@nextblock-cms/ecom 0.18.8 → 0.19.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs.js +1 -1
- package/index.es.js +26 -25
- package/lib/CurrencyProvider.cjs.js +1 -1
- package/lib/CurrencyProvider.es.js +41 -45
- package/lib/PaymentReadinessProvider.cjs.js +1 -1
- package/lib/PaymentReadinessProvider.es.js +15 -19
- package/lib/cart-store.cjs.js +1 -1
- package/lib/cart-store.d.ts +4 -0
- package/lib/cart-store.es.js +77 -69
- package/lib/components/AccountNavigationMenu.cjs.js +1 -1
- package/lib/components/AccountNavigationMenu.es.js +44 -62
- package/lib/components/AddToCartButton.cjs.js +1 -1
- package/lib/components/AddToCartButton.es.js +50 -78
- package/lib/components/Cart.cjs.js +1 -1
- package/lib/components/Cart.es.js +154 -381
- package/lib/components/CartDrawer.cjs.js +1 -1
- package/lib/components/CartDrawer.es.js +143 -297
- package/lib/components/CartIcon.cjs.js +1 -1
- package/lib/components/CartIcon.es.js +21 -47
- package/lib/components/Checkout.cjs.js +1 -1
- package/lib/components/Checkout.es.js +814 -1614
- package/lib/components/CouponForm.cjs.js +1 -1
- package/lib/components/CouponForm.es.js +104 -155
- package/lib/components/CurrencySwitcher.cjs.js +1 -1
- package/lib/components/CurrencySwitcher.es.js +14 -33
- package/lib/components/CustomerProfileForm.cjs.js +1 -1
- package/lib/components/CustomerProfileForm.es.js +264 -672
- package/lib/components/FeaturedProduct.cjs.js +1 -1
- package/lib/components/FeaturedProduct.es.js +46 -125
- package/lib/components/FreemiusLicensePanel.cjs.js +1 -1
- package/lib/components/FreemiusLicensePanel.es.js +45 -125
- package/lib/components/InvoiceDocument.cjs.js +1 -1
- package/lib/components/InvoiceDocument.es.js +148 -487
- package/lib/components/InvoiceViewerShell.cjs.js +2 -2
- package/lib/components/InvoiceViewerShell.d.ts +4 -1
- package/lib/components/InvoiceViewerShell.es.js +59 -142
- package/lib/components/ProductCard.cjs.js +1 -1
- package/lib/components/ProductCard.d.ts +3 -1
- package/lib/components/ProductCard.es.js +128 -242
- package/lib/components/ProductDetailsLayout.cjs.js +1 -1
- package/lib/components/ProductDetailsLayout.es.js +311 -652
- package/lib/components/ProductGallery.cjs.js +1 -1
- package/lib/components/ProductGallery.d.ts +2 -0
- package/lib/components/ProductGallery.es.js +37 -66
- package/lib/components/ProductGrid.cjs.js +1 -1
- package/lib/components/ProductGrid.es.js +23 -32
- package/lib/components/ShippingEstimator.cjs.js +1 -1
- package/lib/components/ShippingEstimator.es.js +118 -231
- package/lib/components/SimpleTiptapRenderer.cjs.js +1 -1
- package/lib/components/SimpleTiptapRenderer.es.js +111 -294
- package/lib/components/SubscriptionSelector.cjs.js +1 -1
- package/lib/components/SubscriptionSelector.es.js +120 -181
- package/lib/freemius-trial-provision.cjs.js +1 -0
- package/lib/freemius-trial-provision.d.ts +85 -0
- package/lib/freemius-trial-provision.es.js +136 -0
- package/lib/invoice.cjs.js +1 -1
- package/lib/invoice.d.ts +1 -1
- package/lib/invoice.es.js +6 -5
- package/lib/pages/cms/coupons/CouponEditorForm.cjs.js +1 -1
- package/lib/pages/cms/coupons/CouponEditorForm.es.js +115 -375
- package/lib/pages/cms/coupons/CouponsPage.cjs.js +2 -2
- package/lib/pages/cms/coupons/CouponsPage.es.js +116 -368
- package/lib/pages/cms/coupons/CreateCouponDialog.cjs.js +1 -1
- package/lib/pages/cms/coupons/CreateCouponDialog.es.js +26 -62
- package/lib/pages/cms/coupons/EditCouponPage.cjs.js +1 -1
- package/lib/pages/cms/coupons/EditCouponPage.es.js +35 -71
- package/lib/pages/cms/coupons/ProductScopePicker.cjs.js +1 -1
- package/lib/pages/cms/coupons/ProductScopePicker.es.js +72 -167
- package/lib/pages/cms/orders/ExportReportsDialog.cjs.js +1 -1
- package/lib/pages/cms/orders/ExportReportsDialog.es.js +87 -247
- package/lib/pages/cms/orders/OrderDetailPage.cjs.js +1 -1
- package/lib/pages/cms/orders/OrderDetailPage.es.js +95 -283
- package/lib/pages/cms/orders/OrderPrintButton.cjs.js +1 -1
- package/lib/pages/cms/orders/OrderPrintButton.es.js +9 -21
- package/lib/pages/cms/orders/OrderStatusForm.cjs.js +1 -1
- package/lib/pages/cms/orders/OrderStatusForm.es.js +46 -106
- package/lib/pages/cms/orders/OrdersPage.cjs.js +1 -1
- package/lib/pages/cms/orders/OrdersPage.es.js +78 -257
- package/lib/pages/cms/payments/PaymentsClient.cjs.js +1 -1
- package/lib/pages/cms/payments/PaymentsClient.es.js +192 -580
- package/lib/pages/cms/payments/PaymentsPage.cjs.js +1 -1
- package/lib/pages/cms/payments/PaymentsPage.es.js +14 -22
- package/lib/pages/cms/products/ProductsPage.cjs.js +1 -1
- package/lib/pages/cms/products/ProductsPage.es.js +47 -87
- package/lib/pages/cms/products/_id_/edit/EditProductPage.cjs.js +1 -1
- package/lib/pages/cms/products/_id_/edit/EditProductPage.es.js +97 -177
- package/lib/pages/cms/products/attributes/AttributeManagementPage.cjs.js +1 -1
- package/lib/pages/cms/products/attributes/AttributeManagementPage.es.js +40 -84
- package/lib/pages/cms/products/attributes/components/AttributeManager.cjs.js +1 -1
- package/lib/pages/cms/products/attributes/components/AttributeManager.es.js +192 -455
- package/lib/pages/cms/products/categories/CategoryManagementPage.cjs.js +1 -1
- package/lib/pages/cms/products/categories/CategoryManagementPage.es.js +28 -72
- package/lib/pages/cms/products/categories/components/CategoryManager.cjs.js +1 -1
- package/lib/pages/cms/products/categories/components/CategoryManager.es.js +183 -490
- package/lib/pages/cms/products/components/CopyProductFromLanguage.cjs.js +1 -1
- package/lib/pages/cms/products/components/CopyProductFromLanguage.es.js +69 -177
- package/lib/pages/cms/products/components/CurrencyPriceFields.cjs.js +1 -1
- package/lib/pages/cms/products/components/CurrencyPriceFields.es.js +102 -213
- package/lib/pages/cms/products/components/DeleteProductButton.cjs.js +1 -1
- package/lib/pages/cms/products/components/DeleteProductButton.es.js +25 -45
- package/lib/pages/cms/products/components/FreemiusPricingDashboard.cjs.js +1 -1
- package/lib/pages/cms/products/components/FreemiusPricingDashboard.es.js +58 -202
- package/lib/pages/cms/products/components/ProductCategorySelector.cjs.js +1 -1
- package/lib/pages/cms/products/components/ProductCategorySelector.es.js +89 -235
- package/lib/pages/cms/products/components/ProductForm.cjs.js +1 -1
- package/lib/pages/cms/products/components/ProductForm.es.js +526 -1110
- package/lib/pages/cms/products/components/ProductMediaManager.cjs.js +1 -1
- package/lib/pages/cms/products/components/ProductMediaManager.es.js +63 -154
- package/lib/pages/cms/products/components/ProductsBulkTable.cjs.js +1 -1
- package/lib/pages/cms/products/components/ProductsBulkTable.es.js +213 -544
- package/lib/pages/cms/products/components/SaleScheduleFields.cjs.js +1 -1
- package/lib/pages/cms/products/components/SaleScheduleFields.es.js +91 -207
- package/lib/pages/cms/products/components/SyncFreemiusButton.cjs.js +1 -1
- package/lib/pages/cms/products/components/SyncFreemiusButton.es.js +16 -28
- package/lib/pages/cms/products/components/SyncFreemiusPricingButton.cjs.js +2 -2
- package/lib/pages/cms/products/components/SyncFreemiusPricingButton.es.js +25 -37
- package/lib/pages/cms/products/components/VariationsEditor.cjs.js +1 -1
- package/lib/pages/cms/products/components/VariationsEditor.es.js +261 -492
- package/lib/pages/cms/products/inventory/InventoryPage.cjs.js +1 -1
- package/lib/pages/cms/products/inventory/InventoryPage.es.js +12 -32
- package/lib/pages/cms/products/inventory/InventoryTableClient.cjs.js +2 -2
- package/lib/pages/cms/products/inventory/InventoryTableClient.es.js +145 -365
- package/lib/pages/cms/products/new/NewProductPage.cjs.js +1 -1
- package/lib/pages/cms/products/new/NewProductPage.es.js +30 -42
- package/lib/pages/cms/shipping/ShippingPage.cjs.js +2 -2
- package/lib/pages/cms/shipping/ShippingPage.es.js +155 -507
- package/lib/pages/cms/shipping/components/RateForm.cjs.js +1 -1
- package/lib/pages/cms/shipping/components/RateForm.es.js +334 -717
- package/lib/pages/cms/shipping/components/ZoneForm.cjs.js +1 -1
- package/lib/pages/cms/shipping/components/ZoneForm.es.js +158 -392
- package/lib/pages/cms/taxes/TaxesPage.cjs.js +1 -1
- package/lib/pages/cms/taxes/TaxesPage.es.js +119 -447
- package/lib/pages/cms/taxes/components/TaxRateForm.cjs.js +1 -1
- package/lib/pages/cms/taxes/components/TaxRateForm.es.js +52 -156
- package/lib/product-context.cjs.js +1 -1
- package/lib/product-context.es.js +10 -14
- package/lib/trials.cjs.js +1 -1
- package/lib/trials.d.ts +10 -3
- package/lib/trials.es.js +28 -21
- package/lib/types.d.ts +2 -0
- package/lib/use-price-formatter.cjs.js +1 -0
- package/lib/use-price-formatter.d.ts +11 -0
- package/lib/use-price-formatter.es.js +13 -0
- package/lib/variation-utils.cjs.js +1 -1
- package/lib/variation-utils.d.ts +10 -0
- package/lib/variation-utils.es.js +139 -123
- package/package.json +4 -4
- package/server.cjs.js +1 -1
- package/server.d.ts +1 -0
- package/server.es.js +180 -172
|
@@ -1,653 +1,476 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
3
|
-
import { Badge as
|
|
4
|
-
import { Button as
|
|
5
|
-
import { Card as
|
|
6
|
-
import { Checkbox as
|
|
7
|
-
import { Input as
|
|
8
|
-
import { Label as
|
|
9
|
-
import { Separator as
|
|
10
|
-
import { RadioGroup as
|
|
11
|
-
import { Checkout as
|
|
12
|
-
import { getCartItemActivePrice as
|
|
13
|
-
import { useCart as
|
|
14
|
-
import { useState as
|
|
15
|
-
import { X as
|
|
16
|
-
import { useTranslations as
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
|
|
28
|
-
|
|
2
|
+
import { jsx as e, jsxs as r, Fragment as ht } from "react/jsx-runtime";
|
|
3
|
+
import { Badge as Xe } from "@nextblock-cms/ui/badge";
|
|
4
|
+
import { Button as we } from "@nextblock-cms/ui/button";
|
|
5
|
+
import { Card as X, CardHeader as Y, CardTitle as W, CardContent as Z } from "@nextblock-cms/ui/card";
|
|
6
|
+
import { Checkbox as gt } from "@nextblock-cms/ui/checkbox";
|
|
7
|
+
import { Input as j } from "@nextblock-cms/ui/input";
|
|
8
|
+
import { Label as b } from "@nextblock-cms/ui/label";
|
|
9
|
+
import { Separator as ft } from "@nextblock-cms/ui/separator";
|
|
10
|
+
import { RadioGroup as Ue, RadioGroupItem as Ce } from "@nextblock-cms/ui/radio-group";
|
|
11
|
+
import { Checkout as _t } from "@freemius/checkout";
|
|
12
|
+
import { getCartItemActivePrice as Ae } from "../cart-store.es.js";
|
|
13
|
+
import { useCart as yt } from "../use-cart.es.js";
|
|
14
|
+
import { useState as y, useMemo as $, useEffect as V } from "react";
|
|
15
|
+
import { X as bt, FlaskConical as xt, CreditCard as vt, ChevronRight as Nt, Loader2 as Se, Package as kt, Download as wt, MapPin as Ct } from "lucide-react";
|
|
16
|
+
import { useTranslations as Ye } from "@nextblock-cms/utils";
|
|
17
|
+
import { usePriceFormatter as St } from "../use-price-formatter.es.js";
|
|
18
|
+
import { normalizeCountryCode as $t, countries as Ft } from "../countries.es.js";
|
|
19
|
+
import { usePaymentReadiness as At } from "../PaymentReadinessProvider.es.js";
|
|
20
|
+
import { getShippingEstimates as Tt } from "../server-actions/shipping-actions.es.js";
|
|
21
|
+
import { getTaxEstimate as jt } from "../server-actions/tax-actions.es.js";
|
|
22
|
+
import { isDigitalItem as $e } from "../types.es.js";
|
|
23
|
+
import { countryUsesStructuredStates as pe, getStatesForCountry as Je } from "../states.es.js";
|
|
24
|
+
import { addressesMatch as Et, emptyCustomerAddress as It, normalizeCustomerAddress as Te, isCustomerAddressComplete as Ge } from "../customer.es.js";
|
|
25
|
+
import { useCurrency as Mt } from "../CurrencyProvider.es.js";
|
|
26
|
+
import { getTrialSummary as He } from "../trials.es.js";
|
|
27
|
+
import { CouponForm as Dt } from "./CouponForm.es.js";
|
|
28
|
+
const Lt = process.env.NEXT_PUBLIC_IS_SANDBOX === "true", me = "nextblock-checkout-draft-v1";
|
|
29
|
+
function ue(n, a) {
|
|
29
30
|
return {
|
|
30
|
-
...
|
|
31
|
+
...It(),
|
|
31
32
|
company_name: n?.company_name || "",
|
|
32
|
-
recipient_name: n?.recipient_name ||
|
|
33
|
+
recipient_name: n?.recipient_name || a || "",
|
|
33
34
|
line1: n?.line1 || "",
|
|
34
35
|
line2: n?.line2 || "",
|
|
35
36
|
city: n?.city || "",
|
|
36
37
|
state: n?.state || "",
|
|
37
38
|
postal_code: n?.postal_code || "",
|
|
38
|
-
country_code:
|
|
39
|
+
country_code: $t(n?.country_code) || "CA"
|
|
39
40
|
};
|
|
40
41
|
}
|
|
41
|
-
function
|
|
42
|
-
const
|
|
43
|
-
return !(!
|
|
42
|
+
function Rt(n) {
|
|
43
|
+
const a = Te(n);
|
|
44
|
+
return !(!a?.country_code || !a.postal_code || pe(a.country_code) && !a.state);
|
|
44
45
|
}
|
|
45
|
-
function
|
|
46
|
-
return n.reduce((
|
|
47
|
-
const { price:
|
|
48
|
-
currencyCode:
|
|
49
|
-
currencies:
|
|
46
|
+
function Fe(n, a, F) {
|
|
47
|
+
return n.reduce((u, f) => {
|
|
48
|
+
const { price: g, sale_price: A } = Ae(f, {
|
|
49
|
+
currencyCode: a,
|
|
50
|
+
currencies: F
|
|
50
51
|
});
|
|
51
|
-
return
|
|
52
|
+
return u + (A ?? g) * f.quantity;
|
|
52
53
|
}, 0);
|
|
53
54
|
}
|
|
54
|
-
function
|
|
55
|
+
function Qe({
|
|
55
56
|
idPrefix: n,
|
|
56
|
-
title:
|
|
57
|
-
description:
|
|
58
|
-
value:
|
|
59
|
-
onChange:
|
|
57
|
+
title: a,
|
|
58
|
+
description: F,
|
|
59
|
+
value: u,
|
|
60
|
+
onChange: f
|
|
60
61
|
}) {
|
|
61
|
-
const { t:
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}, this)
|
|
81
|
-
] }, void 0, !0, {
|
|
82
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
83
|
-
lineNumber: 133,
|
|
84
|
-
columnNumber: 7
|
|
85
|
-
}, this),
|
|
86
|
-
/* @__PURE__ */ e(V, { className: "space-y-4", children: [
|
|
87
|
-
/* @__PURE__ */ e("div", { className: "grid gap-4 sm:grid-cols-3", children: [
|
|
88
|
-
/* @__PURE__ */ e("div", { className: "space-y-2", children: [
|
|
89
|
-
/* @__PURE__ */ e(v, { htmlFor: `${n}-company`, children: S }, void 0, !1, {
|
|
90
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
91
|
-
lineNumber: 143,
|
|
92
|
-
columnNumber: 13
|
|
93
|
-
}, this),
|
|
62
|
+
const { t: g, lang: A } = Ye(), E = $(() => {
|
|
63
|
+
try {
|
|
64
|
+
return new Intl.DisplayNames([A], { type: "region" });
|
|
65
|
+
} catch {
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
}, [A]), I = g("company_name") === "company_name" ? "Company name" : g("company_name"), ee = g("select_an_option") === "select_an_option" ? "Select an option" : g("select_an_option"), q = g("state_province") === "state_province" ? "State / Province" : g("state_province"), U = Je(u.country_code), K = pe(u.country_code);
|
|
69
|
+
return /* @__PURE__ */ r(X, { children: [
|
|
70
|
+
/* @__PURE__ */ r(Y, { children: [
|
|
71
|
+
/* @__PURE__ */ r(W, { role: "heading", "aria-level": 2, className: "flex items-center gap-2", children: [
|
|
72
|
+
/* @__PURE__ */ e(Ct, { className: "w-5 h-5" }),
|
|
73
|
+
a
|
|
74
|
+
] }),
|
|
75
|
+
/* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: F })
|
|
76
|
+
] }),
|
|
77
|
+
/* @__PURE__ */ r(Z, { className: "space-y-4", children: [
|
|
78
|
+
/* @__PURE__ */ r("div", { className: "grid gap-4 sm:grid-cols-3", children: [
|
|
79
|
+
/* @__PURE__ */ r("div", { className: "space-y-2", children: [
|
|
80
|
+
/* @__PURE__ */ e(b, { htmlFor: `${n}-company`, children: I }),
|
|
94
81
|
/* @__PURE__ */ e(
|
|
95
|
-
|
|
82
|
+
j,
|
|
96
83
|
{
|
|
97
84
|
id: `${n}-company`,
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
{
|
|
104
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
105
|
-
lineNumber: 144,
|
|
106
|
-
columnNumber: 13
|
|
107
|
-
},
|
|
108
|
-
this
|
|
85
|
+
name: `${n}-company`,
|
|
86
|
+
autoComplete: `${n} organization`,
|
|
87
|
+
value: u.company_name,
|
|
88
|
+
onChange: (m) => f({ ...u, company_name: m.target.value })
|
|
89
|
+
}
|
|
109
90
|
)
|
|
110
|
-
] },
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
columnNumber: 11
|
|
114
|
-
}, this),
|
|
115
|
-
/* @__PURE__ */ e("div", { className: "space-y-2", children: [
|
|
116
|
-
/* @__PURE__ */ e(v, { htmlFor: `${n}-name`, children: N("full_name") }, void 0, !1, {
|
|
117
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
118
|
-
lineNumber: 151,
|
|
119
|
-
columnNumber: 13
|
|
120
|
-
}, this),
|
|
91
|
+
] }),
|
|
92
|
+
/* @__PURE__ */ r("div", { className: "space-y-2", children: [
|
|
93
|
+
/* @__PURE__ */ e(b, { htmlFor: `${n}-name`, children: g("full_name") }),
|
|
121
94
|
/* @__PURE__ */ e(
|
|
122
|
-
|
|
95
|
+
j,
|
|
123
96
|
{
|
|
124
97
|
id: `${n}-name`,
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
132
|
-
lineNumber: 152,
|
|
133
|
-
columnNumber: 13
|
|
134
|
-
},
|
|
135
|
-
this
|
|
98
|
+
name: `${n}-name`,
|
|
99
|
+
autoComplete: `${n} name`,
|
|
100
|
+
required: !0,
|
|
101
|
+
value: u.recipient_name,
|
|
102
|
+
onChange: (m) => f({ ...u, recipient_name: m.target.value })
|
|
103
|
+
}
|
|
136
104
|
)
|
|
137
|
-
] },
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
columnNumber: 11
|
|
141
|
-
}, this),
|
|
142
|
-
/* @__PURE__ */ e("div", { className: "space-y-2", children: [
|
|
143
|
-
/* @__PURE__ */ e(v, { htmlFor: `${n}-country`, children: N("country") }, void 0, !1, {
|
|
144
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
145
|
-
lineNumber: 159,
|
|
146
|
-
columnNumber: 13
|
|
147
|
-
}, this),
|
|
105
|
+
] }),
|
|
106
|
+
/* @__PURE__ */ r("div", { className: "space-y-2", children: [
|
|
107
|
+
/* @__PURE__ */ e(b, { htmlFor: `${n}-country`, children: g("country") }),
|
|
148
108
|
/* @__PURE__ */ e(
|
|
149
109
|
"select",
|
|
150
110
|
{
|
|
151
111
|
id: `${n}-country`,
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
112
|
+
name: `${n}-country`,
|
|
113
|
+
autoComplete: `${n} country`,
|
|
114
|
+
required: !0,
|
|
115
|
+
className: "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
116
|
+
value: u.country_code,
|
|
117
|
+
onChange: (m) => {
|
|
118
|
+
const te = m.target.value, re = Je(te);
|
|
119
|
+
f({
|
|
120
|
+
...u,
|
|
121
|
+
country_code: te,
|
|
122
|
+
state: re.some((he) => he.code === u.state) ? u.state : ""
|
|
160
123
|
});
|
|
161
124
|
},
|
|
162
|
-
children:
|
|
163
|
-
|
|
164
|
-
lineNumber: 175,
|
|
165
|
-
columnNumber: 17
|
|
166
|
-
}, this))
|
|
167
|
-
},
|
|
168
|
-
void 0,
|
|
169
|
-
!1,
|
|
170
|
-
{
|
|
171
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
172
|
-
lineNumber: 160,
|
|
173
|
-
columnNumber: 13
|
|
174
|
-
},
|
|
175
|
-
this
|
|
125
|
+
children: Ft.map((m) => /* @__PURE__ */ e("option", { value: m.code, children: E?.of(m.code) ?? m.name }, m.code))
|
|
126
|
+
}
|
|
176
127
|
)
|
|
177
|
-
] }
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
}, this)
|
|
182
|
-
] }, void 0, !0, {
|
|
183
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
184
|
-
lineNumber: 141,
|
|
185
|
-
columnNumber: 9
|
|
186
|
-
}, this),
|
|
187
|
-
/* @__PURE__ */ e("div", { className: "space-y-2", children: [
|
|
188
|
-
/* @__PURE__ */ e(v, { htmlFor: `${n}-line1`, children: N("address_line_1") }, void 0, !1, {
|
|
189
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
190
|
-
lineNumber: 184,
|
|
191
|
-
columnNumber: 11
|
|
192
|
-
}, this),
|
|
128
|
+
] })
|
|
129
|
+
] }),
|
|
130
|
+
/* @__PURE__ */ r("div", { className: "space-y-2", children: [
|
|
131
|
+
/* @__PURE__ */ e(b, { htmlFor: `${n}-line1`, children: g("address_line_1") }),
|
|
193
132
|
/* @__PURE__ */ e(
|
|
194
|
-
|
|
133
|
+
j,
|
|
195
134
|
{
|
|
196
135
|
id: `${n}-line1`,
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
204
|
-
lineNumber: 185,
|
|
205
|
-
columnNumber: 11
|
|
206
|
-
},
|
|
207
|
-
this
|
|
136
|
+
name: `${n}-line1`,
|
|
137
|
+
autoComplete: `${n} address-line1`,
|
|
138
|
+
required: !0,
|
|
139
|
+
value: u.line1,
|
|
140
|
+
onChange: (m) => f({ ...u, line1: m.target.value })
|
|
141
|
+
}
|
|
208
142
|
)
|
|
209
|
-
] },
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
columnNumber: 9
|
|
213
|
-
}, this),
|
|
214
|
-
/* @__PURE__ */ e("div", { className: "space-y-2", children: [
|
|
215
|
-
/* @__PURE__ */ e(v, { htmlFor: `${n}-line2`, children: N("address_line_2") }, void 0, !1, {
|
|
216
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
217
|
-
lineNumber: 193,
|
|
218
|
-
columnNumber: 11
|
|
219
|
-
}, this),
|
|
143
|
+
] }),
|
|
144
|
+
/* @__PURE__ */ r("div", { className: "space-y-2", children: [
|
|
145
|
+
/* @__PURE__ */ e(b, { htmlFor: `${n}-line2`, children: g("address_line_2") }),
|
|
220
146
|
/* @__PURE__ */ e(
|
|
221
|
-
|
|
147
|
+
j,
|
|
222
148
|
{
|
|
223
149
|
id: `${n}-line2`,
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
{
|
|
230
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
231
|
-
lineNumber: 194,
|
|
232
|
-
columnNumber: 11
|
|
233
|
-
},
|
|
234
|
-
this
|
|
150
|
+
name: `${n}-line2`,
|
|
151
|
+
autoComplete: `${n} address-line2`,
|
|
152
|
+
value: u.line2,
|
|
153
|
+
onChange: (m) => f({ ...u, line2: m.target.value })
|
|
154
|
+
}
|
|
235
155
|
)
|
|
236
|
-
] },
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
}, this),
|
|
241
|
-
/* @__PURE__ */ e("div", { className: "grid gap-4 sm:grid-cols-3", children: [
|
|
242
|
-
/* @__PURE__ */ e("div", { className: "space-y-2", children: [
|
|
243
|
-
/* @__PURE__ */ e(v, { htmlFor: `${n}-city`, children: N("city") }, void 0, !1, {
|
|
244
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
245
|
-
lineNumber: 203,
|
|
246
|
-
columnNumber: 13
|
|
247
|
-
}, this),
|
|
156
|
+
] }),
|
|
157
|
+
/* @__PURE__ */ r("div", { className: "grid gap-4 sm:grid-cols-3", children: [
|
|
158
|
+
/* @__PURE__ */ r("div", { className: "space-y-2", children: [
|
|
159
|
+
/* @__PURE__ */ e(b, { htmlFor: `${n}-city`, children: g("city") }),
|
|
248
160
|
/* @__PURE__ */ e(
|
|
249
|
-
|
|
161
|
+
j,
|
|
250
162
|
{
|
|
251
163
|
id: `${n}-city`,
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
259
|
-
lineNumber: 204,
|
|
260
|
-
columnNumber: 13
|
|
261
|
-
},
|
|
262
|
-
this
|
|
164
|
+
name: `${n}-city`,
|
|
165
|
+
autoComplete: `${n} address-level2`,
|
|
166
|
+
required: !0,
|
|
167
|
+
value: u.city,
|
|
168
|
+
onChange: (m) => f({ ...u, city: m.target.value })
|
|
169
|
+
}
|
|
263
170
|
)
|
|
264
|
-
] },
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
}, this),
|
|
269
|
-
/* @__PURE__ */ e("div", { className: "space-y-2", children: [
|
|
270
|
-
/* @__PURE__ */ e(v, { htmlFor: `${n}-state`, children: N("state_province") }, void 0, !1, {
|
|
271
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
272
|
-
lineNumber: 211,
|
|
273
|
-
columnNumber: 13
|
|
274
|
-
}, this),
|
|
275
|
-
z ? /* @__PURE__ */ e(
|
|
171
|
+
] }),
|
|
172
|
+
/* @__PURE__ */ r("div", { className: "space-y-2", children: [
|
|
173
|
+
/* @__PURE__ */ e(b, { htmlFor: `${n}-state`, children: g("state_province") }),
|
|
174
|
+
K ? /* @__PURE__ */ r(
|
|
276
175
|
"select",
|
|
277
176
|
{
|
|
278
177
|
id: `${n}-state`,
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
178
|
+
name: `${n}-state`,
|
|
179
|
+
autoComplete: `${n} address-level1`,
|
|
180
|
+
required: !0,
|
|
181
|
+
className: "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
182
|
+
value: u.state,
|
|
183
|
+
onChange: (m) => f({ ...u, state: m.target.value }),
|
|
282
184
|
children: [
|
|
283
|
-
/* @__PURE__ */ e("option", { value: "", children: `${
|
|
284
|
-
|
|
285
|
-
lineNumber: 219,
|
|
286
|
-
columnNumber: 17
|
|
287
|
-
}, this),
|
|
288
|
-
L.map((l) => /* @__PURE__ */ e("option", { value: l.code, children: l.name }, l.code, !1, {
|
|
289
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
290
|
-
lineNumber: 221,
|
|
291
|
-
columnNumber: 19
|
|
292
|
-
}, this))
|
|
185
|
+
/* @__PURE__ */ e("option", { value: "", children: `${ee}: ${q}` }),
|
|
186
|
+
U.map((m) => /* @__PURE__ */ e("option", { value: m.code, children: m.name }, m.code))
|
|
293
187
|
]
|
|
294
|
-
}
|
|
295
|
-
void 0,
|
|
296
|
-
!0,
|
|
297
|
-
{
|
|
298
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
299
|
-
lineNumber: 213,
|
|
300
|
-
columnNumber: 15
|
|
301
|
-
},
|
|
302
|
-
this
|
|
188
|
+
}
|
|
303
189
|
) : /* @__PURE__ */ e(
|
|
304
|
-
|
|
190
|
+
j,
|
|
305
191
|
{
|
|
306
192
|
id: `${n}-state`,
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
{
|
|
313
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
314
|
-
lineNumber: 227,
|
|
315
|
-
columnNumber: 15
|
|
316
|
-
},
|
|
317
|
-
this
|
|
193
|
+
name: `${n}-state`,
|
|
194
|
+
autoComplete: `${n} address-level1`,
|
|
195
|
+
value: u.state,
|
|
196
|
+
onChange: (m) => f({ ...u, state: m.target.value })
|
|
197
|
+
}
|
|
318
198
|
)
|
|
319
|
-
] },
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
columnNumber: 11
|
|
323
|
-
}, this),
|
|
324
|
-
/* @__PURE__ */ e("div", { className: "space-y-2", children: [
|
|
325
|
-
/* @__PURE__ */ e(v, { htmlFor: `${n}-postal`, children: N("postal_zip_code") }, void 0, !1, {
|
|
326
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
327
|
-
lineNumber: 235,
|
|
328
|
-
columnNumber: 13
|
|
329
|
-
}, this),
|
|
199
|
+
] }),
|
|
200
|
+
/* @__PURE__ */ r("div", { className: "space-y-2", children: [
|
|
201
|
+
/* @__PURE__ */ e(b, { htmlFor: `${n}-postal`, children: g("postal_zip_code") }),
|
|
330
202
|
/* @__PURE__ */ e(
|
|
331
|
-
|
|
203
|
+
j,
|
|
332
204
|
{
|
|
333
205
|
id: `${n}-postal`,
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
341
|
-
lineNumber: 236,
|
|
342
|
-
columnNumber: 13
|
|
343
|
-
},
|
|
344
|
-
this
|
|
206
|
+
name: `${n}-postal`,
|
|
207
|
+
autoComplete: `${n} postal-code`,
|
|
208
|
+
required: !0,
|
|
209
|
+
value: u.postal_code,
|
|
210
|
+
onChange: (m) => f({ ...u, postal_code: m.target.value })
|
|
211
|
+
}
|
|
345
212
|
)
|
|
346
|
-
] }
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
}, this)
|
|
351
|
-
] }, void 0, !0, {
|
|
352
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
353
|
-
lineNumber: 201,
|
|
354
|
-
columnNumber: 9
|
|
355
|
-
}, this)
|
|
356
|
-
] }, void 0, !0, {
|
|
357
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
358
|
-
lineNumber: 140,
|
|
359
|
-
columnNumber: 7
|
|
360
|
-
}, this)
|
|
361
|
-
] }, void 0, !0, {
|
|
362
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
363
|
-
lineNumber: 132,
|
|
364
|
-
columnNumber: 5
|
|
365
|
-
}, this);
|
|
213
|
+
] })
|
|
214
|
+
] })
|
|
215
|
+
] })
|
|
216
|
+
] });
|
|
366
217
|
}
|
|
367
|
-
function
|
|
218
|
+
function Ve({
|
|
368
219
|
title: n,
|
|
369
|
-
description:
|
|
370
|
-
badgeLabel:
|
|
371
|
-
children:
|
|
220
|
+
description: a,
|
|
221
|
+
badgeLabel: F,
|
|
222
|
+
children: u
|
|
372
223
|
}) {
|
|
373
|
-
return /* @__PURE__ */
|
|
374
|
-
/* @__PURE__ */ e(
|
|
375
|
-
/* @__PURE__ */
|
|
376
|
-
/* @__PURE__ */ e(
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
lineNumber: 265,
|
|
384
|
-
columnNumber: 13
|
|
385
|
-
}, this)
|
|
386
|
-
] }, void 0, !0, {
|
|
387
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
388
|
-
lineNumber: 263,
|
|
389
|
-
columnNumber: 11
|
|
390
|
-
}, this),
|
|
391
|
-
w ? /* @__PURE__ */ e(qe, { variant: "secondary", children: w }, void 0, !1, {
|
|
392
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
393
|
-
lineNumber: 267,
|
|
394
|
-
columnNumber: 25
|
|
395
|
-
}, this) : null
|
|
396
|
-
] }, void 0, !0, {
|
|
397
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
398
|
-
lineNumber: 262,
|
|
399
|
-
columnNumber: 9
|
|
400
|
-
}, this) }, void 0, !1, {
|
|
401
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
402
|
-
lineNumber: 261,
|
|
403
|
-
columnNumber: 7
|
|
404
|
-
}, this),
|
|
405
|
-
/* @__PURE__ */ e(V, { className: "space-y-4", children: i }, void 0, !1, {
|
|
406
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
407
|
-
lineNumber: 270,
|
|
408
|
-
columnNumber: 7
|
|
409
|
-
}, this)
|
|
410
|
-
] }, void 0, !0, {
|
|
411
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
412
|
-
lineNumber: 260,
|
|
413
|
-
columnNumber: 5
|
|
414
|
-
}, this);
|
|
224
|
+
return /* @__PURE__ */ r(X, { children: [
|
|
225
|
+
/* @__PURE__ */ e(Y, { children: /* @__PURE__ */ r("div", { className: "flex items-center justify-between gap-3 flex-wrap", children: [
|
|
226
|
+
/* @__PURE__ */ r("div", { children: [
|
|
227
|
+
/* @__PURE__ */ e(W, { role: "heading", "aria-level": 2, children: n }),
|
|
228
|
+
/* @__PURE__ */ e("p", { className: "mt-1 text-sm text-muted-foreground", children: a })
|
|
229
|
+
] }),
|
|
230
|
+
F ? /* @__PURE__ */ e(Xe, { variant: "secondary", children: F }) : null
|
|
231
|
+
] }) }),
|
|
232
|
+
/* @__PURE__ */ e(Z, { className: "space-y-4", children: u })
|
|
233
|
+
] });
|
|
415
234
|
}
|
|
416
|
-
const
|
|
417
|
-
const [
|
|
418
|
-
() =>
|
|
419
|
-
), [
|
|
420
|
-
() =>
|
|
235
|
+
const dr = ({ initialCustomer: n }) => {
|
|
236
|
+
const a = St(), [F, u] = y({}), [f, g] = y(null), [A, E] = y({}), [I, ee] = y(n?.email || ""), [q, U] = y(""), [K, m] = y(n?.phone || ""), [te, re] = y(!1), [he, je] = y(null), [Ee, ne] = y(!1), [We, Ie] = y(!1), [Ze, le] = y(!1), [J, G] = y([]), [T, z] = y(null), [k, ce] = y(null), [M, et] = y(null), [w, Me] = y(
|
|
237
|
+
() => ue(n?.billingAddress, n?.fullName)
|
|
238
|
+
), [B, De] = y(
|
|
239
|
+
() => ue(
|
|
421
240
|
n?.shippingAddress ?? n?.billingAddress,
|
|
422
241
|
n?.fullName
|
|
423
242
|
)
|
|
424
|
-
), [
|
|
425
|
-
!n?.shippingAddress ||
|
|
426
|
-
),
|
|
427
|
-
() =>
|
|
428
|
-
[
|
|
429
|
-
),
|
|
430
|
-
() =>
|
|
431
|
-
[
|
|
432
|
-
), P = n?.isAuthenticated ?? !1,
|
|
433
|
-
const
|
|
434
|
-
if (
|
|
435
|
-
return
|
|
436
|
-
if (!
|
|
437
|
-
return
|
|
438
|
-
let
|
|
439
|
-
return Object.entries(
|
|
440
|
-
|
|
441
|
-
new RegExp(`\\{${
|
|
442
|
-
String(
|
|
243
|
+
), [D, Le] = y(
|
|
244
|
+
!n?.shippingAddress || Et(n?.billingAddress, n?.shippingAddress)
|
|
245
|
+
), H = yt((t) => t), { t: c, lang: ge } = Ye(), { activeCurrencyCode: o, currencies: L } = Mt(), Re = At(), x = H?.items ?? [], v = $(
|
|
246
|
+
() => x.filter((t) => !$e(t)),
|
|
247
|
+
[x]
|
|
248
|
+
), C = $(
|
|
249
|
+
() => x.filter((t) => $e(t)),
|
|
250
|
+
[x]
|
|
251
|
+
), P = n?.isAuthenticated ?? !1, l = (t, s, h) => {
|
|
252
|
+
const i = c(t, h);
|
|
253
|
+
if (i !== t)
|
|
254
|
+
return i;
|
|
255
|
+
if (!h)
|
|
256
|
+
return s;
|
|
257
|
+
let _ = s;
|
|
258
|
+
return Object.entries(h).forEach(([p, d]) => {
|
|
259
|
+
_ = _.replace(
|
|
260
|
+
new RegExp(`\\{${p}\\}`, "g"),
|
|
261
|
+
String(d)
|
|
443
262
|
);
|
|
444
|
-
}),
|
|
445
|
-
},
|
|
446
|
-
() =>
|
|
447
|
-
[
|
|
448
|
-
),
|
|
449
|
-
() =>
|
|
450
|
-
[
|
|
451
|
-
),
|
|
452
|
-
() =>
|
|
453
|
-
[
|
|
454
|
-
),
|
|
455
|
-
() =>
|
|
456
|
-
[
|
|
457
|
-
),
|
|
458
|
-
() =>
|
|
459
|
-
[
|
|
460
|
-
),
|
|
461
|
-
() =>
|
|
462
|
-
[
|
|
463
|
-
),
|
|
464
|
-
() =>
|
|
465
|
-
[
|
|
466
|
-
),
|
|
467
|
-
if (
|
|
263
|
+
}), _;
|
|
264
|
+
}, N = v.length > 0, tt = $(
|
|
265
|
+
() => Fe(x, o, L),
|
|
266
|
+
[o, L, x]
|
|
267
|
+
), fe = $(
|
|
268
|
+
() => Fe(v, o, L),
|
|
269
|
+
[o, L, v]
|
|
270
|
+
), _e = $(
|
|
271
|
+
() => Fe(C, o, L),
|
|
272
|
+
[o, L, C]
|
|
273
|
+
), ye = M?.providerDiscounts.stripe ?? 0, be = M?.providerDiscounts.freemius ?? 0, se = Math.max(0, fe - ye), rt = Math.max(0, _e - be), S = $(
|
|
274
|
+
() => D ? w : B,
|
|
275
|
+
[w, B, D]
|
|
276
|
+
), O = $(
|
|
277
|
+
() => N ? S : w,
|
|
278
|
+
[w, N, S]
|
|
279
|
+
), ie = !N || Rt(S), oe = $(
|
|
280
|
+
() => J.find((t) => t.id === T),
|
|
281
|
+
[J, T]
|
|
282
|
+
), qe = $(
|
|
283
|
+
() => se + (oe?.amount ?? 0) + (k && !k.isPendingExternalCalculation ? k.amount : 0),
|
|
284
|
+
[se, oe, k]
|
|
285
|
+
), nt = qe + rt;
|
|
286
|
+
if (V(() => {
|
|
468
287
|
if (!(P || typeof window > "u"))
|
|
469
288
|
try {
|
|
470
|
-
const
|
|
471
|
-
if (!
|
|
289
|
+
const t = window.localStorage.getItem(me);
|
|
290
|
+
if (!t)
|
|
472
291
|
return;
|
|
473
|
-
const
|
|
474
|
-
|
|
475
|
-
} catch (
|
|
476
|
-
console.error("[Checkout] Failed to restore checkout draft:",
|
|
292
|
+
const s = JSON.parse(t);
|
|
293
|
+
s.email && ee(s.email), s.phone && m(s.phone), s.billingAddress && Me(ue(s.billingAddress)), s.shippingAddress && De(ue(s.shippingAddress)), typeof s.useBillingForShipping == "boolean" && Le(s.useBillingForShipping), (typeof s.selectedMethodId == "string" || s.selectedMethodId === null) && z(s.selectedMethodId);
|
|
294
|
+
} catch (t) {
|
|
295
|
+
console.error("[Checkout] Failed to restore checkout draft:", t);
|
|
477
296
|
}
|
|
478
|
-
}, [P]),
|
|
479
|
-
if (!(typeof window > "u"))
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
297
|
+
}, [P]), V(() => {
|
|
298
|
+
if (!(typeof window > "u"))
|
|
299
|
+
try {
|
|
300
|
+
if (P) {
|
|
301
|
+
window.localStorage.removeItem(me);
|
|
302
|
+
return;
|
|
303
|
+
}
|
|
304
|
+
window.localStorage.setItem(
|
|
305
|
+
me,
|
|
306
|
+
JSON.stringify({
|
|
307
|
+
email: I,
|
|
308
|
+
phone: K,
|
|
309
|
+
billingAddress: w,
|
|
310
|
+
shippingAddress: B,
|
|
311
|
+
useBillingForShipping: D,
|
|
312
|
+
selectedMethodId: T
|
|
313
|
+
})
|
|
314
|
+
);
|
|
315
|
+
} catch {
|
|
483
316
|
}
|
|
484
|
-
window.localStorage.setItem(
|
|
485
|
-
te,
|
|
486
|
-
JSON.stringify({
|
|
487
|
-
email: F,
|
|
488
|
-
phone: l,
|
|
489
|
-
billingAddress: B,
|
|
490
|
-
shippingAddress: M,
|
|
491
|
-
useBillingForShipping: $,
|
|
492
|
-
selectedMethodId: x
|
|
493
|
-
})
|
|
494
|
-
);
|
|
495
|
-
}
|
|
496
317
|
}, [
|
|
497
|
-
|
|
498
|
-
|
|
318
|
+
w,
|
|
319
|
+
I,
|
|
499
320
|
P,
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
]),
|
|
505
|
-
if (!
|
|
506
|
-
|
|
321
|
+
K,
|
|
322
|
+
T,
|
|
323
|
+
B,
|
|
324
|
+
D
|
|
325
|
+
]), V(() => {
|
|
326
|
+
if (!N) {
|
|
327
|
+
G([]), z(null), ne(!1);
|
|
507
328
|
return;
|
|
508
329
|
}
|
|
509
|
-
if (!
|
|
510
|
-
|
|
330
|
+
if (!ie) {
|
|
331
|
+
G([]), z(null), ne(!1);
|
|
511
332
|
return;
|
|
512
333
|
}
|
|
513
|
-
let
|
|
514
|
-
const
|
|
515
|
-
if (
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
334
|
+
let t = !1;
|
|
335
|
+
const h = setTimeout(async () => {
|
|
336
|
+
if (S.country_code) {
|
|
337
|
+
ne(!0), Ie(!1);
|
|
338
|
+
try {
|
|
339
|
+
const i = await Tt(
|
|
340
|
+
se,
|
|
341
|
+
{
|
|
342
|
+
country: S.country_code,
|
|
343
|
+
state: S.state,
|
|
344
|
+
postal_code: S.postal_code
|
|
345
|
+
},
|
|
346
|
+
ge,
|
|
347
|
+
o
|
|
348
|
+
);
|
|
349
|
+
if (t)
|
|
350
|
+
return;
|
|
351
|
+
if (i.success && i.methods) {
|
|
352
|
+
const _ = i.methods;
|
|
353
|
+
G(_), z(
|
|
354
|
+
(p) => p && _.some((d) => d.id === p) ? p : _[0]?.id ?? null
|
|
355
|
+
);
|
|
356
|
+
} else
|
|
357
|
+
G([]), z(null);
|
|
358
|
+
} catch (i) {
|
|
359
|
+
if (t)
|
|
360
|
+
return;
|
|
361
|
+
console.error("[Checkout] Failed to load shipping rates:", i), G([]), z(null), Ie(!0);
|
|
362
|
+
} finally {
|
|
363
|
+
t || ne(!1);
|
|
364
|
+
}
|
|
365
|
+
}
|
|
529
366
|
}, 400);
|
|
530
367
|
return () => {
|
|
531
|
-
|
|
368
|
+
t = !0, clearTimeout(h);
|
|
532
369
|
};
|
|
533
370
|
}, [
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
const
|
|
545
|
-
if (!
|
|
546
|
-
|
|
371
|
+
o,
|
|
372
|
+
N,
|
|
373
|
+
ie,
|
|
374
|
+
ge,
|
|
375
|
+
S.country_code,
|
|
376
|
+
S.postal_code,
|
|
377
|
+
S.state,
|
|
378
|
+
se
|
|
379
|
+
]), V(() => {
|
|
380
|
+
let t = !1;
|
|
381
|
+
const h = setTimeout(async () => {
|
|
382
|
+
if (!N || !O.country_code) {
|
|
383
|
+
le(!1), ce(null);
|
|
547
384
|
return;
|
|
548
385
|
}
|
|
549
|
-
if (
|
|
550
|
-
|
|
386
|
+
if (pe(O.country_code) && !O.state) {
|
|
387
|
+
le(!1), ce(null);
|
|
551
388
|
return;
|
|
552
389
|
}
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
390
|
+
le(!0);
|
|
391
|
+
try {
|
|
392
|
+
const i = await jt(
|
|
393
|
+
v,
|
|
394
|
+
{
|
|
395
|
+
country_code: O.country_code,
|
|
396
|
+
state: O.state
|
|
397
|
+
},
|
|
398
|
+
o,
|
|
399
|
+
M?.code ?? null,
|
|
400
|
+
x
|
|
401
|
+
);
|
|
402
|
+
if (t)
|
|
403
|
+
return;
|
|
404
|
+
ce(i.success && i.tax ? i.tax : null);
|
|
405
|
+
} catch (i) {
|
|
406
|
+
if (t)
|
|
407
|
+
return;
|
|
408
|
+
console.error("[Checkout] Failed to load the tax estimate:", i), ce(null);
|
|
409
|
+
} finally {
|
|
410
|
+
t || le(!1);
|
|
411
|
+
}
|
|
565
412
|
}, 300);
|
|
566
|
-
return () =>
|
|
413
|
+
return () => {
|
|
414
|
+
t = !0, clearTimeout(h);
|
|
415
|
+
};
|
|
567
416
|
}, [
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
]),
|
|
417
|
+
o,
|
|
418
|
+
N,
|
|
419
|
+
v,
|
|
420
|
+
O.country_code,
|
|
421
|
+
O.state,
|
|
422
|
+
M?.code,
|
|
423
|
+
x
|
|
424
|
+
]), V(() => {
|
|
425
|
+
const t = (s) => {
|
|
426
|
+
s.persisted && g(null);
|
|
427
|
+
};
|
|
428
|
+
return window.addEventListener("pageshow", t), () => window.removeEventListener("pageshow", t);
|
|
429
|
+
}, []), !H)
|
|
576
430
|
return null;
|
|
577
|
-
const
|
|
578
|
-
|
|
579
|
-
},
|
|
431
|
+
const xe = () => {
|
|
432
|
+
re(!1), je(null);
|
|
433
|
+
}, ze = te ? /* @__PURE__ */ e(
|
|
580
434
|
"div",
|
|
581
435
|
{
|
|
582
|
-
className: "fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",
|
|
583
|
-
onClick:
|
|
584
|
-
|
|
436
|
+
className: "fixed inset-0 z-50 flex items-center justify-center overscroll-contain bg-black/60 backdrop-blur-sm",
|
|
437
|
+
onClick: xe,
|
|
438
|
+
onKeyDown: (t) => {
|
|
439
|
+
t.key === "Escape" && xe();
|
|
440
|
+
},
|
|
441
|
+
children: /* @__PURE__ */ r(
|
|
585
442
|
"div",
|
|
586
443
|
{
|
|
444
|
+
role: "dialog",
|
|
445
|
+
"aria-modal": "true",
|
|
446
|
+
"aria-labelledby": "sandbox-checkout-title",
|
|
587
447
|
className: "relative bg-background border rounded-xl shadow-2xl p-8 max-w-md mx-4",
|
|
588
|
-
onClick: (
|
|
448
|
+
onClick: (t) => t.stopPropagation(),
|
|
589
449
|
children: [
|
|
590
450
|
/* @__PURE__ */ e(
|
|
591
451
|
"button",
|
|
592
452
|
{
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
},
|
|
601
|
-
void 0,
|
|
602
|
-
!1,
|
|
603
|
-
{
|
|
604
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
605
|
-
lineNumber: 600,
|
|
606
|
-
columnNumber: 9
|
|
607
|
-
},
|
|
608
|
-
void 0
|
|
453
|
+
type: "button",
|
|
454
|
+
autoFocus: !0,
|
|
455
|
+
onClick: xe,
|
|
456
|
+
"aria-label": l("close", "Close"),
|
|
457
|
+
className: "absolute top-4 right-4 inline-flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground hover:text-foreground transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring",
|
|
458
|
+
children: /* @__PURE__ */ e(bt, { className: "w-5 h-5" })
|
|
459
|
+
}
|
|
609
460
|
),
|
|
610
|
-
/* @__PURE__ */
|
|
611
|
-
/* @__PURE__ */ e("div", { className: "p-2 rounded-full bg-amber-100 dark:bg-amber-900/20", children: /* @__PURE__ */ e(
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
617
|
-
lineNumber: 607,
|
|
618
|
-
columnNumber: 11
|
|
619
|
-
}, void 0),
|
|
620
|
-
/* @__PURE__ */ e("h2", { className: "text-xl font-semibold", children: c("ecommerce.checkout_successful") }, void 0, !1, {
|
|
621
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
622
|
-
lineNumber: 610,
|
|
623
|
-
columnNumber: 11
|
|
624
|
-
}, void 0)
|
|
625
|
-
] }, void 0, !0, {
|
|
626
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
627
|
-
lineNumber: 606,
|
|
628
|
-
columnNumber: 9
|
|
629
|
-
}, void 0),
|
|
630
|
-
/* @__PURE__ */ e("p", { className: "text-muted-foreground mb-2", children: c("ecommerce.sandbox_notice") }, void 0, !1, {
|
|
631
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
632
|
-
lineNumber: 612,
|
|
633
|
-
columnNumber: 9
|
|
634
|
-
}, void 0),
|
|
635
|
-
/* @__PURE__ */ e("p", { className: "text-muted-foreground mb-2", children: Je === "stripe" ? o(
|
|
461
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-3 mb-4", children: [
|
|
462
|
+
/* @__PURE__ */ e("div", { className: "p-2 rounded-full bg-amber-100 dark:bg-amber-900/20", children: /* @__PURE__ */ e(xt, { className: "h-6 w-6 text-amber-600 dark:text-amber-400" }) }),
|
|
463
|
+
/* @__PURE__ */ e("h2", { id: "sandbox-checkout-title", className: "text-xl font-semibold", children: c("ecommerce.checkout_successful") })
|
|
464
|
+
] }),
|
|
465
|
+
/* @__PURE__ */ e("p", { className: "text-muted-foreground mb-2", children: c("ecommerce.sandbox_notice") }),
|
|
466
|
+
/* @__PURE__ */ e("p", { className: "text-muted-foreground mb-2", children: he === "stripe" ? l(
|
|
636
467
|
"ecommerce.sandbox_checkout_stripe_description",
|
|
637
468
|
"This simulated step represents the Stripe checkout for physical products."
|
|
638
|
-
) :
|
|
469
|
+
) : l(
|
|
639
470
|
"ecommerce.sandbox_checkout_freemius_description",
|
|
640
471
|
"This simulated step represents the Freemius checkout for digital products."
|
|
641
|
-
) },
|
|
642
|
-
|
|
643
|
-
lineNumber: 613,
|
|
644
|
-
columnNumber: 9
|
|
645
|
-
}, void 0),
|
|
646
|
-
/* @__PURE__ */ e("p", { className: "text-muted-foreground mb-6", children: c("ecommerce.license_notice") }, void 0, !1, {
|
|
647
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
648
|
-
lineNumber: 624,
|
|
649
|
-
columnNumber: 9
|
|
650
|
-
}, void 0),
|
|
472
|
+
) }),
|
|
473
|
+
/* @__PURE__ */ e("p", { className: "text-muted-foreground mb-6", children: c("ecommerce.license_notice") }),
|
|
651
474
|
/* @__PURE__ */ e(
|
|
652
475
|
"a",
|
|
653
476
|
{
|
|
@@ -656,1247 +479,624 @@ const on = ({ initialCustomer: n }) => {
|
|
|
656
479
|
rel: "noopener noreferrer",
|
|
657
480
|
className: "block w-full text-center py-3 px-4 rounded-lg bg-primary text-primary-foreground font-semibold hover:opacity-90 transition-opacity",
|
|
658
481
|
children: c("ecommerce.purchase_at")
|
|
659
|
-
}
|
|
660
|
-
void 0,
|
|
661
|
-
!1,
|
|
662
|
-
{
|
|
663
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
664
|
-
lineNumber: 625,
|
|
665
|
-
columnNumber: 9
|
|
666
|
-
},
|
|
667
|
-
void 0
|
|
482
|
+
}
|
|
668
483
|
)
|
|
669
484
|
]
|
|
670
|
-
}
|
|
671
|
-
void 0,
|
|
672
|
-
!0,
|
|
673
|
-
{
|
|
674
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
675
|
-
lineNumber: 596,
|
|
676
|
-
columnNumber: 7
|
|
677
|
-
},
|
|
678
|
-
void 0
|
|
485
|
+
}
|
|
679
486
|
)
|
|
680
|
-
}
|
|
681
|
-
|
|
682
|
-
!
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
if (!
|
|
700
|
-
return
|
|
701
|
-
|
|
487
|
+
}
|
|
488
|
+
) : null, ae = (t, s, h) => (E((i) => ({ ...i, [t]: s })), h && document.getElementById(h)?.focus(), null), ve = (t, s) => s.recipient_name.trim() ? s.line1.trim() ? s.city.trim() ? pe(s.country_code) && !s.state ? `${t}-state` : s.postal_code.trim() ? `${t}-line1` : `${t}-postal` : `${t}-city` : `${t}-line1` : `${t}-name`, lt = (t) => {
|
|
489
|
+
if (!P && (!I || !/^\S+@\S+\.\S+$/.test(I)))
|
|
490
|
+
return U(c("ecommerce.invalid_email")), ae(t, c("ecommerce.invalid_email"), "checkout-email");
|
|
491
|
+
const s = Te(w);
|
|
492
|
+
if (!Ge(s))
|
|
493
|
+
return ae(
|
|
494
|
+
t,
|
|
495
|
+
c("checkout_complete_billing_address"),
|
|
496
|
+
ve("billing", w)
|
|
497
|
+
);
|
|
498
|
+
const h = N ? Te(D ? w : B) : null;
|
|
499
|
+
if (t === "stripe") {
|
|
500
|
+
if (!Ge(h))
|
|
501
|
+
return ae(
|
|
502
|
+
t,
|
|
503
|
+
c("checkout_complete_shipping_address"),
|
|
504
|
+
D ? ve("billing", w) : ve("shipping", B)
|
|
505
|
+
);
|
|
506
|
+
if (!T)
|
|
507
|
+
return ae(
|
|
508
|
+
t,
|
|
509
|
+
l(
|
|
702
510
|
"ecommerce.shipping_method_required",
|
|
703
511
|
"Please select a shipping method before continuing."
|
|
704
512
|
)
|
|
705
|
-
)
|
|
513
|
+
);
|
|
706
514
|
}
|
|
707
|
-
return
|
|
708
|
-
normalizedBillingAddress:
|
|
709
|
-
normalizedShippingAddress:
|
|
515
|
+
return U(""), {
|
|
516
|
+
normalizedBillingAddress: s,
|
|
517
|
+
normalizedShippingAddress: h
|
|
710
518
|
};
|
|
711
|
-
},
|
|
712
|
-
|
|
713
|
-
...
|
|
714
|
-
[
|
|
519
|
+
}, Be = async (t, s, h) => {
|
|
520
|
+
E((_) => ({
|
|
521
|
+
..._,
|
|
522
|
+
[t]: ""
|
|
715
523
|
}));
|
|
716
|
-
const
|
|
717
|
-
if (
|
|
718
|
-
if (
|
|
719
|
-
const
|
|
720
|
-
|
|
524
|
+
const i = lt(t);
|
|
525
|
+
if (i) {
|
|
526
|
+
if (Lt) {
|
|
527
|
+
const _ = new Set(s.map((d) => d.id)), p = x.filter((d) => !_.has(d.id));
|
|
528
|
+
if (H.setItems(p), p.length === 0 && H.removeCoupon(), je(t), re(!0), typeof window < "u" && p.length === 0)
|
|
529
|
+
try {
|
|
530
|
+
window.localStorage.removeItem(me);
|
|
531
|
+
} catch {
|
|
532
|
+
}
|
|
721
533
|
return;
|
|
722
534
|
}
|
|
723
|
-
|
|
535
|
+
g(h);
|
|
724
536
|
try {
|
|
725
|
-
const
|
|
537
|
+
const _ = await fetch("/api/checkout", {
|
|
726
538
|
method: "POST",
|
|
727
539
|
headers: { "Content-Type": "application/json" },
|
|
728
540
|
body: JSON.stringify({
|
|
729
|
-
items:
|
|
730
|
-
customerEmail: P ? void 0 :
|
|
731
|
-
customerPhone:
|
|
732
|
-
billingAddress:
|
|
733
|
-
shippingAddress:
|
|
734
|
-
shippingMethodId:
|
|
735
|
-
locale:
|
|
736
|
-
currencyCode:
|
|
737
|
-
couponCode:
|
|
738
|
-
couponContextItems:
|
|
541
|
+
items: s,
|
|
542
|
+
customerEmail: P ? void 0 : I,
|
|
543
|
+
customerPhone: K || null,
|
|
544
|
+
billingAddress: i.normalizedBillingAddress,
|
|
545
|
+
shippingAddress: t === "stripe" ? i.normalizedShippingAddress : null,
|
|
546
|
+
shippingMethodId: t === "stripe" ? T : null,
|
|
547
|
+
locale: ge,
|
|
548
|
+
currencyCode: o,
|
|
549
|
+
couponCode: M?.code ?? H.appliedCoupon?.code ?? null,
|
|
550
|
+
couponContextItems: x
|
|
739
551
|
})
|
|
740
|
-
}),
|
|
741
|
-
if (!
|
|
742
|
-
const
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
) :
|
|
747
|
-
|
|
748
|
-
...
|
|
749
|
-
[
|
|
750
|
-
})),
|
|
552
|
+
}), p = await _.json();
|
|
553
|
+
if (!_.ok) {
|
|
554
|
+
const d = p?.errorKey && typeof p.errorKey == "string" ? l(
|
|
555
|
+
p.errorKey,
|
|
556
|
+
p?.error || l("ecommerce.generic_error", "Something went wrong."),
|
|
557
|
+
p.errorParams
|
|
558
|
+
) : p?.error || c("ecommerce.generic_error");
|
|
559
|
+
E((Q) => ({
|
|
560
|
+
...Q,
|
|
561
|
+
[t]: d
|
|
562
|
+
})), g(null);
|
|
751
563
|
return;
|
|
752
564
|
}
|
|
753
|
-
if (
|
|
754
|
-
const
|
|
755
|
-
let
|
|
756
|
-
const
|
|
757
|
-
window.location.href = `/checkout/success?session_id=${
|
|
758
|
-
},
|
|
565
|
+
if (p.customProps && p.customProps.provider === "freemius") {
|
|
566
|
+
const d = p.customProps;
|
|
567
|
+
let Q = null;
|
|
568
|
+
const dt = () => {
|
|
569
|
+
window.location.href = `/checkout/success?session_id=${d.order_id}`;
|
|
570
|
+
}, Ke = (R) => (Q || (Q = fetch("/api/checkout/freemius/sync", {
|
|
759
571
|
method: "POST",
|
|
760
572
|
headers: { "Content-Type": "application/json" },
|
|
761
573
|
body: JSON.stringify({
|
|
762
|
-
orderId:
|
|
763
|
-
checkoutResponse:
|
|
574
|
+
orderId: d.order_id,
|
|
575
|
+
checkoutResponse: R
|
|
764
576
|
})
|
|
765
|
-
}).then(async (
|
|
766
|
-
if (!
|
|
767
|
-
const
|
|
768
|
-
console.error("Freemius checkout sync failed:",
|
|
577
|
+
}).then(async (de) => {
|
|
578
|
+
if (!de.ok) {
|
|
579
|
+
const pt = await de.json().catch(() => null);
|
|
580
|
+
console.error("Freemius checkout sync failed:", pt);
|
|
769
581
|
}
|
|
770
|
-
})),
|
|
771
|
-
product_id:
|
|
772
|
-
public_key:
|
|
773
|
-
sandbox:
|
|
774
|
-
},
|
|
582
|
+
})), Q), mt = {
|
|
583
|
+
product_id: d.plugin_id,
|
|
584
|
+
public_key: d.public_key,
|
|
585
|
+
sandbox: d.sandbox
|
|
586
|
+
}, ut = {
|
|
775
587
|
name: c("ecommerce.checkout_overlay_title"),
|
|
776
|
-
plan_id:
|
|
777
|
-
...
|
|
778
|
-
...
|
|
779
|
-
...
|
|
780
|
-
user_email:
|
|
781
|
-
user_firstname:
|
|
782
|
-
user_lastname:
|
|
783
|
-
sandbox:
|
|
784
|
-
purchaseCompleted: function(
|
|
785
|
-
|
|
588
|
+
plan_id: d.plan_id,
|
|
589
|
+
...d.billing_cycle ? { billing_cycle: d.billing_cycle } : {},
|
|
590
|
+
...d.trial ? { trial: d.trial } : {},
|
|
591
|
+
...d.coupon ? { coupon: d.coupon } : {},
|
|
592
|
+
user_email: d.user_email,
|
|
593
|
+
user_firstname: d.user_firstname,
|
|
594
|
+
user_lastname: d.user_lastname,
|
|
595
|
+
sandbox: d.sandbox,
|
|
596
|
+
purchaseCompleted: function(R) {
|
|
597
|
+
Ke(R);
|
|
786
598
|
},
|
|
787
|
-
success: function(
|
|
599
|
+
success: function(R) {
|
|
788
600
|
(async () => {
|
|
789
601
|
try {
|
|
790
|
-
await
|
|
602
|
+
await Ke(R);
|
|
791
603
|
} finally {
|
|
792
|
-
|
|
604
|
+
dt();
|
|
793
605
|
}
|
|
794
606
|
})();
|
|
795
607
|
}
|
|
796
608
|
};
|
|
797
609
|
try {
|
|
798
|
-
new
|
|
799
|
-
} catch (
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
610
|
+
new _t(mt).open(ut), g(null);
|
|
611
|
+
} catch (R) {
|
|
612
|
+
console.error("[Checkout] Freemius overlay failed to open:", R), E((de) => ({
|
|
613
|
+
...de,
|
|
614
|
+
[t]: c("ecommerce.checkout_popup_blocked")
|
|
615
|
+
})), p.url && (window.location.href = p.url), g(null);
|
|
803
616
|
}
|
|
804
|
-
} else
|
|
805
|
-
...
|
|
806
|
-
[
|
|
807
|
-
})),
|
|
808
|
-
} catch (
|
|
809
|
-
console.error(
|
|
810
|
-
...
|
|
811
|
-
[
|
|
812
|
-
})),
|
|
617
|
+
} else p.url ? window.location.href = p.url : (E((d) => ({
|
|
618
|
+
...d,
|
|
619
|
+
[t]: c("ecommerce.checkout_failed") + (p.error || l("ecommerce.unknown_error", "Unknown error"))
|
|
620
|
+
})), g(null));
|
|
621
|
+
} catch (_) {
|
|
622
|
+
console.error(_), E((p) => ({
|
|
623
|
+
...p,
|
|
624
|
+
[t]: c("ecommerce.generic_error")
|
|
625
|
+
})), g(null);
|
|
813
626
|
}
|
|
814
627
|
}
|
|
815
628
|
};
|
|
816
|
-
if (
|
|
817
|
-
return /* @__PURE__ */
|
|
818
|
-
|
|
819
|
-
/* @__PURE__ */
|
|
820
|
-
/* @__PURE__ */ e("h1", { className: "mb-4 text-2xl font-bold", children: c("ecommerce.cart_empty") },
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
827
|
-
lineNumber: 847,
|
|
828
|
-
columnNumber: 11
|
|
829
|
-
}, void 0),
|
|
830
|
-
/* @__PURE__ */ e(he, { asChild: !0, children: /* @__PURE__ */ e("a", { href: "/shop", children: c("ecommerce.go_to_shop") }, void 0, !1, {
|
|
831
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
832
|
-
lineNumber: 849,
|
|
833
|
-
columnNumber: 13
|
|
834
|
-
}, void 0) }, void 0, !1, {
|
|
835
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
836
|
-
lineNumber: 848,
|
|
837
|
-
columnNumber: 11
|
|
838
|
-
}, void 0)
|
|
839
|
-
] }, void 0, !0, {
|
|
840
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
841
|
-
lineNumber: 845,
|
|
842
|
-
columnNumber: 9
|
|
843
|
-
}, void 0)
|
|
844
|
-
] }, void 0, !0, {
|
|
845
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
846
|
-
lineNumber: 843,
|
|
847
|
-
columnNumber: 7
|
|
848
|
-
}, void 0);
|
|
849
|
-
const Te = o(
|
|
629
|
+
if (x.length === 0)
|
|
630
|
+
return /* @__PURE__ */ r(ht, { children: [
|
|
631
|
+
ze,
|
|
632
|
+
/* @__PURE__ */ r("div", { className: "container mx-auto flex min-h-[50vh] flex-col items-center justify-center p-8 text-center", children: [
|
|
633
|
+
/* @__PURE__ */ e("h1", { className: "mb-4 text-2xl font-bold", children: c("ecommerce.cart_empty") }),
|
|
634
|
+
/* @__PURE__ */ e("p", { className: "mb-8 text-muted-foreground", children: c("ecommerce.cart_empty_description") }),
|
|
635
|
+
/* @__PURE__ */ e(we, { asChild: !0, children: /* @__PURE__ */ e("a", { href: "/shop", children: c("ecommerce.go_to_shop") }) })
|
|
636
|
+
] })
|
|
637
|
+
] });
|
|
638
|
+
const Pe = l(
|
|
850
639
|
"ecommerce.checkout_payments_unavailable",
|
|
851
640
|
"This store is not able to take payments right now. Please contact the seller to complete your purchase."
|
|
852
|
-
),
|
|
641
|
+
), Oe = Re.stripe ? null : Pe, Ne = Re.freemius ? null : Pe, ke = Oe || (N ? ie ? Ee ? l(
|
|
853
642
|
"ecommerce.calculating_shipping",
|
|
854
643
|
"Calculating shipping..."
|
|
855
|
-
) :
|
|
644
|
+
) : T ? null : J.length > 0 ? c("ecommerce.select_rate") : c("ecommerce.no_rates_for_region") : l(
|
|
856
645
|
"ecommerce.waiting_on_address_info",
|
|
857
646
|
"Complete your shipping address to view available shipping options."
|
|
858
|
-
) : null),
|
|
859
|
-
count:
|
|
860
|
-
}) :
|
|
861
|
-
count:
|
|
862
|
-
}),
|
|
863
|
-
count:
|
|
864
|
-
}) :
|
|
865
|
-
count:
|
|
866
|
-
}),
|
|
647
|
+
) : null), ct = f !== null || ke !== null, st = v.length === 1 ? l("ecommerce.item_count_one", "{count} item", {
|
|
648
|
+
count: v.length
|
|
649
|
+
}) : l("ecommerce.item_count_other", "{count} items", {
|
|
650
|
+
count: v.length
|
|
651
|
+
}), it = C.length === 1 ? l("ecommerce.license_count_one", "{count} license", {
|
|
652
|
+
count: C.length
|
|
653
|
+
}) : l("ecommerce.license_count_other", "{count} licenses", {
|
|
654
|
+
count: C.length
|
|
655
|
+
}), ot = (t) => $e(t) ? l("ecommerce.digital_label", "Digital") : l("ecommerce.physical_label", "Physical"), at = (t) => t === "monthly" ? l(
|
|
867
656
|
"ecommerce.checkout_billing_cycle_monthly",
|
|
868
657
|
"Monthly subscription"
|
|
869
|
-
) :
|
|
658
|
+
) : t === "annual" ? l(
|
|
870
659
|
"ecommerce.checkout_billing_cycle_annual",
|
|
871
660
|
"Annual subscription"
|
|
872
|
-
) :
|
|
661
|
+
) : t === "lifetime" ? l(
|
|
873
662
|
"ecommerce.checkout_billing_cycle_lifetime",
|
|
874
663
|
"Lifetime subscription"
|
|
875
664
|
) : null;
|
|
876
|
-
return /* @__PURE__ */
|
|
877
|
-
|
|
878
|
-
/* @__PURE__ */
|
|
879
|
-
/* @__PURE__ */ e("h1", { className: "mb-8 text-3xl font-bold", children: c("ecommerce.checkout") },
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
/* @__PURE__ */ e("div", { className: "lg:col-span-8 space-y-6", children: [
|
|
886
|
-
/* @__PURE__ */ e(G, { children: [
|
|
887
|
-
/* @__PURE__ */ e(Q, { children: /* @__PURE__ */ e(X, { className: "flex items-center gap-2", children: [
|
|
888
|
-
/* @__PURE__ */ e(fs, { className: "w-5 h-5" }, void 0, !1, {
|
|
889
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
890
|
-
lineNumber: 948,
|
|
891
|
-
columnNumber: 19
|
|
892
|
-
}, void 0),
|
|
665
|
+
return /* @__PURE__ */ r("div", { className: "container mx-auto px-4 py-12 md:px-6", children: [
|
|
666
|
+
ze,
|
|
667
|
+
/* @__PURE__ */ r("div", { className: "mx-auto max-w-6xl", children: [
|
|
668
|
+
/* @__PURE__ */ e("h1", { className: "mb-8 text-3xl font-bold", children: c("ecommerce.checkout") }),
|
|
669
|
+
/* @__PURE__ */ r("div", { className: "grid gap-8 lg:grid-cols-12 lg:items-start", children: [
|
|
670
|
+
/* @__PURE__ */ r("div", { className: "lg:col-span-8 space-y-6", children: [
|
|
671
|
+
/* @__PURE__ */ r(X, { children: [
|
|
672
|
+
/* @__PURE__ */ e(Y, { children: /* @__PURE__ */ r(W, { role: "heading", "aria-level": 2, className: "flex items-center gap-2", children: [
|
|
673
|
+
/* @__PURE__ */ e(vt, { className: "w-5 h-5" }),
|
|
893
674
|
c("ecommerce.contact_information")
|
|
894
|
-
] }
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
}, void 0) }, void 0, !1, {
|
|
899
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
900
|
-
lineNumber: 946,
|
|
901
|
-
columnNumber: 15
|
|
902
|
-
}, void 0),
|
|
903
|
-
/* @__PURE__ */ e(V, { className: "space-y-4", children: [
|
|
904
|
-
P ? /* @__PURE__ */ e("div", { className: "rounded-xl border bg-muted/20 p-4 text-sm text-muted-foreground", children: c("checkout_prefill_notice", { email: n?.email || "" }) }, void 0, !1, {
|
|
905
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
906
|
-
lineNumber: 954,
|
|
907
|
-
columnNumber: 19
|
|
908
|
-
}, void 0) : /* @__PURE__ */ e("div", { className: "space-y-2", children: [
|
|
909
|
-
/* @__PURE__ */ e(v, { htmlFor: "checkout-email", children: [
|
|
675
|
+
] }) }),
|
|
676
|
+
/* @__PURE__ */ r(Z, { className: "space-y-4", children: [
|
|
677
|
+
P ? /* @__PURE__ */ e("div", { className: "rounded-xl border bg-muted/20 p-4 text-sm text-muted-foreground", children: c("checkout_prefill_notice", { email: n?.email || "" }) }) : /* @__PURE__ */ r("div", { className: "space-y-2", children: [
|
|
678
|
+
/* @__PURE__ */ r(b, { htmlFor: "checkout-email", children: [
|
|
910
679
|
c("ecommerce.email_address"),
|
|
911
680
|
" ",
|
|
912
|
-
/* @__PURE__ */ e("span", { className: "text-destructive", children: "*" }
|
|
913
|
-
|
|
914
|
-
lineNumber: 960,
|
|
915
|
-
columnNumber: 54
|
|
916
|
-
}, void 0)
|
|
917
|
-
] }, void 0, !0, {
|
|
918
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
919
|
-
lineNumber: 959,
|
|
920
|
-
columnNumber: 21
|
|
921
|
-
}, void 0),
|
|
681
|
+
/* @__PURE__ */ e("span", { className: "text-destructive", children: "*" })
|
|
682
|
+
] }),
|
|
922
683
|
/* @__PURE__ */ e(
|
|
923
|
-
|
|
684
|
+
j,
|
|
924
685
|
{
|
|
925
686
|
id: "checkout-email",
|
|
687
|
+
name: "email",
|
|
926
688
|
type: "email",
|
|
689
|
+
autoComplete: "email",
|
|
690
|
+
spellCheck: !1,
|
|
691
|
+
"aria-invalid": q ? !0 : void 0,
|
|
692
|
+
"aria-describedby": q ? "checkout-email-error" : void 0,
|
|
927
693
|
placeholder: c("ecommerce.email_placeholder"),
|
|
928
|
-
value:
|
|
929
|
-
onChange: (
|
|
930
|
-
|
|
694
|
+
value: I,
|
|
695
|
+
onChange: (t) => {
|
|
696
|
+
ee(t.target.value), q && U("");
|
|
931
697
|
},
|
|
932
698
|
required: !0
|
|
933
|
-
}
|
|
934
|
-
void 0,
|
|
935
|
-
!1,
|
|
936
|
-
{
|
|
937
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
938
|
-
lineNumber: 962,
|
|
939
|
-
columnNumber: 21
|
|
940
|
-
},
|
|
941
|
-
void 0
|
|
699
|
+
}
|
|
942
700
|
),
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
}, void 0) : null
|
|
948
|
-
] }, void 0, !0, {
|
|
949
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
950
|
-
lineNumber: 958,
|
|
951
|
-
columnNumber: 19
|
|
952
|
-
}, void 0),
|
|
953
|
-
/* @__PURE__ */ e("div", { className: "space-y-2", children: [
|
|
954
|
-
/* @__PURE__ */ e(v, { htmlFor: "checkout-phone", children: c("phone_number") }, void 0, !1, {
|
|
955
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
956
|
-
lineNumber: 980,
|
|
957
|
-
columnNumber: 19
|
|
958
|
-
}, void 0),
|
|
701
|
+
q ? /* @__PURE__ */ e("p", { id: "checkout-email-error", role: "alert", className: "text-xs text-destructive mt-1", children: q }) : null
|
|
702
|
+
] }),
|
|
703
|
+
/* @__PURE__ */ r("div", { className: "space-y-2", children: [
|
|
704
|
+
/* @__PURE__ */ e(b, { htmlFor: "checkout-phone", children: c("phone_number") }),
|
|
959
705
|
/* @__PURE__ */ e(
|
|
960
|
-
|
|
706
|
+
j,
|
|
961
707
|
{
|
|
962
708
|
id: "checkout-phone",
|
|
709
|
+
name: "phone",
|
|
710
|
+
type: "tel",
|
|
711
|
+
inputMode: "tel",
|
|
712
|
+
autoComplete: "tel",
|
|
963
713
|
placeholder: c("optional"),
|
|
964
|
-
value:
|
|
965
|
-
onChange: (
|
|
966
|
-
}
|
|
967
|
-
void 0,
|
|
968
|
-
!1,
|
|
969
|
-
{
|
|
970
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
971
|
-
lineNumber: 981,
|
|
972
|
-
columnNumber: 19
|
|
973
|
-
},
|
|
974
|
-
void 0
|
|
714
|
+
value: K,
|
|
715
|
+
onChange: (t) => m(t.target.value)
|
|
716
|
+
}
|
|
975
717
|
)
|
|
976
|
-
] }
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
columnNumber: 17
|
|
980
|
-
}, void 0)
|
|
981
|
-
] }, void 0, !0, {
|
|
982
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
983
|
-
lineNumber: 952,
|
|
984
|
-
columnNumber: 15
|
|
985
|
-
}, void 0)
|
|
986
|
-
] }, void 0, !0, {
|
|
987
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
988
|
-
lineNumber: 945,
|
|
989
|
-
columnNumber: 13
|
|
990
|
-
}, void 0),
|
|
718
|
+
] })
|
|
719
|
+
] })
|
|
720
|
+
] }),
|
|
991
721
|
/* @__PURE__ */ e(
|
|
992
|
-
|
|
722
|
+
Qe,
|
|
993
723
|
{
|
|
994
724
|
idPrefix: "billing",
|
|
995
725
|
title: c("billing_address"),
|
|
996
726
|
description: c("checkout_billing_address_help"),
|
|
997
|
-
value:
|
|
998
|
-
onChange:
|
|
999
|
-
}
|
|
1000
|
-
void 0,
|
|
1001
|
-
!1,
|
|
1002
|
-
{
|
|
1003
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1004
|
-
lineNumber: 991,
|
|
1005
|
-
columnNumber: 13
|
|
1006
|
-
},
|
|
1007
|
-
void 0
|
|
727
|
+
value: w,
|
|
728
|
+
onChange: Me
|
|
729
|
+
}
|
|
1008
730
|
),
|
|
1009
|
-
|
|
731
|
+
N ? /* @__PURE__ */ r("div", { className: "flex items-center space-x-3 rounded-xl border bg-muted/20 p-4", children: [
|
|
1010
732
|
/* @__PURE__ */ e(
|
|
1011
|
-
|
|
733
|
+
gt,
|
|
1012
734
|
{
|
|
1013
735
|
id: "use-billing-for-shipping",
|
|
1014
|
-
checked:
|
|
1015
|
-
onCheckedChange: (
|
|
1016
|
-
}
|
|
1017
|
-
void 0,
|
|
1018
|
-
!1,
|
|
1019
|
-
{
|
|
1020
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1021
|
-
lineNumber: 1001,
|
|
1022
|
-
columnNumber: 17
|
|
1023
|
-
},
|
|
1024
|
-
void 0
|
|
736
|
+
checked: D,
|
|
737
|
+
onCheckedChange: (t) => Le(!!t)
|
|
738
|
+
}
|
|
1025
739
|
),
|
|
1026
|
-
/* @__PURE__ */
|
|
1027
|
-
/* @__PURE__ */ e(
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1034
|
-
lineNumber: 1010,
|
|
1035
|
-
columnNumber: 19
|
|
1036
|
-
}, void 0)
|
|
1037
|
-
] }, void 0, !0, {
|
|
1038
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1039
|
-
lineNumber: 1006,
|
|
1040
|
-
columnNumber: 17
|
|
1041
|
-
}, void 0)
|
|
1042
|
-
] }, void 0, !0, {
|
|
1043
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1044
|
-
lineNumber: 1e3,
|
|
1045
|
-
columnNumber: 15
|
|
1046
|
-
}, void 0) : null,
|
|
1047
|
-
_ && !$ ? /* @__PURE__ */ e(
|
|
1048
|
-
ze,
|
|
740
|
+
/* @__PURE__ */ r("div", { className: "space-y-1", children: [
|
|
741
|
+
/* @__PURE__ */ e(b, { htmlFor: "use-billing-for-shipping", className: "cursor-pointer", children: c("use_billing_for_shipping") }),
|
|
742
|
+
/* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: c("checkout_use_billing_for_shipping_help") })
|
|
743
|
+
] })
|
|
744
|
+
] }) : null,
|
|
745
|
+
N && !D ? /* @__PURE__ */ e(
|
|
746
|
+
Qe,
|
|
1049
747
|
{
|
|
1050
748
|
idPrefix: "shipping",
|
|
1051
749
|
title: c("shipping_address"),
|
|
1052
750
|
description: c("checkout_shipping_address_help"),
|
|
1053
|
-
value:
|
|
1054
|
-
onChange:
|
|
1055
|
-
}
|
|
1056
|
-
void 0,
|
|
1057
|
-
!1,
|
|
1058
|
-
{
|
|
1059
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1060
|
-
lineNumber: 1018,
|
|
1061
|
-
columnNumber: 15
|
|
1062
|
-
},
|
|
1063
|
-
void 0
|
|
751
|
+
value: B,
|
|
752
|
+
onChange: De
|
|
753
|
+
}
|
|
1064
754
|
) : null,
|
|
1065
|
-
|
|
1066
|
-
/* @__PURE__ */ e(
|
|
1067
|
-
/* @__PURE__ */ e(
|
|
1068
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1069
|
-
lineNumber: 1031,
|
|
1070
|
-
columnNumber: 21
|
|
1071
|
-
}, void 0),
|
|
755
|
+
N ? /* @__PURE__ */ r(X, { children: [
|
|
756
|
+
/* @__PURE__ */ e(Y, { children: /* @__PURE__ */ r(W, { role: "heading", "aria-level": 2, className: "flex items-center gap-2", children: [
|
|
757
|
+
/* @__PURE__ */ e(Nt, { className: "w-5 h-5 text-primary" }),
|
|
1072
758
|
c("ecommerce.shipping_method")
|
|
1073
|
-
] }
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
}
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
!1,
|
|
1109
|
-
{
|
|
1110
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1111
|
-
lineNumber: 1053,
|
|
1112
|
-
columnNumber: 29
|
|
1113
|
-
},
|
|
1114
|
-
void 0
|
|
1115
|
-
),
|
|
1116
|
-
/* @__PURE__ */ e("span", { className: "font-medium", children: s.name }, void 0, !1, {
|
|
1117
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1118
|
-
lineNumber: 1062,
|
|
1119
|
-
columnNumber: 29
|
|
1120
|
-
}, void 0)
|
|
1121
|
-
] }, void 0, !0, {
|
|
1122
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1123
|
-
lineNumber: 1052,
|
|
1124
|
-
columnNumber: 27
|
|
1125
|
-
}, void 0),
|
|
1126
|
-
/* @__PURE__ */ e("span", { className: "font-bold", children: h(s.amount, t) }, void 0, !1, {
|
|
1127
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1128
|
-
lineNumber: 1064,
|
|
1129
|
-
columnNumber: 27
|
|
1130
|
-
}, void 0)
|
|
1131
|
-
]
|
|
1132
|
-
},
|
|
1133
|
-
s.id,
|
|
1134
|
-
!0,
|
|
1135
|
-
{
|
|
1136
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1137
|
-
lineNumber: 1043,
|
|
1138
|
-
columnNumber: 25
|
|
1139
|
-
},
|
|
1140
|
-
void 0
|
|
1141
|
-
)) }, void 0, !1, {
|
|
1142
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1143
|
-
lineNumber: 1041,
|
|
1144
|
-
columnNumber: 21
|
|
1145
|
-
}, void 0) : /* @__PURE__ */ e("div", { className: "py-4 text-center text-muted-foreground bg-muted/30 rounded-lg italic", children: ce ? c("ecommerce.no_rates_for_region") : o(
|
|
759
|
+
] }) }),
|
|
760
|
+
/* @__PURE__ */ e(Z, { children: Ee ? /* @__PURE__ */ r("div", { role: "status", className: "flex items-center justify-center py-6", children: [
|
|
761
|
+
/* @__PURE__ */ e(Se, { className: "w-6 h-6 animate-spin text-muted-foreground" }),
|
|
762
|
+
/* @__PURE__ */ e("span", { className: "sr-only", children: l("ecommerce.calculating_shipping", "Calculating shipping…") })
|
|
763
|
+
] }) : We ? /* @__PURE__ */ e("div", { role: "alert", className: "rounded-lg bg-destructive/10 px-4 py-3 text-center text-sm text-destructive", children: l(
|
|
764
|
+
"ecommerce.shipping_calculation_failed",
|
|
765
|
+
"We couldn't calculate shipping right now. Please try again."
|
|
766
|
+
) }) : J.length > 0 ? (
|
|
767
|
+
// A real radio group. These rows used to be <div onClick>: no role, no
|
|
768
|
+
// tab stop, no keys, so a keyboard user could not change the shipping method.
|
|
769
|
+
/* @__PURE__ */ e(
|
|
770
|
+
Ue,
|
|
771
|
+
{
|
|
772
|
+
value: T ?? "",
|
|
773
|
+
onValueChange: z,
|
|
774
|
+
"aria-label": c("ecommerce.shipping_method"),
|
|
775
|
+
className: "space-y-3",
|
|
776
|
+
children: J.map((t) => /* @__PURE__ */ r(
|
|
777
|
+
b,
|
|
778
|
+
{
|
|
779
|
+
htmlFor: `shipping-method-${t.id}`,
|
|
780
|
+
className: `flex items-center justify-between gap-3 p-4 rounded-lg border-2 cursor-pointer transition-colors ${T === t.id ? "border-primary bg-primary/5" : "border-border hover:border-muted-foreground/40"}`,
|
|
781
|
+
children: [
|
|
782
|
+
/* @__PURE__ */ r("span", { className: "flex min-w-0 items-center gap-3", children: [
|
|
783
|
+
/* @__PURE__ */ e(Ce, { id: `shipping-method-${t.id}`, value: t.id }),
|
|
784
|
+
/* @__PURE__ */ e("span", { className: "font-medium break-words", children: t.name })
|
|
785
|
+
] }),
|
|
786
|
+
/* @__PURE__ */ e("span", { className: "font-bold tabular-nums", children: a(t.amount, o) })
|
|
787
|
+
]
|
|
788
|
+
},
|
|
789
|
+
t.id
|
|
790
|
+
))
|
|
791
|
+
}
|
|
792
|
+
)
|
|
793
|
+
) : /* @__PURE__ */ e("div", { className: "py-4 text-center text-muted-foreground bg-muted/30 rounded-lg italic", children: ie ? c("ecommerce.no_rates_for_region") : l(
|
|
1146
794
|
"ecommerce.waiting_on_address_info",
|
|
1147
795
|
"Complete your shipping address to view available shipping options."
|
|
1148
|
-
) }
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1171
|
-
lineNumber: 1088,
|
|
1172
|
-
columnNumber: 17
|
|
1173
|
-
}, void 0) }, void 0, !1, {
|
|
1174
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1175
|
-
lineNumber: 1087,
|
|
1176
|
-
columnNumber: 15
|
|
1177
|
-
}, void 0),
|
|
1178
|
-
/* @__PURE__ */ e(V, { className: "space-y-4", children: [
|
|
1179
|
-
/* @__PURE__ */ e("div", { className: "space-y-3 max-h-[260px] overflow-y-auto pr-2", children: C.map((s) => {
|
|
1180
|
-
const r = ve(s, {
|
|
1181
|
-
currencyCode: t,
|
|
1182
|
-
currencies: A
|
|
1183
|
-
}), u = Le(s);
|
|
1184
|
-
return /* @__PURE__ */ e("div", { className: "flex items-start justify-between gap-4", children: [
|
|
1185
|
-
/* @__PURE__ */ e("div", { className: "flex gap-3", children: [
|
|
1186
|
-
s.image_url ? /* @__PURE__ */ e("div", { className: "h-10 w-10 shrink-0 overflow-hidden rounded border bg-neutral-100", children: /* @__PURE__ */ e("img", { src: s.image_url, alt: s.title, className: "h-full w-full object-cover" }, void 0, !1, {
|
|
1187
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1188
|
-
lineNumber: 1104,
|
|
1189
|
-
columnNumber: 31
|
|
1190
|
-
}, void 0) }, void 0, !1, {
|
|
1191
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1192
|
-
lineNumber: 1103,
|
|
1193
|
-
columnNumber: 29
|
|
1194
|
-
}, void 0) : null,
|
|
1195
|
-
/* @__PURE__ */ e("div", { className: "grid gap-0.5", children: [
|
|
1196
|
-
/* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: [
|
|
1197
|
-
/* @__PURE__ */ e("span", { className: "font-medium text-xs line-clamp-1", children: s.title }, void 0, !1, {
|
|
1198
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1199
|
-
lineNumber: 1109,
|
|
1200
|
-
columnNumber: 31
|
|
1201
|
-
}, void 0),
|
|
1202
|
-
/* @__PURE__ */ e(qe, { variant: "outline", className: "text-[9px] uppercase", children: ns(s) }, void 0, !1, {
|
|
1203
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1204
|
-
lineNumber: 1110,
|
|
1205
|
-
columnNumber: 31
|
|
1206
|
-
}, void 0)
|
|
1207
|
-
] }, void 0, !0, {
|
|
1208
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1209
|
-
lineNumber: 1108,
|
|
1210
|
-
columnNumber: 29
|
|
1211
|
-
}, void 0),
|
|
1212
|
-
s.variant_label ? /* @__PURE__ */ e("span", { className: "text-[10px] text-muted-foreground line-clamp-1", children: s.variant_label }, void 0, !1, {
|
|
1213
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1214
|
-
lineNumber: 1115,
|
|
1215
|
-
columnNumber: 31
|
|
1216
|
-
}, void 0) : null,
|
|
1217
|
-
/* @__PURE__ */ e("span", { className: "text-[10px] text-muted-foreground", children: [
|
|
796
|
+
) }) })
|
|
797
|
+
] }) : null
|
|
798
|
+
] }),
|
|
799
|
+
/* @__PURE__ */ r("div", { className: "lg:col-span-4 space-y-6", children: [
|
|
800
|
+
/* @__PURE__ */ r(X, { className: "top-6", children: [
|
|
801
|
+
/* @__PURE__ */ e(Y, { children: /* @__PURE__ */ e(W, { role: "heading", "aria-level": 2, children: c("ecommerce.order_summary") }) }),
|
|
802
|
+
/* @__PURE__ */ r(Z, { className: "space-y-4", children: [
|
|
803
|
+
/* @__PURE__ */ e("div", { className: "space-y-3 max-h-[260px] overflow-y-auto pr-2", children: x.map((t) => {
|
|
804
|
+
const s = Ae(t, {
|
|
805
|
+
currencyCode: o,
|
|
806
|
+
currencies: L
|
|
807
|
+
}), h = He(t, c);
|
|
808
|
+
return /* @__PURE__ */ r("div", { className: "flex items-start justify-between gap-4", children: [
|
|
809
|
+
/* @__PURE__ */ r("div", { className: "flex gap-3", children: [
|
|
810
|
+
t.image_url ? /* @__PURE__ */ e("div", { className: "h-10 w-10 shrink-0 overflow-hidden rounded border bg-neutral-100", children: /* @__PURE__ */ e("img", { src: t.image_url, alt: t.title, className: "h-full w-full object-cover" }) }) : null,
|
|
811
|
+
/* @__PURE__ */ r("div", { className: "grid gap-0.5", children: [
|
|
812
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
813
|
+
/* @__PURE__ */ e("span", { className: "font-medium text-xs line-clamp-1", children: t.title }),
|
|
814
|
+
/* @__PURE__ */ e(Xe, { variant: "outline", className: "text-[9px] uppercase", children: ot(t) })
|
|
815
|
+
] }),
|
|
816
|
+
t.variant_label ? /* @__PURE__ */ e("span", { className: "text-[10px] text-muted-foreground line-clamp-1", children: t.variant_label }) : null,
|
|
817
|
+
/* @__PURE__ */ r("span", { className: "text-[10px] text-muted-foreground", children: [
|
|
1218
818
|
c("ecommerce.qty"),
|
|
1219
819
|
": ",
|
|
1220
|
-
|
|
1221
|
-
] },
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
columnNumber: 29
|
|
1225
|
-
}, void 0),
|
|
1226
|
-
u ? /* @__PURE__ */ e("span", { className: "text-[10px] font-medium text-emerald-700", children: [
|
|
1227
|
-
u.label,
|
|
820
|
+
t.quantity
|
|
821
|
+
] }),
|
|
822
|
+
h ? /* @__PURE__ */ r("span", { className: "text-[10px] font-medium text-emerald-700", children: [
|
|
823
|
+
h.label,
|
|
1228
824
|
" - ",
|
|
1229
|
-
|
|
1230
|
-
] }
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
columnNumber: 25
|
|
1244
|
-
}, void 0),
|
|
1245
|
-
/* @__PURE__ */ e("div", { className: "flex flex-col items-end gap-0.5 shrink-0", children: [
|
|
1246
|
-
/* @__PURE__ */ e("span", { className: "font-medium text-xs", children: h(
|
|
1247
|
-
(r.sale_price ?? r.price) * s.quantity,
|
|
1248
|
-
t
|
|
1249
|
-
) }, void 0, !1, {
|
|
1250
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1251
|
-
lineNumber: 1130,
|
|
1252
|
-
columnNumber: 27
|
|
1253
|
-
}, void 0),
|
|
1254
|
-
r.sale_price ? /* @__PURE__ */ e("span", { className: "text-[9px] text-muted-foreground line-through", children: h(r.price * s.quantity, t) }, void 0, !1, {
|
|
1255
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1256
|
-
lineNumber: 1137,
|
|
1257
|
-
columnNumber: 29
|
|
1258
|
-
}, void 0) : null
|
|
1259
|
-
] }, void 0, !0, {
|
|
1260
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1261
|
-
lineNumber: 1129,
|
|
1262
|
-
columnNumber: 25
|
|
1263
|
-
}, void 0)
|
|
1264
|
-
] }, `${s.id}-${s.variant_id || "base"}`, !0, {
|
|
1265
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1266
|
-
lineNumber: 1100,
|
|
1267
|
-
columnNumber: 23
|
|
1268
|
-
}, void 0);
|
|
1269
|
-
}) }, void 0, !1, {
|
|
1270
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1271
|
-
lineNumber: 1091,
|
|
1272
|
-
columnNumber: 17
|
|
1273
|
-
}, void 0),
|
|
1274
|
-
/* @__PURE__ */ e(ds, {}, void 0, !1, {
|
|
1275
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1276
|
-
lineNumber: 1147,
|
|
1277
|
-
columnNumber: 17
|
|
1278
|
-
}, void 0),
|
|
825
|
+
h.paymentRequirementLabel
|
|
826
|
+
] }) : null
|
|
827
|
+
] })
|
|
828
|
+
] }),
|
|
829
|
+
/* @__PURE__ */ r("div", { className: "flex flex-col items-end gap-0.5 shrink-0", children: [
|
|
830
|
+
/* @__PURE__ */ e("span", { className: "font-medium text-xs", children: a(
|
|
831
|
+
(s.sale_price ?? s.price) * t.quantity,
|
|
832
|
+
o
|
|
833
|
+
) }),
|
|
834
|
+
s.sale_price ? /* @__PURE__ */ e("span", { className: "text-[9px] text-muted-foreground line-through", children: a(s.price * t.quantity, o) }) : null
|
|
835
|
+
] })
|
|
836
|
+
] }, `${t.id}-${t.variant_id || "base"}`);
|
|
837
|
+
}) }),
|
|
838
|
+
/* @__PURE__ */ e(ft, {}),
|
|
1279
839
|
/* @__PURE__ */ e(
|
|
1280
|
-
|
|
840
|
+
Dt,
|
|
1281
841
|
{
|
|
1282
|
-
items:
|
|
1283
|
-
currencyCode:
|
|
1284
|
-
onQuoteChange:
|
|
1285
|
-
}
|
|
1286
|
-
void 0,
|
|
1287
|
-
!1,
|
|
1288
|
-
{
|
|
1289
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1290
|
-
lineNumber: 1149,
|
|
1291
|
-
columnNumber: 17
|
|
1292
|
-
},
|
|
1293
|
-
void 0
|
|
842
|
+
items: x,
|
|
843
|
+
currencyCode: o,
|
|
844
|
+
onQuoteChange: et
|
|
845
|
+
}
|
|
1294
846
|
),
|
|
1295
|
-
/* @__PURE__ */
|
|
1296
|
-
/* @__PURE__ */
|
|
1297
|
-
/* @__PURE__ */ e("span", { children: c("ecommerce.subtotal") },
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
/* @__PURE__ */ e("span", { children: h(Xe, t) }, void 0, !1, {
|
|
1303
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1304
|
-
lineNumber: 1158,
|
|
1305
|
-
columnNumber: 21
|
|
1306
|
-
}, void 0)
|
|
1307
|
-
] }, void 0, !0, {
|
|
1308
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1309
|
-
lineNumber: 1156,
|
|
1310
|
-
columnNumber: 19
|
|
1311
|
-
}, void 0),
|
|
1312
|
-
g.length > 0 ? /* @__PURE__ */ e("div", { className: "flex justify-between text-muted-foreground", children: [
|
|
1313
|
-
/* @__PURE__ */ e("span", { children: o(
|
|
847
|
+
/* @__PURE__ */ r("div", { className: "space-y-2 text-sm", children: [
|
|
848
|
+
/* @__PURE__ */ r("div", { className: "flex justify-between", children: [
|
|
849
|
+
/* @__PURE__ */ e("span", { children: c("ecommerce.subtotal") }),
|
|
850
|
+
/* @__PURE__ */ e("span", { children: a(tt, o) })
|
|
851
|
+
] }),
|
|
852
|
+
v.length > 0 ? /* @__PURE__ */ r("div", { className: "flex justify-between text-muted-foreground", children: [
|
|
853
|
+
/* @__PURE__ */ e("span", { children: l(
|
|
1314
854
|
"ecommerce.physical_products",
|
|
1315
855
|
"Physical products"
|
|
1316
|
-
) },
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
/* @__PURE__ */ e("span", { children: h(ue, t) }, void 0, !1, {
|
|
1322
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1323
|
-
lineNumber: 1168,
|
|
1324
|
-
columnNumber: 23
|
|
1325
|
-
}, void 0)
|
|
1326
|
-
] }, void 0, !0, {
|
|
1327
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1328
|
-
lineNumber: 1161,
|
|
1329
|
-
columnNumber: 21
|
|
1330
|
-
}, void 0) : null,
|
|
1331
|
-
D.length > 0 ? /* @__PURE__ */ e("div", { className: "flex justify-between text-muted-foreground", children: [
|
|
1332
|
-
/* @__PURE__ */ e("span", { children: o(
|
|
856
|
+
) }),
|
|
857
|
+
/* @__PURE__ */ e("span", { children: a(fe, o) })
|
|
858
|
+
] }) : null,
|
|
859
|
+
C.length > 0 ? /* @__PURE__ */ r("div", { className: "flex justify-between text-muted-foreground", children: [
|
|
860
|
+
/* @__PURE__ */ e("span", { children: l(
|
|
1333
861
|
"ecommerce.digital_products",
|
|
1334
862
|
"Digital products"
|
|
1335
|
-
) },
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1342
|
-
lineNumber: 1179,
|
|
1343
|
-
columnNumber: 23
|
|
1344
|
-
}, void 0)
|
|
1345
|
-
] }, void 0, !0, {
|
|
1346
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1347
|
-
lineNumber: 1172,
|
|
1348
|
-
columnNumber: 21
|
|
1349
|
-
}, void 0) : null,
|
|
1350
|
-
T ? /* @__PURE__ */ e("div", { className: "flex justify-between text-emerald-600", children: [
|
|
1351
|
-
/* @__PURE__ */ e("span", { children: [
|
|
1352
|
-
o("ecommerce.discount", "Discount"),
|
|
863
|
+
) }),
|
|
864
|
+
/* @__PURE__ */ e("span", { children: a(_e, o) })
|
|
865
|
+
] }) : null,
|
|
866
|
+
M ? /* @__PURE__ */ r("div", { className: "flex justify-between text-emerald-600", children: [
|
|
867
|
+
/* @__PURE__ */ r("span", { children: [
|
|
868
|
+
l("ecommerce.discount", "Discount"),
|
|
1353
869
|
" (",
|
|
1354
|
-
|
|
870
|
+
M.code,
|
|
1355
871
|
")"
|
|
1356
|
-
] },
|
|
1357
|
-
|
|
1358
|
-
lineNumber: 1184,
|
|
1359
|
-
columnNumber: 23
|
|
1360
|
-
}, void 0),
|
|
1361
|
-
/* @__PURE__ */ e("span", { children: [
|
|
872
|
+
] }),
|
|
873
|
+
/* @__PURE__ */ r("span", { children: [
|
|
1362
874
|
"-",
|
|
1363
|
-
|
|
1364
|
-
] }
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
}, void 0)
|
|
1369
|
-
] }, void 0, !0, {
|
|
1370
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1371
|
-
lineNumber: 1183,
|
|
1372
|
-
columnNumber: 21
|
|
1373
|
-
}, void 0) : null,
|
|
1374
|
-
(g.length > 0 || D.length > 0) && /* @__PURE__ */ e("div", { className: "flex justify-between font-bold text-lg pt-2 border-t mt-2", children: [
|
|
1375
|
-
/* @__PURE__ */ e("span", { children: o(
|
|
875
|
+
a(M.discountTotal, o)
|
|
876
|
+
] })
|
|
877
|
+
] }) : null,
|
|
878
|
+
(v.length > 0 || C.length > 0) && /* @__PURE__ */ r("div", { className: "flex justify-between font-bold text-lg pt-2 border-t mt-2", children: [
|
|
879
|
+
/* @__PURE__ */ e("span", { children: l(
|
|
1376
880
|
"ecommerce.estimated_total",
|
|
1377
881
|
"Estimated total"
|
|
1378
|
-
) },
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
columnNumber: 23
|
|
1387
|
-
}, void 0)
|
|
1388
|
-
] }, void 0, !0, {
|
|
1389
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1390
|
-
lineNumber: 1191,
|
|
1391
|
-
columnNumber: 21
|
|
1392
|
-
}, void 0)
|
|
1393
|
-
] }, void 0, !0, {
|
|
1394
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1395
|
-
lineNumber: 1155,
|
|
1396
|
-
columnNumber: 17
|
|
1397
|
-
}, void 0)
|
|
1398
|
-
] }, void 0, !0, {
|
|
1399
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1400
|
-
lineNumber: 1090,
|
|
1401
|
-
columnNumber: 15
|
|
1402
|
-
}, void 0)
|
|
1403
|
-
] }, void 0, !0, {
|
|
1404
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1405
|
-
lineNumber: 1086,
|
|
1406
|
-
columnNumber: 13
|
|
1407
|
-
}, void 0),
|
|
1408
|
-
g.length > 0 ? /* @__PURE__ */ e(
|
|
1409
|
-
Oe,
|
|
882
|
+
) }),
|
|
883
|
+
/* @__PURE__ */ e("span", { className: "text-primary", children: a(nt, o) })
|
|
884
|
+
] })
|
|
885
|
+
] })
|
|
886
|
+
] })
|
|
887
|
+
] }),
|
|
888
|
+
v.length > 0 ? /* @__PURE__ */ r(
|
|
889
|
+
Ve,
|
|
1410
890
|
{
|
|
1411
|
-
title:
|
|
891
|
+
title: l(
|
|
1412
892
|
"ecommerce.stripe_checkout_title",
|
|
1413
893
|
"Stripe Checkout"
|
|
1414
894
|
),
|
|
1415
|
-
description:
|
|
895
|
+
description: l(
|
|
1416
896
|
"ecommerce.stripe_checkout_description",
|
|
1417
897
|
"Pay for physical products in one Stripe checkout session."
|
|
1418
898
|
),
|
|
1419
|
-
badgeLabel:
|
|
899
|
+
badgeLabel: st,
|
|
1420
900
|
children: [
|
|
1421
|
-
/* @__PURE__ */
|
|
1422
|
-
/* @__PURE__ */
|
|
1423
|
-
/* @__PURE__ */ e("span", { children:
|
|
901
|
+
/* @__PURE__ */ r("div", { className: "space-y-2 text-sm", children: [
|
|
902
|
+
/* @__PURE__ */ r("div", { className: "flex justify-between", children: [
|
|
903
|
+
/* @__PURE__ */ e("span", { children: l(
|
|
1424
904
|
"ecommerce.physical_subtotal",
|
|
1425
905
|
"Physical subtotal"
|
|
1426
|
-
) },
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
/* @__PURE__ */
|
|
1432
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1433
|
-
lineNumber: 1227,
|
|
1434
|
-
columnNumber: 21
|
|
1435
|
-
}, void 0)
|
|
1436
|
-
] }, void 0, !0, {
|
|
1437
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1438
|
-
lineNumber: 1220,
|
|
1439
|
-
columnNumber: 19
|
|
1440
|
-
}, void 0),
|
|
1441
|
-
Ne > 0 ? /* @__PURE__ */ e("div", { className: "flex justify-between text-emerald-600", children: [
|
|
1442
|
-
/* @__PURE__ */ e("span", { children: o("ecommerce.discount", "Discount") }, void 0, !1, {
|
|
1443
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1444
|
-
lineNumber: 1231,
|
|
1445
|
-
columnNumber: 23
|
|
1446
|
-
}, void 0),
|
|
1447
|
-
/* @__PURE__ */ e("span", { children: [
|
|
906
|
+
) }),
|
|
907
|
+
/* @__PURE__ */ e("span", { children: a(fe, o) })
|
|
908
|
+
] }),
|
|
909
|
+
ye > 0 ? /* @__PURE__ */ r("div", { className: "flex justify-between text-emerald-600", children: [
|
|
910
|
+
/* @__PURE__ */ e("span", { children: l("ecommerce.discount", "Discount") }),
|
|
911
|
+
/* @__PURE__ */ r("span", { children: [
|
|
1448
912
|
"-",
|
|
1449
|
-
|
|
1450
|
-
] }
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
] },
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
}, void 0) : null,
|
|
1460
|
-
/* @__PURE__ */ e("div", { className: "flex justify-between", children: [
|
|
1461
|
-
/* @__PURE__ */ e("span", { children: c("ecommerce.shipping") }, void 0, !1, {
|
|
1462
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1463
|
-
lineNumber: 1238,
|
|
1464
|
-
columnNumber: 21
|
|
1465
|
-
}, void 0),
|
|
1466
|
-
/* @__PURE__ */ e("span", { children: ie ? h(ie.amount, t) : "-" }, void 0, !1, {
|
|
1467
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1468
|
-
lineNumber: 1239,
|
|
1469
|
-
columnNumber: 21
|
|
1470
|
-
}, void 0)
|
|
1471
|
-
] }, void 0, !0, {
|
|
1472
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1473
|
-
lineNumber: 1237,
|
|
1474
|
-
columnNumber: 19
|
|
1475
|
-
}, void 0),
|
|
1476
|
-
/* @__PURE__ */ e("div", { className: "flex justify-between", children: [
|
|
1477
|
-
/* @__PURE__ */ e("span", { children: o("ecommerce.tax", "Tax") }, void 0, !1, {
|
|
1478
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1479
|
-
lineNumber: 1242,
|
|
1480
|
-
columnNumber: 21
|
|
1481
|
-
}, void 0),
|
|
1482
|
-
/* @__PURE__ */ e("span", { children: Ge ? "..." : j?.isPendingExternalCalculation ? o(
|
|
913
|
+
a(ye, o)
|
|
914
|
+
] })
|
|
915
|
+
] }) : null,
|
|
916
|
+
/* @__PURE__ */ r("div", { className: "flex justify-between", children: [
|
|
917
|
+
/* @__PURE__ */ e("span", { children: c("ecommerce.shipping") }),
|
|
918
|
+
/* @__PURE__ */ e("span", { children: oe ? a(oe.amount, o) : "-" })
|
|
919
|
+
] }),
|
|
920
|
+
/* @__PURE__ */ r("div", { className: "flex justify-between", children: [
|
|
921
|
+
/* @__PURE__ */ e("span", { children: l("ecommerce.tax", "Tax") }),
|
|
922
|
+
/* @__PURE__ */ e("span", { children: Ze ? "..." : k?.isPendingExternalCalculation ? l(
|
|
1483
923
|
"ecommerce.tax_calculated_on_stripe",
|
|
1484
924
|
"Calculated on Stripe"
|
|
1485
|
-
) :
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
] }, void 0, !0, {
|
|
1491
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1492
|
-
lineNumber: 1241,
|
|
1493
|
-
columnNumber: 19
|
|
1494
|
-
}, void 0),
|
|
1495
|
-
j && j.lines.length > 0 ? /* @__PURE__ */ e("div", { className: "rounded-lg bg-muted/20 px-3 py-2 text-xs text-muted-foreground", children: j.lines.map((s) => /* @__PURE__ */ e("div", { className: "flex justify-between gap-3", children: [
|
|
1496
|
-
/* @__PURE__ */ e("span", { children: [
|
|
1497
|
-
s.name,
|
|
925
|
+
) : k ? a(k.amount, o) : "-" })
|
|
926
|
+
] }),
|
|
927
|
+
k && k.lines.length > 0 ? /* @__PURE__ */ e("div", { className: "rounded-lg bg-muted/20 px-3 py-2 text-xs text-muted-foreground", children: k.lines.map((t) => /* @__PURE__ */ r("div", { className: "flex justify-between gap-3", children: [
|
|
928
|
+
/* @__PURE__ */ r("span", { children: [
|
|
929
|
+
t.name,
|
|
1498
930
|
" (",
|
|
1499
|
-
|
|
931
|
+
t.rate.toFixed(4),
|
|
1500
932
|
"%)"
|
|
1501
|
-
] },
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
/* @__PURE__ */ e("span", { children: h(s.amount, t) }, void 0, !1, {
|
|
1507
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1508
|
-
lineNumber: 1265,
|
|
1509
|
-
columnNumber: 27
|
|
1510
|
-
}, void 0)
|
|
1511
|
-
] }, s.id || `${s.name}-${s.rate}`, !0, {
|
|
1512
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1513
|
-
lineNumber: 1261,
|
|
1514
|
-
columnNumber: 25
|
|
1515
|
-
}, void 0)) }, void 0, !1, {
|
|
1516
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1517
|
-
lineNumber: 1259,
|
|
1518
|
-
columnNumber: 21
|
|
1519
|
-
}, void 0) : null,
|
|
1520
|
-
/* @__PURE__ */ e("div", { className: "flex justify-between font-semibold pt-2 border-t", children: [
|
|
1521
|
-
/* @__PURE__ */ e("span", { children: o(
|
|
933
|
+
] }),
|
|
934
|
+
/* @__PURE__ */ e("span", { children: a(t.amount, o) })
|
|
935
|
+
] }, t.id || `${t.name}-${t.rate}`)) }) : null,
|
|
936
|
+
/* @__PURE__ */ r("div", { className: "flex justify-between font-semibold pt-2 border-t", children: [
|
|
937
|
+
/* @__PURE__ */ e("span", { children: l(
|
|
1522
938
|
"ecommerce.total_on_stripe",
|
|
1523
939
|
"Total on Stripe"
|
|
1524
|
-
) },
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1531
|
-
lineNumber: 1277,
|
|
1532
|
-
columnNumber: 21
|
|
1533
|
-
}, void 0)
|
|
1534
|
-
] }, void 0, !0, {
|
|
1535
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1536
|
-
lineNumber: 1270,
|
|
1537
|
-
columnNumber: 19
|
|
1538
|
-
}, void 0)
|
|
1539
|
-
] }, void 0, !0, {
|
|
1540
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1541
|
-
lineNumber: 1219,
|
|
1542
|
-
columnNumber: 17
|
|
1543
|
-
}, void 0),
|
|
1544
|
-
/* @__PURE__ */ e(
|
|
1545
|
-
he,
|
|
940
|
+
) }),
|
|
941
|
+
/* @__PURE__ */ e("span", { children: a(qe, o) })
|
|
942
|
+
] })
|
|
943
|
+
] }),
|
|
944
|
+
/* @__PURE__ */ r(
|
|
945
|
+
we,
|
|
1546
946
|
{
|
|
1547
947
|
className: "w-full",
|
|
1548
948
|
size: "lg",
|
|
1549
|
-
onClick: () =>
|
|
1550
|
-
disabled:
|
|
949
|
+
onClick: () => Be("stripe", v, "stripe"),
|
|
950
|
+
disabled: ct,
|
|
1551
951
|
children: [
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
lineNumber: 1288,
|
|
1555
|
-
columnNumber: 21
|
|
1556
|
-
}, void 0) : /* @__PURE__ */ e(ks, { className: "mr-2 h-4 w-4" }, void 0, !1, {
|
|
1557
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1558
|
-
lineNumber: 1290,
|
|
1559
|
-
columnNumber: 21
|
|
1560
|
-
}, void 0),
|
|
1561
|
-
i === "stripe" ? c("ecommerce.processing") : o(
|
|
952
|
+
f === "stripe" ? /* @__PURE__ */ e(Se, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ e(kt, { className: "mr-2 h-4 w-4" }),
|
|
953
|
+
f === "stripe" ? c("ecommerce.processing") : l(
|
|
1562
954
|
"ecommerce.checkout_physical_products",
|
|
1563
955
|
"Checkout Physical Products"
|
|
1564
956
|
)
|
|
1565
957
|
]
|
|
1566
|
-
}
|
|
1567
|
-
void 0,
|
|
1568
|
-
!0,
|
|
1569
|
-
{
|
|
1570
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1571
|
-
lineNumber: 1281,
|
|
1572
|
-
columnNumber: 17
|
|
1573
|
-
},
|
|
1574
|
-
void 0
|
|
958
|
+
}
|
|
1575
959
|
),
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
columnNumber: 19
|
|
1580
|
-
}, void 0) : null,
|
|
1581
|
-
N.stripe ? /* @__PURE__ */ e("div", { className: "rounded-lg border border-destructive/20 bg-destructive/10 px-3 py-2 text-xs text-destructive", children: N.stripe }, void 0, !1, {
|
|
1582
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1583
|
-
lineNumber: 1307,
|
|
1584
|
-
columnNumber: 19
|
|
1585
|
-
}, void 0) : null,
|
|
1586
|
-
/* @__PURE__ */ e("p", { className: "text-[11px] text-muted-foreground", children: j?.isPendingExternalCalculation ? o(
|
|
960
|
+
ke && f === null ? /* @__PURE__ */ e("p", { className: "text-[11px] text-muted-foreground", children: ke }) : null,
|
|
961
|
+
A.stripe ? /* @__PURE__ */ e("div", { role: "alert", className: "rounded-lg border border-destructive/20 bg-destructive/10 px-3 py-2 text-xs text-destructive", children: A.stripe }) : null,
|
|
962
|
+
/* @__PURE__ */ e("p", { className: "text-[11px] text-muted-foreground", children: k?.isPendingExternalCalculation ? l(
|
|
1587
963
|
"checkout_stripe_tax_finalized_notice",
|
|
1588
964
|
"Tax will be finalized by Stripe Tax on the payment step."
|
|
1589
|
-
) :
|
|
965
|
+
) : l(
|
|
1590
966
|
"ecommerce.shipping_taxes_collected_on_stripe",
|
|
1591
967
|
"Shipping and taxes are only collected during the Stripe step for physical products."
|
|
1592
|
-
) }
|
|
1593
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1594
|
-
lineNumber: 1312,
|
|
1595
|
-
columnNumber: 17
|
|
1596
|
-
}, void 0)
|
|
968
|
+
) })
|
|
1597
969
|
]
|
|
1598
|
-
}
|
|
1599
|
-
void 0,
|
|
1600
|
-
!0,
|
|
1601
|
-
{
|
|
1602
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1603
|
-
lineNumber: 1208,
|
|
1604
|
-
columnNumber: 15
|
|
1605
|
-
},
|
|
1606
|
-
void 0
|
|
970
|
+
}
|
|
1607
971
|
) : null,
|
|
1608
|
-
|
|
1609
|
-
|
|
972
|
+
C.length > 0 ? /* @__PURE__ */ r(
|
|
973
|
+
Ve,
|
|
1610
974
|
{
|
|
1611
|
-
title:
|
|
975
|
+
title: l(
|
|
1612
976
|
"ecommerce.freemius_checkout_title",
|
|
1613
977
|
"Freemius Checkout"
|
|
1614
978
|
),
|
|
1615
|
-
description:
|
|
979
|
+
description: l(
|
|
1616
980
|
"ecommerce.freemius_checkout_description",
|
|
1617
981
|
"Digital products use the Freemius checkout flow."
|
|
1618
982
|
),
|
|
1619
|
-
badgeLabel:
|
|
983
|
+
badgeLabel: it,
|
|
1620
984
|
children: [
|
|
1621
|
-
/* @__PURE__ */ e("div", { className: "space-y-3", children:
|
|
1622
|
-
const
|
|
1623
|
-
currencyCode:
|
|
1624
|
-
currencies:
|
|
1625
|
-
}),
|
|
1626
|
-
return /* @__PURE__ */
|
|
1627
|
-
/* @__PURE__ */
|
|
1628
|
-
/* @__PURE__ */
|
|
1629
|
-
/* @__PURE__ */ e("p", { className: "font-medium", children:
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
}, void 0),
|
|
1634
|
-
s.billing_cycle ? /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground capitalize", children: os(s.billing_cycle) }, void 0, !1, {
|
|
1635
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1636
|
-
lineNumber: 1356,
|
|
1637
|
-
columnNumber: 31
|
|
1638
|
-
}, void 0) : null,
|
|
1639
|
-
u ? /* @__PURE__ */ e("p", { className: "text-xs font-medium text-emerald-700", children: [
|
|
1640
|
-
u.label,
|
|
985
|
+
/* @__PURE__ */ e("div", { className: "space-y-3", children: C.map((t) => {
|
|
986
|
+
const s = Ae(t, {
|
|
987
|
+
currencyCode: o,
|
|
988
|
+
currencies: L
|
|
989
|
+
}), h = He(t, c), i = `freemius:${t.id}`, _ = h ? F[i] || "paid" : void 0;
|
|
990
|
+
return /* @__PURE__ */ r("div", { className: "rounded-lg border p-3 space-y-3", children: [
|
|
991
|
+
/* @__PURE__ */ r("div", { className: "flex items-start justify-between gap-3", children: [
|
|
992
|
+
/* @__PURE__ */ r("div", { children: [
|
|
993
|
+
/* @__PURE__ */ e("p", { className: "font-medium", children: t.title }),
|
|
994
|
+
t.billing_cycle ? /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground capitalize", children: at(t.billing_cycle) }) : null,
|
|
995
|
+
h ? /* @__PURE__ */ r("p", { className: "text-xs font-medium text-emerald-700", children: [
|
|
996
|
+
h.label,
|
|
1641
997
|
" - ",
|
|
1642
|
-
|
|
1643
|
-
] }
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1650
|
-
lineNumber: 1353,
|
|
1651
|
-
columnNumber: 27
|
|
1652
|
-
}, void 0),
|
|
1653
|
-
/* @__PURE__ */ e("span", { className: "font-medium", children: h(r.sale_price ?? r.price, t) }, void 0, !1, {
|
|
1654
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1655
|
-
lineNumber: 1366,
|
|
1656
|
-
columnNumber: 27
|
|
1657
|
-
}, void 0)
|
|
1658
|
-
] }, void 0, !0, {
|
|
1659
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1660
|
-
lineNumber: 1352,
|
|
1661
|
-
columnNumber: 25
|
|
1662
|
-
}, void 0),
|
|
1663
|
-
u && !s.trial_requires_payment_method && /* @__PURE__ */ e("div", { className: "bg-muted/30 p-3 rounded-md border text-sm mt-2 mb-3", children: [
|
|
1664
|
-
/* @__PURE__ */ e("p", { className: "font-medium mb-3", children: o(
|
|
998
|
+
h.paymentRequirementLabel
|
|
999
|
+
] }) : null
|
|
1000
|
+
] }),
|
|
1001
|
+
/* @__PURE__ */ e("span", { className: "font-medium", children: a(s.sale_price ?? s.price, o) })
|
|
1002
|
+
] }),
|
|
1003
|
+
h && !t.trial_requires_payment_method && /* @__PURE__ */ r("div", { className: "bg-muted/30 p-3 rounded-md border text-sm mt-2 mb-3", children: [
|
|
1004
|
+
/* @__PURE__ */ e("p", { className: "font-medium mb-3", children: l(
|
|
1665
1005
|
"ecommerce.freemius_trial_preference_title",
|
|
1666
1006
|
"How would you like to start your trial?"
|
|
1667
|
-
) },
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
columnNumber: 29
|
|
1671
|
-
}, void 0),
|
|
1672
|
-
/* @__PURE__ */ e(
|
|
1673
|
-
us,
|
|
1007
|
+
) }),
|
|
1008
|
+
/* @__PURE__ */ r(
|
|
1009
|
+
Ue,
|
|
1674
1010
|
{
|
|
1675
|
-
value:
|
|
1676
|
-
onValueChange: (
|
|
1011
|
+
value: F[i] || "paid",
|
|
1012
|
+
onValueChange: (p) => u((d) => ({ ...d, [i]: p })),
|
|
1677
1013
|
className: "gap-3",
|
|
1678
1014
|
children: [
|
|
1679
|
-
/* @__PURE__ */
|
|
1680
|
-
/* @__PURE__ */ e(
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
columnNumber: 33
|
|
1684
|
-
}, void 0),
|
|
1685
|
-
/* @__PURE__ */ e("div", { className: "grid gap-1.5", children: [
|
|
1686
|
-
/* @__PURE__ */ e(v, { htmlFor: `${d}-paid`, className: "font-medium leading-none cursor-pointer", children: o(
|
|
1015
|
+
/* @__PURE__ */ r("div", { className: "flex items-start space-x-3", children: [
|
|
1016
|
+
/* @__PURE__ */ e(Ce, { value: "paid", id: `${i}-paid`, className: "mt-1" }),
|
|
1017
|
+
/* @__PURE__ */ r("div", { className: "grid gap-1.5", children: [
|
|
1018
|
+
/* @__PURE__ */ e(b, { htmlFor: `${i}-paid`, className: "font-medium leading-none cursor-pointer", children: l(
|
|
1687
1019
|
"ecommerce.freemius_trial_with_card",
|
|
1688
1020
|
"Enter Payment Details Now (Still get full trial length free)"
|
|
1689
|
-
) },
|
|
1690
|
-
|
|
1691
|
-
lineNumber: 1387,
|
|
1692
|
-
columnNumber: 35
|
|
1693
|
-
}, void 0),
|
|
1694
|
-
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: o(
|
|
1021
|
+
) }),
|
|
1022
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: l(
|
|
1695
1023
|
"ecommerce.freemius_trial_with_card_help",
|
|
1696
1024
|
"You will not be billed until the trial ends. Cancel anytime."
|
|
1697
|
-
) }
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1704
|
-
lineNumber: 1386,
|
|
1705
|
-
columnNumber: 33
|
|
1706
|
-
}, void 0)
|
|
1707
|
-
] }, void 0, !0, {
|
|
1708
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1709
|
-
lineNumber: 1384,
|
|
1710
|
-
columnNumber: 31
|
|
1711
|
-
}, void 0),
|
|
1712
|
-
/* @__PURE__ */ e("div", { className: "flex items-start space-x-3", children: [
|
|
1713
|
-
/* @__PURE__ */ e(Ee, { value: "free", id: `${d}-free`, className: "mt-1" }, void 0, !1, {
|
|
1714
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1715
|
-
lineNumber: 1402,
|
|
1716
|
-
columnNumber: 33
|
|
1717
|
-
}, void 0),
|
|
1718
|
-
/* @__PURE__ */ e("div", { className: "grid gap-1.5", children: /* @__PURE__ */ e(v, { htmlFor: `${d}-free`, className: "font-medium leading-none cursor-pointer", children: o(
|
|
1025
|
+
) })
|
|
1026
|
+
] })
|
|
1027
|
+
] }),
|
|
1028
|
+
/* @__PURE__ */ r("div", { className: "flex items-start space-x-3", children: [
|
|
1029
|
+
/* @__PURE__ */ e(Ce, { value: "free", id: `${i}-free`, className: "mt-1" }),
|
|
1030
|
+
/* @__PURE__ */ e("div", { className: "grid gap-1.5", children: /* @__PURE__ */ e(b, { htmlFor: `${i}-free`, className: "font-medium leading-none cursor-pointer", children: l(
|
|
1719
1031
|
"ecommerce.freemius_trial_no_card",
|
|
1720
1032
|
"Start Free Trial (No card required)"
|
|
1721
|
-
) }
|
|
1722
|
-
|
|
1723
|
-
lineNumber: 1404,
|
|
1724
|
-
columnNumber: 35
|
|
1725
|
-
}, void 0) }, void 0, !1, {
|
|
1726
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1727
|
-
lineNumber: 1403,
|
|
1728
|
-
columnNumber: 33
|
|
1729
|
-
}, void 0)
|
|
1730
|
-
] }, void 0, !0, {
|
|
1731
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1732
|
-
lineNumber: 1401,
|
|
1733
|
-
columnNumber: 31
|
|
1734
|
-
}, void 0)
|
|
1033
|
+
) }) })
|
|
1034
|
+
] })
|
|
1735
1035
|
]
|
|
1736
|
-
}
|
|
1737
|
-
void 0,
|
|
1738
|
-
!0,
|
|
1739
|
-
{
|
|
1740
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1741
|
-
lineNumber: 1379,
|
|
1742
|
-
columnNumber: 29
|
|
1743
|
-
},
|
|
1744
|
-
void 0
|
|
1036
|
+
}
|
|
1745
1037
|
)
|
|
1746
|
-
] },
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
columnNumber: 27
|
|
1750
|
-
}, void 0),
|
|
1751
|
-
/* @__PURE__ */ e(
|
|
1752
|
-
he,
|
|
1038
|
+
] }),
|
|
1039
|
+
/* @__PURE__ */ r(
|
|
1040
|
+
we,
|
|
1753
1041
|
{
|
|
1754
1042
|
className: "w-full h-auto min-h-[2.75rem] py-2",
|
|
1755
|
-
onClick: () =>
|
|
1043
|
+
onClick: () => Be(
|
|
1756
1044
|
"freemius",
|
|
1757
1045
|
[
|
|
1758
1046
|
{
|
|
1759
|
-
...
|
|
1760
|
-
...
|
|
1047
|
+
...t,
|
|
1048
|
+
..._ ? { trial_preference: _ } : {}
|
|
1761
1049
|
}
|
|
1762
1050
|
],
|
|
1763
|
-
|
|
1051
|
+
i
|
|
1764
1052
|
),
|
|
1765
|
-
disabled:
|
|
1053
|
+
disabled: f !== null || Ne !== null,
|
|
1766
1054
|
children: [
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
lineNumber: 1435,
|
|
1770
|
-
columnNumber: 29
|
|
1771
|
-
}, void 0) : /* @__PURE__ */ e(xs, { className: "mr-2 h-4 w-4 shrink-0" }, void 0, !1, {
|
|
1772
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1773
|
-
lineNumber: 1437,
|
|
1774
|
-
columnNumber: 29
|
|
1775
|
-
}, void 0),
|
|
1776
|
-
/* @__PURE__ */ e("span", { className: "whitespace-normal text-left", children: i === d ? c("ecommerce.processing") : D.length > 1 ? o(
|
|
1055
|
+
f === i ? /* @__PURE__ */ e(Se, { className: "mr-2 h-4 w-4 shrink-0 animate-spin" }) : /* @__PURE__ */ e(wt, { className: "mr-2 h-4 w-4 shrink-0" }),
|
|
1056
|
+
/* @__PURE__ */ e("span", { className: "whitespace-normal text-left", children: f === i ? c("ecommerce.processing") : C.length > 1 ? l(
|
|
1777
1057
|
"ecommerce.checkout_product",
|
|
1778
1058
|
"Checkout {title}",
|
|
1779
|
-
{ title:
|
|
1780
|
-
) :
|
|
1059
|
+
{ title: t.title }
|
|
1060
|
+
) : l(
|
|
1781
1061
|
"ecommerce.checkout_digital_product",
|
|
1782
1062
|
"Checkout Digital Product"
|
|
1783
|
-
) }
|
|
1784
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1785
|
-
lineNumber: 1439,
|
|
1786
|
-
columnNumber: 27
|
|
1787
|
-
}, void 0)
|
|
1063
|
+
) })
|
|
1788
1064
|
]
|
|
1789
|
-
}
|
|
1790
|
-
void 0,
|
|
1791
|
-
!0,
|
|
1792
|
-
{
|
|
1793
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1794
|
-
lineNumber: 1416,
|
|
1795
|
-
columnNumber: 25
|
|
1796
|
-
},
|
|
1797
|
-
void 0
|
|
1065
|
+
}
|
|
1798
1066
|
)
|
|
1799
|
-
] },
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
}, void 0);
|
|
1804
|
-
}) }, void 0, !1, {
|
|
1805
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1806
|
-
lineNumber: 1338,
|
|
1807
|
-
columnNumber: 17
|
|
1808
|
-
}, void 0),
|
|
1809
|
-
/* @__PURE__ */ e("div", { className: "flex justify-between text-sm font-semibold border-t pt-3", children: [
|
|
1810
|
-
/* @__PURE__ */ e("span", { children: o(
|
|
1067
|
+
] }, i);
|
|
1068
|
+
}) }),
|
|
1069
|
+
/* @__PURE__ */ r("div", { className: "flex justify-between text-sm font-semibold border-t pt-3", children: [
|
|
1070
|
+
/* @__PURE__ */ e("span", { children: l(
|
|
1811
1071
|
"ecommerce.digital_subtotal",
|
|
1812
1072
|
"Digital subtotal"
|
|
1813
|
-
) },
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
/* @__PURE__ */
|
|
1819
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1820
|
-
lineNumber: 1466,
|
|
1821
|
-
columnNumber: 19
|
|
1822
|
-
}, void 0)
|
|
1823
|
-
] }, void 0, !0, {
|
|
1824
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1825
|
-
lineNumber: 1459,
|
|
1826
|
-
columnNumber: 17
|
|
1827
|
-
}, void 0),
|
|
1828
|
-
be > 0 ? /* @__PURE__ */ e("div", { className: "flex justify-between text-sm font-semibold text-emerald-600", children: [
|
|
1829
|
-
/* @__PURE__ */ e("span", { children: o("ecommerce.discount", "Discount") }, void 0, !1, {
|
|
1830
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1831
|
-
lineNumber: 1470,
|
|
1832
|
-
columnNumber: 21
|
|
1833
|
-
}, void 0),
|
|
1834
|
-
/* @__PURE__ */ e("span", { children: [
|
|
1073
|
+
) }),
|
|
1074
|
+
/* @__PURE__ */ e("span", { children: a(_e, o) })
|
|
1075
|
+
] }),
|
|
1076
|
+
be > 0 ? /* @__PURE__ */ r("div", { className: "flex justify-between text-sm font-semibold text-emerald-600", children: [
|
|
1077
|
+
/* @__PURE__ */ e("span", { children: l("ecommerce.discount", "Discount") }),
|
|
1078
|
+
/* @__PURE__ */ r("span", { children: [
|
|
1835
1079
|
"-",
|
|
1836
|
-
|
|
1837
|
-
] }
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
] }, void 0, !0, {
|
|
1843
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1844
|
-
lineNumber: 1469,
|
|
1845
|
-
columnNumber: 19
|
|
1846
|
-
}, void 0) : null,
|
|
1847
|
-
pe ? /* @__PURE__ */ e("div", { className: "rounded-lg border border-amber-500/40 bg-amber-500/10 px-3 py-2 text-xs", children: pe }, void 0, !1, {
|
|
1848
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1849
|
-
lineNumber: 1476,
|
|
1850
|
-
columnNumber: 19
|
|
1851
|
-
}, void 0) : null,
|
|
1852
|
-
N.freemius ? /* @__PURE__ */ e("div", { className: "rounded-lg border border-destructive/20 bg-destructive/10 px-3 py-2 text-xs text-destructive", children: N.freemius }, void 0, !1, {
|
|
1853
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1854
|
-
lineNumber: 1482,
|
|
1855
|
-
columnNumber: 19
|
|
1856
|
-
}, void 0) : null,
|
|
1857
|
-
/* @__PURE__ */ e("p", { className: "text-[11px] text-muted-foreground", children: D.length > 1 ? o(
|
|
1080
|
+
a(be, o)
|
|
1081
|
+
] })
|
|
1082
|
+
] }) : null,
|
|
1083
|
+
Ne ? /* @__PURE__ */ e("div", { className: "rounded-lg border border-amber-500/40 bg-amber-500/10 px-3 py-2 text-xs", children: Ne }) : null,
|
|
1084
|
+
A.freemius ? /* @__PURE__ */ e("div", { role: "alert", className: "rounded-lg border border-destructive/20 bg-destructive/10 px-3 py-2 text-xs text-destructive", children: A.freemius }) : null,
|
|
1085
|
+
/* @__PURE__ */ e("p", { className: "text-[11px] text-muted-foreground", children: C.length > 1 ? l(
|
|
1858
1086
|
"ecommerce.freemius_multi_checkout_notice",
|
|
1859
1087
|
"Freemius licenses are completed one at a time, so each digital product gets its own checkout action."
|
|
1860
|
-
) :
|
|
1088
|
+
) : l(
|
|
1861
1089
|
"ecommerce.freemius_tax_notice",
|
|
1862
1090
|
"Taxes and compliance for digital products are handled inside the Freemius checkout."
|
|
1863
|
-
) }
|
|
1864
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1865
|
-
lineNumber: 1487,
|
|
1866
|
-
columnNumber: 17
|
|
1867
|
-
}, void 0)
|
|
1091
|
+
) })
|
|
1868
1092
|
]
|
|
1869
|
-
}
|
|
1870
|
-
void 0,
|
|
1871
|
-
!0,
|
|
1872
|
-
{
|
|
1873
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1874
|
-
lineNumber: 1327,
|
|
1875
|
-
columnNumber: 15
|
|
1876
|
-
},
|
|
1877
|
-
void 0
|
|
1093
|
+
}
|
|
1878
1094
|
) : null
|
|
1879
|
-
] }
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
}, void 0)
|
|
1884
|
-
] }, void 0, !0, {
|
|
1885
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1886
|
-
lineNumber: 943,
|
|
1887
|
-
columnNumber: 9
|
|
1888
|
-
}, void 0)
|
|
1889
|
-
] }, void 0, !0, {
|
|
1890
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1891
|
-
lineNumber: 940,
|
|
1892
|
-
columnNumber: 7
|
|
1893
|
-
}, void 0)
|
|
1894
|
-
] }, void 0, !0, {
|
|
1895
|
-
fileName: "C:/Users/desjardinsn/Desktop/NRH-NextBlock/libs/ecommerce/src/lib/components/Checkout.tsx",
|
|
1896
|
-
lineNumber: 937,
|
|
1897
|
-
columnNumber: 5
|
|
1898
|
-
}, void 0);
|
|
1095
|
+
] })
|
|
1096
|
+
] })
|
|
1097
|
+
] })
|
|
1098
|
+
] });
|
|
1899
1099
|
};
|
|
1900
1100
|
export {
|
|
1901
|
-
|
|
1101
|
+
dr as Checkout
|
|
1902
1102
|
};
|