@burdenoff/website-sdk 2026.1101.1 → 2026.1101.2

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 (276) hide show
  1. package/README.md +42 -8
  2. package/dist/analytics/index.js +19 -69
  3. package/dist/analytics/index.js.map +1 -1
  4. package/dist/analytics/index.mjs +3 -69
  5. package/dist/analytics/index.mjs.map +1 -1
  6. package/dist/avatar-live/index.js +1 -0
  7. package/dist/avatar-live/index.js.map +1 -1
  8. package/dist/avatar-live/index.mjs +1 -0
  9. package/dist/avatar-live/index.mjs.map +1 -1
  10. package/dist/avatar-live-view/index.js +10 -30
  11. package/dist/avatar-live-view/index.js.map +1 -1
  12. package/dist/avatar-live-view/index.mjs +4 -24
  13. package/dist/avatar-live-view/index.mjs.map +1 -1
  14. package/dist/chunk-23H4JUL4.js +41 -0
  15. package/dist/chunk-23H4JUL4.js.map +1 -0
  16. package/dist/chunk-34RX5P75.mjs +25 -0
  17. package/dist/chunk-34RX5P75.mjs.map +1 -0
  18. package/dist/chunk-3LFFY7AZ.js +184 -0
  19. package/dist/chunk-3LFFY7AZ.js.map +1 -0
  20. package/dist/chunk-3X26GE4S.js +2794 -0
  21. package/dist/chunk-3X26GE4S.js.map +1 -0
  22. package/dist/chunk-45GCA4GG.js +85 -0
  23. package/dist/chunk-45GCA4GG.js.map +1 -0
  24. package/dist/chunk-4SAGVLHN.js +876 -0
  25. package/dist/chunk-4SAGVLHN.js.map +1 -0
  26. package/dist/chunk-4U6YAII5.js +218 -0
  27. package/dist/chunk-4U6YAII5.js.map +1 -0
  28. package/dist/chunk-5GMTBOO6.js +21 -0
  29. package/dist/chunk-5GMTBOO6.js.map +1 -0
  30. package/dist/chunk-5JRJ57CL.mjs +329 -0
  31. package/dist/chunk-5JRJ57CL.mjs.map +1 -0
  32. package/dist/chunk-6C2DKIC7.js +4 -0
  33. package/dist/chunk-6C2DKIC7.js.map +1 -0
  34. package/dist/chunk-6IBFBWC5.mjs +17 -0
  35. package/dist/chunk-6IBFBWC5.mjs.map +1 -0
  36. package/dist/chunk-6KY2ZRVI.js +116 -0
  37. package/dist/chunk-6KY2ZRVI.js.map +1 -0
  38. package/dist/chunk-6VJT3SM4.mjs +182 -0
  39. package/dist/chunk-6VJT3SM4.mjs.map +1 -0
  40. package/dist/chunk-6YZUFMK2.mjs +40 -0
  41. package/dist/chunk-6YZUFMK2.mjs.map +1 -0
  42. package/dist/chunk-7A6R7CGG.js +47 -0
  43. package/dist/chunk-7A6R7CGG.js.map +1 -0
  44. package/dist/chunk-7PWL4V2R.js +4 -0
  45. package/dist/chunk-7PWL4V2R.js.map +1 -0
  46. package/dist/chunk-AA33WDYS.js +161 -0
  47. package/dist/chunk-AA33WDYS.js.map +1 -0
  48. package/dist/chunk-AHRGFXV2.js +525 -0
  49. package/dist/chunk-AHRGFXV2.js.map +1 -0
  50. package/dist/chunk-B63XLDZH.mjs +109 -0
  51. package/dist/chunk-B63XLDZH.mjs.map +1 -0
  52. package/dist/chunk-BX2USEWF.mjs +35 -0
  53. package/dist/chunk-BX2USEWF.mjs.map +1 -0
  54. package/dist/chunk-BYSZT35R.js +150 -0
  55. package/dist/chunk-BYSZT35R.js.map +1 -0
  56. package/dist/chunk-C6OJIHNO.js +12 -0
  57. package/dist/chunk-C6OJIHNO.js.map +1 -0
  58. package/dist/chunk-COOELBX7.mjs +63 -0
  59. package/dist/chunk-COOELBX7.mjs.map +1 -0
  60. package/dist/chunk-D2TW7MNC.mjs +2771 -0
  61. package/dist/chunk-D2TW7MNC.mjs.map +1 -0
  62. package/dist/chunk-D5KEZ6V6.mjs +3 -0
  63. package/dist/chunk-D5KEZ6V6.mjs.map +1 -0
  64. package/dist/chunk-E3GUGJMY.js +46 -0
  65. package/dist/chunk-E3GUGJMY.js.map +1 -0
  66. package/dist/chunk-EBZ2HGJ2.mjs +52 -0
  67. package/dist/chunk-EBZ2HGJ2.mjs.map +1 -0
  68. package/dist/chunk-EDLTUOIA.mjs +210 -0
  69. package/dist/chunk-EDLTUOIA.mjs.map +1 -0
  70. package/dist/chunk-EJQSOT4X.js +4 -0
  71. package/dist/chunk-EJQSOT4X.js.map +1 -0
  72. package/dist/chunk-EUPFS6MZ.mjs +2019 -0
  73. package/dist/chunk-EUPFS6MZ.mjs.map +1 -0
  74. package/dist/chunk-F3XWDC3B.js +77 -0
  75. package/dist/chunk-F3XWDC3B.js.map +1 -0
  76. package/dist/chunk-FFADMVIK.mjs +5127 -0
  77. package/dist/chunk-FFADMVIK.mjs.map +1 -0
  78. package/dist/chunk-FJWS7BKT.mjs +3 -0
  79. package/dist/chunk-FJWS7BKT.mjs.map +1 -0
  80. package/dist/chunk-FJZJDUOR.mjs +3 -0
  81. package/dist/chunk-FJZJDUOR.mjs.map +1 -0
  82. package/dist/chunk-GCFLCO2Z.mjs +145 -0
  83. package/dist/chunk-GCFLCO2Z.mjs.map +1 -0
  84. package/dist/chunk-GEXC4LRP.js +61 -0
  85. package/dist/chunk-GEXC4LRP.js.map +1 -0
  86. package/dist/chunk-GTRAXQGC.mjs +3 -0
  87. package/dist/chunk-GTRAXQGC.mjs.map +1 -0
  88. package/dist/chunk-IKOIRUKW.js +270 -0
  89. package/dist/chunk-IKOIRUKW.js.map +1 -0
  90. package/dist/chunk-IXTWOPRN.js +45 -0
  91. package/dist/chunk-IXTWOPRN.js.map +1 -0
  92. package/dist/chunk-JDXOXGOK.js +547 -0
  93. package/dist/chunk-JDXOXGOK.js.map +1 -0
  94. package/dist/chunk-JSLDWYV7.mjs +558 -0
  95. package/dist/chunk-JSLDWYV7.mjs.map +1 -0
  96. package/dist/chunk-JXLSTVBK.js +336 -0
  97. package/dist/chunk-JXLSTVBK.js.map +1 -0
  98. package/dist/chunk-KHYXK7FG.mjs +49 -0
  99. package/dist/chunk-KHYXK7FG.mjs.map +1 -0
  100. package/dist/chunk-KSMBOWQQ.js +2034 -0
  101. package/dist/chunk-KSMBOWQQ.js.map +1 -0
  102. package/dist/chunk-KU2PXHGB.mjs +83 -0
  103. package/dist/chunk-KU2PXHGB.mjs.map +1 -0
  104. package/dist/chunk-KZANIV3S.mjs +37 -0
  105. package/dist/chunk-KZANIV3S.mjs.map +1 -0
  106. package/dist/chunk-L4BP6YOB.js +20 -0
  107. package/dist/chunk-L4BP6YOB.js.map +1 -0
  108. package/dist/chunk-MRKA2OAF.mjs +75 -0
  109. package/dist/chunk-MRKA2OAF.mjs.map +1 -0
  110. package/dist/chunk-N5EC53MH.mjs +80 -0
  111. package/dist/chunk-N5EC53MH.mjs.map +1 -0
  112. package/dist/chunk-NZANQGDM.mjs +34 -0
  113. package/dist/chunk-NZANQGDM.mjs.map +1 -0
  114. package/dist/chunk-O4GS3XPZ.js +10 -0
  115. package/dist/chunk-O4GS3XPZ.js.map +1 -0
  116. package/dist/chunk-O76QDGRM.js +5154 -0
  117. package/dist/chunk-O76QDGRM.js.map +1 -0
  118. package/dist/chunk-OYEUNZJY.js +114 -0
  119. package/dist/chunk-OYEUNZJY.js.map +1 -0
  120. package/dist/chunk-PHXAGQNB.js +74 -0
  121. package/dist/chunk-PHXAGQNB.js.map +1 -0
  122. package/dist/chunk-PIHHPP7J.mjs +16 -0
  123. package/dist/chunk-PIHHPP7J.mjs.map +1 -0
  124. package/dist/chunk-PXRHVVOU.mjs +499 -0
  125. package/dist/chunk-PXRHVVOU.mjs.map +1 -0
  126. package/dist/chunk-QMA6U6AU.js +36 -0
  127. package/dist/chunk-QMA6U6AU.js.map +1 -0
  128. package/dist/chunk-R6J7IULF.js +44 -0
  129. package/dist/chunk-R6J7IULF.js.map +1 -0
  130. package/dist/chunk-R7G6TWIS.mjs +10 -0
  131. package/dist/chunk-R7G6TWIS.mjs.map +1 -0
  132. package/dist/chunk-RUMGFI6L.mjs +544 -0
  133. package/dist/chunk-RUMGFI6L.mjs.map +1 -0
  134. package/dist/chunk-S54JWSJF.js +565 -0
  135. package/dist/chunk-S54JWSJF.js.map +1 -0
  136. package/dist/chunk-SK5UGG6A.js +2041 -0
  137. package/dist/chunk-SK5UGG6A.js.map +1 -0
  138. package/dist/chunk-SKIYDKIS.mjs +70 -0
  139. package/dist/chunk-SKIYDKIS.mjs.map +1 -0
  140. package/dist/chunk-SZNS5IK6.mjs +322 -0
  141. package/dist/chunk-SZNS5IK6.mjs.map +1 -0
  142. package/dist/chunk-T7JIPZAC.js +66 -0
  143. package/dist/chunk-T7JIPZAC.js.map +1 -0
  144. package/dist/chunk-TGYQHO2E.mjs +864 -0
  145. package/dist/chunk-TGYQHO2E.mjs.map +1 -0
  146. package/dist/chunk-TT3MHN42.mjs +8 -0
  147. package/dist/chunk-TT3MHN42.mjs.map +1 -0
  148. package/dist/chunk-UM55U65W.mjs +268 -0
  149. package/dist/chunk-UM55U65W.mjs.map +1 -0
  150. package/dist/chunk-UQ2HALUD.js +72 -0
  151. package/dist/chunk-UQ2HALUD.js.map +1 -0
  152. package/dist/chunk-UXWT7G77.js +82 -0
  153. package/dist/chunk-UXWT7G77.js.map +1 -0
  154. package/dist/chunk-VNS5WDWO.mjs +7 -0
  155. package/dist/chunk-VNS5WDWO.mjs.map +1 -0
  156. package/dist/chunk-VRWZLGR7.js +4 -0
  157. package/dist/chunk-VRWZLGR7.js.map +1 -0
  158. package/dist/chunk-VZLDSNH4.mjs +22 -0
  159. package/dist/chunk-VZLDSNH4.mjs.map +1 -0
  160. package/dist/chunk-W6P3YETJ.js +92 -0
  161. package/dist/chunk-W6P3YETJ.js.map +1 -0
  162. package/dist/chunk-WPKFFQCR.mjs +90 -0
  163. package/dist/chunk-WPKFFQCR.mjs.map +1 -0
  164. package/dist/chunk-WTVTI5TO.mjs +22 -0
  165. package/dist/chunk-WTVTI5TO.mjs.map +1 -0
  166. package/dist/chunk-XJOBZ4RJ.js +44 -0
  167. package/dist/chunk-XJOBZ4RJ.js.map +1 -0
  168. package/dist/chunk-XP2JDNDU.js +325 -0
  169. package/dist/chunk-XP2JDNDU.js.map +1 -0
  170. package/dist/chunk-Y4V5CEWD.mjs +112 -0
  171. package/dist/chunk-Y4V5CEWD.mjs.map +1 -0
  172. package/dist/chunk-YERN2UWM.js +116 -0
  173. package/dist/chunk-YERN2UWM.js.map +1 -0
  174. package/dist/chunk-ZKJQWFAA.mjs +114 -0
  175. package/dist/chunk-ZKJQWFAA.mjs.map +1 -0
  176. package/dist/chunk-ZOON3S3Y.mjs +138 -0
  177. package/dist/chunk-ZOON3S3Y.mjs.map +1 -0
  178. package/dist/chunk-ZP6QRAYC.mjs +2024 -0
  179. package/dist/chunk-ZP6QRAYC.mjs.map +1 -0
  180. package/dist/chunk-ZSTFX7FV.js +9 -0
  181. package/dist/chunk-ZSTFX7FV.js.map +1 -0
  182. package/dist/client/index.js +23 -331
  183. package/dist/client/index.js.map +1 -1
  184. package/dist/client/index.mjs +3 -330
  185. package/dist/client/index.mjs.map +1 -1
  186. package/dist/comparison/index.js +28 -111
  187. package/dist/comparison/index.js.map +1 -1
  188. package/dist/comparison/index.mjs +2 -107
  189. package/dist/comparison/index.mjs.map +1 -1
  190. package/dist/components/contact.js +21 -931
  191. package/dist/components/contact.js.map +1 -1
  192. package/dist/components/contact.mjs +12 -909
  193. package/dist/components/contact.mjs.map +1 -1
  194. package/dist/components/electron-download.js +12 -124
  195. package/dist/components/electron-download.js.map +1 -1
  196. package/dist/components/electron-download.mjs +4 -106
  197. package/dist/components/electron-download.mjs.map +1 -1
  198. package/dist/components/explore-cta.js +8 -112
  199. package/dist/components/explore-cta.js.map +1 -1
  200. package/dist/components/explore-cta.mjs +3 -114
  201. package/dist/components/explore-cta.mjs.map +1 -1
  202. package/dist/components/explore.js +62 -7833
  203. package/dist/components/explore.js.map +1 -1
  204. package/dist/components/explore.mjs +13 -7800
  205. package/dist/components/explore.mjs.map +1 -1
  206. package/dist/components/launch-countdown.js +8 -83
  207. package/dist/components/launch-countdown.js.map +1 -1
  208. package/dist/components/launch-countdown.mjs +3 -85
  209. package/dist/components/launch-countdown.mjs.map +1 -1
  210. package/dist/components/newsletter.js +20 -993
  211. package/dist/components/newsletter.js.map +1 -1
  212. package/dist/components/newsletter.mjs +11 -971
  213. package/dist/components/newsletter.mjs.map +1 -1
  214. package/dist/components/partners.js +24 -1302
  215. package/dist/components/partners.js.map +1 -1
  216. package/dist/components/partners.mjs +15 -1276
  217. package/dist/components/partners.mjs.map +1 -1
  218. package/dist/components/pricing.js +49 -1249
  219. package/dist/components/pricing.js.map +1 -1
  220. package/dist/components/pricing.mjs +8 -1226
  221. package/dist/components/pricing.mjs.map +1 -1
  222. package/dist/components/problems-solved.js +8 -150
  223. package/dist/components/problems-solved.js.map +1 -1
  224. package/dist/components/problems-solved.mjs +4 -133
  225. package/dist/components/problems-solved.mjs.map +1 -1
  226. package/dist/components/resource-links.js +8 -304
  227. package/dist/components/resource-links.js.map +1 -1
  228. package/dist/components/resource-links.mjs +5 -308
  229. package/dist/components/resource-links.mjs.map +1 -1
  230. package/dist/components/social-links.js +8 -343
  231. package/dist/components/social-links.js.map +1 -1
  232. package/dist/components/social-links.mjs +5 -347
  233. package/dist/components/social-links.mjs.map +1 -1
  234. package/dist/components/unsubscribe.js +10 -627
  235. package/dist/components/unsubscribe.js.map +1 -1
  236. package/dist/components/unsubscribe.mjs +6 -611
  237. package/dist/components/unsubscribe.mjs.map +1 -1
  238. package/dist/components/waitlist.js +21 -1001
  239. package/dist/components/waitlist.js.map +1 -1
  240. package/dist/components/waitlist.mjs +12 -982
  241. package/dist/components/waitlist.mjs.map +1 -1
  242. package/dist/components/website-switcher.js +12 -175
  243. package/dist/components/website-switcher.js.map +1 -1
  244. package/dist/components/website-switcher.mjs +4 -157
  245. package/dist/components/website-switcher.mjs.map +1 -1
  246. package/dist/content/index.js +118 -3616
  247. package/dist/content/index.js.map +1 -1
  248. package/dist/content/index.mjs +12 -3567
  249. package/dist/content/index.mjs.map +1 -1
  250. package/dist/hooks/index.js +37 -2321
  251. package/dist/hooks/index.js.map +1 -1
  252. package/dist/hooks/index.mjs +6 -2318
  253. package/dist/hooks/index.mjs.map +1 -1
  254. package/dist/index.d.mts +1 -1
  255. package/dist/index.d.ts +1 -1
  256. package/dist/index.js +4145 -20599
  257. package/dist/index.js.map +1 -1
  258. package/dist/index.mjs +3766 -20567
  259. package/dist/index.mjs.map +1 -1
  260. package/dist/product/index.js +20 -393
  261. package/dist/product/index.js.map +1 -1
  262. package/dist/product/index.mjs +5 -394
  263. package/dist/product/index.mjs.map +1 -1
  264. package/dist/seo/index.js +8 -76
  265. package/dist/seo/index.js.map +1 -1
  266. package/dist/seo/index.mjs +3 -78
  267. package/dist/seo/index.mjs.map +1 -1
  268. package/dist/store/index.js +51 -2650
  269. package/dist/store/index.js.map +1 -1
  270. package/dist/store/index.mjs +13 -2619
  271. package/dist/store/index.mjs.map +1 -1
  272. package/dist/utils/index.js +69 -134
  273. package/dist/utils/index.js.map +1 -1
  274. package/dist/utils/index.mjs +5 -122
  275. package/dist/utils/index.mjs.map +1 -1
  276. package/package.json +2 -1
@@ -0,0 +1,2024 @@
1
+ import { ProseStyles } from './chunk-6VJT3SM4.mjs';
2
+ import { Markdown } from './chunk-EBZ2HGJ2.mjs';
3
+ import { PageHead } from './chunk-N5EC53MH.mjs';
4
+ import { useWebSDK } from './chunk-5JRJ57CL.mjs';
5
+ import { useState, useEffect, useRef, useMemo } from 'react';
6
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
7
+
8
+ function formatPrice(price, currency, pricingModel) {
9
+ if (pricingModel === "FREE" || !price || price === 0) return "Free";
10
+ const curr = currency || "USD";
11
+ try {
12
+ return new Intl.NumberFormat("en-US", {
13
+ style: "currency",
14
+ currency: curr
15
+ }).format(price);
16
+ } catch {
17
+ return `${curr} ${price.toFixed(2)}`;
18
+ }
19
+ }
20
+ function formatDownloads(n) {
21
+ if (!n) return "0";
22
+ if (n >= 1e6) return `${(n / 1e6).toFixed(1)}M`;
23
+ if (n >= 1e3) return `${(n / 1e3).toFixed(1)}K`;
24
+ return n.toString();
25
+ }
26
+ function StarRating({ rating }) {
27
+ return /* @__PURE__ */ jsx("span", { className: "flex items-center gap-0.5", children: [1, 2, 3, 4, 5].map((star) => /* @__PURE__ */ jsx(
28
+ "svg",
29
+ {
30
+ viewBox: "0 0 12 12",
31
+ className: `w-3 h-3 ${star <= Math.round(rating) ? "text-amber-400 fill-current" : "text-muted-foreground/30 fill-current"}`,
32
+ children: /* @__PURE__ */ jsx("path", { d: "M6 1l1.545 3.09L11 4.59l-2.5 2.41.59 3.41L6 8.79l-3.09 1.61L3.5 7 1 4.59l3.455-.5L6 1z" })
33
+ },
34
+ star
35
+ )) });
36
+ }
37
+ function TypeBadge({ type }) {
38
+ const labels = {
39
+ APP: "App",
40
+ NODE: "Node",
41
+ WORKFLOW: "Workflow",
42
+ TEMPLATE: "Template",
43
+ INTEGRATION: "Integration",
44
+ EXTENSION: "Extension",
45
+ THEME: "Theme"
46
+ };
47
+ return /* @__PURE__ */ jsx("span", { className: "inline-block text-xs px-2 py-0.5 rounded-full bg-primary/10 text-foreground font-medium", children: labels[type] ?? type });
48
+ }
49
+ function ProductCard({ product, onClick, href }) {
50
+ const priceLabel = formatPrice(
51
+ product.price,
52
+ product.currency,
53
+ product.pricingModel
54
+ );
55
+ const inner = /* @__PURE__ */ jsxs("div", { className: "group bg-card border border-border rounded-xl p-4 flex flex-col gap-3 transition-all duration-200 hover:shadow-md hover:border-primary/30 cursor-pointer h-full", children: [
56
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-2", children: [
57
+ /* @__PURE__ */ jsx("div", { className: "w-12 h-12 rounded-lg bg-muted flex-shrink-0 overflow-hidden", children: product.icon ? /* @__PURE__ */ jsx(
58
+ "img",
59
+ {
60
+ src: product.icon,
61
+ alt: "",
62
+ "aria-hidden": "true",
63
+ className: "w-full h-full object-cover"
64
+ }
65
+ ) : /* @__PURE__ */ jsx("div", { className: "w-full h-full flex items-center justify-center bg-gradient-to-br from-primary/15 to-primary/5", children: /* @__PURE__ */ jsxs(
66
+ "svg",
67
+ {
68
+ viewBox: "0 0 32 32",
69
+ className: "w-8 h-8",
70
+ fill: "none",
71
+ xmlns: "http://www.w3.org/2000/svg",
72
+ "aria-hidden": "true",
73
+ children: [
74
+ /* @__PURE__ */ jsx(
75
+ "polygon",
76
+ {
77
+ points: "16,4 28,10 16,16 4,10",
78
+ className: "fill-primary/30",
79
+ stroke: "currentColor",
80
+ strokeWidth: "0.6",
81
+ strokeOpacity: "0.35"
82
+ }
83
+ ),
84
+ /* @__PURE__ */ jsx(
85
+ "polygon",
86
+ {
87
+ points: "4,10 16,16 16,28 4,22",
88
+ className: "fill-primary/15",
89
+ stroke: "currentColor",
90
+ strokeWidth: "0.6",
91
+ strokeOpacity: "0.35"
92
+ }
93
+ ),
94
+ /* @__PURE__ */ jsx(
95
+ "polygon",
96
+ {
97
+ points: "28,10 16,16 16,28 28,22",
98
+ className: "fill-primary/20",
99
+ stroke: "currentColor",
100
+ strokeWidth: "0.6",
101
+ strokeOpacity: "0.35"
102
+ }
103
+ )
104
+ ]
105
+ }
106
+ ) }) }),
107
+ /* @__PURE__ */ jsx(TypeBadge, { type: product.type })
108
+ ] }),
109
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
110
+ /* @__PURE__ */ jsx("h3", { className: "font-semibold text-foreground text-sm leading-snug line-clamp-1 group-hover:text-primary transition-colors", children: product.name }),
111
+ product.description && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-xs mt-1 line-clamp-2 leading-relaxed", children: product.description })
112
+ ] }),
113
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2", children: [
114
+ /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1.5", children: product.rating != null && product.rating > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
115
+ /* @__PURE__ */ jsx(StarRating, { rating: product.rating }),
116
+ /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: product.rating.toFixed(1) })
117
+ ] }) : /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: "No reviews yet" }) }),
118
+ /* @__PURE__ */ jsx(
119
+ "span",
120
+ {
121
+ className: `text-xs font-semibold ${priceLabel === "Free" ? "text-emerald-700 dark:text-emerald-400" : "text-foreground"}`,
122
+ children: priceLabel
123
+ }
124
+ )
125
+ ] })
126
+ ] });
127
+ if (href) {
128
+ return /* @__PURE__ */ jsx("a", { href, onClick, className: "block h-full no-underline", children: inner });
129
+ }
130
+ return /* @__PURE__ */ jsx(
131
+ "button",
132
+ {
133
+ type: "button",
134
+ onClick,
135
+ className: "block w-full text-left h-full",
136
+ children: inner
137
+ }
138
+ );
139
+ }
140
+
141
+ // src/store/queries.ts
142
+ var STORE_PRODUCT_FIELDS = `
143
+ fragment StoreProductFields on StoreProduct {
144
+ id name slug type subType nature status pricingModel
145
+ price currency description icon bannerUrl screenshots
146
+ category tags featured downloads viewCount rating reviewCount
147
+ publisherId authorName license compatibleProducts
148
+ }
149
+ `;
150
+ var HOME_GROUPED_PRODUCTS_QUERY = `
151
+ ${STORE_PRODUCT_FIELDS}
152
+ query HomeGroupedProducts($compatibleWith: String) {
153
+ homeGroupedProducts(compatibleWith: $compatibleWith) {
154
+ featured { ...StoreProductFields }
155
+ mostDownloaded { ...StoreProductFields }
156
+ recentlyAdded { ...StoreProductFields }
157
+ freeItems { ...StoreProductFields }
158
+ }
159
+ }
160
+ `;
161
+ var BROWSE_STORE_QUERY = `
162
+ ${STORE_PRODUCT_FIELDS}
163
+ query BrowseStore($input: BrowseStoreInput!) {
164
+ browseStore(input: $input) {
165
+ products { ...StoreProductFields }
166
+ totalCount
167
+ hasMore
168
+ nextCursor
169
+ facets {
170
+ types { value count }
171
+ categories { value count }
172
+ pricingModels { value count }
173
+ priceRange { min max }
174
+ }
175
+ }
176
+ }
177
+ `;
178
+ var STORE_PRODUCT_DETAILS_QUERY = `
179
+ ${STORE_PRODUCT_FIELDS}
180
+ query StoreProductDetails($input: StoreProductDetailsInput!) {
181
+ storeProductDetails(input: $input) {
182
+ product { ...StoreProductFields longDescription videoUrls minPlatformVersion }
183
+ publisher { id name email websiteUrl logoUrl bio isVerified tier }
184
+ reviews { id rating title comment verifiedPurchase helpful createdAt }
185
+ reviewsCount
186
+ relatedProducts { ...StoreProductFields }
187
+ ratingDistribution { fiveStars fourStars threeStars twoStars oneStar }
188
+ }
189
+ }
190
+ `;
191
+ var CATEGORIES_QUERY = `
192
+ query Categories {
193
+ categories {
194
+ id name slug description icon parentId
195
+ }
196
+ }
197
+ `;
198
+ function dedupAcross(lists) {
199
+ const seen = /* @__PURE__ */ new Set();
200
+ return lists.map((list) => {
201
+ const out = [];
202
+ for (const p of list) {
203
+ if (!seen.has(p.id)) {
204
+ seen.add(p.id);
205
+ out.push(p);
206
+ }
207
+ }
208
+ return out;
209
+ });
210
+ }
211
+ function FeaturedHeroCard({
212
+ product,
213
+ onNavigate
214
+ }) {
215
+ const priceLabel = formatPrice(
216
+ product.price,
217
+ product.currency,
218
+ product.pricingModel
219
+ );
220
+ return /* @__PURE__ */ jsxs(
221
+ "button",
222
+ {
223
+ type: "button",
224
+ onClick: () => onNavigate(`/store/${product.slug}`),
225
+ className: "group w-full text-left h-full rounded-2xl border border-border bg-card overflow-hidden hover:border-primary/40 transition-all duration-300 hover:shadow-xl hover:shadow-primary/10 flex flex-col",
226
+ children: [
227
+ /* @__PURE__ */ jsxs("div", { className: "relative h-44 sm:h-52 bg-gradient-to-br from-primary/20 via-primary/8 to-background overflow-hidden flex-shrink-0", children: [
228
+ product.bannerUrl ? /* @__PURE__ */ jsx(
229
+ "img",
230
+ {
231
+ src: product.bannerUrl,
232
+ alt: "",
233
+ "aria-hidden": "true",
234
+ className: "w-full h-full object-cover"
235
+ }
236
+ ) : /* @__PURE__ */ jsxs(Fragment, { children: [
237
+ /* @__PURE__ */ jsxs(
238
+ "svg",
239
+ {
240
+ className: "absolute inset-0 w-full h-full opacity-[0.07]",
241
+ xmlns: "http://www.w3.org/2000/svg",
242
+ "aria-hidden": "true",
243
+ children: [
244
+ /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx(
245
+ "pattern",
246
+ {
247
+ id: "fg-hero-grid",
248
+ width: "36",
249
+ height: "36",
250
+ patternUnits: "userSpaceOnUse",
251
+ children: /* @__PURE__ */ jsx(
252
+ "path",
253
+ {
254
+ d: "M 36 0 L 0 0 0 36",
255
+ fill: "none",
256
+ stroke: "currentColor",
257
+ strokeWidth: "1"
258
+ }
259
+ )
260
+ }
261
+ ) }),
262
+ /* @__PURE__ */ jsx("rect", { width: "100%", height: "100%", fill: "url(#fg-hero-grid)" })
263
+ ]
264
+ }
265
+ ),
266
+ /* @__PURE__ */ jsx(
267
+ "div",
268
+ {
269
+ className: "absolute inset-0 flex items-center justify-center",
270
+ "aria-hidden": "true",
271
+ children: /* @__PURE__ */ jsxs(
272
+ "svg",
273
+ {
274
+ viewBox: "0 0 64 64",
275
+ className: "w-20 h-20 opacity-25",
276
+ fill: "none",
277
+ xmlns: "http://www.w3.org/2000/svg",
278
+ children: [
279
+ /* @__PURE__ */ jsx(
280
+ "polygon",
281
+ {
282
+ points: "32,8 56,20 32,32 8,20",
283
+ className: "fill-primary/40",
284
+ stroke: "currentColor",
285
+ strokeWidth: "1",
286
+ strokeOpacity: "0.5"
287
+ }
288
+ ),
289
+ /* @__PURE__ */ jsx(
290
+ "polygon",
291
+ {
292
+ points: "8,20 32,32 32,56 8,44",
293
+ className: "fill-primary/20",
294
+ stroke: "currentColor",
295
+ strokeWidth: "1",
296
+ strokeOpacity: "0.5"
297
+ }
298
+ ),
299
+ /* @__PURE__ */ jsx(
300
+ "polygon",
301
+ {
302
+ points: "56,20 32,32 32,56 56,44",
303
+ className: "fill-primary/30",
304
+ stroke: "currentColor",
305
+ strokeWidth: "1",
306
+ strokeOpacity: "0.5"
307
+ }
308
+ )
309
+ ]
310
+ }
311
+ )
312
+ }
313
+ )
314
+ ] }),
315
+ /* @__PURE__ */ jsx("span", { className: "absolute top-3 left-3 text-xs font-semibold px-2.5 py-1 rounded-full border border-primary/30 bg-primary/10 text-foreground shadow-sm", children: "Featured" }),
316
+ /* @__PURE__ */ jsx("div", { className: "absolute bottom-4 left-4 w-14 h-14 rounded-xl shadow-lg overflow-hidden border-2 border-background", children: product.icon ? /* @__PURE__ */ jsx(
317
+ "img",
318
+ {
319
+ src: product.icon,
320
+ alt: "",
321
+ "aria-hidden": "true",
322
+ className: "w-full h-full object-cover"
323
+ }
324
+ ) : /* @__PURE__ */ jsx("div", { className: "w-full h-full bg-gradient-to-br from-primary/25 to-primary/10 flex items-center justify-center", children: /* @__PURE__ */ jsxs(
325
+ "svg",
326
+ {
327
+ viewBox: "0 0 32 32",
328
+ className: "w-8 h-8",
329
+ fill: "none",
330
+ xmlns: "http://www.w3.org/2000/svg",
331
+ "aria-hidden": "true",
332
+ children: [
333
+ /* @__PURE__ */ jsx(
334
+ "polygon",
335
+ {
336
+ points: "16,4 28,10 16,16 4,10",
337
+ className: "fill-primary/40",
338
+ stroke: "currentColor",
339
+ strokeWidth: "0.6",
340
+ strokeOpacity: "0.4"
341
+ }
342
+ ),
343
+ /* @__PURE__ */ jsx(
344
+ "polygon",
345
+ {
346
+ points: "4,10 16,16 16,28 4,22",
347
+ className: "fill-primary/20",
348
+ stroke: "currentColor",
349
+ strokeWidth: "0.6",
350
+ strokeOpacity: "0.4"
351
+ }
352
+ ),
353
+ /* @__PURE__ */ jsx(
354
+ "polygon",
355
+ {
356
+ points: "28,10 16,16 16,28 28,22",
357
+ className: "fill-primary/30",
358
+ stroke: "currentColor",
359
+ strokeWidth: "0.6",
360
+ strokeOpacity: "0.4"
361
+ }
362
+ )
363
+ ]
364
+ }
365
+ ) }) })
366
+ ] }),
367
+ /* @__PURE__ */ jsxs("div", { className: "p-5 flex flex-col flex-1", children: [
368
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-3 mb-2", children: [
369
+ /* @__PURE__ */ jsx("h3", { className: "text-base font-bold text-foreground group-hover:text-primary transition-colors line-clamp-1", children: product.name }),
370
+ /* @__PURE__ */ jsx(
371
+ "span",
372
+ {
373
+ className: `text-sm font-bold flex-shrink-0 ${priceLabel === "Free" ? "text-emerald-700 dark:text-emerald-400" : "text-foreground"}`,
374
+ children: priceLabel
375
+ }
376
+ )
377
+ ] }),
378
+ product.description && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground line-clamp-2 leading-relaxed flex-1", children: product.description }),
379
+ /* @__PURE__ */ jsxs("div", { className: "mt-3 flex items-center gap-2", children: [
380
+ /* @__PURE__ */ jsx("span", { className: "text-xs px-2 py-0.5 rounded-full bg-primary/10 text-primary font-medium", children: product.type }),
381
+ product.authorName && /* @__PURE__ */ jsxs("span", { className: "text-xs text-muted-foreground truncate", children: [
382
+ "by ",
383
+ product.authorName
384
+ ] })
385
+ ] })
386
+ ] })
387
+ ]
388
+ }
389
+ );
390
+ }
391
+ function ScrollRow({
392
+ products,
393
+ onProductClick
394
+ }) {
395
+ const ref = useRef(null);
396
+ function scroll(dir) {
397
+ ref.current?.scrollBy({
398
+ left: dir === "r" ? 272 : -272,
399
+ behavior: "smooth"
400
+ });
401
+ }
402
+ return /* @__PURE__ */ jsxs("div", { className: "relative group/row", children: [
403
+ /* @__PURE__ */ jsx(
404
+ "button",
405
+ {
406
+ type: "button",
407
+ onClick: () => scroll("l"),
408
+ "aria-label": "Scroll left",
409
+ className: "absolute left-0 top-1/2 -translate-y-1/2 -translate-x-4 z-10 w-8 h-8 rounded-full bg-background border border-border shadow-md items-center justify-center text-muted-foreground hover:text-primary hover:border-primary/40 transition-all hidden sm:flex opacity-0 group-hover/row:opacity-100",
410
+ children: /* @__PURE__ */ jsx(
411
+ "svg",
412
+ {
413
+ viewBox: "0 0 16 16",
414
+ className: "w-4 h-4",
415
+ fill: "none",
416
+ stroke: "currentColor",
417
+ strokeWidth: "1.5",
418
+ strokeLinecap: "round",
419
+ strokeLinejoin: "round",
420
+ children: /* @__PURE__ */ jsx("path", { d: "M10 3L6 8l4 5" })
421
+ }
422
+ )
423
+ }
424
+ ),
425
+ /* @__PURE__ */ jsx(
426
+ "div",
427
+ {
428
+ ref,
429
+ className: "flex gap-3 overflow-x-auto pb-1 snap-x snap-mandatory",
430
+ style: { scrollbarWidth: "none", msOverflowStyle: "none" },
431
+ children: products.map((product) => /* @__PURE__ */ jsx("div", { className: "flex-shrink-0 w-56 snap-start", children: /* @__PURE__ */ jsx(
432
+ ProductCard,
433
+ {
434
+ product,
435
+ onClick: () => onProductClick(product)
436
+ }
437
+ ) }, product.id))
438
+ }
439
+ ),
440
+ /* @__PURE__ */ jsx(
441
+ "button",
442
+ {
443
+ type: "button",
444
+ onClick: () => scroll("r"),
445
+ "aria-label": "Scroll right",
446
+ className: "absolute right-0 top-1/2 -translate-y-1/2 translate-x-4 z-10 w-8 h-8 rounded-full bg-background border border-border shadow-md items-center justify-center text-muted-foreground hover:text-primary hover:border-primary/40 transition-all hidden sm:flex opacity-0 group-hover/row:opacity-100",
447
+ children: /* @__PURE__ */ jsx(
448
+ "svg",
449
+ {
450
+ viewBox: "0 0 16 16",
451
+ className: "w-4 h-4",
452
+ fill: "none",
453
+ stroke: "currentColor",
454
+ strokeWidth: "1.5",
455
+ strokeLinecap: "round",
456
+ strokeLinejoin: "round",
457
+ children: /* @__PURE__ */ jsx("path", { d: "M6 3l4 5-4 5" })
458
+ }
459
+ )
460
+ }
461
+ )
462
+ ] });
463
+ }
464
+ function SectionHead({
465
+ title,
466
+ hint,
467
+ browseHref,
468
+ onNavigate
469
+ }) {
470
+ return /* @__PURE__ */ jsxs("div", { className: "flex items-end justify-between mb-5 gap-4", children: [
471
+ /* @__PURE__ */ jsxs("div", { children: [
472
+ /* @__PURE__ */ jsx("h2", { className: "text-xl font-bold text-foreground", children: title }),
473
+ hint && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mt-0.5", children: hint })
474
+ ] }),
475
+ /* @__PURE__ */ jsx(
476
+ "button",
477
+ {
478
+ type: "button",
479
+ onClick: () => onNavigate(browseHref),
480
+ className: "text-sm text-primary hover:underline font-medium flex-shrink-0 underline-offset-2",
481
+ children: "See all \u2192"
482
+ }
483
+ )
484
+ ] });
485
+ }
486
+ var DEFAULT_TYPE_FILTERS = [
487
+ { type: "NODE", label: "Nodes" },
488
+ { type: "WORKFLOW", label: "Workflows" },
489
+ { type: "TEMPLATE", label: "Templates" },
490
+ { type: "INTEGRATION", label: "Integrations" },
491
+ { type: "APP", label: "Apps" },
492
+ { type: "EXTENSION", label: "Extensions" }
493
+ ];
494
+ function TypeFilters({
495
+ browsePath,
496
+ onNavigate,
497
+ typeFilters
498
+ }) {
499
+ return /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2 justify-center", children: typeFilters.map((f) => /* @__PURE__ */ jsx(
500
+ "button",
501
+ {
502
+ type: "button",
503
+ onClick: () => onNavigate(`${browsePath}?type=${f.type}`),
504
+ className: "px-4 py-1.5 rounded-full border border-border bg-background text-sm text-foreground hover:border-primary/50 hover:bg-primary/5 hover:text-primary transition-all duration-200",
505
+ children: f.label
506
+ },
507
+ f.type
508
+ )) });
509
+ }
510
+ function HeroCardSkeleton() {
511
+ return /* @__PURE__ */ jsxs("div", { className: "rounded-2xl border border-border bg-card overflow-hidden animate-pulse h-full", children: [
512
+ /* @__PURE__ */ jsx("div", { className: "h-44 sm:h-52 bg-muted" }),
513
+ /* @__PURE__ */ jsxs("div", { className: "p-5 space-y-3", children: [
514
+ /* @__PURE__ */ jsx("div", { className: "h-5 bg-muted rounded w-1/2" }),
515
+ /* @__PURE__ */ jsx("div", { className: "h-3 bg-muted rounded w-3/4" }),
516
+ /* @__PURE__ */ jsx("div", { className: "h-3 bg-muted rounded w-5/6" }),
517
+ /* @__PURE__ */ jsx("div", { className: "h-5 bg-muted rounded w-16 mt-2" })
518
+ ] })
519
+ ] });
520
+ }
521
+ function GridCardSkeleton() {
522
+ return /* @__PURE__ */ jsxs("div", { className: "rounded-xl border border-border bg-card p-4 h-36 animate-pulse", children: [
523
+ /* @__PURE__ */ jsxs("div", { className: "flex gap-3 mb-3", children: [
524
+ /* @__PURE__ */ jsx("div", { className: "w-12 h-12 rounded-lg bg-muted flex-shrink-0" }),
525
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 space-y-2 pt-1", children: [
526
+ /* @__PURE__ */ jsx("div", { className: "h-3 bg-muted rounded w-3/4" }),
527
+ /* @__PURE__ */ jsx("div", { className: "h-3 bg-muted rounded w-1/2" })
528
+ ] })
529
+ ] }),
530
+ /* @__PURE__ */ jsx("div", { className: "h-3 bg-muted rounded w-full mb-2" }),
531
+ /* @__PURE__ */ jsx("div", { className: "h-3 bg-muted rounded w-5/6" })
532
+ ] });
533
+ }
534
+ function ScrollCardSkeleton() {
535
+ return /* @__PURE__ */ jsxs("div", { className: "flex-shrink-0 w-56 rounded-xl border border-border bg-card p-4 h-36 animate-pulse", children: [
536
+ /* @__PURE__ */ jsxs("div", { className: "flex gap-3 mb-3", children: [
537
+ /* @__PURE__ */ jsx("div", { className: "w-12 h-12 rounded-lg bg-muted flex-shrink-0" }),
538
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 space-y-2 pt-1", children: [
539
+ /* @__PURE__ */ jsx("div", { className: "h-3 bg-muted rounded w-3/4" }),
540
+ /* @__PURE__ */ jsx("div", { className: "h-3 bg-muted rounded w-1/2" })
541
+ ] })
542
+ ] }),
543
+ /* @__PURE__ */ jsx("div", { className: "h-3 bg-muted rounded w-full mb-2" }),
544
+ /* @__PURE__ */ jsx("div", { className: "h-3 bg-muted rounded w-5/6" })
545
+ ] });
546
+ }
547
+ function StoreHomePage({
548
+ compatibleWith,
549
+ appLoginUrl,
550
+ onNavigate,
551
+ terminology,
552
+ productName,
553
+ heroTitle,
554
+ heroSubtitle,
555
+ browsePath = "/store/browse",
556
+ seoTitle,
557
+ seoDescription,
558
+ seoKeywords
559
+ }) {
560
+ const client = useWebSDK();
561
+ const [grouped, setGrouped] = useState(null);
562
+ const [loading, setLoading] = useState(true);
563
+ const [error, setError] = useState(null);
564
+ const [retryKey, setRetryKey] = useState(0);
565
+ useEffect(() => {
566
+ let cancelled = false;
567
+ let autoRetryTimer = null;
568
+ async function load() {
569
+ setLoading(true);
570
+ try {
571
+ const res = await client.query(
572
+ HOME_GROUPED_PRODUCTS_QUERY,
573
+ { compatibleWith: compatibleWith ?? null }
574
+ );
575
+ if (cancelled) return;
576
+ if (res.errors?.length) throw new Error(res.errors[0].message);
577
+ if (!res.data?.homeGroupedProducts) throw new Error("No data");
578
+ setGrouped(res.data.homeGroupedProducts);
579
+ setError(null);
580
+ } catch {
581
+ if (!cancelled) {
582
+ if (retryKey < 1) {
583
+ autoRetryTimer = setTimeout(() => {
584
+ if (!cancelled) setRetryKey(1);
585
+ }, 2e3);
586
+ } else {
587
+ setError("Failed to load store. Please try again.");
588
+ }
589
+ }
590
+ } finally {
591
+ if (!cancelled) setLoading(false);
592
+ }
593
+ }
594
+ load();
595
+ return () => {
596
+ cancelled = true;
597
+ if (autoRetryTimer) clearTimeout(autoRetryTimer);
598
+ };
599
+ }, [client, compatibleWith, retryKey]);
600
+ function navigate(path) {
601
+ if (onNavigate) {
602
+ onNavigate(path);
603
+ return;
604
+ }
605
+ window.location.href = path;
606
+ }
607
+ function handleProductClick(product) {
608
+ navigate(`/store/${product.slug}`);
609
+ }
610
+ const deduped = grouped ? dedupAcross([grouped.featured, grouped.mostDownloaded, grouped.freeItems]) : [[], [], []];
611
+ const featuredItems = deduped[0] ?? [];
612
+ const popularItems = deduped[1] ?? [];
613
+ const freeItems = deduped[2] ?? [];
614
+ const hasNoItems = !loading && !error && featuredItems.length === 0 && popularItems.length === 0 && freeItems.length === 0;
615
+ const resolvedTitle = heroTitle ?? `${productName ? `${productName} ` : ""}Store`;
616
+ const resolvedSubtitle = heroSubtitle ?? "Discover workflows, nodes, integrations, and templates built by the community.";
617
+ const typeFilters = terminology?.typeFilters ?? DEFAULT_TYPE_FILTERS;
618
+ const searchPlaceholder = terminology?.searchPlaceholder ?? "Search nodes, workflows, templates\u2026";
619
+ const emptyStateDescription = terminology?.emptyStateDescription ?? "As the community ships workflows, templates, and integrations, they will show up right here.";
620
+ const publisherCtaDescription = terminology?.publisherCtaDescription ?? `Share your workflows, nodes, and integrations with ${productName ? "the " : ""}community. Earn from your work or contribute for free.`;
621
+ return /* @__PURE__ */ jsxs("div", { className: "w-full", children: [
622
+ /* @__PURE__ */ jsx(
623
+ PageHead,
624
+ {
625
+ title: seoTitle ?? `Store${productName ? ` \u2013 ${productName}` : ""}`,
626
+ description: seoDescription ?? resolvedSubtitle,
627
+ keywords: seoKeywords,
628
+ productName
629
+ }
630
+ ),
631
+ /* @__PURE__ */ jsxs("section", { className: "relative overflow-hidden pt-14 pb-12 sm:pt-20 sm:pb-16", children: [
632
+ /* @__PURE__ */ jsx(
633
+ "div",
634
+ {
635
+ className: "absolute inset-0 bg-gradient-to-b from-background via-primary/[0.06] to-background pointer-events-none",
636
+ "aria-hidden": "true"
637
+ }
638
+ ),
639
+ /* @__PURE__ */ jsxs(
640
+ "svg",
641
+ {
642
+ className: "absolute inset-0 w-full h-full opacity-[0.035] pointer-events-none",
643
+ xmlns: "http://www.w3.org/2000/svg",
644
+ "aria-hidden": "true",
645
+ children: [
646
+ /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx(
647
+ "pattern",
648
+ {
649
+ id: "store-home-grid",
650
+ width: "40",
651
+ height: "40",
652
+ patternUnits: "userSpaceOnUse",
653
+ children: /* @__PURE__ */ jsx(
654
+ "path",
655
+ {
656
+ d: "M 40 0 L 0 0 0 40",
657
+ fill: "none",
658
+ stroke: "currentColor",
659
+ strokeWidth: "1"
660
+ }
661
+ )
662
+ }
663
+ ) }),
664
+ /* @__PURE__ */ jsx("rect", { width: "100%", height: "100%", fill: "url(#store-home-grid)" })
665
+ ]
666
+ }
667
+ ),
668
+ /* @__PURE__ */ jsx(
669
+ "div",
670
+ {
671
+ className: "absolute -top-16 left-1/3 w-80 h-80 rounded-full bg-primary/10 blur-3xl pointer-events-none",
672
+ "aria-hidden": "true"
673
+ }
674
+ ),
675
+ /* @__PURE__ */ jsx(
676
+ "div",
677
+ {
678
+ className: "absolute top-8 right-1/4 w-56 h-56 rounded-full bg-primary/8 blur-2xl pointer-events-none",
679
+ "aria-hidden": "true"
680
+ }
681
+ ),
682
+ /* @__PURE__ */ jsxs("div", { className: "relative max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 text-center", children: [
683
+ /* @__PURE__ */ jsxs("div", { className: "inline-flex items-center gap-2 px-3 py-1 rounded-full border border-primary/30 bg-primary/10 text-xs font-semibold text-foreground mb-5", children: [
684
+ /* @__PURE__ */ jsx(
685
+ "span",
686
+ {
687
+ className: "w-1.5 h-1.5 rounded-full bg-primary flex-shrink-0",
688
+ "aria-hidden": "true"
689
+ }
690
+ ),
691
+ "Community Marketplace"
692
+ ] }),
693
+ /* @__PURE__ */ jsx("h1", { className: "text-4xl sm:text-5xl md:text-6xl font-extrabold tracking-tight text-foreground mb-4 leading-[1.08]", children: resolvedTitle }),
694
+ /* @__PURE__ */ jsx("p", { className: "text-lg text-muted-foreground max-w-2xl mx-auto mb-8 leading-relaxed", children: resolvedSubtitle }),
695
+ /* @__PURE__ */ jsxs(
696
+ "form",
697
+ {
698
+ className: "max-w-xl mx-auto flex gap-2 mb-7",
699
+ onSubmit: (e) => {
700
+ e.preventDefault();
701
+ const q = new FormData(e.currentTarget).get("q");
702
+ navigate(
703
+ q.trim() ? `${browsePath}?q=${encodeURIComponent(q.trim())}` : browsePath
704
+ );
705
+ },
706
+ children: [
707
+ /* @__PURE__ */ jsx(
708
+ "input",
709
+ {
710
+ name: "q",
711
+ type: "search",
712
+ placeholder: searchPlaceholder,
713
+ className: "flex-1 h-12 rounded-xl border border-border bg-background px-4 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/40 shadow-sm"
714
+ }
715
+ ),
716
+ /* @__PURE__ */ jsx(
717
+ "button",
718
+ {
719
+ type: "submit",
720
+ className: "h-12 px-6 rounded-xl bg-primary text-primary-foreground text-sm font-semibold hover:opacity-90 transition-opacity shadow-sm",
721
+ children: "Search"
722
+ }
723
+ )
724
+ ]
725
+ }
726
+ ),
727
+ /* @__PURE__ */ jsx(
728
+ TypeFilters,
729
+ {
730
+ browsePath,
731
+ onNavigate: navigate,
732
+ typeFilters
733
+ }
734
+ )
735
+ ] })
736
+ ] }),
737
+ /* @__PURE__ */ jsxs("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 pb-20 space-y-14 pt-4", children: [
738
+ (loading || error || featuredItems.length > 0) && /* @__PURE__ */ jsxs("section", { children: [
739
+ /* @__PURE__ */ jsx(
740
+ SectionHead,
741
+ {
742
+ title: "Featured",
743
+ hint: "Hand-picked highlights from the community",
744
+ browseHref: `${browsePath}?featured=true`,
745
+ onNavigate: navigate
746
+ }
747
+ ),
748
+ loading ? /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 lg:grid-cols-[1fr_2fr] gap-4 items-start", children: [
749
+ /* @__PURE__ */ jsx(HeroCardSkeleton, {}),
750
+ /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [...Array(4)].map((_, i) => /* @__PURE__ */ jsx(GridCardSkeleton, {}, i)) })
751
+ ] }) : error ? /* @__PURE__ */ jsxs("div", { className: "py-16 text-center", children: [
752
+ /* @__PURE__ */ jsx("p", { className: "text-muted-foreground mb-4", children: error }),
753
+ /* @__PURE__ */ jsx(
754
+ "button",
755
+ {
756
+ type: "button",
757
+ onClick: () => setRetryKey((k) => k + 1),
758
+ className: "text-sm text-primary hover:underline",
759
+ children: "Retry"
760
+ }
761
+ )
762
+ ] }) : featuredItems.length > 0 ? /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 lg:grid-cols-[1fr_2fr] gap-4 items-start", children: [
763
+ /* @__PURE__ */ jsx(
764
+ FeaturedHeroCard,
765
+ {
766
+ product: featuredItems[0],
767
+ onNavigate: navigate
768
+ }
769
+ ),
770
+ /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: featuredItems.slice(1, 5).map((product) => /* @__PURE__ */ jsx(
771
+ ProductCard,
772
+ {
773
+ product,
774
+ onClick: () => handleProductClick(product)
775
+ },
776
+ product.id
777
+ )) })
778
+ ] }) : null
779
+ ] }),
780
+ (loading || popularItems.length > 0) && /* @__PURE__ */ jsxs("section", { children: [
781
+ /* @__PURE__ */ jsx(
782
+ SectionHead,
783
+ {
784
+ title: "Most Popular",
785
+ hint: "Top downloads across the community",
786
+ browseHref: `${browsePath}?sortBy=DOWNLOADS`,
787
+ onNavigate: navigate
788
+ }
789
+ ),
790
+ loading ? /* @__PURE__ */ jsx("div", { className: "flex gap-3 overflow-hidden", children: [...Array(5)].map((_, i) => /* @__PURE__ */ jsx(ScrollCardSkeleton, {}, i)) }) : /* @__PURE__ */ jsx(
791
+ ScrollRow,
792
+ {
793
+ products: popularItems,
794
+ onProductClick: handleProductClick
795
+ }
796
+ )
797
+ ] }),
798
+ (loading || freeItems.length > 0) && /* @__PURE__ */ jsxs("section", { children: [
799
+ /* @__PURE__ */ jsx(
800
+ SectionHead,
801
+ {
802
+ title: "Free to Use",
803
+ hint: "Zero cost, full power \u2014 community-contributed freebies",
804
+ browseHref: `${browsePath}?pricingModel=FREE`,
805
+ onNavigate: navigate
806
+ }
807
+ ),
808
+ loading ? /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4", children: [...Array(6)].map((_, i) => /* @__PURE__ */ jsx(GridCardSkeleton, {}, i)) }) : /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4", children: freeItems.slice(0, 6).map((product) => /* @__PURE__ */ jsx(
809
+ ProductCard,
810
+ {
811
+ product,
812
+ onClick: () => handleProductClick(product)
813
+ },
814
+ product.id
815
+ )) })
816
+ ] }),
817
+ hasNoItems && /* @__PURE__ */ jsxs(
818
+ "section",
819
+ {
820
+ "data-store": "empty-state",
821
+ className: "rounded-2xl border border-border bg-card/50 px-6 py-14 sm:py-16 text-center",
822
+ children: [
823
+ /* @__PURE__ */ jsx(
824
+ "div",
825
+ {
826
+ className: "mx-auto mb-5 flex h-14 w-14 items-center justify-center rounded-2xl bg-primary/10",
827
+ "aria-hidden": "true",
828
+ children: /* @__PURE__ */ jsx(
829
+ "svg",
830
+ {
831
+ viewBox: "0 0 24 24",
832
+ fill: "none",
833
+ stroke: "currentColor",
834
+ strokeWidth: "1.5",
835
+ className: "h-7 w-7 text-primary",
836
+ children: /* @__PURE__ */ jsx(
837
+ "path",
838
+ {
839
+ strokeLinecap: "round",
840
+ strokeLinejoin: "round",
841
+ d: "M3.75 9h16.5M4.5 9l1.2 9.3a1.5 1.5 0 0 0 1.49 1.2h9.62a1.5 1.5 0 0 0 1.49-1.2L19.5 9M8.25 9V6.75a3.75 3.75 0 0 1 7.5 0V9"
842
+ }
843
+ )
844
+ }
845
+ )
846
+ }
847
+ ),
848
+ /* @__PURE__ */ jsxs("h2", { className: "text-xl sm:text-2xl font-bold text-foreground mb-2", children: [
849
+ "The ",
850
+ productName ?? "store",
851
+ " catalogue is just getting started"
852
+ ] }),
853
+ /* @__PURE__ */ jsxs("p", { className: "text-sm sm:text-base text-muted-foreground max-w-xl mx-auto mb-7", children: [
854
+ "No items have been published for ",
855
+ productName ?? "this product",
856
+ " ",
857
+ "yet. ",
858
+ emptyStateDescription
859
+ ] }),
860
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center justify-center gap-3", children: [
861
+ /* @__PURE__ */ jsx(
862
+ "button",
863
+ {
864
+ type: "button",
865
+ onClick: () => navigate(browsePath),
866
+ className: "inline-flex items-center gap-2 rounded-xl bg-primary px-5 py-2.5 text-sm font-semibold text-primary-foreground transition-colors hover:bg-primary/90",
867
+ children: "Browse the full store"
868
+ }
869
+ ),
870
+ /* @__PURE__ */ jsx(
871
+ "a",
872
+ {
873
+ href: appLoginUrl,
874
+ className: "inline-flex items-center gap-2 rounded-xl border border-border px-5 py-2.5 text-sm font-semibold text-foreground transition-colors hover:border-primary/40 hover:text-primary",
875
+ children: "Become a publisher"
876
+ }
877
+ )
878
+ ] })
879
+ ]
880
+ }
881
+ )
882
+ ] }),
883
+ /* @__PURE__ */ jsxs("section", { className: "relative overflow-hidden border-t border-border", children: [
884
+ /* @__PURE__ */ jsx(
885
+ "div",
886
+ {
887
+ className: "absolute inset-0 bg-gradient-to-br from-primary/8 via-background to-primary/5 pointer-events-none",
888
+ "aria-hidden": "true"
889
+ }
890
+ ),
891
+ /* @__PURE__ */ jsx(
892
+ "div",
893
+ {
894
+ className: "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-80 h-40 rounded-full bg-primary/12 blur-3xl pointer-events-none",
895
+ "aria-hidden": "true"
896
+ }
897
+ ),
898
+ /* @__PURE__ */ jsxs("div", { className: "relative max-w-2xl mx-auto px-4 py-16 text-center", children: [
899
+ /* @__PURE__ */ jsxs("div", { className: "inline-flex items-center gap-2 px-3 py-1 rounded-full border border-primary/30 bg-primary/10 text-xs font-semibold text-foreground mb-5", children: [
900
+ /* @__PURE__ */ jsx(
901
+ "span",
902
+ {
903
+ className: "w-1.5 h-1.5 rounded-full bg-primary flex-shrink-0",
904
+ "aria-hidden": "true"
905
+ }
906
+ ),
907
+ "Become a publisher"
908
+ ] }),
909
+ /* @__PURE__ */ jsx("h2", { className: "text-2xl sm:text-3xl font-bold text-foreground mb-3", children: "Built something useful?" }),
910
+ /* @__PURE__ */ jsx("p", { className: "text-muted-foreground mb-8 max-w-lg mx-auto leading-relaxed", children: publisherCtaDescription }),
911
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col sm:flex-row gap-3 justify-center", children: [
912
+ /* @__PURE__ */ jsx(
913
+ "a",
914
+ {
915
+ href: appLoginUrl,
916
+ target: "_blank",
917
+ rel: "noopener noreferrer",
918
+ className: "inline-flex items-center justify-center h-11 px-7 rounded-lg bg-primary text-primary-foreground text-sm font-semibold hover:opacity-90 transition-opacity",
919
+ children: "Submit to Store"
920
+ }
921
+ ),
922
+ /* @__PURE__ */ jsx(
923
+ "button",
924
+ {
925
+ type: "button",
926
+ onClick: () => navigate(browsePath),
927
+ className: "inline-flex items-center justify-center h-11 px-7 rounded-lg border border-border bg-background text-sm font-medium text-foreground hover:border-primary/40 hover:bg-primary/5 transition-all",
928
+ children: "Browse the store"
929
+ }
930
+ )
931
+ ] }),
932
+ /* @__PURE__ */ jsxs("p", { className: "mt-4 text-xs text-muted-foreground", children: [
933
+ "By submitting a listing you agree to the",
934
+ " ",
935
+ /* @__PURE__ */ jsx(
936
+ "a",
937
+ {
938
+ href: "https://burdenoff.com/developer-agreement",
939
+ target: "_blank",
940
+ rel: "noopener noreferrer",
941
+ className: "underline hover:text-foreground",
942
+ children: "Marketplace & Developer Agreement"
943
+ }
944
+ ),
945
+ "."
946
+ ] })
947
+ ] })
948
+ ] })
949
+ ] });
950
+ }
951
+ var SORT_OPTIONS = [
952
+ { value: "RELEVANCE", label: "Relevance" },
953
+ { value: "NEWEST", label: "Newest" },
954
+ { value: "DOWNLOADS", label: "Most Downloaded" },
955
+ { value: "RATING", label: "Top Rated" },
956
+ { value: "PRICE_LOW", label: "Price: Low to High" },
957
+ { value: "PRICE_HIGH", label: "Price: High to Low" },
958
+ { value: "NAME_ASC", label: "Name A\u2013Z" }
959
+ ];
960
+ var DEFAULT_TYPE_OPTIONS = [
961
+ { type: "APP", label: "Apps" },
962
+ { type: "NODE", label: "Nodes" },
963
+ { type: "WORKFLOW", label: "Workflows" },
964
+ { type: "TEMPLATE", label: "Templates" },
965
+ { type: "INTEGRATION", label: "Integrations" },
966
+ { type: "EXTENSION", label: "Extensions" },
967
+ { type: "THEME", label: "Themes" }
968
+ ];
969
+ function buildTypeOptions(typeFilters) {
970
+ return [{ type: "", label: "All types" }, ...typeFilters];
971
+ }
972
+ var PRICING_OPTIONS = [
973
+ { value: "", label: "All pricing" },
974
+ { value: "FREE", label: "Free" },
975
+ { value: "ONE_TIME", label: "Paid (one-time)" },
976
+ { value: "SUBSCRIPTION", label: "Subscription" }
977
+ ];
978
+ function parseUrlParams() {
979
+ if (typeof window === "undefined")
980
+ return {
981
+ q: "",
982
+ type: "",
983
+ pricingModel: "",
984
+ category: "",
985
+ sortBy: "RELEVANCE",
986
+ featured: false
987
+ };
988
+ const p = new URLSearchParams(window.location.search);
989
+ return {
990
+ q: p.get("q") ?? "",
991
+ type: p.get("type") ?? "",
992
+ pricingModel: p.get("pricingModel") ?? "",
993
+ category: p.get("category") ?? "",
994
+ sortBy: p.get("sortBy") ?? (p.get("q") ? "RELEVANCE" : "NEWEST"),
995
+ featured: p.get("featured") === "true"
996
+ };
997
+ }
998
+ function FacetList({
999
+ title,
1000
+ facets,
1001
+ selected,
1002
+ onSelect
1003
+ }) {
1004
+ if (facets.length === 0) return null;
1005
+ return /* @__PURE__ */ jsxs("div", { children: [
1006
+ /* @__PURE__ */ jsx("p", { className: "text-xs font-semibold uppercase tracking-wider text-muted-foreground mb-2", children: title }),
1007
+ /* @__PURE__ */ jsx("ul", { className: "space-y-1", children: facets.map((f) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(
1008
+ "button",
1009
+ {
1010
+ type: "button",
1011
+ onClick: () => onSelect(selected === f.value ? "" : f.value),
1012
+ className: `w-full text-left text-sm px-2 py-1 rounded flex items-center justify-between gap-2 transition-colors ${selected === f.value ? "bg-primary/10 text-primary font-medium" : "text-muted-foreground hover:text-foreground hover:bg-muted/50"}`,
1013
+ children: [
1014
+ /* @__PURE__ */ jsx("span", { className: "truncate", children: f.value }),
1015
+ /* @__PURE__ */ jsx("span", { className: "text-xs flex-shrink-0", children: f.count })
1016
+ ]
1017
+ }
1018
+ ) }, f.value)) })
1019
+ ] });
1020
+ }
1021
+ function StoreBrowsePage({
1022
+ compatibleWith,
1023
+ onNavigate,
1024
+ terminology,
1025
+ productName,
1026
+ seoTitle,
1027
+ seoDescription
1028
+ }) {
1029
+ const client = useWebSDK();
1030
+ const typeFilters = terminology?.typeFilters ?? DEFAULT_TYPE_OPTIONS;
1031
+ const typeOptions = buildTypeOptions(typeFilters);
1032
+ const browseDescription = terminology?.browseDescription ?? "Browse all apps, workflows, nodes, and templates.";
1033
+ const initial = parseUrlParams();
1034
+ const [search, setSearch] = useState(initial.q);
1035
+ const [inputValue, setInputValue] = useState(initial.q);
1036
+ const [type, setType] = useState(initial.type);
1037
+ const [pricingModel, setPricingModel] = useState(initial.pricingModel);
1038
+ const [category, setCategory] = useState(initial.category);
1039
+ const [sortBy, setSortBy] = useState(initial.sortBy);
1040
+ const [featured, setFeatured] = useState(initial.featured);
1041
+ const [offset, setOffset] = useState(0);
1042
+ const [result, setResult] = useState(null);
1043
+ const [allProducts, setAllProducts] = useState(
1044
+ []
1045
+ );
1046
+ const [categories, setCategories] = useState([]);
1047
+ const [loading, setLoading] = useState(true);
1048
+ const [loadingMore, setLoadingMore] = useState(false);
1049
+ const [filtersOpen, setFiltersOpen] = useState(false);
1050
+ const searchRef = useRef(null);
1051
+ const PAGE_SIZE = 24;
1052
+ useEffect(() => {
1053
+ client.query(CATEGORIES_QUERY, {}).then((r) => {
1054
+ if (r.data?.categories) setCategories(r.data.categories);
1055
+ }).catch(() => {
1056
+ });
1057
+ }, [client]);
1058
+ useEffect(() => {
1059
+ let cancelled = false;
1060
+ setOffset(0);
1061
+ setLoading(true);
1062
+ setAllProducts([]);
1063
+ client.query(BROWSE_STORE_QUERY, {
1064
+ input: {
1065
+ filter: {
1066
+ search: search || void 0,
1067
+ type: type || void 0,
1068
+ pricingModel: pricingModel || void 0,
1069
+ category: category || void 0,
1070
+ compatibleWith: compatibleWith ?? void 0,
1071
+ featured: featured || void 0
1072
+ },
1073
+ sortBy,
1074
+ pagination: { limit: PAGE_SIZE, offset: 0 }
1075
+ }
1076
+ }).then((r) => {
1077
+ if (cancelled) return;
1078
+ if (r.data?.browseStore) {
1079
+ setResult(r.data.browseStore);
1080
+ setAllProducts(r.data.browseStore.products);
1081
+ }
1082
+ }).catch(() => {
1083
+ }).finally(() => {
1084
+ if (!cancelled) setLoading(false);
1085
+ });
1086
+ return () => {
1087
+ cancelled = true;
1088
+ };
1089
+ }, [
1090
+ client,
1091
+ search,
1092
+ type,
1093
+ pricingModel,
1094
+ category,
1095
+ sortBy,
1096
+ compatibleWith,
1097
+ featured
1098
+ ]);
1099
+ function loadMore() {
1100
+ const nextOffset = offset + PAGE_SIZE;
1101
+ setLoadingMore(true);
1102
+ client.query(BROWSE_STORE_QUERY, {
1103
+ input: {
1104
+ filter: {
1105
+ search: search || void 0,
1106
+ type: type || void 0,
1107
+ pricingModel: pricingModel || void 0,
1108
+ category: category || void 0,
1109
+ compatibleWith: compatibleWith ?? void 0,
1110
+ featured: featured || void 0
1111
+ },
1112
+ sortBy,
1113
+ pagination: { limit: PAGE_SIZE, offset: nextOffset }
1114
+ }
1115
+ }).then((r) => {
1116
+ if (r.data?.browseStore) {
1117
+ setResult(r.data.browseStore);
1118
+ setAllProducts((prev) => [...prev, ...r.data.browseStore.products]);
1119
+ setOffset(nextOffset);
1120
+ }
1121
+ }).catch(() => {
1122
+ }).finally(() => setLoadingMore(false));
1123
+ }
1124
+ function navigate(path) {
1125
+ if (onNavigate) {
1126
+ onNavigate(path);
1127
+ return;
1128
+ }
1129
+ window.location.href = path;
1130
+ }
1131
+ function handleSearchSubmit(e) {
1132
+ e.preventDefault();
1133
+ setSearch(inputValue);
1134
+ setSortBy(inputValue ? "RELEVANCE" : "NEWEST");
1135
+ }
1136
+ function resetFilters() {
1137
+ setSearch("");
1138
+ setInputValue("");
1139
+ setType("");
1140
+ setPricingModel("");
1141
+ setCategory("");
1142
+ setSortBy("NEWEST");
1143
+ setFeatured(false);
1144
+ searchRef.current?.focus();
1145
+ }
1146
+ const hasActiveFilters = !!(search || type || pricingModel || category || featured);
1147
+ const facetTypes = result?.facets?.types ?? [];
1148
+ const facetCategories = result?.facets?.categories ?? [];
1149
+ const sidebarContent = /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
1150
+ /* @__PURE__ */ jsxs("div", { children: [
1151
+ /* @__PURE__ */ jsx("p", { className: "text-xs font-semibold uppercase tracking-wider text-muted-foreground mb-2", children: "Type" }),
1152
+ /* @__PURE__ */ jsx("div", { className: "space-y-1", children: typeOptions.map((opt) => /* @__PURE__ */ jsx(
1153
+ "button",
1154
+ {
1155
+ type: "button",
1156
+ onClick: () => setType(opt.type),
1157
+ className: `w-full text-left text-sm px-2 py-1.5 rounded transition-colors ${type === opt.type ? "bg-primary/10 text-primary font-medium" : "text-muted-foreground hover:text-foreground hover:bg-muted/50"}`,
1158
+ children: opt.label
1159
+ },
1160
+ opt.type
1161
+ )) })
1162
+ ] }),
1163
+ /* @__PURE__ */ jsxs("div", { children: [
1164
+ /* @__PURE__ */ jsx("p", { className: "text-xs font-semibold uppercase tracking-wider text-muted-foreground mb-2", children: "Pricing" }),
1165
+ /* @__PURE__ */ jsx("div", { className: "space-y-1", children: PRICING_OPTIONS.map((opt) => /* @__PURE__ */ jsx(
1166
+ "button",
1167
+ {
1168
+ type: "button",
1169
+ onClick: () => setPricingModel(opt.value),
1170
+ className: `w-full text-left text-sm px-2 py-1.5 rounded transition-colors ${pricingModel === opt.value ? "bg-primary/10 text-primary font-medium" : "text-muted-foreground hover:text-foreground hover:bg-muted/50"}`,
1171
+ children: opt.label
1172
+ },
1173
+ opt.value
1174
+ )) })
1175
+ ] }),
1176
+ (facetCategories.length > 0 || categories.length > 0) && /* @__PURE__ */ jsxs("div", { children: [
1177
+ /* @__PURE__ */ jsx("p", { className: "text-xs font-semibold uppercase tracking-wider text-muted-foreground mb-2", children: "Category" }),
1178
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
1179
+ /* @__PURE__ */ jsx(
1180
+ "button",
1181
+ {
1182
+ type: "button",
1183
+ onClick: () => setCategory(""),
1184
+ className: `w-full text-left text-sm px-2 py-1.5 rounded transition-colors ${!category ? "bg-primary/10 text-primary font-medium" : "text-muted-foreground hover:text-foreground hover:bg-muted/50"}`,
1185
+ children: "All categories"
1186
+ }
1187
+ ),
1188
+ (facetCategories.length > 0 ? facetCategories : categories.slice(0, 12).map((c) => ({ value: c.slug, count: 0 }))).map((f) => {
1189
+ const cat = categories.find((c) => c.slug === f.value);
1190
+ return /* @__PURE__ */ jsxs(
1191
+ "button",
1192
+ {
1193
+ type: "button",
1194
+ onClick: () => setCategory(category === f.value ? "" : f.value),
1195
+ className: `w-full text-left text-sm px-2 py-1.5 rounded flex items-center justify-between gap-2 transition-colors ${category === f.value ? "bg-primary/10 text-primary font-medium" : "text-muted-foreground hover:text-foreground hover:bg-muted/50"}`,
1196
+ children: [
1197
+ /* @__PURE__ */ jsx("span", { className: "truncate", children: cat?.name ?? f.value }),
1198
+ f.count > 0 && /* @__PURE__ */ jsx("span", { className: "text-xs flex-shrink-0", children: f.count })
1199
+ ]
1200
+ },
1201
+ f.value
1202
+ );
1203
+ })
1204
+ ] })
1205
+ ] }),
1206
+ facetTypes.length > 0 && /* @__PURE__ */ jsx(
1207
+ FacetList,
1208
+ {
1209
+ title: "Available types",
1210
+ facets: facetTypes,
1211
+ selected: type,
1212
+ onSelect: setType
1213
+ }
1214
+ ),
1215
+ hasActiveFilters && /* @__PURE__ */ jsx(
1216
+ "button",
1217
+ {
1218
+ type: "button",
1219
+ onClick: resetFilters,
1220
+ className: "text-sm text-muted-foreground hover:text-foreground underline",
1221
+ children: "Clear all filters"
1222
+ }
1223
+ )
1224
+ ] });
1225
+ return /* @__PURE__ */ jsxs("div", { className: "w-full", children: [
1226
+ /* @__PURE__ */ jsx(
1227
+ PageHead,
1228
+ {
1229
+ title: seoTitle ?? `Browse Store${productName ? ` \u2013 ${productName}` : ""}`,
1230
+ description: seoDescription ?? browseDescription,
1231
+ productName
1232
+ }
1233
+ ),
1234
+ /* @__PURE__ */ jsxs("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8", children: [
1235
+ /* @__PURE__ */ jsxs("header", { className: "mb-6", children: [
1236
+ /* @__PURE__ */ jsx("h1", { className: "text-3xl font-bold tracking-tight", children: productName ? `Browse the ${productName} Store` : "Browse the Store" }),
1237
+ /* @__PURE__ */ jsx("p", { className: "mt-2 text-muted-foreground", children: browseDescription })
1238
+ ] }),
1239
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col sm:flex-row gap-3 mb-6", children: [
1240
+ /* @__PURE__ */ jsxs("form", { className: "flex-1 flex gap-2", onSubmit: handleSearchSubmit, children: [
1241
+ /* @__PURE__ */ jsx(
1242
+ "input",
1243
+ {
1244
+ ref: searchRef,
1245
+ type: "search",
1246
+ "aria-label": "Search store items",
1247
+ value: inputValue,
1248
+ onChange: (e) => setInputValue(e.target.value),
1249
+ placeholder: "Search\u2026",
1250
+ className: "flex-1 h-10 rounded-lg border border-border bg-background px-4 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-primary/50"
1251
+ }
1252
+ ),
1253
+ /* @__PURE__ */ jsx(
1254
+ "button",
1255
+ {
1256
+ type: "submit",
1257
+ className: "h-10 px-5 rounded-lg bg-primary text-primary-foreground text-sm font-medium hover:opacity-90 transition-opacity",
1258
+ children: "Search"
1259
+ }
1260
+ )
1261
+ ] }),
1262
+ /* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
1263
+ /* @__PURE__ */ jsx(
1264
+ "select",
1265
+ {
1266
+ "aria-label": "Sort store items",
1267
+ value: sortBy,
1268
+ onChange: (e) => setSortBy(e.target.value),
1269
+ className: "h-10 rounded-lg border border-border bg-background px-3 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-primary/50",
1270
+ children: SORT_OPTIONS.map((o) => /* @__PURE__ */ jsx("option", { value: o.value, children: o.label }, o.value))
1271
+ }
1272
+ ),
1273
+ /* @__PURE__ */ jsxs(
1274
+ "button",
1275
+ {
1276
+ type: "button",
1277
+ onClick: () => setFiltersOpen(!filtersOpen),
1278
+ className: "lg:hidden h-10 px-4 rounded-lg border border-border bg-background text-sm text-foreground hover:bg-muted/50 transition-colors",
1279
+ children: [
1280
+ "Filters",
1281
+ " ",
1282
+ hasActiveFilters && /* @__PURE__ */ jsx("span", { className: "text-primary", children: "\u2022" })
1283
+ ]
1284
+ }
1285
+ )
1286
+ ] })
1287
+ ] }),
1288
+ filtersOpen && /* @__PURE__ */ jsx("div", { className: "lg:hidden mb-6 p-4 border border-border rounded-xl bg-card", children: sidebarContent }),
1289
+ /* @__PURE__ */ jsxs("div", { className: "flex gap-8", children: [
1290
+ /* @__PURE__ */ jsx("aside", { className: "hidden lg:block w-52 flex-shrink-0", children: sidebarContent }),
1291
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
1292
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-4 flex-wrap", children: [
1293
+ /* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: loading ? "Loading\u2026" : `${result?.totalCount ?? 0} results` }),
1294
+ hasActiveFilters && /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap gap-1.5", children: [
1295
+ search && /* @__PURE__ */ jsx(
1296
+ Chip,
1297
+ {
1298
+ label: `"${search}"`,
1299
+ onRemove: () => {
1300
+ setSearch("");
1301
+ setInputValue("");
1302
+ }
1303
+ }
1304
+ ),
1305
+ type && /* @__PURE__ */ jsx(Chip, { label: type, onRemove: () => setType("") }),
1306
+ pricingModel && /* @__PURE__ */ jsx(
1307
+ Chip,
1308
+ {
1309
+ label: pricingModel,
1310
+ onRemove: () => setPricingModel("")
1311
+ }
1312
+ ),
1313
+ category && /* @__PURE__ */ jsx(Chip, { label: category, onRemove: () => setCategory("") }),
1314
+ featured && /* @__PURE__ */ jsx(
1315
+ Chip,
1316
+ {
1317
+ label: "Featured",
1318
+ onRemove: () => setFeatured(false)
1319
+ }
1320
+ )
1321
+ ] })
1322
+ ] }),
1323
+ loading ? /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-3 gap-4", children: [...Array(12)].map((_, i) => /* @__PURE__ */ jsx(
1324
+ "div",
1325
+ {
1326
+ className: "bg-card border border-border rounded-xl p-4 h-36 animate-pulse"
1327
+ },
1328
+ i
1329
+ )) }) : allProducts.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "py-20 text-center", children: [
1330
+ /* @__PURE__ */ jsxs("p", { className: "text-muted-foreground mb-4", children: [
1331
+ "No results found",
1332
+ search ? ` for "${search}"` : "",
1333
+ "."
1334
+ ] }),
1335
+ /* @__PURE__ */ jsx(
1336
+ "button",
1337
+ {
1338
+ type: "button",
1339
+ onClick: resetFilters,
1340
+ className: "text-sm text-primary hover:underline",
1341
+ children: "Clear filters"
1342
+ }
1343
+ )
1344
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
1345
+ /* @__PURE__ */ jsx("h2", { className: "sr-only", children: "Store items" }),
1346
+ /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-3 gap-4", children: allProducts.map((product) => /* @__PURE__ */ jsx(
1347
+ ProductCard,
1348
+ {
1349
+ product,
1350
+ onClick: () => navigate(`/store/${product.slug}`)
1351
+ },
1352
+ product.id
1353
+ )) }),
1354
+ result?.hasMore && /* @__PURE__ */ jsx("div", { className: "mt-8 text-center", children: /* @__PURE__ */ jsx(
1355
+ "button",
1356
+ {
1357
+ type: "button",
1358
+ onClick: loadMore,
1359
+ disabled: loadingMore,
1360
+ className: "h-10 px-8 rounded-lg border border-border text-sm font-medium text-foreground hover:bg-muted/50 transition-colors disabled:opacity-50",
1361
+ children: loadingMore ? "Loading\u2026" : "Load more"
1362
+ }
1363
+ ) })
1364
+ ] })
1365
+ ] })
1366
+ ] })
1367
+ ] })
1368
+ ] });
1369
+ }
1370
+ function Chip({ label, onRemove }) {
1371
+ return /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1 text-xs bg-primary/10 text-primary rounded-full px-2.5 py-0.5 font-medium", children: [
1372
+ label,
1373
+ /* @__PURE__ */ jsx(
1374
+ "button",
1375
+ {
1376
+ type: "button",
1377
+ onClick: onRemove,
1378
+ "aria-label": `Remove ${label}`,
1379
+ className: "hover:opacity-70",
1380
+ children: "\xD7"
1381
+ }
1382
+ )
1383
+ ] });
1384
+ }
1385
+ function detectTheme() {
1386
+ if (typeof document === "undefined") return "light";
1387
+ const root = document.documentElement;
1388
+ return root.classList.contains("dark") || root.getAttribute("data-theme") === "dark" ? "dark" : "light";
1389
+ }
1390
+ function WorkflowEmbed({
1391
+ appUrl,
1392
+ productId,
1393
+ theme,
1394
+ clickToInteract = true,
1395
+ hideCta = false,
1396
+ className,
1397
+ onError
1398
+ }) {
1399
+ const iframeRef = useRef(null);
1400
+ const [status, setStatus] = useState("loading");
1401
+ const [interactive, setInteractive] = useState(!clickToInteract);
1402
+ const resolvedTheme = useMemo(() => theme ?? detectTheme(), [theme]);
1403
+ const src = useMemo(() => {
1404
+ const base = appUrl.replace(/\/+$/, "");
1405
+ const params = new URLSearchParams({
1406
+ productId,
1407
+ theme: resolvedTheme
1408
+ });
1409
+ if (hideCta) params.set("cta", "false");
1410
+ return `${base}/embed/workflow?${params.toString()}`;
1411
+ }, [appUrl, productId, resolvedTheme, hideCta]);
1412
+ useEffect(() => {
1413
+ const handler = (event) => {
1414
+ if (event.source !== iframeRef.current?.contentWindow) return;
1415
+ const data = event.data;
1416
+ if (data?.type === "fluidgrids:embed:loaded") setStatus("loaded");
1417
+ if (data?.type === "fluidgrids:embed:error") {
1418
+ setStatus("error");
1419
+ onError?.(data.message ?? "Failed to load workflow preview");
1420
+ }
1421
+ };
1422
+ window.addEventListener("message", handler);
1423
+ return () => window.removeEventListener("message", handler);
1424
+ }, [onError]);
1425
+ if (status === "error") return null;
1426
+ return /* @__PURE__ */ jsxs(
1427
+ "div",
1428
+ {
1429
+ className: `relative w-full overflow-hidden rounded-xl border border-border bg-muted ${className ?? ""}`,
1430
+ style: { aspectRatio: "16 / 9" },
1431
+ children: [
1432
+ status === "loading" && /* @__PURE__ */ jsx(
1433
+ "div",
1434
+ {
1435
+ className: "absolute inset-0 animate-pulse bg-muted",
1436
+ "aria-hidden": "true"
1437
+ }
1438
+ ),
1439
+ /* @__PURE__ */ jsx(
1440
+ "iframe",
1441
+ {
1442
+ ref: iframeRef,
1443
+ src,
1444
+ title: "Workflow preview",
1445
+ loading: "lazy",
1446
+ className: "h-full w-full border-0",
1447
+ style: interactive ? void 0 : { pointerEvents: "none" }
1448
+ }
1449
+ ),
1450
+ clickToInteract && !interactive && status === "loaded" && /* @__PURE__ */ jsx(
1451
+ "button",
1452
+ {
1453
+ type: "button",
1454
+ onClick: () => setInteractive(true),
1455
+ className: "absolute inset-0 flex items-end justify-center bg-transparent pb-4",
1456
+ "aria-label": "Click to explore the workflow",
1457
+ children: /* @__PURE__ */ jsx("span", { className: "rounded-full border border-border bg-background/90 px-4 py-1.5 text-xs font-medium text-foreground shadow-sm backdrop-blur transition-colors hover:bg-background", children: "Click to explore" })
1458
+ }
1459
+ )
1460
+ ]
1461
+ }
1462
+ );
1463
+ }
1464
+ var ANIM_STYLES = `
1465
+ @keyframes sdFadeUp {
1466
+ from { opacity: 0; transform: translateY(16px); }
1467
+ to { opacity: 1; transform: translateY(0); }
1468
+ }
1469
+ @keyframes sdFadeIn {
1470
+ from { opacity: 0; }
1471
+ to { opacity: 1; }
1472
+ }
1473
+ @keyframes sdScaleIn {
1474
+ from { opacity: 0; transform: scale(0.94); }
1475
+ to { opacity: 1; transform: scale(1); }
1476
+ }
1477
+ @keyframes sdGlowPulse {
1478
+ 0%, 100% { opacity: 0.35; }
1479
+ 50% { opacity: 0.65; }
1480
+ }
1481
+ @media (prefers-reduced-motion: reduce) {
1482
+ .sd-fu, .sd-fi, .sd-si { animation: none !important; opacity: 1 !important; transform: none !important; }
1483
+ .sd-gp { animation: none !important; }
1484
+ }
1485
+ .sd-fu { animation: sdFadeUp 0.55s cubic-bezier(0.16,1,0.3,1) both; }
1486
+ .sd-fi { animation: sdFadeIn 0.45s ease-out both; }
1487
+ .sd-si { animation: sdScaleIn 0.45s cubic-bezier(0.16,1,0.3,1) both; }
1488
+ .sd-gp { animation: sdGlowPulse 3s ease-in-out infinite; }
1489
+ .sd-d1 { animation-delay: 60ms; }
1490
+ .sd-d2 { animation-delay: 120ms; }
1491
+ .sd-d3 { animation-delay: 180ms; }
1492
+ .sd-d4 { animation-delay: 240ms; }
1493
+ .sd-d5 { animation-delay: 320ms; }
1494
+ .sd-d6 { animation-delay: 400ms; }
1495
+ `;
1496
+ function RatingBar({
1497
+ label,
1498
+ count,
1499
+ total
1500
+ }) {
1501
+ const pct = total > 0 ? Math.round(count / total * 100) : 0;
1502
+ return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
1503
+ /* @__PURE__ */ jsx("span", { className: "w-12 text-right shrink-0", children: label }),
1504
+ /* @__PURE__ */ jsx("div", { className: "flex-1 h-1.5 bg-muted rounded-full overflow-hidden", children: /* @__PURE__ */ jsx(
1505
+ "div",
1506
+ {
1507
+ className: "h-full bg-amber-400 rounded-full transition-all duration-700",
1508
+ style: { width: `${pct}%` }
1509
+ }
1510
+ ) }),
1511
+ /* @__PURE__ */ jsx("span", { className: "w-6 shrink-0", children: count })
1512
+ ] });
1513
+ }
1514
+ function IconBlock({ src }) {
1515
+ return /* @__PURE__ */ jsxs("div", { className: "relative flex-shrink-0", children: [
1516
+ /* @__PURE__ */ jsx(
1517
+ "div",
1518
+ {
1519
+ className: "sd-gp absolute -inset-1.5 rounded-2xl bg-primary/30 blur-md pointer-events-none",
1520
+ "aria-hidden": "true"
1521
+ }
1522
+ ),
1523
+ /* @__PURE__ */ jsx("div", { className: "sd-si relative w-20 h-20 rounded-2xl overflow-hidden shadow-lg ring-1 ring-border", children: src ? /* @__PURE__ */ jsx(
1524
+ "img",
1525
+ {
1526
+ src,
1527
+ alt: "",
1528
+ "aria-hidden": true,
1529
+ className: "w-full h-full object-cover"
1530
+ }
1531
+ ) : /* @__PURE__ */ jsx("div", { className: "w-full h-full bg-gradient-to-br from-primary/25 to-primary/8 flex items-center justify-center", children: /* @__PURE__ */ jsxs(
1532
+ "svg",
1533
+ {
1534
+ viewBox: "0 0 40 40",
1535
+ className: "w-10 h-10",
1536
+ fill: "none",
1537
+ xmlns: "http://www.w3.org/2000/svg",
1538
+ "aria-hidden": "true",
1539
+ children: [
1540
+ /* @__PURE__ */ jsx(
1541
+ "polygon",
1542
+ {
1543
+ points: "20,4 34,11 20,18 6,11",
1544
+ className: "fill-primary/40",
1545
+ stroke: "currentColor",
1546
+ strokeWidth: "0.6",
1547
+ strokeOpacity: "0.4"
1548
+ }
1549
+ ),
1550
+ /* @__PURE__ */ jsx(
1551
+ "polygon",
1552
+ {
1553
+ points: "6,11 20,18 20,34 6,27",
1554
+ className: "fill-primary/20",
1555
+ stroke: "currentColor",
1556
+ strokeWidth: "0.6",
1557
+ strokeOpacity: "0.4"
1558
+ }
1559
+ ),
1560
+ /* @__PURE__ */ jsx(
1561
+ "polygon",
1562
+ {
1563
+ points: "34,11 20,18 20,34 34,27",
1564
+ className: "fill-primary/30",
1565
+ stroke: "currentColor",
1566
+ strokeWidth: "0.6",
1567
+ strokeOpacity: "0.4"
1568
+ }
1569
+ )
1570
+ ]
1571
+ }
1572
+ ) }) })
1573
+ ] });
1574
+ }
1575
+ function StoreProductDetailPage({
1576
+ slug,
1577
+ id,
1578
+ appLoginUrl,
1579
+ onNavigate,
1580
+ productName,
1581
+ waitlist: waitlistProp
1582
+ }) {
1583
+ const client = useWebSDK();
1584
+ const waitlist = waitlistProp ?? false;
1585
+ const [details, setDetails] = useState(null);
1586
+ const [loading, setLoading] = useState(true);
1587
+ const [error, setError] = useState(null);
1588
+ const [activeScreenshot, setActiveScreenshot] = useState(0);
1589
+ const [screenshotKey, setScreenshotKey] = useState(0);
1590
+ const [embedFailed, setEmbedFailed] = useState(false);
1591
+ useEffect(() => {
1592
+ if (!slug && !id) {
1593
+ setError("Product not found.");
1594
+ setLoading(false);
1595
+ return;
1596
+ }
1597
+ let cancelled = false;
1598
+ setLoading(true);
1599
+ client.query(STORE_PRODUCT_DETAILS_QUERY, {
1600
+ input: { slug: slug ?? void 0, id: id ?? void 0 }
1601
+ }).then((r) => {
1602
+ if (cancelled) return;
1603
+ if (r.errors?.length) throw new Error(r.errors[0].message);
1604
+ if (!r.data?.storeProductDetails) throw new Error("Not found");
1605
+ setDetails(r.data.storeProductDetails);
1606
+ }).catch(() => {
1607
+ if (!cancelled) setError("Product not found or unavailable.");
1608
+ }).finally(() => {
1609
+ if (!cancelled) setLoading(false);
1610
+ });
1611
+ return () => {
1612
+ cancelled = true;
1613
+ };
1614
+ }, [client, slug, id]);
1615
+ function navigate(path) {
1616
+ if (onNavigate) {
1617
+ onNavigate(path);
1618
+ return;
1619
+ }
1620
+ window.location.href = path;
1621
+ }
1622
+ function switchScreenshot(i) {
1623
+ setActiveScreenshot(i);
1624
+ setScreenshotKey((k) => k + 1);
1625
+ }
1626
+ if (loading) {
1627
+ return /* @__PURE__ */ jsxs("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12 animate-pulse", children: [
1628
+ /* @__PURE__ */ jsx("div", { className: "h-4 bg-muted rounded w-40 mb-8" }),
1629
+ /* @__PURE__ */ jsxs("div", { className: "flex gap-6 mb-8", children: [
1630
+ /* @__PURE__ */ jsx("div", { className: "w-20 h-20 rounded-2xl bg-muted flex-shrink-0" }),
1631
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 space-y-3 pt-1", children: [
1632
+ /* @__PURE__ */ jsx("div", { className: "h-6 bg-muted rounded w-1/3" }),
1633
+ /* @__PURE__ */ jsx("div", { className: "h-4 bg-muted rounded w-1/2" }),
1634
+ /* @__PURE__ */ jsx("div", { className: "h-4 bg-muted rounded w-1/4" })
1635
+ ] })
1636
+ ] }),
1637
+ /* @__PURE__ */ jsx("div", { className: "h-56 bg-muted rounded-xl mb-8" }),
1638
+ /* @__PURE__ */ jsx("div", { className: "space-y-3", children: [...Array(5)].map((_, i) => /* @__PURE__ */ jsx("div", { className: "h-4 bg-muted rounded" }, i)) })
1639
+ ] });
1640
+ }
1641
+ if (error || !details) {
1642
+ return /* @__PURE__ */ jsxs("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-20 text-center", children: [
1643
+ /* @__PURE__ */ jsx("p", { className: "text-muted-foreground mb-4", children: error ?? "Product not found." }),
1644
+ /* @__PURE__ */ jsx(
1645
+ "button",
1646
+ {
1647
+ type: "button",
1648
+ onClick: () => navigate("/store"),
1649
+ className: "text-sm text-primary hover:underline",
1650
+ children: "Back to Store"
1651
+ }
1652
+ )
1653
+ ] });
1654
+ }
1655
+ const {
1656
+ product,
1657
+ publisher,
1658
+ reviews,
1659
+ reviewsCount,
1660
+ relatedProducts,
1661
+ ratingDistribution
1662
+ } = details;
1663
+ const priceLabel = formatPrice(
1664
+ product.price,
1665
+ product.currency,
1666
+ product.pricingModel
1667
+ );
1668
+ const ctaLabel = waitlist ? "Coming Soon" : priceLabel === "Free" ? "Install Free" : `Get for ${priceLabel}`;
1669
+ const ctaHref = waitlist ? "#" : appLoginUrl;
1670
+ const ctaAriaDisabled = waitlist || void 0;
1671
+ const screenshots = product.screenshots ?? [];
1672
+ const totalRatings = ratingDistribution ? ratingDistribution.fiveStars + ratingDistribution.fourStars + ratingDistribution.threeStars + ratingDistribution.twoStars + ratingDistribution.oneStar : 0;
1673
+ return /* @__PURE__ */ jsxs("div", { className: "w-full", children: [
1674
+ /* @__PURE__ */ jsx("style", { dangerouslySetInnerHTML: { __html: ANIM_STYLES } }),
1675
+ /* @__PURE__ */ jsx(ProseStyles, {}),
1676
+ /* @__PURE__ */ jsx(
1677
+ PageHead,
1678
+ {
1679
+ title: `${product.name}${productName ? ` \u2013 ${productName} Store` : " \u2013 Store"}`,
1680
+ description: product.description ?? void 0,
1681
+ productName
1682
+ }
1683
+ ),
1684
+ /* @__PURE__ */ jsxs("div", { className: "relative overflow-hidden", children: [
1685
+ /* @__PURE__ */ jsx(
1686
+ "div",
1687
+ {
1688
+ className: "absolute inset-0 bg-gradient-to-b from-primary/[0.07] via-background to-background pointer-events-none",
1689
+ "aria-hidden": "true"
1690
+ }
1691
+ ),
1692
+ /* @__PURE__ */ jsxs(
1693
+ "svg",
1694
+ {
1695
+ className: "absolute inset-0 w-full h-full opacity-[0.04] pointer-events-none",
1696
+ xmlns: "http://www.w3.org/2000/svg",
1697
+ "aria-hidden": "true",
1698
+ children: [
1699
+ /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx(
1700
+ "pattern",
1701
+ {
1702
+ id: "sd-grid",
1703
+ width: "40",
1704
+ height: "40",
1705
+ patternUnits: "userSpaceOnUse",
1706
+ children: /* @__PURE__ */ jsx(
1707
+ "path",
1708
+ {
1709
+ d: "M 40 0 L 0 0 0 40",
1710
+ fill: "none",
1711
+ stroke: "currentColor",
1712
+ strokeWidth: "1"
1713
+ }
1714
+ )
1715
+ }
1716
+ ) }),
1717
+ /* @__PURE__ */ jsx("rect", { width: "100%", height: "100%", fill: "url(#sd-grid)" })
1718
+ ]
1719
+ }
1720
+ ),
1721
+ /* @__PURE__ */ jsx(
1722
+ "div",
1723
+ {
1724
+ className: "absolute -top-12 -left-12 w-72 h-72 rounded-full bg-primary/10 blur-3xl pointer-events-none",
1725
+ "aria-hidden": "true"
1726
+ }
1727
+ ),
1728
+ /* @__PURE__ */ jsxs("div", { className: "relative max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 pt-6 pb-8", children: [
1729
+ /* @__PURE__ */ jsxs("nav", { className: "sd-fi text-sm text-muted-foreground mb-6 flex items-center gap-1.5 flex-wrap", children: [
1730
+ /* @__PURE__ */ jsx(
1731
+ "button",
1732
+ {
1733
+ type: "button",
1734
+ onClick: () => navigate("/store"),
1735
+ className: "hover:text-primary transition-colors",
1736
+ children: "Store"
1737
+ }
1738
+ ),
1739
+ /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: "\u203A" }),
1740
+ product.category && /* @__PURE__ */ jsxs(Fragment, { children: [
1741
+ /* @__PURE__ */ jsx(
1742
+ "button",
1743
+ {
1744
+ type: "button",
1745
+ onClick: () => navigate(`/store/browse?category=${product.category}`),
1746
+ className: "hover:text-primary transition-colors",
1747
+ children: product.category
1748
+ }
1749
+ ),
1750
+ /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: "\u203A" })
1751
+ ] }),
1752
+ /* @__PURE__ */ jsx("span", { className: "text-foreground font-medium", children: product.name })
1753
+ ] }),
1754
+ /* @__PURE__ */ jsxs("div", { className: "flex gap-5 items-start", children: [
1755
+ /* @__PURE__ */ jsx(IconBlock, { src: product.icon, name: product.name }),
1756
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
1757
+ /* @__PURE__ */ jsxs("div", { className: "sd-fu flex items-start gap-2 flex-wrap mb-1", children: [
1758
+ /* @__PURE__ */ jsx("h1", { className: "text-2xl sm:text-3xl font-bold text-foreground leading-tight", children: product.name }),
1759
+ /* @__PURE__ */ jsx(TypeBadge, { type: product.type })
1760
+ ] }),
1761
+ product.description && /* @__PURE__ */ jsx("p", { className: "sd-fu sd-d1 text-muted-foreground text-sm mb-2 leading-relaxed", children: product.description }),
1762
+ /* @__PURE__ */ jsxs("div", { className: "sd-fu sd-d2 flex items-center gap-3 text-sm text-muted-foreground flex-wrap", children: [
1763
+ product.rating != null && product.rating > 0 && /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1", children: [
1764
+ /* @__PURE__ */ jsx(StarRating, { rating: product.rating }),
1765
+ /* @__PURE__ */ jsx("span", { className: "font-semibold text-foreground", children: product.rating.toFixed(1) }),
1766
+ /* @__PURE__ */ jsxs("span", { children: [
1767
+ "(",
1768
+ reviewsCount ?? 0,
1769
+ ")"
1770
+ ] })
1771
+ ] }),
1772
+ product.downloads != null && /* @__PURE__ */ jsxs("span", { children: [
1773
+ formatDownloads(product.downloads),
1774
+ " downloads"
1775
+ ] }),
1776
+ product.authorName && /* @__PURE__ */ jsxs("span", { children: [
1777
+ "by ",
1778
+ product.authorName
1779
+ ] }),
1780
+ product.license && /* @__PURE__ */ jsx("span", { children: product.license })
1781
+ ] })
1782
+ ] })
1783
+ ] })
1784
+ ] })
1785
+ ] }),
1786
+ /* @__PURE__ */ jsx("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-6", children: /* @__PURE__ */ jsxs("div", { className: "grid lg:grid-cols-[1fr_300px] gap-8", children: [
1787
+ /* @__PURE__ */ jsxs("div", { children: [
1788
+ /* @__PURE__ */ jsxs("div", { className: "sd-fu sd-d3 lg:hidden mb-6 p-4 rounded-xl border border-border bg-card flex items-center gap-4", children: [
1789
+ /* @__PURE__ */ jsxs("div", { children: [
1790
+ /* @__PURE__ */ jsx("div", { className: "text-2xl font-bold text-foreground", children: priceLabel }),
1791
+ product.pricingModel === "SUBSCRIPTION" && /* @__PURE__ */ jsx("div", { className: "text-xs text-muted-foreground", children: "per month" })
1792
+ ] }),
1793
+ /* @__PURE__ */ jsx(
1794
+ "a",
1795
+ {
1796
+ href: ctaHref,
1797
+ target: waitlist ? void 0 : "_blank",
1798
+ rel: waitlist ? void 0 : "noopener noreferrer",
1799
+ "aria-disabled": ctaAriaDisabled,
1800
+ className: "flex-1 h-11 rounded-lg bg-primary text-primary-foreground text-sm font-semibold flex items-center justify-center hover:opacity-90 transition-opacity aria-disabled:opacity-60 aria-disabled:cursor-not-allowed",
1801
+ children: ctaLabel
1802
+ }
1803
+ )
1804
+ ] }),
1805
+ product.type === "WORKFLOW" && !embedFailed && /* @__PURE__ */ jsx("div", { className: "sd-fu sd-d3 mb-8", children: /* @__PURE__ */ jsx(
1806
+ WorkflowEmbed,
1807
+ {
1808
+ appUrl: appLoginUrl,
1809
+ productId: product.id,
1810
+ onError: () => setEmbedFailed(true)
1811
+ }
1812
+ ) }),
1813
+ screenshots.length > 0 && /* @__PURE__ */ jsxs("div", { className: "sd-fu sd-d3 mb-8", children: [
1814
+ /* @__PURE__ */ jsx("div", { className: "rounded-xl overflow-hidden bg-muted aspect-video mb-3 shadow-md", children: /* @__PURE__ */ jsx(
1815
+ "img",
1816
+ {
1817
+ src: screenshots[activeScreenshot],
1818
+ alt: `Screenshot ${activeScreenshot + 1}`,
1819
+ className: "sd-fi w-full h-full object-cover"
1820
+ },
1821
+ screenshotKey
1822
+ ) }),
1823
+ screenshots.length > 1 && /* @__PURE__ */ jsx("div", { className: "flex gap-2 overflow-x-auto pb-1", children: screenshots.map((src, i) => /* @__PURE__ */ jsx(
1824
+ "button",
1825
+ {
1826
+ type: "button",
1827
+ onClick: () => switchScreenshot(i),
1828
+ className: `w-20 h-14 rounded-lg overflow-hidden flex-shrink-0 border-2 transition-all duration-200 ${i === activeScreenshot ? "border-primary shadow-sm shadow-primary/20" : "border-transparent opacity-50 hover:opacity-80"}`,
1829
+ children: /* @__PURE__ */ jsx(
1830
+ "img",
1831
+ {
1832
+ src,
1833
+ alt: `Thumbnail ${i + 1}`,
1834
+ className: "w-full h-full object-cover"
1835
+ }
1836
+ )
1837
+ },
1838
+ i
1839
+ )) })
1840
+ ] }),
1841
+ product.longDescription && /* @__PURE__ */ jsxs("div", { className: "sd-fu sd-d4 mb-8", children: [
1842
+ /* @__PURE__ */ jsx("h2", { className: "text-lg font-bold text-foreground mb-3", children: "About" }),
1843
+ /* @__PURE__ */ jsx(Markdown, { className: "boff-prose boff-prose-sm max-w-none text-muted-foreground leading-relaxed", children: product.longDescription })
1844
+ ] }),
1845
+ publisher && /* @__PURE__ */ jsxs("div", { className: "sd-fu sd-d5 mb-8 p-4 rounded-xl border border-border bg-card hover:border-primary/30 transition-colors duration-300", children: [
1846
+ /* @__PURE__ */ jsx("h2", { className: "text-sm font-semibold text-foreground mb-3", children: "Publisher" }),
1847
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
1848
+ publisher.logoUrl ? /* @__PURE__ */ jsx(
1849
+ "img",
1850
+ {
1851
+ src: publisher.logoUrl,
1852
+ alt: publisher.name,
1853
+ className: "w-10 h-10 rounded-full object-cover"
1854
+ }
1855
+ ) : /* @__PURE__ */ jsx("div", { className: "w-10 h-10 rounded-full bg-primary/10 flex items-center justify-center text-primary text-sm font-bold", children: publisher.name.charAt(0).toUpperCase() }),
1856
+ /* @__PURE__ */ jsxs("div", { children: [
1857
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
1858
+ /* @__PURE__ */ jsx("span", { className: "font-semibold text-foreground text-sm", children: publisher.name }),
1859
+ publisher.isVerified && /* @__PURE__ */ jsx("span", { className: "text-xs text-primary font-medium", children: "\u2713 Verified" })
1860
+ ] }),
1861
+ publisher.bio && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground mt-0.5 line-clamp-2", children: publisher.bio })
1862
+ ] })
1863
+ ] })
1864
+ ] }),
1865
+ (reviews?.length ?? 0) > 0 && /* @__PURE__ */ jsxs("div", { className: "sd-fu sd-d5 mb-8", children: [
1866
+ /* @__PURE__ */ jsxs("h2", { className: "text-lg font-bold text-foreground mb-4", children: [
1867
+ "Reviews (",
1868
+ reviewsCount ?? reviews.length,
1869
+ ")"
1870
+ ] }),
1871
+ ratingDistribution && totalRatings > 0 && /* @__PURE__ */ jsxs("div", { className: "sd-si flex gap-6 mb-5 p-4 rounded-xl border border-border bg-card", children: [
1872
+ /* @__PURE__ */ jsxs("div", { className: "text-center", children: [
1873
+ /* @__PURE__ */ jsx("div", { className: "text-4xl font-bold text-foreground tabular-nums", children: product.rating?.toFixed(1) ?? "\u2014" }),
1874
+ product.rating != null && /* @__PURE__ */ jsx(StarRating, { rating: product.rating }),
1875
+ /* @__PURE__ */ jsxs("div", { className: "text-xs text-muted-foreground mt-1", children: [
1876
+ totalRatings,
1877
+ " ratings"
1878
+ ] })
1879
+ ] }),
1880
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 space-y-1.5 pt-1", children: [
1881
+ /* @__PURE__ */ jsx(
1882
+ RatingBar,
1883
+ {
1884
+ label: "5 \u2605",
1885
+ count: ratingDistribution.fiveStars,
1886
+ total: totalRatings
1887
+ }
1888
+ ),
1889
+ /* @__PURE__ */ jsx(
1890
+ RatingBar,
1891
+ {
1892
+ label: "4 \u2605",
1893
+ count: ratingDistribution.fourStars,
1894
+ total: totalRatings
1895
+ }
1896
+ ),
1897
+ /* @__PURE__ */ jsx(
1898
+ RatingBar,
1899
+ {
1900
+ label: "3 \u2605",
1901
+ count: ratingDistribution.threeStars,
1902
+ total: totalRatings
1903
+ }
1904
+ ),
1905
+ /* @__PURE__ */ jsx(
1906
+ RatingBar,
1907
+ {
1908
+ label: "2 \u2605",
1909
+ count: ratingDistribution.twoStars,
1910
+ total: totalRatings
1911
+ }
1912
+ ),
1913
+ /* @__PURE__ */ jsx(
1914
+ RatingBar,
1915
+ {
1916
+ label: "1 \u2605",
1917
+ count: ratingDistribution.oneStar,
1918
+ total: totalRatings
1919
+ }
1920
+ )
1921
+ ] })
1922
+ ] }),
1923
+ /* @__PURE__ */ jsx("div", { className: "space-y-3", children: reviews.slice(0, 5).map((review, idx) => /* @__PURE__ */ jsxs(
1924
+ "div",
1925
+ {
1926
+ className: "sd-fu p-4 rounded-xl border border-border bg-card hover:border-primary/20 transition-colors duration-200",
1927
+ style: { animationDelay: `${(idx + 5) * 60}ms` },
1928
+ children: [
1929
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2 mb-2", children: [
1930
+ /* @__PURE__ */ jsx(StarRating, { rating: review.rating }),
1931
+ review.verifiedPurchase && /* @__PURE__ */ jsx("span", { className: "text-xs text-emerald-700 dark:text-emerald-400 font-medium", children: "Verified" })
1932
+ ] }),
1933
+ review.title && /* @__PURE__ */ jsx("p", { className: "font-semibold text-sm text-foreground mb-1", children: review.title }),
1934
+ review.comment && /* @__PURE__ */ jsx(Markdown, { className: "text-sm text-muted-foreground leading-relaxed", children: review.comment }),
1935
+ review.createdAt && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground mt-2", children: new Date(review.createdAt).toLocaleDateString(
1936
+ "en-US",
1937
+ {
1938
+ year: "numeric",
1939
+ month: "short",
1940
+ day: "numeric"
1941
+ }
1942
+ ) })
1943
+ ]
1944
+ },
1945
+ review.id
1946
+ )) })
1947
+ ] }),
1948
+ (relatedProducts?.length ?? 0) > 0 && /* @__PURE__ */ jsxs("div", { className: "sd-fu sd-d6", children: [
1949
+ /* @__PURE__ */ jsx("h2", { className: "text-lg font-bold text-foreground mb-4", children: "Related" }),
1950
+ /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4", children: relatedProducts.slice(0, 6).map((p) => /* @__PURE__ */ jsx(
1951
+ ProductCard,
1952
+ {
1953
+ product: p,
1954
+ onClick: () => navigate(`/store/${p.slug}`)
1955
+ },
1956
+ p.id
1957
+ )) })
1958
+ ] })
1959
+ ] }),
1960
+ /* @__PURE__ */ jsx("aside", { className: "lg:sticky lg:top-24 self-start", children: /* @__PURE__ */ jsxs("div", { className: "sd-fu sd-d4 bg-card border border-border rounded-xl p-5 space-y-4 hover:border-primary/30 transition-colors duration-300 hover:shadow-lg hover:shadow-primary/5", children: [
1961
+ /* @__PURE__ */ jsxs("div", { children: [
1962
+ /* @__PURE__ */ jsx(
1963
+ "div",
1964
+ {
1965
+ className: `text-3xl font-extrabold ${priceLabel === "Free" ? "text-emerald-700 dark:text-emerald-400" : "text-foreground"}`,
1966
+ children: priceLabel
1967
+ }
1968
+ ),
1969
+ product.pricingModel === "SUBSCRIPTION" && /* @__PURE__ */ jsx("div", { className: "text-xs text-muted-foreground", children: "per month" })
1970
+ ] }),
1971
+ /* @__PURE__ */ jsx(
1972
+ "a",
1973
+ {
1974
+ href: ctaHref,
1975
+ target: waitlist ? void 0 : "_blank",
1976
+ rel: waitlist ? void 0 : "noopener noreferrer",
1977
+ "aria-disabled": ctaAriaDisabled,
1978
+ className: "flex items-center justify-center w-full h-11 rounded-lg bg-primary text-primary-foreground text-sm font-semibold hover:opacity-90 active:scale-[0.98] transition-all duration-150 aria-disabled:opacity-60 aria-disabled:cursor-not-allowed",
1979
+ children: ctaLabel
1980
+ }
1981
+ ),
1982
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground text-center", children: waitlist ? `Available when ${product?.name ?? "this product"} launches` : "Login required to install" }),
1983
+ /* @__PURE__ */ jsxs("div", { className: "border-t border-border pt-4 space-y-2 text-xs text-muted-foreground", children: [
1984
+ product.type && /* @__PURE__ */ jsxs("div", { className: "flex justify-between", children: [
1985
+ /* @__PURE__ */ jsx("span", { children: "Type" }),
1986
+ /* @__PURE__ */ jsx("span", { className: "text-foreground font-medium", children: product.type })
1987
+ ] }),
1988
+ product.category && /* @__PURE__ */ jsxs("div", { className: "flex justify-between", children: [
1989
+ /* @__PURE__ */ jsx("span", { children: "Category" }),
1990
+ /* @__PURE__ */ jsx("span", { className: "text-foreground font-medium", children: product.category })
1991
+ ] }),
1992
+ product.license && /* @__PURE__ */ jsxs("div", { className: "flex justify-between", children: [
1993
+ /* @__PURE__ */ jsx("span", { children: "License" }),
1994
+ /* @__PURE__ */ jsx("span", { className: "text-foreground font-medium", children: product.license })
1995
+ ] }),
1996
+ product.minPlatformVersion && /* @__PURE__ */ jsxs("div", { className: "flex justify-between", children: [
1997
+ /* @__PURE__ */ jsx("span", { children: "Requires" }),
1998
+ /* @__PURE__ */ jsxs("span", { className: "text-foreground font-medium", children: [
1999
+ "v",
2000
+ product.minPlatformVersion,
2001
+ "+"
2002
+ ] })
2003
+ ] }),
2004
+ product.downloads != null && /* @__PURE__ */ jsxs("div", { className: "flex justify-between", children: [
2005
+ /* @__PURE__ */ jsx("span", { children: "Downloads" }),
2006
+ /* @__PURE__ */ jsx("span", { className: "text-foreground font-medium", children: formatDownloads(product.downloads) })
2007
+ ] })
2008
+ ] }),
2009
+ (product.tags?.length ?? 0) > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1.5 pt-1", children: product.tags.map((tag) => /* @__PURE__ */ jsx(
2010
+ "span",
2011
+ {
2012
+ className: "text-xs px-2 py-0.5 rounded-full bg-primary/10 text-primary font-medium",
2013
+ children: tag
2014
+ },
2015
+ tag
2016
+ )) })
2017
+ ] }) })
2018
+ ] }) })
2019
+ ] });
2020
+ }
2021
+
2022
+ export { ProductCard, StarRating, StoreBrowsePage, StoreHomePage, StoreProductDetailPage, TypeBadge, WorkflowEmbed, formatDownloads, formatPrice };
2023
+ //# sourceMappingURL=chunk-ZP6QRAYC.mjs.map
2024
+ //# sourceMappingURL=chunk-ZP6QRAYC.mjs.map