sveld 0.36.11 → 0.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,245 +0,0 @@
1
- import{createRequire as ha}from"node:module";var sa=Object.create;var{getPrototypeOf:oa,defineProperty:gr,getOwnPropertyNames:aa}=Object;var Ei=Object.prototype.hasOwnProperty;function ua(i){return this[i]}var ca,pa,de=(i,q,ge)=>{var ye=i!=null&&typeof i==="object";if(ye){var xe=q?ca??=new WeakMap:pa??=new WeakMap,Ce=xe.get(i);if(Ce)return Ce}ge=i!=null?sa(oa(i)):{};let ve=q||!i||!i.__esModule||!Ei.call(i,"default")?gr(ge,"default",{value:i,enumerable:!0}):ge;if(i&&typeof i==="object"||typeof i==="function"){for(let be of aa(i))if(!Ei.call(ve,be))gr(ve,be,{get:ua.bind(i,be),enumerable:!0})}if(ye)xe.set(i,ve);return ve};var s=(i,q)=>()=>(q||i((q={exports:{}}).exports,q),q.exports);var la=(i)=>i;function fa(i,q){this[i]=la.bind(null,q)}var da=(i,q)=>{for(var ge in q)gr(i,ge,{get:q[ge],enumerable:!0,configurable:!0,set:fa.bind(q,ge)})};var k=ha(import.meta.url);class _n{constructor(){this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:()=>this.should_skip=!0,remove:()=>this.should_remove=!0,replace:(i)=>this.replacement=i}}replace(i,q,ge,ye){if(i&&q)if(ge!=null)i[q][ge]=ye;else i[q]=ye}remove(i,q,ge){if(i&&q)if(ge!==null&&ge!==void 0)i[q].splice(ge,1);else delete i[q]}}class yr extends _n{constructor(i,q){super();this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:()=>this.should_skip=!0,remove:()=>this.should_remove=!0,replace:(ge)=>this.replacement=ge},this.enter=i,this.leave=q}visit(i,q,ge,ye){if(i){if(this.enter){let Ce=this.should_skip,ve=this.should_remove,be=this.replacement;if(this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.enter.call(this.context,i,q,ge,ye),this.replacement)i=this.replacement,this.replace(q,ge,ye,i);if(this.should_remove)this.remove(q,ge,ye);let Ee=this.should_skip,ke=this.should_remove;if(this.should_skip=Ce,this.should_remove=ve,this.replacement=be,Ee)return i;if(ke)return null}let xe;for(xe in i){let Ce=i[xe];if(Ce&&typeof Ce==="object"){if(Array.isArray(Ce)){let ve=Ce;for(let be=0;be<ve.length;be+=1){let Ee=ve[be];if(Si(Ee)){if(!this.visit(Ee,i,xe,be))be--}}}else if(Si(Ce))this.visit(Ce,i,xe,null)}}if(this.leave){let Ce=this.replacement,ve=this.should_remove;if(this.replacement=null,this.should_remove=!1,this.leave.call(this.context,i,q,ge,ye),this.replacement)i=this.replacement,this.replace(q,ge,ye,i);if(this.should_remove)this.remove(q,ge,ye);let be=this.should_remove;if(this.replacement=Ce,this.should_remove=ve,be)return null}}return i}}function Si(i){return i!==null&&typeof i==="object"&&"type"in i&&typeof i.type==="string"}function f(i,{enter:q,leave:ge}){return new yr(q,ge).visit(i,null)}function rt(i){return typeof i==="object"&&i!==null}function X(i){return rt(i)&&i.type==="VariableDeclaration"&&Array.isArray(i.declarations)}function x(i){return rt(i)&&i.type==="Literal"}function u(i){return rt(i)&&i.type==="Identifier"&&typeof i.name==="string"}function Q(i){return rt(i)&&i.type==="MemberExpression"}function Pn(i){return rt(i)&&i.type==="ObjectExpression"&&Array.isArray(i.properties)}function ma(i){return rt(i)&&i.type==="CallExpression"}function d(i,q){if(!ma(i))return!1;return!!i.callee&&rt(i.callee)&&i.callee.type==="Identifier"&&i.callee.name===q}function m(i){if(rt(i)&&(i.type==="TSAsExpression"||i.type==="TSSatisfiesExpression")&&"expression"in i)return m(i.expression);return i}function Y(i){if(rt(i)&&(i.type==="TSAsExpression"||i.type==="TSSatisfiesExpression")&&"typeAnnotation"in i)return i.typeAnnotation;return}function ga(i){return rt(i)&&i.type==="NewExpression"}function xr(i,q){if(!ga(i))return!1;return!!i.callee&&rt(i.callee)&&i.callee.type==="Identifier"&&i.callee.name===q}function wn(i){if(!rt(i)||typeof i.type!=="string")return null;if(i.type==="Literal"){let q=i.value;if(typeof q==="string")return q;return q==null?null:String(q)}if(i.type==="TemplateLiteral"){let q=i.quasis;if(q?.length===1){let ge=q[0]?.value?.cooked;return ge==null?null:ge}}return null}var T=Symbol("sveld.parsedComponentTypeScriptMetadata");function zt(i){return i[T]}function ki(i,q){if(q.length===0)return;let ge=new Set(i.props.map((ye)=>ye.name));for(let ye of q){if(ge.has(ye.name))continue;ge.add(ye.name),i.props.push({name:ye.name,kind:"let",constant:!1,type:ye.type,typeSource:"typescript",...ye.description?{description:ye.description}:{},isFunction:ye.type.includes("=>"),isFunctionDeclaration:!1,isRequired:ye.isRequired,reactive:!1})}}var ya=/\w/;function xa(i,q){let ge=i.trim();if(!ge.startsWith("{")||!ge.endsWith("}"))return;let ye=ge.slice(1,-1),xe=[],Ce=0,ve="";for(let be of ye)if(be==="{"||be==="<"||be==="("||be==="[")Ce++,ve+=be;else if(be==="}"||be===">"||be===")"||be==="]")Ce--,ve+=be;else if((be===";"||be===",")&&Ce===0)xe.push(ve.trim()),ve="";else ve+=be;if(ve.trim())xe.push(ve.trim());for(let be of xe){if(!be.startsWith(q))continue;let Ee=be.slice(q.length);if(Ee.length>0&&ya.test(Ee[0]))continue;let ke=Ee.trimStart();if(ke.startsWith("?"))ke=ke.slice(1).trimStart();if(ke.startsWith(":"))return ke.slice(1).trim()}return}function N(i,q,ge){let ye=ge;if(ye.computed||ye.object?.type!=="Identifier"||ye.property?.type!=="Identifier")return;let xe=ye.object.name,Ce=ye.property.name;if(!xe||!Ce)return;if(i.wholePropsLocals.has(xe))return q.getPropTypeByLocalOrPublic(Ce);let ve=q.getPropTypeByLocalOrPublic(xe)??q.findVariableTypeAndDescription(xe)?.type;if(!ve)return;return xa(ve,Ce)}function h(i,q,ge,ye,xe){i.diagnosticRecords.push({component:i.componentFilePath,kind:q,name:ge,message:ye,...xe?{source:xe}:{}})}var Cr=/[\r\n]+/g;function Ca(i){if(i.sourceLineStartOffsetsCache)return i.sourceLineStartOffsetsCache;let q=[0];if(i.source){let ge=i.source.indexOf(`
2
- `);while(ge!==-1)q.push(ge+1),ge=i.source.indexOf(`
3
- `,ge+1)}return i.sourceLineStartOffsetsCache=q,q}function _i(i,q){if(!i.source||q<0||q>i.source.length)return;let ge=Ca(i),ye=0,xe=ge.length-1;while(ye<=xe){let Ce=Math.floor((ye+xe)/2),ve=ge[Ce],be=ge[Ce+1]??Number.POSITIVE_INFINITY;if(q<ve)xe=Ce-1;else if(q>=be)ye=Ce+1;else return{line:Ce+1,column:q-ve}}return}function I(i,q,ge){if(q===void 0||ge===void 0||ge<q)return;let ye=_i(i,q),xe=_i(i,ge);if(!ye||!xe)return;return{start:ye,end:xe}}function n(i,q){if(!q||typeof q!=="object")return;let ge="start"in q&&typeof q.start==="number"?q.start:void 0,ye="end"in q&&typeof q.end==="number"?q.end:void 0;return I(i,ge,ye)}function vr(i,q){if(!q||q.length===0)return;let ge=[...q];while(ge.length>1){let Ee=ge[ge.length-1];if(Ee.tag!==void 0||!Ee.raw.trim().endsWith("*/"))break;ge.pop()}let ye=ge[0],xe=ye.raw.indexOf(`@${ye.tag??""}`),Ce=ye.start+Math.max(xe,0),ve=ge[ge.length-1],be=ve.start+ve.raw.length;return I(i,Ce,be)}function e(i,q,ge){return i.source?.slice(q,ge)}function An(i,q){if(!q||typeof q!=="object")return;let ge="start"in q&&typeof q.start==="number"?q.start:void 0,ye="end"in q&&typeof q.end==="number"?q.end:void 0;if(ge===void 0||ye===void 0)return;return e(i,ge,ye)?.replace(Cr," ")}function p(i){return i===void 0||i===""?void 0:i}function A(i,q,ge,ye){if(p(ge)===void 0)return;if(i.trackPropLocalName(ge),q.props.has(ge)){let xe=q.props.get(ge);q.props.set(ge,{...xe,...ye})}else q.props.set(ge,ye)}function y(i,q,ge,ye=0){let xe,Ce,ve=!1;if(!ge||typeof ge!=="object"||!("type"in ge))return{value:xe,type:Ce,isFunction:ve};let be=wi(i,q,ge);if(ge.type==="ObjectExpression"||ge.type==="BinaryExpression"||ge.type==="ArrayExpression"||ge.type==="ArrowFunctionExpression"||ge.type==="FunctionExpression"){let Ee=ge;if("start"in Ee&&"end"in Ee&&typeof Ee.start==="number"&&typeof Ee.end==="number")xe=e(q,Ee.start,Ee.end)?.replace(Cr," ");if(Ce=xe,ve=ge.type==="ArrowFunctionExpression"||ge.type==="FunctionExpression",ge.type==="BinaryExpression"){let ke=ge;if(ke.left&&typeof ke.left==="object"&&"type"in ke.left&&ke.left.type==="Literal"&&"value"in ke.left&&typeof ke.left.value==="string")Ce="string"}if(ge.type==="ArrowFunctionExpression"||ge.type==="FunctionExpression")Ce=Di(ge),xe=Pi(q,ge)}else if(ge.type==="UnaryExpression"){let Ee=ge;if("start"in Ee&&"end"in Ee&&typeof Ee.start==="number"&&typeof Ee.end==="number")xe=e(q,Ee.start,Ee.end);if(Ee.argument){if(typeof Ee.argument==="object"&&"type"in Ee.argument&&Ee.argument.type==="UnaryExpression")Ce=y(i,q,Ee.argument).type;else if(typeof Ee.argument==="object"&&"value"in Ee.argument)Ce=typeof Ee.argument.value}}else if(ge.type==="NewExpression"){let Ee=ge;if("start"in Ee&&"end"in Ee&&typeof Ee.start==="number"&&typeof Ee.end==="number")xe=e(q,Ee.start,Ee.end);if(Ee.callee&&typeof Ee.callee==="object"&&"type"in Ee.callee&&Ee.callee.type==="Identifier"){let ke=Ee.callee.name;if(ke==="Date")Ce="Date";else if(ke==="Map")Ce="Map<any, any>";else if(ke==="Set")Ce="Set<any>";else if(ke==="WeakMap")Ce="WeakMap<object, any>";else if(ke==="WeakSet")Ce="WeakSet<object>";else if(ke==="Array")Ce="any[]";else if(ke==="RegExp"||ke==="Regexp")Ce="RegExp";else if(ke==="Error")Ce="Error";else Ce=ke}}else if(ge.type==="CallExpression"){let Ee=ge;if("start"in Ee&&"end"in Ee&&typeof Ee.start==="number"&&typeof Ee.end==="number")xe=e(q,Ee.start,Ee.end);let ke=Ee.callee,_e=ke&&typeof ke==="object"&&"type"in ke&&ke.type==="Identifier"?ke.name:void 0;if((_e==="$derived"||_e==="$state")&&Ee.arguments.length===1&&ye<5)return{...y(i,q,Ee.arguments[0],ye+1),value:xe,defaultValue:be};if(_e){let Pe=ba(i,q,_e);if(Pe)return{value:xe,type:void 0,isFunction:!1,defaultValue:be,resolvedType:Pe};if(q.funcDecls.has(_e)||Ea(q,_e))return{value:xe,type:void 0,isFunction:!1,defaultValue:be,pendingCallDefault:{calleeName:_e}};let we=q.valueImportBindingsByLocalName.get(_e);if(we)return{value:xe,type:void 0,isFunction:!1,defaultValue:be,pendingCallDefault:{calleeName:_e,importSource:we.source,importedName:we.importedName}}}return{value:xe,type:void 0,isFunction:!1,defaultValue:be,pendingCallDefault:{calleeName:_e??va(q,ke)}}}else if(ge.type==="Identifier"){let Ee=ge;if(ye<5){let ke=Ai(q,Ee.name);if(ke){let _e=y(i,q,ke,ye+1),Pe=i.resolveLocalVarJSDoc(Ee.name);return{..._e,resolvedType:Pe?.type??_e.resolvedType,resolvedDescription:Pe?.description??_e.resolvedDescription,resolvedParams:Pe?.params??_e.resolvedParams,resolvedReturnType:Pe?.returnType??_e.resolvedReturnType}}if(q.funcDecls.has(Ee.name)){let _e=i.resolveLocalVarJSDoc(Ee.name),Pe=q.funcDecls.get(Ee.name);return{value:Pe?Pi(q,Pe):void 0,type:void 0,isFunction:!0,defaultValue:Pe?wi(i,q,Pe):void 0,resolvedType:_e?.type??Pa(_e,Pe),resolvedDescription:_e?.description,resolvedParams:_e?.params,resolvedReturnType:_e?.returnType}}}if("start"in Ee&&"end"in Ee&&typeof Ee.start==="number"&&typeof Ee.end==="number")xe=e(q,Ee.start,Ee.end)}else if(ge.type==="MemberExpression"){let Ee=ge;if("start"in Ee&&"end"in Ee&&typeof Ee.start==="number"&&typeof Ee.end==="number")xe=e(q,Ee.start,Ee.end);if(i.isNumericConstant(ge))Ce="number"}else if(ge.type==="TemplateLiteral"){let Ee=ge;if("start"in Ee&&"end"in Ee&&typeof Ee.start==="number"&&typeof Ee.end==="number")xe=e(q,Ee.start,Ee.end);Ce="string"}else if("raw"in ge&&typeof ge.raw==="string"){if(xe=ge.raw,"value"in ge)Ce=ge.value==null?void 0:typeof ge.value}return{value:xe,type:Ce,isFunction:ve,defaultValue:be}}function Ai(i,q){for(let ge of i.vars)for(let ye of ge.declarations)if(ye.id&&typeof ye.id==="object"&&"type"in ye.id&&ye.id.type==="Identifier"&&"name"in ye.id&&ye.id.name===q&&ye.init)return ye.init;return}function Ti(i,q){for(let ge of i.vars){if(ge.kind!=="const")continue;for(let ye of ge.declarations)if(ye.id&&typeof ye.id==="object"&&"type"in ye.id&&ye.id.type==="Identifier"&&"name"in ye.id&&ye.id.name===q&&ye.init)return ye.init}return}function va(i,q){if(q&&typeof q==="object"&&"start"in q&&"end"in q&&typeof q.start==="number"&&typeof q.end==="number")return e(i,q.start,q.end)??"call";return"call"}function ba(i,q,ge){let ye=i.resolveLocalVarJSDoc(ge);if(ye?.returnType)return ye.returnType;let xe=q.funcDecls.get(ge)??Ni(q,ge);if(!xe)return;let Ce=_a(q,xe);if(Ce)return Ce;let ve=Sa(q,ge);if(ve)return ve;let be=Ri(xe);return be==="any"?void 0:be}function Ea(i,q){return Ni(i,q)!==void 0}function Ni(i,q){let ge=Ai(i,q);if(!ge||typeof ge!=="object"||!("type"in ge))return;if(ge.type==="ArrowFunctionExpression"||ge.type==="FunctionExpression")return ge;return}function Sa(i,q){for(let ge of i.vars)for(let ye of ge.declarations){let xe=ye.id;if(!xe||typeof xe!=="object"||!("type"in xe)||xe.type!=="Identifier"||!("name"in xe)||xe.name!==q)continue;let Ce=xe.typeAnnotation;if(Ce?.type!=="TSTypeAnnotation")return;let ve=Ce.typeAnnotation;if(!ve||typeof ve.start!=="number"||typeof ve.end!=="number")return;return ka(e(i,ve.start,ve.end))}return}function ka(i){if(!i)return;let q=i.lastIndexOf("=>");if(q===-1)return;return i.slice(q+2).trim()||void 0}function _a(i,q){let ge=q.returnType;if(ge?.type!=="TSTypeAnnotation")return;let ye=ge.typeAnnotation;if(!ye||typeof ye.start!=="number"||typeof ye.end!=="number")return;return e(i,ye.start,ye.end)}function Pa(i,q){let ge=i?.returnType??"any",ye=i?.params;if(ye&&ye.length>0)return`(${ye.map((Ce)=>`${Ce.name}${Ce.optional?"?":""}: ${Ce.type}`).join(", ")}) => ${ge}`;if(i?.returnType)return`() => ${ge}`;if(q)return Di(q);return"(...args: any[]) => any"}function Di(i){return`(${wa(i)}) => ${Ri(i)}`}function wa(i){let q=i.params;if(!Array.isArray(q)||q.length===0)return"...args: any[]";let ge=[];for(let ye of q)if(ye&&typeof ye==="object"&&"type"in ye&&ye.type==="Identifier"&&"name"in ye&&typeof ye.name==="string")ge.push(`${ye.name}: any`);else return"...args: any[]";return ge.join(", ")}function Ri(i){if(i.async||i.generator)return"any";let q=i.body,ge;if(q&&typeof q==="object"&&"type"in q&&q.type==="BlockStatement"){if(ge=Aa(q),ge.length===0)return"any"}else ge=[q];let ye=null;for(let xe of ge){let Ce=Ta(xe);if(!Ce)return"any";if(ye===null)ye=Ce;else if(ye!==Ce)return"any"}return ye??"any"}function Aa(i){let q=[];return f(i,{enter(ge){if(ge.type==="FunctionDeclaration"||ge.type==="FunctionExpression"||ge.type==="ArrowFunctionExpression"){this.skip();return}if(ge.type==="ReturnStatement")q.push(ge.argument??null)}}),q}function Ta(i){if(!i||typeof i!=="object"||!("type"in i))return null;switch(i.type){case"Literal":{let q=i.value;if(typeof q==="string")return"string";if(typeof q==="number")return"number";if(typeof q==="boolean")return"boolean";return null}case"TemplateLiteral":return"string";case"CallExpression":{let q=i.callee;if(q&&typeof q==="object"&&"type"in q&&q.type==="Identifier"){let ge=q.name;if(ge==="String")return"string";if(ge==="Number")return"number";if(ge==="Boolean")return"boolean"}return null}default:return null}}function Z(i){if(d(i,"$bindable"))return{init:i.arguments[0],bindable:!0};return{init:i,bindable:!1}}function Na(i,q){let ge=q.params;if(!Array.isArray(ge)||ge.length===0)return"";let ye=ge[0],xe=ge[ge.length-1];if(typeof ye.start!=="number"||typeof xe.end!=="number")return"";return e(i,ye.start,xe.end)??""}function Pi(i,q){if(q.generator)return;let ge=q.body;if(!ge||typeof ge!=="object"||!("type"in ge))return;let ye=Na(i,q),xe=q.async?"async ":"",Ce=(be,Ee)=>be&&typeof be==="object"&&("type"in be)&&be.type==="ObjectExpression"?`(${Ee})`:Ee;if(ge.type!=="BlockStatement"){let be=An(i,ge);return be===void 0?void 0:`${xe}(${ye}) => ${Ce(ge,be)}`}let ve=ge.body;if(ve.length===0)return`${xe}(${ye}) => {}`;if(ve.length===1){let be=ve[0];if(be&&typeof be==="object"&&"type"in be&&be.type==="ReturnStatement"){let Ee=be.argument;if(Ee){let ke=An(i,Ee);if(ke!==void 0)return`${xe}(${ye}) => ${Ce(Ee,ke)}`}}}return}function wi(i,q,ge){let ye=An(q,ge);if(!ye||!ge||typeof ge!=="object"||!("type"in ge))return;let xe="expression";if(ge.type==="Literal"||ge.type==="UnaryExpression")xe="literal";else if(ge.type==="TemplateLiteral")xe=ge.expressions.length===0?"literal":"expression";else if(ge.type==="ArrayExpression")xe="array";else if(ge.type==="ObjectExpression")xe="object";else if(ge.type==="ArrowFunctionExpression"||ge.type==="FunctionExpression"||ge.type==="FunctionDeclaration")xe="function";let Ce={raw:ye,kind:xe};if(xe==="literal"||xe==="array"||xe==="object"){let ve=br(i,ge);if(ve.ok)Ce.value=ve.value}return Ce}function br(i,q){if(!q||typeof q!=="object"||!("type"in q))return{ok:!1};if(q.type==="Literal"){let ge=q.value;return typeof ge==="bigint"?{ok:!1}:{ok:!0,value:ge}}if(q.type==="UnaryExpression"){let ge=q,ye=ge.argument;if(!ye||typeof ye!=="object"||!("type"in ye)||ye.type!=="Literal")return{ok:!1};let xe=ye.value;if(typeof xe==="number"){if(ge.operator==="-")return{ok:!0,value:-xe};if(ge.operator==="+")return{ok:!0,value:xe}}if(typeof xe==="boolean"&&ge.operator==="!")return{ok:!0,value:!xe};return{ok:!1}}if(q.type==="TemplateLiteral"){let ge=q;if(ge.expressions.length>0||ge.quasis.length!==1)return{ok:!1};return{ok:!0,value:ge.quasis[0].value.cooked??ge.quasis[0].value.raw}}if(q.type==="ArrayExpression"){let ge=q,ye=[];for(let xe of ge.elements){if(!xe)return{ok:!1};let Ce=br(i,xe);if(!Ce.ok)return{ok:!1};ye.push(Ce.value)}return{ok:!0,value:ye}}if(q.type==="ObjectExpression"){let ge=q,ye={};for(let xe of ge.properties){if(xe.type!=="Property"||xe.computed)return{ok:!1};let Ce=i.getPropertyName(xe.key);if(!Ce)return{ok:!1};let ve=br(i,xe.value);if(!ve.ok)return{ok:!1};ye[Ce]=ve.value}return{ok:!0,value:ye}}return{ok:!1}}var Da=/[-_.:/\s]+/;function on(i){return`${i.split(Da).map((ye)=>ye.charAt(0).toUpperCase()+ye.slice(1)).join("")}Context`}function Ii(i,q,ge,ye){if(!ge||typeof ge!=="object"||!("type"in ge))return null;if(ge.type==="ObjectExpression"){let xe=[];if(!Pn(ge))return null;let Ce=ge;for(let ve of Ce.properties){if(ve.type!=="Property")continue;let be=q.getPropertyName(ve.key);if(!be)continue;let Ee="any",ke;if(u(ve.value)){let _e=ve.value.name,Pe=q.findVariableTypeAndDescription(_e);if(Pe)Ee=Pe.type,ke=Pe.description;else h(i,"context-any-type",be,`Context "${ye}" property "${be}" has no type annotation; defaulted to "any".`,n(i,ve))}else if(ve.value&&typeof ve.value==="object"&&"type"in ve.value&&(ve.value.type==="ArrowFunctionExpression"||ve.value.type==="FunctionExpression"))Ee=`(${ve.value.params?.map((we)=>{if(u(we))return`${we.name||"arg"}: any`;return"arg: any"}).join(", ")||""}) => any`;else if(x(ve.value))Ee=ve.value.value==null?"null":typeof ve.value.value;xe.push({name:be,type:Ee,description:ke,optional:!1})}return{key:ye,typeName:on(ye),properties:xe,description:void 0}}else if(u(ge)){let xe=ge.name,Ce=q.findVariableTypeAndDescription(xe);if(Ce)return{key:ye,typeName:on(ye),properties:[{name:xe,type:Ce.type,description:Ce.description,optional:!1}]};return h(i,"context-any-type",xe,`Context "${ye}" variable "${xe}" has no type annotation; defaulted to "any".`,n(i,ge)),{key:ye,typeName:on(ye),properties:[{name:xe,type:"any",description:void 0,optional:!1}]}}return null}function Oi(i){let q=i.callee;if(!q||typeof q!=="object"||!("type"in q))return null;let ge=q.type==="Identifier"&&q.name==="Symbol",ye=q.type==="MemberExpression"&&!q.computed&&q.object.type==="Identifier"&&q.object.name==="Symbol"&&q.property.type==="Identifier"&&q.property.name==="for";if(!ge&&!ye)return null;let xe=i.arguments[0];if(!xe||typeof xe!=="object"||!("type"in xe))return"";if(xe.type==="Literal"&&typeof xe.value==="string")return xe.value;if(xe.type==="TemplateLiteral"&&xe.quasis?.length===1)return xe.quasis[0].value.cooked??"";return""}function Li(i,q,ge=0){if(!q||typeof q!=="object"||!("type"in q))return{kind:"unresolved"};let ye=q;if(ye.type==="Literal"||ye.type==="TemplateLiteral"){let xe=wn(ye);return xe==null?{kind:"unresolved"}:{kind:"resolved",key:xe}}if(ye.type==="CallExpression"||ye.type==="NewExpression"){let xe=Oi(ye);return xe==null?{kind:"unresolved"}:{kind:"resolved",key:xe}}if(ye.type==="Identifier"){if(ge>=5)return{kind:"unresolved"};let xe=Ti(i,ye.name);if(xe&&typeof xe==="object"&&"type"in xe){let ve=xe;if((ve.type==="CallExpression"||ve.type==="NewExpression")&&Oi(ve)==="")return{kind:"resolved",key:ye.name};return Li(i,ve,ge+1)}let Ce=i.valueImportBindingsByLocalName.get(ye.name);if(Ce)return{kind:"pending",importSource:Ce.source,importedName:Ce.importedName};return{kind:"unresolved"}}return{kind:"unresolved"}}function K(i,q,ge,ye){if(!ge||typeof ge!=="object"||!("type"in ge)||ge.type!=="CallExpression")return;let xe=ge,Ce=xe.arguments[0];if(!Ce)return;let ve=Li(i,Ce);if(ve.kind==="unresolved"||ve.kind==="resolved"&&!ve.key){let _e=i.componentFilePath?` in ${i.componentFilePath}`:"";console.warn(`Warning: Could not resolve setContext key${_e}. Use a string literal, const-bound string, or Symbol(). Skipping context type generation.`);return}let be=xe.arguments[1];if(!be)return;if(ve.kind==="pending"){let _e=Ii(i,q,be,"");if(_e)i.pendingContextKeyCandidates.push({importSource:ve.importSource,importedName:ve.importedName,properties:_e.properties,description:_e.description});return}let Ee=ve.key,ke=Ii(i,q,be,Ee);if(ke&&!i.contexts.has(Ee))i.contexts.set(Ee,ke)}function F(i){return typeof i==="string"?JSON.stringify(i):String(i)}function v(i,{name:q,detail:ge,has_argument:ye,description:xe,deprecated:Ce,tags:ve,source:be}){if(q===void 0)return;let Ee=!ye&&!ge?"null":p(ge),ke=xe,_e=i.events.get(q);if(_e?.type==="forwarded")i.events.set(q,{type:"dispatched",name:q,detail:Ee,description:ke||_e.description,deprecated:Ce??_e.deprecated,tags:ve??_e.tags,source:be||_e.source});else if(_e){let Pe=_e.tags??ve;i.events.set(q,{..._e,detail:_e.detail===void 0?Ee:_e.detail,description:_e.description||ke,deprecated:_e.deprecated??Ce,tags:Pe,source:be||_e.source})}else i.events.set(q,{type:"dispatched",name:q,detail:Ee,description:ke,deprecated:Ce,tags:ve,source:be})}function ee(i,q){let ge=q.arguments[0],ye=xr(ge,"CustomEvent");if(!ye&&!xr(ge,"Event"))return;let xe=ge.arguments[0],Ce=x(xe)?xe.value:void 0;if(Ce==null)return;let ve=ye?ge.arguments[1]:void 0,be=!1,Ee;if(Pn(ve)){let ke=ve.properties.find((_e)=>_e.type==="Property"&&u(_e.key)&&_e.key.name==="detail");if(ke?.type==="Property")be=!0,Ee=x(ke.value)?ke.value.value:void 0}return v(i,{name:String(Ce),detail:Ee==null?"":F(Ee),has_argument:be,source:n(i,q)}),String(Ce)}function Er(i,q,ge=!1){if(i.length===0)return"null";let ye=i.map(({name:xe,type:Ce,description:ve,optional:be,default:Ee})=>{let ke=be?"?":"",_e=ve||"";if(Ee&&_e)_e=`${_e} @default ${Ee}`;else if(Ee)_e=`@default ${Ee}`;if(_e){if(ge)return`/** ${_e} */
4
- ${xe}${ke}: ${Ce};`;return`/** ${_e} */ ${xe}${ke}: ${Ce};`}return`${xe}${ke}: ${Ce};`}).join(ge?`
5
- `:" ");return ge?`{
6
- ${ye}
7
- }`:`{ ${ye} }`}var Ra=/[A-Za-z_$][\w$]*/g;function Ia(i,q){if(!q)return!1;let ge=new Set(q[0].split(",").map((ye)=>ye.trim()));for(let[ye]of i.matchAll(Ra))if(ge.has(ye))return!0;return!1}function V(i,q){if(q===void 0)return;return i.runesPropsDeclarationMetadataByDeclaratorStart.get(q)}function te(i,q,ge){return V(i,q)?.props.get(ge)}function re(i){if(!i||typeof i!=="object"||!("type"in i))return;if(i.type==="Identifier"&&"name"in i&&typeof i.name==="string")return i.name;if(i.type==="TSQualifiedName"&&"right"in i&&i.right&&typeof i.right==="object"&&"name"in i.right&&typeof i.right.name==="string")return i.right.name;return}function $i(i){if(!i||typeof i!=="object"||!("type"in i))return;if(i.type==="Identifier"&&"name"in i&&typeof i.name==="string")return i.name;if(i.type==="TSQualifiedName"&&"left"in i&&i.left&&typeof i.left==="object")return $i(i.left);return}function L(i,q){let ge=q?.start,ye=q?.end;if(ge===void 0||ye===void 0)return;return e(i,ge+1,ye)?.trim()}function ne(i,q){let ge=q?.start,ye=q?.end;if(ge===void 0||ye===void 0)return;return e(i,ge,ye)?.trim()}function l(i,q,ge,ye,xe=new Set){if(!q?.type)return;switch(q.type){case"TSInterfaceDeclaration":l(i,{type:"TSTypeLiteral",members:q.body?.body},ge,ye,xe);return;case"TSTypeAliasDeclaration":case"TSParenthesizedType":case"TSTypeAnnotation":l(i,q.typeAnnotation,ge,ye,xe);return;case"TSIntersectionType":case"TSUnionType":for(let Ce of q.types??[])l(i,Ce,ge,ye,xe);return;case"TSTypeLiteral":for(let Ce of q.members??[]){if(Ce?.type!=="TSPropertySignature")continue;l(i,Ce.typeAnnotation?.typeAnnotation,ge,ye,xe)}return;case"TSTypeReference":{let Ce=$i(q.typeName);if(Ce){if(i.typeImportBindingsByLocalName.has(Ce))ge.add(Ce);let ve=i.localTypeDeclarationsByName.get(Ce);if(ve&&!xe.has(Ce))ye.add(Ce),xe.add(Ce),l(i,ve.node,ge,ye,xe),xe.delete(Ce)}if("typeParameters"in q&&q.typeParameters&&typeof q.typeParameters==="object"){let ve=q.typeParameters;for(let be of ve.params??[])l(i,be,ge,ye,xe)}return}case"TSArrayType":case"TSRestType":case"TSOptionalType":case"TSIndexedAccessType":case"TSTypeOperator":case"TSExpressionWithTypeArguments":case"TSTupleType":case"TSConditionalType":case"TSInferType":case"TSMappedType":case"TSFunctionType":case"TSConstructorType":case"TSTypeQuery":case"TSImportType":case"TSLiteralType":case"TSTypePredicate":case"TSNamedTupleMember":break;default:break}for(let Ce of Object.values(q)){if(!Ce||typeof Ce!=="object")continue;if(Array.isArray(Ce)){for(let ve of Ce){if(!ve||typeof ve!=="object"||!("type"in ve))continue;l(i,ve,ge,ye,xe)}continue}if("type"in Ce)l(i,Ce,ge,ye,xe)}}function Oa(i,q){let ge=new Map;for(let ye of Array.from(q).sort()){let xe=i.typeImportBindingsByLocalName.get(ye);if(!xe)continue;let Ce=ge.get(xe.source)??{default:[],named:[],namespace:[]};if(xe.specifierType==="default")Ce.default.push(xe.localName);else if(xe.specifierType==="namespace")Ce.namespace.push(xe.localName);else Ce.named.push({imported:xe.importedName,local:xe.localName});ge.set(xe.source,Ce)}return Array.from(ge.entries()).sort(([ye],[xe])=>ye.localeCompare(xe)).map(([ye,xe])=>{if(xe.namespace.length>0)return xe.namespace.map((Ee)=>`import type * as ${Ee} from "${ye}";`).join(`
8
- `);let Ce=xe.named.map(({imported:Ee,local:ke})=>{if(!Ee||Ee===ke)return ke;return`${Ee} as ${ke}`}),ve=xe.default[0],be=Ce.length>0?`{ ${Ce.join(", ")} }`:"";if(ve&&be)return`import type ${ve}, ${be} from "${ye}";`;if(ve)return`import type ${ve} from "${ye}";`;return`import type ${be} from "${ye}";`})}function ie(i){let q=i.pendingCallDefaultCandidates.length>0?i.pendingCallDefaultCandidates.slice():void 0,ge=i.pendingContextKeyCandidates.length>0?i.pendingContextKeyCandidates.slice():void 0,ye={...q?{pendingCallDefaultCandidates:q}:{},...ge?{pendingContextKeyCandidates:ge}:{}},xe=q!==void 0||ge!==void 0;if(i.typedRunesPropsDeclarations.length!==1)return xe?{canonicalPropNames:[],localTypeDeclarations:[],typeImportStatements:[],...ye}:void 0;let[Ce]=i.typedRunesPropsDeclarations;if(!Ce.canonicalType)return xe?{canonicalPropNames:[],localTypeDeclarations:[],typeImportStatements:[],...ye}:void 0;let ve=Array.from(Ce.referencedLocalTypes).map((be)=>i.localTypeDeclarationsByName.get(be)).filter((be)=>be!==void 0).sort((be,Ee)=>be.start-Ee.start).map((be)=>be.code);return{canonicalPropsType:Ce.canonicalType,canonicalPropNames:Array.from(Ce.props.keys()).sort(),localTypeDeclarations:ve,typeImportStatements:Oa(i,Ce.referencedImportedTypes),referencesComponentGenerics:Ia(Ce.canonicalType,i.generics),...ye}}var La=/^[A-Za-z_$][\w$]*/,$a=/[A-Za-z_$][\w$]*/g,Fi=/^(?:const|in|out)\s+/;function an(i){let q=[],ge=0,ye=0;for(let xe=0;xe<i.length;xe++){let Ce=i[xe];if(Ce==="<"||Ce==="("||Ce==="["||Ce==="{")ge++;else if(Ce===">"||Ce===")"||Ce==="]"||Ce==="}")ge=Math.max(ge-1,0);else if(Ce===","&&ge===0)q.push(i.slice(ye,xe)),ye=xe+1}return q.push(i.slice(ye)),q}function se(i){let q=an(i).map((ye)=>ye.trim()).filter((ye)=>ye.length>0);if(q.length===0)return null;return[q.map((ye)=>{let xe=ye;while(Fi.test(xe))xe=xe.replace(Fi,"");return xe.match(La)?.[0]??ye}).join(", "),q.join(", ")]}function oe(i,q,ge){let ye=i.scriptGenericsAttribute?.value;if(!ye)return;for(let[xe]of ye.matchAll($a)){if(i.typeImportBindingsByLocalName.has(xe))q.add(xe);if(ge.has(xe))continue;let Ce=i.localTypeDeclarationsByName.get(xe);if(!Ce)continue;ge.add(xe),l(i,Ce.node,q,ge)}}var Fa=null;function Ba(i,q,ge){let ye={value:void 0,replace:!1};if(!ge||typeof ge!=="object"||!("type"in ge))return ye;if(ge.type==="Identifier")ye.value=ge.name,ye.replace=!0;else if(ge.type==="Literal")ye.value=String(ge.value);else if(ge.type==="MemberExpression")ye.value=N(i,q,ge);else if((ge.type==="ObjectExpression"||ge.type==="TemplateLiteral")&&"start"in ge&&"end"in ge&&typeof ge.start==="number"&&typeof ge.end==="number")ye.value=e(i,ge.start,ge.end);return ye}function ae(i,q,ge){let ye={};for(let xe of ge.properties){if(xe.type!=="Property"||xe.computed)continue;let Ce=q.getPropertyName(xe.key);if(!Ce)continue;ye[Ce]=Ba(i,q,xe.value)}return ye}function Ma(i,q){if(!q||typeof q!=="object"||!("type"in q))return null;if(q.type==="Identifier"){let Ce=q,ve=i.propLocalToPublicName.get(Ce.name);if(!ve)return null;return{publicName:ve,trackingName:Ce.name}}if(q.type!=="MemberExpression")return null;let ge=q,ye=ge.object&&typeof ge.object==="object"&&"type"in ge.object&&ge.object.type==="Identifier"?ge.object.name:void 0;if(!ye||!i.wholePropsLocals.has(ye))return null;let xe;if(!ge.computed&&ge.property&&typeof ge.property==="object"&&"type"in ge.property){if(ge.property.type==="Identifier")xe=ge.property.name;else if(ge.property.type==="Literal"&&ge.property.value!=null)xe=String(ge.property.value)}else if(ge.computed&&ge.property&&typeof ge.property==="object"&&"type"in ge.property&&ge.property.type==="Literal"&&"value"in ge.property&&ge.property.value!=null)xe=String(ge.property.value);if(!xe)return null;return{publicName:xe,trackingName:xe}}function ce(i,q){let ge=q;if(ge&&typeof ge==="object"&&"type"in ge&&ge.type==="ChainExpression")ge=ge.expression;if(!ge||typeof ge!=="object"||!("type"in ge)||ge.type!=="CallExpression")return null;let ye=ge;if(!ye.callee||typeof ye.callee!=="object"||!("type"in ye.callee))return null;let xe=Ma(i,ye.callee);if(!xe)return null;return{...xe,arguments:ye.arguments}}function _(i,{slot_name:q,slot_props:ge,slot_fallback:ye,slot_description:xe,slot_deprecated:Ce,slot_tags:ve,source:be}){let Ee=q===void 0||q==="",ke=Ee?Fa:q??"",_e=p(ye),Pe=ge===void 0||ge===""?void 0:ge,we=xe?.trim()||void 0;if(i.slots.has(ke)){let Te=i.slots.get(ke);if(Te)i.slots.set(ke,{...Te,default:Te.default??Ee,fallback:_e,slot_props:Te.slot_props===void 0?Pe:Te.slot_props,description:Te.description||we,deprecated:Te.deprecated??Ce,tags:Te.tags||ve,source:be||Te.source})}else i.slots.set(ke,{name:ke,default:Ee,fallback:_e,slot_props:ge,description:we,deprecated:Ce,tags:ve,source:be})}var Sr=/^\s+/,Mi=/\s/,ja=/^@[^\s/]+(?=\s|$)/,Va=/^@(\S+)\s*/;function Bi(i){let q=0;while(q<i.length){let ge=i.charCodeAt(q);if(ge!==32&&ge!==9&&ge!==13&&ge!==10&&!Mi.test(i[q]))break;q++}return q}function Ga(i,q){let ge=i.slice(Bi(i)),ye=!1;if(q)ge=ge.slice(3),ye=!0;else if(ge.startsWith("*")&&!ge.startsWith("*/"))ge=ge.slice(1),ye=!0;let xe=ge.slice(0,Bi(ge));ge=ge.slice(xe.length);let Ce=ge.trimEnd(),ve=Ce.endsWith("*/")?Ce.slice(0,-2):ge;return{indent:ye?xe.slice(1):xe,separator:xe,content:ve}}function Ha(i,q,ge){let ye=ge>q&&i.charCodeAt(ge-1)===13?ge-1:ge;return i.slice(q,ye)}function Wa(i){let q=[],ge=0;while(!0){let ye=i.indexOf("/**",ge);if(ye===-1)break;let xe=i.lastIndexOf(`
9
- `,ye-1)+1;if(i.charCodeAt(ye+3)===42||i.slice(xe,ye).trim()!==""){ge=ye+1;continue}let Ce=[],ve=xe,be=!1;while(ve<=i.length){let Ee=i.indexOf(`
10
- `,ve),ke=Ee===-1?i.length:Ee,_e=Ha(i,ve,ke),{indent:Pe,separator:we,content:Te}=Ga(_e,Ce.length===0);if(Ce.push({raw:_e,start:ve,number:Ce.length,indent:Pe,separator:we,content:Te}),_e.trimEnd().endsWith("*/")){be=!0,ge=ke;break}if(Ee===-1)break;ve=Ee+1}if(!be)break;q.push({start:ye,lines:Ce})}return q}function Ua(i){let q=i;if(q.length>0&&q[0].content==="")q=q.slice(1);if(q.length>0&&q[q.length-1].content==="")q=q.slice(0,-1);return q}function Ka(i){let q=[[]],ge=!1;for(let ye of i){if(ja.test(ye.content)&&!ge)q.push([ye]);else q[q.length-1].push(ye);if(qa(ye.content,"```")%2===1)ge=!ge}return q}function qa(i,q){let ge=0,ye=i.indexOf(q);while(ye!==-1)ge++,ye=i.indexOf(q,ye+q.length);return ge}function ji(i){return i.map((q)=>q.indent+q.content).join(`
11
- `)}function Ja(i,q){let ge=q;while(ge<i.length-1&&i[ge].content.trim()==="")ge++;if(i[ge].content[0]!=="{")return null;let ye=0,xe=[],Ce=ge;for(;Ce<i.length;Ce++){let Ee=i[Ce].content,ke=0;for(let _e of Ee){if(_e==="{")ye++;else if(_e==="}")ye--;if(ke++,ye===0)break}if(xe.push(ke),ye===0)break}if(ye!==0)return null;let ve=Ce;return{type:xe.map((Ee,ke)=>{let _e=ge+ke,Pe=i[_e].content.slice(0,Ee);return i[_e].content=i[_e].content.slice(Ee).replace(Sr,""),ke===0?Pe:i[_e].indent+Pe}).join(`
12
- `).slice(1,-1),endIndex:ve}}function za(i){let q=i.content.match(Sr)?.[0]??"",ge=i.content.slice(q.length),ye=0,xe=0;for(let ke of ge){if(ye===0&&Mi.test(ke))break;if(ke==="[")ye++;if(ke==="]")ye--;xe++}let Ce=ye===0?ge.slice(0,xe):"";if(!Ce)return null;let ve=Ce,be=!1,Ee;if(Ce.startsWith("[")&&Ce.endsWith("]")){be=!0;let _e=Ce.slice(1,-1).split("=");if(ve=_e[0].trim(),_e.length>1)Ee=_e.slice(1).join("=").trim();if(!ve)return null}if(ve.length>1&&(ve[0]==='"'||ve[0]==="'")&&ve[ve.length-1]===ve[0])ve=ve.slice(1,-1);return i.content=ge.slice(xe).replace(Sr,""),{name:ve,optional:be,default:Ee}}function Xa(i){let q=i[0],ge=q.content.match(Va),ye=ge?ge[1]:"",xe=ge?q.content.slice(ge[0].length):q.content,Ce=xe.trimEnd(),ve=i.slice(1).map((Te)=>Te.separator+Te.content),be=(Ce?[Ce,...ve]:ve).join(`
13
- `);q.content=xe,q.tag=ye;let Ee=Ja(i,0),ke=Ee?.type??"",_e=0;if(Ee){_e=Ee.endIndex;while(_e<i.length-1&&i[_e].content.trim()==="")_e++}let Pe=za(i[_e]),we=ji(i.slice(Ee?Ee.endIndex:0));return{tag:ye,name:Pe?.name??"",type:ke,optional:Pe?.optional??!1,default:Pe?.default,description:we,raw:be,lines:i}}function Qa(i,q){let ge=Ua(i);ge.forEach((Ce,ve)=>{Ce.number=ve});let ye=Ka(ge),xe=ye.slice(1).map(Xa);return{description:ji(ye[0]),tags:xe,start:q,lines:ge}}function w(i){return Wa(i).map(({start:q,lines:ge})=>Qa(ge,q))}var Ya=/\s*=\s*/;function Vi(i){let q=i.indexOf("<");if(q===-1||!i.endsWith(">"))return i;let ge=i.slice(0,q),ye=i.slice(q+1,-1),xe=an(ye).map((Ce)=>Ce.trim().replace(Ya," = ")).join(", ");return`${ge}<${xe}>`}var U=/^\s*$/,Za=/;$/,eu=/^-\s*/;function jt(i){if(i===void 0)return;let q=i.replace(eu,"").trim();return q===""?"":q}function un(i){if(!i||i.length===0)return;return i[0].content}var Gi=new Set(["since","example"]);function tu(i){let q=i.trim();return q===""?!0:q}function Hi(i,q){return tu(`${i??""}${q?` ${q}`:""}`)}function nu(i){let q=i.trim().replace(Za,"").trimEnd();if(!q.startsWith("{")||!q.endsWith("}"))return!1;let ge=0,ye=null;for(let xe=0;xe<q.length;xe++){let Ce=q[xe];if(ye!==null){if(Ce==="\\"){xe++;continue}if(Ce===ye)ye=null;continue}if(Ce==='"'||Ce==="'"||Ce==="`"){ye=Ce;continue}if(Ce==="{"||Ce==="["||Ce==="(")ge++;else if(Ce==="}"||Ce==="]"||Ce===")"){if(ge--,ge===0&&xe<q.length-1)return!1}}return ge===0}function Wi(i){let q=i;if(!q.startsWith("/*"))q=`/*${q}`;if(!q.endsWith("*/"))q+="*/";return q}function ru(i){if(i==="*")return"any";return i.trim()}function Ui(i){let q=w(Wi(i)),{returns:ge}=R(q);return ge?ru(ge.type):void 0}function R(i){let q=i[0]?.tags??[],ge=new Set(["type","param","returns","return","extends","extendProps","restProps","slot","snippet","event","typedef","callback","bindable","deprecated"]),ye,xe=[],Ce,ve,be,Ee=[],ke=[];for(let _e of q)if(_e.tag==="type")ye=_e;else if(_e.tag==="param")xe.push(_e);else if(_e.tag==="returns"||_e.tag==="return")Ce=_e;else if(_e.tag==="deprecated")be??=Hi(_e.name,_e.description);else if(Gi.has(_e.tag))ke.push(_e);else if(_e.tag==="bindable"){if(_e.type)continue;let Pe=`${_e.name}${_e.description?` ${_e.description}`:""}`.trim();if(Pe==="readonly"||Pe==="writable")ve??=Pe}else if(!ge.has(_e.tag))Ee.push(_e);return{type:ye,param:xe,returns:Ce,binding:ve,deprecated:be,additional:Ee,passthrough:ke,description:i[0]?.description}}function iu(i){if(!i||i.length===0)return;let q=i[i.length-1];return q&&typeof q==="object"&&"value"in q?q:void 0}function su(i,q,ge){if(!q||q.length===0||ge===void 0||!i.source)return;for(let ye=q.length-1;ye>=0;ye--){let xe=q[ye];if(!xe||typeof xe!=="object"||!("value"in xe)||!("end"in xe))continue;if(typeof xe.end!=="number")continue;let Ce=i.source.slice(xe.end,ge);if(U.test(Ce))return xe}return}function g(i,q,ge){if(!ge?.leadingComments)return;let ye=su(i,ge.leadingComments,ge.start);if(!ye)return;return ou(q,[ye])}function ue(i,q,ge){if(!ge?.leadingComments)return;return g(i,q,ge)}function ou(i,q){if(!q)return;let ge=iu(q);if(!ge)return;let ye=w(Wi(ge.value)),{type:xe,param:Ce,returns:ve,binding:be,deprecated:Ee,additional:ke,passthrough:_e,description:Pe}=R(ye),we,Te,Ne,Oe;if(xe)we=i.aliasType(xe.type);if(Ce.length>0)Te=Ce.filter((De)=>!De.name.includes(".")).map((De)=>({name:De.name,type:i.aliasType(De.type),description:jt(De.description),optional:De.optional||!1}));if(ve)Ne=i.aliasType(ve.type);let Ae=p(Pe?.trim());if(Ae||ke.length>0){let De=[];if(Ae)De.push(Ae);for(let Fe of ke){let je=`@${Fe.tag}${Fe.name?` ${Fe.name}`:""}${Fe.description?` ${Fe.description}`:""}`;De.push(je)}Oe=De.join(`
14
- `)}let $e=_e.length>0?_e.map((De)=>({name:De.tag,body:De.raw})):void 0;return{type:we,params:Te,returnType:Ne,description:Oe,binding:be,deprecated:Ee,tags:$e}}function pe(i,q,ge=i.source){if(!ge)return;for(let{tags:ye,description:xe,lines:Ce}of w(ge)){let ve,be,Ee,ke,_e,Pe,we=[],Te=[],Ne,Oe,Ae,$e=[],De,Fe,je=[],ze,Xe=!1,He=!0,Ye=[],et,pt=new Map,Ue=new Set,Ve=new Set;for(let Be of ye)if(Be.lines.length>0)Ue.add(Be.lines[0].number);for(let Be of Ce)if(!Be.tag&&Be.content&&Be.content.trim()!=="}")pt.set(Be.number,Be.content);let Ze=(Be)=>{if(!Be||Be.length===0)return;let st=Be[0].number,Je=[],ft=[],At=!1;for(let Ke=st-1;Ke>=0;Ke--){if(Ue.has(Ke))break;let dt=pt.get(Ke);if(dt)Je.unshift(dt),ft.unshift(Ke),At=!0;else if(At){let tt=Ce[Ke];if(!(!tt||!tt.tag&&(!tt.content||tt.content.trim()==="")))break}}if(Je.length===0)return;for(let Ke of ft)Ve.add(Ke);return Je.join(`
15
- `).trim()},at=()=>{if(ve!==void 0){let Be=be&&be!=="object"&&be!=="Object"?be:void 0,st;if(Be)st=Be;else if(Te.length>0)st=Er(Te,ve,!0);else st=be||"";if(Pe!==void 0){let Je;for(let Ke of ye){let dt=Ke.lines[0]?.number;if(typeof dt!=="number")continue;if(dt<=Pe)continue;if(Ke.tag==="property"||Ke.tag==="type")continue;Je=dt;break}let ft=[],At=Array.from(pt.keys()).sort((Ke,dt)=>Ke-dt);for(let Ke of At){if(Ke<=Pe)continue;if(Je!==void 0&&Ke>=Je)continue;if(Ve.has(Ke))continue;let tt=pt.get(Ke)?.trim();if(tt)ft.push(tt),Ve.add(Ke)}if(ft.length>0){let Ke=ft.join(`
16
- `);Ee=Ee?`${Ee}
17
- ${Ke}`:Ke}}v(i,{name:ve,detail:st,has_argument:!1,description:Ee,deprecated:ke,tags:we.length>0?we:void 0,source:_e}),i.eventDescriptions.set(ve,Ee),i.jsDocEventNames.add(ve),i.jsDocEventSources.set(ve,_e),Te.length=0,ve=void 0,be=void 0,Ee=void 0,ke=void 0,_e=void 0,Pe=void 0,we=[]}},lt=()=>{if(Ne!==void 0){let Be,st;if($e.length>0)Be=Er($e,void 0,!0),st=`type ${Ne} = ${Be};`;else if(Oe)Be=Oe,st=nu(Be)?`interface ${Ne} ${Be}`:`type ${Ne} = ${Be};`;else Be="{}",st=`type ${Ne} = ${Be};`;i.typedefs.set(Ne,{type:Be,name:Ne,description:p(Ae),ts:st}),$e.length=0,Ne=void 0,Oe=void 0,Ae=void 0}},fr=()=>{if(De!==void 0){let Je=`(${je.map(({name:At,type:Ke,optional:dt})=>`${At}${dt?"?":""}: ${Ke}`).join(", ")}) => ${ze||"void"}`,ft=`type ${De} = ${Je};`;i.typedefs.set(De,{type:Je,name:De,description:p(Fe),ts:ft}),je.length=0,ze=void 0,De=void 0,Fe=void 0}},dr=ye.some((Be)=>Be.tag==="slot"||Be.tag==="snippet"),hr=ye.some((Be)=>Be.tag==="extends"||Be.tag==="extendProps");for(let{tag:Be,type:st,name:Je,description:ft,optional:At,default:Ke,raw:dt,lines:tt}of ye){let ht=q.aliasType(st),sn=Ze(tt);switch(Be){case"extends":case"extendProps":if(i.extends={interface:Je,import:ht},He)He=!1;break;case"restProps":{let nt=Je?ft?`${Je} ${ft}`:Je:ft,mr=jt(nt)||sn;if(!mr&&He&&!Xe&&xe)mr=xe,Xe=!0;if(i.rest_props={type:"Element",name:ht,description:mr||void 0},He)He=!1;break}case"slot":case"snippet":{let Jt=jt(un(tt));if(!Jt&&He&&!Xe&&xe)Jt=xe,Xe=!0;if(!Jt&&Ye.length===0)Jt=sn;if(He)He=!1;_(i,{slot_name:Je,slot_props:ht,slot_description:Jt||void 0,slot_deprecated:et,slot_tags:Ye.length>0?[...Ye]:void 0,source:vr(i,tt)}),Ye.length=0,et=void 0;break}case"event":{if(at(),ve=Je,be=ht,Pe=tt.length>0?tt[0].number:void 0,Ee=jt(un(tt))||sn,!Ee&&He&&!Xe&&xe)Ee=xe,Xe=!0;if(_e=vr(i,tt),He)He=!1;break}case"type":if(ve!==void 0)be=ht;break;case"param":if(De!==void 0)je.push({name:Je,type:ht,optional:At||!1});break;case"returns":case"return":if(De!==void 0)ze=ht;break;case"property":{let nt={name:Je,type:ht,description:jt(un(tt)),optional:At||!1,default:Ke};if(ve!==void 0)Te.push(nt);else if(Ne!==void 0)$e.push(nt);break}case"typedef":{if(lt(),Ne=Vi(Je),Oe=ht,Ae=jt(un(tt))||sn,!Ae&&He&&!Xe&&xe)Ae=xe,Xe=!0;if(He)He=!1;break}case"callback":{if(fr(),De=Vi(Je),Fe=jt(un(tt))||sn,!Fe&&He&&!Xe&&xe)Fe=xe,Xe=!0;if(He)He=!1;break}case"generics":if(i.generics=[Je,ht],He)He=!1;break;case"template":{let nt=Je;if(ht)nt=`${Je} extends ${ht}`;if(Ke)nt+=` = ${Ke}`;if(dr&&!hr){i.deferredSlotBlockGenerics.push({name:Je,constraint:nt});break}if(q.accumulateGeneric(Je,nt),He)He=!1;break}case"deprecated":{let nt=Hi(Je,ft);if(ve===void 0)et??=nt;else ke??=nt;break}case"enum":case"class":case"implements":case"this":case"namespace":case"memberof":case"module":case"file":case"overview":break;default:{let nt={name:Be,body:dt};if(ve!==void 0&&Gi.has(Be))we.push(nt);else Ye.push(nt)}break}}at(),lt(),fr()}}import Ki,{sep as qi}from"node:path";var _t=/\.svelte$/;function r(i){return qi==="/"?i:i.split(qi).join("/")}function Tn(i,q){return r(Ki.join(q,Ki.normalize(i)))}function Tt(i){return`${JSON.stringify(i,null,2)}
18
- `}var Ji="sveld",Nn="0.36.11";var zi={name:Ji,version:Nn,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"}},scripts:{test:"bun test --parallel","test:fixtures-types":"tsc --project tsconfig.fixtures.json","test:e2e":"bun tests/test-e2e.ts",format:"biome format --write .",lint:"biome lint .","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.12","@sveltejs/acorn-typescript":"1.0.10","@types/bun":"^1.4.0","@types/jest":"^30.0.0","@typescript/typescript6":"^6.0.2",acorn:"^8.18.0",culls:"^0.2.0","estree-walker":"^3.0.3",ostia:"0.2.0",svelte:"^5.56.10",typescript:"^7.0.2",zimmerframe:"1.1.4"},bin:{sveld:"cli.js"},files:["lib","cli.js"],repository:{type:"git",url:"git+https://github.com/carbon-design-system/sveld.git"},homepage:"https://github.com/carbon-design-system/sveld",bugs:"https://github.com/carbon-design-system/sveld/issues",keywords:["svelte","svelte component","documentation","docgen","typescript","definitions","JSDocs","vite","vite-plugin"],maintainers:["Eric Liu (https://github.com/metonym)"]};var cn="5.56.10";var Dn=1,Xi=new WeakMap;function c(i,q={}){let ge=Xi.get(i),ye=ge?.get(q.entryExports);if(ye)return ye;let xe=Array.from(i,([,ve])=>{let{diagnostics:be,...Ee}=ve;return Ee}).sort((ve,be)=>ve.moduleName.localeCompare(be.moduleName)),Ce={schemaVersion:Dn,generator:{name:Ji,version:Nn,svelteVersion:cn},total:xe.length,components:xe};if(q.entryExports&&q.entryExports.length>0)Ce.totalExports=q.entryExports.length,Ce.exports=q.entryExports;if(!ge)ge=new Map,Xi.set(i,ge);return ge.set(q.entryExports,Ce),Ce}import{readFile as uu}from"node:fs/promises";import cu from"node:path";var Qi={none:0,patch:1,minor:2,major:3};function pu(i,q){return Qi[q]>Qi[i]?q:i}function lu(i){return i.reduce((q,ge)=>pu(q,ge.bump),"none")}function Yi(i){let q=[],ge=0,ye="",xe=null;for(let Ce=0;Ce<i.length;Ce++){let ve=i[Ce];if(xe){if(ye+=ve,ve==="\\")Ce++,ye+=i[Ce]??"";else if(ve===xe)xe=null;continue}if(ve==='"'||ve==="'"||ve==="`"){xe=ve,ye+=ve;continue}if(ve==="<"||ve==="("||ve==="{"||ve==="[")ge++;if(ve===">"||ve===")"||ve==="}"||ve==="]")ge--;if(ve==="|"&&ge===0){q.push(ye.trim()),ye="";continue}ye+=ve}return q.push(ye.trim()),new Set(q.filter((Ce)=>Ce.length>0))}function _r(i,q){if(i===q)return"none";if(i===void 0||q===void 0)return"major";let ge=Yi(i),ye=Yi(q),xe=[...ye].some((ve)=>!ge.has(ve)),Ce=[...ge].some((ve)=>!ye.has(ve));if(!xe&&!Ce)return"none";if(xe&&!Ce)return"minor";if(Ce&&!xe)return"major";return"major"}function Zi(i,q,ge,ye){let xe=q==="prop"?"prop":"export",Ce=[],ve=new Map(ge.map((Ee)=>[Ee.name,Ee])),be=new Map(ye.map((Ee)=>[Ee.name,Ee]));for(let[Ee,ke]of be){if(ve.has(Ee))continue;Ce.push({component:i,kind:q,name:Ee,bump:ke.isRequired?"major":"minor",message:`${xe} "${Ee}" added${ke.isRequired?" (required)":""}`})}for(let[Ee]of ve){if(be.has(Ee))continue;Ce.push({component:i,kind:q,name:Ee,bump:"major",message:`${xe} "${Ee}" removed`})}for(let[Ee,ke]of ve){let _e=be.get(Ee);if(!_e)continue;if(ke.isRequired!==_e.isRequired)Ce.push({component:i,kind:q,name:Ee,bump:_e.isRequired?"major":"minor",message:`${xe} "${Ee}" became ${_e.isRequired?"required":"optional"}`});let Pe=_r(ke.type,_e.type);if(Pe!=="none")Ce.push({component:i,kind:q,name:Ee,bump:Pe,message:`${xe} "${Ee}" type changed from \`${ke.type??"unknown"}\` to \`${_e.type??"unknown"}\``})}return Ce}function fu(i,q,ge){let ye=[],xe=new Map(q.map((ve)=>[ve.name,ve])),Ce=new Map(ge.map((ve)=>[ve.name,ve]));for(let[ve]of Ce){if(xe.has(ve))continue;ye.push({component:i,kind:"event",name:ve,bump:"minor",message:`event "${ve}" added`})}for(let[ve]of xe){if(Ce.has(ve))continue;ye.push({component:i,kind:"event",name:ve,bump:"major",message:`event "${ve}" removed`})}for(let[ve,be]of xe){let Ee=Ce.get(ve);if(!Ee)continue;if(be.type!==Ee.type){ye.push({component:i,kind:"event",name:ve,bump:"major",message:`event "${ve}" changed from ${be.type} to ${Ee.type}`});continue}let ke=be.type==="dispatched"?be.detail:void 0,_e=Ee.type==="dispatched"?Ee.detail:void 0,Pe=_r(ke,_e);if(Pe!=="none")ye.push({component:i,kind:"event",name:ve,bump:Pe,message:`event "${ve}" detail changed from \`${ke??"unknown"}\` to \`${_e??"unknown"}\``})}return ye}function es(i){return i.name??"default"}function du(i,q,ge){let ye=[],xe=new Map(q.map((ve)=>[es(ve),ve])),Ce=new Map(ge.map((ve)=>[es(ve),ve]));for(let[ve]of Ce){if(xe.has(ve))continue;ye.push({component:i,kind:"slot",name:ve,bump:"minor",message:`slot "${ve}" added`})}for(let[ve]of xe){if(Ce.has(ve))continue;ye.push({component:i,kind:"slot",name:ve,bump:"major",message:`slot "${ve}" removed`})}for(let[ve,be]of xe){let Ee=Ce.get(ve);if(!Ee)continue;let ke=_r(be.slot_props,Ee.slot_props);if(ke!=="none")ye.push({component:i,kind:"slot",name:ve,bump:ke,message:`slot "${ve}" props changed from \`${be.slot_props??"none"}\` to \`${Ee.slot_props??"none"}\``})}return ye}var hu=new Set(["description","source","componentCommentSource","tags"]);function Rn(i){if(Array.isArray(i))return i.map(Rn);if(i!==null&&typeof i==="object"){let q={};for(let[ge,ye]of Object.entries(i)){if(hu.has(ge))continue;q[ge]=Rn(ye)}return q}return i}var mu=["generics","rest_props","extends","contexts","typedefs"];function gu(i,q,ge){let ye=[];for(let xe of mu){let Ce=JSON.stringify(Rn(q[xe])),ve=JSON.stringify(Rn(ge[xe]));if(Ce!==ve)ye.push({component:i,kind:"shape",name:xe,bump:"major",message:`"${xe}" changed (breaking)`})}return ye}function yu(i,q){let ge=q.moduleName;return[...Zi(ge,"prop",i.props,q.props),...Zi(ge,"moduleExport",i.moduleExports,q.moduleExports),...fu(ge,i.events,q.events),...du(ge,i.slots,q.slots),...gu(ge,i,q)]}function le(i,q){let ge=[],ye=new Map(i.components.map((Ce)=>[Ce.moduleName,Ce])),xe=new Map(q.components.map((Ce)=>[Ce.moduleName,Ce]));for(let[Ce]of xe){if(ye.has(Ce))continue;ge.push({component:Ce,kind:"component",bump:"minor",message:`component "${Ce}" added`})}for(let[Ce]of ye){if(xe.has(Ce))continue;ge.push({component:Ce,kind:"component",bump:"major",message:`component "${Ce}" removed`})}for(let[Ce,ve]of ye){let be=xe.get(Ce);if(!be)continue;ge.push(...yu(ve,be))}return ge}async function xu(i){let q;try{q=await uu(cu.resolve(i),"utf-8")}catch(ge){if(ge.code==="ENOENT")return null;throw ge}try{return JSON.parse(q)}catch{throw Error(`sveld: could not parse "${i}" as JSON. Is it a sveld COMPONENT_API.json snapshot?`)}}function O(i){if(typeof i.check==="string")return i.check;return i.jsonOptions?.outFile??"COMPONENT_API.json"}async function D(i,q,ge={}){let ye=await xu(q);if(ye===null)return{snapshotExists:!1,snapshotFile:q,changes:[],bump:"none"};if(ye.schemaVersion!==Dn)return{snapshotExists:!0,snapshotFile:q,changes:[{component:"*",kind:"shape",bump:"none",message:`snapshot schemaVersion ${ye.schemaVersion} does not match the current schemaVersion ${Dn}; skipping diff`}],bump:"none"};let xe=c(i,{entryExports:ge.entryExports}),Ce=le(ye,xe);return{snapshotExists:!0,snapshotFile:q,changes:Ce,bump:lu(Ce)}}var Cu={major:"BREAKING",minor:"additive",patch:"patch",none:"no change"};function W(i){if(!i.snapshotExists)return`sveld --check: no snapshot found at "${i.snapshotFile}". Run \`sveld --json\` and commit the output first.`;if(i.changes.length===0)return`sveld --check: no API changes detected against "${i.snapshotFile}".`;let q=[],ge=i.changes.length;q.push(`sveld --check: ${ge} API change${ge===1?"":"s"} detected against "${i.snapshotFile}".`),q.push(`Suggested semver bump: ${i.bump}.`);let ye=new Map;for(let xe of i.changes){let Ce=ye.get(xe.component)??[];Ce.push(xe),ye.set(xe.component,Ce)}for(let[xe,Ce]of ye){q.push(""),q.push(` ${xe}`);for(let ve of Ce)q.push(` [${Cu[ve.bump]}] ${ve.message}`)}return q.join(`
19
- `)}function G(i){let q={kind:"check-report",...i};return Tt(q)}import{existsSync as vu}from"node:fs";import{join as bu}from"node:path";import{pathToFileURL as Eu}from"node:url";var Su=["sveld.config.js","sveld.config.mjs","sveld.config.ts"];function he(i){return i}function ku(i=process.cwd()){for(let q of Su){let ge=bu(i,q);if(vu(ge))return ge}return null}async function _u(i){let q;try{q=await import(`${Eu(i).href}?t=${Date.now()}`)}catch(ye){let xe=ye instanceof Error?ye.message:String(ye);throw Error(`sveld: failed to load config file "${i}".
20
- ${xe}`)}let ge=q.default;if(!rt(ge)||Array.isArray(ge))throw Error(`sveld: config file "${i}" must export a configuration object as its default export. Did you forget \`export default defineConfig({ ... })\`?`);return ge}async function B(i=process.cwd()){let q=ku(i);if(q===null)return{};return _u(q)}function j(...i){return Object.assign({},...i.filter(Boolean))}var Pr=new Map;function P(i){Pr.set(i.name,i)}function J(i){return Pr.get(i)}function me(){return Array.from(Pr.values())}import{dirname as ra}from"node:path";import{lstatSync as yo,readdirSync as np,readFileSync as rp,realpathSync as ip,statSync as sp}from"node:fs";import{readFile as op}from"node:fs/promises";import{dirname as ap,isAbsolute as up,join as go,parse as Zn,relative as Jr,resolve as bn}from"node:path";function pn(i){return i}function Nt(i){if(i==="")return i;return i.startsWith(".")?i:`./${i}`}import{dirname as Pu,resolve as wu}from"node:path";var Au=/^(['"])(.*)\1$/;function Tu(i,q){let ge=i.extends?.import;if(ge===void 0)return null;let ye=ge.replace(Au,"$2");if(!_t.test(ye))return null;return wu(Pu(q),ye)}function ln(i,q){let ge=new Map;for(let ye of i.values()){let xe=q(ye.filePath),Ce=Tu(ye,xe);if(Ce===null)continue;let ve=ge.get(Ce);if(ve===void 0)ve=new Set,ge.set(Ce,ve);ve.add(xe)}return ge}function In(i,q){let ge=new Set,ye=[];for(let xe of i)if(!ge.has(xe))ge.add(xe),ye.push(xe);while(ye.length>0){let xe=ye.shift(),Ce=q.get(xe);if(Ce===void 0)continue;for(let ve of Ce)if(!ge.has(ve))ge.add(ve),ye.push(ve)}return ge}var Nu={"prop-unknown-type":"Props without inferred types","context-any-type":"Context values typed as `any`","event-no-source":"@event tags with no dispatch or callback","example-compile-error":"@example blocks that failed to compile","syntax-skipped":"Component syntax sveld skipped"},Du=["prop-unknown-type","context-any-type","event-no-source","example-compile-error","syntax-skipped"];function On(i){let q=new Set,ge=[];for(let ye of i){let xe=`${ye.component}:${ye.kind}:${ye.name}`;if(q.has(xe))continue;q.add(xe),ge.push(ye)}return ge}function M(i){if(i.length===0)return"sveld: all types resolved.";let q=[],ge=i.length;q.push(`sveld: ${ge} unresolved type${ge===1?"":"s"} found.`);for(let ye of Du){let xe=i.filter((ve)=>ve.kind===ye);if(xe.length===0)continue;q.push(""),q.push(`${Nu[ye]} (${xe.length}):`);let Ce=new Map;for(let ve of xe){let be=Ce.get(ve.component)??[];be.push(ve),Ce.set(ve.component,be)}for(let[ve,be]of Ce){q.push(` ${ve}`);for(let Ee of be){let ke=Ee.source?` (${ve}:${Ee.source.start.line}:${Ee.source.start.column})`:"";q.push(` - ${Ee.message}${ke}`)}}}return q.join(`
21
- `)}function ts(i){return Tt({kind:"diagnostics",diagnostics:i})}var Ru=/^```([\w-]*)\r?\n([\s\S]*?)\r?\n?```$/,Iu=new Set(["","js","jsx","ts","tsx","javascript","typescript"]);function Ou(i){let q=i.trim();if(q==="")return null;let ge=q.match(Ru);if(ge){let ye=ge[1].toLowerCase();if(!Iu.has(ye))return null;let xe=ge[2].trim();return xe===""?null:xe}if(q.startsWith("<"))return null;return q}function ns(i){if(!i.isFunction)return"any";return`(${(i.params??[]).map((ge)=>`${ge.name}${ge.optional?"?":""}: any`).join(", ")}) => any`}function Ln(i,q,ge,ye,xe){let Ce=(i??[]).filter((be)=>be.name==="example"),ve=[];return Ce.forEach((be,Ee)=>{let ke=Ou(be.body);if(ke===null)return;let _e=Ce.length>1;ve.push({id:_e?`${q}#${Ee}`:q,name:_e?`${ge} (example ${Ee+1})`:ge,type:ye,code:ke,...xe?{source:xe}:{}})}),ve}function rs(i){return i.name??"default"}function is(i){let q=[];for(let ge of i.props)q.push(...Ln(ge.tags,`prop:${ge.name}`,ge.name,ns(ge),ge.source));for(let ge of i.moduleExports)q.push(...Ln(ge.tags,`export:${ge.name}`,ge.name,ns(ge),ge.source));for(let ge of i.slots)q.push(...Ln(ge.tags,`slot:${rs(ge)}`,rs(ge),"any",ge.source));for(let ge of i.events)q.push(...Ln(ge.tags,`event:${ge.name}`,ge.name,"any",ge.source));return q}import{createHash as Lu}from"node:crypto";import{mkdirSync as $u,readFileSync as Fu,writeFileSync as Bu}from"node:fs";import{dirname as Mu,isAbsolute as ju,join as Vu,resolve as ss}from"node:path";var wr=2,Gu=Vu("node_modules",".cache","sveld","parse-cache.json");function Ar(){return`${Nn}+svelte@${cn}`}function as(i,q){if(typeof q==="string")return ju(q)?q:ss(i,q);return ss(i,Gu)}function us(i){return Lu("sha256").update(i).digest("hex")}function os(){return{formatVersion:wr,toolchainVersion:Ar(),entries:{}}}function Hu(i){try{let q=Fu(i,"utf-8"),ge=JSON.parse(q);if(ge.formatVersion!==wr||ge.toolchainVersion!==Ar())return os();return ge}catch{return os()}}class Tr{cacheFilePath;file;next=new Map;blocked=new Set;constructor(i){this.cacheFilePath=i,this.file=Hu(i)}has(i,q){if(this.blocked.has(i))return!1;let ge=this.file.entries[i];return ge!==void 0&&ge.hash===q}get(i,q){if(this.blocked.has(i))return null;let ge=this.file.entries[i];if(ge===void 0||ge.hash!==q)return null;if(this.next.set(i,ge),ge.typeScriptMetadata!==void 0)ge.parsed[T]=ge.typeScriptMetadata;return ge.parsed}set(i,q,ge){this.next.set(i,{hash:q,parsed:ge,typeScriptMetadata:ge[T]})}invalidate(i){this.blocked.add(i)}getGeneratedText(i,q){let ge=this.next.get(i);if(ge?.generatedText===void 0||ge.generatedText.format!==q)return;return ge.generatedText.text}setGeneratedText(i,q,ge){let ye=this.next.get(i);if(ye===void 0)return;ye.generatedText={format:q,text:ge}}save(){$u(Mu(this.cacheFilePath),{recursive:!0});let i={formatVersion:wr,toolchainVersion:Ar(),entries:Object.fromEntries(this.next)};Bu(this.cacheFilePath,JSON.stringify(i))}}import{existsSync as Mn,lstatSync as hs,readFileSync as Qu}from"node:fs";import{dirname as Cs,join as Yu,relative as Zu,resolve as vs}from"node:path";var Xt=null,Nr=null;function Vt(){if(Xt)return Promise.resolve(Xt);if(!Nr)Nr=Promise.all([import("./chunk-e1e89j27.js"),import("./chunk-wq8f3w8t.js")]).then(([i,q])=>(Xt={ComponentParser:i.default,parseSvelte:q.parse},Xt));return Nr}function $n(){if(!Xt)throw Error("sveld: internal error, parser stack read before loadParserStack() resolved.");return Xt}import{existsSync as fs,readFileSync as Wu}from"node:fs";import{dirname as Dr,isAbsolute as Uu,join as Ku,relative as qu,resolve as Bn}from"node:path";function cs(i){if(!rt(i))return{};let q=i.svelte;return typeof q==="string"?{svelte:q}:{}}function ps(i){if(!rt(i))return{};let q={};if(typeof i.extends==="string")q.extends=i.extends;if(rt(i.compilerOptions)){let ge={};if(typeof i.compilerOptions.baseUrl==="string")ge.baseUrl=i.compilerOptions.baseUrl;if(rt(i.compilerOptions.paths)){let ye={};for(let[xe,Ce]of Object.entries(i.compilerOptions.paths))if(Array.isArray(Ce)&&Ce.every((ve)=>typeof ve==="string"))ye[xe]=Ce;if(Object.keys(ye).length>0)ge.paths=ye}if(Object.keys(ge).length>0)q.compilerOptions=ge}return q}var Fn=new Map,ls=new Map,Ju=/\/\*[\s\S]*?\*\/|\/\/.*/g,zu=/[.+?^${}()|[\]\\]/g;function Xu(i){let q=i,ge=Bn(q,"/");while(q!==ge){for(let ye of["tsconfig.json","jsconfig.json"]){let xe=Ku(q,ye);if(fs(xe))return xe}q=Dr(q)}return null}function ds(i){if(Fn.has(i))return Fn.get(i)??null;try{let q=Wu(i,"utf-8"),ge;try{ge=JSON.parse(q)}catch{let xe=q.replace(Ju,"");ge=JSON.parse(xe)}let ye=ps(ge);if(ye.extends){let xe=Uu(ye.extends)?ye.extends:Bn(Dr(i),ye.extends),Ce=xe.endsWith(".json")?xe:`${xe}.json`;if(fs(Ce)){let ve=ds(Ce);if(ve)ye.compilerOptions={...ve.compilerOptions,...ye.compilerOptions,paths:{...ve.compilerOptions?.paths,...ye.compilerOptions?.paths}}}}return Fn.set(i,ye),ye}catch{return Fn.set(i,null),null}}function fn(i,q){if(i.startsWith(".")||i.startsWith("/"))return i;let ge=Xu(q);if(!ge)return i;let ye=ds(ge);if(!ye?.compilerOptions?.paths)return i;let{baseUrl:xe=".",paths:Ce}=ye.compilerOptions,ve=Dr(ge),be=Bn(ve,xe);for(let[Ee,ke]of Object.entries(Ce)){let _e=ls.get(Ee);if(!_e){let we=Ee.split("*").map((Te)=>Te.replace(zu,"\\$&")).join("(.*)");_e=new RegExp(`^${we}$`),ls.set(Ee,_e)}let Pe=i.match(_e);if(Pe){let we=ke[0];if(!we)continue;let Te=we;for(let Oe=1;Oe<Pe.length;Oe++)Te=Te.replace("*",Pe[Oe]);return Bn(be,Te)}}return i}function dn(i,q){if(i.startsWith(".")||i.startsWith("/"))return i;let ge=fn(i,q);if(ge===i)return i;let ye=qu(q,ge);return ye=r(ye),ye.startsWith(".")?ye:`./${ye}`}var ms=[".ts",".mts",".cts",".tsx",".js",".mjs",".cjs",".jsx",".d.ts"],ec=/\r?\n/,tc=/^\s*\*+/;function qe(i){return i&&typeof i==="object"?i:void 0}function Yt(i){return Array.isArray(i)?i:[]}function Pt(i){return u(i)?i.name:void 0}function Gt(i,q){let ge=fn(i,q),ye=vs(q,ge);if(Mn(ye)&&hs(ye).isFile())return ye;for(let xe of ms){let Ce=ye+xe;if(Mn(Ce))return Ce}if(Mn(ye)&&hs(ye).isDirectory())for(let xe of ms){let Ce=Yu(ye,`index${xe}`);if(Mn(Ce))return Ce}return null}function nc(i,q){let ge=i.slice(0,q).trimEnd();if(!ge.endsWith("*/"))return;let ye=ge.length-2,xe=ge.lastIndexOf("/**",ye);if(xe===-1)return;let Ce=[];for(let ve of ge.slice(xe+3,ye).split(ec)){let be=ve.replace(tc,"").trim();if(be.startsWith("@"))break;if(be)Ce.push(be)}return Ce.join(" ")||void 0}function rc(i,q){let ge=i.slice(0,q).trimEnd();if(!ge.endsWith("*/"))return;let ye=ge.length-2,xe=ge.lastIndexOf("/**",ye);if(xe===-1)return;return ge.slice(xe,ye+2)}function Qt(i,q){if(!q)return;return i.text.slice(q.start,q.end)}function ic(i,q){let ge=qe(q?.typeAnnotation);if(ge?.type!=="TSTypeAnnotation")return;return Qt(i,qe(ge.typeAnnotation))}function Rr(i,q){let ge=qe(q.returnType);return ge?.type==="TSTypeAnnotation"?Qt(i,qe(ge.typeAnnotation)):void 0}function gs(i,q){let ge=Yt(q.params).map((xe)=>Qt(i,xe)??"").join(", "),ye=Rr(i,q);return`(${ge})${ye?` => ${ye}`:""}`}function bs(i){if(i.type==="Literal"){let q=i.value;if(typeof q==="string")return"string";if(typeof q==="number")return"number";if(typeof q==="boolean")return"boolean"}if(i.type==="TemplateLiteral")return"string";return}function sc(i){if(!i)return;let q=i.lastIndexOf("=>");if(q===-1)return;return i.slice(q+2).trim()||void 0}function ys(i){if(i.async||i.generator)return;let q=qe(i.body);if(!q)return;let ge=[];if(q.type==="BlockStatement"){if(hn(q,ge),ge.length===0)return}else ge.push(q);let ye;for(let xe of ge){if(!xe)return;let Ce=bs(xe);if(!Ce)return;if(ye===void 0)ye=Ce;else if(ye!==Ce)return}return ye}function hn(i,q){for(let ge of Yt(i.body)){if(ge.type==="FunctionDeclaration"||ge.type==="FunctionExpression"||ge.type==="ArrowFunctionExpression")continue;if(ge.type==="ReturnStatement"){q.push(qe(ge.argument)??null);continue}if(ge.type==="BlockStatement"){hn(ge,q);continue}let ye=qe(ge.consequent);if(ye?.type==="BlockStatement")hn(ye,q);else if(ye?.type==="ReturnStatement")q.push(qe(ye.argument)??null);let xe=qe(ge.alternate);if(xe?.type==="BlockStatement")hn(xe,q);else if(xe?.type==="ReturnStatement")q.push(qe(xe.argument)??null);let Ce=qe(ge.body);if(Ce?.type==="BlockStatement")hn(Ce,q)}}function xs(i,q,ge){let ye=i.filePath,xe=nc(i.text,ge),Ce=rc(i.text,ge),ve=Ce?Ui(Ce):void 0;if(q.type==="VariableDeclaration"){let be=q.kind??"const",Ee=[];for(let ke of Yt(q.declarations)){let _e=qe(ke.id),Pe=Pt(_e);if(!Pe)continue;let we=ic(i,_e),Te,Ne,Oe,Ae=qe(ke.init);if(Ae)if(Ae.type==="ArrowFunctionExpression"||Ae.type==="FunctionExpression"){if(!we)we=gs(i,Ae);Ne=Rr(i,Ae)??ve??sc(we)??ys(Ae)}else{if(Te=Qt(i,Ae),!we)we=bs(Ae);Oe=wn(Ae)??void 0}Ee.push({name:Pe,kind:be,type:we,value:Te,returnType:Ne,literalValue:Oe,description:xe,declFile:ye,isTypeOnly:!1})}return Ee}if(q.type==="FunctionDeclaration"||q.type==="TSDeclareFunction"){let be=Pt(qe(q.id));if(!be)return[];return[{name:be,kind:"function",type:gs(i,q),returnType:Rr(i,q)??ve??ys(q),description:xe,declFile:ye,isTypeOnly:!1}]}if(q.type==="ClassDeclaration"){let be=Pt(qe(q.id));if(!be)return[];return[{name:be,kind:"class",type:be,description:xe,declFile:ye,isTypeOnly:!1}]}if(q.type==="TSTypeAliasDeclaration"){let be=Pt(qe(q.id));if(!be)return[];return[{name:be,kind:"type",type:Qt(i,qe(q.typeAnnotation)),description:xe,declFile:ye,isTypeOnly:!0}]}if(q.type==="TSInterfaceDeclaration"){let be=Pt(qe(q.id));if(!be)return[];return[{name:be,kind:"interface",type:Qt(i,qe(q.body)),description:xe,declFile:ye,isTypeOnly:!0}]}if(q.type==="TSEnumDeclaration"){let be=Pt(qe(q.id));if(!be)return[];return[{name:be,kind:"enum",type:be,description:xe,declFile:ye,isTypeOnly:!1}]}return[]}function oc(i){let q;try{q=Qu(i,"utf-8")}catch{return null}let ge=`<script lang="ts">
22
- ${q}
23
- </script>`;try{let ye=$n().parseSvelte(ge),xe=Yt(ye.instance?.content?.body);return{source:{text:ge,filePath:i,dir:Cs(i)},body:xe}}catch(ye){let xe=ye instanceof Error?ye.message:String(ye);return console.warn(`Warning: Failed to parse entry export module ${i}: ${xe}`),null}}function ac(i,q){for(let ge of i){if(ge.type!=="ImportDeclaration")continue;let ye=qe(ge.source)?.value;if(typeof ye!=="string")continue;for(let xe of Yt(ge.specifiers)){if(xe.type!=="ImportSpecifier")continue;if(Pt(qe(xe.local))===q){let Ce=Pt(qe(xe.imported))??q;return{specifier:ye,importedName:Ce}}}}return null}function Dt(i,q){let ge=q.cache.get(i);if(ge)return ge;if(q.computing.has(i))return[];q.computing.add(i);let ye=oc(i);if(!ye)return q.computing.delete(i),q.cache.set(i,[]),[];let{source:xe,body:Ce}=ye,ve=[],be=new Map;for(let ke of Ce){let _e=ke.type==="ExportNamedDeclaration"?qe(ke.declaration):ke;if(!_e)continue;for(let Pe of xs(xe,_e,_e.start))be.set(Pe.name,Pe)}let Ee=(ke)=>{let _e=be.get(ke);if(_e)return _e;let Pe=ac(Ce,ke);if(!Pe||Pe.specifier.endsWith(".svelte"))return null;let we=Gt(Pe.specifier,xe.dir);if(!we)return null;return Dt(we,q).find((Te)=>Te.name===Pe.importedName)??null};for(let ke of Ce){if(ke.type==="ExportAllDeclaration"){let Ne=qe(ke.source)?.value;if(typeof Ne!=="string"||Ne.endsWith(".svelte"))continue;let Oe=Gt(Ne,xe.dir);if(!Oe)continue;let Ae=ke.exportKind==="type";for(let $e of Dt(Oe,q))ve.push(Ae?{...$e,isTypeOnly:!0}:$e);continue}if(ke.type!=="ExportNamedDeclaration")continue;let _e=qe(ke.declaration);if(_e){ve.push(...xs(xe,_e,ke.start));continue}let Pe=qe(ke.source)?.value,we=typeof Pe==="string"?Pe:void 0;if(we?.endsWith(".svelte"))continue;let Te=ke.exportKind==="type";for(let Ne of Yt(ke.specifiers)){if(Ne.type!=="ExportSpecifier")continue;let Oe=Pt(qe(Ne.exported)),Ae=Pt(qe(Ne.local));if(!Oe||!Ae||Ae==="default"||Oe==="default")continue;let $e=Te||Ne.exportKind==="type",De=null;if(we){let Fe=Gt(we,xe.dir);if(Fe)De=Dt(Fe,q).find((je)=>je.name===Ae)??null}else De=Ee(Ae);if(De?.declFile.endsWith(".svelte"))continue;if(De)ve.push({...De,name:Oe,isTypeOnly:De.isTypeOnly||$e});else ve.push({name:Oe,kind:$e?"type":"const",declFile:i,isTypeOnly:$e})}}return q.computing.delete(i),q.cache.set(i,ve),ve}async function jn(i){await Vt();let q=vs(i),ge=Cs(q),ye=Dt(q,{cache:new Map,computing:new Set}),xe=new Map;for(let Ce of ye){let{declFile:ve,returnType:be,...Ee}=Ce,ke=r(`./${Zu(ge,ve)}`);xe.set(Ce.name,{...Ee,source:ke})}return Array.from(xe.values()).sort((Ce,ve)=>Ce.name.localeCompare(ve.name))}import{lstatSync as Uc,readdirSync as Kc,readFileSync as qc}from"node:fs";import{dirname as Jc,join as co,resolve as zc}from"node:path";var H={};da(H,{Node:()=>Cn,Parser:()=>t,Position:()=>Zt,SourceLocation:()=>yn,TokContext:()=>Ct,Token:()=>Yn,TokenType:()=>We,defaultOptions:()=>Gn,getLineInfo:()=>jr,isIdentifierChar:()=>a,isIdentifierStart:()=>o,isNewLine:()=>Wt,keywordTypes:()=>qn,lineBreak:()=>ut,lineBreakG:()=>Ts,nonASCIIwhitespace:()=>Mr,parse:()=>Kr,parseExpressionAt:()=>Hc,tokContexts:()=>Qe,tokTypes:()=>Se,tokenizer:()=>Wc,version:()=>uo});var uc=[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],Ps=[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],cc="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࢗ-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-᫝᫠-᫫ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・",ws="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-࢏ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚ౜ౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ೜-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲊᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-Ƛ꟱-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",Ir={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"},Or="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",pc={5:Or,"5module":Or+" export import",6:Or+" const class extends export import super"},As=/^in(stanceof)?$/,lc=new RegExp("["+ws+"]"),fc=new RegExp("["+ws+cc+"]");function Lr(i,q){var ge=65536;for(var ye=0;ye<q.length;ye+=2){if(ge+=q[ye],ge>i)return!1;if(ge+=q[ye+1],ge>=i)return!0}return!1}function o(i,q){if(i<65)return i===36;if(i<91)return!0;if(i<97)return i===95;if(i<123)return!0;if(i<=65535)return i>=170&&lc.test(String.fromCharCode(i));if(q===!1)return!1;return Lr(i,Ps)}function a(i,q){if(i<48)return i===36;if(i<58)return!0;if(i<65)return!1;if(i<91)return!0;if(i<97)return i===95;if(i<123)return!0;if(i<=65535)return i>=170&&fc.test(String.fromCharCode(i));if(q===!1)return!1;return Lr(i,Ps)||Lr(i,uc)}var We=function(q,ge){if(ge===void 0)ge={};this.label=q,this.keyword=ge.keyword,this.beforeExpr=!!ge.beforeExpr,this.startsExpr=!!ge.startsExpr,this.isLoop=!!ge.isLoop,this.isAssign=!!ge.isAssign,this.prefix=!!ge.prefix,this.postfix=!!ge.postfix,this.binop=ge.binop||null,this.updateContext=null};function yt(i,q){return new We(i,{beforeExpr:!0,binop:q})}var xt={beforeExpr:!0},ct={startsExpr:!0},qn={};function Ge(i,q){if(q===void 0)q={};return q.keyword=i,qn[i]=new We(i,q)}var Se={num:new We("num",ct),regexp:new We("regexp",ct),string:new We("string",ct),name:new We("name",ct),privateId:new We("privateId",ct),eof:new We("eof"),bracketL:new We("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new We("]"),braceL:new We("{",{beforeExpr:!0,startsExpr:!0}),braceR:new We("}"),parenL:new We("(",{beforeExpr:!0,startsExpr:!0}),parenR:new We(")"),comma:new We(",",xt),semi:new We(";",xt),colon:new We(":",xt),dot:new We("."),question:new We("?",xt),questionDot:new We("?."),arrow:new We("=>",xt),template:new We("template"),invalidTemplate:new We("invalidTemplate"),ellipsis:new We("...",xt),backQuote:new We("`",ct),dollarBraceL:new We("${",{beforeExpr:!0,startsExpr:!0}),eq:new We("=",{beforeExpr:!0,isAssign:!0}),assign:new We("_=",{beforeExpr:!0,isAssign:!0}),incDec:new We("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new We("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:yt("||",1),logicalAND:yt("&&",2),bitwiseOR:yt("|",3),bitwiseXOR:yt("^",4),bitwiseAND:yt("&",5),equality:yt("==/!=/===/!==",6),relational:yt("</>/<=/>=",7),bitShift:yt("<</>>/>>>",8),plusMin:new We("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:yt("%",10),star:yt("*",10),slash:yt("/",10),starstar:new We("**",{beforeExpr:!0}),coalesce:yt("??",1),_break:Ge("break"),_case:Ge("case",xt),_catch:Ge("catch"),_continue:Ge("continue"),_debugger:Ge("debugger"),_default:Ge("default",xt),_do:Ge("do",{isLoop:!0,beforeExpr:!0}),_else:Ge("else",xt),_finally:Ge("finally"),_for:Ge("for",{isLoop:!0}),_function:Ge("function",ct),_if:Ge("if"),_return:Ge("return",xt),_switch:Ge("switch"),_throw:Ge("throw",xt),_try:Ge("try"),_var:Ge("var"),_const:Ge("const"),_while:Ge("while",{isLoop:!0}),_with:Ge("with"),_new:Ge("new",{beforeExpr:!0,startsExpr:!0}),_this:Ge("this",ct),_super:Ge("super",ct),_class:Ge("class",ct),_extends:Ge("extends",xt),_export:Ge("export"),_import:Ge("import",ct),_null:Ge("null",ct),_true:Ge("true",ct),_false:Ge("false",ct),_in:Ge("in",{beforeExpr:!0,binop:7}),_instanceof:Ge("instanceof",{beforeExpr:!0,binop:7}),_typeof:Ge("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:Ge("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:Ge("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},ut=/\r\n?|\n|\u2028|\u2029/,Ts=new RegExp(ut.source,"g");function Wt(i){return i===10||i===13||i===8232||i===8233}function Ns(i,q,ge){if(ge===void 0)ge=i.length;for(var ye=q;ye<ge;ye++){var xe=i.charCodeAt(ye);if(Wt(xe))return ye<ge-1&&xe===13&&i.charCodeAt(ye+1)===10?ye+2:ye+1}return-1}var Mr=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,it=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Ds=Object.prototype,{hasOwnProperty:dc,toString:hc}=Ds,en=Object.hasOwn||function(i,q){return dc.call(i,q)},Es=Array.isArray||function(i){return hc.call(i)==="[object Array]"},Ss=Object.create(null);function $t(i){return Ss[i]||(Ss[i]=new RegExp("^(?:"+i.replace(/ /g,"|")+")$"))}function Rt(i){if(i<=65535)return String.fromCharCode(i);return i-=65536,String.fromCharCode((i>>10)+55296,(i&1023)+56320)}var mc=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,Zt=function(q,ge){this.line=q,this.column=ge};Zt.prototype.offset=function(q){return new Zt(this.line,this.column+q)};var yn=function(q,ge,ye){if(this.start=ge,this.end=ye,q.sourceFile!==null)this.source=q.sourceFile};function jr(i,q){for(var ge=1,ye=0;;){var xe=Ns(i,ye,q);if(xe<0)return new Zt(ge,q-ye);++ge,ye=xe}}var Gn={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},ks=!1;function gc(i){var q={};for(var ge in Gn)q[ge]=i&&en(i,ge)?i[ge]:Gn[ge];if(q.ecmaVersion==="latest")q.ecmaVersion=1e8;else if(q.ecmaVersion==null){if(!ks&&typeof console==="object"&&console.warn)ks=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
24
- Defaulting to 2020, but this will stop working in the future.`);q.ecmaVersion=11}else if(q.ecmaVersion>=2015)q.ecmaVersion-=2009;if(q.allowReserved==null)q.allowReserved=q.ecmaVersion<5;if(!i||i.allowHashBang==null)q.allowHashBang=q.ecmaVersion>=14;if(Es(q.onToken)){var ye=q.onToken;q.onToken=function(xe){return ye.push(xe)}}if(Es(q.onComment))q.onComment=yc(q,q.onComment);if(q.sourceType==="commonjs"&&q.allowAwaitOutsideFunction)throw Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");return q}function yc(i,q){return function(ge,ye,xe,Ce,ve,be){var Ee={type:ge?"Block":"Line",value:ye,start:xe,end:Ce};if(i.locations)Ee.loc=new yn(this,ve,be);if(i.ranges)Ee.range=[xe,Ce];q.push(Ee)}}var Ht=1,Ut=2,Vr=4,Rs=8,Gr=16,Is=32,Jn=64,Os=128,Kt=256,xn=512,Ls=1024,zn=Ht|Ut|Kt;function Hr(i,q){return Ut|(i?Vr:0)|(q?Rs:0)}var Hn=0,Wr=1,Ot=2,$s=3,Fs=4,Bs=5,t=function(q,ge,ye){this.options=q=gc(q),this.sourceFile=q.sourceFile,this.keywords=$t(pc[q.ecmaVersion>=6?6:q.sourceType==="module"?"5module":5]);var xe="";if(q.allowReserved!==!0){if(xe=Ir[q.ecmaVersion>=6?6:q.ecmaVersion===5?5:3],q.sourceType==="module")xe+=" await"}this.reservedWords=$t(xe);var Ce=(xe?xe+" ":"")+Ir.strict;if(this.reservedWordsStrict=$t(Ce),this.reservedWordsStrictBind=$t(Ce+" "+Ir.strictBind),this.input=String(ge),this.containsEsc=!1,this.pos=ye||0,this.curLine=1,q.startLocation)this.lineStart=this.pos-q.startLocation.column,this.curLine=q.startLocation.line;else if(ye){if(this.lineStart=this.input.lastIndexOf(`
25
- `,ye-1)+1,this.options.locations)this.curLine=this.input.slice(0,this.lineStart).split(ut).length}else this.lineStart=0;if(this.type=Se.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=q.sourceType==="module",this.strict=this.inModule||q.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&&q.allowHashBang&&this.input.slice(0,2)==="#!")this.skipLineComment(2);this.scopeStack=[],this.enterScope(this.options.sourceType==="commonjs"?Ut:Ht),this.regexpState=null,this.privateNameStack=[]},bt={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}};t.prototype.parse=function(){var q=this,ge=this.options.program||this.startNode();return this.nextToken(),this.catchStackOverflow(function(){return q.parseTopLevel(ge)})};bt.inFunction.get=function(){return(this.currentVarScope().flags&Ut)>0};bt.inGenerator.get=function(){return(this.currentVarScope().flags&Rs)>0};bt.inAsync.get=function(){return(this.currentVarScope().flags&Vr)>0};bt.canAwait.get=function(){for(var i=this.scopeStack.length-1;i>=0;i--){var q=this.scopeStack[i],ge=q.flags;if(ge&(Kt|xn))return!1;if(ge&Ut)return(ge&Vr)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};bt.allowReturn.get=function(){if(this.inFunction)return!0;if(this.options.allowReturnOutsideFunction&&this.currentVarScope().flags&Ht)return!0;return!1};bt.allowSuper.get=function(){var i=this.currentThisScope(),q=i.flags;return(q&Jn)>0||this.options.allowSuperOutsideMethod};bt.allowDirectSuper.get=function(){return(this.currentThisScope().flags&Os)>0};bt.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};bt.allowNewDotTarget.get=function(){for(var i=this.scopeStack.length-1;i>=0;i--){var q=this.scopeStack[i],ge=q.flags;if(ge&(Kt|xn)||ge&Ut&&!(ge&Gr))return!0}return!1};bt.allowUsing.get=function(){var i=this.currentScope(),q=i.flags;if(q&Ls)return!1;if(!this.inModule&&q&Ht)return!1;return!0};bt.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&Kt)>0};t.extend=function(){var q=[],ge=arguments.length;while(ge--)q[ge]=arguments[ge];var ye=this;for(var xe=0;xe<q.length;xe++)ye=q[xe](ye);return ye};t.parse=function(q,ge){return new this(ge,q).parse()};t.parseExpressionAt=function(q,ge,ye){var xe=new this(ye,q,ge);return xe.nextToken(),xe.parseExpression()};t.tokenizer=function(q,ge){return new this(ge,q)};Object.defineProperties(t.prototype,bt);var ot=t.prototype,xc=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;ot.strictDirective=function(i){if(this.options.ecmaVersion<5)return!1;for(;;){it.lastIndex=i,i+=it.exec(this.input)[0].length;var q=xc.exec(this.input.slice(i));if(!q)return!1;if((q[1]||q[2])==="use strict"){it.lastIndex=i+q[0].length;var ge=it.exec(this.input),ye=ge.index+ge[0].length,xe=this.input.charAt(ye);return xe===";"||xe==="}"||ut.test(ge[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(xe)||xe==="!"&&this.input.charAt(ye+1)==="=")}if(i+=q[0].length,it.lastIndex=i,i+=it.exec(this.input)[0].length,this.input[i]===";")i++}};ot.eat=function(i){if(this.type===i)return this.next(),!0;else return!1};ot.isContextual=function(i){return this.type===Se.name&&this.value===i&&!this.containsEsc};ot.eatContextual=function(i){if(!this.isContextual(i))return!1;return this.next(),!0};ot.catchStackOverflow=function(i){try{return i()}catch(q){if(q instanceof Error&&(/\bstack\b.*\b(exceeded|overflow)\b/i.test(q.message)||/\btoo much recursion\b/i.test(q.message)))this.raise(this.start,"Not enough stack space to parse input");else throw q}};ot.expectContextual=function(i){if(!this.eatContextual(i))this.unexpected()};ot.canInsertSemicolon=function(){return this.type===Se.eof||this.type===Se.braceR||ut.test(this.input.slice(this.lastTokEnd,this.start))};ot.insertSemicolon=function(){if(this.canInsertSemicolon()){if(this.options.onInsertedSemicolon)this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc);return!0}};ot.semicolon=function(){if(!this.eat(Se.semi)&&!this.insertSemicolon())this.unexpected()};ot.afterTrailingComma=function(i,q){if(this.type===i){if(this.options.onTrailingComma)this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc);if(!q)this.next();return!0}};ot.expect=function(i){this.eat(i)||this.unexpected()};ot.unexpected=function(i){this.raise(i!=null?i:this.start,"Unexpected token")};var Xn=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};ot.checkPatternErrors=function(i,q){if(!i)return;if(i.trailingComma>-1)this.raiseRecoverable(i.trailingComma,"Comma is not permitted after the rest element");var ge=q?i.parenthesizedAssign:i.parenthesizedBind;if(ge>-1)this.raiseRecoverable(ge,q?"Assigning to rvalue":"Parenthesized pattern")};ot.checkExpressionErrors=function(i,q){if(!i)return!1;var{shorthandAssign:ge,doubleProto:ye}=i;if(!q)return ge>=0||ye>=0;if(ge>=0)this.raise(ge,"Shorthand property assignments are valid only in destructuring patterns");if(ye>=0)this.raiseRecoverable(ye,"Redefinition of __proto__ property")};ot.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")};ot.isSimpleAssignTarget=function(i){if(i.type==="ParenthesizedExpression")return this.isSimpleAssignTarget(i.expression);return i.type==="Identifier"||i.type==="MemberExpression"};var Ie=t.prototype;Ie.parseTopLevel=function(i){var q=Object.create(null);if(!i.body)i.body=[];while(this.type!==Se.eof){var ge=this.parseStatement(null,!0,q);i.body.push(ge)}if(this.inModule)for(var ye=0,xe=Object.keys(this.undefinedExports);ye<xe.length;ye+=1){var Ce=xe[ye];this.raiseRecoverable(this.undefinedExports[Ce].start,"Export '"+Ce+"' is not defined")}return this.adaptDirectivePrologue(i.body),this.next(),i.sourceType=this.options.sourceType==="commonjs"?"script":this.options.sourceType,this.finishNode(i,"Program")};var Ur={kind:"loop"},Cc={kind:"switch"};Ie.isLet=function(i){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;it.lastIndex=this.pos;var q=it.exec(this.input),ge=this.pos+q[0].length,ye=this.fullCharCodeAt(ge);if(ye===91||ye===92)return!0;if(i)return!1;if(ye===123)return!0;if(o(ye)){var xe=ge;do ge+=ye<=65535?1:2;while(a(ye=this.fullCharCodeAt(ge)));if(ye===92)return!0;var Ce=this.input.slice(xe,ge);if(!As.test(Ce))return!0}return!1};Ie.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;it.lastIndex=this.pos;var i=it.exec(this.input),q=this.pos+i[0].length,ge;return!ut.test(this.input.slice(this.pos,q))&&this.input.slice(q,q+8)==="function"&&(q+8===this.input.length||!(a(ge=this.fullCharCodeAt(q+8))||ge===92))};Ie.isUsingKeyword=function(i,q){if(this.options.ecmaVersion<17||!this.isContextual(i?"await":"using"))return!1;it.lastIndex=this.pos;var ge=it.exec(this.input),ye=this.pos+ge[0].length;if(ut.test(this.input.slice(this.pos,ye)))return!1;if(i){var xe=ye+5,Ce;if(this.input.slice(ye,xe)!=="using"||xe===this.input.length||a(Ce=this.fullCharCodeAt(xe))||Ce===92)return!1;it.lastIndex=xe;var ve=it.exec(this.input);if(ye=xe+ve[0].length,ve&&ut.test(this.input.slice(xe,ye)))return!1}var be=this.fullCharCodeAt(ye);if(!o(be)&&be!==92)return!1;var Ee=ye;do ye+=be<=65535?1:2;while(a(be=this.fullCharCodeAt(ye)));if(be===92)return!0;var ke=this.input.slice(Ee,ye);if(As.test(ke))return!1;if(q&&!i&&ke==="of"){it.lastIndex=ye;var _e=it.exec(this.input);if(ye=ye+_e[0].length,this.input.charCodeAt(ye)!==61||(be=this.input.charCodeAt(ye+1))===61||be===62)return!1}return!0};Ie.isAwaitUsing=function(i){return this.isUsingKeyword(!0,i)};Ie.isUsing=function(i){return this.isUsingKeyword(!1,i)};Ie.parseStatement=function(i,q,ge){var ye=this.type,xe=this.startNode(),Ce;if(this.isLet(i))ye=Se._var,Ce="let";switch(ye){case Se._break:case Se._continue:return this.parseBreakContinueStatement(xe,ye.keyword);case Se._debugger:return this.parseDebuggerStatement(xe);case Se._do:return this.parseDoStatement(xe);case Se._for:return this.parseForStatement(xe);case Se._function:if(i&&(this.strict||i!=="if"&&i!=="label")&&this.options.ecmaVersion>=6)this.unexpected();return this.parseFunctionStatement(xe,!1,!i);case Se._class:if(i)this.unexpected();return this.parseClass(xe,!0);case Se._if:return this.parseIfStatement(xe);case Se._return:return this.parseReturnStatement(xe);case Se._switch:return this.parseSwitchStatement(xe);case Se._throw:return this.parseThrowStatement(xe);case Se._try:return this.parseTryStatement(xe);case Se._const:case Se._var:if(Ce=Ce||this.value,i&&Ce!=="var")this.unexpected();return this.parseVarStatement(xe,Ce);case Se._while:return this.parseWhileStatement(xe);case Se._with:return this.parseWithStatement(xe);case Se.braceL:return this.parseBlock(!0,xe);case Se.semi:return this.parseEmptyStatement(xe);case Se._export:case Se._import:if(this.options.ecmaVersion>10&&ye===Se._import){it.lastIndex=this.pos;var ve=it.exec(this.input),be=this.pos+ve[0].length,Ee=this.input.charCodeAt(be);if(Ee===40||Ee===46)return this.parseExpressionStatement(xe,this.parseExpression())}if(!this.options.allowImportExportEverywhere){if(!q)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 ye===Se._import?this.parseImport(xe):this.parseExport(xe,ge);default:if(this.isAsyncFunction()){if(i)this.unexpected();return this.next(),this.parseFunctionStatement(xe,!0,!i)}var ke=this.isAwaitUsing(!1)?"await using":this.isUsing(!1)?"using":null;if(ke){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(i)this.raise(this.start,"Using declaration is not allowed in single-statement positions");if(ke==="await using"){if(!this.canAwait)this.raise(this.start,"Await using cannot appear outside of async function");this.next()}return this.next(),this.parseVar(xe,!1,ke),this.semicolon(),this.finishNode(xe,"VariableDeclaration")}var _e=this.value,Pe=this.parseExpression();if(ye===Se.name&&Pe.type==="Identifier"&&this.eat(Se.colon))return this.parseLabeledStatement(xe,_e,Pe,i);else return this.parseExpressionStatement(xe,Pe)}};Ie.parseBreakContinueStatement=function(i,q){var ge=q==="break";if(this.next(),this.eat(Se.semi)||this.insertSemicolon())i.label=null;else if(this.type!==Se.name)this.unexpected();else i.label=this.parseIdent(),this.semicolon();var ye=0;for(;ye<this.labels.length;++ye){var xe=this.labels[ye];if(i.label==null||xe.name===i.label.name){if(xe.kind!=null&&(ge||xe.kind==="loop"))break;if(i.label&&ge)break}}if(ye===this.labels.length)this.raise(i.start,"Unsyntactic "+q);return this.finishNode(i,ge?"BreakStatement":"ContinueStatement")};Ie.parseDebuggerStatement=function(i){return this.next(),this.semicolon(),this.finishNode(i,"DebuggerStatement")};Ie.parseDoStatement=function(i){if(this.next(),this.labels.push(Ur),i.body=this.parseStatement("do"),this.labels.pop(),this.expect(Se._while),i.test=this.parseParenExpression(),this.options.ecmaVersion>=6)this.eat(Se.semi);else this.semicolon();return this.finishNode(i,"DoWhileStatement")};Ie.parseForStatement=function(i){this.next();var q=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(Ur),this.enterScope(0),this.expect(Se.parenL),this.type===Se.semi){if(q>-1)this.unexpected(q);return this.parseFor(i,null)}var ge=this.isLet();if(this.type===Se._var||this.type===Se._const||ge){var ye=this.startNode(),xe=ge?"let":this.value;return this.next(),this.parseVar(ye,!0,xe),this.finishNode(ye,"VariableDeclaration"),this.parseForAfterInit(i,ye,q)}var Ce=this.isContextual("let"),ve=!1,be=this.isUsing(!0)?"using":this.isAwaitUsing(!0)?"await using":null;if(be){var Ee=this.startNode();if(this.next(),be==="await using"){if(!this.canAwait)this.raise(this.start,"Await using cannot appear outside of async function");this.next()}return this.parseVar(Ee,!0,be),this.finishNode(Ee,"VariableDeclaration"),this.parseForAfterInit(i,Ee,q)}var ke=this.containsEsc,_e=new Xn,Pe=this.start,we=q>-1?this.parseExprSubscripts(_e,"await"):this.parseExpression(!0,_e);if(this.type===Se._in||(ve=this.options.ecmaVersion>=6&&this.isContextual("of"))){if(q>-1){if(this.type===Se._in)this.unexpected(q);i.await=!0}else if(ve&&this.options.ecmaVersion>=8){if(we.start===Pe&&!ke&&we.type==="Identifier"&&we.name==="async")this.unexpected();else if(this.options.ecmaVersion>=9)i.await=!1}if(Ce&&ve)this.raise(we.start,"The left-hand side of a for-of loop may not start with 'let'.");return this.toAssignable(we,!1,_e),this.checkLValPattern(we),this.parseForIn(i,we)}else this.checkExpressionErrors(_e,!0);if(q>-1)this.unexpected(q);return this.parseFor(i,we)};Ie.parseForAfterInit=function(i,q,ge){if((this.type===Se._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&q.declarations.length===1){if(this.type===Se._in){if((q.kind==="using"||q.kind==="await using")&&!q.declarations[0].init)this.raise(this.start,"Using declaration is not allowed in for-in loops");if(this.options.ecmaVersion>=9&&ge>-1)this.unexpected(ge)}else if(this.options.ecmaVersion>=9)i.await=ge>-1;return this.parseForIn(i,q)}if(ge>-1)this.unexpected(ge);return this.parseFor(i,q)};Ie.parseFunctionStatement=function(i,q,ge){return this.next(),this.parseFunction(i,gn|(ge?0:$r),!1,q)};Ie.parseIfStatement=function(i){return this.next(),i.test=this.parseParenExpression(),i.consequent=this.parseStatement("if"),i.alternate=this.eat(Se._else)?this.parseStatement("if"):null,this.finishNode(i,"IfStatement")};Ie.parseReturnStatement=function(i){if(!this.allowReturn)this.raise(this.start,"'return' outside of function");if(this.next(),this.eat(Se.semi)||this.insertSemicolon())i.argument=null;else i.argument=this.parseExpression(),this.semicolon();return this.finishNode(i,"ReturnStatement")};Ie.parseSwitchStatement=function(i){this.next(),i.discriminant=this.parseParenExpression(),i.cases=[],this.expect(Se.braceL),this.labels.push(Cc),this.enterScope(Ls);var q;for(var ge=!1;this.type!==Se.braceR;)if(this.type===Se._case||this.type===Se._default){var ye=this.type===Se._case;if(q)this.finishNode(q,"SwitchCase");if(i.cases.push(q=this.startNode()),q.consequent=[],this.next(),ye)q.test=this.parseExpression();else{if(ge)this.raiseRecoverable(this.lastTokStart,"Multiple default clauses");ge=!0,q.test=null}this.expect(Se.colon)}else{if(!q)this.unexpected();q.consequent.push(this.parseStatement(null))}if(this.exitScope(),q)this.finishNode(q,"SwitchCase");return this.next(),this.labels.pop(),this.finishNode(i,"SwitchStatement")};Ie.parseThrowStatement=function(i){if(this.next(),ut.test(this.input.slice(this.lastTokEnd,this.start)))this.raise(this.lastTokEnd,"Illegal newline after throw");return i.argument=this.parseExpression(),this.semicolon(),this.finishNode(i,"ThrowStatement")};var vc=[];Ie.parseCatchClauseParam=function(){var i=this.parseBindingAtom(),q=i.type==="Identifier";return this.enterScope(q?Is:0),this.checkLValPattern(i,q?Fs:Ot),this.expect(Se.parenR),i};Ie.parseTryStatement=function(i){if(this.next(),i.block=this.parseBlock(),i.handler=null,this.type===Se._catch){var q=this.startNode();if(this.next(),this.eat(Se.parenL))q.param=this.parseCatchClauseParam();else{if(this.options.ecmaVersion<10)this.unexpected();q.param=null,this.enterScope(0)}q.body=this.parseBlock(!1),this.exitScope(),i.handler=this.finishNode(q,"CatchClause")}if(i.finalizer=this.eat(Se._finally)?this.parseBlock():null,!i.handler&&!i.finalizer)this.raise(i.start,"Missing catch or finally clause");return this.finishNode(i,"TryStatement")};Ie.parseVarStatement=function(i,q,ge){return this.next(),this.parseVar(i,!1,q,ge),this.semicolon(),this.finishNode(i,"VariableDeclaration")};Ie.parseWhileStatement=function(i){return this.next(),i.test=this.parseParenExpression(),this.labels.push(Ur),i.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(i,"WhileStatement")};Ie.parseWithStatement=function(i){if(this.strict)this.raise(this.start,"'with' in strict mode");return this.next(),i.object=this.parseParenExpression(),i.body=this.parseStatement("with"),this.finishNode(i,"WithStatement")};Ie.parseEmptyStatement=function(i){return this.next(),this.finishNode(i,"EmptyStatement")};Ie.parseLabeledStatement=function(i,q,ge,ye){for(var xe=0,Ce=this.labels;xe<Ce.length;xe+=1){var ve=Ce[xe];if(ve.name===q)this.raise(ge.start,"Label '"+q+"' is already declared")}var be=this.type.isLoop?"loop":this.type===Se._switch?"switch":null;for(var Ee=this.labels.length-1;Ee>=0;Ee--){var ke=this.labels[Ee];if(ke.statementStart===i.start)ke.statementStart=this.start,ke.kind=be;else break}return this.labels.push({name:q,kind:be,statementStart:this.start}),i.body=this.parseStatement(ye?ye.indexOf("label")===-1?ye+"label":ye:"label"),this.labels.pop(),i.label=ge,this.finishNode(i,"LabeledStatement")};Ie.parseExpressionStatement=function(i,q){return i.expression=q,this.semicolon(),this.finishNode(i,"ExpressionStatement")};Ie.parseBlock=function(i,q,ge){if(i===void 0)i=!0;if(q===void 0)q=this.startNode();if(q.body=[],this.expect(Se.braceL),i)this.enterScope(0);while(this.type!==Se.braceR){var ye=this.parseStatement(null);q.body.push(ye)}if(ge)this.strict=!1;if(this.next(),i)this.exitScope();return this.finishNode(q,"BlockStatement")};Ie.parseFor=function(i,q){return i.init=q,this.expect(Se.semi),i.test=this.type===Se.semi?null:this.parseExpression(),this.expect(Se.semi),i.update=this.type===Se.parenR?null:this.parseExpression(),this.expect(Se.parenR),i.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(i,"ForStatement")};Ie.parseForIn=function(i,q){var ge=this.type===Se._in;if(this.next(),q.type==="VariableDeclaration"&&q.declarations[0].init!=null&&(!ge||this.options.ecmaVersion<8||this.strict||q.kind!=="var"||q.declarations[0].id.type!=="Identifier"))this.raise(q.start,(ge?"for-in":"for-of")+" loop variable declaration may not have an initializer");return i.left=q,i.right=ge?this.parseExpression():this.parseMaybeAssign(),this.expect(Se.parenR),i.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(i,ge?"ForInStatement":"ForOfStatement")};Ie.parseVar=function(i,q,ge,ye){i.declarations=[],i.kind=ge;for(;;){var xe=this.startNode();if(this.parseVarId(xe,ge),this.eat(Se.eq))xe.init=this.parseMaybeAssign(q);else if(!ye&&ge==="const"&&!(this.type===Se._in||this.options.ecmaVersion>=6&&this.isContextual("of")))this.unexpected();else if(!ye&&(ge==="using"||ge==="await using")&&this.options.ecmaVersion>=17&&this.type!==Se._in&&!this.isContextual("of"))this.raise(this.lastTokEnd,"Missing initializer in "+ge+" declaration");else if(!ye&&xe.id.type!=="Identifier"&&!(q&&(this.type===Se._in||this.isContextual("of"))))this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value");else xe.init=null;if(i.declarations.push(this.finishNode(xe,"VariableDeclarator")),!this.eat(Se.comma))break}return i};Ie.parseVarId=function(i,q){i.id=q==="using"||q==="await using"?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(i.id,q==="var"?Wr:Ot,!1)};var gn=1,$r=2,Ms=4;Ie.parseFunction=function(i,q,ge,ye,xe){if(this.initFunction(i),this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!ye){if(this.type===Se.star&&q&$r)this.unexpected();i.generator=this.eat(Se.star)}if(this.options.ecmaVersion>=8)i.async=!!ye;if(q&gn){if(i.id=q&Ms&&this.type!==Se.name?null:this.parseIdent(),i.id&&!(q&$r))this.checkLValSimple(i.id,this.strict||i.generator||i.async?this.treatFunctionsAsVar?Wr:Ot:$s)}var Ce=this.yieldPos,ve=this.awaitPos,be=this.awaitIdentPos;if(this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Hr(i.async,i.generator)),!(q&gn))i.id=this.type===Se.name?this.parseIdent():null;return this.parseFunctionParams(i),this.parseFunctionBody(i,ge,!1,xe),this.yieldPos=Ce,this.awaitPos=ve,this.awaitIdentPos=be,this.finishNode(i,q&gn?"FunctionDeclaration":"FunctionExpression")};Ie.parseFunctionParams=function(i){this.expect(Se.parenL),i.params=this.parseBindingList(Se.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};Ie.parseClass=function(i,q){this.next();var ge=this.strict;this.strict=!0,this.parseClassId(i,q),this.parseClassSuper(i);var ye=this.enterClassBody(),xe=this.startNode(),Ce=!1;xe.body=[],this.expect(Se.braceL);while(this.type!==Se.braceR){var ve=this.parseClassElement(i.superClass!==null);if(ve){if(xe.body.push(ve),ve.type==="MethodDefinition"&&ve.kind==="constructor"){if(Ce)this.raiseRecoverable(ve.start,"Duplicate constructor in the same class");Ce=!0}else if(ve.key&&ve.key.type==="PrivateIdentifier"&&bc(ye,ve))this.raiseRecoverable(ve.key.start,"Identifier '#"+ve.key.name+"' has already been declared")}}return this.strict=ge,this.next(),i.body=this.finishNode(xe,"ClassBody"),this.exitClassBody(),this.finishNode(i,q?"ClassDeclaration":"ClassExpression")};Ie.parseClassElement=function(i){if(this.eat(Se.semi))return null;var q=this.options.ecmaVersion,ge=this.startNode(),ye="",xe=!1,Ce=!1,ve="method",be=!1;if(this.eatContextual("static")){if(q>=13&&this.eat(Se.braceL))return this.parseClassStaticBlock(ge),ge;if(this.isClassElementNameStart()||this.type===Se.star)be=!0;else ye="static"}if(ge.static=be,!ye&&q>=8&&this.eatContextual("async"))if((this.isClassElementNameStart()||this.type===Se.star)&&!this.canInsertSemicolon())Ce=!0;else ye="async";if(!ye&&(q>=9||!Ce)&&this.eat(Se.star))xe=!0;if(!ye&&!Ce&&!xe){var Ee=this.value;if(this.eatContextual("get")||this.eatContextual("set"))if(this.isClassElementNameStart())ve=Ee;else ye=Ee}if(ye)ge.computed=!1,ge.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),ge.key.name=ye,this.finishNode(ge.key,"Identifier");else this.parseClassElementName(ge);if(q<13||this.type===Se.parenL||ve!=="method"||xe||Ce){var ke=!ge.static&&Wn(ge,"constructor"),_e=ke&&i;if(ke&&ve!=="method")this.raise(ge.key.start,"Constructor can't have get/set modifier");ge.kind=ke?"constructor":ve,this.parseClassMethod(ge,xe,Ce,_e)}else this.parseClassField(ge);return ge};Ie.isClassElementNameStart=function(){return this.type===Se.name||this.type===Se.privateId||this.type===Se.num||this.type===Se.string||this.type===Se.bracketL||this.type.keyword};Ie.parseClassElementName=function(i){if(this.type===Se.privateId){if(this.value==="constructor")this.raise(this.start,"Classes can't have an element named '#constructor'");i.computed=!1,i.key=this.parsePrivateIdent()}else this.parsePropertyName(i)};Ie.parseClassMethod=function(i,q,ge,ye){var xe=i.key;if(i.kind==="constructor"){if(q)this.raise(xe.start,"Constructor can't be a generator");if(ge)this.raise(xe.start,"Constructor can't be an async method")}else if(i.static&&Wn(i,"prototype"))this.raise(xe.start,"Classes may not have a static property named prototype");var Ce=i.value=this.parseMethod(q,ge,ye);if(i.kind==="get"&&Ce.params.length!==0)this.raiseRecoverable(Ce.start,"getter should have no params");if(i.kind==="set"&&Ce.params.length!==1)this.raiseRecoverable(Ce.start,"setter should have exactly one param");if(i.kind==="set"&&Ce.params[0].type==="RestElement")this.raiseRecoverable(Ce.params[0].start,"Setter cannot use rest params");return this.finishNode(i,"MethodDefinition")};Ie.parseClassField=function(i){if(Wn(i,"constructor"))this.raise(i.key.start,"Classes can't have a field named 'constructor'");else if(i.static&&Wn(i,"prototype"))this.raise(i.key.start,"Classes can't have a static field named 'prototype'");if(this.eat(Se.eq))this.enterScope(xn|Jn),i.value=this.parseMaybeAssign(),this.exitScope();else i.value=null;return this.semicolon(),this.finishNode(i,"PropertyDefinition")};Ie.parseClassStaticBlock=function(i){i.body=[];var q=this.labels;this.labels=[],this.enterScope(Kt|Jn);while(this.type!==Se.braceR){var ge=this.parseStatement(null);i.body.push(ge)}return this.next(),this.exitScope(),this.labels=q,this.finishNode(i,"StaticBlock")};Ie.parseClassId=function(i,q){if(this.type===Se.name){if(i.id=this.parseIdent(),q)this.checkLValSimple(i.id,Ot,!1)}else{if(q===!0)this.unexpected();i.id=null}};Ie.parseClassSuper=function(i){i.superClass=this.eat(Se._extends)?this.parseExprSubscripts(null,!1):null};Ie.enterClassBody=function(){var i={declared:Object.create(null),used:[]};return this.privateNameStack.push(i),i.declared};Ie.exitClassBody=function(){var i=this.privateNameStack.pop(),{declared:q,used:ge}=i;if(!this.options.checkPrivateFields)return;var ye=this.privateNameStack.length,xe=ye===0?null:this.privateNameStack[ye-1];for(var Ce=0;Ce<ge.length;++Ce){var ve=ge[Ce];if(!en(q,ve.name))if(xe)xe.used.push(ve);else this.raiseRecoverable(ve.start,"Private field '#"+ve.name+"' must be declared in an enclosing class")}};function bc(i,q){var ge=q.key.name,ye=i[ge],xe="true";if(q.type==="MethodDefinition"&&(q.kind==="get"||q.kind==="set"))xe=(q.static?"s":"i")+q.kind;if(ye==="iget"&&xe==="iset"||ye==="iset"&&xe==="iget"||ye==="sget"&&xe==="sset"||ye==="sset"&&xe==="sget")return i[ge]="true",!1;else if(!ye)return i[ge]=xe,!1;else return!0}function Wn(i,q){var{computed:ge,key:ye}=i;return!ge&&(ye.type==="Identifier"&&ye.name===q||ye.type==="Literal"&&ye.value===q)}Ie.parseExportAllDeclaration=function(i,q){if(this.options.ecmaVersion>=11)if(this.eatContextual("as"))i.exported=this.parseModuleExportName(),this.checkExport(q,i.exported,this.lastTokStart);else i.exported=null;if(this.expectContextual("from"),this.type!==Se.string)this.unexpected();if(i.source=this.parseExprAtom(),this.options.ecmaVersion>=16)i.attributes=this.parseWithClause();return this.semicolon(),this.finishNode(i,"ExportAllDeclaration")};Ie.parseExport=function(i,q){if(this.next(),this.eat(Se.star))return this.parseExportAllDeclaration(i,q);if(this.eat(Se._default))return this.checkExport(q,"default",this.lastTokStart),i.declaration=this.parseExportDefaultDeclaration(),this.finishNode(i,"ExportDefaultDeclaration");if(this.shouldParseExportStatement()){if(i.declaration=this.parseExportDeclaration(i),i.declaration.type==="VariableDeclaration")this.checkVariableExport(q,i.declaration.declarations);else this.checkExport(q,i.declaration.id,i.declaration.id.start);if(i.specifiers=[],i.source=null,this.options.ecmaVersion>=16)i.attributes=[]}else{if(i.declaration=null,i.specifiers=this.parseExportSpecifiers(q),this.eatContextual("from")){if(this.type!==Se.string)this.unexpected();if(i.source=this.parseExprAtom(),this.options.ecmaVersion>=16)i.attributes=this.parseWithClause()}else{for(var ge=0,ye=i.specifiers;ge<ye.length;ge+=1){var xe=ye[ge];if(this.checkUnreserved(xe.local),this.checkLocalExport(xe.local),xe.local.type==="Literal")this.raise(xe.local.start,"A string literal cannot be used as an exported binding without `from`.")}if(i.source=null,this.options.ecmaVersion>=16)i.attributes=[]}this.semicolon()}return this.finishNode(i,"ExportNamedDeclaration")};Ie.parseExportDeclaration=function(i){return this.parseStatement(null)};Ie.parseExportDefaultDeclaration=function(){var i;if(this.type===Se._function||(i=this.isAsyncFunction())){var q=this.startNode();if(this.next(),i)this.next();return this.parseFunction(q,gn|Ms,!1,i)}else if(this.type===Se._class){var ge=this.startNode();return this.parseClass(ge,"nullableID")}else{var ye=this.parseMaybeAssign();return this.semicolon(),ye}};Ie.checkExport=function(i,q,ge){if(!i)return;if(typeof q!=="string")q=q.type==="Identifier"?q.name:q.value;if(en(i,q))this.raiseRecoverable(ge,"Duplicate export '"+q+"'");i[q]=!0};Ie.checkPatternExport=function(i,q){var ge=q.type;if(ge==="Identifier")this.checkExport(i,q,q.start);else if(ge==="ObjectPattern")for(var ye=0,xe=q.properties;ye<xe.length;ye+=1){var Ce=xe[ye];this.checkPatternExport(i,Ce)}else if(ge==="ArrayPattern")for(var ve=0,be=q.elements;ve<be.length;ve+=1){var Ee=be[ve];if(Ee)this.checkPatternExport(i,Ee)}else if(ge==="Property")this.checkPatternExport(i,q.value);else if(ge==="AssignmentPattern")this.checkPatternExport(i,q.left);else if(ge==="RestElement")this.checkPatternExport(i,q.argument)};Ie.checkVariableExport=function(i,q){if(!i)return;for(var ge=0,ye=q;ge<ye.length;ge+=1){var xe=ye[ge];this.checkPatternExport(i,xe.id)}};Ie.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()};Ie.parseExportSpecifier=function(i){var q=this.startNode();return q.local=this.parseModuleExportName(),q.exported=this.eatContextual("as")?this.parseModuleExportName():q.local,this.checkExport(i,q.exported,q.exported.start),this.finishNode(q,"ExportSpecifier")};Ie.parseExportSpecifiers=function(i){var q=[],ge=!0;this.expect(Se.braceL);while(!this.eat(Se.braceR)){if(!ge){if(this.expect(Se.comma),this.afterTrailingComma(Se.braceR))break}else ge=!1;q.push(this.parseExportSpecifier(i))}return q};Ie.parseImport=function(i){if(this.next(),this.type===Se.string)i.specifiers=vc,i.source=this.parseExprAtom();else i.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),i.source=this.type===Se.string?this.parseExprAtom():this.unexpected();if(this.options.ecmaVersion>=16)i.attributes=this.parseWithClause();return this.semicolon(),this.finishNode(i,"ImportDeclaration")};Ie.parseImportSpecifier=function(){var i=this.startNode();if(i.imported=this.parseModuleExportName(),this.eatContextual("as"))i.local=this.parseIdent();else this.checkUnreserved(i.imported),i.local=i.imported;return this.checkLValSimple(i.local,Ot),this.finishNode(i,"ImportSpecifier")};Ie.parseImportDefaultSpecifier=function(){var i=this.startNode();return i.local=this.parseIdent(),this.checkLValSimple(i.local,Ot),this.finishNode(i,"ImportDefaultSpecifier")};Ie.parseImportNamespaceSpecifier=function(){var i=this.startNode();return this.next(),this.expectContextual("as"),i.local=this.parseIdent(),this.checkLValSimple(i.local,Ot),this.finishNode(i,"ImportNamespaceSpecifier")};Ie.parseImportSpecifiers=function(){var i=[],q=!0;if(this.type===Se.name){if(i.push(this.parseImportDefaultSpecifier()),!this.eat(Se.comma))return i}if(this.type===Se.star)return i.push(this.parseImportNamespaceSpecifier()),i;this.expect(Se.braceL);while(!this.eat(Se.braceR)){if(!q){if(this.expect(Se.comma),this.afterTrailingComma(Se.braceR))break}else q=!1;i.push(this.parseImportSpecifier())}return i};Ie.parseWithClause=function(){var i=[];if(!this.eat(Se._with))return i;this.expect(Se.braceL);var q={},ge=!0;while(!this.eat(Se.braceR)){if(!ge){if(this.expect(Se.comma),this.afterTrailingComma(Se.braceR))break}else ge=!1;var ye=this.parseImportAttribute(),xe=ye.key.type==="Identifier"?ye.key.name:ye.key.value;if(en(q,xe))this.raiseRecoverable(ye.key.start,"Duplicate attribute key '"+xe+"'");q[xe]=!0,i.push(ye)}return i};Ie.parseImportAttribute=function(){var i=this.startNode();if(i.key=this.type===Se.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(Se.colon),this.type!==Se.string)this.unexpected();return i.value=this.parseExprAtom(),this.finishNode(i,"ImportAttribute")};Ie.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===Se.string){var i=this.parseLiteral(this.value);if(mc.test(i.value))this.raise(i.start,"An export name cannot include a lone surrogate.");return i}return this.parseIdent(!0)};Ie.adaptDirectivePrologue=function(i){for(var q=0;q<i.length&&this.isDirectiveCandidate(i[q]);++q)i[q].directive=i[q].expression.raw.slice(1,-1)};Ie.isDirectiveCandidate=function(i){return this.options.ecmaVersion>=5&&i.type==="ExpressionStatement"&&i.expression.type==="Literal"&&typeof i.expression.value==="string"&&(this.input[i.start]==='"'||this.input[i.start]==="'")};var Et=t.prototype;Et.toAssignable=function(i,q,ge){if(this.options.ecmaVersion>=6&&i)switch(i.type){case"Identifier":if(this.inAsync&&i.name==="await")this.raise(i.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":if(i.type="ObjectPattern",ge)this.checkPatternErrors(ge,!0);for(var ye=0,xe=i.properties;ye<xe.length;ye+=1){var Ce=xe[ye];if(this.toAssignable(Ce,q),Ce.type==="RestElement"&&(Ce.argument.type==="ArrayPattern"||Ce.argument.type==="ObjectPattern"))this.raise(Ce.argument.start,"Unexpected token")}break;case"Property":if(i.kind!=="init")this.raise(i.key.start,"Object pattern can't contain getter or setter");this.toAssignable(i.value,q);break;case"ArrayExpression":if(i.type="ArrayPattern",ge)this.checkPatternErrors(ge,!0);this.toAssignableList(i.elements,q);break;case"SpreadElement":if(i.type="RestElement",this.toAssignable(i.argument,q),i.argument.type==="AssignmentPattern")this.raise(i.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":if(i.operator!=="=")this.raise(i.left.end,"Only '=' operator can be used for specifying default value.");i.type="AssignmentPattern",delete i.operator,this.toAssignable(i.left,q);break;case"ParenthesizedExpression":this.toAssignable(i.expression,q,ge);break;case"ChainExpression":this.raiseRecoverable(i.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!q)break;default:this.raise(i.start,"Assigning to rvalue")}else if(ge)this.checkPatternErrors(ge,!0);return i};Et.toAssignableList=function(i,q){var ge=i.length;for(var ye=0;ye<ge;ye++){var xe=i[ye];if(xe)this.toAssignable(xe,q)}if(ge){var Ce=i[ge-1];if(this.options.ecmaVersion===6&&q&&Ce&&Ce.type==="RestElement"&&Ce.argument.type!=="Identifier")this.unexpected(Ce.argument.start)}return i};Et.parseSpread=function(i){var q=this.startNode();return this.next(),q.argument=this.parseMaybeAssign(!1,i),this.finishNode(q,"SpreadElement")};Et.parseRestBinding=function(){var i=this.startNode();if(this.next(),this.options.ecmaVersion===6&&this.type!==Se.name)this.unexpected();return i.argument=this.parseBindingAtom(),this.finishNode(i,"RestElement")};Et.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case Se.bracketL:var i=this.startNode();return this.next(),i.elements=this.parseBindingList(Se.bracketR,!0,!0),this.finishNode(i,"ArrayPattern");case Se.braceL:return this.parseObj(!0)}return this.parseIdent()};Et.parseBindingList=function(i,q,ge,ye){var xe=[],Ce=!0;while(!this.eat(i)){if(Ce)Ce=!1;else this.expect(Se.comma);if(q&&this.type===Se.comma)xe.push(null);else if(ge&&this.afterTrailingComma(i))break;else if(this.type===Se.ellipsis){var ve=this.parseRestBinding();if(this.parseBindingListItem(ve),xe.push(ve),this.type===Se.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");this.expect(i);break}else xe.push(this.parseAssignableListItem(ye))}return xe};Et.parseAssignableListItem=function(i){var q=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(q),q};Et.parseBindingListItem=function(i){return i};Et.parseMaybeDefault=function(i,q,ge){if(ge=ge||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(Se.eq))return ge;var ye=this.startNodeAt(i,q);return ye.left=ge,ye.right=this.parseMaybeAssign(),this.finishNode(ye,"AssignmentPattern")};Et.checkLValSimple=function(i,q,ge){if(q===void 0)q=Hn;var ye=q!==Hn;switch(i.type){case"Identifier":if(this.strict&&this.reservedWordsStrictBind.test(i.name))this.raiseRecoverable(i.start,(ye?"Binding ":"Assigning to ")+i.name+" in strict mode");if(ye){if(q===Ot&&i.name==="let")this.raiseRecoverable(i.start,"let is disallowed as a lexically bound name");if(ge){if(en(ge,i.name))this.raiseRecoverable(i.start,"Argument name clash");ge[i.name]=!0}if(q!==Bs)this.declareName(i.name,q,i.start)}break;case"ChainExpression":this.raiseRecoverable(i.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(ye)this.raiseRecoverable(i.start,"Binding member expression");break;case"ParenthesizedExpression":if(ye)this.raiseRecoverable(i.start,"Binding parenthesized expression");return this.checkLValSimple(i.expression,q,ge);default:this.raise(i.start,(ye?"Binding":"Assigning to")+" rvalue")}};Et.checkLValPattern=function(i,q,ge){if(q===void 0)q=Hn;switch(i.type){case"ObjectPattern":for(var ye=0,xe=i.properties;ye<xe.length;ye+=1){var Ce=xe[ye];this.checkLValInnerPattern(Ce,q,ge)}break;case"ArrayPattern":for(var ve=0,be=i.elements;ve<be.length;ve+=1){var Ee=be[ve];if(Ee)this.checkLValInnerPattern(Ee,q,ge)}break;default:this.checkLValSimple(i,q,ge)}};Et.checkLValInnerPattern=function(i,q,ge){if(q===void 0)q=Hn;switch(i.type){case"Property":this.checkLValInnerPattern(i.value,q,ge);break;case"AssignmentPattern":this.checkLValPattern(i.left,q,ge);break;case"RestElement":this.checkLValPattern(i.argument,q,ge);break;default:this.checkLValPattern(i,q,ge)}};var Ct=function(q,ge,ye,xe,Ce){this.token=q,this.isExpr=!!ge,this.preserveSpace=!!ye,this.override=xe,this.generator=!!Ce},Qe={b_stat:new Ct("{",!1),b_expr:new Ct("{",!0),b_tmpl:new Ct("${",!1),p_stat:new Ct("(",!1),p_expr:new Ct("(",!0),q_tmpl:new Ct("`",!0,!0,function(i){return i.tryReadTemplateToken()}),f_stat:new Ct("function",!1),f_expr:new Ct("function",!0),f_expr_gen:new Ct("function",!0,!1,null,!0),f_gen:new Ct("function",!1,!1,null,!0)},tn=t.prototype;tn.initialContext=function(){return[Qe.b_stat]};tn.curContext=function(){return this.context[this.context.length-1]};tn.braceIsBlock=function(i){var q=this.curContext();if(q===Qe.f_expr||q===Qe.f_stat)return!0;if(i===Se.colon&&(q===Qe.b_stat||q===Qe.b_expr))return!q.isExpr;if(i===Se._return||i===Se.name&&this.exprAllowed)return ut.test(this.input.slice(this.lastTokEnd,this.start));if(i===Se._else||i===Se.semi||i===Se.eof||i===Se.parenR||i===Se.arrow)return!0;if(i===Se.braceL)return q===Qe.b_stat;if(i===Se._var||i===Se._const||i===Se.name)return!1;return!this.exprAllowed};tn.inGeneratorContext=function(){for(var i=this.context.length-1;i>=1;i--){var q=this.context[i];if(q.token==="function")return q.generator}return!1};tn.updateContext=function(i){var q,ge=this.type;if(ge.keyword&&i===Se.dot)this.exprAllowed=!1;else if(q=ge.updateContext)q.call(this,i);else this.exprAllowed=ge.beforeExpr};tn.overrideContext=function(i){if(this.curContext()!==i)this.context[this.context.length-1]=i};Se.parenR.updateContext=Se.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var i=this.context.pop();if(i===Qe.b_stat&&this.curContext().token==="function")i=this.context.pop();this.exprAllowed=!i.isExpr};Se.braceL.updateContext=function(i){this.context.push(this.braceIsBlock(i)?Qe.b_stat:Qe.b_expr),this.exprAllowed=!0};Se.dollarBraceL.updateContext=function(){this.context.push(Qe.b_tmpl),this.exprAllowed=!0};Se.parenL.updateContext=function(i){var q=i===Se._if||i===Se._for||i===Se._with||i===Se._while;this.context.push(q?Qe.p_stat:Qe.p_expr),this.exprAllowed=!0};Se.incDec.updateContext=function(){};Se._function.updateContext=Se._class.updateContext=function(i){if(i.beforeExpr&&i!==Se._else&&!(i===Se.semi&&this.curContext()!==Qe.p_stat)&&!(i===Se._return&&ut.test(this.input.slice(this.lastTokEnd,this.start)))&&!((i===Se.colon||i===Se.braceL)&&this.curContext()===Qe.b_stat))this.context.push(Qe.f_expr);else this.context.push(Qe.f_stat);this.exprAllowed=!1};Se.colon.updateContext=function(){if(this.curContext().token==="function")this.context.pop();this.exprAllowed=!0};Se.backQuote.updateContext=function(){if(this.curContext()===Qe.q_tmpl)this.context.pop();else this.context.push(Qe.q_tmpl);this.exprAllowed=!1};Se.star.updateContext=function(i){if(i===Se._function){var q=this.context.length-1;if(this.context[q]===Qe.f_expr)this.context[q]=Qe.f_expr_gen;else this.context[q]=Qe.f_gen}this.exprAllowed=!0};Se.name.updateContext=function(i){var q=!1;if(this.options.ecmaVersion>=6&&i!==Se.dot){if(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())q=!0}this.exprAllowed=q};var Le=t.prototype;Le.checkPropClash=function(i,q,ge){if(this.options.ecmaVersion>=9&&i.type==="SpreadElement")return;if(this.options.ecmaVersion>=6&&(i.computed||i.method||i.shorthand))return;var ye=i.key,xe;switch(ye.type){case"Identifier":xe=ye.name;break;case"Literal":xe=String(ye.value);break;default:return}var Ce=i.kind;if(this.options.ecmaVersion>=6){if(xe==="__proto__"&&Ce==="init"){if(q.proto)if(ge){if(ge.doubleProto<0)ge.doubleProto=ye.start}else this.raiseRecoverable(ye.start,"Redefinition of __proto__ property");q.proto=!0}return}xe="$"+xe;var ve=q[xe];if(ve){var be;if(Ce==="init")be=this.strict&&ve.init||ve.get||ve.set;else be=ve.init||ve[Ce];if(be)this.raiseRecoverable(ye.start,"Redefinition of property")}else ve=q[xe]={init:!1,get:!1,set:!1};ve[Ce]=!0};Le.parseExpression=function(i,q){var ge=this;return this.catchStackOverflow(function(){var{start:ye,startLoc:xe}=ge,Ce=ge.parseMaybeAssign(i,q);if(ge.type===Se.comma){var ve=ge.startNodeAt(ye,xe);ve.expressions=[Ce];while(ge.eat(Se.comma))ve.expressions.push(ge.parseMaybeAssign(i,q));return ge.finishNode(ve,"SequenceExpression")}return Ce})};Le.parseMaybeAssign=function(i,q,ge){if(this.isContextual("yield"))if(this.inGenerator)return this.parseYield(i);else this.exprAllowed=!1;var ye=!1,xe=-1,Ce=-1,ve=-1;if(q)xe=q.parenthesizedAssign,Ce=q.trailingComma,ve=q.doubleProto,q.parenthesizedAssign=q.trailingComma=-1;else q=new Xn,ye=!0;var be=this.start,Ee=this.startLoc;if(this.type===Se.parenL||this.type===Se.name)this.potentialArrowAt=this.start,this.potentialArrowInForAwait=i==="await";var ke=this.parseMaybeConditional(i,q);if(ge)ke=ge.call(this,ke,be,Ee);if(this.type.isAssign){var _e=this.startNodeAt(be,Ee);if(_e.operator=this.value,this.type===Se.eq)ke=this.toAssignable(ke,!1,q);if(!ye)q.parenthesizedAssign=q.trailingComma=q.doubleProto=-1;if(q.shorthandAssign>=ke.start)q.shorthandAssign=-1;if(this.type===Se.eq)this.checkLValPattern(ke);else this.checkLValSimple(ke);if(_e.left=ke,this.next(),_e.right=this.parseMaybeAssign(i),ve>-1)q.doubleProto=ve;return this.finishNode(_e,"AssignmentExpression")}else if(ye)this.checkExpressionErrors(q,!0);if(xe>-1)q.parenthesizedAssign=xe;if(Ce>-1)q.trailingComma=Ce;return ke};Le.parseMaybeConditional=function(i,q){var ge=this.start,ye=this.startLoc,xe=this.parseExprOps(i,q);if(this.checkExpressionErrors(q))return xe;if(!(xe.type==="ArrowFunctionExpression"&&xe.start===ge)&&this.eat(Se.question)){var Ce=this.startNodeAt(ge,ye);return Ce.test=xe,Ce.consequent=this.parseMaybeAssign(),this.expect(Se.colon),Ce.alternate=this.parseMaybeAssign(i),this.finishNode(Ce,"ConditionalExpression")}return xe};Le.parseExprOps=function(i,q){var ge=this.start,ye=this.startLoc,xe=this.parseMaybeUnary(q,!1,!1,i);if(this.checkExpressionErrors(q))return xe;return xe.start===ge&&xe.type==="ArrowFunctionExpression"?xe:this.parseExprOp(xe,ge,ye,-1,i)};Le.parseExprOp=function(i,q,ge,ye,xe){var Ce=this.type.binop;if(Ce!=null&&(!xe||this.type!==Se._in)){if(Ce>ye){var ve=this.type===Se.logicalOR||this.type===Se.logicalAND,be=this.type===Se.coalesce;if(be)Ce=Se.logicalAND.binop;var Ee=this.value;this.next();var ke=this.start,_e=this.startLoc,Pe=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,xe),ke,_e,Ce,xe),we=this.buildBinary(q,ge,i,Pe,Ee,ve||be);if(ve&&this.type===Se.coalesce||be&&(this.type===Se.logicalOR||this.type===Se.logicalAND))this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses");return this.parseExprOp(we,q,ge,ye,xe)}}return i};Le.buildBinary=function(i,q,ge,ye,xe,Ce){if(ye.type==="PrivateIdentifier")this.raise(ye.start,"Private identifier can only be left side of binary expression");var ve=this.startNodeAt(i,q);return ve.left=ge,ve.operator=xe,ve.right=ye,this.finishNode(ve,Ce?"LogicalExpression":"BinaryExpression")};Le.parseMaybeUnary=function(i,q,ge,ye){var xe=this.start,Ce=this.startLoc,ve;if(this.isContextual("await")&&this.canAwait)ve=this.parseAwait(ye),q=!0;else if(this.type.prefix){var be=this.startNode(),Ee=this.type===Se.incDec;if(be.operator=this.value,be.prefix=!0,this.next(),be.argument=this.parseMaybeUnary(null,!0,Ee,ye),this.checkExpressionErrors(i,!0),Ee)this.checkLValSimple(be.argument);else if(this.strict&&be.operator==="delete"&&js(be.argument))this.raiseRecoverable(be.start,"Deleting local variable in strict mode");else if(be.operator==="delete"&&Fr(be.argument))this.raiseRecoverable(be.start,"Private fields can not be deleted");else q=!0;ve=this.finishNode(be,Ee?"UpdateExpression":"UnaryExpression")}else if(!q&&this.type===Se.privateId){if((ye||this.privateNameStack.length===0)&&this.options.checkPrivateFields)this.unexpected();if(ve=this.parsePrivateIdent(),this.type!==Se._in)this.unexpected()}else{if(ve=this.parseExprSubscripts(i,ye),this.checkExpressionErrors(i))return ve;while(this.type.postfix&&!this.canInsertSemicolon()){var ke=this.startNodeAt(xe,Ce);ke.operator=this.value,ke.prefix=!1,ke.argument=ve,this.checkLValSimple(ve),this.next(),ve=this.finishNode(ke,"UpdateExpression")}}if(!ge&&!(ve.type==="ArrowFunctionExpression"&&ve.start===xe)&&this.eat(Se.starstar))if(q)this.unexpected(this.lastTokStart);else return this.buildBinary(xe,Ce,ve,this.parseMaybeUnary(null,!1,!1,ye),"**",!1);else return ve};function js(i){return i.type==="Identifier"||i.type==="ParenthesizedExpression"&&js(i.expression)}function Fr(i){return i.type==="MemberExpression"&&i.property.type==="PrivateIdentifier"||i.type==="ChainExpression"&&Fr(i.expression)||i.type==="ParenthesizedExpression"&&Fr(i.expression)}Le.parseExprSubscripts=function(i,q){var ge=this.start,ye=this.startLoc,xe=this.parseExprAtom(i,q);if(xe.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return xe;var Ce=this.parseSubscripts(xe,ge,ye,!1,q);if(i&&Ce.type==="MemberExpression"){if(i.parenthesizedAssign>=Ce.start)i.parenthesizedAssign=-1;if(i.parenthesizedBind>=Ce.start)i.parenthesizedBind=-1;if(i.trailingComma>=Ce.start)i.trailingComma=-1}return Ce};Le.parseSubscripts=function(i,q,ge,ye,xe){var Ce=this.options.ecmaVersion>=8&&i.type==="Identifier"&&i.name==="async"&&this.lastTokEnd===i.end&&!this.canInsertSemicolon()&&i.end-i.start===5&&this.potentialArrowAt===i.start,ve=!1;while(!0){var be=this.parseSubscript(i,q,ge,ye,Ce,ve,xe);if(be.optional)ve=!0;if(be===i||be.type==="ArrowFunctionExpression"){if(ve){var Ee=this.startNodeAt(q,ge);Ee.expression=be,be=this.finishNode(Ee,"ChainExpression")}return be}i=be}};Le.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(Se.arrow)};Le.parseSubscriptAsyncArrow=function(i,q,ge,ye){return this.parseArrowExpression(this.startNodeAt(i,q),ge,!0,ye)};Le.parseSubscript=function(i,q,ge,ye,xe,Ce,ve){var be=this.options.ecmaVersion>=11,Ee=be&&this.eat(Se.questionDot);if(ye&&Ee)this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var ke=this.eat(Se.bracketL);if(ke||Ee&&this.type!==Se.parenL&&this.type!==Se.backQuote||this.eat(Se.dot)){var _e=this.startNodeAt(q,ge);if(_e.object=i,ke)_e.property=this.parseExpression(),this.expect(Se.bracketR);else if(this.type===Se.privateId&&i.type!=="Super")_e.property=this.parsePrivateIdent();else _e.property=this.parseIdent(this.options.allowReserved!=="never");if(_e.computed=!!ke,be)_e.optional=Ee;i=this.finishNode(_e,"MemberExpression")}else if(!ye&&this.eat(Se.parenL)){var Pe=new Xn,we=this.yieldPos,Te=this.awaitPos,Ne=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var Oe=this.parseExprList(Se.parenR,this.options.ecmaVersion>=8,!1,Pe);if(xe&&!Ee&&this.shouldParseAsyncArrow()){if(this.checkPatternErrors(Pe,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0)this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function");return this.yieldPos=we,this.awaitPos=Te,this.awaitIdentPos=Ne,this.parseSubscriptAsyncArrow(q,ge,Oe,ve)}this.checkExpressionErrors(Pe,!0),this.yieldPos=we||this.yieldPos,this.awaitPos=Te||this.awaitPos,this.awaitIdentPos=Ne||this.awaitIdentPos;var Ae=this.startNodeAt(q,ge);if(Ae.callee=i,Ae.arguments=Oe,be)Ae.optional=Ee;i=this.finishNode(Ae,"CallExpression")}else if(this.type===Se.backQuote){if(Ee||Ce)this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var $e=this.startNodeAt(q,ge);$e.tag=i,$e.quasi=this.parseTemplate({isTagged:!0}),i=this.finishNode($e,"TaggedTemplateExpression")}return i};Le.parseExprAtom=function(i,q,ge){if(this.type===Se.slash)this.readRegexp();var ye,xe=this.potentialArrowAt===this.start;switch(this.type){case Se._super:if(!this.allowSuper)this.raise(this.start,"'super' keyword outside a method");if(ye=this.startNode(),this.next(),this.type===Se.parenL&&!this.allowDirectSuper)this.raise(ye.start,"super() call outside constructor of a subclass");if(this.type!==Se.dot&&this.type!==Se.bracketL&&this.type!==Se.parenL)this.unexpected();return this.finishNode(ye,"Super");case Se._this:return ye=this.startNode(),this.next(),this.finishNode(ye,"ThisExpression");case Se.name:var Ce=this.start,ve=this.startLoc,be=this.containsEsc,Ee=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!be&&Ee.name==="async"&&!this.canInsertSemicolon()&&this.eat(Se._function))return this.overrideContext(Qe.f_expr),this.parseFunction(this.startNodeAt(Ce,ve),0,!1,!0,q);if(xe&&!this.canInsertSemicolon()){if(this.eat(Se.arrow))return this.parseArrowExpression(this.startNodeAt(Ce,ve),[Ee],!1,q);if(this.options.ecmaVersion>=8&&Ee.name==="async"&&this.type===Se.name&&!be&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc)){if(Ee=this.parseIdent(!1),this.canInsertSemicolon()||!this.eat(Se.arrow))this.unexpected();return this.parseArrowExpression(this.startNodeAt(Ce,ve),[Ee],!0,q)}}return Ee;case Se.regexp:var ke=this.value;return ye=this.parseLiteral(ke.value),ye.regex={pattern:ke.pattern,flags:ke.flags},ye;case Se.num:case Se.string:return this.parseLiteral(this.value);case Se._null:case Se._true:case Se._false:return ye=this.startNode(),ye.value=this.type===Se._null?null:this.type===Se._true,ye.raw=this.type.keyword,this.next(),this.finishNode(ye,"Literal");case Se.parenL:var _e=this.start,Pe=this.parseParenAndDistinguishExpression(xe,q);if(i){if(i.parenthesizedAssign<0&&!this.isSimpleAssignTarget(Pe))i.parenthesizedAssign=_e;if(i.parenthesizedBind<0)i.parenthesizedBind=_e}return Pe;case Se.bracketL:return ye=this.startNode(),this.next(),ye.elements=this.parseExprList(Se.bracketR,!0,!0,i),this.finishNode(ye,"ArrayExpression");case Se.braceL:return this.overrideContext(Qe.b_expr),this.parseObj(!1,i);case Se._function:return ye=this.startNode(),this.next(),this.parseFunction(ye,0);case Se._class:return this.parseClass(this.startNode(),!1);case Se._new:return this.parseNew();case Se.backQuote:return this.parseTemplate();case Se._import:if(this.options.ecmaVersion>=11)return this.parseExprImport(ge);else return this.unexpected();default:return this.parseExprAtomDefault()}};Le.parseExprAtomDefault=function(){this.unexpected()};Le.parseExprImport=function(i){var q=this.startNode();if(this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword import");if(this.next(),this.type===Se.parenL&&!i)return this.parseDynamicImport(q);else if(this.type===Se.dot){var ge=this.startNodeAt(q.start,q.loc&&q.loc.start);return ge.name="import",q.meta=this.finishNode(ge,"Identifier"),this.parseImportMeta(q)}else this.unexpected()};Le.parseDynamicImport=function(i){if(this.next(),i.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)if(!this.eat(Se.parenR))if(this.expect(Se.comma),!this.afterTrailingComma(Se.parenR)){if(i.options=this.parseMaybeAssign(),!this.eat(Se.parenR)){if(this.expect(Se.comma),!this.afterTrailingComma(Se.parenR))this.unexpected()}}else i.options=null;else i.options=null;else if(!this.eat(Se.parenR)){var q=this.start;if(this.eat(Se.comma)&&this.eat(Se.parenR))this.raiseRecoverable(q,"Trailing comma is not allowed in import()");else this.unexpected(q)}return this.finishNode(i,"ImportExpression")};Le.parseImportMeta=function(i){this.next();var q=this.containsEsc;if(i.property=this.parseIdent(!0),i.property.name!=="meta")this.raiseRecoverable(i.property.start,"The only valid meta property for import is 'import.meta'");if(q)this.raiseRecoverable(i.start,"'import.meta' must not contain escaped characters");if(this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere)this.raiseRecoverable(i.start,"Cannot use 'import.meta' outside a module");return this.finishNode(i,"MetaProperty")};Le.parseLiteral=function(i){var q=this.startNode();if(q.value=i,q.raw=this.input.slice(this.start,this.end),q.raw.charCodeAt(q.raw.length-1)===110)q.bigint=q.value!=null?q.value.toString():q.raw.slice(0,-1).replace(/_/g,"");return this.next(),this.finishNode(q,"Literal")};Le.parseParenExpression=function(){this.expect(Se.parenL);var i=this.parseExpression();return this.expect(Se.parenR),i};Le.shouldParseArrow=function(i){return!this.canInsertSemicolon()};Le.parseParenAndDistinguishExpression=function(i,q){var ge=this.start,ye=this.startLoc,xe,Ce=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var ve=this.start,be=this.startLoc,Ee=[],ke=!0,_e=!1,Pe=new Xn,we=this.yieldPos,Te=this.awaitPos,Ne;this.yieldPos=0,this.awaitPos=0;while(this.type!==Se.parenR)if(ke?ke=!1:this.expect(Se.comma),Ce&&this.afterTrailingComma(Se.parenR,!0)){_e=!0;break}else if(this.type===Se.ellipsis){if(Ne=this.start,Ee.push(this.parseParenItem(this.parseRestBinding())),this.type===Se.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else Ee.push(this.parseMaybeAssign(!1,Pe,this.parseParenItem));var Oe=this.lastTokEnd,Ae=this.lastTokEndLoc;if(this.expect(Se.parenR),i&&this.shouldParseArrow(Ee)&&this.eat(Se.arrow))return this.checkPatternErrors(Pe,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=we,this.awaitPos=Te,this.parseParenArrowList(ge,ye,Ee,q);if(!Ee.length||_e)this.unexpected(this.lastTokStart);if(Ne)this.unexpected(Ne);if(this.checkExpressionErrors(Pe,!0),this.yieldPos=we||this.yieldPos,this.awaitPos=Te||this.awaitPos,Ee.length>1)xe=this.startNodeAt(ve,be),xe.expressions=Ee,this.finishNodeAt(xe,"SequenceExpression",Oe,Ae);else xe=Ee[0]}else xe=this.parseParenExpression();if(this.options.preserveParens){var $e=this.startNodeAt(ge,ye);return $e.expression=xe,this.finishNode($e,"ParenthesizedExpression")}else return xe};Le.parseParenItem=function(i){return i};Le.parseParenArrowList=function(i,q,ge,ye){return this.parseArrowExpression(this.startNodeAt(i,q),ge,!1,ye)};var Ec=[];Le.parseNew=function(){if(this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword new");var i=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===Se.dot){var q=this.startNodeAt(i.start,i.loc&&i.loc.start);q.name="new",i.meta=this.finishNode(q,"Identifier"),this.next();var ge=this.containsEsc;if(i.property=this.parseIdent(!0),i.property.name!=="target")this.raiseRecoverable(i.property.start,"The only valid meta property for new is 'new.target'");if(ge)this.raiseRecoverable(i.start,"'new.target' must not contain escaped characters");if(!this.allowNewDotTarget)this.raiseRecoverable(i.start,"'new.target' can only be used in functions and class static block");return this.finishNode(i,"MetaProperty")}var ye=this.start,xe=this.startLoc;if(i.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),ye,xe,!0,!1),i.callee.type==="Super")this.raiseRecoverable(ye,"Invalid use of 'super'");if(this.eat(Se.parenL))i.arguments=this.parseExprList(Se.parenR,this.options.ecmaVersion>=8,!1);else i.arguments=Ec;return this.finishNode(i,"NewExpression")};Le.parseTemplateElement=function(i){var q=i.isTagged,ge=this.startNode();if(this.type===Se.invalidTemplate){if(!q)this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal");ge.value={raw:this.value.replace(/\r\n?/g,`
26
- `),cooked:null}}else ge.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
27
- `),cooked:this.value};return this.next(),ge.tail=this.type===Se.backQuote,this.finishNode(ge,"TemplateElement")};Le.parseTemplate=function(i){if(i===void 0)i={};var q=i.isTagged;if(q===void 0)q=!1;var ge=this.startNode();this.next(),ge.expressions=[];var ye=this.parseTemplateElement({isTagged:q});ge.quasis=[ye];while(!ye.tail){if(this.type===Se.eof)this.raise(this.pos,"Unterminated template literal");this.expect(Se.dollarBraceL),ge.expressions.push(this.parseExpression()),this.expect(Se.braceR),ge.quasis.push(ye=this.parseTemplateElement({isTagged:q}))}return this.next(),this.finishNode(ge,"TemplateLiteral")};Le.isAsyncProp=function(i){return!i.computed&&i.key.type==="Identifier"&&i.key.name==="async"&&(this.type===Se.name||this.type===Se.num||this.type===Se.string||this.type===Se.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===Se.star)&&!ut.test(this.input.slice(this.lastTokEnd,this.start))};Le.parseObj=function(i,q){var ge=this.startNode(),ye=!0,xe={};ge.properties=[],this.next();while(!this.eat(Se.braceR)){if(!ye){if(this.expect(Se.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(Se.braceR))break}else ye=!1;var Ce=this.parseProperty(i,q);if(!i)this.checkPropClash(Ce,xe,q);ge.properties.push(Ce)}return this.finishNode(ge,i?"ObjectPattern":"ObjectExpression")};Le.parseProperty=function(i,q){var ge=this.startNode(),ye,xe,Ce,ve;if(this.options.ecmaVersion>=9&&this.eat(Se.ellipsis)){if(i){if(ge.argument=this.parseIdent(!1),this.type===Se.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");return this.finishNode(ge,"RestElement")}if(ge.argument=this.parseMaybeAssign(!1,q),this.type===Se.comma&&q&&q.trailingComma<0)q.trailingComma=this.start;return this.finishNode(ge,"SpreadElement")}if(this.options.ecmaVersion>=6){if(ge.method=!1,ge.shorthand=!1,i||q)Ce=this.start,ve=this.startLoc;if(!i)ye=this.eat(Se.star)}var be=this.containsEsc;if(this.parsePropertyName(ge),!i&&!be&&this.options.ecmaVersion>=8&&!ye&&this.isAsyncProp(ge))xe=!0,ye=this.options.ecmaVersion>=9&&this.eat(Se.star),this.parsePropertyName(ge);else xe=!1;return this.parsePropertyValue(ge,i,ye,xe,Ce,ve,q,be),this.finishNode(ge,"Property")};Le.parseGetterSetter=function(i){var q=i.key.name;this.parsePropertyName(i),i.value=this.parseMethod(!1),i.kind=q;var ge=i.kind==="get"?0:1;if(i.value.params.length!==ge){var ye=i.value.start;if(i.kind==="get")this.raiseRecoverable(ye,"getter should have no params");else this.raiseRecoverable(ye,"setter should have exactly one param")}else if(i.kind==="set"&&i.value.params[0].type==="RestElement")this.raiseRecoverable(i.value.params[0].start,"Setter cannot use rest params")};Le.parsePropertyValue=function(i,q,ge,ye,xe,Ce,ve,be){if((ge||ye)&&this.type===Se.colon)this.unexpected();if(this.eat(Se.colon))i.value=q?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,ve),i.kind="init";else if(this.options.ecmaVersion>=6&&this.type===Se.parenL){if(q)this.unexpected();i.method=!0,i.value=this.parseMethod(ge,ye),i.kind="init"}else if(!q&&!be&&this.options.ecmaVersion>=5&&!i.computed&&i.key.type==="Identifier"&&(i.key.name==="get"||i.key.name==="set")&&(this.type!==Se.comma&&this.type!==Se.braceR&&this.type!==Se.eq)){if(ge||ye)this.unexpected();this.parseGetterSetter(i)}else if(this.options.ecmaVersion>=6&&!i.computed&&i.key.type==="Identifier"){if(ge||ye)this.unexpected();if(this.checkUnreserved(i.key),i.key.name==="await"&&!this.awaitIdentPos)this.awaitIdentPos=xe;if(q)i.value=this.parseMaybeDefault(xe,Ce,this.copyNode(i.key));else if(this.type===Se.eq&&ve){if(ve.shorthandAssign<0)ve.shorthandAssign=this.start;i.value=this.parseMaybeDefault(xe,Ce,this.copyNode(i.key))}else i.value=this.copyNode(i.key);i.kind="init",i.shorthand=!0}else this.unexpected()};Le.parsePropertyName=function(i){if(this.options.ecmaVersion>=6)if(this.eat(Se.bracketL))return i.computed=!0,i.key=this.parseMaybeAssign(),this.expect(Se.bracketR),i.key;else i.computed=!1;return i.key=this.type===Se.num||this.type===Se.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};Le.initFunction=function(i){if(i.id=null,this.options.ecmaVersion>=6)i.generator=i.expression=!1;if(this.options.ecmaVersion>=8)i.async=!1};Le.parseMethod=function(i,q,ge){var ye=this.startNode(),xe=this.yieldPos,Ce=this.awaitPos,ve=this.awaitIdentPos;if(this.initFunction(ye),this.options.ecmaVersion>=6)ye.generator=i;if(this.options.ecmaVersion>=8)ye.async=!!q;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Hr(q,ye.generator)|Jn|(ge?Os:0)),this.expect(Se.parenL),ye.params=this.parseBindingList(Se.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(ye,!1,!0,!1),this.yieldPos=xe,this.awaitPos=Ce,this.awaitIdentPos=ve,this.finishNode(ye,"FunctionExpression")};Le.parseArrowExpression=function(i,q,ge,ye){var xe=this.yieldPos,Ce=this.awaitPos,ve=this.awaitIdentPos;if(this.enterScope(Hr(ge,!1)|Gr),this.initFunction(i),this.options.ecmaVersion>=8)i.async=!!ge;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,i.params=this.toAssignableList(q,!0),this.parseFunctionBody(i,!0,!1,ye),this.yieldPos=xe,this.awaitPos=Ce,this.awaitIdentPos=ve,this.finishNode(i,"ArrowFunctionExpression")};Le.parseFunctionBody=function(i,q,ge,ye){var xe=q&&this.type!==Se.braceL,Ce=this.strict,ve=!1;if(xe)i.body=this.parseMaybeAssign(ye),i.expression=!0,this.checkParams(i,!1);else{var be=this.options.ecmaVersion>=7&&!this.isSimpleParamList(i.params);if(!Ce||be){if(ve=this.strictDirective(this.end),ve&&be)this.raiseRecoverable(i.start,"Illegal 'use strict' directive in function with non-simple parameter list")}var Ee=this.labels;if(this.labels=[],ve)this.strict=!0;if(this.checkParams(i,!Ce&&!ve&&!q&&!ge&&this.isSimpleParamList(i.params)),this.strict&&i.id)this.checkLValSimple(i.id,Bs);i.body=this.parseBlock(!1,void 0,ve&&!Ce),i.expression=!1,this.adaptDirectivePrologue(i.body.body),this.labels=Ee}this.exitScope()};Le.isSimpleParamList=function(i){for(var q=0,ge=i;q<ge.length;q+=1){var ye=ge[q];if(ye.type!=="Identifier")return!1}return!0};Le.checkParams=function(i,q){var ge=Object.create(null);for(var ye=0,xe=i.params;ye<xe.length;ye+=1){var Ce=xe[ye];this.checkLValInnerPattern(Ce,Wr,q?null:ge)}};Le.parseExprList=function(i,q,ge,ye){var xe=[],Ce=!0;while(!this.eat(i)){if(!Ce){if(this.expect(Se.comma),q&&this.afterTrailingComma(i))break}else Ce=!1;var ve=void 0;if(ge&&this.type===Se.comma)ve=null;else if(this.type===Se.ellipsis){if(ve=this.parseSpread(ye),ye&&this.type===Se.comma&&ye.trailingComma<0)ye.trailingComma=this.start}else ve=this.parseMaybeAssign(!1,ye);xe.push(ve)}return xe};Le.checkUnreserved=function(i){var{start:q,end:ge,name:ye}=i;if(this.inGenerator&&ye==="yield")this.raiseRecoverable(q,"Cannot use 'yield' as identifier inside a generator");if(this.inAsync&&ye==="await")this.raiseRecoverable(q,"Cannot use 'await' as identifier inside an async function");if(!(this.currentThisScope().flags&zn)&&ye==="arguments")this.raiseRecoverable(q,"Cannot use 'arguments' in class field initializer");if(this.inClassStaticBlock&&(ye==="arguments"||ye==="await"))this.raise(q,"Cannot use "+ye+" in class static initialization block");if(this.keywords.test(ye))this.raise(q,"Unexpected keyword '"+ye+"'");if(this.options.ecmaVersion<6&&this.input.slice(q,ge).indexOf("\\")!==-1)return;var xe=this.strict?this.reservedWordsStrict:this.reservedWords;if(xe.test(ye)){if(!this.inAsync&&ye==="await")this.raiseRecoverable(q,"Cannot use keyword 'await' outside an async function");this.raiseRecoverable(q,"The keyword '"+ye+"' is reserved")}};Le.parseIdent=function(i){var q=this.parseIdentNode();if(this.next(!!i),this.finishNode(q,"Identifier"),!i){if(this.checkUnreserved(q),q.name==="await"&&!this.awaitIdentPos)this.awaitIdentPos=q.start}return q};Le.parseIdentNode=function(){var i=this.startNode();if(this.type===Se.name)i.name=this.value;else if(this.type.keyword){if(i.name=this.type.keyword,(i.name==="class"||i.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46))this.context.pop();this.type=Se.name}else this.unexpected();return i};Le.parsePrivateIdent=function(){var i=this.startNode();if(this.type===Se.privateId)i.name=this.value;else this.unexpected();if(this.next(),this.finishNode(i,"PrivateIdentifier"),this.options.checkPrivateFields)if(this.privateNameStack.length===0)this.raise(i.start,"Private field '#"+i.name+"' must be declared in an enclosing class");else this.privateNameStack[this.privateNameStack.length-1].used.push(i);return i};Le.parseYield=function(i){if(!this.yieldPos)this.yieldPos=this.start;var q=this.startNode();if(this.next(),this.type===Se.semi||this.canInsertSemicolon()||this.type!==Se.star&&!this.type.startsExpr)q.delegate=!1,q.argument=null;else q.delegate=this.eat(Se.star),q.argument=this.parseMaybeAssign(i);return this.finishNode(q,"YieldExpression")};Le.parseAwait=function(i){if(!this.awaitPos)this.awaitPos=this.start;var q=this.startNode();return this.next(),q.argument=this.parseMaybeUnary(null,!0,!1,i),this.finishNode(q,"AwaitExpression")};var Un=t.prototype;Un.raise=function(i,q){var ge=jr(this.input,i);if(q+=" ("+ge.line+":"+ge.column+")",this.sourceFile)q+=" in "+this.sourceFile;var ye=SyntaxError(q);throw ye.pos=i,ye.loc=ge,ye.raisedAt=this.pos,ye};Un.raiseRecoverable=Un.raise;Un.curPosition=function(){if(this.options.locations)return new Zt(this.curLine,this.pos-this.lineStart)};var Ft=t.prototype,Sc=function(q){this.flags=q,this.var=[],this.lexical=[],this.functions=[]};Ft.enterScope=function(i){this.scopeStack.push(new Sc(i))};Ft.exitScope=function(){this.scopeStack.pop()};Ft.treatFunctionsAsVarInScope=function(i){return i.flags&Ut||!this.inModule&&i.flags&Ht};Ft.declareName=function(i,q,ge){var ye=!1;if(q===Ot){var xe=this.currentScope();if(ye=xe.lexical.indexOf(i)>-1||xe.functions.indexOf(i)>-1||xe.var.indexOf(i)>-1,xe.lexical.push(i),this.inModule&&xe.flags&Ht)delete this.undefinedExports[i]}else if(q===Fs){var Ce=this.currentScope();Ce.lexical.push(i)}else if(q===$s){var ve=this.currentScope();if(this.treatFunctionsAsVar)ye=ve.lexical.indexOf(i)>-1;else ye=ve.lexical.indexOf(i)>-1||ve.var.indexOf(i)>-1;ve.functions.push(i)}else for(var be=this.scopeStack.length-1;be>=0;--be){var Ee=this.scopeStack[be];if(Ee.lexical.indexOf(i)>-1&&!(Ee.flags&Is&&Ee.lexical[0]===i)||!this.treatFunctionsAsVarInScope(Ee)&&Ee.functions.indexOf(i)>-1){ye=!0;break}if(Ee.var.push(i),this.inModule&&Ee.flags&Ht)delete this.undefinedExports[i];if(Ee.flags&zn)break}if(ye)this.raiseRecoverable(ge,"Identifier '"+i+"' has already been declared")};Ft.checkLocalExport=function(i){if(this.scopeStack[0].lexical.indexOf(i.name)===-1&&this.scopeStack[0].var.indexOf(i.name)===-1)this.undefinedExports[i.name]=i};Ft.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};Ft.currentVarScope=function(){for(var i=this.scopeStack.length-1;;i--){var q=this.scopeStack[i];if(q.flags&(zn|xn|Kt))return q}};Ft.currentThisScope=function(){for(var i=this.scopeStack.length-1;;i--){var q=this.scopeStack[i];if(q.flags&(zn|xn|Kt)&&!(q.flags&Gr))return q}};var Cn=function(q,ge,ye){if(this.type="",this.start=ge,this.end=0,q.options.locations)this.loc=new yn(q,ye);if(q.options.directSourceFile)this.sourceFile=q.options.directSourceFile;if(q.options.ranges)this.range=[ge,0]},vn=t.prototype;vn.startNode=function(){return new Cn(this,this.start,this.startLoc)};vn.startNodeAt=function(i,q){return new Cn(this,i,q)};function Vs(i,q,ge,ye){if(i.type=q,i.end=ge,this.options.locations)i.loc.end=ye;if(this.options.ranges)i.range[1]=ge;return i}vn.finishNode=function(i,q){return Vs.call(this,i,q,this.lastTokEnd,this.lastTokEndLoc)};vn.finishNodeAt=function(i,q,ge,ye){return Vs.call(this,i,q,ge,ye)};vn.copyNode=function(i){var q=new Cn(this,i.start,this.startLoc);for(var ge in i)q[ge]=i[ge];return q};var kc="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",Gs="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",Hs=Gs+" Extended_Pictographic",Ws=Hs,Us=Ws+" EBase EComp EMod EPres ExtPict",Ks=Us,_c=Ks,Pc={9:Gs,10:Hs,11:Ws,12:Us,13:Ks,14:_c},wc="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",Ac={9:"",10:"",11:"",12:"",13:"",14:wc},_s="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",qs="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",Js=qs+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",zs=Js+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",Xs=zs+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",Qs=Xs+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",Tc=Qs+" "+kc,Nc={9:qs,10:Js,11:zs,12:Xs,13:Qs,14:Tc},Ys={};function Dc(i){var q=Ys[i]={binary:$t(Pc[i]+" "+_s),binaryOfStrings:$t(Ac[i]),nonBinary:{General_Category:$t(_s),Script:$t(Nc[i])}};q.nonBinary.Script_Extensions=q.nonBinary.Script,q.nonBinary.gc=q.nonBinary.General_Category,q.nonBinary.sc=q.nonBinary.Script,q.nonBinary.scx=q.nonBinary.Script_Extensions}for(mn=0,Vn=[9,10,11,12,13,14];mn<Vn.length;mn+=1)Br=Vn[mn],Dc(Br);var Br,mn,Vn,Re=t.prototype,Kn=function(q,ge){this.parent=q,this.base=ge||this};Kn.prototype.separatedFrom=function(q){for(var ge=this;ge;ge=ge.parent)for(var ye=q;ye;ye=ye.parent)if(ge.base===ye.base&&ge!==ye)return!0;return!1};Kn.prototype.sibling=function(){return new Kn(this.parent,this.base)};var wt=function(q){this.parser=q,this.validFlags="gim"+(q.options.ecmaVersion>=6?"uy":"")+(q.options.ecmaVersion>=9?"s":"")+(q.options.ecmaVersion>=13?"d":"")+(q.options.ecmaVersion>=15?"v":""),this.unicodeProperties=Ys[q.options.ecmaVersion>=14?14:q.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};wt.prototype.reset=function(q,ge,ye){var xe=ye.indexOf("v")!==-1,Ce=ye.indexOf("u")!==-1;if(this.start=q|0,this.source=ge+"",this.flags=ye,xe&&this.parser.options.ecmaVersion>=15)this.switchU=!0,this.switchV=!0,this.switchN=!0;else this.switchU=Ce&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=Ce&&this.parser.options.ecmaVersion>=9};wt.prototype.raise=function(q){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+q)};wt.prototype.at=function(q,ge){if(ge===void 0)ge=!1;var ye=this.source,xe=ye.length;if(q>=xe)return-1;var Ce=ye.charCodeAt(q);if(!(ge||this.switchU)||Ce<=55295||Ce>=57344||q+1>=xe)return Ce;var ve=ye.charCodeAt(q+1);return ve>=56320&&ve<=57343?(Ce<<10)+ve-56613888:Ce};wt.prototype.nextIndex=function(q,ge){if(ge===void 0)ge=!1;var ye=this.source,xe=ye.length;if(q>=xe)return xe;var Ce=ye.charCodeAt(q),ve;if(!(ge||this.switchU)||Ce<=55295||Ce>=57344||q+1>=xe||(ve=ye.charCodeAt(q+1))<56320||ve>57343)return q+1;return q+2};wt.prototype.current=function(q){if(q===void 0)q=!1;return this.at(this.pos,q)};wt.prototype.lookahead=function(q){if(q===void 0)q=!1;return this.at(this.nextIndex(this.pos,q),q)};wt.prototype.advance=function(q){if(q===void 0)q=!1;this.pos=this.nextIndex(this.pos,q)};wt.prototype.eat=function(q,ge){if(ge===void 0)ge=!1;if(this.current(ge)===q)return this.advance(ge),!0;return!1};wt.prototype.eatChars=function(q,ge){if(ge===void 0)ge=!1;var ye=this.pos;for(var xe=0,Ce=q;xe<Ce.length;xe+=1){var ve=Ce[xe],be=this.at(ye,ge);if(be===-1||be!==ve)return!1;ye=this.nextIndex(ye,ge)}return this.pos=ye,!0};Re.validateRegExpFlags=function(i){var{validFlags:q,flags:ge}=i,ye=!1,xe=!1;for(var Ce=0;Ce<ge.length;Ce++){var ve=ge.charAt(Ce);if(q.indexOf(ve)===-1)this.raise(i.start,"Invalid regular expression flag");if(ge.indexOf(ve,Ce+1)>-1)this.raise(i.start,"Duplicate regular expression flag");if(ve==="u")ye=!0;if(ve==="v")xe=!0}if(this.options.ecmaVersion>=15&&ye&&xe)this.raise(i.start,"Invalid regular expression flag")};function Rc(i){for(var q in i)return!0;return!1}Re.validateRegExpPattern=function(i){if(this.regexp_pattern(i),!i.switchN&&this.options.ecmaVersion>=9&&Rc(i.groupNames))i.switchN=!0,this.regexp_pattern(i)};Re.regexp_pattern=function(i){if(i.pos=0,i.lastIntValue=0,i.lastStringValue="",i.lastAssertionIsQuantifiable=!1,i.numCapturingParens=0,i.maxBackReference=0,i.groupNames=Object.create(null),i.backReferenceNames.length=0,i.branchID=null,this.regexp_disjunction(i),i.pos!==i.source.length){if(i.eat(41))i.raise("Unmatched ')'");if(i.eat(93)||i.eat(125))i.raise("Lone quantifier brackets")}if(i.maxBackReference>i.numCapturingParens)i.raise("Invalid escape");for(var q=0,ge=i.backReferenceNames;q<ge.length;q+=1){var ye=ge[q];if(!i.groupNames[ye])i.raise("Invalid named capture referenced")}};Re.regexp_disjunction=function(i){var q=this.options.ecmaVersion>=16;if(q)i.branchID=new Kn(i.branchID,null);this.regexp_alternative(i);while(i.eat(124)){if(q)i.branchID=i.branchID.sibling();this.regexp_alternative(i)}if(q)i.branchID=i.branchID.parent;if(this.regexp_eatQuantifier(i,!0))i.raise("Nothing to repeat");if(i.eat(123))i.raise("Lone quantifier brackets")};Re.regexp_alternative=function(i){while(i.pos<i.source.length&&this.regexp_eatTerm(i));};Re.regexp_eatTerm=function(i){if(this.regexp_eatAssertion(i)){if(i.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(i)){if(i.switchU)i.raise("Invalid quantifier")}return!0}if(i.switchU?this.regexp_eatAtom(i):this.regexp_eatExtendedAtom(i))return this.regexp_eatQuantifier(i),!0;return!1};Re.regexp_eatAssertion=function(i){var q=i.pos;if(i.lastAssertionIsQuantifiable=!1,i.eat(94)||i.eat(36))return!0;if(i.eat(92)){if(i.eat(66)||i.eat(98))return!0;i.pos=q}if(i.eat(40)&&i.eat(63)){var ge=!1;if(this.options.ecmaVersion>=9)ge=i.eat(60);if(i.eat(61)||i.eat(33)){if(this.regexp_disjunction(i),!i.eat(41))i.raise("Unterminated group");return i.lastAssertionIsQuantifiable=!ge,!0}}return i.pos=q,!1};Re.regexp_eatQuantifier=function(i,q){if(q===void 0)q=!1;if(this.regexp_eatQuantifierPrefix(i,q))return i.eat(63),!0;return!1};Re.regexp_eatQuantifierPrefix=function(i,q){return i.eat(42)||i.eat(43)||i.eat(63)||this.regexp_eatBracedQuantifier(i,q)};Re.regexp_eatBracedQuantifier=function(i,q){var ge=i.pos;if(i.eat(123)){var ye=0,xe=-1;if(this.regexp_eatDecimalDigits(i)){if(ye=i.lastIntValue,i.eat(44)&&this.regexp_eatDecimalDigits(i))xe=i.lastIntValue;if(i.eat(125)){if(xe!==-1&&xe<ye&&!q)i.raise("numbers out of order in {} quantifier");return!0}}if(i.switchU&&!q)i.raise("Incomplete quantifier");i.pos=ge}return!1};Re.regexp_eatAtom=function(i){return this.regexp_eatPatternCharacters(i)||i.eat(46)||this.regexp_eatReverseSolidusAtomEscape(i)||this.regexp_eatCharacterClass(i)||this.regexp_eatUncapturingGroup(i)||this.regexp_eatCapturingGroup(i)};Re.regexp_eatReverseSolidusAtomEscape=function(i){var q=i.pos;if(i.eat(92)){if(this.regexp_eatAtomEscape(i))return!0;i.pos=q}return!1};Re.regexp_eatUncapturingGroup=function(i){var q=i.pos;if(i.eat(40)){if(i.eat(63)){if(this.options.ecmaVersion>=16){var ge=this.regexp_eatModifiers(i),ye=i.eat(45);if(ge||ye){for(var xe=0;xe<ge.length;xe++){var Ce=ge.charAt(xe);if(ge.indexOf(Ce,xe+1)>-1)i.raise("Duplicate regular expression modifiers")}if(ye){var ve=this.regexp_eatModifiers(i);if(!ge&&!ve&&i.current()===58)i.raise("Invalid regular expression modifiers");for(var be=0;be<ve.length;be++){var Ee=ve.charAt(be);if(ve.indexOf(Ee,be+1)>-1||ge.indexOf(Ee)>-1)i.raise("Duplicate regular expression modifiers")}}}}if(i.eat(58)){if(this.regexp_disjunction(i),i.eat(41))return!0;i.raise("Unterminated group")}}i.pos=q}return!1};Re.regexp_eatCapturingGroup=function(i){if(i.eat(40)){if(this.options.ecmaVersion>=9)this.regexp_groupSpecifier(i);else if(i.current()===63)i.raise("Invalid group");if(this.regexp_disjunction(i),i.eat(41))return i.numCapturingParens+=1,!0;i.raise("Unterminated group")}return!1};Re.regexp_eatModifiers=function(i){var q="",ge=0;while((ge=i.current())!==-1&&Ic(ge))q+=Rt(ge),i.advance();return q};function Ic(i){return i===105||i===109||i===115}Re.regexp_eatExtendedAtom=function(i){return i.eat(46)||this.regexp_eatReverseSolidusAtomEscape(i)||this.regexp_eatCharacterClass(i)||this.regexp_eatUncapturingGroup(i)||this.regexp_eatCapturingGroup(i)||this.regexp_eatInvalidBracedQuantifier(i)||this.regexp_eatExtendedPatternCharacter(i)};Re.regexp_eatInvalidBracedQuantifier=function(i){if(this.regexp_eatBracedQuantifier(i,!0))i.raise("Nothing to repeat");return!1};Re.regexp_eatSyntaxCharacter=function(i){var q=i.current();if(Zs(q))return i.lastIntValue=q,i.advance(),!0;return!1};function Zs(i){return i===36||i>=40&&i<=43||i===46||i===63||i>=91&&i<=94||i>=123&&i<=125}Re.regexp_eatPatternCharacters=function(i){var q=i.pos,ge=0;while((ge=i.current())!==-1&&!Zs(ge))i.advance();return i.pos!==q};Re.regexp_eatExtendedPatternCharacter=function(i){var q=i.current();if(q!==-1&&q!==36&&!(q>=40&&q<=43)&&q!==46&&q!==63&&q!==91&&q!==94&&q!==124)return i.advance(),!0;return!1};Re.regexp_groupSpecifier=function(i){if(i.eat(63)){if(!this.regexp_eatGroupName(i))i.raise("Invalid group");var q=this.options.ecmaVersion>=16,ge=i.groupNames[i.lastStringValue];if(ge)if(q)for(var ye=0,xe=ge;ye<xe.length;ye+=1){var Ce=xe[ye];if(!Ce.separatedFrom(i.branchID))i.raise("Duplicate capture group name")}else i.raise("Duplicate capture group name");if(q)(ge||(i.groupNames[i.lastStringValue]=[])).push(i.branchID);else i.groupNames[i.lastStringValue]=!0}};Re.regexp_eatGroupName=function(i){if(i.lastStringValue="",i.eat(60)){if(this.regexp_eatRegExpIdentifierName(i)&&i.eat(62))return!0;i.raise("Invalid capture group name")}return!1};Re.regexp_eatRegExpIdentifierName=function(i){if(i.lastStringValue="",this.regexp_eatRegExpIdentifierStart(i)){i.lastStringValue+=Rt(i.lastIntValue);while(this.regexp_eatRegExpIdentifierPart(i))i.lastStringValue+=Rt(i.lastIntValue);return!0}return!1};Re.regexp_eatRegExpIdentifierStart=function(i){var q=i.pos,ge=this.options.ecmaVersion>=11,ye=i.current(ge);if(i.advance(ge),ye===92&&this.regexp_eatRegExpUnicodeEscapeSequence(i,ge))ye=i.lastIntValue;if(Oc(ye))return i.lastIntValue=ye,!0;return i.pos=q,!1};function Oc(i){return o(i,!0)||i===36||i===95}Re.regexp_eatRegExpIdentifierPart=function(i){var q=i.pos,ge=this.options.ecmaVersion>=11,ye=i.current(ge);if(i.advance(ge),ye===92&&this.regexp_eatRegExpUnicodeEscapeSequence(i,ge))ye=i.lastIntValue;if(Lc(ye))return i.lastIntValue=ye,!0;return i.pos=q,!1};function Lc(i){return a(i,!0)||i===36||i===95||i===8204||i===8205}Re.regexp_eatAtomEscape=function(i){if(this.regexp_eatBackReference(i)||this.regexp_eatCharacterClassEscape(i)||this.regexp_eatCharacterEscape(i)||i.switchN&&this.regexp_eatKGroupName(i))return!0;if(i.switchU){if(i.current()===99)i.raise("Invalid unicode escape");i.raise("Invalid escape")}return!1};Re.regexp_eatBackReference=function(i){var q=i.pos;if(this.regexp_eatDecimalEscape(i)){var ge=i.lastIntValue;if(i.switchU){if(ge>i.maxBackReference)i.maxBackReference=ge;return!0}if(ge<=i.numCapturingParens)return!0;i.pos=q}return!1};Re.regexp_eatKGroupName=function(i){if(i.eat(107)){if(this.regexp_eatGroupName(i))return i.backReferenceNames.push(i.lastStringValue),!0;i.raise("Invalid named reference")}return!1};Re.regexp_eatCharacterEscape=function(i){return this.regexp_eatControlEscape(i)||this.regexp_eatCControlLetter(i)||this.regexp_eatZero(i)||this.regexp_eatHexEscapeSequence(i)||this.regexp_eatRegExpUnicodeEscapeSequence(i,!1)||!i.switchU&&this.regexp_eatLegacyOctalEscapeSequence(i)||this.regexp_eatIdentityEscape(i)};Re.regexp_eatCControlLetter=function(i){var q=i.pos;if(i.eat(99)){if(this.regexp_eatControlLetter(i))return!0;i.pos=q}return!1};Re.regexp_eatZero=function(i){if(i.current()===48&&!Qn(i.lookahead()))return i.lastIntValue=0,i.advance(),!0;return!1};Re.regexp_eatControlEscape=function(i){var q=i.current();if(q===116)return i.lastIntValue=9,i.advance(),!0;if(q===110)return i.lastIntValue=10,i.advance(),!0;if(q===118)return i.lastIntValue=11,i.advance(),!0;if(q===102)return i.lastIntValue=12,i.advance(),!0;if(q===114)return i.lastIntValue=13,i.advance(),!0;return!1};Re.regexp_eatControlLetter=function(i){var q=i.current();if(eo(q))return i.lastIntValue=q%32,i.advance(),!0;return!1};function eo(i){return i>=65&&i<=90||i>=97&&i<=122}Re.regexp_eatRegExpUnicodeEscapeSequence=function(i,q){if(q===void 0)q=!1;var ge=i.pos,ye=q||i.switchU;if(i.eat(117)){if(this.regexp_eatFixedHexDigits(i,4)){var xe=i.lastIntValue;if(ye&&xe>=55296&&xe<=56319){var Ce=i.pos;if(i.eat(92)&&i.eat(117)&&this.regexp_eatFixedHexDigits(i,4)){var ve=i.lastIntValue;if(ve>=56320&&ve<=57343)return i.lastIntValue=(xe-55296)*1024+(ve-56320)+65536,!0}i.pos=Ce,i.lastIntValue=xe}return!0}if(ye&&i.eat(123)&&this.regexp_eatHexDigits(i)&&i.eat(125)&&$c(i.lastIntValue))return!0;if(ye)i.raise("Invalid unicode escape");i.pos=ge}return!1};function $c(i){return i>=0&&i<=1114111}Re.regexp_eatIdentityEscape=function(i){if(i.switchU){if(this.regexp_eatSyntaxCharacter(i))return!0;if(i.eat(47))return i.lastIntValue=47,!0;return!1}var q=i.current();if(q!==99&&(!i.switchN||q!==107))return i.lastIntValue=q,i.advance(),!0;return!1};Re.regexp_eatDecimalEscape=function(i){i.lastIntValue=0;var q=i.current();if(q>=49&&q<=57){do i.lastIntValue=10*i.lastIntValue+(q-48),i.advance();while((q=i.current())>=48&&q<=57);return!0}return!1};var to=0,It=1,vt=2;Re.regexp_eatCharacterClassEscape=function(i){var q=i.current();if(Fc(q))return i.lastIntValue=-1,i.advance(),It;var ge=!1;if(i.switchU&&this.options.ecmaVersion>=9&&((ge=q===80)||q===112)){i.lastIntValue=-1,i.advance();var ye;if(i.eat(123)&&(ye=this.regexp_eatUnicodePropertyValueExpression(i))&&i.eat(125)){if(ge&&ye===vt)i.raise("Invalid property name");return ye}i.raise("Invalid property name")}return to};function Fc(i){return i===100||i===68||i===115||i===83||i===119||i===87}Re.regexp_eatUnicodePropertyValueExpression=function(i){var q=i.pos;if(this.regexp_eatUnicodePropertyName(i)&&i.eat(61)){var ge=i.lastStringValue;if(this.regexp_eatUnicodePropertyValue(i)){var ye=i.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(i,ge,ye),It}}if(i.pos=q,this.regexp_eatLoneUnicodePropertyNameOrValue(i)){var xe=i.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(i,xe)}return to};Re.regexp_validateUnicodePropertyNameAndValue=function(i,q,ge){if(!en(i.unicodeProperties.nonBinary,q))i.raise("Invalid property name");if(!i.unicodeProperties.nonBinary[q].test(ge))i.raise("Invalid property value")};Re.regexp_validateUnicodePropertyNameOrValue=function(i,q){if(i.unicodeProperties.binary.test(q))return It;if(i.switchV&&i.unicodeProperties.binaryOfStrings.test(q))return vt;i.raise("Invalid property name")};Re.regexp_eatUnicodePropertyName=function(i){var q=0;i.lastStringValue="";while(no(q=i.current()))i.lastStringValue+=Rt(q),i.advance();return i.lastStringValue!==""};function no(i){return eo(i)||i===95}Re.regexp_eatUnicodePropertyValue=function(i){var q=0;i.lastStringValue="";while(Bc(q=i.current()))i.lastStringValue+=Rt(q),i.advance();return i.lastStringValue!==""};function Bc(i){return no(i)||Qn(i)}Re.regexp_eatLoneUnicodePropertyNameOrValue=function(i){return this.regexp_eatUnicodePropertyValue(i)};Re.regexp_eatCharacterClass=function(i){if(i.eat(91)){var q=i.eat(94),ge=this.regexp_classContents(i);if(!i.eat(93))i.raise("Unterminated character class");if(q&&ge===vt)i.raise("Negated character class may contain strings");return!0}return!1};Re.regexp_classContents=function(i){if(i.current()===93)return It;if(i.switchV)return this.regexp_classSetExpression(i);return this.regexp_nonEmptyClassRanges(i),It};Re.regexp_nonEmptyClassRanges=function(i){while(this.regexp_eatClassAtom(i)){var q=i.lastIntValue;if(i.eat(45)&&this.regexp_eatClassAtom(i)){var ge=i.lastIntValue;if(i.switchU&&(q===-1||ge===-1))i.raise("Invalid character class");if(q!==-1&&ge!==-1&&q>ge)i.raise("Range out of order in character class")}}};Re.regexp_eatClassAtom=function(i){var q=i.pos;if(i.eat(92)){if(this.regexp_eatClassEscape(i))return!0;if(i.switchU){var ge=i.current();if(ge===99||so(ge))i.raise("Invalid class escape");i.raise("Invalid escape")}i.pos=q}var ye=i.current();if(ye!==93)return i.lastIntValue=ye,i.advance(),!0;return!1};Re.regexp_eatClassEscape=function(i){var q=i.pos;if(i.eat(98))return i.lastIntValue=8,!0;if(i.switchU&&i.eat(45))return i.lastIntValue=45,!0;if(!i.switchU&&i.eat(99)){if(this.regexp_eatClassControlLetter(i))return!0;i.pos=q}return this.regexp_eatCharacterClassEscape(i)||this.regexp_eatCharacterEscape(i)};Re.regexp_classSetExpression=function(i){var q=It,ge;if(this.regexp_eatClassSetRange(i));else if(ge=this.regexp_eatClassSetOperand(i)){if(ge===vt)q=vt;var ye=i.pos;while(i.eatChars([38,38])){if(i.current()!==38&&(ge=this.regexp_eatClassSetOperand(i))){if(ge!==vt)q=It;continue}i.raise("Invalid character in character class")}if(ye!==i.pos)return q;while(i.eatChars([45,45])){if(this.regexp_eatClassSetOperand(i))continue;i.raise("Invalid character in character class")}if(ye!==i.pos)return q}else i.raise("Invalid character in character class");for(;;){if(this.regexp_eatClassSetRange(i))continue;if(ge=this.regexp_eatClassSetOperand(i),!ge)return q;if(ge===vt)q=vt}};Re.regexp_eatClassSetRange=function(i){var q=i.pos;if(this.regexp_eatClassSetCharacter(i)){var ge=i.lastIntValue;if(i.eat(45)&&this.regexp_eatClassSetCharacter(i)){var ye=i.lastIntValue;if(ge!==-1&&ye!==-1&&ge>ye)i.raise("Range out of order in character class");return!0}i.pos=q}return!1};Re.regexp_eatClassSetOperand=function(i){if(this.regexp_eatClassSetCharacter(i))return It;return this.regexp_eatClassStringDisjunction(i)||this.regexp_eatNestedClass(i)};Re.regexp_eatNestedClass=function(i){var q=i.pos;if(i.eat(91)){var ge=i.eat(94),ye=this.regexp_classContents(i);if(i.eat(93)){if(ge&&ye===vt)i.raise("Negated character class may contain strings");return ye}i.pos=q}if(i.eat(92)){var xe=this.regexp_eatCharacterClassEscape(i);if(xe)return xe;i.pos=q}return null};Re.regexp_eatClassStringDisjunction=function(i){var q=i.pos;if(i.eatChars([92,113])){if(i.eat(123)){var ge=this.regexp_classStringDisjunctionContents(i);if(i.eat(125))return ge}else i.raise("Invalid escape");i.pos=q}return null};Re.regexp_classStringDisjunctionContents=function(i){var q=this.regexp_classString(i);while(i.eat(124))if(this.regexp_classString(i)===vt)q=vt;return q};Re.regexp_classString=function(i){var q=0;while(this.regexp_eatClassSetCharacter(i))q++;return q===1?It:vt};Re.regexp_eatClassSetCharacter=function(i){var q=i.pos;if(i.eat(92)){if(this.regexp_eatCharacterEscape(i)||this.regexp_eatClassSetReservedPunctuator(i))return!0;if(i.eat(98))return i.lastIntValue=8,!0;return i.pos=q,!1}var ge=i.current();if(ge<0||ge===i.lookahead()&&Mc(ge))return!1;if(jc(ge))return!1;return i.advance(),i.lastIntValue=ge,!0};function Mc(i){return i===33||i>=35&&i<=38||i>=42&&i<=44||i===46||i>=58&&i<=64||i===94||i===96||i===126}function jc(i){return i===40||i===41||i===45||i===47||i>=91&&i<=93||i>=123&&i<=125}Re.regexp_eatClassSetReservedPunctuator=function(i){var q=i.current();if(Vc(q))return i.lastIntValue=q,i.advance(),!0;return!1};function Vc(i){return i===33||i===35||i===37||i===38||i===44||i===45||i>=58&&i<=62||i===64||i===96||i===126}Re.regexp_eatClassControlLetter=function(i){var q=i.current();if(Qn(q)||q===95)return i.lastIntValue=q%32,i.advance(),!0;return!1};Re.regexp_eatHexEscapeSequence=function(i){var q=i.pos;if(i.eat(120)){if(this.regexp_eatFixedHexDigits(i,2))return!0;if(i.switchU)i.raise("Invalid escape");i.pos=q}return!1};Re.regexp_eatDecimalDigits=function(i){var q=i.pos,ge=0;i.lastIntValue=0;while(Qn(ge=i.current()))i.lastIntValue=10*i.lastIntValue+(ge-48),i.advance();return i.pos!==q};function Qn(i){return i>=48&&i<=57}Re.regexp_eatHexDigits=function(i){var q=i.pos,ge=0;i.lastIntValue=0;while(ro(ge=i.current()))i.lastIntValue=16*i.lastIntValue+io(ge),i.advance();return i.pos!==q};function ro(i){return i>=48&&i<=57||i>=65&&i<=70||i>=97&&i<=102}function io(i){if(i>=65&&i<=70)return 10+(i-65);if(i>=97&&i<=102)return 10+(i-97);return i-48}Re.regexp_eatLegacyOctalEscapeSequence=function(i){if(this.regexp_eatOctalDigit(i)){var q=i.lastIntValue;if(this.regexp_eatOctalDigit(i)){var ge=i.lastIntValue;if(q<=3&&this.regexp_eatOctalDigit(i))i.lastIntValue=q*64+ge*8+i.lastIntValue;else i.lastIntValue=q*8+ge}else i.lastIntValue=q;return!0}return!1};Re.regexp_eatOctalDigit=function(i){var q=i.current();if(so(q))return i.lastIntValue=q-48,i.advance(),!0;return i.lastIntValue=0,!1};function so(i){return i>=48&&i<=55}Re.regexp_eatFixedHexDigits=function(i,q){var ge=i.pos;i.lastIntValue=0;for(var ye=0;ye<q;++ye){var xe=i.current();if(!ro(xe))return i.pos=ge,!1;i.lastIntValue=16*i.lastIntValue+io(xe),i.advance()}return!0};var Yn=function(q){if(this.type=q.type,this.value=q.value,this.start=q.start,this.end=q.end,q.options.locations)this.loc=new yn(q,q.startLoc,q.endLoc);if(q.options.ranges)this.range=[q.start,q.end]},Me=t.prototype;Me.next=function(i){if(!i&&this.type.keyword&&this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword);if(this.options.onToken)this.options.onToken(new Yn(this));this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()};Me.getToken=function(){return this.next(),new Yn(this)};if(typeof Symbol<"u")Me[Symbol.iterator]=function(){var i=this;return{next:function(){var q=i.getToken();return{done:q.type===Se.eof,value:q}}}};Me.nextToken=function(){var i=this.curContext();if(!i||!i.preserveSpace)this.skipSpace();if(this.start=this.pos,this.options.locations)this.startLoc=this.curPosition();if(this.pos>=this.input.length)return this.finishToken(Se.eof);if(i.override)return i.override(this);else this.readToken(this.fullCharCodeAtPos())};Me.readToken=function(i){if(o(i,this.options.ecmaVersion>=6)||i===92)return this.readWord();return this.getTokenFromCode(i)};Me.fullCharCodeAt=function(i){var q=this.input.charCodeAt(i);if(q<=55295||q>=56320)return q;var ge=this.input.charCodeAt(i+1);return ge<=56319||ge>=57344?q:(q<<10)+ge-56613888};Me.fullCharCodeAtPos=function(){return this.fullCharCodeAt(this.pos)};Me.skipBlockComment=function(){var i=this.options.onComment&&this.curPosition(),q=this.pos,ge=this.input.indexOf("*/",this.pos+=2);if(ge===-1)this.raise(this.pos-2,"Unterminated comment");if(this.pos=ge+2,this.options.locations)for(var ye=void 0,xe=q;(ye=Ns(this.input,xe,this.pos))>-1;)++this.curLine,xe=this.lineStart=ye;if(this.options.onComment)this.options.onComment(!0,this.input.slice(q+2,ge),q,this.pos,i,this.curPosition())};Me.skipLineComment=function(i){var q=this.pos,ge=this.options.onComment&&this.curPosition(),ye=this.input.charCodeAt(this.pos+=i);while(this.pos<this.input.length&&!Wt(ye))ye=this.input.charCodeAt(++this.pos);if(this.options.onComment)this.options.onComment(!1,this.input.slice(q+i,this.pos),q,this.pos,ge,this.curPosition())};Me.skipSpace=function(){e:while(this.pos<this.input.length){var i=this.input.charCodeAt(this.pos);switch(i){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(i>8&&i<14||i>=5760&&Mr.test(String.fromCharCode(i)))++this.pos;else break e}}};Me.finishToken=function(i,q){if(this.end=this.pos,this.options.locations)this.endLoc=this.curPosition();var ge=this.type;this.type=i,this.value=q,this.updateContext(ge)};Me.readToken_dot=function(){var i=this.input.charCodeAt(this.pos+1);if(i>=48&&i<=57)return this.readNumber(!0);var q=this.input.charCodeAt(this.pos+2);if(this.options.ecmaVersion>=6&&i===46&&q===46)return this.pos+=3,this.finishToken(Se.ellipsis);else return++this.pos,this.finishToken(Se.dot)};Me.readToken_slash=function(){var i=this.input.charCodeAt(this.pos+1);if(this.exprAllowed)return++this.pos,this.readRegexp();if(i===61)return this.finishOp(Se.assign,2);return this.finishOp(Se.slash,1)};Me.readToken_mult_modulo_exp=function(i){var q=this.input.charCodeAt(this.pos+1),ge=1,ye=i===42?Se.star:Se.modulo;if(this.options.ecmaVersion>=7&&i===42&&q===42)++ge,ye=Se.starstar,q=this.input.charCodeAt(this.pos+2);if(q===61)return this.finishOp(Se.assign,ge+1);return this.finishOp(ye,ge)};Me.readToken_pipe_amp=function(i){var q=this.input.charCodeAt(this.pos+1);if(q===i){if(this.options.ecmaVersion>=12){var ge=this.input.charCodeAt(this.pos+2);if(ge===61)return this.finishOp(Se.assign,3)}return this.finishOp(i===124?Se.logicalOR:Se.logicalAND,2)}if(q===61)return this.finishOp(Se.assign,2);return this.finishOp(i===124?Se.bitwiseOR:Se.bitwiseAND,1)};Me.readToken_caret=function(){var i=this.input.charCodeAt(this.pos+1);if(i===61)return this.finishOp(Se.assign,2);return this.finishOp(Se.bitwiseXOR,1)};Me.readToken_plus_min=function(i){var q=this.input.charCodeAt(this.pos+1);if(q===i){if(q===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||ut.test(this.input.slice(this.lastTokEnd,this.pos))))return this.skipLineComment(3),this.skipSpace(),this.nextToken();return this.finishOp(Se.incDec,2)}if(q===61)return this.finishOp(Se.assign,2);return this.finishOp(Se.plusMin,1)};Me.readToken_lt_gt=function(i){var q=this.input.charCodeAt(this.pos+1),ge=1;if(q===i){if(ge=i===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+ge)===61)return this.finishOp(Se.assign,ge+1);return this.finishOp(Se.bitShift,ge)}if(q===33&&i===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(q===61)ge=2;return this.finishOp(Se.relational,ge)};Me.readToken_eq_excl=function(i){var q=this.input.charCodeAt(this.pos+1);if(q===61)return this.finishOp(Se.equality,this.input.charCodeAt(this.pos+2)===61?3:2);if(i===61&&q===62&&this.options.ecmaVersion>=6)return this.pos+=2,this.finishToken(Se.arrow);return this.finishOp(i===61?Se.eq:Se.prefix,1)};Me.readToken_question=function(){var i=this.options.ecmaVersion;if(i>=11){var q=this.input.charCodeAt(this.pos+1);if(q===46){var ge=this.input.charCodeAt(this.pos+2);if(ge<48||ge>57)return this.finishOp(Se.questionDot,2)}if(q===63){if(i>=12){var ye=this.input.charCodeAt(this.pos+2);if(ye===61)return this.finishOp(Se.assign,3)}return this.finishOp(Se.coalesce,2)}}return this.finishOp(Se.question,1)};Me.readToken_numberSign=function(){var i=this.options.ecmaVersion,q=35;if(i>=13){if(++this.pos,q=this.fullCharCodeAtPos(),o(q,!0)||q===92)return this.finishToken(Se.privateId,this.readWord1())}this.raise(this.pos,"Unexpected character '"+Rt(q)+"'")};Me.getTokenFromCode=function(i){switch(i){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(Se.parenL);case 41:return++this.pos,this.finishToken(Se.parenR);case 59:return++this.pos,this.finishToken(Se.semi);case 44:return++this.pos,this.finishToken(Se.comma);case 91:return++this.pos,this.finishToken(Se.bracketL);case 93:return++this.pos,this.finishToken(Se.bracketR);case 123:return++this.pos,this.finishToken(Se.braceL);case 125:return++this.pos,this.finishToken(Se.braceR);case 58:return++this.pos,this.finishToken(Se.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(Se.backQuote);case 48:var q=this.input.charCodeAt(this.pos+1);if(q===120||q===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(q===111||q===79)return this.readRadixNumber(8);if(q===98||q===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(i);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(i);case 124:case 38:return this.readToken_pipe_amp(i);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(i);case 60:case 62:return this.readToken_lt_gt(i);case 61:case 33:return this.readToken_eq_excl(i);case 63:return this.readToken_question();case 126:return this.finishOp(Se.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+Rt(i)+"'")};Me.finishOp=function(i,q){var ge=this.input.slice(this.pos,this.pos+q);return this.pos+=q,this.finishToken(i,ge)};Me.readRegexp=function(){var i,q,ge=this.pos;for(;;){if(this.pos>=this.input.length)this.raise(ge,"Unterminated regular expression");var ye=this.input.charAt(this.pos);if(ut.test(ye))this.raise(ge,"Unterminated regular expression");if(!i){if(ye==="[")q=!0;else if(ye==="]"&&q)q=!1;else if(ye==="/"&&!q)break;i=ye==="\\"}else i=!1;++this.pos}var xe=this.input.slice(ge,this.pos);++this.pos;var Ce=this.pos,ve=this.readWord1();if(this.containsEsc)this.unexpected(Ce);var be=this.regexpState||(this.regexpState=new wt(this));be.reset(ge,xe,ve),this.validateRegExpFlags(be),this.validateRegExpPattern(be);var Ee=null;try{Ee=new RegExp(xe,ve)}catch(ke){}return this.finishToken(Se.regexp,{pattern:xe,flags:ve,value:Ee})};Me.readInt=function(i,q,ge){var ye=this.options.ecmaVersion>=12&&q===void 0,xe=ge&&this.input.charCodeAt(this.pos)===48,Ce=this.pos,ve=0,be=0;for(var Ee=0,ke=q==null?1/0:q;Ee<ke;++Ee,++this.pos){var _e=this.input.charCodeAt(this.pos),Pe=void 0;if(ye&&_e===95){if(xe)this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals");if(be===95)this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore");if(Ee===0)this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits");be=_e;continue}if(_e>=97)Pe=_e-97+10;else if(_e>=65)Pe=_e-65+10;else if(_e>=48&&_e<=57)Pe=_e-48;else Pe=1/0;if(Pe>=i)break;be=_e,ve=ve*i+Pe}if(ye&&be===95)this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits");if(this.pos===Ce||q!=null&&this.pos-Ce!==q)return null;return ve};function Gc(i,q){if(q)return parseInt(i,8);return parseFloat(i.replace(/_/g,""))}function oo(i){if(typeof BigInt!=="function")return null;return BigInt(i.replace(/_/g,""))}Me.readRadixNumber=function(i){var q=this.pos;this.pos+=2;var ge=this.readInt(i);if(ge==null)this.raise(this.start+2,"Expected number in radix "+i);if(this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110)ge=oo(this.input.slice(q,this.pos)),++this.pos;else if(o(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");return this.finishToken(Se.num,ge)};Me.readNumber=function(i){var q=this.pos;if(!i&&this.readInt(10,void 0,!0)===null)this.raise(q,"Invalid number");var ge=this.pos-q>=2&&this.input.charCodeAt(q)===48;if(ge&&this.strict)this.raise(q,"Invalid number");var ye=this.input.charCodeAt(this.pos);if(!ge&&!i&&this.options.ecmaVersion>=11&&ye===110){var xe=oo(this.input.slice(q,this.pos));if(++this.pos,o(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");return this.finishToken(Se.num,xe)}if(ge&&/[89]/.test(this.input.slice(q,this.pos)))ge=!1;if(ye===46&&!ge)++this.pos,this.readInt(10),ye=this.input.charCodeAt(this.pos);if((ye===69||ye===101)&&!ge){if(ye=this.input.charCodeAt(++this.pos),ye===43||ye===45)++this.pos;if(this.readInt(10)===null)this.raise(q,"Invalid number")}if(o(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");var Ce=Gc(this.input.slice(q,this.pos),ge);return this.finishToken(Se.num,Ce)};Me.readCodePoint=function(){var i=this.input.charCodeAt(this.pos),q;if(i===123){if(this.options.ecmaVersion<6)this.unexpected();var ge=++this.pos;if(q=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,q>1114111)this.invalidStringToken(ge,"Code point out of bounds")}else q=this.readHexChar(4);return q};Me.readString=function(i){var q="",ge=++this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated string constant");var ye=this.input.charCodeAt(this.pos);if(ye===i)break;if(ye===92)q+=this.input.slice(ge,this.pos),q+=this.readEscapedChar(!1),ge=this.pos;else if(ye===8232||ye===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(Wt(ye))this.raise(this.start,"Unterminated string constant");++this.pos}}return q+=this.input.slice(ge,this.pos++),this.finishToken(Se.string,q)};var ao={};Me.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(i){if(i===ao)this.readInvalidTemplateToken();else throw i}this.inTemplateElement=!1};Me.invalidStringToken=function(i,q){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw ao;else this.raise(i,q)};Me.readTmplToken=function(){var i="",q=this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated template");var ge=this.input.charCodeAt(this.pos);if(ge===96||ge===36&&this.input.charCodeAt(this.pos+1)===123){if(this.pos===this.start&&(this.type===Se.template||this.type===Se.invalidTemplate))if(ge===36)return this.pos+=2,this.finishToken(Se.dollarBraceL);else return++this.pos,this.finishToken(Se.backQuote);return i+=this.input.slice(q,this.pos),this.finishToken(Se.template,i)}if(ge===92)i+=this.input.slice(q,this.pos),i+=this.readEscapedChar(!0),q=this.pos;else if(Wt(ge)){switch(i+=this.input.slice(q,this.pos),++this.pos,ge){case 13:if(this.input.charCodeAt(this.pos)===10)++this.pos;case 10:i+=`
28
- `;break;default:i+=String.fromCharCode(ge);break}if(this.options.locations)++this.curLine,this.lineStart=this.pos;q=this.pos}else++this.pos}};Me.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(Se.invalidTemplate,this.input.slice(this.start,this.pos));case"\r":if(this.input[this.pos+1]===`
29
- `)++this.pos;case`
30
- `:case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,"Unterminated template")};Me.readEscapedChar=function(i){var q=this.input.charCodeAt(++this.pos);switch(++this.pos,q){case 110:return`
31
- `;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return Rt(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(i){var ge=this.pos-1;this.invalidStringToken(ge,"Invalid escape sequence in template string")}default:if(q>=48&&q<=55){var ye=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],xe=parseInt(ye,8);if(xe>255)ye=ye.slice(0,-1),xe=parseInt(ye,8);if(this.pos+=ye.length-1,q=this.input.charCodeAt(this.pos),(ye!=="0"||q===56||q===57)&&(this.strict||i))this.invalidStringToken(this.pos-1-ye.length,i?"Octal literal in template string":"Octal literal in strict mode");return String.fromCharCode(xe)}if(Wt(q)){if(this.options.locations)this.lineStart=this.pos,++this.curLine;return""}return String.fromCharCode(q)}};Me.readHexChar=function(i){var q=this.pos,ge=this.readInt(16,i);if(ge===null)this.invalidStringToken(q,"Bad character escape sequence");return ge};Me.readWord1=function(){this.containsEsc=!1;var i="",q=!0,ge=this.pos,ye=this.options.ecmaVersion>=6;while(this.pos<this.input.length){var xe=this.fullCharCodeAtPos();if(a(xe,ye))this.pos+=xe<=65535?1:2;else if(xe===92){this.containsEsc=!0,i+=this.input.slice(ge,this.pos);var Ce=this.pos;if(this.input.charCodeAt(++this.pos)!==117)this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX");++this.pos;var ve=this.readCodePoint();if(!(q?o:a)(ve,ye))this.invalidStringToken(Ce,"Invalid Unicode escape");i+=Rt(ve),ge=this.pos}else break;q=!1}return i+this.input.slice(ge,this.pos)};Me.readWord=function(){var i=this.readWord1(),q=Se.name;if(this.keywords.test(i))q=qn[i];return this.finishToken(q,i)};var uo="8.18.0";t.acorn={Parser:t,version:uo,defaultOptions:Gn,Position:Zt,SourceLocation:yn,getLineInfo:jr,Node:Cn,TokenType:We,tokTypes:Se,keywordTypes:qn,TokContext:Ct,tokContexts:Qe,isIdentifierChar:a,isIdentifierStart:o,Token:Yn,isNewLine:Wt,lineBreak:ut,lineBreakG:Ts,nonASCIIwhitespace:Mr};function Kr(i,q){return t.parse(i,q)}function Hc(i,q,ge){return t.parseExpressionAt(i,q,ge)}function Wc(i,q){return t.tokenizer(i,q)}var po=new Map;function Xc(i){return Kr(i,{ecmaVersion:"latest",sourceType:"module"})}function qr(i,q,ge=new Set){let ye=po.get(i);if(!ye)ye=Xc(i),po.set(i,ye);let xe={};for(let Ce of ye.body)if(Ce.type==="ExportDefaultDeclaration"){let ve=Ce.declaration.name;if(ve in xe)xe[ve].default=!0;else xe[ve]={source:Nt(""),default:!0}}else if(Ce.type==="ExportAllDeclaration"){if(!Ce.source)continue;let ve=fn(Ce.source.value,q),be=zc(q,ve);if(!Uc(be).isFile()){let _e=Kc(be);for(let Pe of _e)if(Pe.includes("index")){be=co(be,Pe);break}}if(ge.has(be))continue;ge.add(be);let Ee=qc(be,"utf-8"),ke=qr(Ee,Jc(be),ge);ge.delete(be);for(let[_e,Pe]of Object.entries(ke)){let we=Nt(r(`./${co(Ce.source.value,Pe.source)}`));xe[_e]={...Pe,source:we}}}else if(Ce.type==="ExportNamedDeclaration")for(let ve of Ce.specifiers){let be=ve.exported.name,Ee=ve.local.name,ke=be||Ee;if(ke in xe){if(Ce.type==="ExportNamedDeclaration")xe[ke].mixed=!0;if(!xe[ke].source)xe[ke].source=Nt(dn(Ce.source?.value??"",q))}else xe[ke]={source:Nt(dn(Ce.source?.value??"",q)),default:Ee==="default"}}else if(Ce.type==="ImportDeclaration"){let ve=Ce.specifiers[0].local.name;if(ve in xe){if(!xe[ve].source)xe[ve].source=Nt(dn(Ce.source?.value??"",q))}else xe[ve]={source:Nt(dn(Ce.source?.value??"",q)),default:ve==="default"}}return xe}import{existsSync as Qc}from"node:fs";import{dirname as Yc}from"node:path";function lo(){return{cache:new Map,computing:new Set}}var Zc=/\.[^./\\]+$/;function ep(i){if(i.endsWith(".d.ts"))return null;let q=i.replace(Zc,".d.ts");return Qc(q)?q:null}function fo(i,q,ge){let ye=Yc(i);return q.map((xe)=>{if(!xe.importSource||!xe.importedName)return{candidate:xe};let Ce=Gt(xe.importSource,ye);if(!Ce)return{candidate:xe,failureReason:"module-not-found"};let ve=Dt(Ce,ge).find((Ee)=>Ee.name===xe.importedName);if(!ve)return{candidate:xe,failureReason:"export-not-found"};if(ve.returnType)return{candidate:xe,type:ve.returnType};let be=ep(Ce);if(be){let Ee=Dt(be,ge).find((ke)=>ke.name===xe.importedName);if(Ee?.returnType)return{candidate:xe,type:Ee.returnType}}return{candidate:xe,failureReason:"return-type-unresolved"}})}function ho(i,q){switch(q){case"module-not-found":return`Prop "${i.propName}" default calls "${i.calleeName}()", but "${i.importSource}" could not be resolved; falling back to "any".`;case"export-not-found":return`Prop "${i.propName}" default calls "${i.calleeName}()", but "${i.importedName}" is not exported from "${i.importSource}"; falling back to "any".`;case"return-type-unresolved":return`Prop "${i.propName}" default calls "${i.calleeName}()" imported from "${i.importSource}", but its return type could not be resolved; falling back to "any".`}}import{dirname as tp}from"node:path";function mo(i,q,ge){let ye=tp(i);return q.map((xe)=>{let Ce=Gt(xe.importSource,ye);if(!Ce)return{candidate:xe};let ve=Dt(Ce,ge).find((be)=>be.name===xe.importedName);if(ve?.kind!=="const"||ve.literalValue===void 0)return{candidate:xe};return{candidate:xe,key:ve.literalValue}})}function E(i){return{failFast:i?.failFast,resolveTypes:i?.resolveTypes===!0,documentExports:i?.documentExports===!0,cache:i?.cache,checkExamples:i?.checkExamples===!0,dryRun:i?.dryRun===!0}}var cp=/-/g;function xo(i,q=[],ge=new Set,ye){let xe,Ce;try{if(Ce=ye??ip(i),ge.has(Ce))return q;ge.add(Ce),xe=np(i,{withFileTypes:!0})}catch{return q}for(let ve of xe){if(ve.name.startsWith("."))continue;let be=go(i,ve.name),Ee=ve.isSymbolicLink(),ke=Ee?sp(be,{throwIfNoEntry:!1}):ve;if(!ke)continue;if(ke.isDirectory())xo(be,q,ge,Ee?void 0:go(Ce,ve.name));else if(ke.isFile()&&ve.name.endsWith(".svelte"))q.push(be)}return q}function pp(i){return xo(i).map((q)=>{let ge=Zn(q).name.replace(cp,""),ye=Nt(r(`./${Jr(i,q)}`));return{moduleName:ge,source:ye}}).sort((q,ge)=>q.source.localeCompare(ge.source))}function lp(i){return Zn(i).ext!==".svelte"}function fp(i,q){let ge=i.endsWith("/")?i:`${i}/`;return q.startsWith(ge)}function zr(i,q){return{seenPaths:new Set(i.map(([,ge])=>q(ge.source))),seenModuleNamePaths:new Map(i.map(([ge,ye])=>[ge,q(ye.source)])),warnedModuleNames:new Set}}function Xr(i,q,ge,ye,xe){for(let{moduleName:Ce,source:ve}of pp(i)){let be=ye(ve),Ee=q[Ce];if(Ee&&lp(Ee.source)&&fp(Ee.source,ve)){xe.seenPaths.delete(ye(Ee.source)),Ee.source=ve,xe.seenPaths.add(be),xe.seenModuleNamePaths.set(Ce,be);continue}if(xe.seenPaths.has(be))continue;xe.seenPaths.add(be);let ke=xe.seenModuleNamePaths.get(Ce);if(ke===void 0)xe.seenModuleNamePaths.set(Ce,be);else if(ke!==be&&!xe.warnedModuleNames.has(Ce))xe.warnedModuleNames.add(Ce),console.warn(`Warning: multiple components named "${Ce}" found (${r(Jr(i,ke))} and ${r(Jr(i,be))}). Both are included in TypeScript definitions, but only one can be the named export.`);ge.push([Ce,{source:ve,default:!1}])}}function Qr(i,q,ge=!1){let ye=yo(i).isFile(),xe=ye?ap(i):i,Ce=bn(xe),ve=new Map,be=(_e)=>{let Pe=ve.get(_e);if(Pe===void 0)Pe=up(_e)?bn(_e):bn(Ce,_e),ve.set(_e,Pe);return Pe},Ee={};if(ye){let _e=rp(i,"utf-8");try{Ee=qr(_e,Ce,new Set([bn(i)]))}catch(Pe){if(!ge)throw Pe;let we=Pe instanceof Error?Pe.message:String(Pe);console.warn(`Warning: Failed to parse component exports from ${i}: ${we}`)}}let ke=Object.entries(Ee);if(q){let _e=zr(ke,be);Xr(Ce,Ee,ke,be,_e)}return{exports:Ee,allComponentEntries:ke,rootDir:Ce,resolveComponentFilePath:be}}async function er(i){let q=await Promise.all(Array.from(i).map(async(ge)=>{try{let ye=await op(ge,"utf-8");return{path:ge,content:ye}}catch(ye){return console.warn(`Warning: Failed to read file ${ge}:`,ye),{path:ge,content:null}}}));return new Map(q.map(({path:ge,content:ye})=>[ge,ye]))}function Bt([i,q],ge,ye,xe,Ce={}){let ve=q.source,{ext:be,name:Ee}=Zn(ve),ke=i;if(ge.length===1&&i==="default")ke=Ee;if(be===".svelte"){let _e=xe(ve),Pe=ye.get(_e);if(Pe===null||Pe===void 0)return null;let we=r(ve),Te=Ce.memo?.get(_e),Ne=Ce.hashes?.get(_e),Oe=Te===void 0?Ne===void 0?null:Ce.cache?.get(_e,Ne):null,Ae;if(Te!==void 0)Ae=Te;else if(Oe)Ae=Oe;else{let $e=new($n()).ComponentParser;try{Ae=$e.parseSvelteComponent(Pe,{moduleName:ke,filePath:we})}catch(De){if(Ce.failFast)throw De;let Fe=De instanceof Error?De.message:String(De),je=De instanceof Error?De.stack:void 0;return Ce.onParseError?.({filePath:we,moduleName:ke,message:Fe,stack:je}),null}if(Ne!==void 0)Ce.cache?.set(_e,Ne,Ae);Ce.memo?.set(_e,Ae)}return{moduleName:ke,filePath:we,...Ae}}return null}function Yr(i,q){let ge=new Set;for(let ye of i)for(let[,xe]of ye)if(Zn(xe.source).ext===".svelte")ge.add(q(xe.source));return ge}function tr(i){if(i.length===0)return;console.error(`sveld: failed to parse ${i.length} component(s):`);for(let{filePath:q,message:ge}of i)console.error(` - ${q}: ${ge}`)}async function S(i,q,ge={}){let ye=ge.documentExports===!0,{exports:xe,allComponentEntries:Ce,rootDir:ve,resolveComponentFilePath:be}=Qr(i,q,ye),Ee=ye&&yo(i).isFile()?await jn(bn(i)):[],ke=Object.entries(xe),_e=Yr([ke,Ce],be),Pe=await er(_e),we=new Map,Te=new Map,Ne=ge.cache===!1?void 0:new Tr(as(ve,ge.cache??!0)),Oe=Ne?new Map:void 0,Ae=new Set,$e=new Map;if(Ne)for(let Ue of _e){let Ve=Pe.get(Ue);if(Ve===null||Ve===void 0)continue;let Ze=us(Ve);if($e.set(Ue,Ze),!Ne.has(Ue,Ze))Ae.add(Ue)}if(_e.size>0&&(!Ne||Ae.size>0))await Vt();let De=new Map,Fe=new Map,je={failFast:ge.failFast===!0,onParseError:(Ue)=>De.set(Ue.filePath,Ue),cache:Ne,hashes:$e,memo:Fe};for(let Ue of ke){let Ve=Bt(Ue,ke,Pe,be,je);if(Ve)we.set(Ve.moduleName,Ve)}for(let Ue of Ce){let Ve=Bt(Ue,Ce,Pe,be,je);if(Ve)Te.set(Ve.filePath,Ve),Oe?.set(Ve.filePath,be(Ue[1].source))}if(Ne&&Ae.size>0){let Ue=ln(Te,be),Ve=In(Ae,Ue);for(let Ze of Ve){if(Ae.has(Ze))continue;Ne.invalidate(Ze),Fe.delete(Ze)}for(let Ze of ke){let at=be(Ze[1].source);if(!Ve.has(at)||Ae.has(at))continue;let lt=Bt(Ze,ke,Pe,be,je);if(lt)we.set(lt.moduleName,lt)}for(let Ze of Ce){let at=be(Ze[1].source);if(!Ve.has(at)||Ae.has(at))continue;let lt=Bt(Ze,Ce,Pe,be,je);if(lt)Te.set(lt.filePath,lt),Oe?.set(lt.filePath,at)}}let ze=Array.from(De.values());if(tr(ze),!ge.dryRun)Ne?.save();let Xe=ge.resolveTypes?yp(we):[],He=ge.checkExamples?Cp(Te):[];if(Xe.length>0||He.length>0){let{TypeResolver:Ue}=await import("./chunk-ncw3wbrj.js"),Ve=await Ue.create(ve);try{if(Xe.length>0)await xp(Xe,Ve,be);if(He.length>0)await vp(He,Ve,be)}finally{await Ve?.dispose()}}let Ye=dp(Te),et=mp(Te);if(Ye.length>0||et.length>0){await Vt();let Ue=lo();for(let{component:Ve,candidates:Ze}of Ye){let at=fo(be(Ve.filePath),Ze,Ue);hp(Ve,at)}for(let{component:Ve,candidates:Ze}of et){let at=mo(be(Ve.filePath),Ze,Ue);gp(Ve,at)}}let pt=On(Array.from(Te.values()).flatMap((Ue)=>Ue.diagnostics??[]));return{exports:xe,entryExports:Ee,components:we,allComponentsForTypes:Te,errors:ze,diagnostics:pt,cache:Ne,resolvedPathByFilePath:Oe}}function dp(i){let q=[];for(let ge of i.values()){let ye=zt(ge)?.pendingCallDefaultCandidates?.filter((xe)=>xe.importSource!==void 0);if(!ye||ye.length===0)continue;q.push({component:ge,candidates:ye})}return q}function hp(i,q){for(let{candidate:ge,type:ye,failureReason:xe}of q){let ve=(ge.location==="props"?i.props:i.moduleExports).find((be)=>be.name===ge.propName);if(ve?.typeSource!=="unknown")continue;if(ye){if(ve.type=ye,ve.typeSource="typescript",ge.location==="props")i.diagnostics=(i.diagnostics??[]).filter((be)=>!(be.kind==="prop-unknown-type"&&be.name===ge.propName));continue}if(ge.location==="props"&&xe){let be=i.diagnostics?.find((Ee)=>Ee.kind==="prop-unknown-type"&&Ee.name===ge.propName);if(be)be.message=ho(ge,xe)}}}function mp(i){let q=[];for(let ge of i.values()){let ye=zt(ge)?.pendingContextKeyCandidates;if(!ye||ye.length===0)continue;q.push({component:ge,candidates:ye})}return q}function gp(i,q){for(let{candidate:ge,key:ye}of q){if(!ye){console.warn(`Warning: Could not resolve setContext key in ${i.filePath}. Use a string literal, const-bound string, or Symbol(). Skipping context type generation.`);continue}if(i.contexts?.some((xe)=>xe.key===ye))continue;i.contexts=[...i.contexts??[],{key:ye,typeName:on(ye),description:ge.description,properties:ge.properties}]}}function yp(i){let q=[];for(let ge of i.values()){let ye=zt(ge);if(!ye?.canonicalPropsType||ge.props.length>0)continue;q.push({component:ge,metadata:ye})}return q}async function xp(i,q,ge){if(!q)return;let ye=await q.expandAll(i.map(({component:xe,metadata:Ce})=>({moduleName:xe.moduleName,metadata:Ce,filePath:ge(xe.filePath)})));for(let{component:xe}of i){let Ce=ye.get(ge(xe.filePath));if(Ce)ki(xe,Ce)}}function Cp(i){let q=[];for(let ge of i.values()){let ye=is(ge);if(ye.length===0)continue;q.push({component:ge,sources:ye})}return q}async function vp(i,q,ge){if(!q)return;let ye=await q.checkExamples(i.map(({component:xe,sources:Ce})=>({moduleName:xe.moduleName,filePath:ge(xe.filePath),sources:Ce})));for(let{component:xe,sources:Ce}of i){let ve=ye.get(ge(xe.filePath));if(!ve||ve.length===0)continue;let be=new Map(Ce.map((ke)=>[ke.id,ke.source])),Ee=xe.diagnostics??[];for(let ke of ve){let _e=be.get(ke.id);Ee.push({component:xe.filePath,kind:"example-compile-error",name:ke.name,message:ke.message,..._e?{source:_e}:{}})}xe.diagnostics=Ee}}import{existsSync as Co,readFileSync as bp}from"node:fs";import{join as vo}from"node:path";function C(i){if(i){let ge=vo(process.cwd(),i);if(Co(ge))return pn(i);return console.error(`Invalid entry point: ${ge}. Pass a valid --entry (or "entry" option), or unset it and`),console.error('set the "svelte" field in your package.json instead.'),null}let q=vo(process.cwd(),"package.json");if(!Co(q))return console.error("Could not locate a package.json file."),console.error(`Specify an entry point with --entry (or the "entry" option) instead.
32
- `),null;try{let ge=cs(JSON.parse(bp(q,"utf-8")));if(ge.svelte?.trim())return pn(ge.svelte);return console.error(`Could not determine an entry point.
33
- `),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).
34
- `),null}catch(ge){throw console.error("Error reading package.json:",ge),ge}}import{lstatSync as Ep}from"node:fs";import{resolve as bo}from"node:path";async function Eo(i,q,ge=!1){let{exports:ye,allComponentEntries:xe,rootDir:Ce,resolveComponentFilePath:ve}=Qr(i,q,ge),be=ge&&Ep(i).isFile()?await jn(bo(i)):[],Ee=Object.entries(ye),ke=zr(xe,ve),_e=new Map,Pe=new Map;await Vt();let we=new Map,Te={onParseError:(De)=>we.set(De.filePath,De)},Ne=()=>({exports:ye,entryExports:be,components:_e,allComponentsForTypes:Pe,errors:Array.from(we.values()),diagnostics:On(Array.from(Pe.values()).flatMap((De)=>De.diagnostics??[]))});{let De=Yr([Ee,xe],ve),Fe=await er(De);for(let je of Ee){let ze=Bt(je,Ee,Fe,ve,Te);if(ze)_e.set(ze.moduleName,ze)}for(let je of xe){let ze=Bt(je,xe,Fe,ve,Te);if(ze)Pe.set(ze.filePath,ze)}tr(Ne().errors)}let Oe=ln(Pe,ve),Ae=(De,Fe,je,ze,Xe)=>{let He=new Set;for(let Ye of je){let et=ve(Ye[1].source);if(!ze.has(et))continue;let pt=Bt(Ye,je,Xe,ve,Te);if(pt)De.set(Fe(pt),pt),He.add(et);else for(let[Ue,Ve]of De)if(ve(Ve.filePath)===et)De.delete(Ue)}return He};return{get result(){return Ne()},update:async(De)=>{let Fe=De.filter((Ye)=>_t.test(Ye)).map((Ye)=>bo(Ye));if(Fe.length===0)return{result:Ne(),reparsed:[]};if(q)Xr(Ce,ye,xe,ve,ke);let je=In(Fe,Oe);for(let[Ye,et]of we)if(je.has(ve(et.filePath)))we.delete(Ye);let ze=await er(je),Xe=new Set;for(let Ye of Ae(_e,(et)=>et.moduleName,Ee,je,ze))Xe.add(Ye);for(let Ye of Ae(Pe,(et)=>et.filePath,xe,je,ze))Xe.add(Ye);Oe=ln(Pe,ve);let He=Ne();return tr(He.errors),{result:He,reparsed:Array.from(Xe)}}}}import Op from"node:path";var So=!1;function ko(i){So=i}function Lt(i){if(!So)console.error(i)}import{mkdir as Sp,readFile as kp,writeFile as _p}from"node:fs/promises";import{parse as Pp}from"node:path";class mt{dryRun;constructor(i){this.dryRun=i?.dryRun===!0}async write(i,q){if(this.dryRun)return console.log(`would write "${r(i)}"`),!0;try{if(await kp(i,"utf-8")===q)return!1}catch{}return await Sp(Pp(i).dir,{recursive:!0}),await _p(i,q),!0}}var wp=new Set(["string","number","boolean"]);function Ap(i){return i.map((q)=>({kind:"field",name:q.name,...q.type?{type:{text:q.type}}:{},...q.value===void 0?{}:{default:q.value},...q.description?{description:q.description}:{},...q.deprecated===void 0?{}:{deprecated:q.deprecated}}))}function Tp(i){let q=new Map;for(let ye of i){if(!ye.type||!wp.has(ye.type.trim()))continue;let xe=ye.name.toLowerCase(),Ce=q.get(xe);if(Ce)Ce.push(ye);else q.set(xe,[ye])}let ge=[];for(let[ye,xe]of q){if(xe.length!==1)continue;let Ce=xe[0];ge.push({name:ye,fieldName:Ce.name,type:{text:Ce.type},...Ce.value===void 0?{}:{default:Ce.value},...Ce.description?{description:Ce.description}:{}})}return ge}function Np(i){return i.filter((q)=>q.type==="dispatched").map((q)=>({name:q.name,type:{text:`CustomEvent<${q.detail??"unknown"}>`},...q.description?{description:q.description}:{},...q.deprecated===void 0?{}:{deprecated:q.deprecated}}))}function Dp(i){return i.map((q)=>({name:q.default?"":q.name??"",...q.description?{description:q.description}:{},...q.deprecated===void 0?{}:{deprecated:q.deprecated}}))}function Rp(i){let q={kind:"class",name:i.moduleName,...i.componentComment?{description:i.componentComment}:{},members:Ap(i.props),attributes:Tp(i.props),events:Np(i.events),slots:Dp(i.slots)};if(i.customElementTag)q.tagName=i.customElementTag,q.customElement=!0;return q}function Ip(i,q){let ge=[{kind:"js",name:i.moduleName,declaration:{name:i.moduleName,module:q}}];if(i.customElementTag)ge.push({kind:"custom-element-definition",name:i.customElementTag,declaration:{name:i.moduleName,module:q}});return ge}function _o(i,q={}){let ge=c(i),ye=q.resolveModulePath??((Ce)=>Ce.filePath);return{schemaVersion:"1.0.0",modules:ge.components.map((Ce)=>{let ve=ye(Ce);return{kind:"javascript-module",path:ve,declarations:[Rp(Ce)],exports:Ip(Ce,ve)}})}}function Zr(i,q){let ge=_o(i,{resolveModulePath:(ye)=>Tn(ye.filePath,q.inputDir)});return Tt(ge)}async function ei(i,q){let ge=Zr(i,q),ye=Op.join(process.cwd(),q.outFile);if(await new mt({dryRun:q.dryRun}).write(ye,ge),!q.dryRun)Lt(`created "${q.outFile}".`)}import ti from"node:path";function Po(i){let q=new Map;for(let[ye,xe]of Object.entries(i)){let Ce=q.get(xe.source)||[];Ce.push({id:ye,exportee:xe}),q.set(xe.source,Ce)}let ge=[];for(let[ye,xe]of q){let Ce=_t.test(ye),ve=xe.some(({id:we,exportee:Te})=>we!=="default"&&Te.default),be=xe.some(({exportee:we})=>!we.default),Ee=Ce&&ve&&be,ke=[],_e=[],Pe=[];for(let{id:we,exportee:Te}of xe){if(we==="default"){_e.push(`export { default } from "${ye}";`);continue}if(Te.default)if(Te.mixed)_e.push(`export { default as ${we} } from "${ye}";`),_e.push(`export { default } from "${ye}";`);else Pe.push(`default as ${we}`);else if(Ce&&!Ee)Pe.push(`default as ${we}`);else ke.push(we)}if(Pe.length>0&&ke.length>0)ge.push(`export { ${[...Pe,...ke].join(", ")} } from "${ye}";`);else{if(ke.length>0)ge.push(`export { ${ke.join(", ")} } from "${ye}";`);if(Pe.length>0)ge.push(`export { ${Pe.join(", ")} } from "${ye}";`)}ge.push(..._e)}return ge.join(`
35
- `)}function wo(i){return i.replace(_t,"")}function Ao(i){return i.replace(_t,".svelte.d.ts")}function ni(i,q){return i.map((ge)=>({...ge,filePath:Tn(ge.filePath,q)}))}function Lp(i,q,ge){if(!q)return`${i.moduleName}.api.json`;if(!ge.has(i.moduleName))ge.add(i.moduleName),console.warn(`Warning: multiple components named "${i.moduleName}" found. Their JSON files are keyed by source path instead of name to avoid overwriting each other.`);return`${wo(i.filePath)}.api.json`}async function $p(i,q){let ge=c(i),ye=ni(ge.components,q.inputDir),xe=new Map;for(let ve of ye)xe.set(ve.moduleName,(xe.get(ve.moduleName)??0)+1);let Ce=new Set;await Promise.all(ye.map(async(ve)=>{let be=(xe.get(ve.moduleName)??0)>1,Ee=Lp(ve,be,Ce),ke=ti.resolve(ti.join(q.outDir||"",Ee)),Pe=await new mt({dryRun:q.dryRun}).write(ke,Tt(ve));if(!q.dryRun)Lt(`${Pe?"created":"unchanged"} "${ke}".`)}))}function ri(i,q){let ge=c(i,{entryExports:q.entryExports}),ye={...ge,components:ni(ge.components,q.inputDir)};return Tt(ye)}function To(i,q){let ge=c(i,{entryExports:q.entryExports});return`${ni(ge.components,q.inputDir).map((xe)=>JSON.stringify(xe)).join(`
36
- `)}
37
- `}async function Fp(i,q){let ge=ri(i,q),ye=ti.join(process.cwd(),q.outFile);if(await new mt({dryRun:q.dryRun}).write(ye,ge),!q.dryRun)Lt(`created "${q.outFile}".`)}async function ii(i,q){if(q.outDir)await $p(i,q);else await Fp(i,q)}import{join as Fl}from"node:path";var Bp=/\binterface\s+[A-Za-z_$][\w$]*(\s*<[^{};]*>)?\s*$/;var Mp=/[ \t]+$/,Do=/\s/,jp=/\s{2}|[^\S ]/;function Vp(i){return Bp.test(i.slice(-200))}var No=[""];function si(i){let q=No[i];if(q===void 0)q=" ".repeat(i),No[i]=q;return q}function Gp(i,q){let ge="";for(let ye=i.length-1;ye>=0&&ge.length<q;ye--)ge=i[ye]+ge;return ge.length>q?ge.slice(-q):ge}function Hp(i){if(i.length===0)return!1;let q=i[i.length-1];return q.charCodeAt(q.length-1)===10}function Wp(i){while(i.length>0){let q=i[i.length-1],ge=q.length;while(ge>0){let ye=q.charCodeAt(ge-1);if(ye!==32&&ye!==9)break;ge--}if(ge===q.length)return;if(ge===0){i.pop();continue}i[i.length-1]=q.slice(0,ge);return}}function Up(i){while(i.length>0){let q=i[i.length-1];if(!Do.test(q[q.length-1]))return;let ge=q.trimEnd();if(ge.length===q.length)return;if(ge.length===0){i.pop();continue}i[i.length-1]=ge;return}}function Kp(i){if(i.includes("{"))return!1;let q=0,ge=0;for(let ye=0;ye<i.length;ye++){let xe=i.charCodeAt(ye);if(q!==0){if(xe===q&&i.charCodeAt(ye-1)!==92)q=0;continue}if(xe===34||xe===39||xe===96){q=xe;continue}if(xe===59&&++ge>=2)return!0}return!1}function qp(i){if(!jp.test(i))return i.trimEnd();let q="",ge=null,ye=!1;for(let xe=0;xe<i.length;xe++){let Ce=i[xe],ve=i[xe-1];if(ge){if(q+=Ce,ge==="double"&&Ce==='"'&&ve!=="\\"||ge==="single"&&Ce==="'"&&ve!=="\\"||ge==="template"&&Ce==="`"&&ve!=="\\")ge=null;ye=!1;continue}if(Ce==='"'||Ce==="'"||Ce==="`"){ge=Ce==='"'?"double":Ce==="'"?"single":"template",q+=Ce,ye=!1;continue}if(Do.test(Ce)){if(!ye&&q.length>0)q+=" ",ye=!0;continue}q+=Ce,ye=!1}return q.trimEnd()}function Jp(i){let q=new Int32Array(i.length).fill(-1),ge=[],ye=0;for(let xe=0;xe<i.length;xe++){let Ce=i.charCodeAt(xe);if(ye===4){if(Ce===47&&i.charCodeAt(xe-1)===42)ye=0;continue}if(ye===1){if(Ce===34&&i.charCodeAt(xe-1)!==92)ye=0;continue}if(ye===2){if(Ce===39&&i.charCodeAt(xe-1)!==92)ye=0;continue}if(ye===3){if(Ce===96&&i.charCodeAt(xe-1)!==92)ye=0;continue}if(Ce===47){if(i.charCodeAt(xe+1)===42)ye=4}else if(Ce===34)ye=1;else if(Ce===39)ye=2;else if(Ce===96)ye=3;else if(Ce===123)ge.push(xe);else if(Ce===125&&ge.length>0)q[ge.pop()]=xe}return q}function Ro(i,q,ge,ye){let xe=[],Ce=0,ve=q;for(let be=q;be<ge;be++){let Ee=i.charCodeAt(be);if(Ce===4){if(Ee===47&&i.charCodeAt(be-1)===42)Ce=0;continue}if(Ce===1){if(Ee===34&&i.charCodeAt(be-1)!==92)Ce=0;continue}if(Ce===2){if(Ee===39&&i.charCodeAt(be-1)!==92)Ce=0;continue}if(Ce===3){if(Ee===96&&i.charCodeAt(be-1)!==92)Ce=0;continue}if(Ee===47){if(i.charCodeAt(be+1)===42)Ce=4;continue}if(Ee===34){Ce=1;continue}if(Ee===39){Ce=2;continue}if(Ee===96){Ce=3;continue}if(Ee===123){let ke=ye[be];if(ke===-1||ke>=ge)continue;if(ve<be)xe.push(i.slice(ve,be));let _e=be+1,Pe=i.slice(_e,ke);if(Pe.trim()===""){xe.push("{}"),be=ke,ve=ke+1;continue}let we=i.charCodeAt(_e)===10;if(!we&&!Pe.includes("/*")&&!Kp(Pe)&&!Vp(Gp(xe,200))){let Te=Ro(i,_e,ke,ye),Ne=Te.trim();if(!Ne.includes(`
38
- `)){let Oe=Ne.endsWith(";")?Ne.slice(0,-1):Ne,Ae=`{ ${qp(Oe)} }`;if(Ae.length<=120){xe.push(Ae),be=ke,ve=ke+1;continue}}if(xe.push("{"),Te.charCodeAt(0)!==59)xe.push(`
39
- `);if(Te.length>0)xe.push(Te);be=ke-1,ve=ke;continue}if(xe.push("{"),!we)xe.push(`
40
- `);ve=_e;continue}if(Ee===125){if(ve<be)xe.push(i.slice(ve,be));if(Wp(xe),!Hp(xe))xe.push(`
41
- `);xe.push("}"),ve=be+1;continue}if(Ee===59){if(ve<be)xe.push(i.slice(ve,be));if(Up(xe),xe.push(";"),i.charCodeAt(be+1)!==10)xe.push(`
42
- `);ve=be+1}}if(ve<ge)xe.push(i.slice(ve,ge));return xe.join("")}function zp(i){return Ro(i,0,i.length,Jp(i))}function Xp(i){if(!i.includes(" "))return i;let q="",ge=0;for(let ye=0;ye<i.length;ye++){let xe=i.charCodeAt(ye);if(ge!==0){if(q+=i[ye],xe===ge&&i.charCodeAt(ye-1)!==92)ge=0;continue}if(xe===34||xe===39||xe===96){ge=xe,q+=i[ye];continue}if(xe===32&&q.charCodeAt(q.length-1)===32)continue;q+=i[ye]}return q}function Io(i){let q=i.charCodeAt(0);return q===125||q===93||q===41||q===62}function Qp(i){let q=i.split(`
43
- `),ge=[],ye=0,xe=!1,Ce=0;for(let ve=0;ve<q.length;ve++){let be=q[ve].trim();if(be===""){ge.push("");continue}if(xe){if(ge.push(`${si(Ce)} ${be}`),be.includes("*/"))xe=!1;continue}if(be.startsWith("/**")&&!be.includes("*/")){ge.push(si(ye)+be),xe=!0,Ce=ye;continue}let Ee=Xp(be),ke=Math.max(0,ye-(Io(Ee)?1:0));if(ge.push(si(ke)+Ee),Ee.startsWith("/**")&&Ee.includes("*/"))continue;let _e=0;for(let Pe=0;Pe<Ee.length;Pe++){let we=Ee.charCodeAt(Pe);if(_e!==0){if(we===_e&&Ee.charCodeAt(Pe-1)!==92)_e=0;continue}if(we===34||we===39||we===96)_e=we;else if(we===123||we===40||we===91||we===60)ye++;else if(we===125||we===41||we===93)ye=Math.max(0,ye-1);else if(we===62&&Ee.charCodeAt(Pe-1)!==61)ye=Math.max(0,ye-1)}}return ge}function Yp(i){let q=[];for(let ge=0;ge<i.length;ge++){let ye=i[ge],xe=ye.charCodeAt(ye.length-1);if(xe===32||xe===9)ye=ye.replace(Mp,"");let Ce=q.length>0?q[q.length-1]:void 0,ve=Ce==="";if(ye===""){if(Ce===void 0||ve)continue;let be=Ce.charCodeAt(Ce.length-1);if(be===123||be===40||be===91)continue;q.push(ye);continue}if(ve&&Io(ye))q.pop();q.push(ye)}while(q.length>0&&q[q.length-1]==="")q.pop();return q.join(`
44
- `)}function Oo(i){return`${Yp(Qp(zp(i)))}
45
- `}var Mt="any",St="",Zp="Record<string, any>",ai="Record<string, never>",el=/(-|\s+|:)/,tl=/("|')/,nl=/CustomEvent/,rl=/^[A-Z]/,il=/\n/,Bo=/=>/,sl=/(?:^|\n)@default\b/,ui=/\n/g,ol=/\s+/g,nn=/(^|[^.\w])Snippet(?:\s*<|\b)/,al=/import\s+type\s+[^;]*\bSnippet\b[^;]*from\s+"svelte";/,ul=/[.*+?^${}()|[\]\\]/g,cl=/^const\s+/;function ci(i){return i.replace(cl,"")}function pl(i){if(!i)return;return i.replace(ui,`
46
- * `)}function nr(i){if(!i)return"";return`/** ${i} */`}function rr(i){if(!i)return"";return`/**
47
- * ${i.replace(ui,`
48
- * `)}
49
- */`}function Mo(i){if(i===void 0)return;return i===!0?"@deprecated":`@deprecated ${i}`}function ll(i){let q=Mo(i);if(q===void 0)return;return`* ${q.replace(ui,`
50
- * `)}
51
- `}function fl(i,q){if(!q)return[`@${i}`];if(!q.includes(`
52
- `))return[`@${i} ${q}`];return[`@${i}`,...q.split(`
53
- `)]}function jo(i){let q=[];for(let{name:ge,body:ye}of i??[])q.push(...fl(ge,ye));return q}function En(i,q,ge){let ye=Mo(ge),xe=jo(q),Ce=xe.length>0;if(!i&&!Ce&&!ye)return"";if(!Ce&&!ye)return i?.includes(`
54
- `)?rr(i):nr(i);let ve=[];if(i)ve.push(...i.split(`
55
- `));if(ve.push(...xe),ye)ve.push(...ye.split(`
56
- `));return`/**
57
- * ${ve.join(`
58
- * `)}
59
- */`}function dl(i){let q=jo(i);if(q.length===0)return"";return q.map((ge)=>`* ${ge}
60
- `).join("")}function ir(i){if(i===void 0)return Mt;return`${i}
61
- `}function sr(i){if(i.typedefs.length===0)return St;return i.typedefs.map((q)=>`${q.description?`${rr(q.description)}
62
- `:""}export ${q.ts}`).join(`
63
-
64
- `)}var Lo=new Map;function Vo(i,q){let ge=Lo.get(q);if(ge===void 0){let ye=q.replace(ul,"\\$&");ge=new RegExp(`\\b${ye}\\b`),Lo.set(q,ge)}return ge.test(i)}var $o,Fo=[];function pi(i){if(i!==$o)$o=i,Fo=an(i);return Fo}function hl(i){if(i===null)return[];return i[0].split(",").map((q,ge)=>({name:q.trim(),constraint:(pi(i[1]??"")[ge]??q).trim()}))}function ml(i,q){let ge=hl(i).filter(({name:ye})=>Vo(q,ye));if(ge.length===0)return{declSuffix:St,refSuffix:St};return{declSuffix:`<${ge.map(({constraint:ye})=>ci(ye)).join(", ")}>`,refSuffix:`<${ge.map(({name:ye})=>ye).join(", ")}>`}}function Go(i){if(!i.contexts||i.contexts.length===0)return St;let q=i.generics===null?[]:i.generics[0].split(",").map((ge,ye)=>({name:ge.trim(),constraint:(pi(i.generics?.[1]??"")[ye]??ge).trim()}));return i.contexts.map((ge)=>{let ye=ge.properties.map((be)=>{let Ee=be.description?`${nr(be.description)}
65
- `:"",ke=be.optional?"?":"";return`${Ee}${be.name}${ke}: ${be.type};`}).join(`
66
- `),xe=ge.description?`${rr(ge.description)}
67
- `:"",Ce=q.filter(({name:be})=>ge.properties.some((Ee)=>Vo(Ee.type,be))).map(({constraint:be})=>be),ve=Ce.length>0?`<${Ce.map(ci).join(", ")}>`:"";if(ge.properties.length===0)return`${xe}export type ${ge.typeName} = Record<string, never>;`;return`${xe}export type ${ge.typeName}${ve} = {
68
- ${ye}
69
- };`}).join(`
70
-
71
- `)}function Sn(i){if(el.test(i))return tl.test(i)?i:`"${i}"`;return i}function Ho(i,q){if(!i)return;return`* ${q||i}
72
- `}function li(i,q,ge){return[Ho(pl(i)),ll(q),dl(ge)].filter(Boolean).join("")}function fi(i){return i.length>0?`/**
73
- ${i}*/`:St}function gl(i){let q=i.props.filter((Ae)=>!Ae.isFunctionDeclaration&&Ae.kind!=="const"),ge=new Set([...q.map((Ae)=>Ae.name),...Array.from(i.canonicalPropNames??[])]),ye=q.map((Ae)=>{let $e=Ae.value;if(typeof Ae.value==="string")$e=Ae.value.replace(ol," ");if(Ae.value===void 0)$e="undefined";let Fe=sl.test(Ae.description??"")||Ae.isFunction&&Ae.value===void 0,je=[li(Ae.description,Ae.deprecated,Ae.tags),Ho(Ae.constant,"@constant"),Fe?null:`* @default ${$e}
74
- `].filter(Boolean).join(""),ze=Ae.constant&&!Ae.isFunction?Ae.value:Ae.type;return`
75
- ${fi(je)}
76
- ${Ae.name}${Ae.isRequired?"":"?"}: ${ze};`}),xe=i.canonicalPropsType?ye.filter((Ae,$e)=>{let De=q[$e];return De?!(i.canonicalPropNames?.has(De.name)??!1):!0}):ye,Ce=(i.slots||[]).filter((Ae)=>!Ae.default&&Ae.name!=null&&!ge.has(Ae.name)).map((Ae)=>{let $e=Ae.name,De=Sn($e),Fe=En(Ae.description,Ae.tags,Ae.deprecated),je=Fe?`${Fe}
77
- `:"",Xe=Ae.slot_props&&Ae.slot_props!=="Record<string, never>"?`(this: void, ...args: [${Ae.slot_props}]) => void`:"(this: void) => void";return`
78
- ${je}${De}?: ${Xe};`}),ve=(i.slots||[]).find((Ae)=>Ae.default||Ae.name===null),be=ve&&!ge.has("children")?(()=>{let Ae=En(ve.description,ve.tags,ve.deprecated),$e=Ae?`${Ae}
79
- `:"",Fe=ve.slot_props&&ve.slot_props!=="Record<string, never>"?`(this: void, ...args: [${ve.slot_props}]) => void`:"(this: void) => void";return`
80
- ${$e}children?: ${Fe};`})():"",Ee=i.events?El({events:i.events},ge):[],ke=[...Ce,be,...Ee].filter(Boolean),_e=[...xe,...ke].join(`
81
- `),Pe=`${i.moduleName}Props`,we=St,Te=i.generics?`<${pi(i.generics[1]).map((Ae)=>ci(Ae.trim())).join(", ")}>`:"",Ne=i.generics?`<${i.generics[0]}>`:"",Oe=i.canonicalPropsType?`
82
- type $Props${Te} = ${i.canonicalPropsType}${_e.trim()===""?"":` & {${_e}
83
- }`};
84
- `:`
85
- type $Props${Te} = {
86
- ${_e}
87
- };
88
- `;if(i.rest_props?.type==="Element"){let Ae;if(i.rest_props.name==="svelte:element")if(i.rest_props.thisValue)Ae=`SvelteHTMLElements["${i.rest_props.thisValue}"]`;else Ae="HTMLAttributes<HTMLElement>";else Ae=i.rest_props.name.split("|").map((Fe)=>`SvelteHTMLElements["${Fe.trim()}"]`).join(" & ");let $e="[key: `data-${string}`]: unknown;",De=i.rest_props.description?i.rest_props.description.includes(`
89
- `)?`${rr(i.rest_props.description)}
90
- `:`${nr(i.rest_props.description)}
91
- `:"";if(i.extends===void 0)we=`
92
- ${De}${Ae?`type $RestProps = ${Ae};
93
- `:""}
94
- ${i.canonicalPropsType?`type $Props${Te} = (${i.canonicalPropsType}) & {${_e}
95
-
96
- ${$e}
97
- };`:`type $Props${Te} = {
98
- ${_e}
99
-
100
- ${$e}
101
- };`}
102
-
103
- export type ${Pe}${Te} = Omit<$RestProps, keyof $Props${Ne}> & $Props${Ne};
104
- `;else we=`
105
- ${De}${Ae?`type $RestProps = ${Ae};
106
- `:""}
107
- ${i.canonicalPropsType?`type $Props${Te} = (${i.canonicalPropsType}) & {${_e}
108
-
109
- ${$e}
110
- };`:`type $Props${Te} = {
111
- ${_e}
112
-
113
- ${$e}
114
- };`}
115
-
116
- export type ${Pe}${Te} = Omit<$RestProps, keyof ($Props${Ne} & ${i.extends.interface})> & $Props${Ne} & ${i.extends.interface};
117
- `}else if(_e.trim()===""&&i.extends===void 0&&!i.canonicalPropsType)we=`
118
- export type ${Pe}${Te} = ${ai};
119
- `;else if(i.canonicalPropsType)we=`
120
- ${Oe}
121
- export type ${Pe}${Te} = ${i.extends===void 0?"":`${i.extends.interface} & `}$Props${Ne};
122
- `;else we=`
123
- export type ${Pe}${Te} = ${i.extends===void 0?"":`${i.extends.interface} & `} {
124
- ${_e}
125
- };
126
- `;return{props_name:Pe,prop_def:we}}function yl(i){if(i.slots.length===0)return ai;let q=i.slots.map(({name:ge,slot_props:ye,...xe})=>{let Ce=xe.default||ge===null?"default":Sn(ge??""),ve=En(xe.description,xe.tags,xe.deprecated);return`${ve?`${ve}
127
- `:""}${Sn(Ce)}: ${ir(ye)};`}).join(`
128
- `);return i.slots.length===1?`{${q}}`:`{
129
- ${q}
130
- }`}var xl=()=>"WindowEventMap",Cl=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 oi(i=Mt){if(nl.test(i))return i;return`CustomEvent<${i}>`}function vl(i){return Cl.has(i)}function Wo(i){switch(i.type){case"dispatched":return oi(i.detail);case"forwarded":{let q=i.element,ye=!(q&&rl.test(q))||vl(i.name),xe=i.detail!==void 0&&i.detail!=="undefined"&&!(i.detail==="null"&&ye),Ce=i.detail==="null"&&!ye;if(xe||Ce)return oi(i.detail);else if(ye)return`${xl()}["${i.name}"]`;else return oi()}default:return i}}function bl(i){if(i.events.length===0)return Zp;let q=i.events.map((ge)=>{let ye="",xe=En(ge.description,ge.tags,ge.deprecated);if(xe)ye=`${xe}
131
- `;return`${ye}${Sn(ge.name)}: ${Wo(ge)};
132
- `}).join("");return i.events.length===1?`{${q}}`:`{
133
- ${q}}`}function El(i,q){return i.events.map((ge)=>{let ye=`on${ge.name}`;if(q.has(ye))return;let xe="",Ce=En(ge.description,ge.tags,ge.deprecated);if(Ce)xe=`${Ce}
134
- `;return`
135
- ${xe}${Sn(ye)}?: (event: ${Wo(ge)}) => void;`}).filter((ge)=>ge!==void 0)}function Sl(i){let q=i.type==="() => any";if(i.type&&Bo.test(i.type)&&!q)return i.type;else if(i.params&&i.params.length>0){let ye=i.params.map((Ce)=>{let ve=Ce.optional?"?":"";return`${Ce.name}${ve}: ${Ce.type}`}).join(", "),xe=i.returnType||Mt;return`(${ye}) => ${xe}`}else if(i.returnType)return`() => ${i.returnType}`;else return i.type||Mt}function Uo(i){return i.props.filter((q)=>q.isFunctionDeclaration||q.kind==="const").map((q)=>{let ge=li(q.description,q.deprecated,q.tags),ye=Sl(q);return`
136
- ${fi(ge)}
137
- ${q.name}: ${ye};`}).join(`
138
- `)}function kl(i){let q=`${i.moduleName}Exports`,ge=Uo({props:i.props});if(ge.trim()==="")return{exports_name:q,exports_ref:q,exports_def:`export type ${q} = ${ai};`};let{declSuffix:ye,refSuffix:xe}=ml(i.generics,ge);return{exports_name:q,exports_ref:`${q}${xe}`,exports_def:`export type ${q}${ye} = {${ge}
139
- };`}}function _l(i){let q=i.props.filter((ge)=>ge.bindable===!0||ge.binding==="writable").map((ge)=>`"${ge.name}"`);return q.length===0?St:q.join(" | ")}function Pl(i){let q=i.moduleName==="default"?"$$Component":i.moduleName,ge=i.bindings===St?'""':i.bindings;return`declare const ${q}: Component<
140
- ${i.propsRef},
141
- ${i.exportsRef},
142
- ${ge}
143
- >;
144
- export default ${q};`}function wl(i){let q=i.moduleName==="default"?"$$Component":i.moduleName,ge=`${q}Component`,ye=i.bindings===St?'""':i.bindings;return`interface ${ge} {
145
- new ${i.generic}(
146
- options: ComponentConstructorOptions<${i.propsRef}>
147
- ): SvelteComponent<${i.propsRef}> & ${i.exportsRef};
148
- ${i.generic}(
149
- this: void,
150
- internals: ComponentInternals,
151
- props: ${i.propsRef}
152
- ): {
153
- $on?(type: string, callback: (e: any) => void): () => void;
154
- $set?(props: Partial<${i.propsRef}>): void;
155
- } & ${i.exportsRef};
156
- element?: typeof HTMLElement;
157
- z_$$bindings?: ${ye};
158
- }
159
- declare const ${q}: ${ge};
160
- export default ${q};`}function Al(i){if(i.extends===void 0)return"";return`import type { ${i.extends.interface} } from ${i.extends.import};`}function Tl(i){if(!i.componentComment)return"";if(!il.test(i.componentComment))return nr(i.componentComment.trim());return`/*${i.componentComment.split(`
161
- `).map((q)=>`* ${q}`).join(`
162
- `)}
163
- */`}function Nl(i){return i.moduleExports.map((q)=>{let ge=li(q.description,q.deprecated,q.tags),ye,xe=q.type&&Bo.test(q.type),Ce=q.type==="() => any";if(q.kind==="const"&&!xe)ye=`export declare const ${q.name}: ${q.type||Mt};
164
- `;else if(q.params&&q.params.length>0){let be=q.params.map((ke)=>{let _e=ke.optional?"?":"";return`${ke.name}${_e}: ${ke.type}`}).join(", "),Ee=q.returnType||Mt;ye=`export declare function ${q.name}(${be}): ${Ee};`}else if(q.returnType)ye=`export declare function ${q.name}(): ${q.returnType};`;else if(xe&&q.type&&!Ce){let[ve,be,...Ee]=q.type.split("=>"),ke=Ee.map((_e)=>` => ${_e.trim()}`).join("");ye=`export declare function ${q.name}${ve.trimEnd()}: ${be.trim()}${ke};`}else if(xe&&q.type){let[ve,be,...Ee]=q.type.split("=>"),ke=Ee.map((_e)=>` => ${_e.trim()}`).join("");ye=`export declare function ${q.name}${ve.trimEnd()}: ${be.trim()}${ke};`}else if(q.kind==="const")ye=`export declare const ${q.name}: ${q.type||Mt};
165
- `;else ye=`export type ${q.name} = ${q.type||Mt};`;return`
166
- ${fi(ge)}
167
- ${ye}`}).join(`
168
- `)}var Dl=120;function Rl(i){let ge=`export default class ${i.moduleName==="default"?"":i.moduleName}${i.generic} extends SvelteComponentTyped<`,ye=[i.genericProps,i.events,i.slots];if(i.accessors.trim()===""&&ye.every((xe)=>!xe.includes(`
169
- `))){let xe=`${ge}${ye.join(", ")}> {}`;if(xe.length<=Dl)return xe}return`${ge}
170
- ${i.genericProps},
171
- ${i.events},
172
- ${i.slots}
173
- > {
174
- ${i.accessors}
175
- }`}function di(i,q){let ge=zt(i),{moduleName:ye,typedefs:xe,generics:Ce,props:ve,moduleExports:be,slots:Ee,events:ke,rest_props:_e,extends:Pe,componentComment:we,contexts:Te,syntaxMode:Ne}=i,Oe=q?.format==="component",Ae=Ce!==null,{props_name:$e,prop_def:De}=gl({moduleName:ye,props:ve,rest_props:_e,extends:Pe,generics:Ce,slots:Ee,canonicalPropNames:new Set(ge?.canonicalPropNames??[]),canonicalPropsType:ge?.canonicalPropsType,events:Oe&&Ne==="legacy"?ke:void 0}),Fe=Ce?`<${Ce[1]}>`:"",je=Ce?`${$e}<${Ce[0]}>`:$e,ze=Nl({moduleExports:be}),Xe=sr({typedefs:xe}),He=Go({contexts:Te,generics:Ce}),Ye=(ge?.typeImportStatements??[]).join(`
176
- `),et=(ge?.localTypeDeclarations??[]).join(`
177
-
178
- `),{exports_ref:pt,exports_def:Ue}=Oe?kl({props:ve,moduleName:ye,generics:Ce}):{exports_ref:St,exports_def:St},Ve=Oe?_l({props:ve}):St,Ze=!al.test(Ye)&&(nn.test(De)||nn.test(ze)||nn.test(Xe)||nn.test(He)||nn.test(et)||nn.test(Ue)),at=_e?.type==="Element"&&(_e.name!=="svelte:element"||_e.name==="svelte:element"&&_e.thisValue),lt=_e?.type==="Element"&&_e.name==="svelte:element"&&!_e.thisValue,dr=[Oe?Ae?`import type { SvelteComponent, ComponentConstructorOptions, ComponentInternals${Ze?", Snippet":""} } from "svelte";`:`import type { Component${Ze?", Snippet":""} } from "svelte";`:`import { SvelteComponentTyped${Ze?", type Snippet":""} } from "svelte";`,at?'import type { SvelteHTMLElements } from "svelte/elements";':"",lt?'import type { HTMLAttributes } from "svelte/elements";':"",Ye,Al({extends:Pe})].filter(Boolean).join(`
179
- `),hr=Oe?Ae?wl({moduleName:ye,generic:Fe,propsRef:je,exportsRef:pt,bindings:Ve}):Pl({moduleName:ye,propsRef:je,exportsRef:pt,bindings:Ve}):Rl({moduleName:ye,generic:Fe,genericProps:je,events:bl({events:ke}),slots:yl({slots:Ee}),accessors:Uo({props:ve})}),Be=[ze,Xe,et,He,De,Ue,[Tl({componentComment:we}),hr].filter(Boolean).join(`
180
- `)].map((st)=>st.trim()).filter(Boolean).join(`
181
-
182
- `);return Oo([dr,Be].filter(Boolean).join(`
183
-
184
- `))}var hi=/`/g,or=/\s+/g,kt="--",Ko=`| Prop name | Required | Kind | Reactive | Binding | Type | Default value | Description |
185
- | :- | :- | :- | :- | :- | :- | :- | :- |
186
- `,qo=`| Slot name | Default | Props | Fallback | Description |
187
- | :- | :- | :- | :- | :- |
188
- `,Jo=`| Event name | Type | Detail | Description |
189
- | :- | :- | :- | :- |
190
- `,zo=`| Name | Kind | Type | Description |
191
- | :- | :- | :- | :- |
192
- `,ar=/\|/g,Il=/</g,Ol=/>/g,rn=/\n/g;function qt(i){if(i===void 0)return kt;return`<code>${i.replace(ar,"&#124;")}</code>`}function kn(i){return i.replace(Il,"&lt;").replace(Ol,"&gt;")}function Xo(i){if(i===void 0)return kt;return`<code>${i.replace(hi,"\\`").replace(ar,"&#124;")}</code>`}function ur(i,q){if(q===void 0)return i;let ge=typeof q==="string"&&q.trim().length>0?`: ${kn(q).replace(rn," ").replace(ar,"&#124;")}`:"";return`<s>${i}</s><br />**Deprecated**${ge}`}function cr(i){if(i===void 0||i.trim().length===0)return kt;return kn(i).replace(rn,"<br />")}function Qo(i){if(i===void 0||i==="{}")return kt;return qt(ir(i).replace(rn," "))}function Yo(i){if(i===void 0)return kt;return qt(kn(i).replace(rn,"<br />"))}function Zo(i,q){let ge=[];if(i!==void 0&&i.trim().length>0)ge.push(kn(i));for(let{name:ye,body:xe}of q??[]){let Ce=xe?.trim();ge.push(Ce?`@${ye} ${kn(Ce)}`:`@${ye}`)}if(ge.length===0)return kt;return ge.join(`
193
- `).replace(ar,"&#124;").replace(rn,"<br />")}function ea(i){if(i===void 0)return kt;return qt(i.replace(rn," "))}function ta(i,q,ge){if(i.append("h1","Component Index"),i.append("h2","Components").tableOfContents(),i.append("divider"),ge&&ge.length>0)Ll(i,ge);let ye=c(q);for(let xe of ye.components)$l(i,xe)}function Ll(i,q){i.append("h2","Exports"),i.append("raw",zo);for(let ge of q){let ye=(ge.type??ge.value)?.replace(or," ").trim();i.append("raw",`| ${ge.name} | ${`<code>${ge.kind}</code>`} | ${qt(ye)} | ${cr(ge.description)} |
194
- `)}i.append("raw",`
195
- `),i.append("divider")}function mi(i,q,ge,ye){if(q.length>0)ge(),i.append("raw",`
196
- `);else i.append("p",ye??"None.")}function $l(i,q){if(i.append("h2",`\`${q.moduleName}\``),q.generics)i.append("p",`**Type parameters:** ${qt(`<${q.generics[1]}>`)}`);if(q.typedefs.length>0)i.append("h3","Types").append("raw",`\`\`\`ts
197
- ${sr({typedefs:q.typedefs})}
198
- \`\`\`
199
-
200
- `);i.append("h3","Props"),mi(i,q.props,()=>{i.append("raw",Ko);let ge=[...q.props].sort((ye)=>{if(ye.reactive)return-1;if(ye.constant)return 1;return 0});for(let ye of ge)i.append("raw",`| ${ur(ye.name,ye.deprecated)} | ${ye.isRequired?"Yes":"No"} | ${`<code>${ye.kind}</code>`} | ${ye.reactive?"Yes":"No"} | ${ye.binding??"--"} | ${qt(ye.type)} | ${Xo(ye.value)} | ${cr(ye.description)} |
201
- `)}),i.append("h3","Slots"),mi(i,q.slots,()=>{i.append("raw",qo);for(let ge of q.slots)i.append("raw",`| ${ur(ge.default?kt:ge.name??kt,ge.deprecated)} | ${ge.default?"Yes":"No"} | ${Qo(ge.slot_props)} | ${Yo(ge.fallback)} | ${Zo(ge.description,ge.tags)} |
202
- `)}),i.append("h3","Events"),mi(i,q.events,()=>{i.append("raw",Jo);for(let ge of q.events)i.append("raw",`| ${ur(ge.name,ge.deprecated)} | ${ge.type} | ${ge.type==="dispatched"?ea(ge.detail):kt} | ${cr(ge.description)} |
203
- `)})}class gi{sourceParts=[];hasToC=!1;toc=[];get source(){return this.sourceParts.join("")}appendLineBreaks(){return this.sourceParts.push(`
204
-
205
- `),this}append(i,q){switch(i){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":{let ge=Number(i.slice(-1));if(this.sourceParts.push(`${"#".repeat(ge)} ${q}`),this.hasToC&&i==="h2")this.toc.push({indent:0,raw:q??""});break}case"quote":this.sourceParts.push(`> ${q}`);break;case"p":this.sourceParts.push(q??"");break;case"divider":this.sourceParts.push("---");break;case"raw":this.sourceParts.push(q??"");break}if(i!=="raw")this.appendLineBreaks();return this}tableOfContents(){return this.sourceParts.push("<!-- __TOC__ -->"),this.hasToC=!0,this.appendLineBreaks(),this}end(){return this.sourceParts.join("").replace("<!-- __TOC__ -->",this.toc.map(({indent:q,raw:ge})=>`${" ".repeat(q)}- [${ge}](#${ge.toLowerCase().replace(hi,"").replace(or,"-")})`).join(`
206
- `))}}class pr extends mt{onAppend;markdownBase;constructor(i){super();this.onAppend=i.onAppend,this.markdownBase=new gi}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(i,q){return this.markdownBase.append(i,q),this.onAppend?.call(this,i,this),this}tableOfContents(){return this.markdownBase.tableOfContents(),this}end(){return this.markdownBase.end()}}function yi(i,q){let ge=new pr({onAppend:(ye,xe)=>{q.onAppend?.call(null,ye,xe,i)}});return ta(ge,i,q.entryExports),ge.end()}async function xi(i,q){let ge=q?.write!==!1,ye=yi(i,q);if(ge){let xe=Fl(process.cwd(),q.outFile);if(await new mt({dryRun:q.dryRun}).write(xe,ye),!q.dryRun)Lt(`created "${q.outFile}".`)}return ye}import{join as na}from"node:path";async function Ci(i,q){let ge=na(process.cwd(),q.outDir,"index.d.ts"),ye=new mt({dryRun:q.dryRun}),xe=q.preamble+Po(q.exports),Ce=c(i),ve=q.format??"class",be=Ce.components.map(async(Ee)=>{let ke=Ao(na(q.outDir,Ee.filePath)),_e=q.resolvedPathByFilePath?.get(Ee.filePath),Pe=_e?q.cache?.getGeneratedText(_e,ve):void 0;if(Pe===void 0){if(Pe=di(Ee,{format:q.format}),_e)q.cache?.setGeneratedText(_e,ve,Pe)}await ye.write(ke,Pe)});if(await Promise.all([...be,ye.write(ge,`${xe}
207
- `)]),!q.dryRun)Lt("created TypeScript definitions.")}P({name:"json",componentSet:"exported",write:ii});P({name:"markdown",componentSet:"exported",write:xi});P({name:"types",componentSet:"all",write:Ci});P({name:"custom-elements",componentSet:"exported",write:ei});var Bl=50;function fe(i){let q=i?.watch===!0,ge,ye,xe=null,Ce,ve=new Set,be=async()=>{if(xe==null||ye==null||ve.size===0)return;let ke=Array.from(ve);ve.clear();try{let{result:_e}=await xe.update(ke);await b(_e,i||{},ye)}catch(_e){console.error("sveld: failed to regenerate types in watch mode:",_e)}},Ee=(ke)=>{if(!q||xe==null||!_t.test(ke))return;ve.add(ke),clearTimeout(Ce),Ce=setTimeout(be,Bl)};return{name:"vite-plugin-sveld",apply:q?void 0:"build",enforce:"post",async buildStart(){if(ye=C(i?.entry),q&&ye!=null)xe=await Eo(ye,i?.glob===!0,i?.documentExports===!0),await b(xe.result,i||{},ye)},async generateBundle(){if(q)return;if(ye!=null)ge=await S(ye,i?.glob===!0,E(i))},async writeBundle(){if(q)return;if(ye!=null)await b(ge,i||{},ye),ge.cache?.save()},handleHotUpdate(ke){Ee(ke.file)},watchChange(ke){Ee(ke)}}}function lr(i,q,ge){let ye=J(i);if(!ye)throw Error(`sveld: built-in writer "${i}" is not registered.`);return ye.write(q,ge)}async function b(i,q,ge){let ye=ra(ge),xe=q?.dryRun===!0;if(q?.types!==!1)await lr("types",i.allComponentsForTypes,{outDir:"types",preamble:"",...q?.typesOptions,exports:i.exports,inputDir:ye,dryRun:xe,cache:i.cache,resolvedPathByFilePath:i.resolvedPathByFilePath});if(q?.json)await lr("json",i.components,{outFile:"COMPONENT_API.json",...q?.jsonOptions,input:ge,inputDir:ye,entryExports:i.entryExports,dryRun:xe});if(q?.markdown)await lr("markdown",i.components,{outFile:"COMPONENT_INDEX.md",...q?.markdownOptions,entryExports:i.entryExports,dryRun:xe});if(q?.customElements)await lr("custom-elements",i.components,{outFile:"custom-elements.json",...q?.customElementsOptions,inputDir:ye,dryRun:xe});let Ce=Object.entries(q?.additionalWriters??{}).map(([ve,be])=>{let Ee=J(ve);if(!Ee){console.warn(`sveld: no writer registered with name "${ve}"; skipping.`);return}let ke=Ee.componentSet==="all"?i.allComponentsForTypes:i.components;return Ee.write(ke,be)});await Promise.all(Ce)}async function ia(i,q,ge){let ye=ra(ge);if(q?.json){let xe={...q?.jsonOptions,inputDir:ye,entryExports:i.entryExports},Ce=q.stdout==="ndjson"?To(i.components,xe):ri(i.components,xe);process.stdout.write(Ce);return}if(q?.markdown){let xe=yi(i.components,{...q?.markdownOptions,entryExports:i.entryExports});process.stdout.write(xe);return}if(q?.customElements){let xe=Zr(i.components,{...q?.customElementsOptions,inputDir:ye});process.stdout.write(xe)}}import{existsSync as Ml}from"node:fs";import{join as jl}from"node:path";var vi="src/index.js",gt={SUCCESS:0,USAGE_ERROR:1,GENERATION_FAILURE:2,BREAKING_CHANGE:3,DIAGNOSTICS:4},Vl=`Usage: sveld [options]
208
-
209
- Generate TypeScript definitions and component documentation for a Svelte
210
- library. With no flags, only TypeScript definitions are generated for the
211
- entry resolved from package.json#svelte.
212
-
213
- --entry, --cache, --check, and --types-format accept their value as
214
- --flag=value or as a separate --flag value argument.
215
-
216
- Options:
217
- --entry=<path> Entry point to uncompiled Svelte source (default: package.json "svelte" field)
218
- --glob Analyze all *.svelte files instead of the entry barrel
219
- --types Generate TypeScript definitions (default: true)
220
- --json Generate component documentation in JSON format
221
- --markdown Generate component documentation in Markdown format
222
- --custom-elements Generate a Custom Elements Manifest (custom-elements.json)
223
- --fail-fast Abort the run when a single component fails to parse
224
- --dry-run Resolve, parse, and print "would write" lines for each output file instead of writing anything (including the parse cache)
225
- --quiet Suppress progress logs (errors, the diagnostics summary, and the --check report are unaffected)
226
- --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
227
- --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)
228
- --resolve-types Expand opaque imported $props() types into JSON (alias: --resolveTypes, deprecated)
229
- --check-examples Compile-check @example blocks against the TypeScript program (alias: --checkExamples, deprecated)
230
- --report-diagnostics Print unresolved-type diagnostics to stderr
231
- --strict Exit with code 1 when diagnostics exist (implies --report-diagnostics)
232
- --types-format=<format> ".d.ts" output format: "class" (default) or "component" (Svelte 5 Component<...>)
233
- --check[=<path>] Diff the parsed API against a committed snapshot; exit 1 on a breaking change (default path: COMPONENT_API.json)
234
- --format=<text|json> Output format for the --check report and the diagnostics summary (default: text)
235
- --help Print this help message and exit
236
- --version Print the installed sveld version and exit
237
-
238
- Exit codes:
239
- 0 success
240
- 1 usage or configuration error
241
- 2 generation failure
242
- 3 breaking API change detected by --check
243
- 4 diagnostics present under --strict
244
- `,bi={resolveTypes:"resolve-types",checkExamples:"check-examples"},Gl=["help","version","glob","types","json","markdown","quiet","stdout","custom-elements","strict","report-diagnostics","resolve-types","check-examples","fail-fast","entry","cache","check","types-format","format"],Hl=[...Gl,...Object.keys(bi)],Wl=new Set(["glob","types","json","markdown","quiet","custom-elements","strict","report-diagnostics","resolve-types","check-examples","fail-fast"]),Ul=new Set(["entry","cache","check","types-format"]),Kl=new Set(["entry","types-format"]),ql=3;function Jl(i,q){let ge=i.length+1,ye=q.length+1,xe=Array.from({length:ge},()=>Array(ye).fill(0));for(let Ce=0;Ce<ge;Ce++)xe[Ce][0]=Ce;for(let Ce=0;Ce<ye;Ce++)xe[0][Ce]=Ce;for(let Ce=1;Ce<ge;Ce++)for(let ve=1;ve<ye;ve++){let be=i[Ce-1]===q[ve-1]?0:1;xe[Ce][ve]=Math.min(xe[Ce-1][ve]+1,xe[Ce][ve-1]+1,xe[Ce-1][ve-1]+be)}return xe[ge-1][ye-1]}function zl(i){let q,ge=Number.POSITIVE_INFINITY;for(let ye of Hl){let xe=Jl(i,ye);if(xe<ge)q=ye,ge=xe}if(q===void 0||ge>ql)return;return bi[q]??q}function Xl(i,q){let ge=i.indexOf("="),ye=ge===-1?i.slice(2):i.slice(2,ge),xe=bi[ye]??ye,Ce=ge===-1?!0:i.slice(ge+1),ve=!1;if(ge===-1&&Ul.has(xe)){if(q!==void 0&&!q.startsWith("--"))Ce=q,ve=!0;else if(Kl.has(xe))return{result:{kind:"usage-error",message:`sveld: --${xe} requires a value (pass --${xe}=<value> or --${xe} <value>).`},consumedNext:!1,flag:xe}}return{result:Ql(xe,Ce,i,ye),consumedNext:ve,flag:xe}}function Ql(i,q,ge,ye){switch(i){case"help":return{kind:"help"};case"version":return{kind:"version"};case"glob":case"types":case"json":case"markdown":case"quiet":return{kind:"option",option:{[i]:q===!0||q==="true"}};case"stdout":if(q===!0||q==="true")return{kind:"option",option:{stdout:!0}};if(q==="false")return{kind:"option",option:{stdout:!1}};return{kind:"option",option:{stdout:q}};case"custom-elements":return{kind:"option",option:{customElements:q===!0||q==="true"}};case"strict":return{kind:"option",option:{strict:q===!0||q==="true"}};case"report-diagnostics":return{kind:"option",option:{reportDiagnostics:q===!0||q==="true"}};case"resolve-types":return{kind:"option",option:{resolveTypes:q===!0||q==="true"}};case"check-examples":return{kind:"option",option:{checkExamples:q===!0||q==="true"}};case"fail-fast":return{kind:"option",option:{failFast:q===!0||q==="true"}};case"dry-run":return{kind:"option",option:{dryRun:q===!0||q==="true"}};case"entry":return typeof q==="string"?{kind:"option",option:{entry:q}}:{kind:"option",option:{}};case"cache":if(q==="false")return{kind:"option",option:{cache:!1}};return{kind:"option",option:{cache:typeof q==="string"?q:!0}};case"check":if(q==="false")return{kind:"option",option:{check:!1}};return{kind:"option",option:{check:typeof q==="string"?q:!0}};case"types-format":return typeof q==="string"?{kind:"option",option:{typesOptions:{format:q}}}:{kind:"option",option:{}};case"format":return typeof q==="string"?{kind:"option",option:{format:q}}:{kind:"option",option:{}};default:return{kind:"unknown",arg:ge,suggestion:zl(ye)}}}function Yl(i){let q={},ge=!1;for(let ye=0;ye<i.length;ye++){let xe=i[ye];if(!xe.startsWith("--"))return{kind:"unknown",arg:xe,positionalHint:ge?!0:void 0};let{result:Ce,consumedNext:ve,flag:be}=Xl(xe,i[ye+1]);if(Ce.kind!=="option")return Ce;if(Object.assign(q,Ce.option),ge=Wl.has(be),ve)ye++}return{kind:"options",options:q}}async function z(i){let q=Yl(i.argv.slice(2));if(q.kind==="help"){console.log(Vl);return}if(q.kind==="version"){console.log(zi.version);return}if(q.kind==="usage-error"){console.error(q.message),i.exitCode=gt.USAGE_ERROR;return}if(q.kind==="unknown"){let we=`Unknown flag: ${q.arg}`;if(q.suggestion)we+=` Did you mean --${q.suggestion}?`;if(q.positionalHint)we+=" (values are passed as --flag=value or --flag value)";console.error(we),console.error("Run sveld --help for a list of available flags."),i.exitCode=gt.USAGE_ERROR;return}let ge=q.options,ye=await B(),xe=j(ye,ge);if(ye.typesOptions||ge.typesOptions)xe.typesOptions={...ye.typesOptions,...ge.typesOptions};if(xe.stdout){if(xe.stdout!==!0&&xe.stdout!=="json"&&xe.stdout!=="ndjson"){console.error(`sveld: --stdout must be "json" or "ndjson"; got "${xe.stdout}".`),i.exitCode=gt.USAGE_ERROR;return}if([xe.json,xe.markdown,xe.customElements].filter(Boolean).length!==1){console.error("sveld: --stdout requires exactly one of --json, --markdown, or --custom-elements."),i.exitCode=gt.USAGE_ERROR;return}if(xe.stdout==="ndjson"&&!xe.json){console.error("sveld: --stdout=ndjson is only valid with --json."),i.exitCode=gt.USAGE_ERROR;return}if(xe.types===!0){console.error("sveld: --stdout cannot be combined with --types; type definitions span multiple files."),i.exitCode=gt.USAGE_ERROR;return}if(xe.check){console.error("sveld: --stdout cannot be combined with --check; both write their document to stdout."),i.exitCode=gt.USAGE_ERROR;return}}if(xe.format!==void 0&&xe.format!=="text"&&xe.format!=="json"){console.error(`sveld: --format must be "text" or "json"; got "${xe.format}".`),i.exitCode=gt.USAGE_ERROR;return}ko(xe.quiet===!0);let Ce=C(xe.entry),ve;if(Ce!==null)ve=Ce;else if(Ml(jl(i.cwd(),vi)))console.error(`sveld: could not resolve an entry point; falling back to "${vi}". Set package.json#svelte (or pass --entry) to avoid relying on this fallback.`),ve=pn(r(vi));else{i.exitCode=gt.USAGE_ERROR;return}let be,Ee;try{if(be=await S(ve,xe.glob===!0,E(xe)),xe.check)Ee=await D(be.components,O(xe),{entryExports:be.entryExports});if(xe.stdout)await ia(be,xe,ve);else if(await b(be,xe,ve),!xe.dryRun)be.cache?.save()}catch(we){console.error(we instanceof Error?we.message:String(we)),i.exitCode=gt.GENERATION_FAILURE;return}let{diagnostics:ke}=be;if((xe.reportDiagnostics||xe.strict)&&ke.length>0)if(xe.format==="json")i.stderr.write(ts(ke));else console.error(M(ke));if(Ee)if(xe.format==="json")i.stdout.write(G(Ee));else console.log(W(Ee));let Pe;if(Ee?.bump==="major")Pe=gt.BREAKING_CHANGE;if(xe.strict&&ke.length>0)Pe=Pe===void 0?gt.DIAGNOSTICS:Math.min(Pe,gt.DIAGNOSTICS);if(Pe!==void 0)i.exitCode=Pe}
245
- export{de,s,k,f,X,x,u,Q,d,m,Y,T,N,h,I,n,e,p,A,y,Z,K,F,v,ee,V,te,re,L,ne,l,ie,se,oe,w,ae,ce,_,U,R,g,ue,pe,o,a,t,H,r,c,le,O,D,W,G,M,C,he,B,j,E,S,P,J,me,fe,b,z};