@zonos/elements 1.3.151 → 1.3.152

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.
Files changed (32) hide show
  1. package/dist/cjs/{CheckoutConfig-d25d548d.js → CheckoutConfig-626b48e5.js} +7 -1
  2. package/dist/cjs/index.cjs.js +8 -8
  3. package/dist/cjs/zonos-checkout.cjs.entry.js +1 -1
  4. package/dist/cjs/zonos-controller.cjs.entry.js +14 -4
  5. package/dist/collection/components/main/zonos-controller.js +14 -4
  6. package/dist/collection/scripts/_getTempCartById.js +7 -1
  7. package/dist/esm/{CheckoutConfig-573bd959.js → CheckoutConfig-646aae20.js} +7 -1
  8. package/dist/esm/index.js +9 -9
  9. package/dist/esm/zonos-checkout.entry.js +1 -1
  10. package/dist/esm/zonos-controller.entry.js +14 -4
  11. package/dist/esm-es5/CheckoutConfig-646aae20.js +1 -0
  12. package/dist/esm-es5/index.js +1 -1
  13. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  14. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  15. package/dist/scripts/index.js +1 -1
  16. package/dist/scripts/loadZonos.js +1 -1
  17. package/dist/scripts/zonos.js +1 -1
  18. package/dist/types/types/checkout/api/NormalizedTempCart.d.ts +8 -0
  19. package/dist/zonos-elements/index.esm.js +1 -1
  20. package/dist/zonos-elements/{p-43b8406e.entry.js → p-04e53a0f.entry.js} +1 -1
  21. package/dist/zonos-elements/p-46f6e5e9.system.js +1 -1
  22. package/dist/zonos-elements/p-73a3e5bb.system.js +1 -0
  23. package/dist/zonos-elements/{p-353b2453.entry.js → p-764e5c78.entry.js} +1 -1
  24. package/dist/zonos-elements/{p-2f8909b0.system.js → p-92c36f24.system.js} +1 -1
  25. package/dist/zonos-elements/{p-06af7849.system.entry.js → p-949f1418.system.entry.js} +1 -1
  26. package/dist/zonos-elements/{p-5ee576e3.system.entry.js → p-b1d2f586.system.entry.js} +1 -1
  27. package/dist/zonos-elements/p-c9035262.js +1 -0
  28. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  29. package/package.json +1 -1
  30. package/dist/esm-es5/CheckoutConfig-573bd959.js +0 -1
  31. package/dist/zonos-elements/p-81a5dd5c.js +0 -1
  32. package/dist/zonos-elements/p-b3882a73.system.js +0 -1
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(n,e,t,r){function o(n){return n instanceof t?n:new t((function(e){e(n)}))}return new(t||(t=Promise))((function(t,i){function u(n){try{a(r.next(n))}catch(n){i(n)}}function s(n){try{a(r["throw"](n))}catch(n){i(n)}}function a(n){n.done?t(n.value):o(n.value).then(u,s)}a((r=r.apply(n,e||[])).next())}))};var __generator=this&&this.__generator||function(n,e){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,o,i,u;return u={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(u[Symbol.iterator]=function(){return this}),u;function s(n){return function(e){return a([n,e])}}function a(s){if(r)throw new TypeError("Generator is already executing.");while(u&&(u=0,s[0]&&(t=0)),t)try{if(r=1,o&&(i=s[0]&2?o["return"]:s[0]?o["throw"]||((i=o["return"])&&i.call(o),0):o.next)&&!(i=i.call(o,s[1])).done)return i;if(o=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:t.label++;return{value:s[1],done:false};case 5:t.label++;o=s[1];s=[0];continue;case 7:s=t.ops.pop();t.trys.pop();continue;default:if(!(i=t.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){t=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){t.label=s[1];break}if(s[0]===6&&t.label<i[1]){t.label=i[1];i=s;break}if(i&&t.label<i[2]){t.label=i[2];t.ops.push(s);break}if(i[2])t.ops.pop();t.trys.pop();continue}s=e.call(n,t)}catch(n){s=[6,n];o=0}finally{r=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-18e5b741.system.js","./p-b3882a73.system.js","./p-12a6b7bd.system.js"],(function(n){"use strict";var e,t,r,o,i,u,s;return{setters:[function(n){e=n.g;t=n.a;r=n.l;o=n.h;i=n.b},function(e){u=e.s;s=e.c;var t={};t.checkoutHiddenBtnSelector=e.c;t.domesticRedirectedBtnSelector=e.d;n(t)},function(e){var t={};t.countryRequireTaxId=e.c;t.shipToTaxIdLabels=e.s;n(t)}],execute:function(){var a=this;var c=function(n){var e=n.loadScriptSrc;if(!e){return{currentLoadScriptUrl:"",isForceLoadVersionDomain:false,isWhiteListed:false}}var t=["dev.elements.zonos.com","dev.assets-checkout.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"];var r=["qa.js.zonos.com"];var o=new URL(e).origin;var i=t.some((function(n){return o.includes(n)}));var u=r.some((function(n){return o.includes(n)}));return{currentLoadScriptUrl:o,isForceLoadVersionDomain:u,isWhiteListed:i}};var d=["jsdelivr","cdnjs","unpkg","vercel"];var l="jsdelivr";var f=function(n){var e=d.indexOf(n);var t=d[e+1];return t||null};var v=function(){return __awaiter(a,void 0,void 0,(function(){var n,u,s,a,c,d;return __generator(this,(function(l){switch(l.label){case 0:n=e();u=t();if(!n&&!u||!window.Zonos.zonosApiKey){return[2,null]}r("[ZONOS - loadZonos] Attempt test public credential","info");if(!!window.Zonos.zonosApiKey.includes("credential_test")){r("[ZONOS - loadZonos] Test mode is enabled but the API key is already a test key","info");return[2,null]}return[4,o("/api/get-test-public-credential")];case 1:s=l.sent(),a=s.errors,c=s.json;if(a.length||!c){i("[ZONOS - loadZonos] Failed to get test public credential. Keep using production key",a);return[2,null]}d=c.publicCredential;if(!d){i("[ZONOS - loadZonos] No test public key credential. Keep using production key");return[2,null]}r("[ZONOS - loadZonos] Retrieve new test public token ".concat(d),"info");return[2,d]}}))}))};var m=function(n){if(!n){return null}var e=new URL(n).searchParams;var t=e.get("zonosQaUrl");if(!t){return null}var r=/[^a-zA-Z0-9-_]+/.test(t);if(!!r){return null}return t};var w=function(){var n=window&&window.location.href.includes("forceLoadCdn");if(typeof window==="undefined"||n){return null}var e=m(window.location.href);var t="https://v1.3.151.js.zonos.com";if(!e&&(t.includes("test.")||t.includes("test-"))){return t}if(!e&&["dev.demo.elements.zonos.com"].includes(window.location.hostname)){return"https://dev.elements.zonos.com"}if(!e){return null}if(e==="dev-elements"){return"https://dev.elements.zonos.com"}var o="preview.js.zonos.com";var i="https://".concat(e,".").concat(o);r("[ZONOS-WARNING] using '".concat(i,"' for loading elements script"),"warn");void fetch(i).then((function(){window.sessionStorage.removeItem("zonos--checkout-session-id");window.sessionStorage.removeItem("zonos--client-secret")})).catch((function(){alert("[ZONOS-WARNING] '".concat(i,"' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE"));var n=new URLSearchParams(window.location.search);n.delete("zonosQaUrl");var e=window.location.pathname;var t="".concat(e,"?").concat(n.toString());window.history.replaceState(window.history.state,"",t);window.location.reload();return null}));return i};var p="https://js.stripe.com/v3";var h=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/;var y="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";var z=function(){var n=document.querySelectorAll('script[src^="'.concat(p,'"]'));for(var e=0;e<n.length;e++){var t=n[e];if(!t){continue}if(!h.test(t.src)){continue}return t}return null};var g=null;var j=function(n){var e=n&&!n.advancedFraudSignals?"?advancedFraudSignals=false":"";var t=document.createElement("script");t.src="".concat(p).concat(e);var r=document.head||document.body;if(!r){i("Expected document.body not to be null. Stripe.js requires a <body> element.");return null}r.appendChild(t);return t};var S=function(n){if(g!==null){return g}g=new Promise((function(e,t){if(typeof window==="undefined"||typeof document==="undefined"){e(null);return}if(window.Stripe&&n){console.warn(y)}if(window.Stripe){e(window.Stripe);return}try{var r=z();if(r&&n){console.warn(y)}else if(!r){r=j(n)}r===null||r===void 0?void 0:r.addEventListener("load",(function(){if(window.Stripe){e(window.Stripe)}else{t(new Error("Stripe.js not available"))}}));r===null||r===void 0?void 0:r.addEventListener("error",(function(){t(new Error("Failed to load Stripe.js"))}))}catch(n){t(n);return}}));return g};var b=function(n,e){if(!n||!n._registerWrapper){return}n._registerWrapper({name:"stripe-js",startTime:e})};var k=function(n,e,t){if(n===null){return null}var r=n.apply(undefined,e);b(r,t);return r};var O=Promise.resolve().then((function(){return S(null)}));var N=false;O.catch((function(n){if(!N){console.warn(n)}}));var Z=function(){var n=[];for(var e=0;e<arguments.length;e++){n[e]=arguments[e]}return __awaiter(a,void 0,void 0,(function(){var e;return __generator(this,(function(t){N=true;e=Date.now();return[2,O.then((function(t){return k(t,n,e)}))]}))}))};var _="tempCartUUID";var R=function(){var n=new URLSearchParams(window.location.search);var e=n.get(_);return e};var U;var I=function(){if(typeof document==="undefined"){return null}var n=document.querySelector('script[src*="/zonos.js"]');var e=c({loadScriptSrc:n===null||n===void 0?void 0:n.src}),t=e.currentLoadScriptUrl,r=e.isWhiteListed;if(r){return t}return null}();var L="https://v1.3.151.js.zonos.com";var F=I||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.151";var A="https://unpkg.com/@zonos/elements@1.3.151";var E="https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.151";var T="https://fonts.googleapis.com";var P=/^https:\/\/fonts\.googleapis\.com/;var D=function(){function n(){}return n}();n("Zonos",D);U=D;D.doneInit=false;D.debug=typeof window!=="undefined"&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/);D.zonosConversionTest=typeof window!=="undefined"&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/);D._paypalMockResponse=null;D.isBigCommerce=false;D.releaseDate="1737654725866";D.isLegacyCheckout=false;D.domain=typeof window!=="undefined"?window.location!=window.parent.location&&document.referrer||document.location.hostname:"";D.showBaseForeign=typeof window!=="undefined"&&window.location.search.includes("zonosShowBaseForeign");D.isNpm=true;D.zonosQaUrl=null;D.zonosQaUrlApi=null;D.version="v".concat("1.3.151");D.modeAlerted=false;D.cartData=null;D.paypal=null;D.getCurrentTimestamp=function(){return(new Date).getTime()};D.zonosController=null;D.init=function(n){return __awaiter(a,void 0,void 0,(function(){var e,t,o,a,c,d,l,f,m,p,h,y,z,g,j;return __generator(this,(function(S){switch(S.label){case 0:e=n.appearance,t=n.checkoutSettings,o=n.currencyConverter,a=n.helloSettings,c=n.onCountryChange,d=n.overrideCurrencyFormat,l=n.storeId,f=n.zonosApiKey;U.cartId=R();if(U.doneInit){return[2]}r("====== ZONOS DEBUG MODE: on (".concat(U.version,") ======"));U.zonosApiKey=f;U.storeId=l;if(!U.isNpm)return[3,4];r("====== ZONOS LOADING FROM NPM ======");m=w();if(m&&!window.isZonosPreview){r('====== RE-INJECT "zonos.js" FROM PRVIEW: '.concat(m," ======"),"info");p=document.createElement("script");p.src="".concat(m,"/dist/scripts/zonos.js");document.head.appendChild(p);p.addEventListener("load",(function(){window.Zonos.isNpm=U.isNpm;window.Zonos.isBigCommerce=U.isBigCommerce;window.Zonos.isLegacyCheckout=U.isLegacyCheckout;void window.Zonos.init(n)}));p.addEventListener("error",(function(){alert('[ZONOS - loadZonos] Failed to load "loadZonos.js" from zonosQaUrl: '.concat(m))}));window.isZonosPreview=true;return[2]}if(!f&&!U.cartId){i("Zonos API key is required unless `tempCartUUID` is provided in url query params.");return[2]}if(!(!U.cartData&&U.cartId))return[3,2];r("Initialize cart data");return[4,u(U.cartId)];case 1:h=S.sent();if(!h){i("Failed to get cart data");return[2]}U.cartData=h.cartData;U.zonosApiKey=h.zonosApiKey;S.label=2;case 2:return[4,v()];case 3:y=S.sent();if(y){U.zonosApiKey=y}S.label=4;case 4:z=new URL(window.location.href).searchParams.get("payment_intent_client_secret")||sessionStorage.getItem("zonos--client-secret");g=U.cartId&&U.cartData||!!z;if(g){r("Cart data or stripe client secret is available, inject hidden button and trigger checkout");j=document.createElement("button");j.style.display="none";j.id="".concat(s);document.body.appendChild(j)}r("init zonos");U.injectCustomScriptForHostedCheckout();U.injectZonosCdn();U.injectZonosCss();U.injectFonts();U.injectController({config:{appearance:e,checkoutSettings:t,currencyConverter:o,helloSettings:a,onCountryChange:c,overrideCurrencyFormat:d}});U.doneInit=true;return[2]}}))}))};D.injectCustomScriptForHostedCheckout=function(){var n=U.cartData;var e=(n===null||n===void 0?void 0:n.metadata)||[];var t=e.find((function(n){return n.key==="customHeaderScript"}));var o=e.find((function(n){return n.key==="customFooterScript"}));if(!window.Zonos.isLegacyCheckout||!t&&!o){r("Skip injecting custom script for hosted checkout","info",{footerScript:o,headerScript:t,isLegacyCheckout:window.Zonos.isLegacyCheckout});return}if(t){r("Injecting custom header script");var i=document.createElement("script");i.textContent=t.value;document.head.appendChild(i)}if(o){r("Injecting custom footer script");var i=document.createElement("script");i.textContent=o.value;document.body.appendChild(i)}};D.displayCurrency=function(){var n=document.querySelector("zonos-hello");if(n){void n.displayCurrency()}};D.openHelloDialog=function(n){var e=document.querySelector("zonos-hello");if(e){void e.openHelloDialog(n!==null&&n!==void 0?n:true)}};D.showNotification=function(n){var e;void((e=U.zonosController)===null||e===void 0?void 0:e.showNotification(n))};D.updateOrganizationName=function(n){var e;void((e=U.zonosController)===null||e===void 0?void 0:e.updateOrganizationName(n))};D.disablePlaceOrderButtons=function(n){var e=n.autoEnable,t=e===void 0?true:e,r=n.config,o=n.disable,i=n.placeOrderButtonSelector;var u;if((u=r.checkoutSettings)===null||u===void 0?void 0:u.disablePlaceOrderButtonActivation){return}if(i){var s=document.querySelectorAll(i);var a=function(n){var e=n.target;if(e.getAttribute("disabled")){n.preventDefault();n.stopPropagation()}};s.forEach((function(n){var e=n.getAttribute("data-zonos-checkout-attached");if(e){return}if(o){n.setAttribute("disabled","true");n.addEventListener("click",a)}else{n.removeAttribute("disabled");n.removeEventListener("click",a)}}));if(t&&o){setTimeout((function(){s.forEach((function(n){n.removeAttribute("disabled");n.removeEventListener("click",a)}))}),5e3)}}};D.injectController=function(n){var e=n.config;var t;if(document.querySelector("zonos-controller")){return}if((t=e.checkoutSettings)===null||t===void 0?void 0:t.placeOrderButtonSelector){var o=e.checkoutSettings.placeOrderButtonSelector;U.disablePlaceOrderButtons({config:e,disable:true,placeOrderButtonSelector:o});var u=new MutationObserver((function(){U.disablePlaceOrderButtons({config:e,disable:true,placeOrderButtonSelector:o})}));u.observe(document.body,{childList:true,subtree:true})}var s=document.createElement("zonos-controller");s.config=e;s.zonosApiKey=U.zonosApiKey||"";s.addEventListener("stripeInitEvent",(function(n){return __awaiter(a,void 0,void 0,(function(){var e,t;return __generator(this,(function(o){switch(o.label){case 0:e=n.detail;r("loading Stripe");return[4,Z(e.publishableKey)];case 1:t=o.sent();if(!t){i("API seems to be invalid or missing. Failed to load Stripe");return[2]}window.Zonos.stripe=t;void s.initCheckoutElement(t);return[2]}}))}))}));document.body.appendChild(s);U.zonosController=s;r("Zonos controller injected!")};D.injectScript=function(n){var e=n.cdnType,t=n.isModule,o=n.theRestUrl;var u=U.getZonosUrl(e);var s="".concat(u,"/").concat(o);var a=function(){var n=document.querySelector('script[src="'.concat(s,'"]'));return!!n};if(a()){r('Zonos script "'.concat(s,'" already exists in the document'),"warn");return}var c=document.head||document.body;var d=document.createElement("script");if(!!t){d.type="module"}else{d.noModule=true}d.src=s;d.crossOrigin="anonymous";d.onerror=function(){i("Failed to load ".concat(d.src));var n=f(e);if(!n){return}U.injectScript({cdnType:n,isModule:t,theRestUrl:o})};c.appendChild(d)};D.getZonosUrl=function(n){var e=function(){switch(n){case"jsdelivr":return F;case"unpkg":return A;case"cdnjs":return E;case"vercel":return L}};if(U.isNpm){var t=w();return t||e()}return e()};D.injectZonosCdn=function(){U.injectScript({cdnType:l,isModule:true,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"});U.injectScript({cdnType:l,isModule:false,theRestUrl:"dist/zonos-elements/zonos-elements.js"});r("Zonos cdn script injected!")};D.injectStylesheet=function(n){var e=n.cdnType,t=n.theRestUrl;var r=U.getZonosUrl(e);var o=document.head||document.body;var u=document.createElement("link");u.rel="preconnect";u.href="".concat(L,"/");o.appendChild(u);var s=document.createElement("link");s.rel="stylesheet";s.href="".concat(r,"/").concat(t);s.onerror=function(){i("Failed to load ".concat(s.href));var n=f(e);if(!n){return}U.injectStylesheet({cdnType:n,theRestUrl:t})};o.appendChild(s)};D.injectZonosCss=function(){var n=function(){return!!document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')};if(n()){r("Zonos style links already injected","warn");return}U.injectStylesheet({cdnType:l,theRestUrl:"dist/zonos-elements/zonos-elements.css"});r("Zonos style css injected!")};D.injectFonts=function(){var n=function(){var n=document.querySelectorAll('link[rel="stylesheet"][href^="'.concat(T,'"]'));for(var e=0;e<n.length;e++){var t=n[e];if(!t){continue}if(P.test(t.href)){continue}return t}return null};if(n()){r("Inter font already injected","warn");return}var e=document.head||document.body;var t=document.createElement("link");t.rel="preconnect";t.href=T;e.appendChild(t);var o=document.createElement("link");o.rel="stylesheet";o.href="".concat(T,"/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap");e.appendChild(o);r("Zonos font injected!")};D.setupGoogleFont=function(n){var e;void((e=U.zonosController)===null||e===void 0?void 0:e.setupGoogleFont(n))};D.injectSupportGoogleFont=function(n){var e;r("[FONT] injecting ".concat(n));var t=(e=n.match(/family=(.*?):/))===null||e===void 0?void 0:e[1];var o=document.head||document.body;if(!document.querySelector('link[rel="preconnect"][href^="'.concat(T,'"]'))){var i=document.createElement("link");i.rel="preconnect";i.href=T;o.appendChild(i)}if(document.querySelector('link[rel="stylesheet"][href="'.concat(n,'"]'))){r("[FONT] ".concat(t," font already injected"),"warn");return}var u=document.createElement("link");u.rel="stylesheet";u.href=n;o.appendChild(u);r("[FONT] ".concat(t," font injected!"))}}}}));
1
+ var __awaiter=this&&this.__awaiter||function(n,e,t,r){function o(n){return n instanceof t?n:new t((function(e){e(n)}))}return new(t||(t=Promise))((function(t,i){function u(n){try{a(r.next(n))}catch(n){i(n)}}function s(n){try{a(r["throw"](n))}catch(n){i(n)}}function a(n){n.done?t(n.value):o(n.value).then(u,s)}a((r=r.apply(n,e||[])).next())}))};var __generator=this&&this.__generator||function(n,e){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,o,i,u;return u={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(u[Symbol.iterator]=function(){return this}),u;function s(n){return function(e){return a([n,e])}}function a(s){if(r)throw new TypeError("Generator is already executing.");while(u&&(u=0,s[0]&&(t=0)),t)try{if(r=1,o&&(i=s[0]&2?o["return"]:s[0]?o["throw"]||((i=o["return"])&&i.call(o),0):o.next)&&!(i=i.call(o,s[1])).done)return i;if(o=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:t.label++;return{value:s[1],done:false};case 5:t.label++;o=s[1];s=[0];continue;case 7:s=t.ops.pop();t.trys.pop();continue;default:if(!(i=t.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){t=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){t.label=s[1];break}if(s[0]===6&&t.label<i[1]){t.label=i[1];i=s;break}if(i&&t.label<i[2]){t.label=i[2];t.ops.push(s);break}if(i[2])t.ops.pop();t.trys.pop();continue}s=e.call(n,t)}catch(n){s=[6,n];o=0}finally{r=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-18e5b741.system.js","./p-73a3e5bb.system.js","./p-12a6b7bd.system.js"],(function(n){"use strict";var e,t,r,o,i,u,s;return{setters:[function(n){e=n.g;t=n.a;r=n.l;o=n.h;i=n.b},function(e){u=e.s;s=e.c;var t={};t.checkoutHiddenBtnSelector=e.c;t.domesticRedirectedBtnSelector=e.d;n(t)},function(e){var t={};t.countryRequireTaxId=e.c;t.shipToTaxIdLabels=e.s;n(t)}],execute:function(){var a=this;var c=function(n){var e=n.loadScriptSrc;if(!e){return{currentLoadScriptUrl:"",isForceLoadVersionDomain:false,isWhiteListed:false}}var t=["dev.elements.zonos.com","dev.assets-checkout.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"];var r=["qa.js.zonos.com"];var o=new URL(e).origin;var i=t.some((function(n){return o.includes(n)}));var u=r.some((function(n){return o.includes(n)}));return{currentLoadScriptUrl:o,isForceLoadVersionDomain:u,isWhiteListed:i}};var d=["jsdelivr","cdnjs","unpkg","vercel"];var l="jsdelivr";var f=function(n){var e=d.indexOf(n);var t=d[e+1];return t||null};var v=function(){return __awaiter(a,void 0,void 0,(function(){var n,u,s,a,c,d;return __generator(this,(function(l){switch(l.label){case 0:n=e();u=t();if(!n&&!u||!window.Zonos.zonosApiKey){return[2,null]}r("[ZONOS - loadZonos] Attempt test public credential","info");if(!!window.Zonos.zonosApiKey.includes("credential_test")){r("[ZONOS - loadZonos] Test mode is enabled but the API key is already a test key","info");return[2,null]}return[4,o("/api/get-test-public-credential")];case 1:s=l.sent(),a=s.errors,c=s.json;if(a.length||!c){i("[ZONOS - loadZonos] Failed to get test public credential. Keep using production key",a);return[2,null]}d=c.publicCredential;if(!d){i("[ZONOS - loadZonos] No test public key credential. Keep using production key");return[2,null]}r("[ZONOS - loadZonos] Retrieve new test public token ".concat(d),"info");return[2,d]}}))}))};var m=function(n){if(!n){return null}var e=new URL(n).searchParams;var t=e.get("zonosQaUrl");if(!t){return null}var r=/[^a-zA-Z0-9-_]+/.test(t);if(!!r){return null}return t};var w=function(){var n=window&&window.location.href.includes("forceLoadCdn");if(typeof window==="undefined"||n){return null}var e=m(window.location.href);var t="https://v1.3.152.js.zonos.com";if(!e&&(t.includes("test.")||t.includes("test-"))){return t}if(!e&&["dev.demo.elements.zonos.com"].includes(window.location.hostname)){return"https://dev.elements.zonos.com"}if(!e){return null}if(e==="dev-elements"){return"https://dev.elements.zonos.com"}var o="preview.js.zonos.com";var i="https://".concat(e,".").concat(o);r("[ZONOS-WARNING] using '".concat(i,"' for loading elements script"),"warn");void fetch(i).then((function(){window.sessionStorage.removeItem("zonos--checkout-session-id");window.sessionStorage.removeItem("zonos--client-secret")})).catch((function(){alert("[ZONOS-WARNING] '".concat(i,"' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE"));var n=new URLSearchParams(window.location.search);n.delete("zonosQaUrl");var e=window.location.pathname;var t="".concat(e,"?").concat(n.toString());window.history.replaceState(window.history.state,"",t);window.location.reload();return null}));return i};var p="https://js.stripe.com/v3";var h=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/;var y="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";var z=function(){var n=document.querySelectorAll('script[src^="'.concat(p,'"]'));for(var e=0;e<n.length;e++){var t=n[e];if(!t){continue}if(!h.test(t.src)){continue}return t}return null};var g=null;var j=function(n){var e=n&&!n.advancedFraudSignals?"?advancedFraudSignals=false":"";var t=document.createElement("script");t.src="".concat(p).concat(e);var r=document.head||document.body;if(!r){i("Expected document.body not to be null. Stripe.js requires a <body> element.");return null}r.appendChild(t);return t};var b=function(n){if(g!==null){return g}g=new Promise((function(e,t){if(typeof window==="undefined"||typeof document==="undefined"){e(null);return}if(window.Stripe&&n){console.warn(y)}if(window.Stripe){e(window.Stripe);return}try{var r=z();if(r&&n){console.warn(y)}else if(!r){r=j(n)}r===null||r===void 0?void 0:r.addEventListener("load",(function(){if(window.Stripe){e(window.Stripe)}else{t(new Error("Stripe.js not available"))}}));r===null||r===void 0?void 0:r.addEventListener("error",(function(){t(new Error("Failed to load Stripe.js"))}))}catch(n){t(n);return}}));return g};var S=function(n,e){if(!n||!n._registerWrapper){return}n._registerWrapper({name:"stripe-js",startTime:e})};var k=function(n,e,t){if(n===null){return null}var r=n.apply(undefined,e);S(r,t);return r};var O=Promise.resolve().then((function(){return b(null)}));var N=false;O.catch((function(n){if(!N){console.warn(n)}}));var Z=function(){var n=[];for(var e=0;e<arguments.length;e++){n[e]=arguments[e]}return __awaiter(a,void 0,void 0,(function(){var e;return __generator(this,(function(t){N=true;e=Date.now();return[2,O.then((function(t){return k(t,n,e)}))]}))}))};var _="tempCartUUID";var R=function(){var n=new URLSearchParams(window.location.search);var e=n.get(_);return e};var U;var I=function(){if(typeof document==="undefined"){return null}var n=document.querySelector('script[src*="/zonos.js"]');var e=c({loadScriptSrc:n===null||n===void 0?void 0:n.src}),t=e.currentLoadScriptUrl,r=e.isWhiteListed;if(r){return t}return null}();var L="https://v1.3.152.js.zonos.com";var F=I||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.152";var A="https://unpkg.com/@zonos/elements@1.3.152";var E="https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.152";var T="https://fonts.googleapis.com";var P=/^https:\/\/fonts\.googleapis\.com/;var D=function(){function n(){}return n}();n("Zonos",D);U=D;D.doneInit=false;D.debug=typeof window!=="undefined"&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/);D.zonosConversionTest=typeof window!=="undefined"&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/);D._paypalMockResponse=null;D.isBigCommerce=false;D.releaseDate="1737742301571";D.isLegacyCheckout=false;D.domain=typeof window!=="undefined"?window.location!=window.parent.location&&document.referrer||document.location.hostname:"";D.showBaseForeign=typeof window!=="undefined"&&window.location.search.includes("zonosShowBaseForeign");D.isNpm=true;D.zonosQaUrl=null;D.zonosQaUrlApi=null;D.version="v".concat("1.3.152");D.modeAlerted=false;D.cartData=null;D.paypal=null;D.getCurrentTimestamp=function(){return(new Date).getTime()};D.zonosController=null;D.init=function(n){return __awaiter(a,void 0,void 0,(function(){var e,t,o,a,c,d,l,f,m,p,h,y,z,g,j;return __generator(this,(function(b){switch(b.label){case 0:e=n.appearance,t=n.checkoutSettings,o=n.currencyConverter,a=n.helloSettings,c=n.onCountryChange,d=n.overrideCurrencyFormat,l=n.storeId,f=n.zonosApiKey;U.cartId=R();if(U.doneInit){return[2]}r("====== ZONOS DEBUG MODE: on (".concat(U.version,") ======"));U.zonosApiKey=f;U.storeId=l;if(!U.isNpm)return[3,4];r("====== ZONOS LOADING FROM NPM ======");m=w();if(m&&!window.isZonosPreview){r('====== RE-INJECT "zonos.js" FROM PRVIEW: '.concat(m," ======"),"info");p=document.createElement("script");p.src="".concat(m,"/dist/scripts/zonos.js");document.head.appendChild(p);p.addEventListener("load",(function(){window.Zonos.isNpm=U.isNpm;window.Zonos.isBigCommerce=U.isBigCommerce;window.Zonos.isLegacyCheckout=U.isLegacyCheckout;void window.Zonos.init(n)}));p.addEventListener("error",(function(){alert('[ZONOS - loadZonos] Failed to load "loadZonos.js" from zonosQaUrl: '.concat(m))}));window.isZonosPreview=true;return[2]}if(!f&&!U.cartId){i("Zonos API key is required unless `tempCartUUID` is provided in url query params.");return[2]}if(!(!U.cartData&&U.cartId))return[3,2];r("Initialize cart data");return[4,u(U.cartId)];case 1:h=b.sent();if(!h){i("Failed to get cart data");return[2]}U.cartData=h.cartData;U.zonosApiKey=h.zonosApiKey;b.label=2;case 2:return[4,v()];case 3:y=b.sent();if(y){U.zonosApiKey=y}b.label=4;case 4:z=new URL(window.location.href).searchParams.get("payment_intent_client_secret")||sessionStorage.getItem("zonos--client-secret");g=U.cartId&&U.cartData||!!z;if(g){r("Cart data or stripe client secret is available, inject hidden button and trigger checkout");j=document.createElement("button");j.style.display="none";j.id="".concat(s);document.body.appendChild(j)}r("init zonos");U.injectCustomScriptForHostedCheckout();U.injectZonosCdn();U.injectZonosCss();U.injectFonts();U.injectController({config:{appearance:e,checkoutSettings:t,currencyConverter:o,helloSettings:a,onCountryChange:c,overrideCurrencyFormat:d}});U.doneInit=true;return[2]}}))}))};D.injectCustomScriptForHostedCheckout=function(){var n=U.cartData;var e=(n===null||n===void 0?void 0:n.metadata)||[];var t=e.find((function(n){return n.key==="customHeaderScript"}));var o=e.find((function(n){return n.key==="customFooterScript"}));if(!window.Zonos.isLegacyCheckout||!t&&!o){r("Skip injecting custom script for hosted checkout","info",{footerScript:o,headerScript:t,isLegacyCheckout:window.Zonos.isLegacyCheckout});return}if(t){r("Injecting custom header script");var i=document.createElement("script");i.textContent=t.value;document.head.appendChild(i)}if(o){r("Injecting custom footer script");var i=document.createElement("script");i.textContent=o.value;document.body.appendChild(i)}};D.displayCurrency=function(){var n=document.querySelector("zonos-hello");if(n){void n.displayCurrency()}};D.openHelloDialog=function(n){var e=document.querySelector("zonos-hello");if(e){void e.openHelloDialog(n!==null&&n!==void 0?n:true)}};D.showNotification=function(n){var e;void((e=U.zonosController)===null||e===void 0?void 0:e.showNotification(n))};D.updateOrganizationName=function(n){var e;void((e=U.zonosController)===null||e===void 0?void 0:e.updateOrganizationName(n))};D.disablePlaceOrderButtons=function(n){var e=n.autoEnable,t=e===void 0?true:e,r=n.config,o=n.disable,i=n.placeOrderButtonSelector;var u;if((u=r.checkoutSettings)===null||u===void 0?void 0:u.disablePlaceOrderButtonActivation){return}if(i){var s=document.querySelectorAll(i);var a=function(n){var e=n.target;if(e.getAttribute("disabled")){n.preventDefault();n.stopPropagation()}};s.forEach((function(n){var e=n.getAttribute("data-zonos-checkout-attached");if(e){return}if(o){n.setAttribute("disabled","true");n.addEventListener("click",a)}else{n.removeAttribute("disabled");n.removeEventListener("click",a)}}));if(t&&o){setTimeout((function(){s.forEach((function(n){n.removeAttribute("disabled");n.removeEventListener("click",a)}))}),5e3)}}};D.injectController=function(n){var e=n.config;var t;if(document.querySelector("zonos-controller")){return}if((t=e.checkoutSettings)===null||t===void 0?void 0:t.placeOrderButtonSelector){var o=e.checkoutSettings.placeOrderButtonSelector;U.disablePlaceOrderButtons({config:e,disable:true,placeOrderButtonSelector:o});var u=new MutationObserver((function(){U.disablePlaceOrderButtons({config:e,disable:true,placeOrderButtonSelector:o})}));u.observe(document.body,{childList:true,subtree:true})}var s=document.createElement("zonos-controller");s.config=e;s.zonosApiKey=U.zonosApiKey||"";s.addEventListener("stripeInitEvent",(function(n){return __awaiter(a,void 0,void 0,(function(){var e,t;return __generator(this,(function(o){switch(o.label){case 0:e=n.detail;r("loading Stripe");return[4,Z(e.publishableKey)];case 1:t=o.sent();if(!t){i("API seems to be invalid or missing. Failed to load Stripe");return[2]}window.Zonos.stripe=t;void s.initCheckoutElement(t);return[2]}}))}))}));document.body.appendChild(s);U.zonosController=s;r("Zonos controller injected!")};D.injectScript=function(n){var e=n.cdnType,t=n.isModule,o=n.theRestUrl;var u=U.getZonosUrl(e);var s="".concat(u,"/").concat(o);var a=function(){var n=document.querySelector('script[src="'.concat(s,'"]'));return!!n};if(a()){r('Zonos script "'.concat(s,'" already exists in the document'),"warn");return}var c=document.head||document.body;var d=document.createElement("script");if(!!t){d.type="module"}else{d.noModule=true}d.src=s;d.crossOrigin="anonymous";d.onerror=function(){i("Failed to load ".concat(d.src));var n=f(e);if(!n){return}U.injectScript({cdnType:n,isModule:t,theRestUrl:o})};c.appendChild(d)};D.getZonosUrl=function(n){var e=function(){switch(n){case"jsdelivr":return F;case"unpkg":return A;case"cdnjs":return E;case"vercel":return L}};if(U.isNpm){var t=w();return t||e()}return e()};D.injectZonosCdn=function(){U.injectScript({cdnType:l,isModule:true,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"});U.injectScript({cdnType:l,isModule:false,theRestUrl:"dist/zonos-elements/zonos-elements.js"});r("Zonos cdn script injected!")};D.injectStylesheet=function(n){var e=n.cdnType,t=n.theRestUrl;var r=U.getZonosUrl(e);var o=document.head||document.body;var u=document.createElement("link");u.rel="preconnect";u.href="".concat(L,"/");o.appendChild(u);var s=document.createElement("link");s.rel="stylesheet";s.href="".concat(r,"/").concat(t);s.onerror=function(){i("Failed to load ".concat(s.href));var n=f(e);if(!n){return}U.injectStylesheet({cdnType:n,theRestUrl:t})};o.appendChild(s)};D.injectZonosCss=function(){var n=function(){return!!document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')};if(n()){r("Zonos style links already injected","warn");return}U.injectStylesheet({cdnType:l,theRestUrl:"dist/zonos-elements/zonos-elements.css"});r("Zonos style css injected!")};D.injectFonts=function(){var n=function(){var n=document.querySelectorAll('link[rel="stylesheet"][href^="'.concat(T,'"]'));for(var e=0;e<n.length;e++){var t=n[e];if(!t){continue}if(P.test(t.href)){continue}return t}return null};if(n()){r("Inter font already injected","warn");return}var e=document.head||document.body;var t=document.createElement("link");t.rel="preconnect";t.href=T;e.appendChild(t);var o=document.createElement("link");o.rel="stylesheet";o.href="".concat(T,"/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap");e.appendChild(o);r("Zonos font injected!")};D.setupGoogleFont=function(n){var e;void((e=U.zonosController)===null||e===void 0?void 0:e.setupGoogleFont(n))};D.injectSupportGoogleFont=function(n){var e;r("[FONT] injecting ".concat(n));var t=(e=n.match(/family=(.*?):/))===null||e===void 0?void 0:e[1];var o=document.head||document.body;if(!document.querySelector('link[rel="preconnect"][href^="'.concat(T,'"]'))){var i=document.createElement("link");i.rel="preconnect";i.href=T;o.appendChild(i)}if(document.querySelector('link[rel="stylesheet"][href="'.concat(n,'"]'))){r("[FONT] ".concat(t," font already injected"),"warn");return}var u=document.createElement("link");u.rel="stylesheet";u.href=n;o.appendChild(u);r("[FONT] ".concat(t," font injected!"))}}}}));
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(t,n,o,i){function e(t){return t instanceof o?t:new o((function(n){n(t)}))}return new(o||(o=Promise))((function(o,r){function u(t){try{c(i.next(t))}catch(t){r(t)}}function s(t){try{c(i["throw"](t))}catch(t){r(t)}}function c(t){t.done?o(t.value):e(t.value).then(u,s)}c((i=i.apply(t,n||[])).next())}))};var __generator=this&&this.__generator||function(t,n){var o={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,e,r,u;return u={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(u[Symbol.iterator]=function(){return this}),u;function s(t){return function(n){return c([t,n])}}function c(s){if(i)throw new TypeError("Generator is already executing.");while(u&&(u=0,s[0]&&(o=0)),o)try{if(i=1,e&&(r=s[0]&2?e["return"]:s[0]?e["throw"]||((r=e["return"])&&r.call(e),0):e.next)&&!(r=r.call(e,s[1])).done)return r;if(e=0,r)s=[s[0]&2,r.value];switch(s[0]){case 0:case 1:r=s;break;case 4:o.label++;return{value:s[1],done:false};case 5:o.label++;e=s[1];s=[0];continue;case 7:s=o.ops.pop();o.trys.pop();continue;default:if(!(r=o.trys,r=r.length>0&&r[r.length-1])&&(s[0]===6||s[0]===2)){o=0;continue}if(s[0]===3&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(s[0]===6&&o.label<r[1]){o.label=r[1];r=s;break}if(r&&o.label<r[2]){o.label=r[2];o.ops.push(s);break}if(r[2])o.ops.pop();o.trys.pop();continue}s=n.call(t,o)}catch(t){s=[6,t];e=0}finally{i=r=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-4caffd96.system.js","./p-eb192fa3.system.js","./p-32912caf.system.js","./p-18e5b741.system.js","./p-12546668.system.js","./p-c015be06.system.js"],(function(t){"use strict";var n,o,i,e,r,u,s,c,a,f,d,l,h,v,w;return{setters:[function(t){n=t.r;o=t.c;i=t.h;e=t.H},function(t){r=t.E;u=t.f;s=t.F;c=t.e;a=t.a},function(t){f=t.z;d=t.b;l=t.d},function(t){h=t.h;v=t.b;w=t.l},function(){},function(){}],execute:function(){var m=this;var _=function(){return __awaiter(m,void 0,void 0,(function(){var t,n,o,i;return __generator(this,(function(e){switch(e.label){case 0:return[4,h("/api/zonos-elements/zonos-settings")];case 1:t=e.sent(),n=t.errors,o=t.json,i=t.zonosMode;if(n.length){v("Error occurred when getting zonos settings. If this is not an unauthorized error, it will use user settings or default settings");return[2,{errors:n,json:null,zonosMode:i}]}return[2,{errors:[],json:o,zonosMode:i}]}}))}))};var p=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&&!window.Zonos.cartData){return}if(t.placeOrderButtonSelector&&!r(t.placeOrderButtonSelector)){v('Selector checkoutButtonAnchor "'.concat(t.placeOrderButtonSelector,'" is not a valid selector'));return}p()};var g=function(t){var n=document.querySelector(t);var o=document.querySelector("zonos-hello");if(!o&&n){var i=document.createElement("zonos-hello");n.appendChild(i);return true}return false};var y=function(t){switch(t){case"BOTTOM_RIGHT":return"bottom-right";case"BOTTOM_LEFT":return"bottom-left";case"TOP_LEFT":return"top-left";case"TOP_RIGHT":return"top-right";default:return"bottom-right"}};var z=function(t){var n=t.position,o=n===void 0?"bottom-right":n;var i=".zonos--hello-mobile-wrapper";var e=document.querySelector(i);if(e){return i}var r=document.createElement("div");r.className="zonos--hello-mobile-wrapper";r.style.position="fixed";if(o==="top-right"){r.style.top="72px";r.style.right="24px"}if(o==="top-left"){r.style.top="72px";r.style.left="24px"}if(o==="bottom-right"){r.style.bottom="72px";r.style.right="24px"}if(o==="bottom-left"){r.style.bottom="72px";r.style.left="24px"}r.style.zIndex="2147483007";document.body.appendChild(r);return i};var j=function(t){return __awaiter(m,void 0,void 0,(function(){var n,o,i,e,u;return __generator(this,(function(s){if(window.Zonos.isLegacyCheckout){w("Hello is disabled when isLegacyCheckout","info");return[2]}n=t.anchorElementSelector;o=n;if(!t.anchorElementSelector&&t.desktopLocation){i=z({position:"bottom-right"});o=i}if(!o||!r(o)){v('Selector anchorElementSelector "'.concat(t.anchorElementSelector,'" is not a valid selector.'));return[2]}w("Hello init complete");e=g(o);if(!e){u=new MutationObserver((function(){var t=g(o);if(t){u.disconnect()}}));u.observe(document.body,{childList:true,subtree:true});setTimeout((function(){g(o)}),1e3);setTimeout((function(){if(t.notFoundElementFallback){w("Hello anchor selector ".concat(t.anchorElementSelector," not found after 3 seconds, falling back to 'notFoundElementFallback': ").concat(t.notFoundElementFallback),"info");var n=z({position:y(t.notFoundElementFallback)});g(n)}}),3e3)}return[2]}))}))};var k=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--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 I=k;var O=t("zonos_controller",function(){function t(t){n(this,t);this.paypalInitEvent=o(this,"paypalInitEvent",7);this.stripeInitEvent=o(this,"stripeInitEvent",7);this.config=undefined;this.zonosApiKey=undefined}t.prototype.initCheckoutElement=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){if(!t){w("Stripe is not loaded yet - cannot init checkout element","warn");return[2]}u.stripe=t;void b(f.checkoutSettings);w("init checkout element");return[2]}))}))};t.prototype.initZonosNotification=function(){var t=document.querySelector("zonos-notification");if(t){return}var n=document.createElement("zonos-notification");document.body.appendChild(n)};t.prototype.setupGoogleFont=function(t){return __awaiter(this,void 0,void 0,(function(){var n,o,i,e,r,u,s,c;return __generator(this,(function(a){switch(a.label){case 0:i=t||l();if(i==="Inter"){if(!t){return[2]}w("[FONT] Just applied Inter , but no need to inject since we already inject Inter on start","warn");f.appearance=Object.assign(Object.assign({},f.appearance),{fontFamily:t})}e=new URLSearchParams;e.set("family",i);return[4,h("/api/zonos-elements/get-font-detail?".concat(e.toString()))];case 1:r=a.sent(),u=r.errors,s=r.json;if(u.length>0){w("Failed to load font ".concat(i),"warn");f.appearance=Object.assign(Object.assign({},f.appearance),{fontFamily:"Inter"});return[2]}c=s===null||s===void 0?void 0:s.fontUrl;if(c){(o=(n=window.Zonos).injectSupportGoogleFont)===null||o===void 0?void 0:o.call(n,c)}if(!t){return[2]}w("[FONT] ".concat(t," font override applied"));f.appearance=Object.assign(Object.assign({},f.appearance),{fontFamily:t});return[2]}}))}))};t.prototype.handleLocationChange=function(){void j(f.helloSettings)};t.prototype.initHistoryListener=function(){var t=history.pushState;history.pushState=function n(){window.dispatchEvent(new window.Event("pushstate"));window.dispatchEvent(new window.Event("locationchange"));return t.apply(this,arguments)};var n=history.replaceState;history.replaceState=function t(){window.dispatchEvent(new window.Event("replacestate"));window.dispatchEvent(new window.Event("locationchange"));return n.apply(this,arguments)}};t.prototype.injectCustomHTML=function(t){if(!t){return}if(!window.Zonos.isLegacyCheckout){w("=== Skip injecting custom HTML for hosted checkout","info");return}w("=== Injecting custom HTML for hosted checkout");var n=document.createElement("template");n.innerHTML=t;var o=n.content.querySelectorAll("script");o.forEach((function(t){var n=document.createElement("script");if(t.src){n.src=t.src;n.async=t.async}else{n.textContent=t.innerHTML}document.body.appendChild(n)}))};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(n){this.initHistoryListener();f.zonosApiKey=this.zonosApiKey;(function(){return __awaiter(t,void 0,void 0,(function(){var t,n,o,i,e,r,u,c,a,l,h;var v=this;return __generator(this,(function(m){switch(m.label){case 0:return[4,_()];case 1:i=m.sent(),e=i.errors,r=i.json,u=i.zonosMode;if(((t=e[0])===null||t===void 0?void 0:t.type.toString())==="403"){w("Failed to load zonos settings. This domain may not have access","warn");return[2]}c=((n=r===null||r===void 0?void 0:r.checkoutSettings)===null||n===void 0?void 0:n.customHTML)||"";this.injectCustomHTML(c);this.initZonosNotification();a=function(){var t,n,o;if(window.Zonos.isLegacyCheckout){return((t=r===null||r===void 0?void 0:r.appearanceSettings)===null||t===void 0?void 0:t.logoUrl)||((n=v.config.appearance)===null||n===void 0?void 0:n.logoUrl)}return(o=v.config.appearance)===null||o===void 0?void 0:o.logoUrl};l=Object.assign(Object.assign({},this.config),{appearance:Object.assign(Object.assign({},this.config.appearance),{logoUrl:a()}),checkoutSettings:this.config.checkoutSettings?Object.assign(Object.assign({},this.config.checkoutSettings),{subscriptionStatus:undefined}):undefined});d({overrideSettings:l,zonosSettings:r});f.zonosMode=u;void this.setupGoogleFont();if(f.helloSettings.visibilityStatus==="DISABLED"){w("=== Hello is disabled by store owner ===","warn")}if(f.helloSettings&&f.helloSettings.visibilityStatus==="ENABLED"){w("Initializing hello");void j(f.helloSettings)}return[4,s()];case 2:m.sent();h=((o=r===null||r===void 0?void 0:r.checkoutSettings)===null||o===void 0?void 0:o.externalServiceTokens.find((function(t){return t.type==="STRIPE_PUBLISHABLE_TOKEN"})))||null;if(!h||!this.stripeInitEvent){w("Checkout failed to load -- missing publishable key","warn");return[2]}if(f.checkoutSettings.subscriptionStatus==="INACTIVE"){w('=== Checkout subscription is "INACTIVE" - Cancel initializing for Checkout ===',"warn");w("zonos controller loaded");return[2]}if(f.checkoutSettings.visibilityStatus==="DISABLED"){w("=== Checkout is disabled by store owner ===","warn");w("zonos controller loaded");return[2]}this.stripeInitEvent.emit({publishableKey:h.token});return[2]}}))}))})();return[2]}))}))};t.prototype.showNotification=function(t){return __awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(o){n=document.querySelector("zonos-notification");if(!n){w("Failed to show notification - zonos-notification not found","warn");return[2]}void n.showNotification(t);return[2]}))}))};t.prototype.reset=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){c.checkoutSessionId=null;u.clientSecret="";return[2]}))}))};t.prototype.overrideConfig=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){d({overrideSettings:t,zonosSettings:null});return[2]}))}))};t.prototype.overrideCountry=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){w("Override country code to ".concat(t));void a(t);return[2]}))}))};t.prototype.getAppearanceSetting=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,f.appearance]}))}))};t.prototype.updateOrganizationName=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){f.organizationName=t;return[2]}))}))};t.prototype.render=function(){return i(e,{key:"001f728dc41550b734fd1b5c9cf15f43c0c4cbdb",class:"zonos--elements"})};return t}());O.style=I}}}));
1
+ var __awaiter=this&&this.__awaiter||function(t,n,o,i){function e(t){return t instanceof o?t:new o((function(n){n(t)}))}return new(o||(o=Promise))((function(o,r){function u(t){try{c(i.next(t))}catch(t){r(t)}}function s(t){try{c(i["throw"](t))}catch(t){r(t)}}function c(t){t.done?o(t.value):e(t.value).then(u,s)}c((i=i.apply(t,n||[])).next())}))};var __generator=this&&this.__generator||function(t,n){var o={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,e,r,u;return u={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(u[Symbol.iterator]=function(){return this}),u;function s(t){return function(n){return c([t,n])}}function c(s){if(i)throw new TypeError("Generator is already executing.");while(u&&(u=0,s[0]&&(o=0)),o)try{if(i=1,e&&(r=s[0]&2?e["return"]:s[0]?e["throw"]||((r=e["return"])&&r.call(e),0):e.next)&&!(r=r.call(e,s[1])).done)return r;if(e=0,r)s=[s[0]&2,r.value];switch(s[0]){case 0:case 1:r=s;break;case 4:o.label++;return{value:s[1],done:false};case 5:o.label++;e=s[1];s=[0];continue;case 7:s=o.ops.pop();o.trys.pop();continue;default:if(!(r=o.trys,r=r.length>0&&r[r.length-1])&&(s[0]===6||s[0]===2)){o=0;continue}if(s[0]===3&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(s[0]===6&&o.label<r[1]){o.label=r[1];r=s;break}if(r&&o.label<r[2]){o.label=r[2];o.ops.push(s);break}if(r[2])o.ops.pop();o.trys.pop();continue}s=n.call(t,o)}catch(t){s=[6,t];e=0}finally{i=r=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-4caffd96.system.js","./p-eb192fa3.system.js","./p-32912caf.system.js","./p-18e5b741.system.js","./p-12546668.system.js","./p-c015be06.system.js"],(function(t){"use strict";var n,o,i,e,r,u,s,c,a,f,d,l,h,v,w;return{setters:[function(t){n=t.r;o=t.c;i=t.h;e=t.H},function(t){r=t.E;u=t.f;s=t.F;c=t.e;a=t.a},function(t){f=t.z;d=t.b;l=t.d},function(t){h=t.h;v=t.b;w=t.l},function(){},function(){}],execute:function(){var m=this;var _=function(){return __awaiter(m,void 0,void 0,(function(){var t,n,o,i;return __generator(this,(function(e){switch(e.label){case 0:return[4,h("/api/zonos-elements/zonos-settings")];case 1:t=e.sent(),n=t.errors,o=t.json,i=t.zonosMode;if(n.length){v("Error occurred when getting zonos settings. If this is not an unauthorized error, it will use user settings or default settings");return[2,{errors:n,json:null,zonosMode:i}]}return[2,{errors:[],json:o,zonosMode:i}]}}))}))};var p=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&&!window.Zonos.cartData){return}if(t.placeOrderButtonSelector&&!r(t.placeOrderButtonSelector)){v('Selector checkoutButtonAnchor "'.concat(t.placeOrderButtonSelector,'" is not a valid selector'));return}p()};var g=function(t){var n=document.querySelector(t);var o=document.querySelector("zonos-hello");if(!o&&n){var i=document.createElement("zonos-hello");n.appendChild(i);return true}return false};var y=function(t){switch(t){case"BOTTOM_RIGHT":return"bottom-right";case"BOTTOM_LEFT":return"bottom-left";case"TOP_LEFT":return"top-left";case"TOP_RIGHT":return"top-right";default:return"bottom-right"}};var z=function(t){var n=t.position,o=n===void 0?"bottom-right":n;var i=".zonos--hello-mobile-wrapper";var e=document.querySelector(i);if(e){return i}var r=document.createElement("div");r.className="zonos--hello-mobile-wrapper";r.style.position="fixed";if(o==="top-right"){r.style.top="72px";r.style.right="24px"}if(o==="top-left"){r.style.top="72px";r.style.left="24px"}if(o==="bottom-right"){r.style.bottom="72px";r.style.right="24px"}if(o==="bottom-left"){r.style.bottom="72px";r.style.left="24px"}r.style.zIndex="2147483007";document.body.appendChild(r);return i};var O=function(t){return __awaiter(m,void 0,void 0,(function(){var n,o,i,e,u;return __generator(this,(function(s){if(window.Zonos.isLegacyCheckout){w("Hello is disabled when isLegacyCheckout","info");return[2]}n=t.anchorElementSelector;o=n;if(!t.anchorElementSelector&&t.desktopLocation){i=z({position:"bottom-right"});o=i}if(!o||!r(o)){v('Selector anchorElementSelector "'.concat(t.anchorElementSelector,'" is not a valid selector.'));return[2]}w("Hello init complete");e=g(o);if(!e){u=new MutationObserver((function(){var t=g(o);if(t){u.disconnect()}}));u.observe(document.body,{childList:true,subtree:true});setTimeout((function(){g(o)}),1e3);setTimeout((function(){if(t.notFoundElementFallback){w("Hello anchor selector ".concat(t.anchorElementSelector," not found after 3 seconds, falling back to 'notFoundElementFallback': ").concat(t.notFoundElementFallback),"info");var n=z({position:y(t.notFoundElementFallback)});g(n)}}),3e3)}return[2]}))}))};var j=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{visibility:hidden;opacity:0;height:0}";var k=j;var S=t("zonos_controller",function(){function t(t){n(this,t);this.paypalInitEvent=o(this,"paypalInitEvent",7);this.stripeInitEvent=o(this,"stripeInitEvent",7);this.config=undefined;this.zonosApiKey=undefined}t.prototype.initCheckoutElement=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){if(!t){w("Stripe is not loaded yet - cannot init checkout element","warn");return[2]}u.stripe=t;void b(f.checkoutSettings);w("init checkout element");return[2]}))}))};t.prototype.initZonosNotification=function(){var t=document.querySelector("zonos-notification");if(t){return}var n=document.createElement("zonos-notification");document.body.appendChild(n)};t.prototype.setupGoogleFont=function(t){return __awaiter(this,void 0,void 0,(function(){var n,o,i,e,r,u,s,c;return __generator(this,(function(a){switch(a.label){case 0:i=t||l();if(i==="Inter"){if(!t){return[2]}w("[FONT] Just applied Inter , but no need to inject since we already inject Inter on start","warn");f.appearance=Object.assign(Object.assign({},f.appearance),{fontFamily:t})}e=new URLSearchParams;e.set("family",i);return[4,h("/api/zonos-elements/get-font-detail?".concat(e.toString()))];case 1:r=a.sent(),u=r.errors,s=r.json;if(u.length>0){w("Failed to load font ".concat(i),"warn");f.appearance=Object.assign(Object.assign({},f.appearance),{fontFamily:"Inter"});return[2]}c=s===null||s===void 0?void 0:s.fontUrl;if(c){(o=(n=window.Zonos).injectSupportGoogleFont)===null||o===void 0?void 0:o.call(n,c)}if(!t){return[2]}w("[FONT] ".concat(t," font override applied"));f.appearance=Object.assign(Object.assign({},f.appearance),{fontFamily:t});return[2]}}))}))};t.prototype.handleLocationChange=function(){void O(f.helloSettings)};t.prototype.initHistoryListener=function(){var t=history.pushState;history.pushState=function n(){window.dispatchEvent(new window.Event("pushstate"));window.dispatchEvent(new window.Event("locationchange"));return t.apply(this,arguments)};var n=history.replaceState;history.replaceState=function t(){window.dispatchEvent(new window.Event("replacestate"));window.dispatchEvent(new window.Event("locationchange"));return n.apply(this,arguments)}};t.prototype.injectCustomHTML=function(t){if(!t){return}if(!window.Zonos.isLegacyCheckout){w("=== Skip injecting custom HTML for hosted checkout","info");return}w("=== Injecting custom HTML for hosted checkout");var n=document.createElement("template");n.innerHTML=t;var o=n.content.querySelectorAll("script");o.forEach((function(t){var n=document.createElement("script");if(t.src){n.src=t.src;n.async=t.async}else{n.textContent=t.innerHTML}document.body.appendChild(n)}))};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(n){this.initHistoryListener();f.zonosApiKey=this.zonosApiKey;(function(){return __awaiter(t,void 0,void 0,(function(){var t,n,o,i,e,r,u,c,a,l,h,v,m,p;var b=this;return __generator(this,(function(g){switch(g.label){case 0:return[4,_()];case 1:r=g.sent(),u=r.errors,c=r.json,a=r.zonosMode;if(((t=u[0])===null||t===void 0?void 0:t.type.toString())==="403"){w("Failed to load zonos settings. This domain may not have access","warn");return[2]}l=((n=c===null||c===void 0?void 0:c.checkoutSettings)===null||n===void 0?void 0:n.customHTML)||"";this.injectCustomHTML(l);this.initZonosNotification();h=function(){var t,n,o;if(window.Zonos.isLegacyCheckout){return((t=c===null||c===void 0?void 0:c.appearanceSettings)===null||t===void 0?void 0:t.logoUrl)||((n=b.config.appearance)===null||n===void 0?void 0:n.logoUrl)}return(o=b.config.appearance)===null||o===void 0?void 0:o.logoUrl};v=window.Zonos.isLegacyCheckout&&!!window.Zonos.cartData&&((o=this.config.checkoutSettings)===null||o===void 0?void 0:o.successBehavior)==="CLOSE_MODAL";m=Object.assign(Object.assign({},this.config),{appearance:Object.assign(Object.assign({},this.config.appearance),{logoUrl:h()}),checkoutSettings:this.config.checkoutSettings?Object.assign(Object.assign({},this.config.checkoutSettings),{subscriptionStatus:undefined,successBehavior:v?"ZONOS_SUCCESS_PAGE":undefined,successRedirectUrl:v?(i=window.Zonos.cartData)===null||i===void 0?void 0:i.storeBaseUrl:undefined}):undefined});d({overrideSettings:m,zonosSettings:c});f.zonosMode=a;void this.setupGoogleFont();if(f.helloSettings.visibilityStatus==="DISABLED"){w("=== Hello is disabled by store owner ===","warn")}if(f.helloSettings&&f.helloSettings.visibilityStatus==="ENABLED"){w("Initializing hello");void O(f.helloSettings)}return[4,s()];case 2:g.sent();p=((e=c===null||c===void 0?void 0:c.checkoutSettings)===null||e===void 0?void 0:e.externalServiceTokens.find((function(t){return t.type==="STRIPE_PUBLISHABLE_TOKEN"})))||null;if(!p||!this.stripeInitEvent){w("Checkout failed to load -- missing publishable key","warn");return[2]}if(f.checkoutSettings.subscriptionStatus==="INACTIVE"){w('=== Checkout subscription is "INACTIVE" - Cancel initializing for Checkout ===',"warn");w("zonos controller loaded");return[2]}if(f.checkoutSettings.visibilityStatus==="DISABLED"){w("=== Checkout is disabled by store owner ===","warn");w("zonos controller loaded");return[2]}this.stripeInitEvent.emit({publishableKey:p.token});return[2]}}))}))})();return[2]}))}))};t.prototype.showNotification=function(t){return __awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(o){n=document.querySelector("zonos-notification");if(!n){w("Failed to show notification - zonos-notification not found","warn");return[2]}void n.showNotification(t);return[2]}))}))};t.prototype.reset=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){c.checkoutSessionId=null;u.clientSecret="";return[2]}))}))};t.prototype.overrideConfig=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){d({overrideSettings:t,zonosSettings:null});return[2]}))}))};t.prototype.overrideCountry=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){w("Override country code to ".concat(t));void a(t);return[2]}))}))};t.prototype.getAppearanceSetting=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,f.appearance]}))}))};t.prototype.updateOrganizationName=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){f.organizationName=t;return[2]}))}))};t.prototype.render=function(){return i(e,{key:"c9c9c74dc05ff98dcb4c86252872bac9bf1ff0c3",class:"zonos--elements"})};return t}());S.style=k}}}));
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(o,e,t,n){function s(o){return o instanceof t?o:new t((function(e){e(o)}))}return new(t||(t=Promise))((function(t,i){function r(o){try{a(n.next(o))}catch(o){i(o)}}function c(o){try{a(n["throw"](o))}catch(o){i(o)}}function a(o){o.done?t(o.value):s(o.value).then(r,c)}a((n=n.apply(o,e||[])).next())}))};var __generator=this&&this.__generator||function(o,e){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,s,i,r;return r={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function c(o){return function(e){return a([o,e])}}function a(c){if(n)throw new TypeError("Generator is already executing.");while(r&&(r=0,c[0]&&(t=0)),t)try{if(n=1,s&&(i=c[0]&2?s["return"]:c[0]?s["throw"]||((i=s["return"])&&i.call(s),0):s.next)&&!(i=i.call(s,c[1])).done)return i;if(s=0,i)c=[c[0]&2,i.value];switch(c[0]){case 0:case 1:i=c;break;case 4:t.label++;return{value:c[1],done:false};case 5:t.label++;s=c[1];c=[0];continue;case 7:c=t.ops.pop();t.trys.pop();continue;default:if(!(i=t.trys,i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){t.label=c[1];break}if(c[0]===6&&t.label<i[1]){t.label=i[1];i=c;break}if(i&&t.label<i[2]){t.label=i[2];t.ops.push(c);break}if(i[2])t.ops.pop();t.trys.pop();continue}c=e.call(o,t)}catch(o){c=[6,o];s=0}finally{n=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}};System.register(["./p-4caffd96.system.js","./p-eb192fa3.system.js","./p-28a516f8.system.js","./p-32912caf.system.js","./p-18e5b741.system.js","./p-aed0098c.system.js","./p-23e7c655.system.js","./p-bf37ccc7.system.js","./p-c015be06.system.js","./p-12546668.system.js","./p-1aa93d1e.system.js","./p-b3882a73.system.js","./p-2770ba48.system.js"],(function(o){"use strict";var e,t,n,s,i,r,c,a,u,d,l,h,f,m,v,z,p,g,k,w,b,y,C,x,_,S,A,O,I,T,j,P,E,B,L,D,N,R,U,M,H,F,Z,G,V,q,K,W,Y,J,Q,X,$,oo,eo,to,no,so,io;return{setters:[function(o){e=o.r;t=o.h;n=o.H;s=o.F},function(o){i=o.l;r=o.s;c=o.a;a=o.b;u=o.c;d=o.i;l=o.d;h=o.e;f=o.f;m=o.g;v=o.h;z=o.j;p=o.k;g=o.m;k=o.n;w=o.o;b=o.t;y=o.p;C=o.q;x=o.r;_=o.u;S=o.v;A=o.w;O=o.x;I=o.y;T=o.z;j=o.A;P=o.B;E=o.C},function(o){B=o.p;L=o.s;D=o.a;N=o.b},function(o){R=o.z;U=o.g;M=o.m},function(o){H=o.h;F=o.l;Z=o.b;G=o.s;V=o.c;q=o.d;K=o.g;W=o.j;Y=o.a},function(o){J=o.i},function(o){Q=o.c},function(o){X=o.c},function(o){$=o.g},function(o){oo=o.i},function(o){eo=o.s},function(o){to=o.c;no=o.s;so=o.d},function(o){io=o.R}],execute:function(){var ro=this;var co=function(o){var e=o.items.map((function(o){return{amount:o.amount,attributes:o.attributes||[],countryOfOrigin:o.countryOfOrigin||undefined,currencyCode:o.currencyCode,description:o.description||"",imageUrl:o.imageUrl||"",itemType:o.itemType||"PHYSICAL_GOOD",measurements:o.measurements||[],name:o.name||o.description||"",productId:o.productId||"",quantity:o.quantity||0,sku:o.sku||""}}))||[];return{adjustments:o.adjustments,cartItems:e}};var ao=function(){return __awaiter(ro,void 0,void 0,(function(){var o,e,t;return __generator(this,(function(n){switch(n.label){case 0:return[4,H("/api/zonos-elements/get-store-discount-enabled-status")];case 1:o=n.sent(),e=o.errors,t=o.json;if(e.length||!(t===null||t===void 0?void 0:t.enabled)){return[2,{enabled:false}]}return[2,{enabled:true}]}}))}))};var uo=function(o){if(o===void 0){o=true}if(!i.localizationLoaded){return true}if(i.isDisabledCountry){if(o){F("Checkout: disabled country")}return true}return false};var lo=function(o){if(o===void 0){o=true}if(!i.localizationLoaded){return false}if(!i.isShippableCountry){if(o){F("Checkout: not shippable country")}return false}return true};var ho=function(o){var e=o.domesticRedirectedBtnSelector,t=o.onShippingAddressSessionFound;if(!window.Zonos.isBigCommerce){return}var n=new MutationObserver((function(){return __awaiter(ro,void 0,void 0,(function(){var o,s,i,d,l;var h=this;return __generator(this,(function(f){o=document.querySelector(e);s=r();if(!o&&s){i=document.createElement("button");i.style.display="none";i.id="zonos--domestic-redirected-checkout-button";document.body.appendChild(i);t===null||t===void 0?void 0:t(s);n.disconnect();return[2]}d=document.querySelector('select[name="shippingAddress.countryCode"]');l=document.querySelector("#checkout-shipping-continue");if(!d||!l){return[2]}n.disconnect();l.addEventListener("click",(function(o){return __awaiter(h,void 0,void 0,(function(){var e,t,n,s,i,r,l;return __generator(this,(function(h){n=d.value;if(!n){return[2]}c(n);if(!lo(false)){a();return[2]}s=document.querySelector("form");if(!s){return[2]}i=new FormData(s);r=document.querySelector("input#addressLine1Input");l={address1:(e=i.get("shippingAddress.address1"))!==null&&e!==void 0?e:r&&r.value,address2:i.get("shippingAddress.address2"),city:i.get("shippingAddress.city"),countryCode:i.get("shippingAddress.countryCode"),firstName:i.get("shippingAddress.firstName"),lastName:i.get("shippingAddress.lastName"),phone:i.get("shippingAddress.phone"),postalCode:i.get("shippingAddress.postalCode"),stateOrProvince:(t=i.get("shippingAddress.stateOrProvince"))!==null&&t!==void 0?t:i.get("shippingAddress.stateOrProvinceCode")};if(Object.values(l).some((function(o){return o===undefined||o===null}))){Z("One or more shipping address field is missing",Object.entries(l));void G({endpoint:"No endpoint, domestic checkout form missing fields",errors:["Bigcommerce: One or more shipping address field is missing in the domestic checkout form",JSON.stringify(Object.entries(l))],metadata:{storeId:R.storeId}});return[2]}u({address1:l.address1,address2:l.address2,city:l.city,countryCode:l.countryCode,firstName:l.firstName,lastName:l.lastName,phone:l.phone,postalCode:l.postalCode,state:l.stateOrProvince});o.preventDefault();o.stopPropagation();window.location.href="/";return[2]}))}))}));return[2]}))}))}));n.observe(document.body,{childList:true,subtree:true})};var fo=function(){var o="connection"in window.navigator?window.navigator.connection:null;var e="mozConnection"in window.navigator?window.navigator.mozConnection:null;var t="webkitConnection"in window.navigator?window.navigator.webkitConnection:null;var n=o||e||t;return n};var mo=function(){var o="userAgentData"in window.navigator?window.navigator.userAgentData:null;var e=fo();return{connectionDownlink:e===null||e===void 0?void 0:e.downlink,connectionEffectiveType:e===null||e===void 0?void 0:e.effectiveType,connectionRtt:e===null||e===void 0?void 0:e.rtt,connectionSaveData:e===null||e===void 0?void 0:e.saveData,userAgent:o&&o.brands.length>0?o:window.navigator.userAgent}};var vo=function(){return __awaiter(ro,void 0,void 0,(function(){var o,e;return __generator(this,(function(t){o=V().elapsedTime;e={cache:"miss",eventName:"jsdelivr",flag:"LOG_CHECKOUT_FACADE_LOAD",href:window.location.href,loadTime:o,metadata:Object.assign({allLogs:q},mo()),scriptLoadUrl:"checkoutFacade",storeId:window.Zonos.storeId};void H("/api/zonos-elements/log-script-load",{body:e,method:"POST"});return[2]}))}))};var zo='<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M2.25 4.5C2.25 3.25736 3.25736 2.25 4.5 2.25H13.5C14.7426 2.25 15.75 3.25736 15.75 4.5V10.5C15.75 11.7426 14.7426 12.75 13.5 12.75H8.25C8.01393 12.75 7.79164 12.8611 7.65 13.05L6.3 14.85C5.87508 15.4166 5.2082 15.75 4.5 15.75C3.25736 15.75 2.25 14.7426 2.25 13.5V4.5ZM4.5 3.75C4.08579 3.75 3.75 4.08579 3.75 4.5V13.5C3.75 13.9142 4.08579 14.25 4.5 14.25C4.73607 14.25 4.95836 14.1389 5.1 13.95L6.45 12.15C6.87492 11.5834 7.5418 11.25 8.25 11.25H13.5C13.9142 11.25 14.25 10.9142 14.25 10.5V4.5C14.25 4.08579 13.9142 3.75 13.5 3.75H4.5ZM5.25 6C5.25 5.58579 5.58579 5.25 6 5.25H12C12.4142 5.25 12.75 5.58579 12.75 6C12.75 6.41421 12.4142 6.75 12 6.75H6C5.58579 6.75 5.25 6.41421 5.25 6ZM5.25 9C5.25 8.58579 5.58579 8.25 6 8.25H8.25C8.66421 8.25 9 8.58579 9 9C9 9.41421 8.66421 9.75 8.25 9.75H6C5.58579 9.75 5.25 9.41421 5.25 9Z" fill="#4D505A"/>\n</svg>\n';var po=".sc-zonos-checkout-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-checkout-h *.sc-zonos-checkout{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-checkout-h img.sc-zonos-checkout{max-width:100%}.sc-zonos-checkout-h dl.sc-zonos-checkout,.sc-zonos-checkout-h dd.sc-zonos-checkout,.sc-zonos-checkout-h h1.sc-zonos-checkout,.sc-zonos-checkout-h h2.sc-zonos-checkout,.sc-zonos-checkout-h h3.sc-zonos-checkout,.sc-zonos-checkout-h h4.sc-zonos-checkout,.sc-zonos-checkout-h h5.sc-zonos-checkout,.sc-zonos-checkout-h h6.sc-zonos-checkout,.sc-zonos-checkout-h hr.sc-zonos-checkout,.sc-zonos-checkout-h figure.sc-zonos-checkout,.sc-zonos-checkout-h p.sc-zonos-checkout,.sc-zonos-checkout-h pre.sc-zonos-checkout{margin:0}.sc-zonos-checkout-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-checkout-h *.sc-zonos-checkout{-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar{width:10px}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{display:-ms-flexbox;display:flex;height:100%;overflow:hidden;border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10))}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{-ms-flex:1;flex:1;padding:32px}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout{background-color:var(--zonos--primary-color, var(--zonos-elements-gray-0));border-right:1px solid var(--zonos-elements-gray-200)}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{background-color:var(--zonos-elements-gray-0)}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{width:100%;max-height:100%;height:100%;overflow:auto;-ms-flex-direction:column;flex-direction:column;background-color:var(--zonos-elements-gray-0);-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:24px;padding-bottom:50px}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout .zonos--header.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;width:100%}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout .zonos--logo.sc-zonos-checkout{margin-bottom:0}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout zonos-checkout-finish.sc-zonos-checkout{-ms-flex:1;flex:1}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:relative}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{padding:0 8px 8px}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--payment-error-banner.sc-zonos-checkout{margin-top:24px}.sc-zonos-checkout-h .zonos--right.sc-zonos-checkout{position:relative}.sc-zonos-checkout-h .zonos--right.sc-zonos-checkout .zonos--right-actions.sc-zonos-checkout{position:absolute;right:24px;top:24px;z-index:2;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--wrapper.sc-zonos-checkout{overflow:auto;max-height:100%;position:relative}.sc-zonos-checkout-h .flex--wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;max-height:100%}.sc-zonos-checkout-h .zonos--logo-wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;gap:16px;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--logo-wrapper.sc-zonos-checkout>*.sc-zonos-checkout{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}.sc-zonos-checkout-h .zonos--logo.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--logo.sc-zonos-checkout img.sc-zonos-checkout{max-height:72px}.sc-zonos-checkout-h .zonos--checkout-default-message.sc-zonos-checkout{margin-left:76px;margin-bottom:8px}.zonos--close-button.sc-zonos-checkout{-ms-flex-item-align:start;align-self:flex-start}.preview.sc-zonos-checkout-h{min-width:500px;margin:auto}.preview.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{border:var(--zonos-elements-border)}.preview.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{padding:32px}.mobile.sc-zonos-checkout-h{min-width:auto}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow:auto;border-radius:0;max-height:100%;height:100%;border:0}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{padding:12px;padding-bottom:76px}@media (max-width: 768px){.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{padding-bottom:0}}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout{-ms-flex-order:2;order:2;border-right:none}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{-ms-flex-order:1;order:1;padding-top:16px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border:var(--zonos-elements-border);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10));background-color:var(--zonos-elements-gray-50);padding:12px;margin-top:32px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--review.sc-zonos-checkout{margin-bottom:0}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--cart-items.sc-zonos-checkout{margin-top:8px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout zonos-checkout-footer.sc-zonos-checkout{-ms-flex-order:3;order:3}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{max-height:100%}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--footer.sc-zonos-checkout{-ms-flex-order:3;order:3}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{width:auto}.mobile.sc-zonos-checkout-h .zonos--cart-subtotal.sc-zonos-checkout{margin:0}.iframed.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{-ms-scroll-chaining:chained;overscroll-behavior:auto}";var go=po;var ko=90*60*1e3;var wo=6*60*60*1e3;var bo=o("zonos_checkout",function(){function o(o){var t=this;e(this,o);this.onChangeLocaleListener=function(){};this.isRedirectAfterOrder=false;this.applyStripeTheme=function(){return __awaiter(t,void 0,void 0,(function(){var o,e,t,n,s;return __generator(this,(function(i){switch(i.label){case 0:s=((o=this.appearanceSettingsOverride)===null||o===void 0?void 0:o.theme)||R.appearance.theme;return[4,d({overrideBorderRadius:(e=this.appearanceSettingsOverride)===null||e===void 0?void 0:e.style,overridePrimaryColor:(t=this.appearanceSettingsOverride)===null||t===void 0?void 0:t.colorPrimary,overrideSecondaryColor:(n=this.appearanceSettingsOverride)===null||n===void 0?void 0:n.colorSecondary,overrideTheme:this.isMobile?s:undefined,paypalEnabled:B()})];case 1:i.sent();return[2]}}))}))};this.handleCartExpiredCheck=function(){var o;if(K()){F("Not checking for cart expiration in test mode");return false}if(!R.checkoutSettings.cartExpiration||!((o=window.Zonos.cartData)===null||o===void 0?void 0:o.createdAt)){return false}var e=new Date(window.Zonos.cartData.createdAt).getTime();var n=(new Date).getTime();var s=n-e;var i=Math.floor(s/6e4);F("Cart has been created for ".concat(i," minutes"));if(R.checkoutSettings.cartExpiration){if(i>R.checkoutSettings.cartExpiration){t.isCartExpired=true;return true}}return false};this.checkStripePaymentIntentStatus=function(o){return __awaiter(t,[o],void 0,(function(o){var e,t,n,s,i,r,c,a,u;var d=o.triggeredButton;return __generator(this,(function(o){switch(o.label){case 0:e=d===null||d===void 0?void 0:d.matches("#".concat(to));t=!!window.Zonos.cartData;n=new URL(window.location.href).searchParams;s=n.get("payment_intent_client_secret");i=n.get("zonosCheckoutSessionId");if(!e){F("Checkout is triggered by user, no need to check stripe payment intent status");return[2,{shouldAllowOrder:true}]}F("Payment intent exist, checking stripe payment intent status");if(!s){F("No stripe client secret found in the URL, proceed to order if cart data is available");return[2,{shouldAllowOrder:t}]}return[4,l({clientSecret:s})];case 1:r=o.sent(),c=r.error,a=r.status;u=new URLSearchParams(window.location.search).get("redirect_status");if(u){if(!c){F("Payment intent is succeeded or in a good state to move forward, show success screen")}else{F("Payment intent failed, show status from error")}this.open=true;h.checkoutSessionId=i;f.clientSecret=s;void this.setToFinishStep(a);return[2,{shouldAllowOrder:false}]}if(!t){F("Cart data is not available, only check payment intent status, skip order.");return[2,{shouldAllowOrder:false}]}F("Payment intent is not succeeded, proceed to order");return[2,{shouldAllowOrder:true}]}}))}))};this.formatDate=function(o){if(!o){return""}var e=new Date(o);return e.toLocaleDateString()};this.formatTime=function(o){if(!o){return""}var e=new Date(o);return e.toLocaleTimeString()};this.getCurrentLocalePageEnum=function(){switch(h.step){case"customer-info":return"checkout_customer_info";case"shipping":return"checkout_shipping_info";case"payment":return"checkout_payment_info";default:return null}};this.appearanceSettingsOverride=undefined;this.preview=false;this.mobile=false;this.overrideStagingMode=undefined;this.defaultAddress=null;this.forceDialogOpen=false;this.defaultAddressParams=null;this.open=this.forceDialogOpen;this.stripe=window.Zonos.stripe;this.submitLoading=false;this.collapseReviewMobile=true;this.isAttachError=false;this.isMobile=false;this.isIframed=false;this.zonosReviewRef=undefined;this.storybookPaymentStatusOverride=undefined;this.isLegacyCheckout=window.Zonos.isLegacyCheckout;this.confirmDialogOpen=false;this.isCartExpired=false;this.inventoryCheckErrorMessage=null;this.placedOrderInfo=null;this.clientSecret=f.clientSecret}o.prototype.initCartInfoHandler=function(o){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){e=o.detail;void m({adjustments:h.adjustments,cartItems:e});return[2]}))}))};o.prototype.handleKeyPress=function(o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(o.key==="Escape"){void this.closeDialogHandler()}return[2]}))}))};o.prototype.closeDialogHandler=function(o){return __awaiter(this,void 0,void 0,(function(){var e,t;return __generator(this,(function(n){if(!this.open){return[2]}if(!(o===null||o===void 0?void 0:o.confirmed)){this.confirmDialogOpen=true;return[2]}this.confirmDialogOpen=false;L("zonos-checkout-close");this.open=this.forceDialogOpen||false;if(!this.preview&&h.step==="finish"){v()}h.step="customer-info";z();p();(t=(e=R.checkoutSettings).onClose)===null||t===void 0?void 0:t.call(e);return[2]}))}))};o.prototype.buildCartAndInit=function(){return __awaiter(this,void 0,void 0,(function(){var o,e,t,n,s,r,c,a,s,u,c,a,a,d,l,c,f;return __generator(this,(function(v){switch(v.label){case 0:if(!(typeof R.checkoutSettings.createCartId==="function"))return[3,4];F('"createCartId" is provided, start building cart');return[4,R.checkoutSettings.createCartId()];case 1:o=v.sent();e=void 0;if(typeof o==="object"){F("object detected, use cartId and prefill address from createCartId");e=o.cartId;this.useShippingDataFromCreateCartId(o.shippingData)}else{e=o}window.Zonos.cartId=e;return[4,no(e)];case 2:t=v.sent();n=t===null||t===void 0?void 0:t.cartData;if(!n){Z("Failed to build cart, please try again.");return[2,false]}window.Zonos.cartData=n;s=this.handleCartExpiredCheck();if(s){return[2,false]}r=co(n),c=r.adjustments,a=r.cartItems;return[4,m({adjustments:c,cartItems:a})];case 3:v.sent();return[3,9];case 4:if(!window.Zonos.cartData)return[3,6];F("tempCartUUID is provided, start building cart");s=this.handleCartExpiredCheck();if(s){return[2,false]}u=co(window.Zonos.cartData),c=u.adjustments,a=u.cartItems;return[4,m({adjustments:c,cartItems:a})];case 5:v.sent();return[3,9];case 6:if(!(R.checkoutSettings.buildCartDetail&&i.selectedCountryCode))return[3,9];F("build cart detail");return[4,R.checkoutSettings.buildCartDetail({countryCode:i.selectedCountryCode,currencyCode:i.targetCurrency})];case 7:a=v.sent();d=a.filter((function(o){return o.amount>=0}));l=a.filter((function(o){return o.amount<0}));c=l.map((function(o){return{amount:o.amount,currencyCode:o.currencyCode,description:o.name||o.description||"",productId:o.productId||null,sku:o.sku||null,type:"CART_TOTAL"}}));return[4,m({adjustments:c,cartItems:d})];case 8:v.sent();v.label=9;case 9:if(!!h.checkoutSessionId)return[3,11];return[4,g()];case 10:f=v.sent();F("stripeStoreInitCheckoutSession: ".concat(f));if(!f){return[2,false]}v.label=11;case 11:if(!h.isStagingMode){void k()}return[4,this.applyStripeTheme()];case 12:v.sent();this.isRedirectAfterOrder=R.checkoutSettings.successBehavior==="REDIRECT_TO_SUCCESS_PAGE"||!!h.externalConfirmationPageURL;return[2,true]}}))}))};o.prototype.reloadCheckoutSession=function(){window.location.reload()};o.prototype.handleOrderDuplication=function(){var o=W(localStorage.getItem("zonos--placed-order-info"));if(!o){localStorage.removeItem("zonos--placed-order-info");return}var e=Date.now()-o.time;F("=== Existing placed order info: ".concat(o.orderId," - ").concat(this.formatDate(o.time)," - elapsed in hh:ss format: ").concat(new Date(e).toISOString().substring(11,8)),"warn");var t=parseFloat(new URLSearchParams(window.location.search).get("zonosOverrideExpiredDuplication")||"0")||wo;if(e>t){F("=== Existing placed order info is older than ".concat(t,"ms, cleaning localStorage"),"warn");localStorage.removeItem("zonos--placed-order-info");return}this.placedOrderInfo=o;F("=== Showing order duplication confirmation","warn")};o.prototype.confirmProceedWithOrderDuplication=function(){this.placedOrderInfo=null;if(!h.checkoutSessionId){return}void H("/api/zonos-elements/update-checkout-session-metadata",{body:{id:h.checkoutSessionId,metadata:[{key:"orderDuplicationConsent",value:"1"}]},method:"POST"})};o.prototype.handleCancelOrderDuplication=function(){var o;this.placedOrderInfo=null;if(this.isLegacyCheckout){var e=(o=window.Zonos.cartData)===null||o===void 0?void 0:o.storeBaseUrl;if(!e){return}if(window.parent){window.parent.location.href=e}window.location.href=e;return}void this.closeDialogHandler({confirmed:true})};o.prototype.attachCheckout=function(){var o=this;var e=R.checkoutSettings.placeOrderButtonSelector;F("attach checkout ".concat(e));if(!e&&!window.Zonos.cartData){return}var t=[e,"#".concat(so),"#".concat(to)].filter(Boolean);var n=document.querySelectorAll(t.join(","));n.forEach((function(t){var n=t.getAttribute("data-zonos-checkout-attached");if(n){return}F("attached event to button ".concat(e),"info",{button:t});t.addEventListener("click",(function(e){return __awaiter(o,void 0,void 0,(function(){var o,t,n,s,i;return __generator(this,(function(r){switch(r.label){case 0:if(!window.Zonos.isLegacyCheckout&&(!lo()||uo())){return[2]}e.preventDefault();e.stopPropagation();F("zonos checkout button clicked");return[4,this.checkStripePaymentIntentStatus({triggeredButton:e.target})];case 1:t=r.sent().shouldAllowOrder;if(!t){return[2]}f.isFetchingSession=true;this.open=true;r.label=2;case 2:r.trys.push([2,5,,6]);return[4,this.buildCartAndInit()];case 3:n=r.sent();if(this.isCartExpired){throw new Error("This shopping cart is expired")}if(!n){throw new Error("Error building cart")}w({isPreview:this.preview,sessionTimeout:ko});return[4,ao()];case 4:s=r.sent().enabled;h.shouldHideDiscountInput=!s;L("zonos-checkout-start");void b("checkout_open");this.handleOrderDuplication();if(window.Zonos.isLegacyCheckout){void vo()}return[3,6];case 5:i=r.sent();f.isFetchingSession=false;Z(i);if(this.isCartExpired){return[2]}void G({endpoint:"Error creating Checkout",errors:[i instanceof Error?i.toString():"Unknown error"],metadata:{allLogs:q,cartId:window.Zonos.cartId,checkoutSessionBody:y(),href:window.location.href,storeBaseUrl:(o=window.Zonos.cartData)===null||o===void 0?void 0:o.storeBaseUrl}});C({messages:[x("There's been an error creating your checkout session. Please reload and try again or contact support if the error persists")],title:x("Error creating Checkout")});return[3,6];case 6:return[2]}}))}))}),{capture:true,passive:false});if(!R.checkoutSettings.disablePlaceOrderButtonActivation){t.removeAttribute("disabled")}t.setAttribute("data-zonos-checkout-attached","true");if(t.matches(so)){t.dispatchEvent(X("click"));a();t.remove()}if(t.matches("#".concat(to))){t.dispatchEvent(X("click"));t.remove()}}))};o.prototype.appearanceSettingsOverrideChanged=function(){if(!this.appearanceSettingsOverride){return}void this.applyStripeTheme()};o.prototype.useShippingDataFromCreateCartId=function(o){if(!o){return}F("shipping data from createCartId result","info",Object.entries(o));var e=o.customerAddress1,t=o.customerAddress2,n=o.customerCity,s=o.customerCountry,r=o.customerEmail,c=o.customerName,a=o.customerPhone,u=o.customerState,d=o.customerZip;var l=new URLSearchParams(window.location.search);var h=s||_(l)||i.selectedCountryCode;this.applyPrefillAddress({customerAddress1:e,customerAddress2:t,customerCity:n,customerCountry:h,customerEmail:r,customerName:c,customerPhone:a,customerState:u,customerZip:d})};o.prototype.useLegacyQueryParams=function(){var o=new URLSearchParams(window.location.search);F("legacy urlParams","info",Object.fromEntries(o.entries()));var e=function(e){var t=o.get(e);if(!t||t==="undefined"){return null}return t};var t=_(o)||i.selectedCountryCode;var n=e("customerCity");var s=e("customerEmail");var r=e("customerAddress1");var c=e("customerAddress2");var a=e("customerName");var u=e("customerPhone");var d=e("customerZip");var l=e("customerState");this.applyPrefillAddress({customerAddress1:r,customerAddress2:c,customerCity:n,customerCountry:t,customerEmail:s,customerName:a,customerPhone:u,customerState:l,customerZip:d})};o.prototype.applyPrefillAddress=function(o){var e=o.customerAddress1||"";var t=o.customerCountry||"";var n=o.customerAddress2||"";var s=o.customerCity||"";var i=o.customerEmail||"";var r=o.customerName||"";var c=o.customerPhone||"";var a=o.customerZip||"";var u=o.customerState||"";if(!e||!r||!c||!t){F("Missing required query params so it can not be prefilled","info",[!e&&"line1",!r&&"name",!c&&"phone",!t&&"country"].filter(Boolean).join(", "));return}this.defaultAddressParams={address:{city:s||"",country:t,line1:e,line2:n,postal_code:a,state:u},email:i,name:r,phone:c};F("Prefill address applied","info",{prefillAddress:this.defaultAddressParams,providedAddress:o})};o.prototype.overrideStagingModeChanged=function(){h.isStagingMode=!!this.overrideStagingMode};o.prototype.init=function(){return __awaiter(this,void 0,void 0,(function(){var o;var e=this;return __generator(this,(function(t){f.stripe=window.Zonos.stripe;this.stripe=window.Zonos.stripe;h.isStagingMode=Y();if(typeof this.overrideStagingMode!=="undefined"){h.isStagingMode=this.overrideStagingMode}ho({domesticRedirectedBtnSelector:so,onShippingAddressSessionFound:function(o){e.defaultAddress={address:{city:o.city,country:o.countryCode,line1:o.address1,line2:o.address2,postal_code:o.postalCode,state:o.state},email:"",name:"".concat(o.firstName," ").concat(o.lastName),phone:o.phone}}});if(window.Zonos){this.useLegacyQueryParams()}o=setInterval((function(){f.stripe=window.Zonos.stripe;e.stripe=window.Zonos.stripe;if(!e.stripe){F("waiting for stripe to be loaded");return}if(e.storybookPaymentStatusOverride){clearInterval(o);return}F("init checkout");if(e.preview||e.forceDialogOpen){void e.buildCartAndInit()}else if(window.Zonos.isLegacyCheckout){e.attachCheckout()}else if(window){e.attachCheckout();var t=new MutationObserver((function(){e.attachCheckout()}));t.observe(document.body,{childList:true,subtree:true})}clearInterval(o)}),50);setTimeout((function(){clearInterval(o)}),1e4);return[2]}))}))};o.prototype.setToFinishStep=function(o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){h.step="finish";this.storybookPaymentStatusOverride=o;return[2]}))}))};o.prototype.mockCheckoutSession=function(o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){S(o);return[2]}))}))};o.prototype.handleCustomerInfoContinue=function(){return __awaiter(this,void 0,void 0,(function(){var o;var e=this;return __generator(this,(function(t){switch(t.label){case 0:this.submitLoading=true;return[4,A()];case 1:t.sent();o=setInterval((function(){if(h.landedCostData||!f.isFetchingLandedCost){if(h.landedCostData){void D({currency:h.currency});O()}e.submitLoading=false;clearInterval(o)}}),500);return[2]}}))}))};o.prototype.handleShippingContinue=function(){return __awaiter(this,void 0,void 0,(function(){var o=this;return __generator(this,(function(e){this.submitLoading=true;setTimeout((function(){O();o.submitLoading=false}),500);return[2]}))}))};o.prototype.handleInventoryCheckDialogConfirm=function(){h.inventoryCheckErrorMessage=null;if(!this.isLegacyCheckout){void this.closeDialogHandler({confirmed:true})}};o.prototype.handleCartExpiredDialogConfirm=function(){var o;this.isCartExpired=false;if(this.isLegacyCheckout){var e=(o=window.Zonos.cartData)===null||o===void 0?void 0:o.storeBaseUrl;if(!e){return}if(window.parent){window.parent.location.href=e}window.location.href=e;return}if(window.parent){window.parent.location.href=window.location.href}window.location.reload()};o.prototype.handleStripePaymentContinue=function(){return __awaiter(this,void 0,void 0,(function(){var o,e,t;return __generator(this,(function(n){switch(n.label){case 0:N.paypalErrorMessage=null;f.hasPaymentError=false;this.submitLoading=true;h.inventoryCheckErrorMessage=null;n.label=1;case 1:n.trys.push([1,3,,4]);o=h;return[4,I()];case 2:o.inventoryCheckErrorMessage=n.sent();return[3,4];case 3:e=n.sent();h.inventoryCheckErrorMessage=x("Unable to check inventory. Please try again.");return[3,4];case 4:if(h.inventoryCheckErrorMessage){this.submitLoading=false;return[2]}n.label=5;case 5:n.trys.push([5,7,,8]);return[4,T()];case 6:n.sent();O();p();return[3,8];case 7:t=n.sent();Z(t);L("zonos-checkout-payment-fail");f.hasPaymentError=true;if(f.shouldInventoryRefund){void j();f.shouldInventoryRefund=false}return[3,8];case 8:this.submitLoading=false;return[2]}}))}))};o.prototype.handleFinishClick=function(){return __awaiter(this,void 0,void 0,(function(){var o,e,t,n;return __generator(this,(function(s){switch(s.label){case 0:P();if(!this.preview)return[3,2];h.step="customer-info";return[4,this.init()];case 1:s.sent();return[2];case 2:v();if(window.Zonos.isLegacyCheckout&&window.Zonos.cartData){o=window.Zonos.cartData.storeBaseUrl;if(window.parent){window.parent.location.href=o}window.location.href=o;return[2]}e=window.location.href;t=e.split("?")[0];this.open=false;n=window.location.hostname.includes("dashboard.zonos.com");if(!n){window.history.replaceState(window.history.state,document.title,t);window.location.reload()}return[2]}}))}))};o.prototype.handleWindowResize=function(){this.isMobile=J(this.mobile);void this.applyStripeTheme();F("mobile: ".concat(this.isMobile))};o.prototype.handleMobileChange=function(){this.isMobile=J(this.mobile);void this.applyStripeTheme();F("mobile: ".concat(this.isMobile))};o.prototype.handleAppearanceSettingsOverrideChange=function(){var o;if((o=this.appearanceSettingsOverride)===null||o===void 0?void 0:o.theme){this.appearanceSettingsOverride.theme=U(this.appearanceSettingsOverride.theme)}};o.prototype.handleAddressChange=function(){P()};o.prototype.handleClientSecretChange=function(){void this.applyStripeTheme()};o.prototype.handleOpenChange=function(){var o="data-zonos-overflow-origin";var e=document.body;var t=document.documentElement;if(this.open){if(e.style.overflow){e.setAttribute(o,e.style.overflow)}e.style.overflow="hidden";if(t.style.overflow){t.setAttribute(o,t.style.overflow)}t.style.overflow="hidden"}else{var n=e.getAttribute(o);var s=t.getAttribute(o);if(n){e.removeAttribute(o);e.style.overflow=n}else{e.style.removeProperty("overflow")}if(s){t.removeAttribute(o);t.style.overflow=s}else{t.style.removeProperty("overflow")}}};o.prototype.componentWillLoad=function(){var o=this;void this.init();this.isMobile=J(this.mobile);this.isIframed=window.self!==window.top;F("iframed: ".concat(this.isIframed));this.handleAppearanceSettingsOverrideChange();this.onChangeLocaleListener=E("selectedLocale",(function(){void o.applyStripeTheme()}));F("mobile: ".concat(this.isMobile))};o.prototype.disconnectedCallback=function(){P();v();this.onChangeLocaleListener()};o.prototype.render=function(){var o=this;var e,r,c,a;this.clientSecret=f.clientSecret;var u=h.step!=="finish"&&h.step!=="error"&&!f.stripeElements||f.isFetchingSession;var d=M(R.appearance,this.appearanceSettingsOverride||null),l=d.colorPrimary,m=d.colorSecondary,v=d.logoUrl,z=d.style;var p=R.appearance.zonosAttribution==="ENABLED";var g=R.appearance.theme;var k=l&&oo(l)?"DARK":"LIGHT";var w=this.isMobile?g:k;var b=!this.isMobile?m:undefined;var y=i.customMessages;var C=(e=y.find((function(o){return o.pageName==="checkout_default"})))===null||e===void 0?void 0:e.message;var _=this.getCurrentLocalePageEnum();var S=y.filter((function(o){return o.pageName===_}));var A=function(){var e=o.preview?"".concat(v,"?timestamp=").concat(Date.now()):v;return t("div",{class:"zonos--logo"},e&&t("img",{alt:"".concat(R.organizationName," logo"),src:e}))};var O=K();var I=function(){var e=new URLSearchParams(window.location.search);var n=e.get("zonosQaUrl");var s=e.get("zonosDebug");var i=e.get("zonosE2ETest");var r=o.overrideStagingMode||Y();return t("zonos-v-stack",null,t("div",{class:"zonos--logo-wrapper"},A(),O&&t("zonos-badge",{badgeColor:"orange",size:"small"},x("Test mode")),r&&t("zonos-badge",{badgeColor:"red",size:"small"},x("Staging mode")),s==="1"&&t("zonos-badge",{badgeColor:"cyan",size:"small"},"debug"),n&&t("zonos-badge",{badgeColor:"purple",size:"small"},n),i&&t("zonos-badge",{badgeColor:"gray",size:"small"},"E2E Test")),t("zonos-checkout-progress-tabs",{backgroundColor:o.isMobile?"--zonos-elements-gray-0":null}),S.map((function(o){return t("zonos-custom-message",{icon:zo,message:o.message})})))};var T=function(){if(h.checkoutSessionTimeoutShow){return t("zonos-rest-state",{class:"zonos--session-timeout",restStateSubtitle:x("Your checkout session has expired. Please reload the page to continue."),restStateTitle:x("Session timed out"),restStateType:"Warning"},t("zonos-button",{onClick:function(){return o.reloadCheckoutSession()},variant:"primary"},x("Reload")))}return t("div",{class:"zonos--content",style:{"--zonos--border-radius":$({overrideBorderStyle:z})}},h.step!=="finish"&&h.step!=="error"&&t(s,null,t("div",{class:"zonos--left","data-theme":w,style:eo({"--zonos--primary-color":!o.isMobile?l:undefined})},!o.isMobile&&I(),h.step==="customer-info"&&t("zonos-customer-info",{continueLoading:o.submitLoading,defaultAddress:o.defaultAddress||o.defaultAddressParams,isMobile:o.isMobile,onContinueClicked:function(){return o.handleCustomerInfoContinue()},submitBtnColor:b}),h.step==="shipping"&&t("zonos-shipping",{continueLoading:o.submitLoading,onContinueClicked:function(){return o.handleShippingContinue()},submitBtnColor:b}),h.step==="payment"&&t("zonos-checkout-payment",{continueLoading:o.submitLoading,isMobile:o.isMobile,onContinueClicked:function(){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:return[4,this.handleStripePaymentContinue()];case 1:o.sent();return[2]}}))}))},submitBtnColor:b})),t("div",{class:"zonos--right","data-theme":g},o.isMobile&&I(),t("div",{class:"zonos--right-actions"},window.Zonos.showBaseForeign&&t("zonos-currency-toggle",null),!o.isLegacyCheckout&&t("zonos-button",{class:"zonos--close-button",icon:t("zonos-icon",{"aria-label":"Close checkout dialog",content:io}),noBackground:true,onClick:function(){return o.closeDialogHandler()}})),t("div",{class:"flex--wrapper"},t("div",{class:"zonos--wrapper"},t("zonos-review",{collapsed:o.collapseReviewMobile,mobile:o.isMobile,onClick:function(){if(!o.isMobile){return}o.collapseReviewMobile=!o.collapseReviewMobile}}),t("zonos-collapse",{collapsed:o.collapseReviewMobile&&o.isMobile},t("zonos-cart-items",null),o.isMobile&&t("zonos-v-stack",{spacing:16},t("zonos-cart-subtotal",{submitBtnColor:b}),t("zonos-custom-message",{class:"zonos--checkout-default-message",icon:zo,message:C})))),t("zonos-cart-restricted-items",null),!o.isMobile&&t("zonos-v-stack",{spacing:16},t("zonos-cart-subtotal",null),t("zonos-custom-message",{class:"zonos--checkout-default-message",icon:zo,message:C}))))),(h.step==="finish"||h.step==="error")&&t("div",{class:"zonos--done","data-theme":g},t("div",{class:"zonos--header"},A(),!o.isRedirectAfterOrder&&t("zonos-button",{class:"zonos--close-button",icon:t("zonos-icon",{"aria-label":"Close checkout dialog",content:io}),noBackground:true,onClick:function(){return o.handleFinishClick()},theme:g})),t("zonos-checkout-finish",{borderRadius:z,onCloseClick:function(){return o.handleFinishClick()},overrideNotification:h.step==="error"&&!!h.error?Object.assign(Object.assign({},h.error),{type:"error"}):undefined,storybookForceStatus:o.storybookPaymentStatusOverride})),t("zonos-checkout-footer",{"data-theme":g,mobile:o.isMobile,slot:!o.isMobile?"dialog-footer":undefined}))};return t(n,{class:Q(["zonos--checkout zonos--elements",p&&"has-footer",this.preview&&"preview",this.isMobile&&"mobile",this.isIframed&&"iframed"])},this.preview?T():t("zonos-dialog",{borderStyle:z,"data-theme":g,height:"980px",isLoading:u,mobile:this.isMobile,noBodyPadding:true,noBorder:true,noClickOutside:true,noCloseButton:true,onCloseDialog:function(){return o.closeDialogHandler()},open:this.open,width:"1200px"},T()),t("zonos-confirm-dialog",{class:"zonos--close-confirm-dialog",dialogCancelBtnText:x("Don't close"),dialogConfirmBtnText:x("Close"),dialogIntent:"warn",dialogOpen:this.confirmDialogOpen,dialogSubtitle:x("Would you like to close checkout and return to the site?"),dialogTitle:x("Are you sure?"),onCancelClicked:function(){o.confirmDialogOpen=false},onConfirmClicked:function(){return o.closeDialogHandler({confirmed:true})}}),t("zonos-confirm-dialog",{class:"zonos--order-duplication-dialog",dialogCancelBtnText:x("Return to merchant site"),dialogConfirmBtnText:x("Proceed with order"),dialogIntent:"warn",dialogOpen:!!this.placedOrderInfo,dialogSubtitle:((r=this.placedOrderInfo)===null||r===void 0?void 0:r.zonosOrderNumber)?x("It looks like you placed an order recently ([date] at [time]) under order number #[orderNumber]. Check your email for the order confirmation. Are you sure you want to place another order?",{date:this.formatDate(this.placedOrderInfo.time),orderNumber:this.placedOrderInfo.zonosOrderNumber,time:this.formatTime(this.placedOrderInfo.time)}):x("It looks like you placed an order recently ([date] at [time]). Check your email for the order confirmation. Are you sure you want to place another one?",{date:this.formatDate(((c=this.placedOrderInfo)===null||c===void 0?void 0:c.time)||null),time:this.formatTime(((a=this.placedOrderInfo)===null||a===void 0?void 0:a.time)||null)}),dialogTitle:x("Are you sure?"),dialogWidth:530,onCancelClicked:function(){o.handleCancelOrderDuplication()},onConfirmClicked:function(){o.confirmProceedWithOrderDuplication()}}),t("zonos-confirm-dialog",{class:"zonos--inventory-check-failure-dialog",dialogConfirmBtnText:x("Return to cart"),dialogIntent:"danger",dialogOpen:!!h.inventoryCheckErrorMessage,dialogSubtitle:h.inventoryCheckErrorMessage,dialogTitle:x("Couldn't place order"),dialogType:"alert",onConfirmClicked:function(){return o.handleInventoryCheckDialogConfirm()}}),t("zonos-confirm-dialog",{class:"zonos--shopping-cart-expired-dialog",dialogConfirmBtnText:x("OK"),dialogIntent:"danger",dialogOpen:this.isCartExpired,dialogSubtitle:x("You are being sent back to the shop to re-add items to your cart."),dialogTitle:x("Shopping cart expired"),dialogType:"alert",onConfirmClicked:function(){return o.handleCartExpiredDialogConfirm()}}))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});Object.defineProperty(o,"watchers",{get:function(){return{appearanceSettingsOverride:["appearanceSettingsOverrideChanged","handleAppearanceSettingsOverrideChange"],overrideStagingMode:["overrideStagingModeChanged"],mobile:["handleMobileChange"],defaultAddress:["handleAddressChange"],clientSecret:["handleClientSecretChange"],open:["handleOpenChange"]}},enumerable:false,configurable:true});return o}());bo.style=go}}}));
1
+ var __awaiter=this&&this.__awaiter||function(o,e,t,n){function s(o){return o instanceof t?o:new t((function(e){e(o)}))}return new(t||(t=Promise))((function(t,i){function r(o){try{a(n.next(o))}catch(o){i(o)}}function c(o){try{a(n["throw"](o))}catch(o){i(o)}}function a(o){o.done?t(o.value):s(o.value).then(r,c)}a((n=n.apply(o,e||[])).next())}))};var __generator=this&&this.__generator||function(o,e){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,s,i,r;return r={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function c(o){return function(e){return a([o,e])}}function a(c){if(n)throw new TypeError("Generator is already executing.");while(r&&(r=0,c[0]&&(t=0)),t)try{if(n=1,s&&(i=c[0]&2?s["return"]:c[0]?s["throw"]||((i=s["return"])&&i.call(s),0):s.next)&&!(i=i.call(s,c[1])).done)return i;if(s=0,i)c=[c[0]&2,i.value];switch(c[0]){case 0:case 1:i=c;break;case 4:t.label++;return{value:c[1],done:false};case 5:t.label++;s=c[1];c=[0];continue;case 7:c=t.ops.pop();t.trys.pop();continue;default:if(!(i=t.trys,i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){t.label=c[1];break}if(c[0]===6&&t.label<i[1]){t.label=i[1];i=c;break}if(i&&t.label<i[2]){t.label=i[2];t.ops.push(c);break}if(i[2])t.ops.pop();t.trys.pop();continue}c=e.call(o,t)}catch(o){c=[6,o];s=0}finally{n=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}};System.register(["./p-4caffd96.system.js","./p-eb192fa3.system.js","./p-28a516f8.system.js","./p-32912caf.system.js","./p-18e5b741.system.js","./p-aed0098c.system.js","./p-23e7c655.system.js","./p-bf37ccc7.system.js","./p-c015be06.system.js","./p-12546668.system.js","./p-1aa93d1e.system.js","./p-73a3e5bb.system.js","./p-2770ba48.system.js"],(function(o){"use strict";var e,t,n,s,i,r,c,a,u,d,l,h,f,m,v,z,p,g,k,w,b,y,C,x,_,S,A,O,I,T,j,P,E,B,L,D,N,R,U,M,H,F,Z,G,V,q,K,W,Y,J,Q,X,$,oo,eo,to,no,so,io;return{setters:[function(o){e=o.r;t=o.h;n=o.H;s=o.F},function(o){i=o.l;r=o.s;c=o.a;a=o.b;u=o.c;d=o.i;l=o.d;h=o.e;f=o.f;m=o.g;v=o.h;z=o.j;p=o.k;g=o.m;k=o.n;w=o.o;b=o.t;y=o.p;C=o.q;x=o.r;_=o.u;S=o.v;A=o.w;O=o.x;I=o.y;T=o.z;j=o.A;P=o.B;E=o.C},function(o){B=o.p;L=o.s;D=o.a;N=o.b},function(o){R=o.z;U=o.g;M=o.m},function(o){H=o.h;F=o.l;Z=o.b;G=o.s;V=o.c;q=o.d;K=o.g;W=o.j;Y=o.a},function(o){J=o.i},function(o){Q=o.c},function(o){X=o.c},function(o){$=o.g},function(o){oo=o.i},function(o){eo=o.s},function(o){to=o.c;no=o.s;so=o.d},function(o){io=o.R}],execute:function(){var ro=this;var co=function(o){var e=o.items.map((function(o){return{amount:o.amount,attributes:o.attributes||[],countryOfOrigin:o.countryOfOrigin||undefined,currencyCode:o.currencyCode,description:o.description||"",imageUrl:o.imageUrl||"",itemType:o.itemType||"PHYSICAL_GOOD",measurements:o.measurements||[],name:o.name||o.description||"",productId:o.productId||"",quantity:o.quantity||0,sku:o.sku||""}}))||[];return{adjustments:o.adjustments,cartItems:e}};var ao=function(){return __awaiter(ro,void 0,void 0,(function(){var o,e,t;return __generator(this,(function(n){switch(n.label){case 0:return[4,H("/api/zonos-elements/get-store-discount-enabled-status")];case 1:o=n.sent(),e=o.errors,t=o.json;if(e.length||!(t===null||t===void 0?void 0:t.enabled)){return[2,{enabled:false}]}return[2,{enabled:true}]}}))}))};var uo=function(o){if(o===void 0){o=true}if(!i.localizationLoaded){return true}if(i.isDisabledCountry){if(o){F("Checkout: disabled country")}return true}return false};var lo=function(o){if(o===void 0){o=true}if(!i.localizationLoaded){return false}if(!i.isShippableCountry){if(o){F("Checkout: not shippable country")}return false}return true};var ho=function(o){var e=o.domesticRedirectedBtnSelector,t=o.onShippingAddressSessionFound;if(!window.Zonos.isBigCommerce){return}var n=new MutationObserver((function(){return __awaiter(ro,void 0,void 0,(function(){var o,s,i,d,l;var h=this;return __generator(this,(function(f){o=document.querySelector(e);s=r();if(!o&&s){i=document.createElement("button");i.style.display="none";i.id="zonos--domestic-redirected-checkout-button";document.body.appendChild(i);t===null||t===void 0?void 0:t(s);n.disconnect();return[2]}d=document.querySelector('select[name="shippingAddress.countryCode"]');l=document.querySelector("#checkout-shipping-continue");if(!d||!l){return[2]}n.disconnect();l.addEventListener("click",(function(o){return __awaiter(h,void 0,void 0,(function(){var e,t,n,s,i,r,l;return __generator(this,(function(h){n=d.value;if(!n){return[2]}c(n);if(!lo(false)){a();return[2]}s=document.querySelector("form");if(!s){return[2]}i=new FormData(s);r=document.querySelector("input#addressLine1Input");l={address1:(e=i.get("shippingAddress.address1"))!==null&&e!==void 0?e:r&&r.value,address2:i.get("shippingAddress.address2"),city:i.get("shippingAddress.city"),countryCode:i.get("shippingAddress.countryCode"),firstName:i.get("shippingAddress.firstName"),lastName:i.get("shippingAddress.lastName"),phone:i.get("shippingAddress.phone"),postalCode:i.get("shippingAddress.postalCode"),stateOrProvince:(t=i.get("shippingAddress.stateOrProvince"))!==null&&t!==void 0?t:i.get("shippingAddress.stateOrProvinceCode")};if(Object.values(l).some((function(o){return o===undefined||o===null}))){Z("One or more shipping address field is missing",Object.entries(l));void G({endpoint:"No endpoint, domestic checkout form missing fields",errors:["Bigcommerce: One or more shipping address field is missing in the domestic checkout form",JSON.stringify(Object.entries(l))],metadata:{storeId:R.storeId}});return[2]}u({address1:l.address1,address2:l.address2,city:l.city,countryCode:l.countryCode,firstName:l.firstName,lastName:l.lastName,phone:l.phone,postalCode:l.postalCode,state:l.stateOrProvince});o.preventDefault();o.stopPropagation();window.location.href="/";return[2]}))}))}));return[2]}))}))}));n.observe(document.body,{childList:true,subtree:true})};var fo=function(){var o="connection"in window.navigator?window.navigator.connection:null;var e="mozConnection"in window.navigator?window.navigator.mozConnection:null;var t="webkitConnection"in window.navigator?window.navigator.webkitConnection:null;var n=o||e||t;return n};var mo=function(){var o="userAgentData"in window.navigator?window.navigator.userAgentData:null;var e=fo();return{connectionDownlink:e===null||e===void 0?void 0:e.downlink,connectionEffectiveType:e===null||e===void 0?void 0:e.effectiveType,connectionRtt:e===null||e===void 0?void 0:e.rtt,connectionSaveData:e===null||e===void 0?void 0:e.saveData,userAgent:o&&o.brands.length>0?o:window.navigator.userAgent}};var vo=function(){return __awaiter(ro,void 0,void 0,(function(){var o,e;return __generator(this,(function(t){o=V().elapsedTime;e={cache:"miss",eventName:"jsdelivr",flag:"LOG_CHECKOUT_FACADE_LOAD",href:window.location.href,loadTime:o,metadata:Object.assign({allLogs:q},mo()),scriptLoadUrl:"checkoutFacade",storeId:window.Zonos.storeId};void H("/api/zonos-elements/log-script-load",{body:e,method:"POST"});return[2]}))}))};var zo='<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M2.25 4.5C2.25 3.25736 3.25736 2.25 4.5 2.25H13.5C14.7426 2.25 15.75 3.25736 15.75 4.5V10.5C15.75 11.7426 14.7426 12.75 13.5 12.75H8.25C8.01393 12.75 7.79164 12.8611 7.65 13.05L6.3 14.85C5.87508 15.4166 5.2082 15.75 4.5 15.75C3.25736 15.75 2.25 14.7426 2.25 13.5V4.5ZM4.5 3.75C4.08579 3.75 3.75 4.08579 3.75 4.5V13.5C3.75 13.9142 4.08579 14.25 4.5 14.25C4.73607 14.25 4.95836 14.1389 5.1 13.95L6.45 12.15C6.87492 11.5834 7.5418 11.25 8.25 11.25H13.5C13.9142 11.25 14.25 10.9142 14.25 10.5V4.5C14.25 4.08579 13.9142 3.75 13.5 3.75H4.5ZM5.25 6C5.25 5.58579 5.58579 5.25 6 5.25H12C12.4142 5.25 12.75 5.58579 12.75 6C12.75 6.41421 12.4142 6.75 12 6.75H6C5.58579 6.75 5.25 6.41421 5.25 6ZM5.25 9C5.25 8.58579 5.58579 8.25 6 8.25H8.25C8.66421 8.25 9 8.58579 9 9C9 9.41421 8.66421 9.75 8.25 9.75H6C5.58579 9.75 5.25 9.41421 5.25 9Z" fill="#4D505A"/>\n</svg>\n';var po=".sc-zonos-checkout-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-checkout-h *.sc-zonos-checkout{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-checkout-h img.sc-zonos-checkout{max-width:100%}.sc-zonos-checkout-h dl.sc-zonos-checkout,.sc-zonos-checkout-h dd.sc-zonos-checkout,.sc-zonos-checkout-h h1.sc-zonos-checkout,.sc-zonos-checkout-h h2.sc-zonos-checkout,.sc-zonos-checkout-h h3.sc-zonos-checkout,.sc-zonos-checkout-h h4.sc-zonos-checkout,.sc-zonos-checkout-h h5.sc-zonos-checkout,.sc-zonos-checkout-h h6.sc-zonos-checkout,.sc-zonos-checkout-h hr.sc-zonos-checkout,.sc-zonos-checkout-h figure.sc-zonos-checkout,.sc-zonos-checkout-h p.sc-zonos-checkout,.sc-zonos-checkout-h pre.sc-zonos-checkout{margin:0}.sc-zonos-checkout-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-checkout-h *.sc-zonos-checkout{-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar{width:10px}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{display:-ms-flexbox;display:flex;height:100%;overflow:hidden;border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10))}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{-ms-flex:1;flex:1;padding:32px}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout{background-color:var(--zonos--primary-color, var(--zonos-elements-gray-0));border-right:1px solid var(--zonos-elements-gray-200)}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{background-color:var(--zonos-elements-gray-0)}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{width:100%;max-height:100%;height:100%;overflow:auto;-ms-flex-direction:column;flex-direction:column;background-color:var(--zonos-elements-gray-0);-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:24px;padding-bottom:50px}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout .zonos--header.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;width:100%}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout .zonos--logo.sc-zonos-checkout{margin-bottom:0}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout zonos-checkout-finish.sc-zonos-checkout{-ms-flex:1;flex:1}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:relative}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{padding:0 8px 8px}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--payment-error-banner.sc-zonos-checkout{margin-top:24px}.sc-zonos-checkout-h .zonos--right.sc-zonos-checkout{position:relative}.sc-zonos-checkout-h .zonos--right.sc-zonos-checkout .zonos--right-actions.sc-zonos-checkout{position:absolute;right:24px;top:24px;z-index:2;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--wrapper.sc-zonos-checkout{overflow:auto;max-height:100%;position:relative}.sc-zonos-checkout-h .flex--wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;max-height:100%}.sc-zonos-checkout-h .zonos--logo-wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;gap:16px;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--logo-wrapper.sc-zonos-checkout>*.sc-zonos-checkout{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}.sc-zonos-checkout-h .zonos--logo.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--logo.sc-zonos-checkout img.sc-zonos-checkout{max-height:72px}.sc-zonos-checkout-h .zonos--checkout-default-message.sc-zonos-checkout{margin-left:76px;margin-bottom:8px}.zonos--close-button.sc-zonos-checkout{-ms-flex-item-align:start;align-self:flex-start}.preview.sc-zonos-checkout-h{min-width:500px;margin:auto}.preview.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{border:var(--zonos-elements-border)}.preview.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{padding:32px}.mobile.sc-zonos-checkout-h{min-width:auto}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow:auto;border-radius:0;max-height:100%;height:100%;border:0}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{padding:12px;padding-bottom:76px}@media (max-width: 768px){.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{padding-bottom:0}}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout{-ms-flex-order:2;order:2;border-right:none}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{-ms-flex-order:1;order:1;padding-top:16px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border:var(--zonos-elements-border);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10));background-color:var(--zonos-elements-gray-50);padding:12px;margin-top:32px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--review.sc-zonos-checkout{margin-bottom:0}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--cart-items.sc-zonos-checkout{margin-top:8px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout zonos-checkout-footer.sc-zonos-checkout{-ms-flex-order:3;order:3}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{max-height:100%}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--footer.sc-zonos-checkout{-ms-flex-order:3;order:3}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{width:auto}.mobile.sc-zonos-checkout-h .zonos--cart-subtotal.sc-zonos-checkout{margin:0}.iframed.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{-ms-scroll-chaining:chained;overscroll-behavior:auto}";var go=po;var ko=90*60*1e3;var wo=6*60*60*1e3;var bo=o("zonos_checkout",function(){function o(o){var t=this;e(this,o);this.onChangeLocaleListener=function(){};this.isRedirectAfterOrder=false;this.applyStripeTheme=function(){return __awaiter(t,void 0,void 0,(function(){var o,e,t,n,s;return __generator(this,(function(i){switch(i.label){case 0:s=((o=this.appearanceSettingsOverride)===null||o===void 0?void 0:o.theme)||R.appearance.theme;return[4,d({overrideBorderRadius:(e=this.appearanceSettingsOverride)===null||e===void 0?void 0:e.style,overridePrimaryColor:(t=this.appearanceSettingsOverride)===null||t===void 0?void 0:t.colorPrimary,overrideSecondaryColor:(n=this.appearanceSettingsOverride)===null||n===void 0?void 0:n.colorSecondary,overrideTheme:this.isMobile?s:undefined,paypalEnabled:B()})];case 1:i.sent();return[2]}}))}))};this.handleCartExpiredCheck=function(){var o;if(K()){F("Not checking for cart expiration in test mode");return false}if(!R.checkoutSettings.cartExpiration||!((o=window.Zonos.cartData)===null||o===void 0?void 0:o.createdAt)){return false}var e=new Date(window.Zonos.cartData.createdAt).getTime();var n=(new Date).getTime();var s=n-e;var i=Math.floor(s/6e4);F("Cart has been created for ".concat(i," minutes"));if(R.checkoutSettings.cartExpiration){if(i>R.checkoutSettings.cartExpiration){t.isCartExpired=true;return true}}return false};this.checkStripePaymentIntentStatus=function(o){return __awaiter(t,[o],void 0,(function(o){var e,t,n,s,i,r,c,a,u;var d=o.triggeredButton;return __generator(this,(function(o){switch(o.label){case 0:e=d===null||d===void 0?void 0:d.matches("#".concat(to));t=!!window.Zonos.cartData;n=new URL(window.location.href).searchParams;s=n.get("payment_intent_client_secret");i=n.get("zonosCheckoutSessionId");if(!e){F("Checkout is triggered by user, no need to check stripe payment intent status");return[2,{shouldAllowOrder:true}]}F("Payment intent exist, checking stripe payment intent status");if(!s){F("No stripe client secret found in the URL, proceed to order if cart data is available");return[2,{shouldAllowOrder:t}]}return[4,l({clientSecret:s})];case 1:r=o.sent(),c=r.error,a=r.status;u=new URLSearchParams(window.location.search).get("redirect_status");if(u){if(!c){F("Payment intent is succeeded or in a good state to move forward, show success screen")}else{F("Payment intent failed, show status from error")}this.open=true;h.checkoutSessionId=i;f.clientSecret=s;void this.setToFinishStep(a);return[2,{shouldAllowOrder:false}]}if(!t){F("Cart data is not available, only check payment intent status, skip order.");return[2,{shouldAllowOrder:false}]}F("Payment intent is not succeeded, proceed to order");return[2,{shouldAllowOrder:true}]}}))}))};this.formatDate=function(o){if(!o){return""}var e=new Date(o);return e.toLocaleDateString()};this.formatTime=function(o){if(!o){return""}var e=new Date(o);return e.toLocaleTimeString()};this.getCurrentLocalePageEnum=function(){switch(h.step){case"customer-info":return"checkout_customer_info";case"shipping":return"checkout_shipping_info";case"payment":return"checkout_payment_info";default:return null}};this.appearanceSettingsOverride=undefined;this.preview=false;this.mobile=false;this.overrideStagingMode=undefined;this.defaultAddress=null;this.forceDialogOpen=false;this.defaultAddressParams=null;this.open=this.forceDialogOpen;this.stripe=window.Zonos.stripe;this.submitLoading=false;this.collapseReviewMobile=true;this.isAttachError=false;this.isMobile=false;this.isIframed=false;this.zonosReviewRef=undefined;this.storybookPaymentStatusOverride=undefined;this.isLegacyCheckout=window.Zonos.isLegacyCheckout;this.confirmDialogOpen=false;this.isCartExpired=false;this.inventoryCheckErrorMessage=null;this.placedOrderInfo=null;this.clientSecret=f.clientSecret}o.prototype.initCartInfoHandler=function(o){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){e=o.detail;void m({adjustments:h.adjustments,cartItems:e});return[2]}))}))};o.prototype.handleKeyPress=function(o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(o.key==="Escape"){void this.closeDialogHandler()}return[2]}))}))};o.prototype.closeDialogHandler=function(o){return __awaiter(this,void 0,void 0,(function(){var e,t;return __generator(this,(function(n){if(!this.open){return[2]}if(!(o===null||o===void 0?void 0:o.confirmed)){this.confirmDialogOpen=true;return[2]}this.confirmDialogOpen=false;L("zonos-checkout-close");this.open=this.forceDialogOpen||false;if(!this.preview&&h.step==="finish"){v()}h.step="customer-info";z();p();(t=(e=R.checkoutSettings).onClose)===null||t===void 0?void 0:t.call(e);return[2]}))}))};o.prototype.buildCartAndInit=function(){return __awaiter(this,void 0,void 0,(function(){var o,e,t,n,s,r,c,a,s,u,c,a,a,d,l,c,f;return __generator(this,(function(v){switch(v.label){case 0:if(!(typeof R.checkoutSettings.createCartId==="function"))return[3,4];F('"createCartId" is provided, start building cart');return[4,R.checkoutSettings.createCartId()];case 1:o=v.sent();e=void 0;if(typeof o==="object"){F("object detected, use cartId and prefill address from createCartId");e=o.cartId;this.useShippingDataFromCreateCartId(o.shippingData)}else{e=o}window.Zonos.cartId=e;return[4,no(e)];case 2:t=v.sent();n=t===null||t===void 0?void 0:t.cartData;if(!n){Z("Failed to build cart, please try again.");return[2,false]}window.Zonos.cartData=n;s=this.handleCartExpiredCheck();if(s){return[2,false]}r=co(n),c=r.adjustments,a=r.cartItems;return[4,m({adjustments:c,cartItems:a})];case 3:v.sent();return[3,9];case 4:if(!window.Zonos.cartData)return[3,6];F("tempCartUUID is provided, start building cart");s=this.handleCartExpiredCheck();if(s){return[2,false]}u=co(window.Zonos.cartData),c=u.adjustments,a=u.cartItems;return[4,m({adjustments:c,cartItems:a})];case 5:v.sent();return[3,9];case 6:if(!(R.checkoutSettings.buildCartDetail&&i.selectedCountryCode))return[3,9];F("build cart detail");return[4,R.checkoutSettings.buildCartDetail({countryCode:i.selectedCountryCode,currencyCode:i.targetCurrency})];case 7:a=v.sent();d=a.filter((function(o){return o.amount>=0}));l=a.filter((function(o){return o.amount<0}));c=l.map((function(o){return{amount:o.amount,currencyCode:o.currencyCode,description:o.name||o.description||"",productId:o.productId||null,sku:o.sku||null,type:"CART_TOTAL"}}));return[4,m({adjustments:c,cartItems:d})];case 8:v.sent();v.label=9;case 9:if(!!h.checkoutSessionId)return[3,11];return[4,g()];case 10:f=v.sent();F("stripeStoreInitCheckoutSession: ".concat(f));if(!f){return[2,false]}v.label=11;case 11:if(!h.isStagingMode){void k()}return[4,this.applyStripeTheme()];case 12:v.sent();this.isRedirectAfterOrder=R.checkoutSettings.successBehavior==="REDIRECT_TO_SUCCESS_PAGE"||!!h.externalConfirmationPageURL;return[2,true]}}))}))};o.prototype.reloadCheckoutSession=function(){window.location.reload()};o.prototype.handleOrderDuplication=function(){var o=W(localStorage.getItem("zonos--placed-order-info"));if(!o){localStorage.removeItem("zonos--placed-order-info");return}var e=Date.now()-o.time;F("=== Existing placed order info: ".concat(o.orderId," - ").concat(this.formatDate(o.time)," - elapsed in hh:ss format: ").concat(new Date(e).toISOString().substring(11,8)),"warn");var t=parseFloat(new URLSearchParams(window.location.search).get("zonosOverrideExpiredDuplication")||"0")||wo;if(e>t){F("=== Existing placed order info is older than ".concat(t,"ms, cleaning localStorage"),"warn");localStorage.removeItem("zonos--placed-order-info");return}this.placedOrderInfo=o;F("=== Showing order duplication confirmation","warn")};o.prototype.confirmProceedWithOrderDuplication=function(){this.placedOrderInfo=null;if(!h.checkoutSessionId){return}void H("/api/zonos-elements/update-checkout-session-metadata",{body:{id:h.checkoutSessionId,metadata:[{key:"orderDuplicationConsent",value:"1"}]},method:"POST"})};o.prototype.handleCancelOrderDuplication=function(){var o;this.placedOrderInfo=null;if(this.isLegacyCheckout){var e=(o=window.Zonos.cartData)===null||o===void 0?void 0:o.storeBaseUrl;if(!e){return}if(window.parent){window.parent.location.href=e}window.location.href=e;return}void this.closeDialogHandler({confirmed:true})};o.prototype.attachCheckout=function(){var o=this;var e=R.checkoutSettings.placeOrderButtonSelector;F("attach checkout ".concat(e));if(!e&&!window.Zonos.cartData){return}var t=[e,"#".concat(so),"#".concat(to)].filter(Boolean);var n=document.querySelectorAll(t.join(","));n.forEach((function(t){var n=t.getAttribute("data-zonos-checkout-attached");if(n){return}F("attached event to button ".concat(e),"info",{button:t});t.addEventListener("click",(function(e){return __awaiter(o,void 0,void 0,(function(){var o,t,n,s,i;return __generator(this,(function(r){switch(r.label){case 0:if(!window.Zonos.isLegacyCheckout&&(!lo()||uo())){return[2]}e.preventDefault();e.stopPropagation();F("zonos checkout button clicked");return[4,this.checkStripePaymentIntentStatus({triggeredButton:e.target})];case 1:t=r.sent().shouldAllowOrder;if(!t){return[2]}f.isFetchingSession=true;this.open=true;r.label=2;case 2:r.trys.push([2,5,,6]);return[4,this.buildCartAndInit()];case 3:n=r.sent();if(this.isCartExpired){throw new Error("This shopping cart is expired")}if(!n){throw new Error("Error building cart")}w({isPreview:this.preview,sessionTimeout:ko});return[4,ao()];case 4:s=r.sent().enabled;h.shouldHideDiscountInput=!s;L("zonos-checkout-start");void b("checkout_open");this.handleOrderDuplication();if(window.Zonos.isLegacyCheckout){void vo()}return[3,6];case 5:i=r.sent();f.isFetchingSession=false;Z(i);if(this.isCartExpired){return[2]}void G({endpoint:"Error creating Checkout",errors:[i instanceof Error?i.toString():"Unknown error"],metadata:{allLogs:q,cartId:window.Zonos.cartId,checkoutSessionBody:y(),href:window.location.href,storeBaseUrl:(o=window.Zonos.cartData)===null||o===void 0?void 0:o.storeBaseUrl}});C({messages:[x("There's been an error creating your checkout session. Please reload and try again or contact support if the error persists")],title:x("Error creating Checkout")});return[3,6];case 6:return[2]}}))}))}),{capture:true,passive:false});if(!R.checkoutSettings.disablePlaceOrderButtonActivation){t.removeAttribute("disabled")}t.setAttribute("data-zonos-checkout-attached","true");if(t.matches(so)){t.dispatchEvent(X("click"));a();t.remove()}if(t.matches("#".concat(to))){t.dispatchEvent(X("click"));t.remove()}}))};o.prototype.appearanceSettingsOverrideChanged=function(){if(!this.appearanceSettingsOverride){return}void this.applyStripeTheme()};o.prototype.useShippingDataFromCreateCartId=function(o){if(!o){return}F("shipping data from createCartId result","info",Object.entries(o));var e=o.customerAddress1,t=o.customerAddress2,n=o.customerCity,s=o.customerCountry,r=o.customerEmail,c=o.customerName,a=o.customerPhone,u=o.customerState,d=o.customerZip;var l=new URLSearchParams(window.location.search);var h=s||_(l)||i.selectedCountryCode;this.applyPrefillAddress({customerAddress1:e,customerAddress2:t,customerCity:n,customerCountry:h,customerEmail:r,customerName:c,customerPhone:a,customerState:u,customerZip:d})};o.prototype.useLegacyQueryParams=function(){var o=new URLSearchParams(window.location.search);F("legacy urlParams","info",Object.fromEntries(o.entries()));var e=function(e){var t=o.get(e);if(!t||t==="undefined"){return null}return t};var t=_(o)||i.selectedCountryCode;var n=e("customerCity");var s=e("customerEmail");var r=e("customerAddress1");var c=e("customerAddress2");var a=e("customerName");var u=e("customerPhone");var d=e("customerZip");var l=e("customerState");this.applyPrefillAddress({customerAddress1:r,customerAddress2:c,customerCity:n,customerCountry:t,customerEmail:s,customerName:a,customerPhone:u,customerState:l,customerZip:d})};o.prototype.applyPrefillAddress=function(o){var e=o.customerAddress1||"";var t=o.customerCountry||"";var n=o.customerAddress2||"";var s=o.customerCity||"";var i=o.customerEmail||"";var r=o.customerName||"";var c=o.customerPhone||"";var a=o.customerZip||"";var u=o.customerState||"";if(!e||!r||!c||!t){F("Missing required query params so it can not be prefilled","info",[!e&&"line1",!r&&"name",!c&&"phone",!t&&"country"].filter(Boolean).join(", "));return}this.defaultAddressParams={address:{city:s||"",country:t,line1:e,line2:n,postal_code:a,state:u},email:i,name:r,phone:c};F("Prefill address applied","info",{prefillAddress:this.defaultAddressParams,providedAddress:o})};o.prototype.overrideStagingModeChanged=function(){h.isStagingMode=!!this.overrideStagingMode};o.prototype.init=function(){return __awaiter(this,void 0,void 0,(function(){var o;var e=this;return __generator(this,(function(t){f.stripe=window.Zonos.stripe;this.stripe=window.Zonos.stripe;h.isStagingMode=Y();if(typeof this.overrideStagingMode!=="undefined"){h.isStagingMode=this.overrideStagingMode}ho({domesticRedirectedBtnSelector:so,onShippingAddressSessionFound:function(o){e.defaultAddress={address:{city:o.city,country:o.countryCode,line1:o.address1,line2:o.address2,postal_code:o.postalCode,state:o.state},email:"",name:"".concat(o.firstName," ").concat(o.lastName),phone:o.phone}}});if(window.Zonos){this.useLegacyQueryParams()}o=setInterval((function(){f.stripe=window.Zonos.stripe;e.stripe=window.Zonos.stripe;if(!e.stripe){F("waiting for stripe to be loaded");return}if(e.storybookPaymentStatusOverride){clearInterval(o);return}F("init checkout");if(e.preview||e.forceDialogOpen){void e.buildCartAndInit()}else if(window.Zonos.isLegacyCheckout){e.attachCheckout()}else if(window){e.attachCheckout();var t=new MutationObserver((function(){e.attachCheckout()}));t.observe(document.body,{childList:true,subtree:true})}clearInterval(o)}),50);setTimeout((function(){clearInterval(o)}),1e4);return[2]}))}))};o.prototype.setToFinishStep=function(o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){h.step="finish";this.storybookPaymentStatusOverride=o;return[2]}))}))};o.prototype.mockCheckoutSession=function(o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){S(o);return[2]}))}))};o.prototype.handleCustomerInfoContinue=function(){return __awaiter(this,void 0,void 0,(function(){var o;var e=this;return __generator(this,(function(t){switch(t.label){case 0:this.submitLoading=true;return[4,A()];case 1:t.sent();o=setInterval((function(){if(h.landedCostData||!f.isFetchingLandedCost){if(h.landedCostData){void D({currency:h.currency});O()}e.submitLoading=false;clearInterval(o)}}),500);return[2]}}))}))};o.prototype.handleShippingContinue=function(){return __awaiter(this,void 0,void 0,(function(){var o=this;return __generator(this,(function(e){this.submitLoading=true;setTimeout((function(){O();o.submitLoading=false}),500);return[2]}))}))};o.prototype.handleInventoryCheckDialogConfirm=function(){h.inventoryCheckErrorMessage=null;if(!this.isLegacyCheckout){void this.closeDialogHandler({confirmed:true})}};o.prototype.handleCartExpiredDialogConfirm=function(){var o;this.isCartExpired=false;if(this.isLegacyCheckout){var e=(o=window.Zonos.cartData)===null||o===void 0?void 0:o.storeBaseUrl;if(!e){return}if(window.parent){window.parent.location.href=e}window.location.href=e;return}if(window.parent){window.parent.location.href=window.location.href}window.location.reload()};o.prototype.handleStripePaymentContinue=function(){return __awaiter(this,void 0,void 0,(function(){var o,e,t;return __generator(this,(function(n){switch(n.label){case 0:N.paypalErrorMessage=null;f.hasPaymentError=false;this.submitLoading=true;h.inventoryCheckErrorMessage=null;n.label=1;case 1:n.trys.push([1,3,,4]);o=h;return[4,I()];case 2:o.inventoryCheckErrorMessage=n.sent();return[3,4];case 3:e=n.sent();h.inventoryCheckErrorMessage=x("Unable to check inventory. Please try again.");return[3,4];case 4:if(h.inventoryCheckErrorMessage){this.submitLoading=false;return[2]}n.label=5;case 5:n.trys.push([5,7,,8]);return[4,T()];case 6:n.sent();O();p();return[3,8];case 7:t=n.sent();Z(t);L("zonos-checkout-payment-fail");f.hasPaymentError=true;if(f.shouldInventoryRefund){void j();f.shouldInventoryRefund=false}return[3,8];case 8:this.submitLoading=false;return[2]}}))}))};o.prototype.handleFinishClick=function(){return __awaiter(this,void 0,void 0,(function(){var o,e,t,n;return __generator(this,(function(s){switch(s.label){case 0:P();if(!this.preview)return[3,2];h.step="customer-info";return[4,this.init()];case 1:s.sent();return[2];case 2:v();if(window.Zonos.isLegacyCheckout&&window.Zonos.cartData){o=window.Zonos.cartData.storeBaseUrl;if(window.parent){window.parent.location.href=o}window.location.href=o;return[2]}e=window.location.href;t=e.split("?")[0];this.open=false;n=window.location.hostname.includes("dashboard.zonos.com");if(!n){window.history.replaceState(window.history.state,document.title,t);window.location.reload()}return[2]}}))}))};o.prototype.handleWindowResize=function(){this.isMobile=J(this.mobile);void this.applyStripeTheme();F("mobile: ".concat(this.isMobile))};o.prototype.handleMobileChange=function(){this.isMobile=J(this.mobile);void this.applyStripeTheme();F("mobile: ".concat(this.isMobile))};o.prototype.handleAppearanceSettingsOverrideChange=function(){var o;if((o=this.appearanceSettingsOverride)===null||o===void 0?void 0:o.theme){this.appearanceSettingsOverride.theme=U(this.appearanceSettingsOverride.theme)}};o.prototype.handleAddressChange=function(){P()};o.prototype.handleClientSecretChange=function(){void this.applyStripeTheme()};o.prototype.handleOpenChange=function(){var o="data-zonos-overflow-origin";var e=document.body;var t=document.documentElement;if(this.open){if(e.style.overflow){e.setAttribute(o,e.style.overflow)}e.style.overflow="hidden";if(t.style.overflow){t.setAttribute(o,t.style.overflow)}t.style.overflow="hidden"}else{var n=e.getAttribute(o);var s=t.getAttribute(o);if(n){e.removeAttribute(o);e.style.overflow=n}else{e.style.removeProperty("overflow")}if(s){t.removeAttribute(o);t.style.overflow=s}else{t.style.removeProperty("overflow")}}};o.prototype.componentWillLoad=function(){var o=this;void this.init();this.isMobile=J(this.mobile);this.isIframed=window.self!==window.top;F("iframed: ".concat(this.isIframed));this.handleAppearanceSettingsOverrideChange();this.onChangeLocaleListener=E("selectedLocale",(function(){void o.applyStripeTheme()}));F("mobile: ".concat(this.isMobile))};o.prototype.disconnectedCallback=function(){P();v();this.onChangeLocaleListener()};o.prototype.render=function(){var o=this;var e,r,c,a;this.clientSecret=f.clientSecret;var u=h.step!=="finish"&&h.step!=="error"&&!f.stripeElements||f.isFetchingSession;var d=M(R.appearance,this.appearanceSettingsOverride||null),l=d.colorPrimary,m=d.colorSecondary,v=d.logoUrl,z=d.style;var p=R.appearance.zonosAttribution==="ENABLED";var g=R.appearance.theme;var k=l&&oo(l)?"DARK":"LIGHT";var w=this.isMobile?g:k;var b=!this.isMobile?m:undefined;var y=i.customMessages;var C=(e=y.find((function(o){return o.pageName==="checkout_default"})))===null||e===void 0?void 0:e.message;var _=this.getCurrentLocalePageEnum();var S=y.filter((function(o){return o.pageName===_}));var A=function(){var e=o.preview?"".concat(v,"?timestamp=").concat(Date.now()):v;return t("div",{class:"zonos--logo"},e&&t("img",{alt:"".concat(R.organizationName," logo"),src:e}))};var O=K();var I=function(){var e=new URLSearchParams(window.location.search);var n=e.get("zonosQaUrl");var s=e.get("zonosDebug");var i=e.get("zonosE2ETest");var r=o.overrideStagingMode||Y();return t("zonos-v-stack",null,t("div",{class:"zonos--logo-wrapper"},A(),O&&t("zonos-badge",{badgeColor:"orange",size:"small"},x("Test mode")),r&&t("zonos-badge",{badgeColor:"red",size:"small"},x("Staging mode")),s==="1"&&t("zonos-badge",{badgeColor:"cyan",size:"small"},"debug"),n&&t("zonos-badge",{badgeColor:"purple",size:"small"},n),i&&t("zonos-badge",{badgeColor:"gray",size:"small"},"E2E Test")),t("zonos-checkout-progress-tabs",{backgroundColor:o.isMobile?"--zonos-elements-gray-0":null}),S.map((function(o){return t("zonos-custom-message",{icon:zo,message:o.message})})))};var T=function(){if(h.checkoutSessionTimeoutShow){return t("zonos-rest-state",{class:"zonos--session-timeout",restStateSubtitle:x("Your checkout session has expired. Please reload the page to continue."),restStateTitle:x("Session timed out"),restStateType:"Warning"},t("zonos-button",{onClick:function(){return o.reloadCheckoutSession()},variant:"primary"},x("Reload")))}return t("div",{class:"zonos--content",style:{"--zonos--border-radius":$({overrideBorderStyle:z})}},h.step!=="finish"&&h.step!=="error"&&t(s,null,t("div",{class:"zonos--left","data-theme":w,style:eo({"--zonos--primary-color":!o.isMobile?l:undefined})},!o.isMobile&&I(),h.step==="customer-info"&&t("zonos-customer-info",{continueLoading:o.submitLoading,defaultAddress:o.defaultAddress||o.defaultAddressParams,isMobile:o.isMobile,onContinueClicked:function(){return o.handleCustomerInfoContinue()},submitBtnColor:b}),h.step==="shipping"&&t("zonos-shipping",{continueLoading:o.submitLoading,onContinueClicked:function(){return o.handleShippingContinue()},submitBtnColor:b}),h.step==="payment"&&t("zonos-checkout-payment",{continueLoading:o.submitLoading,isMobile:o.isMobile,onContinueClicked:function(){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:return[4,this.handleStripePaymentContinue()];case 1:o.sent();return[2]}}))}))},submitBtnColor:b})),t("div",{class:"zonos--right","data-theme":g},o.isMobile&&I(),t("div",{class:"zonos--right-actions"},window.Zonos.showBaseForeign&&t("zonos-currency-toggle",null),!o.isLegacyCheckout&&t("zonos-button",{class:"zonos--close-button",icon:t("zonos-icon",{"aria-label":"Close checkout dialog",content:io}),noBackground:true,onClick:function(){return o.closeDialogHandler()}})),t("div",{class:"flex--wrapper"},t("div",{class:"zonos--wrapper"},t("zonos-review",{collapsed:o.collapseReviewMobile,mobile:o.isMobile,onClick:function(){if(!o.isMobile){return}o.collapseReviewMobile=!o.collapseReviewMobile}}),t("zonos-collapse",{collapsed:o.collapseReviewMobile&&o.isMobile},t("zonos-cart-items",null),o.isMobile&&t("zonos-v-stack",{spacing:16},t("zonos-cart-subtotal",{submitBtnColor:b}),t("zonos-custom-message",{class:"zonos--checkout-default-message",icon:zo,message:C})))),t("zonos-cart-restricted-items",null),!o.isMobile&&t("zonos-v-stack",{spacing:16},t("zonos-cart-subtotal",null),t("zonos-custom-message",{class:"zonos--checkout-default-message",icon:zo,message:C}))))),(h.step==="finish"||h.step==="error")&&t("div",{class:"zonos--done","data-theme":g},t("div",{class:"zonos--header"},A(),!o.isRedirectAfterOrder&&t("zonos-button",{class:"zonos--close-button",icon:t("zonos-icon",{"aria-label":"Close checkout dialog",content:io}),noBackground:true,onClick:function(){return o.handleFinishClick()},theme:g})),t("zonos-checkout-finish",{borderRadius:z,onCloseClick:function(){return o.handleFinishClick()},overrideNotification:h.step==="error"&&!!h.error?Object.assign(Object.assign({},h.error),{type:"error"}):undefined,storybookForceStatus:o.storybookPaymentStatusOverride})),t("zonos-checkout-footer",{"data-theme":g,mobile:o.isMobile,slot:!o.isMobile?"dialog-footer":undefined}))};return t(n,{class:Q(["zonos--checkout zonos--elements",p&&"has-footer",this.preview&&"preview",this.isMobile&&"mobile",this.isIframed&&"iframed"])},this.preview?T():t("zonos-dialog",{borderStyle:z,"data-theme":g,height:"980px",isLoading:u,mobile:this.isMobile,noBodyPadding:true,noBorder:true,noClickOutside:true,noCloseButton:true,onCloseDialog:function(){return o.closeDialogHandler()},open:this.open,width:"1200px"},T()),t("zonos-confirm-dialog",{class:"zonos--close-confirm-dialog",dialogCancelBtnText:x("Don't close"),dialogConfirmBtnText:x("Close"),dialogIntent:"warn",dialogOpen:this.confirmDialogOpen,dialogSubtitle:x("Would you like to close checkout and return to the site?"),dialogTitle:x("Are you sure?"),onCancelClicked:function(){o.confirmDialogOpen=false},onConfirmClicked:function(){return o.closeDialogHandler({confirmed:true})}}),t("zonos-confirm-dialog",{class:"zonos--order-duplication-dialog",dialogCancelBtnText:x("Return to merchant site"),dialogConfirmBtnText:x("Proceed with order"),dialogIntent:"warn",dialogOpen:!!this.placedOrderInfo,dialogSubtitle:((r=this.placedOrderInfo)===null||r===void 0?void 0:r.zonosOrderNumber)?x("It looks like you placed an order recently ([date] at [time]) under order number #[orderNumber]. Check your email for the order confirmation. Are you sure you want to place another order?",{date:this.formatDate(this.placedOrderInfo.time),orderNumber:this.placedOrderInfo.zonosOrderNumber,time:this.formatTime(this.placedOrderInfo.time)}):x("It looks like you placed an order recently ([date] at [time]). Check your email for the order confirmation. Are you sure you want to place another one?",{date:this.formatDate(((c=this.placedOrderInfo)===null||c===void 0?void 0:c.time)||null),time:this.formatTime(((a=this.placedOrderInfo)===null||a===void 0?void 0:a.time)||null)}),dialogTitle:x("Are you sure?"),dialogWidth:530,onCancelClicked:function(){o.handleCancelOrderDuplication()},onConfirmClicked:function(){o.confirmProceedWithOrderDuplication()}}),t("zonos-confirm-dialog",{class:"zonos--inventory-check-failure-dialog",dialogConfirmBtnText:x("Return to cart"),dialogIntent:"danger",dialogOpen:!!h.inventoryCheckErrorMessage,dialogSubtitle:h.inventoryCheckErrorMessage,dialogTitle:x("Couldn't place order"),dialogType:"alert",onConfirmClicked:function(){return o.handleInventoryCheckDialogConfirm()}}),t("zonos-confirm-dialog",{class:"zonos--shopping-cart-expired-dialog",dialogConfirmBtnText:x("OK"),dialogIntent:"danger",dialogOpen:this.isCartExpired,dialogSubtitle:x("You are being sent back to the shop to re-add items to your cart."),dialogTitle:x("Shopping cart expired"),dialogType:"alert",onConfirmClicked:function(){return o.handleCartExpiredDialogConfirm()}}))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});Object.defineProperty(o,"watchers",{get:function(){return{appearanceSettingsOverride:["appearanceSettingsOverrideChanged","handleAppearanceSettingsOverrideChange"],overrideStagingMode:["overrideStagingModeChanged"],mobile:["handleMobileChange"],defaultAddress:["handleAddressChange"],clientSecret:["handleClientSecretChange"],open:["handleOpenChange"]}},enumerable:false,configurable:true});return o}());bo.style=go}}}));
@@ -0,0 +1 @@
1
+ import{g as t,h as a,l as s,b as e}from"./p-f0c8150e.js";const r=async({cartId:e,retries:o})=>{const i=t(),{errors:n,json:d}=await a("/api/zonos-elements/get-temp-cart",{body:{isTestMode:i,options:{noOnlineStoreSettings:!0},tempCartUUID:e},headers:{"Content-Type":"application/json"},method:"POST"}),c=!d||n.length;return c&&o?(s("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:o}),await new Promise((t=>setTimeout(t,500))),r({cartId:e,retries:o-1})):c?null:d},o=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/,i=new RegExp(`^${o.source}$`),n=new RegExp(`^cart_${o.source}$`),d=/^[a-zA-Z0-9]{2,}$/,c=/^cart_[a-zA-Z0-9]{2,}$/,g=async t=>{const{isDgsCartId:a,isLegacyCartId:o}=(t=>t?t.includes("undefined")?{isDgsCartId:!1,isLegacyCartId:!1}:c.test(t)?{isDgsCartId:!0,isLegacyCartId:!1}:d.test(t)?{isDgsCartId:!1,isLegacyCartId:!0}:n.test(t)?{isDgsCartId:!0,isLegacyCartId:!1}:i.test(t)?{isDgsCartId:!1,isLegacyCartId:!0}:{isDgsCartId:!1,isLegacyCartId:!1}:{isDgsCartId:!1,isLegacyCartId:!1})(t);if(!o&&!a)return e("[ZONOS - loadZonos] invalid cart id"),null;const g=await r({cartId:t,retries:5});return s("[ZONOS - loadZonos] getting temp cart data","info",g),g?(window.Zonos.storeId=g.cartData.storeId,window.Zonos.zonosApiKey=g.cartData.credentialToken,{cartData:g.cartData,storeFavicon:g.storeFaviconUrl,storeId:g.cartData.storeId,storeLogo:g.storeLogoUrl,zonosApiKey:g.cartData.credentialToken}):(e("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),null)},I="zonos--checkout-hidden-button",p="zonos--domestic-redirected-checkout-button";export{I as c,p as d,g as s}
@@ -1 +1 @@
1
- import{p as e,b as o}from"./p-ab68ad11.js";export{s as setNonce}from"./p-ab68ad11.js";import{g as t}from"./p-e1255160.js";(()=>{const o=import.meta.url,t={};return""!==o&&(t.resourcesUrl=new URL(".",o).href),e(t)})().then((async e=>(await t(),o(JSON.parse('[["p-353b2453",[[2,"zonos-checkout",{"appearanceSettingsOverride":[16],"preview":[4],"mobile":[4],"overrideStagingMode":[4,"override-staging-mode"],"defaultAddress":[16],"forceDialogOpen":[4,"force-dialog-open"],"defaultAddressParams":[32],"open":[32],"stripe":[32],"submitLoading":[32],"collapseReviewMobile":[32],"isAttachError":[32],"isMobile":[32],"isIframed":[32],"zonosReviewRef":[32],"storybookPaymentStatusOverride":[32],"isLegacyCheckout":[32],"confirmDialogOpen":[32],"isCartExpired":[32],"inventoryCheckErrorMessage":[32],"placedOrderInfo":[32],"clientSecret":[32],"closeDialogHandler":[64],"init":[64],"setToFinishStep":[64],"mockCheckoutSession":[64]},[[16,"zonos--init-cart-info","initCartInfoHandler"],[4,"keydown","handleKeyPress"],[9,"resize","handleWindowResize"]],{"appearanceSettingsOverride":["appearanceSettingsOverrideChanged","handleAppearanceSettingsOverrideChange"],"overrideStagingMode":["overrideStagingModeChanged"],"mobile":["handleMobileChange"],"defaultAddress":["handleAddressChange"],"clientSecret":["handleClientSecretChange"],"open":["handleOpenChange"]}]]],["p-3ea350e8",[[1,"zonos-hello",{"mobileLocationOverride":[1,"mobile-location-override"],"animateFromLeftOverride":[4,"animate-from-left-override"],"appearanceSettingsOverride":[16],"showPeekMessage":[32],"zonosStoreHelloSettings":[32],"showDialog":[32],"peekMessage":[32],"initialUrl":[32],"allRestrictedItems":[32],"allFoundProducts":[32],"productsOnPage":[32],"isHelloWidgetRendered":[32],"isMobile":[32],"getCountryList":[64],"displayCurrency":[64],"convertAndFormat":[64],"convert":[64],"format":[64],"openHelloDialog":[64]},[[9,"resize","handleResize"]],{"appearanceSettingsOverride":["handleAppearanceSettingsOverrideChange"]}]]],["p-43b8406e",[[1,"zonos-controller",{"config":[16],"zonosApiKey":[1,"zonos-api-key"],"initCheckoutElement":[64],"setupGoogleFont":[64],"showNotification":[64],"reset":[64],"overrideConfig":[64],"overrideCountry":[64],"getAppearanceSetting":[64],"updateOrganizationName":[64]},[[8,"locationchange","handleLocationChange"]]]]],["p-69f84611",[[1,"zonos-tooltip",{"label":[1],"subtitle":[1],"showTooltip":[32]}]]],["p-db3f381d",[[1,"zonos-component",{"first":[1],"middle":[1],"last":[1]}]]],["p-de221545",[[1,"zonos-link",{"href":[1],"rel":[1],"target":[1],"linkTitle":[1,"link-title"]}]]],["p-cbd5d932",[[1,"zonos-logo",{"theme":[1],"width":[1]}]]],["p-3e20fb8f",[[1,"zonos-hello-dialog",{"isOpen":[4,"is-open"],"setIsOpen":[16],"mobileLocationOverride":[1,"mobile-location-override"],"animateFromLeftOverride":[4,"animate-from-left-override"],"appearanceSettings":[16],"restrictedItems":[16],"welcomeMessage":[32],"showCountrySelect":[32],"showLanguageSelect":[32]},[[4,"click","globalClickHandler"]],{"isOpen":["isOpenHandler"]}]]],["p-b288c2ed",[[1,"zonos-badge",{"bold":[4],"badgeColor":[1,"badge-color"],"icon":[16],"iconRight":[4,"icon-right"],"size":[1],"rounded":[4],"loading":[4],"dismissHandler":[16]}]]],["p-b5c360af",[[1,"zonos-shipping-rich-radio",{"items":[16],"borderColor":[1,"border-color"],"borderStyle":[1,"border-style"],"theme":[1],"selectedItem":[16]}]]],["p-0028d158",[[1,"zonos-toggle",{"options":[16],"value":[1]}]]],["p-7f288336",[[1,"zonos-collapse",{"collapsed":[4],"collapseSize":[2,"collapse-size"],"height":[32],"iframe":[32]}]]],["p-36f97fd9",[[1,"zonos-card",{"actions":[16],"backgroundColor":[1,"background-color"],"borderRadius":[2,"border-radius"],"footerActions":[16],"footerContent":[16],"footerHeight":[2,"footer-height"],"label":[16],"spacing":[1]}]]],["p-cdfca133",[[1,"zonos-input",{"inputValue":[1,"input-value"],"inputLabel":[1,"input-label"],"inputSize":[1,"input-size"],"isDisabled":[4,"is-disabled"],"isError":[4,"is-error"],"inputPlaceholder":[1,"input-placeholder"],"value":[32]},null,{"inputValue":["onInputValueChange"]}]]],["p-709c7e9e",[[1,"zonos-text",{"textColor":[1,"text-color"],"size":[1],"type":[1],"weight":[2],"ready":[32]}]]],["p-d2f2c685",[[1,"zonos-banner",{"bannerTitle":[1,"banner-title"],"intent":[1],"hasContent":[32]}]]],["p-8cb90d9e",[[1,"zonos-country-flag",{"countryCode":[1,"country-code"],"size":[2]}]]],["p-05013308",[[1,"zonos-v-stack",{"spacing":[2]}]]],["p-c94d82fb",[[1,"zonos-empty-state-payment",{"emptyStateText":[1,"empty-state-text"],"theme":[1]}],[2,"zonos-payment",{"titleText":[1,"title-text"],"stripe":[32],"stripeElements":[32]},null,{"stripeElements":["watchInitStripe"],"stripe":["watchInitStripe"]}],[2,"zonos-paypal-payment"],[1,"zonos-notification",{"notificationArray":[32],"showNotification":[64]}]]],["p-b12fbc07",[[17,"zonos-button",{"buttonColor":[1,"button-color"],"backgroundColor":[1,"background-color"],"borderStyle":[1,"border-style"],"isDisabled":[4,"is-disabled"],"icon":[16],"iconRight":[4,"icon-right"],"size":[1],"variant":[1],"noBackground":[4,"no-background"],"withBoxShadow":[4,"with-box-shadow"],"noPaddingLeft":[4,"no-padding-left"],"noPaddingRight":[4,"no-padding-right"],"loading":[4],"justifyContent":[1,"justify-content"],"theme":[1],"hasIcon":[32],"hasContent":[32]},[[2,"click","clickHandler"]],{"icon":["iconChangeHandler"]}],[1,"zonos-spinner",{"size":[2],"spinnerColor":[1,"spinner-color"]}],[1,"zonos-icon",{"autoHeight":[4,"auto-height"],"iconColor":[1,"icon-color"],"content":[1],"size":[2]}]]],["p-7c7f0c32",[[1,"zonos-language-select",{"handleOnClose":[16]}],[1,"zonos-select-dialog-header",{"handleOnClose":[16],"label":[1]}]]],["p-5d9c5413",[[1,"zonos-country-select",{"handleOnClose":[16],"inputValue":[32]}],[1,"zonos-hello-dialog-footer",{"appearanceSettings":[16],"setShowCountrySelect":[16],"setShowLanguageSelect":[16]}],[1,"zonos-custom-message",{"icon":[1],"message":[1]}],[2,"zonos-virtual-scroll",{"renderItem":[16],"itemWidth":[2,"item-width"],"fallbackItemHeight":[2,"fallback-item-height"],"itemHeights":[16],"container":[32],"scrollTop":[32],"totalHeight":[32]},null,{"itemHeights":["updateTotalHeight"],"fallbackItemHeight":["updateTotalHeight"]}]]],["p-dec30fa4",[[1,"zonos-address-update-dialog",{"continueLoading":[4,"continue-loading"],"dialogLoading":[4,"dialog-loading"],"dialogOpen":[4,"dialog-open"],"submitBtnType":[1,"submit-btn-type"],"submitBtnColor":[1,"submit-btn-color"],"isMobile":[4,"is-mobile"],"shippingAddress":[16],"billingAddress":[16],"translatedShippingAddress":[16],"translatedBillingAddress":[16],"showErrorBanner":[32],"translatedShippingAddressState":[32],"translatedBillingAddressState":[32]},null,{"translatedShippingAddress":["watchTranslatedShippingAddress"],"translatedBillingAddress":["watchTranslatedBillingAddress"]}],[2,"zonos-link-authentication",{"titleText":[1,"title-text"],"defaultEmail":[1,"default-email"],"isEmailError":[4,"is-email-error"],"stripe":[32],"isStagingMode":[32],"clientSecret":[32]},null,{"isStagingMode":["watchIsStagingMode"],"stripe":["watchInitStripe"],"clientSecret":["watchInitStripe"],"defaultEmail":["watchDefaultEmail"]}],[2,"zonos-address",{"type":[1],"titleText":[1,"title-text"],"defaultAddress":[16],"stripe":[32],"isDirtyAddress":[32]},null,{"stripe":["watchInitStripe"]}],[1,"zonos-checkbox",{"backgroundColor":[1,"background-color"],"label":[1],"isChecked":[4,"is-checked"],"isDisabled":[4,"is-disabled"],"size":[2],"fontSize":[1,"font-size"],"borderStyle":[1,"border-style"]},[[1,"click","onClick"]]],[1,"zonos-dialog",{"open":[4],"headerText":[1,"header-text"],"width":[1],"height":[1],"minHeight":[1,"min-height"],"noHeader":[4,"no-header"],"noBodyPadding":[4,"no-body-padding"],"noBorder":[4,"no-border"],"borderStyle":[1,"border-style"],"noCloseButton":[4,"no-close-button"],"noClickOutside":[4,"no-click-outside"],"mobile":[4],"isLoading":[4,"is-loading"],"isMobile":[32]},[[9,"resize","handleWindowResize"],[4,"keydown","handleKeyDown"]]],[1,"zonos-address-display",{"currentAddress":[16],"addressType":[1,"address-type"]}],[1,"zonos-address-form",{"currentAddress":[16],"translatedAddress":[16],"addressType":[1,"address-type"],"localAddress":[32]},null,{"translatedAddress":["watchCurrentAddress"]}],[1,"zonos-stripe-input",{"inputValue":[1,"input-value"],"inputLabel":[1,"input-label"],"overridePrimaryColor":[1,"override-primary-color"],"overrideSecondaryColor":[1,"override-secondary-color"],"isDisabled":[4,"is-disabled"],"isError":[4,"is-error"],"inputPlaceholder":[1,"input-placeholder"],"value":[1025],"internalValue":[32]},null,{"inputValue":["onInputValueChange"],"value":["onValueChange"]}]]],["p-3e3e7800",[[2,"zonos-customer-info",{"continueLoading":[4,"continue-loading"],"submitBtnType":[1,"submit-btn-type"],"submitBtnColor":[1,"submit-btn-color"],"isMobile":[4,"is-mobile"],"defaultAddress":[16],"showErrorBanner":[32],"shippingCountry":[32],"isCheckingForRestrictedItems":[32],"isValidatingAddress":[32],"isTaxIdError":[32],"invalidShippingCharacterList":[32],"invalidBillingCharacterList":[32],"openAddressValidationDialog":[32],"isEmailError":[32]}],[2,"zonos-checkout-payment",{"submitBtnType":[1,"submit-btn-type"],"continueLoading":[4,"continue-loading"],"submitBtnColor":[1,"submit-btn-color"],"isMobile":[4,"is-mobile"],"overridePrimaryColor":[1,"override-primary-color"],"showErrorBanner":[32],"hasStripePaymentError":[32],"stagingOrderCreateErrorMessage":[32],"internalContinueLoading":[32]},null,{"continueLoading":["continueLoadingWatcher"],"hasStripePaymentError":["stripePaymentErrorWatcher"]}],[1,"zonos-checkout-footer",{"mobile":[4],"dataTheme":[1,"data-theme"],"showLanguageDialog":[32],"isMobile":[32]},[[4,"click","handleGlobalClick"]],{"mobile":["handleMobileChange"]}],[2,"zonos-shipping",{"continueLoading":[4,"continue-loading"],"submitBtnColor":[1,"submit-btn-color"],"submitBtnType":[1,"submit-btn-type"],"selectedShippingMethod":[32],"collapsedDAPOptions":[32],"isSelecting":[32],"showErrorBanner":[32],"serviceLevelsDDP":[32],"serviceLevelsDAP":[32],"serviceLevelsOther":[32],"serviceLevelsAll":[32],"displayBaseCurrency":[32]}],[1,"zonos-cart-subtotal",{"submitBtnType":[1,"submit-btn-type"],"submitBtnColor":[1,"submit-btn-color"],"loading":[32]}],[1,"zonos-cart-restricted-items",{"hide":[4],"errorImages":[32],"internalCollapsed":[32],"firstRender":[32]}],[1,"zonos-checkout-finish",{"borderRadius":[1,"border-radius"],"storybookForceStatus":[1,"storybook-force-status"],"overrideNotification":[16],"isLoading":[32],"notificationType":[32],"notificationTitle":[32],"notificationMessages":[32],"notificationActionText":[32],"order":[32],"isWaitingToRedirect":[32]}],[1,"zonos-confirm-dialog",{"dialogTitle":[1,"dialog-title"],"dialogIntent":[1,"dialog-intent"],"dialogSubtitle":[1,"dialog-subtitle"],"submitBtnColor":[1,"submit-btn-color"],"dialogConfirmBtnText":[1,"dialog-confirm-btn-text"],"dialogWidth":[2,"dialog-width"],"dialogCancelBtnText":[1,"dialog-cancel-btn-text"],"dialogType":[1,"dialog-type"],"isMobile":[4,"is-mobile"],"dialogOpen":[4,"dialog-open"],"noClickOutside":[4,"no-click-outside"]},[[4,"keydown","handleKeyDown"]]],[1,"zonos-checkout-progress-tabs",{"tabColor":[1,"tab-color"],"backgroundColor":[1,"background-color"],"setTabItems":[64],"setTabSelected":[64]}],[1,"zonos-review",{"mobile":[4],"collapsed":[4],"isMobile":[32]},[[9,"resize","handleWindowResize"]]],[1,"zonos-cart-items",{"errorImages":[32]}],[1,"zonos-currency-toggle",{"errorImages":[32]}],[1,"zonos-rest-state",{"restStateSubtitle":[1,"rest-state-subtitle"],"restStateTitle":[1,"rest-state-title"],"restStateType":[1,"rest-state-type"],"isErrorImageLoad":[32]}]]]]'),e))));
1
+ import{p as e,b as o}from"./p-ab68ad11.js";export{s as setNonce}from"./p-ab68ad11.js";import{g as t}from"./p-e1255160.js";(()=>{const o=import.meta.url,t={};return""!==o&&(t.resourcesUrl=new URL(".",o).href),e(t)})().then((async e=>(await t(),o(JSON.parse('[["p-764e5c78",[[2,"zonos-checkout",{"appearanceSettingsOverride":[16],"preview":[4],"mobile":[4],"overrideStagingMode":[4,"override-staging-mode"],"defaultAddress":[16],"forceDialogOpen":[4,"force-dialog-open"],"defaultAddressParams":[32],"open":[32],"stripe":[32],"submitLoading":[32],"collapseReviewMobile":[32],"isAttachError":[32],"isMobile":[32],"isIframed":[32],"zonosReviewRef":[32],"storybookPaymentStatusOverride":[32],"isLegacyCheckout":[32],"confirmDialogOpen":[32],"isCartExpired":[32],"inventoryCheckErrorMessage":[32],"placedOrderInfo":[32],"clientSecret":[32],"closeDialogHandler":[64],"init":[64],"setToFinishStep":[64],"mockCheckoutSession":[64]},[[16,"zonos--init-cart-info","initCartInfoHandler"],[4,"keydown","handleKeyPress"],[9,"resize","handleWindowResize"]],{"appearanceSettingsOverride":["appearanceSettingsOverrideChanged","handleAppearanceSettingsOverrideChange"],"overrideStagingMode":["overrideStagingModeChanged"],"mobile":["handleMobileChange"],"defaultAddress":["handleAddressChange"],"clientSecret":["handleClientSecretChange"],"open":["handleOpenChange"]}]]],["p-3ea350e8",[[1,"zonos-hello",{"mobileLocationOverride":[1,"mobile-location-override"],"animateFromLeftOverride":[4,"animate-from-left-override"],"appearanceSettingsOverride":[16],"showPeekMessage":[32],"zonosStoreHelloSettings":[32],"showDialog":[32],"peekMessage":[32],"initialUrl":[32],"allRestrictedItems":[32],"allFoundProducts":[32],"productsOnPage":[32],"isHelloWidgetRendered":[32],"isMobile":[32],"getCountryList":[64],"displayCurrency":[64],"convertAndFormat":[64],"convert":[64],"format":[64],"openHelloDialog":[64]},[[9,"resize","handleResize"]],{"appearanceSettingsOverride":["handleAppearanceSettingsOverrideChange"]}]]],["p-04e53a0f",[[1,"zonos-controller",{"config":[16],"zonosApiKey":[1,"zonos-api-key"],"initCheckoutElement":[64],"setupGoogleFont":[64],"showNotification":[64],"reset":[64],"overrideConfig":[64],"overrideCountry":[64],"getAppearanceSetting":[64],"updateOrganizationName":[64]},[[8,"locationchange","handleLocationChange"]]]]],["p-69f84611",[[1,"zonos-tooltip",{"label":[1],"subtitle":[1],"showTooltip":[32]}]]],["p-db3f381d",[[1,"zonos-component",{"first":[1],"middle":[1],"last":[1]}]]],["p-de221545",[[1,"zonos-link",{"href":[1],"rel":[1],"target":[1],"linkTitle":[1,"link-title"]}]]],["p-cbd5d932",[[1,"zonos-logo",{"theme":[1],"width":[1]}]]],["p-3e20fb8f",[[1,"zonos-hello-dialog",{"isOpen":[4,"is-open"],"setIsOpen":[16],"mobileLocationOverride":[1,"mobile-location-override"],"animateFromLeftOverride":[4,"animate-from-left-override"],"appearanceSettings":[16],"restrictedItems":[16],"welcomeMessage":[32],"showCountrySelect":[32],"showLanguageSelect":[32]},[[4,"click","globalClickHandler"]],{"isOpen":["isOpenHandler"]}]]],["p-b288c2ed",[[1,"zonos-badge",{"bold":[4],"badgeColor":[1,"badge-color"],"icon":[16],"iconRight":[4,"icon-right"],"size":[1],"rounded":[4],"loading":[4],"dismissHandler":[16]}]]],["p-b5c360af",[[1,"zonos-shipping-rich-radio",{"items":[16],"borderColor":[1,"border-color"],"borderStyle":[1,"border-style"],"theme":[1],"selectedItem":[16]}]]],["p-0028d158",[[1,"zonos-toggle",{"options":[16],"value":[1]}]]],["p-7f288336",[[1,"zonos-collapse",{"collapsed":[4],"collapseSize":[2,"collapse-size"],"height":[32],"iframe":[32]}]]],["p-36f97fd9",[[1,"zonos-card",{"actions":[16],"backgroundColor":[1,"background-color"],"borderRadius":[2,"border-radius"],"footerActions":[16],"footerContent":[16],"footerHeight":[2,"footer-height"],"label":[16],"spacing":[1]}]]],["p-cdfca133",[[1,"zonos-input",{"inputValue":[1,"input-value"],"inputLabel":[1,"input-label"],"inputSize":[1,"input-size"],"isDisabled":[4,"is-disabled"],"isError":[4,"is-error"],"inputPlaceholder":[1,"input-placeholder"],"value":[32]},null,{"inputValue":["onInputValueChange"]}]]],["p-709c7e9e",[[1,"zonos-text",{"textColor":[1,"text-color"],"size":[1],"type":[1],"weight":[2],"ready":[32]}]]],["p-d2f2c685",[[1,"zonos-banner",{"bannerTitle":[1,"banner-title"],"intent":[1],"hasContent":[32]}]]],["p-8cb90d9e",[[1,"zonos-country-flag",{"countryCode":[1,"country-code"],"size":[2]}]]],["p-05013308",[[1,"zonos-v-stack",{"spacing":[2]}]]],["p-c94d82fb",[[1,"zonos-empty-state-payment",{"emptyStateText":[1,"empty-state-text"],"theme":[1]}],[2,"zonos-payment",{"titleText":[1,"title-text"],"stripe":[32],"stripeElements":[32]},null,{"stripeElements":["watchInitStripe"],"stripe":["watchInitStripe"]}],[2,"zonos-paypal-payment"],[1,"zonos-notification",{"notificationArray":[32],"showNotification":[64]}]]],["p-b12fbc07",[[17,"zonos-button",{"buttonColor":[1,"button-color"],"backgroundColor":[1,"background-color"],"borderStyle":[1,"border-style"],"isDisabled":[4,"is-disabled"],"icon":[16],"iconRight":[4,"icon-right"],"size":[1],"variant":[1],"noBackground":[4,"no-background"],"withBoxShadow":[4,"with-box-shadow"],"noPaddingLeft":[4,"no-padding-left"],"noPaddingRight":[4,"no-padding-right"],"loading":[4],"justifyContent":[1,"justify-content"],"theme":[1],"hasIcon":[32],"hasContent":[32]},[[2,"click","clickHandler"]],{"icon":["iconChangeHandler"]}],[1,"zonos-spinner",{"size":[2],"spinnerColor":[1,"spinner-color"]}],[1,"zonos-icon",{"autoHeight":[4,"auto-height"],"iconColor":[1,"icon-color"],"content":[1],"size":[2]}]]],["p-7c7f0c32",[[1,"zonos-language-select",{"handleOnClose":[16]}],[1,"zonos-select-dialog-header",{"handleOnClose":[16],"label":[1]}]]],["p-5d9c5413",[[1,"zonos-country-select",{"handleOnClose":[16],"inputValue":[32]}],[1,"zonos-hello-dialog-footer",{"appearanceSettings":[16],"setShowCountrySelect":[16],"setShowLanguageSelect":[16]}],[1,"zonos-custom-message",{"icon":[1],"message":[1]}],[2,"zonos-virtual-scroll",{"renderItem":[16],"itemWidth":[2,"item-width"],"fallbackItemHeight":[2,"fallback-item-height"],"itemHeights":[16],"container":[32],"scrollTop":[32],"totalHeight":[32]},null,{"itemHeights":["updateTotalHeight"],"fallbackItemHeight":["updateTotalHeight"]}]]],["p-dec30fa4",[[1,"zonos-address-update-dialog",{"continueLoading":[4,"continue-loading"],"dialogLoading":[4,"dialog-loading"],"dialogOpen":[4,"dialog-open"],"submitBtnType":[1,"submit-btn-type"],"submitBtnColor":[1,"submit-btn-color"],"isMobile":[4,"is-mobile"],"shippingAddress":[16],"billingAddress":[16],"translatedShippingAddress":[16],"translatedBillingAddress":[16],"showErrorBanner":[32],"translatedShippingAddressState":[32],"translatedBillingAddressState":[32]},null,{"translatedShippingAddress":["watchTranslatedShippingAddress"],"translatedBillingAddress":["watchTranslatedBillingAddress"]}],[2,"zonos-link-authentication",{"titleText":[1,"title-text"],"defaultEmail":[1,"default-email"],"isEmailError":[4,"is-email-error"],"stripe":[32],"isStagingMode":[32],"clientSecret":[32]},null,{"isStagingMode":["watchIsStagingMode"],"stripe":["watchInitStripe"],"clientSecret":["watchInitStripe"],"defaultEmail":["watchDefaultEmail"]}],[2,"zonos-address",{"type":[1],"titleText":[1,"title-text"],"defaultAddress":[16],"stripe":[32],"isDirtyAddress":[32]},null,{"stripe":["watchInitStripe"]}],[1,"zonos-checkbox",{"backgroundColor":[1,"background-color"],"label":[1],"isChecked":[4,"is-checked"],"isDisabled":[4,"is-disabled"],"size":[2],"fontSize":[1,"font-size"],"borderStyle":[1,"border-style"]},[[1,"click","onClick"]]],[1,"zonos-dialog",{"open":[4],"headerText":[1,"header-text"],"width":[1],"height":[1],"minHeight":[1,"min-height"],"noHeader":[4,"no-header"],"noBodyPadding":[4,"no-body-padding"],"noBorder":[4,"no-border"],"borderStyle":[1,"border-style"],"noCloseButton":[4,"no-close-button"],"noClickOutside":[4,"no-click-outside"],"mobile":[4],"isLoading":[4,"is-loading"],"isMobile":[32]},[[9,"resize","handleWindowResize"],[4,"keydown","handleKeyDown"]]],[1,"zonos-address-display",{"currentAddress":[16],"addressType":[1,"address-type"]}],[1,"zonos-address-form",{"currentAddress":[16],"translatedAddress":[16],"addressType":[1,"address-type"],"localAddress":[32]},null,{"translatedAddress":["watchCurrentAddress"]}],[1,"zonos-stripe-input",{"inputValue":[1,"input-value"],"inputLabel":[1,"input-label"],"overridePrimaryColor":[1,"override-primary-color"],"overrideSecondaryColor":[1,"override-secondary-color"],"isDisabled":[4,"is-disabled"],"isError":[4,"is-error"],"inputPlaceholder":[1,"input-placeholder"],"value":[1025],"internalValue":[32]},null,{"inputValue":["onInputValueChange"],"value":["onValueChange"]}]]],["p-3e3e7800",[[2,"zonos-customer-info",{"continueLoading":[4,"continue-loading"],"submitBtnType":[1,"submit-btn-type"],"submitBtnColor":[1,"submit-btn-color"],"isMobile":[4,"is-mobile"],"defaultAddress":[16],"showErrorBanner":[32],"shippingCountry":[32],"isCheckingForRestrictedItems":[32],"isValidatingAddress":[32],"isTaxIdError":[32],"invalidShippingCharacterList":[32],"invalidBillingCharacterList":[32],"openAddressValidationDialog":[32],"isEmailError":[32]}],[2,"zonos-checkout-payment",{"submitBtnType":[1,"submit-btn-type"],"continueLoading":[4,"continue-loading"],"submitBtnColor":[1,"submit-btn-color"],"isMobile":[4,"is-mobile"],"overridePrimaryColor":[1,"override-primary-color"],"showErrorBanner":[32],"hasStripePaymentError":[32],"stagingOrderCreateErrorMessage":[32],"internalContinueLoading":[32]},null,{"continueLoading":["continueLoadingWatcher"],"hasStripePaymentError":["stripePaymentErrorWatcher"]}],[1,"zonos-checkout-footer",{"mobile":[4],"dataTheme":[1,"data-theme"],"showLanguageDialog":[32],"isMobile":[32]},[[4,"click","handleGlobalClick"]],{"mobile":["handleMobileChange"]}],[2,"zonos-shipping",{"continueLoading":[4,"continue-loading"],"submitBtnColor":[1,"submit-btn-color"],"submitBtnType":[1,"submit-btn-type"],"selectedShippingMethod":[32],"collapsedDAPOptions":[32],"isSelecting":[32],"showErrorBanner":[32],"serviceLevelsDDP":[32],"serviceLevelsDAP":[32],"serviceLevelsOther":[32],"serviceLevelsAll":[32],"displayBaseCurrency":[32]}],[1,"zonos-cart-subtotal",{"submitBtnType":[1,"submit-btn-type"],"submitBtnColor":[1,"submit-btn-color"],"loading":[32]}],[1,"zonos-cart-restricted-items",{"hide":[4],"errorImages":[32],"internalCollapsed":[32],"firstRender":[32]}],[1,"zonos-checkout-finish",{"borderRadius":[1,"border-radius"],"storybookForceStatus":[1,"storybook-force-status"],"overrideNotification":[16],"isLoading":[32],"notificationType":[32],"notificationTitle":[32],"notificationMessages":[32],"notificationActionText":[32],"order":[32],"isWaitingToRedirect":[32]}],[1,"zonos-confirm-dialog",{"dialogTitle":[1,"dialog-title"],"dialogIntent":[1,"dialog-intent"],"dialogSubtitle":[1,"dialog-subtitle"],"submitBtnColor":[1,"submit-btn-color"],"dialogConfirmBtnText":[1,"dialog-confirm-btn-text"],"dialogWidth":[2,"dialog-width"],"dialogCancelBtnText":[1,"dialog-cancel-btn-text"],"dialogType":[1,"dialog-type"],"isMobile":[4,"is-mobile"],"dialogOpen":[4,"dialog-open"],"noClickOutside":[4,"no-click-outside"]},[[4,"keydown","handleKeyDown"]]],[1,"zonos-checkout-progress-tabs",{"tabColor":[1,"tab-color"],"backgroundColor":[1,"background-color"],"setTabItems":[64],"setTabSelected":[64]}],[1,"zonos-review",{"mobile":[4],"collapsed":[4],"isMobile":[32]},[[9,"resize","handleWindowResize"]]],[1,"zonos-cart-items",{"errorImages":[32]}],[1,"zonos-currency-toggle",{"errorImages":[32]}],[1,"zonos-rest-state",{"restStateSubtitle":[1,"rest-state-subtitle"],"restStateTitle":[1,"rest-state-title"],"restStateType":[1,"rest-state-type"],"isErrorImageLoad":[32]}]]]]'),e))));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zonos/elements",
3
- "version": "1.3.151",
3
+ "version": "1.3.152",
4
4
  "description": "Zonos component UI for Stripe elements",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.cjs.js",
@@ -1 +0,0 @@
1
- var __awaiter=this&&this.__awaiter||function(e,t,r,a){function n(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function o(e){try{c(a.next(e))}catch(e){i(e)}}function s(e){try{c(a["throw"](e))}catch(e){i(e)}}function c(e){e.done?r(e.value):n(e.value).then(o,s)}c((a=a.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,n,i,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(s){if(a)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(a=1,n&&(i=s[0]&2?n["return"]:s[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;if(n=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;n=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];n=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};import{g as getIsTestMode,h as handleFetch,l as log,b as logError}from"./handleFetch-b4633675.js";var getTempCartById=function(e){return __awaiter(void 0,[e],void 0,(function(e){var t,r,a,n,i;var o=e.cartId,s=e.retries;return __generator(this,(function(e){switch(e.label){case 0:t=getIsTestMode();return[4,handleFetch("/api/zonos-elements/get-temp-cart",{body:{isTestMode:t,tempCartUUID:o},headers:{"Content-Type":"application/json"},method:"POST"})];case 1:r=e.sent(),a=r.errors,n=r.json;i=!n||a.length;if(!(i&&s))return[3,3];log("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:s});return[4,new Promise((function(e){return setTimeout(e,500)}))];case 2:e.sent();return[2,getTempCartById({cartId:o,retries:s-1})];case 3:if(i){return[2,null]}return[2,n]}}))}))};var baseRe=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/;var uuidRe=new RegExp("^".concat(baseRe.source,"$"));var cartUuidRe=new RegExp("^cart_".concat(baseRe.source,"$"));var tsidRe=/^[a-zA-Z0-9]{2,}$/;var cartTsidRe=/^cart_[a-zA-Z0-9]{2,}$/;var _getIsValidCartId=function(e){if(!e){return{isDgsCartId:false,isLegacyCartId:false}}if(e.includes("undefined")){return{isDgsCartId:false,isLegacyCartId:false}}if(cartTsidRe.test(e)){return{isDgsCartId:true,isLegacyCartId:false}}if(tsidRe.test(e)){return{isDgsCartId:false,isLegacyCartId:true}}if(cartUuidRe.test(e)){return{isDgsCartId:true,isLegacyCartId:false}}if(uuidRe.test(e)){return{isDgsCartId:false,isLegacyCartId:true}}return{isDgsCartId:false,isLegacyCartId:false}};var setupCartData=function(e){return __awaiter(void 0,void 0,void 0,(function(){var t,r,a,n;return __generator(this,(function(i){switch(i.label){case 0:t=_getIsValidCartId(e),r=t.isDgsCartId,a=t.isLegacyCartId;if(!a&&!r){logError("[ZONOS - loadZonos] invalid cart id");return[2,null]}return[4,getTempCartById({cartId:e,retries:5})];case 1:n=i.sent();log("[ZONOS - loadZonos] getting temp cart data","info",n);if(!n){logError("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process.");return[2,null]}window.Zonos.storeId=n.cartData.storeId;window.Zonos.zonosApiKey=n.cartData.credentialToken;return[2,{cartData:n.cartData,storeFavicon:n.storeFaviconUrl,storeId:n.cartData.storeId,storeLogo:n.storeLogoUrl,zonosApiKey:n.cartData.credentialToken}]}}))}))};var checkoutHiddenBtnSelector="zonos--checkout-hidden-button";var domesticRedirectedBtnSelector="zonos--domestic-redirected-checkout-button";export{checkoutHiddenBtnSelector as c,domesticRedirectedBtnSelector as d,setupCartData as s};
@@ -1 +0,0 @@
1
- import{g as t,h as a,l as s,b as e}from"./p-f0c8150e.js";const r=async({cartId:e,retries:o})=>{const i=t(),{errors:n,json:d}=await a("/api/zonos-elements/get-temp-cart",{body:{isTestMode:i,tempCartUUID:e},headers:{"Content-Type":"application/json"},method:"POST"}),c=!d||n.length;return c&&o?(s("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:o}),await new Promise((t=>setTimeout(t,500))),r({cartId:e,retries:o-1})):c?null:d},o=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/,i=new RegExp(`^${o.source}$`),n=new RegExp(`^cart_${o.source}$`),d=/^[a-zA-Z0-9]{2,}$/,c=/^cart_[a-zA-Z0-9]{2,}$/,g=async t=>{const{isDgsCartId:a,isLegacyCartId:o}=(t=>t?t.includes("undefined")?{isDgsCartId:!1,isLegacyCartId:!1}:c.test(t)?{isDgsCartId:!0,isLegacyCartId:!1}:d.test(t)?{isDgsCartId:!1,isLegacyCartId:!0}:n.test(t)?{isDgsCartId:!0,isLegacyCartId:!1}:i.test(t)?{isDgsCartId:!1,isLegacyCartId:!0}:{isDgsCartId:!1,isLegacyCartId:!1}:{isDgsCartId:!1,isLegacyCartId:!1})(t);if(!o&&!a)return e("[ZONOS - loadZonos] invalid cart id"),null;const g=await r({cartId:t,retries:5});return s("[ZONOS - loadZonos] getting temp cart data","info",g),g?(window.Zonos.storeId=g.cartData.storeId,window.Zonos.zonosApiKey=g.cartData.credentialToken,{cartData:g.cartData,storeFavicon:g.storeFaviconUrl,storeId:g.cartData.storeId,storeLogo:g.storeLogoUrl,zonosApiKey:g.cartData.credentialToken}):(e("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),null)},I="zonos--checkout-hidden-button",C="zonos--domestic-redirected-checkout-button";export{I as c,C as d,g as s}
@@ -1 +0,0 @@
1
- var __awaiter=this&&this.__awaiter||function(t,r,e,n){function a(t){return t instanceof e?t:new e((function(r){r(t)}))}return new(e||(e=Promise))((function(e,i){function o(t){try{u(n.next(t))}catch(t){i(t)}}function s(t){try{u(n["throw"](t))}catch(t){i(t)}}function u(t){t.done?e(t.value):a(t.value).then(o,s)}u((n=n.apply(t,r||[])).next())}))};var __generator=this&&this.__generator||function(t,r){var e={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,a,i,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(t){return function(r){return u([t,r])}}function u(s){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(e=0)),e)try{if(n=1,a&&(i=s[0]&2?a["return"]:s[0]?a["throw"]||((i=a["return"])&&i.call(a),0):a.next)&&!(i=i.call(a,s[1])).done)return i;if(a=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:e.label++;return{value:s[1],done:false};case 5:e.label++;a=s[1];s=[0];continue;case 7:s=e.ops.pop();e.trys.pop();continue;default:if(!(i=e.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){e=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){e.label=s[1];break}if(s[0]===6&&e.label<i[1]){e.label=i[1];i=s;break}if(i&&e.label<i[2]){e.label=i[2];e.ops.push(s);break}if(i[2])e.ops.pop();e.trys.pop();continue}s=r.call(t,e)}catch(t){s=[6,t];a=0}finally{n=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-18e5b741.system.js"],(function(t){"use strict";var r,e,n,a;return{setters:[function(t){r=t.g;e=t.h;n=t.l;a=t.b}],execute:function(){var i=this;var o=function(t){return __awaiter(i,[t],void 0,(function(t){var a,i,s,u,c;var f=t.cartId,d=t.retries;return __generator(this,(function(t){switch(t.label){case 0:a=r();return[4,e("/api/zonos-elements/get-temp-cart",{body:{isTestMode:a,tempCartUUID:f},headers:{"Content-Type":"application/json"},method:"POST"})];case 1:i=t.sent(),s=i.errors,u=i.json;c=!u||s.length;if(!(c&&d))return[3,3];n("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:d});return[4,new Promise((function(t){return setTimeout(t,500)}))];case 2:t.sent();return[2,o({cartId:f,retries:d-1})];case 3:if(c){return[2,null]}return[2,u]}}))}))};var s=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/;var u=new RegExp("^".concat(s.source,"$"));var c=new RegExp("^cart_".concat(s.source,"$"));var f=/^[a-zA-Z0-9]{2,}$/;var d=/^cart_[a-zA-Z0-9]{2,}$/;var l=function(t){if(!t){return{isDgsCartId:false,isLegacyCartId:false}}if(t.includes("undefined")){return{isDgsCartId:false,isLegacyCartId:false}}if(d.test(t)){return{isDgsCartId:true,isLegacyCartId:false}}if(f.test(t)){return{isDgsCartId:false,isLegacyCartId:true}}if(c.test(t)){return{isDgsCartId:true,isLegacyCartId:false}}if(u.test(t)){return{isDgsCartId:false,isLegacyCartId:true}}return{isDgsCartId:false,isLegacyCartId:false}};var g=t("s",(function(t){return __awaiter(i,void 0,void 0,(function(){var r,e,i,s;return __generator(this,(function(u){switch(u.label){case 0:r=l(t),e=r.isDgsCartId,i=r.isLegacyCartId;if(!i&&!e){a("[ZONOS - loadZonos] invalid cart id");return[2,null]}return[4,o({cartId:t,retries:5})];case 1:s=u.sent();n("[ZONOS - loadZonos] getting temp cart data","info",s);if(!s){a("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process.");return[2,null]}window.Zonos.storeId=s.cartData.storeId;window.Zonos.zonosApiKey=s.cartData.credentialToken;return[2,{cartData:s.cartData,storeFavicon:s.storeFaviconUrl,storeId:s.cartData.storeId,storeLogo:s.storeLogoUrl,zonosApiKey:s.cartData.credentialToken}]}}))}))}));var v=t("c","zonos--checkout-hidden-button");var h=t("d","zonos--domestic-redirected-checkout-button")}}}));