@zonos/elements 1.2.4-alpha.7 → 1.2.4-alpha.8
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 -1
- package/dist/collection/components/utils/api/getZonosSetting.js +1 -1
- package/dist/collection/types/generated/graphql.customer.types.js +21 -4
- package/dist/collection/types/generated/graphql.frontend.types.js +13 -16
- package/dist/components/zonos-controller.js +1 -1
- package/dist/esm/zonos-controller.entry.js +1 -1
- package/dist/esm-es5/zonos-controller.entry.js +1 -1
- package/dist/scripts/loadZonos.js +3 -3
- package/dist/scripts/zonos.js +3 -3
- package/dist/types/types/generated/graphql.customer.types.d.ts +29 -5
- package/dist/types/types/generated/graphql.customer.types.ts +37 -8
- package/dist/types/types/generated/graphql.frontend.types.d.ts +73 -85
- package/dist/types/types/generated/graphql.frontend.types.ts +90 -109
- package/dist/zonos-elements/p-19942abb.system.entry.js +1 -0
- package/dist/zonos-elements/p-24fbe845.system.js +1 -1
- package/dist/zonos-elements/p-a3a8b5e7.entry.js +1 -0
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/zonos-elements/p-33137e7d.system.entry.js +0 -1
- package/dist/zonos-elements/p-eb392924.entry.js +0 -1
|
@@ -10,7 +10,7 @@ require('./isDarkColor-ff6ff183.js');
|
|
|
10
10
|
require('./getBorderRadius-bf4a4276.js');
|
|
11
11
|
|
|
12
12
|
const getZonosSetting = async () => {
|
|
13
|
-
const url = `${"https://v1.route.js.zonos.com"}/api/zonos-elements/zonos-
|
|
13
|
+
const url = `${"https://v1.route.js.zonos.com"}/api/zonos-elements/zonos-settings`;
|
|
14
14
|
const { errors, json } = await localization.handleFetch(url);
|
|
15
15
|
if (errors.length) {
|
|
16
16
|
localization.logError(`Error occurs when getting zonos settings. If this is not an unauthorized error, it will use user setting or default setting`);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { handleFetch } from "../handleFetch";
|
|
2
2
|
import { logError } from "../logging/logError";
|
|
3
3
|
export const getZonosSetting = async () => {
|
|
4
|
-
const url = `${process.env.NEXT_PUBLIC_ZONOS_ROUTE_URL}/api/zonos-elements/zonos-
|
|
4
|
+
const url = `${process.env.NEXT_PUBLIC_ZONOS_ROUTE_URL}/api/zonos-elements/zonos-settings`;
|
|
5
5
|
const { errors, json } = await handleFetch(url);
|
|
6
6
|
if (errors.length) {
|
|
7
7
|
logError(`Error occurs when getting zonos settings. If this is not an unauthorized error, it will use user setting or default setting`);
|
|
@@ -978,6 +978,20 @@ export const elementsUiTheme = {
|
|
|
978
978
|
Light: 'LIGHT',
|
|
979
979
|
System: 'SYSTEM',
|
|
980
980
|
};
|
|
981
|
+
export const emailTemplateProviderType = {
|
|
982
|
+
Sendgrid: 'SENDGRID',
|
|
983
|
+
};
|
|
984
|
+
export const emailTemplateStatus = {
|
|
985
|
+
Primary: 'PRIMARY',
|
|
986
|
+
Standard: 'STANDARD',
|
|
987
|
+
};
|
|
988
|
+
export const emailTemplateType = {
|
|
989
|
+
AbandonedCart: 'ABANDONED_CART',
|
|
990
|
+
OrderCanceled: 'ORDER_CANCELED',
|
|
991
|
+
OrderConfirmation: 'ORDER_CONFIRMATION',
|
|
992
|
+
OrderShipped: 'ORDER_SHIPPED',
|
|
993
|
+
Unknown: 'UNKNOWN',
|
|
994
|
+
};
|
|
981
995
|
export const endOfDayBehavior = {
|
|
982
996
|
Exempt: 'EXEMPT',
|
|
983
997
|
Required: 'REQUIRED',
|
|
@@ -1252,6 +1266,8 @@ export const landedCostFeeType = {
|
|
|
1252
1266
|
CurrencyConversionFee: 'CURRENCY_CONVERSION_FEE',
|
|
1253
1267
|
DdpServiceFee: 'DDP_SERVICE_FEE',
|
|
1254
1268
|
Duty: 'DUTY',
|
|
1269
|
+
InclusivePriceAdjustment: 'INCLUSIVE_PRICE_ADJUSTMENT',
|
|
1270
|
+
InclusivePricing: 'INCLUSIVE_PRICING',
|
|
1255
1271
|
Item: 'ITEM',
|
|
1256
1272
|
Other: 'OTHER',
|
|
1257
1273
|
Shipping: 'SHIPPING',
|
|
@@ -1568,10 +1584,6 @@ export const shipmentAmountType = {
|
|
|
1568
1584
|
PublishedRate: 'PUBLISHED_RATE',
|
|
1569
1585
|
Surcharge: 'SURCHARGE',
|
|
1570
1586
|
};
|
|
1571
|
-
export const shipmentBatchStatus = {
|
|
1572
|
-
Closed: 'CLOSED',
|
|
1573
|
-
Open: 'OPEN',
|
|
1574
|
-
};
|
|
1575
1587
|
export const shipmentCartonSpecialService = {
|
|
1576
1588
|
Alcohol: 'ALCOHOL',
|
|
1577
1589
|
BatteryInsideEquipment: 'BATTERY_INSIDE_EQUIPMENT',
|
|
@@ -1581,6 +1593,10 @@ export const shipmentCartonSpecialService = {
|
|
|
1581
1593
|
DryIce: 'DRY_ICE',
|
|
1582
1594
|
SignatureOption: 'SIGNATURE_OPTION',
|
|
1583
1595
|
};
|
|
1596
|
+
export const shipmentConsolidationStatus = {
|
|
1597
|
+
Closed: 'CLOSED',
|
|
1598
|
+
Open: 'OPEN',
|
|
1599
|
+
};
|
|
1584
1600
|
export const shipmentSpecialService = {
|
|
1585
1601
|
Consolidation: 'CONSOLIDATION',
|
|
1586
1602
|
CutFlowers: 'CUT_FLOWERS',
|
|
@@ -1696,6 +1712,7 @@ export const transitTypeCode = {
|
|
|
1696
1712
|
export const usageRecordTypeCode = {
|
|
1697
1713
|
ApiUsage: 'API_USAGE',
|
|
1698
1714
|
LcgInvoicing: 'LCG_INVOICING',
|
|
1715
|
+
OrderComplete: 'ORDER_COMPLETE',
|
|
1699
1716
|
OrderTransactionInvoicing: 'ORDER_TRANSACTION_INVOICING',
|
|
1700
1717
|
};
|
|
1701
1718
|
export const visibilityCode = {
|
|
@@ -417,17 +417,14 @@ export const promptBulkJobStatusEnum = {
|
|
|
417
417
|
const defaultWrapper = (action, _operationName, _operationType) => action();
|
|
418
418
|
export function getSdk(client, withWrapper = defaultWrapper) {
|
|
419
419
|
return {
|
|
420
|
-
Cart(variables, requestHeaders) {
|
|
421
|
-
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'Cart', 'query');
|
|
422
|
-
},
|
|
423
420
|
CreateErrorEvent(variables, requestHeaders) {
|
|
424
421
|
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'CreateErrorEvent', 'mutation');
|
|
425
422
|
},
|
|
426
423
|
DeleteAllStoreReserveOrders(variables, requestHeaders) {
|
|
427
424
|
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'DeleteAllStoreReserveOrders', 'mutation');
|
|
428
425
|
},
|
|
429
|
-
|
|
430
|
-
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), '
|
|
426
|
+
DeleteBigCommerceSettings(variables, requestHeaders) {
|
|
427
|
+
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'DeleteBigCommerceSettings', 'mutation');
|
|
431
428
|
},
|
|
432
429
|
DeleteOrderImportLock(variables, requestHeaders) {
|
|
433
430
|
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'DeleteOrderImportLock', 'mutation');
|
|
@@ -438,17 +435,17 @@ export function getSdk(client, withWrapper = defaultWrapper) {
|
|
|
438
435
|
GetAudienceByAspectKey(variables, requestHeaders) {
|
|
439
436
|
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'GetAudienceByAspectKey', 'query');
|
|
440
437
|
},
|
|
441
|
-
|
|
442
|
-
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), '
|
|
443
|
-
},
|
|
444
|
-
GetCheckoutReserveOrders(variables, requestHeaders) {
|
|
445
|
-
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'GetCheckoutReserveOrders', 'query');
|
|
438
|
+
GetBigCommerceSettings(variables, requestHeaders) {
|
|
439
|
+
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'GetBigCommerceSettings', 'query');
|
|
446
440
|
},
|
|
447
441
|
GetReserveOrder(variables, requestHeaders) {
|
|
448
442
|
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'GetReserveOrder', 'query');
|
|
449
443
|
},
|
|
450
|
-
|
|
451
|
-
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), '
|
|
444
|
+
GetSettingsReserveOrders(variables, requestHeaders) {
|
|
445
|
+
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'GetSettingsReserveOrders', 'query');
|
|
446
|
+
},
|
|
447
|
+
InsertBigCommerceSettingsEvent(variables, requestHeaders) {
|
|
448
|
+
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'InsertBigCommerceSettingsEvent', 'mutation');
|
|
452
449
|
},
|
|
453
450
|
InsertOrderImportLock(variables, requestHeaders) {
|
|
454
451
|
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'InsertOrderImportLock', 'mutation');
|
|
@@ -456,8 +453,8 @@ export function getSdk(client, withWrapper = defaultWrapper) {
|
|
|
456
453
|
InsertReserveOrder(variables, requestHeaders) {
|
|
457
454
|
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'InsertReserveOrder', 'mutation');
|
|
458
455
|
},
|
|
459
|
-
|
|
460
|
-
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), '
|
|
456
|
+
InsertReserveOrderEvent(variables, requestHeaders) {
|
|
457
|
+
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'InsertReserveOrderEvent', 'mutation');
|
|
461
458
|
},
|
|
462
459
|
LocaleCountryMessages(variables, requestHeaders) {
|
|
463
460
|
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'LocaleCountryMessages', 'query');
|
|
@@ -465,8 +462,8 @@ export function getSdk(client, withWrapper = defaultWrapper) {
|
|
|
465
462
|
UpdateReserveOrder(variables, requestHeaders) {
|
|
466
463
|
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'UpdateReserveOrder', 'mutation');
|
|
467
464
|
},
|
|
468
|
-
|
|
469
|
-
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), '
|
|
465
|
+
UpsertBigCommerceSettings(variables, requestHeaders) {
|
|
466
|
+
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'UpsertBigCommerceSettings', 'mutation');
|
|
470
467
|
},
|
|
471
468
|
};
|
|
472
469
|
}
|
|
@@ -6,7 +6,7 @@ import { d as defineCustomElement$3 } from './zonos-notification2.js';
|
|
|
6
6
|
import { d as defineCustomElement$2 } from './zonos-text2.js';
|
|
7
7
|
|
|
8
8
|
const getZonosSetting = async () => {
|
|
9
|
-
const url = `${"https://v1.route.js.zonos.com"}/api/zonos-elements/zonos-
|
|
9
|
+
const url = `${"https://v1.route.js.zonos.com"}/api/zonos-elements/zonos-settings`;
|
|
10
10
|
const { errors, json } = await handleFetch(url);
|
|
11
11
|
if (errors.length) {
|
|
12
12
|
logError(`Error occurs when getting zonos settings. If this is not an unauthorized error, it will use user setting or default setting`);
|
|
@@ -6,7 +6,7 @@ import './isDarkColor-416d6047.js';
|
|
|
6
6
|
import './getBorderRadius-178a0a05.js';
|
|
7
7
|
|
|
8
8
|
const getZonosSetting = async () => {
|
|
9
|
-
const url = `${"https://v1.route.js.zonos.com"}/api/zonos-elements/zonos-
|
|
9
|
+
const url = `${"https://v1.route.js.zonos.com"}/api/zonos-elements/zonos-settings`;
|
|
10
10
|
const { errors, json } = await handleFetch(url);
|
|
11
11
|
if (errors.length) {
|
|
12
12
|
logError(`Error occurs when getting zonos settings. If this is not an unauthorized error, it will use user setting or default setting`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(t,o,n,e){function i(t){return t instanceof n?t:new n((function(o){o(t)}))}return new(n||(n=Promise))((function(n,r){function s(t){try{c(e.next(t))}catch(t){r(t)}}function a(t){try{c(e["throw"](t))}catch(t){r(t)}}function c(t){t.done?n(t.value):i(t.value).then(s,a)}c((e=e.apply(t,o||[])).next())}))};var __generator=this&&this.__generator||function(t,o){var n={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},e,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(t){return function(o){return c([t,o])}}function c(a){if(e)throw new TypeError("Generator is already executing.");while(s&&(s=0,a[0]&&(n=0)),n)try{if(e=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:n.label++;return{value:a[1],done:false};case 5:n.label++;i=a[1];a=[0];continue;case 7:a=n.ops.pop();n.trys.pop();continue;default:if(!(r=n.trys,r=r.length>0&&r[r.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!r||a[1]>r[0]&&a[1]<r[3])){n.label=a[1];break}if(a[0]===6&&n.label<r[1]){n.label=r[1];r=a;break}if(r&&n.label<r[2]){n.label=r[2];n.ops.push(a);break}if(r[2])n.ops.pop();n.trys.pop();continue}a=o.call(t,n)}catch(t){a=[6,t];i=0}finally{e=r=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-36ff6342.js";import{s as stripeStore}from"./cart-b439be00.js";import{h as handleFetch,b as logError,i as isValidSelector,l as log,c as initLocalizationStore,d as localizationStoreUpdateSelectedCountryCode}from"./localization-a51ccbc2.js";import{z as zonosStore,d as zonosStoreInitSetting,e as zonosStoreFontFamily}from"./zonosStore-61e74f58.js";import"./isDarkColor-416d6047.js";import"./getBorderRadius-178a0a05.js";var getZonosSetting=function(){return __awaiter(void 0,void 0,void 0,(function(){var t,o,n,e;return __generator(this,(function(i){switch(i.label){case 0:t="".concat("https://v1.route.js.zonos.com","/api/zonos-elements/zonos-
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(t,o,n,e){function i(t){return t instanceof n?t:new n((function(o){o(t)}))}return new(n||(n=Promise))((function(n,r){function s(t){try{c(e.next(t))}catch(t){r(t)}}function a(t){try{c(e["throw"](t))}catch(t){r(t)}}function c(t){t.done?n(t.value):i(t.value).then(s,a)}c((e=e.apply(t,o||[])).next())}))};var __generator=this&&this.__generator||function(t,o){var n={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},e,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(t){return function(o){return c([t,o])}}function c(a){if(e)throw new TypeError("Generator is already executing.");while(s&&(s=0,a[0]&&(n=0)),n)try{if(e=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:n.label++;return{value:a[1],done:false};case 5:n.label++;i=a[1];a=[0];continue;case 7:a=n.ops.pop();n.trys.pop();continue;default:if(!(r=n.trys,r=r.length>0&&r[r.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!r||a[1]>r[0]&&a[1]<r[3])){n.label=a[1];break}if(a[0]===6&&n.label<r[1]){n.label=r[1];r=a;break}if(r&&n.label<r[2]){n.label=r[2];n.ops.push(a);break}if(r[2])n.ops.pop();n.trys.pop();continue}a=o.call(t,n)}catch(t){a=[6,t];i=0}finally{e=r=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-36ff6342.js";import{s as stripeStore}from"./cart-b439be00.js";import{h as handleFetch,b as logError,i as isValidSelector,l as log,c as initLocalizationStore,d as localizationStoreUpdateSelectedCountryCode}from"./localization-a51ccbc2.js";import{z as zonosStore,d as zonosStoreInitSetting,e as zonosStoreFontFamily}from"./zonosStore-61e74f58.js";import"./isDarkColor-416d6047.js";import"./getBorderRadius-178a0a05.js";var getZonosSetting=function(){return __awaiter(void 0,void 0,void 0,(function(){var t,o,n,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,handleFetch(t)];case 1:o=i.sent(),n=o.errors,e=o.json;if(n.length){logError("Error occurs when getting zonos settings. If this is not an unauthorized error, it will use user setting or default setting");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("zonos-hello");if(!o&&t){var n=document.createElement("zonos-hello");t.appendChild(n)}};var initHello=function(t){return __awaiter(void 0,void 0,void 0,(function(){var o,n;return __generator(this,(function(e){o=t.anchorElementSelector;if(!o||!isValidSelector(o)){logError('Selector anchorElementSelector "'.concat(t.anchorElementSelector,'" is not a valid selector.'));return[2]}n=document.querySelector(o);log("Hello init complete");injectHelloComponent(n);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 ZonosController=function(){function t(t){registerInstance(this,t);this.stripeInitEvent=createEvent(this,"stripeInitEvent",7);this.disablePlaceOrderButtons=function(t){var o=t.disable;var n=zonosStore.checkoutSettings.placeOrderButtonSelector;if(!n){return}var e=function(t){var o=t.target;if(o.getAttribute("disabled")){t.preventDefault();t.stopPropagation()}};var i=document.querySelectorAll(n);i.forEach((function(t){if(o){t.setAttribute("disabled","true");t.addEventListener("click",e)}else{t.removeAttribute("disabled");t.removeEventListener("click",e)}}));if(o){setTimeout((function(){i.forEach((function(t){t.removeAttribute("disabled");t.removeEventListener("click",e)}))}),5e3)}};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");this.disablePlaceOrderButtons({disable:false});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,i,r,s,a,c;return __generator(this,(function(u){switch(u.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})}i="https://v1.route.js.zonos.com";return[4,handleFetch("".concat(i,"/api/zonos-elements/get-font-detail?family=").concat(e))];case 1:r=u.sent(),s=r.errors,a=r.json;if(s.length>0||!a){log("Failed to load font ".concat(e),"warn");return[2]}c=a.fontUrl;(n=(o=window.Zonos).injectSupportGoogleFont)===null||n===void 0?void 0:n.call(o,c);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,i,r;return __generator(this,(function(s){switch(s.label){case 0:return[4,getZonosSetting()];case 1:n=s.sent(),e=n.errors,i=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.disablePlaceOrderButtons({disable:true});this.initZonosNotification();zonosStoreInitSetting({overrideSettings:this.config,zonosSettings:i});void this.setupGoogleFont();if(zonosStore.helloSettings){void initHello(zonosStore.helloSettings)}return[4,initLocalizationStore()];case 2:s.sent();r=((o=i===null||i===void 0?void 0:i.checkoutSettings)===null||o===void 0?void 0:o.externalServiceTokens.find((function(t){return t.type==="STRIPE_PUBLISHABLE_TOKEN"})))||null;if(!r||!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:r.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.render=function(){return h(Host,{class:"zonos--elements"})};return t}();ZonosController.style=zonosControllerCss;export{ZonosController as zonos_controller};
|
|
@@ -218,8 +218,8 @@ const zonosQaUrl = (() => {
|
|
|
218
218
|
});
|
|
219
219
|
return fullUrl;
|
|
220
220
|
})();
|
|
221
|
-
const ZONOS_URL = zonosQaUrl || "https://v1.2.4-alpha.
|
|
222
|
-
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.2.4-alpha.
|
|
221
|
+
const ZONOS_URL = zonosQaUrl || "https://v1.2.4-alpha.8.js.zonos.com";
|
|
222
|
+
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.2.4-alpha.8";
|
|
223
223
|
const INTER_FONT_URL = 'https://rsms.me';
|
|
224
224
|
const GOOGLE_FONT_URL = 'https://fonts.googleapis.com';
|
|
225
225
|
const INTER_FONT_REGEX = /^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;
|
|
@@ -232,7 +232,7 @@ Zonos.debug = !!window.location.search.match(/\?.*(&*)zonosDebug=1/);
|
|
|
232
232
|
Zonos.isBigCommerce = false;
|
|
233
233
|
Zonos.internationalHideSelector = '';
|
|
234
234
|
Zonos.zonosQaUrl = zonosQaUrl;
|
|
235
|
-
Zonos.version = `v${"1.2.4-alpha.
|
|
235
|
+
Zonos.version = `v${"1.2.4-alpha.8"}`;
|
|
236
236
|
Zonos.modeAlerted = false;
|
|
237
237
|
Zonos.getCurrentTimestamp = () => new Date().getTime();
|
|
238
238
|
Zonos.zonosController = null;
|
package/dist/scripts/zonos.js
CHANGED
|
@@ -218,8 +218,8 @@ const zonosQaUrl = (() => {
|
|
|
218
218
|
});
|
|
219
219
|
return fullUrl;
|
|
220
220
|
})();
|
|
221
|
-
const ZONOS_URL = zonosQaUrl || "https://v1.2.4-alpha.
|
|
222
|
-
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.2.4-alpha.
|
|
221
|
+
const ZONOS_URL = zonosQaUrl || "https://v1.2.4-alpha.8.js.zonos.com";
|
|
222
|
+
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.2.4-alpha.8";
|
|
223
223
|
const INTER_FONT_URL = 'https://rsms.me';
|
|
224
224
|
const GOOGLE_FONT_URL = 'https://fonts.googleapis.com';
|
|
225
225
|
const INTER_FONT_REGEX = /^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;
|
|
@@ -232,7 +232,7 @@ Zonos.debug = !!window.location.search.match(/\?.*(&*)zonosDebug=1/);
|
|
|
232
232
|
Zonos.isBigCommerce = false;
|
|
233
233
|
Zonos.internationalHideSelector = '';
|
|
234
234
|
Zonos.zonosQaUrl = zonosQaUrl;
|
|
235
|
-
Zonos.version = `v${"1.2.4-alpha.
|
|
235
|
+
Zonos.version = `v${"1.2.4-alpha.8"}`;
|
|
236
236
|
Zonos.modeAlerted = false;
|
|
237
237
|
Zonos.getCurrentTimestamp = () => new Date().getTime();
|
|
238
238
|
Zonos.zonosController = null;
|
|
@@ -47,6 +47,10 @@ export type Scalars = {
|
|
|
47
47
|
input: number;
|
|
48
48
|
output: number;
|
|
49
49
|
};
|
|
50
|
+
JSON: {
|
|
51
|
+
input: Record<string, unknown>;
|
|
52
|
+
output: Record<string, unknown>;
|
|
53
|
+
};
|
|
50
54
|
String: {
|
|
51
55
|
input: string;
|
|
52
56
|
output: string;
|
|
@@ -1107,6 +1111,23 @@ export declare const elementsUiTheme: {
|
|
|
1107
1111
|
readonly System: "SYSTEM";
|
|
1108
1112
|
};
|
|
1109
1113
|
export type ElementsUiTheme = (typeof elementsUiTheme)[keyof typeof elementsUiTheme];
|
|
1114
|
+
export declare const emailTemplateProviderType: {
|
|
1115
|
+
readonly Sendgrid: "SENDGRID";
|
|
1116
|
+
};
|
|
1117
|
+
export type EmailTemplateProviderType = (typeof emailTemplateProviderType)[keyof typeof emailTemplateProviderType];
|
|
1118
|
+
export declare const emailTemplateStatus: {
|
|
1119
|
+
readonly Primary: "PRIMARY";
|
|
1120
|
+
readonly Standard: "STANDARD";
|
|
1121
|
+
};
|
|
1122
|
+
export type EmailTemplateStatus = (typeof emailTemplateStatus)[keyof typeof emailTemplateStatus];
|
|
1123
|
+
export declare const emailTemplateType: {
|
|
1124
|
+
readonly AbandonedCart: "ABANDONED_CART";
|
|
1125
|
+
readonly OrderCanceled: "ORDER_CANCELED";
|
|
1126
|
+
readonly OrderConfirmation: "ORDER_CONFIRMATION";
|
|
1127
|
+
readonly OrderShipped: "ORDER_SHIPPED";
|
|
1128
|
+
readonly Unknown: "UNKNOWN";
|
|
1129
|
+
};
|
|
1130
|
+
export type EmailTemplateType = (typeof emailTemplateType)[keyof typeof emailTemplateType];
|
|
1110
1131
|
export declare const endOfDayBehavior: {
|
|
1111
1132
|
readonly Exempt: "EXEMPT";
|
|
1112
1133
|
readonly Required: "REQUIRED";
|
|
@@ -1421,6 +1442,8 @@ export declare const landedCostFeeType: {
|
|
|
1421
1442
|
readonly CurrencyConversionFee: "CURRENCY_CONVERSION_FEE";
|
|
1422
1443
|
readonly DdpServiceFee: "DDP_SERVICE_FEE";
|
|
1423
1444
|
readonly Duty: "DUTY";
|
|
1445
|
+
readonly InclusivePriceAdjustment: "INCLUSIVE_PRICE_ADJUSTMENT";
|
|
1446
|
+
readonly InclusivePricing: "INCLUSIVE_PRICING";
|
|
1424
1447
|
readonly Item: "ITEM";
|
|
1425
1448
|
readonly Other: "OTHER";
|
|
1426
1449
|
readonly Shipping: "SHIPPING";
|
|
@@ -1773,11 +1796,6 @@ export declare const shipmentAmountType: {
|
|
|
1773
1796
|
readonly Surcharge: "SURCHARGE";
|
|
1774
1797
|
};
|
|
1775
1798
|
export type ShipmentAmountType = (typeof shipmentAmountType)[keyof typeof shipmentAmountType];
|
|
1776
|
-
export declare const shipmentBatchStatus: {
|
|
1777
|
-
readonly Closed: "CLOSED";
|
|
1778
|
-
readonly Open: "OPEN";
|
|
1779
|
-
};
|
|
1780
|
-
export type ShipmentBatchStatus = (typeof shipmentBatchStatus)[keyof typeof shipmentBatchStatus];
|
|
1781
1799
|
export declare const shipmentCartonSpecialService: {
|
|
1782
1800
|
readonly Alcohol: "ALCOHOL";
|
|
1783
1801
|
readonly BatteryInsideEquipment: "BATTERY_INSIDE_EQUIPMENT";
|
|
@@ -1788,6 +1806,11 @@ export declare const shipmentCartonSpecialService: {
|
|
|
1788
1806
|
readonly SignatureOption: "SIGNATURE_OPTION";
|
|
1789
1807
|
};
|
|
1790
1808
|
export type ShipmentCartonSpecialService = (typeof shipmentCartonSpecialService)[keyof typeof shipmentCartonSpecialService];
|
|
1809
|
+
export declare const shipmentConsolidationStatus: {
|
|
1810
|
+
readonly Closed: "CLOSED";
|
|
1811
|
+
readonly Open: "OPEN";
|
|
1812
|
+
};
|
|
1813
|
+
export type ShipmentConsolidationStatus = (typeof shipmentConsolidationStatus)[keyof typeof shipmentConsolidationStatus];
|
|
1791
1814
|
export declare const shipmentSpecialService: {
|
|
1792
1815
|
readonly Consolidation: "CONSOLIDATION";
|
|
1793
1816
|
readonly CutFlowers: "CUT_FLOWERS";
|
|
@@ -1920,6 +1943,7 @@ export type TransitTypeCode = (typeof transitTypeCode)[keyof typeof transitTypeC
|
|
|
1920
1943
|
export declare const usageRecordTypeCode: {
|
|
1921
1944
|
readonly ApiUsage: "API_USAGE";
|
|
1922
1945
|
readonly LcgInvoicing: "LCG_INVOICING";
|
|
1946
|
+
readonly OrderComplete: "ORDER_COMPLETE";
|
|
1923
1947
|
readonly OrderTransactionInvoicing: "ORDER_TRANSACTION_INVOICING";
|
|
1924
1948
|
};
|
|
1925
1949
|
export type UsageRecordTypeCode = (typeof usageRecordTypeCode)[keyof typeof usageRecordTypeCode];
|
|
@@ -29,6 +29,7 @@ export type Scalars = {
|
|
|
29
29
|
Float: { input: number; output: number };
|
|
30
30
|
ID: { input: string; output: string };
|
|
31
31
|
Int: { input: number; output: number };
|
|
32
|
+
JSON: { input: Record<string, unknown>; output: Record<string, unknown> };
|
|
32
33
|
String: { input: string; output: string };
|
|
33
34
|
ZonedDateTime: { input: string; output: string };
|
|
34
35
|
};
|
|
@@ -1233,6 +1234,31 @@ export const elementsUiTheme = {
|
|
|
1233
1234
|
|
|
1234
1235
|
export type ElementsUiTheme =
|
|
1235
1236
|
(typeof elementsUiTheme)[keyof typeof elementsUiTheme];
|
|
1237
|
+
|
|
1238
|
+
export const emailTemplateProviderType = {
|
|
1239
|
+
Sendgrid: 'SENDGRID',
|
|
1240
|
+
} as const;
|
|
1241
|
+
|
|
1242
|
+
export type EmailTemplateProviderType =
|
|
1243
|
+
(typeof emailTemplateProviderType)[keyof typeof emailTemplateProviderType];
|
|
1244
|
+
export const emailTemplateStatus = {
|
|
1245
|
+
Primary: 'PRIMARY',
|
|
1246
|
+
Standard: 'STANDARD',
|
|
1247
|
+
} as const;
|
|
1248
|
+
|
|
1249
|
+
export type EmailTemplateStatus =
|
|
1250
|
+
(typeof emailTemplateStatus)[keyof typeof emailTemplateStatus];
|
|
1251
|
+
export const emailTemplateType = {
|
|
1252
|
+
AbandonedCart: 'ABANDONED_CART',
|
|
1253
|
+
OrderCanceled: 'ORDER_CANCELED',
|
|
1254
|
+
OrderConfirmation: 'ORDER_CONFIRMATION',
|
|
1255
|
+
OrderShipped: 'ORDER_SHIPPED',
|
|
1256
|
+
Unknown: 'UNKNOWN',
|
|
1257
|
+
} as const;
|
|
1258
|
+
|
|
1259
|
+
export type EmailTemplateType =
|
|
1260
|
+
(typeof emailTemplateType)[keyof typeof emailTemplateType];
|
|
1261
|
+
|
|
1236
1262
|
export const endOfDayBehavior = {
|
|
1237
1263
|
Exempt: 'EXEMPT',
|
|
1238
1264
|
Required: 'REQUIRED',
|
|
@@ -1638,6 +1664,8 @@ export const landedCostFeeType = {
|
|
|
1638
1664
|
CurrencyConversionFee: 'CURRENCY_CONVERSION_FEE',
|
|
1639
1665
|
DdpServiceFee: 'DDP_SERVICE_FEE',
|
|
1640
1666
|
Duty: 'DUTY',
|
|
1667
|
+
InclusivePriceAdjustment: 'INCLUSIVE_PRICE_ADJUSTMENT',
|
|
1668
|
+
InclusivePricing: 'INCLUSIVE_PRICING',
|
|
1641
1669
|
Item: 'ITEM',
|
|
1642
1670
|
Other: 'OTHER',
|
|
1643
1671
|
Shipping: 'SHIPPING',
|
|
@@ -2073,14 +2101,6 @@ export const shipmentAmountType = {
|
|
|
2073
2101
|
export type ShipmentAmountType =
|
|
2074
2102
|
(typeof shipmentAmountType)[keyof typeof shipmentAmountType];
|
|
2075
2103
|
|
|
2076
|
-
export const shipmentBatchStatus = {
|
|
2077
|
-
Closed: 'CLOSED',
|
|
2078
|
-
Open: 'OPEN',
|
|
2079
|
-
} as const;
|
|
2080
|
-
|
|
2081
|
-
export type ShipmentBatchStatus =
|
|
2082
|
-
(typeof shipmentBatchStatus)[keyof typeof shipmentBatchStatus];
|
|
2083
|
-
|
|
2084
2104
|
export const shipmentCartonSpecialService = {
|
|
2085
2105
|
Alcohol: 'ALCOHOL',
|
|
2086
2106
|
BatteryInsideEquipment: 'BATTERY_INSIDE_EQUIPMENT',
|
|
@@ -2094,6 +2114,14 @@ export const shipmentCartonSpecialService = {
|
|
|
2094
2114
|
export type ShipmentCartonSpecialService =
|
|
2095
2115
|
(typeof shipmentCartonSpecialService)[keyof typeof shipmentCartonSpecialService];
|
|
2096
2116
|
|
|
2117
|
+
export const shipmentConsolidationStatus = {
|
|
2118
|
+
Closed: 'CLOSED',
|
|
2119
|
+
Open: 'OPEN',
|
|
2120
|
+
} as const;
|
|
2121
|
+
|
|
2122
|
+
export type ShipmentConsolidationStatus =
|
|
2123
|
+
(typeof shipmentConsolidationStatus)[keyof typeof shipmentConsolidationStatus];
|
|
2124
|
+
|
|
2097
2125
|
export const shipmentSpecialService = {
|
|
2098
2126
|
Consolidation: 'CONSOLIDATION',
|
|
2099
2127
|
CutFlowers: 'CUT_FLOWERS',
|
|
@@ -2266,6 +2294,7 @@ export type TransitTypeCode =
|
|
|
2266
2294
|
export const usageRecordTypeCode = {
|
|
2267
2295
|
ApiUsage: 'API_USAGE',
|
|
2268
2296
|
LcgInvoicing: 'LCG_INVOICING',
|
|
2297
|
+
OrderComplete: 'ORDER_COMPLETE',
|
|
2269
2298
|
OrderTransactionInvoicing: 'ORDER_TRANSACTION_INVOICING',
|
|
2270
2299
|
} as const;
|
|
2271
2300
|
|
|
@@ -532,75 +532,10 @@ export type CreateErrorEventMutation = {
|
|
|
532
532
|
}>;
|
|
533
533
|
} | null;
|
|
534
534
|
};
|
|
535
|
-
export type CartQuery = {
|
|
536
|
-
bigcommerce_cart: Array<{
|
|
537
|
-
cartId: string;
|
|
538
|
-
}>;
|
|
539
|
-
};
|
|
540
|
-
export type GetBigCommerceCheckoutQuery = {
|
|
541
|
-
bigcommerce_checkout: Array<{
|
|
542
|
-
authToken: string | null;
|
|
543
|
-
createCustomerEnabled: boolean | null;
|
|
544
|
-
createdAt: string;
|
|
545
|
-
credentialToken: string | null;
|
|
546
|
-
customPaymentProviderEnabled: boolean | null;
|
|
547
|
-
dimensionUnits: string | null;
|
|
548
|
-
domain: string | null;
|
|
549
|
-
id: number;
|
|
550
|
-
isNewVersion: boolean;
|
|
551
|
-
reserveOrderEnabled: boolean | null;
|
|
552
|
-
secureUrl: string | null;
|
|
553
|
-
storeHash: string;
|
|
554
|
-
storeId: number | null;
|
|
555
|
-
updatedAt: string;
|
|
556
|
-
user: string | null;
|
|
557
|
-
weightUnits: string | null;
|
|
558
|
-
}>;
|
|
559
|
-
};
|
|
560
|
-
export type UpsertBigCommerceCheckoutMutation = {
|
|
561
|
-
insert_bigcommerce_checkout_one: {
|
|
562
|
-
authToken: string | null;
|
|
563
|
-
createCustomerEnabled: boolean | null;
|
|
564
|
-
createdAt: string;
|
|
565
|
-
credentialToken: string | null;
|
|
566
|
-
customPaymentProviderEnabled: boolean | null;
|
|
567
|
-
dimensionUnits: string | null;
|
|
568
|
-
domain: string | null;
|
|
569
|
-
id: number;
|
|
570
|
-
isNewVersion: boolean;
|
|
571
|
-
reserveOrderEnabled: boolean | null;
|
|
572
|
-
secureUrl: string | null;
|
|
573
|
-
storeHash: string;
|
|
574
|
-
storeId: number | null;
|
|
575
|
-
updatedAt: string;
|
|
576
|
-
user: string | null;
|
|
577
|
-
weightUnits: string | null;
|
|
578
|
-
} | null;
|
|
579
|
-
};
|
|
580
|
-
export type DeleteBigCommerceCheckoutMutation = {
|
|
581
|
-
delete_bigcommerce_checkout: {
|
|
582
|
-
affected_rows: number;
|
|
583
|
-
} | null;
|
|
584
|
-
};
|
|
585
|
-
export type GetCheckoutReserveOrdersQuery = {
|
|
586
|
-
bigcommerce_checkout: Array<{
|
|
587
|
-
authToken: string | null;
|
|
588
|
-
reserveOrders: Array<{
|
|
589
|
-
cartId: string;
|
|
590
|
-
orderId: string | null;
|
|
591
|
-
}>;
|
|
592
|
-
storeHash: string;
|
|
593
|
-
}>;
|
|
594
|
-
};
|
|
595
|
-
export type InsertCheckoutLogMutation = {
|
|
596
|
-
insert_bigcommerce_bigcommerceCheckoutLog_one: {
|
|
597
|
-
id: number;
|
|
598
|
-
} | null;
|
|
599
|
-
};
|
|
600
535
|
export type InsertOrderImportLockMutation = {
|
|
601
536
|
insert_bigcommerce_orderImportLock_one: {
|
|
602
537
|
id: number;
|
|
603
|
-
note: string
|
|
538
|
+
note: string;
|
|
604
539
|
orderId: string;
|
|
605
540
|
} | null;
|
|
606
541
|
};
|
|
@@ -608,7 +543,7 @@ export type DeleteOrderImportLockMutation = {
|
|
|
608
543
|
delete_bigcommerce_orderImportLock: {
|
|
609
544
|
returning: Array<{
|
|
610
545
|
id: number;
|
|
611
|
-
note: string
|
|
546
|
+
note: string;
|
|
612
547
|
orderId: string;
|
|
613
548
|
}>;
|
|
614
549
|
} | null;
|
|
@@ -651,25 +586,78 @@ export type UpdateReserveOrderMutation = {
|
|
|
651
586
|
storeHash: string;
|
|
652
587
|
} | null;
|
|
653
588
|
};
|
|
654
|
-
export type
|
|
655
|
-
|
|
589
|
+
export type InsertReserveOrderEventMutation = {
|
|
590
|
+
insert_bigcommerce_reserveOrderEvent_one: {
|
|
591
|
+
id: number;
|
|
592
|
+
} | null;
|
|
593
|
+
};
|
|
594
|
+
export type GetBigCommerceSettingsQuery = {
|
|
595
|
+
bigcommerce_settings: Array<{
|
|
596
|
+
authToken: string;
|
|
597
|
+
createCustomerEnabled: boolean;
|
|
598
|
+
createdAt: string;
|
|
599
|
+
dimensionUnits: string;
|
|
600
|
+
domain: string;
|
|
601
|
+
id: number;
|
|
602
|
+
reserveOrderEnabled: boolean;
|
|
603
|
+
storeHash: string;
|
|
604
|
+
updatedAt: string;
|
|
605
|
+
user: string;
|
|
606
|
+
weightUnits: string;
|
|
607
|
+
zonosCredentialToken: string | null;
|
|
608
|
+
zonosIsNewVersion: boolean;
|
|
609
|
+
zonosStoreId: number | null;
|
|
610
|
+
}>;
|
|
611
|
+
};
|
|
612
|
+
export type UpsertBigCommerceSettingsMutation = {
|
|
613
|
+
insert_bigcommerce_settings_one: {
|
|
614
|
+
authToken: string;
|
|
615
|
+
createCustomerEnabled: boolean;
|
|
616
|
+
createdAt: string;
|
|
617
|
+
dimensionUnits: string;
|
|
618
|
+
domain: string;
|
|
619
|
+
id: number;
|
|
620
|
+
reserveOrderEnabled: boolean;
|
|
621
|
+
storeHash: string;
|
|
622
|
+
updatedAt: string;
|
|
623
|
+
user: string;
|
|
624
|
+
weightUnits: string;
|
|
625
|
+
zonosCredentialToken: string | null;
|
|
626
|
+
zonosIsNewVersion: boolean;
|
|
627
|
+
zonosStoreId: number | null;
|
|
628
|
+
} | null;
|
|
629
|
+
};
|
|
630
|
+
export type DeleteBigCommerceSettingsMutation = {
|
|
631
|
+
delete_bigcommerce_settings: {
|
|
632
|
+
affected_rows: number;
|
|
633
|
+
} | null;
|
|
634
|
+
};
|
|
635
|
+
export type GetSettingsReserveOrdersQuery = {
|
|
636
|
+
bigcommerce_settings: Array<{
|
|
637
|
+
authToken: string;
|
|
638
|
+
reserveOrders: Array<{
|
|
639
|
+
cartId: string;
|
|
640
|
+
orderId: string | null;
|
|
641
|
+
}>;
|
|
642
|
+
storeHash: string;
|
|
643
|
+
}>;
|
|
644
|
+
};
|
|
645
|
+
export type InsertBigCommerceSettingsEventMutation = {
|
|
646
|
+
insert_bigcommerce_settingsEvent_one: {
|
|
656
647
|
id: number;
|
|
657
648
|
} | null;
|
|
658
649
|
};
|
|
659
650
|
export type SdkFunctionWrapper = <T>(action: (requestHeaders?: Record<string, string>) => Promise<T>, operationName: string, operationType?: string) => Promise<T>;
|
|
660
651
|
export declare function getSdk(client: GraphQLClient, withWrapper?: SdkFunctionWrapper): {
|
|
661
|
-
Cart(variables?: {
|
|
662
|
-
[x: string]: never;
|
|
663
|
-
} | undefined, requestHeaders?: GraphQLClientRequestHeaders): Promise<CartQuery>;
|
|
664
652
|
CreateErrorEvent(variables?: {
|
|
665
653
|
[x: string]: never;
|
|
666
654
|
} | undefined, requestHeaders?: GraphQLClientRequestHeaders): Promise<CreateErrorEventMutation>;
|
|
667
655
|
DeleteAllStoreReserveOrders(variables?: {
|
|
668
656
|
[x: string]: never;
|
|
669
657
|
} | undefined, requestHeaders?: GraphQLClientRequestHeaders): Promise<DeleteAllStoreReserveOrdersMutation>;
|
|
670
|
-
|
|
658
|
+
DeleteBigCommerceSettings(variables?: {
|
|
671
659
|
[x: string]: never;
|
|
672
|
-
} | undefined, requestHeaders?: GraphQLClientRequestHeaders): Promise<
|
|
660
|
+
} | undefined, requestHeaders?: GraphQLClientRequestHeaders): Promise<DeleteBigCommerceSettingsMutation>;
|
|
673
661
|
DeleteOrderImportLock(variables?: {
|
|
674
662
|
[x: string]: never;
|
|
675
663
|
} | undefined, requestHeaders?: GraphQLClientRequestHeaders): Promise<DeleteOrderImportLockMutation>;
|
|
@@ -679,35 +667,35 @@ export declare function getSdk(client: GraphQLClient, withWrapper?: SdkFunctionW
|
|
|
679
667
|
GetAudienceByAspectKey(variables?: {
|
|
680
668
|
[x: string]: never;
|
|
681
669
|
} | undefined, requestHeaders?: GraphQLClientRequestHeaders): Promise<GetAudienceByAspectKeyQuery>;
|
|
682
|
-
|
|
683
|
-
[x: string]: never;
|
|
684
|
-
} | undefined, requestHeaders?: GraphQLClientRequestHeaders): Promise<GetBigCommerceCheckoutQuery>;
|
|
685
|
-
GetCheckoutReserveOrders(variables?: {
|
|
670
|
+
GetBigCommerceSettings(variables?: {
|
|
686
671
|
[x: string]: never;
|
|
687
|
-
} | undefined, requestHeaders?: GraphQLClientRequestHeaders): Promise<
|
|
672
|
+
} | undefined, requestHeaders?: GraphQLClientRequestHeaders): Promise<GetBigCommerceSettingsQuery>;
|
|
688
673
|
GetReserveOrder(variables?: {
|
|
689
674
|
[x: string]: never;
|
|
690
675
|
} | undefined, requestHeaders?: GraphQLClientRequestHeaders): Promise<GetReserveOrderQuery>;
|
|
691
|
-
|
|
676
|
+
GetSettingsReserveOrders(variables?: {
|
|
677
|
+
[x: string]: never;
|
|
678
|
+
} | undefined, requestHeaders?: GraphQLClientRequestHeaders): Promise<GetSettingsReserveOrdersQuery>;
|
|
679
|
+
InsertBigCommerceSettingsEvent(variables?: {
|
|
692
680
|
[x: string]: never;
|
|
693
|
-
} | undefined, requestHeaders?: GraphQLClientRequestHeaders): Promise<
|
|
681
|
+
} | undefined, requestHeaders?: GraphQLClientRequestHeaders): Promise<InsertBigCommerceSettingsEventMutation>;
|
|
694
682
|
InsertOrderImportLock(variables?: {
|
|
695
683
|
[x: string]: never;
|
|
696
684
|
} | undefined, requestHeaders?: GraphQLClientRequestHeaders): Promise<InsertOrderImportLockMutation>;
|
|
697
685
|
InsertReserveOrder(variables?: {
|
|
698
686
|
[x: string]: never;
|
|
699
687
|
} | undefined, requestHeaders?: GraphQLClientRequestHeaders): Promise<InsertReserveOrderMutation>;
|
|
700
|
-
|
|
688
|
+
InsertReserveOrderEvent(variables?: {
|
|
701
689
|
[x: string]: never;
|
|
702
|
-
} | undefined, requestHeaders?: GraphQLClientRequestHeaders): Promise<
|
|
690
|
+
} | undefined, requestHeaders?: GraphQLClientRequestHeaders): Promise<InsertReserveOrderEventMutation>;
|
|
703
691
|
LocaleCountryMessages(variables?: {
|
|
704
692
|
[x: string]: never;
|
|
705
693
|
} | undefined, requestHeaders?: GraphQLClientRequestHeaders): Promise<LocaleCountryMessagesQuery>;
|
|
706
694
|
UpdateReserveOrder(variables?: {
|
|
707
695
|
[x: string]: never;
|
|
708
696
|
} | undefined, requestHeaders?: GraphQLClientRequestHeaders): Promise<UpdateReserveOrderMutation>;
|
|
709
|
-
|
|
697
|
+
UpsertBigCommerceSettings(variables?: {
|
|
710
698
|
[x: string]: never;
|
|
711
|
-
} | undefined, requestHeaders?: GraphQLClientRequestHeaders): Promise<
|
|
699
|
+
} | undefined, requestHeaders?: GraphQLClientRequestHeaders): Promise<UpsertBigCommerceSettingsMutation>;
|
|
712
700
|
};
|
|
713
701
|
export type Sdk = ReturnType<typeof getSdk>;
|
|
@@ -523,77 +523,17 @@ export type CreateErrorEventMutation = {
|
|
|
523
523
|
} | null;
|
|
524
524
|
};
|
|
525
525
|
|
|
526
|
-
export type CartQuery = { bigcommerce_cart: Array<{ cartId: string }> };
|
|
527
|
-
|
|
528
|
-
export type GetBigCommerceCheckoutQuery = {
|
|
529
|
-
bigcommerce_checkout: Array<{
|
|
530
|
-
authToken: string | null;
|
|
531
|
-
createCustomerEnabled: boolean | null;
|
|
532
|
-
createdAt: string;
|
|
533
|
-
credentialToken: string | null;
|
|
534
|
-
customPaymentProviderEnabled: boolean | null;
|
|
535
|
-
dimensionUnits: string | null;
|
|
536
|
-
domain: string | null;
|
|
537
|
-
id: number;
|
|
538
|
-
isNewVersion: boolean;
|
|
539
|
-
reserveOrderEnabled: boolean | null;
|
|
540
|
-
secureUrl: string | null;
|
|
541
|
-
storeHash: string;
|
|
542
|
-
storeId: number | null;
|
|
543
|
-
updatedAt: string;
|
|
544
|
-
user: string | null;
|
|
545
|
-
weightUnits: string | null;
|
|
546
|
-
}>;
|
|
547
|
-
};
|
|
548
|
-
|
|
549
|
-
export type UpsertBigCommerceCheckoutMutation = {
|
|
550
|
-
insert_bigcommerce_checkout_one: {
|
|
551
|
-
authToken: string | null;
|
|
552
|
-
createCustomerEnabled: boolean | null;
|
|
553
|
-
createdAt: string;
|
|
554
|
-
credentialToken: string | null;
|
|
555
|
-
customPaymentProviderEnabled: boolean | null;
|
|
556
|
-
dimensionUnits: string | null;
|
|
557
|
-
domain: string | null;
|
|
558
|
-
id: number;
|
|
559
|
-
isNewVersion: boolean;
|
|
560
|
-
reserveOrderEnabled: boolean | null;
|
|
561
|
-
secureUrl: string | null;
|
|
562
|
-
storeHash: string;
|
|
563
|
-
storeId: number | null;
|
|
564
|
-
updatedAt: string;
|
|
565
|
-
user: string | null;
|
|
566
|
-
weightUnits: string | null;
|
|
567
|
-
} | null;
|
|
568
|
-
};
|
|
569
|
-
|
|
570
|
-
export type DeleteBigCommerceCheckoutMutation = {
|
|
571
|
-
delete_bigcommerce_checkout: { affected_rows: number } | null;
|
|
572
|
-
};
|
|
573
|
-
|
|
574
|
-
export type GetCheckoutReserveOrdersQuery = {
|
|
575
|
-
bigcommerce_checkout: Array<{
|
|
576
|
-
authToken: string | null;
|
|
577
|
-
reserveOrders: Array<{ cartId: string; orderId: string | null }>;
|
|
578
|
-
storeHash: string;
|
|
579
|
-
}>;
|
|
580
|
-
};
|
|
581
|
-
|
|
582
|
-
export type InsertCheckoutLogMutation = {
|
|
583
|
-
insert_bigcommerce_bigcommerceCheckoutLog_one: { id: number } | null;
|
|
584
|
-
};
|
|
585
|
-
|
|
586
526
|
export type InsertOrderImportLockMutation = {
|
|
587
527
|
insert_bigcommerce_orderImportLock_one: {
|
|
588
528
|
id: number;
|
|
589
|
-
note: string
|
|
529
|
+
note: string;
|
|
590
530
|
orderId: string;
|
|
591
531
|
} | null;
|
|
592
532
|
};
|
|
593
533
|
|
|
594
534
|
export type DeleteOrderImportLockMutation = {
|
|
595
535
|
delete_bigcommerce_orderImportLock: {
|
|
596
|
-
returning: Array<{ id: number; note: string
|
|
536
|
+
returning: Array<{ id: number; note: string; orderId: string }>;
|
|
597
537
|
} | null;
|
|
598
538
|
};
|
|
599
539
|
|
|
@@ -629,8 +569,62 @@ export type UpdateReserveOrderMutation = {
|
|
|
629
569
|
} | null;
|
|
630
570
|
};
|
|
631
571
|
|
|
632
|
-
export type
|
|
633
|
-
|
|
572
|
+
export type InsertReserveOrderEventMutation = {
|
|
573
|
+
insert_bigcommerce_reserveOrderEvent_one: { id: number } | null;
|
|
574
|
+
};
|
|
575
|
+
|
|
576
|
+
export type GetBigCommerceSettingsQuery = {
|
|
577
|
+
bigcommerce_settings: Array<{
|
|
578
|
+
authToken: string;
|
|
579
|
+
createCustomerEnabled: boolean;
|
|
580
|
+
createdAt: string;
|
|
581
|
+
dimensionUnits: string;
|
|
582
|
+
domain: string;
|
|
583
|
+
id: number;
|
|
584
|
+
reserveOrderEnabled: boolean;
|
|
585
|
+
storeHash: string;
|
|
586
|
+
updatedAt: string;
|
|
587
|
+
user: string;
|
|
588
|
+
weightUnits: string;
|
|
589
|
+
zonosCredentialToken: string | null;
|
|
590
|
+
zonosIsNewVersion: boolean;
|
|
591
|
+
zonosStoreId: number | null;
|
|
592
|
+
}>;
|
|
593
|
+
};
|
|
594
|
+
|
|
595
|
+
export type UpsertBigCommerceSettingsMutation = {
|
|
596
|
+
insert_bigcommerce_settings_one: {
|
|
597
|
+
authToken: string;
|
|
598
|
+
createCustomerEnabled: boolean;
|
|
599
|
+
createdAt: string;
|
|
600
|
+
dimensionUnits: string;
|
|
601
|
+
domain: string;
|
|
602
|
+
id: number;
|
|
603
|
+
reserveOrderEnabled: boolean;
|
|
604
|
+
storeHash: string;
|
|
605
|
+
updatedAt: string;
|
|
606
|
+
user: string;
|
|
607
|
+
weightUnits: string;
|
|
608
|
+
zonosCredentialToken: string | null;
|
|
609
|
+
zonosIsNewVersion: boolean;
|
|
610
|
+
zonosStoreId: number | null;
|
|
611
|
+
} | null;
|
|
612
|
+
};
|
|
613
|
+
|
|
614
|
+
export type DeleteBigCommerceSettingsMutation = {
|
|
615
|
+
delete_bigcommerce_settings: { affected_rows: number } | null;
|
|
616
|
+
};
|
|
617
|
+
|
|
618
|
+
export type GetSettingsReserveOrdersQuery = {
|
|
619
|
+
bigcommerce_settings: Array<{
|
|
620
|
+
authToken: string;
|
|
621
|
+
reserveOrders: Array<{ cartId: string; orderId: string | null }>;
|
|
622
|
+
storeHash: string;
|
|
623
|
+
}>;
|
|
624
|
+
};
|
|
625
|
+
|
|
626
|
+
export type InsertBigCommerceSettingsEventMutation = {
|
|
627
|
+
insert_bigcommerce_settingsEvent_one: { id: number } | null;
|
|
634
628
|
};
|
|
635
629
|
|
|
636
630
|
export type SdkFunctionWrapper = <T>(
|
|
@@ -650,20 +644,6 @@ export function getSdk(
|
|
|
650
644
|
withWrapper: SdkFunctionWrapper = defaultWrapper,
|
|
651
645
|
) {
|
|
652
646
|
return {
|
|
653
|
-
Cart(
|
|
654
|
-
variables?: { [x: string]: never },
|
|
655
|
-
requestHeaders?: GraphQLClientRequestHeaders,
|
|
656
|
-
): Promise<CartQuery> {
|
|
657
|
-
return withWrapper(
|
|
658
|
-
wrappedRequestHeaders =>
|
|
659
|
-
client.request<CartQuery>('', variables, {
|
|
660
|
-
...requestHeaders,
|
|
661
|
-
...wrappedRequestHeaders,
|
|
662
|
-
}),
|
|
663
|
-
'Cart',
|
|
664
|
-
'query',
|
|
665
|
-
);
|
|
666
|
-
},
|
|
667
647
|
CreateErrorEvent(
|
|
668
648
|
variables?: { [x: string]: never },
|
|
669
649
|
requestHeaders?: GraphQLClientRequestHeaders,
|
|
@@ -692,17 +672,17 @@ export function getSdk(
|
|
|
692
672
|
'mutation',
|
|
693
673
|
);
|
|
694
674
|
},
|
|
695
|
-
|
|
675
|
+
DeleteBigCommerceSettings(
|
|
696
676
|
variables?: { [x: string]: never },
|
|
697
677
|
requestHeaders?: GraphQLClientRequestHeaders,
|
|
698
|
-
): Promise<
|
|
678
|
+
): Promise<DeleteBigCommerceSettingsMutation> {
|
|
699
679
|
return withWrapper(
|
|
700
680
|
wrappedRequestHeaders =>
|
|
701
|
-
client.request<
|
|
681
|
+
client.request<DeleteBigCommerceSettingsMutation>('', variables, {
|
|
702
682
|
...requestHeaders,
|
|
703
683
|
...wrappedRequestHeaders,
|
|
704
684
|
}),
|
|
705
|
-
'
|
|
685
|
+
'DeleteBigCommerceSettings',
|
|
706
686
|
'mutation',
|
|
707
687
|
);
|
|
708
688
|
},
|
|
@@ -748,59 +728,60 @@ export function getSdk(
|
|
|
748
728
|
'query',
|
|
749
729
|
);
|
|
750
730
|
},
|
|
751
|
-
|
|
731
|
+
GetBigCommerceSettings(
|
|
752
732
|
variables?: { [x: string]: never },
|
|
753
733
|
requestHeaders?: GraphQLClientRequestHeaders,
|
|
754
|
-
): Promise<
|
|
734
|
+
): Promise<GetBigCommerceSettingsQuery> {
|
|
755
735
|
return withWrapper(
|
|
756
736
|
wrappedRequestHeaders =>
|
|
757
|
-
client.request<
|
|
737
|
+
client.request<GetBigCommerceSettingsQuery>('', variables, {
|
|
758
738
|
...requestHeaders,
|
|
759
739
|
...wrappedRequestHeaders,
|
|
760
740
|
}),
|
|
761
|
-
'
|
|
741
|
+
'GetBigCommerceSettings',
|
|
762
742
|
'query',
|
|
763
743
|
);
|
|
764
744
|
},
|
|
765
|
-
|
|
745
|
+
GetReserveOrder(
|
|
766
746
|
variables?: { [x: string]: never },
|
|
767
747
|
requestHeaders?: GraphQLClientRequestHeaders,
|
|
768
|
-
): Promise<
|
|
748
|
+
): Promise<GetReserveOrderQuery> {
|
|
769
749
|
return withWrapper(
|
|
770
750
|
wrappedRequestHeaders =>
|
|
771
|
-
client.request<
|
|
751
|
+
client.request<GetReserveOrderQuery>('', variables, {
|
|
772
752
|
...requestHeaders,
|
|
773
753
|
...wrappedRequestHeaders,
|
|
774
754
|
}),
|
|
775
|
-
'
|
|
755
|
+
'GetReserveOrder',
|
|
776
756
|
'query',
|
|
777
757
|
);
|
|
778
758
|
},
|
|
779
|
-
|
|
759
|
+
GetSettingsReserveOrders(
|
|
780
760
|
variables?: { [x: string]: never },
|
|
781
761
|
requestHeaders?: GraphQLClientRequestHeaders,
|
|
782
|
-
): Promise<
|
|
762
|
+
): Promise<GetSettingsReserveOrdersQuery> {
|
|
783
763
|
return withWrapper(
|
|
784
764
|
wrappedRequestHeaders =>
|
|
785
|
-
client.request<
|
|
765
|
+
client.request<GetSettingsReserveOrdersQuery>('', variables, {
|
|
786
766
|
...requestHeaders,
|
|
787
767
|
...wrappedRequestHeaders,
|
|
788
768
|
}),
|
|
789
|
-
'
|
|
769
|
+
'GetSettingsReserveOrders',
|
|
790
770
|
'query',
|
|
791
771
|
);
|
|
792
772
|
},
|
|
793
|
-
|
|
773
|
+
InsertBigCommerceSettingsEvent(
|
|
794
774
|
variables?: { [x: string]: never },
|
|
795
775
|
requestHeaders?: GraphQLClientRequestHeaders,
|
|
796
|
-
): Promise<
|
|
776
|
+
): Promise<InsertBigCommerceSettingsEventMutation> {
|
|
797
777
|
return withWrapper(
|
|
798
778
|
wrappedRequestHeaders =>
|
|
799
|
-
client.request<
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
779
|
+
client.request<InsertBigCommerceSettingsEventMutation>(
|
|
780
|
+
'',
|
|
781
|
+
variables,
|
|
782
|
+
{ ...requestHeaders, ...wrappedRequestHeaders },
|
|
783
|
+
),
|
|
784
|
+
'InsertBigCommerceSettingsEvent',
|
|
804
785
|
'mutation',
|
|
805
786
|
);
|
|
806
787
|
},
|
|
@@ -832,17 +813,17 @@ export function getSdk(
|
|
|
832
813
|
'mutation',
|
|
833
814
|
);
|
|
834
815
|
},
|
|
835
|
-
|
|
816
|
+
InsertReserveOrderEvent(
|
|
836
817
|
variables?: { [x: string]: never },
|
|
837
818
|
requestHeaders?: GraphQLClientRequestHeaders,
|
|
838
|
-
): Promise<
|
|
819
|
+
): Promise<InsertReserveOrderEventMutation> {
|
|
839
820
|
return withWrapper(
|
|
840
821
|
wrappedRequestHeaders =>
|
|
841
|
-
client.request<
|
|
822
|
+
client.request<InsertReserveOrderEventMutation>('', variables, {
|
|
842
823
|
...requestHeaders,
|
|
843
824
|
...wrappedRequestHeaders,
|
|
844
825
|
}),
|
|
845
|
-
'
|
|
826
|
+
'InsertReserveOrderEvent',
|
|
846
827
|
'mutation',
|
|
847
828
|
);
|
|
848
829
|
},
|
|
@@ -874,17 +855,17 @@ export function getSdk(
|
|
|
874
855
|
'mutation',
|
|
875
856
|
);
|
|
876
857
|
},
|
|
877
|
-
|
|
858
|
+
UpsertBigCommerceSettings(
|
|
878
859
|
variables?: { [x: string]: never },
|
|
879
860
|
requestHeaders?: GraphQLClientRequestHeaders,
|
|
880
|
-
): Promise<
|
|
861
|
+
): Promise<UpsertBigCommerceSettingsMutation> {
|
|
881
862
|
return withWrapper(
|
|
882
863
|
wrappedRequestHeaders =>
|
|
883
|
-
client.request<
|
|
864
|
+
client.request<UpsertBigCommerceSettingsMutation>('', variables, {
|
|
884
865
|
...requestHeaders,
|
|
885
866
|
...wrappedRequestHeaders,
|
|
886
867
|
}),
|
|
887
|
-
'
|
|
868
|
+
'UpsertBigCommerceSettings',
|
|
888
869
|
'mutation',
|
|
889
870
|
);
|
|
890
871
|
},
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(t,n,e,i){function o(t){return t instanceof e?t:new e((function(n){n(t)}))}return new(e||(e=Promise))((function(e,r){function s(t){try{a(i.next(t))}catch(t){r(t)}}function u(t){try{a(i["throw"](t))}catch(t){r(t)}}function a(t){t.done?e(t.value):o(t.value).then(s,u)}a((i=i.apply(t,n||[])).next())}))};var __generator=this&&this.__generator||function(t,n){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,o,r,s;return s={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function u(t){return function(n){return a([t,n])}}function a(u){if(i)throw new TypeError("Generator is already executing.");while(s&&(s=0,u[0]&&(e=0)),e)try{if(i=1,o&&(r=u[0]&2?o["return"]:u[0]?o["throw"]||((r=o["return"])&&r.call(o),0):o.next)&&!(r=r.call(o,u[1])).done)return r;if(o=0,r)u=[u[0]&2,r.value];switch(u[0]){case 0:case 1:r=u;break;case 4:e.label++;return{value:u[1],done:false};case 5:e.label++;o=u[1];u=[0];continue;case 7:u=e.ops.pop();e.trys.pop();continue;default:if(!(r=e.trys,r=r.length>0&&r[r.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!r||u[1]>r[0]&&u[1]<r[3])){e.label=u[1];break}if(u[0]===6&&e.label<r[1]){e.label=r[1];r=u;break}if(r&&e.label<r[2]){e.label=r[2];e.ops.push(u);break}if(r[2])e.ops.pop();e.trys.pop();continue}u=n.call(t,e)}catch(t){u=[6,t];o=0}finally{i=r=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};System.register(["./p-18904b7c.system.js","./p-d2217f09.system.js","./p-b51de536.system.js","./p-b85be1ab.system.js","./p-da060b1c.system.js","./p-24eed2a8.system.js"],(function(t){"use strict";var n,e,i,o,r,s,u,a,c,f,d,l,h,v;return{setters:[function(t){n=t.r;e=t.c;i=t.h;o=t.H},function(t){r=t.s},function(t){s=t.h;u=t.b;a=t.i;c=t.l;f=t.c;d=t.d},function(t){l=t.z;h=t.d;v=t.e},function(){},function(){}],execute:function(){var m=this;var _=function(){return __awaiter(m,void 0,void 0,(function(){var t,n,e,i;return __generator(this,(function(o){switch(o.label){case 0:t="".concat("https://v1.route.js.zonos.com","/api/zonos-elements/zonos-settings");return[4,s(t)];case 1:n=o.sent(),e=n.errors,i=n.json;if(e.length){u("Error occurs when getting zonos settings. If this is not an unauthorized error, it will use user setting or default setting");return[2,{errors:e,json:null}]}return[2,{errors:[],json:i}]}}))}))};var w=function(){var t=document.querySelector("zonos-checkout");if(!t){var n=document.createElement("zonos-checkout");document.body.appendChild(n)}};var b=function(t){if(!t.placeOrderButtonSelector){return}if(!a(t.placeOrderButtonSelector)){u('Selector checkoutButtonAnchor "'.concat(t.placeOrderButtonSelector,'" is not a valid selector'));return}w()};var y=function(t){var n=document.querySelector("zonos-hello");if(!n&&t){var e=document.createElement("zonos-hello");t.appendChild(e)}};var g=function(t){return __awaiter(m,void 0,void 0,(function(){var n,e;return __generator(this,(function(i){n=t.anchorElementSelector;if(!n||!a(n)){u('Selector anchorElementSelector "'.concat(t.anchorElementSelector,'" is not a valid selector.'));return[2]}e=document.querySelector(n);c("Hello init complete");y(e);return[2]}))}))};var p=":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 z=t("zonos_controller",function(){function t(t){n(this,t);this.stripeInitEvent=e(this,"stripeInitEvent",7);this.disablePlaceOrderButtons=function(t){var n=t.disable;var e=l.checkoutSettings.placeOrderButtonSelector;if(!e){return}var i=function(t){var n=t.target;if(n.getAttribute("disabled")){t.preventDefault();t.stopPropagation()}};var o=document.querySelectorAll(e);o.forEach((function(t){if(n){t.setAttribute("disabled","true");t.addEventListener("click",i)}else{t.removeAttribute("disabled");t.removeEventListener("click",i)}}));if(n){setTimeout((function(){o.forEach((function(t){t.removeAttribute("disabled");t.removeEventListener("click",i)}))}),5e3)}};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){c("Stripe is not loaded yet - cannot init checkout element","warn");return[2]}r.stripe=t;void b(l.checkoutSettings);c("init checkout element");this.disablePlaceOrderButtons({disable:false});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,e,i,o,r,u,a,f;return __generator(this,(function(d){switch(d.label){case 0:i=t||v();if(i==="Inter"){if(!t){return[2]}c("[FONT] Just applied Inter , but no need to inject since we already inject Inter on start","warn");l.appearance=Object.assign(Object.assign({},l.appearance),{fontFamily:t})}o="https://v1.route.js.zonos.com";return[4,s("".concat(o,"/api/zonos-elements/get-font-detail?family=").concat(i))];case 1:r=d.sent(),u=r.errors,a=r.json;if(u.length>0||!a){c("Failed to load font ".concat(i),"warn");return[2]}f=a.fontUrl;(e=(n=window.Zonos).injectSupportGoogleFont)===null||e===void 0?void 0:e.call(n,f);if(!t){return[2]}c("[FONT] ".concat(t," font override applied"));l.appearance=Object.assign(Object.assign({},l.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){l.zonosApiKey=this.zonosApiKey;(function(){return __awaiter(t,void 0,void 0,(function(){var t,n,e,i,o,r;return __generator(this,(function(s){switch(s.label){case 0:return[4,_()];case 1:e=s.sent(),i=e.errors,o=e.json;if(((t=i[0])===null||t===void 0?void 0:t.type.toString())==="403"){c("Failed to load zonos settings. This domain may not have access","warn");return[2]}this.disablePlaceOrderButtons({disable:true});this.initZonosNotification();h({overrideSettings:this.config,zonosSettings:o});void this.setupGoogleFont();if(l.helloSettings){void g(l.helloSettings)}return[4,f()];case 2:s.sent();r=((n=o===null||o===void 0?void 0:o.checkoutSettings)===null||n===void 0?void 0:n.externalServiceTokens.find((function(t){return t.type==="STRIPE_PUBLISHABLE_TOKEN"})))||null;if(!r||!this.stripeInitEvent){c("Checkout failed to load -- missing publishable key","warn");return[2]}if(l.checkoutSettings.subscriptionStatus==="INACTIVE"){c('=== Checkout subscription is "INACTIVE" - Cancel initializing for Checkout ===',"warn");c("zonos controller loaded");return[2]}if(l.checkoutSettings.visibilityStatus==="DISABLED"){c("=== Checkout is disabled by store owner ===","warn");c("zonos controller loaded");return[2]}this.stripeInitEvent.emit({publishableKey:r.token});c("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(e){n=document.querySelector("zonos-notification");if(!n){c("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){h({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,l.appearance]}))}))};t.prototype.render=function(){return i(o,{class:"zonos--elements"})};return t}());z.style=p}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["./p-18904b7c.system.js"],(function(e,o){"use strict";var t,i;return{setters:[function(o){t=o.p;i=o.b;e("setNonce",o.s)}],execute:function(){var e=function(){var e=o.meta.url;var i={};if(e!==""){i.resourcesUrl=new URL(".",e).href}return t(i)};e().then((function(e){return i([["p-f367f2fe.system",[[1,"zonos-text",{class:[1],color:[1],size:[1],type:[1],weight:[2],content:[1],ready:[32]}]]],["p-f141519c.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],closeDialogHandler:[64],init:[64],setToFinishStep:[64]},[[16,"zonos--init-cart-info","initCartInfoHandler"],[9,"resize","handleWindowResize"]],{appearanceSettingsOverride:["appearanceSettingsOverrideChanged"],mobile:["handleMobileChange"]}]]],["p-3cea383b.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]},[[9,"resize","handleResize"]]]]],["p-
|
|
1
|
+
System.register(["./p-18904b7c.system.js"],(function(e,o){"use strict";var t,i;return{setters:[function(o){t=o.p;i=o.b;e("setNonce",o.s)}],execute:function(){var e=function(){var e=o.meta.url;var i={};if(e!==""){i.resourcesUrl=new URL(".",e).href}return t(i)};e().then((function(e){return i([["p-f367f2fe.system",[[1,"zonos-text",{class:[1],color:[1],size:[1],type:[1],weight:[2],content:[1],ready:[32]}]]],["p-f141519c.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],closeDialogHandler:[64],init:[64],setToFinishStep:[64]},[[16,"zonos--init-cart-info","initCartInfoHandler"],[9,"resize","handleWindowResize"]],{appearanceSettingsOverride:["appearanceSettingsOverrideChanged"],mobile:["handleMobileChange"]}]]],["p-3cea383b.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]},[[9,"resize","handleResize"]]]]],["p-19942abb.system",[[1,"zonos-controller",{config:[16],zonosApiKey:[1,"zonos-api-key"],initCheckoutElement:[64],setupGoogleFont:[64],showNotification:[64],overrideConfig:[64],overrideCountry:[64],getAppearanceSetting:[64]}]]],["p-67154df2.system",[[1,"zonos-component",{first:[1],middle:[1],last:[1]}]]],["p-8c5595d9.system",[[1,"zonos-country-select",{closeCountrySelect:[16],inputValue:[32]}],[1,"zonos-hello-dialog-footer",{appearanceSettings:[16],setShowCountrySelect:[16]}],[1,"zonos-custom-message",{icon:[1],message:[1]}],[1,"zonos-country-flag",{class:[1],countryCode:[1,"country-code"],size:[2]}]]],["p-b4601210.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]},[[4,"click","globalClickHandler"]],{isOpen:["isOpenHandler"]}]]],["p-d856a200.system",[[1,"zonos-notification",{class:[1],notificationArray:[32],showNotification:[64]}]]],["p-2f43da39.system",[[1,"zonos-badge",{bold:[4],color:[1],icon:[16],iconRight:[4,"icon-right"],size:[1],rounded:[4],class:[1]}]]],["p-4a15c5c7.system",[[2,"zonos-payment",{titleText:[1,"title-text"],stripe:[32],stripeElements:[32]},null,{stripeElements:["watchInitStripe"],stripe:["watchInitStripe"]}]]],["p-e98be2d0.system",[[1,"zonos-shipping-rich-radio",{items:[16],borderColor:[1,"border-color"],borderStyle:[1,"border-style"],theme:[1],selectedItem:[32]}]]],["p-4bee0bff.system",[[2,"zonos-address",{type:[1],titleText:[1,"title-text"],defaultAddress:[16],stripe:[32]},null,{stripe:["watchInitStripe"]}],[2,"zonos-link-authentication",{titleText:[1,"title-text"],stripe:[32]},null,{stripe:["watchInitStripe"]}]]],["p-c9348bb0.system",[[1,"zonos-banner",{bannerTitle:[1,"banner-title"],intent:[1],class:[1],hasContent:[32]}]]],["p-560aa686.system",[[1,"zonos-card",{actions:[16],class:[1],footerActions:[16],footerContent:[16],footerHeight:[2,"footer-height"],label:[16],spacing:[1]}],[1,"zonos-v-stack",{spacing:[2],class:[1]}]]],["p-e5ae22a9.system",[[1,"zonos-icon",{autoHeight:[4,"auto-height"],color:[1],content:[1],size:[2]}]]],["p-47390db7.system",[[1,"zonos-button",{class:[1],color:[1],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],color:[1]}]]],["p-06fb9d1f.system",[[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-customer-info",{continueLoading:[4,"continue-loading"],submitBtnType:[1,"submit-btn-type"],submitBtnColor:[1,"submit-btn-color"],defaultAddress:[16],disabled:[32]},null,{disabled:["watchFormComplete"]}],[2,"zonos-shipping",{continueLoading:[4,"continue-loading"],submitBtnColor:[1,"submit-btn-color"],submitBtnType:[1,"submit-btn-type"],selectedShippingMethod:[32],disabled:[32]},null,{disabled:["watchFormComplete"]}],[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-cart-subtotal"],[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"],footerRightAction:[16],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-review",{mobile:[4],collapsed:[4],isMobile:[32]},[[9,"resize","handleWindowResize"]]],[1,"zonos-cart-items",{errorImages:[32]}],[1,"zonos-collapse",{collapsed:[4],collapseSize:[2,"collapse-size"],height:[32]}],[1,"zonos-logo",{theme:[1],width:[1],class:[1]}]]]],e)}))}}}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as o,c as t,h as n,H as e}from"./p-956efa27.js";import{s}from"./p-4846796a.js";import{h as i,b as r,i as a,l as c,c as l,d}from"./p-3c6988d7.js";import{z as h,d as u,e as f}from"./p-089ba905.js";import"./p-55f49f1e.js";import"./p-ff95f098.js";const m=class{constructor(n){o(this,n),this.stripeInitEvent=t(this,"stripeInitEvent",7),this.disablePlaceOrderButtons=({disable:o})=>{const t=h.checkoutSettings.placeOrderButtonSelector;if(!t)return;const n=o=>{o.target.getAttribute("disabled")&&(o.preventDefault(),o.stopPropagation())},e=document.querySelectorAll(t);e.forEach((t=>{o?(t.setAttribute("disabled","true"),t.addEventListener("click",n)):(t.removeAttribute("disabled"),t.removeEventListener("click",n))})),o&&setTimeout((()=>{e.forEach((o=>{o.removeAttribute("disabled"),o.removeEventListener("click",n)}))}),5e3)},this.config=void 0,this.zonosApiKey=void 0}async initCheckoutElement(o){var t;o?(s.stripe=o,(t=h.checkoutSettings).placeOrderButtonSelector&&(a(t.placeOrderButtonSelector)?(()=>{if(!document.querySelector("zonos-checkout")){const o=document.createElement("zonos-checkout");document.body.appendChild(o)}})():r(`Selector checkoutButtonAnchor "${t.placeOrderButtonSelector}" is not a valid selector`)),c("init checkout element"),this.disablePlaceOrderButtons({disable:!1})):c("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||f();if("Inter"===e){if(!o)return;c("[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:s,json:r}=await i(`https://v1.route.js.zonos.com/api/zonos-elements/get-font-detail?family=${e}`);s.length>0||!r?c(`Failed to load font ${e}`,"warn"):(null===(n=(t=window.Zonos).injectSupportGoogleFont)||void 0===n||n.call(t,r.fontUrl),o&&(c(`[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 i("https://v1.route.js.zonos.com/api/zonos-elements/zonos-settings");return o.length?(r("Error occurs when getting zonos settings. If this is not an unauthorized error, it will use user setting or default setting"),{errors:o,json:null}):{errors:[],json:t}})();if("403"===(null===(o=n[0])||void 0===o?void 0:o.type.toString()))return void c("Failed to load zonos settings. This domain may not have access","warn");this.disablePlaceOrderButtons({disable:!0}),this.initZonosNotification(),u({overrideSettings:this.config,zonosSettings:e}),this.setupGoogleFont(),h.helloSettings&&(async o=>{const{anchorElementSelector:t}=o;if(!t||!a(t))return void r(`Selector anchorElementSelector "${o.anchorElementSelector}" is not a valid selector.`);const n=document.querySelector(t);c("Hello init complete"),(o=>{if(!document.querySelector("zonos-hello")&&o){const t=document.createElement("zonos-hello");o.appendChild(t)}})(n)})(h.helloSettings),await l();const s=(null===(t=null==e?void 0:e.checkoutSettings)||void 0===t?void 0:t.externalServiceTokens.find((o=>"STRIPE_PUBLISHABLE_TOKEN"===o.type)))||null;if(s&&this.stripeInitEvent){if("INACTIVE"===h.checkoutSettings.subscriptionStatus)return c('=== Checkout subscription is "INACTIVE" - Cancel initializing for Checkout ===',"warn"),void c("zonos controller loaded");if("DISABLED"===h.checkoutSettings.visibilityStatus)return c("=== Checkout is disabled by store owner ===","warn"),void c("zonos controller loaded");this.stripeInitEvent.emit({publishableKey:s.token}),c("zonos controller loaded")}else c("Checkout failed to load -- missing publishable key","warn")})()}async showNotification(o){const t=document.querySelector("zonos-notification");t?t.showNotification(o):c("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}render(){return n(e,{class:"zonos--elements"})}};m.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{m as zonos_controller}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as o}from"./p-956efa27.js";export{s as setNonce}from"./p-956efa27.js";(()=>{const o=import.meta.url,t={};return""!==o&&(t.resourcesUrl=new URL(".",o).href),e(t)})().then((e=>o([["p-938803f4",[[1,"zonos-text",{class:[1],color:[1],size:[1],type:[1],weight:[2],content:[1],ready:[32]}]]],["p-afe26069",[[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],closeDialogHandler:[64],init:[64],setToFinishStep:[64]},[[16,"zonos--init-cart-info","initCartInfoHandler"],[9,"resize","handleWindowResize"]],{appearanceSettingsOverride:["appearanceSettingsOverrideChanged"],mobile:["handleMobileChange"]}]]],["p-e9b832c5",[[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]},[[9,"resize","handleResize"]]]]],["p-
|
|
1
|
+
import{p as e,b as o}from"./p-956efa27.js";export{s as setNonce}from"./p-956efa27.js";(()=>{const o=import.meta.url,t={};return""!==o&&(t.resourcesUrl=new URL(".",o).href),e(t)})().then((e=>o([["p-938803f4",[[1,"zonos-text",{class:[1],color:[1],size:[1],type:[1],weight:[2],content:[1],ready:[32]}]]],["p-afe26069",[[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],closeDialogHandler:[64],init:[64],setToFinishStep:[64]},[[16,"zonos--init-cart-info","initCartInfoHandler"],[9,"resize","handleWindowResize"]],{appearanceSettingsOverride:["appearanceSettingsOverrideChanged"],mobile:["handleMobileChange"]}]]],["p-e9b832c5",[[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]},[[9,"resize","handleResize"]]]]],["p-a3a8b5e7",[[1,"zonos-controller",{config:[16],zonosApiKey:[1,"zonos-api-key"],initCheckoutElement:[64],setupGoogleFont:[64],showNotification:[64],overrideConfig:[64],overrideCountry:[64],getAppearanceSetting:[64]}]]],["p-684ed483",[[1,"zonos-component",{first:[1],middle:[1],last:[1]}]]],["p-4ed71bd7",[[1,"zonos-country-select",{closeCountrySelect:[16],inputValue:[32]}],[1,"zonos-hello-dialog-footer",{appearanceSettings:[16],setShowCountrySelect:[16]}],[1,"zonos-custom-message",{icon:[1],message:[1]}],[1,"zonos-country-flag",{class:[1],countryCode:[1,"country-code"],size:[2]}]]],["p-a0e36ed3",[[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]},[[4,"click","globalClickHandler"]],{isOpen:["isOpenHandler"]}]]],["p-a376a37f",[[1,"zonos-notification",{class:[1],notificationArray:[32],showNotification:[64]}]]],["p-4d93275c",[[1,"zonos-badge",{bold:[4],color:[1],icon:[16],iconRight:[4,"icon-right"],size:[1],rounded:[4],class:[1]}]]],["p-639396bb",[[2,"zonos-payment",{titleText:[1,"title-text"],stripe:[32],stripeElements:[32]},null,{stripeElements:["watchInitStripe"],stripe:["watchInitStripe"]}]]],["p-89c210d6",[[1,"zonos-shipping-rich-radio",{items:[16],borderColor:[1,"border-color"],borderStyle:[1,"border-style"],theme:[1],selectedItem:[32]}]]],["p-b6148206",[[2,"zonos-address",{type:[1],titleText:[1,"title-text"],defaultAddress:[16],stripe:[32]},null,{stripe:["watchInitStripe"]}],[2,"zonos-link-authentication",{titleText:[1,"title-text"],stripe:[32]},null,{stripe:["watchInitStripe"]}]]],["p-e1f6ab97",[[1,"zonos-banner",{bannerTitle:[1,"banner-title"],intent:[1],class:[1],hasContent:[32]}]]],["p-1d4a970b",[[1,"zonos-card",{actions:[16],class:[1],footerActions:[16],footerContent:[16],footerHeight:[2,"footer-height"],label:[16],spacing:[1]}],[1,"zonos-v-stack",{spacing:[2],class:[1]}]]],["p-2801d868",[[1,"zonos-icon",{autoHeight:[4,"auto-height"],color:[1],content:[1],size:[2]}]]],["p-49f09b91",[[1,"zonos-button",{class:[1],color:[1],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],color:[1]}]]],["p-494c77a7",[[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-customer-info",{continueLoading:[4,"continue-loading"],submitBtnType:[1,"submit-btn-type"],submitBtnColor:[1,"submit-btn-color"],defaultAddress:[16],disabled:[32]},null,{disabled:["watchFormComplete"]}],[2,"zonos-shipping",{continueLoading:[4,"continue-loading"],submitBtnColor:[1,"submit-btn-color"],submitBtnType:[1,"submit-btn-type"],selectedShippingMethod:[32],disabled:[32]},null,{disabled:["watchFormComplete"]}],[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-cart-subtotal"],[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"],footerRightAction:[16],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-review",{mobile:[4],collapsed:[4],isMobile:[32]},[[9,"resize","handleWindowResize"]]],[1,"zonos-cart-items",{errorImages:[32]}],[1,"zonos-collapse",{collapsed:[4],collapseSize:[2,"collapse-size"],height:[32]}],[1,"zonos-logo",{theme:[1],width:[1],class:[1]}]]]],e)));
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(t,n,e,i){function o(t){return t instanceof e?t:new e((function(n){n(t)}))}return new(e||(e=Promise))((function(e,r){function s(t){try{a(i.next(t))}catch(t){r(t)}}function u(t){try{a(i["throw"](t))}catch(t){r(t)}}function a(t){t.done?e(t.value):o(t.value).then(s,u)}a((i=i.apply(t,n||[])).next())}))};var __generator=this&&this.__generator||function(t,n){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,o,r,s;return s={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function u(t){return function(n){return a([t,n])}}function a(u){if(i)throw new TypeError("Generator is already executing.");while(s&&(s=0,u[0]&&(e=0)),e)try{if(i=1,o&&(r=u[0]&2?o["return"]:u[0]?o["throw"]||((r=o["return"])&&r.call(o),0):o.next)&&!(r=r.call(o,u[1])).done)return r;if(o=0,r)u=[u[0]&2,r.value];switch(u[0]){case 0:case 1:r=u;break;case 4:e.label++;return{value:u[1],done:false};case 5:e.label++;o=u[1];u=[0];continue;case 7:u=e.ops.pop();e.trys.pop();continue;default:if(!(r=e.trys,r=r.length>0&&r[r.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!r||u[1]>r[0]&&u[1]<r[3])){e.label=u[1];break}if(u[0]===6&&e.label<r[1]){e.label=r[1];r=u;break}if(r&&e.label<r[2]){e.label=r[2];e.ops.push(u);break}if(r[2])e.ops.pop();e.trys.pop();continue}u=n.call(t,e)}catch(t){u=[6,t];o=0}finally{i=r=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};System.register(["./p-18904b7c.system.js","./p-d2217f09.system.js","./p-b51de536.system.js","./p-b85be1ab.system.js","./p-da060b1c.system.js","./p-24eed2a8.system.js"],(function(t){"use strict";var n,e,i,o,r,s,u,a,c,f,d,l,h,v;return{setters:[function(t){n=t.r;e=t.c;i=t.h;o=t.H},function(t){r=t.s},function(t){s=t.h;u=t.b;a=t.i;c=t.l;f=t.c;d=t.d},function(t){l=t.z;h=t.d;v=t.e},function(){},function(){}],execute:function(){var m=this;var _=function(){return __awaiter(m,void 0,void 0,(function(){var t,n,e,i;return __generator(this,(function(o){switch(o.label){case 0:t="".concat("https://v1.route.js.zonos.com","/api/zonos-elements/zonos-setting");return[4,s(t)];case 1:n=o.sent(),e=n.errors,i=n.json;if(e.length){u("Error occurs when getting zonos settings. If this is not an unauthorized error, it will use user setting or default setting");return[2,{errors:e,json:null}]}return[2,{errors:[],json:i}]}}))}))};var w=function(){var t=document.querySelector("zonos-checkout");if(!t){var n=document.createElement("zonos-checkout");document.body.appendChild(n)}};var b=function(t){if(!t.placeOrderButtonSelector){return}if(!a(t.placeOrderButtonSelector)){u('Selector checkoutButtonAnchor "'.concat(t.placeOrderButtonSelector,'" is not a valid selector'));return}w()};var y=function(t){var n=document.querySelector("zonos-hello");if(!n&&t){var e=document.createElement("zonos-hello");t.appendChild(e)}};var g=function(t){return __awaiter(m,void 0,void 0,(function(){var n,e;return __generator(this,(function(i){n=t.anchorElementSelector;if(!n||!a(n)){u('Selector anchorElementSelector "'.concat(t.anchorElementSelector,'" is not a valid selector.'));return[2]}e=document.querySelector(n);c("Hello init complete");y(e);return[2]}))}))};var p=":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 z=t("zonos_controller",function(){function t(t){n(this,t);this.stripeInitEvent=e(this,"stripeInitEvent",7);this.disablePlaceOrderButtons=function(t){var n=t.disable;var e=l.checkoutSettings.placeOrderButtonSelector;if(!e){return}var i=function(t){var n=t.target;if(n.getAttribute("disabled")){t.preventDefault();t.stopPropagation()}};var o=document.querySelectorAll(e);o.forEach((function(t){if(n){t.setAttribute("disabled","true");t.addEventListener("click",i)}else{t.removeAttribute("disabled");t.removeEventListener("click",i)}}));if(n){setTimeout((function(){o.forEach((function(t){t.removeAttribute("disabled");t.removeEventListener("click",i)}))}),5e3)}};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){c("Stripe is not loaded yet - cannot init checkout element","warn");return[2]}r.stripe=t;void b(l.checkoutSettings);c("init checkout element");this.disablePlaceOrderButtons({disable:false});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,e,i,o,r,u,a,f;return __generator(this,(function(d){switch(d.label){case 0:i=t||v();if(i==="Inter"){if(!t){return[2]}c("[FONT] Just applied Inter , but no need to inject since we already inject Inter on start","warn");l.appearance=Object.assign(Object.assign({},l.appearance),{fontFamily:t})}o="https://v1.route.js.zonos.com";return[4,s("".concat(o,"/api/zonos-elements/get-font-detail?family=").concat(i))];case 1:r=d.sent(),u=r.errors,a=r.json;if(u.length>0||!a){c("Failed to load font ".concat(i),"warn");return[2]}f=a.fontUrl;(e=(n=window.Zonos).injectSupportGoogleFont)===null||e===void 0?void 0:e.call(n,f);if(!t){return[2]}c("[FONT] ".concat(t," font override applied"));l.appearance=Object.assign(Object.assign({},l.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){l.zonosApiKey=this.zonosApiKey;(function(){return __awaiter(t,void 0,void 0,(function(){var t,n,e,i,o,r;return __generator(this,(function(s){switch(s.label){case 0:return[4,_()];case 1:e=s.sent(),i=e.errors,o=e.json;if(((t=i[0])===null||t===void 0?void 0:t.type.toString())==="403"){c("Failed to load zonos settings. This domain may not have access","warn");return[2]}this.disablePlaceOrderButtons({disable:true});this.initZonosNotification();h({overrideSettings:this.config,zonosSettings:o});void this.setupGoogleFont();if(l.helloSettings){void g(l.helloSettings)}return[4,f()];case 2:s.sent();r=((n=o===null||o===void 0?void 0:o.checkoutSettings)===null||n===void 0?void 0:n.externalServiceTokens.find((function(t){return t.type==="STRIPE_PUBLISHABLE_TOKEN"})))||null;if(!r||!this.stripeInitEvent){c("Checkout failed to load -- missing publishable key","warn");return[2]}if(l.checkoutSettings.subscriptionStatus==="INACTIVE"){c('=== Checkout subscription is "INACTIVE" - Cancel initializing for Checkout ===',"warn");c("zonos controller loaded");return[2]}if(l.checkoutSettings.visibilityStatus==="DISABLED"){c("=== Checkout is disabled by store owner ===","warn");c("zonos controller loaded");return[2]}this.stripeInitEvent.emit({publishableKey:r.token});c("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(e){n=document.querySelector("zonos-notification");if(!n){c("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){h({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,l.appearance]}))}))};t.prototype.render=function(){return i(o,{class:"zonos--elements"})};return t}());z.style=p}}}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as o,c as t,h as n,H as e}from"./p-956efa27.js";import{s}from"./p-4846796a.js";import{h as i,b as r,i as a,l as c,c as l,d}from"./p-3c6988d7.js";import{z as h,d as u,e as f}from"./p-089ba905.js";import"./p-55f49f1e.js";import"./p-ff95f098.js";const m=class{constructor(n){o(this,n),this.stripeInitEvent=t(this,"stripeInitEvent",7),this.disablePlaceOrderButtons=({disable:o})=>{const t=h.checkoutSettings.placeOrderButtonSelector;if(!t)return;const n=o=>{o.target.getAttribute("disabled")&&(o.preventDefault(),o.stopPropagation())},e=document.querySelectorAll(t);e.forEach((t=>{o?(t.setAttribute("disabled","true"),t.addEventListener("click",n)):(t.removeAttribute("disabled"),t.removeEventListener("click",n))})),o&&setTimeout((()=>{e.forEach((o=>{o.removeAttribute("disabled"),o.removeEventListener("click",n)}))}),5e3)},this.config=void 0,this.zonosApiKey=void 0}async initCheckoutElement(o){var t;o?(s.stripe=o,(t=h.checkoutSettings).placeOrderButtonSelector&&(a(t.placeOrderButtonSelector)?(()=>{if(!document.querySelector("zonos-checkout")){const o=document.createElement("zonos-checkout");document.body.appendChild(o)}})():r(`Selector checkoutButtonAnchor "${t.placeOrderButtonSelector}" is not a valid selector`)),c("init checkout element"),this.disablePlaceOrderButtons({disable:!1})):c("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||f();if("Inter"===e){if(!o)return;c("[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:s,json:r}=await i(`https://v1.route.js.zonos.com/api/zonos-elements/get-font-detail?family=${e}`);s.length>0||!r?c(`Failed to load font ${e}`,"warn"):(null===(n=(t=window.Zonos).injectSupportGoogleFont)||void 0===n||n.call(t,r.fontUrl),o&&(c(`[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 i("https://v1.route.js.zonos.com/api/zonos-elements/zonos-setting");return o.length?(r("Error occurs when getting zonos settings. If this is not an unauthorized error, it will use user setting or default setting"),{errors:o,json:null}):{errors:[],json:t}})();if("403"===(null===(o=n[0])||void 0===o?void 0:o.type.toString()))return void c("Failed to load zonos settings. This domain may not have access","warn");this.disablePlaceOrderButtons({disable:!0}),this.initZonosNotification(),u({overrideSettings:this.config,zonosSettings:e}),this.setupGoogleFont(),h.helloSettings&&(async o=>{const{anchorElementSelector:t}=o;if(!t||!a(t))return void r(`Selector anchorElementSelector "${o.anchorElementSelector}" is not a valid selector.`);const n=document.querySelector(t);c("Hello init complete"),(o=>{if(!document.querySelector("zonos-hello")&&o){const t=document.createElement("zonos-hello");o.appendChild(t)}})(n)})(h.helloSettings),await l();const s=(null===(t=null==e?void 0:e.checkoutSettings)||void 0===t?void 0:t.externalServiceTokens.find((o=>"STRIPE_PUBLISHABLE_TOKEN"===o.type)))||null;if(s&&this.stripeInitEvent){if("INACTIVE"===h.checkoutSettings.subscriptionStatus)return c('=== Checkout subscription is "INACTIVE" - Cancel initializing for Checkout ===',"warn"),void c("zonos controller loaded");if("DISABLED"===h.checkoutSettings.visibilityStatus)return c("=== Checkout is disabled by store owner ===","warn"),void c("zonos controller loaded");this.stripeInitEvent.emit({publishableKey:s.token}),c("zonos controller loaded")}else c("Checkout failed to load -- missing publishable key","warn")})()}async showNotification(o){const t=document.querySelector("zonos-notification");t?t.showNotification(o):c("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}render(){return n(e,{class:"zonos--elements"})}};m.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{m as zonos_controller}
|