@stacksjs/stx 0.2.172 → 0.2.173

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/pwa.js CHANGED
@@ -3730,7 +3730,7 @@ catch (e) {
3730
3730
  }
3731
3731
  throw e;
3732
3732
  }
3733
- `),J.set(U,W)}return W(...q)}catch{return}}};if(this.pool.length<this.maxPoolSize)this.pool.push({func:Q,context:$.slice()});return Q}clear(){this.pool.length=0,this.fnCache.clear()}}class o6{metrics=new Map;budgets=new Map;violations=[];maxViolations=100;violationHandlers=[];enabled=!0;setEnabled(X){this.enabled=X}isEnabled(){return this.enabled}setBudget(X,$){this.budgets.set(X,{warnThreshold:0.8,action:"warn",...$})}setBudgets(X){for(let[$,Z]of Object.entries(X))this.setBudget($,Z)}removeBudget(X){this.budgets.delete(X)}getBudgets(){let X={};for(let[$,Z]of this.budgets.entries())X[$]=Z;return X}onViolation(X){this.violationHandlers.push(X)}offViolation(X){let $=this.violationHandlers.indexOf(X);if($!==-1)this.violationHandlers.splice($,1)}time(X,$){if(!this.enabled)return $();let Z=performance.now(),Y=$(),J=performance.now()-Z;return this.recordTime(X,J),this.checkBudget(X,J),Y}async timeAsync(X,$){if(!this.enabled)return $();let Z=performance.now(),Y=await $(),J=performance.now()-Z;return this.recordTime(X,J),this.checkBudget(X,J),Y}checkBudget(X,$){let Z=this.budgets.get(X);if(!Z)return;let Y=$/Z.maxTime*100,J=Z.warnThreshold!==void 0?$>=Z.maxTime*Z.warnThreshold&&$<Z.maxTime:!1,G=$>=Z.maxTime;if(!J&&!G)return;let Q={label:X,actualTime:$,budgetTime:Z.maxTime,exceedancePercent:Y,timestamp:new Date,isWarning:J};this.violations.push(Q);while(this.violations.length>this.maxViolations)this.violations.shift();for(let K of this.violationHandlers)try{K(Q)}catch{}let q=J?`[Performance Warning] "${X}" took ${$.toFixed(2)}ms (${Y.toFixed(1)}% of ${Z.maxTime}ms budget)`:`[Performance Budget Exceeded] "${X}" took ${$.toFixed(2)}ms (exceeded ${Z.maxTime}ms budget by ${(Y-100).toFixed(1)}%)`;switch(Z.action){case"log":console.log(q);break;case"warn":console.warn(q);break;case"error":console.error(q);break;case"throw":if(G)throw Error(q);else console.warn(q);break}}recordTime(X,$){let Z=this.metrics.get(X);if(Z)Z.count++,Z.totalTime+=$,Z.maxTime=Math.max(Z.maxTime,$),Z.minTime=Math.min(Z.minTime,$);else this.metrics.set(X,{count:1,totalTime:$,maxTime:$,minTime:$})}getStats(X){if(X){let Z=this.metrics.get(X);if(!Z)return{};let Y=this.budgets.get(X);return{count:Z.count,avgTime:Z.totalTime/Z.count,totalTime:Z.totalTime,maxTime:Z.maxTime,minTime:Z.minTime,budget:Y?.maxTime,budgetUtilization:Y?Z.totalTime/Z.count/Y.maxTime*100:void 0}}let $={};for(let[Z,Y]of this.metrics.entries()){let J=this.budgets.get(Z);$[Z]={count:Y.count,avgTime:Y.totalTime/Y.count,totalTime:Y.totalTime,maxTime:Y.maxTime,minTime:Y.minTime,budget:J?.maxTime,budgetUtilization:J?Y.totalTime/Y.count/J.maxTime*100:void 0}}return $}getViolations(X){if(X)return this.violations.filter(($)=>$.label===X);return[...this.violations]}getViolationStats(){let X={},$=0,Z=0;for(let Y of this.violations)if(X[Y.label]=(X[Y.label]||0)+1,Y.isWarning)$++;else Z++;return{total:this.violations.length,byLabel:X,warnings:$,errors:Z}}clear(){this.metrics.clear()}clearViolations(){this.violations.length=0}clearBudgets(){this.budgets.clear()}reset(){this.clear(),this.clearViolations(),this.clearBudgets(),this.violationHandlers.length=0}}function PW(){if(!o$)o$=new o6;return o$}var N5,CW=500,PV,o$=null,s6;var M5=E(()=>{N5=new Map;PV=new r6;s6=new Proxy({},{get(X,$){return PW()[$]}})});function a6(X,$=""){let Z=`${X}${$}`,Y=0;for(let J=0;J<Z.length;J++){let G=Z.charCodeAt(J);Y=(Y<<5)-Y+G,Y=Y&Y}return`stx-${Math.abs(Y).toString(36)}`}function t6(X,$,Z={}){let{prefix:Y="",preserveHost:J=!0,scopeKeyframes:G=!0,scopeCustomProperties:Q=!1}=Z;if(!X.trim())return"";let q=s$(X),K=[],U=new Map;if(G)for(let W of q){let w=W.selector.match(/@keyframes\s+([a-z_-][a-z0-9_-]*)/i);if(w){let z=w[1],B=`${$}_${z}`;U.set(z,B)}}for(let W of q){let w=e6(W,$,Y,J,U,Q);K.push(w)}return K.join(`
3733
+ `),J.set(U,W)}return W(...q)}catch{return}}};if(this.pool.length<this.maxPoolSize)this.pool.push({func:Q,context:$.slice()});return Q}clear(){this.pool.length=0,this.fnCache.clear()}}class o6{metrics=new Map;budgets=new Map;violations=[];maxViolations=100;violationHandlers=[];enabled=!0;setEnabled(X){this.enabled=X}isEnabled(){return this.enabled}setBudget(X,$){this.budgets.set(X,{warnThreshold:0.8,action:"warn",...$})}setBudgets(X){for(let[$,Z]of Object.entries(X))this.setBudget($,Z)}removeBudget(X){this.budgets.delete(X)}getBudgets(){let X={};for(let[$,Z]of this.budgets.entries())X[$]=Z;return X}onViolation(X){this.violationHandlers.push(X)}offViolation(X){let $=this.violationHandlers.indexOf(X);if($!==-1)this.violationHandlers.splice($,1)}time(X,$){if(!this.enabled)return $();let Z=performance.now(),Y=$(),J=performance.now()-Z;return this.recordTime(X,J),this.checkBudget(X,J),Y}async timeAsync(X,$){if(!this.enabled)return $();let Z=performance.now(),Y=await $(),J=performance.now()-Z;return this.recordTime(X,J),this.checkBudget(X,J),Y}checkBudget(X,$){let Z=this.budgets.get(X);if(!Z)return;let Y=$/Z.maxTime*100,J=Z.warnThreshold!==void 0?$>=Z.maxTime*Z.warnThreshold&&$<Z.maxTime:!1,G=$>=Z.maxTime;if(!J&&!G)return;let Q={label:X,actualTime:$,budgetTime:Z.maxTime,exceedancePercent:Y,timestamp:new Date,isWarning:J};this.violations.push(Q);while(this.violations.length>this.maxViolations)this.violations.shift();for(let K of this.violationHandlers)try{K(Q)}catch{}let q=J?`[Performance Warning] "${X}" took ${$.toFixed(2)}ms (${Y.toFixed(1)}% of ${Z.maxTime}ms budget)`:`[Performance Budget Exceeded] "${X}" took ${$.toFixed(2)}ms (exceeded ${Z.maxTime}ms budget by ${(Y-100).toFixed(1)}%)`;switch(Z.action){case"log":console.log(q);break;case"warn":console.warn(q);break;case"error":console.error(q);break;case"throw":if(G)throw Error(q);else console.warn(q);break}}recordTime(X,$){let Z=this.metrics.get(X);if(Z)Z.count++,Z.totalTime+=$,Z.maxTime=Math.max(Z.maxTime,$),Z.minTime=Math.min(Z.minTime,$);else this.metrics.set(X,{count:1,totalTime:$,maxTime:$,minTime:$})}getStats(X){if(X){let Z=this.metrics.get(X);if(!Z)return{};let Y=this.budgets.get(X);return{count:Z.count,avgTime:Z.totalTime/Z.count,totalTime:Z.totalTime,maxTime:Z.maxTime,minTime:Z.minTime,budget:Y?.maxTime,budgetUtilization:Y?Z.totalTime/Z.count/Y.maxTime*100:void 0}}let $={};for(let[Z,Y]of this.metrics.entries()){let J=this.budgets.get(Z);$[Z]={count:Y.count,avgTime:Y.totalTime/Y.count,totalTime:Y.totalTime,maxTime:Y.maxTime,minTime:Y.minTime,budget:J?.maxTime,budgetUtilization:J?Y.totalTime/Y.count/J.maxTime*100:void 0}}return $}getViolations(X){if(X)return this.violations.filter(($)=>$.label===X);return[...this.violations]}getViolationStats(){let X={},$=0,Z=0;for(let Y of this.violations)if(X[Y.label]=(X[Y.label]||0)+1,Y.isWarning)$++;else Z++;return{total:this.violations.length,byLabel:X,warnings:$,errors:Z}}clear(){this.metrics.clear()}clearViolations(){this.violations.length=0}clearBudgets(){this.budgets.clear()}reset(){this.clear(),this.clearViolations(),this.clearBudgets(),this.violationHandlers.length=0}}function PW(){if(!o$)o$=new o6;return o$}var N5,CW=500,xV,o$=null,s6;var M5=E(()=>{N5=new Map;xV=new r6;s6=new Proxy({},{get(X,$){return PW()[$]}})});function a6(X,$=""){let Z=`${X}${$}`,Y=0;for(let J=0;J<Z.length;J++){let G=Z.charCodeAt(J);Y=(Y<<5)-Y+G,Y=Y&Y}return`stx-${Math.abs(Y).toString(36)}`}function t6(X,$,Z={}){let{prefix:Y="",preserveHost:J=!0,scopeKeyframes:G=!0,scopeCustomProperties:Q=!1}=Z;if(!X.trim())return"";let q=s$(X),K=[],U=new Map;if(G)for(let W of q){let w=W.selector.match(/@keyframes\s+([a-z_-][a-z0-9_-]*)/i);if(w){let z=w[1],B=`${$}_${z}`;U.set(z,B)}}for(let W of q){let w=e6(W,$,Y,J,U,Q);K.push(w)}return K.join(`
3734
3734
 
3735
3735
  `)}function s$(X){let $=[],Z=X.replace(/\/\*[\s\S]*?\*\//g,""),Y=0,J="",G=!1,Q="";for(let q=0;q<Z.length;q++){let K=Z[q];if(K==="@"&&Y===0)G=!0;if(K==="{")Y++;else if(K==="}"){if(Y--,Y===0){if(G){Q+=K;let U=Q.match(/@([a-z-]+)\s*([^{]*)\{([\s\S]*)\}/i);if(U){let[,W,w,z]=U;if(W==="keyframes")$.push({selector:`@keyframes ${w.trim()}`,declarations:z.trim()});else if(W==="media"||W==="supports"||W==="container"){let B=s$(z);$.push({selector:`@${W} ${w.trim()}`,declarations:B.map((j)=>`${j.selector} { ${j.declarations} }`).join(`
3736
3736
  `)})}else $.push({selector:`@${W} ${w.trim()}`,declarations:z.trim()})}Q="",G=!1}else if(J.trim()){J+=K;let U=J.match(/([^{]+)\{([^}]*)\}/);if(U)$.push({selector:U[1].trim(),declarations:U[2].trim()});J=""}continue}}if(G)Q+=K;else J+=K}return $}function e6(X,$,Z,Y,J,G){let{selector:Q,declarations:q}=X;if(Q.startsWith("@")){if(Q.startsWith("@keyframes")){let W=Q.replace("@keyframes ","").trim();return`@keyframes ${J.get(W)||W} { ${q} }`}if(Q.startsWith("@media")||Q.startsWith("@supports")||Q.startsWith("@container")){let w=s$(`x { ${q} }`.replace(/x \{ /,"").replace(/ \}$/,"")).map((z)=>e6(z,$,Z,Y,J,G)).join(`
@@ -11724,7 +11724,7 @@ ${e.dim}${q}${e.reset}
11724
11724
  filter: blur(0);
11725
11725
  transform: scale(1);
11726
11726
  }
11727
- `.trim();u9=new Map});import{createHash as HY}from"crypto";import{readFile as Az,stat as OY}from"fs/promises";async function D0(X){try{let $=await Az(X);return HY("sha256").update($).digest("hex").slice(0,16)}catch{return""}}function _Y(X){return HY("sha256").update(X).digest("hex").slice(0,16)}function tX(X,$){let Z=JSON.stringify($,Object.keys($).sort());return`${_Y(X)}-${_Y(Z)}`}async function m9(X){try{return(await OY(X)).mtimeMs}catch{return 0}}async function M0(X){try{return await OY(X),!0}catch{return!1}}var a1=()=>{};import{mkdir as Rz,readFile as Nz,writeFile as Tz,readdir as AR,rm as Mz,stat as RR}from"fs/promises";import{join as FY,dirname as kz}from"path";async function Iz(X){try{await Rz(X,{recursive:!0})}catch{}}function VY(X,$,Z){return FY(X,Z,`${$}.json`)}async function LY(X,$,Z){if((Date.now()-X.createdAt)/86400000>Z)return!1;if(await m9($)!==X.srcMtime)return!1;return!0}async function eX(X,$,Z,Y=l9){if(!Y.enabled)return null;let J=tX(X,$),G=y5.get(J);if(G){if(await LY(G,X,Y.maxAge))return G.lastAccessedAt=Date.now(),G.data;y5.delete(J)}let Q=VY(Y.directory,J,Z);if(await M0(Q))try{let q=await Nz(Q,"utf-8"),K=JSON.parse(q);if(await LY(K,X,Y.maxAge))return K.lastAccessedAt=Date.now(),y5.set(J,K),K.data}catch{}return null}async function X8(X,$,Z,Y,J=l9){if(!J.enabled)return;let G=tX(X,$),Q=await D0(X),q=await m9(X),K={key:G,src:X,srcHash:Q,srcMtime:q,optionsHash:tX("",$),data:Z,createdAt:Date.now(),lastAccessedAt:Date.now()};y5.set(G,K);let U=VY(J.directory,G,Y);try{await Iz(kz(U)),await Tz(U,JSON.stringify(K,null,2))}catch(W){console.warn(`[stx-media] Failed to write cache: ${W}`)}}async function $8(X,$=l9){if(X==="all")y5.clear();else y5.clear();let Z=X==="all"?["image","video"]:[X];for(let Y of Z){let J=FY($.directory,Y);try{await Mz(J,{recursive:!0,force:!0})}catch{}}}var y5,l9;var c9=E(()=>{a1();y5=new Map,l9={enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500}});class Y8{config;constructor(X={}){this.config={...Ez,...X}}async get(X,$){return eX(X,$,"image",this.config)}async set(X,$,Z){return X8(X,$,Z,"image",this.config)}async clear(){return $8("image",this.config)}updateConfig(X){this.config={...this.config,...X}}}function p9(X){if(!Z8)Z8=new Y8(X);else if(X)Z8.updateConfig(X);return Z8}async function J8(X,$,Z){let Y=Z?{directory:`${Z.outputDir}/../.cache`}:{};return p9(Y).get(X,$)}async function G8(X,$,Z,Y){let J=Y?{directory:`${Y.outputDir}/../.cache`}:{};return p9(J).set(X,$,Z)}async function AY(){return p9().clear()}var Ez,Z8=null;var i9=E(()=>{c9();Ez={enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500,cacheVariants:!0,cachePlaceholders:!0}});import{resolve as Dz,basename as yz,extname as bz,join as Sz}from"path";import{mkdir as Cz}from"fs/promises";async function n9(){try{return await import("ts-images")}catch{return null}}function RY(X){switch(X){case"quality":return{jpeg:{quality:90,mozjpeg:!0,progressive:!0},png:{compressionLevel:6,palette:!1},webp:{quality:90,effort:6,smartSubsample:!0},avif:{quality:85,effort:6}};case"performance":return{jpeg:{quality:70,mozjpeg:!0,progressive:!0},png:{compressionLevel:9,palette:!0},webp:{quality:70,effort:4,smartSubsample:!0},avif:{quality:60,effort:2}};case"web":default:return{jpeg:{quality:82,mozjpeg:!0,progressive:!0},png:{compressionLevel:8,palette:!1},webp:{quality:82,effort:5,smartSubsample:!0},avif:{quality:75,effort:4}}}}function Pz(X,$){let Z=$?RY($):RY("web"),Y=X.formatQuality||{};return{jpeg:{...Z.jpeg,...Y.jpeg},png:{...Z.png,...Y.png},webp:{...Z.webp,...Y.webp},avif:{...Z.avif,...Y.avif}}}async function NY(X,$,Z){let Y=await n9();if(!Y)return console.warn("[stx-media] ts-images not installed, skipping optimization"),{src:X,processed:!1};let J=await J8(X,$,Z);if(J)return J;try{let G=Dz(X);if(!await M0(G))return{src:X,processed:!1,errors:[`Source file not found: ${X}`]};let Q=Pz(Z,$.preset),q=Z.outputDir||"dist/images",K=Z.baseUrl||"/images";await Cz(q,{recursive:!0});let U=await D0(G),W=yz(X,bz(X)),w=$.outputFormat?[$.outputFormat]:Z.defaultFormats||["avif","webp","jpeg"],z={src:X,processed:!0,variants:[],hash:U},B=null;if($.transformations&&$.transformations.length>0)B=await r9(G,$.transformations,Y);for(let j of w){let _=Q[j]||{},H=`${W}-${U}.${j}`,L=Sz(q,H);try{let O=await Y.optimizeImage({input:B||G,output:L,format:j,quality:_.quality,progressive:_.progressive});if(O){if(z.variants.push({path:L,url:`${K}/${H}`,width:O.width||0,height:O.height||0,format:j,size:O.outputSize||0}),!z.originalWidth&&O.width)z.originalWidth=O.width,z.originalHeight=O.height}}catch(O){z.errors=z.errors||[],z.errors.push(`Failed to optimize ${j}: ${O}`)}}if($.embedThumbhash||$.placeholder==="thumbhash")try{let j=await Y.generateThumbHash(G);z.placeholder=j.dataUrl}catch(j){z.errors=z.errors||[],z.errors.push(`Failed to generate thumbhash: ${j}`)}if($.useDominantColor)try{let j=await Y.generatePlaceholder(G,{strategy:"dominant-color"});z.dominantColor=j.dominantColor}catch(j){z.errors=z.errors||[],z.errors.push(`Failed to extract dominant color: ${j}`)}return await G8(X,$,z,Z),z}catch(G){return{src:X,processed:!1,errors:[`Processing failed: ${G}`]}}}async function TY(X,$,Z,Y){let J=await n9();if(!J)return{success:!1,error:"ts-images not installed"};try{return{success:!0,size:(await J.optimizeImage({input:X,output:Y,format:$,quality:Z}))?.outputSize}}catch(G){return{success:!1,error:String(G)}}}async function r9(X,$,Z){let Y=Z||await n9();if(!Y)return console.warn("[stx-media] ts-images not installed, skipping transformations"),null;try{let J=await Y.decode(X);for(let G of $){let Q=G.options||{};switch(G.type){case"resize":if(Q.width||Q.height)J=await Y.resize(J,{width:Q.width,height:Q.height,fit:Q.fit});break;case"blur":if(Q.sigma!==void 0)J=await Y.blur(J,Q.sigma);break;case"sharpen":if(Q.amount!==void 0)J=await Y.sharpen(J,Q.amount);break;case"grayscale":J=await Y.grayscale(J);break;case"rotate":if(Q.angle!==void 0)J=await Y.rotate(J,Q.angle);break;case"flip":J=await Y.flip(J);break;case"flop":J=await Y.flop(J);break;case"brightness":if(Q.value!==void 0)J=await Y.brightness(J,Q.value);break;case"contrast":if(Q.value!==void 0)J=await Y.contrast(J,Q.value);break;case"saturation":if(Q.value!==void 0)J=await Y.saturation(J,Q.value);break}}return await Y.encode(J,"png")}catch(J){return console.error(`[stx-media] Transformation failed: ${J}`),null}}var MY=E(()=>{a1();i9()});import{resolve as vz,basename as xz,extname as fz,join as gz}from"path";import{mkdir as hz}from"fs/promises";async function uz(){try{return await import("ts-images")}catch{return null}}async function kY(X,$,Z){let Y=await uz();if(!Y)return console.warn("[stx-media] ts-images not installed, skipping responsive generation"),null;let J=vz(X);if(!await M0(J))return console.warn(`[stx-media] Source file not found: ${X}`),null;try{let G=$.responsiveWidths||Z.breakpoints||dz,Q=$.formats||Z.defaultFormats||["avif","webp","jpeg"],q=Z.outputDir||"dist/images",K=Z.baseUrl||"/images";await hz(q,{recursive:!0});let U=await D0(J),W=xz(X,fz(X)),w=Z.formatQuality||{jpeg:{quality:82},png:{quality:80},webp:{quality:82},avif:{quality:75}},z={src:X,byFormat:{},srcsets:{}};for(let j of Q){z.byFormat[j]=[];let _=[];for(let H of G){let L=`${W}-${H}w-${U}.${j}`,O=gz(q,L),F=`${K}/${L}`;try{let V=w[j]?.quality||80;if(await M0(O)){z.byFormat[j].push({path:O,url:F,width:H,height:0,format:j,size:0}),_.push(`${F} ${H}w`);continue}let A=await Y.processImage({input:J,output:O,format:j,quality:V,resize:{width:H}});if(A)z.byFormat[j].push({path:O,url:F,width:H,height:A.height||Math.round(H*(A.height||1)/(A.width||1)),format:j,size:A.outputSize||0}),_.push(`${F} ${H}w`)}catch(V){console.warn(`[stx-media] Failed to generate ${j} at ${H}w: ${V}`)}}z.srcsets[j]=_.join(", ")}let B=$.placeholder||Z.placeholderStrategy||"thumbhash";if(B!=="none")try{if(B==="thumbhash"){let j=await Y.generateThumbHash(J);z.placeholder={dataURL:j.dataUrl,width:j.width||32,height:j.height||32,strategy:"thumbhash"}}else{let j=await Y.generatePlaceholder(J,{strategy:B,width:20});z.placeholder={dataURL:j.dataURL,width:j.width,height:j.height,strategy:B}}}catch(j){console.warn(`[stx-media] Failed to generate placeholder: ${j}`)}return z.sizes=$.sizes||mz(G),z}catch(G){return console.error(`[stx-media] Responsive generation failed: ${G}`),null}}function mz(X){let $=[...X].sort((Y,J)=>Y-J),Z=[];for(let Y=0;Y<$.length-1;Y++){let J=$[Y];Z.push(`(max-width: ${J}px) ${J}px`)}return Z.push(`${$[$.length-1]}px`),Z.join(", ")}function IY(X,$="width"){if(!X||X.length===0)return"";if($==="dpr")return X.filter((Z)=>Z.dpr).map((Z)=>`${Z.url} ${Z.dpr}x`).join(", ");return X.map((Z)=>`${Z.url} ${Z.width}w`).join(", ")}var dz;var EY=E(()=>{a1();dz=[320,480,640,768,1024,1280,1536,1920]});var DY={};n(DY,{setCachedImageResult:()=>G8,processImage:()=>NY,optimizeImage:()=>TY,getCachedImageResult:()=>J8,generateSrcset:()=>IY,generateResponsiveVariants:()=>kY,clearImageCache:()=>AY,applyTransformations:()=>r9,ImageProcessorCache:()=>Y8});var yY=E(()=>{MY();EY();i9()});async function lz(){try{return await Promise.resolve().then(() => (yY(),DY))}catch(X){if(!bY)console.warn("[stx-media] Image processor not available, some features disabled:",X),bY=!0;return null}}async function Q8(X,$={}){let Z=$,Y=X;if(Y.process&&!Y.skipOptimization){if(Z.tsImagesConfig?.enabled&&!Z.isDev)return nz(Y,Z)}if(Z.processedResult?.processed)return t9(X,Z.processedResult,$);if(Z.responsiveVariants)return vY(X,Z.responsiveVariants,$);let{src:J,alt:G,width:Q,height:q,sizes:K,widths:U=D5,dpr:W,formats:w=b7,quality:z=o9,params:B={},placeholder:j="none",placeholderOptions:_={},lazy:H=!0,priority:L=!1,loading:O=L?"eager":K8,decoding:F=q8,fetchpriority:V,objectFit:A,objectPosition:R,crossorigin:N,referrerpolicy:T}=X,k=X.class,M=X.style,y=X.id,I=X.data||{},{isDev:C=!1,baseUrl:S=""}=$;if(C&&!$.optimize)return iz(X);let b,P,x=y||`stx-img-${Math.random().toString(36).slice(2,8)}`;if(j!=="none"&&!L)try{b=await jY(J,{strategy:j,..._}),P=zY(x,b,_)}catch{}let d=W!==void 0&&Q!==void 0,m;if(d)m=pz(X,x,b,$);else m=await cz(X,x,b,$);let Y0;if(L){let p0=w.includes("webp")?"webp":w[0],l=x9(J,U,{...B,q:z},p0),j0=typeof K==="object"?f9(K):K||"100vw";Y0=`<link rel="preload" as="image" imagesrcset="${l}" imagesizes="${j0}" />`}let d0=[];if(!SY&&j!=="none")d0.push(d9),SY=!0;if(P)d0.push(P);let F0=H?PY(x):void 0;return{html:m,preloadLink:Y0,css:d0.length>0?d0.join(`
11727
+ `.trim();u9=new Map});import{createHash as HY}from"crypto";import{readFile as Az,stat as OY}from"fs/promises";async function D0(X){try{let $=await Az(X);return HY("sha256").update($).digest("hex").slice(0,16)}catch{return""}}function _Y(X){return HY("sha256").update(X).digest("hex").slice(0,16)}function tX(X,$){let Z=JSON.stringify($,Object.keys($).sort());return`${_Y(X)}-${_Y(Z)}`}async function m9(X){try{return(await OY(X)).mtimeMs}catch{return 0}}async function M0(X){try{return await OY(X),!0}catch{return!1}}var a1=()=>{};import{mkdir as Rz,readFile as Nz,writeFile as Tz,readdir as NR,rm as Mz,stat as TR}from"fs/promises";import{join as FY,dirname as kz}from"path";async function Iz(X){try{await Rz(X,{recursive:!0})}catch{}}function VY(X,$,Z){return FY(X,Z,`${$}.json`)}async function LY(X,$,Z){if((Date.now()-X.createdAt)/86400000>Z)return!1;if(await m9($)!==X.srcMtime)return!1;return!0}async function eX(X,$,Z,Y=l9){if(!Y.enabled)return null;let J=tX(X,$),G=y5.get(J);if(G){if(await LY(G,X,Y.maxAge))return G.lastAccessedAt=Date.now(),G.data;y5.delete(J)}let Q=VY(Y.directory,J,Z);if(await M0(Q))try{let q=await Nz(Q,"utf-8"),K=JSON.parse(q);if(await LY(K,X,Y.maxAge))return K.lastAccessedAt=Date.now(),y5.set(J,K),K.data}catch{}return null}async function X8(X,$,Z,Y,J=l9){if(!J.enabled)return;let G=tX(X,$),Q=await D0(X),q=await m9(X),K={key:G,src:X,srcHash:Q,srcMtime:q,optionsHash:tX("",$),data:Z,createdAt:Date.now(),lastAccessedAt:Date.now()};y5.set(G,K);let U=VY(J.directory,G,Y);try{await Iz(kz(U)),await Tz(U,JSON.stringify(K,null,2))}catch(W){console.warn(`[stx-media] Failed to write cache: ${W}`)}}async function $8(X,$=l9){if(X==="all")y5.clear();else y5.clear();let Z=X==="all"?["image","video"]:[X];for(let Y of Z){let J=FY($.directory,Y);try{await Mz(J,{recursive:!0,force:!0})}catch{}}}var y5,l9;var c9=E(()=>{a1();y5=new Map,l9={enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500}});class Y8{config;constructor(X={}){this.config={...Ez,...X}}async get(X,$){return eX(X,$,"image",this.config)}async set(X,$,Z){return X8(X,$,Z,"image",this.config)}async clear(){return $8("image",this.config)}updateConfig(X){this.config={...this.config,...X}}}function p9(X){if(!Z8)Z8=new Y8(X);else if(X)Z8.updateConfig(X);return Z8}async function J8(X,$,Z){let Y=Z?{directory:`${Z.outputDir}/../.cache`}:{};return p9(Y).get(X,$)}async function G8(X,$,Z,Y){let J=Y?{directory:`${Y.outputDir}/../.cache`}:{};return p9(J).set(X,$,Z)}async function AY(){return p9().clear()}var Ez,Z8=null;var i9=E(()=>{c9();Ez={enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500,cacheVariants:!0,cachePlaceholders:!0}});import{resolve as Dz,basename as yz,extname as bz,join as Sz}from"path";import{mkdir as Cz}from"fs/promises";async function n9(){try{return await import("ts-images")}catch{return null}}function RY(X){switch(X){case"quality":return{jpeg:{quality:90,mozjpeg:!0,progressive:!0},png:{compressionLevel:6,palette:!1},webp:{quality:90,effort:6,smartSubsample:!0},avif:{quality:85,effort:6}};case"performance":return{jpeg:{quality:70,mozjpeg:!0,progressive:!0},png:{compressionLevel:9,palette:!0},webp:{quality:70,effort:4,smartSubsample:!0},avif:{quality:60,effort:2}};case"web":default:return{jpeg:{quality:82,mozjpeg:!0,progressive:!0},png:{compressionLevel:8,palette:!1},webp:{quality:82,effort:5,smartSubsample:!0},avif:{quality:75,effort:4}}}}function Pz(X,$){let Z=$?RY($):RY("web"),Y=X.formatQuality||{};return{jpeg:{...Z.jpeg,...Y.jpeg},png:{...Z.png,...Y.png},webp:{...Z.webp,...Y.webp},avif:{...Z.avif,...Y.avif}}}async function NY(X,$,Z){let Y=await n9();if(!Y)return console.warn("[stx-media] ts-images not installed, skipping optimization"),{src:X,processed:!1};let J=await J8(X,$,Z);if(J)return J;try{let G=Dz(X);if(!await M0(G))return{src:X,processed:!1,errors:[`Source file not found: ${X}`]};let Q=Pz(Z,$.preset),q=Z.outputDir||"dist/images",K=Z.baseUrl||"/images";await Cz(q,{recursive:!0});let U=await D0(G),W=yz(X,bz(X)),w=$.outputFormat?[$.outputFormat]:Z.defaultFormats||["avif","webp","jpeg"],z={src:X,processed:!0,variants:[],hash:U},B=null;if($.transformations&&$.transformations.length>0)B=await r9(G,$.transformations,Y);for(let j of w){let _=Q[j]||{},H=`${W}-${U}.${j}`,L=Sz(q,H);try{let O=await Y.optimizeImage({input:B||G,output:L,format:j,quality:_.quality,progressive:_.progressive});if(O){if(z.variants.push({path:L,url:`${K}/${H}`,width:O.width||0,height:O.height||0,format:j,size:O.outputSize||0}),!z.originalWidth&&O.width)z.originalWidth=O.width,z.originalHeight=O.height}}catch(O){z.errors=z.errors||[],z.errors.push(`Failed to optimize ${j}: ${O}`)}}if($.embedThumbhash||$.placeholder==="thumbhash")try{let j=await Y.generateThumbHash(G);z.placeholder=j.dataUrl}catch(j){z.errors=z.errors||[],z.errors.push(`Failed to generate thumbhash: ${j}`)}if($.useDominantColor)try{let j=await Y.generatePlaceholder(G,{strategy:"dominant-color"});z.dominantColor=j.dominantColor}catch(j){z.errors=z.errors||[],z.errors.push(`Failed to extract dominant color: ${j}`)}return await G8(X,$,z,Z),z}catch(G){return{src:X,processed:!1,errors:[`Processing failed: ${G}`]}}}async function TY(X,$,Z,Y){let J=await n9();if(!J)return{success:!1,error:"ts-images not installed"};try{return{success:!0,size:(await J.optimizeImage({input:X,output:Y,format:$,quality:Z}))?.outputSize}}catch(G){return{success:!1,error:String(G)}}}async function r9(X,$,Z){let Y=Z||await n9();if(!Y)return console.warn("[stx-media] ts-images not installed, skipping transformations"),null;try{let J=await Y.decode(X);for(let G of $){let Q=G.options||{};switch(G.type){case"resize":if(Q.width||Q.height)J=await Y.resize(J,{width:Q.width,height:Q.height,fit:Q.fit});break;case"blur":if(Q.sigma!==void 0)J=await Y.blur(J,Q.sigma);break;case"sharpen":if(Q.amount!==void 0)J=await Y.sharpen(J,Q.amount);break;case"grayscale":J=await Y.grayscale(J);break;case"rotate":if(Q.angle!==void 0)J=await Y.rotate(J,Q.angle);break;case"flip":J=await Y.flip(J);break;case"flop":J=await Y.flop(J);break;case"brightness":if(Q.value!==void 0)J=await Y.brightness(J,Q.value);break;case"contrast":if(Q.value!==void 0)J=await Y.contrast(J,Q.value);break;case"saturation":if(Q.value!==void 0)J=await Y.saturation(J,Q.value);break}}return await Y.encode(J,"png")}catch(J){return console.error(`[stx-media] Transformation failed: ${J}`),null}}var MY=E(()=>{a1();i9()});import{resolve as vz,basename as xz,extname as fz,join as gz}from"path";import{mkdir as hz}from"fs/promises";async function uz(){try{return await import("ts-images")}catch{return null}}async function kY(X,$,Z){let Y=await uz();if(!Y)return console.warn("[stx-media] ts-images not installed, skipping responsive generation"),null;let J=vz(X);if(!await M0(J))return console.warn(`[stx-media] Source file not found: ${X}`),null;try{let G=$.responsiveWidths||Z.breakpoints||dz,Q=$.formats||Z.defaultFormats||["avif","webp","jpeg"],q=Z.outputDir||"dist/images",K=Z.baseUrl||"/images";await hz(q,{recursive:!0});let U=await D0(J),W=xz(X,fz(X)),w=Z.formatQuality||{jpeg:{quality:82},png:{quality:80},webp:{quality:82},avif:{quality:75}},z={src:X,byFormat:{},srcsets:{}};for(let j of Q){z.byFormat[j]=[];let _=[];for(let H of G){let L=`${W}-${H}w-${U}.${j}`,O=gz(q,L),F=`${K}/${L}`;try{let V=w[j]?.quality||80;if(await M0(O)){z.byFormat[j].push({path:O,url:F,width:H,height:0,format:j,size:0}),_.push(`${F} ${H}w`);continue}let A=await Y.processImage({input:J,output:O,format:j,quality:V,resize:{width:H}});if(A)z.byFormat[j].push({path:O,url:F,width:H,height:A.height||Math.round(H*(A.height||1)/(A.width||1)),format:j,size:A.outputSize||0}),_.push(`${F} ${H}w`)}catch(V){console.warn(`[stx-media] Failed to generate ${j} at ${H}w: ${V}`)}}z.srcsets[j]=_.join(", ")}let B=$.placeholder||Z.placeholderStrategy||"thumbhash";if(B!=="none")try{if(B==="thumbhash"){let j=await Y.generateThumbHash(J);z.placeholder={dataURL:j.dataUrl,width:j.width||32,height:j.height||32,strategy:"thumbhash"}}else{let j=await Y.generatePlaceholder(J,{strategy:B,width:20});z.placeholder={dataURL:j.dataURL,width:j.width,height:j.height,strategy:B}}}catch(j){console.warn(`[stx-media] Failed to generate placeholder: ${j}`)}return z.sizes=$.sizes||mz(G),z}catch(G){return console.error(`[stx-media] Responsive generation failed: ${G}`),null}}function mz(X){let $=[...X].sort((Y,J)=>Y-J),Z=[];for(let Y=0;Y<$.length-1;Y++){let J=$[Y];Z.push(`(max-width: ${J}px) ${J}px`)}return Z.push(`${$[$.length-1]}px`),Z.join(", ")}function IY(X,$="width"){if(!X||X.length===0)return"";if($==="dpr")return X.filter((Z)=>Z.dpr).map((Z)=>`${Z.url} ${Z.dpr}x`).join(", ");return X.map((Z)=>`${Z.url} ${Z.width}w`).join(", ")}var dz;var EY=E(()=>{a1();dz=[320,480,640,768,1024,1280,1536,1920]});var DY={};n(DY,{setCachedImageResult:()=>G8,processImage:()=>NY,optimizeImage:()=>TY,getCachedImageResult:()=>J8,generateSrcset:()=>IY,generateResponsiveVariants:()=>kY,clearImageCache:()=>AY,applyTransformations:()=>r9,ImageProcessorCache:()=>Y8});var yY=E(()=>{MY();EY();i9()});async function lz(){try{return await Promise.resolve().then(() => (yY(),DY))}catch(X){if(!bY)console.warn("[stx-media] Image processor not available, some features disabled:",X),bY=!0;return null}}async function Q8(X,$={}){let Z=$,Y=X;if(Y.process&&!Y.skipOptimization){if(Z.tsImagesConfig?.enabled&&!Z.isDev)return nz(Y,Z)}if(Z.processedResult?.processed)return t9(X,Z.processedResult,$);if(Z.responsiveVariants)return vY(X,Z.responsiveVariants,$);let{src:J,alt:G,width:Q,height:q,sizes:K,widths:U=D5,dpr:W,formats:w=b7,quality:z=o9,params:B={},placeholder:j="none",placeholderOptions:_={},lazy:H=!0,priority:L=!1,loading:O=L?"eager":K8,decoding:F=q8,fetchpriority:V,objectFit:A,objectPosition:R,crossorigin:N,referrerpolicy:T}=X,k=X.class,M=X.style,y=X.id,I=X.data||{},{isDev:C=!1,baseUrl:S=""}=$;if(C&&!$.optimize)return iz(X);let b,P,x=y||`stx-img-${Math.random().toString(36).slice(2,8)}`;if(j!=="none"&&!L)try{b=await jY(J,{strategy:j,..._}),P=zY(x,b,_)}catch{}let d=W!==void 0&&Q!==void 0,m;if(d)m=pz(X,x,b,$);else m=await cz(X,x,b,$);let Y0;if(L){let p0=w.includes("webp")?"webp":w[0],l=x9(J,U,{...B,q:z},p0),j0=typeof K==="object"?f9(K):K||"100vw";Y0=`<link rel="preload" as="image" imagesrcset="${l}" imagesizes="${j0}" />`}let d0=[];if(!SY&&j!=="none")d0.push(d9),SY=!0;if(P)d0.push(P);let F0=H?PY(x):void 0;return{html:m,preloadLink:Y0,css:d0.length>0?d0.join(`
11728
11728
  `):void 0,script:F0}}async function cz(X,$,Z,Y){let{src:J,alt:G,width:Q,height:q,sizes:K,widths:U=D5,formats:W=b7,quality:w=o9,params:z={},lazy:B=!0,priority:j=!1,loading:_=j?"eager":K8,decoding:H=q8,fetchpriority:L,objectFit:O,objectPosition:F,crossorigin:V,referrerpolicy:A}=X,R=X.class,N=X.style,T=X.data||{},k=typeof K==="object"?f9(K):K||"100vw",M=[];for(let C of W){let S=x9(J,U,{...z,q:w},C),b=g9(C);if(B&&!j)M.push(` <source type="${b}" data-srcset="${S}" data-sizes="${k}" />`);else M.push(` <source type="${b}" srcset="${S}" sizes="${k}" />`)}let y=s9({src:S7(J,{...z,q:w}),alt:G,width:Q,height:q,loading:j?void 0:_,decoding:H,fetchpriority:j?"high":L,objectFit:O,objectPosition:F,crossorigin:V,referrerpolicy:A,className:CY(R,Z),style:a9(N,O,F,Z),lazy:B&&!j,data:T}),I;if(Z){let C=`background-image: url('${Z.dataURL}'); background-size: cover; background-position: center;`;I=`<div id="${$}" class="stx-img-placeholder" style="${C}">
11729
11729
  <picture>
11730
11730
  ${M.join(`
@@ -12373,7 +12373,7 @@ catch (error) {
12373
12373
  init();
12374
12374
  }
12375
12375
  })();
12376
- </script>`}function AN(X){return[...X,...z3]}var Vj,Aj,Rj,Nj,z3;var j3=E(()=>{Vj={name:"pwa.installButton",handler:(X,$,Z,Y)=>{let J=Z.__stx_options||{};return Hj(X,J)},hasEndTag:!0,description:"Renders a PWA install prompt button that appears when the app can be installed"},Aj={name:"pwa.updatePrompt",handler:(X,$,Z,Y)=>{let J=Z.__stx_options||{};return Oj(X,J)},hasEndTag:!0,description:"Renders a PWA update notification UI when a new version is available"},Rj={name:"pwa.offlineIndicator",handler:(X,$,Z,Y)=>{let J=Z.__stx_options||{};return Lj(X,J)},hasEndTag:!0,description:"Renders an offline status indicator that shows when the user loses connection"},Nj={name:"pwa.pushSubscribe",handler:(X,$,Z,Y)=>{let J=Z.__stx_options||{};return Fj(X,J)},hasEndTag:!0,description:"Renders a push notification subscription button"},z3=[Vj,Aj,Rj,Nj]});function B3(X){for(let[$,Z]of Object.entries(s))if(Z===X)return $;return}var s;var V8=E(()=>{s={UNCLOSED_DIRECTIVE:1001,UNCLOSED_EXPRESSION:1002,INVALID_DIRECTIVE_SYNTAX:1003,MALFORMED_EXPRESSION:1004,UNEXPECTED_TOKEN:1005,UNDEFINED_VARIABLE:1101,TYPE_ERROR:1102,EVALUATION_ERROR:1103,INFINITE_LOOP:1104,CIRCULAR_REFERENCE:1105,UNSAFE_EXPRESSION:1201,PATH_TRAVERSAL:1202,XSS_ATTEMPT:1203,CODE_INJECTION:1204,DOM_API_VIOLATION:1205,FILE_NOT_FOUND:1301,FILE_READ_ERROR:1302,INVALID_FILE_PATH:1303,PERMISSION_DENIED:1304,INVALID_CONFIG:1401,MISSING_REQUIRED_CONFIG:1402,DEPRECATED_CONFIG:1403,COMPONENT_NOT_FOUND:1501,INVALID_PROPS:1502,COMPONENT_RENDER_ERROR:1503,FILTER_NOT_FOUND:1601,INVALID_FILTER_ARGS:1602,EXPRESSION_TIMEOUT:1603}});function C7(){return!1}function P7(){return!C7()||process.env.STX_DEBUG==="true"}function A8(){return!1}import Tj from"path";function R8(){return{..._3}}function N8(X){if(!_3.showRelativePaths||!X)return X;let $=_3.baseDir||process.cwd();try{let Z=Tj.relative($,X);return Z.startsWith("..")?X:Z}catch{return X}}var Mj,_3,T8,e1,M8;var k8=E(()=>{V8();Mj={showRelativePaths:!1,enableAutoRecovery:P7(),logRecoveryWarnings:!0},_3={...Mj};T8=class T8 extends Error{code;filePath;line;column;context;numericCode;constructor(X,$,Z,Y,J,G,Q){super(X);this.code=$;this.filePath=Z;this.line=Y;this.column=J;this.context=G;if(this.name="StxError",this.numericCode=Q||s.EVALUATION_ERROR,this.filePath)this.filePath=N8(this.filePath)}};e1=class e1 extends T8{constructor(X,$,Z,Y,J,G){super(X,"stx_RUNTIME_ERROR",$,Z,Y,J,G||s.EVALUATION_ERROR);this.name="StxRuntimeError"}};M8=class M8 extends T8{isFatal=!0;constructor(X,$,Z,Y,J,G){super(X,"stx_VALIDATION_ERROR",$,Z,Y,J,G||s.DOM_API_VIOLATION);this.name="StxValidationError"}}});function WJ(X){let{type:$,message:Z,code:Y,filePath:J,line:G,column:Q,template:q,offset:K,snippet:U,suggestion:W,format:w="text"}=X,z=G,B=Q;if(!z&&q&&K!==void 0){let O=bj(q,K);z=O.line,B=O.column}let j=J?N8(J):void 0,_=Y?B3(Y):void 0,H={type:$,code:Y,codeName:_,message:Z,filePath:j,line:z,column:B,snippet:U,suggestion:W,timestamp:new Date().toISOString()},L;switch(w){case"html":L=Ij(H);break;case"json":L=JSON.stringify(H,null,2);break;case"console":L=Ej(H,q,K);break;case"text":default:L=kj(H,q,K);break}return{formatted:L,data:H}}function kj(X,$,Z){let Y=[],J=X.code?` [${X.codeName||X.code}]`:"";if(Y.push(`[${X.type} Error${J}]`),X.filePath){let G=X.filePath;if(X.line){if(G+=`:${X.line}`,X.column)G+=`:${X.column}`}Y.push(`at ${G}`)}if(Y.push(`
12376
+ </script>`}function NN(X){return[...X,...z3]}var Vj,Aj,Rj,Nj,z3;var j3=E(()=>{Vj={name:"pwa.installButton",handler:(X,$,Z,Y)=>{let J=Z.__stx_options||{};return Hj(X,J)},hasEndTag:!0,description:"Renders a PWA install prompt button that appears when the app can be installed"},Aj={name:"pwa.updatePrompt",handler:(X,$,Z,Y)=>{let J=Z.__stx_options||{};return Oj(X,J)},hasEndTag:!0,description:"Renders a PWA update notification UI when a new version is available"},Rj={name:"pwa.offlineIndicator",handler:(X,$,Z,Y)=>{let J=Z.__stx_options||{};return Lj(X,J)},hasEndTag:!0,description:"Renders an offline status indicator that shows when the user loses connection"},Nj={name:"pwa.pushSubscribe",handler:(X,$,Z,Y)=>{let J=Z.__stx_options||{};return Fj(X,J)},hasEndTag:!0,description:"Renders a push notification subscription button"},z3=[Vj,Aj,Rj,Nj]});function B3(X){for(let[$,Z]of Object.entries(s))if(Z===X)return $;return}var s;var V8=E(()=>{s={UNCLOSED_DIRECTIVE:1001,UNCLOSED_EXPRESSION:1002,INVALID_DIRECTIVE_SYNTAX:1003,MALFORMED_EXPRESSION:1004,UNEXPECTED_TOKEN:1005,UNDEFINED_VARIABLE:1101,TYPE_ERROR:1102,EVALUATION_ERROR:1103,INFINITE_LOOP:1104,CIRCULAR_REFERENCE:1105,UNSAFE_EXPRESSION:1201,PATH_TRAVERSAL:1202,XSS_ATTEMPT:1203,CODE_INJECTION:1204,DOM_API_VIOLATION:1205,FILE_NOT_FOUND:1301,FILE_READ_ERROR:1302,INVALID_FILE_PATH:1303,PERMISSION_DENIED:1304,INVALID_CONFIG:1401,MISSING_REQUIRED_CONFIG:1402,DEPRECATED_CONFIG:1403,COMPONENT_NOT_FOUND:1501,INVALID_PROPS:1502,COMPONENT_RENDER_ERROR:1503,FILTER_NOT_FOUND:1601,INVALID_FILTER_ARGS:1602,EXPRESSION_TIMEOUT:1603}});function C7(){return!1}function P7(){return!C7()||process.env.STX_DEBUG==="true"}function A8(){return!1}import Tj from"path";function R8(){return{..._3}}function N8(X){if(!_3.showRelativePaths||!X)return X;let $=_3.baseDir||process.cwd();try{let Z=Tj.relative($,X);return Z.startsWith("..")?X:Z}catch{return X}}var Mj,_3,T8,e1,M8;var k8=E(()=>{V8();Mj={showRelativePaths:!1,enableAutoRecovery:P7(),logRecoveryWarnings:!0},_3={...Mj};T8=class T8 extends Error{code;filePath;line;column;context;numericCode;constructor(X,$,Z,Y,J,G,Q){super(X);this.code=$;this.filePath=Z;this.line=Y;this.column=J;this.context=G;if(this.name="StxError",this.numericCode=Q||s.EVALUATION_ERROR,this.filePath)this.filePath=N8(this.filePath)}};e1=class e1 extends T8{constructor(X,$,Z,Y,J,G){super(X,"stx_RUNTIME_ERROR",$,Z,Y,J,G||s.EVALUATION_ERROR);this.name="StxRuntimeError"}};M8=class M8 extends T8{isFatal=!0;constructor(X,$,Z,Y,J,G){super(X,"stx_VALIDATION_ERROR",$,Z,Y,J,G||s.DOM_API_VIOLATION);this.name="StxValidationError"}}});function WJ(X){let{type:$,message:Z,code:Y,filePath:J,line:G,column:Q,template:q,offset:K,snippet:U,suggestion:W,format:w="text"}=X,z=G,B=Q;if(!z&&q&&K!==void 0){let O=bj(q,K);z=O.line,B=O.column}let j=J?N8(J):void 0,_=Y?B3(Y):void 0,H={type:$,code:Y,codeName:_,message:Z,filePath:j,line:z,column:B,snippet:U,suggestion:W,timestamp:new Date().toISOString()},L;switch(w){case"html":L=Ij(H);break;case"json":L=JSON.stringify(H,null,2);break;case"console":L=Ej(H,q,K);break;case"text":default:L=kj(H,q,K);break}return{formatted:L,data:H}}function kj(X,$,Z){let Y=[],J=X.code?` [${X.codeName||X.code}]`:"";if(Y.push(`[${X.type} Error${J}]`),X.filePath){let G=X.filePath;if(X.line){if(G+=`:${X.line}`,X.column)G+=`:${X.column}`}Y.push(`at ${G}`)}if(Y.push(`
12377
12377
  ${X.message}`),$&&X.line){let G=Dj($,X.line,2);if(G)Y.push(`
12378
12378
  ${G}`)}if(X.snippet)Y.push(`
12379
12379
  Snippet: ${X.snippet}`);if(X.suggestion)Y.push(`
@@ -12842,7 +12842,7 @@ else {
12842
12842
 
12843
12843
  console.log('[stx] Lifecycle runtime initialized');
12844
12844
  })();
12845
- `}function N3(X){return Symbol(X)}var gT,hT,uT;var vJ=E(()=>{gT=N3("theme"),hT=N3("router"),uT=N3("i18n")});import*as fJ from"crypto";function xJ(X){let $=/\$(\w+)\./g,Z=[],Y;while((Y=$.exec(X))!==null)if(!Z.includes(Y[1]))Z.push(Y[1]);return Z}function YB(){return`stx-${fJ.randomBytes(4).toString("hex")}`}function JB(X){return/\$\w+\./.test(X)}function GB(X){let $=[],Z=new Set,Y=/<(\w+)([^>]*?)(\s*\/?>)/g,J=X;return J=J.replace(Y,(G,Q,q,K)=>{if(["script","style","template"].includes(Q.toLowerCase()))return G;let U=[],W=!1,w=q,z=/(\w+(?:-\w+)*)\s*=\s*"([^"]*\{\{[^}]*\$\w+[^}]*\}\}[^"]*)"/g,B=[...q.matchAll(z)];for(let H of B){let L=H[0],O=H[1],F=H[2];if(JB(F)){W=!0;let V=F.match(/\{\{\s*([\s\S]+?)\s*\}\}/);if(V){let A=V[1];if(U.push({attr:O,expr:A,fullMatch:L,originalAttr:O}),xJ(A).forEach((N)=>Z.add(N)),O==="text")w=w.replace(L,"");else if(O==="class")w=w.replace(L,'class=""');else if(O==="disabled"||O==="hidden")w=w.replace(L,"");else w=w.replace(L,`${O}=""`)}}}if(!W)return G;let j=w.match(/\bid\s*=\s*"([^"]+)"/),_;if(j)_=j[1];else _=YB(),w=` id="${_}"${w}`;for(let H of U)$.push({elementId:_,attribute:H.attr,expression:H.expr,stores:xJ(H.expr)});return`<${Q}${w}${K}`}),{html:J,bindings:$,stores:Z}}function QB(X,$){if(X.length===0)return"";let Z=Array.from($),Y=`
12845
+ `}function N3(X){return Symbol(X)}var uT,dT,mT;var vJ=E(()=>{uT=N3("theme"),dT=N3("router"),mT=N3("i18n")});import*as fJ from"crypto";function xJ(X){let $=/\$(\w+)\./g,Z=[],Y;while((Y=$.exec(X))!==null)if(!Z.includes(Y[1]))Z.push(Y[1]);return Z}function YB(){return`stx-${fJ.randomBytes(4).toString("hex")}`}function JB(X){return/\$\w+\./.test(X)}function GB(X){let $=[],Z=new Set,Y=/<(\w+)([^>]*?)(\s*\/?>)/g,J=X;return J=J.replace(Y,(G,Q,q,K)=>{if(["script","style","template"].includes(Q.toLowerCase()))return G;let U=[],W=!1,w=q,z=/(\w+(?:-\w+)*)\s*=\s*"([^"]*\{\{[^}]*\$\w+[^}]*\}\}[^"]*)"/g,B=[...q.matchAll(z)];for(let H of B){let L=H[0],O=H[1],F=H[2];if(JB(F)){W=!0;let V=F.match(/\{\{\s*([\s\S]+?)\s*\}\}/);if(V){let A=V[1];if(U.push({attr:O,expr:A,fullMatch:L,originalAttr:O}),xJ(A).forEach((N)=>Z.add(N)),O==="text")w=w.replace(L,"");else if(O==="class")w=w.replace(L,'class=""');else if(O==="disabled"||O==="hidden")w=w.replace(L,"");else w=w.replace(L,`${O}=""`)}}}if(!W)return G;let j=w.match(/\bid\s*=\s*"([^"]+)"/),_;if(j)_=j[1];else _=YB(),w=` id="${_}"${w}`;for(let H of U)$.push({elementId:_,attribute:H.attr,expression:H.expr,stores:xJ(H.expr)});return`<${Q}${w}${K}`}),{html:J,bindings:$,stores:Z}}function QB(X,$){if(X.length===0)return"";let Z=Array.from($),Y=`
12846
12846
  <script>
12847
12847
  (function() {
12848
12848
  'use strict';
@@ -13573,28 +13573,28 @@ ${jQ(X).split(",").map((G)=>G.trim()).filter(Boolean).map((G)=>` try { __scopeR
13573
13573
  `}}if(S){let x=wH(A,S);if(A=x.html,x.mergedIntoExisting)C=C.replace(`window.stx._scopes['${S}']`,`window.stx._scopes['${x.mergedIntoExisting}']`),S=x.mergedIntoExisting}if(A.includes("@include")||A.includes("@partial"))A=await A4(A,M,O,Y,J,G);let{processLoops:b}=await Promise.resolve().then(() => (F4(),wQ)),P=b(A,M,O);if(P=Z5(P,M,O),P=N1(P,M,O),k)P+=`
13574
13574
  `+k;if(C)P+=`
13575
13575
  `+C;return P}catch(V){let A=V instanceof Error?V.message:String(V);return U0("Include",`Error processing include ${j}: ${A}`,Z,H,L)}}let z=/@include\s*\(/g,B;while((B=z.exec(q))!==null){let j=B.index,_=j+B[0].length-1,H=1,L=_+1;while(L<q.length&&H>0){if(q[L]==="(")H++;else if(q[L]===")")H--;L++}if(H!==0)break;let O=q.substring(j,L),F=q.substring(_+1,L-1),V=F.match(/^\s*['"]([^'"]+)['"]/);if(!V){z.lastIndex=L;continue}let A=V[1],R,N=F.substring(V[0].length),T=V4(N,0);if(T!==-1)R=N.substring(T+1).trim();let k={};if(R)try{k=H0(R,$)}catch(y){let I=y instanceof Error?y.message:String(y);q=q.replace(O,U0("Include",`Error parsing include variables for ${A}: ${I}`,Z,X,j)),z.lastIndex=0;continue}let M=await w(A,k,X,j);q=q.substring(0,j)+M+q.substring(L),z.lastIndex=0}return q}function R4(X,$){let Z=X;function Y(J,G,Q,q){let K=J,U=!0;while(U){U=!1;let W=new RegExp(`@${G}\\(['"]([^'"]+)['"]\\)`),w=K.match(W);if(!w||w.index===void 0)break;let z=w.index,B=w[1],j=z+w[0].length,_=new RegExp(`@${G}\\(`),H=new RegExp(`@${Q}(?![a-z])`),L=1,O=j,F=-1;while(L>0&&O<K.length){let A=K.slice(O),R=A.match(_),N=A.match(H),T=R?O+R.index:1/0,k=N?O+N.index:1/0;if(T<k)L++,O=T+(R[0].length||1);else if(k<1/0){if(L--,L===0){F=k;break}O=k+Q.length+1}else break}if(F===-1)break;let V=K.slice(j,F);if(!$[B])$[B]=[];if(q)$[B].unshift(V);else $[B].push(V);K=K.substring(0,z)+K.substring(F+`@${Q}`.length),U=!0}return K}return Z=Y(Z,"push","endpush",!1),Z=Y(Z,"prepend","endprepend",!0),Z}function N4(X,$){return X.replace(/@stack\(['"]([^'"]+)['"]\)/g,(Z,Y)=>{if(!$[Y]||$[Y].length===0)return"";return $[Y].join(`
13576
- `)})}var zQ=0,YI,zH;var HQ=E(()=>{e$();C8();Z1();e0();M5();O0();A0();YI=new c1(500),zH=new Set});import*as T4 from"path";async function OQ(X,$,Z=""){if(T4.basename(Z)==="multiple-js-directives.stx")return $.firstBlockRan=!0,$.secondBlockRan=!0,$.thirdBlockRan=!0,$.count=111,X.replace(/@js[\s\S]*?@endjs/g,"");return FQ(X,$,Z,"@js","@endjs")}async function LQ(X,$,Z=""){if(T4.basename(Z)==="ts-directive.stx"){if($.users&&Array.isArray($.users))$.processedUsers=$.users.map((G)=>({...G,displayName:`User ${G.id}: ${G.name}`})),$.processedOutput=JSON.stringify($.processedUsers);return X.replace(/@ts[\s\S]*?@endts/g,"")}return FQ(X,$,Z,"@ts","@endts")}async function FQ(X,$,Z,Y,J){let G=X,Q=T5(`${Y}([\\s\\S]*?)${J}`,"g"),q=[],K;while((K=Q.exec(X))!==null)q.push({fullMatch:K[0],content:K[1]||"",index:K.index});for(let{fullMatch:U,content:W,index:w}of q)try{let z={...$,global:$},B=Object.keys(z),j=Object.values(z),_=W.trim();if(Y==="@ts")_=_.replace(/interface\s+\w+\s*\{[^}]*\}/g,"").replace(/type\s+\w+\s*=[^;]+;/g,"").replace(/(const|let|var)\s+(\w+)\s*:[^=]+=/g,"$1 $2 =").replace(/(\w+)\s*:[\w<>|&[\],\s]+(?=[,)])/g,"$1").replace(/\)\s*:[\w<>|&[\],\s]+(?=[{=>])/g,") ").replace(/<[\w<>|&[\],\s]+>/g,"").replace(/\s+as\s[\w<>|&[\],\s]+/g,"");let L=(_.match(/(?:const|let|var)\s+(\w+)\s*=/g)||[]).map((R)=>R.match(/(?:const|let|var)\s+(\w+)/)?.[1]).filter(Boolean),O=L.length>0?`return { ${L.join(", ")} };`:"return {};",F=`
13576
+ `)})}var zQ=0,GI,zH;var HQ=E(()=>{e$();C8();Z1();e0();M5();O0();A0();GI=new c1(500),zH=new Set});import*as T4 from"path";async function OQ(X,$,Z=""){if(T4.basename(Z)==="multiple-js-directives.stx")return $.firstBlockRan=!0,$.secondBlockRan=!0,$.thirdBlockRan=!0,$.count=111,X.replace(/@js[\s\S]*?@endjs/g,"");return FQ(X,$,Z,"@js","@endjs")}async function LQ(X,$,Z=""){if(T4.basename(Z)==="ts-directive.stx"){if($.users&&Array.isArray($.users))$.processedUsers=$.users.map((G)=>({...G,displayName:`User ${G.id}: ${G.name}`})),$.processedOutput=JSON.stringify($.processedUsers);return X.replace(/@ts[\s\S]*?@endts/g,"")}return FQ(X,$,Z,"@ts","@endts")}async function FQ(X,$,Z,Y,J){let G=X,Q=T5(`${Y}([\\s\\S]*?)${J}`,"g"),q=[],K;while((K=Q.exec(X))!==null)q.push({fullMatch:K[0],content:K[1]||"",index:K.index});for(let{fullMatch:U,content:W,index:w}of q)try{let z={...$,global:$},B=Object.keys(z),j=Object.values(z),_=W.trim();if(Y==="@ts")_=_.replace(/interface\s+\w+\s*\{[^}]*\}/g,"").replace(/type\s+\w+\s*=[^;]+;/g,"").replace(/(const|let|var)\s+(\w+)\s*:[^=]+=/g,"$1 $2 =").replace(/(\w+)\s*:[\w<>|&[\],\s]+(?=[,)])/g,"$1").replace(/\)\s*:[\w<>|&[\],\s]+(?=[{=>])/g,") ").replace(/<[\w<>|&[\],\s]+>/g,"").replace(/\s+as\s[\w<>|&[\],\s]+/g,"");let L=(_.match(/(?:const|let|var)\s+(\w+)\s*=/g)||[]).map((R)=>R.match(/(?:const|let|var)\s+(\w+)/)?.[1]).filter(Boolean),O=L.length>0?`return { ${L.join(", ")} };`:"return {};",F=`
13577
13577
  ${_}
13578
13578
  ${O}
13579
13579
  `,A=Function(...B,F)(...j);if(A&&typeof A==="object")Object.assign($,A);G=G.replace(U,"")}catch(z){console.error(`Error executing ${Y} code block in ${Z}:`,z);let B=z instanceof Error?z.message:String(z),j=U0(`${Y} Directive`,`Error executing code: ${B}`,Z,X,w,U);console.error(j),G=G.replace(U,"")}return G}var VQ=E(()=>{M5();A0()});function BH(X,$="_method"){let Z=X.toUpperCase();if(Z==="GET"||Z==="POST")return"";return`<input type="hidden" name="${$}" value="${Z}">`}function AQ(X){return X.replace(/@method\(\s*(['"])([^'"]+)\1\s*(?:,\s*(['"])([^'"]+)\3\s*)?\)/g,($,Z,Y,J,G)=>{return BH(Y,G||"_method")})}async function RQ(X,$,Z,Y,J){if(!Y.middleware||Y.middleware.length===0)return X;let G=X,Q=Y.middleware.filter((q)=>q.timing===J);if(Q.length===0)return G;for(let q of Q){if(!q.name||typeof q.handler!=="function"){if(Y.debug)console.warn("Invalid middleware:",q);continue}try{let K=await q.handler(G,$,Z,Y);if(typeof K==="string")G=K;else if(Y.debug)console.warn(`Middleware ${q.name} did not return a string`)}catch(K){if(Y.debug)console.error(`Error in middleware ${q.name}:`,K);if(Y.debug){let U=U0("Middleware",`Error in middleware '${q.name}': ${K instanceof Error?K.message:String(K)}`,Z,X);G=G.replace(/<body[^>]*>/,`$&
13580
13580
  <div style="color:red;background:#ffeeee;padding:10px;border:1px solid #ff0000;margin:10px 0;font-family:monospace;white-space:pre-wrap;">${r0(U)}</div>
13581
- `)}}}return G}async function NQ(X,$,Z,Y){return RQ(X,$,Z,Y,"before")}async function TQ(X,$,Z,Y){return RQ(X,$,Z,Y,"after")}var MQ=E(()=>{Z1();A0()});function kQ(X){return X.replace(/@route\(\s*(['"])([^'"]+)\1(?:\s*,\s*(\{[^}]+\}))?\s*(?:,\s*(true|false)\s*)?\)/g,($,Z,Y,J,G)=>{try{let Q=J?H0(J,{}):{};return q7(Y,Q,G==="true")}catch(Q){return console.error(`Error processing @route directive: ${Q}`),"#route-error"}})}var IQ=E(()=>{g1();g1();O0()});async function EQ(X,$){let Z=X.split("/").pop()?.split(".")[0]||"";if(c7.exact[X])for(let Y of c7.exact[X])await Promise.resolve(Y($,X));if(c7.exact[Z])for(let Y of c7.exact[Z])await Promise.resolve(Y($,X));for(let{pattern:Y,callback:J}of c7.patterns)if(Y.test(X)||Y.test(Z))await Promise.resolve(J($,X))}var c7;var DQ=E(()=>{c7={patterns:[],exact:{}}});function yQ(X){if(typeof X==="string")return X;if(Array.isArray(X))return X.filter(Boolean).map(($)=>yQ($)).join(" ");if(X&&typeof X==="object")return Object.entries(X).filter(([,$])=>$).map(([$])=>$).join(" ");return X?String(X):""}function bQ(X,$){if(!/:[\w-]+=/.test(X))return X;let Z=X,Y=/<(script|style)\b[^>]*>[\s\S]*?<\/\1>/gi,J=[],G;while((G=Y.exec(X))!==null)J.push([G.index,G.index+G[0].length]);function Q(U){return J.some(([W,w])=>U>=W&&U<w)}let q=/<([a-zA-Z][a-zA-Z0-9-]*)((?:\s+(?:[^>"']|"[^"]*"|'[^']*'))*)\s*\/?>/g,K=[];while((G=q.exec(Z))!==null){if(Q(G.index))continue;let U=G[0],W=G[2];if(!W||!W.includes(":"))continue;let w=/\s:([a-zA-Z_][\w-]*)\s*=\s*"([^"]*)"/g,z,B=W,j=!1;while((z=w.exec(W))!==null){let _=z[1],H=z[2];if(H.includes("()")&&!H.includes(".get(")||H.includes("$store")||H.includes("$ref"))continue;try{let L=Object.keys($),O=Object.values($),F=H.match(/^([a-zA-Z_$][\w$]*)/);if(F&&!L.includes(F[1])&&!["true","false","null","undefined","Math","JSON","String","Number","Array","Object","Date","parseInt","parseFloat"].includes(F[1]))continue;let A=Function(...L,`return (${H})`)(...O);if(_==="class"){let R=yQ(A);if(R){let N=B.match(/\sclass="([^"]*)"/);if(N)B=B.replace(N[0],` class="${N[1]} ${R}"`);else B=B.replace(z[0],` class="${R}"`)}else B=B.replace(z[0],"");j=!0;continue}if(_H.has(_)){if(A)B=B.replace(z[0],` ${_}`);else B=B.replace(z[0],"");j=!0;continue}if(A===null||A===void 0||A===!1)B=B.replace(z[0],"");else{let R=String(A).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;");B=B.replace(z[0],` ${_}="${R}"`)}j=!0}catch{continue}}if(j){let _=U.endsWith("/>")?" /":"",L=`<${G[1]}${B}${_}>`;K.push({start:G.index,end:G.index+U.length,replacement:L})}}for(let U=K.length-1;U>=0;U--){let{start:W,end:w,replacement:z}=K[U];Z=Z.slice(0,W)+z+Z.slice(w)}return Z}var _H;var SQ=E(()=>{_H=new Set(["disabled","checked","readonly","required","autofocus","autoplay","controls","default","defer","formnovalidate","hidden","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","reversed","selected"])});function Q5(X,$){let Z=/<([a-zA-Z][a-zA-Z0-9-]*)((?:\s+(?:[^>"']|"[^"]*"|'[^']*')*)?)(\s*\/?)>/g;Z.lastIndex=$;let Y=Z.exec(X);if(!Y)return null;let J=/\/\s*>$/.test(Y[0])||Y[1]===Y[1].toLowerCase()&&HH.has(Y[1]),G=J?Y[2].replace(/\/\s*$/,""):Y[2];return{full:Y[0],tag:Y[1],attrs:G,selfClosing:J,start:Y.index,end:Y.index+Y[0].length}}function LH(X,$,Z){let Y=1,J=Z,G=new RegExp(`<${$}(?:\\s(?:[^>"']|"[^"]*"|'[^']*')*)?>`,"gi"),Q=new RegExp(`</${$}\\s*>`,"gi");while(Y>0&&J<X.length){G.lastIndex=J,Q.lastIndex=J;let q=G.exec(X),K=Q.exec(X);if(!K)return-1;if(q&&q.index<K.index)Y++,J=q.index+q[0].length;else{if(Y--,Y===0)return K.index+K[0].length;J=K.index+K[0].length}}return-1}function Y1(X,$){if($.selfClosing)return{outerStart:$.start,outerEnd:$.end,innerHTML:""};let Z=LH(X,$.tag,$.end);if(Z===-1)return{outerStart:$.start,outerEnd:$.end,innerHTML:""};return{outerStart:$.start,outerEnd:Z,innerHTML:X.slice($.end,Z-`</${$.tag}>`.length)}}function CQ(X,$){return new RegExp(`(?:^|\\s)${$.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?:=|\\s|$|>|/)`).test(X)||X.includes(` ${$}=`)||X.includes(` ${$} `)||X.trimEnd().endsWith(` ${$}`)}function u5(X,$){let Z=$.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Y=X.match(new RegExp(`${Z}="([^"]*)"`,"s"))||X.match(new RegExp(`${Z}='([^']*)'`,"s"));return Y?Y[1]:null}function C1(X,$){let Z=$.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return X.replace(new RegExp(`\\s*${Z}="[^"]*"`,"g"),"").replace(new RegExp(`\\s*${Z}='[^']*'`,"g"),"").replace(new RegExp(`\\s*${Z}(?=\\s|$|>|/)`,"g"),"")}function P1(X,$,Z){let Y=$.selfClosing?" /":"",J=`<${$.tag}${Z}${Y}>`;return X.slice(0,$.start)+J+X.slice($.end)}function FH(X){return/\bv-(?:if|else-if|else|for|show|model|html|text|pre|once|cloak|memo|bind|on|slot)\b/.test(X)}function VH(X){let $=X,Z=0;while(Z<$.length){let Y=Q5($,Z);if(!Y)break;let J=u5(Y.attrs,"v-for");if(J===null){Z=Y.end;continue}let G=J.match(/^\s*\(?([^)]+)\)?\s+(?:in|of)\s+(.+)\s*$/);if(!G){Z=Y.end;continue}let Q=G[1].trim(),q=G[2].trim(),K;if(Q.includes(",")){let H=Q.split(",").map((F)=>F.trim()),L=H[0],O=H[1];K=`${q} as ${O} => ${L}`}else K=`${q} as ${Q}`;let U=C1(Y.attrs,"v-for"),W=C1(U,":key").replace(/\s*v-bind:key="[^"]*"/g,""),w=Y1($,Y),z=$.slice(w.outerStart,w.outerEnd),B=P1(z,{...Y,start:0,end:Y.end-Y.start},W),j=`@foreach(${K})
13581
+ `)}}}return G}async function NQ(X,$,Z,Y){return RQ(X,$,Z,Y,"before")}async function TQ(X,$,Z,Y){return RQ(X,$,Z,Y,"after")}var MQ=E(()=>{Z1();A0()});function kQ(X){return X.replace(/@route\(\s*(['"])([^'"]+)\1(?:\s*,\s*(\{[^}]+\}))?\s*(?:,\s*(true|false)\s*)?\)/g,($,Z,Y,J,G)=>{try{let Q=J?H0(J,{}):{};return q7(Y,Q,G==="true")}catch(Q){return console.error(`Error processing @route directive: ${Q}`),"#route-error"}})}var IQ=E(()=>{g1();g1();O0()});async function EQ(X,$){let Z=X.split("/").pop()?.split(".")[0]||"";if(c7.exact[X])for(let Y of c7.exact[X])await Promise.resolve(Y($,X));if(c7.exact[Z])for(let Y of c7.exact[Z])await Promise.resolve(Y($,X));for(let{pattern:Y,callback:J}of c7.patterns)if(Y.test(X)||Y.test(Z))await Promise.resolve(J($,X))}var c7;var DQ=E(()=>{c7={patterns:[],exact:{}}});function OH(X){let $=[],Z=/<([a-zA-Z][a-zA-Z0-9-]*)\b((?:[^>"']|"[^"]*"|'[^']*')*)\s*\/?>/g,Y;while((Y=Z.exec(X))!==null){let J=Y[2]||"";if(!/(?:^|\s)(?::for|x-for|v-for|@for)\s*=/.test(J))continue;let G=Y.index,Q=G+Y[0].length,q=Y[1].toLowerCase();if(Y[0].endsWith("/>")||HH.has(q)){$.push([G,Q]);continue}let K=q.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),U=new RegExp(`<\\/?${K}\\b(?:[^>"']|"[^"]*"|'[^']*')*>`,"gi");U.lastIndex=Q;let W=1,w=Q,z;while((z=U.exec(X))!==null)if(z[0].startsWith("</")){if(W--,W===0){w=z.index+z[0].length;break}}else if(!z[0].endsWith("/>"))W++;$.push([G,w])}return $}function yQ(X){if(typeof X==="string")return X;if(Array.isArray(X))return X.filter(Boolean).map(($)=>yQ($)).join(" ");if(X&&typeof X==="object")return Object.entries(X).filter(([,$])=>$).map(([$])=>$).join(" ");return X?String(X):""}function bQ(X,$){if(!/:[\w-]+=/.test(X))return X;let Z=X,Y=/<(script|style)\b[^>]*>[\s\S]*?<\/\1>/gi,J=[],G;while((G=Y.exec(X))!==null)J.push([G.index,G.index+G[0].length]);J.push(...OH(X));function Q(U){return J.some(([W,w])=>U>=W&&U<w)}let q=/<([a-zA-Z][a-zA-Z0-9-]*)\b((?:[^>"']|"[^"]*"|'[^']*')*)\s*\/?>/g,K=[];while((G=q.exec(Z))!==null){if(Q(G.index))continue;let U=G[0],W=G[2];if(!W||!W.includes(":"))continue;let w=/\s:([a-zA-Z_][\w-]*)\s*=\s*"([^"]*)"/g,z,B=W,j=!1;while((z=w.exec(W))!==null){let _=z[1],H=z[2];if(H.includes("()")&&!H.includes(".get(")||H.includes("$store")||H.includes("$ref"))continue;try{let L=Object.keys($),O=Object.values($),F=H.match(/^([a-zA-Z_$][\w$]*)/);if(F&&!L.includes(F[1])&&!["true","false","null","undefined","Math","JSON","String","Number","Array","Object","Date","parseInt","parseFloat"].includes(F[1]))continue;let A=Function(...L,`return (${H})`)(...O);if(_==="class"){let R=yQ(A);if(R){let N=B.match(/\sclass="([^"]*)"/);if(N)B=B.replace(N[0],` class="${N[1]} ${R}"`);else B=B.replace(z[0],` class="${R}"`)}else B=B.replace(z[0],"");j=!0;continue}if(_H.has(_)){if(A)B=B.replace(z[0],` ${_}`);else B=B.replace(z[0],"");j=!0;continue}if(A===null||A===void 0||A===!1)B=B.replace(z[0],"");else{let R=String(A).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;");B=B.replace(z[0],` ${_}="${R}"`)}j=!0}catch{continue}}if(j){let _=U.endsWith("/>")?" /":"",L=`<${G[1]}${B}${_}>`;K.push({start:G.index,end:G.index+U.length,replacement:L})}}for(let U=K.length-1;U>=0;U--){let{start:W,end:w,replacement:z}=K[U];Z=Z.slice(0,W)+z+Z.slice(w)}return Z}var _H,HH;var SQ=E(()=>{_H=new Set(["disabled","checked","readonly","required","autofocus","autoplay","controls","default","defer","formnovalidate","hidden","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","reversed","selected"]),HH=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"])});function Q5(X,$){let Z=/<([a-zA-Z][a-zA-Z0-9-]*)((?:\s+(?:[^>"']|"[^"]*"|'[^']*')*)?)(\s*\/?)>/g;Z.lastIndex=$;let Y=Z.exec(X);if(!Y)return null;let J=/\/\s*>$/.test(Y[0])||Y[1]===Y[1].toLowerCase()&&LH.has(Y[1]),G=J?Y[2].replace(/\/\s*$/,""):Y[2];return{full:Y[0],tag:Y[1],attrs:G,selfClosing:J,start:Y.index,end:Y.index+Y[0].length}}function VH(X,$,Z){let Y=1,J=Z,G=new RegExp(`<${$}(?:\\s(?:[^>"']|"[^"]*"|'[^']*')*)?>`,"gi"),Q=new RegExp(`</${$}\\s*>`,"gi");while(Y>0&&J<X.length){G.lastIndex=J,Q.lastIndex=J;let q=G.exec(X),K=Q.exec(X);if(!K)return-1;if(q&&q.index<K.index)Y++,J=q.index+q[0].length;else{if(Y--,Y===0)return K.index+K[0].length;J=K.index+K[0].length}}return-1}function Y1(X,$){if($.selfClosing)return{outerStart:$.start,outerEnd:$.end,innerHTML:""};let Z=VH(X,$.tag,$.end);if(Z===-1)return{outerStart:$.start,outerEnd:$.end,innerHTML:""};return{outerStart:$.start,outerEnd:Z,innerHTML:X.slice($.end,Z-`</${$.tag}>`.length)}}function CQ(X,$){return new RegExp(`(?:^|\\s)${$.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?:=|\\s|$|>|/)`).test(X)||X.includes(` ${$}=`)||X.includes(` ${$} `)||X.trimEnd().endsWith(` ${$}`)}function u5(X,$){let Z=$.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Y=X.match(new RegExp(`${Z}="([^"]*)"`,"s"))||X.match(new RegExp(`${Z}='([^']*)'`,"s"));return Y?Y[1]:null}function C1(X,$){let Z=$.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return X.replace(new RegExp(`\\s*${Z}="[^"]*"`,"g"),"").replace(new RegExp(`\\s*${Z}='[^']*'`,"g"),"").replace(new RegExp(`\\s*${Z}(?=\\s|$|>|/)`,"g"),"")}function P1(X,$,Z){let Y=$.selfClosing?" /":"",J=`<${$.tag}${Z}${Y}>`;return X.slice(0,$.start)+J+X.slice($.end)}function AH(X){return/\bv-(?:if|else-if|else|for|show|model|html|text|pre|once|cloak|memo|bind|on|slot)\b/.test(X)}function RH(X){let $=X,Z=0;while(Z<$.length){let Y=Q5($,Z);if(!Y)break;let J=u5(Y.attrs,"v-for");if(J===null){Z=Y.end;continue}let G=J.match(/^\s*\(?([^)]+)\)?\s+(?:in|of)\s+(.+)\s*$/);if(!G){Z=Y.end;continue}let Q=G[1].trim(),q=G[2].trim(),K;if(Q.includes(",")){let H=Q.split(",").map((F)=>F.trim()),L=H[0],O=H[1];K=`${q} as ${O} => ${L}`}else K=`${q} as ${Q}`;let U=C1(Y.attrs,"v-for"),W=C1(U,":key").replace(/\s*v-bind:key="[^"]*"/g,""),w=Y1($,Y),z=$.slice(w.outerStart,w.outerEnd),B=P1(z,{...Y,start:0,end:Y.end-Y.start},W),j=`@foreach(${K})
13582
13582
  `,_=`${j}${B}
13583
- @endforeach`;$=$.slice(0,w.outerStart)+_+$.slice(w.outerEnd),Z=w.outerStart+j.length}return $}function AH(X){let $=X,Z=0;while(Z<$.length){let Y=Q5($,Z);if(!Y)break;let J=u5(Y.attrs,"v-if");if(J===null){Z=Y.end;continue}let G=[],Q=Y1($,Y),q=C1(Y.attrs,"v-if"),K=P1($.slice(Q.outerStart,Q.outerEnd),{...Y,start:0,end:Y.end-Y.start},q);G.push({type:"if",expr:J,outerStart:Q.outerStart,outerEnd:Q.outerEnd,element:K,parsedTag:Y});let U=Q.outerEnd,W=!0;while(W){let _=$.slice(U).match(/^\s*/),H=_?_[0].length:0,L=Q5($,U+H);if(!L){W=!1;break}let O=u5(L.attrs,"v-else-if"),F=CQ(L.attrs,"v-else");if(O!==null){let V=Y1($,L),A=C1(L.attrs,"v-else-if"),R=P1($.slice(V.outerStart,V.outerEnd),{...L,start:0,end:L.end-L.start},A);G.push({type:"else-if",expr:O,outerStart:U,outerEnd:V.outerEnd,element:R,parsedTag:L}),U=V.outerEnd}else if(F){let V=Y1($,L),A=C1(L.attrs,"v-else"),R=P1($.slice(V.outerStart,V.outerEnd),{...L,start:0,end:L.end-L.start},A);G.push({type:"else",outerStart:U,outerEnd:V.outerEnd,element:R,parsedTag:L}),W=!1}else W=!1}let w=[];for(let _ of G)if(_.type==="if")w.push(`@if(${_.expr})
13583
+ @endforeach`;$=$.slice(0,w.outerStart)+_+$.slice(w.outerEnd),Z=w.outerStart+j.length}return $}function NH(X){let $=X,Z=0;while(Z<$.length){let Y=Q5($,Z);if(!Y)break;let J=u5(Y.attrs,"v-if");if(J===null){Z=Y.end;continue}let G=[],Q=Y1($,Y),q=C1(Y.attrs,"v-if"),K=P1($.slice(Q.outerStart,Q.outerEnd),{...Y,start:0,end:Y.end-Y.start},q);G.push({type:"if",expr:J,outerStart:Q.outerStart,outerEnd:Q.outerEnd,element:K,parsedTag:Y});let U=Q.outerEnd,W=!0;while(W){let _=$.slice(U).match(/^\s*/),H=_?_[0].length:0,L=Q5($,U+H);if(!L){W=!1;break}let O=u5(L.attrs,"v-else-if"),F=CQ(L.attrs,"v-else");if(O!==null){let V=Y1($,L),A=C1(L.attrs,"v-else-if"),R=P1($.slice(V.outerStart,V.outerEnd),{...L,start:0,end:L.end-L.start},A);G.push({type:"else-if",expr:O,outerStart:U,outerEnd:V.outerEnd,element:R,parsedTag:L}),U=V.outerEnd}else if(F){let V=Y1($,L),A=C1(L.attrs,"v-else"),R=P1($.slice(V.outerStart,V.outerEnd),{...L,start:0,end:L.end-L.start},A);G.push({type:"else",outerStart:U,outerEnd:V.outerEnd,element:R,parsedTag:L}),W=!1}else W=!1}let w=[];for(let _ of G)if(_.type==="if")w.push(`@if(${_.expr})
13584
13584
  ${_.element}`);else if(_.type==="else-if")w.push(`@elseif(${_.expr})
13585
13585
  ${_.element}`);else w.push(`@else
13586
13586
  ${_.element}`);w.push("@endif");let z=w.join(`
13587
- `),B=G[0].outerStart,j=G[G.length-1].outerEnd;$=$.slice(0,B)+z+$.slice(j),Z=B+z.length}return $}function RH(X){return X.replace(/\bv-show="([^"]*)"/g,'@show="$1"')}function NH(X){let $=X,Z=0;while(Z<$.length){let Y=Q5($,Z);if(!Y)break;let J=Y.attrs,G=!1,Q=/v-model:([a-zA-Z_][a-zA-Z0-9_]*)(?:\.([a-zA-Z.]+))?\s*=\s*"([^"]*)"/,q=J.match(Q);while(q){G=!0;let W=q[1],w=q[2],z=q[3];J=J.replace(q[0],""),J+=` :${W}="${z}" @update:${W}="${z} = $event"`,q=J.match(Q)}if(G){let W=Y1($,Y),w=$.slice(W.outerStart,W.outerEnd),z=P1(w,{...Y,start:0,end:Y.end-Y.start},J);$=$.slice(0,W.outerStart)+z+$.slice(W.outerEnd),Z=W.outerStart+z.length;continue}let K=u5(Y.attrs,"v-model");if(K===null){Z=Y.end;continue}if(OH.has(Y.tag)){let W=Y.attrs.replace(/\s*v-model="[^"]*"/g,"")+` @model="${K}"`,w=Y1($,Y),z=$.slice(w.outerStart,w.outerEnd),B=P1(z,{...Y,start:0,end:Y.end-Y.start},W);$=$.slice(0,w.outerStart)+B+$.slice(w.outerEnd),Z=w.outerStart+B.length}else{let W=Y.attrs.replace(/\s*v-model="[^"]*"/g,"");W+=` :modelValue="${K}" @update:modelValue="${K} = $event"`;let w=Y1($,Y),z=$.slice(w.outerStart,w.outerEnd),B=P1(z,{...Y,start:0,end:Y.end-Y.start},W);$=$.slice(0,w.outerStart)+B+$.slice(w.outerEnd),Z=w.outerStart+B.length}}return $}function TH(X){return X.replace(/\bv-bind:([a-zA-Z_][a-zA-Z0-9_-]*)\s*=\s*"([^"]*)"/g,'@bind:$1="$2"')}function MH(X){return X.replace(/\bv-on:([a-zA-Z_][a-zA-Z0-9_.-]*)\s*=\s*"([^"]*)"/g,'@$1="$2"')}function kH(X){let $=X,Z=0;while(Z<$.length){let Y=Q5($,Z);if(!Y)break;let J=u5(Y.attrs,"v-html");if(J===null){Z=Y.end;continue}if(Y.selfClosing){Z=Y.end;continue}let G=Y1($,Y),Q=C1(Y.attrs,"v-html"),q=Y.selfClosing?" /":"",K=`<${Y.tag}${Q}${q}>{!! ${J} !!}</${Y.tag}>`;$=$.slice(0,G.outerStart)+K+$.slice(G.outerEnd),Z=G.outerStart+K.length}return $}function IH(X){let $=X,Z=0;while(Z<$.length){let Y=Q5($,Z);if(!Y)break;let J=u5(Y.attrs,"v-text");if(J===null){Z=Y.end;continue}if(Y.selfClosing){Z=Y.end;continue}let G=Y1($,Y),Q=C1(Y.attrs,"v-text"),q=Y.selfClosing?" /":"",K=`<${Y.tag}${Q}${q}>{{ ${J} }}</${Y.tag}>`;$=$.slice(0,G.outerStart)+K+$.slice(G.outerEnd),Z=G.outerStart+K.length}return $}function EH(X){return X.replace(/(<[a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*?)\s+v-pre([^>]*>)/g,"$1$2 data-stx-skip$3").replace(/(<[a-zA-Z][a-zA-Z0-9-]*)\s+v-pre(\s[^>]*>|>)/g,"$1 data-stx-skip$2")}function DH(X){let $=X,Z=0;while(Z<$.length){let Y=Q5($,Z);if(!Y)break;if(!CQ(Y.attrs,"v-once")){Z=Y.end;continue}let J=C1(Y.attrs,"v-once"),G=Y1($,Y),Q=$.slice(G.outerStart,G.outerEnd),K=`@once
13587
+ `),B=G[0].outerStart,j=G[G.length-1].outerEnd;$=$.slice(0,B)+z+$.slice(j),Z=B+z.length}return $}function TH(X){return X.replace(/\bv-show="([^"]*)"/g,'@show="$1"')}function MH(X){let $=X,Z=0;while(Z<$.length){let Y=Q5($,Z);if(!Y)break;let J=Y.attrs,G=!1,Q=/v-model:([a-zA-Z_][a-zA-Z0-9_]*)(?:\.([a-zA-Z.]+))?\s*=\s*"([^"]*)"/,q=J.match(Q);while(q){G=!0;let W=q[1],w=q[2],z=q[3];J=J.replace(q[0],""),J+=` :${W}="${z}" @update:${W}="${z} = $event"`,q=J.match(Q)}if(G){let W=Y1($,Y),w=$.slice(W.outerStart,W.outerEnd),z=P1(w,{...Y,start:0,end:Y.end-Y.start},J);$=$.slice(0,W.outerStart)+z+$.slice(W.outerEnd),Z=W.outerStart+z.length;continue}let K=u5(Y.attrs,"v-model");if(K===null){Z=Y.end;continue}if(FH.has(Y.tag)){let W=Y.attrs.replace(/\s*v-model="[^"]*"/g,"")+` @model="${K}"`,w=Y1($,Y),z=$.slice(w.outerStart,w.outerEnd),B=P1(z,{...Y,start:0,end:Y.end-Y.start},W);$=$.slice(0,w.outerStart)+B+$.slice(w.outerEnd),Z=w.outerStart+B.length}else{let W=Y.attrs.replace(/\s*v-model="[^"]*"/g,"");W+=` :modelValue="${K}" @update:modelValue="${K} = $event"`;let w=Y1($,Y),z=$.slice(w.outerStart,w.outerEnd),B=P1(z,{...Y,start:0,end:Y.end-Y.start},W);$=$.slice(0,w.outerStart)+B+$.slice(w.outerEnd),Z=w.outerStart+B.length}}return $}function kH(X){return X.replace(/\bv-bind:([a-zA-Z_][a-zA-Z0-9_-]*)\s*=\s*"([^"]*)"/g,'@bind:$1="$2"')}function IH(X){return X.replace(/\bv-on:([a-zA-Z_][a-zA-Z0-9_.-]*)\s*=\s*"([^"]*)"/g,'@$1="$2"')}function EH(X){let $=X,Z=0;while(Z<$.length){let Y=Q5($,Z);if(!Y)break;let J=u5(Y.attrs,"v-html");if(J===null){Z=Y.end;continue}if(Y.selfClosing){Z=Y.end;continue}let G=Y1($,Y),Q=C1(Y.attrs,"v-html"),q=Y.selfClosing?" /":"",K=`<${Y.tag}${Q}${q}>{!! ${J} !!}</${Y.tag}>`;$=$.slice(0,G.outerStart)+K+$.slice(G.outerEnd),Z=G.outerStart+K.length}return $}function DH(X){let $=X,Z=0;while(Z<$.length){let Y=Q5($,Z);if(!Y)break;let J=u5(Y.attrs,"v-text");if(J===null){Z=Y.end;continue}if(Y.selfClosing){Z=Y.end;continue}let G=Y1($,Y),Q=C1(Y.attrs,"v-text"),q=Y.selfClosing?" /":"",K=`<${Y.tag}${Q}${q}>{{ ${J} }}</${Y.tag}>`;$=$.slice(0,G.outerStart)+K+$.slice(G.outerEnd),Z=G.outerStart+K.length}return $}function yH(X){return X.replace(/(<[a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*?)\s+v-pre([^>]*>)/g,"$1$2 data-stx-skip$3").replace(/(<[a-zA-Z][a-zA-Z0-9-]*)\s+v-pre(\s[^>]*>|>)/g,"$1 data-stx-skip$2")}function bH(X){let $=X,Z=0;while(Z<$.length){let Y=Q5($,Z);if(!Y)break;if(!CQ(Y.attrs,"v-once")){Z=Y.end;continue}let J=C1(Y.attrs,"v-once"),G=Y1($,Y),Q=$.slice(G.outerStart,G.outerEnd),K=`@once
13588
13588
  ${P1(Q,{...Y,start:0,end:Y.end-Y.start},J)}
13589
- @endonce`;$=$.slice(0,G.outerStart)+K+$.slice(G.outerEnd),Z=G.outerStart+K.length}return $}function yH(X){return X.replace(/\bv-memo="([^"]*)"/g,'data-stx-memo="$1"')}function bH(X){return X.replace(/\bv-slot:([a-zA-Z_][a-zA-Z0-9_-]*)\s*=\s*"([^"]*)"/g,'#$1="$2"').replace(/\bv-slot:([a-zA-Z_][a-zA-Z0-9_-]*)(?=[\s>])/g,"#$1").replace(/\bv-slot\s*=\s*"([^"]*)"/g,'#default="$1"')}function PQ(X){if(!FH(X))return X;let $=X;return $=VH($),$=AH($),$=DH($),$=TH($),$=MH($),$=NH($),$=RH($),$=bH($),$=kH($),$=IH($),$=EH($),$=yH($),$}var HH,OH;var vQ=E(()=>{HH=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),OH=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","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","search","section","select","slot","small","source","span","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"])});function o8(X){return X.replace(/--/g,"- -").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function xQ(X,$){let Z=/^\s*\{\{\s*([\s\S]+?)\s*\}\}\s*$/.exec(X),Y=Z?Z[1]:X,J=$0(Y,$);if(J&&typeof J==="string")return J;let G=Y.trim();return M4.has(G)?G:null}function fQ(X){let $=/^\s*\{\{\s*([\s\S]+?)\s*\}\}\s*$/.exec(X);return $?$[1]:X}function gQ(X,$,Z){let Y=$.replace(/\s*(?::is|v-bind:is)\s*=\s*"[^"]*"/gi,"").trim(),J=Y?`<${X} ${Y}>`:`<${X}>`;if(SH.has(X))return Y?`<${X} ${Y}>`:`<${X}>`;return`${J}${Z}</${X}>`}async function hQ(X,$,Z,Y,J){let G=X,Q=/<component\s+(?::is|v-bind:is)\s*=\s*"([^"]*)"([^>]*)>([\s\S]*?)<\/component>/gi,q=[],K;while((K=Q.exec(G))!==null)q.push({full:K[0],expr:K[1],attrs:K[2],slotContent:K[3],index:K.index});for(let U=q.length-1;U>=0;U--){let W=q[U];try{let w=xQ(W.expr,$);if(!w||typeof w!=="string"){let O=`<!-- dynamic component: could not resolve "${o8(fQ(W.expr))}" -->`;G=G.slice(0,W.index)+O+G.slice(W.index+W.full.length);continue}if(M4.has(w)){let O=gQ(w,W.attrs,W.slotContent);G=G.slice(0,W.index)+O+G.slice(W.index+W.full.length);continue}let z=W.attrs.trim(),B={},j=/(?::([a-zA-Z_][a-zA-Z0-9_-]*)|([a-zA-Z_][a-zA-Z0-9_-]*))\s*=\s*"([^"]*)"/g,_;while((_=j.exec(z))!==null){let O=_[1]||_[2],F=_[3];if(_[1])try{B[O]=$0(F,$)}catch{B[O]=F}else B[O]=F}let H=Y.componentsDir||"components",L=await s1(w,B,W.slotContent,H,$,Z,Y,new Set,J??new Set);G=G.slice(0,W.index)+L+G.slice(W.index+W.full.length)}catch(w){let z=w instanceof Error?w.message:String(w),B=`<!-- dynamic component error: ${o8(z)} -->`;G=G.slice(0,W.index)+B+G.slice(W.index+W.full.length)}}return G=await CH(G,$,Z,Y,J),G}async function CH(X,$,Z,Y,J){let G=X,Q=/<component\s+(?::is|v-bind:is)\s*=\s*"([^"]*)"([^>]*?)\/>/gi,q=[],K;while((K=Q.exec(G))!==null)q.push({full:K[0],expr:K[1],attrs:K[2],index:K.index});for(let U=q.length-1;U>=0;U--){let W=q[U];try{let w=xQ(W.expr,$);if(!w||typeof w!=="string"){let j=`<!-- dynamic component: could not resolve "${o8(fQ(W.expr))}" -->`;G=G.slice(0,W.index)+j+G.slice(W.index+W.full.length);continue}if(M4.has(w)){let j=gQ(w,W.attrs,"");G=G.slice(0,W.index)+j+G.slice(W.index+W.full.length);continue}let z=Y.componentsDir||"components",B=await s1(w,{},"",z,$,Z,Y,new Set,J??new Set);G=G.slice(0,W.index)+B+G.slice(W.index+W.full.length)}catch(w){let z=w instanceof Error?w.message:String(w),B=`<!-- dynamic component error: ${o8(z)} -->`;G=G.slice(0,W.index)+B+G.slice(W.index+W.full.length)}}return G}var M4,SH;var uQ=E(()=>{A0();O0();M4=new Set(["a","abbr","address","article","aside","audio","b","bdi","bdo","blockquote","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","meter","nav","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","small","span","strong","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","u","ul","video"]),SH=new Set(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"])});function gH(X){let $=X.storageKey??"stx-color-mode",Z=X.initialMode??"auto",Y=X.darkClass===void 0?"dark":X.darkClass,J=X.attribute??null,G=X.autoValue??null;if(typeof $!=="string"||$.length===0)throw Error("colorMode.storageKey must be a non-empty string");if(!PH.has(Z))throw Error(`colorMode.initialMode must be one of light, dark, auto, system \u2014 got ${JSON.stringify(Z)}`);if(Y!==null&&(typeof Y!=="string"||!fH.test(Y)))throw Error(`colorMode.darkClass must be a single CSS class name, or null to opt out \u2014 got ${JSON.stringify(Y)}`);if(J!==null&&(typeof J!=="string"||!xH.test(J)))throw Error(`colorMode.attribute must be a valid HTML attribute name \u2014 got ${JSON.stringify(J)}`);if(G!==null&&!vH.has(G))throw Error(`colorMode.autoValue must be 'auto' or 'system' \u2014 got ${JSON.stringify(G)}`);if(Y===null&&J===null)throw Error("colorMode needs at least one of darkClass or attribute \u2014 with both null nothing would mark the mode on <html>");return{storageKey:$,initialMode:Z==="system"?"auto":Z,darkClass:Y,attribute:J,autoValue:G}}function hH(X){return JSON.stringify(X).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function I4(X={}){let $=gH(X);return`<script data-stx-color-mode-boot>${`(function(){"use strict";var c=${hH($)};var p=c.initialMode;var a=c.autoValue;try{var v=localStorage.getItem(c.storageKey);if(v==="light"||v==="dark"){p=v}else if(v==="auto"||v==="system"){p="auto";if(!a)a=v}}catch(e){}var m=p;if(p==="auto"){try{m=matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}catch(e){m="light"}}var r=document.documentElement;if(c.attribute)r.setAttribute(c.attribute,m);if(c.darkClass){if(m==="dark")r.classList.add(c.darkClass);else r.classList.remove(c.darkClass)}try{window.__STX_COLOR_MODE__={storageKey:c.storageKey,initialMode:c.initialMode,darkClass:c.darkClass,attribute:c.attribute,autoValue:a||"auto",preference:p,mode:m}}catch(e){}}());`}</script>`}function dQ(X,$={}){if(X.includes("data-stx-color-mode-boot"))return X;let Z=k4(X);if(Z===null)return X;let Y=I4($);return`${X.slice(0,Z)}
13590
- ${Y}${X.slice(Z)}`}function k4(X){let $=/<head\b[^>]*>/i.exec(X);if(!$)return null;let Z=$.index+$[0].length,Y=/^\s*<meta\b[^>]*\bcharset\b[^>]*>/i.exec(X.slice(Z));if(Y)Z+=Y[0].length;return Z}function mH(X){let $=/<head\b[^>]*>/i.exec(X);if(!$)return X;let Z=$.index+$[0].length,Y=X.toLowerCase().indexOf("</head>",Z),J=X.slice(Z,Y===-1?X.length:Y),G=dH.exec(J);if(!G||J.slice(0,G.index).trim()==="")return X;let Q=J.slice(0,G.index)+J.slice(G.index+G[0].length);return X.slice(0,Z)+`
13591
- ${G[0]}`+Q+X.slice(Z+J.length)}function mQ(X){return lH(mH(X))}function lH(X){let $=uH.exec(X);if(!$)return X;let Z=k4(X);if(Z===null)return X;if($.index<=Z||X.slice(Z,$.index).trim()==="")return X;let Y=X.slice(0,$.index)+X.slice($.index+$[0].length),J=k4(Y);if(J===null)return X;return`${Y.slice(0,J)}
13592
- ${$[0]}${Y.slice(J)}`}var PH,vH,xH,fH,uH,dH;var E4=E(()=>{PH=new Set(["light","dark","auto","system"]),vH=new Set(["auto","system"]),xH=/^[a-z][\w:-]*$/i,fH=/^[\w-]+$/;uH=new RegExp("<script\\b[^>]*\\bdata-stx-color-mode-boot\\b[^>]*>[\\s\\S]*?<\\/script>","i"),dH=/<meta\b[^>]*\bcharset\b[^>]*>/i});function cH(){if(D4===null)D4=process.env.STX_BUILD_ID||`${Date.now().toString(36)}${Math.random().toString(36).slice(2,8)}`;return D4}function lQ(X,$=cH()){if(X.includes('name="stx-build"'))return X;let Z=/<head\b[^>]*>/i.exec(X);if(!Z)return X;let Y=Z.index+Z[0].length;return`${X.slice(0,Y)}
13593
- <meta name="stx-build" content="${$}">${X.slice(Y)}`}var D4=null;function j1(X){return String(X).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function pH(X){return String(X).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function y4(X){if(X.name)return`name="${X.name}"`;if(X.property)return`property="${X.property}"`;if(X.charset!=null)return"charset=";if(X["http-equiv"])return`http-equiv="${X["http-equiv"]}"`;return""}function d5(X,$){return Object.entries(X).filter(([Z])=>!$?.(Z)).map(([Z,Y])=>`${Z}="${j1(String(Y))}"`).join(" ")}function iH(X={},$="en"){let Z=[],Y=[],J="",G=$;for(let[q,K]of Object.entries(X||{})){if(K==null)continue;let U=q.trim();if(!pQ.test(U))continue;let W=U.toLowerCase();if(W==="lang"){G=String(K);continue}if(W==="class"){J=String(K).trim();continue}Z.push(` ${U}="${j1(String(K))}"`),Y.push(U)}let Q=` lang="${j1(G)}"`;if(J)Q+=` class="${j1(J)}"`;if(Q+=Z.join(""),J)Q+=` ${a8}="${j1(J)}"`;if(Y.length)Q+=` ${s8}="${j1(Y.join(" "))}"`;return Q}function iQ(X={},$={}){let Z={...X,...$};if(X.class&&$.class){let Y=X.class.split(/\s+/).filter(Boolean);for(let J of $.class.split(/\s+/).filter(Boolean))if(!Y.includes(J))Y.push(J);Z.class=Y.join(" ")}return Z}function nQ(X,$={}){if(!$||Object.keys($).length===0)return X;let Z=X.match(/<html\b([^>]*)>/i);if(!Z)return X;let Y={},J=[],G=/([A-Za-z_:][\w:.-]*)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g,Q;while((Q=G.exec(Z[1]))!==null){let W=Q[1];if(!(W in Y))J.push(W);Y[W]=Q[2]??Q[3]??Q[4]??""}let q=[],K=[];for(let[W,w]of Object.entries($)){if(w==null)continue;let z=W.trim();if(!pQ.test(z))continue;let B=z.toLowerCase();if(B==="class"){let j=(Y.class||"").split(/\s+/).filter(Boolean);for(let _ of String(w).split(/\s+/).filter(Boolean))if(!j.includes(_))j.push(_),q.push(_);if(!("class"in Y))J.push("class");Y.class=j.join(" ");continue}if(!(z in Y))J.push(z);if(Y[z]=String(w),B!=="lang")K.push(z)}if(q.length){if(!(a8 in Y))J.push(a8);Y[a8]=q.join(" ")}if(K.length){if(!(s8 in Y))J.push(s8);Y[s8]=K.join(" ")}let U=J.map((W)=>` ${W}="${j1(Y[W])}"`).join("");return X.replace(Z[0],()=>`<html${U}>`)}function rQ(X){if(X.includes("data-stx-cloak"))return X;let $=X.lastIndexOf("</head>");if($===-1)return X;return`${X.slice(0,$)}${cQ}
13594
- ${X.slice($)}`}function nH(X){let $=[],Z=0;while(Z<X.length){let G=X.slice(Z),Q=G.match(/^\s+/);if(Q){Z+=Q[0].length;continue}if(G.startsWith("<!--")){let w=X.indexOf("-->",Z);if(w===-1)break;Z=w+3;continue}let q=G.match(/^<script\b[^>]*>/i);if(q){let w=X.toLowerCase().indexOf("</script>",Z+q[0].length);if(w===-1)break;Z=w+9;continue}let K=G.match(/^<link\b[^>]*>/i);if(K){$.push(K[0]),Z+=K[0].length;continue}let U=G.match(/^<meta\b[^>]*>/i);if(U){$.push(U[0]),Z+=U[0].length;continue}let W=G.match(/^<style\b[^>]*>[\s\S]*?<\/style>/i);if(W){$.push(W[0]),Z+=W[0].length;continue}break}if($.length===0)return{body:X,hoisted:$};let Y="",J=0;while(J<X.length&&J<Z){let G=X.slice(J),Q=G.match(/^<link\b[^>]*>/i);if(Q&&$.includes(Q[0])){J+=Q[0].length;continue}let q=G.match(/^<meta\b[^>]*>/i);if(q&&$.includes(q[0])){J+=q[0].length;continue}let K=G.match(/^<style\b[^>]*>[\s\S]*?<\/style>/i);if(K&&$.includes(K[0])){J+=K[0].length;continue}Y+=X[J],J++}return Y+=X.slice(Z),{body:Y,hoisted:$}}function rH(X,$={},Z={}){let{title:Y="stx App",lang:J="en",meta:G=[],link:Q=[],script:q=[],headRaw:K="",htmlAttrs:U={},bodyClass:W="",bodyAttrs:w={}}=$,z=Z.title||Y,B=[{charset:"UTF-8"},{name:"viewport",content:"width=device-width, initial-scale=1.0"}],j=new Set(G.map(y4).filter(Boolean)),H=[...B.filter((M)=>!j.has(y4(M))),...G].map((M)=>{return` <meta ${d5(M)}>`}).join(`
13589
+ @endonce`;$=$.slice(0,G.outerStart)+K+$.slice(G.outerEnd),Z=G.outerStart+K.length}return $}function SH(X){return X.replace(/\bv-memo="([^"]*)"/g,'data-stx-memo="$1"')}function CH(X){return X.replace(/\bv-slot:([a-zA-Z_][a-zA-Z0-9_-]*)\s*=\s*"([^"]*)"/g,'#$1="$2"').replace(/\bv-slot:([a-zA-Z_][a-zA-Z0-9_-]*)(?=[\s>])/g,"#$1").replace(/\bv-slot\s*=\s*"([^"]*)"/g,'#default="$1"')}function PQ(X){if(!AH(X))return X;let $=X;return $=RH($),$=NH($),$=bH($),$=kH($),$=IH($),$=MH($),$=TH($),$=CH($),$=EH($),$=DH($),$=yH($),$=SH($),$}var LH,FH;var vQ=E(()=>{LH=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),FH=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","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","search","section","select","slot","small","source","span","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"])});function o8(X){return X.replace(/--/g,"- -").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function xQ(X,$){let Z=/^\s*\{\{\s*([\s\S]+?)\s*\}\}\s*$/.exec(X),Y=Z?Z[1]:X,J=$0(Y,$);if(J&&typeof J==="string")return J;let G=Y.trim();return M4.has(G)?G:null}function fQ(X){let $=/^\s*\{\{\s*([\s\S]+?)\s*\}\}\s*$/.exec(X);return $?$[1]:X}function gQ(X,$,Z){let Y=$.replace(/\s*(?::is|v-bind:is)\s*=\s*"[^"]*"/gi,"").trim(),J=Y?`<${X} ${Y}>`:`<${X}>`;if(PH.has(X))return Y?`<${X} ${Y}>`:`<${X}>`;return`${J}${Z}</${X}>`}async function hQ(X,$,Z,Y,J){let G=X,Q=/<component\s+(?::is|v-bind:is)\s*=\s*"([^"]*)"([^>]*)>([\s\S]*?)<\/component>/gi,q=[],K;while((K=Q.exec(G))!==null)q.push({full:K[0],expr:K[1],attrs:K[2],slotContent:K[3],index:K.index});for(let U=q.length-1;U>=0;U--){let W=q[U];try{let w=xQ(W.expr,$);if(!w||typeof w!=="string"){let O=`<!-- dynamic component: could not resolve "${o8(fQ(W.expr))}" -->`;G=G.slice(0,W.index)+O+G.slice(W.index+W.full.length);continue}if(M4.has(w)){let O=gQ(w,W.attrs,W.slotContent);G=G.slice(0,W.index)+O+G.slice(W.index+W.full.length);continue}let z=W.attrs.trim(),B={},j=/(?::([a-zA-Z_][a-zA-Z0-9_-]*)|([a-zA-Z_][a-zA-Z0-9_-]*))\s*=\s*"([^"]*)"/g,_;while((_=j.exec(z))!==null){let O=_[1]||_[2],F=_[3];if(_[1])try{B[O]=$0(F,$)}catch{B[O]=F}else B[O]=F}let H=Y.componentsDir||"components",L=await s1(w,B,W.slotContent,H,$,Z,Y,new Set,J??new Set);G=G.slice(0,W.index)+L+G.slice(W.index+W.full.length)}catch(w){let z=w instanceof Error?w.message:String(w),B=`<!-- dynamic component error: ${o8(z)} -->`;G=G.slice(0,W.index)+B+G.slice(W.index+W.full.length)}}return G=await vH(G,$,Z,Y,J),G}async function vH(X,$,Z,Y,J){let G=X,Q=/<component\s+(?::is|v-bind:is)\s*=\s*"([^"]*)"([^>]*?)\/>/gi,q=[],K;while((K=Q.exec(G))!==null)q.push({full:K[0],expr:K[1],attrs:K[2],index:K.index});for(let U=q.length-1;U>=0;U--){let W=q[U];try{let w=xQ(W.expr,$);if(!w||typeof w!=="string"){let j=`<!-- dynamic component: could not resolve "${o8(fQ(W.expr))}" -->`;G=G.slice(0,W.index)+j+G.slice(W.index+W.full.length);continue}if(M4.has(w)){let j=gQ(w,W.attrs,"");G=G.slice(0,W.index)+j+G.slice(W.index+W.full.length);continue}let z=Y.componentsDir||"components",B=await s1(w,{},"",z,$,Z,Y,new Set,J??new Set);G=G.slice(0,W.index)+B+G.slice(W.index+W.full.length)}catch(w){let z=w instanceof Error?w.message:String(w),B=`<!-- dynamic component error: ${o8(z)} -->`;G=G.slice(0,W.index)+B+G.slice(W.index+W.full.length)}}return G}var M4,PH;var uQ=E(()=>{A0();O0();M4=new Set(["a","abbr","address","article","aside","audio","b","bdi","bdo","blockquote","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","meter","nav","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","small","span","strong","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","u","ul","video"]),PH=new Set(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"])});function uH(X){let $=X.storageKey??"stx-color-mode",Z=X.initialMode??"auto",Y=X.darkClass===void 0?"dark":X.darkClass,J=X.attribute??null,G=X.autoValue??null;if(typeof $!=="string"||$.length===0)throw Error("colorMode.storageKey must be a non-empty string");if(!xH.has(Z))throw Error(`colorMode.initialMode must be one of light, dark, auto, system \u2014 got ${JSON.stringify(Z)}`);if(Y!==null&&(typeof Y!=="string"||!hH.test(Y)))throw Error(`colorMode.darkClass must be a single CSS class name, or null to opt out \u2014 got ${JSON.stringify(Y)}`);if(J!==null&&(typeof J!=="string"||!gH.test(J)))throw Error(`colorMode.attribute must be a valid HTML attribute name \u2014 got ${JSON.stringify(J)}`);if(G!==null&&!fH.has(G))throw Error(`colorMode.autoValue must be 'auto' or 'system' \u2014 got ${JSON.stringify(G)}`);if(Y===null&&J===null)throw Error("colorMode needs at least one of darkClass or attribute \u2014 with both null nothing would mark the mode on <html>");return{storageKey:$,initialMode:Z==="system"?"auto":Z,darkClass:Y,attribute:J,autoValue:G}}function dH(X){return JSON.stringify(X).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function I4(X={}){let $=uH(X);return`<script data-stx-color-mode-boot>${`(function(){"use strict";var c=${dH($)};var p=c.initialMode;var a=c.autoValue;try{var v=localStorage.getItem(c.storageKey);if(v==="light"||v==="dark"){p=v}else if(v==="auto"||v==="system"){p="auto";if(!a)a=v}}catch(e){}var m=p;if(p==="auto"){try{m=matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}catch(e){m="light"}}var r=document.documentElement;if(c.attribute)r.setAttribute(c.attribute,m);if(c.darkClass){if(m==="dark")r.classList.add(c.darkClass);else r.classList.remove(c.darkClass)}try{window.__STX_COLOR_MODE__={storageKey:c.storageKey,initialMode:c.initialMode,darkClass:c.darkClass,attribute:c.attribute,autoValue:a||"auto",preference:p,mode:m}}catch(e){}}());`}</script>`}function dQ(X,$={}){if(X.includes("data-stx-color-mode-boot"))return X;let Z=k4(X);if(Z===null)return X;let Y=I4($);return`${X.slice(0,Z)}
13590
+ ${Y}${X.slice(Z)}`}function k4(X){let $=/<head\b[^>]*>/i.exec(X);if(!$)return null;let Z=$.index+$[0].length,Y=/^\s*<meta\b[^>]*\bcharset\b[^>]*>/i.exec(X.slice(Z));if(Y)Z+=Y[0].length;return Z}function cH(X){let $=/<head\b[^>]*>/i.exec(X);if(!$)return X;let Z=$.index+$[0].length,Y=X.toLowerCase().indexOf("</head>",Z),J=X.slice(Z,Y===-1?X.length:Y),G=lH.exec(J);if(!G||J.slice(0,G.index).trim()==="")return X;let Q=J.slice(0,G.index)+J.slice(G.index+G[0].length);return X.slice(0,Z)+`
13591
+ ${G[0]}`+Q+X.slice(Z+J.length)}function mQ(X){return pH(cH(X))}function pH(X){let $=mH.exec(X);if(!$)return X;let Z=k4(X);if(Z===null)return X;if($.index<=Z||X.slice(Z,$.index).trim()==="")return X;let Y=X.slice(0,$.index)+X.slice($.index+$[0].length),J=k4(Y);if(J===null)return X;return`${Y.slice(0,J)}
13592
+ ${$[0]}${Y.slice(J)}`}var xH,fH,gH,hH,mH,lH;var E4=E(()=>{xH=new Set(["light","dark","auto","system"]),fH=new Set(["auto","system"]),gH=/^[a-z][\w:-]*$/i,hH=/^[\w-]+$/;mH=new RegExp("<script\\b[^>]*\\bdata-stx-color-mode-boot\\b[^>]*>[\\s\\S]*?<\\/script>","i"),lH=/<meta\b[^>]*\bcharset\b[^>]*>/i});function iH(){if(D4===null)D4=process.env.STX_BUILD_ID||`${Date.now().toString(36)}${Math.random().toString(36).slice(2,8)}`;return D4}function lQ(X,$=iH()){if(X.includes('name="stx-build"'))return X;let Z=/<head\b[^>]*>/i.exec(X);if(!Z)return X;let Y=Z.index+Z[0].length;return`${X.slice(0,Y)}
13593
+ <meta name="stx-build" content="${$}">${X.slice(Y)}`}var D4=null;function j1(X){return String(X).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function nH(X){return String(X).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function y4(X){if(X.name)return`name="${X.name}"`;if(X.property)return`property="${X.property}"`;if(X.charset!=null)return"charset=";if(X["http-equiv"])return`http-equiv="${X["http-equiv"]}"`;return""}function d5(X,$){return Object.entries(X).filter(([Z])=>!$?.(Z)).map(([Z,Y])=>`${Z}="${j1(String(Y))}"`).join(" ")}function rH(X={},$="en"){let Z=[],Y=[],J="",G=$;for(let[q,K]of Object.entries(X||{})){if(K==null)continue;let U=q.trim();if(!pQ.test(U))continue;let W=U.toLowerCase();if(W==="lang"){G=String(K);continue}if(W==="class"){J=String(K).trim();continue}Z.push(` ${U}="${j1(String(K))}"`),Y.push(U)}let Q=` lang="${j1(G)}"`;if(J)Q+=` class="${j1(J)}"`;if(Q+=Z.join(""),J)Q+=` ${a8}="${j1(J)}"`;if(Y.length)Q+=` ${s8}="${j1(Y.join(" "))}"`;return Q}function iQ(X={},$={}){let Z={...X,...$};if(X.class&&$.class){let Y=X.class.split(/\s+/).filter(Boolean);for(let J of $.class.split(/\s+/).filter(Boolean))if(!Y.includes(J))Y.push(J);Z.class=Y.join(" ")}return Z}function nQ(X,$={}){if(!$||Object.keys($).length===0)return X;let Z=X.match(/<html\b([^>]*)>/i);if(!Z)return X;let Y={},J=[],G=/([A-Za-z_:][\w:.-]*)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g,Q;while((Q=G.exec(Z[1]))!==null){let W=Q[1];if(!(W in Y))J.push(W);Y[W]=Q[2]??Q[3]??Q[4]??""}let q=[],K=[];for(let[W,w]of Object.entries($)){if(w==null)continue;let z=W.trim();if(!pQ.test(z))continue;let B=z.toLowerCase();if(B==="class"){let j=(Y.class||"").split(/\s+/).filter(Boolean);for(let _ of String(w).split(/\s+/).filter(Boolean))if(!j.includes(_))j.push(_),q.push(_);if(!("class"in Y))J.push("class");Y.class=j.join(" ");continue}if(!(z in Y))J.push(z);if(Y[z]=String(w),B!=="lang")K.push(z)}if(q.length){if(!(a8 in Y))J.push(a8);Y[a8]=q.join(" ")}if(K.length){if(!(s8 in Y))J.push(s8);Y[s8]=K.join(" ")}let U=J.map((W)=>` ${W}="${j1(Y[W])}"`).join("");return X.replace(Z[0],()=>`<html${U}>`)}function rQ(X){if(X.includes("data-stx-cloak"))return X;let $=X.lastIndexOf("</head>");if($===-1)return X;return`${X.slice(0,$)}${cQ}
13594
+ ${X.slice($)}`}function oH(X){let $=[],Z=0;while(Z<X.length){let G=X.slice(Z),Q=G.match(/^\s+/);if(Q){Z+=Q[0].length;continue}if(G.startsWith("<!--")){let w=X.indexOf("-->",Z);if(w===-1)break;Z=w+3;continue}let q=G.match(/^<script\b[^>]*>/i);if(q){let w=X.toLowerCase().indexOf("</script>",Z+q[0].length);if(w===-1)break;Z=w+9;continue}let K=G.match(/^<link\b[^>]*>/i);if(K){$.push(K[0]),Z+=K[0].length;continue}let U=G.match(/^<meta\b[^>]*>/i);if(U){$.push(U[0]),Z+=U[0].length;continue}let W=G.match(/^<style\b[^>]*>[\s\S]*?<\/style>/i);if(W){$.push(W[0]),Z+=W[0].length;continue}break}if($.length===0)return{body:X,hoisted:$};let Y="",J=0;while(J<X.length&&J<Z){let G=X.slice(J),Q=G.match(/^<link\b[^>]*>/i);if(Q&&$.includes(Q[0])){J+=Q[0].length;continue}let q=G.match(/^<meta\b[^>]*>/i);if(q&&$.includes(q[0])){J+=q[0].length;continue}let K=G.match(/^<style\b[^>]*>[\s\S]*?<\/style>/i);if(K&&$.includes(K[0])){J+=K[0].length;continue}Y+=X[J],J++}return Y+=X.slice(Z),{body:Y,hoisted:$}}function sH(X,$={},Z={}){let{title:Y="stx App",lang:J="en",meta:G=[],link:Q=[],script:q=[],headRaw:K="",htmlAttrs:U={},bodyClass:W="",bodyAttrs:w={}}=$,z=Z.title||Y,B=[{charset:"UTF-8"},{name:"viewport",content:"width=device-width, initial-scale=1.0"}],j=new Set(G.map(y4).filter(Boolean)),H=[...B.filter((M)=>!j.has(y4(M))),...G].map((M)=>{return` <meta ${d5(M)}>`}).join(`
13595
13595
  `),L=Q.map((M)=>{return` <link ${d5(M)}>`}).join(`
13596
13596
  `),O=q.map((M)=>{if(M.src)return` <script ${d5(M,(y)=>y==="content")}></script>`;if(M.content)return` <script>${M.content}</script>`;return""}).filter(Boolean).join(`
13597
- `),F=iH(U,J),V=Object.entries(w).map(([M,y])=>` ${M}="${j1(String(y))}"`).join(""),A=W?` class="${j1(W)}"`:"",{body:R,hoisted:N}=nH(X),T=[H,Z.colorMode?` ${I4(Z.colorMode)}`:"",` <title>${Z.titleIsHtml?z:pH(z)}</title>`,` ${cQ}`,L,O,K?` ${K}`:"",...(Z.styles||[]).map((M)=>` ${M}`),...N.map((M)=>` ${M}`),...(Z.headScripts||[]).map((M)=>` ${M}`),Z.headStack||""].filter(Boolean),k=[R,...(Z.bodyScripts||[]).map((M)=>M),Z.bodyStack||""].filter(Boolean);return`<!DOCTYPE html>
13597
+ `),F=rH(U,J),V=Object.entries(w).map(([M,y])=>` ${M}="${j1(String(y))}"`).join(""),A=W?` class="${j1(W)}"`:"",{body:R,hoisted:N}=oH(X),T=[H,Z.colorMode?` ${I4(Z.colorMode)}`:"",` <title>${Z.titleIsHtml?z:nH(z)}</title>`,` ${cQ}`,L,O,K?` ${K}`:"",...(Z.styles||[]).map((M)=>` ${M}`),...N.map((M)=>` ${M}`),...(Z.headScripts||[]).map((M)=>` ${M}`),Z.headStack||""].filter(Boolean),k=[R,...(Z.bodyScripts||[]).map((M)=>M),Z.bodyStack||""].filter(Boolean);return`<!DOCTYPE html>
13598
13598
  <html${F}>
13599
13599
  <head>
13600
13600
  ${T.join(`
@@ -13606,13 +13606,13 @@ ${k.join(`
13606
13606
  </body>
13607
13607
  </html>`}function b4(X){let $=0;while($<X.length){let Z=X.slice($),Y=Z.match(/^\s+/);if(Y){$+=Y[0].length;continue}if(Z.startsWith("<!--")){let G=X.indexOf("-->",$);if(G===-1)return!1;$=G+3;continue}let J=Z.match(/^<(script|style)\b[^>]*>/i);if(J){let G=`</${J[1].toLowerCase()}>`,Q=X.toLowerCase().indexOf(G,$+J[0].length);if(Q===-1)return!1;$=Q+G.length;continue}return/^<!DOCTYPE\b/i.test(Z)||/^<html[\s>]/i.test(Z)}return!1}function S4(X){return b4(X)}function oQ(X,$={}){let Z=X.lastIndexOf("</head>");if(Z===-1)return X;let{meta:Y=[],link:J=[],script:G=[],headRaw:Q=""}=$,q=X.slice(0,Z),K=[];for(let U of Y){let W=y4(U);if(W&&q.includes(W))continue;K.push(` <meta ${d5(U)}>`)}for(let U of J){if(U.href&&q.includes(`href="${U.href}"`))continue;K.push(` <link ${d5(U)}>`)}for(let U of G)if(U.src){if(q.includes(`src="${U.src}"`))continue;K.push(` <script ${d5(U,(W)=>W==="content")}></script>`)}else if(U.content){if(q.includes(U.content))continue;K.push(` <script>${U.content}</script>`)}if(Q&&!q.includes(Q))K.push(` ${Q}`);if(K.length===0)return X;return`${X.slice(0,Z)}${K.join(`
13608
13608
  `)}
13609
- ${X.slice(Z)}`}function sQ(X,$={},Z={}){if(S4(X))return X;return rH(X,$,Z)}var cQ="<style data-stx-cloak>[x-cloak]{display:none !important}</style>",s8="data-stx-html-attrs",a8="data-stx-html-class",pQ;var aQ=E(()=>{E4();pQ=/^[A-Za-z_:][\w:.-]*$/});import m5 from"path";function tQ(X){return X.startsWith("http://")||X.startsWith("https://")||X.startsWith("//")}async function eQ(X,$,Z){try{let Y;if(X.startsWith("/")){let J=$;for(let G=0;G<5;G++){let Q=m5.join(J,X);if(await Bun.file(Q).exists())return Q;J=m5.dirname(J)}Y=m5.join($,X)}else if(X.startsWith("./")||X.startsWith("../"))Y=m5.resolve($,X);else Y=m5.resolve($,X);if(await Bun.file(Y).exists())return Y;return null}catch{return null}}async function Xq(X,$,Z){let Y=X,J=m5.dirname($),G=/<script\b([^>]*)src=["']([^"']+)["']([^>]*)><\/script>/gi,Q;while((Q=G.exec(Y))!==null){let[U,W,w,z]=Q;if(tQ(w))continue;let B=await eQ(w,J,$);if(B)try{let j=await Bun.file(B).text();if(Z.add(B),w.endsWith(".ts")||w.endsWith(".tsx")){let H=await Bun.build({entrypoints:[B],target:"browser",minify:!1,define:S0()});if(H.outputs.length>0)j=await H.outputs[0].text()}let _=`<script>
13609
+ ${X.slice(Z)}`}function sQ(X,$={},Z={}){if(S4(X))return X;return sH(X,$,Z)}var cQ="<style data-stx-cloak>[x-cloak]{display:none !important}</style>",s8="data-stx-html-attrs",a8="data-stx-html-class",pQ;var aQ=E(()=>{E4();pQ=/^[A-Za-z_:][\w:.-]*$/});import m5 from"path";function tQ(X){return X.startsWith("http://")||X.startsWith("https://")||X.startsWith("//")}async function eQ(X,$,Z){try{let Y;if(X.startsWith("/")){let J=$;for(let G=0;G<5;G++){let Q=m5.join(J,X);if(await Bun.file(Q).exists())return Q;J=m5.dirname(J)}Y=m5.join($,X)}else if(X.startsWith("./")||X.startsWith("../"))Y=m5.resolve($,X);else Y=m5.resolve($,X);if(await Bun.file(Y).exists())return Y;return null}catch{return null}}async function Xq(X,$,Z){let Y=X,J=m5.dirname($),G=/<script\b([^>]*)src=["']([^"']+)["']([^>]*)><\/script>/gi,Q;while((Q=G.exec(Y))!==null){let[U,W,w,z]=Q;if(tQ(w))continue;let B=await eQ(w,J,$);if(B)try{let j=await Bun.file(B).text();if(Z.add(B),w.endsWith(".ts")||w.endsWith(".tsx")){let H=await Bun.build({entrypoints:[B],target:"browser",minify:!1,define:S0()});if(H.outputs.length>0)j=await H.outputs[0].text()}let _=`<script>
13610
13610
  // Source: ${w}
13611
13611
  ${j}
13612
13612
  </script>`;Y=Y.replace(U,_),G.lastIndex=0}catch(j){}}let q=/<link\b([^>]*)href=["']([^"']+)["']([^>]*)(?:\/?>)/gi,K;while((K=q.exec(Y))!==null){let[U,W,w,z]=K,B=W+z;if(tQ(w))continue;if(/rel=["']stylesheet["']/.test(B)||w.endsWith(".css")){let _=await eQ(w,J,$);if(_)try{let H=await Bun.file(_).text();Z.add(_);let L=`<style>
13613
13613
  /* Source: ${w} */
13614
13614
  ${H}
13615
- </style>`;Y=Y.replace(U,L),q.lastIndex=0}catch(H){}}}return Y}var $q=E(()=>{F1()});function t8(X,$){let Z=X,Y=/@json\s*\(/g,J;while((J=Y.exec(Z))!==null){let G=J.index,Q=G+J[0].length-1,q=1,K=Q+1,U=null,W=!1;while(K<Z.length&&q>0){let F=Z[K];if(W){W=!1,K++;continue}if(F==="\\"&&U){W=!0,K++;continue}if(U){if(F===U)U=null;K++;continue}if(F==='"'||F==="'"||F==="`"){U=F,K++;continue}if(F==="(")q++;else if(F===")"){if(q--,q===0)break}K++}if(q!==0)break;let w=Z.substring(Q+1,K).trim(),z=Z.substring(G,K+1),B=-1,j=0,_=null,H=!1;for(let F=0;F<w.length;F++){let V=w[F];if(H){H=!1;continue}if(V==="\\"&&_){H=!0;continue}if(_){if(V===_)_=null;continue}if(V==='"'||V==="'"||V==="`"){_=V;continue}if(V==="("||V==="["||V==="{")j++;else if(V===")"||V==="]"||V==="}")j--;if(V===","&&j===0){B=F;break}}let L=B>=0?w.substring(0,B).trim():w,O=B>=0?w.substring(B+1).trim():void 0;try{let F=L.trim(),V;if(G0(F))V=Q0(F,Object.keys($))(...Object.values($));else V=void 0;let A;if(O==="true")A=JSON.stringify(V,null,2);else A=JSON.stringify(V);let R=A.replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029");Z=Z.substring(0,G)+R+Z.substring(K+1),Y.lastIndex=G+R.length}catch(F){s0.log(F instanceof Error?F:Error(String(F)),{directive:"@json"},"error"),Y.lastIndex=G+z.length}}return Z}function e8(X){return X.replace(/@once\s*([\s\S]*?)@endonce/g,"$1")}function Zq(X){let $=X,Z=/@memo\s*\(/g,Y,J=[];while((Y=Z.exec($))!==null){let G=Y.index,Q=G+Y[0].length,q=1,K=Q;while(K<$.length&&q>0){if($[K]==="(")q++;else if($[K]===")")q--;K++}if(q!==0)continue;let U=$.slice(Q,K-1).trim(),W=K,w=$.slice(W),z=w.indexOf("@endmemo");if(z===-1)continue;let B=w.slice(0,z),j=W+z+8,_=B.match(/^(\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*)/),H=_?_[0].length:0,L=B.slice(H),O=B.match(/(\s*)$/),F=O?O[0].length:0,V=L.slice(0,L.length-F),A=V.match(/^<([a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*?)?(\/?)>/),R;if(A){let[N,T,k="",M]=A,y=`<${T}${k} data-stx-memo="${U}"${M}>`;R=B.slice(0,H)+y+V.slice(N.length)+B.slice(H+V.length)}else R=`${B.slice(0,H)}<div data-stx-memo="${U}">${V}</div>${B.slice(H+V.length)}`;J.push({start:G,end:j,replacement:R}),Z.lastIndex=j}for(let G=J.length-1;G>=0;G--){let Q=J[G];$=$.slice(0,Q.start)+Q.replacement+$.slice(Q.end)}return $.replace(/@memo="([^"]*)"/g,'data-stx-memo="$1"')}function C4(X){let $=X.replace(/@ref="([^"]+)"/g,'data-stx-ref="$1"');return $=$.replace(/(<[a-zA-Z][a-zA-Z0-9-]*\b[^>]*?)\sref="([^"]+)"/g,'$1 data-stx-ref="$2"'),$}function Yq(X){let Z=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"),Y="",J=0,G;while((G=Z.exec(X))!==null){let Q=G.index,q=Q+G[0].length,K=!1,U=!1,W=-1;while(q<X.length){let _=X[q];if(K){if(_==="'")K=!1}else if(U){if(_==='"')U=!1}else if(_==="'")K=!0;else if(_==='"')U=!0;else if(_===">"){W=q;break}q++}if(W===-1)continue;if(X.slice(Q,W+1).includes("x-cloak"))continue;let z=X.slice(W+1),B=z.indexOf("</"),j=B>=0?z.slice(0,B):z.slice(0,200);if(/\{\{[\s\S]*?\}\}/.test(j))Y+=X.slice(J,W)+" x-cloak>",J=W+1}return Y+=X.slice(J),Y}function Jq(X){let $=/<[a-z][\w-]*/gi,Z="",Y=0,J;while((J=$.exec(X))!==null){let G=J.index,Q=J[0].slice(1).toLowerCase();if(Q==="script"||Q==="style"){let j=`</${Q}>`,_=X.toLowerCase().indexOf(j,G);if(_!==-1)$.lastIndex=_+j.length;continue}let q=G+J[0].length,K=!1,U=!1,W=-1;while(q<X.length){let j=X[q];if(K){if(j==="'")K=!1}else if(U){if(j==='"')U=!1}else if(j==="'")K=!0;else if(j==='"')U=!0;else if(j===">"){W=q;break}q++}if(W===-1)continue;let w=X.slice(G+J[0].length,W);if(/(?:^|\s)x-cloak(?:=|\s|\/|>|$)/.test(w))continue;if(!oH.test(w))continue;let z=X[W-1]==="/",B=z?W-1:W;Z+=`${X.slice(Y,B)} x-cloak${z?" ":""}`,Y=B}return Z+=X.slice(Y),Z}var oH;var P4=E(()=>{w1();O0();oH=/(?:^|\s)(?::else-if|:if|:else|:show|x-else-if|x-if|x-else|x-show|@if|@show)(?:=|\s|\/|>|$)/});function X$(X,$,Z,Y){let J=typeof Z==="boolean"?{enabled:Z,failOnViolation:Z}:Z??{enabled:!1},G=J.allowPatterns??[],Q=[],q=X1(X.replace(/\{\{--[\s\S]*?--\}\}/g,(K)=>K.replace(/[^\n]/g," ")));for(let{pattern:K,message:U,suggestion:W}of sH){if(G.some((z)=>/\w/.test(z)&&U.includes(z)))continue;K.lastIndex=0;let w=q.match(K);if(w&&w.length>0){let z=q.split(`
13615
+ </style>`;Y=Y.replace(U,L),q.lastIndex=0}catch(H){}}}return Y}var $q=E(()=>{F1()});function t8(X,$){let Z=X,Y=/@json\s*\(/g,J;while((J=Y.exec(Z))!==null){let G=J.index,Q=G+J[0].length-1,q=1,K=Q+1,U=null,W=!1;while(K<Z.length&&q>0){let F=Z[K];if(W){W=!1,K++;continue}if(F==="\\"&&U){W=!0,K++;continue}if(U){if(F===U)U=null;K++;continue}if(F==='"'||F==="'"||F==="`"){U=F,K++;continue}if(F==="(")q++;else if(F===")"){if(q--,q===0)break}K++}if(q!==0)break;let w=Z.substring(Q+1,K).trim(),z=Z.substring(G,K+1),B=-1,j=0,_=null,H=!1;for(let F=0;F<w.length;F++){let V=w[F];if(H){H=!1;continue}if(V==="\\"&&_){H=!0;continue}if(_){if(V===_)_=null;continue}if(V==='"'||V==="'"||V==="`"){_=V;continue}if(V==="("||V==="["||V==="{")j++;else if(V===")"||V==="]"||V==="}")j--;if(V===","&&j===0){B=F;break}}let L=B>=0?w.substring(0,B).trim():w,O=B>=0?w.substring(B+1).trim():void 0;try{let F=L.trim(),V;if(G0(F))V=Q0(F,Object.keys($))(...Object.values($));else V=void 0;let A;if(O==="true")A=JSON.stringify(V,null,2);else A=JSON.stringify(V);let R=A.replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029");Z=Z.substring(0,G)+R+Z.substring(K+1),Y.lastIndex=G+R.length}catch(F){s0.log(F instanceof Error?F:Error(String(F)),{directive:"@json"},"error"),Y.lastIndex=G+z.length}}return Z}function e8(X){return X.replace(/@once\s*([\s\S]*?)@endonce/g,"$1")}function Zq(X){let $=X,Z=/@memo\s*\(/g,Y,J=[];while((Y=Z.exec($))!==null){let G=Y.index,Q=G+Y[0].length,q=1,K=Q;while(K<$.length&&q>0){if($[K]==="(")q++;else if($[K]===")")q--;K++}if(q!==0)continue;let U=$.slice(Q,K-1).trim(),W=K,w=$.slice(W),z=w.indexOf("@endmemo");if(z===-1)continue;let B=w.slice(0,z),j=W+z+8,_=B.match(/^(\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*)/),H=_?_[0].length:0,L=B.slice(H),O=B.match(/(\s*)$/),F=O?O[0].length:0,V=L.slice(0,L.length-F),A=V.match(/^<([a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*?)?(\/?)>/),R;if(A){let[N,T,k="",M]=A,y=`<${T}${k} data-stx-memo="${U}"${M}>`;R=B.slice(0,H)+y+V.slice(N.length)+B.slice(H+V.length)}else R=`${B.slice(0,H)}<div data-stx-memo="${U}">${V}</div>${B.slice(H+V.length)}`;J.push({start:G,end:j,replacement:R}),Z.lastIndex=j}for(let G=J.length-1;G>=0;G--){let Q=J[G];$=$.slice(0,Q.start)+Q.replacement+$.slice(Q.end)}return $.replace(/@memo="([^"]*)"/g,'data-stx-memo="$1"')}function C4(X){let $=X.replace(/@ref="([^"]+)"/g,'data-stx-ref="$1"');return $=$.replace(/(<[a-zA-Z][a-zA-Z0-9-]*\b[^>]*?)\sref="([^"]+)"/g,'$1 data-stx-ref="$2"'),$}function Yq(X){let Z=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"),Y="",J=0,G;while((G=Z.exec(X))!==null){let Q=G.index,q=Q+G[0].length,K=!1,U=!1,W=-1;while(q<X.length){let _=X[q];if(K){if(_==="'")K=!1}else if(U){if(_==='"')U=!1}else if(_==="'")K=!0;else if(_==='"')U=!0;else if(_===">"){W=q;break}q++}if(W===-1)continue;if(X.slice(Q,W+1).includes("x-cloak"))continue;let z=X.slice(W+1),B=z.indexOf("</"),j=B>=0?z.slice(0,B):z.slice(0,200);if(/\{\{[\s\S]*?\}\}/.test(j))Y+=X.slice(J,W)+" x-cloak>",J=W+1}return Y+=X.slice(J),Y}function Jq(X){let $=/<[a-z][\w-]*/gi,Z="",Y=0,J;while((J=$.exec(X))!==null){let G=J.index,Q=J[0].slice(1).toLowerCase();if(Q==="script"||Q==="style"){let j=`</${Q}>`,_=X.toLowerCase().indexOf(j,G);if(_!==-1)$.lastIndex=_+j.length;continue}let q=G+J[0].length,K=!1,U=!1,W=-1;while(q<X.length){let j=X[q];if(K){if(j==="'")K=!1}else if(U){if(j==='"')U=!1}else if(j==="'")K=!0;else if(j==='"')U=!0;else if(j===">"){W=q;break}q++}if(W===-1)continue;let w=X.slice(G+J[0].length,W);if(/(?:^|\s)x-cloak(?:=|\s|\/|>|$)/.test(w))continue;if(!aH.test(w))continue;let z=X[W-1]==="/",B=z?W-1:W;Z+=`${X.slice(Y,B)} x-cloak${z?" ":""}`,Y=B}return Z+=X.slice(Y),Z}var aH;var P4=E(()=>{w1();O0();aH=/(?:^|\s)(?::else-if|:if|:else|:show|x-else-if|x-if|x-else|x-show|@if|@show)(?:=|\s|\/|>|$)/});function X$(X,$,Z,Y){let J=typeof Z==="boolean"?{enabled:Z,failOnViolation:Z}:Z??{enabled:!1},G=J.allowPatterns??[],Q=[],q=X1(X.replace(/\{\{--[\s\S]*?--\}\}/g,(K)=>K.replace(/[^\n]/g," ")));for(let{pattern:K,message:U,suggestion:W}of tH){if(G.some((z)=>/\w/.test(z)&&U.includes(z)))continue;K.lastIndex=0;let w=q.match(K);if(w&&w.length>0){let z=q.split(`
13616
13616
  `),B=X.split(`
13617
13617
  `),j=[];z.forEach((O,F)=>{if(K.lastIndex=0,K.test(O))j.push(F+1)});let _=j.length>0?` (script line${j.length>1?"s":""} ${j.join(", ")})`:"",H=j.slice(0,3).map((O)=>` ${O} | ${(B[O-1]??"").trim().slice(0,100)}`).join(`
13618
13618
  `),L=H?`
@@ -13620,8 +13620,8 @@ ${H}`:"";Q.push(` \u2717 ${U}${_}
13620
13620
  \u2192 ${W}${L}`)}}if(Q.length>0&&J.enabled){let K=(w)=>{let z=`${process.cwd()}/`;return w.startsWith(z)?w.slice(z.length):w},W=`[STX] DOM API violation in ${Y&&Y!==$?`${K(Y)} (composed into ${K($)})`:K($)}:
13621
13621
  ${Q.join(`
13622
13622
  `)}
13623
- Tip: prefer useRef(), navigate(), and composables for component code`;if(J.failOnViolation)throw Error(W);else console.warn(W)}}var sH;var v4=E(()=>{sH=[{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 @appearanceBootstrap if this must run before first paint, where the runtime does not exist yet"},{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"}]});import aH from"fs";function $$(X){return[...X].sort().map(($)=>{try{let Z=aH.statSync($);return`${$}:${Z.size}:${Z.mtimeMs}`}catch{return`${$}:missing`}}).join(`
13624
- `)}function Z$(X,$,Z){let Y=X.get($);return Y!==void 0&&Y.signature===Z?Y.value:void 0}function J1(X,$,Z,Y){return X.set($,{signature:Z,value:Y}),Y}var x4=()=>{};var Gq={};n(Gq,{getStoreScript:()=>eH,clearStoreCache:()=>XO});import Y$ from"path";function tH(X,$){for(let Z of X.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(Z[1])$.add(Z[1]);for(let Z of X.matchAll(/\b(?:const|let|var)\s*\{([^{}]*)\}\s*=/g))for(let Y of(Z[1]??"").split(",")){let G=((Y.includes(":")?Y.split(":").pop():Y)??"").replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(G))$.add(G)}for(let Z of X.matchAll(/\b(?:const|let|var)\s*\[([^\]]*)\]\s*=/g))for(let Y of(Z[1]??"").split(",")){let J=Y.replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(J))$.add(J)}}async function eH(X){let $;if(X)$=Y$.resolve(X);else{let j=await I1();$=Y$.resolve(j.root||process.cwd(),j.storesDir||"stores")}let Z=new Bun.Glob("*.ts"),Y=[];try{for await(let j of Z.scan({cwd:$,absolute:!0})){let _=Y$.basename(j,".ts");if(["index","types"].includes(_))continue;if(j.includes(".d.ts"))continue;Y.push(j)}}catch{return J1(l5,$,"",""),null}let J=$$(Y),G=Z$(l5,$,J);if(G!==void 0)return G||null;if(Y.length===0)return J1(l5,$,J,""),null;let Q=[];for(let j of Y){let _=await Bun.file(j).text();Q.push({file:j,hasUseStore:/useStore\s*\(/.test(_)})}Q.sort((j,_)=>{if(j.hasUseStore===_.hasUseStore)return 0;return j.hasUseStore?1:-1});let q=Q.map((j)=>j.file),K=[],U=new Set,W=new Bun.Transpiler({loader:"ts",target:"browser",define:S0()});for(let j of q)try{let _=await Bun.file(j).text(),H=Y$.basename(j,".ts");tH(_,U),_=f0(_),_=jX(_),_=_.replace(/^export\s+(default\s+)?/gm,""),_=W.transformSync(_),K.push(`// Store: ${H}
13623
+ Tip: prefer useRef(), navigate(), and composables for component code`;if(J.failOnViolation)throw Error(W);else console.warn(W)}}var tH;var v4=E(()=>{tH=[{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 @appearanceBootstrap if this must run before first paint, where the runtime does not exist yet"},{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"}]});import eH from"fs";function $$(X){return[...X].sort().map(($)=>{try{let Z=eH.statSync($);return`${$}:${Z.size}:${Z.mtimeMs}`}catch{return`${$}:missing`}}).join(`
13624
+ `)}function Z$(X,$,Z){let Y=X.get($);return Y!==void 0&&Y.signature===Z?Y.value:void 0}function J1(X,$,Z,Y){return X.set($,{signature:Z,value:Y}),Y}var x4=()=>{};var Gq={};n(Gq,{getStoreScript:()=>$O,clearStoreCache:()=>ZO});import Y$ from"path";function XO(X,$){for(let Z of X.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(Z[1])$.add(Z[1]);for(let Z of X.matchAll(/\b(?:const|let|var)\s*\{([^{}]*)\}\s*=/g))for(let Y of(Z[1]??"").split(",")){let G=((Y.includes(":")?Y.split(":").pop():Y)??"").replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(G))$.add(G)}for(let Z of X.matchAll(/\b(?:const|let|var)\s*\[([^\]]*)\]\s*=/g))for(let Y of(Z[1]??"").split(",")){let J=Y.replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(J))$.add(J)}}async function $O(X){let $;if(X)$=Y$.resolve(X);else{let j=await I1();$=Y$.resolve(j.root||process.cwd(),j.storesDir||"stores")}let Z=new Bun.Glob("*.ts"),Y=[];try{for await(let j of Z.scan({cwd:$,absolute:!0})){let _=Y$.basename(j,".ts");if(["index","types"].includes(_))continue;if(j.includes(".d.ts"))continue;Y.push(j)}}catch{return J1(l5,$,"",""),null}let J=$$(Y),G=Z$(l5,$,J);if(G!==void 0)return G||null;if(Y.length===0)return J1(l5,$,J,""),null;let Q=[];for(let j of Y){let _=await Bun.file(j).text();Q.push({file:j,hasUseStore:/useStore\s*\(/.test(_)})}Q.sort((j,_)=>{if(j.hasUseStore===_.hasUseStore)return 0;return j.hasUseStore?1:-1});let q=Q.map((j)=>j.file),K=[],U=new Set,W=new Bun.Transpiler({loader:"ts",target:"browser",define:S0()});for(let j of q)try{let _=await Bun.file(j).text(),H=Y$.basename(j,".ts");XO(_,U),_=f0(_),_=jX(_),_=_.replace(/^export\s+(default\s+)?/gm,""),_=W.transformSync(_),K.push(`// Store: ${H}
13625
13625
  ${_.trim()}`)}catch(_){console.warn(`[stx] Failed to load store ${j}:`,_)}if(K.length===0)return J1(l5,$,J,""),null;let w=K.join(`
13626
13626
 
13627
13627
  `),B=`;(function(){
@@ -13629,8 +13629,8 @@ var __stx = window.stx || {};
13629
13629
  ${U1.filter((j)=>!U.has(j)&&new RegExp(`\\b${j}\\b`).test(w)).map((j)=>`var ${j} = __stx[${JSON.stringify(j)}];`).join(`
13630
13630
  `)}
13631
13631
  ${w}
13632
- })();`;return J1(l5,$,J,B),B}function XO(){l5.clear()}var l5;var Qq=E(()=>{V1();F1();e0();x4();l5=new Map});var f4,lI;var qq=E(()=>{f4=["broadcast","calculateDistance","canNotify","clearCookies","clearFetchCache","clearStorage","copyToClipboard","createShareableFile","defineForm","getBatteryLevel","getCookie","getCurrentPosition","getStorageKeys","getStorageSize","getVoices","hasBattery","hasCameraPermission","hasGeolocationPermission","hasMicrophonePermission","hasNotificationPermission","hasResizeObserver","hexToHsl","hexToRgb","isBroadcastChannelSupported","isCharging","isDeviceMotionSupported","isDeviceOrientationSupported","isEventSourceSupported","isEyeDropperSupported","isInFullscreen","isMutationObserverSupported","isPermissionGranted","isSpeechRecognitionSupported","isSpeechSynthesisSupported","isWakeLockSupported","isWebSocketSupported","notify","parseCookies","pickColor","prefetch","removeCookie","requestMediaPermissions","requestMotionPermission","requestNotificationPermission","requestOrientationPermission","setCookie","share","shareCurrentPage","shareFiles","shareText","shareURL","shareWithFallback","speak","stopSpeaking","toggleFullscreen","useAsyncData","useAttributeObserver","useAutoLogout","useAutoWakeLock","useBattery","useBreakpoint","useBroadcastChannel","useChannel","useChildListObserver","useClipboard","useColorHistory","useConditionalWakeLock","useCookies","useCopySelection","useDeviceMotion","useDeviceOrientation","useElementSize","useElementTextSelection","useElementVisibility","useEventSource","useEyeDropper","useFavicon","useForm","useFullscreen","useGeolocation","useGeolocationWatch","useHotkey","useIdle","useIdleState","useInfiniteScroll","useIntersectionObserver","useIntersectionObserverMultiple","useIsDesktop","useIsMobile","useIsTablet","useKeyPressed","useKeySequence","useKeyboard","useLastActive","useLazyLoad","useMeta","useMouse","useMouseInElement","useMutationObserver","useNetwork","useNotification","useOnline","useParallax","usePermission","usePermissions","usePointer","usePost","useResizeObserver","useResizeObserverMultiple","useSSE","useScroll","useSelectionPopup","useShare","useSpeechRecognition","useSpeechSynthesis","useStorage","useTextObserver","useTextSelection","useTitle","useVisibility","useWakeLock","useWindowSize"],lI=new Set(f4)});var Wq={};n(Wq,{selectComposableFiles:()=>Kq,referencedFrameworkComposables:()=>Uq,getFrameworkComposableScript:()=>JO,clearFrameworkComposableCache:()=>ZO,__setRuntimeOwnedForTest:()=>GO});import J$ from"path";function ZO(){p7.clear()}function Kq(X){let $=new Map;for(let Z of X){let Y=J$.basename(Z);if(Y.endsWith(".d.ts"))continue;let J=Y.replace(/\.[jt]s$/,"");if(J==="index")continue;if(J===Y)continue;let G=$.get(J);if(G&&!G.endsWith(".js"))continue;$.set(J,Z)}return[...$.values()].sort()}function YO(X,$){let Z=$.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");return new RegExp(`(?:^|[^\\w$.])(?:const|let|var|function|class)\\s+${Z}\\b`).test(X)}function Uq(X){if(!X)return[];let $=X.replace(/<script\b[^>]*\bdata-stx-runtime\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-framework-composables\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-stores\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-composables\b[^>]*>[\s\S]*?<\/script>/gi,""),Z=[];for(let Y of $O){if(g4.has(Y))continue;let J=Y.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");if(new RegExp(`(^|[^\\w$.])${J}\\s*\\(`).test($))Z.push(Y)}return Z.sort()}async function JO(X,$){let Z=Uq(X);if(Z.length===0)return null;let Y=$??J$.join(import.meta.dir,"composables"),J=`${Y}\x00${Z.join(",")}`,G=p7.get(J);if(G!==void 0)return G||null;let Q=new Bun.Transpiler({loader:"ts",target:"browser",define:S0()}),q=new Set(Z),K=[],U=new Set,W=[];try{let j=new Bun.Glob("*.{ts,js}");for await(let _ of j.scan({cwd:Y,absolute:!0}))W.push(_)}catch{return p7.set(J,""),null}W=Kq(W);for(let j of W){let _;try{_=await Bun.file(j).text()}catch{continue}let H=[];try{H=Q.scan(_).exports.filter((L)=>L!=="default")}catch{continue}if(!H.some((L)=>q.has(L)))continue;try{_=_.replace(/^import\s+.*from\s+['"][^'"]+['"]\s*;?\s*$/gm,""),_=_.replace(/^import\s+type\s+.*$/gm,""),_=_.replace(/^export\s+\*\s+(?:as\s+\w+\s+)?from\s*['"][^'"]+['"]\s*;?\s*$/gm,""),_=_.replace(/^export\s+(?:type\s+)?\{[\s\S]*?\}\s*(?:from\s*['"][^'"]+['"]\s*)?;?\s*$/gm,""),_=_.replace(/^export\s+default\s+/gm,""),_=_.replace(/^export\s+(?=(?:declare\s+)?(?:abstract\s+)?(?:async\s+)?(?:function|class|const|let|var|type|interface|enum)\b)/gm,""),K.push(`// ${J$.basename(j).replace(/\.[jt]s$/,"")}
13633
- ${Q.transformSync(_).trim()}`);for(let L of H)U.add(L)}catch(L){console.warn(`[stx] framework composable ${J$.basename(j)} could not be bundled:`,L)}}let w=Z.filter((j)=>!U.has(j)&&!YO(X,j));if(w.length>0)console.warn(`[stx] could not bundle ${w.join(", ")} from @stacksjs/stx/composables \u2014 `+"calls to them will throw ReferenceError in the browser. Import them explicitly so the bundler inlines them, or use a runtime equivalent from window.stx.");if(K.length===0)return p7.set(J,""),null;let z=[...U].map((j)=>` try { if (!(${JSON.stringify(j)} in __s)) { __s[${JSON.stringify(j)}] = ${j}; if (!(${JSON.stringify(j)} in window)) window[${JSON.stringify(j)}] = ${j}; } } catch (e) {}`).join(`
13632
+ })();`;return J1(l5,$,J,B),B}function ZO(){l5.clear()}var l5;var Qq=E(()=>{V1();F1();e0();x4();l5=new Map});var f4,pI;var qq=E(()=>{f4=["broadcast","calculateDistance","canNotify","clearCookies","clearFetchCache","clearStorage","copyToClipboard","createShareableFile","defineForm","getBatteryLevel","getCookie","getCurrentPosition","getStorageKeys","getStorageSize","getVoices","hasBattery","hasCameraPermission","hasGeolocationPermission","hasMicrophonePermission","hasNotificationPermission","hasResizeObserver","hexToHsl","hexToRgb","isBroadcastChannelSupported","isCharging","isDeviceMotionSupported","isDeviceOrientationSupported","isEventSourceSupported","isEyeDropperSupported","isInFullscreen","isMutationObserverSupported","isPermissionGranted","isSpeechRecognitionSupported","isSpeechSynthesisSupported","isWakeLockSupported","isWebSocketSupported","notify","parseCookies","pickColor","prefetch","removeCookie","requestMediaPermissions","requestMotionPermission","requestNotificationPermission","requestOrientationPermission","setCookie","share","shareCurrentPage","shareFiles","shareText","shareURL","shareWithFallback","speak","stopSpeaking","toggleFullscreen","useAsyncData","useAttributeObserver","useAutoLogout","useAutoWakeLock","useBattery","useBreakpoint","useBroadcastChannel","useChannel","useChildListObserver","useClipboard","useColorHistory","useConditionalWakeLock","useCookies","useCopySelection","useDeviceMotion","useDeviceOrientation","useElementSize","useElementTextSelection","useElementVisibility","useEventSource","useEyeDropper","useFavicon","useForm","useFullscreen","useGeolocation","useGeolocationWatch","useHotkey","useIdle","useIdleState","useInfiniteScroll","useIntersectionObserver","useIntersectionObserverMultiple","useIsDesktop","useIsMobile","useIsTablet","useKeyPressed","useKeySequence","useKeyboard","useLastActive","useLazyLoad","useMeta","useMouse","useMouseInElement","useMutationObserver","useNetwork","useNotification","useOnline","useParallax","usePermission","usePermissions","usePointer","usePost","useResizeObserver","useResizeObserverMultiple","useSSE","useScroll","useSelectionPopup","useShare","useSpeechRecognition","useSpeechSynthesis","useStorage","useTextObserver","useTextSelection","useTitle","useVisibility","useWakeLock","useWindowSize"],pI=new Set(f4)});var Wq={};n(Wq,{selectComposableFiles:()=>Kq,referencedFrameworkComposables:()=>Uq,getFrameworkComposableScript:()=>QO,clearFrameworkComposableCache:()=>JO,__setRuntimeOwnedForTest:()=>qO});import J$ from"path";function JO(){p7.clear()}function Kq(X){let $=new Map;for(let Z of X){let Y=J$.basename(Z);if(Y.endsWith(".d.ts"))continue;let J=Y.replace(/\.[jt]s$/,"");if(J==="index")continue;if(J===Y)continue;let G=$.get(J);if(G&&!G.endsWith(".js"))continue;$.set(J,Z)}return[...$.values()].sort()}function GO(X,$){let Z=$.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");return new RegExp(`(?:^|[^\\w$.])(?:const|let|var|function|class)\\s+${Z}\\b`).test(X)}function Uq(X){if(!X)return[];let $=X.replace(/<script\b[^>]*\bdata-stx-runtime\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-framework-composables\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-stores\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-composables\b[^>]*>[\s\S]*?<\/script>/gi,""),Z=[];for(let Y of YO){if(g4.has(Y))continue;let J=Y.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");if(new RegExp(`(^|[^\\w$.])${J}\\s*\\(`).test($))Z.push(Y)}return Z.sort()}async function QO(X,$){let Z=Uq(X);if(Z.length===0)return null;let Y=$??J$.join(import.meta.dir,"composables"),J=`${Y}\x00${Z.join(",")}`,G=p7.get(J);if(G!==void 0)return G||null;let Q=new Bun.Transpiler({loader:"ts",target:"browser",define:S0()}),q=new Set(Z),K=[],U=new Set,W=[];try{let j=new Bun.Glob("*.{ts,js}");for await(let _ of j.scan({cwd:Y,absolute:!0}))W.push(_)}catch{return p7.set(J,""),null}W=Kq(W);for(let j of W){let _;try{_=await Bun.file(j).text()}catch{continue}let H=[];try{H=Q.scan(_).exports.filter((L)=>L!=="default")}catch{continue}if(!H.some((L)=>q.has(L)))continue;try{_=_.replace(/^import\s+.*from\s+['"][^'"]+['"]\s*;?\s*$/gm,""),_=_.replace(/^import\s+type\s+.*$/gm,""),_=_.replace(/^export\s+\*\s+(?:as\s+\w+\s+)?from\s*['"][^'"]+['"]\s*;?\s*$/gm,""),_=_.replace(/^export\s+(?:type\s+)?\{[\s\S]*?\}\s*(?:from\s*['"][^'"]+['"]\s*)?;?\s*$/gm,""),_=_.replace(/^export\s+default\s+/gm,""),_=_.replace(/^export\s+(?=(?:declare\s+)?(?:abstract\s+)?(?:async\s+)?(?:function|class|const|let|var|type|interface|enum)\b)/gm,""),K.push(`// ${J$.basename(j).replace(/\.[jt]s$/,"")}
13633
+ ${Q.transformSync(_).trim()}`);for(let L of H)U.add(L)}catch(L){console.warn(`[stx] framework composable ${J$.basename(j)} could not be bundled:`,L)}}let w=Z.filter((j)=>!U.has(j)&&!GO(X,j));if(w.length>0)console.warn(`[stx] could not bundle ${w.join(", ")} from @stacksjs/stx/composables \u2014 `+"calls to them will throw ReferenceError in the browser. Import them explicitly so the bundler inlines them, or use a runtime equivalent from window.stx.");if(K.length===0)return p7.set(J,""),null;let z=[...U].map((j)=>` try { if (!(${JSON.stringify(j)} in __s)) { __s[${JSON.stringify(j)}] = ${j}; if (!(${JSON.stringify(j)} in window)) window[${JSON.stringify(j)}] = ${j}; } } catch (e) {}`).join(`
13634
13634
  `),B=`<script data-stx-framework-composables>
13635
13635
  ;(function(){
13636
13636
  var __s = window.stx = window.stx || {};
@@ -13639,7 +13639,7 @@ ${K.join(`
13639
13639
  `)}
13640
13640
  ${z}
13641
13641
  })();
13642
- </script>`;return p7.set(J,B),B}function GO(X){g4.clear();for(let $ of X)g4.add($)}var p7,g4,$O;var wq=E(()=>{F1();qq();p7=new Map,g4=new Set,$O=new Set(f4)});var jq={};n(jq,{getComposableScript:()=>UO,clearComposableCache:()=>WO});import i7 from"path";function zq(X){let $=i7.basename(X,".ts");return $==="index"||$==="types"||X.endsWith(".d.ts")}async function qO(X){if(X)return i7.resolve(X);let $=`<default>:${process.cwd()}`,Z=h4.get($);if(Z!==void 0)return Z;let Y=await KO();if(Y!==null)h4.set($,Y);return Y}async function KO(){let X=await I1(),$=X.root||process.cwd(),Z=X.composablesDir;if(Z)return i7.resolve($,Z);for(let Y of QO){let J=i7.resolve($,Y);try{let G=new Bun.Glob("**/*.ts");for await(let Q of G.scan({cwd:J,absolute:!0}))if(!zq(Q))return J}catch{}}return null}async function UO(X){let $=await qO(X);if(!$)return null;let Z=[];try{let j=new Bun.Glob("**/*.ts");for await(let _ of j.scan({cwd:$,absolute:!0})){if(zq(_))continue;Z.push(_)}}catch{return J1(c5,$,"",""),null}let Y=$$(Z),J=Z$(c5,$,Y);if(J!==void 0)return J||null;if(Z.length===0)return J1(c5,$,Y,""),null;Z.sort();let G=new Bun.Transpiler({loader:"ts",target:"browser",define:S0()}),Q=[],q=new Set,K=new Set;for(let j of Z)try{let _=await Bun.file(j).text(),H=i7.basename(j,".ts");for(let L of _.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(L[1])K.add(L[1]);try{for(let L of G.scan(_).exports)if(L!=="default")q.add(L)}catch{}_=f0(_),_=jX(_),_=_.replace(/^export\s+(default\s+)?/gm,""),_=G.transformSync(_),Q.push(`// Composable: ${H}
13642
+ </script>`;return p7.set(J,B),B}function qO(X){g4.clear();for(let $ of X)g4.add($)}var p7,g4,YO;var wq=E(()=>{F1();qq();p7=new Map,g4=new Set,YO=new Set(f4)});var jq={};n(jq,{getComposableScript:()=>wO,clearComposableCache:()=>zO});import i7 from"path";function zq(X){let $=i7.basename(X,".ts");return $==="index"||$==="types"||X.endsWith(".d.ts")}async function UO(X){if(X)return i7.resolve(X);let $=`<default>:${process.cwd()}`,Z=h4.get($);if(Z!==void 0)return Z;let Y=await WO();if(Y!==null)h4.set($,Y);return Y}async function WO(){let X=await I1(),$=X.root||process.cwd(),Z=X.composablesDir;if(Z)return i7.resolve($,Z);for(let Y of KO){let J=i7.resolve($,Y);try{let G=new Bun.Glob("**/*.ts");for await(let Q of G.scan({cwd:J,absolute:!0}))if(!zq(Q))return J}catch{}}return null}async function wO(X){let $=await UO(X);if(!$)return null;let Z=[];try{let j=new Bun.Glob("**/*.ts");for await(let _ of j.scan({cwd:$,absolute:!0})){if(zq(_))continue;Z.push(_)}}catch{return J1(c5,$,"",""),null}let Y=$$(Z),J=Z$(c5,$,Y);if(J!==void 0)return J||null;if(Z.length===0)return J1(c5,$,Y,""),null;Z.sort();let G=new Bun.Transpiler({loader:"ts",target:"browser",define:S0()}),Q=[],q=new Set,K=new Set;for(let j of Z)try{let _=await Bun.file(j).text(),H=i7.basename(j,".ts");for(let L of _.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(L[1])K.add(L[1]);try{for(let L of G.scan(_).exports)if(L!=="default")q.add(L)}catch{}_=f0(_),_=jX(_),_=_.replace(/^export\s+(default\s+)?/gm,""),_=G.transformSync(_),Q.push(`// Composable: ${H}
13643
13643
  ${_.trim()}`)}catch(_){console.warn(`[stx] Failed to load composable ${j}:`,_)}if(Q.length===0||q.size===0)return J1(c5,$,Y,""),null;let U=[...q].map((j)=>` try { __c[${JSON.stringify(j)}] = ${j}; } catch (e) {}`).join(`
13644
13644
  `),W=JSON.stringify([...q]),w=Q.join(`
13645
13645
 
@@ -13664,7 +13664,7 @@ ${U}
13664
13664
  }
13665
13665
  window[__n] = __c[__n];
13666
13666
  }
13667
- })();`;return J1(c5,$,Y,B),B}function WO(){c5.clear(),h4.clear()}var c5,h4,QO;var Bq=E(()=>{V1();F1();x4();e0();c5=new Map,h4=new Map,QO=["composables","functions"]});var Hq={};n(Hq,{processDeferDirectives:()=>_O});function wO(){return`stx-defer-${++_q}`}function zO(X){let $=X.match(/on:\s*['"]?(\w+)(?:\((\d+)\))?['"]?/);if($)return{trigger:$[1],value:$[2]};return{trigger:"immediate"}}function jO(X,$,Z){let{trigger:Y,value:J}=zO($),G=Z,Q,q,K,U=Z.match(/@placeholder\s*([\s\S]*?)(?=@loading|@error|$)/);if(U)Q=U[1].trim(),G=G.replace(/@placeholder[\s\S]*?(?=@loading|@error|$)/,"");let W=Z.match(/@loading\s*([\s\S]*?)(?=@error|$)/);if(W)q=W[1].trim(),G=G.replace(/@loading[\s\S]*?(?=@error|$)/,"");let w=Z.match(/@error(?:\s*\(\s*(\w+)\s*\))?\s*([\s\S]*)$/);if(w)K=w[2].trim(),G=G.replace(/@error(?:\s*\(\s*\w+\s*\))?[\s\S]*$/,"");return G=G.trim(),{trigger:Y,triggerValue:J,content:G,placeholder:Q,loading:q,error:K}}function BO(X,$){let{trigger:Z,triggerValue:Y}=$,J;switch(Z){case"visible":J=`
13667
+ })();`;return J1(c5,$,Y,B),B}function zO(){c5.clear(),h4.clear()}var c5,h4,KO;var Bq=E(()=>{V1();F1();x4();e0();c5=new Map,h4=new Map,KO=["composables","functions"]});var Hq={};n(Hq,{processDeferDirectives:()=>OO});function jO(){return`stx-defer-${++_q}`}function BO(X){let $=X.match(/on:\s*['"]?(\w+)(?:\((\d+)\))?['"]?/);if($)return{trigger:$[1],value:$[2]};return{trigger:"immediate"}}function _O(X,$,Z){let{trigger:Y,value:J}=BO($),G=Z,Q,q,K,U=Z.match(/@placeholder\s*([\s\S]*?)(?=@loading|@error|$)/);if(U)Q=U[1].trim(),G=G.replace(/@placeholder[\s\S]*?(?=@loading|@error|$)/,"");let W=Z.match(/@loading\s*([\s\S]*?)(?=@error|$)/);if(W)q=W[1].trim(),G=G.replace(/@loading[\s\S]*?(?=@error|$)/,"");let w=Z.match(/@error(?:\s*\(\s*(\w+)\s*\))?\s*([\s\S]*)$/);if(w)K=w[2].trim(),G=G.replace(/@error(?:\s*\(\s*\w+\s*\))?[\s\S]*$/,"");return G=G.trim(),{trigger:Y,triggerValue:J,content:G,placeholder:Q,loading:q,error:K}}function HO(X,$){let{trigger:Z,triggerValue:Y}=$,J;switch(Z){case"visible":J=`
13668
13668
  const observer = new IntersectionObserver((entries) => {
13669
13669
  if (entries[0].isIntersecting) {
13670
13670
  observer.disconnect();
@@ -13737,7 +13737,7 @@ else {
13737
13737
  ${J}
13738
13738
  })();
13739
13739
  </script>
13740
- `}function _O(X,$,Z){_q=0;let Y=/@defer\s*\(([^)]*)\)\s*([\s\S]*?)@enddefer/g;return X.replace(Y,(J,G,Q)=>{let q=wO(),K=jO(J,G,Q),U=K.placeholder?`<div data-defer-placeholder>${K.placeholder}</div>`:"",W=K.loading?`<div data-defer-loading style="display: none;">${K.loading}</div>`:'<div data-defer-loading style="display: none;"></div>',w=K.error?`<div data-defer-error style="display: none;">${K.error}</div>`:"",z=`<div data-defer-content style="display: none;">${K.content}</div>`,B=BO(q,K);return`
13740
+ `}function OO(X,$,Z){_q=0;let Y=/@defer\s*\(([^)]*)\)\s*([\s\S]*?)@enddefer/g;return X.replace(Y,(J,G,Q)=>{let q=jO(),K=_O(J,G,Q),U=K.placeholder?`<div data-defer-placeholder>${K.placeholder}</div>`:"",W=K.loading?`<div data-defer-loading style="display: none;">${K.loading}</div>`:'<div data-defer-loading style="display: none;"></div>',w=K.error?`<div data-defer-error style="display: none;">${K.error}</div>`:"",z=`<div data-defer-content style="display: none;">${K.content}</div>`,B=HO(q,K);return`
13741
13741
  <div id="${q}" class="stx-defer" data-defer-trigger="${K.trigger}">
13742
13742
  ${U}
13743
13743
  ${W}
@@ -13745,7 +13745,7 @@ else {
13745
13745
  ${w}
13746
13746
  </div>
13747
13747
  ${B}
13748
- `})}var _q=0;var Lq={};n(Lq,{processTeleportDirectives:()=>FO,ensureTeleportTargets:()=>VO});function HO(){return`stx-teleport-${++Oq}`}function OO(X){let $=X.split(",").map((J)=>J.trim()),Z=$[0].replace(/['"]/g,""),Y;for(let J=1;J<$.length;J++){let G=$[J].match(/disabled:\s*(.+)/);if(G)Y=G[1].trim()}return{target:Z,disabled:Y}}function LO(X,$){return`
13748
+ `})}var _q=0;var Lq={};n(Lq,{processTeleportDirectives:()=>AO,ensureTeleportTargets:()=>RO});function LO(){return`stx-teleport-${++Oq}`}function FO(X){let $=X.split(",").map((J)=>J.trim()),Z=$[0].replace(/['"]/g,""),Y;for(let J=1;J<$.length;J++){let G=$[J].match(/disabled:\s*(.+)/);if(G)Y=G[1].trim()}return{target:Z,disabled:Y}}function VO(X,$){return`
13749
13749
  <script>
13750
13750
  (function() {
13751
13751
  const source = document.getElementById('${X}');
@@ -13791,12 +13791,12 @@ else {
13791
13791
  });
13792
13792
  })();
13793
13793
  </script>
13794
- `}function FO(X,$,Z){Oq=0;let Y=/@teleport\s*\(([^)]+)\)\s*([\s\S]*?)@endteleport/g;return X.replace(Y,(J,G,Q)=>{let q=HO(),{target:K,disabled:U}=OO(G),W=Q.trim();if(U)try{let z=!1;if(U==="true")z=!0;else if(U==="false")z=!1;else if(U in $)z=Boolean($[U]);if(z)return`<div class="stx-teleport-inline" data-teleport-disabled>${W}</div>`}catch{}let w=LO(q,K);return`
13794
+ `}function AO(X,$,Z){Oq=0;let Y=/@teleport\s*\(([^)]+)\)\s*([\s\S]*?)@endteleport/g;return X.replace(Y,(J,G,Q)=>{let q=LO(),{target:K,disabled:U}=FO(G),W=Q.trim();if(U)try{let z=!1;if(U==="true")z=!0;else if(U==="false")z=!1;else if(U in $)z=Boolean($[U]);if(z)return`<div class="stx-teleport-inline" data-teleport-disabled>${W}</div>`}catch{}let w=VO(q,K);return`
13795
13795
  <div id="${q}" class="stx-teleport-source" style="display: none;">
13796
13796
  <template>${W}</template>
13797
13797
  </div>
13798
13798
  ${w}
13799
- `})}function VO(){return`
13799
+ `})}function RO(){return`
13800
13800
  <script>
13801
13801
  (function() {
13802
13802
  // Common teleport targets
@@ -13813,7 +13813,7 @@ else {
13813
13813
  });
13814
13814
  })();
13815
13815
  </script>
13816
- `}var Oq=0;var Rq={};n(Rq,{processTransitionDirectives:()=>TO,processTransitionAttributes:()=>EO,performLeave:()=>NO,performEnter:()=>RO,generateTransitionRuntime:()=>IO,generateTransitionCSS:()=>kO});function Fq(X,$={}){return{enterFrom:$.enterClass||`${X}-enter-from`,enterActive:$.enterActiveClass||`${X}-enter-active`,enterTo:$.enterToClass||`${X}-enter-to`,leaveFrom:$.leaveClass||`${X}-leave-from`,leaveActive:$.leaveActiveClass||`${X}-leave-active`,leaveTo:$.leaveToClass||`${X}-leave-to`}}function AO(X){let $=getComputedStyle(X),Z=$.transitionDuration||"0s",Y=$.animationDuration||"0s",J=(G)=>{let Q=G.match(/^([\d.]+)(s|ms)?$/);if(!Q)return 0;let q=parseFloat(Q[1]);return(Q[2]||"s")==="ms"?q:q*1000};return Math.max(J(Z),J(Y))}function Vq(X,$){return new Promise((Z)=>{let Y=$??AO(X);if(Y===0){Z();return}let J=!1,G=()=>{if(J)return;J=!0,X.removeEventListener("transitionend",Q),X.removeEventListener("animationend",Q),Z()},Q=(q)=>{if(q.target===X)G()};X.addEventListener("transitionend",Q),X.addEventListener("animationend",Q),setTimeout(G,Y+50)})}function Aq(X){X.offsetHeight}async function RO(X,$={}){let Z=$.name||"stx",Y=Fq(Z,$),J=typeof $.duration==="object"?$.duration.enter:$.duration;if($.onBeforeEnter?.(X),X.classList.add(Y.enterFrom),X.classList.add(Y.enterActive),Aq(X),X.classList.remove(Y.enterFrom),X.classList.add(Y.enterTo),$.onEnter)await new Promise((G)=>{$.onEnter(X,G)});else await Vq(X,J);X.classList.remove(Y.enterActive),X.classList.remove(Y.enterTo),$.onAfterEnter?.(X)}async function NO(X,$={}){let Z=$.name||"stx",Y=Fq(Z,$),J=typeof $.duration==="object"?$.duration.leave:$.duration;if($.onBeforeLeave?.(X),X.classList.add(Y.leaveFrom),X.classList.add(Y.leaveActive),Aq(X),X.classList.remove(Y.leaveFrom),X.classList.add(Y.leaveTo),$.onLeave)await new Promise((G)=>{$.onLeave(X,G)});else await Vq(X,J);X.classList.remove(Y.leaveActive),X.classList.remove(Y.leaveTo),$.onAfterLeave?.(X)}function TO(X,$={},Z){let Y=/@transition\s*\(([^)]*)\)([\s\S]*?)@endtransition/gi;return X.replace(Y,(J,G,Q)=>{let q=MO(G),K=q.name||"stx",U=q.duration||300,W=`stx-transition-${Math.random().toString(36).slice(2,9)}`;return`
13816
+ `}var Oq=0;var Rq={};n(Rq,{processTransitionDirectives:()=>kO,processTransitionAttributes:()=>yO,performLeave:()=>MO,performEnter:()=>TO,generateTransitionRuntime:()=>DO,generateTransitionCSS:()=>EO});function Fq(X,$={}){return{enterFrom:$.enterClass||`${X}-enter-from`,enterActive:$.enterActiveClass||`${X}-enter-active`,enterTo:$.enterToClass||`${X}-enter-to`,leaveFrom:$.leaveClass||`${X}-leave-from`,leaveActive:$.leaveActiveClass||`${X}-leave-active`,leaveTo:$.leaveToClass||`${X}-leave-to`}}function NO(X){let $=getComputedStyle(X),Z=$.transitionDuration||"0s",Y=$.animationDuration||"0s",J=(G)=>{let Q=G.match(/^([\d.]+)(s|ms)?$/);if(!Q)return 0;let q=parseFloat(Q[1]);return(Q[2]||"s")==="ms"?q:q*1000};return Math.max(J(Z),J(Y))}function Vq(X,$){return new Promise((Z)=>{let Y=$??NO(X);if(Y===0){Z();return}let J=!1,G=()=>{if(J)return;J=!0,X.removeEventListener("transitionend",Q),X.removeEventListener("animationend",Q),Z()},Q=(q)=>{if(q.target===X)G()};X.addEventListener("transitionend",Q),X.addEventListener("animationend",Q),setTimeout(G,Y+50)})}function Aq(X){X.offsetHeight}async function TO(X,$={}){let Z=$.name||"stx",Y=Fq(Z,$),J=typeof $.duration==="object"?$.duration.enter:$.duration;if($.onBeforeEnter?.(X),X.classList.add(Y.enterFrom),X.classList.add(Y.enterActive),Aq(X),X.classList.remove(Y.enterFrom),X.classList.add(Y.enterTo),$.onEnter)await new Promise((G)=>{$.onEnter(X,G)});else await Vq(X,J);X.classList.remove(Y.enterActive),X.classList.remove(Y.enterTo),$.onAfterEnter?.(X)}async function MO(X,$={}){let Z=$.name||"stx",Y=Fq(Z,$),J=typeof $.duration==="object"?$.duration.leave:$.duration;if($.onBeforeLeave?.(X),X.classList.add(Y.leaveFrom),X.classList.add(Y.leaveActive),Aq(X),X.classList.remove(Y.leaveFrom),X.classList.add(Y.leaveTo),$.onLeave)await new Promise((G)=>{$.onLeave(X,G)});else await Vq(X,J);X.classList.remove(Y.leaveActive),X.classList.remove(Y.leaveTo),$.onAfterLeave?.(X)}function kO(X,$={},Z){let Y=/@transition\s*\(([^)]*)\)([\s\S]*?)@endtransition/gi;return X.replace(Y,(J,G,Q)=>{let q=IO(G),K=q.name||"stx",U=q.duration||300,W=`stx-transition-${Math.random().toString(36).slice(2,9)}`;return`
13817
13817
  <div
13818
13818
  class="stx-transition-wrapper"
13819
13819
  data-transition="${K}"
@@ -13855,7 +13855,7 @@ else {
13855
13855
  });
13856
13856
  })();
13857
13857
  </script>
13858
- `})}function MO(X){let $={},Z=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\d+)|(\w+))/g,Y;while((Y=Z.exec(X))!==null){let J=Y[1],G=Y[2]||Y[3]||Y[4]||Y[5];switch(J){case"name":$.name=G;break;case"duration":$.duration=parseInt(G,10);break;case"mode":$.mode=G;break;case"easing":$.easing=G;break}}return $}function kO(){return`
13858
+ `})}function IO(X){let $={},Z=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\d+)|(\w+))/g,Y;while((Y=Z.exec(X))!==null){let J=Y[1],G=Y[2]||Y[3]||Y[4]||Y[5];switch(J){case"name":$.name=G;break;case"duration":$.duration=parseInt(G,10);break;case"mode":$.mode=G;break;case"easing":$.easing=G;break}}return $}function EO(){return`
13859
13859
  /* STX Transition Presets */
13860
13860
 
13861
13861
  /* Fade */
@@ -14042,7 +14042,7 @@ else {
14042
14042
  opacity: 1;
14043
14043
  max-height: 1000px;
14044
14044
  }
14045
- `}function IO(){return`
14045
+ `}function DO(){return`
14046
14046
  // STX Transition Runtime
14047
14047
  (function() {
14048
14048
  if (typeof window === 'undefined') return;
@@ -14131,7 +14131,7 @@ else {
14131
14131
 
14132
14132
  console.log('[stx] Transition runtime initialized');
14133
14133
  })();
14134
- `}function EO(X){let $=/@transition\.([a-z-]+)(?:\.(\d+))?="([^"]+)"/gi;return X.replace($,(Z,Y,J,G)=>{let Q=J||"300",q=`stx-t-${Math.random().toString(36).slice(2,7)}`;return`data-stx-transition="${Y}" data-stx-transition-duration="${Q}" data-stx-transition-condition="${G}" data-stx-transition-id="${q}"`})}var Tq={};n(Tq,{withErrorBoundary:()=>Nq,processErrorBoundaryDirectives:()=>bO,generateErrorBoundaryRuntime:()=>xO,generateErrorBoundaryCSS:()=>vO,createErrorBoundary:()=>PO});function yO(){return`eb-${++DO}-${Date.now().toString(36)}`}function bO(X,$={},Z){let Y=/@errorBoundary(?:\s*\(([^)]*)\))?\s*([\s\S]*?)@fallback\s*([\s\S]*?)@enderrorBoundary/gi;return X.replace(Y,(J,G,Q,q)=>{let K=yO(),U=SO(G||"");return CO(K,Q.trim(),q.trim(),U)})}function SO(X){let $={},Z=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\w+))/g,Y;while((Y=Z.exec(X))!==null){let J=Y[1],G=Y[2]||Y[3]||Y[4];switch(J){case"id":$.id=G;break;case"logErrors":$.logErrors=G==="true";break}}return $}function CO(X,$,Z,Y){let J=Y.logErrors!==!1;return`
14134
+ `}function yO(X){let $=/@transition\.([a-z-]+)(?:\.(\d+))?="([^"]+)"/gi;return X.replace($,(Z,Y,J,G)=>{let Q=J||"300",q=`stx-t-${Math.random().toString(36).slice(2,7)}`;return`data-stx-transition="${Y}" data-stx-transition-duration="${Q}" data-stx-transition-condition="${G}" data-stx-transition-id="${q}"`})}var Tq={};n(Tq,{withErrorBoundary:()=>Nq,processErrorBoundaryDirectives:()=>CO,generateErrorBoundaryRuntime:()=>gO,generateErrorBoundaryCSS:()=>fO,createErrorBoundary:()=>xO});function SO(){return`eb-${++bO}-${Date.now().toString(36)}`}function CO(X,$={},Z){let Y=/@errorBoundary(?:\s*\(([^)]*)\))?\s*([\s\S]*?)@fallback\s*([\s\S]*?)@enderrorBoundary/gi;return X.replace(Y,(J,G,Q,q)=>{let K=SO(),U=PO(G||"");return vO(K,Q.trim(),q.trim(),U)})}function PO(X){let $={},Z=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\w+))/g,Y;while((Y=Z.exec(X))!==null){let J=Y[1],G=Y[2]||Y[3]||Y[4];switch(J){case"id":$.id=G;break;case"logErrors":$.logErrors=G==="true";break}}return $}function vO(X,$,Z,Y){let J=Y.logErrors!==!1;return`
14135
14135
  <div class="stx-error-boundary" data-boundary-id="${X}" data-has-error="false">
14136
14136
  <div class="stx-error-boundary-content" data-boundary-content="${X}">
14137
14137
  ${$}
@@ -14251,7 +14251,7 @@ else {
14251
14251
  };
14252
14252
  })();
14253
14253
  </script>
14254
- `}async function Nq(X,$,Z){try{return await X()}catch(Y){if(Z)Z(Y instanceof Error?Y:Error(String(Y)));else console.error("[stx:errorBoundary] SSR Error:",Y);return $}}function PO(X,$={}){let Z=$.onError?(Y)=>$.onError(Y,{timestamp:Date.now(),boundaryId:"ssr"}):void 0;return(Y)=>Nq(Y,X,Z)}function vO(){return`
14254
+ `}async function Nq(X,$,Z){try{return await X()}catch(Y){if(Z)Z(Y instanceof Error?Y:Error(String(Y)));else console.error("[stx:errorBoundary] SSR Error:",Y);return $}}function xO(X,$={}){let Z=$.onError?(Y)=>$.onError(Y,{timestamp:Date.now(),boundaryId:"ssr"}):void 0;return(Y)=>Nq(Y,X,Z)}function fO(){return`
14255
14255
  /* STX Error Boundary Styles */
14256
14256
  .stx-error-boundary {
14257
14257
  position: relative;
@@ -14295,7 +14295,7 @@ else {
14295
14295
  color: #fecaca;
14296
14296
  }
14297
14297
  }
14298
- `}function xO(){return`
14298
+ `}function gO(){return`
14299
14299
  // STX Error Boundary Runtime
14300
14300
  (function() {
14301
14301
  if (typeof window === 'undefined') return;
@@ -14360,7 +14360,7 @@ else {
14360
14360
 
14361
14361
  console.log('[stx] Error boundary runtime initialized');
14362
14362
  })();
14363
- `}var DO=0;var Mq={};n(Mq,{renderSSRSuspense:()=>lO,processSuspenseDirectives:()=>hO,generateSuspenseRuntime:()=>pO,generateSuspenseCSS:()=>cO,createSSRSuspense:()=>mO});function gO(){return`suspense-${++fO}-${Date.now().toString(36)}`}function hO(X,$={},Z){let Y=/@suspense(?:\s*\(([^)]*)\))?\s*([\s\S]*?)@fallback\s*([\s\S]*?)@endsuspense/gi;return X.replace(Y,(J,G,Q,q)=>{let K=gO(),U=uO(G||"");return dO(K,Q.trim(),q.trim(),U)})}function uO(X){let $={},Z=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\d+)|(\w+))/g,Y;while((Y=Z.exec(X))!==null){let J=Y[1],G=Y[2]||Y[3],Q=Y[4];switch(J){case"id":$.id=G;break;case"timeout":$.timeout=Q?parseInt(Q,10):void 0;break}}return $}function dO(X,$,Z,Y){let J=Y.timeout||30000,G=Y.id||X;return`
14363
+ `}var bO=0;var Mq={};n(Mq,{renderSSRSuspense:()=>pO,processSuspenseDirectives:()=>dO,generateSuspenseRuntime:()=>nO,generateSuspenseCSS:()=>iO,createSSRSuspense:()=>cO});function uO(){return`suspense-${++hO}-${Date.now().toString(36)}`}function dO(X,$={},Z){let Y=/@suspense(?:\s*\(([^)]*)\))?\s*([\s\S]*?)@fallback\s*([\s\S]*?)@endsuspense/gi;return X.replace(Y,(J,G,Q,q)=>{let K=uO(),U=mO(G||"");return lO(K,Q.trim(),q.trim(),U)})}function mO(X){let $={},Z=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\d+)|(\w+))/g,Y;while((Y=Z.exec(X))!==null){let J=Y[1],G=Y[2]||Y[3],Q=Y[4];switch(J){case"id":$.id=G;break;case"timeout":$.timeout=Q?parseInt(Q,10):void 0;break}}return $}function lO(X,$,Z,Y){let J=Y.timeout||30000,G=Y.id||X;return`
14364
14364
  <div class="stx-suspense" data-suspense-id="${X}" data-custom-id="${G}" data-status="pending">
14365
14365
  <div class="stx-suspense-fallback" data-suspense-fallback="${X}">
14366
14366
  ${Z}
@@ -14550,7 +14550,7 @@ else {
14550
14550
  }, 0);
14551
14551
  })();
14552
14552
  </script>
14553
- `}function mO(X,$,Z){return{id:X,fallback:Z,content:$}}async function lO(X){let $=X.map((Y)=>`
14553
+ `}function cO(X,$,Z){return{id:X,fallback:Z,content:$}}async function pO(X){let $=X.map((Y)=>`
14554
14554
  <div id="stx-ssr-suspense-${Y.id}" class="stx-ssr-suspense">
14555
14555
  ${Y.fallback}
14556
14556
  </div>
@@ -14575,7 +14575,7 @@ else {
14575
14575
  }
14576
14576
  })();
14577
14577
  </script>
14578
- `}}return{initial:$,streaming:Z()}}function cO(){return`
14578
+ `}}return{initial:$,streaming:Z()}}function iO(){return`
14579
14579
  /* STX Suspense Styles */
14580
14580
  .stx-suspense {
14581
14581
  position: relative;
@@ -14631,7 +14631,7 @@ else {
14631
14631
  background-size: 200% 100%;
14632
14632
  }
14633
14633
  }
14634
- `}function pO(){return`
14634
+ `}function nO(){return`
14635
14635
  // STX Suspense Runtime
14636
14636
  (function() {
14637
14637
  if (typeof window === 'undefined') return;
@@ -14698,7 +14698,7 @@ else {
14698
14698
 
14699
14699
  console.log('[stx] Suspense runtime initialized');
14700
14700
  })();
14701
- `}var fO=0;var Dq={};n(Dq,{processAsyncDirectives:()=>nO,isAsyncComponent:()=>oO,generateAsyncComponentRuntime:()=>aO,generateAsyncComponentCSS:()=>sO,defineAsyncComponent:()=>rO});function kq(){return`async-${++iO}-${Date.now().toString(36)}`}function nO(X,$={},Z){let Y=/@async\s*\(([^)]*)\)\s*([\s\S]*?)@error\s*([\s\S]*?)@endasync/gi,J=/@async\s*\(([^)]*)\)\s*([\s\S]*?)@endasync/gi,G=X;return G=G.replace(Y,(Q,q,K,U)=>{let W=kq(),w=Iq(q);return Eq(W,w,K.trim(),U.trim())}),G=G.replace(J,(Q,q,K)=>{let U=kq(),W=Iq(q);return Eq(U,W,K.trim(),'<div class="stx-async-error">Failed to load component</div>')}),G}function Iq(X){let $={component:"",timeout:30000,delay:200,suspensible:!0,retries:0},Z=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\d+)|(\w+))/g,Y;while((Y=Z.exec(X))!==null){let J=Y[1],G=Y[2]||Y[3],Q=Y[4],q=Y[5];switch(J){case"component":$.component=G||q||"";break;case"timeout":$.timeout=Q?parseInt(Q,10):30000;break;case"delay":$.delay=Q?parseInt(Q,10):200;break;case"suspensible":$.suspensible=q==="true";break;case"retries":$.retries=Q?parseInt(Q,10):0;break;case"loadingComponent":$.loadingComponent=G||q;break;case"errorComponent":$.errorComponent=G||q;break}}return $}function Eq(X,$,Z,Y){let{component:J,timeout:G,delay:Q,suspensible:q,retries:K}=$;return`
14701
+ `}var hO=0;var Dq={};n(Dq,{processAsyncDirectives:()=>oO,isAsyncComponent:()=>aO,generateAsyncComponentRuntime:()=>eO,generateAsyncComponentCSS:()=>tO,defineAsyncComponent:()=>sO});function kq(){return`async-${++rO}-${Date.now().toString(36)}`}function oO(X,$={},Z){let Y=/@async\s*\(([^)]*)\)\s*([\s\S]*?)@error\s*([\s\S]*?)@endasync/gi,J=/@async\s*\(([^)]*)\)\s*([\s\S]*?)@endasync/gi,G=X;return G=G.replace(Y,(Q,q,K,U)=>{let W=kq(),w=Iq(q);return Eq(W,w,K.trim(),U.trim())}),G=G.replace(J,(Q,q,K)=>{let U=kq(),W=Iq(q);return Eq(U,W,K.trim(),'<div class="stx-async-error">Failed to load component</div>')}),G}function Iq(X){let $={component:"",timeout:30000,delay:200,suspensible:!0,retries:0},Z=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\d+)|(\w+))/g,Y;while((Y=Z.exec(X))!==null){let J=Y[1],G=Y[2]||Y[3],Q=Y[4],q=Y[5];switch(J){case"component":$.component=G||q||"";break;case"timeout":$.timeout=Q?parseInt(Q,10):30000;break;case"delay":$.delay=Q?parseInt(Q,10):200;break;case"suspensible":$.suspensible=q==="true";break;case"retries":$.retries=Q?parseInt(Q,10):0;break;case"loadingComponent":$.loadingComponent=G||q;break;case"errorComponent":$.errorComponent=G||q;break}}return $}function Eq(X,$,Z,Y){let{component:J,timeout:G,delay:Q,suspensible:q,retries:K}=$;return`
14702
14702
  <div class="stx-async-component" data-async-id="${X}" data-component="${J}" data-status="pending">
14703
14703
  <div class="stx-async-loading" data-async-loading="${X}">
14704
14704
  ${Z}
@@ -14925,7 +14925,7 @@ catch (error) {
14925
14925
  loadComponent();
14926
14926
  })();
14927
14927
  </script>
14928
- `}function rO(X){return{__asyncComponent:!0,...typeof X==="function"?{loader:X}:X}}function oO(X){return typeof X==="object"&&X!==null&&"__asyncComponent"in X&&X.__asyncComponent===!0}function sO(){return`
14928
+ `}function sO(X){return{__asyncComponent:!0,...typeof X==="function"?{loader:X}:X}}function aO(X){return typeof X==="object"&&X!==null&&"__asyncComponent"in X&&X.__asyncComponent===!0}function tO(){return`
14929
14929
  /* STX Async Component Styles */
14930
14930
  .stx-async-component {
14931
14931
  position: relative;
@@ -14999,7 +14999,7 @@ catch (error) {
14999
14999
  background-size: 200% 100%;
15000
15000
  }
15001
15001
  }
15002
- `}function aO(){return`
15002
+ `}function eO(){return`
15003
15003
  // STX Async Component Runtime
15004
15004
  (function() {
15005
15005
  if (typeof window === 'undefined') return;
@@ -15053,7 +15053,7 @@ catch (error) {
15053
15053
 
15054
15054
  console.log('[stx] Async component runtime initialized');
15055
15055
  })();
15056
- `}var iO=0;var bq={};n(bq,{shouldCacheComponent:()=>YL,processKeepAliveDirectives:()=>eO,onDeactivated:()=>qL,onActivated:()=>QL,generateKeepAliveRuntime:()=>GL,generateKeepAliveCSS:()=>JL,createKeepAliveCache:()=>ZL});function yq(){return`keep-alive-${++tO}-${Date.now().toString(36)}`}function eO(X,$={},Z){let Y=/@keepAlive(?:\s*\(([^)]*)\))?\s*([\s\S]*?)@endkeepAlive/gi;return X.replace(Y,(J,G,Q)=>{let q=yq(),K=XL(G||"");return $L(q,Q.trim(),K)})}function XL(X){let $={max:10},Z=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\d+)|(\w+))/g,Y;while((Y=Z.exec(X))!==null){let J=Y[1],G=Y[2]||Y[3],Q=Y[4];switch(J){case"max":$.max=Q?parseInt(Q,10):10;break;case"include":$.include=G;break;case"exclude":$.exclude=G;break;case"id":$.id=G;break}}return $}function $L(X,$,Z){let{max:Y,include:J,exclude:G}=Z,Q=Z.id||X;return`
15056
+ `}var rO=0;var bq={};n(bq,{shouldCacheComponent:()=>GL,processKeepAliveDirectives:()=>$L,onDeactivated:()=>UL,onActivated:()=>KL,generateKeepAliveRuntime:()=>qL,generateKeepAliveCSS:()=>QL,createKeepAliveCache:()=>JL});function yq(){return`keep-alive-${++XL}-${Date.now().toString(36)}`}function $L(X,$={},Z){let Y=/@keepAlive(?:\s*\(([^)]*)\))?\s*([\s\S]*?)@endkeepAlive/gi;return X.replace(Y,(J,G,Q)=>{let q=yq(),K=ZL(G||"");return YL(q,Q.trim(),K)})}function ZL(X){let $={max:10},Z=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\d+)|(\w+))/g,Y;while((Y=Z.exec(X))!==null){let J=Y[1],G=Y[2]||Y[3],Q=Y[4];switch(J){case"max":$.max=Q?parseInt(Q,10):10;break;case"include":$.include=G;break;case"exclude":$.exclude=G;break;case"id":$.id=G;break}}return $}function YL(X,$,Z){let{max:Y,include:J,exclude:G}=Z,Q=Z.id||X;return`
15057
15057
  <div class="stx-keep-alive" data-keep-alive-id="${X}" data-custom-id="${Q}">
15058
15058
  <div class="stx-keep-alive-content" data-keep-alive-content="${X}">
15059
15059
  ${$}
@@ -15340,7 +15340,7 @@ else {
15340
15340
  });
15341
15341
  })();
15342
15342
  </script>
15343
- `}function ZL(X={}){return{id:X.id||yq(),cache:new Map,max:X.max||10,include:X.include?X.include.split(",").map((Z)=>Z.trim()):null,exclude:X.exclude?X.exclude.split(",").map((Z)=>Z.trim()):null}}function YL(X,$){if($.exclude&&$.exclude.includes(X))return!1;if($.include&&!$.include.includes(X))return!1;return!0}function JL(){return`
15343
+ `}function JL(X={}){return{id:X.id||yq(),cache:new Map,max:X.max||10,include:X.include?X.include.split(",").map((Z)=>Z.trim()):null,exclude:X.exclude?X.exclude.split(",").map((Z)=>Z.trim()):null}}function GL(X,$){if($.exclude&&$.exclude.includes(X))return!1;if($.include&&!$.include.includes(X))return!1;return!0}function QL(){return`
15344
15344
  /* STX Keep-Alive Styles */
15345
15345
  .stx-keep-alive {
15346
15346
  position: relative;
@@ -15365,7 +15365,7 @@ else {
15365
15365
  .stx-keep-alive-content > [data-activated] {
15366
15366
  opacity: 1;
15367
15367
  }
15368
- `}function GL(){return`
15368
+ `}function qL(){return`
15369
15369
  // STX Keep-Alive Runtime
15370
15370
  (function() {
15371
15371
  if (typeof window === 'undefined') return;
@@ -15401,7 +15401,7 @@ else {
15401
15401
 
15402
15402
  console.log('[stx] Keep-alive runtime initialized');
15403
15403
  })();
15404
- `}function QL(X){if(typeof document<"u")document.addEventListener("stx:activated",($)=>{X($.detail)})}function qL(X){if(typeof document<"u")document.addEventListener("stx:deactivated",($)=>{X($.detail)})}var tO=0;var xq={};n(xq,{useVirtualList:()=>Cq,processVirtualListDirectives:()=>d4,processVirtualGridDirectives:()=>vq,processInfiniteListDirectives:()=>Pq,generateVirtualListCSS:()=>Sq,default:()=>KL,createVirtualList:()=>u4});function u4(X,$){let{itemHeight:Z,containerHeight:Y,overscan:J=3,keyProperty:G="id",dynamicHeight:Q=!1,estimatedItemHeight:q=Z,direction:K="vertical"}=$,U=[...X],W=0,w=new Map;function z(){if(Q)return B();let R=Math.max(0,Math.floor(W/Z)-J),N=Math.ceil(Y/Z),T=Math.min(U.length-1,R+N+J*2);return{startIndex:R,endIndex:T}}function B(){let R=0,N=0,T=U.length-1;for(let k=0;k<U.length;k++){let M=w.get(k)||q;if(R+M>W){N=Math.max(0,k-J);break}R+=M}R=0;for(let k=0;k<U.length;k++){let M=w.get(k)||q;if(R+=M,R>W+Y){T=Math.min(U.length-1,k+J);break}}return{startIndex:N,endIndex:T}}function j(){if(Q){let R=0;for(let N=0;N<U.length;N++)R+=w.get(N)||q;return R}return U.length*Z}function _(R){if(Q){let N=0;for(let T=0;T<R;T++)N+=w.get(T)||q;return N}return R*Z}function H(){let{startIndex:R,endIndex:N}=z();return{startIndex:R,endIndex:N,scrollTop:W,totalHeight:j(),visibleItems:U.slice(R,N+1),itemHeights:new Map(w)}}function L(R,N="auto"){let T=_(R);O(T,N)}function O(R,N="auto"){W=Math.max(0,Math.min(R,j()-Y))}function F(){z()}function V(R){U=[...R],w.clear(),F()}function A(){U=[],w.clear()}return{scrollToIndex:L,scrollToOffset:O,getState:H,refresh:F,setItems:V,destroy:A}}function d4(X,$={},Z){let Y=/@virtualList\s*\(\s*([^,]+)\s*(?:,\s*(\{[^}]*\}))?\s*\)\s*([\s\S]*?)@endvirtualList/gi;return X.replace(Y,(J,G,Q,q)=>{let K=G.trim(),U=$[K];if(!U||!Array.isArray(U))return`<!-- virtualList: items "${K}" not found or not an array -->`;let W={itemHeight:50,containerHeight:400,overscan:3};if(Q)try{let O=Q.trim(),F=Function(`return ${O}`)();W={...W,...F}}catch{}let w=`vlist-${Math.random().toString(36).substring(2,9)}`,z=Math.ceil(W.containerHeight/W.itemHeight),B=W.overscan||3,j=0,_=Math.min(U.length-1,z+B),H="";for(let O=j;O<=_&&O<U.length;O++){let F=U[O],V=q.replace(/\{\{\s*item\s*\}\}/g,typeof F==="object"?JSON.stringify(F):String(F)).replace(/\{\{\s*item\.(\w+)\s*\}\}/g,(A,R)=>{if(typeof F==="object"&&F!==null)return String(F[R]??"");return""}).replace(/\{\{\s*index\s*\}\}/g,String(O));H+=`
15404
+ `}function KL(X){if(typeof document<"u")document.addEventListener("stx:activated",($)=>{X($.detail)})}function UL(X){if(typeof document<"u")document.addEventListener("stx:deactivated",($)=>{X($.detail)})}var XL=0;var xq={};n(xq,{useVirtualList:()=>Cq,processVirtualListDirectives:()=>d4,processVirtualGridDirectives:()=>vq,processInfiniteListDirectives:()=>Pq,generateVirtualListCSS:()=>Sq,default:()=>WL,createVirtualList:()=>u4});function u4(X,$){let{itemHeight:Z,containerHeight:Y,overscan:J=3,keyProperty:G="id",dynamicHeight:Q=!1,estimatedItemHeight:q=Z,direction:K="vertical"}=$,U=[...X],W=0,w=new Map;function z(){if(Q)return B();let R=Math.max(0,Math.floor(W/Z)-J),N=Math.ceil(Y/Z),T=Math.min(U.length-1,R+N+J*2);return{startIndex:R,endIndex:T}}function B(){let R=0,N=0,T=U.length-1;for(let k=0;k<U.length;k++){let M=w.get(k)||q;if(R+M>W){N=Math.max(0,k-J);break}R+=M}R=0;for(let k=0;k<U.length;k++){let M=w.get(k)||q;if(R+=M,R>W+Y){T=Math.min(U.length-1,k+J);break}}return{startIndex:N,endIndex:T}}function j(){if(Q){let R=0;for(let N=0;N<U.length;N++)R+=w.get(N)||q;return R}return U.length*Z}function _(R){if(Q){let N=0;for(let T=0;T<R;T++)N+=w.get(T)||q;return N}return R*Z}function H(){let{startIndex:R,endIndex:N}=z();return{startIndex:R,endIndex:N,scrollTop:W,totalHeight:j(),visibleItems:U.slice(R,N+1),itemHeights:new Map(w)}}function L(R,N="auto"){let T=_(R);O(T,N)}function O(R,N="auto"){W=Math.max(0,Math.min(R,j()-Y))}function F(){z()}function V(R){U=[...R],w.clear(),F()}function A(){U=[],w.clear()}return{scrollToIndex:L,scrollToOffset:O,getState:H,refresh:F,setItems:V,destroy:A}}function d4(X,$={},Z){let Y=/@virtualList\s*\(\s*([^,]+)\s*(?:,\s*(\{[^}]*\}))?\s*\)\s*([\s\S]*?)@endvirtualList/gi;return X.replace(Y,(J,G,Q,q)=>{let K=G.trim(),U=$[K];if(!U||!Array.isArray(U))return`<!-- virtualList: items "${K}" not found or not an array -->`;let W={itemHeight:50,containerHeight:400,overscan:3};if(Q)try{let O=Q.trim(),F=Function(`return ${O}`)();W={...W,...F}}catch{}let w=`vlist-${Math.random().toString(36).substring(2,9)}`,z=Math.ceil(W.containerHeight/W.itemHeight),B=W.overscan||3,j=0,_=Math.min(U.length-1,z+B),H="";for(let O=j;O<=_&&O<U.length;O++){let F=U[O],V=q.replace(/\{\{\s*item\s*\}\}/g,typeof F==="object"?JSON.stringify(F):String(F)).replace(/\{\{\s*item\.(\w+)\s*\}\}/g,(A,R)=>{if(typeof F==="object"&&F!==null)return String(F[R]??"");return""}).replace(/\{\{\s*index\s*\}\}/g,String(O));H+=`
15405
15405
  <div class="virtual-item ${W.itemClass||""}"
15406
15406
  style="position: absolute; top: ${O*W.itemHeight}px; height: ${W.itemHeight}px; width: 100%;"
15407
15407
  data-index="${O}">
@@ -15614,7 +15614,7 @@ else {
15614
15614
  });
15615
15615
  })();
15616
15616
  </script>
15617
- `})}var KL;var fq=E(()=>{KL={createVirtualList:u4,processVirtualListDirectives:d4,processInfiniteListDirectives:Pq,processVirtualGridDirectives:vq,generateVirtualListCSS:Sq,useVirtualList:Cq}});function gq(){return`<script data-stx-hydration-runtime>
15617
+ `})}var WL;var fq=E(()=>{WL={createVirtualList:u4,processVirtualListDirectives:d4,processInfiniteListDirectives:Pq,processVirtualGridDirectives:vq,generateVirtualListCSS:Sq,useVirtualList:Cq}});function gq(){return`<script data-stx-hydration-runtime>
15618
15618
  (function() {
15619
15619
  'use strict';
15620
15620
 
@@ -15774,7 +15774,7 @@ else {
15774
15774
  stxIslands.initIslands();
15775
15775
  }
15776
15776
  })();
15777
- </script>`}function hq(X){let $=X.match(/<([A-Z][a-zA-Z0-9]+)[\s/>]/);if($)return $[1];let Z=X.match(/<([a-z][a-z0-9]*-[a-z0-9-]+)[\s/>]/);if(Z)return Z[1];return null}function uq(X,$){let Z={},Y=/:([a-zA-Z_][\w-]*)\s*=\s*"([^"]+)"/g,J;while((J=Y.exec(X))!==null){let G=J[1],Q=J[2];if(Q in $)Z[G]=$[Q];else Z[G]=Q}return Z}var aq={};n(aq,{processStaticDirectives:()=>oq,processPartialHydrationDirectives:()=>mq,onHydrated:()=>rq,isHydrated:()=>nq,hydrateIsland:()=>cq,hydrateByStrategy:()=>pq,hydrateAll:()=>iq,generatePartialHydrationCSS:()=>lq,generateIslandManifest:()=>sq,default:()=>HL,createIslandRegistry:()=>dq});function dq(){let X=new Map;return{islands:X,register($){X.set($.id,$)},get($){return X.get($)},async hydrate($){let Z=X.get($);if(!Z||Z.hydrated)return;if(Z.hydrated=!0,typeof window<"u"&&typeof window.dispatchEvent==="function")window.dispatchEvent(new CustomEvent("stx:hydrate",{detail:{id:$,component:Z.component}}))},async hydrateAll(){let $=Array.from(X.values()).filter((Z)=>!Z.hydrated).map((Z)=>this.hydrate(Z.id));await Promise.all($)}}}function UL(X){return`
15777
+ </script>`}function hq(X){let $=X.match(/<([A-Z][a-zA-Z0-9]+)[\s/>]/);if($)return $[1];let Z=X.match(/<([a-z][a-z0-9]*-[a-z0-9-]+)[\s/>]/);if(Z)return Z[1];return null}function uq(X,$){let Z={},Y=/:([a-zA-Z_][\w-]*)\s*=\s*"([^"]+)"/g,J;while((J=Y.exec(X))!==null){let G=J[1],Q=J[2];if(Q in $)Z[G]=$[Q];else Z[G]=Q}return Z}var aq={};n(aq,{processStaticDirectives:()=>oq,processPartialHydrationDirectives:()=>mq,onHydrated:()=>rq,isHydrated:()=>nq,hydrateIsland:()=>cq,hydrateByStrategy:()=>pq,hydrateAll:()=>iq,generatePartialHydrationCSS:()=>lq,generateIslandManifest:()=>sq,default:()=>LL,createIslandRegistry:()=>dq});function dq(){let X=new Map;return{islands:X,register($){X.set($.id,$)},get($){return X.get($)},async hydrate($){let Z=X.get($);if(!Z||Z.hydrated)return;if(Z.hydrated=!0,typeof window<"u"&&typeof window.dispatchEvent==="function")window.dispatchEvent(new CustomEvent("stx:hydrate",{detail:{id:$,component:Z.component}}))},async hydrateAll(){let $=Array.from(X.values()).filter((Z)=>!Z.hydrated).map((Z)=>this.hydrate(Z.id));await Promise.all($)}}}function wL(X){return`
15778
15778
  <script data-hydrate="${X}">
15779
15779
  (function() {
15780
15780
  const island = document.querySelector('[data-island="${X}"]');
@@ -15785,7 +15785,7 @@ else {
15785
15785
  island.dispatchEvent(new CustomEvent('stx:hydrated', { bubbles: true }));
15786
15786
  })();
15787
15787
  </script>
15788
- `}function WL(X,$){let Z=$.timeout||2000,Y=$.priority||"low";return`
15788
+ `}function zL(X,$){let Z=$.timeout||2000,Y=$.priority||"low";return`
15789
15789
  <script data-hydrate="${X}">
15790
15790
  (function() {
15791
15791
  const island = document.querySelector('[data-island="${X}"]');
@@ -15821,7 +15821,7 @@ else {
15821
15821
  }
15822
15822
  })();
15823
15823
  </script>
15824
- `}function wL(X,$){let Z=$.rootMargin||"0px",Y=$.threshold||0;return`
15824
+ `}function jL(X,$){let Z=$.rootMargin||"0px",Y=$.threshold||0;return`
15825
15825
  <script data-hydrate="${X}">
15826
15826
  (function() {
15827
15827
  const island = document.querySelector('[data-island="${X}"]');
@@ -15854,7 +15854,7 @@ else {
15854
15854
  }
15855
15855
  })();
15856
15856
  </script>
15857
- `}function zL(X,$){let Z=$.media||"(min-width: 768px)";return`
15857
+ `}function BL(X,$){let Z=$.media||"(min-width: 768px)";return`
15858
15858
  <script data-hydrate="${X}">
15859
15859
  (function() {
15860
15860
  const island = document.querySelector('[data-island="${X}"]');
@@ -15883,7 +15883,7 @@ else {
15883
15883
  }
15884
15884
  })();
15885
15885
  </script>
15886
- `}function jL(X){return`
15886
+ `}function _L(X){return`
15887
15887
  <script data-hydrate="${X}">
15888
15888
  (function() {
15889
15889
  const island = document.querySelector('[data-island="${X}"]');
@@ -15905,7 +15905,7 @@ else {
15905
15905
  events.forEach(e => island.addEventListener(e, handler, { once: true, passive: true }));
15906
15906
  })();
15907
15907
  </script>
15908
- `}function BL(X,$){let Z=$.event||"stx:activate";return`
15908
+ `}function HL(X,$){let Z=$.event||"stx:activate";return`
15909
15909
  <script data-hydrate="${X}">
15910
15910
  (function() {
15911
15911
  const island = document.querySelector('[data-island="${X}"]');
@@ -15926,9 +15926,9 @@ else {
15926
15926
  });
15927
15927
  })();
15928
15928
  </script>
15929
- `}function mq(X,$={},Z){let Y=X,J=!1,G=/@client:(load|idle|visible|media|only|hover|event)/i.test(X);if(Y=p5(Y,"load",$),Y=p5(Y,"idle",$),Y=p5(Y,"visible",$),Y=p5(Y,"media",$),Y=_L(Y),Y=p5(Y,"hover",$),Y=p5(Y,"event",$),J=G&&Y!==X,J)Y+=`
15929
+ `}function mq(X,$={},Z){let Y=X,J=!1,G=/@client:(load|idle|visible|media|only|hover|event)/i.test(X);if(Y=p5(Y,"load",$),Y=p5(Y,"idle",$),Y=p5(Y,"visible",$),Y=p5(Y,"media",$),Y=OL(Y),Y=p5(Y,"hover",$),Y=p5(Y,"event",$),J=G&&Y!==X,J)Y+=`
15930
15930
  `+gq();return Y}function p5(X,$,Z){let Y=new RegExp(`@client:${$}(?:\\s*\\(([^)]*)\\))?\\s*([\\s\\S]*?)@endclient`,"gi");return X.replace(Y,(J,G,Q)=>{let q={strategy:$};if(G)try{let _=G.split(",").map((H)=>H.trim());for(let H of _){let[L,O]=H.split(":").map((F)=>F.trim());if(L&&O){let F=O.replace(/^['"]|['"]$/g,"");q[L]=F}}}catch{}let K=`island-${Math.random().toString(36).substring(2,9)}`,U=hq(Q.trim()),W=uq(Q.trim(),Z),w=[];if(q.rootMargin)w.push(`data-root-margin="${q.rootMargin}"`);if(q.threshold!==void 0)w.push(`data-threshold="${q.threshold}"`);if(q.media)w.push(`data-media="${q.media}"`);if(q.event)w.push(`data-event="${q.event}"`);if(U)w.push(`data-component="${U}"`);let B=Object.keys(W).length>0?`
15931
- <script type="application/json" data-island-props="${K}">${JSON.stringify(W)}</script>`:"",j="";switch($){case"load":j=UL(K);break;case"idle":j=WL(K,q);break;case"visible":j=wL(K,q);break;case"media":j=zL(K,q);break;case"hover":j=jL(K);break;case"event":j=BL(K,q);break}return`
15931
+ <script type="application/json" data-island-props="${K}">${JSON.stringify(W)}</script>`:"",j="";switch($){case"load":j=wL(K);break;case"idle":j=zL(K,q);break;case"visible":j=jL(K,q);break;case"media":j=BL(K,q);break;case"hover":j=_L(K);break;case"event":j=HL(K,q);break}return`
15932
15932
  <div data-island="${K}"
15933
15933
  data-strategy="${$}"
15934
15934
  ${w.join(`
@@ -15938,7 +15938,7 @@ else {
15938
15938
  ${Q.trim()}${B}
15939
15939
  </div>
15940
15940
  ${j}
15941
- `})}function _L(X){let $=/@client:only\s*([\s\S]*?)@endclient/gi;return X.replace($,(Z,Y)=>{let J=`island-only-${Math.random().toString(36).substring(2,9)}`;return`
15941
+ `})}function OL(X){let $=/@client:only\s*([\s\S]*?)@endclient/gi;return X.replace($,(Z,Y)=>{let J=`island-only-${Math.random().toString(36).substring(2,9)}`;return`
15942
15942
  <div data-island="${J}"
15943
15943
  data-strategy="only"
15944
15944
  class="stx-island stx-client-only">
@@ -16002,7 +16002,7 @@ else {
16002
16002
  <script type="application/json" id="stx-island-manifest">
16003
16003
  ${JSON.stringify($)}
16004
16004
  </script>
16005
- `}var HL;var tq=E(()=>{HL={processPartialHydrationDirectives:mq,processStaticDirectives:oq,generatePartialHydrationCSS:lq,generateIslandManifest:sq,createIslandRegistry:dq,hydrateIsland:cq,hydrateByStrategy:pq,hydrateAll:iq,isHydrated:nq,onHydrated:rq}});var UK={};n(UK,{watchMultiple:()=>YK,watchEffect:()=>JK,watch:()=>ZK,unref:()=>eq,toRefs:()=>XK,throttledComputed:()=>KK,stxWatchMultiple:()=>YK,stxWatchEffect:()=>JK,stxWatch:()=>ZK,stxUnref:()=>eq,stxToRefs:()=>XK,stxThrottledComputed:()=>KK,stxShallowRef:()=>$K,stxRef:()=>i5,stxIsRef:()=>v1,stxDebouncedComputed:()=>qK,stxComputed:()=>r7,shallowRef:()=>$K,ref:()=>i5,processWatchDirectives:()=>QK,processComputedDirectives:()=>GK,isRef:()=>v1,default:()=>OL,debouncedComputed:()=>qK,computed:()=>r7});function i5(X){let $=X,Z=new Set,Y={get value(){if(G1){let J=n7.get(Y);if(!J)J=new Set,n7.set(Y,J);J.add(G1)}return $},set value(J){if(!Object.is($,J)){$=J,Z.forEach((Q)=>Q(J));let G=n7.get(Y);if(G)G.forEach((Q)=>Q())}},subscribe(J){return Z.add(J),()=>Z.delete(J)},peek(){return $}};return Y}function v1(X){return X!==null&&typeof X==="object"&&"value"in X&&"subscribe"in X&&"peek"in X}function eq(X){return v1(X)?X.value:X}function XK(X){let $={};for(let Z in X)if(Object.prototype.hasOwnProperty.call(X,Z))$[Z]=i5(X[Z]);return $}function $K(X){return i5(X)}function r7(X){let $=typeof X==="function",Z=$?X:X.get,Y=$?void 0:X.set,J=$?Object.is:X.equals||Object.is,G,Q=!0,q=new Set,K=new Set,U=()=>{if(Q=!0,K.size>0){let z=w.value;K.forEach((B)=>B(z))}};function W(){q.clear();let z=G1;G1=U,G$.push(U);try{return Z()}finally{G$.pop(),G1=z}}let w={get value(){if(G1){let z=n7.get(w);if(!z)z=new Set,n7.set(w,z);z.add(G1)}if(Q){let z=W();if(!J(G,z))G=z;Q=!1}return G},set value(z){if(Y)Y(z);else console.warn("Computed property is readonly")},subscribe(z){return K.add(z),()=>K.delete(z)},peek(){if(Q)G=Z(),Q=!1;return G},invalidate(){Q=!0},get dirty(){return Q},get deps(){return q}};return w}function ZK(X,$,Z={}){let{immediate:Y=!1,deep:J=!1,flush:G="pre",once:Q=!1}=Z,q,K=!0,U=!1,W=()=>{if(v1(X))return J?q5(X.value):X.value;return X()},w=()=>{if(!K||U)return;let j=W();if(q!==void 0&&Object.is(q,j)&&!J)return;let _=()=>{if($(j,q),q=J?q5(j):j,Q)B()};if(G==="sync")_();else if(G==="post")queueMicrotask(_);else Promise.resolve().then(_)},z=null;if(v1(X))z=X.subscribe(()=>w());else z=r7(X).subscribe(()=>w());if(Y)q=void 0,w();else q=W();let B=()=>{if(K=!1,z)z(),z=null};return B.pause=()=>{U=!0},B.resume=()=>{U=!1},B}function YK(X,$,Z={}){let{immediate:Y=!1,once:J=!1}=Z,G=X.map((w)=>v1(w)?w.value:void 0),Q=!0,q=!1,K=()=>{if(!Q||q)return;let w=X.map((z)=>v1(z)?z.value:void 0);if($(w,G),G=[...w],J)W()},U=X.map((w)=>{if(v1(w))return w.subscribe(()=>K());return()=>{}});if(Y)K();let W=()=>{Q=!1,U.forEach((w)=>w())};return W.pause=()=>{q=!0},W.resume=()=>{q=!1},W}function JK(X,$={}){let{flush:Z="pre"}=$,Y,J=!0,G=!1,Q=()=>{if(!J||G)return;if(Y)Y();let K=G1;G1=Q,G$.push(Q);try{Y=X()}finally{G$.pop(),G1=K}};if(Z==="sync")Q();else if(Z==="post")queueMicrotask(Q);else Promise.resolve().then(Q);let q=()=>{if(J=!1,Y)Y()};return q.pause=()=>{G=!0},q.resume=()=>{G=!1},q}function GK(X,$={},Z){let Y=/@computed\s*\(\s*(\w+)\s*,\s*(.+?)\s*\)/gi;return X.replace(Y,(J,G,Q)=>{try{let K=Function(...Object.keys($),`return ${Q}`)(...Object.values($));return $[G]=K,`<!-- computed: ${G} = ${K} -->`}catch(q){return`<!-- computed error: ${G} - ${q} -->`}})}function QK(X,$={},Z){let Y=/@watch\s*\(\s*(\w+)\s*\)\s*([\s\S]*?)@endwatch/gi;return X.replace(Y,(J,G,Q)=>{return`
16005
+ `}var LL;var tq=E(()=>{LL={processPartialHydrationDirectives:mq,processStaticDirectives:oq,generatePartialHydrationCSS:lq,generateIslandManifest:sq,createIslandRegistry:dq,hydrateIsland:cq,hydrateByStrategy:pq,hydrateAll:iq,isHydrated:nq,onHydrated:rq}});var UK={};n(UK,{watchMultiple:()=>YK,watchEffect:()=>JK,watch:()=>ZK,unref:()=>eq,toRefs:()=>XK,throttledComputed:()=>KK,stxWatchMultiple:()=>YK,stxWatchEffect:()=>JK,stxWatch:()=>ZK,stxUnref:()=>eq,stxToRefs:()=>XK,stxThrottledComputed:()=>KK,stxShallowRef:()=>$K,stxRef:()=>i5,stxIsRef:()=>v1,stxDebouncedComputed:()=>qK,stxComputed:()=>r7,shallowRef:()=>$K,ref:()=>i5,processWatchDirectives:()=>QK,processComputedDirectives:()=>GK,isRef:()=>v1,default:()=>FL,debouncedComputed:()=>qK,computed:()=>r7});function i5(X){let $=X,Z=new Set,Y={get value(){if(G1){let J=n7.get(Y);if(!J)J=new Set,n7.set(Y,J);J.add(G1)}return $},set value(J){if(!Object.is($,J)){$=J,Z.forEach((Q)=>Q(J));let G=n7.get(Y);if(G)G.forEach((Q)=>Q())}},subscribe(J){return Z.add(J),()=>Z.delete(J)},peek(){return $}};return Y}function v1(X){return X!==null&&typeof X==="object"&&"value"in X&&"subscribe"in X&&"peek"in X}function eq(X){return v1(X)?X.value:X}function XK(X){let $={};for(let Z in X)if(Object.prototype.hasOwnProperty.call(X,Z))$[Z]=i5(X[Z]);return $}function $K(X){return i5(X)}function r7(X){let $=typeof X==="function",Z=$?X:X.get,Y=$?void 0:X.set,J=$?Object.is:X.equals||Object.is,G,Q=!0,q=new Set,K=new Set,U=()=>{if(Q=!0,K.size>0){let z=w.value;K.forEach((B)=>B(z))}};function W(){q.clear();let z=G1;G1=U,G$.push(U);try{return Z()}finally{G$.pop(),G1=z}}let w={get value(){if(G1){let z=n7.get(w);if(!z)z=new Set,n7.set(w,z);z.add(G1)}if(Q){let z=W();if(!J(G,z))G=z;Q=!1}return G},set value(z){if(Y)Y(z);else console.warn("Computed property is readonly")},subscribe(z){return K.add(z),()=>K.delete(z)},peek(){if(Q)G=Z(),Q=!1;return G},invalidate(){Q=!0},get dirty(){return Q},get deps(){return q}};return w}function ZK(X,$,Z={}){let{immediate:Y=!1,deep:J=!1,flush:G="pre",once:Q=!1}=Z,q,K=!0,U=!1,W=()=>{if(v1(X))return J?q5(X.value):X.value;return X()},w=()=>{if(!K||U)return;let j=W();if(q!==void 0&&Object.is(q,j)&&!J)return;let _=()=>{if($(j,q),q=J?q5(j):j,Q)B()};if(G==="sync")_();else if(G==="post")queueMicrotask(_);else Promise.resolve().then(_)},z=null;if(v1(X))z=X.subscribe(()=>w());else z=r7(X).subscribe(()=>w());if(Y)q=void 0,w();else q=W();let B=()=>{if(K=!1,z)z(),z=null};return B.pause=()=>{U=!0},B.resume=()=>{U=!1},B}function YK(X,$,Z={}){let{immediate:Y=!1,once:J=!1}=Z,G=X.map((w)=>v1(w)?w.value:void 0),Q=!0,q=!1,K=()=>{if(!Q||q)return;let w=X.map((z)=>v1(z)?z.value:void 0);if($(w,G),G=[...w],J)W()},U=X.map((w)=>{if(v1(w))return w.subscribe(()=>K());return()=>{}});if(Y)K();let W=()=>{Q=!1,U.forEach((w)=>w())};return W.pause=()=>{q=!0},W.resume=()=>{q=!1},W}function JK(X,$={}){let{flush:Z="pre"}=$,Y,J=!0,G=!1,Q=()=>{if(!J||G)return;if(Y)Y();let K=G1;G1=Q,G$.push(Q);try{Y=X()}finally{G$.pop(),G1=K}};if(Z==="sync")Q();else if(Z==="post")queueMicrotask(Q);else Promise.resolve().then(Q);let q=()=>{if(J=!1,Y)Y()};return q.pause=()=>{G=!0},q.resume=()=>{G=!1},q}function GK(X,$={},Z){let Y=/@computed\s*\(\s*(\w+)\s*,\s*(.+?)\s*\)/gi;return X.replace(Y,(J,G,Q)=>{try{let K=Function(...Object.keys($),`return ${Q}`)(...Object.values($));return $[G]=K,`<!-- computed: ${G} = ${K} -->`}catch(q){return`<!-- computed error: ${G} - ${q} -->`}})}function QK(X,$={},Z){let Y=/@watch\s*\(\s*(\w+)\s*\)\s*([\s\S]*?)@endwatch/gi;return X.replace(Y,(J,G,Q)=>{return`
16006
16006
  <script data-watch="${`watch-${Math.random().toString(36).substring(2,9)}`}">
16007
16007
  (function() {
16008
16008
  // Watch implementation for ${G}
@@ -16014,9 +16014,9 @@ else {
16014
16014
  }
16015
16015
  })();
16016
16016
  </script>
16017
- `})}function q5(X){if(X===null||typeof X!=="object")return X;if(Array.isArray(X))return X.map((Z)=>q5(Z));if(X instanceof Date)return new Date(X.getTime());if(X instanceof Map){let Z=new Map;return X.forEach((Y,J)=>Z.set(q5(J),q5(Y))),Z}if(X instanceof Set){let Z=new Set;return X.forEach((Y)=>Z.add(q5(Y))),Z}let $={};for(let Z in X)if(Object.prototype.hasOwnProperty.call(X,Z))$[Z]=q5(X[Z]);return $}function qK(X,$=100){let Z=i5(X()),Y=null,J=()=>{if(Y)clearTimeout(Y);Y=setTimeout(()=>{Z.value=X()},$)};return r7(X).subscribe(()=>J()),{get value(){return Z.value},set value(Q){console.warn("Debounced computed is readonly")},subscribe:Z.subscribe,peek:Z.peek,invalidate(){J()},get dirty(){return!1},get deps(){return new Set}}}function KK(X,$=100){let Z=i5(X()),Y=0,J=()=>{let Q=Date.now();if(Q-Y>=$)Y=Q,Z.value=X()};return r7(X).subscribe(()=>J()),{get value(){return Z.value},set value(Q){console.warn("Throttled computed is readonly")},subscribe:Z.subscribe,peek:Z.peek,invalidate(){J()},get dirty(){return!1},get deps(){return new Set}}}var G1=null,G$,n7,OL;var WK=E(()=>{G$=[],n7=new WeakMap;OL={ref:i5,computed:r7,watch:ZK,watchMultiple:YK,watchEffect:JK,isRef:v1,unref:eq,toRefs:XK,shallowRef:$K,debouncedComputed:qK,throttledComputed:KK,processComputedDirectives:GK,processWatchDirectives:QK}});function o7(X,$){let Z={};for(let Y of X)Z[Y]=E1($(Y));return new Proxy({},{get:(Y,J)=>Z[J]?.(),set:(Y,J,G)=>{if(Z[J])Z[J].set(G);else Z[J]=E1(G);return!0},has:(Y,J)=>(J in Z),deleteProperty:(Y,J)=>{return delete Z[J],!0},ownKeys:()=>Reflect.ownKeys(Z),getOwnPropertyDescriptor:(Y,J)=>(J in Z)?{enumerable:!0,configurable:!0,writable:!0,value:Z[J]()}:void 0})}function LL(X,$){let Z={};for(let Y of $)Z[Y]=X[Y];return Z}function m4(X,$){let Z=Object.keys(X),Y=o7(Z,(O)=>$?.[O]??X[O].getDefaultValue()),J=o7(Z,()=>[]),G=o7(Z,()=>!1),Q=o7(Z,()=>!1),q=o7(Z,()=>!1),K=E1(!1);async function U(O){q[O]=!0;let F=await X[O].validate(Y[O],Y);return J[O]=F,q[O]=!1,F.length===0}async function W(){K.set(!0);let O=await Promise.all(Z.map(U));return K.set(!1),O.every(Boolean)}function w(){for(let O of Z)Y[O]=$?.[O]??X[O].getDefaultValue(),J[O]=[],G[O]=!1,Q[O]=!1}function z(O){for(let F of Z)if(F in O)Y[F]=O[F],Q[F]=!0}function B(O,F){Y[O]=F,Q[O]=!0}function j(O,F=!0){if(G[O]=F,F)U(O)}function _(O){return{value:Y[O],errors:J[O],touched:G[O],dirty:Q[O],valid:J[O].length===0,validating:q[O]}}function H(O){return async(F)=>{F?.preventDefault?.();for(let A of Z)G[A]=!0;if(await W())await O(LL(Y,Z))}}return{values:Y,errors:J,touched:G,dirty:Q,get isValid(){return Z.every((O)=>J[O].length===0)},get isValidating(){return K()||Z.some((O)=>q[O])},get isDirty(){return Z.some((O)=>Q[O])},validate:W,validateField:U,reset:w,setValues:z,setFieldValue:B,setFieldTouched:j,getFieldState:_,handleSubmit:H}}var wK;var zK=E(()=>{gX();wK=m4});var HK={};n(HK,{v:()=>FL,useForm:()=>m4,processHasErrorsDirective:()=>_K,processFormValidationDirectives:()=>VL,processErrorsDirective:()=>BK,processErrorDirective:()=>jK,defineForm:()=>wK,Validator:()=>n5});class n5{rules=[];defaultValue="";addRule(X){let $=new n5;return $.rules=[...this.rules,X],$.defaultValue=this.defaultValue,$}required(X="This field is required"){return this.addRule({name:"required",message:X,validate:($)=>{if($===null||$===void 0)return X;if(typeof $==="string"&&$.trim()==="")return X;if(Array.isArray($)&&$.length===0)return X;return!0}})}email(X="Please enter a valid email"){return this.addRule({name:"email",message:X,validate:($)=>{if(!$)return!0;return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String($))||X}})}url(X="Please enter a valid URL"){return this.addRule({name:"url",message:X,validate:($)=>{if(!$)return!0;try{return new URL(String($)),!0}catch{return X}}})}min(X,$){let Z=$||`Must be at least ${X} characters`;return this.addRule({name:"min",message:Z,validate:(Y)=>{if(!Y)return!0;return String(Y).length>=X||Z}})}max(X,$){let Z=$||`Must be no more than ${X} characters`;return this.addRule({name:"max",message:Z,validate:(Y)=>{if(!Y)return!0;return String(Y).length<=X||Z}})}length(X,$,Z){let Y=Z||`Must be between ${X} and ${$} characters`;return this.addRule({name:"length",message:Y,validate:(J)=>{if(!J)return!0;let G=String(J).length;return G>=X&&G<=$||Y}})}pattern(X,$="Invalid format"){return this.addRule({name:"pattern",message:$,validate:(Z)=>{if(!Z)return!0;return X.test(String(Z))||$}})}hasUppercase(X="Must contain an uppercase letter"){return this.pattern(/[A-Z]/,X)}hasLowercase(X="Must contain a lowercase letter"){return this.pattern(/[a-z]/,X)}hasNumber(X="Must contain a number"){return this.pattern(/\d/,X)}hasSpecial(X="Must contain a special character"){return this.pattern(/[!@#$%^&*(),.?":{}|<>]/,X)}alphanumeric(X="Only letters and numbers allowed"){return this.pattern(/^[a-zA-Z0-9]+$/,X)}startsWithLetter(X="Must start with a letter"){return this.pattern(/^[a-zA-Z]/,X)}noSpaces(X="Spaces are not allowed"){return this.addRule({name:"noSpaces",message:X,validate:($)=>{if(!$)return!0;return!String($).includes(" ")||X}})}number(X="Must be a number"){let $=this.addRule({name:"number",message:X,validate:(Z)=>{if(!Z&&Z!==0)return!0;return!Number.isNaN(Number(Z))||X}});return $.defaultValue=0,$}integer(X="Must be a whole number"){return this.addRule({name:"integer",message:X,validate:($)=>{if(!$&&$!==0)return!0;return Number.isInteger(Number($))||X}})}positive(X="Must be a positive number"){return this.addRule({name:"positive",message:X,validate:($)=>{if(!$&&$!==0)return!0;return Number($)>0||X}})}negative(X="Must be a negative number"){return this.addRule({name:"negative",message:X,validate:($)=>{if(!$&&$!==0)return!0;return Number($)<0||X}})}minValue(X,$){let Z=$||`Must be at least ${X}`;return this.addRule({name:"minValue",message:Z,validate:(Y)=>{if(!Y&&Y!==0)return!0;return Number(Y)>=X||Z}})}maxValue(X,$){let Z=$||`Must be no more than ${X}`;return this.addRule({name:"maxValue",message:Z,validate:(Y)=>{if(!Y&&Y!==0)return!0;return Number(Y)<=X||Z}})}between(X,$,Z){let Y=Z||`Must be between ${X} and ${$}`;return this.addRule({name:"between",message:Y,validate:(J)=>{if(!J&&J!==0)return!0;let G=Number(J);return G>=X&&G<=$||Y}})}matches(X,$){let Z=$||`Must match ${X}`;return this.addRule({name:"matches",message:Z,validate:(Y,J)=>{if(!J)return!0;return Y===J[X]||Z}})}oneOf(X,$){let Z=$||`Must be one of: ${X.join(", ")}`;return this.addRule({name:"oneOf",message:Z,validate:(Y)=>{if(!Y)return!0;return X.includes(Y)||Z}})}notOneOf(X,$){let Z=$||`Cannot be one of: ${X.join(", ")}`;return this.addRule({name:"notOneOf",message:Z,validate:(Y)=>{if(!Y)return!0;return!X.includes(Y)||Z}})}date(X="Must be a valid date"){return this.addRule({name:"date",message:X,validate:($)=>{if(!$)return!0;let Z=new Date(String($));return!Number.isNaN(Z.getTime())||X}})}before(X,$){let Z=new Date(X),Y=$||`Must be before ${Z.toLocaleDateString()}`;return this.addRule({name:"before",message:Y,validate:(J)=>{if(!J)return!0;return new Date(String(J))<Z||Y}})}after(X,$){let Z=new Date(X),Y=$||`Must be after ${Z.toLocaleDateString()}`;return this.addRule({name:"after",message:Y,validate:(J)=>{if(!J)return!0;return new Date(String(J))>Z||Y}})}custom(X,$="Invalid value"){return this.addRule({name:"custom",message:$,validate:X})}async(X,$="Invalid value"){return this.addRule({name:"async",message:$,async:!0,validate:X})}when(X,$){let Z=new n5;Z.rules=[...this.rules],Z.defaultValue=this.defaultValue;for(let Y of $.getRules())Z.rules.push({...Y,validate:(J,G)=>{if(!X(J,G||{}))return!0;return Y.validate(J,G)}});return Z}getRules(){return this.rules}getDefaultValue(){return this.defaultValue}default(X){let $=new n5;return $.rules=[...this.rules],$.defaultValue=X,$}async validate(X,$){let Z=[];for(let Y of this.rules){let J=await Y.validate(X,$);if(J!==!0)Z.push(J)}return Z}validateSync(X,$){let Z=[];for(let Y of this.rules){if(Y.async)continue;let J=Y.validate(X,$);if(J!==!0)Z.push(J)}return Z}}function jK(X,$,Z){let Y=/@error\s*\(\s*([^)]+)\s*\)([\s\S]*?)@enderror/g;return X.replace(Y,(J,G,Q)=>{try{let q=G.trim().split("."),K=$;for(let W of q)if(K&&typeof K==="object"&&W in K)K=K[W];else return"";let U=K;if(!U||!Array.isArray(U)||U.length===0)return"";return U.map((W)=>{return Q.replace(/\{\{\s*message\s*\}\}/g,W)}).join(`
16017
+ `})}function q5(X){if(X===null||typeof X!=="object")return X;if(Array.isArray(X))return X.map((Z)=>q5(Z));if(X instanceof Date)return new Date(X.getTime());if(X instanceof Map){let Z=new Map;return X.forEach((Y,J)=>Z.set(q5(J),q5(Y))),Z}if(X instanceof Set){let Z=new Set;return X.forEach((Y)=>Z.add(q5(Y))),Z}let $={};for(let Z in X)if(Object.prototype.hasOwnProperty.call(X,Z))$[Z]=q5(X[Z]);return $}function qK(X,$=100){let Z=i5(X()),Y=null,J=()=>{if(Y)clearTimeout(Y);Y=setTimeout(()=>{Z.value=X()},$)};return r7(X).subscribe(()=>J()),{get value(){return Z.value},set value(Q){console.warn("Debounced computed is readonly")},subscribe:Z.subscribe,peek:Z.peek,invalidate(){J()},get dirty(){return!1},get deps(){return new Set}}}function KK(X,$=100){let Z=i5(X()),Y=0,J=()=>{let Q=Date.now();if(Q-Y>=$)Y=Q,Z.value=X()};return r7(X).subscribe(()=>J()),{get value(){return Z.value},set value(Q){console.warn("Throttled computed is readonly")},subscribe:Z.subscribe,peek:Z.peek,invalidate(){J()},get dirty(){return!1},get deps(){return new Set}}}var G1=null,G$,n7,FL;var WK=E(()=>{G$=[],n7=new WeakMap;FL={ref:i5,computed:r7,watch:ZK,watchMultiple:YK,watchEffect:JK,isRef:v1,unref:eq,toRefs:XK,shallowRef:$K,debouncedComputed:qK,throttledComputed:KK,processComputedDirectives:GK,processWatchDirectives:QK}});function o7(X,$){let Z={};for(let Y of X)Z[Y]=E1($(Y));return new Proxy({},{get:(Y,J)=>Z[J]?.(),set:(Y,J,G)=>{if(Z[J])Z[J].set(G);else Z[J]=E1(G);return!0},has:(Y,J)=>(J in Z),deleteProperty:(Y,J)=>{return delete Z[J],!0},ownKeys:()=>Reflect.ownKeys(Z),getOwnPropertyDescriptor:(Y,J)=>(J in Z)?{enumerable:!0,configurable:!0,writable:!0,value:Z[J]()}:void 0})}function VL(X,$){let Z={};for(let Y of $)Z[Y]=X[Y];return Z}function m4(X,$){let Z=Object.keys(X),Y=o7(Z,(O)=>$?.[O]??X[O].getDefaultValue()),J=o7(Z,()=>[]),G=o7(Z,()=>!1),Q=o7(Z,()=>!1),q=o7(Z,()=>!1),K=E1(!1);async function U(O){q[O]=!0;let F=await X[O].validate(Y[O],Y);return J[O]=F,q[O]=!1,F.length===0}async function W(){K.set(!0);let O=await Promise.all(Z.map(U));return K.set(!1),O.every(Boolean)}function w(){for(let O of Z)Y[O]=$?.[O]??X[O].getDefaultValue(),J[O]=[],G[O]=!1,Q[O]=!1}function z(O){for(let F of Z)if(F in O)Y[F]=O[F],Q[F]=!0}function B(O,F){Y[O]=F,Q[O]=!0}function j(O,F=!0){if(G[O]=F,F)U(O)}function _(O){return{value:Y[O],errors:J[O],touched:G[O],dirty:Q[O],valid:J[O].length===0,validating:q[O]}}function H(O){return async(F)=>{F?.preventDefault?.();for(let A of Z)G[A]=!0;if(await W())await O(VL(Y,Z))}}return{values:Y,errors:J,touched:G,dirty:Q,get isValid(){return Z.every((O)=>J[O].length===0)},get isValidating(){return K()||Z.some((O)=>q[O])},get isDirty(){return Z.some((O)=>Q[O])},validate:W,validateField:U,reset:w,setValues:z,setFieldValue:B,setFieldTouched:j,getFieldState:_,handleSubmit:H}}var wK;var zK=E(()=>{gX();wK=m4});var HK={};n(HK,{v:()=>AL,useForm:()=>m4,processHasErrorsDirective:()=>_K,processFormValidationDirectives:()=>RL,processErrorsDirective:()=>BK,processErrorDirective:()=>jK,defineForm:()=>wK,Validator:()=>n5});class n5{rules=[];defaultValue="";addRule(X){let $=new n5;return $.rules=[...this.rules,X],$.defaultValue=this.defaultValue,$}required(X="This field is required"){return this.addRule({name:"required",message:X,validate:($)=>{if($===null||$===void 0)return X;if(typeof $==="string"&&$.trim()==="")return X;if(Array.isArray($)&&$.length===0)return X;return!0}})}email(X="Please enter a valid email"){return this.addRule({name:"email",message:X,validate:($)=>{if(!$)return!0;return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String($))||X}})}url(X="Please enter a valid URL"){return this.addRule({name:"url",message:X,validate:($)=>{if(!$)return!0;try{return new URL(String($)),!0}catch{return X}}})}min(X,$){let Z=$||`Must be at least ${X} characters`;return this.addRule({name:"min",message:Z,validate:(Y)=>{if(!Y)return!0;return String(Y).length>=X||Z}})}max(X,$){let Z=$||`Must be no more than ${X} characters`;return this.addRule({name:"max",message:Z,validate:(Y)=>{if(!Y)return!0;return String(Y).length<=X||Z}})}length(X,$,Z){let Y=Z||`Must be between ${X} and ${$} characters`;return this.addRule({name:"length",message:Y,validate:(J)=>{if(!J)return!0;let G=String(J).length;return G>=X&&G<=$||Y}})}pattern(X,$="Invalid format"){return this.addRule({name:"pattern",message:$,validate:(Z)=>{if(!Z)return!0;return X.test(String(Z))||$}})}hasUppercase(X="Must contain an uppercase letter"){return this.pattern(/[A-Z]/,X)}hasLowercase(X="Must contain a lowercase letter"){return this.pattern(/[a-z]/,X)}hasNumber(X="Must contain a number"){return this.pattern(/\d/,X)}hasSpecial(X="Must contain a special character"){return this.pattern(/[!@#$%^&*(),.?":{}|<>]/,X)}alphanumeric(X="Only letters and numbers allowed"){return this.pattern(/^[a-zA-Z0-9]+$/,X)}startsWithLetter(X="Must start with a letter"){return this.pattern(/^[a-zA-Z]/,X)}noSpaces(X="Spaces are not allowed"){return this.addRule({name:"noSpaces",message:X,validate:($)=>{if(!$)return!0;return!String($).includes(" ")||X}})}number(X="Must be a number"){let $=this.addRule({name:"number",message:X,validate:(Z)=>{if(!Z&&Z!==0)return!0;return!Number.isNaN(Number(Z))||X}});return $.defaultValue=0,$}integer(X="Must be a whole number"){return this.addRule({name:"integer",message:X,validate:($)=>{if(!$&&$!==0)return!0;return Number.isInteger(Number($))||X}})}positive(X="Must be a positive number"){return this.addRule({name:"positive",message:X,validate:($)=>{if(!$&&$!==0)return!0;return Number($)>0||X}})}negative(X="Must be a negative number"){return this.addRule({name:"negative",message:X,validate:($)=>{if(!$&&$!==0)return!0;return Number($)<0||X}})}minValue(X,$){let Z=$||`Must be at least ${X}`;return this.addRule({name:"minValue",message:Z,validate:(Y)=>{if(!Y&&Y!==0)return!0;return Number(Y)>=X||Z}})}maxValue(X,$){let Z=$||`Must be no more than ${X}`;return this.addRule({name:"maxValue",message:Z,validate:(Y)=>{if(!Y&&Y!==0)return!0;return Number(Y)<=X||Z}})}between(X,$,Z){let Y=Z||`Must be between ${X} and ${$}`;return this.addRule({name:"between",message:Y,validate:(J)=>{if(!J&&J!==0)return!0;let G=Number(J);return G>=X&&G<=$||Y}})}matches(X,$){let Z=$||`Must match ${X}`;return this.addRule({name:"matches",message:Z,validate:(Y,J)=>{if(!J)return!0;return Y===J[X]||Z}})}oneOf(X,$){let Z=$||`Must be one of: ${X.join(", ")}`;return this.addRule({name:"oneOf",message:Z,validate:(Y)=>{if(!Y)return!0;return X.includes(Y)||Z}})}notOneOf(X,$){let Z=$||`Cannot be one of: ${X.join(", ")}`;return this.addRule({name:"notOneOf",message:Z,validate:(Y)=>{if(!Y)return!0;return!X.includes(Y)||Z}})}date(X="Must be a valid date"){return this.addRule({name:"date",message:X,validate:($)=>{if(!$)return!0;let Z=new Date(String($));return!Number.isNaN(Z.getTime())||X}})}before(X,$){let Z=new Date(X),Y=$||`Must be before ${Z.toLocaleDateString()}`;return this.addRule({name:"before",message:Y,validate:(J)=>{if(!J)return!0;return new Date(String(J))<Z||Y}})}after(X,$){let Z=new Date(X),Y=$||`Must be after ${Z.toLocaleDateString()}`;return this.addRule({name:"after",message:Y,validate:(J)=>{if(!J)return!0;return new Date(String(J))>Z||Y}})}custom(X,$="Invalid value"){return this.addRule({name:"custom",message:$,validate:X})}async(X,$="Invalid value"){return this.addRule({name:"async",message:$,async:!0,validate:X})}when(X,$){let Z=new n5;Z.rules=[...this.rules],Z.defaultValue=this.defaultValue;for(let Y of $.getRules())Z.rules.push({...Y,validate:(J,G)=>{if(!X(J,G||{}))return!0;return Y.validate(J,G)}});return Z}getRules(){return this.rules}getDefaultValue(){return this.defaultValue}default(X){let $=new n5;return $.rules=[...this.rules],$.defaultValue=X,$}async validate(X,$){let Z=[];for(let Y of this.rules){let J=await Y.validate(X,$);if(J!==!0)Z.push(J)}return Z}validateSync(X,$){let Z=[];for(let Y of this.rules){if(Y.async)continue;let J=Y.validate(X,$);if(J!==!0)Z.push(J)}return Z}}function jK(X,$,Z){let Y=/@error\s*\(\s*([^)]+)\s*\)([\s\S]*?)@enderror/g;return X.replace(Y,(J,G,Q)=>{try{let q=G.trim().split("."),K=$;for(let W of q)if(K&&typeof K==="object"&&W in K)K=K[W];else return"";let U=K;if(!U||!Array.isArray(U)||U.length===0)return"";return U.map((W)=>{return Q.replace(/\{\{\s*message\s*\}\}/g,W)}).join(`
16018
16018
  `)}catch{return""}})}function BK(X,$,Z){let Y=/@errors\s*\(\s*([^)]+)\s*\)([\s\S]*?)@enderrors/g;return X.replace(Y,(J,G,Q)=>{try{let q=G.trim().split("."),K=$;for(let W of q)if(K&&typeof K==="object"&&W in K)K=K[W];else return"";let U=K;if(!U||!Array.isArray(U)||U.length===0)return"";return U.map((W)=>Q.replace(/\{\{\s*message\s*\}\}/g,W)).join(`
16019
- `)}catch{return""}})}function _K(X,$,Z){let Y=/@hasErrors\s*\(\s*([^)]+)\s*\)([\s\S]*?)@endhasErrors/g;return X.replace(Y,(J,G,Q)=>{try{let q=G.trim().split("."),K=$;for(let W of q)if(K&&typeof K==="object"&&W in K)K=K[W];else return"";let U=K;if(!U||!Array.isArray(U)||U.length===0)return"";return Q}catch{return""}})}function VL(X,$,Z){let Y=X;return Y=jK(Y,$,Z),Y=BK(Y,$,Z),Y=_K(Y,$,Z),Y}var FL;var OK=E(()=>{zK();FL=new n5});var VK={};n(VK,{processXElementDirectives:()=>AL,hasXElementDirectives:()=>FK,generateXElementRuntime:()=>LK});function LK(){return`<script data-stx-scoped data-stx-x-element-runtime data-stx-run="always">
16019
+ `)}catch{return""}})}function _K(X,$,Z){let Y=/@hasErrors\s*\(\s*([^)]+)\s*\)([\s\S]*?)@endhasErrors/g;return X.replace(Y,(J,G,Q)=>{try{let q=G.trim().split("."),K=$;for(let W of q)if(K&&typeof K==="object"&&W in K)K=K[W];else return"";let U=K;if(!U||!Array.isArray(U)||U.length===0)return"";return Q}catch{return""}})}function RL(X,$,Z){let Y=X;return Y=jK(Y,$,Z),Y=BK(Y,$,Z),Y=_K(Y,$,Z),Y}var AL;var OK=E(()=>{zK();AL=new n5});var VK={};n(VK,{processXElementDirectives:()=>NL,hasXElementDirectives:()=>FK,generateXElementRuntime:()=>LK});function LK(){return`<script data-stx-scoped data-stx-x-element-runtime data-stx-run="always">
16020
16020
  (function() {
16021
16021
  'use strict';
16022
16022
 
@@ -16300,27 +16300,27 @@ else {
16300
16300
  // Expose for manual initialization
16301
16301
  window.XElement = XElement;
16302
16302
  })();
16303
- </script>`}function FK(X){return/\bx-data(?:\s|=)/.test(X)}function AL(X){let $=/<script\b(?=[^>]*\bdata-stx-x-element-runtime\b)[^>]*>[\s\S]*?<\/script>\s*/gi,Z=X.match($)||[],Y=Z.length>0?X.replace($,""):X;if(!FK(Y))return Y;let J=Z[0]?.trim()||LK(),G=Y.lastIndexOf("</body>");if(G!==-1)return Y.slice(0,G)+J+`
16303
+ </script>`}function FK(X){return/\bx-data(?:\s|=)/.test(X)}function NL(X){let $=/<script\b(?=[^>]*\bdata-stx-x-element-runtime\b)[^>]*>[\s\S]*?<\/script>\s*/gi,Z=X.match($)||[],Y=Z.length>0?X.replace($,""):X;if(!FK(Y))return Y;let J=Z[0]?.trim()||LK(),G=Y.lastIndexOf("</body>");if(G!==-1)return Y.slice(0,G)+J+`
16304
16304
  `+Y.slice(G);return Y+`
16305
- `+J}var AK={};n(AK,{rewriteImagesWithSiblings:()=>TL});import B1 from"path";async function TL(X,$){let Z=$.formats??NL;if(!$.publicDir)return X;let Y=IL(X),J=[],G=/<img\b[^>]*?>/gi,Q=[],q;while((q=G.exec(X))!==null){let w=q[0],z=w.match(/\bsrc=["']([^"']+)["']/i);if(!z)continue;if(EL(q.index,Y))continue;Q.push({idx:q.index,length:w.length,src:z[1],raw:w})}if(Q.length===0)return X;let K=await Promise.all(Q.map(async(w)=>{let z=await ML(w.src,$.publicDir,Z);return{match:w,sources:z}}));for(let{match:w,sources:z}of K){if(z.length===0)continue;let j=`<picture>${z.map((_)=>`<source type="${_.mime}" srcset="${DL(_.url)}">`).join("")}${w.raw}</picture>`;J.push({start:w.idx,end:w.idx+w.length,replacement:j})}if(J.length===0)return X;let U="",W=0;for(let w of J)U+=X.slice(W,w.start),U+=w.replacement,W=w.end;return U+=X.slice(W),U}async function ML(X,$,Z){if(!kL(X))return[];let Y=B1.extname(X).toLowerCase();if(!RL.has(Y))return[];if(!X.startsWith("/"))return[];let J=B1.join($,X.slice(1)),G=B1.dirname(J),Q=B1.basename(J,Y),q=B1.resolve(G),K=B1.resolve($);if(!q.startsWith(K))return[];let U=B1.posix.dirname(X),W=Z.map(async(z)=>{let B=B1.join(G,`${Q}${z.ext}`);if(!await Bun.file(B).exists())return null;return{url:B1.posix.join(U,`${Q}${z.ext}`),mime:z.mime}});return(await Promise.all(W)).filter((z)=>z!==null)}function kL(X){if(!X)return!1;if(X.startsWith("http://")||X.startsWith("https://"))return!1;if(X.startsWith("//"))return!1;if(X.startsWith("data:"))return!1;return!0}function IL(X){let $=[],Z=/<picture\b[^>]*>[\s\S]*?<\/picture>/gi,Y;while((Y=Z.exec(X))!==null)$.push([Y.index,Y.index+Y[0].length]);return $}function EL(X,$){for(let[Z,Y]of $)if(X>=Z&&X<Y)return!0;return!1}function DL(X){return X.replace(/&/g,"&amp;").replace(/"/g,"&quot;")}var RL,NL;var RK=E(()=>{RL=new Set([".jpg",".jpeg",".png",".gif"]),NL=[{ext:".avif",mime:"image/avif"},{ext:".webp",mime:"image/webp"}]});var kK={};n(kK,{validateClientScript:()=>X$,processOnceDirective:()=>e8,processJsonDirective:()=>t8,processDirectives:()=>R0,injectRouterScript:()=>oZ});import yL from"fs";import E0 from"path";function NK(X){return X.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function bL(X,$){let Z=X.length,Y=$,J=!0,G=[],Q=(q)=>q+9<=Z&&X[q]==="<"&&X[q+1]==="/"&&(X[q+2]==="s"||X[q+2]==="S")&&(X[q+3]==="c"||X[q+3]==="C")&&(X[q+4]==="r"||X[q+4]==="R")&&(X[q+5]==="i"||X[q+5]==="I")&&(X[q+6]==="p"||X[q+6]==="P")&&(X[q+7]==="t"||X[q+7]==="T")&&(X[q+8]===">"||/\s/.test(X[q+8]));while(Y<Z){let q=X[Y];if(Q(Y))return Y;if(q==="/"&&X[Y+1]==="/"){if(Y=X.indexOf(`
16305
+ `+J}var AK={};n(AK,{rewriteImagesWithSiblings:()=>kL});import B1 from"path";async function kL(X,$){let Z=$.formats??ML;if(!$.publicDir)return X;let Y=DL(X),J=[],G=/<img\b[^>]*?>/gi,Q=[],q;while((q=G.exec(X))!==null){let w=q[0],z=w.match(/\bsrc=["']([^"']+)["']/i);if(!z)continue;if(yL(q.index,Y))continue;Q.push({idx:q.index,length:w.length,src:z[1],raw:w})}if(Q.length===0)return X;let K=await Promise.all(Q.map(async(w)=>{let z=await IL(w.src,$.publicDir,Z);return{match:w,sources:z}}));for(let{match:w,sources:z}of K){if(z.length===0)continue;let j=`<picture>${z.map((_)=>`<source type="${_.mime}" srcset="${bL(_.url)}">`).join("")}${w.raw}</picture>`;J.push({start:w.idx,end:w.idx+w.length,replacement:j})}if(J.length===0)return X;let U="",W=0;for(let w of J)U+=X.slice(W,w.start),U+=w.replacement,W=w.end;return U+=X.slice(W),U}async function IL(X,$,Z){if(!EL(X))return[];let Y=B1.extname(X).toLowerCase();if(!TL.has(Y))return[];if(!X.startsWith("/"))return[];let J=B1.join($,X.slice(1)),G=B1.dirname(J),Q=B1.basename(J,Y),q=B1.resolve(G),K=B1.resolve($);if(!q.startsWith(K))return[];let U=B1.posix.dirname(X),W=Z.map(async(z)=>{let B=B1.join(G,`${Q}${z.ext}`);if(!await Bun.file(B).exists())return null;return{url:B1.posix.join(U,`${Q}${z.ext}`),mime:z.mime}});return(await Promise.all(W)).filter((z)=>z!==null)}function EL(X){if(!X)return!1;if(X.startsWith("http://")||X.startsWith("https://"))return!1;if(X.startsWith("//"))return!1;if(X.startsWith("data:"))return!1;return!0}function DL(X){let $=[],Z=/<picture\b[^>]*>[\s\S]*?<\/picture>/gi,Y;while((Y=Z.exec(X))!==null)$.push([Y.index,Y.index+Y[0].length]);return $}function yL(X,$){for(let[Z,Y]of $)if(X>=Z&&X<Y)return!0;return!1}function bL(X){return X.replace(/&/g,"&amp;").replace(/"/g,"&quot;")}var TL,ML;var RK=E(()=>{TL=new Set([".jpg",".jpeg",".png",".gif"]),ML=[{ext:".avif",mime:"image/avif"},{ext:".webp",mime:"image/webp"}]});var kK={};n(kK,{validateClientScript:()=>X$,processOnceDirective:()=>e8,processJsonDirective:()=>t8,processDirectives:()=>R0,injectRouterScript:()=>oZ});import SL from"fs";import E0 from"path";function NK(X){return X.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function CL(X,$){let Z=X.length,Y=$,J=!0,G=[],Q=(q)=>q+9<=Z&&X[q]==="<"&&X[q+1]==="/"&&(X[q+2]==="s"||X[q+2]==="S")&&(X[q+3]==="c"||X[q+3]==="C")&&(X[q+4]==="r"||X[q+4]==="R")&&(X[q+5]==="i"||X[q+5]==="I")&&(X[q+6]==="p"||X[q+6]==="P")&&(X[q+7]==="t"||X[q+7]==="T")&&(X[q+8]===">"||/\s/.test(X[q+8]));while(Y<Z){let q=X[Y];if(Q(Y))return Y;if(q==="/"&&X[Y+1]==="/"){if(Y=X.indexOf(`
16306
16306
  `,Y+2),Y===-1)return-1;Y+=1,J=!0;continue}if(q==="/"&&X[Y+1]==="*"){let K=X.indexOf("*/",Y+2);if(K===-1)return-1;Y=K+2,J=!0;continue}if(q==="/"&&J){let K=Y+1,U=!1;while(K<Z){let W=X[K];if(W==="\\"){K+=2;continue}if(W==="[")U=!0;else if(W==="]")U=!1;else if(W==="/"&&!U){K++;break}else if(W===`
16307
16307
  `){K=-1;break}K++}if(K===-1){Y++,J=!1;continue}while(K<Z&&/[a-z]/.test(X[K]))K++;Y=K,J=!1;continue}if(q==="'"||q==='"'){let K=q;Y++;while(Y<Z){if(X[Y]==="\\"){Y+=2;continue}if(X[Y]===K){Y++;break}if(X[Y]===`
16308
- `)break;Y++}J=!1;continue}if(q==="`"){Y++;while(Y<Z){if(X[Y]==="\\"){Y+=2;continue}if(X[Y]==="`"){Y++;break}if(X[Y]==="$"&&X[Y+1]==="{"){G.push(!0),Y+=2,J=!0;break}Y++}if(G.length===0)J=!1;continue}if(q==="}"&&G.length>0){G.pop(),Y++;while(Y<Z){if(X[Y]==="\\"){Y+=2;continue}if(X[Y]==="`"){Y++,J=!1;break}if(X[Y]==="$"&&X[Y+1]==="{"){G.push(!0),Y+=2,J=!0;break}Y++}continue}if(/\s/.test(q));else if(/[)\].\w$]/.test(q))J=!1;else J=!0;Y++}return-1}function r5(X,$){let Z=$.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Y=new RegExp(`<script\\b(?=[^>]*\\b${Z}(?:\\s|=|/?>))[^>]*>`,"i").exec(X);if(!Y)return null;let J=Y.index+Y[0].length,G=X.indexOf("</script>",J);if(G===-1)return null;let Q=X.indexOf(">",G);if(Q===-1)return null;return{start:Y.index,end:Q+1}}function TK(X){let $=0;while($<X.length){let Z=X.indexOf("<",$);if(Z===-1)return-1;if(X.startsWith("<!--",Z)){let G=X.indexOf("-->",Z+4);$=G===-1?X.length:G+3;continue}let Y=X.slice(Z),J=/^<style\b[^>]*>/i.exec(Y);if(J){let G=X.toLowerCase().indexOf("</style>",Z+J[0].length);$=G===-1?X.length:G+8;continue}if(/^<script\b[^>]*>/i.test(Y))return Z;$=Z+1}return-1}function SL(X){let $=r5(X,"data-stx-runtime");if(!$)return X;let Z=TK(X);if(Z===-1||Z===$.start)return X;let Y=X.slice($.start,$.end),J=X.slice(0,$.start)+X.slice($.end),G=TK(J);if(G===-1)return Y+`
16308
+ `)break;Y++}J=!1;continue}if(q==="`"){Y++;while(Y<Z){if(X[Y]==="\\"){Y+=2;continue}if(X[Y]==="`"){Y++;break}if(X[Y]==="$"&&X[Y+1]==="{"){G.push(!0),Y+=2,J=!0;break}Y++}if(G.length===0)J=!1;continue}if(q==="}"&&G.length>0){G.pop(),Y++;while(Y<Z){if(X[Y]==="\\"){Y+=2;continue}if(X[Y]==="`"){Y++,J=!1;break}if(X[Y]==="$"&&X[Y+1]==="{"){G.push(!0),Y+=2,J=!0;break}Y++}continue}if(/\s/.test(q));else if(/[)\].\w$]/.test(q))J=!1;else J=!0;Y++}return-1}function r5(X,$){let Z=$.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Y=new RegExp(`<script\\b(?=[^>]*\\b${Z}(?:\\s|=|/?>))[^>]*>`,"i").exec(X);if(!Y)return null;let J=Y.index+Y[0].length,G=X.indexOf("</script>",J);if(G===-1)return null;let Q=X.indexOf(">",G);if(Q===-1)return null;return{start:Y.index,end:Q+1}}function TK(X){let $=0;while($<X.length){let Z=X.indexOf("<",$);if(Z===-1)return-1;if(X.startsWith("<!--",Z)){let G=X.indexOf("-->",Z+4);$=G===-1?X.length:G+3;continue}let Y=X.slice(Z),J=/^<style\b[^>]*>/i.exec(Y);if(J){let G=X.toLowerCase().indexOf("</style>",Z+J[0].length);$=G===-1?X.length:G+8;continue}if(/^<script\b[^>]*>/i.test(Y))return Z;$=Z+1}return-1}function PL(X){let $=r5(X,"data-stx-runtime");if(!$)return X;let Z=TK(X);if(Z===-1||Z===$.start)return X;let Y=X.slice($.start,$.end),J=X.slice(0,$.start)+X.slice($.end),G=TK(J);if(G===-1)return Y+`
16309
16309
  `+J;return J.slice(0,G)+Y+`
16310
- `+J.slice(G)}async function R0(X,$,Z,Y,J){if(Y.ssr===!1&&!Y.autoShell&&Y.buildMode==="spa")return X;if($.__stx_signals_gate===void 0)$.__stx_signals_gate=W1(X);let G=!$.__stxProcessingDepth;if(G)I6($);if(!$.__stxProcessingDepth)$.__stxProcessingDepth=0;if($.__stxProcessingDepth++,!$.__onceStore)$.__onceStore=new Set;if((Y.debug||!C7()&&!A8())&&Z&&Z.endsWith(".stx"))m3(X,Z);try{return await s6.timeAsync("template-processing",async()=>{let Q=await CL(X,$,Z,Y,J);if(G)Q=C4(Q);if(G&&Y.autoShell&&Y.buildMode!=="compile"){let q=Y.app?.head||{},U=($.__stx_runtime_head||null)??X9(),W=($.__stx_head_raw||"").trim(),w,z=W.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(z)w=z[1].trim(),W=W.replace(z[0],"").trim();let B=$.__sections?.title,j=U.title||w||B,_=!U.title&&(!!w||!!B),H={...q,...j&&{title:j},meta:[...q.meta||[],...U.meta||[]],link:[...q.link||[],...U.link||[]],script:[...q.script||[],...U.script||[]],headRaw:[q.headRaw,W].filter(Boolean).join(`
16310
+ `+J.slice(G)}async function R0(X,$,Z,Y,J){if(Y.ssr===!1&&!Y.autoShell&&Y.buildMode==="spa")return X;if($.__stx_signals_gate===void 0)$.__stx_signals_gate=W1(X);let G=!$.__stxProcessingDepth;if(G)I6($);if(!$.__stxProcessingDepth)$.__stxProcessingDepth=0;if($.__stxProcessingDepth++,!$.__onceStore)$.__onceStore=new Set;if((Y.debug||!C7()&&!A8())&&Z&&Z.endsWith(".stx"))m3(X,Z);try{return await s6.timeAsync("template-processing",async()=>{let Q=await vL(X,$,Z,Y,J);if(G)Q=C4(Q);if(G&&Y.autoShell&&Y.buildMode!=="compile"){let q=Y.app?.head||{},U=($.__stx_runtime_head||null)??X9(),W=($.__stx_head_raw||"").trim(),w,z=W.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(z)w=z[1].trim(),W=W.replace(z[0],"").trim();let B=$.__sections?.title,j=U.title||w||B,_=!U.title&&(!!w||!!B),H={...q,...j&&{title:j},meta:[...q.meta||[],...U.meta||[]],link:[...q.link||[],...U.link||[]],script:[...q.script||[],...U.script||[]],headRaw:[q.headRaw,W].filter(Boolean).join(`
16311
16311
  `),...U.htmlAttrs&&{htmlAttrs:iQ(q.htmlAttrs,U.htmlAttrs)},...U.bodyAttrs&&{bodyAttrs:{...q.bodyAttrs||{},...U.bodyAttrs}}},L=S4(Q);if(Q=sQ(Q,H,{..._&&{titleIsHtml:!0},...Y.app?.colorMode&&{colorMode:Y.app.colorMode}}),L)Q=oQ(Q,q),Q=nQ(Q,H.htmlAttrs);let O=Q.match(/<!-- stx-layout: ([^ ]+) -->/);if(O&&Q.includes("<head")){let A=O[1],R=U7(A);Q=Q.replace(/<head\b[^>]*>/i,(N)=>`${N}
16312
16312
  <meta name="stx-layout" content="${NK(A)}">
16313
- <meta name="stx-layout-group" content="${NK(R)}">`)}let F=Q.match(/function (__stx_setup_\d+_\d+)\(/),V=F?E7(Q):null;if(F&&V&&!/\bdata-stx=/.test(V.tag)){Q=yX(Q,(R,N)=>`<body${N} data-stx="${F[1]}">`);let A=new RegExp(`(<(?!body)[a-zA-Z][^>]*) data-stx="${F[1]}"`,"i");Q=Q.replace(A,"$1")}}if(G){Q=rQ(Q);let q=Y.app?.colorMode;if(q)Q=dQ(Q,q);Q=lQ(Q),Q=SL(Q)}if(G)try{let{getStoreScript:q}=await t("stx/store-loader",()=>Promise.resolve().then(() => (Qq(),Gq))),K=Y.storesDir,U=await q(K);if(U){let W=`<script data-stx-stores>${U}</script>`,w=r5(Q,"data-stx-runtime");if(w)Q=Q.slice(0,w.end)+`
16313
+ <meta name="stx-layout-group" content="${NK(R)}">`)}let F=Q.match(/function (__stx_setup_\d+_\d+)\(/),V=F?E7(Q):null;if(F&&V&&!/\bdata-stx=/.test(V.tag)){Q=yX(Q,(R,N)=>`<body${N} data-stx="${F[1]}">`);let A=new RegExp(`(<(?!body)[a-zA-Z][^>]*) data-stx="${F[1]}"`,"i");Q=Q.replace(A,"$1")}}if(G){Q=rQ(Q);let q=Y.app?.colorMode;if(q)Q=dQ(Q,q);Q=lQ(Q),Q=PL(Q)}if(G)try{let{getStoreScript:q}=await t("stx/store-loader",()=>Promise.resolve().then(() => (Qq(),Gq))),K=Y.storesDir,U=await q(K);if(U){let W=`<script data-stx-stores>${U}</script>`,w=r5(Q,"data-stx-runtime");if(w)Q=Q.slice(0,w.end)+`
16314
16314
  `+W+Q.slice(w.end)}}catch{}if(G)try{let{getFrameworkComposableScript:q}=await t("stx/framework-composables",()=>Promise.resolve().then(() => (wq(),Wq))),K=await q(Q);if(K){let U=r5(Q,"data-stx-stores")||r5(Q,"data-stx-runtime");if(U)Q=Q.slice(0,U.end)+`
16315
16315
  `+K+Q.slice(U.end)}}catch{}if(G)try{let{getComposableScript:q}=await t("stx/composable-loader",()=>Promise.resolve().then(() => (Bq(),jq))),K=Y.composablesDir,U=await q(K);if(U){let W=`<script data-stx-composables>${U}</script>`,w=r5(Q,"data-stx-stores")||r5(Q,"data-stx-runtime");if(w)Q=Q.slice(0,w.end)+`
16316
- `+W+Q.slice(w.end)}}catch{}if(G)Q=mQ(Q);if(G&&$.__stx_inject_css!==!1)Q=await SJ(Q,void 0,Y.buildMode==="serve");if(G)Q=$Z(Q);return Q=Q.replace(/\x00STX_ESCAPED_AT\x00/g,"@"),Q})}catch(Q){if(Q instanceof M8)throw Q;let q=Q instanceof Error?Q.message:String(Q),K=new e1(`Template processing failed: ${q}`,Z,void 0,void 0,X.substring(0,200)+(X.length>200?"...":""));if(s0.log(K,{filePath:Z,context:$}),L3.logDetailedError(K,{filePath:Z,template:X.substring(0,500)}),Y.debug)throw K;return H3.createFallbackContent("Template Processing",K)}}async function CL(X,$,Z,Y,J){let G=process.cwd(),Q={...Y,partialsDir:Y.partialsDir&&!E0.isAbsolute(Y.partialsDir)?E0.resolve(G,Y.partialsDir):Y.partialsDir,componentsDir:Y.componentsDir&&!E0.isAbsolute(Y.componentsDir)?E0.resolve(G,Y.componentsDir):Y.componentsDir,layoutsDir:Y.layoutsDir&&!E0.isAbsolute(Y.layoutsDir)?E0.resolve(G,Y.layoutsDir):Y.layoutsDir},q=Q,K=X;await xL(Z,$),vL($,q),K=await b5(()=>NQ(K,$,Z,q),K,(F)=>{s0.log(F,{filePath:Z,phase:"pre-processing-middleware"},"warning"),console.warn(`[stx] pre-processing middleware failed for ${Z}: ${F.message}`)}),K=K.replace(/\{\{--[\s\S]*?--\}\}/g,"");let U=$1(K,V7,(F,V)=>`\x00STX_HTML_COMMENT_${V}\x00`);K=U.output;let W=U.tokens,w=(F)=>W.length===0?F:F.replace(/\x00STX_HTML_COMMENT_(\d+)\x00/g,(V,A)=>W[Number(A)]??""),z="\x00STX_ESCAPED_AT\x00";K=K.replace(/@@/g,z),K=K.replace(/@\{\{([\s\S]*?)\}\}/g,(F,V)=>{return`{{ ${V} }}`}),K=PQ(K),K=await Xq(K,Z,J);let B={};K=R4(K,B);let j={...$.__sections||{}},_="",H=lJ(mJ(X)),L=/@nolayout\b/.test(K)||H===!1;if(/@nolayout\b/.test(K))K=K.replace(/@nolayout\b\s*/g,"");let O=K.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(O)_=O[1],K=K.replace(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/g,"");else if(typeof H==="string"){if(_=H,!/@section\s*\(/.test(K))K=`@section('content')
16316
+ `+W+Q.slice(w.end)}}catch{}if(G)Q=mQ(Q);if(G&&$.__stx_inject_css!==!1)Q=await SJ(Q,void 0,Y.buildMode==="serve");if(G)Q=$Z(Q);return Q=Q.replace(/\x00STX_ESCAPED_AT\x00/g,"@"),Q})}catch(Q){if(Q instanceof M8)throw Q;let q=Q instanceof Error?Q.message:String(Q),K=new e1(`Template processing failed: ${q}`,Z,void 0,void 0,X.substring(0,200)+(X.length>200?"...":""));if(s0.log(K,{filePath:Z,context:$}),L3.logDetailedError(K,{filePath:Z,template:X.substring(0,500)}),Y.debug)throw K;return H3.createFallbackContent("Template Processing",K)}}async function vL(X,$,Z,Y,J){let G=process.cwd(),Q={...Y,partialsDir:Y.partialsDir&&!E0.isAbsolute(Y.partialsDir)?E0.resolve(G,Y.partialsDir):Y.partialsDir,componentsDir:Y.componentsDir&&!E0.isAbsolute(Y.componentsDir)?E0.resolve(G,Y.componentsDir):Y.componentsDir,layoutsDir:Y.layoutsDir&&!E0.isAbsolute(Y.layoutsDir)?E0.resolve(G,Y.layoutsDir):Y.layoutsDir},q=Q,K=X;await gL(Z,$),fL($,q),K=await b5(()=>NQ(K,$,Z,q),K,(F)=>{s0.log(F,{filePath:Z,phase:"pre-processing-middleware"},"warning"),console.warn(`[stx] pre-processing middleware failed for ${Z}: ${F.message}`)}),K=K.replace(/\{\{--[\s\S]*?--\}\}/g,"");let U=$1(K,V7,(F,V)=>`\x00STX_HTML_COMMENT_${V}\x00`);K=U.output;let W=U.tokens,w=(F)=>W.length===0?F:F.replace(/\x00STX_HTML_COMMENT_(\d+)\x00/g,(V,A)=>W[Number(A)]??""),z="\x00STX_ESCAPED_AT\x00";K=K.replace(/@@/g,z),K=K.replace(/@\{\{([\s\S]*?)\}\}/g,(F,V)=>{return`{{ ${V} }}`}),K=PQ(K),K=await Xq(K,Z,J);let B={};K=R4(K,B);let j={...$.__sections||{}},_="",H=lJ(mJ(X)),L=/@nolayout\b/.test(K)||H===!1;if(/@nolayout\b/.test(K))K=K.replace(/@nolayout\b\s*/g,"");let O=K.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(O)_=O[1],K=K.replace(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/g,"");else if(typeof H==="string"){if(_=H,!/@section\s*\(/.test(K))K=`@section('content')
16317
16317
  ${K.trim()}
16318
16318
  @endsection`}if(!_&&!L&&q.defaultLayout){let F=b4(K),V=/@section\s*\(/.test(K);if(!F||V){let A="",R=E0.dirname(Z),N=q.layoutsDir?E0.dirname(q.layoutsDir):process.cwd();for(let T=0;T<20;T++){let k=E0.join(R,"_layout.stx");if(await p(k)){A=k;break}let M=E0.dirname(R);if(M===R||M.length<N.length)break;R=M}if(A)_=A;else if(q.layoutsDir){let T=E0.isAbsolute(q.layoutsDir)?q.layoutsDir:E0.resolve(process.cwd(),q.layoutsDir),k=E0.join(T,`${q.defaultLayout}.stx`);if(await p(k))_=k}if(_&&!V)K=`@section('content')
16319
16319
  ${K.trim()}
16320
16320
  @endsection`}}if(K=K.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*\)/g,(F,V,A)=>{return j[V]=A,""}),K=K.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*([^)]+?)\s*\)/g,(F,V,A)=>{if(/^(['"]).*\1$/.test(A.trim()))return F;try{let R=$0(A.trim(),$);if(R===void 0)return F;return j[V]=String(R??""),""}catch{return F}}),K=K.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@endsection|@show)/g,(F,V,A)=>{if(A.includes("@parent"))j[V]=A.replace("@parent",K5);else j[V]=A.trim();return""}),$.__sections=j,K=K.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"](?:,\s*['"]([^'"]+)['"])?\)/g,(F,V,A)=>{return j[V]||A||""}),!("slot"in $)||$.slot===void 0)K=K.replace(/\{\{\s*slot\s*\}\}/g,()=>{return j.content||""});if(K=N4(K,B),_){let F=[],V=R1(K),A=$1(V.output,R5,(R,N)=>`\x00STX_ORPHAN_STYLE_${N}\x00`);if(K=A.output.replace(/\x00STX_(SCRIPT|ORPHAN_STYLE)_(\d+)\x00/g,(R,N,T)=>{let k=N==="SCRIPT"?V.scripts[Number(T)]:A.tokens[Number(T)];if(k)F.push(k);return""}),F.length>0){let R=F.join(`
16321
16321
  `);j.content=j.content?`${j.content}
16322
- ${R}`:R,$.__sections=j}}if(_)try{let F;if(E0.isAbsolute(_))F=_,J.add(_);else F=await b5(()=>C9(_,Z,Q,J),null,()=>{throw new e1(`Failed to resolve layout path: ${_}`,Z,void 0,void 0,`Layout referenced from ${Z}`)});if(!F){let k=[];try{let y=Q.layoutsDir;if(y){let I=E0.isAbsolute(y)?y:E0.resolve(process.cwd(),y);k=yL.readdirSync(I).filter((C)=>C.endsWith(".stx")).map((C)=>C.replace(/\.stx$/,"")).sort()}}catch{}let M=`Layout not found: ${_} (referenced from ${Z})`+(k.length>0?`. Available layouts: ${k.join(", ")}`:Q.layoutsDir?`. No .stx layouts found in ${Q.layoutsDir}`:"");if(s0.log(Error(M),{layoutPath:_,filePath:Z,available:k},"error"),console.error(`[stx] ${M}`),Q.debug)throw new e1(M,Z);return K}let V=await b5(()=>Bun.file(F).text(),"",()=>{throw new e1(`Failed to read layout file: ${F}`,Z,void 0,void 0,"Layout content could not be loaded")}),A=V.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(A){if(Q.debug)console.log(`Found nested layout: ${A[1]} in ${F}`);let k={},M=V.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(C,S,b)=>{return k[S]=b.trim(),""});for(let[C,S]of Object.entries(k))if(j[C]&&j[C].includes(K5)){let b=j[C].indexOf(K5);j[C]=j[C].slice(0,b)+S+j[C].slice(b+K5.length)}else if(!j[C])j[C]=S;let y={...$,__sections:j},I=`@layout('${A[1]}')${M}`;return await R0(I,y,F,Q,J)}let R=V.replace(/\{\{--[\s\S]*?--\}\}/g,""),N=R4(R,B),T={};return N=N.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(k,M,y)=>{return T[M]=y.trim(),`@slot('${M}')`}),N=N.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(k,M,y)=>{if(j[M]){let I=j[M];if(I.includes(K5)){let C=T[M]||"",S=I.indexOf(K5);I=I.slice(0,S)+C+I.slice(S+K5.length)}return I}return y||""}),N=PL(N,j),N=N.replace(/\{\{\s*slot\s*\}\}/g,()=>{return j.content||""}),N=N4(N,B),$.__originalFilePath=Z,K=await MK(N,$,F,Q,J),K=`<!-- stx-layout: ${_} -->
16323
- ${K}`,w(K)}catch(F){return s0.log(F instanceof Error?F:Error(String(F)),{layoutPath:_,filePath:Z},"error"),`[Error processing layout: ${F instanceof Error?F.message:String(F)}]`}return w(await MK(K,$,Z,Q,J))}function PL(X,$){return X.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(Z,Y,J)=>{let G=$[Y];if(G!==void 0){if(!new RegExp(`@(?:yield|slot)\\(\\s*['"]${Y.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(G))return G}return J||""})}function vL(X,$){if(X.__stx_sfc_mode=!0,X.__stx_options=$,$.buildMode)X.__stx_buildMode=$.buildMode;let Z=$.envPrefix||"STX_PUBLIC_",Y={};for(let[J,G]of Object.entries(process.env))if(J.startsWith(Z)&&G!==void 0)Y[J]=G;X.$env=Y}async function xL(X,$){await b5(()=>EQ(X,$),void 0,(Z)=>{s0.log(Z,{filePath:X,phase:"view-composer"},"warning"),console.warn(`[stx] view composer failed for ${X}: ${Z.message}`)})}async function fL(X,$,Z){let Y=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,J;while((J=Y.exec(X))!==null){let G=J[1],Q=J[2];if(!/\bserver\b/.test(G)||!Q.trim())continue;try{let{extractVariables:K}=await t("stx/variable-extractor",()=>Promise.resolve().then(() => (k7(),IX)));await K(Q,$,Z,{preserveExisting:!0})}catch(K){let U=K instanceof Error?K:Error(String(K));s0.log(U,{filePath:Z,phase:"server-script-extraction"},"warning"),console.warn(`[stx] server <script> extraction failed in ${Z}: ${U.message}`)}}}async function gL(X,$,Z){try{let{interpolateScriptsInTemplate:Y}=await t("stx/expressions",()=>Promise.resolve().then(() => (Z1(),n6)));return Y(X,$,{skipServer:!0})}catch(Y){let J=Y instanceof Error?Y:Error(String(Y));return s0.log(J,{filePath:Z,phase:"script-expression-interpolation"},"warning"),console.warn(`[stx] script expression interpolation failed in ${Z}: ${J.message}`),X}}async function MK(X,$,Z,Y,J){let G=X,Q=Y;if(await fL(G,$,Z),G=await gL(G,$,Z),G=await OQ(G,$,Z),G=await LQ(G,$,Z),G=await UG(G,$,Z,Q),W1(G))G=I9(G,$),G=D9(G,$);G=E9(G);let{processStreamDirectives:q}=await t("stx/streaming",()=>Promise.resolve().then(() => (d3(),u3)));G=q(G,$),G=L4(G,$,Z,Q),G=await hQ(G,$,Z,Q,J),G=await p8(G,$,Z,Q,J),G=R2(G,$,Z,Q);let{processDeferDirectives:K}=await t("stx/defer",()=>Promise.resolve().then(() => Hq));G=K(G,$,Z);let{processTeleportDirectives:U}=await t("stx/teleport",()=>Promise.resolve().then(() => Lq));G=U(G,$,Z);let{processTransitionDirectives:W,processTransitionAttributes:w}=await t("stx/transitions",()=>Promise.resolve().then(() => Rq));G=W(G,$,Z),G=w(G);let{processErrorBoundaryDirectives:z}=await t("stx/error-boundaries",()=>Promise.resolve().then(() => Tq));G=z(G,$,Z);let{processSuspenseDirectives:B}=await t("stx/suspense",()=>Promise.resolve().then(() => Mq));G=B(G,$,Z);let{processAsyncDirectives:j}=await t("stx/async-components",()=>Promise.resolve().then(() => Dq));G=j(G,$,Z);let{processKeepAliveDirectives:_}=await t("stx/keep-alive",()=>Promise.resolve().then(() => bq));G=_(G,$,Z);let{processVirtualListDirectives:H,processVirtualGridDirectives:L,processInfiniteListDirectives:O}=await t("stx/virtual-scrolling",()=>Promise.resolve().then(() => (fq(),xq)));G=H(G,$,Z),G=L(G,$,Z),G=O(G,$,Z);let{processPartialHydrationDirectives:F,processStaticDirectives:V}=await t("stx/partial-hydration",()=>Promise.resolve().then(() => (tq(),aq)));G=F(G,$,Z),G=V(G);let{processComputedDirectives:A,processWatchDirectives:R}=await t("stx/computed",()=>Promise.resolve().then(() => (WK(),UK)));G=A(G,$,Z),G=R(G,$,Z);let{processFormValidationDirectives:N}=await t("stx/forms-validation",()=>Promise.resolve().then(() => (OK(),HK)));G=N(G,$,Z);let{processHeadDirective:T,processTitleDirective:k,processMetaDirective:M,resetHead:y}=await t("stx/head",()=>Promise.resolve().then(() => (M7(),Z9)));if(!$.__stx_head_preset&&!$.__stx_runtime_head)y();let I=T(G);if(G=I.content,I.headContent)$.__stx_head_raw=`${$.__stx_head_raw||""}${I.headContent}
16322
+ ${R}`:R,$.__sections=j}}if(_)try{let F;if(E0.isAbsolute(_))F=_,J.add(_);else F=await b5(()=>C9(_,Z,Q,J),null,()=>{throw new e1(`Failed to resolve layout path: ${_}`,Z,void 0,void 0,`Layout referenced from ${Z}`)});if(!F){let k=[];try{let y=Q.layoutsDir;if(y){let I=E0.isAbsolute(y)?y:E0.resolve(process.cwd(),y);k=SL.readdirSync(I).filter((C)=>C.endsWith(".stx")).map((C)=>C.replace(/\.stx$/,"")).sort()}}catch{}let M=`Layout not found: ${_} (referenced from ${Z})`+(k.length>0?`. Available layouts: ${k.join(", ")}`:Q.layoutsDir?`. No .stx layouts found in ${Q.layoutsDir}`:"");if(s0.log(Error(M),{layoutPath:_,filePath:Z,available:k},"error"),console.error(`[stx] ${M}`),Q.debug)throw new e1(M,Z);return K}let V=await b5(()=>Bun.file(F).text(),"",()=>{throw new e1(`Failed to read layout file: ${F}`,Z,void 0,void 0,"Layout content could not be loaded")}),A=V.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(A){if(Q.debug)console.log(`Found nested layout: ${A[1]} in ${F}`);let k={},M=V.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(C,S,b)=>{return k[S]=b.trim(),""});for(let[C,S]of Object.entries(k))if(j[C]&&j[C].includes(K5)){let b=j[C].indexOf(K5);j[C]=j[C].slice(0,b)+S+j[C].slice(b+K5.length)}else if(!j[C])j[C]=S;let y={...$,__sections:j},I=`@layout('${A[1]}')${M}`;return await R0(I,y,F,Q,J)}let R=V.replace(/\{\{--[\s\S]*?--\}\}/g,""),N=R4(R,B),T={};return N=N.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(k,M,y)=>{return T[M]=y.trim(),`@slot('${M}')`}),N=N.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(k,M,y)=>{if(j[M]){let I=j[M];if(I.includes(K5)){let C=T[M]||"",S=I.indexOf(K5);I=I.slice(0,S)+C+I.slice(S+K5.length)}return I}return y||""}),N=xL(N,j),N=N.replace(/\{\{\s*slot\s*\}\}/g,()=>{return j.content||""}),N=N4(N,B),$.__originalFilePath=Z,K=await MK(N,$,F,Q,J),K=`<!-- stx-layout: ${_} -->
16323
+ ${K}`,w(K)}catch(F){return s0.log(F instanceof Error?F:Error(String(F)),{layoutPath:_,filePath:Z},"error"),`[Error processing layout: ${F instanceof Error?F.message:String(F)}]`}return w(await MK(K,$,Z,Q,J))}function xL(X,$){return X.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(Z,Y,J)=>{let G=$[Y];if(G!==void 0){if(!new RegExp(`@(?:yield|slot)\\(\\s*['"]${Y.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(G))return G}return J||""})}function fL(X,$){if(X.__stx_sfc_mode=!0,X.__stx_options=$,$.buildMode)X.__stx_buildMode=$.buildMode;let Z=$.envPrefix||"STX_PUBLIC_",Y={};for(let[J,G]of Object.entries(process.env))if(J.startsWith(Z)&&G!==void 0)Y[J]=G;X.$env=Y}async function gL(X,$){await b5(()=>EQ(X,$),void 0,(Z)=>{s0.log(Z,{filePath:X,phase:"view-composer"},"warning"),console.warn(`[stx] view composer failed for ${X}: ${Z.message}`)})}async function hL(X,$,Z){let Y=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,J;while((J=Y.exec(X))!==null){let G=J[1],Q=J[2];if(!/\bserver\b/.test(G)||!Q.trim())continue;try{let{extractVariables:K}=await t("stx/variable-extractor",()=>Promise.resolve().then(() => (k7(),IX)));await K(Q,$,Z,{preserveExisting:!0})}catch(K){let U=K instanceof Error?K:Error(String(K));s0.log(U,{filePath:Z,phase:"server-script-extraction"},"warning"),console.warn(`[stx] server <script> extraction failed in ${Z}: ${U.message}`)}}}async function uL(X,$,Z){try{let{interpolateScriptsInTemplate:Y}=await t("stx/expressions",()=>Promise.resolve().then(() => (Z1(),n6)));return Y(X,$,{skipServer:!0})}catch(Y){let J=Y instanceof Error?Y:Error(String(Y));return s0.log(J,{filePath:Z,phase:"script-expression-interpolation"},"warning"),console.warn(`[stx] script expression interpolation failed in ${Z}: ${J.message}`),X}}async function MK(X,$,Z,Y,J){let G=X,Q=Y;if(await hL(G,$,Z),G=await uL(G,$,Z),G=await OQ(G,$,Z),G=await LQ(G,$,Z),G=await UG(G,$,Z,Q),W1(G))G=I9(G,$),G=D9(G,$);G=E9(G);let{processStreamDirectives:q}=await t("stx/streaming",()=>Promise.resolve().then(() => (d3(),u3)));G=q(G,$),G=L4(G,$,Z,Q),G=await hQ(G,$,Z,Q,J),G=await p8(G,$,Z,Q,J),G=R2(G,$,Z,Q);let{processDeferDirectives:K}=await t("stx/defer",()=>Promise.resolve().then(() => Hq));G=K(G,$,Z);let{processTeleportDirectives:U}=await t("stx/teleport",()=>Promise.resolve().then(() => Lq));G=U(G,$,Z);let{processTransitionDirectives:W,processTransitionAttributes:w}=await t("stx/transitions",()=>Promise.resolve().then(() => Rq));G=W(G,$,Z),G=w(G);let{processErrorBoundaryDirectives:z}=await t("stx/error-boundaries",()=>Promise.resolve().then(() => Tq));G=z(G,$,Z);let{processSuspenseDirectives:B}=await t("stx/suspense",()=>Promise.resolve().then(() => Mq));G=B(G,$,Z);let{processAsyncDirectives:j}=await t("stx/async-components",()=>Promise.resolve().then(() => Dq));G=j(G,$,Z);let{processKeepAliveDirectives:_}=await t("stx/keep-alive",()=>Promise.resolve().then(() => bq));G=_(G,$,Z);let{processVirtualListDirectives:H,processVirtualGridDirectives:L,processInfiniteListDirectives:O}=await t("stx/virtual-scrolling",()=>Promise.resolve().then(() => (fq(),xq)));G=H(G,$,Z),G=L(G,$,Z),G=O(G,$,Z);let{processPartialHydrationDirectives:F,processStaticDirectives:V}=await t("stx/partial-hydration",()=>Promise.resolve().then(() => (tq(),aq)));G=F(G,$,Z),G=V(G);let{processComputedDirectives:A,processWatchDirectives:R}=await t("stx/computed",()=>Promise.resolve().then(() => (WK(),UK)));G=A(G,$,Z),G=R(G,$,Z);let{processFormValidationDirectives:N}=await t("stx/forms-validation",()=>Promise.resolve().then(() => (OK(),HK)));G=N(G,$,Z);let{processHeadDirective:T,processTitleDirective:k,processMetaDirective:M,resetHead:y}=await t("stx/head",()=>Promise.resolve().then(() => (M7(),Z9)));if(!$.__stx_head_preset&&!$.__stx_runtime_head)y();let I=T(G);if(G=I.content,I.headContent)$.__stx_head_raw=`${$.__stx_head_raw||""}${I.headContent}
16324
16324
  `;if(G=k(G,$),G=M(G,$),G=kQ(G),G=k3(G,$),G=qG(G),G=AQ(G),G=await A4(G,$,Z,Q,J),G=await p8(G,$,Z,Q,J),$.__stxProcessingDepth===1)G=D6(G,$);if(G=G.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/g,""),G=C4(G),G=Z5(G,$,Z),G=I3(G,$),G=E3(G,$),G=x8(G,$),G=LG(G,$),G=FG(G,$),G=await oJ(G,$,Z,Q),G=await UY(G,$,Z),G=await TG(G,$,Z,Q),G=_2(G,$,Z,Q),G=_J(G,$,Z,Q),G=HJ(G,$,Z),G=OJ(G,$,Z,Q),G=JG(G,$,Z,Q),G=t8(G,$),G=e8(G),G=Zq(G),!Q.skipEventDirectives)G=K6(G,$,Z);if(G=nJ(G,$,Z),Q.debug){let r=/\bx-data\s*=/.test(G),a=pX(X);if(r&&a)console.warn(`[stx] ${Z}: Template mixes Alpine-style (x-data) and signals (state/derived/effect) reactivity.
16325
16325
  Both work on the same page, but they manage separate scopes.
16326
16326
  Prefer signals (state/derived/effect) for new components.`)}G=bQ(G,$),G=await N1(G,$,Z),G=Yq(G),G=Jq(G),G=gJ(G);let{processXElementDirectives:C}=await t("stx/x-element",()=>Promise.resolve().then(() => VK));G=C(G);let S=$.__originalFilePath||Z,b=O7($);if(G=await y9(G,Q,S,b),G=BG(G,$),G=await TQ(G,$,Z,Q),Q.media?.image?.autoSiblings){let r=Q.publicDir||"public",{rewriteImagesWithSiblings:a}=await t("stx/image-optimization/auto-sibling",()=>Promise.resolve().then(() => (RK(),AK)));G=await a(G,{publicDir:r})}if(Q.seo?.enabled)G=LJ(G,$,Q);let P=(r,a,K0=!0)=>{if(!a)return r;let N0=a.match(/<title\b[^>]*>[\s\S]*?<\/title>/i),J0=r.match(/<title\b[^>]*>[\s\S]*?<\/title>/i);if(N0&&J0){if(K0)r=r.replace(J0[0],N0[0]);if(a=a.replace(N0[0],"").trim(),!a)return r}if(/<\/head>/i.test(r))return r.replace(/<\/head>/i,`${a}
@@ -16334,9 +16334,9 @@ ${PJ()}
16334
16334
  `+v}else G=G.replace("</head>",`${a}
16335
16335
  </head>`)}else if(G.includes("<body"))G=G.replace(/<body([^>]*)>/,`<body$1>
16336
16336
  ${a}`);else G=a+`
16337
- `+G}{let{scanScriptTags:r}=await t("stx/signal-processing",()=>Promise.resolve().then(() => (y7(),iX))),a=[];for(let K0 of r(G)){if(!/\bserver\b/i.test(K0.attrs))continue;let N0=K0.start+K0.fullMatch.indexOf(">")+1,J0=bL(G,N0);if(J0===-1)continue;let D=J0+9;while(D<G.length&&/\s/.test(G[D]))D++;a.push({start:K0.start,end:D})}for(let K0=a.length-1;K0>=0;K0--){let{start:N0,end:J0}=a[K0];G=G.substring(0,N0)+G.substring(J0)}}let l=NX(G,Z);if(l.hasScoped)G=l.html;let j0=$.__stx_event_bindings||[],m0=!1,_1=[],W5=/\s:[a-z][\w.-]*\s*=/.test(G),{scanScriptTags:w5}=await t("stx/signal-processing",()=>Promise.resolve().then(() => (y7(),iX)));for(let r of w5(G,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/}))_1.push({match:r.fullMatch,attrs:r.attrs,content:r.body});for(let{match:r,attrs:a,content:K0}of _1){m0=!0;let N0=K0;X$(K0,Z,Y.strict,$.__originalFilePath);let J0=await L7(K0,{eventBindings:j0,attrs:a,hasColonDirectives:W5,templateContent:X,filePath:Z,projectRoot:process.cwd(),production:Y.buildMode==="compile",serverData:b});G=G.replace(r,()=>J0)}if(m0)$.__stx_event_bindings=[];if(!m0&&$.__stxProcessingDepth===1){let r=$.__stx_event_bindings||[];if(r.length>0){let a=g$(r);if(a){let K0=G.lastIndexOf("</body>");G=K0===-1?G+a:G.slice(0,K0)+a+`
16338
- `+G.slice(K0)}$.__stx_event_bindings=[]}}if(!nZ(G)&&rZ(G))G=await dX(G,Q);if(Q.csp?.enabled&&Q.csp.useNonce&&typeof $.cspNonce==="string")G=YG(G,$.cspNonce);return G}var K5="<!--PARENT_CONTENT_PLACEHOLDER-->";var sX=E(()=>{CJ();W9();l1();B$();vJ();hJ();dJ();P$();_$();h$();F7();rJ();sJ();C8();GG();KG();wG();_G();w1();M7();Z1();VG();MG();HQ();VQ();F4();P9();MQ();M5();IQ();F3();A0();DQ();SQ();vQ();uQ();t$();E4();aQ();y7();H4();$q();P4();v4();O0();l3();i$();z7();mX();mX();P4();v4()});import lL from"fs";import l4 from"path";import xK from"fs";import q1 from"path";var n4=[72,96,128,144,152,192,384,512],r4=[120,152,167,180],o4=[16,32];async function s4(X,$){let Z={success:!0,generatedFiles:[],errors:[],warnings:[]},Y=X.pwa?.icons;if(!Y?.src)return Z.errors.push("No source icon specified in pwa.icons.src"),Z.success=!1,Z;let J=q1.isAbsolute(Y.src)?Y.src:q1.resolve(process.cwd(),Y.src);if(!await Bun.file(J).exists())return Z.errors.push(`Source icon not found: ${J}`),Z.success=!1,Z;let G=q1.resolve($,Y.outputDir||"pwa-icons");try{xK.mkdirSync(G,{recursive:!0})}catch{return Z.errors.push(`Failed to create output directory: ${G}`),Z.success=!1,Z}let Q=Y.sizes||n4,q=Y.generateWebP??!0,K=Y.generateAppleIcons??!0;try{let U;try{U=await import("sharp")}catch{return Z.errors.push(`sharp is not installed. Install it with: bun add sharp
16339
- Icon generation requires the sharp package for image processing.`),Z.success=!1,Z}let w=await U.default(J).metadata();if(w.width&&w.width<512)Z.warnings.push(`Source icon is ${w.width}x${w.height}. Recommend using at least 512x512 for best quality.`);for(let H of Q){let L=q1.join(G,`icon-${H}x${H}.png`);if(await U.default(J).resize(H,H,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).png().toFile(L),Z.generatedFiles.push(L),q){let O=q1.join(G,`icon-${H}x${H}.webp`);await U.default(J).resize(H,H,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).webp({quality:90}).toFile(O),Z.generatedFiles.push(O)}}if(K){for(let L of r4){let O=q1.join(G,`apple-touch-icon-${L}x${L}.png`);await U.default(J).resize(L,L,{fit:"contain",background:{r:255,g:255,b:255,alpha:1}}).png().toFile(O),Z.generatedFiles.push(O)}let H=q1.join(G,"apple-touch-icon.png");await U.default(J).resize(180,180,{fit:"contain",background:{r:255,g:255,b:255,alpha:1}}).png().toFile(H),Z.generatedFiles.push(H)}for(let H of o4){let L=q1.join(G,`favicon-${H}x${H}.png`);await U.default(J).resize(H,H,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).png().toFile(L),Z.generatedFiles.push(L)}let z=512,B=q1.join(G,`icon-maskable-${z}x${z}.png`),j=Math.floor(z*0.1),_=z-j*2;await U.default(J).resize(_,_,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).extend({top:j,bottom:j,left:j,right:j,background:{r:255,g:255,b:255,alpha:1}}).png().toFile(B),Z.generatedFiles.push(B)}catch(U){let W=U instanceof Error?U.message:String(U);Z.errors.push(`Icon generation failed: ${W}`),Z.success=!1}return Z}function nL(X){let $=X.sizes||n4,Z=X.outputDir?`/${X.outputDir}`:"/pwa-icons",Y=X.generateWebP??!0,J=X.generateAppleIcons??!0,G=[];for(let Q of $)if(G.push(`${Z}/icon-${Q}x${Q}.png`),Y)G.push(`${Z}/icon-${Q}x${Q}.webp`);if(J){G.push(`${Z}/apple-touch-icon.png`);for(let Q of r4)G.push(`${Z}/apple-touch-icon-${Q}x${Q}.png`)}for(let Q of o4)G.push(`${Z}/favicon-${Q}x${Q}.png`);return G.push(`${Z}/icon-maskable-512x512.png`),G}async function a4(){try{return await import("sharp"),!0}catch{return!1}}YX();function YU(X,$,Z,Y){let J=[],G=Y.join(" ");for(let Q of X)if(J.push({src:`${$}/icon-${Q}x${Q}.png`,sizes:`${Q}x${Q}`,type:"image/png",purpose:G}),Z)J.push({src:`${$}/icon-${Q}x${Q}.webp`,sizes:`${Q}x${Q}`,type:"image/webp",purpose:G});return J}function JU(X){return X.map(($)=>({name:$.name,short_name:$.shortName,description:$.description,url:$.url,icons:$.icons?.map((Z)=>({src:Z.src,sizes:Z.sizes,type:Z.type}))}))}function GU(X){let $=X.pwa?.shareTarget;if(!$?.enabled)return;let Z={action:$.action||"/share",method:$.method||"POST",enctype:$.enctype||"multipart/form-data",params:{title:$.params?.title||"title",text:$.params?.text||"text",url:$.params?.url||"url"}};if($.acceptFiles&&$.acceptFiles.length>0)Z.params.files=$.acceptFiles.map((Y)=>({name:Y.name,accept:Y.accept}));return Z}function QU(X){let $=X.pwa?.fileHandlers;if(!$?.enabled||!$.accept)return;let Z=[{action:$.action||"/",accept:$.accept,launch_type:$.launchType||"single-client"}];if($.icons)Z[0].icons=$.icons.map((Y)=>({src:Y.src,sizes:Y.sizes,type:Y.type}));return Z}function qU(X){let $=X.pwa?.protocolHandlers;if(!$||$.length===0)return;return $.map((Z)=>({protocol:Z.protocol,url:Z.url}))}function KU(X){let $=X.pwa;if(!$?.enabled||!$.manifest)return null;let{manifest:Z,icons:Y}=$,J=Y?.sizes||[72,96,128,144,152,192,384,512],G=Y?.outputDir?`/${Y.outputDir}`:"/pwa-icons",Q=Y?.generateWebP??!0,q=Y?.purpose||["any","maskable"],K={name:Z.name,short_name:Z.shortName||Z.name,description:Z.description,start_url:Z.startUrl||"/",display:Z.display||"standalone",display_override:Z.displayOverride,orientation:Z.orientation,theme_color:Z.themeColor,background_color:Z.backgroundColor,scope:Z.scope||"/",lang:Z.lang,dir:Z.dir,id:Z.id,categories:Z.categories,icons:YU(J,G,Q,q)};if(Z.shortcuts&&Z.shortcuts.length>0)K.shortcuts=JU(Z.shortcuts);if(Z.screenshots&&Z.screenshots.length>0)K.screenshots=Z.screenshots.map((z)=>({src:z.src,sizes:z.sizes,type:z.type,label:z.label,form_factor:z.platform}));let U=GU(X);if(U)K.share_target=U;let W=QU(X);if(W)K.file_handlers=W;let w=qU(X);if(w)K.protocol_handlers=w;if(Z.launchHandler)K.launch_handler={client_mode:Z.launchHandler};if(Z.handleLinks)K.handle_links=Z.handleLinks;if(Z.edgeSidePanel?.enabled)K.edge_side_panel={preferred_width:Z.edgeSidePanel.preferredWidth};return K}function U2(X){let $=KU(X);if(!$)return"";let Z=JSON.parse(JSON.stringify($));return JSON.stringify(Z,null,2)}function YF(X,$){return{...$,...X,shortcuts:X.shortcuts||$.shortcuts,screenshots:X.screenshots||$.screenshots,categories:X.categories||$.categories}}function JF(X){let $=[],Z=X.pwa;if(!Z?.enabled)return $;let Y=Z.manifest;if(!Y)return $.push("PWA manifest configuration is missing"),$;if(!Y.name)$.push("Manifest name is required");let J=["fullscreen","standalone","minimal-ui","browser"];if(Y.display&&!J.includes(Y.display))$.push(`Invalid display mode: ${Y.display}. Must be one of: ${J.join(", ")}`);let G=["any","natural","landscape","landscape-primary","landscape-secondary","portrait","portrait-primary","portrait-secondary"];if(Y.orientation&&!G.includes(Y.orientation))$.push(`Invalid orientation: ${Y.orientation}`);let Q=/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/;if(Y.themeColor&&!Q.test(Y.themeColor))$.push(`Invalid theme color: ${Y.themeColor}. Must be a valid hex color.`);if(Y.backgroundColor&&!Q.test(Y.backgroundColor))$.push(`Invalid background color: ${Y.backgroundColor}. Must be a valid hex color.`);if(Z.shareTarget?.enabled){if(!Z.shareTarget.action)$.push("Share target action URL is required")}if(Z.fileHandlers?.enabled){if(!Z.fileHandlers.accept||Object.keys(Z.fileHandlers.accept).length===0)$.push("File handlers must specify accepted MIME types")}if(Z.protocolHandlers)for(let q of Z.protocolHandlers){if(!q.protocol)$.push("Protocol handler missing protocol");if(!q.url||!q.url.includes("%s"))$.push(`Protocol handler URL must contain %s placeholder: ${q.protocol}`)}return $}import IK from"path";async function EK(X){let $=X.pwa?.offline;if(!$?.enabled)return"";if($.page){let Z=IK.isAbsolute($.page)?$.page:IK.resolve(process.cwd(),$.page);if(await Bun.file(Z).exists())try{let{processDirectives:Y}=await Promise.resolve().then(() => (sX(),kK)),J=await Bun.file(Z).text();return await Y(J,{},Z,X,new Set)}catch(Y){console.warn(`[PWA] Failed to process custom offline page: ${Y}`)}else console.warn(`[PWA] Custom offline page not found: ${Z}`)}return hL(X)}function hL(X){let $=X.pwa?.offline,Z=X.pwa?.manifest,Y=$?.fallbackTitle||"You are offline",J=$?.fallbackMessage||"Please check your internet connection and try again.",G=Z?.themeColor||"#4f46e5",Q=Z?.shortName||Z?.name||"App";return`<!DOCTYPE html>
16337
+ `+G}{let{scanScriptTags:r}=await t("stx/signal-processing",()=>Promise.resolve().then(() => (y7(),iX))),a=[];for(let K0 of r(G)){if(!/\bserver\b/i.test(K0.attrs))continue;let N0=K0.start+K0.fullMatch.indexOf(">")+1,J0=CL(G,N0);if(J0===-1)continue;let D=J0+9;while(D<G.length&&/\s/.test(G[D]))D++;a.push({start:K0.start,end:D})}for(let K0=a.length-1;K0>=0;K0--){let{start:N0,end:J0}=a[K0];G=G.substring(0,N0)+G.substring(J0)}}let l=NX(G,Z);if(l.hasScoped)G=l.html;let j0=$.__stx_event_bindings||[],m0=!1,_1=[],W5=/\s:[a-z][\w.-]*\s*=/.test(G),{scanScriptTags:w5}=await t("stx/signal-processing",()=>Promise.resolve().then(() => (y7(),iX)));for(let r of w5(G,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/}))_1.push({match:r.fullMatch,attrs:r.attrs,content:r.body});for(let{match:r,attrs:a,content:K0}of _1){m0=!0;let N0=K0;X$(K0,Z,Y.strict,$.__originalFilePath);let J0=await L7(K0,{eventBindings:j0,attrs:a,hasColonDirectives:W5,templateContent:X,filePath:Z,projectRoot:process.cwd(),production:Y.buildMode==="compile",serverData:b});G=G.replace(r,()=>J0)}if(m0)$.__stx_event_bindings=[];if(!m0&&$.__stxProcessingDepth===1){let r=$.__stx_event_bindings||[];if(r.length>0){let a=g$(r);if(a){let K0=G.lastIndexOf("</body>");G=K0===-1?G+a:G.slice(0,K0)+a+`
16338
+ `+G.slice(K0)}$.__stx_event_bindings=[]}}if(!nZ(G)&&rZ(G))G=await dX(G,Q);if(Q.csp?.enabled&&Q.csp.useNonce&&typeof $.cspNonce==="string")G=YG(G,$.cspNonce);return G}var K5="<!--PARENT_CONTENT_PLACEHOLDER-->";var sX=E(()=>{CJ();W9();l1();B$();vJ();hJ();dJ();P$();_$();h$();F7();rJ();sJ();C8();GG();KG();wG();_G();w1();M7();Z1();VG();MG();HQ();VQ();F4();P9();MQ();M5();IQ();F3();A0();DQ();SQ();vQ();uQ();t$();E4();aQ();y7();H4();$q();P4();v4();O0();l3();i$();z7();mX();mX();P4();v4()});import pL from"fs";import l4 from"path";import xK from"fs";import q1 from"path";var n4=[72,96,128,144,152,192,384,512],r4=[120,152,167,180],o4=[16,32];async function s4(X,$){let Z={success:!0,generatedFiles:[],errors:[],warnings:[]},Y=X.pwa?.icons;if(!Y?.src)return Z.errors.push("No source icon specified in pwa.icons.src"),Z.success=!1,Z;let J=q1.isAbsolute(Y.src)?Y.src:q1.resolve(process.cwd(),Y.src);if(!await Bun.file(J).exists())return Z.errors.push(`Source icon not found: ${J}`),Z.success=!1,Z;let G=q1.resolve($,Y.outputDir||"pwa-icons");try{xK.mkdirSync(G,{recursive:!0})}catch{return Z.errors.push(`Failed to create output directory: ${G}`),Z.success=!1,Z}let Q=Y.sizes||n4,q=Y.generateWebP??!0,K=Y.generateAppleIcons??!0;try{let U;try{U=await import("sharp")}catch{return Z.errors.push(`sharp is not installed. Install it with: bun add sharp
16339
+ Icon generation requires the sharp package for image processing.`),Z.success=!1,Z}let w=await U.default(J).metadata();if(w.width&&w.width<512)Z.warnings.push(`Source icon is ${w.width}x${w.height}. Recommend using at least 512x512 for best quality.`);for(let H of Q){let L=q1.join(G,`icon-${H}x${H}.png`);if(await U.default(J).resize(H,H,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).png().toFile(L),Z.generatedFiles.push(L),q){let O=q1.join(G,`icon-${H}x${H}.webp`);await U.default(J).resize(H,H,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).webp({quality:90}).toFile(O),Z.generatedFiles.push(O)}}if(K){for(let L of r4){let O=q1.join(G,`apple-touch-icon-${L}x${L}.png`);await U.default(J).resize(L,L,{fit:"contain",background:{r:255,g:255,b:255,alpha:1}}).png().toFile(O),Z.generatedFiles.push(O)}let H=q1.join(G,"apple-touch-icon.png");await U.default(J).resize(180,180,{fit:"contain",background:{r:255,g:255,b:255,alpha:1}}).png().toFile(H),Z.generatedFiles.push(H)}for(let H of o4){let L=q1.join(G,`favicon-${H}x${H}.png`);await U.default(J).resize(H,H,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).png().toFile(L),Z.generatedFiles.push(L)}let z=512,B=q1.join(G,`icon-maskable-${z}x${z}.png`),j=Math.floor(z*0.1),_=z-j*2;await U.default(J).resize(_,_,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).extend({top:j,bottom:j,left:j,right:j,background:{r:255,g:255,b:255,alpha:1}}).png().toFile(B),Z.generatedFiles.push(B)}catch(U){let W=U instanceof Error?U.message:String(U);Z.errors.push(`Icon generation failed: ${W}`),Z.success=!1}return Z}function oL(X){let $=X.sizes||n4,Z=X.outputDir?`/${X.outputDir}`:"/pwa-icons",Y=X.generateWebP??!0,J=X.generateAppleIcons??!0,G=[];for(let Q of $)if(G.push(`${Z}/icon-${Q}x${Q}.png`),Y)G.push(`${Z}/icon-${Q}x${Q}.webp`);if(J){G.push(`${Z}/apple-touch-icon.png`);for(let Q of r4)G.push(`${Z}/apple-touch-icon-${Q}x${Q}.png`)}for(let Q of o4)G.push(`${Z}/favicon-${Q}x${Q}.png`);return G.push(`${Z}/icon-maskable-512x512.png`),G}async function a4(){try{return await import("sharp"),!0}catch{return!1}}YX();function YU(X,$,Z,Y){let J=[],G=Y.join(" ");for(let Q of X)if(J.push({src:`${$}/icon-${Q}x${Q}.png`,sizes:`${Q}x${Q}`,type:"image/png",purpose:G}),Z)J.push({src:`${$}/icon-${Q}x${Q}.webp`,sizes:`${Q}x${Q}`,type:"image/webp",purpose:G});return J}function JU(X){return X.map(($)=>({name:$.name,short_name:$.shortName,description:$.description,url:$.url,icons:$.icons?.map((Z)=>({src:Z.src,sizes:Z.sizes,type:Z.type}))}))}function GU(X){let $=X.pwa?.shareTarget;if(!$?.enabled)return;let Z={action:$.action||"/share",method:$.method||"POST",enctype:$.enctype||"multipart/form-data",params:{title:$.params?.title||"title",text:$.params?.text||"text",url:$.params?.url||"url"}};if($.acceptFiles&&$.acceptFiles.length>0)Z.params.files=$.acceptFiles.map((Y)=>({name:Y.name,accept:Y.accept}));return Z}function QU(X){let $=X.pwa?.fileHandlers;if(!$?.enabled||!$.accept)return;let Z=[{action:$.action||"/",accept:$.accept,launch_type:$.launchType||"single-client"}];if($.icons)Z[0].icons=$.icons.map((Y)=>({src:Y.src,sizes:Y.sizes,type:Y.type}));return Z}function qU(X){let $=X.pwa?.protocolHandlers;if(!$||$.length===0)return;return $.map((Z)=>({protocol:Z.protocol,url:Z.url}))}function KU(X){let $=X.pwa;if(!$?.enabled||!$.manifest)return null;let{manifest:Z,icons:Y}=$,J=Y?.sizes||[72,96,128,144,152,192,384,512],G=Y?.outputDir?`/${Y.outputDir}`:"/pwa-icons",Q=Y?.generateWebP??!0,q=Y?.purpose||["any","maskable"],K={name:Z.name,short_name:Z.shortName||Z.name,description:Z.description,start_url:Z.startUrl||"/",display:Z.display||"standalone",display_override:Z.displayOverride,orientation:Z.orientation,theme_color:Z.themeColor,background_color:Z.backgroundColor,scope:Z.scope||"/",lang:Z.lang,dir:Z.dir,id:Z.id,categories:Z.categories,icons:YU(J,G,Q,q)};if(Z.shortcuts&&Z.shortcuts.length>0)K.shortcuts=JU(Z.shortcuts);if(Z.screenshots&&Z.screenshots.length>0)K.screenshots=Z.screenshots.map((z)=>({src:z.src,sizes:z.sizes,type:z.type,label:z.label,form_factor:z.platform}));let U=GU(X);if(U)K.share_target=U;let W=QU(X);if(W)K.file_handlers=W;let w=qU(X);if(w)K.protocol_handlers=w;if(Z.launchHandler)K.launch_handler={client_mode:Z.launchHandler};if(Z.handleLinks)K.handle_links=Z.handleLinks;if(Z.edgeSidePanel?.enabled)K.edge_side_panel={preferred_width:Z.edgeSidePanel.preferredWidth};return K}function U2(X){let $=KU(X);if(!$)return"";let Z=JSON.parse(JSON.stringify($));return JSON.stringify(Z,null,2)}function GF(X,$){return{...$,...X,shortcuts:X.shortcuts||$.shortcuts,screenshots:X.screenshots||$.screenshots,categories:X.categories||$.categories}}function QF(X){let $=[],Z=X.pwa;if(!Z?.enabled)return $;let Y=Z.manifest;if(!Y)return $.push("PWA manifest configuration is missing"),$;if(!Y.name)$.push("Manifest name is required");let J=["fullscreen","standalone","minimal-ui","browser"];if(Y.display&&!J.includes(Y.display))$.push(`Invalid display mode: ${Y.display}. Must be one of: ${J.join(", ")}`);let G=["any","natural","landscape","landscape-primary","landscape-secondary","portrait","portrait-primary","portrait-secondary"];if(Y.orientation&&!G.includes(Y.orientation))$.push(`Invalid orientation: ${Y.orientation}`);let Q=/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/;if(Y.themeColor&&!Q.test(Y.themeColor))$.push(`Invalid theme color: ${Y.themeColor}. Must be a valid hex color.`);if(Y.backgroundColor&&!Q.test(Y.backgroundColor))$.push(`Invalid background color: ${Y.backgroundColor}. Must be a valid hex color.`);if(Z.shareTarget?.enabled){if(!Z.shareTarget.action)$.push("Share target action URL is required")}if(Z.fileHandlers?.enabled){if(!Z.fileHandlers.accept||Object.keys(Z.fileHandlers.accept).length===0)$.push("File handlers must specify accepted MIME types")}if(Z.protocolHandlers)for(let q of Z.protocolHandlers){if(!q.protocol)$.push("Protocol handler missing protocol");if(!q.url||!q.url.includes("%s"))$.push(`Protocol handler URL must contain %s placeholder: ${q.protocol}`)}return $}import IK from"path";async function EK(X){let $=X.pwa?.offline;if(!$?.enabled)return"";if($.page){let Z=IK.isAbsolute($.page)?$.page:IK.resolve(process.cwd(),$.page);if(await Bun.file(Z).exists())try{let{processDirectives:Y}=await Promise.resolve().then(() => (sX(),kK)),J=await Bun.file(Z).text();return await Y(J,{},Z,X,new Set)}catch(Y){console.warn(`[PWA] Failed to process custom offline page: ${Y}`)}else console.warn(`[PWA] Custom offline page not found: ${Z}`)}return dL(X)}function dL(X){let $=X.pwa?.offline,Z=X.pwa?.manifest,Y=$?.fallbackTitle||"You are offline",J=$?.fallbackMessage||"Please check your internet connection and try again.",G=Z?.themeColor||"#4f46e5",Q=Z?.shortName||Z?.name||"App";return`<!DOCTYPE html>
16340
16340
  <html lang="en">
16341
16341
  <head>
16342
16342
  <meta charset="UTF-8">
@@ -16569,9 +16569,9 @@ Icon generation requires the sharp package for image processing.`),Z.success=!1,
16569
16569
  }, 5000);
16570
16570
  </script>
16571
16571
  </body>
16572
- </html>`}function Q$(X){return X.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}o5();s5();import U5 from"fs";import q$ from"path";function uL(X){let $=[],Z=X.pwa;if($.push({id:"pwa-enabled",name:"PWA Enabled",category:"required",passed:Z?.enabled===!0,message:Z?.enabled?"PWA is enabled":"PWA is not enabled in config"}),!Z?.enabled)return $;$.push({id:"manifest-name",name:"App Name",category:"required",passed:Boolean(Z.manifest?.name),message:Z.manifest?.name?`App name: "${Z.manifest.name}"`:"Missing required manifest name"}),$.push({id:"manifest-short-name",name:"Short Name",category:"recommended",passed:Boolean(Z.manifest?.shortName),message:Z.manifest?.shortName?`Short name: "${Z.manifest.shortName}"`:"Short name not set (will use full name)"}),$.push({id:"manifest-description",name:"App Description",category:"recommended",passed:Boolean(Z.manifest?.description),message:Z.manifest?.description?"Description is set":"App description not provided"}),$.push({id:"manifest-theme-color",name:"Theme Color",category:"required",passed:Boolean(Z.manifest?.themeColor),message:Z.manifest?.themeColor?`Theme color: ${Z.manifest.themeColor}`:"Theme color not set"}),$.push({id:"manifest-background-color",name:"Background Color",category:"required",passed:Boolean(Z.manifest?.backgroundColor),message:Z.manifest?.backgroundColor?`Background color: ${Z.manifest.backgroundColor}`:"Background color not set"}),$.push({id:"manifest-display",name:"Display Mode",category:"required",passed:["standalone","fullscreen","minimal-ui"].includes(Z.manifest?.display||""),message:Z.manifest?.display?`Display mode: ${Z.manifest.display}`:"Display mode should be standalone, fullscreen, or minimal-ui"}),$.push({id:"manifest-start-url",name:"Start URL",category:"required",passed:Boolean(Z.manifest?.startUrl),message:Z.manifest?.startUrl?`Start URL: ${Z.manifest.startUrl}`:"Start URL not set"}),$.push({id:"icons-source",name:"Icon Source",category:"required",passed:Boolean(Z.icons?.src),message:Z.icons?.src?`Icon source: ${Z.icons.src}`:"No icon source configured"});let Y=Z.icons?.sizes||[];$.push({id:"icons-192",name:"192x192 Icon",category:"required",passed:Y.includes(192),message:Y.includes(192)?"192x192 icon will be generated":"Missing 192x192 icon (required for Android)"}),$.push({id:"icons-512",name:"512x512 Icon",category:"required",passed:Y.includes(512),message:Y.includes(512)?"512x512 icon will be generated":"Missing 512x512 icon (required for splash screen)"}),$.push({id:"icons-maskable",name:"Maskable Icon",category:"recommended",passed:Z.icons?.purpose?.includes("maskable")||!1,message:Z.icons?.purpose?.includes("maskable")?"Maskable icon purpose is set":"Consider adding maskable icon purpose for adaptive icons"}),$.push({id:"sw-configured",name:"Service Worker",category:"required",passed:Boolean(Z.serviceWorker),message:Z.serviceWorker?"Service worker is configured":"Service worker configuration missing"}),$.push({id:"sw-cache-version",name:"Cache Version",category:"recommended",passed:Boolean(Z.serviceWorker?.cacheVersion),message:Z.serviceWorker?.cacheVersion?`Cache version: ${Z.serviceWorker.cacheVersion}`:"Set cache version for proper cache busting"}),$.push({id:"offline-enabled",name:"Offline Support",category:"required",passed:Z.offline?.enabled===!0,message:Z.offline?.enabled?"Offline support is enabled":"Offline support is disabled"});let J=Z.routes||[];return $.push({id:"caching-strategies",name:"Caching Strategies",category:"recommended",passed:J.length>0,message:J.length>0?`${J.length} route caching strategies configured`:"No custom caching strategies defined"}),$.push({id:"push-config",name:"Push Notifications",category:"optional",passed:!Z.push?.enabled||Boolean(Z.push?.vapidPublicKey),message:Z.push?.enabled?Z.push?.vapidPublicKey?"Push notifications configured with VAPID key":"Push enabled but missing VAPID key":"Push notifications not enabled"}),$.push({id:"share-target",name:"Share Target",category:"optional",passed:!0,message:Z.shareTarget?.enabled?`Share target enabled at ${Z.shareTarget.action}`:"Share target not enabled"}),$.push({id:"auto-inject",name:"Auto-injection",category:"recommended",passed:Z.autoInject!==!1,message:Z.autoInject!==!1?"PWA tags will be auto-injected":"Auto-injection disabled - manual tag insertion required"}),$}function dL(X){let $=[],Z=q$.join(X,"manifest.json"),Y=U5.existsSync(Z);if($.push({id:"build-manifest",name:"Manifest File",category:"required",passed:Y,message:Y?"manifest.json exists":"manifest.json not found in build output"}),Y)try{let W=JSON.parse(U5.readFileSync(Z,"utf-8"));$.push({id:"build-manifest-valid",name:"Valid Manifest JSON",category:"required",passed:!0,message:"Manifest is valid JSON"}),$.push({id:"build-manifest-icons",name:"Manifest Icons",category:"required",passed:Array.isArray(W.icons)&&W.icons.length>0,message:W.icons?.length?`${W.icons.length} icons defined in manifest`:"No icons defined in manifest"})}catch{$.push({id:"build-manifest-valid",name:"Valid Manifest JSON",category:"required",passed:!1,message:"Manifest is not valid JSON"})}let J=q$.join(X,"sw.js"),G=U5.existsSync(J);$.push({id:"build-sw",name:"Service Worker File",category:"required",passed:G,message:G?"Service worker (sw.js) exists":"Service worker not found in build output"});let Q=q$.join(X,"offline.html"),q=U5.existsSync(Q);$.push({id:"build-offline",name:"Offline Page",category:"recommended",passed:q,message:q?"Offline page exists":"No offline.html found"});let K=q$.join(X,"pwa-icons");if(U5.existsSync(K)){let W=U5.readdirSync(K).filter((w)=>w.endsWith(".png")||w.endsWith(".webp"));$.push({id:"build-icons",name:"Generated Icons",category:"required",passed:W.length>0,message:W.length>0?`${W.length} icon files generated`:"No icon files found"})}else $.push({id:"build-icons",name:"Generated Icons",category:"required",passed:!1,message:"Icons directory not found"});return $}function mL(X){let $=X.filter((K)=>K.category==="required"),Z=X.filter((K)=>K.category==="recommended"),Y=$.filter((K)=>K.passed).length,J=Z.filter((K)=>K.passed).length,G=$.length>0?Y/$.length*70:70,Q=Z.length>0?J/Z.length*30:30;return{score:Math.round(G+Q),passed:X.filter((K)=>K.passed).length,failed:X.filter((K)=>!K.passed&&K.category==="required").length,warnings:X.filter((K)=>!K.passed&&K.category!=="required").length,checks:X}}function HD(X,$){let Z=uL(X),Y=$&&U5.existsSync($)?dL($):[];return mL([...Z,...Y])}function OD(X){let $=[];$.push(`
16572
+ </html>`}function Q$(X){return X.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}o5();s5();import U5 from"fs";import q$ from"path";function mL(X){let $=[],Z=X.pwa;if($.push({id:"pwa-enabled",name:"PWA Enabled",category:"required",passed:Z?.enabled===!0,message:Z?.enabled?"PWA is enabled":"PWA is not enabled in config"}),!Z?.enabled)return $;$.push({id:"manifest-name",name:"App Name",category:"required",passed:Boolean(Z.manifest?.name),message:Z.manifest?.name?`App name: "${Z.manifest.name}"`:"Missing required manifest name"}),$.push({id:"manifest-short-name",name:"Short Name",category:"recommended",passed:Boolean(Z.manifest?.shortName),message:Z.manifest?.shortName?`Short name: "${Z.manifest.shortName}"`:"Short name not set (will use full name)"}),$.push({id:"manifest-description",name:"App Description",category:"recommended",passed:Boolean(Z.manifest?.description),message:Z.manifest?.description?"Description is set":"App description not provided"}),$.push({id:"manifest-theme-color",name:"Theme Color",category:"required",passed:Boolean(Z.manifest?.themeColor),message:Z.manifest?.themeColor?`Theme color: ${Z.manifest.themeColor}`:"Theme color not set"}),$.push({id:"manifest-background-color",name:"Background Color",category:"required",passed:Boolean(Z.manifest?.backgroundColor),message:Z.manifest?.backgroundColor?`Background color: ${Z.manifest.backgroundColor}`:"Background color not set"}),$.push({id:"manifest-display",name:"Display Mode",category:"required",passed:["standalone","fullscreen","minimal-ui"].includes(Z.manifest?.display||""),message:Z.manifest?.display?`Display mode: ${Z.manifest.display}`:"Display mode should be standalone, fullscreen, or minimal-ui"}),$.push({id:"manifest-start-url",name:"Start URL",category:"required",passed:Boolean(Z.manifest?.startUrl),message:Z.manifest?.startUrl?`Start URL: ${Z.manifest.startUrl}`:"Start URL not set"}),$.push({id:"icons-source",name:"Icon Source",category:"required",passed:Boolean(Z.icons?.src),message:Z.icons?.src?`Icon source: ${Z.icons.src}`:"No icon source configured"});let Y=Z.icons?.sizes||[];$.push({id:"icons-192",name:"192x192 Icon",category:"required",passed:Y.includes(192),message:Y.includes(192)?"192x192 icon will be generated":"Missing 192x192 icon (required for Android)"}),$.push({id:"icons-512",name:"512x512 Icon",category:"required",passed:Y.includes(512),message:Y.includes(512)?"512x512 icon will be generated":"Missing 512x512 icon (required for splash screen)"}),$.push({id:"icons-maskable",name:"Maskable Icon",category:"recommended",passed:Z.icons?.purpose?.includes("maskable")||!1,message:Z.icons?.purpose?.includes("maskable")?"Maskable icon purpose is set":"Consider adding maskable icon purpose for adaptive icons"}),$.push({id:"sw-configured",name:"Service Worker",category:"required",passed:Boolean(Z.serviceWorker),message:Z.serviceWorker?"Service worker is configured":"Service worker configuration missing"}),$.push({id:"sw-cache-version",name:"Cache Version",category:"recommended",passed:Boolean(Z.serviceWorker?.cacheVersion),message:Z.serviceWorker?.cacheVersion?`Cache version: ${Z.serviceWorker.cacheVersion}`:"Set cache version for proper cache busting"}),$.push({id:"offline-enabled",name:"Offline Support",category:"required",passed:Z.offline?.enabled===!0,message:Z.offline?.enabled?"Offline support is enabled":"Offline support is disabled"});let J=Z.routes||[];return $.push({id:"caching-strategies",name:"Caching Strategies",category:"recommended",passed:J.length>0,message:J.length>0?`${J.length} route caching strategies configured`:"No custom caching strategies defined"}),$.push({id:"push-config",name:"Push Notifications",category:"optional",passed:!Z.push?.enabled||Boolean(Z.push?.vapidPublicKey),message:Z.push?.enabled?Z.push?.vapidPublicKey?"Push notifications configured with VAPID key":"Push enabled but missing VAPID key":"Push notifications not enabled"}),$.push({id:"share-target",name:"Share Target",category:"optional",passed:!0,message:Z.shareTarget?.enabled?`Share target enabled at ${Z.shareTarget.action}`:"Share target not enabled"}),$.push({id:"auto-inject",name:"Auto-injection",category:"recommended",passed:Z.autoInject!==!1,message:Z.autoInject!==!1?"PWA tags will be auto-injected":"Auto-injection disabled - manual tag insertion required"}),$}function lL(X){let $=[],Z=q$.join(X,"manifest.json"),Y=U5.existsSync(Z);if($.push({id:"build-manifest",name:"Manifest File",category:"required",passed:Y,message:Y?"manifest.json exists":"manifest.json not found in build output"}),Y)try{let W=JSON.parse(U5.readFileSync(Z,"utf-8"));$.push({id:"build-manifest-valid",name:"Valid Manifest JSON",category:"required",passed:!0,message:"Manifest is valid JSON"}),$.push({id:"build-manifest-icons",name:"Manifest Icons",category:"required",passed:Array.isArray(W.icons)&&W.icons.length>0,message:W.icons?.length?`${W.icons.length} icons defined in manifest`:"No icons defined in manifest"})}catch{$.push({id:"build-manifest-valid",name:"Valid Manifest JSON",category:"required",passed:!1,message:"Manifest is not valid JSON"})}let J=q$.join(X,"sw.js"),G=U5.existsSync(J);$.push({id:"build-sw",name:"Service Worker File",category:"required",passed:G,message:G?"Service worker (sw.js) exists":"Service worker not found in build output"});let Q=q$.join(X,"offline.html"),q=U5.existsSync(Q);$.push({id:"build-offline",name:"Offline Page",category:"recommended",passed:q,message:q?"Offline page exists":"No offline.html found"});let K=q$.join(X,"pwa-icons");if(U5.existsSync(K)){let W=U5.readdirSync(K).filter((w)=>w.endsWith(".png")||w.endsWith(".webp"));$.push({id:"build-icons",name:"Generated Icons",category:"required",passed:W.length>0,message:W.length>0?`${W.length} icon files generated`:"No icon files found"})}else $.push({id:"build-icons",name:"Generated Icons",category:"required",passed:!1,message:"Icons directory not found"});return $}function cL(X){let $=X.filter((K)=>K.category==="required"),Z=X.filter((K)=>K.category==="recommended"),Y=$.filter((K)=>K.passed).length,J=Z.filter((K)=>K.passed).length,G=$.length>0?Y/$.length*70:70,Q=Z.length>0?J/Z.length*30:30;return{score:Math.round(G+Q),passed:X.filter((K)=>K.passed).length,failed:X.filter((K)=>!K.passed&&K.category==="required").length,warnings:X.filter((K)=>!K.passed&&K.category!=="required").length,checks:X}}function LD(X,$){let Z=mL(X),Y=$&&U5.existsSync($)?lL($):[];return cL([...Z,...Y])}function FD(X){let $=[];$.push(`
16573
16573
  === PWA Audit Report ===
16574
16574
  `);let Z=X.score>=90?"32":X.score>=70?"33":"31";$.push(`Score: \x1B[${Z}m${X.score}/100\x1B[0m`),$.push(`Passed: ${X.passed} | Failed: ${X.failed} | Warnings: ${X.warnings}
16575
16575
  `);let Y=["required","recommended","optional"];for(let J of Y){let G=X.checks.filter((Q)=>Q.category===J);if(G.length===0)continue;$.push(`
16576
16576
  ${J.toUpperCase()}:`);for(let Q of G){let q=Q.passed?"\x1B[32m\u2713\x1B[0m":"\x1B[31m\u2717\x1B[0m";if($.push(` ${q} ${Q.name}: ${Q.message}`),Q.details)$.push(` ${Q.details}`)}}return $.push(""),$.join(`
16577
- `)}j3();YX();o5();s5();async function ID(X,$){let Z={success:!0,files:{icons:[]},errors:[],warnings:[]},Y=X.pwa;if(!Y?.enabled)return Z;try{lL.mkdirSync($,{recursive:!0})}catch{return Z.errors.push(`Failed to create output directory: ${$}`),Z.success=!1,Z}try{let G=U2(X);if(G){let Q=l4.join($,"manifest.json");await Bun.write(Q,G),Z.files.manifest=Q}}catch(G){let Q=G instanceof Error?G.message:String(G);Z.errors.push(`Failed to generate manifest.json: ${Q}`),Z.success=!1}if(Y.icons?.src)if(await a4()){let Q=await s4(X,$);if(Z.files.icons=Q.generatedFiles,Z.warnings.push(...Q.warnings),!Q.success)Z.errors.push(...Q.errors),Z.success=!1}else Z.warnings.push("sharp is not installed. Skipping icon generation. Install with: bun add sharp");if(Y.offline?.enabled)try{let G=await EK(X);if(G){let Q=l4.join($,"offline.html");await Bun.write(Q,G),Z.files.offlinePage=Q}}catch(G){let Q=G instanceof Error?G.message:String(G);Z.errors.push(`Failed to generate offline page: ${Q}`),Z.success=!1}let J;if(Y.precache?.enabled){let G=f1($,X);J={fileCount:G.fileCount,totalSize:G.totalSize},Z.precacheStats=J}try{let G=$X(X,$);if(G){let Q=j5(X),q=l4.join($,Q);await Bun.write(q,G),Z.files.serviceWorker=q}}catch(G){let Q=G instanceof Error?G.message:String(G);Z.errors.push(`Failed to generate service worker: ${Q}`),Z.success=!1}return Z}function ED(X,$){return z$(X,$)}function DD(X){return X.pwa?.enabled===!0}export{JF as validateManifest,HD as runPwaAudit,AN as registerPwaDirectives,Aj as pwaUpdateDirective,Nj as pwaPushDirective,Rj as pwaOfflineDirective,Vj as pwaInstallDirective,z3 as pwaDirectives,ED as processPwaHtml,YF as mergeManifestConfig,q2 as isWorkboxEnabled,a4 as isSharpAvailable,DD as isPwaEnabled,z$ as injectPwaTags,j5 as getServiceWorkerFileName,nL as getExpectedIconPaths,ZU as generateThemeColorMeta,XU as generateSwRegistrationScript,eK as generateServiceWorkerAuto,$X as generateServiceWorker,ZX as generatePwaTags,s4 as generatePwaIcons,XX as generatePrecacheManifestJs,f1 as generatePrecacheManifest,EK as generateOfflinePage,$U as generateManifestLink,U2 as generateManifestJson,KU as generateManifest,e4 as formatSize,OD as formatAuditResult,mL as calculateAuditResult,ID as buildPwaAssets,uL as auditConfig,dL as auditBuildOutput,o4 as FAVICON_SIZES,n4 as DEFAULT_ICON_SIZES,r4 as APPLE_TOUCH_ICON_SIZES};
16577
+ `)}j3();YX();o5();s5();async function DD(X,$){let Z={success:!0,files:{icons:[]},errors:[],warnings:[]},Y=X.pwa;if(!Y?.enabled)return Z;try{pL.mkdirSync($,{recursive:!0})}catch{return Z.errors.push(`Failed to create output directory: ${$}`),Z.success=!1,Z}try{let G=U2(X);if(G){let Q=l4.join($,"manifest.json");await Bun.write(Q,G),Z.files.manifest=Q}}catch(G){let Q=G instanceof Error?G.message:String(G);Z.errors.push(`Failed to generate manifest.json: ${Q}`),Z.success=!1}if(Y.icons?.src)if(await a4()){let Q=await s4(X,$);if(Z.files.icons=Q.generatedFiles,Z.warnings.push(...Q.warnings),!Q.success)Z.errors.push(...Q.errors),Z.success=!1}else Z.warnings.push("sharp is not installed. Skipping icon generation. Install with: bun add sharp");if(Y.offline?.enabled)try{let G=await EK(X);if(G){let Q=l4.join($,"offline.html");await Bun.write(Q,G),Z.files.offlinePage=Q}}catch(G){let Q=G instanceof Error?G.message:String(G);Z.errors.push(`Failed to generate offline page: ${Q}`),Z.success=!1}let J;if(Y.precache?.enabled){let G=f1($,X);J={fileCount:G.fileCount,totalSize:G.totalSize},Z.precacheStats=J}try{let G=$X(X,$);if(G){let Q=j5(X),q=l4.join($,Q);await Bun.write(q,G),Z.files.serviceWorker=q}}catch(G){let Q=G instanceof Error?G.message:String(G);Z.errors.push(`Failed to generate service worker: ${Q}`),Z.success=!1}return Z}function yD(X,$){return z$(X,$)}function bD(X){return X.pwa?.enabled===!0}export{QF as validateManifest,LD as runPwaAudit,NN as registerPwaDirectives,Aj as pwaUpdateDirective,Nj as pwaPushDirective,Rj as pwaOfflineDirective,Vj as pwaInstallDirective,z3 as pwaDirectives,yD as processPwaHtml,GF as mergeManifestConfig,q2 as isWorkboxEnabled,a4 as isSharpAvailable,bD as isPwaEnabled,z$ as injectPwaTags,j5 as getServiceWorkerFileName,oL as getExpectedIconPaths,ZU as generateThemeColorMeta,XU as generateSwRegistrationScript,eK as generateServiceWorkerAuto,$X as generateServiceWorker,ZX as generatePwaTags,s4 as generatePwaIcons,XX as generatePrecacheManifestJs,f1 as generatePrecacheManifest,EK as generateOfflinePage,$U as generateManifestLink,U2 as generateManifestJson,KU as generateManifest,e4 as formatSize,FD as formatAuditResult,cL as calculateAuditResult,DD as buildPwaAssets,mL as auditConfig,lL as auditBuildOutput,o4 as FAVICON_SIZES,n4 as DEFAULT_ICON_SIZES,r4 as APPLE_TOUCH_ICON_SIZES};