@zonos/elements 1.3.203 → 1.3.204
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/index.cjs.js +7 -7
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/zonos-address_11.cjs.entry.js +52 -25
- package/dist/cjs/zonos-checkout.cjs.entry.js +1 -0
- package/dist/cjs/zonos-elements.cjs.js +1 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +1 -0
- package/dist/collection/components/stripe/zonos-custom-address/zonos-custom-address.js +54 -24
- package/dist/collection/types/generated/graphql.internal.types.js +4 -0
- package/dist/esm/index.js +7 -7
- package/dist/esm/loader.js +1 -1
- package/dist/esm/zonos-address_11.entry.js +52 -25
- package/dist/esm/zonos-checkout.entry.js +1 -0
- package/dist/esm/zonos-elements.js +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/zonos-address_11.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-elements.js +1 -1
- package/dist/scripts/index.d.ts +4 -0
- 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/stripe/zonos-custom-address/zonos-custom-address.d.ts +1 -0
- package/dist/types/components/utils/api/getLocaleMessages.d.ts +1 -1
- package/dist/types/types/generated/graphql.frontend.types.d.ts +1 -1
- package/dist/types/types/generated/graphql.frontend.types.ts +1 -1
- package/dist/types/types/generated/graphql.internal.types.d.ts +9 -0
- package/dist/types/types/generated/graphql.internal.types.ts +10 -0
- package/dist/zonos-elements/assets/RemoveIcon.svg +1 -1
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/p-0944fe64.entry.js +1 -0
- package/dist/zonos-elements/p-4b5197e7.system.entry.js +1 -0
- package/dist/zonos-elements/{p-7cd09f1f.system.js → p-6a71f76b.system.js} +1 -1
- package/dist/zonos-elements/{p-2bb8ca7d.system.entry.js → p-c66fc4e5.system.entry.js} +1 -1
- package/dist/zonos-elements/p-ea6d87a1.system.js +1 -1
- package/dist/zonos-elements/p-f29edb65.entry.js +1 -0
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/zonos-elements/p-2f70d0eb.entry.js +0 -1
- package/dist/zonos-elements/p-411b8e10.entry.js +0 -1
- package/dist/zonos-elements/p-54cdc47f.system.entry.js +0 -1
|
@@ -289,14 +289,6 @@ export class ZonosAddress {
|
|
|
289
289
|
}
|
|
290
290
|
getIsComplete() {
|
|
291
291
|
const { city, firstName, lastName, line1, phone, postalCode, state } = this.getCustomAddressErrors();
|
|
292
|
-
// empty field when first loaded
|
|
293
|
-
if (!this.line1 ||
|
|
294
|
-
!this.postalCode ||
|
|
295
|
-
!this.firstName ||
|
|
296
|
-
!this.lastName ||
|
|
297
|
-
!this.phone) {
|
|
298
|
-
return false;
|
|
299
|
-
}
|
|
300
292
|
// has any errors from any of the fields
|
|
301
293
|
const hasErrors = line1 || postalCode || state || city || firstName || lastName || phone;
|
|
302
294
|
return !hasErrors;
|
|
@@ -607,6 +599,20 @@ export class ZonosAddress {
|
|
|
607
599
|
valueType: 'phone',
|
|
608
600
|
});
|
|
609
601
|
}
|
|
602
|
+
countryChanged(countryCode) {
|
|
603
|
+
var _a, _b;
|
|
604
|
+
const countryFields = (_a = zonosStore.genericSettings) === null || _a === void 0 ? void 0 : _a.countryFields;
|
|
605
|
+
const countryFieldCountryCode = countryFields === null || countryFields === void 0 ? void 0 : countryFields[countryCode];
|
|
606
|
+
// If the country code of countryFields are the same as current selected country code, do nothing
|
|
607
|
+
if (((_b = this.countryField) === null || _b === void 0 ? void 0 : _b.countryCode) === this.country) {
|
|
608
|
+
return;
|
|
609
|
+
}
|
|
610
|
+
if (countryFields && countryFieldCountryCode) {
|
|
611
|
+
this.countryField = countryFieldCountryCode;
|
|
612
|
+
return;
|
|
613
|
+
}
|
|
614
|
+
this.countryField = null;
|
|
615
|
+
}
|
|
610
616
|
shouldEnabledCustomAddressChanged() {
|
|
611
617
|
// Only initialize the address suggestions if the address service is not already initialized
|
|
612
618
|
this.initAddressSuggestions();
|
|
@@ -624,16 +630,12 @@ export class ZonosAddress {
|
|
|
624
630
|
});
|
|
625
631
|
}
|
|
626
632
|
renderCustomAddressForm() {
|
|
627
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s
|
|
628
|
-
const
|
|
633
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
634
|
+
const _t = this.getCustomAddressErrors(), { showError } = _t, customAddressErrors = __rest(_t, ["showError"]);
|
|
629
635
|
const stripeAddressEventData = this.getStripeAddressInstance().stripeAddressEventData;
|
|
630
636
|
const countryCode = stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.country;
|
|
631
|
-
this.
|
|
632
|
-
|
|
633
|
-
? (_c = (_b = zonosStore.genericSettings) === null || _b === void 0 ? void 0 : _b.countryFields) === null || _c === void 0 ? void 0 : _c[countryCode]
|
|
634
|
-
: null;
|
|
635
|
-
const firstCountry = (_d = this.shipToCountries) === null || _d === void 0 ? void 0 : _d[0];
|
|
636
|
-
const stateOptions = Object.entries(((_e = this.countryField) === null || _e === void 0 ? void 0 : _e.regions) || {})
|
|
637
|
+
const firstCountry = (_a = this.shipToCountries) === null || _a === void 0 ? void 0 : _a[0];
|
|
638
|
+
const stateOptions = Object.entries(((_b = this.countryField) === null || _b === void 0 ? void 0 : _b.regions) || {})
|
|
637
639
|
.map(([label, region]) => ({
|
|
638
640
|
label,
|
|
639
641
|
value: region.interpayCode,
|
|
@@ -668,6 +670,30 @@ export class ZonosAddress {
|
|
|
668
670
|
*/
|
|
669
671
|
this.lastName = event.detail;
|
|
670
672
|
}, required: true }), h("zonos-stripe-select", { "aria-required": "true", autoComplete: "shipping country", class: "zonos--custom-address-form-input", name: `${this.type}-country`, onSelectChange: (event) => {
|
|
673
|
+
this.countryChanged(event.detail);
|
|
674
|
+
// revalidate the postal code since with empty value so it would reset the customAddressErrors
|
|
675
|
+
this.validate({
|
|
676
|
+
type: this.type,
|
|
677
|
+
value: '',
|
|
678
|
+
valueType: 'postalCode',
|
|
679
|
+
});
|
|
680
|
+
this.validate({
|
|
681
|
+
type: this.type,
|
|
682
|
+
value: '',
|
|
683
|
+
valueType: 'city',
|
|
684
|
+
});
|
|
685
|
+
this.validate({
|
|
686
|
+
type: this.type,
|
|
687
|
+
value: '',
|
|
688
|
+
valueType: 'state',
|
|
689
|
+
});
|
|
690
|
+
/**
|
|
691
|
+
* Order of operations is important here:
|
|
692
|
+
* 1. validate() updates all input error states
|
|
693
|
+
* 2. Setting postalCode triggers @Watch('postalCode')
|
|
694
|
+
* 3. getIsComplete() checks customAddressErrors state
|
|
695
|
+
* Therefore, we must update the value after validation to ensure correct error state
|
|
696
|
+
*/
|
|
671
697
|
this.country = event.detail;
|
|
672
698
|
this.city = '';
|
|
673
699
|
this.state = '';
|
|
@@ -705,9 +731,9 @@ export class ZonosAddress {
|
|
|
705
731
|
}, suggestions: this.addressSuggestions, type: this.type })), h("div", { "aria-label": "Additional address details", class: classes([
|
|
706
732
|
'zonos--custom-address-form-additional-fields',
|
|
707
733
|
countryCode && this.isAddressLine1Entered ? 'zonos--show' : '',
|
|
708
|
-
]), role: "group" }, h("zonos-stripe-input", { "aria-required": "false", autoComplete: "shipping address-line2", class: "zonos--custom-address-form-input", inputLabel: translate(((
|
|
734
|
+
]), role: "group" }, h("zonos-stripe-input", { "aria-required": "false", autoComplete: "shipping address-line2", class: "zonos--custom-address-form-input", inputLabel: translate(((_c = this.countryField) === null || _c === void 0 ? void 0 : _c.address2Label) || 'Address line 2'), inputValue: (stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.line2) || '', onInputChange: (event) => {
|
|
709
735
|
this.line2 = event.detail;
|
|
710
|
-
} }), ((
|
|
736
|
+
} }), ((_d = this.countryField) === null || _d === void 0 ? void 0 : _d.cityShow) && (h("zonos-stripe-input", { "aria-required": ((_e = this.countryField) === null || _e === void 0 ? void 0 : _e.cityRequired) ? 'true' : 'false', autoComplete: "shipping address-level2", class: "zonos--custom-address-form-input", error: showError ? customAddressErrors.city : undefined, inputLabel: translate(((_f = this.countryField) === null || _f === void 0 ? void 0 : _f.cityLabel) || 'City'), inputValue: (stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.city) || '', name: "locality", onInputChange: (event) => {
|
|
711
737
|
this.validate({
|
|
712
738
|
type: this.type,
|
|
713
739
|
value: event.detail,
|
|
@@ -721,7 +747,7 @@ export class ZonosAddress {
|
|
|
721
747
|
* Therefore, we must update the value after validation to ensure correct error state
|
|
722
748
|
*/
|
|
723
749
|
this.city = event.detail;
|
|
724
|
-
}, required: (
|
|
750
|
+
}, required: (_g = this.countryField) === null || _g === void 0 ? void 0 : _g.cityRequired })), h("div", { class: "zonos--custom-address-form-state-zip-wrapper" }, ((_h = this.countryField) === null || _h === void 0 ? void 0 : _h.stateShow) && (h("zonos-stripe-select", { "aria-required": ((_j = this.countryField) === null || _j === void 0 ? void 0 : _j.stateRequired) ? 'true' : 'false', autoComplete: "shipping address-level1", class: "zonos--custom-address-form-input", error: showError ? customAddressErrors.state : undefined, isError: showError && !!customAddressErrors.state, name: `${this.type}-state`, onSelectChange: (event) => {
|
|
725
751
|
this.validate({
|
|
726
752
|
type: this.type,
|
|
727
753
|
value: event.detail,
|
|
@@ -735,9 +761,9 @@ export class ZonosAddress {
|
|
|
735
761
|
* Therefore, we must update the value after validation to ensure correct error state
|
|
736
762
|
*/
|
|
737
763
|
this.state = event.detail;
|
|
738
|
-
}, options: stateOptions, required: (
|
|
764
|
+
}, options: stateOptions, required: (_k = this.countryField) === null || _k === void 0 ? void 0 : _k.stateRequired, selectLabel: translate(((_l = this.countryField) === null || _l === void 0 ? void 0 : _l.stateLabel) || 'State'), selectedValue: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.state, title: `${this.type} state` })), ((_m = this.countryField) === null || _m === void 0 ? void 0 : _m.zipShow) && (h("zonos-stripe-input", { "aria-describedby": ((_o = this.countryField) === null || _o === void 0 ? void 0 : _o.zipFormat)
|
|
739
765
|
? `zip-format-${this.type}`
|
|
740
|
-
: undefined, "aria-required": ((
|
|
766
|
+
: undefined, "aria-required": ((_p = this.countryField) === null || _p === void 0 ? void 0 : _p.zipRequired) ? 'true' : 'false', autoComplete: "shipping postal-code", class: "zonos--custom-address-form-input", error: showError ? customAddressErrors.postalCode : undefined, inputLabel: translate(((_q = this.countryField) === null || _q === void 0 ? void 0 : _q.zipLabel) || 'Zip'), inputValue: (stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.postal_code) || '', onInputChange: (event) => {
|
|
741
767
|
this.validate({
|
|
742
768
|
type: this.type,
|
|
743
769
|
value: event.detail,
|
|
@@ -751,7 +777,7 @@ export class ZonosAddress {
|
|
|
751
777
|
* Therefore, we must update the value after validation to ensure correct error state
|
|
752
778
|
*/
|
|
753
779
|
this.postalCode = event.detail;
|
|
754
|
-
}, required: (
|
|
780
|
+
}, required: (_r = this.countryField) === null || _r === void 0 ? void 0 : _r.zipRequired }))), h("zonos-stripe-phone-input", { autoComplete: "shipping tel", class: "zonos--custom-address-form-input", countryCode: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.country, countryOptions: (_s = zonosStore.genericSettings) === null || _s === void 0 ? void 0 : _s.countryFields, error: showError ? customAddressErrors.phone : undefined, inputLabel: translate('Phone number'), inputValue: (stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.phone) || '', onInputValueChange: event => {
|
|
755
781
|
const { isEmpty, phoneNumber, valid, wrongFormat } = event.detail;
|
|
756
782
|
// Validate the phone number
|
|
757
783
|
this.validate({
|
|
@@ -808,6 +834,7 @@ export class ZonosAddress {
|
|
|
808
834
|
this.isFirstInitialization = false;
|
|
809
835
|
// subscribe to checkout session id changes from storage store
|
|
810
836
|
this.onStoreCheckoutSessionIdChanged();
|
|
837
|
+
this.countryChanged((stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.country) || 'US');
|
|
811
838
|
}
|
|
812
839
|
render() {
|
|
813
840
|
var _a;
|
|
@@ -821,10 +848,10 @@ export class ZonosAddress {
|
|
|
821
848
|
this.country = localizationStore.selectedCountryCode;
|
|
822
849
|
}
|
|
823
850
|
// this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
|
|
824
|
-
return (h(Host, { key: '
|
|
851
|
+
return (h(Host, { key: 'e693838d636553752143c9f0b85468fbc468d6a2', class: classes([
|
|
825
852
|
'zonos--address zonos--elements',
|
|
826
853
|
`zonos--${this.type}-address`,
|
|
827
|
-
]) }, h("zonos-text", { key: '
|
|
854
|
+
]) }, h("zonos-text", { key: '1983fa345e6720875f9fa37d293c7d26815de5a1', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), this.renderCompanyNameInput(), this.renderTaxIdInput(), this.renderCustomAddressForm()));
|
|
828
855
|
}
|
|
829
856
|
static get is() { return "zonos-custom-address"; }
|
|
830
857
|
static get encapsulation() { return "scoped"; }
|
|
@@ -1037,6 +1064,9 @@ export class ZonosAddress {
|
|
|
1037
1064
|
}, {
|
|
1038
1065
|
"propName": "state",
|
|
1039
1066
|
"methodName": "formFieldsChanged"
|
|
1067
|
+
}, {
|
|
1068
|
+
"propName": "country",
|
|
1069
|
+
"methodName": "countryChanged"
|
|
1040
1070
|
}, {
|
|
1041
1071
|
"propName": "addressService",
|
|
1042
1072
|
"methodName": "shouldEnabledCustomAddressChanged"
|
|
@@ -335,6 +335,10 @@ export const checkoutSessionCreationModeType = {
|
|
|
335
335
|
WithPaymentIntent: 'WITH_PAYMENT_INTENT',
|
|
336
336
|
WithoutPaymentIntent: 'WITHOUT_PAYMENT_INTENT',
|
|
337
337
|
};
|
|
338
|
+
export const checkoutSessionPartyReferenceType = {
|
|
339
|
+
Destination: 'DESTINATION',
|
|
340
|
+
Payor: 'PAYOR',
|
|
341
|
+
};
|
|
338
342
|
export const checkoutStatus = {
|
|
339
343
|
Disabled: 'DISABLED',
|
|
340
344
|
Enabled: 'ENABLED',
|
package/dist/esm/index.js
CHANGED
|
@@ -129,7 +129,7 @@ const getZonosQaUrl = () => {
|
|
|
129
129
|
return null;
|
|
130
130
|
}
|
|
131
131
|
const qaUrl = extractZonosQaUrl(window.location.href);
|
|
132
|
-
const cdnUrl = "https://v1.3.
|
|
132
|
+
const cdnUrl = "https://v1.3.204.js.zonos.com";
|
|
133
133
|
// when the qaUrl is not set and the built URL is from the test domain, use the test domain for testing
|
|
134
134
|
if (!qaUrl &&
|
|
135
135
|
(cdnUrl.includes('test.') ||
|
|
@@ -370,10 +370,10 @@ const zonosLoadUrl = (() => {
|
|
|
370
370
|
}
|
|
371
371
|
return null;
|
|
372
372
|
})();
|
|
373
|
-
const ZONOS_URL = "https://v1.3.
|
|
374
|
-
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.
|
|
375
|
-
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.
|
|
376
|
-
const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.
|
|
373
|
+
const ZONOS_URL = "https://v1.3.204.js.zonos.com";
|
|
374
|
+
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.204";
|
|
375
|
+
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.204";
|
|
376
|
+
const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.204";
|
|
377
377
|
const GOOGLE_FONT_URL = 'https://fonts.googleapis.com';
|
|
378
378
|
const GOOGLE_FONT_REGEX = /^https:\/\/fonts\.googleapis\.com/;
|
|
379
379
|
class Zonos {
|
|
@@ -391,7 +391,7 @@ Zonos.iframeLogType = typeof window !== 'undefined'
|
|
|
391
391
|
? new URLSearchParams(window.location.search).get('iframeLogType')
|
|
392
392
|
: null;
|
|
393
393
|
Zonos.isBigCommerce = false;
|
|
394
|
-
Zonos.releaseDate = "
|
|
394
|
+
Zonos.releaseDate = "1747426281984";
|
|
395
395
|
Zonos.isLegacyCheckout = false;
|
|
396
396
|
Zonos.domain = typeof window !== 'undefined'
|
|
397
397
|
? // domain that embeds the iframe
|
|
@@ -409,7 +409,7 @@ Zonos.isNpm = true;
|
|
|
409
409
|
Zonos.zonosQaUrl = null;
|
|
410
410
|
Zonos.zonosQaUrlApi = null;
|
|
411
411
|
Zonos.trackEventLogs = [];
|
|
412
|
-
Zonos.version = `v${"1.3.
|
|
412
|
+
Zonos.version = `v${"1.3.204"}`;
|
|
413
413
|
Zonos.modeAlerted = false;
|
|
414
414
|
Zonos.cartData = null;
|
|
415
415
|
Zonos.paypal = null;
|
package/dist/esm/loader.js
CHANGED
|
@@ -5,7 +5,7 @@ import { g as globalScripts } from './app-globals-0f993ce5.js';
|
|
|
5
5
|
const defineCustomElements = async (win, options) => {
|
|
6
6
|
if (typeof window === 'undefined') return undefined;
|
|
7
7
|
await globalScripts();
|
|
8
|
-
return bootstrapLazy(JSON.parse("[[\"zonos-checkout\",[[2,\"zonos-checkout\",{\"appearanceSettingsOverride\":[16],\"preview\":[4],\"hiddenMode\":[4,\"hidden-mode\"],\"mobile\":[4],\"overrideStagingMode\":[4,\"override-staging-mode\"],\"defaultAddress\":[16],\"forceDialogOpen\":[4,\"force-dialog-open\"],\"defaultAddressParams\":[32],\"defaultCustomerProfileAddress\":[32],\"customerProfile\":[32],\"open\":[32],\"isOverlayLoading\":[32],\"stripe\":[32],\"submitLoading\":[32],\"collapseReviewMobile\":[32],\"isAttachError\":[32],\"isMobile\":[32],\"isIframed\":[32],\"zonosReviewRef\":[32],\"storybookPaymentStatusOverride\":[32],\"isLegacyCheckout\":[32],\"confirmDialogOpen\":[32],\"isCartExpired\":[32],\"payInUsdConfirmDialogOpen\":[32],\"inventoryCheckErrorMessage\":[32],\"placedOrderInfo\":[32],\"clientSecret\":[32],\"stripeCustomerSessionClientSecret\":[32],\"closeDialogHandler\":[64],\"init\":[64],\"setToFinishStep\":[64],\"mockCheckoutSession\":[64],\"triggerCheckoutInternational\":[64]},[[16,\"zonos--init-cart-info\",\"initCartInfoHandler\"],[4,\"keydown\",\"handleKeyPress\"],[9,\"resize\",\"handleWindowResize\"]],{\"appearanceSettingsOverride\":[\"appearanceSettingsOverrideChanged\",\"handleAppearanceSettingsOverrideChange\"],\"overrideStagingMode\":[\"overrideStagingModeChanged\"],\"mobile\":[\"handleMobileChange\"],\"defaultAddress\":[\"handleAddressChange\"],\"customerProfile\":[\"handleCustomerProfileChange\"],\"clientSecret\":[\"handleClientSecretChange\"],\"stripeCustomerSessionClientSecret\":[\"handleClientSecretChange\"],\"open\":[\"handleOpenChange\"]}]]],[\"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-tooltip\",[[1,\"zonos-tooltip\",{\"label\":[1],\"subtitle\":[1],\"showTooltip\":[32]}]]],[\"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-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-badge\",[[1,\"zonos-badge\",{\"bold\":[4],\"badgeColor\":[1,\"badge-color\"],\"icon\":[16],\"iconRight\":[4,\"icon-right\"],\"size\":[1],\"rounded\":[4],\"loading\":[4],\"dismissHandler\":[16]}]]],[\"zonos-shipping-rich-radio\",[[1,\"zonos-shipping-rich-radio\",{\"items\":[16],\"borderColor\":[1,\"border-color\"],\"borderStyle\":[1,\"border-style\"],\"theme\":[1],\"selectedItem\":[16]}]]],[\"zonos-toggle\",[[1,\"zonos-toggle\",{\"options\":[16],\"value\":[1]}]]],[\"zonos-collapse\",[[1,\"zonos-collapse\",{\"collapsed\":[4],\"collapseSize\":[2,\"collapse-size\"],\"height\":[32],\"iframe\":[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-stripe-input\",[[2,\"zonos-stripe-input\",{\"name\":[1],\"autoComplete\":[1,\"auto-complete\"],\"inputValue\":[1,\"input-value\"],\"inputLabel\":[1,\"input-label\"],\"overridePrimaryColor\":[1,\"override-primary-color\"],\"overrideSecondaryColor\":[1,\"override-secondary-color\"],\"isDisabled\":[4,\"is-disabled\"],\"isError\":[4,\"is-error\"],\"error\":[1],\"inputPlaceholder\":[1,\"input-placeholder\"],\"value\":[1025],\"required\":[4],\"internalValue\":[32]},null,{\"inputValue\":[\"onInputValueChange\"],\"value\":[\"onValueChange\"]}]]],[\"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-banner\",[[1,\"zonos-banner\",{\"bannerTitle\":[1,\"banner-title\"],\"intent\":[1],\"hasContent\":[32]}]]],[\"zonos-v-stack\",[[1,\"zonos-v-stack\",{\"spacing\":[2]}]]],[\"zonos-empty-state-payment_4\",[[1,\"zonos-empty-state-payment\",{\"emptyStateText\":[1,\"empty-state-text\"],\"theme\":[1]}],[2,\"zonos-payment\",{\"titleText\":[1,\"title-text\"],\"stripe\":[32],\"stripeElements\":[32],\"isPaymentInfoFilled\":[32]},null,{\"isPaymentInfoFilled\":[\"watchIsPaymentInfoFilled\"],\"stripeElements\":[\"watchInitStripe\"],\"stripe\":[\"watchInitStripe\"]}],[2,\"zonos-paypal-payment\"],[1,\"zonos-notification\",{\"notificationArray\":[32],\"showNotification\":[64]}]]],[\"zonos-language-select_2\",[[1,\"zonos-language-select\",{\"handleOnClose\":[16]}],[1,\"zonos-select-dialog-header\",{\"handleOnClose\":[16],\"label\":[1]}]]],[\"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\"],\"bold\":[4],\"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-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-address_11\",[[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-custom-address\",{\"type\":[1],\"titleText\":[1,\"title-text\"],\"defaultAddress\":[16],\"taxIdErrorMessage\":[1,\"tax-id-error-message\"],\"stripe\":[32],\"isDirtyAddress\":[32],\"isAddressFilled\":[32],\"isAddressLine1Entered\":[32],\"addressSuggestions\":[32],\"countryField\":[32],\"startGooglePlaceSuggestions\":[32],\"shipToCountries\":[32],\"shippingZones\":[32],\"city\":[32],\"country\":[32],\"firstName\":[32],\"lastName\":[32],\"line1\":[32],\"line2\":[32],\"phone\":[32],\"postalCode\":[32],\"state\":[32],\"cityError\":[32],\"stateError\":[32],\"postalCodeError\":[32],\"phoneError\":[32],\"firstNameError\":[32],\"lastNameError\":[32],\"isFirstInitialization\":[32],\"addressService\":[32],\"checkoutSessionId\":[32]},null,{\"checkoutSessionId\":[\"isAddressFilledChanged\"],\"isAddressFilled\":[\"isAddressFilledChanged\"],\"defaultAddress\":[\"defaultAddressChanged\"],\"line1\":[\"line1Changed\"],\"city\":[\"formFieldsChanged\"],\"country\":[\"formFieldsChanged\"],\"firstName\":[\"formFieldsChanged\"],\"lastName\":[\"formFieldsChanged\"],\"line2\":[\"formFieldsChanged\"],\"phone\":[\"formFieldsChanged\"],\"postalCode\":[\"formFieldsChanged\"],\"state\":[\"formFieldsChanged\"],\"addressService\":[\"shouldEnabledCustomAddressChanged\"],\"shippingZones\":[\"shippingZonesChanged\"]}],[2,\"zonos-address\",{\"type\":[1],\"titleText\":[1,\"title-text\"],\"defaultAddress\":[16],\"taxIdErrorMessage\":[1,\"tax-id-error-message\"],\"stripe\":[32],\"isDirtyAddress\":[32],\"isAddressFilled\":[32],\"checkoutSessionId\":[32]},null,{\"checkoutSessionId\":[\"isAddressFilledChanged\"],\"isAddressFilled\":[\"isAddressFilledChanged\"],\"stripe\":[\"watchInitStripe\"],\"defaultAddress\":[\"defaultAddressChanged\"]}],[2,\"zonos-link-authentication\",{\"titleText\":[1,\"title-text\"],\"defaultEmail\":[1,\"default-email\"],\"isEmailError\":[4,\"is-email-error\"],\"stripe\":[32],\"isStagingMode\":[32],\"clientSecret\":[32]},null,{\"isStagingMode\":[\"watchIsStagingMode\"],\"stripe\":[\"watchInitStripe\"],\"clientSecret\":[\"watchInitStripe\"],\"defaultEmail\":[\"watchDefaultEmail\"]}],[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\"]]],[1,\"zonos-address-suggestions\",{\"type\":[1],\"suggestions\":[16],\"selectedSuggestionId\":[32],\"localSuggestions\":[32],\"lastHoveredSuggestionId\":[32]},null,{\"suggestions\":[\"suggestionsChanged\"]}],[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\"]]],[2,\"zonos-stripe-phone-input\",{\"autoComplete\":[1,\"auto-complete\"],\"countryOptions\":[16],\"disabled\":[4],\"error\":[1],\"inputLabel\":[1,\"input-label\"],\"overridePrimaryColor\":[1,\"override-primary-color\"],\"overrideSecondaryColor\":[1,\"override-secondary-color\"],\"inputValue\":[1,\"input-value\"],\"countryCode\":[1,\"country-code\"],\"minWidth\":[1,\"min-width\"],\"selectedCountry\":[32],\"phoneNumber\":[32],\"isFocused\":[32],\"isSelectOpen\":[32]},null,{\"countryOptions\":[\"onCountryOptionsChange\"],\"selectedCountry\":[\"onSelectedCountryChange\"],\"inputValue\":[\"onPhoneNumberChange\"]}],[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-stripe-select\",{\"name\":[1],\"selectedValue\":[1,\"selected-value\"],\"selectLabel\":[1,\"select-label\"],\"overridePrimaryColor\":[1,\"override-primary-color\"],\"overrideSecondaryColor\":[1,\"override-secondary-color\"],\"isDisabled\":[4,\"is-disabled\"],\"isError\":[4,\"is-error\"],\"error\":[1],\"selectPlaceholder\":[1,\"select-placeholder\"],\"options\":[16],\"autoComplete\":[1,\"auto-complete\"],\"value\":[1025],\"required\":[4],\"isClearable\":[4,\"is-clearable\"],\"minWidth\":[1,\"min-width\"],\"internalValue\":[32],\"internalOptions\":[32]},null,{\"options\":[\"onOptionsChange\"],\"selectedValue\":[\"onSelectedValueChange\"],\"value\":[\"onValueChange\"]}]]],[\"zonos-cart-items_14\",[[2,\"zonos-customer-info\",{\"continueLoading\":[4,\"continue-loading\"],\"submitBtnType\":[1,\"submit-btn-type\"],\"submitBtnColor\":[1,\"submit-btn-color\"],\"isMobile\":[4,\"is-mobile\"],\"defaultAddress\":[16],\"shouldUseCustomAddressFormOverride\":[4,\"should-use-custom-address-form-override\"],\"showErrorBanner\":[32],\"shippingCountry\":[32],\"isCheckingForRestrictedItems\":[32],\"isValidatingAddress\":[32],\"taxIdErrorMessage\":[32],\"invalidShippingCharacterList\":[32],\"invalidBillingCharacterList\":[32],\"openAddressValidationDialog\":[32],\"shouldEnabledCustomAddress\":[32],\"isEmailError\":[32],\"recordedFormTypeUsed\":[32]},null,{\"showErrorBanner\":[\"watchShowErrorBanner\"]}],[2,\"zonos-checkout-payment\",{\"submitBtnType\":[1,\"submit-btn-type\"],\"continueLoading\":[4,\"continue-loading\"],\"submitBtnColor\":[1,\"submit-btn-color\"],\"isMobile\":[4,\"is-mobile\"],\"overridePrimaryColor\":[1,\"override-primary-color\"],\"showErrorBanner\":[32],\"hasStripePaymentError\":[32],\"stagingOrderCreateErrorMessage\":[32],\"internalContinueLoading\":[32]},null,{\"continueLoading\":[\"continueLoadingWatcher\"],\"hasStripePaymentError\":[\"stripePaymentErrorWatcher\"]}],[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],\"collapsedDAPOptions\":[32],\"isSelecting\":[32],\"showErrorBanner\":[32],\"serviceLevelsDDP\":[32],\"serviceLevelsDAP\":[32],\"serviceLevelsOther\":[32],\"serviceLevelsAll\":[32],\"displayBaseCurrency\":[32]}],[1,\"zonos-cart-subtotal\",{\"submitBtnType\":[1,\"submit-btn-type\"],\"submitBtnColor\":[1,\"submit-btn-color\"],\"loading\":[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],\"isWaitingToRedirect\":[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\"],\"dialogWidth\":[2,\"dialog-width\"],\"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-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-cart-items\",{\"errorImages\":[32]}],[1,\"zonos-currency-toggle\",{\"errorImages\":[32]}],[1,\"zonos-loading-overlay\",{\"open\":[4],\"spinnerColor\":[1,\"spinner-color\"],\"size\":[2]}],[1,\"zonos-rest-state\",{\"restStateSubtitle\":[1,\"rest-state-subtitle\"],\"restStateTitle\":[1,\"rest-state-title\"],\"restStateType\":[1,\"rest-state-type\"],\"isErrorImageLoad\":[32]}]]]]"), options);
|
|
8
|
+
return bootstrapLazy(JSON.parse("[[\"zonos-checkout\",[[2,\"zonos-checkout\",{\"appearanceSettingsOverride\":[16],\"preview\":[4],\"hiddenMode\":[4,\"hidden-mode\"],\"mobile\":[4],\"overrideStagingMode\":[4,\"override-staging-mode\"],\"defaultAddress\":[16],\"forceDialogOpen\":[4,\"force-dialog-open\"],\"defaultAddressParams\":[32],\"defaultCustomerProfileAddress\":[32],\"customerProfile\":[32],\"open\":[32],\"isOverlayLoading\":[32],\"stripe\":[32],\"submitLoading\":[32],\"collapseReviewMobile\":[32],\"isAttachError\":[32],\"isMobile\":[32],\"isIframed\":[32],\"zonosReviewRef\":[32],\"storybookPaymentStatusOverride\":[32],\"isLegacyCheckout\":[32],\"confirmDialogOpen\":[32],\"isCartExpired\":[32],\"payInUsdConfirmDialogOpen\":[32],\"inventoryCheckErrorMessage\":[32],\"placedOrderInfo\":[32],\"clientSecret\":[32],\"stripeCustomerSessionClientSecret\":[32],\"closeDialogHandler\":[64],\"init\":[64],\"setToFinishStep\":[64],\"mockCheckoutSession\":[64],\"triggerCheckoutInternational\":[64]},[[16,\"zonos--init-cart-info\",\"initCartInfoHandler\"],[4,\"keydown\",\"handleKeyPress\"],[9,\"resize\",\"handleWindowResize\"]],{\"appearanceSettingsOverride\":[\"appearanceSettingsOverrideChanged\",\"handleAppearanceSettingsOverrideChange\"],\"overrideStagingMode\":[\"overrideStagingModeChanged\"],\"mobile\":[\"handleMobileChange\"],\"defaultAddress\":[\"handleAddressChange\"],\"customerProfile\":[\"handleCustomerProfileChange\"],\"clientSecret\":[\"handleClientSecretChange\"],\"stripeCustomerSessionClientSecret\":[\"handleClientSecretChange\"],\"open\":[\"handleOpenChange\"]}]]],[\"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-tooltip\",[[1,\"zonos-tooltip\",{\"label\":[1],\"subtitle\":[1],\"showTooltip\":[32]}]]],[\"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-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-badge\",[[1,\"zonos-badge\",{\"bold\":[4],\"badgeColor\":[1,\"badge-color\"],\"icon\":[16],\"iconRight\":[4,\"icon-right\"],\"size\":[1],\"rounded\":[4],\"loading\":[4],\"dismissHandler\":[16]}]]],[\"zonos-shipping-rich-radio\",[[1,\"zonos-shipping-rich-radio\",{\"items\":[16],\"borderColor\":[1,\"border-color\"],\"borderStyle\":[1,\"border-style\"],\"theme\":[1],\"selectedItem\":[16]}]]],[\"zonos-toggle\",[[1,\"zonos-toggle\",{\"options\":[16],\"value\":[1]}]]],[\"zonos-collapse\",[[1,\"zonos-collapse\",{\"collapsed\":[4],\"collapseSize\":[2,\"collapse-size\"],\"height\":[32],\"iframe\":[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-stripe-input\",[[2,\"zonos-stripe-input\",{\"name\":[1],\"autoComplete\":[1,\"auto-complete\"],\"inputValue\":[1,\"input-value\"],\"inputLabel\":[1,\"input-label\"],\"overridePrimaryColor\":[1,\"override-primary-color\"],\"overrideSecondaryColor\":[1,\"override-secondary-color\"],\"isDisabled\":[4,\"is-disabled\"],\"isError\":[4,\"is-error\"],\"error\":[1],\"inputPlaceholder\":[1,\"input-placeholder\"],\"value\":[1025],\"required\":[4],\"internalValue\":[32]},null,{\"inputValue\":[\"onInputValueChange\"],\"value\":[\"onValueChange\"]}]]],[\"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-banner\",[[1,\"zonos-banner\",{\"bannerTitle\":[1,\"banner-title\"],\"intent\":[1],\"hasContent\":[32]}]]],[\"zonos-v-stack\",[[1,\"zonos-v-stack\",{\"spacing\":[2]}]]],[\"zonos-empty-state-payment_4\",[[1,\"zonos-empty-state-payment\",{\"emptyStateText\":[1,\"empty-state-text\"],\"theme\":[1]}],[2,\"zonos-payment\",{\"titleText\":[1,\"title-text\"],\"stripe\":[32],\"stripeElements\":[32],\"isPaymentInfoFilled\":[32]},null,{\"isPaymentInfoFilled\":[\"watchIsPaymentInfoFilled\"],\"stripeElements\":[\"watchInitStripe\"],\"stripe\":[\"watchInitStripe\"]}],[2,\"zonos-paypal-payment\"],[1,\"zonos-notification\",{\"notificationArray\":[32],\"showNotification\":[64]}]]],[\"zonos-language-select_2\",[[1,\"zonos-language-select\",{\"handleOnClose\":[16]}],[1,\"zonos-select-dialog-header\",{\"handleOnClose\":[16],\"label\":[1]}]]],[\"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\"],\"bold\":[4],\"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-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-address_11\",[[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-custom-address\",{\"type\":[1],\"titleText\":[1,\"title-text\"],\"defaultAddress\":[16],\"taxIdErrorMessage\":[1,\"tax-id-error-message\"],\"stripe\":[32],\"isDirtyAddress\":[32],\"isAddressFilled\":[32],\"isAddressLine1Entered\":[32],\"addressSuggestions\":[32],\"countryField\":[32],\"startGooglePlaceSuggestions\":[32],\"shipToCountries\":[32],\"shippingZones\":[32],\"city\":[32],\"country\":[32],\"firstName\":[32],\"lastName\":[32],\"line1\":[32],\"line2\":[32],\"phone\":[32],\"postalCode\":[32],\"state\":[32],\"cityError\":[32],\"stateError\":[32],\"postalCodeError\":[32],\"phoneError\":[32],\"firstNameError\":[32],\"lastNameError\":[32],\"isFirstInitialization\":[32],\"addressService\":[32],\"checkoutSessionId\":[32]},null,{\"checkoutSessionId\":[\"isAddressFilledChanged\"],\"isAddressFilled\":[\"isAddressFilledChanged\"],\"defaultAddress\":[\"defaultAddressChanged\"],\"line1\":[\"line1Changed\"],\"city\":[\"formFieldsChanged\"],\"country\":[\"formFieldsChanged\",\"countryChanged\"],\"firstName\":[\"formFieldsChanged\"],\"lastName\":[\"formFieldsChanged\"],\"line2\":[\"formFieldsChanged\"],\"phone\":[\"formFieldsChanged\"],\"postalCode\":[\"formFieldsChanged\"],\"state\":[\"formFieldsChanged\"],\"addressService\":[\"shouldEnabledCustomAddressChanged\"],\"shippingZones\":[\"shippingZonesChanged\"]}],[2,\"zonos-address\",{\"type\":[1],\"titleText\":[1,\"title-text\"],\"defaultAddress\":[16],\"taxIdErrorMessage\":[1,\"tax-id-error-message\"],\"stripe\":[32],\"isDirtyAddress\":[32],\"isAddressFilled\":[32],\"checkoutSessionId\":[32]},null,{\"checkoutSessionId\":[\"isAddressFilledChanged\"],\"isAddressFilled\":[\"isAddressFilledChanged\"],\"stripe\":[\"watchInitStripe\"],\"defaultAddress\":[\"defaultAddressChanged\"]}],[2,\"zonos-link-authentication\",{\"titleText\":[1,\"title-text\"],\"defaultEmail\":[1,\"default-email\"],\"isEmailError\":[4,\"is-email-error\"],\"stripe\":[32],\"isStagingMode\":[32],\"clientSecret\":[32]},null,{\"isStagingMode\":[\"watchIsStagingMode\"],\"stripe\":[\"watchInitStripe\"],\"clientSecret\":[\"watchInitStripe\"],\"defaultEmail\":[\"watchDefaultEmail\"]}],[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\"]]],[1,\"zonos-address-suggestions\",{\"type\":[1],\"suggestions\":[16],\"selectedSuggestionId\":[32],\"localSuggestions\":[32],\"lastHoveredSuggestionId\":[32]},null,{\"suggestions\":[\"suggestionsChanged\"]}],[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\"]]],[2,\"zonos-stripe-phone-input\",{\"autoComplete\":[1,\"auto-complete\"],\"countryOptions\":[16],\"disabled\":[4],\"error\":[1],\"inputLabel\":[1,\"input-label\"],\"overridePrimaryColor\":[1,\"override-primary-color\"],\"overrideSecondaryColor\":[1,\"override-secondary-color\"],\"inputValue\":[1,\"input-value\"],\"countryCode\":[1,\"country-code\"],\"minWidth\":[1,\"min-width\"],\"selectedCountry\":[32],\"phoneNumber\":[32],\"isFocused\":[32],\"isSelectOpen\":[32]},null,{\"countryOptions\":[\"onCountryOptionsChange\"],\"selectedCountry\":[\"onSelectedCountryChange\"],\"inputValue\":[\"onPhoneNumberChange\"]}],[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-stripe-select\",{\"name\":[1],\"selectedValue\":[1,\"selected-value\"],\"selectLabel\":[1,\"select-label\"],\"overridePrimaryColor\":[1,\"override-primary-color\"],\"overrideSecondaryColor\":[1,\"override-secondary-color\"],\"isDisabled\":[4,\"is-disabled\"],\"isError\":[4,\"is-error\"],\"error\":[1],\"selectPlaceholder\":[1,\"select-placeholder\"],\"options\":[16],\"autoComplete\":[1,\"auto-complete\"],\"value\":[1025],\"required\":[4],\"isClearable\":[4,\"is-clearable\"],\"minWidth\":[1,\"min-width\"],\"internalValue\":[32],\"internalOptions\":[32]},null,{\"options\":[\"onOptionsChange\"],\"selectedValue\":[\"onSelectedValueChange\"],\"value\":[\"onValueChange\"]}]]],[\"zonos-cart-items_14\",[[2,\"zonos-customer-info\",{\"continueLoading\":[4,\"continue-loading\"],\"submitBtnType\":[1,\"submit-btn-type\"],\"submitBtnColor\":[1,\"submit-btn-color\"],\"isMobile\":[4,\"is-mobile\"],\"defaultAddress\":[16],\"shouldUseCustomAddressFormOverride\":[4,\"should-use-custom-address-form-override\"],\"showErrorBanner\":[32],\"shippingCountry\":[32],\"isCheckingForRestrictedItems\":[32],\"isValidatingAddress\":[32],\"taxIdErrorMessage\":[32],\"invalidShippingCharacterList\":[32],\"invalidBillingCharacterList\":[32],\"openAddressValidationDialog\":[32],\"shouldEnabledCustomAddress\":[32],\"isEmailError\":[32],\"recordedFormTypeUsed\":[32]},null,{\"showErrorBanner\":[\"watchShowErrorBanner\"]}],[2,\"zonos-checkout-payment\",{\"submitBtnType\":[1,\"submit-btn-type\"],\"continueLoading\":[4,\"continue-loading\"],\"submitBtnColor\":[1,\"submit-btn-color\"],\"isMobile\":[4,\"is-mobile\"],\"overridePrimaryColor\":[1,\"override-primary-color\"],\"showErrorBanner\":[32],\"hasStripePaymentError\":[32],\"stagingOrderCreateErrorMessage\":[32],\"internalContinueLoading\":[32]},null,{\"continueLoading\":[\"continueLoadingWatcher\"],\"hasStripePaymentError\":[\"stripePaymentErrorWatcher\"]}],[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],\"collapsedDAPOptions\":[32],\"isSelecting\":[32],\"showErrorBanner\":[32],\"serviceLevelsDDP\":[32],\"serviceLevelsDAP\":[32],\"serviceLevelsOther\":[32],\"serviceLevelsAll\":[32],\"displayBaseCurrency\":[32]}],[1,\"zonos-cart-subtotal\",{\"submitBtnType\":[1,\"submit-btn-type\"],\"submitBtnColor\":[1,\"submit-btn-color\"],\"loading\":[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],\"isWaitingToRedirect\":[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\"],\"dialogWidth\":[2,\"dialog-width\"],\"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-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-cart-items\",{\"errorImages\":[32]}],[1,\"zonos-currency-toggle\",{\"errorImages\":[32]}],[1,\"zonos-loading-overlay\",{\"open\":[4],\"spinnerColor\":[1,\"spinner-color\"],\"size\":[2]}],[1,\"zonos-rest-state\",{\"restStateSubtitle\":[1,\"rest-state-subtitle\"],\"restStateTitle\":[1,\"rest-state-title\"],\"restStateType\":[1,\"rest-state-type\"],\"isErrorImageLoad\":[32]}]]]]"), options);
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export { defineCustomElements };
|
|
@@ -1063,14 +1063,6 @@ const ZonosAddress = class {
|
|
|
1063
1063
|
}
|
|
1064
1064
|
getIsComplete() {
|
|
1065
1065
|
const { city, firstName, lastName, line1, phone, postalCode, state } = this.getCustomAddressErrors();
|
|
1066
|
-
// empty field when first loaded
|
|
1067
|
-
if (!this.line1 ||
|
|
1068
|
-
!this.postalCode ||
|
|
1069
|
-
!this.firstName ||
|
|
1070
|
-
!this.lastName ||
|
|
1071
|
-
!this.phone) {
|
|
1072
|
-
return false;
|
|
1073
|
-
}
|
|
1074
1066
|
// has any errors from any of the fields
|
|
1075
1067
|
const hasErrors = line1 || postalCode || state || city || firstName || lastName || phone;
|
|
1076
1068
|
return !hasErrors;
|
|
@@ -1381,6 +1373,20 @@ const ZonosAddress = class {
|
|
|
1381
1373
|
valueType: 'phone',
|
|
1382
1374
|
});
|
|
1383
1375
|
}
|
|
1376
|
+
countryChanged(countryCode) {
|
|
1377
|
+
var _a, _b;
|
|
1378
|
+
const countryFields = (_a = zonosStore.genericSettings) === null || _a === void 0 ? void 0 : _a.countryFields;
|
|
1379
|
+
const countryFieldCountryCode = countryFields === null || countryFields === void 0 ? void 0 : countryFields[countryCode];
|
|
1380
|
+
// If the country code of countryFields are the same as current selected country code, do nothing
|
|
1381
|
+
if (((_b = this.countryField) === null || _b === void 0 ? void 0 : _b.countryCode) === this.country) {
|
|
1382
|
+
return;
|
|
1383
|
+
}
|
|
1384
|
+
if (countryFields && countryFieldCountryCode) {
|
|
1385
|
+
this.countryField = countryFieldCountryCode;
|
|
1386
|
+
return;
|
|
1387
|
+
}
|
|
1388
|
+
this.countryField = null;
|
|
1389
|
+
}
|
|
1384
1390
|
shouldEnabledCustomAddressChanged() {
|
|
1385
1391
|
// Only initialize the address suggestions if the address service is not already initialized
|
|
1386
1392
|
this.initAddressSuggestions();
|
|
@@ -1398,16 +1404,12 @@ const ZonosAddress = class {
|
|
|
1398
1404
|
});
|
|
1399
1405
|
}
|
|
1400
1406
|
renderCustomAddressForm() {
|
|
1401
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s
|
|
1402
|
-
const
|
|
1407
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
1408
|
+
const _t = this.getCustomAddressErrors(), { showError } = _t, customAddressErrors = __rest(_t, ["showError"]);
|
|
1403
1409
|
const stripeAddressEventData = this.getStripeAddressInstance().stripeAddressEventData;
|
|
1404
1410
|
const countryCode = stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.country;
|
|
1405
|
-
this.
|
|
1406
|
-
|
|
1407
|
-
? (_c = (_b = zonosStore.genericSettings) === null || _b === void 0 ? void 0 : _b.countryFields) === null || _c === void 0 ? void 0 : _c[countryCode]
|
|
1408
|
-
: null;
|
|
1409
|
-
const firstCountry = (_d = this.shipToCountries) === null || _d === void 0 ? void 0 : _d[0];
|
|
1410
|
-
const stateOptions = Object.entries(((_e = this.countryField) === null || _e === void 0 ? void 0 : _e.regions) || {})
|
|
1411
|
+
const firstCountry = (_a = this.shipToCountries) === null || _a === void 0 ? void 0 : _a[0];
|
|
1412
|
+
const stateOptions = Object.entries(((_b = this.countryField) === null || _b === void 0 ? void 0 : _b.regions) || {})
|
|
1411
1413
|
.map(([label, region]) => ({
|
|
1412
1414
|
label,
|
|
1413
1415
|
value: region.interpayCode,
|
|
@@ -1442,6 +1444,30 @@ const ZonosAddress = class {
|
|
|
1442
1444
|
*/
|
|
1443
1445
|
this.lastName = event.detail;
|
|
1444
1446
|
}, required: true }), h("zonos-stripe-select", { "aria-required": "true", autoComplete: "shipping country", class: "zonos--custom-address-form-input", name: `${this.type}-country`, onSelectChange: (event) => {
|
|
1447
|
+
this.countryChanged(event.detail);
|
|
1448
|
+
// revalidate the postal code since with empty value so it would reset the customAddressErrors
|
|
1449
|
+
this.validate({
|
|
1450
|
+
type: this.type,
|
|
1451
|
+
value: '',
|
|
1452
|
+
valueType: 'postalCode',
|
|
1453
|
+
});
|
|
1454
|
+
this.validate({
|
|
1455
|
+
type: this.type,
|
|
1456
|
+
value: '',
|
|
1457
|
+
valueType: 'city',
|
|
1458
|
+
});
|
|
1459
|
+
this.validate({
|
|
1460
|
+
type: this.type,
|
|
1461
|
+
value: '',
|
|
1462
|
+
valueType: 'state',
|
|
1463
|
+
});
|
|
1464
|
+
/**
|
|
1465
|
+
* Order of operations is important here:
|
|
1466
|
+
* 1. validate() updates all input error states
|
|
1467
|
+
* 2. Setting postalCode triggers @Watch('postalCode')
|
|
1468
|
+
* 3. getIsComplete() checks customAddressErrors state
|
|
1469
|
+
* Therefore, we must update the value after validation to ensure correct error state
|
|
1470
|
+
*/
|
|
1445
1471
|
this.country = event.detail;
|
|
1446
1472
|
this.city = '';
|
|
1447
1473
|
this.state = '';
|
|
@@ -1479,9 +1505,9 @@ const ZonosAddress = class {
|
|
|
1479
1505
|
}, suggestions: this.addressSuggestions, type: this.type })), h("div", { "aria-label": "Additional address details", class: classes([
|
|
1480
1506
|
'zonos--custom-address-form-additional-fields',
|
|
1481
1507
|
countryCode && this.isAddressLine1Entered ? 'zonos--show' : '',
|
|
1482
|
-
]), role: "group" }, h("zonos-stripe-input", { "aria-required": "false", autoComplete: "shipping address-line2", class: "zonos--custom-address-form-input", inputLabel: translate(((
|
|
1508
|
+
]), role: "group" }, h("zonos-stripe-input", { "aria-required": "false", autoComplete: "shipping address-line2", class: "zonos--custom-address-form-input", inputLabel: translate(((_c = this.countryField) === null || _c === void 0 ? void 0 : _c.address2Label) || 'Address line 2'), inputValue: (stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.line2) || '', onInputChange: (event) => {
|
|
1483
1509
|
this.line2 = event.detail;
|
|
1484
|
-
} }), ((
|
|
1510
|
+
} }), ((_d = this.countryField) === null || _d === void 0 ? void 0 : _d.cityShow) && (h("zonos-stripe-input", { "aria-required": ((_e = this.countryField) === null || _e === void 0 ? void 0 : _e.cityRequired) ? 'true' : 'false', autoComplete: "shipping address-level2", class: "zonos--custom-address-form-input", error: showError ? customAddressErrors.city : undefined, inputLabel: translate(((_f = this.countryField) === null || _f === void 0 ? void 0 : _f.cityLabel) || 'City'), inputValue: (stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.city) || '', name: "locality", onInputChange: (event) => {
|
|
1485
1511
|
this.validate({
|
|
1486
1512
|
type: this.type,
|
|
1487
1513
|
value: event.detail,
|
|
@@ -1495,7 +1521,7 @@ const ZonosAddress = class {
|
|
|
1495
1521
|
* Therefore, we must update the value after validation to ensure correct error state
|
|
1496
1522
|
*/
|
|
1497
1523
|
this.city = event.detail;
|
|
1498
|
-
}, required: (
|
|
1524
|
+
}, required: (_g = this.countryField) === null || _g === void 0 ? void 0 : _g.cityRequired })), h("div", { class: "zonos--custom-address-form-state-zip-wrapper" }, ((_h = this.countryField) === null || _h === void 0 ? void 0 : _h.stateShow) && (h("zonos-stripe-select", { "aria-required": ((_j = this.countryField) === null || _j === void 0 ? void 0 : _j.stateRequired) ? 'true' : 'false', autoComplete: "shipping address-level1", class: "zonos--custom-address-form-input", error: showError ? customAddressErrors.state : undefined, isError: showError && !!customAddressErrors.state, name: `${this.type}-state`, onSelectChange: (event) => {
|
|
1499
1525
|
this.validate({
|
|
1500
1526
|
type: this.type,
|
|
1501
1527
|
value: event.detail,
|
|
@@ -1509,9 +1535,9 @@ const ZonosAddress = class {
|
|
|
1509
1535
|
* Therefore, we must update the value after validation to ensure correct error state
|
|
1510
1536
|
*/
|
|
1511
1537
|
this.state = event.detail;
|
|
1512
|
-
}, options: stateOptions, required: (
|
|
1538
|
+
}, options: stateOptions, required: (_k = this.countryField) === null || _k === void 0 ? void 0 : _k.stateRequired, selectLabel: translate(((_l = this.countryField) === null || _l === void 0 ? void 0 : _l.stateLabel) || 'State'), selectedValue: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.state, title: `${this.type} state` })), ((_m = this.countryField) === null || _m === void 0 ? void 0 : _m.zipShow) && (h("zonos-stripe-input", { "aria-describedby": ((_o = this.countryField) === null || _o === void 0 ? void 0 : _o.zipFormat)
|
|
1513
1539
|
? `zip-format-${this.type}`
|
|
1514
|
-
: undefined, "aria-required": ((
|
|
1540
|
+
: undefined, "aria-required": ((_p = this.countryField) === null || _p === void 0 ? void 0 : _p.zipRequired) ? 'true' : 'false', autoComplete: "shipping postal-code", class: "zonos--custom-address-form-input", error: showError ? customAddressErrors.postalCode : undefined, inputLabel: translate(((_q = this.countryField) === null || _q === void 0 ? void 0 : _q.zipLabel) || 'Zip'), inputValue: (stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.postal_code) || '', onInputChange: (event) => {
|
|
1515
1541
|
this.validate({
|
|
1516
1542
|
type: this.type,
|
|
1517
1543
|
value: event.detail,
|
|
@@ -1525,7 +1551,7 @@ const ZonosAddress = class {
|
|
|
1525
1551
|
* Therefore, we must update the value after validation to ensure correct error state
|
|
1526
1552
|
*/
|
|
1527
1553
|
this.postalCode = event.detail;
|
|
1528
|
-
}, required: (
|
|
1554
|
+
}, required: (_r = this.countryField) === null || _r === void 0 ? void 0 : _r.zipRequired }))), h("zonos-stripe-phone-input", { autoComplete: "shipping tel", class: "zonos--custom-address-form-input", countryCode: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.country, countryOptions: (_s = zonosStore.genericSettings) === null || _s === void 0 ? void 0 : _s.countryFields, error: showError ? customAddressErrors.phone : undefined, inputLabel: translate('Phone number'), inputValue: (stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.phone) || '', onInputValueChange: event => {
|
|
1529
1555
|
const { isEmpty, phoneNumber, valid, wrongFormat } = event.detail;
|
|
1530
1556
|
// Validate the phone number
|
|
1531
1557
|
this.validate({
|
|
@@ -1582,6 +1608,7 @@ const ZonosAddress = class {
|
|
|
1582
1608
|
this.isFirstInitialization = false;
|
|
1583
1609
|
// subscribe to checkout session id changes from storage store
|
|
1584
1610
|
this.onStoreCheckoutSessionIdChanged();
|
|
1611
|
+
this.countryChanged((stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.country) || 'US');
|
|
1585
1612
|
}
|
|
1586
1613
|
render() {
|
|
1587
1614
|
var _a;
|
|
@@ -1595,10 +1622,10 @@ const ZonosAddress = class {
|
|
|
1595
1622
|
this.country = localizationStore.selectedCountryCode;
|
|
1596
1623
|
}
|
|
1597
1624
|
// this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
|
|
1598
|
-
return (h(Host, { key: '
|
|
1625
|
+
return (h(Host, { key: 'e693838d636553752143c9f0b85468fbc468d6a2', class: classes([
|
|
1599
1626
|
'zonos--address zonos--elements',
|
|
1600
1627
|
`zonos--${this.type}-address`,
|
|
1601
|
-
]) }, h("zonos-text", { key: '
|
|
1628
|
+
]) }, h("zonos-text", { key: '1983fa345e6720875f9fa37d293c7d26815de5a1', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), this.renderCompanyNameInput(), this.renderTaxIdInput(), this.renderCustomAddressForm()));
|
|
1602
1629
|
}
|
|
1603
1630
|
get el() { return getElement(this); }
|
|
1604
1631
|
static get watchers() { return {
|
|
@@ -1607,7 +1634,7 @@ const ZonosAddress = class {
|
|
|
1607
1634
|
"defaultAddress": ["defaultAddressChanged"],
|
|
1608
1635
|
"line1": ["line1Changed"],
|
|
1609
1636
|
"city": ["formFieldsChanged"],
|
|
1610
|
-
"country": ["formFieldsChanged"],
|
|
1637
|
+
"country": ["formFieldsChanged", "countryChanged"],
|
|
1611
1638
|
"firstName": ["formFieldsChanged"],
|
|
1612
1639
|
"lastName": ["formFieldsChanged"],
|
|
1613
1640
|
"line2": ["formFieldsChanged"],
|
|
@@ -875,6 +875,7 @@ const ZonosCheckout = class {
|
|
|
875
875
|
// Remove negative line items and move them to adjustments here, this is only for the deprecated `buildCartDetail` where negative line items are just treated as global discount amounts. It is up to the caller to create the right discount line items.
|
|
876
876
|
const cartItemsFiltered = cartItems.filter(item => item.amount >= 0);
|
|
877
877
|
const negativeItems = cartItems.filter(item => item.amount < 0);
|
|
878
|
+
log('cartItems', 'info', { cartItems });
|
|
878
879
|
const adjustments = negativeItems.map(item => ({
|
|
879
880
|
amount: item.amount,
|
|
880
881
|
currencyCode: item.currencyCode,
|