@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
@@ -1,2621 +1,15 @@
1
- import * as React from 'react';
2
- import { createContext, useState, useEffect, useRef, useMemo, useContext } from 'react';
3
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
4
- import { Helmet } from 'react-helmet-async';
5
- import 'isomorphic-dompurify';
6
- import ReactMarkdown from 'react-markdown';
7
- import rehypeSanitize from 'rehype-sanitize';
8
- import remarkGfm from 'remark-gfm';
9
- import 'lucide-react';
10
- import { Slot } from '@radix-ui/react-slot';
11
- import { cva } from 'class-variance-authority';
12
- import { clsx } from 'clsx';
13
- import { twMerge } from 'tailwind-merge';
14
-
15
- var __defProp = Object.defineProperty;
16
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
17
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
18
- function formatPrice(price, currency, pricingModel) {
19
- if (pricingModel === "FREE" || !price || price === 0) return "Free";
20
- const curr = currency || "USD";
21
- try {
22
- return new Intl.NumberFormat("en-US", {
23
- style: "currency",
24
- currency: curr
25
- }).format(price);
26
- } catch {
27
- return `${curr} ${price.toFixed(2)}`;
28
- }
29
- }
30
- function formatDownloads(n) {
31
- if (!n) return "0";
32
- if (n >= 1e6) return `${(n / 1e6).toFixed(1)}M`;
33
- if (n >= 1e3) return `${(n / 1e3).toFixed(1)}K`;
34
- return n.toString();
35
- }
36
- function StarRating({ rating }) {
37
- return /* @__PURE__ */ jsx("span", { className: "flex items-center gap-0.5", children: [1, 2, 3, 4, 5].map((star) => /* @__PURE__ */ jsx(
38
- "svg",
39
- {
40
- viewBox: "0 0 12 12",
41
- className: `w-3 h-3 ${star <= Math.round(rating) ? "text-amber-400 fill-current" : "text-muted-foreground/30 fill-current"}`,
42
- 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" })
43
- },
44
- star
45
- )) });
46
- }
47
- function TypeBadge({ type }) {
48
- const labels = {
49
- APP: "App",
50
- NODE: "Node",
51
- WORKFLOW: "Workflow",
52
- TEMPLATE: "Template",
53
- INTEGRATION: "Integration",
54
- EXTENSION: "Extension",
55
- THEME: "Theme"
56
- };
57
- 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 });
58
- }
59
- function ProductCard({ product, onClick, href }) {
60
- const priceLabel = formatPrice(
61
- product.price,
62
- product.currency,
63
- product.pricingModel
64
- );
65
- 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: [
66
- /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-2", children: [
67
- /* @__PURE__ */ jsx("div", { className: "w-12 h-12 rounded-lg bg-muted flex-shrink-0 overflow-hidden", children: product.icon ? /* @__PURE__ */ jsx(
68
- "img",
69
- {
70
- src: product.icon,
71
- alt: "",
72
- "aria-hidden": "true",
73
- className: "w-full h-full object-cover"
74
- }
75
- ) : /* @__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(
76
- "svg",
77
- {
78
- viewBox: "0 0 32 32",
79
- className: "w-8 h-8",
80
- fill: "none",
81
- xmlns: "http://www.w3.org/2000/svg",
82
- "aria-hidden": "true",
83
- children: [
84
- /* @__PURE__ */ jsx(
85
- "polygon",
86
- {
87
- points: "16,4 28,10 16,16 4,10",
88
- className: "fill-primary/30",
89
- stroke: "currentColor",
90
- strokeWidth: "0.6",
91
- strokeOpacity: "0.35"
92
- }
93
- ),
94
- /* @__PURE__ */ jsx(
95
- "polygon",
96
- {
97
- points: "4,10 16,16 16,28 4,22",
98
- className: "fill-primary/15",
99
- stroke: "currentColor",
100
- strokeWidth: "0.6",
101
- strokeOpacity: "0.35"
102
- }
103
- ),
104
- /* @__PURE__ */ jsx(
105
- "polygon",
106
- {
107
- points: "28,10 16,16 16,28 28,22",
108
- className: "fill-primary/20",
109
- stroke: "currentColor",
110
- strokeWidth: "0.6",
111
- strokeOpacity: "0.35"
112
- }
113
- )
114
- ]
115
- }
116
- ) }) }),
117
- /* @__PURE__ */ jsx(TypeBadge, { type: product.type })
118
- ] }),
119
- /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
120
- /* @__PURE__ */ jsx("h3", { className: "font-semibold text-foreground text-sm leading-snug line-clamp-1 group-hover:text-primary transition-colors", children: product.name }),
121
- product.description && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-xs mt-1 line-clamp-2 leading-relaxed", children: product.description })
122
- ] }),
123
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2", children: [
124
- /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1.5", children: product.rating != null && product.rating > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
125
- /* @__PURE__ */ jsx(StarRating, { rating: product.rating }),
126
- /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: product.rating.toFixed(1) })
127
- ] }) : /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: "No reviews yet" }) }),
128
- /* @__PURE__ */ jsx(
129
- "span",
130
- {
131
- className: `text-xs font-semibold ${priceLabel === "Free" ? "text-emerald-700 dark:text-emerald-400" : "text-foreground"}`,
132
- children: priceLabel
133
- }
134
- )
135
- ] })
136
- ] });
137
- if (href) {
138
- return /* @__PURE__ */ jsx("a", { href, onClick, className: "block h-full no-underline", children: inner });
139
- }
140
- return /* @__PURE__ */ jsx(
141
- "button",
142
- {
143
- type: "button",
144
- onClick,
145
- className: "block w-full text-left h-full",
146
- children: inner
147
- }
148
- );
149
- }
150
-
151
- // src/store/queries.ts
152
- var STORE_PRODUCT_FIELDS = `
153
- fragment StoreProductFields on StoreProduct {
154
- id name slug type subType nature status pricingModel
155
- price currency description icon bannerUrl screenshots
156
- category tags featured downloads viewCount rating reviewCount
157
- publisherId authorName license compatibleProducts
158
- }
159
- `;
160
- var HOME_GROUPED_PRODUCTS_QUERY = `
161
- ${STORE_PRODUCT_FIELDS}
162
- query HomeGroupedProducts($compatibleWith: String) {
163
- homeGroupedProducts(compatibleWith: $compatibleWith) {
164
- featured { ...StoreProductFields }
165
- mostDownloaded { ...StoreProductFields }
166
- recentlyAdded { ...StoreProductFields }
167
- freeItems { ...StoreProductFields }
168
- }
169
- }
170
- `;
171
- var BROWSE_STORE_QUERY = `
172
- ${STORE_PRODUCT_FIELDS}
173
- query BrowseStore($input: BrowseStoreInput!) {
174
- browseStore(input: $input) {
175
- products { ...StoreProductFields }
176
- totalCount
177
- hasMore
178
- nextCursor
179
- facets {
180
- types { value count }
181
- categories { value count }
182
- pricingModels { value count }
183
- priceRange { min max }
184
- }
185
- }
186
- }
187
- `;
188
- var STORE_PRODUCT_DETAILS_QUERY = `
189
- ${STORE_PRODUCT_FIELDS}
190
- query StoreProductDetails($input: StoreProductDetailsInput!) {
191
- storeProductDetails(input: $input) {
192
- product { ...StoreProductFields longDescription videoUrls minPlatformVersion }
193
- publisher { id name email websiteUrl logoUrl bio isVerified tier }
194
- reviews { id rating title comment verifiedPurchase helpful createdAt }
195
- reviewsCount
196
- relatedProducts { ...StoreProductFields }
197
- ratingDistribution { fiveStars fourStars threeStars twoStars oneStar }
198
- }
199
- }
200
- `;
201
- var CATEGORIES_QUERY = `
202
- query Categories {
203
- categories {
204
- id name slug description icon parentId
205
- }
206
- }
207
- `;
208
-
209
- // src/client/security.ts
210
- var LOOPBACK_HOSTS = /* @__PURE__ */ new Set(["localhost", "127.0.0.1", "::1"]);
211
- var RESERVED_HEADERS = /* @__PURE__ */ new Set([
212
- "authorization",
213
- "cookie",
214
- "x-actor-id",
215
- "x-actor-type",
216
- "x-consent-granted-by",
217
- "x-consent-scope",
218
- "x-consent-granted-at",
219
- "x-consent-expires-at"
220
- ]);
221
- function validateGatewayUrl(value) {
222
- let url;
223
- try {
224
- url = new URL(value);
225
- } catch {
226
- throw new Error("Gateway URL must be a valid absolute URL");
227
- }
228
- if (url.protocol === "https:") {
229
- return url.toString();
230
- }
231
- if (url.protocol === "http:" && LOOPBACK_HOSTS.has(url.hostname.toLowerCase())) {
232
- return url.toString();
233
- }
234
- throw new Error("Gateway URL must use HTTPS unless it targets localhost");
235
- }
236
- function sanitizeHeaders(headers) {
237
- if (!headers) return void 0;
238
- return Object.fromEntries(
239
- Object.entries(headers).filter(
240
- ([key]) => !RESERVED_HEADERS.has(key.toLowerCase())
241
- )
242
- );
243
- }
244
- var CF_ACCESS_GATED_HOSTS = /* @__PURE__ */ new Set([
245
- "alphagraphql.burdenoff.com",
246
- "alphagraphqlworkspaces.burdenoff.com"
247
- ]);
248
- function cfAccessHeaders(gatewayUrl, cfAccess) {
249
- const clientId = cfAccess?.clientId?.trim();
250
- const clientSecret = cfAccess?.clientSecret?.trim();
251
- if (!clientId || !clientSecret) return {};
252
- let host;
253
- try {
254
- host = new URL(gatewayUrl).hostname.toLowerCase();
255
- } catch {
256
- return {};
257
- }
258
- if (!CF_ACCESS_GATED_HOSTS.has(host)) return {};
259
- return {
260
- "CF-Access-Client-Id": clientId,
261
- "CF-Access-Client-Secret": clientSecret
262
- };
263
- }
264
-
265
- // src/client/graphql-client.ts
266
- var _WebSDKClient = class _WebSDKClient {
267
- constructor(config) {
268
- __publicField(this, "config");
269
- __publicField(this, "queryCache", /* @__PURE__ */ new Map());
270
- __publicField(this, "inflight", /* @__PURE__ */ new Map());
271
- this.config = {
272
- ...config,
273
- gatewayUrl: validateGatewayUrl(config.gatewayUrl),
274
- headers: sanitizeHeaders(config.headers)
275
- };
276
- }
277
- getConfig() {
278
- return this.config;
279
- }
280
- /**
281
- * Execute a GraphQL query (with deduplication and caching).
282
- *
283
- * Pass `{ cache: false }` to bypass the cache entirely — required for poll
284
- * loops, where every tick must reach the network.
285
- */
286
- async query(query, variables, options) {
287
- if (options?.cache === false) {
288
- return this.request(query, variables, true, options.timeoutMs);
289
- }
290
- const cacheKey = JSON.stringify({ query, variables });
291
- const cached = this.queryCache.get(cacheKey);
292
- if (cached) {
293
- if (Date.now() - cached.ts < _WebSDKClient.CACHE_TTL) {
294
- return cached.data;
295
- }
296
- this.queryCache.delete(cacheKey);
297
- }
298
- const existing = this.inflight.get(cacheKey);
299
- if (existing) {
300
- return existing;
301
- }
302
- const promise = this.request(query, variables, true, options?.timeoutMs).then((result) => {
303
- if (result.data && !result.errors?.length) {
304
- if (this.queryCache.size >= _WebSDKClient.MAX_CACHE_ENTRIES) {
305
- const oldestEntry = this.queryCache.keys().next().value;
306
- if (oldestEntry) {
307
- this.queryCache.delete(oldestEntry);
308
- }
309
- }
310
- this.queryCache.set(cacheKey, { data: result, ts: Date.now() });
311
- }
312
- return result;
313
- }).finally(() => {
314
- this.inflight.delete(cacheKey);
315
- });
316
- this.inflight.set(cacheKey, promise);
317
- return promise;
318
- }
319
- /**
320
- * Execute a GraphQL mutation
321
- */
322
- async mutate(mutation, variables, options) {
323
- return this.request(mutation, variables, false, options?.timeoutMs);
324
- }
325
- /** HTTP statuses worth another attempt — transient server/edge conditions. */
326
- static isRetriableStatus(status) {
327
- return status === 429 || status === 408 || status >= 500 && status < 600;
328
- }
329
- static sleep(ms) {
330
- return new Promise((resolve) => setTimeout(resolve, ms));
331
- }
332
- /**
333
- * Perform the HTTP call with a hard timeout. Every outcome resolves to a
334
- * GraphQLResponse — callers never hang, so a UI's `loading` state always
335
- * settles into data or a renderable error.
336
- */
337
- async attempt(query, variables, timeoutMs) {
338
- const controller = new AbortController();
339
- const timer = setTimeout(() => controller.abort(), timeoutMs);
340
- try {
341
- const response = await fetch(this.config.gatewayUrl, {
342
- method: "POST",
343
- headers: {
344
- "Content-Type": "application/json",
345
- "x-product-id": this.config.productId,
346
- ...this.config.headers,
347
- ...cfAccessHeaders(this.config.gatewayUrl, this.config.cfAccess)
348
- },
349
- body: JSON.stringify({ query, variables }),
350
- signal: controller.signal
351
- });
352
- if (!response.ok) {
353
- console.error(
354
- "[WebSDK] GraphQL request failed",
355
- response.status,
356
- response.statusText
357
- );
358
- return {
359
- res: {
360
- errors: [
361
- {
362
- message: `HTTP ${response.status}: ${response.statusText}`,
363
- extensions: { code: `HTTP_${response.status}` }
364
- }
365
- ]
366
- },
367
- retriable: _WebSDKClient.isRetriableStatus(response.status)
368
- };
369
- }
370
- return {
371
- res: await response.json(),
372
- retriable: false
373
- };
374
- } catch (error) {
375
- const aborted = error instanceof Error && (error.name === "AbortError" || controller.signal.aborted);
376
- const message = aborted ? `Request timed out after ${timeoutMs}ms` : error instanceof Error ? error.message : "Network error";
377
- console.error("[WebSDK] Network error", message);
378
- return {
379
- res: {
380
- errors: [
381
- {
382
- message,
383
- extensions: { code: aborted ? "TIMEOUT" : "NETWORK_ERROR" }
384
- }
385
- ]
386
- },
387
- // Transport-level failures are worth one more try; a genuine outage
388
- // just fails twice quickly and still renders an error state.
389
- retriable: true
390
- };
391
- } finally {
392
- clearTimeout(timer);
393
- }
394
- }
395
- async request(query, variables, retry = true, timeoutOverrideMs) {
396
- const timeoutMs = timeoutOverrideMs ?? this.config.timeoutMs ?? _WebSDKClient.DEFAULT_TIMEOUT_MS;
397
- const maxRetries = retry ? this.config.maxRetries ?? _WebSDKClient.DEFAULT_MAX_RETRIES : 0;
398
- let last;
399
- for (let i = 0; i <= maxRetries; i++) {
400
- const { res, retriable } = await this.attempt(
401
- query,
402
- variables,
403
- timeoutMs
404
- );
405
- if (!retriable || i === maxRetries) return res;
406
- last = res;
407
- await _WebSDKClient.sleep(
408
- _WebSDKClient.RETRY_BASE_DELAY_MS * (i + 1) + Math.random() * 200
409
- );
410
- }
411
- return last;
412
- }
413
- };
414
- __publicField(_WebSDKClient, "CACHE_TTL", 5 * 60 * 1e3);
415
- // 5 minutes
416
- __publicField(_WebSDKClient, "MAX_CACHE_ENTRIES", 100);
417
- __publicField(_WebSDKClient, "DEFAULT_TIMEOUT_MS", 12e3);
418
- __publicField(_WebSDKClient, "DEFAULT_MAX_RETRIES", 1);
419
- __publicField(_WebSDKClient, "RETRY_BASE_DELAY_MS", 400);
420
- var WebSDKContext = createContext(null);
421
- function useWebSDK() {
422
- const client = useContext(WebSDKContext);
423
- if (!client) {
424
- throw new Error("useWebSDK must be used within a WebSDKProvider");
425
- }
426
- return client;
427
- }
428
- function canonicalFromLocation() {
429
- if (typeof window === "undefined" || !window.location) return void 0;
430
- const { origin, pathname } = window.location;
431
- if (!origin || origin === "null") return void 0;
432
- const path = pathname === "/" ? "/" : pathname.replace(/\/+$/, "");
433
- return `${origin}${path}`;
434
- }
435
- function resolveImageUrl(image, base) {
436
- if (!image || /^https?:\/\//i.test(image)) return image;
437
- if (!base) return image;
438
- try {
439
- return new URL(image, base).toString();
440
- } catch {
441
- return image;
442
- }
443
- }
444
- function serializeJsonLd(data) {
445
- return JSON.stringify(data).replace(/</g, "\\u003c").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
446
- }
447
- function PageHead({
448
- title,
449
- description,
450
- productName,
451
- keywords,
452
- image,
453
- url,
454
- favicon,
455
- robots = "index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1",
456
- locale = "en_US",
457
- twitterHandle,
458
- themeColor = "#000000",
459
- author,
460
- structuredData,
461
- additionalMeta
462
- }) {
463
- const fullTitle = productName && !title.includes(productName) ? `${title} | ${productName}` : title;
464
- const resolvedUrl = url ?? canonicalFromLocation();
465
- const fullImageUrl = resolveImageUrl(image, resolvedUrl);
466
- const structuredDataItems = structuredData ? Array.isArray(structuredData) ? structuredData : [structuredData] : [];
467
- return /* @__PURE__ */ jsxs(Helmet, { children: [
468
- /* @__PURE__ */ jsx("title", { children: fullTitle }),
469
- /* @__PURE__ */ jsx("meta", { name: "title", content: fullTitle }),
470
- description ? /* @__PURE__ */ jsx("meta", { name: "description", content: description }) : null,
471
- keywords ? /* @__PURE__ */ jsx("meta", { name: "keywords", content: keywords }) : null,
472
- author ? /* @__PURE__ */ jsx("meta", { name: "author", content: author }) : null,
473
- /* @__PURE__ */ jsx("meta", { name: "robots", content: robots }),
474
- resolvedUrl ? /* @__PURE__ */ jsx("link", { rel: "canonical", href: resolvedUrl }) : null,
475
- favicon ? /* @__PURE__ */ jsx("link", { rel: "icon", href: favicon }) : null,
476
- /* @__PURE__ */ jsx("meta", { property: "og:type", content: "website" }),
477
- /* @__PURE__ */ jsx("meta", { property: "og:title", content: fullTitle }),
478
- description ? /* @__PURE__ */ jsx("meta", { property: "og:description", content: description }) : null,
479
- fullImageUrl ? /* @__PURE__ */ jsx("meta", { property: "og:image", content: fullImageUrl }) : null,
480
- resolvedUrl ? /* @__PURE__ */ jsx("meta", { property: "og:url", content: resolvedUrl }) : null,
481
- /* @__PURE__ */ jsx("meta", { property: "og:locale", content: locale }),
482
- productName ? /* @__PURE__ */ jsx("meta", { property: "og:site_name", content: productName }) : null,
483
- /* @__PURE__ */ jsx("meta", { name: "twitter:card", content: "summary_large_image" }),
484
- /* @__PURE__ */ jsx("meta", { name: "twitter:title", content: fullTitle }),
485
- description ? /* @__PURE__ */ jsx("meta", { name: "twitter:description", content: description }) : null,
486
- fullImageUrl ? /* @__PURE__ */ jsx("meta", { name: "twitter:image", content: fullImageUrl }) : null,
487
- twitterHandle ? /* @__PURE__ */ jsx("meta", { name: "twitter:creator", content: twitterHandle }) : null,
488
- /* @__PURE__ */ jsx("meta", { name: "theme-color", content: themeColor }),
489
- structuredDataItems.map((data, index) => /* @__PURE__ */ jsx("script", { type: "application/ld+json", children: serializeJsonLd(data) }, `ld-${index}`)),
490
- additionalMeta?.map((meta, index) => /* @__PURE__ */ jsx(
491
- "meta",
492
- {
493
- ...meta.name ? { name: meta.name } : {},
494
- ...meta.property ? { property: meta.property } : {},
495
- content: meta.content
496
- },
497
- `meta-${index}`
498
- ))
499
- ] });
500
- }
501
- function dedupAcross(lists) {
502
- const seen = /* @__PURE__ */ new Set();
503
- return lists.map((list) => {
504
- const out = [];
505
- for (const p of list) {
506
- if (!seen.has(p.id)) {
507
- seen.add(p.id);
508
- out.push(p);
509
- }
510
- }
511
- return out;
512
- });
513
- }
514
- function FeaturedHeroCard({
515
- product,
516
- onNavigate
517
- }) {
518
- const priceLabel = formatPrice(
519
- product.price,
520
- product.currency,
521
- product.pricingModel
522
- );
523
- return /* @__PURE__ */ jsxs(
524
- "button",
525
- {
526
- type: "button",
527
- onClick: () => onNavigate(`/store/${product.slug}`),
528
- 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",
529
- children: [
530
- /* @__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: [
531
- product.bannerUrl ? /* @__PURE__ */ jsx(
532
- "img",
533
- {
534
- src: product.bannerUrl,
535
- alt: "",
536
- "aria-hidden": "true",
537
- className: "w-full h-full object-cover"
538
- }
539
- ) : /* @__PURE__ */ jsxs(Fragment, { children: [
540
- /* @__PURE__ */ jsxs(
541
- "svg",
542
- {
543
- className: "absolute inset-0 w-full h-full opacity-[0.07]",
544
- xmlns: "http://www.w3.org/2000/svg",
545
- "aria-hidden": "true",
546
- children: [
547
- /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx(
548
- "pattern",
549
- {
550
- id: "fg-hero-grid",
551
- width: "36",
552
- height: "36",
553
- patternUnits: "userSpaceOnUse",
554
- children: /* @__PURE__ */ jsx(
555
- "path",
556
- {
557
- d: "M 36 0 L 0 0 0 36",
558
- fill: "none",
559
- stroke: "currentColor",
560
- strokeWidth: "1"
561
- }
562
- )
563
- }
564
- ) }),
565
- /* @__PURE__ */ jsx("rect", { width: "100%", height: "100%", fill: "url(#fg-hero-grid)" })
566
- ]
567
- }
568
- ),
569
- /* @__PURE__ */ jsx(
570
- "div",
571
- {
572
- className: "absolute inset-0 flex items-center justify-center",
573
- "aria-hidden": "true",
574
- children: /* @__PURE__ */ jsxs(
575
- "svg",
576
- {
577
- viewBox: "0 0 64 64",
578
- className: "w-20 h-20 opacity-25",
579
- fill: "none",
580
- xmlns: "http://www.w3.org/2000/svg",
581
- children: [
582
- /* @__PURE__ */ jsx(
583
- "polygon",
584
- {
585
- points: "32,8 56,20 32,32 8,20",
586
- className: "fill-primary/40",
587
- stroke: "currentColor",
588
- strokeWidth: "1",
589
- strokeOpacity: "0.5"
590
- }
591
- ),
592
- /* @__PURE__ */ jsx(
593
- "polygon",
594
- {
595
- points: "8,20 32,32 32,56 8,44",
596
- className: "fill-primary/20",
597
- stroke: "currentColor",
598
- strokeWidth: "1",
599
- strokeOpacity: "0.5"
600
- }
601
- ),
602
- /* @__PURE__ */ jsx(
603
- "polygon",
604
- {
605
- points: "56,20 32,32 32,56 56,44",
606
- className: "fill-primary/30",
607
- stroke: "currentColor",
608
- strokeWidth: "1",
609
- strokeOpacity: "0.5"
610
- }
611
- )
612
- ]
613
- }
614
- )
615
- }
616
- )
617
- ] }),
618
- /* @__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" }),
619
- /* @__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(
620
- "img",
621
- {
622
- src: product.icon,
623
- alt: "",
624
- "aria-hidden": "true",
625
- className: "w-full h-full object-cover"
626
- }
627
- ) : /* @__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(
628
- "svg",
629
- {
630
- viewBox: "0 0 32 32",
631
- className: "w-8 h-8",
632
- fill: "none",
633
- xmlns: "http://www.w3.org/2000/svg",
634
- "aria-hidden": "true",
635
- children: [
636
- /* @__PURE__ */ jsx(
637
- "polygon",
638
- {
639
- points: "16,4 28,10 16,16 4,10",
640
- className: "fill-primary/40",
641
- stroke: "currentColor",
642
- strokeWidth: "0.6",
643
- strokeOpacity: "0.4"
644
- }
645
- ),
646
- /* @__PURE__ */ jsx(
647
- "polygon",
648
- {
649
- points: "4,10 16,16 16,28 4,22",
650
- className: "fill-primary/20",
651
- stroke: "currentColor",
652
- strokeWidth: "0.6",
653
- strokeOpacity: "0.4"
654
- }
655
- ),
656
- /* @__PURE__ */ jsx(
657
- "polygon",
658
- {
659
- points: "28,10 16,16 16,28 28,22",
660
- className: "fill-primary/30",
661
- stroke: "currentColor",
662
- strokeWidth: "0.6",
663
- strokeOpacity: "0.4"
664
- }
665
- )
666
- ]
667
- }
668
- ) }) })
669
- ] }),
670
- /* @__PURE__ */ jsxs("div", { className: "p-5 flex flex-col flex-1", children: [
671
- /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-3 mb-2", children: [
672
- /* @__PURE__ */ jsx("h3", { className: "text-base font-bold text-foreground group-hover:text-primary transition-colors line-clamp-1", children: product.name }),
673
- /* @__PURE__ */ jsx(
674
- "span",
675
- {
676
- className: `text-sm font-bold flex-shrink-0 ${priceLabel === "Free" ? "text-emerald-700 dark:text-emerald-400" : "text-foreground"}`,
677
- children: priceLabel
678
- }
679
- )
680
- ] }),
681
- product.description && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground line-clamp-2 leading-relaxed flex-1", children: product.description }),
682
- /* @__PURE__ */ jsxs("div", { className: "mt-3 flex items-center gap-2", children: [
683
- /* @__PURE__ */ jsx("span", { className: "text-xs px-2 py-0.5 rounded-full bg-primary/10 text-primary font-medium", children: product.type }),
684
- product.authorName && /* @__PURE__ */ jsxs("span", { className: "text-xs text-muted-foreground truncate", children: [
685
- "by ",
686
- product.authorName
687
- ] })
688
- ] })
689
- ] })
690
- ]
691
- }
692
- );
693
- }
694
- function ScrollRow({
695
- products,
696
- onProductClick
697
- }) {
698
- const ref = useRef(null);
699
- function scroll(dir) {
700
- ref.current?.scrollBy({
701
- left: dir === "r" ? 272 : -272,
702
- behavior: "smooth"
703
- });
704
- }
705
- return /* @__PURE__ */ jsxs("div", { className: "relative group/row", children: [
706
- /* @__PURE__ */ jsx(
707
- "button",
708
- {
709
- type: "button",
710
- onClick: () => scroll("l"),
711
- "aria-label": "Scroll left",
712
- 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",
713
- children: /* @__PURE__ */ jsx(
714
- "svg",
715
- {
716
- viewBox: "0 0 16 16",
717
- className: "w-4 h-4",
718
- fill: "none",
719
- stroke: "currentColor",
720
- strokeWidth: "1.5",
721
- strokeLinecap: "round",
722
- strokeLinejoin: "round",
723
- children: /* @__PURE__ */ jsx("path", { d: "M10 3L6 8l4 5" })
724
- }
725
- )
726
- }
727
- ),
728
- /* @__PURE__ */ jsx(
729
- "div",
730
- {
731
- ref,
732
- className: "flex gap-3 overflow-x-auto pb-1 snap-x snap-mandatory",
733
- style: { scrollbarWidth: "none", msOverflowStyle: "none" },
734
- children: products.map((product) => /* @__PURE__ */ jsx("div", { className: "flex-shrink-0 w-56 snap-start", children: /* @__PURE__ */ jsx(
735
- ProductCard,
736
- {
737
- product,
738
- onClick: () => onProductClick(product)
739
- }
740
- ) }, product.id))
741
- }
742
- ),
743
- /* @__PURE__ */ jsx(
744
- "button",
745
- {
746
- type: "button",
747
- onClick: () => scroll("r"),
748
- "aria-label": "Scroll right",
749
- 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",
750
- children: /* @__PURE__ */ jsx(
751
- "svg",
752
- {
753
- viewBox: "0 0 16 16",
754
- className: "w-4 h-4",
755
- fill: "none",
756
- stroke: "currentColor",
757
- strokeWidth: "1.5",
758
- strokeLinecap: "round",
759
- strokeLinejoin: "round",
760
- children: /* @__PURE__ */ jsx("path", { d: "M6 3l4 5-4 5" })
761
- }
762
- )
763
- }
764
- )
765
- ] });
766
- }
767
- function SectionHead({
768
- title,
769
- hint,
770
- browseHref,
771
- onNavigate
772
- }) {
773
- return /* @__PURE__ */ jsxs("div", { className: "flex items-end justify-between mb-5 gap-4", children: [
774
- /* @__PURE__ */ jsxs("div", { children: [
775
- /* @__PURE__ */ jsx("h2", { className: "text-xl font-bold text-foreground", children: title }),
776
- hint && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mt-0.5", children: hint })
777
- ] }),
778
- /* @__PURE__ */ jsx(
779
- "button",
780
- {
781
- type: "button",
782
- onClick: () => onNavigate(browseHref),
783
- className: "text-sm text-primary hover:underline font-medium flex-shrink-0 underline-offset-2",
784
- children: "See all \u2192"
785
- }
786
- )
787
- ] });
788
- }
789
- var DEFAULT_TYPE_FILTERS = [
790
- { type: "NODE", label: "Nodes" },
791
- { type: "WORKFLOW", label: "Workflows" },
792
- { type: "TEMPLATE", label: "Templates" },
793
- { type: "INTEGRATION", label: "Integrations" },
794
- { type: "APP", label: "Apps" },
795
- { type: "EXTENSION", label: "Extensions" }
796
- ];
797
- function TypeFilters({
798
- browsePath,
799
- onNavigate,
800
- typeFilters
801
- }) {
802
- return /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2 justify-center", children: typeFilters.map((f) => /* @__PURE__ */ jsx(
803
- "button",
804
- {
805
- type: "button",
806
- onClick: () => onNavigate(`${browsePath}?type=${f.type}`),
807
- 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",
808
- children: f.label
809
- },
810
- f.type
811
- )) });
812
- }
813
- function HeroCardSkeleton() {
814
- return /* @__PURE__ */ jsxs("div", { className: "rounded-2xl border border-border bg-card overflow-hidden animate-pulse h-full", children: [
815
- /* @__PURE__ */ jsx("div", { className: "h-44 sm:h-52 bg-muted" }),
816
- /* @__PURE__ */ jsxs("div", { className: "p-5 space-y-3", children: [
817
- /* @__PURE__ */ jsx("div", { className: "h-5 bg-muted rounded w-1/2" }),
818
- /* @__PURE__ */ jsx("div", { className: "h-3 bg-muted rounded w-3/4" }),
819
- /* @__PURE__ */ jsx("div", { className: "h-3 bg-muted rounded w-5/6" }),
820
- /* @__PURE__ */ jsx("div", { className: "h-5 bg-muted rounded w-16 mt-2" })
821
- ] })
822
- ] });
823
- }
824
- function GridCardSkeleton() {
825
- return /* @__PURE__ */ jsxs("div", { className: "rounded-xl border border-border bg-card p-4 h-36 animate-pulse", children: [
826
- /* @__PURE__ */ jsxs("div", { className: "flex gap-3 mb-3", children: [
827
- /* @__PURE__ */ jsx("div", { className: "w-12 h-12 rounded-lg bg-muted flex-shrink-0" }),
828
- /* @__PURE__ */ jsxs("div", { className: "flex-1 space-y-2 pt-1", children: [
829
- /* @__PURE__ */ jsx("div", { className: "h-3 bg-muted rounded w-3/4" }),
830
- /* @__PURE__ */ jsx("div", { className: "h-3 bg-muted rounded w-1/2" })
831
- ] })
832
- ] }),
833
- /* @__PURE__ */ jsx("div", { className: "h-3 bg-muted rounded w-full mb-2" }),
834
- /* @__PURE__ */ jsx("div", { className: "h-3 bg-muted rounded w-5/6" })
835
- ] });
836
- }
837
- function ScrollCardSkeleton() {
838
- return /* @__PURE__ */ jsxs("div", { className: "flex-shrink-0 w-56 rounded-xl border border-border bg-card p-4 h-36 animate-pulse", children: [
839
- /* @__PURE__ */ jsxs("div", { className: "flex gap-3 mb-3", children: [
840
- /* @__PURE__ */ jsx("div", { className: "w-12 h-12 rounded-lg bg-muted flex-shrink-0" }),
841
- /* @__PURE__ */ jsxs("div", { className: "flex-1 space-y-2 pt-1", children: [
842
- /* @__PURE__ */ jsx("div", { className: "h-3 bg-muted rounded w-3/4" }),
843
- /* @__PURE__ */ jsx("div", { className: "h-3 bg-muted rounded w-1/2" })
844
- ] })
845
- ] }),
846
- /* @__PURE__ */ jsx("div", { className: "h-3 bg-muted rounded w-full mb-2" }),
847
- /* @__PURE__ */ jsx("div", { className: "h-3 bg-muted rounded w-5/6" })
848
- ] });
849
- }
850
- function StoreHomePage({
851
- compatibleWith,
852
- appLoginUrl,
853
- onNavigate,
854
- terminology,
855
- productName,
856
- heroTitle,
857
- heroSubtitle,
858
- browsePath = "/store/browse",
859
- seoTitle,
860
- seoDescription,
861
- seoKeywords
862
- }) {
863
- const client = useWebSDK();
864
- const [grouped, setGrouped] = useState(null);
865
- const [loading, setLoading] = useState(true);
866
- const [error, setError] = useState(null);
867
- const [retryKey, setRetryKey] = useState(0);
868
- useEffect(() => {
869
- let cancelled = false;
870
- let autoRetryTimer = null;
871
- async function load() {
872
- setLoading(true);
873
- try {
874
- const res = await client.query(
875
- HOME_GROUPED_PRODUCTS_QUERY,
876
- { compatibleWith: compatibleWith ?? null }
877
- );
878
- if (cancelled) return;
879
- if (res.errors?.length) throw new Error(res.errors[0].message);
880
- if (!res.data?.homeGroupedProducts) throw new Error("No data");
881
- setGrouped(res.data.homeGroupedProducts);
882
- setError(null);
883
- } catch {
884
- if (!cancelled) {
885
- if (retryKey < 1) {
886
- autoRetryTimer = setTimeout(() => {
887
- if (!cancelled) setRetryKey(1);
888
- }, 2e3);
889
- } else {
890
- setError("Failed to load store. Please try again.");
891
- }
892
- }
893
- } finally {
894
- if (!cancelled) setLoading(false);
895
- }
896
- }
897
- load();
898
- return () => {
899
- cancelled = true;
900
- if (autoRetryTimer) clearTimeout(autoRetryTimer);
901
- };
902
- }, [client, compatibleWith, retryKey]);
903
- function navigate(path) {
904
- if (onNavigate) {
905
- onNavigate(path);
906
- return;
907
- }
908
- window.location.href = path;
909
- }
910
- function handleProductClick(product) {
911
- navigate(`/store/${product.slug}`);
912
- }
913
- const deduped = grouped ? dedupAcross([grouped.featured, grouped.mostDownloaded, grouped.freeItems]) : [[], [], []];
914
- const featuredItems = deduped[0] ?? [];
915
- const popularItems = deduped[1] ?? [];
916
- const freeItems = deduped[2] ?? [];
917
- const hasNoItems = !loading && !error && featuredItems.length === 0 && popularItems.length === 0 && freeItems.length === 0;
918
- const resolvedTitle = heroTitle ?? `${productName ? `${productName} ` : ""}Store`;
919
- const resolvedSubtitle = heroSubtitle ?? "Discover workflows, nodes, integrations, and templates built by the community.";
920
- const typeFilters = terminology?.typeFilters ?? DEFAULT_TYPE_FILTERS;
921
- const searchPlaceholder = terminology?.searchPlaceholder ?? "Search nodes, workflows, templates\u2026";
922
- const emptyStateDescription = terminology?.emptyStateDescription ?? "As the community ships workflows, templates, and integrations, they will show up right here.";
923
- const publisherCtaDescription = terminology?.publisherCtaDescription ?? `Share your workflows, nodes, and integrations with ${productName ? "the " : ""}community. Earn from your work or contribute for free.`;
924
- return /* @__PURE__ */ jsxs("div", { className: "w-full", children: [
925
- /* @__PURE__ */ jsx(
926
- PageHead,
927
- {
928
- title: seoTitle ?? `Store${productName ? ` \u2013 ${productName}` : ""}`,
929
- description: seoDescription ?? resolvedSubtitle,
930
- keywords: seoKeywords,
931
- productName
932
- }
933
- ),
934
- /* @__PURE__ */ jsxs("section", { className: "relative overflow-hidden pt-14 pb-12 sm:pt-20 sm:pb-16", children: [
935
- /* @__PURE__ */ jsx(
936
- "div",
937
- {
938
- className: "absolute inset-0 bg-gradient-to-b from-background via-primary/[0.06] to-background pointer-events-none",
939
- "aria-hidden": "true"
940
- }
941
- ),
942
- /* @__PURE__ */ jsxs(
943
- "svg",
944
- {
945
- className: "absolute inset-0 w-full h-full opacity-[0.035] pointer-events-none",
946
- xmlns: "http://www.w3.org/2000/svg",
947
- "aria-hidden": "true",
948
- children: [
949
- /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx(
950
- "pattern",
951
- {
952
- id: "store-home-grid",
953
- width: "40",
954
- height: "40",
955
- patternUnits: "userSpaceOnUse",
956
- children: /* @__PURE__ */ jsx(
957
- "path",
958
- {
959
- d: "M 40 0 L 0 0 0 40",
960
- fill: "none",
961
- stroke: "currentColor",
962
- strokeWidth: "1"
963
- }
964
- )
965
- }
966
- ) }),
967
- /* @__PURE__ */ jsx("rect", { width: "100%", height: "100%", fill: "url(#store-home-grid)" })
968
- ]
969
- }
970
- ),
971
- /* @__PURE__ */ jsx(
972
- "div",
973
- {
974
- className: "absolute -top-16 left-1/3 w-80 h-80 rounded-full bg-primary/10 blur-3xl pointer-events-none",
975
- "aria-hidden": "true"
976
- }
977
- ),
978
- /* @__PURE__ */ jsx(
979
- "div",
980
- {
981
- className: "absolute top-8 right-1/4 w-56 h-56 rounded-full bg-primary/8 blur-2xl pointer-events-none",
982
- "aria-hidden": "true"
983
- }
984
- ),
985
- /* @__PURE__ */ jsxs("div", { className: "relative max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 text-center", children: [
986
- /* @__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: [
987
- /* @__PURE__ */ jsx(
988
- "span",
989
- {
990
- className: "w-1.5 h-1.5 rounded-full bg-primary flex-shrink-0",
991
- "aria-hidden": "true"
992
- }
993
- ),
994
- "Community Marketplace"
995
- ] }),
996
- /* @__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 }),
997
- /* @__PURE__ */ jsx("p", { className: "text-lg text-muted-foreground max-w-2xl mx-auto mb-8 leading-relaxed", children: resolvedSubtitle }),
998
- /* @__PURE__ */ jsxs(
999
- "form",
1000
- {
1001
- className: "max-w-xl mx-auto flex gap-2 mb-7",
1002
- onSubmit: (e) => {
1003
- e.preventDefault();
1004
- const q = new FormData(e.currentTarget).get("q");
1005
- navigate(
1006
- q.trim() ? `${browsePath}?q=${encodeURIComponent(q.trim())}` : browsePath
1007
- );
1008
- },
1009
- children: [
1010
- /* @__PURE__ */ jsx(
1011
- "input",
1012
- {
1013
- name: "q",
1014
- type: "search",
1015
- placeholder: searchPlaceholder,
1016
- 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"
1017
- }
1018
- ),
1019
- /* @__PURE__ */ jsx(
1020
- "button",
1021
- {
1022
- type: "submit",
1023
- className: "h-12 px-6 rounded-xl bg-primary text-primary-foreground text-sm font-semibold hover:opacity-90 transition-opacity shadow-sm",
1024
- children: "Search"
1025
- }
1026
- )
1027
- ]
1028
- }
1029
- ),
1030
- /* @__PURE__ */ jsx(
1031
- TypeFilters,
1032
- {
1033
- browsePath,
1034
- onNavigate: navigate,
1035
- typeFilters
1036
- }
1037
- )
1038
- ] })
1039
- ] }),
1040
- /* @__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: [
1041
- (loading || error || featuredItems.length > 0) && /* @__PURE__ */ jsxs("section", { children: [
1042
- /* @__PURE__ */ jsx(
1043
- SectionHead,
1044
- {
1045
- title: "Featured",
1046
- hint: "Hand-picked highlights from the community",
1047
- browseHref: `${browsePath}?featured=true`,
1048
- onNavigate: navigate
1049
- }
1050
- ),
1051
- loading ? /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 lg:grid-cols-[1fr_2fr] gap-4 items-start", children: [
1052
- /* @__PURE__ */ jsx(HeroCardSkeleton, {}),
1053
- /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [...Array(4)].map((_, i) => /* @__PURE__ */ jsx(GridCardSkeleton, {}, i)) })
1054
- ] }) : error ? /* @__PURE__ */ jsxs("div", { className: "py-16 text-center", children: [
1055
- /* @__PURE__ */ jsx("p", { className: "text-muted-foreground mb-4", children: error }),
1056
- /* @__PURE__ */ jsx(
1057
- "button",
1058
- {
1059
- type: "button",
1060
- onClick: () => setRetryKey((k) => k + 1),
1061
- className: "text-sm text-primary hover:underline",
1062
- children: "Retry"
1063
- }
1064
- )
1065
- ] }) : featuredItems.length > 0 ? /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 lg:grid-cols-[1fr_2fr] gap-4 items-start", children: [
1066
- /* @__PURE__ */ jsx(
1067
- FeaturedHeroCard,
1068
- {
1069
- product: featuredItems[0],
1070
- onNavigate: navigate
1071
- }
1072
- ),
1073
- /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: featuredItems.slice(1, 5).map((product) => /* @__PURE__ */ jsx(
1074
- ProductCard,
1075
- {
1076
- product,
1077
- onClick: () => handleProductClick(product)
1078
- },
1079
- product.id
1080
- )) })
1081
- ] }) : null
1082
- ] }),
1083
- (loading || popularItems.length > 0) && /* @__PURE__ */ jsxs("section", { children: [
1084
- /* @__PURE__ */ jsx(
1085
- SectionHead,
1086
- {
1087
- title: "Most Popular",
1088
- hint: "Top downloads across the community",
1089
- browseHref: `${browsePath}?sortBy=DOWNLOADS`,
1090
- onNavigate: navigate
1091
- }
1092
- ),
1093
- loading ? /* @__PURE__ */ jsx("div", { className: "flex gap-3 overflow-hidden", children: [...Array(5)].map((_, i) => /* @__PURE__ */ jsx(ScrollCardSkeleton, {}, i)) }) : /* @__PURE__ */ jsx(
1094
- ScrollRow,
1095
- {
1096
- products: popularItems,
1097
- onProductClick: handleProductClick
1098
- }
1099
- )
1100
- ] }),
1101
- (loading || freeItems.length > 0) && /* @__PURE__ */ jsxs("section", { children: [
1102
- /* @__PURE__ */ jsx(
1103
- SectionHead,
1104
- {
1105
- title: "Free to Use",
1106
- hint: "Zero cost, full power \u2014 community-contributed freebies",
1107
- browseHref: `${browsePath}?pricingModel=FREE`,
1108
- onNavigate: navigate
1109
- }
1110
- ),
1111
- 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(
1112
- ProductCard,
1113
- {
1114
- product,
1115
- onClick: () => handleProductClick(product)
1116
- },
1117
- product.id
1118
- )) })
1119
- ] }),
1120
- hasNoItems && /* @__PURE__ */ jsxs(
1121
- "section",
1122
- {
1123
- "data-store": "empty-state",
1124
- className: "rounded-2xl border border-border bg-card/50 px-6 py-14 sm:py-16 text-center",
1125
- children: [
1126
- /* @__PURE__ */ jsx(
1127
- "div",
1128
- {
1129
- className: "mx-auto mb-5 flex h-14 w-14 items-center justify-center rounded-2xl bg-primary/10",
1130
- "aria-hidden": "true",
1131
- children: /* @__PURE__ */ jsx(
1132
- "svg",
1133
- {
1134
- viewBox: "0 0 24 24",
1135
- fill: "none",
1136
- stroke: "currentColor",
1137
- strokeWidth: "1.5",
1138
- className: "h-7 w-7 text-primary",
1139
- children: /* @__PURE__ */ jsx(
1140
- "path",
1141
- {
1142
- strokeLinecap: "round",
1143
- strokeLinejoin: "round",
1144
- 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"
1145
- }
1146
- )
1147
- }
1148
- )
1149
- }
1150
- ),
1151
- /* @__PURE__ */ jsxs("h2", { className: "text-xl sm:text-2xl font-bold text-foreground mb-2", children: [
1152
- "The ",
1153
- productName ?? "store",
1154
- " catalogue is just getting started"
1155
- ] }),
1156
- /* @__PURE__ */ jsxs("p", { className: "text-sm sm:text-base text-muted-foreground max-w-xl mx-auto mb-7", children: [
1157
- "No items have been published for ",
1158
- productName ?? "this product",
1159
- " ",
1160
- "yet. ",
1161
- emptyStateDescription
1162
- ] }),
1163
- /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center justify-center gap-3", children: [
1164
- /* @__PURE__ */ jsx(
1165
- "button",
1166
- {
1167
- type: "button",
1168
- onClick: () => navigate(browsePath),
1169
- 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",
1170
- children: "Browse the full store"
1171
- }
1172
- ),
1173
- /* @__PURE__ */ jsx(
1174
- "a",
1175
- {
1176
- href: appLoginUrl,
1177
- 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",
1178
- children: "Become a publisher"
1179
- }
1180
- )
1181
- ] })
1182
- ]
1183
- }
1184
- )
1185
- ] }),
1186
- /* @__PURE__ */ jsxs("section", { className: "relative overflow-hidden border-t border-border", children: [
1187
- /* @__PURE__ */ jsx(
1188
- "div",
1189
- {
1190
- className: "absolute inset-0 bg-gradient-to-br from-primary/8 via-background to-primary/5 pointer-events-none",
1191
- "aria-hidden": "true"
1192
- }
1193
- ),
1194
- /* @__PURE__ */ jsx(
1195
- "div",
1196
- {
1197
- 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",
1198
- "aria-hidden": "true"
1199
- }
1200
- ),
1201
- /* @__PURE__ */ jsxs("div", { className: "relative max-w-2xl mx-auto px-4 py-16 text-center", children: [
1202
- /* @__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: [
1203
- /* @__PURE__ */ jsx(
1204
- "span",
1205
- {
1206
- className: "w-1.5 h-1.5 rounded-full bg-primary flex-shrink-0",
1207
- "aria-hidden": "true"
1208
- }
1209
- ),
1210
- "Become a publisher"
1211
- ] }),
1212
- /* @__PURE__ */ jsx("h2", { className: "text-2xl sm:text-3xl font-bold text-foreground mb-3", children: "Built something useful?" }),
1213
- /* @__PURE__ */ jsx("p", { className: "text-muted-foreground mb-8 max-w-lg mx-auto leading-relaxed", children: publisherCtaDescription }),
1214
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col sm:flex-row gap-3 justify-center", children: [
1215
- /* @__PURE__ */ jsx(
1216
- "a",
1217
- {
1218
- href: appLoginUrl,
1219
- target: "_blank",
1220
- rel: "noopener noreferrer",
1221
- 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",
1222
- children: "Submit to Store"
1223
- }
1224
- ),
1225
- /* @__PURE__ */ jsx(
1226
- "button",
1227
- {
1228
- type: "button",
1229
- onClick: () => navigate(browsePath),
1230
- 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",
1231
- children: "Browse the store"
1232
- }
1233
- )
1234
- ] }),
1235
- /* @__PURE__ */ jsxs("p", { className: "mt-4 text-xs text-muted-foreground", children: [
1236
- "By submitting a listing you agree to the",
1237
- " ",
1238
- /* @__PURE__ */ jsx(
1239
- "a",
1240
- {
1241
- href: "https://burdenoff.com/developer-agreement",
1242
- target: "_blank",
1243
- rel: "noopener noreferrer",
1244
- className: "underline hover:text-foreground",
1245
- children: "Marketplace & Developer Agreement"
1246
- }
1247
- ),
1248
- "."
1249
- ] })
1250
- ] })
1251
- ] })
1252
- ] });
1253
- }
1254
- var SORT_OPTIONS = [
1255
- { value: "RELEVANCE", label: "Relevance" },
1256
- { value: "NEWEST", label: "Newest" },
1257
- { value: "DOWNLOADS", label: "Most Downloaded" },
1258
- { value: "RATING", label: "Top Rated" },
1259
- { value: "PRICE_LOW", label: "Price: Low to High" },
1260
- { value: "PRICE_HIGH", label: "Price: High to Low" },
1261
- { value: "NAME_ASC", label: "Name A\u2013Z" }
1262
- ];
1263
- var DEFAULT_TYPE_OPTIONS = [
1264
- { type: "APP", label: "Apps" },
1265
- { type: "NODE", label: "Nodes" },
1266
- { type: "WORKFLOW", label: "Workflows" },
1267
- { type: "TEMPLATE", label: "Templates" },
1268
- { type: "INTEGRATION", label: "Integrations" },
1269
- { type: "EXTENSION", label: "Extensions" },
1270
- { type: "THEME", label: "Themes" }
1271
- ];
1272
- function buildTypeOptions(typeFilters) {
1273
- return [{ type: "", label: "All types" }, ...typeFilters];
1274
- }
1275
- var PRICING_OPTIONS = [
1276
- { value: "", label: "All pricing" },
1277
- { value: "FREE", label: "Free" },
1278
- { value: "ONE_TIME", label: "Paid (one-time)" },
1279
- { value: "SUBSCRIPTION", label: "Subscription" }
1280
- ];
1281
- function parseUrlParams() {
1282
- if (typeof window === "undefined")
1283
- return {
1284
- q: "",
1285
- type: "",
1286
- pricingModel: "",
1287
- category: "",
1288
- sortBy: "RELEVANCE",
1289
- featured: false
1290
- };
1291
- const p = new URLSearchParams(window.location.search);
1292
- return {
1293
- q: p.get("q") ?? "",
1294
- type: p.get("type") ?? "",
1295
- pricingModel: p.get("pricingModel") ?? "",
1296
- category: p.get("category") ?? "",
1297
- sortBy: p.get("sortBy") ?? (p.get("q") ? "RELEVANCE" : "NEWEST"),
1298
- featured: p.get("featured") === "true"
1299
- };
1300
- }
1301
- function FacetList({
1302
- title,
1303
- facets,
1304
- selected,
1305
- onSelect
1306
- }) {
1307
- if (facets.length === 0) return null;
1308
- return /* @__PURE__ */ jsxs("div", { children: [
1309
- /* @__PURE__ */ jsx("p", { className: "text-xs font-semibold uppercase tracking-wider text-muted-foreground mb-2", children: title }),
1310
- /* @__PURE__ */ jsx("ul", { className: "space-y-1", children: facets.map((f) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(
1311
- "button",
1312
- {
1313
- type: "button",
1314
- onClick: () => onSelect(selected === f.value ? "" : f.value),
1315
- 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"}`,
1316
- children: [
1317
- /* @__PURE__ */ jsx("span", { className: "truncate", children: f.value }),
1318
- /* @__PURE__ */ jsx("span", { className: "text-xs flex-shrink-0", children: f.count })
1319
- ]
1320
- }
1321
- ) }, f.value)) })
1322
- ] });
1323
- }
1324
- function StoreBrowsePage({
1325
- compatibleWith,
1326
- onNavigate,
1327
- terminology,
1328
- productName,
1329
- seoTitle,
1330
- seoDescription
1331
- }) {
1332
- const client = useWebSDK();
1333
- const typeFilters = terminology?.typeFilters ?? DEFAULT_TYPE_OPTIONS;
1334
- const typeOptions = buildTypeOptions(typeFilters);
1335
- const browseDescription = terminology?.browseDescription ?? "Browse all apps, workflows, nodes, and templates.";
1336
- const initial = parseUrlParams();
1337
- const [search, setSearch] = useState(initial.q);
1338
- const [inputValue, setInputValue] = useState(initial.q);
1339
- const [type, setType] = useState(initial.type);
1340
- const [pricingModel, setPricingModel] = useState(initial.pricingModel);
1341
- const [category, setCategory] = useState(initial.category);
1342
- const [sortBy, setSortBy] = useState(initial.sortBy);
1343
- const [featured, setFeatured] = useState(initial.featured);
1344
- const [offset, setOffset] = useState(0);
1345
- const [result, setResult] = useState(null);
1346
- const [allProducts, setAllProducts] = useState(
1347
- []
1348
- );
1349
- const [categories, setCategories] = useState([]);
1350
- const [loading, setLoading] = useState(true);
1351
- const [loadingMore, setLoadingMore] = useState(false);
1352
- const [filtersOpen, setFiltersOpen] = useState(false);
1353
- const searchRef = useRef(null);
1354
- const PAGE_SIZE = 24;
1355
- useEffect(() => {
1356
- client.query(CATEGORIES_QUERY, {}).then((r) => {
1357
- if (r.data?.categories) setCategories(r.data.categories);
1358
- }).catch(() => {
1359
- });
1360
- }, [client]);
1361
- useEffect(() => {
1362
- let cancelled = false;
1363
- setOffset(0);
1364
- setLoading(true);
1365
- setAllProducts([]);
1366
- client.query(BROWSE_STORE_QUERY, {
1367
- input: {
1368
- filter: {
1369
- search: search || void 0,
1370
- type: type || void 0,
1371
- pricingModel: pricingModel || void 0,
1372
- category: category || void 0,
1373
- compatibleWith: compatibleWith ?? void 0,
1374
- featured: featured || void 0
1375
- },
1376
- sortBy,
1377
- pagination: { limit: PAGE_SIZE, offset: 0 }
1378
- }
1379
- }).then((r) => {
1380
- if (cancelled) return;
1381
- if (r.data?.browseStore) {
1382
- setResult(r.data.browseStore);
1383
- setAllProducts(r.data.browseStore.products);
1384
- }
1385
- }).catch(() => {
1386
- }).finally(() => {
1387
- if (!cancelled) setLoading(false);
1388
- });
1389
- return () => {
1390
- cancelled = true;
1391
- };
1392
- }, [
1393
- client,
1394
- search,
1395
- type,
1396
- pricingModel,
1397
- category,
1398
- sortBy,
1399
- compatibleWith,
1400
- featured
1401
- ]);
1402
- function loadMore() {
1403
- const nextOffset = offset + PAGE_SIZE;
1404
- setLoadingMore(true);
1405
- client.query(BROWSE_STORE_QUERY, {
1406
- input: {
1407
- filter: {
1408
- search: search || void 0,
1409
- type: type || void 0,
1410
- pricingModel: pricingModel || void 0,
1411
- category: category || void 0,
1412
- compatibleWith: compatibleWith ?? void 0,
1413
- featured: featured || void 0
1414
- },
1415
- sortBy,
1416
- pagination: { limit: PAGE_SIZE, offset: nextOffset }
1417
- }
1418
- }).then((r) => {
1419
- if (r.data?.browseStore) {
1420
- setResult(r.data.browseStore);
1421
- setAllProducts((prev) => [...prev, ...r.data.browseStore.products]);
1422
- setOffset(nextOffset);
1423
- }
1424
- }).catch(() => {
1425
- }).finally(() => setLoadingMore(false));
1426
- }
1427
- function navigate(path) {
1428
- if (onNavigate) {
1429
- onNavigate(path);
1430
- return;
1431
- }
1432
- window.location.href = path;
1433
- }
1434
- function handleSearchSubmit(e) {
1435
- e.preventDefault();
1436
- setSearch(inputValue);
1437
- setSortBy(inputValue ? "RELEVANCE" : "NEWEST");
1438
- }
1439
- function resetFilters() {
1440
- setSearch("");
1441
- setInputValue("");
1442
- setType("");
1443
- setPricingModel("");
1444
- setCategory("");
1445
- setSortBy("NEWEST");
1446
- setFeatured(false);
1447
- searchRef.current?.focus();
1448
- }
1449
- const hasActiveFilters = !!(search || type || pricingModel || category || featured);
1450
- const facetTypes = result?.facets?.types ?? [];
1451
- const facetCategories = result?.facets?.categories ?? [];
1452
- const sidebarContent = /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
1453
- /* @__PURE__ */ jsxs("div", { children: [
1454
- /* @__PURE__ */ jsx("p", { className: "text-xs font-semibold uppercase tracking-wider text-muted-foreground mb-2", children: "Type" }),
1455
- /* @__PURE__ */ jsx("div", { className: "space-y-1", children: typeOptions.map((opt) => /* @__PURE__ */ jsx(
1456
- "button",
1457
- {
1458
- type: "button",
1459
- onClick: () => setType(opt.type),
1460
- 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"}`,
1461
- children: opt.label
1462
- },
1463
- opt.type
1464
- )) })
1465
- ] }),
1466
- /* @__PURE__ */ jsxs("div", { children: [
1467
- /* @__PURE__ */ jsx("p", { className: "text-xs font-semibold uppercase tracking-wider text-muted-foreground mb-2", children: "Pricing" }),
1468
- /* @__PURE__ */ jsx("div", { className: "space-y-1", children: PRICING_OPTIONS.map((opt) => /* @__PURE__ */ jsx(
1469
- "button",
1470
- {
1471
- type: "button",
1472
- onClick: () => setPricingModel(opt.value),
1473
- 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"}`,
1474
- children: opt.label
1475
- },
1476
- opt.value
1477
- )) })
1478
- ] }),
1479
- (facetCategories.length > 0 || categories.length > 0) && /* @__PURE__ */ jsxs("div", { children: [
1480
- /* @__PURE__ */ jsx("p", { className: "text-xs font-semibold uppercase tracking-wider text-muted-foreground mb-2", children: "Category" }),
1481
- /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
1482
- /* @__PURE__ */ jsx(
1483
- "button",
1484
- {
1485
- type: "button",
1486
- onClick: () => setCategory(""),
1487
- 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"}`,
1488
- children: "All categories"
1489
- }
1490
- ),
1491
- (facetCategories.length > 0 ? facetCategories : categories.slice(0, 12).map((c) => ({ value: c.slug, count: 0 }))).map((f) => {
1492
- const cat = categories.find((c) => c.slug === f.value);
1493
- return /* @__PURE__ */ jsxs(
1494
- "button",
1495
- {
1496
- type: "button",
1497
- onClick: () => setCategory(category === f.value ? "" : f.value),
1498
- 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"}`,
1499
- children: [
1500
- /* @__PURE__ */ jsx("span", { className: "truncate", children: cat?.name ?? f.value }),
1501
- f.count > 0 && /* @__PURE__ */ jsx("span", { className: "text-xs flex-shrink-0", children: f.count })
1502
- ]
1503
- },
1504
- f.value
1505
- );
1506
- })
1507
- ] })
1508
- ] }),
1509
- facetTypes.length > 0 && /* @__PURE__ */ jsx(
1510
- FacetList,
1511
- {
1512
- title: "Available types",
1513
- facets: facetTypes,
1514
- selected: type,
1515
- onSelect: setType
1516
- }
1517
- ),
1518
- hasActiveFilters && /* @__PURE__ */ jsx(
1519
- "button",
1520
- {
1521
- type: "button",
1522
- onClick: resetFilters,
1523
- className: "text-sm text-muted-foreground hover:text-foreground underline",
1524
- children: "Clear all filters"
1525
- }
1526
- )
1527
- ] });
1528
- return /* @__PURE__ */ jsxs("div", { className: "w-full", children: [
1529
- /* @__PURE__ */ jsx(
1530
- PageHead,
1531
- {
1532
- title: seoTitle ?? `Browse Store${productName ? ` \u2013 ${productName}` : ""}`,
1533
- description: seoDescription ?? browseDescription,
1534
- productName
1535
- }
1536
- ),
1537
- /* @__PURE__ */ jsxs("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8", children: [
1538
- /* @__PURE__ */ jsxs("header", { className: "mb-6", children: [
1539
- /* @__PURE__ */ jsx("h1", { className: "text-3xl font-bold tracking-tight", children: productName ? `Browse the ${productName} Store` : "Browse the Store" }),
1540
- /* @__PURE__ */ jsx("p", { className: "mt-2 text-muted-foreground", children: browseDescription })
1541
- ] }),
1542
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col sm:flex-row gap-3 mb-6", children: [
1543
- /* @__PURE__ */ jsxs("form", { className: "flex-1 flex gap-2", onSubmit: handleSearchSubmit, children: [
1544
- /* @__PURE__ */ jsx(
1545
- "input",
1546
- {
1547
- ref: searchRef,
1548
- type: "search",
1549
- "aria-label": "Search store items",
1550
- value: inputValue,
1551
- onChange: (e) => setInputValue(e.target.value),
1552
- placeholder: "Search\u2026",
1553
- 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"
1554
- }
1555
- ),
1556
- /* @__PURE__ */ jsx(
1557
- "button",
1558
- {
1559
- type: "submit",
1560
- className: "h-10 px-5 rounded-lg bg-primary text-primary-foreground text-sm font-medium hover:opacity-90 transition-opacity",
1561
- children: "Search"
1562
- }
1563
- )
1564
- ] }),
1565
- /* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
1566
- /* @__PURE__ */ jsx(
1567
- "select",
1568
- {
1569
- "aria-label": "Sort store items",
1570
- value: sortBy,
1571
- onChange: (e) => setSortBy(e.target.value),
1572
- 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",
1573
- children: SORT_OPTIONS.map((o) => /* @__PURE__ */ jsx("option", { value: o.value, children: o.label }, o.value))
1574
- }
1575
- ),
1576
- /* @__PURE__ */ jsxs(
1577
- "button",
1578
- {
1579
- type: "button",
1580
- onClick: () => setFiltersOpen(!filtersOpen),
1581
- className: "lg:hidden h-10 px-4 rounded-lg border border-border bg-background text-sm text-foreground hover:bg-muted/50 transition-colors",
1582
- children: [
1583
- "Filters",
1584
- " ",
1585
- hasActiveFilters && /* @__PURE__ */ jsx("span", { className: "text-primary", children: "\u2022" })
1586
- ]
1587
- }
1588
- )
1589
- ] })
1590
- ] }),
1591
- filtersOpen && /* @__PURE__ */ jsx("div", { className: "lg:hidden mb-6 p-4 border border-border rounded-xl bg-card", children: sidebarContent }),
1592
- /* @__PURE__ */ jsxs("div", { className: "flex gap-8", children: [
1593
- /* @__PURE__ */ jsx("aside", { className: "hidden lg:block w-52 flex-shrink-0", children: sidebarContent }),
1594
- /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
1595
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-4 flex-wrap", children: [
1596
- /* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: loading ? "Loading\u2026" : `${result?.totalCount ?? 0} results` }),
1597
- hasActiveFilters && /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap gap-1.5", children: [
1598
- search && /* @__PURE__ */ jsx(
1599
- Chip,
1600
- {
1601
- label: `"${search}"`,
1602
- onRemove: () => {
1603
- setSearch("");
1604
- setInputValue("");
1605
- }
1606
- }
1607
- ),
1608
- type && /* @__PURE__ */ jsx(Chip, { label: type, onRemove: () => setType("") }),
1609
- pricingModel && /* @__PURE__ */ jsx(
1610
- Chip,
1611
- {
1612
- label: pricingModel,
1613
- onRemove: () => setPricingModel("")
1614
- }
1615
- ),
1616
- category && /* @__PURE__ */ jsx(Chip, { label: category, onRemove: () => setCategory("") }),
1617
- featured && /* @__PURE__ */ jsx(
1618
- Chip,
1619
- {
1620
- label: "Featured",
1621
- onRemove: () => setFeatured(false)
1622
- }
1623
- )
1624
- ] })
1625
- ] }),
1626
- 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(
1627
- "div",
1628
- {
1629
- className: "bg-card border border-border rounded-xl p-4 h-36 animate-pulse"
1630
- },
1631
- i
1632
- )) }) : allProducts.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "py-20 text-center", children: [
1633
- /* @__PURE__ */ jsxs("p", { className: "text-muted-foreground mb-4", children: [
1634
- "No results found",
1635
- search ? ` for "${search}"` : "",
1636
- "."
1637
- ] }),
1638
- /* @__PURE__ */ jsx(
1639
- "button",
1640
- {
1641
- type: "button",
1642
- onClick: resetFilters,
1643
- className: "text-sm text-primary hover:underline",
1644
- children: "Clear filters"
1645
- }
1646
- )
1647
- ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
1648
- /* @__PURE__ */ jsx("h2", { className: "sr-only", children: "Store items" }),
1649
- /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-3 gap-4", children: allProducts.map((product) => /* @__PURE__ */ jsx(
1650
- ProductCard,
1651
- {
1652
- product,
1653
- onClick: () => navigate(`/store/${product.slug}`)
1654
- },
1655
- product.id
1656
- )) }),
1657
- result?.hasMore && /* @__PURE__ */ jsx("div", { className: "mt-8 text-center", children: /* @__PURE__ */ jsx(
1658
- "button",
1659
- {
1660
- type: "button",
1661
- onClick: loadMore,
1662
- disabled: loadingMore,
1663
- 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",
1664
- children: loadingMore ? "Loading\u2026" : "Load more"
1665
- }
1666
- ) })
1667
- ] })
1668
- ] })
1669
- ] })
1670
- ] })
1671
- ] });
1672
- }
1673
- function Chip({ label, onRemove }) {
1674
- 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: [
1675
- label,
1676
- /* @__PURE__ */ jsx(
1677
- "button",
1678
- {
1679
- type: "button",
1680
- onClick: onRemove,
1681
- "aria-label": `Remove ${label}`,
1682
- className: "hover:opacity-70",
1683
- children: "\xD7"
1684
- }
1685
- )
1686
- ] });
1687
- }
1688
- function detectTheme() {
1689
- if (typeof document === "undefined") return "light";
1690
- const root = document.documentElement;
1691
- return root.classList.contains("dark") || root.getAttribute("data-theme") === "dark" ? "dark" : "light";
1692
- }
1693
- function WorkflowEmbed({
1694
- appUrl,
1695
- productId,
1696
- theme,
1697
- clickToInteract = true,
1698
- hideCta = false,
1699
- className,
1700
- onError
1701
- }) {
1702
- const iframeRef = useRef(null);
1703
- const [status, setStatus] = useState("loading");
1704
- const [interactive, setInteractive] = useState(!clickToInteract);
1705
- const resolvedTheme = useMemo(() => theme ?? detectTheme(), [theme]);
1706
- const src = useMemo(() => {
1707
- const base = appUrl.replace(/\/+$/, "");
1708
- const params = new URLSearchParams({
1709
- productId,
1710
- theme: resolvedTheme
1711
- });
1712
- if (hideCta) params.set("cta", "false");
1713
- return `${base}/embed/workflow?${params.toString()}`;
1714
- }, [appUrl, productId, resolvedTheme, hideCta]);
1715
- useEffect(() => {
1716
- const handler = (event) => {
1717
- if (event.source !== iframeRef.current?.contentWindow) return;
1718
- const data = event.data;
1719
- if (data?.type === "fluidgrids:embed:loaded") setStatus("loaded");
1720
- if (data?.type === "fluidgrids:embed:error") {
1721
- setStatus("error");
1722
- onError?.(data.message ?? "Failed to load workflow preview");
1723
- }
1724
- };
1725
- window.addEventListener("message", handler);
1726
- return () => window.removeEventListener("message", handler);
1727
- }, [onError]);
1728
- if (status === "error") return null;
1729
- return /* @__PURE__ */ jsxs(
1730
- "div",
1731
- {
1732
- className: `relative w-full overflow-hidden rounded-xl border border-border bg-muted ${className ?? ""}`,
1733
- style: { aspectRatio: "16 / 9" },
1734
- children: [
1735
- status === "loading" && /* @__PURE__ */ jsx(
1736
- "div",
1737
- {
1738
- className: "absolute inset-0 animate-pulse bg-muted",
1739
- "aria-hidden": "true"
1740
- }
1741
- ),
1742
- /* @__PURE__ */ jsx(
1743
- "iframe",
1744
- {
1745
- ref: iframeRef,
1746
- src,
1747
- title: "Workflow preview",
1748
- loading: "lazy",
1749
- className: "h-full w-full border-0",
1750
- style: interactive ? void 0 : { pointerEvents: "none" }
1751
- }
1752
- ),
1753
- clickToInteract && !interactive && status === "loaded" && /* @__PURE__ */ jsx(
1754
- "button",
1755
- {
1756
- type: "button",
1757
- onClick: () => setInteractive(true),
1758
- className: "absolute inset-0 flex items-end justify-center bg-transparent pb-4",
1759
- "aria-label": "Click to explore the workflow",
1760
- 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" })
1761
- }
1762
- )
1763
- ]
1764
- }
1765
- );
1766
- }
1767
- function MarkdownLink({
1768
- href,
1769
- children,
1770
- // react-markdown passes the hast node to every override; it is not a DOM attribute.
1771
- node: _node,
1772
- ...props
1773
- }) {
1774
- const isExternal = typeof href === "string" && (href.startsWith("http://") || href.startsWith("https://"));
1775
- return /* @__PURE__ */ jsx(
1776
- "a",
1777
- {
1778
- href,
1779
- ...props,
1780
- ...isExternal ? { target: "_blank", rel: "noopener noreferrer" } : { rel: "noopener noreferrer" },
1781
- children
1782
- }
1783
- );
1784
- }
1785
- var defaultComponents = {
1786
- a: MarkdownLink
1787
- };
1788
- function Markdown({
1789
- children,
1790
- className,
1791
- inline,
1792
- components,
1793
- rehypePlugins
1794
- }) {
1795
- const content = /* @__PURE__ */ jsx(
1796
- ReactMarkdown,
1797
- {
1798
- remarkPlugins: [remarkGfm],
1799
- rehypePlugins: [rehypeSanitize, ...rehypePlugins ?? []],
1800
- components: { ...defaultComponents, ...components },
1801
- ...inline ? { disallowedElements: ["p"], unwrapDisallowed: true } : {},
1802
- children
1803
- }
1804
- );
1805
- if (inline) {
1806
- return /* @__PURE__ */ jsx("span", { className, children: content });
1807
- }
1808
- return /* @__PURE__ */ jsx("div", { className, children: content });
1809
- }
1810
-
1811
- // src/utils/product-slug.ts
1812
- var PRODUCT_SLUG_RENAMES = Object.freeze(
1813
- [Object.freeze({ legacy: "botlit", current: "botmanor" })]
1814
- );
1815
- Object.freeze(
1816
- Object.fromEntries(PRODUCT_SLUG_RENAMES.map((r) => [r.legacy, r.current]))
1817
- );
1818
- createContext({
1819
- product: null,
1820
- loading: true,
1821
- error: null,
1822
- hasProvider: false,
1823
- refetch: () => {
1824
- }
1825
- });
1826
- var PROSE_CSS = `
1827
- .boff-prose {
1828
- max-width: none;
1829
- }
1830
-
1831
- .boff-prose h1 {
1832
- font-size: 2.25rem;
1833
- font-weight: 800;
1834
- line-height: 1.2;
1835
- margin-top: 0;
1836
- margin-bottom: 1rem;
1837
- color: hsl(var(--foreground));
1838
- }
1839
-
1840
- .boff-prose h2 {
1841
- font-size: 1.75rem;
1842
- font-weight: 700;
1843
- line-height: 1.3;
1844
- margin-top: 2rem;
1845
- margin-bottom: 1rem;
1846
- color: hsl(var(--foreground));
1847
- }
1848
-
1849
- .boff-prose h3 {
1850
- font-size: 1.5rem;
1851
- font-weight: 600;
1852
- line-height: 1.4;
1853
- margin-top: 1.5rem;
1854
- margin-bottom: 0.75rem;
1855
- color: hsl(var(--foreground));
1856
- }
1857
-
1858
- .boff-prose h4 {
1859
- font-size: 1.25rem;
1860
- font-weight: 600;
1861
- line-height: 1.5;
1862
- margin-top: 1.25rem;
1863
- margin-bottom: 0.5rem;
1864
- color: hsl(var(--foreground));
1865
- }
1866
-
1867
- .boff-prose p {
1868
- margin-bottom: 1rem;
1869
- line-height: 1.75;
1870
- color: hsl(var(--foreground));
1871
- }
1872
-
1873
- .boff-prose ul,
1874
- .boff-prose ol {
1875
- margin-bottom: 1rem;
1876
- padding-left: 1.5rem;
1877
- }
1878
-
1879
- .boff-prose ul {
1880
- list-style-type: disc;
1881
- }
1882
-
1883
- .boff-prose ol {
1884
- list-style-type: decimal;
1885
- }
1886
-
1887
- .boff-prose li {
1888
- margin-bottom: 0.25rem;
1889
- line-height: 1.75;
1890
- color: hsl(var(--foreground));
1891
- }
1892
-
1893
- .boff-prose li > ul,
1894
- .boff-prose li > ol {
1895
- margin-top: 0.25rem;
1896
- margin-bottom: 0.25rem;
1897
- }
1898
-
1899
- .boff-prose a {
1900
- color: hsl(var(--primary));
1901
- text-decoration: underline;
1902
- text-underline-offset: 2px;
1903
- }
1904
-
1905
- .boff-prose a:hover {
1906
- opacity: 0.8;
1907
- }
1908
-
1909
- .boff-prose hr {
1910
- border: none;
1911
- height: 1px;
1912
- background-color: hsl(var(--border));
1913
- margin: 2rem 0;
1914
- }
1915
-
1916
- .boff-prose blockquote {
1917
- border-left: 4px solid hsl(var(--border));
1918
- padding-left: 1rem;
1919
- margin: 1.5rem 0;
1920
- font-style: italic;
1921
- color: hsl(var(--muted-foreground));
1922
- }
1923
-
1924
- .boff-prose strong {
1925
- font-weight: 700;
1926
- color: hsl(var(--foreground));
1927
- }
1928
-
1929
- .boff-prose code {
1930
- background-color: hsl(var(--muted));
1931
- padding: 0.125rem 0.25rem;
1932
- border-radius: 0.25rem;
1933
- font-size: 0.875em;
1934
- font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
1935
- }
1936
-
1937
- .boff-prose pre {
1938
- background-color: hsl(var(--muted));
1939
- padding: 1rem;
1940
- border-radius: 0.5rem;
1941
- overflow-x: auto;
1942
- margin-bottom: 1rem;
1943
- }
1944
-
1945
- .boff-prose pre code {
1946
- background-color: transparent;
1947
- padding: 0;
1948
- }
1949
-
1950
- .boff-prose img {
1951
- max-width: 100%;
1952
- height: auto;
1953
- }
1954
-
1955
- .boff-prose table {
1956
- width: 100%;
1957
- border-collapse: collapse;
1958
- margin-bottom: 1rem;
1959
- }
1960
-
1961
- .boff-prose th,
1962
- .boff-prose td {
1963
- border: 1px solid hsl(var(--border));
1964
- padding: 0.5rem;
1965
- text-align: left;
1966
- }
1967
-
1968
- .boff-prose th {
1969
- font-weight: 600;
1970
- background-color: hsl(var(--muted));
1971
- }
1972
-
1973
- /* Smaller variant used inside cards and compact panels */
1974
- .boff-prose-sm {
1975
- font-size: 0.875rem;
1976
- }
1977
-
1978
- .boff-prose-sm h1 {
1979
- font-size: 1.75rem;
1980
- }
1981
-
1982
- .boff-prose-sm h2 {
1983
- font-size: 1.5rem;
1984
- }
1985
-
1986
- .boff-prose-sm h3 {
1987
- font-size: 1.25rem;
1988
- }
1989
-
1990
- .boff-prose-sm h4 {
1991
- font-size: 1.125rem;
1992
- }
1993
-
1994
- .boff-prose-sm p,
1995
- .boff-prose-sm li {
1996
- line-height: 1.625;
1997
- }
1998
- `;
1999
- function ProseStyles() {
2000
- return /* @__PURE__ */ jsx("style", { dangerouslySetInnerHTML: { __html: PROSE_CSS } });
2001
- }
2002
- function cn(...inputs) {
2003
- return twMerge(clsx(inputs));
2004
- }
2005
- var buttonVariants = cva(
2006
- "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
2007
- {
2008
- variants: {
2009
- variant: {
2010
- default: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
2011
- destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
2012
- outline: "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
2013
- secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
2014
- ghost: "hover:bg-accent hover:text-accent-foreground",
2015
- link: "text-primary underline-offset-4 hover:underline"
2016
- },
2017
- size: {
2018
- default: "h-9 px-4 py-2",
2019
- sm: "h-8 rounded-md px-3 text-xs",
2020
- lg: "h-10 rounded-md px-8",
2021
- icon: "h-9 w-9"
2022
- }
2023
- },
2024
- defaultVariants: {
2025
- variant: "default",
2026
- size: "default"
2027
- }
2028
- }
2029
- );
2030
- var Button = React.forwardRef(
2031
- ({ className, variant, size, asChild = false, ...props }, ref) => {
2032
- const Comp = asChild ? Slot : "button";
2033
- return /* @__PURE__ */ jsx(
2034
- Comp,
2035
- {
2036
- className: cn(buttonVariants({ variant, size, className })),
2037
- ref,
2038
- ...props
2039
- }
2040
- );
2041
- }
2042
- );
2043
- Button.displayName = "Button";
2044
- var Input = React.forwardRef(
2045
- ({ className, type, ...props }, ref) => {
2046
- return /* @__PURE__ */ jsx(
2047
- "input",
2048
- {
2049
- type,
2050
- className: cn(
2051
- "flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
2052
- className
2053
- ),
2054
- ref,
2055
- ...props
2056
- }
2057
- );
2058
- }
2059
- );
2060
- Input.displayName = "Input";
2061
- var ANIM_STYLES = `
2062
- @keyframes sdFadeUp {
2063
- from { opacity: 0; transform: translateY(16px); }
2064
- to { opacity: 1; transform: translateY(0); }
2065
- }
2066
- @keyframes sdFadeIn {
2067
- from { opacity: 0; }
2068
- to { opacity: 1; }
2069
- }
2070
- @keyframes sdScaleIn {
2071
- from { opacity: 0; transform: scale(0.94); }
2072
- to { opacity: 1; transform: scale(1); }
2073
- }
2074
- @keyframes sdGlowPulse {
2075
- 0%, 100% { opacity: 0.35; }
2076
- 50% { opacity: 0.65; }
2077
- }
2078
- @media (prefers-reduced-motion: reduce) {
2079
- .sd-fu, .sd-fi, .sd-si { animation: none !important; opacity: 1 !important; transform: none !important; }
2080
- .sd-gp { animation: none !important; }
2081
- }
2082
- .sd-fu { animation: sdFadeUp 0.55s cubic-bezier(0.16,1,0.3,1) both; }
2083
- .sd-fi { animation: sdFadeIn 0.45s ease-out both; }
2084
- .sd-si { animation: sdScaleIn 0.45s cubic-bezier(0.16,1,0.3,1) both; }
2085
- .sd-gp { animation: sdGlowPulse 3s ease-in-out infinite; }
2086
- .sd-d1 { animation-delay: 60ms; }
2087
- .sd-d2 { animation-delay: 120ms; }
2088
- .sd-d3 { animation-delay: 180ms; }
2089
- .sd-d4 { animation-delay: 240ms; }
2090
- .sd-d5 { animation-delay: 320ms; }
2091
- .sd-d6 { animation-delay: 400ms; }
2092
- `;
2093
- function RatingBar({
2094
- label,
2095
- count,
2096
- total
2097
- }) {
2098
- const pct = total > 0 ? Math.round(count / total * 100) : 0;
2099
- return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
2100
- /* @__PURE__ */ jsx("span", { className: "w-12 text-right shrink-0", children: label }),
2101
- /* @__PURE__ */ jsx("div", { className: "flex-1 h-1.5 bg-muted rounded-full overflow-hidden", children: /* @__PURE__ */ jsx(
2102
- "div",
2103
- {
2104
- className: "h-full bg-amber-400 rounded-full transition-all duration-700",
2105
- style: { width: `${pct}%` }
2106
- }
2107
- ) }),
2108
- /* @__PURE__ */ jsx("span", { className: "w-6 shrink-0", children: count })
2109
- ] });
2110
- }
2111
- function IconBlock({ src }) {
2112
- return /* @__PURE__ */ jsxs("div", { className: "relative flex-shrink-0", children: [
2113
- /* @__PURE__ */ jsx(
2114
- "div",
2115
- {
2116
- className: "sd-gp absolute -inset-1.5 rounded-2xl bg-primary/30 blur-md pointer-events-none",
2117
- "aria-hidden": "true"
2118
- }
2119
- ),
2120
- /* @__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(
2121
- "img",
2122
- {
2123
- src,
2124
- alt: "",
2125
- "aria-hidden": true,
2126
- className: "w-full h-full object-cover"
2127
- }
2128
- ) : /* @__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(
2129
- "svg",
2130
- {
2131
- viewBox: "0 0 40 40",
2132
- className: "w-10 h-10",
2133
- fill: "none",
2134
- xmlns: "http://www.w3.org/2000/svg",
2135
- "aria-hidden": "true",
2136
- children: [
2137
- /* @__PURE__ */ jsx(
2138
- "polygon",
2139
- {
2140
- points: "20,4 34,11 20,18 6,11",
2141
- className: "fill-primary/40",
2142
- stroke: "currentColor",
2143
- strokeWidth: "0.6",
2144
- strokeOpacity: "0.4"
2145
- }
2146
- ),
2147
- /* @__PURE__ */ jsx(
2148
- "polygon",
2149
- {
2150
- points: "6,11 20,18 20,34 6,27",
2151
- className: "fill-primary/20",
2152
- stroke: "currentColor",
2153
- strokeWidth: "0.6",
2154
- strokeOpacity: "0.4"
2155
- }
2156
- ),
2157
- /* @__PURE__ */ jsx(
2158
- "polygon",
2159
- {
2160
- points: "34,11 20,18 20,34 34,27",
2161
- className: "fill-primary/30",
2162
- stroke: "currentColor",
2163
- strokeWidth: "0.6",
2164
- strokeOpacity: "0.4"
2165
- }
2166
- )
2167
- ]
2168
- }
2169
- ) }) })
2170
- ] });
2171
- }
2172
- function StoreProductDetailPage({
2173
- slug,
2174
- id,
2175
- appLoginUrl,
2176
- onNavigate,
2177
- productName,
2178
- waitlist: waitlistProp
2179
- }) {
2180
- const client = useWebSDK();
2181
- const waitlist = waitlistProp ?? false;
2182
- const [details, setDetails] = useState(null);
2183
- const [loading, setLoading] = useState(true);
2184
- const [error, setError] = useState(null);
2185
- const [activeScreenshot, setActiveScreenshot] = useState(0);
2186
- const [screenshotKey, setScreenshotKey] = useState(0);
2187
- const [embedFailed, setEmbedFailed] = useState(false);
2188
- useEffect(() => {
2189
- if (!slug && !id) {
2190
- setError("Product not found.");
2191
- setLoading(false);
2192
- return;
2193
- }
2194
- let cancelled = false;
2195
- setLoading(true);
2196
- client.query(STORE_PRODUCT_DETAILS_QUERY, {
2197
- input: { slug: slug ?? void 0, id: id ?? void 0 }
2198
- }).then((r) => {
2199
- if (cancelled) return;
2200
- if (r.errors?.length) throw new Error(r.errors[0].message);
2201
- if (!r.data?.storeProductDetails) throw new Error("Not found");
2202
- setDetails(r.data.storeProductDetails);
2203
- }).catch(() => {
2204
- if (!cancelled) setError("Product not found or unavailable.");
2205
- }).finally(() => {
2206
- if (!cancelled) setLoading(false);
2207
- });
2208
- return () => {
2209
- cancelled = true;
2210
- };
2211
- }, [client, slug, id]);
2212
- function navigate(path) {
2213
- if (onNavigate) {
2214
- onNavigate(path);
2215
- return;
2216
- }
2217
- window.location.href = path;
2218
- }
2219
- function switchScreenshot(i) {
2220
- setActiveScreenshot(i);
2221
- setScreenshotKey((k) => k + 1);
2222
- }
2223
- if (loading) {
2224
- return /* @__PURE__ */ jsxs("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12 animate-pulse", children: [
2225
- /* @__PURE__ */ jsx("div", { className: "h-4 bg-muted rounded w-40 mb-8" }),
2226
- /* @__PURE__ */ jsxs("div", { className: "flex gap-6 mb-8", children: [
2227
- /* @__PURE__ */ jsx("div", { className: "w-20 h-20 rounded-2xl bg-muted flex-shrink-0" }),
2228
- /* @__PURE__ */ jsxs("div", { className: "flex-1 space-y-3 pt-1", children: [
2229
- /* @__PURE__ */ jsx("div", { className: "h-6 bg-muted rounded w-1/3" }),
2230
- /* @__PURE__ */ jsx("div", { className: "h-4 bg-muted rounded w-1/2" }),
2231
- /* @__PURE__ */ jsx("div", { className: "h-4 bg-muted rounded w-1/4" })
2232
- ] })
2233
- ] }),
2234
- /* @__PURE__ */ jsx("div", { className: "h-56 bg-muted rounded-xl mb-8" }),
2235
- /* @__PURE__ */ jsx("div", { className: "space-y-3", children: [...Array(5)].map((_, i) => /* @__PURE__ */ jsx("div", { className: "h-4 bg-muted rounded" }, i)) })
2236
- ] });
2237
- }
2238
- if (error || !details) {
2239
- return /* @__PURE__ */ jsxs("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-20 text-center", children: [
2240
- /* @__PURE__ */ jsx("p", { className: "text-muted-foreground mb-4", children: error ?? "Product not found." }),
2241
- /* @__PURE__ */ jsx(
2242
- "button",
2243
- {
2244
- type: "button",
2245
- onClick: () => navigate("/store"),
2246
- className: "text-sm text-primary hover:underline",
2247
- children: "Back to Store"
2248
- }
2249
- )
2250
- ] });
2251
- }
2252
- const {
2253
- product,
2254
- publisher,
2255
- reviews,
2256
- reviewsCount,
2257
- relatedProducts,
2258
- ratingDistribution
2259
- } = details;
2260
- const priceLabel = formatPrice(
2261
- product.price,
2262
- product.currency,
2263
- product.pricingModel
2264
- );
2265
- const ctaLabel = waitlist ? "Coming Soon" : priceLabel === "Free" ? "Install Free" : `Get for ${priceLabel}`;
2266
- const ctaHref = waitlist ? "#" : appLoginUrl;
2267
- const ctaAriaDisabled = waitlist || void 0;
2268
- const screenshots = product.screenshots ?? [];
2269
- const totalRatings = ratingDistribution ? ratingDistribution.fiveStars + ratingDistribution.fourStars + ratingDistribution.threeStars + ratingDistribution.twoStars + ratingDistribution.oneStar : 0;
2270
- return /* @__PURE__ */ jsxs("div", { className: "w-full", children: [
2271
- /* @__PURE__ */ jsx("style", { dangerouslySetInnerHTML: { __html: ANIM_STYLES } }),
2272
- /* @__PURE__ */ jsx(ProseStyles, {}),
2273
- /* @__PURE__ */ jsx(
2274
- PageHead,
2275
- {
2276
- title: `${product.name}${productName ? ` \u2013 ${productName} Store` : " \u2013 Store"}`,
2277
- description: product.description ?? void 0,
2278
- productName
2279
- }
2280
- ),
2281
- /* @__PURE__ */ jsxs("div", { className: "relative overflow-hidden", children: [
2282
- /* @__PURE__ */ jsx(
2283
- "div",
2284
- {
2285
- className: "absolute inset-0 bg-gradient-to-b from-primary/[0.07] via-background to-background pointer-events-none",
2286
- "aria-hidden": "true"
2287
- }
2288
- ),
2289
- /* @__PURE__ */ jsxs(
2290
- "svg",
2291
- {
2292
- className: "absolute inset-0 w-full h-full opacity-[0.04] pointer-events-none",
2293
- xmlns: "http://www.w3.org/2000/svg",
2294
- "aria-hidden": "true",
2295
- children: [
2296
- /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx(
2297
- "pattern",
2298
- {
2299
- id: "sd-grid",
2300
- width: "40",
2301
- height: "40",
2302
- patternUnits: "userSpaceOnUse",
2303
- children: /* @__PURE__ */ jsx(
2304
- "path",
2305
- {
2306
- d: "M 40 0 L 0 0 0 40",
2307
- fill: "none",
2308
- stroke: "currentColor",
2309
- strokeWidth: "1"
2310
- }
2311
- )
2312
- }
2313
- ) }),
2314
- /* @__PURE__ */ jsx("rect", { width: "100%", height: "100%", fill: "url(#sd-grid)" })
2315
- ]
2316
- }
2317
- ),
2318
- /* @__PURE__ */ jsx(
2319
- "div",
2320
- {
2321
- className: "absolute -top-12 -left-12 w-72 h-72 rounded-full bg-primary/10 blur-3xl pointer-events-none",
2322
- "aria-hidden": "true"
2323
- }
2324
- ),
2325
- /* @__PURE__ */ jsxs("div", { className: "relative max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 pt-6 pb-8", children: [
2326
- /* @__PURE__ */ jsxs("nav", { className: "sd-fi text-sm text-muted-foreground mb-6 flex items-center gap-1.5 flex-wrap", children: [
2327
- /* @__PURE__ */ jsx(
2328
- "button",
2329
- {
2330
- type: "button",
2331
- onClick: () => navigate("/store"),
2332
- className: "hover:text-primary transition-colors",
2333
- children: "Store"
2334
- }
2335
- ),
2336
- /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: "\u203A" }),
2337
- product.category && /* @__PURE__ */ jsxs(Fragment, { children: [
2338
- /* @__PURE__ */ jsx(
2339
- "button",
2340
- {
2341
- type: "button",
2342
- onClick: () => navigate(`/store/browse?category=${product.category}`),
2343
- className: "hover:text-primary transition-colors",
2344
- children: product.category
2345
- }
2346
- ),
2347
- /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: "\u203A" })
2348
- ] }),
2349
- /* @__PURE__ */ jsx("span", { className: "text-foreground font-medium", children: product.name })
2350
- ] }),
2351
- /* @__PURE__ */ jsxs("div", { className: "flex gap-5 items-start", children: [
2352
- /* @__PURE__ */ jsx(IconBlock, { src: product.icon, name: product.name }),
2353
- /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
2354
- /* @__PURE__ */ jsxs("div", { className: "sd-fu flex items-start gap-2 flex-wrap mb-1", children: [
2355
- /* @__PURE__ */ jsx("h1", { className: "text-2xl sm:text-3xl font-bold text-foreground leading-tight", children: product.name }),
2356
- /* @__PURE__ */ jsx(TypeBadge, { type: product.type })
2357
- ] }),
2358
- product.description && /* @__PURE__ */ jsx("p", { className: "sd-fu sd-d1 text-muted-foreground text-sm mb-2 leading-relaxed", children: product.description }),
2359
- /* @__PURE__ */ jsxs("div", { className: "sd-fu sd-d2 flex items-center gap-3 text-sm text-muted-foreground flex-wrap", children: [
2360
- product.rating != null && product.rating > 0 && /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1", children: [
2361
- /* @__PURE__ */ jsx(StarRating, { rating: product.rating }),
2362
- /* @__PURE__ */ jsx("span", { className: "font-semibold text-foreground", children: product.rating.toFixed(1) }),
2363
- /* @__PURE__ */ jsxs("span", { children: [
2364
- "(",
2365
- reviewsCount ?? 0,
2366
- ")"
2367
- ] })
2368
- ] }),
2369
- product.downloads != null && /* @__PURE__ */ jsxs("span", { children: [
2370
- formatDownloads(product.downloads),
2371
- " downloads"
2372
- ] }),
2373
- product.authorName && /* @__PURE__ */ jsxs("span", { children: [
2374
- "by ",
2375
- product.authorName
2376
- ] }),
2377
- product.license && /* @__PURE__ */ jsx("span", { children: product.license })
2378
- ] })
2379
- ] })
2380
- ] })
2381
- ] })
2382
- ] }),
2383
- /* @__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: [
2384
- /* @__PURE__ */ jsxs("div", { children: [
2385
- /* @__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: [
2386
- /* @__PURE__ */ jsxs("div", { children: [
2387
- /* @__PURE__ */ jsx("div", { className: "text-2xl font-bold text-foreground", children: priceLabel }),
2388
- product.pricingModel === "SUBSCRIPTION" && /* @__PURE__ */ jsx("div", { className: "text-xs text-muted-foreground", children: "per month" })
2389
- ] }),
2390
- /* @__PURE__ */ jsx(
2391
- "a",
2392
- {
2393
- href: ctaHref,
2394
- target: waitlist ? void 0 : "_blank",
2395
- rel: waitlist ? void 0 : "noopener noreferrer",
2396
- "aria-disabled": ctaAriaDisabled,
2397
- 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",
2398
- children: ctaLabel
2399
- }
2400
- )
2401
- ] }),
2402
- product.type === "WORKFLOW" && !embedFailed && /* @__PURE__ */ jsx("div", { className: "sd-fu sd-d3 mb-8", children: /* @__PURE__ */ jsx(
2403
- WorkflowEmbed,
2404
- {
2405
- appUrl: appLoginUrl,
2406
- productId: product.id,
2407
- onError: () => setEmbedFailed(true)
2408
- }
2409
- ) }),
2410
- screenshots.length > 0 && /* @__PURE__ */ jsxs("div", { className: "sd-fu sd-d3 mb-8", children: [
2411
- /* @__PURE__ */ jsx("div", { className: "rounded-xl overflow-hidden bg-muted aspect-video mb-3 shadow-md", children: /* @__PURE__ */ jsx(
2412
- "img",
2413
- {
2414
- src: screenshots[activeScreenshot],
2415
- alt: `Screenshot ${activeScreenshot + 1}`,
2416
- className: "sd-fi w-full h-full object-cover"
2417
- },
2418
- screenshotKey
2419
- ) }),
2420
- screenshots.length > 1 && /* @__PURE__ */ jsx("div", { className: "flex gap-2 overflow-x-auto pb-1", children: screenshots.map((src, i) => /* @__PURE__ */ jsx(
2421
- "button",
2422
- {
2423
- type: "button",
2424
- onClick: () => switchScreenshot(i),
2425
- 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"}`,
2426
- children: /* @__PURE__ */ jsx(
2427
- "img",
2428
- {
2429
- src,
2430
- alt: `Thumbnail ${i + 1}`,
2431
- className: "w-full h-full object-cover"
2432
- }
2433
- )
2434
- },
2435
- i
2436
- )) })
2437
- ] }),
2438
- product.longDescription && /* @__PURE__ */ jsxs("div", { className: "sd-fu sd-d4 mb-8", children: [
2439
- /* @__PURE__ */ jsx("h2", { className: "text-lg font-bold text-foreground mb-3", children: "About" }),
2440
- /* @__PURE__ */ jsx(Markdown, { className: "boff-prose boff-prose-sm max-w-none text-muted-foreground leading-relaxed", children: product.longDescription })
2441
- ] }),
2442
- 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: [
2443
- /* @__PURE__ */ jsx("h2", { className: "text-sm font-semibold text-foreground mb-3", children: "Publisher" }),
2444
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
2445
- publisher.logoUrl ? /* @__PURE__ */ jsx(
2446
- "img",
2447
- {
2448
- src: publisher.logoUrl,
2449
- alt: publisher.name,
2450
- className: "w-10 h-10 rounded-full object-cover"
2451
- }
2452
- ) : /* @__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() }),
2453
- /* @__PURE__ */ jsxs("div", { children: [
2454
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
2455
- /* @__PURE__ */ jsx("span", { className: "font-semibold text-foreground text-sm", children: publisher.name }),
2456
- publisher.isVerified && /* @__PURE__ */ jsx("span", { className: "text-xs text-primary font-medium", children: "\u2713 Verified" })
2457
- ] }),
2458
- publisher.bio && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground mt-0.5 line-clamp-2", children: publisher.bio })
2459
- ] })
2460
- ] })
2461
- ] }),
2462
- (reviews?.length ?? 0) > 0 && /* @__PURE__ */ jsxs("div", { className: "sd-fu sd-d5 mb-8", children: [
2463
- /* @__PURE__ */ jsxs("h2", { className: "text-lg font-bold text-foreground mb-4", children: [
2464
- "Reviews (",
2465
- reviewsCount ?? reviews.length,
2466
- ")"
2467
- ] }),
2468
- ratingDistribution && totalRatings > 0 && /* @__PURE__ */ jsxs("div", { className: "sd-si flex gap-6 mb-5 p-4 rounded-xl border border-border bg-card", children: [
2469
- /* @__PURE__ */ jsxs("div", { className: "text-center", children: [
2470
- /* @__PURE__ */ jsx("div", { className: "text-4xl font-bold text-foreground tabular-nums", children: product.rating?.toFixed(1) ?? "\u2014" }),
2471
- product.rating != null && /* @__PURE__ */ jsx(StarRating, { rating: product.rating }),
2472
- /* @__PURE__ */ jsxs("div", { className: "text-xs text-muted-foreground mt-1", children: [
2473
- totalRatings,
2474
- " ratings"
2475
- ] })
2476
- ] }),
2477
- /* @__PURE__ */ jsxs("div", { className: "flex-1 space-y-1.5 pt-1", children: [
2478
- /* @__PURE__ */ jsx(
2479
- RatingBar,
2480
- {
2481
- label: "5 \u2605",
2482
- count: ratingDistribution.fiveStars,
2483
- total: totalRatings
2484
- }
2485
- ),
2486
- /* @__PURE__ */ jsx(
2487
- RatingBar,
2488
- {
2489
- label: "4 \u2605",
2490
- count: ratingDistribution.fourStars,
2491
- total: totalRatings
2492
- }
2493
- ),
2494
- /* @__PURE__ */ jsx(
2495
- RatingBar,
2496
- {
2497
- label: "3 \u2605",
2498
- count: ratingDistribution.threeStars,
2499
- total: totalRatings
2500
- }
2501
- ),
2502
- /* @__PURE__ */ jsx(
2503
- RatingBar,
2504
- {
2505
- label: "2 \u2605",
2506
- count: ratingDistribution.twoStars,
2507
- total: totalRatings
2508
- }
2509
- ),
2510
- /* @__PURE__ */ jsx(
2511
- RatingBar,
2512
- {
2513
- label: "1 \u2605",
2514
- count: ratingDistribution.oneStar,
2515
- total: totalRatings
2516
- }
2517
- )
2518
- ] })
2519
- ] }),
2520
- /* @__PURE__ */ jsx("div", { className: "space-y-3", children: reviews.slice(0, 5).map((review, idx) => /* @__PURE__ */ jsxs(
2521
- "div",
2522
- {
2523
- className: "sd-fu p-4 rounded-xl border border-border bg-card hover:border-primary/20 transition-colors duration-200",
2524
- style: { animationDelay: `${(idx + 5) * 60}ms` },
2525
- children: [
2526
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2 mb-2", children: [
2527
- /* @__PURE__ */ jsx(StarRating, { rating: review.rating }),
2528
- review.verifiedPurchase && /* @__PURE__ */ jsx("span", { className: "text-xs text-emerald-700 dark:text-emerald-400 font-medium", children: "Verified" })
2529
- ] }),
2530
- review.title && /* @__PURE__ */ jsx("p", { className: "font-semibold text-sm text-foreground mb-1", children: review.title }),
2531
- review.comment && /* @__PURE__ */ jsx(Markdown, { className: "text-sm text-muted-foreground leading-relaxed", children: review.comment }),
2532
- review.createdAt && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground mt-2", children: new Date(review.createdAt).toLocaleDateString(
2533
- "en-US",
2534
- {
2535
- year: "numeric",
2536
- month: "short",
2537
- day: "numeric"
2538
- }
2539
- ) })
2540
- ]
2541
- },
2542
- review.id
2543
- )) })
2544
- ] }),
2545
- (relatedProducts?.length ?? 0) > 0 && /* @__PURE__ */ jsxs("div", { className: "sd-fu sd-d6", children: [
2546
- /* @__PURE__ */ jsx("h2", { className: "text-lg font-bold text-foreground mb-4", children: "Related" }),
2547
- /* @__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(
2548
- ProductCard,
2549
- {
2550
- product: p,
2551
- onClick: () => navigate(`/store/${p.slug}`)
2552
- },
2553
- p.id
2554
- )) })
2555
- ] })
2556
- ] }),
2557
- /* @__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: [
2558
- /* @__PURE__ */ jsxs("div", { children: [
2559
- /* @__PURE__ */ jsx(
2560
- "div",
2561
- {
2562
- className: `text-3xl font-extrabold ${priceLabel === "Free" ? "text-emerald-700 dark:text-emerald-400" : "text-foreground"}`,
2563
- children: priceLabel
2564
- }
2565
- ),
2566
- product.pricingModel === "SUBSCRIPTION" && /* @__PURE__ */ jsx("div", { className: "text-xs text-muted-foreground", children: "per month" })
2567
- ] }),
2568
- /* @__PURE__ */ jsx(
2569
- "a",
2570
- {
2571
- href: ctaHref,
2572
- target: waitlist ? void 0 : "_blank",
2573
- rel: waitlist ? void 0 : "noopener noreferrer",
2574
- "aria-disabled": ctaAriaDisabled,
2575
- 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",
2576
- children: ctaLabel
2577
- }
2578
- ),
2579
- /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground text-center", children: waitlist ? `Available when ${product?.name ?? "this product"} launches` : "Login required to install" }),
2580
- /* @__PURE__ */ jsxs("div", { className: "border-t border-border pt-4 space-y-2 text-xs text-muted-foreground", children: [
2581
- product.type && /* @__PURE__ */ jsxs("div", { className: "flex justify-between", children: [
2582
- /* @__PURE__ */ jsx("span", { children: "Type" }),
2583
- /* @__PURE__ */ jsx("span", { className: "text-foreground font-medium", children: product.type })
2584
- ] }),
2585
- product.category && /* @__PURE__ */ jsxs("div", { className: "flex justify-between", children: [
2586
- /* @__PURE__ */ jsx("span", { children: "Category" }),
2587
- /* @__PURE__ */ jsx("span", { className: "text-foreground font-medium", children: product.category })
2588
- ] }),
2589
- product.license && /* @__PURE__ */ jsxs("div", { className: "flex justify-between", children: [
2590
- /* @__PURE__ */ jsx("span", { children: "License" }),
2591
- /* @__PURE__ */ jsx("span", { className: "text-foreground font-medium", children: product.license })
2592
- ] }),
2593
- product.minPlatformVersion && /* @__PURE__ */ jsxs("div", { className: "flex justify-between", children: [
2594
- /* @__PURE__ */ jsx("span", { children: "Requires" }),
2595
- /* @__PURE__ */ jsxs("span", { className: "text-foreground font-medium", children: [
2596
- "v",
2597
- product.minPlatformVersion,
2598
- "+"
2599
- ] })
2600
- ] }),
2601
- product.downloads != null && /* @__PURE__ */ jsxs("div", { className: "flex justify-between", children: [
2602
- /* @__PURE__ */ jsx("span", { children: "Downloads" }),
2603
- /* @__PURE__ */ jsx("span", { className: "text-foreground font-medium", children: formatDownloads(product.downloads) })
2604
- ] })
2605
- ] }),
2606
- (product.tags?.length ?? 0) > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1.5 pt-1", children: product.tags.map((tag) => /* @__PURE__ */ jsx(
2607
- "span",
2608
- {
2609
- className: "text-xs px-2 py-0.5 rounded-full bg-primary/10 text-primary font-medium",
2610
- children: tag
2611
- },
2612
- tag
2613
- )) })
2614
- ] }) })
2615
- ] }) })
2616
- ] });
2617
- }
2618
-
2619
- export { ProductCard, StarRating, StoreBrowsePage, StoreHomePage, StoreProductDetailPage, TypeBadge, WorkflowEmbed, formatDownloads, formatPrice };
1
+ export { ProductCard, StarRating, StoreBrowsePage, StoreHomePage, StoreProductDetailPage, TypeBadge, WorkflowEmbed, formatDownloads, formatPrice } from '../chunk-ZP6QRAYC.mjs';
2
+ import '../chunk-D2TW7MNC.mjs';
3
+ import '../chunk-EDLTUOIA.mjs';
4
+ import '../chunk-6VJT3SM4.mjs';
5
+ import '../chunk-EBZ2HGJ2.mjs';
6
+ import '../chunk-34RX5P75.mjs';
7
+ import '../chunk-N5EC53MH.mjs';
8
+ import '../chunk-KHYXK7FG.mjs';
9
+ import '../chunk-R7G6TWIS.mjs';
10
+ import '../chunk-GCFLCO2Z.mjs';
11
+ import '../chunk-KZANIV3S.mjs';
12
+ import '../chunk-5JRJ57CL.mjs';
13
+ import '../chunk-VNS5WDWO.mjs';
2620
14
  //# sourceMappingURL=index.mjs.map
2621
15
  //# sourceMappingURL=index.mjs.map