@zonos/elements 1.3.51 → 1.3.52
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/cjs/CheckoutConfig-65376e00.js +40 -0
- package/dist/cjs/{cart-546d1602.js → cart-61a8983d.js} +238 -375
- package/dist/cjs/{createCustomEvent-9b91480b.js → createCustomEvent-228027b5.js} +3 -2
- package/dist/cjs/handleFetch-842c95b0.js +322 -0
- package/dist/cjs/index.cjs.js +75 -35
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{paypal-83f49f9a.js → paypal-f1eb6621.js} +16 -16
- package/dist/cjs/zonos-address_8.cjs.entry.js +4 -4
- package/dist/cjs/{zonos-cart-items_12.cjs.entry.js → zonos-badge_13.cjs.entry.js} +41 -9
- package/dist/cjs/zonos-checkout.cjs.entry.js +75 -174
- package/dist/cjs/zonos-controller.cjs.entry.js +27 -25
- package/dist/cjs/zonos-country-flag.cjs.entry.js +2 -2
- package/dist/cjs/zonos-country-select_4.cjs.entry.js +2 -2
- package/dist/cjs/zonos-elements.cjs.js +1 -1
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +2 -2
- package/dist/cjs/zonos-hello.cjs.entry.js +11 -11
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +2 -2
- package/dist/cjs/zonos-notification_3.cjs.entry.js +9 -9
- package/dist/cjs/zonos-tooltip.cjs.entry.js +27 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.js +5 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +44 -20
- package/dist/collection/components/store/checkout/cart.js +14 -2
- package/dist/collection/components/store/checkout/stripe.js +9 -4
- package/dist/collection/components/store/translationStore/strings.arabic.js +3 -3
- package/dist/collection/components/store/translationStore/strings.base.js +3 -3
- package/dist/collection/components/store/translationStore/strings.chinese.js +3 -3
- package/dist/collection/components/store/translationStore/strings.danish.js +3 -3
- package/dist/collection/components/store/translationStore/strings.dutch.js +3 -3
- package/dist/collection/components/store/translationStore/strings.french.js +3 -3
- package/dist/collection/components/store/translationStore/strings.german.js +3 -3
- package/dist/collection/components/store/translationStore/strings.hebrew.js +3 -3
- package/dist/collection/components/store/translationStore/strings.indonesian.js +3 -3
- package/dist/collection/components/store/translationStore/strings.italian.js +3 -3
- package/dist/collection/components/store/translationStore/strings.japanese.js +3 -3
- package/dist/collection/components/store/translationStore/strings.korean.js +3 -3
- package/dist/collection/components/store/translationStore/strings.norwegian.js +3 -3
- package/dist/collection/components/store/translationStore/strings.polish.js +3 -3
- package/dist/collection/components/store/translationStore/strings.portuguese.js +3 -3
- package/dist/collection/components/store/translationStore/strings.russian.js +3 -3
- package/dist/collection/components/store/translationStore/strings.spanish.js +3 -3
- package/dist/collection/components/store/translationStore/strings.swedish.js +3 -3
- package/dist/collection/components/store/translationStore/strings.turkish.js +3 -3
- package/dist/collection/components/store/translationStore/strings.vietnamese.js +3 -3
- package/dist/collection/components/utils/api/buildCartItemsByTempCart.js +14 -14
- package/dist/collection/components/utils/api/calculateLandedCostNormalized.js +28 -0
- package/dist/collection/components/utils/api/cartCalculateLandedCost.js +19 -0
- package/dist/collection/components/utils/api/prepCalculateLandedCost.js +65 -0
- package/dist/collection/components/utils/checkout/initCheckout.js +4 -2
- package/dist/collection/environment.js +1 -1
- package/dist/collection/scripts/_getNextFallbackUrl.js +1 -0
- package/dist/collection/scripts/_getTempCartById.js +14 -0
- package/dist/collection/scripts/_zonosBase.js +39 -10
- package/dist/collection/scripts/cart/_getCartIdFromParam.js +9 -0
- package/dist/collection/scripts/cart/_setupCartData.js +18 -0
- package/dist/collection/types/checkout/CheckoutConfig.js +2 -1
- package/dist/collection/types/generated/graphql.customer.types.js +12 -0
- package/dist/collection/utils/formattedCloudflareApiUrl.js +8 -2
- package/dist/collection/utils/generateCloudflareDeployUrl.js +3 -0
- package/dist/esm/CheckoutConfig-57350b28.js +36 -0
- package/dist/esm/{cart-51529af2.js → cart-45d2861f.js} +193 -327
- package/dist/esm/{createCustomEvent-b8bbdf5e.js → createCustomEvent-3fcc948a.js} +2 -1
- package/dist/esm/handleFetch-37cea185.js +315 -0
- package/dist/esm/index.js +56 -17
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{paypal-905325d0.js → paypal-ee310945.js} +2 -2
- package/dist/esm/zonos-address_8.entry.js +2 -2
- package/dist/esm/{zonos-cart-items_12.entry.js → zonos-badge_13.entry.js} +40 -9
- package/dist/esm/zonos-checkout.entry.js +61 -160
- package/dist/esm/zonos-controller.entry.js +6 -4
- package/dist/esm/zonos-country-flag.entry.js +2 -2
- package/dist/esm/zonos-country-select_4.entry.js +2 -2
- package/dist/esm/zonos-elements.js +1 -1
- package/dist/esm/zonos-hello-dialog.entry.js +2 -2
- package/dist/esm/zonos-hello.entry.js +2 -2
- package/dist/esm/zonos-language-select_2.entry.js +2 -2
- package/dist/esm/zonos-notification_3.entry.js +3 -3
- package/dist/esm/zonos-tooltip.entry.js +23 -0
- package/dist/esm-es5/CheckoutConfig-57350b28.js +1 -0
- package/dist/esm-es5/cart-45d2861f.js +1 -0
- package/dist/esm-es5/{createCustomEvent-b8bbdf5e.js → createCustomEvent-3fcc948a.js} +1 -1
- package/dist/esm-es5/handleFetch-37cea185.js +1 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/{paypal-905325d0.js → paypal-ee310945.js} +1 -1
- package/dist/esm-es5/zonos-address_8.entry.js +1 -1
- package/dist/esm-es5/zonos-badge_13.entry.js +1 -0
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-controller.entry.js +1 -1
- package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
- package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
- package/dist/esm-es5/zonos-elements.js +1 -1
- package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm-es5/zonos-hello.entry.js +1 -1
- package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
- package/dist/esm-es5/zonos-notification_3.entry.js +1 -1
- package/dist/esm-es5/zonos-tooltip.entry.js +1 -0
- package/dist/scripts/index.d.ts +74 -87
- package/dist/scripts/index.js +1 -1
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/types/components/checkout/zonos-checkout/zonos-checkout.d.ts +0 -2
- package/dist/types/components/store/checkout/cart.d.ts +13 -3
- package/dist/types/components/store/checkout/stripe.d.ts +3 -1
- package/dist/types/components/store/translationStore/strings.arabic.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.base.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.chinese.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.danish.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.dutch.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.french.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.german.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.hebrew.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.indonesian.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.italian.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.japanese.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.korean.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.norwegian.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.polish.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.portuguese.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.russian.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.spanish.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.swedish.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.turkish.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +3 -3
- package/dist/types/components/store/translationStore.d.ts +1 -1
- package/dist/types/components/utils/api/buildCartItemsByTempCart.d.ts +8 -3
- package/dist/types/components/utils/api/calculateLandedCostNormalized.d.ts +2 -0
- package/dist/types/components/utils/api/cartCalculateLandedCost.d.ts +5 -0
- package/dist/types/components/utils/api/prepCalculateLandedCost.d.ts +5 -1
- package/dist/types/components/utils/checkout/getIsTestMode.d.ts +1 -1
- package/dist/types/scripts/_getNextFallbackUrl.d.ts +1 -0
- package/dist/types/scripts/_getTempCartById.d.ts +8 -0
- package/dist/types/scripts/_zonosBase.d.ts +15 -12
- package/dist/types/scripts/cart/_getCartIdFromParam.d.ts +4 -0
- package/dist/types/scripts/cart/_setupCartData.d.ts +7 -0
- package/dist/types/types/checkout/CheckoutConfig.d.ts +18 -3
- package/dist/types/types/checkout/api/CalculateLandedCostRequest.d.ts +42 -1
- package/dist/types/types/checkout/api/NormalizedTempCart.d.ts +37 -0
- package/dist/types/types/generated/graphql.customer.types.d.ts +249 -2
- package/dist/types/types/generated/graphql.customer.types.ts +251 -3
- package/dist/types/utils/formattedCloudflareApiUrl.d.ts +2 -2
- package/dist/zonos-elements/assets/RemoveIcon.svg +1 -1
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/p-042c466d.system.entry.js +1 -0
- package/dist/zonos-elements/p-10cb0064.entry.js +1 -0
- package/dist/zonos-elements/{p-5e56828a.entry.js → p-259ccf8d.entry.js} +1 -1
- package/dist/zonos-elements/p-2a47d2cc.system.entry.js +1 -0
- package/dist/zonos-elements/{p-ffd76226.entry.js → p-31eb835c.entry.js} +1 -1
- package/dist/zonos-elements/{p-58d9803d.entry.js → p-36360905.entry.js} +1 -1
- package/dist/zonos-elements/{p-1828a4ff.system.entry.js → p-3703b814.system.entry.js} +1 -1
- package/dist/zonos-elements/p-4146feec.js +1 -0
- package/dist/zonos-elements/p-446c8f02.system.entry.js +1 -0
- package/dist/zonos-elements/{p-2c323311.system.js → p-5590f90c.system.js} +1 -1
- package/dist/zonos-elements/p-588396df.js +1 -0
- package/dist/zonos-elements/{p-aa5d669b.js → p-6e59c6e4.js} +2 -2
- package/dist/zonos-elements/p-6eedc3f8.entry.js +1 -0
- package/dist/zonos-elements/p-747eed39.entry.js +1 -0
- package/dist/zonos-elements/{p-00100b17.system.entry.js → p-8228e87c.system.entry.js} +1 -1
- package/dist/zonos-elements/p-827868e6.entry.js +1 -0
- package/dist/zonos-elements/{p-cc7a4fca.entry.js → p-88005b94.entry.js} +1 -1
- package/dist/zonos-elements/p-895fdefb.js +1 -0
- package/dist/zonos-elements/p-8f7773b0.system.js +1 -0
- package/dist/zonos-elements/{p-9a0401fd.entry.js → p-8fa49d94.entry.js} +1 -1
- package/dist/zonos-elements/p-a74a7afa.system.js +1 -0
- package/dist/zonos-elements/p-b1861e64.system.js +1 -0
- package/dist/zonos-elements/{p-8473f99a.system.entry.js → p-b842b96a.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-9e976332.entry.js → p-bb186075.entry.js} +1 -1
- package/dist/zonos-elements/{p-b1a8b874.system.entry.js → p-c008648a.system.entry.js} +1 -1
- package/dist/zonos-elements/p-c78dd680.system.js +1 -1
- package/dist/zonos-elements/{p-6b42fa1b.system.entry.js → p-cd4ad1be.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-59e85369.system.entry.js → p-d62e6bb0.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-496e040f.system.entry.js → p-dc12f30a.system.entry.js} +1 -1
- package/dist/zonos-elements/p-eb2aedd0.js +1 -0
- package/dist/zonos-elements/{p-c89859cf.system.js → p-f124e459.system.js} +2 -2
- package/dist/zonos-elements/p-f527cd5b.entry.js +1 -0
- package/dist/zonos-elements/p-f826b979.system.entry.js +1 -0
- package/dist/zonos-elements/p-f87a635b.system.js +1 -0
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/logError-4e2f2020.js +0 -58
- package/dist/cjs/zonos-badge_2.cjs.entry.js +0 -57
- package/dist/collection/components/utils/api/tempCartItem/getAttributes.js +0 -66
- package/dist/collection/components/utils/api/tempCartItem/getMeasurements.js +0 -58
- package/dist/esm/logError-c456c092.js +0 -55
- package/dist/esm/zonos-badge_2.entry.js +0 -52
- package/dist/esm-es5/cart-51529af2.js +0 -1
- package/dist/esm-es5/logError-c456c092.js +0 -1
- package/dist/esm-es5/zonos-badge_2.entry.js +0 -1
- package/dist/esm-es5/zonos-cart-items_12.entry.js +0 -1
- package/dist/types/components/utils/api/tempCartItem/getAttributes.d.ts +0 -11
- package/dist/types/components/utils/api/tempCartItem/getMeasurements.d.ts +0 -7
- package/dist/types/types/checkout/api/TempCart.d.ts +0 -80
- package/dist/zonos-elements/p-101c41bf.entry.js +0 -1
- package/dist/zonos-elements/p-3c4eec63.system.entry.js +0 -1
- package/dist/zonos-elements/p-47945026.system.entry.js +0 -1
- package/dist/zonos-elements/p-47c72c50.system.entry.js +0 -1
- package/dist/zonos-elements/p-4e77ed65.system.entry.js +0 -1
- package/dist/zonos-elements/p-6013e370.entry.js +0 -1
- package/dist/zonos-elements/p-63db40b9.system.js +0 -1
- package/dist/zonos-elements/p-8b8ef484.entry.js +0 -1
- package/dist/zonos-elements/p-b57d24f2.entry.js +0 -1
- package/dist/zonos-elements/p-ba0289f9.entry.js +0 -1
- package/dist/zonos-elements/p-c8a3303b.js +0 -1
- package/dist/zonos-elements/p-d413cd13.js +0 -1
- package/dist/zonos-elements/p-e758ec31.system.js +0 -1
- package/dist/zonos-elements/p-eaa335e1.js +0 -1
- package/dist/zonos-elements/p-fcfde531.system.js +0 -1
- /package/dist/collection/types/checkout/api/{TempCart.js → NormalizedTempCart.js} +0 -0
|
@@ -1,16 +1,44 @@
|
|
|
1
|
-
import { r as registerInstance,
|
|
2
|
-
import {
|
|
1
|
+
import { r as registerInstance, h, H as Host, a as getAssetPath, F as Fragment, c as createEvent, d as getElement } from './index-86b8247e.js';
|
|
2
|
+
import { d as zonosStoreFontFamily, z as zonosStore, g as getZonosStoreTheme } from './zonosStore-473f4654.js';
|
|
3
3
|
import { c as classes } from './classes-0d95c529.js';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { t as trackConversionEvent, c as createCustomEvent, g as getIsTestMode } from './createCustomEvent-
|
|
4
|
+
import { d as cartStore, D as currencyFormat, E as cartStoreHasOneEligibleItem, t as translate, u as stripeStoreReset, j as stripeStore, F as stripeStoreRetrievePayment, G as stripeStoreMessageBasedOnStatus, l as localizationStore, H as stripeStoreTranslateAddressToLatin, I as cartStoreUpdateSelectedShippingOption, J as cartStoreGetShippingTransitInfo } from './cart-45d2861f.js';
|
|
5
|
+
import { s as submitGtag, a as paypalStore, b as paypalStoreReset, c as paypalStoreHasPaypalEnabled, i as isContrastColor } from './paypal-ee310945.js';
|
|
6
|
+
import { t as trackConversionEvent, c as createCustomEvent, g as getIsTestMode } from './createCustomEvent-3fcc948a.js';
|
|
7
7
|
import { g as getBorderRadius } from './getBorderRadius-23398fc6.js';
|
|
8
|
+
import { h as handleFetch, s as sendErrorLog } from './handleFetch-37cea185.js';
|
|
8
9
|
import { i as isCheckoutMobile } from './isCheckoutMobile-8846dccb.js';
|
|
9
10
|
import { l as languages } from './ILanguage-cd6acb72.js';
|
|
10
11
|
import { i as isDarkColor, t as tinycolor } from './isDarkColor-c927f77d.js';
|
|
11
12
|
import { i as isColorVariable } from './isColorVariable-82457bef.js';
|
|
12
13
|
import { c as containsNonLatinChars } from './containsNonLatinChars-2d8810c3.js';
|
|
13
|
-
|
|
14
|
+
|
|
15
|
+
const zonosBadgeCss = ":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex}:host .zonos--badge-content{display:-ms-flexbox;display:flex;gap:8px;font-size:var(--zonos-elements-font-size-s);padding:4px 8px;text-align:center;border-radius:var(--zonos-elements-radius-6);background-color:var(--zonos-elements-gray-100);color:var(--zonos-elements-gray-800);-ms-flex-align:center;align-items:center}:host p{font-weight:600;line-height:16px}:host .icon-right svg{-ms-flex-order:2;order:2}:host .small{padding:2px 8px}:host .rounded{border-radius:20px}:host .bold{background-color:var(--zonos-elements-gray-600);color:var(--zonos-elements-gray-100)}:host .blue{background-color:var(--zonos-elements-blue-100);color:var(--zonos-elements-blue-800)}:host .blue.bold{background-color:var(--zonos-elements-blue-600);color:var(--zonos-elements-blue-100)}:host .green{background-color:var(--zonos-elements-green-100);color:var(--zonos-elements-green-800)}:host .green.bold{background-color:var(--zonos-elements-green-600);color:var(--zonos-elements-green-100)}:host .red{background-color:var(--zonos-elements-red-100);color:var(--zonos-elements-red-800)}:host .red.bold{background-color:var(--zonos-elements-red-600);color:var(--zonos-elements-red-100)}:host .orange{background-color:var(--zonos-elements-orange-100);color:var(--zonos-elements-orange-800);border:1px solid var(--zonos-elements-orange-200)}:host .orange.bold{background-color:var(--zonos-elements-orange-600);color:var(--zonos-elements-orange-100)}:host .purple{background-color:var(--zonos-elements-purple-100);color:var(--zonos-elements-purple-800)}:host .purple.bold{background-color:var(--zonos-elements-purple-600);color:var(--zonos-elements-purple-100)}:host .cyan{background-color:var(--zonos-elements-cyan-100);color:var(--zonos-elements-cyan-800)}:host .cyan.bold{background-color:var(--zonos-elements-cyan-600);color:var(--zonos-elements-cyan-100)}:host .transparent{background-color:transparent;border:1px solid var(--zonos-elements-gray-200);color:var(--zonos-elements-gray-800)}:host .transparent.bold{background-color:var(--zonos-elements-glass-600);color:var(--zonos-elements-gray-100)}";
|
|
16
|
+
const ZonosBadgeStyle0 = zonosBadgeCss;
|
|
17
|
+
|
|
18
|
+
const ZonosBadge = class {
|
|
19
|
+
constructor(hostRef) {
|
|
20
|
+
registerInstance(this, hostRef);
|
|
21
|
+
this.bold = false;
|
|
22
|
+
this.badgeColor = 'gray';
|
|
23
|
+
this.icon = undefined;
|
|
24
|
+
this.iconRight = false;
|
|
25
|
+
this.size = 'default';
|
|
26
|
+
this.rounded = false;
|
|
27
|
+
}
|
|
28
|
+
render() {
|
|
29
|
+
return (h(Host, { key: '4e022b4090de017818c5ba8f86e2d7684a1b8f05', class: classes(['zonos--elements zonos--badge']), style: {
|
|
30
|
+
'--font-family': zonosStoreFontFamily(),
|
|
31
|
+
} }, h("div", { key: '8e6a4c0fcf81939d69fd3aec91463ed6c7a2d67d', class: classes([
|
|
32
|
+
'zonos--badge-content',
|
|
33
|
+
this.badgeColor,
|
|
34
|
+
this.rounded && 'rounded',
|
|
35
|
+
this.iconRight && 'icon-right',
|
|
36
|
+
this.size,
|
|
37
|
+
this.bold && 'bold',
|
|
38
|
+
]) }, this.icon, h("zonos-text", { key: '5824866453d31abef18443179e6bc1692e9e98a3', textColor: `${this.badgeColor}-800` }, h("slot", { key: '9bc411177ae04e8fa1061098023860204fa1a5d7' })))));
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
ZonosBadge.style = ZonosBadgeStyle0;
|
|
14
42
|
|
|
15
43
|
const zonosCartItemsCss = ":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--cart-table{width:100%;border:none;border-collapse:collapse;overflow:auto;font-size:var(--zonos-elements-font-size-base)}:host .zonos--cart-table .zonos--column{padding:8px;font-size:var(--zonos-elements-font-size-base)}:host .zonos--cart-table .zonos--column:last-child{text-align:right}:host .zonos--cart-table .zonos--column:first-child{width:60px}:host .zonos--cart-table td{vertical-align:top}:host .zonos--cart-item-price zonos-text{white-space:nowrap}:host img{min-width:40px;margin-top:6px}";
|
|
16
44
|
const ZonosCartItemsStyle0 = zonosCartItemsCss;
|
|
@@ -157,12 +185,15 @@ const ZonosCartSubtotal = class {
|
|
|
157
185
|
amount: cartStore.shipping,
|
|
158
186
|
currency: cartStore.currency,
|
|
159
187
|
})
|
|
160
|
-
: '-')), showDutyTaxesInfo && (h("tr", { class: "zonos--row zonos--cart-duties" }, h("td", { class: "zonos--column" }), h("td", { class: "zonos--column zonos--cart-subtotal-title" }, h("div", { class: "zonos--title-with-icon" }, h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, translate('Duties, taxes, and fees')), h("zonos-tooltip", { label: translate('Nothing due at the door') }, h("zonos-icon", { "aria-label": "Learn more about duties, taxes, and fees", content: InfoIcon, size: 16 })))
|
|
188
|
+
: '-')), showDutyTaxesInfo && (h("tr", { class: "zonos--row zonos--cart-duties" }, h("td", { class: "zonos--column" }), h("td", { class: "zonos--column zonos--cart-subtotal-title" }, h("div", { class: "zonos--title-with-icon" }, h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, translate('Duties, taxes, and fees')), h("zonos-tooltip", { label: translate('Nothing due at the door') }, h("zonos-icon", { "aria-label": "Learn more about duties, taxes, and fees", content: InfoIcon, size: 16 })))), h("td", { class: "zonos--column zonos--cart-subtotal-price" }, h("div", { class: "zonos--cart-duty-tax-price" }, cartStore.dutiesTaxFees
|
|
161
189
|
? currencyFormat({
|
|
162
190
|
amount: cartStore.dutiesTaxFees,
|
|
163
191
|
currency: cartStore.currency,
|
|
164
192
|
})
|
|
165
|
-
: '-', cartStore.
|
|
193
|
+
: '-')))), !!cartStore.adjustmentTotal && (h("tr", { class: "zonos--row zonos--cart-duties" }, h("td", { class: "zonos--column" }), h("td", { class: "zonos--column zonos--cart-subtotal-title" }, h("div", { class: "zonos--title-with-icon" }, h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, translate('Discounts')))), h("td", { class: "zonos--column zonos--cart-subtotal-price" }, h("zonos-text", { type: "semiBoldLabel" }, currencyFormat({
|
|
194
|
+
amount: cartStore.adjustmentTotal,
|
|
195
|
+
currency: cartStore.currency,
|
|
196
|
+
}))))), h("tr", { class: "zonos--row zonos--cart-pay-total" }, h("td", { class: "zonos--column" }), h("td", { class: "zonos--column" }, h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, translate('Order total'))), h("td", { class: "zonos--column" }, h("zonos-text", { type: "semiBoldLabel" }, currencyFormat({
|
|
166
197
|
amount: total,
|
|
167
198
|
currency: cartStore.currency,
|
|
168
199
|
})))))));
|
|
@@ -1111,4 +1142,4 @@ const ZonosShipping = class {
|
|
|
1111
1142
|
};
|
|
1112
1143
|
ZonosShipping.style = ZonosShippingStyle0;
|
|
1113
1144
|
|
|
1114
|
-
export { ZonosCartItems as zonos_cart_items, ZonosCartRestrictedItems as zonos_cart_restricted_items, ZonosCartSubtotal as zonos_cart_subtotal, ZonosCheckoutFinish as zonos_checkout_finish, ZonosCheckoutFooter as zonos_checkout_footer, ZonosCheckoutPayment as zonos_checkout_payment, ZonosCheckoutProgressTabs as zonos_checkout_progress_tabs, ZonosConfirmDialog as zonos_confirm_dialog, ZonosCustomerInfo as zonos_customer_info, ZonosRestState as zonos_rest_state, ZonosReview as zonos_review, ZonosShipping as zonos_shipping };
|
|
1145
|
+
export { ZonosBadge as zonos_badge, ZonosCartItems as zonos_cart_items, ZonosCartRestrictedItems as zonos_cart_restricted_items, ZonosCartSubtotal as zonos_cart_subtotal, ZonosCheckoutFinish as zonos_checkout_finish, ZonosCheckoutFooter as zonos_checkout_footer, ZonosCheckoutPayment as zonos_checkout_payment, ZonosCheckoutProgressTabs as zonos_checkout_progress_tabs, ZonosConfirmDialog as zonos_confirm_dialog, ZonosCustomerInfo as zonos_customer_info, ZonosRestState as zonos_rest_state, ZonosReview as zonos_review, ZonosShipping as zonos_shipping };
|
|
@@ -1,162 +1,39 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, F as Fragment } from './index-86b8247e.js';
|
|
2
|
-
import { l as localizationStore, s as stripeStoreGetDomesticShippingSession, a as localizationStoreUpdateSelectedCountryCode, b as stripeStoreCleanupDomesticShippingSession, c as
|
|
3
|
-
import { s as submitGtag, p as paypalInitScript } from './paypal-
|
|
2
|
+
import { l as localizationStore, s as stripeStoreGetDomesticShippingSession, a as localizationStoreUpdateSelectedCountryCode, b as stripeStoreCleanupDomesticShippingSession, c as stripeStoreSaveDomesticShippingSession, i as initStripeElements, d as cartStore, e as cartStoreUpdateItems, f as cartStoreReset, g as cartStoreResetTabItems, h as cartStoreClearCheckoutInterval, j as stripeStore, k as stripeStoreInitCheckoutSession, m as cartStoreStartCheckoutInterval, n as cartStoreUpdateToErrorState, t as translate, o as stripeStorePrefetchLandedCost, p as cartStoreNextStep, q as stripeStoreHandleInventoryCheck, r as stripeStoreConfirmPayment, u as stripeStoreReset, v as localizationStoreOnUpdate } from './cart-45d2861f.js';
|
|
3
|
+
import { s as submitGtag, p as paypalInitScript } from './paypal-ee310945.js';
|
|
4
4
|
import { z as zonosStore, g as getZonosStoreTheme, m as mergeConfig } from './zonosStore-473f4654.js';
|
|
5
|
-
import { c as createCustomEvent, t as trackConversionEvent, g as getIsTestMode } from './createCustomEvent-
|
|
5
|
+
import { c as createCustomEvent, t as trackConversionEvent, g as getIsTestMode } from './createCustomEvent-3fcc948a.js';
|
|
6
6
|
import { i as isCheckoutMobile } from './isCheckoutMobile-8846dccb.js';
|
|
7
|
-
import { l as log, a as logError } from './
|
|
7
|
+
import { l as log, a as logError, s as sendErrorLog } from './handleFetch-37cea185.js';
|
|
8
8
|
import { c as classes } from './classes-0d95c529.js';
|
|
9
9
|
import { g as getBorderRadius } from './getBorderRadius-23398fc6.js';
|
|
10
10
|
import { i as isDarkColor } from './isDarkColor-c927f77d.js';
|
|
11
|
+
import { s as setupCartData, d as domesticRedirectedBtnSelector, c as checkoutHiddenBtnSelector } from './CheckoutConfig-57350b28.js';
|
|
11
12
|
import { R as RemoveIcon } from './RemoveIcon-9dc5dd1a.js';
|
|
12
13
|
|
|
13
|
-
/**
|
|
14
|
-
* This is just function to make the key typesafe to enter
|
|
15
|
-
* @returns
|
|
16
|
-
*/
|
|
17
|
-
const objAttribute = ({ key, value, }) => value
|
|
18
|
-
? {
|
|
19
|
-
key,
|
|
20
|
-
value,
|
|
21
|
-
}
|
|
22
|
-
: null;
|
|
23
|
-
/**
|
|
24
|
-
* Map legacy item attribute to dgs item attributes
|
|
25
|
-
* @ref https://github.com/Zonos/ShippingQuoteService/blob/f8bd4f1ff41cb34b49b9f3f435576ec28dedf906/src/main/java/com/iglobal/services/shippingquote/dto/ShippingQuoteRequestDto.java#L412
|
|
26
|
-
*/
|
|
27
|
-
const getAttributes = (item) => {
|
|
28
|
-
return [
|
|
29
|
-
objAttribute({
|
|
30
|
-
key: 'brand',
|
|
31
|
-
value: item.itemBrand,
|
|
32
|
-
}),
|
|
33
|
-
objAttribute({
|
|
34
|
-
key: 'material',
|
|
35
|
-
value: item.itemMaterial,
|
|
36
|
-
}),
|
|
37
|
-
objAttribute({
|
|
38
|
-
key: 'category',
|
|
39
|
-
value: item.itemCategory,
|
|
40
|
-
}),
|
|
41
|
-
objAttribute({
|
|
42
|
-
key: 'color',
|
|
43
|
-
value: item.itemColor,
|
|
44
|
-
}),
|
|
45
|
-
objAttribute({
|
|
46
|
-
key: 'customization',
|
|
47
|
-
value: item.itemCustomization,
|
|
48
|
-
}),
|
|
49
|
-
objAttribute({
|
|
50
|
-
key: 'descriptionDetailed',
|
|
51
|
-
value: item.itemDescriptionDetailed,
|
|
52
|
-
}),
|
|
53
|
-
objAttribute({
|
|
54
|
-
key: 'fabricContent',
|
|
55
|
-
value: item.itemFabricContent,
|
|
56
|
-
}),
|
|
57
|
-
objAttribute({
|
|
58
|
-
key: 'ltlClass',
|
|
59
|
-
value: item.itemLtlClass,
|
|
60
|
-
}),
|
|
61
|
-
objAttribute({
|
|
62
|
-
key: 'pickingLocation',
|
|
63
|
-
value: item.itemPickingLocation,
|
|
64
|
-
}),
|
|
65
|
-
objAttribute({
|
|
66
|
-
key: 'shipFromLocation',
|
|
67
|
-
value: item.itemShipFromLocation,
|
|
68
|
-
}),
|
|
69
|
-
objAttribute({
|
|
70
|
-
key: 'size',
|
|
71
|
-
value: item.itemSize,
|
|
72
|
-
}),
|
|
73
|
-
objAttribute({
|
|
74
|
-
key: 'status',
|
|
75
|
-
value: item.status,
|
|
76
|
-
}),
|
|
77
|
-
].filter(Boolean);
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Map legacy weight units with dgs
|
|
82
|
-
* @ref https://github.com/Zonos/ShippingQuoteService/blob/f8bd4f1ff41cb34b49b9f3f435576ec28dedf906/src/main/java/com/iglobal/services/shippingquote/dto/ShippingQuoteRequestDto.java#L483
|
|
83
|
-
*/
|
|
84
|
-
const getItemWeightUnit = (weightUnit) => {
|
|
85
|
-
if (!weightUnit) {
|
|
86
|
-
return 'POUND';
|
|
87
|
-
}
|
|
88
|
-
switch (weightUnit.toUpperCase()) {
|
|
89
|
-
case 'KG':
|
|
90
|
-
return 'KILOGRAM';
|
|
91
|
-
case 'OZ':
|
|
92
|
-
return 'OUNCE';
|
|
93
|
-
case 'G':
|
|
94
|
-
return 'GRAM';
|
|
95
|
-
default:
|
|
96
|
-
return 'POUND';
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
/**
|
|
100
|
-
* Mapping legacy measurement with dgs
|
|
101
|
-
* @ref https://github.com/Zonos/ShippingQuoteService/blob/f8bd4f1ff41cb34b49b9f3f435576ec28dedf906/src/main/java/com/iglobal/services/shippingquote/dto/ShippingQuoteRequestDto.java#L441
|
|
102
|
-
*/
|
|
103
|
-
const getMeasurements = (item) => {
|
|
104
|
-
if (!item) {
|
|
105
|
-
return [];
|
|
106
|
-
}
|
|
107
|
-
const measurements = [];
|
|
108
|
-
if (item.length) {
|
|
109
|
-
measurements.push({
|
|
110
|
-
type: 'LENGTH',
|
|
111
|
-
unitOfMeasure: 'INCH',
|
|
112
|
-
value: item.length,
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
if (item.width) {
|
|
116
|
-
measurements.push({
|
|
117
|
-
type: 'WIDTH',
|
|
118
|
-
unitOfMeasure: 'INCH',
|
|
119
|
-
value: item.width,
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
if (item.weight) {
|
|
123
|
-
measurements.push({
|
|
124
|
-
type: 'WEIGHT',
|
|
125
|
-
unitOfMeasure: getItemWeightUnit(item.weightUnits),
|
|
126
|
-
value: item.weight,
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
if (item.height) {
|
|
130
|
-
measurements.push({
|
|
131
|
-
type: 'HEIGHT',
|
|
132
|
-
unitOfMeasure: 'INCH',
|
|
133
|
-
value: item.height,
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
return measurements;
|
|
137
|
-
};
|
|
138
|
-
|
|
139
14
|
/**
|
|
140
15
|
* Map the items from tempCart like how we do it in dgs
|
|
141
16
|
* @ref https://github.com/Zonos/ShippingQuoteService/blob/f8bd4f1ff41cb34b49b9f3f435576ec28dedf906/src/main/java/com/iglobal/services/shippingquote/dto/ShippingQuoteRequestDto.java#L393
|
|
142
17
|
*/
|
|
143
18
|
const buildCartItemsByTempCart = (tempCartData) => {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
attributes: getAttributes(item),
|
|
19
|
+
const tempCartItems = tempCartData.items.map(item => ({
|
|
20
|
+
amount: item.amount,
|
|
21
|
+
attributes: item.attributes || [],
|
|
148
22
|
countryOfOrigin: item.countryOfOrigin || undefined,
|
|
149
|
-
currencyCode:
|
|
150
|
-
description: item.
|
|
151
|
-
imageUrl: item.
|
|
152
|
-
itemType: 'PHYSICAL_GOOD',
|
|
153
|
-
measurements:
|
|
154
|
-
name: item.description || '',
|
|
23
|
+
currencyCode: item.currencyCode,
|
|
24
|
+
description: item.description || '',
|
|
25
|
+
imageUrl: item.imageUrl || '',
|
|
26
|
+
itemType: item.itemType || 'PHYSICAL_GOOD',
|
|
27
|
+
measurements: item.measurements || [],
|
|
28
|
+
name: item.name || item.description || '',
|
|
155
29
|
productId: item.productId || '',
|
|
156
30
|
quantity: item.quantity || 0,
|
|
157
31
|
sku: item.sku || '',
|
|
158
|
-
}))
|
|
159
|
-
return
|
|
32
|
+
})) || [];
|
|
33
|
+
return {
|
|
34
|
+
adjustments: tempCartData.adjustments,
|
|
35
|
+
cartItems: tempCartItems,
|
|
36
|
+
};
|
|
160
37
|
};
|
|
161
38
|
|
|
162
39
|
const isShippableCountry = (showLog = true) => {
|
|
@@ -333,9 +210,7 @@ const ZonosCheckout = class {
|
|
|
333
210
|
this.isMobile = false;
|
|
334
211
|
this.zonosReviewRef = undefined;
|
|
335
212
|
this.storybookPaymentStatusOverride = undefined;
|
|
336
|
-
this.
|
|
337
|
-
this.legacyCheckoutHiddenBtnSelector = '#legacy-checkout-hidden-button';
|
|
338
|
-
this.isLegacyCheckout = false;
|
|
213
|
+
this.isLegacyCheckout = window.Zonos.isLegacyCheckout;
|
|
339
214
|
this.confirmDialogOpen = false;
|
|
340
215
|
this.inventoryCheckErrorMessage = null;
|
|
341
216
|
}
|
|
@@ -344,7 +219,10 @@ const ZonosCheckout = class {
|
|
|
344
219
|
*/
|
|
345
220
|
async initCartInfoHandler(e) {
|
|
346
221
|
const cartItems = e.detail;
|
|
347
|
-
void cartStoreUpdateItems(
|
|
222
|
+
void cartStoreUpdateItems({
|
|
223
|
+
adjustments: cartStore.adjustments,
|
|
224
|
+
cartItems,
|
|
225
|
+
});
|
|
348
226
|
}
|
|
349
227
|
async handleKeyPress(e) {
|
|
350
228
|
if (e.key === 'Escape') {
|
|
@@ -386,9 +264,24 @@ const ZonosCheckout = class {
|
|
|
386
264
|
}
|
|
387
265
|
async buildCartAndInit() {
|
|
388
266
|
// if tempCartUUID is provided, use it instead of buildCartDetail
|
|
389
|
-
if (window.Zonos.
|
|
390
|
-
|
|
391
|
-
|
|
267
|
+
if (window.Zonos.cartData) {
|
|
268
|
+
log('tempCartUUID is provided, start building cart');
|
|
269
|
+
const { adjustments, cartItems } = buildCartItemsByTempCart(window.Zonos.cartData);
|
|
270
|
+
await cartStoreUpdateItems({ adjustments, cartItems });
|
|
271
|
+
}
|
|
272
|
+
// if createCartId is provided, use it to build cart. Merchant will provide create a cart from their server side and give the cart id to us.
|
|
273
|
+
else if (typeof zonosStore.checkoutSettings.createCartId === 'function') {
|
|
274
|
+
log('"createCartId" is provided, start building cart');
|
|
275
|
+
const cartId = await zonosStore.checkoutSettings.createCartId();
|
|
276
|
+
window.Zonos.cartId = cartId;
|
|
277
|
+
const cartResult = await setupCartData(cartId);
|
|
278
|
+
const cartData = cartResult === null || cartResult === void 0 ? void 0 : cartResult.cartData;
|
|
279
|
+
if (!cartData) {
|
|
280
|
+
logError('Fail to build cart, please try again.');
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
283
|
+
const { adjustments, cartItems } = buildCartItemsByTempCart(cartData);
|
|
284
|
+
await cartStoreUpdateItems({ adjustments, cartItems });
|
|
392
285
|
}
|
|
393
286
|
else if (zonosStore.checkoutSettings.buildCartDetail &&
|
|
394
287
|
localizationStore.selectedCountryCode) {
|
|
@@ -397,7 +290,7 @@ const ZonosCheckout = class {
|
|
|
397
290
|
countryCode: localizationStore.selectedCountryCode,
|
|
398
291
|
currencyCode: localizationStore.targetCurrency,
|
|
399
292
|
});
|
|
400
|
-
await cartStoreUpdateItems(cartItems);
|
|
293
|
+
await cartStoreUpdateItems({ adjustments: [], cartItems });
|
|
401
294
|
}
|
|
402
295
|
// if client secret doesn't exist, request a new one.
|
|
403
296
|
if (!stripeStore.clientSecret) {
|
|
@@ -417,12 +310,20 @@ const ZonosCheckout = class {
|
|
|
417
310
|
attachCheckout() {
|
|
418
311
|
const buttonAnchorSelector = zonosStore.checkoutSettings.placeOrderButtonSelector;
|
|
419
312
|
log(`attach checkout ${buttonAnchorSelector}`);
|
|
420
|
-
if (
|
|
313
|
+
// allow to load checkout if cartData is ready (Checkout can be loaded right awaiy if tempCartUUID is in the URL)
|
|
314
|
+
if (!buttonAnchorSelector && !window.Zonos.cartData) {
|
|
421
315
|
// do nothing if button element is not found
|
|
422
316
|
return;
|
|
423
317
|
}
|
|
318
|
+
const selectors = [
|
|
319
|
+
buttonAnchorSelector,
|
|
320
|
+
// hidden button for domestic redirected
|
|
321
|
+
`#${domesticRedirectedBtnSelector}`,
|
|
322
|
+
// hidden button for legacy checkout facade
|
|
323
|
+
`#${checkoutHiddenBtnSelector}`,
|
|
324
|
+
].filter(Boolean);
|
|
424
325
|
// also attach event to hidden button if user was redirected with shipping address session
|
|
425
|
-
const buttonAnchorElements = document.querySelectorAll(
|
|
326
|
+
const buttonAnchorElements = document.querySelectorAll(selectors.join(','));
|
|
426
327
|
// only attach event once, and looping through all of the button elements
|
|
427
328
|
buttonAnchorElements.forEach(button => {
|
|
428
329
|
const isEventAttached = button.getAttribute('data-zonos-checkout-attached');
|
|
@@ -478,15 +379,15 @@ const ZonosCheckout = class {
|
|
|
478
379
|
}
|
|
479
380
|
button.setAttribute('data-zonos-checkout-attached', 'true');
|
|
480
381
|
// if this button is the hidden button, trigger the click event
|
|
481
|
-
if (button.matches(
|
|
382
|
+
if (button.matches(domesticRedirectedBtnSelector)) {
|
|
482
383
|
button.dispatchEvent(createCustomEvent('click'));
|
|
483
384
|
// cleanup shipping session after button is clicked
|
|
484
385
|
stripeStoreCleanupDomesticShippingSession();
|
|
485
386
|
// remove the button after it's clicked
|
|
486
387
|
button.remove();
|
|
487
388
|
}
|
|
488
|
-
|
|
489
|
-
|
|
389
|
+
// For legacy checkout facade and in case the cart is provided in the query param, open Checkout right away
|
|
390
|
+
if (button.matches(`#${checkoutHiddenBtnSelector}`)) {
|
|
490
391
|
// trigger the click event on the button
|
|
491
392
|
button.dispatchEvent(createCustomEvent('click'));
|
|
492
393
|
button.remove();
|
|
@@ -548,7 +449,7 @@ const ZonosCheckout = class {
|
|
|
548
449
|
this.stripe = window.Zonos.stripe;
|
|
549
450
|
// check if bigcommerce, if user enters the shipping address that's in the shipping zone at bigcommerce checkout
|
|
550
451
|
watchBigcommerceDomesticCheckout({
|
|
551
|
-
domesticRedirectedBtnSelector:
|
|
452
|
+
domesticRedirectedBtnSelector: domesticRedirectedBtnSelector,
|
|
552
453
|
onShippingAddressSessionFound: shippingAddressSession => {
|
|
553
454
|
// prefilled the default address if shipping address session is found for checkout on open
|
|
554
455
|
this.defaultAddress = {
|
|
@@ -569,7 +470,7 @@ const ZonosCheckout = class {
|
|
|
569
470
|
/**
|
|
570
471
|
* When temp cart data is available, set default address if exist
|
|
571
472
|
*/
|
|
572
|
-
if (window.Zonos
|
|
473
|
+
if (window.Zonos) {
|
|
573
474
|
this.useLegacyQueryParam();
|
|
574
475
|
}
|
|
575
476
|
// only init checkout if visitor's country is in the shipping zones.
|
|
@@ -695,9 +596,9 @@ const ZonosCheckout = class {
|
|
|
695
596
|
// reset cart store
|
|
696
597
|
cartStoreReset();
|
|
697
598
|
// redirect to vendor store url if this is legacy checkout.
|
|
698
|
-
if (
|
|
699
|
-
const
|
|
700
|
-
window.location.href =
|
|
599
|
+
if (window.Zonos.isLegacyCheckout && window.Zonos.cartData) {
|
|
600
|
+
const storeBaseUrl = window.Zonos.cartData.storeBaseUrl;
|
|
601
|
+
window.location.href = storeBaseUrl;
|
|
701
602
|
return;
|
|
702
603
|
}
|
|
703
604
|
// reset url
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-86b8247e.js';
|
|
2
|
-
import {
|
|
2
|
+
import { w as isValidSelector, j as stripeStore, x as initLocalizationStore, d as cartStore, a as localizationStoreUpdateSelectedCountryCode } from './cart-45d2861f.js';
|
|
3
3
|
import { z as zonosStore, b as zonosStoreInitSetting, d as zonosStoreFontFamily } from './zonosStore-473f4654.js';
|
|
4
|
-
import { a as logError, l as log } from './
|
|
4
|
+
import { h as handleFetch, a as logError, l as log } from './handleFetch-37cea185.js';
|
|
5
5
|
import './isDarkColor-c927f77d.js';
|
|
6
6
|
import './getBorderRadius-23398fc6.js';
|
|
7
7
|
|
|
@@ -23,12 +23,14 @@ const injectCheckoutElement = () => {
|
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
25
|
const initCheckout = (config) => {
|
|
26
|
-
if (
|
|
26
|
+
// allow to load checkout if cartData is ready (Checkout can be loaded right awaiy if tempCartUUID is in the URL)
|
|
27
|
+
if (!config.placeOrderButtonSelector && !window.Zonos.cartData) {
|
|
27
28
|
// do nothing if checkout button anchor is not set
|
|
28
29
|
return;
|
|
29
30
|
}
|
|
30
31
|
// check if checkout button anchor selector user pass in is valid
|
|
31
|
-
if (
|
|
32
|
+
if (config.placeOrderButtonSelector &&
|
|
33
|
+
!isValidSelector(config.placeOrderButtonSelector)) {
|
|
32
34
|
logError(`Selector checkoutButtonAnchor "${config.placeOrderButtonSelector}" is not a valid selector`);
|
|
33
35
|
return;
|
|
34
36
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, d as getElement } from './index-86b8247e.js';
|
|
2
|
-
import { l as localizationStore } from './cart-
|
|
2
|
+
import { l as localizationStore } from './cart-45d2861f.js';
|
|
3
3
|
import { d as zonosStoreFontFamily } from './zonosStore-473f4654.js';
|
|
4
4
|
import { c as classes } from './classes-0d95c529.js';
|
|
5
|
-
import './
|
|
5
|
+
import './handleFetch-37cea185.js';
|
|
6
6
|
import './isDarkColor-c927f77d.js';
|
|
7
7
|
import './getBorderRadius-23398fc6.js';
|
|
8
8
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, d as getElement } from './index-86b8247e.js';
|
|
2
|
-
import { a as localizationStoreUpdateSelectedCountryCode, t as translate, l as localizationStore } from './cart-
|
|
2
|
+
import { a as localizationStoreUpdateSelectedCountryCode, t as translate, l as localizationStore } from './cart-45d2861f.js';
|
|
3
3
|
import { d as zonosStoreFontFamily } from './zonosStore-473f4654.js';
|
|
4
4
|
import { f as formatStringWithLinks } from './formatStringWithLinks-9e819405.js';
|
|
5
5
|
import { i as isDarkColor } from './isDarkColor-c927f77d.js';
|
|
6
6
|
import { l as languages } from './ILanguage-cd6acb72.js';
|
|
7
|
-
import './
|
|
7
|
+
import './handleFetch-37cea185.js';
|
|
8
8
|
import './getBorderRadius-23398fc6.js';
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -16,5 +16,5 @@ var patchBrowser = () => {
|
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(async (options) => {
|
|
18
18
|
await globalScripts();
|
|
19
|
-
return bootstrapLazy([["zonos-checkout",[[2,"zonos-checkout",{"appearanceSettingsOverride":[16],"preview":[4],"mobile":[4],"defaultAddress":[16],"forceDialogOpen":[4,"force-dialog-open"],"open":[32],"stripe":[32],"submitLoading":[32],"collapseReviewMobile":[32],"isAttachError":[32],"isMobile":[32],"zonosReviewRef":[32],"storybookPaymentStatusOverride":[32],"
|
|
19
|
+
return bootstrapLazy([["zonos-checkout",[[2,"zonos-checkout",{"appearanceSettingsOverride":[16],"preview":[4],"mobile":[4],"defaultAddress":[16],"forceDialogOpen":[4,"force-dialog-open"],"open":[32],"stripe":[32],"submitLoading":[32],"collapseReviewMobile":[32],"isAttachError":[32],"isMobile":[32],"zonosReviewRef":[32],"storybookPaymentStatusOverride":[32],"isLegacyCheckout":[32],"confirmDialogOpen":[32],"inventoryCheckErrorMessage":[32],"closeDialogHandler":[64],"init":[64],"setToFinishStep":[64]},[[16,"zonos--init-cart-info","initCartInfoHandler"],[4,"keydown","handleKeyPress"],[9,"resize","handleWindowResize"]],{"appearanceSettingsOverride":["appearanceSettingsOverrideChanged","handleAppearanceSettingsOverrideChange"],"mobile":["handleMobileChange"],"defaultAddress":["handleAddressChange"]}]]],["zonos-hello",[[1,"zonos-hello",{"mobileLocationOverride":[1,"mobile-location-override"],"animateFromLeftOverride":[4,"animate-from-left-override"],"appearanceSettingsOverride":[16],"showPeekMessage":[32],"zonosStoreHelloSettings":[32],"showDialog":[32],"peekMessage":[32],"initialUrl":[32],"allRestrictedItems":[32],"allFoundProducts":[32],"productsOnPage":[32],"isHelloWidgetRendered":[32],"isMobile":[32],"getCountryList":[64],"displayCurrency":[64],"convertAndFormat":[64],"convert":[64],"format":[64],"openHelloDialog":[64]},[[9,"resize","handleResize"]],{"appearanceSettingsOverride":["handleAppearanceSettingsOverrideChange"]}]]],["zonos-controller",[[1,"zonos-controller",{"config":[16],"zonosApiKey":[1,"zonos-api-key"],"initCheckoutElement":[64],"setupGoogleFont":[64],"showNotification":[64],"reset":[64],"overrideConfig":[64],"overrideCountry":[64],"getAppearanceSetting":[64],"updateOrganizationName":[64]},[[8,"locationchange","handleLocationChange"]]]]],["zonos-component",[[1,"zonos-component",{"first":[1],"middle":[1],"last":[1]}]]],["zonos-link",[[1,"zonos-link",{"href":[1],"rel":[1],"target":[1],"linkTitle":[1,"link-title"]}]]],["zonos-logo",[[1,"zonos-logo",{"theme":[1],"width":[1]}]]],["zonos-text",[[1,"zonos-text",{"textColor":[1,"text-color"],"size":[1],"type":[1],"weight":[2],"ready":[32]}]]],["zonos-tooltip",[[1,"zonos-tooltip",{"label":[1],"subtitle":[1],"showTooltip":[32]}]]],["zonos-card",[[1,"zonos-card",{"actions":[16],"backgroundColor":[1,"background-color"],"borderRadius":[2,"border-radius"],"footerActions":[16],"footerContent":[16],"footerHeight":[2,"footer-height"],"label":[16],"spacing":[1]}]]],["zonos-banner",[[1,"zonos-banner",{"bannerTitle":[1,"banner-title"],"intent":[1],"hasContent":[32]}]]],["zonos-v-stack",[[1,"zonos-v-stack",{"spacing":[2]}]]],["zonos-language-select_2",[[1,"zonos-language-select",{"handleOnClose":[16]}],[1,"zonos-select-dialog-header",{"handleOnClose":[16],"label":[1]}]]],["zonos-country-select_4",[[1,"zonos-country-select",{"handleOnClose":[16],"inputValue":[32]}],[1,"zonos-hello-dialog-footer",{"appearanceSettings":[16],"setShowCountrySelect":[16],"setShowLanguageSelect":[16]}],[1,"zonos-custom-message",{"icon":[1],"message":[1]}],[2,"zonos-virtual-scroll",{"renderItem":[16],"itemWidth":[2,"item-width"],"fallbackItemHeight":[2,"fallback-item-height"],"itemHeights":[16],"container":[32],"scrollTop":[32],"totalHeight":[32]},null,{"itemHeights":["updateTotalHeight"],"fallbackItemHeight":["updateTotalHeight"]}]]],["zonos-hello-dialog",[[1,"zonos-hello-dialog",{"isOpen":[4,"is-open"],"setIsOpen":[16],"mobileLocationOverride":[1,"mobile-location-override"],"animateFromLeftOverride":[4,"animate-from-left-override"],"appearanceSettings":[16],"restrictedItems":[16],"welcomeMessage":[32],"showCountrySelect":[32],"showLanguageSelect":[32]},[[4,"click","globalClickHandler"]],{"isOpen":["isOpenHandler"]}]]],["zonos-shipping-rich-radio",[[1,"zonos-shipping-rich-radio",{"items":[16],"borderColor":[1,"border-color"],"borderStyle":[1,"border-style"],"theme":[1],"initialSelectedValue":[8,"initial-selected-value"],"selectedItem":[32]}]]],["zonos-input",[[1,"zonos-input",{"inputValue":[1,"input-value"],"inputLabel":[1,"input-label"],"inputSize":[1,"input-size"],"isDisabled":[4,"is-disabled"],"isError":[4,"is-error"],"inputPlaceholder":[1,"input-placeholder"],"value":[32]},null,{"inputValue":["onInputValueChange"]}]]],["zonos-notification_3",[[2,"zonos-payment",{"titleText":[1,"title-text"],"stripe":[32],"stripeElements":[32]},null,{"stripeElements":["watchInitStripe"],"stripe":["watchInitStripe"]}],[2,"zonos-paypal-payment"],[1,"zonos-notification",{"notificationArray":[32],"showNotification":[64]}]]],["zonos-country-flag",[[1,"zonos-country-flag",{"countryCode":[1,"country-code"],"size":[2]}]]],["zonos-button_3",[[17,"zonos-button",{"buttonColor":[1,"button-color"],"backgroundColor":[1,"background-color"],"borderStyle":[1,"border-style"],"isDisabled":[4,"is-disabled"],"icon":[16],"iconRight":[4,"icon-right"],"size":[1],"variant":[1],"noBackground":[4,"no-background"],"withBoxShadow":[4,"with-box-shadow"],"noPaddingLeft":[4,"no-padding-left"],"noPaddingRight":[4,"no-padding-right"],"loading":[4],"justifyContent":[1,"justify-content"],"theme":[1],"hasIcon":[32],"hasContent":[32]},[[2,"click","clickHandler"]],{"icon":["iconChangeHandler"]}],[1,"zonos-spinner",{"size":[2],"spinnerColor":[1,"spinner-color"]}],[1,"zonos-icon",{"autoHeight":[4,"auto-height"],"iconColor":[1,"icon-color"],"content":[1],"size":[2]}]]],["zonos-address_8",[[1,"zonos-address-update-dialog",{"continueLoading":[4,"continue-loading"],"dialogLoading":[4,"dialog-loading"],"dialogOpen":[4,"dialog-open"],"submitBtnType":[1,"submit-btn-type"],"submitBtnColor":[1,"submit-btn-color"],"isMobile":[4,"is-mobile"],"shippingAddress":[16],"billingAddress":[16],"translatedShippingAddress":[16],"translatedBillingAddress":[16],"showErrorBanner":[32],"translatedShippingAddressState":[32],"translatedBillingAddressState":[32]},null,{"translatedShippingAddress":["watchTranslatedShippingAddress"],"translatedBillingAddress":["watchTranslatedBillingAddress"]}],[2,"zonos-address",{"type":[1],"titleText":[1,"title-text"],"defaultAddress":[16],"stripe":[32],"isDirtyAddress":[32]},null,{"stripe":["watchInitStripe"]}],[1,"zonos-checkbox",{"backgroundColor":[1,"background-color"],"label":[1],"isChecked":[4,"is-checked"],"isDisabled":[4,"is-disabled"],"size":[2],"fontSize":[1,"font-size"],"borderStyle":[1,"border-style"]},[[1,"click","onClick"]]],[2,"zonos-link-authentication",{"titleText":[1,"title-text"],"defaultEmail":[1,"default-email"],"stripe":[32]},null,{"stripe":["watchInitStripe"]}],[1,"zonos-dialog",{"open":[4],"headerText":[1,"header-text"],"width":[1],"height":[1],"minHeight":[1,"min-height"],"noHeader":[4,"no-header"],"noBodyPadding":[4,"no-body-padding"],"noBorder":[4,"no-border"],"borderStyle":[1,"border-style"],"noCloseButton":[4,"no-close-button"],"noClickOutside":[4,"no-click-outside"],"mobile":[4],"isLoading":[4,"is-loading"],"isMobile":[32]},[[9,"resize","handleWindowResize"],[4,"keydown","handleKeyDown"]]],[1,"zonos-address-display",{"currentAddress":[16],"addressType":[1,"address-type"]}],[1,"zonos-address-form",{"currentAddress":[16],"translatedAddress":[16],"addressType":[1,"address-type"],"localAddress":[32]},null,{"translatedAddress":["watchCurrentAddress"]}],[1,"zonos-collapse",{"collapsed":[4],"collapseSize":[2,"collapse-size"],"height":[32],"iframe":[32]}]]],["zonos-badge_13",[[2,"zonos-customer-info",{"continueLoading":[4,"continue-loading"],"submitBtnType":[1,"submit-btn-type"],"submitBtnColor":[1,"submit-btn-color"],"isMobile":[4,"is-mobile"],"defaultAddress":[16],"showErrorBanner":[32],"shippingCountry":[32],"isCheckingForRestrictedItems":[32],"isValidatingAddress":[32],"invalidShippingCharacterList":[32],"invalidBillingCharacterList":[32],"openAddressValidationDialog":[32]}],[2,"zonos-checkout-payment",{"submitBtnType":[1,"submit-btn-type"],"continueLoading":[4,"continue-loading"],"submitBtnColor":[1,"submit-btn-color"],"showErrorBanner":[32]}],[1,"zonos-checkout-footer",{"mobile":[4],"dataTheme":[1,"data-theme"],"showLanguageDialog":[32],"isMobile":[32]},[[4,"click","handleGlobalClick"]],{"mobile":["handleMobileChange"]}],[2,"zonos-shipping",{"continueLoading":[4,"continue-loading"],"submitBtnColor":[1,"submit-btn-color"],"submitBtnType":[1,"submit-btn-type"],"selectedShippingMethod":[32],"isSelecting":[32],"showErrorBanner":[32],"serviceLevels":[32]}],[1,"zonos-cart-restricted-items",{"hide":[4],"errorImages":[32],"internalCollapsed":[32],"firstRender":[32]}],[1,"zonos-checkout-finish",{"borderRadius":[1,"border-radius"],"storybookForceStatus":[1,"storybook-force-status"],"overrideNotification":[16],"isLoading":[32],"notificationType":[32],"notificationTitle":[32],"notificationMessages":[32],"notificationActionText":[32],"order":[32]}],[1,"zonos-confirm-dialog",{"dialogTitle":[1,"dialog-title"],"dialogIntent":[1,"dialog-intent"],"dialogSubtitle":[1,"dialog-subtitle"],"submitBtnColor":[1,"submit-btn-color"],"dialogConfirmBtnText":[1,"dialog-confirm-btn-text"],"dialogCancelBtnText":[1,"dialog-cancel-btn-text"],"dialogType":[1,"dialog-type"],"isMobile":[4,"is-mobile"],"dialogOpen":[4,"dialog-open"],"noClickOutside":[4,"no-click-outside"]},[[4,"keydown","handleKeyDown"]]],[1,"zonos-cart-subtotal"],[1,"zonos-checkout-progress-tabs",{"tabColor":[1,"tab-color"],"backgroundColor":[1,"background-color"],"setTabItems":[64],"setTabSelected":[64]}],[1,"zonos-review",{"mobile":[4],"collapsed":[4],"isMobile":[32]},[[9,"resize","handleWindowResize"]]],[1,"zonos-badge",{"bold":[4],"badgeColor":[1,"badge-color"],"icon":[16],"iconRight":[4,"icon-right"],"size":[1],"rounded":[4]}],[1,"zonos-cart-items",{"errorImages":[32]}],[1,"zonos-rest-state",{"restStateSubtitle":[1,"rest-state-subtitle"],"restStateTitle":[1,"rest-state-title"],"restStateType":[1,"rest-state-type"],"isErrorImageLoad":[32]}]]]], options);
|
|
20
20
|
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, F as Fragment, H as Host } from './index-86b8247e.js';
|
|
2
|
-
import { t as translate, l as localizationStore,
|
|
2
|
+
import { t as translate, l as localizationStore, D as currencyFormat } from './cart-45d2861f.js';
|
|
3
3
|
import { z as zonosStore } from './zonosStore-473f4654.js';
|
|
4
4
|
import { c as classes } from './classes-0d95c529.js';
|
|
5
5
|
import { f as formatStringWithLinks } from './formatStringWithLinks-9e819405.js';
|
|
6
6
|
import { g as getHasMoreSpaceOnRight } from './getHasMoreSpaceOnRight-70eb913a.js';
|
|
7
|
-
import './
|
|
7
|
+
import './handleFetch-37cea185.js';
|
|
8
8
|
import './isDarkColor-c927f77d.js';
|
|
9
9
|
import './getBorderRadius-23398fc6.js';
|
|
10
10
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host } from './index-86b8247e.js';
|
|
2
2
|
import { _ as _root, e as _baseGetTag, i as isObjectLike_1, f as isObject_1, z as zonosStore, g as getZonosStoreTheme, m as mergeConfig } from './zonosStore-473f4654.js';
|
|
3
|
-
import {
|
|
3
|
+
import { l as localizationStore, w as isValidSelector, t as translate, y as getZCountryUrlParam, z as setZCountryUrlParam, A as currencyDisplay, B as currencyConvertAndFormat, C as currencyConvert, D as currencyFormat } from './cart-45d2861f.js';
|
|
4
4
|
import { c as classes } from './classes-0d95c529.js';
|
|
5
|
-
import { a as logError, l as log } from './
|
|
5
|
+
import { h as handleFetch, a as logError, l as log } from './handleFetch-37cea185.js';
|
|
6
6
|
import { g as getHasMoreSpaceOnRight } from './getHasMoreSpaceOnRight-70eb913a.js';
|
|
7
7
|
import './isDarkColor-c927f77d.js';
|
|
8
8
|
import './getBorderRadius-23398fc6.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host } from './index-86b8247e.js';
|
|
2
|
-
import {
|
|
2
|
+
import { K as localizationStoreUpdateSelectedLocale, t as translate, l as localizationStore } from './cart-45d2861f.js';
|
|
3
3
|
import { d as zonosStoreFontFamily } from './zonosStore-473f4654.js';
|
|
4
4
|
import { l as languages } from './ILanguage-cd6acb72.js';
|
|
5
|
-
import './
|
|
5
|
+
import './handleFetch-37cea185.js';
|
|
6
6
|
import './isDarkColor-c927f77d.js';
|
|
7
7
|
import './getBorderRadius-23398fc6.js';
|
|
8
8
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, d as getElement, c as createEvent } from './index-86b8247e.js';
|
|
2
2
|
import { d as zonosStoreFontFamily } from './zonosStore-473f4654.js';
|
|
3
3
|
import { c as classes } from './classes-0d95c529.js';
|
|
4
|
-
import {
|
|
5
|
-
import { a as logError, l as log } from './
|
|
6
|
-
import { d as paypalStoreInitButtons } from './paypal-
|
|
4
|
+
import { j as stripeStore } from './cart-45d2861f.js';
|
|
5
|
+
import { a as logError, l as log } from './handleFetch-37cea185.js';
|
|
6
|
+
import { d as paypalStoreInitButtons } from './paypal-ee310945.js';
|
|
7
7
|
import './isDarkColor-c927f77d.js';
|
|
8
8
|
import './getBorderRadius-23398fc6.js';
|
|
9
9
|
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { r as registerInstance, h, H as Host } from './index-86b8247e.js';
|
|
2
|
+
import { c as classes } from './classes-0d95c529.js';
|
|
3
|
+
|
|
4
|
+
const zonosTooltipCss = ":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--tooltip{position:relative}:host .zonos--tooltip .zonos--tooltip-content{position:absolute;bottom:100%;left:0;width:-webkit-max-content;width:-moz-max-content;width:max-content;padding:12px;background-color:var(--zonos-elements-gray-1200);opacity:0;-webkit-transform:scale(0);transform:scale(0);-webkit-transition:all 0.2s ease-in-out;transition:all 0.2s ease-in-out;-webkit-transform-origin:bottom left;transform-origin:bottom left;border-radius:var(--zonos-elements-radius-4);z-index:100;-webkit-box-shadow:var(--zonos-elements-v3-shadow-large);box-shadow:var(--zonos-elements-v3-shadow-large)}:host .zonos--tooltip .zonos--tooltip-content.zonos--show-tooltip{opacity:1;-webkit-transform:scale(1);transform:scale(1)}";
|
|
5
|
+
const ZonosTooltipStyle0 = zonosTooltipCss;
|
|
6
|
+
|
|
7
|
+
const ZonosTooltip = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
registerInstance(this, hostRef);
|
|
10
|
+
this.label = '';
|
|
11
|
+
this.subtitle = '';
|
|
12
|
+
this.showTooltip = false;
|
|
13
|
+
}
|
|
14
|
+
render() {
|
|
15
|
+
return (h(Host, { key: '24f3b1f73cc320540ab3700213004c267ea04658', class: "zonos--elements" }, h("div", { key: '7f52acf90cb5b9f1fd5efdc4fedc4d61a893a646', class: "zonos--tooltip", onMouseEnter: () => (this.showTooltip = true), onMouseLeave: () => (this.showTooltip = false) }, h("slot", { key: '1871529e8b75c44a71bf1f5bc9e60b81bbc598d2' }), h("div", { key: 'c0b9c9c1b3fef5f766d2bad4c5bea48f3d6bbb6f', class: classes([
|
|
16
|
+
this.showTooltip && 'zonos--show-tooltip',
|
|
17
|
+
'zonos--tooltip-content',
|
|
18
|
+
]) }, h("zonos-text", { key: '3b106cb439877dffa101f15fb01aff980a64c7cb', size: "s", textColor: "gray-0", type: "boldLabel" }, this.label), h("zonos-text", { key: 'c0005051e6e1b614b7739718e1a262f6043d56f5', size: "xs", textColor: "gray-0" }, this.subtitle)))));
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
ZonosTooltip.style = ZonosTooltipStyle0;
|
|
22
|
+
|
|
23
|
+
export { ZonosTooltip as zonos_tooltip };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(t,e,r,n){function o(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,a){function i(t){try{u(n.next(t))}catch(t){a(t)}}function c(t){try{u(n["throw"](t))}catch(t){a(t)}}function u(t){t.done?r(t.value):o(t.value).then(i,c)}u((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,i;return i={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function c(t){return function(e){return u([t,e])}}function u(c){if(n)throw new TypeError("Generator is already executing.");while(i&&(i=0,c[0]&&(r=0)),r)try{if(n=1,o&&(a=c[0]&2?o["return"]:c[0]?o["throw"]||((a=o["return"])&&a.call(o),0):o.next)&&!(a=a.call(o,c[1])).done)return a;if(o=0,a)c=[c[0]&2,a.value];switch(c[0]){case 0:case 1:a=c;break;case 4:r.label++;return{value:c[1],done:false};case 5:r.label++;o=c[1];c=[0];continue;case 7:c=r.ops.pop();r.trys.pop();continue;default:if(!(a=r.trys,a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){r.label=c[1];break}if(c[0]===6&&r.label<a[1]){r.label=a[1];a=c;break}if(a&&r.label<a[2]){r.label=a[2];r.ops.push(c);break}if(a[2])r.ops.pop();r.trys.pop();continue}c=e.call(t,r)}catch(t){c=[6,t];o=0}finally{n=a=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}};import{h as handleFetch,l as log,a as logError}from"./handleFetch-37cea185.js";var getTempCartById=function(t){return __awaiter(void 0,void 0,void 0,(function(){var e,r,n;return __generator(this,(function(o){switch(o.label){case 0:return[4,handleFetch("/api/zonos-elements/get-temp-cart",{body:{tempCartUUID:t},headers:{"Content-Type":"application/json"},method:"POST"})];case 1:e=o.sent(),r=e.errors,n=e.json;if(!n||r.length){return[2,null]}return[2,n]}}))}))};var setupCartData=function(t){return __awaiter(void 0,void 0,void 0,(function(){var e;return __generator(this,(function(r){switch(r.label){case 0:return[4,getTempCartById(t)];case 1:e=r.sent();log("[ZONOS - loadZonos] getting temp cart data","info",e);if(!e){logError("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process.");return[2,null]}return[2,{cartData:e.cartData,storeFavicon:e.storeFaviconUrl,storeId:e.cartData.storeId,storeLogo:e.storeLogoUrl,zonosApiKey:e.cartData.credentialToken}]}}))}))};var checkoutHiddenBtnSelector="zonos--checkout-hidden-button";var domesticRedirectedBtnSelector="zonos--domestic-redirected-checkout-button";export{checkoutHiddenBtnSelector as c,domesticRedirectedBtnSelector as d,setupCartData as s};
|