@burdenoff/microfe-billing 2026.1113.2 → 2026.1113.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/dist/billing/BillingRoot.js +83 -77
  2. package/dist/billing/BillingRoot.js.map +1 -1
  3. package/dist/billing/modules/addons/pages/AddonBrowseDetailPage.js +78 -78
  4. package/dist/billing/modules/addons/pages/AddonCreatePage.js +70 -70
  5. package/dist/billing/modules/addons/pages/AddonDetailPage.js +72 -72
  6. package/dist/billing/modules/addons/pages/AddonEditPage.js +79 -79
  7. package/dist/billing/modules/addons/pages/AddonsBrowsePage.js +224 -224
  8. package/dist/billing/modules/addons/pages/AddonsListPage.js +186 -186
  9. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js +168 -168
  10. package/dist/billing/modules/affiliate/pages/AffiliateDashboardPage.js.map +1 -1
  11. package/dist/billing/modules/analytics/pages/AnalyticsPage.js +88 -88
  12. package/dist/billing/modules/billing/hooks/index.js +5 -5
  13. package/dist/billing/modules/billing/hooks/useInvoices.js +39 -20
  14. package/dist/billing/modules/billing/hooks/useInvoices.js.map +1 -1
  15. package/dist/billing/modules/billing/index.js +14 -14
  16. package/dist/billing/modules/billing/pages/BillingWebhookLogsPage.js +92 -92
  17. package/dist/billing/modules/billing/pages/InvoiceDetailPage.js +160 -160
  18. package/dist/billing/modules/billing/pages/InvoiceDetailPage.js.map +1 -1
  19. package/dist/billing/modules/billing/pages/InvoicesListPage.js +100 -100
  20. package/dist/billing/modules/billing/pages/OrderCallbackLogsPage.js +105 -105
  21. package/dist/billing/modules/billing/pages/PaymentMethodsPage.js +37 -37
  22. package/dist/billing/modules/billing/pages/RefundIssueLogsPage.js +41 -41
  23. package/dist/billing/modules/billing/pages/RefundsPage.js +334 -334
  24. package/dist/billing/modules/billing/pages/RefundsPage.js.map +1 -1
  25. package/dist/billing/modules/billing/pages/TransactionsPage.js +174 -174
  26. package/dist/billing/modules/billing/pages/TransactionsPage.js.map +1 -1
  27. package/dist/billing/modules/billing/pages/UserRefundsPage.js +24 -24
  28. package/dist/billing/modules/billing/pages/UserRefundsPage.js.map +1 -1
  29. package/dist/billing/modules/checkout/components/OrderSummary.js +71 -71
  30. package/dist/billing/modules/checkout/pages/CheckoutPage.js +646 -625
  31. package/dist/billing/modules/checkout/pages/CheckoutPage.js.map +1 -1
  32. package/dist/billing/modules/checkout/utils/checkoutOptions.d.ts +23 -0
  33. package/dist/billing/modules/checkout/utils/checkoutOptions.js +8 -0
  34. package/dist/billing/modules/checkout/utils/checkoutOptions.js.map +1 -0
  35. package/dist/billing/modules/coupons/pages/CouponDetailPage.js +112 -112
  36. package/dist/billing/modules/coupons/pages/CouponsListPage.js +118 -118
  37. package/dist/billing/modules/coupons/pages/CouponsListPage.js.map +1 -1
  38. package/dist/billing/modules/coupons/pages/CreateCouponPage.js +119 -119
  39. package/dist/billing/modules/coupons/pages/EditCouponPage.js +82 -82
  40. package/dist/billing/modules/credits/pages/AdminCreditsPage.js +30 -30
  41. package/dist/billing/modules/credits/pages/CreditTransactionsPage.js +77 -77
  42. package/dist/billing/modules/credits/pages/CreditWithdrawalPage.js +144 -144
  43. package/dist/billing/modules/credits/pages/CreditsPage.js +67 -67
  44. package/dist/billing/modules/dashboard/pages/OverviewPage.js +594 -442
  45. package/dist/billing/modules/dashboard/pages/OverviewPage.js.map +1 -1
  46. package/dist/billing/modules/dashboard/utils/overviewSummary.d.ts +46 -0
  47. package/dist/billing/modules/dashboard/utils/overviewSummary.js +37 -0
  48. package/dist/billing/modules/dashboard/utils/overviewSummary.js.map +1 -0
  49. package/dist/billing/modules/discounts/pages/DiscountsListPage.js +199 -199
  50. package/dist/billing/modules/discounts/pages/DiscountsListPage.js.map +1 -1
  51. package/dist/billing/modules/earnings/pages/DeveloperRevenueAdminPage.js +64 -64
  52. package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js +122 -122
  53. package/dist/billing/modules/earnings/pages/DeveloperRevenueOrgDetailPage.js.map +1 -1
  54. package/dist/billing/modules/earnings/pages/EarningsPage.js +102 -102
  55. package/dist/billing/modules/earnings/pages/EarningsPage.js.map +1 -1
  56. package/dist/billing/modules/earnings/pages/PayoutAdminPage.js +178 -178
  57. package/dist/billing/modules/earnings/pages/PayoutAdminPage.js.map +1 -1
  58. package/dist/billing/modules/earnings/pages/PayoutsPage.js +107 -107
  59. package/dist/billing/modules/earnings/pages/PayoutsPage.js.map +1 -1
  60. package/dist/billing/modules/plans/pages/PlanAssignFreePage.js +54 -54
  61. package/dist/billing/modules/plans/pages/PlanBrowseDetailPage.js +94 -94
  62. package/dist/billing/modules/plans/pages/PlanCreatePage.js +73 -73
  63. package/dist/billing/modules/plans/pages/PlanDetailPage.js +96 -96
  64. package/dist/billing/modules/plans/pages/PlanEditPage.js +16 -16
  65. package/dist/billing/modules/plans/pages/PlanEditPage.js.map +1 -1
  66. package/dist/billing/modules/plans/pages/PlansBrowsePage.js +100 -100
  67. package/dist/billing/modules/plans/pages/PlansListPage.js +88 -88
  68. package/dist/billing/modules/promotions/pages/CreatePromotionPage.js +60 -60
  69. package/dist/billing/modules/promotions/pages/PromotionsListPage.js +37 -37
  70. package/dist/billing/modules/quota/pages/QuotaAssignFreePage.js +62 -62
  71. package/dist/billing/modules/quota/pages/QuotaPage.js +1 -1
  72. package/dist/billing/modules/quota/pages/QuotaTemplateCreatePage.js +69 -69
  73. package/dist/billing/modules/quota/pages/QuotaTemplateDetailPage.js +76 -76
  74. package/dist/billing/modules/quota/pages/QuotaTemplateEditPage.js +80 -80
  75. package/dist/billing/modules/quota/pages/QuotaTemplatesListPage.js +95 -95
  76. package/dist/billing/modules/settings/pages/SettingsPage.js +134 -134
  77. package/dist/billing/modules/settings/pages/SettingsPage.js.map +1 -1
  78. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js +62 -62
  79. package/dist/billing/modules/settings/pages/TeamPermissionsPage.js.map +1 -1
  80. package/dist/billing/modules/subscriptions/components/ManageSeatsModal.js +36 -36
  81. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js +534 -410
  82. package/dist/billing/modules/subscriptions/pages/SubscriptionDetailPage.js.map +1 -1
  83. package/dist/billing/modules/subscriptions/pages/SubscriptionsListPage.js +111 -111
  84. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js +166 -160
  85. package/dist/billing/modules/subscriptions/pages/UpgradeSubscriptionPage.js.map +1 -1
  86. package/dist/billing/modules/subscriptions/utils/subscriptionDetailView.d.ts +30 -0
  87. package/dist/billing/modules/subscriptions/utils/subscriptionDetailView.js +20 -0
  88. package/dist/billing/modules/subscriptions/utils/subscriptionDetailView.js.map +1 -0
  89. package/dist/billing/modules/subscriptions/utils/upgradeAccess.d.ts +10 -0
  90. package/dist/billing/modules/subscriptions/utils/upgradeAccess.js +7 -0
  91. package/dist/billing/modules/subscriptions/utils/upgradeAccess.js.map +1 -0
  92. package/dist/billing/modules/usage/pages/UsagePage.js +722 -591
  93. package/dist/billing/modules/usage/pages/UsagePage.js.map +1 -1
  94. package/dist/billing/modules/usage/utils/usageHealth.d.ts +63 -0
  95. package/dist/billing/modules/usage/utils/usageHealth.js +43 -0
  96. package/dist/billing/modules/usage/utils/usageHealth.js.map +1 -0
  97. package/dist/billing/shared/components/EmptyState.js +3 -3
  98. package/dist/billing/shared/components/MoneyActionDialog.js +12 -12
  99. package/dist/billing/shared/ui/MetricCard.js +13 -13
  100. package/dist/billing/shared/utils/format.js +16 -4
  101. package/dist/billing/shared/utils/format.js.map +1 -1
  102. package/dist/billing/shared/utils/index.js +8 -8
  103. package/dist/generated/global-operations.js +294 -286
  104. package/dist/generated/global-operations.js.map +1 -1
  105. package/package.json +2 -2
@@ -5,10 +5,10 @@ import { useBillingPermissions as r } from "../../../hooks/useBillingPermissions
5
5
  import "../../../shared/components/index.js";
6
6
  import { useCreateCouponMutation as i } from "../../../../generated/global-operations.js";
7
7
  import { useRef as a, useState as o } from "react";
8
- import { ArrowLeft as s, Package as c, Percent as l, Save as u, Tag as d, Users as f, X as p } from "lucide-react";
9
- import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
10
- import { useI18n as _ } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
11
- import { PagePurpose as v } from "@burdenoff/fe-libs/ui";
8
+ import { PagePurpose as s } from "@burdenoff/fe-libs/ui";
9
+ import { ArrowLeft as c, Package as l, Percent as u, Save as d, Tag as f, Users as p, X as m } from "lucide-react";
10
+ import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
11
+ import { useI18n as v } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
12
12
  // src/billing/modules/coupons/pages/CreateCouponPage.tsx
13
13
  var y = [
14
14
  {
@@ -100,7 +100,7 @@ var y = [
100
100
  label: "Store purchases"
101
101
  }
102
102
  ], S = () => {
103
- let { t: S } = _(), C = (e, t) => {
103
+ let { t: S } = v(), C = (e, t) => {
104
104
  let n = S(e);
105
105
  return n === e ? t : n;
106
106
  }, w = n(), T = r(), [E, D] = o(""), O = a(null), [k, A] = o({
@@ -124,7 +124,7 @@ var y = [
124
124
  applicableEntityTypes: [],
125
125
  campaignName: ""
126
126
  }), [j, M] = o({}), [N, P] = o(!1), F = y.find((e) => e.code === k.currency)?.symbol ?? k.currency, [I] = i({ refetchQueries: ["ListCoupons"] });
127
- if (!T.canManageDiscounts) return /* @__PURE__ */ h(e, { message: "You don't have permission to create coupons." });
127
+ if (!T.canManageDiscounts) return /* @__PURE__ */ g(e, { message: "You don't have permission to create coupons." });
128
128
  let L = (e, t) => {
129
129
  A((n) => ({
130
130
  ...n,
@@ -146,24 +146,24 @@ var y = [
146
146
  }, H = (e) => {
147
147
  L("applicableEntityTypes", k.applicableEntityTypes.includes(e) ? k.applicableEntityTypes.filter((t) => t !== e) : [...k.applicableEntityTypes, e]);
148
148
  };
149
- return /* @__PURE__ */ g("div", {
149
+ return /* @__PURE__ */ _("div", {
150
150
  className: "max-w-4xl mx-auto p-4 sm:p-6 space-y-6",
151
151
  children: [
152
- /* @__PURE__ */ g("div", {
152
+ /* @__PURE__ */ _("div", {
153
153
  className: "flex items-center gap-4",
154
- children: [/* @__PURE__ */ h("button", {
154
+ children: [/* @__PURE__ */ g("button", {
155
155
  type: "button",
156
156
  onClick: () => w("/coupons"),
157
157
  className: "p-2 rounded-lg hover:bg-bg-sunken text-text-muted hover:text-text-primary",
158
- children: /* @__PURE__ */ h(s, { className: "size-5" })
159
- }), /* @__PURE__ */ h(t, {
158
+ children: /* @__PURE__ */ g(c, { className: "size-5" })
159
+ }), /* @__PURE__ */ g(t, {
160
160
  title: C("billing.coupons.createTitle", "Create Coupon"),
161
161
  description: "Create a new discount code or promotional offer",
162
- icon: /* @__PURE__ */ h(d, { className: "size-6" })
162
+ icon: /* @__PURE__ */ g(f, { className: "size-6" })
163
163
  })]
164
164
  }),
165
- /* @__PURE__ */ h(v, { children: C("billing.coupons.createPurpose", "Define a new discount code customers can redeem at checkout. Choose whether it takes a percentage or fixed amount off, set any usage limit and expiry, and pick which products it applies to.") }),
166
- /* @__PURE__ */ g("form", {
165
+ /* @__PURE__ */ g(s, { children: C("billing.coupons.createPurpose", "Define a new discount code customers can redeem at checkout. Choose whether it takes a percentage or fixed amount off, set any usage limit and expiry, and pick which products it applies to.") }),
166
+ /* @__PURE__ */ _("form", {
167
167
  onSubmit: async (e) => {
168
168
  if (e.preventDefault(), R()) {
169
169
  P(!0);
@@ -204,55 +204,55 @@ var y = [
204
204
  },
205
205
  className: "space-y-6",
206
206
  children: [
207
- /* @__PURE__ */ g("div", {
207
+ /* @__PURE__ */ _("div", {
208
208
  className: "bg-bg-surface border border-border-subtle rounded-lg p-6 space-y-4",
209
209
  children: [
210
- /* @__PURE__ */ h("h3", {
210
+ /* @__PURE__ */ g("h3", {
211
211
  className: "text-lg font-semibold text-text-primary",
212
212
  children: "Basic Information"
213
213
  }),
214
- /* @__PURE__ */ g("div", { children: [
215
- /* @__PURE__ */ h("label", {
214
+ /* @__PURE__ */ _("div", { children: [
215
+ /* @__PURE__ */ g("label", {
216
216
  className: "block text-sm font-medium text-text-primary mb-1",
217
217
  children: "Coupon Code *"
218
218
  }),
219
- /* @__PURE__ */ h("input", {
219
+ /* @__PURE__ */ g("input", {
220
220
  type: "text",
221
221
  value: k.code,
222
222
  onChange: (e) => L("code", e.target.value.toUpperCase()),
223
223
  placeholder: "e.g., WELCOME20",
224
224
  className: `w-full px-4 py-2 rounded-input border ${j.code ? "border-status-error-border" : "border-border-subtle"} bg-bg-surface text-text-primary placeholder:text-text-muted focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]`
225
225
  }),
226
- j.code && /* @__PURE__ */ h("p", {
226
+ j.code && /* @__PURE__ */ g("p", {
227
227
  className: "text-sm text-status-error-text mt-1",
228
228
  children: j.code
229
229
  }),
230
- /* @__PURE__ */ h("p", {
230
+ /* @__PURE__ */ g("p", {
231
231
  className: "text-xs text-text-muted mt-1",
232
232
  children: "Use uppercase letters, numbers, hyphens, and underscores"
233
233
  })
234
234
  ] }),
235
- /* @__PURE__ */ g("div", { children: [
236
- /* @__PURE__ */ h("label", {
235
+ /* @__PURE__ */ _("div", { children: [
236
+ /* @__PURE__ */ g("label", {
237
237
  className: "block text-sm font-medium text-text-primary mb-1",
238
238
  children: "Display Name *"
239
239
  }),
240
- /* @__PURE__ */ h("input", {
240
+ /* @__PURE__ */ g("input", {
241
241
  type: "text",
242
242
  value: k.name,
243
243
  onChange: (e) => L("name", e.target.value),
244
244
  placeholder: "e.g., Welcome 20% Off",
245
245
  className: `w-full px-4 py-2 rounded-input border ${j.name ? "border-status-error-border" : "border-border-subtle"} bg-bg-surface text-text-primary placeholder:text-text-muted focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]`
246
246
  }),
247
- j.name && /* @__PURE__ */ h("p", {
247
+ j.name && /* @__PURE__ */ g("p", {
248
248
  className: "text-sm text-status-error-text mt-1",
249
249
  children: j.name
250
250
  })
251
251
  ] }),
252
- /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("label", {
252
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("label", {
253
253
  className: "block text-sm font-medium text-text-primary mb-1",
254
254
  children: "Description"
255
- }), /* @__PURE__ */ h("textarea", {
255
+ }), /* @__PURE__ */ g("textarea", {
256
256
  value: k.description,
257
257
  onChange: (e) => L("description", e.target.value),
258
258
  placeholder: "Optional description for internal use",
@@ -261,23 +261,23 @@ var y = [
261
261
  })] })
262
262
  ]
263
263
  }),
264
- /* @__PURE__ */ g("div", {
264
+ /* @__PURE__ */ _("div", {
265
265
  className: "bg-bg-surface border border-border-subtle rounded-lg p-6 space-y-4",
266
266
  children: [
267
- /* @__PURE__ */ h("h3", {
267
+ /* @__PURE__ */ g("h3", {
268
268
  className: "text-lg font-semibold text-text-primary",
269
269
  children: "Discount Configuration"
270
270
  }),
271
- /* @__PURE__ */ g("div", { children: [
272
- /* @__PURE__ */ h("label", {
271
+ /* @__PURE__ */ _("div", { children: [
272
+ /* @__PURE__ */ g("label", {
273
273
  className: "block text-sm font-medium text-text-primary mb-1",
274
274
  children: "Coupon Currency *"
275
275
  }),
276
- /* @__PURE__ */ h("select", {
276
+ /* @__PURE__ */ g("select", {
277
277
  value: k.currency,
278
278
  onChange: (e) => L("currency", e.target.value),
279
279
  className: "w-full px-4 py-2 rounded-input border border-border-subtle bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
280
- children: y.map(({ code: e, symbol: t, name: n }) => /* @__PURE__ */ g("option", {
280
+ children: y.map(({ code: e, symbol: t, name: n }) => /* @__PURE__ */ _("option", {
281
281
  value: e,
282
282
  children: [
283
283
  t,
@@ -288,21 +288,21 @@ var y = [
288
288
  ]
289
289
  }, e))
290
290
  }),
291
- /* @__PURE__ */ h("p", {
291
+ /* @__PURE__ */ g("p", {
292
292
  className: "text-xs text-text-muted mt-1",
293
293
  children: "Amounts below are in this currency. Users paying in a different currency (e.g. INR) will have the amounts automatically converted using live exchange rates at validation time."
294
294
  })
295
295
  ] }),
296
- /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("label", {
296
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("label", {
297
297
  className: "block text-sm font-medium text-text-primary mb-2",
298
298
  children: "Discount Type *"
299
- }), /* @__PURE__ */ h("div", {
299
+ }), /* @__PURE__ */ g("div", {
300
300
  className: "grid grid-cols-3 gap-3",
301
301
  children: [
302
302
  {
303
303
  value: "PERCENTAGE",
304
304
  label: "Percentage",
305
- icon: l
305
+ icon: u
306
306
  },
307
307
  {
308
308
  value: "FIXED_AMOUNT",
@@ -312,29 +312,29 @@ var y = [
312
312
  {
313
313
  value: "FREE_SHIPPING",
314
314
  label: "Free Shipping",
315
- icon: c
315
+ icon: l
316
316
  }
317
- ].map(({ value: e, label: t, icon: n }) => /* @__PURE__ */ g("button", {
317
+ ].map(({ value: e, label: t, icon: n }) => /* @__PURE__ */ _("button", {
318
318
  type: "button",
319
319
  onClick: () => L("type", e),
320
320
  className: `p-4 rounded-lg border-2 transition-colors ${k.type === e ? "border-action-primary-bg bg-[var(--color-accent-soft)]" : "border-border-subtle hover:border-action-primary-bg/50"}`,
321
- children: [n ? /* @__PURE__ */ h(n, { className: "size-5 mx-auto mb-2" }) : /* @__PURE__ */ h("span", {
321
+ children: [n ? /* @__PURE__ */ g(n, { className: "size-5 mx-auto mb-2" }) : /* @__PURE__ */ g("span", {
322
322
  className: "block text-lg font-bold mb-2",
323
323
  children: F
324
- }), /* @__PURE__ */ h("p", {
324
+ }), /* @__PURE__ */ g("p", {
325
325
  className: "text-sm font-medium",
326
326
  children: t
327
327
  })]
328
328
  }, e))
329
329
  })] }),
330
- /* @__PURE__ */ g("div", { children: [
331
- /* @__PURE__ */ h("label", {
330
+ /* @__PURE__ */ _("div", { children: [
331
+ /* @__PURE__ */ g("label", {
332
332
  className: "block text-sm font-medium text-text-primary mb-1",
333
333
  children: "Discount Value *"
334
334
  }),
335
- /* @__PURE__ */ h("div", {
335
+ /* @__PURE__ */ g("div", {
336
336
  className: "relative",
337
- children: k.type === "PERCENTAGE" ? /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(l, { className: "absolute left-3 top-1/2 -translate-y-1/2 size-4 text-text-muted" }), /* @__PURE__ */ h("input", {
337
+ children: k.type === "PERCENTAGE" ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(u, { className: "absolute left-3 top-1/2 -translate-y-1/2 size-4 text-text-muted" }), /* @__PURE__ */ g("input", {
338
338
  type: "number",
339
339
  value: k.value,
340
340
  onChange: (e) => L("value", parseFloat(e.target.value)),
@@ -342,10 +342,10 @@ var y = [
342
342
  max: "100",
343
343
  step: "0.01",
344
344
  className: `w-full pl-10 pr-4 py-2 rounded-input border ${j.value ? "border-status-error-border" : "border-border-subtle"} bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]`
345
- })] }) : /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("span", {
345
+ })] }) : /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("span", {
346
346
  className: "absolute left-3 top-1/2 -translate-y-1/2 text-sm text-text-muted font-medium",
347
347
  children: F
348
- }), /* @__PURE__ */ h("input", {
348
+ }), /* @__PURE__ */ g("input", {
349
349
  type: "number",
350
350
  value: k.value,
351
351
  onChange: (e) => L("value", parseFloat(e.target.value)),
@@ -354,13 +354,13 @@ var y = [
354
354
  className: `w-full pl-10 pr-4 py-2 rounded-input border ${j.value ? "border-status-error-border" : "border-border-subtle"} bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]`
355
355
  })] })
356
356
  }),
357
- j.value && /* @__PURE__ */ h("p", {
357
+ j.value && /* @__PURE__ */ g("p", {
358
358
  className: "text-sm text-status-error-text mt-1",
359
359
  children: j.value
360
360
  })
361
361
  ] }),
362
- /* @__PURE__ */ g("div", { children: [
363
- /* @__PURE__ */ g("label", {
362
+ /* @__PURE__ */ _("div", { children: [
363
+ /* @__PURE__ */ _("label", {
364
364
  className: "block text-sm font-medium text-text-primary mb-1",
365
365
  children: [
366
366
  "Minimum Purchase Amount (",
@@ -368,12 +368,12 @@ var y = [
368
368
  ")"
369
369
  ]
370
370
  }),
371
- /* @__PURE__ */ g("div", {
371
+ /* @__PURE__ */ _("div", {
372
372
  className: "relative",
373
- children: [/* @__PURE__ */ h("span", {
373
+ children: [/* @__PURE__ */ g("span", {
374
374
  className: "absolute left-3 top-1/2 -translate-y-1/2 text-sm text-text-muted font-medium",
375
375
  children: F
376
- }), /* @__PURE__ */ h("input", {
376
+ }), /* @__PURE__ */ g("input", {
377
377
  type: "number",
378
378
  value: k.minPurchaseAmount || "",
379
379
  onChange: (e) => L("minPurchaseAmount", e.target.value ? parseFloat(e.target.value) : null),
@@ -383,7 +383,7 @@ var y = [
383
383
  className: "w-full pl-10 pr-4 py-2 rounded-input border border-border-subtle bg-bg-surface text-text-primary placeholder:text-text-muted focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
384
384
  })]
385
385
  }),
386
- /* @__PURE__ */ g("p", {
386
+ /* @__PURE__ */ _("p", {
387
387
  className: "text-xs text-text-muted mt-1",
388
388
  children: [
389
389
  "Order must be at least this amount in ",
@@ -392,8 +392,8 @@ var y = [
392
392
  ]
393
393
  })
394
394
  ] }),
395
- k.type === "PERCENTAGE" && /* @__PURE__ */ g("div", { children: [
396
- /* @__PURE__ */ g("label", {
395
+ k.type === "PERCENTAGE" && /* @__PURE__ */ _("div", { children: [
396
+ /* @__PURE__ */ _("label", {
397
397
  className: "block text-sm font-medium text-text-primary mb-1",
398
398
  children: [
399
399
  "Maximum Discount Amount (",
@@ -401,12 +401,12 @@ var y = [
401
401
  ")"
402
402
  ]
403
403
  }),
404
- /* @__PURE__ */ g("div", {
404
+ /* @__PURE__ */ _("div", {
405
405
  className: "relative",
406
- children: [/* @__PURE__ */ h("span", {
406
+ children: [/* @__PURE__ */ g("span", {
407
407
  className: "absolute left-3 top-1/2 -translate-y-1/2 text-sm text-text-muted font-medium",
408
408
  children: F
409
- }), /* @__PURE__ */ h("input", {
409
+ }), /* @__PURE__ */ g("input", {
410
410
  type: "number",
411
411
  value: k.maxDiscountAmount || "",
412
412
  onChange: (e) => L("maxDiscountAmount", e.target.value ? parseFloat(e.target.value) : null),
@@ -416,7 +416,7 @@ var y = [
416
416
  className: "w-full pl-10 pr-4 py-2 rounded-input border border-border-subtle bg-bg-surface text-text-primary placeholder:text-text-muted focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
417
417
  })]
418
418
  }),
419
- /* @__PURE__ */ g("p", {
419
+ /* @__PURE__ */ _("p", {
420
420
  className: "text-xs text-text-muted mt-1",
421
421
  children: [
422
422
  "Cap the discount in ",
@@ -427,19 +427,19 @@ var y = [
427
427
  ] })
428
428
  ]
429
429
  }),
430
- /* @__PURE__ */ g("div", {
430
+ /* @__PURE__ */ _("div", {
431
431
  className: "bg-bg-surface border border-border-subtle rounded-lg p-6 space-y-4",
432
432
  children: [
433
- /* @__PURE__ */ h("h3", {
433
+ /* @__PURE__ */ g("h3", {
434
434
  className: "text-lg font-semibold text-text-primary",
435
435
  children: "Usage Limits"
436
436
  }),
437
- /* @__PURE__ */ g("div", { children: [
438
- /* @__PURE__ */ h("label", {
437
+ /* @__PURE__ */ _("div", { children: [
438
+ /* @__PURE__ */ g("label", {
439
439
  className: "block text-sm font-medium text-text-primary mb-1",
440
440
  children: "Total Usage Limit"
441
441
  }),
442
- /* @__PURE__ */ h("input", {
442
+ /* @__PURE__ */ g("input", {
443
443
  type: "number",
444
444
  value: k.maxTotalUses || "",
445
445
  onChange: (e) => L("maxTotalUses", e.target.value ? parseInt(e.target.value) : null),
@@ -447,186 +447,186 @@ var y = [
447
447
  placeholder: "Unlimited",
448
448
  className: "w-full px-4 py-2 rounded-input border border-border-subtle bg-bg-surface text-text-primary placeholder:text-text-muted focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
449
449
  }),
450
- /* @__PURE__ */ h("p", {
450
+ /* @__PURE__ */ g("p", {
451
451
  className: "text-xs text-text-muted mt-1",
452
452
  children: "Maximum number of times this coupon can be used across all users"
453
453
  })
454
454
  ] }),
455
- /* @__PURE__ */ g("div", { children: [
456
- /* @__PURE__ */ h("label", {
455
+ /* @__PURE__ */ _("div", { children: [
456
+ /* @__PURE__ */ g("label", {
457
457
  className: "block text-sm font-medium text-text-primary mb-1",
458
458
  children: "Per-User Limit *"
459
459
  }),
460
- /* @__PURE__ */ h("input", {
460
+ /* @__PURE__ */ g("input", {
461
461
  type: "number",
462
462
  value: k.maxUsesPerUser,
463
463
  onChange: (e) => L("maxUsesPerUser", parseInt(e.target.value)),
464
464
  min: "1",
465
465
  className: "w-full px-4 py-2 rounded-input border border-border-subtle bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
466
466
  }),
467
- /* @__PURE__ */ h("p", {
467
+ /* @__PURE__ */ g("p", {
468
468
  className: "text-xs text-text-muted mt-1",
469
469
  children: "Maximum times a single user can use this coupon"
470
470
  })
471
471
  ] })
472
472
  ]
473
473
  }),
474
- /* @__PURE__ */ g("div", {
474
+ /* @__PURE__ */ _("div", {
475
475
  className: "bg-bg-surface border border-border-subtle rounded-lg p-6 space-y-4",
476
- children: [/* @__PURE__ */ h("h3", {
476
+ children: [/* @__PURE__ */ g("h3", {
477
477
  className: "text-lg font-semibold text-text-primary",
478
478
  children: "Validity Period"
479
- }), /* @__PURE__ */ g("div", {
479
+ }), /* @__PURE__ */ _("div", {
480
480
  className: "grid grid-cols-1 md:grid-cols-2 gap-4",
481
- children: [/* @__PURE__ */ g("div", { children: [
482
- /* @__PURE__ */ h("label", {
481
+ children: [/* @__PURE__ */ _("div", { children: [
482
+ /* @__PURE__ */ g("label", {
483
483
  className: "block text-sm font-medium text-text-primary mb-1",
484
484
  children: "Start Date *"
485
485
  }),
486
- /* @__PURE__ */ h("input", {
486
+ /* @__PURE__ */ g("input", {
487
487
  type: "date",
488
488
  value: k.validFrom,
489
489
  onChange: (e) => L("validFrom", e.target.value),
490
490
  className: `w-full px-4 py-2 rounded-input border ${j.validFrom ? "border-status-error-border" : "border-border-subtle"} bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]`
491
491
  }),
492
- j.validFrom && /* @__PURE__ */ h("p", {
492
+ j.validFrom && /* @__PURE__ */ g("p", {
493
493
  className: "text-sm text-status-error-text mt-1",
494
494
  children: j.validFrom
495
495
  })
496
- ] }), /* @__PURE__ */ g("div", { children: [
497
- /* @__PURE__ */ h("label", {
496
+ ] }), /* @__PURE__ */ _("div", { children: [
497
+ /* @__PURE__ */ g("label", {
498
498
  className: "block text-sm font-medium text-text-primary mb-1",
499
499
  children: "End Date"
500
500
  }),
501
- /* @__PURE__ */ h("input", {
501
+ /* @__PURE__ */ g("input", {
502
502
  type: "date",
503
503
  value: k.validUntil,
504
504
  onChange: (e) => L("validUntil", e.target.value),
505
505
  className: `w-full px-4 py-2 rounded-input border ${j.validUntil ? "border-status-error-border" : "border-border-subtle"} bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]`
506
506
  }),
507
- j.validUntil && /* @__PURE__ */ h("p", {
507
+ j.validUntil && /* @__PURE__ */ g("p", {
508
508
  className: "text-sm text-status-error-text mt-1",
509
509
  children: j.validUntil
510
510
  }),
511
- /* @__PURE__ */ h("p", {
511
+ /* @__PURE__ */ g("p", {
512
512
  className: "text-xs text-text-muted mt-1",
513
513
  children: "Leave empty for no expiry"
514
514
  })
515
515
  ] })]
516
516
  })]
517
517
  }),
518
- /* @__PURE__ */ g("div", {
518
+ /* @__PURE__ */ _("div", {
519
519
  className: "bg-bg-surface border border-border-subtle rounded-lg p-6 space-y-4",
520
520
  children: [
521
- /* @__PURE__ */ h("h3", {
521
+ /* @__PURE__ */ g("h3", {
522
522
  className: "text-lg font-semibold text-text-primary",
523
523
  children: "Applicability"
524
524
  }),
525
- /* @__PURE__ */ g("div", { children: [
526
- /* @__PURE__ */ h("label", {
525
+ /* @__PURE__ */ _("div", { children: [
526
+ /* @__PURE__ */ g("label", {
527
527
  className: "block text-sm font-medium text-text-primary mb-2",
528
528
  children: "Applicable Products"
529
529
  }),
530
- /* @__PURE__ */ h("div", {
530
+ /* @__PURE__ */ g("div", {
531
531
  className: "flex flex-wrap gap-2",
532
- children: b.map((e) => /* @__PURE__ */ h("button", {
532
+ children: b.map((e) => /* @__PURE__ */ g("button", {
533
533
  type: "button",
534
534
  onClick: () => V(e),
535
535
  className: `px-3 py-1.5 rounded-lg border text-sm transition-colors ${k.applicableProductIds.includes(e) ? "border-action-primary-bg bg-[var(--color-accent-soft)] text-text-link font-medium" : "border-border-subtle hover:border-action-primary-bg/50"}`,
536
536
  children: e
537
537
  }, e))
538
538
  }),
539
- /* @__PURE__ */ h("p", {
539
+ /* @__PURE__ */ g("p", {
540
540
  className: "text-xs text-text-muted mt-1",
541
541
  children: k.applicableProductIds.length === 0 ? "No selection = applies to all products" : `Applies to: ${k.applicableProductIds.join(", ")}`
542
542
  })
543
543
  ] }),
544
- /* @__PURE__ */ g("div", { children: [
545
- /* @__PURE__ */ h("label", {
544
+ /* @__PURE__ */ _("div", { children: [
545
+ /* @__PURE__ */ g("label", {
546
546
  className: "block text-sm font-medium text-text-primary mb-2",
547
547
  children: "Applicable Purchase Types"
548
548
  }),
549
- /* @__PURE__ */ h("div", {
549
+ /* @__PURE__ */ g("div", {
550
550
  className: "flex flex-wrap gap-2",
551
- children: x.map(({ value: e, label: t }) => /* @__PURE__ */ h("button", {
551
+ children: x.map(({ value: e, label: t }) => /* @__PURE__ */ g("button", {
552
552
  type: "button",
553
553
  onClick: () => H(e),
554
554
  className: `px-3 py-1.5 rounded-lg border text-sm transition-colors ${k.applicableEntityTypes.includes(e) ? "border-action-primary-bg bg-[var(--color-accent-soft)] text-text-link font-medium" : "border-border-subtle hover:border-action-primary-bg/50"}`,
555
555
  children: t
556
556
  }, e))
557
557
  }),
558
- /* @__PURE__ */ h("p", {
558
+ /* @__PURE__ */ g("p", {
559
559
  className: "text-xs text-text-muted mt-1",
560
560
  children: k.applicableEntityTypes.length === 0 ? "No selection = applies to plan, add-on, and store purchases" : `Applies to: ${k.applicableEntityTypes.join(", ")}`
561
561
  })
562
562
  ] })
563
563
  ]
564
564
  }),
565
- /* @__PURE__ */ g("div", {
565
+ /* @__PURE__ */ _("div", {
566
566
  className: "bg-bg-surface border border-border-subtle rounded-lg p-6 space-y-4",
567
567
  children: [
568
- /* @__PURE__ */ h("h3", {
568
+ /* @__PURE__ */ g("h3", {
569
569
  className: "text-lg font-semibold text-text-primary",
570
570
  children: "Coupon Scope"
571
571
  }),
572
- /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("label", {
572
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("label", {
573
573
  className: "block text-sm font-medium text-text-primary mb-2",
574
574
  children: "Who can use this coupon? *"
575
- }), /* @__PURE__ */ g("select", {
575
+ }), /* @__PURE__ */ _("select", {
576
576
  value: k.scope,
577
577
  onChange: (e) => L("scope", e.target.value),
578
578
  className: "w-full px-4 py-2 rounded-input border border-border-subtle bg-bg-surface text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
579
579
  children: [
580
- /* @__PURE__ */ h("option", {
580
+ /* @__PURE__ */ g("option", {
581
581
  value: "GENERIC",
582
582
  children: "Anyone (Public)"
583
583
  }),
584
- /* @__PURE__ */ h("option", {
584
+ /* @__PURE__ */ g("option", {
585
585
  value: "USER_SPECIFIC",
586
586
  children: "Specific Users Only"
587
587
  }),
588
- /* @__PURE__ */ h("option", {
588
+ /* @__PURE__ */ g("option", {
589
589
  value: "REFERRAL",
590
590
  children: "Referral Code"
591
591
  }),
592
- /* @__PURE__ */ h("option", {
592
+ /* @__PURE__ */ g("option", {
593
593
  value: "CAMPAIGN",
594
594
  children: "Campaign-Specific"
595
595
  })
596
596
  ]
597
597
  })] }),
598
- k.scope === "CAMPAIGN" && /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("label", {
598
+ k.scope === "CAMPAIGN" && /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("label", {
599
599
  className: "block text-sm font-medium text-text-primary mb-1",
600
600
  children: "Campaign Name"
601
- }), /* @__PURE__ */ h("input", {
601
+ }), /* @__PURE__ */ g("input", {
602
602
  type: "text",
603
603
  value: k.campaignName,
604
604
  onChange: (e) => L("campaignName", e.target.value),
605
605
  placeholder: "e.g., Summer Sale 2024",
606
606
  className: "w-full px-4 py-2 rounded-input border border-border-subtle bg-bg-surface text-text-primary placeholder:text-text-muted focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
607
607
  })] }),
608
- k.scope === "USER_SPECIFIC" && /* @__PURE__ */ g("div", { children: [
609
- /* @__PURE__ */ h("label", {
608
+ k.scope === "USER_SPECIFIC" && /* @__PURE__ */ _("div", { children: [
609
+ /* @__PURE__ */ g("label", {
610
610
  className: "block text-sm font-medium text-text-primary mb-1",
611
- children: /* @__PURE__ */ g("span", {
611
+ children: /* @__PURE__ */ _("span", {
612
612
  className: "flex items-center gap-1.5",
613
- children: [/* @__PURE__ */ h(f, { className: "size-4" }), "Restricted Users *"]
613
+ children: [/* @__PURE__ */ g(p, { className: "size-4" }), "Restricted Users *"]
614
614
  })
615
615
  }),
616
- /* @__PURE__ */ g("div", {
616
+ /* @__PURE__ */ _("div", {
617
617
  className: `min-h-[42px] flex flex-wrap gap-2 px-3 py-2 rounded-lg border ${j.restrictedToUserIds ? "border-status-error-border" : "border-border-subtle"} bg-bg-surface cursor-text`,
618
618
  onClick: () => O.current?.focus(),
619
- children: [k.restrictedToUserIds.map((e) => /* @__PURE__ */ g("span", {
619
+ children: [k.restrictedToUserIds.map((e) => /* @__PURE__ */ _("span", {
620
620
  className: "inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-[var(--color-accent-soft)] text-text-link text-sm font-medium",
621
- children: [e, /* @__PURE__ */ h("button", {
621
+ children: [e, /* @__PURE__ */ g("button", {
622
622
  type: "button",
623
623
  onClick: (t) => {
624
624
  t.stopPropagation(), B(e);
625
625
  },
626
626
  className: "hover:text-status-error-text",
627
- children: /* @__PURE__ */ h(p, { className: "size-3" })
627
+ children: /* @__PURE__ */ g(m, { className: "size-3" })
628
628
  })]
629
- }, e)), /* @__PURE__ */ h("input", {
629
+ }, e)), /* @__PURE__ */ g("input", {
630
630
  ref: O,
631
631
  type: "text",
632
632
  value: E,
@@ -639,29 +639,29 @@ var y = [
639
639
  className: "flex-1 min-w-[200px] bg-transparent text-text-primary placeholder:text-text-muted text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]"
640
640
  })]
641
641
  }),
642
- j.restrictedToUserIds && /* @__PURE__ */ h("p", {
642
+ j.restrictedToUserIds && /* @__PURE__ */ g("p", {
643
643
  className: "text-sm text-status-error-text mt-1",
644
644
  children: j.restrictedToUserIds
645
645
  }),
646
- /* @__PURE__ */ h("p", {
646
+ /* @__PURE__ */ g("p", {
647
647
  className: "text-xs text-text-muted mt-1",
648
648
  children: "Type an email or user ID and press Enter or comma to add. Only these users can redeem this coupon."
649
649
  })
650
650
  ] })
651
651
  ]
652
652
  }),
653
- /* @__PURE__ */ g("div", {
653
+ /* @__PURE__ */ _("div", {
654
654
  className: "flex items-center justify-end gap-3",
655
- children: [/* @__PURE__ */ h("button", {
655
+ children: [/* @__PURE__ */ g("button", {
656
656
  type: "button",
657
657
  onClick: () => w("/coupons"),
658
658
  className: "px-6 py-3 rounded-lg border border-border-subtle text-text-primary hover:bg-bg-sunken",
659
659
  children: "Cancel"
660
- }), /* @__PURE__ */ h("button", {
660
+ }), /* @__PURE__ */ g("button", {
661
661
  type: "submit",
662
662
  disabled: N,
663
663
  className: "px-6 py-3 rounded-lg bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bgHover flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed",
664
- children: N ? /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("div", { className: "size-4 border-2 border-action-primary-text border-t-transparent rounded-full animate-spin" }), "Creating…"] }) : /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(u, { className: "size-4" }), "Create Coupon"] })
664
+ children: N ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("div", { className: "size-4 border-2 border-action-primary-text border-t-transparent rounded-full animate-spin" }), "Creating…"] }) : /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(d, { className: "size-4" }), "Create Coupon"] })
665
665
  })]
666
666
  })
667
667
  ]