@burdenoff/microfe-billing 2026.1120.1 → 2026.1123.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.
@@ -5,46 +5,47 @@ import { PageHeader as r } from "../../../shared/components/PageHeader.js";
5
5
  import { useBillingPermissions as i } from "../../../hooks/useBillingPermissions.js";
6
6
  import { useBilling as a } from "../../../providers/BillingProvider.js";
7
7
  import "../../../shared/components/index.js";
8
- import { useIsFluidgridsVariant as o } from "../../../hooks/useBillingVariant.js";
9
- import { customisedCheckoutOptions as ee } from "../utils/checkoutOptions.js";
10
- import { useAddonCartStore as te } from "../../addons/store/addonCartStore.js";
11
- import { useMyWorkspaces as s } from "../../usage/hooks/useUsage.js";
8
+ import { PlanQuotaTermsNote as o } from "../../../shared/components/PlanQuotaTermsNote.js";
9
+ import { useIsFluidgridsVariant as ee } from "../../../hooks/useBillingVariant.js";
10
+ import { customisedCheckoutOptions as te } from "../utils/checkoutOptions.js";
11
+ import { useAddonCartStore as s } from "../../addons/store/addonCartStore.js";
12
+ import { useMyWorkspaces as ne } from "../../usage/hooks/useUsage.js";
12
13
  import "../hooks/index.js";
13
14
  import { isNativeIAPAvailable as c } from "../../../lib/native-purchases.js";
14
- import { NativeCheckoutView as ne } from "../components/NativeCheckoutView.js";
15
- import { WebCheckoutRedirectView as re } from "../components/WebCheckoutRedirectView.js";
16
- import { getStoredBillingAccountId as ie } from "../../../hooks/useBillingAccountSelection.js";
17
- import { useCheckout as ae } from "../hooks/useCheckout.js";
18
- import { useNativeCheckout as oe } from "../hooks/useNativeCheckout.js";
19
- import { usePaymentProviders as se } from "../hooks/usePaymentProviders.js";
20
- import { usePaymentStatusPolling as ce } from "../hooks/usePaymentStatusPolling.js";
21
- import { useGetActiveSubscriptionsCheckoutQuery as le, useGetBillingAccountsCheckoutQuery as ue, useGetCostOfCreditsCheckoutQuery as de, useGetPaymentMethodsCheckoutQuery as fe, useGetPlanCheckoutQuery as pe, useGetSelectedAddonCheckoutQuery as me, useGetStoreOrderCheckoutQuery as he } from "../../../../generated/global-operations.js";
15
+ import { NativeCheckoutView as re } from "../components/NativeCheckoutView.js";
16
+ import { WebCheckoutRedirectView as ie } from "../components/WebCheckoutRedirectView.js";
17
+ import { getStoredBillingAccountId as ae } from "../../../hooks/useBillingAccountSelection.js";
18
+ import { useCheckout as oe } from "../hooks/useCheckout.js";
19
+ import { useNativeCheckout as se } from "../hooks/useNativeCheckout.js";
20
+ import { usePaymentProviders as ce } from "../hooks/usePaymentProviders.js";
21
+ import { usePaymentStatusPolling as le } from "../hooks/usePaymentStatusPolling.js";
22
+ import { useGetActiveSubscriptionsCheckoutQuery as ue, useGetBillingAccountsCheckoutQuery as de, useGetCostOfCreditsCheckoutQuery as fe, useGetPaymentMethodsCheckoutQuery as pe, useGetPlanCheckoutQuery as me, useGetSelectedAddonCheckoutQuery as he, useGetStoreOrderCheckoutQuery as ge } from "../../../../generated/global-operations.js";
22
23
  import "../components/index.js";
23
- import { WorkspaceQuotaAssignmentModal as ge, isWorkspaceScopedQuota as _e } from "../components/WorkspaceQuotaAssignmentModal.js";
24
- import { BillingAccountSelector as ve } from "../components/BillingAccountSelector.js";
25
- import { OrderSummary as ye } from "../components/OrderSummary.js";
26
- import { PromoCodeInput as be } from "../components/PromoCodeInput.js";
27
- import { CreditsAmountInput as xe } from "../components/CreditsAmountInput.js";
28
- import { StripePaymentForm as Se } from "../components/StripePaymentForm.js";
29
- import { RazorpayPaymentButton as Ce } from "../components/RazorpayPaymentButton.js";
30
- import { SubscriptionSelector as we } from "../components/SubscriptionSelector.js";
31
- import { SimpleAutoPayToggle as Te } from "../components/SimpleAutoPayToggle.js";
32
- import { UnifiedPaymentMethodSelector as Ee } from "../components/UnifiedPaymentMethodSelector.js";
33
- import { CompleteBillingAccountModal as De, isBillingAccountComplete as Oe } from "../components/CompleteBillingAccountModal.js";
34
- import { StoreShippingSection as ke } from "../components/StoreShippingSection.js";
35
- import { buildStoreOrderCheckoutItems as Ae, normalizeStoreOrderCurrency as je } from "../utils/storeOrder.js";
36
- import { STORE_SHIPPING_ITEM_ID as Me, useSetStoreOrderShipping as Ne } from "../hooks/useStoreShipping.js";
37
- import { recordAffiliateEvent as Pe } from "../../affiliate/api.js";
38
- import { useCallback as l, useEffect as u, useMemo as d, useRef as Fe, useState as f } from "react";
39
- import { OptionalFields as Ie, PagePurpose as Le } from "@burdenoff/fe-libs/ui";
40
- import { ArrowLeft as Re, ArrowRight as ze, Blocks as Be, CheckCircle as Ve, Coins as He, CreditCard as Ue, Loader2 as We, Package as Ge, Receipt as Ke, RefreshCw as qe, ShoppingCart as Je, Wallet as Ye, XCircle as Xe } from "lucide-react";
41
- import { useLocation as Ze, useParams as Qe } from "react-router";
42
- import { useAppShell as $e } from "@burdenoff/fe-libs/shared/providers/shell";
24
+ import { WorkspaceQuotaAssignmentModal as _e, isWorkspaceScopedQuota as ve } from "../components/WorkspaceQuotaAssignmentModal.js";
25
+ import { BillingAccountSelector as ye } from "../components/BillingAccountSelector.js";
26
+ import { OrderSummary as be } from "../components/OrderSummary.js";
27
+ import { PromoCodeInput as xe } from "../components/PromoCodeInput.js";
28
+ import { CreditsAmountInput as Se } from "../components/CreditsAmountInput.js";
29
+ import { StripePaymentForm as Ce } from "../components/StripePaymentForm.js";
30
+ import { RazorpayPaymentButton as we } from "../components/RazorpayPaymentButton.js";
31
+ import { SubscriptionSelector as Te } from "../components/SubscriptionSelector.js";
32
+ import { SimpleAutoPayToggle as Ee } from "../components/SimpleAutoPayToggle.js";
33
+ import { UnifiedPaymentMethodSelector as De } from "../components/UnifiedPaymentMethodSelector.js";
34
+ import { CompleteBillingAccountModal as Oe, isBillingAccountComplete as ke } from "../components/CompleteBillingAccountModal.js";
35
+ import { StoreShippingSection as Ae } from "../components/StoreShippingSection.js";
36
+ import { buildStoreOrderCheckoutItems as je, normalizeStoreOrderCurrency as Me } from "../utils/storeOrder.js";
37
+ import { STORE_SHIPPING_ITEM_ID as Ne, useSetStoreOrderShipping as Pe } from "../hooks/useStoreShipping.js";
38
+ import { recordAffiliateEvent as Fe } from "../../affiliate/api.js";
39
+ import { useCallback as l, useEffect as u, useMemo as d, useRef as Ie, useState as f } from "react";
40
+ import { OptionalFields as Le, PagePurpose as Re } from "@burdenoff/fe-libs/ui";
41
+ import { ArrowLeft as ze, ArrowRight as Be, Blocks as Ve, CheckCircle as He, Coins as Ue, CreditCard as We, Loader2 as Ge, Package as Ke, Receipt as qe, RefreshCw as Je, ShoppingCart as Ye, Wallet as Xe, XCircle as Ze } from "lucide-react";
42
+ import { useLocation as Qe, useParams as $e } from "react-router";
43
+ import { useAppShell as et } from "@burdenoff/fe-libs/shared/providers/shell";
43
44
  import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
44
- import { useI18n as et } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
45
- import { getProfileScopedKey as tt } from "@burdenoff/fe-libs/shared/utils";
45
+ import { useI18n as tt } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
46
+ import { getProfileScopedKey as nt } from "@burdenoff/fe-libs/shared/utils";
46
47
  // src/billing/modules/checkout/pages/CheckoutPage.tsx
47
- function nt(e) {
48
+ function rt(e) {
48
49
  return typeof e.id != "string" || typeof e.name != "string" || typeof e.email != "string" || typeof e.currency != "string" || typeof e.creditAmount != "number" || typeof e.isActive != "boolean" ? null : {
49
50
  ...e,
50
51
  id: e.id,
@@ -56,17 +57,17 @@ function nt(e) {
56
57
  billingAddresses: e.billingAddresses === null ? null : e.billingAddresses?.flatMap((e) => e ? [{ ...e }] : [])
57
58
  };
58
59
  }
59
- var rt = () => {
60
- let { t: rt } = et(), g = o(), _ = (e, t) => {
61
- let n = rt(e);
60
+ var it = () => {
61
+ let { t: it } = tt(), g = ee(), _ = (e, t) => {
62
+ let n = it(e);
62
63
  return n === e ? t : n;
63
- }, { planId: it, addonId: at, storeOrderId: v } = Qe(), y = e(), b = Ze(), x = b.state, ot = i(), { emit: S } = t(), { orgId: C, stripePublishableKey: st, razorpayKey: ct, apiGatewayUrl: lt, authToken: ut, currentUser: dt, workspaceId: w } = a(), { productSlug: ft } = $e(), pt = Fe(null), { workspaces: mt } = s(), ht = mt.length > 0 ? mt : w ? [{
64
+ }, { planId: at, addonId: ot, storeOrderId: v } = $e(), y = e(), b = Qe(), x = b.state, st = i(), { emit: S } = t(), { orgId: C, stripePublishableKey: ct, razorpayKey: lt, apiGatewayUrl: ut, authToken: dt, currentUser: ft, workspaceId: w } = a(), { productSlug: pt } = et(), mt = Ie(null), { workspaces: ht } = ne(), gt = ht.length > 0 ? ht : w ? [{
64
65
  id: w,
65
66
  name: "Current workspace"
66
- }] : [], { items: T, clearCart: gt, _hasHydrated: E } = te(), D = b.pathname.includes("/checkout/addons") && !at, O = b.pathname.includes("/checkout/store") && !!v, k = D ? "ADDON" : O ? "ORDER" : x?.purchaseType ?? (it ? "PLAN" : at ? "ADDON" : "CREDITS"), A = x?.itemId ?? it ?? at ?? v, [_t, vt] = f(!1), yt = Fe(!1), [bt, xt] = f(!1), [St, Ct] = f([]), [wt, Tt] = f(null), [j, M] = f("select"), [N, Et] = f(null), [Dt, P] = f(null), [F, Ot] = f(null), [kt, At] = f("card");
67
+ }] : [], { items: T, clearCart: _t, _hasHydrated: E } = s(), D = b.pathname.includes("/checkout/addons") && !ot, O = b.pathname.includes("/checkout/store") && !!v, k = D ? "ADDON" : O ? "ORDER" : x?.purchaseType ?? (at ? "PLAN" : ot ? "ADDON" : "CREDITS"), A = x?.itemId ?? at ?? ot ?? v, [vt, yt] = f(!1), bt = Ie(!1), [xt, St] = f(!1), [Ct, wt] = f([]), [Tt, Et] = f(null), [j, M] = f("select"), [N, Dt] = f(null), [Ot, P] = f(null), [F, kt] = f(null), [At, jt] = f("card");
67
68
  u(() => {
68
69
  if (j !== "success" || !F) return;
69
- let e = typeof window < "u" ? window.localStorage.getItem(tt("boff-referral-attribution")) : null;
70
+ let e = typeof window < "u" ? window.localStorage.getItem(nt("boff-referral-attribution")) : null;
70
71
  if (!e) return;
71
72
  let t;
72
73
  try {
@@ -76,12 +77,12 @@ var rt = () => {
76
77
  }
77
78
  if (!t.journeyId && !t.codeId) return;
78
79
  let n = F.transactionId || N?.paymentId || N?.orderId || v || A || k, r = `${t.journeyId ?? "journey"}:${n}`;
79
- pt.current !== r && (pt.current = r, Pe({
80
+ mt.current !== r && (mt.current = r, Fe({
80
81
  journeyId: t.journeyId,
81
82
  codeId: t.codeId,
82
83
  eventType: k === "ORDER" ? "STORE_PURCHASE" : "PAID_CONVERSION",
83
- productSlug: ft,
84
- actorUserId: dt?.id,
84
+ productSlug: pt,
85
+ actorUserId: ft?.id,
85
86
  orderId: F.transactionId || N?.paymentId || N?.orderId,
86
87
  billingAccountId: F.billingAccountId,
87
88
  storeOrderId: k === "ORDER" ? v : void 0,
@@ -93,42 +94,42 @@ var rt = () => {
93
94
  billingAccountName: F.billingAccountName
94
95
  }
95
96
  }, {
96
- apiGatewayUrl: lt,
97
- authToken: ut,
97
+ apiGatewayUrl: ut,
98
+ authToken: dt,
98
99
  orgId: C
99
100
  }).catch(() => {
100
- pt.current = null;
101
+ mt.current = null;
101
102
  }));
102
103
  }, [
103
- lt,
104
104
  ut,
105
- dt?.id,
105
+ dt,
106
+ ft?.id,
106
107
  A,
107
108
  j,
108
109
  C,
109
110
  N?.orderId,
110
111
  N?.paymentId,
111
- ft,
112
+ pt,
112
113
  F,
113
114
  k,
114
115
  v
115
116
  ]);
116
- let [I, jt] = f(1), L = ae({
117
+ let [I, Mt] = f(1), L = oe({
117
118
  defaultCurrency: "USD",
118
119
  upgradeFromSubscriptionId: x?.upgradeFromSubscriptionId,
119
120
  downgradeFromSubscriptionId: x?.downgradeFromSubscriptionId
120
- }), { config: Mt, stripeEnabled: Nt, razorpayEnabled: Pt } = se(), { elapsedTime: Ft, error: It } = ce({
121
+ }), { config: Nt, stripeEnabled: Pt, razorpayEnabled: Ft } = ce(), { elapsedTime: It, error: Lt } = le({
121
122
  paymentId: j === "processing" ? N?.paymentId ?? null : null,
122
123
  billingAccountId: L.billingAccount?.id ?? F?.billingAccountId ?? null,
123
- paymentType: kt,
124
+ paymentType: At,
124
125
  pollingInterval: 5e3,
125
126
  maxPollingTime: 3e5,
126
127
  onSuccess: (e) => {
127
- if (e.transactionId && Ot((t) => t && {
128
+ if (e.transactionId && kt((t) => t && {
128
129
  ...t,
129
130
  transactionId: e.transactionId
130
- }), M("success"), D && gt(), (k === "PLAN" || k === "ADDON") && w) {
131
- let e = (R?.getPlan?.features ?? []).filter((e) => e != null).filter((e) => e.quota?.name && _e(e.quota.name)).map((e) => {
131
+ }), M("success"), D && _t(), (k === "PLAN" || k === "ADDON") && w) {
132
+ let e = (R?.getPlan?.features ?? []).filter((e) => e != null).filter((e) => e.quota?.name && ve(e.quota.name)).map((e) => {
132
133
  let t = e.quota?.limits, n = t && "type" in t ? String(t.type) : "number", r = e.context && "quantity" in e.context ? Number(e.context.quantity) : null, i = t && "value" in t ? Number(t.value) : null, a = r ?? i;
133
134
  return {
134
135
  quotaName: e.quota.name,
@@ -139,10 +140,10 @@ var rt = () => {
139
140
  quotaMode: "dedicated"
140
141
  };
141
142
  });
142
- e.length > 0 && (Ct(e), Xt().then((e) => {
143
+ e.length > 0 && (wt(e), Zt().then((e) => {
143
144
  let t = e.data?.getActiveSubscriptions?.find((e) => e.planId === A);
144
- t && Tt(t.id);
145
- }), ht.length > 1 && xt(!0));
145
+ t && Et(t.id);
146
+ }), gt.length > 1 && St(!0));
146
147
  }
147
148
  },
148
149
  onFailure: (e) => {
@@ -151,49 +152,49 @@ var rt = () => {
151
152
  onTimeout: () => {
152
153
  P("Payment verification timed out. Please check your billing history for the payment status."), M("error");
153
154
  }
154
- }), { data: Lt, loading: Rt, refetch: zt } = ue({}), { data: R, loading: Bt } = pe({
155
+ }), { data: Rt, loading: zt, refetch: Bt } = de({}), { data: R, loading: Vt } = me({
155
156
  variables: { id: A },
156
157
  skip: k !== "PLAN" || !A
157
- }), { data: z, loading: Vt } = me({
158
+ }), { data: z, loading: Ht } = he({
158
159
  variables: { addonIDs: A ? [A] : [] },
159
160
  skip: k !== "ADDON" || !A || O
160
- }), { data: B } = he({
161
+ }), { data: B } = ge({
161
162
  variables: { id: v },
162
163
  skip: !O || !v
163
- }), V = k === "PLAN" ? R?.getPlan?.nativeProductId ?? A : k === "ADDON" && !D ? z?.getSelectedAddons?.[0]?.nativeProductId ?? A : void 0, Ht = d(() => {
164
+ }), V = k === "PLAN" ? R?.getPlan?.nativeProductId ?? A : k === "ADDON" && !D ? z?.getSelectedAddons?.[0]?.nativeProductId ?? A : void 0, Ut = d(() => {
164
165
  let e = B?.getStoreOrder?.lineItems;
165
166
  return Array.isArray(e) ? e : [];
166
- }, [B]), H = O && Ht.some((e) => String(e.itemType).toUpperCase() === "PHYSICAL"), Ut = je(B?.getStoreOrder?.currency), [U, Wt] = f({
167
+ }, [B]), H = O && Ut.some((e) => String(e.itemType).toUpperCase() === "PHYSICAL"), Wt = Me(B?.getStoreOrder?.currency), [U, Gt] = f({
167
168
  shippingAddressId: null,
168
169
  shippingMethodId: null,
169
170
  shippingCost: 0,
170
171
  destinationCountry: null
171
- }), [Gt] = Ne(), { data: Kt, loading: qt } = fe({
172
+ }), [Kt] = Pe(), { data: qt, loading: Jt } = pe({
172
173
  variables: { billingAccountId: L.billingAccount?.id ?? "" },
173
174
  skip: !L.billingAccount?.id
174
- }), { data: Jt, loading: Yt, refetch: Xt } = le({
175
+ }), { data: Yt, loading: Xt, refetch: Zt } = ue({
175
176
  variables: { billingAccountId: L.billingAccount?.id ?? "" },
176
177
  skip: !L.billingAccount?.id || k !== "ADDON" && k !== "PLAN" || O
177
- }), W = d(() => Jt?.getActiveSubscriptions ?? [], [Jt]), G = d(() => !L.selectedSubscriptionId || W.length === 0 ? null : W.find((e) => e.id === L.selectedSubscriptionId) ?? null, [L.selectedSubscriptionId, W]), K = L.items[0]?.type === "CREDITS" ? L.items[0].quantity : 100, { data: Zt, loading: Qt } = de({
178
+ }), W = d(() => Yt?.getActiveSubscriptions ?? [], [Yt]), G = d(() => !L.selectedSubscriptionId || W.length === 0 ? null : W.find((e) => e.id === L.selectedSubscriptionId) ?? null, [L.selectedSubscriptionId, W]), K = L.items[0]?.type === "CREDITS" ? L.items[0].quantity : 100, { data: Qt, loading: $t } = fe({
178
179
  variables: {
179
180
  creditAmount: K,
180
181
  currency: L.selectedCurrency || "USD"
181
182
  },
182
183
  skip: k !== "CREDITS"
183
- }), q = d(() => Zt?.getCostOfCredits?.amount && K > 0 ? Zt.getCostOfCredits.amount / K : .01, [Zt, K]), J = d(() => Kt?.getPaymentMethods ?? [], [Kt]), Y = d(() => Lt?.myBillingAccounts ?? [], [Lt]), X = d(() => {
184
+ }), q = d(() => Qt?.getCostOfCredits?.amount && K > 0 ? Qt.getCostOfCredits.amount / K : .01, [Qt, K]), J = d(() => qt?.getPaymentMethods ?? [], [qt]), Y = d(() => Rt?.myBillingAccounts ?? [], [Rt]), X = d(() => {
184
185
  if (!L.billingAccount) return;
185
186
  let e = Y.find((e) => e.id === L.billingAccount?.id)?.billingAddresses;
186
187
  if (e && e.length > 0) return e[0]?.country || void 0;
187
- }, [L.billingAccount, Y]), [$t, en] = f(null);
188
+ }, [L.billingAccount, Y]), [en, tn] = f(null);
188
189
  u(() => {
189
190
  if (X) {
190
- if (X === "IN") L.selectedCurrency !== "INR" && L.setCurrency("INR"), Pt && $t !== X && L.selectedProvider !== "CREDITS" && (L.setPaymentProvider("RAZORPAY"), en(X));
191
+ if (X === "IN") L.selectedCurrency !== "INR" && L.setCurrency("INR"), Ft && en !== X && L.selectedProvider !== "CREDITS" && (L.setPaymentProvider("RAZORPAY"), tn(X));
191
192
  else {
192
193
  if (L.selectedCurrency === "INR") {
193
194
  let e = L.billingAccount?.currency, t = e && e !== "INR" ? e : "USD";
194
195
  L.setCurrency(t);
195
196
  }
196
- L.selectedProvider === "RAZORPAY" && (L.setPaymentProvider("STRIPE"), en(X));
197
+ L.selectedProvider === "RAZORPAY" && (L.setPaymentProvider("STRIPE"), tn(X));
197
198
  }
198
199
  }
199
200
  }, [
@@ -203,22 +204,22 @@ var rt = () => {
203
204
  L.setCurrency,
204
205
  L.setPaymentProvider,
205
206
  L.billingAccount?.currency,
206
- Pt,
207
- $t
207
+ Ft,
208
+ en
208
209
  ]);
209
- let { billingAccount: tn, canPayWithCredits: nn, hasEnoughCredits: rn, selectedCurrency: an, selectedPaymentMethodId: on, selectedProvider: sn, setCurrency: cn, setPaymentProvider: ln, setSelectedPaymentMethodId: un } = L;
210
+ let { billingAccount: nn, canPayWithCredits: rn, hasEnoughCredits: an, selectedCurrency: Z, selectedPaymentMethodId: on, selectedProvider: sn, setCurrency: cn, setPaymentProvider: ln, setSelectedPaymentMethodId: un } = L;
210
211
  u(() => {
211
- if (!tn?.currency || X === "IN") return;
212
- let e = tn.currency;
213
- e !== "INR" && an !== e && cn(e);
212
+ if (!nn?.currency || X === "IN") return;
213
+ let e = nn.currency;
214
+ e !== "INR" && Z !== e && cn(e);
214
215
  }, [
215
216
  X,
216
- tn,
217
- an,
217
+ nn,
218
+ Z,
218
219
  cn
219
220
  ]), u(() => {
220
221
  if (sn === "AUTO" || sn === null) {
221
- if (nn && rn) ln("CREDITS"), un(null);
222
+ if (rn && an) ln("CREDITS"), un(null);
222
223
  else if (J.length > 0 && !on) {
223
224
  let e = J.find((e) => e.isDefault && e.isVerified), t = J.find((e) => e.isVerified), n = e || t;
224
225
  if (n) {
@@ -228,34 +229,34 @@ var rt = () => {
228
229
  }
229
230
  }
230
231
  }, [
231
- nn,
232
232
  rn,
233
+ an,
233
234
  J,
234
235
  on,
235
236
  sn,
236
237
  ln,
237
238
  un
238
239
  ]);
239
- let [Z, Q] = f(!1);
240
+ let [Q, $] = f(!1);
240
241
  u(() => {
241
- if (!O || Z || !B?.getStoreOrder) return;
242
- let e = je(B.getStoreOrder.currency);
243
- an !== e && cn(e);
242
+ if (!O || Q || !B?.getStoreOrder) return;
243
+ let e = Me(B.getStoreOrder.currency);
244
+ Z !== e && cn(e);
244
245
  }, [
245
246
  O,
247
+ Q,
246
248
  Z,
247
- an,
248
249
  cn,
249
250
  B
250
251
  ]), u(() => {
251
252
  if (k === "PLAN" && R?.getPlan?.pricingModel === "PER_SEAT") {
252
253
  let e = R.getPlan.minSeats ?? 1;
253
- jt((t) => t < e ? e : t);
254
+ Mt((t) => t < e ? e : t);
254
255
  }
255
256
  }, [R, k]), u(() => {
256
- k === "PLAN" && R?.getPlan?.pricingModel === "PER_SEAT" && Z && Q(!1);
257
+ k === "PLAN" && R?.getPlan?.pricingModel === "PER_SEAT" && Q && $(!1);
257
258
  }, [I]), u(() => {
258
- if (!Z) {
259
+ if (!Q) {
259
260
  if (D && E && T.length > 0) {
260
261
  L.clearItems();
261
262
  for (let e of T) {
@@ -283,7 +284,7 @@ var rt = () => {
283
284
  };
284
285
  L.addItem(ee);
285
286
  }
286
- Q(!0);
287
+ $(!0);
287
288
  } else if (k === "PLAN" && R?.getPlan) {
288
289
  let e = R.getPlan, t = e.features?.map((e) => {
289
290
  let t = e.quota?.limits, n = e.context && "quantity" in e.context ? Number(e.context.quantity) : void 0;
@@ -303,7 +304,7 @@ var rt = () => {
303
304
  let t = r?.[n];
304
305
  a = typeof t == "number" ? t : e.price;
305
306
  }
306
- let o = r?.USD, ee = typeof o == "number" ? o : e.price, te = typeof o == "object" && o?.perSeat ? o.perSeat : e.pricePerSeat, s = i ? I : 1, c = {
307
+ let o = r?.USD, ee = typeof o == "number" ? o : e.price, te = typeof o == "object" && o?.perSeat ? o.perSeat : e.pricePerSeat, s = i ? I : 1, ne = {
307
308
  id: e.id,
308
309
  type: "PLAN",
309
310
  name: e.name,
@@ -319,7 +320,7 @@ var rt = () => {
319
320
  seatCount: i ? s : void 0
320
321
  }
321
322
  };
322
- L.addItem(c), Q(!0);
323
+ L.addItem(ne), $(!0);
323
324
  } else if (k === "ADDON" && !D && z?.getSelectedAddons?.[0]) {
324
325
  let e = z.getSelectedAddons[0], t = e.features?.map((e) => {
325
326
  let t = e.quota?.limits, n = e.context && "quantity" in e.context ? Number(e.context.quantity) : void 0;
@@ -343,12 +344,12 @@ var rt = () => {
343
344
  features: t,
344
345
  metadata: { addonId: e.id }
345
346
  };
346
- L.addItem(o), Q(!0);
347
+ L.addItem(o), $(!0);
347
348
  } else if (O && B?.getStoreOrder) {
348
349
  L.clearItems();
349
- let e = B.getStoreOrder, t = Ae(e);
350
+ let e = B.getStoreOrder, t = je(e);
350
351
  for (let e of t) L.addItem(e);
351
- Q(!0);
352
+ $(!0);
352
353
  } else if (k === "CREDITS") {
353
354
  let e = L.selectedCurrency || "USD", t = {
354
355
  id: "credits-purchase",
@@ -359,7 +360,7 @@ var rt = () => {
359
360
  currency: e,
360
361
  quantity: 100
361
362
  };
362
- L.addItem(t), Q(!0);
363
+ L.addItem(t), $(!0);
363
364
  }
364
365
  }
365
366
  }, [
@@ -370,7 +371,7 @@ var rt = () => {
370
371
  L.addItem,
371
372
  L.clearItems,
372
373
  x?.quantity,
373
- Z,
374
+ Q,
374
375
  D,
375
376
  O,
376
377
  T,
@@ -378,7 +379,7 @@ var rt = () => {
378
379
  q,
379
380
  L.selectedCurrency
380
381
  ]), u(() => {
381
- if (O && Z && L.convertedAmount !== null) {
382
+ if (O && Q && L.convertedAmount !== null) {
382
383
  for (let e of L.items) if (e.type === "ORDER" && e.currency !== L.selectedCurrency) {
383
384
  let t = e.price * L.conversionRate;
384
385
  L.updateItemPrice(e.id, t, L.selectedCurrency);
@@ -386,20 +387,20 @@ var rt = () => {
386
387
  }
387
388
  }, [
388
389
  O,
389
- Z,
390
+ Q,
390
391
  L.convertedAmount,
391
392
  L.conversionRate,
392
393
  L.selectedCurrency,
393
394
  L.updateItemPrice
394
395
  ]);
395
- let dn = Fe(null);
396
+ let dn = Ie(null);
396
397
  u(() => {
397
398
  if (H) {
398
399
  if (U.shippingCost > 0) {
399
- let e = L.selectedCurrency, t = Ut !== e && L.convertedAmount !== null ? U.shippingCost * L.conversionRate : U.shippingCost, n = dn.current;
400
+ let e = L.selectedCurrency, t = Wt !== e && L.convertedAmount !== null ? U.shippingCost * L.conversionRate : U.shippingCost, n = dn.current;
400
401
  if (n && n.price === t && n.currency === e) return;
401
402
  n === null ? L.addItem({
402
- id: Me,
403
+ id: Ne,
403
404
  type: "ORDER",
404
405
  name: "Shipping",
405
406
  price: t,
@@ -409,16 +410,16 @@ var rt = () => {
409
410
  storeOrderId: v,
410
411
  isShipping: !0
411
412
  }
412
- }) : L.updateItemPrice(Me, t, e), dn.current = {
413
+ }) : L.updateItemPrice(Ne, t, e), dn.current = {
413
414
  price: t,
414
415
  currency: e
415
416
  };
416
- } else dn.current !== null && (dn.current = null, L.removeItem(Me));
417
+ } else dn.current !== null && (dn.current = null, L.removeItem(Ne));
417
418
  }
418
419
  }, [
419
420
  H,
420
421
  U.shippingCost,
421
- Ut,
422
+ Wt,
422
423
  L.selectedCurrency,
423
424
  L.conversionRate,
424
425
  L.convertedAmount,
@@ -427,18 +428,18 @@ var rt = () => {
427
428
  L.updateItemPrice,
428
429
  L.removeItem
429
430
  ]), u(() => {
430
- if (k === "CREDITS" && Z && q > 0) {
431
+ if (k === "CREDITS" && Q && q > 0) {
431
432
  let e = L.items.find((e) => e.id === "credits-purchase");
432
433
  e && e.price !== q && L.updateItemPrice("credits-purchase", q);
433
434
  }
434
435
  }, [
435
436
  k,
436
- Z,
437
+ Q,
437
438
  q,
438
439
  L.items,
439
440
  L.updateItemPrice
440
441
  ]), u(() => {
441
- if (!Z || L.items.length === 0) return;
442
+ if (!Q || L.items.length === 0) return;
442
443
  let e = L.selectedCurrency || "USD";
443
444
  for (let t of L.items) if (t.type === "PLAN" && R?.getPlan) {
444
445
  let n = R.getPlan.currencyPrices?.[e] ?? R.getPlan.price;
@@ -458,7 +459,7 @@ var rt = () => {
458
459
  }
459
460
  }, [
460
461
  L.selectedCurrency,
461
- Z,
462
+ Q,
462
463
  L.items,
463
464
  L.updateItemPrice,
464
465
  R,
@@ -475,7 +476,7 @@ var rt = () => {
475
476
  }
476
477
  }
477
478
  if (C) {
478
- let e = ie(C);
479
+ let e = ae(C);
479
480
  if (e) {
480
481
  let t = Y.find((t) => t.id === e);
481
482
  if (t) {
@@ -495,32 +496,32 @@ var rt = () => {
495
496
  ]);
496
497
  let fn = !!(x?.upgradeFromSubscriptionId || x?.downgradeFromSubscriptionId);
497
498
  u(() => {
498
- D && E && T.length === 0 && !Z && y("/addons", { replace: !0 });
499
+ D && E && T.length === 0 && !Q && y("/addons", { replace: !0 });
499
500
  }, [
500
501
  E,
501
502
  T.length,
502
503
  D,
503
- Z,
504
+ Q,
504
505
  y
505
506
  ]);
506
- let pn = oe({
507
+ let pn = se({
507
508
  billingAccountId: L.billingAccount?.id,
508
509
  purchaseType: k,
509
510
  productId: V
510
511
  }), mn = l(async () => {
511
512
  if (!L.billingAccount) return;
512
- let e = yt.current;
513
- if (yt.current = !1, !e && !Oe(L.billingAccount)) {
514
- vt(!0);
513
+ let e = bt.current;
514
+ if (bt.current = !1, !e && !ke(L.billingAccount)) {
515
+ yt(!0);
515
516
  return;
516
517
  }
517
518
  if (P(null), H) try {
518
- let e = (await Gt({ variables: { input: {
519
+ let e = (await Kt({ variables: { input: {
519
520
  orderId: v,
520
521
  shippingMethodId: U.shippingMethodId,
521
522
  ...U.shippingAddressId ? { shippingAddressId: U.shippingAddressId } : {}
522
523
  } } })).data?.setStoreOrderShipping?.shippingCost;
523
- typeof e == "number" && e !== U.shippingCost && Wt((t) => ({
524
+ typeof e == "number" && e !== U.shippingCost && Gt((t) => ({
524
525
  ...t,
525
526
  shippingCost: e
526
527
  }));
@@ -543,7 +544,7 @@ var rt = () => {
543
544
  source: "checkout",
544
545
  amount: i,
545
546
  currency: "CREDITS"
546
- }), Ot({
547
+ }), kt({
547
548
  items: n,
548
549
  total: i,
549
550
  billingAccountName: L.billingAccount.name,
@@ -553,10 +554,10 @@ var rt = () => {
553
554
  paymentMethod: "credits",
554
555
  currency: "Credits",
555
556
  transactionId: a.orderId
556
- }), At("credits"), Et({ paymentId: a.orderId }), M("processing");
557
+ }), jt("credits"), Dt({ paymentId: a.orderId }), M("processing");
557
558
  return;
558
559
  }
559
- Ot({
560
+ kt({
560
561
  items: n,
561
562
  total: a.total || r,
562
563
  billingAccountName: L.billingAccount.name,
@@ -566,7 +567,7 @@ var rt = () => {
566
567
  paymentMethod: "card",
567
568
  currency: a.currency || L.selectedCurrency,
568
569
  transactionId: a.paymentId
569
- }), At("card"), Et({
570
+ }), jt("card"), Dt({
570
571
  clientSecret: a.clientSecret,
571
572
  orderId: a.orderId,
572
573
  razorpayKeyId: a.razorpayKeyId,
@@ -590,14 +591,14 @@ var rt = () => {
590
591
  H,
591
592
  U,
592
593
  v,
593
- Ut,
594
- Gt
594
+ Wt,
595
+ Kt
595
596
  ]), hn = l((e) => {
596
597
  S("billing.payment.succeeded", {
597
598
  route: "/billing/checkout",
598
599
  entityId: N?.paymentId ?? N?.orderId,
599
600
  source: "checkout"
600
- }), Et((e) => e), M("processing");
601
+ }), Dt((e) => e), M("processing");
601
602
  }, [
602
603
  S,
603
604
  N?.orderId,
@@ -616,35 +617,35 @@ var rt = () => {
616
617
  ]), _n = l((e) => {
617
618
  L.updateItemQuantity("credits-purchase", e);
618
619
  }, [L]);
619
- if (!ot.canProcessPayment) return /* @__PURE__ */ m(n, { message: "You don't have permission to make purchases." });
620
- if (c() && k === "PLAN" && (Bt || Rt)) return /* @__PURE__ */ m("div", {
620
+ if (!st.canProcessPayment) return /* @__PURE__ */ m(n, { message: "You don't have permission to make purchases." });
621
+ if (c() && k === "PLAN" && (Vt || zt)) return /* @__PURE__ */ m("div", {
621
622
  className: "flex min-h-[240px] items-center justify-center",
622
- children: /* @__PURE__ */ m(We, {
623
+ children: /* @__PURE__ */ m(Ge, {
623
624
  className: "size-6 animate-spin text-[--color-primary]",
624
625
  "aria-label": "Loading"
625
626
  })
626
627
  });
627
- if (c() && k !== "PLAN") return /* @__PURE__ */ m(re, {
628
+ if (c() && k !== "PLAN") return /* @__PURE__ */ m(ie, {
628
629
  purchaseType: k,
629
630
  path: b.pathname + b.search,
630
631
  billingAccountId: L.billingAccount?.id,
631
632
  onBack: () => y("dashboard")
632
633
  });
633
- if (c() && k === "PLAN" && V) return /* @__PURE__ */ m(ne, {
634
+ if (c() && k === "PLAN" && V) return /* @__PURE__ */ m(re, {
634
635
  purchaseType: k,
635
636
  productId: V,
636
637
  billingAccountId: L.billingAccount?.id,
637
638
  nativeCheckout: pn,
638
639
  onBack: () => y("dashboard")
639
640
  });
640
- if (c() && k === "PLAN" && !V) return /* @__PURE__ */ m(re, {
641
+ if (c() && k === "PLAN" && !V) return /* @__PURE__ */ m(ie, {
641
642
  purchaseType: k,
642
643
  path: b.pathname + b.search,
643
644
  billingAccountId: L.billingAccount?.id,
644
645
  onBack: () => y("dashboard")
645
646
  });
646
- let vn = Rt || Bt && k === "PLAN" || Vt && k === "ADDON" && !D || D && !E;
647
- if (D && E && T.length === 0 && !Z) return null;
647
+ let vn = zt || Vt && k === "PLAN" || Ht && k === "ADDON" && !D || D && !E;
648
+ if (D && E && T.length === 0 && !Q) return null;
648
649
  let yn = () => {
649
650
  if (D) {
650
651
  let e = L.items.length;
@@ -658,17 +659,17 @@ var rt = () => {
658
659
  }
659
660
  }, bn = () => {
660
661
  switch (k) {
661
- case "CREDITS": return /* @__PURE__ */ m(He, { className: "size-6" });
662
- case "PLAN": return /* @__PURE__ */ m(Ge, { className: "size-6" });
663
- case "ADDON": return /* @__PURE__ */ m(Be, { className: "size-6" });
664
- default: return /* @__PURE__ */ m(Je, { className: "size-6" });
662
+ case "CREDITS": return /* @__PURE__ */ m(Ue, { className: "size-6" });
663
+ case "PLAN": return /* @__PURE__ */ m(Ke, { className: "size-6" });
664
+ case "ADDON": return /* @__PURE__ */ m(Ve, { className: "size-6" });
665
+ default: return /* @__PURE__ */ m(Ye, { className: "size-6" });
665
666
  }
666
667
  };
667
668
  if (vn) return /* @__PURE__ */ m("div", {
668
669
  className: "flex items-center justify-center min-h-[400px]",
669
670
  children: /* @__PURE__ */ h("div", {
670
671
  className: "text-center space-y-4",
671
- children: [/* @__PURE__ */ m(We, { className: "size-8 animate-spin mx-auto text-text-link" }), /* @__PURE__ */ m("p", {
672
+ children: [/* @__PURE__ */ m(Ge, { className: "size-8 animate-spin mx-auto text-text-link" }), /* @__PURE__ */ m("p", {
672
673
  className: "text-text-secondary",
673
674
  children: _("billing.checkout.loadingCheckout", "Loading checkout...")
674
675
  })]
@@ -696,7 +697,7 @@ var rt = () => {
696
697
  className: "text-center space-y-4",
697
698
  children: [/* @__PURE__ */ m("div", {
698
699
  className: "inline-flex p-4 rounded-full bg-status-success-bg-subtle text-status-success-text",
699
- children: /* @__PURE__ */ m(Ve, { className: "size-12" })
700
+ children: /* @__PURE__ */ m(He, { className: "size-12" })
700
701
  }), /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("h1", {
701
702
  className: "text-2xl font-bold text-text-primary",
702
703
  children: _("billing.checkout.paymentSuccessful", "Payment Successful!")
@@ -712,7 +713,7 @@ var rt = () => {
712
713
  className: "p-4 border-b border-border-subtle",
713
714
  children: [/* @__PURE__ */ h("h3", {
714
715
  className: "font-semibold text-text-primary mb-3 flex items-center gap-2",
715
- children: [/* @__PURE__ */ m(Ke, { className: "size-4" }), _("billing.checkout.itemsPurchased", "Items Purchased")]
716
+ children: [/* @__PURE__ */ m(qe, { className: "size-4" }), _("billing.checkout.itemsPurchased", "Items Purchased")]
716
717
  }), /* @__PURE__ */ m("div", {
717
718
  className: "space-y-2",
718
719
  children: F.items.map((t) => /* @__PURE__ */ h("div", {
@@ -720,10 +721,10 @@ var rt = () => {
720
721
  children: [/* @__PURE__ */ h("div", {
721
722
  className: "flex items-center gap-2",
722
723
  children: [
723
- t.type === "PLAN" && /* @__PURE__ */ m(Ge, { className: "size-4 text-accent-blue" }),
724
- t.type === "ADDON" && /* @__PURE__ */ m(Be, { className: "size-4 text-accent-purple" }),
725
- t.type === "CREDITS" && /* @__PURE__ */ m(He, { className: "size-4 text-status-warning-text" }),
726
- t.type === "ORDER" && /* @__PURE__ */ m(Je, { className: "size-4 text-status-success-text" }),
724
+ t.type === "PLAN" && /* @__PURE__ */ m(Ke, { className: "size-4 text-accent-blue" }),
725
+ t.type === "ADDON" && /* @__PURE__ */ m(Ve, { className: "size-4 text-accent-purple" }),
726
+ t.type === "CREDITS" && /* @__PURE__ */ m(Ue, { className: "size-4 text-status-warning-text" }),
727
+ t.type === "ORDER" && /* @__PURE__ */ m(Ye, { className: "size-4 text-status-success-text" }),
727
728
  /* @__PURE__ */ m("span", {
728
729
  className: "text-text-primary",
729
730
  children: t.name
@@ -749,10 +750,10 @@ var rt = () => {
749
750
  children: _("billing.checkout.paymentMethod", "Payment Method")
750
751
  }), /* @__PURE__ */ m("div", {
751
752
  className: "flex items-center gap-2",
752
- children: F.paymentMethod === "credits" ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(Ye, { className: "size-4 text-status-warning-text" }), /* @__PURE__ */ m("span", {
753
+ children: F.paymentMethod === "credits" ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(Xe, { className: "size-4 text-status-warning-text" }), /* @__PURE__ */ m("span", {
753
754
  className: "font-medium text-text-primary",
754
755
  children: _("billing.checkout.credits", "Credits")
755
- })] }) : /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(Ue, { className: "size-4 text-accent-blue" }), /* @__PURE__ */ m("span", {
756
+ })] }) : /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(We, { className: "size-4 text-accent-blue" }), /* @__PURE__ */ m("span", {
756
757
  className: "font-medium text-text-primary",
757
758
  children: _("billing.checkout.card", "Card")
758
759
  })] })
@@ -772,7 +773,7 @@ var rt = () => {
772
773
  className: "p-4 border-b border-border-subtle",
773
774
  children: [/* @__PURE__ */ h("h3", {
774
775
  className: "font-semibold text-text-primary mb-3 flex items-center gap-2",
775
- children: [/* @__PURE__ */ m(Ye, { className: "size-4" }), _("billing.checkout.creditBalance", "Credit Balance")]
776
+ children: [/* @__PURE__ */ m(Xe, { className: "size-4" }), _("billing.checkout.creditBalance", "Credit Balance")]
776
777
  }), /* @__PURE__ */ h("div", {
777
778
  className: "flex items-center gap-4",
778
779
  children: [
@@ -786,7 +787,7 @@ var rt = () => {
786
787
  children: t(F.previousBalance)
787
788
  })]
788
789
  }),
789
- /* @__PURE__ */ m(ze, { className: "size-5 text-text-secondary shrink-0" }),
790
+ /* @__PURE__ */ m(Be, { className: "size-5 text-text-secondary shrink-0" }),
790
791
  /* @__PURE__ */ h("div", {
791
792
  className: "flex-1 text-center p-3 rounded-lg bg-status-success-bg-subtle",
792
793
  children: [/* @__PURE__ */ m("p", {
@@ -839,14 +840,14 @@ var rt = () => {
839
840
  })]
840
841
  })
841
842
  ]
842
- }), bt && St.length > 0 && w && wt && /* @__PURE__ */ m(ge, {
843
+ }), xt && Ct.length > 0 && w && Tt && /* @__PURE__ */ m(_e, {
843
844
  billingAccountId: F?.billingAccountId ?? "",
844
- subscriptionId: wt,
845
- quotas: St,
846
- workspaces: ht,
845
+ subscriptionId: Tt,
846
+ quotas: Ct,
847
+ workspaces: gt,
847
848
  currentWorkspaceId: w,
848
- onAssigned: () => xt(!1),
849
- onSkip: () => xt(!1)
849
+ onAssigned: () => St(!1),
850
+ onSkip: () => St(!1)
850
851
  })] });
851
852
  }
852
853
  if (j === "error") return /* @__PURE__ */ m("div", {
@@ -856,14 +857,14 @@ var rt = () => {
856
857
  children: [
857
858
  /* @__PURE__ */ m("div", {
858
859
  className: "inline-flex p-4 rounded-full bg-status-error-bg-subtle text-status-error-text",
859
- children: /* @__PURE__ */ m(Xe, { className: "size-12" })
860
+ children: /* @__PURE__ */ m(Ze, { className: "size-12" })
860
861
  }),
861
862
  /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("h1", {
862
863
  className: "text-2xl font-bold text-text-primary",
863
864
  children: _("billing.checkout.paymentFailed", "Payment Failed")
864
865
  }), /* @__PURE__ */ m("p", {
865
866
  className: "text-text-secondary mt-2",
866
- children: Dt || It || L.error || _("billing.checkout.genericError", "Something went wrong. Please try again.")
867
+ children: Ot || Lt || L.error || _("billing.checkout.genericError", "Something went wrong. Please try again.")
867
868
  })] }),
868
869
  /* @__PURE__ */ h("div", {
869
870
  className: "flex gap-3 justify-center",
@@ -891,7 +892,7 @@ var rt = () => {
891
892
  children: [
892
893
  /* @__PURE__ */ m("div", {
893
894
  className: "inline-flex p-4 rounded-full bg-[var(--color-accent-soft)] text-text-link",
894
- children: /* @__PURE__ */ m(We, { className: "size-12 animate-spin" })
895
+ children: /* @__PURE__ */ m(Ge, { className: "size-12 animate-spin" })
895
896
  }),
896
897
  /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("h1", {
897
898
  className: "text-2xl font-bold text-text-primary",
@@ -912,7 +913,7 @@ var rt = () => {
912
913
  children: ((e) => {
913
914
  let t = Math.floor(e / 1e3);
914
915
  return `${Math.floor(t / 60)}:${(t % 60).toString().padStart(2, "0")}`;
915
- })(Ft)
916
+ })(It)
916
917
  })
917
918
  ]
918
919
  }), /* @__PURE__ */ m("p", {
@@ -924,10 +925,10 @@ var rt = () => {
924
925
  className: "w-full bg-bg-sunken rounded-full h-2 overflow-hidden",
925
926
  children: /* @__PURE__ */ m("div", {
926
927
  className: "bg-action-primary-bg h-2 rounded-full transition-all duration-1000",
927
- style: { width: `${Math.min(Ft / 3e5 * 100, 100)}%` }
928
+ style: { width: `${Math.min(It / 3e5 * 100, 100)}%` }
928
929
  })
929
930
  }),
930
- Ft > 3e4 && /* @__PURE__ */ m("button", {
931
+ It > 3e4 && /* @__PURE__ */ m("button", {
931
932
  type: "button",
932
933
  onClick: () => {
933
934
  M("error"), P("Payment verification was cancelled. Please check your billing history.");
@@ -952,7 +953,7 @@ var rt = () => {
952
953
  type: "button",
953
954
  onClick: () => M("select"),
954
955
  className: "flex items-center gap-2 text-sm text-text-secondary hover:text-text-primary",
955
- children: [/* @__PURE__ */ m(Re, { className: "size-4" }), _("billing.checkout.backToCheckout", "Back to checkout")]
956
+ children: [/* @__PURE__ */ m(ze, { className: "size-4" }), _("billing.checkout.backToCheckout", "Back to checkout")]
956
957
  }),
957
958
  /* @__PURE__ */ m(r, {
958
959
  title: _("billing.checkout.completePayment", "Complete Payment"),
@@ -963,7 +964,7 @@ var rt = () => {
963
964
  children: [
964
965
  /* @__PURE__ */ h("h3", {
965
966
  className: "font-semibold text-text-primary flex items-center gap-2",
966
- children: [/* @__PURE__ */ m(Ke, { className: "size-4" }), _("billing.checkout.paymentSummary", "Payment Summary")]
967
+ children: [/* @__PURE__ */ m(qe, { className: "size-4" }), _("billing.checkout.paymentSummary", "Payment Summary")]
967
968
  }),
968
969
  L.billingAccount && /* @__PURE__ */ h("div", {
969
970
  className: "p-3 bg-bg-sunken rounded-lg space-y-1",
@@ -1055,9 +1056,9 @@ var rt = () => {
1055
1056
  className: "rounded-lg border border-border-subtle bg-bg-surface overflow-hidden",
1056
1057
  children: /* @__PURE__ */ m("div", {
1057
1058
  className: "p-4 space-y-4",
1058
- children: /* @__PURE__ */ m(Se, {
1059
+ children: /* @__PURE__ */ m(Ce, {
1059
1060
  clientSecret: N.clientSecret,
1060
- publishableKey: st || Mt?.stripePublishableKey || "",
1061
+ publishableKey: ct || Nt?.stripePublishableKey || "",
1061
1062
  amount: Math.round((N.total ?? L.total) * 100),
1062
1063
  currency: N.currency || L.selectedCurrency,
1063
1064
  onSuccess: hn,
@@ -1082,9 +1083,9 @@ var rt = () => {
1082
1083
  className: "text-sm text-text-secondary",
1083
1084
  children: "Save card for future purchases"
1084
1085
  })]
1085
- }), /* @__PURE__ */ m(Ce, {
1086
+ }), /* @__PURE__ */ m(we, {
1086
1087
  orderId: N.orderId,
1087
- keyId: N.razorpayKeyId || ct || "",
1088
+ keyId: N.razorpayKeyId || lt || "",
1088
1089
  amount: Math.round((N.total ?? L.total) * 100),
1089
1090
  currency: N.currency || "INR",
1090
1091
  customerId: N.razorpayCustomerId,
@@ -1102,7 +1103,7 @@ var rt = () => {
1102
1103
  ]
1103
1104
  });
1104
1105
  }
1105
- let $ = k === "PLAN" && R?.getPlan?.pricingModel === "PER_SEAT" ? /* @__PURE__ */ m("div", {
1106
+ let xn = k === "PLAN" && R?.getPlan?.pricingModel === "PER_SEAT" ? /* @__PURE__ */ m("div", {
1106
1107
  className: g ? "px-4 pt-4" : "border-t border-border-subtle pt-4",
1107
1108
  children: /* @__PURE__ */ h("div", {
1108
1109
  className: "space-y-3",
@@ -1123,7 +1124,7 @@ var rt = () => {
1123
1124
  children: [
1124
1125
  /* @__PURE__ */ m("button", {
1125
1126
  type: "button",
1126
- onClick: () => jt((e) => Math.max(R.getPlan?.minSeats ?? 1, e - 1)),
1127
+ onClick: () => Mt((e) => Math.max(R.getPlan?.minSeats ?? 1, e - 1)),
1127
1128
  disabled: I <= (R.getPlan.minSeats ?? 1),
1128
1129
  className: "size-9 rounded-button border border-border-subtle flex items-center justify-center hover:bg-action-ghost-bgHover disabled:opacity-40 disabled:cursor-not-allowed transition-colors text-text-primary",
1129
1130
  children: "−"
@@ -1135,13 +1136,13 @@ var rt = () => {
1135
1136
  max: R.getPlan.maxSeats ?? 999,
1136
1137
  onChange: (e) => {
1137
1138
  let t = parseInt(e.target.value, 10);
1138
- isNaN(t) || jt(Math.max(R.getPlan?.minSeats ?? 1, t));
1139
+ isNaN(t) || Mt(Math.max(R.getPlan?.minSeats ?? 1, t));
1139
1140
  },
1140
1141
  className: "w-20 h-9 text-center border border-border-subtle rounded-button bg-bg-surface text-text-primary text-sm focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
1141
1142
  }),
1142
1143
  /* @__PURE__ */ m("button", {
1143
1144
  type: "button",
1144
- onClick: () => jt((e) => Math.min(R.getPlan?.maxSeats ?? 999, e + 1)),
1145
+ onClick: () => Mt((e) => Math.min(R.getPlan?.maxSeats ?? 999, e + 1)),
1145
1146
  disabled: I >= (R.getPlan.maxSeats ?? 999),
1146
1147
  className: "size-9 rounded-button border border-border-subtle flex items-center justify-center hover:bg-action-ghost-bgHover disabled:opacity-40 disabled:cursor-not-allowed transition-colors text-text-primary",
1147
1148
  children: "+"
@@ -1168,9 +1169,9 @@ var rt = () => {
1168
1169
  ]
1169
1170
  })]
1170
1171
  })
1171
- }) : null, xn = L.selectedProvider === "CREDITS" ? null : /* @__PURE__ */ m("div", {
1172
+ }) : null, Sn = L.selectedProvider === "CREDITS" ? null : /* @__PURE__ */ m("div", {
1172
1173
  className: g ? "px-4 pb-4 pt-4" : "px-4 pb-4 border-t border-border-subtle pt-4",
1173
- children: /* @__PURE__ */ m(be, {
1174
+ children: /* @__PURE__ */ m(xe, {
1174
1175
  value: L.promoCode,
1175
1176
  onChange: L.setPromoCode,
1176
1177
  onValidate: async () => await L.validatePromoCode(),
@@ -1180,7 +1181,7 @@ var rt = () => {
1180
1181
  discountType: L.promoDiscountType,
1181
1182
  isValidating: L.isProcessing
1182
1183
  })
1183
- }), Sn = k === "PLAN" && L.selectedProvider !== "CREDITS" && L.selectedProvider !== "AUTO" ? (() => {
1184
+ }), Cn = k === "PLAN" && L.selectedProvider !== "CREDITS" && L.selectedProvider !== "AUTO" ? (() => {
1184
1185
  let e = "", t = !1, n = !1;
1185
1186
  if (L.selectedPaymentMethodId) {
1186
1187
  let r = J.find((e) => e.id === L.selectedPaymentMethodId);
@@ -1188,7 +1189,7 @@ var rt = () => {
1188
1189
  } else (L.selectedProvider === "RAZORPAY" || L.selectedProvider === "STRIPE") && (e = L.selectedProvider === "RAZORPAY" ? "new card (Razorpay)" : "new card (Stripe)", t = !0, n = !0);
1189
1190
  return /* @__PURE__ */ m("div", {
1190
1191
  className: g ? "px-4 pb-4 pt-4" : "px-4 pb-4",
1191
- children: /* @__PURE__ */ m(Te, {
1192
+ children: /* @__PURE__ */ m(Ee, {
1192
1193
  enabled: L.autoRenew,
1193
1194
  onToggle: (e) => {
1194
1195
  L.setAutoRenew(e), e && L.selectedPaymentMethodId && L.setAutoRenewPaymentMethodId(L.selectedPaymentMethodId);
@@ -1198,14 +1199,14 @@ var rt = () => {
1198
1199
  isNewCard: n
1199
1200
  })
1200
1201
  });
1201
- })() : null, Cn = ee({
1202
+ })() : null, wn = te({
1202
1203
  seatCount: I,
1203
1204
  minSeats: R?.getPlan?.minSeats ?? 1,
1204
- hasSeatOption: $ !== null,
1205
+ hasSeatOption: xn !== null,
1205
1206
  promoApplied: L.promoDiscount > 0,
1206
1207
  autoRenew: L.autoRenew,
1207
- hasAutoRenewOption: Sn !== null
1208
- }), wn = Cn.length > 0 ? _("billing.checkout.moreOptionsChanged", "{{count}} changed").replace("{{count}}", String(Cn.length)) : _("billing.checkout.moreOptionsHint", "Seats, promo code and auto-renew");
1208
+ hasAutoRenewOption: Cn !== null
1209
+ }), Tn = wn.length > 0 ? _("billing.checkout.moreOptionsChanged", "{{count}} changed").replace("{{count}}", String(wn.length)) : _("billing.checkout.moreOptionsHint", "Seats, promo code and auto-renew");
1209
1210
  return /* @__PURE__ */ h("div", {
1210
1211
  className: "max-w-6xl mx-auto p-4 sm:p-6",
1211
1212
  children: [
@@ -1213,7 +1214,7 @@ var rt = () => {
1213
1214
  type: "button",
1214
1215
  onClick: () => y(-1),
1215
1216
  className: "flex items-center gap-2 text-sm text-text-secondary hover:text-text-primary mb-4",
1216
- children: [/* @__PURE__ */ m(Re, { className: "size-4" }), "Back"]
1217
+ children: [/* @__PURE__ */ m(ze, { className: "size-4" }), "Back"]
1217
1218
  }),
1218
1219
  /* @__PURE__ */ h("div", {
1219
1220
  className: "flex items-center gap-3 mb-6",
@@ -1228,7 +1229,7 @@ var rt = () => {
1228
1229
  children: "Complete your purchase securely"
1229
1230
  })] })]
1230
1231
  }),
1231
- /* @__PURE__ */ m(Le, {
1232
+ /* @__PURE__ */ m(Re, {
1232
1233
  className: "mb-6",
1233
1234
  children: _("billing.checkout.purpose", "Review what you are buying — plan, add-ons or credits — pick the billing account and payment method, apply any discount code, and pay. Taxes and the final total are shown before you confirm.")
1234
1235
  }),
@@ -1238,7 +1239,7 @@ var rt = () => {
1238
1239
  className: "flex items-center gap-3",
1239
1240
  children: [/* @__PURE__ */ m("div", {
1240
1241
  className: "p-2 rounded-full bg-status-info-bg-subtle",
1241
- children: /* @__PURE__ */ m(qe, { className: "size-4 text-accent-blue" })
1242
+ children: /* @__PURE__ */ m(Je, { className: "size-4 text-accent-blue" })
1242
1243
  }), /* @__PURE__ */ h("div", {
1243
1244
  className: "flex-1",
1244
1245
  children: [/* @__PURE__ */ h("p", {
@@ -1264,7 +1265,7 @@ var rt = () => {
1264
1265
  className: "flex items-center gap-3",
1265
1266
  children: [/* @__PURE__ */ m("div", {
1266
1267
  className: "p-2 rounded-full bg-status-warning-bg-subtle",
1267
- children: /* @__PURE__ */ m(qe, { className: "size-4 text-status-warning-text" })
1268
+ children: /* @__PURE__ */ m(Je, { className: "size-4 text-status-warning-text" })
1268
1269
  }), /* @__PURE__ */ h("div", {
1269
1270
  className: "flex-1",
1270
1271
  children: [/* @__PURE__ */ h("p", {
@@ -1291,46 +1292,46 @@ var rt = () => {
1291
1292
  children: [
1292
1293
  k === "CREDITS" && L.items[0] && /* @__PURE__ */ m("div", {
1293
1294
  className: "rounded-lg border border-border-subtle bg-bg-surface p-4 sm:p-6",
1294
- children: /* @__PURE__ */ m(xe, {
1295
+ children: /* @__PURE__ */ m(Se, {
1295
1296
  value: L.items[0].quantity,
1296
1297
  onChange: _n,
1297
1298
  costPerCredit: q,
1298
1299
  currency: L.selectedCurrency,
1299
- disabled: Qt
1300
+ disabled: $t
1300
1301
  })
1301
1302
  }),
1302
1303
  /* @__PURE__ */ h("div", {
1303
1304
  className: "rounded-lg border border-border-subtle bg-bg-surface p-4 sm:p-6 space-y-4",
1304
- children: [/* @__PURE__ */ m(ve, {
1305
+ children: [/* @__PURE__ */ m(ye, {
1305
1306
  accounts: Y,
1306
1307
  selectedAccountId: L.billingAccount?.id ?? null,
1307
1308
  onSelect: L.setBillingAccount,
1308
- isLoading: Rt,
1309
+ isLoading: zt,
1309
1310
  disabled: fn,
1310
1311
  disabledMessage: fn ? "Billing account is locked for plan changes" : void 0
1311
- }), k === "ADDON" && !O && L.billingAccount && /* @__PURE__ */ m(we, {
1312
+ }), k === "ADDON" && !O && L.billingAccount && /* @__PURE__ */ m(Te, {
1312
1313
  subscriptions: W,
1313
1314
  selectedSubscriptionId: L.selectedSubscriptionId,
1314
1315
  onSelect: L.setSelectedSubscriptionId,
1315
- isLoading: Yt
1316
+ isLoading: Xt
1316
1317
  })]
1317
1318
  }),
1318
- H && /* @__PURE__ */ m(ke, {
1319
+ H && /* @__PURE__ */ m(Ae, {
1319
1320
  storeOrderId: v,
1320
1321
  currency: L.selectedCurrency,
1321
- onChange: Wt
1322
+ onChange: Gt
1322
1323
  }),
1323
1324
  /* @__PURE__ */ h("div", {
1324
1325
  className: "rounded-lg border border-border-subtle bg-bg-surface p-4 sm:p-6 space-y-4",
1325
1326
  children: [
1326
- /* @__PURE__ */ m(Ee, {
1327
+ /* @__PURE__ */ m(De, {
1327
1328
  savedPaymentMethods: J,
1328
1329
  selectedPaymentMethodId: L.selectedPaymentMethodId,
1329
1330
  onSelectSavedCard: L.setSelectedPaymentMethodId,
1330
1331
  selectedProvider: L.selectedProvider,
1331
1332
  onSelectProvider: L.setPaymentProvider,
1332
- stripeEnabled: Nt,
1333
- razorpayEnabled: Pt,
1333
+ stripeEnabled: Pt,
1334
+ razorpayEnabled: Ft,
1334
1335
  canPayWithCredits: L.canPayWithCredits,
1335
1336
  availableCredits: L.availableCredits,
1336
1337
  creditsRequired: L.creditsRequired,
@@ -1338,7 +1339,7 @@ var rt = () => {
1338
1339
  saveCard: L.saveCard,
1339
1340
  onSaveCardChange: L.setSaveCard,
1340
1341
  autoRenewEnabled: k === "PLAN" && L.autoRenew,
1341
- isLoading: qt
1342
+ isLoading: Jt
1342
1343
  }),
1343
1344
  L.selectedProvider !== "CREDITS" && L.selectedProvider !== "AUTO" && /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("div", { className: "border-t border-border-subtle" }), /* @__PURE__ */ m("div", {
1344
1345
  className: "bg-bg-sunken p-4 rounded-button",
@@ -1377,7 +1378,7 @@ var rt = () => {
1377
1378
  })]
1378
1379
  })
1379
1380
  })] }),
1380
- !g && $
1381
+ !g && xn
1381
1382
  ]
1382
1383
  })
1383
1384
  ]
@@ -1391,7 +1392,7 @@ var rt = () => {
1391
1392
  children: [
1392
1393
  /* @__PURE__ */ m("div", {
1393
1394
  className: "p-4",
1394
- children: /* @__PURE__ */ m(ye, {
1395
+ children: /* @__PURE__ */ m(be, {
1395
1396
  items: L.items,
1396
1397
  subtotal: L.subtotal,
1397
1398
  discountAmount: L.discountAmount,
@@ -1408,27 +1409,28 @@ var rt = () => {
1408
1409
  isEditable: k !== "PLAN" && k !== "ORDER"
1409
1410
  })
1410
1411
  }),
1411
- !g && xn,
1412
- !g && Sn
1412
+ !g && Sn,
1413
+ !g && Cn
1413
1414
  ]
1414
1415
  }),
1415
- g && ($ || xn || Sn) && /* @__PURE__ */ h(Ie, {
1416
+ k === "PLAN" && /* @__PURE__ */ m(o, { className: "px-1" }),
1417
+ g && (xn || Sn || Cn) && /* @__PURE__ */ h(Le, {
1416
1418
  storageKey: "billing.checkout.more",
1417
1419
  label: _("billing.checkout.moreOptions", "More options"),
1418
- description: wn,
1420
+ description: Tn,
1419
1421
  contentClassName: "px-0 py-0 space-y-0",
1420
1422
  children: [
1421
- $,
1422
1423
  xn,
1423
- Sn
1424
+ Sn,
1425
+ Cn
1424
1426
  ]
1425
1427
  }),
1426
1428
  /* @__PURE__ */ m("button", {
1427
1429
  type: "button",
1428
1430
  onClick: mn,
1429
- disabled: L.isProcessing || !L.billingAccount || L.items.length === 0 || L.selectedProvider === "CREDITS" && !rn || k === "ADDON" && !O && Yt || k === "ADDON" && !O && W.length === 0 || k === "ADDON" && !O && !L.selectedSubscriptionId || H && (!U.shippingAddressId || !U.shippingMethodId),
1431
+ disabled: L.isProcessing || !L.billingAccount || L.items.length === 0 || L.selectedProvider === "CREDITS" && !an || k === "ADDON" && !O && Xt || k === "ADDON" && !O && W.length === 0 || k === "ADDON" && !O && !L.selectedSubscriptionId || H && (!U.shippingAddressId || !U.shippingMethodId),
1430
1432
  className: "w-full px-6 py-4 rounded-lg bg-action-primary-bg text-action-primary-text font-semibold\n hover:bg-action-primary-bgHover disabled:opacity-50 disabled:cursor-not-allowed\n transition-colors flex items-center justify-center gap-2",
1431
- children: L.isProcessing ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(We, { className: "size-5 animate-spin" }), "Processing…"] }) : L.selectedProvider === "CREDITS" ? "Pay with Credits" : "Proceed to Payment"
1433
+ children: L.isProcessing ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(Ge, { className: "size-5 animate-spin" }), "Processing…"] }) : L.selectedProvider === "CREDITS" ? "Pay with Credits" : "Proceed to Payment"
1432
1434
  }),
1433
1435
  /* @__PURE__ */ m("p", {
1434
1436
  className: "text-center text-xs text-text-secondary",
@@ -1438,21 +1440,21 @@ var rt = () => {
1438
1440
  })
1439
1441
  })]
1440
1442
  }),
1441
- _t && L.billingAccount && /* @__PURE__ */ m(De, {
1443
+ vt && L.billingAccount && /* @__PURE__ */ m(Oe, {
1442
1444
  billingAccountId: L.billingAccount.id,
1443
1445
  hasPhone: !!L.billingAccount.contactNumber?.trim(),
1444
1446
  hasAddress: !!(L.billingAccount.billingAddresses?.[0]?.line1?.trim() && L.billingAccount.billingAddresses?.[0]?.postalCode?.trim()),
1445
1447
  onCompleted: () => {
1446
- yt.current = !0, vt(!1), mn(), zt().then((e) => {
1447
- let t = (e.data?.myBillingAccounts ?? []).map(nt).find((e) => e?.id === L.billingAccount?.id);
1448
+ bt.current = !0, yt(!1), mn(), Bt().then((e) => {
1449
+ let t = (e.data?.myBillingAccounts ?? []).map(rt).find((e) => e?.id === L.billingAccount?.id);
1448
1450
  t && L.setBillingAccount(t);
1449
1451
  });
1450
1452
  },
1451
- onCancel: () => vt(!1)
1453
+ onCancel: () => yt(!1)
1452
1454
  })
1453
1455
  ]
1454
1456
  });
1455
1457
  };
1456
- export { rt as CheckoutPage };
1458
+ export { it as CheckoutPage };
1457
1459
 
1458
1460
  //# sourceMappingURL=CheckoutPage.js.map