@burdenoff/website-sdk 2026.710.1 → 2026.716.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.
@@ -1,10 +1,200 @@
1
- import { createContext, useState, useEffect, useRef, useContext } from 'react';
1
+ import { createContext, useState, useEffect, useRef, useMemo, useContext } from 'react';
2
2
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
3
3
  import { Helmet } from 'react-helmet-async';
4
4
 
5
5
  var __defProp = Object.defineProperty;
6
6
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7
7
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
8
+ function formatPrice(price, currency, pricingModel) {
9
+ if (pricingModel === "FREE" || !price || price === 0) return "Free";
10
+ const curr = currency || "USD";
11
+ try {
12
+ return new Intl.NumberFormat("en-US", {
13
+ style: "currency",
14
+ currency: curr
15
+ }).format(price);
16
+ } catch {
17
+ return `${curr} ${price.toFixed(2)}`;
18
+ }
19
+ }
20
+ function formatDownloads(n) {
21
+ if (!n) return "0";
22
+ if (n >= 1e6) return `${(n / 1e6).toFixed(1)}M`;
23
+ if (n >= 1e3) return `${(n / 1e3).toFixed(1)}K`;
24
+ return n.toString();
25
+ }
26
+ function StarRating({ rating }) {
27
+ return /* @__PURE__ */ jsx("span", { className: "flex items-center gap-0.5", children: [1, 2, 3, 4, 5].map((star) => /* @__PURE__ */ jsx(
28
+ "svg",
29
+ {
30
+ viewBox: "0 0 12 12",
31
+ className: `w-3 h-3 ${star <= Math.round(rating) ? "text-amber-400 fill-current" : "text-muted-foreground/30 fill-current"}`,
32
+ children: /* @__PURE__ */ jsx("path", { d: "M6 1l1.545 3.09L11 4.59l-2.5 2.41.59 3.41L6 8.79l-3.09 1.61L3.5 7 1 4.59l3.455-.5L6 1z" })
33
+ },
34
+ star
35
+ )) });
36
+ }
37
+ function TypeBadge({ type }) {
38
+ const labels = {
39
+ APP: "App",
40
+ NODE: "Node",
41
+ WORKFLOW: "Workflow",
42
+ TEMPLATE: "Template",
43
+ INTEGRATION: "Integration",
44
+ EXTENSION: "Extension",
45
+ THEME: "Theme"
46
+ };
47
+ return /* @__PURE__ */ jsx("span", { className: "inline-block text-xs px-2 py-0.5 rounded-full bg-primary/10 text-primary font-medium", children: labels[type] ?? type });
48
+ }
49
+ function ProductCard({ product, onClick, href }) {
50
+ const priceLabel = formatPrice(
51
+ product.price,
52
+ product.currency,
53
+ product.pricingModel
54
+ );
55
+ const inner = /* @__PURE__ */ jsxs("div", { className: "group bg-card border border-border rounded-xl p-4 flex flex-col gap-3 transition-all duration-200 hover:shadow-md hover:border-primary/30 cursor-pointer h-full", children: [
56
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-2", children: [
57
+ /* @__PURE__ */ jsx("div", { className: "w-12 h-12 rounded-lg bg-muted flex-shrink-0 overflow-hidden", children: product.icon ? /* @__PURE__ */ jsx(
58
+ "img",
59
+ {
60
+ src: product.icon,
61
+ alt: "",
62
+ "aria-hidden": "true",
63
+ className: "w-full h-full object-cover"
64
+ }
65
+ ) : /* @__PURE__ */ jsx("div", { className: "w-full h-full flex items-center justify-center bg-gradient-to-br from-primary/15 to-primary/5", children: /* @__PURE__ */ jsxs(
66
+ "svg",
67
+ {
68
+ viewBox: "0 0 32 32",
69
+ className: "w-8 h-8",
70
+ fill: "none",
71
+ xmlns: "http://www.w3.org/2000/svg",
72
+ "aria-hidden": "true",
73
+ children: [
74
+ /* @__PURE__ */ jsx(
75
+ "polygon",
76
+ {
77
+ points: "16,4 28,10 16,16 4,10",
78
+ className: "fill-primary/30",
79
+ stroke: "currentColor",
80
+ strokeWidth: "0.6",
81
+ strokeOpacity: "0.35"
82
+ }
83
+ ),
84
+ /* @__PURE__ */ jsx(
85
+ "polygon",
86
+ {
87
+ points: "4,10 16,16 16,28 4,22",
88
+ className: "fill-primary/15",
89
+ stroke: "currentColor",
90
+ strokeWidth: "0.6",
91
+ strokeOpacity: "0.35"
92
+ }
93
+ ),
94
+ /* @__PURE__ */ jsx(
95
+ "polygon",
96
+ {
97
+ points: "28,10 16,16 16,28 28,22",
98
+ className: "fill-primary/20",
99
+ stroke: "currentColor",
100
+ strokeWidth: "0.6",
101
+ strokeOpacity: "0.35"
102
+ }
103
+ )
104
+ ]
105
+ }
106
+ ) }) }),
107
+ /* @__PURE__ */ jsx(TypeBadge, { type: product.type })
108
+ ] }),
109
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
110
+ /* @__PURE__ */ jsx("h3", { className: "font-semibold text-foreground text-sm leading-snug line-clamp-1 group-hover:text-primary transition-colors", children: product.name }),
111
+ product.description && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-xs mt-1 line-clamp-2 leading-relaxed", children: product.description })
112
+ ] }),
113
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2", children: [
114
+ /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1.5", children: product.rating != null && product.rating > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
115
+ /* @__PURE__ */ jsx(StarRating, { rating: product.rating }),
116
+ /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: product.rating.toFixed(1) })
117
+ ] }) : /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: "No reviews yet" }) }),
118
+ /* @__PURE__ */ jsx(
119
+ "span",
120
+ {
121
+ className: `text-xs font-semibold ${priceLabel === "Free" ? "text-emerald-500" : "text-foreground"}`,
122
+ children: priceLabel
123
+ }
124
+ )
125
+ ] })
126
+ ] });
127
+ if (href) {
128
+ return /* @__PURE__ */ jsx("a", { href, onClick, className: "block h-full no-underline", children: inner });
129
+ }
130
+ return /* @__PURE__ */ jsx(
131
+ "button",
132
+ {
133
+ type: "button",
134
+ onClick,
135
+ className: "block w-full text-left h-full",
136
+ children: inner
137
+ }
138
+ );
139
+ }
140
+
141
+ // src/store/queries.ts
142
+ var STORE_PRODUCT_FIELDS = `
143
+ fragment StoreProductFields on StoreProduct {
144
+ id name slug type subType nature status pricingModel
145
+ price currency description icon bannerUrl screenshots
146
+ category tags featured downloads viewCount rating reviewCount
147
+ publisherId authorName license compatibleProducts
148
+ }
149
+ `;
150
+ var HOME_GROUPED_PRODUCTS_QUERY = `
151
+ ${STORE_PRODUCT_FIELDS}
152
+ query HomeGroupedProducts($compatibleWith: String) {
153
+ homeGroupedProducts(compatibleWith: $compatibleWith) {
154
+ featured { ...StoreProductFields }
155
+ mostDownloaded { ...StoreProductFields }
156
+ recentlyAdded { ...StoreProductFields }
157
+ freeItems { ...StoreProductFields }
158
+ }
159
+ }
160
+ `;
161
+ var BROWSE_STORE_QUERY = `
162
+ ${STORE_PRODUCT_FIELDS}
163
+ query BrowseStore($input: BrowseStoreInput!) {
164
+ browseStore(input: $input) {
165
+ products { ...StoreProductFields }
166
+ totalCount
167
+ hasMore
168
+ nextCursor
169
+ facets {
170
+ types { value count }
171
+ categories { value count }
172
+ pricingModels { value count }
173
+ priceRange { min max }
174
+ }
175
+ }
176
+ }
177
+ `;
178
+ var STORE_PRODUCT_DETAILS_QUERY = `
179
+ ${STORE_PRODUCT_FIELDS}
180
+ query StoreProductDetails($input: StoreProductDetailsInput!) {
181
+ storeProductDetails(input: $input) {
182
+ product { ...StoreProductFields longDescription videoUrls minPlatformVersion }
183
+ publisher { id name email websiteUrl logoUrl bio isVerified tier }
184
+ reviews { id rating title comment verifiedPurchase helpful createdAt }
185
+ reviewsCount
186
+ relatedProducts { ...StoreProductFields }
187
+ ratingDistribution { fiveStars fourStars threeStars twoStars oneStar }
188
+ }
189
+ }
190
+ `;
191
+ var CATEGORIES_QUERY = `
192
+ query Categories {
193
+ categories {
194
+ id name slug description icon parentId
195
+ }
196
+ }
197
+ `;
8
198
 
9
199
  // src/client/security.ts
10
200
  var LOOPBACK_HOSTS = /* @__PURE__ */ new Set(["localhost", "127.0.0.1", "::1"]);
@@ -202,155 +392,6 @@ function PageHead({
202
392
  ))
203
393
  ] });
204
394
  }
205
- function formatPrice(price, currency, pricingModel) {
206
- if (pricingModel === "FREE" || !price || price === 0) return "Free";
207
- const curr = currency || "USD";
208
- try {
209
- return new Intl.NumberFormat("en-US", {
210
- style: "currency",
211
- currency: curr
212
- }).format(price);
213
- } catch {
214
- return `${curr} ${price.toFixed(2)}`;
215
- }
216
- }
217
- function formatDownloads(n) {
218
- if (!n) return "0";
219
- if (n >= 1e6) return `${(n / 1e6).toFixed(1)}M`;
220
- if (n >= 1e3) return `${(n / 1e3).toFixed(1)}K`;
221
- return n.toString();
222
- }
223
- function StarRating({ rating }) {
224
- return /* @__PURE__ */ jsx("span", { className: "flex items-center gap-0.5", children: [1, 2, 3, 4, 5].map((star) => /* @__PURE__ */ jsx(
225
- "svg",
226
- {
227
- viewBox: "0 0 12 12",
228
- className: `w-3 h-3 ${star <= Math.round(rating) ? "text-amber-400 fill-current" : "text-muted-foreground/30 fill-current"}`,
229
- 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" })
230
- },
231
- star
232
- )) });
233
- }
234
- function TypeBadge({ type }) {
235
- const labels = {
236
- APP: "App",
237
- NODE: "Node",
238
- WORKFLOW: "Workflow",
239
- TEMPLATE: "Template",
240
- INTEGRATION: "Integration",
241
- EXTENSION: "Extension",
242
- THEME: "Theme"
243
- };
244
- return /* @__PURE__ */ jsx("span", { className: "inline-block text-xs px-2 py-0.5 rounded-full bg-primary/10 text-primary font-medium", children: labels[type] ?? type });
245
- }
246
- function ProductCard({ product, onClick, href }) {
247
- const priceLabel = formatPrice(product.price, product.currency, product.pricingModel);
248
- 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: [
249
- /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-2", children: [
250
- /* @__PURE__ */ jsx("div", { className: "w-12 h-12 rounded-lg bg-muted flex-shrink-0 overflow-hidden", children: product.icon ? /* @__PURE__ */ jsx(
251
- "img",
252
- {
253
- src: product.icon,
254
- alt: "",
255
- "aria-hidden": "true",
256
- className: "w-full h-full object-cover"
257
- }
258
- ) : /* @__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("svg", { viewBox: "0 0 32 32", className: "w-8 h-8", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: [
259
- /* @__PURE__ */ jsx("polygon", { points: "16,4 28,10 16,16 4,10", className: "fill-primary/30", stroke: "currentColor", strokeWidth: "0.6", strokeOpacity: "0.35" }),
260
- /* @__PURE__ */ jsx("polygon", { points: "4,10 16,16 16,28 4,22", className: "fill-primary/15", stroke: "currentColor", strokeWidth: "0.6", strokeOpacity: "0.35" }),
261
- /* @__PURE__ */ jsx("polygon", { points: "28,10 16,16 16,28 28,22", className: "fill-primary/20", stroke: "currentColor", strokeWidth: "0.6", strokeOpacity: "0.35" })
262
- ] }) }) }),
263
- /* @__PURE__ */ jsx(TypeBadge, { type: product.type })
264
- ] }),
265
- /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
266
- /* @__PURE__ */ jsx("h3", { className: "font-semibold text-foreground text-sm leading-snug line-clamp-1 group-hover:text-primary transition-colors", children: product.name }),
267
- product.description && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-xs mt-1 line-clamp-2 leading-relaxed", children: product.description })
268
- ] }),
269
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2", children: [
270
- /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1.5", children: product.rating != null && product.rating > 0 ? /* @__PURE__ */ jsxs(Fragment, { children: [
271
- /* @__PURE__ */ jsx(StarRating, { rating: product.rating }),
272
- /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: product.rating.toFixed(1) })
273
- ] }) : /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: "No reviews yet" }) }),
274
- /* @__PURE__ */ jsx(
275
- "span",
276
- {
277
- className: `text-xs font-semibold ${priceLabel === "Free" ? "text-emerald-500" : "text-foreground"}`,
278
- children: priceLabel
279
- }
280
- )
281
- ] })
282
- ] });
283
- if (href) {
284
- return /* @__PURE__ */ jsx("a", { href, onClick, className: "block h-full no-underline", children: inner });
285
- }
286
- return /* @__PURE__ */ jsx(
287
- "button",
288
- {
289
- type: "button",
290
- onClick,
291
- className: "block w-full text-left h-full",
292
- children: inner
293
- }
294
- );
295
- }
296
-
297
- // src/store/queries.ts
298
- var STORE_PRODUCT_FIELDS = `
299
- fragment StoreProductFields on StoreProduct {
300
- id name slug type subType nature status pricingModel
301
- price currency description icon bannerUrl screenshots
302
- category tags featured downloads viewCount rating reviewCount
303
- publisherId authorName license compatibleProducts
304
- }
305
- `;
306
- var HOME_GROUPED_PRODUCTS_QUERY = `
307
- ${STORE_PRODUCT_FIELDS}
308
- query HomeGroupedProducts($compatibleWith: String) {
309
- homeGroupedProducts(compatibleWith: $compatibleWith) {
310
- featured { ...StoreProductFields }
311
- mostDownloaded { ...StoreProductFields }
312
- recentlyAdded { ...StoreProductFields }
313
- freeItems { ...StoreProductFields }
314
- }
315
- }
316
- `;
317
- var BROWSE_STORE_QUERY = `
318
- ${STORE_PRODUCT_FIELDS}
319
- query BrowseStore($input: BrowseStoreInput!) {
320
- browseStore(input: $input) {
321
- products { ...StoreProductFields }
322
- totalCount
323
- hasMore
324
- nextCursor
325
- facets {
326
- types { value count }
327
- categories { value count }
328
- pricingModels { value count }
329
- priceRange { min max }
330
- }
331
- }
332
- }
333
- `;
334
- var STORE_PRODUCT_DETAILS_QUERY = `
335
- ${STORE_PRODUCT_FIELDS}
336
- query StoreProductDetails($input: StoreProductDetailsInput!) {
337
- storeProductDetails(input: $input) {
338
- product { ...StoreProductFields longDescription videoUrls minPlatformVersion }
339
- publisher { id name email websiteUrl logoUrl bio isVerified tier }
340
- reviews { id rating title comment verifiedPurchase helpful createdAt }
341
- reviewsCount
342
- relatedProducts { ...StoreProductFields }
343
- ratingDistribution { fiveStars fourStars threeStars twoStars oneStar }
344
- }
345
- }
346
- `;
347
- var CATEGORIES_QUERY = `
348
- query Categories {
349
- categories {
350
- id name slug description icon parentId
351
- }
352
- }
353
- `;
354
395
  function dedupAcross(lists) {
355
396
  const seen = /* @__PURE__ */ new Set();
356
397
  return lists.map((list) => {
@@ -368,7 +409,11 @@ function FeaturedHeroCard({
368
409
  product,
369
410
  onNavigate
370
411
  }) {
371
- const priceLabel = formatPrice(product.price, product.currency, product.pricingModel);
412
+ const priceLabel = formatPrice(
413
+ product.price,
414
+ product.currency,
415
+ product.pricingModel
416
+ );
372
417
  return /* @__PURE__ */ jsxs(
373
418
  "button",
374
419
  {
@@ -377,28 +422,155 @@ function FeaturedHeroCard({
377
422
  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",
378
423
  children: [
379
424
  /* @__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: [
380
- product.bannerUrl ? /* @__PURE__ */ jsx("img", { src: product.bannerUrl, alt: "", "aria-hidden": "true", className: "w-full h-full object-cover" }) : /* @__PURE__ */ jsxs(Fragment, { children: [
381
- /* @__PURE__ */ jsxs("svg", { className: "absolute inset-0 w-full h-full opacity-[0.07]", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: [
382
- /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("pattern", { id: "fg-hero-grid", width: "36", height: "36", patternUnits: "userSpaceOnUse", children: /* @__PURE__ */ jsx("path", { d: "M 36 0 L 0 0 0 36", fill: "none", stroke: "currentColor", strokeWidth: "1" }) }) }),
383
- /* @__PURE__ */ jsx("rect", { width: "100%", height: "100%", fill: "url(#fg-hero-grid)" })
384
- ] }),
385
- /* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex items-center justify-center", "aria-hidden": "true", children: /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 64 64", className: "w-20 h-20 opacity-25", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
386
- /* @__PURE__ */ jsx("polygon", { points: "32,8 56,20 32,32 8,20", className: "fill-primary/40", stroke: "currentColor", strokeWidth: "1", strokeOpacity: "0.5" }),
387
- /* @__PURE__ */ jsx("polygon", { points: "8,20 32,32 32,56 8,44", className: "fill-primary/20", stroke: "currentColor", strokeWidth: "1", strokeOpacity: "0.5" }),
388
- /* @__PURE__ */ jsx("polygon", { points: "56,20 32,32 32,56 56,44", className: "fill-primary/30", stroke: "currentColor", strokeWidth: "1", strokeOpacity: "0.5" })
389
- ] }) })
425
+ product.bannerUrl ? /* @__PURE__ */ jsx(
426
+ "img",
427
+ {
428
+ src: product.bannerUrl,
429
+ alt: "",
430
+ "aria-hidden": "true",
431
+ className: "w-full h-full object-cover"
432
+ }
433
+ ) : /* @__PURE__ */ jsxs(Fragment, { children: [
434
+ /* @__PURE__ */ jsxs(
435
+ "svg",
436
+ {
437
+ className: "absolute inset-0 w-full h-full opacity-[0.07]",
438
+ xmlns: "http://www.w3.org/2000/svg",
439
+ "aria-hidden": "true",
440
+ children: [
441
+ /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx(
442
+ "pattern",
443
+ {
444
+ id: "fg-hero-grid",
445
+ width: "36",
446
+ height: "36",
447
+ patternUnits: "userSpaceOnUse",
448
+ children: /* @__PURE__ */ jsx(
449
+ "path",
450
+ {
451
+ d: "M 36 0 L 0 0 0 36",
452
+ fill: "none",
453
+ stroke: "currentColor",
454
+ strokeWidth: "1"
455
+ }
456
+ )
457
+ }
458
+ ) }),
459
+ /* @__PURE__ */ jsx("rect", { width: "100%", height: "100%", fill: "url(#fg-hero-grid)" })
460
+ ]
461
+ }
462
+ ),
463
+ /* @__PURE__ */ jsx(
464
+ "div",
465
+ {
466
+ className: "absolute inset-0 flex items-center justify-center",
467
+ "aria-hidden": "true",
468
+ children: /* @__PURE__ */ jsxs(
469
+ "svg",
470
+ {
471
+ viewBox: "0 0 64 64",
472
+ className: "w-20 h-20 opacity-25",
473
+ fill: "none",
474
+ xmlns: "http://www.w3.org/2000/svg",
475
+ children: [
476
+ /* @__PURE__ */ jsx(
477
+ "polygon",
478
+ {
479
+ points: "32,8 56,20 32,32 8,20",
480
+ className: "fill-primary/40",
481
+ stroke: "currentColor",
482
+ strokeWidth: "1",
483
+ strokeOpacity: "0.5"
484
+ }
485
+ ),
486
+ /* @__PURE__ */ jsx(
487
+ "polygon",
488
+ {
489
+ points: "8,20 32,32 32,56 8,44",
490
+ className: "fill-primary/20",
491
+ stroke: "currentColor",
492
+ strokeWidth: "1",
493
+ strokeOpacity: "0.5"
494
+ }
495
+ ),
496
+ /* @__PURE__ */ jsx(
497
+ "polygon",
498
+ {
499
+ points: "56,20 32,32 32,56 56,44",
500
+ className: "fill-primary/30",
501
+ stroke: "currentColor",
502
+ strokeWidth: "1",
503
+ strokeOpacity: "0.5"
504
+ }
505
+ )
506
+ ]
507
+ }
508
+ )
509
+ }
510
+ )
390
511
  ] }),
391
512
  /* @__PURE__ */ jsx("span", { className: "absolute top-3 left-3 text-xs font-semibold px-2.5 py-1 rounded-full bg-primary text-primary-foreground shadow-sm", children: "Featured" }),
392
- /* @__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("img", { src: product.icon, alt: "", "aria-hidden": "true", className: "w-full h-full object-cover" }) : /* @__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("svg", { viewBox: "0 0 32 32", className: "w-8 h-8", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: [
393
- /* @__PURE__ */ jsx("polygon", { points: "16,4 28,10 16,16 4,10", className: "fill-primary/40", stroke: "currentColor", strokeWidth: "0.6", strokeOpacity: "0.4" }),
394
- /* @__PURE__ */ jsx("polygon", { points: "4,10 16,16 16,28 4,22", className: "fill-primary/20", stroke: "currentColor", strokeWidth: "0.6", strokeOpacity: "0.4" }),
395
- /* @__PURE__ */ jsx("polygon", { points: "28,10 16,16 16,28 28,22", className: "fill-primary/30", stroke: "currentColor", strokeWidth: "0.6", strokeOpacity: "0.4" })
396
- ] }) }) })
513
+ /* @__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(
514
+ "img",
515
+ {
516
+ src: product.icon,
517
+ alt: "",
518
+ "aria-hidden": "true",
519
+ className: "w-full h-full object-cover"
520
+ }
521
+ ) : /* @__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(
522
+ "svg",
523
+ {
524
+ viewBox: "0 0 32 32",
525
+ className: "w-8 h-8",
526
+ fill: "none",
527
+ xmlns: "http://www.w3.org/2000/svg",
528
+ "aria-hidden": "true",
529
+ children: [
530
+ /* @__PURE__ */ jsx(
531
+ "polygon",
532
+ {
533
+ points: "16,4 28,10 16,16 4,10",
534
+ className: "fill-primary/40",
535
+ stroke: "currentColor",
536
+ strokeWidth: "0.6",
537
+ strokeOpacity: "0.4"
538
+ }
539
+ ),
540
+ /* @__PURE__ */ jsx(
541
+ "polygon",
542
+ {
543
+ points: "4,10 16,16 16,28 4,22",
544
+ className: "fill-primary/20",
545
+ stroke: "currentColor",
546
+ strokeWidth: "0.6",
547
+ strokeOpacity: "0.4"
548
+ }
549
+ ),
550
+ /* @__PURE__ */ jsx(
551
+ "polygon",
552
+ {
553
+ points: "28,10 16,16 16,28 28,22",
554
+ className: "fill-primary/30",
555
+ stroke: "currentColor",
556
+ strokeWidth: "0.6",
557
+ strokeOpacity: "0.4"
558
+ }
559
+ )
560
+ ]
561
+ }
562
+ ) }) })
397
563
  ] }),
398
564
  /* @__PURE__ */ jsxs("div", { className: "p-5 flex flex-col flex-1", children: [
399
565
  /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-3 mb-2", children: [
400
566
  /* @__PURE__ */ jsx("h3", { className: "text-base font-bold text-foreground group-hover:text-primary transition-colors line-clamp-1", children: product.name }),
401
- /* @__PURE__ */ jsx("span", { className: `text-sm font-bold flex-shrink-0 ${priceLabel === "Free" ? "text-emerald-500" : "text-foreground"}`, children: priceLabel })
567
+ /* @__PURE__ */ jsx(
568
+ "span",
569
+ {
570
+ className: `text-sm font-bold flex-shrink-0 ${priceLabel === "Free" ? "text-emerald-500" : "text-foreground"}`,
571
+ children: priceLabel
572
+ }
573
+ )
402
574
  ] }),
403
575
  product.description && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground line-clamp-2 leading-relaxed flex-1", children: product.description }),
404
576
  /* @__PURE__ */ jsxs("div", { className: "mt-3 flex items-center gap-2", children: [
@@ -419,7 +591,10 @@ function ScrollRow({
419
591
  }) {
420
592
  const ref = useRef(null);
421
593
  function scroll(dir) {
422
- ref.current?.scrollBy({ left: dir === "r" ? 272 : -272, behavior: "smooth" });
594
+ ref.current?.scrollBy({
595
+ left: dir === "r" ? 272 : -272,
596
+ behavior: "smooth"
597
+ });
423
598
  }
424
599
  return /* @__PURE__ */ jsxs("div", { className: "relative group/row", children: [
425
600
  /* @__PURE__ */ jsx(
@@ -429,7 +604,19 @@ function ScrollRow({
429
604
  onClick: () => scroll("l"),
430
605
  "aria-label": "Scroll left",
431
606
  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",
432
- children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", className: "w-4 h-4", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx("path", { d: "M10 3L6 8l4 5" }) })
607
+ children: /* @__PURE__ */ jsx(
608
+ "svg",
609
+ {
610
+ viewBox: "0 0 16 16",
611
+ className: "w-4 h-4",
612
+ fill: "none",
613
+ stroke: "currentColor",
614
+ strokeWidth: "1.5",
615
+ strokeLinecap: "round",
616
+ strokeLinejoin: "round",
617
+ children: /* @__PURE__ */ jsx("path", { d: "M10 3L6 8l4 5" })
618
+ }
619
+ )
433
620
  }
434
621
  ),
435
622
  /* @__PURE__ */ jsx(
@@ -438,7 +625,13 @@ function ScrollRow({
438
625
  ref,
439
626
  className: "flex gap-3 overflow-x-auto pb-1 snap-x snap-mandatory",
440
627
  style: { scrollbarWidth: "none", msOverflowStyle: "none" },
441
- children: products.map((product) => /* @__PURE__ */ jsx("div", { className: "flex-shrink-0 w-56 snap-start", children: /* @__PURE__ */ jsx(ProductCard, { product, onClick: () => onProductClick(product) }) }, product.id))
628
+ children: products.map((product) => /* @__PURE__ */ jsx("div", { className: "flex-shrink-0 w-56 snap-start", children: /* @__PURE__ */ jsx(
629
+ ProductCard,
630
+ {
631
+ product,
632
+ onClick: () => onProductClick(product)
633
+ }
634
+ ) }, product.id))
442
635
  }
443
636
  ),
444
637
  /* @__PURE__ */ jsx(
@@ -448,7 +641,19 @@ function ScrollRow({
448
641
  onClick: () => scroll("r"),
449
642
  "aria-label": "Scroll right",
450
643
  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",
451
- children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", className: "w-4 h-4", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx("path", { d: "M6 3l4 5-4 5" }) })
644
+ children: /* @__PURE__ */ jsx(
645
+ "svg",
646
+ {
647
+ viewBox: "0 0 16 16",
648
+ className: "w-4 h-4",
649
+ fill: "none",
650
+ stroke: "currentColor",
651
+ strokeWidth: "1.5",
652
+ strokeLinecap: "round",
653
+ strokeLinejoin: "round",
654
+ children: /* @__PURE__ */ jsx("path", { d: "M6 3l4 5-4 5" })
655
+ }
656
+ )
452
657
  }
453
658
  )
454
659
  ] });
@@ -603,16 +808,65 @@ function StoreHomePage({
603
808
  }
604
809
  ),
605
810
  /* @__PURE__ */ jsxs("section", { className: "relative overflow-hidden pt-14 pb-12 sm:pt-20 sm:pb-16", children: [
606
- /* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-gradient-to-b from-background via-primary/[0.06] to-background pointer-events-none", "aria-hidden": "true" }),
607
- /* @__PURE__ */ jsxs("svg", { className: "absolute inset-0 w-full h-full opacity-[0.035] pointer-events-none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: [
608
- /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("pattern", { id: "store-home-grid", width: "40", height: "40", patternUnits: "userSpaceOnUse", children: /* @__PURE__ */ jsx("path", { d: "M 40 0 L 0 0 0 40", fill: "none", stroke: "currentColor", strokeWidth: "1" }) }) }),
609
- /* @__PURE__ */ jsx("rect", { width: "100%", height: "100%", fill: "url(#store-home-grid)" })
610
- ] }),
611
- /* @__PURE__ */ jsx("div", { className: "absolute -top-16 left-1/3 w-80 h-80 rounded-full bg-primary/10 blur-3xl pointer-events-none", "aria-hidden": "true" }),
612
- /* @__PURE__ */ jsx("div", { className: "absolute top-8 right-1/4 w-56 h-56 rounded-full bg-primary/8 blur-2xl pointer-events-none", "aria-hidden": "true" }),
811
+ /* @__PURE__ */ jsx(
812
+ "div",
813
+ {
814
+ className: "absolute inset-0 bg-gradient-to-b from-background via-primary/[0.06] to-background pointer-events-none",
815
+ "aria-hidden": "true"
816
+ }
817
+ ),
818
+ /* @__PURE__ */ jsxs(
819
+ "svg",
820
+ {
821
+ className: "absolute inset-0 w-full h-full opacity-[0.035] pointer-events-none",
822
+ xmlns: "http://www.w3.org/2000/svg",
823
+ "aria-hidden": "true",
824
+ children: [
825
+ /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx(
826
+ "pattern",
827
+ {
828
+ id: "store-home-grid",
829
+ width: "40",
830
+ height: "40",
831
+ patternUnits: "userSpaceOnUse",
832
+ children: /* @__PURE__ */ jsx(
833
+ "path",
834
+ {
835
+ d: "M 40 0 L 0 0 0 40",
836
+ fill: "none",
837
+ stroke: "currentColor",
838
+ strokeWidth: "1"
839
+ }
840
+ )
841
+ }
842
+ ) }),
843
+ /* @__PURE__ */ jsx("rect", { width: "100%", height: "100%", fill: "url(#store-home-grid)" })
844
+ ]
845
+ }
846
+ ),
847
+ /* @__PURE__ */ jsx(
848
+ "div",
849
+ {
850
+ className: "absolute -top-16 left-1/3 w-80 h-80 rounded-full bg-primary/10 blur-3xl pointer-events-none",
851
+ "aria-hidden": "true"
852
+ }
853
+ ),
854
+ /* @__PURE__ */ jsx(
855
+ "div",
856
+ {
857
+ className: "absolute top-8 right-1/4 w-56 h-56 rounded-full bg-primary/8 blur-2xl pointer-events-none",
858
+ "aria-hidden": "true"
859
+ }
860
+ ),
613
861
  /* @__PURE__ */ jsxs("div", { className: "relative max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 text-center", children: [
614
862
  /* @__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-primary mb-5", children: [
615
- /* @__PURE__ */ jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-primary flex-shrink-0", "aria-hidden": "true" }),
863
+ /* @__PURE__ */ jsx(
864
+ "span",
865
+ {
866
+ className: "w-1.5 h-1.5 rounded-full bg-primary flex-shrink-0",
867
+ "aria-hidden": "true"
868
+ }
869
+ ),
616
870
  "Community Marketplace"
617
871
  ] }),
618
872
  /* @__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 }),
@@ -624,7 +878,9 @@ function StoreHomePage({
624
878
  onSubmit: (e) => {
625
879
  e.preventDefault();
626
880
  const q = new FormData(e.currentTarget).get("q");
627
- navigate(q.trim() ? `${browsePath}?q=${encodeURIComponent(q.trim())}` : browsePath);
881
+ navigate(
882
+ q.trim() ? `${browsePath}?q=${encodeURIComponent(q.trim())}` : browsePath
883
+ );
628
884
  },
629
885
  children: [
630
886
  /* @__PURE__ */ jsx(
@@ -666,9 +922,23 @@ function StoreHomePage({
666
922
  /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [...Array(4)].map((_, i) => /* @__PURE__ */ jsx(GridCardSkeleton, {}, i)) })
667
923
  ] }) : error ? /* @__PURE__ */ jsxs("div", { className: "py-16 text-center", children: [
668
924
  /* @__PURE__ */ jsx("p", { className: "text-muted-foreground mb-4", children: error }),
669
- /* @__PURE__ */ jsx("button", { type: "button", onClick: () => window.location.reload(), className: "text-sm text-primary hover:underline", children: "Retry" })
925
+ /* @__PURE__ */ jsx(
926
+ "button",
927
+ {
928
+ type: "button",
929
+ onClick: () => window.location.reload(),
930
+ className: "text-sm text-primary hover:underline",
931
+ children: "Retry"
932
+ }
933
+ )
670
934
  ] }) : featuredItems.length > 0 ? /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 lg:grid-cols-[1fr_2fr] gap-4 items-start", children: [
671
- /* @__PURE__ */ jsx(FeaturedHeroCard, { product: featuredItems[0], onNavigate: navigate }),
935
+ /* @__PURE__ */ jsx(
936
+ FeaturedHeroCard,
937
+ {
938
+ product: featuredItems[0],
939
+ onNavigate: navigate
940
+ }
941
+ ),
672
942
  /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: featuredItems.slice(1, 5).map((product) => /* @__PURE__ */ jsx(
673
943
  ProductCard,
674
944
  {
@@ -689,7 +959,13 @@ function StoreHomePage({
689
959
  onNavigate: navigate
690
960
  }
691
961
  ),
692
- loading ? /* @__PURE__ */ jsx("div", { className: "flex gap-3 overflow-hidden", children: [...Array(5)].map((_, i) => /* @__PURE__ */ jsx(ScrollCardSkeleton, {}, i)) }) : /* @__PURE__ */ jsx(ScrollRow, { products: popularItems, onProductClick: handleProductClick })
962
+ loading ? /* @__PURE__ */ jsx("div", { className: "flex gap-3 overflow-hidden", children: [...Array(5)].map((_, i) => /* @__PURE__ */ jsx(ScrollCardSkeleton, {}, i)) }) : /* @__PURE__ */ jsx(
963
+ ScrollRow,
964
+ {
965
+ products: popularItems,
966
+ onProductClick: handleProductClick
967
+ }
968
+ )
693
969
  ] }),
694
970
  (loading || freeItems.length > 0) && /* @__PURE__ */ jsxs("section", { children: [
695
971
  /* @__PURE__ */ jsx(
@@ -712,16 +988,35 @@ function StoreHomePage({
712
988
  ] })
713
989
  ] }),
714
990
  /* @__PURE__ */ jsxs("section", { className: "relative overflow-hidden border-t border-border", children: [
715
- /* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-gradient-to-br from-primary/8 via-background to-primary/5 pointer-events-none", "aria-hidden": "true" }),
716
- /* @__PURE__ */ jsx("div", { 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", "aria-hidden": "true" }),
991
+ /* @__PURE__ */ jsx(
992
+ "div",
993
+ {
994
+ className: "absolute inset-0 bg-gradient-to-br from-primary/8 via-background to-primary/5 pointer-events-none",
995
+ "aria-hidden": "true"
996
+ }
997
+ ),
998
+ /* @__PURE__ */ jsx(
999
+ "div",
1000
+ {
1001
+ 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",
1002
+ "aria-hidden": "true"
1003
+ }
1004
+ ),
717
1005
  /* @__PURE__ */ jsxs("div", { className: "relative max-w-2xl mx-auto px-4 py-16 text-center", children: [
718
1006
  /* @__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-primary mb-5", children: [
719
- /* @__PURE__ */ jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-primary flex-shrink-0", "aria-hidden": "true" }),
1007
+ /* @__PURE__ */ jsx(
1008
+ "span",
1009
+ {
1010
+ className: "w-1.5 h-1.5 rounded-full bg-primary flex-shrink-0",
1011
+ "aria-hidden": "true"
1012
+ }
1013
+ ),
720
1014
  "Become a publisher"
721
1015
  ] }),
722
1016
  /* @__PURE__ */ jsx("h2", { className: "text-2xl sm:text-3xl font-bold text-foreground mb-3", children: "Built something useful?" }),
723
1017
  /* @__PURE__ */ jsxs("p", { className: "text-muted-foreground mb-8 max-w-lg mx-auto leading-relaxed", children: [
724
- "Share your workflows, nodes, and integrations with ",
1018
+ "Share your workflows, nodes, and integrations with",
1019
+ " ",
725
1020
  productName ?? "the",
726
1021
  " community. Earn from your work or contribute for free."
727
1022
  ] }),
@@ -777,7 +1072,14 @@ var PRICING_OPTIONS = [
777
1072
  ];
778
1073
  function parseUrlParams() {
779
1074
  if (typeof window === "undefined")
780
- return { q: "", type: "", pricingModel: "", category: "", sortBy: "RELEVANCE", featured: false };
1075
+ return {
1076
+ q: "",
1077
+ type: "",
1078
+ pricingModel: "",
1079
+ category: "",
1080
+ sortBy: "RELEVANCE",
1081
+ featured: false
1082
+ };
781
1083
  const p = new URLSearchParams(window.location.search);
782
1084
  return {
783
1085
  q: p.get("q") ?? "",
@@ -829,7 +1131,9 @@ function StoreBrowsePage({
829
1131
  const [featured, setFeatured] = useState(initial.featured);
830
1132
  const [offset, setOffset] = useState(0);
831
1133
  const [result, setResult] = useState(null);
832
- const [allProducts, setAllProducts] = useState([]);
1134
+ const [allProducts, setAllProducts] = useState(
1135
+ []
1136
+ );
833
1137
  const [categories, setCategories] = useState([]);
834
1138
  const [loading, setLoading] = useState(true);
835
1139
  const [loadingMore, setLoadingMore] = useState(false);
@@ -873,7 +1177,16 @@ function StoreBrowsePage({
873
1177
  return () => {
874
1178
  cancelled = true;
875
1179
  };
876
- }, [client, search, type, pricingModel, category, sortBy, compatibleWith, featured]);
1180
+ }, [
1181
+ client,
1182
+ search,
1183
+ type,
1184
+ pricingModel,
1185
+ category,
1186
+ sortBy,
1187
+ compatibleWith,
1188
+ featured
1189
+ ]);
877
1190
  function loadMore() {
878
1191
  const nextOffset = offset + PAGE_SIZE;
879
1192
  setLoadingMore(true);
@@ -1049,7 +1362,8 @@ function StoreBrowsePage({
1049
1362
  onClick: () => setFiltersOpen(!filtersOpen),
1050
1363
  className: "lg:hidden h-10 px-4 rounded-lg border border-border bg-background text-sm text-foreground hover:bg-muted/50 transition-colors",
1051
1364
  children: [
1052
- "Filters ",
1365
+ "Filters",
1366
+ " ",
1053
1367
  hasActiveFilters && /* @__PURE__ */ jsx("span", { className: "text-primary", children: "\u2022" })
1054
1368
  ]
1055
1369
  }
@@ -1063,14 +1377,32 @@ function StoreBrowsePage({
1063
1377
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-4 flex-wrap", children: [
1064
1378
  /* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: loading ? "Loading\u2026" : `${result?.totalCount ?? 0} results` }),
1065
1379
  hasActiveFilters && /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap gap-1.5", children: [
1066
- search && /* @__PURE__ */ jsx(Chip, { label: `"${search}"`, onRemove: () => {
1067
- setSearch("");
1068
- setInputValue("");
1069
- } }),
1380
+ search && /* @__PURE__ */ jsx(
1381
+ Chip,
1382
+ {
1383
+ label: `"${search}"`,
1384
+ onRemove: () => {
1385
+ setSearch("");
1386
+ setInputValue("");
1387
+ }
1388
+ }
1389
+ ),
1070
1390
  type && /* @__PURE__ */ jsx(Chip, { label: type, onRemove: () => setType("") }),
1071
- pricingModel && /* @__PURE__ */ jsx(Chip, { label: pricingModel, onRemove: () => setPricingModel("") }),
1391
+ pricingModel && /* @__PURE__ */ jsx(
1392
+ Chip,
1393
+ {
1394
+ label: pricingModel,
1395
+ onRemove: () => setPricingModel("")
1396
+ }
1397
+ ),
1072
1398
  category && /* @__PURE__ */ jsx(Chip, { label: category, onRemove: () => setCategory("") }),
1073
- featured && /* @__PURE__ */ jsx(Chip, { label: "Featured", onRemove: () => setFeatured(false) })
1399
+ featured && /* @__PURE__ */ jsx(
1400
+ Chip,
1401
+ {
1402
+ label: "Featured",
1403
+ onRemove: () => setFeatured(false)
1404
+ }
1405
+ )
1074
1406
  ] })
1075
1407
  ] }),
1076
1408
  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(
@@ -1122,9 +1454,97 @@ function StoreBrowsePage({
1122
1454
  function Chip({ label, onRemove }) {
1123
1455
  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: [
1124
1456
  label,
1125
- /* @__PURE__ */ jsx("button", { type: "button", onClick: onRemove, "aria-label": `Remove ${label}`, className: "hover:opacity-70", children: "\xD7" })
1457
+ /* @__PURE__ */ jsx(
1458
+ "button",
1459
+ {
1460
+ type: "button",
1461
+ onClick: onRemove,
1462
+ "aria-label": `Remove ${label}`,
1463
+ className: "hover:opacity-70",
1464
+ children: "\xD7"
1465
+ }
1466
+ )
1126
1467
  ] });
1127
1468
  }
1469
+ function detectTheme() {
1470
+ if (typeof document === "undefined") return "light";
1471
+ const root = document.documentElement;
1472
+ return root.classList.contains("dark") || root.getAttribute("data-theme") === "dark" ? "dark" : "light";
1473
+ }
1474
+ function WorkflowEmbed({
1475
+ appUrl,
1476
+ productId,
1477
+ theme,
1478
+ clickToInteract = true,
1479
+ hideCta = false,
1480
+ className,
1481
+ onError
1482
+ }) {
1483
+ const iframeRef = useRef(null);
1484
+ const [status, setStatus] = useState("loading");
1485
+ const [interactive, setInteractive] = useState(!clickToInteract);
1486
+ const resolvedTheme = useMemo(() => theme ?? detectTheme(), [theme]);
1487
+ const src = useMemo(() => {
1488
+ const base = appUrl.replace(/\/+$/, "");
1489
+ const params = new URLSearchParams({
1490
+ productId,
1491
+ theme: resolvedTheme
1492
+ });
1493
+ if (hideCta) params.set("cta", "false");
1494
+ return `${base}/embed/workflow?${params.toString()}`;
1495
+ }, [appUrl, productId, resolvedTheme, hideCta]);
1496
+ useEffect(() => {
1497
+ const handler = (event) => {
1498
+ if (event.source !== iframeRef.current?.contentWindow) return;
1499
+ const data = event.data;
1500
+ if (data?.type === "fluidgrids:embed:loaded") setStatus("loaded");
1501
+ if (data?.type === "fluidgrids:embed:error") {
1502
+ setStatus("error");
1503
+ onError?.(data.message ?? "Failed to load workflow preview");
1504
+ }
1505
+ };
1506
+ window.addEventListener("message", handler);
1507
+ return () => window.removeEventListener("message", handler);
1508
+ }, [onError]);
1509
+ if (status === "error") return null;
1510
+ return /* @__PURE__ */ jsxs(
1511
+ "div",
1512
+ {
1513
+ className: `relative w-full overflow-hidden rounded-xl border border-border bg-muted ${className ?? ""}`,
1514
+ style: { aspectRatio: "16 / 9" },
1515
+ children: [
1516
+ status === "loading" && /* @__PURE__ */ jsx(
1517
+ "div",
1518
+ {
1519
+ className: "absolute inset-0 animate-pulse bg-muted",
1520
+ "aria-hidden": "true"
1521
+ }
1522
+ ),
1523
+ /* @__PURE__ */ jsx(
1524
+ "iframe",
1525
+ {
1526
+ ref: iframeRef,
1527
+ src,
1528
+ title: "Workflow preview",
1529
+ loading: "lazy",
1530
+ className: "h-full w-full border-0",
1531
+ style: interactive ? void 0 : { pointerEvents: "none" }
1532
+ }
1533
+ ),
1534
+ clickToInteract && !interactive && status === "loaded" && /* @__PURE__ */ jsx(
1535
+ "button",
1536
+ {
1537
+ type: "button",
1538
+ onClick: () => setInteractive(true),
1539
+ className: "absolute inset-0 flex items-end justify-center bg-transparent pb-4",
1540
+ "aria-label": "Click to explore the workflow",
1541
+ 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" })
1542
+ }
1543
+ )
1544
+ ]
1545
+ }
1546
+ );
1547
+ }
1128
1548
  var ANIM_STYLES = `
1129
1549
  @keyframes sdFadeUp {
1130
1550
  from { opacity: 0; transform: translateY(16px); }
@@ -1157,7 +1577,11 @@ var ANIM_STYLES = `
1157
1577
  .sd-d5 { animation-delay: 320ms; }
1158
1578
  .sd-d6 { animation-delay: 400ms; }
1159
1579
  `;
1160
- function RatingBar({ label, count, total }) {
1580
+ function RatingBar({
1581
+ label,
1582
+ count,
1583
+ total
1584
+ }) {
1161
1585
  const pct = total > 0 ? Math.round(count / total * 100) : 0;
1162
1586
  return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
1163
1587
  /* @__PURE__ */ jsx("span", { className: "w-12 text-right shrink-0", children: label }),
@@ -1173,12 +1597,63 @@ function RatingBar({ label, count, total }) {
1173
1597
  }
1174
1598
  function IconBlock({ src }) {
1175
1599
  return /* @__PURE__ */ jsxs("div", { className: "relative flex-shrink-0", children: [
1176
- /* @__PURE__ */ jsx("div", { className: "sd-gp absolute -inset-1.5 rounded-2xl bg-primary/30 blur-md pointer-events-none", "aria-hidden": "true" }),
1177
- /* @__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("img", { src, alt: "", "aria-hidden": true, className: "w-full h-full object-cover" }) : /* @__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("svg", { viewBox: "0 0 40 40", className: "w-10 h-10", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: [
1178
- /* @__PURE__ */ jsx("polygon", { points: "20,4 34,11 20,18 6,11", className: "fill-primary/40", stroke: "currentColor", strokeWidth: "0.6", strokeOpacity: "0.4" }),
1179
- /* @__PURE__ */ jsx("polygon", { points: "6,11 20,18 20,34 6,27", className: "fill-primary/20", stroke: "currentColor", strokeWidth: "0.6", strokeOpacity: "0.4" }),
1180
- /* @__PURE__ */ jsx("polygon", { points: "34,11 20,18 20,34 34,27", className: "fill-primary/30", stroke: "currentColor", strokeWidth: "0.6", strokeOpacity: "0.4" })
1181
- ] }) }) })
1600
+ /* @__PURE__ */ jsx(
1601
+ "div",
1602
+ {
1603
+ className: "sd-gp absolute -inset-1.5 rounded-2xl bg-primary/30 blur-md pointer-events-none",
1604
+ "aria-hidden": "true"
1605
+ }
1606
+ ),
1607
+ /* @__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(
1608
+ "img",
1609
+ {
1610
+ src,
1611
+ alt: "",
1612
+ "aria-hidden": true,
1613
+ className: "w-full h-full object-cover"
1614
+ }
1615
+ ) : /* @__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(
1616
+ "svg",
1617
+ {
1618
+ viewBox: "0 0 40 40",
1619
+ className: "w-10 h-10",
1620
+ fill: "none",
1621
+ xmlns: "http://www.w3.org/2000/svg",
1622
+ "aria-hidden": "true",
1623
+ children: [
1624
+ /* @__PURE__ */ jsx(
1625
+ "polygon",
1626
+ {
1627
+ points: "20,4 34,11 20,18 6,11",
1628
+ className: "fill-primary/40",
1629
+ stroke: "currentColor",
1630
+ strokeWidth: "0.6",
1631
+ strokeOpacity: "0.4"
1632
+ }
1633
+ ),
1634
+ /* @__PURE__ */ jsx(
1635
+ "polygon",
1636
+ {
1637
+ points: "6,11 20,18 20,34 6,27",
1638
+ className: "fill-primary/20",
1639
+ stroke: "currentColor",
1640
+ strokeWidth: "0.6",
1641
+ strokeOpacity: "0.4"
1642
+ }
1643
+ ),
1644
+ /* @__PURE__ */ jsx(
1645
+ "polygon",
1646
+ {
1647
+ points: "34,11 20,18 20,34 34,27",
1648
+ className: "fill-primary/30",
1649
+ stroke: "currentColor",
1650
+ strokeWidth: "0.6",
1651
+ strokeOpacity: "0.4"
1652
+ }
1653
+ )
1654
+ ]
1655
+ }
1656
+ ) }) })
1182
1657
  ] });
1183
1658
  }
1184
1659
  function StoreProductDetailPage({
@@ -1194,6 +1669,7 @@ function StoreProductDetailPage({
1194
1669
  const [error, setError] = useState(null);
1195
1670
  const [activeScreenshot, setActiveScreenshot] = useState(0);
1196
1671
  const [screenshotKey, setScreenshotKey] = useState(0);
1672
+ const [embedFailed, setEmbedFailed] = useState(false);
1197
1673
  useEffect(() => {
1198
1674
  if (!slug && !id) {
1199
1675
  setError("Product not found.");
@@ -1247,11 +1723,30 @@ function StoreProductDetailPage({
1247
1723
  if (error || !details) {
1248
1724
  return /* @__PURE__ */ jsxs("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-20 text-center", children: [
1249
1725
  /* @__PURE__ */ jsx("p", { className: "text-muted-foreground mb-4", children: error ?? "Product not found." }),
1250
- /* @__PURE__ */ jsx("button", { type: "button", onClick: () => navigate("/store"), className: "text-sm text-primary hover:underline", children: "Back to Store" })
1726
+ /* @__PURE__ */ jsx(
1727
+ "button",
1728
+ {
1729
+ type: "button",
1730
+ onClick: () => navigate("/store"),
1731
+ className: "text-sm text-primary hover:underline",
1732
+ children: "Back to Store"
1733
+ }
1734
+ )
1251
1735
  ] });
1252
1736
  }
1253
- const { product, publisher, reviews, reviewsCount, relatedProducts, ratingDistribution } = details;
1254
- const priceLabel = formatPrice(product.price, product.currency, product.pricingModel);
1737
+ const {
1738
+ product,
1739
+ publisher,
1740
+ reviews,
1741
+ reviewsCount,
1742
+ relatedProducts,
1743
+ ratingDistribution
1744
+ } = details;
1745
+ const priceLabel = formatPrice(
1746
+ product.price,
1747
+ product.currency,
1748
+ product.pricingModel
1749
+ );
1255
1750
  const screenshots = product.screenshots ?? [];
1256
1751
  const totalRatings = ratingDistribution ? ratingDistribution.fiveStars + ratingDistribution.fourStars + ratingDistribution.threeStars + ratingDistribution.twoStars + ratingDistribution.oneStar : 0;
1257
1752
  return /* @__PURE__ */ jsxs("div", { className: "w-full", children: [
@@ -1265,15 +1760,60 @@ function StoreProductDetailPage({
1265
1760
  }
1266
1761
  ),
1267
1762
  /* @__PURE__ */ jsxs("div", { className: "relative overflow-hidden", children: [
1268
- /* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-gradient-to-b from-primary/[0.07] via-background to-background pointer-events-none", "aria-hidden": "true" }),
1269
- /* @__PURE__ */ jsxs("svg", { className: "absolute inset-0 w-full h-full opacity-[0.04] pointer-events-none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: [
1270
- /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("pattern", { id: "sd-grid", width: "40", height: "40", patternUnits: "userSpaceOnUse", children: /* @__PURE__ */ jsx("path", { d: "M 40 0 L 0 0 0 40", fill: "none", stroke: "currentColor", strokeWidth: "1" }) }) }),
1271
- /* @__PURE__ */ jsx("rect", { width: "100%", height: "100%", fill: "url(#sd-grid)" })
1272
- ] }),
1273
- /* @__PURE__ */ jsx("div", { className: "absolute -top-12 -left-12 w-72 h-72 rounded-full bg-primary/10 blur-3xl pointer-events-none", "aria-hidden": "true" }),
1763
+ /* @__PURE__ */ jsx(
1764
+ "div",
1765
+ {
1766
+ className: "absolute inset-0 bg-gradient-to-b from-primary/[0.07] via-background to-background pointer-events-none",
1767
+ "aria-hidden": "true"
1768
+ }
1769
+ ),
1770
+ /* @__PURE__ */ jsxs(
1771
+ "svg",
1772
+ {
1773
+ className: "absolute inset-0 w-full h-full opacity-[0.04] pointer-events-none",
1774
+ xmlns: "http://www.w3.org/2000/svg",
1775
+ "aria-hidden": "true",
1776
+ children: [
1777
+ /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx(
1778
+ "pattern",
1779
+ {
1780
+ id: "sd-grid",
1781
+ width: "40",
1782
+ height: "40",
1783
+ patternUnits: "userSpaceOnUse",
1784
+ children: /* @__PURE__ */ jsx(
1785
+ "path",
1786
+ {
1787
+ d: "M 40 0 L 0 0 0 40",
1788
+ fill: "none",
1789
+ stroke: "currentColor",
1790
+ strokeWidth: "1"
1791
+ }
1792
+ )
1793
+ }
1794
+ ) }),
1795
+ /* @__PURE__ */ jsx("rect", { width: "100%", height: "100%", fill: "url(#sd-grid)" })
1796
+ ]
1797
+ }
1798
+ ),
1799
+ /* @__PURE__ */ jsx(
1800
+ "div",
1801
+ {
1802
+ className: "absolute -top-12 -left-12 w-72 h-72 rounded-full bg-primary/10 blur-3xl pointer-events-none",
1803
+ "aria-hidden": "true"
1804
+ }
1805
+ ),
1274
1806
  /* @__PURE__ */ jsxs("div", { className: "relative max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 pt-6 pb-8", children: [
1275
1807
  /* @__PURE__ */ jsxs("nav", { className: "sd-fi text-sm text-muted-foreground mb-6 flex items-center gap-1.5 flex-wrap", children: [
1276
- /* @__PURE__ */ jsx("button", { type: "button", onClick: () => navigate("/store"), className: "hover:text-primary transition-colors", children: "Store" }),
1808
+ /* @__PURE__ */ jsx(
1809
+ "button",
1810
+ {
1811
+ type: "button",
1812
+ onClick: () => navigate("/store"),
1813
+ className: "hover:text-primary transition-colors",
1814
+ children: "Store"
1815
+ }
1816
+ ),
1277
1817
  /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: "\u203A" }),
1278
1818
  product.category && /* @__PURE__ */ jsxs(Fragment, { children: [
1279
1819
  /* @__PURE__ */ jsx(
@@ -1339,6 +1879,14 @@ function StoreProductDetailPage({
1339
1879
  }
1340
1880
  )
1341
1881
  ] }),
1882
+ product.type === "WORKFLOW" && !embedFailed && /* @__PURE__ */ jsx("div", { className: "sd-fu sd-d3 mb-8", children: /* @__PURE__ */ jsx(
1883
+ WorkflowEmbed,
1884
+ {
1885
+ appUrl: appLoginUrl,
1886
+ productId: product.id,
1887
+ onError: () => setEmbedFailed(true)
1888
+ }
1889
+ ) }),
1342
1890
  screenshots.length > 0 && /* @__PURE__ */ jsxs("div", { className: "sd-fu sd-d3 mb-8", children: [
1343
1891
  /* @__PURE__ */ jsx("div", { className: "rounded-xl overflow-hidden bg-muted aspect-video mb-3 shadow-md", children: /* @__PURE__ */ jsx(
1344
1892
  "img",
@@ -1355,7 +1903,14 @@ function StoreProductDetailPage({
1355
1903
  type: "button",
1356
1904
  onClick: () => switchScreenshot(i),
1357
1905
  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"}`,
1358
- children: /* @__PURE__ */ jsx("img", { src, alt: `Thumbnail ${i + 1}`, className: "w-full h-full object-cover" })
1906
+ children: /* @__PURE__ */ jsx(
1907
+ "img",
1908
+ {
1909
+ src,
1910
+ alt: `Thumbnail ${i + 1}`,
1911
+ className: "w-full h-full object-cover"
1912
+ }
1913
+ )
1359
1914
  },
1360
1915
  i
1361
1916
  )) })
@@ -1367,7 +1922,14 @@ function StoreProductDetailPage({
1367
1922
  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: [
1368
1923
  /* @__PURE__ */ jsx("h2", { className: "text-sm font-semibold text-foreground mb-3", children: "Publisher" }),
1369
1924
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
1370
- publisher.logoUrl ? /* @__PURE__ */ jsx("img", { src: publisher.logoUrl, alt: publisher.name, className: "w-10 h-10 rounded-full object-cover" }) : /* @__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() }),
1925
+ publisher.logoUrl ? /* @__PURE__ */ jsx(
1926
+ "img",
1927
+ {
1928
+ src: publisher.logoUrl,
1929
+ alt: publisher.name,
1930
+ className: "w-10 h-10 rounded-full object-cover"
1931
+ }
1932
+ ) : /* @__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() }),
1371
1933
  /* @__PURE__ */ jsxs("div", { children: [
1372
1934
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
1373
1935
  /* @__PURE__ */ jsx("span", { className: "font-semibold text-foreground text-sm", children: publisher.name }),
@@ -1393,11 +1955,46 @@ function StoreProductDetailPage({
1393
1955
  ] })
1394
1956
  ] }),
1395
1957
  /* @__PURE__ */ jsxs("div", { className: "flex-1 space-y-1.5 pt-1", children: [
1396
- /* @__PURE__ */ jsx(RatingBar, { label: "5 \u2605", count: ratingDistribution.fiveStars, total: totalRatings }),
1397
- /* @__PURE__ */ jsx(RatingBar, { label: "4 \u2605", count: ratingDistribution.fourStars, total: totalRatings }),
1398
- /* @__PURE__ */ jsx(RatingBar, { label: "3 \u2605", count: ratingDistribution.threeStars, total: totalRatings }),
1399
- /* @__PURE__ */ jsx(RatingBar, { label: "2 \u2605", count: ratingDistribution.twoStars, total: totalRatings }),
1400
- /* @__PURE__ */ jsx(RatingBar, { label: "1 \u2605", count: ratingDistribution.oneStar, total: totalRatings })
1958
+ /* @__PURE__ */ jsx(
1959
+ RatingBar,
1960
+ {
1961
+ label: "5 \u2605",
1962
+ count: ratingDistribution.fiveStars,
1963
+ total: totalRatings
1964
+ }
1965
+ ),
1966
+ /* @__PURE__ */ jsx(
1967
+ RatingBar,
1968
+ {
1969
+ label: "4 \u2605",
1970
+ count: ratingDistribution.fourStars,
1971
+ total: totalRatings
1972
+ }
1973
+ ),
1974
+ /* @__PURE__ */ jsx(
1975
+ RatingBar,
1976
+ {
1977
+ label: "3 \u2605",
1978
+ count: ratingDistribution.threeStars,
1979
+ total: totalRatings
1980
+ }
1981
+ ),
1982
+ /* @__PURE__ */ jsx(
1983
+ RatingBar,
1984
+ {
1985
+ label: "2 \u2605",
1986
+ count: ratingDistribution.twoStars,
1987
+ total: totalRatings
1988
+ }
1989
+ ),
1990
+ /* @__PURE__ */ jsx(
1991
+ RatingBar,
1992
+ {
1993
+ label: "1 \u2605",
1994
+ count: ratingDistribution.oneStar,
1995
+ total: totalRatings
1996
+ }
1997
+ )
1401
1998
  ] })
1402
1999
  ] }),
1403
2000
  /* @__PURE__ */ jsx("div", { className: "space-y-3", children: reviews.slice(0, 5).map((review, idx) => /* @__PURE__ */ jsxs(
@@ -1412,11 +2009,14 @@ function StoreProductDetailPage({
1412
2009
  ] }),
1413
2010
  review.title && /* @__PURE__ */ jsx("p", { className: "font-semibold text-sm text-foreground mb-1", children: review.title }),
1414
2011
  review.comment && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground leading-relaxed", children: review.comment }),
1415
- review.createdAt && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground mt-2", children: new Date(review.createdAt).toLocaleDateString("en-US", {
1416
- year: "numeric",
1417
- month: "short",
1418
- day: "numeric"
1419
- }) })
2012
+ review.createdAt && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground mt-2", children: new Date(review.createdAt).toLocaleDateString(
2013
+ "en-US",
2014
+ {
2015
+ year: "numeric",
2016
+ month: "short",
2017
+ day: "numeric"
2018
+ }
2019
+ ) })
1420
2020
  ]
1421
2021
  },
1422
2022
  review.id
@@ -1436,7 +2036,13 @@ function StoreProductDetailPage({
1436
2036
  ] }),
1437
2037
  /* @__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: [
1438
2038
  /* @__PURE__ */ jsxs("div", { children: [
1439
- /* @__PURE__ */ jsx("div", { className: `text-3xl font-extrabold ${priceLabel === "Free" ? "text-emerald-500" : "text-foreground"}`, children: priceLabel }),
2039
+ /* @__PURE__ */ jsx(
2040
+ "div",
2041
+ {
2042
+ className: `text-3xl font-extrabold ${priceLabel === "Free" ? "text-emerald-500" : "text-foreground"}`,
2043
+ children: priceLabel
2044
+ }
2045
+ ),
1440
2046
  product.pricingModel === "SUBSCRIPTION" && /* @__PURE__ */ jsx("div", { className: "text-xs text-muted-foreground", children: "per month" })
1441
2047
  ] }),
1442
2048
  /* @__PURE__ */ jsx(
@@ -1489,6 +2095,6 @@ function StoreProductDetailPage({
1489
2095
  ] });
1490
2096
  }
1491
2097
 
1492
- export { ProductCard, StarRating, StoreBrowsePage, StoreHomePage, StoreProductDetailPage, TypeBadge, formatDownloads, formatPrice };
2098
+ export { ProductCard, StarRating, StoreBrowsePage, StoreHomePage, StoreProductDetailPage, TypeBadge, WorkflowEmbed, formatDownloads, formatPrice };
1493
2099
  //# sourceMappingURL=index.mjs.map
1494
2100
  //# sourceMappingURL=index.mjs.map