@stacksjs/stx 0.2.358 → 0.2.360

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.
Files changed (161) hide show
  1. package/dist/{chunk-wkyt4j9e.js → chunk-0dkaztpp.js} +1 -1
  2. package/dist/{chunk-jmdxn2mq.js → chunk-0p52xkk9.js} +1 -1
  3. package/dist/{chunk-3y8vvkar.js → chunk-0ppgyq8q.js} +1 -1
  4. package/dist/{chunk-0dj2gne3.js → chunk-0vrn78j5.js} +1 -1
  5. package/dist/chunk-0vvqxeq3.js +2 -0
  6. package/dist/{chunk-2gtwha4k.js → chunk-0w12p79j.js} +1 -1
  7. package/dist/chunk-11hfa3kp.js +2 -0
  8. package/dist/{chunk-19m7hed6.js → chunk-135mme4g.js} +1 -1
  9. package/dist/{chunk-ms25gb16.js → chunk-175da6nh.js} +1 -1
  10. package/dist/{chunk-hy79zwyy.js → chunk-198fr2d4.js} +1 -1
  11. package/dist/{chunk-e48050x3.js → chunk-1c2k7713.js} +1 -1
  12. package/dist/{chunk-2s3wvns6.js → chunk-1e0jj83h.js} +1 -1
  13. package/dist/{chunk-f72c62s7.js → chunk-1hvxs7rh.js} +1 -1
  14. package/dist/chunk-1tfhw9c0.js +2 -0
  15. package/dist/{chunk-q4kgqqed.js → chunk-1tz8fb87.js} +2 -2
  16. package/dist/{chunk-3ssjb8cx.js → chunk-2119txb8.js} +201 -201
  17. package/dist/{chunk-mdbj7sq8.js → chunk-2c907a77.js} +1 -1
  18. package/dist/{chunk-ez003q74.js → chunk-2xpdcr8c.js} +1 -1
  19. package/dist/{chunk-qnptmtqh.js → chunk-3v63btq1.js} +1 -1
  20. package/dist/{chunk-7v1g7prf.js → chunk-3xspzgrq.js} +1 -1
  21. package/dist/{chunk-tf16jtj4.js → chunk-4arms0am.js} +1 -1
  22. package/dist/chunk-4qhhbzx9.js +2 -0
  23. package/dist/{chunk-rydb5n5b.js → chunk-5fzgdrfy.js} +1 -1
  24. package/dist/{chunk-nybn003d.js → chunk-5j3v0p6s.js} +1 -1
  25. package/dist/{chunk-x5b8az2h.js → chunk-5mjz2qgs.js} +1 -1
  26. package/dist/chunk-6nf5g9bh.js +2 -0
  27. package/dist/chunk-6pdfvpa6.js +2 -0
  28. package/dist/chunk-71gg4a7z.js +2 -0
  29. package/dist/chunk-7k7vqrj3.js +2 -0
  30. package/dist/{chunk-0smr2xjs.js → chunk-7kfv1q2r.js} +1 -1
  31. package/dist/chunk-7ppey2yt.js +2 -0
  32. package/dist/{chunk-aa8015mk.js → chunk-7racewc5.js} +1 -1
  33. package/dist/{chunk-t23kccpz.js → chunk-7rj4h2t2.js} +2 -2
  34. package/dist/{chunk-apbr1kb1.js → chunk-7wj5je2t.js} +1 -1
  35. package/dist/{chunk-284kattb.js → chunk-83af26bs.js} +1 -1
  36. package/dist/{chunk-qrvey4wk.js → chunk-84577w4y.js} +1 -1
  37. package/dist/{chunk-9qdn9y72.js → chunk-89xwdc1d.js} +1 -1
  38. package/dist/{chunk-f2jypsax.js → chunk-8akj7f4h.js} +1 -1
  39. package/dist/chunk-8e6fgnk5.js +2 -0
  40. package/dist/chunk-93z5qt1s.js +2 -0
  41. package/dist/{chunk-94dz7hrj.js → chunk-a5cybvfv.js} +1 -1
  42. package/dist/{chunk-a4jhcbsh.js → chunk-a68y9s2j.js} +2 -2
  43. package/dist/{chunk-m0eg86q3.js → chunk-b381xgvw.js} +1 -1
  44. package/dist/{chunk-dtdwjpvf.js → chunk-bab01mkf.js} +1 -1
  45. package/dist/{chunk-79fj9zem.js → chunk-benx1c4p.js} +1 -1
  46. package/dist/chunk-bqm306xw.js +2 -0
  47. package/dist/chunk-bxkr3ts9.js +2 -0
  48. package/dist/{chunk-hcf8399w.js → chunk-ct8tvahc.js} +1 -1
  49. package/dist/chunk-d0350ak9.js +2 -0
  50. package/dist/chunk-d5gzma79.js +2 -0
  51. package/dist/{chunk-kjd9hbg4.js → chunk-dj24n5n7.js} +3 -3
  52. package/dist/{chunk-hkrzv980.js → chunk-dnard9gp.js} +2 -2
  53. package/dist/{chunk-sa6cgj9h.js → chunk-dwyad9gb.js} +1 -1
  54. package/dist/{chunk-trva71am.js → chunk-e03m4har.js} +2 -2
  55. package/dist/{chunk-c17ybabd.js → chunk-enjfp0tp.js} +1 -1
  56. package/dist/chunk-erbyg322.js +2 -0
  57. package/dist/chunk-g6av70d6.js +2 -0
  58. package/dist/{chunk-j6kec9kp.js → chunk-g8k2zj4z.js} +1 -1
  59. package/dist/chunk-gzr4mcp2.js +2 -0
  60. package/dist/{chunk-awyyskad.js → chunk-hkq7d4t2.js} +1 -1
  61. package/dist/{chunk-ykevda74.js → chunk-jc6wrxrh.js} +2 -2
  62. package/dist/{chunk-rcbt11p8.js → chunk-k11mck47.js} +1 -1
  63. package/dist/{chunk-3kd0zn9c.js → chunk-k91ej0ts.js} +1 -1
  64. package/dist/{chunk-tv04k7gq.js → chunk-karkhcja.js} +1 -1
  65. package/dist/{chunk-5270fyk7.js → chunk-kd95t585.js} +1 -1
  66. package/dist/{chunk-emjmshj8.js → chunk-m8kem5ca.js} +1 -1
  67. package/dist/{chunk-n5tpqzcb.js → chunk-m8nmsr4g.js} +1 -1
  68. package/dist/{chunk-v1qm7p7t.js → chunk-masf0yq5.js} +2 -2
  69. package/dist/{chunk-czj6nq0b.js → chunk-met6wtbk.js} +2 -2
  70. package/dist/{chunk-ep034wt0.js → chunk-mzrejx5e.js} +1 -1
  71. package/dist/chunk-n6eg071x.js +2 -0
  72. package/dist/chunk-nabannen.js +2 -0
  73. package/dist/{chunk-wz4fnsat.js → chunk-necx4e30.js} +1 -1
  74. package/dist/chunk-p1ycxzwx.js +2 -0
  75. package/dist/{chunk-7jcntsp4.js → chunk-p41s1y4v.js} +1 -1
  76. package/dist/{chunk-j8wycqve.js → chunk-pf8575bx.js} +1 -1
  77. package/dist/{chunk-b8ywrx2w.js → chunk-pt74619a.js} +1 -1
  78. package/dist/{chunk-krt45cqy.js → chunk-pwctc0m1.js} +1 -1
  79. package/dist/{chunk-degz74nv.js → chunk-qg0w5tjb.js} +1 -1
  80. package/dist/{chunk-z50ex86m.js → chunk-r55bx7r8.js} +1 -1
  81. package/dist/chunk-r6sacvqn.js +2 -0
  82. package/dist/{chunk-6yfccnr7.js → chunk-r6xmsxaz.js} +1 -1
  83. package/dist/{chunk-3kyydhzt.js → chunk-r7q89mv2.js} +1 -1
  84. package/dist/{chunk-ec8jsqgm.js → chunk-rargfb5s.js} +2 -2
  85. package/dist/chunk-s3q7k0bf.js +2 -0
  86. package/dist/{chunk-6qhatdte.js → chunk-s4jbvdx3.js} +2 -2
  87. package/dist/chunk-sd57d9bq.js +2 -0
  88. package/dist/chunk-syxe0cyd.js +2 -0
  89. package/dist/{chunk-6gsgayq3.js → chunk-t9m81dj8.js} +1 -1
  90. package/dist/{chunk-zxfejz72.js → chunk-ta6z7k4p.js} +1 -1
  91. package/dist/chunk-tfjv0567.js +2 -0
  92. package/dist/{chunk-kyyt9xhs.js → chunk-v90kxg77.js} +1 -1
  93. package/dist/{chunk-czypgdc1.js → chunk-vcdd231w.js} +1 -1
  94. package/dist/{chunk-qbz6yn8c.js → chunk-vgx5077x.js} +2 -2
  95. package/dist/{chunk-gn2qc03b.js → chunk-vj5ywxmb.js} +1 -1
  96. package/dist/chunk-vnwzzw9j.js +2 -0
  97. package/dist/{chunk-rtfwn4cm.js → chunk-vsqx756d.js} +1 -1
  98. package/dist/{chunk-cf9gt3h9.js → chunk-vyhrzsnf.js} +10 -10
  99. package/dist/{chunk-ejwfnttb.js → chunk-w1asc0zd.js} +1 -1
  100. package/dist/{chunk-f11z7q5g.js → chunk-x0c5vqss.js} +1 -1
  101. package/dist/{chunk-zxnf0c9x.js → chunk-x6c2t5dv.js} +1 -1
  102. package/dist/{chunk-h99qxgbr.js → chunk-xb23pzwa.js} +1 -1
  103. package/dist/{chunk-eg8k598q.js → chunk-xb2fcf36.js} +1 -1
  104. package/dist/{chunk-1nnza3m6.js → chunk-xk402w4a.js} +1 -1
  105. package/dist/chunk-xn226qe0.js +2 -0
  106. package/dist/{chunk-aacfyyya.js → chunk-xnbbnbtm.js} +1 -1
  107. package/dist/{chunk-n1y0hjk1.js → chunk-ypgyhr2p.js} +1 -1
  108. package/dist/{chunk-hh0aaxxy.js → chunk-z2rvc8d5.js} +2 -2
  109. package/dist/chunk-za8wxkx6.js +2 -0
  110. package/dist/{chunk-8xjasa91.js → chunk-zd172hvg.js} +1 -1
  111. package/dist/{chunk-4gtsf1xw.js → chunk-zf66zyyy.js} +1 -1
  112. package/dist/chunk-zmvgsgtd.js +2 -0
  113. package/dist/{chunk-0c49cy69.js → chunk-zxf0deg6.js} +1 -1
  114. package/dist/{chunk-mere396d.js → chunk-zxptxz2b.js} +1 -1
  115. package/dist/cli.js +14 -14
  116. package/dist/client-declarations.d.ts +24 -0
  117. package/dist/client-declarations.js +33 -0
  118. package/dist/client-script.js +2 -33
  119. package/dist/craft-entry.js +1 -1
  120. package/dist/craft.js +1 -1
  121. package/dist/database.js +1 -1
  122. package/dist/loop-binding.d.ts +23 -0
  123. package/dist/loop-binding.js +12 -0
  124. package/dist/loops.d.ts +20 -23
  125. package/dist/loops.js +9 -13
  126. package/dist/pwa.js +2 -2
  127. package/dist/ssg.js +2 -2
  128. package/dist/stx-virtual-ts.d.ts +27 -0
  129. package/dist/stx-virtual-ts.js +57 -10
  130. package/dist/visual-testing.js +1 -1
  131. package/package.json +5 -5
  132. package/dist/chunk-0chkqvs1.js +0 -2
  133. package/dist/chunk-0d6qgbks.js +0 -2
  134. package/dist/chunk-2x3zy811.js +0 -2
  135. package/dist/chunk-38mpg3kn.js +0 -2
  136. package/dist/chunk-3f782ywp.js +0 -2
  137. package/dist/chunk-4mkqzhfh.js +0 -2
  138. package/dist/chunk-54w1tgzq.js +0 -2
  139. package/dist/chunk-5x0zjm34.js +0 -2
  140. package/dist/chunk-7nf8azjh.js +0 -2
  141. package/dist/chunk-8wgsjh65.js +0 -2
  142. package/dist/chunk-a6x0czvr.js +0 -2
  143. package/dist/chunk-abtxpqna.js +0 -2
  144. package/dist/chunk-c4rpdtvw.js +0 -2
  145. package/dist/chunk-cgs5xpsn.js +0 -2
  146. package/dist/chunk-dpyc7pht.js +0 -2
  147. package/dist/chunk-e0f3qs59.js +0 -2
  148. package/dist/chunk-f3eb1f6z.js +0 -2
  149. package/dist/chunk-fzq2n865.js +0 -2
  150. package/dist/chunk-g3cmkyk2.js +0 -2
  151. package/dist/chunk-gxgrzeeh.js +0 -2
  152. package/dist/chunk-p78b80dp.js +0 -2
  153. package/dist/chunk-pr3hz3ec.js +0 -2
  154. package/dist/chunk-skdfq4hq.js +0 -2
  155. package/dist/chunk-w1a8dwgx.js +0 -2
  156. package/dist/chunk-w9gserf7.js +0 -2
  157. package/dist/chunk-x131a0jq.js +0 -2
  158. package/dist/chunk-xk782v5z.js +0 -2
  159. package/dist/chunk-xxrv2p42.js +0 -2
  160. package/dist/chunk-ynj1y0qm.js +0 -2
  161. package/dist/chunk-z8gccz1q.js +0 -2
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{a as x,b as u,c as b,d as Az,e as G,f as d,h as y,i as I,j as Uz,k as v}from"./chunk-0y46fbkx.js";import{l as h,m as f,n as g}from"./chunk-q9n5swx7.js";import{Io as V}from"./chunk-3ssjb8cx.js";import"./chunk-ykevda74.js";import"./chunk-ez003q74.js";import"./chunk-kyyt9xhs.js";import"./chunk-tf16jtj4.js";import"./chunk-19m7hed6.js";import"./chunk-kjd9hbg4.js";import"./chunk-ejwfnttb.js";import"./chunk-5270fyk7.js";import"./chunk-q4kgqqed.js";import"./chunk-1nnza3m6.js";import"./chunk-hkrzv980.js";import"./chunk-qbz6yn8c.js";import"./chunk-czj6nq0b.js";import"./chunk-zxfejz72.js";import"./chunk-mere396d.js";import"./chunk-aa8015mk.js";import"./chunk-trva71am.js";import"./chunk-rtfwn4cm.js";import{Rw as F}from"./chunk-emjmshj8.js";import l from"fs";import R from"path";function m(z,J){let Z=[R.join(z.root,"stx.config.ts"),R.join(z.root,"stx.config.js"),R.join(z.root,"stx.config.mjs")],K=J.debounceMs??300,$=null,X=[];for(let B of Z)try{if(!l.existsSync(B))continue;let Y=l.watch(B,(W)=>{if(W==="change"){if($)clearTimeout($);$=setTimeout(async()=>{d("Config file changed, restarting...");try{await J.onChange()}catch(j){G(`Failed to restart: ${j}`)}},K)}});X.push(Y)}catch{}return{stop(){if($)clearTimeout($);for(let B of X)B.close()}}}import E from"fs";import i from"path";var Gz=".stx/story/analytics.json",Nz=1,c=1e4;class M{storage;storagePath;currentSession=null;dirty=!1;viewStartTimes=new Map;constructor(z){this.storagePath=i.join(z,Gz),this.storage=this.loadStorage(),this.startSession()}loadStorage(){try{let z=E.readFileSync(this.storagePath,"utf-8");return JSON.parse(z)}catch{return{version:Nz,events:[],sessions:[]}}}async save(){if(!this.dirty)return;let z=i.dirname(this.storagePath);if(await E.promises.mkdir(z,{recursive:!0}),this.storage.events.length>c)this.storage.events=this.storage.events.slice(-c);await E.promises.writeFile(this.storagePath,JSON.stringify(this.storage,null,2)),this.dirty=!1}startSession(){this.endSession(),this.currentSession={id:Hz(),startTime:Date.now(),componentViews:[]},this.storage.sessions.push(this.currentSession),this.dirty=!0}endSession(){if(this.currentSession)this.currentSession.endTime=Date.now(),this.currentSession=null}track(z){this.storage.events.push({...z,timestamp:Date.now()}),this.dirty=!0}trackView(z,J){if(this.endViewTiming(z),this.viewStartTimes.set(z,Date.now()),this.track({type:"view",componentId:z,variantId:J}),this.currentSession&&!this.currentSession.componentViews.includes(z))this.currentSession.componentViews.push(z)}endViewTiming(z){let J=this.viewStartTimes.get(z);if(J){let Z=Date.now()-J;this.track({type:"view",componentId:z,metadata:{duration:Z,endView:!0}}),this.viewStartTimes.delete(z)}}trackPropChange(z,J,Z){this.track({type:"prop_change",componentId:z,propName:J,metadata:{value:Z}})}trackVariantSwitch(z,J){this.track({type:"variant_switch",componentId:z,variantId:J})}trackSearch(z,J){this.track({type:"search",query:z,metadata:{resultCount:J}})}getComponentAnalytics(z,J){let Z=this.storage.events.filter((Q)=>Q.componentId===z),K=Z.filter((Q)=>Q.type==="view"&&!Q.metadata?.endView),$=Z.filter((Q)=>Q.type==="prop_change"),X=Z.filter((Q)=>Q.type==="variant_switch"),B={};for(let Q of $)if(Q.propName)B[Q.propName]=(B[Q.propName]||0)+1;let Y={};for(let Q of X)if(Q.variantId)Y[Q.variantId]=(Y[Q.variantId]||0)+1;let W=new Set(this.storage.sessions.filter((Q)=>Q.componentViews.includes(z)).map((Q)=>Q.id)),j=Z.filter((Q)=>Q.metadata?.duration).map((Q)=>Q.metadata.duration),U=j.length>0?j.reduce((Q,D)=>Q+D,0)/j.length:0,_=Object.entries(B).sort((Q,D)=>D[1]-Q[1]).slice(0,5).map(([Q])=>Q);return{componentId:z,componentName:J,viewCount:K.length,uniqueViews:W.size,lastViewed:K[K.length-1]?.timestamp,propChanges:B,topChangedProps:_,variantViews:Y,avgTimeSpent:U}}getMostViewedComponents(z=10){let J=new Map;for(let Z of this.storage.events)if(Z.type==="view"&&Z.componentId&&!Z.metadata?.endView)J.set(Z.componentId,(J.get(Z.componentId)||0)+1);return Array.from(J.entries()).map(([Z,K])=>({componentId:Z,viewCount:K})).sort((Z,K)=>K.viewCount-Z.viewCount).slice(0,z)}getMostChangedProps(z=10){let J=new Map;for(let Z of this.storage.events)if(Z.type==="prop_change"&&Z.propName)J.set(Z.propName,(J.get(Z.propName)||0)+1);return Array.from(J.entries()).map(([Z,K])=>({propName:Z,changeCount:K})).sort((Z,K)=>K.changeCount-Z.changeCount).slice(0,z)}getSearchAnalytics(){let z=this.storage.events.filter(($)=>$.type==="search"),J=new Map,Z=0;for(let $ of z){if($.query)J.set($.query,(J.get($.query)||0)+1);if($.metadata?.resultCount!==void 0)Z+=$.metadata.resultCount}let K=Array.from(J.entries()).map(([$,X])=>({query:$,count:X})).sort(($,X)=>X.count-$.count).slice(0,10);return{totalSearches:z.length,topQueries:K,avgResultCount:z.length>0?Z/z.length:0}}clear(){this.storage.events=[],this.storage.sessions=[],this.dirty=!0,this.startSession()}exportAnalytics(){return JSON.stringify({exportedAt:Date.now(),...this.storage},null,2)}}function Hz(){return`session-${Date.now()}-${Math.random().toString(36).slice(2,8)}`}import P from"fs";import p from"path";var Fz=".stx/story/bookmarks.json",Vz=1;class T{storage;storagePath;dirty=!1;constructor(z){this.storagePath=p.join(z,Fz),this.storage=this.loadStorage()}loadStorage(){try{let z=P.readFileSync(this.storagePath,"utf-8");return JSON.parse(z)}catch{return{version:Vz,bookmarks:[]}}}async save(){if(!this.dirty)return;let z=p.dirname(this.storagePath);await P.promises.mkdir(z,{recursive:!0}),await P.promises.writeFile(this.storagePath,JSON.stringify(this.storage,null,2)),this.dirty=!1}addBookmark(z,J,Z,K={}){let $={id:Rz(),name:K.name||`${z}/${J}`,storyId:z,variantId:J,props:Z,created:Date.now(),notes:K.notes,color:K.color};return this.storage.bookmarks.push($),this.dirty=!0,$}getAllBookmarks(){return[...this.storage.bookmarks]}getBookmarksForStory(z){return this.storage.bookmarks.filter((J)=>J.storyId===z)}getBookmark(z){return this.storage.bookmarks.find((J)=>J.id===z)}isBookmarked(z,J){return this.storage.bookmarks.some((Z)=>Z.storyId===z&&Z.variantId===J)}updateBookmark(z,J){let Z=this.getBookmark(z);if(!Z)return;return Object.assign(Z,J),this.dirty=!0,Z}deleteBookmark(z){let J=this.storage.bookmarks.findIndex((Z)=>Z.id===z);if(J===-1)return!1;return this.storage.bookmarks.splice(J,1),this.dirty=!0,!0}toggleBookmark(z,J,Z){let K=this.storage.bookmarks.find((X)=>X.storyId===z&&X.variantId===J);if(K)return this.deleteBookmark(K.id),{added:!1};return{added:!0,bookmark:this.addBookmark(z,J,Z)}}exportBookmarks(){return JSON.stringify(this.storage,null,2)}importBookmarks(z,J=!0){let Z=JSON.parse(z),K=0;for(let $ of Z.bookmarks){if(J){let X=this.storage.bookmarks.find((B)=>B.id===$.id);if(X)Object.assign(X,$);else this.storage.bookmarks.push($)}else this.storage.bookmarks.push($);K++}if(K>0)this.dirty=!0;return K}}function Rz(){return`bm-${Date.now()}-${Math.random().toString(36).slice(2,8)}`}var N=new Set;function s(){return{open(z){N.add(z),z.send(JSON.stringify({type:"connected",timestamp:Date.now()}))},close(z){N.delete(z)},message(z,J){}}}function q(z){let J=JSON.stringify({...z,timestamp:z.timestamp||Date.now()});for(let Z of N)try{Z.send(J)}catch{N.delete(Z)}}function n(z,J){q({type:"story-update",data:{storyId:z,...J}})}function a(z,J){q({type:"story-add",data:{storyId:z,...J}})}function o(z){q({type:"story-remove",data:{storyId:z}})}function r(z){return`
2
+ import{a as x,b as u,c as b,d as Az,e as G,f as d,h as y,i as I,j as Uz,k as v}from"./chunk-0y46fbkx.js";import{l as h,m as f,n as g}from"./chunk-q9n5swx7.js";import{Io as V}from"./chunk-2119txb8.js";import"./chunk-jc6wrxrh.js";import"./chunk-2xpdcr8c.js";import"./chunk-v90kxg77.js";import"./chunk-4arms0am.js";import"./chunk-135mme4g.js";import"./chunk-dj24n5n7.js";import"./chunk-w1asc0zd.js";import"./chunk-kd95t585.js";import"./chunk-1tz8fb87.js";import"./chunk-xk402w4a.js";import"./chunk-dnard9gp.js";import"./chunk-vgx5077x.js";import"./chunk-met6wtbk.js";import"./chunk-ta6z7k4p.js";import"./chunk-zxptxz2b.js";import"./chunk-7racewc5.js";import"./chunk-e03m4har.js";import"./chunk-vsqx756d.js";import{Sw as F}from"./chunk-m8kem5ca.js";import l from"fs";import R from"path";function m(z,J){let Z=[R.join(z.root,"stx.config.ts"),R.join(z.root,"stx.config.js"),R.join(z.root,"stx.config.mjs")],K=J.debounceMs??300,$=null,X=[];for(let B of Z)try{if(!l.existsSync(B))continue;let Y=l.watch(B,(W)=>{if(W==="change"){if($)clearTimeout($);$=setTimeout(async()=>{d("Config file changed, restarting...");try{await J.onChange()}catch(j){G(`Failed to restart: ${j}`)}},K)}});X.push(Y)}catch{}return{stop(){if($)clearTimeout($);for(let B of X)B.close()}}}import E from"fs";import i from"path";var Gz=".stx/story/analytics.json",Nz=1,c=1e4;class M{storage;storagePath;currentSession=null;dirty=!1;viewStartTimes=new Map;constructor(z){this.storagePath=i.join(z,Gz),this.storage=this.loadStorage(),this.startSession()}loadStorage(){try{let z=E.readFileSync(this.storagePath,"utf-8");return JSON.parse(z)}catch{return{version:Nz,events:[],sessions:[]}}}async save(){if(!this.dirty)return;let z=i.dirname(this.storagePath);if(await E.promises.mkdir(z,{recursive:!0}),this.storage.events.length>c)this.storage.events=this.storage.events.slice(-c);await E.promises.writeFile(this.storagePath,JSON.stringify(this.storage,null,2)),this.dirty=!1}startSession(){this.endSession(),this.currentSession={id:Hz(),startTime:Date.now(),componentViews:[]},this.storage.sessions.push(this.currentSession),this.dirty=!0}endSession(){if(this.currentSession)this.currentSession.endTime=Date.now(),this.currentSession=null}track(z){this.storage.events.push({...z,timestamp:Date.now()}),this.dirty=!0}trackView(z,J){if(this.endViewTiming(z),this.viewStartTimes.set(z,Date.now()),this.track({type:"view",componentId:z,variantId:J}),this.currentSession&&!this.currentSession.componentViews.includes(z))this.currentSession.componentViews.push(z)}endViewTiming(z){let J=this.viewStartTimes.get(z);if(J){let Z=Date.now()-J;this.track({type:"view",componentId:z,metadata:{duration:Z,endView:!0}}),this.viewStartTimes.delete(z)}}trackPropChange(z,J,Z){this.track({type:"prop_change",componentId:z,propName:J,metadata:{value:Z}})}trackVariantSwitch(z,J){this.track({type:"variant_switch",componentId:z,variantId:J})}trackSearch(z,J){this.track({type:"search",query:z,metadata:{resultCount:J}})}getComponentAnalytics(z,J){let Z=this.storage.events.filter((Q)=>Q.componentId===z),K=Z.filter((Q)=>Q.type==="view"&&!Q.metadata?.endView),$=Z.filter((Q)=>Q.type==="prop_change"),X=Z.filter((Q)=>Q.type==="variant_switch"),B={};for(let Q of $)if(Q.propName)B[Q.propName]=(B[Q.propName]||0)+1;let Y={};for(let Q of X)if(Q.variantId)Y[Q.variantId]=(Y[Q.variantId]||0)+1;let W=new Set(this.storage.sessions.filter((Q)=>Q.componentViews.includes(z)).map((Q)=>Q.id)),j=Z.filter((Q)=>Q.metadata?.duration).map((Q)=>Q.metadata.duration),U=j.length>0?j.reduce((Q,D)=>Q+D,0)/j.length:0,_=Object.entries(B).sort((Q,D)=>D[1]-Q[1]).slice(0,5).map(([Q])=>Q);return{componentId:z,componentName:J,viewCount:K.length,uniqueViews:W.size,lastViewed:K[K.length-1]?.timestamp,propChanges:B,topChangedProps:_,variantViews:Y,avgTimeSpent:U}}getMostViewedComponents(z=10){let J=new Map;for(let Z of this.storage.events)if(Z.type==="view"&&Z.componentId&&!Z.metadata?.endView)J.set(Z.componentId,(J.get(Z.componentId)||0)+1);return Array.from(J.entries()).map(([Z,K])=>({componentId:Z,viewCount:K})).sort((Z,K)=>K.viewCount-Z.viewCount).slice(0,z)}getMostChangedProps(z=10){let J=new Map;for(let Z of this.storage.events)if(Z.type==="prop_change"&&Z.propName)J.set(Z.propName,(J.get(Z.propName)||0)+1);return Array.from(J.entries()).map(([Z,K])=>({propName:Z,changeCount:K})).sort((Z,K)=>K.changeCount-Z.changeCount).slice(0,z)}getSearchAnalytics(){let z=this.storage.events.filter(($)=>$.type==="search"),J=new Map,Z=0;for(let $ of z){if($.query)J.set($.query,(J.get($.query)||0)+1);if($.metadata?.resultCount!==void 0)Z+=$.metadata.resultCount}let K=Array.from(J.entries()).map(([$,X])=>({query:$,count:X})).sort(($,X)=>X.count-$.count).slice(0,10);return{totalSearches:z.length,topQueries:K,avgResultCount:z.length>0?Z/z.length:0}}clear(){this.storage.events=[],this.storage.sessions=[],this.dirty=!0,this.startSession()}exportAnalytics(){return JSON.stringify({exportedAt:Date.now(),...this.storage},null,2)}}function Hz(){return`session-${Date.now()}-${Math.random().toString(36).slice(2,8)}`}import P from"fs";import p from"path";var Fz=".stx/story/bookmarks.json",Vz=1;class T{storage;storagePath;dirty=!1;constructor(z){this.storagePath=p.join(z,Fz),this.storage=this.loadStorage()}loadStorage(){try{let z=P.readFileSync(this.storagePath,"utf-8");return JSON.parse(z)}catch{return{version:Vz,bookmarks:[]}}}async save(){if(!this.dirty)return;let z=p.dirname(this.storagePath);await P.promises.mkdir(z,{recursive:!0}),await P.promises.writeFile(this.storagePath,JSON.stringify(this.storage,null,2)),this.dirty=!1}addBookmark(z,J,Z,K={}){let $={id:Rz(),name:K.name||`${z}/${J}`,storyId:z,variantId:J,props:Z,created:Date.now(),notes:K.notes,color:K.color};return this.storage.bookmarks.push($),this.dirty=!0,$}getAllBookmarks(){return[...this.storage.bookmarks]}getBookmarksForStory(z){return this.storage.bookmarks.filter((J)=>J.storyId===z)}getBookmark(z){return this.storage.bookmarks.find((J)=>J.id===z)}isBookmarked(z,J){return this.storage.bookmarks.some((Z)=>Z.storyId===z&&Z.variantId===J)}updateBookmark(z,J){let Z=this.getBookmark(z);if(!Z)return;return Object.assign(Z,J),this.dirty=!0,Z}deleteBookmark(z){let J=this.storage.bookmarks.findIndex((Z)=>Z.id===z);if(J===-1)return!1;return this.storage.bookmarks.splice(J,1),this.dirty=!0,!0}toggleBookmark(z,J,Z){let K=this.storage.bookmarks.find((X)=>X.storyId===z&&X.variantId===J);if(K)return this.deleteBookmark(K.id),{added:!1};return{added:!0,bookmark:this.addBookmark(z,J,Z)}}exportBookmarks(){return JSON.stringify(this.storage,null,2)}importBookmarks(z,J=!0){let Z=JSON.parse(z),K=0;for(let $ of Z.bookmarks){if(J){let X=this.storage.bookmarks.find((B)=>B.id===$.id);if(X)Object.assign(X,$);else this.storage.bookmarks.push($)}else this.storage.bookmarks.push($);K++}if(K>0)this.dirty=!0;return K}}function Rz(){return`bm-${Date.now()}-${Math.random().toString(36).slice(2,8)}`}var N=new Set;function s(){return{open(z){N.add(z),z.send(JSON.stringify({type:"connected",timestamp:Date.now()}))},close(z){N.delete(z)},message(z,J){}}}function q(z){let J=JSON.stringify({...z,timestamp:z.timestamp||Date.now()});for(let Z of N)try{Z.send(J)}catch{N.delete(Z)}}function n(z,J){q({type:"story-update",data:{storyId:z,...J}})}function a(z,J){q({type:"story-add",data:{storyId:z,...J}})}function o(z){q({type:"story-remove",data:{storyId:z}})}function r(z){return`
3
3
  <script>
4
4
  (function() {
5
5
  const ws = new WebSocket('${z}');
@@ -556,7 +556,7 @@ window.__stxPerformance = {
556
556
 
557
557
  window.clearPerformanceMetrics = () => window.__stxPerformance.clear();
558
558
  </script>
559
- `}import w from"fs";import Xz from"path";var Mz=".stx/story/presets.json",C=1,Pz=10;class k{storage;storagePath;dirty=!1;constructor(z){this.storagePath=Xz.join(z,Mz),this.storage=this.loadStorage()}loadStorage(){try{let z=w.readFileSync(this.storagePath,"utf-8"),J=JSON.parse(z);if(J.version!==C)return this.migrateStorage(J);return J}catch{return{version:C,presets:[],recentIds:[]}}}migrateStorage(z){return{version:C,presets:z.presets||[],recentIds:z.recentIds||[]}}async save(){if(!this.dirty)return;let z=Xz.dirname(this.storagePath);await w.promises.mkdir(z,{recursive:!0}),await w.promises.writeFile(this.storagePath,JSON.stringify(this.storage,null,2)),this.dirty=!1}createPreset(z,J,Z={}){let K={id:Tz(),name:z,description:Z.description,props:J,componentId:Z.componentId,created:Date.now(),usageCount:0,tags:Z.tags};return this.storage.presets.push(K),this.dirty=!0,K}getPreset(z){return this.storage.presets.find((J)=>J.id===z)}getAllPresets(){return[...this.storage.presets]}getPresetsForComponent(z){return this.storage.presets.filter((J)=>!J.componentId||J.componentId===z)}getRecentPresets(){return this.storage.recentIds.map((z)=>this.getPreset(z)).filter((z)=>z!==void 0)}usePreset(z){let J=this.getPreset(z);if(!J)return;return J.lastUsed=Date.now(),J.usageCount++,this.storage.recentIds=[z,...this.storage.recentIds.filter((Z)=>Z!==z)].slice(0,Pz),this.dirty=!0,J}updatePreset(z,J){let Z=this.getPreset(z);if(!Z)return;return Object.assign(Z,J),this.dirty=!0,Z}deletePreset(z){let J=this.storage.presets.findIndex((Z)=>Z.id===z);if(J===-1)return!1;return this.storage.presets.splice(J,1),this.storage.recentIds=this.storage.recentIds.filter((Z)=>Z!==z),this.dirty=!0,!0}searchPresets(z){let J=z.toLowerCase();return this.storage.presets.filter((Z)=>{if(Z.name.toLowerCase().includes(J))return!0;if(Z.description?.toLowerCase().includes(J))return!0;if(Z.tags?.some((K)=>K.toLowerCase().includes(J)))return!0;return!1})}getMostUsedPresets(z=5){return[...this.storage.presets].sort((J,Z)=>Z.usageCount-J.usageCount).slice(0,z)}exportPresets(z){let J=z?this.storage.presets.filter((Z)=>z.includes(Z.id)):this.storage.presets;return JSON.stringify({presets:J},null,2)}importPresets(z,J=!1){let Z=JSON.parse(z),K=0;for(let $ of Z.presets){let X=this.storage.presets.find((B)=>B.id===$.id);if(X&&!J)continue;if(X)Object.assign(X,$);else this.storage.presets.push($);K++}if(K>0)this.dirty=!0;return K}}function Tz(){return`preset-${Date.now()}-${Math.random().toString(36).slice(2,8)}`}import S from"fs";var Qz=new Map;async function H(z,J,Z={}){let K=performance.now(),$=[];try{let X=await S.promises.stat(J),B=Qz.get(J),Y;if(B&&B.mtime===X.mtimeMs)Y=B.content;else Y=await S.promises.readFile(J,"utf-8"),Qz.set(J,{content:Y,mtime:X.mtimeMs,analyzed:null});let{processDirectives:W}=await import("./chunk-38mpg3kn.js"),j={},U=A(Y);if(U)try{await V(U,j,J)}catch(O){$.push(`Warning: Could not extract script variables: ${O instanceof Error?O.message:String(O)}`)}if(Z.props)Object.assign(j,Z.props);let Q=await W(Y,j,J,{},new Set),D=Wz(Y),L=A(Y);return Q=jz(Q),Q=Dz(Q,j),{html:Q,css:D,js:L,errors:$,duration:performance.now()-K}}catch(X){return $.push(X instanceof Error?X.message:String(X)),{html:`<div class="stx-render-error">${Lz($[0])}</div>`,css:"",js:"",errors:$,duration:performance.now()-K}}}async function qz(z){try{let J=await S.promises.readFile(z,"utf-8"),Z=A(J);if(!Z)return null;let K={};if(await V(Z,K,z),Array.isArray(K.variants))return K.variants;return null}catch{return null}}async function Bz(z,J,Z,K){let $=J.story?.variants;if(!$){let Y=await qz(J.path);if(Y)$=Y}if(!$&&Z==="default")return H(z,J.path,{props:K||{}});if(!$)return H(z,J.path,{props:K||{}});let X=$.find((Y)=>Y.id===Z);if(!X&&Z==="default")return H(z,J.path,{props:K||{}});if(!X)return{html:'<div class="stx-render-error">Variant not found</div>',css:"",js:"",errors:[`Variant '${Z}' not found`],duration:0};let B={...X.state,...K};if(X.source)return wz(z,X.source,B);return H(z,J.path,{props:B})}async function wz(z,J,Z={}){let K=performance.now(),$=[];try{let{processDirectives:X}=await import("./chunk-38mpg3kn.js"),B={...Z},Y=A(J);if(Y)try{await V(Y,B,"inline-template.stx")}catch{}let j=await X(J,B,"inline-template.stx",{},new Set);return j=jz(j),j=Dz(j,B),{html:j,css:Wz(J),js:A(J),errors:$,duration:performance.now()-K}}catch(X){return $.push(X instanceof Error?X.message:String(X)),{html:`<div class="stx-render-error">${Lz($[0])}</div>`,css:"",js:"",errors:$,duration:performance.now()-K}}}function Wz(z){let J=[],Z=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,K=Z.exec(z);while(K!==null)J.push(K[1].trim()),K=Z.exec(z);return J.join(`
559
+ `}import w from"fs";import Xz from"path";var Mz=".stx/story/presets.json",C=1,Pz=10;class k{storage;storagePath;dirty=!1;constructor(z){this.storagePath=Xz.join(z,Mz),this.storage=this.loadStorage()}loadStorage(){try{let z=w.readFileSync(this.storagePath,"utf-8"),J=JSON.parse(z);if(J.version!==C)return this.migrateStorage(J);return J}catch{return{version:C,presets:[],recentIds:[]}}}migrateStorage(z){return{version:C,presets:z.presets||[],recentIds:z.recentIds||[]}}async save(){if(!this.dirty)return;let z=Xz.dirname(this.storagePath);await w.promises.mkdir(z,{recursive:!0}),await w.promises.writeFile(this.storagePath,JSON.stringify(this.storage,null,2)),this.dirty=!1}createPreset(z,J,Z={}){let K={id:Tz(),name:z,description:Z.description,props:J,componentId:Z.componentId,created:Date.now(),usageCount:0,tags:Z.tags};return this.storage.presets.push(K),this.dirty=!0,K}getPreset(z){return this.storage.presets.find((J)=>J.id===z)}getAllPresets(){return[...this.storage.presets]}getPresetsForComponent(z){return this.storage.presets.filter((J)=>!J.componentId||J.componentId===z)}getRecentPresets(){return this.storage.recentIds.map((z)=>this.getPreset(z)).filter((z)=>z!==void 0)}usePreset(z){let J=this.getPreset(z);if(!J)return;return J.lastUsed=Date.now(),J.usageCount++,this.storage.recentIds=[z,...this.storage.recentIds.filter((Z)=>Z!==z)].slice(0,Pz),this.dirty=!0,J}updatePreset(z,J){let Z=this.getPreset(z);if(!Z)return;return Object.assign(Z,J),this.dirty=!0,Z}deletePreset(z){let J=this.storage.presets.findIndex((Z)=>Z.id===z);if(J===-1)return!1;return this.storage.presets.splice(J,1),this.storage.recentIds=this.storage.recentIds.filter((Z)=>Z!==z),this.dirty=!0,!0}searchPresets(z){let J=z.toLowerCase();return this.storage.presets.filter((Z)=>{if(Z.name.toLowerCase().includes(J))return!0;if(Z.description?.toLowerCase().includes(J))return!0;if(Z.tags?.some((K)=>K.toLowerCase().includes(J)))return!0;return!1})}getMostUsedPresets(z=5){return[...this.storage.presets].sort((J,Z)=>Z.usageCount-J.usageCount).slice(0,z)}exportPresets(z){let J=z?this.storage.presets.filter((Z)=>z.includes(Z.id)):this.storage.presets;return JSON.stringify({presets:J},null,2)}importPresets(z,J=!1){let Z=JSON.parse(z),K=0;for(let $ of Z.presets){let X=this.storage.presets.find((B)=>B.id===$.id);if(X&&!J)continue;if(X)Object.assign(X,$);else this.storage.presets.push($);K++}if(K>0)this.dirty=!0;return K}}function Tz(){return`preset-${Date.now()}-${Math.random().toString(36).slice(2,8)}`}import S from"fs";var Qz=new Map;async function H(z,J,Z={}){let K=performance.now(),$=[];try{let X=await S.promises.stat(J),B=Qz.get(J),Y;if(B&&B.mtime===X.mtimeMs)Y=B.content;else Y=await S.promises.readFile(J,"utf-8"),Qz.set(J,{content:Y,mtime:X.mtimeMs,analyzed:null});let{processDirectives:W}=await import("./chunk-7k7vqrj3.js"),j={},U=A(Y);if(U)try{await V(U,j,J)}catch(O){$.push(`Warning: Could not extract script variables: ${O instanceof Error?O.message:String(O)}`)}if(Z.props)Object.assign(j,Z.props);let Q=await W(Y,j,J,{},new Set),D=Wz(Y),L=A(Y);return Q=jz(Q),Q=Dz(Q,j),{html:Q,css:D,js:L,errors:$,duration:performance.now()-K}}catch(X){return $.push(X instanceof Error?X.message:String(X)),{html:`<div class="stx-render-error">${Lz($[0])}</div>`,css:"",js:"",errors:$,duration:performance.now()-K}}}async function qz(z){try{let J=await S.promises.readFile(z,"utf-8"),Z=A(J);if(!Z)return null;let K={};if(await V(Z,K,z),Array.isArray(K.variants))return K.variants;return null}catch{return null}}async function Bz(z,J,Z,K){let $=J.story?.variants;if(!$){let Y=await qz(J.path);if(Y)$=Y}if(!$&&Z==="default")return H(z,J.path,{props:K||{}});if(!$)return H(z,J.path,{props:K||{}});let X=$.find((Y)=>Y.id===Z);if(!X&&Z==="default")return H(z,J.path,{props:K||{}});if(!X)return{html:'<div class="stx-render-error">Variant not found</div>',css:"",js:"",errors:[`Variant '${Z}' not found`],duration:0};let B={...X.state,...K};if(X.source)return wz(z,X.source,B);return H(z,J.path,{props:B})}async function wz(z,J,Z={}){let K=performance.now(),$=[];try{let{processDirectives:X}=await import("./chunk-7k7vqrj3.js"),B={...Z},Y=A(J);if(Y)try{await V(Y,B,"inline-template.stx")}catch{}let j=await X(J,B,"inline-template.stx",{},new Set);return j=jz(j),j=Dz(j,B),{html:j,css:Wz(J),js:A(J),errors:$,duration:performance.now()-K}}catch(X){return $.push(X instanceof Error?X.message:String(X)),{html:`<div class="stx-render-error">${Lz($[0])}</div>`,css:"",js:"",errors:$,duration:performance.now()-K}}}function Wz(z){let J=[],Z=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,K=Z.exec(z);while(K!==null)J.push(K[1].trim()),K=Z.exec(z);return J.join(`
560
560
  `)}function jz(z){return z.replace(/<!--[\s\S]*?-->/g,"").replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"").replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/^\s*\n/gm,"").trim()}function A(z){let J=[],Z=/<script\b[^>]*>([\s\S]*?)<\/script>/gi,K=Z.exec(z);while(K!==null)J.push(K[1].trim()),K=Z.exec(z);return J.join(`
561
561
  `)}function Dz(z,J){let Z=`<script>window.__stxProps = ${JSON.stringify(J)};</script>`;return z+Z}function Lz(z){return z.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}async function Oz(z,J){let Z=await I(z);f(z,Z);let K=v(z.config,Z);g(z,K),console.log(` Found ${Z.length} story files`);let $=typeof J.host==="string"?J.host:J.host===!0?"0.0.0.0":"localhost",X=new k(z.root),B=new T(z.root),Y=new M(z.root),W=s(),j=Bun.serve({port:J.port,hostname:$,fetch:async(Q,D)=>{let O=new URL(Q.url).pathname;if(O==="/__hmr"){if(D.upgrade(Q,{data:{isHmr:!0}}))return;return new Response("WebSocket upgrade failed",{status:400})}if(O.startsWith("/api/"))return Cz(z,O,Q,{presetsManager:X,bookmarksManager:B,analyticsTracker:Y});return kz(z,O,J.port)},websocket:{open(Q){W.open(Q)},close(Q){W.close(Q)},message(Q,D){W.message(Q,D)}}}),U=`http://${$}:${J.port}`,_=Uz(z,async(Q,D)=>{console.log(` [${Q}] ${D.relativePath}`);let L=await I(z);f(z,L);let O=v(z.config,L);if(g(z,O),Q==="add")a(D.id,{fileName:D.fileName});else if(Q==="unlink")o(D.id);else n(D.id,{fileName:D.fileName})});if(J.open){let Q=U;try{let{exec:D}=await import("child_process"),L=process.platform;D(`${L==="darwin"?"open":L==="win32"?"start":"xdg-open"} ${Q}`)}catch{}}return{server:j,url:U,close:async()=>{_(),j.stop()}}}async function Cz(z,J,Z,K){let{presetsManager:$,bookmarksManager:X,analyticsTracker:B}=K;if(J==="/api/stories")return Response.json({files:z.storyFiles.map((Y)=>({id:Y.id,fileName:Y.fileName,relativePath:Y.relativePath,treePath:Y.treePath})),tree:z.tree});if(J.startsWith("/api/story/")){let Y=J.slice(11),W=z.storyFiles.find((j)=>j.id===Y);if(!W)return new Response("Story not found",{status:404});try{let j=await Bun.file(W.path).text();return Response.json({id:W.id,fileName:W.fileName,relativePath:W.relativePath,content:j})}catch{return new Response("Error reading story",{status:500})}}if(J==="/api/config")return Response.json({theme:z.config.theme,responsivePresets:z.config.responsivePresets,backgroundPresets:z.config.backgroundPresets});if(J.startsWith("/api/render/")){let Y=new URL(Z.url),W=J.slice(12).split("/"),j=W[0],U=W[1]||"default",_,Q=Y.searchParams.get("props");if(Q)try{_=JSON.parse(Q)}catch{}let D=z.storyFiles.find((L)=>L.id===j);if(!D)return new Response("Story not found",{status:404});try{let L=await Bz(z,D,U,_);return Response.json({html:L.html,css:L.css,js:L.js,errors:L.errors,duration:L.duration})}catch(L){return Response.json({html:"",css:"",js:"",errors:[L instanceof Error?L.message:String(L)],duration:0},{status:500})}}if(J==="/api/presets"&&Z.method==="GET")return Response.json({presets:$.getAllPresets()});if(J==="/api/presets"&&Z.method==="POST")try{let Y=await Z.json(),W=$.createPreset(Y.name,Y.props,{componentId:Y.componentId,description:Y.description});return await $.save(),Response.json(W)}catch(Y){return Response.json({error:String(Y)},{status:400})}if(J.startsWith("/api/presets/")&&!J.includes("/use")&&Z.method==="GET"){let Y=J.slice(13),W=$.getPreset(Y);if(!W)return new Response("Preset not found",{status:404});return Response.json(W)}if(J.endsWith("/use")&&Z.method==="POST"){let Y=J.slice(13,-4),W=$.usePreset(Y);if(!W)return new Response("Preset not found",{status:404});return await $.save(),Response.json(W)}if(J.startsWith("/api/presets/")&&Z.method==="DELETE"){let Y=J.slice(13);if(!$.deletePreset(Y))return new Response("Preset not found",{status:404});return await $.save(),Response.json({success:!0})}if(J==="/api/bookmarks"&&Z.method==="GET")return Response.json({bookmarks:X.getAllBookmarks()});if(J==="/api/bookmarks"&&Z.method==="POST")try{let Y=await Z.json(),W=X.addBookmark(Y.storyId,Y.variantId,Y.props,{name:Y.name,notes:Y.notes,color:Y.color});return await X.save(),Response.json(W)}catch(Y){return Response.json({error:String(Y)},{status:400})}if(J==="/api/bookmarks/toggle"&&Z.method==="POST")try{let Y=await Z.json(),W=X.toggleBookmark(Y.storyId,Y.variantId,Y.props);return await X.save(),Response.json(W)}catch(Y){return Response.json({error:String(Y)},{status:400})}if(J.startsWith("/api/bookmarks/")&&J!=="/api/bookmarks/toggle"&&Z.method==="GET"){let Y=J.slice(15),W=X.getBookmark(Y);if(!W)return new Response("Bookmark not found",{status:404});return Response.json(W)}if(J.startsWith("/api/bookmarks/")&&Z.method==="DELETE"){let Y=J.slice(15);if(!X.deleteBookmark(Y))return new Response("Bookmark not found",{status:404});return await X.save(),Response.json({success:!0})}if(J==="/api/analytics/track"&&Z.method==="POST")try{let Y=await Z.json();if(Y.type==="view"&&Y.componentId)B.trackView(Y.componentId,Y.variantId);else if(Y.type==="prop_change"&&Y.componentId&&Y.propName)B.trackPropChange(Y.componentId,Y.propName,null);else if(Y.type==="variant_switch"&&Y.componentId&&Y.variantId)B.trackVariantSwitch(Y.componentId,Y.variantId);else if(Y.type==="search"&&Y.query)B.trackSearch(Y.query,0);return await B.save(),Response.json({success:!0})}catch(Y){return Response.json({error:String(Y)},{status:400})}if(J==="/api/analytics/summary"&&Z.method==="GET")return Response.json({mostViewed:B.getMostViewedComponents(10),mostChangedProps:B.getMostChangedProps(10),searchAnalytics:B.getSearchAnalytics()});if(J.startsWith("/api/analytics/component/")&&Z.method==="GET"){let Y=J.slice(25),W=z.storyFiles.find((U)=>U.id===Y),j=B.getComponentAnalytics(Y,W?.fileName||Y);return Response.json(j)}return new Response("Not found",{status:404})}function kz(z,J,Z){let K=Sz(z,Z);return new Response(K,{headers:{"Content-Type":"text/html; charset=utf-8"}})}function Sz(z,J){let{theme:Z}=z.config,K=Z.title||"STX Story",$=`ws://localhost:${J}/__hmr`,X=r($);return`<!DOCTYPE html>
562
562
  <html lang="en" class="${Z.darkClass||"dark"}">
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Rw as z}from"./chunk-emjmshj8.js";var Vq={1001:{message:"Unclosed directive: {{directive}}",help:"Make sure to close the directive with the appropriate end tag"},1002:{message:"Unclosed expression at position {{position}}",help:"Check for missing closing braces }}"},1003:{message:"Invalid directive syntax: {{directive}}",help:"Review the directive documentation for correct syntax"},1004:{message:"Malformed expression: {{expression}}",help:"Check for syntax errors in your expression"},1005:{message:"Unexpected token: {{token}}",help:"Remove or fix the unexpected token"},1101:{message:"Undefined variable: {{variable}}",help:"Make sure the variable is defined in the template context"},1102:{message:"Type error: {{details}}",help:"Check that you are using the correct types"},1103:{message:"Evaluation error: {{details}}",help:"Review the expression for errors"},1104:{message:"Infinite loop detected in {{location}}",help:"Check your loop conditions"},1105:{message:"Circular reference detected: {{path}}",help:"Remove the circular dependency"},1201:{message:"Unsafe expression blocked: {{expression}}",help:"This expression contains potentially dangerous code"},1202:{message:"Path traversal attempt blocked: {{path}}",help:"Use only relative paths within allowed directories"},1203:{message:"Potential XSS attempt blocked",help:"Sanitize user input before rendering"},1204:{message:"Code injection attempt blocked: {{code}}",help:"Avoid executing dynamic code"},1205:{message:"Prohibited DOM API usage: {{api}}",help:"Use STX.useRefs(), STX.useRef(), STX.el() and other STX helpers instead of direct DOM manipulation"},1301:{message:"File not found: {{path}}",help:"Check that the file exists and the path is correct"},1302:{message:"Error reading file: {{path}}",help:"Check file permissions and encoding"},1303:{message:"Invalid file path: {{path}}",help:"Use a valid file path"},1304:{message:"Permission denied: {{path}}",help:"Check file permissions"},1401:{message:"Invalid configuration: {{details}}",help:"Review your stx.config.ts file"},1402:{message:"Missing required configuration: {{key}}",help:"Add the required configuration option"},1403:{message:"Deprecated configuration: {{key}}",help:"Update to the new configuration format"},1501:{message:"Component not found: {{name}}",help:"Check that the component exists in your components directory"},1502:{message:"Invalid props for component {{name}}: {{details}}",help:"Check the component prop requirements"},1503:{message:"Error rendering component {{name}}: {{details}}",help:"Check the component template for errors"},1601:{message:"Filter not found: {{filter}}",help:"Register the filter or check the filter name"},1602:{message:"Invalid arguments for filter {{filter}}: {{details}}",help:"Check the filter documentation for correct arguments"},1603:{message:"Expression evaluation timed out",help:"Simplify the expression or increase the timeout"}},L={},u="en";function Gq(q){u=q}function Bq(){return u}function Hq(q){L={...L,...q}}function Wq(){L={}}function f(q,J={}){let Q=L[q]||Vq[q]||{message:`Unknown error (code: ${q})`},Z=Q.message,$=Q.help;for(let[X,V]of Object.entries(J)){let Y=`{{${X}}}`;if(Z=Z.replace(new RegExp(Y,"g"),V),$)$=$.replace(new RegExp(Y,"g"),V)}return{message:Z,help:$}}function Mq(q,J={}){let{message:Q,help:Z}=f(q,J);return Z?`${Q}
2
+ import{Sw as z}from"./chunk-m8kem5ca.js";var Vq={1001:{message:"Unclosed directive: {{directive}}",help:"Make sure to close the directive with the appropriate end tag"},1002:{message:"Unclosed expression at position {{position}}",help:"Check for missing closing braces }}"},1003:{message:"Invalid directive syntax: {{directive}}",help:"Review the directive documentation for correct syntax"},1004:{message:"Malformed expression: {{expression}}",help:"Check for syntax errors in your expression"},1005:{message:"Unexpected token: {{token}}",help:"Remove or fix the unexpected token"},1101:{message:"Undefined variable: {{variable}}",help:"Make sure the variable is defined in the template context"},1102:{message:"Type error: {{details}}",help:"Check that you are using the correct types"},1103:{message:"Evaluation error: {{details}}",help:"Review the expression for errors"},1104:{message:"Infinite loop detected in {{location}}",help:"Check your loop conditions"},1105:{message:"Circular reference detected: {{path}}",help:"Remove the circular dependency"},1201:{message:"Unsafe expression blocked: {{expression}}",help:"This expression contains potentially dangerous code"},1202:{message:"Path traversal attempt blocked: {{path}}",help:"Use only relative paths within allowed directories"},1203:{message:"Potential XSS attempt blocked",help:"Sanitize user input before rendering"},1204:{message:"Code injection attempt blocked: {{code}}",help:"Avoid executing dynamic code"},1205:{message:"Prohibited DOM API usage: {{api}}",help:"Use STX.useRefs(), STX.useRef(), STX.el() and other STX helpers instead of direct DOM manipulation"},1301:{message:"File not found: {{path}}",help:"Check that the file exists and the path is correct"},1302:{message:"Error reading file: {{path}}",help:"Check file permissions and encoding"},1303:{message:"Invalid file path: {{path}}",help:"Use a valid file path"},1304:{message:"Permission denied: {{path}}",help:"Check file permissions"},1401:{message:"Invalid configuration: {{details}}",help:"Review your stx.config.ts file"},1402:{message:"Missing required configuration: {{key}}",help:"Add the required configuration option"},1403:{message:"Deprecated configuration: {{key}}",help:"Update to the new configuration format"},1501:{message:"Component not found: {{name}}",help:"Check that the component exists in your components directory"},1502:{message:"Invalid props for component {{name}}: {{details}}",help:"Check the component prop requirements"},1503:{message:"Error rendering component {{name}}: {{details}}",help:"Check the component template for errors"},1601:{message:"Filter not found: {{filter}}",help:"Register the filter or check the filter name"},1602:{message:"Invalid arguments for filter {{filter}}: {{details}}",help:"Check the filter documentation for correct arguments"},1603:{message:"Expression evaluation timed out",help:"Simplify the expression or increase the timeout"}},L={},u="en";function Gq(q){u=q}function Bq(){return u}function Hq(q){L={...L,...q}}function Wq(){L={}}function f(q,J={}){let Q=L[q]||Vq[q]||{message:`Unknown error (code: ${q})`},Z=Q.message,$=Q.help;for(let[X,V]of Object.entries(J)){let Y=`{{${X}}}`;if(Z=Z.replace(new RegExp(Y,"g"),V),$)$=$.replace(new RegExp(Y,"g"),V)}return{message:Z,help:$}}function Mq(q,J={}){let{message:Q,help:Z}=f(q,J);return Z?`${Q}
3
3
  Help: ${Z}`:Q}var w={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 S(q){for(let[J,Q]of Object.entries(w))if(Q===q)return J;return}function Iq(){return!1}function k(){return!Iq()||process.env.STX_DEBUG==="true"}function aq(){return!1}import wq from"path";var x={showRelativePaths:!1,enableAutoRecovery:k(),logRecoveryWarnings:!0},D={...x};function Fq(q){D={...D,...q}}function _(){return{...D}}function jq(){D={...x}}function N(q){if(!D.showRelativePaths||!q)return q;let J=D.baseDir||process.cwd();try{let Q=wq.relative(J,q);return Q.startsWith("..")?q:Q}catch{return q}}class U extends Error{code;filePath;line;column;context;numericCode;constructor(q,J,Q,Z,$,X,V){super(q);this.code=J;this.filePath=Q;this.line=Z;this.column=$;this.context=X;if(this.name="StxError",this.numericCode=V||w.EVALUATION_ERROR,this.filePath)this.filePath=N(this.filePath)}}class m extends U{constructor(q,J,Q,Z,$,X){super(q,"stx_SYNTAX_ERROR",J,Q,Z,$,X||w.INVALID_DIRECTIVE_SYNTAX);this.name="StxSyntaxError"}}class c extends U{constructor(q,J,Q,Z,$,X){super(q,"stx_RUNTIME_ERROR",J,Q,Z,$,X||w.EVALUATION_ERROR);this.name="StxRuntimeError"}}class d extends U{constructor(q,J,Q,Z,$,X){super(q,"stx_SECURITY_ERROR",J,Q,Z,$,X||w.UNSAFE_EXPRESSION);this.name="StxSecurityError"}}class p extends U{constructor(q,J,Q,Z,$,X){super(q,"stx_FILE_ERROR",J,Q,Z,$,X||w.FILE_NOT_FOUND);this.name="StxFileError"}}class l extends U{isFatal=!0;constructor(q,J,Q,Z,$,X){super(q,"stx_VALIDATION_ERROR",J,Q,Z,$,X||w.DOM_API_VIOLATION);this.name="StxValidationError"}}function P(q){let{type:J,message:Q,code:Z,filePath:$,line:X,column:V,template:Y,offset:B,snippet:G,suggestion:H,format:W="text"}=q,M=X,I=V;if(!M&&Y&&B!==void 0){let y=s(Y,B);M=y.line,I=y.column}let j=$?N($):void 0,Yq=Z?S(Z):void 0,K={type:J,code:Z,codeName:Yq,message:Q,filePath:j,line:M,column:I,snippet:G,suggestion:H,timestamp:new Date().toISOString()},O;switch(W){case"html":O=Dq(K);break;case"json":O=JSON.stringify(K,null,2);break;case"console":O=Kq(K,Y,B);break;case"text":default:O=Uq(K,Y,B);break}return{formatted:O,data:K}}function Uq(q,J,Q){let Z=[],$=q.code?` [${q.codeName||q.code}]`:"";if(Z.push(`[${q.type} Error${$}]`),q.filePath){let X=q.filePath;if(q.line){if(X+=`:${q.line}`,q.column)X+=`:${q.column}`}Z.push(`at ${X}`)}if(Z.push(`
4
4
  ${q.message}`),J&&q.line){let X=Oq(J,q.line,2);if(X)Z.push(`
5
5
  ${X}`)}if(q.snippet)Z.push(`
@@ -44,4 +44,4 @@ catch (e) {
44
44
  throw e;
45
45
  }
46
46
  `;return nq(Z?(G)=>{let H=a([b,...X,...G],Y);return(...W)=>H($q,...W)}:(G)=>a([...X,...G],Y),X,J,$,V)}function nq(q,J,Q,Z,$){let X=q([]),V=Z.every((B,G)=>B.index===G);if(J.length===Q.length&&V)return t(X,J,q);return t((...B)=>{let G=Array($.length);for(let H=0;H<$.length;H++)G[H]=B[$[H]];return X(...G)},J,q,(B)=>{X=q(B)})}function t(q,J,Q,Z){let X=/^(\w+) is not defined$/,V=q,Y=[],B=new Set(J);return(...G)=>{for(let H=0;H<=8;H++)try{return V(...G)}catch(W){let M=W instanceof Error?W.message:"",I=X.exec(M);if(!(W instanceof ReferenceError)||!I)return;let j=I[1];if(B.has(j)||Xq.has(j))return;if(B.add(j),Y.push(j),Z)Z(Y);else V=Q(Y)}return}}function LJ(q){let J=q.trim(),Q=[/\beval\s*\(/i,/\bFunction\s*\(/i,/\bimport\s*\(/i,/\brequire\s*\(/i,/\bprocess\b/i,/\b__proto__\b/i,/\bconstructor\s*[.(]/i,/\bglobalThis\b/i,/\bwindow\b/i,/\bdocument\b/i,/\bfetch\s*\(/i,/\bBun\b/i,/\bDeno\b/i,/\bconsole\b/i,/\bthis\b/i,/\bReflect\b/i,/\bProxy\b/i,/\bprototype\b/i,/\.(bind|call|apply)\s*\(/i];for(let Z of Q)if(Z.test(J))return!1;return!0}
47
- export{Gq as Bu,Bq as Cu,Hq as Du,Wq as Eu,f as Fu,Mq as Gu,w as Hu,S as Iu,Iq as Ju,k as Ku,aq as Lu,Fq as Mu,_ as Nu,jq as Ou,N as Pu,U as Qu,m as Ru,c as Su,d as Tu,p as Uu,l as Vu,P as Wu,zq as Xu,Lq as Yu,_q as Zu,Nq as _u,Tq as $u,Aq as av,C as bv,Rq as cv,bq as dv,v as ev,T as fv,Pq as gv,Cq as hv,gq as iv,r as jv,KJ as kv,cq as lv,dq as mv,pq as nv,OJ as ov,kJ as pv,zJ as qv,sq as rv,rq as sv,LJ as tv};
47
+ export{Gq as Cu,Bq as Du,Hq as Eu,Wq as Fu,f as Gu,Mq as Hu,w as Iu,S as Ju,Iq as Ku,k as Lu,aq as Mu,Fq as Nu,_ as Ou,jq as Pu,N as Qu,U as Ru,m as Su,c as Tu,d as Uu,p as Vu,l as Wu,P as Xu,zq as Yu,Lq as Zu,_q as _u,Nq as $u,Tq as av,Aq as bv,C as cv,Rq as dv,bq as ev,v as fv,T as gv,Pq as hv,Cq as iv,gq as jv,r as kv,KJ as lv,cq as mv,dq as nv,pq as ov,OJ as pv,kJ as qv,zJ as rv,sq as sv,rq as tv,LJ as uv};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{l as a,m as b,n as c}from"./chunk-q9n5swx7.js";import"./chunk-emjmshj8.js";export{c as updateContextTree,b as updateContextStoryFiles,a as createContext};
2
+ import{l as a,m as b,n as c}from"./chunk-q9n5swx7.js";import"./chunk-m8kem5ca.js";export{c as updateContextTree,b as updateContextStoryFiles,a as createContext};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{lk as a,mk as b,nk as c,ok as d}from"./chunk-0vrn78j5.js";import"./chunk-rargfb5s.js";import"./chunk-2119txb8.js";import"./chunk-jc6wrxrh.js";import"./chunk-2xpdcr8c.js";import"./chunk-v90kxg77.js";import"./chunk-4arms0am.js";import"./chunk-135mme4g.js";import"./chunk-dj24n5n7.js";import"./chunk-w1asc0zd.js";import"./chunk-kd95t585.js";import"./chunk-1tz8fb87.js";import"./chunk-xk402w4a.js";import"./chunk-dnard9gp.js";import"./chunk-vgx5077x.js";import"./chunk-met6wtbk.js";import"./chunk-ta6z7k4p.js";import"./chunk-zxptxz2b.js";import"./chunk-7racewc5.js";import"./chunk-e03m4har.js";import"./chunk-vsqx756d.js";import"./chunk-m8kem5ca.js";export{b as getAvailableTargets,c as getAvailableFormats,d as default,a as buildNative};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Ar as f,vr as a,wr as b,xr as c,yr as d,zr as e}from"./chunk-2119txb8.js";import"./chunk-jc6wrxrh.js";import"./chunk-2xpdcr8c.js";import"./chunk-v90kxg77.js";import"./chunk-4arms0am.js";import"./chunk-135mme4g.js";import"./chunk-dj24n5n7.js";import"./chunk-w1asc0zd.js";import"./chunk-kd95t585.js";import"./chunk-1tz8fb87.js";import"./chunk-xk402w4a.js";import"./chunk-dnard9gp.js";import"./chunk-vgx5077x.js";import"./chunk-met6wtbk.js";import"./chunk-ta6z7k4p.js";import"./chunk-zxptxz2b.js";import"./chunk-7racewc5.js";import"./chunk-e03m4har.js";import"./chunk-vsqx756d.js";import"./chunk-m8kem5ca.js";export{f as validateConfig,b as resolveStxDirectories,c as loadStxConfig,e as defineStxConfig,a as defaultConfig,d as config};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Hw as y}from"./chunk-trva71am.js";import N from"fs";import B from"path";var Y="_stx";function L(M){return Bun.hash(M).toString(16).slice(0,8)}function T(M){let C=[],v=(q)=>{for(let g of N.readdirSync(q,{withFileTypes:!0})){let j=B.join(q,g.name);if(g.isDirectory())v(j);else if(g.isFile()&&j.endsWith(".html"))C.push(j)}};if(N.existsSync(M))v(M);return C}var S=[{pattern:/<script\b([^>]*\bdata-stx-runtime\b[^>]*)>([\s\S]*?)<\/script>/gi,prefix:"runtime",extension:"js",contentType:"text/javascript; charset=utf-8",replace:(M)=>`<script data-stx-runtime src="${M}"></script>`},{pattern:/<script\b([^>]*\bdata-stx-router\b[^>]*)>([\s\S]*?)<\/script>/gi,prefix:"router",extension:"js",contentType:"text/javascript; charset=utf-8",replace:(M)=>`<script data-stx-router src="${M}"></script>`},{pattern:/<style\b([^>]*\bdata-css=(?:"generated"|'generated')[^>]*)>([\s\S]*?)<\/style>/gi,prefix:"css",extension:"css",contentType:"text/css; charset=utf-8",replace:(M)=>`<link data-css="generated" rel="stylesheet" href="${M}">`}];function _(M,C=`/${Y}`){let v=[],q=new Set,g=0,j=M;for(let G of S)j=j.replace(G.pattern,(R,K,W)=>{if(/\b(?:src|href)\s*=/.test(K)||!W.trim())return R;let Q=`${G.prefix}.${L(W)}.${G.extension}`;if(!q.has(Q))q.add(Q),v.push({filename:Q,contents:W,contentType:G.contentType});return g+=W.length,G.replace(`${C}/${Q}`)});return{html:j,assets:v,bytesInlined:g}}function a(M){let C={pages:0,assets:0,bytesInlined:0},v=B.join(M,Y),q=new Set;for(let g of T(M)){let j=N.readFileSync(g,"utf8"),{html:G,assets:R,bytesInlined:K}=_(j);if(G===j)continue;for(let W of R){if(q.has(W.filename))continue;q.add(W.filename),N.mkdirSync(v,{recursive:!0}),N.writeFileSync(B.join(v,W.filename),W.contents),C.assets++}N.writeFileSync(g,G),C.bytesInlined+=K,C.pages++}return C}import z from"fs";import P from"path";var I=1024,E=/<(script|style)\b([^>]*)>([\s\S]*?)<\/\1>/gi,d=new Set(["","module","text/javascript","application/javascript","module/javascript"]);function b(M){return Bun.hash(M).toString(16).slice(0,8)}function p(M){let C=[],v=(q)=>{for(let g of z.readdirSync(q,{withFileTypes:!0})){let j=P.join(q,g.name);if(g.isDirectory())v(j);else if(g.isFile()&&j.endsWith(".html"))C.push(j)}};if(z.existsSync(M))v(M);return C}function D(M,C){let v=M.match(new RegExp(`\\b${C}\\s*=\\s*("([^"]*)"|'([^']*)'|([^\\s>]+))`,"i"));if(!v)return;return v[2]??v[3]??v[4]??""}function m(M,C,v){if(v.length<I)return!1;if(/\b(?:src|href)\s*=/i.test(C))return!1;if(M.toLowerCase()==="script"){if(!d.has((D(C,"type")??"").trim().toLowerCase()))return!1;return!0}return!0}function o(M){let C=[];for(let v of M.matchAll(/<template\b[^>]*>[\s\S]*?<\/template>/gi))C.push([v.index,v.index+v[0].length]);return C}function s(M){let C={pages:0,assets:0,bytesInlined:0},v=p(M);if(v.length<2)return C;let q=new Map,g=new Map;for(let Q of v){let O=z.readFileSync(Q,"utf8");q.set(Q,O);let x=o(O);for(let U of O.matchAll(E)){let[w,V,J,$]=U;if(!m(V,J,$))continue;if(x.some(([A,k])=>U.index>=A&&U.index<k))continue;let H=`${V.toLowerCase()}\x00${$}`,X=g.get(H);if(X)X.push({file:Q,whole:w,tag:V,attrs:J,body:$});else g.set(H,[{file:Q,whole:w,tag:V,attrs:J,body:$}])}}let j=[...g.values()].filter((Q)=>new Set(Q.map((O)=>O.file)).size>1);if(j.length===0)return C;let G=P.join(M,Y),R=new Map(q),K=new Map,W=[];for(let Q of j){let{tag:O,body:x}=Q[0],U=O.toLowerCase()==="script",w=`${U?"chunk":"style"}.${b(x)}.${U?"js":"css"}`;W.push({filename:w,contents:x,contentType:U?"text/javascript; charset=utf-8":"text/css; charset=utf-8"});let V=`/${Y}/${w}`;for(let J of Q){let $=U?`<script${J.attrs} src="${V}"></script>`:`<link${J.attrs} rel="stylesheet" href="${V}">`,H=R.get(J.file),X=H.replace(J.whole,()=>$);if(X===H)continue;R.set(J.file,X),K.set(J.file,(K.get(J.file)??0)+J.body.length)}}z.mkdirSync(G,{recursive:!0});for(let Q of W)z.writeFileSync(P.join(G,Q.filename),Q.contents),C.assets++;for(let[Q,O]of R){if(O===q.get(Q))continue;z.writeFileSync(Q,O),C.pages++,C.bytesInlined+=K.get(Q)??0}return C}y();import Z from"fs";import F from"path";var h="layout-types.d.ts";function f(M){let C=[],v=(q,g)=>{let j;try{j=Z.readdirSync(q,{withFileTypes:!0})}catch{return}for(let G of j){if(G.name.startsWith("."))continue;let R=F.join(q,G.name);if(G.isDirectory())v(R,g?`${g}/${G.name}`:G.name);else if(G.isFile()&&G.name.endsWith(".stx")&&G.name!=="_layout.stx"){let K=G.name.slice(0,-4);C.push(g?`${g}/${K}`:K)}}};return v(M,""),C.sort()}function c(M){let C=["// Auto-generated by stx \u2014 do not edit.","//","// Makes `definePageMeta({ layout })` reject a name with no layout behind it.","// Include this file in your tsconfig (it lives in the stx state directory,","// `.stx/` by default) for the check to apply.",""];if(M.length===0)return C.push("// No layouts found \u2014 `layout` stays typed as `string`.","export {}",""),C.join(`
2
+ import{Iw as y}from"./chunk-e03m4har.js";import N from"fs";import B from"path";var Y="_stx";function L(M){return Bun.hash(M).toString(16).slice(0,8)}function T(M){let C=[],v=(q)=>{for(let g of N.readdirSync(q,{withFileTypes:!0})){let j=B.join(q,g.name);if(g.isDirectory())v(j);else if(g.isFile()&&j.endsWith(".html"))C.push(j)}};if(N.existsSync(M))v(M);return C}var S=[{pattern:/<script\b([^>]*\bdata-stx-runtime\b[^>]*)>([\s\S]*?)<\/script>/gi,prefix:"runtime",extension:"js",contentType:"text/javascript; charset=utf-8",replace:(M)=>`<script data-stx-runtime src="${M}"></script>`},{pattern:/<script\b([^>]*\bdata-stx-router\b[^>]*)>([\s\S]*?)<\/script>/gi,prefix:"router",extension:"js",contentType:"text/javascript; charset=utf-8",replace:(M)=>`<script data-stx-router src="${M}"></script>`},{pattern:/<style\b([^>]*\bdata-css=(?:"generated"|'generated')[^>]*)>([\s\S]*?)<\/style>/gi,prefix:"css",extension:"css",contentType:"text/css; charset=utf-8",replace:(M)=>`<link data-css="generated" rel="stylesheet" href="${M}">`}];function _(M,C=`/${Y}`){let v=[],q=new Set,g=0,j=M;for(let G of S)j=j.replace(G.pattern,(R,K,W)=>{if(/\b(?:src|href)\s*=/.test(K)||!W.trim())return R;let Q=`${G.prefix}.${L(W)}.${G.extension}`;if(!q.has(Q))q.add(Q),v.push({filename:Q,contents:W,contentType:G.contentType});return g+=W.length,G.replace(`${C}/${Q}`)});return{html:j,assets:v,bytesInlined:g}}function a(M){let C={pages:0,assets:0,bytesInlined:0},v=B.join(M,Y),q=new Set;for(let g of T(M)){let j=N.readFileSync(g,"utf8"),{html:G,assets:R,bytesInlined:K}=_(j);if(G===j)continue;for(let W of R){if(q.has(W.filename))continue;q.add(W.filename),N.mkdirSync(v,{recursive:!0}),N.writeFileSync(B.join(v,W.filename),W.contents),C.assets++}N.writeFileSync(g,G),C.bytesInlined+=K,C.pages++}return C}import z from"fs";import P from"path";var I=1024,E=/<(script|style)\b([^>]*)>([\s\S]*?)<\/\1>/gi,d=new Set(["","module","text/javascript","application/javascript","module/javascript"]);function b(M){return Bun.hash(M).toString(16).slice(0,8)}function p(M){let C=[],v=(q)=>{for(let g of z.readdirSync(q,{withFileTypes:!0})){let j=P.join(q,g.name);if(g.isDirectory())v(j);else if(g.isFile()&&j.endsWith(".html"))C.push(j)}};if(z.existsSync(M))v(M);return C}function D(M,C){let v=M.match(new RegExp(`\\b${C}\\s*=\\s*("([^"]*)"|'([^']*)'|([^\\s>]+))`,"i"));if(!v)return;return v[2]??v[3]??v[4]??""}function m(M,C,v){if(v.length<I)return!1;if(/\b(?:src|href)\s*=/i.test(C))return!1;if(M.toLowerCase()==="script"){if(!d.has((D(C,"type")??"").trim().toLowerCase()))return!1;return!0}return!0}function o(M){let C=[];for(let v of M.matchAll(/<template\b[^>]*>[\s\S]*?<\/template>/gi))C.push([v.index,v.index+v[0].length]);return C}function s(M){let C={pages:0,assets:0,bytesInlined:0},v=p(M);if(v.length<2)return C;let q=new Map,g=new Map;for(let Q of v){let O=z.readFileSync(Q,"utf8");q.set(Q,O);let x=o(O);for(let U of O.matchAll(E)){let[w,V,J,$]=U;if(!m(V,J,$))continue;if(x.some(([A,k])=>U.index>=A&&U.index<k))continue;let H=`${V.toLowerCase()}\x00${$}`,X=g.get(H);if(X)X.push({file:Q,whole:w,tag:V,attrs:J,body:$});else g.set(H,[{file:Q,whole:w,tag:V,attrs:J,body:$}])}}let j=[...g.values()].filter((Q)=>new Set(Q.map((O)=>O.file)).size>1);if(j.length===0)return C;let G=P.join(M,Y),R=new Map(q),K=new Map,W=[];for(let Q of j){let{tag:O,body:x}=Q[0],U=O.toLowerCase()==="script",w=`${U?"chunk":"style"}.${b(x)}.${U?"js":"css"}`;W.push({filename:w,contents:x,contentType:U?"text/javascript; charset=utf-8":"text/css; charset=utf-8"});let V=`/${Y}/${w}`;for(let J of Q){let $=U?`<script${J.attrs} src="${V}"></script>`:`<link${J.attrs} rel="stylesheet" href="${V}">`,H=R.get(J.file),X=H.replace(J.whole,()=>$);if(X===H)continue;R.set(J.file,X),K.set(J.file,(K.get(J.file)??0)+J.body.length)}}z.mkdirSync(G,{recursive:!0});for(let Q of W)z.writeFileSync(P.join(G,Q.filename),Q.contents),C.assets++;for(let[Q,O]of R){if(O===q.get(Q))continue;z.writeFileSync(Q,O),C.pages++,C.bytesInlined+=K.get(Q)??0}return C}y();import Z from"fs";import F from"path";var h="layout-types.d.ts";function f(M){let C=[],v=(q,g)=>{let j;try{j=Z.readdirSync(q,{withFileTypes:!0})}catch{return}for(let G of j){if(G.name.startsWith("."))continue;let R=F.join(q,G.name);if(G.isDirectory())v(R,g?`${g}/${G.name}`:G.name);else if(G.isFile()&&G.name.endsWith(".stx")&&G.name!=="_layout.stx"){let K=G.name.slice(0,-4);C.push(g?`${g}/${K}`:K)}}};return v(M,""),C.sort()}function c(M){let C=["// Auto-generated by stx \u2014 do not edit.","//","// Makes `definePageMeta({ layout })` reject a name with no layout behind it.","// Include this file in your tsconfig (it lives in the stx state directory,","// `.stx/` by default) for the check to apply.",""];if(M.length===0)return C.push("// No layouts found \u2014 `layout` stays typed as `string`.","export {}",""),C.join(`
3
3
  `);return C.push("declare module '@stacksjs/stx' {"," interface KnownLayouts {",...M.map((v)=>` '${v}': true`)," }","}","","export {}",""),C.join(`
4
4
  `)}function HM(M,C){if(!M)return[];let v=F.isAbsolute(M)?M:F.resolve(process.cwd(),M),q=f(v),g=c(q),j=F.join(C,h);try{if(Z.existsSync(j)&&Z.readFileSync(j,"utf8")===g)return q;Z.mkdirSync(C,{recursive:!0}),Z.writeFileSync(j,g)}catch{}return q}
5
5
  export{Y as vk,_ as wk,a as xk,s as yk,h as zk,f as Ak,c as Bk,HM as Ck};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{$k as b,_k as a,al as c,bl as d,cl as e,dl as f,el as g,fl as h,gl as i,hl as j,il as k,jl as l,kl as m,ll as n,ml as o}from"./chunk-qg0w5tjb.js";import"./chunk-7rj4h2t2.js";import"./chunk-qjvny3wf.js";import"./chunk-2119txb8.js";import"./chunk-jc6wrxrh.js";import"./chunk-2xpdcr8c.js";import"./chunk-v90kxg77.js";import"./chunk-4arms0am.js";import"./chunk-135mme4g.js";import"./chunk-dj24n5n7.js";import"./chunk-w1asc0zd.js";import"./chunk-kd95t585.js";import"./chunk-1tz8fb87.js";import"./chunk-xk402w4a.js";import"./chunk-dnard9gp.js";import"./chunk-vgx5077x.js";import"./chunk-met6wtbk.js";import"./chunk-ta6z7k4p.js";import"./chunk-zxptxz2b.js";import"./chunk-7racewc5.js";import"./chunk-e03m4har.js";import"./chunk-vsqx756d.js";import"./chunk-m8kem5ca.js";export{o as tempBuildName,b as shouldLogBundlerDiagnostics,f as setBundlerFallbackMode,l as rewriteRegistryImports,g as resolveBundlerFallback,j as registryIdForPath,c as recordBundleFailure,m as queueClientBundleBuild,k as normalizeRegistrySpecifiers,h as hasUserImports,d as getBundleFailures,a as clientBundleDependencies,e as clearBundleFailures,n as bundleClientScript,i as MODULE_SPECIFIER_PREFIX};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Rw as O}from"./chunk-emjmshj8.js";import{mkdir as b,writeFile as T}from"fs/promises";import{join as q}from"path";var E="https://api.iconify.design";async function k(){let G=await fetch(`${E}/collections`);if(!G.ok)throw Error(`Failed to fetch collections: ${G.statusText}`);return await G.json()}async function P(G,z){try{let Z=O.resolve("@iconify/json"),X=`${`${Z.substring(0,Z.lastIndexOf("/node_modules/@iconify/json/"))}/node_modules/@iconify/json`}/json/${G}.json`,Q=Bun.file(X);if(await Q.exists()){let $=await Q.json();if(z&&z.length>0){let B={};for(let S of z)if($.icons[S])B[S]=$.icons[S];return{...$,icons:B}}return $}}catch{}let M=z&&z.length>0?`${E}/${G}.json?icons=${z.join(",")}`:`${E}/${G}.json`,U=await fetch(M);if(!U.ok)throw Error(`Failed to fetch icons for ${G}: ${U.statusText}`);return await U.json()}function j(G,z=24,M=24){return{body:G.body,width:G.width||z,height:G.height||M,viewBox:`0 0 ${G.width||z} ${G.height||M}`}}function F(G,z){let M=V(G);return`import type { IconData } from '@stacksjs/iconify-core'
2
+ import{Sw as O}from"./chunk-m8kem5ca.js";import{mkdir as b,writeFile as T}from"fs/promises";import{join as q}from"path";var E="https://api.iconify.design";async function k(){let G=await fetch(`${E}/collections`);if(!G.ok)throw Error(`Failed to fetch collections: ${G.statusText}`);return await G.json()}async function P(G,z){try{let Z=O.resolve("@iconify/json"),X=`${`${Z.substring(0,Z.lastIndexOf("/node_modules/@iconify/json/"))}/node_modules/@iconify/json`}/json/${G}.json`,Q=Bun.file(X);if(await Q.exists()){let $=await Q.json();if(z&&z.length>0){let B={};for(let S of z)if($.icons[S])B[S]=$.icons[S];return{...$,icons:B}}return $}}catch{}let M=z&&z.length>0?`${E}/${G}.json?icons=${z.join(",")}`:`${E}/${G}.json`,U=await fetch(M);if(!U.ok)throw Error(`Failed to fetch icons for ${G}: ${U.statusText}`);return await U.json()}function j(G,z=24,M=24){return{body:G.body,width:G.width||z,height:G.height||M,viewBox:`0 0 ${G.width||z} ${G.height||M}`}}function F(G,z){let M=V(G);return`import type { IconData } from '@stacksjs/iconify-core'
3
3
 
4
4
  export const ${M}: IconData = ${JSON.stringify(z,null,2)}
5
5
 
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{At as e,Bt as f,Ct as g,Dt as h,Et as i,tt as a,xt as b,yt as c,zt as d}from"./chunk-5270fyk7.js";import"./chunk-emjmshj8.js";export{a as webpHeaderHasAlpha,g as snapshotImageDelivery,b as setImageEncoderIdentity,i as prepareImageDelivery,e as isTransparentImage,h as installImageDelivery,c as imageEncoderIdentity,d as getImageDelivery,f as clearImageDeliveryCatalog};
2
+ import{At as d,Bt as e,Ct as f,Dt as g,Et as h,Ft as i,ut as a,yt as b,zt as c}from"./chunk-kd95t585.js";import"./chunk-m8kem5ca.js";export{a as webpHeaderHasAlpha,g as snapshotImageDelivery,b as setImageEncoderIdentity,i as prepareImageDelivery,e as isTransparentImage,h as installImageDelivery,c as imageEncoderIdentity,d as getImageDelivery,f as clearImageDeliveryCatalog};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Ai as e,wi as a,xi as b,yi as c,zi as d}from"./chunk-c79nfdyj.js";import"./chunk-emjmshj8.js";export{a as processAsyncDirectives,c as isAsyncComponent,e as generateAsyncComponentRuntime,d as generateAsyncComponentCSS,b as defineAsyncComponent};
2
+ import{Ai as e,wi as a,xi as b,yi as c,zi as d}from"./chunk-c79nfdyj.js";import"./chunk-m8kem5ca.js";export{a as processAsyncDirectives,c as isAsyncComponent,e as generateAsyncComponentRuntime,d as generateAsyncComponentCSS,b as defineAsyncComponent};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Aj as I,Bj as M,Fj as P,Gj as T,Hj as x,Ij as C,wj as B,xj as F,yj as H,zj as O}from"./chunk-0t1yyn1d.js";import{Nv as L,Pv as R,Rv as S}from"./chunk-aa8015mk.js";var w=null;function j(){return w}function g(z,W){if(w)w.provides.set(z,W);else V.set(z,W)}function v(z,W){let Q=w;while(Q){if(Q.provides.has(z))return Q.provides.get(z);Q=Q.parent}if(V.has(z))return V.get(z);return W}var V=new Map;function m(z,W){V.set(z,W)}function U(z){let W=w,Q=W?.el,Z=Array.isArray(z)?z:z&&typeof z==="object"?Object.keys(z):[];if(Q&&Z.length>0){let $=Q.__stx_component_emits||=Object.create(null);for(let Y of Z)$[Y]=!0}let _=($,...Y)=>{if(typeof document>"u")return;if(Q){let A=Q.__stx_component_emits||=Object.create(null);A[$]=!0,Q.dispatchEvent(new CustomEvent($,{detail:Y.length===1?Y[0]:Y,bubbles:!0,cancelable:!0}))}};if(W)W.emit=_;return _}function y(z){if(w)w.exposed=z}function h(z){let W=Promise.resolve();return z?W.then(z):W}function p(z){if(w)w.errorCapturedHooks.push(z)}function u(z,W,Q){let Z=W?.parent;while(Z){for(let _ of Z.errorCapturedHooks)if(_(z,W,Q)===!1)return;Z=Z.parent}}function l(){return w?.slots??{}}function d(){return w?.slots??{}}function i(){return w?.attrs??{}}function c(z){let W=z.__provides?new Map(Object.entries(z.__provides)):new Map;return{...z,__provides:W,__provide(Q,Z){W.set(Q,Z)},__inject(Q,Z){if(W.has(Q))return W.get(Q);if(z.__provides){let _=z.__provides instanceof Map?z.__provides:new Map(Object.entries(z.__provides));if(_.has(Q))return _.get(Q)}return Z}}}function o(){return`
2
+ import{Aj as I,Bj as M,Fj as P,Gj as T,Hj as x,Ij as C,wj as B,xj as F,yj as H,zj as O}from"./chunk-0t1yyn1d.js";import{Ov as L,Qv as R,Sv as S}from"./chunk-7racewc5.js";var w=null;function j(){return w}function g(z,W){if(w)w.provides.set(z,W);else V.set(z,W)}function v(z,W){let Q=w;while(Q){if(Q.provides.has(z))return Q.provides.get(z);Q=Q.parent}if(V.has(z))return V.get(z);return W}var V=new Map;function m(z,W){V.set(z,W)}function U(z){let W=w,Q=W?.el,Z=Array.isArray(z)?z:z&&typeof z==="object"?Object.keys(z):[];if(Q&&Z.length>0){let $=Q.__stx_component_emits||=Object.create(null);for(let Y of Z)$[Y]=!0}let _=($,...Y)=>{if(typeof document>"u")return;if(Q){let A=Q.__stx_component_emits||=Object.create(null);A[$]=!0,Q.dispatchEvent(new CustomEvent($,{detail:Y.length===1?Y[0]:Y,bubbles:!0,cancelable:!0}))}};if(W)W.emit=_;return _}function y(z){if(w)w.exposed=z}function h(z){let W=Promise.resolve();return z?W.then(z):W}function p(z){if(w)w.errorCapturedHooks.push(z)}function u(z,W,Q){let Z=W?.parent;while(Z){for(let _ of Z.errorCapturedHooks)if(_(z,W,Q)===!1)return;Z=Z.parent}}function l(){return w?.slots??{}}function d(){return w?.slots??{}}function i(){return w?.attrs??{}}function c(z){let W=z.__provides?new Map(Object.entries(z.__provides)):new Map;return{...z,__provides:W,__provide(Q,Z){W.set(Q,Z)},__inject(Q,Z){if(W.has(Q))return W.get(Q);if(z.__provides){let _=z.__provides instanceof Map?z.__provides:new Map(Object.entries(z.__provides));if(_.has(Q))return _.get(Q)}return Z}}}function o(){return`
3
3
  // STX Composition API Runtime
4
4
  (function() {
5
5
  const _provides = new Map();
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{tl as QJ}from"./chunk-t23kccpz.js";import{ul as WJ}from"./chunk-qjvny3wf.js";import{bm as GJ,wr as XJ,xr as qJ}from"./chunk-3ssjb8cx.js";import{ps as ZJ,qs as $J}from"./chunk-kyyt9xhs.js";import{Js as YJ,Ns as u}from"./chunk-kjd9hbg4.js";import{rt as c}from"./chunk-ejwfnttb.js";import X from"path";import O from"fs";function UJ(J){if(!J||typeof J!=="object")return!1;let K=J;return typeof K.message==="string"&&(K.name==="BuildMessage"||K.name==="ResolveMessage"||("position"in K))}function LJ(J){if(J&&typeof J==="object"&&Array.isArray(J.errors))return J.errors;return[J]}function b(J,K){let $=[];for(let W of LJ(J)){if(UJ(W)){let Y=W.position||void 0;$.push({file:K||Y?.file,line:Y?.line,column:Y?.column,message:W.message??"",lineText:Y?.lineText});continue}$.push({file:K,message:W instanceof Error?W.message:String(W)})}return $}function t(J,K){return b(J,K).map(($)=>{let W=$.file?`${$.file}${$.line?`:${$.line}${$.column?`:${$.column}`:""}`:""}`:"",Y=$.lineText?`
2
+ import{tl as QJ}from"./chunk-7rj4h2t2.js";import{ul as WJ}from"./chunk-qjvny3wf.js";import{bm as GJ,xr as XJ,yr as qJ}from"./chunk-2119txb8.js";import{qs as ZJ,rs as $J}from"./chunk-v90kxg77.js";import{Ks as YJ,Os as u}from"./chunk-dj24n5n7.js";import{st as c}from"./chunk-w1asc0zd.js";import X from"path";import O from"fs";function UJ(J){if(!J||typeof J!=="object")return!1;let K=J;return typeof K.message==="string"&&(K.name==="BuildMessage"||K.name==="ResolveMessage"||("position"in K))}function LJ(J){if(J&&typeof J==="object"&&Array.isArray(J.errors))return J.errors;return[J]}function b(J,K){let $=[];for(let W of LJ(J)){if(UJ(W)){let Y=W.position||void 0;$.push({file:K||Y?.file,line:Y?.line,column:Y?.column,message:W.message??"",lineText:Y?.lineText});continue}$.push({file:K,message:W instanceof Error?W.message:String(W)})}return $}function t(J,K){return b(J,K).map(($)=>{let W=$.file?`${$.file}${$.line?`:${$.line}${$.column?`:${$.column}`:""}`:""}`:"",Y=$.lineText?`
3
3
  ${$.lineText.trim()}`:"";return W?`${W}: ${$.message}${Y}`:`${$.message}${Y}`}).join(`
4
4
  `)}var TJ=9;function P(J,K,$){return/^(?:(?:stx|ui)\.config\.[cm]?[jt]s|runtime-config-(?:server|loader)\.[cm]?[jt]s)$/.test(X.basename(J))||QJ(J,K,$)}var HJ=1,zJ=new Map,f=600,AJ=100,g=new Map;async function MJ(J){let K=g.get(J)??0;if(K>0&&K<AJ){g.set(J,K+1);return}g.set(J,1);try{let $=(await O.promises.readdir(J)).filter((z)=>z.endsWith(".js"));if($.length<=f)return;let Y=(await Promise.all($.map(async(z)=>{try{return{name:z,at:(await O.promises.stat(X.join(J,z))).mtimeMs}}catch{return null}}))).filter((z)=>z!==null);Y.sort((z,H)=>H.at-z.at);for(let z of Y.slice(f)){let H=z.name.slice(0,-3);await O.promises.rm(X.join(J,`${H}.js`),{force:!0}),await O.promises.rm(X.join(J,`${H}.deps.json`),{force:!0})}x("pruned bundle cache to",f,"entries")}catch{}}function nJ(J){return zJ.get(J)??[]}function h(J,K){if(J)zJ.set(J,K)}function CJ(J=process.env){return J.STX_DEBUG==="true"||J.STX_DEBUG==="1"}function x(...J){if(CJ())console.log("[stx:bundler]",...J)}var n=[];function r(J,K,$){n.push({filePath:J||"<inline>",message:K,details:$})}function oJ(){return n.slice()}function lJ(){n.length=0}var p;function dJ(J){p=J}function a(){if(p)return p;try{let J=qJ.strict;return typeof J==="object"&&J!==null?J.bundlerFallback??"warn":"warn"}catch{return"warn"}}var e=[/^stx$/,/^@stacksjs\/stx$/,/^@stores$/,/^stx\/stores$/,/^@composables$/];function sJ(J){let K=/^[ \t]*import[ \t]+(?!type(?:[ \t]|{))[\s\S]*?\s+from\s+['"]([^'"]+)['"][ \t]*;?/gm,$;while(($=K.exec(J))!==null){let Y=$[1];if(!e.some((H)=>H.test(Y)))return x("detected user import:",Y),!0}let W=/^[ \t]*import[ \t]+['"]([^'"]+)['"]/gm;while(($=W.exec(J))!==null){let Y=$[1];if(/\.css(?:\?.*)?$/.test(Y))continue;if(!e.some((H)=>H.test(Y)))return x("detected side-effect import:",Y),!0}return!1}var v="stx-module:",xJ=/\.(?:[cm]?[jt]sx?|json)$/i;function IJ(J,K){return X.relative(J,K).split(X.sep).join("/")}function _J(J,K){if(K.size===0)return J;return J.replace(/^([ \t]*import\s+(?:[^;"']*?\s+from\s+)?)(["'])([^"']+)\2/gm,($,W,Y,z)=>{let H=K.get(z);return H&&!z.startsWith(v)?`${W}${Y}${H}${Y}`:$})}function NJ(J,K){let $=0,W=(z)=>{let H=`__stxMod${$++}`,j=JSON.stringify(z);return K.push(`var ${H} = globalThis.__stxModules && globalThis.__stxModules[${j}];`,`if (${H} === undefined) throw new Error("[stx] module " + ${JSON.stringify(j)} + " is not registered on this page (#1957)");`),H},Y=(z,H)=>{for(let j of z.split(",")){let T=j.trim();if(!T)continue;let Q=T.match(/^("(?:[^"\\]|\\.)*"|[\w$]+)(?:\s+as\s+([\w$]+))?$/);if(!Q)continue;let Z=Q[1].startsWith('"')?JSON.parse(Q[1]):Q[1],G=Q[2]??Z;K.push(`var ${G} = ${H}[${JSON.stringify(Z)}];`)}};return J=J.replace(/^[ \t]*import\s+([^;"']*?)\s+from\s+["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(z,H,j)=>{let T=j.slice(v.length),Q=W(T),Z=H.trim(),G=Z.match(/^([\w$]+)\s*(?:,\s*|$)/);if(G&&!Z.startsWith("{")&&!Z.startsWith("*"))K.push(`var ${G[1]} = ${Q}.default;`),Z=Z.slice(G[0].length).trim();let q=Z.match(/^\*\s*as\s+([\w$]+)$/);if(q)K.push(`var ${q[1]} = ${Q};`);else if(Z.startsWith("{"))Y(Z.replace(/^\{|\}$/g,""),Q);return""}),J=J.replace(/^[ \t]*import\s+["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(z,H)=>{return W(H.slice(v.length)),""}),J}function JJ(J){let K=[J,`${J}.ts`,`${J}.tsx`,`${J}.js`,`${J}.mjs`,`${J}.jsx`,X.join(J,"index.ts"),X.join(J,"index.tsx"),X.join(J,"index.js"),X.join(J,"index.mjs")];for(let $ of K)try{if(O.existsSync($)&&O.statSync($,{throwIfNoEntry:!1})?.isFile())return $}catch{}return}function SJ(J,K,$,W,Y,z=new Map,H){let j=(Q,Z,G)=>{if(P(Z,J,H))return null;if(!Y||Q!==$||!xJ.test(Z))return null;try{if(!O.statSync(Z,{throwIfNoEntry:!1})?.isFile())return null}catch{return null}W.add(Z);let q=`${v}${IJ(process.cwd(),Z)}`;return z.set(G,q),{path:q,external:!0}},T=(Q,Z)=>{let G=Q===$?K:X.dirname(Q),q=X.resolve(G,Z);return JJ(q)??q};return{name:"stx-client-bundle",setup(Q){if(Q.onResolve({filter:/^(stx|@stacksjs\/stx)$/},(Z)=>({path:Z.path,external:!0})),Q.onResolve({filter:/^(@stores|@composables|stx\/stores)$/},(Z)=>({path:Z.path,external:!0})),Q.onResolve({filter:/^\//},(Z)=>{let G=JJ(Z.path);if(G){let q=j(Z.importer,G,Z.path);if(q)return q;if(G!==$)W.add(G);return{path:G}}return{path:Z.path,external:!0}}),Q.onResolve({filter:/^\.\.?\//},(Z)=>{let G=T(Z.importer,Z.path),q=j(Z.importer,G,Z.path);if(q)return q;return W.add(G),{path:G}}),Q.onResolve({filter:/^[@~]\//},(Z)=>{let G=X.resolve(J,Z.path.slice(2)),q=[G,`${G}.ts`,`${G}.tsx`,`${G}.js`,`${G}.mjs`,`${G}.jsx`,X.join(G,"index.ts"),X.join(G,"index.tsx"),X.join(G,"index.js"),X.join(G,"index.mjs")];for(let w of q)if(O.existsSync(w)&&O.statSync(w,{throwIfNoEntry:!1})?.isFile()){let y=j(Z.importer,w,Z.path);if(y)return y;return x(`resolved ${Z.path[0]}/ import:`,Z.path,"\u2192",w),W.add(w),{path:w}}return console.warn(`[stx:bundler] could not resolve ${Z.path[0]}/ import:`,Z.path),{path:G}}),Y)Q.onResolve({filter:/^(?!node:|bun:)(?:@[\w.-]+\/)?[\w.-]/},(Z)=>{if(Z.importer!==$)return;let G=`${v}npm:${Z.path}`;return z.set(Z.path,G),{path:G,external:!0}});Q.onLoad({filter:/\.(?:[cm]?[jt]sx?|json)$/},(Z)=>{if(P(Z.path,J,H))throw Error(`Server-only API source cannot be imported by a client script: ${Z.path}`);let G=X.extname(Z.path).toLowerCase(),q=G===".json"?"json":G===".tsx"?"tsx":G===".jsx"?"jsx":G===".ts"||G===".mts"||G===".cts"?"ts":"js";if(Z.path!==$)W.add(Z.path);return{contents:O.readFileSync(Z.path,"utf8"),loader:q}})}}}var m=new Map,D=YJ(64),KJ=Symbol.for("stx.client-bundle-build-queue");function yJ(J){let K=globalThis,W=(K[KJ]??Promise.resolve()).then(J,J);return K[KJ]=W.then(()=>{return},()=>{return}),W}async function iJ(J,K,$={}){let W=$.projectRoot||process.cwd(),Y=(await XJ(W)).serverApi,z=$.minify??!1,H=$.externalizeUserModules??!0,j=$.cacheDir||c(W,"bundle-cache"),T=new Bun.CryptoHasher("md5");T.update(`${TJ}\x00${WJ()}\x00${JSON.stringify(Y??!1)}\x00${H?"registry":"inline"}\x00${J}\x00${K}`);let Q=T.digest("hex").slice(0,12),Z=X.join(j,`${Q}.js`),G=D.get(Z);if(G){if(u(G.files)&&G.files.every((A)=>!P(A.path,W,Y))){x("memo hit:",Q);let A=G.files.map((M)=>M.path);return h(K,A),$.collectInputs?.push(...A),G.code}D.delete(Z),x("memo invalidated by dep change:",Q)}let q=X.join(j,`${Q}.deps.json`),w=Bun.file(Z);if(await w.exists()){let A=Bun.file(q),M=!1,U=null;if(await A.exists())try{let N=JSON.parse(await A.text());if(N.metadataVersion!==HJ||!Array.isArray(N.files))M=!1;else U=N.files,M=!0;if(U&&(!u(U)||U.some((B)=>P(B.path,W,Y))))M=!1}catch{M=!1}if(M){if(x("cache hit:",Q),U)h(K,U.map((B)=>B.path)),$.collectInputs?.push(...U.map((B)=>B.path));let N=await w.text();if(U)D.set(Z,{code:N,files:U});return N}x("cache invalidated by dep change:",Q)}let y=m.get(Q);if(y){let A=await y;if($.collectInputs)$.collectInputs.push(...(D.get(Z)?.files??[]).map((M)=>M.path));return A}let I=yJ(()=>FJ(J,K,{projectRoot:W,minify:z,cacheDir:j,hash:Q,cachePath:Z,depsPath:q,collectInputs:$.collectInputs,externalizeUserModules:H,serverApi:Y}));m.set(Q,I);try{return await I}finally{m.delete(Q)}}var BJ=0;function RJ(J){return`${J}-${process.pid}-${++BJ}`}async function FJ(J,K,$){let{projectRoot:W,minify:Y,cacheDir:z,hash:H,cachePath:j,depsPath:T,externalizeUserModules:Q}=$,Z=c(W,"bundle-tmp"),G=RJ(H),q=X.join(Z,`${G}.ts`),w=X.join(Z,"out",G);O.mkdirSync(Z,{recursive:!0}),O.mkdirSync(w,{recursive:!0});let y=X.dirname(K),I=new Set,A=/^[ \t]*(export\s+)?(?:const|let|var)\s+(?:\{([^}]+)\}|(\w+))/gm,M=/^[ \t]*(export\s+)?(?:async\s+)?function\s+(\w+)/gm,U=ZJ(J),{depths:N,balanced:B}=$J(U),o=(L)=>!B||N[L]===0,C;while((C=A.exec(U))!==null){if(C[1])continue;if(!o(C.index))continue;if(C[2])C[2].split(",").forEach((L)=>{let k=DJ(L);if(k)I.add(k)});else if(C[3])I.add(C[3])}while((C=M.exec(U))!==null){if(C[1])continue;if(!o(C.index))continue;I.add(C[2])}let VJ=I.size>0?`
5
5
  export { ${[...I].join(", ")} }`:"";await Bun.write(q,J+VJ),x("bundling:",H,"from:",X.basename(K));let l=new Set,d=new Map;try{let L=await Bun.build({entrypoints:[q],outdir:w,target:"browser",format:"esm",minify:Y,plugins:[SJ(W,y,q,l,Q,d,$.serverApi)],define:{"process.env.NODE_ENV":Y?'"production"':'"development"',...GJ()},root:W});if(!L.success){let S=L.logs.filter((R)=>R.level==="error").map((R)=>R.message).join(", ")||`Unable to bundle ${X.basename(K)}`,F=b(L.logs,K||void 0);if(console.warn("[stx:bundler] build failed:",S),r(K||"",S,F),a()==="error")throw Error(S);return J}let k="";for(let V of L.outputs){k=await V.text();break}let _=[];for(let V of k.matchAll(/^\s*export\s*\{([^}]*)\}\s*;?\s*$/gm))for(let S of V[1].split(",")){let F=S.trim().match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);if(F){_.push([F[2],F[1]]);continue}let R=S.trim();if(/^[A-Za-z_$][\w$]*$/.test(R))_.push([R,R])}let s=[];k=NJ(_J(k,d),s);let kJ=k.match(/^\s*import\s+[^;]+;?\s*$/gm)||[];k=k.replace(/^\s*import\s+[^;]+;?\s*$/gm,"").replace(/^\s*export\s*\{[^}]*\}\s*;?\s*$/gm,"").replace(/^\s*export\s+default\s+.*$/gm,"").trim();let i=`__stxBundle_${H}`,jJ=_.map(([V,S])=>`${JSON.stringify(V)}: ${S}`).join(", "),OJ=_.map(([V])=>`var ${V} = undefined;`).join(`
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Nh as a,Oh as b,Ph as c,Qh as d,Rh as e,Sh as f,Th as g,Uh as h,Vh as i,Wh as j,Xh as k}from"./chunk-k33778kc.js";import"./chunk-emjmshj8.js";export{i as processStaticDirectives,b as processPartialHydrationDirectives,h as onHydrated,g as isHydrated,d as hydrateIsland,e as hydrateByStrategy,f as hydrateAll,c as generatePartialHydrationCSS,j as generateIslandManifest,k as default,a as createIslandRegistry};
2
+ import{Nh as a,Oh as b,Ph as c,Qh as d,Rh as e,Sh as f,Th as g,Uh as h,Vh as i,Wh as j,Xh as k}from"./chunk-k33778kc.js";import"./chunk-m8kem5ca.js";export{i as processStaticDirectives,b as processPartialHydrationDirectives,h as onHydrated,g as isHydrated,d as hydrateIsland,e as hydrateByStrategy,f as hydrateAll,c as generatePartialHydrationCSS,j as generateIslandManifest,k as default,a as createIslandRegistry};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{go as b,ho as c,io as d}from"./chunk-2119txb8.js";import"./chunk-jc6wrxrh.js";import"./chunk-2xpdcr8c.js";import"./chunk-v90kxg77.js";import"./chunk-4arms0am.js";import"./chunk-135mme4g.js";import"./chunk-dj24n5n7.js";import"./chunk-w1asc0zd.js";import"./chunk-kd95t585.js";import"./chunk-1tz8fb87.js";import"./chunk-xk402w4a.js";import"./chunk-dnard9gp.js";import"./chunk-vgx5077x.js";import{rv as a}from"./chunk-met6wtbk.js";import"./chunk-ta6z7k4p.js";import"./chunk-zxptxz2b.js";import"./chunk-7racewc5.js";import"./chunk-e03m4har.js";import"./chunk-vsqx756d.js";import"./chunk-m8kem5ca.js";export{b as rendersAsElement,c as processESImports,d as processComponents,a as freeIdentifiers};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{Bm as b}from"./chunk-3ssjb8cx.js";import{ov as L,sv as R}from"./chunk-czj6nq0b.js";function P(j,U){let Q=1,J=U,B="<template",z="</template";while(J<j.length&&Q>0){let G=j.indexOf("<",J);if(G===-1)break;if(J=G,j.startsWith(B,J)&&(J+B.length>=j.length||/[\s>\/]/.test(j[J+B.length]))){Q++,J+=B.length;continue}if(j.startsWith(z,J)){let W=j.indexOf(">",J+z.length);if(W!==-1){if(Q--,Q===0)return W+1;J=W+1;continue}}J++}return Q===0?J:-1}var F=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function O(j,U){let Q=null;for(let J=U;J<j.length;J++){let B=j[J];if(Q){if(B==="\\"){J++;continue}if(B===Q)Q=null;continue}if(B==='"'||B==="'"){Q=B;continue}if(B===">")return J+1}return-1}function I(j,U,Q){let J=U.toLowerCase(),B=1,z=Q;while(z<j.length){let G=j.indexOf("<",z);if(G===-1)return-1;if(j.startsWith("<!--",G)){let $=j.indexOf("-->",G+4);z=$===-1?j.length:$+3;continue}let W=O(j,G+1);if(W===-1)return-1;let Z=j.slice(G,W),Y=Z.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(Y&&Y[2].toLowerCase()===J){if(Y[1]==="/"){if(B--,B===0)return W}else if(!/\/\s*>$/.test(Z))B++}z=W}return-1}function w(j){let U=[],Q=[],J=/\bslot\s*=\s*(?:"([^"]+)"|'([^']+)')/i,B=0;while(B<j.length){let z=j.indexOf("<",B);if(z===-1)break;if(j.startsWith("<!--",z)){let X=j.indexOf("-->",z+4);B=X===-1?j.length:X+3;continue}let G=O(j,z+1);if(G===-1)break;let W=j.slice(z,G),Z=W.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!Z){B=G;continue}let Y=Z[2].toLowerCase();if(Z[1]==="/"){let X=Q.lastIndexOf(Y);if(X!==-1)Q.splice(X);B=G;continue}let $=/\/\s*>$/.test(W),K=Q.length===0?W.match(J):null;if(K){let X=K[1]||K[2],H=W.replace(J,"").replace(/\s+(?=\/?>$)/,"").replace(/\s{2,}/g," "),_=$||F.has(Y)?-1:I(j,Y,G);if(_===-1)U.push({start:z,end:G,slotName:X,element:H}),B=G;else U.push({start:z,end:_,slotName:X,element:H+j.slice(G,_)}),B=_;continue}if(!$&&!F.has(Y)){if(Q.push(Y),Y==="script"||Y==="style"){let X=j.toLowerCase().indexOf(`</${Y}>`,G);if(X!==-1){B=X;continue}}}B=G}return U}function D(j){let U=[],Q=[],J=/^<template\s+(?:#([a-zA-Z][\w-]*)|v-slot:([a-zA-Z][\w-]*)|slot="([a-zA-Z][\w-]*)")(?:\s*=\s*"([^"]*)")?[^>]*>$/i,B=0;while(B<j.length){let z=j.indexOf("<",B);if(z===-1)break;if(j.startsWith("<!--",z)){let X=j.indexOf("-->",z+4);B=X===-1?j.length:X+3;continue}let G=O(j,z+1);if(G===-1)break;let W=j.slice(z,G),Z=W.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!Z){B=G;continue}let Y=Z[1]==="/",$=Z[2].toLowerCase();if(Y){let X=Q.lastIndexOf($);if(X!==-1)Q.splice(X);B=G;continue}if($==="template"&&Q.length===0){let X=W.match(J);if(X){let H=P(j,G);if(H!==-1){let _=X[1]||X[2]||X[3];U.push({start:z,end:H,slotName:_,content:j.slice(G,H-11).trim(),propsBinding:X[4]||void 0}),B=H;continue}}}if(!/\/\s*>$/.test(W)&&!F.has($)){if(Q.push($),$==="script"||$==="style"){let X=j.toLowerCase().indexOf(`</${$}>`,G);if(X!==-1){B=X;continue}}}B=G}return U}function v(j){let U={default:"",named:new Map},Q=j,J=D(j);for(let z of J)U.named.set(z.slotName,{name:z.slotName,content:z.content,propsBinding:z.propsBinding});J.sort((z,G)=>G.start-z.start);for(let z of J)Q=Q.slice(0,z.start)+Q.slice(z.end);let B=w(Q);for(let z of B){let G=U.named.get(z.slotName);if(G)G.content+=z.element;else U.named.set(z.slotName,{name:z.slotName,content:z.element})}for(let z=B.length-1;z>=0;z--){let G=B[z];Q=Q.slice(0,G.start)+Q.slice(G.end)}return U.default=Q.trim(),U}function S(j){let U=j.match(/name\s*=\s*["']([^"']+)["']/),Q=U?U[1]:"",J={},B=/:([a-zA-Z][\w-]*)\s*=\s*["']([^"']+)["']/g,z;while((z=B.exec(j))!==null)J[z[1]]=z[2];let G=j.match(/<slot[^>]*>([\s\S]*?)<\/slot>/i),W=G?G[1].trim():"";return{name:Q,props:J,defaultContent:W}}async function k(j,U,Q,J){if(!j)return Q;let B=j.content;if(j.propsBinding&&Object.keys(U).length>0){let z=j.propsBinding.trim(),G={...J};if(z.startsWith("{")&&z.endsWith("}")){let W=z.slice(1,-1).split(",").map((Z)=>Z.trim()).filter(Boolean);for(let Z of W){let[Y,$]=Z.split(":").map((X)=>X.trim()),K=$||Y;if(U[Y]!==void 0)G[K]=U[Y]}}else G[z]=U;B=N(B,G)}return B}function N(j,U){return j.replace(/\{\{\s*([^}]+)\s*\}\}/g,(Q,J)=>{try{let B=J.trim(),z=y(B,U);return b(String(z??""))}catch{return`{{ ${J} }}`}})}function y(j,U){if(/^[a-zA-Z_$][\w$]*(\.[a-zA-Z_$][\w$]*)*$/.test(j)){let J=j.split("."),B=U;for(let z of J)if(B&&typeof B==="object"&&z in B)B=B[z];else return;return B}let Q=j.match(/^([a-zA-Z_$][\w$]*)\s*([+\-*/])\s*(\d+)$/);if(Q){let[,J,B,z]=Q,G=U[J],W=parseInt(z,10);if(typeof G==="number")switch(B){case"+":return G+W;case"-":return G-W;case"*":return G*W;case"/":return G/W}}try{if(!L(j))return;return R(j,Object.keys(U))(...Object.values(U))}catch{return}}async function T(j,U,Q){let J=j;J=await C(J,/<slot\s+name\s*=\s*["']([^"']+)["']([^>]*?)(?:\/>|>([\s\S]*?)<\/slot>)/gi,async(G,W,Z,Y)=>{let $=U.named.get(W),K=Y?.trim()||"",X=Z||"",H={},_=/:([a-zA-Z_$][\w$-]*)\s*=\s*["']([^"']+)["']/g,q;while((q=_.exec(X))!==null){let A=q[1],V=q[2];H[A]=y(V,Q)}return await k($,H,K,Q)});let z=/<slot\b((?:"[^"]*"|'[^']*'|[^>"'])*?)\s*(?:\/>|>([\s\S]*?)<\/slot>)/gi;return J=J.replace(z,(G,W,Z)=>{if(/\bname\s*=/.test(W||""))return G;let Y=Z?.trim()||"";return U.default||Y}),J}async function C(j,U,Q){let J=[],B=[];j.replace(U,(W,...Z)=>{let Y=Z[Z.length-2];return B.push({match:W,index:Y}),J.push(Q(W,...Z.slice(0,-2))),W});let z=await Promise.all(J),G=j;for(let W=B.length-1;W>=0;W--){let{match:Z,index:Y}=B[W];G=G.slice(0,Y)+z[W]+G.slice(Y+Z.length)}return G}function E(j){let U=v(j);return{defaultSlot:U.default,namedSlots:U.named}}async function x(j,U,Q,J){return await T(j,{default:U,named:Q},J)}
2
+ import{Bm as b}from"./chunk-2119txb8.js";import{pv as L,tv as R}from"./chunk-met6wtbk.js";function P(j,U){let Q=1,J=U,B="<template",z="</template";while(J<j.length&&Q>0){let G=j.indexOf("<",J);if(G===-1)break;if(J=G,j.startsWith(B,J)&&(J+B.length>=j.length||/[\s>\/]/.test(j[J+B.length]))){Q++,J+=B.length;continue}if(j.startsWith(z,J)){let W=j.indexOf(">",J+z.length);if(W!==-1){if(Q--,Q===0)return W+1;J=W+1;continue}}J++}return Q===0?J:-1}var F=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function O(j,U){let Q=null;for(let J=U;J<j.length;J++){let B=j[J];if(Q){if(B==="\\"){J++;continue}if(B===Q)Q=null;continue}if(B==='"'||B==="'"){Q=B;continue}if(B===">")return J+1}return-1}function I(j,U,Q){let J=U.toLowerCase(),B=1,z=Q;while(z<j.length){let G=j.indexOf("<",z);if(G===-1)return-1;if(j.startsWith("<!--",G)){let $=j.indexOf("-->",G+4);z=$===-1?j.length:$+3;continue}let W=O(j,G+1);if(W===-1)return-1;let Z=j.slice(G,W),Y=Z.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(Y&&Y[2].toLowerCase()===J){if(Y[1]==="/"){if(B--,B===0)return W}else if(!/\/\s*>$/.test(Z))B++}z=W}return-1}function w(j){let U=[],Q=[],J=/\bslot\s*=\s*(?:"([^"]+)"|'([^']+)')/i,B=0;while(B<j.length){let z=j.indexOf("<",B);if(z===-1)break;if(j.startsWith("<!--",z)){let X=j.indexOf("-->",z+4);B=X===-1?j.length:X+3;continue}let G=O(j,z+1);if(G===-1)break;let W=j.slice(z,G),Z=W.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!Z){B=G;continue}let Y=Z[2].toLowerCase();if(Z[1]==="/"){let X=Q.lastIndexOf(Y);if(X!==-1)Q.splice(X);B=G;continue}let $=/\/\s*>$/.test(W),K=Q.length===0?W.match(J):null;if(K){let X=K[1]||K[2],H=W.replace(J,"").replace(/\s+(?=\/?>$)/,"").replace(/\s{2,}/g," "),_=$||F.has(Y)?-1:I(j,Y,G);if(_===-1)U.push({start:z,end:G,slotName:X,element:H}),B=G;else U.push({start:z,end:_,slotName:X,element:H+j.slice(G,_)}),B=_;continue}if(!$&&!F.has(Y)){if(Q.push(Y),Y==="script"||Y==="style"){let X=j.toLowerCase().indexOf(`</${Y}>`,G);if(X!==-1){B=X;continue}}}B=G}return U}function D(j){let U=[],Q=[],J=/^<template\s+(?:#([a-zA-Z][\w-]*)|v-slot:([a-zA-Z][\w-]*)|slot="([a-zA-Z][\w-]*)")(?:\s*=\s*"([^"]*)")?[^>]*>$/i,B=0;while(B<j.length){let z=j.indexOf("<",B);if(z===-1)break;if(j.startsWith("<!--",z)){let X=j.indexOf("-->",z+4);B=X===-1?j.length:X+3;continue}let G=O(j,z+1);if(G===-1)break;let W=j.slice(z,G),Z=W.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!Z){B=G;continue}let Y=Z[1]==="/",$=Z[2].toLowerCase();if(Y){let X=Q.lastIndexOf($);if(X!==-1)Q.splice(X);B=G;continue}if($==="template"&&Q.length===0){let X=W.match(J);if(X){let H=P(j,G);if(H!==-1){let _=X[1]||X[2]||X[3];U.push({start:z,end:H,slotName:_,content:j.slice(G,H-11).trim(),propsBinding:X[4]||void 0}),B=H;continue}}}if(!/\/\s*>$/.test(W)&&!F.has($)){if(Q.push($),$==="script"||$==="style"){let X=j.toLowerCase().indexOf(`</${$}>`,G);if(X!==-1){B=X;continue}}}B=G}return U}function v(j){let U={default:"",named:new Map},Q=j,J=D(j);for(let z of J)U.named.set(z.slotName,{name:z.slotName,content:z.content,propsBinding:z.propsBinding});J.sort((z,G)=>G.start-z.start);for(let z of J)Q=Q.slice(0,z.start)+Q.slice(z.end);let B=w(Q);for(let z of B){let G=U.named.get(z.slotName);if(G)G.content+=z.element;else U.named.set(z.slotName,{name:z.slotName,content:z.element})}for(let z=B.length-1;z>=0;z--){let G=B[z];Q=Q.slice(0,G.start)+Q.slice(G.end)}return U.default=Q.trim(),U}function S(j){let U=j.match(/name\s*=\s*["']([^"']+)["']/),Q=U?U[1]:"",J={},B=/:([a-zA-Z][\w-]*)\s*=\s*["']([^"']+)["']/g,z;while((z=B.exec(j))!==null)J[z[1]]=z[2];let G=j.match(/<slot[^>]*>([\s\S]*?)<\/slot>/i),W=G?G[1].trim():"";return{name:Q,props:J,defaultContent:W}}async function k(j,U,Q,J){if(!j)return Q;let B=j.content;if(j.propsBinding&&Object.keys(U).length>0){let z=j.propsBinding.trim(),G={...J};if(z.startsWith("{")&&z.endsWith("}")){let W=z.slice(1,-1).split(",").map((Z)=>Z.trim()).filter(Boolean);for(let Z of W){let[Y,$]=Z.split(":").map((X)=>X.trim()),K=$||Y;if(U[Y]!==void 0)G[K]=U[Y]}}else G[z]=U;B=N(B,G)}return B}function N(j,U){return j.replace(/\{\{\s*([^}]+)\s*\}\}/g,(Q,J)=>{try{let B=J.trim(),z=y(B,U);return b(String(z??""))}catch{return`{{ ${J} }}`}})}function y(j,U){if(/^[a-zA-Z_$][\w$]*(\.[a-zA-Z_$][\w$]*)*$/.test(j)){let J=j.split("."),B=U;for(let z of J)if(B&&typeof B==="object"&&z in B)B=B[z];else return;return B}let Q=j.match(/^([a-zA-Z_$][\w$]*)\s*([+\-*/])\s*(\d+)$/);if(Q){let[,J,B,z]=Q,G=U[J],W=parseInt(z,10);if(typeof G==="number")switch(B){case"+":return G+W;case"-":return G-W;case"*":return G*W;case"/":return G/W}}try{if(!L(j))return;return R(j,Object.keys(U))(...Object.values(U))}catch{return}}async function T(j,U,Q){let J=j;J=await C(J,/<slot\s+name\s*=\s*["']([^"']+)["']([^>]*?)(?:\/>|>([\s\S]*?)<\/slot>)/gi,async(G,W,Z,Y)=>{let $=U.named.get(W),K=Y?.trim()||"",X=Z||"",H={},_=/:([a-zA-Z_$][\w$-]*)\s*=\s*["']([^"']+)["']/g,q;while((q=_.exec(X))!==null){let A=q[1],V=q[2];H[A]=y(V,Q)}return await k($,H,K,Q)});let z=/<slot\b((?:"[^"]*"|'[^']*'|[^>"'])*?)\s*(?:\/>|>([\s\S]*?)<\/slot>)/gi;return J=J.replace(z,(G,W,Z)=>{if(/\bname\s*=/.test(W||""))return G;let Y=Z?.trim()||"";return U.default||Y}),J}async function C(j,U,Q){let J=[],B=[];j.replace(U,(W,...Z)=>{let Y=Z[Z.length-2];return B.push({match:W,index:Y}),J.push(Q(W,...Z.slice(0,-2))),W});let z=await Promise.all(J),G=j;for(let W=B.length-1;W>=0;W--){let{match:Z,index:Y}=B[W];G=G.slice(0,Y)+z[W]+G.slice(Y+Z.length)}return G}function E(j){let U=v(j);return{defaultSlot:U.default,namedSlots:U.named}}async function x(j,U,Q,J){return await T(j,{default:U,named:Q},J)}
3
3
  export{v as Lg,S as Mg,k as Ng,T as Og,E as Pg,x as Qg};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{bt as a,ct as b,dt as c,et as d,ft as e,gt as f,ht as g,it as h,jt as i,kt as j,lt as k,mt as l}from"./chunk-kjd9hbg4.js";import"./chunk-ejwfnttb.js";import"./chunk-emjmshj8.js";export{e as resolveUserCssConfig,c as resetCssCache,h as rebuildCss,d as loadCssEngineConfig,b as loadCssEngine,l as injectCss,a as getCssServeAsset,i as getCachedCSS,k as generateCss,f as fingerprintConfig,j as extractClassNames,g as buildCss};
2
+ import{ct as a,dt as b,et as c,ft as d,gt as e,ht as f,it as g,jt as h,kt as i,lt as j,mt as k,nt as l}from"./chunk-dj24n5n7.js";import"./chunk-w1asc0zd.js";import"./chunk-m8kem5ca.js";export{e as resolveUserCssConfig,c as resetCssCache,h as rebuildCss,d as loadCssEngineConfig,b as loadCssEngine,l as injectCss,a as getCssServeAsset,i as getCachedCSS,k as generateCss,f as fingerprintConfig,j as extractClassNames,g as buildCss};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Ao as x,Io as k,Kp as w,Tl as A,Ul as b,_n as M,an as T,bn as y,lm as B,mo as R,nm as F,ur as P}from"./chunk-3ssjb8cx.js";import{Rw as v}from"./chunk-emjmshj8.js";function j(K){return K.endsWith(".md")||K.endsWith(".markdown")}function C(K){let z=[];_(/<pre\b[^>]*>[\s\S]*?<\/pre>/gi);let G=[...z];_(/<code\b[^>]*>[\s\S]*?<\/code>/gi,G);function _(J,Y){let $;while(($=J.exec(K))!==null){let q=$.index,N=q+$[0].length;if(Y?.some((X)=>q>=X.start&&N<=X.end))continue;z.push({start:q,end:N})}}if(z.length===0)return K;z.sort((J,Y)=>J.start-Y.start);let U="",Q=0;for(let J of z){if(J.start<Q)continue;U+=K.slice(Q,J.start),U+=`@raw${K.slice(J.start,J.end)}@endraw`,Q=J.end}return U+=K.slice(Q),U}async function D(K,z={}){let{data:G,content:_}=A(K),Q=await(z.renderer??((J)=>b(J)))(_);return{html:C(Q),frontmatter:G??{}}}import{dirname as f,resolve as H}from"path";function S(K){let z=K,G=M(K);if(G)z=G.content.trim();let _=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,U=[],Q=[],J=[],Y=(N)=>/\b(?:state|derived|effect|batch)\s*(?:<[^<>()]*>)?\s*\(/.test(N),$;while(($=_.exec(K))!==null){let N=$[1],X=$[2],E=$[0],Z=N.includes("server");if(Y(X))J.push(E);else if(Z)Q.push(X);else U.push(E)}let q=z;{let N=/<script\b(?![^>]*\b(?:client|type\s*=\s*["']module["']|src\s*=))[^>]*>/gi,X,E=[];while((X=N.exec(q))!==null){let Z=X.index+X[0].length,L=q.indexOf("</script>",Z);if(L===-1)continue;E.push({start:X.index,end:L+9}),N.lastIndex=L+9}for(let Z=E.length-1;Z>=0;Z--)q=q.substring(0,E[Z].start)+q.substring(E[Z].end)}for(let N of U)q=q.replace(N,"");return{templateContent:q,serverScripts:Q,clientScripts:U,signalsScripts:J}}function g(K,z){return`<!DOCTYPE html>
2
+ import{Ao as x,Io as k,Lp as w,Tl as A,Ul as b,_n as M,an as T,bn as y,lm as B,mo as R,nm as F,vr as P}from"./chunk-2119txb8.js";import{Sw as v}from"./chunk-m8kem5ca.js";function j(K){return K.endsWith(".md")||K.endsWith(".markdown")}function C(K){let z=[];_(/<pre\b[^>]*>[\s\S]*?<\/pre>/gi);let G=[...z];_(/<code\b[^>]*>[\s\S]*?<\/code>/gi,G);function _(J,Y){let $;while(($=J.exec(K))!==null){let q=$.index,N=q+$[0].length;if(Y?.some((X)=>q>=X.start&&N<=X.end))continue;z.push({start:q,end:N})}}if(z.length===0)return K;z.sort((J,Y)=>J.start-Y.start);let U="",Q=0;for(let J of z){if(J.start<Q)continue;U+=K.slice(Q,J.start),U+=`@raw${K.slice(J.start,J.end)}@endraw`,Q=J.end}return U+=K.slice(Q),U}async function D(K,z={}){let{data:G,content:_}=A(K),Q=await(z.renderer??((J)=>b(J)))(_);return{html:C(Q),frontmatter:G??{}}}import{dirname as f,resolve as H}from"path";function S(K){let z=K,G=M(K);if(G)z=G.content.trim();let _=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,U=[],Q=[],J=[],Y=(N)=>/\b(?:state|derived|effect|batch)\s*(?:<[^<>()]*>)?\s*\(/.test(N),$;while(($=_.exec(K))!==null){let N=$[1],X=$[2],E=$[0],Z=N.includes("server");if(Y(X))J.push(E);else if(Z)Q.push(X);else U.push(E)}let q=z;{let N=/<script\b(?![^>]*\b(?:client|type\s*=\s*["']module["']|src\s*=))[^>]*>/gi,X,E=[];while((X=N.exec(q))!==null){let Z=X.index+X[0].length,L=q.indexOf("</script>",Z);if(L===-1)continue;E.push({start:X.index,end:L+9}),N.lastIndex=L+9}for(let Z=E.length-1;Z>=0;Z--)q=q.substring(0,E[Z].start)+q.substring(E[Z].end)}for(let N of U)q=q.replace(N,"");return{templateContent:q,serverScripts:Q,clientScripts:U,signalsScripts:J}}function g(K,z){return`<!DOCTYPE html>
3
3
  <html lang="en">
4
4
  <head>
5
5
  <meta charset="UTF-8">
@@ -14,5 +14,5 @@ ${Q.join(`
14
14
  `)}`}else{if(G.processClientScripts!==!1&&Q.length>0){let N=Y.__stx_event_bindings||[],X=B(Y),Z=(await Promise.all(Q.map(async(I)=>{let W=I.match(/<script\b[^>]*>([\s\S]*?)<\/script>/);if(!W)return I;return await F(W[1],{eventBindings:N,templateContent:q,serverData:X,filePath:z})}))).join(`
15
15
  `);if(q.match(/(<\/body>)/i))q=q.replace(/(<\/body>)/i,`${Z}
16
16
  $1`);else q+=`
17
- ${Z}`}q=await R(q)}if(G.wrapInDocument){if(!q.trim().toLowerCase().startsWith("<!doctype")&&!q.trim().toLowerCase().startsWith("<html"))q=g(q,G.title)}if(G.injectCSS)try{let{injectCss:N}=await import("./chunk-3kyydhzt.js");q=await N(q)}catch{}return q}
17
+ ${Z}`}q=await R(q)}if(G.wrapInDocument){if(!q.trim().toLowerCase().startsWith("<!doctype")&&!q.trim().toLowerCase().startsWith("<html"))q=g(q,G.title)}if(G.injectCSS)try{let{injectCss:N}=await import("./chunk-r7q89mv2.js");q=await N(q)}catch{}return q}
18
18
  export{j as pk,C as qk,D as rk,o as sk,r as tk,V as uk};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{$p as f,Io as a,Ko as b,Mo as c,No as d,_p as e,aq as g,bq as h,cq as i,dq as j,eq as k,fq as l,gq as m,hq as n,iq as o,jq as p,kq as q,lq as r,mq as s,nq as t,oq as u,pq as v,qq as w,rq as x,sq as y}from"./chunk-2119txb8.js";import"./chunk-jc6wrxrh.js";import"./chunk-2xpdcr8c.js";import"./chunk-v90kxg77.js";import"./chunk-4arms0am.js";import"./chunk-135mme4g.js";import"./chunk-dj24n5n7.js";import"./chunk-w1asc0zd.js";import"./chunk-kd95t585.js";import"./chunk-1tz8fb87.js";import"./chunk-xk402w4a.js";import"./chunk-dnard9gp.js";import"./chunk-vgx5077x.js";import"./chunk-met6wtbk.js";import"./chunk-ta6z7k4p.js";import"./chunk-zxptxz2b.js";import"./chunk-7racewc5.js";import"./chunk-e03m4har.js";import"./chunk-vsqx756d.js";import"./chunk-m8kem5ca.js";export{e as validateTemplate,g as validateDirective,o as userComponentFileExists,m as transpileTypeScript,q as slotContentHasExpressions,k as shouldTranspileTypeScript,n as scopeOnRootElement,u as resolveTemplatePath,s as renderComponentWithSlot,j as isJavaScriptScript,p as isHydrateTrigger,d as hasVariables,h as hasDirectives,v as getSourceLineInfo,l as getSharedTranspiler,f as getPositionInfo,y as getComponentCacheStats,t as fileExists,a as extractVariables,c as extractScriptFromTemplate,i as extractDirectiveNames,w as createDetailedErrorMessage,b as convertToCommonJS,r as componentClientSignalNames,x as clearComponentCache};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{Rw as H}from"./chunk-emjmshj8.js";import P from"path";var $=/__stxModules\["((?:[^"\\]|\\.)*)"\]/g;function G(...v){let w=new Set;for(let q of v){if(!q||!q.includes("__stxModules["))continue;for(let z of q.matchAll($))try{w.add(JSON.parse(`"${z[1]}"`))}catch{}}return[...w].sort()}async function T(v,w={}){if(v.length===0)return null;let q=process.cwd(),z=[],J=[];v.forEach((j,X)=>{let Z=j.startsWith("npm:")?j.slice(4):P.resolve(q,j),N=`__stxRegistered${X}`,O=JSON.stringify(j);z.push(`import * as ${N} from ${JSON.stringify(Z)};`),J.push(`if (!globalThis.__stxModules[${O}]) globalThis.__stxModules[${O}] = ${N};`)});let L=[...z,"globalThis.__stxModules = globalThis.__stxModules || {};",...J].join(`
3
- `),B;try{let{bundleClientScript:j}=await import("./chunk-3f782ywp.js");B=await j(L,P.join(q,".stx-module-registry.ts"),{projectRoot:q,minify:w.minify,externalizeUserModules:!1})}catch(j){return console.warn("[stx] could not build the page module registry (#1957):",j),null}let{transformAutoImports:Q,generateAutoImportDestructuring:U}=await import("./chunk-a6x0czvr.js"),F=Q(B),V=U(F.stxImports,F.browserImports),{transformStoreImports:W}=await import("./chunk-gxgrzeeh.js");B=W(F.code);let M=JSON.stringify(new Bun.CryptoHasher("md5").update(L).digest("hex").slice(0,12));return[";(function() {"," var __stxBundles = globalThis.__stxModuleBundles || (globalThis.__stxModuleBundles = {});",` if (__stxBundles[${M}]) return;`,` __stxBundles[${M}] = true;`,V,B,"})();"].join(`
2
+ import{Sw as H}from"./chunk-m8kem5ca.js";import P from"path";var $=/__stxModules\["((?:[^"\\]|\\.)*)"\]/g;function G(...v){let w=new Set;for(let q of v){if(!q||!q.includes("__stxModules["))continue;for(let z of q.matchAll($))try{w.add(JSON.parse(`"${z[1]}"`))}catch{}}return[...w].sort()}async function T(v,w={}){if(v.length===0)return null;let q=process.cwd(),z=[],J=[];v.forEach((j,X)=>{let Z=j.startsWith("npm:")?j.slice(4):P.resolve(q,j),N=`__stxRegistered${X}`,O=JSON.stringify(j);z.push(`import * as ${N} from ${JSON.stringify(Z)};`),J.push(`if (!globalThis.__stxModules[${O}]) globalThis.__stxModules[${O}] = ${N};`)});let L=[...z,"globalThis.__stxModules = globalThis.__stxModules || {};",...J].join(`
3
+ `),B;try{let{bundleClientScript:j}=await import("./chunk-p1ycxzwx.js");B=await j(L,P.join(q,".stx-module-registry.ts"),{projectRoot:q,minify:w.minify,externalizeUserModules:!1})}catch(j){return console.warn("[stx] could not build the page module registry (#1957):",j),null}let{transformAutoImports:Q,generateAutoImportDestructuring:U}=await import("./chunk-vnwzzw9j.js"),F=Q(B),V=U(F.stxImports,F.browserImports),{transformStoreImports:W}=await import("./chunk-bqm306xw.js");B=W(F.code);let M=JSON.stringify(new Bun.CryptoHasher("md5").update(L).digest("hex").slice(0,12));return[";(function() {"," var __stxBundles = globalThis.__stxModuleBundles || (globalThis.__stxModuleBundles = {});",` if (__stxBundles[${M}]) return;`,` __stxBundles[${M}] = true;`,V,B,"})();"].join(`
4
4
  `)}export{G as registeredModuleIdsIn,T as buildModuleRegistryScript};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Af as b,zf as a}from"./chunk-5j3v0p6s.js";import"./chunk-198fr2d4.js";import"./chunk-m8kem5ca.js";export{a as handleImageRequest,b as createImageHandler};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Uk as a,Vk as b,Wk as c,Xk as d,Yk as e}from"./chunk-7wj5je2t.js";import"./chunk-m8kem5ca.js";export{b as injectPwaTags,e as generateThemeColorMeta,c as generateSwRegistrationScript,a as generatePwaTags,d as generateManifestLink};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{$v as g,Aw as H,Bw as I,Cw as J,Ew as K,Fw as L,Hw as M,Vv as a,Wv as b,Xv as c,Yv as d,Zv as e,_v as f,aw as h,bw as i,cw as j,dw as k,ew as l,fw as m,gw as n,hw as o,iw as p,jw as q,kw as r,lw as s,mw as t,nw as u,ow as v,pw as w,qw as x,rw as y,sw as z,tw as A,uw as B,vw as C,ww as D,xw as E,yw as F,zw as G}from"./chunk-trva71am.js";import"./chunk-emjmshj8.js";M();export{o as setAppUrl,H as runMiddleware,r as route,j as resolveLayoutChain,s as resetRoutes,z as registerMiddleware,g as patternToRegex,t as navigateTo,h as matchRoute,E as loadMiddlewareFromDirectory,c as isNonPageRoutePattern,b as isNonPageRoutePath,B as hasMiddleware,L as getRouterScriptDev,K as getRouterScript,D as getMiddlewareNames,A as getMiddleware,d as generateRouteTypes,e as generateRouteManifest,n as formatRoutes,m as findErrorPage,f as filePathToPattern,J as extractLayoutMetadata,I as deriveLayoutGroup,q as defineRoutes,p as defineRoute,v as defineMiddleware,y as createStorageManager,w as createServerCookieManager,l as createRouter,F as createRouteLocation,G as createMiddlewareContext,x as createClientCookieManager,C as clearMiddleware,i as bracketPathToRegex,u as abortNavigation,k as Router,a as NON_PAGE_DIRS};
2
+ import{$v as f,Aw as G,Bw as H,Cw as I,Dw as J,Fw as K,Gw as L,Iw as M,Wv as a,Xv as b,Yv as c,Zv as d,_v as e,aw as g,bw as h,cw as i,dw as j,ew as k,fw as l,gw as m,hw as n,iw as o,jw as p,kw as q,lw as r,mw as s,nw as t,ow as u,pw as v,qw as w,rw as x,sw as y,tw as z,uw as A,vw as B,ww as C,xw as D,yw as E,zw as F}from"./chunk-e03m4har.js";import"./chunk-m8kem5ca.js";M();export{o as setAppUrl,H as runMiddleware,r as route,j as resolveLayoutChain,s as resetRoutes,z as registerMiddleware,g as patternToRegex,t as navigateTo,h as matchRoute,E as loadMiddlewareFromDirectory,c as isNonPageRoutePattern,b as isNonPageRoutePath,B as hasMiddleware,L as getRouterScriptDev,K as getRouterScript,D as getMiddlewareNames,A as getMiddleware,d as generateRouteTypes,e as generateRouteManifest,n as formatRoutes,m as findErrorPage,f as filePathToPattern,J as extractLayoutMetadata,I as deriveLayoutGroup,q as defineRoutes,p as defineRoute,v as defineMiddleware,y as createStorageManager,w as createServerCookieManager,l as createRouter,F as createRouteLocation,G as createMiddlewareContext,x as createClientCookieManager,C as clearMiddleware,i as bracketPathToRegex,u as abortNavigation,k as Router,a as NON_PAGE_DIRS};
@@ -2,4 +2,4 @@
2
2
  function A(h){let q=/import\s*\{([^}]+)\}\s*from\s*['"](@stores|stx\/stores)['"]\s*;?\n?/g;h=h.replace(q,(w,j)=>{return`const { ${j.split(",").map((k)=>k.trim()).filter(Boolean).join(", ")} } = window.__STX_STORES__
3
3
  `});let v=/import\s*\{([^}]+)\}\s*from\s*['"]@composables['"]\s*;?\n?/g;return h=h.replace(v,(w,j)=>{return`const { ${j.split(",").map((k)=>k.trim()).filter(Boolean).join(", ")} } = window.__composables
4
4
  `}),h}function B(h){return h.replace(/^import\s+[^'"]*?from\s*['"][^'"]+['"]\s*;?[ \t]*$/gm,"").replace(/^import\s+['"][^'"]+['"]\s*;?[ \t]*$/gm,"")}
5
- export{A as uv,B as vv};
5
+ export{A as vv,B as wv};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{fi as a,gi as b,hi as c}from"./chunk-0ppgyq8q.js";import"./chunk-ra1s4s6b.js";import"./chunk-qg0w5tjb.js";import"./chunk-7rj4h2t2.js";import"./chunk-qjvny3wf.js";import"./chunk-2119txb8.js";import"./chunk-jc6wrxrh.js";import"./chunk-2xpdcr8c.js";import"./chunk-v90kxg77.js";import"./chunk-4arms0am.js";import"./chunk-135mme4g.js";import"./chunk-dj24n5n7.js";import"./chunk-w1asc0zd.js";import"./chunk-kd95t585.js";import"./chunk-1tz8fb87.js";import"./chunk-xk402w4a.js";import"./chunk-dnard9gp.js";import"./chunk-vgx5077x.js";import"./chunk-met6wtbk.js";import"./chunk-ta6z7k4p.js";import"./chunk-zxptxz2b.js";import"./chunk-7racewc5.js";import"./chunk-e03m4har.js";import"./chunk-vsqx756d.js";import"./chunk-m8kem5ca.js";export{a as listComposableModules,b as getComposableScript,c as clearComposableCache};
@@ -9,4 +9,4 @@ function G(H,M){let j=H[M],J=M+1;while(J<H.length){if(H[J]==="\\"){J+=2;continue
9
9
  `:" ",j++}M+=" ",j++,J=z,U="";continue}if(V==="/"&&P(J,U)){let $=Q(H,j);if($!==-1){M+=`/${" ".repeat($-j-2)}/`,j=$,J=z,U="";continue}}if(V==="`"){M+=" ",j++;while(j<H.length&&H[j]!=="`"){if(H[j]==="\\"){M+=" ",j+=2;continue}if(H[j]==="$"&&H[j+1]==="{"){let $=j+2,B=F(H,$);if(M+=" ",M+=X(H.slice($,B)),B<H.length)M+=" ";j=B+1;continue}M+=H[j]===`
10
10
  `?`
11
11
  `:" ",j++}M+=" ",j++,J=z,U="";continue}if(M+=V,j++,/[\w$]/.test(V))U=/[\w$]/.test(J)?U+V:V,J=V;else if(!/\s/.test(V))J=V,U=""}return M}function Y(H){let M=new Uint16Array(H.length),j=0,J=!0;for(let U=0;U<H.length;U++){let Z=H[U];if(Z===")"||Z==="]"||Z==="}")if(j===0)J=!1;else j--;if(M[U]=j,Z==="("||Z==="["||Z==="{")j++}return{depths:M,balanced:J&&j===0}}
12
- export{F as os,X as ps,Y as qs};
12
+ export{F as ps,X as qs,Y as rs};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import"./chunk-emjmshj8.js";var Z=0;function $(){return`eb-${++Z}-${Date.now().toString(36)}`}var U=/<!--stx-render-failed:([a-z-]+)-->/g;function w(q){return q.replace(U,"")}function O(q,z={},J){let j=/@errorBoundary(?:\s*\(([^)]*)\))?\s*([\s\S]*?)@fallback\s*([\s\S]*?)@enderrorBoundary/gi;return q.replace(j,(Q,P,T,W)=>{let X=$(),Y=C(P||"");return G(X,T.trim(),W.trim(),Y)})}function C(q){let z={},J=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\w+))/g,j;while((j=J.exec(q))!==null){let Q=j[1],P=j[2]||j[3]||j[4];switch(Q){case"id":z.id=P;break;case"logErrors":z.logErrors=P==="true";break}}return z}function G(q,z,J,j){let Q=j.logErrors!==!1,P=U.test(z);U.lastIndex=0;let T=P?` <div class="stx-error-boundary-fallback" data-boundary-fallback="${q}">
2
+ import"./chunk-m8kem5ca.js";var Z=0;function $(){return`eb-${++Z}-${Date.now().toString(36)}`}var U=/<!--stx-render-failed:([a-z-]+)-->/g;function w(q){return q.replace(U,"")}function O(q,z={},J){let j=/@errorBoundary(?:\s*\(([^)]*)\))?\s*([\s\S]*?)@fallback\s*([\s\S]*?)@enderrorBoundary/gi;return q.replace(j,(Q,P,T,W)=>{let X=$(),Y=C(P||"");return G(X,T.trim(),W.trim(),Y)})}function C(q){let z={},J=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\w+))/g,j;while((j=J.exec(q))!==null){let Q=j[1],P=j[2]||j[3]||j[4];switch(Q){case"id":z.id=P;break;case"logErrors":z.logErrors=P==="true";break}}return z}function G(q,z,J,j){let Q=j.logErrors!==!1,P=U.test(z);U.lastIndex=0;let T=P?` <div class="stx-error-boundary-fallback" data-boundary-fallback="${q}">
3
3
  ${J}
4
4
  </div>`:` <div class="stx-error-boundary-content" data-boundary-content="${q}">
5
5
  ${w(z)}
@@ -1,7 +1,7 @@
1
1
  // @bun
2
- import{Hu as Y,Xu as y,kv as A,mv as H,qv as q,sv as b}from"./chunk-czj6nq0b.js";import M from"path";class S{source;pos=0;line=1;column=0;tokens=[];constructor(K){this.source=K}tokenize(){this.tokens=[],this.pos=0,this.line=1,this.column=0;while(this.pos<this.source.length){let K=this.nextToken();if(K)this.tokens.push(K)}return this.tokens.push({type:"EOF",value:"",start:this.pos,end:this.pos,line:this.line,column:this.column}),this.tokens}nextToken(){if(this.pos>=this.source.length)return null;let K=this.pos,Q=this.line,Z=this.column,$=this.source[this.pos];if(/\s/.test($))return this.readWhitespace(K,Q,Z);if($==="/"&&this.peek(1)==="/")return this.readLineComment(K,Q,Z);if($==="/"&&this.peek(1)==="*")return this.readBlockComment(K,Q,Z);if($==='"'||$==="'")return this.readString($,K,Q,Z);if($==="`")return this.readTemplateString(K,Q,Z);if(/\d/.test($)||$==="."&&/\d/.test(this.peek(1)||""))return this.readNumber(K,Q,Z);if(/[a-z_$]/i.test($))return this.readIdentifier(K,Q,Z);if($==="{"){if(this.peek(1)==="{"&&this.peek(2)==="{")return this.advance(3),{type:"RAW_START",value:"{{{",start:K,end:this.pos,line:Q,column:Z};if(this.peek(1)==="{")return this.advance(2),{type:"EXPRESSION_START",value:"{{",start:K,end:this.pos,line:Q,column:Z};if(this.peek(1)==="!"&&this.peek(2)==="!")return this.advance(3),{type:"RAW_START",value:"{!!",start:K,end:this.pos,line:Q,column:Z}}if($==="}"){if(this.peek(1)==="}"&&this.peek(2)==="}")return this.advance(3),{type:"RAW_END",value:"}}}",start:K,end:this.pos,line:Q,column:Z};if(this.peek(1)==="}")return this.advance(2),{type:"EXPRESSION_END",value:"}}",start:K,end:this.pos,line:Q,column:Z}}if($==="!"&&this.peek(1)==="!"&&this.peek(2)==="}")return this.advance(3),{type:"RAW_END",value:"!!}",start:K,end:this.pos,line:Q,column:Z};if($==="@"&&/[a-z]/i.test(this.peek(1)||""))return this.readDirective(K,Q,Z);let z=["===","!==","==","!=","<=",">=","&&","||","??","++","--","+=","-=","*=","/=","%=","**","=>","?.","...","<<",">>",">>>","&=","|=","^="];for(let j of z)if(this.source.slice(this.pos,this.pos+j.length)===j)return this.advance(j.length),{type:"OPERATOR",value:j,start:K,end:this.pos,line:Q,column:Z};if(/[+\-*/%<>=!&|^~?:]/.test($))return this.advance(),{type:"OPERATOR",value:$,start:K,end:this.pos,line:Q,column:Z};if(/[()[\]{},;.]/.test($))return this.advance(),{type:"PUNCTUATION",value:$,start:K,end:this.pos,line:Q,column:Z};return this.advance(),{type:"PUNCTUATION",value:$,start:K,end:this.pos,line:Q,column:Z}}readWhitespace(K,Q,Z){while(this.pos<this.source.length&&/\s/.test(this.source[this.pos]))this.advance();return{type:"WHITESPACE",value:this.source.slice(K,this.pos),start:K,end:this.pos,line:Q,column:Z}}readLineComment(K,Q,Z){this.advance(2);while(this.pos<this.source.length&&this.source[this.pos]!==`
2
+ import{Iu as Y,Yu as y,lv as A,nv as H,rv as q,tv as b}from"./chunk-met6wtbk.js";import M from"path";class S{source;pos=0;line=1;column=0;tokens=[];constructor(K){this.source=K}tokenize(){this.tokens=[],this.pos=0,this.line=1,this.column=0;while(this.pos<this.source.length){let K=this.nextToken();if(K)this.tokens.push(K)}return this.tokens.push({type:"EOF",value:"",start:this.pos,end:this.pos,line:this.line,column:this.column}),this.tokens}nextToken(){if(this.pos>=this.source.length)return null;let K=this.pos,Q=this.line,Z=this.column,$=this.source[this.pos];if(/\s/.test($))return this.readWhitespace(K,Q,Z);if($==="/"&&this.peek(1)==="/")return this.readLineComment(K,Q,Z);if($==="/"&&this.peek(1)==="*")return this.readBlockComment(K,Q,Z);if($==='"'||$==="'")return this.readString($,K,Q,Z);if($==="`")return this.readTemplateString(K,Q,Z);if(/\d/.test($)||$==="."&&/\d/.test(this.peek(1)||""))return this.readNumber(K,Q,Z);if(/[a-z_$]/i.test($))return this.readIdentifier(K,Q,Z);if($==="{"){if(this.peek(1)==="{"&&this.peek(2)==="{")return this.advance(3),{type:"RAW_START",value:"{{{",start:K,end:this.pos,line:Q,column:Z};if(this.peek(1)==="{")return this.advance(2),{type:"EXPRESSION_START",value:"{{",start:K,end:this.pos,line:Q,column:Z};if(this.peek(1)==="!"&&this.peek(2)==="!")return this.advance(3),{type:"RAW_START",value:"{!!",start:K,end:this.pos,line:Q,column:Z}}if($==="}"){if(this.peek(1)==="}"&&this.peek(2)==="}")return this.advance(3),{type:"RAW_END",value:"}}}",start:K,end:this.pos,line:Q,column:Z};if(this.peek(1)==="}")return this.advance(2),{type:"EXPRESSION_END",value:"}}",start:K,end:this.pos,line:Q,column:Z}}if($==="!"&&this.peek(1)==="!"&&this.peek(2)==="}")return this.advance(3),{type:"RAW_END",value:"!!}",start:K,end:this.pos,line:Q,column:Z};if($==="@"&&/[a-z]/i.test(this.peek(1)||""))return this.readDirective(K,Q,Z);let z=["===","!==","==","!=","<=",">=","&&","||","??","++","--","+=","-=","*=","/=","%=","**","=>","?.","...","<<",">>",">>>","&=","|=","^="];for(let j of z)if(this.source.slice(this.pos,this.pos+j.length)===j)return this.advance(j.length),{type:"OPERATOR",value:j,start:K,end:this.pos,line:Q,column:Z};if(/[+\-*/%<>=!&|^~?:]/.test($))return this.advance(),{type:"OPERATOR",value:$,start:K,end:this.pos,line:Q,column:Z};if(/[()[\]{},;.]/.test($))return this.advance(),{type:"PUNCTUATION",value:$,start:K,end:this.pos,line:Q,column:Z};return this.advance(),{type:"PUNCTUATION",value:$,start:K,end:this.pos,line:Q,column:Z}}readWhitespace(K,Q,Z){while(this.pos<this.source.length&&/\s/.test(this.source[this.pos]))this.advance();return{type:"WHITESPACE",value:this.source.slice(K,this.pos),start:K,end:this.pos,line:Q,column:Z}}readLineComment(K,Q,Z){this.advance(2);while(this.pos<this.source.length&&this.source[this.pos]!==`
3
3
  `)this.advance();return{type:"COMMENT",value:this.source.slice(K,this.pos),start:K,end:this.pos,line:Q,column:Z}}readBlockComment(K,Q,Z){this.advance(2);while(this.pos<this.source.length-1){if(this.source[this.pos]==="*"&&this.source[this.pos+1]==="/"){this.advance(2);break}this.advance()}return{type:"COMMENT",value:this.source.slice(K,this.pos),start:K,end:this.pos,line:Q,column:Z}}readString(K,Q,Z,$){this.advance();while(this.pos<this.source.length){let z=this.source[this.pos];if(z==="\\"){this.advance(2);continue}if(z===K){this.advance();break}this.advance()}return{type:"STRING",value:this.source.slice(Q,this.pos),start:Q,end:this.pos,line:Z,column:$}}readTemplateString(K,Q,Z){this.advance();let $=0,z=256;while(this.pos<this.source.length){let j=this.source[this.pos];if(j==="\\"){this.advance(2);continue}if(j==="$"&&this.peek(1)==="{"){if($>=z){this.pos=this.source.length;break}this.advance(2),$++;continue}if(j==="{"&&$>0){$++,this.advance();continue}if(j==="}"&&$>0){$--,this.advance();continue}if(j==="`"&&$===0){this.advance();break}this.advance()}return{type:"TEMPLATE_STRING",value:this.source.slice(K,this.pos),start:K,end:this.pos,line:Q,column:Z}}readNumber(K,Q,Z){if(this.source[this.pos]==="0"){let $=this.peek(1)?.toLowerCase();if($==="x"||$==="o"||$==="b"){this.advance(2);while(this.pos<this.source.length&&/[\da-f_]/i.test(this.source[this.pos]))this.advance();return{type:"NUMBER",value:this.source.slice(K,this.pos),start:K,end:this.pos,line:Q,column:Z}}}while(this.pos<this.source.length&&/[\d_]/.test(this.source[this.pos]))this.advance();if(this.source[this.pos]==="."&&/\d/.test(this.peek(1)||"")){this.advance();while(this.pos<this.source.length&&/[\d_]/.test(this.source[this.pos]))this.advance()}if(/e/i.test(this.source[this.pos]||"")){if(this.advance(),/[+-]/.test(this.source[this.pos]||""))this.advance();while(this.pos<this.source.length&&/[\d_]/.test(this.source[this.pos]))this.advance()}if(this.source[this.pos]==="n")this.advance();return{type:"NUMBER",value:this.source.slice(K,this.pos),start:K,end:this.pos,line:Q,column:Z}}readIdentifier(K,Q,Z){while(this.pos<this.source.length&&/[\w$]/.test(this.source[this.pos]))this.advance();return{type:"IDENTIFIER",value:this.source.slice(K,this.pos),start:K,end:this.pos,line:Q,column:Z}}readDirective(K,Q,Z){this.advance();while(this.pos<this.source.length&&/[a-z]/i.test(this.source[this.pos]))this.advance();return{type:"DIRECTIVE",value:this.source.slice(K,this.pos),start:K,end:this.pos,line:Q,column:Z}}advance(K=1){for(let Q=0;Q<K&&this.pos<this.source.length;Q++){if(this.source[this.pos]===`
4
4
  `)this.line++,this.column=0;else this.column++;this.pos++}}peek(K){return this.source[this.pos+K]}saveState(){return{pos:this.pos,line:this.line,column:this.column}}restoreState(K){this.pos=K.pos,this.line=K.line,this.column=K.column}}function D(K,Q,Z,$=0){let z=0,j=$,J=null,W=0,X=!1;while(j<K.length){let B=K[j];if(J&&X){X=!1,j++;continue}if(J&&B==="\\"){X=!0,j++;continue}if(X=!1,(B==='"'||B==="'"||B==="`")&&!J){J=B,j++;continue}if(B===J&&J!=="`"){J=null,j++;continue}if(J==="`"&&B==="$"&&K[j+1]==="{"){W++,j+=2;continue}if(W>0&&B==="}"){W--,j++;continue}if(B==="`"&&J==="`"&&W===0){J=null,j++;continue}if(J){j++;continue}if(B===Q)z++;else if(B===Z){if(z--,z===0)return j}j++}return-1}function g(K,Q){let Z=Q,$={paren:0,bracket:0,brace:0},z=null,j=0;while(Z<K.length){let J=K[Z];if((Z>0?K[Z-1]:"")==="\\"&&z){Z++;continue}if((J==='"'||J==="'")&&!z){z=J,Z++;continue}if(J===z&&z!=="`"){z=null,Z++;continue}if(J==="`"&&!z){z="`",Z++;continue}if(J==="`"&&z==="`"&&j===0){z=null,Z++;continue}if(z==="`"&&J==="$"&&K[Z+1]==="{"){j++,Z+=2;continue}if(j>0){if(J==="{")j++;else if(J==="}")j--;Z++;continue}if(z){Z++;continue}if($.paren===0&&$.bracket===0&&$.brace===0){if(K.slice(Z,Z+2)==="}}"||K.slice(Z,Z+3)==="!!}")break;if(J===","||J===";")break}if(J==="(")$.paren++;else if(J===")"){if($.paren--,$.paren<0)break}else if(J==="[")$.bracket++;else if(J==="]"){if($.bracket--,$.bracket<0)break}else if(J==="{")$.brace++;else if(J==="}"){if($.brace--,$.brace<0)break}Z++}return{expression:K.slice(Q,Z),endPos:Z}}function l(K){let Q=[],Z="",$={paren:0,bracket:0,brace:0},z=null,j=0;for(let J=0;J<K.length;J++){let W=K[J];if((J>0?K[J-1]:"")==="\\"&&z){Z+=W;continue}if((W==='"'||W==="'")&&!z){z=W,Z+=W;continue}if(W===z&&z!=="`"){z=null,Z+=W;continue}if(W==="`"&&!z){z="`",Z+=W;continue}if(W==="`"&&z==="`"&&j===0){z=null,Z+=W;continue}if(z==="`"&&W==="$"&&K[J+1]==="{"){j++,Z+=W+K[J+1],J++;continue}if(j>0&&W==="{"){j++,Z+=W;continue}if(j>0&&W==="}"){j--,Z+=W;continue}if(z){Z+=W;continue}if(W==="(")$.paren++;else if(W===")")$.paren--;else if(W==="[")$.bracket++;else if(W==="]")$.bracket--;else if(W==="{")$.brace++;else if(W==="}")$.brace--;if(W==="|"&&K[J+1]!=="|"&&(J===0||K[J-1]!=="|")&&K[J-1]!=="\\"&&$.paren===0&&$.bracket===0&&$.brace===0){Q.push(Z.trim()),Z="";continue}if(W==="|"&&K[J-1]==="\\"&&!z){Z=Z.slice(0,-1)+W;continue}Z+=W}if(Z.trim())Q.push(Z.trim());return Q}function C(K,Q){let Z=[];Q.lastIndex=0;let $;while(($=Q.exec(K))!==null){let z=$.index,j=z+$[0].length-1,J=D(K,"(",")",j);if(J===-1){Z.push({start:z,end:-1,args:"",call:K.slice(z,Math.min(K.length,z+80))}),Q.lastIndex=j+1;continue}Z.push({start:z,end:J+1,args:K.slice(j+1,J),call:K.slice(z,J+1)}),Q.lastIndex=J+1}return Z}function w(K,Q,Z,$){let z="",j=0;for(let J of C(K,Q)){if(z+=K.slice(j,J.start),J.end===-1){z+=$(J.call),j=J.start;continue}z+=Z(J.args,J.call),j=J.end}return z+K.slice(j)}function k(K){let Q=[],Z=0,$=null,z="";for(let j=0;j<K.length;j++){let J=K[j];if($){if(z+=J,J==="\\"&&j+1<K.length){z+=K[++j];continue}if(J===$)$=null;continue}if(J==="'"||J==='"'||J==="`")$=J;else if(J==="("||J==="["||J==="{")Z++;else if(J===")"||J==="]"||J==="}")Z--;else if(J===","&&Z===0){Q.push(z.trim()),z="";continue}z+=J}if(z.trim())Q.push(z.trim());return Q}function V(K){let Q=K.trim(),Z=Q[0];if(Z!=="'"&&Z!=='"'&&Z!=="`"||Q.length<2||Q.at(-1)!==Z)return null;let $="";for(let z=1;z<Q.length-1;z++){let j=Q[z];if(j==="\\"&&z+1<Q.length-1){let J=Q[++z];$+=J==="n"?`
5
5
  `:J==="t"?"\t":J;continue}if(j===Z)return null;if(Z==="`"&&j==="$"&&Q[z+1]==="{")return null;$+=j}return $}var x=new Set(["true","false","null","undefined","typeof","void","new","in","of","instanceof","this","delete","await","async","function","return","NaN","Infinity"]);function N(K,Q){let Z=K.trim();if(!Z)return{ok:!1,message:"the argument is empty",code:Y.INVALID_DIRECTIVE_SYNTAX};let $=A(Z);if($)return{ok:!1,message:`the expression is not allowed (${$})`,code:Y.UNSAFE_EXPRESSION};let z=H(Q),j;try{j=b(Z,Object.keys(z))(...Object.values(z))}catch(W){return{ok:!1,message:`the expression could not be evaluated: ${W instanceof Error?W.message:String(W)}`,code:Y.EVALUATION_ERROR}}if(j!==void 0&&j!==null)return{ok:!0,value:j};let J=[...new Set(q(Z))].filter((W)=>!x.has(W)&&!(W in z)&&!(W in globalThis));if(J.length>0)return{ok:!1,message:`${J.map((X)=>`"${X}"`).join(", ")} ${J.length===1?"is":"are"} not defined here. Values a directive reads must come from <script server> or the render context; a plain <script> runs in the browser. To pass literal text, quote it.`,code:Y.UNDEFINED_VARIABLE};if(j===void 0&&(Z.startsWith("{")||Z.startsWith("[")))return{ok:!1,message:"the expression threw while it was evaluated",code:Y.EVALUATION_ERROR};return{ok:!0,value:j}}function _(K){if(K===null)return"null";if(Array.isArray(K))return"an array";if(typeof K==="object")return"an object";if(typeof K==="string")return`a string ("${K.length>40?`${K.slice(0,40)}...`:K}")`;return`${/^[aeiou]/.test(typeof K)?"an":"a"} ${typeof K}`}function T(K){return typeof K==="object"&&K!==null&&!Array.isArray(K)}function L(K){if(!K)return"";return M.isAbsolute(K)?M.relative(process.cwd(),K)||K:K}function G(K){let Q=K.replace(/\s+/g," ").trim();return Q.length>80?`${Q.slice(0,77)}...`:Q}function I(K,Q,Z,$,z=Y.EVALUATION_ERROR){let j=$?` in ${L($)}`:"";return console.warn(`[stx] ${G(Q)}${j}: ${Z}`),y(K,`${G(Q)}: ${Z}`,z)}function a(K,Q,Z){let $=Z?` in ${L(Z)}`:"";console.warn(`[stx] ${G(K)}${$}: ${Q}`)}var v=["og:","article:","book:","profile:","fb:","music:","video:"],d=/^[a-z][\w-]*(?::[\w:-]+)?$/i;function E(K,Q){if(K.length<1)return{kind:"error",message:"meta directive requires at least the meta name",code:Y.INVALID_DIRECTIVE_SYNTAX};if(K.length>2)return{kind:"error",message:`@meta takes a name and a value, got ${K.length} arguments`,code:Y.INVALID_DIRECTIVE_SYNTAX};let Z=m(K[0],Q);if(typeof Z!=="string")return Z;let $;if(K.length===2){let j=h(K[1],Q);if(typeof j!=="string")return j;$=j}else{let j=Z.includes(":")?Z.slice(Z.indexOf(":")+1):Z,J=Q.openGraph,W=Q[j]??(T(J)?J[j]:void 0);$=W===void 0||W===null||typeof W==="object"?"":String(W)}if(!$)return{kind:"empty"};return{kind:"tag",tag:v.some((j)=>Z.startsWith(j))?{property:Z,content:$}:{name:Z,content:$}}}function m(K,Q){let Z=V(K);if(Z!==null)return Z.trim()?Z:{kind:"error",message:"the meta name is empty",code:Y.INVALID_DIRECTIVE_SYNTAX};if(d.test(K.trim()))return K.trim();let $=N(K,Q);if(!$.ok)return{kind:"error",message:`meta name: ${$.message}`,code:$.code};if(typeof $.value!=="string"||!$.value.trim())return{kind:"error",message:`the meta name must be a non-empty string, got ${_($.value)}`,code:Y.TYPE_ERROR};return $.value}function h(K,Q){let Z=V(K);if(Z!==null)return Z;let $=N(K,Q);if(!$.ok)return{kind:"error",message:$.message,code:$.code};let z=$.value;if(z===void 0||z===null||z===!1)return"";if(Array.isArray(z))return z.filter((j)=>j!==void 0&&j!==null&&j!=="").map(String).join(", ");if(typeof z==="object"&&!(z instanceof Date))return{kind:"error",message:`the content must be text, got ${_(z)}`,code:Y.TYPE_ERROR};return String(z)}var O={},p=[],F={};function jK(){return O}function zK(){return F}function JK(){O={},p.length=0,F={}}function P(K){O=R(O,K)}function R(K,Q){return{title:Q.title??K.title,titleTemplate:Q.titleTemplate??K.titleTemplate,base:Q.base??K.base,meta:[...K.meta||[],...Q.meta||[]],link:[...K.link||[],...Q.link||[]],script:[...K.script||[],...Q.script||[]],style:[...K.style||[],...Q.style||[]],htmlAttrs:{...K.htmlAttrs,...Q.htmlAttrs},bodyAttrs:{...K.bodyAttrs,...Q.bodyAttrs}}}function u(K){P(f(K))}function f(K){let Q=[];if(K.description)Q.push({name:"description",content:K.description});if(K.keywords){let X=Array.isArray(K.keywords)?K.keywords.join(", "):K.keywords;Q.push({name:"keywords",content:X})}if(K.author)Q.push({name:"author",content:K.author});if(K.robots)Q.push({name:"robots",content:K.robots});let Z=K.ogTitle??K.title,$=K.ogDescription??K.description;if(Z)Q.push({property:"og:title",content:Z});if($)Q.push({property:"og:description",content:$});if(K.ogImage){if(Q.push({property:"og:image",content:K.ogImage}),K.ogImageType)Q.push({property:"og:image:type",content:K.ogImageType});if(K.ogImageWidth)Q.push({property:"og:image:width",content:String(K.ogImageWidth)});if(K.ogImageHeight)Q.push({property:"og:image:height",content:String(K.ogImageHeight)});if(K.ogImageAlt)Q.push({property:"og:image:alt",content:K.ogImageAlt})}if(K.ogUrl)Q.push({property:"og:url",content:K.ogUrl});if(K.ogType)Q.push({property:"og:type",content:K.ogType});if(K.ogSiteName)Q.push({property:"og:site_name",content:K.ogSiteName});if(K.ogLocale)Q.push({property:"og:locale",content:K.ogLocale});if(K.profileFirstName)Q.push({property:"profile:first_name",content:K.profileFirstName});if(K.profileLastName)Q.push({property:"profile:last_name",content:K.profileLastName});if(K.profileUsername)Q.push({property:"profile:username",content:K.profileUsername});let z=K.twitterTitle??K.title,j=K.twitterDescription??K.description,J=K.twitterImage??K.ogImage;if(K.twitterCard)Q.push({name:"twitter:card",content:K.twitterCard});if(z)Q.push({name:"twitter:title",content:z});if(j)Q.push({name:"twitter:description",content:j});if(J){Q.push({name:"twitter:image",content:J});let X=K.twitterImageAlt??(K.twitterImage?void 0:K.ogImageAlt);if(X)Q.push({name:"twitter:image:alt",content:X})}if(K.twitterSite)Q.push({name:"twitter:site",content:K.twitterSite});if(K.twitterCreator)Q.push({name:"twitter:creator",content:K.twitterCreator});if(K.articleAuthor)Q.push({property:"article:author",content:K.articleAuthor});if(K.articlePublishedTime)Q.push({property:"article:published_time",content:K.articlePublishedTime});if(K.articleModifiedTime)Q.push({property:"article:modified_time",content:K.articleModifiedTime});if(K.articleSection)Q.push({property:"article:section",content:K.articleSection});if(K.articleTags)for(let X of K.articleTags)Q.push({property:"article:tag",content:X});let W=[];if(K.canonical)W.push({rel:"canonical",href:K.canonical});return{title:K.title,titleTemplate:K.titleTemplate,meta:Q,link:W}}function WK(K){if(F={...F,...K},K.title||K.description)u({title:K.title,description:K.description})}function XK(K){let Q=typeof K==="function"?K():K;P({title:Q})}function YK(K=O){let Q=[];if(K.title){let Z=K.title;if(K.titleTemplate)Z=typeof K.titleTemplate==="function"?K.titleTemplate(Z):K.titleTemplate.replace("%s",Z);Q.push(`<title>${U(Z)}</title>`)}if(K.base){let Z=Object.entries(K.base).map(([$,z])=>`${$}="${U(z)}"`).join(" ");Q.push(`<base ${Z}>`)}for(let Z of K.meta||[]){let $=Object.entries(Z).filter(([z,j])=>j!==void 0).map(([z,j])=>{return`${z==="httpEquiv"?"http-equiv":z}="${U(String(j))}"`}).join(" ");Q.push(`<meta ${$}>`)}for(let Z of K.link||[]){let $=Object.entries(Z).filter(([z,j])=>j!==void 0).map(([z,j])=>`${z}="${U(String(j))}"`).join(" ");Q.push(`<link ${$}>`)}for(let Z of K.script||[]){let{content:$,...z}=Z,j=Object.entries(z).filter(([J,W])=>W!==void 0).map(([J,W])=>{if(typeof W==="boolean")return W?J:"";return`${J}="${U(String(W))}"`}).filter(Boolean).join(" ");if($)Q.push(`<script ${j}>${$}</script>`);else Q.push(`<script ${j}></script>`)}for(let Z of K.style||[]){let $=Z.type?` type="${Z.type}"`:"";Q.push(`<style${$}>${Z.content}</style>`)}return Q.join(`
6
6
  `)}function BK(K=O){if(!K.htmlAttrs)return"";return Object.entries(K.htmlAttrs).map(([Q,Z])=>`${Q}="${U(Z)}"`).join(" ")}function OK(K=O){if(!K.bodyAttrs)return"";return Object.entries(K.bodyAttrs).map(([Q,Z])=>`${Q}="${U(Z)}"`).join(" ")}function U(K){return K.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function UK(K=O){if(typeof document>"u")return;if(K.title){let Q=K.title;if(K.titleTemplate)Q=typeof K.titleTemplate==="function"?K.titleTemplate(Q):K.titleTemplate.replace("%s",Q);document.title=Q}for(let Q of K.meta||[]){let Z=Q.name?`meta[name="${Q.name}"]`:Q.property?`meta[property="${Q.property}"]`:null;if(Z){let $=document.querySelector(Z);if(!$){if($=document.createElement("meta"),Q.name)$.setAttribute("name",Q.name);if(Q.property)$.setAttribute("property",Q.property);document.head.appendChild($)}$.setAttribute("content",Q.content)}}for(let Q of K.link||[]){let Z=`link[rel="${Q.rel}"]${Q.href?`[href="${Q.href}"]`:""}`,$=document.querySelector(Z);if(!$)$=document.createElement("link"),document.head.appendChild($);for(let[z,j]of Object.entries(Q))if(j!==void 0)$.setAttribute(z,String(j))}if(K.htmlAttrs)for(let[Q,Z]of Object.entries(K.htmlAttrs))if(Q==="class")for(let $ of String(Z).split(/\s+/).filter(Boolean))document.documentElement.classList.add($);else document.documentElement.setAttribute(Q,Z);if(K.bodyAttrs)for(let[Q,Z]of Object.entries(K.bodyAttrs))document.body.setAttribute(Q,Z)}function FK(K){let Q="";return{content:K.replace(/@head\s*([\s\S]*?)@endhead/g,($,z)=>{return Q+=z.trim()+`
7
- `,""}),headContent:Q.trim()}}function GK(K,Q){return K.replace(/@title\s*\(\s*(?:(['"`])(.+?)\1|([^)]+))\s*\)/g,(Z,$,z,j)=>{let J=$?z:Q[(j||"").trim()]??j,W=Q.__stx_runtime_head??{};return Q.__stx_runtime_head=R(W,{title:J}),""})}function VK(K,Q,Z=""){if(!K.includes("@meta"))return K;return w(K,/(?<![\w$@])@meta\s*\(/g,($,z)=>{let j=E(k($),Q);if(j.kind==="error")return I("Meta",z,j.message,Z,j.code);if(j.kind==="tag"){let J=Q.__stx_runtime_head??{};Q.__stx_runtime_head=R(J,{meta:[j.tag]})}return""},($)=>I("Meta",$,"the call has no closing parenthesis",Z,Y.INVALID_DIRECTIVE_SYNTAX))}export{S as _t,D as $t,g as au,l as bu,C as cu,w as du,k as eu,N as fu,_ as gu,T as hu,I as iu,a as ju,E as ku,jK as lu,zK as mu,JK as nu,P as ou,R as pu,u as qu,f as ru,WK as su,XK as tu,YK as uu,BK as vu,OK as wu,UK as xu,FK as yu,GK as zu,VK as Au};
7
+ `,""}),headContent:Q.trim()}}function GK(K,Q){return K.replace(/@title\s*\(\s*(?:(['"`])(.+?)\1|([^)]+))\s*\)/g,(Z,$,z,j)=>{let J=$?z:Q[(j||"").trim()]??j,W=Q.__stx_runtime_head??{};return Q.__stx_runtime_head=R(W,{title:J}),""})}function VK(K,Q,Z=""){if(!K.includes("@meta"))return K;return w(K,/(?<![\w$@])@meta\s*\(/g,($,z)=>{let j=E(k($),Q);if(j.kind==="error")return I("Meta",z,j.message,Z,j.code);if(j.kind==="tag"){let J=Q.__stx_runtime_head??{};Q.__stx_runtime_head=R(J,{meta:[j.tag]})}return""},($)=>I("Meta",$,"the call has no closing parenthesis",Z,Y.INVALID_DIRECTIVE_SYNTAX))}export{S as $t,D as au,g as bu,l as cu,C as du,w as eu,k as fu,N as gu,_ as hu,T as iu,I as ju,a as ku,E as lu,jK as mu,zK as nu,JK as ou,P as pu,R as qu,u as ru,f as su,WK as tu,XK as uu,YK as vu,BK as wu,OK as xu,UK as yu,FK as zu,GK as Au,VK as Bu};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Au as p,lu as a,mu as b,nu as c,ou as d,pu as e,qu as f,ru as g,su as h,tu as i,uu as j,vu as k,wu as l,xu as m,yu as n,zu as o}from"./chunk-qbz6yn8c.js";import"./chunk-czj6nq0b.js";import"./chunk-emjmshj8.js";export{i as useTitle,f as useSeoMeta,i as usePageTitle,d as useHead,g as seoMetaToHeadConfig,c as resetHead,k as renderHtmlAttrs,j as renderHead,l as renderBodyAttrs,o as processTitleDirective,p as processMetaDirective,n as processHeadDirective,e as mergeHeadConfigs,b as getPageMeta,a as getHead,h as definePageMeta,m as applyHead};
2
+ import{Au as o,Bu as p,mu as a,nu as b,ou as c,pu as d,qu as e,ru as f,su as g,tu as h,uu as i,vu as j,wu as k,xu as l,yu as m,zu as n}from"./chunk-vgx5077x.js";import"./chunk-met6wtbk.js";import"./chunk-m8kem5ca.js";export{i as useTitle,f as useSeoMeta,i as usePageTitle,d as useHead,g as seoMetaToHeadConfig,c as resetHead,k as renderHtmlAttrs,j as renderHead,l as renderBodyAttrs,o as processTitleDirective,p as processMetaDirective,n as processHeadDirective,e as mergeHeadConfigs,b as getPageMeta,a as getHead,h as definePageMeta,m as applyHead};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{am as c,dm as d,em as e,fm as f,gm as g,hm as h,im as i,jm as j,km as k,lm as l,mm as m,nm as n}from"./chunk-2119txb8.js";import"./chunk-jc6wrxrh.js";import"./chunk-2xpdcr8c.js";import{ps as a,qs as b}from"./chunk-v90kxg77.js";import"./chunk-4arms0am.js";import"./chunk-135mme4g.js";import"./chunk-dj24n5n7.js";import"./chunk-w1asc0zd.js";import"./chunk-kd95t585.js";import"./chunk-1tz8fb87.js";import"./chunk-xk402w4a.js";import"./chunk-dnard9gp.js";import"./chunk-vgx5077x.js";import"./chunk-met6wtbk.js";import"./chunk-ta6z7k4p.js";import"./chunk-zxptxz2b.js";import"./chunk-7racewc5.js";import"./chunk-e03m4har.js";import"./chunk-vsqx756d.js";import"./chunk-m8kem5ca.js";export{h as transformAutoImports,b as stripCommentsAndLiterals,e as renderVendorStyleTags,i as referencesName,n as processClientScript,g as injectBrowserCoreAutoImports,m as generateServerDataBridge,k as generateBrowserAutoImportDestructuring,j as generateAutoImportDestructuring,a as findInterpolationEnd,l as extractBridgeData,d as extractAndStripCssImports,f as STX_AUTO_IMPORTS,c as BROWSER_CORE_IMPORTS};
@@ -299,4 +299,4 @@ catch (error) {
299
299
  }
300
300
  })();
301
301
  </script>`}var N={name:"pwa.installButton",handler:(j,z,k,E)=>{let q=k.__stx_options||{};return H(j,q)},hasEndTag:!0,description:"Renders a PWA install prompt button that appears when the app can be installed"},Q={name:"pwa.updatePrompt",handler:(j,z,k,E)=>{let q=k.__stx_options||{};return J(j,q)},hasEndTag:!0,description:"Renders a PWA update notification UI when a new version is available"},T={name:"pwa.offlineIndicator",handler:(j,z,k,E)=>{let q=k.__stx_options||{};return L(j,q)},hasEndTag:!0,description:"Renders an offline status indicator that shows when the user loses connection"},V={name:"pwa.pushSubscribe",handler:(j,z,k,E)=>{let q=k.__stx_options||{};return M(j,q)},hasEndTag:!0,description:"Renders a push notification subscription button"},X=[N,Q,T,V];function Z(j){return[...j,...X]}
302
- export{N as Iw,Q as Jw,T as Kw,V as Lw,X as Mw,Z as Nw};
302
+ export{N as Jw,Q as Kw,T as Lw,V as Mw,X as Nw,Z as Ow};