sveld 0.37.8 → 0.37.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,29 @@
1
+ import{be,y,e,M,l,g,x,Se,de,f,P,B,G,Y,v,z,i,j,E,C,d,c,ne,re,me,se,w,Ce,he,m,ie,ye,b,p,u,A}from"./chunk-f8nq2w4s.js";import{k,H,De}from"./chunk-81w3m3mq.js";function Fe(n,t,r,o,a){n.diagnosticRecords.push(ht(n,t,r,o,a))}function ht(n,t,r,o,a){return i({component:n.componentFilePath,kind:t,name:r,message:o,...a?{source:a}:{},...bt(n,t,r)?{ignored:!0}:{}})}function ar(n,t){return`${n}:${t}`}function En(n,t,r,o){if(!o||o.length===0)return;let a=ar(t,r),h=n.sveldIgnoreDirectives.get(a)??new Set;for(let T of o)h.add(T);n.sveldIgnoreDirectives.set(a,h)}function bt(n,t,r){let o=n.sveldIgnoreDirectives.get(ar(t,r));if(!o)return!1;return o.has("")||o.has(z[t])}function ci(n){let t=[],r=0,o=0;for(let a=0;a<n.length;a++){let h=n[a];if(h==="<"||h==="("||h==="["||h==="{")r++;else if(h===">"||h===")"||h==="]"||h==="}")r=Math.max(r-1,0);else if(r===0&&(h===";"||h===","))t.push(n.slice(o,a)),o=a+1}return t.push(n.slice(o)),t}function pi(n){let t=0;for(let r=0;r<n.length;r++){let o=n[r];if(o==="<"||o==="("||o==="["||o==="{")t++;else if(o===">"||o===")"||o==="]"||o==="}")t=Math.max(t-1,0);else if(t===0&&o===":")return r}return-1}var li=/^\{([\s\S]*)\}$/,ui=/^[A-Za-z_$][\w$]*$/;function Sn(n){let t=n.trim(),r=li.exec(t);if(!r)return null;let o=r[1].trim();if(o==="")return[];let a=[];for(let h of ci(o)){let T=h.trim();if(!T)continue;let D=pi(T);if(D===-1)return null;let S=T.slice(0,D).trim(),N=T.slice(D+1).trim();if(!N)return null;let L=!1;if(S.endsWith("?"))L=!0,S=S.slice(0,-1).trim();if(!ui.test(S))return null;a.push({name:S,type:N,optional:L})}return a}var tt=/[\r\n]+/g;function di(n){if(n.sourceLineStartOffsetsCache)return n.sourceLineStartOffsetsCache;let t=[0];if(n.source){let r=n.source.indexOf(`
2
+ `);while(r!==-1)t.push(r+1),r=n.source.indexOf(`
3
+ `,r+1)}return n.sourceLineStartOffsetsCache=t,t}function cr(n,t){if(!n.source||t<0||t>n.source.length)return;let r=di(n),o=n.sourceLineHint;if(o!==void 0)for(let T=o;T<=o+1&&T<r.length;T++){let D=r[T],S=r[T+1]??Number.POSITIVE_INFINITY;if(t>=D&&t<S)return n.sourceLineHint=T,{line:T+1,column:t-D}}let a=0,h=r.length-1;while(a<=h){let T=a+h>>>1,D=r[T],S=r[T+1]??Number.POSITIVE_INFINITY;if(t<D)h=T-1;else if(t>=S)a=T+1;else return n.sourceLineHint=T,{line:T+1,column:t-D}}return}function rt(n,t,r){if(t===void 0||r===void 0||r<t)return;let o=cr(n,t),a=cr(n,r);if(!o||!a)return;return{start:o,end:a}}function Me(n,t){if(!t||typeof t!=="object")return;let r="start"in t&&typeof t.start==="number"?t.start:void 0,o="end"in t&&typeof t.end==="number"?t.end:void 0;return rt(n,r,o)}function dn(n,t){if(!t||t.length===0)return;let r=[...t];while(r.length>1){let S=r[r.length-1];if(S.tag!==void 0||!S.raw.trim().endsWith("*/"))break;r.pop()}let o=r[0],a=o.raw.indexOf(`@${o.tag??""}`),h=o.start+Math.max(a,0),T=r[r.length-1],D=T.start+T.raw.length;return rt(n,h,D)}function je(n,t,r){return n.source?.slice(t,r)}function fn(n,t){if(!t||typeof t!=="object")return;let r="start"in t&&typeof t.start==="number"?t.start:void 0,o="end"in t&&typeof t.end==="number"?t.end:void 0;if(r===void 0||o===void 0)return;return je(n,r,o)?.replace(tt," ")}var fi=/[A-Za-z_$][\w$]*/g;function mi(n,t){if(!t)return!1;let r=new Set(t[0].split(",").map((o)=>o.trim()));for(let[o]of n.matchAll(fi))if(r.has(o))return!0;return!1}function ot(n,t){if(t===void 0)return;return n.runesPropsDeclarationMetadataByDeclaratorStart.get(t)}function pr(n,t,r){return ot(n,t)?.props.get(r)}function lr(n){if(!n||typeof n!=="object"||!("type"in n))return;if(n.type==="Identifier"&&"name"in n&&typeof n.name==="string")return n.name;if(n.type==="TSQualifiedName"&&"right"in n&&n.right&&typeof n.right==="object"&&"name"in n.right&&typeof n.right.name==="string")return n.right.name;return}function ur(n){if(!n||typeof n!=="object"||!("type"in n))return;if(n.type==="Identifier"&&"name"in n&&typeof n.name==="string")return n.name;if(n.type==="TSQualifiedName"&&"left"in n&&n.left&&typeof n.left==="object")return ur(n.left);return}function vn(n,t){let r=t?.start,o=t?.end;if(r===void 0||o===void 0)return;return je(n,r+1,o)?.trim()}function Ln(n,t){let r=t?.start,o=t?.end;if(r===void 0||o===void 0)return;return je(n,r,o)?.trim()}function tn(n,t,r,o,a=new Set){if(!t?.type)return;switch(t.type){case"TSInterfaceDeclaration":for(let h of t.extends??[])tn(n,{type:"TSTypeReference",typeName:h.expression,typeParameters:h.typeParameters},r,o,a);tn(n,{type:"TSTypeLiteral",members:t.body?.body},r,o,a);return;case"TSTypeAliasDeclaration":case"TSParenthesizedType":case"TSTypeAnnotation":tn(n,t.typeAnnotation,r,o,a);return;case"TSIntersectionType":case"TSUnionType":for(let h of t.types??[])tn(n,h,r,o,a);return;case"TSTypeLiteral":for(let h of t.members??[]){if(h?.type!=="TSPropertySignature")continue;tn(n,h.typeAnnotation?.typeAnnotation,r,o,a)}return;case"TSTypeReference":{let h=ur(t.typeName);if(h){if(n.typeImportBindingsByLocalName.has(h)||n.valueImportBindingsByLocalName.has(h))r.add(h);let D=n.localTypeDeclarationsByName.get(h);if(D&&!a.has(h))o.add(h),a.add(h),tn(n,D.node,r,o,a),a.delete(h)}let T=t.typeArguments??t.typeParameters;if(T&&typeof T==="object"){let D=T;for(let S of D.params??[])tn(n,S,r,o,a)}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 h in t){let T=t[h];if(!T||typeof T!=="object")continue;if(Array.isArray(T)){for(let D of T){if(!D||typeof D!=="object"||!("type"in D))continue;tn(n,D,r,o,a)}continue}if("type"in T)tn(n,T,r,o,a)}}function yi(n,t){let r=new Map;for(let o of Array.from(t).sort()){let a=n.typeImportBindingsByLocalName.get(o),h=a?void 0:n.valueImportBindingsByLocalName.get(o),T=a??(h?{importedName:h.importedName,localName:h.localName,source:h.source,specifierType:"named"}:void 0);if(!T)continue;let D=r.get(T.source)??{default:[],named:[],namespace:[]};if(T.specifierType==="default")D.default.push(T.localName);else if(T.specifierType==="namespace")D.namespace.push(T.localName);else D.named.push({imported:T.importedName,local:T.localName});r.set(T.source,D)}return Array.from(r.entries()).sort(([o],[a])=>c(o,a)).map(([o,a])=>{if(a.namespace.length>0)return a.namespace.map((S)=>`import type * as ${S} from "${o}";`).join(`
4
+ `);let h=a.named.map(({imported:S,local:N})=>{if(!S||S===N)return N;return`${S} as ${N}`}),T=a.default[0],D=h.length>0?`{ ${h.join(", ")} }`:"";if(T&&D)return`import type ${T}, ${D} from "${o}";`;if(T)return`import type ${T} from "${o}";`;return`import type ${D} from "${o}";`})}function Ye(n,t){if(t)n.additionalTypeDependencyNodes.push(t)}function gi(n){if(!n.const)return;let t=n.id?.name;if(!t)return;let r=[];for(let o of n.members??[]){let a=o.initializer;if(a?.type!=="Literal")return;let h=a.value;if(typeof h==="string")r.push(JSON.stringify(h));else if(typeof h==="number")r.push(String(h));else return}if(r.length===0)return;return`type ${t} = ${r.join(" | ")};`}function dr(n,t){let r=gi(t);if(r)return r;if(t.start===void 0||t.end===void 0)return;let o=je(n,t.start,t.end)?.trim();return o?`declare ${o}`:void 0}function Tt(n,t){let r=[];for(let o of t.params??[]){let a=o.type==="TSParameterProperty"&&o.parameter?o.parameter:o;if(a.type==="RestElement"){Ye(n,a.typeAnnotation?.typeAnnotation),r.push({name:a.argument?.name??"rest",type:vn(n,a.typeAnnotation),optional:!1,rest:!0});continue}let h=a.type==="AssignmentPattern",T=h?a.left:a;Ye(n,T?.typeAnnotation?.typeAnnotation),r.push({name:T?.name??"arg",type:vn(n,T?.typeAnnotation),optional:h||a.optional===!0,rest:!1})}Ye(n,t.returnType?.typeAnnotation);for(let o of t.typeParameters?.params??[])Ye(n,o.constraint),Ye(n,o.default);return{params:r,returnType:vn(n,t.returnType),typeParameters:Ln(n,t.typeParameters)||void 0}}function xt(n,t){let{params:r,returnType:o,typeParameters:a}=Tt(n,t),h=r.map(({name:D,type:S,optional:N,rest:L})=>L?`...${D}: ${S??"any[]"}`:`${D}${N?"?":""}: ${S??"any"}`),T=o!==void 0||a!==void 0||r.some((D)=>D.type!==void 0);return{signature:`${a??""}(${h.join(", ")}) => ${o??"any"}`,hasAnnotations:T}}function fr(n){let t=n.pendingCallDefaultCandidates.length>0?n.pendingCallDefaultCandidates.slice():void 0,r=n.pendingConstDefaultCandidates.length>0?n.pendingConstDefaultCandidates.slice():void 0,o=n.pendingContextKeyCandidates.length>0?n.pendingContextKeyCandidates.slice():void 0,a=n.pendingDispatchEscapeCandidates.length>0?n.pendingDispatchEscapeCandidates.slice():void 0,h=n.deferredEventNoSourceDiagnostics.length>0?n.deferredEventNoSourceDiagnostics.slice():void 0,T=a&&n.untypedJsDocEventNames.size>0?Array.from(n.untypedJsDocEventNames):void 0,D={...t?{pendingCallDefaultCandidates:t}:{},...r?{pendingConstDefaultCandidates:r}:{},...o?{pendingContextKeyCandidates:o}:{},...a?{pendingDispatchEscapeCandidates:a}:{},...h?{deferredEventNoSourceDiagnostics:h}:{},...T?{untypedJsDocEventNames:T}:{}},S=t!==void 0||r!==void 0||o!==void 0||a!==void 0,N=new Set,L=new Set;for(let te of n.additionalTypeDependencyNodes)tn(n,te,N,L);let R=Array.from(n.localTypeDeclarationsByName.values()).filter((te)=>te.exported).sort((te,Ue)=>te.start-Ue.start);for(let te of R)tn(n,te.node,N,L);let _=R.map((te)=>`export ${te.code}`),X=n.typedRunesPropsDeclarations.length===1?n.typedRunesPropsDeclarations[0]:void 0,K=X?.canonicalType;if(X&&K){for(let te of X.referencedImportedTypes)N.add(te);for(let te of X.referencedLocalTypes)L.add(te)}if(!K&&N.size===0&&L.size===0&&_.length===0)return S?{canonicalPropNames:[],localTypeDeclarations:[],typeImportStatements:[],...D}:void 0;let Q=Array.from(L).map((te)=>n.localTypeDeclarationsByName.get(te)).filter((te)=>te!==void 0&&!te.exported).sort((te,Ue)=>te.start-Ue.start).map((te)=>te.code);return{...K?{canonicalPropsType:K}:{},canonicalPropNames:X&&K?Array.from(X.props.keys()).sort():[],localTypeDeclarations:Q,..._.length>0?{moduleTypeDeclarations:_}:{},typeImportStatements:yi(n,N),referencesComponentGenerics:K?mi(K,n.generics):!1,...D}}function Bn(n,t,r,o){if(d(r)===void 0)return;if(n.trackPropLocalName(r),t.props.has(r)){let a=t.props.get(r);t.props.set(r,{...a,...o})}else t.props.set(r,o)}function Hn(n,t,r,o){if(t.pendingCallDefault)n.pendingCallDefaultCandidates.push({propName:r,location:o,...t.pendingCallDefault});if(t.pendingConstDefault)n.pendingConstDefaultCandidates.push({propName:r,location:o,...t.pendingConstDefault})}var hi=/[^\S\r\n]*[\r\n]\s*/g;function xn(n,t,r,o=0){let a,h,T=!1;if(!r||typeof r!=="object"||!("type"in r))return{value:a,type:h,isFunction:T};let D=gr(n,t,r);if(r.type==="ObjectExpression"||r.type==="BinaryExpression"||r.type==="ArrayExpression"||r.type==="ArrowFunctionExpression"||r.type==="FunctionExpression"){let S=r;if("start"in S&&"end"in S&&typeof S.start==="number"&&typeof S.end==="number")a=je(t,S.start,S.end)?.replace(tt," ");if(T=r.type==="ArrowFunctionExpression"||r.type==="FunctionExpression",r.type==="BinaryExpression")h=mn(n,t,r,o);else if(r.type==="ObjectExpression"||r.type==="ArrayExpression"){let{start:N,end:L}=S;h=Et(r)?xi(t,N,L,a):void 0}if(r.type==="ArrowFunctionExpression"||r.type==="FunctionExpression")h=br(r),a=yr(t,r)}else if(r.type==="UnaryExpression"){let S=r;if("start"in S&&"end"in S&&typeof S.start==="number"&&typeof S.end==="number")a=je(t,S.start,S.end);h=mn(n,t,S,o)}else if(r.type==="LogicalExpression"||r.type==="ConditionalExpression"||r.type==="SequenceExpression"){let{start:S,end:N}=r,L=S===void 0||N===void 0?void 0:je(t,S,N)?.replace(hi," ");a=L!==void 0&&r.type==="SequenceExpression"?`(${L})`:L,h=mn(n,t,r,o)}else if(r.type==="NewExpression"){let S=r;if("start"in S&&"end"in S&&typeof S.start==="number"&&typeof S.end==="number")a=je(t,S.start,S.end);if(S.callee&&typeof S.callee==="object"&&"type"in S.callee&&S.callee.type==="Identifier"){let N=S.callee.name;if(N==="Date")h="Date";else if(N==="Map")h="Map<any, any>";else if(N==="Set")h="Set<any>";else if(N==="WeakMap")h="WeakMap<object, any>";else if(N==="WeakSet")h="WeakSet<object>";else if(N==="Array")h="any[]";else if(N==="RegExp"||N==="Regexp")h="RegExp";else if(N==="Error")h="Error";else h=N}}else if(r.type==="CallExpression"){let S=r;if("start"in S&&"end"in S&&typeof S.start==="number"&&typeof S.end==="number")a=je(t,S.start,S.end);let N=S.callee,L=N&&typeof N==="object"&&"type"in N&&N.type==="Identifier"?N.name:void 0;if((L==="$derived"||L==="$state")&&S.arguments.length===1&&o<5)return{...xn(n,t,S.arguments[0],o+1),value:a,defaultValue:D};if(L){let R=Si(n,t,L);if(R)return{value:a,type:void 0,isFunction:!1,defaultValue:D,resolvedType:R};if(t.funcDecls.has(L)||vi(t,L))return{value:a,type:void 0,isFunction:!1,defaultValue:D,pendingCallDefault:{calleeName:L}};let _=t.valueImportBindingsByLocalName.get(L);if(_)return{value:a,type:void 0,isFunction:!1,defaultValue:D,pendingCallDefault:{calleeName:L,importSource:_.source,importedName:_.importedName}}}return{value:a,type:void 0,isFunction:!1,defaultValue:D,pendingCallDefault:{calleeName:L??Ei(t,N)}}}else if(r.type==="Identifier"){let S=r;if(o<5){let L=st(t,S.name);if(L){let R=xn(n,t,L,o+1),_=n.resolveLocalVarJSDoc(S.name);return{...R,resolvedType:_?.type??R.resolvedType,resolvedDescription:_?.description??R.resolvedDescription,resolvedParams:_?.params??R.resolvedParams,resolvedReturnType:_?.returnType??R.resolvedReturnType}}if(t.funcDecls.has(S.name)){let R=n.resolveLocalVarJSDoc(S.name),_=t.funcDecls.get(S.name);return{value:_?yr(t,_):void 0,type:void 0,isFunction:!0,defaultValue:_?gr(n,t,_):void 0,resolvedType:R?.type??Di(R,_),resolvedDescription:R?.description,resolvedParams:R?.params,resolvedReturnType:R?.returnType}}}if("start"in S&&"end"in S&&typeof S.start==="number"&&typeof S.end==="number")a=je(t,S.start,S.end);let N=t.valueImportBindingsByLocalName.get(S.name);if(N)return{value:a,type:h,isFunction:T,defaultValue:D,pendingConstDefault:{importSource:N.source,importedName:N.importedName}}}else if(r.type==="MemberExpression"){let S=r;if("start"in S&&"end"in S&&typeof S.start==="number"&&typeof S.end==="number")a=je(t,S.start,S.end);if(n.isNumericConstant(r))h="number";let N=se(t,r);if(N)return{value:a,type:h,isFunction:T,defaultValue:D,pendingConstDefault:{importSource:N.source,importedName:N.importedName,...N.members?{members:N.members}:{}}}}else if(r.type==="TemplateLiteral"){let S=r;if("start"in S&&"end"in S&&typeof S.start==="number"&&typeof S.end==="number")a=je(t,S.start,S.end);h="string"}else if("raw"in r&&typeof r.raw==="string")a=r.raw,h=Gn(r);return{value:a,type:h,isFunction:T,defaultValue:D}}function Gn(n){if("regex"in n&&n.regex)return"RegExp";if("bigint"in n&&n.bigint)return"bigint";return n.value==null?void 0:typeof n.value}var bi=new Set(["-","*","/","%","**","<<",">>",">>>","&","|","^"]),Ti=new Set(["==","!=","===","!==","<","<=",">",">=","in","instanceof"]);function mn(n,t,r,o){if(!r||typeof r!=="object"||!("type"in r))return;switch(r.type){case"UnaryExpression":{let a=r;if(a.operator==="!"||a.operator==="delete")return"boolean";if(a.operator==="typeof")return"string";if(a.operator==="void")return;if(a.operator==="+")return"number";return mn(n,t,a.argument,o)==="bigint"?"bigint":"number"}case"BinaryExpression":{let a=r;if(Ti.has(a.operator))return"boolean";let h=mn(n,t,a.left,o),T=mn(n,t,a.right,o);if(h==="bigint"&&T==="bigint")return"bigint";if(bi.has(a.operator))return"number";if(a.operator!=="+")return;if(h==="string"||T==="string")return"string";if(h==="number"&&T==="number")return"number";return}case"LogicalExpression":{let a=r;return mr([mn(n,t,a.left,o),mn(n,t,a.right,o)])}case"ConditionalExpression":{let a=r;return mr([mn(n,t,a.consequent,o),mn(n,t,a.alternate,o)])}case"SequenceExpression":{let a=r.expressions;return mn(n,t,a[a.length-1],o)}case"Identifier":{let a=r.name;if(a==="NaN"||a==="Infinity")return"number";if(a==="undefined")return;let h=n.findVariableTypeAndDescription(a)?.type;if(h)return h;if(o>=5)return;return mn(n,t,st(t,a),o+1)}default:{if(o>=5)return;let a=xn(n,t,r,o+1);return a.type??a.resolvedType}}}function mr(n){let t=new Set;for(let r of n){if(r===void 0)return;t.add(r.includes("=>")?`(${r})`:r)}return t.size===1?n[0]:[...t].join(" | ")}function xi(n,t,r,o){if(o===void 0||t===void 0||r===void 0)return o;let a=n.parsed?.comments??[],h="",T=t;for(let D of a){if(D.start<t||D.end>r)continue;h+=je(n,T,D.start)??"",T=D.end}if(T===t)return o;return h+=je(n,T,r)??"",h.replace(tt," ")}function Et(n){if(!n||typeof n!=="object"||!("type"in n))return!1;switch(n.type){case"Literal":return!(("regex"in n)&&n.regex);case"TemplateLiteral":return n.expressions.length===0;case"Identifier":return n.name==="undefined";case"UnaryExpression":{let t=n,r=t.argument;return t.operator==="-"&&r?.type==="Literal"&&(typeof r.value==="number"||typeof r.value==="bigint")}case"ArrayExpression":return n.elements.every((t)=>t!==null&&Et(t));case"ObjectExpression":return n.properties.every((t)=>t.type==="Property"&&t.kind==="init"&&!t.computed&&!t.method&&!t.shorthand&&(t.key.type==="Identifier"||t.key.type==="Literal")&&Et(t.value));default:return!1}}function it(n,t,r){let o=st(t,r);if(!o||typeof o!=="object"||!("type"in o))return;if(o.type==="CallExpression"){let a=o,h=fn(t,a.callee);if(h==="$state"||h==="$state.raw"||h==="$derived"){let T=a.typeArguments?.params?.[0];if(T)return Ye(t,T),fn(t,T);if(h==="$state.raw")return xn(n,t,a.arguments[0],1).type}}return xn(n,t,o).type}function st(n,t){for(let r of n.vars)for(let o of r.declarations)if(o.id&&typeof o.id==="object"&&"type"in o.id&&o.id.type==="Identifier"&&"name"in o.id&&o.id.name===t&&o.init)return o.init;return}function Fn(n,t){for(let r of n.vars){if(r.kind!=="const")continue;for(let o of r.declarations)if(o.id&&typeof o.id==="object"&&"type"in o.id&&o.id.type==="Identifier"&&"name"in o.id&&o.id.name===t&&o.init)return o.init}return}function Ei(n,t){if(t&&typeof t==="object"&&"start"in t&&"end"in t&&typeof t.start==="number"&&typeof t.end==="number")return je(n,t.start,t.end)??"call";return"call"}function Si(n,t,r){let o=n.resolveLocalVarJSDoc(r);if(o?.returnType)return o.returnType;let a=t.funcDecls.get(r)??hr(t,r);if(!a)return;let h=wi(t,a);if(h)return h;let T=Ci(t,r);if(T)return T;let D=Tr(a);return D==="any"?void 0:D}function vi(n,t){return hr(n,t)!==void 0}function hr(n,t){let r=st(n,t);if(!r||typeof r!=="object"||!("type"in r))return;if(r.type==="ArrowFunctionExpression"||r.type==="FunctionExpression")return r;return}function Ci(n,t){for(let r of n.vars)for(let o of r.declarations){let a=o.id;if(!a||typeof a!=="object"||!("type"in a)||a.type!=="Identifier"||!("name"in a)||a.name!==t)continue;let h=a.typeAnnotation;if(h?.type!=="TSTypeAnnotation")return;let T=h.typeAnnotation;if(!T||typeof T.start!=="number"||typeof T.end!=="number")return;return Pi(je(n,T.start,T.end))}return}function Pi(n){if(!n)return;let t=n.lastIndexOf("=>");if(t===-1)return;return n.slice(t+2).trim()||void 0}function wi(n,t){let r=t.returnType;if(r?.type!=="TSTypeAnnotation")return;let o=r.typeAnnotation;if(!o||typeof o.start!=="number"||typeof o.end!=="number")return;return je(n,o.start,o.end)}function Di(n,t){let r=n?.returnType??"any",o=n?.params;if(o&&o.length>0)return`(${C(o)}) => ${r}`;if(n?.returnType)return`() => ${r}`;if(t)return br(t);return"(...args: any[]) => any"}function br(n){return`(${ki(n)}) => ${Tr(n)}`}function ki(n){let t=n.params;if(!Array.isArray(t)||t.length===0)return"...args: any[]";let r=[];for(let o of t)if(o&&typeof o==="object"&&"type"in o&&o.type==="Identifier"&&"name"in o&&typeof o.name==="string")r.push(`${o.name}: any`);else return"...args: any[]";return r.join(", ")}function Tr(n){if(n.async||n.generator)return"any";let t=n.body,r;if(t&&typeof t==="object"&&"type"in t&&t.type==="BlockStatement"){if(r=Ai(t),r.length===0)return"any"}else r=[t];let o=null;for(let a of r){let h=Ni(a);if(!h)return"any";if(o===null)o=h;else if(o!==h)return"any"}return o??"any"}function Ai(n){let t=[];return St(n,t),t}function St(n,t){if(!n||typeof n!=="object")return;let r=n;if(typeof r.type!=="string")return;if(r.type==="FunctionDeclaration"||r.type==="FunctionExpression"||r.type==="ArrowFunctionExpression")return;if(r.type==="ReturnStatement")t.push(r.argument??null);for(let o in r){if(o==="leadingComments")continue;let a=r[o];if(!a||typeof a!=="object")continue;if(Array.isArray(a))for(let h=0;h<a.length;h++)St(a[h],t);else St(a,t)}}function Ni(n){if(!n||typeof n!=="object"||!("type"in n))return null;switch(n.type){case"Literal":{let t=n.value;if(typeof t==="string")return"string";if(typeof t==="number")return"number";if(typeof t==="boolean")return"boolean";return null}case"TemplateLiteral":return"string";case"CallExpression":{let t=n.callee;if(t&&typeof t==="object"&&"type"in t&&t.type==="Identifier"){let r=t.name;if(r==="String")return"string";if(r==="Number")return"number";if(r==="Boolean")return"boolean"}return null}default:return null}}function xr(n){if(g(n,"$bindable"))return{init:n.arguments[0],bindable:!0};return{init:n,bindable:!1}}function Li(n,t){let r=t.params;if(!Array.isArray(r)||r.length===0)return"";let o=r[0],a=r[r.length-1];if(typeof o.start!=="number"||typeof a.end!=="number")return"";return je(n,o.start,a.end)??""}function yr(n,t){if(t.generator)return;let r=t.body;if(!r||typeof r!=="object"||!("type"in r))return;let o=Li(n,t),a=t.async?"async ":"",h=(D,S)=>D&&typeof D==="object"&&("type"in D)&&D.type==="ObjectExpression"?`(${S})`:S;if(r.type!=="BlockStatement"){let D=fn(n,r);return D===void 0?void 0:`${a}(${o}) => ${h(r,D)}`}let T=r.body;if(T.length===0)return`${a}(${o}) => {}`;if(T.length===1){let D=T[0];if(D&&typeof D==="object"&&"type"in D&&D.type==="ReturnStatement"){let S=D.argument;if(S){let N=fn(n,S);if(N!==void 0)return`${a}(${o}) => ${h(S,N)}`}}}return}function gr(n,t,r){let o=fn(t,r);if(!o||!r||typeof r!=="object"||!("type"in r))return;let a="expression";if(r.type==="Literal"||r.type==="UnaryExpression")a="literal";else if(r.type==="TemplateLiteral")a=r.expressions.length===0?"literal":"expression";else if(r.type==="ArrayExpression")a="array";else if(r.type==="ObjectExpression")a="object";else if(r.type==="ArrowFunctionExpression"||r.type==="FunctionExpression"||r.type==="FunctionDeclaration")a="function";let h={raw:o,kind:a};if(a==="literal"||a==="array"||a==="object"){let T=vt(n,r);if(T.ok)h.value=T.value}return h}function vt(n,t){if(!t||typeof t!=="object"||!("type"in t))return{ok:!1};if(t.type==="Literal"){let r=t.value;return typeof r==="bigint"||"regex"in t?{ok:!1}:{ok:!0,value:r}}if(t.type==="UnaryExpression"){let r=t,o=r.argument;if(!o||typeof o!=="object"||!("type"in o)||o.type!=="Literal")return{ok:!1};let a=o.value;if(typeof a==="number"){if(r.operator==="-")return{ok:!0,value:-a};if(r.operator==="+")return{ok:!0,value:a}}if(typeof a==="boolean"&&r.operator==="!")return{ok:!0,value:!a};return{ok:!1}}if(t.type==="TemplateLiteral"){let r=t;if(r.expressions.length>0||r.quasis.length!==1)return{ok:!1};return{ok:!0,value:r.quasis[0].value.cooked??r.quasis[0].value.raw}}if(t.type==="ArrayExpression"){let r=t,o=[];for(let a of r.elements){if(!a)return{ok:!1};let h=vt(n,a);if(!h.ok)return{ok:!1};o.push(h.value)}return{ok:!0,value:o}}if(t.type==="ObjectExpression"){let r=t,o={};for(let a of r.properties){if(a.type!=="Property"||a.computed)return{ok:!1};let h=n.getPropertyName(a.key);if(!h)return{ok:!1};let T=vt(n,a.value);if(!T.ok)return{ok:!1};o[h]=T.value}return{ok:!0,value:o}}return{ok:!1}}function nn(n,t,r){if(!t||n.has(t))return;n.set(t,r)}function Un(n,t){for(let r=n.activeScopes.length-1;r>=0;r-=1){let o=n.activeScopes[r]?.get(t);if(!o)continue;return o.kind==="prop"?o.publicPropName:void 0}return}function Wn(n,t){for(let r=n.activeScopes.length-1;r>=0;r-=1){let o=n.activeScopes[r];if(o===n.componentScope)return!1;if(o?.has(t))return!0}return!1}function at(n,t){let r=t;while(M(r))r=r.object;return e(r)&&Wn(n,r.name)}function Ge(n,t=new Set){if(!n||typeof n!=="object"||!("type"in n))return t;switch(n.type){case"Identifier":t.add(n.name);break;case"AssignmentPattern":Ge(n.left,t);break;case"ArrayPattern":for(let r of n.elements)Ge(r??void 0,t);break;case"ObjectPattern":for(let r of n.properties)if(r.type==="Property")Ge(r.value,t);else if(r.type==="RestElement")Ge(r.argument,t);break;case"RestElement":Ge(n.argument,t);break}return t}function Pt(n,t){if(!t||typeof t!=="object"||!("type"in t))return;if(t.type==="Identifier"){let o=Un(n,t.name);if(o)n.reactive_vars.add(o);return}let r=Ge(t);for(let o of r){let a=Un(n,o);if(a)n.reactive_vars.add(a)}}function Jn(n){if(!n||typeof n!=="object"||!("type"in n))return!1;switch(String(n.type)){case"BlockStatement":case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":case"CatchClause":case"EachBlock":case"AwaitBlock":return!0;default:return!1}}function Er(n){if(!n||typeof n!=="object"||!("type"in n))return!1;let t=String(n.type);return t==="FunctionDeclaration"||t==="FunctionExpression"||t==="ArrowFunctionExpression"}function Ri(n,t){let r=n.scopeDeclarations.get(t);if(!r)r=new Map,n.scopeDeclarations.set(t,r);return r}function Mi(n,t,r){let o=[];if(r.id.type==="Identifier")return o.push({kind:"local",name:r.id.name}),o;if(r.id.type!=="ObjectPattern")return o;for(let a of r.id.properties){if(a.type==="RestElement"){if(a.argument.type==="Identifier")o.push({kind:"local",name:a.argument.name});continue}if(a.computed)continue;let h=n.getPropertyName(a.key);if(!h)continue;let T;if(a.value.type==="Identifier")T=a.value.name;else if(a.value.type==="AssignmentPattern"&&a.value.left.type==="Identifier")T=a.value.left.name;if(!T)continue;o.push({kind:"prop",name:T,publicPropName:h})}return o}function Ct(n,t,r,o,a){if(!be(t))return;let h=a?.allowRunesProps??!1,T=a?.forceProp??!1,D=t;for(let S of D.declarations){if(h&&g(x(S.init),"$props")){for(let R of Mi(n,D,S))nn(R.kind==="prop"?r:o,R.name,R.kind==="prop"?{kind:"prop",publicPropName:R.publicPropName}:{kind:"local"});continue}let N=D.kind==="var"?o:r,L=T?"prop":"local";for(let R of Ge(S.id))nn(N,R,L==="prop"?{kind:"prop",publicPropName:R}:{kind:"local"})}}function Ii(n,t){if("id"in n&&n.id&&typeof n.id==="object"&&"name"in n.id&&typeof n.id.name==="string")nn(t,n.id.name,{kind:"local"});for(let r of n.params)for(let o of Ge(r))nn(t,o,{kind:"local"})}function _i(n,t,r,o){if(!Array.isArray(t))return;for(let a of t){if(!a||typeof a!=="object"||!("type"in a))continue;switch(a.type){case"VariableDeclaration":Ct(n,a,r,o);break;case"FunctionDeclaration":if(a.id?.name)nn(r,a.id.name,{kind:"local"});break;case"ClassDeclaration":if(a.id?.name)nn(r,a.id.name,{kind:"local"});break}}}function Bi(n,t){for(let{local:r,exported:o}of t){if(r.type!=="Identifier")continue;let a=o.type==="Identifier"?o.name:String(o.value);if(n.componentScope.get(r.name)?.kind==="prop")continue;n.componentScope.set(r.name,{kind:"prop",publicPropName:a})}}function Fi(n,t,r){if(!r||typeof r!=="object")return;let o="content"in r&&r.content&&typeof r.content==="object"&&"body"in r.content&&Array.isArray(r.content.body)?r.content:("body"in r)&&Array.isArray(r.body)?r:void 0;if(!o||!("body"in o)||!Array.isArray(o.body))return;for(let a of o.body){if(!a||typeof a!=="object"||!("type"in a))continue;switch(a.type){case"ImportDeclaration":for(let h of a.specifiers??[])if(h.local?.name)nn(t.componentScope,h.local.name,{kind:"local"});break;case"VariableDeclaration":Ct(n,a,t.componentScope,t.componentScope,{allowRunesProps:!0});break;case"FunctionDeclaration":if(a.id?.name)nn(t.componentScope,a.id.name,{kind:"local"});break;case"ClassDeclaration":if(a.id?.name)nn(t.componentScope,a.id.name,{kind:"local"});break;case"ExportNamedDeclaration":if(!a.declaration||typeof a.declaration!=="object"||!("type"in a.declaration)){if(a.source==null)Bi(t,a.specifiers??[]);break}if(a.declaration.type==="VariableDeclaration")Ct(n,a.declaration,t.componentScope,t.componentScope,{forceProp:!0});else if(a.declaration.type==="FunctionDeclaration"&&a.declaration.id?.name)nn(t.componentScope,a.declaration.id.name,{kind:"prop",publicPropName:a.declaration.id.name});break}}}function Sr(n,t){t.componentScope.clear(),t.scopeDeclarations=new Map,t.activeScopes.length=0,Fi(n,t,t.parsed?.instance)}function vr(n){return{varScopeStack:[n.componentScope]}}function Cr(n,t,r,o){if(!Jn(o))return;let a=Ri(t,o),h=r.varScopeStack[r.varScopeStack.length-1]??t.componentScope;switch(String(o.type)){case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":Ii(o,a);break;case"BlockStatement":_i(n,o.body,a,h);break;case"CatchClause":if("param"in o)for(let D of Ge(o.param))nn(a,D,{kind:"local"});break;case"EachBlock":{let D=o;for(let S of Ge(D.context))nn(a,S,{kind:"local"});if(typeof D.index==="string")nn(a,D.index,{kind:"local"});else if(D.index&&"name"in D.index)nn(a,D.index.name,{kind:"local"});break}case"AwaitBlock":{let D=o;for(let S of Ge(D.value))nn(a,S,{kind:"local"});for(let S of Ge(D.error))nn(a,S,{kind:"local"});break}}if(Er(o))r.varScopeStack.push(a);return a}function Pr(n,t){if(Er(t))n.varScopeStack.pop()}function wt(n,t,r){let o=t.findVariableTypeAndDescription(r);if(o&&o.type===n.explicitVariableTypesByName.get(r))Ye(n,n.explicitVariableTypeNodesByName.get(r));return o}function ct(n,t,r,o=!0){let a=wt(n,t,r);if(a||!o)return a;let h=it(t,n,r);return h?{type:h,...t.findVariableJsDoc(r)}:null}function ji(n,t,r,o){if(!e(r))return null;let a=Fn(n,r.name);if(l(a))return Rr(n,t,a,o).properties;let h=ct(n,t,r.name);return h?Sn(h.type):null}function Oi(n,t,r){return t.properties.some((o)=>o.type==="Property"&&o.kind==="get"&&n.getPropertyName(o.key)===r)}function wr(n,t,r){if(!t||typeof t!=="object"||!(r in t))return;let o=t[r];if(!o||typeof o!=="object"||!("typeAnnotation"in o))return;return fn(n,o.typeAnnotation)}function qi(n){let t=n?.body.body;if(t?.length!==1||t[0].type!=="ReturnStatement")return;return t[0].argument??void 0}function Vi(n,t,r,o,a,h){if(e(h)){let T=ct(n,t,h.name);if(T)return T;return Fe(n,"context-any-type",o,`Context "${r}" property "${o}" has no type annotation; defaulted to "any".`,Me(n,a)),{type:"any"}}if(h?.type==="ArrowFunctionExpression"||h?.type==="FunctionExpression")return{type:`(${h.params.map((D)=>`${e(D)?D.name||"arg":"arg"}: any`).join(", ")}) => any`};if(y(h))return{type:Gn(h)??"null"};return{type:"any"}}function Rr(n,t,r,o){let a=[],h=!1;for(let T of r.properties){if(T.type==="SpreadElement"){let R=ji(n,t,T.argument,o);if(R)a.push(...R);else h=!0,Fe(n,"spread-unresolved",o,`Context "${o}" spreads a value sveld can't resolve; its shape is widened to "Record<string, any>".`,Me(n,T));continue}if(T.type!=="Property")continue;let D=t.getPropertyName(T.key);if(!D)continue;if(T.kind==="set"&&Oi(t,r,D))continue;let S=T.kind==="get"||T.kind==="set"?T.value:void 0,N=S?T.kind==="get"?wr(n,S,"returnType"):wr(n,S.params[0],"typeAnnotation"):void 0,L=N?{type:N}:Vi(n,t,o,D,T,T.kind==="get"?qi(S):T.kind==="set"?void 0:T.value);a.push({name:D,type:L.type,description:L.description,optional:!1,...L.internal?{internal:!0}:{}})}return{properties:a,hasUnresolvedSpread:h}}function Dr(n,t,r,o){let{properties:a,hasUnresolvedSpread:h}=Rr(n,t,r,o);return{key:o,typeName:j(o),properties:a,description:void 0,...h?{hasUnresolvedSpread:h}:{}}}function kr(n,t,r,o){if(l(r))return Dr(n,t,r,o);else if(e(r)){let a=r.name,h=ct(n,t,a,!1),T=h?void 0:Fn(n,a);if(l(T))return Dr(n,t,T,o);let D=h??ct(n,t,a);if(D){let S=Sn(D.type);return{key:o,typeName:j(o),...S?{}:{type:D.type},properties:S??[],description:D.description,...D.internal?{internal:!0}:{}}}return Fe(n,"context-any-type",a,`Context "${o}" variable "${a}" has no type annotation; defaulted to "any".`,Me(n,r)),{key:o,typeName:j(o),type:"any",properties:[]}}return null}function Ar(n){let t=n.callee;if(!t||typeof t!=="object"||!("type"in t))return null;let r=t.type==="Identifier"&&t.name==="Symbol",o=t.type==="MemberExpression"&&!t.computed&&t.object.type==="Identifier"&&t.object.name==="Symbol"&&t.property.type==="Identifier"&&t.property.name==="for";if(!r&&!o)return null;let a=n.arguments[0];if(!a||typeof a!=="object"||!("type"in a))return"";if(a.type==="Literal"&&typeof a.value==="string")return a.value;if(a.type==="TemplateLiteral"&&a.quasis?.length===1)return a.quasis[0].value.cooked??"";return""}function Nr(n){return{kind:"pending",importSource:n.source,importedName:n.importedName,...n.members?{members:n.members}:{}}}function Mr(n,t,r=0){if(!t||typeof t!=="object"||!("type"in t))return{kind:"unresolved"};let o=t;if(o.type==="Literal"||o.type==="TemplateLiteral"){let a=f(o);return a==null?{kind:"unresolved"}:{kind:"resolved",key:a}}if(o.type==="CallExpression"||o.type==="NewExpression"){let a=Ar(o);return a==null?{kind:"unresolved"}:{kind:"resolved",key:a}}if(o.type==="Identifier"){if(r>=5)return{kind:"unresolved"};let a=Fn(n,o.name);if(a&&typeof a==="object"&&"type"in a){let T=a;if((T.type==="CallExpression"||T.type==="NewExpression")&&Ar(T)==="")return{kind:"resolved",key:o.name};return Mr(n,T,r+1)}let h=r===0&&Wn(n,o.name)?void 0:n.valueImportBindingsByLocalName.get(o.name);return h?Nr(h):{kind:"unresolved"}}if(o.type==="MemberExpression"){let a=r===0&&at(n,o)?void 0:se(n,o);if(a)return Nr(a)}return{kind:"unresolved"}}function Lr(n,t,r,o,a){let h=fn(n,o)??"";Fe(n,"context-value-unresolved",t,`setContext(${r}, ${h}): the value isn't an object literal or a variable, so sveld can't describe its shape; the context is skipped.`,a)}function Ir(n,t,r,o){if(!r||typeof r!=="object"||!("type"in r)||r.type!=="CallExpression")return;let a=r,h=a.arguments[0];if(!h)return;let T=Mr(n,h);if(T.kind==="unresolved"||T.kind==="resolved"&&!T.key){let R=fn(n,h)??"";Fe(n,"context-key-unresolved",R,`setContext key \`${R}\` isn't a string literal, const-bound string, Symbol(), or imported \`export const\` string; the context is skipped.`,Me(n,r));return}let D=a.arguments[1];if(!D)return;let S=Me(n,r);if(T.kind==="pending"){let R=re(T),_=kr(n,t,D,R);if(_)n.pendingContextKeyCandidates.push({importSource:T.importSource,importedName:T.importedName,...T.members?{members:T.members}:{},..._.type===void 0?{}:{type:_.type},properties:_.properties,description:_.description,..._.hasUnresolvedSpread?{hasUnresolvedSpread:!0}:{},..._.internal?{internal:!0}:{},source:S});else Lr(n,R,R,D,S);return}let N=T.key,L=kr(n,t,D,N);if(!L){Lr(n,N,JSON.stringify(N),D,S);return}if(n.contexts.has(N)){Fe(n,"context-duplicate-key",N,`setContext("${N}", ...) was called more than once; only the first call's shape is used.`,S);return}n.contexts.set(N,{...L,source:S})}var $i=/\n/g,Hi=/^[A-Za-z_$][\w$]*$/;function Dt(n,t,r){return{variableType:(o)=>{if(r?.has(o))return;return wt(t,n,o)?.type??it(n,t,o)},getPropertyName:(o)=>n.getPropertyName(o)}}function zn(n,t,r){if(!t||typeof t!=="object"||!("type"in t))return r;if(e(t)){if(!Wn(n,t.name))return r;let a=r??new Set;return a.add(t.name),a}let o=r;if(l(t)){for(let a of t.properties)if(a.type==="Property")o=zn(n,a.value,o)}else if(t.type==="ArrayExpression")for(let a of t.elements)o=zn(n,a,o);return o}function kt(n,t){if(e(t))return n.variableType(t.name);return Ae(n,t)}function Ae(n,t){if(!t||typeof t!=="object"||!("type"in t))return;if(l(t))return Br(n,t);if(t.type==="ArrayExpression")return Fr(n,t);return}function _r(n,t){if(!t||typeof t!=="object"||!("type"in t))return"any";if(e(t))return n.variableType(t.name)??"any";if(y(t))return Gn(t)??"null";if(l(t))return Br(n,t);if(t.type==="ArrayExpression")return Fr(n,t);return"any"}function Br(n,t){if(t.properties.length===0)return"Record<string, never>";let r=[],o=!1;for(let a of t.properties){let h=a.type==="Property"&&!a.computed?n.getPropertyName(a.key):void 0;if(a.type!=="Property"||!h){o=!0;continue}r.push({name:h,type:_r(n,a.value)})}if(!o)return Kn(r);if(r.length===0)return"Record<string, any>";return Kn([...r,{name:"[key: string]",type:"any"}])}function Fr(n,t){let r=new Set(t.elements.filter((o)=>o!=null).map((o)=>_r(n,o)));if(r.size===0)return"any[]";if(r.size===1)return`${[...r][0]}[]`;return`(${[...r].join(" | ")})[]`}function jr(n,t){for(let[r,o]of n.arguments.entries()){if(e(o)&&o.name===t)return{argumentIndex:r};if(!l(o))continue;for(let a of o.properties){if(a.type!=="Property"||!e(a.value))continue;if(a.value.name!==t)continue;let h=!a.computed&&e(a.key)?a.key.name:void 0;return{argumentIndex:r,property:h??""}}}return}function le(n){return typeof n==="string"?JSON.stringify(n):String(n)}function Dn(n,{name:t,detail:r,has_argument:o,description:a,deprecated:h,tags:T,internal:D,source:S}){if(t===void 0)return;let N=!o&&!r?"null":d(r),L=a,R=n.events.get(t);if(R?.type==="forwarded")n.events.set(t,{type:"dispatched",name:t,detail:N,description:L||R.description,deprecated:h??R.deprecated,tags:T??R.tags,...D||R.internal?{internal:!0}:{},source:S||R.source});else if(R){let _=R.tags??T,X=n.untypedJsDocEventNames.delete(t);n.events.set(t,{...R,detail:R.detail===void 0||X?N:R.detail,description:R.description||L,deprecated:R.deprecated??h,tags:_,...R.internal||D?{internal:!0}:{},source:S||R.source})}else n.events.set(t,{type:"dispatched",name:t,detail:N,description:L,deprecated:h,tags:T,...D?{internal:!0}:{},source:S})}function Or(n,t){let r=t.arguments[0],o=de(r,"CustomEvent");if(!o&&!de(r,"Event"))return;let a=r.arguments[0],h=y(a)?a.value:void 0;if(h==null)return;let T=o?r.arguments[1]:void 0,D=!1,S;if(l(T)){let N=T.properties.find((L)=>L.type==="Property"&&e(L.key)&&L.key.name==="detail");if(N?.type==="Property")D=!0,S=N.value}return{name:String(h),detail:S,hasArgument:D,nestedBoundNames:zn(n,S),source:Me(n,t)}}function qr(n,t,r){let o=kt(Dt(n,t,r.nestedBoundNames),r.detail),a=o===void 0&&y(r.detail)?r.detail.value:void 0;Dn(t,{name:r.name,detail:o??(a==null?"":le(a)),has_argument:r.hasArgument,source:r.source})}function Kn(n,t,r=!1){if(n.length===0)return"null";let o=n.map(({name:a,type:h,description:T,optional:D,default:S})=>{let N=D?"?":"",L=Hi.test(a)||a.startsWith("[")?a:JSON.stringify(a),R=T||"";if(S&&R)R=`${R} @default ${S}`;else if(S)R=`@default ${S}`;if(R=E(R),R){if(r)return`${R.includes(`
5
+ `)?`/**
6
+ ${R.split(`
7
+ `).map((X)=>X?` * ${X}`:" *").join(`
8
+ `)}
9
+ */`:`/** ${R} */`}
10
+ ${L}${N}: ${h};`;return`/** ${R.replace($i," ")} */ ${L}${N}: ${h};`}return`${L}${N}: ${h};`}).join(r?`
11
+ `:" ");return r?`{
12
+ ${o}
13
+ }`:`{ ${o} }`}var Gi=/\w/;function Ui(n,t){let r=n.trim();if(!r.startsWith("{")||!r.endsWith("}"))return;let o=r.slice(1,-1),a=[],h=0,T="";for(let D of o)if(D==="{"||D==="<"||D==="("||D==="[")h++,T+=D;else if(D==="}"||D===">"||D===")"||D==="]")h--,T+=D;else if((D===";"||D===",")&&h===0)a.push(T.trim()),T="";else T+=D;if(T.trim())a.push(T.trim());for(let D of a){if(!D.startsWith(t))continue;let S=D.slice(t.length);if(S.length>0&&Gi.test(S[0]))continue;let N=S.trimStart();if(N.startsWith("?"))N=N.slice(1).trimStart();if(N.startsWith(":"))return N.slice(1).trim()}return}function pt(n,t,r){let o=r;if(o.computed||o.object?.type!=="Identifier"||o.property?.type!=="Identifier")return;let a=o.object.name,h=o.property.name;if(!a||!h)return;if(n.wholePropsLocals.has(a))return t.getPropTypeByLocalOrPublic(h);let T=t.getPropTypeByLocalOrPublic(a)??t.findVariableTypeAndDescription(a)?.type;if(!T)return;return Ui(T,h)}var Wi=null;function Ji(n,t,r){let o={value:void 0,replace:!1};if(!r||typeof r!=="object"||!("type"in r))return o;if(r.type==="Identifier")o.value=r.name,o.replace=!0;else if(r.type==="Literal")o.value=String(r.value);else if(r.type==="MemberExpression")o.value=pt(n,t,r);else if((r.type==="ObjectExpression"||r.type==="TemplateLiteral")&&"start"in r&&"end"in r&&typeof r.start==="number"&&typeof r.end==="number")o.value=je(n,r.start,r.end);return o}function zi(n,t,r){if(!e(r))return null;let o=Fn(n,r.name);if(l(o))return At(n,t,o).slot_props;let a=t.findVariableTypeAndDescription(r.name);if(!a)return null;let h=Sn(a.type);if(!h)return null;let T={};for(let D of h)T[D.name]={value:D.type,replace:!1};return T}function At(n,t,r){let o={},a=!1;for(let h of r.properties){if(h.type==="SpreadElement"){let D=zi(n,t,h.argument);if(D)Object.assign(o,D);else a=!0,Fe(n,"spread-unresolved","slot_props",`Slot props spread a value sveld can't resolve; its shape is widened to "Record<string, any>".`,Me(n,h));continue}if(h.type!=="Property"||h.computed)continue;let T=t.getPropertyName(h.key);if(!T)continue;o[T]=Ji(n,t,h.value)}return{slot_props:o,hasUnresolvedSpread:a}}function Ki(n,t){if(!t||typeof t!=="object"||!("type"in t))return null;if(t.type==="Identifier"){let h=t,T=n.propLocalToPublicName.get(h.name);if(!T)return null;return{publicName:T,trackingName:h.name}}if(t.type!=="MemberExpression")return null;let r=t,o=r.object&&typeof r.object==="object"&&"type"in r.object&&r.object.type==="Identifier"?r.object.name:void 0;if(!o||!n.wholePropsLocals.has(o))return null;let a;if(!r.computed&&r.property&&typeof r.property==="object"&&"type"in r.property){if(r.property.type==="Identifier")a=r.property.name;else if(r.property.type==="Literal"&&r.property.value!=null)a=String(r.property.value)}else if(r.computed&&r.property&&typeof r.property==="object"&&"type"in r.property&&r.property.type==="Literal"&&"value"in r.property&&r.property.value!=null)a=String(r.property.value);if(!a)return null;return{publicName:a,trackingName:a}}function Vr(n,t){let r=t;if(r&&typeof r==="object"&&"type"in r&&r.type==="ChainExpression")r=r.expression;if(!r||typeof r!=="object"||!("type"in r)||r.type!=="CallExpression")return null;let o=r;if(!o.callee||typeof o.callee!=="object"||!("type"in o.callee))return null;let a=Ki(n,o.callee);if(!a)return null;return{...a,arguments:o.arguments}}function Xn(n,{slot_name:t,slot_props:r,slot_props_unresolved_spread:o,slot_fallback:a,slot_description:h,slot_deprecated:T,slot_tags:D,slot_internal:S,source:N}){let L=t===void 0||t==="",R=L?Wi:t??"",_=d(a),X=r===void 0||r===""?void 0:r,K=h?.trim()||void 0;if(n.slots.has(R)){let Q=n.slots.get(R);if(Q)n.slots.set(R,{...Q,default:Q.default??L,fallback:_,slot_props:Q.slot_props===void 0?X:Q.slot_props,slot_props_unresolved_spread:Q.slot_props_unresolved_spread||o,description:Q.description||K,deprecated:Q.deprecated??T,tags:Q.tags||D,...Q.internal||S?{internal:!0}:{},source:N||Q.source})}else n.slots.set(R,{name:R,default:L,fallback:_,slot_props:X,slot_props_unresolved_spread:o,description:K,deprecated:T,tags:D,...S?{internal:!0}:{},source:N})}var Xi=/\s*=\s*/;function Yi(n){let t=n.indexOf("<");if(t===-1||!n.endsWith(">"))return n;let r=n.slice(0,t),o=n.slice(t+1,-1),a=m(o).map((h)=>h.trim().replace(Xi," = ")).join(", ");return`${r}<${a}>`}var Zi=/\s/;function Mt(n,t,r){let o=t;while(o<r){let a=n[o];if(a==="/"&&n[o+1]==="/"){let h=n.indexOf(`
14
+ `,o+2);if(h===-1||h>=r)return!0;o=h+1}else if(a==="/"&&n[o+1]==="*"&&n[o+2]!=="*"){let h=n.indexOf("*/",o+2);if(h===-1||h+2>r)return!1;o=h+2}else if(a===" "||a===`
15
+ `||a==="\t"||a==="\r"||Zi.test(a))o++;else return!1}return!0}var Qi=/;$/,es=/^-\s*/;function It(n){let t=[],r,o=!1;for(let a of n){let h=Y(a);if(r!==void 0){if(h)t.push(a.trim()),r=void 0;else t.push(a.slice(Math.min(r,G(a))).trimEnd());continue}let T=a.trim();if(T===""){o=t.length>0;continue}if(o)t.push("");if(o=!1,t.push(T),h)r=G(a)}return t.join(`
16
+ `).trimEnd()}function kn(n){if(n===void 0)return;let t=n.replace(es,"").trim();return t===""?"":t}function Gr(n){let t=n.name?`${n.name} ${n.description}`:n.description;return kn(It(t.split(`
17
+ `)))}var ns=new Set(["restProps","slot","snippet","event","typedef","callback"]),Nt=new Set(["property","type"]),ts=new Set(["slot","snippet","typedef","callback"]);function lt(n){if(!n||n.length===0)return;return n[Ur(n)].content}function Ur(n){let t=0;while(n[t+1]?.continuesType)t++;return t}function $r(n){return!n||!n.tag&&!n.continuesType&&n.content.trim()===""}function rs(n){return n.text.split(`
18
+ `).length===n.lines.length}function Lt(n,t){if(t<=0)return n;return n.split(`
19
+ `).slice(0,-t).join(`
20
+ `).trimEnd()}var _t=new Set(["since","example","see"]),Wr=new Set(["bindable","default","required"]),os=new Set(["abstract","access","alias","alpha","arg","argument","async","augments","author","beta","borrows","const","constructs","copyright","defaultValue","description","emits","experimental","exports","external","fires","function","global","import","inner","instance","kind","lends","license","link","listens","member","name","override","package","private","prop","protected","public","readonly","remarks","requires","satisfies","sealed","static","summary","throws","todo","tutorial","typeParam","version","virtual","yields"]),is=[..._t,...Wr,"type","param","returns","typedef","property","callback","template","generics","slot","snippet","event","restProps","extends","extendProps","deprecated","ignore","internal","sveld-ignore","csspart","cssprop"];function Jr(n){return n.length>0?n.map((t)=>({name:t.tag,body:t.text})):void 0}function Rt(n){let t=n.trim();return t===""?!0:t}function ss(n){let t=n.trim().replace(Qi,"").trimEnd();if(!t.startsWith("{")||!t.endsWith("}"))return!1;let r=0,o=null;for(let a=0;a<t.length;a++){let h=t[a];if(o!==null){if(h==="\\"){a++;continue}if(h===o)o=null;continue}if(h==='"'||h==="'"||h==="`"){o=h;continue}if(h==="{"||h==="["||h==="(")r++;else if(h==="}"||h==="]"||h===")"){if(r--,r===0&&a<t.length-1)return!1}}return r===0}function Bt(n){let t=n;if(!t.startsWith("/*"))t=`/*${t}`;if(!t.endsWith("*/"))t+="*/";return t}function as(n){if(n==="*")return"any";return n.trim()}function Re(n){let t=v(Bt(n)),{returns:r}=W(t);return r?as(r.type):void 0}function Le(n){let t=v(Bt(n)),{deprecated:r,passthrough:o,internal:a}=W(t);return{deprecated:r,tags:Jr(o),internal:a}}var cs=new Set(["type","param","returns","return","extends","extendProps","restProps","slot","snippet","event","typedef","callback","bindable","deprecated","ignore","internal","csspart","cssprop","cssproperty"]);function Ft(n,t){let r=n.parsedJsDocByText.get(t);if(r===void 0)r=v(t),n.parsedJsDocByText.set(t,r);return r}function W(n){let t=n[0]?.tags??[],r,o=[],a,h,T,D=!1,S=[],N=[],L=[];for(let R of t)if(R.tag==="type")r=R;else if(R.tag==="param")o.push(R);else if(R.tag==="returns"||R.tag==="return")a=R;else if(R.tag==="deprecated")T??=Rt(R.text);else if(R.tag==="ignore"||R.tag==="internal")D=!0;else if(R.tag==="sveld-ignore")L.push(R.name);else if(_t.has(R.tag))N.push(R);else if(R.tag==="bindable"){if(R.type)continue;let _=`${R.name}${R.description?` ${R.description}`:""}`.trim();if(_==="readonly"||_==="writable")h??=_}else if(!cs.has(R.tag))S.push(R);return{type:r,param:o,returns:a,binding:h,deprecated:T,internal:D,additional:S,passthrough:N,ignore:L,description:n[0]?.description}}function ps(n,t){if(typeof t.start!=="number"||typeof t.end!=="number")return;let r=n.jsDocBlocksByStart.get(t.start);if(r===void 0||r.end!==t.end)return;return[r]}function ls(n){if(!n||n.length===0)return;let t=n[n.length-1];return t&&typeof t==="object"&&"value"in t?t:void 0}function zr(n,t,r){if(!t||t.length===0||r===void 0||!n.source)return;for(let o=t.length-1;o>=0;o--){let a=t[o];if(!a||typeof a!=="object"||!("value"in a)||!("end"in a))continue;if(typeof a.end!=="number"||!("start"in a)||typeof a.start!=="number")continue;if("type"in a&&a.type==="Line"||!String(a.value).startsWith("*"))continue;if(Mt(n.source,a.end,r))return a}return}function us(n){let t=new Set,r=(a)=>{let{leadingComments:h,start:T}=a,D=zr(n,h,T);if(D)t.add(D.start)};for(let a of n.funcDecls.values())r(a);let o=[{root:n.parsed?.module,isModule:!0},{root:n.parsed?.instance,isModule:!1}];for(let{root:a,isModule:h}of o)for(let T of(a&&w(a))??[]){let D=T,S=D.type==="ExportNamedDeclaration",N=S?D.declaration:D;if(N?.type==="FunctionDeclaration"){if(S)r(D)}else if(N?.type==="ClassDeclaration"&&h){r(S?D:N);for(let L of N.body?.body??[])if(L.type==="MethodDefinition")r(L)}else if(N?.type==="VariableDeclaration"&&(h||!S||N.kind==="const")&&N.declarations?.length===1&&ds.has(N.declarations[0].init?.type??""))r(D)}return t}var ds=new Set(["ArrowFunctionExpression","FunctionExpression"]);function an(n,t,r){if(!r?.leadingComments)return;let o=zr(n,r.leadingComments,r.start);if(!o)return;return Ts(n,t,[o])}function jt(n,t,r){if(!r?.leadingComments)return;return an(n,t,r)}function fs(n,t,r){let o=n;if(t)o=`${n} extends ${t}`;if(r)o+=` = ${r}`;return o}var ms=/^[^\s,]+/,Hr=/^\s*,\s*([^\s,]+)/;function Kr(n,t){let r=n.optional?n.name:ms.exec(n.name)?.[0];if(!r)return[];let o=[{name:r,constraint:fs(r,t,n.default)}],a=`${n.optional?"":n.name.slice(r.length)} ${n.description}`;for(let h=Hr.exec(a);h;h=Hr.exec(a))o.push({name:h[1],constraint:h[1]}),a=a.slice(h[0].length);return o}var ys=/[\w$]+/g,gs=new Set(["property","param","returns","return"]);function hs(n,t,r){let o=[n[t].type];for(let h=t+1;gs.has(n[h]?.tag);h++)o.push(n[h].type);let a=new Set(o.join(" ").match(ys));return r.some(({name:h})=>a.has(h))}function bs(n){let t=n?.trim();return!t||t==="object"||t==="Object"}function Ts(n,t,r){if(!r)return;let o=ls(r);if(!o)return;let a=ps(n,o)??Ft(n,Bt(o.value)),{type:h,param:T,returns:D,binding:S,deprecated:N,internal:L,additional:R,passthrough:_,ignore:X,description:K}=W(a),Q,te,Ue,Oe;if(h)Q=t.aliasType(h.type);if(T.length>0)te=T.filter((Ie)=>!Ie.name.includes(".")).map((Ie)=>({name:Ie.name,type:t.aliasType(Ie.type),description:kn(It(Ie.description.split(`
21
+ `))),optional:Ie.optional||!1}));if(D)Ue=t.aliasType(D.type);let ue,$e=R;if(typeof o.start==="number"&&n.functionDocCommentStarts.has(o.start)){let Ie=R.filter((_e)=>_e.tag==="template"&&_e.name);if(Ie.length>0)ue=Ie.flatMap((_e)=>Kr(_e,t.aliasType(_e.type))).map(({constraint:_e})=>_e).join(", "),$e=R.filter((_e)=>_e.tag!=="template")}let we=d(K?.trim());if(we||$e.length>0){let Ie=[];if(we)Ie.push(we);for(let _e of $e)Ie.push(`@${_e.tag}${_e.text?` ${_e.text}`:""}`);Oe=Ie.join(`
22
+ `)}return{type:Q,params:te,returnType:Ue,description:Oe,binding:S,deprecated:N,tags:Jr(_),sveldIgnore:X.length>0?X:void 0,internal:L,typeParameters:ue}}function Xr(n,t,r=n.source){if(!r)return;let o=!1,a=!1,h=!1,T=new Set,D=()=>{if(o&&a&&!h){h=!0;let K=n.componentFilePath?` in ${n.componentFilePath}`:"";console.warn(`Warning: Both @generics and @template tags are used to declare component generics${K}; their declarations are combined in the order encountered.`)}},S=(K,Q)=>{if(T.has(K))Fe(n,"generics-conflict",K,`Duplicate generic name "${K}".`,Q);else T.add(K)},N=(K,Q)=>{if(n.generics){let Ue=m(n.generics[0]).map((Oe)=>Oe.trim()).indexOf(K.trim());if(Ue!==-1){let Oe=m(n.generics[1]).map((ue)=>ue.trim());Oe[Ue]=Q,n.generics=[n.generics[0],Oe.join(", ")];return}}t.accumulateGeneric(K,Q)},L=(K,Q)=>{if(n.typedefs.has(K))Fe(n,"typedef-duplicate",K,`Duplicate typedef/callback name "${K}"; the later declaration overwrites the earlier one.`,Q)},R=(K,Q,te,Ue)=>{let Oe=K.findIndex((ue)=>ue.name===Q.name);if(Oe===-1)K.push(Q);else{let ue=te?` of "${te}"`:"";Fe(n,"property-duplicate",Q.name,`Duplicate property "${Q.name}"${ue}; the later declaration overwrites the earlier one.`,Ue),K[Oe]=Q}},_=r.includes("@template")?us(n):new Set;n.functionDocCommentStarts=_;let X=v(r);for(let K of X)n.jsDocBlocksByStart.set(K.start,K);for(let{tags:K,description:Q,lines:te,start:Ue}of X){let Oe=_.has(Ue),ue,$e,we,Ie,_e=!1,gn,cn,hn=[],on=[],yn=[],Ze,Cn,Pn,I,F=[],q=!1,oe=[],J,O,V,ee=[],ce=!1,ge=[],Ee,ke,Pe=!1,pe=!0,Ne=[],Qe,Te=!1,ze=[],en=(U)=>{if(ze.length===0)return Yi(U);let ae=`${U}<${ze.join(", ")}>`;return ze.length=0,ae},Ke=new Map,Xe=new Set,pn=new Set,wn,bn;for(let U of K)if(U.lines.length>0)Xe.add(U.lines[0].number);for(let U of te)if(U.continuesType)Xe.add(U.number);let Mn=new Set,qn=!1,nt=!1;for(let U of te){if(!U.tag&&!U.continuesType&&U.content&&(nt||U.content.trim()!=="}"))Ke.set(U.number,U.content);if(U.tag!==void 0||U.continuesType)qn=!0;else if(!U.content.trim());else if(qn&&(U.indent||nt))Mn.add(U.number);else qn=!1;if(Y(U.content))nt=!nt}let mt=(U,ae)=>{let qe=ae?ae.text.split(`
23
+ `):[],Z=ae?.line;for(let ve of U){if(Z!==void 0&&ve-Z>1){let Be=Z+1;while(Be<ve&&$r(te[Be]))Be++;if(Be===ve)for(let We=Z+1;We<ve;We++)qe.push("")}let ln=te[ve];qe.push(ln.indent+ln.content),Z=ve}return It(qe)},ri=(U)=>{if(U.length===0)return;let ae=U[0].number,qe=[],Z=!1;for(let ve=ae-1;ve>=0;ve--){if(Xe.has(ve)||Mn.has(ve)||pn.has(ve))break;if(Ke.has(ve))qe.unshift(ve),Z=!0;else if(Z&&!$r(te[ve]))break}if(qe.length===0)return;for(let ve of qe)pn.add(ve);return wn?.(qe[0]),mt(qe)},yt=(U,ae)=>{if(!rs(U)){for(let Z=1;Z<U.lines.length;Z++)pn.add(U.lines[Z].number);return}let qe=U.lines[U.lines.length-1].number;bn=(Z)=>ae(qe-Z+1)},In=(U,ae,qe=!1)=>{let Z=kn(lt(U)),ve=ae!==void 0&&ns.has(ae.tag)&&!kn(lt(ae.lines)),ln=qe&&(ae===void 0||!Nt.has(ae.tag)),Be=[];for(let We=1;We<U.length;We++){let Ve=U[We];if((ve||ln)&&!Mn.has(Ve.number))continue;if(!Ke.get(Ve.number)?.trim()||pn.has(Ve.number))continue;Be.push(Ve.number),pn.add(Ve.number)}if(Be.length===0)return Z;return mt(Be,{text:Z??"",line:U[Ur(U)].number})},oi=(U,ae,qe,Z)=>{if(ue===void 0||we)return;if(cn!==void 0&&Mn.has(cn+1))return;if(Z?.tag!=="event"&&!Nt.has(Z?.tag??""))return;if(kn(lt(qe)))return;let ve=ae?`@${U} "${ae}"`:`@${U}`;Fe(n,"event-description-ambiguous",ue,`Text after @event "${ue}" was used as the description of ${ve}. Move it above the tag it describes, indent it as a continuation line, or give each event its own comment block.`,dn(n,qe))},Vn=(U)=>{let{tag:ae,name:qe,lines:Z}=K[U],ve=ri(Z);if(ve)oi(ae,qe,Z,K[U-1]);return ve},gt=()=>{if(ue!==void 0){let U=$e&&$e!=="object"&&$e!=="Object"?$e:void 0,ae;if(U)ae=U;else if(yn.length>0)ae=Kn(yn,ue,!0);else ae=$e||"";if(cn!==void 0){let Z;for(let Be of K){let We=Be.lines[0]?.number;if(typeof We!=="number")continue;if(We<=cn)continue;if(Nt.has(Be.tag))continue;Z=We;break}let ve=[],ln=Array.from(Ke.keys()).sort((Be,We)=>Be-We);for(let Be of ln){if(Be<=cn)continue;if(Z!==void 0&&Be>=Z)continue;if(pn.has(Be))continue;if(Ke.get(Be)?.trim())ve.push(Be),pn.add(Be)}if(ve.length>0)we=mt(ve,we?{text:we,line:cn}:void 0)}let qe=ae===""&&(!n.events.has(ue)||n.untypedJsDocEventNames.has(ue));if(Dn(n,{name:ue,detail:ae,has_argument:!1,description:we,deprecated:Ie,tags:hn.length>0?hn:void 0,internal:_e||void 0,source:gn}),qe)n.untypedJsDocEventNames.add(ue);n.eventDescriptions.set(ue,we),n.jsDocEventNames.add(ue),n.jsDocEventSources.set(ue,gn),En(n,"event-no-source",ue,on),yn.length=0,ue=void 0,$e=void 0,we=void 0,Ie=void 0,_e=!1,gn=void 0,cn=void 0,hn=[],on=[]}},ir=()=>{if(Ze!==void 0){let U,ae;if(oe.length>0)U=Kn(oe,void 0,!0),ae=`type ${Ze} = ${U};`;else if(Cn)U=Cn,ae=ss(U)?`interface ${Ze} ${U}`:`type ${Ze} = ${U};`;else U="{}",ae=`type ${Ze} = ${U};`;let qe=oe.length>0?oe.filter(({name:Z})=>!Z.includes(".")&&!Z.startsWith("[")).map(({name:Z,type:ve,optional:ln,description:Be})=>({name:Z,type:ve,optional:ln===!0,...Be?{description:Be}:{}})):Sn(U);if(qe)n.typedefMembersByName.set(Ze,qe);L(Ze,I),n.typedefs.set(Ze,{type:U,name:Ze,description:d(Pn),ts:ae,tags:F.length>0?F:void 0,...q?{internal:!0}:{},source:I}),oe.length=0,Ze=void 0,Cn=void 0,Pn=void 0,I=void 0,F=[],q=!1}},sr=()=>{if(J!==void 0){let qe=`(${ge.map(({name:ve,type:ln,optional:Be})=>`${ve}${Be?"?":""}: ${ln}`).join(", ")}) => ${Ee||"void"}`,Z=`type ${J} = ${qe};`;L(J,V),n.typedefs.set(J,{type:qe,name:J,description:d(O),ts:Z,tags:ee.length>0?ee:void 0,...ce?{internal:!0}:{},source:V}),ge.length=0,Ee=void 0,J=void 0,O=void 0,V=void 0,ee=[],ce=!1}},ii=K.some((U)=>U.tag==="slot"||U.tag==="snippet"),si=K.some((U)=>U.tag==="extends"||U.tag==="extendProps"),ai=K.some((U)=>U.tag==="slot"||U.tag==="snippet"||U.tag==="event"||U.tag==="typedef"||U.tag==="callback");for(let U=0;U<K.length;U++){let{tag:ae,type:qe,name:Z,description:ve,optional:ln,default:Be,text:We,lines:Ve}=K[U],_n=K[U+1],un=t.aliasType(qe);switch(wn=bn,bn=void 0,ae){case"extends":case"extendProps":if(n.extends!==void 0)Fe(n,"extend-props-duplicate",Z,`A second @extends/@extendProps tag ("${Z}") overwrote the first ("${n.extends.interface}"); only one is used.`,dn(n,Ve));if(n.extends={interface:Z,import:un},pe)pe=!1;break;case"restProps":{let xe=Z?ve?`${Z} ${ve}`:Z:ve,He=kn(xe),sn=He||Vn(U);if(!sn&&pe&&!Pe&&Q)sn=Q,Pe=!0;let Tn={type:"Element",name:un,description:sn||void 0};if(n.rest_props=Tn,He)yt(K[U],($n)=>{Tn.description=kn(Lt(xe,$n))||void 0});if(pe)pe=!1;break}case"slot":case"snippet":{let xe=In(Ve,_n);if(!xe&&pe&&!Pe&&Q)xe=Q,Pe=!0;if(!xe&&Ne.length===0)xe=Vn(U);if(pe)pe=!1;let He=un;if(!He)He="Record<string, never>",Fe(n,"slot-missing-type",Z||"default",`@${ae}${Z?` "${Z}"`:""} is missing a required {Type} annotation; falling back to "${He}".`,dn(n,Ve));Xn(n,{slot_name:Z,slot_props:He,slot_description:xe||void 0,slot_deprecated:Qe,slot_tags:Ne.length>0?[...Ne]:void 0,slot_internal:Te||void 0,source:dn(n,Ve)}),Ne.length=0,Qe=void 0,Te=!1;{let sn=Z===void 0||Z===""?null:Z;ke=(Tn)=>{let $n=n.slots.get(sn);if($n)$n.tags=[...$n.tags??[],Tn]}}break}case"csspart":{let xe=In(Ve,_n);n.cssParts.push({name:Z,...xe?{description:xe}:{}});break}case"cssprop":case"cssproperty":{let xe=In(Ve,_n);n.cssProperties.push({name:Z,...un?{type:un}:{},...Be===void 0?{}:{default:Be},...xe?{description:xe}:{}});break}case"event":{let xe=kn(lt(Ve))||Vn(U);if(gt(),ue=Z,$e=un,cn=Ve.length>0?Ve[0].number:void 0,we=xe,!we&&pe&&!Pe&&Q)we=Q,Pe=!0;if(gn=dn(n,Ve),Ne.length>0)hn.push(...Ne),Ne.length=0;if(ke=(He)=>hn.push(He),pe)pe=!1;break}case"type":if(ue!==void 0)$e=un;break;case"param":if(J!==void 0)ge.push({name:Z,type:un,optional:ln||!1});break;case"returns":case"return":if(J!==void 0)Ee=un;break;case"property":{let xe={name:Z,type:un,description:In(Ve,_n,ue!==void 0),optional:ln||!1,default:Be};if(ue!==void 0)R(yn,xe,ue,dn(n,Ve));else if(Ze!==void 0&&bs(Cn))R(oe,xe,Ze,dn(n,Ve));break}case"typedef":{if(ir(),Ze=en(Z),Cn=un,I=dn(n,Ve),Pn=In(Ve,_n)||Vn(U),!Pn&&pe&&!Pe&&Q)Pn=Q,Pe=!0;if(Ne.length>0)F.push(...Ne),Ne.length=0;if(q=Te,Te=!1,ke=(xe)=>F.push(xe),pe)pe=!1;break}case"callback":{if(sr(),J=en(Z),V=dn(n,Ve),O=In(Ve,_n)||Vn(U),!O&&pe&&!Pe&&Q)O=Q,Pe=!0;if(Ne.length>0)ee.push(...Ne),Ne.length=0;if(ce=Te,Te=!1,ke=(xe)=>ee.push(xe),pe)pe=!1;break}case"generics":{let xe=un||Z;for(let He of m(Z))S(He.trim(),dn(n,Ve));if(o=!0,D(),N(Z,xe),pe)pe=!1;break}case"template":{let xe=Kr(K[U],un),He=U+1;while(K[He]?.tag==="template")He++;let sn=K[He];if((sn?.tag==="typedef"||sn?.tag==="callback")&&!sn.name.includes("<")&&hs(K,He,xe)){ze.push(...xe.map(({constraint:Tn})=>Tn));break}if(ii&&!si){n.deferredSlotBlockGenerics.push(...xe);break}if(Oe)break;for(let Tn of xe)S(Tn.name,dn(n,Ve)),N(Tn.name,Tn.constraint);if(a=!0,D(),pe)pe=!1;break}case"deprecated":{let xe=ue!==void 0;if(xe?Ie!==void 0:Qe!==void 0)break;let He=(sn)=>{if(xe)Ie=sn;else Qe=sn};He(Rt(We)),yt(K[U],(sn)=>{He(Rt(Lt(We,sn)))});break}case"ignore":case"internal":{if(ue===void 0)Te=!0;else _e=!0;break}case"sveld-ignore":if(ue!==void 0)on.push(Z);break;case"enum":case"class":case"implements":case"this":case"namespace":case"memberof":case"module":case"file":case"overview":break;default:{let xe={name:ae,body:We};if(yt(K[U],(He)=>{xe.body=Lt(We,He)}),!_t.has(ae)&&!Wr.has(ae)){let He=os.has(ae)?void 0:B(ae,is,ae.length<=4?1:2);Fe(n,"jsdoc-unknown-tag",ae,He?`Unknown JSDoc tag "@${ae}"; did you mean "@${He}"? Passed through unchanged.`:`Unknown JSDoc tag "@${ae}"; passed through unchanged. If this is a typo, fix the tag name.`,dn(n,Ve))}if(ke)ke(xe);else Ne.push(xe)}break}if(ts.has(ae))gt()}if(gt(),ir(),sr(),ai&&Ne.length>0){for(let U of Ne)Fe(n,"jsdoc-tag-dropped",U.name,`@${U.name} could not attach to a @slot/@snippet/@event/@typedef/@callback tag in the same comment block and was dropped.`);Ne.length=0}}}var xs={li:{direct:["li"]},dt:{descendant:["dt","dd"]},dd:{descendant:["dt","dd"]},p:{descendant:["address","article","aside","blockquote","div","dl","fieldset","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","main","menu","nav","ol","p","pre","section","table","ul"]},rt:{descendant:["rt","rp"]},rp:{descendant:["rt","rp"]},optgroup:{descendant:["optgroup"]},option:{descendant:["option","optgroup"]},thead:{direct:["tbody","tfoot"]},tbody:{direct:["tbody","tfoot"]},tfoot:{direct:["tbody"]},tr:{direct:["tr","tbody"]},td:{direct:["td","th","tr"]},th:{direct:["td","th","tr"]}};function Yr(n,t){let r=xs[n];if(!r)return!1;if(!t)return!0;return(r.direct??r.descendant??[]).includes(t)}function Rn(n){if(n===32||n<=13&&n>=9)return!0;if(n<160)return!1;return n===160||n===5760||n>=8192&&n<=8202||n===8232||n===8233||n===8239||n===8287||n===12288||n===65279}class Ot{source;index=0;constructor(n){this.source=n}match(n){if(n.length===1)return this.source.charCodeAt(this.index)===n.charCodeAt(0);return this.source.startsWith(n,this.index)}matchRegex(n){n.lastIndex=this.index;let t=n.exec(this.source);if(!t||t.index!==this.index)return null;return t[0]}eat(n,t=!1){if(this.match(n))return this.index+=n.length,!0;if(t)throw new An(`Expected token ${JSON.stringify(n)}`,this.index);return!1}read(n){let t=this.matchRegex(n);if(t)this.index+=t.length;return t}readUntil(n){if(this.index>=this.source.length)throw new An("Unexpected end of input",this.source.length);let t=this.index;n.lastIndex=t;let r=n.exec(this.source);if(r)return this.index=r.index,this.source.slice(t,this.index);return this.index=this.source.length,this.source.slice(t)}readUntilString(n){if(this.index>=this.source.length)throw new An("Unexpected end of input",this.source.length);let t=this.source.indexOf(n,this.index),r=t===-1?this.source.length:t,o=this.source.slice(this.index,r);return this.index=r,o}allowWhitespace(){while(this.index<this.source.length&&Rn(this.source.charCodeAt(this.index)))this.index++}requireWhitespace(){if(!Rn(this.source.charCodeAt(this.index)))throw new An("Expected whitespace",this.index);this.allowWhitespace()}readIdentifierName(){let n=this.index,t=n,r="",o=this.source.codePointAt(this.index);if(o!==void 0&&p(o,!0)){t+=o<=65535?1:2;while(t<this.source.length){let a=this.source.codePointAt(t);if(a===void 0||!u(a,!0))break;t+=a<=65535?1:2}r=this.source.slice(n,t),this.index=t}return{type:"Identifier",name:r,start:n,end:t}}}class An extends Error{position;constructor(n,t){super(`${n} (at index ${t})`);this.name="TemplateSyntaxError",this.position=t}}function rn(){return{type:"Fragment",nodes:[]}}var Es=new Set(["await","break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","finally","for","function","if","implements","import","in","instanceof","interface","let","new","package","private","protected","public","return","static","super","switch","this","throw","try","typeof","var","void","while","with","yield"]),Ss=["&&","||","??"],vs=["===","!==","==","!="];function Zr(n,t){let r=n.codePointAt(t);if(r===void 0||!p(r,!0))return t;let o=t+(r<=65535?1:2);while(o<n.length){let a=n.codePointAt(o);if(!u(a,!0))break;o+=a<=65535?1:2}return o}function Cs(n,t){let r=t;while(r<n.length){let o=n.charCodeAt(r);if(o<48||o>57)break;r++}return r}function ut(n,t){let r=t;while(r<n.length&&Rn(n.charCodeAt(r)))r++;return r}function Qr(n,t){let r=Cs(n,t);if(r===t)return null;if(n.charCodeAt(t)===48&&r-t>1)return null;if(r<n.length){let a=n.codePointAt(r);if(a===46||u(a,!0))return null}let o=n.slice(t,r);return{type:"Literal",start:t,end:r,value:Number(o),raw:o}}function eo(n,t){let r=n.charCodeAt(t),o=t+1;while(o<n.length){let a=n.charCodeAt(o);if(a===r){let h=n.slice(t,o+1);return{type:"Literal",start:t,end:o+1,value:n.slice(t+1,o),raw:h}}if(a===92||a===10||a===13)return null;o++}return null}function Ps(n,t){let r=n.charCodeAt(t);if(r===34||r===39)return eo(n,t);let o=Zr(n,t);if(o===t)return Qr(n,t);let a=n.slice(t,o);if(a==="true"||a==="false")return{type:"Literal",start:t,end:o,value:a==="true",raw:a};if(a==="null")return{type:"Literal",start:t,end:o,value:null,raw:a};if(Es.has(a))return null;let h={type:"Identifier",start:t,end:o,name:a},T=o;while(T<n.length){let D=n.charCodeAt(T);if(D===46){let S=T+1,N=Zr(n,S);if(N===S)return null;let L={type:"Identifier",start:S,end:N,name:n.slice(S,N)};h={type:"MemberExpression",start:t,end:N,object:h,property:L,computed:!1,optional:!1},T=N}else if(D===91){let S=T+1,N=n.charCodeAt(S),L=N===34||N===39?eo(n,S):Qr(n,S);if(!L||n.charCodeAt(L.end)!==93)return null;h={type:"MemberExpression",start:t,end:L.end+1,object:h,property:L,computed:!0,optional:!1},T=L.end+1}else break}return h}function qt(n,t){if(n.charCodeAt(t)!==33||n.charCodeAt(t+1)===61)return Ps(n,t);let r=qt(n,ut(n,t+1));if(!r)return null;return{type:"UnaryExpression",start:t,end:r.end,operator:"!",prefix:!0,argument:r}}function ws(n,t){for(let r of vs)if(n.startsWith(r,t))return{operator:r,logical:!1};for(let r of Ss)if(n.startsWith(r,t))return{operator:r,logical:!0};return null}function no(n,t){let r=ut(n,t);if(r>=n.length)return!1;let o=n.charCodeAt(r);return o===125||o===41}function Ds(n){let t=n.source,r=qt(t,n.index);if(!r)return null;if(no(t,r.end))return n.index=r.end,r;let o=ut(t,r.end),a=ws(t,o);if(!a)return null;let h=qt(t,ut(t,o+a.operator.length));if(!h||!no(t,h.end))return null;return n.index=h.end,{type:a.logical?"LogicalExpression":"BinaryExpression",start:r.start,end:h.end,left:r,operator:a.operator,right:h}}function Je(n){let t=Ds(n);if(t)return t;let{node:r,end:o}=H(n.source,n.index,n.isTypeScript,n.root.comments,n.lineTable);return n.index=o,r}var ks={"CounterClockwiseContourIntegral;":8755,"ClockwiseContourIntegral;":8754,"DoubleLongLeftRightArrow;":10234,"NotNestedGreaterGreater;":10914,"DiacriticalDoubleAcute;":733,"NotSquareSupersetEqual;":8931,"CloseCurlyDoubleQuote;":8221,"DoubleContourIntegral;":8751,"FilledVerySmallSquare;":9642,"NegativeVeryThinSpace;":8203,"NotPrecedesSlantEqual;":8928,"NotRightTriangleEqual;":8941,"NotSucceedsSlantEqual;":8929,"CapitalDifferentialD;":8517,"DoubleLeftRightArrow;":8660,"DoubleLongRightArrow;":10233,"EmptyVerySmallSquare;":9643,"NestedGreaterGreater;":8811,"NotDoubleVerticalBar;":8742,"NotGreaterSlantEqual;":10878,"NotLeftTriangleEqual;":8940,"NotSquareSubsetEqual;":8930,"OpenCurlyDoubleQuote;":8220,"ReverseUpEquilibrium;":10607,"DoubleLongLeftArrow;":10232,"DownLeftRightVector;":10576,"LeftArrowRightArrow;":8646,"NegativeMediumSpace;":8203,"NotGreaterFullEqual;":8807,"NotRightTriangleBar;":10704,"RightArrowLeftArrow;":8644,"SquareSupersetEqual;":8850,"leftrightsquigarrow;":8621,"DownRightTeeVector;":10591,"DownRightVectorBar;":10583,"LongLeftRightArrow;":10231,"Longleftrightarrow;":10234,"NegativeThickSpace;":8203,"NotLeftTriangleBar;":10703,"PrecedesSlantEqual;":8828,"ReverseEquilibrium;":8651,"RightDoubleBracket;":10215,"RightDownTeeVector;":10589,"RightDownVectorBar;":10581,"RightTriangleEqual;":8885,"SquareIntersection;":8851,"SucceedsSlantEqual;":8829,"blacktriangleright;":9656,"longleftrightarrow;":10231,"DoubleUpDownArrow;":8661,"DoubleVerticalBar;":8741,"DownLeftTeeVector;":10590,"DownLeftVectorBar;":10582,"FilledSmallSquare;":9724,"GreaterSlantEqual;":10878,"LeftDoubleBracket;":10214,"LeftDownTeeVector;":10593,"LeftDownVectorBar;":10585,"LeftTriangleEqual;":8884,"NegativeThinSpace;":8203,"NotGreaterGreater;":8811,"NotLessSlantEqual;":10877,"NotNestedLessLess;":10913,"NotReverseElement;":8716,"NotSquareSuperset;":8848,"NotTildeFullEqual;":8775,"RightAngleBracket;":10217,"RightUpDownVector;":10575,"SquareSubsetEqual;":8849,"VerticalSeparator;":10072,"blacktriangledown;":9662,"blacktriangleleft;":9666,"leftrightharpoons;":8651,"rightleftharpoons;":8652,"twoheadrightarrow;":8608,"DiacriticalAcute;":180,"DiacriticalGrave;":96,"DiacriticalTilde;":732,"DoubleRightArrow;":8658,"DownArrowUpArrow;":8693,"EmptySmallSquare;":9723,"GreaterEqualLess;":8923,"GreaterFullEqual;":8807,"LeftAngleBracket;":10216,"LeftUpDownVector;":10577,"LessEqualGreater;":8922,"NonBreakingSpace;":160,"NotPrecedesEqual;":10927,"NotRightTriangle;":8939,"NotSucceedsEqual;":10928,"NotSucceedsTilde;":8831,"NotSupersetEqual;":8841,"RightTriangleBar;":10704,"RightUpTeeVector;":10588,"RightUpVectorBar;":10580,"UnderParenthesis;":9181,"UpArrowDownArrow;":8645,"circlearrowright;":8635,"downharpoonright;":8642,"ntrianglerighteq;":8941,"rightharpoondown;":8641,"rightrightarrows;":8649,"twoheadleftarrow;":8606,"vartriangleright;":8883,"CloseCurlyQuote;":8217,"ContourIntegral;":8750,"DoubleDownArrow;":8659,"DoubleLeftArrow;":8656,"DownRightVector;":8641,"LeftRightVector;":10574,"LeftTriangleBar;":10703,"LeftUpTeeVector;":10592,"LeftUpVectorBar;":10584,"LowerRightArrow;":8600,"NotGreaterEqual;":8817,"NotGreaterTilde;":8821,"NotHumpDownHump;":8782,"NotLeftTriangle;":8938,"NotSquareSubset;":8847,"OverParenthesis;":9180,"RightDownVector;":8642,"ShortRightArrow;":8594,"UpperRightArrow;":8599,"bigtriangledown;":9661,"circlearrowleft;":8634,"curvearrowright;":8631,"downharpoonleft;":8643,"leftharpoondown;":8637,"leftrightarrows;":8646,"nLeftrightarrow;":8654,"nleftrightarrow;":8622,"ntrianglelefteq;":8940,"rightleftarrows;":8644,"rightsquigarrow;":8605,"rightthreetimes;":8908,"straightepsilon;":1013,"trianglerighteq;":8885,"vartriangleleft;":8882,"DiacriticalDot;":729,"DoubleRightTee;":8872,"DownLeftVector;":8637,"GreaterGreater;":10914,"HorizontalLine;":9472,"InvisibleComma;":8291,"InvisibleTimes;":8290,"LeftDownVector;":8643,"LeftRightArrow;":8596,"Leftrightarrow;":8660,"LessSlantEqual;":10877,"LongRightArrow;":10230,"Longrightarrow;":10233,"LowerLeftArrow;":8601,"NestedLessLess;":8810,"NotGreaterLess;":8825,"NotLessGreater;":8824,"NotSubsetEqual;":8840,"NotVerticalBar;":8740,"OpenCurlyQuote;":8216,"ReverseElement;":8715,"RightTeeVector;":10587,"RightVectorBar;":10579,"ShortDownArrow;":8595,"ShortLeftArrow;":8592,"SquareSuperset;":8848,"TildeFullEqual;":8773,"UpperLeftArrow;":8598,"ZeroWidthSpace;":8203,"curvearrowleft;":8630,"doublebarwedge;":8966,"downdownarrows;":8650,"hookrightarrow;":8618,"leftleftarrows;":8647,"leftrightarrow;":8596,"leftthreetimes;":8907,"longrightarrow;":10230,"looparrowright;":8620,"nshortparallel;":8742,"ntriangleright;":8939,"rightarrowtail;":8611,"rightharpoonup;":8640,"trianglelefteq;":8884,"upharpoonright;":8638,"ApplyFunction;":8289,"DifferentialD;":8518,"DoubleLeftTee;":10980,"DoubleUpArrow;":8657,"LeftTeeVector;":10586,"LeftVectorBar;":10578,"LessFullEqual;":8806,"LongLeftArrow;":10229,"Longleftarrow;":10232,"NotEqualTilde;":8770,"NotTildeEqual;":8772,"NotTildeTilde;":8777,"Poincareplane;":8460,"PrecedesEqual;":10927,"PrecedesTilde;":8830,"RightArrowBar;":8677,"RightTeeArrow;":8614,"RightTriangle;":8883,"RightUpVector;":8638,"SucceedsEqual;":10928,"SucceedsTilde;":8831,"SupersetEqual;":8839,"UpEquilibrium;":10606,"VerticalTilde;":8768,"VeryThinSpace;":8202,"bigtriangleup;":9651,"blacktriangle;":9652,"divideontimes;":8903,"fallingdotseq;":8786,"hookleftarrow;":8617,"leftarrowtail;":8610,"leftharpoonup;":8636,"longleftarrow;":10229,"looparrowleft;":8619,"measuredangle;":8737,"ntriangleleft;":8938,"shortparallel;":8741,"smallsetminus;":8726,"triangleright;":9657,"upharpoonleft;":8639,"varsubsetneqq;":10955,"varsupsetneqq;":10956,"DownArrowBar;":10515,"DownTeeArrow;":8615,"ExponentialE;":8519,"GreaterEqual;":8805,"GreaterTilde;":8819,"HilbertSpace;":8459,"HumpDownHump;":8782,"Intersection;":8898,"LeftArrowBar;":8676,"LeftTeeArrow;":8612,"LeftTriangle;":8882,"LeftUpVector;":8639,"NotCongruent;":8802,"NotHumpEqual;":8783,"NotLessEqual;":8816,"NotLessTilde;":8820,"Proportional;":8733,"RightCeiling;":8969,"RoundImplies;":10608,"ShortUpArrow;":8593,"SquareSubset;":8847,"UnderBracket;":9141,"VerticalLine;":124,"blacklozenge;":10731,"exponentiale;":8519,"risingdotseq;":8787,"triangledown;":9663,"triangleleft;":9667,"varsubsetneq;":8842,"varsupsetneq;":8843,"CircleMinus;":8854,"CircleTimes;":8855,"Equilibrium;":8652,"GreaterLess;":8823,"LeftCeiling;":8968,"LessGreater;":8822,"MediumSpace;":8287,"NotLessLess;":8810,"NotPrecedes;":8832,"NotSucceeds;":8833,"NotSuperset;":8835,"OverBracket;":9140,"RightVector;":8640,"Rrightarrow;":8667,"RuleDelayed;":10740,"SmallCircle;":8728,"SquareUnion;":8852,"SubsetEqual;":8838,"UpDownArrow;":8597,"Updownarrow;":8661,"VerticalBar;":8739,"backepsilon;":1014,"blacksquare;":9642,"circledcirc;":8858,"circleddash;":8861,"curlyeqprec;":8926,"curlyeqsucc;":8927,"diamondsuit;":9830,"eqslantless;":10901,"expectation;":8496,"nRightarrow;":8655,"nrightarrow;":8603,"preccurlyeq;":8828,"precnapprox;":10937,"quaternions;":8461,"straightphi;":981,"succcurlyeq;":8829,"succnapprox;":10938,"thickapprox;":8776,"updownarrow;":8597,"Bernoullis;":8492,"CirclePlus;":8853,"EqualTilde;":8770,"Fouriertrf;":8497,"ImaginaryI;":8520,"Laplacetrf;":8466,"LeftVector;":8636,"Lleftarrow;":8666,"NotElement;":8713,"NotGreater;":8815,"Proportion;":8759,"RightArrow;":8594,"RightFloor;":8971,"Rightarrow;":8658,"ThickSpace;":8287,"TildeEqual;":8771,"TildeTilde;":8776,"UnderBrace;":9183,"UpArrowBar;":10514,"UpTeeArrow;":8613,"circledast;":8859,"complement;":8705,"curlywedge;":8911,"eqslantgtr;":10902,"gtreqqless;":10892,"lessapprox;":10885,"lesseqqgtr;":10891,"lmoustache;":9136,"longmapsto;":10236,"mapstodown;":8615,"mapstoleft;":8612,"nLeftarrow;":8653,"nleftarrow;":8602,"nsubseteqq;":10949,"nsupseteqq;":10950,"precapprox;":10935,"rightarrow;":8594,"rmoustache;":9137,"sqsubseteq;":8849,"sqsupseteq;":8850,"subsetneqq;":10955,"succapprox;":10936,"supsetneqq;":10956,"upuparrows;":8648,"varepsilon;":1013,"varnothing;":8709,"Backslash;":8726,"CenterDot;":183,"CircleDot;":8857,"Congruent;":8801,"Coproduct;":8720,"DoubleDot;":168,"DownArrow;":8595,"DownBreve;":785,"Downarrow;":8659,"HumpEqual;":8783,"LeftArrow;":8592,"LeftFloor;":8970,"Leftarrow;":8656,"LessTilde;":8818,"Mellintrf;":8499,"MinusPlus;":8723,"NotCupCap;":8813,"NotExists;":8708,"NotSubset;":8834,"OverBrace;":9182,"PlusMinus;":177,"Therefore;":8756,"ThinSpace;":8201,"TripleDot;":8411,"UnionPlus;":8846,"backprime;":8245,"backsimeq;":8909,"bigotimes;":10754,"centerdot;":183,"checkmark;":10003,"complexes;":8450,"dotsquare;":8865,"downarrow;":8595,"gtrapprox;":10886,"gtreqless;":8923,"gvertneqq;":8809,"heartsuit;":9829,"leftarrow;":8592,"lesseqgtr;":8922,"lvertneqq;":8808,"ngeqslant;":10878,"nleqslant;":10877,"nparallel;":8742,"nshortmid;":8740,"nsubseteq;":8840,"nsupseteq;":8841,"pitchfork;":8916,"rationals;":8474,"spadesuit;":9824,"subseteqq;":10949,"subsetneq;":8842,"supseteqq;":10950,"supsetneq;":8843,"therefore;":8756,"triangleq;":8796,"varpropto;":8733,"DDotrahd;":10513,"DotEqual;":8784,"Integral;":8747,"LessLess;":10913,"NotEqual;":8800,"NotTilde;":8769,"PartialD;":8706,"Precedes;":8826,"RightTee;":8866,"Succeeds;":8827,"SuchThat;":8715,"Superset;":8835,"Uarrocir;":10569,"UnderBar;":95,"andslope;":10840,"angmsdaa;":10664,"angmsdab;":10665,"angmsdac;":10666,"angmsdad;":10667,"angmsdae;":10668,"angmsdaf;":10669,"angmsdag;":10670,"angmsdah;":10671,"angrtvbd;":10653,"approxeq;":8778,"awconint;":8755,"backcong;":8780,"barwedge;":8965,"bbrktbrk;":9142,"bigoplus;":10753,"bigsqcup;":10758,"biguplus;":10756,"bigwedge;":8896,"boxminus;":8863,"boxtimes;":8864,"bsolhsub;":10184,"capbrcup;":10825,"circledR;":174,"circledS;":9416,"cirfnint;":10768,"clubsuit;":9827,"cupbrcap;":10824,"curlyvee;":8910,"cwconint;":8754,"doteqdot;":8785,"dotminus;":8760,"drbkarow;":10512,"dzigrarr;":10239,"elinters;":9191,"emptyset;":8709,"eqvparsl;":10725,"fpartint;":10765,"geqslant;":10878,"gesdotol;":10884,"gnapprox;":10890,"hksearow;":10533,"hkswarow;":10534,"imagline;":8464,"imagpart;":8465,"infintie;":10717,"integers;":8484,"intercal;":8890,"intlarhk;":10775,"laemptyv;":10676,"ldrushar;":10571,"leqslant;":10877,"lesdotor;":10883,"llcorner;":8990,"lnapprox;":10889,"lrcorner;":8991,"lurdshar;":10570,"mapstoup;":8613,"multimap;":8888,"naturals;":8469,"ncongdot;":10861,"notindot;":8949,"otimesas;":10806,"parallel;":8741,"plusacir;":10787,"pointint;":10773,"precneqq;":10933,"precnsim;":8936,"profalar;":9006,"profline;":8978,"profsurf;":8979,"raemptyv;":10675,"realpart;":8476,"rppolint;":10770,"rtriltri;":10702,"scpolint;":10771,"setminus;":8726,"shortmid;":8739,"smeparsl;":10724,"sqsubset;":8847,"sqsupset;":8848,"subseteq;":8838,"succneqq;":10934,"succnsim;":8937,"supseteq;":8839,"thetasym;":977,"thicksim;":8764,"timesbar;":10801,"triangle;":9653,"triminus;":10810,"trpezium;":9186,"ulcorner;":8988,"urcorner;":8989,"varkappa;":1008,"varsigma;":962,"vartheta;":977,"Because;":8757,"Cayleys;":8493,"Cconint;":8752,"Cedilla;":184,"Diamond;":8900,"DownTee;":8868,"Element;":8712,"Epsilon;":917,"Implies;":8658,"LeftTee;":8867,"NewLine;":10,"NoBreak;":8288,"NotLess;":8814,"Omicron;":927,"OverBar;":8254,"Product;":8719,"UpArrow;":8593,"Uparrow;":8657,"Upsilon;":933,"alefsym;":8501,"angrtvb;":8894,"angzarr;":9084,"asympeq;":8781,"backsim;":8765,"because;":8757,"bemptyv;":10672,"between;":8812,"bigcirc;":9711,"bigodot;":10752,"bigstar;":9733,"bnequiv;":8801,"boxplus;":8862,"ccupssm;":10832,"cemptyv;":10674,"cirscir;":10690,"coloneq;":8788,"congdot;":10861,"cudarrl;":10552,"cudarrr;":10549,"cularrp;":10557,"curarrm;":10556,"dbkarow;":10511,"ddagger;":8225,"ddotseq;":10871,"demptyv;":10673,"diamond;":8900,"digamma;":989,"dotplus;":8724,"dwangle;":10662,"epsilon;":949,"eqcolon;":8789,"equivDD;":10872,"gesdoto;":10882,"gtquest;":10876,"gtrless;":8823,"harrcir;":10568,"intprod;":10812,"isindot;":8949,"larrbfs;":10527,"larrsim;":10611,"lbrksld;":10639,"lbrkslu;":10637,"ldrdhar;":10599,"lesdoto;":10881,"lessdot;":8918,"lessgtr;":8822,"lesssim;":8818,"lotimes;":10804,"lozenge;":9674,"ltquest;":10875,"luruhar;":10598,"maltese;":10016,"minusdu;":10794,"napprox;":8777,"natural;":9838,"nearrow;":8599,"nexists;":8708,"notinva;":8713,"notinvb;":8951,"notinvc;":8950,"notniva;":8716,"notnivb;":8958,"notnivc;":8957,"npolint;":10772,"npreceq;":10927,"nsqsube;":8930,"nsqsupe;":8931,"nsubset;":8834,"nsucceq;":10928,"nsupset;":8835,"nvinfin;":10718,"nvltrie;":8884,"nvrtrie;":8885,"nwarrow;":8598,"olcross;":10683,"omicron;":959,"orderof;":8500,"orslope;":10839,"pertenk;":8241,"planckh;":8462,"pluscir;":10786,"plussim;":10790,"plustwo;":10791,"precsim;":8830,"quatint;":10774,"questeq;":8799,"rarrbfs;":10528,"rarrsim;":10612,"rbrksld;":10638,"rbrkslu;":10640,"rdldhar;":10601,"realine;":8475,"rotimes;":10805,"ruluhar;":10600,"searrow;":8600,"simplus;":10788,"simrarr;":10610,"subedot;":10947,"submult;":10945,"subplus;":10943,"subrarr;":10617,"succsim;":8831,"supdsub;":10968,"supedot;":10948,"suphsol;":10185,"suphsub;":10967,"suplarr;":10619,"supmult;":10946,"supplus;":10944,"swarrow;":8601,"topfork;":10970,"triplus;":10809,"tritime;":10811,"uparrow;":8593,"upsilon;":965,"uwangle;":10663,"vzigzag;":10650,"zigrarr;":8669,"Aacute;":193,"Abreve;":258,"Agrave;":192,"Assign;":8788,"Atilde;":195,"Barwed;":8966,"Bumpeq;":8782,"Cacute;":262,"Ccaron;":268,"Ccedil;":199,"Colone;":10868,"Conint;":8751,"CupCap;":8781,"Dagger;":8225,"Dcaron;":270,"DotDot;":8412,"Dstrok;":272,"Eacute;":201,"Ecaron;":282,"Egrave;":200,"Exists;":8707,"ForAll;":8704,"Gammad;":988,"Gbreve;":286,"Gcedil;":290,"HARDcy;":1066,"Hstrok;":294,"Iacute;":205,"Igrave;":204,"Itilde;":296,"Jsercy;":1032,"Kcedil;":310,"Lacute;":313,"Lambda;":923,"Lcaron;":317,"Lcedil;":315,"Lmidot;":319,"Lstrok;":321,"Nacute;":323,"Ncaron;":327,"Ncedil;":325,"Ntilde;":209,"Oacute;":211,"Odblac;":336,"Ograve;":210,"Oslash;":216,"Otilde;":213,"Otimes;":10807,"Racute;":340,"Rarrtl;":10518,"Rcaron;":344,"Rcedil;":342,"SHCHcy;":1065,"SOFTcy;":1068,"Sacute;":346,"Scaron;":352,"Scedil;":350,"Square;":9633,"Subset;":8912,"Supset;":8913,"Tcaron;":356,"Tcedil;":354,"Tstrok;":358,"Uacute;":218,"Ubreve;":364,"Udblac;":368,"Ugrave;":217,"Utilde;":360,"Vdashl;":10982,"Verbar;":8214,"Vvdash;":8874,"Yacute;":221,"Zacute;":377,"Zcaron;":381,"aacute;":225,"abreve;":259,"agrave;":224,"andand;":10837,"angmsd;":8737,"angsph;":8738,"apacir;":10863,"approx;":8776,"atilde;":227,"barvee;":8893,"barwed;":8965,"becaus;":8757,"bernou;":8492,"bigcap;":8898,"bigcup;":8899,"bigvee;":8897,"bkarow;":10509,"bottom;":8869,"bowtie;":8904,"boxbox;":10697,"bprime;":8245,"brvbar;":166,"bullet;":8226,"bumpeq;":8783,"cacute;":263,"capand;":10820,"capcap;":10827,"capcup;":10823,"capdot;":10816,"ccaron;":269,"ccedil;":231,"circeq;":8791,"cirmid;":10991,"colone;":8788,"commat;":64,"compfn;":8728,"conint;":8750,"coprod;":8720,"copysr;":8471,"cularr;":8630,"cupcap;":10822,"cupcup;":10826,"cupdot;":8845,"curarr;":8631,"curren;":164,"cylcty;":9005,"dagger;":8224,"daleth;":8504,"dcaron;":271,"dfisht;":10623,"divide;":247,"divonx;":8903,"dlcorn;":8990,"dlcrop;":8973,"dollar;":36,"drcorn;":8991,"drcrop;":8972,"dstrok;":273,"eacute;":233,"easter;":10862,"ecaron;":283,"ecolon;":8789,"egrave;":232,"egsdot;":10904,"elsdot;":10903,"emptyv;":8709,"emsp13;":8196,"emsp14;":8197,"eparsl;":10723,"eqcirc;":8790,"equals;":61,"equest;":8799,"female;":9792,"ffilig;":64259,"ffllig;":64260,"forall;":8704,"frac12;":189,"frac13;":8531,"frac14;":188,"frac15;":8533,"frac16;":8537,"frac18;":8539,"frac23;":8532,"frac25;":8534,"frac34;":190,"frac35;":8535,"frac38;":8540,"frac45;":8536,"frac56;":8538,"frac58;":8541,"frac78;":8542,"gacute;":501,"gammad;":989,"gbreve;":287,"gesdot;":10880,"gesles;":10900,"gtlPar;":10645,"gtrarr;":10616,"gtrdot;":8919,"gtrsim;":8819,"hairsp;":8202,"hamilt;":8459,"hardcy;":1098,"hearts;":9829,"hellip;":8230,"hercon;":8889,"homtht;":8763,"horbar;":8213,"hslash;":8463,"hstrok;":295,"hybull;":8259,"hyphen;":8208,"iacute;":237,"igrave;":236,"iiiint;":10764,"iinfin;":10716,"incare;":8453,"inodot;":305,"intcal;":8890,"iquest;":191,"isinsv;":8947,"itilde;":297,"jsercy;":1112,"kappav;":1008,"kcedil;":311,"kgreen;":312,"lAtail;":10523,"lacute;":314,"lagran;":8466,"lambda;":955,"langle;":10216,"larrfs;":10525,"larrhk;":8617,"larrlp;":8619,"larrpl;":10553,"larrtl;":8610,"latail;":10521,"lbrace;":123,"lbrack;":91,"lcaron;":318,"lcedil;":316,"ldquor;":8222,"lesdot;":10879,"lesges;":10899,"lfisht;":10620,"lfloor;":8970,"lharul;":10602,"llhard;":10603,"lmidot;":320,"lmoust;":9136,"loplus;":10797,"lowast;":8727,"lowbar;":95,"lparlt;":10643,"lrhard;":10605,"lsaquo;":8249,"lsquor;":8218,"lstrok;":322,"lthree;":8907,"ltimes;":8905,"ltlarr;":10614,"ltrPar;":10646,"mapsto;":8614,"marker;":9646,"mcomma;":10793,"midast;":42,"midcir;":10992,"middot;":183,"minusb;":8863,"minusd;":8760,"mnplus;":8723,"models;":8871,"mstpos;":8766,"nVDash;":8879,"nVdash;":8878,"nacute;":324,"nbumpe;":8783,"ncaron;":328,"ncedil;":326,"nearhk;":10532,"nequiv;":8802,"nesear;":10536,"nexist;":8708,"nltrie;":8940,"notinE;":8953,"nparsl;":11005,"nprcue;":8928,"nrarrc;":10547,"nrarrw;":8605,"nrtrie;":8941,"nsccue;":8929,"nsimeq;":8772,"ntilde;":241,"numero;":8470,"nvDash;":8877,"nvHarr;":10500,"nvdash;":8876,"nvlArr;":10498,"nvrArr;":10499,"nwarhk;":10531,"nwnear;":10535,"oacute;":243,"odblac;":337,"odsold;":10684,"ograve;":242,"ominus;":8854,"origof;":8886,"oslash;":248,"otilde;":245,"otimes;":8855,"parsim;":10995,"percnt;":37,"period;":46,"permil;":8240,"phmmat;":8499,"planck;":8463,"plankv;":8463,"plusdo;":8724,"plusdu;":10789,"plusmn;":177,"preceq;":10927,"primes;":8473,"prnsim;":8936,"propto;":8733,"prurel;":8880,"puncsp;":8200,"qprime;":8279,"rAtail;":10524,"racute;":341,"rangle;":10217,"rarrap;":10613,"rarrfs;":10526,"rarrhk;":8618,"rarrlp;":8620,"rarrpl;":10565,"rarrtl;":8611,"ratail;":10522,"rbrace;":125,"rbrack;":93,"rcaron;":345,"rcedil;":343,"rdquor;":8221,"rfisht;":10621,"rfloor;":8971,"rharul;":10604,"rmoust;":9137,"roplus;":10798,"rpargt;":10644,"rsaquo;":8250,"rsquor;":8217,"rthree;":8908,"rtimes;":8906,"sacute;":347,"scaron;":353,"scedil;":351,"scnsim;":8937,"searhk;":10533,"seswar;":10537,"sfrown;":8994,"shchcy;":1097,"sigmaf;":962,"sigmav;":962,"simdot;":10858,"smashp;":10803,"softcy;":1100,"solbar;":9023,"spades;":9824,"sqcaps;":8851,"sqcups;":8852,"sqsube;":8849,"sqsupe;":8850,"square;":9633,"squarf;":9642,"ssetmn;":8726,"ssmile;":8995,"sstarf;":8902,"subdot;":10941,"subset;":8834,"subsim;":10951,"subsub;":10965,"subsup;":10963,"succeq;":10928,"supdot;":10942,"supset;":8835,"supsim;":10952,"supsub;":10964,"supsup;":10966,"swarhk;":10534,"swnwar;":10538,"target;":8982,"tcaron;":357,"tcedil;":355,"telrec;":8981,"there4;":8756,"thetav;":977,"thinsp;":8201,"thksim;":8764,"timesb;":8864,"timesd;":10800,"topbot;":9014,"topcir;":10993,"tprime;":8244,"tridot;":9708,"tstrok;":359,"uacute;":250,"ubreve;":365,"udblac;":369,"ufisht;":10622,"ugrave;":249,"ulcorn;":8988,"ulcrop;":8975,"urcorn;":8989,"urcrop;":8974,"utilde;":361,"vangrt;":10652,"varphi;":981,"varrho;":1009,"veebar;":8891,"vellip;":8942,"verbar;":124,"vsubnE;":10955,"vsubne;":8842,"vsupnE;":10956,"vsupne;":8843,"wedbar;":10847,"wedgeq;":8793,"weierp;":8472,"wreath;":8768,"xoplus;":10753,"xotime;":10754,"xsqcup;":10758,"xuplus;":10756,"xwedge;":8896,"yacute;":253,"zacute;":378,"zcaron;":382,"zeetrf;":8488,"AElig;":198,Aacute:193,"Acirc;":194,Agrave:192,"Alpha;":913,"Amacr;":256,"Aogon;":260,"Aring;":197,Atilde:195,"Breve;":728,Ccedil:199,"Ccirc;":264,"Colon;":8759,"Cross;":10799,"Dashv;":10980,"Delta;":916,Eacute:201,"Ecirc;":202,Egrave:200,"Emacr;":274,"Eogon;":280,"Equal;":10869,"Gamma;":915,"Gcirc;":284,"Hacek;":711,"Hcirc;":292,"IJlig;":306,Iacute:205,"Icirc;":206,Igrave:204,"Imacr;":298,"Iogon;":302,"Iukcy;":1030,"Jcirc;":308,"Jukcy;":1028,"Kappa;":922,Ntilde:209,"OElig;":338,Oacute:211,"Ocirc;":212,Ograve:210,"Omacr;":332,"Omega;":937,Oslash:216,Otilde:213,"Prime;":8243,"RBarr;":10512,"Scirc;":348,"Sigma;":931,"THORN;":222,"TRADE;":8482,"TSHcy;":1035,"Theta;":920,"Tilde;":8764,Uacute:218,"Ubrcy;":1038,"Ucirc;":219,Ugrave:217,"Umacr;":362,"Union;":8899,"Uogon;":370,"UpTee;":8869,"Uring;":366,"VDash;":8875,"Vdash;":8873,"Wcirc;":372,"Wedge;":8896,Yacute:221,"Ycirc;":374,aacute:225,"acirc;":226,"acute;":180,"aelig;":230,agrave:224,"aleph;":8501,"alpha;":945,"amacr;":257,"amalg;":10815,"angle;":8736,"angrt;":8735,"angst;":197,"aogon;":261,"aring;":229,"asymp;":8776,atilde:227,"awint;":10769,"bcong;":8780,"bdquo;":8222,"bepsi;":1014,"blank;":9251,"blk12;":9618,"blk14;":9617,"blk34;":9619,"block;":9608,"boxDL;":9559,"boxDR;":9556,"boxDl;":9558,"boxDr;":9555,"boxHD;":9574,"boxHU;":9577,"boxHd;":9572,"boxHu;":9575,"boxUL;":9565,"boxUR;":9562,"boxUl;":9564,"boxUr;":9561,"boxVH;":9580,"boxVL;":9571,"boxVR;":9568,"boxVh;":9579,"boxVl;":9570,"boxVr;":9567,"boxdL;":9557,"boxdR;":9554,"boxdl;":9488,"boxdr;":9484,"boxhD;":9573,"boxhU;":9576,"boxhd;":9516,"boxhu;":9524,"boxuL;":9563,"boxuR;":9560,"boxul;":9496,"boxur;":9492,"boxvH;":9578,"boxvL;":9569,"boxvR;":9566,"boxvh;":9532,"boxvl;":9508,"boxvr;":9500,"breve;":728,brvbar:166,"bsemi;":8271,"bsime;":8909,"bsolb;":10693,"bumpE;":10926,"bumpe;":8783,"caret;":8257,"caron;":711,"ccaps;":10829,ccedil:231,"ccirc;":265,"ccups;":10828,"cedil;":184,"check;":10003,"clubs;":9827,"colon;":58,"comma;":44,"crarr;":8629,"cross;":10007,"csube;":10961,"csupe;":10962,"ctdot;":8943,"cuepr;":8926,"cuesc;":8927,"cupor;":10821,curren:164,"cuvee;":8910,"cuwed;":8911,"cwint;":8753,"dashv;":8867,"dblac;":733,"ddarr;":8650,"delta;":948,"dharl;":8643,"dharr;":8642,"diams;":9830,"disin;":8946,divide:247,"doteq;":8784,"dtdot;":8945,"dtrif;":9662,"duarr;":8693,"duhar;":10607,"eDDot;":10871,eacute:233,"ecirc;":234,"efDot;":8786,egrave:232,"emacr;":275,"empty;":8709,"eogon;":281,"eplus;":10865,"epsiv;":1013,"eqsim;":8770,"equiv;":8801,"erDot;":8787,"erarr;":10609,"esdot;":8784,"exist;":8707,"fflig;":64256,"filig;":64257,"fjlig;":102,"fllig;":64258,"fltns;":9649,"forkv;":10969,frac12:189,frac14:188,frac34:190,"frasl;":8260,"frown;":8994,"gamma;":947,"gcirc;":285,"gescc;":10921,"gimel;":8503,"gneqq;":8809,"gnsim;":8935,"grave;":96,"gsime;":10894,"gsiml;":10896,"gtcir;":10874,"gtdot;":8919,"harrw;":8621,"hcirc;":293,"hoarr;":8703,iacute:237,"icirc;":238,"iexcl;":161,igrave:236,"iiint;":8749,"iiota;":8489,"ijlig;":307,"imacr;":299,"image;":8465,"imath;":305,"imped;":437,"infin;":8734,"iogon;":303,"iprod;":10812,iquest:191,"isinE;":8953,"isins;":8948,"isinv;":8712,"iukcy;":1110,"jcirc;":309,"jmath;":567,"jukcy;":1108,"kappa;":954,"lAarr;":8666,"lBarr;":10510,"langd;":10641,"laquo;":171,"larrb;":8676,"lates;":10925,"lbarr;":10508,"lbbrk;":10098,"lbrke;":10635,"lceil;":8968,"ldquo;":8220,"lescc;":10920,"lhard;":8637,"lharu;":8636,"lhblk;":9604,"llarr;":8647,"lltri;":9722,"lneqq;":8808,"lnsim;":8934,"loang;":10220,"loarr;":8701,"lobrk;":10214,"lopar;":10629,"lrarr;":8646,"lrhar;":8651,"lrtri;":8895,"lsime;":10893,"lsimg;":10895,"lsquo;":8216,"ltcir;":10873,"ltdot;":8918,"ltrie;":8884,"ltrif;":9666,"mDDot;":8762,"mdash;":8212,"micro;":181,middot:183,"minus;":8722,"mumap;":8888,"nabla;":8711,"napid;":8779,"napos;":329,"natur;":9838,"nbump;":8782,"ncong;":8775,"ndash;":8211,"neArr;":8663,"nearr;":8599,"nedot;":8784,"nesim;":8770,"ngeqq;":8807,"ngsim;":8821,"nhArr;":8654,"nharr;":8622,"nhpar;":10994,"nlArr;":8653,"nlarr;":8602,"nleqq;":8806,"nless;":8814,"nlsim;":8820,"nltri;":8938,"notin;":8713,"notni;":8716,"npart;":8706,"nprec;":8832,"nrArr;":8655,"nrarr;":8603,"nrtri;":8939,"nsime;":8772,"nsmid;":8740,"nspar;":8742,"nsubE;":10949,"nsube;":8840,"nsucc;":8833,"nsupE;":10950,"nsupe;":8841,ntilde:241,"numsp;":8199,"nvsim;":8764,"nwArr;":8662,"nwarr;":8598,oacute:243,"ocirc;":244,"odash;":8861,"oelig;":339,"ofcir;":10687,ograve:242,"ohbar;":10677,"olarr;":8634,"olcir;":10686,"oline;":8254,"omacr;":333,"omega;":969,"operp;":10681,"oplus;":8853,"orarr;":8635,"order;":8500,oslash:248,otilde:245,"ovbar;":9021,"parsl;":11005,"phone;":9742,"plusb;":8862,"pluse;":10866,plusmn:177,"pound;":163,"prcue;":8828,"prime;":8242,"prnap;":10937,"prsim;":8830,"quest;":63,"rAarr;":8667,"rBarr;":10511,"radic;":8730,"rangd;":10642,"range;":10661,"raquo;":187,"rarrb;":8677,"rarrc;":10547,"rarrw;":8605,"ratio;":8758,"rbarr;":10509,"rbbrk;":10099,"rbrke;":10636,"rceil;":8969,"rdquo;":8221,"reals;":8477,"rhard;":8641,"rharu;":8640,"rlarr;":8644,"rlhar;":8652,"rnmid;":10990,"roang;":10221,"roarr;":8702,"robrk;":10215,"ropar;":10630,"rrarr;":8649,"rsquo;":8217,"rtrie;":8885,"rtrif;":9656,"sbquo;":8218,"sccue;":8829,"scirc;":349,"scnap;":10938,"scsim;":8831,"sdotb;":8865,"sdote;":10854,"seArr;":8664,"searr;":8600,"setmn;":8726,"sharp;":9839,"sigma;":963,"simeq;":8771,"simgE;":10912,"simlE;":10911,"simne;":8774,"slarr;":8592,"smile;":8995,"smtes;":10924,"sqcap;":8851,"sqcup;":8852,"sqsub;":8847,"sqsup;":8848,"srarr;":8594,"starf;":9733,"strns;":175,"subnE;":10955,"subne;":8842,"supnE;":10956,"supne;":8843,"swArr;":8665,"swarr;":8601,"szlig;":223,"theta;":952,"thkap;":8776,"thorn;":254,"tilde;":732,"times;":215,"trade;":8482,"trisb;":10701,"tshcy;":1115,"twixt;":8812,uacute:250,"ubrcy;":1118,"ucirc;":251,"udarr;":8645,"udhar;":10606,ugrave:249,"uharl;":8639,"uharr;":8638,"uhblk;":9600,"ultri;":9720,"umacr;":363,"uogon;":371,"uplus;":8846,"upsih;":978,"uring;":367,"urtri;":9721,"utdot;":8944,"utrif;":9652,"uuarr;":8648,"vBarv;":10985,"vDash;":8872,"varpi;":982,"vdash;":8866,"veeeq;":8794,"vltri;":8882,"vnsub;":8834,"vnsup;":8835,"vprop;":8733,"vrtri;":8883,"wcirc;":373,"wedge;":8743,"xcirc;":9711,"xdtri;":9661,"xhArr;":10234,"xharr;":10231,"xlArr;":10232,"xlarr;":10229,"xodot;":10752,"xrArr;":10233,"xrarr;":10230,"xutri;":9651,yacute:253,"ycirc;":375,AElig:198,Acirc:194,"Aopf;":120120,Aring:197,"Ascr;":119964,"Auml;":196,"Barv;":10983,"Beta;":914,"Bopf;":120121,"Bscr;":8492,"CHcy;":1063,"COPY;":169,"Cdot;":266,"Copf;":8450,"Cscr;":119966,"DJcy;":1026,"DScy;":1029,"DZcy;":1039,"Darr;":8609,"Dopf;":120123,"Dscr;":119967,Ecirc:202,"Edot;":278,"Eopf;":120124,"Escr;":8496,"Esim;":10867,"Euml;":203,"Fopf;":120125,"Fscr;":8497,"GJcy;":1027,"Gdot;":288,"Gopf;":120126,"Gscr;":119970,"Hopf;":8461,"Hscr;":8459,"IEcy;":1045,"IOcy;":1025,Icirc:206,"Idot;":304,"Iopf;":120128,"Iota;":921,"Iscr;":8464,"Iuml;":207,"Jopf;":120129,"Jscr;":119973,"KHcy;":1061,"KJcy;":1036,"Kopf;":120130,"Kscr;":119974,"LJcy;":1033,"Lang;":10218,"Larr;":8606,"Lopf;":120131,"Lscr;":8466,"Mopf;":120132,"Mscr;":8499,"NJcy;":1034,"Nopf;":8469,"Nscr;":119977,Ocirc:212,"Oopf;":120134,"Oscr;":119978,"Ouml;":214,"Popf;":8473,"Pscr;":119979,"QUOT;":34,"Qopf;":8474,"Qscr;":119980,"Rang;":10219,"Rarr;":8608,"Ropf;":8477,"Rscr;":8475,"SHcy;":1064,"Sopf;":120138,"Sqrt;":8730,"Sscr;":119982,"Star;":8902,THORN:222,"TScy;":1062,"Topf;":120139,"Tscr;":119983,"Uarr;":8607,Ucirc:219,"Uopf;":120140,"Upsi;":978,"Uscr;":119984,"Uuml;":220,"Vbar;":10987,"Vert;":8214,"Vopf;":120141,"Vscr;":119985,"Wopf;":120142,"Wscr;":119986,"Xopf;":120143,"Xscr;":119987,"YAcy;":1071,"YIcy;":1031,"YUcy;":1070,"Yopf;":120144,"Yscr;":119988,"Yuml;":376,"ZHcy;":1046,"Zdot;":379,"Zeta;":918,"Zopf;":8484,"Zscr;":119989,acirc:226,acute:180,aelig:230,"andd;":10844,"andv;":10842,"ange;":10660,"aopf;":120146,"apid;":8779,"apos;":39,aring:229,"ascr;":119990,"auml;":228,"bNot;":10989,"bbrk;":9141,"beta;":946,"beth;":8502,"bnot;":8976,"bopf;":120147,"boxH;":9552,"boxV;":9553,"boxh;":9472,"boxv;":9474,"bscr;":119991,"bsim;":8765,"bsol;":92,"bull;":8226,"bump;":8782,"caps;":8745,"cdot;":267,cedil:184,"cent;":162,"chcy;":1095,"cirE;":10691,"circ;":710,"cire;":8791,"comp;":8705,"cong;":8773,"copf;":120148,"copy;":169,"cscr;":119992,"csub;":10959,"csup;":10960,"cups;":8746,"dArr;":8659,"dHar;":10597,"darr;":8595,"dash;":8208,"diam;":8900,"djcy;":1106,"dopf;":120149,"dscr;":119993,"dscy;":1109,"dsol;":10742,"dtri;":9663,"dzcy;":1119,"eDot;":8785,"ecir;":8790,ecirc:234,"edot;":279,"emsp;":8195,"ensp;":8194,"eopf;":120150,"epar;":8917,"epsi;":949,"escr;":8495,"esim;":8770,"euml;":235,"euro;":8364,"excl;":33,"flat;":9837,"fnof;":402,"fopf;":120151,"fork;":8916,"fscr;":119995,"gdot;":289,"geqq;":8807,"gesl;":8923,"gjcy;":1107,"gnap;":10890,"gneq;":10888,"gopf;":120152,"gscr;":8458,"gsim;":8819,"gtcc;":10919,"gvnE;":8809,"hArr;":8660,"half;":189,"harr;":8596,"hbar;":8463,"hopf;":120153,"hscr;":119997,icirc:238,"iecy;":1077,iexcl:161,"imof;":8887,"iocy;":1105,"iopf;":120154,"iota;":953,"iscr;":119998,"isin;":8712,"iuml;":239,"jopf;":120155,"jscr;":119999,"khcy;":1093,"kjcy;":1116,"kopf;":120156,"kscr;":120000,"lArr;":8656,"lHar;":10594,"lang;":10216,laquo:171,"larr;":8592,"late;":10925,"lcub;":123,"ldca;":10550,"ldsh;":8626,"leqq;":8806,"lesg;":8922,"ljcy;":1113,"lnap;":10889,"lneq;":10887,"lopf;":120157,"lozf;":10731,"lpar;":40,"lscr;":120001,"lsim;":8818,"lsqb;":91,"ltcc;":10918,"ltri;":9667,"lvnE;":8808,"macr;":175,"male;":9794,"malt;":10016,micro:181,"mlcp;":10971,"mldr;":8230,"mopf;":120158,"mscr;":120002,"nGtv;":8811,"nLtv;":8810,"nang;":8736,"napE;":10864,"nbsp;":160,"ncap;":10819,"ncup;":10818,"ngeq;":8817,"nges;":10878,"ngtr;":8815,"nisd;":8954,"njcy;":1114,"nldr;":8229,"nleq;":8816,"nles;":10877,"nmid;":8740,"nopf;":120159,"npar;":8742,"npre;":10927,"nsce;":10928,"nscr;":120003,"nsim;":8769,"nsub;":8836,"nsup;":8837,"ntgl;":8825,"ntlg;":8824,"nvap;":8781,"nvge;":8805,"nvgt;":62,"nvle;":8804,"nvlt;":60,"oast;":8859,"ocir;":8858,ocirc:244,"odiv;":10808,"odot;":8857,"ogon;":731,"oint;":8750,"omid;":10678,"oopf;":120160,"opar;":10679,"ordf;":170,"ordm;":186,"oror;":10838,"oscr;":8500,"osol;":8856,"ouml;":246,"para;":182,"part;":8706,"perp;":8869,"phiv;":981,"plus;":43,"popf;":120161,pound:163,"prap;":10935,"prec;":8826,"prnE;":10933,"prod;":8719,"prop;":8733,"pscr;":120005,"qint;":10764,"qopf;":120162,"qscr;":120006,"quot;":34,"rArr;":8658,"rHar;":10596,"race;":8765,"rang;":10217,raquo:187,"rarr;":8594,"rcub;":125,"rdca;":10551,"rdsh;":8627,"real;":8476,"rect;":9645,"rhov;":1009,"ring;":730,"ropf;":120163,"rpar;":41,"rscr;":120007,"rsqb;":93,"rtri;":9657,"scap;":10936,"scnE;":10934,"sdot;":8901,"sect;":167,"semi;":59,"sext;":10038,"shcy;":1096,"sime;":8771,"simg;":10910,"siml;":10909,"smid;":8739,"smte;":10924,"solb;":10692,"sopf;":120164,"spar;":8741,"squf;":9642,"sscr;":120008,"star;":9734,"subE;":10949,"sube;":8838,"succ;":8827,"sung;":9834,"sup1;":185,"sup2;":178,"sup3;":179,"supE;":10950,"supe;":8839,szlig:223,"tbrk;":9140,"tdot;":8411,thorn:254,times:215,"tint;":8749,"toea;":10536,"topf;":120165,"tosa;":10537,"trie;":8796,"tscr;":120009,"tscy;":1094,"uArr;":8657,"uHar;":10595,"uarr;":8593,ucirc:251,"uopf;":120166,"upsi;":965,"uscr;":120010,"utri;":9653,"uuml;":252,"vArr;":8661,"vBar;":10984,"varr;":8597,"vert;":124,"vopf;":120167,"vscr;":120011,"wopf;":120168,"wscr;":120012,"xcap;":8898,"xcup;":8899,"xmap;":10236,"xnis;":8955,"xopf;":120169,"xscr;":120013,"xvee;":8897,"yacy;":1103,"yicy;":1111,"yopf;":120170,"yscr;":120014,"yucy;":1102,"yuml;":255,"zdot;":380,"zeta;":950,"zhcy;":1078,"zopf;":120171,"zscr;":120015,"zwnj;":8204,"AMP;":38,"Acy;":1040,"Afr;":120068,"And;":10835,Auml:196,"Bcy;":1041,"Bfr;":120069,COPY:169,"Cap;":8914,"Cfr;":8493,"Chi;":935,"Cup;":8915,"Dcy;":1044,"Del;":8711,"Dfr;":120071,"Dot;":168,"ENG;":330,"ETH;":208,"Ecy;":1069,"Efr;":120072,"Eta;":919,Euml:203,"Fcy;":1060,"Ffr;":120073,"Gcy;":1043,"Gfr;":120074,"Hat;":94,"Hfr;":8460,"Icy;":1048,"Ifr;":8465,"Int;":8748,Iuml:207,"Jcy;":1049,"Jfr;":120077,"Kcy;":1050,"Kfr;":120078,"Lcy;":1051,"Lfr;":120079,"Lsh;":8624,"Map;":10501,"Mcy;":1052,"Mfr;":120080,"Ncy;":1053,"Nfr;":120081,"Not;":10988,"Ocy;":1054,"Ofr;":120082,Ouml:214,"Pcy;":1055,"Pfr;":120083,"Phi;":934,"Psi;":936,QUOT:34,"Qfr;":120084,"REG;":174,"Rcy;":1056,"Rfr;":8476,"Rho;":929,"Rsh;":8625,"Scy;":1057,"Sfr;":120086,"Sub;":8912,"Sum;":8721,"Sup;":8913,"Tab;":9,"Tau;":932,"Tcy;":1058,"Tfr;":120087,"Ucy;":1059,"Ufr;":120088,Uuml:220,"Vcy;":1042,"Vee;":8897,"Vfr;":120089,"Wfr;":120090,"Xfr;":120091,"Ycy;":1067,"Yfr;":120092,"Zcy;":1047,"Zfr;":8488,"acE;":8766,"acd;":8767,"acy;":1072,"afr;":120094,"amp;":38,"and;":8743,"ang;":8736,"apE;":10864,"ape;":8778,"ast;":42,auml:228,"bcy;":1073,"bfr;":120095,"bne;":61,"bot;":8869,"cap;":8745,cent:162,"cfr;":120096,"chi;":967,"cir;":9675,copy:169,"cup;":8746,"dcy;":1076,"deg;":176,"dfr;":120097,"die;":168,"div;":247,"dot;":729,"ecy;":1101,"efr;":120098,"egs;":10902,"ell;":8467,"els;":10901,"eng;":331,"eta;":951,"eth;":240,euml:235,"fcy;":1092,"ffr;":120099,"gEl;":10892,"gap;":10886,"gcy;":1075,"gel;":8923,"geq;":8805,"ges;":10878,"gfr;":120100,"ggg;":8921,"glE;":10898,"gla;":10917,"glj;":10916,"gnE;":8809,"gne;":10888,"hfr;":120101,"icy;":1080,"iff;":8660,"ifr;":120102,"int;":8747,iuml:239,"jcy;":1081,"jfr;":120103,"kcy;":1082,"kfr;":120104,"lEg;":10891,"lap;":10885,"lat;":10923,"lcy;":1083,"leg;":8922,"leq;":8804,"les;":10877,"lfr;":120105,"lgE;":10897,"lnE;":8808,"lne;":10887,"loz;":9674,"lrm;":8206,"lsh;":8624,macr:175,"map;":8614,"mcy;":1084,"mfr;":120106,"mho;":8487,"mid;":8739,"nGg;":8921,"nGt;":8811,"nLl;":8920,"nLt;":8810,"nap;":8777,nbsp:160,"ncy;":1085,"nfr;":120107,"ngE;":8807,"nge;":8817,"ngt;":8815,"nis;":8956,"niv;":8715,"nlE;":8806,"nle;":8816,"nlt;":8814,"not;":172,"npr;":8832,"nsc;":8833,"num;":35,"ocy;":1086,"ofr;":120108,"ogt;":10689,"ohm;":937,"olt;":10688,"ord;":10845,ordf:170,ordm:186,"orv;":10843,ouml:246,"par;":8741,para:182,"pcy;":1087,"pfr;":120109,"phi;":966,"piv;":982,"prE;":10931,"pre;":10927,"psi;":968,"qfr;":120110,quot:34,"rcy;":1088,"reg;":174,"rfr;":120111,"rho;":961,"rlm;":8207,"rsh;":8625,"scE;":10932,"sce;":10928,"scy;":1089,sect:167,"sfr;":120112,"shy;":173,"sim;":8764,"smt;":10922,"sol;":47,"squ;":9633,"sub;":8834,"sum;":8721,sup1:185,sup2:178,sup3:179,"sup;":8835,"tau;":964,"tcy;":1090,"tfr;":120113,"top;":8868,"ucy;":1091,"ufr;":120114,"uml;":168,uuml:252,"vcy;":1074,"vee;":8744,"vfr;":120115,"wfr;":120116,"xfr;":120117,"ycy;":1099,"yen;":165,"yfr;":120118,yuml:255,"zcy;":1079,"zfr;":120119,"zwj;":8205,AMP:38,"DD;":8517,ETH:208,"GT;":62,"Gg;":8921,"Gt;":8811,"Im;":8465,"LT;":60,"Ll;":8920,"Lt;":8810,"Mu;":924,"Nu;":925,"Or;":10836,"Pi;":928,"Pr;":10939,REG:174,"Re;":8476,"Sc;":10940,"Xi;":926,"ac;":8766,"af;":8289,amp:38,"ap;":8776,"dd;":8518,deg:176,"ee;":8519,"eg;":10906,"el;":10905,eth:240,"gE;":8807,"ge;":8805,"gg;":8811,"gl;":8823,"gt;":62,"ic;":8291,"ii;":8520,"in;":8712,"it;":8290,"lE;":8806,"le;":8804,"lg;":8822,"ll;":8810,"lt;":60,"mp;":8723,"mu;":956,"ne;":8800,"ni;":8715,not:172,"nu;":957,"oS;":9416,"or;":8744,"pi;":960,"pm;":177,"pr;":8826,reg:174,"rx;":8478,"sc;":8827,shy:173,uml:168,"wp;":8472,"wr;":8768,"xi;":958,yen:165,GT:62,LT:60,gt:62,lt:60},Vt=ks;var As=[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,381,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,382,376];function Ns(n,t){if(t&&!n.endsWith(";"))return`${n}\\b(?!=)`;return n}function to(n){let r=Object.keys(Vt).map((o)=>Ns(o,n));return new RegExp(`&(#(?:x[a-fA-F\\d]+|\\d+)(?:;)?|${r.join("|")})`,"g")}var $t,Ht;function Ls(n){if(n){if(!Ht)Ht=to(!0);return Ht}if(!$t)$t=to(!1);return $t}var ro=0;function Rs(n){if(n===10)return 32;if(n<128)return n;if(n<=159)return As[n-128];if(n<55296)return n;if(n<=57343)return ro;if(n<=65535)return n;if(n>=65536&&n<=131071)return n;if(n>=131072&&n<=196607)return n;if(n>=917504&&n<=917631||n>=917760&&n<=917999)return n;return ro}function Gt(n,t){if(n.indexOf("&")===-1)return n;return n.replace(Ls(t),(r,o)=>{let a;if(o[0]!=="#")a=Vt[o];else if(o[1]==="x")a=Number.parseInt(o.substring(2),16);else a=Number.parseInt(o.substring(1),10);if(!a)return r;return String.fromCodePoint(Rs(a))})}var Ms=/<\/script\s*>/g,Is=/<\/script\s*>/y,_s=/[^\n]/g,Bs=new Set(["server","client","worker","test","default"]);function oo(n,t,r){let o=n.index,a=n.readUntil(Ms);if(n.index>=n.source.length)throw Error("sveld: unclosed <script> tag");let h=n.source.slice(0,o).replace(_s," ")+a;n.read(Is);let T=k(h,n.isTypeScript,n.root.comments);T.start=o;let D="default";for(let S of r){if(Bs.has(S.name))throw Error(`sveld: "${S.name}" is a reserved <script> attribute name.`);if(S.name==="module"){if(S.value!==!0)throw Error("sveld: <script module> does not take a value.");D="module"}if(S.name==="context"){let N=S.value;if(N===!0||!Array.isArray(N)||N.length!==1||N[0].type!=="Text")throw Error("sveld: context attribute must be a plain string.");if(N[0].data!=="module")throw Error('sveld: only context="module" is valid.');D="module"}}return{type:"Script",start:t,end:n.index,context:D,content:T,attributes:r}}function io(n,t,r){let o=n.index,a=n.source.indexOf("</style",n.index),h=a===-1?n.source.length:a;return n.index=h,n.eat("</style",!0),n.read(/\s*>/y),{type:"StyleSheet",start:t,end:n.index,attributes:r,children:[],comments:[],content:{start:o,end:h,styles:n.source.slice(o,h),comment:null}}}var Fs=new Set(["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]);function Ut(n){return Fs.has(n)||n.charCodeAt(0)===33&&n.toLowerCase()==="!doctype"}var js="^[a-zA-Z][a-zA-Z0-9]*(-[a-zA-Z0-9.\\-_\\u00B7\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u203F-\\u2040\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\u{10000}-\\u{EFFFF}]*)?$",Os=new RegExp(js,"u");function so(n){return Os.test(n)}var qs=/(?:"([^"]*)"|'([^'])*'|([^>\s]+))/y,uo=/["']/y,Vs=/(\/>|[\s"'=<>`])/y,Wt=/<\/textarea(\s[^>]*)?>/iy,$s=/^![a-zA-Z]+$/,Hs=/^[a-zA-Z][a-zA-Z0-9]*:[a-zA-Z][a-zA-Z0-9-]*[a-zA-Z0-9]$/,Gs=/^(?:\p{Lu}[$\u200c\u200d\p{ID_Continue}.]*|\p{ID_Start}[$\u200c\u200d\p{ID_Continue}]*(?:\.[$\u200c\u200d\p{ID_Continue}]+)+)$/u,fo={"svelte:head":"SvelteHead","svelte:options":"SvelteOptions","svelte:window":"SvelteWindow","svelte:document":"SvelteDocument","svelte:body":"SvelteBody"},ao={...fo,"svelte:element":"SvelteElement","svelte:component":"SvelteComponent","svelte:self":"SvelteSelf","svelte:fragment":"SvelteFragment","svelte:boundary":"SvelteBoundary"};function Us(n){let t=n.charCodeAt(0);if(t<97||t>122)return!1;for(let r=1;r<n.length;r++){let o=n.charCodeAt(r);if((o<97||o>122)&&(o<48||o>57))return!1}return!0}function Ws(n){if(Us(n))return!0;if($s.test(n))return!0;if(Hs.test(n))return!0;return so(n)}function Js(n){let t=n.charCodeAt(0);if(t>=97&&t<=122&&!n.includes("."))return!1;return!0}function zs(n){return`Svelte${n.slice(7).split("-").map((r)=>r.charAt(0).toUpperCase()+r.slice(1)).join("")}`}function Ks(n){for(let t=n.length-1;t>=0;t--){let r=n[t].type;if(r==="SvelteHead")return!0;if(r==="RegularElement"||r==="Component")return!1}return!1}function Xs(n){for(let t=n.length-1;t>=0;t--){let r=n[t];if(r.type==="RegularElement"&&r.attributes?.some((o)=>o.type==="Attribute"&&o.name==="shadowrootmode"))return!0}return!1}function co(n){let{source:t,index:r}=n;if(r>=t.length)throw new An("Unexpected end of input",t.length);let o=r;while(o<t.length){let a=t.charCodeAt(o);if(a===47||a===62||Rn(a))break;o++}return n.index=o,{name:t.slice(r,o),start:r,end:o}}function mo(n){let{source:t,index:r}=n;if(r>=t.length)throw new An("Unexpected end of input",t.length);let o=r;while(o<t.length){let a=t.charCodeAt(o);if(a===61||a===47||a===62||a===34||a===39||Rn(a))break;o++}return n.index=o,{name:t.slice(r,o),start:r,end:o}}function Ys(n){let t=n.index;if(n.eat("//")){let r=n.readUntilString(`
24
+ `),o=n.index;n.root.comments.push({type:"Line",value:r,start:t,end:o});return}if(n.eat("/*")){let r=n.readUntilString("*/");n.eat("*/");let o=n.index;n.root.comments.push({type:"Block",value:r,start:t,end:o})}}function Zs(n){if(n==="use")return"UseDirective";if(n==="animate")return"AnimateDirective";if(n==="bind")return"BindDirective";if(n==="class")return"ClassDirective";if(n==="style")return"StyleDirective";if(n==="on")return"OnDirective";if(n==="let")return"LetDirective";if(n==="in"||n==="out"||n==="transition")return"TransitionDirective";return!1}function yo(n,t,r){let o={start:n.index,end:-1,type:"Text",raw:"",data:""},a=[],h=(T)=>{if(T>o.start)o.raw=n.source.slice(o.start,T),o.data=Gt(o.raw,!0),o.end=T,a.push(o)};while(n.index<n.source.length){if(t())return h(n.index),a;if(n.eat("{")){if(n.match("#")||n.match("@"))throw new A("blocks/tags inside attribute value sequences");let T=n.index-1;h(T),n.allowWhitespace();let D=Je(n);n.allowWhitespace(),n.eat("}",!0),a.push({type:"ExpressionTag",start:T,end:n.index,expression:D}),o={start:n.index,end:-1,type:"Text",raw:"",data:""}}else{let T=n.index+1;if(r!==void 0){let D=n.source;while(T<D.length){let S=D.charCodeAt(T);if(S===123||S===r)break;T++}}n.index=T}}throw new A("unterminated attribute value / sequence (loose mode)")}function Qs(n){let t=n.eat("'")?"'":n.eat('"')?'"':null;if(t&&n.eat(t))return[{start:n.index-1,end:n.index-1,type:"Text",raw:"",data:""}];let r=yo(n,()=>{if(t)return n.match(t);return!!n.matchRegex(Vs)},t===null?void 0:t.charCodeAt(0));if(r.length===0&&!t)throw Error("sveld: expected attribute value");if(t)n.index+=1;if(t||r.length>1||r[0].type==="Text")return r;return r[0]}function Jt(n,t,r,o){return{type:"Attribute",start:t,end:r,name:n,value:o}}function ea(n){let t=n.index,r=mo(n);if(!r.name)return null;let o=!0;if(n.eat("=")){n.allowWhitespace();let a=n.matchRegex(qs);if(!a)throw Error("sveld: expected attribute value");n.index+=a.length;let h=a[0]==='"'||a[0]==="'";if(h)a=a.slice(1,-1);o=[{start:n.index-a.length-(h?1:0),end:h?n.index-1:n.index,type:"Text",raw:a,data:Gt(a,!0)}]}if(n.matchRegex(uo))throw Error("sveld: expected '='");return Jt(r.name,t,n.index,o)}function na(n){while(!0){let D=n.index;if(Ys(n),n.index===D)break;n.allowWhitespace()}let t=n.index;if(n.eat("{")){if(n.allowWhitespace(),n.eat("@attach")){n.requireWhitespace();let N=Je(n);return n.allowWhitespace(),n.eat("}",!0),{type:"AttachTag",start:t,end:n.index,expression:N}}if(n.eat("...")){let N=Je(n);return n.allowWhitespace(),n.eat("}",!0),{type:"SpreadAttribute",start:t,end:n.index,expression:N}}let D=n.readIdentifierName();if(D.name==="")throw Error("sveld: empty attribute shorthand");n.allowWhitespace(),n.eat("}",!0);let S={type:"ExpressionTag",start:D.start,end:D.end,expression:D};return Jt(D.name,t,n.index,S)}let r=mo(n);if(!r.name)return null;let o=n.index;n.allowWhitespace();let a=r.name.indexOf(":"),h=a!==-1&&Zs(r.name.slice(0,a)),T=!0;if(n.eat("="))if(n.allowWhitespace(),n.source[n.index]==="/"&&n.source[n.index+1]===">"){let D=n.index;n.index++,T=[{start:D,end:D+1,type:"Text",raw:"/",data:"/"}],o=n.index}else T=Qs(n),o=n.index;else if(n.matchRegex(uo))throw Error("sveld: expected '='");if(h){let D=r.name.slice(a+1).split("|",1)[0];if(D==="")throw Error("sveld: directive missing a name");if(h==="StyleDirective")return{start:t,end:o,type:h,name:D,value:T};let S=T===!0?void 0:Array.isArray(T)?T[0]:T,N=null;if(S){if((Array.isArray(T)?T.length>1:!1)||S.type==="Text")throw Error("sveld: directive value must be a single expression");N=S.expression}let L={start:t,end:o,type:h,name:D,expression:N};if((L.type==="BindDirective"||L.type==="ClassDirective")&&!L.expression)L.expression={start:t+a+1,end:o,type:"Identifier",name:L.name};return L}return Jt(r.name,t,o,T)}function go(n){let t=n.index++,r=n.current();if(n.eat("!--")){let _=n.readUntilString("-->");n.eat("-->",!0),n.append({type:"Comment",start:t,end:n.index,data:_});return}if(n.eat("/")){let{name:_}=co(n);if(n.allowWhitespace(),n.eat(">",!0),Ut(_))throw Error(`sveld: <${_}> is a void element and cannot have a closing tag`);while(r.name!==_){if(r.type==="RegularElement");else throw Error(`sveld: invalid closing tag </${_}>`);r.end=t,n.pop(),r=n.current()}if(r.end=n.index,n.pop(),n.lastAutoClosedTag&&n.stack.length<n.lastAutoClosedTag.depth)n.lastAutoClosedTag=void 0;return}let o=co(n),a=Js(o.name)&&Gs.test(o.name);if(!Ws(o.name)&&!a)throw Error(`sveld: "${o.name}" is not a valid element or component name`);if(o.name in fo&&r.type!=="Root")throw Error(`sveld: <${o.name}> must be a top-level element`);let h;if(o.name in ao)h=ao[o.name];else if(o.name.startsWith("svelte:"))h=zs(o.name);else if(a)h="Component";else if(o.name==="title"&&Ks(n.stack))h="TitleElement";else if(o.name==="slot"&&!Xs(n.stack))h="SlotElement";else h="RegularElement";let T={type:h,start:t,end:-1,name:o.name,attributes:[],fragment:{type:"Fragment",nodes:[]}};if(n.allowWhitespace(),r.type==="RegularElement"&&Yr(r.name,o.name))r.end=t,n.pop(),n.lastAutoClosedTag={tag:r.name,reason:o.name,depth:n.stack.length},r=n.current();let D=n.current(),S=(o.name==="script"||o.name==="style")&&D.type==="Root",N=S?ea:na,L;while(L=N(n))T.attributes.push(L),n.allowWhitespace();if(T.type==="SvelteComponent")T.expression=lo(po(T));if(T.type==="SvelteElement"){let _=po(T);if(_.value===!0)throw Error("sveld: <svelte:element> `this` attribute needs a value");if(ra(_))T.tag=lo(_);else{let X=_.value[0];T.tag=X.type==="Text"?{type:"Literal",value:X.data,raw:`'${X.raw}'`,start:X.start,end:X.end}:X.expression}}if(S){n.eat(">",!0);let _=ta(D.fragment.nodes,t);if(o.name==="script"){let X=oo(n,t,T.attributes);if(_)X.content.leadingComments=[{type:"Line",value:_.data}];if(X.context==="module"){if(n.root.module)throw Error("sveld: duplicate <script module>");n.root.module=X}else{if(n.root.instance)throw Error("sveld: duplicate <script>");n.root.instance=X}}else{if(n.root.css)throw Error("sveld: duplicate <style>");let X=io(n,t,T.attributes);X.content.comment=_,n.root.css=X}return}n.append(T);let R=n.eat("/")||Ut(o.name);if(n.eat(">",!0),R)T.end=n.index;else if(o.name==="textarea")T.fragment.nodes=yo(n,()=>(Wt.lastIndex=n.index,Wt.test(n.source))),n.read(Wt),T.end=n.index;else n.push(T,T.fragment)}function ta(n,t){for(let r=n.length-1;r>=0;r--){let o=n[r];if(r===n.length-1&&o.end!==t)break;if(o.type==="Comment")return o;if(o.type!=="Text"||o.data.trim())break}return null}function po(n){let t=n.attributes,r=t.findIndex((o)=>o.type==="Attribute"&&o.name==="this");if(r===-1)throw Error(`sveld: <${n.name}> requires a \`this\` attribute`);return t.splice(r,1)[0]}function lo(n){return Array.isArray(n.value)?n.value[0].expression:n.value.expression}function ra(n){return n.value!==!0&&!Array.isArray(n.value)||Array.isArray(n.value)&&n.value.length===1&&n.value[0].type==="ExpressionTag"}function ho(n){let t={start:n.start,end:n.end,attributes:n.attributes};for(let r of n.attributes){if(r.type!=="Attribute")continue;if(r.name==="runes"){let o=bo(r);if(typeof o==="boolean")t.runes=o}if(r.name==="customElement"){let o=sa(r);if(o!==void 0)t.customElement=o}}return t}function bo(n){let{value:t}=n;if(t===!0)return!0;let r=Array.isArray(t)?t[0]:t;if(!r)return!0;if(Array.isArray(t)&&t.length>1)return null;if(r.type==="Text")return r.data;if(r.expression.type!=="Literal")return null;return r.expression.value}var oa=new Set(["String","Boolean","Number","Array","Object"]);function zt(n){let t=[];for(let r of n.properties){if(!r||typeof r!=="object"||r.type!=="Property"||r.computed||r.key?.type!=="Identifier")continue;let{key:o,value:a}=r;t.push([o.name,a])}return t}function ia(n){let t={};if(!n||typeof n!=="object"||n.type!=="ObjectExpression")return t;for(let[r,o]of zt(n)){if(!o||typeof o!=="object"||o.type!=="Literal")continue;let a=o.value;if(r==="attribute"&&typeof a==="string")t.attribute=a;else if(r==="reflect"&&typeof a==="boolean")t.reflect=a;else if(r==="type"&&typeof a==="string"&&oa.has(a))t.type=a}return t}function sa(n){let{value:t}=n;if(t===!0)return;let r=Array.isArray(t)?t[0]:t;if(!r)return;if(r.type==="Text"){let L=bo(n);return typeof L==="string"?{tag:L}:void 0}let o=r.expression;if(o.type==="Literal"&&o.value===null)return;if(o.type!=="ObjectExpression")return;let a=zt(o),h={},T=a.find(([L])=>L==="tag")?.[1];if(T&&typeof T==="object"&&T.type==="Literal"&&typeof T.value==="string")h.tag=T.value;let D=a.find(([L])=>L==="props")?.[1];if(D&&typeof D==="object"&&D.type==="ObjectExpression"){h.props={};for(let[L,R]of zt(D))h.props[L]=ia(R)}let S=a.find(([L])=>L==="shadow")?.[1];if(S&&typeof S==="object"){let L=S;if(L.type==="Literal"&&(L.value==="open"||L.value==="none"))h.shadow=L.value;else if(L.type==="ObjectExpression")h.shadow=S}let N=a.find(([L])=>L==="extend")?.[1];if(N!==void 0)h.extend=N;return h}var aa=/<script\s+(?:[^>]*|(?:[^=>'"/]+=(?:"[^"]*"|'[^']*'|[^>\s]+)\s+)*)lang=(["'])?ts\1[^>]*>/;class Kt extends Ot{root;stack=[];fragments=[];isTypeScript;lineTable={};lastAutoClosedTag;constructor(n,t){super(n);this.isTypeScript=aa.test(n);let r=rn();this.root={type:"Root",start:0,end:t,css:null,js:[],options:null,fragment:r,comments:[]},this.stack.push(this.root),this.fragments.push(r)}current(){return this.stack[this.stack.length-1]}currentFragment(){return this.fragments[this.fragments.length-1]}push(n,t){this.stack.push(n),this.fragments.push(t)}pop(){return this.fragments.pop(),this.stack.pop()}append(n){return this.currentFragment().nodes.push(n),n}}var Xt={"{":"}","(":")","[":"]"},ca=new Set(Object.values(Xt));function Yn(n,t,r=Xt){let o=r===Xt?ca:new Set(Object.values(r)),a=[],h=t;while(h<n.source.length){let T=n.source[h++];if(T==="'"||T==='"'||T==="`"){h=pa(n,h,T);continue}if(Object.hasOwn(r,T))a.push(T);else if(o.has(T)){let D=a.pop(),S=D?r[D]:void 0;if(T!==S)throw Error(`sveld: expected "${S}"`);if(a.length===0)return h}}throw Error("sveld: unexpected end of input")}function pa(n,t,r){let o=!1,a=t;while(a<n.source.length){let h=n.source[a++];if(o){o=!1;continue}if(h===r)return a;if(h==="\\")o=!0;if(r==="`"&&h==="$"&&n.source[a]==="{")a=Yn(n,a)}throw Error("sveld: unterminated string constant")}var xo=/[^\n]/g,la=/\?\s*:/g;function Nn(n){let t=n.index,r=n.readIdentifierName();if(r.name!==""){let _=To(n);return{...r,typeAnnotation:_}}let o=n.source[n.index];if(o!=="{"&&o!=="[")throw Error("sveld: expected a binding pattern");let a=Yn(n,t);n.index=a;let h=n.source.slice(t,a),T=n.source.slice(0,t).replace(xo," "),D=T.indexOf(" ");T=T.slice(0,D)+T.slice(D+1);let S=`${T}(${h} = 1)`,{node:N}=H(S,t-1,n.isTypeScript,n.root.comments),L=N.left,R=To(n);if(R)L.typeAnnotation=R,L.end=R.end;return L}function To(n){let t=n.index;if(n.allowWhitespace(),!n.eat(":")){n.index=t;return}let r="_ as ",o=n.index-r.length,a=n.source.slice(0,o).replace(xo," ")+r+n.source.slice(n.index).replace(la,":"),{node:h}=H(a,o,n.isTypeScript,n.root.comments),T=h;if(T.type==="AssignmentExpression"){let D=T.right.start;while(a[D]!=="=")D-=1;({node:h}=H(a.slice(0,D),o,n.isTypeScript,n.root.comments)),T=h}if(T.type==="SequenceExpression"&&T.expressions)T=T.expressions[0];return n.index=T.end,{type:"TSTypeAnnotation",start:t,end:n.index,typeAnnotation:T.typeAnnotation}}var Eo=/\s*}/y,ua={"<":">"};function So(n){let t=n.index-2;while(n.source[t]!=="{")t-=1;if(n.eat("if")){n.requireWhitespace();let r={type:"IfBlock",elseif:!1,start:t,end:-1,test:Je(n),consequent:rn(),alternate:null};n.append(r),n.allowWhitespace(),n.eat("}",!0),n.push(r,r.consequent);return}if(n.eat("each")){n.requireWhitespace();let r=Je(n);if(n.allowWhitespace(),!n.match("as")){let D=r;if(D.type==="SequenceExpression"&&D.expressions)D=D.expressions[0];if(D.type==="TSAsExpression"){let S=D;r=S.expression;let N=S.typeAnnotation.start-2;while(N>=0&&!(n.source[N]==="a"&&n.source[N+1]==="s"))N-=1;n.index=N}}let o=null,a,h;if(n.eat("as"))n.requireWhitespace(),o=Nn(n);if(n.allowWhitespace(),n.eat(",")){n.allowWhitespace();let D=n.readIdentifierName();if(!D.name)throw Error("sveld: expected an identifier");a=D.name,n.allowWhitespace()}if(n.eat("("))n.allowWhitespace(),h=Je(n),n.allowWhitespace(),n.eat(")",!0),n.allowWhitespace();n.eat("}",!0);let T={type:"EachBlock",start:t,end:-1,expression:r,body:rn(),context:o,index:a,key:h};n.append(T),n.push(T,T.body);return}if(n.eat("await")){n.requireWhitespace();let r=Je(n);n.allowWhitespace();let o={type:"AwaitBlock",start:t,end:-1,expression:r,value:null,error:null,pending:null,then:null,catch:null};if(n.eat("then")){if(!n.matchRegex(Eo))n.requireWhitespace(),o.value=Nn(n),n.allowWhitespace();o.then=rn()}else if(n.eat("catch")){if(!n.matchRegex(Eo))n.requireWhitespace(),o.error=Nn(n),n.allowWhitespace();o.catch=rn()}else o.pending=rn();n.eat("}",!0),n.append(o),n.push(o,o.then??o.catch??o.pending);return}if(n.eat("key")){n.requireWhitespace();let r=Je(n);n.allowWhitespace(),n.eat("}",!0);let o={type:"KeyBlock",start:t,end:-1,expression:r,fragment:rn()};n.append(o),n.push(o,o.fragment);return}if(n.eat("snippet")){n.requireWhitespace();let r=n.readIdentifierName();if(r.name==="")throw Error("sveld: expected a snippet name");n.allowWhitespace();let o;if(n.isTypeScript&&n.match("<")){let h=n.index,T=Yn(n,h,ua);o=n.source.slice(h+1,T-1),n.index=T}if(n.allowWhitespace(),n.eat("(")){let h=1;while(n.index<n.source.length&&(!n.match(")")||h!==1)){if(n.match("("))h++;if(n.match(")"))h--;n.index+=1}n.eat(")",!0)}n.allowWhitespace(),n.eat("}",!0);let a={type:"SnippetBlock",start:t,end:-1,expression:r,typeParams:o,parameters:[],body:rn()};n.append(a),n.push(a,a.body);return}throw Error("sveld: expected if/each/await/key/snippet")}function vo(n){let t=n.index-1,r=n.current();if(r.type==="IfBlock"){if(!n.eat("else"))throw Error("sveld: expected {:else} or {:else if}");if(n.eat("if"))throw Error("sveld: {:else if} cannot follow {:else if} directly");if(n.allowWhitespace(),n.fragments.pop(),r.alternate=rn(),n.fragments.push(r.alternate),n.eat("if")){n.requireWhitespace();let o=Je(n);n.allowWhitespace(),n.eat("}",!0);let a=t-1;while(n.source[a]!=="{")a-=1;let h={type:"IfBlock",start:a,end:-1,elseif:!0,test:o,consequent:rn(),alternate:null};n.append(h),n.stack.push(h),n.fragments.pop(),n.fragments.push(h.consequent)}else n.allowWhitespace(),n.eat("}",!0);return}if(r.type==="EachBlock"){if(!n.eat("else"))throw Error("sveld: expected {:else}");n.allowWhitespace(),n.eat("}",!0),r.fallback=rn(),n.fragments.pop(),n.fragments.push(r.fallback);return}if(r.type==="AwaitBlock"){if(n.eat("then")){if(r.then)throw Error("sveld: duplicate {:then}");if(!n.eat("}"))n.requireWhitespace(),r.value=Nn(n),n.allowWhitespace(),n.eat("}",!0);r.then=rn(),n.fragments.pop(),n.fragments.push(r.then);return}if(n.eat("catch")){if(r.catch)throw Error("sveld: duplicate {:catch}");if(!n.eat("}"))n.requireWhitespace(),r.error=Nn(n),n.allowWhitespace(),n.eat("}",!0);r.catch=rn(),n.fragments.pop(),n.fragments.push(r.catch);return}throw Error("sveld: expected {:then ...} or {:catch ...}")}throw Error("sveld: {:...} not valid here")}function Co(n){let t=n.current();switch(t.type){case"IfBlock":{n.eat("if",!0),n.allowWhitespace(),n.eat("}",!0);while(t.type==="IfBlock"&&t.elseif)t.end=n.index,n.stack.pop(),t=n.current();t.end=n.index,n.pop();return}case"EachBlock":n.eat("each",!0);break;case"KeyBlock":n.eat("key",!0);break;case"AwaitBlock":n.eat("await",!0);break;case"SnippetBlock":n.eat("snippet",!0);break;default:throw Error("sveld: unexpected closing block tag")}n.allowWhitespace(),n.eat("}",!0),t.end=n.index,n.pop()}var da=/(?:let|const)\b/y,fa=/(?:var|interface|enum)\b/y,ma=/type\b/y;function Po(n){let t=n.index;if(n.matchRegex(fa))throw Error("sveld: `var`/`interface`/`enum` are not valid here");if(!n.matchRegex(da)&&!n.matchRegex(ma))return null;let r=n.root.comments.length,o=De(n.source,t,n.isTypeScript,n.root.comments);if(o.type!=="VariableDeclaration"){if(o.type==="ExpressionStatement")return n.root.comments.length=r,null;throw Error("sveld: expected a `let`/`const` declaration")}if(o.kind!=="let"&&o.kind!=="const")throw Error("sveld: expected a `let`/`const` declaration");return n.index=o.end,n.allowWhitespace(),n.eat("}",!0),o}var ya=/\s*}/y;function wo(n){let t=n.index;while(n.source[t]!=="{")t-=1;if(n.eat("html")){n.requireWhitespace();let r=Je(n);n.allowWhitespace(),n.eat("}",!0);let o={type:"HtmlTag",start:t,end:n.index,expression:r};n.append(o);return}if(n.eat("debug")){let r;if(n.read(ya))r=[];else{let a=Je(n);r=a.type==="SequenceExpression"?a.expressions:[a];for(let h of r)if(h.type!=="Identifier")throw Error("sveld: {@debug} arguments must be identifiers");n.allowWhitespace(),n.eat("}",!0)}let o={type:"DebugTag",start:t,end:n.index,identifiers:r};n.append(o);return}if(n.eat("const")){n.requireWhitespace();let r=Nn(n);n.allowWhitespace(),n.eat("=",!0),n.allowWhitespace();let o=Je(n),a=n.index;n.allowWhitespace(),n.eat("}",!0);let h={type:"VariableDeclarator",id:r,init:o,start:r.start,end:a},T={type:"ConstTag",start:t,end:n.index,declaration:{type:"VariableDeclaration",kind:"const",declarations:[h],start:t+2,end:n.index-1}};n.append(T);return}if(n.eat("render")){n.requireWhitespace();let r=Je(n);if(!(r.type==="CallExpression"||r.type==="ChainExpression"&&r.expression.type==="CallExpression"))throw Error("sveld: {@render ...} must be a function call");n.allowWhitespace(),n.eat("}",!0);let a={type:"RenderTag",start:t,end:n.index,expression:r};n.append(a);return}throw Error("sveld: expected html/debug/const/render")}function Do(n){let t=n.index;if(n.index+=1,n.allowWhitespace(),n.eat("#")){So(n);return}if(n.eat(":")){vo(n);return}if(n.eat("@")){wo(n);return}if(n.match("/")&&!n.match("/*")&&!n.match("//")){n.eat("/"),Co(n);return}let r=Po(n);if(r){let h={type:"DeclarationTag",start:t,end:n.index,declaration:r};n.append(h);return}let o=Je(n);n.allowWhitespace(),n.eat("}",!0);let a={type:"ExpressionTag",start:t,end:n.index,expression:o};n.append(a)}function ko(n){let{index:t,source:r}=n,o=r.indexOf("<",t),a=r.indexOf("{",t),h;if(o===-1)h=a===-1?r.length:a;else h=a===-1?o:Math.min(o,a);n.index=h;let T=r.slice(t,h),D={type:"Text",start:t,end:n.index,raw:T,data:T};n.append(D)}function fe(n){let t=n.trimEnd(),r=new Kt(t,n.length);while(r.index<r.source.length)if(r.match("<"))go(r);else if(r.match("{"))Do(r);else ko(r);let o=r.root.fragment.nodes.findIndex((a)=>a.type==="SvelteOptions");if(o!==-1){let[a]=r.root.fragment.nodes.splice(o,1);r.root.options=ho(a)}return r.root}var Ao={a:"HTMLAnchorElement",abbr:"HTMLElement",address:"HTMLElement",applet:"HTMLUnknownElement",area:"HTMLAreaElement",article:"HTMLElement",aside:"HTMLElement",audio:"HTMLAudioElement",b:"HTMLElement",base:"HTMLBaseElement",basefont:"HTMLElement",bdi:"HTMLElement",bdo:"HTMLElement",blockquote:"HTMLQuoteElement",body:"HTMLBodyElement",br:"HTMLBRElement",button:"HTMLButtonElement",canvas:"HTMLCanvasElement",caption:"HTMLTableCaptionElement",cite:"HTMLElement",code:"HTMLElement",col:"HTMLTableColElement",colgroup:"HTMLTableColElement",data:"HTMLDataElement",datalist:"HTMLDataListElement",dd:"HTMLElement",del:"HTMLModElement",details:"HTMLDetailsElement",dfn:"HTMLElement",dialog:"HTMLDialogElement",dir:"HTMLDirectoryElement",div:"HTMLDivElement",dl:"HTMLDListElement",dt:"HTMLElement",em:"HTMLElement",embed:"HTMLEmbedElement",fieldset:"HTMLFieldSetElement",figcaption:"HTMLElement",figure:"HTMLElement",font:"HTMLFontElement",footer:"HTMLElement",form:"HTMLFormElement",frame:"HTMLFrameElement",frameset:"HTMLFrameSetElement",h1:"HTMLHeadingElement",h2:"HTMLHeadingElement",h3:"HTMLHeadingElement",h4:"HTMLHeadingElement",h5:"HTMLHeadingElement",h6:"HTMLHeadingElement",head:"HTMLHeadElement",header:"HTMLElement",hgroup:"HTMLElement",hr:"HTMLHRElement",html:"HTMLHtmlElement",i:"HTMLElement",iframe:"HTMLIFrameElement",img:"HTMLImageElement",input:"HTMLInputElement",ins:"HTMLModElement",kbd:"HTMLElement",label:"HTMLLabelElement",legend:"HTMLLegendElement",li:"HTMLLIElement",link:"HTMLLinkElement",main:"HTMLElement",map:"HTMLMapElement",mark:"HTMLElement",marquee:"HTMLMarqueeElement",menu:"HTMLMenuElement",meta:"HTMLMetaElement",meter:"HTMLMeterElement",nav:"HTMLElement",noscript:"HTMLElement",object:"HTMLObjectElement",ol:"HTMLOListElement",optgroup:"HTMLOptGroupElement",option:"HTMLOptionElement",output:"HTMLOutputElement",p:"HTMLParagraphElement",param:"HTMLParamElement",picture:"HTMLPictureElement",pre:"HTMLPreElement",progress:"HTMLProgressElement",q:"HTMLQuoteElement",rp:"HTMLElement",rt:"HTMLElement",ruby:"HTMLElement",s:"HTMLElement",samp:"HTMLElement",script:"HTMLScriptElement",search:"HTMLElement",section:"HTMLElement",select:"HTMLSelectElement",slot:"HTMLSlotElement",small:"HTMLElement",source:"HTMLSourceElement",span:"HTMLSpanElement",strong:"HTMLElement",style:"HTMLStyleElement",sub:"HTMLElement",summary:"HTMLElement",sup:"HTMLElement",table:"HTMLTableElement",tbody:"HTMLTableSectionElement",td:"HTMLTableCellElement",template:"HTMLTemplateElement",textarea:"HTMLTextAreaElement",tfoot:"HTMLTableSectionElement",th:"HTMLTableCellElement",thead:"HTMLTableSectionElement",time:"HTMLTimeElement",title:"HTMLTitleElement",tr:"HTMLTableRowElement",track:"HTMLTrackElement",u:"HTMLElement",ul:"HTMLUListElement",var:"HTMLElement",video:"HTMLVideoElement",wbr:"HTMLElement"};function ga(n){return n in Ao}function No(n){if(ga(n))return Ao[n];return"HTMLElement"}var ha=new Set(["MethodDefinition","PropertyDefinition","AccessorProperty"]);function ba(n){if(n.computed||!n.key)return;if(n.key.type==="Identifier")return n.key.name;if(n.key.type==="Literal"&&(typeof n.key.value==="string"||typeof n.key.value==="number"))return String(n.key.value);return}function Lo(n){return n==="private"||n==="protected"}function jn(n){return{...n?.description?{description:n.description}:{},...n?.deprecated===void 0?{}:{deprecated:n.deprecated},...n?.tags?{tags:n.tags}:{}}}function Mo(n){return n?.slice(1,-1).trim()||void 0}function Yt(n,t,r){let o=Tt(n,t),a=new Map((r?.params??[]).map((S)=>[S.name,S])),h=o.params.map(({name:S,type:N,optional:L,rest:R})=>{let _=a.get(S);return{name:R?`...${S}`:S,type:N??_?.type??(R?"any[]":"any"),..._?.description?{description:_.description}:{},...!R&&(L||_?.optional)?{optional:!0}:{}}}),T=o.returnType??r?.returnType??(t.async?"Promise<any>":void 0),D=Mo(o.typeParameters)??r?.typeParameters;return{...h.length>0?{params:h}:{},...T?{returnType:T}:{},...D?{typeParameters:D}:{}}}function Io(n,t,r){let o=[],a=new Map,h=new Set,T=new Set,D,S=-1;for(let R of r.body?.body??[]){let _=R;if(!ha.has(_.type)||Lo(_.accessibility))continue;let X=ba(_);if(X===void 0)continue;let K=an(n,t,_);if(K?.internal)continue;let Q=`${_.static?"static ":""}${X}`,te={..._.static?{static:!0}:{},..._.optional?{optional:!0}:{},..._.abstract?{abstract:!0}:{}};if(_.type!=="MethodDefinition"){if(Ye(n,_.typeAnnotation?.typeAnnotation),!_.static)T.add(X);o.push({kind:"property",name:X,type:vn(n,_.typeAnnotation)??K?.type??"any",...te,..._.readonly?{readonly:!0}:{},...jn(K)});continue}let Ue=_.value,Oe=_.typeParameters?{...Ue,typeParameters:_.typeParameters}:Ue;if(_.kind==="constructor"){let ue=Yt(n,Oe,K);o.push({kind:"constructor",name:"constructor",params:ue.params,...jn(K)}),S=o.length,D=Oe.body?.body,(Oe.params??[]).forEach((we,Ie)=>{if(we.type!=="TSParameterProperty"||Lo(we.accessibility))return;let _e=ue.params?.[Ie];if(!_e)return;T.add(_e.name),o.push({kind:"property",name:_e.name,type:_e.type,...we.readonly?{readonly:!0}:{},..._e.description?{description:_e.description}:{}})});continue}if(_.kind==="get"||_.kind==="set"){let ue=Yt(n,Oe,K),$e=_.kind==="get"?ue.returnType??K?.type:ue.params?.[0]?.type??K?.type,we=a.get(Q);if(we){if(_.kind==="set")we.readonly=void 0;if($e&&$e!=="any"&&(we.type==="any"||_.kind==="get"))we.type=$e;if(!we.description&&!we.deprecated)Object.assign(we,jn(K));continue}let Ie={kind:"property",name:X,type:$e??"any",...te,..._.kind==="get"?{readonly:!0}:{},...jn(K)};a.set(Q,Ie),o.push(Ie);continue}if(Oe.type==="TSDeclareMethod"&&!_.abstract)h.add(Q);else if(Oe.type!=="TSDeclareMethod"&&h.has(Q))continue;o.push({kind:"method",name:X,...te,...Yt(n,Oe,K),...jn(K)})}if(n.scriptLanguage!=="ts"&&D)o.splice(S,0,...xa(n,t,D,T));for(let R of r.typeParameters?.params??[])Ye(n,R.constraint),Ye(n,R.default);let N=Mo(Ln(n,r.typeParameters)),L=Ta(n,r);return{members:o,...N?{typeParameters:N}:{},...L}}function Ta(n,t){let r={},o=t.superClass;if(o){if(r.extends=Ln(n,{start:o.start,end:t.superTypeParameters?.end??o.end}),o.type==="Identifier")Ro(n,o,t.superTypeParameters)}let a=(t.implements??[]).map((h)=>(Ro(n,h.expression,h.typeParameters),Ln(n,h))).filter((h)=>Boolean(h));if(a.length>0)r.implements=a;return r}function Ro(n,t,r){Ye(n,{type:"TSTypeReference",typeName:t,...r?{typeParameters:r}:{}})}function xa(n,t,r,o){let a=[];for(let h of r){let T=h.type==="ExpressionStatement"?h.expression:void 0;if(T?.type!=="AssignmentExpression"||T.operator!=="=")continue;let D=T.left;if(D?.type!=="MemberExpression"||D.computed||D.object?.type!=="ThisExpression")continue;let S=D.property?.type==="Identifier"?D.property.name:void 0;if(!S||o.has(S))continue;o.add(S);let N=an(n,t,h);if(N?.internal)continue;a.push({kind:"property",name:S,type:N?.type??"any",...jn(N)})}return a}function Zt(){return{syntaxMode:"legacy",scriptLanguage:void 0,source:void 0,parsed:void 0,runesOptionOverride:void 0,sourceLineStartOffsetsCache:void 0,sourceLineHint:void 0,parsedJsDocByText:new Map,jsDocBlocksByStart:new Map,functionDocCommentStarts:new Set,rest_props:void 0,extends:void 0,customElementTag:void 0,customElement:void 0,componentComment:void 0,componentCommentSource:void 0,generics:null,scriptGenericsAttribute:void 0,diagnosticRecords:[],componentFilePath:"",props:new Map,moduleExports:new Map,propLocalToPublicName:new Map,reactive_vars:new Set,funcDecls:new Map,vars:new Set,valueImportBindingsByLocalName:new Map,pendingCallDefaultCandidates:[],pendingConstDefaultCandidates:[],pendingContextKeyCandidates:[],pendingDispatchEscapeCandidates:[],deferredEventNoSourceDiagnostics:[],runesPropsDeclarationMetadataByDeclaratorStart:new Map,typedRunesPropsDeclarations:[],explicitPropTypesByName:new Map,explicitVariableTypesByName:new Map,explicitVariableTypeNodesByName:new Map,typeImportBindingsByLocalName:new Map,localTypeDeclarationsByName:new Map,additionalTypeDependencyNodes:[],wholePropsLocals:new Set,restPropLocals:new Set,componentScope:new Map,scopeDeclarations:new Map,activeScopes:[],slots:new Map,snippetPropLocals:new Set,cssParts:[],cssProperties:[],deferredSlotBlockGenerics:[],events:new Map,eventDescriptions:new Map,forwardedEvents:new Map,jsDocEventNames:new Set,untypedJsDocEventNames:new Set,jsDocEventSources:new Map,bindings:new Map,contexts:new Map,typedefs:new Map,typedefMembersByName:new Map,variableInfoCache:new Map,variableInfoCacheBuilt:!1,sveldIgnoreDirectives:new Map}}var Ea=new Set(["Component","SvelteComponent","SvelteSelf"]),Sa=new Set(["RegularElement","SvelteElement"]);function Zn(n){return Ea.has(n)}function Qn(n){return Sa.has(n)}var va=/^[A-Za-z_$][\w$]*/,Ca=/[A-Za-z_$][\w$]*/g,_o=/^(?:const|in|out)\s+/;function Bo(n){let t=m(n).map((o)=>o.trim()).filter((o)=>o.length>0);if(t.length===0)return null;return[t.map((o)=>{let a=o;while(_o.test(a))a=a.replace(_o,"");return a.match(va)?.[0]??o}).join(", "),t.join(", ")]}function Fo(n,t,r){let o=n.scriptGenericsAttribute?.value;if(!o)return;for(let[a]of o.matchAll(Ca)){if(n.typeImportBindingsByLocalName.has(a))t.add(a);if(r.has(a))continue;let h=n.localTypeDeclarationsByName.get(a);if(!h)continue;r.add(a),tn(n,h.node,t,r)}}function Pa({hasTypeScriptType:n,hasJSDocType:t,inferredType:r,finalType:o}){if(n)return"typescript";if(t)return"jsdoc";if(r!==void 0)return"default";if(o!==void 0)return"inferred";return"unknown"}function et(n){let t=n.explicitType??n.jsdocType??n.resolvedType??n.typeSeed,r=n.jsdocParams??n.resolvedParams,o=n.jsdocReturnType??n.resolvedReturnType;if((n.isFunctionDeclaration?t==="() => any":n.initializerIsFunction&&t===n.typeSeed)&&o){let N=n.jsdocTypeParameters?`<${n.jsdocTypeParameters}>`:"";t=r&&r.length>0?`${N}(${C(r)}) => ${o}`:`${N}() => ${o}`}let h=n.jsdocDescription??n.resolvedDescription;if(h===void 0&&t!==void 0)h=n.typedefs?.get(t)?.description;let T=Pa({hasTypeScriptType:n.explicitType!==void 0,hasJSDocType:n.jsdocType!==void 0||n.jsdocParams!==void 0||n.jsdocReturnType!==void 0||n.resolvedType!==void 0,inferredType:n.inferredTypeForSource,finalType:t}),D=n.initializerIsFunction||n.isFunctionDeclaration||n.inferIsFunctionFromTypeSignature===!0&&(!!n.jsdocParams?.length||n.jsdocReturnType!==void 0||!!n.jsdocType?.includes("=>")||!!n.resolvedType?.includes("=>")||!!n.explicitType?.includes("=>")),S=D?n.jsdocTypeParameters:void 0;return{type:t,typeSource:T,description:h,params:r,returnType:o,isFunction:D,typeParameters:S}}function wa(n){if(!n||typeof n!=="object"||!("type"in n))return;let t=String(n.type),r=Zn(t);if(!r&&!Qn(t))return;let o="name"in n&&typeof n.name==="string"?n.name:void 0;if(!o)return;let a=r?{type:"InlineComponent",name:o}:{type:"Element",name:o};if(o==="svelte:element"&&"tag"in n&&n.tag&&typeof n.tag==="object"){let h=n.tag;if(h.type==="Literal"&&typeof h.value==="string")a.thisValue=h.value}return a}function jo(n,t){let r=wa(t);if(!r)return;if(n.rest_props===void 0){n.rest_props=r;return}if(n.rest_props.type==="InlineComponent"&&r.type==="Element")n.rest_props=r}var Vo=new Set(["$state","$derived","$effect","$props","$bindable","$inspect","$host"]);function Da(n,t){switch(t?.type){case"MemberExpression":return t.computed||n===t.object;case"MethodDefinition":return!!t.computed;case"MetaProperty":return n===t.meta;case"PropertyDefinition":return t.computed||n===t.value;case"Property":return t.computed||n===t.value;case"ExportSpecifier":case"ImportSpecifier":return n===t.local;case"LabeledStatement":case"BreakStatement":case"ContinueStatement":return!1;default:return!0}}var ka=Array.from(Vo);function Oo(n){return n>=48&&n<=57||n>=65&&n<=90||n>=97&&n<=122||n===95||n===36}function Aa(n){if(n.includes("\\u"))return!0;for(let t of ka){let r=n.indexOf(t);while(r!==-1){if(!Oo(n.charCodeAt(r-1))&&!Oo(n.charCodeAt(r+t.length)))return!0;r=n.indexOf(t,r+1)}}return!1}function Na(n,t){for(let r=t.length-1;r>=0;r-=1)if(t[r]?.has(n))return!0;return!1}function La(n){let t=new Set;if(!n||typeof n!=="object"||!("type"in n))return t;switch(String(n.type)){case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":{let r=n;if(r.id?.name)t.add(r.id.name);for(let o of r.params??[])Ge(o,t);break}case"BlockStatement":dt(n.body,t);break;case"CatchClause":Ge(n.param,t);break;case"EachBlock":{let r=n;if(Ge(r.context,t),typeof r.index==="string")t.add(r.index);else if(r.index?.name)t.add(r.index.name);break}case"AwaitBlock":{let r=n;Ge(r.value,t),Ge(r.error,t);break}}return t}function dt(n,t){if(!Array.isArray(n))return;for(let r of n){if(!r||typeof r!=="object"||!("type"in r))continue;switch(String(r.type)){case"ImportDeclaration":for(let o of r.specifiers??[])if(o.local?.name)t.add(o.local.name);break;case"VariableDeclaration":for(let o of r.declarations??[])Ge(o.id,t);break;case"FunctionDeclaration":case"ClassDeclaration":{let o=r.id?.name;if(o)t.add(o);break}case"ExportNamedDeclaration":{let o=r.declaration;if(o&&typeof o==="object"&&"type"in o)dt([o],t);break}}}}function Qt(n,t){if(!n||typeof n!=="object")return!1;return er(n,void 0,[...t])}function er(n,t,r){if(ye(n.type))return!1;let o=Jn(n);if(o)r.push(La(n));let a=!1;if(t&&n.type==="Identifier"&&n.name!==void 0&&Vo.has(n.name)&&!t.type.startsWith("TS")&&Da(n,t)&&!Na(n.name,r))a=!0;else for(let h in n){if(h==="leadingComments")continue;let T=n[h];if(!T||typeof T!=="object")continue;if(Array.isArray(T)){for(let D=0;D<T.length;D++){let S=T[D];if(S&&typeof S==="object"&&typeof S.type==="string"){if(er(S,n,r)){a=!0;break}}}if(a)break}else if(typeof T.type==="string"){if(er(T,n,r)){a=!0;break}}}if(o)r.pop();return a}function qo(n){if(!n||typeof n!=="object")return;if("content"in n){let t=n.content,r=t&&typeof t==="object"&&"body"in t?t.body:void 0;if(Array.isArray(r))return r}if("body"in n&&Array.isArray(n.body))return n.body;return}function $o(n){if(n.runesOptionOverride!==void 0)return n.runesOptionOverride?"runes":"legacy";let t=n.parsed;if(!t)return"legacy";if(n.source!==void 0&&!Aa(n.source))return"legacy";let r=new Set;dt(qo(t.module),r);let o=new Set;return dt(qo(t.instance),o),Qt(t.module,[r])||Qt(t.instance,[r,o])||Qt(t.fragment,[r,o])?"runes":"legacy"}var Ra=/[A-Za-z_$][\w$]*/g;function Ma(n,t,r){let o=new Map,a=t.typeParameters?.params,h=r.typeArguments?.params;if(!a?.length||!h?.length)return o;for(let T=0;T<a.length;T++){let D=a[T]?.name,S=h[T];if(!D||S?.start===void 0||S?.end===void 0)continue;let N=je(n,S.start,S.end)?.trim();if(N)o.set(D,N)}return o}function Ia(n,t){if(t.size===0)return n;return n.replace(Ra,(r)=>t.get(r)??r)}function On(n,t,r,o,a=new Set){let h=new Map;if(!r?.type)return h;let T=(D)=>{for(let S of D){if(S?.type!=="TSPropertySignature"||S.computed)continue;if(!S.key)continue;let N=n.getPropertyName(S.key);if(!N)continue;let L=S.typeAnnotation?.start,R=S.typeAnnotation?.end;if(L===void 0||R===void 0)continue;let _=je(t,L+1,R)?.trim();if(!_)continue;Ye(t,S.typeAnnotation?.typeAnnotation);let X=jt(t,n,S);h.set(N,{type:_,optional:S.optional===!0,source:Me(t,S),...X?{jsdoc:X}:{}})}};switch(r.type){case"TSTypeLiteral":T(r.members??[]);break;case"TSInterfaceDeclaration":T(r.body?.body??[]);break;case"TSTypeAliasDeclaration":{let D=On(n,t,r.typeAnnotation,o,a);for(let[S,N]of D)h.set(S,N);break}case"TSTypeReference":{let D=lr(r.typeName);if(!D||a.has(D))break;let S=o.get(D);if(!S)break;a.add(D);let N=On(n,t,S,o,a);a.delete(D);let L=Ma(t,S,r);for(let[R,_]of N)h.set(R,L.size===0?_:{..._,type:Ia(_.type,L)});break}case"TSIntersectionType":for(let D of r.types??[]){let S=On(n,t,D,o,a);for(let[N,L]of S)h.set(N,L)}break;case"TSParenthesizedType":{let D=On(n,t,r.typeAnnotation,o,a);for(let[S,N]of D)h.set(S,N);break}}return h}function _a(n){let t={};for(let[r,o]of Object.entries(n))t[r]={...o.attribute===void 0?{}:{attribute:o.attribute},...o.reflect===void 0?{}:{reflect:o.reflect},...o.type===void 0?{}:{type:o.type}};return t}function nr(n,t,r){if(t.type==="ImportDeclaration"&&t.source?.value)for(let a of t.specifiers??[]){let h=a.local?.name;if(!h)continue;if(!(t.importKind==="type"||a.importKind==="type"))continue;let D,S;if(a.type==="ImportSpecifier")D="named",S=a.imported?.type==="Identifier"?a.imported.name:typeof a.imported?.value==="string"?a.imported.value:void 0;else if(a.type==="ImportDefaultSpecifier")D="default";else if(a.type==="ImportNamespaceSpecifier")D="namespace";if(!D)continue;n.typeImportBindingsByLocalName.set(h,{importedName:S,localName:h,source:String(t.source.value),specifierType:D})}let o=t.type==="TSEnumDeclaration";if((o||t.type==="TSInterfaceDeclaration"||t.type==="TSTypeAliasDeclaration")&&t.id?.name&&t.start!==void 0&&t.end!==void 0){let a=o?dr(n,t):je(n,t.start,t.end)?.trim();n.localTypeDeclarationsByName.set(t.id.name,{code:a??"",node:t,start:t.start,...r?{exported:r}:{}})}}function Go(n,t,r){if(t.runesPropsDeclarationMetadataByDeclaratorStart.clear(),t.explicitPropTypesByName.clear(),t.explicitVariableTypesByName.clear(),t.explicitVariableTypeNodesByName.clear(),t.typeImportBindingsByLocalName.clear(),t.localTypeDeclarationsByName.clear(),t.additionalTypeDependencyNodes.length=0,t.typedRunesPropsDeclarations.length=0,!t.source)return;let o=r;t.scriptLanguage=n.resolveScriptLanguage(o);let a=o.options?.customElement;t.customElementTag=a?.tag,t.customElement=a?{...a.tag===void 0?{}:{tag:a.tag},...a.shadow==="open"||a.shadow==="none"?{shadow:a.shadow}:{},...a.props?{props:_a(a.props)}:{},...a.extend===void 0?{}:{extend:!0}}:void 0,t.runesOptionOverride=o.options?.runes,t.scriptGenericsAttribute=n.resolveScriptGenericsAttribute(o);let h=o.module?.content?.body??[],T=new Set;for(let S of h){if(!S?.type)continue;if(S.type==="ExportNamedDeclaration"&&S.declaration)nr(t,S.declaration,!0);else if(S.type==="ExportNamedDeclaration"&&!S.source)for(let N of S.specifiers??[]){let L=N.local?.name;if(L&&L===N.exported?.name)T.add(L)}else nr(t,S,!1)}for(let S of T){let N=t.localTypeDeclarationsByName.get(S);if(N)N.exported=!0}let D=o.instance?.content?.body??[];for(let S of D){if(!S?.type)continue;if(nr(t,S,!1),S.type==="ExportNamedDeclaration"&&S.declaration?.type==="VariableDeclaration")for(let N of S.declaration.declarations??[]){if(N.id?.type!=="Identifier"||!N.id.name)continue;let L=vn(t,N.id.typeAnnotation);if(L)t.explicitPropTypesByName.set(N.id.name,L),Ye(t,N.id.typeAnnotation?.typeAnnotation)}else if(S.type==="VariableDeclaration")for(let N of S.declarations??[]){if(N.id?.type!=="Identifier"||!N.id.name)continue;let L=vn(t,N.id.typeAnnotation);if(L){t.explicitVariableTypesByName.set(N.id.name,L);let R=N.id.typeAnnotation?.typeAnnotation;if(R)t.explicitVariableTypeNodesByName.set(N.id.name,R)}}}for(let S of D){if(!S||typeof S!=="object"||!("declarations"in S))continue;for(let N of S.declarations??[]){if(!g(x(N.init),"$props"))continue;let L=N.id?.typeAnnotation?void 0:Se(N.init),R=N.id?.typeAnnotation?.typeAnnotation??L,_=N.id?.typeAnnotation?vn(t,N.id.typeAnnotation):Ln(t,L),X=On(n,t,R,new Map(Array.from(t.localTypeDeclarationsByName.entries(),([te,Ue])=>[te,Ue.node]))),K=new Set,Q=new Set;if(tn(t,R,K,Q),Fo(t,K,Q),N.start!==void 0){let te={canonicalType:_,props:X,referencedImportedTypes:K,referencedLocalTypes:Q};if(t.runesPropsDeclarationMetadataByDeclaratorStart.set(N.start,te),_)t.typedRunesPropsDeclarations.push(te)}}}}function Ho(n,t){let r=t?.trim();if(!r)return;let o=n.typedefMembersByName.get(r)??Sn(r);return o?new Map(o.map((a)=>[a.name,a])):void 0}function Uo(n,t,r){for(let o of r.declarations){if(!g(x(o.init),"$props"))continue;if(o.id.type==="Identifier"){t.wholePropsLocals.add(o.id.name),t.restPropLocals.add(o.id.name);let D=ot(t,o.start),S=D?.props.size?void 0:Ho(t,an(t,n,r)?.type);for(let N of S?.values()??[])Bn(n,t,N.name,{name:N.name,kind:"let",description:N.description,type:N.type,typeSource:"jsdoc",isFunction:N.type.includes("=>"),isFunctionDeclaration:!1,isRequired:!N.optional,constant:!1,reactive:!1});if(D)for(let[N,L]of D.props)Bn(n,t,N,{name:N,kind:"let",description:L.jsdoc?.description,deprecated:L.jsdoc?.deprecated,tags:L.jsdoc?.tags,type:L.type,typeSource:"typescript",isFunction:!1,isFunctionDeclaration:!1,isRequired:!L.optional,constant:!1,reactive:!1,source:L.source});continue}if(o.id.type!=="ObjectPattern")continue;let a=an(t,n,r),h=ot(t,o.start)?.props.size?void 0:Ho(t,a?.type),T=o.id.properties.filter((D)=>{if(D.type!=="Property"||D.computed)return!1;if(!n.getPropertyName(D.key))return!1;if(D.value.type==="Identifier")return!0;return D.value.type==="AssignmentPattern"&&D.value.left.type==="Identifier"}).length;for(let D of o.id.properties){if(D.type==="RestElement"){if(D.argument.type==="Identifier")t.restPropLocals.add(D.argument.name);continue}let S=n.getPropertyName(D.key);if(!S)continue;let N,L;if(D.value.type==="Identifier")N=D.value.name;else{let yn=D.value;N=yn.left.name,L=yn.right}if(!N)continue;if(n.trackPropLocalName(S,N),S==="children")t.snippetPropLocals.add(N);let R=h?.get(S),_=pr(t,o.start,S),X=jt(t,n,D)??_?.jsdoc??(T===1&&!h?a:void 0),{init:K,bindable:Q}=xr(L),te=K==null?{isFunction:!1}:xn(n,t,K),{value:Ue,type:Oe,isFunction:ue,defaultValue:$e}=te,we=_?.type===void 0&&X?.type===void 0?te.resolvedType:void 0;Hn(t,te,S,"props");let{type:Ie,typeSource:_e,description:gn,params:cn,returnType:hn,isFunction:on}=et({explicitType:_?.type,typeSeed:Oe,inferredTypeForSource:Oe,jsdocType:X?.type??R?.type,jsdocDescription:X?.description??R?.description,jsdocParams:X?.params,jsdocReturnType:X?.returnType,resolvedType:we,resolvedDescription:te.resolvedDescription,resolvedParams:te.resolvedParams,resolvedReturnType:te.resolvedReturnType,initializerIsFunction:ue,isFunctionDeclaration:!1,inferIsFunctionFromTypeSignature:!0});if(Q)t.reactive_vars.add(S);En(t,"prop-unknown-type",S,X?.sveldIgnore),Bn(n,t,S,{name:S,...N===S?{}:{localName:N},kind:"let",description:gn,binding:X?.binding,deprecated:X?.deprecated,tags:X?.tags,...X?.internal?{internal:!0}:{},...Q?{bindable:!0}:{},type:Ie,typeSource:_e,value:Ue,defaultValue:$e,params:cn,returnType:hn,isFunction:on,isFunctionDeclaration:!1,isRequired:!Q&&K==null&&_?.optional!==!0&&R?.optional!==!0,constant:!1,reactive:Q,source:Me(t,D)})}}}function Ba(n){let r=n.indexOf("EventDispatcher");if(r===-1)return;let o=r+15;while(n[o]===" ")o++;if(n[o]!=="<")return;let a=0,h=o;for(;o<n.length;o++)if(n[o]==="<")a++;else if(n[o]===">"){if(a--,a===0)return n.slice(h+1,o)}return}function Wo(n,t){let r=n[t];for(let o=t+1;o<n.length;o++)if(n[o]==="\\")o++;else if(n[o]===r)return o;return n.length}function Fa(n){let t=[],r=0,o=0;for(let a=0;a<n.length;a++){let h=n[a];if(h==='"'||h==="'")a=Wo(n,a);else if(h==="{"||h==="("||h==="["||h==="<")r++;else if(h==="}"||h===")"||h==="]"||h===">")r=Math.max(r-1,0);else if(r===0&&(h===";"||h===","))t.push(n.slice(o,a)),o=a+1}return t.push(n.slice(o)),t.map((a)=>a.trim()).filter((a)=>a.length>0)}var ja=/^["']|["']$/g,Oa=/\?$/,qa=/^\{/,Va=/\}$/;function $a(n){let t=0;for(let r=0;r<n.length;r++){let o=n[r];if(o==='"'||o==="'")r=Wo(n,r);else if(o==="{"||o==="("||o==="["||o==="<")t++;else if(o==="}"||o===")"||o==="]"||o===">")t=Math.max(t-1,0);else if(t===0&&o===":"){let a=n.slice(0,r).trim().replace(Oa,"").replace(ja,""),h=n.slice(r+1).trim();if(!a||!h)return;return{name:a,type:h}}}return}function Jo(n,t,r,o,a){if(r){let S=new Map(Array.from(t.localTypeDeclarationsByName.entries(),([L,R])=>[L,R.node])),N=On(n,t,r,S);for(let[L,R]of N)Dn(t,{name:L,detail:R.type,has_argument:!0,source:R.source});return}let h=n.resolveLocalVarJSDoc(o)?.type,T=h?Ba(h):void 0;if(!T)return;let D=T.trim().replace(qa,"").replace(Va,"");for(let S of Fa(D)){let N=$a(S);if(!N)continue;Dn(t,{name:N.name,detail:N.type,has_argument:!0,source:a})}}function zo(n,t){if(n.syntaxMode!=="runes")return;for(let[r,o]of Array.from(n.events.entries())){if(o.type!=="dispatched")continue;if(t.has(r)||n.forwardedEvents.has(r))continue;let a=`on${r}`,h=n.props.get(a);if(!h)continue;let T=h.type!==void 0||h.params!==void 0||h.returnType!==void 0,D=o.detail===void 0||o.detail==="undefined"||o.detail==="null"?"() => void":`(detail: ${o.detail}) => void`;n.props.set(a,{...h,description:h.description??o.description,type:T?h.type:D,typeSource:T?h.typeSource:"inferred",isFunction:!0}),n.events.delete(r)}}var Ko=new Set(["TSAsExpression","TSSatisfiesExpression","TSNonNullExpression","TSTypeAssertion","TSInstantiationExpression"]);function tr(n){return n!==null&&typeof n==="object"&&typeof n.type==="string"}function Xo(n){if(!Ko.has(n.type))return n;let t=n.expression;while(t&&Ko.has(t.type))t=t.expression;return t??n}function ft(n){if(!tr(n))return;rr(n)}function rr(n){for(let t in n){if(t==="leadingComments")continue;let r=n[t];if(!r||typeof r!=="object")continue;if(Array.isArray(r))for(let o=0;o<r.length;o++){let a=r[o];if(!tr(a))continue;let h=Xo(a);if(h!==a)r[o]=h;rr(h)}else if(tr(r)){let o=Xo(r);if(o!==r)n[t]=o;rr(o)}}}function Ha(n,t,r,o,a){for(let h of n){if(h.type!=="Block"||h.start<r||h.end>o)continue;a.push({start:h.start,end:h.end,isJsDoc:h.end-h.start>4&&t.startsWith("/**",h.start)})}}function Yo(n,t,r){if(!n||typeof n!=="object"||!("type"in n))return;let o=n;if(o.type==="FunctionDeclaration"){if(o.id?.type==="Identifier"&&o.id.name)r.push({name:o.id.name,start:t});return}if(o.type==="VariableDeclaration"){for(let a of o.declarations??[])if(a?.id?.type==="Identifier"&&a.id.name)r.push({name:a.id.name,start:t})}}function Ga(n){let t=[];for(let r of n){if(!r||typeof r!=="object"||!("type"in r))continue;let o=r;if(o.start===void 0)continue;if(o.type==="ExportNamedDeclaration"&&o.declaration)Yo(o.declaration,o.start,t);else Yo(o,o.start,t)}return t}function Ua(n,t,r){let o=0,a=n.length;while(o<a){let h=o+a>>>1;if(n[h].end<=t)o=h+1;else a=h}for(let h=o-1;h>=0;h--){let T=n[h];if(!T.isJsDoc)continue;return Mt(r,T.end,t)?T:void 0}return}function Zo(n,t){let r=new Map;if(!n.source)return r;let o=[n.parsed?.module,n.parsed?.instance],a=[],h=[],T=n.parsed?.comments??[];for(let D of o){let S=D?.content;if(!S?.body||S.start===void 0||S.end===void 0)continue;Ha(T,n.source,S.start,S.end,a),h.push(...Ga(S.body))}a.sort((D,S)=>D.end-S.end);for(let D of h){let S=Ua(a,D.start,n.source);if(!S)continue;let N=Ft(n,n.source.slice(S.start,S.end)),{type:L,description:R,ignore:_,internal:X}=W(N);if(_.length>0)En(n,"context-any-type",D.name,_);if(!L&&!R&&!X)continue;r.set(D.name,{type:L?t.aliasType(L.type):void 0,description:R||L&&Gr(L),internal:X||void 0})}return r}function or(n){if(n?.type==="Identifier")return n.name;return typeof n?.value==="string"?n.value:void 0}function Qo(n,t){for(let r of(n&&w(n))??[]){let o=r,a=o.type==="ExportNamedDeclaration"&&o.declaration?o.declaration:o;if(a.type==="VariableDeclaration"){let h=a.declarations.find((T)=>T.id.type==="Identifier"?T.id.name===t:Ge(T.id).has(t));if(h)return{declaration:a,declarator:h,statement:o}}else if((a.type==="FunctionDeclaration"||a.type==="ClassDeclaration")&&a.id?.name===t)return{declaration:a,statement:o}}return}function Wa(n,t){for(let r of(n&&w(n))??[]){let o=r;if(o.type!=="LabeledStatement"||o.label.name!=="$")continue;if(o.body.type!=="ExpressionStatement")continue;let a=o.body.expression;if(a.type!=="AssignmentExpression"||a.operator!=="=")continue;if(!Ge(a.left).has(t))continue;let h={type:"VariableDeclarator",id:a.left,init:a.right};return{declaration:{type:"VariableDeclaration",kind:"let",declarations:[h]},declarator:h,statement:o}}return}function ei(n){if(n==="var")return"let";if(n==="using"||n==="await using")return"const";return n}var ni=null,ti=/^@component/,Ja=/^[A-Za-z_$][\w$]*(?=\s*(?:<|$))/,za=/\r/g,Ka=/^\{\s*\}$/,Xa=new Set(["AssignmentExpression","UpdateExpression","CallExpression","SpreadAttribute","FunctionDeclaration","ImportDeclaration","VariableDeclaration","ExportNamedDeclaration","Comment","SlotElement","RenderTag","OnDirective","BindDirective"]);class s{ctx=Zt();static mapToArray(n){return Array.from(n,([t,r])=>r)}static getStaticAttributeValue(n){if(!Array.isArray(n.value))return;return n.value.map((t)=>t.data??t.raw??"").join("").trim()}resolveScriptLanguage(n){let t=[n.instance,n.module].filter((o)=>o!==void 0),r=!1;for(let o of t){let a=o.attributes?.find((T)=>T.name==="lang");if(!a){r=!0;continue}if(s.getStaticAttributeValue(a)?.toLowerCase()==="ts")return"ts"}return r?"js":void 0}resolveScriptGenericsAttribute(n){let t=n.instance?.attributes?.find((T)=>T.name==="generics");if(!t)return;let r=Me(this.ctx,t),o=n.instance?.attributes?.find((T)=>T.name==="lang");if((o?s.getStaticAttributeValue(o)?.toLowerCase():void 0)!=="ts"){Fe(this.ctx,"syntax-skipped","generics",'<script generics="..."> requires lang="ts"; the generics attribute was ignored because the script is not TypeScript.',r);return}let h=s.getStaticAttributeValue(t);if(!h)return;return{value:h,source:r}}resolvePublicPropName(n){return this.ctx.propLocalToPublicName.get(n)??n}trackPropLocalName(n,t=n){this.ctx.propLocalToPublicName.set(t,n)}getPropByLocalOrPublic(n){return this.ctx.props.get(this.resolvePublicPropName(n))}getPropTypeByLocalOrPublic(n){return this.getPropByLocalOrPublic(n)?.type}getExplicitPropType(n){return this.ctx.explicitPropTypesByName.get(n)}getPropertyName(n){if(!n||typeof n!=="object"||!("type"in n))return;if(e(n))return n.name;if(y(n))return n.value==null?void 0:String(n.value);return}isNumericConstant(n){if(!n||typeof n!=="object"||!("type"in n))return!1;if(n.type!=="MemberExpression")return!1;let t=n,r=t.object&&"name"in t.object?t.object.name:void 0,o=t.property&&"name"in t.property?t.property.name:void 0;if(!r||!o)return!1;if(r==="Number")return["POSITIVE_INFINITY","NEGATIVE_INFINITY","MAX_VALUE","MIN_VALUE","MAX_SAFE_INTEGER","MIN_SAFE_INTEGER","EPSILON","NaN"].includes(o);if(r==="Math")return["PI","E","LN2","LN10","LOG2E","LOG10E","SQRT2","SQRT1_2"].includes(o);return!1}resolveLocalVarJSDoc(n){for(let r of this.ctx.vars)if(r.declarations.some((a)=>a.id&&typeof a.id==="object"&&("type"in a.id)&&a.id.type==="Identifier"&&("name"in a.id)&&a.id.name===n))return an(this.ctx,this,r);let t=this.ctx.funcDecls.get(n);if(t)return an(this.ctx,this,t);return}addModuleExport(n,t){if(d(n)===void 0)return;if(this.ctx.moduleExports.has(n)){let r=this.ctx.moduleExports.get(n);this.ctx.moduleExports.set(n,{...r,...t})}else this.ctx.moduleExports.set(n,t)}resolveExportSpecifier(n,t,r,o){let a=or(t.local),h=or(t.exported);if(!a||!h)return;if(n.source!=null)return{localName:a,exportedName:h};let T=Qo(r,a);if(!T&&o==="instance"){let D=this.ctx.parsed?.module;T=Qo(D,a)??Wa(r,a)}return{localName:a,exportedName:h,...T}}recordUnresolvedExportSpecifier(n,t,r){let o=n.source?.value,a=typeof o==="string"?`it re-exports from "${o}"`:this.ctx.valueImportBindingsByLocalName.has(t)?"it re-exports an imported binding":"no matching local declaration was found";Fe(this.ctx,"export-unresolved",r,`export "${r}" was skipped because ${a}; sveld only resolves exports of a local declaration.`,Me(this.ctx,n))}exportJSDoc(n,t){if(!t)return an(this.ctx,this,n);let r=n.specifiers.length===1?an(this.ctx,this,n):void 0,o=an(this.ctx,this,t.statement);if(!r||!o)return r??o;let a=Object.fromEntries(Object.entries(r).filter(([,h])=>h!==void 0));return{...o,...a,internal:r.internal||o.internal}}recordClassExport(n,t){Fe(this.ctx,"export-unresolved",t,`export "${t}" was skipped because a class can't be a prop; export it from the module script instead.`,Me(this.ctx,n))}dropUndeclaredClassBases(){let n=Array.from(this.ctx.moduleExports.values()).filter((r)=>r.kind==="class"),t=new Set(n.map((r)=>r.localName??r.name));for(let r of n){if(!r.extends)continue;let o=Ja.exec(r.extends)?.[0];if(o&&(t.has(o)||this.ctx.valueImportBindingsByLocalName.has(o)||this.ctx.typeImportBindingsByLocalName.has(o)))continue;Fe(this.ctx,"export-unresolved",r.name,`class "${r.name}" extends \`${r.extends}\`, which isn't imported or an exported class, so the .d.ts declares it without \`extends\` and its inherited members are missing. Export the base class from the module script.`,r.source),r.extends=void 0}}addModuleClassExport(n,t,r){let o=t.id?.name;if(!o)return;let a=r?.exportedName??o,h=this.exportJSDoc(n,r),{members:T,typeParameters:D,extends:S,implements:N}=Io(this.ctx,this,t),L=D??h?.typeParameters;this.addModuleExport(a,{name:a,...o===a?{}:{localName:o},kind:"class",description:h?.description,deprecated:h?.deprecated,tags:h?.tags,...h?.internal?{internal:!0}:{},type:`typeof ${o}`,...L?{typeParameters:L}:{},members:T,...t.abstract?{abstract:!0}:{},...S?{extends:S}:{},...N?{implements:N}:{},isFunction:!1,isFunctionDeclaration:!1,isRequired:!1,constant:!1,reactive:!1,source:Me(this.ctx,n)})}aliasType(n){if(n==="*")return"any";return n.trim()}findVariableTypeAndDescription(n){let t=this.getPropByLocalOrPublic(n);if(t?.type)return{type:t.type,description:t.description,internal:t.internal};let r=this.variableJsDocEntry(n),o=this.ctx.explicitVariableTypesByName.get(n);if(o)return{type:o,description:r?.description,internal:r?.internal};if(!r?.type)return null;return{type:r.type,description:r.description,internal:r.internal}}findVariableJsDoc(n){let t=this.variableJsDocEntry(n);return{...t?.description?{description:t.description}:{},...t?.internal?{internal:!0}:{}}}variableJsDocEntry(n){if(!this.ctx.variableInfoCacheBuilt)this.ctx.variableInfoCache=Zo(this.ctx,this),this.ctx.variableInfoCacheBuilt=!0;return this.ctx.variableInfoCache.get(n)}accumulateGeneric(n,t){if(this.ctx.generics)this.ctx.generics=[`${this.ctx.generics[0]}, ${n}`,`${this.ctx.generics[1]}, ${t}`];else this.ctx.generics=[n,t]}cleanup(){this.ctx=Zt()}static SCRIPT_BLOCK_REGEX=/(<script[^>]*>)([\s\S]*?)(<\/script>)/gi;static TS_DIRECTIVE_REGEX=/\/\/(?<!^[ \t]*\*.*\/\/)\s*@ts-[^\n\r]*/gm;static stripTypeScriptDirectivesFromScripts(n){if(!n.includes("@ts-"))return n;return s.SCRIPT_BLOCK_REGEX.lastIndex=0,n.replace(s.SCRIPT_BLOCK_REGEX,(t,r,o,a)=>{s.TS_DIRECTIVE_REGEX.lastIndex=0;let h=o.replace(s.TS_DIRECTIVE_REGEX,"");return r+h+a})}parseSvelteComponent(n,t){this.cleanup(),this.ctx.componentFilePath=t.filePath;let r=s.stripTypeScriptDirectivesFromScripts(n);this.ctx.source=r;let o=fe(r);if(Go(this,this.ctx,o),this.ctx.parsed=o,this.ctx.scriptLanguage==="ts")ft(this.ctx.parsed.module),ft(this.ctx.parsed.instance),ft(this.ctx.parsed.fragment);this.ctx.syntaxMode=$o(this.ctx);let a=this.ctx.parsed.css,h=a?.start!==void 0&&a?.end!==void 0?r.slice(0,a.start)+" ".repeat(a.end-a.start)+r.slice(a.end):r;he(this.ctx,this.ctx.parsed?.module),he(this.ctx,this.ctx.parsed?.instance),Xr(this.ctx,this,h);let T={type:"ComponentRoot",instance:this.ctx.parsed.instance,fragment:this.ctx.parsed.fragment};if(this.ctx.parsed?.module){let I=Ce(this.ctx.parsed.module),F=(J,O,V)=>{let ee=an(this.ctx,this,J);this.addModuleExport(O==="*"?`* from ${V.from}`:O,{name:O,kind:"re-export",description:ee?.description,deprecated:ee?.deprecated,tags:ee?.tags,...ee?.internal?{internal:!0}:{},isFunction:!1,isFunctionDeclaration:!1,isRequired:!1,constant:!1,reactive:!1,reExport:V,source:Me(this.ctx,J)})},q=(J)=>{Fe(this.ctx,"module-export-conflict","default",`export "default" was skipped because it collides with the component's own default export.`,Me(this.ctx,J))},oe=(J,O,V)=>{let ee=[];if(O.type==="FunctionDeclaration"){let ge=O;if(!ge.id?.name)return;let Ee=this.ctx.scriptLanguage==="ts"?xt(this.ctx,ge):void 0;ee.push({prop_name:V?.exportedName??ge.id.name,kind:"function",isFunctionDeclaration:!0,value:void 0,typeSeed:Ee?.hasAnnotations?void 0:"() => any",explicitType:Ee?.hasAnnotations?Ee.signature:void 0,initializerIsFunction:!0,defaultValue:void 0,inferredTypeForSource:void 0,resolvedJSDoc:void 0})}else if(O.type==="VariableDeclaration"){let ge=O,Ee=ei(ge.kind),ke=V?.declarator?[V.declarator]:ge.declarations;for(let Pe of ke){if(!Pe||typeof Pe!=="object"||!("id"in Pe))continue;let{id:pe,init:Ne}=Pe;if(!pe||typeof pe!=="object")continue;if(pe.type!=="Identifier"){for(let bn of Ge(pe)){if(V&&V.localName!==bn)continue;ee.push({prop_name:V?.exportedName??bn,kind:Ee,isFunctionDeclaration:!1,value:void 0,typeSeed:void 0,explicitType:void 0,initializerIsFunction:!1,defaultValue:void 0,inferredTypeForSource:void 0,resolvedJSDoc:void 0})}continue}let Qe=pe.name,Te=V?.exportedName??Qe,ze=Ne==null?{isFunction:!1}:xn(this,this.ctx,Ne),{value:en,type:Ke,isFunction:Xe,defaultValue:pn}=ze,wn=ze;Hn(this.ctx,ze,Te,"moduleExports"),ee.push({prop_name:Te,kind:Ee,isFunctionDeclaration:!1,value:en,typeSeed:Ke,explicitType:this.getExplicitPropType(Qe),initializerIsFunction:Xe,defaultValue:pn,inferredTypeForSource:Ke,resolvedJSDoc:wn})}if(ee.length===0)return}else{if(O.type==="ClassDeclaration")this.addModuleClassExport(J,O,V);return}let ce=this.exportJSDoc(J,V);for(let{prop_name:ge,kind:Ee,isFunctionDeclaration:ke,value:Pe,typeSeed:pe,explicitType:Ne,initializerIsFunction:Qe,defaultValue:Te,inferredTypeForSource:ze,resolvedJSDoc:en}of ee){let{type:Ke,typeSource:Xe,description:pn,params:wn,returnType:bn,isFunction:Mn,typeParameters:qn}=et({explicitType:Ne,typeSeed:pe,inferredTypeForSource:ze,jsdocType:ce?.type,jsdocDescription:ce?.description,jsdocParams:ce?.params,jsdocReturnType:ce?.returnType,jsdocTypeParameters:ce?.typeParameters,resolvedType:en?.resolvedType,resolvedDescription:en?.resolvedDescription,resolvedParams:en?.resolvedParams,resolvedReturnType:en?.resolvedReturnType,initializerIsFunction:Qe,isFunctionDeclaration:ke,typedefs:this.ctx.typedefs});this.addModuleExport(ge,{name:ge,kind:Ee,description:pn,deprecated:ce?.deprecated,tags:ce?.tags,...ce?.internal?{internal:!0}:{},type:Ke,typeSource:Xe,value:Pe,defaultValue:Te,params:wn,returnType:bn,typeParameters:qn,isFunction:Mn,isFunctionDeclaration:ke,isRequired:!1,constant:Ee==="const",reactive:!1,source:Me(this.ctx,J)})}};b(this.ctx.parsed?.module,(J,O)=>{if(J.type==="ImportDeclaration")ne(this.ctx,J);if(J.type==="FunctionDeclaration"){let V=J;if(V.id?.name)this.ctx.funcDecls.set(V.id.name,V)}if(J.type==="VariableDeclaration")this.ctx.vars.add(J);if(J.type==="ExportNamedDeclaration"){if(J.declaration!=null){oe(J,J.declaration);return}let V=J.source?.value;for(let ee of J.specifiers){let ce=this.resolveExportSpecifier(J,ee,O,"module");if(!ce)continue;if(ce.exportedName==="default"){q(J);continue}let ge=typeof V==="string"?{from:V,imported:ce.localName}:I.get(ce.localName);if(ce.declaration)oe(J,ce.declaration,ce);else if(ge)F(J,ce.exportedName,ge);else if(!this.ctx.localTypeDeclarationsByName.get(ce.localName)?.exported)this.recordUnresolvedExportSpecifier(J,ce.localName,ce.exportedName)}}if(J.type==="ExportAllDeclaration"&&typeof J.source.value==="string"){let V=(J.exported&&or(J.exported))??"*";if(V==="default"){q(J);return}F(J,V,{from:J.source.value,imported:"*"})}}),this.dropUndeclaredClassBases()}let D,S,N,L=new Set,R=new Set,_=[],X=[],K=[],Q=new Set;Sr(this,this.ctx),this.ctx.activeScopes.push(this.ctx.componentScope);let te=vr(this.ctx),Ue=(I,F,q)=>{let oe=[];if(F.type==="FunctionDeclaration"){let O=F;if(!O.id?.name)return;let V=q?.exportedName??O.id.name,ee=this.ctx.scriptLanguage==="ts"?xt(this.ctx,O):void 0;oe.push({prop_name:V,kind:"function",isFunctionDeclaration:!0,value:void 0,typeSeed:ee?.hasAnnotations?void 0:"() => any",explicitType:ee?.hasAnnotations?ee.signature:void 0,initializerIsFunction:!0,isRequired:!1,localName:O.id.name,defaultValue:void 0,inferredTypeForSource:void 0,resolvedJSDoc:void 0})}else if(F.type==="VariableDeclaration"){let O=F,V=ei(O.kind),ee=q?.declarator?[q.declarator]:O.declarations;for(let ce of ee){if(!ce||typeof ce!=="object"||!("id"in ce))continue;let{id:ge,init:Ee}=ce;if(!ge||typeof ge!=="object")continue;if(ge.type!=="Identifier"){for(let Xe of Ge(ge)){if(q&&q.localName!==Xe)continue;oe.push({prop_name:q?.exportedName??Xe,kind:V,isFunctionDeclaration:!1,value:void 0,typeSeed:void 0,explicitType:void 0,initializerIsFunction:!1,isRequired:!1,localName:Xe,defaultValue:void 0,inferredTypeForSource:void 0,resolvedJSDoc:void 0})}continue}let ke=ge.name,Pe=q?.exportedName??ke,pe=V==="let"&&Ee==null,Ne=Ee==null?{isFunction:!1}:xn(this,this.ctx,Ee),{value:Qe,type:Te,isFunction:ze,defaultValue:en}=Ne,Ke=Ne;Hn(this.ctx,Ne,Pe,"props"),oe.push({prop_name:Pe,kind:V,isFunctionDeclaration:!1,value:Qe,typeSeed:Te,explicitType:this.getExplicitPropType(ke),initializerIsFunction:ze,isRequired:pe,localName:ke,defaultValue:en,inferredTypeForSource:Te,resolvedJSDoc:Ke})}if(oe.length===0)return}else{if(F.type==="ClassDeclaration"&&F.id)this.recordClassExport(I,q?.exportedName??F.id.name);return}let J=this.exportJSDoc(I,q);for(let{prop_name:O,kind:V,isFunctionDeclaration:ee,value:ce,typeSeed:ge,explicitType:Ee,initializerIsFunction:ke,isRequired:Pe,localName:pe,defaultValue:Ne,inferredTypeForSource:Qe,resolvedJSDoc:Te}of oe){let{type:ze,typeSource:en,description:Ke,params:Xe,returnType:pn,isFunction:wn,typeParameters:bn}=et({explicitType:Ee,typeSeed:ge,inferredTypeForSource:Qe,jsdocType:J?.type,jsdocDescription:J?.description,jsdocParams:J?.params,jsdocReturnType:J?.returnType,jsdocTypeParameters:J?.typeParameters,resolvedType:Te?.resolvedType,resolvedDescription:Te?.resolvedDescription,resolvedParams:Te?.resolvedParams,resolvedReturnType:Te?.resolvedReturnType,initializerIsFunction:ke,isFunctionDeclaration:ee,typedefs:this.ctx.typedefs});En(this.ctx,"prop-unknown-type",O,J?.sveldIgnore),Bn(this,this.ctx,O,{name:O,...pe!==void 0&&pe!==O?{localName:pe}:{},kind:V,description:Ke,binding:J?.binding,deprecated:J?.deprecated,tags:J?.tags,...J?.internal?{internal:!0}:{},type:ze,typeSource:en,value:ce,defaultValue:Ne,params:Xe,returnType:pn,typeParameters:bn,isFunction:wn,isFunctionDeclaration:ee,isRequired:Pe,constant:V==="const",reactive:this.ctx.reactive_vars.has(O),source:Me(this.ctx,I)})}};b(T,(I,F,q)=>{let oe=Cr(this,this.ctx,te,I);if(oe)this.ctx.activeScopes.push(oe);let J=I.type;if(!Xa.has(J))return;if(I.type==="AssignmentExpression")Pt(this.ctx,I.left);if(I.type==="UpdateExpression")Pt(this.ctx,I.argument);if(I.type==="CallExpression"){let O=I,V=O.callee&&typeof O.callee==="object"&&"name"in O.callee?O.callee.name:void 0;if(V==="createEventDispatcher"){if(F&&typeof F==="object"&&"id"in F&&F.id&&typeof F.id==="object"&&"name"in F.id)D=F.id.name,S=F;N=O.typeArguments?.params?.[0]}if(V==="$host"){if(F&&typeof F==="object"&&"id"in F&&F.id&&typeof F.id==="object"&&"name"in F.id)L.add(F.id.name)}if(V==="setContext")Ir(this.ctx,this,I,F??void 0);if(O.arguments.length>0){if(K.push(O),at(this.ctx,O.callee))Q.add(O)}if(V)X.push({name:V,arguments:O.arguments,node:O,nestedBoundDetailNames:zn(this.ctx,O.arguments[1])});if(M(O.callee)&&e(O.callee.property)&&O.callee.property.name==="dispatchEvent"&&(g(O.callee.object,"$host")||e(O.callee.object)&&L.has(O.callee.object.name))){let ee=Or(this.ctx,O);if(ee)R.add(ee.name),_.push(ee)}}if(J==="SpreadAttribute"){let O=I;if(O.expression?.name==="$$restProps"||this.ctx.restPropLocals.has(O.expression?.name??""))jo(this.ctx,F)}if(I.type==="FunctionDeclaration"){let O=I;if(O.id?.name)this.ctx.funcDecls.set(O.id.name,O)}if(I.type==="ImportDeclaration")ne(this.ctx,I);if(I.type==="VariableDeclaration"){if(this.ctx.vars.add(I),F&&typeof F==="object"&&"type"in F&&F.type==="Program"&&I.declarations.some((O)=>g(x(O.init),"$props")))Uo(this,this.ctx,I)}if(I.type==="ExportNamedDeclaration"){if(I.declaration!=null){Ue(I,I.declaration);return}for(let O of I.specifiers){let V=this.resolveExportSpecifier(I,O,F,"instance");if(!V)continue;if(V.declaration)Ue(I,V.declaration,V);else this.recordUnresolvedExportSpecifier(I,V.localName,V.exportedName)}}if(J==="Comment"){let V=I?.data?.trim()??"";if(ti.test(V))this.ctx.componentComment=V.replace(ti,"").replace(za,""),this.ctx.componentCommentSource=Me(this.ctx,I)}if(J==="SlotElement"){let O=I,V=O.attributes?.find((Ee)=>Ee.name==="name")?.value,ee=(Array.isArray(V)?V[0]:void 0)?.data,ce=(O.attributes||[]).filter((Ee)=>Ee.name!=="name").reduce((Ee,ke)=>{let Pe={value:void 0,replace:!1},pe=ke.value;if(pe===void 0||pe===!0)return Ee;let Ne=Array.isArray(pe)?pe[0]:pe;if(Ne){let{type:Qe,expression:Te,raw:ze,start:en,end:Ke}=Ne;if(Qe==="Text"&&ze!==void 0)Pe.value=JSON.stringify(ze);else if(!Array.isArray(pe)&&Qe==="ExpressionTag"&&Te&&typeof Te==="object"&&"type"in Te&&Te.type==="Identifier"&&"name"in Te&&Te.name===ke.name)Pe.value=Te.name,Pe.replace=!0;if(Te&&typeof Te==="object"&&"type"in Te){if(Te.type==="Literal"&&"value"in Te){let Xe=Te.value;Pe.value=typeof Xe==="string"?JSON.stringify(Xe):String(Xe)}else if(Te.type==="MemberExpression")Pe.value=pt(this.ctx,this,Te);else if(Te.type!=="Identifier"){if(en!==void 0&&Ke!==void 0){if(Te.type==="ObjectExpression"||Te.type==="TemplateLiteral")Pe.value=je(this.ctx,en+1,Ke-1)}}}}if(ke.name)Ee[ke.name]=Pe;return Ee},{}),ge=O.fragment?.nodes?.map(({start:Ee,end:ke})=>{if(Ee===void 0||ke===void 0)return"";return je(this.ctx,Ee,ke)??""}).join("").trim();Xn(this.ctx,{slot_name:ee,slot_props:ce,slot_fallback:ge,source:Me(this.ctx,I)})}if(J==="RenderTag"){let O=I,V=Vr(this.ctx,O.expression);if(V){let ee,ce=!1;if(V.arguments.length===0)ee={};else if(V.arguments.length===1&&typeof V.arguments[0]==="object"&&V.arguments[0]&&"type"in V.arguments[0]&&V.arguments[0].type==="ObjectExpression"){let ke=At(this.ctx,this,V.arguments[0]);ee=ke.slot_props,ce=ke.hasUnresolvedSpread}let ge=V.publicName==="children"?void 0:V.publicName,Ee=ge===void 0?ni:ge;if(ee!==void 0)Xn(this.ctx,{slot_name:ge,slot_props:ee,slot_props_unresolved_spread:ce||void 0,source:Me(this.ctx,I)});if(ee!==void 0||this.ctx.slots.has(Ee))this.ctx.snippetPropLocals.add(V.trackingName)}}if(J==="OnDirective"){let O=I;if(O.expression==null&&O.name){if(F!=null&&typeof F==="object"&&"name"in F){let V=typeof F.name==="string"?F.name:void 0,ee="type"in F?String(F.type):void 0;if(V&&ee){let ce=Zn(ee)?{type:"InlineComponent",name:V}:{type:"Element",name:V};this.ctx.forwardedEvents.set(O.name,ce);let ge=this.ctx.events.get(O.name),Ee=this.ctx.eventDescriptions.get(O.name),ke=ge?.deprecated,Pe=ge?.internal;if(!ge)this.ctx.events.set(O.name,{type:"forwarded",name:O.name,element:ce,description:Ee,deprecated:ke,...Pe?{internal:!0}:{},source:Me(this.ctx,I)});else if(ge.type==="forwarded"&&Ee&&!ge.description)this.ctx.events.set(O.name,{...ge,description:Ee,deprecated:ge.deprecated??ke,...ge.internal||Pe?{internal:!0}:{},source:ge.source||Me(this.ctx,I)})}}}}if(J==="BindDirective"&&F&&typeof F==="object"&&"type"in F&&(Qn(String(F.type))||Zn(String(F.type)))){let O=I;if(O.expression?.name){let V=Un(this.ctx,O.expression.name);if(V)this.ctx.reactive_vars.add(V)}if(Qn(String(F.type))&&O.name==="this"&&O.expression?.name&&"name"in F&&typeof F.name==="string"){let V=Un(this.ctx,O.expression.name);if(!V)return;let ee=F.name;if(this.ctx.bindings.has(V)){let ce=this.ctx.bindings.get(V);if(ce&&!ce.elements.includes(ee))this.ctx.bindings.set(V,{...ce,elements:[...ce.elements,ee]})}else this.ctx.bindings.set(V,{elements:[ee]})}}},(I)=>{if(Jn(I))this.ctx.activeScopes.pop(),Pr(te,I)},{skipTypeOnlySubtrees:!0});for(let I of _)qr(this,this.ctx,I);if(D!==void 0){Jo(this,this.ctx,N,D,Me(this.ctx,S));for(let I of X)if(I.name===D){let F=I.arguments[0],q=F&&typeof F==="object"&&"value"in F?F.value:void 0,oe=I.arguments[1],J=kt(Dt(this,this.ctx,I.nestedBoundDetailNames),oe),O=J===void 0&&oe&&typeof oe==="object"&&"value"in oe?oe.value:void 0,V=O===null&&oe.raw==="null";if(q!=null)Dn(this.ctx,{name:String(q),detail:J??(V?"null":O==null?"":le(O)),has_argument:Boolean(oe),source:Me(this.ctx,I.node)})}}let Oe=new Set(R);if(D!==void 0){for(let I of X)if(I.name===D){let F=I.arguments[0],q=F&&typeof F==="object"&&"value"in F?F.value:void 0;if(q!=null)Oe.add(String(q))}}this.ctx.forwardedEvents.forEach((I,F)=>{let q=this.ctx.events.get(F);if(q&&q.type==="dispatched"&&!Oe.has(F)){let oe=this.ctx.eventDescriptions.get(F),J={type:"forwarded",name:F,element:I,description:oe,deprecated:q.deprecated,tags:q.tags,source:q.source};if(q.internal)J.internal=!0;if(q.detail!==void 0&&q.detail!=="undefined")J.detail=q.detail;this.ctx.events.set(F,J)}}),zo(this.ctx,Oe);let ue=this.ctx.syntaxMode==="runes"?new Set(Array.from(this.ctx.snippetPropLocals,(I)=>this.resolvePublicPropName(I))):new Set,$e=s.mapToArray(this.ctx.props).filter((I)=>!(ue.has(I.name)&&this.ctx.slots.has(I.name==="children"?ni:I.name))).map((I)=>{if(this.ctx.bindings.has(I.name)){let F=this.ctx.bindings.get(I.name)?.elements.sort().map((q)=>No(q)).join(" | ");return{...I,type:`null | ${F}`,typeSource:"inferred",reactive:I.reactive||this.ctx.reactive_vars.has(I.name)}}return{...I,reactive:I.reactive||this.ctx.reactive_vars.has(I.name)}});this.ctx.activeScopes.length=0;let we=s.mapToArray(this.ctx.slots).map((I)=>{let{slot_props_unresolved_spread:F,...q}=I;if(!I.slot_props)return q;if(typeof I.slot_props==="string")return Ka.test(I.slot_props)?{...q,slot_props:"Record<string, never>"}:q;let oe=I.slot_props,J=[];for(let ee of Object.keys(oe)){if(oe[ee].replace&&oe[ee].value!==void 0)oe[ee].value=this.getPropTypeByLocalOrPublic(oe[ee].value);if(oe[ee].value===void 0)oe[ee].value="any";J.push(`${ee}: ${oe[ee].value}`)}let O=F?" & Record<string, any>":"",V=J.length===0?F?"Record<string, any>":"Record<string, never>":J.length===1?`{ ${J[0]} }${O}`:`{
25
+ ${J.join(`;
26
+ `)};
27
+ }${O}`;return{...q,slot_props:V}}).sort((I,F)=>{let q=I.name??"",oe=F.name??"";if(q<oe)return-1;if(q>oe)return 1;return 0});if(this.ctx.deferredSlotBlockGenerics.length>0){let I=[...$e.map((F)=>F.type??""),...we.map((F)=>F.slot_props??"")].join(`
28
+ `);for(let{name:F,constraint:q}of this.ctx.deferredSlotBlockGenerics){let oe=F.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(!new RegExp(`\\b${oe}\\b`).test(I))continue;this.accumulateGeneric(F,q)}}if(this.ctx.scriptGenericsAttribute){if(this.ctx.generics)Fe(this.ctx,"syntax-skipped","generics",'Both the "generics" script attribute and @generics/@template JSDoc tags declare component generics; the script attribute takes precedence and the JSDoc declaration was ignored.',this.ctx.scriptGenericsAttribute.source);this.ctx.generics=Bo(this.ctx.scriptGenericsAttribute.value)}let Ie=s.mapToArray(this.ctx.moduleExports),_e=s.mapToArray(this.ctx.events).map((I)=>{switch(I.type){case"forwarded":return{...I,element:I.element.name};case"dispatched":return I;default:return I}}).sort(ie),gn=s.mapToArray(this.ctx.typedefs),cn=s.mapToArray(this.ctx.contexts),hn={props:new Map(this.ctx.pendingCallDefaultCandidates.filter((I)=>I.location==="props").map((I)=>[I.propName,I])),moduleExports:new Map(this.ctx.pendingCallDefaultCandidates.filter((I)=>I.location==="moduleExports").map((I)=>[I.propName,I]))};for(let I of $e)if(I.typeSource==="unknown"){let F=hn.props.get(I.name);if(F)I.type="any";let q=F?F.importSource?`Prop "${I.name}" default calls "${F.calleeName}()" imported from "${F.importSource}"; falling back to "any" pending cross-file resolution.`:`Prop "${I.name}" default calls "${F.calleeName}()", but its return type could not be inferred; falling back to "any".`:`Prop "${I.name}" type could not be inferred; falling back to "${I.type??"any"}".`;Fe(this.ctx,"prop-unknown-type",I.name,q,I.source)}for(let I of Ie)if(I.typeSource==="unknown"&&hn.moduleExports.has(I.name))I.type="any";let on=D,yn=[];if(on!==void 0){let I=[];for(let q of K){let oe=jr(q,on);if(oe)I.push({call:q,...oe})}if(I.length>0)En(this.ctx,"dispatch-escapes",on,this.resolveLocalVarJSDoc(on)?.sveldIgnore);let F=bt(this.ctx,"dispatch-escapes",on);for(let{call:q,argumentIndex:oe,property:J}of I){let O=Q.has(q)?void 0:me(this.ctx,q.callee);if(!O){yn.push(q);continue}let V=Me(this.ctx,q);this.ctx.pendingDispatchEscapeCandidates.push({importSource:O.source,importedName:O.importedName,...O.members?{members:O.members}:{},calleeText:fn(this.ctx,q.callee)??O.importedName,dispatcherName:on,argumentIndex:oe,...J===void 0?{}:{property:J},...V?{source:V}:{},...F?{ignored:F}:{}})}}for(let I of this.ctx.jsDocEventNames){if(Oe.has(I))continue;if(this.ctx.forwardedEvents.has(I))continue;if(this.ctx.props.has(`on${I}`))continue;if(yn.length>0)continue;let F=ht(this.ctx,"event-no-source",I,`@event "${I}" has no matching dispatch or callback prop.`,this.ctx.jsDocEventSources.get(I));if(this.ctx.pendingDispatchEscapeCandidates.length>0)this.ctx.deferredEventNoSourceDiagnostics.push(F);else this.ctx.diagnosticRecords.push(F)}for(let I of yn){let F=fn(this.ctx,I.callee)??"";Fe(this.ctx,"dispatch-escapes",on??"",`\`${on}\` is passed to \`${F}\`, which sveld can't follow: it only reads a function imported from another module, by name, as its default export, or through a namespace import. Document the events dispatched there with @event tags.`,Me(this.ctx,I))}if(this.ctx.rest_props?.type==="InlineComponent")Fe(this.ctx,"rest-props-unresolved","$$restProps",`$$restProps is only spread onto component "${this.ctx.rest_props.name}"; sveld cannot infer its rest-prop type. Spread onto a plain element or add an @restProps tag.`);let Ze=gn.filter((I)=>I.internal).map((I)=>I.name.split("<")[0]);if(Ze.length>0){let I=Ze.map((q)=>({name:q,regex:new RegExp(`\\b${q}\\b`)})),F=(q,oe,J)=>{if(!oe)return;for(let{name:O,regex:V}of I){if(!V.test(oe))continue;Fe(this.ctx,"internal-typedef-referenced",q,`"${q}" references "${O}", which is @internal and excluded from output; the generated .d.ts will contain a dangling reference to it.`,J)}};for(let q of $e){if(q.internal)continue;F(q.name,q.type,q.source)}for(let q of Ie){if(q.internal)continue;F(q.name,q.type,q.source)}for(let q of gn){if(q.internal)continue;F(q.name,q.ts)}for(let q of _e){if(q.internal||q.type!=="dispatched")continue;F(q.name,q.detail,q.source)}for(let q of we){if(q.internal)continue;F(q.name??"default",q.slot_props,q.source)}for(let q of cn){if(q.internal)continue;if(q.type!==void 0)F(q.typeName,q.type,q.source);for(let oe of q.properties)F(oe.name,oe.type)}}let Cn={source:rt(this.ctx,0,this.ctx.source?.length),syntaxMode:this.ctx.syntaxMode,...this.ctx.scriptLanguage?{scriptLanguage:this.ctx.scriptLanguage}:{},props:$e,moduleExports:Ie,slots:we,events:_e,typedefs:gn,generics:this.ctx.generics,rest_props:this.ctx.rest_props,extends:this.ctx.extends,componentComment:this.ctx.componentComment,componentCommentSource:this.ctx.componentCommentSource,contexts:cn,customElementTag:this.ctx.customElementTag,customElement:this.ctx.customElement,...this.ctx.cssParts.length>0?{cssParts:this.ctx.cssParts.slice()}:{},...this.ctx.cssProperties.length>0?{cssProperties:this.ctx.cssProperties.slice()}:{},diagnostics:this.ctx.diagnosticRecords.slice()},Pn=fr(this.ctx);if(Pn)Cn[P]=Pn;return Cn}}
29
+ export{Ae,le,Re,Le,W,fe,s};
@@ -0,0 +1,4 @@
1
+ import{r,e,f,T,i,b,t,ce,h,pe,U,Q,S,_}from"./chunk-f8nq2w4s.js";import{k}from"./chunk-81w3m3mq.js";import{lstatSync as ae,readFileSync as de}from"node:fs";import{basename as le,dirname as j,join as ne,resolve as ue}from"node:path";var fe=[".ts",".d.ts",".mts",".cts"],me=["index.ts","index.d.ts"],ye=10,ge=/^\s*(?:export\s+)?(?:declare\s+)?(?:type|interface)\s+([A-Za-z_$][\w$]*)/,ke=/^[aeiou]/,be=new Set(["svelte","svelte/elements"]);function z(n){return be.has(n)}function V(n,s){let a=j(s),o;if(n.startsWith(".")||n.startsWith("/"))o=ue(a,n);else{let u=U(n,a);if(u.unresolved)return{kind:"bare"};o=u.resolved}let l=j(o),d=le(o);if(h(l,d)){let u=ce(l,d);if(u?u.isFile():ae(o,{throwIfNoEntry:!1})?.isFile())return o.endsWith(".svelte")?{kind:"svelte"}:{kind:"resolved",path:o}}if(h(l,`${d}.svelte`))return{kind:"svelte"};for(let u of fe)if(h(l,`${d}${u}`))return{kind:"resolved",path:`${o}${u}`};for(let u of me)if(h(o,u))return{kind:"resolved",path:ne(o,u)};let p=pe(o);return p?{kind:"resolved",path:p}:{kind:"missing"}}function te(n){return`${ke.test(n)?"an":"a"} ${n}`}function y(n){return r(n)&&typeof n.type==="string"?n:void 0}function A(n){if(!Array.isArray(n))return[];let s=[];for(let a of n){let o=y(a);if(o)s.push(o)}return s}function w(n){if(!n)return;if(e(n))return n.name;return f(n)??void 0}function x(n){return f(n)??void 0}function G(n,s){let a=n.files.get(s);if(a!==void 0)return a;let o;try{let l=de(s,"utf-8"),d=k(l,!0,[]);o={source:l,program:d}}catch{o=null}return n.files.set(s,o),o}function he(n){let s=n;while(s?.type==="TSQualifiedName")s=y(s.left);return s?w(s):void 0}function Ne(n){let s=new Set,a=[],o=(l)=>{if(l.type!=="TSTypeReference")return;let d=he(y(l.typeName));if(d&&!s.has(d))s.add(d),a.push(d)};for(let l in n){if(l==="id"||l==="typeParameters")continue;let d=n[l];if(Array.isArray(d))for(let p of d){let u=y(p);if(u)b(u,o)}else{let p=y(d);if(p)b(p,o)}}return a}function Se(n){let s=new Set,a=y(n.typeParameters);for(let o of A(a?.params)){let l=w(y(o.name));if(l)s.add(l)}return s}function q(n,s){for(let a of n.body){let o=a.type==="ExportNamedDeclaration"?y(a.declaration)??a:a;switch(o.type){case"TSTypeAliasDeclaration":if(w(y(o.id))===s)return{kind:"type",node:o};break;case"TSInterfaceDeclaration":if(w(y(o.id))===s)return{kind:"interface",node:o};break;case"TSEnumDeclaration":if(w(y(o.id))===s)return{kind:"unsupported",reason:"enum"};break;case"ClassDeclaration":if(w(y(o.id))===s)return{kind:"unsupported",reason:"class"};break;case"FunctionDeclaration":if(w(y(o.id))===s)return{kind:"unsupported",reason:"function"};break;case"TSModuleDeclaration":if(w(y(o.id))===s)return{kind:"unsupported",reason:"namespace"};break;case"VariableDeclaration":for(let l of A(o.declarations))if(w(y(l.id))===s)return{kind:"unsupported",reason:"const"};break;default:break}}return}function ve(n,s){for(let a of n.body){if(a.type!=="ImportDeclaration")continue;let o=x(y(a.source));if(o===void 0)continue;for(let l of A(a.specifiers)){let d=y(l.local),p=w(d);if(p!==s)continue;if(l.type==="ImportNamespaceSpecifier")return{kind:"namespace"};let u=typeof d?.start==="number"?d.start:void 0;if(l.type==="ImportDefaultSpecifier")return{kind:"named",source:o,importedName:"default",localNameStart:u};if(l.type==="ImportSpecifier")return{kind:"named",source:o,importedName:w(y(l.imported))??p,localNameStart:u}}}return}function J(n,s){return`${n}\x00${s}`}function we(n,s){let a=new Set,o=[];for(let l of n){let d;try{d=k(l,!0,[])}catch{continue}for(let p of d.body){if(p.type!=="ImportDeclaration")continue;let u=x(y(p.source));if(u===void 0||z(u))continue;if(V(u,s).kind!=="bare")continue;for(let c of A(p.specifiers)){if(c.type==="ImportNamespaceSpecifier")continue;let g=c.type==="ImportDefaultSpecifier"?"default":w(y(c.imported))??void 0;if(!g)continue;let m=J(u,g);if(a.has(m))continue;a.add(m),o.push({source:u,importedName:g})}}}return o}function $e(n,s){return t(ne(j(n),`__sveld_inline_all_${s}.ts`))}function re(n,s,a){let o=we(a,n);if(o.length===0)return null;let l=o.map(({source:c,importedName:g},m)=>`import type { ${g} as __sveld_bare_${m} } from ${JSON.stringify(c)};`),d=new Map,p=`${l.join(`
2
+ `)}
3
+ `;return o.forEach(({source:c,importedName:g},m)=>{p+=`type __sveld_ref_${m} = `,d.set(J(c,g),p.length),p+=`__sveld_bare_${m};
4
+ `}),{virtualFile:$e(n,s),content:p,positions:d}}function Xe(n,s){let a=new Map;for(let o of n.values()){let l=T(o)?.typeImportStatements??[];if(l.length===0)continue;let d=re(s(o.filePath),o.moduleName,l);if(d)a.set(d.virtualFile,d.content)}return a}function Y(n){switch(n.type){case"TSTypeAliasDeclaration":return{kind:"type"};case"TSInterfaceDeclaration":return{kind:"interface"};case"TSEnumDeclaration":return{reason:"enum"};case"ClassDeclaration":return{reason:"class"};case"FunctionDeclaration":return{reason:"function"};case"TSModuleDeclaration":return{reason:"namespace"};default:return{reason:n.type}}}function H(n,s,a,o,l){let d=`${s}#${a}`;if(l>ye||o.has(d))return{kind:"not-found"};o.add(d);let p=G(n,s);if(!p)return{kind:"not-found"};n.dependencies.add(s);for(let u of p.program.body){if(u.type==="ExportNamedDeclaration"){let c=y(u.declaration);if(!c)continue;if(c.type==="VariableDeclaration"){for(let m of A(c.declarations))if(w(y(m.id))===a)return{kind:"unsupported",reason:"const"};continue}if(w(y(c.id))!==a)continue;let g=Y(c);return"reason"in g?{kind:"unsupported",reason:g.reason}:{kind:"found",node:c,filePath:s,source:p.source}}if(u.type==="ExportDefaultDeclaration"&&a==="default"){let c=y(u.declaration);if(!c)return{kind:"not-found"};let g=Y(c);return"reason"in g?{kind:"unsupported",reason:g.reason}:{kind:"found",node:c,filePath:s,source:p.source}}}for(let u of p.program.body){if(u.type!=="ExportNamedDeclaration"||u.declaration)continue;for(let c of A(u.specifiers)){if(w(y(c.exported))!==a)continue;let g=w(y(c.local));if(!g)return{kind:"not-found"};if(!u.source){let v=q(p.program,g);if(!v)return{kind:"not-found"};if(v.kind==="unsupported")return v;return{kind:"found",node:v.node,filePath:s,source:p.source}}let m=x(y(u.source));if(m===void 0)return{kind:"not-found"};let O=V(m,s);if(O.kind!=="resolved")return{kind:"not-found"};return H(n,O.path,g,o,l+1)}}for(let u of p.program.body){if(u.type!=="ExportAllDeclaration"||y(u.exported))continue;let c=x(y(u.source));if(c===void 0)continue;let g=V(c,s);if(g.kind!=="resolved")continue;let m=H(n,g.path,a,o,l+1);if(m.kind!=="not-found")return m}return{kind:"not-found"}}function oe(n,s,a){let o=n.nameOwner.get(s);if(o!==void 0&&o!==a)return{ok:!1,reason:`"${s}" was already inlined from a different source`};if(n.reservedNames.has(s))return{ok:!1,reason:`"${s}" collides with a name the component's .d.ts already declares or imports`};return}function ee(n,s,a){if(a===s)return{ok:!0};let o=`alias#${a}`;if(n.textByKey.has(o))return{ok:!0};let l=oe(n,a,o);if(l)return l;return n.nameOwner.set(a,o),n.tx.keys.push(o),n.textByKey.set(o,`type ${a} = ${s};`),n.order.push(o),{ok:!0}}async function se(n,s,a){let o=await n.bareSession.resolveAt(s,a);if(o.kind==="default-lib")return{status:"left-alone"};if(o.kind==="unresolved")return{status:"unresolved"};let l=G(n,o.filePath);if(!l)return{status:"unlocatable",filePath:o.filePath,declaredName:o.declaredName};let d=q(l.program,o.declaredName);if(!d)return{status:"unlocatable",filePath:o.filePath,declaredName:o.declaredName};if(d.kind==="unsupported")return{status:"unsupported",reason:d.reason};return{status:"found",node:d.node,filePath:o.filePath,source:l.source}}async function K(n,s,a,o,l){let d=w(y(s.id)),{start:p,end:u}=s;if(!d||typeof p!=="number"||typeof u!=="number")return{ok:!1,reason:"has no name or source position"};let c=`${a}#${d}`;if(n.pending.has(c)||n.textByKey.has(c))return ee(n,d,l);let g=oe(n,d,c);if(g)return g;n.pending.add(c),n.nameOwner.set(d,c),n.tx.keys.push(c),n.dependencies.add(a);let m=Se(s),O=G(n,a);for(let v of Ne(s)){if(m.has(v)||v===d)continue;if(!O)continue;let R=q(O.program,v);if(R){if(R.kind==="unsupported")return n.pending.delete(c),{ok:!1,reason:`references "${v}", a ${R.reason} that cannot be inlined`};let D=await K(n,R.node,a,o,v);if(!D.ok)return n.pending.delete(c),D;continue}let P=ve(O.program,v);if(!P||P.kind==="namespace")continue;let F=V(P.source,a);if(F.kind==="resolved"){let D=H(n,F.path,P.importedName,new Set,0);if(D.kind==="not-found")return n.pending.delete(c),{ok:!1,reason:`references "${v}", which is not exported from "${P.source}"`};if(D.kind==="unsupported")return n.pending.delete(c),{ok:!1,reason:`references "${v}", a ${D.reason} that cannot be inlined`};let M=await K(n,D.node,D.filePath,D.source,v);if(!M.ok)return n.pending.delete(c),M;continue}if(F.kind!=="bare"||z(P.source)||!n.bareSession||P.localNameStart===void 0)continue;let I=await se(n,a,P.localNameStart);if(I.status==="left-alone")continue;if(I.status!=="found"){n.pending.delete(c);let D=I.status==="unresolved"?`which could not be resolved from "${P.source}"`:I.status==="unlocatable"?`which resolves to "${I.declaredName}" in "${I.filePath}", where sveld could not locate that declaration`:`a ${I.reason} that cannot be inlined`;return{ok:!1,reason:`references "${v}", ${D}`}}let C=await K(n,I.node,I.filePath,I.source,v);if(!C.ok)return n.pending.delete(c),C}return n.pending.delete(c),n.textByKey.set(c,o.slice(p,u).trim()),n.order.push(c),ee(n,d,l)}async function De(n,s,a,o){let l=H(n,s,a,new Set,0);if(l.kind==="not-found")return{ok:!1,reason:`"${a}" is not exported from "${s}"`};if(l.kind==="unsupported")return{ok:!1,reason:`"${a}" is ${te(l.reason)}, which cannot be inlined`};return K(n,l.node,l.filePath,l.source,o)}async function Ie(n,s,a,o){let l=n.barePlan?.positions.get(J(s,a));if(!n.bareSession||!n.barePlan||l===void 0)return{ok:!1,reason:`"${a}" is a package import that sveld could not verify`};let d=await se(n,n.barePlan.virtualFile,l);switch(d.status){case"left-alone":return{ok:!1,reason:`"${a}" resolves to a built-in TypeScript type, which cannot be inlined`};case"unresolved":return{ok:!1,reason:`"${a}" could not be resolved from "${s}"`};case"unlocatable":return{ok:!1,reason:`"${a}" resolves to "${d.declaredName}" in "${d.filePath}", where sveld could not locate that declaration`};case"unsupported":return{ok:!1,reason:`"${a}" is ${te(d.reason)}, which cannot be inlined`};case"found":return K(n,d.node,d.filePath,d.source,o);default:return d}}function Te(n){n.order.length=n.tx.orderStart;let s=new Set(n.tx.keys);for(let a of s)n.textByKey.delete(a);for(let[a,o]of n.nameOwner)if(s.has(o))n.nameOwner.delete(a)}function Ee(n,s,a){let o;try{o=k(n,!0,[])}catch{return{status:"kept",localNames:[]}}let l=o.body.filter((m)=>m.type==="ImportDeclaration"),d=l.flatMap((m)=>A(m.specifiers)),p=[];for(let m of d){let O=w(y(m.local));if(!O)continue;let v=m.type==="ImportDefaultSpecifier"?"default":w(y(m.imported))??O;p.push({importedName:v,localName:O})}let u=p.map(({localName:m})=>m);if(l.length===0||d.some((m)=>m.type==="ImportNamespaceSpecifier"))return{status:"kept",localNames:u};let c=x(y(l[0]?.source));if(c===void 0)return{status:"kept",localNames:u};let g=V(c,s);if(g.kind==="svelte")return{status:"kept",localNames:u};if(g.kind==="missing")return{status:"refused",localNames:u,failures:p.map(({localName:m})=>({name:m,reason:`"${c}" was not found on disk`}))};if(g.kind==="bare"&&(z(c)||!a))return{status:"kept",localNames:u};return{status:"attempt",localNames:u,names:p,sourceValue:c,resolution:g}}async function Oe(n,s){if(s.status!=="attempt")return s;let{names:a,sourceValue:o,resolution:l}=s;n.tx={orderStart:n.order.length,keys:[]};let d=[];for(let{importedName:p,localName:u}of a){let c=await(l.kind==="bare"?Ie(n,o,p,u):De(n,l.path,p,u));if(!c.ok)d.push({name:u,reason:c.reason})}if(d.length>0)return Te(n),{status:"refused",failures:d};return{status:"inlined"}}function Pe(n,s){let a=new Set;for(let d of n.typedefs)a.add(d.name);for(let d of n.contexts??[])a.add(d.typeName);let o=T(n);for(let d of[...o?.localTypeDeclarations??[],...o?.moduleTypeDeclarations??[]]){let p=ge.exec(d);if(p)a.add(p[1])}a.add(S(n.moduleName,s)),a.add(_(n.moduleName,s));let l=Q(n.moduleName);a.add(l),a.add(`${l}Component`);for(let d of Ce)a.add(d);return a}var Ce=["$Props","$RestProps","Component","ComponentConstructorOptions","ComponentInternals","HTMLAttributes","Snippet","SvelteComponent","SvelteComponentTyped","SvelteHTMLElements"];async function He(n,s,a,o){let l=new Map;return await Promise.all(Array.from(n.values()).map(async(d)=>{let u=T(d)?.typeImportStatements??[];if(u.length===0)return;let c=s(d.filePath),g=o?re(c,d.moduleName,u):null,m=u.map((E)=>Ee(E,c,o)),O=Pe(d,a);for(let E of m)if(E.status!=="attempt")for(let B of E.localNames)O.add(B);let v=new Map,R=new Set,P=()=>({files:v,reservedNames:new Set(O),nameOwner:new Map,textByKey:new Map,order:[],pending:new Set,dependencies:R,tx:{orderStart:0,keys:[]},bareSession:o,barePlan:g}),F=new Set,I=new Map,C,D;for(;;){C=P(),D=new Map;for(let N of I.keys())for(let W of m[N].localNames)C.reservedNames.add(W);let E=m.map((N,W)=>W).filter((N)=>!I.has(N)),B=[...E.filter((N)=>F.has(N)),...E.filter((N)=>!F.has(N))];for(let N of B){let W=await Oe(C,m[N]);if(D.set(N,W),W.status==="refused")for(let ie of m[N].localNames)C.reservedNames.add(ie)}let L=C.nameOwner,X=B.filter((N)=>D.get(N)?.status!=="inlined"&&m[N].localNames.some((W)=>L.has(W)));if(X.length===0)break;for(let N of X){let W=D.get(N);if(F.has(N))I.set(N,W?.status==="refused"?W.failures:[]);else F.add(N)}}let M=[],Z=(d.diagnostics??[]).filter((E)=>E.kind!=="types-inline-unresolved");for(let[E,B]of u.entries()){let L=D.get(E),X=L?.status==="refused"?L.failures:I.get(E);if(L?.status==="inlined")M.push(B);for(let N of X??[])Z.push(i({component:d.filePath,kind:"types-inline-unresolved",name:N.name,message:`Cannot inline "${N.name}": ${N.reason}.`}))}if(d.diagnostics=Z,M.length===0&&C.order.length===0)return;l.set(d.filePath,{droppedImportStatements:M,declarations:C.order.map((E)=>C.textByKey.get(E)??""),dependencies:Array.from(R)})})),l}export{$e as bareOverlayVirtualFilePath,Xe as collectBareImportOverlay,He as inlineLocalTypeImports};
@@ -0,0 +1 @@
1
+ import{Ae,le,Re,Le,W,fe,s}from"./chunk-fk1w3bnw.js";import{k}from"./chunk-81w3m3mq.js";export{s as ComponentParser,Ae as deriveLiteralDetailType,Le as extractJsDocDeprecatedAndTags,Re as extractJsDocReturnType,W as getCommentTags,le as literalDetailToTypeText,k as parseProgram,fe as parseSvelte};