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