@burdenoff/microfe-billing 2026.528.1 → 2026.529.1
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/plans/pages/PlanBrowseDetailPage.js +82 -81
- package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlanDetailPage.js +105 -104
- package/dist/billing/modules/plans/pages/PlanDetailPage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlanEditPage.js +162 -161
- package/dist/billing/modules/plans/pages/PlanEditPage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlansBrowsePage.js +85 -84
- package/dist/billing/modules/plans/pages/PlansBrowsePage.js.map +1 -1
- package/dist/billing/modules/plans/pages/PlansListPage.js +115 -114
- package/dist/billing/modules/plans/pages/PlansListPage.js.map +1 -1
- package/dist/billing/shared/utils/index.js +1 -0
- package/dist/billing/shared/utils/planFeatureQuantity.js +11 -0
- package/dist/billing/shared/utils/planFeatureQuantity.js.map +1 -0
- package/dist/generated/global-operations.js +1 -0
- package/dist/generated/global-operations.js.map +1 -1
- package/package.json +1 -1
|
@@ -4,21 +4,22 @@ import "../../../shared/components/index.js";
|
|
|
4
4
|
import { PricingModel as n } from "../../../shared/types/graphql.js";
|
|
5
5
|
import { formatCurrency as r, formatPlanDuration as i, formatPlanDurationLabel as a } from "../../../shared/utils/format.js";
|
|
6
6
|
import { isServerError as o } from "../../../shared/utils/error.js";
|
|
7
|
+
import { getPlanFeatureQuantity as s } from "../../../shared/utils/planFeatureQuantity.js";
|
|
7
8
|
import "../../../shared/utils/index.js";
|
|
8
|
-
import { useBillingPermissions as
|
|
9
|
-
import { useBillingNavigate as
|
|
10
|
-
import { getDisplayPrice as
|
|
11
|
-
import { usePlanMutations as
|
|
9
|
+
import { useBillingPermissions as c } from "../../../hooks/useBillingPermissions.js";
|
|
10
|
+
import { useBillingNavigate as l } from "../../../hooks/useBillingNavigate.js";
|
|
11
|
+
import { getDisplayPrice as u, useDefaultBillingCurrency as d } from "../../../hooks/useDefaultBillingCurrency.js";
|
|
12
|
+
import { usePlanMutations as f, usePlans as p } from "../hooks/usePlans.js";
|
|
12
13
|
import "../hooks/index.js";
|
|
13
|
-
import { useMemo as
|
|
14
|
-
import { jsx as
|
|
15
|
-
import { useI18n as
|
|
14
|
+
import { useMemo as m, useState as h } from "react";
|
|
15
|
+
import { jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
16
|
+
import { useI18n as v } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
16
17
|
//#region src/billing/modules/plans/pages/PlansListPage.tsx
|
|
17
|
-
function
|
|
18
|
+
function y(e) {
|
|
18
19
|
let t = /* @__PURE__ */ new Map();
|
|
19
20
|
for (let n of e) {
|
|
20
21
|
if (!n.quota) continue;
|
|
21
|
-
let e = n.quota.id, r = n
|
|
22
|
+
let e = n.quota.id, r = s(n), i = t.get(e);
|
|
22
23
|
i ? i.totalValue += r : t.set(e, {
|
|
23
24
|
quotaId: e,
|
|
24
25
|
name: n.quota.name ?? "Unknown Quota",
|
|
@@ -27,15 +28,15 @@ function v(e) {
|
|
|
27
28
|
}
|
|
28
29
|
return Array.from(t.values());
|
|
29
30
|
}
|
|
30
|
-
var
|
|
31
|
-
let { t: n } =
|
|
31
|
+
var b = () => {
|
|
32
|
+
let { t: n } = v(), r = (e, t) => {
|
|
32
33
|
let r = n(e);
|
|
33
34
|
return r === e ? t : r;
|
|
34
|
-
}, i =
|
|
35
|
-
if (!a.canViewPlans) return /* @__PURE__ */
|
|
36
|
-
let k =
|
|
35
|
+
}, i = l(), a = c(), { plans: s, isLoading: u, error: d, refetch: m } = p(), { togglePlan: y, isToggling: b } = f(), [C, w] = h("grid"), [T, E] = h(!1), [D, O] = h("all");
|
|
36
|
+
if (!a.canViewPlans) return /* @__PURE__ */ g(e, { message: r("billing.plans.noViewPermission", "You don't have permission to view pricing plans.") });
|
|
37
|
+
let k = s.filter((e) => !(!T && !e.isActive || D !== "all" && e.duration !== D)), A = async (e) => {
|
|
37
38
|
if (a.canManagePlans) try {
|
|
38
|
-
await y(e.id, !e.isActive), await
|
|
39
|
+
await y(e.id, !e.isActive), await m();
|
|
39
40
|
} catch (e) {
|
|
40
41
|
console.error("Failed to toggle plan:", e);
|
|
41
42
|
}
|
|
@@ -44,52 +45,52 @@ var y = () => {
|
|
|
44
45
|
}, M = (e) => {
|
|
45
46
|
i(`/plans/${e.id}`);
|
|
46
47
|
};
|
|
47
|
-
return u &&
|
|
48
|
+
return u && s.length === 0 ? /* @__PURE__ */ _("div", {
|
|
48
49
|
className: "space-y-6 p-6",
|
|
49
|
-
children: [/* @__PURE__ */
|
|
50
|
+
children: [/* @__PURE__ */ g("div", { className: "h-8 w-48 bg-muted animate-pulse rounded" }), /* @__PURE__ */ g("div", {
|
|
50
51
|
className: "grid grid-cols-1 md:grid-cols-3 gap-6",
|
|
51
52
|
children: [
|
|
52
53
|
1,
|
|
53
54
|
2,
|
|
54
55
|
3
|
|
55
|
-
].map((e) => /* @__PURE__ */
|
|
56
|
+
].map((e) => /* @__PURE__ */ _("div", {
|
|
56
57
|
className: "border border-border rounded-lg p-6 space-y-4",
|
|
57
58
|
children: [
|
|
58
|
-
/* @__PURE__ */
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
-
/* @__PURE__ */
|
|
59
|
+
/* @__PURE__ */ g("div", { className: "h-6 w-24 bg-muted animate-pulse rounded" }),
|
|
60
|
+
/* @__PURE__ */ g("div", { className: "h-8 w-32 bg-muted animate-pulse rounded" }),
|
|
61
|
+
/* @__PURE__ */ g("div", {
|
|
61
62
|
className: "space-y-2",
|
|
62
63
|
children: [
|
|
63
64
|
1,
|
|
64
65
|
2,
|
|
65
66
|
3,
|
|
66
67
|
4
|
|
67
|
-
].map((e) => /* @__PURE__ */
|
|
68
|
+
].map((e) => /* @__PURE__ */ g("div", { className: "h-4 w-full bg-muted animate-pulse rounded" }, e))
|
|
68
69
|
})
|
|
69
70
|
]
|
|
70
71
|
}, e))
|
|
71
72
|
})]
|
|
72
|
-
}) :
|
|
73
|
+
}) : d ? o(d) ? /* @__PURE__ */ g("div", {
|
|
73
74
|
className: "p-6",
|
|
74
|
-
children: /* @__PURE__ */
|
|
75
|
+
children: /* @__PURE__ */ g(t, {
|
|
75
76
|
title: r("billing.plans.serverUnavailable", "Server Unavailable"),
|
|
76
77
|
message: r("billing.plans.serverUnavailableMessage", "Unable to load pricing plans. The server might be down or experiencing issues."),
|
|
77
|
-
onRetry: () =>
|
|
78
|
+
onRetry: () => m(),
|
|
78
79
|
showRetry: !0
|
|
79
80
|
})
|
|
80
|
-
}) : /* @__PURE__ */
|
|
81
|
+
}) : /* @__PURE__ */ g("div", {
|
|
81
82
|
className: "flex items-center justify-center h-full min-h-[400px]",
|
|
82
|
-
children: /* @__PURE__ */
|
|
83
|
+
children: /* @__PURE__ */ _("div", {
|
|
83
84
|
className: "text-center space-y-4",
|
|
84
85
|
children: [
|
|
85
|
-
/* @__PURE__ */
|
|
86
|
+
/* @__PURE__ */ g("div", {
|
|
86
87
|
className: "size-12 mx-auto rounded-full bg-destructive/10 flex items-center justify-center",
|
|
87
|
-
children: /* @__PURE__ */
|
|
88
|
+
children: /* @__PURE__ */ g("svg", {
|
|
88
89
|
className: "size-6 text-destructive",
|
|
89
90
|
fill: "none",
|
|
90
91
|
viewBox: "0 0 24 24",
|
|
91
92
|
stroke: "currentColor",
|
|
92
|
-
children: /* @__PURE__ */
|
|
93
|
+
children: /* @__PURE__ */ g("path", {
|
|
93
94
|
strokeLinecap: "round",
|
|
94
95
|
strokeLinejoin: "round",
|
|
95
96
|
strokeWidth: 2,
|
|
@@ -97,43 +98,43 @@ var y = () => {
|
|
|
97
98
|
})
|
|
98
99
|
})
|
|
99
100
|
}),
|
|
100
|
-
/* @__PURE__ */
|
|
101
|
+
/* @__PURE__ */ g("h2", {
|
|
101
102
|
className: "text-lg font-semibold text-foreground",
|
|
102
103
|
children: r("billing.plans.failedToLoad", "Failed to load plans")
|
|
103
104
|
}),
|
|
104
|
-
/* @__PURE__ */
|
|
105
|
+
/* @__PURE__ */ g("p", {
|
|
105
106
|
className: "text-sm text-muted-foreground",
|
|
106
|
-
children:
|
|
107
|
+
children: d.message
|
|
107
108
|
}),
|
|
108
|
-
/* @__PURE__ */
|
|
109
|
+
/* @__PURE__ */ g("button", {
|
|
109
110
|
type: "button",
|
|
110
|
-
onClick: () =>
|
|
111
|
+
onClick: () => m(),
|
|
111
112
|
className: "px-4 py-2 text-sm font-medium bg-primary text-primary-foreground rounded-md hover:bg-primary/90 transition-colors",
|
|
112
113
|
children: "Try Again"
|
|
113
114
|
})
|
|
114
115
|
]
|
|
115
116
|
})
|
|
116
|
-
}) : /* @__PURE__ */
|
|
117
|
+
}) : /* @__PURE__ */ _("div", {
|
|
117
118
|
className: "space-y-6 p-6",
|
|
118
119
|
children: [
|
|
119
|
-
/* @__PURE__ */
|
|
120
|
+
/* @__PURE__ */ _("div", {
|
|
120
121
|
className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",
|
|
121
|
-
children: [/* @__PURE__ */
|
|
122
|
+
children: [/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("h1", {
|
|
122
123
|
className: "text-2xl font-bold text-foreground",
|
|
123
124
|
children: r("billing.plans.title", "Pricing Plans")
|
|
124
|
-
}), /* @__PURE__ */
|
|
125
|
+
}), /* @__PURE__ */ g("p", {
|
|
125
126
|
className: "text-sm text-muted-foreground mt-1",
|
|
126
127
|
children: r("billing.plans.subtitle", "Choose the plan that best fits your needs")
|
|
127
|
-
})] }), a.canManagePlans && /* @__PURE__ */
|
|
128
|
+
})] }), a.canManagePlans && /* @__PURE__ */ _("button", {
|
|
128
129
|
type: "button",
|
|
129
130
|
onClick: () => i("/plans/new"),
|
|
130
131
|
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",
|
|
131
|
-
children: [/* @__PURE__ */
|
|
132
|
+
children: [/* @__PURE__ */ g("svg", {
|
|
132
133
|
className: "size-4",
|
|
133
134
|
fill: "none",
|
|
134
135
|
viewBox: "0 0 24 24",
|
|
135
136
|
stroke: "currentColor",
|
|
136
|
-
children: /* @__PURE__ */
|
|
137
|
+
children: /* @__PURE__ */ g("path", {
|
|
137
138
|
strokeLinecap: "round",
|
|
138
139
|
strokeLinejoin: "round",
|
|
139
140
|
strokeWidth: 2,
|
|
@@ -142,25 +143,25 @@ var y = () => {
|
|
|
142
143
|
}), "Create Plan"]
|
|
143
144
|
})]
|
|
144
145
|
}),
|
|
145
|
-
/* @__PURE__ */
|
|
146
|
+
/* @__PURE__ */ _("div", {
|
|
146
147
|
className: "flex flex-wrap items-center gap-4 pb-4 border-b border-border",
|
|
147
148
|
children: [
|
|
148
|
-
/* @__PURE__ */
|
|
149
|
+
/* @__PURE__ */ _("div", {
|
|
149
150
|
className: "inline-flex rounded-lg border border-border p-1 bg-muted/50",
|
|
150
151
|
children: [
|
|
151
|
-
/* @__PURE__ */
|
|
152
|
+
/* @__PURE__ */ g("button", {
|
|
152
153
|
type: "button",
|
|
153
154
|
onClick: () => O("all"),
|
|
154
155
|
className: `px-3 py-1.5 text-sm font-medium rounded-md transition-colors ${D === "all" ? "bg-background text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"}`,
|
|
155
156
|
children: "All"
|
|
156
157
|
}),
|
|
157
|
-
/* @__PURE__ */
|
|
158
|
+
/* @__PURE__ */ g("button", {
|
|
158
159
|
type: "button",
|
|
159
160
|
onClick: () => O("monthly"),
|
|
160
161
|
className: `px-3 py-1.5 text-sm font-medium rounded-md transition-colors ${D === "monthly" ? "bg-background text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"}`,
|
|
161
162
|
children: "Monthly"
|
|
162
163
|
}),
|
|
163
|
-
/* @__PURE__ */
|
|
164
|
+
/* @__PURE__ */ g("button", {
|
|
164
165
|
type: "button",
|
|
165
166
|
onClick: () => O("yearly"),
|
|
166
167
|
className: `px-3 py-1.5 text-sm font-medium rounded-md transition-colors ${D === "yearly" ? "bg-background text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"}`,
|
|
@@ -168,48 +169,48 @@ var y = () => {
|
|
|
168
169
|
})
|
|
169
170
|
]
|
|
170
171
|
}),
|
|
171
|
-
a.canManagePlans && /* @__PURE__ */
|
|
172
|
+
a.canManagePlans && /* @__PURE__ */ _("label", {
|
|
172
173
|
className: "flex items-center gap-2 text-sm cursor-pointer",
|
|
173
|
-
children: [/* @__PURE__ */
|
|
174
|
+
children: [/* @__PURE__ */ g("input", {
|
|
174
175
|
type: "checkbox",
|
|
175
176
|
checked: T,
|
|
176
177
|
onChange: (e) => E(e.target.checked),
|
|
177
178
|
className: "size-4 rounded border-border text-primary focus:ring-primary"
|
|
178
|
-
}), /* @__PURE__ */
|
|
179
|
+
}), /* @__PURE__ */ g("span", {
|
|
179
180
|
className: "text-muted-foreground",
|
|
180
181
|
children: r("billing.plans.showInactive", "Show inactive plans")
|
|
181
182
|
})]
|
|
182
183
|
}),
|
|
183
|
-
/* @__PURE__ */
|
|
184
|
+
/* @__PURE__ */ _("div", {
|
|
184
185
|
className: "ml-auto inline-flex rounded-lg border border-border p-1 bg-muted/50",
|
|
185
|
-
children: [/* @__PURE__ */
|
|
186
|
+
children: [/* @__PURE__ */ g("button", {
|
|
186
187
|
type: "button",
|
|
187
188
|
onClick: () => w("grid"),
|
|
188
189
|
className: `p-1.5 rounded-md transition-colors ${C === "grid" ? "bg-background text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"}`,
|
|
189
190
|
title: "Grid view",
|
|
190
|
-
children: /* @__PURE__ */
|
|
191
|
+
children: /* @__PURE__ */ g("svg", {
|
|
191
192
|
className: "size-4",
|
|
192
193
|
fill: "none",
|
|
193
194
|
viewBox: "0 0 24 24",
|
|
194
195
|
stroke: "currentColor",
|
|
195
|
-
children: /* @__PURE__ */
|
|
196
|
+
children: /* @__PURE__ */ g("path", {
|
|
196
197
|
strokeLinecap: "round",
|
|
197
198
|
strokeLinejoin: "round",
|
|
198
199
|
strokeWidth: 2,
|
|
199
200
|
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"
|
|
200
201
|
})
|
|
201
202
|
})
|
|
202
|
-
}), /* @__PURE__ */
|
|
203
|
+
}), /* @__PURE__ */ g("button", {
|
|
203
204
|
type: "button",
|
|
204
205
|
onClick: () => w("list"),
|
|
205
206
|
className: `p-1.5 rounded-md transition-colors ${C === "list" ? "bg-background text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"}`,
|
|
206
207
|
title: "List view",
|
|
207
|
-
children: /* @__PURE__ */
|
|
208
|
+
children: /* @__PURE__ */ g("svg", {
|
|
208
209
|
className: "size-4",
|
|
209
210
|
fill: "none",
|
|
210
211
|
viewBox: "0 0 24 24",
|
|
211
212
|
stroke: "currentColor",
|
|
212
|
-
children: /* @__PURE__ */
|
|
213
|
+
children: /* @__PURE__ */ g("path", {
|
|
213
214
|
strokeLinecap: "round",
|
|
214
215
|
strokeLinejoin: "round",
|
|
215
216
|
strokeWidth: 2,
|
|
@@ -220,17 +221,17 @@ var y = () => {
|
|
|
220
221
|
})
|
|
221
222
|
]
|
|
222
223
|
}),
|
|
223
|
-
k.length === 0 ? /* @__PURE__ */
|
|
224
|
+
k.length === 0 ? /* @__PURE__ */ _("div", {
|
|
224
225
|
className: "flex flex-col items-center justify-center py-12 border border-dashed border-border rounded-lg",
|
|
225
226
|
children: [
|
|
226
|
-
/* @__PURE__ */
|
|
227
|
+
/* @__PURE__ */ g("div", {
|
|
227
228
|
className: "size-12 rounded-full bg-muted flex items-center justify-center mb-4",
|
|
228
|
-
children: /* @__PURE__ */
|
|
229
|
+
children: /* @__PURE__ */ g("svg", {
|
|
229
230
|
className: "size-6 text-muted-foreground",
|
|
230
231
|
fill: "none",
|
|
231
232
|
viewBox: "0 0 24 24",
|
|
232
233
|
stroke: "currentColor",
|
|
233
|
-
children: /* @__PURE__ */
|
|
234
|
+
children: /* @__PURE__ */ g("path", {
|
|
234
235
|
strokeLinecap: "round",
|
|
235
236
|
strokeLinejoin: "round",
|
|
236
237
|
strokeWidth: 2,
|
|
@@ -238,68 +239,68 @@ var y = () => {
|
|
|
238
239
|
})
|
|
239
240
|
})
|
|
240
241
|
}),
|
|
241
|
-
/* @__PURE__ */
|
|
242
|
+
/* @__PURE__ */ g("h3", {
|
|
242
243
|
className: "text-lg font-medium text-foreground",
|
|
243
244
|
children: r("billing.plans.noPlansFound", "No plans found")
|
|
244
245
|
}),
|
|
245
|
-
/* @__PURE__ */
|
|
246
|
+
/* @__PURE__ */ g("p", {
|
|
246
247
|
className: "text-sm text-muted-foreground mt-1",
|
|
247
248
|
children: T ? r("billing.plans.noPlansFiltered", "No plans match your current filters.") : r("billing.plans.noActivePlans", "There are no active plans available.")
|
|
248
249
|
}),
|
|
249
|
-
a.canManagePlans && /* @__PURE__ */
|
|
250
|
+
a.canManagePlans && /* @__PURE__ */ g("button", {
|
|
250
251
|
type: "button",
|
|
251
252
|
onClick: () => i("/plans/new"),
|
|
252
253
|
className: "mt-4 px-4 py-2 text-sm font-medium bg-primary text-primary-foreground rounded-md hover:bg-primary/90 transition-colors",
|
|
253
254
|
children: r("billing.plans.createFirstPlan", "Create your first plan")
|
|
254
255
|
})
|
|
255
256
|
]
|
|
256
|
-
}) : C === "grid" ? /* @__PURE__ */
|
|
257
|
+
}) : C === "grid" ? /* @__PURE__ */ g("div", {
|
|
257
258
|
className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",
|
|
258
|
-
children: k.map((e) => /* @__PURE__ */
|
|
259
|
+
children: k.map((e) => /* @__PURE__ */ g(x, {
|
|
259
260
|
plan: e,
|
|
260
261
|
onSelect: j,
|
|
261
262
|
onView: M,
|
|
262
263
|
onToggle: A,
|
|
263
264
|
canSelect: a.canCreateSubscription,
|
|
264
265
|
canManage: a.canManagePlans,
|
|
265
|
-
isToggling:
|
|
266
|
+
isToggling: b
|
|
266
267
|
}, e.id))
|
|
267
|
-
}) : /* @__PURE__ */
|
|
268
|
+
}) : /* @__PURE__ */ g("div", {
|
|
268
269
|
className: "space-y-3",
|
|
269
|
-
children: k.map((e) => /* @__PURE__ */
|
|
270
|
+
children: k.map((e) => /* @__PURE__ */ g(S, {
|
|
270
271
|
plan: e,
|
|
271
272
|
onSelect: j,
|
|
272
273
|
onView: M,
|
|
273
274
|
onToggle: A,
|
|
274
275
|
canSelect: a.canCreateSubscription,
|
|
275
276
|
canManage: a.canManagePlans,
|
|
276
|
-
isToggling:
|
|
277
|
+
isToggling: b
|
|
277
278
|
}, e.id))
|
|
278
279
|
})
|
|
279
280
|
]
|
|
280
281
|
});
|
|
281
|
-
},
|
|
282
|
-
let
|
|
283
|
-
return /* @__PURE__ */
|
|
282
|
+
}, x = ({ plan: e, onSelect: t, onView: o, onToggle: s, canSelect: c, canManage: l, isToggling: f }) => {
|
|
283
|
+
let p = d(), h = m(() => y(e.features || []), [e.features]);
|
|
284
|
+
return /* @__PURE__ */ _("div", {
|
|
284
285
|
className: `relative border rounded-lg p-6 transition-all hover:shadow-md flex flex-col h-full ${e.isActive ? "border-border bg-card" : "border-dashed border-muted-foreground/30 bg-muted/30"}`,
|
|
285
286
|
children: [
|
|
286
|
-
!e.isActive && /* @__PURE__ */
|
|
287
|
+
!e.isActive && /* @__PURE__ */ g("span", {
|
|
287
288
|
className: "absolute top-4 right-4 px-2 py-1 text-xs font-medium bg-muted text-muted-foreground rounded",
|
|
288
289
|
children: "Inactive"
|
|
289
290
|
}),
|
|
290
|
-
/* @__PURE__ */
|
|
291
|
+
/* @__PURE__ */ _("div", {
|
|
291
292
|
className: "mb-4",
|
|
292
|
-
children: [/* @__PURE__ */
|
|
293
|
+
children: [/* @__PURE__ */ g("h3", {
|
|
293
294
|
className: "text-xl font-bold text-foreground",
|
|
294
295
|
children: e.name
|
|
295
|
-
}), /* @__PURE__ */
|
|
296
|
+
}), /* @__PURE__ */ g("span", {
|
|
296
297
|
className: "text-sm text-muted-foreground",
|
|
297
298
|
children: a(e.duration)
|
|
298
299
|
})]
|
|
299
300
|
}),
|
|
300
|
-
/* @__PURE__ */
|
|
301
|
+
/* @__PURE__ */ _("div", {
|
|
301
302
|
className: "flex items-baseline gap-1 mb-1",
|
|
302
|
-
children: [/* @__PURE__ */
|
|
303
|
+
children: [/* @__PURE__ */ g("span", {
|
|
303
304
|
className: "text-3xl font-bold text-foreground",
|
|
304
305
|
children: (() => {
|
|
305
306
|
let t = e.pricingModel === n.PER_SEAT && e.pricePerSeat ? {
|
|
@@ -308,68 +309,68 @@ var y = () => {
|
|
|
308
309
|
} : {
|
|
309
310
|
price: e.price,
|
|
310
311
|
currency: e.currency
|
|
311
|
-
}, { price: i, currency: a } =
|
|
312
|
+
}, { price: i, currency: a } = u(t.price, t.currency, e.currencyPrices, p);
|
|
312
313
|
return r(i, a);
|
|
313
314
|
})()
|
|
314
|
-
}), /* @__PURE__ */
|
|
315
|
+
}), /* @__PURE__ */ _("span", {
|
|
315
316
|
className: "text-muted-foreground",
|
|
316
317
|
children: ["/ ", i(e.duration)]
|
|
317
318
|
})]
|
|
318
319
|
}),
|
|
319
|
-
e.pricingModel === n.PER_SEAT && /* @__PURE__ */
|
|
320
|
+
e.pricingModel === n.PER_SEAT && /* @__PURE__ */ _("p", {
|
|
320
321
|
className: "text-xs text-muted-foreground mb-4",
|
|
321
322
|
children: ["per seat", e.minSeats ? ` · min ${e.minSeats} seat${e.minSeats === 1 ? "" : "s"}` : ""]
|
|
322
323
|
}),
|
|
323
|
-
e.pricingModel !== n.PER_SEAT && /* @__PURE__ */
|
|
324
|
-
|
|
324
|
+
e.pricingModel !== n.PER_SEAT && /* @__PURE__ */ g("div", { className: "mb-6" }),
|
|
325
|
+
h.length > 0 && /* @__PURE__ */ _("ul", {
|
|
325
326
|
className: "space-y-2 mb-6",
|
|
326
|
-
children: [
|
|
327
|
+
children: [h.slice(0, 5).map((e) => /* @__PURE__ */ _("li", {
|
|
327
328
|
className: "flex items-center justify-between text-sm",
|
|
328
|
-
children: [/* @__PURE__ */
|
|
329
|
+
children: [/* @__PURE__ */ _("div", {
|
|
329
330
|
className: "flex items-center gap-2",
|
|
330
|
-
children: [/* @__PURE__ */
|
|
331
|
+
children: [/* @__PURE__ */ g("svg", {
|
|
331
332
|
className: "size-5 text-status-success-text shrink-0",
|
|
332
333
|
fill: "none",
|
|
333
334
|
viewBox: "0 0 24 24",
|
|
334
335
|
stroke: "currentColor",
|
|
335
|
-
children: /* @__PURE__ */
|
|
336
|
+
children: /* @__PURE__ */ g("path", {
|
|
336
337
|
strokeLinecap: "round",
|
|
337
338
|
strokeLinejoin: "round",
|
|
338
339
|
strokeWidth: 2,
|
|
339
340
|
d: "M5 13l4 4L19 7"
|
|
340
341
|
})
|
|
341
|
-
}), /* @__PURE__ */
|
|
342
|
+
}), /* @__PURE__ */ g("span", {
|
|
342
343
|
className: "text-foreground",
|
|
343
344
|
children: e.name
|
|
344
345
|
})]
|
|
345
|
-
}), /* @__PURE__ */
|
|
346
|
+
}), /* @__PURE__ */ g("span", {
|
|
346
347
|
className: "font-medium text-foreground",
|
|
347
348
|
children: e.totalValue.toLocaleString()
|
|
348
349
|
})]
|
|
349
|
-
}, e.quotaId)),
|
|
350
|
+
}, e.quotaId)), h.length > 5 && /* @__PURE__ */ _("li", {
|
|
350
351
|
className: "text-sm text-muted-foreground pl-7",
|
|
351
352
|
children: [
|
|
352
353
|
"+",
|
|
353
|
-
|
|
354
|
+
h.length - 5,
|
|
354
355
|
" more quotas"
|
|
355
356
|
]
|
|
356
357
|
})]
|
|
357
358
|
}),
|
|
358
|
-
/* @__PURE__ */
|
|
359
|
+
/* @__PURE__ */ _("div", {
|
|
359
360
|
className: "space-y-2 pt-4 border-t border-border mt-auto",
|
|
360
|
-
children: [c && e.isActive && /* @__PURE__ */
|
|
361
|
+
children: [c && e.isActive && /* @__PURE__ */ g("button", {
|
|
361
362
|
type: "button",
|
|
362
363
|
onClick: () => t(e),
|
|
363
364
|
className: "w-full px-4 py-2 text-sm font-medium bg-primary text-primary-foreground rounded-md hover:bg-primary/90 transition-colors",
|
|
364
365
|
children: "Select Plan"
|
|
365
|
-
}), /* @__PURE__ */
|
|
366
|
+
}), /* @__PURE__ */ _("div", {
|
|
366
367
|
className: "flex gap-2",
|
|
367
|
-
children: [/* @__PURE__ */
|
|
368
|
+
children: [/* @__PURE__ */ g("button", {
|
|
368
369
|
type: "button",
|
|
369
370
|
onClick: () => o(e),
|
|
370
371
|
className: "flex-1 px-4 py-2 text-sm font-medium border border-border text-foreground rounded-md hover:bg-muted transition-colors",
|
|
371
372
|
children: "View Details"
|
|
372
|
-
}),
|
|
373
|
+
}), l && /* @__PURE__ */ g("button", {
|
|
373
374
|
type: "button",
|
|
374
375
|
onClick: () => s(e),
|
|
375
376
|
disabled: f,
|
|
@@ -380,23 +381,23 @@ var y = () => {
|
|
|
380
381
|
})
|
|
381
382
|
]
|
|
382
383
|
});
|
|
383
|
-
},
|
|
384
|
-
let
|
|
385
|
-
return /* @__PURE__ */
|
|
384
|
+
}, S = ({ plan: e, onSelect: t, onView: n, onToggle: a, canSelect: o, canManage: s, isToggling: c }) => {
|
|
385
|
+
let l = d(), f = m(() => y(e.features || []), [e.features]);
|
|
386
|
+
return /* @__PURE__ */ _("div", {
|
|
386
387
|
className: `flex items-center gap-4 p-4 border rounded-lg transition-all hover:shadow-sm ${e.isActive ? "border-border bg-card" : "border-dashed border-muted-foreground/30 bg-muted/30"}`,
|
|
387
388
|
children: [
|
|
388
|
-
/* @__PURE__ */
|
|
389
|
+
/* @__PURE__ */ _("div", {
|
|
389
390
|
className: "flex-1 min-w-0",
|
|
390
|
-
children: [/* @__PURE__ */
|
|
391
|
+
children: [/* @__PURE__ */ _("div", {
|
|
391
392
|
className: "flex items-center gap-2",
|
|
392
|
-
children: [/* @__PURE__ */
|
|
393
|
+
children: [/* @__PURE__ */ g("h3", {
|
|
393
394
|
className: "font-semibold text-foreground truncate",
|
|
394
395
|
children: e.name
|
|
395
|
-
}), !e.isActive && /* @__PURE__ */
|
|
396
|
+
}), !e.isActive && /* @__PURE__ */ g("span", {
|
|
396
397
|
className: "px-2 py-0.5 text-xs font-medium bg-muted text-muted-foreground rounded",
|
|
397
398
|
children: "Inactive"
|
|
398
399
|
})]
|
|
399
|
-
}), /* @__PURE__ */
|
|
400
|
+
}), /* @__PURE__ */ _("p", {
|
|
400
401
|
className: "text-sm text-muted-foreground",
|
|
401
402
|
children: [
|
|
402
403
|
f.length,
|
|
@@ -406,35 +407,35 @@ var y = () => {
|
|
|
406
407
|
]
|
|
407
408
|
})]
|
|
408
409
|
}),
|
|
409
|
-
/* @__PURE__ */
|
|
410
|
+
/* @__PURE__ */ _("div", {
|
|
410
411
|
className: "text-right",
|
|
411
|
-
children: [/* @__PURE__ */
|
|
412
|
+
children: [/* @__PURE__ */ g("div", {
|
|
412
413
|
className: "font-semibold text-foreground",
|
|
413
414
|
children: (() => {
|
|
414
|
-
let { price: t, currency: n } =
|
|
415
|
+
let { price: t, currency: n } = u(e.price, e.currency, e.currencyPrices, l);
|
|
415
416
|
return r(t, n);
|
|
416
417
|
})()
|
|
417
|
-
}), /* @__PURE__ */
|
|
418
|
+
}), /* @__PURE__ */ _("div", {
|
|
418
419
|
className: "text-sm text-muted-foreground",
|
|
419
420
|
children: ["per ", i(e.duration)]
|
|
420
421
|
})]
|
|
421
422
|
}),
|
|
422
|
-
/* @__PURE__ */
|
|
423
|
+
/* @__PURE__ */ _("div", {
|
|
423
424
|
className: "flex items-center gap-2",
|
|
424
425
|
children: [
|
|
425
|
-
o && e.isActive && /* @__PURE__ */
|
|
426
|
+
o && e.isActive && /* @__PURE__ */ g("button", {
|
|
426
427
|
type: "button",
|
|
427
428
|
onClick: () => t(e),
|
|
428
429
|
className: "px-3 py-1.5 text-sm font-medium bg-primary text-primary-foreground rounded-md hover:bg-primary/90 transition-colors",
|
|
429
430
|
children: "Select"
|
|
430
431
|
}),
|
|
431
|
-
/* @__PURE__ */
|
|
432
|
+
/* @__PURE__ */ g("button", {
|
|
432
433
|
type: "button",
|
|
433
434
|
onClick: () => n(e),
|
|
434
435
|
className: "px-3 py-1.5 text-sm font-medium border border-border text-foreground rounded-md hover:bg-muted transition-colors",
|
|
435
436
|
children: "View"
|
|
436
437
|
}),
|
|
437
|
-
s && /* @__PURE__ */
|
|
438
|
+
s && /* @__PURE__ */ g("button", {
|
|
438
439
|
type: "button",
|
|
439
440
|
onClick: () => a(e),
|
|
440
441
|
disabled: c,
|
|
@@ -447,6 +448,6 @@ var y = () => {
|
|
|
447
448
|
});
|
|
448
449
|
};
|
|
449
450
|
//#endregion
|
|
450
|
-
export {
|
|
451
|
+
export { b as PlansListPage };
|
|
451
452
|
|
|
452
453
|
//# sourceMappingURL=PlansListPage.js.map
|