@fluid-app/portal-sdk 0.1.311 → 0.1.313
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AddressAutocompleteInput-CmbuVfD5.cjs → AddressAutocompleteInput-BqZwiUup.cjs} +212 -136
- package/dist/AddressAutocompleteInput-BqZwiUup.cjs.map +1 -0
- package/dist/{AddressAutocompleteInput-RLaGWKfq.mjs → AddressAutocompleteInput-DY0ZFQOs.mjs} +212 -136
- package/dist/AddressAutocompleteInput-DY0ZFQOs.mjs.map +1 -0
- package/dist/{ContactsScreen-C2-ScK3i.cjs → ContactsScreen-B_iTSV67.cjs} +21 -21
- package/dist/{ContactsScreen-C2-ScK3i.cjs.map → ContactsScreen-B_iTSV67.cjs.map} +1 -1
- package/dist/{ContactsScreen-9613La-4.cjs → ContactsScreen-BacGvYpU.cjs} +1 -1
- package/dist/{ContactsScreen-CAwUXMDr.mjs → ContactsScreen-D2htG3gL.mjs} +21 -21
- package/dist/{ContactsScreen-CAwUXMDr.mjs.map → ContactsScreen-D2htG3gL.mjs.map} +1 -1
- package/dist/{FluidProvider-D4T1Tfn7.mjs → FluidProvider-BdjVFM6g.mjs} +5 -3
- package/dist/{FluidProvider-D4T1Tfn7.mjs.map → FluidProvider-BdjVFM6g.mjs.map} +1 -1
- package/dist/{FluidProvider-FvdFx8ML.cjs → FluidProvider-CiMgrTE0.cjs} +5 -3
- package/dist/{FluidProvider-FvdFx8ML.cjs.map → FluidProvider-CiMgrTE0.cjs.map} +1 -1
- package/dist/{MessagingScreen-_TJsaL8I.cjs → MessagingScreen-B0nvkVRJ.cjs} +2 -2
- package/dist/{MessagingScreen-_TJsaL8I.cjs.map → MessagingScreen-B0nvkVRJ.cjs.map} +1 -1
- package/dist/{MessagingScreen-CWqnuXcd.mjs → MessagingScreen-ClnTfJPR.mjs} +2 -2
- package/dist/{MessagingScreen-CWqnuXcd.mjs.map → MessagingScreen-ClnTfJPR.mjs.map} +1 -1
- package/dist/{MessagingScreen-bUf-46H5.cjs → MessagingScreen-DckwoF5C.cjs} +2 -2
- package/dist/{MessagingScreen-DuYCzPYW.mjs → MessagingScreen-Dz57LSh8.mjs} +2 -2
- package/dist/{OrdersScreen-kVm3EyXs.cjs → OrdersScreen-Ci3ZZZKP.cjs} +2 -2
- package/dist/{OrdersScreen-kVm3EyXs.cjs.map → OrdersScreen-Ci3ZZZKP.cjs.map} +1 -1
- package/dist/{OrdersScreen-CGxEuDzh.cjs → OrdersScreen-CtzoJUXX.cjs} +2 -2
- package/dist/{OrdersScreen-D1Whz24J.mjs → OrdersScreen-DKzZQPWm.mjs} +2 -2
- package/dist/{OrdersScreen-OEk3M3Qm.mjs → OrdersScreen-zpW6p4eP.mjs} +2 -2
- package/dist/{OrdersScreen-OEk3M3Qm.mjs.map → OrdersScreen-zpW6p4eP.mjs.map} +1 -1
- package/dist/{ProfileScreen-DCrPvVaF.cjs → ProfileScreen-BRYNGS4S.cjs} +3 -3
- package/dist/{ProfileScreen-BBjsjvuj.cjs → ProfileScreen-BXZMqNcY.cjs} +30 -23
- package/dist/ProfileScreen-BXZMqNcY.cjs.map +1 -0
- package/dist/{ProfileScreen-eeXNttNa.mjs → ProfileScreen-BirNjDNw.mjs} +3 -3
- package/dist/{ProfileScreen-DeTQ4Xoo.mjs → ProfileScreen-D-Vo-_yC.mjs} +30 -23
- package/dist/ProfileScreen-D-Vo-_yC.mjs.map +1 -0
- package/dist/{ShopScreen-BGiVyKAO.cjs → ShopScreen-CBZsxycw.cjs} +2 -2
- package/dist/{ShopScreen-KF3dsnFC.mjs → ShopScreen-CC3KbNCc.mjs} +2 -2
- package/dist/{ShopScreen-KF3dsnFC.mjs.map → ShopScreen-CC3KbNCc.mjs.map} +1 -1
- package/dist/{ShopScreen-Cx-iyP99.cjs → ShopScreen-D9I_t5HX.cjs} +2 -2
- package/dist/{ShopScreen-Cx-iyP99.cjs.map → ShopScreen-D9I_t5HX.cjs.map} +1 -1
- package/dist/{ShopScreen-CH3PhvzA.mjs → ShopScreen-Jsj-2scF.mjs} +2 -2
- package/dist/{SubscriptionsScreen-BJ8yW6x3.cjs → SubscriptionsScreen-Bo4cTf0n.cjs} +3 -3
- package/dist/{SubscriptionsScreen-7DGtY49t.cjs → SubscriptionsScreen-CNjeVllB.cjs} +152 -57
- package/dist/SubscriptionsScreen-CNjeVllB.cjs.map +1 -0
- package/dist/{SubscriptionsScreen-DpcL08EP.mjs → SubscriptionsScreen-DcmKn9y1.mjs} +152 -57
- package/dist/SubscriptionsScreen-DcmKn9y1.mjs.map +1 -0
- package/dist/{SubscriptionsScreen-CHdYF4Ga.mjs → SubscriptionsScreen-s9CNAkH9.mjs} +3 -3
- package/dist/{de-5dJcGXHd.mjs → de-CZcaM1mg.mjs} +33 -1
- package/dist/de-CZcaM1mg.mjs.map +1 -0
- package/dist/{de-279qQKkW.cjs → de-DOhr1RUy.cjs} +33 -1
- package/dist/de-DOhr1RUy.cjs.map +1 -0
- package/dist/{el-DXt-pZcE.mjs → el-CFfcOTW0.mjs} +33 -1
- package/dist/el-CFfcOTW0.mjs.map +1 -0
- package/dist/{el-CFPYRWKm.cjs → el-De6RiFnZ.cjs} +33 -1
- package/dist/el-De6RiFnZ.cjs.map +1 -0
- package/dist/{es-DLfWfxCc.cjs → es-BxpjC2GW.cjs} +33 -1
- package/dist/es-BxpjC2GW.cjs.map +1 -0
- package/dist/{es-WB2frRI4.mjs → es-jVAovyyN.mjs} +33 -1
- package/dist/es-jVAovyyN.mjs.map +1 -0
- package/dist/{fr-DgmvSclY.mjs → fr-BS-JXutt.mjs} +33 -1
- package/dist/fr-BS-JXutt.mjs.map +1 -0
- package/dist/{fr-C3IQZmS6.cjs → fr-DErR5mVD.cjs} +33 -1
- package/dist/fr-DErR5mVD.cjs.map +1 -0
- package/dist/{he-XJMTsvul.cjs → he-BCoena1G.cjs} +33 -1
- package/dist/he-BCoena1G.cjs.map +1 -0
- package/dist/{he-w6k-YiLm.mjs → he-Dm3gcP5z.mjs} +33 -1
- package/dist/he-Dm3gcP5z.mjs.map +1 -0
- package/dist/{hu-BydB22cZ.cjs → hu-BzV6oL5x.cjs} +33 -1
- package/dist/hu-BzV6oL5x.cjs.map +1 -0
- package/dist/{hu-tDjFfQ9J.mjs → hu-DrbPFf-v.mjs} +33 -1
- package/dist/hu-DrbPFf-v.mjs.map +1 -0
- package/dist/{id-Dp68FLAc.mjs → id-B8lS0RIT.mjs} +33 -1
- package/dist/id-B8lS0RIT.mjs.map +1 -0
- package/dist/{id-0CifOwIm.cjs → id-BJnQbLNZ.cjs} +33 -1
- package/dist/id-BJnQbLNZ.cjs.map +1 -0
- package/dist/index.cjs +20 -20
- package/dist/index.mjs +20 -20
- package/dist/{it-DngfQciz.mjs → it-Cz92WfRO.mjs} +33 -1
- package/dist/it-Cz92WfRO.mjs.map +1 -0
- package/dist/{it-CBdazuIz.cjs → it-Dij-dYqs.cjs} +33 -1
- package/dist/it-Dij-dYqs.cjs.map +1 -0
- package/dist/{ja-CVtC1kDv.cjs → ja-CrT0URkz.cjs} +33 -1
- package/dist/ja-CrT0URkz.cjs.map +1 -0
- package/dist/{ja-CkMDVPtH.mjs → ja-DI_TV2Zj.mjs} +33 -1
- package/dist/ja-DI_TV2Zj.mjs.map +1 -0
- package/dist/{ko-R-Le9JU8.cjs → ko-Dv4sXcM3.cjs} +33 -1
- package/dist/ko-Dv4sXcM3.cjs.map +1 -0
- package/dist/{ko-B72HbkvY.mjs → ko-E9TdOA9L.mjs} +33 -1
- package/dist/ko-E9TdOA9L.mjs.map +1 -0
- package/dist/{nl-CuaJpFBW.mjs → nl-B_w0JfzN.mjs} +33 -1
- package/dist/nl-B_w0JfzN.mjs.map +1 -0
- package/dist/{nl-dE66DT9d.cjs → nl-CPxJexkh.cjs} +33 -1
- package/dist/nl-CPxJexkh.cjs.map +1 -0
- package/dist/{pl-CNTDY6Ov.mjs → pl-BTmWl6HG.mjs} +33 -1
- package/dist/pl-BTmWl6HG.mjs.map +1 -0
- package/dist/{pl-d7LeUSmm.cjs → pl-ifHwr3rd.cjs} +33 -1
- package/dist/pl-ifHwr3rd.cjs.map +1 -0
- package/dist/{pt-Cu2TCvrS.mjs → pt-C1UtoI8g.mjs} +33 -1
- package/dist/pt-C1UtoI8g.mjs.map +1 -0
- package/dist/{pt-DlWYOQB7.cjs → pt-lMkT_wS4.cjs} +33 -1
- package/dist/pt-lMkT_wS4.cjs.map +1 -0
- package/dist/{ro-IGnNpnPk.mjs → ro-CQ1vwLZl.mjs} +33 -1
- package/dist/ro-CQ1vwLZl.mjs.map +1 -0
- package/dist/{ro-CxRERiJd.cjs → ro-DDUpw1f5.cjs} +33 -1
- package/dist/ro-DDUpw1f5.cjs.map +1 -0
- package/dist/{ru-BaL7GN_2.cjs → ru-BQOLcWNV.cjs} +33 -1
- package/dist/ru-BQOLcWNV.cjs.map +1 -0
- package/dist/{ru-CDda1N4V.mjs → ru-V4rwK1qm.mjs} +33 -1
- package/dist/ru-V4rwK1qm.mjs.map +1 -0
- package/dist/{th-Bmg6T2oO.mjs → th-BBDWFncd.mjs} +33 -1
- package/dist/th-BBDWFncd.mjs.map +1 -0
- package/dist/{th-eBfuOCvu.cjs → th-BCAGq41B.cjs} +33 -1
- package/dist/th-BCAGq41B.cjs.map +1 -0
- package/dist/{tl-yM51nib5.mjs → tl-CKtTJyIH.mjs} +33 -1
- package/dist/tl-CKtTJyIH.mjs.map +1 -0
- package/dist/{tl-DorumJMB.cjs → tl-D-jPdAL3.cjs} +33 -1
- package/dist/tl-D-jPdAL3.cjs.map +1 -0
- package/dist/{tr-q4NrT_MG.mjs → tr-C1fcNn_N.mjs} +33 -1
- package/dist/tr-C1fcNn_N.mjs.map +1 -0
- package/dist/{tr-CPLe40Ae.cjs → tr-DylwTPzx.cjs} +33 -1
- package/dist/tr-DylwTPzx.cjs.map +1 -0
- package/dist/{zh_CN-DELFfbhB.mjs → zh_CN-Ctx0sPwT.mjs} +33 -1
- package/dist/zh_CN-Ctx0sPwT.mjs.map +1 -0
- package/dist/{zh_CN-Bvmrqi_G.cjs → zh_CN-DhRV2h7N.cjs} +33 -1
- package/dist/zh_CN-DhRV2h7N.cjs.map +1 -0
- package/dist/{zh_TW-CryKLufw.mjs → zh_TW-Buj0u5-2.mjs} +33 -1
- package/dist/zh_TW-Buj0u5-2.mjs.map +1 -0
- package/dist/{zh_TW-DVfX_7Is.cjs → zh_TW-N9P2PjhJ.cjs} +33 -1
- package/dist/zh_TW-N9P2PjhJ.cjs.map +1 -0
- package/package.json +14 -14
- package/dist/AddressAutocompleteInput-CmbuVfD5.cjs.map +0 -1
- package/dist/AddressAutocompleteInput-RLaGWKfq.mjs.map +0 -1
- package/dist/ProfileScreen-BBjsjvuj.cjs.map +0 -1
- package/dist/ProfileScreen-DeTQ4Xoo.mjs.map +0 -1
- package/dist/SubscriptionsScreen-7DGtY49t.cjs.map +0 -1
- package/dist/SubscriptionsScreen-DpcL08EP.mjs.map +0 -1
- package/dist/de-279qQKkW.cjs.map +0 -1
- package/dist/de-5dJcGXHd.mjs.map +0 -1
- package/dist/el-CFPYRWKm.cjs.map +0 -1
- package/dist/el-DXt-pZcE.mjs.map +0 -1
- package/dist/es-DLfWfxCc.cjs.map +0 -1
- package/dist/es-WB2frRI4.mjs.map +0 -1
- package/dist/fr-C3IQZmS6.cjs.map +0 -1
- package/dist/fr-DgmvSclY.mjs.map +0 -1
- package/dist/he-XJMTsvul.cjs.map +0 -1
- package/dist/he-w6k-YiLm.mjs.map +0 -1
- package/dist/hu-BydB22cZ.cjs.map +0 -1
- package/dist/hu-tDjFfQ9J.mjs.map +0 -1
- package/dist/id-0CifOwIm.cjs.map +0 -1
- package/dist/id-Dp68FLAc.mjs.map +0 -1
- package/dist/it-CBdazuIz.cjs.map +0 -1
- package/dist/it-DngfQciz.mjs.map +0 -1
- package/dist/ja-CVtC1kDv.cjs.map +0 -1
- package/dist/ja-CkMDVPtH.mjs.map +0 -1
- package/dist/ko-B72HbkvY.mjs.map +0 -1
- package/dist/ko-R-Le9JU8.cjs.map +0 -1
- package/dist/nl-CuaJpFBW.mjs.map +0 -1
- package/dist/nl-dE66DT9d.cjs.map +0 -1
- package/dist/pl-CNTDY6Ov.mjs.map +0 -1
- package/dist/pl-d7LeUSmm.cjs.map +0 -1
- package/dist/pt-Cu2TCvrS.mjs.map +0 -1
- package/dist/pt-DlWYOQB7.cjs.map +0 -1
- package/dist/ro-CxRERiJd.cjs.map +0 -1
- package/dist/ro-IGnNpnPk.mjs.map +0 -1
- package/dist/ru-BaL7GN_2.cjs.map +0 -1
- package/dist/ru-CDda1N4V.mjs.map +0 -1
- package/dist/th-Bmg6T2oO.mjs.map +0 -1
- package/dist/th-eBfuOCvu.cjs.map +0 -1
- package/dist/tl-DorumJMB.cjs.map +0 -1
- package/dist/tl-yM51nib5.mjs.map +0 -1
- package/dist/tr-CPLe40Ae.cjs.map +0 -1
- package/dist/tr-q4NrT_MG.mjs.map +0 -1
- package/dist/zh_CN-Bvmrqi_G.cjs.map +0 -1
- package/dist/zh_CN-DELFfbhB.mjs.map +0 -1
- package/dist/zh_TW-CryKLufw.mjs.map +0 -1
- package/dist/zh_TW-DVfX_7Is.cjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
require("./chunk-9hOWP6kD.cjs");
|
|
2
|
-
const require_FluidProvider = require("./FluidProvider-
|
|
2
|
+
const require_FluidProvider = require("./FluidProvider-CiMgrTE0.cjs");
|
|
3
3
|
const require_portal_tenant_content = require("./portal_tenant_content-CrltRlMW.cjs");
|
|
4
4
|
const require_countries_api_context = require("./countries-api-context-G-NW4BoH.cjs");
|
|
5
5
|
const require_PortalTenantClientProvider = require("./PortalTenantClientProvider-OhJylQjc.cjs");
|
|
@@ -11,7 +11,7 @@ const require_query_keys = require("./query-keys-D3lK70Ea.cjs");
|
|
|
11
11
|
const require_use_account = require("./use-account-CEjH1hp5.cjs");
|
|
12
12
|
const require_AppNavigationContext = require("./AppNavigationContext-C1-hd9Rw.cjs");
|
|
13
13
|
const require_static_dict_adapter = require("./static-dict-adapter-DUeLZtek.cjs");
|
|
14
|
-
const require_AddressAutocompleteInput = require("./AddressAutocompleteInput-
|
|
14
|
+
const require_AddressAutocompleteInput = require("./AddressAutocompleteInput-BqZwiUup.cjs");
|
|
15
15
|
const require_isAfter = require("./isAfter-DXdeICis.cjs");
|
|
16
16
|
let react = require("react");
|
|
17
17
|
let _tanstack_react_query = require("@tanstack/react-query");
|
|
@@ -2440,6 +2440,21 @@ function formatDate(dateString, isCancelled = false) {
|
|
|
2440
2440
|
};
|
|
2441
2441
|
return `${monthName} ${dayNum}${ordinalSuffix(dayNum)}, ${yearNum}`;
|
|
2442
2442
|
}
|
|
2443
|
+
function formatTime(dateString, timezone) {
|
|
2444
|
+
if (!dateString || !timezone) return "";
|
|
2445
|
+
const date = new Date(dateString);
|
|
2446
|
+
if (Number.isNaN(date.getTime())) return "";
|
|
2447
|
+
try {
|
|
2448
|
+
return new Intl.DateTimeFormat("en-US", {
|
|
2449
|
+
hour: "numeric",
|
|
2450
|
+
minute: "2-digit",
|
|
2451
|
+
hour12: true,
|
|
2452
|
+
timeZone: timezone
|
|
2453
|
+
}).format(date);
|
|
2454
|
+
} catch {
|
|
2455
|
+
return "";
|
|
2456
|
+
}
|
|
2457
|
+
}
|
|
2443
2458
|
function getNextBillDisplay(subscription) {
|
|
2444
2459
|
if (subscription?.status === "cancelled") return "Cancelled";
|
|
2445
2460
|
if (subscription?.next_bill_date) return formatDate(subscription.next_bill_date);
|
|
@@ -2485,6 +2500,7 @@ function mapDetailSubscription(bff) {
|
|
|
2485
2500
|
original_price: safeParsePrice(bff.original_price, price),
|
|
2486
2501
|
next_bill_date: bff.next_billing_date ?? null,
|
|
2487
2502
|
last_bill_date: bff.last_billing_date ?? null,
|
|
2503
|
+
timezone: bff.timezone ?? null,
|
|
2488
2504
|
next_ship_date: null,
|
|
2489
2505
|
last_ship_date: null,
|
|
2490
2506
|
disabled: false,
|
|
@@ -4539,12 +4555,21 @@ const ADDRESS_DIALOG_LABELS = {
|
|
|
4539
4555
|
first_name: "First Name",
|
|
4540
4556
|
last_name: "Last Name",
|
|
4541
4557
|
deleting: "Deleting…",
|
|
4542
|
-
tap_to_confirm: "Tap to confirm"
|
|
4558
|
+
tap_to_confirm: "Tap to confirm",
|
|
4559
|
+
add_credit_card: "Add Credit Card",
|
|
4560
|
+
add_billing_address: "Add billing address",
|
|
4561
|
+
billing_address: "Billing Address",
|
|
4562
|
+
same_as_shipping: "Same as shipping address",
|
|
4563
|
+
use_a_different_address: "Use a different address",
|
|
4564
|
+
set_as_default_payment_method: "Set as default payment method",
|
|
4565
|
+
save_card: "Save Card",
|
|
4566
|
+
saving: "Saving...",
|
|
4567
|
+
securing: "Loading secure form..."
|
|
4543
4568
|
};
|
|
4544
4569
|
function addressDialogT(key) {
|
|
4545
4570
|
return ADDRESS_DIALOG_LABELS[key] ?? key.split("_").map((w) => w.charAt(0).toUpperCase() + w.slice(1)).join(" ");
|
|
4546
4571
|
}
|
|
4547
|
-
function mapToFluidPayAddress$
|
|
4572
|
+
function mapToFluidPayAddress$2(raw) {
|
|
4548
4573
|
return {
|
|
4549
4574
|
id: raw.id,
|
|
4550
4575
|
address1: raw.street1,
|
|
@@ -4572,7 +4597,7 @@ function SubscriptionsListScreenInner({ customerId, isLoadingCustomer, onToast }
|
|
|
4572
4597
|
const { data: addresses = [] } = (0, _tanstack_react_query.useQuery)({
|
|
4573
4598
|
queryKey: require_query_keys.payKeys.addresses.list(),
|
|
4574
4599
|
queryFn: async () => {
|
|
4575
|
-
return (await payApi.fetchAddresses()).addresses.map(mapToFluidPayAddress$
|
|
4600
|
+
return (await payApi.fetchAddresses()).addresses.map(mapToFluidPayAddress$2);
|
|
4576
4601
|
},
|
|
4577
4602
|
enabled: !!customerId && !isLoadingCustomer
|
|
4578
4603
|
});
|
|
@@ -4633,11 +4658,14 @@ function SubscriptionsListScreenInner({ customerId, isLoadingCustomer, onToast }
|
|
|
4633
4658
|
onError: () => onToast?.("Failed to add address", "error")
|
|
4634
4659
|
});
|
|
4635
4660
|
const addCreditCardMutation = (0, _tanstack_react_query.useMutation)({
|
|
4636
|
-
mutationFn: (data) => payApi.createPaymentMethod({
|
|
4637
|
-
|
|
4638
|
-
|
|
4639
|
-
|
|
4640
|
-
|
|
4661
|
+
mutationFn: (data) => payApi.createPaymentMethod({
|
|
4662
|
+
payment_method: {
|
|
4663
|
+
type: "card",
|
|
4664
|
+
token: data.payment_method.token,
|
|
4665
|
+
default: data.set_as_default
|
|
4666
|
+
},
|
|
4667
|
+
billing_address_id: data.billing_address_id
|
|
4668
|
+
}),
|
|
4641
4669
|
onSuccess: () => {
|
|
4642
4670
|
queryClient.invalidateQueries({ queryKey: require_query_keys.payKeys.paymentMethods.all });
|
|
4643
4671
|
onToast?.("Payment method added", "success");
|
|
@@ -4742,17 +4770,33 @@ function SubscriptionsListScreenInner({ customerId, isLoadingCustomer, onToast }
|
|
|
4742
4770
|
} catch {}
|
|
4743
4771
|
},
|
|
4744
4772
|
isSubmitting: addCreditCardMutation.isPending,
|
|
4745
|
-
countries: countryOptions,
|
|
4746
4773
|
jwt: "",
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
|
|
4750
|
-
|
|
4751
|
-
|
|
4752
|
-
|
|
4753
|
-
|
|
4754
|
-
|
|
4755
|
-
|
|
4774
|
+
savedAddresses: addresses,
|
|
4775
|
+
defaultBillingAddressId: addresses.find((a) => a.default)?.id,
|
|
4776
|
+
renderAddressFormDialog: ({ isOpen, onClose, onAddressCreated }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_AddressAutocompleteInput.AddressFormDialog, {
|
|
4777
|
+
isOpen,
|
|
4778
|
+
onClose,
|
|
4779
|
+
selectedAddress: null,
|
|
4780
|
+
defaultCountry: addresses.find((a) => a.default)?.country_code ?? config.countryIso ?? "US",
|
|
4781
|
+
t: addressDialogT,
|
|
4782
|
+
onSubmit: async (formData) => {
|
|
4783
|
+
try {
|
|
4784
|
+
onAddressCreated(mapToFluidPayAddress$2(await createAddressMutation.mutateAsync(formData)));
|
|
4785
|
+
} catch {}
|
|
4786
|
+
},
|
|
4787
|
+
isSubmitting: createAddressMutation.isPending,
|
|
4788
|
+
countries: countryOptions,
|
|
4789
|
+
fetchStates: fetchStatesFromCountries,
|
|
4790
|
+
renderAddressAutocomplete: ({ control, setValue, countryCode }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_AddressAutocompleteInput.AddressAutocompleteInput, {
|
|
4791
|
+
control,
|
|
4792
|
+
setValue,
|
|
4793
|
+
countryIso: countryCode,
|
|
4794
|
+
addressLineField: "address1",
|
|
4795
|
+
cityField: "city",
|
|
4796
|
+
stateField: "state",
|
|
4797
|
+
postalCodeField: "postal_code",
|
|
4798
|
+
placeholder: addressDialogT("address_line_1")
|
|
4799
|
+
})
|
|
4756
4800
|
})
|
|
4757
4801
|
})
|
|
4758
4802
|
] });
|
|
@@ -5627,6 +5671,7 @@ function SubscriptionItemsSection({ subscription, displayQuantity, displayNextBi
|
|
|
5627
5671
|
const quantityInputId = `subscription-${subscription.subscription_token}-quantity`;
|
|
5628
5672
|
const discount = subscription.original_price != null ? subscription.original_price - subscription.price : 0;
|
|
5629
5673
|
const subtotal = discount > 0 ? formatCurrency(subscription.original_price * quantity) : totalPrice;
|
|
5674
|
+
const nextOrderTimeOfDay = formatTime(displayNextBillDate ?? subscription.next_bill_date, subscription.timezone);
|
|
5630
5675
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("section", {
|
|
5631
5676
|
className: "bg-muted flex w-full flex-col items-center rounded-lg px-8 lg:col-span-4 lg:self-start",
|
|
5632
5677
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -5643,32 +5688,37 @@ function SubscriptionItemsSection({ subscription, displayQuantity, displayNextBi
|
|
|
5643
5688
|
className: "grid grid-cols-2 gap-4",
|
|
5644
5689
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5645
5690
|
className: "border-border border-r pr-4",
|
|
5646
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
5647
|
-
className: "text-muted-foreground mb-1 text-sm",
|
|
5648
|
-
children: t("next_order_date")
|
|
5649
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
5650
|
-
className: "text-foreground text-2xl font-bold",
|
|
5651
|
-
children: getNextBillDisplay(displayNextBillDate ? {
|
|
5652
|
-
...subscription,
|
|
5653
|
-
next_bill_date: displayNextBillDate
|
|
5654
|
-
} : subscription)
|
|
5655
|
-
})]
|
|
5656
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5657
|
-
className: "pl-4",
|
|
5658
5691
|
children: [
|
|
5659
5692
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
5660
5693
|
className: "text-muted-foreground mb-1 text-sm",
|
|
5661
|
-
children: t("
|
|
5694
|
+
children: t("next_order_date")
|
|
5662
5695
|
}),
|
|
5663
5696
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
5664
5697
|
className: "text-foreground text-2xl font-bold",
|
|
5665
|
-
children:
|
|
5698
|
+
children: getNextBillDisplay(displayNextBillDate ? {
|
|
5699
|
+
...subscription,
|
|
5700
|
+
next_bill_date: displayNextBillDate
|
|
5701
|
+
} : subscription)
|
|
5666
5702
|
}),
|
|
5667
|
-
|
|
5703
|
+
nextOrderTimeOfDay && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5668
5704
|
className: "text-muted-foreground mt-1 text-xs",
|
|
5669
|
-
children:
|
|
5705
|
+
children: [
|
|
5706
|
+
nextOrderTimeOfDay,
|
|
5707
|
+
" (",
|
|
5708
|
+
subscription.timezone,
|
|
5709
|
+
")"
|
|
5710
|
+
]
|
|
5670
5711
|
})
|
|
5671
5712
|
]
|
|
5713
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5714
|
+
className: "pl-4",
|
|
5715
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
5716
|
+
className: "text-muted-foreground mb-1 text-sm",
|
|
5717
|
+
children: t("next_bill_amount")
|
|
5718
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
5719
|
+
className: "text-foreground text-2xl font-bold",
|
|
5720
|
+
children: formatCurrency(subscription.price * quantity)
|
|
5721
|
+
})]
|
|
5672
5722
|
})]
|
|
5673
5723
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("hr", { className: "border-border mt-4" })]
|
|
5674
5724
|
})]
|
|
@@ -6445,6 +6495,20 @@ function SelectablePaymentMethodDropdown({ title, displayPaymentMethod, paymentM
|
|
|
6445
6495
|
}
|
|
6446
6496
|
//#endregion
|
|
6447
6497
|
//#region src/subscriptions/PortalSubscriptionPaymentMethodSection.tsx
|
|
6498
|
+
function mapToFluidPayAddress$1(raw) {
|
|
6499
|
+
return {
|
|
6500
|
+
id: raw.id,
|
|
6501
|
+
address1: raw.street1,
|
|
6502
|
+
address2: raw.street2,
|
|
6503
|
+
city: raw.city,
|
|
6504
|
+
country_code: raw.country,
|
|
6505
|
+
default: raw.default,
|
|
6506
|
+
name: raw.name,
|
|
6507
|
+
postal_code: raw.zip,
|
|
6508
|
+
state: raw.state,
|
|
6509
|
+
subdivision_code: null
|
|
6510
|
+
};
|
|
6511
|
+
}
|
|
6448
6512
|
function subscriptionPaymentMethodToFluidPay(raw) {
|
|
6449
6513
|
const details = raw.details;
|
|
6450
6514
|
return {
|
|
@@ -6485,6 +6549,13 @@ function PortalSubscriptionPaymentMethodSectionInner({ paymentMethod: currentPay
|
|
|
6485
6549
|
return (await payApi.fetchPaymentMethods()).payment_methods.map(require_AddressAutocompleteInput.mapToFluidPayPaymentMethod);
|
|
6486
6550
|
}
|
|
6487
6551
|
});
|
|
6552
|
+
const { data: addresses = [] } = (0, _tanstack_react_query.useQuery)({
|
|
6553
|
+
queryKey: require_query_keys.payKeys.addresses.list(),
|
|
6554
|
+
queryFn: async () => {
|
|
6555
|
+
return (await payApi.fetchAddresses()).addresses.map(mapToFluidPayAddress$1);
|
|
6556
|
+
},
|
|
6557
|
+
enabled: isAddDialogOpen
|
|
6558
|
+
});
|
|
6488
6559
|
const countriesApi = require_countries_api_context.useCountriesApi();
|
|
6489
6560
|
const { data: countriesData } = (0, _tanstack_react_query.useQuery)({
|
|
6490
6561
|
queryKey: require_query_keys.storeKeys.countries(),
|
|
@@ -6507,17 +6578,9 @@ function PortalSubscriptionPaymentMethodSectionInner({ paymentMethod: currentPay
|
|
|
6507
6578
|
payment_method: {
|
|
6508
6579
|
type: "card",
|
|
6509
6580
|
token: data.payment_method.token,
|
|
6510
|
-
default: data.
|
|
6581
|
+
default: data.set_as_default
|
|
6511
6582
|
},
|
|
6512
|
-
|
|
6513
|
-
country: data.billing_address.country_code,
|
|
6514
|
-
name: data.billing_address.name ?? null,
|
|
6515
|
-
street1: data.billing_address.address1,
|
|
6516
|
-
street2: data.billing_address.address2 ?? null,
|
|
6517
|
-
city: data.billing_address.city,
|
|
6518
|
-
state: data.billing_address.state,
|
|
6519
|
-
zip: data.billing_address.zip
|
|
6520
|
-
} }
|
|
6583
|
+
billing_address_id: data.billing_address_id
|
|
6521
6584
|
}),
|
|
6522
6585
|
onSuccess: async () => {
|
|
6523
6586
|
await queryClient.invalidateQueries({ queryKey: require_query_keys.payKeys.paymentMethods.all });
|
|
@@ -6525,6 +6588,24 @@ function PortalSubscriptionPaymentMethodSectionInner({ paymentMethod: currentPay
|
|
|
6525
6588
|
},
|
|
6526
6589
|
onError: (err) => onError?.(profileT("failed_to_add_payment_method"), err)
|
|
6527
6590
|
});
|
|
6591
|
+
const createAddressMutation = (0, _tanstack_react_query.useMutation)({
|
|
6592
|
+
mutationFn: (body) => {
|
|
6593
|
+
const combinedName = `${body.address.first_name} ${body.address.last_name}`.trim();
|
|
6594
|
+
return payApi.createAddress({ address: {
|
|
6595
|
+
name: combinedName.length > 0 ? combinedName : null,
|
|
6596
|
+
street1: body.address.address1,
|
|
6597
|
+
street2: body.address.address2,
|
|
6598
|
+
city: body.address.city,
|
|
6599
|
+
state: body.address.state,
|
|
6600
|
+
zip: body.address.postal_code,
|
|
6601
|
+
country: body.address.country_code
|
|
6602
|
+
} });
|
|
6603
|
+
},
|
|
6604
|
+
onSuccess: () => {
|
|
6605
|
+
queryClient.invalidateQueries({ queryKey: require_query_keys.payKeys.addresses.all });
|
|
6606
|
+
},
|
|
6607
|
+
onError: (err) => onError?.(profileT("failed_to_create_address"), err)
|
|
6608
|
+
});
|
|
6528
6609
|
const updatePaymentMethodMutation = (0, _tanstack_react_query.useMutation)({
|
|
6529
6610
|
mutationFn: ({ paymentMethodId, data }) => payApi.updatePaymentMethod(paymentMethodId, { payment_method: {
|
|
6530
6611
|
default: data.set_as_default,
|
|
@@ -6620,17 +6701,31 @@ function PortalSubscriptionPaymentMethodSectionInner({ paymentMethod: currentPay
|
|
|
6620
6701
|
} catch {}
|
|
6621
6702
|
},
|
|
6622
6703
|
isSubmitting: addCardMutation.isPending,
|
|
6623
|
-
countries: countryOptions,
|
|
6624
6704
|
jwt: "",
|
|
6625
|
-
|
|
6626
|
-
|
|
6627
|
-
|
|
6628
|
-
|
|
6629
|
-
|
|
6630
|
-
|
|
6631
|
-
|
|
6632
|
-
|
|
6633
|
-
|
|
6705
|
+
savedAddresses: addresses,
|
|
6706
|
+
defaultBillingAddressId: addresses.find((a) => a.default)?.id,
|
|
6707
|
+
renderAddressFormDialog: ({ isOpen, onClose, onAddressCreated }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_AddressAutocompleteInput.AddressFormDialog, {
|
|
6708
|
+
isOpen,
|
|
6709
|
+
onClose,
|
|
6710
|
+
selectedAddress: null,
|
|
6711
|
+
t: tFn,
|
|
6712
|
+
onSubmit: async (formData) => {
|
|
6713
|
+
try {
|
|
6714
|
+
onAddressCreated(mapToFluidPayAddress$1(await createAddressMutation.mutateAsync(formData)));
|
|
6715
|
+
} catch {}
|
|
6716
|
+
},
|
|
6717
|
+
isSubmitting: createAddressMutation.isPending,
|
|
6718
|
+
countries: countryOptions,
|
|
6719
|
+
renderAddressAutocomplete: ({ control, setValue, countryCode }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_AddressAutocompleteInput.AddressAutocompleteInput, {
|
|
6720
|
+
control,
|
|
6721
|
+
setValue,
|
|
6722
|
+
countryIso: countryCode,
|
|
6723
|
+
addressLineField: "address1",
|
|
6724
|
+
cityField: "city",
|
|
6725
|
+
stateField: "state",
|
|
6726
|
+
postalCodeField: "postal_code",
|
|
6727
|
+
placeholder: profileT("address_line_1")
|
|
6728
|
+
})
|
|
6634
6729
|
})
|
|
6635
6730
|
}),
|
|
6636
6731
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_AddressAutocompleteInput.EditPaymentMethodDialog, {
|
|
@@ -7122,4 +7217,4 @@ Object.defineProperty(exports, "subscriptionsScreenPropertySchema", {
|
|
|
7122
7217
|
}
|
|
7123
7218
|
});
|
|
7124
7219
|
|
|
7125
|
-
//# sourceMappingURL=SubscriptionsScreen-
|
|
7220
|
+
//# sourceMappingURL=SubscriptionsScreen-CNjeVllB.cjs.map
|