@burdenoff/microfe-billing 2026.530.4 → 2026.531.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.
- package/dist/billing/modules/addons/pages/AddonDetailPage.js +85 -84
- package/dist/billing/modules/addons/pages/AddonDetailPage.js.map +1 -1
- package/dist/billing/modules/addons/pages/AddonEditPage.js +176 -195
- package/dist/billing/modules/addons/pages/AddonEditPage.js.map +1 -1
- package/dist/billing/modules/addons/pages/AddonsBrowsePage.js +408 -206
- package/dist/billing/modules/addons/pages/AddonsBrowsePage.js.map +1 -1
- package/dist/billing/modules/addons/pages/AddonsListPage.js +216 -215
- package/dist/billing/modules/addons/pages/AddonsListPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/InvoicesListPage.js +7 -1
- package/dist/billing/modules/billing/pages/InvoicesListPage.js.map +1 -1
- package/dist/billing/modules/billing/pages/TransactionsPage.js +1 -1
- package/dist/billing/modules/billing/pages/TransactionsPage.js.map +1 -1
- package/dist/billing/modules/checkout/components/CompleteBillingAccountModal.js +261 -0
- package/dist/billing/modules/checkout/components/CompleteBillingAccountModal.js.map +1 -0
- package/dist/billing/modules/checkout/components/index.js +1 -0
- package/dist/billing/modules/checkout/hooks/useCheckout.js +2 -0
- package/dist/billing/modules/checkout/hooks/useCheckout.js.map +1 -1
- package/dist/billing/modules/checkout/index.js +1 -0
- package/dist/billing/modules/checkout/pages/CheckoutPage.js +354 -340
- package/dist/billing/modules/checkout/pages/CheckoutPage.js.map +1 -1
- package/dist/billing/modules/dashboard/components/RecommendedAddonsSection.js +79 -78
- package/dist/billing/modules/dashboard/components/RecommendedAddonsSection.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlanEditPage.js +29 -20
- package/dist/billing/modules/plans/pages/PlanEditPage.js.map +1 -1
- package/dist/generated/global-operations.js +8 -0
- package/dist/generated/global-operations.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
import { formatCurrency as e, formatPlanDuration as t, formatPlanDurationLabel as n } from "../../../shared/utils/format.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { getPlanFeatureQuantity as r } from "../../../shared/utils/planFeatureQuantity.js";
|
|
3
|
+
import { useBillingPermissions as i } from "../../../hooks/useBillingPermissions.js";
|
|
4
|
+
import { useAddonCartStore as a } from "../store/addonCartStore.js";
|
|
5
|
+
import { useBillingNavigate as o } from "../../../hooks/useBillingNavigate.js";
|
|
6
|
+
import { useAddonMutations as s, useAddons as c } from "../hooks/useAddons.js";
|
|
6
7
|
import "../hooks/index.js";
|
|
7
|
-
import { useDefaultBillingCurrency as
|
|
8
|
-
import { useMemo as
|
|
9
|
-
import { Minus as
|
|
10
|
-
import { Fragment as
|
|
11
|
-
import { useI18n as
|
|
8
|
+
import { useDefaultBillingCurrency as l } from "../../../hooks/useDefaultBillingCurrency.js";
|
|
9
|
+
import { useMemo as u, useState as d } from "react";
|
|
10
|
+
import { Minus as f, Plus as p, ShoppingCart as m, Trash2 as h, X as g } from "lucide-react";
|
|
11
|
+
import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
12
|
+
import { useI18n as b } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
12
13
|
//#region src/billing/modules/addons/pages/AddonsListPage.tsx
|
|
13
|
-
function
|
|
14
|
+
function x(e) {
|
|
14
15
|
let t = /* @__PURE__ */ new Map();
|
|
15
16
|
for (let n of e) {
|
|
16
17
|
if (!n.quota) continue;
|
|
17
|
-
let e = n.quota.id,
|
|
18
|
-
|
|
18
|
+
let e = n.quota.id, i = r(n), a = t.get(e);
|
|
19
|
+
a ? a.totalValue += i : t.set(e, {
|
|
19
20
|
quotaId: e,
|
|
20
21
|
name: n.quota.name ?? "Unknown Quota",
|
|
21
|
-
totalValue:
|
|
22
|
+
totalValue: i
|
|
22
23
|
});
|
|
23
24
|
}
|
|
24
25
|
return Array.from(t.values());
|
|
25
26
|
}
|
|
26
|
-
function
|
|
27
|
+
function S(e, t = "USD") {
|
|
27
28
|
if (e.currencyPrices && typeof e.currencyPrices == "object") {
|
|
28
29
|
let n = e.currencyPrices;
|
|
29
30
|
if (n[t]) return {
|
|
@@ -36,24 +37,24 @@ function x(e, t = "USD") {
|
|
|
36
37
|
currency: e.currency || "USD"
|
|
37
38
|
};
|
|
38
39
|
}
|
|
39
|
-
var
|
|
40
|
-
let { t: e } =
|
|
40
|
+
var C = () => {
|
|
41
|
+
let { t: e } = b(), t = (t, n) => {
|
|
41
42
|
let r = e(t);
|
|
42
43
|
return r === t ? n : r;
|
|
43
|
-
}, n =
|
|
44
|
-
if (!
|
|
44
|
+
}, n = o(), r = i(), { addons: u, isLoading: f, error: p, refetch: m } = c(), { toggleAddon: h, isToggling: g } = s(), { addToCart: _, removeFromCart: x, updateQuantity: S, isInCart: C, getCartItem: D } = a(), [O, k] = d("grid"), [A, j] = d(!1), [M, N] = d("all"), P = l();
|
|
45
|
+
if (!r.canViewAddons) return /* @__PURE__ */ v("div", {
|
|
45
46
|
className: "flex items-center justify-center h-full min-h-[400px]",
|
|
46
|
-
children: /* @__PURE__ */
|
|
47
|
+
children: /* @__PURE__ */ y("div", {
|
|
47
48
|
className: "text-center space-y-2",
|
|
48
49
|
children: [
|
|
49
|
-
/* @__PURE__ */
|
|
50
|
+
/* @__PURE__ */ v("div", {
|
|
50
51
|
className: "size-12 mx-auto rounded-full bg-muted flex items-center justify-center",
|
|
51
|
-
children: /* @__PURE__ */
|
|
52
|
+
children: /* @__PURE__ */ v("svg", {
|
|
52
53
|
className: "size-6 text-muted-foreground",
|
|
53
54
|
fill: "none",
|
|
54
55
|
viewBox: "0 0 24 24",
|
|
55
56
|
stroke: "currentColor",
|
|
56
|
-
children: /* @__PURE__ */
|
|
57
|
+
children: /* @__PURE__ */ v("path", {
|
|
57
58
|
strokeLinecap: "round",
|
|
58
59
|
strokeLinejoin: "round",
|
|
59
60
|
strokeWidth: 2,
|
|
@@ -61,19 +62,19 @@ var S = () => {
|
|
|
61
62
|
})
|
|
62
63
|
})
|
|
63
64
|
}),
|
|
64
|
-
/* @__PURE__ */
|
|
65
|
+
/* @__PURE__ */ v("h2", {
|
|
65
66
|
className: "text-lg font-semibold text-foreground",
|
|
66
67
|
children: t("billing.accessDenied.title", "Access Denied")
|
|
67
68
|
}),
|
|
68
|
-
/* @__PURE__ */
|
|
69
|
+
/* @__PURE__ */ v("p", {
|
|
69
70
|
className: "text-sm text-muted-foreground max-w-sm",
|
|
70
71
|
children: t("billing.addons.noViewPermission", "You don't have permission to view addons.")
|
|
71
72
|
})
|
|
72
73
|
]
|
|
73
74
|
})
|
|
74
75
|
});
|
|
75
|
-
let F =
|
|
76
|
-
if (
|
|
76
|
+
let F = u.filter((e) => !(!A && !e.isActive || M !== "all" && e.duration !== M)), I = async (e) => {
|
|
77
|
+
if (r.canManageAddons) try {
|
|
77
78
|
await h(e.id, !e.isActive), await m();
|
|
78
79
|
} catch (e) {
|
|
79
80
|
console.error("Failed to toggle addon:", e);
|
|
@@ -83,43 +84,43 @@ var S = () => {
|
|
|
83
84
|
}, R = (e) => {
|
|
84
85
|
n(`/addons/${e.id}/edit`);
|
|
85
86
|
};
|
|
86
|
-
return f &&
|
|
87
|
+
return f && u.length === 0 ? /* @__PURE__ */ y("div", {
|
|
87
88
|
className: "space-y-6 p-6",
|
|
88
|
-
children: [/* @__PURE__ */
|
|
89
|
+
children: [/* @__PURE__ */ v("div", { className: "h-8 w-48 bg-muted animate-pulse rounded" }), /* @__PURE__ */ v("div", {
|
|
89
90
|
className: "grid grid-cols-1 md:grid-cols-3 gap-6",
|
|
90
91
|
children: [
|
|
91
92
|
1,
|
|
92
93
|
2,
|
|
93
94
|
3
|
|
94
|
-
].map((e) => /* @__PURE__ */
|
|
95
|
+
].map((e) => /* @__PURE__ */ y("div", {
|
|
95
96
|
className: "border border-border rounded-lg p-6 space-y-4",
|
|
96
97
|
children: [
|
|
97
|
-
/* @__PURE__ */
|
|
98
|
-
/* @__PURE__ */
|
|
99
|
-
/* @__PURE__ */
|
|
98
|
+
/* @__PURE__ */ v("div", { className: "h-6 w-24 bg-muted animate-pulse rounded" }),
|
|
99
|
+
/* @__PURE__ */ v("div", { className: "h-8 w-32 bg-muted animate-pulse rounded" }),
|
|
100
|
+
/* @__PURE__ */ v("div", {
|
|
100
101
|
className: "space-y-2",
|
|
101
102
|
children: [
|
|
102
103
|
1,
|
|
103
104
|
2,
|
|
104
105
|
3
|
|
105
|
-
].map((e) => /* @__PURE__ */
|
|
106
|
+
].map((e) => /* @__PURE__ */ v("div", { className: "h-4 w-full bg-muted animate-pulse rounded" }, e))
|
|
106
107
|
})
|
|
107
108
|
]
|
|
108
109
|
}, e))
|
|
109
110
|
})]
|
|
110
|
-
}) : p ? /* @__PURE__ */
|
|
111
|
+
}) : p ? /* @__PURE__ */ v("div", {
|
|
111
112
|
className: "flex items-center justify-center h-full min-h-[400px]",
|
|
112
|
-
children: /* @__PURE__ */
|
|
113
|
+
children: /* @__PURE__ */ y("div", {
|
|
113
114
|
className: "text-center space-y-4",
|
|
114
115
|
children: [
|
|
115
|
-
/* @__PURE__ */
|
|
116
|
+
/* @__PURE__ */ v("div", {
|
|
116
117
|
className: "size-12 mx-auto rounded-full bg-destructive/10 flex items-center justify-center",
|
|
117
|
-
children: /* @__PURE__ */
|
|
118
|
+
children: /* @__PURE__ */ v("svg", {
|
|
118
119
|
className: "size-6 text-destructive",
|
|
119
120
|
fill: "none",
|
|
120
121
|
viewBox: "0 0 24 24",
|
|
121
122
|
stroke: "currentColor",
|
|
122
|
-
children: /* @__PURE__ */
|
|
123
|
+
children: /* @__PURE__ */ v("path", {
|
|
123
124
|
strokeLinecap: "round",
|
|
124
125
|
strokeLinejoin: "round",
|
|
125
126
|
strokeWidth: 2,
|
|
@@ -127,15 +128,15 @@ var S = () => {
|
|
|
127
128
|
})
|
|
128
129
|
})
|
|
129
130
|
}),
|
|
130
|
-
/* @__PURE__ */
|
|
131
|
+
/* @__PURE__ */ v("h2", {
|
|
131
132
|
className: "text-lg font-semibold text-foreground",
|
|
132
133
|
children: t("billing.addons.failedToLoad", "Failed to load addons")
|
|
133
134
|
}),
|
|
134
|
-
/* @__PURE__ */
|
|
135
|
+
/* @__PURE__ */ v("p", {
|
|
135
136
|
className: "text-sm text-muted-foreground",
|
|
136
137
|
children: p.message
|
|
137
138
|
}),
|
|
138
|
-
/* @__PURE__ */
|
|
139
|
+
/* @__PURE__ */ v("button", {
|
|
139
140
|
type: "button",
|
|
140
141
|
onClick: () => m(),
|
|
141
142
|
className: "px-4 py-2 text-sm font-medium bg-primary text-primary-foreground rounded-md hover:bg-primary/90 transition-colors",
|
|
@@ -143,27 +144,27 @@ var S = () => {
|
|
|
143
144
|
})
|
|
144
145
|
]
|
|
145
146
|
})
|
|
146
|
-
}) : /* @__PURE__ */
|
|
147
|
+
}) : /* @__PURE__ */ y("div", {
|
|
147
148
|
className: "space-y-6 p-6",
|
|
148
149
|
children: [
|
|
149
|
-
/* @__PURE__ */
|
|
150
|
+
/* @__PURE__ */ y("div", {
|
|
150
151
|
className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",
|
|
151
|
-
children: [/* @__PURE__ */
|
|
152
|
+
children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("h1", {
|
|
152
153
|
className: "text-2xl font-bold text-foreground",
|
|
153
154
|
children: t("billing.addons.title", "Addons")
|
|
154
|
-
}), /* @__PURE__ */
|
|
155
|
+
}), /* @__PURE__ */ v("p", {
|
|
155
156
|
className: "text-sm text-muted-foreground mt-1",
|
|
156
157
|
children: t("billing.addons.subtitle", "Enhance your subscription with additional features")
|
|
157
|
-
})] }),
|
|
158
|
+
})] }), r.canManageAddons && /* @__PURE__ */ y("button", {
|
|
158
159
|
type: "button",
|
|
159
160
|
onClick: () => n("/addons/new"),
|
|
160
161
|
className: "inline-flex items-center gap-2 px-4 py-2 text-sm font-medium bg-primary text-primary-foreground rounded-md hover:bg-primary/90 transition-colors",
|
|
161
|
-
children: [/* @__PURE__ */
|
|
162
|
+
children: [/* @__PURE__ */ v("svg", {
|
|
162
163
|
className: "size-4",
|
|
163
164
|
fill: "none",
|
|
164
165
|
viewBox: "0 0 24 24",
|
|
165
166
|
stroke: "currentColor",
|
|
166
|
-
children: /* @__PURE__ */
|
|
167
|
+
children: /* @__PURE__ */ v("path", {
|
|
167
168
|
strokeLinecap: "round",
|
|
168
169
|
strokeLinejoin: "round",
|
|
169
170
|
strokeWidth: 2,
|
|
@@ -172,25 +173,25 @@ var S = () => {
|
|
|
172
173
|
}), "Create Addon"]
|
|
173
174
|
})]
|
|
174
175
|
}),
|
|
175
|
-
/* @__PURE__ */
|
|
176
|
+
/* @__PURE__ */ y("div", {
|
|
176
177
|
className: "flex flex-wrap items-center gap-4 pb-4 border-b border-border",
|
|
177
178
|
children: [
|
|
178
|
-
/* @__PURE__ */
|
|
179
|
+
/* @__PURE__ */ y("div", {
|
|
179
180
|
className: "inline-flex rounded-lg border border-border p-1 bg-muted/50",
|
|
180
181
|
children: [
|
|
181
|
-
/* @__PURE__ */
|
|
182
|
+
/* @__PURE__ */ v("button", {
|
|
182
183
|
type: "button",
|
|
183
184
|
onClick: () => N("all"),
|
|
184
185
|
className: `px-3 py-1.5 text-sm font-medium rounded-md transition-colors ${M === "all" ? "bg-background text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"}`,
|
|
185
186
|
children: "All"
|
|
186
187
|
}),
|
|
187
|
-
/* @__PURE__ */
|
|
188
|
+
/* @__PURE__ */ v("button", {
|
|
188
189
|
type: "button",
|
|
189
190
|
onClick: () => N("monthly"),
|
|
190
191
|
className: `px-3 py-1.5 text-sm font-medium rounded-md transition-colors ${M === "monthly" ? "bg-background text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"}`,
|
|
191
192
|
children: "Monthly"
|
|
192
193
|
}),
|
|
193
|
-
/* @__PURE__ */
|
|
194
|
+
/* @__PURE__ */ v("button", {
|
|
194
195
|
type: "button",
|
|
195
196
|
onClick: () => N("yearly"),
|
|
196
197
|
className: `px-3 py-1.5 text-sm font-medium rounded-md transition-colors ${M === "yearly" ? "bg-background text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"}`,
|
|
@@ -198,48 +199,48 @@ var S = () => {
|
|
|
198
199
|
})
|
|
199
200
|
]
|
|
200
201
|
}),
|
|
201
|
-
|
|
202
|
+
r.canManageAddons && /* @__PURE__ */ y("label", {
|
|
202
203
|
className: "flex items-center gap-2 text-sm cursor-pointer",
|
|
203
|
-
children: [/* @__PURE__ */
|
|
204
|
+
children: [/* @__PURE__ */ v("input", {
|
|
204
205
|
type: "checkbox",
|
|
205
206
|
checked: A,
|
|
206
207
|
onChange: (e) => j(e.target.checked),
|
|
207
208
|
className: "size-4 rounded border-border text-primary focus:ring-primary"
|
|
208
|
-
}), /* @__PURE__ */
|
|
209
|
+
}), /* @__PURE__ */ v("span", {
|
|
209
210
|
className: "text-muted-foreground",
|
|
210
211
|
children: t("billing.addons.showInactive", "Show inactive addons")
|
|
211
212
|
})]
|
|
212
213
|
}),
|
|
213
|
-
/* @__PURE__ */
|
|
214
|
+
/* @__PURE__ */ y("div", {
|
|
214
215
|
className: "ml-auto inline-flex rounded-lg border border-border p-1 bg-muted/50",
|
|
215
|
-
children: [/* @__PURE__ */
|
|
216
|
+
children: [/* @__PURE__ */ v("button", {
|
|
216
217
|
type: "button",
|
|
217
218
|
onClick: () => k("grid"),
|
|
218
219
|
className: `p-1.5 rounded-md transition-colors ${O === "grid" ? "bg-background text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"}`,
|
|
219
220
|
title: "Grid view",
|
|
220
|
-
children: /* @__PURE__ */
|
|
221
|
+
children: /* @__PURE__ */ v("svg", {
|
|
221
222
|
className: "size-4",
|
|
222
223
|
fill: "none",
|
|
223
224
|
viewBox: "0 0 24 24",
|
|
224
225
|
stroke: "currentColor",
|
|
225
|
-
children: /* @__PURE__ */
|
|
226
|
+
children: /* @__PURE__ */ v("path", {
|
|
226
227
|
strokeLinecap: "round",
|
|
227
228
|
strokeLinejoin: "round",
|
|
228
229
|
strokeWidth: 2,
|
|
229
230
|
d: "M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zM14 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zM14 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z"
|
|
230
231
|
})
|
|
231
232
|
})
|
|
232
|
-
}), /* @__PURE__ */
|
|
233
|
+
}), /* @__PURE__ */ v("button", {
|
|
233
234
|
type: "button",
|
|
234
235
|
onClick: () => k("list"),
|
|
235
236
|
className: `p-1.5 rounded-md transition-colors ${O === "list" ? "bg-background text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"}`,
|
|
236
237
|
title: "List view",
|
|
237
|
-
children: /* @__PURE__ */
|
|
238
|
+
children: /* @__PURE__ */ v("svg", {
|
|
238
239
|
className: "size-4",
|
|
239
240
|
fill: "none",
|
|
240
241
|
viewBox: "0 0 24 24",
|
|
241
242
|
stroke: "currentColor",
|
|
242
|
-
children: /* @__PURE__ */
|
|
243
|
+
children: /* @__PURE__ */ v("path", {
|
|
243
244
|
strokeLinecap: "round",
|
|
244
245
|
strokeLinejoin: "round",
|
|
245
246
|
strokeWidth: 2,
|
|
@@ -250,17 +251,17 @@ var S = () => {
|
|
|
250
251
|
})
|
|
251
252
|
]
|
|
252
253
|
}),
|
|
253
|
-
F.length === 0 ? /* @__PURE__ */
|
|
254
|
+
F.length === 0 ? /* @__PURE__ */ y("div", {
|
|
254
255
|
className: "flex flex-col items-center justify-center py-12 border border-dashed border-border rounded-lg",
|
|
255
256
|
children: [
|
|
256
|
-
/* @__PURE__ */
|
|
257
|
+
/* @__PURE__ */ v("div", {
|
|
257
258
|
className: "size-12 rounded-full bg-muted flex items-center justify-center mb-4",
|
|
258
|
-
children: /* @__PURE__ */
|
|
259
|
+
children: /* @__PURE__ */ v("svg", {
|
|
259
260
|
className: "size-6 text-muted-foreground",
|
|
260
261
|
fill: "none",
|
|
261
262
|
viewBox: "0 0 24 24",
|
|
262
263
|
stroke: "currentColor",
|
|
263
|
-
children: /* @__PURE__ */
|
|
264
|
+
children: /* @__PURE__ */ v("path", {
|
|
264
265
|
strokeLinecap: "round",
|
|
265
266
|
strokeLinejoin: "round",
|
|
266
267
|
strokeWidth: 2,
|
|
@@ -268,73 +269,73 @@ var S = () => {
|
|
|
268
269
|
})
|
|
269
270
|
})
|
|
270
271
|
}),
|
|
271
|
-
/* @__PURE__ */
|
|
272
|
+
/* @__PURE__ */ v("h3", {
|
|
272
273
|
className: "text-lg font-medium text-foreground",
|
|
273
274
|
children: t("billing.addons.noAddonsFound", "No addons found")
|
|
274
275
|
}),
|
|
275
|
-
/* @__PURE__ */
|
|
276
|
+
/* @__PURE__ */ v("p", {
|
|
276
277
|
className: "text-sm text-muted-foreground mt-1",
|
|
277
278
|
children: A ? t("billing.addons.noAddonsFiltered", "No addons match your current filters.") : t("billing.addons.noActiveAddons", "There are no active addons available.")
|
|
278
279
|
}),
|
|
279
|
-
|
|
280
|
+
r.canManageAddons && /* @__PURE__ */ v("button", {
|
|
280
281
|
type: "button",
|
|
281
282
|
onClick: () => n("/addons/new"),
|
|
282
283
|
className: "mt-4 px-4 py-2 text-sm font-medium bg-primary text-primary-foreground rounded-md hover:bg-primary/90 transition-colors",
|
|
283
284
|
children: t("billing.addons.createFirstAddon", "Create your first addon")
|
|
284
285
|
})
|
|
285
286
|
]
|
|
286
|
-
}) : O === "grid" ? /* @__PURE__ */
|
|
287
|
+
}) : O === "grid" ? /* @__PURE__ */ v("div", {
|
|
287
288
|
className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",
|
|
288
289
|
children: F.map((e) => {
|
|
289
290
|
let t = D(e.id);
|
|
290
|
-
return /* @__PURE__ */
|
|
291
|
+
return /* @__PURE__ */ v(w, {
|
|
291
292
|
addon: e,
|
|
292
293
|
onView: L,
|
|
293
294
|
onEdit: R,
|
|
294
295
|
onToggle: I,
|
|
295
|
-
canManage:
|
|
296
|
+
canManage: r.canManageAddons,
|
|
296
297
|
isToggling: g,
|
|
297
|
-
isInCart:
|
|
298
|
+
isInCart: C(e.id),
|
|
298
299
|
cartQuantity: t?.quantity || 0,
|
|
299
|
-
onAddToCart:
|
|
300
|
+
onAddToCart: _,
|
|
300
301
|
onUpdateQuantity: S,
|
|
301
302
|
onRemoveFromCart: x,
|
|
302
303
|
displayCurrency: P
|
|
303
304
|
}, e.id);
|
|
304
305
|
})
|
|
305
|
-
}) : /* @__PURE__ */
|
|
306
|
+
}) : /* @__PURE__ */ v("div", {
|
|
306
307
|
className: "space-y-3",
|
|
307
308
|
children: F.map((e) => {
|
|
308
309
|
let t = D(e.id);
|
|
309
|
-
return /* @__PURE__ */
|
|
310
|
+
return /* @__PURE__ */ v(T, {
|
|
310
311
|
addon: e,
|
|
311
312
|
onView: L,
|
|
312
313
|
onEdit: R,
|
|
313
314
|
onToggle: I,
|
|
314
|
-
canManage:
|
|
315
|
+
canManage: r.canManageAddons,
|
|
315
316
|
isToggling: g,
|
|
316
|
-
isInCart:
|
|
317
|
+
isInCart: C(e.id),
|
|
317
318
|
cartQuantity: t?.quantity || 0,
|
|
318
|
-
onAddToCart:
|
|
319
|
+
onAddToCart: _,
|
|
319
320
|
onUpdateQuantity: S,
|
|
320
321
|
onRemoveFromCart: x,
|
|
321
322
|
displayCurrency: P
|
|
322
323
|
}, e.id);
|
|
323
324
|
})
|
|
324
325
|
}),
|
|
325
|
-
/* @__PURE__ */
|
|
326
|
+
/* @__PURE__ */ v(E, { displayCurrency: P })
|
|
326
327
|
]
|
|
327
328
|
});
|
|
328
|
-
},
|
|
329
|
-
let w =
|
|
330
|
-
return /* @__PURE__ */
|
|
331
|
-
className: `relative border rounded-lg p-6 transition-all hover:shadow-md flex flex-col h-full ${r.isActive ?
|
|
329
|
+
}, w = ({ addon: r, onView: i, onEdit: a, onToggle: o, canManage: s, displayCurrency: c, isToggling: l, isInCart: d, cartQuantity: g, onAddToCart: _, onUpdateQuantity: b, onRemoveFromCart: C }) => {
|
|
330
|
+
let w = u(() => x(r.features || []), [r.features]);
|
|
331
|
+
return /* @__PURE__ */ y("div", {
|
|
332
|
+
className: `relative border rounded-lg p-6 transition-all hover:shadow-md flex flex-col h-full ${r.isActive ? d ? "border-primary bg-primary/5" : "border-border bg-card" : "border-dashed border-muted-foreground/30 bg-muted/30"}`,
|
|
332
333
|
children: [
|
|
333
|
-
!r.isActive && /* @__PURE__ */
|
|
334
|
+
!r.isActive && /* @__PURE__ */ v("span", {
|
|
334
335
|
className: "absolute top-4 right-4 px-2 py-1 text-xs font-medium bg-muted text-muted-foreground rounded",
|
|
335
336
|
children: "Inactive"
|
|
336
337
|
}),
|
|
337
|
-
|
|
338
|
+
d && r.isActive && /* @__PURE__ */ y("span", {
|
|
338
339
|
className: "absolute top-4 right-4 px-2 py-1 text-xs font-medium bg-primary text-primary-foreground rounded",
|
|
339
340
|
children: [
|
|
340
341
|
"In Cart (",
|
|
@@ -342,14 +343,14 @@ var S = () => {
|
|
|
342
343
|
")"
|
|
343
344
|
]
|
|
344
345
|
}),
|
|
345
|
-
/* @__PURE__ */
|
|
346
|
+
/* @__PURE__ */ v("div", {
|
|
346
347
|
className: "size-10 rounded-lg bg-primary/10 flex items-center justify-center mb-4",
|
|
347
|
-
children: /* @__PURE__ */
|
|
348
|
+
children: /* @__PURE__ */ v("svg", {
|
|
348
349
|
className: "size-5 text-primary",
|
|
349
350
|
fill: "none",
|
|
350
351
|
viewBox: "0 0 24 24",
|
|
351
352
|
stroke: "currentColor",
|
|
352
|
-
children: /* @__PURE__ */
|
|
353
|
+
children: /* @__PURE__ */ v("path", {
|
|
353
354
|
strokeLinecap: "round",
|
|
354
355
|
strokeLinejoin: "round",
|
|
355
356
|
strokeWidth: 2,
|
|
@@ -357,55 +358,55 @@ var S = () => {
|
|
|
357
358
|
})
|
|
358
359
|
})
|
|
359
360
|
}),
|
|
360
|
-
/* @__PURE__ */
|
|
361
|
+
/* @__PURE__ */ y("div", {
|
|
361
362
|
className: "mb-4",
|
|
362
|
-
children: [/* @__PURE__ */
|
|
363
|
+
children: [/* @__PURE__ */ v("h3", {
|
|
363
364
|
className: "text-lg font-bold text-foreground",
|
|
364
365
|
children: r.name
|
|
365
|
-
}), /* @__PURE__ */
|
|
366
|
+
}), /* @__PURE__ */ v("span", {
|
|
366
367
|
className: "text-sm text-muted-foreground",
|
|
367
368
|
children: n(r.duration)
|
|
368
369
|
})]
|
|
369
370
|
}),
|
|
370
|
-
/* @__PURE__ */
|
|
371
|
+
/* @__PURE__ */ y("div", {
|
|
371
372
|
className: "flex items-baseline gap-1 mb-4",
|
|
372
|
-
children: [/* @__PURE__ */
|
|
373
|
+
children: [/* @__PURE__ */ v("span", {
|
|
373
374
|
className: "text-2xl font-bold text-foreground",
|
|
374
375
|
children: (() => {
|
|
375
|
-
let { price: t, currency: n } =
|
|
376
|
+
let { price: t, currency: n } = S(r, c);
|
|
376
377
|
return e(t, n);
|
|
377
378
|
})()
|
|
378
|
-
}), /* @__PURE__ */
|
|
379
|
+
}), /* @__PURE__ */ y("span", {
|
|
379
380
|
className: "text-muted-foreground text-sm",
|
|
380
381
|
children: ["/ ", t(r.duration)]
|
|
381
382
|
})]
|
|
382
383
|
}),
|
|
383
|
-
w.length > 0 && /* @__PURE__ */
|
|
384
|
+
w.length > 0 && /* @__PURE__ */ y("ul", {
|
|
384
385
|
className: "space-y-2 mb-4",
|
|
385
|
-
children: [w.slice(0, 4).map((e) => /* @__PURE__ */
|
|
386
|
+
children: [w.slice(0, 4).map((e) => /* @__PURE__ */ y("li", {
|
|
386
387
|
className: "flex items-center justify-between text-sm",
|
|
387
|
-
children: [/* @__PURE__ */
|
|
388
|
+
children: [/* @__PURE__ */ y("div", {
|
|
388
389
|
className: "flex items-center gap-2",
|
|
389
|
-
children: [/* @__PURE__ */
|
|
390
|
+
children: [/* @__PURE__ */ v("svg", {
|
|
390
391
|
className: "size-4 text-status-success-text shrink-0",
|
|
391
392
|
fill: "none",
|
|
392
393
|
viewBox: "0 0 24 24",
|
|
393
394
|
stroke: "currentColor",
|
|
394
|
-
children: /* @__PURE__ */
|
|
395
|
+
children: /* @__PURE__ */ v("path", {
|
|
395
396
|
strokeLinecap: "round",
|
|
396
397
|
strokeLinejoin: "round",
|
|
397
398
|
strokeWidth: 2,
|
|
398
399
|
d: "M5 13l4 4L19 7"
|
|
399
400
|
})
|
|
400
|
-
}), /* @__PURE__ */
|
|
401
|
+
}), /* @__PURE__ */ v("span", {
|
|
401
402
|
className: "text-foreground",
|
|
402
403
|
children: e.name
|
|
403
404
|
})]
|
|
404
|
-
}), /* @__PURE__ */
|
|
405
|
+
}), /* @__PURE__ */ v("span", {
|
|
405
406
|
className: "font-medium text-foreground",
|
|
406
407
|
children: e.totalValue.toLocaleString()
|
|
407
408
|
})]
|
|
408
|
-
}, e.quotaId)), w.length > 4 && /* @__PURE__ */
|
|
409
|
+
}, e.quotaId)), w.length > 4 && /* @__PURE__ */ y("li", {
|
|
409
410
|
className: "text-sm text-muted-foreground pl-6",
|
|
410
411
|
children: [
|
|
411
412
|
"+",
|
|
@@ -414,61 +415,61 @@ var S = () => {
|
|
|
414
415
|
]
|
|
415
416
|
})]
|
|
416
417
|
}),
|
|
417
|
-
/* @__PURE__ */
|
|
418
|
+
/* @__PURE__ */ y("div", {
|
|
418
419
|
className: "space-y-2 pt-4 border-t border-border mt-auto",
|
|
419
420
|
children: [
|
|
420
|
-
r.isActive && (
|
|
421
|
+
r.isActive && (d ? /* @__PURE__ */ y("div", {
|
|
421
422
|
className: "flex items-center justify-between gap-2",
|
|
422
|
-
children: [/* @__PURE__ */
|
|
423
|
+
children: [/* @__PURE__ */ y("div", {
|
|
423
424
|
className: "flex items-center gap-1",
|
|
424
425
|
children: [
|
|
425
|
-
/* @__PURE__ */
|
|
426
|
+
/* @__PURE__ */ v("button", {
|
|
426
427
|
type: "button",
|
|
427
|
-
onClick: () =>
|
|
428
|
+
onClick: () => b(r.id, g - 1),
|
|
428
429
|
className: "p-1.5 rounded border border-border hover:bg-muted transition-colors",
|
|
429
|
-
children: /* @__PURE__ */
|
|
430
|
+
children: /* @__PURE__ */ v(f, { className: "size-4" })
|
|
430
431
|
}),
|
|
431
|
-
/* @__PURE__ */
|
|
432
|
+
/* @__PURE__ */ v("span", {
|
|
432
433
|
className: "w-10 text-center font-medium",
|
|
433
434
|
children: g
|
|
434
435
|
}),
|
|
435
|
-
/* @__PURE__ */
|
|
436
|
+
/* @__PURE__ */ v("button", {
|
|
436
437
|
type: "button",
|
|
437
|
-
onClick: () =>
|
|
438
|
+
onClick: () => b(r.id, g + 1),
|
|
438
439
|
className: "p-1.5 rounded border border-border hover:bg-muted transition-colors",
|
|
439
|
-
children: /* @__PURE__ */
|
|
440
|
+
children: /* @__PURE__ */ v(p, { className: "size-4" })
|
|
440
441
|
})
|
|
441
442
|
]
|
|
442
|
-
}), /* @__PURE__ */
|
|
443
|
+
}), /* @__PURE__ */ v("button", {
|
|
443
444
|
type: "button",
|
|
444
445
|
onClick: () => C(r.id),
|
|
445
446
|
className: "p-1.5 rounded text-destructive hover:bg-destructive/10 transition-colors",
|
|
446
447
|
title: "Remove from cart",
|
|
447
|
-
children: /* @__PURE__ */
|
|
448
|
+
children: /* @__PURE__ */ v(h, { className: "size-4" })
|
|
448
449
|
})]
|
|
449
|
-
}) : /* @__PURE__ */
|
|
450
|
+
}) : /* @__PURE__ */ y("button", {
|
|
450
451
|
type: "button",
|
|
451
|
-
onClick: () =>
|
|
452
|
+
onClick: () => _(r),
|
|
452
453
|
className: "w-full px-4 py-2 text-sm font-medium bg-primary text-primary-foreground rounded-md hover:bg-primary/90 transition-colors flex items-center justify-center gap-2",
|
|
453
|
-
children: [/* @__PURE__ */
|
|
454
|
+
children: [/* @__PURE__ */ v(m, { className: "size-4" }), "Add to Cart"]
|
|
454
455
|
})),
|
|
455
|
-
/* @__PURE__ */
|
|
456
|
+
/* @__PURE__ */ v("button", {
|
|
456
457
|
type: "button",
|
|
457
458
|
onClick: () => i(r),
|
|
458
459
|
className: "w-full px-4 py-2 text-sm font-medium border border-border text-foreground rounded-md hover:bg-muted transition-colors",
|
|
459
460
|
children: "View Details"
|
|
460
461
|
}),
|
|
461
|
-
s && /* @__PURE__ */
|
|
462
|
+
s && /* @__PURE__ */ y("div", {
|
|
462
463
|
className: "flex gap-2",
|
|
463
|
-
children: [/* @__PURE__ */
|
|
464
|
+
children: [/* @__PURE__ */ v("button", {
|
|
464
465
|
type: "button",
|
|
465
466
|
onClick: () => a(r),
|
|
466
467
|
className: "flex-1 px-3 py-2 text-sm font-medium border border-border text-foreground rounded-md hover:bg-muted transition-colors",
|
|
467
468
|
children: "Edit"
|
|
468
|
-
}), /* @__PURE__ */
|
|
469
|
+
}), /* @__PURE__ */ v("button", {
|
|
469
470
|
type: "button",
|
|
470
471
|
onClick: () => o(r),
|
|
471
|
-
disabled:
|
|
472
|
+
disabled: l,
|
|
472
473
|
className: `px-3 py-2 text-sm font-medium border border-border rounded-md transition-colors ${r.isActive ? "text-destructive hover:bg-destructive/10" : "text-status-success-text hover:bg-status-success-bg-subtle"}`,
|
|
473
474
|
children: r.isActive ? "Deactivate" : "Activate"
|
|
474
475
|
})]
|
|
@@ -477,19 +478,19 @@ var S = () => {
|
|
|
477
478
|
})
|
|
478
479
|
]
|
|
479
480
|
});
|
|
480
|
-
},
|
|
481
|
-
let w =
|
|
482
|
-
return /* @__PURE__ */
|
|
483
|
-
className: `flex items-center gap-4 p-4 border rounded-lg transition-all hover:shadow-sm ${n.isActive ?
|
|
481
|
+
}, T = ({ addon: n, onView: r, onEdit: i, onToggle: a, canManage: o, displayCurrency: s, isToggling: c, isInCart: l, cartQuantity: d, onAddToCart: g, onUpdateQuantity: b, onRemoveFromCart: C }) => {
|
|
482
|
+
let w = u(() => x(n.features || []), [n.features]);
|
|
483
|
+
return /* @__PURE__ */ y("div", {
|
|
484
|
+
className: `flex items-center gap-4 p-4 border rounded-lg transition-all hover:shadow-sm ${n.isActive ? l ? "border-primary bg-primary/5" : "border-border bg-card" : "border-dashed border-muted-foreground/30 bg-muted/30"}`,
|
|
484
485
|
children: [
|
|
485
|
-
/* @__PURE__ */
|
|
486
|
+
/* @__PURE__ */ v("div", {
|
|
486
487
|
className: "size-10 rounded-lg bg-primary/10 flex items-center justify-center shrink-0",
|
|
487
|
-
children: /* @__PURE__ */
|
|
488
|
+
children: /* @__PURE__ */ v("svg", {
|
|
488
489
|
className: "size-5 text-primary",
|
|
489
490
|
fill: "none",
|
|
490
491
|
viewBox: "0 0 24 24",
|
|
491
492
|
stroke: "currentColor",
|
|
492
|
-
children: /* @__PURE__ */
|
|
493
|
+
children: /* @__PURE__ */ v("path", {
|
|
493
494
|
strokeLinecap: "round",
|
|
494
495
|
strokeLinejoin: "round",
|
|
495
496
|
strokeWidth: 2,
|
|
@@ -497,29 +498,29 @@ var S = () => {
|
|
|
497
498
|
})
|
|
498
499
|
})
|
|
499
500
|
}),
|
|
500
|
-
/* @__PURE__ */
|
|
501
|
+
/* @__PURE__ */ y("div", {
|
|
501
502
|
className: "flex-1 min-w-0",
|
|
502
|
-
children: [/* @__PURE__ */
|
|
503
|
+
children: [/* @__PURE__ */ y("div", {
|
|
503
504
|
className: "flex items-center gap-2",
|
|
504
505
|
children: [
|
|
505
|
-
/* @__PURE__ */
|
|
506
|
+
/* @__PURE__ */ v("h3", {
|
|
506
507
|
className: "font-semibold text-foreground truncate",
|
|
507
508
|
children: n.name
|
|
508
509
|
}),
|
|
509
|
-
!n.isActive && /* @__PURE__ */
|
|
510
|
+
!n.isActive && /* @__PURE__ */ v("span", {
|
|
510
511
|
className: "px-2 py-0.5 text-xs font-medium bg-muted text-muted-foreground rounded",
|
|
511
512
|
children: "Inactive"
|
|
512
513
|
}),
|
|
513
|
-
|
|
514
|
+
l && n.isActive && /* @__PURE__ */ y("span", {
|
|
514
515
|
className: "px-2 py-0.5 text-xs font-medium bg-primary text-primary-foreground rounded",
|
|
515
516
|
children: [
|
|
516
517
|
"In Cart (",
|
|
517
|
-
|
|
518
|
+
d,
|
|
518
519
|
")"
|
|
519
520
|
]
|
|
520
521
|
})
|
|
521
522
|
]
|
|
522
|
-
}), /* @__PURE__ */
|
|
523
|
+
}), /* @__PURE__ */ y("p", {
|
|
523
524
|
className: "text-sm text-muted-foreground",
|
|
524
525
|
children: [
|
|
525
526
|
w.length,
|
|
@@ -528,65 +529,65 @@ var S = () => {
|
|
|
528
529
|
]
|
|
529
530
|
})]
|
|
530
531
|
}),
|
|
531
|
-
/* @__PURE__ */
|
|
532
|
+
/* @__PURE__ */ y("div", {
|
|
532
533
|
className: "text-right",
|
|
533
|
-
children: [/* @__PURE__ */
|
|
534
|
+
children: [/* @__PURE__ */ v("div", {
|
|
534
535
|
className: "font-semibold text-foreground",
|
|
535
536
|
children: (() => {
|
|
536
|
-
let { price: t, currency: r } =
|
|
537
|
+
let { price: t, currency: r } = S(n, s);
|
|
537
538
|
return e(t, r);
|
|
538
539
|
})()
|
|
539
|
-
}), /* @__PURE__ */
|
|
540
|
+
}), /* @__PURE__ */ y("div", {
|
|
540
541
|
className: "text-sm text-muted-foreground",
|
|
541
542
|
children: ["per ", t(n.duration)]
|
|
542
543
|
})]
|
|
543
544
|
}),
|
|
544
|
-
n.isActive && (
|
|
545
|
+
n.isActive && (l ? /* @__PURE__ */ y("div", {
|
|
545
546
|
className: "flex items-center gap-1",
|
|
546
547
|
children: [
|
|
547
|
-
/* @__PURE__ */
|
|
548
|
+
/* @__PURE__ */ v("button", {
|
|
548
549
|
type: "button",
|
|
549
|
-
onClick: () =>
|
|
550
|
+
onClick: () => b(n.id, d - 1),
|
|
550
551
|
className: "p-1.5 rounded border border-border hover:bg-muted transition-colors",
|
|
551
|
-
children: /* @__PURE__ */
|
|
552
|
+
children: /* @__PURE__ */ v(f, { className: "size-4" })
|
|
552
553
|
}),
|
|
553
|
-
/* @__PURE__ */
|
|
554
|
+
/* @__PURE__ */ v("span", {
|
|
554
555
|
className: "w-8 text-center font-medium",
|
|
555
|
-
children:
|
|
556
|
+
children: d
|
|
556
557
|
}),
|
|
557
|
-
/* @__PURE__ */
|
|
558
|
+
/* @__PURE__ */ v("button", {
|
|
558
559
|
type: "button",
|
|
559
|
-
onClick: () =>
|
|
560
|
+
onClick: () => b(n.id, d + 1),
|
|
560
561
|
className: "p-1.5 rounded border border-border hover:bg-muted transition-colors",
|
|
561
|
-
children: /* @__PURE__ */
|
|
562
|
+
children: /* @__PURE__ */ v(p, { className: "size-4" })
|
|
562
563
|
}),
|
|
563
|
-
/* @__PURE__ */
|
|
564
|
+
/* @__PURE__ */ v("button", {
|
|
564
565
|
type: "button",
|
|
565
566
|
onClick: () => C(n.id),
|
|
566
567
|
className: "p-1.5 rounded text-destructive hover:bg-destructive/10 transition-colors ml-1",
|
|
567
568
|
title: "Remove from cart",
|
|
568
|
-
children: /* @__PURE__ */
|
|
569
|
+
children: /* @__PURE__ */ v(h, { className: "size-4" })
|
|
569
570
|
})
|
|
570
571
|
]
|
|
571
|
-
}) : /* @__PURE__ */
|
|
572
|
+
}) : /* @__PURE__ */ y("button", {
|
|
572
573
|
type: "button",
|
|
573
|
-
onClick: () =>
|
|
574
|
+
onClick: () => g(n),
|
|
574
575
|
className: "px-3 py-1.5 text-sm font-medium bg-primary text-primary-foreground rounded-md hover:bg-primary/90 transition-colors flex items-center gap-1.5",
|
|
575
|
-
children: [/* @__PURE__ */
|
|
576
|
+
children: [/* @__PURE__ */ v(m, { className: "size-4" }), "Add"]
|
|
576
577
|
})),
|
|
577
|
-
/* @__PURE__ */
|
|
578
|
+
/* @__PURE__ */ y("div", {
|
|
578
579
|
className: "flex items-center gap-2",
|
|
579
|
-
children: [/* @__PURE__ */
|
|
580
|
+
children: [/* @__PURE__ */ v("button", {
|
|
580
581
|
type: "button",
|
|
581
582
|
onClick: () => r(n),
|
|
582
583
|
className: "px-3 py-1.5 text-sm font-medium border border-border text-foreground rounded-md hover:bg-muted transition-colors",
|
|
583
584
|
children: "View"
|
|
584
|
-
}), o && /* @__PURE__ */
|
|
585
|
+
}), o && /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v("button", {
|
|
585
586
|
type: "button",
|
|
586
587
|
onClick: () => i(n),
|
|
587
588
|
className: "px-3 py-1.5 text-sm font-medium border border-border text-foreground rounded-md hover:bg-muted transition-colors",
|
|
588
589
|
children: "Edit"
|
|
589
|
-
}), /* @__PURE__ */
|
|
590
|
+
}), /* @__PURE__ */ v("button", {
|
|
590
591
|
type: "button",
|
|
591
592
|
onClick: () => a(n),
|
|
592
593
|
disabled: c,
|
|
@@ -596,77 +597,77 @@ var S = () => {
|
|
|
596
597
|
})
|
|
597
598
|
]
|
|
598
599
|
});
|
|
599
|
-
},
|
|
600
|
-
let r =
|
|
601
|
-
return
|
|
600
|
+
}, E = ({ displayCurrency: n }) => {
|
|
601
|
+
let r = o(), { items: i, isCartOpen: s, toggleCart: c, closeCart: l, removeFromCart: u, updateQuantity: d, clearCart: b } = a(), x = i.reduce((e, t) => e + t.quantity, 0);
|
|
602
|
+
return i.length === 0 && !s ? null : /* @__PURE__ */ y(_, { children: [!s && i.length > 0 && /* @__PURE__ */ y("button", {
|
|
602
603
|
type: "button",
|
|
603
604
|
onClick: c,
|
|
604
605
|
className: "fixed bottom-6 right-6 z-50 flex items-center gap-2 px-4 py-3 bg-primary text-primary-foreground rounded-full shadow-lg hover:bg-primary/90 transition-all",
|
|
605
606
|
children: [
|
|
606
|
-
/* @__PURE__ */
|
|
607
|
-
/* @__PURE__ */
|
|
607
|
+
/* @__PURE__ */ v(m, { className: "size-5" }),
|
|
608
|
+
/* @__PURE__ */ y("span", {
|
|
608
609
|
className: "font-medium",
|
|
609
610
|
children: [
|
|
610
|
-
|
|
611
|
+
x,
|
|
611
612
|
" item",
|
|
612
|
-
|
|
613
|
+
x === 1 ? "" : "s"
|
|
613
614
|
]
|
|
614
615
|
}),
|
|
615
|
-
/* @__PURE__ */
|
|
616
|
+
/* @__PURE__ */ v("span", {
|
|
616
617
|
className: "px-2 py-0.5 bg-primary-foreground/20 rounded-full text-sm",
|
|
617
|
-
children: e(
|
|
618
|
-
let { price: i } =
|
|
618
|
+
children: e(i.reduce((e, { addon: t, quantity: r }) => {
|
|
619
|
+
let { price: i } = S(t, n);
|
|
619
620
|
return e + i * r;
|
|
620
621
|
}, 0), n)
|
|
621
622
|
})
|
|
622
623
|
]
|
|
623
|
-
}), s && /* @__PURE__ */
|
|
624
|
+
}), s && /* @__PURE__ */ y("div", {
|
|
624
625
|
className: "fixed inset-0 z-50 flex items-end sm:items-center justify-center",
|
|
625
|
-
children: [/* @__PURE__ */
|
|
626
|
+
children: [/* @__PURE__ */ v("div", {
|
|
626
627
|
className: "absolute inset-0 bg-overlay-scrim",
|
|
627
628
|
onClick: l
|
|
628
|
-
}), /* @__PURE__ */
|
|
629
|
+
}), /* @__PURE__ */ y("div", {
|
|
629
630
|
className: "relative w-full max-w-md max-h-[80vh] bg-card border border-border rounded-t-xl sm:rounded-xl shadow-xl overflow-hidden",
|
|
630
631
|
children: [
|
|
631
|
-
/* @__PURE__ */
|
|
632
|
+
/* @__PURE__ */ y("div", {
|
|
632
633
|
className: "flex items-center justify-between px-4 py-3 border-b border-border bg-muted/30",
|
|
633
|
-
children: [/* @__PURE__ */
|
|
634
|
+
children: [/* @__PURE__ */ y("div", {
|
|
634
635
|
className: "flex items-center gap-2",
|
|
635
636
|
children: [
|
|
636
|
-
/* @__PURE__ */
|
|
637
|
-
/* @__PURE__ */
|
|
637
|
+
/* @__PURE__ */ v(m, { className: "size-5 text-foreground" }),
|
|
638
|
+
/* @__PURE__ */ v("h3", {
|
|
638
639
|
className: "font-semibold text-foreground",
|
|
639
640
|
children: "Your Cart"
|
|
640
641
|
}),
|
|
641
|
-
/* @__PURE__ */
|
|
642
|
+
/* @__PURE__ */ y("span", {
|
|
642
643
|
className: "px-2 py-0.5 text-xs bg-primary text-primary-foreground rounded-full",
|
|
643
644
|
children: [
|
|
644
|
-
|
|
645
|
+
x,
|
|
645
646
|
" item",
|
|
646
|
-
|
|
647
|
+
x === 1 ? "" : "s"
|
|
647
648
|
]
|
|
648
649
|
})
|
|
649
650
|
]
|
|
650
|
-
}), /* @__PURE__ */
|
|
651
|
+
}), /* @__PURE__ */ v("button", {
|
|
651
652
|
type: "button",
|
|
652
653
|
onClick: l,
|
|
653
654
|
className: "p-1.5 rounded hover:bg-muted transition-colors",
|
|
654
|
-
children: /* @__PURE__ */
|
|
655
|
+
children: /* @__PURE__ */ v(g, { className: "size-5" })
|
|
655
656
|
})]
|
|
656
657
|
}),
|
|
657
|
-
/* @__PURE__ */
|
|
658
|
+
/* @__PURE__ */ v("div", {
|
|
658
659
|
className: "overflow-y-auto max-h-[50vh] divide-y divide-border",
|
|
659
|
-
children:
|
|
660
|
+
children: i.map(({ addon: r, quantity: i }) => /* @__PURE__ */ y("div", {
|
|
660
661
|
className: "p-4 flex items-center gap-3",
|
|
661
662
|
children: [
|
|
662
|
-
/* @__PURE__ */
|
|
663
|
+
/* @__PURE__ */ v("div", {
|
|
663
664
|
className: "size-10 rounded-lg bg-primary/10 flex items-center justify-center shrink-0",
|
|
664
|
-
children: /* @__PURE__ */
|
|
665
|
+
children: /* @__PURE__ */ v("svg", {
|
|
665
666
|
className: "size-5 text-primary",
|
|
666
667
|
fill: "none",
|
|
667
668
|
viewBox: "0 0 24 24",
|
|
668
669
|
stroke: "currentColor",
|
|
669
|
-
children: /* @__PURE__ */
|
|
670
|
+
children: /* @__PURE__ */ v("path", {
|
|
670
671
|
strokeLinecap: "round",
|
|
671
672
|
strokeLinejoin: "round",
|
|
672
673
|
strokeWidth: 2,
|
|
@@ -674,16 +675,16 @@ var S = () => {
|
|
|
674
675
|
})
|
|
675
676
|
})
|
|
676
677
|
}),
|
|
677
|
-
/* @__PURE__ */
|
|
678
|
+
/* @__PURE__ */ y("div", {
|
|
678
679
|
className: "flex-1 min-w-0",
|
|
679
|
-
children: [/* @__PURE__ */
|
|
680
|
+
children: [/* @__PURE__ */ v("h4", {
|
|
680
681
|
className: "font-medium text-foreground truncate",
|
|
681
682
|
children: r.name
|
|
682
|
-
}), /* @__PURE__ */
|
|
683
|
+
}), /* @__PURE__ */ y("p", {
|
|
683
684
|
className: "text-sm text-muted-foreground",
|
|
684
685
|
children: [
|
|
685
686
|
(() => {
|
|
686
|
-
let { price: t, currency: i } =
|
|
687
|
+
let { price: t, currency: i } = S(r, n);
|
|
687
688
|
return e(t, i);
|
|
688
689
|
})(),
|
|
689
690
|
" ",
|
|
@@ -692,68 +693,68 @@ var S = () => {
|
|
|
692
693
|
]
|
|
693
694
|
})]
|
|
694
695
|
}),
|
|
695
|
-
/* @__PURE__ */
|
|
696
|
+
/* @__PURE__ */ y("div", {
|
|
696
697
|
className: "flex items-center gap-1",
|
|
697
698
|
children: [
|
|
698
|
-
/* @__PURE__ */
|
|
699
|
+
/* @__PURE__ */ v("button", {
|
|
699
700
|
type: "button",
|
|
700
|
-
onClick: () =>
|
|
701
|
+
onClick: () => d(r.id, i - 1),
|
|
701
702
|
className: "p-1 rounded border border-border hover:bg-muted transition-colors",
|
|
702
|
-
children: /* @__PURE__ */
|
|
703
|
+
children: /* @__PURE__ */ v(f, { className: "size-3" })
|
|
703
704
|
}),
|
|
704
|
-
/* @__PURE__ */
|
|
705
|
+
/* @__PURE__ */ v("span", {
|
|
705
706
|
className: "w-6 text-center text-sm font-medium",
|
|
706
707
|
children: i
|
|
707
708
|
}),
|
|
708
|
-
/* @__PURE__ */
|
|
709
|
+
/* @__PURE__ */ v("button", {
|
|
709
710
|
type: "button",
|
|
710
|
-
onClick: () =>
|
|
711
|
+
onClick: () => d(r.id, i + 1),
|
|
711
712
|
className: "p-1 rounded border border-border hover:bg-muted transition-colors",
|
|
712
|
-
children: /* @__PURE__ */
|
|
713
|
+
children: /* @__PURE__ */ v(p, { className: "size-3" })
|
|
713
714
|
})
|
|
714
715
|
]
|
|
715
716
|
}),
|
|
716
|
-
/* @__PURE__ */
|
|
717
|
+
/* @__PURE__ */ v("div", {
|
|
717
718
|
className: "text-right",
|
|
718
|
-
children: /* @__PURE__ */
|
|
719
|
+
children: /* @__PURE__ */ v("p", {
|
|
719
720
|
className: "font-medium text-foreground",
|
|
720
721
|
children: (() => {
|
|
721
|
-
let { price: t, currency: a } =
|
|
722
|
+
let { price: t, currency: a } = S(r, n);
|
|
722
723
|
return e(t * i, a);
|
|
723
724
|
})()
|
|
724
725
|
})
|
|
725
726
|
}),
|
|
726
|
-
/* @__PURE__ */
|
|
727
|
+
/* @__PURE__ */ v("button", {
|
|
727
728
|
type: "button",
|
|
728
729
|
onClick: () => u(r.id),
|
|
729
730
|
className: "p-1.5 rounded text-destructive hover:bg-destructive/10 transition-colors",
|
|
730
|
-
children: /* @__PURE__ */
|
|
731
|
+
children: /* @__PURE__ */ v(h, { className: "size-4" })
|
|
731
732
|
})
|
|
732
733
|
]
|
|
733
734
|
}, r.id))
|
|
734
735
|
}),
|
|
735
|
-
/* @__PURE__ */
|
|
736
|
+
/* @__PURE__ */ y("div", {
|
|
736
737
|
className: "border-t border-border p-4 space-y-3 bg-muted/20",
|
|
737
|
-
children: [/* @__PURE__ */
|
|
738
|
+
children: [/* @__PURE__ */ y("div", {
|
|
738
739
|
className: "flex items-center justify-between text-lg font-semibold",
|
|
739
|
-
children: [/* @__PURE__ */
|
|
740
|
+
children: [/* @__PURE__ */ v("span", {
|
|
740
741
|
className: "text-foreground",
|
|
741
742
|
children: "Total"
|
|
742
|
-
}), /* @__PURE__ */
|
|
743
|
+
}), /* @__PURE__ */ v("span", {
|
|
743
744
|
className: "text-foreground",
|
|
744
|
-
children: e(
|
|
745
|
-
let { price: i } =
|
|
745
|
+
children: e(i.reduce((e, { addon: t, quantity: r }) => {
|
|
746
|
+
let { price: i } = S(t, n);
|
|
746
747
|
return e + i * r;
|
|
747
748
|
}, 0), n)
|
|
748
749
|
})]
|
|
749
|
-
}), /* @__PURE__ */
|
|
750
|
+
}), /* @__PURE__ */ y("div", {
|
|
750
751
|
className: "flex gap-2",
|
|
751
|
-
children: [/* @__PURE__ */
|
|
752
|
+
children: [/* @__PURE__ */ v("button", {
|
|
752
753
|
type: "button",
|
|
753
754
|
onClick: b,
|
|
754
755
|
className: "flex-1 px-4 py-2.5 text-sm font-medium border border-border text-foreground rounded-md hover:bg-muted transition-colors",
|
|
755
756
|
children: "Clear Cart"
|
|
756
|
-
}), /* @__PURE__ */
|
|
757
|
+
}), /* @__PURE__ */ v("button", {
|
|
757
758
|
type: "button",
|
|
758
759
|
onClick: () => {
|
|
759
760
|
l(), r("/checkout/addons");
|
|
@@ -768,6 +769,6 @@ var S = () => {
|
|
|
768
769
|
})] });
|
|
769
770
|
};
|
|
770
771
|
//#endregion
|
|
771
|
-
export {
|
|
772
|
+
export { C as AddonsListPage };
|
|
772
773
|
|
|
773
774
|
//# sourceMappingURL=AddonsListPage.js.map
|