@zonos/elements 1.3.14-alpha.0 → 1.3.14
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/zonos-controller.cjs.entry.js +1 -3
- package/dist/collection/components/utils/hello/initHello.js +1 -3
- package/dist/collection/types/generated/graphql.customer.types.js +42 -0
- package/dist/collection/types/generated/graphql.frontend.types.js +5 -0
- package/dist/components/zonos-controller.js +1 -3
- package/dist/esm/zonos-controller.entry.js +1 -3
- package/dist/esm-es5/zonos-controller.entry.js +1 -1
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/scripts/zonosBase.js +1 -1
- package/dist/types/types/generated/graphql.customer.types.d.ts +94 -0
- package/dist/types/types/generated/graphql.customer.types.ts +174 -0
- package/dist/types/types/generated/graphql.frontend.types.d.ts +10 -0
- package/dist/types/types/generated/graphql.frontend.types.ts +20 -0
- package/dist/zonos-elements/p-522294b9.system.entry.js +1 -0
- package/dist/zonos-elements/p-b8e8330b.system.js +1 -1
- package/dist/zonos-elements/{p-1744bddb.entry.js → p-f6bbff95.entry.js} +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/zonos-elements/p-4029034e.system.entry.js +0 -1
|
@@ -89,9 +89,7 @@ const initHello = async (helloSettings) => {
|
|
|
89
89
|
position: 'bottom-right',
|
|
90
90
|
});
|
|
91
91
|
// default to mobile anchor if anchorElementSelector is not provided, so for bigcommerce, we don't need to manually add a anchor every time we onboard a new store
|
|
92
|
-
const helloAnchor =
|
|
93
|
-
? anchorElementSelector || mobileHelloAnchor
|
|
94
|
-
: anchorElementSelector;
|
|
92
|
+
const helloAnchor = anchorElementSelector || mobileHelloAnchor;
|
|
95
93
|
// check if checkout button anchor selector user pass in is valid to setup hello
|
|
96
94
|
if (!helloAnchor || !cart.isValidSelector(helloAnchor)) {
|
|
97
95
|
cart.logError(`Selector anchorElementSelector "${helloSettings.anchorElementSelector}" is not a valid selector.`);
|
|
@@ -51,9 +51,7 @@ export const initHello = async (helloSettings) => {
|
|
|
51
51
|
position: 'bottom-right',
|
|
52
52
|
});
|
|
53
53
|
// default to mobile anchor if anchorElementSelector is not provided, so for bigcommerce, we don't need to manually add a anchor every time we onboard a new store
|
|
54
|
-
const helloAnchor =
|
|
55
|
-
? anchorElementSelector || mobileHelloAnchor
|
|
56
|
-
: anchorElementSelector;
|
|
54
|
+
const helloAnchor = anchorElementSelector || mobileHelloAnchor;
|
|
57
55
|
// check if checkout button anchor selector user pass in is valid to setup hello
|
|
58
56
|
if (!helloAnchor || !isValidSelector(helloAnchor)) {
|
|
59
57
|
logError(`Selector anchorElementSelector "${helloSettings.anchorElementSelector}" is not a valid selector.`);
|
|
@@ -139,6 +139,10 @@ export const carrierApiRatingSpecialServiceType = {
|
|
|
139
139
|
SignatureOption: 'SIGNATURE_OPTION',
|
|
140
140
|
SundayDelivery: 'SUNDAY_DELIVERY',
|
|
141
141
|
};
|
|
142
|
+
export const carrierApiSupportType = {
|
|
143
|
+
Supported: 'SUPPORTED',
|
|
144
|
+
Unsupported: 'UNSUPPORTED',
|
|
145
|
+
};
|
|
142
146
|
export const carrierCode = {
|
|
143
147
|
Apc: 'APC',
|
|
144
148
|
Dhl: 'DHL',
|
|
@@ -1076,6 +1080,7 @@ export const emailTemplateStatus = {
|
|
|
1076
1080
|
export const emailTemplateType = {
|
|
1077
1081
|
AbandonedCart: 'ABANDONED_CART',
|
|
1078
1082
|
CatalogExport: 'CATALOG_EXPORT',
|
|
1083
|
+
ManualClassificationExport: 'MANUAL_CLASSIFICATION_EXPORT',
|
|
1079
1084
|
OrderCanceled: 'ORDER_CANCELED',
|
|
1080
1085
|
OrderConfirmation: 'ORDER_CONFIRMATION',
|
|
1081
1086
|
OrderReceipt: 'ORDER_RECEIPT',
|
|
@@ -1193,6 +1198,25 @@ export const imageSlot = {
|
|
|
1193
1198
|
Image_4: 'IMAGE_4',
|
|
1194
1199
|
Image_5: 'IMAGE_5',
|
|
1195
1200
|
};
|
|
1201
|
+
export const inclusivePriceCalculateJobStatus = {
|
|
1202
|
+
Completed: 'COMPLETED',
|
|
1203
|
+
Failed: 'FAILED',
|
|
1204
|
+
InProgress: 'IN_PROGRESS',
|
|
1205
|
+
};
|
|
1206
|
+
export const inclusivePriceCalculateJobType = {
|
|
1207
|
+
All: 'ALL',
|
|
1208
|
+
CatalogItem: 'CATALOG_ITEM',
|
|
1209
|
+
Country: 'COUNTRY',
|
|
1210
|
+
};
|
|
1211
|
+
export const inclusivePriceCatalogValidationJobCompletionStatus = {
|
|
1212
|
+
Archived: 'ARCHIVED',
|
|
1213
|
+
Completed: 'COMPLETED',
|
|
1214
|
+
InProgress: 'IN_PROGRESS',
|
|
1215
|
+
};
|
|
1216
|
+
export const inclusivePriceCatalogValidationJobComplianceStatus = {
|
|
1217
|
+
Compliant: 'COMPLIANT',
|
|
1218
|
+
NonCompliant: 'NON_COMPLIANT',
|
|
1219
|
+
};
|
|
1196
1220
|
export const inclusivePriceHistoryCsvJobStatus = {
|
|
1197
1221
|
Error: 'ERROR',
|
|
1198
1222
|
Processed: 'PROCESSED',
|
|
@@ -2082,8 +2106,26 @@ export function getSdk(client, withWrapper = defaultWrapper) {
|
|
|
2082
2106
|
ZonosSettings(variables, requestHeaders) {
|
|
2083
2107
|
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'ZonosSettings', 'query');
|
|
2084
2108
|
},
|
|
2109
|
+
addTrackingNumber(variables, requestHeaders) {
|
|
2110
|
+
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'addTrackingNumber', 'mutation');
|
|
2111
|
+
},
|
|
2112
|
+
createWebhook(variables, requestHeaders) {
|
|
2113
|
+
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'createWebhook', 'mutation');
|
|
2114
|
+
},
|
|
2115
|
+
deleteWebhook(variables, requestHeaders) {
|
|
2116
|
+
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'deleteWebhook', 'mutation');
|
|
2117
|
+
},
|
|
2085
2118
|
getCheckoutPlaceOrderButtonSelector(variables, requestHeaders) {
|
|
2086
2119
|
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'getCheckoutPlaceOrderButtonSelector', 'query');
|
|
2087
2120
|
},
|
|
2121
|
+
getWebhooks(variables, requestHeaders) {
|
|
2122
|
+
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'getWebhooks', 'query');
|
|
2123
|
+
},
|
|
2124
|
+
removeTrackingNumber(variables, requestHeaders) {
|
|
2125
|
+
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'removeTrackingNumber', 'mutation');
|
|
2126
|
+
},
|
|
2127
|
+
updateWebhook(variables, requestHeaders) {
|
|
2128
|
+
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'updateWebhook', 'mutation');
|
|
2129
|
+
},
|
|
2088
2130
|
};
|
|
2089
2131
|
}
|
|
@@ -13,6 +13,7 @@ export const featureAspectKeyEnum = {
|
|
|
13
13
|
ComConsolidation: 'com_consolidation',
|
|
14
14
|
DashboardCheckout_2Settings: 'dashboard_checkout_2_settings',
|
|
15
15
|
DashboardHello_2Settings: 'dashboard_hello_2_settings',
|
|
16
|
+
DashboardNewLabelUi: 'dashboard_new_label_ui',
|
|
16
17
|
DashboardOrderApprove: 'dashboard_order_approve',
|
|
17
18
|
DashboardOrderApproveNoCapture: 'dashboard_order_approve_no_capture',
|
|
18
19
|
Dashboard_909Settings: 'dashboard_909_settings',
|
|
@@ -30,6 +31,7 @@ export const featureAudienceNameEnum = {
|
|
|
30
31
|
AccountsReceivable: 'accounts_receivable',
|
|
31
32
|
CheckoutSales: 'checkout_sales',
|
|
32
33
|
CustomerSuccess: 'customer_success',
|
|
34
|
+
DashboardLabelBetaMerchant: 'dashboard_label_beta_merchant',
|
|
33
35
|
Designer: 'designer',
|
|
34
36
|
DocsContributor: 'docs_contributor',
|
|
35
37
|
Executive: 'executive',
|
|
@@ -494,6 +496,9 @@ export function getSdk(client, withWrapper = defaultWrapper) {
|
|
|
494
496
|
UpsertBigCommerceSettings(variables, requestHeaders) {
|
|
495
497
|
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'UpsertBigCommerceSettings', 'mutation');
|
|
496
498
|
},
|
|
499
|
+
cleanupTestErrors(variables, requestHeaders) {
|
|
500
|
+
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'cleanupTestErrors', 'mutation');
|
|
501
|
+
},
|
|
497
502
|
cleanupTestZonosElementSetting(variables, requestHeaders) {
|
|
498
503
|
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'cleanupTestZonosElementSetting', 'mutation');
|
|
499
504
|
},
|
|
@@ -85,9 +85,7 @@ const initHello = async (helloSettings) => {
|
|
|
85
85
|
position: 'bottom-right',
|
|
86
86
|
});
|
|
87
87
|
// default to mobile anchor if anchorElementSelector is not provided, so for bigcommerce, we don't need to manually add a anchor every time we onboard a new store
|
|
88
|
-
const helloAnchor =
|
|
89
|
-
? anchorElementSelector || mobileHelloAnchor
|
|
90
|
-
: anchorElementSelector;
|
|
88
|
+
const helloAnchor = anchorElementSelector || mobileHelloAnchor;
|
|
91
89
|
// check if checkout button anchor selector user pass in is valid to setup hello
|
|
92
90
|
if (!helloAnchor || !isValidSelector(helloAnchor)) {
|
|
93
91
|
logError(`Selector anchorElementSelector "${helloSettings.anchorElementSelector}" is not a valid selector.`);
|
|
@@ -85,9 +85,7 @@ const initHello = async (helloSettings) => {
|
|
|
85
85
|
position: 'bottom-right',
|
|
86
86
|
});
|
|
87
87
|
// default to mobile anchor if anchorElementSelector is not provided, so for bigcommerce, we don't need to manually add a anchor every time we onboard a new store
|
|
88
|
-
const helloAnchor =
|
|
89
|
-
? anchorElementSelector || mobileHelloAnchor
|
|
90
|
-
: anchorElementSelector;
|
|
88
|
+
const helloAnchor = anchorElementSelector || mobileHelloAnchor;
|
|
91
89
|
// check if checkout button anchor selector user pass in is valid to setup hello
|
|
92
90
|
if (!helloAnchor || !isValidSelector(helloAnchor)) {
|
|
93
91
|
logError(`Selector anchorElementSelector "${helloSettings.anchorElementSelector}" is not a valid selector.`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(t,o,n,e){function r(t){return t instanceof n?t:new n((function(o){o(t)}))}return new(n||(n=Promise))((function(n,i){function s(t){try{u(e.next(t))}catch(t){i(t)}}function a(t){try{u(e["throw"](t))}catch(t){i(t)}}function u(t){t.done?n(t.value):r(t.value).then(s,a)}u((e=e.apply(t,o||[])).next())}))};var __generator=this&&this.__generator||function(t,o){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},e,r,i,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(t){return function(o){return u([t,o])}}function u(a){if(e)throw new TypeError("Generator is already executing.");while(s&&(s=0,a[0]&&(n=0)),n)try{if(e=1,r&&(i=a[0]&2?r["return"]:a[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;if(r=0,i)a=[a[0]&2,i.value];switch(a[0]){case 0:case 1:i=a;break;case 4:n.label++;return{value:a[1],done:false};case 5:n.label++;r=a[1];a=[0];continue;case 7:a=n.ops.pop();n.trys.pop();continue;default:if(!(i=n.trys,i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){n.label=a[1];break}if(a[0]===6&&n.label<i[1]){n.label=i[1];i=a;break}if(i&&n.label<i[2]){n.label=i[2];n.ops.push(a);break}if(i[2])n.ops.pop();n.trys.pop();continue}a=o.call(t,n)}catch(t){a=[6,t];r=0}finally{e=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host}from"./index-0e31d804.js";import{r as handleFetch,d as logError,u as isValidSelector,a as log,j as stripeStore,v as initLocalizationStore,b as localizationStoreUpdateSelectedCountryCode}from"./cart-515aac56.js";import{z as zonosStore,b as zonosStoreInitSetting,d as zonosStoreFontFamily}from"./zonosStore-f3eef64b.js";import"./isDarkColor-7a6d2d14.js";import"./getBorderRadius-8129b0cb.js";var getZonosSettings=function(){return __awaiter(void 0,void 0,void 0,(function(){var t,o,n,e;return __generator(this,(function(r){switch(r.label){case 0:t="".concat("https://v1.route.js.zonos.com","/api/zonos-elements/zonos-settings");return[4,handleFetch(t)];case 1:o=r.sent(),n=o.errors,e=o.json;if(n.length){logError("Error occurred when getting zonos settings. If this is not an unauthorized error, it will use user settings or default settings");return[2,{errors:n,json:null}]}return[2,{errors:[],json:e}]}}))}))};var injectCheckoutElement=function(){var t=document.querySelector("zonos-checkout");if(!t){var o=document.createElement("zonos-checkout");document.body.appendChild(o)}};var initCheckout=function(t){if(!t.placeOrderButtonSelector){return}if(!isValidSelector(t.placeOrderButtonSelector)){logError('Selector checkoutButtonAnchor "'.concat(t.placeOrderButtonSelector,'" is not a valid selector'));return}injectCheckoutElement()};var injectHelloComponent=function(t){var o=document.querySelector(t);var n=document.querySelector("zonos-hello");if(!n&&o){var e=document.createElement("zonos-hello");o.appendChild(e);return true}return false};var injectHelloMobileWrapper=function(t){var o=t.position,n=o===void 0?"bottom-right":o;var e=".zonos--hello-mobile-wrapper";var r=document.querySelector(e);if(r){return e}var i=document.createElement("div");i.className="zonos--hello-mobile-wrapper";i.style.position="fixed";if(n==="top-right"){i.style.top="72px";i.style.right="24px"}if(n==="top-left"){i.style.top="72px";i.style.left="24px"}if(n==="bottom-right"){i.style.bottom="72px";i.style.right="24px"}if(n==="bottom-left"){i.style.bottom="72px";i.style.left="24px"}i.style.zIndex="2147483007";document.body.appendChild(i);return e};var initHello=function(t){return __awaiter(void 0,void 0,void 0,(function(){var o,n,e,r,i;return __generator(this,(function(s){o=t.anchorElementSelector;n=injectHelloMobileWrapper({position:"bottom-right"});e=
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(t,o,n,e){function r(t){return t instanceof n?t:new n((function(o){o(t)}))}return new(n||(n=Promise))((function(n,i){function s(t){try{u(e.next(t))}catch(t){i(t)}}function a(t){try{u(e["throw"](t))}catch(t){i(t)}}function u(t){t.done?n(t.value):r(t.value).then(s,a)}u((e=e.apply(t,o||[])).next())}))};var __generator=this&&this.__generator||function(t,o){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},e,r,i,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(t){return function(o){return u([t,o])}}function u(a){if(e)throw new TypeError("Generator is already executing.");while(s&&(s=0,a[0]&&(n=0)),n)try{if(e=1,r&&(i=a[0]&2?r["return"]:a[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;if(r=0,i)a=[a[0]&2,i.value];switch(a[0]){case 0:case 1:i=a;break;case 4:n.label++;return{value:a[1],done:false};case 5:n.label++;r=a[1];a=[0];continue;case 7:a=n.ops.pop();n.trys.pop();continue;default:if(!(i=n.trys,i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){n.label=a[1];break}if(a[0]===6&&n.label<i[1]){n.label=i[1];i=a;break}if(i&&n.label<i[2]){n.label=i[2];n.ops.push(a);break}if(i[2])n.ops.pop();n.trys.pop();continue}a=o.call(t,n)}catch(t){a=[6,t];r=0}finally{e=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host}from"./index-0e31d804.js";import{r as handleFetch,d as logError,u as isValidSelector,a as log,j as stripeStore,v as initLocalizationStore,b as localizationStoreUpdateSelectedCountryCode}from"./cart-515aac56.js";import{z as zonosStore,b as zonosStoreInitSetting,d as zonosStoreFontFamily}from"./zonosStore-f3eef64b.js";import"./isDarkColor-7a6d2d14.js";import"./getBorderRadius-8129b0cb.js";var getZonosSettings=function(){return __awaiter(void 0,void 0,void 0,(function(){var t,o,n,e;return __generator(this,(function(r){switch(r.label){case 0:t="".concat("https://v1.route.js.zonos.com","/api/zonos-elements/zonos-settings");return[4,handleFetch(t)];case 1:o=r.sent(),n=o.errors,e=o.json;if(n.length){logError("Error occurred when getting zonos settings. If this is not an unauthorized error, it will use user settings or default settings");return[2,{errors:n,json:null}]}return[2,{errors:[],json:e}]}}))}))};var injectCheckoutElement=function(){var t=document.querySelector("zonos-checkout");if(!t){var o=document.createElement("zonos-checkout");document.body.appendChild(o)}};var initCheckout=function(t){if(!t.placeOrderButtonSelector){return}if(!isValidSelector(t.placeOrderButtonSelector)){logError('Selector checkoutButtonAnchor "'.concat(t.placeOrderButtonSelector,'" is not a valid selector'));return}injectCheckoutElement()};var injectHelloComponent=function(t){var o=document.querySelector(t);var n=document.querySelector("zonos-hello");if(!n&&o){var e=document.createElement("zonos-hello");o.appendChild(e);return true}return false};var injectHelloMobileWrapper=function(t){var o=t.position,n=o===void 0?"bottom-right":o;var e=".zonos--hello-mobile-wrapper";var r=document.querySelector(e);if(r){return e}var i=document.createElement("div");i.className="zonos--hello-mobile-wrapper";i.style.position="fixed";if(n==="top-right"){i.style.top="72px";i.style.right="24px"}if(n==="top-left"){i.style.top="72px";i.style.left="24px"}if(n==="bottom-right"){i.style.bottom="72px";i.style.right="24px"}if(n==="bottom-left"){i.style.bottom="72px";i.style.left="24px"}i.style.zIndex="2147483007";document.body.appendChild(i);return e};var initHello=function(t){return __awaiter(void 0,void 0,void 0,(function(){var o,n,e,r,i;return __generator(this,(function(s){o=t.anchorElementSelector;n=injectHelloMobileWrapper({position:"bottom-right"});e=o||n;if(!e||!isValidSelector(e)){logError('Selector anchorElementSelector "'.concat(t.anchorElementSelector,'" is not a valid selector.'));return[2]}log("Hello init complete");r=injectHelloComponent(e);if(!r){i=new MutationObserver((function(){var t=injectHelloComponent(e);if(t){i.disconnect()}}));i.observe(document.body,{childList:true,subtree:true});setTimeout((function(){i.disconnect()}),5e3)}return[2]}))}))};var zonosControllerCss=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{visibility:hidden;opacity:0;height:0}";var ZonosControllerStyle0=zonosControllerCss;var ZonosController=function(){function t(t){registerInstance(this,t);this.stripeInitEvent=createEvent(this,"stripeInitEvent",7);this.config=undefined;this.zonosApiKey=undefined}t.prototype.initCheckoutElement=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){if(!t){log("Stripe is not loaded yet - cannot init checkout element","warn");return[2]}stripeStore.stripe=t;void initCheckout(zonosStore.checkoutSettings);log("init checkout element");return[2]}))}))};t.prototype.initZonosNotification=function(){var t=document.querySelector("zonos-notification");if(t){return}var o=document.createElement("zonos-notification");document.body.appendChild(o)};t.prototype.setupGoogleFont=function(t){return __awaiter(this,void 0,void 0,(function(){var o,n,e,r,i,s,a,u;return __generator(this,(function(c){switch(c.label){case 0:e=t||zonosStoreFontFamily();if(e==="Inter"){if(!t){return[2]}log("[FONT] Just applied Inter , but no need to inject since we already inject Inter on start","warn");zonosStore.appearance=Object.assign(Object.assign({},zonosStore.appearance),{fontFamily:t})}r="https://v1.route.js.zonos.com";return[4,handleFetch("".concat(r,"/api/zonos-elements/get-font-detail?family=").concat(e))];case 1:i=c.sent(),s=i.errors,a=i.json;if(s.length>0||!a){log("Failed to load font ".concat(e),"warn");return[2]}u=a.fontUrl;(n=(o=window.Zonos).injectSupportGoogleFont)===null||n===void 0?void 0:n.call(o,u);if(!t){return[2]}log("[FONT] ".concat(t," font override applied"));zonosStore.appearance=Object.assign(Object.assign({},zonosStore.appearance),{fontFamily:t});return[2]}}))}))};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(o){zonosStore.zonosApiKey=this.zonosApiKey;(function(){return __awaiter(t,void 0,void 0,(function(){var t,o,n,e,r,i;return __generator(this,(function(s){switch(s.label){case 0:return[4,getZonosSettings()];case 1:n=s.sent(),e=n.errors,r=n.json;if(((t=e[0])===null||t===void 0?void 0:t.type.toString())==="403"){log("Failed to load zonos settings. This domain may not have access","warn");return[2]}this.initZonosNotification();zonosStoreInitSetting({overrideSettings:this.config,zonosSettings:r});void this.setupGoogleFont();if(zonosStore.helloSettings){void initHello(zonosStore.helloSettings)}return[4,initLocalizationStore()];case 2:s.sent();i=((o=r===null||r===void 0?void 0:r.checkoutSettings)===null||o===void 0?void 0:o.externalServiceTokens.find((function(t){return t.type==="STRIPE_PUBLISHABLE_TOKEN"})))||null;if(!i||!this.stripeInitEvent){log("Checkout failed to load -- missing publishable key","warn");return[2]}if(zonosStore.checkoutSettings.subscriptionStatus==="INACTIVE"){log('=== Checkout subscription is "INACTIVE" - Cancel initializing for Checkout ===',"warn");log("zonos controller loaded");return[2]}if(zonosStore.checkoutSettings.visibilityStatus==="DISABLED"){log("=== Checkout is disabled by store owner ===","warn");log("zonos controller loaded");return[2]}this.stripeInitEvent.emit({publishableKey:i.token});log("zonos controller loaded");return[2]}}))}))})();return[2]}))}))};t.prototype.showNotification=function(t){return __awaiter(this,void 0,void 0,(function(){var o;return __generator(this,(function(n){o=document.querySelector("zonos-notification");if(!o){log("Failed to show notification - zonos-notification not found","warn");return[2]}void o.showNotification(t);return[2]}))}))};t.prototype.overrideConfig=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){zonosStoreInitSetting({overrideSettings:t,zonosSettings:null});return[2]}))}))};t.prototype.overrideCountry=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){void localizationStoreUpdateSelectedCountryCode(t);return[2]}))}))};t.prototype.getAppearanceSetting=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,zonosStore.appearance]}))}))};t.prototype.updateOrganizationName=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){zonosStore.organizationName=t;return[2]}))}))};t.prototype.render=function(){return h(Host,{key:"e0869cf08934b9d047adef9875c9a5f50d604bdf",class:"zonos--elements"})};return t}();ZonosController.style=ZonosControllerStyle0;export{ZonosController as zonos_controller};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";"function"==typeof SuppressedError&&SuppressedError;const e=async({response:e,shouldLog:o=!0,shouldThrow:t=!1})=>{try{return await e.json()}catch(e){if(t)throw e;return o&&console.error(e),null}};const o=async(o,t)=>{const r=(function(e,o){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&o.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(e);n<r.length;n++)o.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(t[r[n]]=e[r[n]])}return t})(t||{},[]),n=r.body?JSON.stringify(r.body):void 0,s=r.method||"GET",i=new URL(o);i.searchParams.set("zToken",(function(e){try{return btoa(e).replace(/=/g,"")}catch(o){return e.replace(/[^A-Za-z0-9]/g,"").split("").reverse().join("")}})(window.location.hostname));const a=Object.assign({"Content-Type":"application/json","Zonos-Is-BigCommerce":window.Zonos.isBigCommerce.toString(),"Zonos-Referer":window.location.hostname,"Zonos-Version":window.Zonos.version,credentialtoken:window.Zonos.zonosApiKey||"Empty credential token from zonos-elements"},r.headers),c=Object.assign(Object.assign({},r),{body:"GET"===s?void 0:n,headers:a,method:s});return(async(o,t)=>{let r;try{r=await fetch(o,t)}catch(e){return e instanceof Error?{errors:[{message:e.message,type:"unknown"}],json:null,response:null}:{errors:[{message:"Fail to fetch",type:"unknown"}],json:null,response:null}}const n=r.headers.get("Zonos-Mode"),s=window.Zonos.zonosQaUrl;if(!window.Zonos.modeAlerted&&n&&s&&("production"===n&&alert("Please be aware that you are currently operating in the production environment. Any interactions with the customer store, including payments, will be processed as real transactions!"),"test"===n&&alert("For testing payments, you can utilize the test payment information provided at this link: https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements#web-test-the-integration"),window.Zonos.modeAlerted=!0),r.ok)return{errors:[],json:await e({response:r}),response:r};const i=r.status.toString();try{const o=await e({response:r,shouldThrow:!0});return{errors:[{message:`${i}: ${JSON.stringify(o)}`,type:i}],json:null,response:r}}catch(e){return{errors:[{message:`${i}: Unknown error`,type:i}],json:null,response:null}}})(i.toString(),c)},t=(e,o,...t)=>{var r,n;if(!(!!(null===(r=window.Zonos)||void 0===r?void 0:r.debug)||!!window.location.search.match(/\?.*(&*)zonosDebug=1/)))return void("error"===o&&console.error(e,...t));let s=document.querySelector("iframe#zonos---debug-logging-iframe");s||(s=document.createElement("iframe"),s.id="zonos---debug-logging-iframe",s.style.display="none",s.style.opacity="0",s.style.position="absolute",s.style.top="-9999px",s.style.left="-9999px",s.style.width="1px",s.style.height="1px",s.style.border="none",s.style.overflow="hidden",s.style.visibility="hidden",document.body.appendChild(s));const i=(null===(n=s.contentWindow)||void 0===n?void 0:n.window.console)||window.console;switch(o){case"warn":i.warn(e,...t);break;case"info":i.info(e,...t);break;case"error":i.error(e,...t);break;default:i.groupCollapsed(e,...t),i.trace(),i.groupEnd()}},r=(e,...o)=>{t(e,"error",...o)},n=async({endpoint:e,errors:t,metadata:r})=>{const n="userAgentData"in window.navigator?window.navigator.userAgentData:null,s={endpoint:e,errors:t,metadata:Object.assign({href:window.location.href,userAgent:n&&n.brands.length>0?n:window.navigator.userAgent},r)};o("https://v1.route.js.zonos.com/api/zonos-elements/log-error",{body:s,method:"POST"})};var s;const i=(()=>{const e=(e=>{if(!e)return null;const o=new URL(e).searchParams.get("zonosQaUrl");return o?/[^a-zA-Z0-9-_]+/.test(o)?null:o:null})(window.location.href);if(!e)return null;if("dev-elements"===e)return"https://dev.elements.zonos.com:7002";const o=`https://${e}.preview.js.zonos.com`;return t(`[ZONOS-WARNING] using '${o}' for loading script`,"warn"),fetch(o).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${o}' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE`);const e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");const{pathname:t}=window.location,r=`${t}?${e.toString()}`;return window.history.replaceState({},"",r),window.location.reload(),null})),o})();class a{}s=a,a.isBigCommerce=!1,a.requested=!1,a.internationalHideSelector="",a.zonosQaUrl=null,a.tempCartData=null,a.zonosApiKey=null,a.isLegacyCheckout=!1,a.legacyStoreLogo=null,a.legacyStoreFavicon=null,a.parallelLoadTimes=[],a.paralellLoadState="off",a.loadScriptLogHandler=async({cdnLoadTime:e,fallbackLoadTime:o,isError:t,metadata:r,scriptLoadUrl:n,storeId:s,type:i})=>{try{const e=window.performance.getEntriesByType("resource").find((e=>{const o=e;return o.name.includes(n)&&"script"===o.initiatorType}));null==e||e.transferSize;(async e=>{})((e&&(null==e?void 0:e.duration)>0?parseFloat(e.duration.toFixed(2)):parseFloat(o.toFixed(2)),Object.assign({decodedBodySize:null==e?void 0:e.decodedBodySize,encodedBodySize:null==e?void 0:e.encodedBodySize,fallbackLoadTime:o,isError:!!t},r)))}catch(e){}},a.loadScriptLogParallelHandler=async e=>{try{if(s.parallelLoadTimes.push(e),2===s.parallelLoadTimes.length){const e=s.parallelLoadTimes.find((e=>"vercel"===e.type)),o=s.parallelLoadTimes.find((e=>"jsdelivr"===e.type));if(!e||!o)return;if(e.isError&&o.isError)return void n({endpoint:`<${e.scriptLoadUrl}> <${o.scriptLoadUrl}>`,errors:["Failed to fetch both Vercel and jsdelivr CDN. Perhaps network issue on customer site."],metadata:{cdnLoadTime:o.fallbackLoadTime,cdnType:o.type,vercelLoadTime:e.fallbackLoadTime}});s.loadScriptLogHandler({cdnLoadTime:o.fallbackLoadTime,fallbackLoadTime:e.fallbackLoadTime,isError:e.isError,metadata:{cdnScriptFallbackTime:o.fallbackLoadTime,cdnScriptIsError:!!o.isError,cdnScriptLoadUrl:o.scriptLoadUrl,cdnScriptType:o.type},scriptLoadUrl:e.scriptLoadUrl,storeId:e.storeId,type:e.type})}}catch(e){}},a.legacyCheckoutErrorHandler=({message:e,tempCartUUID:o})=>{r(`[ZONOS - loadZonos] ${e}`),n({endpoint:"LegacyCheckoutInit",errors:[e],metadata:{tempCartUUID:o}}),document.dispatchEvent(new CustomEvent("legacyCheckoutError",{detail:e}))},a.injectZonos=({initConfig:e,isGithubCdn:o=!1,parallelLoaded:r,url:a,version:c})=>{var l;const d=()=>{const e="https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.14-alpha.0";return c?e.replace(/@zonos\/elements@(.+)/,`@zonos/elements@${c}`):e},p=i||a,m=p.replace("https://","").replace("http://",""),u=document.createElement("script"),g=c&&c<"1.2.5"?"loadZonos.js":"zonos.js";u.src=`https://${m}/dist/scripts/${g}`,t(`[ZONOS - loadZonos] Injecting "${g}" from "${m}"`,"info");const w="4g"===(null===(l=(()=>{const e="connection"in window.navigator?window.navigator.connection:null,o="mozConnection"in window.navigator?window.navigator.mozConnection:null,t="webkitConnection"in window.navigator?window.navigator.webkitConnection:null;return e||o||t})())||void 0===l?void 0:l.effectiveType),y=["dev.elements.zonos.com","zonos.com"].some((e=>window.location.href.includes(e))),h="on"===s.paralellLoadState&&w&&!o&&!y;if(h){const o=d();s.injectZonos({initConfig:e,isGithubCdn:!0,parallelLoaded:!0,url:o,version:c})}const f=performance.now();u.addEventListener("load",(()=>{if(h||r?s.loadScriptLogParallelHandler({fallbackLoadTime:performance.now()-f,scriptLoadUrl:u.src,storeId:s.storeId,type:o?"jsdelivr":"vercel"}):s.loadScriptLogHandler({fallbackLoadTime:performance.now()-f,scriptLoadUrl:u.src,storeId:s.storeId,type:o?"jsdelivr":"vercel"}),s.isBigCommerce||(s.isBigCommerce=!!window.stencilBootstrap||!!window.bcConfig||!!document.querySelector('script[src*="bigcommerce.com"]')),window.Zonos.zonosQaUrl=i,window.Zonos.internationalHideSelector=s.internationalHideSelector,window.Zonos.isBigCommerce=s.isBigCommerce,s.isLegacyCheckout){if(!s.zonosApiKey)throw s.legacyCheckoutErrorHandler({message:"zonosApiKey is required for legacy checkout",tempCartUUID:e.tempCartUUID}),new Error("zonosApiKey is required for legacy checkout");if(!s.tempCartData)throw s.legacyCheckoutErrorHandler({message:"tempCartData is required for legacy checkout",tempCartUUID:e.tempCartUUID}),new Error("zonosApiKey is required for legacy checkout");if(s.legacyStoreFavicon){const e=document.createElement("link");e.rel="shortcut icon",e.type="image/x-icon",e.href=s.legacyStoreFavicon,document.head.appendChild(e)}window.Zonos.tempCartData=s.tempCartData;const o=Object.assign(Object.assign({},e),{appearance:Object.assign(Object.assign({},e.appearance),{logoUrl:s.legacyStoreLogo||""}),checkoutSettings:Object.assign(Object.assign({},e.checkoutSettings),{successBehavior:"ZONOS_SUCCESS_PAGE",successRedirectUrl:s.tempCartData.contShoppingURL}),zonosApiKey:s.zonosApiKey});e=o}window.Zonos.version&&(t(`[ZONOS - loadZonos] Execute "Zonos.init" from "${g}" from "${m}"`,"info"),window.Zonos.init(e))})),u.addEventListener("error",(async()=>{if(!h&&!r){const o=d();s.injectZonos({initConfig:e,isGithubCdn:!0,url:o,version:c})}["localhost",".zonos.com"].some((e=>window.location.href.includes(e)))||i||(h||r?s.loadScriptLogParallelHandler({fallbackLoadTime:performance.now()-f,isError:!0,scriptLoadUrl:u.src,storeId:s.storeId,type:o?"jsdelivr":"vercel"}):n(o?{endpoint:u.src,errors:["zonos.js - Failed to fetch github CDN."],metadata:{cdnLoadTime:performance.now()-f,cdnType:"jsdelivr",loadUrl:p,version:c}}:{endpoint:u.src,errors:["[Info] Using alternative CDN. Failed to fetch script"],metadata:{vercelLoadTime:performance.now()-f}}))})),document.head.appendChild(u)},a.setupCartData=async e=>{const n=await(async e=>{const{errors:t,json:r}=await o("https://v1.route.js.zonos.com/api/bigcommerce/legacy-migration/get-temp-cart",{body:{tempCartUUID:e},headers:{"Content-Type":"application/json"},method:"POST"});return!r||t.length?null:r})(e);if(t("[ZONOS - loadZonos] getting temp cart data","info",n),!n)throw r("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),s.legacyCheckoutErrorHandler({message:"Error getting temp cart data",tempCartUUID:e}),new Error("Error getting temp cart data");return s.tempCartData=n.tempCart,s.legacyStoreLogo=n.storeLogoUrl,s.legacyStoreFavicon=n.storeFaviconUrl,{storeId:n.tempCart.storeId,zonosApiKey:n.zonosApiKey}},a.init=async e=>{var n;const i="https://v1.3.14-alpha.0.js.zonos.com",a=null===(n=document.querySelector("script[src*='/loadZonos.js']"))||void 0===n?void 0:n.src,c=document.querySelector('script[src*="/zonos.js"]'),l=null==a?void 0:a.includes("timestamp=");if(!a||!l)return void r("[ZONOS - loadZonos] A timestamp is required as a query parameter in the loadZonos.js script source. This timestamp ensures that you are loading the most recent version of the script, avoiding any cached versions.");if(c||!a||s.requested)return void t("[ZONOS - loadZonos] script is already loaded or requested","info");s.requested=!0;let d=e.storeId;if(e.tempCartUUID){const o=await s.setupCartData(e.tempCartUUID);d=o.storeId,s.zonosApiKey=o.zonosApiKey,s.isLegacyCheckout=!0}if(!d)return t("[ZONOS - loadZonos] loading latest script since storeId is not provided."),void s.injectZonos({initConfig:e,url:i,version:null});s.storeId=d;const p=new URL("https://v1.route.js.zonos.com/api/get-store-version");p.searchParams.set("storeId",e.storeId.toString());const{errors:m,json:u}=await o(p.toString());if(m.length||!u)return t("[ZONOS - loadZonos] Error getting store version, loadding the latest version.","error"),void s.injectZonos({initConfig:e,url:i,version:null});const{version:g}=u;if(!c){const{currentLoadScriptUrl:o,isForceLoadVersionDomain:r,isWhiteListed:n}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const o=new URL(e).origin,t=["dev.elements.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>o.includes(e))),r=["qa.js.zonos.com"].some((e=>o.includes(e)));return{currentLoadScriptUrl:o,isForceLoadVersionDomain:r,isWhiteListed:t}})({loadScriptSrc:a}),i=n&&!r?o:`${"alpha"===g?"alpha":`v${g}`}.js.zonos.com`,c=n&&!r?null:g;t("[ZONOS - loadZonos] injecting zonos script","info",{currentLoadScriptUrl:o,isForceLoadVersionDomain:r,isWhiteListed:n,loadUrl:i,loadVersion:c,version:g}),s.injectZonos({initConfig:e,url:i,version:c})}},void 0===window.Zonos&&(window.Zonos=a)})();
|
|
1
|
+
(function(){"use strict";"function"==typeof SuppressedError&&SuppressedError;const e=async({response:e,shouldLog:o=!0,shouldThrow:t=!1})=>{try{return await e.json()}catch(e){if(t)throw e;return o&&console.error(e),null}};const o=async(o,t)=>{const r=(function(e,o){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&o.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(e);n<r.length;n++)o.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(t[r[n]]=e[r[n]])}return t})(t||{},[]),n=r.body?JSON.stringify(r.body):void 0,s=r.method||"GET",i=new URL(o);i.searchParams.set("zToken",(function(e){try{return btoa(e).replace(/=/g,"")}catch(o){return e.replace(/[^A-Za-z0-9]/g,"").split("").reverse().join("")}})(window.location.hostname));const a=Object.assign({"Content-Type":"application/json","Zonos-Is-BigCommerce":window.Zonos.isBigCommerce.toString(),"Zonos-Referer":window.location.hostname,"Zonos-Version":window.Zonos.version,credentialtoken:window.Zonos.zonosApiKey||"Empty credential token from zonos-elements"},r.headers),c=Object.assign(Object.assign({},r),{body:"GET"===s?void 0:n,headers:a,method:s});return(async(o,t)=>{let r;try{r=await fetch(o,t)}catch(e){return e instanceof Error?{errors:[{message:e.message,type:"unknown"}],json:null,response:null}:{errors:[{message:"Fail to fetch",type:"unknown"}],json:null,response:null}}const n=r.headers.get("Zonos-Mode"),s=window.Zonos.zonosQaUrl;if(!window.Zonos.modeAlerted&&n&&s&&("production"===n&&alert("Please be aware that you are currently operating in the production environment. Any interactions with the customer store, including payments, will be processed as real transactions!"),"test"===n&&alert("For testing payments, you can utilize the test payment information provided at this link: https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements#web-test-the-integration"),window.Zonos.modeAlerted=!0),r.ok)return{errors:[],json:await e({response:r}),response:r};const i=r.status.toString();try{const o=await e({response:r,shouldThrow:!0});return{errors:[{message:`${i}: ${JSON.stringify(o)}`,type:i}],json:null,response:r}}catch(e){return{errors:[{message:`${i}: Unknown error`,type:i}],json:null,response:null}}})(i.toString(),c)},t=(e,o,...t)=>{var r,n;if(!(!!(null===(r=window.Zonos)||void 0===r?void 0:r.debug)||!!window.location.search.match(/\?.*(&*)zonosDebug=1/)))return void("error"===o&&console.error(e,...t));let s=document.querySelector("iframe#zonos---debug-logging-iframe");s||(s=document.createElement("iframe"),s.id="zonos---debug-logging-iframe",s.style.display="none",s.style.opacity="0",s.style.position="absolute",s.style.top="-9999px",s.style.left="-9999px",s.style.width="1px",s.style.height="1px",s.style.border="none",s.style.overflow="hidden",s.style.visibility="hidden",document.body.appendChild(s));const i=(null===(n=s.contentWindow)||void 0===n?void 0:n.window.console)||window.console;switch(o){case"warn":i.warn(e,...t);break;case"info":i.info(e,...t);break;case"error":i.error(e,...t);break;default:i.groupCollapsed(e,...t),i.trace(),i.groupEnd()}},r=(e,...o)=>{t(e,"error",...o)},n=async({endpoint:e,errors:t,metadata:r})=>{const n="userAgentData"in window.navigator?window.navigator.userAgentData:null,s={endpoint:e,errors:t,metadata:Object.assign({href:window.location.href,userAgent:n&&n.brands.length>0?n:window.navigator.userAgent},r)};o("https://v1.route.js.zonos.com/api/zonos-elements/log-error",{body:s,method:"POST"})};var s;const i=(()=>{const e=(e=>{if(!e)return null;const o=new URL(e).searchParams.get("zonosQaUrl");return o?/[^a-zA-Z0-9-_]+/.test(o)?null:o:null})(window.location.href);if(!e)return null;if("dev-elements"===e)return"https://dev.elements.zonos.com:7002";const o=`https://${e}.preview.js.zonos.com`;return t(`[ZONOS-WARNING] using '${o}' for loading script`,"warn"),fetch(o).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${o}' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE`);const e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");const{pathname:t}=window.location,r=`${t}?${e.toString()}`;return window.history.replaceState({},"",r),window.location.reload(),null})),o})();class a{}s=a,a.isBigCommerce=!1,a.requested=!1,a.internationalHideSelector="",a.zonosQaUrl=null,a.tempCartData=null,a.zonosApiKey=null,a.isLegacyCheckout=!1,a.legacyStoreLogo=null,a.legacyStoreFavicon=null,a.parallelLoadTimes=[],a.paralellLoadState="off",a.loadScriptLogHandler=async({cdnLoadTime:e,fallbackLoadTime:o,isError:t,metadata:r,scriptLoadUrl:n,storeId:s,type:i})=>{try{const e=window.performance.getEntriesByType("resource").find((e=>{const o=e;return o.name.includes(n)&&"script"===o.initiatorType}));null==e||e.transferSize;(async e=>{})((e&&(null==e?void 0:e.duration)>0?parseFloat(e.duration.toFixed(2)):parseFloat(o.toFixed(2)),Object.assign({decodedBodySize:null==e?void 0:e.decodedBodySize,encodedBodySize:null==e?void 0:e.encodedBodySize,fallbackLoadTime:o,isError:!!t},r)))}catch(e){}},a.loadScriptLogParallelHandler=async e=>{try{if(s.parallelLoadTimes.push(e),2===s.parallelLoadTimes.length){const e=s.parallelLoadTimes.find((e=>"vercel"===e.type)),o=s.parallelLoadTimes.find((e=>"jsdelivr"===e.type));if(!e||!o)return;if(e.isError&&o.isError)return void n({endpoint:`<${e.scriptLoadUrl}> <${o.scriptLoadUrl}>`,errors:["Failed to fetch both Vercel and jsdelivr CDN. Perhaps network issue on customer site."],metadata:{cdnLoadTime:o.fallbackLoadTime,cdnType:o.type,vercelLoadTime:e.fallbackLoadTime}});s.loadScriptLogHandler({cdnLoadTime:o.fallbackLoadTime,fallbackLoadTime:e.fallbackLoadTime,isError:e.isError,metadata:{cdnScriptFallbackTime:o.fallbackLoadTime,cdnScriptIsError:!!o.isError,cdnScriptLoadUrl:o.scriptLoadUrl,cdnScriptType:o.type},scriptLoadUrl:e.scriptLoadUrl,storeId:e.storeId,type:e.type})}}catch(e){}},a.legacyCheckoutErrorHandler=({message:e,tempCartUUID:o})=>{r(`[ZONOS - loadZonos] ${e}`),n({endpoint:"LegacyCheckoutInit",errors:[e],metadata:{tempCartUUID:o}}),document.dispatchEvent(new CustomEvent("legacyCheckoutError",{detail:e}))},a.injectZonos=({initConfig:e,isGithubCdn:o=!1,parallelLoaded:r,url:a,version:c})=>{var l;const d=()=>{const e="https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.14";return c?e.replace(/@zonos\/elements@(.+)/,`@zonos/elements@${c}`):e},p=i||a,m=p.replace("https://","").replace("http://",""),u=document.createElement("script"),g=c&&c<"1.2.5"?"loadZonos.js":"zonos.js";u.src=`https://${m}/dist/scripts/${g}`,t(`[ZONOS - loadZonos] Injecting "${g}" from "${m}"`,"info");const w="4g"===(null===(l=(()=>{const e="connection"in window.navigator?window.navigator.connection:null,o="mozConnection"in window.navigator?window.navigator.mozConnection:null,t="webkitConnection"in window.navigator?window.navigator.webkitConnection:null;return e||o||t})())||void 0===l?void 0:l.effectiveType),y=["dev.elements.zonos.com","zonos.com"].some((e=>window.location.href.includes(e))),h="on"===s.paralellLoadState&&w&&!o&&!y;if(h){const o=d();s.injectZonos({initConfig:e,isGithubCdn:!0,parallelLoaded:!0,url:o,version:c})}const f=performance.now();u.addEventListener("load",(()=>{if(h||r?s.loadScriptLogParallelHandler({fallbackLoadTime:performance.now()-f,scriptLoadUrl:u.src,storeId:s.storeId,type:o?"jsdelivr":"vercel"}):s.loadScriptLogHandler({fallbackLoadTime:performance.now()-f,scriptLoadUrl:u.src,storeId:s.storeId,type:o?"jsdelivr":"vercel"}),s.isBigCommerce||(s.isBigCommerce=!!window.stencilBootstrap||!!window.bcConfig||!!document.querySelector('script[src*="bigcommerce.com"]')),window.Zonos.zonosQaUrl=i,window.Zonos.internationalHideSelector=s.internationalHideSelector,window.Zonos.isBigCommerce=s.isBigCommerce,s.isLegacyCheckout){if(!s.zonosApiKey)throw s.legacyCheckoutErrorHandler({message:"zonosApiKey is required for legacy checkout",tempCartUUID:e.tempCartUUID}),new Error("zonosApiKey is required for legacy checkout");if(!s.tempCartData)throw s.legacyCheckoutErrorHandler({message:"tempCartData is required for legacy checkout",tempCartUUID:e.tempCartUUID}),new Error("zonosApiKey is required for legacy checkout");if(s.legacyStoreFavicon){const e=document.createElement("link");e.rel="shortcut icon",e.type="image/x-icon",e.href=s.legacyStoreFavicon,document.head.appendChild(e)}window.Zonos.tempCartData=s.tempCartData;const o=Object.assign(Object.assign({},e),{appearance:Object.assign(Object.assign({},e.appearance),{logoUrl:s.legacyStoreLogo||""}),checkoutSettings:Object.assign(Object.assign({},e.checkoutSettings),{successBehavior:"ZONOS_SUCCESS_PAGE",successRedirectUrl:s.tempCartData.contShoppingURL}),zonosApiKey:s.zonosApiKey});e=o}window.Zonos.version&&(t(`[ZONOS - loadZonos] Execute "Zonos.init" from "${g}" from "${m}"`,"info"),window.Zonos.init(e))})),u.addEventListener("error",(async()=>{if(!h&&!r){const o=d();s.injectZonos({initConfig:e,isGithubCdn:!0,url:o,version:c})}["localhost",".zonos.com"].some((e=>window.location.href.includes(e)))||i||(h||r?s.loadScriptLogParallelHandler({fallbackLoadTime:performance.now()-f,isError:!0,scriptLoadUrl:u.src,storeId:s.storeId,type:o?"jsdelivr":"vercel"}):n(o?{endpoint:u.src,errors:["zonos.js - Failed to fetch github CDN."],metadata:{cdnLoadTime:performance.now()-f,cdnType:"jsdelivr",loadUrl:p,version:c}}:{endpoint:u.src,errors:["[Info] Using alternative CDN. Failed to fetch script"],metadata:{vercelLoadTime:performance.now()-f}}))})),document.head.appendChild(u)},a.setupCartData=async e=>{const n=await(async e=>{const{errors:t,json:r}=await o("https://v1.route.js.zonos.com/api/bigcommerce/legacy-migration/get-temp-cart",{body:{tempCartUUID:e},headers:{"Content-Type":"application/json"},method:"POST"});return!r||t.length?null:r})(e);if(t("[ZONOS - loadZonos] getting temp cart data","info",n),!n)throw r("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),s.legacyCheckoutErrorHandler({message:"Error getting temp cart data",tempCartUUID:e}),new Error("Error getting temp cart data");return s.tempCartData=n.tempCart,s.legacyStoreLogo=n.storeLogoUrl,s.legacyStoreFavicon=n.storeFaviconUrl,{storeId:n.tempCart.storeId,zonosApiKey:n.zonosApiKey}},a.init=async e=>{var n;const i="https://v1.3.14.js.zonos.com",a=null===(n=document.querySelector("script[src*='/loadZonos.js']"))||void 0===n?void 0:n.src,c=document.querySelector('script[src*="/zonos.js"]'),l=null==a?void 0:a.includes("timestamp=");if(!a||!l)return void r("[ZONOS - loadZonos] A timestamp is required as a query parameter in the loadZonos.js script source. This timestamp ensures that you are loading the most recent version of the script, avoiding any cached versions.");if(c||!a||s.requested)return void t("[ZONOS - loadZonos] script is already loaded or requested","info");s.requested=!0;let d=e.storeId;if(e.tempCartUUID){const o=await s.setupCartData(e.tempCartUUID);d=o.storeId,s.zonosApiKey=o.zonosApiKey,s.isLegacyCheckout=!0}if(!d)return t("[ZONOS - loadZonos] loading latest script since storeId is not provided."),void s.injectZonos({initConfig:e,url:i,version:null});s.storeId=d;const p=new URL("https://v1.route.js.zonos.com/api/get-store-version");p.searchParams.set("storeId",e.storeId.toString());const{errors:m,json:u}=await o(p.toString());if(m.length||!u)return t("[ZONOS - loadZonos] Error getting store version, loadding the latest version.","error"),void s.injectZonos({initConfig:e,url:i,version:null});const{version:g}=u;if(!c){const{currentLoadScriptUrl:o,isForceLoadVersionDomain:r,isWhiteListed:n}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const o=new URL(e).origin,t=["dev.elements.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>o.includes(e))),r=["qa.js.zonos.com"].some((e=>o.includes(e)));return{currentLoadScriptUrl:o,isForceLoadVersionDomain:r,isWhiteListed:t}})({loadScriptSrc:a}),i=n&&!r?o:`${"alpha"===g?"alpha":`v${g}`}.js.zonos.com`,c=n&&!r?null:g;t("[ZONOS - loadZonos] injecting zonos script","info",{currentLoadScriptUrl:o,isForceLoadVersionDomain:r,isWhiteListed:n,loadUrl:i,loadVersion:c,version:g}),s.injectZonos({initConfig:e,url:i,version:c})}},void 0===window.Zonos&&(window.Zonos=a)})();
|
package/dist/scripts/zonos.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";const e=(e,t,...o)=>{var n,r;if(!(!!(null===(n=window.Zonos)||void 0===n?void 0:n.debug)||!!window.location.search.match(/\?.*(&*)zonosDebug=1/)))return void("error"===t&&console.error(e,...o));let s=document.querySelector("iframe#zonos---debug-logging-iframe");s||(s=document.createElement("iframe"),s.id="zonos---debug-logging-iframe",s.style.display="none",s.style.opacity="0",s.style.position="absolute",s.style.top="-9999px",s.style.left="-9999px",s.style.width="1px",s.style.height="1px",s.style.border="none",s.style.overflow="hidden",s.style.visibility="hidden",document.body.appendChild(s));const i=(null===(r=s.contentWindow)||void 0===r?void 0:r.window.console)||window.console;switch(t){case"warn":i.warn(e,...o);break;case"info":i.info(e,...o);break;case"error":i.error(e,...o);break;default:i.groupCollapsed(e,...o),i.trace(),i.groupEnd()}},t=(t,...o)=>{e(t,"error",...o)},o="https://js.stripe.com/v3",n=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,r="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let s=null;const i=e=>(null!==s||(s=new Promise(((s,i)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(r),window.Stripe)s(window.Stripe);else try{let l=(()=>{const e=document.querySelectorAll(`script[src^="${o}"]`);for(let t=0;t<e.length;t++){const o=e[t];if(o&&n.test(o.src))return o}return null})();l&&e?console.warn(r):l||(l=(e=>{const n=document.createElement("script");n.src=`${o}`;const r=document.head||document.body;return r?(r.appendChild(n),n):(t("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})()),null==l||l.addEventListener("load",(()=>{window.Stripe?s(window.Stripe):i(new Error("Stripe.js not available"))})),null==l||l.addEventListener("error",(()=>{i(new Error("Failed to load Stripe.js"))}))}catch(e){return void i(e)}else s(null)}))),s),l=Promise.resolve().then((()=>i(null)));let c=!1;l.catch((e=>{c||console.warn(e)}));var d;const a=(()=>{const e=document.querySelector('script[src*="/zonos.js"]'),{currentLoadScriptUrl:t,isWhiteListed:o}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const t=new URL(e).origin,o=["dev.elements.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>t.includes(e))),n=["qa.js.zonos.com"].some((e=>t.includes(e)));return{currentLoadScriptUrl:t,isForceLoadVersionDomain:n,isWhiteListed:o}})({loadScriptSrc:null==e?void 0:e.src});return o?t:null})()||"https://v1.3.14
|
|
1
|
+
(function(){"use strict";const e=(e,t,...o)=>{var n,r;if(!(!!(null===(n=window.Zonos)||void 0===n?void 0:n.debug)||!!window.location.search.match(/\?.*(&*)zonosDebug=1/)))return void("error"===t&&console.error(e,...o));let s=document.querySelector("iframe#zonos---debug-logging-iframe");s||(s=document.createElement("iframe"),s.id="zonos---debug-logging-iframe",s.style.display="none",s.style.opacity="0",s.style.position="absolute",s.style.top="-9999px",s.style.left="-9999px",s.style.width="1px",s.style.height="1px",s.style.border="none",s.style.overflow="hidden",s.style.visibility="hidden",document.body.appendChild(s));const i=(null===(r=s.contentWindow)||void 0===r?void 0:r.window.console)||window.console;switch(t){case"warn":i.warn(e,...o);break;case"info":i.info(e,...o);break;case"error":i.error(e,...o);break;default:i.groupCollapsed(e,...o),i.trace(),i.groupEnd()}},t=(t,...o)=>{e(t,"error",...o)},o="https://js.stripe.com/v3",n=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,r="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let s=null;const i=e=>(null!==s||(s=new Promise(((s,i)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(r),window.Stripe)s(window.Stripe);else try{let l=(()=>{const e=document.querySelectorAll(`script[src^="${o}"]`);for(let t=0;t<e.length;t++){const o=e[t];if(o&&n.test(o.src))return o}return null})();l&&e?console.warn(r):l||(l=(e=>{const n=document.createElement("script");n.src=`${o}`;const r=document.head||document.body;return r?(r.appendChild(n),n):(t("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})()),null==l||l.addEventListener("load",(()=>{window.Stripe?s(window.Stripe):i(new Error("Stripe.js not available"))})),null==l||l.addEventListener("error",(()=>{i(new Error("Failed to load Stripe.js"))}))}catch(e){return void i(e)}else s(null)}))),s),l=Promise.resolve().then((()=>i(null)));let c=!1;l.catch((e=>{c||console.warn(e)}));var d;const a=(()=>{const e=document.querySelector('script[src*="/zonos.js"]'),{currentLoadScriptUrl:t,isWhiteListed:o}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const t=new URL(e).origin,o=["dev.elements.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>t.includes(e))),n=["qa.js.zonos.com"].some((e=>t.includes(e)));return{currentLoadScriptUrl:t,isForceLoadVersionDomain:n,isWhiteListed:o}})({loadScriptSrc:null==e?void 0:e.src});return o?t:null})()||"https://v1.3.14.js.zonos.com",u="https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.14",m="https://rsms.me",p="https://fonts.googleapis.com",h=/^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;class y{}d=y,y.doneInit=!1,y.debug=!!window.location.search.match(/\?.*(&*)zonosDebug=1/),y.zonosConversionTest=!!window.location.search.match(/\?.*(&*)zonosConversionTest/),y.isBigCommerce=!1,y.internationalHideSelector="",y.zonosQaUrl=null,y.version="v1.3.14",y.modeAlerted=!1,y.tempCartData=null,y.getCurrentTimestamp=()=>(new Date).getTime(),y.zonosController=null,y.init=async({appearance:o,checkoutSettings:n,currencyConverter:r,helloSettings:s,storeId:i,zonosApiKey:l})=>{d.doneInit||(e(`====== ZONOS DEBUG MODE: on (${d.version}) ======`),l?(d.zonosApiKey=l,d.storeId=i,e("init zonos"),d.injectSentryScript(),d.injectZonosCdn(),d.injectZonosCss(),d.injectFonts(),d.injectController({config:{appearance:o,checkoutSettings:n,currencyConverter:r,helloSettings:s},zonosApiKey:l}),d.doneInit=!0):t("Missing Zonos API key"))},y.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},y.openHelloDialog=e=>{const t=document.querySelector("zonos-hello");t&&t.openHelloDialog(null==e||e)},y.showNotification=e=>{var t;null===(t=d.zonosController)||void 0===t||t.showNotification(e)},y.updateOrganizationName=e=>{var t;null===(t=d.zonosController)||void 0===t||t.updateOrganizationName(e)},y.disablePlaceOrderButtons=({autoEnable:e=!0,disable:t,placeOrderButtonSelector:o})=>{if(o){const n=document.querySelectorAll(o),r=e=>{e.target.getAttribute("disabled")&&(e.preventDefault(),e.stopPropagation())};n.forEach((e=>{e.getAttribute("data-zonos-checkout-attached")||(t?(e.setAttribute("disabled","true"),e.addEventListener("click",r)):(e.removeAttribute("disabled"),e.removeEventListener("click",r)))})),e&&t&&setTimeout((()=>{n.forEach((e=>{e.removeAttribute("disabled"),e.removeEventListener("click",r)}))}),5e3)}},y.injectController=({config:o,zonosApiKey:n})=>{var r;if(document.querySelector("zonos-controller"))return;if(null===(r=o.checkoutSettings)||void 0===r?void 0:r.placeOrderButtonSelector){const e=o.checkoutSettings.placeOrderButtonSelector;d.disablePlaceOrderButtons({disable:!0,placeOrderButtonSelector:e});new MutationObserver((()=>{d.disablePlaceOrderButtons({disable:!0,placeOrderButtonSelector:e})})).observe(document.body,{childList:!0,subtree:!0})}const s=document.createElement("zonos-controller");s.config=o,s.zonosApiKey=n,s.addEventListener("stripeInitEvent",(async o=>{const{detail:n}=o;e("loading Stripe");const r=await(async(...e)=>{c=!0;const t=Date.now();return l.then((o=>((e,t,o)=>{if(null===e)return null;const n=e.apply(void 0,t);return((e,t)=>{e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",startTime:t})})(n,o),n})(o,e,t)))})(n.publishableKey);r?(window.Zonos.stripe=r,s.initCheckoutElement(r)):t("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(s),d.zonosController=s,e("Zonos controller injected!")},y.injectSentryScript=()=>{const o="https://browser.sentry-cdn.com/7.88.0/bundle.tracing.min.js";if(document.querySelector(`script[src="${o}"]`))return void e("Sentry script already exists in the document","warn");const n=document.head||document.body,r=document.createElement("script");r.crossOrigin="anonymous",r.src=o,r.integrity="sha384-z/aQww1Fr6Mes0MO/2wlzQd2nXBCdDcKPXDTsMDMNPgTGRPqii3a4bzH79I+Vo8l",r.setAttribute("data-lazy","no"),r.onerror=()=>{t(`Failed to load ${r.src}`)},r.onload=()=>{var e;null===(e=window.Sentry)||void 0===e||e.init({beforeSend(e){var t,o,n,r,s,i;const l=null===(i=null===(s=null===(r=null===(n=null===(o=null===(t=e.exception)||void 0===t?void 0:t.values)||void 0===o?void 0:o[0])||void 0===n?void 0:n.stacktrace)||void 0===r?void 0:r.frames)||void 0===s?void 0:s[0])||void 0===i?void 0:i.filename,c=(null==l?void 0:l.includes("js.zonos.com"))||(null==l?void 0:l.includes("@zonos/elements")),d=window.location.href.includes("dev.elements")||window.location.href.includes("route.js.zonos.com");return c&&!d?e:null},dsn:"https://19168bd05af0e2e0e7520ad58953e4f2@o446983.ingest.sentry.io/4506400622837760",ignoreErrors:["Failed to load Stripe.js"],release:`zonos-elements@${d.version}`,tracesSampler:({transactionContext:e})=>"pageload"===e.op?1:.25})},n.appendChild(r)},y.injectScript=({fallBackDomain:o,isModule:n,scriptDomain:r,theRestUrl:s})=>{const i=`${r}/${s}`;if(document.querySelector(`script[src="${i}"]`))return void e(`Zonos script "${i}" already exists in the document`,"warn");const l=document.head||document.body,c=document.createElement("script");n?c.type="module":c.noModule=!0,c.src=i,c.crossOrigin="anonymous",c.onerror=()=>{/\/\/v\d+\./g.test(r)?(o&&d.injectScript({isModule:n,scriptDomain:o,theRestUrl:s}),t(`Failed to load ${c.src}`)):e("No need to fallback since this is not a versioned domain","warn")},l.appendChild(c)},y.injectZonosCdn=()=>{d.injectScript({fallBackDomain:u,isModule:!0,scriptDomain:a,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),d.injectScript({fallBackDomain:u,isModule:!1,scriptDomain:a,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),e("Zonos cdn script injected!")},y.injectStylesheet=({fallBackDomain:o,stylesheetDomain:n,theRestUrl:r})=>{const s=document.head||document.body,i=document.createElement("link");i.rel="preconnect",i.href=`${a}/`,s.appendChild(i);const l=document.createElement("link");l.rel="stylesheet",l.href=`${n}/${r}`,l.onerror=()=>{const s=/\/\/v\d+\./g.test(n);s?(o&&s&&d.injectStylesheet({stylesheetDomain:o,theRestUrl:r}),t(`Failed to load ${l.href}`)):e("No need to fallback since this is not a versioned domain","warn")},s.appendChild(l)},y.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?e("Zonos style links already injected","warn"):(d.injectStylesheet({fallBackDomain:u,stylesheetDomain:a,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),e("Zonos style css injected!"))},y.injectFonts=()=>{if((()=>{const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${m}"]`);for(let t=0;t<e.length;t++){const o=e[t];if(o&&!h.test(o.href))return o}return null})())return void e("Inter font already injected","warn");const t=document.head||document.body,o=document.createElement("link");o.rel="preconnect",o.href=m,t.appendChild(o);const n=document.createElement("link");n.rel="stylesheet",n.href=`${m}/inter/inter.css`,t.appendChild(n),e("Zonos font injected!")},y.setupGoogleFont=e=>{var t;null===(t=d.zonosController)||void 0===t||t.setupGoogleFont(e)},y.injectSupportGoogleFont=t=>{var o;e(`[FONT] injecting ${t}`);const n=null===(o=t.match(/family=(.*?):/))||void 0===o?void 0:o[1],r=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${p}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=p,r.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${t}"]`))return void e(`[FONT] ${n} font already injected`,"warn");const s=document.createElement("link");s.rel="stylesheet",s.href=t,r.appendChild(s),e(`[FONT] ${n} font injected!`)},window.Zonos&&window.Zonos.doneInit||(window.Zonos=y)})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";const e=(e,t,...o)=>{var n,r;if(!(!!(null===(n=window.Zonos)||void 0===n?void 0:n.debug)||!!window.location.search.match(/\?.*(&*)zonosDebug=1/)))return void("error"===t&&console.error(e,...o));let s=document.querySelector("iframe#zonos---debug-logging-iframe");s||(s=document.createElement("iframe"),s.id="zonos---debug-logging-iframe",s.style.display="none",s.style.opacity="0",s.style.position="absolute",s.style.top="-9999px",s.style.left="-9999px",s.style.width="1px",s.style.height="1px",s.style.border="none",s.style.overflow="hidden",s.style.visibility="hidden",document.body.appendChild(s));const i=(null===(r=s.contentWindow)||void 0===r?void 0:r.window.console)||window.console;switch(t){case"warn":i.warn(e,...o);break;case"info":i.info(e,...o);break;case"error":i.error(e,...o);break;default:i.groupCollapsed(e,...o),i.trace(),i.groupEnd()}},t=(t,...o)=>{e(t,"error",...o)},o="https://js.stripe.com/v3",n=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,r="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let s=null;const i=e=>(null!==s||(s=new Promise(((s,i)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(r),window.Stripe)s(window.Stripe);else try{let l=(()=>{const e=document.querySelectorAll(`script[src^="${o}"]`);for(let t=0;t<e.length;t++){const o=e[t];if(o&&n.test(o.src))return o}return null})();l&&e?console.warn(r):l||(l=(e=>{const n=document.createElement("script");n.src=`${o}`;const r=document.head||document.body;return r?(r.appendChild(n),n):(t("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})()),null==l||l.addEventListener("load",(()=>{window.Stripe?s(window.Stripe):i(new Error("Stripe.js not available"))})),null==l||l.addEventListener("error",(()=>{i(new Error("Failed to load Stripe.js"))}))}catch(e){return void i(e)}else s(null)}))),s),l=Promise.resolve().then((()=>i(null)));let c=!1;l.catch((e=>{c||console.warn(e)}));var d;const a=(()=>{const e=document.querySelector('script[src*="/zonos.js"]'),{currentLoadScriptUrl:t,isWhiteListed:o}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const t=new URL(e).origin,o=["dev.elements.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>t.includes(e))),n=["qa.js.zonos.com"].some((e=>t.includes(e)));return{currentLoadScriptUrl:t,isForceLoadVersionDomain:n,isWhiteListed:o}})({loadScriptSrc:null==e?void 0:e.src});return o?t:null})()||"https://v1.3.14
|
|
1
|
+
(function(){"use strict";const e=(e,t,...o)=>{var n,r;if(!(!!(null===(n=window.Zonos)||void 0===n?void 0:n.debug)||!!window.location.search.match(/\?.*(&*)zonosDebug=1/)))return void("error"===t&&console.error(e,...o));let s=document.querySelector("iframe#zonos---debug-logging-iframe");s||(s=document.createElement("iframe"),s.id="zonos---debug-logging-iframe",s.style.display="none",s.style.opacity="0",s.style.position="absolute",s.style.top="-9999px",s.style.left="-9999px",s.style.width="1px",s.style.height="1px",s.style.border="none",s.style.overflow="hidden",s.style.visibility="hidden",document.body.appendChild(s));const i=(null===(r=s.contentWindow)||void 0===r?void 0:r.window.console)||window.console;switch(t){case"warn":i.warn(e,...o);break;case"info":i.info(e,...o);break;case"error":i.error(e,...o);break;default:i.groupCollapsed(e,...o),i.trace(),i.groupEnd()}},t=(t,...o)=>{e(t,"error",...o)},o="https://js.stripe.com/v3",n=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,r="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let s=null;const i=e=>(null!==s||(s=new Promise(((s,i)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(r),window.Stripe)s(window.Stripe);else try{let l=(()=>{const e=document.querySelectorAll(`script[src^="${o}"]`);for(let t=0;t<e.length;t++){const o=e[t];if(o&&n.test(o.src))return o}return null})();l&&e?console.warn(r):l||(l=(e=>{const n=document.createElement("script");n.src=`${o}`;const r=document.head||document.body;return r?(r.appendChild(n),n):(t("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})()),null==l||l.addEventListener("load",(()=>{window.Stripe?s(window.Stripe):i(new Error("Stripe.js not available"))})),null==l||l.addEventListener("error",(()=>{i(new Error("Failed to load Stripe.js"))}))}catch(e){return void i(e)}else s(null)}))),s),l=Promise.resolve().then((()=>i(null)));let c=!1;l.catch((e=>{c||console.warn(e)}));var d;const a=(()=>{const e=document.querySelector('script[src*="/zonos.js"]'),{currentLoadScriptUrl:t,isWhiteListed:o}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const t=new URL(e).origin,o=["dev.elements.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>t.includes(e))),n=["qa.js.zonos.com"].some((e=>t.includes(e)));return{currentLoadScriptUrl:t,isForceLoadVersionDomain:n,isWhiteListed:o}})({loadScriptSrc:null==e?void 0:e.src});return o?t:null})()||"https://v1.3.14.js.zonos.com",u="https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.14",m="https://rsms.me",p="https://fonts.googleapis.com",h=/^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;class y{}d=y,y.doneInit=!1,y.debug=!!window.location.search.match(/\?.*(&*)zonosDebug=1/),y.zonosConversionTest=!!window.location.search.match(/\?.*(&*)zonosConversionTest/),y.isBigCommerce=!1,y.internationalHideSelector="",y.zonosQaUrl=null,y.version="v1.3.14",y.modeAlerted=!1,y.tempCartData=null,y.getCurrentTimestamp=()=>(new Date).getTime(),y.zonosController=null,y.init=async({appearance:o,checkoutSettings:n,currencyConverter:r,helloSettings:s,storeId:i,zonosApiKey:l})=>{d.doneInit||(e(`====== ZONOS DEBUG MODE: on (${d.version}) ======`),l?(d.zonosApiKey=l,d.storeId=i,e("init zonos"),d.injectSentryScript(),d.injectZonosCdn(),d.injectZonosCss(),d.injectFonts(),d.injectController({config:{appearance:o,checkoutSettings:n,currencyConverter:r,helloSettings:s},zonosApiKey:l}),d.doneInit=!0):t("Missing Zonos API key"))},y.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},y.openHelloDialog=e=>{const t=document.querySelector("zonos-hello");t&&t.openHelloDialog(null==e||e)},y.showNotification=e=>{var t;null===(t=d.zonosController)||void 0===t||t.showNotification(e)},y.updateOrganizationName=e=>{var t;null===(t=d.zonosController)||void 0===t||t.updateOrganizationName(e)},y.disablePlaceOrderButtons=({autoEnable:e=!0,disable:t,placeOrderButtonSelector:o})=>{if(o){const n=document.querySelectorAll(o),r=e=>{e.target.getAttribute("disabled")&&(e.preventDefault(),e.stopPropagation())};n.forEach((e=>{e.getAttribute("data-zonos-checkout-attached")||(t?(e.setAttribute("disabled","true"),e.addEventListener("click",r)):(e.removeAttribute("disabled"),e.removeEventListener("click",r)))})),e&&t&&setTimeout((()=>{n.forEach((e=>{e.removeAttribute("disabled"),e.removeEventListener("click",r)}))}),5e3)}},y.injectController=({config:o,zonosApiKey:n})=>{var r;if(document.querySelector("zonos-controller"))return;if(null===(r=o.checkoutSettings)||void 0===r?void 0:r.placeOrderButtonSelector){const e=o.checkoutSettings.placeOrderButtonSelector;d.disablePlaceOrderButtons({disable:!0,placeOrderButtonSelector:e});new MutationObserver((()=>{d.disablePlaceOrderButtons({disable:!0,placeOrderButtonSelector:e})})).observe(document.body,{childList:!0,subtree:!0})}const s=document.createElement("zonos-controller");s.config=o,s.zonosApiKey=n,s.addEventListener("stripeInitEvent",(async o=>{const{detail:n}=o;e("loading Stripe");const r=await(async(...e)=>{c=!0;const t=Date.now();return l.then((o=>((e,t,o)=>{if(null===e)return null;const n=e.apply(void 0,t);return((e,t)=>{e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",startTime:t})})(n,o),n})(o,e,t)))})(n.publishableKey);r?(window.Zonos.stripe=r,s.initCheckoutElement(r)):t("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(s),d.zonosController=s,e("Zonos controller injected!")},y.injectSentryScript=()=>{const o="https://browser.sentry-cdn.com/7.88.0/bundle.tracing.min.js";if(document.querySelector(`script[src="${o}"]`))return void e("Sentry script already exists in the document","warn");const n=document.head||document.body,r=document.createElement("script");r.crossOrigin="anonymous",r.src=o,r.integrity="sha384-z/aQww1Fr6Mes0MO/2wlzQd2nXBCdDcKPXDTsMDMNPgTGRPqii3a4bzH79I+Vo8l",r.setAttribute("data-lazy","no"),r.onerror=()=>{t(`Failed to load ${r.src}`)},r.onload=()=>{var e;null===(e=window.Sentry)||void 0===e||e.init({beforeSend(e){var t,o,n,r,s,i;const l=null===(i=null===(s=null===(r=null===(n=null===(o=null===(t=e.exception)||void 0===t?void 0:t.values)||void 0===o?void 0:o[0])||void 0===n?void 0:n.stacktrace)||void 0===r?void 0:r.frames)||void 0===s?void 0:s[0])||void 0===i?void 0:i.filename,c=(null==l?void 0:l.includes("js.zonos.com"))||(null==l?void 0:l.includes("@zonos/elements")),d=window.location.href.includes("dev.elements")||window.location.href.includes("route.js.zonos.com");return c&&!d?e:null},dsn:"https://19168bd05af0e2e0e7520ad58953e4f2@o446983.ingest.sentry.io/4506400622837760",ignoreErrors:["Failed to load Stripe.js"],release:`zonos-elements@${d.version}`,tracesSampler:({transactionContext:e})=>"pageload"===e.op?1:.25})},n.appendChild(r)},y.injectScript=({fallBackDomain:o,isModule:n,scriptDomain:r,theRestUrl:s})=>{const i=`${r}/${s}`;if(document.querySelector(`script[src="${i}"]`))return void e(`Zonos script "${i}" already exists in the document`,"warn");const l=document.head||document.body,c=document.createElement("script");n?c.type="module":c.noModule=!0,c.src=i,c.crossOrigin="anonymous",c.onerror=()=>{/\/\/v\d+\./g.test(r)?(o&&d.injectScript({isModule:n,scriptDomain:o,theRestUrl:s}),t(`Failed to load ${c.src}`)):e("No need to fallback since this is not a versioned domain","warn")},l.appendChild(c)},y.injectZonosCdn=()=>{d.injectScript({fallBackDomain:u,isModule:!0,scriptDomain:a,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),d.injectScript({fallBackDomain:u,isModule:!1,scriptDomain:a,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),e("Zonos cdn script injected!")},y.injectStylesheet=({fallBackDomain:o,stylesheetDomain:n,theRestUrl:r})=>{const s=document.head||document.body,i=document.createElement("link");i.rel="preconnect",i.href=`${a}/`,s.appendChild(i);const l=document.createElement("link");l.rel="stylesheet",l.href=`${n}/${r}`,l.onerror=()=>{const s=/\/\/v\d+\./g.test(n);s?(o&&s&&d.injectStylesheet({stylesheetDomain:o,theRestUrl:r}),t(`Failed to load ${l.href}`)):e("No need to fallback since this is not a versioned domain","warn")},s.appendChild(l)},y.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?e("Zonos style links already injected","warn"):(d.injectStylesheet({fallBackDomain:u,stylesheetDomain:a,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),e("Zonos style css injected!"))},y.injectFonts=()=>{if((()=>{const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${m}"]`);for(let t=0;t<e.length;t++){const o=e[t];if(o&&!h.test(o.href))return o}return null})())return void e("Inter font already injected","warn");const t=document.head||document.body,o=document.createElement("link");o.rel="preconnect",o.href=m,t.appendChild(o);const n=document.createElement("link");n.rel="stylesheet",n.href=`${m}/inter/inter.css`,t.appendChild(n),e("Zonos font injected!")},y.setupGoogleFont=e=>{var t;null===(t=d.zonosController)||void 0===t||t.setupGoogleFont(e)},y.injectSupportGoogleFont=t=>{var o;e(`[FONT] injecting ${t}`);const n=null===(o=t.match(/family=(.*?):/))||void 0===o?void 0:o[1],r=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${p}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=p,r.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${t}"]`))return void e(`[FONT] ${n} font already injected`,"warn");const s=document.createElement("link");s.rel="stylesheet",s.href=t,r.appendChild(s),e(`[FONT] ${n} font injected!`)},exports.Zonos=y})();
|
|
@@ -242,6 +242,11 @@ export declare const carrierApiRatingSpecialServiceType: {
|
|
|
242
242
|
readonly SundayDelivery: "SUNDAY_DELIVERY";
|
|
243
243
|
};
|
|
244
244
|
export type CarrierApiRatingSpecialServiceType = (typeof carrierApiRatingSpecialServiceType)[keyof typeof carrierApiRatingSpecialServiceType];
|
|
245
|
+
export declare const carrierApiSupportType: {
|
|
246
|
+
readonly Supported: "SUPPORTED";
|
|
247
|
+
readonly Unsupported: "UNSUPPORTED";
|
|
248
|
+
};
|
|
249
|
+
export type CarrierApiSupportType = (typeof carrierApiSupportType)[keyof typeof carrierApiSupportType];
|
|
245
250
|
export declare const carrierCode: {
|
|
246
251
|
readonly Apc: "APC";
|
|
247
252
|
readonly Dhl: "DHL";
|
|
@@ -1238,6 +1243,7 @@ export type EmailTemplateStatus = (typeof emailTemplateStatus)[keyof typeof emai
|
|
|
1238
1243
|
export declare const emailTemplateType: {
|
|
1239
1244
|
readonly AbandonedCart: "ABANDONED_CART";
|
|
1240
1245
|
readonly CatalogExport: "CATALOG_EXPORT";
|
|
1246
|
+
readonly ManualClassificationExport: "MANUAL_CLASSIFICATION_EXPORT";
|
|
1241
1247
|
readonly OrderCanceled: "ORDER_CANCELED";
|
|
1242
1248
|
readonly OrderConfirmation: "ORDER_CONFIRMATION";
|
|
1243
1249
|
readonly OrderReceipt: "ORDER_RECEIPT";
|
|
@@ -1376,6 +1382,29 @@ export declare const imageSlot: {
|
|
|
1376
1382
|
readonly Image_5: "IMAGE_5";
|
|
1377
1383
|
};
|
|
1378
1384
|
export type ImageSlot = (typeof imageSlot)[keyof typeof imageSlot];
|
|
1385
|
+
export declare const inclusivePriceCalculateJobStatus: {
|
|
1386
|
+
readonly Completed: "COMPLETED";
|
|
1387
|
+
readonly Failed: "FAILED";
|
|
1388
|
+
readonly InProgress: "IN_PROGRESS";
|
|
1389
|
+
};
|
|
1390
|
+
export type InclusivePriceCalculateJobStatus = (typeof inclusivePriceCalculateJobStatus)[keyof typeof inclusivePriceCalculateJobStatus];
|
|
1391
|
+
export declare const inclusivePriceCalculateJobType: {
|
|
1392
|
+
readonly All: "ALL";
|
|
1393
|
+
readonly CatalogItem: "CATALOG_ITEM";
|
|
1394
|
+
readonly Country: "COUNTRY";
|
|
1395
|
+
};
|
|
1396
|
+
export type InclusivePriceCalculateJobType = (typeof inclusivePriceCalculateJobType)[keyof typeof inclusivePriceCalculateJobType];
|
|
1397
|
+
export declare const inclusivePriceCatalogValidationJobCompletionStatus: {
|
|
1398
|
+
readonly Archived: "ARCHIVED";
|
|
1399
|
+
readonly Completed: "COMPLETED";
|
|
1400
|
+
readonly InProgress: "IN_PROGRESS";
|
|
1401
|
+
};
|
|
1402
|
+
export type InclusivePriceCatalogValidationJobCompletionStatus = (typeof inclusivePriceCatalogValidationJobCompletionStatus)[keyof typeof inclusivePriceCatalogValidationJobCompletionStatus];
|
|
1403
|
+
export declare const inclusivePriceCatalogValidationJobComplianceStatus: {
|
|
1404
|
+
readonly Compliant: "COMPLIANT";
|
|
1405
|
+
readonly NonCompliant: "NON_COMPLIANT";
|
|
1406
|
+
};
|
|
1407
|
+
export type InclusivePriceCatalogValidationJobComplianceStatus = (typeof inclusivePriceCatalogValidationJobComplianceStatus)[keyof typeof inclusivePriceCatalogValidationJobComplianceStatus];
|
|
1379
1408
|
export declare const inclusivePriceHistoryCsvJobStatus: {
|
|
1380
1409
|
readonly Error: "ERROR";
|
|
1381
1410
|
readonly Processed: "PROCESSED";
|
|
@@ -3064,6 +3093,7 @@ export type GetOrderQuery = {
|
|
|
3064
3093
|
}>;
|
|
3065
3094
|
} | null;
|
|
3066
3095
|
status: OrderStatus;
|
|
3096
|
+
trackingNumbers: Array<string | null> | null;
|
|
3067
3097
|
} | null;
|
|
3068
3098
|
};
|
|
3069
3099
|
export type OrderUpdateAccountOrderNumberMutation = {
|
|
@@ -3089,11 +3119,57 @@ export type GetOrdersQuery = {
|
|
|
3089
3119
|
} | null;
|
|
3090
3120
|
} | null;
|
|
3091
3121
|
};
|
|
3122
|
+
export type GetWebhooksQuery = {
|
|
3123
|
+
webhooks: {
|
|
3124
|
+
edges: Array<{
|
|
3125
|
+
node: {
|
|
3126
|
+
id: string;
|
|
3127
|
+
query: string;
|
|
3128
|
+
status: WebhookStatus;
|
|
3129
|
+
type: WebhookType;
|
|
3130
|
+
url: string;
|
|
3131
|
+
} | null;
|
|
3132
|
+
}>;
|
|
3133
|
+
};
|
|
3134
|
+
};
|
|
3135
|
+
export type CreateWebhookMutation = {
|
|
3136
|
+
webhookCreate: {
|
|
3137
|
+
id: string;
|
|
3138
|
+
organizationId: string;
|
|
3139
|
+
type: WebhookType;
|
|
3140
|
+
url: string;
|
|
3141
|
+
} | null;
|
|
3142
|
+
};
|
|
3143
|
+
export type UpdateWebhookMutation = {
|
|
3144
|
+
webhookUpdate: {
|
|
3145
|
+
id: string;
|
|
3146
|
+
organizationId: string;
|
|
3147
|
+
type: WebhookType;
|
|
3148
|
+
url: string;
|
|
3149
|
+
} | null;
|
|
3150
|
+
};
|
|
3151
|
+
export type DeleteWebhookMutation = {
|
|
3152
|
+
webhookDelete: Result | null;
|
|
3153
|
+
};
|
|
3092
3154
|
export type GetCheckoutPlaceOrderButtonSelectorQuery = {
|
|
3093
3155
|
checkoutSettings: {
|
|
3094
3156
|
placeOrderButtonSelector: string | null;
|
|
3095
3157
|
} | null;
|
|
3096
3158
|
};
|
|
3159
|
+
export type AddTrackingNumberMutation = {
|
|
3160
|
+
orderAddTrackingNumber: {
|
|
3161
|
+
id: string;
|
|
3162
|
+
status: OrderStatus;
|
|
3163
|
+
trackingNumbers: Array<string | null> | null;
|
|
3164
|
+
} | null;
|
|
3165
|
+
};
|
|
3166
|
+
export type RemoveTrackingNumberMutation = {
|
|
3167
|
+
orderRemoveTrackingNumber: {
|
|
3168
|
+
id: string;
|
|
3169
|
+
status: OrderStatus;
|
|
3170
|
+
trackingNumbers: Array<string | null> | null;
|
|
3171
|
+
} | null;
|
|
3172
|
+
};
|
|
3097
3173
|
export type SdkFunctionWrapper = <T>(action: (requestHeaders?: Record<string, string>) => Promise<T>, operationName: string, operationType?: string) => Promise<T>;
|
|
3098
3174
|
export declare function getSdk(client: GraphQLClient, withWrapper?: SdkFunctionWrapper): {
|
|
3099
3175
|
BulkClassify(variables?: {
|
|
@@ -3144,8 +3220,26 @@ export declare function getSdk(client: GraphQLClient, withWrapper?: SdkFunctionW
|
|
|
3144
3220
|
ZonosSettings(variables?: {
|
|
3145
3221
|
[x: string]: never;
|
|
3146
3222
|
}, requestHeaders?: GraphQLClientRequestHeaders): Promise<ZonosSettingsQuery>;
|
|
3223
|
+
addTrackingNumber(variables?: {
|
|
3224
|
+
[x: string]: never;
|
|
3225
|
+
}, requestHeaders?: GraphQLClientRequestHeaders): Promise<AddTrackingNumberMutation>;
|
|
3226
|
+
createWebhook(variables?: {
|
|
3227
|
+
[x: string]: never;
|
|
3228
|
+
}, requestHeaders?: GraphQLClientRequestHeaders): Promise<CreateWebhookMutation>;
|
|
3229
|
+
deleteWebhook(variables?: {
|
|
3230
|
+
[x: string]: never;
|
|
3231
|
+
}, requestHeaders?: GraphQLClientRequestHeaders): Promise<DeleteWebhookMutation>;
|
|
3147
3232
|
getCheckoutPlaceOrderButtonSelector(variables?: {
|
|
3148
3233
|
[x: string]: never;
|
|
3149
3234
|
}, requestHeaders?: GraphQLClientRequestHeaders): Promise<GetCheckoutPlaceOrderButtonSelectorQuery>;
|
|
3235
|
+
getWebhooks(variables?: {
|
|
3236
|
+
[x: string]: never;
|
|
3237
|
+
}, requestHeaders?: GraphQLClientRequestHeaders): Promise<GetWebhooksQuery>;
|
|
3238
|
+
removeTrackingNumber(variables?: {
|
|
3239
|
+
[x: string]: never;
|
|
3240
|
+
}, requestHeaders?: GraphQLClientRequestHeaders): Promise<RemoveTrackingNumberMutation>;
|
|
3241
|
+
updateWebhook(variables?: {
|
|
3242
|
+
[x: string]: never;
|
|
3243
|
+
}, requestHeaders?: GraphQLClientRequestHeaders): Promise<UpdateWebhookMutation>;
|
|
3150
3244
|
};
|
|
3151
3245
|
export type Sdk = ReturnType<typeof getSdk>;
|
|
@@ -285,6 +285,13 @@ export const carrierApiRatingSpecialServiceType = {
|
|
|
285
285
|
|
|
286
286
|
export type CarrierApiRatingSpecialServiceType =
|
|
287
287
|
(typeof carrierApiRatingSpecialServiceType)[keyof typeof carrierApiRatingSpecialServiceType];
|
|
288
|
+
export const carrierApiSupportType = {
|
|
289
|
+
Supported: 'SUPPORTED',
|
|
290
|
+
Unsupported: 'UNSUPPORTED',
|
|
291
|
+
} as const;
|
|
292
|
+
|
|
293
|
+
export type CarrierApiSupportType =
|
|
294
|
+
(typeof carrierApiSupportType)[keyof typeof carrierApiSupportType];
|
|
288
295
|
|
|
289
296
|
export const carrierCode = {
|
|
290
297
|
Apc: 'APC',
|
|
@@ -1411,6 +1418,7 @@ export type EmailTemplateStatus =
|
|
|
1411
1418
|
export const emailTemplateType = {
|
|
1412
1419
|
AbandonedCart: 'ABANDONED_CART',
|
|
1413
1420
|
CatalogExport: 'CATALOG_EXPORT',
|
|
1421
|
+
ManualClassificationExport: 'MANUAL_CLASSIFICATION_EXPORT',
|
|
1414
1422
|
OrderCanceled: 'ORDER_CANCELED',
|
|
1415
1423
|
OrderConfirmation: 'ORDER_CONFIRMATION',
|
|
1416
1424
|
OrderReceipt: 'ORDER_RECEIPT',
|
|
@@ -1594,6 +1602,37 @@ export const imageSlot = {
|
|
|
1594
1602
|
} as const;
|
|
1595
1603
|
|
|
1596
1604
|
export type ImageSlot = (typeof imageSlot)[keyof typeof imageSlot];
|
|
1605
|
+
export const inclusivePriceCalculateJobStatus = {
|
|
1606
|
+
Completed: 'COMPLETED',
|
|
1607
|
+
Failed: 'FAILED',
|
|
1608
|
+
InProgress: 'IN_PROGRESS',
|
|
1609
|
+
} as const;
|
|
1610
|
+
|
|
1611
|
+
export type InclusivePriceCalculateJobStatus =
|
|
1612
|
+
(typeof inclusivePriceCalculateJobStatus)[keyof typeof inclusivePriceCalculateJobStatus];
|
|
1613
|
+
export const inclusivePriceCalculateJobType = {
|
|
1614
|
+
All: 'ALL',
|
|
1615
|
+
CatalogItem: 'CATALOG_ITEM',
|
|
1616
|
+
Country: 'COUNTRY',
|
|
1617
|
+
} as const;
|
|
1618
|
+
|
|
1619
|
+
export type InclusivePriceCalculateJobType =
|
|
1620
|
+
(typeof inclusivePriceCalculateJobType)[keyof typeof inclusivePriceCalculateJobType];
|
|
1621
|
+
export const inclusivePriceCatalogValidationJobCompletionStatus = {
|
|
1622
|
+
Archived: 'ARCHIVED',
|
|
1623
|
+
Completed: 'COMPLETED',
|
|
1624
|
+
InProgress: 'IN_PROGRESS',
|
|
1625
|
+
} as const;
|
|
1626
|
+
|
|
1627
|
+
export type InclusivePriceCatalogValidationJobCompletionStatus =
|
|
1628
|
+
(typeof inclusivePriceCatalogValidationJobCompletionStatus)[keyof typeof inclusivePriceCatalogValidationJobCompletionStatus];
|
|
1629
|
+
export const inclusivePriceCatalogValidationJobComplianceStatus = {
|
|
1630
|
+
Compliant: 'COMPLIANT',
|
|
1631
|
+
NonCompliant: 'NON_COMPLIANT',
|
|
1632
|
+
} as const;
|
|
1633
|
+
|
|
1634
|
+
export type InclusivePriceCatalogValidationJobComplianceStatus =
|
|
1635
|
+
(typeof inclusivePriceCatalogValidationJobComplianceStatus)[keyof typeof inclusivePriceCatalogValidationJobComplianceStatus];
|
|
1597
1636
|
export const inclusivePriceHistoryCsvJobStatus = {
|
|
1598
1637
|
Error: 'ERROR',
|
|
1599
1638
|
Processed: 'PROCESSED',
|
|
@@ -3487,6 +3526,7 @@ export type GetOrderQuery = {
|
|
|
3487
3526
|
}>;
|
|
3488
3527
|
} | null;
|
|
3489
3528
|
status: OrderStatus;
|
|
3529
|
+
trackingNumbers: Array<string | null> | null;
|
|
3490
3530
|
} | null;
|
|
3491
3531
|
};
|
|
3492
3532
|
|
|
@@ -3513,10 +3553,60 @@ export type GetOrdersQuery = {
|
|
|
3513
3553
|
} | null;
|
|
3514
3554
|
};
|
|
3515
3555
|
|
|
3556
|
+
export type GetWebhooksQuery = {
|
|
3557
|
+
webhooks: {
|
|
3558
|
+
edges: Array<{
|
|
3559
|
+
node: {
|
|
3560
|
+
id: string;
|
|
3561
|
+
query: string;
|
|
3562
|
+
status: WebhookStatus;
|
|
3563
|
+
type: WebhookType;
|
|
3564
|
+
url: string;
|
|
3565
|
+
} | null;
|
|
3566
|
+
}>;
|
|
3567
|
+
};
|
|
3568
|
+
};
|
|
3569
|
+
|
|
3570
|
+
export type CreateWebhookMutation = {
|
|
3571
|
+
webhookCreate: {
|
|
3572
|
+
id: string;
|
|
3573
|
+
organizationId: string;
|
|
3574
|
+
type: WebhookType;
|
|
3575
|
+
url: string;
|
|
3576
|
+
} | null;
|
|
3577
|
+
};
|
|
3578
|
+
|
|
3579
|
+
export type UpdateWebhookMutation = {
|
|
3580
|
+
webhookUpdate: {
|
|
3581
|
+
id: string;
|
|
3582
|
+
organizationId: string;
|
|
3583
|
+
type: WebhookType;
|
|
3584
|
+
url: string;
|
|
3585
|
+
} | null;
|
|
3586
|
+
};
|
|
3587
|
+
|
|
3588
|
+
export type DeleteWebhookMutation = { webhookDelete: Result | null };
|
|
3589
|
+
|
|
3516
3590
|
export type GetCheckoutPlaceOrderButtonSelectorQuery = {
|
|
3517
3591
|
checkoutSettings: { placeOrderButtonSelector: string | null } | null;
|
|
3518
3592
|
};
|
|
3519
3593
|
|
|
3594
|
+
export type AddTrackingNumberMutation = {
|
|
3595
|
+
orderAddTrackingNumber: {
|
|
3596
|
+
id: string;
|
|
3597
|
+
status: OrderStatus;
|
|
3598
|
+
trackingNumbers: Array<string | null> | null;
|
|
3599
|
+
} | null;
|
|
3600
|
+
};
|
|
3601
|
+
|
|
3602
|
+
export type RemoveTrackingNumberMutation = {
|
|
3603
|
+
orderRemoveTrackingNumber: {
|
|
3604
|
+
id: string;
|
|
3605
|
+
status: OrderStatus;
|
|
3606
|
+
trackingNumbers: Array<string | null> | null;
|
|
3607
|
+
} | null;
|
|
3608
|
+
};
|
|
3609
|
+
|
|
3520
3610
|
export type SdkFunctionWrapper = <T>(
|
|
3521
3611
|
action: (requestHeaders?: Record<string, string>) => Promise<T>,
|
|
3522
3612
|
operationName: string,
|
|
@@ -3758,6 +3848,48 @@ export function getSdk(
|
|
|
3758
3848
|
'query',
|
|
3759
3849
|
);
|
|
3760
3850
|
},
|
|
3851
|
+
addTrackingNumber(
|
|
3852
|
+
variables?: { [x: string]: never },
|
|
3853
|
+
requestHeaders?: GraphQLClientRequestHeaders,
|
|
3854
|
+
): Promise<AddTrackingNumberMutation> {
|
|
3855
|
+
return withWrapper(
|
|
3856
|
+
wrappedRequestHeaders =>
|
|
3857
|
+
client.request<AddTrackingNumberMutation>('', variables, {
|
|
3858
|
+
...requestHeaders,
|
|
3859
|
+
...wrappedRequestHeaders,
|
|
3860
|
+
}),
|
|
3861
|
+
'addTrackingNumber',
|
|
3862
|
+
'mutation',
|
|
3863
|
+
);
|
|
3864
|
+
},
|
|
3865
|
+
createWebhook(
|
|
3866
|
+
variables?: { [x: string]: never },
|
|
3867
|
+
requestHeaders?: GraphQLClientRequestHeaders,
|
|
3868
|
+
): Promise<CreateWebhookMutation> {
|
|
3869
|
+
return withWrapper(
|
|
3870
|
+
wrappedRequestHeaders =>
|
|
3871
|
+
client.request<CreateWebhookMutation>('', variables, {
|
|
3872
|
+
...requestHeaders,
|
|
3873
|
+
...wrappedRequestHeaders,
|
|
3874
|
+
}),
|
|
3875
|
+
'createWebhook',
|
|
3876
|
+
'mutation',
|
|
3877
|
+
);
|
|
3878
|
+
},
|
|
3879
|
+
deleteWebhook(
|
|
3880
|
+
variables?: { [x: string]: never },
|
|
3881
|
+
requestHeaders?: GraphQLClientRequestHeaders,
|
|
3882
|
+
): Promise<DeleteWebhookMutation> {
|
|
3883
|
+
return withWrapper(
|
|
3884
|
+
wrappedRequestHeaders =>
|
|
3885
|
+
client.request<DeleteWebhookMutation>('', variables, {
|
|
3886
|
+
...requestHeaders,
|
|
3887
|
+
...wrappedRequestHeaders,
|
|
3888
|
+
}),
|
|
3889
|
+
'deleteWebhook',
|
|
3890
|
+
'mutation',
|
|
3891
|
+
);
|
|
3892
|
+
},
|
|
3761
3893
|
getCheckoutPlaceOrderButtonSelector(
|
|
3762
3894
|
variables?: { [x: string]: never },
|
|
3763
3895
|
requestHeaders?: GraphQLClientRequestHeaders,
|
|
@@ -3773,6 +3905,48 @@ export function getSdk(
|
|
|
3773
3905
|
'query',
|
|
3774
3906
|
);
|
|
3775
3907
|
},
|
|
3908
|
+
getWebhooks(
|
|
3909
|
+
variables?: { [x: string]: never },
|
|
3910
|
+
requestHeaders?: GraphQLClientRequestHeaders,
|
|
3911
|
+
): Promise<GetWebhooksQuery> {
|
|
3912
|
+
return withWrapper(
|
|
3913
|
+
wrappedRequestHeaders =>
|
|
3914
|
+
client.request<GetWebhooksQuery>('', variables, {
|
|
3915
|
+
...requestHeaders,
|
|
3916
|
+
...wrappedRequestHeaders,
|
|
3917
|
+
}),
|
|
3918
|
+
'getWebhooks',
|
|
3919
|
+
'query',
|
|
3920
|
+
);
|
|
3921
|
+
},
|
|
3922
|
+
removeTrackingNumber(
|
|
3923
|
+
variables?: { [x: string]: never },
|
|
3924
|
+
requestHeaders?: GraphQLClientRequestHeaders,
|
|
3925
|
+
): Promise<RemoveTrackingNumberMutation> {
|
|
3926
|
+
return withWrapper(
|
|
3927
|
+
wrappedRequestHeaders =>
|
|
3928
|
+
client.request<RemoveTrackingNumberMutation>('', variables, {
|
|
3929
|
+
...requestHeaders,
|
|
3930
|
+
...wrappedRequestHeaders,
|
|
3931
|
+
}),
|
|
3932
|
+
'removeTrackingNumber',
|
|
3933
|
+
'mutation',
|
|
3934
|
+
);
|
|
3935
|
+
},
|
|
3936
|
+
updateWebhook(
|
|
3937
|
+
variables?: { [x: string]: never },
|
|
3938
|
+
requestHeaders?: GraphQLClientRequestHeaders,
|
|
3939
|
+
): Promise<UpdateWebhookMutation> {
|
|
3940
|
+
return withWrapper(
|
|
3941
|
+
wrappedRequestHeaders =>
|
|
3942
|
+
client.request<UpdateWebhookMutation>('', variables, {
|
|
3943
|
+
...requestHeaders,
|
|
3944
|
+
...wrappedRequestHeaders,
|
|
3945
|
+
}),
|
|
3946
|
+
'updateWebhook',
|
|
3947
|
+
'mutation',
|
|
3948
|
+
);
|
|
3949
|
+
},
|
|
3776
3950
|
};
|
|
3777
3951
|
}
|
|
3778
3952
|
export type Sdk = ReturnType<typeof getSdk>;
|
|
@@ -84,6 +84,7 @@ export declare const featureAspectKeyEnum: {
|
|
|
84
84
|
readonly ComConsolidation: "com_consolidation";
|
|
85
85
|
readonly DashboardCheckout_2Settings: "dashboard_checkout_2_settings";
|
|
86
86
|
readonly DashboardHello_2Settings: "dashboard_hello_2_settings";
|
|
87
|
+
readonly DashboardNewLabelUi: "dashboard_new_label_ui";
|
|
87
88
|
readonly DashboardOrderApprove: "dashboard_order_approve";
|
|
88
89
|
readonly DashboardOrderApproveNoCapture: "dashboard_order_approve_no_capture";
|
|
89
90
|
readonly Dashboard_909Settings: "dashboard_909_settings";
|
|
@@ -102,6 +103,7 @@ export declare const featureAudienceNameEnum: {
|
|
|
102
103
|
readonly AccountsReceivable: "accounts_receivable";
|
|
103
104
|
readonly CheckoutSales: "checkout_sales";
|
|
104
105
|
readonly CustomerSuccess: "customer_success";
|
|
106
|
+
readonly DashboardLabelBetaMerchant: "dashboard_label_beta_merchant";
|
|
105
107
|
readonly Designer: "designer";
|
|
106
108
|
readonly DocsContributor: "docs_contributor";
|
|
107
109
|
readonly Executive: "executive";
|
|
@@ -612,6 +614,11 @@ export type AllSettingsQuery = {
|
|
|
612
614
|
zonosStoreId: number | null;
|
|
613
615
|
}>;
|
|
614
616
|
};
|
|
617
|
+
export type CleanupTestErrorsMutation = {
|
|
618
|
+
delete_error_event: {
|
|
619
|
+
affected_rows: number;
|
|
620
|
+
} | null;
|
|
621
|
+
};
|
|
615
622
|
export type HasPreviousErrorsQuery = {
|
|
616
623
|
error_event: Array<{
|
|
617
624
|
endpoint: string;
|
|
@@ -792,6 +799,9 @@ export declare function getSdk(client: GraphQLClient, withWrapper?: SdkFunctionW
|
|
|
792
799
|
UpsertBigCommerceSettings(variables?: {
|
|
793
800
|
[x: string]: never;
|
|
794
801
|
}, requestHeaders?: GraphQLClientRequestHeaders): Promise<UpsertBigCommerceSettingsMutation>;
|
|
802
|
+
cleanupTestErrors(variables?: {
|
|
803
|
+
[x: string]: never;
|
|
804
|
+
}, requestHeaders?: GraphQLClientRequestHeaders): Promise<CleanupTestErrorsMutation>;
|
|
795
805
|
cleanupTestZonosElementSetting(variables?: {
|
|
796
806
|
[x: string]: never;
|
|
797
807
|
}, requestHeaders?: GraphQLClientRequestHeaders): Promise<CleanupTestZonosElementSettingMutation>;
|
|
@@ -62,6 +62,7 @@ export const featureAspectKeyEnum = {
|
|
|
62
62
|
ComConsolidation: 'com_consolidation',
|
|
63
63
|
DashboardCheckout_2Settings: 'dashboard_checkout_2_settings',
|
|
64
64
|
DashboardHello_2Settings: 'dashboard_hello_2_settings',
|
|
65
|
+
DashboardNewLabelUi: 'dashboard_new_label_ui',
|
|
65
66
|
DashboardOrderApprove: 'dashboard_order_approve',
|
|
66
67
|
DashboardOrderApproveNoCapture: 'dashboard_order_approve_no_capture',
|
|
67
68
|
Dashboard_909Settings: 'dashboard_909_settings',
|
|
@@ -83,6 +84,7 @@ export const featureAudienceNameEnum = {
|
|
|
83
84
|
AccountsReceivable: 'accounts_receivable',
|
|
84
85
|
CheckoutSales: 'checkout_sales',
|
|
85
86
|
CustomerSuccess: 'customer_success',
|
|
87
|
+
DashboardLabelBetaMerchant: 'dashboard_label_beta_merchant',
|
|
86
88
|
Designer: 'designer',
|
|
87
89
|
DocsContributor: 'docs_contributor',
|
|
88
90
|
Executive: 'executive',
|
|
@@ -617,6 +619,10 @@ export type AllSettingsQuery = {
|
|
|
617
619
|
}>;
|
|
618
620
|
};
|
|
619
621
|
|
|
622
|
+
export type CleanupTestErrorsMutation = {
|
|
623
|
+
delete_error_event: { affected_rows: number } | null;
|
|
624
|
+
};
|
|
625
|
+
|
|
620
626
|
export type HasPreviousErrorsQuery = {
|
|
621
627
|
error_event: Array<{
|
|
622
628
|
endpoint: string;
|
|
@@ -1012,6 +1018,20 @@ export function getSdk(
|
|
|
1012
1018
|
'mutation',
|
|
1013
1019
|
);
|
|
1014
1020
|
},
|
|
1021
|
+
cleanupTestErrors(
|
|
1022
|
+
variables?: { [x: string]: never },
|
|
1023
|
+
requestHeaders?: GraphQLClientRequestHeaders,
|
|
1024
|
+
): Promise<CleanupTestErrorsMutation> {
|
|
1025
|
+
return withWrapper(
|
|
1026
|
+
wrappedRequestHeaders =>
|
|
1027
|
+
client.request<CleanupTestErrorsMutation>('', variables, {
|
|
1028
|
+
...requestHeaders,
|
|
1029
|
+
...wrappedRequestHeaders,
|
|
1030
|
+
}),
|
|
1031
|
+
'cleanupTestErrors',
|
|
1032
|
+
'mutation',
|
|
1033
|
+
);
|
|
1034
|
+
},
|
|
1015
1035
|
cleanupTestZonosElementSetting(
|
|
1016
1036
|
variables?: { [x: string]: never },
|
|
1017
1037
|
requestHeaders?: GraphQLClientRequestHeaders,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(t,n,o,e){function i(t){return t instanceof o?t:new o((function(n){n(t)}))}return new(o||(o=Promise))((function(o,r){function u(t){try{a(e.next(t))}catch(t){r(t)}}function s(t){try{a(e["throw"](t))}catch(t){r(t)}}function a(t){t.done?o(t.value):i(t.value).then(u,s)}a((e=e.apply(t,n||[])).next())}))};var __generator=this&&this.__generator||function(t,n){var o={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},e,i,r,u;return u={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(u[Symbol.iterator]=function(){return this}),u;function s(t){return function(n){return a([t,n])}}function a(s){if(e)throw new TypeError("Generator is already executing.");while(u&&(u=0,s[0]&&(o=0)),o)try{if(e=1,i&&(r=s[0]&2?i["return"]:s[0]?i["throw"]||((r=i["return"])&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;if(i=0,r)s=[s[0]&2,r.value];switch(s[0]){case 0:case 1:r=s;break;case 4:o.label++;return{value:s[1],done:false};case 5:o.label++;i=s[1];s=[0];continue;case 7:s=o.ops.pop();o.trys.pop();continue;default:if(!(r=o.trys,r=r.length>0&&r[r.length-1])&&(s[0]===6||s[0]===2)){o=0;continue}if(s[0]===3&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(s[0]===6&&o.label<r[1]){o.label=r[1];r=s;break}if(r&&o.label<r[2]){o.label=r[2];o.ops.push(s);break}if(r[2])o.ops.pop();o.trys.pop();continue}s=n.call(t,o)}catch(t){s=[6,t];i=0}finally{e=r=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-2825570c.system.js","./p-2d404058.system.js","./p-520e8e63.system.js","./p-fc4da55c.system.js","./p-f4c38bfc.system.js"],(function(t){"use strict";var n,o,e,i,r,u,s,a,c,f,h,d,l,v;return{setters:[function(t){n=t.r;o=t.c;e=t.h;i=t.H},function(t){r=t.r;u=t.d;s=t.u;a=t.a;c=t.j;f=t.v;h=t.b},function(t){d=t.z;l=t.b;v=t.d},function(){},function(){}],execute:function(){var m=this;var _=function(){return __awaiter(m,void 0,void 0,(function(){var t,n,o,e;return __generator(this,(function(i){switch(i.label){case 0:t="".concat("https://v1.route.js.zonos.com","/api/zonos-elements/zonos-settings");return[4,r(t)];case 1:n=i.sent(),o=n.errors,e=n.json;if(o.length){u("Error occurred when getting zonos settings. If this is not an unauthorized error, it will use user settings or default settings");return[2,{errors:o,json:null}]}return[2,{errors:[],json:e}]}}))}))};var w=function(){var t=document.querySelector("zonos-checkout");if(!t){var n=document.createElement("zonos-checkout");document.body.appendChild(n)}};var p=function(t){if(!t.placeOrderButtonSelector){return}if(!s(t.placeOrderButtonSelector)){u('Selector checkoutButtonAnchor "'.concat(t.placeOrderButtonSelector,'" is not a valid selector'));return}w()};var g=function(t){var n=document.querySelector(t);var o=document.querySelector("zonos-hello");if(!o&&n){var e=document.createElement("zonos-hello");n.appendChild(e);return true}return false};var y=function(t){var n=t.position,o=n===void 0?"bottom-right":n;var e=".zonos--hello-mobile-wrapper";var i=document.querySelector(e);if(i){return e}var r=document.createElement("div");r.className="zonos--hello-mobile-wrapper";r.style.position="fixed";if(o==="top-right"){r.style.top="72px";r.style.right="24px"}if(o==="top-left"){r.style.top="72px";r.style.left="24px"}if(o==="bottom-right"){r.style.bottom="72px";r.style.right="24px"}if(o==="bottom-left"){r.style.bottom="72px";r.style.left="24px"}r.style.zIndex="2147483007";document.body.appendChild(r);return e};var b=function(t){return __awaiter(m,void 0,void 0,(function(){var n,o,e,i,r;return __generator(this,(function(c){n=t.anchorElementSelector;o=y({position:"bottom-right"});e=n||o;if(!e||!s(e)){u('Selector anchorElementSelector "'.concat(t.anchorElementSelector,'" is not a valid selector.'));return[2]}a("Hello init complete");i=g(e);if(!i){r=new MutationObserver((function(){var t=g(e);if(t){r.disconnect()}}));r.observe(document.body,{childList:true,subtree:true});setTimeout((function(){r.disconnect()}),5e3)}return[2]}))}))};var z=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{visibility:hidden;opacity:0;height:0}";var k=z;var I=t("zonos_controller",function(){function t(t){n(this,t);this.stripeInitEvent=o(this,"stripeInitEvent",7);this.config=undefined;this.zonosApiKey=undefined}t.prototype.initCheckoutElement=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){if(!t){a("Stripe is not loaded yet - cannot init checkout element","warn");return[2]}c.stripe=t;void p(d.checkoutSettings);a("init checkout element");return[2]}))}))};t.prototype.initZonosNotification=function(){var t=document.querySelector("zonos-notification");if(t){return}var n=document.createElement("zonos-notification");document.body.appendChild(n)};t.prototype.setupGoogleFont=function(t){return __awaiter(this,void 0,void 0,(function(){var n,o,e,i,u,s,c,f;return __generator(this,(function(h){switch(h.label){case 0:e=t||v();if(e==="Inter"){if(!t){return[2]}a("[FONT] Just applied Inter , but no need to inject since we already inject Inter on start","warn");d.appearance=Object.assign(Object.assign({},d.appearance),{fontFamily:t})}i="https://v1.route.js.zonos.com";return[4,r("".concat(i,"/api/zonos-elements/get-font-detail?family=").concat(e))];case 1:u=h.sent(),s=u.errors,c=u.json;if(s.length>0||!c){a("Failed to load font ".concat(e),"warn");return[2]}f=c.fontUrl;(o=(n=window.Zonos).injectSupportGoogleFont)===null||o===void 0?void 0:o.call(n,f);if(!t){return[2]}a("[FONT] ".concat(t," font override applied"));d.appearance=Object.assign(Object.assign({},d.appearance),{fontFamily:t});return[2]}}))}))};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(n){d.zonosApiKey=this.zonosApiKey;(function(){return __awaiter(t,void 0,void 0,(function(){var t,n,o,e,i,r;return __generator(this,(function(u){switch(u.label){case 0:return[4,_()];case 1:o=u.sent(),e=o.errors,i=o.json;if(((t=e[0])===null||t===void 0?void 0:t.type.toString())==="403"){a("Failed to load zonos settings. This domain may not have access","warn");return[2]}this.initZonosNotification();l({overrideSettings:this.config,zonosSettings:i});void this.setupGoogleFont();if(d.helloSettings){void b(d.helloSettings)}return[4,f()];case 2:u.sent();r=((n=i===null||i===void 0?void 0:i.checkoutSettings)===null||n===void 0?void 0:n.externalServiceTokens.find((function(t){return t.type==="STRIPE_PUBLISHABLE_TOKEN"})))||null;if(!r||!this.stripeInitEvent){a("Checkout failed to load -- missing publishable key","warn");return[2]}if(d.checkoutSettings.subscriptionStatus==="INACTIVE"){a('=== Checkout subscription is "INACTIVE" - Cancel initializing for Checkout ===',"warn");a("zonos controller loaded");return[2]}if(d.checkoutSettings.visibilityStatus==="DISABLED"){a("=== Checkout is disabled by store owner ===","warn");a("zonos controller loaded");return[2]}this.stripeInitEvent.emit({publishableKey:r.token});a("zonos controller loaded");return[2]}}))}))})();return[2]}))}))};t.prototype.showNotification=function(t){return __awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(o){n=document.querySelector("zonos-notification");if(!n){a("Failed to show notification - zonos-notification not found","warn");return[2]}void n.showNotification(t);return[2]}))}))};t.prototype.overrideConfig=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){l({overrideSettings:t,zonosSettings:null});return[2]}))}))};t.prototype.overrideCountry=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){void h(t);return[2]}))}))};t.prototype.getAppearanceSetting=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,d.appearance]}))}))};t.prototype.updateOrganizationName=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){d.organizationName=t;return[2]}))}))};t.prototype.render=function(){return e(i,{key:"e0869cf08934b9d047adef9875c9a5f50d604bdf",class:"zonos--elements"})};return t}());I.style=k}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,o,t,n){function i(e){return e instanceof t?e:new t((function(o){o(e)}))}return new(t||(t=Promise))((function(t,r){function s(e){try{l(n.next(e))}catch(e){r(e)}}function a(e){try{l(n["throw"](e))}catch(e){r(e)}}function l(e){e.done?t(e.value):i(e.value).then(s,a)}l((n=n.apply(e,o||[])).next())}))};var __generator=this&&this.__generator||function(e,o){var t={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,i,r,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(e){return function(o){return l([e,o])}}function l(a){if(n)throw new TypeError("Generator is already executing.");while(s&&(s=0,a[0]&&(t=0)),t)try{if(n=1,i&&(r=a[0]&2?i["return"]:a[0]?i["throw"]||((r=i["return"])&&r.call(i),0):i.next)&&!(r=r.call(i,a[1])).done)return r;if(i=0,r)a=[a[0]&2,r.value];switch(a[0]){case 0:case 1:r=a;break;case 4:t.label++;return{value:a[1],done:false};case 5:t.label++;i=a[1];a=[0];continue;case 7:a=t.ops.pop();t.trys.pop();continue;default:if(!(r=t.trys,r=r.length>0&&r[r.length-1])&&(a[0]===6||a[0]===2)){t=0;continue}if(a[0]===3&&(!r||a[1]>r[0]&&a[1]<r[3])){t.label=a[1];break}if(a[0]===6&&t.label<r[1]){t.label=r[1];r=a;break}if(r&&t.label<r[2]){t.label=r[2];t.ops.push(a);break}if(r[2])t.ops.pop();t.trys.pop();continue}a=o.call(e,t)}catch(e){a=[6,e];i=0}finally{n=r=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};System.register(["./p-2825570c.system.js","./p-56ba5cbf.system.js"],(function(e,o){"use strict";var t,n,i;return{setters:[function(o){t=o.p;n=o.b;e("setNonce",o.s)},function(e){i=e.g}],execute:function(){var e=this;var r=function(){var e=o.meta.url;var n={};if(e!==""){n.resourcesUrl=new URL(".",e).href}return t(n)};r().then((function(o){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,i()];case 1:e.sent();return[2,n([["p-17ded5a1.system",[[2,"zonos-checkout",{appearanceSettingsOverride:[16],preview:[4],mobile:[4],defaultAddress:[16],forceDialogOpen:[4,"force-dialog-open"],open:[32],stripe:[32],submitLoading:[32],paymentError:[32],collapseReviewMobile:[32],isAttachError:[32],isMobile:[32],zonosReviewRef:[32],storybookPaymentStatusOverride:[32],domesticRedirectedBtnSelector:[32],legacyCheckoutHiddenBtnSelector:[32],isLegacyCheckout:[32],closeDialogHandler:[64],init:[64],setToFinishStep:[64]},[[16,"zonos--init-cart-info","initCartInfoHandler"],[9,"resize","handleWindowResize"]],{appearanceSettingsOverride:["appearanceSettingsOverrideChanged","handleAppearanceSettingsOverrideChange"],mobile:["handleMobileChange"]}]]],["p-aa5e2f7c.system",[[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],displayCurrency:[64],convertAndFormat:[64],convert:[64],format:[64],openHelloDialog:[64]},[[9,"resize","handleResize"]],{appearanceSettingsOverride:["handleAppearanceSettingsOverrideChange"]}]]],["p-
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,o,t,n){function i(e){return e instanceof t?e:new t((function(o){o(e)}))}return new(t||(t=Promise))((function(t,r){function s(e){try{l(n.next(e))}catch(e){r(e)}}function a(e){try{l(n["throw"](e))}catch(e){r(e)}}function l(e){e.done?t(e.value):i(e.value).then(s,a)}l((n=n.apply(e,o||[])).next())}))};var __generator=this&&this.__generator||function(e,o){var t={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,i,r,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(e){return function(o){return l([e,o])}}function l(a){if(n)throw new TypeError("Generator is already executing.");while(s&&(s=0,a[0]&&(t=0)),t)try{if(n=1,i&&(r=a[0]&2?i["return"]:a[0]?i["throw"]||((r=i["return"])&&r.call(i),0):i.next)&&!(r=r.call(i,a[1])).done)return r;if(i=0,r)a=[a[0]&2,r.value];switch(a[0]){case 0:case 1:r=a;break;case 4:t.label++;return{value:a[1],done:false};case 5:t.label++;i=a[1];a=[0];continue;case 7:a=t.ops.pop();t.trys.pop();continue;default:if(!(r=t.trys,r=r.length>0&&r[r.length-1])&&(a[0]===6||a[0]===2)){t=0;continue}if(a[0]===3&&(!r||a[1]>r[0]&&a[1]<r[3])){t.label=a[1];break}if(a[0]===6&&t.label<r[1]){t.label=r[1];r=a;break}if(r&&t.label<r[2]){t.label=r[2];t.ops.push(a);break}if(r[2])t.ops.pop();t.trys.pop();continue}a=o.call(e,t)}catch(e){a=[6,e];i=0}finally{n=r=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};System.register(["./p-2825570c.system.js","./p-56ba5cbf.system.js"],(function(e,o){"use strict";var t,n,i;return{setters:[function(o){t=o.p;n=o.b;e("setNonce",o.s)},function(e){i=e.g}],execute:function(){var e=this;var r=function(){var e=o.meta.url;var n={};if(e!==""){n.resourcesUrl=new URL(".",e).href}return t(n)};r().then((function(o){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,i()];case 1:e.sent();return[2,n([["p-17ded5a1.system",[[2,"zonos-checkout",{appearanceSettingsOverride:[16],preview:[4],mobile:[4],defaultAddress:[16],forceDialogOpen:[4,"force-dialog-open"],open:[32],stripe:[32],submitLoading:[32],paymentError:[32],collapseReviewMobile:[32],isAttachError:[32],isMobile:[32],zonosReviewRef:[32],storybookPaymentStatusOverride:[32],domesticRedirectedBtnSelector:[32],legacyCheckoutHiddenBtnSelector:[32],isLegacyCheckout:[32],closeDialogHandler:[64],init:[64],setToFinishStep:[64]},[[16,"zonos--init-cart-info","initCartInfoHandler"],[9,"resize","handleWindowResize"]],{appearanceSettingsOverride:["appearanceSettingsOverrideChanged","handleAppearanceSettingsOverrideChange"],mobile:["handleMobileChange"]}]]],["p-aa5e2f7c.system",[[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],displayCurrency:[64],convertAndFormat:[64],convert:[64],format:[64],openHelloDialog:[64]},[[9,"resize","handleResize"]],{appearanceSettingsOverride:["handleAppearanceSettingsOverrideChange"]}]]],["p-522294b9.system",[[1,"zonos-controller",{config:[16],zonosApiKey:[1,"zonos-api-key"],initCheckoutElement:[64],setupGoogleFont:[64],showNotification:[64],overrideConfig:[64],overrideCountry:[64],getAppearanceSetting:[64],updateOrganizationName:[64]}]]],["p-c5bc49b5.system",[[1,"zonos-component",{first:[1],middle:[1],last:[1]}]]],["p-3d8254a2.system",[[1,"zonos-link",{href:[1],rel:[1],target:[1],linkTitle:[1,"link-title"]}]]],["p-2aa3c0e8.system",[[1,"zonos-logo",{theme:[1],width:[1]}]]],["p-e1ac5b2a.system",[[1,"zonos-text",{textColor:[1,"text-color"],size:[1],type:[1],weight:[2],content:[1],ready:[32]}]]],["p-8ec3995a.system",[[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"]}]]],["p-d0d78094.system",[[1,"zonos-notification",{notificationArray:[32],showNotification:[64]}]]],["p-a583e3c6.system",[[2,"zonos-payment",{titleText:[1,"title-text"],stripe:[32],stripeElements:[32]},null,{stripeElements:["watchInitStripe"],stripe:["watchInitStripe"]}]]],["p-0a0d45e9.system",[[1,"zonos-shipping-rich-radio",{items:[16],borderColor:[1,"border-color"],borderStyle:[1,"border-style"],theme:[1],initialSelectedValue:[8,"initial-selected-value"],selectedItem:[32]}]]],["p-4f626a90.system",[[1,"zonos-badge",{bold:[4],badgeColor:[1,"badge-color"],icon:[16],iconRight:[4,"icon-right"],size:[1],rounded:[4]}],[1,"zonos-tooltip",{label:[1],subtitle:[1],showTooltip:[32]}]]],["p-05f749dc.system",[[1,"zonos-country-flag",{countryCode:[1,"country-code"],size:[2]}]]],["p-509717bc.system",[[1,"zonos-banner",{bannerTitle:[1,"banner-title"],intent:[1],hasContent:[32]}]]],["p-a6bbf6de.system",[[1,"zonos-icon",{autoHeight:[4,"auto-height"],iconColor:[1,"icon-color"],content:[1],size:[2]}]]],["p-16b59229.system",[[1,"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"],noPaddingLeft:[4,"no-padding-left"],noPaddingRight:[4,"no-padding-right"],loading:[4],theme:[1],hasIcon:[32],hasContent:[32]},[[2,"click","clickHandler"]],{icon:["iconChangeHandler"]}],[1,"zonos-spinner",{size:[2],spinnerColor:[1,"spinner-color"]}]]],["p-bc2bd266.system",[[1,"zonos-select-dialog-header",{handleOnClose:[16],label:[1]}],[1,"zonos-v-stack",{spacing:[2]}]]],["p-f48a613e.system",[[1,"zonos-language-select",{handleOnClose:[16]}],[1,"zonos-card",{actions:[16],footerActions:[16],footerContent:[16],footerHeight:[2,"footer-height"],label:[16],spacing:[1]}]]],["p-7aef7d5d.system",[[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]}]]],["p-ab06e5c8.system",[[2,"zonos-address",{type:[1],titleText:[1,"title-text"],defaultAddress:[16],stripe:[32],reportedInvalidCharacters:[32],invalidCharacterList:[32],isDirtyAddress:[32]},null,{stripe:["watchInitStripe"]}],[1,"zonos-checkbox",{backgroundColor:[1,"background-color"],label:[1],isChecked:[4,"is-checked"],isDisabled:[4,"is-disabled"],size:[2],fontSize:[1,"font-size"],borderStyle:[1,"border-style"]}],[2,"zonos-link-authentication",{titleText:[1,"title-text"],stripe:[32]},null,{stripe:["watchInitStripe"]}],[1,"zonos-collapse",{collapsed:[4],collapseSize:[2,"collapse-size"],height:[32],iframe:[32]}]]],["p-93698719.system",[[2,"zonos-customer-info",{continueLoading:[4,"continue-loading"],submitBtnType:[1,"submit-btn-type"],submitBtnColor:[1,"submit-btn-color"],defaultAddress:[16],disabled:[32],hasInvalidShippingCharacters:[32],hasInvalidBillingCharacters:[32]},null,{disabled:["watchFormComplete"]}],[1,"zonos-checkout-footer",{mobile:[4],dataTheme:[1,"data-theme"],showLanguageDialog:[32],isMobile:[32]},[[4,"click","handleGlobalClick"]],{mobile:["handleMobileChange"]}],[2,"zonos-checkout-payment",{paymentError:[4,"payment-error"],submitBtnType:[1,"submit-btn-type"],continueLoading:[4,"continue-loading"],submitBtnColor:[1,"submit-btn-color"],disabled:[32]},null,{disabled:["watchFormComplete"]}],[2,"zonos-shipping",{continueLoading:[4,"continue-loading"],submitBtnColor:[1,"submit-btn-color"],submitBtnType:[1,"submit-btn-type"],selectedShippingMethod:[32],isSelecting:[32],disabled:[32],serviceLevels:[32]},null,{disabled:["watchFormComplete"]}],[1,"zonos-cart-subtotal"],[1,"zonos-checkout-finish",{borderRadius:[1,"border-radius"],storybookForceStatus:[1,"storybook-force-status"],overrideNotification:[16],isLoading:[32],notificationType:[32],notificationTitle:[32],notificationMessages:[32],order:[32]}],[1,"zonos-dialog",{open:[4],headerText:[1,"header-text"],width:[1],height:[1],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"]]],[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]}]]]],o)]}}))}))}))}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,c as t,h as n,H as e}from"./p-2244534c.js";import{r as s,d as i,u as r,a,j as c,v as l,b as d}from"./p-816f1aee.js";import{z as h,b as u,d as m}from"./p-d41b5762.js";import"./p-d01576d7.js";import"./p-ed2e94d2.js";const f=o=>{const t=document.querySelector(o);if(!document.querySelector("zonos-hello")&&t){const o=document.createElement("zonos-hello");return t.appendChild(o),!0}return!1},p=class{constructor(n){o(this,n),this.stripeInitEvent=t(this,"stripeInitEvent",7),this.config=void 0,this.zonosApiKey=void 0}async initCheckoutElement(o){var t;o?(c.stripe=o,(t=h.checkoutSettings).placeOrderButtonSelector&&(r(t.placeOrderButtonSelector)?(()=>{if(!document.querySelector("zonos-checkout")){const o=document.createElement("zonos-checkout");document.body.appendChild(o)}})():i(`Selector checkoutButtonAnchor "${t.placeOrderButtonSelector}" is not a valid selector`)),a("init checkout element")):a("Stripe is not loaded yet - cannot init checkout element","warn")}initZonosNotification(){if(document.querySelector("zonos-notification"))return;const o=document.createElement("zonos-notification");document.body.appendChild(o)}async setupGoogleFont(o){var t,n;const e=o||m();if("Inter"===e){if(!o)return;a("[FONT] Just applied Inter , but no need to inject since we already inject Inter on start","warn"),h.appearance=Object.assign(Object.assign({},h.appearance),{fontFamily:o})}const{errors:i,json:r}=await s(`https://v1.route.js.zonos.com/api/zonos-elements/get-font-detail?family=${e}`);i.length>0||!r?a(`Failed to load font ${e}`,"warn"):(null===(n=(t=window.Zonos).injectSupportGoogleFont)||void 0===n||n.call(t,r.fontUrl),o&&(a(`[FONT] ${o} font override applied`),h.appearance=Object.assign(Object.assign({},h.appearance),{fontFamily:o})))}async componentWillLoad(){h.zonosApiKey=this.zonosApiKey,(async()=>{var o,t;const{errors:n,json:e}=await(async()=>{const{errors:o,json:t}=await s("https://v1.route.js.zonos.com/api/zonos-elements/zonos-settings");return o.length?(i("Error occurred when getting zonos settings. If this is not an unauthorized error, it will use user settings or default settings"),{errors:o,json:null}):{errors:[],json:t}})();if("403"===(null===(o=n[0])||void 0===o?void 0:o.type.toString()))return void a("Failed to load zonos settings. This domain may not have access","warn");this.initZonosNotification(),u({overrideSettings:this.config,zonosSettings:e}),this.setupGoogleFont(),h.helloSettings&&(async o=>{const{anchorElementSelector:t}=o,n=(({position:o="bottom-right"})=>{const t=".zonos--hello-mobile-wrapper";if(document.querySelector(t))return t;const n=document.createElement("div");return n.className="zonos--hello-mobile-wrapper",n.style.position="fixed","top-right"===o&&(n.style.top="72px",n.style.right="24px"),"top-left"===o&&(n.style.top="72px",n.style.left="24px"),"bottom-right"===o&&(n.style.bottom="72px",n.style.right="24px"),"bottom-left"===o&&(n.style.bottom="72px",n.style.left="24px"),n.style.zIndex="2147483007",document.body.appendChild(n),t})({position:"bottom-right"}),e=
|
|
1
|
+
import{r as o,c as t,h as n,H as e}from"./p-2244534c.js";import{r as s,d as i,u as r,a,j as c,v as l,b as d}from"./p-816f1aee.js";import{z as h,b as u,d as m}from"./p-d41b5762.js";import"./p-d01576d7.js";import"./p-ed2e94d2.js";const f=o=>{const t=document.querySelector(o);if(!document.querySelector("zonos-hello")&&t){const o=document.createElement("zonos-hello");return t.appendChild(o),!0}return!1},p=class{constructor(n){o(this,n),this.stripeInitEvent=t(this,"stripeInitEvent",7),this.config=void 0,this.zonosApiKey=void 0}async initCheckoutElement(o){var t;o?(c.stripe=o,(t=h.checkoutSettings).placeOrderButtonSelector&&(r(t.placeOrderButtonSelector)?(()=>{if(!document.querySelector("zonos-checkout")){const o=document.createElement("zonos-checkout");document.body.appendChild(o)}})():i(`Selector checkoutButtonAnchor "${t.placeOrderButtonSelector}" is not a valid selector`)),a("init checkout element")):a("Stripe is not loaded yet - cannot init checkout element","warn")}initZonosNotification(){if(document.querySelector("zonos-notification"))return;const o=document.createElement("zonos-notification");document.body.appendChild(o)}async setupGoogleFont(o){var t,n;const e=o||m();if("Inter"===e){if(!o)return;a("[FONT] Just applied Inter , but no need to inject since we already inject Inter on start","warn"),h.appearance=Object.assign(Object.assign({},h.appearance),{fontFamily:o})}const{errors:i,json:r}=await s(`https://v1.route.js.zonos.com/api/zonos-elements/get-font-detail?family=${e}`);i.length>0||!r?a(`Failed to load font ${e}`,"warn"):(null===(n=(t=window.Zonos).injectSupportGoogleFont)||void 0===n||n.call(t,r.fontUrl),o&&(a(`[FONT] ${o} font override applied`),h.appearance=Object.assign(Object.assign({},h.appearance),{fontFamily:o})))}async componentWillLoad(){h.zonosApiKey=this.zonosApiKey,(async()=>{var o,t;const{errors:n,json:e}=await(async()=>{const{errors:o,json:t}=await s("https://v1.route.js.zonos.com/api/zonos-elements/zonos-settings");return o.length?(i("Error occurred when getting zonos settings. If this is not an unauthorized error, it will use user settings or default settings"),{errors:o,json:null}):{errors:[],json:t}})();if("403"===(null===(o=n[0])||void 0===o?void 0:o.type.toString()))return void a("Failed to load zonos settings. This domain may not have access","warn");this.initZonosNotification(),u({overrideSettings:this.config,zonosSettings:e}),this.setupGoogleFont(),h.helloSettings&&(async o=>{const{anchorElementSelector:t}=o,n=(({position:o="bottom-right"})=>{const t=".zonos--hello-mobile-wrapper";if(document.querySelector(t))return t;const n=document.createElement("div");return n.className="zonos--hello-mobile-wrapper",n.style.position="fixed","top-right"===o&&(n.style.top="72px",n.style.right="24px"),"top-left"===o&&(n.style.top="72px",n.style.left="24px"),"bottom-right"===o&&(n.style.bottom="72px",n.style.right="24px"),"bottom-left"===o&&(n.style.bottom="72px",n.style.left="24px"),n.style.zIndex="2147483007",document.body.appendChild(n),t})({position:"bottom-right"}),e=t||n;if(e&&r(e)){if(a("Hello init complete"),!f(e)){const o=new MutationObserver((()=>{f(e)&&o.disconnect()}));o.observe(document.body,{childList:!0,subtree:!0}),setTimeout((()=>{o.disconnect()}),5e3)}}else i(`Selector anchorElementSelector "${o.anchorElementSelector}" is not a valid selector.`)})(h.helloSettings),await l();const c=(null===(t=null==e?void 0:e.checkoutSettings)||void 0===t?void 0:t.externalServiceTokens.find((o=>"STRIPE_PUBLISHABLE_TOKEN"===o.type)))||null;if(c&&this.stripeInitEvent){if("INACTIVE"===h.checkoutSettings.subscriptionStatus)return a('=== Checkout subscription is "INACTIVE" - Cancel initializing for Checkout ===',"warn"),void a("zonos controller loaded");if("DISABLED"===h.checkoutSettings.visibilityStatus)return a("=== Checkout is disabled by store owner ===","warn"),void a("zonos controller loaded");this.stripeInitEvent.emit({publishableKey:c.token}),a("zonos controller loaded")}else a("Checkout failed to load -- missing publishable key","warn")})()}async showNotification(o){const t=document.querySelector("zonos-notification");t?t.showNotification(o):a("Failed to show notification - zonos-notification not found","warn")}async overrideConfig(o){u({overrideSettings:o,zonosSettings:null})}async overrideCountry(o){d(o)}async getAppearanceSetting(){return h.appearance}async updateOrganizationName(o){h.organizationName=o}render(){return n(e,{key:"e0869cf08934b9d047adef9875c9a5f50d604bdf",class:"zonos--elements"})}};p.style=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{visibility:hidden;opacity:0;height:0}";export{p as zonos_controller}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as o}from"./p-2244534c.js";export{s as setNonce}from"./p-2244534c.js";import{g as t}from"./p-e1255160.js";(()=>{const o=import.meta.url,t={};return""!==o&&(t.resourcesUrl=new URL(".",o).href),e(t)})().then((async e=>(await t(),o([["p-e9a41fd8",[[2,"zonos-checkout",{appearanceSettingsOverride:[16],preview:[4],mobile:[4],defaultAddress:[16],forceDialogOpen:[4,"force-dialog-open"],open:[32],stripe:[32],submitLoading:[32],paymentError:[32],collapseReviewMobile:[32],isAttachError:[32],isMobile:[32],zonosReviewRef:[32],storybookPaymentStatusOverride:[32],domesticRedirectedBtnSelector:[32],legacyCheckoutHiddenBtnSelector:[32],isLegacyCheckout:[32],closeDialogHandler:[64],init:[64],setToFinishStep:[64]},[[16,"zonos--init-cart-info","initCartInfoHandler"],[9,"resize","handleWindowResize"]],{appearanceSettingsOverride:["appearanceSettingsOverrideChanged","handleAppearanceSettingsOverrideChange"],mobile:["handleMobileChange"]}]]],["p-418c056d",[[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],displayCurrency:[64],convertAndFormat:[64],convert:[64],format:[64],openHelloDialog:[64]},[[9,"resize","handleResize"]],{appearanceSettingsOverride:["handleAppearanceSettingsOverrideChange"]}]]],["p-
|
|
1
|
+
import{p as e,b as o}from"./p-2244534c.js";export{s as setNonce}from"./p-2244534c.js";import{g as t}from"./p-e1255160.js";(()=>{const o=import.meta.url,t={};return""!==o&&(t.resourcesUrl=new URL(".",o).href),e(t)})().then((async e=>(await t(),o([["p-e9a41fd8",[[2,"zonos-checkout",{appearanceSettingsOverride:[16],preview:[4],mobile:[4],defaultAddress:[16],forceDialogOpen:[4,"force-dialog-open"],open:[32],stripe:[32],submitLoading:[32],paymentError:[32],collapseReviewMobile:[32],isAttachError:[32],isMobile:[32],zonosReviewRef:[32],storybookPaymentStatusOverride:[32],domesticRedirectedBtnSelector:[32],legacyCheckoutHiddenBtnSelector:[32],isLegacyCheckout:[32],closeDialogHandler:[64],init:[64],setToFinishStep:[64]},[[16,"zonos--init-cart-info","initCartInfoHandler"],[9,"resize","handleWindowResize"]],{appearanceSettingsOverride:["appearanceSettingsOverrideChanged","handleAppearanceSettingsOverrideChange"],mobile:["handleMobileChange"]}]]],["p-418c056d",[[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],displayCurrency:[64],convertAndFormat:[64],convert:[64],format:[64],openHelloDialog:[64]},[[9,"resize","handleResize"]],{appearanceSettingsOverride:["handleAppearanceSettingsOverrideChange"]}]]],["p-f6bbff95",[[1,"zonos-controller",{config:[16],zonosApiKey:[1,"zonos-api-key"],initCheckoutElement:[64],setupGoogleFont:[64],showNotification:[64],overrideConfig:[64],overrideCountry:[64],getAppearanceSetting:[64],updateOrganizationName:[64]}]]],["p-a48e7c84",[[1,"zonos-component",{first:[1],middle:[1],last:[1]}]]],["p-257af88b",[[1,"zonos-link",{href:[1],rel:[1],target:[1],linkTitle:[1,"link-title"]}]]],["p-1f5c2d7b",[[1,"zonos-logo",{theme:[1],width:[1]}]]],["p-5ca09163",[[1,"zonos-text",{textColor:[1,"text-color"],size:[1],type:[1],weight:[2],content:[1],ready:[32]}]]],["p-4fbd0ce6",[[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"]}]]],["p-2ee0d779",[[1,"zonos-notification",{notificationArray:[32],showNotification:[64]}]]],["p-9da65d62",[[2,"zonos-payment",{titleText:[1,"title-text"],stripe:[32],stripeElements:[32]},null,{stripeElements:["watchInitStripe"],stripe:["watchInitStripe"]}]]],["p-e703c902",[[1,"zonos-shipping-rich-radio",{items:[16],borderColor:[1,"border-color"],borderStyle:[1,"border-style"],theme:[1],initialSelectedValue:[8,"initial-selected-value"],selectedItem:[32]}]]],["p-8cb8fa93",[[1,"zonos-badge",{bold:[4],badgeColor:[1,"badge-color"],icon:[16],iconRight:[4,"icon-right"],size:[1],rounded:[4]}],[1,"zonos-tooltip",{label:[1],subtitle:[1],showTooltip:[32]}]]],["p-d9aa8599",[[1,"zonos-country-flag",{countryCode:[1,"country-code"],size:[2]}]]],["p-97534044",[[1,"zonos-banner",{bannerTitle:[1,"banner-title"],intent:[1],hasContent:[32]}]]],["p-be022d8e",[[1,"zonos-icon",{autoHeight:[4,"auto-height"],iconColor:[1,"icon-color"],content:[1],size:[2]}]]],["p-808413f8",[[1,"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"],noPaddingLeft:[4,"no-padding-left"],noPaddingRight:[4,"no-padding-right"],loading:[4],theme:[1],hasIcon:[32],hasContent:[32]},[[2,"click","clickHandler"]],{icon:["iconChangeHandler"]}],[1,"zonos-spinner",{size:[2],spinnerColor:[1,"spinner-color"]}]]],["p-cd449b56",[[1,"zonos-select-dialog-header",{handleOnClose:[16],label:[1]}],[1,"zonos-v-stack",{spacing:[2]}]]],["p-3f713699",[[1,"zonos-language-select",{handleOnClose:[16]}],[1,"zonos-card",{actions:[16],footerActions:[16],footerContent:[16],footerHeight:[2,"footer-height"],label:[16],spacing:[1]}]]],["p-3b4225b2",[[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]}]]],["p-aa671fa6",[[2,"zonos-address",{type:[1],titleText:[1,"title-text"],defaultAddress:[16],stripe:[32],reportedInvalidCharacters:[32],invalidCharacterList:[32],isDirtyAddress:[32]},null,{stripe:["watchInitStripe"]}],[1,"zonos-checkbox",{backgroundColor:[1,"background-color"],label:[1],isChecked:[4,"is-checked"],isDisabled:[4,"is-disabled"],size:[2],fontSize:[1,"font-size"],borderStyle:[1,"border-style"]}],[2,"zonos-link-authentication",{titleText:[1,"title-text"],stripe:[32]},null,{stripe:["watchInitStripe"]}],[1,"zonos-collapse",{collapsed:[4],collapseSize:[2,"collapse-size"],height:[32],iframe:[32]}]]],["p-3e38990b",[[2,"zonos-customer-info",{continueLoading:[4,"continue-loading"],submitBtnType:[1,"submit-btn-type"],submitBtnColor:[1,"submit-btn-color"],defaultAddress:[16],disabled:[32],hasInvalidShippingCharacters:[32],hasInvalidBillingCharacters:[32]},null,{disabled:["watchFormComplete"]}],[1,"zonos-checkout-footer",{mobile:[4],dataTheme:[1,"data-theme"],showLanguageDialog:[32],isMobile:[32]},[[4,"click","handleGlobalClick"]],{mobile:["handleMobileChange"]}],[2,"zonos-checkout-payment",{paymentError:[4,"payment-error"],submitBtnType:[1,"submit-btn-type"],continueLoading:[4,"continue-loading"],submitBtnColor:[1,"submit-btn-color"],disabled:[32]},null,{disabled:["watchFormComplete"]}],[2,"zonos-shipping",{continueLoading:[4,"continue-loading"],submitBtnColor:[1,"submit-btn-color"],submitBtnType:[1,"submit-btn-type"],selectedShippingMethod:[32],isSelecting:[32],disabled:[32],serviceLevels:[32]},null,{disabled:["watchFormComplete"]}],[1,"zonos-cart-subtotal"],[1,"zonos-checkout-finish",{borderRadius:[1,"border-radius"],storybookForceStatus:[1,"storybook-force-status"],overrideNotification:[16],isLoading:[32],notificationType:[32],notificationTitle:[32],notificationMessages:[32],order:[32]}],[1,"zonos-dialog",{open:[4],headerText:[1,"header-text"],width:[1],height:[1],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"]]],[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]}]]]],e))));
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(t,n,o,e){function i(t){return t instanceof o?t:new o((function(n){n(t)}))}return new(o||(o=Promise))((function(o,r){function u(t){try{a(e.next(t))}catch(t){r(t)}}function s(t){try{a(e["throw"](t))}catch(t){r(t)}}function a(t){t.done?o(t.value):i(t.value).then(u,s)}a((e=e.apply(t,n||[])).next())}))};var __generator=this&&this.__generator||function(t,n){var o={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},e,i,r,u;return u={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(u[Symbol.iterator]=function(){return this}),u;function s(t){return function(n){return a([t,n])}}function a(s){if(e)throw new TypeError("Generator is already executing.");while(u&&(u=0,s[0]&&(o=0)),o)try{if(e=1,i&&(r=s[0]&2?i["return"]:s[0]?i["throw"]||((r=i["return"])&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;if(i=0,r)s=[s[0]&2,r.value];switch(s[0]){case 0:case 1:r=s;break;case 4:o.label++;return{value:s[1],done:false};case 5:o.label++;i=s[1];s=[0];continue;case 7:s=o.ops.pop();o.trys.pop();continue;default:if(!(r=o.trys,r=r.length>0&&r[r.length-1])&&(s[0]===6||s[0]===2)){o=0;continue}if(s[0]===3&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(s[0]===6&&o.label<r[1]){o.label=r[1];r=s;break}if(r&&o.label<r[2]){o.label=r[2];o.ops.push(s);break}if(r[2])o.ops.pop();o.trys.pop();continue}s=n.call(t,o)}catch(t){s=[6,t];i=0}finally{e=r=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-2825570c.system.js","./p-2d404058.system.js","./p-520e8e63.system.js","./p-fc4da55c.system.js","./p-f4c38bfc.system.js"],(function(t){"use strict";var n,o,e,i,r,u,s,a,c,f,d,h,l,v;return{setters:[function(t){n=t.r;o=t.c;e=t.h;i=t.H},function(t){r=t.r;u=t.d;s=t.u;a=t.a;c=t.j;f=t.v;d=t.b},function(t){h=t.z;l=t.b;v=t.d},function(){},function(){}],execute:function(){var m=this;var _=function(){return __awaiter(m,void 0,void 0,(function(){var t,n,o,e;return __generator(this,(function(i){switch(i.label){case 0:t="".concat("https://v1.route.js.zonos.com","/api/zonos-elements/zonos-settings");return[4,r(t)];case 1:n=i.sent(),o=n.errors,e=n.json;if(o.length){u("Error occurred when getting zonos settings. If this is not an unauthorized error, it will use user settings or default settings");return[2,{errors:o,json:null}]}return[2,{errors:[],json:e}]}}))}))};var w=function(){var t=document.querySelector("zonos-checkout");if(!t){var n=document.createElement("zonos-checkout");document.body.appendChild(n)}};var p=function(t){if(!t.placeOrderButtonSelector){return}if(!s(t.placeOrderButtonSelector)){u('Selector checkoutButtonAnchor "'.concat(t.placeOrderButtonSelector,'" is not a valid selector'));return}w()};var g=function(t){var n=document.querySelector(t);var o=document.querySelector("zonos-hello");if(!o&&n){var e=document.createElement("zonos-hello");n.appendChild(e);return true}return false};var y=function(t){var n=t.position,o=n===void 0?"bottom-right":n;var e=".zonos--hello-mobile-wrapper";var i=document.querySelector(e);if(i){return e}var r=document.createElement("div");r.className="zonos--hello-mobile-wrapper";r.style.position="fixed";if(o==="top-right"){r.style.top="72px";r.style.right="24px"}if(o==="top-left"){r.style.top="72px";r.style.left="24px"}if(o==="bottom-right"){r.style.bottom="72px";r.style.right="24px"}if(o==="bottom-left"){r.style.bottom="72px";r.style.left="24px"}r.style.zIndex="2147483007";document.body.appendChild(r);return e};var b=function(t){return __awaiter(m,void 0,void 0,(function(){var n,o,e,i,r;return __generator(this,(function(c){n=t.anchorElementSelector;o=y({position:"bottom-right"});e=window.Zonos.isBigCommerce?n||o:n;if(!e||!s(e)){u('Selector anchorElementSelector "'.concat(t.anchorElementSelector,'" is not a valid selector.'));return[2]}a("Hello init complete");i=g(e);if(!i){r=new MutationObserver((function(){var t=g(e);if(t){r.disconnect()}}));r.observe(document.body,{childList:true,subtree:true});setTimeout((function(){r.disconnect()}),5e3)}return[2]}))}))};var z=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{visibility:hidden;opacity:0;height:0}";var k=z;var I=t("zonos_controller",function(){function t(t){n(this,t);this.stripeInitEvent=o(this,"stripeInitEvent",7);this.config=undefined;this.zonosApiKey=undefined}t.prototype.initCheckoutElement=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){if(!t){a("Stripe is not loaded yet - cannot init checkout element","warn");return[2]}c.stripe=t;void p(h.checkoutSettings);a("init checkout element");return[2]}))}))};t.prototype.initZonosNotification=function(){var t=document.querySelector("zonos-notification");if(t){return}var n=document.createElement("zonos-notification");document.body.appendChild(n)};t.prototype.setupGoogleFont=function(t){return __awaiter(this,void 0,void 0,(function(){var n,o,e,i,u,s,c,f;return __generator(this,(function(d){switch(d.label){case 0:e=t||v();if(e==="Inter"){if(!t){return[2]}a("[FONT] Just applied Inter , but no need to inject since we already inject Inter on start","warn");h.appearance=Object.assign(Object.assign({},h.appearance),{fontFamily:t})}i="https://v1.route.js.zonos.com";return[4,r("".concat(i,"/api/zonos-elements/get-font-detail?family=").concat(e))];case 1:u=d.sent(),s=u.errors,c=u.json;if(s.length>0||!c){a("Failed to load font ".concat(e),"warn");return[2]}f=c.fontUrl;(o=(n=window.Zonos).injectSupportGoogleFont)===null||o===void 0?void 0:o.call(n,f);if(!t){return[2]}a("[FONT] ".concat(t," font override applied"));h.appearance=Object.assign(Object.assign({},h.appearance),{fontFamily:t});return[2]}}))}))};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(n){h.zonosApiKey=this.zonosApiKey;(function(){return __awaiter(t,void 0,void 0,(function(){var t,n,o,e,i,r;return __generator(this,(function(u){switch(u.label){case 0:return[4,_()];case 1:o=u.sent(),e=o.errors,i=o.json;if(((t=e[0])===null||t===void 0?void 0:t.type.toString())==="403"){a("Failed to load zonos settings. This domain may not have access","warn");return[2]}this.initZonosNotification();l({overrideSettings:this.config,zonosSettings:i});void this.setupGoogleFont();if(h.helloSettings){void b(h.helloSettings)}return[4,f()];case 2:u.sent();r=((n=i===null||i===void 0?void 0:i.checkoutSettings)===null||n===void 0?void 0:n.externalServiceTokens.find((function(t){return t.type==="STRIPE_PUBLISHABLE_TOKEN"})))||null;if(!r||!this.stripeInitEvent){a("Checkout failed to load -- missing publishable key","warn");return[2]}if(h.checkoutSettings.subscriptionStatus==="INACTIVE"){a('=== Checkout subscription is "INACTIVE" - Cancel initializing for Checkout ===',"warn");a("zonos controller loaded");return[2]}if(h.checkoutSettings.visibilityStatus==="DISABLED"){a("=== Checkout is disabled by store owner ===","warn");a("zonos controller loaded");return[2]}this.stripeInitEvent.emit({publishableKey:r.token});a("zonos controller loaded");return[2]}}))}))})();return[2]}))}))};t.prototype.showNotification=function(t){return __awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(o){n=document.querySelector("zonos-notification");if(!n){a("Failed to show notification - zonos-notification not found","warn");return[2]}void n.showNotification(t);return[2]}))}))};t.prototype.overrideConfig=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){l({overrideSettings:t,zonosSettings:null});return[2]}))}))};t.prototype.overrideCountry=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){void d(t);return[2]}))}))};t.prototype.getAppearanceSetting=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,h.appearance]}))}))};t.prototype.updateOrganizationName=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){h.organizationName=t;return[2]}))}))};t.prototype.render=function(){return e(i,{key:"e0869cf08934b9d047adef9875c9a5f50d604bdf",class:"zonos--elements"})};return t}());I.style=k}}}));
|