@zonos/elements 1.3.284 → 1.3.285
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/collection/components/checkout/zonos-checkout/zonos-checkout.js +1 -1
- package/dist/collection/components/common/zonos-stripe-phone-input/zonos-stripe-phone-input.js +1 -1
- package/dist/collection/components/main/zonos-controller.js +1 -1
- package/dist/collection/types/generated/graphql.internal.types.js +57 -0
- package/dist/esm/index.js +7 -7
- package/dist/esm-es5/index.js +1 -1
- package/dist/scripts/index.d.ts +35 -34
- package/dist/scripts/index.js +1 -1
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/types/scripts/cart/_setupCartDataWithSettings.d.ts +24 -24
- package/dist/types/types/generated/graphql.internal.types.d.ts +156 -91
- package/dist/types/types/generated/graphql.internal.types.ts +169 -84
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-2989da12.system.js → p-6695de06.system.js} +1 -1
- package/package.json +1 -1
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -133,7 +133,7 @@ const getZonosQaUrl = () => {
|
|
|
133
133
|
return null;
|
|
134
134
|
}
|
|
135
135
|
const qaUrl = extractZonosQaUrl(window.location.href);
|
|
136
|
-
const cdnUrl = "https://v1.3.
|
|
136
|
+
const cdnUrl = "https://v1.3.285.js.zonos.com";
|
|
137
137
|
// when the qaUrl is not set and the built URL is from the test domain, use the test domain for testing
|
|
138
138
|
if (!qaUrl &&
|
|
139
139
|
(cdnUrl.includes('test.') ||
|
|
@@ -399,10 +399,10 @@ const zonosLoadUrl = (() => {
|
|
|
399
399
|
return null;
|
|
400
400
|
})();
|
|
401
401
|
const startLoadTime = Date.now();
|
|
402
|
-
const ZONOS_URL = "https://v1.3.
|
|
403
|
-
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.
|
|
404
|
-
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.
|
|
405
|
-
const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.
|
|
402
|
+
const ZONOS_URL = "https://v1.3.285.js.zonos.com";
|
|
403
|
+
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.285";
|
|
404
|
+
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.285";
|
|
405
|
+
const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.285";
|
|
406
406
|
const GOOGLE_FONT_URL = 'https://fonts.googleapis.com';
|
|
407
407
|
const GOOGLE_FONT_REGEX = /^https:\/\/fonts\.googleapis\.com/;
|
|
408
408
|
class Zonos {
|
|
@@ -420,7 +420,7 @@ Zonos.iframeLogType = typeof window !== 'undefined'
|
|
|
420
420
|
? new URLSearchParams(window.location.search).get('iframeLogType')
|
|
421
421
|
: null;
|
|
422
422
|
Zonos.isBigCommerce = false;
|
|
423
|
-
Zonos.releaseDate = "
|
|
423
|
+
Zonos.releaseDate = "1787351938302";
|
|
424
424
|
Zonos.isLegacyCheckout = false;
|
|
425
425
|
Zonos.googleAnalyticId = null;
|
|
426
426
|
Zonos.googleAnalyticReady = false;
|
|
@@ -445,7 +445,7 @@ Zonos.isNpm = true;
|
|
|
445
445
|
Zonos.zonosQaUrl = null;
|
|
446
446
|
Zonos.zonosQaUrlApi = null;
|
|
447
447
|
Zonos.trackEventLogs = [];
|
|
448
|
-
Zonos.version = `v${"1.3.
|
|
448
|
+
Zonos.version = `v${"1.3.285"}`;
|
|
449
449
|
Zonos.modeAlerted = false;
|
|
450
450
|
Zonos.cartData = null;
|
|
451
451
|
Zonos.paypal = null;
|
|
@@ -2191,7 +2191,7 @@ export class ZonosCheckout {
|
|
|
2191
2191
|
"signature": "(session: CheckoutSessionDetailsFragment) => Promise<void>",
|
|
2192
2192
|
"parameters": [{
|
|
2193
2193
|
"name": "session",
|
|
2194
|
-
"type": "{ cartId: string | null; clientSecret: string; completedAt: string | null; customerProfile: { email: string | null; locations: { administrativeArea: string; countryCode: CountryCode; email: string | null; line1: string; line2: string | null;
|
|
2194
|
+
"type": "{ cartId: string | null; clientSecret: string; completedAt: string | null; customerProfile: { email: string | null; locations: { administrativeArea: string; countryCode: CountryCode; email: string | null; line1: string; line2: string | null; name: string | null; phone: string | null; locality: string; postalCode: string; }[] | null; name: string | null; storeCreditBalance: number | null; } | null; customerSessionClientSecret: string | null; id: string; landedCost: { amountSubtotals: { discounts: number | null; duties: number; fees: number; items: number; landedCostTotal: number; shipping: number; taxes: number; } | null; appliedAdjustments: { adjustment: { name: string | null; source: AdjustmentSource | null; } | null; amount: number; type: LandedCostAdjustmentType | null; item: { amount: number; } | null; }[] | null; currencyCode: CurrencyCode; deMinimis: { type: DeMinimisType; threshold: DeMinimisThreshold; method: IncotermCode; note: string; formula: string; }[]; duties: { amount: number; currencyCode: CurrencyCode; }[]; fees: { amount: number; currencyCode: CurrencyCode; }[]; landedCostGuaranteeCode: LandedCostGuaranteeCode; id: string; method: IncotermCode; remittance: { amount: number; description: string; }[]; rootId: string; shipmentRating: { amount: number; currencyCode: CurrencyCode; displayName: string; id: string; shippingProfile: { serviceLevel: { code: string; deliveryType: DeliveryType | null; }; transitTime: { guaranteedDelivery: string | null; max: number | null; min: number | null; type: TransitTypeCode | null; } | null; } | null; }; taxes: { amount: number; currencyCode: CurrencyCode; }[]; } | null; metadata: ({ key: string; value: string; } | null)[] | null; organizationId: string; paymentProcessor: CheckoutPaymentProcessorType | null; references: { inclusivePriceConfigurationId: string | null; } | null; subtotals: { adjustments: number; duties: number; exchangeRate: { id: string; rate: number; sourceCurrencyCode: CurrencyCode; targetCurrencyCode: CurrencyCode; type: ExchangeRateType; }; fees: number; items: number; landedCostTotal: number; presentmentCurrencyCode: CurrencyCode; shipping: number; storeCredit: number; taxes: number; total: number; }; varianceTestResults: { selectedVariantKey: string; testKey: string; }[] | null; }",
|
|
2195
2195
|
"docs": ""
|
|
2196
2196
|
}],
|
|
2197
2197
|
"references": {
|
package/dist/collection/components/common/zonos-stripe-phone-input/zonos-stripe-phone-input.js
CHANGED
|
@@ -268,7 +268,7 @@ export class ZonosStripePhoneInput {
|
|
|
268
268
|
"mutable": false,
|
|
269
269
|
"complexType": {
|
|
270
270
|
"original": "GenericZonosSettings['countryFields'] | null",
|
|
271
|
-
"resolved": "null | undefined | { EG: CountryFields; MO: CountryFields; PN: CountryFields; KG: CountryFields; LB: CountryFields; BH: CountryFields; ML: CountryFields; NO: CountryFields; CG: CountryFields; CM: CountryFields; MM: CountryFields; AQ: CountryFields; AX: CountryFields; CC: CountryFields; ER: CountryFields; PF: CountryFields; SO: CountryFields; SX: CountryFields; TO: CountryFields; AD: CountryFields; AE: CountryFields; AF: CountryFields; AG: CountryFields; AI: CountryFields; AL: CountryFields; AM: CountryFields; AO: CountryFields; AR: CountryFields; AS: CountryFields; AT: CountryFields; AU: CountryFields; AW: CountryFields; AZ: CountryFields; BA: CountryFields; BB: CountryFields; BD: CountryFields; BE: CountryFields; BF: CountryFields; BG: CountryFields; BI: CountryFields; BJ: CountryFields; BL: CountryFields; BM: CountryFields; BN: CountryFields; BO: CountryFields; BQ: CountryFields; BR: CountryFields; BS: CountryFields; BT: CountryFields; BV: CountryFields; BW: CountryFields; BY: CountryFields; BZ: CountryFields; CA: CountryFields; CD: CountryFields; CF: CountryFields; CH: CountryFields; CI: CountryFields; CK: CountryFields; CL: CountryFields; CN: CountryFields; CO: CountryFields; CR: CountryFields; CU: CountryFields; CV: CountryFields; CW: CountryFields; CX: CountryFields; CY: CountryFields; CZ: CountryFields; DE: CountryFields; DJ: CountryFields; DK: CountryFields; DM: CountryFields; DO: CountryFields; DZ: CountryFields; EC: CountryFields; EE: CountryFields; EH: CountryFields; ES: CountryFields; ET: CountryFields; FI: CountryFields; FJ: CountryFields; FK: CountryFields; FM: CountryFields; FO: CountryFields; FR: CountryFields; GA: CountryFields; GB: CountryFields; GD: CountryFields; GE: CountryFields; GF: CountryFields; GG: CountryFields; GH: CountryFields; GI: CountryFields; GL: CountryFields; GM: CountryFields; GN: CountryFields; GP: CountryFields; GQ: CountryFields; GR: CountryFields; GS: CountryFields; GT: CountryFields; GU: CountryFields; GW: CountryFields; GY: CountryFields; HK: CountryFields; HM: CountryFields; HN: CountryFields; HR: CountryFields; HT: CountryFields; HU: CountryFields; IC: CountryFields; ID: CountryFields; IE: CountryFields; IL: CountryFields; IM: CountryFields; IN: CountryFields; IO: CountryFields; IQ: CountryFields; IR: CountryFields; IS: CountryFields; IT: CountryFields; JE: CountryFields; JM: CountryFields; JO: CountryFields; JP: CountryFields; KE: CountryFields; KH: CountryFields; KI: CountryFields; KM: CountryFields; KN: CountryFields; KP: CountryFields; KR: CountryFields; KW: CountryFields; KY: CountryFields; KZ: CountryFields; LA: CountryFields; LC: CountryFields; LI: CountryFields; LK: CountryFields; LR: CountryFields; LS: CountryFields; LT: CountryFields; LU: CountryFields; LV: CountryFields; LY: CountryFields; MA: CountryFields; MC: CountryFields; MD: CountryFields; ME: CountryFields; MF: CountryFields; MG: CountryFields; MH: CountryFields; MK: CountryFields; MN: CountryFields; MP: CountryFields; MQ: CountryFields; MR: CountryFields; MS: CountryFields; MT: CountryFields; MU: CountryFields; MV: CountryFields; MW: CountryFields; MX: CountryFields; MY: CountryFields; MZ: CountryFields; NA: CountryFields; NC: CountryFields; NE: CountryFields; NF: CountryFields; NG: CountryFields; NI: CountryFields; NL: CountryFields; NP: CountryFields; NR: CountryFields; NU: CountryFields; NZ: CountryFields; OM: CountryFields; PA: CountryFields; PE: CountryFields; PG: CountryFields; PH: CountryFields; PK: CountryFields; PL: CountryFields; PM: CountryFields; PR: CountryFields; PS: CountryFields; PT: CountryFields; PW: CountryFields; PY: CountryFields; QA: CountryFields; RE: CountryFields; RO: CountryFields; RS: CountryFields; RU: CountryFields; RW: CountryFields; SA: CountryFields; SB: CountryFields; SC: CountryFields; SD: CountryFields; SE: CountryFields; SG: CountryFields; SH: CountryFields; SI: CountryFields; SJ: CountryFields; SK: CountryFields; SL: CountryFields; SM: CountryFields; SN: CountryFields; SR: CountryFields; SS: CountryFields; ST: CountryFields; SV: CountryFields; SY: CountryFields; SZ: CountryFields; TC: CountryFields; TD: CountryFields; TF: CountryFields; TG: CountryFields; TH: CountryFields; TJ: CountryFields; TK: CountryFields; TL: CountryFields; TM: CountryFields; TN: CountryFields; TR: CountryFields; TT: CountryFields; TV: CountryFields; TW: CountryFields; TZ: CountryFields; UA: CountryFields; UG: CountryFields; UM: CountryFields; US: CountryFields; UY: CountryFields; UZ: CountryFields; VA: CountryFields; VC: CountryFields; VE: CountryFields; VG: CountryFields; VI: CountryFields; VN: CountryFields; VU: CountryFields; WF: CountryFields; WS: CountryFields; YE: CountryFields; YT: CountryFields; ZA: CountryFields; ZM: CountryFields; ZW: CountryFields; }",
|
|
271
|
+
"resolved": "null | undefined | { EG: CountryFields; MO: CountryFields; PN: CountryFields; KG: CountryFields; LB: CountryFields; BH: CountryFields; ML: CountryFields; NO: CountryFields; CG: CountryFields; CM: CountryFields; MM: CountryFields; AQ: CountryFields; AX: CountryFields; CC: CountryFields; ER: CountryFields; PF: CountryFields; SO: CountryFields; SX: CountryFields; TO: CountryFields; AD: CountryFields; AE: CountryFields; AF: CountryFields; AG: CountryFields; AI: CountryFields; AL: CountryFields; AM: CountryFields; AO: CountryFields; AR: CountryFields; AS: CountryFields; AT: CountryFields; AU: CountryFields; AW: CountryFields; AZ: CountryFields; BA: CountryFields; BB: CountryFields; BD: CountryFields; BE: CountryFields; BF: CountryFields; BG: CountryFields; BI: CountryFields; BJ: CountryFields; BL: CountryFields; BM: CountryFields; BN: CountryFields; BO: CountryFields; BQ: CountryFields; BR: CountryFields; BS: CountryFields; BT: CountryFields; BV: CountryFields; BW: CountryFields; BY: CountryFields; BZ: CountryFields; CA: CountryFields; CD: CountryFields; CF: CountryFields; CH: CountryFields; CI: CountryFields; CK: CountryFields; CL: CountryFields; CN: CountryFields; CO: CountryFields; CR: CountryFields; CU: CountryFields; CV: CountryFields; CW: CountryFields; CX: CountryFields; CY: CountryFields; CZ: CountryFields; DE: CountryFields; DJ: CountryFields; DK: CountryFields; DM: CountryFields; DO: CountryFields; DZ: CountryFields; EC: CountryFields; EE: CountryFields; EH: CountryFields; ES: CountryFields; ET: CountryFields; FI: CountryFields; FJ: CountryFields; FK: CountryFields; FM: CountryFields; FO: CountryFields; FR: CountryFields; GA: CountryFields; GB: CountryFields; GD: CountryFields; GE: CountryFields; GF: CountryFields; GG: CountryFields; GH: CountryFields; GI: CountryFields; GL: CountryFields; GM: CountryFields; GN: CountryFields; GP: CountryFields; GQ: CountryFields; GR: CountryFields; GS: CountryFields; GT: CountryFields; GU: CountryFields; GW: CountryFields; GY: CountryFields; HK: CountryFields; HM: CountryFields; HN: CountryFields; HR: CountryFields; HT: CountryFields; HU: CountryFields; IC: CountryFields; ID: CountryFields; IE: CountryFields; IL: CountryFields; IM: CountryFields; IN: CountryFields; IO: CountryFields; IQ: CountryFields; IR: CountryFields; IS: CountryFields; IT: CountryFields; JE: CountryFields; JM: CountryFields; JO: CountryFields; JP: CountryFields; KE: CountryFields; KH: CountryFields; KI: CountryFields; KM: CountryFields; KN: CountryFields; KP: CountryFields; KR: CountryFields; KW: CountryFields; KY: CountryFields; KZ: CountryFields; LA: CountryFields; LC: CountryFields; LI: CountryFields; LK: CountryFields; LR: CountryFields; LS: CountryFields; LT: CountryFields; LU: CountryFields; LV: CountryFields; LY: CountryFields; MA: CountryFields; MC: CountryFields; MD: CountryFields; ME: CountryFields; MF: CountryFields; MG: CountryFields; MH: CountryFields; MK: CountryFields; MN: CountryFields; MP: CountryFields; MQ: CountryFields; MR: CountryFields; MS: CountryFields; MT: CountryFields; MU: CountryFields; MV: CountryFields; MW: CountryFields; MX: CountryFields; MY: CountryFields; MZ: CountryFields; NA: CountryFields; NC: CountryFields; NE: CountryFields; NF: CountryFields; NG: CountryFields; NI: CountryFields; NL: CountryFields; NP: CountryFields; NR: CountryFields; NU: CountryFields; NZ: CountryFields; OM: CountryFields; PA: CountryFields; PE: CountryFields; PG: CountryFields; PH: CountryFields; PK: CountryFields; PL: CountryFields; PM: CountryFields; PR: CountryFields; PS: CountryFields; PT: CountryFields; PW: CountryFields; PY: CountryFields; QA: CountryFields; RE: CountryFields; RO: CountryFields; RS: CountryFields; RU: CountryFields; RW: CountryFields; SA: CountryFields; SB: CountryFields; SC: CountryFields; SD: CountryFields; SE: CountryFields; SG: CountryFields; SH: CountryFields; SI: CountryFields; SJ: CountryFields; SK: CountryFields; SL: CountryFields; SM: CountryFields; SN: CountryFields; SR: CountryFields; SS: CountryFields; ST: CountryFields; SV: CountryFields; SY: CountryFields; SZ: CountryFields; TC: CountryFields; TD: CountryFields; TF: CountryFields; TG: CountryFields; TH: CountryFields; TJ: CountryFields; TK: CountryFields; TL: CountryFields; TM: CountryFields; TN: CountryFields; TR: CountryFields; TT: CountryFields; TV: CountryFields; TW: CountryFields; TZ: CountryFields; UA: CountryFields; UG: CountryFields; UM: CountryFields; US: CountryFields; UY: CountryFields; UZ: CountryFields; VA: CountryFields; VC: CountryFields; VE: CountryFields; VG: CountryFields; VI: CountryFields; VN: CountryFields; VU: CountryFields; WF: CountryFields; WS: CountryFields; XK: CountryFields; YE: CountryFields; YT: CountryFields; ZA: CountryFields; ZM: CountryFields; ZW: CountryFields; }",
|
|
272
272
|
"references": {
|
|
273
273
|
"GenericZonosSettings": {
|
|
274
274
|
"location": "import",
|
|
@@ -619,7 +619,7 @@ export class ZonosController {
|
|
|
619
619
|
"signature": "(countryCode: CountryCode) => Promise<void>",
|
|
620
620
|
"parameters": [{
|
|
621
621
|
"name": "countryCode",
|
|
622
|
-
"type": "\"EG\" | \"MO\" | \"PN\" | \"KG\" | \"LB\" | \"BH\" | \"ML\" | \"NO\" | \"CG\" | \"CM\" | \"MM\" | \"AQ\" | \"AX\" | \"CC\" | \"ER\" | \"PF\" | \"SO\" | \"SX\" | \"TO\" | \"AD\" | \"AE\" | \"AF\" | \"AG\" | \"AI\" | \"AL\" | \"AM\" | \"AO\" | \"AR\" | \"AS\" | \"AT\" | \"AU\" | \"AW\" | \"AZ\" | \"BA\" | \"BB\" | \"BD\" | \"BE\" | \"BF\" | \"BG\" | \"BI\" | \"BJ\" | \"BL\" | \"BM\" | \"BN\" | \"BO\" | \"BQ\" | \"BR\" | \"BS\" | \"BT\" | \"BV\" | \"BW\" | \"BY\" | \"BZ\" | \"CA\" | \"CD\" | \"CF\" | \"CH\" | \"CI\" | \"CK\" | \"CL\" | \"CN\" | \"CO\" | \"CR\" | \"CU\" | \"CV\" | \"CW\" | \"CX\" | \"CY\" | \"CZ\" | \"DE\" | \"DJ\" | \"DK\" | \"DM\" | \"DO\" | \"DZ\" | \"EC\" | \"EE\" | \"EH\" | \"ES\" | \"ET\" | \"FI\" | \"FJ\" | \"FK\" | \"FM\" | \"FO\" | \"FR\" | \"GA\" | \"GB\" | \"GD\" | \"GE\" | \"GF\" | \"GG\" | \"GH\" | \"GI\" | \"GL\" | \"GM\" | \"GN\" | \"GP\" | \"GQ\" | \"GR\" | \"GS\" | \"GT\" | \"GU\" | \"GW\" | \"GY\" | \"HK\" | \"HM\" | \"HN\" | \"HR\" | \"HT\" | \"HU\" | \"IC\" | \"ID\" | \"IE\" | \"IL\" | \"IM\" | \"IN\" | \"IO\" | \"IQ\" | \"IR\" | \"IS\" | \"IT\" | \"JE\" | \"JM\" | \"JO\" | \"JP\" | \"KE\" | \"KH\" | \"KI\" | \"KM\" | \"KN\" | \"KP\" | \"KR\" | \"KW\" | \"KY\" | \"KZ\" | \"LA\" | \"LC\" | \"LI\" | \"LK\" | \"LR\" | \"LS\" | \"LT\" | \"LU\" | \"LV\" | \"LY\" | \"MA\" | \"MC\" | \"MD\" | \"ME\" | \"MF\" | \"MG\" | \"MH\" | \"MK\" | \"MN\" | \"MP\" | \"MQ\" | \"MR\" | \"MS\" | \"MT\" | \"MU\" | \"MV\" | \"MW\" | \"MX\" | \"MY\" | \"MZ\" | \"NA\" | \"NC\" | \"NE\" | \"NF\" | \"NG\" | \"NI\" | \"NL\" | \"NP\" | \"NR\" | \"NU\" | \"NZ\" | \"OM\" | \"PA\" | \"PE\" | \"PG\" | \"PH\" | \"PK\" | \"PL\" | \"PM\" | \"PR\" | \"PS\" | \"PT\" | \"PW\" | \"PY\" | \"QA\" | \"RE\" | \"RO\" | \"RS\" | \"RU\" | \"RW\" | \"SA\" | \"SB\" | \"SC\" | \"SD\" | \"SE\" | \"SG\" | \"SH\" | \"SI\" | \"SJ\" | \"SK\" | \"SL\" | \"SM\" | \"SN\" | \"SR\" | \"SS\" | \"ST\" | \"SV\" | \"SY\" | \"SZ\" | \"TC\" | \"TD\" | \"TF\" | \"TG\" | \"TH\" | \"TJ\" | \"TK\" | \"TL\" | \"TM\" | \"TN\" | \"TR\" | \"TT\" | \"TV\" | \"TW\" | \"TZ\" | \"UA\" | \"UG\" | \"UM\" | \"US\" | \"UY\" | \"UZ\" | \"VA\" | \"VC\" | \"VE\" | \"VG\" | \"VI\" | \"VN\" | \"VU\" | \"WF\" | \"WS\" | \"YE\" | \"YT\" | \"ZA\" | \"ZM\" | \"ZW\"",
|
|
622
|
+
"type": "\"EG\" | \"MO\" | \"PN\" | \"KG\" | \"LB\" | \"BH\" | \"ML\" | \"NO\" | \"CG\" | \"CM\" | \"MM\" | \"AQ\" | \"AX\" | \"CC\" | \"ER\" | \"PF\" | \"SO\" | \"SX\" | \"TO\" | \"AD\" | \"AE\" | \"AF\" | \"AG\" | \"AI\" | \"AL\" | \"AM\" | \"AO\" | \"AR\" | \"AS\" | \"AT\" | \"AU\" | \"AW\" | \"AZ\" | \"BA\" | \"BB\" | \"BD\" | \"BE\" | \"BF\" | \"BG\" | \"BI\" | \"BJ\" | \"BL\" | \"BM\" | \"BN\" | \"BO\" | \"BQ\" | \"BR\" | \"BS\" | \"BT\" | \"BV\" | \"BW\" | \"BY\" | \"BZ\" | \"CA\" | \"CD\" | \"CF\" | \"CH\" | \"CI\" | \"CK\" | \"CL\" | \"CN\" | \"CO\" | \"CR\" | \"CU\" | \"CV\" | \"CW\" | \"CX\" | \"CY\" | \"CZ\" | \"DE\" | \"DJ\" | \"DK\" | \"DM\" | \"DO\" | \"DZ\" | \"EC\" | \"EE\" | \"EH\" | \"ES\" | \"ET\" | \"FI\" | \"FJ\" | \"FK\" | \"FM\" | \"FO\" | \"FR\" | \"GA\" | \"GB\" | \"GD\" | \"GE\" | \"GF\" | \"GG\" | \"GH\" | \"GI\" | \"GL\" | \"GM\" | \"GN\" | \"GP\" | \"GQ\" | \"GR\" | \"GS\" | \"GT\" | \"GU\" | \"GW\" | \"GY\" | \"HK\" | \"HM\" | \"HN\" | \"HR\" | \"HT\" | \"HU\" | \"IC\" | \"ID\" | \"IE\" | \"IL\" | \"IM\" | \"IN\" | \"IO\" | \"IQ\" | \"IR\" | \"IS\" | \"IT\" | \"JE\" | \"JM\" | \"JO\" | \"JP\" | \"KE\" | \"KH\" | \"KI\" | \"KM\" | \"KN\" | \"KP\" | \"KR\" | \"KW\" | \"KY\" | \"KZ\" | \"LA\" | \"LC\" | \"LI\" | \"LK\" | \"LR\" | \"LS\" | \"LT\" | \"LU\" | \"LV\" | \"LY\" | \"MA\" | \"MC\" | \"MD\" | \"ME\" | \"MF\" | \"MG\" | \"MH\" | \"MK\" | \"MN\" | \"MP\" | \"MQ\" | \"MR\" | \"MS\" | \"MT\" | \"MU\" | \"MV\" | \"MW\" | \"MX\" | \"MY\" | \"MZ\" | \"NA\" | \"NC\" | \"NE\" | \"NF\" | \"NG\" | \"NI\" | \"NL\" | \"NP\" | \"NR\" | \"NU\" | \"NZ\" | \"OM\" | \"PA\" | \"PE\" | \"PG\" | \"PH\" | \"PK\" | \"PL\" | \"PM\" | \"PR\" | \"PS\" | \"PT\" | \"PW\" | \"PY\" | \"QA\" | \"RE\" | \"RO\" | \"RS\" | \"RU\" | \"RW\" | \"SA\" | \"SB\" | \"SC\" | \"SD\" | \"SE\" | \"SG\" | \"SH\" | \"SI\" | \"SJ\" | \"SK\" | \"SL\" | \"SM\" | \"SN\" | \"SR\" | \"SS\" | \"ST\" | \"SV\" | \"SY\" | \"SZ\" | \"TC\" | \"TD\" | \"TF\" | \"TG\" | \"TH\" | \"TJ\" | \"TK\" | \"TL\" | \"TM\" | \"TN\" | \"TR\" | \"TT\" | \"TV\" | \"TW\" | \"TZ\" | \"UA\" | \"UG\" | \"UM\" | \"US\" | \"UY\" | \"UZ\" | \"VA\" | \"VC\" | \"VE\" | \"VG\" | \"VI\" | \"VN\" | \"VU\" | \"WF\" | \"WS\" | \"XK\" | \"YE\" | \"YT\" | \"ZA\" | \"ZM\" | \"ZW\"",
|
|
623
623
|
"docs": ""
|
|
624
624
|
}],
|
|
625
625
|
"references": {
|
|
@@ -534,6 +534,7 @@ export const answerProvenance = {
|
|
|
534
534
|
};
|
|
535
535
|
export const answerType = {
|
|
536
536
|
Boolean: 'BOOLEAN',
|
|
537
|
+
Checkbox: 'CHECKBOX',
|
|
537
538
|
Date: 'DATE',
|
|
538
539
|
Document: 'DOCUMENT',
|
|
539
540
|
MultiSelect: 'MULTI_SELECT',
|
|
@@ -982,11 +983,13 @@ export const carrierBillingInvoiceStatus = {
|
|
|
982
983
|
};
|
|
983
984
|
export const carrierCode = {
|
|
984
985
|
Apc: 'APC',
|
|
986
|
+
Asendia: 'ASENDIA',
|
|
985
987
|
AustraliaPost: 'AUSTRALIA_POST',
|
|
986
988
|
BermudaPost: 'BERMUDA_POST',
|
|
987
989
|
CanadaPost: 'CANADA_POST',
|
|
988
990
|
CyprusPost: 'CYPRUS_POST',
|
|
989
991
|
Dhl: 'DHL',
|
|
992
|
+
DhlEcommerce: 'DHL_ECOMMERCE',
|
|
990
993
|
DirectLink: 'DIRECT_LINK',
|
|
991
994
|
Ehub: 'EHUB',
|
|
992
995
|
Envia: 'ENVIA',
|
|
@@ -1168,9 +1171,14 @@ export const channelConnectionStatus = {
|
|
|
1168
1171
|
export const channelType = {
|
|
1169
1172
|
Amazon: 'AMAZON',
|
|
1170
1173
|
Bigcommerce: 'BIGCOMMERCE',
|
|
1174
|
+
CustomApi: 'CUSTOM_API',
|
|
1171
1175
|
Ebay: 'EBAY',
|
|
1172
1176
|
Etsy: 'ETSY',
|
|
1177
|
+
Magento: 'MAGENTO',
|
|
1178
|
+
Mirakl: 'MIRAKL',
|
|
1173
1179
|
Shopify: 'SHOPIFY',
|
|
1180
|
+
Walmart: 'WALMART',
|
|
1181
|
+
Walmartca: 'WALMARTCA',
|
|
1174
1182
|
Wix: 'WIX',
|
|
1175
1183
|
Woocommerce: 'WOOCOMMERCE',
|
|
1176
1184
|
};
|
|
@@ -1372,6 +1380,18 @@ export const commercialInvoiceItemUnitOfMeasure = {
|
|
|
1372
1380
|
Pound: 'POUND',
|
|
1373
1381
|
Yard: 'YARD',
|
|
1374
1382
|
};
|
|
1383
|
+
export const complianceObligationReason = {
|
|
1384
|
+
ContentChanged: 'CONTENT_CHANGED',
|
|
1385
|
+
Expired: 'EXPIRED',
|
|
1386
|
+
NewlyApplicable: 'NEWLY_APPLICABLE',
|
|
1387
|
+
VersionRelease: 'VERSION_RELEASE',
|
|
1388
|
+
};
|
|
1389
|
+
export const complianceObligationStatus = {
|
|
1390
|
+
Current: 'CURRENT',
|
|
1391
|
+
InProgress: 'IN_PROGRESS',
|
|
1392
|
+
NeedsReview: 'NEEDS_REVIEW',
|
|
1393
|
+
Unanswered: 'UNANSWERED',
|
|
1394
|
+
};
|
|
1375
1395
|
export const complianceProgramType = {
|
|
1376
1396
|
Fta: 'FTA',
|
|
1377
1397
|
Other: 'OTHER',
|
|
@@ -1947,6 +1967,7 @@ export const countryCode = {
|
|
|
1947
1967
|
Vu: 'VU',
|
|
1948
1968
|
Wf: 'WF',
|
|
1949
1969
|
Ws: 'WS',
|
|
1970
|
+
Xk: 'XK',
|
|
1950
1971
|
Ye: 'YE',
|
|
1951
1972
|
Yt: 'YT',
|
|
1952
1973
|
Za: 'ZA',
|
|
@@ -2270,16 +2291,28 @@ export const customsStage = {
|
|
|
2270
2291
|
InCustoms: 'IN_CUSTOMS',
|
|
2271
2292
|
PreCustoms: 'PRE_CUSTOMS',
|
|
2272
2293
|
};
|
|
2294
|
+
export const dangerousGoodsAccessibility = {
|
|
2295
|
+
Accessible: 'ACCESSIBLE',
|
|
2296
|
+
Inaccessible: 'INACCESSIBLE',
|
|
2297
|
+
};
|
|
2273
2298
|
export const dangerousGoodsCategory = {
|
|
2274
2299
|
BiologicalSubstance: 'BIOLOGICAL_SUBSTANCE',
|
|
2275
2300
|
ConsumerCommodity: 'CONSUMER_COMMODITY',
|
|
2276
2301
|
ExceptedQuantity: 'EXCEPTED_QUANTITY',
|
|
2302
|
+
FullyRegulated: 'FULLY_REGULATED',
|
|
2277
2303
|
LimitedQuantity: 'LIMITED_QUANTITY',
|
|
2278
2304
|
MagnetizedMaterial: 'MAGNETIZED_MATERIAL',
|
|
2279
2305
|
NotRestrictedA02: 'NOT_RESTRICTED_A02',
|
|
2280
2306
|
NotRestrictedA67: 'NOT_RESTRICTED_A67',
|
|
2281
2307
|
NotRestrictedA70: 'NOT_RESTRICTED_A70',
|
|
2282
2308
|
};
|
|
2309
|
+
export const dangerousGoodsOption = {
|
|
2310
|
+
HazardousMaterials: 'HAZARDOUS_MATERIALS',
|
|
2311
|
+
LimitedQuantitiesCommodities: 'LIMITED_QUANTITIES_COMMODITIES',
|
|
2312
|
+
OrmD: 'ORM_D',
|
|
2313
|
+
ReportableQuantities: 'REPORTABLE_QUANTITIES',
|
|
2314
|
+
SmallQuantityException: 'SMALL_QUANTITY_EXCEPTION',
|
|
2315
|
+
};
|
|
2283
2316
|
export const dashboardUnit = {
|
|
2284
2317
|
Imperial: 'IMPERIAL',
|
|
2285
2318
|
Metric: 'METRIC',
|
|
@@ -3628,9 +3661,11 @@ export const labelBrokerType = {
|
|
|
3628
3661
|
};
|
|
3629
3662
|
export const labelCarrierCode = {
|
|
3630
3663
|
Apc: 'APC',
|
|
3664
|
+
Asendia: 'ASENDIA',
|
|
3631
3665
|
AustraliaPost: 'AUSTRALIA_POST',
|
|
3632
3666
|
CanadaPost: 'CANADA_POST',
|
|
3633
3667
|
Dhl: 'DHL',
|
|
3668
|
+
DhlEcommerce: 'DHL_ECOMMERCE',
|
|
3634
3669
|
DirectLink: 'DIRECT_LINK',
|
|
3635
3670
|
Ehub: 'EHUB',
|
|
3636
3671
|
Envia: 'ENVIA',
|
|
@@ -3682,6 +3717,7 @@ export const labelDangerousGoodsCategory = {
|
|
|
3682
3717
|
BiologicalSubstance: 'BIOLOGICAL_SUBSTANCE',
|
|
3683
3718
|
ConsumerCommodity: 'CONSUMER_COMMODITY',
|
|
3684
3719
|
ExceptedQuantity: 'EXCEPTED_QUANTITY',
|
|
3720
|
+
FullyRegulated: 'FULLY_REGULATED',
|
|
3685
3721
|
LimitedQuantity: 'LIMITED_QUANTITY',
|
|
3686
3722
|
MagnetizedMaterial: 'MAGNETIZED_MATERIAL',
|
|
3687
3723
|
NotRestrictedA02: 'NOT_RESTRICTED_A02',
|
|
@@ -4311,6 +4347,7 @@ export const manifestSource = {
|
|
|
4311
4347
|
Api: 'API',
|
|
4312
4348
|
Ipc: 'IPC',
|
|
4313
4349
|
Other: 'OTHER',
|
|
4350
|
+
PddpReconciliation: 'PDDP_RECONCILIATION',
|
|
4314
4351
|
Post: 'POST',
|
|
4315
4352
|
Upu: 'UPU',
|
|
4316
4353
|
Usps: 'USPS',
|
|
@@ -4653,6 +4690,11 @@ export const packagingType = {
|
|
|
4653
4690
|
Polybag: 'POLYBAG',
|
|
4654
4691
|
Tube: 'TUBE',
|
|
4655
4692
|
};
|
|
4693
|
+
export const packingGroup = {
|
|
4694
|
+
I: 'I',
|
|
4695
|
+
Ii: 'II',
|
|
4696
|
+
Iii: 'III',
|
|
4697
|
+
};
|
|
4656
4698
|
export const packingPreference = {
|
|
4657
4699
|
AssignedBox: 'ASSIGNED_BOX',
|
|
4658
4700
|
Consolidated: 'CONSOLIDATED',
|
|
@@ -4684,6 +4726,11 @@ export const partyType = {
|
|
|
4684
4726
|
PortOfEntry: 'PORT_OF_ENTRY',
|
|
4685
4727
|
UltimateConsignee: 'ULTIMATE_CONSIGNEE',
|
|
4686
4728
|
};
|
|
4729
|
+
export const paymentAttributionSource = {
|
|
4730
|
+
InvoiceDetailReference: 'INVOICE_DETAIL_REFERENCE',
|
|
4731
|
+
InvoicePaymentMethod: 'INVOICE_PAYMENT_METHOD',
|
|
4732
|
+
OrderDetailReference: 'ORDER_DETAIL_REFERENCE',
|
|
4733
|
+
};
|
|
4687
4734
|
export const paymentInstrumentAccountHolderType = {
|
|
4688
4735
|
Company: 'COMPANY',
|
|
4689
4736
|
Individual: 'INDIVIDUAL',
|
|
@@ -4705,6 +4752,11 @@ export const paymentInstrumentType = {
|
|
|
4705
4752
|
export const paymentInstrumentVaultProvider = {
|
|
4706
4753
|
BasisTheory: 'BASIS_THEORY',
|
|
4707
4754
|
};
|
|
4755
|
+
export const paymentMethodRemoveType = {
|
|
4756
|
+
Airwallex: 'AIRWALLEX',
|
|
4757
|
+
Stripe_1: 'STRIPE_1',
|
|
4758
|
+
Stripe_2: 'STRIPE_2',
|
|
4759
|
+
};
|
|
4708
4760
|
export const paymentNetworkTokenStatus = {
|
|
4709
4761
|
Active: 'ACTIVE',
|
|
4710
4762
|
Inactive: 'INACTIVE',
|
|
@@ -5334,6 +5386,11 @@ export const questionnaireInferState = {
|
|
|
5334
5386
|
Partial: 'PARTIAL',
|
|
5335
5387
|
ReadyToAttest: 'READY_TO_ATTEST',
|
|
5336
5388
|
};
|
|
5389
|
+
export const questionnaireReleaseImpact = {
|
|
5390
|
+
Compatible: 'COMPATIBLE',
|
|
5391
|
+
Reanswer: 'REANSWER',
|
|
5392
|
+
Reattest: 'REATTEST',
|
|
5393
|
+
};
|
|
5337
5394
|
export const questionnaireStatus = {
|
|
5338
5395
|
Active: 'ACTIVE',
|
|
5339
5396
|
Deprecated: 'DEPRECATED',
|
package/dist/esm/index.js
CHANGED
|
@@ -131,7 +131,7 @@ const getZonosQaUrl = () => {
|
|
|
131
131
|
return null;
|
|
132
132
|
}
|
|
133
133
|
const qaUrl = extractZonosQaUrl(window.location.href);
|
|
134
|
-
const cdnUrl = "https://v1.3.
|
|
134
|
+
const cdnUrl = "https://v1.3.285.js.zonos.com";
|
|
135
135
|
// when the qaUrl is not set and the built URL is from the test domain, use the test domain for testing
|
|
136
136
|
if (!qaUrl &&
|
|
137
137
|
(cdnUrl.includes('test.') ||
|
|
@@ -397,10 +397,10 @@ const zonosLoadUrl = (() => {
|
|
|
397
397
|
return null;
|
|
398
398
|
})();
|
|
399
399
|
const startLoadTime = Date.now();
|
|
400
|
-
const ZONOS_URL = "https://v1.3.
|
|
401
|
-
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.
|
|
402
|
-
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.
|
|
403
|
-
const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.
|
|
400
|
+
const ZONOS_URL = "https://v1.3.285.js.zonos.com";
|
|
401
|
+
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.285";
|
|
402
|
+
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.285";
|
|
403
|
+
const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.285";
|
|
404
404
|
const GOOGLE_FONT_URL = 'https://fonts.googleapis.com';
|
|
405
405
|
const GOOGLE_FONT_REGEX = /^https:\/\/fonts\.googleapis\.com/;
|
|
406
406
|
class Zonos {
|
|
@@ -418,7 +418,7 @@ Zonos.iframeLogType = typeof window !== 'undefined'
|
|
|
418
418
|
? new URLSearchParams(window.location.search).get('iframeLogType')
|
|
419
419
|
: null;
|
|
420
420
|
Zonos.isBigCommerce = false;
|
|
421
|
-
Zonos.releaseDate = "
|
|
421
|
+
Zonos.releaseDate = "1787351938302";
|
|
422
422
|
Zonos.isLegacyCheckout = false;
|
|
423
423
|
Zonos.googleAnalyticId = null;
|
|
424
424
|
Zonos.googleAnalyticReady = false;
|
|
@@ -443,7 +443,7 @@ Zonos.isNpm = true;
|
|
|
443
443
|
Zonos.zonosQaUrl = null;
|
|
444
444
|
Zonos.zonosQaUrlApi = null;
|
|
445
445
|
Zonos.trackEventLogs = [];
|
|
446
|
-
Zonos.version = `v${"1.3.
|
|
446
|
+
Zonos.version = `v${"1.3.285"}`;
|
|
447
447
|
Zonos.modeAlerted = false;
|
|
448
448
|
Zonos.cartData = null;
|
|
449
449
|
Zonos.paypal = null;
|
package/dist/esm-es5/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,n,o,t){function r(e){return e instanceof o?e:new o((function(n){n(e)}))}return new(o||(o=Promise))((function(o,i){function a(e){try{c(t.next(e))}catch(e){i(e)}}function s(e){try{c(t["throw"](e))}catch(e){i(e)}}function c(e){e.done?o(e.value):r(e.value).then(a,s)}c((t=t.apply(e,n||[])).next())}))};var __generator=this&&this.__generator||function(e,n){var o={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},t,r,i,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(n){return c([e,n])}}function c(s){if(t)throw new TypeError("Generator is already executing.");while(a&&(a=0,s[0]&&(o=0)),o)try{if(t=1,r&&(i=s[0]&2?r["return"]:s[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;if(r=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:o.label++;return{value:s[1],done:false};case 5:o.label++;r=s[1];s=[0];continue;case 7:s=o.ops.pop();o.trys.pop();continue;default:if(!(i=o.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){o=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(s[0]===6&&o.label<i[1]){o.label=i[1];i=s;break}if(i&&o.label<i[2]){o.label=i[2];o.ops.push(s);break}if(i[2])o.ops.pop();o.trys.pop();continue}s=n.call(e,o)}catch(e){s=[6,e];r=0}finally{t=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,n,o){if(o||arguments.length===2)for(var t=0,r=n.length,i;t<r;t++){if(i||!(t in n)){if(!i)i=Array.prototype.slice.call(n,0,t);i[t]=n[t]}}return e.concat(i||Array.prototype.slice.call(n))};import{c as createCustomEvent}from"./createCustomEvent-58159025.js";import{g as getGenericSettingsOverride,I as IframeService}from"./getGenericSettingsOverride-0bc3e118.js";import{l as log}from"./VarianceTest-572cecf5.js";export{a as availableTestKeys}from"./VarianceTest-572cecf5.js";import{g as getIsTestMode,a as getIsStagingMode,h as handleFetch,l as logError}from"./handleFetch-a844cac1.js";import{g as getAbandonedCartRenewTokenValue,_ as _getIsValidCartId,c as checkoutHiddenBtnSelector,a as checkoutHiddenInternationalBtnSelector}from"./CheckoutConfig-724d7bae.js";export{c as checkoutHiddenBtnSelector,a as checkoutHiddenInternationalBtnSelector,d as domesticRedirectedBtnSelector}from"./CheckoutConfig-724d7bae.js";export{c as countryRequireShortAddressCode}from"./ShortAddressCode-7620e622.js";export{c as countryRequireTaxId,e as euCountryCodes,s as shipToTaxIdLabels}from"./TaxId-63a14057.js";var checkIfLoadVersionDomain=function(e){var n=e.loadScriptSrc;if(!n){return{currentLoadScriptUrl:"",isForceLoadVersionDomain:false,isWhiteListed:false}}var o=["dev.elements.zonos.com","dev.assets-checkout.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"];var t=["qa.js.zonos.com"];var r=new URL(n).origin;var i=o.some((function(e){return r.includes(e)}));var a=t.some((function(e){return r.includes(e)}));return{currentLoadScriptUrl:r,isForceLoadVersionDomain:a,isWhiteListed:i}};var fallbackList=["jsdelivr","cdnjs","unpkg","vercel"];var MAIN_LOAD_CDN_TYPE="jsdelivr";var getNextFallbackUrl=function(e){var n=fallbackList.indexOf(e);var o=fallbackList[n+1];return o||null};var getWithTestPublicCredential=function(){return __awaiter(void 0,void 0,void 0,(function(){var e,n,o,t,r,i;return __generator(this,(function(a){switch(a.label){case 0:e=getIsTestMode();n=getIsStagingMode();if(!e&&!n||!window.Zonos.zonosApiKey){return[2,null]}log("[ZONOS - loadZonos] Attempt test public credential","info");if(!!window.Zonos.zonosApiKey.includes("credential_test")){log("[ZONOS - loadZonos] Test mode is enabled but the API key is already a test key","info");return[2,null]}return[4,handleFetch("/api/get-test-public-credential")];case 1:o=a.sent(),t=o.errors,r=o.json;if(t.length||!r){logError("[ZONOS - loadZonos] Failed to get test public credential. Keep using production key",t);return[2,null]}i=r.publicCredential;if(!i){logError("[ZONOS - loadZonos] No test public key credential. Keep using production key");return[2,null]}log("[ZONOS - loadZonos] Retrieve new test public token ".concat(i),"info");return[2,i]}}))}))};var extractZonosQaUrl=function(e){if(!e){return null}var n=new URL(e).searchParams;var o=n.get("zonosQaUrl");if(!o){return null}var t=/[^a-zA-Z0-9-_]+/.test(o);if(!!t){return null}return o};var getZonosQaUrl=function(){var e=window&&window.location.href.includes("forceLoadCdn");if(typeof window==="undefined"||e){return null}var n=extractZonosQaUrl(window.location.href);var o="https://v1.3.284.js.zonos.com";if(!n&&(o.includes("test.")||o.includes("test-"))){return o}if(!n&&["dev.demo.elements.zonos.com","dev.checkout.elements.zonos.com","dev.storybook.elements.zonos.com"].includes(window.location.hostname)){return"https://dev.elements.zonos.com"}if(!n){return null}if(n==="dev-elements"){return"https://dev.elements.zonos.com"}var t="preview.js.zonos.com";var r="https://".concat(n,".").concat(t);log("[ZONOS-WARNING] using '".concat(r,"' for loading elements script"),"warn");void fetch(r).then((function(){window.sessionStorage.removeItem("zonos--checkout-session-id");window.sessionStorage.removeItem("zonos--client-secret")})).catch((function(){alert("[ZONOS-WARNING] '".concat(r,"' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE"));var e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");var n=window.location.pathname;var o="".concat(n,"?").concat(e.toString());window.history.replaceState(window.history.state,"",o);window.location.reload();return null}));return r};var V3_URL="https://js.stripe.com/v3";var V3_URL_REGEX=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/;var EXISTING_SCRIPT_MESSAGE="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";var zonosStripeFindScript=function(){var e=document.querySelectorAll('script[src^="'.concat(V3_URL,'"]'));for(var n=0;n<e.length;n++){var o=e[n];if(!o){continue}if(!V3_URL_REGEX.test(o.src)){continue}return o}return null};var stripePromise$1=null;var injectScript=function(e){var n=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"";var o=document.createElement("script");o.src="".concat(V3_URL).concat(n);var t=document.head||document.body;if(!t){logError("Expected document.body not to be null. Stripe.js requires a <body> element.");return null}t.appendChild(o);return o};var zonosStripeLoadScript=function(e){if(stripePromise$1!==null){return stripePromise$1}stripePromise$1=new Promise((function(n,o){if(typeof window==="undefined"||typeof document==="undefined"){n(null);return}if(window.Stripe&&e){console.warn(EXISTING_SCRIPT_MESSAGE)}if(window.Stripe){n(window.Stripe);return}try{var t=zonosStripeFindScript();if(t&&e){console.warn(EXISTING_SCRIPT_MESSAGE)}else if(!t){t=injectScript(e)}t===null||t===void 0?void 0:t.addEventListener("load",(function(){if(window.Stripe){n(window.Stripe)}else{o(new Error("Stripe.js not available"))}}));t===null||t===void 0?void 0:t.addEventListener("error",(function(){o(new Error("Failed to load Stripe.js"))}))}catch(e){o(e);return}}));return stripePromise$1};var registerWrapper=function(e,n){if(!e||!e._registerWrapper){return}e._registerWrapper({name:"stripe-js",startTime:n})};var initStripe=function(e,n,o){if(e===null){return null}var t=e.apply(undefined,n);registerWrapper(t,o);return t};var hasCheckoutCartCallback=function(){var e,n;return typeof window!=="undefined"&&(typeof((e=window.Zonos)===null||e===void 0?void 0:e.createCartId)==="function"||typeof((n=window.Zonos)===null||n===void 0?void 0:n.buildCartDetail)==="function")};var stripePromise=Promise.resolve().then((function(){if(!hasCheckoutCartCallback()){return null}return zonosStripeLoadScript(null)}));var loadCalled=false;stripePromise.catch((function(e){if(!loadCalled){console.warn(e)}}));var zonosLoadStripe=function(){var e=[];for(var n=0;n<arguments.length;n++){e[n]=arguments[n]}return __awaiter(void 0,void 0,void 0,(function(){var n,o,t,r;return __generator(this,(function(i){switch(i.label){case 0:loadCalled=true;o=Date.now();return[4,stripePromise];case 1:if(!((n=i.sent())!==null&&n!==void 0))return[3,2];r=n;return[3,4];case 2:return[4,zonosStripeLoadScript(null)];case 3:r=i.sent();i.label=4;case 4:t=r;return[2,initStripe(t,e,o)]}}))}))};var TEMP_CART_ID_QUERY_PARAM="tempCartUUID";var getCartIdFromQueryParam=function(){var e=new URLSearchParams(window.location.search);var n=e.get(TEMP_CART_ID_QUERY_PARAM);return n};var getCartInfoById=function(e){return __awaiter(void 0,[e],void 0,(function(e){var n,o,t,r,i,a,s,c,u;var d=e.cartId,l=e.retries;return __generator(this,(function(e){switch(e.label){case 0:n=getIsTestMode();o=getGenericSettingsOverride();t=getAbandonedCartRenewTokenValue()||undefined;r=new URLSearchParams;if(o.overrideShouldEnabledCustomAddress){r.set("overrideShouldEnabledCustomAddress",o.overrideShouldEnabledCustomAddress)}return[4,handleFetch("/api/zonos-elements/get-cart?".concat(r.toString()),{body:{isTestMode:n,renewCartExpirationToken:t,tempCartUUID:d},headers:{"Content-Type":"application/json"},method:"POST"})];case 1:i=e.sent(),a=i.errors,s=i.json,c=i.zonosMode;u=!s||a.length;if(!(u&&l))return[3,3];log("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:l});return[4,new Promise((function(e){return setTimeout(e,500)}))];case 2:e.sent();return[2,getCartInfoById({cartId:d,retries:l-1})];case 3:if(u){return[2,null]}return[2,Object.assign(Object.assign({},s),{zonosMode:c})]}}))}))};var setupCartDataWithSettings=function(e){return __awaiter(void 0,void 0,void 0,(function(){var n,o,t,r;return __generator(this,(function(i){switch(i.label){case 0:n=_getIsValidCartId(e),o=n.isDgsCartId,t=n.isLegacyCartId;if(!t&&!o){logError("[ZONOS - loadZonos] invalid cart id");return[2,null]}return[4,getCartInfoById({cartId:e,retries:5})];case 1:r=i.sent();log("[ZONOS - loadZonos] getting temp cart data","info",r);if(!r){logError("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process.");return[2,null]}window.Zonos.storeId=r.cartData.storeId;window.Zonos.zonosApiKey=r.cartData.credentialToken;window.Zonos.zonosMode=r.zonosMode;return[2,{cartData:r.cartData,settings:r.settings,storeFavicon:r.storeFaviconUrl,storeId:r.cartData.storeId,storeLogo:r.storeLogoUrl,zonosApiKey:r.cartData.credentialToken}]}}))}))};var _a;var zonosLoadUrl=function(){if(typeof document==="undefined"){return null}var e=document.querySelector('script[src*="/zonos.js"]');var n=checkIfLoadVersionDomain({loadScriptSrc:e===null||e===void 0?void 0:e.src}),o=n.currentLoadScriptUrl,t=n.isWhiteListed;if(t){return o}return null}();var startLoadTime=Date.now();var ZONOS_URL="https://v1.3.284.js.zonos.com";var JS_DELIVR_ZONOS_URL=zonosLoadUrl||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.284";var UNPKG_ZONOS_URL="https://unpkg.com/@zonos/elements@1.3.284";var CDNJS_ZONOS_URL="https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.284";var GOOGLE_FONT_URL="https://fonts.googleapis.com";var GOOGLE_FONT_REGEX=/^https:\/\/fonts\.googleapis\.com/;var Zonos=function(){function e(){}return e}();_a=Zonos;Zonos.doneInit=false;Zonos.cartSettings=null;Zonos.debug=typeof window!=="undefined"&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/);Zonos.zonosConversionTest=typeof window!=="undefined"&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/);Zonos._paypalMockResponse=null;Zonos.iframeLogType=typeof window!=="undefined"?new URLSearchParams(window.location.search).get("iframeLogType"):null;Zonos.isBigCommerce=false;Zonos.releaseDate="1787002350863";Zonos.isLegacyCheckout=false;Zonos.googleAnalyticId=null;Zonos.googleAnalyticReady=false;Zonos.facebookPixelId=null;Zonos.facebookPixelReady=false;Zonos.startLoadTime=startLoadTime;Zonos.domain=typeof window!=="undefined"?window.location!=window.parent.location&&document.referrer||document.location.hostname:"";Zonos.showBaseForeign=typeof window!=="undefined"&&window.location.search.includes("zonosShowBaseForeign");Zonos.overrideUseCustomAddressForm=false;Zonos.isCollect=false;Zonos.isInvoice=false;Zonos.isNpm=true;Zonos.zonosQaUrl=null;Zonos.zonosQaUrlApi=null;Zonos.trackEventLogs=[];Zonos.version="v".concat("1.3.284");Zonos.modeAlerted=false;Zonos.cartData=null;Zonos.paypal=null;Zonos.zonosMode=null;Zonos.IframeService=IframeService;Zonos.getCurrentTimestamp=function(){return(new Date).getTime()};Zonos.zonosController=null;Zonos.loadTimeApiInfoList=[];Zonos.logIntervalId=null;Zonos.init=function(e){return __awaiter(void 0,void 0,void 0,(function(){var n,o,t,r,i,a,s,c,u,d,l,f,v,m,_;return __generator(this,(function(p){switch(p.label){case 0:n=e.appearance,o=e.checkoutSettings,t=e.currencyConverter,r=e.helloSettings,i=e.onCountryChange,a=e.overrideCurrencyFormat,s=e.storeId,c=e.zonosApiKey;_a.cartId=getCartIdFromQueryParam();_a.createCartId=o===null||o===void 0?void 0:o.createCartId;_a.buildCartDetail=o===null||o===void 0?void 0:o.buildCartDetail;if(_a.doneInit){return[2]}log("====== ZONOS DEBUG MODE: on (".concat(_a.version,") ======"));_a.zonosApiKey=c;_a.storeId=s;if(typeof window!=="undefined"&&window.parent===window){_a.googleAnalyticReady=true;_a.facebookPixelReady=true}if(!_a.isNpm)return[3,4];log("====== ZONOS LOADING FROM NPM ======");u=getZonosQaUrl();if(u&&!window.isZonosPreview){log('====== RE-INJECT "zonos.js" FROM PRVIEW: '.concat(u," ======"),"info");d=document.createElement("script");d.src="".concat(u,"/dist/scripts/zonos.js");document.head.appendChild(d);d.addEventListener("load",(function(){window.Zonos.isNpm=_a.isNpm;window.Zonos.isBigCommerce=_a.isBigCommerce;window.Zonos.isLegacyCheckout=_a.isLegacyCheckout;window.Zonos.zonosMode=_a.zonosMode;void window.Zonos.init(e)}));d.addEventListener("error",(function(){alert('[ZONOS - loadZonos] Failed to load "loadZonos.js" from zonosQaUrl: '.concat(u))}));window.isZonosPreview=true;return[2]}if(!c&&!_a.cartId){logError("Zonos API key is required unless `tempCartUUID` is provided in url query params.");return[2]}if(!(!_a.cartData&&_a.cartId))return[3,2];log("Initialize cart data");return[4,setupCartDataWithSettings(_a.cartId)];case 1:l=p.sent();if(!l){logError("Failed to get cart data");return[2]}_a.cartData=l.cartData;_a.zonosApiKey=l.zonosApiKey;_a.cartSettings=l.settings;p.label=2;case 2:return[4,getWithTestPublicCredential()];case 3:f=p.sent();if(f){_a.zonosApiKey=f}p.label=4;case 4:v=new URL(window.location.href).searchParams.get("payment_intent_client_secret")||sessionStorage.getItem("zonos--client-secret");m=_a.cartId&&_a.cartData||!!v;if(m){log("Cart data or stripe client secret is available, inject hidden button and trigger checkout");_=document.createElement("button");_.style.display="none";_.id="".concat(checkoutHiddenBtnSelector);document.body.appendChild(_)}log("init zonos");_a.restoreNativeBrowserFunctions();_a.injectCustomScriptForHostedCheckout();_a.injectZonosCdn();_a.injectZonosCss();_a.injectFonts();_a.injectCheckoutInternationalButton();_a.injectController({config:{appearance:n,checkoutSettings:o,currencyConverter:t,helloSettings:r,onCountryChange:i,overrideCurrencyFormat:a}});_a.doneInit=true;return[2]}}))}))};Zonos.injectCheckoutInternationalButton=function(){if(!document.querySelector("#".concat(checkoutHiddenInternationalBtnSelector))){var e=document.createElement("button");e.id=checkoutHiddenInternationalBtnSelector;e.style.display="none";document.body.appendChild(e)}};Zonos.injectCustomScriptForHostedCheckout=function(){var e=_a.cartData;var n=(e===null||e===void 0?void 0:e.metadata)||[];var o=n.find((function(e){return e.key==="customHeaderScript"}));var t=n.find((function(e){return e.key==="customFooterScript"}));if(!window.Zonos.isLegacyCheckout||!o&&!t){log("Skip injecting custom script for hosted checkout","info",{footerScript:t,headerScript:o,isLegacyCheckout:window.Zonos.isLegacyCheckout});return}if(o){log("Injecting custom header script");var r=document.createElement("script");r.textContent=o.value;document.head.appendChild(r)}if(t){log("Injecting custom footer script");var r=document.createElement("script");r.textContent=t.value;document.body.appendChild(r)}};Zonos.displayCurrency=function(){var e=document.querySelector("zonos-hello");if(e){void e.displayCurrency()}};Zonos.triggerCheckoutInternational=function(){return __awaiter(void 0,void 0,void 0,(function(){var e;return __generator(this,(function(n){e=document.querySelector("#".concat(checkoutHiddenInternationalBtnSelector));setTimeout((function(){if(e){e.dispatchEvent(createCustomEvent("click"))}}),10);return[2]}))}))};Zonos.openHelloDialog=function(e){var n=document.querySelector("zonos-hello");if(n){void n.openHelloDialog(e!==null&&e!==void 0?e:true)}};Zonos.showNotification=function(e){var n;void((n=_a.zonosController)===null||n===void 0?void 0:n.showNotification(e))};Zonos.updateOrganizationName=function(e){var n;void((n=_a.zonosController)===null||n===void 0?void 0:n.updateOrganizationName(e))};Zonos.disablePlaceOrderButtons=function(e){var n=e.autoEnable,o=n===void 0?true:n,t=e.config,r=e.disable,i=e.placeOrderButtonSelector;var a;if((a=t.checkoutSettings)===null||a===void 0?void 0:a.disablePlaceOrderButtonActivation){return}if(i){var s=document.querySelectorAll(i);var c=function(e){var n=e.target;if(n.getAttribute("disabled")){e.preventDefault();e.stopPropagation()}};s.forEach((function(e){var n=e.getAttribute("data-zonos-checkout-attached");if(n){return}if(r){e.setAttribute("disabled","true");e.addEventListener("click",c)}else{e.removeAttribute("disabled");e.removeEventListener("click",c)}}));if(o&&r){setTimeout((function(){s.forEach((function(e){e.removeAttribute("disabled");e.removeEventListener("click",c)}))}),5e3)}}};Zonos.restoreNativeBrowserFunctions=function(){var e;var n=new URL(window.location.href).searchParams.get("useMerchantPolyfill")==="1";if(n){return}var o="zonos---native-browser";var t=document.querySelector("iframe#".concat(o));if(!t){t=document.createElement("iframe");t.id=o;t.style.display="none";t.style.opacity="0";t.style.position="absolute";t.style.top="-9999px";t.style.left="-9999px";t.style.width="1px";t.style.height="1px";t.style.border="none";t.style.overflow="hidden";t.style.visibility="hidden";document.body.appendChild(t)}var r=((e=t.contentWindow)===null||e===void 0?void 0:e.window.Array.from)||Array.from;Array.from=r;document.body.removeChild(t)};Zonos.injectController=function(e){var n=e.config;var o,t;if(document.querySelector("zonos-controller")){return}if((o=n.checkoutSettings)===null||o===void 0?void 0:o.placeOrderButtonSelector){var r=n.checkoutSettings.placeOrderButtonSelector;_a.disablePlaceOrderButtons({config:n,disable:true,placeOrderButtonSelector:r});var i=new MutationObserver((function(){_a.disablePlaceOrderButtons({config:n,disable:true,placeOrderButtonSelector:r})}));i.observe(document.body,{childList:true,subtree:true})}if((t=n.checkoutSettings)===null||t===void 0?void 0:t.alwaysTriggerInternationalCheckoutSelector){var a=n.checkoutSettings.alwaysTriggerInternationalCheckoutSelector;_a.disablePlaceOrderButtons({config:n,disable:true,placeOrderButtonSelector:a});var i=new MutationObserver((function(){_a.disablePlaceOrderButtons({config:n,disable:true,placeOrderButtonSelector:a})}));i.observe(document.body,{childList:true,subtree:true})}var s=document.createElement("zonos-controller");s.config=n;s.zonosApiKey=_a.zonosApiKey||"";s.addEventListener("stripeInitEvent",(function(e){return __awaiter(void 0,void 0,void 0,(function(){var n,o;return __generator(this,(function(t){switch(t.label){case 0:n=e.detail;log("loading Stripe");return[4,zonosLoadStripe(n.publishableKey)];case 1:o=t.sent();if(!o){logError("API seems to be invalid or missing. Failed to load Stripe");return[2]}window.Zonos.stripe=o;if(window.Zonos.isCollect){void s.initCollectElement(o)}else if(window.Zonos.isInvoice){void s.initInvoiceElement(o)}else{void s.initCheckoutElement(o)}return[2]}}))}))}));document.body.appendChild(s);_a.zonosController=s;log("Zonos controller injected!")};Zonos.injectScript=function(e){var n=e.cdnType,o=e.isModule,t=e.theRestUrl;var r=_a.getZonosUrl(n);var i="".concat(r,"/").concat(t);var a=function(){var e=document.querySelector('script[src="'.concat(i,'"]'));return!!e};if(a()){log('Zonos script "'.concat(i,'" already exists in the document'),"warn");return}var s=document.head||document.body;var c=document.createElement("script");if(!!o){c.type="module"}else{c.noModule=true}c.src=i;c.crossOrigin="anonymous";c.onerror=function(){logError("Failed to load ".concat(c.src));var e=getNextFallbackUrl(n);if(!e){return}_a.injectScript({cdnType:e,isModule:o,theRestUrl:t})};s.appendChild(c)};Zonos.getZonosUrl=function(e){var n=function(){switch(e){case"jsdelivr":return JS_DELIVR_ZONOS_URL;case"unpkg":return UNPKG_ZONOS_URL;case"cdnjs":return CDNJS_ZONOS_URL;case"vercel":return ZONOS_URL}};if(_a.isNpm){var o=getZonosQaUrl();return o||n()}return n()};Zonos.injectZonosCdn=function(){_a.injectScript({cdnType:MAIN_LOAD_CDN_TYPE,isModule:true,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"});_a.injectScript({cdnType:MAIN_LOAD_CDN_TYPE,isModule:false,theRestUrl:"dist/zonos-elements/zonos-elements.js"});log("Zonos cdn script injected!")};Zonos.injectStylesheet=function(e){var n=e.cdnType,o=e.theRestUrl;var t=_a.getZonosUrl(n);var r=document.head||document.body;var i=document.createElement("link");i.rel="preconnect";i.href="".concat(ZONOS_URL,"/");r.appendChild(i);var a=document.createElement("link");a.rel="stylesheet";a.href="".concat(t,"/").concat(o);a.onerror=function(){logError("Failed to load ".concat(a.href));var e=getNextFallbackUrl(n);if(!e){return}_a.injectStylesheet({cdnType:e,theRestUrl:o})};r.appendChild(a)};Zonos.injectZonosCss=function(){var e=function(){return!!document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')};if(e()){log("Zonos style links already injected","warn");return}_a.injectStylesheet({cdnType:MAIN_LOAD_CDN_TYPE,theRestUrl:"dist/zonos-elements/zonos-elements.css"});log("Zonos style css injected!")};Zonos.injectFonts=function(){var e=function(){var e=document.fonts.check("1em Inter");if(e){log("Inter font already loaded","warn");return}var n=document.querySelectorAll('link[rel="stylesheet"][href^="'.concat(GOOGLE_FONT_URL,'"]'));for(var o=0;o<n.length;o++){var t=n[o];if(!t){continue}if(GOOGLE_FONT_REGEX.test(t.href)){continue}return t}return null};if(e()){log("Inter font already injected","warn");return}var n=document.head||document.body;var o=document.createElement("link");o.rel="preconnect";o.href=GOOGLE_FONT_URL;n.appendChild(o);var t=document.createElement("link");t.rel="stylesheet";t.href="".concat(GOOGLE_FONT_URL,"/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap");n.appendChild(t);log("Zonos font injected!")};Zonos.setupGoogleFont=function(e){var n;void((n=_a.zonosController)===null||n===void 0?void 0:n.setupGoogleFont(e))};Zonos.injectSupportGoogleFont=function(e){var n;log("[FONT] injecting ".concat(e));var o=(n=e.match(/family=(.*?):/))===null||n===void 0?void 0:n[1];var t=document.head||document.body;if(!document.querySelector('link[rel="preconnect"][href^="'.concat(GOOGLE_FONT_URL,'"]'))){var r=document.createElement("link");r.rel="preconnect";r.href=GOOGLE_FONT_URL;t.appendChild(r)}if(document.querySelector('link[rel="stylesheet"][href="'.concat(e,'"]'))){log("[FONT] ".concat(o," font already injected"),"warn");return}var i=document.createElement("link");i.rel="stylesheet";i.href=e;t.appendChild(i);log("[FONT] ".concat(o," font injected!"))};var checkoutSessionMutableAttributeKeys=["ZONOS_FORM_TYPE_USING","APP_VERSION","APP_VERSION_NPM_INTEGRATION","LEGACY_CHECKOUT_FACADE"];var checkoutSessionImmutableAttributeKeys=["ORDER_DUPLICATION_CONSENT","WITH_ABANDONED_CART_TOKEN"];var checkoutSessionAttributeKeys=__spreadArray(__spreadArray([],checkoutSessionMutableAttributeKeys,true),checkoutSessionImmutableAttributeKeys,true);export{Zonos,checkoutSessionAttributeKeys,checkoutSessionImmutableAttributeKeys,checkoutSessionMutableAttributeKeys};
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,n,o,t){function r(e){return e instanceof o?e:new o((function(n){n(e)}))}return new(o||(o=Promise))((function(o,i){function a(e){try{c(t.next(e))}catch(e){i(e)}}function s(e){try{c(t["throw"](e))}catch(e){i(e)}}function c(e){e.done?o(e.value):r(e.value).then(a,s)}c((t=t.apply(e,n||[])).next())}))};var __generator=this&&this.__generator||function(e,n){var o={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},t,r,i,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(n){return c([e,n])}}function c(s){if(t)throw new TypeError("Generator is already executing.");while(a&&(a=0,s[0]&&(o=0)),o)try{if(t=1,r&&(i=s[0]&2?r["return"]:s[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;if(r=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:o.label++;return{value:s[1],done:false};case 5:o.label++;r=s[1];s=[0];continue;case 7:s=o.ops.pop();o.trys.pop();continue;default:if(!(i=o.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){o=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(s[0]===6&&o.label<i[1]){o.label=i[1];i=s;break}if(i&&o.label<i[2]){o.label=i[2];o.ops.push(s);break}if(i[2])o.ops.pop();o.trys.pop();continue}s=n.call(e,o)}catch(e){s=[6,e];r=0}finally{t=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,n,o){if(o||arguments.length===2)for(var t=0,r=n.length,i;t<r;t++){if(i||!(t in n)){if(!i)i=Array.prototype.slice.call(n,0,t);i[t]=n[t]}}return e.concat(i||Array.prototype.slice.call(n))};import{c as createCustomEvent}from"./createCustomEvent-58159025.js";import{g as getGenericSettingsOverride,I as IframeService}from"./getGenericSettingsOverride-0bc3e118.js";import{l as log}from"./VarianceTest-572cecf5.js";export{a as availableTestKeys}from"./VarianceTest-572cecf5.js";import{g as getIsTestMode,a as getIsStagingMode,h as handleFetch,l as logError}from"./handleFetch-a844cac1.js";import{g as getAbandonedCartRenewTokenValue,_ as _getIsValidCartId,c as checkoutHiddenBtnSelector,a as checkoutHiddenInternationalBtnSelector}from"./CheckoutConfig-724d7bae.js";export{c as checkoutHiddenBtnSelector,a as checkoutHiddenInternationalBtnSelector,d as domesticRedirectedBtnSelector}from"./CheckoutConfig-724d7bae.js";export{c as countryRequireShortAddressCode}from"./ShortAddressCode-7620e622.js";export{c as countryRequireTaxId,e as euCountryCodes,s as shipToTaxIdLabels}from"./TaxId-63a14057.js";var checkIfLoadVersionDomain=function(e){var n=e.loadScriptSrc;if(!n){return{currentLoadScriptUrl:"",isForceLoadVersionDomain:false,isWhiteListed:false}}var o=["dev.elements.zonos.com","dev.assets-checkout.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"];var t=["qa.js.zonos.com"];var r=new URL(n).origin;var i=o.some((function(e){return r.includes(e)}));var a=t.some((function(e){return r.includes(e)}));return{currentLoadScriptUrl:r,isForceLoadVersionDomain:a,isWhiteListed:i}};var fallbackList=["jsdelivr","cdnjs","unpkg","vercel"];var MAIN_LOAD_CDN_TYPE="jsdelivr";var getNextFallbackUrl=function(e){var n=fallbackList.indexOf(e);var o=fallbackList[n+1];return o||null};var getWithTestPublicCredential=function(){return __awaiter(void 0,void 0,void 0,(function(){var e,n,o,t,r,i;return __generator(this,(function(a){switch(a.label){case 0:e=getIsTestMode();n=getIsStagingMode();if(!e&&!n||!window.Zonos.zonosApiKey){return[2,null]}log("[ZONOS - loadZonos] Attempt test public credential","info");if(!!window.Zonos.zonosApiKey.includes("credential_test")){log("[ZONOS - loadZonos] Test mode is enabled but the API key is already a test key","info");return[2,null]}return[4,handleFetch("/api/get-test-public-credential")];case 1:o=a.sent(),t=o.errors,r=o.json;if(t.length||!r){logError("[ZONOS - loadZonos] Failed to get test public credential. Keep using production key",t);return[2,null]}i=r.publicCredential;if(!i){logError("[ZONOS - loadZonos] No test public key credential. Keep using production key");return[2,null]}log("[ZONOS - loadZonos] Retrieve new test public token ".concat(i),"info");return[2,i]}}))}))};var extractZonosQaUrl=function(e){if(!e){return null}var n=new URL(e).searchParams;var o=n.get("zonosQaUrl");if(!o){return null}var t=/[^a-zA-Z0-9-_]+/.test(o);if(!!t){return null}return o};var getZonosQaUrl=function(){var e=window&&window.location.href.includes("forceLoadCdn");if(typeof window==="undefined"||e){return null}var n=extractZonosQaUrl(window.location.href);var o="https://v1.3.285.js.zonos.com";if(!n&&(o.includes("test.")||o.includes("test-"))){return o}if(!n&&["dev.demo.elements.zonos.com","dev.checkout.elements.zonos.com","dev.storybook.elements.zonos.com"].includes(window.location.hostname)){return"https://dev.elements.zonos.com"}if(!n){return null}if(n==="dev-elements"){return"https://dev.elements.zonos.com"}var t="preview.js.zonos.com";var r="https://".concat(n,".").concat(t);log("[ZONOS-WARNING] using '".concat(r,"' for loading elements script"),"warn");void fetch(r).then((function(){window.sessionStorage.removeItem("zonos--checkout-session-id");window.sessionStorage.removeItem("zonos--client-secret")})).catch((function(){alert("[ZONOS-WARNING] '".concat(r,"' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE"));var e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");var n=window.location.pathname;var o="".concat(n,"?").concat(e.toString());window.history.replaceState(window.history.state,"",o);window.location.reload();return null}));return r};var V3_URL="https://js.stripe.com/v3";var V3_URL_REGEX=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/;var EXISTING_SCRIPT_MESSAGE="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";var zonosStripeFindScript=function(){var e=document.querySelectorAll('script[src^="'.concat(V3_URL,'"]'));for(var n=0;n<e.length;n++){var o=e[n];if(!o){continue}if(!V3_URL_REGEX.test(o.src)){continue}return o}return null};var stripePromise$1=null;var injectScript=function(e){var n=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"";var o=document.createElement("script");o.src="".concat(V3_URL).concat(n);var t=document.head||document.body;if(!t){logError("Expected document.body not to be null. Stripe.js requires a <body> element.");return null}t.appendChild(o);return o};var zonosStripeLoadScript=function(e){if(stripePromise$1!==null){return stripePromise$1}stripePromise$1=new Promise((function(n,o){if(typeof window==="undefined"||typeof document==="undefined"){n(null);return}if(window.Stripe&&e){console.warn(EXISTING_SCRIPT_MESSAGE)}if(window.Stripe){n(window.Stripe);return}try{var t=zonosStripeFindScript();if(t&&e){console.warn(EXISTING_SCRIPT_MESSAGE)}else if(!t){t=injectScript(e)}t===null||t===void 0?void 0:t.addEventListener("load",(function(){if(window.Stripe){n(window.Stripe)}else{o(new Error("Stripe.js not available"))}}));t===null||t===void 0?void 0:t.addEventListener("error",(function(){o(new Error("Failed to load Stripe.js"))}))}catch(e){o(e);return}}));return stripePromise$1};var registerWrapper=function(e,n){if(!e||!e._registerWrapper){return}e._registerWrapper({name:"stripe-js",startTime:n})};var initStripe=function(e,n,o){if(e===null){return null}var t=e.apply(undefined,n);registerWrapper(t,o);return t};var hasCheckoutCartCallback=function(){var e,n;return typeof window!=="undefined"&&(typeof((e=window.Zonos)===null||e===void 0?void 0:e.createCartId)==="function"||typeof((n=window.Zonos)===null||n===void 0?void 0:n.buildCartDetail)==="function")};var stripePromise=Promise.resolve().then((function(){if(!hasCheckoutCartCallback()){return null}return zonosStripeLoadScript(null)}));var loadCalled=false;stripePromise.catch((function(e){if(!loadCalled){console.warn(e)}}));var zonosLoadStripe=function(){var e=[];for(var n=0;n<arguments.length;n++){e[n]=arguments[n]}return __awaiter(void 0,void 0,void 0,(function(){var n,o,t,r;return __generator(this,(function(i){switch(i.label){case 0:loadCalled=true;o=Date.now();return[4,stripePromise];case 1:if(!((n=i.sent())!==null&&n!==void 0))return[3,2];r=n;return[3,4];case 2:return[4,zonosStripeLoadScript(null)];case 3:r=i.sent();i.label=4;case 4:t=r;return[2,initStripe(t,e,o)]}}))}))};var TEMP_CART_ID_QUERY_PARAM="tempCartUUID";var getCartIdFromQueryParam=function(){var e=new URLSearchParams(window.location.search);var n=e.get(TEMP_CART_ID_QUERY_PARAM);return n};var getCartInfoById=function(e){return __awaiter(void 0,[e],void 0,(function(e){var n,o,t,r,i,a,s,c,u;var d=e.cartId,l=e.retries;return __generator(this,(function(e){switch(e.label){case 0:n=getIsTestMode();o=getGenericSettingsOverride();t=getAbandonedCartRenewTokenValue()||undefined;r=new URLSearchParams;if(o.overrideShouldEnabledCustomAddress){r.set("overrideShouldEnabledCustomAddress",o.overrideShouldEnabledCustomAddress)}return[4,handleFetch("/api/zonos-elements/get-cart?".concat(r.toString()),{body:{isTestMode:n,renewCartExpirationToken:t,tempCartUUID:d},headers:{"Content-Type":"application/json"},method:"POST"})];case 1:i=e.sent(),a=i.errors,s=i.json,c=i.zonosMode;u=!s||a.length;if(!(u&&l))return[3,3];log("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:l});return[4,new Promise((function(e){return setTimeout(e,500)}))];case 2:e.sent();return[2,getCartInfoById({cartId:d,retries:l-1})];case 3:if(u){return[2,null]}return[2,Object.assign(Object.assign({},s),{zonosMode:c})]}}))}))};var setupCartDataWithSettings=function(e){return __awaiter(void 0,void 0,void 0,(function(){var n,o,t,r;return __generator(this,(function(i){switch(i.label){case 0:n=_getIsValidCartId(e),o=n.isDgsCartId,t=n.isLegacyCartId;if(!t&&!o){logError("[ZONOS - loadZonos] invalid cart id");return[2,null]}return[4,getCartInfoById({cartId:e,retries:5})];case 1:r=i.sent();log("[ZONOS - loadZonos] getting temp cart data","info",r);if(!r){logError("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process.");return[2,null]}window.Zonos.storeId=r.cartData.storeId;window.Zonos.zonosApiKey=r.cartData.credentialToken;window.Zonos.zonosMode=r.zonosMode;return[2,{cartData:r.cartData,settings:r.settings,storeFavicon:r.storeFaviconUrl,storeId:r.cartData.storeId,storeLogo:r.storeLogoUrl,zonosApiKey:r.cartData.credentialToken}]}}))}))};var _a;var zonosLoadUrl=function(){if(typeof document==="undefined"){return null}var e=document.querySelector('script[src*="/zonos.js"]');var n=checkIfLoadVersionDomain({loadScriptSrc:e===null||e===void 0?void 0:e.src}),o=n.currentLoadScriptUrl,t=n.isWhiteListed;if(t){return o}return null}();var startLoadTime=Date.now();var ZONOS_URL="https://v1.3.285.js.zonos.com";var JS_DELIVR_ZONOS_URL=zonosLoadUrl||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.285";var UNPKG_ZONOS_URL="https://unpkg.com/@zonos/elements@1.3.285";var CDNJS_ZONOS_URL="https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.285";var GOOGLE_FONT_URL="https://fonts.googleapis.com";var GOOGLE_FONT_REGEX=/^https:\/\/fonts\.googleapis\.com/;var Zonos=function(){function e(){}return e}();_a=Zonos;Zonos.doneInit=false;Zonos.cartSettings=null;Zonos.debug=typeof window!=="undefined"&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/);Zonos.zonosConversionTest=typeof window!=="undefined"&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/);Zonos._paypalMockResponse=null;Zonos.iframeLogType=typeof window!=="undefined"?new URLSearchParams(window.location.search).get("iframeLogType"):null;Zonos.isBigCommerce=false;Zonos.releaseDate="1787351938302";Zonos.isLegacyCheckout=false;Zonos.googleAnalyticId=null;Zonos.googleAnalyticReady=false;Zonos.facebookPixelId=null;Zonos.facebookPixelReady=false;Zonos.startLoadTime=startLoadTime;Zonos.domain=typeof window!=="undefined"?window.location!=window.parent.location&&document.referrer||document.location.hostname:"";Zonos.showBaseForeign=typeof window!=="undefined"&&window.location.search.includes("zonosShowBaseForeign");Zonos.overrideUseCustomAddressForm=false;Zonos.isCollect=false;Zonos.isInvoice=false;Zonos.isNpm=true;Zonos.zonosQaUrl=null;Zonos.zonosQaUrlApi=null;Zonos.trackEventLogs=[];Zonos.version="v".concat("1.3.285");Zonos.modeAlerted=false;Zonos.cartData=null;Zonos.paypal=null;Zonos.zonosMode=null;Zonos.IframeService=IframeService;Zonos.getCurrentTimestamp=function(){return(new Date).getTime()};Zonos.zonosController=null;Zonos.loadTimeApiInfoList=[];Zonos.logIntervalId=null;Zonos.init=function(e){return __awaiter(void 0,void 0,void 0,(function(){var n,o,t,r,i,a,s,c,u,d,l,f,v,m,_;return __generator(this,(function(p){switch(p.label){case 0:n=e.appearance,o=e.checkoutSettings,t=e.currencyConverter,r=e.helloSettings,i=e.onCountryChange,a=e.overrideCurrencyFormat,s=e.storeId,c=e.zonosApiKey;_a.cartId=getCartIdFromQueryParam();_a.createCartId=o===null||o===void 0?void 0:o.createCartId;_a.buildCartDetail=o===null||o===void 0?void 0:o.buildCartDetail;if(_a.doneInit){return[2]}log("====== ZONOS DEBUG MODE: on (".concat(_a.version,") ======"));_a.zonosApiKey=c;_a.storeId=s;if(typeof window!=="undefined"&&window.parent===window){_a.googleAnalyticReady=true;_a.facebookPixelReady=true}if(!_a.isNpm)return[3,4];log("====== ZONOS LOADING FROM NPM ======");u=getZonosQaUrl();if(u&&!window.isZonosPreview){log('====== RE-INJECT "zonos.js" FROM PRVIEW: '.concat(u," ======"),"info");d=document.createElement("script");d.src="".concat(u,"/dist/scripts/zonos.js");document.head.appendChild(d);d.addEventListener("load",(function(){window.Zonos.isNpm=_a.isNpm;window.Zonos.isBigCommerce=_a.isBigCommerce;window.Zonos.isLegacyCheckout=_a.isLegacyCheckout;window.Zonos.zonosMode=_a.zonosMode;void window.Zonos.init(e)}));d.addEventListener("error",(function(){alert('[ZONOS - loadZonos] Failed to load "loadZonos.js" from zonosQaUrl: '.concat(u))}));window.isZonosPreview=true;return[2]}if(!c&&!_a.cartId){logError("Zonos API key is required unless `tempCartUUID` is provided in url query params.");return[2]}if(!(!_a.cartData&&_a.cartId))return[3,2];log("Initialize cart data");return[4,setupCartDataWithSettings(_a.cartId)];case 1:l=p.sent();if(!l){logError("Failed to get cart data");return[2]}_a.cartData=l.cartData;_a.zonosApiKey=l.zonosApiKey;_a.cartSettings=l.settings;p.label=2;case 2:return[4,getWithTestPublicCredential()];case 3:f=p.sent();if(f){_a.zonosApiKey=f}p.label=4;case 4:v=new URL(window.location.href).searchParams.get("payment_intent_client_secret")||sessionStorage.getItem("zonos--client-secret");m=_a.cartId&&_a.cartData||!!v;if(m){log("Cart data or stripe client secret is available, inject hidden button and trigger checkout");_=document.createElement("button");_.style.display="none";_.id="".concat(checkoutHiddenBtnSelector);document.body.appendChild(_)}log("init zonos");_a.restoreNativeBrowserFunctions();_a.injectCustomScriptForHostedCheckout();_a.injectZonosCdn();_a.injectZonosCss();_a.injectFonts();_a.injectCheckoutInternationalButton();_a.injectController({config:{appearance:n,checkoutSettings:o,currencyConverter:t,helloSettings:r,onCountryChange:i,overrideCurrencyFormat:a}});_a.doneInit=true;return[2]}}))}))};Zonos.injectCheckoutInternationalButton=function(){if(!document.querySelector("#".concat(checkoutHiddenInternationalBtnSelector))){var e=document.createElement("button");e.id=checkoutHiddenInternationalBtnSelector;e.style.display="none";document.body.appendChild(e)}};Zonos.injectCustomScriptForHostedCheckout=function(){var e=_a.cartData;var n=(e===null||e===void 0?void 0:e.metadata)||[];var o=n.find((function(e){return e.key==="customHeaderScript"}));var t=n.find((function(e){return e.key==="customFooterScript"}));if(!window.Zonos.isLegacyCheckout||!o&&!t){log("Skip injecting custom script for hosted checkout","info",{footerScript:t,headerScript:o,isLegacyCheckout:window.Zonos.isLegacyCheckout});return}if(o){log("Injecting custom header script");var r=document.createElement("script");r.textContent=o.value;document.head.appendChild(r)}if(t){log("Injecting custom footer script");var r=document.createElement("script");r.textContent=t.value;document.body.appendChild(r)}};Zonos.displayCurrency=function(){var e=document.querySelector("zonos-hello");if(e){void e.displayCurrency()}};Zonos.triggerCheckoutInternational=function(){return __awaiter(void 0,void 0,void 0,(function(){var e;return __generator(this,(function(n){e=document.querySelector("#".concat(checkoutHiddenInternationalBtnSelector));setTimeout((function(){if(e){e.dispatchEvent(createCustomEvent("click"))}}),10);return[2]}))}))};Zonos.openHelloDialog=function(e){var n=document.querySelector("zonos-hello");if(n){void n.openHelloDialog(e!==null&&e!==void 0?e:true)}};Zonos.showNotification=function(e){var n;void((n=_a.zonosController)===null||n===void 0?void 0:n.showNotification(e))};Zonos.updateOrganizationName=function(e){var n;void((n=_a.zonosController)===null||n===void 0?void 0:n.updateOrganizationName(e))};Zonos.disablePlaceOrderButtons=function(e){var n=e.autoEnable,o=n===void 0?true:n,t=e.config,r=e.disable,i=e.placeOrderButtonSelector;var a;if((a=t.checkoutSettings)===null||a===void 0?void 0:a.disablePlaceOrderButtonActivation){return}if(i){var s=document.querySelectorAll(i);var c=function(e){var n=e.target;if(n.getAttribute("disabled")){e.preventDefault();e.stopPropagation()}};s.forEach((function(e){var n=e.getAttribute("data-zonos-checkout-attached");if(n){return}if(r){e.setAttribute("disabled","true");e.addEventListener("click",c)}else{e.removeAttribute("disabled");e.removeEventListener("click",c)}}));if(o&&r){setTimeout((function(){s.forEach((function(e){e.removeAttribute("disabled");e.removeEventListener("click",c)}))}),5e3)}}};Zonos.restoreNativeBrowserFunctions=function(){var e;var n=new URL(window.location.href).searchParams.get("useMerchantPolyfill")==="1";if(n){return}var o="zonos---native-browser";var t=document.querySelector("iframe#".concat(o));if(!t){t=document.createElement("iframe");t.id=o;t.style.display="none";t.style.opacity="0";t.style.position="absolute";t.style.top="-9999px";t.style.left="-9999px";t.style.width="1px";t.style.height="1px";t.style.border="none";t.style.overflow="hidden";t.style.visibility="hidden";document.body.appendChild(t)}var r=((e=t.contentWindow)===null||e===void 0?void 0:e.window.Array.from)||Array.from;Array.from=r;document.body.removeChild(t)};Zonos.injectController=function(e){var n=e.config;var o,t;if(document.querySelector("zonos-controller")){return}if((o=n.checkoutSettings)===null||o===void 0?void 0:o.placeOrderButtonSelector){var r=n.checkoutSettings.placeOrderButtonSelector;_a.disablePlaceOrderButtons({config:n,disable:true,placeOrderButtonSelector:r});var i=new MutationObserver((function(){_a.disablePlaceOrderButtons({config:n,disable:true,placeOrderButtonSelector:r})}));i.observe(document.body,{childList:true,subtree:true})}if((t=n.checkoutSettings)===null||t===void 0?void 0:t.alwaysTriggerInternationalCheckoutSelector){var a=n.checkoutSettings.alwaysTriggerInternationalCheckoutSelector;_a.disablePlaceOrderButtons({config:n,disable:true,placeOrderButtonSelector:a});var i=new MutationObserver((function(){_a.disablePlaceOrderButtons({config:n,disable:true,placeOrderButtonSelector:a})}));i.observe(document.body,{childList:true,subtree:true})}var s=document.createElement("zonos-controller");s.config=n;s.zonosApiKey=_a.zonosApiKey||"";s.addEventListener("stripeInitEvent",(function(e){return __awaiter(void 0,void 0,void 0,(function(){var n,o;return __generator(this,(function(t){switch(t.label){case 0:n=e.detail;log("loading Stripe");return[4,zonosLoadStripe(n.publishableKey)];case 1:o=t.sent();if(!o){logError("API seems to be invalid or missing. Failed to load Stripe");return[2]}window.Zonos.stripe=o;if(window.Zonos.isCollect){void s.initCollectElement(o)}else if(window.Zonos.isInvoice){void s.initInvoiceElement(o)}else{void s.initCheckoutElement(o)}return[2]}}))}))}));document.body.appendChild(s);_a.zonosController=s;log("Zonos controller injected!")};Zonos.injectScript=function(e){var n=e.cdnType,o=e.isModule,t=e.theRestUrl;var r=_a.getZonosUrl(n);var i="".concat(r,"/").concat(t);var a=function(){var e=document.querySelector('script[src="'.concat(i,'"]'));return!!e};if(a()){log('Zonos script "'.concat(i,'" already exists in the document'),"warn");return}var s=document.head||document.body;var c=document.createElement("script");if(!!o){c.type="module"}else{c.noModule=true}c.src=i;c.crossOrigin="anonymous";c.onerror=function(){logError("Failed to load ".concat(c.src));var e=getNextFallbackUrl(n);if(!e){return}_a.injectScript({cdnType:e,isModule:o,theRestUrl:t})};s.appendChild(c)};Zonos.getZonosUrl=function(e){var n=function(){switch(e){case"jsdelivr":return JS_DELIVR_ZONOS_URL;case"unpkg":return UNPKG_ZONOS_URL;case"cdnjs":return CDNJS_ZONOS_URL;case"vercel":return ZONOS_URL}};if(_a.isNpm){var o=getZonosQaUrl();return o||n()}return n()};Zonos.injectZonosCdn=function(){_a.injectScript({cdnType:MAIN_LOAD_CDN_TYPE,isModule:true,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"});_a.injectScript({cdnType:MAIN_LOAD_CDN_TYPE,isModule:false,theRestUrl:"dist/zonos-elements/zonos-elements.js"});log("Zonos cdn script injected!")};Zonos.injectStylesheet=function(e){var n=e.cdnType,o=e.theRestUrl;var t=_a.getZonosUrl(n);var r=document.head||document.body;var i=document.createElement("link");i.rel="preconnect";i.href="".concat(ZONOS_URL,"/");r.appendChild(i);var a=document.createElement("link");a.rel="stylesheet";a.href="".concat(t,"/").concat(o);a.onerror=function(){logError("Failed to load ".concat(a.href));var e=getNextFallbackUrl(n);if(!e){return}_a.injectStylesheet({cdnType:e,theRestUrl:o})};r.appendChild(a)};Zonos.injectZonosCss=function(){var e=function(){return!!document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')};if(e()){log("Zonos style links already injected","warn");return}_a.injectStylesheet({cdnType:MAIN_LOAD_CDN_TYPE,theRestUrl:"dist/zonos-elements/zonos-elements.css"});log("Zonos style css injected!")};Zonos.injectFonts=function(){var e=function(){var e=document.fonts.check("1em Inter");if(e){log("Inter font already loaded","warn");return}var n=document.querySelectorAll('link[rel="stylesheet"][href^="'.concat(GOOGLE_FONT_URL,'"]'));for(var o=0;o<n.length;o++){var t=n[o];if(!t){continue}if(GOOGLE_FONT_REGEX.test(t.href)){continue}return t}return null};if(e()){log("Inter font already injected","warn");return}var n=document.head||document.body;var o=document.createElement("link");o.rel="preconnect";o.href=GOOGLE_FONT_URL;n.appendChild(o);var t=document.createElement("link");t.rel="stylesheet";t.href="".concat(GOOGLE_FONT_URL,"/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap");n.appendChild(t);log("Zonos font injected!")};Zonos.setupGoogleFont=function(e){var n;void((n=_a.zonosController)===null||n===void 0?void 0:n.setupGoogleFont(e))};Zonos.injectSupportGoogleFont=function(e){var n;log("[FONT] injecting ".concat(e));var o=(n=e.match(/family=(.*?):/))===null||n===void 0?void 0:n[1];var t=document.head||document.body;if(!document.querySelector('link[rel="preconnect"][href^="'.concat(GOOGLE_FONT_URL,'"]'))){var r=document.createElement("link");r.rel="preconnect";r.href=GOOGLE_FONT_URL;t.appendChild(r)}if(document.querySelector('link[rel="stylesheet"][href="'.concat(e,'"]'))){log("[FONT] ".concat(o," font already injected"),"warn");return}var i=document.createElement("link");i.rel="stylesheet";i.href=e;t.appendChild(i);log("[FONT] ".concat(o," font injected!"))};var checkoutSessionMutableAttributeKeys=["ZONOS_FORM_TYPE_USING","APP_VERSION","APP_VERSION_NPM_INTEGRATION","LEGACY_CHECKOUT_FACADE"];var checkoutSessionImmutableAttributeKeys=["ORDER_DUPLICATION_CONSENT","WITH_ABANDONED_CART_TOKEN"];var checkoutSessionAttributeKeys=__spreadArray(__spreadArray([],checkoutSessionMutableAttributeKeys,true),checkoutSessionImmutableAttributeKeys,true);export{Zonos,checkoutSessionAttributeKeys,checkoutSessionImmutableAttributeKeys,checkoutSessionMutableAttributeKeys};
|
package/dist/scripts/index.d.ts
CHANGED
|
@@ -502,6 +502,7 @@ declare const countryCode: {
|
|
|
502
502
|
readonly Vu: "VU";
|
|
503
503
|
readonly Wf: "WF";
|
|
504
504
|
readonly Ws: "WS";
|
|
505
|
+
readonly Xk: "XK";
|
|
505
506
|
readonly Ye: "YE";
|
|
506
507
|
readonly Yt: "YT";
|
|
507
508
|
readonly Za: "ZA";
|
|
@@ -1188,24 +1189,10 @@ type CartCheckoutWorkflowQuery = {
|
|
|
1188
1189
|
captureDelay: number;
|
|
1189
1190
|
companyFieldsStatus: CheckoutCompanyFieldsStatus;
|
|
1190
1191
|
createdAt: string;
|
|
1191
|
-
createdBy: string;
|
|
1192
|
-
customHTML: string;
|
|
1193
|
-
defaultCartExpiration: number;
|
|
1194
|
-
disabledCountries: Array<CountryCode> | null;
|
|
1195
|
-
domesticElementSelector: string | null;
|
|
1196
|
-
externalPaymentMethods: Array<{
|
|
1197
|
-
status: ExternalPaymentMethodStatus;
|
|
1198
|
-
type: ExternalPaymentMethodType;
|
|
1199
|
-
}> | null;
|
|
1200
|
-
externalServiceTokens: Array<{
|
|
1201
|
-
token: string;
|
|
1202
|
-
type: ExternalServiceTokenType;
|
|
1203
|
-
}>;
|
|
1204
|
-
id: string;
|
|
1205
1192
|
merchantPolicyLinks: {
|
|
1206
1193
|
euWithdrawalPolicy: {
|
|
1207
|
-
currencyCode: CurrencyCode;
|
|
1208
1194
|
maximumReturnShippingEstimate: number | null;
|
|
1195
|
+
currencyCode: CurrencyCode;
|
|
1209
1196
|
status: NotificationActiveStatus | null;
|
|
1210
1197
|
} | null;
|
|
1211
1198
|
privacyPolicy: {
|
|
@@ -1217,13 +1204,24 @@ type CartCheckoutWorkflowQuery = {
|
|
|
1217
1204
|
shippingPolicy: {
|
|
1218
1205
|
link: string | null;
|
|
1219
1206
|
} | null;
|
|
1220
|
-
|
|
1207
|
+
warrantyPolicy: {
|
|
1221
1208
|
link: string | null;
|
|
1222
1209
|
} | null;
|
|
1223
|
-
|
|
1210
|
+
termsAndConditions: {
|
|
1224
1211
|
link: string | null;
|
|
1225
1212
|
} | null;
|
|
1226
1213
|
};
|
|
1214
|
+
customHTML: string;
|
|
1215
|
+
defaultCartExpiration: number;
|
|
1216
|
+
disabledCountries: Array<CountryCode> | null;
|
|
1217
|
+
domesticElementSelector: string | null;
|
|
1218
|
+
externalPaymentMethods: Array<{
|
|
1219
|
+
status: ExternalPaymentMethodStatus;
|
|
1220
|
+
type: ExternalPaymentMethodType;
|
|
1221
|
+
}> | null;
|
|
1222
|
+
successRedirectUrl: string;
|
|
1223
|
+
id: string;
|
|
1224
|
+
updatedAt: string;
|
|
1227
1225
|
mode: Mode;
|
|
1228
1226
|
orderNotifications: {
|
|
1229
1227
|
abandonedCart: {
|
|
@@ -1247,8 +1245,11 @@ type CartCheckoutWorkflowQuery = {
|
|
|
1247
1245
|
placeOrderButtonSelector: string | null;
|
|
1248
1246
|
subscriptionStatus: CheckoutSubscriptionStatus;
|
|
1249
1247
|
successBehavior: CheckoutSuccessBehavior;
|
|
1250
|
-
|
|
1251
|
-
|
|
1248
|
+
createdBy: string;
|
|
1249
|
+
externalServiceTokens: Array<{
|
|
1250
|
+
token: string;
|
|
1251
|
+
type: ExternalServiceTokenType;
|
|
1252
|
+
}>;
|
|
1252
1253
|
updatedBy: string;
|
|
1253
1254
|
varianceTestRegistrations: Array<{
|
|
1254
1255
|
testKey: string;
|
|
@@ -1284,22 +1285,22 @@ type CartCheckoutWorkflowQuery = {
|
|
|
1284
1285
|
desktopLocation: HelloDesktopLocation;
|
|
1285
1286
|
dutyTaxEstimationBehavior: HelloEstimateBehavior;
|
|
1286
1287
|
excludedUrlPatterns: Array<string>;
|
|
1287
|
-
|
|
1288
|
+
updatedBy: string;
|
|
1288
1289
|
id: string;
|
|
1289
1290
|
mobileLocation: HelloMobileLocation;
|
|
1290
1291
|
mode: Mode;
|
|
1291
1292
|
organization: string;
|
|
1292
1293
|
peekMessageBehavior: HelloPeekMessageBehavior;
|
|
1293
1294
|
peekMessageDelay: number;
|
|
1294
|
-
productAddToCartElementSelector: string | null;
|
|
1295
|
-
productDescriptionElementSelector: string | null;
|
|
1296
|
-
productDetailUrlPattern: string | null;
|
|
1297
1295
|
productListUrlPattern: string | null;
|
|
1296
|
+
productDetailUrlPattern: string | null;
|
|
1297
|
+
homepageUrlPattern: string | null;
|
|
1298
|
+
productDescriptionElementSelector: string | null;
|
|
1298
1299
|
productPriceElementSelector: string | null;
|
|
1299
1300
|
productTitleElementSelector: string | null;
|
|
1300
1301
|
restrictionBehavior: HelloRestrictionBehavior;
|
|
1301
1302
|
updatedAt: string;
|
|
1302
|
-
|
|
1303
|
+
productAddToCartElementSelector: string | null;
|
|
1303
1304
|
visibilityStatus: HelloVisibilityStatus;
|
|
1304
1305
|
widgetSize: number | null;
|
|
1305
1306
|
};
|
|
@@ -1329,9 +1330,9 @@ type CheckoutSessionDetailsFragment = {
|
|
|
1329
1330
|
email: string | null;
|
|
1330
1331
|
line1: string;
|
|
1331
1332
|
line2: string | null;
|
|
1332
|
-
locality: string;
|
|
1333
1333
|
name: string | null;
|
|
1334
1334
|
phone: string | null;
|
|
1335
|
+
locality: string;
|
|
1335
1336
|
postalCode: string;
|
|
1336
1337
|
}> | null;
|
|
1337
1338
|
name: string | null;
|
|
@@ -1355,18 +1356,18 @@ type CheckoutSessionDetailsFragment = {
|
|
|
1355
1356
|
source: AdjustmentSource | null;
|
|
1356
1357
|
} | null;
|
|
1357
1358
|
amount: number;
|
|
1359
|
+
type: LandedCostAdjustmentType | null;
|
|
1358
1360
|
item: {
|
|
1359
1361
|
amount: number;
|
|
1360
1362
|
} | null;
|
|
1361
|
-
type: LandedCostAdjustmentType | null;
|
|
1362
1363
|
}> | null;
|
|
1363
1364
|
currencyCode: CurrencyCode;
|
|
1364
1365
|
deMinimis: Array<{
|
|
1365
|
-
|
|
1366
|
+
type: DeMinimisType;
|
|
1367
|
+
threshold: DeMinimisThreshold;
|
|
1366
1368
|
method: IncotermCode;
|
|
1367
1369
|
note: string;
|
|
1368
|
-
|
|
1369
|
-
type: DeMinimisType;
|
|
1370
|
+
formula: string;
|
|
1370
1371
|
}>;
|
|
1371
1372
|
duties: Array<{
|
|
1372
1373
|
amount: number;
|
|
@@ -1376,8 +1377,8 @@ type CheckoutSessionDetailsFragment = {
|
|
|
1376
1377
|
amount: number;
|
|
1377
1378
|
currencyCode: CurrencyCode;
|
|
1378
1379
|
}>;
|
|
1379
|
-
id: string;
|
|
1380
1380
|
landedCostGuaranteeCode: LandedCostGuaranteeCode;
|
|
1381
|
+
id: string;
|
|
1381
1382
|
method: IncotermCode;
|
|
1382
1383
|
remittance: Array<{
|
|
1383
1384
|
amount: number;
|
|
@@ -1471,9 +1472,9 @@ type HelloSettingFragment = {
|
|
|
1471
1472
|
organization: string;
|
|
1472
1473
|
peekMessageBehavior: HelloPeekMessageBehavior;
|
|
1473
1474
|
peekMessageDelay: number;
|
|
1474
|
-
productAddToCartElementSelector: string | null;
|
|
1475
|
-
productDescriptionElementSelector: string | null;
|
|
1476
1475
|
productDetailUrlPattern: string | null;
|
|
1476
|
+
productDescriptionElementSelector: string | null;
|
|
1477
|
+
productAddToCartElementSelector: string | null;
|
|
1477
1478
|
productListUrlPattern: string | null;
|
|
1478
1479
|
productPriceElementSelector: string | null;
|
|
1479
1480
|
productTitleElementSelector: string | null;
|
|
@@ -1561,7 +1562,7 @@ type GetOrderQuery = {
|
|
|
1561
1562
|
}>;
|
|
1562
1563
|
shipmentRating: {
|
|
1563
1564
|
amount: number;
|
|
1564
|
-
|
|
1565
|
+
serviceLevelCode: string;
|
|
1565
1566
|
details: Array<{
|
|
1566
1567
|
amount: number;
|
|
1567
1568
|
carrierCode: string;
|
|
@@ -1569,7 +1570,7 @@ type GetOrderQuery = {
|
|
|
1569
1570
|
}> | null;
|
|
1570
1571
|
displayName: string;
|
|
1571
1572
|
id: string;
|
|
1572
|
-
|
|
1573
|
+
currencyCode: CurrencyCode;
|
|
1573
1574
|
};
|
|
1574
1575
|
}> | null;
|
|
1575
1576
|
metadata: Array<{
|