@stacksjs/stx 0.2.462 → 0.2.463

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 (142) hide show
  1. package/dist/{chunk-kcs71ks8.js → chunk-02e24cym.js} +1 -1
  2. package/dist/chunk-0fvz8wad.js +2 -0
  3. package/dist/chunk-0yba08sr.js +2 -0
  4. package/dist/{chunk-3rpbzfw5.js → chunk-14vnnx44.js} +2 -2
  5. package/dist/chunk-1mfggkga.js +2 -0
  6. package/dist/chunk-1p5ge6fq.js +2 -0
  7. package/dist/{chunk-rcr57c30.js → chunk-2cqymwe8.js} +2 -2
  8. package/dist/{chunk-8xz8t9xp.js → chunk-2n5pjbw9.js} +2 -2
  9. package/dist/{chunk-44msrx2e.js → chunk-2tn3dkcy.js} +2 -2
  10. package/dist/{chunk-5pgvfxtx.js → chunk-39q77svv.js} +3 -3
  11. package/dist/{chunk-hehtgsrt.js → chunk-3q2z7cts.js} +1 -1
  12. package/dist/chunk-4yjtwjrw.js +2 -0
  13. package/dist/chunk-5127n7rc.js +2 -0
  14. package/dist/{chunk-462jmw0a.js → chunk-544e2jvd.js} +2 -2
  15. package/dist/chunk-5564cka1.js +2 -0
  16. package/dist/{chunk-e02b66yn.js → chunk-5yn0gpcj.js} +3 -3
  17. package/dist/{chunk-t0j0d802.js → chunk-627af18j.js} +1 -1
  18. package/dist/chunk-6876vczs.js +2 -0
  19. package/dist/chunk-7fjatz47.js +2 -0
  20. package/dist/chunk-7j1cpa9d.js +2 -0
  21. package/dist/{chunk-5w87wmc4.js → chunk-88px183j.js} +2 -2
  22. package/dist/{chunk-ree9weje.js → chunk-90drf2ag.js} +2 -2
  23. package/dist/chunk-938g2a3d.js +2 -0
  24. package/dist/{chunk-5qns2sdz.js → chunk-9fr19qe4.js} +2 -2
  25. package/dist/{chunk-6r2709dj.js → chunk-9pt8fd2n.js} +3 -3
  26. package/dist/{chunk-6wqvgy6x.js → chunk-a35c060g.js} +1 -1
  27. package/dist/{chunk-tpeyn7wr.js → chunk-a8q8m5pp.js} +2 -2
  28. package/dist/chunk-ajqwjevt.js +2 -0
  29. package/dist/{chunk-z3etxty5.js → chunk-amd6ey3t.js} +5 -5
  30. package/dist/{chunk-n1mspzv7.js → chunk-bddjx2a2.js} +2 -2
  31. package/dist/chunk-bp53x03f.js +2 -0
  32. package/dist/{chunk-jnn745tt.js → chunk-ccy6avqe.js} +5 -5
  33. package/dist/{chunk-pe214qcn.js → chunk-cfk3skk4.js} +1 -1
  34. package/dist/chunk-d1x5r4p6.js +2 -0
  35. package/dist/{chunk-5bqs0ve6.js → chunk-d2zw2e5m.js} +1 -1
  36. package/dist/chunk-d9360m89.js +2 -0
  37. package/dist/chunk-dcv6absa.js +2 -0
  38. package/dist/{chunk-b6e36vr2.js → chunk-dqdggvq4.js} +180 -180
  39. package/dist/{chunk-rvgvt161.js → chunk-e15a8txv.js} +2 -2
  40. package/dist/{chunk-hp901qmd.js → chunk-eegxyqk3.js} +2 -2
  41. package/dist/{chunk-9yywhkc7.js → chunk-ery19t9s.js} +3 -3
  42. package/dist/{chunk-6yt2dpsb.js → chunk-etjw0he9.js} +3 -3
  43. package/dist/{chunk-gxhwg1f4.js → chunk-fh1qrp68.js} +5 -5
  44. package/dist/{chunk-a51ftv2n.js → chunk-hhsynd7c.js} +3 -3
  45. package/dist/chunk-j9qcrwbg.js +2 -0
  46. package/dist/chunk-jmabeqfq.js +2 -0
  47. package/dist/{chunk-yfbj4qce.js → chunk-jmhhv817.js} +2 -2
  48. package/dist/chunk-jr3g08vs.js +2 -0
  49. package/dist/chunk-k2vcwa7m.js +2 -0
  50. package/dist/{chunk-tbjyp03h.js → chunk-k9sbgax8.js} +1 -1
  51. package/dist/{chunk-a6pjaw6w.js → chunk-kdk0jy1h.js} +3 -3
  52. package/dist/chunk-kmb9qrdg.js +2 -0
  53. package/dist/{chunk-q0d0q8r8.js → chunk-krsdcjxk.js} +6 -6
  54. package/dist/{chunk-bagh6sc1.js → chunk-mfxf378k.js} +2 -2
  55. package/dist/chunk-mhfwdyeg.js +2 -0
  56. package/dist/chunk-mxt11ejx.js +2 -0
  57. package/dist/chunk-mxtah7y5.js +2 -0
  58. package/dist/{chunk-n3r5m938.js → chunk-ng61wjke.js} +1 -1
  59. package/dist/{chunk-qer8jpr5.js → chunk-nkxa7men.js} +1 -1
  60. package/dist/{chunk-501kq69r.js → chunk-nwwzf7h1.js} +1 -1
  61. package/dist/{chunk-z2daw0th.js → chunk-pbh4smw3.js} +4 -4
  62. package/dist/{chunk-9n10mh5q.js → chunk-ptek61ts.js} +1 -1
  63. package/dist/chunk-q316y302.js +2 -0
  64. package/dist/chunk-q7qchkvk.js +2 -0
  65. package/dist/{chunk-18pagcsc.js → chunk-qr15ksz9.js} +4 -4
  66. package/dist/chunk-qyq7j8hp.js +2 -0
  67. package/dist/chunk-r5gyx7ch.js +2 -0
  68. package/dist/chunk-raeyd6e5.js +2 -0
  69. package/dist/chunk-raqqq3mm.js +2 -0
  70. package/dist/chunk-rjm3n62n.js +2 -0
  71. package/dist/{chunk-ty3j2ryw.js → chunk-skjwh35r.js} +2 -2
  72. package/dist/{chunk-6ths0ktv.js → chunk-sprx02g0.js} +1 -1
  73. package/dist/{chunk-x4yqyea2.js → chunk-t1py7rbg.js} +5 -5
  74. package/dist/{chunk-vxhy0a3n.js → chunk-tesmv3m9.js} +2 -2
  75. package/dist/chunk-tkakxkbx.js +2 -0
  76. package/dist/{chunk-pq84ycrv.js → chunk-tsg7bj9p.js} +3 -3
  77. package/dist/chunk-txkfp4v5.js +2 -0
  78. package/dist/chunk-tzjqtweb.js +2 -0
  79. package/dist/{chunk-8yrk8ybh.js → chunk-v83bpj84.js} +3 -3
  80. package/dist/chunk-vhdemrec.js +2 -0
  81. package/dist/chunk-wsftz3vj.js +2 -0
  82. package/dist/chunk-wvxj6r2a.js +2 -0
  83. package/dist/{chunk-wz29ahjp.js → chunk-xbm2gcb6.js} +2 -2
  84. package/dist/chunk-xek78ez1.js +2 -0
  85. package/dist/chunk-xjb0yzvq.js +2 -0
  86. package/dist/{chunk-ver2yf41.js → chunk-y36av1ac.js} +6 -6
  87. package/dist/{chunk-m2yy86d8.js → chunk-y8mx0hab.js} +2 -2
  88. package/dist/{chunk-ptxvex42.js → chunk-y9j2kf3k.js} +5 -5
  89. package/dist/chunk-ydjfar14.js +2 -0
  90. package/dist/chunk-ymk7eswy.js +2 -0
  91. package/dist/{chunk-gkqxnetc.js → chunk-zasd9166.js} +2 -2
  92. package/dist/chunk-zhexga43.js +2 -0
  93. package/dist/cli.js +11 -11
  94. package/dist/craft-entry.js +2 -2
  95. package/dist/craft.js +2 -2
  96. package/dist/includes.d.ts +17 -0
  97. package/dist/includes.js +43 -1
  98. package/dist/pwa.js +3 -3
  99. package/dist/ssg.js +2 -2
  100. package/package.json +5 -5
  101. package/dist/chunk-03ek5ag5.js +0 -2
  102. package/dist/chunk-0a2w25j8.js +0 -2
  103. package/dist/chunk-0f1f6y2w.js +0 -2
  104. package/dist/chunk-14p5jgqp.js +0 -2
  105. package/dist/chunk-1fccwkkq.js +0 -2
  106. package/dist/chunk-32t5agpk.js +0 -2
  107. package/dist/chunk-3rrzxapr.js +0 -2
  108. package/dist/chunk-3s2vnqcf.js +0 -2
  109. package/dist/chunk-4henqdjf.js +0 -2
  110. package/dist/chunk-4mcmbvxb.js +0 -2
  111. package/dist/chunk-561yczfn.js +0 -2
  112. package/dist/chunk-5ex4hjt3.js +0 -2
  113. package/dist/chunk-68txmj8d.js +0 -2
  114. package/dist/chunk-6qv189mb.js +0 -2
  115. package/dist/chunk-8xkr55v2.js +0 -2
  116. package/dist/chunk-995ytskb.js +0 -2
  117. package/dist/chunk-9mmsb0zb.js +0 -2
  118. package/dist/chunk-9t50hw97.js +0 -2
  119. package/dist/chunk-9y6bn8hk.js +0 -2
  120. package/dist/chunk-amvnckr7.js +0 -2
  121. package/dist/chunk-c0wcvbhr.js +0 -2
  122. package/dist/chunk-darbqs38.js +0 -2
  123. package/dist/chunk-e38fyh0y.js +0 -2
  124. package/dist/chunk-gcz1wex2.js +0 -2
  125. package/dist/chunk-gn32cr6z.js +0 -2
  126. package/dist/chunk-jbdvkj3q.js +0 -2
  127. package/dist/chunk-jy58t59b.js +0 -2
  128. package/dist/chunk-kggx9jc1.js +0 -2
  129. package/dist/chunk-khx54f41.js +0 -2
  130. package/dist/chunk-n76phhd2.js +0 -2
  131. package/dist/chunk-n8hd5qap.js +0 -2
  132. package/dist/chunk-neq30d52.js +0 -2
  133. package/dist/chunk-qr68w6qf.js +0 -2
  134. package/dist/chunk-sd2gc341.js +0 -2
  135. package/dist/chunk-t1s00kj6.js +0 -2
  136. package/dist/chunk-vrvnctex.js +0 -2
  137. package/dist/chunk-vvyfeyxk.js +0 -2
  138. package/dist/chunk-w28dbef2.js +0 -2
  139. package/dist/chunk-y2p3scx0.js +0 -2
  140. package/dist/chunk-yxwam84p.js +0 -2
  141. package/dist/chunk-zkp2cw7q.js +0 -2
  142. package/dist/chunk-zxbz8v00.js +0 -2
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import"./chunk-ynvce0q6.js";import"./chunk-8xz8t9xp.js";import"./chunk-5w87wmc4.js";import{or,Ds,Ri}from"./chunk-2jbyks2t.js";import"./chunk-pf0d8y9n.js";import{Nn,Fn,n,o}from"./chunk-b6e36vr2.js";import"./chunk-8yrk8ybh.js";import"./chunk-ver2yf41.js";import"./chunk-zydg3wgt.js";import"./chunk-n3r5m938.js";import"./chunk-jz7pvh7b.js";import"./chunk-0trfbqa7.js";import{Pe}from"./chunk-a51ftv2n.js";import"./chunk-5bqs0ve6.js";import{existsSync as M,mkdirSync as dt,readFileSync as ft}from"fs";import T from"path";import{existsSync as at,mkdirSync as ct}from"fs";import k from"path";import{existsSync as it}from"fs";import E from"path";var be="data-stx-b",H=new Set(Ds),Se=new Set(or);function xe(t){if(t==="ref"||t==="data-stx-ref")return"ref";if(t.startsWith("::"))return null;if(t.startsWith("@bind:")||t.startsWith("x-bind:"))return"attr";if(t.startsWith("@")||t.startsWith(":")){let e=t.slice(1).split(".")[0];if(H.has(e))return e==="if"?"if":e;if(e==="for"||e==="else"||e==="else-if"||e==="elseif")return"for";if(Ri(e))return"event";if(t.startsWith("@"))return"event";return"attr"}if(t.startsWith("x-")){let e=t.split(".")[0];if(!Se.has(e))return"attr";let r=e.slice(2);if(r==="cloak"||r==="data"||r==="bind")return null;if(r==="tooltip"||r==="tooltip-position")return null;return H.has(r)?r==="if"?"if":r:"attr"}return null}function we(t){let e=[];for(let[r,i]of t){let s=xe(r);if(s)e.push({name:r,value:i,kind:s})}return e}var ye=/<([a-z][\w-]*)((?:\s+[^\s"'=<>/]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'=<>`]+))?)*)\s*\/?>/gi,X=/([^\s"'=<>/]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?/g;function G(t){let e=[],r=0;return{html:t.replace(ye,(s,a,l)=>{if(!l||!/[:@]|x-/.test(l))return s;let u=[];X.lastIndex=0;for(let p=X.exec(l);p;p=X.exec(l))u.push([p[1],p[2]??p[3]??p[4]??""]);let d=we(u);if(!d.length)return s;let g={id:r++,bindings:d};if(d.some((p)=>p.kind==="for"))g.template=!0;e.push(g);let c=s.endsWith("/>");return`${s.slice(0,c?-2:-1).trimEnd()} ${be}="${g.id}"${c?"/>":">"}`}),manifest:{entries:e}}}var Te=["accessibilityHint","accessibilityLabel","accessibilityRole","accessibilityState","accessibilityValue","activeOpacity","alwaysBounceHorizontal","alwaysBounceVertical","animationType","autoCapitalize","autoCorrect","autoFocus","blurRadius","contentContainerStyle","defaultSource","defaultValue","ellipsizeMode","fadeDuration","hidesWhenStopped","hitSlop","imageStyle","initialNumToRender","iosBackgroundColor","keyboardDismissMode","keyboardShouldPersistTaps","keyboardType","keyboardVerticalOffset","keyExtractor","maxLength","maximumTrackTintColor","maximumValue","maxToRenderPerBatch","minimumTrackTintColor","minimumValue","numberOfLines","numColumns","onEndReachedThreshold","pagingEnabled","placeholderTextColor","pointerEvents","presentationStyle","pressRetentionOffset","progressBackgroundColor","progressViewOffset","refreshControl","resizeMode","returnKeyType","scrollEnabled","scrollTarget","secureTextEntry","selectedValue","selectionColor","showsHorizontalScrollIndicator","showsVerticalScrollIndicator","statusBarTranslucent","stickyHeaderIndices","testID","thumbColor","thumbTintColor","titleColor","trackColor","underlayColor","windowSize"],ve=new Map(Te.map((t)=>[q(t),t]));function q(t){return t.replace(/[-_]/g,"").toLowerCase()}function O(t){return ve.get(q(t))??t}var ke={view:"View",text:"Text",button:"Button",image:"Image",img:"Image",input:"TextInput",textarea:"TextInput",scroll:"ScrollView",scrollview:"ScrollView",list:"FlatList",flatlist:"FlatList",modal:"Modal",switch:"Switch",slider:"Slider",picker:"Picker",select:"Picker",loading:"ActivityIndicator",spinner:"ActivityIndicator",div:"View",span:"Text",p:"Text",h1:"Text",h2:"Text",h3:"Text",h4:"Text",h5:"Text",h6:"Text",a:"TouchableOpacity",section:"View",article:"View",header:"SafeAreaView",footer:"View",main:"View",nav:"View",aside:"View",form:"View",label:"Text",fieldset:"View",legend:"Text",option:"Text",dialog:"Modal",figure:"View",figcaption:"Text",picture:"View",hr:"View",ul:"View",ol:"View",li:"View",dl:"View",dt:"Text",dd:"Text",table:"View",thead:"View",tbody:"View",tfoot:"View",tr:"View",th:"Text",td:"Text",caption:"Text",strong:"Text",b:"Text",em:"Text",i:"Text",u:"Text",s:"Text",small:"Text",mark:"Text",abbr:"Text",time:"Text",code:"Text",kbd:"Text",samp:"Text",pre:"Text",blockquote:"Text",cite:"Text",q:"Text",sub:"Text",sup:"Text"};function U(t){return ke[t.toLowerCase()]||t}var Re={activity:"waveform.path.ecg","alarm-clock":"alarm","alert-circle":"exclamationmark.circle","alert-triangle":"exclamationmark.triangle",archive:"archivebox","arrow-down":"arrow.down","arrow-left":"arrow.left","arrow-right":"arrow.right","arrow-up":"arrow.up","arrow-up-right":"arrow.up.right","at-sign":"at","audio-lines":"waveform",award:"rosette","badge-check":"checkmark.seal","bar-chart":"chart.bar","bar-chart-2":"chart.bar","bar-chart-3":"chart.bar",battery:"battery.100",bed:"bed.double",bell:"bell","bell-off":"bell.slash",bike:"figure.outdoor.cycle",bluetooth:"antenna.radiowaves.left.and.right",book:"book","book-open":"book",bookmark:"bookmark",brain:"brain",calendar:"calendar","calendar-check":"calendar.badge.checkmark","calendar-clock":"calendar.badge.clock","calendar-days":"calendar","calendar-plus":"calendar.badge.plus","calendar-range":"calendar","calendar-sync":"arrow.triangle.2.circlepath",camera:"camera","chart-bar":"chart.bar","chart-line":"chart.xyaxis.line",check:"checkmark","check-circle":"checkmark.circle","check-circle-2":"checkmark.circle","chevron-down":"chevron.down","chevron-left":"chevron.left","chevron-right":"chevron.right","chevron-up":"chevron.up",circle:"circle","circle-alert":"exclamationmark.circle","circle-check":"checkmark.circle","circle-check-big":"checkmark.circle","circle-help":"questionmark.circle","circle-play":"play.circle","circle-plus":"plus.circle","circle-user":"person.crop.circle","circle-x":"xmark.circle",clapperboard:"film",clipboard:"clipboard","clipboard-list":"list.clipboard",clock:"clock",cloud:"cloud","cloud-off":"icloud.slash",coffee:"cup.and.saucer",copy:"doc.on.doc","credit-card":"creditcard",download:"arrow.down.circle",droplet:"drop",droplets:"drop",dumbbell:"dumbbell",edit:"pencil","external-link":"arrow.up.right.square",eye:"eye","eye-off":"eye.slash",file:"doc","file-text":"doc.text",filter:"line.3.horizontal.decrease",flag:"flag",flame:"flame","flower-2":"camera.macro",footprints:"figure.run",gauge:"gauge",gift:"gift",globe:"globe","graduation-cap":"graduationcap","grip-vertical":"line.3.horizontal",heart:"heart","heart-pulse":"heart.text.square","help-circle":"questionmark.circle",history:"clock.arrow.circlepath",home:"house",house:"house",image:"photo",inbox:"tray",info:"info.circle",layers:"square.3.layers.3d","layout-grid":"square.grid.2x2",library:"books.vertical",link:"link",list:"list.bullet","list-checks":"checklist",loader:"arrow.triangle.2.circlepath","loader-2":"arrow.triangle.2.circlepath","loader-circle":"arrow.triangle.2.circlepath",lock:"lock","log-in":"arrow.right.to.line","log-out":"rectangle.portrait.and.arrow.right",mail:"envelope",map:"map","map-pin":"mappin.and.ellipse",medal:"medal",menu:"line.3.horizontal","message-circle":"bubble.left","message-square":"text.bubble","message-square-quote":"quote.bubble",mic:"mic",minus:"minus",moon:"moon","more-horizontal":"ellipsis","more-vertical":"ellipsis",mountain:"mountain.2",music:"music.note",package:"shippingbox",pause:"pause","pause-circle":"pause.circle",pencil:"pencil","person-standing":"figure.walk",phone:"phone",play:"play.fill",plug:"powerplug",plus:"plus","plus-circle":"plus.circle","refresh-cw":"arrow.clockwise",repeat:"repeat","rotate-ccw":"arrow.counterclockwise",route:"point.topleft.down.to.point.bottomright.curvepath",ruler:"ruler",sailboat:"sailboat",satellite:"antenna.radiowaves.left.and.right",save:"square.and.arrow.down",scale:"scalemass",search:"magnifyingglass",send:"paperplane",settings:"gearshape","settings-2":"slider.horizontal.3",share:"square.and.arrow.up","share-2":"square.and.arrow.up",shield:"shield","shield-check":"checkmark.shield","shopping-bag":"bag","shopping-cart":"cart","skip-back":"backward.end","skip-forward":"forward.end",sliders:"slider.horizontal.3","sliders-horizontal":"slider.horizontal.3",smartphone:"iphone",snowflake:"snowflake",sparkles:"sparkles",square:"square",star:"star",stopwatch:"stopwatch",store:"storefront",sun:"sun.max",sunrise:"sunrise",sunset:"sunset",tag:"tag",target:"scope",thermometer:"thermometer.medium","thumbs-up":"hand.thumbsup",timer:"timer",trash:"trash","trash-2":"trash","trending-down":"chart.line.downtrend.xyaxis","trending-up":"chart.line.uptrend.xyaxis",trophy:"trophy",unlink:"personalhotspot.slash",upload:"arrow.up.circle",user:"person","user-plus":"person.badge.plus","user-round":"person",users:"person.2",video:"video","volume-2":"speaker.wave.2",watch:"applewatch",waves:"figure.pool.swim",weight:"scalemass",wifi:"wifi","wifi-off":"wifi.slash",wind:"wind",x:"xmark","x-circle":"xmark.circle",zap:"bolt"};function J(t,e=!1){let r=String(t??"").trim();if(!r)return{symbol:"circle",known:!1};if(e)return{symbol:r,known:!0};let i=/^i-([a-z0-9]+)-(.+)$/.exec(r)??/^([a-z0-9]+):(.+)$/.exec(r),s=i?i[1]:"lucide",a=i?i[2]:r;if(s==="lucide"){let l=Re[a];if(l)return{symbol:l,iconify:`i-lucide-${a}`,known:!0};if(!i&&r.includes("."))return{symbol:r,known:!0}}return{symbol:"circle",iconify:i?r:`i-lucide-${a}`,known:!1}}var Ce={transparent:"transparent",current:"currentColor",black:"#000000",white:"#ffffff",slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"}},Z={px:1,0:0,0.5:2,1:4,1.5:6,2:8,2.5:10,3:12,3.5:14,4:16,5:20,6:24,7:28,8:32,9:36,10:40,11:44,12:48,14:56,16:64,20:80,24:96,28:112,32:128,36:144,40:160,44:176,48:192,52:208,56:224,60:240,64:256,72:288,80:320,96:384},Y={xs:12,sm:14,base:16,lg:18,xl:20,"2xl":24,"3xl":30,"4xl":36,"5xl":48,"6xl":60,"7xl":72,"8xl":96,"9xl":128},y={none:0,sm:2,DEFAULT:4,md:6,lg:8,xl:12,"2xl":16,"3xl":24,full:9999};function N(t){let e=t.lastIndexOf("/");if(e>0&&!t.endsWith("]")){let i=N(t.slice(0,e)),s=t.slice(e+1),a=/^\[(.+)\]$/.test(s)?Number.parseFloat(s.slice(1,-1))*(s.includes("%")?1:100):Number.parseFloat(s);if(!i||!Number.isFinite(a))return;return _e(i,a/100)}if(t==="transparent")return"transparent";if(t==="current")return"currentColor";if(t==="black")return"#000000";if(t==="white")return"#ffffff";let r=t.split("-");if(r.length===2){let[i,s]=r,a=Ce[i];if(a&&typeof a==="object")return a[s]}if(t.startsWith("[")&&t.endsWith("]")){let i=t.slice(1,-1);return/^(#|rgba?\(|hsla?\(|[a-z]+$)/i.test(i)?i:void 0}return}function _e(t,e){if(t==="transparent")return t;let r=t.startsWith("#")?t.slice(1):"";if(r.length===3)r=r.split("").map((s)=>s+s).join("");if(r.length===8)r=r.slice(0,6);if(r.length!==6)return;let i=Math.round(Math.min(1,Math.max(0,e))*255);return`#${r}${i.toString(16).padStart(2,"0")}`}function z(t,e=16){if(!t.startsWith("[")||!t.endsWith("]"))return;let r=t.slice(1,-1),i=Number.parseFloat(r);if(!Number.isFinite(i))return;if(r.endsWith("rem"))return i*16;if(r.endsWith("em"))return i*e;return i}function h(t){if(t.startsWith("[")&&t.endsWith("]")){let e=t.slice(1,-1),r=e.endsWith("rem")?Number.parseFloat(e)*16:Number.parseFloat(e);return Number.isFinite(r)?r:void 0}return Z[t]}var Ee={flex:(t,e)=>(e.display="flex",!0),hidden:(t,e)=>(e.display="none",!0),grid:(t,e)=>(e.display="grid",!0),"flex-row":(t,e)=>(e.flexDirection="row",!0),"flex-col":(t,e)=>(e.flexDirection="column",!0),"flex-row-reverse":(t,e)=>(e.flexDirection="row-reverse",!0),"flex-col-reverse":(t,e)=>(e.flexDirection="column-reverse",!0),"flex-wrap":(t,e)=>(e.flexWrap="wrap",!0),"flex-nowrap":(t,e)=>(e.flexWrap="nowrap",!0),"flex-wrap-reverse":(t,e)=>(e.flexWrap="wrap-reverse",!0),"flex-1":(t,e)=>(e.flex=1,e.flexGrow=1,e.flexShrink=1,e.flexBasis=0,!0),"flex-auto":(t,e)=>(e.flexGrow=1,e.flexShrink=1,!0),"flex-initial":(t,e)=>(e.flexGrow=0,e.flexShrink=1,!0),"flex-none":(t,e)=>(e.flexGrow=0,e.flexShrink=0,!0),grow:(t,e)=>(e.flexGrow=1,!0),"grow-0":(t,e)=>(e.flexGrow=0,!0),shrink:(t,e)=>(e.flexShrink=1,!0),"shrink-0":(t,e)=>(e.flexShrink=0,!0),"justify-start":(t,e)=>(e.justifyContent="flex-start",!0),"justify-center":(t,e)=>(e.justifyContent="center",!0),"justify-end":(t,e)=>(e.justifyContent="flex-end",!0),"justify-between":(t,e)=>(e.justifyContent="space-between",!0),"justify-around":(t,e)=>(e.justifyContent="space-around",!0),"justify-evenly":(t,e)=>(e.justifyContent="space-evenly",!0),"items-start":(t,e)=>(e.alignItems="flex-start",!0),"items-center":(t,e)=>(e.alignItems="center",!0),"items-end":(t,e)=>(e.alignItems="flex-end",!0),"items-stretch":(t,e)=>(e.alignItems="stretch",!0),"items-baseline":(t,e)=>(e.alignItems="baseline",!0),"self-auto":(t,e)=>(e.alignSelf="auto",!0),"self-start":(t,e)=>(e.alignSelf="flex-start",!0),"self-center":(t,e)=>(e.alignSelf="center",!0),"self-end":(t,e)=>(e.alignSelf="flex-end",!0),"self-stretch":(t,e)=>(e.alignSelf="stretch",!0),"self-baseline":(t,e)=>(e.alignSelf="baseline",!0),"min-w-0":(t,e)=>(e.minWidth=0,!0),"aspect-square":(t,e)=>(e.aspectRatio=1,!0),"inset-0":(t,e)=>(e.top=0,e.right=0,e.bottom=0,e.left=0,!0),"tracking-tighter":(t,e)=>(e.letterSpacing=-0.8,!0),"tracking-tight":(t,e)=>(e.letterSpacing=-0.4,!0),"tracking-normal":(t,e)=>(e.letterSpacing=0,!0),"tracking-wide":(t,e)=>(e.letterSpacing=0.4,!0),"tracking-wider":(t,e)=>(e.letterSpacing=0.8,!0),"tracking-widest":(t,e)=>(e.letterSpacing=1.6,!0),"tabular-nums":()=>!0,block:()=>!0,"inline-flex":(t,e)=>(e.display="flex",!0),truncate:()=>!0,relative:(t,e)=>(e.position="relative",!0),absolute:(t,e)=>(e.position="absolute",!0),"overflow-visible":(t,e)=>(e.overflow="visible",!0),"overflow-hidden":(t,e)=>(e.overflow="hidden",!0),"overflow-scroll":(t,e)=>(e.overflow="scroll",!0),"font-thin":(t,e)=>(e.fontWeight="100",!0),"font-extralight":(t,e)=>(e.fontWeight="200",!0),"font-light":(t,e)=>(e.fontWeight="300",!0),"font-normal":(t,e)=>(e.fontWeight="400",!0),"font-medium":(t,e)=>(e.fontWeight="500",!0),"font-semibold":(t,e)=>(e.fontWeight="600",!0),"font-bold":(t,e)=>(e.fontWeight="bold",!0),"font-extrabold":(t,e)=>(e.fontWeight="800",!0),"font-black":(t,e)=>(e.fontWeight="900",!0),italic:(t,e)=>(e.fontStyle="italic",!0),"not-italic":(t,e)=>(e.fontStyle="normal",!0),"text-left":(t,e)=>(e.textAlign="left",!0),"text-center":(t,e)=>(e.textAlign="center",!0),"text-right":(t,e)=>(e.textAlign="right",!0),"text-justify":(t,e)=>(e.textAlign="justify",!0),uppercase:(t,e)=>(e.textTransform="uppercase",!0),lowercase:(t,e)=>(e.textTransform="lowercase",!0),capitalize:(t,e)=>(e.textTransform="capitalize",!0),"normal-case":(t,e)=>(e.textTransform="none",!0),underline:(t,e)=>(e.textDecorationLine="underline",!0),"line-through":(t,e)=>(e.textDecorationLine="line-through",!0),"no-underline":(t,e)=>(e.textDecorationLine="none",!0)};function Ne(t,e){if(!t.startsWith("bg-"))return!1;let r=t.slice(3),i=N(r);if(i)return e.backgroundColor=i,!0;return!1}function We(t,e){if(!t.startsWith("text-"))return!1;let r=t.slice(5);if(Y[r])return e.fontSize=Y[r],!0;if(r.startsWith("[")&&r.endsWith("]")){let s=r.slice(1,-1);if(/^-?[\d.]+(?:px|r?em)?$/.test(s)){let a=s.endsWith("rem")||s.endsWith("em")?Number.parseFloat(s)*16:Number.parseFloat(s);if(Number.isFinite(a))return e.fontSize=a,!0}}let i=N(r);if(i)return e.color=i,!0;return!1}function Be(t,e){if(t.startsWith("p-")){let r=h(t.slice(2));if(r!==void 0)return e.padding=r,!0}if(t.startsWith("px-")){let r=h(t.slice(3));if(r!==void 0)return e.paddingHorizontal=r,!0}if(t.startsWith("py-")){let r=h(t.slice(3));if(r!==void 0)return e.paddingVertical=r,!0}if(t.startsWith("pt-")){let r=h(t.slice(3));if(r!==void 0)return e.paddingTop=r,!0}if(t.startsWith("pr-")){let r=h(t.slice(3));if(r!==void 0)return e.paddingRight=r,!0}if(t.startsWith("pb-")){let r=h(t.slice(3));if(r!==void 0)return e.paddingBottom=r,!0}if(t.startsWith("pl-")){let r=h(t.slice(3));if(r!==void 0)return e.paddingLeft=r,!0}return!1}function Ie(t,e){if(t.startsWith("m-")){let r=h(t.slice(2));if(r!==void 0)return e.margin=r,!0}if(t.startsWith("mx-")){let r=h(t.slice(3));if(r!==void 0)return e.marginHorizontal=r,!0}if(t.startsWith("my-")){let r=h(t.slice(3));if(r!==void 0)return e.marginVertical=r,!0}if(t.startsWith("mt-")){let r=h(t.slice(3));if(r!==void 0)return e.marginTop=r,!0}if(t.startsWith("mr-")){let r=h(t.slice(3));if(r!==void 0)return e.marginRight=r,!0}if(t.startsWith("mb-")){let r=h(t.slice(3));if(r!==void 0)return e.marginBottom=r,!0}if(t.startsWith("ml-")){let r=h(t.slice(3));if(r!==void 0)return e.marginLeft=r,!0}return!1}function Le(t,e){if(!t.startsWith("w-"))return!1;let r=t.slice(2);if(r==="full")return e.width="100%",!0;if(r==="screen")return e.width="100%",!0;if(r==="auto")return e.width="auto",!0;if(r.includes("/")){let[s,a]=r.split("/"),l=Number.parseInt(s)/Number.parseInt(a)*100;return e.width=`${l}%`,!0}let i=h(r);if(i!==void 0)return e.width=i,!0;return!1}function De(t,e){if(!t.startsWith("h-"))return!1;let r=t.slice(2);if(r==="full")return e.height="100%",!0;if(r==="screen")return e.height="100%",!0;if(r==="auto")return e.height="auto",!0;let i=h(r);if(i!==void 0)return e.height=i,!0;return!1}function Xe(t,e){if(!t.startsWith("rounded"))return!1;if(t==="rounded")return e.borderRadius=y.DEFAULT,!0;let r=t.slice(8);if(r==="")return!1;let i=/^(?:(t|b|l|r)-)?(\[[^\]]+\])$/.exec(r);if(i){let a=z(i[2]);if(a===void 0)return!1;let l={t:["borderTopLeftRadius","borderTopRightRadius"],b:["borderBottomLeftRadius","borderBottomRightRadius"],l:["borderTopLeftRadius","borderBottomLeftRadius"],r:["borderTopRightRadius","borderBottomRightRadius"]};for(let u of i[1]?l[i[1]]:["borderRadius"])e[u]=a;return!0}if(r.startsWith("t-")){let a=y[r.slice(2)]??y.DEFAULT;return e.borderTopLeftRadius=a,e.borderTopRightRadius=a,!0}if(r.startsWith("b-")){let a=y[r.slice(2)]??y.DEFAULT;return e.borderBottomLeftRadius=a,e.borderBottomRightRadius=a,!0}if(r.startsWith("l-")){let a=y[r.slice(2)]??y.DEFAULT;return e.borderTopLeftRadius=a,e.borderBottomLeftRadius=a,!0}if(r.startsWith("r-")){let a=y[r.slice(2)]??y.DEFAULT;return e.borderTopRightRadius=a,e.borderBottomRightRadius=a,!0}let s=y[r];if(s!==void 0)return e.borderRadius=s,!0;return!1}function Oe(t,e){if(!t.startsWith("border"))return!1;if(t==="border")return e.borderWidth=1,!0;let r=t.match(/^border-(\d+)$/);if(r)return e.borderWidth=Number.parseInt(r[1]),!0;let i=t.match(/^border-(t|r|b|l)-?(\d*)$/);if(i){let[,s,a]=i,l=a?Number.parseInt(a):1;switch(s){case"t":e.borderTopWidth=l;break;case"r":e.borderRightWidth=l;break;case"b":e.borderBottomWidth=l;break;case"l":e.borderLeftWidth=l;break}return!0}return!1}function $e(t,e){if(!t.startsWith("border-"))return!1;let r=t.slice(7),i=N(r);if(i)return e.borderColor=i,!0;return!1}function ze(t,e){if(!t.startsWith("opacity-"))return!1;let r=Number.parseInt(t.slice(8));if(!Number.isNaN(r))return e.opacity=r/100,!0;return!1}function Ae(t,e){if(t.startsWith("tracking-[")){let r=z(t.slice(9),typeof e.fontSize==="number"?e.fontSize:16);if(r===void 0)return!1;return e.letterSpacing=r,!0}if(t.startsWith("leading-")){let r=t.slice(8),i=typeof e.fontSize==="number"?e.fontSize:16,s={none:1,tight:1.25,snug:1.375,normal:1.5,relaxed:1.625,loose:2},a=r.startsWith("[")?/^\[[\d.]+\]$/.test(r)?Number.parseFloat(r.slice(1,-1))*i:z(r,i):s[r]!==void 0?s[r]*i:Z[r];if(a===void 0||!Number.isFinite(a))return!1;return e.lineHeight=a,!0}return!1}function Ve(t,e){let r=/^grid-cols-(\d+)$/.exec(t);if(!r)return!1;return e.gridColumns=Number(r[1]),!0}function Fe(t,e){if(!t.startsWith("size-"))return!1;let r=t.slice(5),i=r==="full"?"100%":h(r);if(i===void 0)return!1;return e.width=i,e.height=i,!0}function je(t,e){let r=/^(-?)(top|right|bottom|left)-(.+)$/.exec(t);if(!r)return!1;let i=r[3]==="full"?"100%":h(r[3]);if(i===void 0)return!1;return e[r[2]]=typeof i==="number"&&r[1]?-i:i,!0}function Me(t,e){let r=/^space-(x|y)-(.+)$/.exec(t);if(!r)return!1;let i=h(r[2]);if(i===void 0)return!1;return e.gap=i,!0}function He(t,e){if(t.startsWith("gap-")){let r=h(t.slice(4));if(r!==void 0)return e.gap=r,!0}if(t.startsWith("gap-x-")){let r=h(t.slice(6));if(r!==void 0)return e.columnGap=r,!0}if(t.startsWith("gap-y-")){let r=h(t.slice(6));if(r!==void 0)return e.rowGap=r,!0}return!1}function A(t){let e=[],r=[],i=[];function s(d,g){let c=/^(text|bg|border|ring)-([a-z-]+)(\/[^\s]+)?$/.exec(d),f=c&&Nn[c[2]];return f?`${c[1]}-${f[g]}${c[3]||""}`:d}for(let d of t.split(/\s+/).filter(Boolean))if(d.startsWith("dark:"))r.push(s(d.slice(5),"dark"));else if(!d.includes(":")||d.startsWith("[")){if(e.push(s(d,"light")),s(d,"dark")!==d)i.push(s(d,"dark"))}let a=[],u={style:K(e.join(" "),a),unknown:a};if(r.length||i.length)u.dark=K([...i,...r].join(" "),a);for(let d of e){if(d==="truncate")u.numberOfLines=1;let g=/^line-clamp-(\d+)$/.exec(d);if(g)u.numberOfLines=Number(g[1]);if(!u.icon&&/^i-[a-z0-9]+-[a-z0-9-]+$/.test(d))u.icon=d}return u.unknown=a.filter((d)=>!/^line-clamp-\d+$/.test(d)),u}function K(t,e){let r={},i=t.split(/\s+/).filter(Boolean);for(let s of i){if(/^i-[a-z0-9]+-/.test(s))continue;let a=Ee[s];if(a){a("",r);continue}if(Ne(s,r))continue;if(We(s,r))continue;if(Be(s,r))continue;if(Ie(s,r))continue;if(Le(s,r))continue;if(De(s,r))continue;if(Xe(s,r))continue;if(Oe(s,r))continue;if($e(s,r))continue;if(ze(s,r))continue;if(He(s,r))continue;if(Ae(s,r))continue;if(Fe(s,r))continue;if(Ve(s,r))continue;if(je(s,r))continue;if(Me(s,r))continue;if(e?.push(s),typeof process<"u"&&process.env?.NODE_ENV==="development")console.warn(`[STX Native] Unknown Headwind class: ${s}`)}return r}function W(t,e={},r={},i={},s=[]){return{type:t,props:e,style:r,events:i,children:s}}function Q(t,e,r={}){return{version:"1.0.0",root:t,script:e,meta:{source:r.source||"unknown",compiledAt:r.compiledAt||Date.now(),headwindConfig:r.headwindConfig}}}var ee=new Set(["script","style","head","meta","link","title","base","noscript","svg"]),te=new Set(["template","body","html","main","fragment"]),B=new Set(["svg"]),Ge={click:"onPress",press:"onPress","press-in":"onPressIn",pressin:"onPressIn","press-out":"onPressOut",pressout:"onPressOut",longpress:"onLongPress",contextmenu:"onLongPress",input:"onChangeText",change:"onValueChange","value-change":"onValueChange",valuechange:"onValueChange",focus:"onFocus",focusin:"onFocus",blur:"onBlur",focusout:"onBlur",submit:"onSubmitEditing","submit-editing":"onSubmitEditing",submitediting:"onSubmitEditing","end-editing":"onEndEditing",endediting:"onEndEditing",scroll:"onScroll",refresh:"onRefresh",layout:"onLayout","end-reached":"onEndReached",endreached:"onEndReached",close:"onRequestClose","request-close":"onRequestClose",requestclose:"onRequestClose",show:"onShow",dismiss:"onDismiss","sliding-complete":"onSlidingComplete",slidingcomplete:"onSlidingComplete","load-start":"onLoadStart",loadstart:"onLoadStart",load:"onLoad","load-end":"onLoadEnd",loadend:"onLoadEnd",error:"onError"},qe=new Set(["onBlur","onChangeText","onDismiss","onEndEditing","onEndReached","onError","onFocus","onLayout","onLoad","onLoadEnd","onLoadStart","onLongPress","onPress","onPressIn","onPressOut","onRequestClose","onRefresh","onScroll","onShow","onSlidingComplete","onSubmitEditing","onValueChange"]),V=new Set(["display","gridColumns","gridTemplateColumns","gridAutoRows","flex","flexGrow","flexShrink","flexBasis","flexDirection","flexWrap","justifyContent","alignItems","alignSelf","alignContent","position","top","right","bottom","left","zIndex","width","height","minWidth","maxWidth","minHeight","maxHeight","aspectRatio","margin","marginTop","marginRight","marginBottom","marginLeft","marginHorizontal","marginVertical","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingHorizontal","paddingVertical","gap","rowGap","columnGap","borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","borderStyle","backgroundColor","backgroundImage","opacity","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","color","fontSize","fontWeight","fontStyle","fontFamily","lineHeight","letterSpacing","textAlign","textDecorationLine","textDecorationColor","textTransform","resizeMode","tintColor","transform","overflow"]),Ue=new Set(["gridColumns","gridAutoRows","flex","flexGrow","flexShrink","zIndex","aspectRatio","gap","rowGap","columnGap","borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","opacity","shadowOpacity","shadowRadius","elevation","fontSize","lineHeight","letterSpacing"]),Je=new Set(["top","right","bottom","left","width","height","minWidth","maxWidth","minHeight","maxHeight","flexBasis","margin","marginTop","marginRight","marginBottom","marginLeft","marginHorizontal","marginVertical","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingHorizontal","paddingVertical"]),re=new Set(["View","ScrollView","SafeAreaView","KeyboardAvoidingView","Text","TextInput","Button","TouchableOpacity","TouchableHighlight","Pressable","Icon","Image","ImageBackground","FlatList","SectionList","Switch","Slider","Picker","DatePicker","Modal","ActivityIndicator","StatusBar","RefreshControl"]),ne=new Set(["View","SafeAreaView","ScrollView","KeyboardAvoidingView"]),Ye={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" ","#39":"'","#x27":"'"};function _(t){return t.replace(/&(#x?[0-9a-f]+|\w+);/gi,(e,r)=>{let i=Ye[r.toLowerCase()];if(i!==void 0)return i;if(r[0]==="#"){let s=r[1]==="x"||r[1]==="X"?Number.parseInt(r.slice(2),16):Number.parseInt(r.slice(1),10);return Number.isFinite(s)?String.fromCodePoint(s):e}return e})}function ie(t){return t.replace(/-([a-z])/g,(e,r)=>r.toUpperCase())}function oe(t){let e=/^(-?[\d.]+)px$/.exec(t);if(e)return Number.parseFloat(e[1]);let r=/^(-?[\d.]+)r?em$/.exec(t);if(r)return Number.parseFloat(r[1])*16;if(/^-?[\d.]+$/.test(t))return Number.parseFloat(t);return t}function Ke(t,e,r){let i={},s={},a={},l="",u={};for(let[g,c]of e){let f=g.toLowerCase();if(f==="class"||f==="classname"){l=l?`${l} ${c}`:c;continue}if(f==="style"){u={...u,...Ze(t,c,r)};continue}if(f.startsWith(":")||f.startsWith("x-")&&f!=="x-cloak"){a[f.startsWith(":")?f.slice(1):f.slice(2)]=_(c);continue}if(f==="x-cloak")continue;if(f.startsWith("@")||f.startsWith("v-on:")){let b=f.startsWith("@")?f.slice(1):f.slice(5),[m]=b.split("."),x=Ge[m]??(m.startsWith("on")?m:"");if(!x||!qe.has(x)){r.push({kind:"unread-event",tag:t,name:g});continue}s[x]=_(c);continue}if(f==="key"){i.key=c;continue}let p=_(c);try{i[O(g)]=JSON.parse(p)}catch{i[O(g)]=p}}let d={...l?A(l).style:{},...u};return{props:i,style:d,events:s,bindings:a,classes:l,inline:u}}function se(t,e){if(Ue.has(t))return!1;if(Je.has(t))return/^-?[\d.]+%$/.test(e);return!0}function Ze(t,e,r){let i={},s=_(e);try{let a=JSON.parse(s);if(a&&typeof a==="object"&&!Array.isArray(a)){for(let[l,u]of Object.entries(a)){let d=V.has(l)?l:ie(l.trim().toLowerCase());if(!V.has(d)){r.push({kind:"unknown-style",tag:t,name:d});continue}if(u===null||u===void 0)continue;let g=typeof u==="string"?oe(u):u;if(typeof g!=="string"&&typeof g!=="number")continue;if(typeof g==="string"&&!se(d,g)){r.push({kind:"non-numeric-style",tag:t,name:d});continue}i[d]=g}return i}}catch{}for(let a of s.split(";")){let l=a.indexOf(":");if(l===-1)continue;let u=ie(a.slice(0,l).trim().toLowerCase()),d=a.slice(l+1).trim();if(!u||!d)continue;if(!V.has(u)){r.push({kind:"unknown-style",tag:t,name:u});continue}let g=oe(d);if(typeof g==="string"&&!se(u,g)){r.push({kind:"non-numeric-style",tag:t,name:u});continue}i[u]=g}return i}function ae(t){return t.children.map((e)=>typeof e==="string"?e:ae(e)).join("").replace(/\s+/g," ").trim()}function Qe(t,e){let r=t.node,i=r.children.filter((a)=>typeof a!=="string"),s=r.children.filter((a)=>typeof a==="string").join("").trim();if(ne.has(r.type)&&i.length===0&&s)return r.type="Text",r.children=[s],r;if(r.type==="Text"&&i.length>0){let a=ae(r);return e.push({kind:"flattened-text",tag:t.tag}),r.children=a?[a]:[],r}if(ne.has(r.type)&&i.length>0)r.children=i;return r}async function et(t,e={}){let r=[],i=[],s=[],a=new Set;function l(c){let f=s[s.length-1];if(!f)i.push(c);else if(!f.dropped)f.node.children.push(c)}function u(c){if(c.node.bindings&&Object.keys(c.node.bindings).length>0){let p=c.node.children,b=p.filter((x)=>typeof x!=="string"),m=b.length===1&&b.length===p.length?b[0]:W("View",{},{},{},p);if(m.bindings={...c.node.bindings,...m.bindings},m.bindingId===void 0&&c.node.bindingId!==void 0)m.bindingId=c.node.bindingId;l(m);return}let f=s[s.length-1];for(let p of c.node.children){if(typeof p==="string"){if(f&&!f.dropped)f.node.children.push(p);continue}if(!f)i.push(p);else if(!f.dropped)f.node.children.push(p)}}function d(c,f){let p=ee.has(c)&&!B.has(c),b=s[s.length-1]?.dropped??!1,{props:m,style:x,events:S,bindings:w,classes:v,inline:me}=p||b?{props:{},style:{},events:{},bindings:{},classes:"",inline:{}}:Ke(c,f,r),L=m["data-native"],R;if(typeof L==="string"&&re.has(L))R=L,delete m["data-native"];else R=B.has(c)?"View":U(c);if(R===c&&!re.has(R)&&!ee.has(c)&&!te.has(c)&&!a.has(c))a.add(c),r.push({kind:"unmapped-tag",tag:c});if((p||B.has(c))&&!a.has(`drop:${c}`))a.add(`drop:${c}`),r.push({kind:"dropped-subtree",tag:c});if(R==="Icon"){let he=A(v).icon;m.symbol=J(String(m.symbol||m.name||he||""),Boolean(m.symbol)).symbol}let C=W(R,m,x,S);C._inlineStyle=me;let D=m["data-stx-b"];if(typeof D==="number"&&Number.isInteger(D))C.bindingId=D;if(delete m["data-stx-b"],v)C._classes=v;if(Object.keys(w).length>0)C.bindings=w;if(typeof m.key==="string")C.key=m.key,delete m.key;return{tag:c,node:C,dropped:p||b||B.has(c),discard:p||b,unwrap:te.has(c)}}if(await new HTMLRewriter().on("*",{element(c){let f=c.tagName.toLowerCase(),p=d(f,[...c.attributes]),b=!0;try{c.onEndTag(()=>{if(s.pop(),p.discard)return;if(p.unwrap)u(p);else l(Qe(p,r))})}catch{b=!1}if(b)s.push(p);else if(!p.discard)l(p.node)},text(c){let f=s[s.length-1];if(!f||f.dropped)return;let p=_(c.text).replace(/\s+/g," ");if(!p.trim())return;f.node.children.push(p)}}).transform(new Response(t)).text(),i.length===0)throw Error(`No element to translate in the rendered output of ${e.source??"unknown"}`);return{root:i.length===1?i[0]:W("View",{},{},{},i),diagnostics:r}}async function ce(t,e={}){let{root:r,diagnostics:i}=await et(t,e),s=e.script??{exports:{},functions:[],code:""};return{document:Q(r,s,{source:e.source??"unknown"}),diagnostics:i}}var le=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,tt=/(?:^|\n)\s*(?:export\s+)?(?:async\s+)?function\s*\*?\s*([$\w]+)\s*\(/g,rt=/(?:^|\n)\s*(?:export\s+)?(?:const|let|var)\s+([$\w]+)\s*=\s*(?:async\s*)?(?:\([^)]*\)|[$\w]+)\s*=>/g,ue=/(?:^|\n)\s*(?:export\s+)?const\s+([$\w]+)\s*=\s*(-?[\d.]+|true|false|'[^']*'|"[^"]*")\s*(?=;|\n|$)/g;function P(t){let e=[];le.lastIndex=0;for(let a of t.matchAll(le)){let l=a[1]??"";if(/\bserver\b/.test(l))continue;e.push(a[2].trim())}let r=e.filter(Boolean).join(`
2
+ import"./chunk-ynvce0q6.js";import"./chunk-2n5pjbw9.js";import"./chunk-88px183j.js";import{or,Ds,Ri}from"./chunk-2jbyks2t.js";import"./chunk-pf0d8y9n.js";import{Nn,Fn,n,o}from"./chunk-dqdggvq4.js";import"./chunk-v83bpj84.js";import"./chunk-y36av1ac.js";import"./chunk-zydg3wgt.js";import"./chunk-ng61wjke.js";import"./chunk-jz7pvh7b.js";import"./chunk-0trfbqa7.js";import{Pe}from"./chunk-hhsynd7c.js";import"./chunk-d2zw2e5m.js";import{existsSync as M,mkdirSync as dt,readFileSync as ft}from"fs";import T from"path";import{existsSync as at,mkdirSync as ct}from"fs";import k from"path";import{existsSync as it}from"fs";import E from"path";var be="data-stx-b",H=new Set(Ds),Se=new Set(or);function xe(t){if(t==="ref"||t==="data-stx-ref")return"ref";if(t.startsWith("::"))return null;if(t.startsWith("@bind:")||t.startsWith("x-bind:"))return"attr";if(t.startsWith("@")||t.startsWith(":")){let e=t.slice(1).split(".")[0];if(H.has(e))return e==="if"?"if":e;if(e==="for"||e==="else"||e==="else-if"||e==="elseif")return"for";if(Ri(e))return"event";if(t.startsWith("@"))return"event";return"attr"}if(t.startsWith("x-")){let e=t.split(".")[0];if(!Se.has(e))return"attr";let r=e.slice(2);if(r==="cloak"||r==="data"||r==="bind")return null;if(r==="tooltip"||r==="tooltip-position")return null;return H.has(r)?r==="if"?"if":r:"attr"}return null}function we(t){let e=[];for(let[r,i]of t){let s=xe(r);if(s)e.push({name:r,value:i,kind:s})}return e}var ye=/<([a-z][\w-]*)((?:\s+[^\s"'=<>/]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'=<>`]+))?)*)\s*\/?>/gi,X=/([^\s"'=<>/]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?/g;function G(t){let e=[],r=0;return{html:t.replace(ye,(s,a,l)=>{if(!l||!/[:@]|x-/.test(l))return s;let u=[];X.lastIndex=0;for(let p=X.exec(l);p;p=X.exec(l))u.push([p[1],p[2]??p[3]??p[4]??""]);let d=we(u);if(!d.length)return s;let g={id:r++,bindings:d};if(d.some((p)=>p.kind==="for"))g.template=!0;e.push(g);let c=s.endsWith("/>");return`${s.slice(0,c?-2:-1).trimEnd()} ${be}="${g.id}"${c?"/>":">"}`}),manifest:{entries:e}}}var Te=["accessibilityHint","accessibilityLabel","accessibilityRole","accessibilityState","accessibilityValue","activeOpacity","alwaysBounceHorizontal","alwaysBounceVertical","animationType","autoCapitalize","autoCorrect","autoFocus","blurRadius","contentContainerStyle","defaultSource","defaultValue","ellipsizeMode","fadeDuration","hidesWhenStopped","hitSlop","imageStyle","initialNumToRender","iosBackgroundColor","keyboardDismissMode","keyboardShouldPersistTaps","keyboardType","keyboardVerticalOffset","keyExtractor","maxLength","maximumTrackTintColor","maximumValue","maxToRenderPerBatch","minimumTrackTintColor","minimumValue","numberOfLines","numColumns","onEndReachedThreshold","pagingEnabled","placeholderTextColor","pointerEvents","presentationStyle","pressRetentionOffset","progressBackgroundColor","progressViewOffset","refreshControl","resizeMode","returnKeyType","scrollEnabled","scrollTarget","secureTextEntry","selectedValue","selectionColor","showsHorizontalScrollIndicator","showsVerticalScrollIndicator","statusBarTranslucent","stickyHeaderIndices","testID","thumbColor","thumbTintColor","titleColor","trackColor","underlayColor","windowSize"],ve=new Map(Te.map((t)=>[q(t),t]));function q(t){return t.replace(/[-_]/g,"").toLowerCase()}function O(t){return ve.get(q(t))??t}var ke={view:"View",text:"Text",button:"Button",image:"Image",img:"Image",input:"TextInput",textarea:"TextInput",scroll:"ScrollView",scrollview:"ScrollView",list:"FlatList",flatlist:"FlatList",modal:"Modal",switch:"Switch",slider:"Slider",picker:"Picker",select:"Picker",loading:"ActivityIndicator",spinner:"ActivityIndicator",div:"View",span:"Text",p:"Text",h1:"Text",h2:"Text",h3:"Text",h4:"Text",h5:"Text",h6:"Text",a:"TouchableOpacity",section:"View",article:"View",header:"SafeAreaView",footer:"View",main:"View",nav:"View",aside:"View",form:"View",label:"Text",fieldset:"View",legend:"Text",option:"Text",dialog:"Modal",figure:"View",figcaption:"Text",picture:"View",hr:"View",ul:"View",ol:"View",li:"View",dl:"View",dt:"Text",dd:"Text",table:"View",thead:"View",tbody:"View",tfoot:"View",tr:"View",th:"Text",td:"Text",caption:"Text",strong:"Text",b:"Text",em:"Text",i:"Text",u:"Text",s:"Text",small:"Text",mark:"Text",abbr:"Text",time:"Text",code:"Text",kbd:"Text",samp:"Text",pre:"Text",blockquote:"Text",cite:"Text",q:"Text",sub:"Text",sup:"Text"};function U(t){return ke[t.toLowerCase()]||t}var Re={activity:"waveform.path.ecg","alarm-clock":"alarm","alert-circle":"exclamationmark.circle","alert-triangle":"exclamationmark.triangle",archive:"archivebox","arrow-down":"arrow.down","arrow-left":"arrow.left","arrow-right":"arrow.right","arrow-up":"arrow.up","arrow-up-right":"arrow.up.right","at-sign":"at","audio-lines":"waveform",award:"rosette","badge-check":"checkmark.seal","bar-chart":"chart.bar","bar-chart-2":"chart.bar","bar-chart-3":"chart.bar",battery:"battery.100",bed:"bed.double",bell:"bell","bell-off":"bell.slash",bike:"figure.outdoor.cycle",bluetooth:"antenna.radiowaves.left.and.right",book:"book","book-open":"book",bookmark:"bookmark",brain:"brain",calendar:"calendar","calendar-check":"calendar.badge.checkmark","calendar-clock":"calendar.badge.clock","calendar-days":"calendar","calendar-plus":"calendar.badge.plus","calendar-range":"calendar","calendar-sync":"arrow.triangle.2.circlepath",camera:"camera","chart-bar":"chart.bar","chart-line":"chart.xyaxis.line",check:"checkmark","check-circle":"checkmark.circle","check-circle-2":"checkmark.circle","chevron-down":"chevron.down","chevron-left":"chevron.left","chevron-right":"chevron.right","chevron-up":"chevron.up",circle:"circle","circle-alert":"exclamationmark.circle","circle-check":"checkmark.circle","circle-check-big":"checkmark.circle","circle-help":"questionmark.circle","circle-play":"play.circle","circle-plus":"plus.circle","circle-user":"person.crop.circle","circle-x":"xmark.circle",clapperboard:"film",clipboard:"clipboard","clipboard-list":"list.clipboard",clock:"clock",cloud:"cloud","cloud-off":"icloud.slash",coffee:"cup.and.saucer",copy:"doc.on.doc","credit-card":"creditcard",download:"arrow.down.circle",droplet:"drop",droplets:"drop",dumbbell:"dumbbell",edit:"pencil","external-link":"arrow.up.right.square",eye:"eye","eye-off":"eye.slash",file:"doc","file-text":"doc.text",filter:"line.3.horizontal.decrease",flag:"flag",flame:"flame","flower-2":"camera.macro",footprints:"figure.run",gauge:"gauge",gift:"gift",globe:"globe","graduation-cap":"graduationcap","grip-vertical":"line.3.horizontal",heart:"heart","heart-pulse":"heart.text.square","help-circle":"questionmark.circle",history:"clock.arrow.circlepath",home:"house",house:"house",image:"photo",inbox:"tray",info:"info.circle",layers:"square.3.layers.3d","layout-grid":"square.grid.2x2",library:"books.vertical",link:"link",list:"list.bullet","list-checks":"checklist",loader:"arrow.triangle.2.circlepath","loader-2":"arrow.triangle.2.circlepath","loader-circle":"arrow.triangle.2.circlepath",lock:"lock","log-in":"arrow.right.to.line","log-out":"rectangle.portrait.and.arrow.right",mail:"envelope",map:"map","map-pin":"mappin.and.ellipse",medal:"medal",menu:"line.3.horizontal","message-circle":"bubble.left","message-square":"text.bubble","message-square-quote":"quote.bubble",mic:"mic",minus:"minus",moon:"moon","more-horizontal":"ellipsis","more-vertical":"ellipsis",mountain:"mountain.2",music:"music.note",package:"shippingbox",pause:"pause","pause-circle":"pause.circle",pencil:"pencil","person-standing":"figure.walk",phone:"phone",play:"play.fill",plug:"powerplug",plus:"plus","plus-circle":"plus.circle","refresh-cw":"arrow.clockwise",repeat:"repeat","rotate-ccw":"arrow.counterclockwise",route:"point.topleft.down.to.point.bottomright.curvepath",ruler:"ruler",sailboat:"sailboat",satellite:"antenna.radiowaves.left.and.right",save:"square.and.arrow.down",scale:"scalemass",search:"magnifyingglass",send:"paperplane",settings:"gearshape","settings-2":"slider.horizontal.3",share:"square.and.arrow.up","share-2":"square.and.arrow.up",shield:"shield","shield-check":"checkmark.shield","shopping-bag":"bag","shopping-cart":"cart","skip-back":"backward.end","skip-forward":"forward.end",sliders:"slider.horizontal.3","sliders-horizontal":"slider.horizontal.3",smartphone:"iphone",snowflake:"snowflake",sparkles:"sparkles",square:"square",star:"star",stopwatch:"stopwatch",store:"storefront",sun:"sun.max",sunrise:"sunrise",sunset:"sunset",tag:"tag",target:"scope",thermometer:"thermometer.medium","thumbs-up":"hand.thumbsup",timer:"timer",trash:"trash","trash-2":"trash","trending-down":"chart.line.downtrend.xyaxis","trending-up":"chart.line.uptrend.xyaxis",trophy:"trophy",unlink:"personalhotspot.slash",upload:"arrow.up.circle",user:"person","user-plus":"person.badge.plus","user-round":"person",users:"person.2",video:"video","volume-2":"speaker.wave.2",watch:"applewatch",waves:"figure.pool.swim",weight:"scalemass",wifi:"wifi","wifi-off":"wifi.slash",wind:"wind",x:"xmark","x-circle":"xmark.circle",zap:"bolt"};function J(t,e=!1){let r=String(t??"").trim();if(!r)return{symbol:"circle",known:!1};if(e)return{symbol:r,known:!0};let i=/^i-([a-z0-9]+)-(.+)$/.exec(r)??/^([a-z0-9]+):(.+)$/.exec(r),s=i?i[1]:"lucide",a=i?i[2]:r;if(s==="lucide"){let l=Re[a];if(l)return{symbol:l,iconify:`i-lucide-${a}`,known:!0};if(!i&&r.includes("."))return{symbol:r,known:!0}}return{symbol:"circle",iconify:i?r:`i-lucide-${a}`,known:!1}}var Ce={transparent:"transparent",current:"currentColor",black:"#000000",white:"#ffffff",slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"}},Z={px:1,0:0,0.5:2,1:4,1.5:6,2:8,2.5:10,3:12,3.5:14,4:16,5:20,6:24,7:28,8:32,9:36,10:40,11:44,12:48,14:56,16:64,20:80,24:96,28:112,32:128,36:144,40:160,44:176,48:192,52:208,56:224,60:240,64:256,72:288,80:320,96:384},Y={xs:12,sm:14,base:16,lg:18,xl:20,"2xl":24,"3xl":30,"4xl":36,"5xl":48,"6xl":60,"7xl":72,"8xl":96,"9xl":128},y={none:0,sm:2,DEFAULT:4,md:6,lg:8,xl:12,"2xl":16,"3xl":24,full:9999};function N(t){let e=t.lastIndexOf("/");if(e>0&&!t.endsWith("]")){let i=N(t.slice(0,e)),s=t.slice(e+1),a=/^\[(.+)\]$/.test(s)?Number.parseFloat(s.slice(1,-1))*(s.includes("%")?1:100):Number.parseFloat(s);if(!i||!Number.isFinite(a))return;return _e(i,a/100)}if(t==="transparent")return"transparent";if(t==="current")return"currentColor";if(t==="black")return"#000000";if(t==="white")return"#ffffff";let r=t.split("-");if(r.length===2){let[i,s]=r,a=Ce[i];if(a&&typeof a==="object")return a[s]}if(t.startsWith("[")&&t.endsWith("]")){let i=t.slice(1,-1);return/^(#|rgba?\(|hsla?\(|[a-z]+$)/i.test(i)?i:void 0}return}function _e(t,e){if(t==="transparent")return t;let r=t.startsWith("#")?t.slice(1):"";if(r.length===3)r=r.split("").map((s)=>s+s).join("");if(r.length===8)r=r.slice(0,6);if(r.length!==6)return;let i=Math.round(Math.min(1,Math.max(0,e))*255);return`#${r}${i.toString(16).padStart(2,"0")}`}function z(t,e=16){if(!t.startsWith("[")||!t.endsWith("]"))return;let r=t.slice(1,-1),i=Number.parseFloat(r);if(!Number.isFinite(i))return;if(r.endsWith("rem"))return i*16;if(r.endsWith("em"))return i*e;return i}function h(t){if(t.startsWith("[")&&t.endsWith("]")){let e=t.slice(1,-1),r=e.endsWith("rem")?Number.parseFloat(e)*16:Number.parseFloat(e);return Number.isFinite(r)?r:void 0}return Z[t]}var Ee={flex:(t,e)=>(e.display="flex",!0),hidden:(t,e)=>(e.display="none",!0),grid:(t,e)=>(e.display="grid",!0),"flex-row":(t,e)=>(e.flexDirection="row",!0),"flex-col":(t,e)=>(e.flexDirection="column",!0),"flex-row-reverse":(t,e)=>(e.flexDirection="row-reverse",!0),"flex-col-reverse":(t,e)=>(e.flexDirection="column-reverse",!0),"flex-wrap":(t,e)=>(e.flexWrap="wrap",!0),"flex-nowrap":(t,e)=>(e.flexWrap="nowrap",!0),"flex-wrap-reverse":(t,e)=>(e.flexWrap="wrap-reverse",!0),"flex-1":(t,e)=>(e.flex=1,e.flexGrow=1,e.flexShrink=1,e.flexBasis=0,!0),"flex-auto":(t,e)=>(e.flexGrow=1,e.flexShrink=1,!0),"flex-initial":(t,e)=>(e.flexGrow=0,e.flexShrink=1,!0),"flex-none":(t,e)=>(e.flexGrow=0,e.flexShrink=0,!0),grow:(t,e)=>(e.flexGrow=1,!0),"grow-0":(t,e)=>(e.flexGrow=0,!0),shrink:(t,e)=>(e.flexShrink=1,!0),"shrink-0":(t,e)=>(e.flexShrink=0,!0),"justify-start":(t,e)=>(e.justifyContent="flex-start",!0),"justify-center":(t,e)=>(e.justifyContent="center",!0),"justify-end":(t,e)=>(e.justifyContent="flex-end",!0),"justify-between":(t,e)=>(e.justifyContent="space-between",!0),"justify-around":(t,e)=>(e.justifyContent="space-around",!0),"justify-evenly":(t,e)=>(e.justifyContent="space-evenly",!0),"items-start":(t,e)=>(e.alignItems="flex-start",!0),"items-center":(t,e)=>(e.alignItems="center",!0),"items-end":(t,e)=>(e.alignItems="flex-end",!0),"items-stretch":(t,e)=>(e.alignItems="stretch",!0),"items-baseline":(t,e)=>(e.alignItems="baseline",!0),"self-auto":(t,e)=>(e.alignSelf="auto",!0),"self-start":(t,e)=>(e.alignSelf="flex-start",!0),"self-center":(t,e)=>(e.alignSelf="center",!0),"self-end":(t,e)=>(e.alignSelf="flex-end",!0),"self-stretch":(t,e)=>(e.alignSelf="stretch",!0),"self-baseline":(t,e)=>(e.alignSelf="baseline",!0),"min-w-0":(t,e)=>(e.minWidth=0,!0),"aspect-square":(t,e)=>(e.aspectRatio=1,!0),"inset-0":(t,e)=>(e.top=0,e.right=0,e.bottom=0,e.left=0,!0),"tracking-tighter":(t,e)=>(e.letterSpacing=-0.8,!0),"tracking-tight":(t,e)=>(e.letterSpacing=-0.4,!0),"tracking-normal":(t,e)=>(e.letterSpacing=0,!0),"tracking-wide":(t,e)=>(e.letterSpacing=0.4,!0),"tracking-wider":(t,e)=>(e.letterSpacing=0.8,!0),"tracking-widest":(t,e)=>(e.letterSpacing=1.6,!0),"tabular-nums":()=>!0,block:()=>!0,"inline-flex":(t,e)=>(e.display="flex",!0),truncate:()=>!0,relative:(t,e)=>(e.position="relative",!0),absolute:(t,e)=>(e.position="absolute",!0),"overflow-visible":(t,e)=>(e.overflow="visible",!0),"overflow-hidden":(t,e)=>(e.overflow="hidden",!0),"overflow-scroll":(t,e)=>(e.overflow="scroll",!0),"font-thin":(t,e)=>(e.fontWeight="100",!0),"font-extralight":(t,e)=>(e.fontWeight="200",!0),"font-light":(t,e)=>(e.fontWeight="300",!0),"font-normal":(t,e)=>(e.fontWeight="400",!0),"font-medium":(t,e)=>(e.fontWeight="500",!0),"font-semibold":(t,e)=>(e.fontWeight="600",!0),"font-bold":(t,e)=>(e.fontWeight="bold",!0),"font-extrabold":(t,e)=>(e.fontWeight="800",!0),"font-black":(t,e)=>(e.fontWeight="900",!0),italic:(t,e)=>(e.fontStyle="italic",!0),"not-italic":(t,e)=>(e.fontStyle="normal",!0),"text-left":(t,e)=>(e.textAlign="left",!0),"text-center":(t,e)=>(e.textAlign="center",!0),"text-right":(t,e)=>(e.textAlign="right",!0),"text-justify":(t,e)=>(e.textAlign="justify",!0),uppercase:(t,e)=>(e.textTransform="uppercase",!0),lowercase:(t,e)=>(e.textTransform="lowercase",!0),capitalize:(t,e)=>(e.textTransform="capitalize",!0),"normal-case":(t,e)=>(e.textTransform="none",!0),underline:(t,e)=>(e.textDecorationLine="underline",!0),"line-through":(t,e)=>(e.textDecorationLine="line-through",!0),"no-underline":(t,e)=>(e.textDecorationLine="none",!0)};function Ne(t,e){if(!t.startsWith("bg-"))return!1;let r=t.slice(3),i=N(r);if(i)return e.backgroundColor=i,!0;return!1}function We(t,e){if(!t.startsWith("text-"))return!1;let r=t.slice(5);if(Y[r])return e.fontSize=Y[r],!0;if(r.startsWith("[")&&r.endsWith("]")){let s=r.slice(1,-1);if(/^-?[\d.]+(?:px|r?em)?$/.test(s)){let a=s.endsWith("rem")||s.endsWith("em")?Number.parseFloat(s)*16:Number.parseFloat(s);if(Number.isFinite(a))return e.fontSize=a,!0}}let i=N(r);if(i)return e.color=i,!0;return!1}function Be(t,e){if(t.startsWith("p-")){let r=h(t.slice(2));if(r!==void 0)return e.padding=r,!0}if(t.startsWith("px-")){let r=h(t.slice(3));if(r!==void 0)return e.paddingHorizontal=r,!0}if(t.startsWith("py-")){let r=h(t.slice(3));if(r!==void 0)return e.paddingVertical=r,!0}if(t.startsWith("pt-")){let r=h(t.slice(3));if(r!==void 0)return e.paddingTop=r,!0}if(t.startsWith("pr-")){let r=h(t.slice(3));if(r!==void 0)return e.paddingRight=r,!0}if(t.startsWith("pb-")){let r=h(t.slice(3));if(r!==void 0)return e.paddingBottom=r,!0}if(t.startsWith("pl-")){let r=h(t.slice(3));if(r!==void 0)return e.paddingLeft=r,!0}return!1}function Ie(t,e){if(t.startsWith("m-")){let r=h(t.slice(2));if(r!==void 0)return e.margin=r,!0}if(t.startsWith("mx-")){let r=h(t.slice(3));if(r!==void 0)return e.marginHorizontal=r,!0}if(t.startsWith("my-")){let r=h(t.slice(3));if(r!==void 0)return e.marginVertical=r,!0}if(t.startsWith("mt-")){let r=h(t.slice(3));if(r!==void 0)return e.marginTop=r,!0}if(t.startsWith("mr-")){let r=h(t.slice(3));if(r!==void 0)return e.marginRight=r,!0}if(t.startsWith("mb-")){let r=h(t.slice(3));if(r!==void 0)return e.marginBottom=r,!0}if(t.startsWith("ml-")){let r=h(t.slice(3));if(r!==void 0)return e.marginLeft=r,!0}return!1}function Le(t,e){if(!t.startsWith("w-"))return!1;let r=t.slice(2);if(r==="full")return e.width="100%",!0;if(r==="screen")return e.width="100%",!0;if(r==="auto")return e.width="auto",!0;if(r.includes("/")){let[s,a]=r.split("/"),l=Number.parseInt(s)/Number.parseInt(a)*100;return e.width=`${l}%`,!0}let i=h(r);if(i!==void 0)return e.width=i,!0;return!1}function De(t,e){if(!t.startsWith("h-"))return!1;let r=t.slice(2);if(r==="full")return e.height="100%",!0;if(r==="screen")return e.height="100%",!0;if(r==="auto")return e.height="auto",!0;let i=h(r);if(i!==void 0)return e.height=i,!0;return!1}function Xe(t,e){if(!t.startsWith("rounded"))return!1;if(t==="rounded")return e.borderRadius=y.DEFAULT,!0;let r=t.slice(8);if(r==="")return!1;let i=/^(?:(t|b|l|r)-)?(\[[^\]]+\])$/.exec(r);if(i){let a=z(i[2]);if(a===void 0)return!1;let l={t:["borderTopLeftRadius","borderTopRightRadius"],b:["borderBottomLeftRadius","borderBottomRightRadius"],l:["borderTopLeftRadius","borderBottomLeftRadius"],r:["borderTopRightRadius","borderBottomRightRadius"]};for(let u of i[1]?l[i[1]]:["borderRadius"])e[u]=a;return!0}if(r.startsWith("t-")){let a=y[r.slice(2)]??y.DEFAULT;return e.borderTopLeftRadius=a,e.borderTopRightRadius=a,!0}if(r.startsWith("b-")){let a=y[r.slice(2)]??y.DEFAULT;return e.borderBottomLeftRadius=a,e.borderBottomRightRadius=a,!0}if(r.startsWith("l-")){let a=y[r.slice(2)]??y.DEFAULT;return e.borderTopLeftRadius=a,e.borderBottomLeftRadius=a,!0}if(r.startsWith("r-")){let a=y[r.slice(2)]??y.DEFAULT;return e.borderTopRightRadius=a,e.borderBottomRightRadius=a,!0}let s=y[r];if(s!==void 0)return e.borderRadius=s,!0;return!1}function Oe(t,e){if(!t.startsWith("border"))return!1;if(t==="border")return e.borderWidth=1,!0;let r=t.match(/^border-(\d+)$/);if(r)return e.borderWidth=Number.parseInt(r[1]),!0;let i=t.match(/^border-(t|r|b|l)-?(\d*)$/);if(i){let[,s,a]=i,l=a?Number.parseInt(a):1;switch(s){case"t":e.borderTopWidth=l;break;case"r":e.borderRightWidth=l;break;case"b":e.borderBottomWidth=l;break;case"l":e.borderLeftWidth=l;break}return!0}return!1}function $e(t,e){if(!t.startsWith("border-"))return!1;let r=t.slice(7),i=N(r);if(i)return e.borderColor=i,!0;return!1}function ze(t,e){if(!t.startsWith("opacity-"))return!1;let r=Number.parseInt(t.slice(8));if(!Number.isNaN(r))return e.opacity=r/100,!0;return!1}function Ae(t,e){if(t.startsWith("tracking-[")){let r=z(t.slice(9),typeof e.fontSize==="number"?e.fontSize:16);if(r===void 0)return!1;return e.letterSpacing=r,!0}if(t.startsWith("leading-")){let r=t.slice(8),i=typeof e.fontSize==="number"?e.fontSize:16,s={none:1,tight:1.25,snug:1.375,normal:1.5,relaxed:1.625,loose:2},a=r.startsWith("[")?/^\[[\d.]+\]$/.test(r)?Number.parseFloat(r.slice(1,-1))*i:z(r,i):s[r]!==void 0?s[r]*i:Z[r];if(a===void 0||!Number.isFinite(a))return!1;return e.lineHeight=a,!0}return!1}function Ve(t,e){let r=/^grid-cols-(\d+)$/.exec(t);if(!r)return!1;return e.gridColumns=Number(r[1]),!0}function Fe(t,e){if(!t.startsWith("size-"))return!1;let r=t.slice(5),i=r==="full"?"100%":h(r);if(i===void 0)return!1;return e.width=i,e.height=i,!0}function je(t,e){let r=/^(-?)(top|right|bottom|left)-(.+)$/.exec(t);if(!r)return!1;let i=r[3]==="full"?"100%":h(r[3]);if(i===void 0)return!1;return e[r[2]]=typeof i==="number"&&r[1]?-i:i,!0}function Me(t,e){let r=/^space-(x|y)-(.+)$/.exec(t);if(!r)return!1;let i=h(r[2]);if(i===void 0)return!1;return e.gap=i,!0}function He(t,e){if(t.startsWith("gap-")){let r=h(t.slice(4));if(r!==void 0)return e.gap=r,!0}if(t.startsWith("gap-x-")){let r=h(t.slice(6));if(r!==void 0)return e.columnGap=r,!0}if(t.startsWith("gap-y-")){let r=h(t.slice(6));if(r!==void 0)return e.rowGap=r,!0}return!1}function A(t){let e=[],r=[],i=[];function s(d,g){let c=/^(text|bg|border|ring)-([a-z-]+)(\/[^\s]+)?$/.exec(d),f=c&&Nn[c[2]];return f?`${c[1]}-${f[g]}${c[3]||""}`:d}for(let d of t.split(/\s+/).filter(Boolean))if(d.startsWith("dark:"))r.push(s(d.slice(5),"dark"));else if(!d.includes(":")||d.startsWith("[")){if(e.push(s(d,"light")),s(d,"dark")!==d)i.push(s(d,"dark"))}let a=[],u={style:K(e.join(" "),a),unknown:a};if(r.length||i.length)u.dark=K([...i,...r].join(" "),a);for(let d of e){if(d==="truncate")u.numberOfLines=1;let g=/^line-clamp-(\d+)$/.exec(d);if(g)u.numberOfLines=Number(g[1]);if(!u.icon&&/^i-[a-z0-9]+-[a-z0-9-]+$/.test(d))u.icon=d}return u.unknown=a.filter((d)=>!/^line-clamp-\d+$/.test(d)),u}function K(t,e){let r={},i=t.split(/\s+/).filter(Boolean);for(let s of i){if(/^i-[a-z0-9]+-/.test(s))continue;let a=Ee[s];if(a){a("",r);continue}if(Ne(s,r))continue;if(We(s,r))continue;if(Be(s,r))continue;if(Ie(s,r))continue;if(Le(s,r))continue;if(De(s,r))continue;if(Xe(s,r))continue;if(Oe(s,r))continue;if($e(s,r))continue;if(ze(s,r))continue;if(He(s,r))continue;if(Ae(s,r))continue;if(Fe(s,r))continue;if(Ve(s,r))continue;if(je(s,r))continue;if(Me(s,r))continue;if(e?.push(s),typeof process<"u"&&process.env?.NODE_ENV==="development")console.warn(`[STX Native] Unknown Headwind class: ${s}`)}return r}function W(t,e={},r={},i={},s=[]){return{type:t,props:e,style:r,events:i,children:s}}function Q(t,e,r={}){return{version:"1.0.0",root:t,script:e,meta:{source:r.source||"unknown",compiledAt:r.compiledAt||Date.now(),headwindConfig:r.headwindConfig}}}var ee=new Set(["script","style","head","meta","link","title","base","noscript","svg"]),te=new Set(["template","body","html","main","fragment"]),B=new Set(["svg"]),Ge={click:"onPress",press:"onPress","press-in":"onPressIn",pressin:"onPressIn","press-out":"onPressOut",pressout:"onPressOut",longpress:"onLongPress",contextmenu:"onLongPress",input:"onChangeText",change:"onValueChange","value-change":"onValueChange",valuechange:"onValueChange",focus:"onFocus",focusin:"onFocus",blur:"onBlur",focusout:"onBlur",submit:"onSubmitEditing","submit-editing":"onSubmitEditing",submitediting:"onSubmitEditing","end-editing":"onEndEditing",endediting:"onEndEditing",scroll:"onScroll",refresh:"onRefresh",layout:"onLayout","end-reached":"onEndReached",endreached:"onEndReached",close:"onRequestClose","request-close":"onRequestClose",requestclose:"onRequestClose",show:"onShow",dismiss:"onDismiss","sliding-complete":"onSlidingComplete",slidingcomplete:"onSlidingComplete","load-start":"onLoadStart",loadstart:"onLoadStart",load:"onLoad","load-end":"onLoadEnd",loadend:"onLoadEnd",error:"onError"},qe=new Set(["onBlur","onChangeText","onDismiss","onEndEditing","onEndReached","onError","onFocus","onLayout","onLoad","onLoadEnd","onLoadStart","onLongPress","onPress","onPressIn","onPressOut","onRequestClose","onRefresh","onScroll","onShow","onSlidingComplete","onSubmitEditing","onValueChange"]),V=new Set(["display","gridColumns","gridTemplateColumns","gridAutoRows","flex","flexGrow","flexShrink","flexBasis","flexDirection","flexWrap","justifyContent","alignItems","alignSelf","alignContent","position","top","right","bottom","left","zIndex","width","height","minWidth","maxWidth","minHeight","maxHeight","aspectRatio","margin","marginTop","marginRight","marginBottom","marginLeft","marginHorizontal","marginVertical","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingHorizontal","paddingVertical","gap","rowGap","columnGap","borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","borderStyle","backgroundColor","backgroundImage","opacity","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","color","fontSize","fontWeight","fontStyle","fontFamily","lineHeight","letterSpacing","textAlign","textDecorationLine","textDecorationColor","textTransform","resizeMode","tintColor","transform","overflow"]),Ue=new Set(["gridColumns","gridAutoRows","flex","flexGrow","flexShrink","zIndex","aspectRatio","gap","rowGap","columnGap","borderWidth","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderRadius","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","opacity","shadowOpacity","shadowRadius","elevation","fontSize","lineHeight","letterSpacing"]),Je=new Set(["top","right","bottom","left","width","height","minWidth","maxWidth","minHeight","maxHeight","flexBasis","margin","marginTop","marginRight","marginBottom","marginLeft","marginHorizontal","marginVertical","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingHorizontal","paddingVertical"]),re=new Set(["View","ScrollView","SafeAreaView","KeyboardAvoidingView","Text","TextInput","Button","TouchableOpacity","TouchableHighlight","Pressable","Icon","Image","ImageBackground","FlatList","SectionList","Switch","Slider","Picker","DatePicker","Modal","ActivityIndicator","StatusBar","RefreshControl"]),ne=new Set(["View","SafeAreaView","ScrollView","KeyboardAvoidingView"]),Ye={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" ","#39":"'","#x27":"'"};function _(t){return t.replace(/&(#x?[0-9a-f]+|\w+);/gi,(e,r)=>{let i=Ye[r.toLowerCase()];if(i!==void 0)return i;if(r[0]==="#"){let s=r[1]==="x"||r[1]==="X"?Number.parseInt(r.slice(2),16):Number.parseInt(r.slice(1),10);return Number.isFinite(s)?String.fromCodePoint(s):e}return e})}function ie(t){return t.replace(/-([a-z])/g,(e,r)=>r.toUpperCase())}function oe(t){let e=/^(-?[\d.]+)px$/.exec(t);if(e)return Number.parseFloat(e[1]);let r=/^(-?[\d.]+)r?em$/.exec(t);if(r)return Number.parseFloat(r[1])*16;if(/^-?[\d.]+$/.test(t))return Number.parseFloat(t);return t}function Ke(t,e,r){let i={},s={},a={},l="",u={};for(let[g,c]of e){let f=g.toLowerCase();if(f==="class"||f==="classname"){l=l?`${l} ${c}`:c;continue}if(f==="style"){u={...u,...Ze(t,c,r)};continue}if(f.startsWith(":")||f.startsWith("x-")&&f!=="x-cloak"){a[f.startsWith(":")?f.slice(1):f.slice(2)]=_(c);continue}if(f==="x-cloak")continue;if(f.startsWith("@")||f.startsWith("v-on:")){let b=f.startsWith("@")?f.slice(1):f.slice(5),[m]=b.split("."),x=Ge[m]??(m.startsWith("on")?m:"");if(!x||!qe.has(x)){r.push({kind:"unread-event",tag:t,name:g});continue}s[x]=_(c);continue}if(f==="key"){i.key=c;continue}let p=_(c);try{i[O(g)]=JSON.parse(p)}catch{i[O(g)]=p}}let d={...l?A(l).style:{},...u};return{props:i,style:d,events:s,bindings:a,classes:l,inline:u}}function se(t,e){if(Ue.has(t))return!1;if(Je.has(t))return/^-?[\d.]+%$/.test(e);return!0}function Ze(t,e,r){let i={},s=_(e);try{let a=JSON.parse(s);if(a&&typeof a==="object"&&!Array.isArray(a)){for(let[l,u]of Object.entries(a)){let d=V.has(l)?l:ie(l.trim().toLowerCase());if(!V.has(d)){r.push({kind:"unknown-style",tag:t,name:d});continue}if(u===null||u===void 0)continue;let g=typeof u==="string"?oe(u):u;if(typeof g!=="string"&&typeof g!=="number")continue;if(typeof g==="string"&&!se(d,g)){r.push({kind:"non-numeric-style",tag:t,name:d});continue}i[d]=g}return i}}catch{}for(let a of s.split(";")){let l=a.indexOf(":");if(l===-1)continue;let u=ie(a.slice(0,l).trim().toLowerCase()),d=a.slice(l+1).trim();if(!u||!d)continue;if(!V.has(u)){r.push({kind:"unknown-style",tag:t,name:u});continue}let g=oe(d);if(typeof g==="string"&&!se(u,g)){r.push({kind:"non-numeric-style",tag:t,name:u});continue}i[u]=g}return i}function ae(t){return t.children.map((e)=>typeof e==="string"?e:ae(e)).join("").replace(/\s+/g," ").trim()}function Qe(t,e){let r=t.node,i=r.children.filter((a)=>typeof a!=="string"),s=r.children.filter((a)=>typeof a==="string").join("").trim();if(ne.has(r.type)&&i.length===0&&s)return r.type="Text",r.children=[s],r;if(r.type==="Text"&&i.length>0){let a=ae(r);return e.push({kind:"flattened-text",tag:t.tag}),r.children=a?[a]:[],r}if(ne.has(r.type)&&i.length>0)r.children=i;return r}async function et(t,e={}){let r=[],i=[],s=[],a=new Set;function l(c){let f=s[s.length-1];if(!f)i.push(c);else if(!f.dropped)f.node.children.push(c)}function u(c){if(c.node.bindings&&Object.keys(c.node.bindings).length>0){let p=c.node.children,b=p.filter((x)=>typeof x!=="string"),m=b.length===1&&b.length===p.length?b[0]:W("View",{},{},{},p);if(m.bindings={...c.node.bindings,...m.bindings},m.bindingId===void 0&&c.node.bindingId!==void 0)m.bindingId=c.node.bindingId;l(m);return}let f=s[s.length-1];for(let p of c.node.children){if(typeof p==="string"){if(f&&!f.dropped)f.node.children.push(p);continue}if(!f)i.push(p);else if(!f.dropped)f.node.children.push(p)}}function d(c,f){let p=ee.has(c)&&!B.has(c),b=s[s.length-1]?.dropped??!1,{props:m,style:x,events:S,bindings:w,classes:v,inline:me}=p||b?{props:{},style:{},events:{},bindings:{},classes:"",inline:{}}:Ke(c,f,r),L=m["data-native"],R;if(typeof L==="string"&&re.has(L))R=L,delete m["data-native"];else R=B.has(c)?"View":U(c);if(R===c&&!re.has(R)&&!ee.has(c)&&!te.has(c)&&!a.has(c))a.add(c),r.push({kind:"unmapped-tag",tag:c});if((p||B.has(c))&&!a.has(`drop:${c}`))a.add(`drop:${c}`),r.push({kind:"dropped-subtree",tag:c});if(R==="Icon"){let he=A(v).icon;m.symbol=J(String(m.symbol||m.name||he||""),Boolean(m.symbol)).symbol}let C=W(R,m,x,S);C._inlineStyle=me;let D=m["data-stx-b"];if(typeof D==="number"&&Number.isInteger(D))C.bindingId=D;if(delete m["data-stx-b"],v)C._classes=v;if(Object.keys(w).length>0)C.bindings=w;if(typeof m.key==="string")C.key=m.key,delete m.key;return{tag:c,node:C,dropped:p||b||B.has(c),discard:p||b,unwrap:te.has(c)}}if(await new HTMLRewriter().on("*",{element(c){let f=c.tagName.toLowerCase(),p=d(f,[...c.attributes]),b=!0;try{c.onEndTag(()=>{if(s.pop(),p.discard)return;if(p.unwrap)u(p);else l(Qe(p,r))})}catch{b=!1}if(b)s.push(p);else if(!p.discard)l(p.node)},text(c){let f=s[s.length-1];if(!f||f.dropped)return;let p=_(c.text).replace(/\s+/g," ");if(!p.trim())return;f.node.children.push(p)}}).transform(new Response(t)).text(),i.length===0)throw Error(`No element to translate in the rendered output of ${e.source??"unknown"}`);return{root:i.length===1?i[0]:W("View",{},{},{},i),diagnostics:r}}async function ce(t,e={}){let{root:r,diagnostics:i}=await et(t,e),s=e.script??{exports:{},functions:[],code:""};return{document:Q(r,s,{source:e.source??"unknown"}),diagnostics:i}}var le=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,tt=/(?:^|\n)\s*(?:export\s+)?(?:async\s+)?function\s*\*?\s*([$\w]+)\s*\(/g,rt=/(?:^|\n)\s*(?:export\s+)?(?:const|let|var)\s+([$\w]+)\s*=\s*(?:async\s*)?(?:\([^)]*\)|[$\w]+)\s*=>/g,ue=/(?:^|\n)\s*(?:export\s+)?const\s+([$\w]+)\s*=\s*(-?[\d.]+|true|false|'[^']*'|"[^"]*")\s*(?=;|\n|$)/g;function P(t){let e=[];le.lastIndex=0;for(let a of t.matchAll(le)){let l=a[1]??"";if(/\bserver\b/.test(l))continue;e.push(a[2].trim())}let r=e.filter(Boolean).join(`
3
3
 
4
4
  `),i=[];for(let a of[tt,rt]){a.lastIndex=0;for(let l of r.matchAll(a))if(!i.includes(l[1]))i.push(l[1])}let s={};ue.lastIndex=0;for(let a of r.matchAll(ue)){let l=a[2];try{s[a[1]]=JSON.parse(l.replace(/^'(.*)'$/,'"$1"'))}catch{s[a[1]]=l}}return{exports:s,functions:i,code:r}}var de=/<script\b[^>]*\bdata-stx-scoped\b[^>]*>([\s\S]*?)<\/script>/gi,nt=/function\s+(__stx_setup_[\w$]+)\s*\(/;function F(t){de.lastIndex=0;for(let e of t.matchAll(de)){let r=e[1].trim(),i=nt.exec(r)?.[1];if(i)return{name:i,code:r}}return null}function ot(){let t=[E.join(import.meta.dir,"..","primitives"),E.join(import.meta.dir,"native","primitives")];for(let e of t)if(it(E.join(e,"View.stx")))return e;return t[0]}async function st(t,e,r={}){let i=r.root??E.dirname(e),s=await o(i),a={root:i,componentsDir:r.componentsDir??E.join(i,"components"),buildMode:"serve",cache:!1,_pluginComponentDirs:[ot(),...s._pluginComponentDirs??[]]},l={...r.context??{},__stx_inject_css:!1},u=await n(t,l,e,a,new Set),{html:d,manifest:g}=G(u),{document:c,diagnostics:f}=await ce(d,{source:e,script:P(t)}),p=F(d);if(P(t).code.trim()){let b=await Fn(t,e,r.context,{forceClientSetup:!0});p=F(b.setupCode??"")??p}return{document:c,manifest:g,setup:p,diagnostics:f,html:d}}async function I(t,e={}){return st(await Bun.file(t).text(),t,e)}function fe(t){let r=[k.join(import.meta.dir,"..","runtime",`${t}.ts`),k.join(import.meta.dir,"..","runtime",`${t}.js`),k.join(import.meta.dir,"native","runtime",`${t}.js`)].find((i)=>at(i));if(!r)throw Error(`Native runtime module ${t} is missing`);return r}async function lt(t,e,r){let i=await Bun.build({entrypoints:[t],target:"browser",format:"iife",minify:r,plugins:e,define:{"process.env.NODE_ENV":JSON.stringify(r?"production":"development")}});if(!i.success){let s=i.logs.map((a)=>String(a.message??a)).join(`
5
5
  `);throw Error(`Could not bundle ${t}:
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- var g=0;function p(){return`async-${++g}-${Date.now().toString(36)}`}function Dl(e,t={},c){let o=/@async\s*\(([^)]*)\)\s*([\s\S]*?)@error\s*([\s\S]*?)@endasync/gi,i=/@async\s*\(([^)]*)\)\s*([\s\S]*?)@endasync/gi,n=e;return n=n.replace(o,(r,s,a,d)=>{let l=p(),y=u(s);return m(l,y,a.trim(),d.trim())}),n=n.replace(i,(r,s,a)=>{let d=p(),l=u(s);return m(d,l,a.trim(),'<div class="stx-async-error">Failed to load component</div>')}),n}function u(e){let t={component:"",timeout:30000,delay:200,suspensible:!0,retries:0},c=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\d+)|(\w+))/g,o;while((o=c.exec(e))!==null){let i=o[1],n=o[2]||o[3],r=o[4],s=o[5];switch(i){case"component":t.component=n||s||"";break;case"timeout":t.timeout=r?parseInt(r,10):30000;break;case"delay":t.delay=r?parseInt(r,10):200;break;case"suspensible":t.suspensible=s==="true";break;case"retries":t.retries=r?parseInt(r,10):0;break;case"loadingComponent":t.loadingComponent=n||s;break;case"errorComponent":t.errorComponent=n||s;break}}return t}function m(e,t,c,o){let{component:i,timeout:n,delay:r,suspensible:s,retries:a}=t;return`
2
+ var g=0;function p(){return`async-${++g}-${Date.now().toString(36)}`}function Ol(e,t={},c){let o=/@async\s*\(([^)]*)\)\s*([\s\S]*?)@error\s*([\s\S]*?)@endasync/gi,i=/@async\s*\(([^)]*)\)\s*([\s\S]*?)@endasync/gi,n=e;return n=n.replace(o,(r,s,a,d)=>{let l=p(),y=u(s);return m(l,y,a.trim(),d.trim())}),n=n.replace(i,(r,s,a)=>{let d=p(),l=u(s);return m(d,l,a.trim(),'<div class="stx-async-error">Failed to load component</div>')}),n}function u(e){let t={component:"",timeout:30000,delay:200,suspensible:!0,retries:0},c=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\d+)|(\w+))/g,o;while((o=c.exec(e))!==null){let i=o[1],n=o[2]||o[3],r=o[4],s=o[5];switch(i){case"component":t.component=n||s||"";break;case"timeout":t.timeout=r?parseInt(r,10):30000;break;case"delay":t.delay=r?parseInt(r,10):200;break;case"suspensible":t.suspensible=s==="true";break;case"retries":t.retries=r?parseInt(r,10):0;break;case"loadingComponent":t.loadingComponent=n||s;break;case"errorComponent":t.errorComponent=n||s;break}}return t}function m(e,t,c,o){let{component:i,timeout:n,delay:r,suspensible:s,retries:a}=t;return`
3
3
  <div class="stx-async-component" data-async-id="${e}" data-component="${i}" data-status="pending">
4
4
  <div class="stx-async-loading" data-async-loading="${e}">
5
5
  ${c}
@@ -226,7 +226,7 @@ catch (error) {
226
226
  loadComponent();
227
227
  })();
228
228
  </script>
229
- `}function Ol(e){return{__asyncComponent:!0,...typeof e==="function"?{loader:e}:e}}function Ml(e){return typeof e==="object"&&e!==null&&"__asyncComponent"in e&&e.__asyncComponent===!0}function Nl(){return`
229
+ `}function Ml(e){return{__asyncComponent:!0,...typeof e==="function"?{loader:e}:e}}function Nl(e){return typeof e==="object"&&e!==null&&"__asyncComponent"in e&&e.__asyncComponent===!0}function Ll(){return`
230
230
  /* STX Async Component Styles */
231
231
  .stx-async-component {
232
232
  position: relative;
@@ -300,7 +300,7 @@ catch (error) {
300
300
  background-size: 200% 100%;
301
301
  }
302
302
  }
303
- `}function Ll(){return`
303
+ `}function jl(){return`
304
304
  // STX Async Component Runtime
305
305
  (function() {
306
306
  if (typeof window === 'undefined') return;
@@ -355,4 +355,4 @@ catch (error) {
355
355
  console.log('[stx] Async component runtime initialized');
356
356
  })();
357
357
  `}
358
- export{Dl,Ol,Ml,Nl,Ll};
358
+ export{Ol,Ml,Nl,Ll,jl};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import"./chunk-ynvce0q6.js";import"./chunk-8xz8t9xp.js";import"./chunk-5bqs0ve6.js";import{a}from"./chunk-7tt84v1y.js";import f from"fs";import l from"path";async function d(e,t={}){let s=Date.now(),n={total:0,passed:0,failed:0,new:0,failures:[],duration:0},o=t.snapshotDir||a(e.root,"story","snapshots");await f.promises.mkdir(o,{recursive:!0});let r=e.storyFiles;if(t.filter&&t.filter.length>0)r=r.filter((i)=>t.filter.some((p)=>i.fileName.toLowerCase().includes(p.toLowerCase())));for(let i of r)await h(i,o,t,n);return n.duration=Date.now()-s,n}async function h(e,t,s,n){let o=e.story;if(!o)return;for(let r of o.variants){n.total++;let i=l.join(t,`${e.id}-${r.id}.snap`),p=g(r.source||""),c=await w(i);if(s.update||!c){let u={storyId:e.id,variantId:r.id,component:e.fileName,timestamp:Date.now(),hash:p};if(await f.promises.writeFile(i,JSON.stringify(u,null,2)),!c)n.new++;n.passed++}else try{let u=await f.promises.readFile(i,"utf-8"),m=JSON.parse(u);if(m.hash===p)n.passed++;else n.failed++,n.failures.push({storyId:e.id,variantId:r.id,component:e.fileName,message:"Snapshot mismatch",difference:y(m.hash,p)})}catch(u){n.failed++,n.failures.push({storyId:e.id,variantId:r.id,component:e.fileName,message:`Error reading snapshot: ${u}`})}}}async function x(e,t={}){return(await d(e,{...t,update:!0})).total}function g(e){let t=0;for(let s=0;s<e.length;s++){let n=e.charCodeAt(s);t=(t<<5)-t+n,t=t&t}return t.toString(16)}function y(e,t){if(e===t)return 0;let s=Math.abs(Number.parseInt(e,16)-Number.parseInt(t,16));return Math.min(s/1e6,1)}async function w(e){try{return await f.promises.access(e),!0}catch{return!1}}function F(e){let t=[];if(t.push(""),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(" STX Story Visual Regression Tests"),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(""),e.failures.length>0){t.push(" \u274C Failures:"),t.push("");for(let s of e.failures){if(t.push(` \u2022 ${s.component} / ${s.variantId}`),t.push(` ${s.message}`),s.difference!==void 0)t.push(` Difference: ${(s.difference*100).toFixed(2)}%`);t.push("")}}if(t.push(" Summary:"),t.push(` Total: ${e.total}`),t.push(` Passed: ${e.passed} \u2713`),t.push(` Failed: ${e.failed} \u2717`),e.new>0)t.push(` New: ${e.new} \u26A1`);return t.push(` Time: ${e.duration}ms`),t.push(""),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(""),t.join(`
2
+ import"./chunk-ynvce0q6.js";import"./chunk-2n5pjbw9.js";import"./chunk-d2zw2e5m.js";import{a}from"./chunk-7tt84v1y.js";import f from"fs";import l from"path";async function d(e,t={}){let s=Date.now(),n={total:0,passed:0,failed:0,new:0,failures:[],duration:0},o=t.snapshotDir||a(e.root,"story","snapshots");await f.promises.mkdir(o,{recursive:!0});let r=e.storyFiles;if(t.filter&&t.filter.length>0)r=r.filter((i)=>t.filter.some((p)=>i.fileName.toLowerCase().includes(p.toLowerCase())));for(let i of r)await h(i,o,t,n);return n.duration=Date.now()-s,n}async function h(e,t,s,n){let o=e.story;if(!o)return;for(let r of o.variants){n.total++;let i=l.join(t,`${e.id}-${r.id}.snap`),p=g(r.source||""),c=await w(i);if(s.update||!c){let u={storyId:e.id,variantId:r.id,component:e.fileName,timestamp:Date.now(),hash:p};if(await f.promises.writeFile(i,JSON.stringify(u,null,2)),!c)n.new++;n.passed++}else try{let u=await f.promises.readFile(i,"utf-8"),m=JSON.parse(u);if(m.hash===p)n.passed++;else n.failed++,n.failures.push({storyId:e.id,variantId:r.id,component:e.fileName,message:"Snapshot mismatch",difference:y(m.hash,p)})}catch(u){n.failed++,n.failures.push({storyId:e.id,variantId:r.id,component:e.fileName,message:`Error reading snapshot: ${u}`})}}}async function x(e,t={}){return(await d(e,{...t,update:!0})).total}function g(e){let t=0;for(let s=0;s<e.length;s++){let n=e.charCodeAt(s);t=(t<<5)-t+n,t=t&t}return t.toString(16)}function y(e,t){if(e===t)return 0;let s=Math.abs(Number.parseInt(e,16)-Number.parseInt(t,16));return Math.min(s/1e6,1)}async function w(e){try{return await f.promises.access(e),!0}catch{return!1}}function F(e){let t=[];if(t.push(""),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(" STX Story Visual Regression Tests"),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(""),e.failures.length>0){t.push(" \u274C Failures:"),t.push("");for(let s of e.failures){if(t.push(` \u2022 ${s.component} / ${s.variantId}`),t.push(` ${s.message}`),s.difference!==void 0)t.push(` Difference: ${(s.difference*100).toFixed(2)}%`);t.push("")}}if(t.push(" Summary:"),t.push(` Total: ${e.total}`),t.push(` Passed: ${e.passed} \u2713`),t.push(` Failed: ${e.failed} \u2717`),e.new>0)t.push(` New: ${e.new} \u26A1`);return t.push(` Time: ${e.duration}ms`),t.push(""),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(""),t.join(`
3
3
  `)}export{F as formatTestResults,d as runVisualTests,x as updateSnapshots};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{So,ko,Co,mu}from"./chunk-krsdcjxk.js";import"./chunk-mfxf378k.js";import"./chunk-dqdggvq4.js";import"./chunk-d2zw2e5m.js";import"./chunk-2n5pjbw9.js";import"./chunk-0trfbqa7.js";import"./chunk-ng61wjke.js";import"./chunk-zydg3wgt.js";import"./chunk-y36av1ac.js";import"./chunk-v83bpj84.js";import"./chunk-ynvce0q6.js";import"./chunk-pf0d8y9n.js";import"./chunk-2jbyks2t.js";import"./chunk-88px183j.js";import"./chunk-jz7pvh7b.js";export{So as buildNative,mu as default,Co as getAvailableFormats,ko as getAvailableTargets};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Rl,Al,Pl,Il,Dl}from"./chunk-fh1qrp68.js";export{Al as createSSRSuspense,Il as generateSuspenseCSS,Dl as generateSuspenseRuntime,Rl as processSuspenseDirectives,Pl as renderSSRSuspense};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{b,d,n,g,I}from"./chunk-b6e36vr2.js";import q from"path";var M={enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},T=/<!-- @section:([\w-]+) -->([\s\S]*?)<!-- @endsection:\1 -->/g;var O=/<!-- @suspense:([\w-]+) -->([\s\S]*?)<!-- @endsuspense:\1 -->/g;function z(e){let t=[],o=0,s;O.lastIndex=0;while((s=O.exec(e))!==null){if(s.index>o){let a=e.slice(o,s.index);if(a.trim())t.push({type:t.length===0?"shell":"content",content:a})}let r=s[1],i=s[2];t.push({type:"suspense",name:r,content:i}),o=s.index+s[0].length}if(o<e.length){let r=e.slice(o);if(r.trim())t.push({type:t.length===0?"shell":"content",content:r})}if(t.length===0)t.push({type:"shell",content:e});return t}async function Zl(e,t={},o={}){let s={...I,...o,streaming:{...M,...o.streaming}},r=s.streaming?.bufferSize||16384;return new ReadableStream({async start(i){try{let a=await Bun.file(e).text(),w=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),m=w?w[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),y={...t,__filename:e,__dirname:q.dirname(e)};if(m.trim())await d(m,y,e);let E=z(c),u=new Set;if(!E.some((h)=>h.type==="suspense")){let h=s.streaming?.strategy||"auto",S=new RegExp(T.source,"g");if(!(h!=="manual"&&S.test(c))){let p=await n(c,y,e,s,u);for(let x=0;x<p.length;x+=r)i.enqueue(p.slice(x,x+r)),await new Promise((f)=>setTimeout(f,0))}else{let p=[],x=new RegExp(T.source,"g"),f;while((f=x.exec(c))!==null)p.push({name:f[1],content:f[2],start:f.index,end:f.index+f[0].length});let v=0;for(let _ of p){if(_.start>v){let k=c.slice(v,_.start);if(k.trim()){let D=await n(k,y,e,s,u);i.enqueue(D),await new Promise((H)=>setTimeout(H,0))}}let C=await n(_.content,y,e,s,u);i.enqueue(C),await new Promise((k)=>setTimeout(k,0)),v=_.end}if(v<c.length){let _=c.slice(v);if(_.trim()){let C=await n(_,y,e,s,u);i.enqueue(C)}}}}else{let h=new Map;for(let l of E)if(l.type==="shell"||l.type==="content"){let p=await n(l.content,y,e,s,u);i.enqueue(p)}else if(l.type==="suspense"&&l.name){let p=`stx-suspense-${l.name}`;i.enqueue(`<div id="${p}" data-suspense="${l.name}" style="display:contents;">
2
+ import{b,d,n,g,I}from"./chunk-dqdggvq4.js";import q from"path";var M={enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},T=/<!-- @section:([\w-]+) -->([\s\S]*?)<!-- @endsection:\1 -->/g;var O=/<!-- @suspense:([\w-]+) -->([\s\S]*?)<!-- @endsuspense:\1 -->/g;function z(e){let t=[],o=0,s;O.lastIndex=0;while((s=O.exec(e))!==null){if(s.index>o){let a=e.slice(o,s.index);if(a.trim())t.push({type:t.length===0?"shell":"content",content:a})}let r=s[1],i=s[2];t.push({type:"suspense",name:r,content:i}),o=s.index+s[0].length}if(o<e.length){let r=e.slice(o);if(r.trim())t.push({type:t.length===0?"shell":"content",content:r})}if(t.length===0)t.push({type:"shell",content:e});return t}async function Ql(e,t={},o={}){let s={...I,...o,streaming:{...M,...o.streaming}},r=s.streaming?.bufferSize||16384;return new ReadableStream({async start(i){try{let a=await Bun.file(e).text(),w=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),m=w?w[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),y={...t,__filename:e,__dirname:q.dirname(e)};if(m.trim())await d(m,y,e);let E=z(c),u=new Set;if(!E.some((h)=>h.type==="suspense")){let h=s.streaming?.strategy||"auto",S=new RegExp(T.source,"g");if(!(h!=="manual"&&S.test(c))){let p=await n(c,y,e,s,u);for(let x=0;x<p.length;x+=r)i.enqueue(p.slice(x,x+r)),await new Promise((f)=>setTimeout(f,0))}else{let p=[],x=new RegExp(T.source,"g"),f;while((f=x.exec(c))!==null)p.push({name:f[1],content:f[2],start:f.index,end:f.index+f[0].length});let v=0;for(let _ of p){if(_.start>v){let k=c.slice(v,_.start);if(k.trim()){let D=await n(k,y,e,s,u);i.enqueue(D),await new Promise((H)=>setTimeout(H,0))}}let C=await n(_.content,y,e,s,u);i.enqueue(C),await new Promise((k)=>setTimeout(k,0)),v=_.end}if(v<c.length){let _=c.slice(v);if(_.trim()){let C=await n(_,y,e,s,u);i.enqueue(C)}}}}else{let h=new Map;for(let l of E)if(l.type==="shell"||l.type==="content"){let p=await n(l.content,y,e,s,u);i.enqueue(p)}else if(l.type==="suspense"&&l.name){let p=`stx-suspense-${l.name}`;i.enqueue(`<div id="${p}" data-suspense="${l.name}" style="display:contents;">
3
3
  <template data-suspense-fallback>Loading...</template>
4
4
  </div>`),h.set(l.name,n(l.content,y,e,s,u))}i.enqueue(`
5
5
  <script>
@@ -43,12 +43,12 @@ window.__stxSuspense.resolve('${e}', '<div class="stx-error">Error loading conte
43
43
  }
44
44
  };
45
45
  })();
46
- </script>`;function A(e,t,o){if(!t||t<=0)return e;let s,r=new Promise((i,a)=>{s=setTimeout(()=>a(Error(`streaming boundary "${o}" timed out after ${t}ms`)),t)});return Promise.race([e,r]).finally(()=>clearTimeout(s))}function Ql(e,t=[],o={}){let s=o.timeoutMs??0;return new ReadableStream({async start(r){try{if(r.enqueue(e),t.length>0)r.enqueue(_a),await Promise.all(t.map(async(i)=>{let a=A(i.render(),s,i.id);r.enqueue(await yo(i.id,a))}));r.close()}catch(i){r.error(i)}}})}var B=/@stream\s*\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)@endstream/gi;function eu(e,t){return e.replace(B,(o,s,r)=>{let i=s.trim(),a=r.split(/@fallback/i),w=a[0].trim(),m=a.length>1?a.slice(1).join("@fallback").trim():"";if(!t.__streamTemplates)t.__streamTemplates={};return t.__streamTemplates[i]=w,`<div data-suspense="${i}">${m}</div>`})}function tu(e){let t=e?.streamBoundaries;if(!t||typeof t!=="object")return;let o=Object.entries(t).filter(([,s])=>typeof s==="function");return o.length>0?o.map(([s,r])=>({id:s,render:r})):void 0}async function nu(e,t={},o={}){let s={...I,...o,streaming:{...M,...o.streaming}},r=s.streaming?.bufferSize||16384;return new ReadableStream({async start(i){try{let a=await Bun.file(e).text(),w=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),m=w?w[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),y={...t,__filename:e,__dirname:q.dirname(e)};if(m.trim())await d(m,y,e);let E=new Set,u=s.streaming?.strategy||"auto",R=new RegExp(T.source,"g");if(!(u!=="manual"&&R.test(c))){let S=await n(c,y,e,s,E);for(let l=0;l<S.length;l+=r)i.enqueue(S.slice(l,l+r))}else{let S=[],l=new RegExp(T.source,"g"),p;while((p=l.exec(c))!==null)S.push({name:p[1],content:p[2],start:p.index,end:p.index+p[0].length});let x=0;for(let f of S){if(f.start>x){let _=c.slice(x,f.start);if(_.trim()){let C=await n(_,y,e,s,E);i.enqueue(C)}}let v=await n(f.content,y,e,s,E);i.enqueue(v),x=f.end}if(x<c.length){let f=c.slice(x);if(f.trim()){let v=await n(f,y,e,s,E);i.enqueue(v)}}}i.close()}catch(a){i.error(a)}}})}async function ru(e,t={}){let o={...I,...t,streaming:{...M,...t.streaming}},s=await Bun.file(e).text(),r=s.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),i=r?r[1]:"",a=s.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),w=a,m={},c;T.lastIndex=0;while((c=T.exec(a))!==null){let u=c[1],R=c[2];m[u]=R}let y=a.replace(T,"");return{renderShell:async(u={})=>{let R={...u,__filename:e,__dirname:q.dirname(e)};return await d(i,R,e),n(y,R,e,o,new Set)},renderSection:async(u,R={})=>{try{if(!m[u])return`<div class="error-message">Section "${b(u)}" not found in template "${b(e)}"</div>`;let h={...R,__filename:e,__dirname:q.dirname(e)};await d(i,h,e);let S=new Set;return await n(m[u],h,e,o,S)}catch(h){let S=h instanceof Error?h.message:String(h);return g("Expression",S,e,m[u]||"",0,m[u]||"")}},getSections:()=>Object.keys(m),getTemplate:()=>w}}var Ta={name:"suspense",hasEndTag:!0,handler:(e,t,o,s)=>{if(!t||t.length===0)throw Error("Suspense directive requires a name parameter");let r=t[0].replace(/['"`]/g,"");return`<!-- @suspense:${r} -->${e}<!-- @endsuspense:${r} -->`}},Ra={name:"island",hasEndTag:!0,handler:(e,t,o,s)=>{if(!t||t.length===0)throw Error("Island directive requires a name parameter");let r=t[0].replace(/['"`]/g,""),i=t[1]?t[1].replace(/['"`]/g,""):"lazy",a=`island-${r}-${Math.random().toString(36).substring(2,9)}`,w=e.match(/<script\s+props\s*>([\s\S]*?)<\/script>/i),m=w?w[1].trim():"",c=w?e.replace(w[0],""):e;return`<div data-island="${r}" data-island-id="${a}" data-priority="${i}">
46
+ </script>`;function A(e,t,o){if(!t||t<=0)return e;let s,r=new Promise((i,a)=>{s=setTimeout(()=>a(Error(`streaming boundary "${o}" timed out after ${t}ms`)),t)});return Promise.race([e,r]).finally(()=>clearTimeout(s))}function eu(e,t=[],o={}){let s=o.timeoutMs??0;return new ReadableStream({async start(r){try{if(r.enqueue(e),t.length>0)r.enqueue(_a),await Promise.all(t.map(async(i)=>{let a=A(i.render(),s,i.id);r.enqueue(await yo(i.id,a))}));r.close()}catch(i){r.error(i)}}})}var B=/@stream\s*\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)@endstream/gi;function tu(e,t){return e.replace(B,(o,s,r)=>{let i=s.trim(),a=r.split(/@fallback/i),w=a[0].trim(),m=a.length>1?a.slice(1).join("@fallback").trim():"";if(!t.__streamTemplates)t.__streamTemplates={};return t.__streamTemplates[i]=w,`<div data-suspense="${i}">${m}</div>`})}function nu(e){let t=e?.streamBoundaries;if(!t||typeof t!=="object")return;let o=Object.entries(t).filter(([,s])=>typeof s==="function");return o.length>0?o.map(([s,r])=>({id:s,render:r})):void 0}async function ru(e,t={},o={}){let s={...I,...o,streaming:{...M,...o.streaming}},r=s.streaming?.bufferSize||16384;return new ReadableStream({async start(i){try{let a=await Bun.file(e).text(),w=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),m=w?w[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),y={...t,__filename:e,__dirname:q.dirname(e)};if(m.trim())await d(m,y,e);let E=new Set,u=s.streaming?.strategy||"auto",R=new RegExp(T.source,"g");if(!(u!=="manual"&&R.test(c))){let S=await n(c,y,e,s,E);for(let l=0;l<S.length;l+=r)i.enqueue(S.slice(l,l+r))}else{let S=[],l=new RegExp(T.source,"g"),p;while((p=l.exec(c))!==null)S.push({name:p[1],content:p[2],start:p.index,end:p.index+p[0].length});let x=0;for(let f of S){if(f.start>x){let _=c.slice(x,f.start);if(_.trim()){let C=await n(_,y,e,s,E);i.enqueue(C)}}let v=await n(f.content,y,e,s,E);i.enqueue(v),x=f.end}if(x<c.length){let f=c.slice(x);if(f.trim()){let v=await n(f,y,e,s,E);i.enqueue(v)}}}i.close()}catch(a){i.error(a)}}})}async function su(e,t={}){let o={...I,...t,streaming:{...M,...t.streaming}},s=await Bun.file(e).text(),r=s.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),i=r?r[1]:"",a=s.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),w=a,m={},c;T.lastIndex=0;while((c=T.exec(a))!==null){let u=c[1],R=c[2];m[u]=R}let y=a.replace(T,"");return{renderShell:async(u={})=>{let R={...u,__filename:e,__dirname:q.dirname(e)};return await d(i,R,e),n(y,R,e,o,new Set)},renderSection:async(u,R={})=>{try{if(!m[u])return`<div class="error-message">Section "${b(u)}" not found in template "${b(e)}"</div>`;let h={...R,__filename:e,__dirname:q.dirname(e)};await d(i,h,e);let S=new Set;return await n(m[u],h,e,o,S)}catch(h){let S=h instanceof Error?h.message:String(h);return g("Expression",S,e,m[u]||"",0,m[u]||"")}},getSections:()=>Object.keys(m),getTemplate:()=>w}}var Ta={name:"suspense",hasEndTag:!0,handler:(e,t,o,s)=>{if(!t||t.length===0)throw Error("Suspense directive requires a name parameter");let r=t[0].replace(/['"`]/g,"");return`<!-- @suspense:${r} -->${e}<!-- @endsuspense:${r} -->`}},Ra={name:"island",hasEndTag:!0,handler:(e,t,o,s)=>{if(!t||t.length===0)throw Error("Island directive requires a name parameter");let r=t[0].replace(/['"`]/g,""),i=t[1]?t[1].replace(/['"`]/g,""):"lazy",a=`island-${r}-${Math.random().toString(36).substring(2,9)}`,w=e.match(/<script\s+props\s*>([\s\S]*?)<\/script>/i),m=w?w[1].trim():"",c=w?e.replace(w[0],""):e;return`<div data-island="${r}" data-island-id="${a}" data-priority="${i}">
47
47
  ${c}
48
48
  <script type="application/json" data-island-props="${a}">
49
49
  ${m?`{${m}}`:"{}"}
50
50
  </script>
51
- </div>`}};function su(e={}){let t=[];if(e.streaming?.enabled)t.push(Ta);if(e.hydration?.enabled)t.push(Ra);return t}async function ou(e,t,o,s={}){return e}function iu(e,t={}){let o=new TextEncoder,s=e.pipeThrough(new TransformStream({transform(i,a){a.enqueue(o.encode(i))}})),r=new Headers(t.headers);if(!r.has("Content-Type"))r.set("Content-Type","text/html; charset=utf-8");if(!r.has("Transfer-Encoding"))r.set("Transfer-Encoding","chunked");if(!r.has("X-Content-Type-Options"))r.set("X-Content-Type-Options","nosniff");if(!r.has("X-Accel-Buffering"))r.set("X-Accel-Buffering","no");return new Response(s,{...t,headers:r})}function au(e={mode:"full"}){let{mode:t,components:o={},dynamicImports:s=!0}=e,r=Object.entries(o).map(([i,a])=>`'${i}': ${s?`() => import('${a}')`:`require('${a}')`}`).join(`,
51
+ </div>`}};function ou(e={}){let t=[];if(e.streaming?.enabled)t.push(Ta);if(e.hydration?.enabled)t.push(Ra);return t}async function iu(e,t,o,s={}){return e}function au(e,t={}){let o=new TextEncoder,s=e.pipeThrough(new TransformStream({transform(i,a){a.enqueue(o.encode(i))}})),r=new Headers(t.headers);if(!r.has("Content-Type"))r.set("Content-Type","text/html; charset=utf-8");if(!r.has("Transfer-Encoding"))r.set("Transfer-Encoding","chunked");if(!r.has("X-Content-Type-Options"))r.set("X-Content-Type-Options","nosniff");if(!r.has("X-Accel-Buffering"))r.set("X-Accel-Buffering","no");return new Response(s,{...t,headers:r})}function cu(e={mode:"full"}){let{mode:t,components:o={},dynamicImports:s=!0}=e,r=Object.entries(o).map(([i,a])=>`'${i}': ${s?`() => import('${a}')`:`require('${a}')`}`).join(`,
52
52
  `);if(t==="loader")return`
53
53
  (function() {
54
54
  window.__stx = window.__stx || {};
@@ -191,4 +191,4 @@ else {
191
191
  stx.hydrate();
192
192
  }
193
193
  })();`}
194
- export{Zl,yo,_a,Ql,eu,tu,nu,ru,Ta,Ra,su,ou,iu,au};
194
+ export{Ql,yo,_a,eu,tu,nu,ru,su,Ta,Ra,ou,iu,au,cu};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Br,$o,Eo,hu}from"./chunk-2tn3dkcy.js";export{Br as NATIVE_COMPONENTS,$o as compileToNative,Eo as createHotReloadServer,hu as default};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{bt,Hr,Vr,Ur,bu,Wr}from"./chunk-39q77svv.js";import"./chunk-0trfbqa7.js";import"./chunk-zydg3wgt.js";import"./chunk-88px183j.js";export{Vr as buildServerApi,bu as createServerApi,bt as discoverServerApi,Hr as generateApiTypes,Wr as isServerApiSource,Ur as productionApiDispatcher};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Dn,Va,vu,Ua,xu,Wa,On,b,vt,he,qa,Yr,Ka,Su,q,Xa,ku,x,Cu}from"./chunk-dqdggvq4.js";import"./chunk-d2zw2e5m.js";import"./chunk-2n5pjbw9.js";import"./chunk-0trfbqa7.js";import"./chunk-ng61wjke.js";import"./chunk-zydg3wgt.js";import"./chunk-y36av1ac.js";import"./chunk-v83bpj84.js";import"./chunk-ynvce0q6.js";import"./chunk-pf0d8y9n.js";import"./chunk-2jbyks2t.js";import"./chunk-88px183j.js";import"./chunk-jz7pvh7b.js";export{Xa as applyFilters,xu as clearCustomFilters,qa as clientLoopScopes,Dn as defaultFilters,b as escapeHtml,vt as escapeHtmlValue,x as evaluateExpression,Wa as findMustacheEnd,Ua as getAllFilters,Ka as interpolateScriptAttributes,Yr as interpolateScriptExpressions,Su as interpolateScriptsInTemplate,q as processExpressions,Va as registerFilter,vu as registerFilters,On as replaceInterpolations,ku as resetRejectedExpressionWarnings,Cu as unescapeHtml,he as usesSignalsInScript};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{d,ls,ri,si,yc,bc,wc,vc,xc,Sc,Ve,L,Ue,kc,Wn,Cc,ci,$c,We,r,qn,li,g,ee,Fu}from"./chunk-dqdggvq4.js";import"./chunk-d2zw2e5m.js";import"./chunk-2n5pjbw9.js";import"./chunk-0trfbqa7.js";import"./chunk-ng61wjke.js";import"./chunk-zydg3wgt.js";import"./chunk-y36av1ac.js";import"./chunk-v83bpj84.js";import"./chunk-ynvce0q6.js";import"./chunk-pf0d8y9n.js";import"./chunk-2jbyks2t.js";import"./chunk-88px183j.js";import"./chunk-jz7pvh7b.js";export{ee as clearComponentCache,$c as componentClientSignalNames,ls as convertToCommonJS,g as createDetailedErrorMessage,xc as extractDirectiveNames,ri as extractScriptFromTemplate,d as extractVariables,r as fileExists,Fu as getComponentCacheStats,bc as getPositionInfo,L as getSharedTranspiler,li as getSourceLineInfo,vc as hasDirectives,si as hasVariables,Cc as isHydrateTrigger,Sc as isJavaScriptScript,We as renderComponentWithSlot,qn as resolveTemplatePath,kc as scopeOnRootElement,Ve as shouldTranspileTypeScript,ci as slotContentHasExpressions,Ue as transpileTypeScript,Wn as userComponentFileExists,wc as validateDirective,yc as validateTemplate};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{K,hs,ys,bs,n}from"./chunk-dqdggvq4.js";import"./chunk-d2zw2e5m.js";import"./chunk-2n5pjbw9.js";import"./chunk-0trfbqa7.js";import"./chunk-ng61wjke.js";import"./chunk-zydg3wgt.js";import"./chunk-y36av1ac.js";import"./chunk-v83bpj84.js";import"./chunk-ynvce0q6.js";import"./chunk-pf0d8y9n.js";import"./chunk-2jbyks2t.js";import"./chunk-88px183j.js";import"./chunk-jz7pvh7b.js";export{K as injectRouterScript,n as processDirectives,hs as processJsonDirective,ys as processOnceDirective,bs as validateClientScript};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{p,l}from"./chunk-ynvce0q6.js";import{b}from"./chunk-b6e36vr2.js";function y(t,o){let i=1,r=o,e="<template",n="</template";while(r<t.length&&i>0){let s=t.indexOf("<",r);if(s===-1)break;if(r=s,t.startsWith(e,r)&&(r+e.length>=t.length||/[\s>\/]/.test(t[r+e.length]))){i++,r+=e.length;continue}if(t.startsWith(n,r)){let a=t.indexOf(">",r+n.length);if(a!==-1){if(i--,i===0)return a+1;r=a+1;continue}}r++}return i===0?r:-1}var w=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function x(t,o){let i=null;for(let r=o;r<t.length;r++){let e=t[r];if(i){if(e==="\\"){r++;continue}if(e===i)i=null;continue}if(e==='"'||e==="'"){i=e;continue}if(e===">")return r+1}return-1}function N(t,o,i){let r=o.toLowerCase(),e=1,n=i;while(n<t.length){let s=t.indexOf("<",n);if(s===-1)return-1;if(t.startsWith("<!--",s)){let g=t.indexOf("-->",s+4);n=g===-1?t.length:g+3;continue}let a=x(t,s+1);if(a===-1)return-1;let f=t.slice(s,a),u=f.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(u&&u[2].toLowerCase()===r){if(u[1]==="/"){if(e--,e===0)return a}else if(!/\/\s*>$/.test(f))e++}n=a}return-1}function A(t){let o=[],i=[],r=/\bslot\s*=\s*(?:"([^"]+)"|'([^']+)')/i,e=0;while(e<t.length){let n=t.indexOf("<",e);if(n===-1)break;if(t.startsWith("<!--",n)){let c=t.indexOf("-->",n+4);e=c===-1?t.length:c+3;continue}let s=x(t,n+1);if(s===-1)break;let a=t.slice(n,s),f=a.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!f){e=s;continue}let u=f[2].toLowerCase();if(f[1]==="/"){let c=i.lastIndexOf(u);if(c!==-1)i.splice(c);e=s;continue}let g=/\/\s*>$/.test(a),d=i.length===0?a.match(r):null;if(d){let c=d[1]||d[2],m=a.replace(r,"").replace(/\s+(?=\/?>$)/,"").replace(/\s{2,}/g," "),h=g||w.has(u)?-1:N(t,u,s);if(h===-1)o.push({start:n,end:s,slotName:c,element:m}),e=s;else o.push({start:n,end:h,slotName:c,element:m+t.slice(s,h)}),e=h;continue}if(!g&&!w.has(u)){if(i.push(u),u==="script"||u==="style"){let c=t.toLowerCase().indexOf(`</${u}>`,s);if(c!==-1){e=c;continue}}}e=s}return o}function O(t){let o=[],i=[],r=/^<template\s+(?:#([a-zA-Z][\w-]*)|v-slot:([a-zA-Z][\w-]*)|slot="([a-zA-Z][\w-]*)")(?:\s*=\s*"([^"]*)")?[^>]*>$/i,e=0;while(e<t.length){let n=t.indexOf("<",e);if(n===-1)break;if(t.startsWith("<!--",n)){let c=t.indexOf("-->",n+4);e=c===-1?t.length:c+3;continue}let s=x(t,n+1);if(s===-1)break;let a=t.slice(n,s),f=a.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!f){e=s;continue}let u=f[1]==="/",g=f[2].toLowerCase();if(u){let c=i.lastIndexOf(g);if(c!==-1)i.splice(c);e=s;continue}if(g==="template"&&i.length===0){let c=a.match(r);if(c){let m=y(t,s);if(m!==-1){let h=c[1]||c[2]||c[3];o.push({start:n,end:m,slotName:h,content:t.slice(s,m-11).trim(),propsBinding:c[4]||void 0}),e=m;continue}}}if(!/\/\s*>$/.test(a)&&!w.has(g)){if(i.push(g),g==="script"||g==="style"){let c=t.toLowerCase().indexOf(`</${g}>`,s);if(c!==-1){e=c;continue}}}e=s}return o}function Yi(t){let o={default:"",named:new Map},i=t,r=O(t);for(let n of r)o.named.set(n.slotName,{name:n.slotName,content:n.content,propsBinding:n.propsBinding});r.sort((n,s)=>s.start-n.start);for(let n of r)i=i.slice(0,n.start)+i.slice(n.end);let e=A(i);for(let n of e){let s=o.named.get(n.slotName);if(s)s.content+=n.element;else o.named.set(n.slotName,{name:n.slotName,content:n.element})}for(let n=e.length-1;n>=0;n--){let s=e[n];i=i.slice(0,s.start)+i.slice(s.end)}return o.default=i.trim(),o}function ul(t){let o=t.match(/name\s*=\s*["']([^"']+)["']/),i=o?o[1]:"",r={},e=/:([a-zA-Z][\w-]*)\s*=\s*["']([^"']+)["']/g,n;while((n=e.exec(t))!==null)r[n[1]]=n[2];let s=t.match(/<slot[^>]*>([\s\S]*?)<\/slot>/i),a=s?s[1].trim():"";return{name:i,props:r,defaultContent:a}}async function Zi(t,o,i,r){if(!t)return i;let e=t.content;if(t.propsBinding&&Object.keys(o).length>0){let n=t.propsBinding.trim(),s={...r};if(n.startsWith("{")&&n.endsWith("}")){let a=n.slice(1,-1).split(",").map((f)=>f.trim()).filter(Boolean);for(let f of a){let[u,g]=f.split(":").map((c)=>c.trim()),d=g||u;if(o[u]!==void 0)s[d]=o[u]}}else s[n]=o;e=C(e,s)}return e}function C(t,o){return t.replace(/\{\{\s*([^}]+)\s*\}\}/g,(i,r)=>{try{let e=r.trim(),n=k(e,o);return b(String(n??""))}catch{return`{{ ${r} }}`}})}function k(t,o){if(/^[a-zA-Z_$][\w$]*(\.[a-zA-Z_$][\w$]*)*$/.test(t)){let r=t.split("."),e=o;for(let n of r)if(e&&typeof e==="object"&&n in e)e=e[n];else return;return e}let i=t.match(/^([a-zA-Z_$][\w$]*)\s*([+\-*/])\s*(\d+)$/);if(i){let[,r,e,n]=i,s=o[r],a=parseInt(n,10);if(typeof s==="number")switch(e){case"+":return s+a;case"-":return s-a;case"*":return s*a;case"/":return s/a}}try{if(!p(t))return;return l(t,Object.keys(o))(...Object.values(o))}catch{return}}async function Qi(t,o,i){let r=t;r=await M(r,/<slot\s+name\s*=\s*["']([^"']+)["']([^>]*?)(?:\/>|>([\s\S]*?)<\/slot>)/gi,async(s,a,f,u)=>{let g=o.named.get(a),d=u?.trim()||"",c=f||"",m={},h=/:([a-zA-Z_$][\w$-]*)\s*=\s*["']([^"']+)["']/g,S;while((S=h.exec(c))!==null){let E=S[1],R=S[2];m[E]=k(R,i)}return await Zi(g,m,d,i)});let n=/<slot\b((?:"[^"]*"|'[^']*'|[^>"'])*?)\s*(?:\/>|>([\s\S]*?)<\/slot>)/gi;return r=r.replace(n,(s,a,f)=>{if(/\bname\s*=/.test(a||""))return s;let u=f?.trim()||"";return o.default||u}),r}async function M(t,o,i){let r=[],e=[];t.replace(o,(a,...f)=>{let u=f[f.length-2];return e.push({match:a,index:u}),r.push(i(a,...f.slice(0,-2))),a});let n=await Promise.all(r),s=t;for(let a=e.length-1;a>=0;a--){let{match:f,index:u}=e[a];s=s.slice(0,u)+n[a]+s.slice(u+f.length)}return s}function dl(t){let o=Yi(t);return{defaultSlot:o.default,namedSlots:o.named}}async function pl(t,o,i,r){return await Qi(t,{default:o,named:i},r)}
3
- export{Yi,ul,Zi,Qi,dl,pl};
2
+ import{p,l}from"./chunk-ynvce0q6.js";import{b}from"./chunk-dqdggvq4.js";function y(t,o){let i=1,r=o,e="<template",n="</template";while(r<t.length&&i>0){let s=t.indexOf("<",r);if(s===-1)break;if(r=s,t.startsWith(e,r)&&(r+e.length>=t.length||/[\s>\/]/.test(t[r+e.length]))){i++,r+=e.length;continue}if(t.startsWith(n,r)){let a=t.indexOf(">",r+n.length);if(a!==-1){if(i--,i===0)return a+1;r=a+1;continue}}r++}return i===0?r:-1}var w=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function x(t,o){let i=null;for(let r=o;r<t.length;r++){let e=t[r];if(i){if(e==="\\"){r++;continue}if(e===i)i=null;continue}if(e==='"'||e==="'"){i=e;continue}if(e===">")return r+1}return-1}function N(t,o,i){let r=o.toLowerCase(),e=1,n=i;while(n<t.length){let s=t.indexOf("<",n);if(s===-1)return-1;if(t.startsWith("<!--",s)){let g=t.indexOf("-->",s+4);n=g===-1?t.length:g+3;continue}let a=x(t,s+1);if(a===-1)return-1;let f=t.slice(s,a),u=f.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(u&&u[2].toLowerCase()===r){if(u[1]==="/"){if(e--,e===0)return a}else if(!/\/\s*>$/.test(f))e++}n=a}return-1}function A(t){let o=[],i=[],r=/\bslot\s*=\s*(?:"([^"]+)"|'([^']+)')/i,e=0;while(e<t.length){let n=t.indexOf("<",e);if(n===-1)break;if(t.startsWith("<!--",n)){let c=t.indexOf("-->",n+4);e=c===-1?t.length:c+3;continue}let s=x(t,n+1);if(s===-1)break;let a=t.slice(n,s),f=a.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!f){e=s;continue}let u=f[2].toLowerCase();if(f[1]==="/"){let c=i.lastIndexOf(u);if(c!==-1)i.splice(c);e=s;continue}let g=/\/\s*>$/.test(a),d=i.length===0?a.match(r):null;if(d){let c=d[1]||d[2],m=a.replace(r,"").replace(/\s+(?=\/?>$)/,"").replace(/\s{2,}/g," "),h=g||w.has(u)?-1:N(t,u,s);if(h===-1)o.push({start:n,end:s,slotName:c,element:m}),e=s;else o.push({start:n,end:h,slotName:c,element:m+t.slice(s,h)}),e=h;continue}if(!g&&!w.has(u)){if(i.push(u),u==="script"||u==="style"){let c=t.toLowerCase().indexOf(`</${u}>`,s);if(c!==-1){e=c;continue}}}e=s}return o}function O(t){let o=[],i=[],r=/^<template\s+(?:#([a-zA-Z][\w-]*)|v-slot:([a-zA-Z][\w-]*)|slot="([a-zA-Z][\w-]*)")(?:\s*=\s*"([^"]*)")?[^>]*>$/i,e=0;while(e<t.length){let n=t.indexOf("<",e);if(n===-1)break;if(t.startsWith("<!--",n)){let c=t.indexOf("-->",n+4);e=c===-1?t.length:c+3;continue}let s=x(t,n+1);if(s===-1)break;let a=t.slice(n,s),f=a.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!f){e=s;continue}let u=f[1]==="/",g=f[2].toLowerCase();if(u){let c=i.lastIndexOf(g);if(c!==-1)i.splice(c);e=s;continue}if(g==="template"&&i.length===0){let c=a.match(r);if(c){let m=y(t,s);if(m!==-1){let h=c[1]||c[2]||c[3];o.push({start:n,end:m,slotName:h,content:t.slice(s,m-11).trim(),propsBinding:c[4]||void 0}),e=m;continue}}}if(!/\/\s*>$/.test(a)&&!w.has(g)){if(i.push(g),g==="script"||g==="style"){let c=t.toLowerCase().indexOf(`</${g}>`,s);if(c!==-1){e=c;continue}}}e=s}return o}function Yi(t){let o={default:"",named:new Map},i=t,r=O(t);for(let n of r)o.named.set(n.slotName,{name:n.slotName,content:n.content,propsBinding:n.propsBinding});r.sort((n,s)=>s.start-n.start);for(let n of r)i=i.slice(0,n.start)+i.slice(n.end);let e=A(i);for(let n of e){let s=o.named.get(n.slotName);if(s)s.content+=n.element;else o.named.set(n.slotName,{name:n.slotName,content:n.element})}for(let n=e.length-1;n>=0;n--){let s=e[n];i=i.slice(0,s.start)+i.slice(s.end)}return o.default=i.trim(),o}function dl(t){let o=t.match(/name\s*=\s*["']([^"']+)["']/),i=o?o[1]:"",r={},e=/:([a-zA-Z][\w-]*)\s*=\s*["']([^"']+)["']/g,n;while((n=e.exec(t))!==null)r[n[1]]=n[2];let s=t.match(/<slot[^>]*>([\s\S]*?)<\/slot>/i),a=s?s[1].trim():"";return{name:i,props:r,defaultContent:a}}async function Zi(t,o,i,r){if(!t)return i;let e=t.content;if(t.propsBinding&&Object.keys(o).length>0){let n=t.propsBinding.trim(),s={...r};if(n.startsWith("{")&&n.endsWith("}")){let a=n.slice(1,-1).split(",").map((f)=>f.trim()).filter(Boolean);for(let f of a){let[u,g]=f.split(":").map((c)=>c.trim()),d=g||u;if(o[u]!==void 0)s[d]=o[u]}}else s[n]=o;e=C(e,s)}return e}function C(t,o){return t.replace(/\{\{\s*([^}]+)\s*\}\}/g,(i,r)=>{try{let e=r.trim(),n=k(e,o);return b(String(n??""))}catch{return`{{ ${r} }}`}})}function k(t,o){if(/^[a-zA-Z_$][\w$]*(\.[a-zA-Z_$][\w$]*)*$/.test(t)){let r=t.split("."),e=o;for(let n of r)if(e&&typeof e==="object"&&n in e)e=e[n];else return;return e}let i=t.match(/^([a-zA-Z_$][\w$]*)\s*([+\-*/])\s*(\d+)$/);if(i){let[,r,e,n]=i,s=o[r],a=parseInt(n,10);if(typeof s==="number")switch(e){case"+":return s+a;case"-":return s-a;case"*":return s*a;case"/":return s/a}}try{if(!p(t))return;return l(t,Object.keys(o))(...Object.values(o))}catch{return}}async function Qi(t,o,i){let r=t;r=await M(r,/<slot\s+name\s*=\s*["']([^"']+)["']([^>]*?)(?:\/>|>([\s\S]*?)<\/slot>)/gi,async(s,a,f,u)=>{let g=o.named.get(a),d=u?.trim()||"",c=f||"",m={},h=/:([a-zA-Z_$][\w$-]*)\s*=\s*["']([^"']+)["']/g,S;while((S=h.exec(c))!==null){let E=S[1],R=S[2];m[E]=k(R,i)}return await Zi(g,m,d,i)});let n=/<slot\b((?:"[^"]*"|'[^']*'|[^>"'])*?)\s*(?:\/>|>([\s\S]*?)<\/slot>)/gi;return r=r.replace(n,(s,a,f)=>{if(/\bname\s*=/.test(a||""))return s;let u=f?.trim()||"";return o.default||u}),r}async function M(t,o,i){let r=[],e=[];t.replace(o,(a,...f)=>{let u=f[f.length-2];return e.push({match:a,index:u}),r.push(i(a,...f.slice(0,-2))),a});let n=await Promise.all(r),s=t;for(let a=e.length-1;a>=0;a--){let{match:f,index:u}=e[a];s=s.slice(0,u)+n[a]+s.slice(u+f.length)}return s}function pl(t){let o=Yi(t);return{defaultSlot:o.default,namedSlots:o.named}}async function fl(t,o,i,r){return await Qi(t,{default:o,named:i},r)}
3
+ export{Yi,dl,Zi,Qi,pl,fl};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{cn,xs}from"./chunk-n3r5m938.js";import"./chunk-zydg3wgt.js";export{xs as generateRuntimeConfigTypes,cn as prepareRuntimeConfig};
2
+ import{cn,xs}from"./chunk-ng61wjke.js";import"./chunk-zydg3wgt.js";export{xs as generateRuntimeConfigTypes,cn as prepareRuntimeConfig};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- function m(e,t={}){return{enterFrom:t.enterClass||`${e}-enter-from`,enterActive:t.enterActiveClass||`${e}-enter-active`,enterTo:t.enterToClass||`${e}-enter-to`,leaveFrom:t.leaveClass||`${e}-leave-from`,leaveActive:t.leaveActiveClass||`${e}-leave-active`,leaveTo:t.leaveToClass||`${e}-leave-to`}}function u(e){let t=getComputedStyle(e),o=t.transitionDuration||"0s",n=t.animationDuration||"0s",s=(a)=>{let i=a.match(/^([\d.]+)(s|ms)?$/);if(!i)return 0;let r=parseFloat(i[1]);return(i[2]||"s")==="ms"?r:r*1000};return Math.max(s(o),s(n))}function v(e,t){return new Promise((o)=>{let n=t??u(e);if(n===0){o();return}let s=!1,a=()=>{if(s)return;s=!0,e.removeEventListener("transitionend",i),e.removeEventListener("animationend",i),o()},i=(r)=>{if(r.target===e)a()};e.addEventListener("transitionend",i),e.addEventListener("animationend",i),setTimeout(a,n+50)})}function f(e){e.offsetHeight}async function Sl(e,t={}){let o=t.name||"stx",n=m(o,t),s=typeof t.duration==="object"?t.duration.enter:t.duration;if(t.onBeforeEnter?.(e),e.classList.add(n.enterFrom),e.classList.add(n.enterActive),f(e),e.classList.remove(n.enterFrom),e.classList.add(n.enterTo),t.onEnter)await new Promise((a)=>{t.onEnter(e,a)});else await v(e,s);e.classList.remove(n.enterActive),e.classList.remove(n.enterTo),t.onAfterEnter?.(e)}async function kl(e,t={}){let o=t.name||"stx",n=m(o,t),s=typeof t.duration==="object"?t.duration.leave:t.duration;if(t.onBeforeLeave?.(e),e.classList.add(n.leaveFrom),e.classList.add(n.leaveActive),f(e),e.classList.remove(n.leaveFrom),e.classList.add(n.leaveTo),t.onLeave)await new Promise((a)=>{t.onLeave(e,a)});else await v(e,s);e.classList.remove(n.leaveActive),e.classList.remove(n.leaveTo),t.onAfterLeave?.(e)}function Cl(e,t={},o){let n=/@transition\s*\(([^)]*)\)([\s\S]*?)@endtransition/gi;return e.replace(n,(s,a,i)=>{let r=p(a),l=r.name||"stx",c=r.duration||300,d=`stx-transition-${Math.random().toString(36).slice(2,9)}`;return`
2
+ function m(e,t={}){return{enterFrom:t.enterClass||`${e}-enter-from`,enterActive:t.enterActiveClass||`${e}-enter-active`,enterTo:t.enterToClass||`${e}-enter-to`,leaveFrom:t.leaveClass||`${e}-leave-from`,leaveActive:t.leaveActiveClass||`${e}-leave-active`,leaveTo:t.leaveToClass||`${e}-leave-to`}}function u(e){let t=getComputedStyle(e),o=t.transitionDuration||"0s",n=t.animationDuration||"0s",s=(a)=>{let i=a.match(/^([\d.]+)(s|ms)?$/);if(!i)return 0;let r=parseFloat(i[1]);return(i[2]||"s")==="ms"?r:r*1000};return Math.max(s(o),s(n))}function v(e,t){return new Promise((o)=>{let n=t??u(e);if(n===0){o();return}let s=!1,a=()=>{if(s)return;s=!0,e.removeEventListener("transitionend",i),e.removeEventListener("animationend",i),o()},i=(r)=>{if(r.target===e)a()};e.addEventListener("transitionend",i),e.addEventListener("animationend",i),setTimeout(a,n+50)})}function f(e){e.offsetHeight}async function kl(e,t={}){let o=t.name||"stx",n=m(o,t),s=typeof t.duration==="object"?t.duration.enter:t.duration;if(t.onBeforeEnter?.(e),e.classList.add(n.enterFrom),e.classList.add(n.enterActive),f(e),e.classList.remove(n.enterFrom),e.classList.add(n.enterTo),t.onEnter)await new Promise((a)=>{t.onEnter(e,a)});else await v(e,s);e.classList.remove(n.enterActive),e.classList.remove(n.enterTo),t.onAfterEnter?.(e)}async function Cl(e,t={}){let o=t.name||"stx",n=m(o,t),s=typeof t.duration==="object"?t.duration.leave:t.duration;if(t.onBeforeLeave?.(e),e.classList.add(n.leaveFrom),e.classList.add(n.leaveActive),f(e),e.classList.remove(n.leaveFrom),e.classList.add(n.leaveTo),t.onLeave)await new Promise((a)=>{t.onLeave(e,a)});else await v(e,s);e.classList.remove(n.leaveActive),e.classList.remove(n.leaveTo),t.onAfterLeave?.(e)}function $l(e,t={},o){let n=/@transition\s*\(([^)]*)\)([\s\S]*?)@endtransition/gi;return e.replace(n,(s,a,i)=>{let r=p(a),l=r.name||"stx",c=r.duration||300,d=`stx-transition-${Math.random().toString(36).slice(2,9)}`;return`
3
3
  <div
4
4
  class="stx-transition-wrapper"
5
5
  data-transition="${l}"
@@ -41,7 +41,7 @@ function m(e,t={}){return{enterFrom:t.enterClass||`${e}-enter-from`,enterActive:
41
41
  });
42
42
  })();
43
43
  </script>
44
- `})}function p(e){let t={},o=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\d+)|(\w+))/g,n;while((n=o.exec(e))!==null){let s=n[1],a=n[2]||n[3]||n[4]||n[5];switch(s){case"name":t.name=a;break;case"duration":t.duration=parseInt(a,10);break;case"mode":t.mode=a;break;case"easing":t.easing=a;break}}return t}function $l(){return`
44
+ `})}function p(e){let t={},o=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\d+)|(\w+))/g,n;while((n=o.exec(e))!==null){let s=n[1],a=n[2]||n[3]||n[4]||n[5];switch(s){case"name":t.name=a;break;case"duration":t.duration=parseInt(a,10);break;case"mode":t.mode=a;break;case"easing":t.easing=a;break}}return t}function El(){return`
45
45
  /* STX Transition Presets */
46
46
 
47
47
  /* Fade */
@@ -228,7 +228,7 @@ function m(e,t={}){return{enterFrom:t.enterClass||`${e}-enter-from`,enterActive:
228
228
  opacity: 1;
229
229
  max-height: 1000px;
230
230
  }
231
- `}function El(){return`
231
+ `}function _l(){return`
232
232
  // STX Transition Runtime
233
233
  (function() {
234
234
  if (typeof window === 'undefined') return;
@@ -317,5 +317,5 @@ else {
317
317
 
318
318
  console.log('[stx] Transition runtime initialized');
319
319
  })();
320
- `}function _l(e){let t=/@transition\.([a-z-]+)(?:\.(\d+))?="([^"]+)"/gi;return e.replace(t,(o,n,s,a)=>{let i=s||"300",r=`stx-t-${Math.random().toString(36).slice(2,7)}`;return`data-stx-transition="${n}" data-stx-transition-duration="${i}" data-stx-transition-condition="${a}" data-stx-transition-id="${r}"`})}
321
- export{Sl,kl,Cl,$l,El,_l};
320
+ `}function Tl(e){let t=/@transition\.([a-z-]+)(?:\.(\d+))?="([^"]+)"/gi;return e.replace(t,(o,n,s,a)=>{let i=s||"300",r=`stx-t-${Math.random().toString(36).slice(2,7)}`;return`data-stx-transition="${n}" data-stx-transition-duration="${i}" data-stx-transition-condition="${a}" data-stx-transition-id="${r}"`})}
321
+ export{kl,Cl,$l,El,_l,Tl};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Ce,$e,Ee}from"./chunk-qxre7vw6.js";import"./chunk-2jbyks2t.js";import"./chunk-pf0d8y9n.js";import{d}from"./chunk-b6e36vr2.js";import"./chunk-ynvce0q6.js";import"./chunk-8xz8t9xp.js";import"./chunk-5w87wmc4.js";import"./chunk-8yrk8ybh.js";import"./chunk-ver2yf41.js";import"./chunk-0trfbqa7.js";import"./chunk-zydg3wgt.js";import"./chunk-n3r5m938.js";import"./chunk-jz7pvh7b.js";import{ot,dr,it,js,ke,Bs,pr,at,zs,ct}from"./chunk-1sdtg9np.js";import"./chunk-5bqs0ve6.js";import M from"fs";import x from"path";function E(t,e){let r=[x.join(t.root,"stx.config.ts"),x.join(t.root,"stx.config.js"),x.join(t.root,"stx.config.mjs")],s=e.debounceMs??300,o=null,a=[];for(let c of r)try{if(!M.existsSync(c))continue;let n=M.watch(c,(p)=>{if(p==="change"){if(o)clearTimeout(o);o=setTimeout(async()=>{Bs("Config file changed, restarting...");try{await e.onChange()}catch(l){ke(`Failed to restart: ${l}`)}},s)}});a.push(n)}catch{}return{stop(){if(o)clearTimeout(o);for(let c of a)c.close()}}}import w from"fs";import j from"path";var st=".stx/story/analytics.json",dt=1,A=1e4;class k{storage;storagePath;currentSession=null;dirty=!1;viewStartTimes=new Map;constructor(t){this.storagePath=j.join(t,st),this.storage=this.loadStorage(),this.startSession()}loadStorage(){try{let t=w.readFileSync(this.storagePath,"utf-8");return JSON.parse(t)}catch{return{version:dt,events:[],sessions:[]}}}async save(){if(!this.dirty)return;let t=j.dirname(this.storagePath);if(await w.promises.mkdir(t,{recursive:!0}),this.storage.events.length>A)this.storage.events=this.storage.events.slice(-A);await w.promises.writeFile(this.storagePath,JSON.stringify(this.storage,null,2)),this.dirty=!1}startSession(){this.endSession(),this.currentSession={id:pt(),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(t){this.storage.events.push({...t,timestamp:Date.now()}),this.dirty=!0}trackView(t,e){if(this.endViewTiming(t),this.viewStartTimes.set(t,Date.now()),this.track({type:"view",componentId:t,variantId:e}),this.currentSession&&!this.currentSession.componentViews.includes(t))this.currentSession.componentViews.push(t)}endViewTiming(t){let e=this.viewStartTimes.get(t);if(e){let r=Date.now()-e;this.track({type:"view",componentId:t,metadata:{duration:r,endView:!0}}),this.viewStartTimes.delete(t)}}trackPropChange(t,e,r){this.track({type:"prop_change",componentId:t,propName:e,metadata:{value:r}})}trackVariantSwitch(t,e){this.track({type:"variant_switch",componentId:t,variantId:e})}trackSearch(t,e){this.track({type:"search",query:t,metadata:{resultCount:e}})}getComponentAnalytics(t,e){let r=this.storage.events.filter((i)=>i.componentId===t),s=r.filter((i)=>i.type==="view"&&!i.metadata?.endView),o=r.filter((i)=>i.type==="prop_change"),a=r.filter((i)=>i.type==="variant_switch"),c={};for(let i of o)if(i.propName)c[i.propName]=(c[i.propName]||0)+1;let n={};for(let i of a)if(i.variantId)n[i.variantId]=(n[i.variantId]||0)+1;let p=new Set(this.storage.sessions.filter((i)=>i.componentViews.includes(t)).map((i)=>i.id)),l=r.filter((i)=>i.metadata?.duration).map((i)=>i.metadata.duration),g=l.length>0?l.reduce((i,m)=>i+m,0)/l.length:0,y=Object.entries(c).sort((i,m)=>m[1]-i[1]).slice(0,5).map(([i])=>i);return{componentId:t,componentName:e,viewCount:s.length,uniqueViews:p.size,lastViewed:s[s.length-1]?.timestamp,propChanges:c,topChangedProps:y,variantViews:n,avgTimeSpent:g}}getMostViewedComponents(t=10){let e=new Map;for(let r of this.storage.events)if(r.type==="view"&&r.componentId&&!r.metadata?.endView)e.set(r.componentId,(e.get(r.componentId)||0)+1);return Array.from(e.entries()).map(([r,s])=>({componentId:r,viewCount:s})).sort((r,s)=>s.viewCount-r.viewCount).slice(0,t)}getMostChangedProps(t=10){let e=new Map;for(let r of this.storage.events)if(r.type==="prop_change"&&r.propName)e.set(r.propName,(e.get(r.propName)||0)+1);return Array.from(e.entries()).map(([r,s])=>({propName:r,changeCount:s})).sort((r,s)=>s.changeCount-r.changeCount).slice(0,t)}getSearchAnalytics(){let t=this.storage.events.filter((o)=>o.type==="search"),e=new Map,r=0;for(let o of t){if(o.query)e.set(o.query,(e.get(o.query)||0)+1);if(o.metadata?.resultCount!==void 0)r+=o.metadata.resultCount}let s=Array.from(e.entries()).map(([o,a])=>({query:o,count:a})).sort((o,a)=>a.count-o.count).slice(0,10);return{totalSearches:t.length,topQueries:s,avgResultCount:t.length>0?r/t.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 pt(){return`session-${Date.now()}-${Math.random().toString(36).slice(2,8)}`}import S from"fs";import B from"path";var lt=".stx/story/bookmarks.json",mt=1;class P{storage;storagePath;dirty=!1;constructor(t){this.storagePath=B.join(t,lt),this.storage=this.loadStorage()}loadStorage(){try{let t=S.readFileSync(this.storagePath,"utf-8");return JSON.parse(t)}catch{return{version:mt,bookmarks:[]}}}async save(){if(!this.dirty)return;let t=B.dirname(this.storagePath);await S.promises.mkdir(t,{recursive:!0}),await S.promises.writeFile(this.storagePath,JSON.stringify(this.storage,null,2)),this.dirty=!1}addBookmark(t,e,r,s={}){let o={id:ut(),name:s.name||`${t}/${e}`,storyId:t,variantId:e,props:r,created:Date.now(),notes:s.notes,color:s.color};return this.storage.bookmarks.push(o),this.dirty=!0,o}getAllBookmarks(){return[...this.storage.bookmarks]}getBookmarksForStory(t){return this.storage.bookmarks.filter((e)=>e.storyId===t)}getBookmark(t){return this.storage.bookmarks.find((e)=>e.id===t)}isBookmarked(t,e){return this.storage.bookmarks.some((r)=>r.storyId===t&&r.variantId===e)}updateBookmark(t,e){let r=this.getBookmark(t);if(!r)return;return Object.assign(r,e),this.dirty=!0,r}deleteBookmark(t){let e=this.storage.bookmarks.findIndex((r)=>r.id===t);if(e===-1)return!1;return this.storage.bookmarks.splice(e,1),this.dirty=!0,!0}toggleBookmark(t,e,r){let s=this.storage.bookmarks.find((a)=>a.storyId===t&&a.variantId===e);if(s)return this.deleteBookmark(s.id),{added:!1};return{added:!0,bookmark:this.addBookmark(t,e,r)}}exportBookmarks(){return JSON.stringify(this.storage,null,2)}importBookmarks(t,e=!0){let r=JSON.parse(t),s=0;for(let o of r.bookmarks){if(e){let a=this.storage.bookmarks.find((c)=>c.id===o.id);if(a)Object.assign(a,o);else this.storage.bookmarks.push(o)}else this.storage.bookmarks.push(o);s++}if(s>0)this.dirty=!0;return s}}function ut(){return`bm-${Date.now()}-${Math.random().toString(36).slice(2,8)}`}var v=new Set;function N(){return{open(t){v.add(t),t.send(JSON.stringify({type:"connected",timestamp:Date.now()}))},close(t){v.delete(t)},message(t,e){}}}function C(t){let e=JSON.stringify({...t,timestamp:t.timestamp||Date.now()});for(let r of v)try{r.send(e)}catch{v.delete(r)}}function V(t,e){C({type:"story-update",data:{storyId:t,...e}})}function H(t,e){C({type:"story-add",data:{storyId:t,...e}})}function O(t){C({type:"story-remove",data:{storyId:t}})}function F(t){return`
2
+ import{Ce,$e,Ee}from"./chunk-qxre7vw6.js";import"./chunk-2jbyks2t.js";import"./chunk-pf0d8y9n.js";import{d}from"./chunk-dqdggvq4.js";import"./chunk-ynvce0q6.js";import"./chunk-2n5pjbw9.js";import"./chunk-88px183j.js";import"./chunk-v83bpj84.js";import"./chunk-y36av1ac.js";import"./chunk-0trfbqa7.js";import"./chunk-zydg3wgt.js";import"./chunk-ng61wjke.js";import"./chunk-jz7pvh7b.js";import{ot,dr,it,js,ke,Bs,pr,at,zs,ct}from"./chunk-1sdtg9np.js";import"./chunk-d2zw2e5m.js";import M from"fs";import x from"path";function E(t,e){let r=[x.join(t.root,"stx.config.ts"),x.join(t.root,"stx.config.js"),x.join(t.root,"stx.config.mjs")],s=e.debounceMs??300,o=null,a=[];for(let c of r)try{if(!M.existsSync(c))continue;let n=M.watch(c,(p)=>{if(p==="change"){if(o)clearTimeout(o);o=setTimeout(async()=>{Bs("Config file changed, restarting...");try{await e.onChange()}catch(l){ke(`Failed to restart: ${l}`)}},s)}});a.push(n)}catch{}return{stop(){if(o)clearTimeout(o);for(let c of a)c.close()}}}import w from"fs";import j from"path";var st=".stx/story/analytics.json",dt=1,A=1e4;class k{storage;storagePath;currentSession=null;dirty=!1;viewStartTimes=new Map;constructor(t){this.storagePath=j.join(t,st),this.storage=this.loadStorage(),this.startSession()}loadStorage(){try{let t=w.readFileSync(this.storagePath,"utf-8");return JSON.parse(t)}catch{return{version:dt,events:[],sessions:[]}}}async save(){if(!this.dirty)return;let t=j.dirname(this.storagePath);if(await w.promises.mkdir(t,{recursive:!0}),this.storage.events.length>A)this.storage.events=this.storage.events.slice(-A);await w.promises.writeFile(this.storagePath,JSON.stringify(this.storage,null,2)),this.dirty=!1}startSession(){this.endSession(),this.currentSession={id:pt(),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(t){this.storage.events.push({...t,timestamp:Date.now()}),this.dirty=!0}trackView(t,e){if(this.endViewTiming(t),this.viewStartTimes.set(t,Date.now()),this.track({type:"view",componentId:t,variantId:e}),this.currentSession&&!this.currentSession.componentViews.includes(t))this.currentSession.componentViews.push(t)}endViewTiming(t){let e=this.viewStartTimes.get(t);if(e){let r=Date.now()-e;this.track({type:"view",componentId:t,metadata:{duration:r,endView:!0}}),this.viewStartTimes.delete(t)}}trackPropChange(t,e,r){this.track({type:"prop_change",componentId:t,propName:e,metadata:{value:r}})}trackVariantSwitch(t,e){this.track({type:"variant_switch",componentId:t,variantId:e})}trackSearch(t,e){this.track({type:"search",query:t,metadata:{resultCount:e}})}getComponentAnalytics(t,e){let r=this.storage.events.filter((i)=>i.componentId===t),s=r.filter((i)=>i.type==="view"&&!i.metadata?.endView),o=r.filter((i)=>i.type==="prop_change"),a=r.filter((i)=>i.type==="variant_switch"),c={};for(let i of o)if(i.propName)c[i.propName]=(c[i.propName]||0)+1;let n={};for(let i of a)if(i.variantId)n[i.variantId]=(n[i.variantId]||0)+1;let p=new Set(this.storage.sessions.filter((i)=>i.componentViews.includes(t)).map((i)=>i.id)),l=r.filter((i)=>i.metadata?.duration).map((i)=>i.metadata.duration),g=l.length>0?l.reduce((i,m)=>i+m,0)/l.length:0,y=Object.entries(c).sort((i,m)=>m[1]-i[1]).slice(0,5).map(([i])=>i);return{componentId:t,componentName:e,viewCount:s.length,uniqueViews:p.size,lastViewed:s[s.length-1]?.timestamp,propChanges:c,topChangedProps:y,variantViews:n,avgTimeSpent:g}}getMostViewedComponents(t=10){let e=new Map;for(let r of this.storage.events)if(r.type==="view"&&r.componentId&&!r.metadata?.endView)e.set(r.componentId,(e.get(r.componentId)||0)+1);return Array.from(e.entries()).map(([r,s])=>({componentId:r,viewCount:s})).sort((r,s)=>s.viewCount-r.viewCount).slice(0,t)}getMostChangedProps(t=10){let e=new Map;for(let r of this.storage.events)if(r.type==="prop_change"&&r.propName)e.set(r.propName,(e.get(r.propName)||0)+1);return Array.from(e.entries()).map(([r,s])=>({propName:r,changeCount:s})).sort((r,s)=>s.changeCount-r.changeCount).slice(0,t)}getSearchAnalytics(){let t=this.storage.events.filter((o)=>o.type==="search"),e=new Map,r=0;for(let o of t){if(o.query)e.set(o.query,(e.get(o.query)||0)+1);if(o.metadata?.resultCount!==void 0)r+=o.metadata.resultCount}let s=Array.from(e.entries()).map(([o,a])=>({query:o,count:a})).sort((o,a)=>a.count-o.count).slice(0,10);return{totalSearches:t.length,topQueries:s,avgResultCount:t.length>0?r/t.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 pt(){return`session-${Date.now()}-${Math.random().toString(36).slice(2,8)}`}import S from"fs";import B from"path";var lt=".stx/story/bookmarks.json",mt=1;class P{storage;storagePath;dirty=!1;constructor(t){this.storagePath=B.join(t,lt),this.storage=this.loadStorage()}loadStorage(){try{let t=S.readFileSync(this.storagePath,"utf-8");return JSON.parse(t)}catch{return{version:mt,bookmarks:[]}}}async save(){if(!this.dirty)return;let t=B.dirname(this.storagePath);await S.promises.mkdir(t,{recursive:!0}),await S.promises.writeFile(this.storagePath,JSON.stringify(this.storage,null,2)),this.dirty=!1}addBookmark(t,e,r,s={}){let o={id:ut(),name:s.name||`${t}/${e}`,storyId:t,variantId:e,props:r,created:Date.now(),notes:s.notes,color:s.color};return this.storage.bookmarks.push(o),this.dirty=!0,o}getAllBookmarks(){return[...this.storage.bookmarks]}getBookmarksForStory(t){return this.storage.bookmarks.filter((e)=>e.storyId===t)}getBookmark(t){return this.storage.bookmarks.find((e)=>e.id===t)}isBookmarked(t,e){return this.storage.bookmarks.some((r)=>r.storyId===t&&r.variantId===e)}updateBookmark(t,e){let r=this.getBookmark(t);if(!r)return;return Object.assign(r,e),this.dirty=!0,r}deleteBookmark(t){let e=this.storage.bookmarks.findIndex((r)=>r.id===t);if(e===-1)return!1;return this.storage.bookmarks.splice(e,1),this.dirty=!0,!0}toggleBookmark(t,e,r){let s=this.storage.bookmarks.find((a)=>a.storyId===t&&a.variantId===e);if(s)return this.deleteBookmark(s.id),{added:!1};return{added:!0,bookmark:this.addBookmark(t,e,r)}}exportBookmarks(){return JSON.stringify(this.storage,null,2)}importBookmarks(t,e=!0){let r=JSON.parse(t),s=0;for(let o of r.bookmarks){if(e){let a=this.storage.bookmarks.find((c)=>c.id===o.id);if(a)Object.assign(a,o);else this.storage.bookmarks.push(o)}else this.storage.bookmarks.push(o);s++}if(s>0)this.dirty=!0;return s}}function ut(){return`bm-${Date.now()}-${Math.random().toString(36).slice(2,8)}`}var v=new Set;function N(){return{open(t){v.add(t),t.send(JSON.stringify({type:"connected",timestamp:Date.now()}))},close(t){v.delete(t)},message(t,e){}}}function C(t){let e=JSON.stringify({...t,timestamp:t.timestamp||Date.now()});for(let r of v)try{r.send(e)}catch{v.delete(r)}}function V(t,e){C({type:"story-update",data:{storyId:t,...e}})}function H(t,e){C({type:"story-add",data:{storyId:t,...e}})}function O(t){C({type:"story-remove",data:{storyId:t}})}function F(t){return`
3
3
  <script>
4
4
  (function() {
5
5
  const ws = new WebSocket('${t}');
@@ -556,7 +556,7 @@ window.__stxPerformance = {
556
556
 
557
557
  window.clearPerformanceMetrics = () => window.__stxPerformance.clear();
558
558
  </script>
559
- `}import T from"fs";import K from"path";var ft=".stx/story/presets.json",R=1,yt=10;class I{storage;storagePath;dirty=!1;constructor(t){this.storagePath=K.join(t,ft),this.storage=this.loadStorage()}loadStorage(){try{let t=T.readFileSync(this.storagePath,"utf-8"),e=JSON.parse(t);if(e.version!==R)return this.migrateStorage(e);return e}catch{return{version:R,presets:[],recentIds:[]}}}migrateStorage(t){return{version:R,presets:t.presets||[],recentIds:t.recentIds||[]}}async save(){if(!this.dirty)return;let t=K.dirname(this.storagePath);await T.promises.mkdir(t,{recursive:!0}),await T.promises.writeFile(this.storagePath,JSON.stringify(this.storage,null,2)),this.dirty=!1}createPreset(t,e,r={}){let s={id:ht(),name:t,description:r.description,props:e,componentId:r.componentId,created:Date.now(),usageCount:0,tags:r.tags};return this.storage.presets.push(s),this.dirty=!0,s}getPreset(t){return this.storage.presets.find((e)=>e.id===t)}getAllPresets(){return[...this.storage.presets]}getPresetsForComponent(t){return this.storage.presets.filter((e)=>!e.componentId||e.componentId===t)}getRecentPresets(){return this.storage.recentIds.map((t)=>this.getPreset(t)).filter((t)=>t!==void 0)}usePreset(t){let e=this.getPreset(t);if(!e)return;return e.lastUsed=Date.now(),e.usageCount++,this.storage.recentIds=[t,...this.storage.recentIds.filter((r)=>r!==t)].slice(0,yt),this.dirty=!0,e}updatePreset(t,e){let r=this.getPreset(t);if(!r)return;return Object.assign(r,e),this.dirty=!0,r}deletePreset(t){let e=this.storage.presets.findIndex((r)=>r.id===t);if(e===-1)return!1;return this.storage.presets.splice(e,1),this.storage.recentIds=this.storage.recentIds.filter((r)=>r!==t),this.dirty=!0,!0}searchPresets(t){let e=t.toLowerCase();return this.storage.presets.filter((r)=>{if(r.name.toLowerCase().includes(e))return!0;if(r.description?.toLowerCase().includes(e))return!0;if(r.tags?.some((s)=>s.toLowerCase().includes(e)))return!0;return!1})}getMostUsedPresets(t=5){return[...this.storage.presets].sort((e,r)=>r.usageCount-e.usageCount).slice(0,t)}exportPresets(t){let e=t?this.storage.presets.filter((r)=>t.includes(r.id)):this.storage.presets;return JSON.stringify({presets:e},null,2)}importPresets(t,e=!1){let r=JSON.parse(t),s=0;for(let o of r.presets){let a=this.storage.presets.find((c)=>c.id===o.id);if(a&&!e)continue;if(a)Object.assign(a,o);else this.storage.presets.push(o);s++}if(s>0)this.dirty=!0;return s}}function ht(){return`preset-${Date.now()}-${Math.random().toString(36).slice(2,8)}`}import _ from"fs";var q=new Map;async function b(t,e,r={}){let s=performance.now(),o=[];try{let a=await _.promises.stat(e),c=q.get(e),n;if(c&&c.mtime===a.mtimeMs)n=c.content;else n=await _.promises.readFile(e,"utf-8"),q.set(e,{content:n,mtime:a.mtimeMs,analyzed:null});let{processDirectives:p}=await import("./chunk-yxwam84p.js"),l={},g=h(n);if(g)try{await d(g,l,e)}catch(f){o.push(`Warning: Could not extract script variables: ${f instanceof Error?f.message:String(f)}`)}if(r.props)Object.assign(l,r.props);let i=await p(n,l,e,{},new Set),m=Z(n),u=h(n);return i=Q(i),i=tt(i,l),{html:i,css:m,js:u,errors:o,duration:performance.now()-s}}catch(a){return o.push(a instanceof Error?a.message:String(a)),{html:`<div class="stx-render-error">${et(o[0])}</div>`,css:"",js:"",errors:o,duration:performance.now()-s}}}async function vt(t){try{let e=await _.promises.readFile(t,"utf-8"),r=h(e);if(!r)return null;let s={};if(await d(r,s,t),Array.isArray(s.variants))return s.variants;return null}catch{return null}}async function Y(t,e,r,s){let o=e.story?.variants;if(!o){let n=await vt(e.path);if(n)o=n}if(!o&&r==="default")return b(t,e.path,{props:s||{}});if(!o)return b(t,e.path,{props:s||{}});let a=o.find((n)=>n.id===r);if(!a&&r==="default")return b(t,e.path,{props:s||{}});if(!a)return{html:'<div class="stx-render-error">Variant not found</div>',css:"",js:"",errors:[`Variant '${r}' not found`],duration:0};let c={...a.state,...s};if(a.source)return bt(t,a.source,c);return b(t,e.path,{props:c})}async function bt(t,e,r={}){let s=performance.now(),o=[];try{let{processDirectives:a}=await import("./chunk-yxwam84p.js"),c={...r},n=h(e);if(n)try{await d(n,c,"inline-template.stx")}catch{}let l=await a(e,c,"inline-template.stx",{},new Set);return l=Q(l),l=tt(l,c),{html:l,css:Z(e),js:h(e),errors:o,duration:performance.now()-s}}catch(a){return o.push(a instanceof Error?a.message:String(a)),{html:`<div class="stx-render-error">${et(o[0])}</div>`,css:"",js:"",errors:o,duration:performance.now()-s}}}function Z(t){let e=[],r=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,s=r.exec(t);while(s!==null)e.push(s[1].trim()),s=r.exec(t);return e.join(`
559
+ `}import T from"fs";import K from"path";var ft=".stx/story/presets.json",R=1,yt=10;class I{storage;storagePath;dirty=!1;constructor(t){this.storagePath=K.join(t,ft),this.storage=this.loadStorage()}loadStorage(){try{let t=T.readFileSync(this.storagePath,"utf-8"),e=JSON.parse(t);if(e.version!==R)return this.migrateStorage(e);return e}catch{return{version:R,presets:[],recentIds:[]}}}migrateStorage(t){return{version:R,presets:t.presets||[],recentIds:t.recentIds||[]}}async save(){if(!this.dirty)return;let t=K.dirname(this.storagePath);await T.promises.mkdir(t,{recursive:!0}),await T.promises.writeFile(this.storagePath,JSON.stringify(this.storage,null,2)),this.dirty=!1}createPreset(t,e,r={}){let s={id:ht(),name:t,description:r.description,props:e,componentId:r.componentId,created:Date.now(),usageCount:0,tags:r.tags};return this.storage.presets.push(s),this.dirty=!0,s}getPreset(t){return this.storage.presets.find((e)=>e.id===t)}getAllPresets(){return[...this.storage.presets]}getPresetsForComponent(t){return this.storage.presets.filter((e)=>!e.componentId||e.componentId===t)}getRecentPresets(){return this.storage.recentIds.map((t)=>this.getPreset(t)).filter((t)=>t!==void 0)}usePreset(t){let e=this.getPreset(t);if(!e)return;return e.lastUsed=Date.now(),e.usageCount++,this.storage.recentIds=[t,...this.storage.recentIds.filter((r)=>r!==t)].slice(0,yt),this.dirty=!0,e}updatePreset(t,e){let r=this.getPreset(t);if(!r)return;return Object.assign(r,e),this.dirty=!0,r}deletePreset(t){let e=this.storage.presets.findIndex((r)=>r.id===t);if(e===-1)return!1;return this.storage.presets.splice(e,1),this.storage.recentIds=this.storage.recentIds.filter((r)=>r!==t),this.dirty=!0,!0}searchPresets(t){let e=t.toLowerCase();return this.storage.presets.filter((r)=>{if(r.name.toLowerCase().includes(e))return!0;if(r.description?.toLowerCase().includes(e))return!0;if(r.tags?.some((s)=>s.toLowerCase().includes(e)))return!0;return!1})}getMostUsedPresets(t=5){return[...this.storage.presets].sort((e,r)=>r.usageCount-e.usageCount).slice(0,t)}exportPresets(t){let e=t?this.storage.presets.filter((r)=>t.includes(r.id)):this.storage.presets;return JSON.stringify({presets:e},null,2)}importPresets(t,e=!1){let r=JSON.parse(t),s=0;for(let o of r.presets){let a=this.storage.presets.find((c)=>c.id===o.id);if(a&&!e)continue;if(a)Object.assign(a,o);else this.storage.presets.push(o);s++}if(s>0)this.dirty=!0;return s}}function ht(){return`preset-${Date.now()}-${Math.random().toString(36).slice(2,8)}`}import _ from"fs";var q=new Map;async function b(t,e,r={}){let s=performance.now(),o=[];try{let a=await _.promises.stat(e),c=q.get(e),n;if(c&&c.mtime===a.mtimeMs)n=c.content;else n=await _.promises.readFile(e,"utf-8"),q.set(e,{content:n,mtime:a.mtimeMs,analyzed:null});let{processDirectives:p}=await import("./chunk-rjm3n62n.js"),l={},g=h(n);if(g)try{await d(g,l,e)}catch(f){o.push(`Warning: Could not extract script variables: ${f instanceof Error?f.message:String(f)}`)}if(r.props)Object.assign(l,r.props);let i=await p(n,l,e,{},new Set),m=Z(n),u=h(n);return i=Q(i),i=tt(i,l),{html:i,css:m,js:u,errors:o,duration:performance.now()-s}}catch(a){return o.push(a instanceof Error?a.message:String(a)),{html:`<div class="stx-render-error">${et(o[0])}</div>`,css:"",js:"",errors:o,duration:performance.now()-s}}}async function vt(t){try{let e=await _.promises.readFile(t,"utf-8"),r=h(e);if(!r)return null;let s={};if(await d(r,s,t),Array.isArray(s.variants))return s.variants;return null}catch{return null}}async function Y(t,e,r,s){let o=e.story?.variants;if(!o){let n=await vt(e.path);if(n)o=n}if(!o&&r==="default")return b(t,e.path,{props:s||{}});if(!o)return b(t,e.path,{props:s||{}});let a=o.find((n)=>n.id===r);if(!a&&r==="default")return b(t,e.path,{props:s||{}});if(!a)return{html:'<div class="stx-render-error">Variant not found</div>',css:"",js:"",errors:[`Variant '${r}' not found`],duration:0};let c={...a.state,...s};if(a.source)return bt(t,a.source,c);return b(t,e.path,{props:c})}async function bt(t,e,r={}){let s=performance.now(),o=[];try{let{processDirectives:a}=await import("./chunk-rjm3n62n.js"),c={...r},n=h(e);if(n)try{await d(n,c,"inline-template.stx")}catch{}let l=await a(e,c,"inline-template.stx",{},new Set);return l=Q(l),l=tt(l,c),{html:l,css:Z(e),js:h(e),errors:o,duration:performance.now()-s}}catch(a){return o.push(a instanceof Error?a.message:String(a)),{html:`<div class="stx-render-error">${et(o[0])}</div>`,css:"",js:"",errors:o,duration:performance.now()-s}}}function Z(t){let e=[],r=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,s=r.exec(t);while(s!==null)e.push(s[1].trim()),s=r.exec(t);return e.join(`
560
560
  `)}function Q(t){return t.replace(/<!--[\s\S]*?-->/g,"").replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"").replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/^\s*\n/gm,"").trim()}function h(t){let e=[],r=/<script\b[^>]*>([\s\S]*?)<\/script>/gi,s=r.exec(t);while(s!==null)e.push(s[1].trim()),s=r.exec(t);return e.join(`
561
561
  `)}function tt(t,e){let r=`<script>window.__stxProps = ${JSON.stringify(e)};</script>`;return t+r}function et(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}async function rt(t,e){let r=await at(t);$e(t,r);let s=ct(t.config,r);Ee(t,s),console.log(` Found ${r.length} story files`);let o=typeof e.host==="string"?e.host:e.host===!0?"0.0.0.0":"localhost",a=new I(t.root),c=new P(t.root),n=new k(t.root),p=N(),l=Bun.serve({port:e.port,hostname:o,fetch:async(i,m)=>{let f=new URL(i.url).pathname;if(f==="/__hmr"){if(m.upgrade(i,{data:{isHmr:!0}}))return;return new Response("WebSocket upgrade failed",{status:400})}if(f.startsWith("/api/"))return xt(t,f,i,{presetsManager:a,bookmarksManager:c,analyticsTracker:n});return wt(t,f,e.port)},websocket:{open(i){p.open(i)},close(i){p.close(i)},message(i,m){p.message(i,m)}}}),g=`http://${o}:${e.port}`,y=zs(t,async(i,m)=>{console.log(` [${i}] ${m.relativePath}`);let u=await at(t);$e(t,u);let f=ct(t.config,u);if(Ee(t,f),i==="add")H(m.id,{fileName:m.fileName});else if(i==="unlink")O(m.id);else V(m.id,{fileName:m.fileName})});if(e.open){let i=g;try{let{exec:m}=await import("child_process"),u=process.platform;m(`${u==="darwin"?"open":u==="win32"?"start":"xdg-open"} ${i}`)}catch{}}return{server:l,url:g,close:async()=>{y(),l.stop()}}}async function xt(t,e,r,s){let{presetsManager:o,bookmarksManager:a,analyticsTracker:c}=s;if(e==="/api/stories")return Response.json({files:t.storyFiles.map((n)=>({id:n.id,fileName:n.fileName,relativePath:n.relativePath,treePath:n.treePath})),tree:t.tree});if(e.startsWith("/api/story/")){let n=e.slice(11),p=t.storyFiles.find((l)=>l.id===n);if(!p)return new Response("Story not found",{status:404});try{let l=await Bun.file(p.path).text();return Response.json({id:p.id,fileName:p.fileName,relativePath:p.relativePath,content:l})}catch{return new Response("Error reading story",{status:500})}}if(e==="/api/config")return Response.json({theme:t.config.theme,responsivePresets:t.config.responsivePresets,backgroundPresets:t.config.backgroundPresets});if(e.startsWith("/api/render/")){let n=new URL(r.url),p=e.slice(12).split("/"),l=p[0],g=p[1]||"default",y,i=n.searchParams.get("props");if(i)try{y=JSON.parse(i)}catch{}let m=t.storyFiles.find((u)=>u.id===l);if(!m)return new Response("Story not found",{status:404});try{let u=await Y(t,m,g,y);return Response.json({html:u.html,css:u.css,js:u.js,errors:u.errors,duration:u.duration})}catch(u){return Response.json({html:"",css:"",js:"",errors:[u instanceof Error?u.message:String(u)],duration:0},{status:500})}}if(e==="/api/presets"&&r.method==="GET")return Response.json({presets:o.getAllPresets()});if(e==="/api/presets"&&r.method==="POST")try{let n=await r.json(),p=o.createPreset(n.name,n.props,{componentId:n.componentId,description:n.description});return await o.save(),Response.json(p)}catch(n){return Response.json({error:String(n)},{status:400})}if(e.startsWith("/api/presets/")&&!e.includes("/use")&&r.method==="GET"){let n=e.slice(13),p=o.getPreset(n);if(!p)return new Response("Preset not found",{status:404});return Response.json(p)}if(e.endsWith("/use")&&r.method==="POST"){let n=e.slice(13,-4),p=o.usePreset(n);if(!p)return new Response("Preset not found",{status:404});return await o.save(),Response.json(p)}if(e.startsWith("/api/presets/")&&r.method==="DELETE"){let n=e.slice(13);if(!o.deletePreset(n))return new Response("Preset not found",{status:404});return await o.save(),Response.json({success:!0})}if(e==="/api/bookmarks"&&r.method==="GET")return Response.json({bookmarks:a.getAllBookmarks()});if(e==="/api/bookmarks"&&r.method==="POST")try{let n=await r.json(),p=a.addBookmark(n.storyId,n.variantId,n.props,{name:n.name,notes:n.notes,color:n.color});return await a.save(),Response.json(p)}catch(n){return Response.json({error:String(n)},{status:400})}if(e==="/api/bookmarks/toggle"&&r.method==="POST")try{let n=await r.json(),p=a.toggleBookmark(n.storyId,n.variantId,n.props);return await a.save(),Response.json(p)}catch(n){return Response.json({error:String(n)},{status:400})}if(e.startsWith("/api/bookmarks/")&&e!=="/api/bookmarks/toggle"&&r.method==="GET"){let n=e.slice(15),p=a.getBookmark(n);if(!p)return new Response("Bookmark not found",{status:404});return Response.json(p)}if(e.startsWith("/api/bookmarks/")&&r.method==="DELETE"){let n=e.slice(15);if(!a.deleteBookmark(n))return new Response("Bookmark not found",{status:404});return await a.save(),Response.json({success:!0})}if(e==="/api/analytics/track"&&r.method==="POST")try{let n=await r.json();if(n.type==="view"&&n.componentId)c.trackView(n.componentId,n.variantId);else if(n.type==="prop_change"&&n.componentId&&n.propName)c.trackPropChange(n.componentId,n.propName,null);else if(n.type==="variant_switch"&&n.componentId&&n.variantId)c.trackVariantSwitch(n.componentId,n.variantId);else if(n.type==="search"&&n.query)c.trackSearch(n.query,0);return await c.save(),Response.json({success:!0})}catch(n){return Response.json({error:String(n)},{status:400})}if(e==="/api/analytics/summary"&&r.method==="GET")return Response.json({mostViewed:c.getMostViewedComponents(10),mostChangedProps:c.getMostChangedProps(10),searchAnalytics:c.getSearchAnalytics()});if(e.startsWith("/api/analytics/component/")&&r.method==="GET"){let n=e.slice(25),p=t.storyFiles.find((g)=>g.id===n),l=c.getComponentAnalytics(n,p?.fileName||n);return Response.json(l)}return new Response("Not found",{status:404})}function wt(t,e,r){let s=kt(t,r);return new Response(s,{headers:{"Content-Type":"text/html; charset=utf-8"}})}function kt(t,e){let{theme:r}=t.config,s=r.title||"STX Story",o=`ws://localhost:${e}/__hmr`,a=F(o);return`<!DOCTYPE html>
562
562
  <html lang="en" class="${r.darkClass||"dark"}">
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Gc}from"./chunk-etjw0he9.js";import"./chunk-dqdggvq4.js";import"./chunk-d2zw2e5m.js";import"./chunk-2n5pjbw9.js";import"./chunk-0trfbqa7.js";import"./chunk-ng61wjke.js";import"./chunk-zydg3wgt.js";import"./chunk-y36av1ac.js";import"./chunk-v83bpj84.js";import"./chunk-ynvce0q6.js";import"./chunk-pf0d8y9n.js";import"./chunk-2jbyks2t.js";import"./chunk-88px183j.js";import"./chunk-jz7pvh7b.js";export{Gc as startInteractive};