sveld 0.36.7 → 0.36.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.
- package/lib/browser.d.ts +9 -0
- package/lib/browser.js +218 -218
- package/lib/chunk-0beysrt7.js +62 -0
- package/lib/chunk-26w7fg2w.js +13 -0
- package/lib/chunk-bbeezhqq.js +6 -0
- package/lib/chunk-cqkng6ys.js +7 -0
- package/lib/chunk-hpxd4cgm.js +1 -0
- package/lib/chunk-mdth9bg3.js +225 -0
- package/lib/chunk-n5cjh6db.js +1 -0
- package/lib/chunk-nrz6c5ew.js +10 -0
- package/lib/chunk-ptdfswsv.js +2 -0
- package/lib/chunk-syz2wqmb.js +3 -0
- package/lib/chunk-yzabyfqs.js +16 -0
- package/lib/cli-entry.js +1 -1
- package/lib/index.d.ts +9 -0
- package/lib/index.js +1 -1
- package/package.json +1 -1
- package/lib/chunk-02g49ekt.js +0 -13
- package/lib/chunk-0q7qnmx3.js +0 -2
- package/lib/chunk-4ndm4k55.js +0 -16
- package/lib/chunk-5x7ma2jx.js +0 -62
- package/lib/chunk-bjwm35xb.js +0 -1
- package/lib/chunk-c5sqd852.js +0 -1
- package/lib/chunk-fk94b2eb.js +0 -6
- package/lib/chunk-hytk5gv8.js +0 -225
- package/lib/chunk-jvqe4bt1.js +0 -3
- package/lib/chunk-tjthqdyw.js +0 -10
- package/lib/chunk-wn9w3zst.js +0 -7
package/lib/chunk-0q7qnmx3.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createRequire as s}from"node:module";var j=Object.create;var{getPrototypeOf:k,defineProperty:f,getOwnPropertyNames:l}=Object;var m=Object.prototype.hasOwnProperty;function n(a){return this[a]}var o,p,t=(a,b,c)=>{var g=a!=null&&typeof a==="object";if(g){var h=b?o??=new WeakMap:p??=new WeakMap,i=h.get(a);if(i)return i}c=a!=null?j(k(a)):{};let d=b||!a||!a.__esModule?f(c,"default",{value:a,enumerable:!0}):c;for(let e of l(a))if(!m.call(d,e))f(d,e,{get:n.bind(a,e),enumerable:!0});if(g)h.set(a,d);return d};var u=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports);var q=(a)=>a;function r(a,b){this[a]=q.bind(null,b)}var v=(a,b)=>{for(var c in b)f(a,c,{get:b[c],enumerable:!0,configurable:!0,set:r.bind(b,c)})};var x=s(import.meta.url);
|
|
2
|
-
export{t as ta,u as ua,v as va,x as wa};
|
package/lib/chunk-4ndm4k55.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
function b(w){return typeof w==="object"&&w!==null}function Bq(w){return b(w)&&w.type==="VariableDeclaration"&&Array.isArray(w.declarations)}function a(w){return b(w)&&w.type==="Literal"}function $w(w){return b(w)&&w.type==="Identifier"&&typeof w.name==="string"}function Mq(w){return b(w)&&w.type==="MemberExpression"}function Jw(w){return b(w)&&w.type==="ObjectExpression"&&Array.isArray(w.properties)}function Rw(w){return b(w)&&w.type==="CallExpression"}function Uq(w,q){if(!Rw(w))return!1;return!!w.callee&&b(w.callee)&&w.callee.type==="Identifier"&&w.callee.name===q}function Cw(w){if(b(w)&&(w.type==="TSAsExpression"||w.type==="TSSatisfiesExpression")&&"expression"in w)return Cw(w.expression);return w}function Oq(w){if(b(w)&&(w.type==="TSAsExpression"||w.type==="TSSatisfiesExpression")&&"typeAnnotation"in w)return w.typeAnnotation;return}function Sw(w){return b(w)&&w.type==="NewExpression"}function r(w,q){if(!Sw(w))return!1;return!!w.callee&&b(w.callee)&&w.callee.type==="Identifier"&&w.callee.name===q}var Iw=Symbol("sveld.parsedComponentTypeScriptMetadata");function Vq(w){return w[Iw]}function kq(w,q){if(q.length===0)return;let K=new Set(w.props.map((Z)=>Z.name));for(let Z of q){if(K.has(Z.name))continue;K.add(Z.name),w.props.push({name:Z.name,kind:"let",constant:!1,type:Z.type,typeSource:"typescript",...Z.description?{description:Z.description}:{},isFunction:Z.type.includes("=>"),isFunctionDeclaration:!1,isRequired:Z.isRequired,reactive:!1})}}var bw=/\w/;function hw(w,q){let K=w.trim();if(!K.startsWith("{")||!K.endsWith("}"))return;let Z=K.slice(1,-1),Q=[],$=0,J="";for(let z of Z)if(z==="{"||z==="<"||z==="("||z==="[")$++,J+=z;else if(z==="}"||z===">"||z===")"||z==="]")$--,J+=z;else if((z===";"||z===",")&&$===0)Q.push(J.trim()),J="";else J+=z;if(J.trim())Q.push(J.trim());for(let z of Q){if(!z.startsWith(q))continue;let H=z.slice(q.length);if(H.length>0&&bw.test(H[0]))continue;let j=H.trimStart();if(j.startsWith("?"))j=j.slice(1).trimStart();if(j.startsWith(":"))return j.slice(1).trim()}return}function Yw(w,q,K){let Z=K;if(Z.computed||Z.object?.type!=="Identifier"||Z.property?.type!=="Identifier")return;let Q=Z.object.name,$=Z.property.name;if(!Q||!$)return;if(w.wholePropsLocals.has(Q))return q.getPropTypeByLocalOrPublic($);let J=q.getPropTypeByLocalOrPublic(Q)??q.findVariableTypeAndDescription(Q)?.type;if(!J)return;return hw(J,$)}var Dw=/[\r\n]+/g;function _w(w){if(w.sourceLineStartOffsetsCache)return w.sourceLineStartOffsetsCache;let q=[0];if(w.source){let K=w.source.indexOf(`
|
|
2
|
-
`);while(K!==-1)q.push(K+1),K=w.source.indexOf(`
|
|
3
|
-
`,K+1)}return w.sourceLineStartOffsetsCache=q,q}function zw(w,q){if(!w.source||q<0||q>w.source.length)return;let K=_w(w),Z=0,Q=K.length-1;while(Z<=Q){let $=Math.floor((Z+Q)/2),J=K[$],z=K[$+1]??Number.POSITIVE_INFINITY;if(q<J)Q=$-1;else if(q>=z)Z=$+1;else return{line:$+1,column:q-J}}return}function Hw(w,q,K){if(q===void 0||K===void 0||K<q)return;let Z=zw(w,q),Q=zw(w,K);if(!Z||!Q)return;return{start:Z,end:Q}}function jw(w,q){if(!q||typeof q!=="object")return;let K="start"in q&&typeof q.start==="number"?q.start:void 0,Z="end"in q&&typeof q.end==="number"?q.end:void 0;return Hw(w,K,Z)}function n(w,q){if(!q||q.length===0)return;let K=[...q];while(K.length>1){let H=K[K.length-1];if(H.tag!==void 0||!H.raw.trim().endsWith("*/"))break;K.pop()}let Z=K[0],Q=Z.raw.indexOf(`@${Z.tag??""}`),$=Z.start+Math.max(Q,0),J=K[K.length-1],z=J.start+J.raw.length;return Hw(w,$,z)}function x(w,q,K){return w.source?.slice(q,K)}function Fq(w,q){if(!q||typeof q!=="object")return;let K="start"in q&&typeof q.start==="number"?q.start:void 0,Z="end"in q&&typeof q.end==="number"?q.end:void 0;if(K===void 0||Z===void 0)return;return x(w,K,Z)?.replace(Dw," ")}function v(w){return w===void 0||w===""?void 0:w}function Lw(w){return typeof w==="string"?JSON.stringify(w):String(w)}function t(w,{name:q,detail:K,has_argument:Z,description:Q,deprecated:$,tags:J,source:z}){if(q===void 0)return;let H=!Z&&!K?"null":v(K),j=Q,Y=w.events.get(q);if(Y?.type==="forwarded")w.events.set(q,{type:"dispatched",name:q,detail:H,description:j||Y.description,deprecated:$??Y.deprecated,tags:J??Y.tags,source:z||Y.source});else if(Y){let U=Y.tags??J;w.events.set(q,{...Y,detail:Y.detail===void 0?H:Y.detail,description:Y.description||j,deprecated:Y.deprecated??$,tags:U,source:z||Y.source})}else w.events.set(q,{type:"dispatched",name:q,detail:H,description:j,deprecated:$,tags:J,source:z})}function bq(w,q){let K=q.arguments[0],Z=r(K,"CustomEvent");if(!Z&&!r(K,"Event"))return;let Q=K.arguments[0],$=a(Q)?Q.value:void 0;if($==null)return;let J=Z?K.arguments[1]:void 0,z=!1,H;if(Jw(J)){let j=J.properties.find((Y)=>Y.type==="Property"&&$w(Y.key)&&Y.key.name==="detail");if(j?.type==="Property")z=!0,H=a(j.value)?j.value.value:void 0}return t(w,{name:String($),detail:H==null?"":Lw(H),has_argument:z,source:jw(w,q)}),String($)}function e(w,q,K=!1){if(w.length===0)return"null";let Z=w.map(({name:Q,type:$,description:J,optional:z,default:H})=>{let j=z?"?":"",Y=J||"";if(H&&Y)Y=`${Y} @default ${H}`;else if(H)Y=`@default ${H}`;if(Y){if(K)return`/** ${Y} */
|
|
4
|
-
${Q}${j}: ${$};`;return`/** ${Y} */ ${Q}${j}: ${$};`}return`${Q}${j}: ${$};`}).join(K?`
|
|
5
|
-
`:" ");return K?`{
|
|
6
|
-
${Z}
|
|
7
|
-
}`:`{ ${Z} }`}var vw=/[A-Za-z_$][\w$]*/g;function Ew(w,q){if(!q)return!1;let K=new Set(q[0].split(",").map((Z)=>Z.trim()));for(let[Z]of w.matchAll(vw))if(K.has(Z))return!0;return!1}function fw(w,q){if(q===void 0)return;return w.runesPropsDeclarationMetadataByDeclaratorStart.get(q)}function _q(w,q,K){return fw(w,q)?.props.get(K)}function Lq(w){if(!w||typeof w!=="object"||!("type"in w))return;if(w.type==="Identifier"&&"name"in w&&typeof w.name==="string")return w.name;if(w.type==="TSQualifiedName"&&"right"in w&&w.right&&typeof w.right==="object"&&"name"in w.right&&typeof w.right.name==="string")return w.right.name;return}function Ww(w){if(!w||typeof w!=="object"||!("type"in w))return;if(w.type==="Identifier"&&"name"in w&&typeof w.name==="string")return w.name;if(w.type==="TSQualifiedName"&&"left"in w&&w.left&&typeof w.left==="object")return Ww(w.left);return}function vq(w,q){let K=q?.start,Z=q?.end;if(K===void 0||Z===void 0)return;return x(w,K+1,Z)?.trim()}function Eq(w,q){let K=q?.start,Z=q?.end;if(K===void 0||Z===void 0)return;return x(w,K,Z)?.trim()}function D(w,q,K,Z,Q=new Set){if(!q?.type)return;switch(q.type){case"TSInterfaceDeclaration":D(w,{type:"TSTypeLiteral",members:q.body?.body},K,Z,Q);return;case"TSTypeAliasDeclaration":case"TSParenthesizedType":case"TSTypeAnnotation":D(w,q.typeAnnotation,K,Z,Q);return;case"TSIntersectionType":case"TSUnionType":for(let $ of q.types??[])D(w,$,K,Z,Q);return;case"TSTypeLiteral":for(let $ of q.members??[]){if($?.type!=="TSPropertySignature")continue;D(w,$.typeAnnotation?.typeAnnotation,K,Z,Q)}return;case"TSTypeReference":{let $=Ww(q.typeName);if($){if(w.typeImportBindingsByLocalName.has($))K.add($);let J=w.localTypeDeclarationsByName.get($);if(J&&!Q.has($))Z.add($),Q.add($),D(w,J.node,K,Z,Q),Q.delete($)}if("typeParameters"in q&&q.typeParameters&&typeof q.typeParameters==="object"){let J=q.typeParameters;for(let z of J.params??[])D(w,z,K,Z,Q)}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 $ of Object.values(q)){if(!$||typeof $!=="object")continue;if(Array.isArray($)){for(let J of $){if(!J||typeof J!=="object"||!("type"in J))continue;D(w,J,K,Z,Q)}continue}if("type"in $)D(w,$,K,Z,Q)}}function Nw(w,q){let K=new Map;for(let Z of Array.from(q).sort()){let Q=w.typeImportBindingsByLocalName.get(Z);if(!Q)continue;let $=K.get(Q.source)??{default:[],named:[],namespace:[]};if(Q.specifierType==="default")$.default.push(Q.localName);else if(Q.specifierType==="namespace")$.namespace.push(Q.localName);else $.named.push({imported:Q.importedName,local:Q.localName});K.set(Q.source,$)}return Array.from(K.entries()).sort(([Z],[Q])=>Z.localeCompare(Q)).map(([Z,Q])=>{if(Q.namespace.length>0)return Q.namespace.map((H)=>`import type * as ${H} from "${Z}";`).join(`
|
|
8
|
-
`);let $=Q.named.map(({imported:H,local:j})=>{if(!H||H===j)return j;return`${H} as ${j}`}),J=Q.default[0],z=$.length>0?`{ ${$.join(", ")} }`:"";if(J&&z)return`import type ${J}, ${z} from "${Z}";`;if(J)return`import type ${J} from "${Z}";`;return`import type ${z} from "${Z}";`})}function fq(w){let q=w.pendingCallDefaultCandidates.length>0?w.pendingCallDefaultCandidates.slice():void 0;if(w.typedRunesPropsDeclarations.length!==1)return q?{canonicalPropNames:[],localTypeDeclarations:[],typeImportStatements:[],pendingCallDefaultCandidates:q}:void 0;let[K]=w.typedRunesPropsDeclarations;if(!K.canonicalType)return q?{canonicalPropNames:[],localTypeDeclarations:[],typeImportStatements:[],pendingCallDefaultCandidates:q}:void 0;let Z=Array.from(K.referencedLocalTypes).map((Q)=>w.localTypeDeclarationsByName.get(Q)).filter((Q)=>Q!==void 0).sort((Q,$)=>Q.start-$.start).map((Q)=>Q.code);return{canonicalPropsType:K.canonicalType,canonicalPropNames:Array.from(K.props.keys()).sort(),localTypeDeclarations:Z,typeImportStatements:Nw(w,K.referencedImportedTypes),referencesComponentGenerics:Ew(K.canonicalType,w.generics),...q?{pendingCallDefaultCandidates:q}:{}}}var Tw=/^[A-Za-z_$][\w$]*/,xw=/[A-Za-z_$][\w$]*/g,Bw=/^(?:const|in|out)\s+/;function ww(w){let q=[],K=0,Z=0;for(let Q=0;Q<w.length;Q++){let $=w[Q];if($==="<"||$==="("||$==="["||$==="{")K++;else if($===">"||$===")"||$==="]"||$==="}")K=Math.max(K-1,0);else if($===","&&K===0)q.push(w.slice(Z,Q)),Z=Q+1}return q.push(w.slice(Z)),q}function xq(w){let q=ww(w).map((Z)=>Z.trim()).filter((Z)=>Z.length>0);if(q.length===0)return null;return[q.map((Z)=>{let Q=Z;while(Bw.test(Q))Q=Q.replace(Bw,"");return Q.match(Tw)?.[0]??Z}).join(", "),q.join(", ")]}function yq(w,q,K){let Z=w.scriptGenericsAttribute?.value;if(!Z)return;for(let[Q]of Z.matchAll(xw)){if(w.typeImportBindingsByLocalName.has(Q))q.add(Q);if(K.has(Q))continue;let $=w.localTypeDeclarationsByName.get(Q);if(!$)continue;K.add(Q),D(w,$.node,q,K)}}var yw=null;function uw(w,q,K){let Z={value:void 0,replace:!1};if(!K||typeof K!=="object"||!("type"in K))return Z;if(K.type==="Identifier")Z.value=K.name,Z.replace=!0;else if(K.type==="Literal")Z.value=String(K.value);else if(K.type==="MemberExpression")Z.value=Yw(w,q,K);else if((K.type==="ObjectExpression"||K.type==="TemplateLiteral")&&"start"in K&&"end"in K&&typeof K.start==="number"&&typeof K.end==="number")Z.value=x(w,K.start,K.end);return Z}function dq(w,q,K){let Z={};for(let Q of K.properties){if(Q.type!=="Property"||Q.computed)continue;let $=q.getPropertyName(Q.key);if(!$)continue;Z[$]=uw(w,q,Q.value)}return Z}function gw(w,q){if(!q||typeof q!=="object"||!("type"in q))return null;if(q.type==="Identifier"){let $=q,J=w.propLocalToPublicName.get($.name);if(!J)return null;return{publicName:J,trackingName:$.name}}if(q.type!=="MemberExpression")return null;let K=q,Z=K.object&&typeof K.object==="object"&&"type"in K.object&&K.object.type==="Identifier"?K.object.name:void 0;if(!Z||!w.wholePropsLocals.has(Z))return null;let Q;if(!K.computed&&K.property&&typeof K.property==="object"&&"type"in K.property){if(K.property.type==="Identifier")Q=K.property.name;else if(K.property.type==="Literal"&&K.property.value!=null)Q=String(K.property.value)}else if(K.computed&&K.property&&typeof K.property==="object"&&"type"in K.property&&K.property.type==="Literal"&&"value"in K.property&&K.property.value!=null)Q=String(K.property.value);if(!Q)return null;return{publicName:Q,trackingName:Q}}function pq(w,q){let K=q;if(K&&typeof K==="object"&&"type"in K&&K.type==="ChainExpression")K=K.expression;if(!K||typeof K!=="object"||!("type"in K)||K.type!=="CallExpression")return null;let Z=K;if(!Z.callee||typeof Z.callee!=="object"||!("type"in Z.callee))return null;let Q=gw(w,Z.callee);if(!Q)return null;return{...Q,arguments:Z.arguments}}function Mw(w,{slot_name:q,slot_props:K,slot_fallback:Z,slot_description:Q,slot_deprecated:$,slot_tags:J,source:z}){let H=q===void 0||q==="",j=H?yw:q??"",Y=v(Z),U=K===void 0||K===""?void 0:K,S=Q?.trim()||void 0;if(w.slots.has(j)){let V=w.slots.get(j);if(V)w.slots.set(j,{...V,default:V.default??H,fallback:Y,slot_props:V.slot_props===void 0?U:V.slot_props,description:V.description||S,deprecated:V.deprecated??$,tags:V.tags||J,source:z||V.source})}else w.slots.set(j,{name:j,default:H,fallback:Y,slot_props:K,description:S,deprecated:$,tags:J,source:z})}var lw=/\n/,mw=/\r$/,y=/^\s+/,dw=/\s/,pw=/^@[^\s/]+(?=\s|$)/,cw=/^@(\S+)\s*/;function iw(w){let q=[],K=0;for(let Z of w.split(lw))q.push({text:Z.replace(mw,""),start:K}),K+=Z.length+1;return q}function ow(w,q){let K=w.replace(y,""),Z=!1;if(q)K=K.slice(3),Z=!0;else if(K.startsWith("*")&&!K.startsWith("*/"))K=K.slice(1),Z=!0;let Q=K.match(y)?.[0]??"";K=K.slice(Q.length);let $=K.trimEnd(),J=$.endsWith("*/")?$.slice(0,-2):K;return{indent:Z?Q.slice(1):Q,separator:Q,content:J}}function sw(w){let q=[],K=iw(w),Z=null,Q=0;for(let $ of K){if(Z===null){let j=$.text.replace(y,"");if(!j.startsWith("/**")||j.startsWith("/***"))continue;Z=[],Q=$.start+($.text.length-j.length)}let{indent:J,separator:z,content:H}=ow($.text,Z.length===0);if(Z.push({raw:$.text,start:$.start,number:Z.length,indent:J,separator:z,content:H}),$.text.trimEnd().endsWith("*/"))q.push({start:Q,lines:Z}),Z=null}return q}function aw(w){let q=w;if(q.length>0&&q[0].content==="")q=q.slice(1);if(q.length>0&&q[q.length-1].content==="")q=q.slice(0,-1);return q}function rw(w){let q=[[]],K=!1;for(let Z of w){if(pw.test(Z.content)&&!K)q.push([Z]);else q[q.length-1].push(Z);if(Z.content.split("```").length%2===0)K=!K}return q}function Uw(w){return w.map((q)=>q.indent+q.content).join(`
|
|
9
|
-
`)}function nw(w,q){let K=q;while(K<w.length-1&&w[K].content.trim()==="")K++;if(w[K].content[0]!=="{")return null;let Z=0,Q=[],$=K;for(;$<w.length;$++){let H=w[$].content,j=0;for(let Y of H){if(Y==="{")Z++;else if(Y==="}")Z--;if(j++,Z===0)break}if(Q.push(j),Z===0)break}if(Z!==0)return null;let J=$;return{type:Q.map((H,j)=>{let Y=K+j,U=w[Y].content.slice(0,H);return w[Y].content=w[Y].content.slice(H).replace(y,""),j===0?U:w[Y].indent+U}).join(`
|
|
10
|
-
`).slice(1,-1),endIndex:J}}function tw(w){let q=w.content.match(y)?.[0]??"",K=w.content.slice(q.length),Z=0,Q=0;for(let j of K){if(Z===0&&dw.test(j))break;if(j==="[")Z++;if(j==="]")Z--;Q++}let $=Z===0?K.slice(0,Q):"";if(!$)return null;let J=$,z=!1,H;if($.startsWith("[")&&$.endsWith("]")){z=!0;let Y=$.slice(1,-1).split("=");if(J=Y[0].trim(),Y.length>1)H=Y.slice(1).join("=").trim();if(!J)return null}if(J.length>1&&(J[0]==='"'||J[0]==="'")&&J[J.length-1]===J[0])J=J.slice(1,-1);return w.content=K.slice(Q).replace(y,""),{name:J,optional:z,default:H}}function ew(w){let q=w[0],K=q.content.match(cw),Z=K?K[1]:"",Q=K?q.content.slice(K[0].length):q.content,$=Q.trimEnd(),J=w.slice(1).map((V)=>V.separator+V.content),z=($?[$,...J]:J).join(`
|
|
11
|
-
`);q.content=Q,q.tag=Z;let H=nw(w,0),j=H?.type??"",Y=0;if(H){Y=H.endIndex;while(Y<w.length-1&&w[Y].content.trim()==="")Y++}let U=tw(w[Y]),S=Uw(w.slice(H?H.endIndex:0));return{tag:Z,name:U?.name??"",type:j,optional:U?.optional??!1,default:U?.default,description:S,raw:z,lines:w}}function wq(w,q){let K=aw(w);K.forEach(($,J)=>{$.number=J});let Z=rw(K),Q=Z.slice(1).map(ew);return{description:Uw(Z[0]),tags:Q,start:q,lines:K}}function p(w){return sw(w).map(({start:q,lines:K})=>wq(K,q))}var qq=/\s*=\s*/;function Ow(w){let q=w.indexOf("<");if(q===-1||!w.endsWith(">"))return w;let K=w.slice(0,q),Z=w.slice(q+1,-1),Q=ww(Z).map(($)=>$.trim().replace(qq," = ")).join(", ");return`${K}<${Q}>`}var Kq=/^\s*$/,Zq=/;$/,Qq=/^-\s*/;function f(w){if(w===void 0)return;let q=w.replace(Qq,"").trim();return q===""?"":q}function m(w){if(!w||w.length===0)return;return w[0].content}var Xw=new Set(["since","example"]);function $q(w){let q=w.trim();return q===""?!0:q}function Vw(w,q){return $q(`${w??""}${q?` ${q}`:""}`)}function Jq(w){let q=w.trim().replace(Zq,"").trimEnd();if(!q.startsWith("{")||!q.endsWith("}"))return!1;let K=0,Z=null;for(let Q=0;Q<q.length;Q++){let $=q[Q];if(Z!==null){if($==="\\"){Q++;continue}if($===Z)Z=null;continue}if($==='"'||$==="'"||$==="`"){Z=$;continue}if($==="{"||$==="["||$==="(")K++;else if($==="}"||$==="]"||$===")"){if(K--,K===0&&Q<q.length-1)return!1}}return K===0}function kw(w){let q=w;if(!q.startsWith("/*"))q=`/*${q}`;if(!q.endsWith("*/"))q+="*/";return q}function Yq(w){if(w==="*")return"any";return w.trim()}function eq(w){let q=p(kw(w)),{returns:K}=Aw(q);return K?Yq(K.type):void 0}function Aw(w){let q=w[0]?.tags??[],K=new Set(["type","param","returns","return","extends","extendProps","restProps","slot","snippet","event","typedef","callback","bindable","deprecated"]),Z,Q=[],$,J,z,H=[],j=[];for(let Y of q)if(Y.tag==="type")Z=Y;else if(Y.tag==="param")Q.push(Y);else if(Y.tag==="returns"||Y.tag==="return")$=Y;else if(Y.tag==="deprecated")z??=Vw(Y.name,Y.description);else if(Xw.has(Y.tag))j.push(Y);else if(Y.tag==="bindable"){if(Y.type)continue;let U=`${Y.name}${Y.description?` ${Y.description}`:""}`.trim();if(U==="readonly"||U==="writable")J??=U}else if(!K.has(Y.tag))H.push(Y);return{type:Z,param:Q,returns:$,binding:J,deprecated:z,additional:H,passthrough:j,description:w[0]?.description}}function zq(w){if(!w||w.length===0)return;let q=w[w.length-1];return q&&typeof q==="object"&&"value"in q?q:void 0}function Hq(w,q,K){if(!q||q.length===0||K===void 0||!w.source)return;for(let Z=q.length-1;Z>=0;Z--){let Q=q[Z];if(!Q||typeof Q!=="object"||!("value"in Q)||!("end"in Q))continue;if(typeof Q.end!=="number")continue;let $=w.source.slice(Q.end,K);if(Kq.test($))return Q}return}function jq(w,q,K){if(!K?.leadingComments)return;let Z=Hq(w,K.leadingComments,K.start);if(!Z)return;return Wq(q,[Z])}function wK(w,q,K){if(!K?.leadingComments)return;return jq(w,q,K)}function Wq(w,q){if(!q)return;let K=zq(q);if(!K)return;let Z=p(kw(K.value)),{type:Q,param:$,returns:J,binding:z,deprecated:H,additional:j,passthrough:Y,description:U}=Aw(Z),S,V,F,E;if(Q)S=w.aliasType(Q.type);if($.length>0)V=$.filter((O)=>!O.name.includes(".")).map((O)=>({name:O.name,type:w.aliasType(O.type),description:f(O.description),optional:O.optional||!1}));if(J)F=w.aliasType(J.type);let _=v(U?.trim());if(_||j.length>0){let O=[];if(_)O.push(_);for(let I of j){let u=`@${I.tag}${I.name?` ${I.name}`:""}${I.description?` ${I.description}`:""}`;O.push(u)}E=O.join(`
|
|
12
|
-
`)}let N=Y.length>0?Y.map((O)=>({name:O.tag,body:O.raw})):void 0;return{type:S,params:V,returnType:F,description:E,binding:z,deprecated:H,tags:N}}function qK(w,q,K=w.source){if(!K)return;for(let{tags:Z,description:Q,lines:$}of p(K)){let J,z,H,j,Y,U,S=[],V=[],F,E,_,N=[],O,I,u=[],c,h=!1,X=!0,g=[],i,d=new Map,qw=new Set,o=new Set;for(let W of Z)if(W.lines.length>0)qw.add(W.lines[0].number);for(let W of $)if(!W.tag&&W.content&&W.content.trim()!=="}")d.set(W.number,W.content);let Gw=(W)=>{if(!W||W.length===0)return;let G=W[0].number,M=[],P=[],L=!1;for(let B=G-1;B>=0;B--){if(qw.has(B))break;let R=d.get(B);if(R)M.unshift(R),P.unshift(B),L=!0;else if(L){let k=$[B];if(!(!k||!k.tag&&(!k.content||k.content.trim()==="")))break}}if(M.length===0)return;for(let B of P)o.add(B);return M.join(`
|
|
13
|
-
`).trim()},Kw=()=>{if(J!==void 0){let W=z&&z!=="object"&&z!=="Object"?z:void 0,G;if(W)G=W;else if(V.length>0)G=e(V,J,!0);else G=z||"";if(U!==void 0){let M;for(let B of Z){let R=B.lines[0]?.number;if(typeof R!=="number")continue;if(R<=U)continue;if(B.tag==="property"||B.tag==="type")continue;M=R;break}let P=[],L=Array.from(d.keys()).sort((B,R)=>B-R);for(let B of L){if(B<=U)continue;if(M!==void 0&&B>=M)continue;if(o.has(B))continue;let k=d.get(B)?.trim();if(k)P.push(k),o.add(B)}if(P.length>0){let B=P.join(`
|
|
14
|
-
`);H=H?`${H}
|
|
15
|
-
${B}`:B}}t(w,{name:J,detail:G,has_argument:!1,description:H,deprecated:j,tags:S.length>0?S:void 0,source:Y}),w.eventDescriptions.set(J,H),w.jsDocEventNames.add(J),w.jsDocEventSources.set(J,Y),V.length=0,J=void 0,z=void 0,H=void 0,j=void 0,Y=void 0,U=void 0,S=[]}},Zw=()=>{if(F!==void 0){let W,G;if(N.length>0)W=e(N,void 0,!0),G=`type ${F} = ${W};`;else if(E)W=E,G=Jq(W)?`interface ${F} ${W}`:`type ${F} = ${W};`;else W="{}",G=`type ${F} = ${W};`;w.typedefs.set(F,{type:W,name:F,description:v(_),ts:G}),N.length=0,F=void 0,E=void 0,_=void 0}},Qw=()=>{if(O!==void 0){let M=`(${u.map(({name:L,type:B,optional:R})=>{return`${L}${R?"?":""}: ${B}`}).join(", ")}) => ${c||"void"}`,P=`type ${O} = ${M};`;w.typedefs.set(O,{type:M,name:O,description:v(I),ts:P}),u.length=0,c=void 0,O=void 0,I=void 0}},Fw=Z.some((W)=>W.tag==="slot"||W.tag==="snippet"),Pw=Z.some((W)=>W.tag==="extends"||W.tag==="extendProps");for(let{tag:W,type:G,name:M,description:P,optional:L,default:B,raw:R,lines:k}of Z){let C=q.aliasType(G),l=Gw(k);switch(W){case"extends":case"extendProps":if(w.extends={interface:M,import:C},X)X=!1;break;case"restProps":{let A=M?P?`${M} ${P}`:M:P,s=f(A)||l;if(!s&&X&&!h&&Q)s=Q,h=!0;if(w.rest_props={type:"Element",name:C,description:s||void 0},X)X=!1;break}case"slot":case"snippet":{let T=f(m(k));if(!T&&X&&!h&&Q)T=Q,h=!0;if(!T&&g.length===0)T=l;if(X)X=!1;Mw(w,{slot_name:M,slot_props:C,slot_description:T||void 0,slot_deprecated:i,slot_tags:g.length>0?[...g]:void 0,source:n(w,k)}),g.length=0,i=void 0;break}case"event":{if(Kw(),J=M,z=C,U=k.length>0?k[0].number:void 0,H=f(m(k))||l,!H&&X&&!h&&Q)H=Q,h=!0;if(Y=n(w,k),X)X=!1;break}case"type":if(J!==void 0)z=C;break;case"param":if(O!==void 0)u.push({name:M,type:C,optional:L||!1});break;case"returns":case"return":if(O!==void 0)c=C;break;case"property":{let A={name:M,type:C,description:f(m(k)),optional:L||!1,default:B};if(J!==void 0)V.push(A);else if(F!==void 0)N.push(A);break}case"typedef":{if(Zw(),F=Ow(M),E=C,_=f(m(k))||l,!_&&X&&!h&&Q)_=Q,h=!0;if(X)X=!1;break}case"callback":{if(Qw(),O=Ow(M),I=f(m(k))||l,!I&&X&&!h&&Q)I=Q,h=!0;if(X)X=!1;break}case"generics":if(w.generics=[M,C],X)X=!1;break;case"template":{let A=M;if(C)A=`${M} extends ${C}`;if(B)A+=` = ${B}`;if(Fw&&!Pw){w.deferredSlotBlockGenerics.push({name:M,constraint:A});break}if(q.accumulateGeneric(M,A),X)X=!1;break}case"deprecated":{let A=Vw(M,P);if(J===void 0)i??=A;else j??=A;break}case"enum":case"class":case"implements":case"this":case"namespace":case"memberof":case"module":case"file":case"overview":break;default:{let A={name:W,body:R};if(J!==void 0&&Xw.has(W))S.push(A);else g.push(A)}break}}Kw(),Zw(),Qw()}}
|
|
16
|
-
export{b as u,Bq as v,a as w,$w as x,Mq as y,Jw as z,Uq as A,Cw as B,Oq as C,Iw as D,Vq as E,kq as F,Yw as G,Dw as H,Hw as I,jw as J,x as K,Fq as L,v as M,Lw as N,t as O,bq as P,fw as Q,_q as R,Lq as S,vq as T,Eq as U,D as V,fq as W,ww as X,xq as Y,yq as Z,p as _,dq as $,pq as aa,Mw as ba,Kq as ca,eq as da,Aw as ea,jq as fa,wK as ga,qK as ha};
|