svelte-prune 0.0.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +2 -2
- package/README.md +529 -2
- package/analysis-ah6ws3px.js +1 -0
- package/index-17bw6v3k.js +2 -0
- package/index-45rna84h.js +9 -0
- package/index-c4dndsx9.js +2 -0
- package/index-fhqjbrb9.js +3 -0
- package/index-jxng1156.js +5 -0
- package/index-k2z70ex7.js +22 -0
- package/index-pykm4v5k.js +2 -0
- package/index-v520xws8.js +2 -0
- package/index-z8hj1913.js +2 -0
- package/index.d.ts +209 -0
- package/index.js +1 -0
- package/internal-analysis.d.ts +602 -0
- package/internal-analysis.js +1 -0
- package/internal.d.ts +451 -0
- package/internal.js +1 -0
- package/loader.js +1 -0
- package/package.json +53 -3
- package/tailwind-sources-8wvzbxes.js +1 -0
- package/variant-tables-zha5f3x0.js +1 -0
- package/vite.d.ts +119 -0
- package/vite.js +1 -0
- package/webpack.d.ts +195 -0
- package/webpack.js +1 -0
- package/index.ts +0 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{c}from"./index-jxng1156.js";var z=Array(2048).fill(void 0);function ue(){z.fill(void 0)}function Ue(e,t,r,n){let i=n&2047,s=z[i];if(s!==void 0&&s.length===r-t&&e.startsWith(s,t))return s;let o=e.slice(t,r);return z[i]=o,o}var B="",b=[0],P=0,R=0,w;function U(e){ue(),B=e,b=[0],P=0,R=0,w=void 0}function G(e){while(P<=e){let t=B.indexOf(`
|
|
2
|
+
`,P);if(t===-1){P=Number.POSITIVE_INFINITY;return}P=t+1,b.push(P)}}function Q(e){let t=[0],r=e.indexOf(`
|
|
3
|
+
`);while(r!==-1)t.push(r+1),r=e.indexOf(`
|
|
4
|
+
`,r+1);return t}function F(e,t,r){let n=0,i=e.length-1;if(t>=e[r])n=r;else i=r-1;if(n<i&&t<e[n+1])i=n;while(n<i){let s=n+i+1>>>1;if(e[s]<=t)n=s;else i=s-1}return n}function E(e){return G(e),R=F(b,e,R),{line:R+1,column:e-b[R],character:e}}var q=/\r\n?|\n|\u2028|\u2029/g,fe=/[\r\u2028\u2029]/;function We(e){if(w===void 0){w=fe.test(B)?[]:null,q.lastIndex=0;while(w!==null&&q.exec(B)!==null)w.push(q.lastIndex)}if(w===null)return G(e),F(b,e,R);let t=0,r=w.length;while(t<r){let n=t+r>>>1;if(w[n]<=e)t=n+1;else r=n}return t}function D(e){let{line:t,column:r}=E(e);return{line:t,column:r}}function je(e){while(b.length<=e+1&&P!==Number.POSITIVE_INFINITY)G(P);if(e>=b.length)return;let t=e+1<b.length?b[e+1]-1:B.length;return B.slice(b[e],t)}function d(e){return typeof e==="object"&&e!==null&&typeof k(e).type==="string"}function k(e){return e}function Z(e,t){let r=k(e);for(let n in r){let i=r[n];if(Array.isArray(i)){for(let s=0;s<i.length;s++)if(d(i[s]))i[s]=t(i[s])}else if(d(i))r[n]=t(i)}}function he(e,...t){if(!t.some((r)=>r===e.type))throw Error(`expected ${t.join(" or ")}, got ${e.type}`)}function m(e){let t=[];return O(e,t),t}function O(e,t){switch(e.type){case"Identifier":t.push(e);return;case"ObjectPattern":for(let r of e.properties)O(r.type==="RestElement"?r.argument:r.value,t);return;case"ArrayPattern":for(let r of e.elements)if(r!==null)O(r,t);return;case"RestElement":O(e.argument,t);return;case"AssignmentPattern":O(e.left,t);return;case"TSParameterProperty":O(e.parameter,t);return;case"TSAsExpression":case"TSNonNullExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":O(e.expression,t)}}function A(e,t){if(e.type!=="Identifier")return!1;if(t===null)return!0;switch(t.type){case"MemberExpression":return t.computed||e===t.object;case"MethodDefinition":return t.computed;case"Property":case"PropertyDefinition":return t.computed||e===t.value;case"ExportSpecifier":case"ImportSpecifier":return e===t.local;case"MetaProperty":case"ImportAttribute":case"ExportAllDeclaration":case"LabeledStatement":case"BreakStatement":case"ContinueStatement":return!1;case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"TSNonNullExpression":case"TSInstantiationExpression":case"TSExportAssignment":return e===t.expression;case"TSEnumMember":return e===t.initializer;case"TSParameterProperty":case"TSEnumDeclaration":case"TSImportEqualsDeclaration":return!0;default:return!t.type.startsWith("TS")}}var Te=64,K=new Map;function C(e,t){let r=K.get(e);if(r===void 0){if(K.size>=Te)K.delete(K.keys().next().value);r={starts:Q(e),last:0},K.set(e,r)}let n=F(r.starts,t,r.last);return r.last=n,{line:n+1,column:t-r.starts[n]}}function W(e){let t=e;while(t.type==="TSAsExpression"||t.type==="TSSatisfiesExpression"||t.type==="TSTypeAssertion"||t.type==="TSNonNullExpression"||t.type==="TSInstantiationExpression")t=t.expression;return t}var v={Root:["module","instance","fragment","css"],Script:["attributes","content"],Fragment:["nodes"],Text:[],Comment:[],ExpressionTag:["expression"],HtmlTag:["expression"],ConstTag:["declaration"],DeclarationTag:["declaration"],DebugTag:["identifiers"],RenderTag:["expression"],AttachTag:["expression"],Attribute:["value"],SpreadAttribute:["expression"],AnimateDirective:["expression"],BindDirective:["expression"],ClassDirective:["expression"],LetDirective:["expression"],OnDirective:["expression"],StyleDirective:["value"],TransitionDirective:["expression"],UseDirective:["expression"],Component:["attributes","fragment"],TitleElement:["attributes","fragment"],SlotElement:["attributes","fragment"],RegularElement:["attributes","fragment"],SvelteBody:["attributes","fragment"],SvelteBoundary:["attributes","fragment"],SvelteComponent:["expression","attributes","fragment"],SvelteDocument:["attributes","fragment"],SvelteElement:["tag","attributes","fragment"],SvelteFragment:["attributes","fragment"],SvelteHead:["attributes","fragment"],SvelteOptions:["attributes","fragment"],SvelteSelf:["attributes","fragment"],SvelteWindow:["attributes","fragment"],IfBlock:["test","consequent","alternate"],EachBlock:["expression","context","key","body","fallback"],AwaitBlock:["expression","pending","value","then","error","catch"],KeyBlock:["expression","fragment"],SnippetBlock:["expression","parameters","body"],StyleSheet:["attributes","children"],Rule:["prelude","block"],Atrule:["block"],SelectorList:["children"],ComplexSelector:["children"],RelativeSelector:["combinator","selectors"],Combinator:[],TypeSelector:[],IdSelector:[],ClassSelector:[],AttributeSelector:[],PseudoElementSelector:["args"],PseudoClassSelector:["args"],Percentage:[],Nth:[],NestingSelector:[],Block:["children"],Declaration:[],Program:["body"],ExpressionStatement:["expression"],BlockStatement:["body"],StaticBlock:["body"],EmptyStatement:[],DebuggerStatement:[],WithStatement:["object","body"],ReturnStatement:["argument"],LabeledStatement:["label","body"],BreakStatement:["label"],ContinueStatement:["label"],IfStatement:["test","consequent","alternate"],SwitchStatement:["discriminant","cases"],SwitchCase:["test","consequent"],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],CatchClause:["param","body"],WhileStatement:["test","body"],DoWhileStatement:["body","test"],ForStatement:["init","test","update","body"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],FunctionDeclaration:["id","typeParameters","params","returnType","body"],FunctionExpression:["id","typeParameters","params","returnType","body"],ArrowFunctionExpression:["typeParameters","params","returnType","body"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],ClassDeclaration:["decorators","id","typeParameters","superClass","superTypeParameters","implements","body"],ClassExpression:["decorators","id","typeParameters","superClass","superTypeParameters","implements","body"],ClassBody:["body"],MethodDefinition:["decorators","key","typeParameters","value"],PropertyDefinition:["decorators","key","typeAnnotation","value"],Property:["decorators","key","value"],ThisExpression:[],Super:[],Literal:[],Identifier:["decorators","typeAnnotation"],PrivateIdentifier:[],ArrayExpression:["elements"],ObjectExpression:["properties"],UnaryExpression:["argument"],UpdateExpression:["argument"],BinaryExpression:["left","right"],LogicalExpression:["left","right"],AssignmentExpression:["left","right"],MemberExpression:["object","property"],ConditionalExpression:["test","consequent","alternate"],CallExpression:["callee","typeArguments","arguments"],NewExpression:["callee","typeArguments","arguments"],SequenceExpression:["expressions"],TemplateLiteral:["quasis","expressions"],TaggedTemplateExpression:["tag","typeArguments","quasi"],TemplateElement:[],SpreadElement:["argument"],RestElement:["decorators","argument","typeAnnotation"],YieldExpression:["argument"],AwaitExpression:["argument"],ImportExpression:["source","options","arguments"],ChainExpression:["expression"],ParenthesizedExpression:["expression"],MetaProperty:["meta","property"],ObjectPattern:["decorators","properties","typeAnnotation"],ArrayPattern:["decorators","elements","typeAnnotation"],AssignmentPattern:["decorators","left","right"],ImportDeclaration:["specifiers","source","attributes"],ImportSpecifier:["imported","local"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportAttribute:["key","value"],ExportNamedDeclaration:["declaration","specifiers","source","attributes"],ExportSpecifier:["local","exported"],ExportDefaultDeclaration:["declaration"],ExportAllDeclaration:["exported","source","attributes"],Decorator:["expression"],TSTypeAnnotation:["typeAnnotation"],TSTypeParameterDeclaration:["params"],TSTypeParameterInstantiation:["params"],TSTypeParameter:["constraint","default"],TSAnyKeyword:[],TSBigIntKeyword:[],TSBooleanKeyword:[],TSNeverKeyword:[],TSNullKeyword:[],TSNumberKeyword:[],TSObjectKeyword:[],TSStringKeyword:[],TSSymbolKeyword:[],TSUndefinedKeyword:[],TSUnknownKeyword:[],TSVoidKeyword:[],TSThisType:[],TSArrayType:["elementType"],TSTupleType:["elementTypes"],TSNamedTupleMember:["label","elementType"],TSOptionalType:["typeAnnotation"],TSRestType:["typeAnnotation"],TSUnionType:["types"],TSIntersectionType:["types"],TSConditionalType:["checkType","extendsType","trueType","falseType"],TSInferType:["typeParameter"],TSParenthesizedType:["typeAnnotation"],TSTypeOperator:["typeAnnotation"],TSIndexedAccessType:["objectType","indexType"],TSMappedType:["typeParameter","nameType","typeAnnotation"],TSLiteralType:["literal"],TSTypeReference:["typeName","typeArguments"],TSQualifiedName:["left","right"],TSTypeQuery:["exprName","typeArguments"],TSImportType:["argument","qualifier","typeArguments"],TSTypeLiteral:["members"],TSPropertySignature:["key","typeAnnotation"],TSMethodSignature:["key","typeParameters","parameters","typeAnnotation"],TSCallSignatureDeclaration:["typeParameters","parameters","typeAnnotation"],TSConstructSignatureDeclaration:["typeParameters","parameters","typeAnnotation"],TSFunctionType:["typeParameters","parameters","typeAnnotation"],TSConstructorType:["typeParameters","parameters","typeAnnotation"],TSIndexSignature:["decorators","parameters","typeAnnotation"],TSTypePredicate:["parameterName","typeAnnotation"],TSInterfaceDeclaration:["id","typeParameters","extends","body"],TSInterfaceBody:["body"],TSExpressionWithTypeArguments:["expression","typeParameters"],TSTypeAliasDeclaration:["id","typeParameters","typeAnnotation"],TSEnumDeclaration:["id","members"],TSEnumMember:["id","initializer"],TSModuleDeclaration:["id","body"],TSModuleBlock:["body"],TSImportEqualsDeclaration:["id","moduleReference"],TSExternalModuleReference:["expression"],TSExportAssignment:["expression"],TSNamespaceExportDeclaration:["id"],TSDeclareFunction:["id","typeParameters","params","returnType"],TSDeclareMethod:["typeParameters","params","returnType"],TSParameterProperty:["parameter"],TSAsExpression:["expression","typeAnnotation"],TSSatisfiesExpression:["expression","typeAnnotation"],TSTypeAssertion:["typeAnnotation","expression"],TSNonNullExpression:["expression"],TSInstantiationExpression:["expression","typeArguments"]};var a=[],g={...v,FunctionDeclaration:["id","params","body"],FunctionExpression:["id","params","body"],ArrowFunctionExpression:["params","body"],ClassDeclaration:["decorators","id","superClass","body"],ClassExpression:["decorators","id","superClass","body"],MethodDefinition:["decorators","key","value"],PropertyDefinition:["decorators","key","value"],Identifier:["decorators"],CallExpression:["callee","arguments"],NewExpression:["callee","arguments"],TaggedTemplateExpression:["tag","quasi"],RestElement:["decorators","argument"],ObjectPattern:["decorators","properties"],ArrayPattern:["decorators","elements"],TSTypeAnnotation:a,TSTypeParameterDeclaration:a,TSTypeParameterInstantiation:a,TSTypeParameter:a,TSArrayType:a,TSTupleType:a,TSNamedTupleMember:a,TSOptionalType:a,TSRestType:a,TSUnionType:a,TSIntersectionType:a,TSConditionalType:a,TSInferType:a,TSParenthesizedType:a,TSTypeOperator:a,TSIndexedAccessType:a,TSMappedType:a,TSLiteralType:a,TSTypeReference:a,TSTypeQuery:a,TSImportType:a,TSTypeLiteral:a,TSPropertySignature:a,TSMethodSignature:a,TSCallSignatureDeclaration:a,TSConstructSignatureDeclaration:a,TSFunctionType:a,TSConstructorType:a,TSIndexSignature:a,TSTypePredicate:a,TSInterfaceDeclaration:a,TSInterfaceBody:a,TSExpressionWithTypeArguments:a,TSTypeAliasDeclaration:a,TSNamespaceExportDeclaration:a,TSDeclareFunction:["id"],TSDeclareMethod:a,TSAsExpression:["expression"],TSSatisfiesExpression:["expression"],TSTypeAssertion:["expression"],TSInstantiationExpression:["expression"]},Se=Object.assign(Object.create(null),v),ge=Object.assign(Object.create(null),g),te=[],X=Symbol("sveast.walk.stop"),ee=Symbol("sveast.walk.skip");function u(e,t,r){_(e,null,null,null,t,xe(r))}function xe(e){if(e===void 0||e===v)return ne;if(e===g)return ie;return(t)=>re(e,t.type)}function re(e,t){return Object.hasOwn(e,t)?e[t]:void 0}function be(e,t){if(e===void 0||e===v)return ne(t);if(e===g)return ie(t);return re(e,t.type)}function x(e,t,r){let n=be(r,e);if(n===void 0)throw Error(`unknown node type: ${e.type}`);let i=k(e);for(let s=0;s<n.length;s++){let o=n[s],l=i[o];if(Array.isArray(l))for(let f=0;f<l.length;f++){let p=l[f];if(d(p))t(p,o,f)}else if(d(l))t(l,o,null)}}var Ee=Object.freeze([]),J=new WeakMap,ve=new WeakMap;function Me(e,t=v){let r=t===v?ve:J.get(t);if(r===void 0)r=new WeakMap,J.set(t,r);let n=r.get(e);if(n===void 0){let i=[];x(e,(s)=>i.push(s),t),n=i.length===0?Ee:i,r.set(e,n)}return n}function _(e,t,r,n,i,s){let o=s(e);if(o===void 0)throw Error(`unknown node type: ${e.type}`);let l=i.enter?.(e,t,r,n);if(l===X)return!0;if(l!==ee){if(l!==e&&d(l))return Ae(l,t,r,n,i,s);let f=k(e);for(let p=0;p<o.length;p++){let S=o[p],T=f[S];if(Array.isArray(T))for(let y=0;y<T.length;y++){let h=T[y];if(d(h)&&_(h,e,S,y,i,s))return!0}else if(d(T)&&_(T,e,S,null,i,s))return!0}}return i.leave?.(e,t,r,n)===X}function ne(e){let t=e.type;if(t==="Identifier")return e.typeAnnotation===void 0&&e.decorators===void 0?te:v.Identifier;if(t==="Literal")return v.Literal;if(t==="Text")return v.Text;return Se[t]}function ie(e){let t=e.type;if(t==="Identifier")return e.decorators===void 0?te:g.Identifier;if(t==="Literal")return g.Literal;if(t==="Text")return g.Text;return ge[t]}function Ae(e,t,r,n,i,s){if(t===null||r===null)throw Error("walk can't replace the node it was called with");let o=k(t),l=o[r];if(n===null)o[r]=e;else if(Array.isArray(l))l[n]=e;return _(e,t,r,n,i,s)}import{readFileSync as Ie,statSync as we}from"node:fs";import N from"node:path";var Ce=/^[\p{ID_Start}$_][\p{ID_Continue}$\u200c\u200d]*$/u;function Pe(e){return Ce.test(e)}var De=8;function ke(e){let t=new Map;for(let r of c(Ie(e,"utf8"))){if(r.kind!=="export"||!r.source)continue;for(let{kind:n,local:i,exported:s}of r.specifiers)if(n==="named"&&s!==null&&Pe(i)&&Pe(s))t.set(s,{local:i,source:r.source.value})}return t}function de(e,t){let r=N.resolve(N.dirname(e),t);return[r,`${r}.js`,`${r}.svelte`,N.join(r,"index.js")].find((n)=>we(n,{throwIfNoEntry:!1})?.isFile()===!0)}function $e(e,t){return N.relative(e,t).split(N.sep).join("/")}function me(e,{name:t,srcDir:r,barrel:n}){let i=N.join(e,r),s=N.join(i,n),o=new Map,l=(p)=>{let S=o.get(p);if(!S)S=ke(p),o.set(p,S);return S},f=new Map;for(let[p,S]of l(s)){let T=de(s,S.source),y=S.local;for(let h=0;T&&h<De;h++){if(y==="default"||!T.endsWith(".js"))break;let H=l(T).get(y);if(!H)break;let Y=de(T,H.source);if(!Y)break;T=Y,y=H.local}if(!T)continue;f.set(p,{path:`${t}/${r}/${$e(i,T)}`,name:y})}return f}function V(e,t,r){return{text:e.slice(t,r),runs:r>t?[[0,t,r-t]]:[]}}function M(...e){let t="",r=[];for(let n of e){if(typeof n==="string"){t+=n;continue}for(let[i,s,o]of n.runs)r.push([i+t.length,s,o]);t+=n.text}return{text:t,runs:r}}function j(e,t){if(t.length===0)return e;let r="",n=0,i=[];for(let o of t)i.push([n,o.start,r.length]),r+=e.text.slice(n,o.start)+(o.text??""),n=o.end;i.push([n,e.text.length,r.length]),r+=e.text.slice(n);let s=[];for(let[o,l,f]of e.runs)for(let[p,S,T]of i){let y=Math.max(o,p),h=Math.min(o+f,S);if(y<h)s.push([T+y-p,l+y-o,h-y])}return{text:r,runs:s}}function ye(e,t,r=0,n=e.text.length){let i=[];for(let s of e.text.slice(r,n).matchAll(t)){let o=r+s.index;i.push({start:o,end:o+s[0].length})}return j(e,i)}function Re(e,t,r){let n=new Le,{text:i}=e,s=0,o=0;for(let[l,f,p]of e.runs){if(f<o)continue;if(l>s)n.replace(i.slice(s,l),t,o,f);else if(f>o)n.skip(t,o,f);n.copy(i.slice(l,l+p)),s=l+p,o=f+p}if(s<i.length)n.replace(i.slice(s),t,o,t.length);return{version:3,sources:[r],sourcesContent:[t],names:[],mappings:n.toString()}}var le="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",se=44,oe=59,I=65,pe=new Uint8Array(16);for(let e=0;e<16;e++)pe[e]=le.charCodeAt(e<<1);var ce=new Uint8Array(128);for(let e=0;e<128;e++)ce[e]=e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===95?1:0;var Oe=new TextDecoder("latin1"),Ne=1048576,ae=new Uint8Array(4096);class Le{buffer=ae;length=0;line=0;column=0;genColumn=0;lineHasSegments=!1;prevGenColumn=0;prevLine=0;prevColumn=0;copy(e){let t=e.length;if(t===0)return;this.reserve(t*5+64);let r=this.buffer,n=this.length,i=this.column,s=this.genColumn-i,o=this.prevColumn,l=!1,f=!1;for(let p=0;p<t;p++){let S=e.charCodeAt(p);if(S===10){r[n++]=oe,this.line++,i=0,s=0,this.prevGenColumn=0,this.lineHasSegments=!1,l=!1,f=!1;continue}let T=S<128&&ce[S]===1;if(!T||!l)if(f){let y=i-o;if(r[n++]=se,y<16){let h=pe[y];r[n++]=h,r[n++]=I,r[n++]=I,r[n++]=h}else n=L(r,n,y),r[n++]=I,r[n++]=I,n=L(r,n,y);o=i}else this.length=n,this.column=i,this.genColumn=i+s,this.prevColumn=o,this.addSegment(),n=this.length,o=i,f=!0;l=T,i++}if(this.length=n,this.column=i,this.genColumn=i+s,this.prevColumn=o,f)this.prevGenColumn=o+s}replace(e,t,r,n){this.addSegment();let i=0,s=e.indexOf(`
|
|
5
|
+
`);while(s!==-1){i=s+1,this.reserve(5);let o=this.buffer;if(o[this.length++]=oe,i<e.length)o[this.length++]=I,o[this.length++]=I,o[this.length++]=I,o[this.length++]=I;s=e.indexOf(`
|
|
6
|
+
`,i)}if(i===0)this.genColumn+=e.length;else this.genColumn=e.length-i,this.prevGenColumn=0,this.lineHasSegments=i<e.length;this.skip(t,r,n)}skip(e,t,r){let n=-1,i=e.indexOf(`
|
|
7
|
+
`,t);while(i!==-1&&i<r)this.line++,n=i,i=e.indexOf(`
|
|
8
|
+
`,i+1);this.column=n===-1?this.column+(r-t):r-n-1}addSegment(){let{genColumn:e,line:t,column:r}=this;this.reserve(25);let n=this.buffer,i=this.length;if(this.lineHasSegments)n[i++]=se;i=L(n,i,e-this.prevGenColumn),n[i++]=I,i=L(n,i,t-this.prevLine),i=L(n,i,r-this.prevColumn),this.length=i,this.lineHasSegments=!0,this.prevGenColumn=e,this.prevLine=t,this.prevColumn=r}reserve(e){let t=this.length+e;if(t<=this.buffer.length)return;let r=this.buffer.length*2;while(r<t)r*=2;let n=new Uint8Array(r);if(n.set(this.buffer.subarray(0,this.length)),this.buffer=n,r<=Ne)ae=n}toString(){return Oe.decode(this.buffer.subarray(0,this.length))}}function L(e,t,r){let n=r<0?-r<<1|1:r<<1;do{let i=n&31;if(n>>>=5,n>0)i|=32;e[t++]=le.charCodeAt(i)}while(n>0);return t}
|
|
9
|
+
export{Ue,U,E,We,D,je,d,k,Z,he,m,A,C,W,g,ee,u,x,Me,Pe,de,$e,me,V,M,j,ye,Re,Le};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{G,H,X}from"./index-17bw6v3k.js";import{P}from"./index-fhqjbrb9.js";import{c,o,p}from"./index-jxng1156.js";var g=/^(?:\.|\/|\0|svelte(?:\/|$))/;function I(l){let a=new Set;for(let n of c(l))if(n.source)a.add(n.source.value);for(let{kind:n,source:d}of P(l))if(n!=="glob"&&d!==null)a.add(d);return a}async function we(l,a){let n=p(l),d=[],u=new Set;for(let r of a.getModuleIds()){if(!n.importKey(r))continue;let e=a.getModuleInfo(r);for(let t of[...e?.importers??[],...e?.dynamicImporters??[]]){if(n.moduleKey(o(t)))continue;d.push({id:r,importer:t}),u.add(t)}}let s=[];for(let r of u){let e=a.getModuleInfo(r)?.code;if(!e)continue;for(let t of I(e)){if(n.isSpecifier(t)||g.test(t))continue;s.push(a.resolve(t,r).then((i)=>{if(i&&n.importKey(i.id))d.push({id:i.id,importer:r,specifier:t})},()=>{}))}}return await Promise.all(s),d}function Oe(l,a,n={...H,id:"svelte-prune"}){let d=process.cwd(),u=!1,s=X(l,a,n);return{name:n.id,enforce:"pre",...l.tailwind!==!0&&{apply:"build"},configResolved(r){d=r.root,u=r.command==="serve"},async buildStart(){if(u){let i=await G(l,d,n);if(i)this.warn(i);return}let{warning:r,info:e,report:t}=await s.prepare(d,async(i,f)=>(await this.resolve(i,f,{skipSelf:!0}))?.id);if(r)this.warn(r);if(e)this.info?.(e);for(let i of t??[])console.log(i)},load(r){return u?void 0:s.load(r)},transform(r,e){if(!u)s.check(e,r)},async buildEnd(){if(u)return;for(let e of await we(l,this))s.checkLibraryImport(e);for(let e of this.getModuleIds()){if(s.load(e)&&e.endsWith(".js")){let f=this.getModuleInfo(e);s.checkScriptImporters(e,[...f?.importers??[],...f?.dynamicImporters??[]])}if(!s.isClosed(e))continue;let t=this.getModuleInfo(e);if(!t)continue;let i=[...t.importers];if(t.isEntry)i.push(void 0);s.checkImporters(e,i,t.dynamicImporters.length>0)}let r=s.error();if(r)this.error(r)},generateBundle:{order:"post",handler(r,e){if(u)return;let t=new Map;for(let f of Object.values(e)){if(f.type!=="asset"||!f.fileName.endsWith(".css"))continue;t.set(f.fileName,typeof f.source==="string"?f.source:new TextDecoder().decode(f.source))}if(t.size===0)return;let i=s.pruneStyles(t);for(let[f,y]of t){let m=e[f];if(m?.type==="asset")m.source=y}if(i)this.info?.(i)}}}}
|
|
2
|
+
export{we,Oe};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{ie,l,s,ne,re,se,z,oe,y,R,ae,ve,ze}from"./index-jxng1156.js";var b={li:["li"],dt:["dt","dd"],dd:["dt","dd"],p:"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".split(" "),rt:["rt","rp"],rp:["rt","rp"],optgroup:["optgroup"],option:["option","optgroup"],thead:["tbody","tfoot"],tbody:["tbody","tfoot"],tfoot:["tbody"],tr:["tr","tbody"],td:["td","th","tr"],th:["td","th","tr"]};function ge(t,i){return Object.hasOwn(b,t)&&b[t].includes(i)}var S="{",L=60,O=62,x=47,_=61,A=123,v=/\s*>/y,E=/<\/textarea(\s[^>]*)?>/iy,q=["cript","tyle","velte:options"],D="</svelte:options";function I(t){let i=ie(t).trimEnd();return w(i,ne(i),null)}function w(t,i,n){let e={typescript:i,instance:null,module:null,css:null,options:null},a=W(t),d=[],r=0;while(r<=a){let h=t.charCodeAt(r);if(h===L)r=X(t,r,d,e,n);else if(h===A)r=U(t,r,d);else r++}return e}function W(t){let i=-1,n=t.indexOf("<s");while(n!==-1){let e=B(t,n+2);if(e!==-1){let a=t.charCodeAt(e);if(e===t.length||l(a)||a===x||a===O)i=n}n=t.indexOf("<s",n+2)}return i}function B(t,i){for(let n of q)if(t.startsWith(n,i))return i+n.length;return-1}function C(t,i){return Math.min(ve(t,i)+1,t.length)}function U(t,i,n){let e=s(t,i+1),a=t.charCodeAt(e),d=t.charCodeAt(e+1);if(a===35||a===58||a===64||a===x&&d!==x&&d!==42){e++;while(e<t.length){let r=t.charCodeAt(e);if(r<97||r>122)break;e++}if(a===35)n.push(S);else if(a===x){let r=n.lastIndexOf(S);if(r!==-1)n.length=r}}return C(t,e)}function X(t,i,n,e,a){if(t.startsWith("!--",i+1)){let p=t.indexOf("-->",i+4),m=p===-1?t.length:p+3;if(a&&n.length===0)a.comments.push(i,m);return m}if(t.charCodeAt(i+1)===x){let p=i+2,m=t.slice(p,R(t,p,!1)),g=n.lastIndexOf(m);if(g!==-1)n.length=g;return c(t,s(t,p+m.length))}let d=t.slice(i+1,R(t,i+1,!1)),r=s(t,i+1+d.length),h=n[n.length-1];if(h!==void 0&&ge(h,d))n.pop();let o=n.length===0;if(a&&o&&(d==="script"||d==="style"||d==="svelte:options"))a.tags.push(i);if(o&&(d==="script"||d==="style")){let p=[];if(r=c(t,H(t,r,p)),d==="script"){let g=k(t,i,r,p);if(g.context==="module")e.module??=g;else e.instance??=g;return g.end}let m=V(t,i,r,p);return e.css??=m,m.end}let f=o&&d==="svelte:options"?[]:null;if(r=Q(t,r,f),t.charCodeAt(r)===x||z(d)){if(t.charCodeAt(r)===x)r++;r=c(t,r)}else{if(r=c(t,r),d==="textarea")return j(t,r);if(d==="script"||d==="style"){let p=`</${d}>`,m=t.indexOf(p,r);return m===-1?t.length:m+p.length}if(f&&t.startsWith(D,r))r=c(t,s(t,r+D.length));else return n.push(d),r}if(f)e.options??={start:i,end:r,attributes:f};return r}function c(t,i){return t.charCodeAt(i)===O?i+1:i}function k(t,i,n,e){let a=re(t,n),d=a===-1?t.length:a,r=e.some((h)=>h.name==="module"||h.name==="context");return{start:i,end:a===-1?t.length:se(t,a),context:r?"module":"default",attributes:e,content:{start:n,end:d}}}function V(t,i,n,e){let a=oe(t,n),d=a;if(t.startsWith("</style",d)){d+=7,v.lastIndex=d;let r=v.exec(t);if(r)d+=r[0].length}return{start:i,end:d,attributes:e,content:{start:n,end:a}}}function H(t,i,n){let e=i;for(;;){let a=e,d=R(t,e,!0);if(d===a)return e;e=d;let r=!0;if(t.charCodeAt(e)===_){let h=s(t,e+1),o=t.charCodeAt(h),f=-1;if(y(o)){let m=t.indexOf(t[h],h+1);if(m!==-1)f=m+1}if(f===-1){f=h;while(f<t.length&&t.charCodeAt(f)!==O&&!l(t.charCodeAt(f)))f++}let p=y(o)?1:0;r=t.slice(h+p,f-p),e=f}n.push({name:t.slice(a,d),value:r,start:a,end:e}),e=s(t,e)}}function Q(t,i,n){let e=i;for(;;){for(;;){if(t.startsWith("/*",e)){let o=t.indexOf("*/",e+2);e=o===-1?t.length:o+2}else if(t.startsWith("//",e)){let o=t.indexOf(`
|
|
2
|
+
`,e+2);e=o===-1?t.length:o}else break;e=s(t,e)}let a=e;if(t.charCodeAt(e)===A){e=s(t,C(t,e+1));continue}let d=R(t,e,!0);if(d===a)return e;let r=d,h=!0;if(e=s(t,d),t.charCodeAt(e)===_){let o=s(t,e+1);r=t.startsWith("/>",o)?o+1:Y(t,o),h=y(t.charCodeAt(o))?t.slice(o+1,Math.max(o+1,r-1)):t.slice(o,r),e=s(t,r)}n?.push({name:t.slice(a,d),value:h,start:a,end:r})}}function Y(t,i){let n=t.charCodeAt(i);if(y(n)){let a=i+1;while(a<t.length){let d=t.charCodeAt(a);if(d===n)return a+1;a=d===A?C(t,a+1):a+1}return t.length}let e=i;while(e<t.length&&!ae(t,e))e=t.charCodeAt(e)===A?C(t,e+1):e+1;return e}function j(t,i){let n=i;while(n<t.length){let e=t.charCodeAt(n);if(e===L){if(E.lastIndex=n,E.test(t))return E.lastIndex}n=e===A?C(t,n+1):n+1}return t.length}var N=[],K=/\b(?:import|require)\s*(?:[(.]|\/[*/])/;function G(t){return K.test(t)}function P(t){return G(t)?M(t,0):N}function M(t,i){return ze(t).map((n)=>({kind:n.kind,source:n.source?.value??null,start:n.start+i,end:n.end+i}))}function te(t,i){if(!G(t))return N;let n=[],e=0;for(let a of[...i??F(t)].sort((d,r)=>d.start-r.start))n.push(...xe(t,e,a.start)),n.push(...M(t.slice(a.start,a.end),a.start)),e=a.end;return n.push(...xe(t,e,t.length)),n}function F(t){let{module:i,instance:n}=I(t);return[i,n].flatMap((e)=>e?[e.content]:[])}var u=/\b(?:(import|require)\s*\(|import\.meta\.glob\b)/g,T=/\s*(["'`])([^"'`$]+)\1\s*\)/y;function xe(t,i=0,n=t.length){let e=[];u.lastIndex=i;for(let a=u.exec(t);a&&a.index<n;a=u.exec(t)){let d=a.index,r=a[1];if(!r){e.push({kind:"glob",source:null,start:d,end:u.lastIndex});continue}T.lastIndex=u.lastIndex;let h=T.exec(t);if(h){e.push({kind:r,source:h[2],start:d,end:T.lastIndex});continue}let o=t.indexOf(")",u.lastIndex);e.push({kind:r,source:null,start:d,end:o===-1?t.length:o+1})}return e}
|
|
3
|
+
export{ge,I,P,te,xe};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
var J=/<!--[\s\S]*?-->|<script\s+(?:[^>]*|(?:[^=>'"/]+=(?:"[^"]*"|'[^']*'|[^>\s]+)\s+)*)lang=(["'])?([^"' >]+)\1[^>]*>/y;function ie(e){return e.charCodeAt(0)===65279?e.slice(1):e}function f(e){return e>=48&&e<=57}function l(e){if(e===32||e<=13&&e>=9)return!0;if(e<160)return!1;return e===160||e===5760||e>=8192&&e<=8202||e===8232||e===8233||e===8239||e===8287||e===12288||e===65279}function s(e,r){let t=r;while(t<e.length&&l(e.charCodeAt(t)))t++;return t}function ne(e){let r=e.indexOf("<");while(r!==-1){let t=e.charCodeAt(r+1);if(t===33||t===115){J.lastIndex=r;let i=J.exec(e);if(i){if(t===115)return i[2]==="ts";r=e.indexOf("<",J.lastIndex);continue}}r=e.indexOf("<",r+1)}return!1}function re(e,r){let t=e.indexOf("</script",r);while(t!==-1){if(e.charCodeAt(s(e,t+8))===Q)return t;t=e.indexOf("</script",t+8)}return-1}function se(e,r){return s(e,r+8)+1}var Fe=new Set("area base br col command embed hr img input keygen link meta param source track wbr".split(" "));function z(e){return Fe.has(e)||e.charCodeAt(0)===33&&e.toLowerCase()==="!doctype"}function oe(e,r){let t=r;while(t<e.length){let i=e.charCodeAt(t);if(i===47&&e.charCodeAt(t+1)===42){let n=e.indexOf("*/",t+2);t=n===-1?e.length:n+2}else if(i===34||i===39){t++;while(t<e.length){let n=e.charCodeAt(t);if(n===i||n===10)break;t+=n===92?2:1}t++}else if(i===60&&e.startsWith("</style",t))break;else t++}return Math.min(t,e.length)}var Je=34,Ze=39,Ae=47,ke=61,Q=62,y=(e)=>e===Je||e===Ze;function R(e,r,t){let i=r;for(;i<e.length;i++){let n=e.charCodeAt(i);if(l(n)||n===Ae||n===Q)break;if(t&&(y(n)||n===ke))break}return i}function ae(e,r){let t=e.charCodeAt(r);return l(t)||y(t)||t===ke||t===60||t===Q||t===96||t===Ae&&e.charCodeAt(r+1)===Q}var D=0,d=1,O=2,m=3,xe=0,Ce=1,Ee=2,j=3,he=4,I=4,ee=5,V=6,we=7,et={await:d,case:d,default:d,delete:d,extends:d,in:d,instanceof:d,new:d,of:d,return:d,throw:d,typeof:d,void:d,yield:d,do:O,else:O,finally:O,try:O,for:I,if:I,while:I,with:I,import:ee,export:V,require:we},Te=10,te=Array(fe(128,0)).fill(null);for(let e of Object.entries(et)){let r=fe(e[0].charCodeAt(0),e[0].length),t=te[r]??[];t.push(e),te[r]=t}function fe(e,r){return e*(Te+1)+r}function $e(e,r,t){let i=e.charCodeAt(r);if(i>=128||t-r>Te)return m;let n=fe(i,t-r),a=te[n];if(a===null)return m;for(let h=0;h<a.length;h++)if(e.startsWith(a[h][0],r))return a[h][1];return m}var We=new Uint8Array(128);for(let e of["az","AZ","09","__","$$","\\\\"])for(let r=e.charCodeAt(0);r<=e.charCodeAt(1);r++)We[r]=1;function w(e){return e>=128?!l(e):We[e]===1}function be(e,r,t,i=!1){ue(e,tt(e,r,i),r,i,t,void 0,void 0)}function Oe(e,r){ue(e,e.length-1,!1,!1,void 0,r,void 0)}function Re(e,r){ue(e,e.length-1,!1,!1,void 0,void 0,r)}function ue(e,r,t,i,n,a,h){let A=[],u=e.startsWith("#!")?H(e,2):0,g=D,C=!1,P=!1,M=-1,F=()=>{if(g=D,A.length===0)M=-1};while(u<=r){let _=e.charCodeAt(u);if(_===32||_===10||l(_)){u++;continue}if(_===47){let k=de(e,u);if(k!==-1){u=k;continue}}let He=C,Xe=P;if(C=!1,P=!1,w(_)||_===35){let k=u;u=_e(e,u+1);let x=He?m:$e(e,k,u);if(h!==void 0&&(x===ee||x===we))h(k,g===D||g===m);if(n!==void 0&&A.length===0&&(x===V?t||Ie(e,u,i):x===ee&&De(e,u)))u=Math.max(u,n(M!==-1&&x===V?M:k,k)),F();else if(x===V)g=O;else if(x===I)P=!0,g=m;else g=x===d||x===O?x:m;continue}switch(u++,_){case 34:case 39:{let k=u-1;u=ge(e,u,_),a?.(k,u,!1),g=m;break}case 96:{let k=u;u=G(e,u,A),a?.(k,ye(e,u),!0),g=e.charCodeAt(u-1)===123?d:m;break}case 47:{let k=g===m?-1:Pe(e,u);if(k===-1)g=d;else u=Y(e,k),g=m;break}case 40:A.push(Xe?Ce:xe),g=d;break;case 41:g=A.pop()===Ce?O:m;break;case 123:A.push(g===d?j:Ee),g=D;break;case 125:{let k=A.pop();if(k===he){let x=u;u=G(e,u,A),a?.(x,ye(e,u),!0),g=e.charCodeAt(u-1)===123?d:m}else if(k===j)g=m;else F();break}case 59:F();break;case 44:g=A[A.length-1]===j?D:d;break;case 93:g=m;break;case 46:if(f(e.charCodeAt(u)))u=Y(e,u),g=m;else if(e.startsWith("..",u))u+=2,g=d;else C=!0,g=d;break;case 63:if(e.charCodeAt(u)===46&&!f(e.charCodeAt(u+1)))u++,C=!0;g=d;break;case 33:g=g===m&&!l(e.charCodeAt(u-2))?m:d;break;case 43:case 45:if(e.charCodeAt(u)===_&&g===m)u++;else g=d;break;case 61:if(g=e.charCodeAt(u)===62?O:d,g===O)u++;break;case 64:if(A.length===0&&M===-1)M=u-1;g=d;break;default:g=d}}}function ve(e,r,t){let i=e.length,n=[],a=r,h=d,A=!1;while(a<i){let u=e.charCodeAt(a);if(u===32||u===10||l(u)){a++;continue}if(u===47){let C=de(e,a);if(C!==-1){a=C;continue}}let g=A;if(A=!1,w(u)||u===35){let C=a;if(a=_e(e,a+1),!g&&t?.(C,a))return-1;let P=g?m:$e(e,C,a);h=P===d||P===O||P===I?d:m;continue}switch(a++,u){case 34:case 39:a=ge(e,a,u),h=m;break;case 96:a=G(e,a,n),h=e.charCodeAt(a-1)===123?d:m;break;case 47:{let C=h===m?-1:Pe(e,a);if(C===-1)h=d;else a=Y(e,C),h=m;break}case 40:n.push(xe),h=d;break;case 41:if(n.length===0)return a-1;n.pop(),h=m;break;case 123:n.push(h===d?j:Ee),h=D;break;case 125:{if(n.length===0)return a-1;let C=n.pop();if(C===he)a=G(e,a,n),h=e.charCodeAt(a-1)===123?d:m;else h=C===j?m:D;break}case 93:h=m;break;case 46:if(f(e.charCodeAt(a)))a=Y(e,a),h=m;else if(e.startsWith("..",a))a+=2,h=d;else A=!0,h=d;break;case 63:if(e.charCodeAt(a)===46&&!f(e.charCodeAt(a+1)))a++,A=!0;h=d;break;case 33:h=h===m&&!l(e.charCodeAt(a-2))?m:d;break;case 43:case 45:if(e.charCodeAt(a)===u&&h===m)a++;else h=d;break;case 61:if(e.charCodeAt(a)===62)a++;h=d;break;default:h=d}}return i}function Le(e){return e===10||e===13||e===8232||e===8233}function H(e,r){for(let t=r;t<e.length;t++)if(Le(e.charCodeAt(t)))return t;return e.length}function de(e,r){let t=e.charCodeAt(r+1);if(t===47)return H(e,r+2);if(t!==42)return-1;let i=e.indexOf("*/",r+2);return i===-1?e.length:i+2}function _e(e,r){let t=r;while(t<e.length){let i=e.charCodeAt(t);if(i===92)t+=2;else if(w(i))t++;else break}return t}function Y(e,r){let t=r;while(t<e.length&&w(e.charCodeAt(t)))t++;return t}function ge(e,r,t){for(let i=r;i<e.length;i++){let n=e.charCodeAt(i);if(n===t)return i+1;if(n===92)i+=e.startsWith(`\r
|
|
2
|
+
`,i+1)?2:1;else if(n===10||n===13)return i}return e.length}function G(e,r,t){for(let i=r;i<e.length;i++){let n=e.charCodeAt(i);if(n===96)return i+1;if(n===92)i++;else if(n===36&&e.charCodeAt(i+1)===123)return t.push(he),i+2}return e.length}function ye(e,r){let t=e.charCodeAt(r-1);if(t===96)return r-1;if(t===123&&e.charCodeAt(r-2)===36)return r-2;return r}function Pe(e,r){let t=!1;for(let i=r;i<e.length;i++){let n=e.charCodeAt(i);if(Le(n))return-1;if(n===92)i++;else if(n===91)t=!0;else if(n===93)t=!1;else if(n===47&&!t)return i+1}return-1}function E(e,r){let t=r;while(t<e.length){let i=e.charCodeAt(t);if(l(i)){t++;continue}let n=i===47?de(e,t):-1;if(n===-1)return t;t=n}return e.length}function N(e,r,t){return e.charCodeAt(r)===t.charCodeAt(0)&&e.startsWith(t,r)&&!w(e.charCodeAt(r+t.length))}function De(e,r){let t=e.charCodeAt(E(e,r));return t!==40&&t!==46}function Ie(e,r,t){let i=E(e,r);if(N(e,i,"import"))return!0;if(N(e,i,"type"))i=E(e,i+4);let n=e.charCodeAt(i);if(n===42)return!0;if(n!==123)return!1;if(t)return!0;for(i++;i<e.length;i++){let a=e.charCodeAt(i);if(a===125)break;if(a===34||a===39)i=ge(e,i+1,a)-1;else if(a===47)i=Math.max(i,E(e,i)-1)}return N(e,E(e,i+1),"from")}var Z=/import|export/g;function tt(e,r,t){let i=-1;Z.lastIndex=0;for(let n=Z.exec(e);n!==null;n=Z.exec(e)){let a=n.index,h=a+6;if(!w(e.charCodeAt(a-1))&&!w(e.charCodeAt(h))&&(e.charCodeAt(a)===105?De(e,h):r||Ie(e,h,t)))i=a}return i}function c(e,r={}){let t=new X(e);t.exportLists=r.exportLists??!1;let i=[];return be(e,!1,(n,a)=>{let h=t.statement(a);return i.push(h),h.end},t.exportLists),i}function ze(e){let r=new X(e),t=[];return Re(e,(i,n)=>{let a=r.dynamicImport(i,n);if(a!==null)t.push(a)}),t}function Ke(e){let r=new X(e),t=[];return Oe(e,(i,n,a)=>{let h=a?0:1;t.push({kind:a?"template":"string",value:r.cooked(i+h,n-h,a),start:i,end:n})}),t}class X{source;pos=0;end=0;escapeEnd=0;exportLists=!1;constructor(e){this.source=e}statement(e){this.pos=this.end=e+6;let r={kind:this.source.charCodeAt(e)===105?"import":"export",start:e,end:0,source:null,typeOnly:!1,specifiers:[]};if(!(r.kind==="import"?this.import(r):this.export(r)))r.source=null,r.specifiers=[];return r.end=this.end,r}import(e){let r=this.string();if(r!==null)return e.source=r,this.finish();if(this.isWord("type")){let a=this.peekAfter(4);if(a===123||a===42||me(a)&&!this.isWordAfter(4,"from"))e.typeOnly=!0,this.advance(4)}let{specifiers:t,typeOnly:i}=e,n=this.at();if(n!==123&&n!==42){let a=this.pos,h=this.name();if(h===null)return!1;if(this.at()===61)return this.importEquals();if(t.push({kind:"default",imported:"default",local:h,typeOnly:i,start:a,end:this.end}),!this.eat(44))return this.from(e);n=this.at()}if(n===42){let a=this.pos;if(this.advance(1),!this.eatWord("as"))return!1;let h=this.name();if(h===null)return!1;return t.push({kind:"namespace",imported:"*",local:h,typeOnly:i,start:a,end:this.end}),this.from(e)}if(!this.eat(123))return!1;while(!this.eat(125)){let a=this.skip(),h=this.typeModifier()||i,A=this.name(),u=A??this.string()?.value;if(u===void 0)return!1;let g=A;if(this.eatWord("as"))g=this.name();if(g===null)return!1;if(t.push({kind:"named",imported:u,local:g,typeOnly:h,start:a,end:this.end}),!this.eat(44)&&this.at()!==125)return!1}return this.from(e)}export(e){if(this.eatWord("import")){if(this.isWord("type")&&me(this.peekAfter(4))&&!this.isWordAfter(4,"from"))e.typeOnly=!0,this.advance(4);return this.name()!==null&&this.at()===61&&this.importEquals()}if(this.isWord("type")){let i=this.peekAfter(4);if(i===123||i===42)e.typeOnly=!0,this.advance(4)}let{specifiers:r,typeOnly:t}=e;if(this.at()===42){let i=this.pos;this.advance(1);let n=null;if(this.eatWord("as")){if(n=this.moduleExportName(),n===null)return!1}return r.push({kind:n===null?"all":"namespace",local:"*",exported:n,typeOnly:t,start:i,end:this.end}),this.from(e)}if(!this.eat(123))return!1;while(!this.eat(125)){let i=this.skip(),n=this.typeModifier()||t,a=this.moduleExportName();if(a===null)return!1;let h=a;if(this.eatWord("as"))h=this.moduleExportName();if(h===null)return!1;if(r.push({kind:"named",local:a,exported:h,typeOnly:n,start:i,end:this.end}),!this.eat(44)&&this.at()!==125)return!1}if(this.exportLists&&!this.isWord("from")){for(let i of r)i.kind="local";return this.eat(59),!0}return this.from(e)}dynamicImport(e,r){let t=this.source.charCodeAt(e)===105;this.pos=this.end=e+(t?6:7);let i=t?"import":"require";if(t&&this.eat(46)){if(!this.eatWord("meta")||!this.eat(46)||!this.eatWord("glob")||!this.typeArguments())return null;i="glob"}if(!this.eat(40))return null;let n=this.skip(),a=this.string()??this.template(),h=this.at()===41?this.pos:-1;if(h===-1){if(this.at()!==44)a=null;h=ve(this.source,n)}if(r&&i!=="glob"){let A=this.source.charCodeAt(E(this.source,h+1));if(A===123||A===58)return null}return{kind:i,source:a,start:e,end:Math.min(h+1,this.source.length)}}typeArguments(){if(this.at()!==60)return!0;let e=this.source,r=0;for(let t=this.pos;t<e.length;t=E(e,t+1)){let i=e.charCodeAt(t);if(i===34||i===39||i===96){let n=e.indexOf(e[t],t+1);if(n===-1)return!1;t=n}else if(i===60)r++;else if(i===62&&e.charCodeAt(t-1)!==61){if(--r===0)return this.advance(t+1-this.pos),!0}}return!1}template(){let e=this.source,r=this.skip();if(e.charCodeAt(r)!==96)return null;for(let t=r+1;t<e.length;t++){let i=e.charCodeAt(t);if(i===96){let n=this.cooked(r+1,t,!0);if(n===null)return null;return this.advance(t+1-r),{value:n,start:r,end:t+1}}if(i===92)t++;else if(i===36&&e.charCodeAt(t+1)===123)return null}return null}typeModifier(){if(!this.isWord("type"))return!1;let e=this.peekAfter(4);if(e===34||e===39||me(e)&&!this.isWordAfter(4,"as"))return this.advance(4),!0;return!1}importEquals(){if(this.advance(1),this.isWord("require")&&this.peekAfter(7)===40){if(this.advance(7),this.eat(40),this.string()===null||!this.eat(41))return!1}else do if(this.name()===null)return!1;while(this.eat(46));return this.eat(59),!0}from(e){if(!this.eatWord("from"))return!1;return e.source=this.string(),e.source!==null&&this.finish()}finish(){let e=this.isWord("with")?4:0;if(this.isWord("assert")&&H(this.source,this.end)>=this.pos)e=6;if(e!==0&&this.peekAfter(e)===123){this.advance(e),this.eat(123);while(!this.eat(125))if(this.string()===null&&this.name()===null&&!this.eat(58)&&!this.eat(44))return!1}return this.eat(59),!0}skip(){return this.pos=E(this.source,this.pos),this.pos}at(){return this.source.charCodeAt(this.skip())}advance(e){this.pos+=e,this.end=this.pos}peekAfter(e){return this.source.charCodeAt(E(this.source,this.pos+e))}isWordAfter(e,r){return N(this.source,E(this.source,this.pos+e),r)}eat(e){if(this.at()!==e)return!1;return this.advance(1),!0}isWord(e){return N(this.source,this.skip(),e)}eatWord(e){if(!this.isWord(e))return!1;return this.advance(e.length),!0}moduleExportName(){return this.name()??this.string()?.value??null}name(){let e=this.source,r=this.skip();if(!w(e.charCodeAt(r))||f(e.charCodeAt(r)))return null;let t="",i=r,n=r;while(n<e.length){let a=e.charCodeAt(n);if(a===92){if(e.charCodeAt(n+1)!==117)return null;let h=this.unicodeEscape(n+2);if(h===null)return null;t+=e.slice(i,n)+h,n=i=this.escapeEnd}else if(w(a))n++;else break}return this.advance(n-r),t+e.slice(i,n)}string(){let e=this.source,r=this.skip(),t=e.charCodeAt(r);if(t!==34&&t!==39)return null;let i="",n=r+1;for(let a=n;a<e.length;){let h=e.charCodeAt(a);if(h===t)return this.advance(a+1-r),{value:i+e.slice(n,a),start:r,end:a+1};if(h===10||h===13)return null;if(h===92){let A=this.escape(a+1);if(A===null)return null;i+=e.slice(n,a)+A,a=n=this.escapeEnd}else a++}return null}cooked(e,r,t){let i=this.source,n="",a=e;for(let h=e;h<r;){let A=i.charCodeAt(h);if(A===92){let u=this.escape(h+1);if(u===null)return null;n+=i.slice(a,h)+u,h=a=this.escapeEnd}else if(A===13&&t)n+=`${i.slice(a,h)}
|
|
3
|
+
`,h+=i.charCodeAt(h+1)===10?2:1,a=h;else h++}return n+i.slice(a,r)}escape(e){let r=this.source.charCodeAt(e);switch(this.escapeEnd=e+1,r){case 110:return`
|
|
4
|
+
`;case 114:return"\r";case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 48:return f(this.source.charCodeAt(e+1))?null:"\x00";case 120:return this.hexEscape(e+1,2);case 117:return this.unicodeEscape(e+1);case 13:if(this.source.charCodeAt(e+1)===10)this.escapeEnd++;return"";case 10:case 8232:case 8233:return"";default:return f(r)||e>=this.source.length?null:String.fromCharCode(r)}}unicodeEscape(e){if(this.source.charCodeAt(e)!==123)return this.hexEscape(e,4);let r=0,t=e+1;for(;this.source.charCodeAt(t)!==125;t++){let i=Ne(this.source.charCodeAt(t));if(i===-1)return null;if(r=r*16+i,r>1114111)return null}if(t===e+1)return null;return this.escapeEnd=t+1,String.fromCodePoint(r)}hexEscape(e,r){let t=0;for(let i=e;i<e+r;i++){let n=Ne(this.source.charCodeAt(i));if(n===-1)return null;t=t*16+n}return this.escapeEnd=e+r,String.fromCharCode(t)}}function me(e){return e!==92&&w(e)&&!f(e)}function Ne(e){if(f(e))return e-48;let r=e|32;return r>=97&&r<=102?r-87:-1}import{realpathSync as rt}from"node:fs";var le=/\.svelte$/,qe=/\.js$/,it=/[?#].*$/,B=/\.(css|scss|sass|less|styl|stylus|pcss|postcss)$/;function L(e){return le.test(e)}function o(e){return e.replace(it,"")}function b(e){try{return rt(e)}catch{return}}function ce(e){return e instanceof Error?e.message:String(e)}function pe(e,r){return`${e}\x00${r}`}var Me=/[\w-]+/g,nt={marker:"",text:(e)=>Array.from(e.matchAll(Me),([r])=>`.${r}`),script(e,r){for(let[t]of e.matchAll(Me))r.add(`.${t}`)}};function q(e){return e.classTokens??(e.styles?nt:void 0)}var st=/[.*+?^${}()|[\]\\/]/g;function U(e){return e.replace(st,"\\$&")}function je(e){let r=new WeakMap;return(t)=>{let i=r.get(t);if(i===void 0)i=e(t),r.set(t,i);return i}}var at=je(lt);function lt(e){let r=U(e.name),t=`${r}\\/${U(e.srcDir)}\\/`;return{argument:new RegExp(`["'\`]${r}\\b`),directComponentPath:new RegExp(`^${t}(.+\\.svelte)$`),contextKey:new RegExp(`(["'\`])(${U(e.contextKeyPrefix)}[^"'\`\\s]+)\\1`,"g"),valueSubpath:new RegExp(`["'\`]${r}\\/(?![^"'\`]*\\.(?:svelte|css)["'\`])`),scriptSpecifier:new RegExp(`["']${t}(?![^"']*\\.svelte["'])[^"']*["']`),barrelImport:new RegExp(`\\bimport\\s+(type\\s+)?\\{([^}]*)\\}\\s*from\\s*(["'])${r}\\3`,"g"),barrelSpecifier:new RegExp(`["']${r}["']`,"g"),directComponentSpecifier:new RegExp(`["']${t}([^"']+\\.svelte)["']`,"g"),componentSource:new RegExp(e.componentPackages.length>0?`\\.svelte$|^(?:${e.componentPackages.map(U).join("|")})(\\/|$)`:"\\.svelte$"),importText:new RegExp(`\\b(?:from|import|require)\\s*\\(?\\s*["'\`]${r}(?:["'\`]|\\/)`),dynamicImport:new RegExp(`\\b(?:import|require)\\s*\\(\\s*(["'\`])(${r}(?:\\/[^"'\`]*)?)\\1`,"g"),directComponentName:new RegExp(`^${t}.+\\/([A-Za-z0-9_]+)\\.svelte$`),segment:new RegExp(`(^|[\\\\/])${r}([\\\\/]|$)`),srcSegment:new RegExp(`(?:^|[\\\\/])${r}[\\\\/]${U(e.srcDir)}[\\\\/](.+)$`)}}var ot=/\\/g;class Se{spec;patterns;constructor(e){this.spec=e,this.patterns=at(e)}get name(){return this.spec.name}get logPrefix(){return`${this.spec.tool}:`}get srcPrefix(){return`${this.name}/${this.spec.srcDir}/`}get barrelKey(){return this.spec.barrel}moduleKey(e){return this.patterns.srcSegment.exec(e)?.[1].replace(ot,"/")}importKey(e){let r=this.moduleKey(o(e));return r&&(r===this.barrelKey||L(r))?r:void 0}isSpecifier(e){return e===this.name||e.startsWith(`${this.name}/`)}isComponentFile(e){return L(e)&&this.patterns.segment.test(e)}}var p=je((e)=>new Se(e));import{existsSync as ht,readFileSync as ct,realpathSync as Ue,statSync as ft}from"node:fs";import{readdir as ut}from"node:fs/promises";import dt,{createRequire as Be}from"node:module";import W from"node:path";var pt=/\.(js|svelte)$/;async function v(e){return(await ut(e,{recursive:!0})).filter((t)=>pt.test(t)).map((t)=>t.split(W.sep).join("/")).sort((t,i)=>t.localeCompare(i))}var gt=Be(import.meta.url);function mt(e,r){let{findPnpApi:t}=dt;if(typeof t!=="function")return;let i=`${W.resolve(r)}${W.sep}`;try{let n=t(i)?.resolveToUnqualified(e,i);return n?W.resolve(n):void 0}catch{return}}function Qe(e,r=process.cwd()){let t=mt(e,r);if(t)return t;let i=Be(W.join(r,"__resolve__.js")),n=new Set([...i.resolve.paths(e)??[],...gt.resolve.paths(e)??[]]);for(let a of n){let h=W.join(a,e);if(ht(W.join(h,"package.json")))return h}return}function T(e,r){let t=Qe(e,r);if(!t)throw Error(`Could not resolve an installed "${e}" package.`);return t}function K(e,r=process.cwd()){let t=Qe(e,r);if(!t)return;let i=Number.parseInt(String(Ve(t)),10);return Number.isNaN(i)?void 0:i}function Ve(e){try{return JSON.parse(ct(W.join(e,"package.json"),"utf8")).version}catch{return}}var Ye=(e)=>!e.split(W.sep).includes("node_modules");function Ge(e){try{return Ye(Ue(e))}catch{return!1}}async function S(e,r){let t=Ve(e),i;try{i=Ue(e)}catch{return""}let n=`${i}@${String(t)}`;if(t!==void 0&&!Ye(i))return n;let a=W.join(e,r);try{for(let h of await v(a))n+=`:${ft(W.join(a,h)).mtimeMs}`}catch{}return n}
|
|
5
|
+
export{ie,f,l,s,ne,re,se,z,oe,y,R,ae,be,ve,c,ze,Ke,le,qe,B,L,o,b,ce,pe,q,Se,p,v,T,K,Ge,S};
|