@burdenoff/microfe-store 2026.510.113

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 (141) hide show
  1. package/README.md +217 -0
  2. package/dist/StoreAdminRoot.d.ts +22 -0
  3. package/dist/StoreAdminRoot.js +23 -0
  4. package/dist/StoreAdminRoot.js.map +1 -0
  5. package/dist/StoreAdminRoutes.d.ts +9 -0
  6. package/dist/StoreAdminRoutes.js +69 -0
  7. package/dist/StoreAdminRoutes.js.map +1 -0
  8. package/dist/StoreRoot.d.ts +31 -0
  9. package/dist/StoreRoot.js +139 -0
  10. package/dist/StoreRoot.js.map +1 -0
  11. package/dist/StoreRoutes.d.ts +12 -0
  12. package/dist/StoreRoutes.js +285 -0
  13. package/dist/StoreRoutes.js.map +1 -0
  14. package/dist/components/InstallAppModal.d.ts +26 -0
  15. package/dist/components/InstallAppModal.js +287 -0
  16. package/dist/components/InstallAppModal.js.map +1 -0
  17. package/dist/components/RouteGuards.d.ts +17 -0
  18. package/dist/components/RouteGuards.js +26 -0
  19. package/dist/components/RouteGuards.js.map +1 -0
  20. package/dist/components/cart/CartDrawer.d.ts +35 -0
  21. package/dist/components/cart/CartDrawer.js +162 -0
  22. package/dist/components/cart/CartDrawer.js.map +1 -0
  23. package/dist/components/index.d.ts +9 -0
  24. package/dist/components/index.js +3 -0
  25. package/dist/components/marketplace/ProductCard.d.ts +18 -0
  26. package/dist/components/marketplace/ProductCard.js +2 -0
  27. package/dist/dev/main.d.ts +1 -0
  28. package/dist/generated/global-operations.d.ts +2012 -0
  29. package/dist/generated/global-operations.js +1444 -0
  30. package/dist/generated/global-operations.js.map +1 -0
  31. package/dist/generated/global-types.d.ts +20856 -0
  32. package/dist/generated/global-types.js +14 -0
  33. package/dist/generated/global-types.js.map +1 -0
  34. package/dist/generated/wspace-operations.d.ts +1 -0
  35. package/dist/generated/wspace-types.d.ts +53362 -0
  36. package/dist/hooks/index.d.ts +12 -0
  37. package/dist/hooks/useBackendCart.d.ts +73 -0
  38. package/dist/hooks/useBackendCart.js +171 -0
  39. package/dist/hooks/useBackendCart.js.map +1 -0
  40. package/dist/hooks/useCart.d.ts +62 -0
  41. package/dist/hooks/useCart.js +90 -0
  42. package/dist/hooks/useCart.js.map +1 -0
  43. package/dist/hooks/useInstallations.d.ts +43 -0
  44. package/dist/hooks/useInstallations.js +140 -0
  45. package/dist/hooks/useInstallations.js.map +1 -0
  46. package/dist/hooks/useOrders.d.ts +40 -0
  47. package/dist/hooks/useOrders.js +73 -0
  48. package/dist/hooks/useOrders.js.map +1 -0
  49. package/dist/hooks/useProductSearch.d.ts +22 -0
  50. package/dist/hooks/useProductSearch.js +59 -0
  51. package/dist/hooks/useProductSearch.js.map +1 -0
  52. package/dist/hooks/useStoreGraphQL.d.ts +475 -0
  53. package/dist/hooks/useStoreGraphQL.js +751 -0
  54. package/dist/hooks/useStoreGraphQL.js.map +1 -0
  55. package/dist/hooks/useStoreGraphQLWithContext.d.ts +48 -0
  56. package/dist/hooks/useStoreGraphQLWithContext.js +39 -0
  57. package/dist/hooks/useStoreGraphQLWithContext.js.map +1 -0
  58. package/dist/hooks/useStorePermissions.d.ts +63 -0
  59. package/dist/hooks/useStorePermissions.js +88 -0
  60. package/dist/hooks/useStorePermissions.js.map +1 -0
  61. package/dist/index.d.ts +44 -0
  62. package/dist/index.js +13 -0
  63. package/dist/pages/AdminDashboardPage.d.ts +3 -0
  64. package/dist/pages/AdminDashboardPage.js +491 -0
  65. package/dist/pages/AdminDashboardPage.js.map +1 -0
  66. package/dist/pages/AdminReviewModerationPage.d.ts +3 -0
  67. package/dist/pages/AdminReviewModerationPage.js +247 -0
  68. package/dist/pages/AdminReviewModerationPage.js.map +1 -0
  69. package/dist/pages/AdminStoresPage.d.ts +3 -0
  70. package/dist/pages/AdminStoresPage.js +442 -0
  71. package/dist/pages/AdminStoresPage.js.map +1 -0
  72. package/dist/pages/AdminSubmissionsQueuePage.d.ts +3 -0
  73. package/dist/pages/AdminSubmissionsQueuePage.js +387 -0
  74. package/dist/pages/AdminSubmissionsQueuePage.js.map +1 -0
  75. package/dist/pages/AppDetailPage.d.ts +3 -0
  76. package/dist/pages/AppDetailPage.js +166 -0
  77. package/dist/pages/AppDetailPage.js.map +1 -0
  78. package/dist/pages/AppSettingsPage.d.ts +3 -0
  79. package/dist/pages/AppSettingsPage.js +100 -0
  80. package/dist/pages/AppSettingsPage.js.map +1 -0
  81. package/dist/pages/CartPage.d.ts +8 -0
  82. package/dist/pages/CartPage.js +259 -0
  83. package/dist/pages/CartPage.js.map +1 -0
  84. package/dist/pages/InstalledAppsPage.d.ts +8 -0
  85. package/dist/pages/InstalledAppsPage.js +290 -0
  86. package/dist/pages/InstalledAppsPage.js.map +1 -0
  87. package/dist/pages/MarketplaceHomePage.d.ts +3 -0
  88. package/dist/pages/MarketplaceHomePage.js +1118 -0
  89. package/dist/pages/MarketplaceHomePage.js.map +1 -0
  90. package/dist/pages/MyLicensesPage.d.ts +3 -0
  91. package/dist/pages/MyLicensesPage.js +146 -0
  92. package/dist/pages/MyLicensesPage.js.map +1 -0
  93. package/dist/pages/OrderConfirmationPage.d.ts +3 -0
  94. package/dist/pages/OrderConfirmationPage.js +178 -0
  95. package/dist/pages/OrderConfirmationPage.js.map +1 -0
  96. package/dist/pages/OrdersPage.d.ts +8 -0
  97. package/dist/pages/OrdersPage.js +358 -0
  98. package/dist/pages/OrdersPage.js.map +1 -0
  99. package/dist/pages/ProductCategoryPage.d.ts +3 -0
  100. package/dist/pages/ProductCategoryPage.js +83 -0
  101. package/dist/pages/ProductCategoryPage.js.map +1 -0
  102. package/dist/pages/ProductDetailPage.d.ts +8 -0
  103. package/dist/pages/ProductDetailPage.js +1205 -0
  104. package/dist/pages/ProductDetailPage.js.map +1 -0
  105. package/dist/pages/ProductReviewsPage.d.ts +3 -0
  106. package/dist/pages/ProductReviewsPage.js +86 -0
  107. package/dist/pages/ProductReviewsPage.js.map +1 -0
  108. package/dist/pages/PublisherDashboardPage.d.ts +3 -0
  109. package/dist/pages/PublisherDashboardPage.js +154 -0
  110. package/dist/pages/PublisherDashboardPage.js.map +1 -0
  111. package/dist/pages/PublisherRevenuePage.d.ts +3 -0
  112. package/dist/pages/PublisherRevenuePage.js +138 -0
  113. package/dist/pages/PublisherRevenuePage.js.map +1 -0
  114. package/dist/pages/PublisherSubmissionsPage.d.ts +3 -0
  115. package/dist/pages/PublisherSubmissionsPage.js +174 -0
  116. package/dist/pages/PublisherSubmissionsPage.js.map +1 -0
  117. package/dist/pages/PublisherSubmitPage.d.ts +3 -0
  118. package/dist/pages/PublisherSubmitPage.js +224 -0
  119. package/dist/pages/PublisherSubmitPage.js.map +1 -0
  120. package/dist/pages/SearchResultsPage.d.ts +3 -0
  121. package/dist/pages/SearchResultsPage.js +125 -0
  122. package/dist/pages/SearchResultsPage.js.map +1 -0
  123. package/dist/pages/StoresPage.d.ts +3 -0
  124. package/dist/pages/StoresPage.js +154 -0
  125. package/dist/pages/StoresPage.js.map +1 -0
  126. package/dist/providers/StoreProvider.d.ts +38 -0
  127. package/dist/providers/StoreProvider.js +51 -0
  128. package/dist/providers/StoreProvider.js.map +1 -0
  129. package/dist/store/storeStore.d.ts +69 -0
  130. package/dist/store/storeStore.js +68 -0
  131. package/dist/store/storeStore.js.map +1 -0
  132. package/dist/translations/en.d.ts +518 -0
  133. package/dist/translations/en.js +514 -0
  134. package/dist/translations/en.js.map +1 -0
  135. package/dist/types/index.d.ts +575 -0
  136. package/dist/utils/index.d.ts +67 -0
  137. package/dist/utils/index.js +114 -0
  138. package/dist/utils/index.js.map +1 -0
  139. package/dist/utils/nativeBridge.d.ts +2 -0
  140. package/dist/utils/nativeBridge.js +2 -0
  141. package/package.json +105 -0
@@ -0,0 +1,1118 @@
1
+ import { useStore as e } from "../providers/StoreProvider.js";
2
+ import { useCart as t } from "../hooks/useCart.js";
3
+ import { CartDrawer as n } from "../components/cart/CartDrawer.js";
4
+ import { useBrowseStoreWithContext as r, useHomeGroupedProducts as i } from "../hooks/useStoreGraphQL.js";
5
+ import { PricingModel as a, ProductNature as ee, StoreSortBy as o } from "../generated/global-types.js";
6
+ import { useCallback as te, useEffect as ne, useId as re, useMemo as s, useState as c } from "react";
7
+ import { useI18n as ie } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
8
+ import { AlertCircle as ae, Bot as l, Box as u, Brain as d, ChevronDown as f, ChevronRight as oe, Clock as se, Database as ce, Download as le, FileCode2 as ue, Filter as de, Gift as fe, GitBranch as p, LayoutDashboard as m, Loader2 as pe, Puzzle as h, Search as me, ShoppingCart as he, SlidersHorizontal as ge, Sparkles as g, Star as _, TrendingUp as _e, X as v } from "lucide-react";
9
+ import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
10
+ import { useNavigate as ve } from "react-router-dom";
11
+ import { useDebounce as ye } from "@burdenoff/fe-libs/shared/hooks";
12
+ import { useEventBus as be } from "@burdenoff/fe-libs/shared/events";
13
+ //#region src/pages/MarketplaceHomePage.tsx
14
+ var xe = (e) => e >= 1e6 ? `${(e / 1e6).toFixed(1)}M` : e >= 1e3 ? `${(e / 1e3).toFixed(1)}K` : e.toString(), S = (e) => e.pricingModel === "FREE" || e.price === 0 ? "Free" : `$${e.price}`, C = (e) => ({
15
+ BOTAPP: "var(--color-accent-blue)",
16
+ AGENT: "var(--color-accent-purple)",
17
+ CONSOLE: "var(--color-accent-teal)",
18
+ WORKFLOW: "var(--color-status-warning-bg)",
19
+ NODE: "var(--color-status-error-bg)",
20
+ WIDGET: "var(--color-accent-purple)",
21
+ VIBEMODULE: "var(--color-accent-blue)",
22
+ DASHBOARD: "var(--color-accent-blue)",
23
+ PARSER: "var(--color-status-warning-bg)",
24
+ DATASINK: "var(--color-status-success-bg)",
25
+ APP: "var(--color-accent-indigo)",
26
+ TEMPLATE: "var(--color-accent-teal)",
27
+ INTEGRATION: "var(--color-status-warning-bg)",
28
+ EXTENSION: "var(--color-accent-purple)",
29
+ THEME: "var(--color-accent-purple)",
30
+ PLUGIN: "var(--color-status-success-bg)",
31
+ COMPONENT: "var(--color-accent-blue)"
32
+ })[e] || "var(--color-text-muted)", w = (e) => `color-mix(in srgb, ${C(e)}, transparent 85%)`, T = {
33
+ BOTAPP: l,
34
+ AGENT: d,
35
+ CONSOLE: m,
36
+ WORKFLOW: p,
37
+ NODE: u,
38
+ WIDGET: h,
39
+ VIBEMODULE: h,
40
+ DASHBOARD: m,
41
+ PARSER: ue,
42
+ DATASINK: ce,
43
+ APP: u,
44
+ TEMPLATE: m,
45
+ INTEGRATION: p,
46
+ EXTENSION: h,
47
+ THEME: h,
48
+ PLUGIN: h,
49
+ COMPONENT: u
50
+ }, E = ({ type: e, className: t, style: n }) => /* @__PURE__ */ b(T[e] || u, {
51
+ className: t,
52
+ style: n
53
+ }), D = ({ product: e, onClick: t, variant: n = "default" }) => {
54
+ let r = C(e.type);
55
+ return n === "featured" ? /* @__PURE__ */ x("button", {
56
+ onClick: t,
57
+ className: "group relative flex h-full w-full cursor-pointer flex-col overflow-hidden rounded-2xl border border-border-default bg-gradient-to-br from-bg-surface to-bg-sunken p-6 text-left transition-all hover:border-action-primary-border hover:shadow-lg",
58
+ children: [
59
+ e.featured && /* @__PURE__ */ x("div", {
60
+ className: "absolute right-4 top-4 flex items-center gap-1 rounded-full bg-status-warning-bg-subtle px-2 py-1 text-xs font-medium text-status-warning-text",
61
+ children: [/* @__PURE__ */ b(g, { className: "h-3 w-3" }), "Featured"]
62
+ }),
63
+ /* @__PURE__ */ x("div", {
64
+ className: "flex items-start gap-4",
65
+ children: [/* @__PURE__ */ b("div", {
66
+ className: "flex h-16 w-16 flex-shrink-0 items-center justify-center rounded-2xl",
67
+ style: { backgroundColor: w(e.type) },
68
+ children: e.icon ? /* @__PURE__ */ b("img", {
69
+ src: e.icon,
70
+ alt: e.name,
71
+ className: "h-10 w-10 rounded-lg object-cover"
72
+ }) : /* @__PURE__ */ b(E, {
73
+ type: e.type,
74
+ className: "h-10 w-10",
75
+ style: { color: r }
76
+ })
77
+ }), /* @__PURE__ */ x("div", {
78
+ className: "flex-1 overflow-hidden",
79
+ children: [/* @__PURE__ */ b("h3", {
80
+ className: "truncate text-lg font-semibold text-text-primary group-hover:text-text-link",
81
+ children: e.name
82
+ }), /* @__PURE__ */ x("p", {
83
+ className: "flex items-center gap-2 text-sm text-text-muted",
84
+ children: [/* @__PURE__ */ b(E, {
85
+ type: e.type,
86
+ className: "h-3.5 w-3.5"
87
+ }), e.category || e.type]
88
+ })]
89
+ })]
90
+ }),
91
+ /* @__PURE__ */ b("p", {
92
+ className: "mt-4 line-clamp-2 flex-1 text-sm text-text-muted",
93
+ children: e.description || "No description available"
94
+ }),
95
+ /* @__PURE__ */ x("div", {
96
+ className: "mt-4 flex items-center justify-between border-t border-border-default pt-4",
97
+ children: [/* @__PURE__ */ x("div", {
98
+ className: "flex items-center gap-3",
99
+ children: [/* @__PURE__ */ x("span", {
100
+ className: "flex items-center gap-1 text-sm text-text-muted",
101
+ children: [/* @__PURE__ */ b(_, { className: "h-4 w-4 fill-current text-status-warning-text" }), (e.rating ?? 0).toFixed(1)]
102
+ }), /* @__PURE__ */ x("span", {
103
+ className: "flex items-center gap-1 text-sm text-text-muted",
104
+ children: [/* @__PURE__ */ b(le, { className: "h-4 w-4" }), xe(e.downloads)]
105
+ })]
106
+ }), /* @__PURE__ */ b("span", {
107
+ className: "rounded-full bg-action-primary-bg/10 px-3 py-1 text-sm font-medium text-text-link",
108
+ children: S(e)
109
+ })]
110
+ })
111
+ ]
112
+ }) : n === "compact" ? /* @__PURE__ */ x("button", {
113
+ onClick: t,
114
+ className: "group flex cursor-pointer items-center gap-3 rounded-xl border border-transparent p-3 text-left transition-all hover:border-border-default hover:bg-bg-surface",
115
+ children: [
116
+ /* @__PURE__ */ b("div", {
117
+ className: "flex h-12 w-12 flex-shrink-0 items-center justify-center rounded-xl",
118
+ style: { backgroundColor: w(e.type) },
119
+ children: e.icon ? /* @__PURE__ */ b("img", {
120
+ src: e.icon,
121
+ alt: e.name,
122
+ className: "h-8 w-8 rounded-lg object-cover"
123
+ }) : /* @__PURE__ */ b(E, {
124
+ type: e.type,
125
+ className: "h-8 w-8",
126
+ style: { color: r }
127
+ })
128
+ }),
129
+ /* @__PURE__ */ x("div", {
130
+ className: "flex-1 overflow-hidden",
131
+ children: [/* @__PURE__ */ b("h4", {
132
+ className: "truncate font-medium text-text-primary group-hover:text-text-link",
133
+ children: e.name
134
+ }), /* @__PURE__ */ x("p", {
135
+ className: "truncate text-xs text-text-muted",
136
+ children: [
137
+ e.category || e.type,
138
+ " · ",
139
+ (e.rating ?? 0).toFixed(1),
140
+ " ★"
141
+ ]
142
+ })]
143
+ }),
144
+ /* @__PURE__ */ b("span", {
145
+ className: "text-xs font-medium text-text-muted",
146
+ children: S(e)
147
+ })
148
+ ]
149
+ }) : /* @__PURE__ */ x("button", {
150
+ onClick: t,
151
+ className: "group flex cursor-pointer flex-col overflow-hidden rounded-xl border border-border-default bg-bg-surface p-4 text-left transition-all hover:border-action-primary-border hover:shadow-md",
152
+ children: [
153
+ /* @__PURE__ */ x("div", {
154
+ className: "flex items-start gap-3",
155
+ children: [/* @__PURE__ */ b("div", {
156
+ className: "flex h-14 w-14 flex-shrink-0 items-center justify-center rounded-xl",
157
+ style: { backgroundColor: w(e.type) },
158
+ children: e.icon ? /* @__PURE__ */ b("img", {
159
+ src: e.icon,
160
+ alt: e.name,
161
+ className: "h-9 w-9 rounded-lg object-cover"
162
+ }) : /* @__PURE__ */ b(E, {
163
+ type: e.type,
164
+ className: "h-9 w-9",
165
+ style: { color: r }
166
+ })
167
+ }), /* @__PURE__ */ x("div", {
168
+ className: "flex-1 overflow-hidden",
169
+ children: [/* @__PURE__ */ b("h4", {
170
+ className: "truncate font-semibold text-text-primary group-hover:text-text-link",
171
+ children: e.name
172
+ }), /* @__PURE__ */ x("p", {
173
+ className: "flex items-center gap-1.5 text-xs text-text-muted",
174
+ children: [/* @__PURE__ */ b(E, {
175
+ type: e.type,
176
+ className: "h-3 w-3"
177
+ }), e.category || e.type]
178
+ })]
179
+ })]
180
+ }),
181
+ /* @__PURE__ */ b("p", {
182
+ className: "mt-3 line-clamp-2 text-sm text-text-muted",
183
+ children: e.description || "No description available"
184
+ }),
185
+ /* @__PURE__ */ x("div", {
186
+ className: "mt-3 flex items-center justify-between",
187
+ children: [/* @__PURE__ */ x("div", {
188
+ className: "flex items-center gap-2",
189
+ children: [
190
+ /* @__PURE__ */ x("span", {
191
+ className: "flex items-center gap-0.5 text-xs text-text-muted",
192
+ children: [/* @__PURE__ */ b(_, { className: "h-3.5 w-3.5 fill-current text-status-warning-text" }), (e.rating ?? 0).toFixed(1)]
193
+ }),
194
+ /* @__PURE__ */ b("span", {
195
+ className: "text-xs text-text-muted",
196
+ children: "·"
197
+ }),
198
+ /* @__PURE__ */ x("span", {
199
+ className: "text-xs text-text-muted",
200
+ children: [xe(e.downloads), " downloads"]
201
+ })
202
+ ]
203
+ }), /* @__PURE__ */ b("span", {
204
+ className: "text-xs font-semibold text-text-link",
205
+ children: S(e)
206
+ })]
207
+ })
208
+ ]
209
+ });
210
+ }, O = ({ icon: e, title: t, subtitle: n, onViewAll: r }) => /* @__PURE__ */ x("div", {
211
+ className: "mb-4 flex items-center justify-between",
212
+ children: [/* @__PURE__ */ x("div", {
213
+ className: "flex items-center gap-3",
214
+ children: [/* @__PURE__ */ b("div", {
215
+ className: "flex h-10 w-10 items-center justify-center rounded-xl bg-action-primary-bg/10",
216
+ children: /* @__PURE__ */ b(e, { className: "h-5 w-5 text-text-link" })
217
+ }), /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("h2", {
218
+ className: "text-lg font-semibold text-text-primary",
219
+ children: t
220
+ }), n && /* @__PURE__ */ b("p", {
221
+ className: "text-sm text-text-muted",
222
+ children: n
223
+ })] })]
224
+ }), r && /* @__PURE__ */ x("button", {
225
+ onClick: r,
226
+ className: "cursor-pointer flex items-center gap-1 text-sm font-medium text-text-link hover:underline",
227
+ children: ["View all", /* @__PURE__ */ b(oe, { className: "h-4 w-4" })]
228
+ })]
229
+ }), Se = ({ typeId: e, name: t, count: n, active: r, onClick: i }) => /* @__PURE__ */ x("button", {
230
+ onClick: i,
231
+ className: `flex cursor-pointer items-center gap-2 rounded-full px-4 py-2 text-sm font-medium transition-all ${r ? "bg-action-primary-bg text-action-primary-text" : "bg-bg-surface text-text-primary hover:bg-bg-sunken"}`,
232
+ children: [
233
+ /* @__PURE__ */ b(E, {
234
+ type: e,
235
+ className: "h-4 w-4"
236
+ }),
237
+ t,
238
+ /* @__PURE__ */ b("span", {
239
+ className: `rounded-full px-1.5 py-0.5 text-xs ${r ? "bg-bg-surface/20" : "bg-bg-sunken"}`,
240
+ children: n
241
+ })
242
+ ]
243
+ }), Ce = ({ featuredProducts: e, onProductClick: t }) => {
244
+ let [n, r] = c(0), i = e[n] || e[0];
245
+ if (!i) return null;
246
+ let a = C(i.type);
247
+ return /* @__PURE__ */ x("div", {
248
+ className: "relative overflow-hidden rounded-2xl bg-gradient-to-r from-bg-surface via-bg-sunken to-bg-surface p-8",
249
+ children: [
250
+ /* @__PURE__ */ b("div", {
251
+ className: "absolute inset-0 opacity-10",
252
+ style: { background: `linear-gradient(135deg, ${a} 0%, transparent 50%)` }
253
+ }),
254
+ /* @__PURE__ */ x("div", {
255
+ className: "relative z-10 flex items-center gap-8",
256
+ children: [/* @__PURE__ */ x("div", {
257
+ className: "flex-1",
258
+ children: [
259
+ /* @__PURE__ */ x("div", {
260
+ className: "mb-4 flex items-center gap-2",
261
+ children: [/* @__PURE__ */ x("span", {
262
+ className: "flex items-center gap-1 rounded-full bg-status-warning-bg-subtle px-3 py-1 text-xs font-semibold text-status-warning-text",
263
+ children: [/* @__PURE__ */ b(g, { className: "h-3 w-3" }), "Featured App"]
264
+ }), /* @__PURE__ */ b("span", {
265
+ className: "rounded-full bg-action-primary-bg/10 px-3 py-1 text-xs font-medium text-text-link",
266
+ children: i.category || i.type
267
+ })]
268
+ }),
269
+ /* @__PURE__ */ b("h1", {
270
+ className: "mb-3 text-3xl font-bold text-text-primary",
271
+ children: i.name
272
+ }),
273
+ /* @__PURE__ */ b("p", {
274
+ className: "mb-6 max-w-xl text-text-muted",
275
+ children: i.description || "No description available"
276
+ }),
277
+ /* @__PURE__ */ x("div", {
278
+ className: "mb-6 flex items-center gap-4",
279
+ children: [/* @__PURE__ */ x("span", {
280
+ className: "flex items-center gap-1 text-sm",
281
+ children: [
282
+ /* @__PURE__ */ b(_, { className: "h-5 w-5 fill-current text-status-warning-text" }),
283
+ /* @__PURE__ */ b("span", {
284
+ className: "font-semibold text-text-primary",
285
+ children: (i.rating ?? 0).toFixed(1)
286
+ }),
287
+ /* @__PURE__ */ x("span", {
288
+ className: "text-text-muted",
289
+ children: [
290
+ "(",
291
+ i.reviewCount,
292
+ " reviews)"
293
+ ]
294
+ })
295
+ ]
296
+ }), /* @__PURE__ */ x("span", {
297
+ className: "flex items-center gap-1 text-sm text-text-muted",
298
+ children: [
299
+ /* @__PURE__ */ b(le, { className: "h-4 w-4" }),
300
+ i.downloads.toLocaleString(),
301
+ " downloads"
302
+ ]
303
+ })]
304
+ }),
305
+ /* @__PURE__ */ b("button", {
306
+ onClick: () => t(i),
307
+ className: "cursor-pointer rounded-lg bg-action-primary-bg px-6 py-3 font-semibold text-action-primary-text transition-opacity hover:opacity-90",
308
+ children: "View Details"
309
+ })
310
+ ]
311
+ }), /* @__PURE__ */ b("div", {
312
+ className: "hidden flex-shrink-0 lg:block",
313
+ children: /* @__PURE__ */ b("div", {
314
+ className: "flex h-48 w-48 items-center justify-center rounded-3xl shadow-lg",
315
+ style: { backgroundColor: w(i.type) },
316
+ children: i.icon ? /* @__PURE__ */ b("img", {
317
+ src: i.icon,
318
+ alt: i.name,
319
+ className: "h-32 w-32 rounded-2xl object-cover"
320
+ }) : /* @__PURE__ */ b(E, {
321
+ type: i.type,
322
+ className: "h-32 w-32",
323
+ style: { color: a }
324
+ })
325
+ })
326
+ })]
327
+ }),
328
+ e.length > 1 && /* @__PURE__ */ b("div", {
329
+ className: "relative z-10 mt-6 flex gap-2",
330
+ children: e.map((e, t) => /* @__PURE__ */ b("button", {
331
+ onClick: () => r(t),
332
+ className: `h-2 w-8 rounded-full transition-all ${t === n ? "bg-action-primary-bg" : "bg-border-default hover:bg-action-primary-border"}`,
333
+ "aria-label": `View ${e.name}`
334
+ }, e.id))
335
+ })
336
+ ]
337
+ });
338
+ }, k = ({ variant: e = "default" }) => e === "featured" ? /* @__PURE__ */ x("div", {
339
+ className: "h-full animate-pulse rounded-2xl border border-border-default bg-bg-surface p-6",
340
+ children: [/* @__PURE__ */ x("div", {
341
+ className: "flex items-start gap-4",
342
+ children: [/* @__PURE__ */ b("div", { className: "h-16 w-16 rounded-2xl bg-bg-sunken" }), /* @__PURE__ */ x("div", {
343
+ className: "flex-1 space-y-2",
344
+ children: [/* @__PURE__ */ b("div", { className: "h-5 w-3/4 rounded bg-bg-sunken" }), /* @__PURE__ */ b("div", { className: "h-4 w-1/2 rounded bg-bg-sunken" })]
345
+ })]
346
+ }), /* @__PURE__ */ x("div", {
347
+ className: "mt-4 space-y-2",
348
+ children: [/* @__PURE__ */ b("div", { className: "h-4 w-full rounded bg-bg-sunken" }), /* @__PURE__ */ b("div", { className: "h-4 w-2/3 rounded bg-bg-sunken" })]
349
+ })]
350
+ }) : e === "compact" ? /* @__PURE__ */ x("div", {
351
+ className: "flex animate-pulse items-center gap-3 p-3",
352
+ children: [/* @__PURE__ */ b("div", { className: "h-12 w-12 rounded-xl bg-bg-sunken" }), /* @__PURE__ */ x("div", {
353
+ className: "flex-1 space-y-2",
354
+ children: [/* @__PURE__ */ b("div", { className: "h-4 w-3/4 rounded bg-bg-sunken" }), /* @__PURE__ */ b("div", { className: "h-3 w-1/2 rounded bg-bg-sunken" })]
355
+ })]
356
+ }) : /* @__PURE__ */ x("div", {
357
+ className: "animate-pulse rounded-xl border border-border-default bg-bg-surface p-4",
358
+ children: [/* @__PURE__ */ x("div", {
359
+ className: "flex items-start gap-3",
360
+ children: [/* @__PURE__ */ b("div", { className: "h-14 w-14 rounded-xl bg-bg-sunken" }), /* @__PURE__ */ x("div", {
361
+ className: "flex-1 space-y-2",
362
+ children: [/* @__PURE__ */ b("div", { className: "h-4 w-3/4 rounded bg-bg-sunken" }), /* @__PURE__ */ b("div", { className: "h-3 w-1/2 rounded bg-bg-sunken" })]
363
+ })]
364
+ }), /* @__PURE__ */ x("div", {
365
+ className: "mt-3 space-y-2",
366
+ children: [/* @__PURE__ */ b("div", { className: "h-3 w-full rounded bg-bg-sunken" }), /* @__PURE__ */ b("div", { className: "h-3 w-2/3 rounded bg-bg-sunken" })]
367
+ })]
368
+ }), A = () => /* @__PURE__ */ x("div", {
369
+ className: "animate-pulse rounded-2xl bg-gradient-to-r from-bg-surface via-bg-sunken to-bg-surface p-8",
370
+ children: [/* @__PURE__ */ x("div", {
371
+ className: "flex items-center gap-8",
372
+ children: [/* @__PURE__ */ x("div", {
373
+ className: "flex-1 space-y-4",
374
+ children: [
375
+ /* @__PURE__ */ x("div", {
376
+ className: "flex gap-2",
377
+ children: [/* @__PURE__ */ b("div", { className: "h-6 w-24 rounded-full bg-bg-sunken" }), /* @__PURE__ */ b("div", { className: "h-6 w-20 rounded-full bg-bg-sunken" })]
378
+ }),
379
+ /* @__PURE__ */ b("div", { className: "h-9 w-3/4 rounded bg-bg-sunken" }),
380
+ /* @__PURE__ */ x("div", {
381
+ className: "space-y-2",
382
+ children: [/* @__PURE__ */ b("div", { className: "h-4 w-full rounded bg-bg-sunken" }), /* @__PURE__ */ b("div", { className: "h-4 w-5/6 rounded bg-bg-sunken" })]
383
+ }),
384
+ /* @__PURE__ */ x("div", {
385
+ className: "flex gap-4",
386
+ children: [/* @__PURE__ */ b("div", { className: "h-5 w-24 rounded bg-bg-sunken" }), /* @__PURE__ */ b("div", { className: "h-5 w-32 rounded bg-bg-sunken" })]
387
+ }),
388
+ /* @__PURE__ */ b("div", { className: "h-12 w-36 rounded-lg bg-bg-sunken" })
389
+ ]
390
+ }), /* @__PURE__ */ b("div", { className: "hidden h-48 w-48 rounded-3xl bg-bg-sunken lg:block" })]
391
+ }), /* @__PURE__ */ b("div", {
392
+ className: "mt-6 flex gap-2",
393
+ children: [...[
394
+ ,
395
+ ,
396
+ ,
397
+ ]].map((e, t) => /* @__PURE__ */ b("div", { className: "h-2 w-8 rounded-full bg-bg-sunken" }, t))
398
+ })]
399
+ }), j = [
400
+ 100,
401
+ 120,
402
+ 90,
403
+ 110,
404
+ 130,
405
+ 95,
406
+ 115,
407
+ 105
408
+ ], M = () => /* @__PURE__ */ x("div", {
409
+ className: "space-y-4",
410
+ children: [/* @__PURE__ */ b("div", { className: "h-6 w-32 animate-pulse rounded bg-bg-sunken" }), /* @__PURE__ */ b("div", {
411
+ className: "flex flex-wrap gap-2",
412
+ children: j.map((e, t) => /* @__PURE__ */ b("div", {
413
+ className: "h-9 animate-pulse rounded-full bg-bg-sunken",
414
+ style: { width: `${e}px` }
415
+ }, t))
416
+ })]
417
+ }), N = () => /* @__PURE__ */ x("div", {
418
+ className: "mb-4 flex items-center justify-between",
419
+ children: [/* @__PURE__ */ x("div", {
420
+ className: "flex items-center gap-3",
421
+ children: [/* @__PURE__ */ b("div", { className: "h-10 w-10 animate-pulse rounded-xl bg-bg-sunken" }), /* @__PURE__ */ x("div", {
422
+ className: "space-y-1",
423
+ children: [/* @__PURE__ */ b("div", { className: "h-5 w-40 animate-pulse rounded bg-bg-sunken" }), /* @__PURE__ */ b("div", { className: "h-4 w-32 animate-pulse rounded bg-bg-sunken" })]
424
+ })]
425
+ }), /* @__PURE__ */ b("div", { className: "h-4 w-16 animate-pulse rounded bg-bg-sunken" })]
426
+ }), we = () => /* @__PURE__ */ x("div", {
427
+ className: "mx-auto max-w-7xl space-y-8 px-6 py-6",
428
+ children: [
429
+ /* @__PURE__ */ b(A, {}),
430
+ /* @__PURE__ */ b(M, {}),
431
+ /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b(N, {}), /* @__PURE__ */ b("div", {
432
+ className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",
433
+ children: [...[
434
+ ,
435
+ ,
436
+ ,
437
+ ,
438
+ ,
439
+ ,
440
+ ]].map((e, t) => /* @__PURE__ */ b(k, {}, t))
441
+ })] }),
442
+ /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b(N, {}), /* @__PURE__ */ b("div", {
443
+ className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",
444
+ children: [...[
445
+ ,
446
+ ,
447
+ ,
448
+ ,
449
+ ,
450
+ ,
451
+ ]].map((e, t) => /* @__PURE__ */ b(k, {}, t))
452
+ })] }),
453
+ /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b(N, {}), /* @__PURE__ */ b("div", {
454
+ className: "grid grid-cols-2 gap-2 sm:grid-cols-3 lg:grid-cols-6",
455
+ children: [...[
456
+ ,
457
+ ,
458
+ ,
459
+ ,
460
+ ,
461
+ ,
462
+ ]].map((e, t) => /* @__PURE__ */ b(k, { variant: "compact" }, t))
463
+ })] })
464
+ ]
465
+ }), P = ({ label: e, value: t, options: n, onChange: r }) => {
466
+ let i = re();
467
+ return /* @__PURE__ */ x("label", {
468
+ htmlFor: i,
469
+ className: "relative inline-flex items-center gap-2 rounded-lg border border-border-default bg-bg-surface px-3 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken focus-within:border-action-primary-border focus-within:ring-2 focus-within:ring-action-primary-border/20",
470
+ children: [
471
+ /* @__PURE__ */ b("span", {
472
+ className: "sr-only",
473
+ children: e
474
+ }),
475
+ /* @__PURE__ */ x("span", {
476
+ className: "text-text-muted",
477
+ children: [e, ":"]
478
+ }),
479
+ /* @__PURE__ */ b("select", {
480
+ id: i,
481
+ "aria-label": e,
482
+ value: t,
483
+ onChange: (e) => r(e.target.value),
484
+ className: "min-w-[8rem] appearance-none bg-transparent pr-6 text-sm font-medium text-text-primary focus:outline-none",
485
+ children: n.map((e) => /* @__PURE__ */ b("option", {
486
+ value: e.value,
487
+ children: e.label
488
+ }, e.value))
489
+ }),
490
+ /* @__PURE__ */ b(f, { className: "pointer-events-none absolute right-3 h-4 w-4 text-text-muted" })
491
+ ]
492
+ });
493
+ }, F = () => {
494
+ let l = ve(), { basePath: d } = e(), { t: f } = ie(), oe = re(), ce = be(), { cartOpen: le, closeCart: ue, itemCount: p, cartItems: m, subtotal: h, tax: xe, total: S, updateQuantity: C, removeProduct: w } = t(), [T, E] = c(""), [k, A] = c("all"), [j, M] = c("all"), [N, F] = c("any"), [I, Te] = c("all"), [L, Ee] = c("all"), [R, De] = c("all"), [z, Oe] = c(!1), [B, ke] = c("relevance"), [Ae, je] = c(!1), V = ye(T, 1500), Me = [
495
+ {
496
+ value: "all",
497
+ label: "All Prices"
498
+ },
499
+ {
500
+ value: "free",
501
+ label: "Free"
502
+ },
503
+ {
504
+ value: "paid",
505
+ label: "Paid (One-time)"
506
+ },
507
+ {
508
+ value: "subscription",
509
+ label: "Subscription"
510
+ }
511
+ ], Ne = [
512
+ {
513
+ value: "any",
514
+ label: "Any Rating"
515
+ },
516
+ {
517
+ value: "3",
518
+ label: "3+ Stars"
519
+ },
520
+ {
521
+ value: "3.5",
522
+ label: "3.5+ Stars"
523
+ },
524
+ {
525
+ value: "4",
526
+ label: "4+ Stars"
527
+ },
528
+ {
529
+ value: "4.5",
530
+ label: "4.5+ Stars"
531
+ }
532
+ ], Pe = [
533
+ {
534
+ value: "all",
535
+ label: "All Types"
536
+ },
537
+ {
538
+ value: "digital",
539
+ label: "Digital"
540
+ },
541
+ {
542
+ value: "physical",
543
+ label: "Physical"
544
+ }
545
+ ], Fe = [
546
+ {
547
+ value: "relevance",
548
+ label: "Relevance"
549
+ },
550
+ {
551
+ value: "rating",
552
+ label: "Highest Rated"
553
+ },
554
+ {
555
+ value: "downloads",
556
+ label: "Most Downloads"
557
+ },
558
+ {
559
+ value: "newest",
560
+ label: "Newest First"
561
+ },
562
+ {
563
+ value: "price-low",
564
+ label: "Price: Low to High"
565
+ },
566
+ {
567
+ value: "price-high",
568
+ label: "Price: High to Low"
569
+ },
570
+ {
571
+ value: "name-asc",
572
+ label: "Name A-Z"
573
+ }
574
+ ], Ie = (e) => ({
575
+ relevance: o.Relevance,
576
+ rating: o.Rating,
577
+ downloads: o.Downloads,
578
+ newest: o.Newest,
579
+ "price-low": o.PriceLow,
580
+ "price-high": o.PriceHigh,
581
+ "name-asc": o.NameAsc
582
+ })[e], Le = (e) => {
583
+ if (e !== "all") return {
584
+ free: a.Free,
585
+ paid: a.PaidOnetime,
586
+ subscription: a.Subscription
587
+ }[e];
588
+ }, H = V.trim() !== "" || j !== "all" || N !== "any" || I !== "all" || L !== "all" || R !== "all" || z || k !== "all" || B !== "relevance", Re = T.trim() !== "" && T !== V, ze = () => {
589
+ E(""), M("all"), F("any"), Te("all"), Ee("all"), De("all"), Oe(!1), ke("relevance"), A("all");
590
+ }, U = (j === "all" ? 0 : 1) + (N === "any" ? 0 : 1) + (I === "all" ? 0 : 1) + (L === "all" ? 0 : 1) + (R === "all" ? 0 : 1) + +!!z + (k === "all" ? 0 : 1), Be = s(() => {
591
+ let e = {
592
+ sortBy: Ie(B),
593
+ pagination: { limit: 50 }
594
+ };
595
+ if (H) {
596
+ e.filter = {}, V.trim() && (e.filter.search = V.trim()), k !== "all" && (e.filter.type = k), L !== "all" && (e.filter.category = L), I !== "all" && (e.filter.nature = I === "digital" ? ee.Digital : ee.Physical);
597
+ let t = Le(j);
598
+ t && (e.filter.pricingModel = t), N !== "any" && (e.filter.minRating = parseFloat(N)), z && (e.filter.featured = !0), R !== "all" && (e.filter.license = R);
599
+ }
600
+ return e;
601
+ }, [
602
+ V,
603
+ k,
604
+ L,
605
+ I,
606
+ j,
607
+ N,
608
+ z,
609
+ R,
610
+ B,
611
+ H
612
+ ]), { featured: W, mostDownloaded: G, recentlyAdded: K, freeItems: q, loading: Ve, error: He, refetch: Ue } = i({ skip: H }), { products: We, totalCount: J, facets: Y, loading: X, error: Ge, refetch: Ke } = r(H ? Be : {}, { skip: !H }), qe = H ? X : Ve, Z = H ? Ge : He, Je = H ? Ke : Ue, Ye = H ? We : [];
613
+ ne(() => {
614
+ !V.trim() || X || ce.emit("store.marketplace.searched", {
615
+ query: V,
616
+ resultCount: J
617
+ });
618
+ }, [V, X]);
619
+ let Q = te((e) => {
620
+ l(`${d}/marketplace/product/${e.id}`);
621
+ }, [l, d]), Xe = () => {
622
+ ue(), l(`${d}/cart`);
623
+ }, $ = s(() => [...new Map([
624
+ ...W,
625
+ ...G,
626
+ ...K,
627
+ ...q
628
+ ].map((e) => [e.id, e])).values()], [
629
+ W,
630
+ G,
631
+ K,
632
+ q
633
+ ]), Ze = s(() => Y?.types && Y.types.length > 0 ? [{
634
+ id: "all",
635
+ name: "All Apps",
636
+ count: J
637
+ }, ...Y.types.map((e) => ({
638
+ id: e.value,
639
+ name: e.value.charAt(0) + e.value.slice(1).toLowerCase().replace(/_/g, " "),
640
+ count: e.count
641
+ }))] : [{
642
+ id: "all",
643
+ name: "All Apps",
644
+ count: $.length
645
+ }, ...Array.from(new Set($.map((e) => e.type))).map((e) => ({
646
+ id: e,
647
+ name: e.charAt(0) + e.slice(1).toLowerCase().replace(/_/g, " "),
648
+ count: $.filter((t) => t.type === e).length
649
+ })).filter((e) => e.count > 0).sort((e, t) => t.count - e.count)], [
650
+ Y,
651
+ $,
652
+ J
653
+ ]), Qe = s(() => Y?.categories && Y.categories.length > 0 ? [{
654
+ value: "all",
655
+ label: "All Categories"
656
+ }, ...Y.categories.map((e) => ({
657
+ value: e.value,
658
+ label: e.value
659
+ }))] : [{
660
+ value: "all",
661
+ label: "All Categories"
662
+ }, ...Array.from(new Set($.map((e) => e.category).filter(Boolean))).map((e) => ({
663
+ value: e,
664
+ label: e
665
+ })).sort((e, t) => e.label.localeCompare(t.label))], [Y, $]), $e = s(() => Y?.licenses && Y.licenses.length > 0 ? [{
666
+ value: "all",
667
+ label: "All Licenses"
668
+ }, ...Y.licenses.map((e) => ({
669
+ value: e.value,
670
+ label: e.value
671
+ }))] : [{
672
+ value: "all",
673
+ label: "All Licenses"
674
+ }], [Y]);
675
+ return /* @__PURE__ */ x("div", {
676
+ className: "flex h-full flex-col",
677
+ children: [
678
+ /* @__PURE__ */ x("header", {
679
+ className: "border-b border-border-default bg-bg-surface px-6 py-4",
680
+ children: [
681
+ /* @__PURE__ */ x("div", {
682
+ className: "flex items-center justify-between",
683
+ children: [/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ x("h1", {
684
+ className: "text-2xl font-bold text-text-primary",
685
+ children: ["App ", f("pages.marketplace.title", { defaultValue: "Marketplace" })]
686
+ }), /* @__PURE__ */ b("p", {
687
+ className: "text-sm text-text-muted",
688
+ children: f("pages.marketplace.subtitle", { defaultValue: "Discover apps, workflows, and integrations for your workspace" })
689
+ })] }), /* @__PURE__ */ x("button", {
690
+ onClick: () => l(`${d}/cart`),
691
+ className: "cursor-pointer relative flex items-center gap-2 rounded-lg border border-border-default bg-bg-surface px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken",
692
+ children: [
693
+ /* @__PURE__ */ b(he, { className: "h-5 w-5" }),
694
+ f("pages.marketplace.cart", { defaultValue: "Cart" }),
695
+ p > 0 && /* @__PURE__ */ b("span", {
696
+ className: "absolute -right-2 -top-2 flex h-5 w-5 items-center justify-center rounded-full bg-action-primary-bg text-xs font-bold text-action-primary-text",
697
+ children: p
698
+ })
699
+ ]
700
+ })]
701
+ }),
702
+ /* @__PURE__ */ x("div", {
703
+ className: "mt-4",
704
+ children: [/* @__PURE__ */ x("div", {
705
+ className: "relative",
706
+ children: [
707
+ /* @__PURE__ */ b("label", {
708
+ htmlFor: oe,
709
+ className: "sr-only",
710
+ children: f("pages.marketplace.search.label", { defaultValue: "Search marketplace products" })
711
+ }),
712
+ /* @__PURE__ */ b(me, { className: "absolute left-4 top-1/2 h-5 w-5 -translate-y-1/2 text-text-muted" }),
713
+ /* @__PURE__ */ b("input", {
714
+ id: oe,
715
+ "aria-label": f("pages.marketplace.search.label", { defaultValue: "Search marketplace products" }),
716
+ type: "text",
717
+ value: T,
718
+ onChange: (e) => E(e.target.value),
719
+ placeholder: f("pages.marketplace.search.placeholder", { defaultValue: "Search apps, workflows, integrations..." }),
720
+ className: "w-full rounded-xl border border-border-default bg-bg-sunken py-3 pl-12 pr-4 text-text-primary placeholder-text-muted focus:border-action-primary-border focus:bg-bg-surface focus:outline-none focus:ring-2 focus:ring-action-primary-border/20"
721
+ }),
722
+ T && /* @__PURE__ */ b("button", {
723
+ type: "button",
724
+ onClick: () => E(""),
725
+ "aria-label": f("pages.marketplace.search.clear", { defaultValue: "Clear search" }),
726
+ className: "cursor-pointer absolute right-4 top-1/2 -translate-y-1/2 text-text-muted transition-colors hover:text-text-primary",
727
+ children: /* @__PURE__ */ b(v, {
728
+ className: "h-4 w-4",
729
+ "aria-hidden": "true"
730
+ })
731
+ })
732
+ ]
733
+ }), T.trim() && /* @__PURE__ */ b("div", {
734
+ "aria-live": "polite",
735
+ className: "mt-2 flex items-center gap-2 text-sm text-text-muted",
736
+ children: Re || X ? /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(pe, { className: "h-4 w-4 animate-spin" }), /* @__PURE__ */ b("span", { children: f("pages.marketplace.search.searching", { defaultValue: "Searching..." }) })] }) : /* @__PURE__ */ x("span", { children: [
737
+ J,
738
+ " result",
739
+ J === 1 ? "" : "s",
740
+ " for “",
741
+ V,
742
+ "”"
743
+ ] })
744
+ })]
745
+ }),
746
+ /* @__PURE__ */ x("div", {
747
+ className: "mt-4 flex flex-wrap items-center gap-3",
748
+ children: [
749
+ /* @__PURE__ */ x("button", {
750
+ onClick: () => je(!Ae),
751
+ className: `cursor-pointer flex items-center gap-2 rounded-lg border px-3 py-2 text-sm font-medium transition-colors ${Ae || U > 0 ? "border-action-primary-border bg-action-primary-bg/10 text-text-link" : "border-border-default bg-bg-surface text-text-primary transition-colors hover:bg-bg-sunken"}`,
752
+ children: [
753
+ /* @__PURE__ */ b(ge, { className: "h-4 w-4" }),
754
+ f("pages.marketplace.filters", { defaultValue: "Filters" }),
755
+ U > 0 && /* @__PURE__ */ b("span", {
756
+ className: "flex h-5 w-5 items-center justify-center rounded-full bg-action-primary-bg text-xs text-action-primary-text",
757
+ children: U
758
+ })
759
+ ]
760
+ }),
761
+ /* @__PURE__ */ x("div", {
762
+ className: "flex flex-wrap items-center gap-2",
763
+ children: [
764
+ /* @__PURE__ */ x("button", {
765
+ onClick: () => M(j === "free" ? "all" : "free"),
766
+ className: `cursor-pointer flex items-center gap-1.5 rounded-full px-3 py-1.5 text-sm font-medium transition-colors ${j === "free" ? "bg-action-primary-bg text-action-primary-text" : "bg-bg-sunken text-text-primary transition-colors hover:bg-bg-surface"}`,
767
+ children: [/* @__PURE__ */ b(fe, { className: "h-3.5 w-3.5" }), "Free"]
768
+ }),
769
+ /* @__PURE__ */ x("button", {
770
+ onClick: () => F(N === "4" ? "any" : "4"),
771
+ className: `cursor-pointer flex items-center gap-1.5 rounded-full px-3 py-1.5 text-sm font-medium transition-colors ${N === "4" ? "bg-action-primary-bg text-action-primary-text" : "bg-bg-sunken text-text-primary transition-colors hover:bg-bg-surface"}`,
772
+ children: [/* @__PURE__ */ b(_, { className: "h-3.5 w-3.5" }), "4+ Stars"]
773
+ }),
774
+ /* @__PURE__ */ x("button", {
775
+ onClick: () => Oe(!z),
776
+ className: `cursor-pointer flex items-center gap-1.5 rounded-full px-3 py-1.5 text-sm font-medium transition-colors ${z ? "bg-action-primary-bg text-action-primary-text" : "bg-bg-sunken text-text-primary transition-colors hover:bg-bg-surface"}`,
777
+ children: [/* @__PURE__ */ b(g, { className: "h-3.5 w-3.5" }), "Featured"]
778
+ })
779
+ ]
780
+ }),
781
+ H && /* @__PURE__ */ x("button", {
782
+ onClick: ze,
783
+ className: "cursor-pointer flex items-center gap-1 text-sm text-text-muted transition-colors hover:text-text-primary",
784
+ children: [/* @__PURE__ */ b(v, { className: "h-4 w-4" }), "Clear all"]
785
+ }),
786
+ /* @__PURE__ */ b("div", {
787
+ className: "ml-auto",
788
+ children: /* @__PURE__ */ b(P, {
789
+ label: "Sort",
790
+ value: B,
791
+ options: Fe,
792
+ onChange: (e) => ke(e)
793
+ })
794
+ })
795
+ ]
796
+ }),
797
+ Ae && /* @__PURE__ */ x("div", {
798
+ className: "mt-4 rounded-lg border border-border-default bg-bg-surface p-4",
799
+ children: [/* @__PURE__ */ x("div", {
800
+ className: "flex flex-wrap items-start gap-6",
801
+ children: [
802
+ /* @__PURE__ */ x("div", {
803
+ className: "flex flex-col gap-2",
804
+ children: [/* @__PURE__ */ b("span", {
805
+ className: "text-xs font-medium uppercase tracking-wider text-text-muted",
806
+ children: "Pricing"
807
+ }), /* @__PURE__ */ b(P, {
808
+ label: "Price",
809
+ value: j,
810
+ options: Me,
811
+ onChange: (e) => M(e)
812
+ })]
813
+ }),
814
+ /* @__PURE__ */ x("div", {
815
+ className: "flex flex-col gap-2",
816
+ children: [/* @__PURE__ */ b("span", {
817
+ className: "text-xs font-medium uppercase tracking-wider text-text-muted",
818
+ children: "Min Rating"
819
+ }), /* @__PURE__ */ b(P, {
820
+ label: "Rating",
821
+ value: N,
822
+ options: Ne,
823
+ onChange: (e) => F(e)
824
+ })]
825
+ }),
826
+ Qe.length > 1 && /* @__PURE__ */ x("div", {
827
+ className: "flex flex-col gap-2",
828
+ children: [/* @__PURE__ */ b("span", {
829
+ className: "text-xs font-medium uppercase tracking-wider text-text-muted",
830
+ children: "Category"
831
+ }), /* @__PURE__ */ b(P, {
832
+ label: "Category",
833
+ value: L,
834
+ options: Qe,
835
+ onChange: Ee
836
+ })]
837
+ }),
838
+ /* @__PURE__ */ x("div", {
839
+ className: "flex flex-col gap-2",
840
+ children: [/* @__PURE__ */ b("span", {
841
+ className: "text-xs font-medium uppercase tracking-wider text-text-muted",
842
+ children: "Nature"
843
+ }), /* @__PURE__ */ b(P, {
844
+ label: "Nature",
845
+ value: I,
846
+ options: Pe,
847
+ onChange: (e) => Te(e)
848
+ })]
849
+ }),
850
+ $e.length > 1 && /* @__PURE__ */ x("div", {
851
+ className: "flex flex-col gap-2",
852
+ children: [/* @__PURE__ */ b("span", {
853
+ className: "text-xs font-medium uppercase tracking-wider text-text-muted",
854
+ children: "License"
855
+ }), /* @__PURE__ */ b(P, {
856
+ label: "License",
857
+ value: R,
858
+ options: $e,
859
+ onChange: De
860
+ })]
861
+ })
862
+ ]
863
+ }), U > 0 && /* @__PURE__ */ x("div", {
864
+ className: "mt-4 flex flex-wrap items-center gap-2 border-t border-border-default pt-4",
865
+ children: [
866
+ /* @__PURE__ */ b("span", {
867
+ className: "text-xs font-medium text-text-muted",
868
+ children: "Active filters:"
869
+ }),
870
+ k !== "all" && /* @__PURE__ */ x("button", {
871
+ onClick: () => A("all"),
872
+ className: "inline-flex cursor-pointer items-center gap-1.5 rounded-full border border-action-primary-border bg-action-primary-bg/5 px-3 py-1.5 text-xs font-medium text-text-link shadow-sm transition-colors hover:bg-action-primary-bg/15",
873
+ children: [
874
+ /* @__PURE__ */ b("span", {
875
+ className: "text-text-muted",
876
+ children: "Type:"
877
+ }),
878
+ " ",
879
+ k,
880
+ /* @__PURE__ */ b(v, { className: "h-3 w-3" })
881
+ ]
882
+ }),
883
+ j !== "all" && /* @__PURE__ */ x("button", {
884
+ onClick: () => M("all"),
885
+ className: "inline-flex cursor-pointer items-center gap-1.5 rounded-full border border-action-primary-border bg-action-primary-bg/5 px-3 py-1.5 text-xs font-medium text-text-link shadow-sm transition-colors hover:bg-action-primary-bg/15",
886
+ children: [
887
+ /* @__PURE__ */ b("span", {
888
+ className: "text-text-muted",
889
+ children: "Price:"
890
+ }),
891
+ " ",
892
+ Me.find((e) => e.value === j)?.label,
893
+ /* @__PURE__ */ b(v, { className: "h-3 w-3" })
894
+ ]
895
+ }),
896
+ N !== "any" && /* @__PURE__ */ x("button", {
897
+ onClick: () => F("any"),
898
+ className: "inline-flex cursor-pointer items-center gap-1.5 rounded-full border border-action-primary-border bg-action-primary-bg/5 px-3 py-1.5 text-xs font-medium text-text-link shadow-sm transition-colors hover:bg-action-primary-bg/15",
899
+ children: [
900
+ /* @__PURE__ */ b("span", {
901
+ className: "text-text-muted",
902
+ children: "Rating:"
903
+ }),
904
+ " ",
905
+ Ne.find((e) => e.value === N)?.label,
906
+ /* @__PURE__ */ b(v, { className: "h-3 w-3" })
907
+ ]
908
+ }),
909
+ L !== "all" && /* @__PURE__ */ x("button", {
910
+ onClick: () => Ee("all"),
911
+ className: "inline-flex cursor-pointer items-center gap-1.5 rounded-full border border-action-primary-border bg-action-primary-bg/5 px-3 py-1.5 text-xs font-medium text-text-link shadow-sm transition-colors hover:bg-action-primary-bg/15",
912
+ children: [
913
+ /* @__PURE__ */ b("span", {
914
+ className: "text-text-muted",
915
+ children: "Category:"
916
+ }),
917
+ " ",
918
+ L,
919
+ /* @__PURE__ */ b(v, { className: "h-3 w-3" })
920
+ ]
921
+ }),
922
+ I !== "all" && /* @__PURE__ */ x("button", {
923
+ onClick: () => Te("all"),
924
+ className: "inline-flex cursor-pointer items-center gap-1.5 rounded-full border border-action-primary-border bg-action-primary-bg/5 px-3 py-1.5 text-xs font-medium text-text-link shadow-sm transition-colors hover:bg-action-primary-bg/15",
925
+ children: [
926
+ /* @__PURE__ */ b("span", {
927
+ className: "text-text-muted",
928
+ children: "Nature:"
929
+ }),
930
+ " ",
931
+ Pe.find((e) => e.value === I)?.label,
932
+ /* @__PURE__ */ b(v, { className: "h-3 w-3" })
933
+ ]
934
+ }),
935
+ R !== "all" && /* @__PURE__ */ x("button", {
936
+ onClick: () => De("all"),
937
+ className: "inline-flex cursor-pointer items-center gap-1.5 rounded-full border border-action-primary-border bg-action-primary-bg/5 px-3 py-1.5 text-xs font-medium text-text-link shadow-sm transition-colors hover:bg-action-primary-bg/15",
938
+ children: [
939
+ /* @__PURE__ */ b("span", {
940
+ className: "text-text-muted",
941
+ children: "License:"
942
+ }),
943
+ " ",
944
+ $e.find((e) => e.value === R)?.label,
945
+ /* @__PURE__ */ b(v, { className: "h-3 w-3" })
946
+ ]
947
+ }),
948
+ z && /* @__PURE__ */ x("button", {
949
+ onClick: () => Oe(!1),
950
+ className: "inline-flex cursor-pointer items-center gap-1.5 rounded-full border border-action-primary-border bg-action-primary-bg/5 px-3 py-1.5 text-xs font-medium text-text-link shadow-sm transition-colors hover:bg-action-primary-bg/15",
951
+ children: [
952
+ /* @__PURE__ */ b(g, { className: "h-3 w-3" }),
953
+ "Featured Only",
954
+ /* @__PURE__ */ b(v, { className: "h-3 w-3" })
955
+ ]
956
+ })
957
+ ]
958
+ })]
959
+ })
960
+ ]
961
+ }),
962
+ /* @__PURE__ */ b("main", {
963
+ className: "flex-1 overflow-y-auto",
964
+ children: /* @__PURE__ */ x("div", {
965
+ className: "mx-auto max-w-7xl space-y-8 px-6 py-6",
966
+ children: [
967
+ Z && /* @__PURE__ */ x("div", {
968
+ role: "alert",
969
+ className: "flex flex-col items-center justify-center rounded-xl border border-status-error-border bg-status-error-bg-subtle p-8 text-center",
970
+ children: [
971
+ /* @__PURE__ */ b(ae, { className: "mb-4 h-12 w-12 text-status-error-text" }),
972
+ /* @__PURE__ */ b("h3", {
973
+ className: "mb-2 text-lg font-semibold text-status-error-text-emphasis",
974
+ children: "Failed to load marketplace"
975
+ }),
976
+ /* @__PURE__ */ b("p", {
977
+ className: "mb-4 text-sm text-status-error-text",
978
+ children: Z.message || "An error occurred while fetching products"
979
+ }),
980
+ /* @__PURE__ */ b("button", {
981
+ onClick: () => Je(),
982
+ className: "cursor-pointer rounded-lg bg-status-error-bg px-4 py-2 text-sm font-medium text-status-error-text transition-colors hover:bg-status-error-bg-emphasis",
983
+ children: "Try Again"
984
+ })
985
+ ]
986
+ }),
987
+ qe && !Z && /* @__PURE__ */ b(we, {}),
988
+ !qe && !Z && /* @__PURE__ */ x(y, { children: [
989
+ !H && k === "all" && W.length > 0 && /* @__PURE__ */ b(Ce, {
990
+ featuredProducts: W,
991
+ onProductClick: Q
992
+ }),
993
+ Ze.length > 1 && /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("h2", {
994
+ className: "mb-4 text-lg font-semibold text-text-primary",
995
+ children: "Browse by Type"
996
+ }), /* @__PURE__ */ b("div", {
997
+ className: "flex flex-wrap gap-2",
998
+ children: Ze.map((e) => /* @__PURE__ */ b(Se, {
999
+ typeId: e.id,
1000
+ name: e.name,
1001
+ count: e.count,
1002
+ active: k === e.id,
1003
+ onClick: () => A(e.id)
1004
+ }, e.id))
1005
+ })] }),
1006
+ H && /* @__PURE__ */ x("section", { children: [/* @__PURE__ */ b(O, {
1007
+ icon: de,
1008
+ title: V ? "Search Results" : "Filtered Results",
1009
+ subtitle: `${J} app${J === 1 ? "" : "s"} found`
1010
+ }), Ye.length > 0 ? /* @__PURE__ */ b("div", {
1011
+ className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
1012
+ children: Ye.map((e) => /* @__PURE__ */ b(D, {
1013
+ product: e,
1014
+ onClick: () => Q(e)
1015
+ }, e.id))
1016
+ }) : /* @__PURE__ */ x("div", {
1017
+ className: "flex flex-col items-center justify-center rounded-xl border border-border-default bg-bg-surface p-8 text-center",
1018
+ children: [
1019
+ /* @__PURE__ */ b(de, { className: "mb-4 h-12 w-12 text-text-muted" }),
1020
+ /* @__PURE__ */ b("h3", {
1021
+ className: "mb-2 text-lg font-semibold text-text-primary",
1022
+ children: "No apps match your filters"
1023
+ }),
1024
+ /* @__PURE__ */ b("p", {
1025
+ className: "mb-4 text-sm text-text-muted",
1026
+ children: "Try adjusting your filter criteria or clearing filters to see more results."
1027
+ }),
1028
+ /* @__PURE__ */ b("button", {
1029
+ onClick: ze,
1030
+ className: "cursor-pointer rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-opacity hover:opacity-90",
1031
+ children: "Clear All Filters"
1032
+ })
1033
+ ]
1034
+ })] }),
1035
+ !H && k === "all" && /* @__PURE__ */ x(y, { children: [
1036
+ G.length > 0 && /* @__PURE__ */ x("section", { children: [/* @__PURE__ */ b(O, {
1037
+ icon: _e,
1038
+ title: "Most Downloaded",
1039
+ subtitle: "Top picks by our community"
1040
+ }), /* @__PURE__ */ b("div", {
1041
+ className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",
1042
+ children: G.slice(0, 6).map((e) => /* @__PURE__ */ b(D, {
1043
+ product: e,
1044
+ onClick: () => Q(e)
1045
+ }, e.id))
1046
+ })] }),
1047
+ K.length > 0 && /* @__PURE__ */ x("section", { children: [/* @__PURE__ */ b(O, {
1048
+ icon: se,
1049
+ title: "New Releases",
1050
+ subtitle: "Recently published apps"
1051
+ }), /* @__PURE__ */ b("div", {
1052
+ className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",
1053
+ children: K.slice(0, 6).map((e) => /* @__PURE__ */ b(D, {
1054
+ product: e,
1055
+ onClick: () => Q(e)
1056
+ }, e.id))
1057
+ })] }),
1058
+ q.length > 0 && /* @__PURE__ */ x("section", { children: [/* @__PURE__ */ b(O, {
1059
+ icon: fe,
1060
+ title: "Free Apps",
1061
+ subtitle: "No cost, full functionality"
1062
+ }), /* @__PURE__ */ b("div", {
1063
+ className: "grid grid-cols-2 gap-2 sm:grid-cols-3 lg:grid-cols-6",
1064
+ children: q.slice(0, 6).map((e) => /* @__PURE__ */ b(D, {
1065
+ product: e,
1066
+ onClick: () => Q(e),
1067
+ variant: "compact"
1068
+ }, e.id))
1069
+ })] }),
1070
+ $.length > 0 && /* @__PURE__ */ x("section", { children: [/* @__PURE__ */ b(O, {
1071
+ icon: u,
1072
+ title: "All Apps",
1073
+ subtitle: `${$.length} apps available`
1074
+ }), /* @__PURE__ */ b("div", {
1075
+ className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
1076
+ children: $.map((e) => /* @__PURE__ */ b(D, {
1077
+ product: e,
1078
+ onClick: () => Q(e)
1079
+ }, e.id))
1080
+ })] })
1081
+ ] }),
1082
+ $.length === 0 && /* @__PURE__ */ x("div", {
1083
+ className: "flex flex-col items-center justify-center rounded-xl border border-border-default bg-bg-surface p-12 text-center",
1084
+ children: [
1085
+ /* @__PURE__ */ b(u, { className: "mb-4 h-16 w-16 text-text-muted" }),
1086
+ /* @__PURE__ */ b("h3", {
1087
+ className: "mb-2 text-xl font-semibold text-text-primary",
1088
+ children: "No apps available yet"
1089
+ }),
1090
+ /* @__PURE__ */ b("p", {
1091
+ className: "max-w-md text-text-muted",
1092
+ children: "The marketplace is empty. Check back soon for new apps, workflows, and integrations."
1093
+ })
1094
+ ]
1095
+ })
1096
+ ] })
1097
+ ]
1098
+ })
1099
+ }),
1100
+ /* @__PURE__ */ b(n, {
1101
+ isOpen: le,
1102
+ onClose: ue,
1103
+ onCheckout: Xe,
1104
+ cartItems: m,
1105
+ itemCount: p,
1106
+ subtotal: h,
1107
+ tax: xe,
1108
+ total: S,
1109
+ updateQuantity: C,
1110
+ removeProduct: w
1111
+ })
1112
+ ]
1113
+ });
1114
+ };
1115
+ //#endregion
1116
+ export { F as MarketplaceHomePage };
1117
+
1118
+ //# sourceMappingURL=MarketplaceHomePage.js.map