@stacksjs/stx 0.2.802 → 0.2.805
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/dist/{chunk-bbt09ebh.js → chunk-0ekdbagy.js} +3 -3
- package/dist/{chunk-brhas9mp.js → chunk-0rjcbqk3.js} +2 -2
- package/dist/{chunk-p4aaxpaw.js → chunk-0svj1nfa.js} +4 -4
- package/dist/{chunk-wvnzq8w8.js → chunk-117sk8mx.js} +4 -4
- package/dist/{chunk-1pz11ez9.js → chunk-1carv1dw.js} +1 -1
- package/dist/{chunk-3dtp59r9.js → chunk-1qp6vqdd.js} +3 -3
- package/dist/{chunk-enpx5t99.js → chunk-1ydz2w3t.js} +1 -1
- package/dist/chunk-21yscass.js +2 -0
- package/dist/{chunk-zwptpjjt.js → chunk-2k8vxve1.js} +6 -6
- package/dist/chunk-2wdrznkm.js +2 -0
- package/dist/{chunk-9gwhs0gk.js → chunk-2ws2qe1k.js} +2 -2
- package/dist/{chunk-aj5na3d3.js → chunk-2zkzkjmr.js} +1 -1
- package/dist/chunk-3e85etrf.js +2 -0
- package/dist/{chunk-bs02d6mm.js → chunk-3ec6jf9b.js} +30 -30
- package/dist/{chunk-b9d70mgr.js → chunk-3vpgr6nk.js} +3 -3
- package/dist/{chunk-xrvdef6x.js → chunk-3z0e637x.js} +1 -1
- package/dist/{chunk-wy0gghvh.js → chunk-427mhgje.js} +1 -1
- package/dist/chunk-4xtgh99h.js +3 -0
- package/dist/chunk-4y304qhn.js +2 -0
- package/dist/chunk-5a1273xd.js +2 -0
- package/dist/chunk-5eqna31h.js +2 -0
- package/dist/chunk-5kqbj292.js +2 -0
- package/dist/{chunk-g02jnsz5.js → chunk-5pm5zq2f.js} +1 -1
- package/dist/chunk-6a97a9wk.js +2 -0
- package/dist/{chunk-h1dwth11.js → chunk-6dcc4ezx.js} +1 -1
- package/dist/{chunk-nhfksrce.js → chunk-6dg45cs2.js} +1 -1
- package/dist/chunk-6g6542n1.js +2 -0
- package/dist/chunk-6pch0363.js +2 -0
- package/dist/{chunk-7yb82rm6.js → chunk-6s9bk98p.js} +2 -2
- package/dist/{chunk-e1g3ns8y.js → chunk-6tj3a33f.js} +4 -4
- package/dist/{chunk-mt95md1e.js → chunk-7agp0wj2.js} +1 -1
- package/dist/{chunk-y9bj3566.js → chunk-7xs45trj.js} +2 -2
- package/dist/chunk-7yycf63z.js +2 -0
- package/dist/{chunk-xbvx8j82.js → chunk-85w7kf2j.js} +1 -1
- package/dist/{chunk-3vfxn6g5.js → chunk-8e99wh2m.js} +1 -1
- package/dist/{chunk-v18816jj.js → chunk-8z10r3sa.js} +5 -5
- package/dist/chunk-8z9qtgjp.js +2 -0
- package/dist/chunk-9wmjmas8.js +2 -0
- package/dist/{chunk-x82zksaj.js → chunk-a0r4dpzs.js} +2 -2
- package/dist/{chunk-nya33asw.js → chunk-a706x1s8.js} +5 -5
- package/dist/chunk-aayq1a90.js +2 -0
- package/dist/chunk-aqydav9y.js +2 -0
- package/dist/{chunk-n7arptzc.js → chunk-baj6w8ja.js} +2 -2
- package/dist/{chunk-8fvgsd9v.js → chunk-bejj0gra.js} +3 -3
- package/dist/{chunk-wpendr22.js → chunk-c5vzr1va.js} +2 -2
- package/dist/{chunk-eayewa2s.js → chunk-cfbpvm5e.js} +2 -2
- package/dist/{chunk-pamtcna7.js → chunk-cwg1m0yp.js} +1 -1
- package/dist/{chunk-d8rcba53.js → chunk-d47m4qat.js} +2 -2
- package/dist/chunk-d62tf4rh.js +2 -0
- package/dist/chunk-da886asf.js +2 -0
- package/dist/{chunk-fsfj0s13.js → chunk-dhv8ne0m.js} +3 -3
- package/dist/{chunk-7tkxshah.js → chunk-dskgez6y.js} +11 -11
- package/dist/{chunk-antc6crh.js → chunk-dvbd5fxe.js} +1 -1
- package/dist/{chunk-rxhymzj8.js → chunk-e39nkbt4.js} +3 -3
- package/dist/chunk-et8n16k2.js +2 -0
- package/dist/chunk-ewzdsksb.js +2 -0
- package/dist/{chunk-3j9zzpbd.js → chunk-f0zatmhn.js} +3 -3
- package/dist/chunk-f3b37bt7.js +2 -0
- package/dist/{chunk-cs38hg43.js → chunk-f3n4vkgk.js} +4 -4
- package/dist/chunk-f6f93b8g.js +2 -0
- package/dist/chunk-f8g151t2.js +2 -0
- package/dist/chunk-fdrk6pzr.js +2 -0
- package/dist/chunk-fg0amm0c.js +2 -0
- package/dist/{chunk-qx5jhe7h.js → chunk-ftfayqmk.js} +2 -2
- package/dist/{chunk-byatzyvf.js → chunk-g0nbypak.js} +2 -2
- package/dist/chunk-g48x8yme.js +2 -0
- package/dist/{chunk-6n5cbyes.js → chunk-gb3tv53p.js} +2 -2
- package/dist/{chunk-ewhkvqce.js → chunk-gebb12ak.js} +11 -11
- package/dist/{chunk-wes7vsze.js → chunk-h5rcc2rx.js} +1 -1
- package/dist/chunk-h9yvb9qn.js +2 -0
- package/dist/{chunk-dbbc84mj.js → chunk-hn2me1qx.js} +2 -2
- package/dist/{chunk-7j4tf0ba.js → chunk-htrm7vx7.js} +1 -1
- package/dist/{chunk-gjf8cjdt.js → chunk-hwcfgs3e.js} +3 -3
- package/dist/chunk-jngx8bzh.js +2 -0
- package/dist/{chunk-c36bj74x.js → chunk-jrsz8e9x.js} +1 -1
- package/dist/{chunk-mz1kffvs.js → chunk-k86573fe.js} +4 -4
- package/dist/chunk-kqnsztam.js +2 -0
- package/dist/chunk-m5cdkb11.js +2 -0
- package/dist/{chunk-2vqpz4qv.js → chunk-m7hfcxt3.js} +2 -2
- package/dist/{chunk-ddk34ppv.js → chunk-mmh2k7ab.js} +3 -3
- package/dist/{chunk-sxee2rxz.js → chunk-ncyjaxyz.js} +1 -1
- package/dist/chunk-nrqv8s48.js +2 -0
- package/dist/{chunk-06hc6rs6.js → chunk-nsxjt6h3.js} +1 -1
- package/dist/{chunk-0vztrb90.js → chunk-p48wb9v7.js} +15 -15
- package/dist/{chunk-ved3r01r.js → chunk-pnf0ev9m.js} +86 -86
- package/dist/chunk-pr6nrg6x.js +2 -0
- package/dist/{chunk-we6jnjjp.js → chunk-r1vkk7qp.js} +2 -2
- package/dist/chunk-r4mpr1qr.js +2 -0
- package/dist/{chunk-q7zwv88b.js → chunk-rpen41w3.js} +2 -2
- package/dist/{chunk-esm9sdyf.js → chunk-s9xs2ff4.js} +6 -6
- package/dist/{chunk-znx5m1jv.js → chunk-sphc7xzx.js} +1 -1
- package/dist/chunk-syvsj91a.js +2 -0
- package/dist/chunk-t2tyvphs.js +2 -0
- package/dist/{chunk-fy6sdbak.js → chunk-tanza35f.js} +8 -8
- package/dist/{chunk-4gf3khd9.js → chunk-tb6s07sr.js} +1 -1
- package/dist/{chunk-kzny87pz.js → chunk-tdcgskyy.js} +1 -1
- package/dist/{chunk-rs0ejvjm.js → chunk-tesytdw5.js} +1 -1
- package/dist/chunk-tfv50vab.js +2 -0
- package/dist/chunk-tj4gpffg.js +2 -0
- package/dist/{chunk-m4w61tyq.js → chunk-tns9qjwk.js} +9 -9
- package/dist/{chunk-xndhzwdj.js → chunk-twqd8vme.js} +5 -5
- package/dist/{chunk-gk214p91.js → chunk-tx9wvkvp.js} +6 -6
- package/dist/{chunk-x0ttkvr7.js → chunk-txs6mfvk.js} +3 -3
- package/dist/{chunk-24x7s0x5.js → chunk-tyvt5pfm.js} +4 -4
- package/dist/chunk-tzb0n60s.js +2 -0
- package/dist/{chunk-qpvwxppw.js → chunk-vbc8a8fh.js} +4 -4
- package/dist/{chunk-s9b6abkb.js → chunk-vkn133cs.js} +2 -2
- package/dist/chunk-vp6ysefr.js +2 -0
- package/dist/{chunk-dxemdr58.js → chunk-vqydn3xj.js} +13 -13
- package/dist/chunk-w2q6zmwn.js +2 -0
- package/dist/chunk-w31y3j3k.js +2 -0
- package/dist/chunk-w5xq1217.js +2 -0
- package/dist/{chunk-hrrrf46j.js → chunk-w6n4y2xg.js} +2 -2
- package/dist/chunk-x2hc3zth.js +2 -0
- package/dist/{chunk-e5fszb5z.js → chunk-x6322cmf.js} +2 -2
- package/dist/{chunk-s81y1dw3.js → chunk-xmntrbxe.js} +1 -1
- package/dist/{chunk-c1bsagbe.js → chunk-xrd1md4j.js} +6 -6
- package/dist/{chunk-hzhsg5j7.js → chunk-xwe3fysm.js} +5 -5
- package/dist/chunk-y5ah4ghz.js +2 -0
- package/dist/{chunk-a5byhf8f.js → chunk-y7sf7aj0.js} +1 -1
- package/dist/{chunk-t65tn8ee.js → chunk-ybjfr7e8.js} +2 -2
- package/dist/{chunk-m0c64sna.js → chunk-ycr9bkww.js} +1 -1
- package/dist/{chunk-r9eyepbk.js → chunk-yg0g5rm9.js} +6 -6
- package/dist/chunk-yjezsy4p.js +2 -0
- package/dist/{chunk-casq5t61.js → chunk-z843epx3.js} +2 -2
- package/dist/cli.js +19 -19
- package/dist/client-script.js +11 -10
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/native/runtime/craft-bridge.js +15 -1
- package/dist/pwa.js +3 -3
- package/dist/ssg.js +4 -4
- package/package.json +5 -5
- package/dist/chunk-077dwzpp.js +0 -2
- package/dist/chunk-1338vj5g.js +0 -2
- package/dist/chunk-14qhn86r.js +0 -2
- package/dist/chunk-27p6cxa2.js +0 -2
- package/dist/chunk-2jwmtbsj.js +0 -2
- package/dist/chunk-4q2fh4r4.js +0 -2
- package/dist/chunk-50be1xy0.js +0 -2
- package/dist/chunk-5hgghq24.js +0 -2
- package/dist/chunk-6cgak0k1.js +0 -2
- package/dist/chunk-6fq522rd.js +0 -2
- package/dist/chunk-77v7g18n.js +0 -2
- package/dist/chunk-8fnhv8jq.js +0 -2
- package/dist/chunk-8hm4a8p2.js +0 -2
- package/dist/chunk-9736003n.js +0 -2
- package/dist/chunk-9767yz39.js +0 -2
- package/dist/chunk-a0xxm3eh.js +0 -2
- package/dist/chunk-b22yj5j5.js +0 -2
- package/dist/chunk-b29x9hsz.js +0 -2
- package/dist/chunk-bz3papjy.js +0 -2
- package/dist/chunk-d1c1qggs.js +0 -2
- package/dist/chunk-dwn8ye99.js +0 -2
- package/dist/chunk-e88bsw36.js +0 -2
- package/dist/chunk-fq1dw4ph.js +0 -3
- package/dist/chunk-gabw11g3.js +0 -2
- package/dist/chunk-gxrpf87x.js +0 -2
- package/dist/chunk-j0jgc426.js +0 -2
- package/dist/chunk-jdjv5x6q.js +0 -2
- package/dist/chunk-jkn9garq.js +0 -2
- package/dist/chunk-jn6g5n02.js +0 -2
- package/dist/chunk-jy9qmwpm.js +0 -2
- package/dist/chunk-krqj3cx9.js +0 -2
- package/dist/chunk-kzt46v41.js +0 -2
- package/dist/chunk-md55r6zp.js +0 -2
- package/dist/chunk-mv9k42dn.js +0 -2
- package/dist/chunk-ntwgk0tf.js +0 -2
- package/dist/chunk-sfvdj9dj.js +0 -2
- package/dist/chunk-szma9dby.js +0 -2
- package/dist/chunk-tkb335d7.js +0 -2
- package/dist/chunk-txyyvtdp.js +0 -2
- package/dist/chunk-vxd3akt4.js +0 -2
- package/dist/chunk-wf6vjd41.js +0 -2
- package/dist/chunk-wghv9vr6.js +0 -2
- package/dist/chunk-whq40bdm.js +0 -2
- package/dist/chunk-yxsrerew.js +0 -2
- package/dist/chunk-z0kx564w.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ze,xn,Ws,Si,N}from"./chunk-2vqpz4qv.js";import{vn}from"./chunk-casq5t61.js";import{Nr,k,ul,at,Ai,dl}from"./chunk-t65tn8ee.js";import{P}from"./chunk-r9e0r6jx.js";import{R,qs,u,f,jt,d,q,F,w,Js,_e,Ve,Ys}from"./chunk-ewhkvqce.js";import{r,ge}from"./chunk-b9d70mgr.js";import{g}from"./chunk-0dve54ne.js";import{K}from"./chunk-wpendr22.js";import Qe from"path";import kt from"process";import{AsyncLocalStorage as Bo}from"async_hooks";var or=new Bo;function mn(e){return e.__stx_server_data??={pending:new Map,values:new Map}}function cr(e,t){return or.run(mn(e),t)}async function ar(e,t){let i=or.getStore();if(!i)throw Error("useServerData must run inside a <script server> render");if(typeof e!=="string"||!e.trim())throw TypeError("useServerData requires a non-empty string key");let n=i.pending.get(e);if(n)return n;let c=Promise.resolve().then(t).then((l)=>{let a=JSON.stringify(l,(v,E)=>{if(E===void 0||typeof E==="function"||typeof E==="symbol"||typeof E==="bigint"||typeof E==="number"&&!Number.isFinite(E))throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);if(E&&typeof E==="object"&&!Array.isArray(E)&&Object.getPrototypeOf(E)!==Object.prototype&&Object.getPrototypeOf(E)!==null)throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);return E}),y=JSON.parse(a);return i.values.set(e,y),y}).catch((l)=>{throw i.pending.delete(e),l});return i.pending.set(e,c),c}function Cr(e){let t=e.__stx_server_data;if(!t?.values.size)return"";return`<script data-stx-scoped data-stx-server-data type="application/json">${JSON.stringify(Object.fromEntries(t.values)).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}</script>`}function H(e,t=!1){let i=r(e),n=[],c=new Set,l=0,a=0,y=i.length,v=()=>{if(l!==0)return;let E=i.slice(a).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*(?:[!:;,\n]|=(?!=)|$)/);if(E){if(t&&E[1]==="const")return;let I=E[2];if(!c.has(I))n.push(I),c.add(I);return}let A=i.slice(a).match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(A){if(t&&i.slice(a).startsWith("const"))return;A[1].split(",").forEach((I)=>{let j=I.trim();if(!j)return;let Q=j.indexOf(":"),z=(Q>=0?j.slice(Q+1).trim():j).split(/[\s=]/)[0];if(z&&!c.has(z))n.push(z),c.add(z)});return}let D=i.slice(a).match(/^(?:const|let|var)\s+\[([^\]]+)\]\s*=/);if(D){if(t&&i.slice(a).startsWith("const"))return;D[1].split(",").forEach((I)=>{let j=I.trim().replace(/^\.\.\./,"");if(!j)return;let Q=j.split(/[\s=]/)[0];if(Q&&!c.has(Q))n.push(Q),c.add(Q)});return}if(t)return;let B=i.slice(a).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(B){let I=B[1];if(!c.has(I))n.push(I),c.add(I);return}let M=i.slice(a).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(M){let I=M[1];if(!c.has(I))n.push(I),c.add(I)}};while(a<y){if(i[a]==="{"){l++,a++;continue}if(i[a]==="}"){l--,a++;continue}if(l===0&&/[a-z]/i.test(i[a])&&(a===0||/\s|[;{}()]/.test(i[a-1])))v();a++}return n.join(", ")}function Is(e){return`{ enumerable: true, configurable: true, get() { return ${e} }, set(__stxValue_${e}) { ${e} = __stxValue_${e} } }`}function Wo(e,t=H(e).split(",").map((i)=>i.trim()).filter(Boolean)){let i=new Set(H(e,!0).split(",").map((n)=>n.trim()));return t.map((n)=>i.has(n)?`get ${n}() { return ${n} }, set ${n}(__stxValue_${n}) { ${n} = __stxValue_${n} }`:n).join(", ")}function Os(e,t){let i=`{ ${Wo(e,t)} }`;return H(e).split(",").some((n)=>n.trim()==="__stxLiveBindings")?`Object.defineProperties(${i}, Object.getOwnPropertyDescriptors(__stxLiveBindings))`:i}import Cn from"fs";import Ae from"path";function V(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").toLowerCase()}var lr=new Map;function yr(e,t=!0){let i=lr.get(e);if(t&&i)return i;let n=new Map,c=[Ae.join(e,"src"),Ae.join(e,"dist"),e];function l(a,y){if(y>6)return;let v;try{v=Cn.readdirSync(a,{withFileTypes:!0})}catch{return}for(let E of v){let A=Ae.join(a,E.name);if(E.isDirectory()){if(E.name==="node_modules"||E.name.startsWith("."))continue;l(A,y+1)}else if(E.isFile()&&E.name.endsWith(".stx")){let D=E.name.slice(0,-4);if(!n.has(D))n.set(D,A);let B=D.toLowerCase();if(!n.has(B))n.set(B,A);let M=V(D);if(!n.has(M))n.set(M,A)}}}for(let a of c)if(l(a,0),n.size>0)break;if(t)lr.set(e,n);return n}function Ns(e,t){if(e.startsWith(".")||e.startsWith("/"))return null;let i=t;while(!0){let n=Ae.join(i,"node_modules",e);try{if(Cn.statSync(n).isDirectory())return n}catch{}let c=Ae.dirname(i);if(c===i)return null;i=c}}function Ms(e,t,i={}){return[Ae.resolve(Ae.dirname(t),`${e}.stx`),Ae.resolve(Ae.dirname(t),e),Ae.resolve(i.componentsDir||"components",`${e}.stx`),Ae.resolve(i.componentsDir||"components",e),e.endsWith(".stx")?e:`${e}.stx`]}function ur(e){let t=e.endsWith(".stx")?e.slice(0,-4):e,i=t.split("-").map((c)=>c.charAt(0).toUpperCase()+c.slice(1)).join(""),n=V(t);return[t,i,n]}function oi(e,t){let[i,n,c]=ur(e);for(let l of[i,i.toLowerCase(),n,c]){let a=t?.__importedComponents?.get(l);if(a!==void 0)return a}}function*ii(e,t,i={},n){let c=ur(e);if(c[0].startsWith("./")||c[0].startsWith("../")){yield Ae.resolve(Ae.dirname(t),`${c[0]}.stx`);return}let l=[...new Set(c.map((v)=>`${v}.stx`))],a=i.projectRoot||process.cwd(),y=[...n?.__originalFilePath?[Ae.join(Ae.dirname(n.__originalFilePath),"components")]:[],...i.componentsDir?[i.componentsDir]:[],Ae.join(Ae.dirname(t),"components"),Ae.resolve(a,"src/components"),Ae.resolve(a,"components"),...import.meta.dir?[Ae.resolve(import.meta.dir,"components")]:[]];for(let v of new Set(y)){for(let E of l)yield Ae.join(v,E);try{for(let E of Cn.readdirSync(v,{withFileTypes:!0}))if(E.isDirectory())for(let A of l)yield Ae.join(v,E.name,A)}catch{}}}function fr(e,t,i={},n){let c=oi(e,n);if(c!==void 0)return c;for(let l of ii(e,t,i,n))try{if(Cn.statSync(l,{throwIfNoEntry:!1})?.isFile())return l}catch{}return null}function Ds(e,t=[],i={}){let n=new Set([...e].map((E)=>E.replace(/[-_]/g,"").toLowerCase()));if(!n.has("src")||!n.has("alt")&&!n.has("decorative"))return!1;let c=new Map(Object.entries(i).map(([E,A])=>[E.replace(/[-_]/g,"").toLowerCase(),A])),l=c.get("alt"),a=c.get("decorative"),y=typeof l==="string"&&!!l.trim(),v=typeof a==="string"?!["false","0","off","no"].includes(a.trim().toLowerCase()):Boolean(a);if(!y&&!v)return!1;if(["source","resizemode","defaultsource","provider","format","densities","quality","preload","modifiers","preset"].some((E)=>n.has(E)))return!1;if([...t].some((E)=>!["load","error"].includes(E.replace(/^@/,"").split(".")[0].toLowerCase())))return!1;return["fit","objectfit","position","objectposition","rounded","aspectratio","zoomonhover","sources","webpsrc","webpsrcset"].some((E)=>n.has(E))}import Hn from"fs";import ce from"path";import ht from"path";import qt from"fs";var zo=new Set(["touchstart","touchmove","wheel","mousewheel"]);function os(e,t){if(t.passive)return!0;if(t.prevent||t.nonpassive)return!1;return zo.has(e.toLowerCase())}var pr=new Set(["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","mouseover","mouseout","contextmenu","wheel","keydown","keyup","keypress","submit","reset","change","input","focus","blur","focusin","focusout","select","invalid","touchstart","touchend","touchmove","touchcancel","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","scroll","resize","load","error","abort","animationstart","animationend","animationiteration","transitionstart","transitionend","transitionrun","transitioncancel","mounted","unmounted"]),dr={enter:"Enter",tab:"Tab",delete:"Delete",backspace:"Backspace",esc:"Escape",escape:"Escape",space:" ",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",home:"Home",end:"End",pageup:"PageUp",pagedown:"PageDown"},Fo=new Set(["ctrl","alt","shift","meta"]),hr={left:0,middle:1,right:2};function gr(e){let t={prevent:!1,stop:!1,once:!1,capture:!1,self:!1,passive:!1,nonpassive:!1,keys:[],systemKeys:[],mouse:null,debounce:null,throttle:null};for(let i of e){let n=i.toLowerCase();if(n==="prevent")t.prevent=!0;else if(n==="stop")t.stop=!0;else if(n==="once")t.once=!0;else if(n==="capture")t.capture=!0;else if(n==="self")t.self=!0;else if(n==="passive")t.passive=!0;else if(n==="nonpassive")t.nonpassive=!0;else if(Fo.has(n))t.systemKeys.push(n);else if(n in hr)t.mouse=n;else if(n in dr||/^[a-z]$/.test(n))t.keys.push(dr[n]||n.toUpperCase());else if(n.startsWith("debounce")){let c=n.match(/debounce(?:\.(\d+))?/);t.debounce=c?.[1]?Number.parseInt(c[1],10):300}else if(n.startsWith("throttle")){let c=n.match(/throttle(?:\.(\d+))?/);t.throttle=c?.[1]?Number.parseInt(c[1],10):300}}return t}function $r(e,t=""){let i=[],n=0,c=/<([a-z][a-z0-9-]*)\s+([^>]*@[a-z][^>]*)>/gi,l;while((l=c.exec(e))!==null){let[a,y,v]=l,E=l.index,A=E+a.length,D=`__stx_evt_${t}${n++}`,B=[],M=/@([a-z][a-z0-9.]*)\s*=\s*"([^"]*)"/gi,I;while((I=M.exec(v))!==null){let[,Q,X]=I,z=Q.split("."),L=z[0];if(!pr.has(L))continue;B.push({attribute:`@${Q}`,event:L,handler:X,modifiers:gr(z.slice(1)),elementId:D})}let j=/@([a-z][a-z0-9.]*)\s*=\s*'([^']*)'/gi;while((I=j.exec(v))!==null){let[,Q,X]=I,z=Q.split("."),L=z[0];if(!pr.has(L))continue;B.push({attribute:`@${Q}`,event:L,handler:X,modifiers:gr(z.slice(1)),elementId:D})}if(B.length>0)i.push({originalTag:a,elementId:D,events:B,startIndex:E,endIndex:A})}return i}function Uo(e){let t=[],{modifiers:i}=e;if(i.self)t.push("if ($event.target !== $el) return");for(let n of i.systemKeys)t.push(`if (!$event.${n}Key) return`);if(i.keys.length>0){let n=i.keys.map((c)=>`$event.key === '${c}'`).join(" || ");t.push(`if (!(${n})) return`)}if(i.mouse!==null){let n=hr[i.mouse];t.push(`if ($event.button !== ${n}) return`)}if(i.prevent)t.push("$event.preventDefault()");if(i.stop)t.push("$event.stopPropagation()");return t.join("; ")}function Vo(e,t){let i=e;if(t.debounce!==null)i=`__stx_debounce(() => { ${i} }, ${t.debounce})`;else if(t.throttle!==null)i=`__stx_throttle(() => { ${i} }, ${t.throttle})`;return i}function cs(e){let t=e.trim();if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(t))return e;return`if (typeof ${t} === 'function' && !${t}._isSignal) ${t}($event);`}function Ho(e){let{modifiers:t}=e,i=e.elementId.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),n=Uo(e),c=Vo(cs(e.handler),t),l=[];if(t.once)l.push("once: true");if(t.capture)l.push("capture: true");if(os(e.event,t))l.push("passive: true");let a=l.length>0?`, { ${l.join(", ")} }`:"",y=c.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t");if(e.event==="mounted")return`
|
|
2
|
+
import{ze,xn,Ws,xi,N}from"./chunk-m7hfcxt3.js";import{vn}from"./chunk-z843epx3.js";import{Nr,k,ll,at,Ri,ul}from"./chunk-ybjfr7e8.js";import{P}from"./chunk-r9e0r6jx.js";import{R,qs,u,f,jt,d,q,F,w,Js,_e,Ve,Ys}from"./chunk-gebb12ak.js";import{r,ge}from"./chunk-3vpgr6nk.js";import{g}from"./chunk-0dve54ne.js";import{K}from"./chunk-c5vzr1va.js";import Qe from"path";import kt from"process";import{AsyncLocalStorage as Bo}from"async_hooks";var cr=new Bo;function mn(e){return e.__stx_server_data??={pending:new Map,values:new Map}}function ar(e,t){return cr.run(mn(e),t)}async function lr(e,t){let i=cr.getStore();if(!i)throw Error("useServerData must run inside a <script server> render");if(typeof e!=="string"||!e.trim())throw TypeError("useServerData requires a non-empty string key");let n=i.pending.get(e);if(n)return n;let c=Promise.resolve().then(t).then((l)=>{let a=JSON.stringify(l,(v,E)=>{if(E===void 0||typeof E==="function"||typeof E==="symbol"||typeof E==="bigint"||typeof E==="number"&&!Number.isFinite(E))throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);if(E&&typeof E==="object"&&!Array.isArray(E)&&Object.getPrototypeOf(E)!==Object.prototype&&Object.getPrototypeOf(E)!==null)throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);return E}),y=JSON.parse(a);return i.values.set(e,y),y}).catch((l)=>{throw i.pending.delete(e),l});return i.pending.set(e,c),c}function Cr(e){let t=e.__stx_server_data;if(!t?.values.size)return"";return`<script data-stx-scoped data-stx-server-data type="application/json">${JSON.stringify(Object.fromEntries(t.values)).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}</script>`}function H(e,t=!1){let i=r(e),n=[],c=new Set,l=0,a=0,y=i.length,v=()=>{if(l!==0)return;let E=i.slice(a).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*(?:[!:;,\n]|=(?!=)|$)/);if(E){if(t&&E[1]==="const")return;let I=E[2];if(!c.has(I))n.push(I),c.add(I);return}let A=i.slice(a).match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(A){if(t&&i.slice(a).startsWith("const"))return;A[1].split(",").forEach((I)=>{let j=I.trim();if(!j)return;let Q=j.indexOf(":"),z=(Q>=0?j.slice(Q+1).trim():j).split(/[\s=]/)[0];if(z&&!c.has(z))n.push(z),c.add(z)});return}let M=i.slice(a).match(/^(?:const|let|var)\s+\[([^\]]+)\]\s*=/);if(M){if(t&&i.slice(a).startsWith("const"))return;M[1].split(",").forEach((I)=>{let j=I.trim().replace(/^\.\.\./,"");if(!j)return;let Q=j.split(/[\s=]/)[0];if(Q&&!c.has(Q))n.push(Q),c.add(Q)});return}if(t)return;let B=i.slice(a).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(B){let I=B[1];if(!c.has(I))n.push(I),c.add(I);return}let D=i.slice(a).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(D){let I=D[1];if(!c.has(I))n.push(I),c.add(I)}};while(a<y){if(i[a]==="{"){l++,a++;continue}if(i[a]==="}"){l--,a++;continue}if(l===0&&/[a-z]/i.test(i[a])&&(a===0||/\s|[;{}()]/.test(i[a-1])))v();a++}return n.join(", ")}function Is(e){return`{ enumerable: true, configurable: true, get() { return ${e} }, set(__stxValue_${e}) { ${e} = __stxValue_${e} } }`}function Wo(e,t=H(e).split(",").map((i)=>i.trim()).filter(Boolean)){let i=new Set(H(e,!0).split(",").map((n)=>n.trim()));return t.map((n)=>i.has(n)?`get ${n}() { return ${n} }, set ${n}(__stxValue_${n}) { ${n} = __stxValue_${n} }`:n).join(", ")}function Os(e,t){let i=`{ ${Wo(e,t)} }`;return H(e).split(",").some((n)=>n.trim()==="__stxLiveBindings")?`Object.defineProperties(${i}, Object.getOwnPropertyDescriptors(__stxLiveBindings))`:i}import An from"fs";import Te from"path";function V(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").toLowerCase()}var ur=new Map;function yr(e,t=!0){let i=ur.get(e);if(t&&i)return i;let n=new Map,c=[Te.join(e,"src"),Te.join(e,"dist"),e];function l(a,y){if(y>6)return;let v;try{v=An.readdirSync(a,{withFileTypes:!0})}catch{return}for(let E of v){let A=Te.join(a,E.name);if(E.isDirectory()){if(E.name==="node_modules"||E.name.startsWith("."))continue;l(A,y+1)}else if(E.isFile()&&E.name.endsWith(".stx")){let M=E.name.slice(0,-4);if(!n.has(M))n.set(M,A);let B=M.toLowerCase();if(!n.has(B))n.set(B,A);let D=V(M);if(!n.has(D))n.set(D,A)}}}for(let a of c)if(l(a,0),n.size>0)break;if(t)ur.set(e,n);return n}function Ns(e,t){if(e.startsWith(".")||e.startsWith("/"))return null;let i=t;while(!0){let n=Te.join(i,"node_modules",e);try{if(An.statSync(n).isDirectory())return n}catch{}let c=Te.dirname(i);if(c===i)return null;i=c}}function Ms(e,t,i={}){return[Te.resolve(Te.dirname(t),`${e}.stx`),Te.resolve(Te.dirname(t),e),Te.resolve(i.componentsDir||"components",`${e}.stx`),Te.resolve(i.componentsDir||"components",e),e.endsWith(".stx")?e:`${e}.stx`]}function fr(e){let t=e.endsWith(".stx")?e.slice(0,-4):e,i=t.split("-").map((c)=>c.charAt(0).toUpperCase()+c.slice(1)).join(""),n=V(t);return[t,i,n]}function oi(e,t){let[i,n,c]=fr(e);for(let l of[i,i.toLowerCase(),n,c]){let a=t?.__importedComponents?.get(l);if(a!==void 0)return a}}function*ii(e,t,i={},n){let c=fr(e);if(c[0].startsWith("./")||c[0].startsWith("../")){yield Te.resolve(Te.dirname(t),`${c[0]}.stx`);return}let l=[...new Set(c.map((v)=>`${v}.stx`))],a=i.projectRoot||process.cwd(),y=[...n?.__originalFilePath?[Te.join(Te.dirname(n.__originalFilePath),"components")]:[],...i.componentsDir?[i.componentsDir]:[],Te.join(Te.dirname(t),"components"),Te.resolve(a,"src/components"),Te.resolve(a,"components"),...import.meta.dir?[Te.resolve(import.meta.dir,"components")]:[]];for(let v of new Set(y)){for(let E of l)yield Te.join(v,E);try{for(let E of An.readdirSync(v,{withFileTypes:!0}))if(E.isDirectory())for(let A of l)yield Te.join(v,E.name,A)}catch{}}}function pr(e,t,i={},n){let c=oi(e,n);if(c!==void 0)return c;for(let l of ii(e,t,i,n))try{if(An.statSync(l,{throwIfNoEntry:!1})?.isFile())return l}catch{}return null}function Ds(e,t=[],i={}){let n=new Set([...e].map((E)=>E.replace(/[-_]/g,"").toLowerCase()));if(!n.has("src")||!n.has("alt")&&!n.has("decorative"))return!1;let c=new Map(Object.entries(i).map(([E,A])=>[E.replace(/[-_]/g,"").toLowerCase(),A])),l=c.get("alt"),a=c.get("decorative"),y=typeof l==="string"&&!!l.trim(),v=typeof a==="string"?!["false","0","off","no"].includes(a.trim().toLowerCase()):Boolean(a);if(!y&&!v)return!1;if(["source","resizemode","defaultsource","provider","format","densities","quality","preload","modifiers","preset"].some((E)=>n.has(E)))return!1;if([...t].some((E)=>!["load","error"].includes(E.replace(/^@/,"").split(".")[0].toLowerCase())))return!1;return["fit","objectfit","position","objectposition","rounded","aspectratio","zoomonhover","sources","webpsrc","webpsrcset"].some((E)=>n.has(E))}import Zn from"fs";import ce from"path";import ht from"path";import Kt from"fs";var zo=new Set(["touchstart","touchmove","wheel","mousewheel"]);function cs(e,t){if(t.passive)return!0;if(t.prevent||t.nonpassive)return!1;return zo.has(e.toLowerCase())}var dr=new Set(["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","mouseover","mouseout","contextmenu","wheel","keydown","keyup","keypress","submit","reset","change","input","focus","blur","focusin","focusout","select","invalid","touchstart","touchend","touchmove","touchcancel","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","scroll","resize","load","error","abort","animationstart","animationend","animationiteration","transitionstart","transitionend","transitionrun","transitioncancel","mounted","unmounted"]),gr={enter:"Enter",tab:"Tab",delete:"Delete",backspace:"Backspace",esc:"Escape",escape:"Escape",space:" ",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",home:"Home",end:"End",pageup:"PageUp",pagedown:"PageDown"},Fo=new Set(["ctrl","alt","shift","meta"]),$r={left:0,middle:1,right:2};function mr(e){let t={prevent:!1,stop:!1,once:!1,capture:!1,self:!1,passive:!1,nonpassive:!1,keys:[],systemKeys:[],mouse:null,debounce:null,throttle:null};for(let i of e){let n=i.toLowerCase();if(n==="prevent")t.prevent=!0;else if(n==="stop")t.stop=!0;else if(n==="once")t.once=!0;else if(n==="capture")t.capture=!0;else if(n==="self")t.self=!0;else if(n==="passive")t.passive=!0;else if(n==="nonpassive")t.nonpassive=!0;else if(Fo.has(n))t.systemKeys.push(n);else if(n in $r)t.mouse=n;else if(n in gr||/^[a-z]$/.test(n))t.keys.push(gr[n]||n.toUpperCase());else if(n.startsWith("debounce")){let c=n.match(/debounce(?:\.(\d+))?/);t.debounce=c?.[1]?Number.parseInt(c[1],10):300}else if(n.startsWith("throttle")){let c=n.match(/throttle(?:\.(\d+))?/);t.throttle=c?.[1]?Number.parseInt(c[1],10):300}}return t}function Rr(e,t=""){let i=[],n=0,c=/<([a-z][a-z0-9-]*)\s+([^>]*@[a-z][^>]*)>/gi,l;while((l=c.exec(e))!==null){let[a,y,v]=l,E=l.index,A=E+a.length,M=`__stx_evt_${t}${n++}`,B=[],D=/@([a-z][a-z0-9.]*)\s*=\s*"([^"]*)"/gi,I;while((I=D.exec(v))!==null){let[,Q,X]=I,z=Q.split("."),L=z[0];if(!dr.has(L))continue;B.push({attribute:`@${Q}`,event:L,handler:X,modifiers:mr(z.slice(1)),elementId:M})}let j=/@([a-z][a-z0-9.]*)\s*=\s*'([^']*)'/gi;while((I=j.exec(v))!==null){let[,Q,X]=I,z=Q.split("."),L=z[0];if(!dr.has(L))continue;B.push({attribute:`@${Q}`,event:L,handler:X,modifiers:mr(z.slice(1)),elementId:M})}if(B.length>0)i.push({originalTag:a,elementId:M,events:B,startIndex:E,endIndex:A})}return i}function Uo(e){let t=[],{modifiers:i}=e;if(i.self)t.push("if ($event.target !== $el) return");for(let n of i.systemKeys)t.push(`if (!$event.${n}Key) return`);if(i.keys.length>0){let n=i.keys.map((c)=>`$event.key === '${c}'`).join(" || ");t.push(`if (!(${n})) return`)}if(i.mouse!==null){let n=$r[i.mouse];t.push(`if ($event.button !== ${n}) return`)}if(i.prevent)t.push("$event.preventDefault()");if(i.stop)t.push("$event.stopPropagation()");return t.join("; ")}function Vo(e,t){let i=e;if(t.debounce!==null)i=`__stx_debounce(() => { ${i} }, ${t.debounce})`;else if(t.throttle!==null)i=`__stx_throttle(() => { ${i} }, ${t.throttle})`;return i}function as(e){let t=e.trim();if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(t))return e;return`if (typeof ${t} === 'function' && !${t}._isSignal) ${t}($event);`}function Ho(e){let{modifiers:t}=e,i=e.elementId.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),n=Uo(e),c=Vo(as(e.handler),t),l=[];if(t.once)l.push("once: true");if(t.capture)l.push("capture: true");if(cs(e.event,t))l.push("passive: true");let a=l.length>0?`, { ${l.join(", ")} }`:"",y=c.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t");if(e.event==="mounted")return`
|
|
3
3
|
(function() {
|
|
4
4
|
var $el = document.getElementById('${i}');
|
|
5
5
|
if (!$el) return;
|
|
@@ -111,19 +111,19 @@ else {
|
|
|
111
111
|
${e.map(Ho).join(`
|
|
112
112
|
`)}
|
|
113
113
|
})();
|
|
114
|
-
</script>`}function Zo(e,t=""){let i
|
|
115
|
-
`+c.slice(a);else c+=l;return c}function Rr(e,t){let i=new Set;for(let n of e.split(",")){let c=n.trim().replace(/^\.\.\./,"").trim();if(!c)continue;if(t){let l=c.lastIndexOf(":");if(l!==-1)c=c.slice(l+1).trim()}if(c=c.split("=")[0].trim(),/^[A-Za-z_$][\w$]*$/.test(c))i.add(c)}return i}function Rt(e,t){let i=r(e),{depths:n,balanced:c}=ge(i),l=(y)=>!c||n[y]===0,a=new RegExp(`(?:^|[^\\w$.])((?:const|let|var|function|class)\\s+${t}\\b)`,"g");for(let y of i.matchAll(a)){let v=(y.index??0)+y[0].length-y[1].length;if(l(v))return!0}for(let y of i.matchAll(/(?:const|let|var)\s*\{([^}]*)\}/g))if(l(y.index??0)&&Rr(y[1],!0).has(t))return!0;for(let y of i.matchAll(/(?:const|let|var)\s*\[([^\]]*)\]/g))if(l(y.index??0)&&Rr(y[1],!1).has(t))return!0;return!1}var Tr=new R(32,{maxBytes:2097152,sizeOf:(e)=>e.code.length*4}),ut=/^[A-Za-z_$][\w$]*$/,qo=new Set(["if","for","while","switch","with"]),Ar=["(","[","{"],Ir=[")","]","}"],Ko=new Set(["const","let","var","return","if","for","while","do","switch","try","throw","export"]);function Xo(e){let t=r(e),i=[];for(let n of t.matchAll(/[A-Za-z_$][\w$]*|=>|\.\.\.|[^\s]/g)){let c=n.index??0;i.push({text:n[0],start:c,end:c+n[0].length})}return{code:t,tokens:i}}function as(e){let t=Tr.get(e);if(t)return t;let{code:i,tokens:n}=Xo(e),c=new Map,l=[];for(let Q=0;Q<n.length;Q++){let X=n[Q].text;if(["(","[","{"].includes(X))l.push(Q);else if([")","]","}"].includes(X)){let z=l.at(-1);if(z!==void 0&&["()","[]","{}"].includes(n[z].text+X))l.pop(),c.set(z,Q),c.set(Q,z)}}function a(Q,X){let z=[],L=Q;for(let ee=Q;ee<X;ee++){if(["(","[","{"].includes(n[ee].text)&&(c.get(ee)??X)<X){ee=c.get(ee);continue}if(n[ee].text===",")z.push([L,ee]),L=ee+1}return z.push([L,X]),z}let y=[];function v(Q,X,z,L=!1){if(n[Q]?.text==="...")Q++;if(Q>=X)return;let ee=n[Q].text;if(ut.test(ee)){if(z.add(ee),z===D)y.push({name:ee,token:Q,functionScoped:L});return}if(ee!=="{"&&ee!=="[")return;let te=c.get(Q);if(te===void 0||te>=X)return;for(let[re,me]of a(Q+1,te)){let he=re;if(ee==="{")for(let le=re;le<me;le++){if(n[le].text===":"){he=le+1;break}if(n[le].text==="=")break;if(["(","[","{"].includes(n[le].text)&&c.has(le))le=c.get(le)}v(he,me,z,L)}}function E(Q,X){let z=new Set;for(let[L,ee]of a(Q,X))v(L,ee,z);return z}function A(Q){let X=Q;for(;X<n.length;X++){let z=n[X].text;if(["(","[","{"].includes(z)&&c.has(X)){X=c.get(X);continue}if([",",";",")","]","}"].includes(z))break}return n[Math.max(Q,X-1)]?.end??i.length}let D=new Set,B=[];for(let Q=0;Q<n.length;Q++)if(n[Q].text==="=>"){let X=Q-1,z=X,L;if(n[X]?.text===")"&&c.has(X))z=c.get(X),L=E(z+1,X);else if(n[X]&&ut.test(n[X].text))L=new Set([n[X].text]);else continue;let ee=Q+1,te=n[ee]?.text==="{"&&c.has(ee)?n[c.get(ee)].end:A(ee);B.push({start:n[z].start,end:te,bodyStart:n[ee]?.start??te,functionBody:!0,names:L})}else if(n[Q].text==="("&&c.has(Q)){let X=n[Q-1]?.text;if(!X||qo.has(X)||!ut.test(X)&&X!=="*"&&X!=="]")continue;let z=c.get(Q),L=z+1;if(n[L]?.text===":"){L++;while(L<n.length&&!["{","=>",";","="].includes(n[L].text))L++}if(n[L]?.text!=="{"||!c.has(L))continue;B.push({start:n[Q].start,end:n[c.get(L)].end,bodyStart:n[L].start,functionBody:X!=="catch",names:E(Q+1,z)})}function M(Q){let X=Q;for(;X<n.length;X++){let z=n[X].text;if(Ar.includes(z)&&c.has(X)){X=c.get(X);continue}if(z===";"||Ir.includes(z))break;let L=n[X-1];if(X>Q&&Ko.has(z)&&L.text!==".")break;if(X>Q&&/[\n\r]/.test(i.slice(L.end,n[X].start))&&(/^[\w$]+$/.test(L.text)||Ir.includes(L.text)||['"',"'","`"].includes(L.text))&&ut.test(z)&&!["in","of","instanceof"].includes(z))break}return X}let I=[];for(let Q=0;Q<n.length;Q++){if(n[Q].text!=="for")continue;let X=n[Q+1]?.text==="await"?Q+2:Q+1;if(n[X]?.text!=="("||!c.has(X))continue;let z=c.get(X),L=z+1,ee=n[L]?.text==="{"&&c.has(L)?c.get(L):M(L),te=n[ee]?.text===";"||n[ee]?.text==="}"?n[ee].end:n[Math.max(L,ee-1)]?.end??i.length;I.push({headStart:X,headEnd:z,start:n[X].start,end:te})}for(let Q=0;Q<n.length;Q++){let X=n[Q].text,z=n[Q-1]?.text;if(z==="."||n[Q+1]?.text===":")continue;if(z==="as"||z==="<")continue;if(X==="const"||X==="let"||X==="var"){let L=M(Q+1),ee=Q+1,te=!1,re=!1,me=0;for(let he=Q+1;he<=L;he++){let le=n[he]?.text;if(he<L&&Ar.includes(le)&&c.has(he)&&c.get(he)<L){he=c.get(he);continue}if(he<L&&le===":"&&!re)te=!0;else if(he<L&&le==="="&&me===0)te=!1,re=!0;else if(he<L&&te&&le==="<")me++;else if(he<L&&te&&le===">"&&me>0)me--;else if(he===L||le===","&&me===0)v(ee,he,D,X==="var"),ee=he+1,te=!1,re=!1}}else if(X==="function"||X==="class"){let L=Q+1;if(n[L]?.text==="*")L++;if(n[L]&&ut.test(n[L].text)&&n[L].text!=="extends")D.add(n[L].text),y.push({name:n[L].text,token:L})}else if(X==="import"){let L=Q+1;if(n[L]?.text==="*"&&n[L+1]?.text==="as")L+=2;let ee=n[L]?.text;if(ee&&ut.test(ee)&&ee!=="type"&&n[L+1]?.text!=="("&&n[L+1]?.text!==".")D.add(ee),y.push({name:ee,token:L,file:!0});let te=n[L]?.text==="{"?L:n[L+1]?.text===","&&n[L+2]?.text==="{"?L+2:-1;if(te!==-1&&c.has(te)){let re=c.get(te);for(let[me,he]of a(te+1,re)){let le=he-1;while(le>=me&&!ut.test(n[le].text))le--;if(le>=me&&n[le].text!=="type")y.push({name:n[le].text,token:le,file:!0})}}}}let j={code:i,scopes:B,loops:I,declarations:D,sites:y,tokens:n,pairs:c};return Tr.set(e,j),j}function ls(e){let t=as(e);return{code:t.code,shadows:(i,n)=>t.scopes.some((c)=>n>=c.start&&n<c.end&&c.names.has(i))}}function Tn(e){return new Set(as(e).declarations)}function Ie(e,t){let{scopes:i,loops:n,sites:c,tokens:l,pairs:a}=as(e),y=Array.from({length:l.length},()=>-1),v=[];for(let M=0;M<l.length;M++){y[M]=v.length?v[v.length-1]:-1;let I=l[M].text;if(I==="{"&&a.has(M))v.push(M);else if(I==="}"&&v.length&&a.get(M)===v[v.length-1])v.pop()}let E=new Set,A=new Map;for(let M of c){if(!t.has(M.name))continue;E.add(M.token);let I=M.file?-1:y[M.token],j=I===-1?[0,Number.POSITIVE_INFINITY]:[l[I].start,l[a.get(I)].end];if(M.functionScoped){let X=l[M.token].start,z=i.filter((L)=>L.functionBody&&X>=L.bodyStart&&X<L.end).sort((L,ee)=>L.end-L.bodyStart-(ee.end-ee.bodyStart))[0];j=z?[z.bodyStart,z.end]:[0,Number.POSITIVE_INFINITY]}else if(!M.file){let X=n.filter((z)=>M.token>z.headStart&&M.token<z.headEnd).sort((z,L)=>z.headEnd-z.headStart-(L.headEnd-L.headStart))[0];if(X)j=[X.start,X.end]}let Q=A.get(M.name);if(Q)Q.push(j);else A.set(M.name,[j])}let D=new Set;for(let M=0;M<l.length;M++){if(l[M].text!=="import"||l[M-1]?.text===".")continue;let I=M+1;if(l[I]?.text==="type")I++;if(l[I]&&ut.test(l[I].text)&&l[I+1]?.text===",")I+=2;if(l[I]?.text==="{"&&a.has(I))for(let j=I+1;j<a.get(I);j++)D.add(j)}let B=new Set;for(let M=0;M<l.length;M++){let I=l[M].text;if(!t.has(I)||B.has(I)||E.has(M)||D.has(M))continue;let j=l[M-1]?.text;if(j==="#"||j==="."&&l[M-2]?.text!=="..")continue;if(l[M+1]?.text===":"&&(j==="{"||j===","))continue;let Q=l[M].start;if(A.get(I)?.some(([X,z])=>Q>=X&&Q<z))continue;if(i.some((X)=>Q>=X.start&&Q<X.end&&X.names.has(I)))continue;B.add(I)}return B}var Pe="0.2.802";var Or=Symbol.for(`stx.lazy-module-promises.${Pe}`);function Go(){let e=globalThis;return e[Or]??=new Map,e[Or]}function o(e,t){let i=Go(),n=`${import.meta.url}\x00${e}`,c=i.get(n);if(c)return c;let l=t();return i.set(n,l),l.catch(()=>{if(i.get(n)===l)i.delete(n)}),l}var Yo=/<\/(script)/gi;function dn(e){if(!e||e.indexOf("</")===-1)return e;return e.replace(Yo,"<\\/$1")}import Pr from"fs";var Dr=[];function b(e){let t=new R(e);return Dr.push(t),t}function Ac(){for(let e of Dr)e.clear()}function x(e,...t){return`${t.map((i)=>String(i??"")).join("\x00")}\x00${e.length}\x00${Bun.hash(e)}`}function br(e){let t=[];for(let i of new Set(e))try{t.push({path:i,mtimeMs:Pr.statSync(i).mtimeMs})}catch{}return t}function Ls(e){for(let t of e)try{if(Pr.statSync(t.path).mtimeMs!==t.mtimeMs)return!1}catch{return!1}return!0}var xe=["browserQuery","BrowserQueryBuilder","BrowserQueryError","browserAuth","configureBrowser","getBrowserConfig","createBrowserDb","createBrowserModel","isBrowser","debounce","throttle","retry","sleep","wait","delay","waitUntil","waitWhile","lazy","clamp","rand","readableSize","useActiveElement","useIntervalFn","useObjectUrl"];var Qo=/^[ \t]*import\s+['"]([^'"]+?\.css)(\?[^'"]*)?['"]\s*;?\s*$/gm;function ec(e){if(e.startsWith(".")||e.startsWith("/"))return null;if(e.startsWith("@")){let i=e.match(/^(@[^/]+\/[^/]+)(\/.*)?$/);if(!i)return null;return{pkg:i[1],subpath:i[2]||""}}let t=e.match(/^([^/]+)(\/.*)?$/);if(!t)return null;return{pkg:t[1],subpath:t[2]||""}}function tc(e,t){let i=t;while(!0){let n=ht.join(i,"node_modules",e,"package.json");if(qt.existsSync(n))return ht.dirname(n);let c=ht.dirname(i);if(c===i)return null;i=c}}function nc(e,t){if(!e||typeof e!=="object")return null;let i=(c)=>{if(typeof c==="string")return c;if(c&&typeof c==="object"){if(typeof c.import==="string")return c.import;if(typeof c.default==="string")return c.default;if(typeof c.import==="object")return i(c.import);if(typeof c.default==="object")return i(c.default)}return null};if(Object.prototype.hasOwnProperty.call(e,t))return i(e[t]);let n=null;for(let c of Object.keys(e)){let l=c.indexOf("*");if(l===-1)continue;let a=c.slice(0,l),y=c.slice(l+1);if(!t.startsWith(a)||!t.endsWith(y))continue;if(t.length<a.length+y.length)continue;if(!n||a.length>n.prefix.length)n={pattern:c,prefix:a,suffix:y}}if(n){let c=t.slice(n.prefix.length,t.length-n.suffix.length),l=i(e[n.pattern]);if(l)return l.replace("*",c)}return null}function sc(e,t){let i=ec(e);if(!i||!i.subpath)return null;let n=tc(i.pkg,t);if(!n)return null;let c;try{c=JSON.parse(qt.readFileSync(ht.join(n,"package.json"),"utf8"))}catch{return null}let l=`.${i.subpath}`,a=nc(c.exports,l);if(!a)return null;let y=ht.resolve(n,a);return qt.existsSync(y)?y:null}function mi(e,t){let i=t.filePath?ht.dirname(t.filePath):t.projectRoot||process.cwd(),n=t.projectRoot||process.cwd(),c=new Set,l=[],a=[];return{code:e.replace(Qo,(v,E)=>{let A;try{if(E.startsWith("./")||E.startsWith("../")||E.startsWith("/")){if(A=E.startsWith("/")?E:ht.resolve(i,E),!qt.existsSync(A))throw Error(`file not found: ${A}`)}else{let D=null;try{D=Bun.resolveSync(E,n)}catch{D=sc(E,n)}if(!D)throw Error(`could not resolve ${E} (Bun.resolveSync + exports fallback both failed)`);A=D}}catch(D){return console.warn(`[stx:vendor-css] could not resolve ${JSON.stringify(E)} (from ${t.filePath||"<unknown>"}): ${D?.message||D}`),a.push(E),""}if(c.has(A))return"";c.add(A);try{let D=qt.readFileSync(A,"utf8");l.push({source:E,resolvedPath:A,contents:D})}catch(D){console.warn(`[stx:vendor-css] could not read ${A}: ${D?.message||D}`),a.push(E)}return""}),styles:l,unresolved:a}}function rc(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function hi(e){if(e.length===0)return"";return`${e.map((t)=>`<style data-stx-vendor="${rc(t.source)}" data-stx-layer="vendor">
|
|
114
|
+
</script>`}function Zo(e,t=""){let i=Rr(e,t);if(i.length===0)return{template:e,bindings:[]};let n=e,c=[];for(let l=i.length-1;l>=0;l--){let a=i[l],y=a.originalTag;if(!y.includes(" id="))y=y.replace(/^<([a-z][a-z0-9-]*)/,`<$1 id="${a.elementId}"`);else{let v=y.match(/id=["']([^"']+)["']/);if(v)for(let E of a.events)E.elementId=v[1]}for(let v of a.events){let E=v.attribute.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),A=new RegExp(`\\s*${E}\\s*=\\s*"[^"]*"`,"g"),M=new RegExp(`\\s*${E}\\s*=\\s*'[^']*'`,"g");y=y.replace(A,""),y=y.replace(M,"")}n=n.slice(0,a.startIndex)+y+n.slice(a.endIndex),c.push(...a.events)}return{template:n,bindings:c}}function hr(e){let t=e.$uid;return typeof t==="string"&&t?`${t}_`:""}function $c(e,t,i){if(ul(e))return e;if(t.__stx_sfc_mode){if(/x-data\s*=\s*["']/.test(e))return e;let{template:y,bindings:v}=Zo(e,hr(t)),E=t.__stx_event_bindings||[];return t.__stx_event_bindings=[...E,...v],y}let n=Rr(e,hr(t));if(n.length===0)return e;let c=e;for(let y=n.length-1;y>=0;y--){let v=n[y],E=v.originalTag;if(!E.includes(" id="))E=E.replace(/^<([a-z][a-z0-9-]*)/,`<$1 id="${v.elementId}"`);else{let A=E.match(/id=["']([^"']+)["']/);if(A)for(let M of v.events)M.elementId=A[1]}for(let A of v.events){let M=A.attribute.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),B=new RegExp(`\\s*${M}\\s*=\\s*"[^"]*"`,"g"),D=new RegExp(`\\s*${M}\\s*=\\s*'[^']*'`,"g");E=E.replace(B,""),E=E.replace(D,"")}c=c.slice(0,v.startIndex)+E+c.slice(v.endIndex)}let l=ai(n.flatMap((y)=>y.events)),a=c.lastIndexOf("</body>");if(a!==-1)c=c.slice(0,a)+l+`
|
|
115
|
+
`+c.slice(a);else c+=l;return c}function Ar(e,t){let i=new Set;for(let n of e.split(",")){let c=n.trim().replace(/^\.\.\./,"").trim();if(!c)continue;if(t){let l=c.lastIndexOf(":");if(l!==-1)c=c.slice(l+1).trim()}if(c=c.split("=")[0].trim(),/^[A-Za-z_$][\w$]*$/.test(c))i.add(c)}return i}function Rt(e,t){let i=r(e),{depths:n,balanced:c}=ge(i),l=(y)=>!c||n[y]===0,a=new RegExp(`(?:^|[^\\w$.])((?:const|let|var|function|class)\\s+${t}\\b)`,"g");for(let y of i.matchAll(a)){let v=(y.index??0)+y[0].length-y[1].length;if(l(v))return!0}for(let y of i.matchAll(/(?:const|let|var)\s*\{([^}]*)\}/g))if(l(y.index??0)&&Ar(y[1],!0).has(t))return!0;for(let y of i.matchAll(/(?:const|let|var)\s*\[([^\]]*)\]/g))if(l(y.index??0)&&Ar(y[1],!1).has(t))return!0;return!1}var Tr=new R(32,{maxBytes:2097152,sizeOf:(e)=>e.code.length*4}),ut=/^[A-Za-z_$][\w$]*$/,qo=new Set(["if","for","while","switch","with"]),Ir=["(","[","{"],Or=[")","]","}"],Ko=new Set(["const","let","var","return","if","for","while","do","switch","try","throw","export"]);function Xo(e){let t=r(e),i=[];for(let n of t.matchAll(/[A-Za-z_$][\w$]*|=>|\.\.\.|[^\s]/g)){let c=n.index??0;i.push({text:n[0],start:c,end:c+n[0].length})}return{code:t,tokens:i}}function ls(e){let t=Tr.get(e);if(t)return t;let{code:i,tokens:n}=Xo(e),c=new Map,l=[];for(let Q=0;Q<n.length;Q++){let X=n[Q].text;if(["(","[","{"].includes(X))l.push(Q);else if([")","]","}"].includes(X)){let z=l.at(-1);if(z!==void 0&&["()","[]","{}"].includes(n[z].text+X))l.pop(),c.set(z,Q),c.set(Q,z)}}function a(Q,X){let z=[],L=Q;for(let ee=Q;ee<X;ee++){if(["(","[","{"].includes(n[ee].text)&&(c.get(ee)??X)<X){ee=c.get(ee);continue}if(n[ee].text===",")z.push([L,ee]),L=ee+1}return z.push([L,X]),z}let y=[];function v(Q,X,z,L=!1){if(n[Q]?.text==="...")Q++;if(Q>=X)return;let ee=n[Q].text;if(ut.test(ee)){if(z.add(ee),z===M)y.push({name:ee,token:Q,functionScoped:L});return}if(ee!=="{"&&ee!=="[")return;let te=c.get(Q);if(te===void 0||te>=X)return;for(let[re,me]of a(Q+1,te)){let he=re;if(ee==="{")for(let le=re;le<me;le++){if(n[le].text===":"){he=le+1;break}if(n[le].text==="=")break;if(["(","[","{"].includes(n[le].text)&&c.has(le))le=c.get(le)}v(he,me,z,L)}}function E(Q,X){let z=new Set;for(let[L,ee]of a(Q,X))v(L,ee,z);return z}function A(Q){let X=Q;for(;X<n.length;X++){let z=n[X].text;if(["(","[","{"].includes(z)&&c.has(X)){X=c.get(X);continue}if([",",";",")","]","}"].includes(z))break}return n[Math.max(Q,X-1)]?.end??i.length}let M=new Set,B=[];for(let Q=0;Q<n.length;Q++)if(n[Q].text==="=>"){let X=Q-1,z=X,L;if(n[X]?.text===")"&&c.has(X))z=c.get(X),L=E(z+1,X);else if(n[X]&&ut.test(n[X].text))L=new Set([n[X].text]);else continue;let ee=Q+1,te=n[ee]?.text==="{"&&c.has(ee)?n[c.get(ee)].end:A(ee);B.push({start:n[z].start,end:te,bodyStart:n[ee]?.start??te,functionBody:!0,names:L})}else if(n[Q].text==="("&&c.has(Q)){let X=n[Q-1]?.text;if(!X||qo.has(X)||!ut.test(X)&&X!=="*"&&X!=="]")continue;let z=c.get(Q),L=z+1;if(n[L]?.text===":"){L++;while(L<n.length&&!["{","=>",";","="].includes(n[L].text))L++}if(n[L]?.text!=="{"||!c.has(L))continue;B.push({start:n[Q].start,end:n[c.get(L)].end,bodyStart:n[L].start,functionBody:X!=="catch",names:E(Q+1,z)})}function D(Q){let X=Q;for(;X<n.length;X++){let z=n[X].text;if(Ir.includes(z)&&c.has(X)){X=c.get(X);continue}if(z===";"||Or.includes(z))break;let L=n[X-1];if(X>Q&&Ko.has(z)&&L.text!==".")break;if(X>Q&&/[\n\r]/.test(i.slice(L.end,n[X].start))&&(/^[\w$]+$/.test(L.text)||Or.includes(L.text)||['"',"'","`"].includes(L.text))&&ut.test(z)&&!["in","of","instanceof"].includes(z))break}return X}let I=[];for(let Q=0;Q<n.length;Q++){if(n[Q].text!=="for")continue;let X=n[Q+1]?.text==="await"?Q+2:Q+1;if(n[X]?.text!=="("||!c.has(X))continue;let z=c.get(X),L=z+1,ee=n[L]?.text==="{"&&c.has(L)?c.get(L):D(L),te=n[ee]?.text===";"||n[ee]?.text==="}"?n[ee].end:n[Math.max(L,ee-1)]?.end??i.length;I.push({headStart:X,headEnd:z,start:n[X].start,end:te})}for(let Q=0;Q<n.length;Q++){let X=n[Q].text,z=n[Q-1]?.text;if(z==="."||n[Q+1]?.text===":")continue;if(z==="as"||z==="<")continue;if(X==="const"||X==="let"||X==="var"){let L=D(Q+1),ee=Q+1,te=!1,re=!1,me=0;for(let he=Q+1;he<=L;he++){let le=n[he]?.text;if(he<L&&Ir.includes(le)&&c.has(he)&&c.get(he)<L){he=c.get(he);continue}if(he<L&&le===":"&&!re)te=!0;else if(he<L&&le==="="&&me===0)te=!1,re=!0;else if(he<L&&te&&le==="<")me++;else if(he<L&&te&&le===">"&&me>0)me--;else if(he===L||le===","&&me===0)v(ee,he,M,X==="var"),ee=he+1,te=!1,re=!1}}else if(X==="function"||X==="class"){let L=Q+1;if(n[L]?.text==="*")L++;if(n[L]&&ut.test(n[L].text)&&n[L].text!=="extends")M.add(n[L].text),y.push({name:n[L].text,token:L})}else if(X==="import"){let L=Q+1;if(n[L]?.text==="*"&&n[L+1]?.text==="as")L+=2;let ee=n[L]?.text;if(ee&&ut.test(ee)&&ee!=="type"&&n[L+1]?.text!=="("&&n[L+1]?.text!==".")M.add(ee),y.push({name:ee,token:L,file:!0});let te=n[L]?.text==="{"?L:n[L+1]?.text===","&&n[L+2]?.text==="{"?L+2:-1;if(te!==-1&&c.has(te)){let re=c.get(te);for(let[me,he]of a(te+1,re)){let le=he-1;while(le>=me&&!ut.test(n[le].text))le--;if(le>=me&&n[le].text!=="type")y.push({name:n[le].text,token:le,file:!0})}}}}let j={code:i,scopes:B,loops:I,declarations:M,sites:y,tokens:n,pairs:c};return Tr.set(e,j),j}function qt(e){let t=ls(e);return{code:t.code,shadows:(i,n)=>t.scopes.some((c)=>n>=c.start&&n<c.end&&c.names.has(i))}}function Tn(e){return new Set(ls(e).declarations)}function Ie(e,t){let{scopes:i,loops:n,sites:c,tokens:l,pairs:a}=ls(e),y=Array.from({length:l.length},()=>-1),v=[];for(let D=0;D<l.length;D++){y[D]=v.length?v[v.length-1]:-1;let I=l[D].text;if(I==="{"&&a.has(D))v.push(D);else if(I==="}"&&v.length&&a.get(D)===v[v.length-1])v.pop()}let E=new Set,A=new Map;for(let D of c){if(!t.has(D.name))continue;E.add(D.token);let I=D.file?-1:y[D.token],j=I===-1?[0,Number.POSITIVE_INFINITY]:[l[I].start,l[a.get(I)].end];if(D.functionScoped){let X=l[D.token].start,z=i.filter((L)=>L.functionBody&&X>=L.bodyStart&&X<L.end).sort((L,ee)=>L.end-L.bodyStart-(ee.end-ee.bodyStart))[0];j=z?[z.bodyStart,z.end]:[0,Number.POSITIVE_INFINITY]}else if(!D.file){let X=n.filter((z)=>D.token>z.headStart&&D.token<z.headEnd).sort((z,L)=>z.headEnd-z.headStart-(L.headEnd-L.headStart))[0];if(X)j=[X.start,X.end]}let Q=A.get(D.name);if(Q)Q.push(j);else A.set(D.name,[j])}let M=new Set;for(let D=0;D<l.length;D++){if(l[D].text!=="import"||l[D-1]?.text===".")continue;let I=D+1;if(l[I]?.text==="type")I++;if(l[I]&&ut.test(l[I].text)&&l[I+1]?.text===",")I+=2;if(l[I]?.text==="{"&&a.has(I))for(let j=I+1;j<a.get(I);j++)M.add(j)}let B=new Set;for(let D=0;D<l.length;D++){let I=l[D].text;if(!t.has(I)||B.has(I)||E.has(D)||M.has(D))continue;let j=l[D-1]?.text;if(j==="#"||j==="."&&l[D-2]?.text!=="..")continue;if(l[D+1]?.text===":"&&(j==="{"||j===","))continue;let Q=l[D].start;if(A.get(I)?.some(([X,z])=>Q>=X&&Q<z))continue;if(i.some((X)=>Q>=X.start&&Q<X.end&&X.names.has(I)))continue;B.add(I)}return B}var Pe="0.2.805";var Pr=Symbol.for(`stx.lazy-module-promises.${Pe}`);function Go(){let e=globalThis;return e[Pr]??=new Map,e[Pr]}function o(e,t){let i=Go(),n=`${import.meta.url}\x00${e}`,c=i.get(n);if(c)return c;let l=t();return i.set(n,l),l.catch(()=>{if(i.get(n)===l)i.delete(n)}),l}var Yo=/<\/(script)/gi;function dn(e){if(!e||e.indexOf("</")===-1)return e;return e.replace(Yo,"<\\/$1")}import Dr from"fs";var Mr=[];function b(e){let t=new R(e);return Mr.push(t),t}function Rc(){for(let e of Mr)e.clear()}function x(e,...t){return`${t.map((i)=>String(i??"")).join("\x00")}\x00${e.length}\x00${Bun.hash(e)}`}function br(e){let t=[];for(let i of new Set(e))try{t.push({path:i,mtimeMs:Dr.statSync(i).mtimeMs})}catch{}return t}function Ls(e){for(let t of e)try{if(Dr.statSync(t.path).mtimeMs!==t.mtimeMs)return!1}catch{return!1}return!0}var xe=["browserQuery","BrowserQueryBuilder","BrowserQueryError","browserAuth","configureBrowser","getBrowserConfig","createBrowserDb","createBrowserModel","isBrowser","debounce","throttle","retry","sleep","wait","delay","waitUntil","waitWhile","lazy","clamp","rand","readableSize","useActiveElement","useIntervalFn","useObjectUrl"];var Qo=/^[ \t]*import\s+['"]([^'"]+?\.css)(\?[^'"]*)?['"]\s*;?\s*$/gm;function ec(e){if(e.startsWith(".")||e.startsWith("/"))return null;if(e.startsWith("@")){let i=e.match(/^(@[^/]+\/[^/]+)(\/.*)?$/);if(!i)return null;return{pkg:i[1],subpath:i[2]||""}}let t=e.match(/^([^/]+)(\/.*)?$/);if(!t)return null;return{pkg:t[1],subpath:t[2]||""}}function tc(e,t){let i=t;while(!0){let n=ht.join(i,"node_modules",e,"package.json");if(Kt.existsSync(n))return ht.dirname(n);let c=ht.dirname(i);if(c===i)return null;i=c}}function nc(e,t){if(!e||typeof e!=="object")return null;let i=(c)=>{if(typeof c==="string")return c;if(c&&typeof c==="object"){if(typeof c.import==="string")return c.import;if(typeof c.default==="string")return c.default;if(typeof c.import==="object")return i(c.import);if(typeof c.default==="object")return i(c.default)}return null};if(Object.prototype.hasOwnProperty.call(e,t))return i(e[t]);let n=null;for(let c of Object.keys(e)){let l=c.indexOf("*");if(l===-1)continue;let a=c.slice(0,l),y=c.slice(l+1);if(!t.startsWith(a)||!t.endsWith(y))continue;if(t.length<a.length+y.length)continue;if(!n||a.length>n.prefix.length)n={pattern:c,prefix:a,suffix:y}}if(n){let c=t.slice(n.prefix.length,t.length-n.suffix.length),l=i(e[n.pattern]);if(l)return l.replace("*",c)}return null}function sc(e,t){let i=ec(e);if(!i||!i.subpath)return null;let n=tc(i.pkg,t);if(!n)return null;let c;try{c=JSON.parse(Kt.readFileSync(ht.join(n,"package.json"),"utf8"))}catch{return null}let l=`.${i.subpath}`,a=nc(c.exports,l);if(!a)return null;let y=ht.resolve(n,a);return Kt.existsSync(y)?y:null}function mi(e,t){let i=t.filePath?ht.dirname(t.filePath):t.projectRoot||process.cwd(),n=t.projectRoot||process.cwd(),c=new Set,l=[],a=[];return{code:e.replace(Qo,(v,E)=>{let A;try{if(E.startsWith("./")||E.startsWith("../")||E.startsWith("/")){if(A=E.startsWith("/")?E:ht.resolve(i,E),!Kt.existsSync(A))throw Error(`file not found: ${A}`)}else{let M=null;try{M=Bun.resolveSync(E,n)}catch{M=sc(E,n)}if(!M)throw Error(`could not resolve ${E} (Bun.resolveSync + exports fallback both failed)`);A=M}}catch(M){return console.warn(`[stx:vendor-css] could not resolve ${JSON.stringify(E)} (from ${t.filePath||"<unknown>"}): ${M?.message||M}`),a.push(E),""}if(c.has(A))return"";c.add(A);try{let M=Kt.readFileSync(A,"utf8");l.push({source:E,resolvedPath:A,contents:M})}catch(M){console.warn(`[stx:vendor-css] could not read ${A}: ${M?.message||M}`),a.push(E)}return""}),styles:l,unresolved:a}}function rc(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function hi(e){if(e.length===0)return"";return`${e.map((t)=>`<style data-stx-vendor="${rc(t.source)}" data-stx-layer="vendor">
|
|
116
116
|
@layer vendor {
|
|
117
117
|
${t.contents}
|
|
118
118
|
}
|
|
119
119
|
</style>`).join(`
|
|
120
120
|
`)}
|
|
121
|
-
`}var
|
|
121
|
+
`}var sg=k,jr=b(256);function Nt(e){let t=x(e),i=jr.get(t);if(!i)i=ic(e),jr.set(t,i);return{code:i.code,imports:[...i.imports],models:[...i.models]}}function ic(e){let t=r(e),i=new Set;for(let y of e.matchAll(/^\s*import\s+(?:type\s+)?\{([^}]*)\}\s+from\s+['"][^'"]+['"]\s*;?\s*$/gm))for(let v of y[1].split(",")){let E=v.trim().split(/\s+as\s+/).pop()?.replace(/^type\s+/,"").trim();if(E)i.add(E)}let n=Tn(t),c=xe.filter((y)=>{if(i.has(y)||n.has(y))return!1;return og(t,y,!0)}),l=zr(t).filter((y)=>!i.has(y)&&!n.has(y));if(c.length===0&&l.length===0)return{code:e,imports:c,models:l};return{code:`${[c.length>0?`import { ${c.join(", ")} } from '@stacksjs/browser'`:"",l.length>0?"import '@stacksjs/browser'":"",l.length>0?`const { ${l.join(", ")} } = window.StacksBrowser || {}`:""].filter(Boolean).join(`
|
|
122
122
|
`)}
|
|
123
|
-
${e}`,imports:c,models:l}}var oc=new Set(["Promise","Object","Array","Map","Set","Date","Error","JSON","Math","Number","String","RegExp","Symbol","WeakMap","WeakSet","Proxy","Reflect","Intl","URL","URLSearchParams","FormData","Headers","Request","Response","AbortController","EventTarget","Element","Document","Node","Window","Console","Storage","Navigator","Blob","File","FileReader","HTMLElement","SVGElement","Event","CustomEvent","DOMParser","XMLSerializer","WebSocket","Worker","SharedWorker","IntersectionObserver","MutationObserver","ResizeObserver","PerformanceObserver","Notification","Bun","Buffer","Process","Modal","Intl"]);function
|
|
123
|
+
${e}`,imports:c,models:l}}var oc=new Set(["Promise","Object","Array","Map","Set","Date","Error","JSON","Math","Number","String","RegExp","Symbol","WeakMap","WeakSet","Proxy","Reflect","Intl","URL","URLSearchParams","FormData","Headers","Request","Response","AbortController","EventTarget","Element","Document","Node","Window","Console","Storage","Navigator","Blob","File","FileReader","HTMLElement","SVGElement","Event","CustomEvent","DOMParser","XMLSerializer","WebSocket","Worker","SharedWorker","IntersectionObserver","MutationObserver","ResizeObserver","PerformanceObserver","Notification","Bun","Buffer","Process","Modal","Intl"]);function zr(e,t=qt(e)){let i=new Set,n=Tn(e),c=/(?<![\w$.])([A-Z][a-zA-Z0-9]*)\s*\.\s*(all|find|first|get|where|orderBy|orderByDesc|limit|select|pluck|create|update|delete)\s*\(/g;for(let l of t.code.matchAll(c)){let a=l[1];if(oc.has(a)||n.has(a)||a.length<3)continue;if(t.shadows(a,l.index??0))continue;i.add(a)}return Array.from(i)}function cc(e){return Tn(e)}var Lr=b(128);function qc(e){let t=x(e),i=Lr.get(t);if(!i)i=ac(e),Lr.set(t,i);return{code:i.code,stxImports:[...i.stxImports],browserImports:[...i.browserImports]}}function ac(e){let t=new Set,i=new Set,n=e;n=n.replace(/^[ \t]*import\s+type\s+\{[^}]*\}\s+from\s+['"][^'"]+['"][ \t]*;?[ \t]*$/gm,"// [type import stripped]");let c=new Set,l=/^[ \t]*import\s+(?:type\s+)?{\s*([^}]+)\s*}\s+from\s+['"](@stacksjs\/browser|@stacksjs\/stx|stx)['"][ \t]*;?[ \t]*$/gm,a;while((a=l.exec(e))!==null){let D=a[1],I=a[2];if(a[0].includes("import type"))continue;let j=[];for(let X of D.split(",")){let z=X.trim();if(!z||z.startsWith("type "))continue;let L=z.match(/^([A-Za-z_$][\w$]*)(?:\s+as\s+([A-Za-z_$][\w$]*))?$/);if(!L)continue;let ee=L[1],te=L[2]||ee;if(c.add(ee),c.add(te),I==="stx"||I==="@stacksjs/stx")t.add(ee);else i.add(ee);if(te!==ee)j.push(`${te} = ${ee}`)}let Q=j.length>0?`var ${j.join(", ")}; /* [auto-import processed] */`:"// [auto-import processed]";n=n.replace(a[0],Q)}let y=cc(n),v=qt(n);for(let D of sg){if(c.has(D)||y.has(D))continue;if(us(v,D,!0))t.add(D)}let E=r(n),A=qt(E),M=new Set;for(let D of n.matchAll(/^\s*import\s+(?:type\s+)?\{([^}]*)\}\s+from\s+['"][^'"]+['"]\s*;?\s*$/gm))for(let I of D[1].split(",")){let j=I.trim().replace(/^type\s+/,"").split(/\s+as\s+/);for(let Q of j){let X=Q.trim();if(X)M.add(X)}}for(let D of xe){if(c.has(D)||y.has(D)||M.has(D))continue;if(us(A,D))i.add(D)}let B=zr(E,A);for(let D of B)if(!c.has(D)&&!y.has(D))i.add(D);return{code:n,stxImports:Array.from(t),browserImports:Array.from(i)}}function og(e,t,i=!1){return us(qt(e),t,i)}function us(e,t,i=!1){let n=e.code,c=new RegExp(`\\b${t.replace(/[$]/g,"\\$")}\\b`,"g");for(let l of n.matchAll(c)){let a=l.index??0;if(e.shadows(t,a))continue;let y=a+t.length,v=a-1;while(v>=0&&/\s/.test(n[v]))v--;if(n[v]==="."&&n.slice(Math.max(0,v-2),v+1)!=="...")continue;let E=y;while(E<n.length&&/\s/.test(n[E]))E++;if(n[E]===":"&&n[E+1]!==":"&&(n[v]==="{"||n[v]===","))continue;if(i&&!/^\s*(?:<[^>]*>)?\s*\(/.test(n.slice(y)))continue;if(lc(n,y))continue;return!0}return!1}function lc(e,t){let i=t;while(i<e.length&&(e[i]===" "||e[i]==="\t"))i++;if(e[i]!=="(")return!1;let n=0;for(;i<e.length;i++){let c=e[i];if(c==="(")n++;else if(c===")"){if(n--,n===0)break}}if(n!==0)return!1;i++;while(i<e.length&&(e[i]===" "||e[i]==="\t"))i++;return e[i]==="{"}function Kc(e,t){let i=[];if(e.length>0)i.push(` var { ${e.join(", ")} } = window.stx || window;`);if(t.length>0)i.push(` var { ${t.join(", ")} } = window.StacksBrowser || {};`);if(i.length>0)return` // STX: auto-imported from stx and @stacksjs/browser
|
|
124
124
|
${i.join(`
|
|
125
125
|
`)}
|
|
126
|
-
${uc(e,t)}`;return""}function Kh(e,t=[]){let{browserImports:i}=
|
|
126
|
+
${uc(e,t)}`;return""}function Kh(e,t=[]){let{browserImports:i}=qc(e),n=new Set(t);return Kc([],i.filter((c)=>!n.has(c)))}function uc(e,t){let i=[...e.map((n)=>`['${n}', typeof ${n}, 'stx']`),...t.map((n)=>`['${n}', typeof ${n}, '@stacksjs/browser']`)];if(i.length===0)return"";return` // STX: report auto-imports the client runtime did not provide
|
|
127
127
|
[${i.join(", ")}].forEach(function (e) {
|
|
128
128
|
if (e[1] !== 'undefined') return;
|
|
129
129
|
console.error(
|
|
@@ -132,18 +132,18 @@ ${uc(e,t)}`;return""}function Kh(e,t=[]){let{browserImports:i}=Kc(e),n=new Set(t
|
|
|
132
132
|
+ 'or it should be imported from a relative path so the bundler includes it.'
|
|
133
133
|
);
|
|
134
134
|
});
|
|
135
|
-
`}function De(e){let t=e.__stxClientPayload;if(t&&typeof t==="object"){let n={};for(let c in t){let l=t[c];if(typeof l==="function")continue;n[c]=l}return n.__stxDeclaredPayload=!0,n}let i={};for(let n in e){if(n.startsWith("__")||n.startsWith("$"))continue;let c=e[n];if(typeof c==="function")continue;i[n]=c}return i}var fc=/token|secret|passw|apikey|api_key|privatekey|private_key|credential|webhook|bearer|jwt|signature/i,
|
|
135
|
+
`}function De(e){let t=e.__stxClientPayload;if(t&&typeof t==="object"){let n={};for(let c in t){let l=t[c];if(typeof l==="function")continue;n[c]=l}return n.__stxDeclaredPayload=!0,n}let i={};for(let n in e){if(n.startsWith("__")||n.startsWith("$"))continue;let c=e[n];if(typeof c==="function")continue;i[n]=c}return i}var fc=/token|secret|passw|apikey|api_key|privatekey|private_key|credential|webhook|bearer|jwt|signature/i,Br=new Set;function pc(e,t){let i=fc.test(e),n=t.length>32768;if(!i&&!n)return;if(Br.has(e))return;if(Br.add(e),i)console.warn(`[stx] server\u2192client bridge is publishing "${e}" into the page body. If it holds a credential, rename it with a "__" prefix (never bridged) and pass only what the template needs. See stacksjs/stx#1831.`);if(n)console.warn(`[stx] server\u2192client bridge is publishing ${(t.length/1024).toFixed(1)}KB under "${e}". Every byte ships in the HTML on each request; prefix the binding with "__" and project just the fields the client reads.`)}function yn(e,t){if(!t)return"";let i=Ie(e,new Set(Object.keys(t))),n=t.__stxDeclaredPayload===!0,c=[],l=Object.entries(t).sort(([a],[y])=>a<y?-1:a>y?1:0);for(let[a,y]of l){if(!/^[A-Za-z_$][\w$]*$/.test(a))continue;if(a.startsWith("__")||a.startsWith("$"))continue;if(!n&&!i.has(a))continue;if(Rt(e,a)){if(n)console.warn(`[stx] defineClientPayload declares "${a}", but this client block also declares "${a}" at the top level, so the server value is not published (emitting it would be a duplicate binding). Rename the local, or drop "${a}" from defineClientPayload.`);continue}let v;try{v=JSON.stringify(y)}catch{continue}if(v===void 0)continue;pc(a,v),c.push(` var ${a} = ${v.replace(/</g,"\\u003c")};`)}if(c.length===0)return"";return` // stx: server -> client data bridge (seeded from server scope)
|
|
136
136
|
${c.join(`
|
|
137
137
|
`)}
|
|
138
|
-
`}var dc={left:0,middle:1,right:2};function gc(e){let t=[];if(e.self)t.push("if ($event.target !== $el) return");for(let i of e.systemKeys)t.push(`if (!$event.${i}Key) return`);if(e.keys.length>0){let i=e.keys.map((n)=>`$event.key === '${n}'`).join(" || ");t.push(`if (!(${i})) return`)}if(e.mouse!==null){let i=dc[e.mouse];t.push(`if ($event.button !== ${i}) return`)}if(e.prevent)t.push("$event.preventDefault()");if(e.stop)t.push("$event.stopPropagation()");return t.join("; ")}function mc(e,t){let{elementId:i,event:n,modifiers:c}=e,l=
|
|
138
|
+
`}var dc={left:0,middle:1,right:2};function gc(e){let t=[];if(e.self)t.push("if ($event.target !== $el) return");for(let i of e.systemKeys)t.push(`if (!$event.${i}Key) return`);if(e.keys.length>0){let i=e.keys.map((n)=>`$event.key === '${n}'`).join(" || ");t.push(`if (!(${i})) return`)}if(e.mouse!==null){let i=dc[e.mouse];t.push(`if ($event.button !== ${i}) return`)}if(e.prevent)t.push("$event.preventDefault()");if(e.stop)t.push("$event.stopPropagation()");return t.join("; ")}function mc(e,t){let{elementId:i,event:n,modifiers:c}=e,l=as(e.handler),a=gc(c),y=[];if(c.once)y.push("once: true");if(c.capture)y.push("capture: true");if(cs(n,c))y.push("passive: true");let v=y.length>0?`, { ${y.join(", ")} }`:"",E="";if(a)E+=`${a}; `;let A=l.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),M=`var $emit = function(name, detail) {
|
|
139
139
|
$el.dispatchEvent(new CustomEvent(name, { detail: detail, bubbles: true, cancelable: true }))
|
|
140
|
-
};`;function B(
|
|
141
|
-
${
|
|
140
|
+
};`;function B(D){if(/\$emit\s*\(/.test(D))return`${M}
|
|
141
|
+
${D}`;return`var scope = $el.closest('[data-stx-scope]');
|
|
142
142
|
if (scope && scope.__stx_execute) {
|
|
143
143
|
scope.__stx_execute('${A}', $event, $el);
|
|
144
144
|
}
|
|
145
145
|
else {
|
|
146
|
-
${
|
|
146
|
+
${D}
|
|
147
147
|
}`}if(c.debounce!==null)return` ;(function() {
|
|
148
148
|
// eslint-disable-next-line pickier/no-unused-vars
|
|
149
149
|
var $el = document.getElementById('${i}')
|
|
@@ -167,7 +167,7 @@ else {
|
|
|
167
167
|
}${v})
|
|
168
168
|
})()`;if(/\$emit\s*\(/.test(l))return` var $el = document.getElementById('${i}')
|
|
169
169
|
if ($el) $el.addEventListener('${n}', function($event) {
|
|
170
|
-
${E}${
|
|
170
|
+
${E}${M}
|
|
171
171
|
${l}
|
|
172
172
|
}${v})`;return` var $el = document.getElementById('${i}')
|
|
173
173
|
if ($el) $el.addEventListener('${n}', function($event) {
|
|
@@ -181,47 +181,47 @@ else {
|
|
|
181
181
|
}${v})`}function hc(e){if(e.length===0)return"";return`
|
|
182
182
|
// STX: auto-generated event bindings
|
|
183
183
|
${e.map((i,n)=>mc(i,n)).join(`
|
|
184
|
-
`)}`}function
|
|
185
|
-
`)a++;continue}if(y==="/"&&n[a+1]==="*"){a+=2;while(a<l-1&&!(n[a]==="*"&&n[a+1]==="/"))a++;a+=2;continue}if(y==="{"){c++,a++;continue}if(y==="}"){c--,a++;continue}if(c===0){let v=n.slice(a),E=v.match(/^(?:const|let|var)\s+([a-zA-Z_$]\w*)\s*(?::[^=]*)?=/);if(E){let B=E[1];if(!B.startsWith("_")&&!i.has(B))t.push(B),i.add(B);a+=E[0].length;continue}let A=v.match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(A){A[1].split(",").forEach((B)=>{let
|
|
184
|
+
`)}`}function Wr(e){let t=[],i=new Set,n=e.replace(/^\s*import\s+.*$/gm,""),c=0,l=n.length,a=0;while(a<l){let y=n[a];if(y==="'"||y==='"'||y==="`"){let v=y;if(a++,v==="`"){let E=0;while(a<l){if(n[a]==="\\"){a+=2;continue}if(n[a]==="`"&&E===0){a++;break}if(n[a]==="$"&&n[a+1]==="{"){E++,a+=2;continue}if(n[a]==="}"&&E>0){E--,a++;continue}a++}}else while(a<l){if(n[a]==="\\"){a+=2;continue}if(n[a]===v){a++;break}a++}continue}if(y==="/"&&n[a+1]==="/"){while(a<l&&n[a]!==`
|
|
185
|
+
`)a++;continue}if(y==="/"&&n[a+1]==="*"){a+=2;while(a<l-1&&!(n[a]==="*"&&n[a+1]==="/"))a++;a+=2;continue}if(y==="{"){c++,a++;continue}if(y==="}"){c--,a++;continue}if(c===0){let v=n.slice(a),E=v.match(/^(?:const|let|var)\s+([a-zA-Z_$]\w*)\s*(?::[^=]*)?=/);if(E){let B=E[1];if(!B.startsWith("_")&&!i.has(B))t.push(B),i.add(B);a+=E[0].length;continue}let A=v.match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(A){A[1].split(",").forEach((B)=>{let D=B.trim(),I=D.indexOf(":"),j=I>=0?D.slice(I+1).trim().split(/[\s=]/)[0]:D.split(/[\s=]/)[0];if(j&&!j.startsWith("_")&&!i.has(j))t.push(j),i.add(j)}),a+=A[0].length;continue}let M=v.match(/^(?:async\s+)?function\s+([a-zA-Z_$]\w*)/);if(M){let B=M[1];if(!B.startsWith("_")&&!i.has(B))t.push(B),i.add(B);a+=M[0].length;continue}}a++}return t}var xc=new Set(["if","else","true","false","null","undefined","typeof","instanceof","in","of","new","this","return","void","delete","throw","switch","case","break","continue","for","while","do","try","catch","finally","const","let","var","function","class","import","export","default","async","await","yield","with","debugger","console","window","document","Math","JSON","Date","Array","Object","String","Number","Boolean","Symbol","Map","Set","Promise","Error","parseInt","parseFloat","isNaN","isFinite","encodeURIComponent","decodeURIComponent","setTimeout","setInterval","clearTimeout","clearInterval","fetch","alert","confirm","prompt","event"]);function bc(e){let t=new Set,i=/[a-zA-Z_$][a-zA-Z0-9_$]*/g;function n(B){let D;while((D=i.exec(B))!==null){let I=D[0];if(!xc.has(I))t.add(I)}}let c=/\{\{([\s\S]*?)\}\}/g,l;while((l=c.exec(e))!==null)n(l[1]);let a=/:[a-z][\w.-]*\s*=\s*"([^"]*)"/gi;while((l=a.exec(e))!==null)n(l[1]);let y=/:[a-z][\w.-]*\s*=\s*'([^']*)'/gi;while((l=y.exec(e))!==null)n(l[1]);let v=/@[a-z]+(?:\.[a-z]+)*\s*=\s*"([^"]*)"/gi;while((l=v.exec(e))!==null)n(l[1]);let E=/@[a-z]+(?:\.[a-z]+)*\s*=\s*'([^']*)'/gi;while((l=E.exec(e))!==null)n(l[1]);let A=/@model\s*=\s*["']([^"']*)["']/gi;while((l=A.exec(e))!==null)n(l[1]);let M=/@for\s*=\s*["'][^"']*\bin\s+([^"']+)["']/gi;while((l=M.exec(e))!==null)n(l[1]);return t}async function Le(e,t={}){let i=e,n="",c=!1,l=[],a=mi(i,{filePath:t.filePath,projectRoot:t.projectRoot});i=a.code;let y=hi(a.styles),v=Nt(i);i=v.code,l=[...v.imports,...v.models];let{hasUserImports:E,bundleClientScript:A}=await o("stx/client-script-bundler",()=>import("./chunk-aayq1a90.js"));if(E(i))i=await A(i,t.filePath||"",{projectRoot:t.projectRoot,minify:t.production}),c=!0;if(t.autoImports!==!1){let L=qc(i);i=L.code,n=Kc(L.stxImports,L.browserImports.filter((ee)=>!l.includes(ee)))}if(n=`${yn(i,t.serverData)}${n}`,i=P(i),!c&&je(t.attrs||""))i=Be(i);let M=hc(t.eventBindings||[]),B=(t.attrs||"").trim(),D=/\btype\s*=\s*["']module["']/i.test(B),I=t.instanceId?` data-stx-instance="${t.instanceId}"`:"";if(D){let L=B.replace(/\btype\s*=\s*["']module["']/i,"").trim(),ee=`type="module" data-stx-scoped${I}${L?` ${L}`:""}`;return`${y}<script ${ee}>
|
|
186
186
|
${dn(`${n}${i}
|
|
187
|
-
${
|
|
188
|
-
</script>`}let j=
|
|
187
|
+
${M}`)}
|
|
188
|
+
</script>`}let j=Ri(e),Q=/function __stx_setup_/.test(i),X=/\bstx\.mount\s*\(|\bstx\.mountEl\s*\(/.test(e);function z(L){let ee=L.length>0?`
|
|
189
189
|
return ${Os(i,L)};`:"",te=JSON.stringify(`[stx] client block failed${t.filePath?` (${t.filePath})`:""}; this block will not hydrate`);return`${y}<script data-stx-scoped data-stx-run="always"${I}>
|
|
190
190
|
window.stx.mount(function() {
|
|
191
191
|
'use strict';
|
|
192
192
|
try {
|
|
193
193
|
${dn(`${n}${i}
|
|
194
|
-
${
|
|
194
|
+
${M}${ee}`)}
|
|
195
195
|
} catch (error) {
|
|
196
196
|
console.error(${te}, error);
|
|
197
197
|
return {};
|
|
198
198
|
}
|
|
199
|
-
})</script>`}if(!X&&!Q){if(j)return z(
|
|
199
|
+
})</script>`}if(!X&&!Q){if(j)return z(Wr(e));if(t.templateContent){let L=Wr(e);if(L.length>0){let ee=bc(t.templateContent);if(L.some((re)=>ee.has(re)))return z(L)}}}return`${y}<script data-stx-scoped data-stx-run="always"${I}>
|
|
200
200
|
;(function() {
|
|
201
201
|
'use strict';
|
|
202
202
|
try {
|
|
203
203
|
${dn(`${n}${i}
|
|
204
|
-
${
|
|
204
|
+
${M}`)}
|
|
205
205
|
} catch (error) {
|
|
206
206
|
console.error(${JSON.stringify(`[stx] client block failed${t.filePath?` (${t.filePath})`:""}; this block will not hydrate`)}, error);
|
|
207
207
|
}
|
|
208
|
-
})()</script>`}import{createHash as
|
|
208
|
+
})()</script>`}import{createHash as kc}from"crypto";var In=/<script\b[^>]*>/iy,gs=/<\/script\s*>/ig,On=/<style\b[^>]*>/iy,ms=/<\/style\s*>/ig;function Fr(e,t,i,n){i.lastIndex=t;let c=i.exec(e);if(!c||c.index!==t)return-1;n.lastIndex=i.lastIndex;let l=n.exec(e);if(!l)return-1;return l.index+l[0].length}function W(e,t){return Fr(e,t,In,gs)}function pn(e,t){return Fr(e,t,On,ms)}function Ne(e,t){if(!e.startsWith("<!--",t))return-1;let i=e.indexOf("-->",t+4);if(i===-1)return-1;return i+3}function Ur(e,t){if(e.startsWith("<!--",t)){let c=Ne(e,t);return c===-1?e.length:c}if(In.lastIndex=t,In.exec(e)?.index===t){gs.lastIndex=In.lastIndex;let c=gs.exec(e);return c?c.index+c[0].length:e.length}if(On.lastIndex=t,On.exec(e)?.index===t){ms.lastIndex=On.lastIndex;let c=ms.exec(e);return c?c.index+c[0].length:e.length}return-1}function S(e,t){let i=[],n=0,c=e.length,l=!1,a=null;while(n<c){let y=e[n];if(l){if(a){if(y===a)a=null}else if(y==='"'||y==="'")a=y;else if(y===">")l=!1;n++;continue}if(y!=="<"){let M=e.indexOf("<",n+1);if(M===-1)break;n=M;continue}let v=t(e,n);if(v>n){i.push({start:n,end:v,token:e.slice(n,v)}),n=v;continue}let E=Ur(e,n);if(E>n){n=E;continue}let A=e.charCodeAt(n+1);if(A>=65&&A<=90||A>=97&&A<=122)l=!0;n++}return i}function Vr(e){let t=0,i=0,n=0,c=!1,l=null;while(n<e.length){if(c){let M=e[n];if(l){if(M===l)l=null}else if(M==='"'||M==="'")l=M;else if(M===">")c=!1;n++;continue}let a=e.indexOf("<",n),y=a===-1?e.length:a;while(n<y){let M=e[n++];if(M==="{")t++;else if(M==="}")i++;if(t>=2&&i>=2)return!0}if(a===-1)break;let v=Ur(e,a);if(v>a){n=v;continue}let E=e.charCodeAt(a+1),A=E===47?e.charCodeAt(a+2):E;if(A>=65&&A<=90||A>=97&&A<=122)c=!0;n=a+1}return!1}function Ac(e,t){while(e.size>=t){let i=e.keys().next();if(i.done)return;e.delete(i.value)}}var yc=1024,_c=16777216,vt=new Map,fs=0;function wc(e,t){vt.set(e,t),fs+=e.length+t.output.length;for(let[i,n]of vt){if(fs<=_c)break;vt.delete(i),fs-=i.length+n.output.length}}function pe(e,t,i,n){let c=n!==void 0&&e.length>=yc,l=c?`${n}\x00${e}`:"";if(c){let A=vt.get(l);if(A)return vt.delete(l),vt.set(l,A),{output:A.output,tokens:A.tokens.slice()}}let a=S(e,t);if(a.length===0)return{output:e,tokens:[]};let y=a.map((A)=>A.token),v="",E=0;for(let A=0;A<a.length;A++){let M=a[A];v+=e.slice(E,M.start),v+=i(M.token,A),E=M.end}if(v+=e.slice(E),c)return wc(l,{output:v,tokens:y}),{output:v,tokens:y.slice()};return{output:v,tokens:y}}var Sc=1024,vc=16777216,Et=new Map,ps=0;function Ec(e,t){Et.set(e,t),ps+=e.length+t.output.length;for(let[i,n]of Et){if(ps<=vc)break;Et.delete(i),ps-=i.length+n.output.length}}function ds(e,t,i){return{output:t,scripts:i,restore:(n)=>n===t?e:vr(n,i)}}function G(e){let t=e.length>=Sc;if(t){let c=Et.get(e);if(c)return Et.delete(e),Et.set(e,c),ds(e,c.output,c.scripts.slice())}let{output:i,tokens:n}=pe(e,W,(c,l)=>`\x00STX_SCRIPT_${l}\x00`);if(t)return Ec(e,{output:i,scripts:n}),ds(e,i,n.slice());return ds(e,i,n)}function vr(e,t){if(t.length===0)return e;return e.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(i,n)=>t[+n]??"")}var Pn="__stx_component_client_factories";function Dn(e){let t=e[Pn];return t instanceof Map?t:null}function Hc(e){e[Pn]=new Map}function hs(e,t){let i=Dn(e);if(!i)return null;let n=kc("sha256").update(t).digest("hex").slice(0,16),c=i.get(n);if(c)c.instances++;else i.set(n,{body:t,instances:1});return n}function Vc(e,t){let i=Dn(t);if(!i?.size)return e;let n=new Map;for(let[A,M]of i)if(M.instances===1)n.set(A,M.body);let c=[];if(n.size>0){let A=[...n.keys()].map((D)=>JSON.stringify(D).replace(/[$()*+.?[\\\]^{|}]/g,"\\$&")).join("|"),M=new RegExp(`window\\.__stxComponentFactories\\[(${A})\\]\\(("[^"]+")\\);`,"g"),B=M.exec(e);while(B!==null){let D=n.get(JSON.parse(B[1]));if(D!==void 0)c.push({start:B.index,end:B.index+B[0].length,replacement:`(${D})(${B[2]});`});B=M.exec(e)}}let l=[...i].filter(([,A])=>A.instances>1);if(l.length===0)return Hr(e,c);let y=`<script data-stx-scoped data-stx-run="always" data-stx-component-factories>
|
|
209
209
|
(function() {
|
|
210
210
|
const factories = window.__stxComponentFactories = window.__stxComponentFactories || {};
|
|
211
|
-
${l.map(([A,
|
|
211
|
+
${l.map(([A,M])=>` try { factories[${JSON.stringify(A)}] = factories[${JSON.stringify(A)}] || ${M.body}; }
|
|
212
212
|
catch (e) { console.error('[stx] component factory ' + ${JSON.stringify(A)} + ' failed to register; instances of it will not hydrate.', e); }`).join(`
|
|
213
213
|
`)}
|
|
214
214
|
})();
|
|
215
|
-
</script>`,v,E=/<(?:template\b|script\b(?=[^>]*\bdata-stx-scoped\b))/iy;return S(e,(A,
|
|
216
|
-
`}),Vr(e,c)}function Vr(e,t){if(t.length===0)return e;t.sort((l,a)=>l.start-a.start||l.end-a.end);let i=Array(t.length*2+1),n=0,c=0;for(let l of t)i[c++]=e.slice(n,l.start),i[c++]=l.replacement,n=l.end;return i[c]=e.slice(n),i.join("")}function Hr(e){let t=Pn(e),i=new Map;if(t)for(let[n,c]of t)i.set(n,c.instances);return i}function Zr(e,t){let i=Pn(e);if(!i)return[];let n=[];for(let[c,l]of i){let a=l.instances-(t.get(c)??0);if(a>0)n.push({body:l.body,count:a})}return n}function qr(e,t){for(let{body:i,count:n}of t)for(let c=0;c<n;c++)ms(e,i)}function ve(e,t,i=2){let n=0,c=null;for(let l=t+i;l<e.length;l++){let a=e[l];if(c){if(a==="\\"){l++;continue}if(a===c)c=null;continue}if(a==='"'||a==="'"||a==="`"){c=a;continue}if(a==="{"){n++;continue}if(a==="}"){if(n>0){n--;continue}let y=0;while(e[l+y]==="}")y++;if(y>=i)return l}}return-1}import ti from"fs";var Kr=0,hs=new Map;function Zc(){Kr=0,hs.clear()}function Dn(e,t){let i=Kr++,n=`<!--__STX_${e.toUpperCase()}_${i}__-->`;return hs.set(n,{type:e,expression:t}),n}function Qc(){let e={};for(let[t,i]of hs)e[t]={type:i.type,expression:i.expression};return e}function el(e,t){let i=e;for(let[n,c]of t)i=i.split(n).join(c);return i}function wi(e){return e.includes("<!--__STX_")}var kc=/@(?=[a-zA-Z_]\w*\s*\(|end[a-zA-Z]*\b|else(?:if)?\b|empty\b|case\b|default\b|break\b|continue\b|fallback\b)/g;function Cc(e){return Array.from({length:e},()=>"{").join("⁠")}function Xr(e){return e.replace(/\{{2,}/g,(t)=>Cc(t.length)).replace(/\{(?=!)/g,"{⁠").replace(kc,"@")}function xr(e,t,i=!1){let{openTag:n,tail:c}=i?Tc(e,t):ea(e).at(t);return na(c,n,i)}function Tc(e,t){let i="",n=0;for(let a=0;a<t;a++){if(!e.startsWith("{{",a))continue;let y=ve(e,a);if(y<0||y+2>t)break;i+=e.slice(n,a)+"x",a=y+1,n=y+2}i+=e.slice(n,t);let c=-1,l=null;for(let a=0;a<i.length;a++){let y=i[a];if(l){if(y===l)l=null;continue}if(y==='"'||y==="'"){l=y;continue}if(y===">"){c=-1;continue}if(y==="<")c=a}return{openTag:c,tail:c>=0?i.slice(c+1):i}}var Mn=null;function ea(e){if(Mn&&Mn.source===e)return Mn.scanner;let t=ta(e);return Mn={source:e,scanner:t},t}function ta(e){let t=0,i=-1,n=null,c=-1,l=(y,v)=>{let E=e[y];if(v.quote){if(E===v.quote)v.quote=null;return}if(v.openTag>=0){if(E==='"'||E==="'"){v.quote=E;return}if(E===">"){v.openTag=-1;return}}if(E==="<")v.openTag=y},a=(y,v)=>{if(v.openTag>=0||!e.startsWith("<!--",y))return-1;let E=e.indexOf("-->",y+4);return E<0?e.length:E+3};return{at(y){if(y<t)t=0,i=-1,n=null,c=-1;let v={openTag:i,quote:n},E=!1;while(t<y){if(c<0&&e.startsWith("{{",t)){let j=ve(e,t);if(j<0)c=t;else if(j+2<=y){t=j+2;continue}else break}let I=a(t,v);if(I>=0){if(I>y){E=!0;break}t=I;continue}l(t,v),t++}if(i=v.openTag,n=v.quote,E)return{openTag:-1,tail:""};let A=c>=0?c:t,D={openTag:i,quote:n};for(let I=t;I<y;I++){let j=a(I,D);if(j>=0){if(j>y)return{openTag:-1,tail:""};I=j-1;continue}l(I,D)}if(D.openTag<0)return{openTag:-1,tail:""};let B="",M=D.openTag+1;for(let I=M;I<Math.min(y,A);I++){if(!e.startsWith("{{",I))continue;let j=ve(e,I);B+=e.slice(M,I)+"x",I=j+1,M=j+2}return B+=e.slice(M,y),{openTag:D.openTag,tail:B}}}}function na(e,t,i){if(t<0&&!i)return null;if(t>=0&&/^\s*[!/?]/.test(e))return/^\s*\/?\s*$/.test(e)?{kind:"tag-name"}:null;if(t>=0&&/^\s*$/.test(e))return{kind:"tag-name"};let n=0;if(t>=0)while(n<e.length&&!/\s/.test(e[n]))n++;while(n<e.length){while(/\s/.test(e[n]??"")&&n<e.length)n++;let c=n;while(n<e.length&&!/[\s=/>]/.test(e[n]))n++;let l=e.slice(c,n);if(!l)break;while(n<e.length&&/\s/.test(e[n]))n++;if(e[n]!=="=")continue;n++;while(n<e.length&&/\s/.test(e[n]))n++;let a=e[n];if(a==='"'||a==="'"){let y=++n,v=e.indexOf(a,n);if(v===-1)return{kind:"attribute",name:l,quote:a,valuePrefix:e.slice(y)};n=v+1}else{let y=n;while(n<e.length&&!/\s/.test(e[n]))n++;if(n===e.length)return{kind:"attribute",name:l,quote:null,valuePrefix:e.slice(y)}}}return{kind:"tag"}}class oe extends Error{attribute;near;constructor(e,t){super(`Unsafe interpolation in ${e}: ${t}`);this.name="UnsafeInterpolationContextError",this.attribute=e}locate(e,t){if(this.near===void 0)this.near=e.slice(Math.max(0,t-160),t).replace(/\s+/g," ").trim(),this.message+=` (after: ${JSON.stringify(this.near)})`;return this}}var Jr="unsafe:";var sa=/^(?:javascript|vbscript|livescript|mocha|view-source):/,ra=/^data:(?:text\/html|text\/xml|application\/xhtml\+xml|application\/xml|image\/svg\+xml)/,ia=/^data:(?:text\/html|application\/xhtml\+xml)/,oa=new RegExp("[\\u0000-\\u0020\\u00A0\\u1680\\u2000-\\u200F\\u2028\\u2029\\u202F\\u205F\\u3000\\uFEFF]+","g");function ca(e){return e.replace(oa,"").toLowerCase()}function xs(e){let t=e.toLowerCase();if(new RegExp("^(?:href|xlink:href|action|formaction|ping|cite|manifest|data|to)$").test(t))return"navigable";if(new RegExp("^(?:src|srcset|poster|background)$").test(t))return"fetched";return null}function jn(e,t="navigable"){let i=ca(e);if(sa.test(i))return!0;return t==="navigable"?ra.test(i):ia.test(i)}function wr(e,t="navigable"){return jn(e,t)?"unsafe:"+e:e}function aa(e){let t=e.match(/(?:^|[\s"'`/])([A-Za-z][\w:-]*)\s*=\s*(["'])([^"']*)$/);if(!t)return null;if(t[3].trim()!=="")return null;return xs(t[1])}function Gr(e,t,i=256){if(t<=i)return e.slice(0,t);let n=e.slice(t-i,t),c=n.search(/[\s"'`/]/);return c===-1?"":n.slice(c)}function Yr(e,t,i=t){let n=aa(e);return n&&jn(t,n)?"unsafe:"+i:i}function At(e){let t=e.indexOf(" as ");if(t!==-1){let l=e.slice(0,t).trim(),a=e.slice(t+4).trim();return l&&a?{arrayExpr:l,itemVar:a}:null}let i=/^\s*(.+?)\s+in\s+([\s\S]+)$/.exec(e);if(!i)return null;let n=i[1].trim().replace(/^\(([\s\S]*)\)$/,"$1").trim(),c=i[2].trim();return n&&c?{arrayExpr:c,itemVar:n}:null}function Nn(e){let t=[],i=0,n="",c=0;for(let l=0;l<e.length;l++){let a=e[l];if(n){if(a==="\\")l++;else if(a===n)n="";continue}if(a==="'"||a==='"'||a==="`")n=a;else if(a==="("||a==="["||a==="{")i++;else if(a===")"||a==="]"||a==="}")i--;else if(a===","&&i===0)t.push(e.slice(c,l)),c=l+1}return t.push(e.slice(c)),t}function Qr(e,t){let i=0;for(let n=0;n<e.length;n++){let c=e[n];if(c==="("||c==="["||c==="{")i++;else if(c===")"||c==="]"||c==="}")i--;else if(c===t&&i===0)return n}return-1}function ei(e){let t=0;for(let i=0;i<e.length;i++){let n=e[i];if(n==="("||n==="["||n==="{")t++;else if((n===")"||n==="]"||n==="}")&&--t===0)return i}return-1}function xt(e,t){let i=e.trim().replace(/^\.\.\./,"").trim(),n=Qr(i,"=");if(n!==-1&&i[n+1]!==">")i=i.slice(0,n).trim();if(!i)return;if(i.startsWith("{")&&i.endsWith("}")){for(let c of Nn(i.slice(1,-1))){let l=c.trim();if(!l)continue;if(l.startsWith("...")){xt(l,t);continue}let a=Qr(l,":");xt(a===-1?l:l.slice(a+1),t)}return}if(i.startsWith("[")&&i.endsWith("]")){for(let c of Nn(i.slice(1,-1)))xt(c,t);return}if(/^[A-Z_$][\w$]*$/i.test(i))t.push(i)}function J(e){let t=e.trim(),i=[],n=0;for(let l=0;l<t.length;l++){let a=t[l];if(a==="("||a==="["||a==="{")n++;else if(a===")"||a==="]"||a==="}")n--;else if(n===0&&/\s/.test(a)){if(!/^\s+(?:in|of)\s/.exec(t.slice(l)))continue;let v=t.slice(0,l).trim();if(v.startsWith("(")&&ei(v)===v.length-1)v=v.slice(1,-1);for(let E of Nn(v))xt(E,i);if(i.length>0)return i;break}}let c=/^[\s\S]+?\s+as\s+([\s\S]+)$/.exec(t);if(c){let l=c[1].trim();if(l.startsWith("(")&&ei(l)===l.length-1)l=l.slice(1,-1);let a=/^([\w$]+)\s*=>\s*([\s\S]+)$/.exec(l);if(a)xt(a[2],i),xt(a[1],i);else for(let y of Nn(l))xt(y,i)}return i}function O(e,t){let i=t instanceof Set?t:new Set(t);if(i.size===0)return!1;let a=e.replace(/'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"/g," ").replace(/`(?:[^`\\$]|\\.|\$(?!\{))*`/g," ").replace(/\??\.\s*[a-zA-Z_$][\w$]*/g," ").replace(/([{,]\s*)[a-zA-Z_$][\w$]*(\s*:(?!:))/g,"$1$2");for(let y of a.match(/[a-zA-Z_$][\w$]*/g)||[])if(i.has(y))return!0;return!1}var Ln="__stx_client_loop_names";function rt(e){let t=e?.[Ln];return Array.isArray(t)?t:[]}function Bn(e){if(!e.includes("#")&&!e.includes("v-slot:")&&!e.includes("data-stx-slot-binding"))return[];let t=[],i=[],n=/<!--[\s\S]*?-->|<script\b(?:"[^"]*"|'[^']*'|[^'">])*>[\s\S]*?<\/script\s*>|<style\b(?:"[^"]*"|'[^']*'|[^'">])*>[\s\S]*?<\/style\s*>|<\/?[a-z][\w:-]*\b(?:"[^"]*"|'[^']*'|[^'">])*>/gi;for(let c of e.matchAll(n)){let l=c[0];if(/^<\/template\s*>$/i.test(l)){let a=i.pop();if(a)a.end=c.index}else if(/^<template\b/i.test(l)&&!/\/\s*>$/.test(l)){let y=[...l.slice(9).matchAll(/([^\s=/>]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+)))?/g)].find((A)=>/^(?:#[\w-]+|v-slot:[\w-]+|data-stx-slot-binding)$/i.test(A[1])),v=(y?.[2]??y?.[3])?.trim();if(v&&y?.[1]==="data-stx-slot-binding")try{v=decodeURIComponent(v)}catch{v=void 0}let E=v?{start:c.index+l.length,end:e.length,binding:v}:void 0;if(i.push(E),E)t.push(E)}}return t}var Xt={},ni=new Map;function la(e){let t=ni.get(e);if(!t){let i=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");t=new RegExp(`:${i}(?!\\w)`,"g"),ni.set(e,t)}return t.lastIndex=0,t}var Us={uppercase:(e,t)=>e!==void 0&&e!==null?String(e).toUpperCase():"",lowercase:(e,t)=>e!==void 0&&e!==null?String(e).toLowerCase():"",capitalize:(e,t)=>{if(e===void 0||e===null)return"";let i=String(e);return i.charAt(0).toUpperCase()+i.slice(1)},number:(e,t,i=0)=>{if(e===void 0||e===null)return"";try{let n=Number(e);return Number.isNaN(n)?"":n.toFixed(Number.parseInt(String(i),10))}catch{return""}},fmt:(e,t,i="en-US")=>{if(e===void 0||e===null)return"";try{let n=Number(e);if(Number.isNaN(n))return String(e);return n.toLocaleString(i)}catch{return String(e)}},join:(e,t,i=",")=>{if(!Array.isArray(e))return"";return e.join(String(i))},escape:(e,t)=>{if(e===void 0||e===null)return"";return U(String(e))},translate:(e,t,i={})=>{if(!t||!t.__translations)return e;let n=t.__translations,c=t.__i18nConfig?.fallbackToKey??!0,l=String(e).split("."),a=n;for(let v of l){if(a===void 0||a===null)break;a=a[v]}if(a===void 0||a===null)return c?e:"";let y=String(a);return Object.entries(i).forEach(([v,E])=>{y=y.replace(la(v),()=>String(E))}),y},t:(e,t,i={})=>Us.translate(e,t,i),truncate:(e,t,i=50,n="...")=>{if(e===void 0||e===null)return"";let c=String(e);if(c.length<=i)return c;if(i<=n.length)return n.substring(0,i);return c.substring(0,i-n.length)+n},date:(e,t,i="short",n="en-US")=>{if(e===void 0||e===null)return"";try{let c=e instanceof Date?e:new Date(e);if(Number.isNaN(c.getTime()))return String(e);let l={short:{dateStyle:"short"},medium:{dateStyle:"medium"},long:{dateStyle:"long"},full:{dateStyle:"full"},time:{timeStyle:"short"},datetime:{dateStyle:"short",timeStyle:"short"},iso:{}};if(i==="iso")return c.toISOString();return new Intl.DateTimeFormat(n,l[i]||l.short).format(c)}catch{return String(e)}},currency:(e,t,i="USD",n="en-US")=>{if(e===void 0||e===null)return"";try{let c=Number(e);if(Number.isNaN(c))return String(e);return new Intl.NumberFormat(n,{style:"currency",currency:i}).format(c)}catch{return String(e)}},pluralize:(e,t,i,n)=>{let c=Number(e);if(Number.isNaN(c))return i;let l=n||`${i}s`;return c===1?i:l},first:(e,t)=>{if(e===void 0||e===null)return"";if(Array.isArray(e))return e.length===0?"":e[0];return String(e).charAt(0)},last:(e,t)=>{if(e===void 0||e===null)return"";if(Array.isArray(e))return e.length===0?"":e[e.length-1];let i=String(e);return i.charAt(i.length-1)},length:(e,t)=>{if(e===void 0||e===null)return 0;if(Array.isArray(e)||typeof e==="string")return e.length;if(e instanceof Map||e instanceof Set)return e.size;if(typeof e==="object")return Object.keys(e).length;return 0},json:(e,t,i=!1)=>{if(e===void 0)return"undefined";if(e===null)return"null";try{return i?JSON.stringify(e,null,2):JSON.stringify(e)}catch{return String(e)}},default:(e,t,i="")=>e===void 0||e===null||e===""?i:e,reverse:(e,t)=>{if(e===void 0||e===null)return"";if(Array.isArray(e))return[...e].reverse();return String(e).split("").reverse().join("")},slice:(e,t,i=0,n)=>{if(e===void 0||e===null)return"";if(Array.isArray(e)||typeof e==="string")return e.slice(i,n);return e},replace:(e,t,i,n="")=>{if(e===void 0||e===null)return"";let c=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return String(e).replace(new RegExp(c,"g"),()=>n)},stripTags:(e,t)=>{if(e===void 0||e===null)return"";return String(e).replace(/<[^>]*>/g,"")},urlencode:(e,t)=>{if(e===void 0||e===null)return"";return encodeURIComponent(String(e))},abs:(e,t)=>{let i=Number(e);return Number.isNaN(i)?0:Math.abs(i)},round:(e,t,i=0)=>{let n=Number(e);if(Number.isNaN(n))return 0;let c=10**i;return Math.round(n*c)/c}};function gg(e,t){if(e in Us)console.warn(`Filter "${e}" already exists as a built-in filter. Custom filter will take precedence.`);Xt[e]=t}function Gh(e){for(let[t,i]of Object.entries(e))gg(t,i)}function mg(){return{...Us,...Xt}}function Jh(){for(let e of Object.keys(Xt))delete Xt[e]}function Mt(e,t,i=2){let n="{".repeat(i);if(!e.includes(n))return e;let c="",l=0;for(;;){let a=e.indexOf(n,l);if(a===-1)break;let y=ve(e,a,i);if(y===-1)break;c+=e.slice(l,a)+t(e.slice(a,y+i),e.slice(a+i,y),a),l=y+i}return l===0?e:c+e.slice(l)}function ua(e,t,i){let n=i[0];if(n!=="'"&&n!=='"'&&n!=="`")return!1;let c=xr(e,t);if(!c||c.kind!=="attribute"||c.quote===n)return!1;if(!/^(?::|@|x-|v-)/.test(c.name))return!1;let l=0;for(let a=0;a<c.valuePrefix.length;a++)if(c.valuePrefix[a]==="\\")a++;else if(c.valuePrefix[a]===n)l++;return l%2===1}function p(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function U(e){return Xr(p(e))}function fa(e){return e.replace(/ /g," ").replace(/\t/g,"	").replace(/\n/g," ").replace(/\r/g," ").replace(/\f/g,"").replace(/=/g,"=").replace(/`/g,"`")}function pa(e){return e.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\\([\dA-Fa-f]{1,6})\s?/g,(t,i)=>String.fromCodePoint(Number.parseInt(i,16))).replace(/\\([^\r\n])/g,"$1").replace(/[\u0000-\u0020]+/g,"").toLowerCase()}function da(e,t){let i=pa(e);if(/@import|expression\(|behavior:|-moz-binding|(?:image-set|cross-fade)\(/.test(i))throw new oe(t,"network-capable or executable CSS is not allowed in an escaped interpolation");let n=/url\(([^)]*)\)/g,c;while((c=n.exec(i))!==null){let l=c[1].replace(/^["']|["']$/g,""),a=l.startsWith("/")&&!l.startsWith("//")||l.startsWith("./")||l.startsWith("../")||l.startsWith("#"),y=/^data:image\/(?:avif|bmp|gif|jpeg|jpg|png|webp);base64,[a-z\d+/=]+$/i.test(l);if(!a&&!y)throw new oe(t,"CSS URLs must be local paths or base64 raster images")}}function Z(e,t,i,n=!1,c=0){try{return ga(e,t,i,n,c)}catch(l){if(l instanceof oe)l.locate(e,t);throw l}}function ga(e,t,i,n,c){let l=xr(e,t,n),a=U(i);if(!l)return a;if(l.kind==="tag-name"){if(!/^[A-Za-z][A-Za-z0-9:-]*$/.test(i))throw new oe("tag name","dynamic tag names may contain only letters, digits, colons, and hyphens");return i}if(l.kind==="tag"){let E=e.slice(t+c).trimStart(),A=i.trim();if(!E.startsWith("=")&&(A===""||/^(?!on)[A-Za-z_:][\w:.-]*(?:\s+(?!on)[A-Za-z_:][\w:.-]*)*$/.test(A)))return A;throw new oe("tag structure","only standalone boolean attributes may be interpolated into tag structure")}let y=l.name.toLowerCase();if(/^on[a-z]/.test(y))throw new oe(l.name,"native event-handler attributes execute JavaScript; use an @event binding instead");if(y==="srcdoc")a=U(a);if(y==="style")da(i,l.name);if(l.quote===null)a=fa(a);let v=xs(y);if(v&&l.valuePrefix.trim()===""&&jn(i,v))return Jr+a;return Yr(Gr(e,t),i,a)}function wn(e,t){let i=` ${e}="`;return Z(i,i.length,t,!0)}function Ei(e){return e.flatMap((t)=>{let i=t.match(/^<script\b([^>]*)>([\s\S]*?)<\/script\s*>$/i);return!i||/\bserver\b|\bsrc\s*=/.test(i[1])?[]:[i[2]]})}function Se(e,t){let{scripts:i}=G(e);for(let n of Ei(i)){if(/\b(state|derived|effect|ref|reactive|computed|watch|watchEffect|useModel)\s*(?:<[^>]*>)?\s*\(/.test(n)||Jc.test(n))return!0;if(Nr(n,t))return!0}if(/@(if|for|show)\s*=\s*["'][^"']*\(\s*\)/.test(e))return!0;if(/@for\s*=\s*["'][^"']*\s+(?:in|of)\s+[^"']*\(\s*\)/.test(e))return!0;if(/(?:^|[\s"'])(?::|x-)(?:for|if|else-if|else|show|text|html|model|bind)\b/.test(e))return!0;return!1}function hg(e){let t=[],i=/<([a-zA-Z][\w-]*)\b[^>]*?\s(?::for|x-for|@for)\s*=\s*(["'])([\s\S]*?)\2[^>]*>/g;for(let n=i.exec(e);n;n=i.exec(e)){let c=n[1].toLowerCase(),l=new Set(J(n[3]));if(l.size===0)continue;let a=n.index+n[0].length;if(n[0].endsWith("/>")){t.push({start:n.index,end:a,names:l});continue}let y=new RegExp(`<(/?)${c}\\b[^>]*?(/?)>`,"gi");y.lastIndex=a;let v=1,E=e.length;for(let A=y.exec(e);A;A=y.exec(e)){if(A[2]==="/")continue;if(v+=A[1]==="/"?-1:1,v===0){E=A.index+A[0].length;break}}t.push({start:n.index,end:E,names:l})}return t}function si(e,t,i){let n=r(i);for(let c of e){if(t<c.start||t>=c.end)continue;for(let l of c.names)if(new RegExp(`(?<![.#\\w$])${l.replace(/\$/g,"\\$")}(?![\\w$])`).test(n))return!0}return!1}function ri(e,t){let i=["parseInt","parseFloat","String","Number","Boolean","Array","Object","JSON","Math","Date","URL","URLSearchParams","Intl","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","true","false","null","undefined","NaN","Infinity","isNaN","isFinite","window","document","console","new","typeof","instanceof","in","void"],n=e.replace(/'[^']*'/g,"").replace(/"[^"]*"/g,""),c="",l=!1,a=0;for(let E=0;E<n.length;E++){let A=n[E];if(!l&&A==="`"){l=!0,a=0;continue}if(l){if(A==="`"&&a===0){l=!1;continue}if(A==="$"&&n[E+1]==="{"){a++,E++,c+=" ";continue}if(A==="}"&&a>0){a--;continue}if(a>0){c+=A;continue}continue}c+=A}n=c;let y=/(?<![a-zA-Z0-9_$])([a-zA-Z_$][a-zA-Z0-9_$]*)/g,v;while((v=y.exec(n))!==null){let E=v[1];if(!n.substring(0,v.index).trimEnd().endsWith(".")){if(!i.includes(E)&&!(E in t))return!1}}return!0}function ma(e,t){let i=r(e);for(let n of i.matchAll(/(?<![.\w$])([A-Z_$][\w$]*)\s*\(/gi))if(typeof t[n[1]]==="function")return!0;return!1}function ha(e,t){let i=t.__stx_serverDeclared;if(!i||i.size===0)return!1;let n=r(e);for(let c of i)if(new RegExp(`(?<![.#\\w$])${c}(?![\\w$])`).test(n))return!0;return!1}var xi=new Set;function _i(e){return/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*$/.test(e.trim())}function xa(e,t,i){let n=i[0];if(n!=="'"&&n!=='"'&&n!=="`")return!1;let c=0;for(let l=e.lastIndexOf(`
|
|
217
|
-
`,t-1)+1;l<t;l++)if(e[l]==="\\")l++;else if(e[l]===n)c++;return c%2===1}function
|
|
218
|
-
`).length}`;console.warn(`${l}: stx warning: ${t} rendered as an empty string. The safe evaluator rejected \`${e.expression}\` (${e.rule}). Compute the value in <script server> and interpolate the variable instead.`)}function T(e,t,i=!1,n){try{let c=e.trim(),l=
|
|
215
|
+
</script>`,v,E=/<(?:template\b|script\b(?=[^>]*\bdata-stx-scoped\b))/iy;return S(e,(A,M)=>{if(v===void 0){if(E.lastIndex=M,E.test(A))v=M}return-1}),c.push({start:v??0,end:v??0,replacement:`${y}
|
|
216
|
+
`}),Hr(e,c)}function Hr(e,t){if(t.length===0)return e;t.sort((l,a)=>l.start-a.start||l.end-a.end);let i=Array(t.length*2+1),n=0,c=0;for(let l of t)i[c++]=e.slice(n,l.start),i[c++]=l.replacement,n=l.end;return i[c]=e.slice(n),i.join("")}function Zr(e){let t=Dn(e),i=new Map;if(t)for(let[n,c]of t)i.set(n,c.instances);return i}function qr(e,t){let i=Dn(e);if(!i)return[];let n=[];for(let[c,l]of i){let a=l.instances-(t.get(c)??0);if(a>0)n.push({body:l.body,count:a})}return n}function Kr(e,t){for(let{body:i,count:n}of t)for(let c=0;c<n;c++)hs(e,i)}function ve(e,t,i=2){let n=0,c=null;for(let l=t+i;l<e.length;l++){let a=e[l];if(c){if(a==="\\"){l++;continue}if(a===c)c=null;continue}if(a==='"'||a==="'"||a==="`"){c=a;continue}if(a==="{"){n++;continue}if(a==="}"){if(n>0){n--;continue}let y=0;while(e[l+y]==="}")y++;if(y>=i)return l}}return-1}import ni from"fs";var Xr=0,xs=new Map;function Yc(){Xr=0,xs.clear()}function Mn(e,t){let i=Xr++,n=`<!--__STX_${e.toUpperCase()}_${i}__-->`;return xs.set(n,{type:e,expression:t}),n}function Zc(){let e={};for(let[t,i]of xs)e[t]={type:i.type,expression:i.expression};return e}function Qc(e,t){let i=e;for(let[n,c]of t)i=i.split(n).join(c);return i}function bi(e){return e.includes("<!--__STX_")}var Cc=/@(?=[a-zA-Z_]\w*\s*\(|end[a-zA-Z]*\b|else(?:if)?\b|empty\b|case\b|default\b|break\b|continue\b|fallback\b)/g;function Tc(e){return Array.from({length:e},()=>"{").join("⁠")}function Jr(e){return e.replace(/\{{2,}/g,(t)=>Tc(t.length)).replace(/\{(?=!)/g,"{⁠").replace(Cc,"@")}function xr(e,t,i=!1){let{openTag:n,tail:c}=i?ea(e,t):ta(e).at(t);return sa(c,n,i)}function ea(e,t){let i="",n=0;for(let a=0;a<t;a++){if(!e.startsWith("{{",a))continue;let y=ve(e,a);if(y<0||y+2>t)break;i+=e.slice(n,a)+"x",a=y+1,n=y+2}i+=e.slice(n,t);let c=-1,l=null;for(let a=0;a<i.length;a++){let y=i[a];if(l){if(y===l)l=null;continue}if(y==='"'||y==="'"){l=y;continue}if(y===">"){c=-1;continue}if(y==="<")c=a}return{openTag:c,tail:c>=0?i.slice(c+1):i}}var jn=null;function ta(e){if(jn&&jn.source===e)return jn.scanner;let t=na(e);return jn={source:e,scanner:t},t}function na(e){let t=0,i=-1,n=null,c=-1,l=(y,v)=>{let E=e[y];if(v.quote){if(E===v.quote)v.quote=null;return}if(v.openTag>=0){if(E==='"'||E==="'"){v.quote=E;return}if(E===">"){v.openTag=-1;return}}if(E==="<")v.openTag=y},a=(y,v)=>{if(v.openTag>=0||!e.startsWith("<!--",y))return-1;let E=e.indexOf("-->",y+4);return E<0?e.length:E+3};return{at(y){if(y<t)t=0,i=-1,n=null,c=-1;let v={openTag:i,quote:n},E=!1;while(t<y){if(c<0&&e.startsWith("{{",t)){let j=ve(e,t);if(j<0)c=t;else if(j+2<=y){t=j+2;continue}else break}let I=a(t,v);if(I>=0){if(I>y){E=!0;break}t=I;continue}l(t,v),t++}if(i=v.openTag,n=v.quote,E)return{openTag:-1,tail:""};let A=c>=0?c:t,M={openTag:i,quote:n};for(let I=t;I<y;I++){let j=a(I,M);if(j>=0){if(j>y)return{openTag:-1,tail:""};I=j-1;continue}l(I,M)}if(M.openTag<0)return{openTag:-1,tail:""};let B="",D=M.openTag+1;for(let I=D;I<Math.min(y,A);I++){if(!e.startsWith("{{",I))continue;let j=ve(e,I);B+=e.slice(D,I)+"x",I=j+1,D=j+2}return B+=e.slice(D,y),{openTag:M.openTag,tail:B}}}}function sa(e,t,i){if(t<0&&!i)return null;if(t>=0&&/^\s*[!/?]/.test(e))return/^\s*\/?\s*$/.test(e)?{kind:"tag-name"}:null;if(t>=0&&/^\s*$/.test(e))return{kind:"tag-name"};let n=0;if(t>=0)while(n<e.length&&!/\s/.test(e[n]))n++;while(n<e.length){while(/\s/.test(e[n]??"")&&n<e.length)n++;let c=n;while(n<e.length&&!/[\s=/>]/.test(e[n]))n++;let l=e.slice(c,n);if(!l)break;while(n<e.length&&/\s/.test(e[n]))n++;if(e[n]!=="=")continue;n++;while(n<e.length&&/\s/.test(e[n]))n++;let a=e[n];if(a==='"'||a==="'"){let y=++n,v=e.indexOf(a,n);if(v===-1)return{kind:"attribute",name:l,quote:a,valuePrefix:e.slice(y)};n=v+1}else{let y=n;while(n<e.length&&!/\s/.test(e[n]))n++;if(n===e.length)return{kind:"attribute",name:l,quote:null,valuePrefix:e.slice(y)}}}return{kind:"tag"}}class oe extends Error{attribute;near;constructor(e,t){super(`Unsafe interpolation in ${e}: ${t}`);this.name="UnsafeInterpolationContextError",this.attribute=e}locate(e,t){if(this.near===void 0)this.near=e.slice(Math.max(0,t-160),t).replace(/\s+/g," ").trim(),this.message+=` (after: ${JSON.stringify(this.near)})`;return this}}var Gr="unsafe:";var ra=/^(?:javascript|vbscript|livescript|mocha|view-source):/,ia=/^data:(?:text\/html|text\/xml|application\/xhtml\+xml|application\/xml|image\/svg\+xml)/,oa=/^data:(?:text\/html|application\/xhtml\+xml)/,ca=new RegExp("[\\u0000-\\u0020\\u00A0\\u1680\\u2000-\\u200F\\u2028\\u2029\\u202F\\u205F\\u3000\\uFEFF]+","g");function aa(e){return e.replace(ca,"").toLowerCase()}function bs(e){let t=e.toLowerCase();if(new RegExp("^(?:href|xlink:href|action|formaction|ping|cite|manifest|data|to)$").test(t))return"navigable";if(new RegExp("^(?:src|srcset|poster|background)$").test(t))return"fetched";return null}function Nn(e,t="navigable"){let i=aa(e);if(ra.test(i))return!0;return t==="navigable"?ia.test(i):oa.test(i)}function wr(e,t="navigable"){return Nn(e,t)?"unsafe:"+e:e}function la(e){let t=e.match(/(?:^|[\s"'`/])([A-Za-z][\w:-]*)\s*=\s*(["'])([^"']*)$/);if(!t)return null;if(t[3].trim()!=="")return null;return bs(t[1])}function Yr(e,t,i=256){if(t<=i)return e.slice(0,t);let n=e.slice(t-i,t),c=n.search(/[\s"'`/]/);return c===-1?"":n.slice(c)}function Qr(e,t,i=t){let n=la(e);return n&&Nn(t,n)?"unsafe:"+i:i}function At(e){let t=e.indexOf(" as ");if(t!==-1){let l=e.slice(0,t).trim(),a=e.slice(t+4).trim();return l&&a?{arrayExpr:l,itemVar:a}:null}let i=/^\s*(.+?)\s+in\s+([\s\S]+)$/.exec(e);if(!i)return null;let n=i[1].trim().replace(/^\(([\s\S]*)\)$/,"$1").trim(),c=i[2].trim();return n&&c?{arrayExpr:c,itemVar:n}:null}function Ln(e){let t=[],i=0,n="",c=0;for(let l=0;l<e.length;l++){let a=e[l];if(n){if(a==="\\")l++;else if(a===n)n="";continue}if(a==="'"||a==='"'||a==="`")n=a;else if(a==="("||a==="["||a==="{")i++;else if(a===")"||a==="]"||a==="}")i--;else if(a===","&&i===0)t.push(e.slice(c,l)),c=l+1}return t.push(e.slice(c)),t}function ei(e,t){let i=0;for(let n=0;n<e.length;n++){let c=e[n];if(c==="("||c==="["||c==="{")i++;else if(c===")"||c==="]"||c==="}")i--;else if(c===t&&i===0)return n}return-1}function ti(e){let t=0;for(let i=0;i<e.length;i++){let n=e[i];if(n==="("||n==="["||n==="{")t++;else if((n===")"||n==="]"||n==="}")&&--t===0)return i}return-1}function xt(e,t){let i=e.trim().replace(/^\.\.\./,"").trim(),n=ei(i,"=");if(n!==-1&&i[n+1]!==">")i=i.slice(0,n).trim();if(!i)return;if(i.startsWith("{")&&i.endsWith("}")){for(let c of Ln(i.slice(1,-1))){let l=c.trim();if(!l)continue;if(l.startsWith("...")){xt(l,t);continue}let a=ei(l,":");xt(a===-1?l:l.slice(a+1),t)}return}if(i.startsWith("[")&&i.endsWith("]")){for(let c of Ln(i.slice(1,-1)))xt(c,t);return}if(/^[A-Z_$][\w$]*$/i.test(i))t.push(i)}function J(e){let t=e.trim(),i=[],n=0;for(let l=0;l<t.length;l++){let a=t[l];if(a==="("||a==="["||a==="{")n++;else if(a===")"||a==="]"||a==="}")n--;else if(n===0&&/\s/.test(a)){if(!/^\s+(?:in|of)\s/.exec(t.slice(l)))continue;let v=t.slice(0,l).trim();if(v.startsWith("(")&&ti(v)===v.length-1)v=v.slice(1,-1);for(let E of Ln(v))xt(E,i);if(i.length>0)return i;break}}let c=/^[\s\S]+?\s+as\s+([\s\S]+)$/.exec(t);if(c){let l=c[1].trim();if(l.startsWith("(")&&ti(l)===l.length-1)l=l.slice(1,-1);let a=/^([\w$]+)\s*=>\s*([\s\S]+)$/.exec(l);if(a)xt(a[2],i),xt(a[1],i);else for(let y of Ln(l))xt(y,i)}return i}function O(e,t){let i=t instanceof Set?t:new Set(t);if(i.size===0)return!1;let a=e.replace(/'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"/g," ").replace(/`(?:[^`\\$]|\\.|\$(?!\{))*`/g," ").replace(/\??\.\s*[a-zA-Z_$][\w$]*/g," ").replace(/([{,]\s*)[a-zA-Z_$][\w$]*(\s*:(?!:))/g,"$1$2");for(let y of a.match(/[a-zA-Z_$][\w$]*/g)||[])if(i.has(y))return!0;return!1}var Bn="__stx_client_loop_names";function rt(e){let t=e?.[Bn];return Array.isArray(t)?t:[]}function Wn(e){if(!e.includes("#")&&!e.includes("v-slot:")&&!e.includes("data-stx-slot-binding"))return[];let t=[],i=[],n=/<!--[\s\S]*?-->|<script\b(?:"[^"]*"|'[^']*'|[^'">])*>[\s\S]*?<\/script\s*>|<style\b(?:"[^"]*"|'[^']*'|[^'">])*>[\s\S]*?<\/style\s*>|<\/?[a-z][\w:-]*\b(?:"[^"]*"|'[^']*'|[^'">])*>/gi;for(let c of e.matchAll(n)){let l=c[0];if(/^<\/template\s*>$/i.test(l)){let a=i.pop();if(a)a.end=c.index}else if(/^<template\b/i.test(l)&&!/\/\s*>$/.test(l)){let y=[...l.slice(9).matchAll(/([^\s=/>]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+)))?/g)].find((A)=>/^(?:#[\w-]+|v-slot:[\w-]+|data-stx-slot-binding)$/i.test(A[1])),v=(y?.[2]??y?.[3])?.trim();if(v&&y?.[1]==="data-stx-slot-binding")try{v=decodeURIComponent(v)}catch{v=void 0}let E=v?{start:c.index+l.length,end:e.length,binding:v}:void 0;if(i.push(E),E)t.push(E)}}return t}var Jt={},si=new Map;function ua(e){let t=si.get(e);if(!t){let i=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");t=new RegExp(`:${i}(?!\\w)`,"g"),si.set(e,t)}return t.lastIndex=0,t}var Us={uppercase:(e,t)=>e!==void 0&&e!==null?String(e).toUpperCase():"",lowercase:(e,t)=>e!==void 0&&e!==null?String(e).toLowerCase():"",capitalize:(e,t)=>{if(e===void 0||e===null)return"";let i=String(e);return i.charAt(0).toUpperCase()+i.slice(1)},number:(e,t,i=0)=>{if(e===void 0||e===null)return"";try{let n=Number(e);return Number.isNaN(n)?"":n.toFixed(Number.parseInt(String(i),10))}catch{return""}},fmt:(e,t,i="en-US")=>{if(e===void 0||e===null)return"";try{let n=Number(e);if(Number.isNaN(n))return String(e);return n.toLocaleString(i)}catch{return String(e)}},join:(e,t,i=",")=>{if(!Array.isArray(e))return"";return e.join(String(i))},escape:(e,t)=>{if(e===void 0||e===null)return"";return U(String(e))},translate:(e,t,i={})=>{if(!t||!t.__translations)return e;let n=t.__translations,c=t.__i18nConfig?.fallbackToKey??!0,l=String(e).split("."),a=n;for(let v of l){if(a===void 0||a===null)break;a=a[v]}if(a===void 0||a===null)return c?e:"";let y=String(a);return Object.entries(i).forEach(([v,E])=>{y=y.replace(ua(v),()=>String(E))}),y},t:(e,t,i={})=>Us.translate(e,t,i),truncate:(e,t,i=50,n="...")=>{if(e===void 0||e===null)return"";let c=String(e);if(c.length<=i)return c;if(i<=n.length)return n.substring(0,i);return c.substring(0,i-n.length)+n},date:(e,t,i="short",n="en-US")=>{if(e===void 0||e===null)return"";try{let c=e instanceof Date?e:new Date(e);if(Number.isNaN(c.getTime()))return String(e);let l={short:{dateStyle:"short"},medium:{dateStyle:"medium"},long:{dateStyle:"long"},full:{dateStyle:"full"},time:{timeStyle:"short"},datetime:{dateStyle:"short",timeStyle:"short"},iso:{}};if(i==="iso")return c.toISOString();return new Intl.DateTimeFormat(n,l[i]||l.short).format(c)}catch{return String(e)}},currency:(e,t,i="USD",n="en-US")=>{if(e===void 0||e===null)return"";try{let c=Number(e);if(Number.isNaN(c))return String(e);return new Intl.NumberFormat(n,{style:"currency",currency:i}).format(c)}catch{return String(e)}},pluralize:(e,t,i,n)=>{let c=Number(e);if(Number.isNaN(c))return i;let l=n||`${i}s`;return c===1?i:l},first:(e,t)=>{if(e===void 0||e===null)return"";if(Array.isArray(e))return e.length===0?"":e[0];return String(e).charAt(0)},last:(e,t)=>{if(e===void 0||e===null)return"";if(Array.isArray(e))return e.length===0?"":e[e.length-1];let i=String(e);return i.charAt(i.length-1)},length:(e,t)=>{if(e===void 0||e===null)return 0;if(Array.isArray(e)||typeof e==="string")return e.length;if(e instanceof Map||e instanceof Set)return e.size;if(typeof e==="object")return Object.keys(e).length;return 0},json:(e,t,i=!1)=>{if(e===void 0)return"undefined";if(e===null)return"null";try{return i?JSON.stringify(e,null,2):JSON.stringify(e)}catch{return String(e)}},default:(e,t,i="")=>e===void 0||e===null||e===""?i:e,reverse:(e,t)=>{if(e===void 0||e===null)return"";if(Array.isArray(e))return[...e].reverse();return String(e).split("").reverse().join("")},slice:(e,t,i=0,n)=>{if(e===void 0||e===null)return"";if(Array.isArray(e)||typeof e==="string")return e.slice(i,n);return e},replace:(e,t,i,n="")=>{if(e===void 0||e===null)return"";let c=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return String(e).replace(new RegExp(c,"g"),()=>n)},stripTags:(e,t)=>{if(e===void 0||e===null)return"";return String(e).replace(/<[^>]*>/g,"")},urlencode:(e,t)=>{if(e===void 0||e===null)return"";return encodeURIComponent(String(e))},abs:(e,t)=>{let i=Number(e);return Number.isNaN(i)?0:Math.abs(i)},round:(e,t,i=0)=>{let n=Number(e);if(Number.isNaN(n))return 0;let c=10**i;return Math.round(n*c)/c}};function gg(e,t){if(e in Us)console.warn(`Filter "${e}" already exists as a built-in filter. Custom filter will take precedence.`);Jt[e]=t}function Gh(e){for(let[t,i]of Object.entries(e))gg(t,i)}function mg(){return{...Us,...Jt}}function Jh(){for(let e of Object.keys(Jt))delete Jt[e]}function Mt(e,t,i=2){let n="{".repeat(i);if(!e.includes(n))return e;let c="",l=0;for(;;){let a=e.indexOf(n,l);if(a===-1)break;let y=ve(e,a,i);if(y===-1)break;c+=e.slice(l,a)+t(e.slice(a,y+i),e.slice(a+i,y),a),l=y+i}return l===0?e:c+e.slice(l)}function fa(e,t,i){let n=i[0];if(n!=="'"&&n!=='"'&&n!=="`")return!1;let c=xr(e,t);if(!c||c.kind!=="attribute"||c.quote===n)return!1;if(!/^(?::|@|x-|v-)/.test(c.name))return!1;let l=0;for(let a=0;a<c.valuePrefix.length;a++)if(c.valuePrefix[a]==="\\")a++;else if(c.valuePrefix[a]===n)l++;return l%2===1}function p(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function U(e){return Jr(p(e))}function pa(e){return e.replace(/ /g," ").replace(/\t/g,"	").replace(/\n/g," ").replace(/\r/g," ").replace(/\f/g,"").replace(/=/g,"=").replace(/`/g,"`")}function da(e){return e.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\\([\dA-Fa-f]{1,6})\s?/g,(t,i)=>String.fromCodePoint(Number.parseInt(i,16))).replace(/\\([^\r\n])/g,"$1").replace(/[\u0000-\u0020]+/g,"").toLowerCase()}function ga(e,t){let i=da(e);if(/@import|expression\(|behavior:|-moz-binding|(?:image-set|cross-fade)\(/.test(i))throw new oe(t,"network-capable or executable CSS is not allowed in an escaped interpolation");let n=/url\(([^)]*)\)/g,c;while((c=n.exec(i))!==null){let l=c[1].replace(/^["']|["']$/g,""),a=l.startsWith("/")&&!l.startsWith("//")||l.startsWith("./")||l.startsWith("../")||l.startsWith("#"),y=/^data:image\/(?:avif|bmp|gif|jpeg|jpg|png|webp);base64,[a-z\d+/=]+$/i.test(l);if(!a&&!y)throw new oe(t,"CSS URLs must be local paths or base64 raster images")}}function Z(e,t,i,n=!1,c=0){try{return ma(e,t,i,n,c)}catch(l){if(l instanceof oe)l.locate(e,t);throw l}}function ma(e,t,i,n,c){let l=xr(e,t,n),a=U(i);if(!l)return a;if(l.kind==="tag-name"){if(!/^[A-Za-z][A-Za-z0-9:-]*$/.test(i))throw new oe("tag name","dynamic tag names may contain only letters, digits, colons, and hyphens");return i}if(l.kind==="tag"){let E=e.slice(t+c).trimStart(),A=i.trim();if(!E.startsWith("=")&&(A===""||/^(?!on)[A-Za-z_:][\w:.-]*(?:\s+(?!on)[A-Za-z_:][\w:.-]*)*$/.test(A)))return A;throw new oe("tag structure","only standalone boolean attributes may be interpolated into tag structure")}let y=l.name.toLowerCase();if(/^on[a-z]/.test(y))throw new oe(l.name,"native event-handler attributes execute JavaScript; use an @event binding instead");if(y==="srcdoc")a=U(a);if(y==="style")ga(i,l.name);if(l.quote===null)a=pa(a);let v=bs(y);if(v&&l.valuePrefix.trim()===""&&Nn(i,v))return Gr+a;return Qr(Yr(e,t),i,a)}function wn(e,t){let i=` ${e}="`;return Z(i,i.length,t,!0)}function Ei(e){return e.flatMap((t)=>{let i=t.match(/^<script\b([^>]*)>([\s\S]*?)<\/script\s*>$/i);return!i||/\bserver\b|\bsrc\s*=/.test(i[1])?[]:[i[2]]})}function Se(e,t){let{scripts:i}=G(e);for(let n of Ei(i)){if(/\b(state|derived|effect|ref|reactive|computed|watch|watchEffect|useModel)\s*(?:<[^>]*>)?\s*\(/.test(n)||Gc.test(n))return!0;if(Nr(n,t))return!0}if(/@(if|for|show)\s*=\s*["'][^"']*\(\s*\)/.test(e))return!0;if(/@for\s*=\s*["'][^"']*\s+(?:in|of)\s+[^"']*\(\s*\)/.test(e))return!0;if(/(?:^|[\s"'])(?::|x-)(?:for|if|else-if|else|show|text|html|model|bind)\b/.test(e))return!0;return!1}function hg(e){let t=[],i=/<([a-zA-Z][\w-]*)\b[^>]*?\s(?::for|x-for|@for)\s*=\s*(["'])([\s\S]*?)\2[^>]*>/g;for(let n=i.exec(e);n;n=i.exec(e)){let c=n[1].toLowerCase(),l=new Set(J(n[3]));if(l.size===0)continue;let a=n.index+n[0].length;if(n[0].endsWith("/>")){t.push({start:n.index,end:a,names:l});continue}let y=new RegExp(`<(/?)${c}\\b[^>]*?(/?)>`,"gi");y.lastIndex=a;let v=1,E=e.length;for(let A=y.exec(e);A;A=y.exec(e)){if(A[2]==="/")continue;if(v+=A[1]==="/"?-1:1,v===0){E=A.index+A[0].length;break}}t.push({start:n.index,end:E,names:l})}return t}function ri(e,t,i){let n=r(i);for(let c of e){if(t<c.start||t>=c.end)continue;for(let l of c.names)if(new RegExp(`(?<![.#\\w$])${l.replace(/\$/g,"\\$")}(?![\\w$])`).test(n))return!0}return!1}function _i(e,t){let i=["parseInt","parseFloat","String","Number","Boolean","Array","Object","JSON","Math","Date","URL","URLSearchParams","Intl","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","true","false","null","undefined","NaN","Infinity","isNaN","isFinite","window","document","console","new","typeof","instanceof","in","void"],n=e.replace(/'[^']*'/g,"").replace(/"[^"]*"/g,""),c="",l=!1,a=0;for(let E=0;E<n.length;E++){let A=n[E];if(!l&&A==="`"){l=!0,a=0;continue}if(l){if(A==="`"&&a===0){l=!1;continue}if(A==="$"&&n[E+1]==="{"){a++,E++,c+=" ";continue}if(A==="}"&&a>0){a--;continue}if(a>0){c+=A;continue}continue}c+=A}n=c;let y=/(?<![a-zA-Z0-9_$])([a-zA-Z_$][a-zA-Z0-9_$]*)/g,v;while((v=y.exec(n))!==null){let E=v[1];if(!n.substring(0,v.index).trimEnd().endsWith(".")){if(!i.includes(E)&&!(E in t))return!1}}return!0}function ha(e,t){let i=r(e);for(let n of i.matchAll(/(?<![.\w$])([A-Z_$][\w$]*)\s*\(/gi))if(typeof t[n[1]]==="function")return!0;return!1}function xa(e,t){let i=t.__stx_serverDeclared;if(!i||i.size===0)return!1;let n=r(e);for(let c of i)if(new RegExp(`(?<![.#\\w$])${c}(?![\\w$])`).test(n))return!0;return!1}var Si=new Set;function $i(e){return/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*$/.test(e.trim())}function ba(e,t,i){let n=i[0];if(n!=="'"&&n!=='"'&&n!=="`")return!1;let c=0;for(let l=e.lastIndexOf(`
|
|
217
|
+
`,t-1)+1;l<t;l++)if(e[l]==="\\")l++;else if(e[l]===n)c++;return c%2===1}function vi(e,t){let i=`${t??"<unknown>"}\x00${e}`;if(process.env.STX_DEBUG||!Si.has(i))Si.add(i),console.warn(`[stx] {{ ${e} }} in a <script> in ${t??"<unknown>"} has no server value, so it was emitted as undefined. A mustache left in JavaScript is a SyntaxError that takes the whole script down, so give the value a default in <script server>.`);return"undefined"}function wi(e,t,i){let n=e;return n=n.replace(/\{!!([\s\S]*?)!!\}/g,(c,l)=>{try{let a=T(l,t);if(a===void 0)return $i(l)?vi(l.trim(),i):c;return a===null?"":String(a)}catch{return c}}),n=Mt(n,(c,l,a)=>{let y=l.trim();if(ba(n,a,l))return c;if(/^__[A-Z_]+__$/.test(y))return c;try{let v=T(l,t);if(v===void 0)return $i(y)?vi(y,i):c;return JSON.stringify(v).replace(/</g,"\\u003c").replace(/@/g,"\\u0040").replace(/\{{2,}/g,(E)=>"\\u007b".repeat(E.length)).replace(/\{(?=!)/g,"\\u007b")}catch{return c}}),n}function yg(e,t){if(!e.includes("{"))return e;let i=e;return i=i.replace(/\{!!([\s\S]*?)!!\}/g,(n,c)=>{try{let l=T(c,t);if(l===void 0)return n;return l===null?"":String(l)}catch{return n}}),i=Mt(i,(n,c,l)=>{let a=c.trim();if(/^__[A-Z_]+__$/.test(a))return n;try{let y=T(c,t);if(y===void 0)return n;if(y===null)return"";let v=String(y);return Z(i,l,v,!0,n.length)}catch(y){if(y instanceof oe)throw y;return n}}),i}function Yh(e,t,i={}){let{output:n,scripts:c}=G(e),l=c.map((a)=>{let y=a.match(/^<script\b((?:[^>\"']|\"[^\"]*\"|'[^']*')*)>/i),v=a.search(/<\/script\s*>$/i);if(!y||v===-1)return a;let E=y[1],A=a.slice(y[0].length,v);if(/\bdata-raw\b/.test(E))return a;if(i.skipServer&&/\bserver\b/.test(E))return a;let B=`<script${yg(E,t)}>`;if(/\bsrc\s*=/.test(E)||/\btype\s*=\s*["']application\/json["']/.test(E))return B+A+a.slice(v);return B+wi(A,t)+a.slice(v)});return vr(n,l)}function _(e,t,i){let n=e,c=(I,j)=>{let Q=pn(I,j);if(Q===-1)return-1;return/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(I.slice(j,Q))?-1:Q},l=(I,j,Q,X)=>{let z=Q.length,{output:L,tokens:ee}=pe(I,j,(te,re)=>X(z+re));return Q.push(...ee),L},a=[];n=l(n,c,a,(I)=>`<!--__STX_STYLE_${I}__-->`);let y=[];n=l(n,W,y,(I)=>`<!--__STX_SCRIPT_EXPR_${I}__-->`);let v=t?.__stx_signals_gate===!0||Se(e),E=new Set([...Array.isArray(t?.__stx_client_signal_names)?t.__stx_client_signal_names:[],...yi(Ei(y))]),A=new Set(Array.isArray(t?.__stx_preserved_client_expressions)?t.__stx_preserved_client_expressions:[]);n=Mt(n,(I,j,Q)=>{if(O(j,E))return I;try{let X=T(j,t,!1,(z)=>ys(z,I,i,e));return X!==void 0&&X!==null?String(X):""}catch(X){let z=X instanceof Error?X.message:String(X);return h("Expression",`Error evaluating: {{{ ${j.trim()}}}}: ${z}`,i,e,Q,I)}},3),n=n.replace(/\{!!([\s\S]*?)!!\}/g,(I,j,Q)=>{if(O(j,E))return I;try{let X=T(j,t,!1,(z)=>ys(z,I,i,e));if(X===void 0&&t.__stx_buildMode==="compile")return Mn("raw",j.trim());return X!==void 0&&X!==null?String(X):""}catch(X){if(t.__stx_buildMode==="compile")return Mn("raw",j.trim());let z=X instanceof Error?X.message:String(X);return h("Expression",`Error evaluating: {!! ${j.trim()} !!}: ${z}`,i,e,Q,I)}}),n=l(n,W,y,(I)=>`<!--__STX_SCRIPT_EXPR_${I}__-->`),n=l(n,c,a,(I)=>`<!--__STX_STYLE_${I}__-->`);let M=v?hg(n):[],B=Wn(n).map((I)=>({...I,names:new Set(J(`${I.binding} in __slot`))})),D=new Set(rt(t));if(n=Mt(n,(I,j,Q)=>{let X=j.trim();if(fa(n,Q,j))return I;if(ri(B,Q,X))return I;if(O(X,D))return I;if(M.length>0&&ri(M,Q,X))return I;if(A.has(X))return I;let z=["parseInt","parseFloat","String","Number","Boolean","Array","Object","JSON","Math","Date","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","true","false","null","undefined"],L=/^([a-zA-Z_$][a-zA-Z0-9_$]*)/,te=X.match(L)?.[1],re=te&&((te in t)||z.includes(te)),me=/^([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/,he=X.match(me),le=he&&!z.includes(he[1])&&!(he[1]in t);if(/^__[A-Z_]+__$/.test(X))return"";if(O(X,E))return I;if(t.__stx_native_screen===!0&&ha(X,t))return I;let ke;try{let Re=T(j,t,!1,(Xe)=>{ke=Xe});if(v&&!_i(X,t))return I;if(ke)ys(ke,I,i,e);if(t.__stx_buildMode==="compile"&&!v&&(Re===void 0||xa(X,t)))return Mn("expr",X);if(Re===void 0||Re===null)return"";let He=String(Re);return Z(n,Q,He,!1,I.length)}catch(Re){if(Re instanceof oe)throw Re;if(v&&!_i(X,t))return I;if(le)return I;let He=Re instanceof Error?Re.message:String(Re);return h("Expression",`Error evaluating: {{ ${X} }}: ${He}`,i,e,Q,I)}}),y.length>0)n=n.replace(/<!--__STX_SCRIPT_EXPR_(\d+)__-->/g,(I,j)=>y[Number(j)]??I);if(a.length>0)n=n.replace(/<!--__STX_STYLE_(\d+)__-->/g,(I,j)=>a[Number(j)]??I);return n}function bg(e,t,i){if(!t.trim())return e;let n=e,c=t.trim();while(c.length>0){let l=c.match(/^(\w+)/);if(!l)break;let a=l[1];c=c.substring(a.length).trim();let y=Jt[a]||Us[a];if(!y)throw Error(`Filter not found: ${a}. Available filters: ${Object.keys(mg()).join(", ")}`);let v=[];if(c.startsWith(":")){let E=c.match(/^:([^|\s]+)/);if(E){let A=E[1].trim();try{let M=Number(A);v=[Number.isNaN(M)?A:M]}catch{v=[A]}c=c.substring(E[0].length).trim()}}else if(c.startsWith("(")){let E=1,A=1;while(E>0&&A<c.length){if(c[A]==="(")E++;if(c[A]===")")E--;A++}if(E===0){let M=c.substring(1,A-1).trim();if(M)try{if(M.startsWith("{")&&M.endsWith("}"))v=[T(`(${M})`,i,!0)];else{let B=[],D="",I=null,j=0,Q=0,X=0,z=!1;for(let L=0;L<M.length;L++){let ee=M[L];if(z){D+=ee,z=!1;continue}if(ee==="\\"){D+=ee,z=!0;continue}if(I){if(D+=ee,ee===I)I=null;continue}if(ee==='"'||ee==="'"||ee==="`"){I=ee,D+=ee;continue}if(ee==="(")j++;else if(ee===")")j--;else if(ee==="[")Q++;else if(ee==="]")Q--;else if(ee==="{")X++;else if(ee==="}")X--;if(ee===","&&j===0&&Q===0&&X===0){B.push(D),D="";continue}D+=ee}if(D)B.push(D);v=B.map((L)=>{let ee=L.trim();return T(ee,i,!0)})}}catch{v=[M]}c=c.substring(A).trim()}}try{n=y(n,i,...v)}catch(E){let A=E instanceof Error?E.message:String(E);throw Error(`Error applying filter '${a}': ${A}`)}if(c.startsWith("|"))c=c.substring(1).trim();else break}return n}function ya(e){let t=!1,i="",n=0,c=0,l=0,a=!1;for(let y=0;y<e.length;y++){let v=e[y],E=e[y+1];if(t&&a){a=!1;continue}if(t&&v==="\\"){a=!0;continue}if(a=!1,(v==='"'||v==="'"||v==="`")&&!a){if(!t)t=!0,i=v;else if(v===i)t=!1,i="";continue}if(t&&i==="`"&&v==="$"&&E==="{"){let A=1;y+=2;while(y<e.length&&A>0){if(e[y]==="{")A++;else if(e[y]==="}")A--;if(A>0)y++}continue}if(t)continue;if(v==="(")n++;else if(v===")")n--;else if(v==="[")c++;else if(v==="]")c--;else if(v==="{")l++;else if(v==="}")l--;if(v==="|"&&n===0&&c===0&&l===0){if(E==="|"){y++;continue}if(E==="="){y++;continue}return y}}return-1}var Xt=new Set,_a=1000;function Zh(){Xt.clear()}function ys(e,t,i,n){if(!K())return;let c=`${i}\x00${e.expression}`;if(Xt.has(c))return;if(Xt.size>=_a)Xt.clear();Xt.add(c);let l=i,a=n;try{if(i&&ni.existsSync(i))a=ni.readFileSync(i,"utf8")}catch{}let y=a.indexOf(t);if(y>=0)l=`${i}:${a.slice(0,y).split(`
|
|
218
|
+
`).length}`;console.warn(`${l}: stx warning: ${t} rendered as an empty string. The safe evaluator rejected \`${e.expression}\` (${e.rule}). Compute the value in <script server> and interpolate the variable instead.`)}function T(e,t,i=!1,n){try{let c=e.trim(),l=ya(c);if(l>0){let y=c.substring(0,l).trim(),v=c.substring(l+1).trim(),E=T(y,t,!0,n);return bg(E,v,t)}let a=qs(c);if(a!==null){n?.({expression:c,rule:a});return}try{let y=Object.keys(t),v=Object.values(t);return d(c,y)(...v)}catch{return u(c,t)}}catch(c){if(c instanceof ReferenceError){let l=/(\b\w+)\s+is not defined/.exec(c.message);if(l){let a=l[1],y=wa(a,Object.keys(t));if(y&&y!==a)c.message=`${c.message} \u2014 did you mean '${y}'?`}}if(!i)console.error(`Error evaluating expression: ${e}`,c);throw c}}function wa(e,t){let i=null;for(let c of t){if(c===e)continue;let l=Sa(e,c);if(i===null||l<i.dist)i={key:c,dist:l}}if(!i)return null;let n=Math.max(e.length,i.key.length);if(i.dist<=2||i.dist/n<=0.35)return i.key;return null}function Sa(e,t){if(e===t)return 0;if(e.length===0)return t.length;if(t.length===0)return e.length;let[i,n]=e.length<t.length?[e,t]:[t,e],c=Array(i.length+1),l=Array(i.length+1);for(let a=0;a<=i.length;a++)c[a]=a;for(let a=1;a<=n.length;a++){l[0]=a;for(let y=1;y<=i.length;y++){let v=i[y-1]===n[a-1]?0:1;l[y]=Math.min(l[y-1]+1,c[y]+1,c[y-1]+v)}for(let y=0;y<=i.length;y++)c[y]=l[y]}return c[i.length]}function Qh(e){if(!e)return"";return e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/'/g,"'").replace(/&/g,"&")}import $a from"process";function C(e="STX_PUBLIC_"){let t={},i={};for(let[n,c]of Object.entries($a.env)){if(!n.startsWith(e)||c===void 0)continue;t[`import.meta.env.${n}`]=JSON.stringify(c),i[n]=c}return t["import.meta.env"]=JSON.stringify(i),t}function ki(e,t=""){let i=`${e}${t}`,n=0;for(let c=0;c<i.length;c++){let l=i.charCodeAt(c);n=(n<<5)-n+l,n=n&n}return`stx-${Math.abs(n).toString(36)}`}function Ci(e,t,i={}){let{prefix:n="",preserveHost:c=!0,scopeKeyframes:l=!0,scopeCustomProperties:a=!1}=i;if(!e.trim())return"";let y=_s(e),v=[],E=new Map;if(l)for(let A of y){let M=A.selector.match(/@keyframes\s+([a-z_-][a-z0-9_-]*)/i);if(M){let B=M[1],D=`${t}_${B}`;E.set(B,D)}}for(let A of y){let M=Ai(A,t,n,c,E,a);v.push(M)}return v.join(`
|
|
219
219
|
|
|
220
|
-
`)}function
|
|
221
|
-
`)})}else t.push({selector:`@${A} ${
|
|
220
|
+
`)}function _s(e){let t=[],i=e.replace(/\/\*[\s\S]*?\*\//g,""),n=0,c="",l=!1,a="";for(let y=0;y<i.length;y++){let v=i[y];if(v==="@"&&n===0)l=!0;if(v==="{")n++;else if(v==="}"){if(n--,n===0){if(l){a+=v;let E=a.match(/@([a-z-]+)\s*([^{]*)\{([\s\S]*)\}/i);if(E){let[,A,M,B]=E;if(A==="keyframes")t.push({selector:`@keyframes ${M.trim()}`,declarations:B.trim()});else if(A==="media"||A==="supports"||A==="container"){let D=_s(B);t.push({selector:`@${A} ${M.trim()}`,declarations:D.map((I)=>`${I.selector} { ${I.declarations} }`).join(`
|
|
221
|
+
`)})}else t.push({selector:`@${A} ${M.trim()}`,declarations:B.trim()})}a="",l=!1}else if(c.trim()){c+=v;let E=c.match(/([^{]+)\{([^}]*)\}/);if(E)t.push({selector:E[1].trim(),declarations:E[2].trim()});c=""}continue}}if(l)a+=v;else c+=v}return t}function Ai(e,t,i,n,c,l){let{selector:a,declarations:y}=e;if(a.startsWith("@")){if(a.startsWith("@keyframes")){let A=a.replace("@keyframes ","").trim();return`@keyframes ${c.get(A)||A} { ${y} }`}if(a.startsWith("@media")||a.startsWith("@supports")||a.startsWith("@container")){let M=_s(`x { ${y} }`.replace(/x \{ /,"").replace(/ \}$/,"")).map((B)=>Ai(B,t,i,n,c,l)).join(`
|
|
222
222
|
`);return`${a} {
|
|
223
|
-
${
|
|
224
|
-
}`}return`${a} { ${y} }`}let v=$a(a,t,i,n),E=y;for(let[A,D]of c)E=E.replace(new RegExp(`\\b${A}\\b`,"g"),D);if(l)E=E.replace(/--([a-z-]+)/gi,`--${t}-$1`);return`${v} { ${E} }`}function $a(e,t,i,n){let c=e.split(",").map((a)=>a.trim()),l=[];for(let a of c){if(a.startsWith(":host")){if(n)l.push(a);else{let E=a.replace(/:host(\([^)]*\))?/,`.${t}$1`);l.push(E)}continue}if(a.includes("::slotted")){l.push(a);continue}if(a===":root"){l.push(`:root .${t}`);continue}let y=i?`${i} .${t}`:`.${t}`;l.push(`${y} ${a}`);let v=va(a,t);if(v)l.push(i?`${i} ${v}`:v)}return l.join(", ")}function va(e,t){let i=0,n=e.length;for(let v=0;v<e.length;v++){let E=e[v];if(E==="["||E==="(")i++;else if(E==="]"||E===")")i--;else if(i===0&&(E===" "||E===">"||E==="+"||E==="~")){n=v;break}}let c=e.slice(0,n),l=e.slice(n);if(!c)return"";let a=c.length,y=0;for(let v=0;v<c.length;v++){let E=c[v];if(E==="["||E==="(")y++;else if(E==="]"||E===")")y--;else if(i===0&&y===0&&E===":"){a=v;break}}return`${c.slice(0,a)}.${t}${c.slice(a)}${l}`}var Oi=String.raw`(?<![\w-])scoped(?![\w-])`,_s=/<style\s+([^>]*)>/gi,Ti=/<style\s+([^>]*)>([\s\S]*?)<\/style>/gi,Pi=new RegExp(Oi,"i"),Ea=new RegExp(Oi,"gi"),ws=/<style\b[^>]*\bdata-stx-scoped(?:=(?:"[^"]*"|'[^']*'|[^\s>]+))?[^>]*>[\s\S]*?<\/style>\s*/gi;function ka(e){_s.lastIndex=0;let t=_s.exec(e);while(t!==null){if(Pi.test(t[1]))return!0;t=_s.exec(e)}return!1}function pi(e){let t=new Set,i=[];ws.lastIndex=0;let n=ws.exec(e);while(n!==null){let c=n[0].trim();if(t.has(c))i.push({start:n.index,end:n.index+n[0].length});else t.add(c);n=ws.exec(e)}return i}function fn(e){let t=pi(e);if(t.length===0)return e;let i=Array(t.length+1),n=0;for(let c=0;c<t.length;c++){let l=t[c];i[c]=e.slice(n,l.start),n=l.end}return i[t.length]=e.slice(n),i.join("")}function Bs(e,t){if(!ka(e))return{html:e,hasScoped:!1};let i=ki(t),n=`data-v-${i}`,c=e,l=!1;if(Ti.lastIndex=0,c=c.replace(Ti,(a,y,v)=>{if(!Pi.test(y))return a;l=!0;let E=Ra(v,n),A=y.replace(Ea,"").trim(),D=A?` ${A}`:"";return`<style data-stx-scoped="${i}"${D}>${E}</style>`}),!l)return{html:e,hasScoped:!1};return c=Ta(c,n),{html:c,hasScoped:!0}}function Ra(e,t){return Ri(e,"__SCOPE_PLACEHOLDER__",{preserveHost:!1}).replace(/\.(__SCOPE_PLACEHOLDER__) /g,`[${t}] `).replace(/\.(__SCOPE_PLACEHOLDER__)/g,`[${t}]`)}var Ca=(e)=>`\x00stx-scope-mask-${e}\x00`,Ii=/\u0000stx-scope-mask-(\d+)\u0000/g;function Ta(e,t){let i=pe(e,(c,l)=>{let a=W(c,l);return a>l?a:pn(c,l)},(c,l)=>Ca(l)),n=Aa(i.output,t);return Ii.lastIndex=0,n.replace(Ii,(c,l)=>i.tokens[Number(l)])}function Aa(e,t){let i=new Set(["script","style","template","html","head","body","meta","link","title","base","!doctype","!DOCTYPE"]);return e.replace(/<([a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*)?\/?>/g,(n,c,l)=>{if(i.has(c.toLowerCase()))return n;if(n.includes(t))return n;if(c.toLowerCase()==="style"||c.toLowerCase()==="script")return n;if(l)return n.replace(`<${c}${l}`,`<${c} ${t}${l}`);if(n.endsWith("/>"))return`<${c} ${t} />`;return`<${c} ${t}>`})}var Jt=/<\/?template\b[^>]*>/gi,Ia=/(?:^|\s)(?:id\s*=|(?:x-|[@:])(?:for|if|else(?:-if)?)(?=\s|=|$)|#[\w-]+(?:\s*=|\s|$)|v-slot(?::[\w-]+)?(?=\s|=|$)|slot\s*=)/i;function Oa(e){let t=e.replace(/^<template\b/i,"").replace(/>$/,"");return Ia.test(t)}function de(e){Jt.lastIndex=0;let t;while((t=Jt.exec(e))!==null){if(t[0].startsWith("</")||Oa(t[0]))continue;let i=t.index,n=Jt.lastIndex,c=1,l;while((l=Jt.exec(e))!==null)if(l[0].startsWith("</")){if(c--,c===0){let a=l.index;return{start:i,openEnd:n,closeStart:a,end:Jt.lastIndex,content:e.slice(n,a)}}}else c++;return null}return null}function zs(e,t){let i=e,n=/@json\s*\(/g,c;while((c=n.exec(i))!==null){let l=c.index,a=l+c[0].length-1,y=1,v=a+1,E=null,A=!1;while(v<i.length&&y>0){let L=i[v];if(A){A=!1,v++;continue}if(L==="\\"&&E){A=!0,v++;continue}if(E){if(L===E)E=null;v++;continue}if(L==='"'||L==="'"||L==="`"){E=L,v++;continue}if(L==="(")y++;else if(L===")"){if(y--,y===0)break}v++}if(y!==0)break;let D=i.substring(a+1,v).trim(),B=i.substring(l,v+1),M=-1,I=0,j=null,Q=!1;for(let L=0;L<D.length;L++){let ee=D[L];if(Q){Q=!1;continue}if(ee==="\\"&&j){Q=!0;continue}if(j){if(ee===j)j=null;continue}if(ee==='"'||ee==="'"||ee==="`"){j=ee;continue}if(ee==="("||ee==="["||ee==="{")I++;else if(ee===")"||ee==="]"||ee==="}")I--;if(ee===","&&I===0){M=L;break}}let X=M>=0?D.substring(0,M).trim():D,z=M>=0?D.substring(M+1).trim():void 0;try{let L=X.trim(),ee;if(f(L))ee=d(L,Object.keys(t))(...Object.values(t));else ee=void 0;let te;if(z==="true")te=JSON.stringify(ee,null,2);else te=JSON.stringify(ee);let re=te.replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029");i=i.substring(0,l)+re+i.substring(v+1),n.lastIndex=l+re.length}catch(L){F.log(L instanceof Error?L:Error(String(L)),{directive:"@json"},"error"),n.lastIndex=l+B.length}}return i}function Hs(e){return e.replace(/@once\s*([\s\S]*?)@endonce/g,"$1")}function Fc(e){let t=e,i=/@memo\s*\(/g,n,c=[];while((n=i.exec(t))!==null){let l=n.index,a=l+n[0].length,y=1,v=a;while(v<t.length&&y>0){if(t[v]==="(")y++;else if(t[v]===")")y--;v++}if(y!==0)continue;let E=t.slice(a,v-1).trim(),A=v,D=t.slice(A),B=D.indexOf("@endmemo");if(B===-1)continue;let M=D.slice(0,B),I=A+B+8,j=M.match(/^(\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*)/),Q=j?j[0].length:0,X=M.slice(Q),z=M.match(/(\s*)$/),L=z?z[0].length:0,ee=X.slice(0,X.length-L),te=ee.match(/^<([a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*?)?(\/?)>/),re;if(te){let[me,he,le="",ke]=te,Re=`<${he}${le} data-stx-memo="${E}"${ke}>`;re=M.slice(0,Q)+Re+ee.slice(me.length)+M.slice(Q+ee.length)}else re=`${M.slice(0,Q)}<div data-stx-memo="${E}">${ee}</div>${M.slice(Q+ee.length)}`;c.push({start:l,end:I,replacement:re}),i.lastIndex=I}for(let l=c.length-1;l>=0;l--){let a=c[l];t=t.slice(0,a.start)+a.replacement+t.slice(a.end)}return t.replace(/@memo="([^"]*)"/g,'data-stx-memo="$1"')}function fi(e){let t=e.replace(/@ref="([^"]+)"/g,'data-stx-ref="$1"');return t=t.replace(/(<[a-zA-Z][a-zA-Z0-9-]*\b[^>]*?)\sref="([^"]+)"/g,'$1 data-stx-ref="$2"'),t}function Ni(e,t){if(!/\bref\s*=/.test(e))return e;let i=/<\/?([a-zA-Z][\w-]*)\b(?:"[^"]*"|'[^']*'|[^'">])*>/y,n=S(e,(v,E)=>{i.lastIndex=E;let A=i.exec(v);if(!A||/^(?:script|style)$/i.test(A[1]))return-1;return i.lastIndex}),c=[],l=0,a=0,y=[];for(let{start:v,end:E,token:A}of n){let D=/^<\/?([\w-]+)/.exec(A)[1].toLowerCase();if(A.startsWith("</")){let j;while(j=c.pop()){if(j.scoped)l--;if(j.name===D)break}continue}let B=/\sdata-stx-scope\s*=/.test(A),M=/\sdata-stx-ref-caller\s*=\s*(["'])(.*?)\1/.exec(A),I=c.find((j)=>j.scoped)?.scopeId;if(M&&I&&M[2]===I)y.push(e.slice(a,v),A.replace(M[0],` data-stx-ref-caller="${t}"`)),a=E;else if(!l&&!B&&/\s(?:ref|@ref|:ref|x-ref|data-stx-ref)\s*=/.test(A)&&!/\sdata-stx-ref-caller\s*=/.test(A))y.push(e.slice(a,v),A.replace(/\s*\/?>$/,(j)=>` data-stx-ref-caller="${t}"${j}`)),a=E;if(!Li.has(D)&&!/\/>$/.test(A)){let j=/\sdata-stx-scope\s*=\s*(?:"([^"]*)"|'([^']*)')/.exec(A);if(c.push({name:D,scoped:B,scopeId:j?.[1]??j?.[2]}),B)l++}}return y.push(e.slice(a)),y.join("")}var Li=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Bi=/(?:^|\s)x-no-cloak(?:=|\s|\/|>|$)/,Di=/<\/?\s*([a-z][\w-]*)/iy,Pa=/\s/;function Da(e,t){let i=t-1;while(i>=0&&Pa.test(e[i]))i--;return i>=0&&e[i]==="/"}function Ma(e,t){let i=!1,n=!1;for(let c=t;c<e.length;c++){let l=e[c];if(i){if(l==="'")i=!1}else if(n){if(l==='"')n=!1}else if(l==="'")i=!0;else if(l==='"')n=!0;else if(l===">")return c}return-1}function ja(e,t){if(e.indexOf("{",t)===-1||e.indexOf("}",t)===-1)return!1;let i=0,n=t,c=!1,l=!1,a=!1;while(n<e.length){let y=e.indexOf("<",n),v=y===-1?e.length:y;if(v>n){if(i===0)while(n<v){let D=e.indexOf(l?"}":"{",n);if(D===-1||D>=v){if(l)a=!1;else c=!1;break}if(D>n)if(l)a=!1;else c=!1;if(l){if(a)return!0;a=!0}else if(c)l=!0,a=!1;else c=!0;n=D+1}n=v;continue}if(e.startsWith("<!--",n)){let D=e.indexOf("-->",n);n=D===-1?e.length:D+3;continue}let E=Ma(e,n);if(E===-1)break;Di.lastIndex=n;let A=Di.exec(e)?.[1]?.toLowerCase()??"";if(e[n+1]==="/"){if(i===0)break;i--}else if(!Da(e,E)&&!Li.has(A))i++;n=E+1}return!1}var Mi=b(256);function zc(e){if(e.length<1024)return ji(e);let t=x(e),i=Mi.get(t);if(i!==void 0)return i;let n=ji(e);return Mi.set(t,n),n}function ji(e){if(e.length>=32768&&!Ur(e))return e;let i=new RegExp(`<(${"div|span|p|h[1-6]|td|th|li|a|button|label|section|article|header|footer|main|nav|aside|dd|dt|figcaption|summary|caption|blockquote|pre|code|em|strong|small|sub|sup|time|mark|abbr|cite|q|s|u|b|i"})\\b`,"gi"),n="",c=0,l;while((l=i.exec(e))!==null){let a=l.index,y=a+l[0].length,v=!1,E=!1,A=-1;while(y<e.length){let B=e[y];if(v){if(B==="'")v=!1}else if(E){if(B==='"')E=!1}else if(B==="'")v=!0;else if(B==='"')E=!0;else if(B===">"){A=y;break}y++}if(A===-1)continue;let D=e.slice(a,A+1);if(Bi.test(D))continue;if(D.includes("x-cloak"))continue;if(ja(e,A+1))n+=e.slice(c,A)+" x-cloak>",c=A+1}return n+=e.slice(c),n}var Na=/(?:^|\s)(?::else-if|:if|:else|:show|x-else-if|x-if|x-else|x-show|@if|@show)(?:=|\s|\/|>|$)/,La=/<\/script>/gi,Ba=/<\/style>/gi;function Hc(e){let t=/<[a-z][\w-]*/gi,i="",n=0,c;while((c=t.exec(e))!==null){let l=c.index,a=c[0].slice(1).toLowerCase();if(a==="script"||a==="style"){let I=a==="script"?La:Ba;I.lastIndex=l;let j=I.exec(e);if(j!==null)t.lastIndex=j.index+j[0].length;continue}let y=l+c[0].length,v=!1,E=!1,A=-1;while(y<e.length){let I=e[y];if(v){if(I==="'")v=!1}else if(E){if(I==='"')E=!1}else if(I==="'")v=!0;else if(I==='"')E=!0;else if(I===">"){A=y;break}y++}if(A===-1)continue;let D=e.slice(l+c[0].length,A);if(Bi.test(D))continue;if(/(?:^|\s)x-cloak(?:=|\s|\/|>|$)/.test(D))continue;if(!Na.test(D))continue;let B=e[A-1]==="/",M=B?A-1:A;i+=`${e.slice(n,M)} x-cloak${B?" ":""}`,n=M}return i+=e.slice(n),i}import Qi from"path";import $s from"fs";import Gt from"path";function Wi(e,t,i,n){let c=0;for(let l=t;l<e.length;l++)if(e[l]===i)c++;else if(e[l]===n&&!(n===">"&&e[l-1]==="=")){if(--c===0)return l}return-1}function Wa(e){let t=r(e),i=0,n=0,c=[];for(let l=0;l<t.length;l++)if("([{".includes(t[l]))i++;else if(")]}".includes(t[l]))i--;else if(t[l]===","&&i===0)c.push(e.slice(n,l).trim()),n=l+1;return c.push(e.slice(n).trim()),c}function Ss(e,t){let i=r(e),n=new RegExp(`\\b(?:${t.map((c)=>c.replace(/[$]/g,"\\$&")).join("|")})\\s*(?=[<(])`,"g");for(let c of i.matchAll(n)){let l=c.index+c[0].length,a="";if(i[l]==="<"){let v=Wi(i,l,"<",">");if(v<0)continue;a=e.slice(l+1,v),l=v+1;while(/\s/.test(i[l]||"")&&l<i.length)l++}if(i[l]!=="(")continue;let y=Wi(i,l,"(",")");if(y>=0)return{type:a,args:Wa(e.slice(l+1,y))}}return null}var zi=`
|
|
223
|
+
${M}
|
|
224
|
+
}`}return`${a} { ${y} }`}let v=va(a,t,i,n),E=y;for(let[A,M]of c)E=E.replace(new RegExp(`\\b${A}\\b`,"g"),M);if(l)E=E.replace(/--([a-z-]+)/gi,`--${t}-$1`);return`${v} { ${E} }`}function va(e,t,i,n){let c=e.split(",").map((a)=>a.trim()),l=[];for(let a of c){if(a.startsWith(":host")){if(n)l.push(a);else{let E=a.replace(/:host(\([^)]*\))?/,`.${t}$1`);l.push(E)}continue}if(a.includes("::slotted")){l.push(a);continue}if(a===":root"){l.push(`:root .${t}`);continue}let y=i?`${i} .${t}`:`.${t}`;l.push(`${y} ${a}`);let v=Ea(a,t);if(v)l.push(i?`${i} ${v}`:v)}return l.join(", ")}function Ea(e,t){let i=0,n=e.length;for(let v=0;v<e.length;v++){let E=e[v];if(E==="["||E==="(")i++;else if(E==="]"||E===")")i--;else if(i===0&&(E===" "||E===">"||E==="+"||E==="~")){n=v;break}}let c=e.slice(0,n),l=e.slice(n);if(!c)return"";let a=c.length,y=0;for(let v=0;v<c.length;v++){let E=c[v];if(E==="["||E==="(")y++;else if(E==="]"||E===")")y--;else if(i===0&&y===0&&E===":"){a=v;break}}return`${c.slice(0,a)}.${t}${c.slice(a)}${l}`}var Oi=String.raw`(?<![\w-])scoped(?![\w-])`,ws=/<style\s+([^>]*)>/gi,Ti=/<style\s+([^>]*)>([\s\S]*?)<\/style>/gi,Pi=new RegExp(Oi,"i"),ka=new RegExp(Oi,"gi"),Ss=/<style\b[^>]*\bdata-stx-scoped(?:=(?:"[^"]*"|'[^']*'|[^\s>]+))?[^>]*>[\s\S]*?<\/style>\s*/gi;function Ra(e){ws.lastIndex=0;let t=ws.exec(e);while(t!==null){if(Pi.test(t[1]))return!0;t=ws.exec(e)}return!1}function pi(e){let t=new Set,i=[];Ss.lastIndex=0;let n=Ss.exec(e);while(n!==null){let c=n[0].trim();if(t.has(c))i.push({start:n.index,end:n.index+n[0].length});else t.add(c);n=Ss.exec(e)}return i}function fn(e){let t=pi(e);if(t.length===0)return e;let i=Array(t.length+1),n=0;for(let c=0;c<t.length;c++){let l=t[c];i[c]=e.slice(n,l.start),n=l.end}return i[t.length]=e.slice(n),i.join("")}function Bs(e,t){if(!Ra(e))return{html:e,hasScoped:!1};let i=ki(t),n=`data-v-${i}`,c=e,l=!1;if(Ti.lastIndex=0,c=c.replace(Ti,(a,y,v)=>{if(!Pi.test(y))return a;l=!0;let E=Ca(v,n),A=y.replace(ka,"").trim(),M=A?` ${A}`:"";return`<style data-stx-scoped="${i}"${M}>${E}</style>`}),!l)return{html:e,hasScoped:!1};return c=Ta(c,n),{html:c,hasScoped:!0}}function Ca(e,t){return Ci(e,"__SCOPE_PLACEHOLDER__",{preserveHost:!1}).replace(/\.(__SCOPE_PLACEHOLDER__) /g,`[${t}] `).replace(/\.(__SCOPE_PLACEHOLDER__)/g,`[${t}]`)}var Aa=(e)=>`\x00stx-scope-mask-${e}\x00`,Ii=/\u0000stx-scope-mask-(\d+)\u0000/g;function Ta(e,t){let i=pe(e,(c,l)=>{let a=W(c,l);return a>l?a:pn(c,l)},(c,l)=>Aa(l)),n=Ia(i.output,t);return Ii.lastIndex=0,n.replace(Ii,(c,l)=>i.tokens[Number(l)])}function Ia(e,t){let i=new Set(["script","style","template","html","head","body","meta","link","title","base","!doctype","!DOCTYPE"]);return e.replace(/<([a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*)?\/?>/g,(n,c,l)=>{if(i.has(c.toLowerCase()))return n;if(n.includes(t))return n;if(c.toLowerCase()==="style"||c.toLowerCase()==="script")return n;if(l)return n.replace(`<${c}${l}`,`<${c} ${t}${l}`);if(n.endsWith("/>"))return`<${c} ${t} />`;return`<${c} ${t}>`})}var Gt=/<\/?template\b[^>]*>/gi,Oa=/(?:^|\s)(?:id\s*=|(?:x-|[@:])(?:for|if|else(?:-if)?)(?=\s|=|$)|#[\w-]+(?:\s*=|\s|$)|v-slot(?::[\w-]+)?(?=\s|=|$)|slot\s*=)/i;function Pa(e){let t=e.replace(/^<template\b/i,"").replace(/>$/,"");return Oa.test(t)}function de(e){Gt.lastIndex=0;let t;while((t=Gt.exec(e))!==null){if(t[0].startsWith("</")||Pa(t[0]))continue;let i=t.index,n=Gt.lastIndex,c=1,l;while((l=Gt.exec(e))!==null)if(l[0].startsWith("</")){if(c--,c===0){let a=l.index;return{start:i,openEnd:n,closeStart:a,end:Gt.lastIndex,content:e.slice(n,a)}}}else c++;return null}return null}function zs(e,t){let i=e,n=/@json\s*\(/g,c;while((c=n.exec(i))!==null){let l=c.index,a=l+c[0].length-1,y=1,v=a+1,E=null,A=!1;while(v<i.length&&y>0){let L=i[v];if(A){A=!1,v++;continue}if(L==="\\"&&E){A=!0,v++;continue}if(E){if(L===E)E=null;v++;continue}if(L==='"'||L==="'"||L==="`"){E=L,v++;continue}if(L==="(")y++;else if(L===")"){if(y--,y===0)break}v++}if(y!==0)break;let M=i.substring(a+1,v).trim(),B=i.substring(l,v+1),D=-1,I=0,j=null,Q=!1;for(let L=0;L<M.length;L++){let ee=M[L];if(Q){Q=!1;continue}if(ee==="\\"&&j){Q=!0;continue}if(j){if(ee===j)j=null;continue}if(ee==='"'||ee==="'"||ee==="`"){j=ee;continue}if(ee==="("||ee==="["||ee==="{")I++;else if(ee===")"||ee==="]"||ee==="}")I--;if(ee===","&&I===0){D=L;break}}let X=D>=0?M.substring(0,D).trim():M,z=D>=0?M.substring(D+1).trim():void 0;try{let L=X.trim(),ee;if(f(L))ee=d(L,Object.keys(t))(...Object.values(t));else ee=void 0;let te;if(z==="true")te=JSON.stringify(ee,null,2);else te=JSON.stringify(ee);let re=te.replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029");i=i.substring(0,l)+re+i.substring(v+1),n.lastIndex=l+re.length}catch(L){F.log(L instanceof Error?L:Error(String(L)),{directive:"@json"},"error"),n.lastIndex=l+B.length}}return i}function Hs(e){return e.replace(/@once\s*([\s\S]*?)@endonce/g,"$1")}function Bc(e){let t=e,i=/@memo\s*\(/g,n,c=[];while((n=i.exec(t))!==null){let l=n.index,a=l+n[0].length,y=1,v=a;while(v<t.length&&y>0){if(t[v]==="(")y++;else if(t[v]===")")y--;v++}if(y!==0)continue;let E=t.slice(a,v-1).trim(),A=v,M=t.slice(A),B=M.indexOf("@endmemo");if(B===-1)continue;let D=M.slice(0,B),I=A+B+8,j=D.match(/^(\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*)/),Q=j?j[0].length:0,X=D.slice(Q),z=D.match(/(\s*)$/),L=z?z[0].length:0,ee=X.slice(0,X.length-L),te=ee.match(/^<([a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*?)?(\/?)>/),re;if(te){let[me,he,le="",ke]=te,Re=`<${he}${le} data-stx-memo="${E}"${ke}>`;re=D.slice(0,Q)+Re+ee.slice(me.length)+D.slice(Q+ee.length)}else re=`${D.slice(0,Q)}<div data-stx-memo="${E}">${ee}</div>${D.slice(Q+ee.length)}`;c.push({start:l,end:I,replacement:re}),i.lastIndex=I}for(let l=c.length-1;l>=0;l--){let a=c[l];t=t.slice(0,a.start)+a.replacement+t.slice(a.end)}return t.replace(/@memo="([^"]*)"/g,'data-stx-memo="$1"')}function fi(e){let t=e.replace(/@ref="([^"]+)"/g,'data-stx-ref="$1"');return t=t.replace(/(<[a-zA-Z][a-zA-Z0-9-]*\b[^>]*?)\sref="([^"]+)"/g,'$1 data-stx-ref="$2"'),t}function Ni(e,t){if(!/\bref\s*=/.test(e))return e;let i=/<\/?([a-zA-Z][\w-]*)\b(?:"[^"]*"|'[^']*'|[^'">])*>/y,n=S(e,(v,E)=>{i.lastIndex=E;let A=i.exec(v);if(!A||/^(?:script|style)$/i.test(A[1]))return-1;return i.lastIndex}),c=[],l=0,a=0,y=[];for(let{start:v,end:E,token:A}of n){let M=/^<\/?([\w-]+)/.exec(A)[1].toLowerCase();if(A.startsWith("</")){let j;while(j=c.pop()){if(j.scoped)l--;if(j.name===M)break}continue}let B=/\sdata-stx-scope\s*=/.test(A),D=/\sdata-stx-ref-caller\s*=\s*(["'])(.*?)\1/.exec(A),I=c.find((j)=>j.scoped)?.scopeId;if(D&&I&&D[2]===I)y.push(e.slice(a,v),A.replace(D[0],` data-stx-ref-caller="${t}"`)),a=E;else if(!l&&!B&&/\s(?:ref|@ref|:ref|x-ref|data-stx-ref)\s*=/.test(A)&&!/\sdata-stx-ref-caller\s*=/.test(A))y.push(e.slice(a,v),A.replace(/\s*\/?>$/,(j)=>` data-stx-ref-caller="${t}"${j}`)),a=E;if(!Li.has(M)&&!/\/>$/.test(A)){let j=/\sdata-stx-scope\s*=\s*(?:"([^"]*)"|'([^']*)')/.exec(A);if(c.push({name:M,scoped:B,scopeId:j?.[1]??j?.[2]}),B)l++}}return y.push(e.slice(a)),y.join("")}var Li=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Bi=/(?:^|\s)x-no-cloak(?:=|\s|\/|>|$)/,Di=/<\/?\s*([a-z][\w-]*)/iy,Da=/\s/;function Ma(e,t){let i=t-1;while(i>=0&&Da.test(e[i]))i--;return i>=0&&e[i]==="/"}function ja(e,t){let i=!1,n=!1;for(let c=t;c<e.length;c++){let l=e[c];if(i){if(l==="'")i=!1}else if(n){if(l==='"')n=!1}else if(l==="'")i=!0;else if(l==='"')n=!0;else if(l===">")return c}return-1}function Na(e,t){if(e.indexOf("{",t)===-1||e.indexOf("}",t)===-1)return!1;let i=0,n=t,c=!1,l=!1,a=!1;while(n<e.length){let y=e.indexOf("<",n),v=y===-1?e.length:y;if(v>n){if(i===0)while(n<v){let M=e.indexOf(l?"}":"{",n);if(M===-1||M>=v){if(l)a=!1;else c=!1;break}if(M>n)if(l)a=!1;else c=!1;if(l){if(a)return!0;a=!0}else if(c)l=!0,a=!1;else c=!0;n=M+1}n=v;continue}if(e.startsWith("<!--",n)){let M=e.indexOf("-->",n);n=M===-1?e.length:M+3;continue}let E=ja(e,n);if(E===-1)break;Di.lastIndex=n;let A=Di.exec(e)?.[1]?.toLowerCase()??"";if(e[n+1]==="/"){if(i===0)break;i--}else if(!Ma(e,E)&&!Li.has(A))i++;n=E+1}return!1}var Mi=b(256);function Fc(e){if(e.length<1024)return ji(e);let t=x(e),i=Mi.get(t);if(i!==void 0)return i;let n=ji(e);return Mi.set(t,n),n}function ji(e){if(e.length>=32768&&!Vr(e))return e;let i=new RegExp(`<(${"div|span|p|h[1-6]|td|th|li|a|button|label|section|article|header|footer|main|nav|aside|dd|dt|figcaption|summary|caption|blockquote|pre|code|em|strong|small|sub|sup|time|mark|abbr|cite|q|s|u|b|i"})\\b`,"gi"),n="",c=0,l;while((l=i.exec(e))!==null){let a=l.index,y=a+l[0].length,v=!1,E=!1,A=-1;while(y<e.length){let B=e[y];if(v){if(B==="'")v=!1}else if(E){if(B==='"')E=!1}else if(B==="'")v=!0;else if(B==='"')E=!0;else if(B===">"){A=y;break}y++}if(A===-1)continue;let M=e.slice(a,A+1);if(Bi.test(M))continue;if(M.includes("x-cloak"))continue;if(Na(e,A+1))n+=e.slice(c,A)+" x-cloak>",c=A+1}return n+=e.slice(c),n}var La=/(?:^|\s)(?::else-if|:if|:else|:show|x-else-if|x-if|x-else|x-show|@if|@show)(?:=|\s|\/|>|$)/,Ba=/<\/script>/gi,Wa=/<\/style>/gi;function zc(e){let t=/<[a-z][\w-]*/gi,i="",n=0,c;while((c=t.exec(e))!==null){let l=c.index,a=c[0].slice(1).toLowerCase();if(a==="script"||a==="style"){let I=a==="script"?Ba:Wa;I.lastIndex=l;let j=I.exec(e);if(j!==null)t.lastIndex=j.index+j[0].length;continue}let y=l+c[0].length,v=!1,E=!1,A=-1;while(y<e.length){let I=e[y];if(v){if(I==="'")v=!1}else if(E){if(I==='"')E=!1}else if(I==="'")v=!0;else if(I==='"')E=!0;else if(I===">"){A=y;break}y++}if(A===-1)continue;let M=e.slice(l+c[0].length,A);if(Bi.test(M))continue;if(/(?:^|\s)x-cloak(?:=|\s|\/|>|$)/.test(M))continue;if(!La.test(M))continue;let B=e[A-1]==="/",D=B?A-1:A;i+=`${e.slice(n,D)} x-cloak${B?" ":""}`,n=D}return i+=e.slice(n),i}import Qi from"path";import vs from"fs";import Yt from"path";function Wi(e,t,i,n){let c=0;for(let l=t;l<e.length;l++)if(e[l]===i)c++;else if(e[l]===n&&!(n===">"&&e[l-1]==="=")){if(--c===0)return l}return-1}function za(e){let t=r(e),i=0,n=0,c=[];for(let l=0;l<t.length;l++)if("([{".includes(t[l]))i++;else if(")]}".includes(t[l]))i--;else if(t[l]===","&&i===0)c.push(e.slice(n,l).trim()),n=l+1;return c.push(e.slice(n).trim()),c}function $s(e,t){let i=r(e),n=new RegExp(`\\b(?:${t.map((c)=>c.replace(/[$]/g,"\\$&")).join("|")})\\s*(?=[<(])`,"g");for(let c of i.matchAll(n)){let l=c.index+c[0].length,a="";if(i[l]==="<"){let v=Wi(i,l,"<",">");if(v<0)continue;a=e.slice(l+1,v),l=v+1;while(/\s/.test(i[l]||"")&&l<i.length)l++}if(i[l]!=="(")continue;let y=Wi(i,l,"(",")");if(y>=0)return{type:a,args:za(e.slice(l+1,y))}}return null}var zi=`
|
|
225
225
|
type __StxCtor<T> = T extends StringConstructor ? string : T extends NumberConstructor ? number : T extends BooleanConstructor ? boolean : T extends ArrayConstructor ? unknown[] : T extends ObjectConstructor ? object : T extends readonly unknown[] ? __StxCtor<T[number]> : T extends abstract new (...args: any[]) => infer V ? V : unknown;
|
|
226
226
|
type __StxWiden<T> = T extends string ? string : T extends number ? number : T extends boolean ? boolean : T;
|
|
227
227
|
type __StxOption<T> = T extends { type: infer C } ? __StxCtor<C> : T extends { default: infer D } ? D extends (...args: any[]) => infer V ? V : __StxWiden<D> : __StxCtor<T>;
|
|
@@ -229,78 +229,78 @@ type __StxRequired<O> = { [K in keyof O]-?: O[K] extends { required: true } ? K
|
|
|
229
229
|
type __StxDefaulted<O> = { [K in keyof O]-?: O[K] extends { default: unknown } ? K : never }[keyof O];
|
|
230
230
|
type __StxOptions<O> = { [K in Exclude<__StxRequired<O>, __StxDefaulted<O>>]: __StxOption<O[K]> } & { [K in Exclude<keyof O, Exclude<__StxRequired<O>, __StxDefaulted<O>>>]?: __StxOption<O[K]> };
|
|
231
231
|
type __StxDefaults<P, K> = Omit<P, Extract<keyof P, K>> & Partial<Pick<P, Extract<keyof P, K>>>;
|
|
232
|
-
`;function Fi(e,t){let i=[],n={defineProps:["defineProps"],defineEmits:["defineEmits"],withDefaults:["withDefaults"]},c=r(e),l=e.replace(/\bimport\s+(?:type\s+)?(\{[^}]*\}|\*\s+as\s+[\w$]+|[\w$]+)\s+from\s*(['"])([^'"]+)\2\s*;?/g,(B,
|
|
233
|
-
`)}),a
|
|
232
|
+
`;function Fi(e,t){let i=[],n={defineProps:["defineProps"],defineEmits:["defineEmits"],withDefaults:["withDefaults"]},c=r(e),l=e.replace(/\bimport\s+(?:type\s+)?(\{[^}]*\}|\*\s+as\s+[\w$]+|[\w$]+)\s+from\s*(['"])([^'"]+)\2\s*;?/g,(B,D,I,j,Q)=>{if(c.slice(Q,Q+6)!=="import")return B;if(j.endsWith(".stx"))return"";let X=`${t}Import${i.length}`;if(i.push(`import * as ${X} from ${JSON.stringify(j)};`),D.startsWith("*"))return`import ${D.replace(/^\*\s+as\s+/,"")} = ${X};`;if(!D.startsWith("{"))return`import ${D} = ${X}.default;`;return D.slice(1,-1).split(",").map((z)=>{let[L,ee=L]=z.trim().replace(/^type\s+/,"").split(/\s+as\s+/);if(!L)return"";if(/^(?:stx|@stacksjs\/stx)(?:\/|$)/.test(j)&&L in n)n[L].push(ee);return`import ${ee} = ${X}.${L};`}).join(`
|
|
233
|
+
`)}),a=$s(e,n.defineProps),y=$s(e,n.defineEmits),v=$s(e,n.withDefaults);if(!a&&!y)return{declarations:"",props:null,events:null};let E=[],A=null,M=null;if(a){E.push(`const __options = (${a.args[0]||"{}"}) as const;`),E.push(`const __defaults = (${v?.args[1]||"{}"});`);let B=a.type||"__StxOptions<typeof __options>";E.push(`export type __StxProps = __StxDefaults<${B}, keyof typeof __defaults | __StxDefaulted<typeof __options>>;`),A=`${t}.__StxProps`}if(y)E.push(`const __events = (${y.args[0]||"[]"}) as const;`),E.push(`export type __StxEvents = ${y.type||"Record<(typeof __events)[number], any[]>"};`),M=`${t}.__StxEvents`;return{declarations:`${i.join(`
|
|
234
234
|
`)}
|
|
235
235
|
namespace ${t} {
|
|
236
236
|
${l}
|
|
237
237
|
${E.join(`
|
|
238
238
|
`)}
|
|
239
|
-
}`,props:A,events:
|
|
239
|
+
}`,props:A,events:M}}var Sr=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","component","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","path","circle","rect","line","polygon","polyline","ellipse","text","tspan","textPath","g","defs","use","symbol","image","clipPath","mask","pattern","marker","linearGradient","radialGradient","stop","filter","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","foreignObject","animate","animateMotion","animateTransform","set","mpath","desc","metadata","switch","view"]);function kr(e){if(e.includes("-")||e==="component")return!1;if(/^[A-Z]/.test(e))return!/[a-z]/.test(e)&&[...Sr].some((t)=>t.toLowerCase()===e.toLowerCase());return Sr.has(e)||/[A-Z]/.test(e)}function*Fa(e){let t=/<([A-Za-z][\w.-]*)(?=[\s/>])/g,i;while(i=t.exec(e)){let n=t.lastIndex,c=[];while(n<e.length){while(/\s/.test(e[n]||""))n++;if(e[n]===">"||e.slice(n,n+2)==="/>"){n+=e[n]===">"?1:2;break}let l=/^[^\s=/>]+/.exec(e.slice(n))?.[0];if(!l){n++;continue}let a=n;n+=l.length;while(/\s/.test(e[n]||""))n++;if(e[n]!=="="){c.push({name:l,value:!0,offset:a,braced:!1});continue}n++;while(/\s/.test(e[n]||""))n++;let y=e[n],v=y==="{",E=y==='"'||y==="'";if(E||v)n++;let A=n;if(v){let M=r(e.slice(n)),B=1,D=0;for(;D<M.length;D++){if(M[D]==="{")B++;if(M[D]==="}"&&--B===0)break}n+=D}else if(E)while(n<e.length&&e[n]!==y)n++;else while(n<e.length&&!/[\s/>]/.test(e[n]))n++;if(c.push({name:l,value:e.slice(A,n),offset:A,braced:v}),E||v)n++}t.lastIndex=n,yield{name:i[1],offset:i.index,attributes:c}}}function Ui(e,t,i){let n=[],c=[zi,"type __StxAssignedValue<T> = T extends { readonly _isSignal: true } | { readonly _isDerived: true } ? T extends () => infer V ? V : T : T;","type __StxProp<P, K> = K extends keyof P ? P[K] : unknown;",'type __StxStaticProp<P, K> = __StxProp<P, K> extends infer T ? boolean extends T ? T | "true" | "false" : T : never;','type __StxEvent<E, K> = K extends keyof E ? E[K] extends readonly unknown[] ? number extends E[K]["length"] ? E[K][0] : Exclude<E[K]["length"], 0 | 1> extends never ? E[K][0] : E[K] : E[K] : any;'],l=new Map,a=new Map,y=new Map,v=i.scriptCode(e,i.filePath),E=r(v);for(let I of v.matchAll(/\bimport\s+(\{[^}]+\}|[\w$]+)\s+from\s*['"]([^'"]+)['"]/g)){if(E.slice(I.index,I.index+6)!=="import")continue;let j=I[2],Q=Yt.isAbsolute(j)||j.startsWith(".")?Yt.resolve(Yt.dirname(i.filePath),j):Ns(j,Yt.dirname(i.filePath));if(!Q)continue;let X=Q.endsWith(".stx")?Q:vs.existsSync(`${Q}.stx`)?`${Q}.stx`:void 0,z=X?null:yr(Q,!1),L=I[1].startsWith("{")?I[1].slice(1,-1).split(","):[I[1]];for(let ee of L){let[te,re=te]=ee.trim().split(/\s+as\s+/),me=X||z?.get(te)||z?.get(te.toLowerCase());if(me)y.set(re,me),y.set(re.toLowerCase(),me),y.set(re.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),me)}}for(let I of t.matchAll(/@import\s*\(([^)]+)\)/g))for(let j of I[1].matchAll(/['"]([^'"]+)['"]/g)){let Q=Ms(j[1],i.filePath,i).find((X)=>vs.statSync(X,{throwIfNoEntry:!1})?.isFile());if(Q)y.set(Yt.basename(j[1]).replace(/\.stx$/,""),Q)}let A={__importedComponents:y},M=new Map,B=(I,j,Q)=>{let X=e.slice(0,I);return{code:j,offset:I,attribute:Q,anchor:!0,kind:"directive",line:X.split(`
|
|
240
240
|
`).length,column:I-X.lastIndexOf(`
|
|
241
|
-
`)}},
|
|
242
|
-
`):"",checks:n,events:l,dependencies:a}}var Vi=/<script(\s[^>]*)?>([\s\S]*?)<\/script>/gi;function
|
|
243
|
-
`,t-1)+1;return t-i+1}function
|
|
244
|
-
`)t[a]=" "},n=[/<script(?:\s[^>]*)?>[\s\S]*?<\/script>/gi,/<style(?:\s[^>]*)?>[\s\S]*?<\/style>/gi,/<!--[\s\S]*?-->/g,/\{\{--[\s\S]*?--\}\}/g,/@verbatim\b[\s\S]*?@endverbatim\b/g];for(let c of n){c.lastIndex=0;let l;while((l=c.exec(e))!==null)i(l.index,l.index+l[0].length)}return t.join("")}function eo(e){let t=0,i="";for(let n=0;n<e.length;n++){let c=e[n];if(i){if(c==="\\"){n++;continue}if(c===i)i="";continue}if(c==='"'||c==="'"||c==="`"){i=c;continue}if(c==="("||c==="["||c==="{"){t++;continue}if(c===")"||c==="]"||c==="}"){t--;continue}if(c==="|"&&t===0){if(e[n+1]==="|"){n++;continue}if(e[n-1]==="|")continue;return e.slice(0,n)}}return e}var to=new Set([":for","x-for","v-for"]),
|
|
241
|
+
`)}},D=(I,j,Q)=>n.push({expression:I,statement:{text:j+I.code+Q,prefixLength:j.length}});for(let I of Fa(t)){if(kr(I.name)||I.name==="component")continue;let j=pr(I.name,i.filePath,i,A);if(!j)continue;let Q=M.get(j);if(!Q){let z;try{z=i.readComponent?i.readComponent(j):vs.readFileSync(j,"utf8")}catch{continue}if(z===void 0)continue;a.set(j,z),Q=Fi(i.scriptCode(z,j),`__StxComponent${M.size}`),M.set(j,Q),c.push(Q.declarations)}let X=[];for(let z of I.attributes){let{name:L,offset:ee}=z,te=z.value===!0?"true":z.value;if(L.startsWith("@")||L.startsWith("v-on:")){if(Q.events&&z.value!==!0)l.set(ee,`__StxEvent<${Q.events}, ${JSON.stringify(L.replace(/^@|^v-on:/,"").split(".")[0])}>`);continue}let re=/^v-model(?::([\w-]+))?(?:\.[\w-]+)*$/.exec(L);if(L.startsWith("v-")&&!L.startsWith("v-bind:")&&!re)continue;if(/^(?:x-|:)(?:if|for|show|key|else)(?:$|[.:-])/.test(L))continue;let me=(re?re[1]||"modelValue":L.replace(/^:|^v-bind:/,"")).replace(/-([a-z])/g,(Re,He)=>He.toUpperCase());if(X.push(me),!Q.props)continue;let he=L.startsWith(":")||L.startsWith("v-bind:")||!!re||z.braced,le=he?te:z.value!==!0?JSON.stringify(te):"true",ke=!he&&z.value!==!0&&(te==="true"||te==="false");D(B(ee,le,L),";void ((",`) satisfies ${ke?"__StxStaticProp":"__StxProp"}<${Q.props}, ${JSON.stringify(me)}>);`)}if(Q.props){let z=[...new Set(X)].map((ee)=>`${JSON.stringify(ee)}: undefined as any`).join(", "),L=B(I.offset,`<${I.name}>`);n.push({expression:L,statement:{text:`;void ({ ${z} } satisfies ${Q.props} & Record<string, unknown>);`,prefixLength:0}})}}return{declarations:M.size?c.join(`
|
|
242
|
+
`):"",checks:n,events:l,dependencies:a}}var Vi=/<script(\s[^>]*)?>([\s\S]*?)<\/script>/gi;function Ua(e){let t=(i)=>i.replace(/[^\n]/g," ");return e.replace(/<!--[\s\S]*?-->/g,t).replace(/\{\{--[\s\S]*?--\}\}/g,t)}function Pt(e){let t=[],i=Ua(e);Vi.lastIndex=0;let n;while((n=Vi.exec(i))!==null){let c=(n[1]||"").trim(),l=(n[0].match(/^<script(?:\s[^>]*)?>/i)?.[0]??"<script>").length,a=(n[0].match(/<\/script\s*>$/i)?.[0]??"</script>").length,y=n.index+l,v=n.index+n[0].length-a,E=e.slice(y,v);if(/\bsrc\s*=/.test(c))continue;let A=c.match(/\btype\s*=\s*["']([^"']+)["']/i);if(A&&!/^(?:module|text\/(?:javascript|typescript))$/i.test(A[1]))continue;let M=/\bserver\b/.test(c)?"server":/\bclient\b/.test(c)?"client":"plain",B=Qt(e,y);t.push({kind:M,code:E,startLine:B,startColumn:en(e,y),offset:y,attrs:c})}return t}function Qt(e,t){let i=1;for(let n=0;n<t&&n<e.length;n++)if(e.charCodeAt(n)===10)i++;return i}function en(e,t){let i=e.lastIndexOf(`
|
|
243
|
+
`,t-1)+1;return t-i+1}function zn(e){let t=e.split(""),i=(c,l)=>{for(let a=c;a<l&&a<t.length;a++)if(t[a]!==`
|
|
244
|
+
`)t[a]=" "},n=[/<script(?:\s[^>]*)?>[\s\S]*?<\/script>/gi,/<style(?:\s[^>]*)?>[\s\S]*?<\/style>/gi,/<!--[\s\S]*?-->/g,/\{\{--[\s\S]*?--\}\}/g,/@verbatim\b[\s\S]*?@endverbatim\b/g];for(let c of n){c.lastIndex=0;let l;while((l=c.exec(e))!==null)i(l.index,l.index+l[0].length)}return t.join("")}function eo(e){let t=0,i="";for(let n=0;n<e.length;n++){let c=e[n];if(i){if(c==="\\"){n++;continue}if(c===i)i="";continue}if(c==='"'||c==="'"||c==="`"){i=c;continue}if(c==="("||c==="["||c==="{"){t++;continue}if(c===")"||c==="]"||c==="}"){t--;continue}if(c==="|"&&t===0){if(e[n+1]==="|"){n++;continue}if(e[n-1]==="|")continue;return e.slice(0,n)}}return e}var to=new Set([":for","x-for","v-for"]),Fn=/(?:^|\s)((?::|x-|v-|@)[\w.:-]+)\s*=\s*(["'])([\s\S]*?)\2/g,Es="__stx_interpolated",Hi="__StxElement",no="__StxTemplateValue",Va=`type ${no}<T> = T extends { readonly _isSignal: true } | { readonly _isDerived: true } ? (T extends () => infer V ? T & V : T) : T`;function Zi(e){return e.replace(/\{\{[\s\S]*?\}\}/g,Es).replace(/\{!![\s\S]*?!!\}/g,Es)}function ci(e,t,i="0"){let n=`__stxScript${i}`;while((e+t).includes(n))n+="_";let c=new Map,l=[],a=[],y=r(e),v=cl(e),E=[],A=0;for(let Q of y.matchAll(/\{\{([\s\S]*?)\}\}|\{!!([\s\S]*?)!!\}/g)){let X=Q.index,z=e.slice(X,X+Q[0].length),L=Q[1]!==void 0,ee=z.slice(L?2:3,L?-2:-3),te=a.length,re=Yi(v,X),me=Yi(v,X+(L?2:3));a.push({code:eo(ee),...me});let he=`${n}_${te}`,le=z.split(`
|
|
245
245
|
`),ke=le[0].length;le[0]=he+" ".repeat(Math.max(0,ke-he.length));for(let Ze=1;Ze<le.length;Ze++)le[Ze]=le[Ze].replace(/[^\r]/g," ");let Re=c.get(re.line)??[],He=Re.at(-1),Xe=re.column+(He?He.generatedEnd-He.sourceEnd:0);Re.push({sourceStart:re.column,sourceEnd:re.column+ke,generatedStart:Xe,generatedEnd:Xe+le[0].length}),c.set(re.line,Re),E.push(e.slice(A,X),le.join(`
|
|
246
|
-
`)),A=X+z.length}E.push(e.slice(A));let
|
|
246
|
+
`)),A=X+z.length}E.push(e.slice(A));let M=E.join("");if(!a.length)return{code:M,columns:c,declarations:l};let{imports:B,body:D}=ro(t),I=[],j=0;for(let Q of B.split(/\n(?=import\b)/)){if(!Q.trim())continue;let X=/^import\s+(?:type\s+)?([\s\S]+?)\s+from\s*(['"][^'"]+['"])/.exec(Q);if(!X){l.push({text:Q});continue}let z=`${n}Module${j++}`;l.push({text:`import * as ${z} from ${X[2]}`});let L=X[1],ee=/\{([\s\S]*?)\}/.exec(L);for(let he of ee?.[1].split(",")??[]){let[le,ke=le]=he.trim().replace(/^type\s+/,"").split(/\s+as\s+/);if(le==="default")I.push(`const ${ke} = ${z}.default; type ${ke} = import(${X[2]}).default`);else if(le)I.push(`import ${ke} = ${z}.${le}`)}let te=L.replace(/\{[\s\S]*?\}/,""),re=/\*\s+as\s+(\w+)/.exec(te);if(re)I.push(`import ${re[1]} = ${z}`);let me=/^\s*([\w$]+)/.exec(te)?.[1];if(me)I.push(`const ${me} = ${z}.default; type ${me} = import(${X[2]}).default`)}l.push({text:`namespace ${n}Scope {
|
|
247
247
|
${I.join(`
|
|
248
248
|
`)}
|
|
249
249
|
export async function read() {
|
|
250
|
-
${js(
|
|
250
|
+
${js(D).replace(/^[ \t]*export[ \t]+(?=(?:const|let|var|function|async|class|interface|type)\b)/gm,"")}
|
|
251
251
|
return {`});for(let[Q,X]of a.entries())l.push({text:`value${Q}: (`}),l.push({text:X.code,origin:{line:X.line,column:X.column}}),l.push({text:"),"});l.push({text:`}
|
|
252
252
|
}
|
|
253
|
-
}`});for(let Q=0;Q<a.length;Q++)l.push({text:`declare var ${n}_${Q}: Awaited<ReturnType<typeof ${n}Scope.read>>['value${Q}']`});return{code:
|
|
254
|
-
`)}function
|
|
253
|
+
}`});for(let Q=0;Q<a.length;Q++)l.push({text:`declare var ${n}_${Q}: Awaited<ReturnType<typeof ${n}Scope.read>>['value${Q}']`});return{code:M,columns:c,declarations:l}}function Ha(e,t){let i=0;for(let n of e){if(t<n.generatedStart)break;if(t<n.generatedEnd)return n.sourceStart+Math.min(t-n.generatedStart,n.sourceEnd-n.sourceStart);i=n.sourceEnd-n.generatedEnd}return t+i}var Za=["foreach","endforeach","forelse","endforelse","for","endfor","while","endwhile","empty","if","elseif","else","endif","unless","endunless","isset","endisset","switch","case","default","endswitch","auth","endauth","guest","endguest","env","endenv","once","endonce","break","continue"],qa=new RegExp(String.raw`^[ \t]*@(?:${Za.join("|")})\b[ \t]*(\([^\n)]*\))?[ \t]*$`,"gm");function js(e){return e.replace(qa,(t)=>t.replace(/[^\n]/g," "))}var qi=new Set(["x-cloak","x-ref","x-transition","x-teleport","v-slot","x-hydrate",":key","x-tooltip","x-tooltip-position"]);function Jf(e){let t=zn(e),i=[],n=/(@?)\{\{([\s\S]*?)\}\}|(@?)\{!!([\s\S]*?)!!\}/g,c;while((c=n.exec(t))!==null){if(c[1]||c[3])continue;let y=c[2]??c[4]??"",v=c[2]!==void 0?2:3,E=eo(y);if(!E.trim())continue;let A=c.index+v+(E.length-E.trimStart().length);i.push({code:E.trim(),line:Qt(t,A),column:en(t,A),offset:A,kind:"interpolation"})}let l=/@(if|elseif|else\s+if|unless)\b\s*\(/g;while((c=l.exec(t))!==null){let a=c.index+c[0].length-1,y=0,v=a;for(;v<t.length;v++){let B=t[v];if(B==="(")y++;else if(B===")"){if(y--,y===0)break}}if(y!==0)continue;let E=t.slice(a+1,v),A=E.trim();if(l.lastIndex=v+1,!A)continue;let M=a+1+(E.length-E.trimStart().length);i.push({code:A,line:Qt(t,M),column:en(t,M),offset:c.index,kind:"condition"})}Fn.lastIndex=0;while((c=Fn.exec(t))!==null){let a=c[1],y=c[3]??"",v=a.replace(/\..*$/,"").replace(/^([^:].*?):.*$/,"$1");if(qi.has(v)||qi.has(a))continue;if(!y.trim())continue;let E=c.index+c[0].indexOf(c[2],c[0].indexOf(a)+a.length)+1;if(to.has(v)){let M=y.match(/\s+(?:in|of)\s+/);if(!M||M.index===void 0)continue;let B=y.slice(M.index+M[0].length),D=M.index+M[0].length+(B.length-B.trimStart().length);i.push({code:Zi(B.trim()),line:Qt(t,E+D),column:en(t,E+D),offset:E+D,kind:"directive",attribute:v});continue}let A=y.length-y.trimStart().length;i.push({code:Zi(y.trim()),line:Qt(t,E+A),column:en(t,E+A),offset:E+A,kind:"directive",attribute:v})}return i.sort((a,y)=>a.line-y.line||a.column-y.column),i}var Ka=2000;function Xa(e,t){let i=0,n=Math.min(e.length,t+Ka);for(let c=t;c<n;c++){let l=e[c];if(l==="(")i++;else if(l===")"){if(i--,i===0)return e.slice(t+1,c)}}return null}function Ja(e){let t=new Map,i=(y,v)=>{let E=y.split(/[,[\]{}()\s]+/).filter(Boolean);for(let A of E){let M=A.replace(/^\.\.\./,"").trim();if(!/^\$?[A-Z_$][\w$]*$/i.test(M))continue;let B=E.length===1?v:void 0,D=t.get(M);if(!D)t.set(M,{name:M,iterable:B});else if(D.iterable!==B)D.iterable=void 0}},n=/^\$?[A-Z_$][\w$]*$/i,c=(y)=>{let v=y.trim();return n.test(v)?v:void 0};for(let y of e.matchAll(/@for(?:each|else)\s*\(/g)){let v=Xa(e,y.index+y[0].length-1);if(v===null)continue;let E=At(v);if(!E)continue;i(E.itemVar.replace(/=>/g," "),c(E.arrayExpr))}for(let y of e.matchAll(/@for\s*\(\s*(?:(?:let|const|var)\s+)?([\w$]+|\[[^\]]*\]|\{[^}]*\})\s+(of|in)\s+([^)]*)/g))i(y[1],y[2]==="of"?c(y[3]):void 0);for(let y of e.matchAll(/@for\s*\(\s*(?:let|const|var)\s+([\w$]+)\s*[=;]/g))i(y[1]);let l=zn(e);Fn.lastIndex=0;let a;while((a=Fn.exec(l))!==null){let y=a[1].replace(/\..*$/,"");if(!to.has(y))continue;let v=a[3].match(/\s+(?:in|of)\s+/);if(!v||v.index===void 0)continue;i(a[3].slice(0,v.index),c(a[3].slice(v.index+v[0].length)))}for(let y of e.matchAll(/@(?:php|js|ts)\b([\s\S]*?)@end(?:php|js|ts)\b/g))for(let v of y[1].matchAll(/\b(?:const|let|var|function|class)\s+([\w$]+)/g))i(v[1]);return[...t.values()].sort((y,v)=>y.name.localeCompare(v.name))}function Me(e){let t=new Set;for(let i of e.matchAll(/^\s*(?:export\s+)?(?:const|let|var)\s+([\w$]+)/gm))t.add(i[1]);for(let i of e.matchAll(/^\s*(?:export\s+)?(?:async\s+)?function\s*\*?\s*([\w$]+)/gm))t.add(i[1]);for(let i of e.matchAll(/^\s*(?:export\s+)?class\s+([\w$]+)/gm))t.add(i[1]);for(let i of e.matchAll(/^\s*(?:export\s+)?(?:const|let|var)\s*[[{]([^\]}]*)[\]}]/gm))for(let n of i[1].split(",")){let c=n.split(":").pop().split("=")[0].replace(/^\.\.\./,"").trim();if(/^[A-Z_$][\w$]*$/i.test(c))t.add(c)}return[...t].sort()}var ks=["params","query","cookies","host","ip","setResponseStatus","setResponseHeader","notFound","request","url","definePageMeta","defineClientPayload","defineStore","props","$props"],Ga={$bool:"declare function $bool(value: unknown, fallback?: boolean): boolean",$num:"declare function $num(value: unknown, fallback?: number): number",$uid:"declare var $uid: string",$native:"declare var $native: boolean"};function Pc(e=new Set){return[...ks.filter((t)=>!e.has(t)).map((t)=>`declare var ${t}: any`),...Object.entries(Ga).filter(([t])=>!e.has(t)).map(([,t])=>t)].join(`
|
|
254
|
+
`)}function Ic(e){return new Set([...e.matchAll(/^declare (?:function|const|let|var)\s+([A-Za-z_$][\w$]*)/gm)].map((t)=>t[1]))}function so(e){let t=/\bdefineClientPayload\s*\(\s*\{([\s\S]*?)\}\s*\)/g,i,n=!1,c=new Set,l=r(e);while((i=t.exec(l))!==null){n=!0;for(let a of Ya(i[1])){let y=a.split(":")[0].trim();if(/^[A-Za-z_$][\w$]*$/.test(y))c.add(y)}}return n?[...c]:null}function Ya(e){let t=[],i=0,n="";for(let c of e){if(c===","&&i===0){t.push(n),n="";continue}if(c==="("||c==="["||c==="{")i++;else if(c===")"||c==="]"||c==="}")i--;n+=c}return t.push(n),t.filter((c)=>c.trim().length>0)}function ro(e){let t=/^[ \t]*import\b[\s\S]*?(?:from\s*['"][^'"]*['"]|['"][^'"]*['"])[ \t]*;?[ \t]*$/gm,i=[],n=e.replace(t,(c)=>(i.push(c.trim()),c.split(`
|
|
255
255
|
`).map(()=>"").join(`
|
|
256
256
|
`)));return{imports:i.join(`
|
|
257
|
-
`),body:n}}function io(e){let t=r(e),i=Array(t.length),n=0;for(let y=0;y<t.length;y++){let v=t[y];if(v==="}"||v===")"||v==="]")n=Math.max(0,n-1);if(i[y]=n,v==="{"||v==="("||v==="[")n++}let c=[],l=/^[ \t]*(?:export[ \t]+)?(interface|type)[ \t]+([A-Za-z_$][\w$]*)/gm,a;while((a=l.exec(t))!==null){if(i[a.index]!==0)continue;let y=a[1],v=a[2],E;if(y==="interface"){let A=t.indexOf("{",a.index);if(A===-1)continue;let
|
|
258
|
-
`&&!/[=|&,<([{]\s*$/.test(t.slice(Math.max(0,
|
|
257
|
+
`),body:n}}function io(e){let t=r(e),i=Array(t.length),n=0;for(let y=0;y<t.length;y++){let v=t[y];if(v==="}"||v===")"||v==="]")n=Math.max(0,n-1);if(i[y]=n,v==="{"||v==="("||v==="[")n++}let c=[],l=/^[ \t]*(?:export[ \t]+)?(interface|type)[ \t]+([A-Za-z_$][\w$]*)/gm,a;while((a=l.exec(t))!==null){if(i[a.index]!==0)continue;let y=a[1],v=a[2],E;if(y==="interface"){let A=t.indexOf("{",a.index);if(A===-1)continue;let M=0;E=-1;for(let B=A;B<t.length;B++)if(t[B]==="{")M++;else if(t[B]==="}"&&--M===0){E=B+1;break}if(E===-1)continue}else{let A=0;E=t.length;for(let M=t.indexOf("=",a.index)+1;M<t.length;M++){let B=t[M];if(B==="{"||B==="["||B==="("||B==="<")A++;else if(B==="}"||B==="]"||B===")"||B===">")A--;else if(A<=0&&(B===";"||B===`
|
|
258
|
+
`&&!/[=|&,<([{]\s*$/.test(t.slice(Math.max(0,M-40),M)))){E=B===";"?M+1:M;break}}}c.push({name:v,text:e.slice(a.index,E).replace(/^[ \t]*export[ \t]+/,"")}),l.lastIndex=E}return c}function Qa(e){return new Set(io(e).map((t)=>t.name))}function Oc(e,t=""){let i=so(e),n=Qa(t),c=io(e).filter((E)=>!n.has(E.name)).map((E)=>E.text);if(!i){let E=Me(e).filter((A)=>!Rt(t,A));if(E.length===0&&c.length===0)return"";return["",`// ${el}`,...c,...E.map((A)=>`declare var ${A}: any`)].join(`
|
|
259
259
|
`)}if(i.length===0)return c.length>0?["",`// ${Ki}`,...c].join(`
|
|
260
260
|
`):"";let{imports:l,body:a}=ro(e),y=a.replace(/^[ \t]*export[ \t]+(?=(?:const|let|var|function|async|class)\b)/gm,""),v=["",`// ${Ki}`];if(l)v.push(l);return v.push(...c),v.push(`async function ${Xi}() {`,y,` return { ${i.join(", ")} }`,"}",`type ${Ji} = Awaited<ReturnType<typeof ${Xi}>>`,...i.map((E)=>`declare var ${E}: ${Ji}[${JSON.stringify(E)}]`)),v.join(`
|
|
261
261
|
`)}function li(e){let i=r(e).split(""),n=0;for(let c=0;c<i.length;c++){let l=i[c];if(l==="{"||l==="("||l==="["){n++;continue}if(l==="}"||l===")"||l==="]"){n=Math.max(0,n-1);continue}if(n>0&&l!==`
|
|
262
|
-
`)i[c]=" "}return Me(i.join(""))}function
|
|
262
|
+
`)i[c]=" "}return Me(i.join(""))}function Nc(e,t){if(so(e)!==null)return[];let i=li(e),n=Ie(t,new Set(i)),c=new Set(k);return i.filter((l)=>{if(c.has(l))return!1;if(Rt(t,l))return!1;return n.has(l)})}var Ki="stx: types for the declared client payload (#1868)",el="stx: untyped bridge names \u2014 declare a defineClientPayload to check these (#1868)",Xi="__stxServerScope",Ji="__StxClientPayload";var Gi=["$env","$user","$slot","$slots","$attrs","$props","$page","$route","$loop","loop","$errors","$csrf","$native","props","slot"];var tl=/^\s*[A-Z_$][\w$]*\s*=[^=]/i;function nl(e){let t=new Map,i=/!|===|!==|==|!=|&&|\|\||<|>|\btypeof\b|\binstanceof\b|\bin\b/;for(let n of e){let c=r(n),{depths:l,balanced:a}=ge(c);if(!a)continue;let y=/^([ \t]*(?:export[ \t]+)?const[ \t]+)([A-Za-z_$][\w$]*)[ \t]*(?::[^=\n]+)?=[ \t]*([^\n]+)$/gm;for(let v of c.matchAll(y)){let E=v.index??0;if(l[E+v[1].length]!==0)continue;let A=v[2],M=E+v[0].length-v[3].length,B=n.slice(M,E+v[0].length).trim().replace(/;$/,"").trim(),D=v[3],I=i.test(D)&&!/\bawait\b|=>|\bfunction\b|[{}]/.test(D)&&!/[,+\-*/%&|?:=]$/.test(B)&&ge(D).balanced;t.set(A,t.has(A)||!I?null:B)}}return new Map([...t].filter((n)=>n[1]!==null))}function oo(e,t,i=0,n=new Set){if(t.size===0||i>=5)return e;let c=r(e),l="",a=0;for(let y of c.matchAll(/[A-Za-z_$][\w$]*/g)){let v=y.index??0,E=y[0],A=t.get(E);if(!A||n.has(E))continue;let M=c.slice(0,v).trimEnd(),B=c.slice(v+E.length).trimStart();if(M.endsWith(".")||/^:(?!:)/.test(B)&&/[{,]$/.test(M))continue;if(v>0&&/[\w$]/.test(c[v-1]))continue;l+=`${e.slice(a,v)}(${oo(A,t,i+1,new Set([...n,E]))})`,a=v+E.length}return l+e.slice(a)}function sl(e,t){let i=/@(if|unless|elseif|else|endif|endunless)\b\s*(\()?/g,n=[],c;while((c=i.exec(e))!==null){if(c.index>t)break;let l=c[1];if(c.index===t){if(l==="elseif"){let y=n[n.length-1];if(y?.current)y.seen.push(y.current);if(y)y.current=null}break}if(l==="endif"||l==="endunless"){n.pop();continue}let a="";if(c[2]==="("){let y=0,v=c.index+c[0].length-1,E=v+1;for(;v<e.length;v++){let A=e[v];if(A==="(")y++;else if(A===")"){if(y--,y===0)break}}a=e.slice(E,v).trim(),i.lastIndex=v+1}if(l==="if")n.push({seen:[],current:a});else if(l==="unless")n.push({seen:[],current:`!(${a})`});else if(l==="elseif"||l==="else"){let y=n[n.length-1];if(!y)continue;if(y.current)y.seen.push(y.current);y.current=l==="elseif"?a:null}}return n.flatMap((l)=>[...l.seen.map((a)=>`!(${a})`),...l.current?[l.current]:[]]).filter(Boolean)}function rl(e){let t=e.code.trim();if(!t)return null;if(e.attribute?.startsWith("@")){if(tl.test(t))return null;let n=";(($event: any): void => { ";return{text:`${n}${t} });`,prefixLength:n.length}}let i=";void ((";return{text:`${i}${t}));`,prefixLength:i.length}}var il=/(\bfrom\s*|\bimport\s*\(\s*|\bimport\s+)(['"])(\.{1,2}\/[^'"\n]*)\2/g;function _r(e,t){if(!t)return e;return e.replace(il,(i,n,c,l)=>{let a=Qi.resolve(t,l).replace(/\\/g,"/");return`${n}${c}${a}${c}`})}function ui(e){return" ".repeat(Math.max(0,(e.startColumn??1)-1))}function ol(e){let t=new Set,i=r(e);for(let n of i.matchAll(/\bimport\s+(?:type\s+)?([\w$*{}\s,]+?)\s+from\b/g)){let c=n[1],l=/\{([^}]*)\}/.exec(c);for(let E of l?.[1].split(",")??[]){let A=E.trim().replace(/^type\s+/,"").split(/\s+as\s+/).pop()?.trim();if(A&&/^[A-Z_$][\w$]*$/i.test(A))t.add(A)}let a=c.replace(/\{[^}]*\}/,""),y=/\*\s*as\s+([A-Z_$][\w$]*)/i.exec(a);if(y)t.add(y[1]);let v=/^\s*([A-Z_$][\w$]*)/i.exec(a);if(v&&v[1]!=="type")t.add(v[1])}return[...t].sort()}function Mc(e,t={}){let i=Pt(e),n=e.split(`
|
|
263
263
|
`),c=Array.from({length:n.length},()=>""),l=new Map,a=new Map,y=[],v=i.filter((I)=>I.kind==="server").map((I)=>I.code).join(`
|
|
264
|
-
`),E=t.filePath&&t.templateExpressions!==!1?Ui(e,
|
|
265
|
-
`)}):void 0,A=new Set,
|
|
266
|
-
`);z.forEach((L,ee)=>{let te=j.startLine-1+ee;if(te<c.length)c[te]=L,A.add(te)}),
|
|
267
|
-
`).entries())if(c.push(X),j)l.set(c.length,Q===0?j:{...j,line:j.line+Q,column:1,prefixLength:0})};for(let I of y)B(I.text,I.origin);if(t.globals!==!1){B("");let I=new Set([...i.flatMap((z)=>Me(z.code)),...i.flatMap((z)=>ol(z.code))]),j=(z)=>{if(!I.has(z))B(`declare var ${z}: any`)};if(t.runtimeGlobals!==!1){if(!I.has("window"))B("declare var window: any");for(let z of k)j(z)}let Q=[...new Set([...
|
|
268
|
-
`))B(j);let I=
|
|
269
|
-
`),lineMap:l,sourceLineCount:n.length,componentDependencies:E?.dependencies,referenced:
|
|
264
|
+
`),E=t.filePath&&t.templateExpressions!==!1?Ui(e,zn(e),{filePath:t.filePath,componentsDir:t.componentsDir,projectRoot:t.projectRoot,readComponent:t.readComponent,scriptCode:(I,j)=>Pt(I).map((Q)=>_r(Q.code,Qi.dirname(j))).join(`
|
|
265
|
+
`)}):void 0,A=new Set,M=[];for(let[I,j]of i.entries()){let Q=ci(ui(j)+j.code,v,String(I));for(let[L,ee]of Q.columns)a.set(j.startLine+L-1,ee);for(let L of Q.declarations)y.push({text:_r(L.text,t.originDir??""),origin:L.origin?{...L.origin,line:L.origin.line+j.startLine-1}:void 0});let X=js(Q.code),z=_r(X,t.originDir??"").split(`
|
|
266
|
+
`);z.forEach((L,ee)=>{let te=j.startLine-1+ee;if(te<c.length)c[te]=L,A.add(te)}),M.push(j.startLine-1+z.length-1)}for(let I of M){let j=c[I]?.trim()===""?I:I+1;if(j<c.length&&c[j].trim()===""&&(j===I||!A.has(j)))c[j]=";"}let B=(I,j)=>{for(let[Q,X]of I.split(`
|
|
267
|
+
`).entries())if(c.push(X),j)l.set(c.length,Q===0?j:{...j,line:j.line+Q,column:1,prefixLength:0})};for(let I of y)B(I.text,I.origin);if(t.globals!==!1){B("");let I=new Set([...i.flatMap((z)=>Me(z.code)),...i.flatMap((z)=>ol(z.code))]),j=(z)=>{if(!I.has(z))B(`declare var ${z}: any`)};if(t.runtimeGlobals!==!1){if(!I.has("window"))B("declare var window: any");for(let z of k)j(z)}let Q=[...new Set([...ks,...xe,...Gi])].filter((z)=>t.runtimeGlobals!==!1||!k.includes(z));if(t.contextScope==="global"){B("declare global {");for(let z of Q)B(` var ${z}: any`);B("}")}else{for(let z of ks)j(z);for(let z of xe)j(z);for(let z of Gi)j(z)}B(`declare var ${Es}: any`);let X=new Set(i.flatMap((z)=>Me(z.code)));B(`type ${Hi}<T> = T extends readonly (infer E)[] ? E : T extends Iterable<infer E2> ? E2 : any`);for(let z of Ja(e)){if(X.has(z.name))continue;let L=z.iterable&&X.has(z.iterable)?`${Hi}<typeof ${z.iterable}>`:"any";B(`declare var ${z.name}: ${L}`)}}if(t.templateExpressions!==!1){if(E?.declarations)for(let j of E.declarations.split(`
|
|
268
|
+
`))B(j);let I=Jf(e).map((j)=>{let Q=E?.events.get(j.offset??-1);if(Q){j.anchor=!0;let X=j.code.trim(),z=/^([\w$]+)\s*=\s*([^=][\s\S]*)$/.exec(X),L=z?`void ((${z[2]}) satisfies __StxAssignedValue<typeof ${z[1]}>)`:/^[\w$]+(?:\.[\w$]+)*$/.test(X)?`${X} satisfies (($event: ${Q}) => unknown)`:X,ee=`;(($event: ${Q}): void => { `;return{expression:j,statement:{text:`${ee}${L} });`,prefixLength:ee.length}}}return{expression:j,statement:rl(j)}}).filter((j)=>j.statement!==null);if(I.push(...E?.checks||[]),I.length>0){let j=zn(e),Q=Wn(j),X=nl(i.map((te)=>te.code)),L=[...new Set(i.flatMap((te)=>Me(te.code)))].filter((te)=>/^[A-Z_$][\w$]*$/i.test(te)),ee=0;if(L.length>0){B(Va);for(let te of L)B(`function __StxRead_${te}() { return ${te} }`),B(`type __StxT_${te} = ${no}<ReturnType<typeof __StxRead_${te}>>`);B(`;((${L.map((te)=>`${te}: __StxT_${te}`).join(", ")}) => {`),ee=1}for(let{expression:te,statement:re}of I){let me=" ".repeat(ee),he=te.offset===void 0?[]:Q.filter((Ze)=>te.offset>=Ze.start&&te.offset<Ze.end),le=he.map((Ze)=>`;((${Ze.binding.replace(/[\r\n]/g," ")}: any) => { `).join(""),ke=" });".repeat(he.length),Re=te.offset===void 0?[]:sl(j,te.offset),He=Re.length>0?`${Re.map((Ze)=>`if (${oo(Ze,X)}) `).join("")}{ `:"",Xe=Re.length>0?" }":"";B(me+le+He+re.text+Xe+ke,{line:te.line,column:te.column,expression:te,prefixLength:re.prefixLength+me.length+le.length+He.length,guardPrefixLength:me.length+le.length+He.length})}if(ee>0)B("});")}}let D=!1;if(t.reference&&c[0]!==void 0&&c[0].trim()==="")c[0]=`/// <reference path=${JSON.stringify(t.reference.replace(/\\/g,"/"))} />`,D=!0;return B("export {}"),{text:c.join(`
|
|
269
|
+
`),lineMap:l,sourceLineCount:n.length,componentDependencies:E?.dependencies,referenced:D,scriptColumns:a}}function cl(e){let t=[0];for(let i=0;i<e.length;i++)if(e.charCodeAt(i)===10)t.push(i+1);return t}function Yi(e,t){let i=0,n=e.length-1;while(i<n){let c=Math.ceil((i+n)/2);if(e[c]<=t)i=c;else n=c-1}return{line:i+1,column:t-e[i]+1}}function Dc(e,t){if(!e.expression)return!1;return e.inGuard===!0||t===2774}function di(e,t,i){let n=e.lineMap.get(t);if(!n)return t<=e.sourceLineCount?{line:t,column:Ha(e.scriptColumns?.get(t)??[],i)}:null;let c=n.expression?.anchor?0:Math.max(0,i-1-(n.prefixLength??0));return{line:n.line,column:n.column+c,expression:n.expression,inGuard:i<=(n.guardPrefixLength??0)}}var Rs=b(256),al=[{pattern:/document\.getElementById\s*\(/g,message:"document.getElementById() is prohibited",suggestion:'Use useRef("name") instead'},{pattern:/document\.querySelector\s*\(/g,message:"document.querySelector() is prohibited",suggestion:'Use useRef("name") instead'},{pattern:/document\.querySelectorAll\s*\(/g,message:"document.querySelectorAll() is prohibited",suggestion:'Use useRef("name") and access children instead'},{pattern:/document\.getElementsBy\w+\s*\(/g,message:"document.getElementsBy*() is prohibited",suggestion:'Use useRef("name") instead'},{pattern:/document\.createElement\s*\(/g,message:"document.createElement() is prohibited",suggestion:"Use template directives or component composition instead"},{pattern:/document\.activeElement(?![A-Za-z])/g,message:"document.activeElement is prohibited",suggestion:"Use useRef() to track focused elements"},{pattern:/document\.title\s*=/g,message:"document.title assignment is prohibited",suggestion:"Use useTitle() from composables"},{pattern:/document\.cookie(?![A-Za-z])/g,message:"document.cookie is prohibited",suggestion:"Use useCookie() from composables"},{pattern:/document\.addEventListener\s*\(/g,message:"document.addEventListener() is prohibited",suggestion:"Use useEventListener() or template @event directives"},{pattern:/window\.location(?![A-Za-z])/g,message:"window.location is prohibited",suggestion:"Use navigate() or useRoute()"},{pattern:/window\.history(?![A-Za-z])/g,message:"window.history is prohibited",suggestion:"Use navigate(), goBack(), goForward()"},{pattern:/window\.addEventListener\s*\(/g,message:"window.addEventListener() is prohibited",suggestion:"Use useEventListener() or @click directives"},{pattern:/(?:\bwindow\.)?localStorage(?![A-Za-z])/g,message:"window.localStorage is prohibited",suggestion:"Use useLocalStorage() from composables \u2014 or, where this must run before first paint and the runtime does not exist yet, the colorMode config for a light/dark theme, or @appearanceBootstrap when there is a second appearance axis"},{pattern:/window\.sessionStorage(?![A-Za-z])/g,message:"window.sessionStorage is prohibited",suggestion:"Use useSessionStorage() from composables"},{pattern:/window\.scrollTo\s*\(/g,message:"window.scrollTo() is prohibited",suggestion:"Use useScroll().scrollTo() from composables"},{pattern:/window\.alert\s*\(/g,message:"window.alert() is prohibited",suggestion:"Use stx modal/dialog APIs instead"},{pattern:/window\.confirm\s*\(/g,message:"window.confirm() is prohibited",suggestion:"Use stx modal/dialog APIs instead"},{pattern:/window\.prompt\s*\(/g,message:"window.prompt() is prohibited",suggestion:"Use stx modal/dialog APIs instead"},{pattern:/(?<!\w)setTimeout\s*\(/g,message:"setTimeout() is prohibited",suggestion:"Use useTimeout() or useDebounce() from composables"},{pattern:/(?<!\w)setInterval\s*\(/g,message:"setInterval() is prohibited",suggestion:"Use useInterval() from composables"},{pattern:/(?<!\w)clearTimeout\s*\(/g,message:"clearTimeout() is prohibited",suggestion:"Use useTimeout().stop() or useDebounce().cancel()"},{pattern:/(?<!\w)clearInterval\s*\(/g,message:"clearInterval() is prohibited",suggestion:"Use useInterval().pause()"},{pattern:/(?<!\w)location\.href\s*=/g,message:"location.href assignment is prohibited",suggestion:"Use navigate() instead"},{pattern:/(?<!\w)location\.assign\s*\(/g,message:"location.assign() is prohibited",suggestion:"Use navigate() instead"},{pattern:/(?<!\w)location\.replace\s*\(/g,message:"location.replace() is prohibited",suggestion:"Use navigate() instead"}],co=/(?:\/\/|\/\*|\{\{--)\s*stx-strict-ignore(-next-line)?([^\n*}]*)/g;function fl(e){let t=Array.from(e,(c)=>c===`
|
|
270
270
|
`?`
|
|
271
271
|
`:" "),i=0,n="";while(i<e.length){let c=e[i],l=e[i+1];if(n){if(c==="\\"){i+=2;continue}if(c===n)n="";i++;continue}if(c==='"'||c==="'"||c==="`"){n=c,i++;continue}if(c==="/"&&l==="/"){while(i<e.length&&e[i]!==`
|
|
272
|
-
`)t[i]=e[i],i++;continue}if(c==="/"&&l==="*"){let a=e.indexOf("*/",i+2),y=a===-1?e.length:a+2;for(;i<y;i++)t[i]=e[i];continue}if(c==="{"&&l==="{"&&e.slice(i,i+4)==="{{--"){let a=e.indexOf("--}}",i+4),y=a===-1?e.length:a+4;for(;i<y;i++)t[i]=e[i];continue}i++}return t.join("")}function
|
|
272
|
+
`)t[i]=e[i],i++;continue}if(c==="/"&&l==="*"){let a=e.indexOf("*/",i+2),y=a===-1?e.length:a+2;for(;i<y;i++)t[i]=e[i];continue}if(c==="{"&&l==="{"&&e.slice(i,i+4)==="{{--"){let a=e.indexOf("--}}",i+4),y=a===-1?e.length:a+4;for(;i<y;i++)t[i]=e[i];continue}i++}return t.join("")}function pl(e){let t=new Map,i=fl(e).split(`
|
|
273
273
|
`),n=e.split(`
|
|
274
|
-
`);return i.forEach((c,l)=>{co.lastIndex=0;for(let a of c.matchAll(co)){let y=a[1]==="-next-line",v=(n[l]??"").slice(0,a.index).trim(),E=y||v===""?l+2:l+1,
|
|
274
|
+
`);return i.forEach((c,l)=>{co.lastIndex=0;for(let a of c.matchAll(co)){let y=a[1]==="-next-line",v=(n[l]??"").slice(0,a.index).trim(),E=y||v===""?l+2:l+1,M=(a[2]??"").split("--")[0].split(/[\s,]+/).filter(Boolean),B=M.filter((I)=>/\w/.test(I));if(M.length>0&&B.length===0)continue;let D=t.get(E);if(D&&D.size===0)continue;if(B.length===0){t.set(E,new Set);continue}if(D)B.forEach((I)=>D.add(I));else t.set(E,new Set(B))}}),t}function dl(e,t,i){let n=e.get(t);if(!n)return!1;if(n.size===0)return!0;return[...n].some((c)=>i.includes(c))}function Oe(e,t,i,n){let c=typeof i==="boolean"?{enabled:i,failOnViolation:i}:i??{enabled:!1};if(!c.enabled)return;let l=x(e,t,n,JSON.stringify(c)),a=Rs.get(l);if(a!==void 0){if(a&&c.failOnViolation)throw new q(a,n??t);return}let y=c.allowPatterns??[],v=pl(e),E=[],A=r(e.replace(/\{\{--[\s\S]*?--\}\}/g,(I)=>I.replace(/[^\n]/g," ")));for(let{pattern:I,message:j,suggestion:Q}of al){if(y.some((z)=>/\w/.test(z)&&j.includes(z)))continue;I.lastIndex=0;let X=A.match(I);if(X&&X.length>0){let z=A.split(`
|
|
275
275
|
`),L=e.split(`
|
|
276
|
-
`),ee=[];if(z.forEach((he,le)=>{if(I.lastIndex=0,I.test(he)&&!
|
|
276
|
+
`),ee=[];if(z.forEach((he,le)=>{if(I.lastIndex=0,I.test(he)&&!dl(v,le+1,j))ee.push(le+1)}),ee.length===0&&z.some((he)=>(I.lastIndex=0,I.test(he))))continue;let te=ee.length>0?` (script line${ee.length>1?"s":""} ${ee.join(", ")})`:"",re=ee.slice(0,3).map((he)=>` ${he} | ${(L[he-1]??"").trim().slice(0,100)}`).join(`
|
|
277
277
|
`),me=re?`
|
|
278
278
|
${re}`:"";E.push(` \u2717 ${j}${te}
|
|
279
|
-
\u2192 ${Q}${me}`)}}if(E.length===0){
|
|
279
|
+
\u2192 ${Q}${me}`)}}if(E.length===0){Rs.set(l,"");return}let M=(I)=>{let j=`${process.cwd()}/`;return I.startsWith(j)?I.slice(j.length):I},D=`[STX] DOM API violation in ${n&&n!==t?`${M(n)} (composed into ${M(t)})`:M(t)}:
|
|
280
280
|
${E.join(`
|
|
281
281
|
`)}
|
|
282
|
-
Tip: prefer useRef(), navigate(), and composables for component code`;if(
|
|
283
|
-
`);return{line:i.length,column:i[i.length-1].length+1}}function cg(e,t,i){let n=[];switch(e){case"if":case"elseif":case"unless":if(i.length===0)n.push({type:"syntax",message:`@${e} requires a condition`,suggestion:`Use @${e}(condition)`});break;case"foreach":if(i.length===0||!i[0].includes(" as "))n.push({type:"syntax",message:'@foreach requires "items as item" syntax',suggestion:"Use @foreach(items as item) or @foreach(items as key => value)"});break;case"for":if(i.length===0)n.push({type:"syntax",message:"@for requires loop parameters",suggestion:"Use @for(let i = 0; i < 10; i++)"});break;case"switch":if(i.length===0)n.push({type:"syntax",message:"@switch requires an expression",suggestion:"Use @switch(expression)"});break;case"case":if(i.length===0)n.push({type:"syntax",message:"@case requires a value",suggestion:"Use @case(value)"});break;case"include":case"extends":case"component":if(i.length===0)n.push({type:"syntax",message:`@${e} requires a path`,suggestion:`Use @${e}('path/to/template')`});break}return n}function lg(e){return/@[a-z]+/i.test(e)||/\{\{/.test(e)}function ug(e){let t=e.matchAll(/@([a-z]+)/gi),i=new Set;for(let n of t){let c=n[1].toLowerCase();if(!c.startsWith("end"))i.add(c)}return Array.from(i)}function ao(e,t,i){let n=/^<script\b([^>]*)>/i.exec(e);if(!n||!/(?:^|\s)src\s*=/i.test(n[1]??""))return null;return _(n[0],t,i)+e.slice(n[0].length)}var
|
|
284
|
-
`)c++;return!0}if(e[c]==="/"&&e[c+1]==="*"){c+=2;while(c<l-1&&!(e[c]==="*"&&e[c+1]==="/"))c++;return c+=2,!0}return!1},E=new Set(["return","typeof","instanceof","in","of","new","delete","void","throw","case","do","else","yield","await"]),A=()=>{let
|
|
285
|
-
`){let I=e[c];if(I==="\\"){c+=2;continue}if(I==="[")
|
|
282
|
+
Tip: prefer useRef(), navigate(), and composables for component code`;if(Rs.set(l,D),console.warn(D),c.failOnViolation)throw new q(D,n??t)}var gl=[{open:"@if",close:"@endif",name:"if"},{open:"@unless",close:"@endunless",name:"unless"},{open:"@foreach",close:"@endforeach",name:"foreach"},{open:"@for",close:"@endfor",name:"for"},{open:"@while",close:"@endwhile",name:"while"},{open:"@forelse",close:"@endforelse",name:"forelse"},{open:"@switch",close:"@endswitch",name:"switch"},{open:"@isset",close:"@endisset",name:"isset"},{open:"@empty",close:"@endempty",name:"empty"},{open:"@auth",close:"@endauth",name:"auth"},{open:"@guest",close:"@endguest",name:"guest"},{open:"@can",close:"@endcan",name:"can"},{open:"@cannot",close:"@endcannot",name:"cannot"},{open:"@section",close:"@endsection",name:"section",altClose:"@show"},{open:"@push",close:"@endpush",name:"push"},{open:"@prepend",close:"@endprepend",name:"prepend"},{open:"@once",close:"@endonce",name:"once"},{open:"@markdown",close:"@endmarkdown",name:"markdown"},{open:"@component",close:"@endcomponent",name:"component"}],ml=[{pattern:/@if\s*[^(]/,message:"@if directive missing parentheses",suggestion:"Use @if(condition)"},{pattern:/@foreach\s*[^(]/,message:"@foreach directive missing parentheses",suggestion:"Use @foreach(items as item)"},{pattern:/@foreach\([^)]*\)\s*[^@\n<]/,message:"@foreach may have content on same line",suggestion:"Put content on new line after @foreach()"},{pattern:/@include\s*[^(]/,message:"@include directive missing parentheses",suggestion:"Use @include('partial-name')"},{pattern:/@extends\s*[^(]/,message:"@extends directive missing parentheses",suggestion:"Use @extends('layout-name') or @layout('layout-name')"},{pattern:/@layout\s*[^(]/,message:"@layout directive missing parentheses",suggestion:"Use @layout('layout-name')"}],hl=[{pattern:/\{\{\s*constructor\s*\}\}/,message:"Attempting to access constructor property"},{pattern:/\{\{\s*__proto__\s*\}\}/,message:"Attempting to access __proto__ property"},{pattern:/\{\{\s*eval\s*\(/,message:"Attempting to use eval in expression"}];function ig(e){let t=[],i=[];return xl(e,t),bl(e,t,i),yl(e,i),_l(e,t),{valid:t.length===0,errors:t,warnings:i}}function xl(e,t){let i=(e.match(/\{\{/g)||[]).length,n=(e.match(/\}\}/g)||[]).length;if(i!==n)t.push({type:"expression",message:`Unclosed expression brackets: found ${i} opening '{{' and ${n} closing '}}'`,suggestion:"Ensure every {{ has a matching }}"})}function bl(e,t,i){for(let n of gl){let c=new RegExp(`${n.open}(?:\\s|\\()`,"g"),l=new RegExp(n.close,"g"),a=(e.match(c)||[]).length,y=(e.match(l)||[]).length;if(n.altClose){let v=new RegExp(n.altClose,"g");y+=(e.match(v)||[]).length}if(a>y)t.push({type:"directive",message:`Unclosed @${n.name} directive: found ${a} opening and ${y} closing`,suggestion:`Add ${a-y} missing ${n.close} tag(s)`});else if(y>a)i.push({type:"directive",message:`Extra ${n.close} found: ${y-a} more closing than opening`,suggestion:`Check for orphaned ${n.close} tags`})}}function yl(e,t){for(let i of ml)if(i.pattern.test(e))t.push({type:"syntax",message:i.message,suggestion:i.suggestion})}function _l(e,t){for(let i of hl)if(i.pattern.test(e))t.push({type:"expression",message:`Security warning: ${i.message}`,suggestion:"Remove dangerous code from template expressions"})}function ag(e,t){let i=e.slice(0,t).split(`
|
|
283
|
+
`);return{line:i.length,column:i[i.length-1].length+1}}function cg(e,t,i){let n=[];switch(e){case"if":case"elseif":case"unless":if(i.length===0)n.push({type:"syntax",message:`@${e} requires a condition`,suggestion:`Use @${e}(condition)`});break;case"foreach":if(i.length===0||!i[0].includes(" as "))n.push({type:"syntax",message:'@foreach requires "items as item" syntax',suggestion:"Use @foreach(items as item) or @foreach(items as key => value)"});break;case"for":if(i.length===0)n.push({type:"syntax",message:"@for requires loop parameters",suggestion:"Use @for(let i = 0; i < 10; i++)"});break;case"switch":if(i.length===0)n.push({type:"syntax",message:"@switch requires an expression",suggestion:"Use @switch(expression)"});break;case"case":if(i.length===0)n.push({type:"syntax",message:"@case requires a value",suggestion:"Use @case(value)"});break;case"include":case"extends":case"component":if(i.length===0)n.push({type:"syntax",message:`@${e} requires a path`,suggestion:`Use @${e}('path/to/template')`});break}return n}function lg(e){return/@[a-z]+/i.test(e)||/\{\{/.test(e)}function ug(e){let t=e.matchAll(/@([a-z]+)/gi),i=new Set;for(let n of t){let c=n[1].toLowerCase();if(!c.startsWith("end"))i.add(c)}return Array.from(i)}function ao(e,t,i){let n=/^<script\b([^>]*)>/i.exec(e);if(!n||!/(?:^|\s)src\s*=/i.test(n[1]??""))return null;return _(n[0],t,i)+e.slice(n[0].length)}var tn=new R(500),Ts=new Map;function lo(e){try{let t=Zn.statSync(e);return`${t.size}:${t.mtimeMs}`}catch{return""}}var Vn=new R(1000),Ps=new R(2000),Zs=new R(500),yo=33554432,Ks=yo;function wl(e){let t=e.componentRenderCacheBytes;if(typeof t!=="number"||t<0||t===Ks)return;Ks=t,Hn.setMaxBytes(t)}var Hn=new R(2000,{maxBytes:yo,sizeOf:(e)=>e.output.length});function Sl(e){let t=new WeakSet;try{let i=(n)=>{if(n===void 0)return{__stxType:"undefined"};if(typeof n==="bigint")return{__stxType:"bigint",value:n.toString()};if(typeof n==="function"||typeof n==="symbol")throw TypeError("Non-serializable component input");if(n===null||typeof n!=="object")return n;if(t.has(n))throw TypeError("Circular component input");t.add(n);try{if(n instanceof Date)return{__stxType:"date",value:n.toISOString()};if(Array.isArray(n))return n.map(i);let c=Object.getPrototypeOf(n);if(c!==Object.prototype&&c!==null)throw TypeError("Non-plain component input");let l={};for(let a of Object.keys(n).sort())l[a]=i(n[a]);return l}finally{t.delete(n)}};return JSON.stringify(i(e))}catch{return null}}function $l(e){let t={};for(let[i,n]of Object.entries(e))if(!i.startsWith("__")||i==="__stxServeContext")t[i]=n;return t}function Cs(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function Vs(e){let t=process.cwd(),i=`${t}\x00${e}`,n=uo.get(i);if(n===void 0)n=Bun.hash(_o(e,t).split(ce.sep).join("/")).toString(36).slice(0,6),uo.set(i,n);return n}var uo=new Map;function _o(e,t){if(!ce.isAbsolute(e))return e;let i=(n)=>{try{return Zn.realpathSync(n)}catch{return n}};return ce.relative(i(t),i(e))}function dg(e){return/\bjs\b/.test(e)||/\blang\s*=\s*["']?(js|javascript)["']?/i.test(e)}function je(e){return!dg(e)}var Un=new Map;function Y(e){let t;try{t=JSON.stringify(e)}catch{return new Bun.Transpiler(e)}let i=Un.get(t);if(i)return i;if(Un.size>=16)Un.clear();let n=new Bun.Transpiler(e);return Un.set(t,n),n}var fo=new WeakMap,vl=256;function Be(e){try{let t=Y({loader:"ts",target:"browser",define:C()}),i=fo.get(t);if(!i)i=new Map,fo.set(t,i);let n=i.get(e);if(n!==void 0)return n;let c=e.replace(/^\s*import\s+\w+\s+from\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,"");c=c.replace(/^\s*import\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,"");let l=[];c=c.replace(/\{!![\s\S]*?!!\}/g,(y)=>{let v=l.length;return l.push(y),`"__STX_EXPR_${v}__"`}),c=c.replace(/\{\{\{[\s\S]*?\}\}\}/g,(y)=>{let v=l.length;return l.push(y),`"__STX_EXPR_${v}__"`}),c=c.replace(/\{\{[\s\S]*?\}\}/g,(y)=>{let v=l.length;return l.push(y),`"__STX_EXPR_${v}__"`});let a=t.transformSync(c);for(let y=0;y<l.length;y++)a=a.replace(`"__STX_EXPR_${y}__"`,l[y]),a=a.replace(`'__STX_EXPR_${y}__'`,l[y]);if(i.size>=vl){let y=i.keys().next();if(!y.done)i.delete(y.value)}return i.set(e,a),a}catch(t){if(process.env.STX_DEBUG_TS)console.warn("[STX] TypeScript transpilation error:",t);return e}}function El(e){let t=[],i=new Set,n=0,c=0,l=e.length,a=(D)=>{c++;while(c<l){if(e[c]==="\\"){c+=2;continue}if(e[c]===D){c++;return}c++}},y=()=>{c++;while(c<l){if(e[c]==="\\"){c+=2;continue}if(e[c]==="`"){c++;return}if(e[c]==="$"&&e[c+1]==="{"){c+=2;let D=1;while(c<l&&D>0)if(e[c]==="{")D++,c++;else if(e[c]==="}")D--,c++;else if(e[c]==="'"||e[c]==='"')a(e[c]);else if(e[c]==="`")y();else c++;continue}c++}},v=()=>{if(e[c]==="/"&&e[c+1]==="/"){while(c<l&&e[c]!==`
|
|
284
|
+
`)c++;return!0}if(e[c]==="/"&&e[c+1]==="*"){c+=2;while(c<l-1&&!(e[c]==="*"&&e[c+1]==="/"))c++;return c+=2,!0}return!1},E=new Set(["return","typeof","instanceof","in","of","new","delete","void","throw","case","do","else","yield","await"]),A=()=>{let D=c-1;while(D>=0&&/\s/.test(e[D]))D--;if(D<0)return!0;let I=e[D];if("(,=:[!&|?{};+-*%<>~^".includes(I))return!0;if(!/[\w$]/.test(I))return!1;let j=D;while(j>0&&/[\w$]/.test(e[j-1]))j--;return E.has(e.slice(j,D+1))},M=()=>{c++;let D=!1;while(c<l&&e[c]!==`
|
|
285
|
+
`){let I=e[c];if(I==="\\"){c+=2;continue}if(I==="[")D=!0;else if(I==="]")D=!1;else if(I==="/"&&!D){c++;while(c<l&&/[a-z]/i.test(e[c]))c++;return}c++}},B=()=>{if(n!==0)return;let D=e.slice(c).match(/^(const|let|var)\s*\{([^}]+)\}\s*=/);if(D){let X=D[2].split(",").map((z)=>{let L=z.trim().split(":");return L[L.length-1].trim()});for(let z of X)if(z&&/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(z)&&!i.has(z))t.push(z),i.add(z);return}let I=e.slice(c).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(I){let X=I[2];if(!i.has(X))t.push(X),i.add(X);return}let j=e.slice(c).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(j){let X=j[1];if(!i.has(X))t.push(X),i.add(X);return}let Q=e.slice(c).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(Q){let X=Q[1];if(!i.has(X))t.push(X),i.add(X)}};while(c<l){if(v())continue;if(e[c]==="'"||e[c]==='"'){a(e[c]);continue}if(e[c]==="`"){y();continue}if(e[c]==="/"&&A()){M();continue}if(e[c]==="{"){n++,c++;continue}if(e[c]==="}"){n--,c++;continue}if(n===0&&/[a-z]/i.test(e[c])&&(c===0||/\s|[;{}()]/.test(e[c-1])))B();c++}return t}function kl(e){let t=[],i=0,n=0,c=null;for(let l=0;l<e.length;l++){let a=e[l];if(c){if(a==="\\"){l++;continue}if(a===c)c=null;continue}if(a==='"'||a==="'"||a==="`"){c=a;continue}if(a==="("||a==="["||a==="{")i++;else if(a===")"||a==="]"||a==="}")i--;else if(a===","&&i===0)t.push(e.slice(n,l)),n=l+1}if(n<e.length)t.push(e.slice(n));return t}function Rl(e){let t=0,i=null;for(let n=0;n<e.length;n++){let c=e[n];if(i){if(c==="\\"){n++;continue}if(c===i)i=null;continue}if(c==='"'||c==="'"||c==="`"){i=c;continue}if(c==="("||c==="["||c==="{")t++;else if(c===")"||c==="]"||c==="}")t--;else if(c==="="&&t===0){let l=e[n-1],a=e[n+1];if(l==="!"||l==="<"||l===">"||l==="=")continue;if(a==="="||a===">")continue;return n}}return-1}function Cl(e,t){try{let i=/=\s*(?:withDefaults\s*\([\s\S]*?defineProps|defineProps)\b/.exec(e);if(!i)return;let n=i.index-1;while(n>=0&&/\s/.test(e[n]))n--;if(e[n]!=="}")return;let c=n,l=0,a=-1;for(;n>=0;n--){let v=e[n];if(v==="}")l++;else if(v==="{"){if(l--,l===0){a=n;break}}}if(a===-1)return;let y=e.slice(a+1,c);for(let v of kl(y)){let E=v.trim();if(!E||E.startsWith("..."))continue;let A=Rl(E);if(A===-1)continue;let M=E.slice(0,A).trim();if(!/^[A-Z_$][\w$]*$/i.test(M))continue;if(t[M]!==void 0)continue;let B=E.slice(A+1).trim();if(!B)continue;try{let D=Object.keys(t).filter(jt),I=Function(...D,`"use strict"; return (${B});`);t[M]=I(...D.map((j)=>t[j]))}catch{}}}catch{}}var Al=new Set(["tr","td","th","thead","tbody","tfoot","caption","colgroup","col","option","optgroup","li","dt","dd","span"]);function pg(e,t){let i=e.match(/^(\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*)<([a-zA-Z][a-zA-Z0-9-]*)/s);if(!i)return null;let n=i[2].toLowerCase();if(!Al.has(n))return null;let c=new RegExp(`<\\/?${n}(?=[\\s/>])(?:[^>"']|"[^"]*"|'[^']*')*>`,"iy"),l=S(e,(E,A)=>(c.lastIndex=A,c.exec(E)?.index===A?c.lastIndex:-1));if(n==="span"&&/\sdata-stx-scope\s*=/.test(l[0]?.token||""))return null;let a=0,y=!1;for(let E of l){if(a+=E.token.startsWith("</")?-1:1,a<0)return null;if(a===0){if(e.slice(E.end).trim())return null;y=!0;break}}if(!y)return null;let v=i[0].length;return e.slice(0,v)+t+e.slice(v)}function wo(e,t){if(!e)return!1;return[...t.additionalComponentsDirs??[],...t.fallbackComponentsDir?[t.fallbackComponentsDir]:[]].some((n)=>{let c=ce.relative(ce.resolve(n),ce.resolve(e));return!c.startsWith("..")&&!ce.isAbsolute(c)})}async function Er(e,t,i,n,c){let l=e.endsWith(".stx")?e.slice(0,-4):e,a=(re)=>re.split("-").map((me)=>me.charAt(0).toUpperCase()+me.slice(1)).join(""),y=i.__importedComponents;if(y){for(let re of[l,l.toLowerCase(),a(l),V(l)])if(y.has(re))return!0}let v=[...new Set([`${l}.stx`,`${a(l)}.stx`,`${V(l)}.stx`])],E=typeof c.root==="string"?ce.resolve(c.root):void 0,A=E??ce.dirname(n),M=[],B=(re)=>{if(re&&!M.includes(re))M.push(re)},D=i.__originalFilePath;if(D)B(ce.join(ce.dirname(D),"components"));if(wo(t,c))B(c._rootComponentsDir);B(t),B(c._rootComponentsDir),B(ce.join(ce.dirname(n),"components")),B(c.componentsDir);for(let re of c.additionalComponentsDirs??[])B(re);let I=c._targetComponentFallbackNames?.some((re)=>re.toLowerCase()===l.toLowerCase());if(!I)for(let re of c._targetComponentDirs??[])B(re);if(E)B(ce.resolve(E,"resources/views/components")),B(ce.resolve(E,"resources/components")),B(ce.resolve(E,"src/components")),B(ce.resolve(E,"components"));for(let re of c._layerComponentDirs??[])B(re);let j=c._pluginComponentDirs;if(Array.isArray(j))for(let re of j)B(typeof re==="string"?re:null);if(B(c.fallbackComponentsDir),I)for(let re of c._targetComponentDirs??[])B(re);let Q=c._nativePrimitivesFallback;if(Q&&!Q.except.some((re)=>re.toLowerCase()===l.toLowerCase()))B(Q.dir);if(l.startsWith("./")||l.startsWith("../"))return s(ce.resolve(ce.dirname(n),`${l}.stx`));let X=po(ce.resolve(import.meta.dir,"components")),z=M.map((re)=>ce.isAbsolute(re)?re:ce.resolve(A,re)),L=`${v.join("\x00")}\x00\x00${z.join("\x00")}`,ee=Ps.get(L);if(ee!==void 0)return ee;let te=!1;e:for(let re of z){if(po(re)===X)continue;for(let me of v)if(await s(ce.join(re,me))){te=!0;break e}}return Ps.set(L,te),te}function po(e){let t=Zs.get(e);if(t!==void 0)return t;let i=e;try{i=Zn.realpathSync(e)}catch{}return Zs.set(e,i),i}function fg(e){return e==="visible"||e==="idle"||e==="interaction"||e.startsWith("media:")}function Xc(e){if(!e)return!1;let t=e.replace(/<script[\s\S]*?<\/script>/gi,"").replace(/<style[\s\S]*?<\/style>/gi,"");return/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(t)}function Tl(e,t,i){if(!e.includes("{{")&&!e.includes("{!!"))return e;let n=(c,l)=>{let a;try{a=T(c,t)}catch{return l}if(a===void 0||a===null)return"";let y=String(a);if(/<\/style/i.test(y))return console.warn(`[stx] a <style> expression in ${i??"<unknown>"} evaluated to CSS containing a closing style tag, which would end the element early, so it was dropped rather than emitted.`),"";return y};return e.replace(/\{!!([\s\S]*?)!!\}/g,(c,l)=>n(l,c)).replace(/\{\{([\s\S]*?)\}\}/g,(c,l)=>n(l,c))}var go=new Set;function mo(e,t,i,n){let c=`${e}\x00${t}\x00${n??""}`;if(!process.env.STX_DEBUG&&go.has(c))return;go.add(c);let l=t?` used in ${t}`:"",a=n?` Cause: ${n}.`:"",y=i.length>0?`
|
|
286
286
|
searched:
|
|
287
287
|
${i.map((v)=>` - ${v}`).join(`
|
|
288
|
-
`)}`:"";console.error(`[stx] component <${e}> could not be resolved${l}, so it rendered as nothing.${a}${y}`)}function ho(e){return`<!-- stx: component "${e.replace(/--+/g,"-")}" could not be resolved; see the server log -->`}var Il=new Set(["for","if","show","key","ref","class","className","style"]),xo=new Set,So="useMediaQuery|useDark|usePreferredDark|usePreferredLight|usePreferredReducedMotion|usePreferredContrast|useDocumentVisibility|useScrollLock",Jc=new RegExp(`\\b(?:${So})\\s*(?:<[^>]*>)?\\s*\\(`);function bi(e){let t=new Set,i=new RegExp(`\\b(?:const|let|var)\\s+([a-zA-Z_$][\\w$]*)\\s*=\\s*(?:state|derived|computed|ref|reactive|signal|useModel|useReactiveProp|useLocalStorage|useSessionStorage|keptState|useCookie|useDebouncedValue|${So})\\s*(?:<[^>]*>)?\\s*\\(`,"g");for(let n of e){let c;while((c=i.exec(n))!==null)t.add(c[1]);i.lastIndex=0}return[...t]}async function Fe(e,t,i,n,c,l,a,y=new Set,v,E=rt(c),A,D=e){let{extractVariables:B}=await o("stx/variable-extractor",()=>import("./chunk-9767yz39.js")),M=y??new Set;if(M.has(e))return`[Circular component reference: ${e}]`;let I=new Set(M);I.add(e);let j=typeof t.client==="string"?t.client.trim():"";if("client"in t)delete t.client;let Q=j&&j!=="load"&&fg(j)?j:"";try{let X=(se)=>se.split("-").map((ae)=>ae.charAt(0).toUpperCase()+ae.slice(1)).join(""),z=D.endsWith(".stx")?D.slice(0,-4):D,L=null,ee=c.__importedComponents;if(ee){let se=[z,z.toLowerCase(),X(z),V(z)];for(let ae of se)if(ee.has(ae)){L=ee.get(ae);break}}let te=[];if(!L){let se=[`${z}.stx`,`${X(z)}.stx`,`${V(z)}.stx`],ae=[...new Set(se)],we=c.__originalFilePath,be=[];if(be.push(...a._layerComponentDirs??[]),we){let ye=ce.join(ce.dirname(we),"components");be.push(ye)}let Ue=a._rootComponentsDir;if(typeof Ue==="string"&&wo(n,a)&&!be.includes(Ue))be.push(Ue);if(n&&!be.includes(n))be.push(n);if(typeof Ue==="string"&&!be.includes(Ue))be.push(Ue);let Te=ce.join(ce.dirname(l),"components");if(!be.includes(Te))be.push(Te);if(a.componentsDir&&a.componentsDir!==n&&!be.includes(a.componentsDir))be.push(a.componentsDir);for(let ye of a.additionalComponentsDirs??[])if(ye&&!be.includes(ye))be.push(ye);let ct=a._nativeHostAttrs&&/^(?:checkbox|switch)$/i.test(z),lt=(A?.events??[]).map((ye)=>ye.replace(/^@/,"").split(".")[0].toLowerCase().replace(/-/g,"")),yt=Object.hasOwn(t,"checked")||Boolean(A?.reactiveProps?.includes("checked")),Qn=Object.hasOwn(t,"value")||Boolean(A?.reactiveProps?.includes("value")),es=!lt.includes("valuechange")&&(yt||lt.includes("change")&&!Qn),gt=a._nativeHostAttrs&&/^textinput$/i.test(z),_t=lt.includes("update:value")&&!lt.includes("input"),Ht=a._nativeHostAttrs&&/^video$/i.test(z),ts=a._nativeHostAttrs&&/^image$/i.test(z),an=Ds([...Object.keys(t),...A?.reactiveProps??[]],A?.events,t),wt=Object.hasOwn(t,"src")||Boolean(A?.reactiveProps?.includes("src")),ln=Object.hasOwn(t,"source")||Boolean(A?.reactiveProps?.includes("source")),un=Ht&&wt&&!ln&&(A?.events??[]).every((ye)=>/^(?:play|pause|ended|timeupdate|loadedmetadata|loadstart|error)$/.test(ye.replace(/^@/,"").split(".")[0])),mt=(ye)=>Object.hasOwn(t,ye)||Boolean(A?.reactiveProps?.includes(ye)),_n=a._nativeHostAttrs&&/^button$/i.test(z)&&(mt("symbol")||mt("iconOnly")||mt("title")&&!mt("label")&&!i.trim()),Zt=a._targetComponentFallbackNames?.some((ye)=>ye.toLowerCase()===z.toLowerCase())&&(!ct||es)&&(!gt||_t)&&(!Ht||un)&&(!ts||an)&&!_n;for(let ye of Zt?[]:a._targetComponentDirs??[])if(ye&&!be.includes(ye))be.push(ye);let St=typeof a.root==="string"?ce.resolve(a.root):void 0,jo=St??ce.dirname(l),$t=[];if(St)$t.push(ce.resolve(St,"resources/views/components")),$t.push(ce.resolve(St,"resources/components")),$t.push(ce.resolve(St,"src/components")),$t.push(ce.resolve(St,"components"));$t.push(ce.resolve(import.meta.dir,"components"));for(let ye of $t)if(!be.includes(ye))be.push(ye);let nr=a._pluginComponentDirs;if(Array.isArray(nr)){for(let ye of nr)if(typeof ye==="string"&&!be.includes(ye))be.push(ye)}if(a.fallbackComponentsDir&&!be.includes(a.fallbackComponentsDir))be.push(a.fallbackComponentsDir);if(Zt){for(let ye of a._targetComponentDirs??[])if(ye&&!be.includes(ye))be.push(ye)}let Sn=a._nativePrimitivesFallback;if(Sn&&!Sn.except.some((ye)=>ye.toLowerCase()===z.toLowerCase())&&!be.includes(Sn.dir))be.push(Sn.dir);let sr=[...new Set(be.map((ye)=>{if(!ye)return ye;return ce.isAbsolute(ye)?ye:ce.resolve(jo,ye)}))];be.length=0,be.push(...sr);let ns=`${z}\x00${l}\x00${sr.join("\x00")}`,ss=Un.get(ns);if(ss)if(await s(ss))L=ss;else Un.delete(ns);if(!L&&(z.startsWith("./")||z.startsWith("../")))L=ce.resolve(ce.dirname(l),`${z}.stx`),te.push(L);else if(!L)for(let ye of be){if(!ye)continue;for(let $n of ae){let En=ce.join(ye,$n);if(te.push(En),await s(En)){L=En;break}}if(L)break;if(!L)try{let $n=await import("fs");if(!$n.statSync(ye,{throwIfNoEntry:!1})?.isDirectory())continue;let No=8,rs=[{path:ye,depth:0}];while(rs.length>0&&!L){let kn=rs.pop();if(kn.depth>=No)continue;let rr;try{rr=$n.readdirSync(kn.path,{withFileTypes:!0})}catch{continue}for(let Rn of rr){if(!Rn.isDirectory())continue;if(Rn.name==="node_modules"||Rn.name.startsWith("."))continue;let ir=ce.join(kn.path,Rn.name);for(let Lo of ae){let is=ce.join(ir,Lo);if(te.push(is),await s(is)){L=is;break}}if(L)break;rs.push({path:ir,depth:kn.depth+1})}}}catch{}if(L)break}if(L)Un.set(ns,L)}if(!L||!await s(L))return mo(e,l,te),ho(e);v.add(L);let re;if(en.has(L)&&Ts.get(L)===lo(L))re=en.get(L);else try{let se=lo(L);re=await Bun.file(L).text(),en.set(L,re),Ts.set(L,se)}catch(se){let ae=se instanceof Error?se.message:String(se);return mo(e,l,[L],ae),ho(e)}if(A)for(let se of new Set([...Object.keys(t),...A.reactiveProps??[]])){let ae=se.toLowerCase();if(ae.startsWith("aria-")||ae.startsWith("data-"))continue;let we=se.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`\\b${we}\\b`).test(re))A.declaredProps.add(se);if(new RegExp(`\\$props\\s*(?:\\.\\s*${we}\\b|\\[\\s*['"]${we}['"]\\s*\\])`).test(re)||new RegExp(`\\buseReactiveProp\\s*\\(\\s*['"]${we}['"]`).test(re))A.consumedProps?.add(se)}if(A?.reactiveProps?.length&&/\bdefineProps\s*(?:<[^>]*>)?\s*\(/.test(re))for(let se of A.reactiveProps){if(Il.has(se)||A.consumedProps?.has(se))continue;if(new RegExp(`\\buse(?:ReactiveProp|Model)\\s*\\(\\s*['"]${se.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(re))continue;let ae=`${L}\x00${se}`;if(xo.has(ae))continue;xo.add(ae),console.warn(`[stx] ${ce.basename(L)} reads \`${se}\` with defineProps(), which is not live, but ${ce.basename(l)} binds it (:${se}): the value can arrive empty or stale (on a native screen, and for a :for's rows, it does not arrive at all). Read it with useReactiveProp('${se}').`)}let me=new Set(["__originalFilePath","__importedComponents",On,"__stx_client_signal_names","__stx_client_declared_names","__stx_runtime_config","__stxServeContext","__stx_scope_seq"]),he={};for(let[se,ae]of Object.entries(c))if(!se.startsWith("__")||me.has(se))he[se]=ae;let le=E.length>0?{[Ln]:[...E]}:{},ke=i;if(i.includes("@include")){let{processIncludes:se}=await o("stx/includes",()=>import("./chunk-1338vj5g.js"));ke=await se(i,c,l,a,v)}if(/<[A-Z][\w.-]*[\s/>]/.test(ke)){let{processComponents:se}=await o("stx/component-renderer",()=>import("./chunk-27p6cxa2.js")),ae={...c,__processedComponents:M,...le};ke=await se(ke,ae,l,a,v);let we=ae.__stx_preserved_client_expressions;if(Array.isArray(we)&&we.length>0)c.__stx_preserved_client_expressions=[...new Set([...Array.isArray(c.__stx_preserved_client_expressions)?c.__stx_preserved_client_expressions:[],...we])]}let Re=[];if(Gc(ke)){let{processExpressions:se}=await o("stx/expressions",()=>import("./chunk-7j4tf0ba.js")),ae=c.__stx_signals_gate===void 0?{...c,__stx_signals_gate:!0,...le}:E.length>0?{...c,...le}:c;ke=se(ke,ae,l);for(let we of ke.matchAll(/\{\{([\s\S]*?)\}\}/g))Re.push(we[1].trim())}let He=G(ke),Xe=[],Ze=He.output.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(se,ae)=>{let we=He.scripts[Number(ae)]||"",be=we.match(/^<script\b([^>]*)>/i)?.[1]||"",Ue=be.match(/\btype\s*=\s*["']([^"']+)["']/i)?.[1]?.toLowerCase(),Te=!Ue||["module","text/javascript","application/javascript"].includes(Ue),ct=/\sdata-stx-(?:owner|instance)(?=[\s=/>])/i.test(` ${be}`);if(!/\bserver\b/i.test(be)&&Te&&!ct)return Xe.push(we),"";return we}),{extractSlotContent:qn}=await o("stx/slots",()=>import("./chunk-dwn8ye99.js")),ft=qn(Ze),pt={};if(ft.defaultSlot?.trim())pt.default=ft.defaultSlot;for(let[se,ae]of ft.namedSlots)pt[se]=ae.content;let dt=c.__stx_scope_seq??={n:0,key:Vs(String(c.__filename??l))},Ct=_o(e,process.cwd()),it=`stx_${(Ct.endsWith(".stx")?Ct.slice(0,-4):Ct).replace(/[^a-zA-Z0-9]/g,"_")}_${++dt.n}_${dt.key}`,We={...he,$uid:it,$native:a._nativeHostAttrs===!0,...t,props:t,slot:Ze,$slots:pt,__processedComponents:I,__sections:{},__stx_signals_gate:Se(re)||Gc(i),__stx_preserved_client_expressions:[...Array.isArray(c.__stx_preserved_client_expressions)?c.__stx_preserved_client_expressions:[],...Re]};Cl(re,We);let Tt=re,nn=de(Tt);if(nn)Tt=nn.content.trim();let Kn=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,Dt=[...re.matchAll(Kn)];for(let[,se,ae]of Dt)if(!/\bserver\b|\bsrc\s*=|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(se))Oe(ae,L,a.strict);let Je=[],Lt=null,Xn=Dt.some((se)=>/\bserver\b/.test(se[1]||"")&&/\bcache\b/.test(se[1]||"")),bt=null,et=null,Bt=null,sn=0,Wt=null;if(wl(a),Xn&&Zs>0){let se=Sl({props:t,slot:ke,slotContext:i.trim()?$l(he):void 0,buildMode:a.buildMode??"",skipEventDirectives:a.skipEventDirectives===!0,native:a._nativeHostAttrs===!0,clientLoopNames:[...E].sort(),layers:a._layerGraph?.layers.map((ae)=>ae.configFile),uid:it});if(se!==null){bt=`${L}\x00${x(re)}\x00${se}`;let ae=Vn.get(bt);if(ae){for(let we of ae.dependencies)v.add(we);if(qr(c,ae.clientFactories),dt.n+=ae.uidsConsumed,ae.preservedClientExpressions.length>0){let we=new Set(Array.isArray(c.__stx_preserved_client_expressions)?c.__stx_preserved_client_expressions:[]);for(let be of ae.preservedClientExpressions)we.add(be);c.__stx_preserved_client_expressions=[...we]}return ae.output}et=new Set(v),Bt=Hr(c),sn=dt.n,Wt=new Set(Array.isArray(c.__stx_preserved_client_expressions)?c.__stx_preserved_client_expressions:[])}}let zt=new Set;for(let se of Dt){let ae=se[1]||"",we=se[2]||"",be=ae.includes("server");if(je(ae)&&we.trim())we=Be(we);if(be&&we){for(let Te of Me(we))zt.add(Te);try{await B(we,We,L,{onFailure:(Te)=>{if(Te.kind!=="unknown")Lt=Te.kind}})}catch(Te){}}if(!be){let Te=we.replace(/^\s*const\s*\{[^}]+\}\s*=\s*window\.stx\s*;?\s*\n?/gm,""),ct=Te.includes("{{")&&Te.includes("}}"),lt=Te.includes("{!!")&&Te.includes("!!}");if(ct||lt)Te=vi(Te,We,L);let yt=ae.replace(/\s*\bts\b/g,"").replace(/\s*\blang\s*=\s*["']?(ts|typescript)["']?/gi,"");Je.push(`<script${yt}>${Te}</script>`)}}let Ge=G(re).output.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),Ft=Ge?Ge[1]:"",Jn=Ge?Ge[2]:"",tt="",ne=Ft&&/\bscoped\b/i.test(Ft);if(Ge)tt=`<style${Ft}>${Al(Jn,We,L)}</style>`;let ie=Tt;if(ie=ie.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),Ge)ie=ie.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");{let se=/@push\s*\(\s*['"]styles['"]\s*\)([\s\S]*?)@endpush/gi,ae=[];if(ie=ie.replace(se,(we,be)=>{let Ue=be.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i);if(Ue)ae.push(`<style${Ue[1]}>${Ue[2]}</style>`);return""}),ie=ie.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/gi,""),ae.length>0)tt=`${tt}${ae.join(`
|
|
289
|
-
`)}`}if(i&&ie.includes("{{ text || slot }}"))ie=ie.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g,()=>i);let{applySlots:ue}=await o("stx/slots",()=>import("./chunk-
|
|
290
|
-
${
|
|
288
|
+
`)}`:"";console.error(`[stx] component <${e}> could not be resolved${l}, so it rendered as nothing.${a}${y}`)}function ho(e){return`<!-- stx: component "${e.replace(/--+/g,"-")}" could not be resolved; see the server log -->`}var Il=new Set(["for","if","show","key","ref","class","className","style"]),xo=new Set,So="useMediaQuery|useDark|usePreferredDark|usePreferredLight|usePreferredReducedMotion|usePreferredContrast|useDocumentVisibility|useScrollLock",Gc=new RegExp(`\\b(?:${So})\\s*(?:<[^>]*>)?\\s*\\(`);function yi(e){let t=new Set,i=new RegExp(`\\b(?:const|let|var)\\s+([a-zA-Z_$][\\w$]*)\\s*=\\s*(?:state|derived|computed|ref|reactive|signal|useModel|useReactiveProp|useLocalStorage|useSessionStorage|keptState|useCookie|useDebouncedValue|${So})\\s*(?:<[^>]*>)?\\s*\\(`,"g");for(let n of e){let c;while((c=i.exec(n))!==null)t.add(c[1]);i.lastIndex=0}return[...t]}async function Fe(e,t,i,n,c,l,a,y=new Set,v,E=rt(c),A,M=e){let{extractVariables:B}=await o("stx/variable-extractor",()=>import("./chunk-f3b37bt7.js")),D=y??new Set;if(D.has(e))return`[Circular component reference: ${e}]`;let I=new Set(D);I.add(e);let j=typeof t.client==="string"?t.client.trim():"";if("client"in t)delete t.client;let Q=j&&j!=="load"&&fg(j)?j:"";try{let X=(se)=>se.split("-").map((ae)=>ae.charAt(0).toUpperCase()+ae.slice(1)).join(""),z=M.endsWith(".stx")?M.slice(0,-4):M,L=null,ee=c.__importedComponents;if(ee){let se=[z,z.toLowerCase(),X(z),V(z)];for(let ae of se)if(ee.has(ae)){L=ee.get(ae);break}}let te=[];if(!L){let se=[`${z}.stx`,`${X(z)}.stx`,`${V(z)}.stx`],ae=[...new Set(se)],we=c.__originalFilePath,be=[];if(be.push(...a._layerComponentDirs??[]),we){let ye=ce.join(ce.dirname(we),"components");be.push(ye)}let Ue=a._rootComponentsDir;if(typeof Ue==="string"&&wo(n,a)&&!be.includes(Ue))be.push(Ue);if(n&&!be.includes(n))be.push(n);if(typeof Ue==="string"&&!be.includes(Ue))be.push(Ue);let Ae=ce.join(ce.dirname(l),"components");if(!be.includes(Ae))be.push(Ae);if(a.componentsDir&&a.componentsDir!==n&&!be.includes(a.componentsDir))be.push(a.componentsDir);for(let ye of a.additionalComponentsDirs??[])if(ye&&!be.includes(ye))be.push(ye);let ct=a._nativeHostAttrs&&/^(?:checkbox|switch)$/i.test(z),lt=(A?.events??[]).map((ye)=>ye.replace(/^@/,"").split(".")[0].toLowerCase().replace(/-/g,"")),yt=Object.hasOwn(t,"checked")||Boolean(A?.reactiveProps?.includes("checked")),es=Object.hasOwn(t,"value")||Boolean(A?.reactiveProps?.includes("value")),ts=!lt.includes("valuechange")&&(yt||lt.includes("change")&&!es),gt=a._nativeHostAttrs&&/^textinput$/i.test(z),_t=lt.includes("update:value")&&!lt.includes("input"),Ht=a._nativeHostAttrs&&/^video$/i.test(z),ns=a._nativeHostAttrs&&/^image$/i.test(z),ln=Ds([...Object.keys(t),...A?.reactiveProps??[]],A?.events,t),wt=Object.hasOwn(t,"src")||Boolean(A?.reactiveProps?.includes("src")),un=Object.hasOwn(t,"source")||Boolean(A?.reactiveProps?.includes("source")),_n=Ht&&wt&&!un&&(A?.events??[]).every((ye)=>/^(?:play|pause|ended|timeupdate|loadedmetadata|loadstart|error)$/.test(ye.replace(/^@/,"").split(".")[0])),mt=(ye)=>Object.hasOwn(t,ye)||Boolean(A?.reactiveProps?.includes(ye)),Sn=a._nativeHostAttrs&&/^button$/i.test(z)&&(mt("symbol")||mt("iconOnly")||mt("title")&&!mt("label")&&!i.trim()),Zt=a._targetComponentFallbackNames?.some((ye)=>ye.toLowerCase()===z.toLowerCase())&&(!ct||ts)&&(!gt||_t)&&(!Ht||_n)&&(!ns||ln)&&!Sn;for(let ye of Zt?[]:a._targetComponentDirs??[])if(ye&&!be.includes(ye))be.push(ye);let St=typeof a.root==="string"?ce.resolve(a.root):void 0,jo=St??ce.dirname(l),$t=[];if(St)$t.push(ce.resolve(St,"resources/views/components")),$t.push(ce.resolve(St,"resources/components")),$t.push(ce.resolve(St,"src/components")),$t.push(ce.resolve(St,"components"));$t.push(ce.resolve(import.meta.dir,"components"));for(let ye of $t)if(!be.includes(ye))be.push(ye);let sr=a._pluginComponentDirs;if(Array.isArray(sr)){for(let ye of sr)if(typeof ye==="string"&&!be.includes(ye))be.push(ye)}if(a.fallbackComponentsDir&&!be.includes(a.fallbackComponentsDir))be.push(a.fallbackComponentsDir);if(Zt){for(let ye of a._targetComponentDirs??[])if(ye&&!be.includes(ye))be.push(ye)}let $n=a._nativePrimitivesFallback;if($n&&!$n.except.some((ye)=>ye.toLowerCase()===z.toLowerCase())&&!be.includes($n.dir))be.push($n.dir);let rr=[...new Set(be.map((ye)=>{if(!ye)return ye;return ce.isAbsolute(ye)?ye:ce.resolve(jo,ye)}))];be.length=0,be.push(...rr);let ss=`${z}\x00${l}\x00${rr.join("\x00")}`,rs=Vn.get(ss);if(rs)if(await s(rs))L=rs;else Vn.delete(ss);if(!L&&(z.startsWith("./")||z.startsWith("../")))L=ce.resolve(ce.dirname(l),`${z}.stx`),te.push(L);else if(!L)for(let ye of be){if(!ye)continue;for(let En of ae){let kn=ce.join(ye,En);if(te.push(kn),await s(kn)){L=kn;break}}if(L)break;if(!L)try{let En=await import("fs");if(!En.statSync(ye,{throwIfNoEntry:!1})?.isDirectory())continue;let No=8,is=[{path:ye,depth:0}];while(is.length>0&&!L){let Rn=is.pop();if(Rn.depth>=No)continue;let ir;try{ir=En.readdirSync(Rn.path,{withFileTypes:!0})}catch{continue}for(let Cn of ir){if(!Cn.isDirectory())continue;if(Cn.name==="node_modules"||Cn.name.startsWith("."))continue;let or=ce.join(Rn.path,Cn.name);for(let Lo of ae){let os=ce.join(or,Lo);if(te.push(os),await s(os)){L=os;break}}if(L)break;is.push({path:or,depth:Rn.depth+1})}}}catch{}if(L)break}if(L)Vn.set(ss,L)}if(!L||!await s(L))return mo(e,l,te),ho(e);v.add(L);let re;if(tn.has(L)&&Ts.get(L)===lo(L))re=tn.get(L);else try{let se=lo(L);re=await Bun.file(L).text(),tn.set(L,re),Ts.set(L,se)}catch(se){let ae=se instanceof Error?se.message:String(se);return mo(e,l,[L],ae),ho(e)}if(A)for(let se of new Set([...Object.keys(t),...A.reactiveProps??[]])){let ae=se.toLowerCase();if(ae.startsWith("aria-")||ae.startsWith("data-"))continue;let we=se.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`\\b${we}\\b`).test(re))A.declaredProps.add(se);if(new RegExp(`\\$props\\s*(?:\\.\\s*${we}\\b|\\[\\s*['"]${we}['"]\\s*\\])`).test(re)||new RegExp(`\\buseReactiveProp\\s*\\(\\s*['"]${we}['"]`).test(re))A.consumedProps?.add(se)}if(A?.reactiveProps?.length&&/\bdefineProps\s*(?:<[^>]*>)?\s*\(/.test(re))for(let se of A.reactiveProps){if(Il.has(se)||A.consumedProps?.has(se))continue;if(new RegExp(`\\buse(?:ReactiveProp|Model)\\s*\\(\\s*['"]${se.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(re))continue;let ae=`${L}\x00${se}`;if(xo.has(ae))continue;xo.add(ae),console.warn(`[stx] ${ce.basename(L)} reads \`${se}\` with defineProps(), which is not live, but ${ce.basename(l)} binds it (:${se}): the value can arrive empty or stale (on a native screen, and for a :for's rows, it does not arrive at all). Read it with useReactiveProp('${se}').`)}let me=new Set(["__originalFilePath","__importedComponents",Pn,"__stx_client_signal_names","__stx_client_declared_names","__stx_runtime_config","__stxServeContext","__stx_scope_seq"]),he={};for(let[se,ae]of Object.entries(c))if(!se.startsWith("__")||me.has(se))he[se]=ae;let le=E.length>0?{[Bn]:[...E]}:{},ke=i;if(i.includes("@include")){let{processIncludes:se}=await o("stx/includes",()=>import("./chunk-fg0amm0c.js"));ke=await se(i,c,l,a,v)}if(/<[A-Z][\w.-]*[\s/>]/.test(ke)){let{processComponents:se}=await o("stx/component-renderer",()=>import("./chunk-5kqbj292.js")),ae={...c,__processedComponents:D,...le};ke=await se(ke,ae,l,a,v);let we=ae.__stx_preserved_client_expressions;if(Array.isArray(we)&&we.length>0)c.__stx_preserved_client_expressions=[...new Set([...Array.isArray(c.__stx_preserved_client_expressions)?c.__stx_preserved_client_expressions:[],...we])]}let Re=[];if(Xc(ke)){let{processExpressions:se}=await o("stx/expressions",()=>import("./chunk-htrm7vx7.js")),ae=c.__stx_signals_gate===void 0?{...c,__stx_signals_gate:!0,...le}:E.length>0?{...c,...le}:c;ke=se(ke,ae,l);for(let we of ke.matchAll(/\{\{([\s\S]*?)\}\}/g))Re.push(we[1].trim())}let He=G(ke),Xe=[],Ze=He.output.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(se,ae)=>{let we=He.scripts[Number(ae)]||"",be=we.match(/^<script\b([^>]*)>/i)?.[1]||"",Ue=be.match(/\btype\s*=\s*["']([^"']+)["']/i)?.[1]?.toLowerCase(),Ae=!Ue||["module","text/javascript","application/javascript"].includes(Ue),ct=/\sdata-stx-(?:owner|instance)(?=[\s=/>])/i.test(` ${be}`);if(!/\bserver\b/i.test(be)&&Ae&&!ct)return Xe.push(we),"";return we}),{extractSlotContent:Kn}=await o("stx/slots",()=>import("./chunk-g48x8yme.js")),ft=Kn(Ze),pt={};if(ft.defaultSlot?.trim())pt.default=ft.defaultSlot;for(let[se,ae]of ft.namedSlots)pt[se]=ae.content;let dt=c.__stx_scope_seq??={n:0,key:Vs(String(c.__filename??l))},Ct=_o(e,process.cwd()),it=`stx_${(Ct.endsWith(".stx")?Ct.slice(0,-4):Ct).replace(/[^a-zA-Z0-9]/g,"_")}_${++dt.n}_${dt.key}`,We={...he,$uid:it,$native:a._nativeHostAttrs===!0,...t,props:t,slot:Ze,$slots:pt,__processedComponents:I,__sections:{},__stx_signals_gate:Se(re)||Xc(i),__stx_preserved_client_expressions:[...Array.isArray(c.__stx_preserved_client_expressions)?c.__stx_preserved_client_expressions:[],...Re]};Cl(re,We);let Tt=re,sn=de(Tt);if(sn)Tt=sn.content.trim();let Xn=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,Dt=[...re.matchAll(Xn)];for(let[,se,ae]of Dt)if(!/\bserver\b|\bsrc\s*=|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(se))Oe(ae,L,a.strict);let Je=[],Lt=null,Jn=Dt.some((se)=>/\bserver\b/.test(se[1]||"")&&/\bcache\b/.test(se[1]||"")),bt=null,et=null,Bt=null,rn=0,Wt=null;if(wl(a),Jn&&Ks>0){let se=Sl({props:t,slot:ke,slotContext:i.trim()?$l(he):void 0,buildMode:a.buildMode??"",skipEventDirectives:a.skipEventDirectives===!0,native:a._nativeHostAttrs===!0,clientLoopNames:[...E].sort(),layers:a._layerGraph?.layers.map((ae)=>ae.configFile),uid:it});if(se!==null){bt=`${L}\x00${x(re)}\x00${se}`;let ae=Hn.get(bt);if(ae){for(let we of ae.dependencies)v.add(we);if(Kr(c,ae.clientFactories),dt.n+=ae.uidsConsumed,ae.preservedClientExpressions.length>0){let we=new Set(Array.isArray(c.__stx_preserved_client_expressions)?c.__stx_preserved_client_expressions:[]);for(let be of ae.preservedClientExpressions)we.add(be);c.__stx_preserved_client_expressions=[...we]}return ae.output}et=new Set(v),Bt=Zr(c),rn=dt.n,Wt=new Set(Array.isArray(c.__stx_preserved_client_expressions)?c.__stx_preserved_client_expressions:[])}}let zt=new Set;for(let se of Dt){let ae=se[1]||"",we=se[2]||"",be=ae.includes("server");if(je(ae)&&we.trim())we=Be(we);if(be&&we){for(let Ae of Me(we))zt.add(Ae);try{await B(we,We,L,{onFailure:(Ae)=>{if(Ae.kind!=="unknown")Lt=Ae.kind}})}catch(Ae){}}if(!be){let Ae=we.replace(/^\s*const\s*\{[^}]+\}\s*=\s*window\.stx\s*;?\s*\n?/gm,""),ct=Ae.includes("{{")&&Ae.includes("}}"),lt=Ae.includes("{!!")&&Ae.includes("!!}");if(ct||lt)Ae=wi(Ae,We,L);let yt=ae.replace(/\s*\bts\b/g,"").replace(/\s*\blang\s*=\s*["']?(ts|typescript)["']?/gi,"");Je.push(`<script${yt}>${Ae}</script>`)}}let Ge=G(re).output.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),Ft=Ge?Ge[1]:"",Gn=Ge?Ge[2]:"",tt="",ne=Ft&&/\bscoped\b/i.test(Ft);if(Ge)tt=`<style${Ft}>${Tl(Gn,We,L)}</style>`;let ie=Tt;if(ie=ie.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),Ge)ie=ie.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");{let se=/@push\s*\(\s*['"]styles['"]\s*\)([\s\S]*?)@endpush/gi,ae=[];if(ie=ie.replace(se,(we,be)=>{let Ue=be.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i);if(Ue)ae.push(`<style${Ue[1]}>${Ue[2]}</style>`);return""}),ie=ie.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/gi,""),ae.length>0)tt=`${tt}${ae.join(`
|
|
289
|
+
`)}`}if(i&&ie.includes("{{ text || slot }}"))ie=ie.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g,()=>i);let{applySlots:ue}=await o("stx/slots",()=>import("./chunk-g48x8yme.js")),{defaultSlot:$e,namedSlots:Ce}=ft,qe=c.__stx_signals_gate===!0&&/\s(?:@[\w:.-]+|x-on:[\w:.-]+)\s*=/.test(Ze),nt=a._nativeHostAttrs===!0&&Je.length>0||qe&&Je.length>0||Je.some((se)=>/\b(?:state|derived|effect|ref|useRef|reactive|computed|watch|watchEffect|useModel|useReactiveProp|onMount|onDestroy|defineProps|withDefaults|defineEmits|defineExpose|defineSlots)\s*(?:<[^<>()]*>)?\s*\(/.test(se)),Yn=(se)=>nt?Ni(se,it):se,Qn=new Map([...Ce].map(([se,ae])=>[se,{...ae,content:Yn(ae.content)}]));ie=await ue(ie,Yn($e),Qn,We,nt?it:"");let on=yi(Je),Ut=(Array.isArray(We.__stx_client_signal_names)?We.__stx_client_signal_names:[]).filter((se)=>!zt.has(se));if(on.length>0||Ut.length>0)We.__stx_client_signal_names=[...new Set([...Ut,...on])];else delete We.__stx_client_signal_names;let Vt=E.filter((se)=>!zt.has(se)&&!(se in t));if(Vt.length>0)We[Bn]=Vt;let cn={...a,_rootComponentsDir:a._rootComponentsDir||a.componentsDir,componentsDir:ce.dirname(L),skipSignalsRuntime:!0,skipEventDirectives:a._nativeHostAttrs===!0||nt||Je.length===0,defaultLayout:void 0};We.__stxProcessingDepth=(c.__stxProcessingDepth||0)+1;let{processDirectives:an}=await o("stx/process",()=>import("./chunk-w31y3j3k.js")),Ye=await an(ie,We,L,cn,v),ot=new Set(Array.isArray(c.__stx_preserved_client_expressions)?c.__stx_preserved_client_expressions:[]);for(let se of Ye.matchAll(/\{\{([\s\S]*?)\}\}/g))ot.add(se[1].trim());if(ot.size>0)c.__stx_preserved_client_expressions=[...ot];let st=it,Ke=Ye;if(nt){let se="";if(Object.keys(t).length>0)try{se=` data-stx-props="${Cs(JSON.stringify(t))}"`}catch{}let ae=Q?` stx-hydrate="${Cs(Q)}"`:"",we=Object.fromEntries(Object.entries(pt).map(([gt,_t])=>[gt,Boolean(_t)])),be=Object.keys(we).length>0?` data-stx-slots="${Cs(JSON.stringify(we))}"`:"",Ue=` data-stx-scope="${st}"${se}${be}${ae}`,Ae=/^\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*<span(?=[\s/>])/i.test(Ye),ct=/^\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*<[^>]+\bdata-stx-layout-root(?:\s|=|>)/i.test(Ye),lt=/^\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*<[^>]+\bdata-stx-fill-root(?:\s|=|>)/i.test(Ye),yt=Ae?"span":"div",es=ct&&a._nativeHostAttrs?' style="display:flex;flex-direction:column;flex:1;min-height:0;min-width:0"':lt&&a._nativeHostAttrs?' style="width:100%;height:100%"':Ae||ct?' style="display:contents"':"";Ke=pg(Ye,Ue)??`<${yt}${Ue} data-stx-component-wrapper${es}>${Ye}</${yt}>`;let ts=await Promise.all(Je.map(async(gt)=>{let _t=gt.match(/<script([^>]*)>([\s\S]*)<\/script>/i);if(!_t)return gt;let[,Ht,ns]=_t,ln=ao(gt,We,L);if(ln!==null)return ln;let wt=await Pl(ns,L,a.buildMode==="compile"),un=yn(wt.clientCode,De(We)),{vendorStyleTags:_n}=wt,mt=un?`function(__scopeId) {
|
|
290
|
+
${un}
|
|
291
291
|
return (${wt.factoryBody})(__scopeId);
|
|
292
|
-
}`:wt.factoryBody,
|
|
293
|
-
`+
|
|
292
|
+
}`:wt.factoryBody,Sn=Q?null:hs(c,mt),Zt=Sn?`window.__stxComponentFactories[${JSON.stringify(Sn)}](${JSON.stringify(st)});`:`(${mt})(${JSON.stringify(st)});`;if(Q)return`${_n}<script type="stx/island" data-stx-island="${st}" data-stx-scoped data-stx-owner="${st}"${Ht}>${Zt}</script>`;return`${_n}<script data-stx-scoped data-stx-run="always" data-stx-owner="${st}"${Ht}>${Zt}</script>`}));if(Ke=Ke+`
|
|
293
|
+
`+ts.join(`
|
|
294
294
|
`),tt)Ke+=`
|
|
295
295
|
`+tt}else{if(tt)Ke+=`
|
|
296
|
-
`+tt;if(Je.length>0){let se=We.__stx_event_bindings||[],ae=De(We),we=await Promise.all(Je.map(async(be)=>{let Ue=ao(be,We,L);if(Ue!==null)return Ue;let
|
|
296
|
+
`+tt;if(Je.length>0){let se=We.__stx_event_bindings||[],ae=De(We),we=await Promise.all(Je.map(async(be)=>{let Ue=ao(be,We,L);if(Ue!==null)return Ue;let Ae=be.match(/<script\b[^>]*>([\s\S]*?)<\/script>/);if(!Ae)return be;return await Le(Ae[1],{eventBindings:se,templateContent:Ke,filePath:L,projectRoot:process.cwd(),serverData:ae,instanceId:it})}));Ke+=`
|
|
297
297
|
`+we.join(`
|
|
298
|
-
`),We.__stx_event_bindings=[]}}if(ne){let se=Bs(Ke,L);if(se.hasScoped)Ke=se.html}if(bt&&et){let se=Array.isArray(c.__stx_preserved_client_expressions)?c.__stx_preserved_client_expressions:[];
|
|
298
|
+
`),We.__stx_event_bindings=[]}}if(ne){let se=Bs(Ke,L);if(se.hasScoped)Ke=se.html}if(bt&&et){let se=Array.isArray(c.__stx_preserved_client_expressions)?c.__stx_preserved_client_expressions:[];Hn.set(bt,{output:Ke,dependencies:[...v].filter((ae)=>!et.has(ae)),clientFactories:Bt?qr(c,Bt):[],uidsConsumed:dt.n-rn,preservedClientExpressions:Wt?se.filter((ae)=>!Wt.has(ae)):[]})}if(Lt)Ke=`<!--stx-render-failed:${Lt}-->${Ke}`;return Xe.length>0?`${Ke}
|
|
299
299
|
${Xe.join(`
|
|
300
|
-
`)}`:Ke}catch(X){if(X instanceof q)throw X;return`[Error processing component: ${X instanceof Error?X.message:String(X)}]`}finally{
|
|
301
|
-
`),y=0;for(let v=0;v<a.length;v++)if(y+=a[v].length+1,y>=t){n=v+1,c=a[v].trim();let E=Math.max(0,v-2),A=Math.min(a.length,v+3);l=a.slice(E,A).map((
|
|
302
|
-
`);break}}else if(i){let a=e.indexOf(i);if(a>=0)return
|
|
303
|
-
`,Math.max(0,c-1));E=c-(
|
|
300
|
+
`)}`:Ke}catch(X){if(X instanceof q)throw X;return`[Error processing component: ${X instanceof Error?X.message:String(X)}]`}finally{D.delete(e)}}async function s(e){return Bun.file(e).exists()}function Xs(e,t){let i=ce.resolve(t),n=ce.resolve(e),c=i.endsWith(ce.sep)?i:i+ce.sep;if(n===i||n.startsWith(c))return n;return null}async function bo(e,t,i,n){let c=t.startsWith("layouts/")?t.slice(8):t,l=ce.join(e,c);for(let a of l.endsWith(".stx")?[l]:[l,`${l}.stx`])if(await s(a)){if(n)console.log(`Found layout in ${e}: ${a}`);return i?.add(a),a}return null}async function bn(e,t,i,n){let c=await Ol(e,t,i,n);if(c===null)return null;let l=Xs(c,process.cwd());if(l)return l;let a=[i.root,i.layoutsDir,i.fallbackLayoutsDir,i.componentsDir,i.partialsDir,i.pagesDir,...i._layerLayoutDirs??[]].filter((y)=>typeof y==="string"&&y.length>0);for(let y of a){let v=ce.isAbsolute(y)?y:ce.resolve(process.cwd(),y);if(Xs(c,v))return ce.resolve(c)}return console.warn(`[stx] rejected resolved template path that escapes project root: ${c} (template: ${e}, from: ${t})`),null}async function Ol(e,t,i,n){if(i.debug)console.log(`Resolving template path: ${e} from ${t}`);let c=ce.dirname(t),l=process.cwd();if(e.startsWith("/")){let D=ce.join(l,e),I=Xs(D,l);if(!I)return console.warn(`[stx] rejected template path that escapes project root: ${e} (from ${t})`),null;if(i.debug)console.log(`Checking absolute path: ${I}`);if(await s(I)&&n)n.add(I);return I}let a=async(D)=>{if(!i.layoutsDir||!i.fallbackLayoutsDir)return D;let I=ce.relative(ce.resolve(l,i.fallbackLayoutsDir),D);if(I.startsWith("..")||ce.isAbsolute(I))return D;return await bo(ce.resolve(l,i.layoutsDir),e,n,i.debug)??D},y=ce.join(c,e);if(await s(y)){if(i.debug)console.log(`Found direct path: ${y}`);let D=await a(y);if(n)n.add(D);return D}if(!e.endsWith(".stx")&&!e.endsWith(".jsx")&&!e.endsWith(".tsx"))for(let D of[".stx",".tsx",".jsx"]){let I=`${y}${D}`;if(await s(I)){if(i.debug)console.log(`Found direct path with extension: ${I}`);let j=await a(I);if(n)n.add(j);return j}}let v=[];if(v.push(...i._layerLayoutDirs??[]),i.layoutsDir)v.push(ce.isAbsolute(i.layoutsDir)?i.layoutsDir:ce.resolve(process.cwd(),i.layoutsDir));let E=ce.resolve(c),A=process.cwd();for(let D=0;D<10;D++){let I=ce.join(E,"layouts"),j=!1;try{j=Zn.statSync(I,{throwIfNoEntry:!1})?.isDirectory()??!1}catch{}if(j){v.push(I);break}let Q=ce.dirname(E);if(Q===E||Q.length<A.length)break;E=Q}for(let D of v){let I=await bo(D,e,n,i.debug);if(I)return I}if(i.fallbackLayoutsDir){let D=ce.isAbsolute(i.fallbackLayoutsDir)?i.fallbackLayoutsDir:ce.resolve(process.cwd(),i.fallbackLayoutsDir),I=e.startsWith("layouts/")?e.slice(8):e,j=[ce.join(D,I)];if(!e.endsWith(".stx"))j.push(`${j[0]}.stx`);for(let Q of j)if(await s(Q)){if(i.debug)console.log(`Found in options.fallbackLayoutsDir: ${Q}`);if(n)n.add(Q);return Q}}if(e.startsWith("layouts/")||e.includes("/layouts/")){let D=e.split("layouts/"),I=ce.join(i.partialsDir||c,"layouts",D[1]);if(await s(I)){if(i.debug)console.log(`Found in layouts path: ${I}`);if(n)n.add(I);return I}if(!I.endsWith(".stx")){let j=`${I}.stx`;if(await s(j)){if(i.debug)console.log(`Found in layouts path with extension: ${j}`);if(n)n.add(j);return j}}}if(i.partialsDir){let D=ce.join(i.partialsDir,"layouts");if(await s(D)){let I=ce.join(D,e);if(await s(I)){if(i.debug)console.log(`Found in partials layouts dir: ${I}`);if(n)n.add(I);return I}if(!e.endsWith(".stx")){let j=`${I}.stx`;if(await s(j)){if(i.debug)console.log(`Found in partials layouts dir with extension: ${j}`);if(n)n.add(j);return j}}}}let M=i.partialsDir||ce.join(process.cwd(),"views"),B=ce.join(M,e);if(await s(B)){if(i.debug)console.log(`Found in views path: ${B}`);if(n)n.add(B);return B}if(!e.endsWith(".stx")){let D=`${B}.stx`;if(await s(D)){if(i.debug)console.log(`Found in views path with extension: ${D}`);if(n)n.add(D);return D}}if(c.includes("temp")){let D=ce.join(ce.dirname(c),"layouts",e);if(await s(D)){if(i.debug)console.log(`Found in temp layouts dir: ${D}`);if(n)n.add(D);return D}if(!e.endsWith(".stx")){let I=`${D}.stx`;if(await s(I)){if(i.debug)console.log(`Found in temp layouts dir with extension: ${I}`);if(n)n.add(I);return I}}}if(i.debug)console.warn(`Template not found after trying all paths: ${e} (referenced from ${t})`);else console.warn(`Template not found: ${e} (referenced from ${t})`);return null}function Jc(e,t,i){let n=0,c="",l="";try{if(typeof t==="number"&&t>=0){let a=e.split(`
|
|
301
|
+
`),y=0;for(let v=0;v<a.length;v++)if(y+=a[v].length+1,y>=t){n=v+1,c=a[v].trim();let E=Math.max(0,v-2),A=Math.min(a.length,v+3);l=a.slice(E,A).map((M,B)=>{let D=E+B+1;return`${D===n?"> ":" "}${D}: ${M}`}).join(`
|
|
302
|
+
`);break}}else if(i){let a=e.indexOf(i);if(a>=0)return Jc(e,a)}}catch{}return{lineNumber:n,lineContent:c,context:l}}var Ee={reset:"\x1B[0m",bold:"\x1B[1m",dim:"\x1B[2m",red:"\x1B[31m",yellow:"\x1B[33m",blue:"\x1B[34m",cyan:"\x1B[36m",gray:"\x1B[90m",bgRed:"\x1B[41m",bgYellow:"\x1B[43m"};function h(e,t,i,n,c,l){let{lineNumber:a,context:y}=Jc(n,c,l),v=i.split("/").pop(),E=0;if(typeof c==="number"&&c>=0&&n){let M=n.lastIndexOf(`
|
|
303
|
+
`,Math.max(0,c-1));E=c-(M+1)+1}let A="";if(a>0)A+=`
|
|
304
304
|
${i}:${a}${E>0?`:${E}`:""}: ${e.toLowerCase()} error: ${t}
|
|
305
305
|
`;if(A+=`
|
|
306
306
|
${Ee.bold}${Ee.red}\u256D\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256E${Ee.reset}
|
|
@@ -312,8 +312,8 @@ ${Ee.yellow}${Ee.bold}Message:${Ee.reset} ${t}
|
|
|
312
312
|
`,y)A+=`
|
|
313
313
|
${Ee.blue}${Ee.bold}Context:${Ee.reset}
|
|
314
314
|
${Ee.dim}${y}${Ee.reset}
|
|
315
|
-
`;return A}function fe(){
|
|
316
|
-
${at("const",[...
|
|
315
|
+
`;return A}function fe(){tn.clear(),Ts.clear(),Vn.clear(),Ps.clear(),Zs.clear(),Hn.clear()}function Xh(){return{size:tn.size,maxSize:500}}var As=b(128);async function Pl(e,t,i){let n=x(e,t,i),c=As.get(n);if(c){if(Ls(c.deps))return c;As.delete(n)}let l=mi(e,{filePath:t,projectRoot:process.cwd()}),a=l.code,y=hi(l.styles);a=Nt(a).code;let{hasUserImports:v,bundleClientScript:E}=await o("stx/client-script-bundler",()=>import("./chunk-aayq1a90.js")),A=[],M=!1;if(v(a)){let z=a;a=await E(z,t,{projectRoot:process.cwd(),minify:i,collectInputs:A}),M=a===z}let{stripStxRuntimeImports:B}=await o("stx/signal-processing",()=>import("./chunk-5a1273xd.js"));a=B(a);let D=P(a),I=El(D),j=new Set(H(D,!0).split(",").map((z)=>z.trim())),Q=`function(__scopeId) {
|
|
316
|
+
${at("const",[...ll,...I],D)}
|
|
317
317
|
const __scope = window.stx._scopes = window.stx._scopes || {};
|
|
318
318
|
const __scopeVars = __scope[__scopeId] = __scope[__scopeId] || {};
|
|
319
319
|
__scopeVars.$refs = __scopeVars.$refs || {};
|
|
@@ -373,7 +373,7 @@ ${Ee.dim}${y}${Ee.reset}
|
|
|
373
373
|
const __endEffects = window.stx._beginEffects ? window.stx._beginEffects() : null;
|
|
374
374
|
|
|
375
375
|
try {
|
|
376
|
-
${
|
|
376
|
+
${D}
|
|
377
377
|
|
|
378
378
|
// Register all defined signals and functions in this scope
|
|
379
379
|
const __localVars = {};
|
|
@@ -397,24 +397,24 @@ finally {
|
|
|
397
397
|
window.__STX_CURRENT_ELEMENT__ = __previousCurrentElement;
|
|
398
398
|
window.__STX_CURRENT_PROPS__ = __previousCurrentProps;
|
|
399
399
|
}
|
|
400
|
-
}`,X={vendorStyleTags:y,factoryBody:Q,clientCode:
|
|
401
|
-
`);for(let c of n){let l=i,a=null,y=!1;for(let v=0;v<c.length;v++){let E=c[v];if(y){y=!1;continue}if(E==="\\"){y=!0;continue}if(a){if(E===a)a=null;continue}if(E==="'"||E==='"'||E==="`"){a=E;continue}if(E==="/"&&v+1<c.length&&c[v+1]==="/")break;if(E==="{")i++;else if(E==="}")i--}if(l===0){let v=c.match(/(?:const|let|var)\s+(\w+)\s*=/);if(v)t.push(v[1]);else if(/^\s*(?:const|let|var)\s+\w+\s*;?\s*$/.test(c)){let E=c.match(/(?:const|let|var)\s+(\w+)/);if(E)t.push(E[1])}else{let E=c.match(/(?:const|let|var)\s+(\{[^}]+\}|\[[^\]]+\])\s*=/);if(E){let
|
|
400
|
+
}`,X={vendorStyleTags:y,factoryBody:Q,clientCode:D,deps:br([...A,...l.styles.map((z)=>z.resolvedPath)])};if(!M&&l.unresolved.length===0)As.set(n,X);return X}var hn=["module","exports","require","props","$props","$bool","$num","defineProps","withDefaults","defineClientPayload","useServerData","useRuntimeConfig","useServerRuntimeConfig","state","derived","effect","batch","onMount","onDestroy","definePageMeta","useRoute","useRouter","useHead","useSeoMeta","setResponseStatus","setResponseHeader","notFound","ref","reactive","computed","watch","onMounted","onUnmounted","nextTick","defineEmits","defineExpose","defineSlots","provide","inject","useColorMode","useDark","useMediaQuery","useScrollLock","usePreferredDark","usePreferredLight","usePreferredReducedMotion","usePreferredContrast","window","document","console","confirm","alert","fetch","params"];var Dl=100,Ml=599,Qs="__stxResponseStatus",nn="__stxResponseHeaders";function qn(e){return typeof e==="number"&&Number.isInteger(e)&&e>=Dl&&e<=Ml}function gn(e){for(let t of e.matchAll(/\bdefinePageMeta\s*\(\s*\{([\s\S]*?)\}\s*\)/g)){let i=t[1].match(/(?:^|,)\s*status\s*:\s*(\d{3})(?=\s*(?:,|$))/);if(!i)continue;let n=Number(i[1]);if(qn(n))return n}return}function Gs(e,t){if(!e||typeof e!=="object")return!1;let i=typeof t==="string"&&/^\d+$/.test(t.trim())?Number(t.trim()):t;if(!qn(i))return!1;return e[Qs]=i,!0}function jl(e,t,i){if(!e||typeof e!=="object")return;let n=String(t??"").trim();if(!n)return;e[nn]={...e[nn],[n]:String(i)}}function It(e){let t=e?.[Qs];return qn(t)?t:void 0}function Ot(e){let t=e?.[nn];if(!t||typeof t!=="object")return;let i=Object.entries(t).map(([n,c])=>[n,String(c)]);return i.length>0?Object.fromEntries(i):void 0}function Lc(e,t){if(!e||!t||e===t||typeof t!=="object")return;let i=It(e);if(i!==void 0)t[Qs]=i;let n=Ot(e);if(n)t[nn]={...t[nn],...n}}function Fs(e){return{setResponseStatus:(t)=>{Gs(e,t)},notFound:(t=404)=>{let i=qn(t)&&t>=400?t:404;Gs(e,i)},setResponseHeader:(t,i)=>{jl(e,t,i)}}}function jc(e,t,i={}){if(!e.includes("@status"))return e;let{filePath:n,buildMode:c}=i,l=c==="compile",a="",y=0,v=/@status\s*\(/g,E;while((E=v.exec(e))!==null){let A=Nl(e,E.index+E[0].length-1);if(A<0)break;let M=e.slice(E.index+E[0].length,A).trim(),B=/^\d+$/.test(M)?Number(M):u(M,t),D=n?` in ${n}`:"";if(l)console.warn(`[stx] @status(${M})${D} is skipped when precompiling: the build has no request, so the branch it sits in is not the one a visitor will get. Call notFound() or setResponseStatus(${M}) from <script server> instead \u2014 that runs per request.`);else if(!Gs(t,B))console.warn(`[stx] @status(${M})${D} is not an HTTP status (100-599) \u2014 ignoring it.`);a+=e.slice(y,E.index),y=A+1+(e.slice(A+1).match(/^[^\S\n]*\n?/)?.[0].length??0),v.lastIndex=y}return y===0?e:a+e.slice(y)}function Nl(e,t){let i=1,n=null,c=!1;for(let l=t+1;l<e.length;l++){let a=e[l];if(c){c=!1;continue}if(n){if(a==="\\")c=!0;else if(a===n)n=null;continue}if(a==='"'||a==="'"||a==="`"){n=a;continue}if(a==="(")i++;else if(a===")"&&--i===0)return l}return-1}var $o=new Set(hn),Ll=new Set(["props","$props","defineProps"]),Bl=new Set(["stx","@stacksjs/stx"]),vo=b(128),Eo=b(64);function Wl(e){let t=[],i=0,n=e.split(`
|
|
401
|
+
`);for(let c of n){let l=i,a=null,y=!1;for(let v=0;v<c.length;v++){let E=c[v];if(y){y=!1;continue}if(E==="\\"){y=!0;continue}if(a){if(E===a)a=null;continue}if(E==="'"||E==='"'||E==="`"){a=E;continue}if(E==="/"&&v+1<c.length&&c[v+1]==="/")break;if(E==="{")i++;else if(E==="}")i--}if(l===0){let v=c.match(/(?:const|let|var)\s+(\w+)\s*=/);if(v)t.push(v[1]);else if(/^\s*(?:const|let|var)\s+\w+\s*;?\s*$/.test(c)){let E=c.match(/(?:const|let|var)\s+(\w+)/);if(E)t.push(E[1])}else{let E=c.match(/(?:const|let|var)\s+(\{[^}]+\}|\[[^\]]+\])\s*=/);if(E){let M=E[1].slice(1,-1).split(",").map((B)=>{let D=B.split(":");return(D.length>1?D[1]:D[0]).trim()}).filter((B)=>/^\w+$/.test(B));t.push(...M)}}}}return[...new Set(t)]}function Yf(e){let t=e;t=t.replace(/^\s*import\s+.*?from\s+['"][^'"]+['"]\s*;?\s*$/gm,""),t=t.replace(/^\s*import\s+['"][^'"]+['"]\s*;?\s*$/gm,""),t=t.replace(/^\s*interface\s+\w+\s*\{[\s\S]*?\n\}\s*$/gm,""),t=t.replace(/^\s*type\s+\w+\s*=[\s\S]*?(?=\n(?:const|let|var|function|export|interface|type|$))/gm,""),t=t.replace(/^(\s*(?:export\s+)?(?:const|let|var)\s+)(\w+|\{[^}]+\}|\[[^\]]+\])\s*:\s*[^=]+(\s*=)/gm,"$1$2$3");function i(n){if(!n.includes(":"))return n;let c=[],l="",a=0,y=0,v=null;for(let E=0;E<n.length;E++){let A=n[E];if(v){if(l+=A,A===v)v=null;continue}if(A==='"'||A==="'"||A==="`"){v=A,l+=A;continue}if(A==="<")a++;else if(A===">"&&a>0)a--;else if(A==="(")y++;else if(A===")")y--;if(A===","&&a===0&&y===0){c.push(l),l="";continue}l+=A}if(l)c.push(l);return c.map((E)=>{let A=E.trim(),M=A.startsWith("..."),B=M?A.slice(3):A,D=-1,I=0;for(let te=0;te<B.length;te++)if(B[te]==="<")I++;else if(B[te]===">")I--;else if(B[te]===":"&&I===0){D=te;break}if(D===-1)return E;let Q=B.substring(0,D).trim().replace(/\?$/,""),X=B.substring(D+1),z=-1,L=0;for(let te=0;te<X.length;te++)if(X[te]==="<")L++;else if(X[te]===">")L--;else if(X[te]==="="&&L===0){z=te;break}let ee=M?"...":"";if(z!==-1)return`${ee}${Q} = ${X.substring(z+1).trim()}`;return`${ee}${Q}`}).join(", ")}t=t.replace(/\b(function\s+\w*\s*)\(([^)]*)\)/g,(n,c,l)=>{if(!l.includes(":"))return n;return`${c}(${i(l)})`});{let n=/\b(function\s+\w*\s*)\(/g,c,l=[];while((c=n.exec(t))!==null){let a=c.index+c[0].length-1,y=1,v=a+1,E=0,A=null;while(v<t.length&&y>0){let D=t[v];if(A){if(D===A)A=null;v++;continue}if(D==='"'||D==="'"||D==="`"){A=D,v++;continue}if(D==="<")E++;else if(D===">"&&E>0)E--;else if(E===0){if(D==="(")y++;else if(D===")")y--}if(y>0)v++}if(y!==0)continue;let M=t.substring(a+1,v);if(!M.includes(":"))continue;let B=i(M);l.push({start:a+1,end:v,replacement:B})}for(let a=l.length-1;a>=0;a--){let{start:y,end:v,replacement:E}=l[a];t=t.substring(0,y)+E+t.substring(v)}}return t=t.replace(/\(([^)]*)\)\s*(?::\s*[^=]+)?\s*=>/g,(n,c)=>{if(!c.includes(":"))return n;if(c.includes("{")||c.includes("}"))return n;return`(${c.split(",").map((a)=>{let[y,...v]=a.split("="),E=y.split(":")[0].trim();if(v.length>0)return`${E} = ${v.join("=").trim()}`;return E}).join(", ")}) =>`}),t=t.replace(/(\))\s*:\s*([A-Z]\w*|void|string|number|boolean|any|unknown|never|null|undefined)(?:<[^>]+>)?(?:\s*\|\s*(?:[A-Z]\w*|void|string|number|boolean|any|unknown|never|null|undefined))*\s*(\{)/g,"$1$3"),t=t.replace(/(\b(?:function|class|interface|type|extends|implements)\s+\w+)\s*<[^<>()]*>/g,"$1"),t=t.replace(/(\b(?:defineProps|withDefaults|defineEmits|defineSlots|Array|Promise|Map|Set|Record|Partial|Required|Readonly|Pick|Omit|Exclude|Extract))\s*<[^<>()]*>/g,"$1"),t=t.replace(/(\w+)\s*<[A-Z][^<>()]*>\s*(?=\()/g,"$1"),t=t.replace(/\s+as\s+(?:const|[A-Za-z]\w*(?:\[\])?(?:\s*\|\s*\w+(?:\[\])?)*)/g,""),t=t.replace(/\s+satisfies\s+\w+(?:<[^>]*>)?/g,""),t=t.replace(/(\w|\)|\])\s*!(?!=)/g,"$1"),t=t.replace(/^\s*(?:export\s+)?(?:const\s+)?enum\s+\w+\s*\{[^}]*\}\s*$/gm,""),t=t.replace(/(?<=[\s=,(])<[A-Z]\w*(?:\[\])?>/g,""),t=t.replace(/\n\s*\n\s*\n/g,`
|
|
402
402
|
|
|
403
|
-
`),t}function
|
|
404
|
-
`),
|
|
403
|
+
`),t}function Zf(e){return e.replace(/\s*(?:imported from|from)\s+(?:(['"])([^'"\r\n]+)\1|(\S+))/g,(t,...i)=>{let[,n,c]=i,l=n??c;return/(?:[/\\]packages[/\\]stx[/\\]|@stacksjs[/\\]stx[/\\])/.test(l)?"":t})}function Qf(e){return/cannot find module|cannot find package|could not resolve|module not found|failed to resolve/i.test(e)}function eg(e){if(e instanceof SyntaxError)return!0;let t=e instanceof Error?e.message:String(e);return/SyntaxError|Unexpected (token|identifier|string|number|keyword|end of)|Unterminated|Expected .+ but found/i.test(t)}function tg(e){if(!/is not defined|can't find variable/i.test(e))return!1;return!/\b(document|window|navigator|localStorage|sessionStorage|self)\b/.test(e)}var ko=new Set;async function m(e,t,i,n={}){if(!e.trim())return;let c=C(),l=x(e,JSON.stringify(c)),a=vo.get(l);if(a===void 0){try{let ne=Y({loader:"ts",target:"browser",define:c}),ie=e.replace(/^\s*import\s+\w+\s+from\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,"");ie=ie.replace(/^\s*import\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,""),a=ne.transformSync(ie)}catch{a=Yf(e)}vo.set(l,a)}let y={exports:{}},v=y.exports,E=kt.cwd(),A={},M=[...a.matchAll(/require\s*\(\s*['"]([^'"]+)['"]\s*\)/g)||[]].map((ne)=>ne[1]).filter((ne)=>!ne.startsWith("node:")&&!["fs","path","os","child_process","crypto","http","https","url","util","stream","events","buffer","net","querystring","zlib","tls"].includes(ne)),B=new Map;for(let ne of M)try{if(ne.startsWith(".")){A[ne]=await import(Qe.resolve(Qe.dirname(i),ne));continue}let ie=Qe.resolve(E,"node_modules",ne),ue=Qe.join(ie,"package.json"),$e=JSON.parse(g("fs").readFileSync(ue,"utf8")),Ce=$e.main||"index.js";if($e.exports){let qe=typeof $e.exports==="string"?$e.exports:$e.exports["."];if(typeof qe==="string")Ce=qe;else if(qe?.bun)Ce=qe.bun;else if(qe?.import)Ce=qe.import;else if(qe?.default)Ce=qe.default}A[ne]=await import(Qe.resolve(ie,Ce))}catch(ie){if(ne.startsWith("."))B.set(ne,ie instanceof Error?ie.message:String(ie))}let D=(ne)=>{if(A[ne])return A[ne];let ie=B.get(ne);if(ie!==void 0)throw Error(`Cannot require '${ne}' from ${i}: ${ie}`);return g(ne)},I=t.props||{},j=(ne)=>{if(!ne)return I;let ie={};for(let[ue,$e]of Object.entries(ne)){let Ce=I[ue];if(Ce!==void 0)ie[ue]=Ce;else if(typeof $e==="function")ie[ue]=$e();else ie[ue]=$e}return ie};for(let[ne,ie]of Object.entries(I))Object.defineProperty(j,ne,{value:ie,enumerable:!0,configurable:!0,writable:!0});let Q=(ne,ie=!1)=>{if(ne===void 0||ne===null)return ie;if(typeof ne==="string"){let ue=ne.trim().toLowerCase();if(ue===""||ue==="true"||ue==="1"||ue==="on"||ue==="yes")return!0;if(ue==="false"||ue==="0"||ue==="off"||ue==="no")return!1;return!0}return Boolean(ne)},X=(ne,ie=0)=>{if(ne===void 0||ne===null)return ie;if(typeof ne==="string"){let $e=ne.trim();if($e==="")return ie;let Ce=Number($e);return Number.isFinite(Ce)?Ce:ie}let ue=Number(ne);return Number.isFinite(ue)?ue:ie};for(let ne of["name","length","caller","arguments"]){if(Object.prototype.hasOwnProperty.call(I,ne))continue;try{Object.defineProperty(j,ne,{value:void 0,enumerable:!1,configurable:!0,writable:!0})}catch{}}let z=(ne)=>{if(!ne)return I;let ie={...I};for(let[ue,$e]of Object.entries(ne)){let Ce=$e&&typeof $e==="object"&&!Array.isArray($e)?$e:{type:$e};if(ie[ue]===void 0&&Ce.default!==void 0)ie[ue]=typeof Ce.default==="function"?Ce.default():Ce.default}return ie},L=()=>t.slots||{},ee=(ne,ie)=>{let ue={...ne};for(let[$e,Ce]of Object.entries(ie))if(ue[$e]===void 0)if(typeof Ce==="function")ue[$e]=Ce();else ue[$e]=Ce;return ue},te=(ne)=>{let ie=()=>ne;return ie.set=(ue)=>{},ie.update=(ue)=>{},ie},re=(ne)=>{let ie,ue=!1;return()=>{if(!ue)try{ie=ne(),ue=!0}catch{ie=void 0}return ie}},me=(ne)=>{},he=(ne)=>ne(),le=(ne)=>{},ke=(ne)=>{},Re=Fs(t);function He(ne){let ie=ne||{};if(ie.title!==void 0||ie.description!==void 0)pt({title:ie.title,description:ie.description})}function Xe(ne){if(!ne||typeof ne!=="object")return;let ie=t.__stxClientPayload??{};Object.assign(ie,ne),t.__stxClientPayload=ie}let Ze=()=>{let ne=t.__stxServeContext,ie=t.__stxServeSearch??ne?.search??"",ue=ne?.path??"",$e=Object.fromEntries(new URLSearchParams(ie)),Ce=t.query,qe=Object.keys($e).length>0?$e:Ce??{},nt=ie||(Object.keys(qe).length>0?`?${new URLSearchParams(qe).toString()}`:"");return{params:t.params??{},query:qe,path:ue,name:"",fullPath:ue+nt,hash:"",matched:[]}},Kn=()=>({push:(ne)=>{},replace:(ne)=>{},back:()=>{},forward:()=>{},go:(ne)=>{}}),ft=(ne)=>{let ie=t.__stx_runtime_head||{};t.__stx_runtime_head=Ve(ie,_e(ne||{},{known:Js,source:"useHead()"}))},pt=(ne)=>{ft(Ys(ne||{}))},dt=(ne)=>({value:ne}),Ct=(ne)=>ne,tr=(ne)=>({value:typeof ne==="function"?ne():ne}),it=(ne,ie)=>{},We=(ne)=>{},Tt=(ne)=>{},sn=(ne)=>ne?ne():Promise.resolve(),Xn=(ne)=>(ie,...ue)=>{},Dt=(ne)=>{},Je=(ne,ie)=>{},Lt=(ne,ie)=>ie,Jn=()=>({value:"light"}),bt=()=>te(!1),et=(ne)=>te(!1),Bt=()=>te(!1),rn=()=>et("(prefers-color-scheme: dark)"),Wt=()=>et("(prefers-color-scheme: light)"),zt=()=>et("(prefers-reduced-motion: reduce)"),nr=()=>et("(prefers-contrast: more)"),Ge={siteId:void 0,API_ENDPOINT:"",ANALYTICS_SITE_ID:void 0,location:{href:"",pathname:"",search:"",hash:"",origin:"",host:"",hostname:"",protocol:"https:",assign:()=>{},replace:()=>{},reload:()=>{}},localStorage:{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{}},sessionStorage:{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{}},fetch:globalThis.fetch,addEventListener:()=>{},removeEventListener:()=>{},setTimeout:()=>0,clearTimeout:()=>{},setInterval:()=>0,clearInterval:()=>{},requestAnimationFrame:()=>0,cancelAnimationFrame:()=>{},alert:()=>{},confirm:()=>!1,prompt:()=>null,getComputedStyle:()=>({}),matchMedia:()=>({matches:!1,addListener:()=>{},removeListener:()=>{}}),getDateRangeParams:()=>"",stx:{}},Ft=new Proxy(Ge,{get(ne,ie){if(ie in ne)return ne[ie];return},set(ne,ie,ue){return ne[ie]=ue,!0}}),Gn={getElementById:()=>null,querySelector:()=>null,querySelectorAll:()=>[],createElement:()=>({}),createTextNode:()=>({}),body:{},head:{},documentElement:{},addEventListener:()=>{},removeEventListener:()=>{}},tt=console;try{let ne=gi(a,i),ie=new Set(Object.keys(I)),ue=Object.keys(t).filter((se)=>!ie.has(se)&&!Ll.has(se)&&jt(se)),$e=ue.map((se)=>t[se]);if(!ue.includes("__stxServeContext"))ue.push("__stxServeContext"),$e.push(void 0);if(!ie.has("cookies")){let se=t.cookies??t.__stxServeContext?.cookies??{},ae=ue.indexOf("cookies");if(ae<0)ue.push("cookies"),$e.push(se);else $e[ae]=se}let Ce=new Set(["async","module","exports","require","params","window","document","console","state","derived","effect"]),qe=[],nt=[];for(let[se,ae]of Object.entries(I)){if(!jt(se))continue;if(Ce.has(se))continue;if(new RegExp(`(?:^|[\\s;{])(?:const|let|var|function)\\s+${se}\\b`).test(ne))continue;qe.push(se),nt.push(ae)}let Qn=Wl(ne).map((se)=>`module.exports.${se} = typeof ${se} !== 'undefined' ? ${se} : module.exports.${se};`).join(`
|
|
404
|
+
`),on=t.params??{},Ut=[],Vt=[];for(let se=0;se<ue.length;se++){if(ue[se]==="params")continue;Ut.push(ue[se]),Vt.push($e[se])}let cn=[...hn,...qe,...Ut],an=`return (async () => {
|
|
405
405
|
${ne}
|
|
406
|
-
${
|
|
406
|
+
${Qn}
|
|
407
407
|
return module.exports
|
|
408
|
-
})()`,Ye=x(cn
|
|
409
|
-
`),l=[],a=0;while(a<c.length){let y=c[a].trim();if(y.startsWith("interface ")||y.startsWith("export interface ")||y.startsWith("type ")||y.startsWith("export type ")){if(y.includes("{")&&!y.includes("}")){let v=0;for(;a<c.length;a++){for(let E of c[a])if(E==="{")v++;else if(E==="}")v--;if(v<=0)break}}a++;continue}if(y.startsWith("definePageMeta(")){let v=0,E=!1,A=a;for(let
|
|
410
|
-
`),B=[];for(let
|
|
411
|
-
`+
|
|
412
|
-
`),i,n)}function Fl(e,t,i){let n=e.length,c="",l=0,a=null,y=!1,v=!1,E=0;while(l<n){let A=e[l],
|
|
413
|
-
`)y=!1;l++;continue}if(v){if(c+=A,A==="*"&&
|
|
408
|
+
})()`,Ye=x(an,cn.join("\x00")),ot=Eo.get(Ye);if(!ot)ot=Function(...cn,an),Eo.set(Ye,ot);let st=t.__stx_options?.runtimeConfig;if(st||/\buse(?:Server)?RuntimeConfig\b/.test(a))await vn(t,i,st);let Ke=await ze(t.__stx_runtime_config??xn()??N(),()=>ar(t,()=>ot(y,v,D,I,j,Q,X,z,ee,Xe,lr,xi,Ws,te,re,me,he,le,ke,He,Ze,Kn,ft,pt,Re.setResponseStatus,Re.setResponseHeader,Re.notFound,dt,Ct,tr,it,We,Tt,sn,Xn,Dt,L,Je,Lt,Jn,bt,et,Bt,rn,Wt,zt,nr,Ft,Gn,tt,Ge.confirm,Ge.alert,Ge.fetch,on,...nt,...Vt)));if(n.preserveExisting){for(let[se,ae]of Object.entries(Ke))if(!(se in t)||t[se]===void 0)t[se]=ae}else Object.assign(t,Ke);for(let[se,ae]of Object.entries(I))if(!(se in t))t[se]=ae}catch(ne){if(t.__stx_strict_hydration)throw ne;let ie=Zf(ne instanceof Error?ne.message:String(ne));if(Qf(ie))console.warn(`[stx] server <script> in ${i??"<unknown>"} imports a module that does not resolve, so every variable in that script is undefined. Cause: ${ie}`),n.onFailure?.({kind:"module-resolution",message:ie,error:ne});else if(eg(ne))console.warn(`[stx] server <script> in ${i??"<unknown>"} does not parse, so every variable in that script is undefined. Cause: ${ie}`),n.onFailure?.({kind:"syntax",message:ie,error:ne});else if(tg(ie))console.warn(`[stx] server <script> in ${i??"<unknown>"} names something that does not exist, so every variable in that script is undefined. Optional chaining does not help here: an undefined identifier throws before the chain is reached. Cause: ${ie}`),n.onFailure?.({kind:"missing-binding",message:ie,error:ne});else{let ue=`${i??"<unknown>"}\x00${ie}`;if(kt.env.STX_DEBUG||!ko.has(ue))ko.add(ue),console.warn(`[stx] server <script> in ${i??"<unknown>"} threw, so every variable in that script is undefined and anything that reads one renders empty. Cause: ${ie}`);n.onFailure?.({kind:"unknown",message:ie,error:ne})}try{await Zl(a,t,i)}catch(ue){if(kt.env.STX_DEBUG){let $e=ue instanceof Error?ue.message:String(ue);console.warn(`[stx] fallback extraction also failed in ${i??"<unknown>"}: ${$e}`)}}}}function ng(e){let t=0,i=null,n=!1,c=!1;for(let l=0;l<e.length;l++){let a=e[l];if(i){if(a===i){if(i=null,n||t===0)c=!0}continue}if(a==="'"||a==='"'||a==="`"){i=a;continue}if(a==="{")t++;else if(a==="}")t--;else if(e.startsWith("from",l)&&t===0)n=!0}return i===null&&t===0&&c}var zl=/^(?:export\s+)?(?:const|let|var)\s+[A-Za-z_$][\w$]*(?:\s*,\s*[A-Za-z_$][\w$]*)*\s*;?$/;function gi(e,t){let i=t?Qe.dirname(t):kt.cwd(),n=kt.cwd(),c=e.split(`
|
|
409
|
+
`),l=[],a=0;while(a<c.length){let y=c[a].trim();if(y.startsWith("interface ")||y.startsWith("export interface ")||y.startsWith("type ")||y.startsWith("export type ")){if(y.includes("{")&&!y.includes("}")){let v=0;for(;a<c.length;a++){for(let E of c[a])if(E==="{")v++;else if(E==="}")v--;if(v<=0)break}}a++;continue}if(y.startsWith("definePageMeta(")){let v=0,E=!1,A=a;for(let D=a;D<c.length&&!E;D++){let I=null,j=!1,Q=c[D];for(let X=0;X<Q.length;X++){let z=Q[X];if(j){j=!1;continue}if(z==="\\"){j=!0;continue}if(I){if(z===I)I=null;continue}if(z==='"'||z==="'"||z==="`"){I=z;continue}if(z==="(")v++;else if(z===")"){if(v--,v===0){a=D+1,E=!0;break}}}}if(!E)a=c.length;let M=c.slice(A,a).join(`
|
|
410
|
+
`),B=[];for(let D of["title","description"]){let I=new RegExp(`\\b${D}\\s*:\\s*(['"\`])((?:\\\\.|(?!\\1)[^\\\\])*)\\1`).exec(M);if(I)B.push(`${D}: ${JSON.stringify(I[2])}`)}if(B.length>0)l.push(`useSeoMeta({ ${B.join(", ")} });`);continue}if(y.startsWith("import ")||y==="import"||y.startsWith("import{")||/^import['"]/.test(y)){let v=y,E=0;while(!ng(v)&&a+E+1<c.length)E++,v=`${v} ${c[a+E].trim()}`;a+=E;let A=v.match(/^import\s+(\w+)\s+from\s+['"](.+?)['"]/),M=v.match(/^import\s+\{([^}]*)\}\s+from\s+['"](.+?)['"]/),B=v.match(/^import\s*['"](.+?)['"]/),D=v,I=(j)=>{if(j.startsWith("."))return Qe.resolve(i,j);if(j.startsWith("~/")||j.startsWith("@/"))return Qe.resolve(n,j.slice(2));try{return Bun.resolveSync(j,i)}catch{return j}};if(A){let[,j,Q]=A,X=I(Q);l.push(`const ${j} = (await import('${X}')).default`),l.push(`module.exports.${j} = ${j};`)}else if(M){let[,j,Q]=M,X=I(Q),z=[],L=[],ee=Bl.has(Q);for(let te of j.split(",")){let re=te.trim();if(!re)continue;let me=re.split(/\s+as\s+/);if(me.length===2){let[he,le]=[me[0].trim(),me[1].trim()];if(ee&&$o.has(he)){l.push(`const ${le} = ${he};`);continue}z.push(`${he}: ${le}`),L.push(le)}else{if(ee&&$o.has(re))continue;z.push(re),L.push(re)}}if(z.length>0)l.push(`const { ${z.join(", ")} } = await import('${X}')`);for(let te of L)l.push(`module.exports.${te} = ${te};`)}else if(B){let j=I(B[1]);l.push(`await import('${j}')`)}else l.push(D);a++;continue}if(zl.test(y))l.push(c[a]),a++;else if(y.startsWith("export const ")||y.startsWith("export let ")||y.startsWith("export var ")){let v=Co(c,a),{type:E,name:A,value:M}=v;l.push(`${E} ${A} = ${M};`),l.push(`module.exports.${A} = ${A};`),a=v.nextIndex}else if(y.startsWith("export function ")||y.startsWith("export async function ")){let v=er(c,a);l.push(v.functionCode),l.push(`module.exports.${v.name} = ${v.name};`),a=v.nextIndex}else if(y.startsWith("const ")||y.startsWith("let ")||y.startsWith("var ")){let v=Co(c,a),{type:E,name:A,value:M}=v;l.push(`${E} ${A} = ${M};`),l.push(`module.exports.${A} = ${A};`),a=v.nextIndex}else if(y.startsWith("function ")||y.startsWith("async function ")){let v=er(c,a);l.push(v.functionCode),l.push(`module.exports.${v.name} = ${v.name};`),a=v.nextIndex}else if(y.startsWith("export default function ")||y.startsWith("export default async function ")){let v=c[a].replace(/^(\s*)export\s+default\s+/,"$1"),E=[...c];E[a]=v;let A=er(E,a);if(l.push(A.functionCode),A.name)l.push(`module.exports.default = ${A.name};`);a=A.nextIndex}else if(y.startsWith("export default ")){let v=y.replace(/^export\s+default\s+/,"").replace(/;$/,"");l.push(`module.exports.default = ${v};`),a++}else if(y.startsWith("class ")||y.startsWith("export class ")){let v=y.match(/(?:export\s+)?class\s+(\w+)/);if(v){let E=v[1],A=c[a].replace(/^export\s+/,""),M=0,B=a;for(;B<c.length;B++){let D=c[B];for(let I of D)if(I==="{")M++;else if(I==="}")M--;if(B>a)A+=`
|
|
411
|
+
`+D;if(M<=0&&B>=a)break}l.push(A),l.push(`module.exports.${E} = ${E};`),a=B+1}else l.push(y),a++}else if(y.includes("module.exports"))l.push(y),a++;else if(y.trim()&&!y.startsWith("//"))l.push(y),a++;else a++}return Fl(l.join(`
|
|
412
|
+
`),i,n)}function Fl(e,t,i){let n=e.length,c="",l=0,a=null,y=!1,v=!1,E=0;while(l<n){let A=e[l],M=e[l+1];if(y){if(c+=A,A===`
|
|
413
|
+
`)y=!1;l++;continue}if(v){if(c+=A,A==="*"&&M==="/"){c+=M,l+=2,v=!1;continue}l++;continue}if(!a&&A==="/"&&M==="/"){y=!0,c+=A,l++;continue}if(!a&&A==="/"&&M==="*"){v=!0,c+=A,l++;continue}if(a){if(c+=A,A==="\\"){c+=M,l+=2;continue}if(A===a&&a!=="`"){a=null,l++;continue}if(a==="`"){if(A==="$"&&M==="{"){E++,c+=M,l+=2;continue}if(A==="`"){a=null,l++;continue}}l++;continue}if(E>0){if(A==="{")E++;else if(A==="}")E--}if(A==='"'||A==="'"||A==="`"){a=A,c+=A,l++;continue}if(A==="a"&&e.startsWith("await",l)){let B=Ul(e,l);if(B){let{quote:D,path:I,end:j}=B;if(I.startsWith(".")||I.startsWith("~/")||I.startsWith("@/")){let Q=I.startsWith(".")?Qe.resolve(t,I):Qe.resolve(i,I.slice(2));c+=`await import(${D}${Q}${D})`,l=j;continue}}}c+=A,l++}return c}function Ul(e,t){let i=t+5;if(i>=e.length)return null;if(!/\s/.test(e[i]))return null;while(i<e.length&&/\s/.test(e[i]))i++;if(!e.startsWith("import",i))return null;i+=6;while(i<e.length&&/\s/.test(e[i]))i++;if(e[i]!=="(")return null;i++;while(i<e.length&&/\s/.test(e[i]))i++;let n=e[i];if(n!=="'"&&n!=='"')return null;i++;let c=i;while(i<e.length&&e[i]!==n)if(e[i]==="\\")i+=2;else i++;if(i>=e.length)return null;let l=e.slice(c,i);i++;while(i<e.length&&/\s/.test(e[i]))i++;if(e[i]!==")")return null;return{quote:n,path:l,end:i+1}}function Oo(e,t){let i=e[t];if(i!=="{"&&i!=="[")return null;let c=w(e,i,i==="{"?"}":"]",t);if(c===-1)return null;return{pattern:e.slice(t,c+1),endPos:c+1}}function Po(e){let t=[],i=e.slice(1,-1).trim();if(!i)return t;let n=0,c=0,l="";while(n<i.length){let a=i[n];if(a==="{"||a==="["){let y=c===0?Oo(i,n):null;if(y){t.push(...Po(y.pattern)),n=y.endPos,l="";continue}c++}else if(a==="}"||a==="]")c--;if(c>0){n++;continue}if(a===","){if(l.trim())t.push(l.trim());l="",n++;continue}if(a===":"){l="",n++;continue}if(a==="="){if(l.trim())t.push(l.trim());l="",n++;while(n<i.length&&i[n]!==","&&c===0){if(i[n]==="{"||i[n]==="[")c++;else if(i[n]==="}"||i[n]==="]")c--;n++}continue}if(/[\w$]/.test(a))l+=a;n++}if(l.trim())t.push(l.trim());return t}function rg(e){let t=/^(?:export\s+)?(const|let|var)\s+([A-Za-z_$][\w$]*)/.exec(e);if(!t)return null;let i=t[0].length,n=(c)=>c===" "||c==="\t";while(i<e.length&&n(e[i]))i++;if(e[i]===":"){let c=0,l=null;i++;for(;i<e.length;i++){let a=e[i];if(l){if(a==="\\"){i++;continue}if(a===l)l=null;continue}if(a==="'"||a==='"'||a==="`"){l=a;continue}if(a==="("||a==="["||a==="{"||a==="<"){c++;continue}if(a===")"||a==="]"||a==="}"||a===">"){c--;continue}if(a==="="&&c<=0){let y=e[i+1],v=e[i-1];if(y!=="="&&y!==">"&&v!=="="&&v!=="!"&&v!=="<"&&v!==">")break}}if(e[i]!=="=")return null}while(i<e.length&&n(e[i]))i++;if(e[i]!=="=")return null;return{type:t[1],name:t[2],value:e.slice(i+1).trim()}}function Ro(e,t,i,n){let c=null,l=!1;for(let a of e){if(l){l=!1;continue}if(a==="\\"){l=!0;continue}if(c){if(a===c)c=null;continue}if(a==="'"||a==='"'||a==="`"){c=a;continue}if(a===t)n++;else if(a===i)n--}return n}function Co(e,t){let i=e[t].trim(),n=rg(i),c=n?[i,n.type,n.name,n.value]:null;if(!c){let A=i.match(/^(?:export\s+)?(const|let|var)\s+/);if(A){let M=i.slice(A[0].length),B=t;if(M.startsWith("{")||M.startsWith("[")){let I=M[0],j=I==="{"?"}":"]",Q=Ro(M,I,j,0),X=M;for(let z=t+1;z<e.length&&Q>0;z++)X+=` ${e[z].trim()}`,B=z,Q=Ro(e[z],I,j,Q);if(Q>0)X=M,B=t;M=X}let D=Oo(M,0);if(D){let I=A[1],j=D.pattern,Q=M.slice(D.endPos).trim();if(Q.startsWith("=")){let X=Q.slice(1).trim(),z=X,L=Math.max(B,t);if(Ao(X)){let me=To(e,L,X);z=me.value,L=me.nextIndex}else L=L+1;z=z.trim().replace(/;$/,"");let ee=Po(j),te=`__stx_src_${t}`,re=ee.map((me)=>`module.exports.${me} = ${me};`).join(`
|
|
414
414
|
`);return{type:I,name:te,value:`${z}; ${I} ${j} = ${te};
|
|
415
|
-
${re}`,nextIndex:L}}}}throw Error(`Failed to parse variable declaration: ${i}`)}let[,l,a,y]=c,v=y,E=t;if(
|
|
416
|
-
${e[E]}`,E++;else break}return v=v.trim().replace(/;$/,""),{type:l,name:a,value:v,nextIndex:E}}function
|
|
415
|
+
${re}`,nextIndex:L}}}}throw Error(`Failed to parse variable declaration: ${i}`)}let[,l,a,y]=c,v=y,E=t;if(Ao(y)){let A=To(e,t,y);v=A.value,E=A.nextIndex}else E=t+1;while(E<e.length){let A=e[E].trim();if(A.startsWith(".")||A.startsWith("?."))v+=`
|
|
416
|
+
${e[E]}`,E++;else break}return v=v.trim().replace(/;$/,""),{type:l,name:a,value:v,nextIndex:E}}function er(e,t){let i=e[t].trim(),n=i.match(/^(?:export\s+)?(?:async\s+)?function\s+(\w+)/);if(!n)throw Error(`Failed to parse function declaration: ${i}`);let[,c]=n,l=i.replace(/^export\s+/,""),a=t;if(Vl(i)){let y=Hl(e,t,l);l=y.functionCode,a=y.nextIndex}else a=t+1;return{name:c,functionCode:l,nextIndex:a}}function Ao(e){let t=e.trim();if(t.startsWith("{"))return w(t,"{","}",0)===-1;if(t.startsWith("["))return w(t,"[","]",0)===-1;return!Do(t)}function Do(e){let t={paren:0,bracket:0,brace:0},i=null,n=0;for(let c=0;c<e.length;c++){let l=e[c];if((c>0?e[c-1]:"")==="\\"&&i)continue;if((l==='"'||l==="'")&&!i){i=l;continue}if(l===i&&i!=="`"){i=null;continue}if(l==="`"&&!i){i="`";continue}if(l==="`"&&i==="`"&&n===0){i=null;continue}if(i==="`"&&l==="$"&&e[c+1]==="{"){n++,c++;continue}if(n>0&&l==="{"){n++;continue}if(n>0&&l==="}"){n--;continue}if(i)continue;if(l==="(")t.paren++;else if(l===")")t.paren--;else if(l==="[")t.bracket++;else if(l==="]")t.bracket--;else if(l==="{")t.brace++;else if(l==="}")t.brace--}return t.paren===0&&t.bracket===0&&t.brace===0&&i===null}function Mo(e){let t=e.indexOf("(");if(t===-1)return e.indexOf("{");let i=w(e,"(",")",t);if(i===-1)return-1;return e.indexOf("{",i)}function Vl(e){let t=Mo(e);if(t===-1)return!0;return w(e,"{","}",t)===-1}function To(e,t,i){let n=i,c=t+1;while(c<e.length&&!Do(n)){let l=e[c];n+=`
|
|
417
417
|
${l}`,c++}while(c<e.length){let l=e[c].trim();if(l.startsWith(".")||l.startsWith("?."))n+=`
|
|
418
418
|
${e[c]}`,c++;else break}return{value:n,nextIndex:c}}function Hl(e,t,i){let n=i,c=t+1;while(c<e.length){let l=Mo(n);if(l!==-1){if(w(n,"{","}",l)!==-1)break}let a=e[c];n+=`
|
|
419
|
-
${a}`,c++}return{functionCode:n,nextIndex:c}}function Io(e,t){let i=u(e,t)??u(`(${e})`,t);if(i!==void 0)return i;if(!/\bprocess\b/.test(e))return;let n={...t,process:Object.freeze({env:{...kt.env}})},c=Object.keys(n).filter(jt),l=c.map((a)=>n[a]);try{return Function(...c,`'use strict'; return (${e});`)(...l)}catch{try{return Function(...c,`'use strict'; return ${e};`)(...l)}catch{return}}}async function Zl(e,t,i){let n=e.matchAll(/export\s+(const|let|var)\s+(\w+)\s*=\s*([\s\S]*?)(?=\s*(?:export\s+|$))/g);for(let l of n){let[,,a,y]=l;try{let v=y.trim().replace(/;$/,""),E=Io(v,t);if(E!==void 0)t[a]=E}catch(v){console.warn(`Failed to parse export ${a} in fallback:`,v)}}let c=e.matchAll(/(?:^|\n)\s*(const|let|var)\s+(\w+)\s*=\s*([\s\S]*?)(?=\s*(?:(?:const|let|var|function|export)\s+|$))/g);for(let l of c){let[,,a,y]=l;if(!(a in t))try{let v=y.trim().replace(/;$/,""),E=Io(v,t);if(E!==void 0)t[a]=E}catch{}}}function
|
|
420
|
-
export{Pe,ve,H,Is,Os,V,yr,Ns,Ms,oi,ii,Ds,ai,
|
|
419
|
+
${a}`,c++}return{functionCode:n,nextIndex:c}}function Io(e,t){let i=u(e,t)??u(`(${e})`,t);if(i!==void 0)return i;if(!/\bprocess\b/.test(e))return;let n={...t,process:Object.freeze({env:{...kt.env}})},c=Object.keys(n).filter(jt),l=c.map((a)=>n[a]);try{return Function(...c,`'use strict'; return (${e});`)(...l)}catch{try{return Function(...c,`'use strict'; return ${e};`)(...l)}catch{return}}}async function Zl(e,t,i){let n=e.matchAll(/export\s+(const|let|var)\s+(\w+)\s*=\s*([\s\S]*?)(?=\s*(?:export\s+|$))/g);for(let l of n){let[,,a,y]=l;try{let v=y.trim().replace(/;$/,""),E=Io(v,t);if(E!==void 0)t[a]=E}catch(v){console.warn(`Failed to parse export ${a} in fallback:`,v)}}let c=e.matchAll(/(?:^|\n)\s*(const|let|var)\s+(\w+)\s*=\s*([\s\S]*?)(?=\s*(?:(?:const|let|var|function|export)\s+|$))/g);for(let l of c){let[,,a,y]=l;if(!(a in t))try{let v=y.trim().replace(/;$/,""),E=Io(v,t);if(E!==void 0)t[a]=E}catch{}}}function Uc(e){let t=e.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i),i=t?t[1]:"",n=t?e.replace(/<script\b[^>]*>[\s\S]*?<\/script>/i,""):e;return{scriptContent:i,templateWithoutScript:n}}function Wc(e){let t=e.trim();if(!t)return!1;return/(?:const|let|var|function)\s+\w+/.test(t)}
|
|
420
|
+
export{Pe,ve,H,Is,Os,V,yr,Ns,Ms,oi,ii,Ds,ai,$c,Rt,Ie,o,dn,b,Rc,x,br,Ls,xe,C,Oe,de,wr,W,pn,Ne,S,Ac,pe,G,vr,xr,oe,At,J,O,rt,Sr,kr,Pt,ci,js,Jf,Me,Pc,Ic,Oc,li,Nc,_r,ui,Mc,Dc,di,pi,fn,Bs,gn,It,Ot,Lc,Fs,jc,mn,Cr,zs,Hs,Bc,fi,Fc,zc,Hc,Vc,hn,Yf,Zf,Qf,eg,tg,m,ng,gi,rg,Uc,Wc,mi,hi,sg,Nt,qc,og,Kc,Kh,De,yn,Le,ig,ag,cg,lg,ug,Vs,dg,je,Y,Be,pg,Er,fg,Xc,Gc,yi,Fe,s,bn,Jc,h,fe,Xh,Yc,Zc,Qc,bi,Us,gg,Gh,mg,Jh,Mt,p,U,Z,wn,Se,hg,wi,yg,Yh,_,bg,Zh,T,Qh};
|