@burdenoff/microfe-billing 2026.530.3 → 2026.531.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.
Files changed (30) hide show
  1. package/dist/billing/BillingAdminRoutes.js +87 -61
  2. package/dist/billing/BillingAdminRoutes.js.map +1 -1
  3. package/dist/billing/BillingRoot.js +81 -73
  4. package/dist/billing/BillingRoot.js.map +1 -1
  5. package/dist/billing/modules/addons/pages/AddonDetailPage.js +85 -84
  6. package/dist/billing/modules/addons/pages/AddonDetailPage.js.map +1 -1
  7. package/dist/billing/modules/addons/pages/AddonEditPage.js +176 -195
  8. package/dist/billing/modules/addons/pages/AddonEditPage.js.map +1 -1
  9. package/dist/billing/modules/addons/pages/AddonsBrowsePage.js +173 -172
  10. package/dist/billing/modules/addons/pages/AddonsBrowsePage.js.map +1 -1
  11. package/dist/billing/modules/addons/pages/AddonsListPage.js +216 -215
  12. package/dist/billing/modules/addons/pages/AddonsListPage.js.map +1 -1
  13. package/dist/billing/modules/checkout/hooks/useCheckout.js +165 -161
  14. package/dist/billing/modules/checkout/hooks/useCheckout.js.map +1 -1
  15. package/dist/billing/modules/coupons/pages/CreateCouponPage.js +344 -167
  16. package/dist/billing/modules/coupons/pages/CreateCouponPage.js.map +1 -1
  17. package/dist/billing/modules/dashboard/components/RecommendedAddonsSection.js +79 -78
  18. package/dist/billing/modules/dashboard/components/RecommendedAddonsSection.js.map +1 -1
  19. package/dist/billing/modules/plans/pages/PlanEditPage.js +29 -20
  20. package/dist/billing/modules/plans/pages/PlanEditPage.js.map +1 -1
  21. package/dist/billing/modules/promotions/index.js +4 -0
  22. package/dist/billing/modules/promotions/pages/CreatePromotionPage.js +289 -0
  23. package/dist/billing/modules/promotions/pages/CreatePromotionPage.js.map +1 -0
  24. package/dist/billing/modules/promotions/pages/PromotionsListPage.js +168 -0
  25. package/dist/billing/modules/promotions/pages/PromotionsListPage.js.map +1 -0
  26. package/dist/billing/modules/promotions/pages/index.js +2 -0
  27. package/dist/generated/global-operations.js +182 -75
  28. package/dist/generated/global-operations.js.map +1 -1
  29. package/dist/generated/global-types.js.map +1 -1
  30. package/package.json +1 -1
@@ -1,59 +1,60 @@
1
- import { useConvertCurrencyLazyQuery as e, useInitiatePaymentCheckoutMutation as t, useSpendCreditsCheckoutMutation as n, useValidateCouponLazyQuery as r } from "../../../../generated/global-operations.js";
2
- import { useCallback as i, useEffect as a, useMemo as o, useState as s } from "react";
1
+ import { useBilling as e } from "../../../providers/BillingProvider.js";
2
+ import { useConvertCurrencyLazyQuery as t, useInitiatePaymentCheckoutMutation as n, useSpendCreditsCheckoutMutation as r, useValidateCouponLazyQuery as i } from "../../../../generated/global-operations.js";
3
+ import { useCallback as a, useEffect as o, useMemo as s, useState as c } from "react";
3
4
  //#region src/billing/modules/checkout/hooks/useCheckout.ts
4
5
  var ee = 100;
5
- function c(c = {}) {
6
- let { defaultCurrency: l = "USD", defaultSaveCard: u = !1, upgradeFromSubscriptionId: d, downgradeFromSubscriptionId: f, defaultSubscriptionId: p } = c, [m, h] = s([]), [g, te] = s(null), [_, ne] = s("AUTO"), [v, y] = s(l), [b, x] = s(""), [S, C] = s(0), [re, w] = s("PERCENTAGE"), [T, E] = s(!1), [D, O] = s(0), [k, A] = s("idle"), [ie, j] = s(null), [M, N] = s(0), [ae, P] = s(0), [oe, F] = s("NONE"), [I, L] = s(null), [R, se] = s(u), [z, ce] = s(!1), [B, V] = s(null), [H, U] = s(p ?? null), [W] = t(), [G] = n(), [K, { data: q, loading: le }] = e(), [ue] = r(), J = o(() => m.reduce((e, t) => e + t.price * t.quantity, 0), [m]), Y = o(() => m.reduce((e, t) => e + (t.priceUSD ?? t.price) * t.quantity, 0), [m]), X = o(() => S ? Math.min(S, J) : 0, [J, S]), Z = o(() => {
6
+ function l(l = {}) {
7
+ let { currentUser: u } = e(), { defaultCurrency: d = "USD", defaultSaveCard: f = !1, upgradeFromSubscriptionId: p, downgradeFromSubscriptionId: m, defaultSubscriptionId: h } = l, [g, _] = c([]), [v, te] = c(null), [y, b] = c("AUTO"), [x, S] = c(d), [C, w] = c(""), [T, E] = c(0), [ne, D] = c("PERCENTAGE"), [O, k] = c(!1), [A, j] = c(0), [M, N] = c("idle"), [re, P] = c(null), [F, I] = c(0), [ie, L] = c(0), [ae, R] = c("NONE"), [z, oe] = c(null), [B, se] = c(f), [V, ce] = c(!1), [H, U] = c(null), [W, G] = c(h ?? null), [K] = n(), [le] = r(), [q, { data: ue, loading: de }] = t(), [fe] = i(), J = s(() => g.reduce((e, t) => e + t.price * t.quantity, 0), [g]), Y = s(() => g.reduce((e, t) => e + (t.priceUSD ?? t.price) * t.quantity, 0), [g]), X = s(() => T ? Math.min(T, J) : 0, [J, T]), Z = s(() => {
7
8
  let e = J - X;
8
- return (T ? Math.max(0, e - D) : e) + M;
9
+ return (O ? Math.max(0, e - A) : e) + F;
9
10
  }, [
10
11
  J,
11
12
  X,
12
- T,
13
- D,
14
- M
15
- ]), Q = g?.creditAmount ?? 0, de = o(() => Q >= Y * ee, [Q, Y]), fe = o(() => !m.some((e) => e.type === "CREDITS") && Q > 0, [m, Q]), pe = q?.convertCurrency?.amount ?? null, me = q?.convertCurrency?.exchangeRate ?? 1, he = pe ?? Z, ge = k === "loading" || le, _e = k === "processing";
16
- a(() => {
17
- if (_ !== "CREDITS" && m.length !== 0 && !m.every((e) => e.currency === v || e.type === "CREDITS") && Z > 0 && v !== "USD") {
18
- if (v === "INR" && M === 0 && J > 0) return;
19
- K({ variables: {
13
+ O,
14
+ A,
15
+ F
16
+ ]), Q = v?.creditAmount ?? 0, pe = s(() => Q >= Y * ee, [Q, Y]), me = s(() => !g.some((e) => e.type === "CREDITS") && Q > 0, [g, Q]), he = ue?.convertCurrency?.amount ?? null, ge = ue?.convertCurrency?.exchangeRate ?? 1, _e = he ?? Z, ve = M === "loading" || de, ye = M === "processing";
17
+ o(() => {
18
+ if (y !== "CREDITS" && g.length !== 0 && !g.every((e) => e.currency === x || e.type === "CREDITS") && Z > 0 && x !== "USD") {
19
+ if (x === "INR" && F === 0 && J > 0) return;
20
+ q({ variables: {
20
21
  amount: Z,
21
- toCurrency: v,
22
+ toCurrency: x,
22
23
  fromCurrency: "USD"
23
24
  } });
24
25
  }
25
26
  }, [
26
27
  Z,
27
- v,
28
- _,
29
- K,
30
- M,
28
+ x,
29
+ y,
30
+ q,
31
+ F,
31
32
  J,
32
- m
33
- ]), a(() => {
34
- if (!g || J <= 0) {
35
- N(0), P(0), F("NONE");
33
+ g
34
+ ]), o(() => {
35
+ if (!v || J <= 0) {
36
+ I(0), L(0), R("NONE");
36
37
  return;
37
38
  }
38
- if (_ === "CREDITS") {
39
- N(0), P(0), F("NONE");
39
+ if (y === "CREDITS") {
40
+ I(0), L(0), R("NONE");
40
41
  return;
41
42
  }
42
- if (v !== "INR") {
43
- N(0), P(0), F("NONE");
43
+ if (x !== "INR") {
44
+ I(0), L(0), R("NONE");
44
45
  return;
45
46
  }
46
47
  let e = J - X, t = .18;
47
- N(e * t), P(t), F("GST");
48
+ I(e * t), L(t), R("GST");
48
49
  }, [
49
- g,
50
+ v,
50
51
  J,
51
52
  X,
52
- v,
53
- _
53
+ x,
54
+ y
54
55
  ]);
55
- let ve = i((e) => {
56
- h((t) => e.type === "PLAN" ? t.find((e) => e.type === "PLAN") ? t.map((t) => t.type === "PLAN" ? {
56
+ let be = a((e) => {
57
+ _((t) => e.type === "PLAN" ? t.find((e) => e.type === "PLAN") ? t.map((t) => t.type === "PLAN" ? {
57
58
  ...e,
58
59
  quantity: 1
59
60
  } : t) : [...t, {
@@ -63,22 +64,22 @@ function c(c = {}) {
63
64
  ...t,
64
65
  quantity: t.quantity + e.quantity
65
66
  } : t) : [...t, e]);
66
- }, []), $ = i((e) => {
67
- h((t) => t.filter((t) => t.id !== e));
68
- }, []), ye = i((e, t) => {
67
+ }, []), $ = a((e) => {
68
+ _((t) => t.filter((t) => t.id !== e));
69
+ }, []), xe = a((e, t) => {
69
70
  if (t <= 0) {
70
71
  $(e);
71
72
  return;
72
73
  }
73
- h((n) => n.map((n) => n.id === e ? n.type === "PLAN" ? {
74
+ _((n) => n.map((n) => n.id === e ? n.type === "PLAN" ? {
74
75
  ...n,
75
76
  quantity: 1
76
77
  } : {
77
78
  ...n,
78
79
  quantity: t
79
80
  } : n));
80
- }, [$]), be = i((e, t, n) => {
81
- h((r) => r.map((r) => {
81
+ }, [$]), Se = a((e, t, n) => {
82
+ _((r) => r.map((r) => {
82
83
  if (r.id !== e) return r;
83
84
  let i = { price: t };
84
85
  return n && (i.currency = n), {
@@ -86,69 +87,69 @@ function c(c = {}) {
86
87
  ...i
87
88
  };
88
89
  }));
89
- }, []), xe = i(() => {
90
- h([]);
91
- }, []), Se = i((e) => {
92
- te(e), E(!1), O(0);
93
- }, []), Ce = i((e) => {
94
- y(e);
95
- let t = m.every((t) => t.currency === e || t.type === "CREDITS");
96
- Z > 0 && e !== "USD" && !t && K({ variables: {
90
+ }, []), Ce = a(() => {
91
+ _([]);
92
+ }, []), we = a((e) => {
93
+ te(e), k(!1), j(0);
94
+ }, []), Te = a((e) => {
95
+ S(e);
96
+ let t = g.every((t) => t.currency === e || t.type === "CREDITS");
97
+ Z > 0 && e !== "USD" && !t && q({ variables: {
97
98
  amount: Z,
98
99
  toCurrency: e,
99
100
  fromCurrency: "USD"
100
101
  } });
101
102
  }, [
102
103
  Z,
103
- K,
104
- m
104
+ q,
105
+ g
105
106
  ]);
106
107
  return {
107
- items: m,
108
- billingAccount: g,
109
- selectedProvider: _,
110
- selectedCurrency: v,
111
- promoCode: b,
112
- promoDiscount: S,
113
- promoDiscountType: re,
114
- useCredits: T,
115
- creditsToUse: D,
116
- checkoutState: k,
117
- error: ie,
118
- selectedPaymentMethodId: I,
119
- saveCard: R,
120
- autoRenew: z,
121
- autoRenewPaymentMethodId: B,
122
- selectedSubscriptionId: H,
108
+ items: g,
109
+ billingAccount: v,
110
+ selectedProvider: y,
111
+ selectedCurrency: x,
112
+ promoCode: C,
113
+ promoDiscount: T,
114
+ promoDiscountType: ne,
115
+ useCredits: O,
116
+ creditsToUse: A,
117
+ checkoutState: M,
118
+ error: re,
119
+ selectedPaymentMethodId: z,
120
+ saveCard: B,
121
+ autoRenew: V,
122
+ autoRenewPaymentMethodId: H,
123
+ selectedSubscriptionId: W,
123
124
  subtotal: J,
124
125
  subtotalUSD: Y,
125
126
  discountAmount: X,
126
- taxAmount: M,
127
- taxRate: ae,
128
- taxType: oe,
127
+ taxAmount: F,
128
+ taxRate: ie,
129
+ taxType: ae,
129
130
  total: Z,
130
- totalInSelectedCurrency: he,
131
+ totalInSelectedCurrency: _e,
131
132
  availableCredits: Q,
132
- hasEnoughCredits: de,
133
- canPayWithCredits: fe,
134
- isLoading: ge,
135
- isProcessing: _e,
133
+ hasEnoughCredits: pe,
134
+ canPayWithCredits: me,
135
+ isLoading: ve,
136
+ isProcessing: ye,
136
137
  isCalculatingTax: !1,
137
- conversionRate: me,
138
- convertedAmount: pe,
139
- addItem: ve,
138
+ conversionRate: ge,
139
+ convertedAmount: he,
140
+ addItem: be,
140
141
  removeItem: $,
141
- updateItemQuantity: ye,
142
- updateItemPrice: be,
143
- clearItems: xe,
144
- setBillingAccount: Se,
145
- setPaymentProvider: i((e) => {
146
- ne(e), e === "RAZORPAY" && v !== "INR" && y("INR");
147
- }, [v]),
148
- setCurrency: Ce,
149
- setPromoCode: x,
150
- validatePromoCode: i(async () => {
151
- if (!b.trim()) return {
142
+ updateItemQuantity: xe,
143
+ updateItemPrice: Se,
144
+ clearItems: Ce,
145
+ setBillingAccount: we,
146
+ setPaymentProvider: a((e) => {
147
+ b(e), e === "RAZORPAY" && x !== "INR" && S("INR");
148
+ }, [x]),
149
+ setCurrency: Te,
150
+ setPromoCode: w,
151
+ validatePromoCode: a(async () => {
152
+ if (!C.trim()) return {
152
153
  valid: !1,
153
154
  code: "",
154
155
  discountType: "PERCENTAGE",
@@ -156,78 +157,81 @@ function c(c = {}) {
156
157
  error: "Please enter a promo code"
157
158
  };
158
159
  try {
159
- A("loading");
160
- let { data: e, error: t } = await ue({ variables: { input: {
161
- code: b.trim().toUpperCase(),
162
- userId: g?.id || "unknown",
160
+ N("loading");
161
+ let { data: e, error: t } = await fe({ variables: { input: {
162
+ code: C.trim().toUpperCase(),
163
+ userId: u?.id ?? "",
164
+ userEmail: u?.email,
163
165
  amount: J,
164
- currency: v
166
+ currency: x
165
167
  } } });
166
- if (t || !e?.validateCoupon) return C(0), A("idle"), {
168
+ if (t || !e?.validateCoupon) return E(0), N("idle"), {
167
169
  valid: !1,
168
- code: b,
170
+ code: C,
169
171
  discountType: "PERCENTAGE",
170
172
  discountValue: 0,
171
173
  error: "Failed to validate coupon"
172
174
  };
173
175
  let n = e.validateCoupon;
174
- if (!n.valid) return C(0), A("idle"), {
176
+ if (!n.valid) return E(0), N("idle"), {
175
177
  valid: !1,
176
- code: b,
178
+ code: C,
177
179
  discountType: "PERCENTAGE",
178
180
  discountValue: 0,
179
181
  error: n.error || "Invalid coupon code"
180
182
  };
181
183
  let r = n.coupon;
182
- if (!r) return C(0), A("idle"), {
184
+ if (!r) return E(0), N("idle"), {
183
185
  valid: !1,
184
- code: b,
186
+ code: C,
185
187
  discountType: "PERCENTAGE",
186
188
  discountValue: 0,
187
189
  error: "Coupon data not found"
188
190
  };
189
191
  let i = n.discountAmount || 0, a = r.type === "FIXED_AMOUNT" ? "FIXED" : "PERCENTAGE";
190
- return C(i), w(a), A("idle"), {
192
+ return E(i), D(a), N("idle"), {
191
193
  valid: !0,
192
194
  code: r.code,
193
195
  discountType: a,
194
196
  discountValue: i
195
197
  };
196
198
  } catch {
197
- return C(0), A("idle"), {
199
+ return E(0), N("idle"), {
198
200
  valid: !1,
199
- code: b,
201
+ code: C,
200
202
  discountType: "PERCENTAGE",
201
203
  discountValue: 0,
202
204
  error: "Failed to validate coupon"
203
205
  };
204
206
  }
205
207
  }, [
206
- g?.id,
207
- b,
208
- v,
208
+ v?.id,
209
+ u?.email,
210
+ u?.id,
211
+ C,
212
+ x,
209
213
  J,
210
- ue
214
+ fe
211
215
  ]),
212
- clearPromoCode: i(() => {
213
- x(""), C(0), w("PERCENTAGE");
216
+ clearPromoCode: a(() => {
217
+ w(""), E(0), D("PERCENTAGE");
214
218
  }, []),
215
- setUseCredits: E,
216
- setCreditsToUse: i((e) => {
219
+ setUseCredits: k,
220
+ setCreditsToUse: a((e) => {
217
221
  let t = Math.min(e, Q, J - X);
218
- O(Math.max(0, t));
222
+ j(Math.max(0, t));
219
223
  }, [
220
224
  Q,
221
225
  J,
222
226
  X
223
227
  ]),
224
- setSelectedPaymentMethodId: L,
228
+ setSelectedPaymentMethodId: oe,
225
229
  setSaveCard: se,
226
230
  setAutoRenew: ce,
227
- setAutoRenewPaymentMethodId: V,
228
- setSelectedSubscriptionId: U,
229
- initiatePayment: i(async () => {
230
- if (!g) return {
231
+ setAutoRenewPaymentMethodId: U,
232
+ setSelectedSubscriptionId: G,
233
+ initiatePayment: a(async () => {
234
+ if (!v) return {
231
235
  success: !1,
232
236
  provider: "AUTO",
233
237
  subtotal: 0,
@@ -236,10 +240,10 @@ function c(c = {}) {
236
240
  total: 0,
237
241
  taxType: "NONE",
238
242
  jurisdiction: "UNKNOWN",
239
- currency: v,
243
+ currency: x,
240
244
  error: "Please select a billing account"
241
245
  };
242
- if (m.length === 0) return {
246
+ if (g.length === 0) return {
243
247
  success: !1,
244
248
  provider: "AUTO",
245
249
  subtotal: 0,
@@ -248,29 +252,29 @@ function c(c = {}) {
248
252
  total: 0,
249
253
  taxType: "NONE",
250
254
  jurisdiction: "UNKNOWN",
251
- currency: v,
255
+ currency: x,
252
256
  error: "No items in checkout"
253
257
  };
254
258
  try {
255
- A("processing"), j(null);
256
- let e = m[0], t = e.type, n = m.find((e) => e.metadata?.billingOrderId)?.metadata?.billingOrderId;
259
+ N("processing"), P(null);
260
+ let e = g[0], t = e.type, n = g.find((e) => e.metadata?.billingOrderId)?.metadata?.billingOrderId;
257
261
  n && (t = "ORDER");
258
- let r = J - X, i = _;
259
- if (i === "AUTO" && (i = v === "INR" ? "RAZORPAY" : "STRIPE"), i === "CREDITS") {
260
- let e = m.filter((e) => e.type === "ADDON"), t = m.find((e) => e.type === "PLAN"), { data: n } = await G({ variables: { input: {
261
- billingAccountId: g.id,
262
+ let r = J - X, i = y;
263
+ if (i === "AUTO" && (i = x === "INR" ? "RAZORPAY" : "STRIPE"), i === "CREDITS") {
264
+ let e = g.filter((e) => e.type === "ADDON"), t = g.find((e) => e.type === "PLAN"), { data: n } = await le({ variables: { input: {
265
+ billingAccountId: v.id,
262
266
  planId: t ? t.metadata?.planId || t.id : void 0,
263
267
  addOnIds: e.length > 0 ? e.map((e) => ({
264
268
  id: e.metadata?.addonId || e.id,
265
269
  quantity: e.quantity
266
270
  })) : void 0,
267
271
  isAnnual: t?.metadata?.duration === "yearly",
268
- upgradeFromSubscriptionId: d || void 0,
269
- downgradeFromSubscriptionId: f || void 0,
270
- subscriptionId: e.length > 0 ? H : void 0,
272
+ upgradeFromSubscriptionId: p || void 0,
273
+ downgradeFromSubscriptionId: m || void 0,
274
+ subscriptionId: e.length > 0 ? W : void 0,
271
275
  seatCount: t?.metadata?.seatCount
272
276
  } } }), i = n?.spendCredits;
273
- return i?.creditTransactionID ? (A("success"), {
277
+ return i?.creditTransactionID ? (N("success"), {
274
278
  success: !0,
275
279
  provider: "CREDITS",
276
280
  subtotal: r,
@@ -279,9 +283,9 @@ function c(c = {}) {
279
283
  total: r,
280
284
  taxType: "NONE",
281
285
  jurisdiction: "UNKNOWN",
282
- currency: v,
286
+ currency: x,
283
287
  orderId: i.creditTransactionID
284
- }) : (A("error"), j("Failed to process credit payment"), {
288
+ }) : (N("error"), P("Failed to process credit payment"), {
285
289
  success: !1,
286
290
  provider: "CREDITS",
287
291
  subtotal: r,
@@ -290,14 +294,14 @@ function c(c = {}) {
290
294
  total: r,
291
295
  taxType: "NONE",
292
296
  jurisdiction: "UNKNOWN",
293
- currency: v,
297
+ currency: x,
294
298
  error: "Failed to process credit payment"
295
299
  });
296
300
  }
297
- let a = m.filter((e) => e.type === "ADDON"), o = a.length > 0 ? a.map((e) => e.metadata?.addonId || e.id) : void 0, s = a.length > 0 ? a.map((e) => e.quantity) : void 0, ee = m.find((e) => e.type === "PLAN")?.metadata?.duration === "yearly", c = t === "PLAN" && z && (B || I) || void 0, { data: l } = await W({ variables: { input: {
298
- billingAccountId: g.id,
301
+ let a = g.filter((e) => e.type === "ADDON"), o = a.length > 0 ? a.map((e) => e.metadata?.addonId || e.id) : void 0, s = a.length > 0 ? a.map((e) => e.quantity) : void 0, c = g.find((e) => e.type === "PLAN")?.metadata?.duration === "yearly", ee = t === "PLAN" && V && (H || z) || void 0, { data: l } = await K({ variables: { input: {
302
+ billingAccountId: v.id,
299
303
  amount: r,
300
- currency: v,
304
+ currency: x,
301
305
  purchaseType: t,
302
306
  provider: i,
303
307
  orderId: n || void 0,
@@ -307,17 +311,17 @@ function c(c = {}) {
307
311
  quantity: t === "ADDON" && a.length === 1 && !n ? a[0].quantity : void 0,
308
312
  addonIds: t === "ADDON" && a.length > 1 && !n ? o : void 0,
309
313
  quantities: t === "ADDON" && a.length > 1 && !n ? s : void 0,
310
- subscriptionId: t === "ADDON" && !n ? H : void 0,
311
- paymentMethodId: I || void 0,
312
- saveCard: I ? void 0 : R || z,
313
- upgradeFromSubscriptionId: d || void 0,
314
- downgradeFromSubscriptionId: f || void 0,
315
- isAnnual: ee || void 0,
316
- promoCode: b || void 0,
317
- autoRenew: t === "PLAN" && z ? !0 : void 0,
318
- autoRenewPaymentMethodId: c
314
+ subscriptionId: t === "ADDON" && !n ? W : void 0,
315
+ paymentMethodId: z || void 0,
316
+ saveCard: z ? void 0 : B || V,
317
+ upgradeFromSubscriptionId: p || void 0,
318
+ downgradeFromSubscriptionId: m || void 0,
319
+ isAnnual: c || void 0,
320
+ promoCode: C || void 0,
321
+ autoRenew: t === "PLAN" && V ? !0 : void 0,
322
+ autoRenewPaymentMethodId: ee
319
323
  } } }), u = l?.initiatePayment;
320
- return u?.success ? (A("success"), u) : (A("error"), j(u?.error ?? "Payment initiation failed"), {
324
+ return u?.success ? (N("success"), u) : (N("error"), P(u?.error ?? "Payment initiation failed"), {
321
325
  success: !1,
322
326
  provider: i,
323
327
  subtotal: r,
@@ -326,12 +330,12 @@ function c(c = {}) {
326
330
  total: r,
327
331
  taxType: "NONE",
328
332
  jurisdiction: "UNKNOWN",
329
- currency: v,
333
+ currency: x,
330
334
  error: u?.error ?? "Payment initiation failed"
331
335
  });
332
336
  } catch (e) {
333
337
  let t = e instanceof Error ? e.message : "An error occurred";
334
- return A("error"), j(t), {
338
+ return N("error"), P(t), {
335
339
  success: !1,
336
340
  provider: "AUTO",
337
341
  subtotal: 0,
@@ -340,38 +344,38 @@ function c(c = {}) {
340
344
  total: 0,
341
345
  taxType: "NONE",
342
346
  jurisdiction: "UNKNOWN",
343
- currency: v,
347
+ currency: x,
344
348
  error: t
345
349
  };
346
350
  }
347
351
  }, [
348
- g,
349
- m,
350
352
  v,
351
- _,
353
+ g,
354
+ x,
355
+ y,
352
356
  J,
353
357
  X,
354
- b,
355
- I,
356
- R,
358
+ C,
357
359
  z,
358
360
  B,
361
+ V,
359
362
  H,
360
- d,
361
- f,
362
363
  W,
363
- G
364
+ p,
365
+ m,
366
+ K,
367
+ le
364
368
  ]),
365
- reset: i(() => {
366
- h([]), te(null), ne("AUTO"), y(l), x(""), C(0), w("PERCENTAGE"), E(!1), O(0), A("idle"), j(null), N(0), P(0), F("NONE"), L(null), se(u), ce(!1), V(null), U(p ?? null);
369
+ reset: a(() => {
370
+ _([]), te(null), b("AUTO"), S(d), w(""), E(0), D("PERCENTAGE"), k(!1), j(0), N("idle"), P(null), I(0), L(0), R("NONE"), oe(null), se(f), ce(!1), U(null), G(h ?? null);
367
371
  }, [
368
- l,
369
- u,
370
- p
372
+ d,
373
+ f,
374
+ h
371
375
  ])
372
376
  };
373
377
  }
374
378
  //#endregion
375
- export { c as useCheckout };
379
+ export { l as useCheckout };
376
380
 
377
381
  //# sourceMappingURL=useCheckout.js.map