@zonos/elements 1.3.4 → 1.3.5-alpha.0

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 (51) hide show
  1. package/dist/cjs/{cart-f31374d4.js → cart-f038cf46.js} +6 -1
  2. package/dist/cjs/index.cjs.js +1 -1
  3. package/dist/cjs/zonos-address_2.cjs.entry.js +36 -26
  4. package/dist/cjs/zonos-cart-items_10.cjs.entry.js +1 -1
  5. package/dist/cjs/zonos-checkout.cjs.entry.js +1 -1
  6. package/dist/cjs/zonos-controller.cjs.entry.js +1 -1
  7. package/dist/cjs/zonos-payment.cjs.entry.js +1 -1
  8. package/dist/collection/components/stripe/zonos-address/zonos-address.js +35 -25
  9. package/dist/collection/components/utils/api/calculateLandedCost.js +6 -1
  10. package/dist/components/cart.js +6 -1
  11. package/dist/components/zonos-address2.js +35 -25
  12. package/dist/esm/{cart-c9124cc3.js → cart-ba9b0d4c.js} +6 -1
  13. package/dist/esm/index.js +1 -1
  14. package/dist/esm/zonos-address_2.entry.js +36 -26
  15. package/dist/esm/zonos-cart-items_10.entry.js +1 -1
  16. package/dist/esm/zonos-checkout.entry.js +1 -1
  17. package/dist/esm/zonos-controller.entry.js +1 -1
  18. package/dist/esm/zonos-payment.entry.js +1 -1
  19. package/dist/esm-es5/cart-ba9b0d4c.js +1 -0
  20. package/dist/esm-es5/index.js +1 -1
  21. package/dist/esm-es5/zonos-address_2.entry.js +1 -1
  22. package/dist/esm-es5/zonos-cart-items_10.entry.js +1 -1
  23. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  24. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  25. package/dist/esm-es5/zonos-payment.entry.js +1 -1
  26. package/dist/scripts/loadZonos.js +1 -1
  27. package/dist/scripts/zonos.js +1 -1
  28. package/dist/scripts/zonosBase.js +1 -1
  29. package/dist/types/components/stripe/zonos-address/zonos-address.d.ts +1 -0
  30. package/dist/zonos-elements/index.esm.js +1 -1
  31. package/dist/zonos-elements/{p-ffc91e42.entry.js → p-1165b6e5.entry.js} +1 -1
  32. package/dist/zonos-elements/{p-741a1402.system.entry.js → p-12c19be6.system.entry.js} +1 -1
  33. package/dist/zonos-elements/p-245997d9.js +1 -0
  34. package/dist/zonos-elements/{p-c134eecd.system.js → p-59343e23.system.js} +1 -1
  35. package/dist/zonos-elements/{p-f7b1dfd0.system.entry.js → p-7beaee33.system.entry.js} +1 -1
  36. package/dist/zonos-elements/{p-43220d68.entry.js → p-824ebf9d.entry.js} +1 -1
  37. package/dist/zonos-elements/p-839f6cd9.entry.js +1 -0
  38. package/dist/zonos-elements/{p-62851827.system.entry.js → p-8970e202.system.entry.js} +1 -1
  39. package/dist/zonos-elements/p-b035f9e5.system.js +1 -1
  40. package/dist/zonos-elements/{p-b494d540.entry.js → p-be4bc6bc.entry.js} +1 -1
  41. package/dist/zonos-elements/p-c3d75f4f.system.js +1 -0
  42. package/dist/zonos-elements/{p-d170748c.system.entry.js → p-da2387d2.system.entry.js} +1 -1
  43. package/dist/zonos-elements/p-dcf1e1b4.system.entry.js +1 -0
  44. package/dist/zonos-elements/{p-139fc767.entry.js → p-fdb9568e.entry.js} +1 -1
  45. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  46. package/package.json +1 -1
  47. package/dist/esm-es5/cart-c9124cc3.js +0 -1
  48. package/dist/zonos-elements/p-2ac66cea.system.entry.js +0 -1
  49. package/dist/zonos-elements/p-51a40ddf.system.js +0 -1
  50. package/dist/zonos-elements/p-97e659b7.entry.js +0 -1
  51. package/dist/zonos-elements/p-e59b6648.js +0 -1
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(n,t,o,s){function e(n){return n instanceof o?n:new o((function(t){t(n)}))}return new(o||(o=Promise))((function(o,i){function a(n){try{c(s.next(n))}catch(n){i(n)}}function r(n){try{c(s["throw"](n))}catch(n){i(n)}}function c(n){n.done?o(n.value):e(n.value).then(a,r)}c((s=s.apply(n,t||[])).next())}))};var __generator=this&&this.__generator||function(n,t){var o={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},s,e,i,a;return a={next:r(0),throw:r(1),return:r(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function r(n){return function(t){return c([n,t])}}function c(r){if(s)throw new TypeError("Generator is already executing.");while(a&&(a=0,r[0]&&(o=0)),o)try{if(s=1,e&&(i=r[0]&2?e["return"]:r[0]?e["throw"]||((i=e["return"])&&i.call(e),0):e.next)&&!(i=i.call(e,r[1])).done)return i;if(e=0,i)r=[r[0]&2,i.value];switch(r[0]){case 0:case 1:i=r;break;case 4:o.label++;return{value:r[1],done:false};case 5:o.label++;e=r[1];r=[0];continue;case 7:r=o.ops.pop();o.trys.pop();continue;default:if(!(i=o.trys,i=i.length>0&&i[i.length-1])&&(r[0]===6||r[0]===2)){o=0;continue}if(r[0]===3&&(!i||r[1]>i[0]&&r[1]<i[3])){o.label=r[1];break}if(r[0]===6&&o.label<i[1]){o.label=i[1];i=r;break}if(i&&o.label<i[2]){o.label=i[2];o.ops.push(r);break}if(i[2])o.ops.pop();o.trys.pop();continue}r=t.call(n,o)}catch(n){r=[6,n];e=0}finally{s=i=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};import{r as registerInstance,h,H as Host,d as getElement}from"./index-81a199ef.js";import{s as stripeStore,m as stripeStorePrefetchLandedCost}from"./cart-c9124cc3.js";import{b as logError,a as localizationStore}from"./localization-5d83fde2.js";import"./zonosStore-e59617f8.js";import"./isDarkColor-8696cb70.js";import"./getBorderRadius-9e4cb3b1.js";var zonosAddressCss=".sc-zonos-address-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-address-h *.sc-zonos-address{font-family:var(--font-family, Inter), Inter}.sc-zonos-address-h img.sc-zonos-address{max-width:100%}.sc-zonos-address-h dl.sc-zonos-address,.sc-zonos-address-h dd.sc-zonos-address,.sc-zonos-address-h h1.sc-zonos-address,.sc-zonos-address-h h2.sc-zonos-address,.sc-zonos-address-h h3.sc-zonos-address,.sc-zonos-address-h h4.sc-zonos-address,.sc-zonos-address-h h5.sc-zonos-address,.sc-zonos-address-h h6.sc-zonos-address,.sc-zonos-address-h hr.sc-zonos-address,.sc-zonos-address-h figure.sc-zonos-address,.sc-zonos-address-h p.sc-zonos-address,.sc-zonos-address-h pre.sc-zonos-address{margin:0}.sc-zonos-address-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-address-h .zonos--title.sc-zonos-address{margin-bottom:var(--amino-space-16)}";var ZonosAddressStyle0=zonosAddressCss;var ZonosAddress=function(){function n(n){registerInstance(this,n);this.type=undefined;this.titleText=undefined;this.defaultAddress=null;this.stripe=window.Zonos.stripe}n.prototype.watchInitStripe=function(){return __awaiter(this,void 0,void 0,(function(){var n,t,o,s,e;return __generator(this,(function(i){this.stripe=window.Zonos.stripe;if(!this.stripe||!stripeStore.stripeElements){logError("Stripe is not initialized. Couldn't load stripe element.");return[2]}o=(n=this.defaultAddress)===null||n===void 0?void 0:n.phone;if(!o){(t=this.defaultAddress)===null||t===void 0?true:delete t.phone}s=localizationStore.shippingZoneCountries;e=stripeStore.stripeAddressElement||stripeStore.stripeElements.create("address",{allowedCountries:s?Object.values(s).map((function(n){return n.code})):[],contacts:this.defaultAddress?[this.defaultAddress]:undefined,defaultValues:{address:{country:localizationStore.selectedCountryCode||"AL"}},display:{name:"split"},fields:{phone:"always"},mode:this.type,validation:{phone:{required:"always"}}});e.mount(this.el.querySelector(".zonos--address-component"));e.on("change",(function(n){var t=n.value;stripeStore.stripeAddressEventData=Object.assign(Object.assign({},n),{elementMode:"shipping",elementType:"address",empty:false,value:Object.assign(Object.assign({},t),{firstName:t.firstName||t.name.split(" ")[0],lastName:t.lastName||t.name.split(" ").pop()})});void stripeStorePrefetchLandedCost()}));stripeStore.stripeAddressElement=e;return[2]}))}))};n.prototype.componentDidLoad=function(){void this.watchInitStripe()};n.prototype.render=function(){return h(Host,{key:"47fa225123b7c944732b018fbb374bcb6da0f4ca",class:"zonos--address zonos--elements"},h("zonos-text",{key:"4d0d9d4f9c09d6b2f29bc6a44164a0ef8db0acc9",class:"zonos--title",type:"semiBoldLabel"},this.titleText),h("div",{key:"d279ba97287890e489230f9e449a344db76556f2",class:"zonos--address-component"}))};Object.defineProperty(n.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(n,"watchers",{get:function(){return{stripe:["watchInitStripe"]}},enumerable:false,configurable:true});return n}();ZonosAddress.style=ZonosAddressStyle0;var zonosLinkAuthenticationCss=".sc-zonos-link-authentication-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-link-authentication-h *.sc-zonos-link-authentication{font-family:var(--font-family, Inter), Inter}.sc-zonos-link-authentication-h img.sc-zonos-link-authentication{max-width:100%}.sc-zonos-link-authentication-h dl.sc-zonos-link-authentication,.sc-zonos-link-authentication-h dd.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h1.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h2.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h3.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h4.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h5.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h6.sc-zonos-link-authentication,.sc-zonos-link-authentication-h hr.sc-zonos-link-authentication,.sc-zonos-link-authentication-h figure.sc-zonos-link-authentication,.sc-zonos-link-authentication-h p.sc-zonos-link-authentication,.sc-zonos-link-authentication-h pre.sc-zonos-link-authentication{margin:0}.sc-zonos-link-authentication-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-link-authentication-h .zonos--title.sc-zonos-link-authentication{margin-bottom:var(--amino-space-16)}";var ZonosLinkAuthenticationStyle0=zonosLinkAuthenticationCss;var ZonosLinkAuthentication=function(){function n(n){registerInstance(this,n);this.titleText=undefined;this.stripe=stripeStore.stripe}n.prototype.watchInitStripe=function(){if(!this.stripe||!stripeStore.stripeElements){return}var n=stripeStore.stripeLinkElement||stripeStore.stripeElements.create("linkAuthentication");var t=this.el.querySelector(".zonos--link-authentication-component");if(!t){console.error("Cannot find container element for linkAuthenticationElement");return}n.mount(t);n.on("change",(function(n){stripeStore.stripeLinkEventData=n;void stripeStorePrefetchLandedCost()}));stripeStore.stripeLinkElement=n};n.prototype.componentDidLoad=function(){this.watchInitStripe()};n.prototype.render=function(){return h(Host,{key:"48ec92ca8a1500c3b8e85222c3df069c32074e72",class:"zonos--link-authentication zonos--elements"},h("zonos-text",{key:"9060fab8ab9f88157ee6951af830e106e6ff9509",class:"zonos--title",type:"semiBoldLabel"},this.titleText),h("div",{key:"dac7e96170d15faa8c1013fb298ae86e2ce99f0b",class:"zonos--link-authentication-component"}))};Object.defineProperty(n.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(n,"watchers",{get:function(){return{stripe:["watchInitStripe"]}},enumerable:false,configurable:true});return n}();ZonosLinkAuthentication.style=ZonosLinkAuthenticationStyle0;export{ZonosAddress as zonos_address,ZonosLinkAuthentication as zonos_link_authentication};
1
+ var __awaiter=this&&this.__awaiter||function(n,t,o,e){function s(n){return n instanceof o?n:new o((function(t){t(n)}))}return new(o||(o=Promise))((function(o,i){function a(n){try{c(e.next(n))}catch(n){i(n)}}function r(n){try{c(e["throw"](n))}catch(n){i(n)}}function c(n){n.done?o(n.value):s(n.value).then(a,r)}c((e=e.apply(n,t||[])).next())}))};var __generator=this&&this.__generator||function(n,t){var o={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},e,s,i,a;return a={next:r(0),throw:r(1),return:r(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function r(n){return function(t){return c([n,t])}}function c(r){if(e)throw new TypeError("Generator is already executing.");while(a&&(a=0,r[0]&&(o=0)),o)try{if(e=1,s&&(i=r[0]&2?s["return"]:r[0]?s["throw"]||((i=s["return"])&&i.call(s),0):s.next)&&!(i=i.call(s,r[1])).done)return i;if(s=0,i)r=[r[0]&2,i.value];switch(r[0]){case 0:case 1:i=r;break;case 4:o.label++;return{value:r[1],done:false};case 5:o.label++;s=r[1];r=[0];continue;case 7:r=o.ops.pop();o.trys.pop();continue;default:if(!(i=o.trys,i=i.length>0&&i[i.length-1])&&(r[0]===6||r[0]===2)){o=0;continue}if(r[0]===3&&(!i||r[1]>i[0]&&r[1]<i[3])){o.label=r[1];break}if(r[0]===6&&o.label<i[1]){o.label=i[1];i=r;break}if(i&&o.label<i[2]){o.label=i[2];o.ops.push(r);break}if(i[2])o.ops.pop();o.trys.pop();continue}r=t.call(n,o)}catch(n){r=[6,n];s=0}finally{e=i=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};import{r as registerInstance,h,H as Host,d as getElement}from"./index-81a199ef.js";import{s as stripeStore,m as stripeStorePrefetchLandedCost}from"./cart-ba9b0d4c.js";import{b as logError,a as localizationStore}from"./localization-5d83fde2.js";import"./zonosStore-e59617f8.js";import"./isDarkColor-8696cb70.js";import"./getBorderRadius-9e4cb3b1.js";var zonosAddressCss=".sc-zonos-address-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-address-h *.sc-zonos-address{font-family:var(--font-family, Inter), Inter}.sc-zonos-address-h img.sc-zonos-address{max-width:100%}.sc-zonos-address-h dl.sc-zonos-address,.sc-zonos-address-h dd.sc-zonos-address,.sc-zonos-address-h h1.sc-zonos-address,.sc-zonos-address-h h2.sc-zonos-address,.sc-zonos-address-h h3.sc-zonos-address,.sc-zonos-address-h h4.sc-zonos-address,.sc-zonos-address-h h5.sc-zonos-address,.sc-zonos-address-h h6.sc-zonos-address,.sc-zonos-address-h hr.sc-zonos-address,.sc-zonos-address-h figure.sc-zonos-address,.sc-zonos-address-h p.sc-zonos-address,.sc-zonos-address-h pre.sc-zonos-address{margin:0}.sc-zonos-address-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-address-h .zonos--title.sc-zonos-address{margin-bottom:var(--amino-space-16)}";var ZonosAddressStyle0=zonosAddressCss;var ZonosAddress=function(){function n(n){registerInstance(this,n);this.type=undefined;this.titleText=undefined;this.defaultAddress=null;this.stripe=window.Zonos.stripe}n.prototype.watchInitStripe=function(){return __awaiter(this,void 0,void 0,(function(){var n,t,o,e,s,i,a,r,c,d;return __generator(this,(function(h){this.stripe=window.Zonos.stripe;if(!this.stripe||!stripeStore.stripeElements){logError("Stripe is not initialized. Couldn't load stripe element.");return[2]}r=(n=this.defaultAddress)===null||n===void 0?void 0:n.phone;if(!r){(t=this.defaultAddress)===null||t===void 0?true:delete t.phone}c=localizationStore.shippingZoneCountries;d=stripeStore.stripeElements.create("address",{allowedCountries:c?Object.values(c).map((function(n){return n.code})):[],autocomplete:{mode:"automatic"},contacts:this.defaultAddress?[this.defaultAddress]:[],defaultValues:{address:Object.assign(Object.assign({},(o=stripeStore.stripeAddressEventData)===null||o===void 0?void 0:o.value.address),{country:((e=stripeStore.stripeAddressEventData)===null||e===void 0?void 0:e.value.address.country)||localizationStore.selectedCountryCode||"AL"}),firstName:(s=stripeStore.stripeAddressEventData)===null||s===void 0?void 0:s.value.firstName,lastName:(i=stripeStore.stripeAddressEventData)===null||i===void 0?void 0:i.value.lastName,phone:(a=stripeStore.stripeAddressEventData)===null||a===void 0?void 0:a.value.phone},display:{name:"split"},fields:{phone:"always"},mode:this.type,validation:{phone:{required:"always"}}});d.mount(this.el.querySelector(".zonos--address-component"));d.on("change",(function(n){var t=n.value;stripeStore.stripeAddressEventData=Object.assign(Object.assign({},n),{elementMode:"shipping",elementType:"address",empty:false,value:Object.assign(Object.assign({},t),{firstName:t.firstName||t.name.split(" ")[0],lastName:t.lastName||t.name.split(" ").pop()})});void stripeStorePrefetchLandedCost()}));stripeStore.stripeAddressElement=d;return[2]}))}))};n.prototype.disconnectedCallback=function(){var n;(n=stripeStore.stripeAddressElement)===null||n===void 0?void 0:n.destroy()};n.prototype.componentDidLoad=function(){void this.watchInitStripe()};n.prototype.render=function(){return h(Host,{key:"f376a81e62581bff4ac25d53f11c8e53408f9e7e",class:"zonos--address zonos--elements"},h("zonos-text",{key:"bdc1a8b7414cae0e79c90e0685700590cd920468",class:"zonos--title",type:"semiBoldLabel"},this.titleText),h("div",{key:"fe384f4c0e508a9f8ddff8fa579c504c3f18e7bb",class:"zonos--address-component"}))};Object.defineProperty(n.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(n,"watchers",{get:function(){return{stripe:["watchInitStripe"]}},enumerable:false,configurable:true});return n}();ZonosAddress.style=ZonosAddressStyle0;var zonosLinkAuthenticationCss=".sc-zonos-link-authentication-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-link-authentication-h *.sc-zonos-link-authentication{font-family:var(--font-family, Inter), Inter}.sc-zonos-link-authentication-h img.sc-zonos-link-authentication{max-width:100%}.sc-zonos-link-authentication-h dl.sc-zonos-link-authentication,.sc-zonos-link-authentication-h dd.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h1.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h2.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h3.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h4.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h5.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h6.sc-zonos-link-authentication,.sc-zonos-link-authentication-h hr.sc-zonos-link-authentication,.sc-zonos-link-authentication-h figure.sc-zonos-link-authentication,.sc-zonos-link-authentication-h p.sc-zonos-link-authentication,.sc-zonos-link-authentication-h pre.sc-zonos-link-authentication{margin:0}.sc-zonos-link-authentication-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-link-authentication-h .zonos--title.sc-zonos-link-authentication{margin-bottom:var(--amino-space-16)}";var ZonosLinkAuthenticationStyle0=zonosLinkAuthenticationCss;var ZonosLinkAuthentication=function(){function n(n){registerInstance(this,n);this.titleText=undefined;this.stripe=stripeStore.stripe}n.prototype.watchInitStripe=function(){if(!this.stripe||!stripeStore.stripeElements){return}var n=stripeStore.stripeLinkElement||stripeStore.stripeElements.create("linkAuthentication");var t=this.el.querySelector(".zonos--link-authentication-component");if(!t){console.error("Cannot find container element for linkAuthenticationElement");return}n.mount(t);n.on("change",(function(n){stripeStore.stripeLinkEventData=n;void stripeStorePrefetchLandedCost()}));stripeStore.stripeLinkElement=n};n.prototype.componentDidLoad=function(){this.watchInitStripe()};n.prototype.render=function(){return h(Host,{key:"48ec92ca8a1500c3b8e85222c3df069c32074e72",class:"zonos--link-authentication zonos--elements"},h("zonos-text",{key:"9060fab8ab9f88157ee6951af830e106e6ff9509",class:"zonos--title",type:"semiBoldLabel"},this.titleText),h("div",{key:"dac7e96170d15faa8c1013fb298ae86e2ce99f0b",class:"zonos--link-authentication-component"}))};Object.defineProperty(n.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(n,"watchers",{get:function(){return{stripe:["watchInitStripe"]}},enumerable:false,configurable:true});return n}();ZonosLinkAuthentication.style=ZonosLinkAuthenticationStyle0;export{ZonosAddress as zonos_address,ZonosLinkAuthentication as zonos_link_authentication};
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(o,t,s,n){function e(o){return o instanceof s?o:new s((function(t){t(o)}))}return new(s||(s=Promise))((function(s,i){function a(o){try{c(n.next(o))}catch(o){i(o)}}function r(o){try{c(n["throw"](o))}catch(o){i(o)}}function c(o){o.done?s(o.value):e(o.value).then(a,r)}c((n=n.apply(o,t||[])).next())}))};var __generator=this&&this.__generator||function(o,t){var s={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,e,i,a;return a={next:r(0),throw:r(1),return:r(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function r(o){return function(t){return c([o,t])}}function c(r){if(n)throw new TypeError("Generator is already executing.");while(a&&(a=0,r[0]&&(s=0)),s)try{if(n=1,e&&(i=r[0]&2?e["return"]:r[0]?e["throw"]||((i=e["return"])&&i.call(e),0):e.next)&&!(i=i.call(e,r[1])).done)return i;if(e=0,i)r=[r[0]&2,i.value];switch(r[0]){case 0:case 1:i=r;break;case 4:s.label++;return{value:r[1],done:false};case 5:s.label++;e=r[1];r=[0];continue;case 7:r=s.ops.pop();s.trys.pop();continue;default:if(!(i=s.trys,i=i.length>0&&i[i.length-1])&&(r[0]===6||r[0]===2)){s=0;continue}if(r[0]===3&&(!i||r[1]>i[0]&&r[1]<i[3])){s.label=r[1];break}if(r[0]===6&&s.label<i[1]){s.label=i[1];i=r;break}if(i&&s.label<i[2]){s.label=i[2];s.ops.push(r);break}if(i[2])s.ops.pop();s.trys.pop();continue}r=t.call(o,s)}catch(o){r=[6,o];e=0}finally{n=i=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(o,t,s){if(s||arguments.length===2)for(var n=0,e=t.length,i;n<e;n++){if(i||!(n in t)){if(!i)i=Array.prototype.slice.call(t,0,n);i[n]=t[n]}}return o.concat(i||Array.prototype.slice.call(t))};import{r as registerInstance,a as getAssetPath,h,H as Host,F as Fragment,c as createEvent,d as getElement}from"./index-81a199ef.js";import{c as cartStore,s as stripeStore,p as stripeStoreRetrievePayment,o as stripeStoreReset,i as cartStoreUpdateSelectedShippingOption,b as cartStoreGetShippingTransitInfo}from"./cart-c9124cc3.js";import{t as translate,h as handleFetch}from"./localization-5d83fde2.js";import{z as zonosStore,d as zonosStoreFontFamily}from"./zonosStore-e59617f8.js";import{g as getBorderRadius}from"./getBorderRadius-9e4cb3b1.js";import{s as submitGtag,i as isCheckoutMobile}from"./submitGtag-a7d07aec.js";import{c as classes}from"./classes-0d95c529.js";import"./isDarkColor-8696cb70.js";var formatCurrency=function(o){var t=o.amount,s=o.currency,n=o.showCurrencyText;return n?"".concat(new Intl.NumberFormat("en-US",{currency:s,style:"currency"}).format(t)," ").concat(s):new Intl.NumberFormat("en-US",{currency:s,style:"currency"}).format(t)};var zonosCartItemsCss=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--cart-table{width:100%;border:none;border-collapse:collapse;overflow:auto;font-size:var(--amino-font-size-base)}:host .zonos--cart-table .zonos--column{padding:var(--amino-space-8);font-size:var(--amino-font-size-base)}:host .zonos--cart-table .zonos--column:last-child{text-align:right}:host .zonos--cart-table .zonos--column:first-child{width:60px}:host img{min-width:40px}";var ZonosCartItemsStyle0=zonosCartItemsCss;var ZonosCartItems=function(){function o(o){registerInstance(this,o);this.errorImages=[]}o.prototype.render=function(){var o=this;var t;var s=getAssetPath("./assets/empty-item.jpeg");var n=((t=cartStore.exchangeRate)===null||t===void 0?void 0:t.rate)||1;return h(Host,{key:"945bd402bb5f8a73bc02dc8f30d187c43b78050e",class:"zonos--cart-items zonos--elements"},h("table",{key:"600b545e20eb81d7e744c2bf66a9cec2eb68c8e7",class:"zonos--cart-table"},h("tbody",{key:"cd12a4372e97b8018af37433e6b2daba5403e621"},cartStore.items.map((function(t){var e=t.imageUrl;return h("tr",{class:"zonos--cart-item"},h("td",{class:"zonos--column zonos--cart-item-image"},e&&!o.errorImages.includes(e)?h("img",{alt:t.name,onError:function(){o.errorImages=__spreadArray(__spreadArray([],o.errorImages,true),[e],false)},src:t.imageUrl,style:{"min-width":"40px"},width:40}):h("img",{alt:t.name,src:s,width:40})),h("td",{class:"zonos--column zonos--cart-item-name"},h("zonos-text",{type:"label"},t.name)),h("td",{class:"zonos--column zonos--cart-item-price"},h("zonos-text",{type:"semiBoldLabel"},formatCurrency({amount:t.amount*t.quantity*n,currency:cartStore.currency}))))})))))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return o}();ZonosCartItems.style=ZonosCartItemsStyle0;var InfoIcon='<svg viewBox="0 0 17 16" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M1.96704 8.00065C1.96704 4.31875 4.93024 1.33398 8.58554 1.33398C12.2408 1.33398 15.204 4.31875 15.204 8.00065C15.204 11.6826 12.2408 14.6673 8.58554 14.6673C4.93024 14.6673 1.96704 11.6825 1.96704 8.00065Z" fill="#C5C6CA"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M8.58543 4.66016C8.95096 4.66016 9.24728 4.95863 9.24728 5.32682V5.33349C9.24728 5.70168 8.95096 6.00016 8.58543 6.00016C8.2199 6.00016 7.92358 5.70168 7.92358 5.33349V5.32682C7.92358 4.95863 8.2199 4.66016 8.58543 4.66016ZM8.58543 7.33349C8.95096 7.33349 9.24728 7.63197 9.24728 8.00016V10.6668C9.24728 11.035 8.95096 11.3335 8.58543 11.3335C8.2199 11.3335 7.92358 11.035 7.92358 10.6668V8.00016C7.92358 7.63197 8.2199 7.33349 8.58543 7.33349Z" fill="#4D505A"/>\n</svg>\n';var zonosCartSubtotalCss=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--cart-table{width:100%;border:none;border-collapse:collapse;overflow:auto;font-size:var(--amino-font-size-base)}:host .zonos--cart-table .zonos--column{padding:var(--amino-space-20) var(--amino-space-8);vertical-align:top}:host .zonos--cart-table .zonos--column:last-child{text-align:right}:host .zonos--cart-table .zonos--column:first-child{width:60px}:host .zonos--title-with-icon{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:var(--amino-space-8)}:host .zonos--cart-subtotal-title,:host .zonos--cart-subtotal-price{border-bottom:1px solid var(--amino-gray-200)}:host .zonos--cart-duty-tax-price{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:end;align-items:flex-end;gap:5px}:host .zonos--cart-subtotal-price{text-align:right}";var ZonosCartSubtotalStyle0=zonosCartSubtotalCss;var ZonosCartSubtotal=function(){function o(o){registerInstance(this,o)}o.prototype.render=function(){var o=cartStore.total-cartStore.dutiesTaxFees;var t=cartStore.step==="payment"||cartStore.step==="shipping";var s=function(){if(!cartStore.selectedShippingOption){return h(Fragment,null,h("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},translate("Shipping")),h("zonos-text",{class:"zonos--caption",type:"caption"},translate("No shipping method selected")))}return h(Fragment,null,h("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},cartStore.selectedShippingOption.displayName),cartStore.selectedShippingOptionTransitTime&&h("zonos-text",{class:"zonos--caption",type:"caption"},cartStore.selectedShippingOptionTransitTime," ",translate("business days")))};return h(Host,{class:"zonos--cart-subtotal zonos--elements"},h("table",{class:"zonos--cart-table"},h("tr",{class:"zonos--row zonos--cart-subtotal"},h("td",{class:"zonos--column"}),h("td",{class:"zonos--column zonos--cart-subtotal-title"},h("zonos-text",{type:"semiBoldLabel"},translate("Cart subtotal"))),h("td",{class:"zonos--column zonos--cart-subtotal-price"},h("zonos-text",{type:"semiBoldLabel"},formatCurrency({amount:cartStore.subtotal,currency:cartStore.currency})))),h("tr",{class:"zonos--row zonos--cart-shipping"},h("td",{class:"zonos--column"}),h("td",{class:"zonos--column zonos--cart-subtotal-title"},s()),h("td",{class:"zonos--column zonos--cart-subtotal-price"},cartStore.shipping?formatCurrency({amount:cartStore.shipping,currency:cartStore.currency}):"-")),t&&h("tr",{class:"zonos--row zonos--cart-duties"},h("td",{class:"zonos--column"}),h("td",{class:"zonos--column zonos--cart-subtotal-title"},h("div",{class:"zonos--title-with-icon"},h("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},translate("Duties, taxes, and fees")),h("zonos-icon",{content:InfoIcon,size:16})),!!cartStore.isSelectedShippingAboveDeminimis&&h("zonos-text",{color:"gray-800",type:"body"},translate("Order is over the de minimis threshold for both duty and tax"))),h("td",{class:"zonos--column zonos--cart-subtotal-price"},h("div",{class:"zonos--cart-duty-tax-price"},cartStore.dutiesTaxFees?formatCurrency({amount:cartStore.dutiesTaxFees,currency:cartStore.currency}):"-",cartStore.isSelectedShippingGuarantee&&h("zonos-badge",null,translate("Guaranteed"))))),h("tr",{class:"zonos--row zonos--cart-pay-total"},h("td",{class:"zonos--column"}),h("td",{class:"zonos--column"},h("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},translate("Order total"))),h("td",{class:"zonos--column"},h("zonos-text",{type:"semiBoldLabel"},formatCurrency({amount:cartStore.step==="shipping"?o:cartStore.total,currency:cartStore.currency}))))))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return o}();ZonosCartSubtotal.style=ZonosCartSubtotalStyle0;var RemoveIcon$1='<svg color="var(--amino-red-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" data-is-secondary-color="true" fill="var(--amino-red-200)" fill-rule="evenodd"></path><path clip-rule="evenodd" d="M8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>';var SuccessIcon='<svg color="var(--amino-blue-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12Z" data-is-secondary-color="true" fill="var(--amino-blue-100)" fill-rule="evenodd"></path><path clip-rule="evenodd" d="M15.707 9.293a1 1 0 0 1 0 1.414l-3.646 3.647a1.5 1.5 0 0 1-2.122 0l-1.646-1.647a1 1 0 1 1 1.414-1.414L11 12.586l3.293-3.293a1 1 0 0 1 1.414 0Z" fill="currentColor" fill-rule="evenodd"></path></svg>';var zonosCheckoutFinishCss=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host .zonos--group{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;margin-bottom:var(--amino-space-24);border-radius:var(--border-radius, 10px);gap:var(--amino-space-24);max-width:360px;width:auto;margin:auto;margin-top:var(--amino-space-24);background-color:var(--amino-gray-50);padding:var(--amino-space-20)}:host zonos-button{width:100%}:host .loading-wrapper{min-height:300px;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}";var ZonosCheckoutFinishStyle0=zonosCheckoutFinishCss;var ZonosCheckoutFinish=function(){function o(o){var t=this;registerInstance(this,o);this.closeClick=createEvent(this,"closeClick",7);this.pullOrder=function(){return __awaiter(t,void 0,void 0,(function(){var o,t,s,n,e,i,a;return __generator(this,(function(r){switch(r.label){case 0:s="https://v1.route.js.zonos.com";n=cartStore.checkoutSessionId;return[4,handleFetch("".concat(s,"/api/zonos-elements/get-order?checkoutSessionId=").concat(n))];case 1:e=r.sent(),i=e.errors,a=e.json;if(i.length||!(a===null||a===void 0?void 0:a.id)){return[2,null]}return[4,(t=(o=zonosStore.checkoutSettings).onOrderSuccess)===null||t===void 0?void 0:t.call(o,a)];case 2:r.sent();return[2,a]}}))}))};this.handleSuccessBehavior=function(o){var s=zonosStore.checkoutSettings.successBehavior;switch(s){case"REDIRECT_TO_SUCCESS_PAGE":var n=zonosStore.checkoutSettings.successRedirectUrl;if(n){window.location.href="".concat(n,"?zOrderNumber=").concat(o)}break;case"CLOSE_MODAL":t.closeClickHandler();break}};this.getPullOrder=function(o){if(o===void 0){o=0}return __awaiter(t,void 0,void 0,(function(){var t,s;return __generator(this,(function(n){switch(n.label){case 0:return[4,this.pullOrder()];case 1:t=n.sent();if(!t)return[3,2];this.order=t;this.handleSuccessBehavior(t.id);this.isLoading=false;return[3,6];case 2:if(!(!t&&o<5))return[3,5];return[4,new Promise((function(o){return setTimeout(o,1e3)}))];case 3:n.sent();return[4,this.getPullOrder(o+1)];case 4:n.sent();return[3,6];case 5:this.isLoading=false;s={endpoint:"".concat("https://v1.route.js.zonos.com","/api/zonos-elements/get-order"),errors:["Order not found after multiple attempts"],metadata:{checkoutSessionId:cartStore.checkoutSessionId||"",domain:window.location.hostname,storeId:zonosStore.storeId}};void handleFetch("".concat("https://v1.route.js.zonos.com","/api/zonos-elements/log-error"),{body:s,method:"POST"});n.label=6;case 6:return[2]}}))}))};this.checkPaymentStatus=function(){return __awaiter(t,void 0,void 0,(function(){var o,t,s,n,e;return __generator(this,(function(i){switch(i.label){case 0:this.isLoading=true;o=new URLSearchParams(window.location.search).get("payment_intent_client_secret")||stripeStore.clientSecret;if(!(o||this.storybookForceStatus))return[3,2];return[4,stripeStoreRetrievePayment({clientSecret:o,storybookForceStatus:this.storybookForceStatus})];case 1:t=i.sent(),s=t.error,n=t.messages;this.notificationType=s?"error":"success";this.notificationMessages=n||[];this.notificationTitle=s?translate("Payment failed"):translate("You're all set!");if(s){submitGtag("zonos-checkout-payment-fail")}else{submitGtag("zonos-checkout-success");e=new CustomEvent("zonos-checkout-success",{detail:{message:"Zonos Checkout successfully processed order"}});document.dispatchEvent(e)}if(this.notificationType==="success"){this.isLoading=true;void this.getPullOrder()}i.label=2;case 2:stripeStoreReset();this.isLoading=false;return[2]}}))}))};this.closeClickHandler=function(){t.closeClick.emit()};this.borderRadius="ROUNDED";this.storybookForceStatus=undefined;this.overrideNotification=undefined;this.isLoading=true;this.notificationType="success";this.notificationTitle="";this.notificationMessages=[];this.order=null}o.prototype.componentDidLoad=function(){if(this.overrideNotification){this.notificationType=this.overrideNotification.type;this.notificationTitle=this.overrideNotification.title;this.notificationMessages=this.overrideNotification.messages;this.isLoading=false;return}void this.checkPaymentStatus()};o.prototype.render=function(){var o=this;return h(Host,{key:"bdf824c48f7f01bcafd88b17ad758d05ab589ffd",class:"zonos--checkout-finish zonos--elements",style:{"--border-radius":getBorderRadius(this.borderRadius)}},this.isLoading&&h("div",{class:"loading-wrapper"},h("zonos-spinner",null)),!this.isLoading&&h(Fragment,null,h("div",{class:"zonos--group"},this.notificationType==="success"?h("zonos-icon",{color:"blue-800",content:SuccessIcon,size:50}):h("zonos-icon",{color:"red-800",content:RemoveIcon$1,size:50}),h("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},this.notificationTitle),h("zonos-text",null,this.notificationMessages.map((function(o){return h(Fragment,null,o,h("br",null))}))),h("zonos-button",{onClick:function(){return o.closeClickHandler()},size:"md",variant:"primary"},translate("Keep shopping")))))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return o}();ZonosCheckoutFinish.style=ZonosCheckoutFinishStyle0;var zonosCheckoutPaymentCss=".sc-zonos-checkout-payment-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-checkout-payment-h *.sc-zonos-checkout-payment{font-family:var(--font-family, Inter), Inter}.sc-zonos-checkout-payment-h img.sc-zonos-checkout-payment{max-width:100%}.sc-zonos-checkout-payment-h dl.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h dd.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h1.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h2.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h3.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h4.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h5.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h6.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h hr.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h figure.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h p.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h pre.sc-zonos-checkout-payment{margin:0}.sc-zonos-checkout-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-checkout-payment-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-checkout-payment-h .zonos--title.sc-zonos-checkout-payment{margin-bottom:var(--amino-space-24)}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment{margin-bottom:var(--amino-space-20);overflow:auto;padding:5px}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment::-webkit-scrollbar{width:10px}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment::-webkit-scrollbar-track{background:var(--amino-gray-50)}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-checkout-payment-h .zonos--payment-error-banner.sc-zonos-checkout-payment{margin-bottom:var(--amino-space-8)}.sc-zonos-checkout-payment-h .zonos--group-btn.sc-zonos-checkout-payment{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}.sc-zonos-checkout-payment-h .zonos--group-btn.sc-zonos-checkout-payment zonos-button.sc-zonos-checkout-payment{width:calc(100% - 10px)}";var ZonosCheckoutPaymentStyle0=zonosCheckoutPaymentCss;var ZonosCheckoutPayment=function(){function o(o){var t=this;registerInstance(this,o);this.continueClicked=createEvent(this,"continueClicked",7);this.continueClickHandler=function(){t.continueClicked.emit()};this.paymentError=false;this.submitBtnType=undefined;this.continueLoading=false;this.submitBtnColor=undefined;this.disabled=true}o.prototype.watchFormComplete=function(){if(!this.disabled){submitGtag("zonos-checkout-payment-info")}};o.prototype.render=function(){var o=this;var t;if(!stripeStore.stripeElements){return null}this.disabled=!((t=stripeStore.stripePaymentEventData)===null||t===void 0?void 0:t.complete);return h(Host,{class:"zonos--checkout-payment zonos--elements"},h("div",{class:"zonos--group"},h("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},translate("Payment method")),this.paymentError&&h("zonos-banner",{class:"zonos--payment-error-banner",intent:"error"},translate("We couldn't complete your payment. Please verify the payment details and try again.")),h("zonos-payment",null)),h("div",{class:"zonos--group-btn"},h("zonos-button",{backgroundColor:this.submitBtnColor,"is-disabled":this.disabled,loading:this.continueLoading,onClick:function(){return o.continueClickHandler()},size:"lg",variant:this.submitBtnType},"Pay"," ",formatCurrency({amount:cartStore.total,currency:cartStore.currency}))))};Object.defineProperty(o,"watchers",{get:function(){return{disabled:["watchFormComplete"]}},enumerable:false,configurable:true});return o}();ZonosCheckoutPayment.style=ZonosCheckoutPaymentStyle0;var zonosCollapseCss=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{-webkit-transition:all 0.3s ease-in-out;transition:all 0.3s ease-in-out;overflow:hidden}:host div{position:relative}:host iframe{width:0;height:100%;position:absolute;top:0;border:0}";var ZonosCollapseStyle0=zonosCollapseCss;var ZonosCollapse=function(){function o(o){registerInstance(this,o);this.collapsed=false;this.collapseSize=0;this.height=this.el.scrollHeight}o.prototype.getElementHeight=function(){var o="".concat(this.height,"px");var t="".concat(this.collapseSize,"px");return this.collapsed?t:o};o.prototype.componentDidLoad=function(){this.height=this.el.scrollHeight};o.prototype.componentDidRender=function(){var o=this;var t,s,n;(n=(s=(t=this.el.shadowRoot)===null||t===void 0?void 0:t.querySelector("iframe"))===null||s===void 0?void 0:s.contentWindow)===null||n===void 0?void 0:n.addEventListener("resize",(function(){o.height=o.el.scrollHeight}))};o.prototype.render=function(){this.height=this.el.scrollHeight;return h(Host,{key:"fb0d16e7e638d45b3469d7f7d26cd3f3ce9bf318",class:"zonos--elements zonos--collapse",style:{"--font-family":zonosStoreFontFamily(),height:this.getElementHeight()}},h("div",{key:"9da00237f8f14edd9c5bf4b68da545b8c7ab4786"},h("iframe",{key:"402e19d6e96d019a4eccd49af6afdac428c9fae9",class:"height-change-listener",tabindex:"-1",title:"collapse-height-change-listener"}),h("slot",{key:"de6751ac4955c073cc34188ebe22fabed38f780d"})))};Object.defineProperty(o.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return o}();ZonosCollapse.style=ZonosCollapseStyle0;var zonosCustomerInfoCss=".sc-zonos-customer-info-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-customer-info-h *.sc-zonos-customer-info{font-family:var(--font-family, Inter), Inter}.sc-zonos-customer-info-h img.sc-zonos-customer-info{max-width:100%}.sc-zonos-customer-info-h dl.sc-zonos-customer-info,.sc-zonos-customer-info-h dd.sc-zonos-customer-info,.sc-zonos-customer-info-h h1.sc-zonos-customer-info,.sc-zonos-customer-info-h h2.sc-zonos-customer-info,.sc-zonos-customer-info-h h3.sc-zonos-customer-info,.sc-zonos-customer-info-h h4.sc-zonos-customer-info,.sc-zonos-customer-info-h h5.sc-zonos-customer-info,.sc-zonos-customer-info-h h6.sc-zonos-customer-info,.sc-zonos-customer-info-h hr.sc-zonos-customer-info,.sc-zonos-customer-info-h figure.sc-zonos-customer-info,.sc-zonos-customer-info-h p.sc-zonos-customer-info,.sc-zonos-customer-info-h pre.sc-zonos-customer-info{margin:0}.sc-zonos-customer-info-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-customer-info-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-customer-info-h .zonos--title.sc-zonos-customer-info{margin-bottom:var(--amino-space-20)}.sc-zonos-customer-info-h .zonos--link-authentication.sc-zonos-customer-info{margin-bottom:var(--amino-space-32)}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info{margin-bottom:var(--amino-space-20);overflow:auto;padding:5px}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar{width:10px}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar-track{background:var(--amino-gray-50)}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-customer-info-h .zonos--group-btn.sc-zonos-customer-info{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}.sc-zonos-customer-info-h .zonos--group-btn.sc-zonos-customer-info zonos-button.sc-zonos-customer-info{width:calc(100% - 10px)}";var ZonosCustomerInfoStyle0=zonosCustomerInfoCss;var ZonosCustomerInfo=function(){function o(o){var t=this;registerInstance(this,o);this.continueClicked=createEvent(this,"continueClicked",7);this.continueClickHandler=function(){t.continueClicked.emit()};this.continueLoading=false;this.submitBtnType=undefined;this.submitBtnColor=undefined;this.defaultAddress=null;this.disabled=true}o.prototype.watchFormComplete=function(){if(!this.disabled){submitGtag("zonos-checkout-customer-info")}};o.prototype.render=function(){var o=this;var t,s;if(!stripeStore.stripeElements){return null}this.disabled=!((t=stripeStore.stripeAddressEventData)===null||t===void 0?void 0:t.complete)||!((s=stripeStore.stripeLinkEventData)===null||s===void 0?void 0:s.complete);return h(Host,{class:"zonos--customer-info zonos--elements"},h("div",{class:"zonos--group"},h("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},translate("Customer information")),h("zonos-link-authentication",{titleText:translate("Contact")}),h("zonos-address",{defaultAddress:this.defaultAddress,titleText:translate("Address"),type:"shipping"})),h("div",{class:"zonos--group-btn"},h("zonos-button",{backgroundColor:this.submitBtnColor,isDisabled:this.disabled,loading:this.continueLoading,onClick:function(){return o.continueClickHandler()},size:"lg",variant:this.submitBtnType},translate("Continue to shipping"))))};Object.defineProperty(o,"watchers",{get:function(){return{disabled:["watchFormComplete"]}},enumerable:false,configurable:true});return o}();ZonosCustomerInfo.style=ZonosCustomerInfoStyle0;var RemoveIcon='<svg xmlns="https://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="#C5C6CA" fill-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" clip-rule="evenodd"/><path fill="#4D505A" fill-rule="evenodd" d="M8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" clip-rule="evenodd"/></svg>';var zonosDialogCss=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--backdrop,:host .zonos--dialog-layout{opacity:0;z-index:-999;visibility:hidden;-webkit-transition:0.3s all ease;transition:0.3s all ease}:host .zonos--backdrop{width:100vw;height:100vh;left:0px;top:0px;background:var(--amino-backdrop-color);z-index:-999;opacity:0;visibility:hidden;position:fixed}:host .zonos--loading{position:absolute;left:0;right:0;bottom:0;top:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;z-index:10002;background:white}:host .zonos--dialog-layout{width:100vw;height:100vh;left:0;top:0;position:fixed;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;color:var(--amino-text-color);visibility:hidden}:host .zonos--dialog{position:relative;z-index:10001;background:var(--amino-gray-0);max-width:90vw;max-height:90vh;min-height:500px;height:var(--height, auto);width:var(--width, auto);border-radius:var(--border-radius, var(--amino-radius-10));outline:none;-webkit-box-shadow:var(--amino-v3-shadow-xxl);box-shadow:var(--amino-v3-shadow-xxl);border:var(--amino-border);overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host .zonos--header{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;padding:var(--amino-space-16) var(--amino-space-24)}:host .zonos--header .-zonos-stencil-library--header-text{-ms-flex-positive:1;flex-grow:1}:host .zonos--header .zonos--close-button{width:var(--amino-size-md);height:var(--amino-size-md);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;cursor:pointer;border-radius:var(--amino-radius-10)}:host .zonos--header .zonos--close-button:hover{background:var(--amino-hover-color)}:host .zonos--body{padding:var(--amino-space-8) var(--amino-space-24);max-height:100%;height:100%;overflow:auto}:host .zonos--body.zonos--no-body-padding{padding:0}:host .zonos--footer{padding:var(--amino-space-16) var(--amino-space-24)}:host(.open) .zonos--dialog-layout,:host(.open) .zonos--backdrop{visibility:visible}:host(.open) .zonos--backdrop{z-index:10001;opacity:0.65}:host(.open) .zonos--dialog-layout{opacity:1;z-index:10002;-webkit-transform:scale(1);transform:scale(1)}:host(.no-border) .zonos--dialog{border:none}:host(.mobile) .zonos--dialog{max-width:100vw;max-height:100vh;height:100%;width:100%;border-radius:0;-webkit-box-shadow:none;box-shadow:none;border:none}";var ZonosDialogStyle0=zonosDialogCss;var ZonosDialog=function(){function o(o){var t=this;registerInstance(this,o);this.closeDialog=createEvent(this,"closeDialog",7);this.isMobileMode=function(){return t.mobile||window.innerWidth<=768};this.closeButtonHandler=function(){t.closeDialog.emit()};this.clickOutsideDialogHandler=function(o){if(o.target===o.currentTarget&&!t.noClickOutside){t.closeDialog.emit()}};this.open=false;this.headerText="";this.width="460px";this.height=undefined;this.noHeader=false;this.noBodyPadding=false;this.noBorder=false;this.footerRightAction=null;this.borderStyle=undefined;this.noCloseButton=false;this.noClickOutside=false;this.mobile=false;this.isLoading=true;this.isMobile=false}o.prototype.handleWindowResize=function(){this.isMobile=this.isMobileMode()};o.prototype.componentDidLoad=function(){this.isMobile=this.isMobileMode()};o.prototype.render=function(){if(this.open){document.body.style.overflow="hidden"}else{document.body.style.overflow="auto"}var o=getBorderRadius(this.borderStyle);return h(Host,{key:"5a331d58bfd2a0414e9577c4f515cfcd0c630ad5",class:classes(["zonos--elements",this.open&&"open",this.isLoading&&"is-loading",this.noBorder&&"no-border",this.isMobile&&"mobile"]),style:{"--border-radius":o,"--font-family":zonosStoreFontFamily(),"--height":this.height||"initial","--width":this.width}},h("div",{key:"74e3ed8fcdf55e3ae11d6be9c1e18691f1115bb9",class:"zonos--backdrop"}),h("div",{key:"dae7aa8261feeb43d62550832b6b91437da07f9d","aria-hidden":"true",class:"zonos--dialog-layout",onClick:this.clickOutsideDialogHandler},h("div",{key:"ea919a80d1c0589908af64d48845c5263d1b18f4",class:"zonos--dialog"},this.isLoading&&h("div",{class:"zonos--loading"},h("zonos-spinner",{size:30})),(this.headerText||!this.noCloseButton)&&h("div",{class:"zonos--header"},this.headerText&&h("h3",{class:"zonos--header-text"},this.headerText),!this.noCloseButton&&h("zonos-button",{class:"zonos--close-button",icon:h("zonos-icon",{content:RemoveIcon}),noBackground:true,onClick:this.closeButtonHandler})),h("div",{key:"77de036f1fd7ea16936a5521a646df427115e99b",class:classes(["zonos--body",this.noBodyPadding&&"zonos--no-body-padding"])},h("slot",{key:"9da41cdcfe580bb41b672f8185552e29b269e5dd"})),this.footerRightAction&&h("div",{class:"zonos--footer"},h("div",{class:"zonos--footer-right-action"},this.footerRightAction)))))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return o}();ZonosDialog.style=ZonosDialogStyle0;var zonosLogoCss=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex}:host img{-webkit-filter:var(--filter-color);filter:var(--filter-color);width:var(--width)}";var ZonosLogoStyle0=zonosLogoCss;var ZonosLogo=function(){function o(o){registerInstance(this,o);this.theme="LIGHT";this.width="auto";this.class=""}o.prototype.render=function(){var o=this.theme==="DARK"?"invert(100%) sepia(100%) saturate(0%) hue-rotate(288deg) brightness(102%) contrast(102%)":"whiteinvert(0%) sepia(100%) saturate(32%) hue-rotate(92deg) brightness(107%) contrast(107%)";return h(Host,{key:"7ddd949ab91ed0c61ee34ce6ee80da54b3ba3664",class:classes(["zonos--elements zonos--logo",this.class]),style:{"--filter-color":o,"--font-family":zonosStoreFontFamily(),"--width":this.width}},h("img",{key:"1a8d98f7d836f253a21654c84ab0251969362e2f",alt:"Zonos Logo",src:getAssetPath("./assets/ZonosLogo.png")}))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return o}();ZonosLogo.style=ZonosLogoStyle0;var ChevronDownIcon='<svg color="var(--amino-gray-400)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M6.293 9.293a1 1 0 0 1 1.414 0L12 13.586l4.293-4.293a1 1 0 0 1 1.414 1.414l-4.93 4.93a1.1 1.1 0 0 1-1.555 0l-4.93-4.93a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>';var ChevronUpIcon='<svg color="var(--amino-gray-400)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M17.707 14.707a1 1 0 0 1-1.414 0L12 10.414l-4.293 4.293a1 1 0 0 1-1.414-1.414l4.93-4.93a1.1 1.1 0 0 1 1.555 0l4.93 4.93a1 1 0 0 1 0 1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>';var zonosReviewCss=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--total-pay{margin:var(--amino-space-16) 0 var(--amino-space-32)}:host(.mobile){display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;gap:var(--amino-space-24);-ms-flex-pack:justify;justify-content:space-between;padding:var(--amino-space-4) 0;margin-bottom:var(--amino-space-8)}:host(.mobile) .zonos--title{display:-ms-flexbox;display:flex;-ms-flex-item-align:center;align-self:center;gap:var(--amino-space-8)}:host(.mobile) .zonos--total-pay{margin:0}";var ZonosReviewStyle0=zonosReviewCss;var ZonosReview=function(){function o(o){registerInstance(this,o);this.mobile=false;this.collapsed=false;this.isMobile=false}o.prototype.handleWindowResize=function(){this.isMobile=isCheckoutMobile(this.mobile)};o.prototype.componentWillLoad=function(){this.isMobile=isCheckoutMobile(this.mobile)};o.prototype.render=function(){var o=this;var t=this.isMobile?"boldSubheader":"semiBoldLabel";var s=this.isMobile?"boldSubheader":"secondaryPageHeader";var n=this.isMobile?"gray-1200":"gray-800";var e=cartStore.total-cartStore.dutiesTaxFees;var i=function(){if(!o.isMobile){return null}if(!o.collapsed){return h("zonos-icon",{color:"gray-1200",content:ChevronDownIcon})}return h("zonos-icon",{color:"gray-1200",content:ChevronUpIcon})};return h(Host,{class:classes(["zonos--review zonos--elements",this.isMobile&&"mobile"])},h("div",{class:"zonos--title"},h("zonos-text",{color:n,type:t},translate("Pay")," ",zonosStore.organizationName),i()),h("div",{class:"zonos--total-pay"},h("zonos-text",{type:s},formatCurrency({amount:cartStore.step==="shipping"?e:cartStore.total,currency:cartStore.currency}))))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return o}();ZonosReview.style=ZonosReviewStyle0;var zonosShippingCss=".sc-zonos-shipping-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-shipping-h *.sc-zonos-shipping{font-family:var(--font-family, Inter), Inter}.sc-zonos-shipping-h img.sc-zonos-shipping{max-width:100%}.sc-zonos-shipping-h dl.sc-zonos-shipping,.sc-zonos-shipping-h dd.sc-zonos-shipping,.sc-zonos-shipping-h h1.sc-zonos-shipping,.sc-zonos-shipping-h h2.sc-zonos-shipping,.sc-zonos-shipping-h h3.sc-zonos-shipping,.sc-zonos-shipping-h h4.sc-zonos-shipping,.sc-zonos-shipping-h h5.sc-zonos-shipping,.sc-zonos-shipping-h h6.sc-zonos-shipping,.sc-zonos-shipping-h hr.sc-zonos-shipping,.sc-zonos-shipping-h figure.sc-zonos-shipping,.sc-zonos-shipping-h p.sc-zonos-shipping,.sc-zonos-shipping-h pre.sc-zonos-shipping{margin:0}.sc-zonos-shipping-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-shipping-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-shipping-h .zonos--title.sc-zonos-shipping{margin-bottom:var(--amino-space-24)}.sc-zonos-shipping-h .zonos--shipping-method-title.sc-zonos-shipping{margin-bottom:var(--amino-space-16)}.sc-zonos-shipping-h .zonos-shipping-rich-radio.sc-zonos-shipping{margin-bottom:var(--amino-space-24)}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping{margin-bottom:var(--amino-space-20);overflow:auto;padding:5px}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar{width:10px}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar-track{background:var(--amino-gray-50)}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-shipping-h .zonos--group-btn.sc-zonos-shipping{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}.sc-zonos-shipping-h .zonos--group-btn.sc-zonos-shipping zonos-button.sc-zonos-shipping{width:calc(100% - 10px)}.sc-zonos-shipping-h zonos-banner.sc-zonos-shipping{margin-top:var(--amino-space-24)}";var ZonosShippingStyle0=zonosShippingCss;var ZonosShipping=function(){function o(o){var t=this;registerInstance(this,o);this.continueClicked=createEvent(this,"continueClicked",7);this.handleRadioSelected=function(o){return __awaiter(t,void 0,void 0,(function(){var t,s,n;var e=this;return __generator(this,(function(i){switch(i.label){case 0:this.selectedShippingMethod=o.detail;if(!this.selectedShippingMethod){return[2]}s=((t=cartStore.shippingData)===null||t===void 0?void 0:t.find((function(o){var t;return o.id===((t=e.selectedShippingMethod)===null||t===void 0?void 0:t.value)})))||null;if(!s){return[2]}return[4,cartStoreUpdateSelectedShippingOption(s)];case 1:n=i.sent();if(!n){return[2]}this.disabled=false;return[2]}}))}))};this.continueClickHandler=function(){t.continueClicked.emit()};this.continueLoading=false;this.submitBtnColor=undefined;this.submitBtnType=undefined;this.selectedShippingMethod=null;this.disabled=true}o.prototype.watchFormComplete=function(){if(!this.disabled){submitGtag("zonos-checkout-shipping-info")}};o.prototype.render=function(){var o=this;var t;var s=(t=cartStore.shippingData)===null||t===void 0?void 0:t.flatMap((function(o){var t,s;var n=cartStoreGetShippingTransitInfo(o),e=n.expectedDate,i=n.maxTransit,a=n.minTransit;var r=e?"".concat(translate("Expected delivery")," ").concat(e):"";var c=a&&i?"(".concat(a,"-").concat(i," ").concat(translate("business days"),")"):"";var h=((s=(t=cartStore.landedCostData)===null||t===void 0?void 0:t.find((function(t){var s;return((s=t.landedCost)===null||s===void 0?void 0:s.shipmentRating.id)===o.id})))===null||s===void 0?void 0:s.subtotals.shipping)||0;return{caption:c,label:o.displayName,price:formatCurrency({amount:h,currency:cartStore.currency}),sublabel:r,value:o.id}}));return h(Host,{class:"zonos--shipping zonos--elements"},h("div",{class:"zonos--group"},h("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},translate("Shipping information")),h("zonos-text",{class:"zonos--shipping-method-title",type:"semiBoldLabel"},translate("Shipping method")),!(s===null||s===void 0?void 0:s.length)?h("zonos-banner",{bannerTitle:"No shipping methods found - try editing your address or contacting support if the error persists",intent:"error"}):h("zonos-shipping-rich-radio",{items:s||[],onRadioSelected:function(t){return o.handleRadioSelected(t)}})),h("zonos-button",{backgroundColor:this.submitBtnColor,"is-disabled":this.disabled,loading:this.continueLoading,onClick:function(){return o.continueClickHandler()},size:"lg",variant:this.submitBtnType},translate("Go to payment")))};Object.defineProperty(o,"watchers",{get:function(){return{disabled:["watchFormComplete"]}},enumerable:false,configurable:true});return o}();ZonosShipping.style=ZonosShippingStyle0;export{ZonosCartItems as zonos_cart_items,ZonosCartSubtotal as zonos_cart_subtotal,ZonosCheckoutFinish as zonos_checkout_finish,ZonosCheckoutPayment as zonos_checkout_payment,ZonosCollapse as zonos_collapse,ZonosCustomerInfo as zonos_customer_info,ZonosDialog as zonos_dialog,ZonosLogo as zonos_logo,ZonosReview as zonos_review,ZonosShipping as zonos_shipping};
1
+ var __awaiter=this&&this.__awaiter||function(o,t,s,n){function e(o){return o instanceof s?o:new s((function(t){t(o)}))}return new(s||(s=Promise))((function(s,i){function a(o){try{c(n.next(o))}catch(o){i(o)}}function r(o){try{c(n["throw"](o))}catch(o){i(o)}}function c(o){o.done?s(o.value):e(o.value).then(a,r)}c((n=n.apply(o,t||[])).next())}))};var __generator=this&&this.__generator||function(o,t){var s={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,e,i,a;return a={next:r(0),throw:r(1),return:r(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function r(o){return function(t){return c([o,t])}}function c(r){if(n)throw new TypeError("Generator is already executing.");while(a&&(a=0,r[0]&&(s=0)),s)try{if(n=1,e&&(i=r[0]&2?e["return"]:r[0]?e["throw"]||((i=e["return"])&&i.call(e),0):e.next)&&!(i=i.call(e,r[1])).done)return i;if(e=0,i)r=[r[0]&2,i.value];switch(r[0]){case 0:case 1:i=r;break;case 4:s.label++;return{value:r[1],done:false};case 5:s.label++;e=r[1];r=[0];continue;case 7:r=s.ops.pop();s.trys.pop();continue;default:if(!(i=s.trys,i=i.length>0&&i[i.length-1])&&(r[0]===6||r[0]===2)){s=0;continue}if(r[0]===3&&(!i||r[1]>i[0]&&r[1]<i[3])){s.label=r[1];break}if(r[0]===6&&s.label<i[1]){s.label=i[1];i=r;break}if(i&&s.label<i[2]){s.label=i[2];s.ops.push(r);break}if(i[2])s.ops.pop();s.trys.pop();continue}r=t.call(o,s)}catch(o){r=[6,o];e=0}finally{n=i=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(o,t,s){if(s||arguments.length===2)for(var n=0,e=t.length,i;n<e;n++){if(i||!(n in t)){if(!i)i=Array.prototype.slice.call(t,0,n);i[n]=t[n]}}return o.concat(i||Array.prototype.slice.call(t))};import{r as registerInstance,a as getAssetPath,h,H as Host,F as Fragment,c as createEvent,d as getElement}from"./index-81a199ef.js";import{c as cartStore,s as stripeStore,p as stripeStoreRetrievePayment,o as stripeStoreReset,i as cartStoreUpdateSelectedShippingOption,b as cartStoreGetShippingTransitInfo}from"./cart-ba9b0d4c.js";import{t as translate,h as handleFetch}from"./localization-5d83fde2.js";import{z as zonosStore,d as zonosStoreFontFamily}from"./zonosStore-e59617f8.js";import{g as getBorderRadius}from"./getBorderRadius-9e4cb3b1.js";import{s as submitGtag,i as isCheckoutMobile}from"./submitGtag-a7d07aec.js";import{c as classes}from"./classes-0d95c529.js";import"./isDarkColor-8696cb70.js";var formatCurrency=function(o){var t=o.amount,s=o.currency,n=o.showCurrencyText;return n?"".concat(new Intl.NumberFormat("en-US",{currency:s,style:"currency"}).format(t)," ").concat(s):new Intl.NumberFormat("en-US",{currency:s,style:"currency"}).format(t)};var zonosCartItemsCss=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--cart-table{width:100%;border:none;border-collapse:collapse;overflow:auto;font-size:var(--amino-font-size-base)}:host .zonos--cart-table .zonos--column{padding:var(--amino-space-8);font-size:var(--amino-font-size-base)}:host .zonos--cart-table .zonos--column:last-child{text-align:right}:host .zonos--cart-table .zonos--column:first-child{width:60px}:host img{min-width:40px}";var ZonosCartItemsStyle0=zonosCartItemsCss;var ZonosCartItems=function(){function o(o){registerInstance(this,o);this.errorImages=[]}o.prototype.render=function(){var o=this;var t;var s=getAssetPath("./assets/empty-item.jpeg");var n=((t=cartStore.exchangeRate)===null||t===void 0?void 0:t.rate)||1;return h(Host,{key:"945bd402bb5f8a73bc02dc8f30d187c43b78050e",class:"zonos--cart-items zonos--elements"},h("table",{key:"600b545e20eb81d7e744c2bf66a9cec2eb68c8e7",class:"zonos--cart-table"},h("tbody",{key:"cd12a4372e97b8018af37433e6b2daba5403e621"},cartStore.items.map((function(t){var e=t.imageUrl;return h("tr",{class:"zonos--cart-item"},h("td",{class:"zonos--column zonos--cart-item-image"},e&&!o.errorImages.includes(e)?h("img",{alt:t.name,onError:function(){o.errorImages=__spreadArray(__spreadArray([],o.errorImages,true),[e],false)},src:t.imageUrl,style:{"min-width":"40px"},width:40}):h("img",{alt:t.name,src:s,width:40})),h("td",{class:"zonos--column zonos--cart-item-name"},h("zonos-text",{type:"label"},t.name)),h("td",{class:"zonos--column zonos--cart-item-price"},h("zonos-text",{type:"semiBoldLabel"},formatCurrency({amount:t.amount*t.quantity*n,currency:cartStore.currency}))))})))))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return o}();ZonosCartItems.style=ZonosCartItemsStyle0;var InfoIcon='<svg viewBox="0 0 17 16" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M1.96704 8.00065C1.96704 4.31875 4.93024 1.33398 8.58554 1.33398C12.2408 1.33398 15.204 4.31875 15.204 8.00065C15.204 11.6826 12.2408 14.6673 8.58554 14.6673C4.93024 14.6673 1.96704 11.6825 1.96704 8.00065Z" fill="#C5C6CA"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M8.58543 4.66016C8.95096 4.66016 9.24728 4.95863 9.24728 5.32682V5.33349C9.24728 5.70168 8.95096 6.00016 8.58543 6.00016C8.2199 6.00016 7.92358 5.70168 7.92358 5.33349V5.32682C7.92358 4.95863 8.2199 4.66016 8.58543 4.66016ZM8.58543 7.33349C8.95096 7.33349 9.24728 7.63197 9.24728 8.00016V10.6668C9.24728 11.035 8.95096 11.3335 8.58543 11.3335C8.2199 11.3335 7.92358 11.035 7.92358 10.6668V8.00016C7.92358 7.63197 8.2199 7.33349 8.58543 7.33349Z" fill="#4D505A"/>\n</svg>\n';var zonosCartSubtotalCss=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--cart-table{width:100%;border:none;border-collapse:collapse;overflow:auto;font-size:var(--amino-font-size-base)}:host .zonos--cart-table .zonos--column{padding:var(--amino-space-20) var(--amino-space-8);vertical-align:top}:host .zonos--cart-table .zonos--column:last-child{text-align:right}:host .zonos--cart-table .zonos--column:first-child{width:60px}:host .zonos--title-with-icon{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:var(--amino-space-8)}:host .zonos--cart-subtotal-title,:host .zonos--cart-subtotal-price{border-bottom:1px solid var(--amino-gray-200)}:host .zonos--cart-duty-tax-price{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:end;align-items:flex-end;gap:5px}:host .zonos--cart-subtotal-price{text-align:right}";var ZonosCartSubtotalStyle0=zonosCartSubtotalCss;var ZonosCartSubtotal=function(){function o(o){registerInstance(this,o)}o.prototype.render=function(){var o=cartStore.total-cartStore.dutiesTaxFees;var t=cartStore.step==="payment"||cartStore.step==="shipping";var s=function(){if(!cartStore.selectedShippingOption){return h(Fragment,null,h("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},translate("Shipping")),h("zonos-text",{class:"zonos--caption",type:"caption"},translate("No shipping method selected")))}return h(Fragment,null,h("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},cartStore.selectedShippingOption.displayName),cartStore.selectedShippingOptionTransitTime&&h("zonos-text",{class:"zonos--caption",type:"caption"},cartStore.selectedShippingOptionTransitTime," ",translate("business days")))};return h(Host,{class:"zonos--cart-subtotal zonos--elements"},h("table",{class:"zonos--cart-table"},h("tr",{class:"zonos--row zonos--cart-subtotal"},h("td",{class:"zonos--column"}),h("td",{class:"zonos--column zonos--cart-subtotal-title"},h("zonos-text",{type:"semiBoldLabel"},translate("Cart subtotal"))),h("td",{class:"zonos--column zonos--cart-subtotal-price"},h("zonos-text",{type:"semiBoldLabel"},formatCurrency({amount:cartStore.subtotal,currency:cartStore.currency})))),h("tr",{class:"zonos--row zonos--cart-shipping"},h("td",{class:"zonos--column"}),h("td",{class:"zonos--column zonos--cart-subtotal-title"},s()),h("td",{class:"zonos--column zonos--cart-subtotal-price"},cartStore.shipping?formatCurrency({amount:cartStore.shipping,currency:cartStore.currency}):"-")),t&&h("tr",{class:"zonos--row zonos--cart-duties"},h("td",{class:"zonos--column"}),h("td",{class:"zonos--column zonos--cart-subtotal-title"},h("div",{class:"zonos--title-with-icon"},h("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},translate("Duties, taxes, and fees")),h("zonos-icon",{content:InfoIcon,size:16})),!!cartStore.isSelectedShippingAboveDeminimis&&h("zonos-text",{color:"gray-800",type:"body"},translate("Order is over the de minimis threshold for both duty and tax"))),h("td",{class:"zonos--column zonos--cart-subtotal-price"},h("div",{class:"zonos--cart-duty-tax-price"},cartStore.dutiesTaxFees?formatCurrency({amount:cartStore.dutiesTaxFees,currency:cartStore.currency}):"-",cartStore.isSelectedShippingGuarantee&&h("zonos-badge",null,translate("Guaranteed"))))),h("tr",{class:"zonos--row zonos--cart-pay-total"},h("td",{class:"zonos--column"}),h("td",{class:"zonos--column"},h("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},translate("Order total"))),h("td",{class:"zonos--column"},h("zonos-text",{type:"semiBoldLabel"},formatCurrency({amount:cartStore.step==="shipping"?o:cartStore.total,currency:cartStore.currency}))))))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return o}();ZonosCartSubtotal.style=ZonosCartSubtotalStyle0;var RemoveIcon$1='<svg color="var(--amino-red-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" data-is-secondary-color="true" fill="var(--amino-red-200)" fill-rule="evenodd"></path><path clip-rule="evenodd" d="M8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>';var SuccessIcon='<svg color="var(--amino-blue-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12Z" data-is-secondary-color="true" fill="var(--amino-blue-100)" fill-rule="evenodd"></path><path clip-rule="evenodd" d="M15.707 9.293a1 1 0 0 1 0 1.414l-3.646 3.647a1.5 1.5 0 0 1-2.122 0l-1.646-1.647a1 1 0 1 1 1.414-1.414L11 12.586l3.293-3.293a1 1 0 0 1 1.414 0Z" fill="currentColor" fill-rule="evenodd"></path></svg>';var zonosCheckoutFinishCss=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host .zonos--group{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;margin-bottom:var(--amino-space-24);border-radius:var(--border-radius, 10px);gap:var(--amino-space-24);max-width:360px;width:auto;margin:auto;margin-top:var(--amino-space-24);background-color:var(--amino-gray-50);padding:var(--amino-space-20)}:host zonos-button{width:100%}:host .loading-wrapper{min-height:300px;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}";var ZonosCheckoutFinishStyle0=zonosCheckoutFinishCss;var ZonosCheckoutFinish=function(){function o(o){var t=this;registerInstance(this,o);this.closeClick=createEvent(this,"closeClick",7);this.pullOrder=function(){return __awaiter(t,void 0,void 0,(function(){var o,t,s,n,e,i,a;return __generator(this,(function(r){switch(r.label){case 0:s="https://v1.route.js.zonos.com";n=cartStore.checkoutSessionId;return[4,handleFetch("".concat(s,"/api/zonos-elements/get-order?checkoutSessionId=").concat(n))];case 1:e=r.sent(),i=e.errors,a=e.json;if(i.length||!(a===null||a===void 0?void 0:a.id)){return[2,null]}return[4,(t=(o=zonosStore.checkoutSettings).onOrderSuccess)===null||t===void 0?void 0:t.call(o,a)];case 2:r.sent();return[2,a]}}))}))};this.handleSuccessBehavior=function(o){var s=zonosStore.checkoutSettings.successBehavior;switch(s){case"REDIRECT_TO_SUCCESS_PAGE":var n=zonosStore.checkoutSettings.successRedirectUrl;if(n){window.location.href="".concat(n,"?zOrderNumber=").concat(o)}break;case"CLOSE_MODAL":t.closeClickHandler();break}};this.getPullOrder=function(o){if(o===void 0){o=0}return __awaiter(t,void 0,void 0,(function(){var t,s;return __generator(this,(function(n){switch(n.label){case 0:return[4,this.pullOrder()];case 1:t=n.sent();if(!t)return[3,2];this.order=t;this.handleSuccessBehavior(t.id);this.isLoading=false;return[3,6];case 2:if(!(!t&&o<5))return[3,5];return[4,new Promise((function(o){return setTimeout(o,1e3)}))];case 3:n.sent();return[4,this.getPullOrder(o+1)];case 4:n.sent();return[3,6];case 5:this.isLoading=false;s={endpoint:"".concat("https://v1.route.js.zonos.com","/api/zonos-elements/get-order"),errors:["Order not found after multiple attempts"],metadata:{checkoutSessionId:cartStore.checkoutSessionId||"",domain:window.location.hostname,storeId:zonosStore.storeId}};void handleFetch("".concat("https://v1.route.js.zonos.com","/api/zonos-elements/log-error"),{body:s,method:"POST"});n.label=6;case 6:return[2]}}))}))};this.checkPaymentStatus=function(){return __awaiter(t,void 0,void 0,(function(){var o,t,s,n,e;return __generator(this,(function(i){switch(i.label){case 0:this.isLoading=true;o=new URLSearchParams(window.location.search).get("payment_intent_client_secret")||stripeStore.clientSecret;if(!(o||this.storybookForceStatus))return[3,2];return[4,stripeStoreRetrievePayment({clientSecret:o,storybookForceStatus:this.storybookForceStatus})];case 1:t=i.sent(),s=t.error,n=t.messages;this.notificationType=s?"error":"success";this.notificationMessages=n||[];this.notificationTitle=s?translate("Payment failed"):translate("You're all set!");if(s){submitGtag("zonos-checkout-payment-fail")}else{submitGtag("zonos-checkout-success");e=new CustomEvent("zonos-checkout-success",{detail:{message:"Zonos Checkout successfully processed order"}});document.dispatchEvent(e)}if(this.notificationType==="success"){this.isLoading=true;void this.getPullOrder()}i.label=2;case 2:stripeStoreReset();this.isLoading=false;return[2]}}))}))};this.closeClickHandler=function(){t.closeClick.emit()};this.borderRadius="ROUNDED";this.storybookForceStatus=undefined;this.overrideNotification=undefined;this.isLoading=true;this.notificationType="success";this.notificationTitle="";this.notificationMessages=[];this.order=null}o.prototype.componentDidLoad=function(){if(this.overrideNotification){this.notificationType=this.overrideNotification.type;this.notificationTitle=this.overrideNotification.title;this.notificationMessages=this.overrideNotification.messages;this.isLoading=false;return}void this.checkPaymentStatus()};o.prototype.render=function(){var o=this;return h(Host,{key:"bdf824c48f7f01bcafd88b17ad758d05ab589ffd",class:"zonos--checkout-finish zonos--elements",style:{"--border-radius":getBorderRadius(this.borderRadius)}},this.isLoading&&h("div",{class:"loading-wrapper"},h("zonos-spinner",null)),!this.isLoading&&h(Fragment,null,h("div",{class:"zonos--group"},this.notificationType==="success"?h("zonos-icon",{color:"blue-800",content:SuccessIcon,size:50}):h("zonos-icon",{color:"red-800",content:RemoveIcon$1,size:50}),h("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},this.notificationTitle),h("zonos-text",null,this.notificationMessages.map((function(o){return h(Fragment,null,o,h("br",null))}))),h("zonos-button",{onClick:function(){return o.closeClickHandler()},size:"md",variant:"primary"},translate("Keep shopping")))))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return o}();ZonosCheckoutFinish.style=ZonosCheckoutFinishStyle0;var zonosCheckoutPaymentCss=".sc-zonos-checkout-payment-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-checkout-payment-h *.sc-zonos-checkout-payment{font-family:var(--font-family, Inter), Inter}.sc-zonos-checkout-payment-h img.sc-zonos-checkout-payment{max-width:100%}.sc-zonos-checkout-payment-h dl.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h dd.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h1.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h2.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h3.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h4.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h5.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h6.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h hr.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h figure.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h p.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h pre.sc-zonos-checkout-payment{margin:0}.sc-zonos-checkout-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-checkout-payment-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-checkout-payment-h .zonos--title.sc-zonos-checkout-payment{margin-bottom:var(--amino-space-24)}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment{margin-bottom:var(--amino-space-20);overflow:auto;padding:5px}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment::-webkit-scrollbar{width:10px}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment::-webkit-scrollbar-track{background:var(--amino-gray-50)}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-checkout-payment-h .zonos--payment-error-banner.sc-zonos-checkout-payment{margin-bottom:var(--amino-space-8)}.sc-zonos-checkout-payment-h .zonos--group-btn.sc-zonos-checkout-payment{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}.sc-zonos-checkout-payment-h .zonos--group-btn.sc-zonos-checkout-payment zonos-button.sc-zonos-checkout-payment{width:calc(100% - 10px)}";var ZonosCheckoutPaymentStyle0=zonosCheckoutPaymentCss;var ZonosCheckoutPayment=function(){function o(o){var t=this;registerInstance(this,o);this.continueClicked=createEvent(this,"continueClicked",7);this.continueClickHandler=function(){t.continueClicked.emit()};this.paymentError=false;this.submitBtnType=undefined;this.continueLoading=false;this.submitBtnColor=undefined;this.disabled=true}o.prototype.watchFormComplete=function(){if(!this.disabled){submitGtag("zonos-checkout-payment-info")}};o.prototype.render=function(){var o=this;var t;if(!stripeStore.stripeElements){return null}this.disabled=!((t=stripeStore.stripePaymentEventData)===null||t===void 0?void 0:t.complete);return h(Host,{class:"zonos--checkout-payment zonos--elements"},h("div",{class:"zonos--group"},h("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},translate("Payment method")),this.paymentError&&h("zonos-banner",{class:"zonos--payment-error-banner",intent:"error"},translate("We couldn't complete your payment. Please verify the payment details and try again.")),h("zonos-payment",null)),h("div",{class:"zonos--group-btn"},h("zonos-button",{backgroundColor:this.submitBtnColor,"is-disabled":this.disabled,loading:this.continueLoading,onClick:function(){return o.continueClickHandler()},size:"lg",variant:this.submitBtnType},"Pay"," ",formatCurrency({amount:cartStore.total,currency:cartStore.currency}))))};Object.defineProperty(o,"watchers",{get:function(){return{disabled:["watchFormComplete"]}},enumerable:false,configurable:true});return o}();ZonosCheckoutPayment.style=ZonosCheckoutPaymentStyle0;var zonosCollapseCss=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{-webkit-transition:all 0.3s ease-in-out;transition:all 0.3s ease-in-out;overflow:hidden}:host div{position:relative}:host iframe{width:0;height:100%;position:absolute;top:0;border:0}";var ZonosCollapseStyle0=zonosCollapseCss;var ZonosCollapse=function(){function o(o){registerInstance(this,o);this.collapsed=false;this.collapseSize=0;this.height=this.el.scrollHeight}o.prototype.getElementHeight=function(){var o="".concat(this.height,"px");var t="".concat(this.collapseSize,"px");return this.collapsed?t:o};o.prototype.componentDidLoad=function(){this.height=this.el.scrollHeight};o.prototype.componentDidRender=function(){var o=this;var t,s,n;(n=(s=(t=this.el.shadowRoot)===null||t===void 0?void 0:t.querySelector("iframe"))===null||s===void 0?void 0:s.contentWindow)===null||n===void 0?void 0:n.addEventListener("resize",(function(){o.height=o.el.scrollHeight}))};o.prototype.render=function(){this.height=this.el.scrollHeight;return h(Host,{key:"fb0d16e7e638d45b3469d7f7d26cd3f3ce9bf318",class:"zonos--elements zonos--collapse",style:{"--font-family":zonosStoreFontFamily(),height:this.getElementHeight()}},h("div",{key:"9da00237f8f14edd9c5bf4b68da545b8c7ab4786"},h("iframe",{key:"402e19d6e96d019a4eccd49af6afdac428c9fae9",class:"height-change-listener",tabindex:"-1",title:"collapse-height-change-listener"}),h("slot",{key:"de6751ac4955c073cc34188ebe22fabed38f780d"})))};Object.defineProperty(o.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return o}();ZonosCollapse.style=ZonosCollapseStyle0;var zonosCustomerInfoCss=".sc-zonos-customer-info-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-customer-info-h *.sc-zonos-customer-info{font-family:var(--font-family, Inter), Inter}.sc-zonos-customer-info-h img.sc-zonos-customer-info{max-width:100%}.sc-zonos-customer-info-h dl.sc-zonos-customer-info,.sc-zonos-customer-info-h dd.sc-zonos-customer-info,.sc-zonos-customer-info-h h1.sc-zonos-customer-info,.sc-zonos-customer-info-h h2.sc-zonos-customer-info,.sc-zonos-customer-info-h h3.sc-zonos-customer-info,.sc-zonos-customer-info-h h4.sc-zonos-customer-info,.sc-zonos-customer-info-h h5.sc-zonos-customer-info,.sc-zonos-customer-info-h h6.sc-zonos-customer-info,.sc-zonos-customer-info-h hr.sc-zonos-customer-info,.sc-zonos-customer-info-h figure.sc-zonos-customer-info,.sc-zonos-customer-info-h p.sc-zonos-customer-info,.sc-zonos-customer-info-h pre.sc-zonos-customer-info{margin:0}.sc-zonos-customer-info-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-customer-info-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-customer-info-h .zonos--title.sc-zonos-customer-info{margin-bottom:var(--amino-space-20)}.sc-zonos-customer-info-h .zonos--link-authentication.sc-zonos-customer-info{margin-bottom:var(--amino-space-32)}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info{margin-bottom:var(--amino-space-20);overflow:auto;padding:5px}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar{width:10px}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar-track{background:var(--amino-gray-50)}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-customer-info-h .zonos--group-btn.sc-zonos-customer-info{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}.sc-zonos-customer-info-h .zonos--group-btn.sc-zonos-customer-info zonos-button.sc-zonos-customer-info{width:calc(100% - 10px)}";var ZonosCustomerInfoStyle0=zonosCustomerInfoCss;var ZonosCustomerInfo=function(){function o(o){var t=this;registerInstance(this,o);this.continueClicked=createEvent(this,"continueClicked",7);this.continueClickHandler=function(){t.continueClicked.emit()};this.continueLoading=false;this.submitBtnType=undefined;this.submitBtnColor=undefined;this.defaultAddress=null;this.disabled=true}o.prototype.watchFormComplete=function(){if(!this.disabled){submitGtag("zonos-checkout-customer-info")}};o.prototype.render=function(){var o=this;var t,s;if(!stripeStore.stripeElements){return null}this.disabled=!((t=stripeStore.stripeAddressEventData)===null||t===void 0?void 0:t.complete)||!((s=stripeStore.stripeLinkEventData)===null||s===void 0?void 0:s.complete);return h(Host,{class:"zonos--customer-info zonos--elements"},h("div",{class:"zonos--group"},h("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},translate("Customer information")),h("zonos-link-authentication",{titleText:translate("Contact")}),h("zonos-address",{defaultAddress:this.defaultAddress,titleText:translate("Address"),type:"shipping"})),h("div",{class:"zonos--group-btn"},h("zonos-button",{backgroundColor:this.submitBtnColor,isDisabled:this.disabled,loading:this.continueLoading,onClick:function(){return o.continueClickHandler()},size:"lg",variant:this.submitBtnType},translate("Continue to shipping"))))};Object.defineProperty(o,"watchers",{get:function(){return{disabled:["watchFormComplete"]}},enumerable:false,configurable:true});return o}();ZonosCustomerInfo.style=ZonosCustomerInfoStyle0;var RemoveIcon='<svg xmlns="https://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="#C5C6CA" fill-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" clip-rule="evenodd"/><path fill="#4D505A" fill-rule="evenodd" d="M8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" clip-rule="evenodd"/></svg>';var zonosDialogCss=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--backdrop,:host .zonos--dialog-layout{opacity:0;z-index:-999;visibility:hidden;-webkit-transition:0.3s all ease;transition:0.3s all ease}:host .zonos--backdrop{width:100vw;height:100vh;left:0px;top:0px;background:var(--amino-backdrop-color);z-index:-999;opacity:0;visibility:hidden;position:fixed}:host .zonos--loading{position:absolute;left:0;right:0;bottom:0;top:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;z-index:10002;background:white}:host .zonos--dialog-layout{width:100vw;height:100vh;left:0;top:0;position:fixed;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;color:var(--amino-text-color);visibility:hidden}:host .zonos--dialog{position:relative;z-index:10001;background:var(--amino-gray-0);max-width:90vw;max-height:90vh;min-height:500px;height:var(--height, auto);width:var(--width, auto);border-radius:var(--border-radius, var(--amino-radius-10));outline:none;-webkit-box-shadow:var(--amino-v3-shadow-xxl);box-shadow:var(--amino-v3-shadow-xxl);border:var(--amino-border);overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host .zonos--header{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;padding:var(--amino-space-16) var(--amino-space-24)}:host .zonos--header .-zonos-stencil-library--header-text{-ms-flex-positive:1;flex-grow:1}:host .zonos--header .zonos--close-button{width:var(--amino-size-md);height:var(--amino-size-md);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;cursor:pointer;border-radius:var(--amino-radius-10)}:host .zonos--header .zonos--close-button:hover{background:var(--amino-hover-color)}:host .zonos--body{padding:var(--amino-space-8) var(--amino-space-24);max-height:100%;height:100%;overflow:auto}:host .zonos--body.zonos--no-body-padding{padding:0}:host .zonos--footer{padding:var(--amino-space-16) var(--amino-space-24)}:host(.open) .zonos--dialog-layout,:host(.open) .zonos--backdrop{visibility:visible}:host(.open) .zonos--backdrop{z-index:10001;opacity:0.65}:host(.open) .zonos--dialog-layout{opacity:1;z-index:10002;-webkit-transform:scale(1);transform:scale(1)}:host(.no-border) .zonos--dialog{border:none}:host(.mobile) .zonos--dialog{max-width:100vw;max-height:100vh;height:100%;width:100%;border-radius:0;-webkit-box-shadow:none;box-shadow:none;border:none}";var ZonosDialogStyle0=zonosDialogCss;var ZonosDialog=function(){function o(o){var t=this;registerInstance(this,o);this.closeDialog=createEvent(this,"closeDialog",7);this.isMobileMode=function(){return t.mobile||window.innerWidth<=768};this.closeButtonHandler=function(){t.closeDialog.emit()};this.clickOutsideDialogHandler=function(o){if(o.target===o.currentTarget&&!t.noClickOutside){t.closeDialog.emit()}};this.open=false;this.headerText="";this.width="460px";this.height=undefined;this.noHeader=false;this.noBodyPadding=false;this.noBorder=false;this.footerRightAction=null;this.borderStyle=undefined;this.noCloseButton=false;this.noClickOutside=false;this.mobile=false;this.isLoading=true;this.isMobile=false}o.prototype.handleWindowResize=function(){this.isMobile=this.isMobileMode()};o.prototype.componentDidLoad=function(){this.isMobile=this.isMobileMode()};o.prototype.render=function(){if(this.open){document.body.style.overflow="hidden"}else{document.body.style.overflow="auto"}var o=getBorderRadius(this.borderStyle);return h(Host,{key:"5a331d58bfd2a0414e9577c4f515cfcd0c630ad5",class:classes(["zonos--elements",this.open&&"open",this.isLoading&&"is-loading",this.noBorder&&"no-border",this.isMobile&&"mobile"]),style:{"--border-radius":o,"--font-family":zonosStoreFontFamily(),"--height":this.height||"initial","--width":this.width}},h("div",{key:"74e3ed8fcdf55e3ae11d6be9c1e18691f1115bb9",class:"zonos--backdrop"}),h("div",{key:"dae7aa8261feeb43d62550832b6b91437da07f9d","aria-hidden":"true",class:"zonos--dialog-layout",onClick:this.clickOutsideDialogHandler},h("div",{key:"ea919a80d1c0589908af64d48845c5263d1b18f4",class:"zonos--dialog"},this.isLoading&&h("div",{class:"zonos--loading"},h("zonos-spinner",{size:30})),(this.headerText||!this.noCloseButton)&&h("div",{class:"zonos--header"},this.headerText&&h("h3",{class:"zonos--header-text"},this.headerText),!this.noCloseButton&&h("zonos-button",{class:"zonos--close-button",icon:h("zonos-icon",{content:RemoveIcon}),noBackground:true,onClick:this.closeButtonHandler})),h("div",{key:"77de036f1fd7ea16936a5521a646df427115e99b",class:classes(["zonos--body",this.noBodyPadding&&"zonos--no-body-padding"])},h("slot",{key:"9da41cdcfe580bb41b672f8185552e29b269e5dd"})),this.footerRightAction&&h("div",{class:"zonos--footer"},h("div",{class:"zonos--footer-right-action"},this.footerRightAction)))))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return o}();ZonosDialog.style=ZonosDialogStyle0;var zonosLogoCss=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex}:host img{-webkit-filter:var(--filter-color);filter:var(--filter-color);width:var(--width)}";var ZonosLogoStyle0=zonosLogoCss;var ZonosLogo=function(){function o(o){registerInstance(this,o);this.theme="LIGHT";this.width="auto";this.class=""}o.prototype.render=function(){var o=this.theme==="DARK"?"invert(100%) sepia(100%) saturate(0%) hue-rotate(288deg) brightness(102%) contrast(102%)":"whiteinvert(0%) sepia(100%) saturate(32%) hue-rotate(92deg) brightness(107%) contrast(107%)";return h(Host,{key:"7ddd949ab91ed0c61ee34ce6ee80da54b3ba3664",class:classes(["zonos--elements zonos--logo",this.class]),style:{"--filter-color":o,"--font-family":zonosStoreFontFamily(),"--width":this.width}},h("img",{key:"1a8d98f7d836f253a21654c84ab0251969362e2f",alt:"Zonos Logo",src:getAssetPath("./assets/ZonosLogo.png")}))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return o}();ZonosLogo.style=ZonosLogoStyle0;var ChevronDownIcon='<svg color="var(--amino-gray-400)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M6.293 9.293a1 1 0 0 1 1.414 0L12 13.586l4.293-4.293a1 1 0 0 1 1.414 1.414l-4.93 4.93a1.1 1.1 0 0 1-1.555 0l-4.93-4.93a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>';var ChevronUpIcon='<svg color="var(--amino-gray-400)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M17.707 14.707a1 1 0 0 1-1.414 0L12 10.414l-4.293 4.293a1 1 0 0 1-1.414-1.414l4.93-4.93a1.1 1.1 0 0 1 1.555 0l4.93 4.93a1 1 0 0 1 0 1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>';var zonosReviewCss=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--total-pay{margin:var(--amino-space-16) 0 var(--amino-space-32)}:host(.mobile){display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;gap:var(--amino-space-24);-ms-flex-pack:justify;justify-content:space-between;padding:var(--amino-space-4) 0;margin-bottom:var(--amino-space-8)}:host(.mobile) .zonos--title{display:-ms-flexbox;display:flex;-ms-flex-item-align:center;align-self:center;gap:var(--amino-space-8)}:host(.mobile) .zonos--total-pay{margin:0}";var ZonosReviewStyle0=zonosReviewCss;var ZonosReview=function(){function o(o){registerInstance(this,o);this.mobile=false;this.collapsed=false;this.isMobile=false}o.prototype.handleWindowResize=function(){this.isMobile=isCheckoutMobile(this.mobile)};o.prototype.componentWillLoad=function(){this.isMobile=isCheckoutMobile(this.mobile)};o.prototype.render=function(){var o=this;var t=this.isMobile?"boldSubheader":"semiBoldLabel";var s=this.isMobile?"boldSubheader":"secondaryPageHeader";var n=this.isMobile?"gray-1200":"gray-800";var e=cartStore.total-cartStore.dutiesTaxFees;var i=function(){if(!o.isMobile){return null}if(!o.collapsed){return h("zonos-icon",{color:"gray-1200",content:ChevronDownIcon})}return h("zonos-icon",{color:"gray-1200",content:ChevronUpIcon})};return h(Host,{class:classes(["zonos--review zonos--elements",this.isMobile&&"mobile"])},h("div",{class:"zonos--title"},h("zonos-text",{color:n,type:t},translate("Pay")," ",zonosStore.organizationName),i()),h("div",{class:"zonos--total-pay"},h("zonos-text",{type:s},formatCurrency({amount:cartStore.step==="shipping"?e:cartStore.total,currency:cartStore.currency}))))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return o}();ZonosReview.style=ZonosReviewStyle0;var zonosShippingCss=".sc-zonos-shipping-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-shipping-h *.sc-zonos-shipping{font-family:var(--font-family, Inter), Inter}.sc-zonos-shipping-h img.sc-zonos-shipping{max-width:100%}.sc-zonos-shipping-h dl.sc-zonos-shipping,.sc-zonos-shipping-h dd.sc-zonos-shipping,.sc-zonos-shipping-h h1.sc-zonos-shipping,.sc-zonos-shipping-h h2.sc-zonos-shipping,.sc-zonos-shipping-h h3.sc-zonos-shipping,.sc-zonos-shipping-h h4.sc-zonos-shipping,.sc-zonos-shipping-h h5.sc-zonos-shipping,.sc-zonos-shipping-h h6.sc-zonos-shipping,.sc-zonos-shipping-h hr.sc-zonos-shipping,.sc-zonos-shipping-h figure.sc-zonos-shipping,.sc-zonos-shipping-h p.sc-zonos-shipping,.sc-zonos-shipping-h pre.sc-zonos-shipping{margin:0}.sc-zonos-shipping-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-shipping-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-shipping-h .zonos--title.sc-zonos-shipping{margin-bottom:var(--amino-space-24)}.sc-zonos-shipping-h .zonos--shipping-method-title.sc-zonos-shipping{margin-bottom:var(--amino-space-16)}.sc-zonos-shipping-h .zonos-shipping-rich-radio.sc-zonos-shipping{margin-bottom:var(--amino-space-24)}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping{margin-bottom:var(--amino-space-20);overflow:auto;padding:5px}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar{width:10px}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar-track{background:var(--amino-gray-50)}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-shipping-h .zonos--group-btn.sc-zonos-shipping{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}.sc-zonos-shipping-h .zonos--group-btn.sc-zonos-shipping zonos-button.sc-zonos-shipping{width:calc(100% - 10px)}.sc-zonos-shipping-h zonos-banner.sc-zonos-shipping{margin-top:var(--amino-space-24)}";var ZonosShippingStyle0=zonosShippingCss;var ZonosShipping=function(){function o(o){var t=this;registerInstance(this,o);this.continueClicked=createEvent(this,"continueClicked",7);this.handleRadioSelected=function(o){return __awaiter(t,void 0,void 0,(function(){var t,s,n;var e=this;return __generator(this,(function(i){switch(i.label){case 0:this.selectedShippingMethod=o.detail;if(!this.selectedShippingMethod){return[2]}s=((t=cartStore.shippingData)===null||t===void 0?void 0:t.find((function(o){var t;return o.id===((t=e.selectedShippingMethod)===null||t===void 0?void 0:t.value)})))||null;if(!s){return[2]}return[4,cartStoreUpdateSelectedShippingOption(s)];case 1:n=i.sent();if(!n){return[2]}this.disabled=false;return[2]}}))}))};this.continueClickHandler=function(){t.continueClicked.emit()};this.continueLoading=false;this.submitBtnColor=undefined;this.submitBtnType=undefined;this.selectedShippingMethod=null;this.disabled=true}o.prototype.watchFormComplete=function(){if(!this.disabled){submitGtag("zonos-checkout-shipping-info")}};o.prototype.render=function(){var o=this;var t;var s=(t=cartStore.shippingData)===null||t===void 0?void 0:t.flatMap((function(o){var t,s;var n=cartStoreGetShippingTransitInfo(o),e=n.expectedDate,i=n.maxTransit,a=n.minTransit;var r=e?"".concat(translate("Expected delivery")," ").concat(e):"";var c=a&&i?"(".concat(a,"-").concat(i," ").concat(translate("business days"),")"):"";var h=((s=(t=cartStore.landedCostData)===null||t===void 0?void 0:t.find((function(t){var s;return((s=t.landedCost)===null||s===void 0?void 0:s.shipmentRating.id)===o.id})))===null||s===void 0?void 0:s.subtotals.shipping)||0;return{caption:c,label:o.displayName,price:formatCurrency({amount:h,currency:cartStore.currency}),sublabel:r,value:o.id}}));return h(Host,{class:"zonos--shipping zonos--elements"},h("div",{class:"zonos--group"},h("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},translate("Shipping information")),h("zonos-text",{class:"zonos--shipping-method-title",type:"semiBoldLabel"},translate("Shipping method")),!(s===null||s===void 0?void 0:s.length)?h("zonos-banner",{bannerTitle:"No shipping methods found - try editing your address or contacting support if the error persists",intent:"error"}):h("zonos-shipping-rich-radio",{items:s||[],onRadioSelected:function(t){return o.handleRadioSelected(t)}})),h("zonos-button",{backgroundColor:this.submitBtnColor,"is-disabled":this.disabled,loading:this.continueLoading,onClick:function(){return o.continueClickHandler()},size:"lg",variant:this.submitBtnType},translate("Go to payment")))};Object.defineProperty(o,"watchers",{get:function(){return{disabled:["watchFormComplete"]}},enumerable:false,configurable:true});return o}();ZonosShipping.style=ZonosShippingStyle0;export{ZonosCartItems as zonos_cart_items,ZonosCartSubtotal as zonos_cart_subtotal,ZonosCheckoutFinish as zonos_checkout_finish,ZonosCheckoutPayment as zonos_checkout_payment,ZonosCollapse as zonos_collapse,ZonosCustomerInfo as zonos_customer_info,ZonosDialog as zonos_dialog,ZonosLogo as zonos_logo,ZonosReview as zonos_review,ZonosShipping as zonos_shipping};
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(o,t,e,n){function s(o){return o instanceof e?o:new e((function(t){t(o)}))}return new(e||(e=Promise))((function(e,c){function r(o){try{a(n.next(o))}catch(o){c(o)}}function i(o){try{a(n["throw"](o))}catch(o){c(o)}}function a(o){o.done?e(o.value):s(o.value).then(r,i)}a((n=n.apply(o,t||[])).next())}))};var __generator=this&&this.__generator||function(o,t){var e={label:0,sent:function(){if(c[0]&1)throw c[1];return c[1]},trys:[],ops:[]},n,s,c,r;return r={next:i(0),throw:i(1),return:i(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function i(o){return function(t){return a([o,t])}}function a(i){if(n)throw new TypeError("Generator is already executing.");while(r&&(r=0,i[0]&&(e=0)),e)try{if(n=1,s&&(c=i[0]&2?s["return"]:i[0]?s["throw"]||((c=s["return"])&&c.call(s),0):s.next)&&!(c=c.call(s,i[1])).done)return c;if(s=0,c)i=[i[0]&2,c.value];switch(i[0]){case 0:case 1:c=i;break;case 4:e.label++;return{value:i[1],done:false};case 5:e.label++;s=i[1];i=[0];continue;case 7:i=e.ops.pop();e.trys.pop();continue;default:if(!(c=e.trys,c=c.length>0&&c[c.length-1])&&(i[0]===6||i[0]===2)){e=0;continue}if(i[0]===3&&(!c||i[1]>c[0]&&i[1]<c[3])){e.label=i[1];break}if(i[0]===6&&e.label<c[1]){e.label=c[1];c=i;break}if(c&&e.label<c[2]){e.label=c[2];e.ops.push(i);break}if(c[2])e.ops.pop();e.trys.pop();continue}i=t.call(o,e)}catch(o){i=[6,o];s=0}finally{n=c=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}};import{r as registerInstance,h,F as Fragment,H as Host}from"./index-81a199ef.js";import{k as initStripeElements,c as cartStore,h as cartStoreUpdateItems,g as cartStoreReset,s as stripeStore,l as stripeStoreInitCheckoutSession,j as cartStoreUpdateToErrorState,m as stripeStorePrefetchLandedCost,d as cartStoreNextStep,n as stripeStoreConfirmPayment,o as stripeStoreReset,e as cartStorePreviousStep}from"./cart-c9124cc3.js";import{a as localizationStore,l as log,t as translate}from"./localization-5d83fde2.js";import{z as zonosStore,m as mergeConfig}from"./zonosStore-e59617f8.js";import{s as submitGtag,i as isCheckoutMobile}from"./submitGtag-a7d07aec.js";import{c as classes}from"./classes-0d95c529.js";import{g as getBorderRadius}from"./getBorderRadius-9e4cb3b1.js";import{i as isDarkColor}from"./isDarkColor-8696cb70.js";var LeftArrow='<svg color="var(--amino-gray-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M9.707 16.707a1 1 0 0 1-1.414 0l-3.647-3.646a1.5 1.5 0 0 1 0-2.122l3.647-3.646a1 1 0 0 1 1.414 1.414L7.414 11H19a1 1 0 1 1 0 2H7.414l2.293 2.293a1 1 0 0 1 0 1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>';var MessageIcon='<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 RemoveIcon='<svg color="var(--amino-gray-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" data-is-secondary-color="true" fill="var(--amino-gray-200)" fill-rule="evenodd"></path><path clip-rule="evenodd" d="M8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>';var zonosCheckoutCss=".sc-zonos-checkout-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-checkout-h *.sc-zonos-checkout{font-family:var(--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::-webkit-scrollbar{width:10px}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-track{background:var(--amino-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(--border-radius, var(--amino-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:var(--amino-space-48) var(--amino-space-56)}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout{background-color:var(--primary-color, var(--amino-gray-0));border-right:1px solid var(--amino-gray-200)}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{background-color:var(--amino-gray-0);padding-bottom:var(--amino-space-80)}.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(--amino-gray-0);-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:var(--amino-space-24);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--header.sc-zonos-checkout img.sc-zonos-checkout{width:150px;min-width:150px}.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}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--back-button.sc-zonos-checkout{margin-bottom:var(--amino-space-24)}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{padding:0 var(--amino-space-8) var(--amino-space-8)}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--payment-error-banner.sc-zonos-checkout{margin-top:var(--amino-space-24)}.sc-zonos-checkout-h .zonos--right.sc-zonos-checkout{position:relative}.sc-zonos-checkout-h .zonos--right.sc-zonos-checkout .zonos--close-button.sc-zonos-checkout{position:absolute;right:var(--amino-space-24);top:var(--amino-space-24)}.sc-zonos-checkout-h .zonos--footer.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-pack:end;justify-content:flex-end;-ms-flex-align:center;align-items:center;position:absolute;bottom:var(--amino-space-32);right:var(--amino-space-56);gap:var(--amino-space-8)}.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.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--checkout-default-message.sc-zonos-checkout{margin-left:var(--amino-space-76);margin-bottom:var(--amino-space-8)}.preview.sc-zonos-checkout-h{min-width:500px;margin:auto}.preview.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{border:var(--amino-border)}.preview.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{padding:var(--amino-space-32)}.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:var(--amino-space-12)}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout{-ms-flex-order:2;order:2}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{-ms-flex-order:1;order:1;padding-top:var(--amino-space-16)}.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;gap:var(--amino-space-16);margin-top:var(--amino-space-24);border:var(--amino-border);border-radius:var(--border-radius, var(--amino-radius-10));background-color:var(--amino-gray-50);padding:var(--amino-space-12);margin-top:var(--amino-space-32)}.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}.mobile.sc-zonos-checkout-h .zonos--footer.sc-zonos-checkout{bottom:0;left:0;padding:var(--amino-space-12);position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background-color:var(--amino-gray-0)}";var ZonosCheckoutStyle0=zonosCheckoutCss;var ZonosCheckout=function(){function o(o){var t=this;registerInstance(this,o);this.applyStripeTheme=function(){return __awaiter(t,void 0,void 0,(function(){var o,t,e,n;return __generator(this,(function(s){switch(s.label){case 0:n=((o=this.appearanceSettingsOverride)===null||o===void 0?void 0:o.theme)||zonosStore.appearance.theme;return[4,initStripeElements({overrideBorderRaidus:(t=this.appearanceSettingsOverride)===null||t===void 0?void 0:t.style,overridePrimaryColor:(e=this.appearanceSettingsOverride)===null||e===void 0?void 0:e.colorPrimary,overrideTheme:this.isMobile?n:undefined})];case 1:s.sent();return[2]}}))}))};this.isShippableCountry=function(o){if(o===void 0){o=true}if(!localizationStore.localizationLoaded){return false}if(!localizationStore.isShippableCountry){if(o){log("Checkout: not shippable country")}return false}return true};this.getCurrentLocalePageEnum=function(){switch(cartStore.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.defaultAddress=null;this.forceDialogOpen=false;this.open=this.forceDialogOpen;this.stripe=window.Zonos.stripe;this.submitLoading=false;this.paymentError=false;this.collapseReviewMobile=false;this.isAttachError=false;this.isMobile=false;this.zonosReviewRef=undefined;this.storybookPaymentStatusOverride=undefined}o.prototype.initCartInfoHandler=function(o){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){t=o.detail;void cartStoreUpdateItems(t);return[2]}))}))};o.prototype.closeDialogHandler=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){submitGtag("zonos-checkout-close");this.open=this.forceDialogOpen||false;if(!this.preview&&cartStore.step==="finish"){cartStoreReset()}cartStore.step="customer-info";return[2]}))}))};o.prototype.buildCartAndInit=function(){return __awaiter(this,void 0,void 0,(function(){var o,t;return __generator(this,(function(e){switch(e.label){case 0:if(!zonosStore.checkoutSettings.buildCartDetail)return[3,3];log("build cart detail");return[4,zonosStore.checkoutSettings.buildCartDetail()];case 1:o=e.sent();return[4,cartStoreUpdateItems(o)];case 2:e.sent();e.label=3;case 3:if(!!stripeStore.clientSecret)return[3,5];return[4,stripeStoreInitCheckoutSession()];case 4:t=e.sent();log("stripeStoreInitCheckoutSession: ".concat(t));if(!t){return[2,false]}e.label=5;case 5:return[4,this.applyStripeTheme()];case 6:e.sent();return[2,true]}}))}))};o.prototype.attachCheckout=function(){var o=this;var t=zonosStore.checkoutSettings.placeOrderButtonSelector;if(!t){return}var e=document.querySelectorAll(t);e.forEach((function(t){var e=t.getAttribute("data-zonos-checkout-attached");if(e){return}t.addEventListener("click",(function(t){return __awaiter(o,void 0,void 0,(function(){var o,e;return __generator(this,(function(n){switch(n.label){case 0:if(!this.isShippableCountry()){return[2]}t.preventDefault();t.stopPropagation();log("zonos checkout button clicked");stripeStore.isFetchingSession=true;this.open=true;n.label=1;case 1:n.trys.push([1,3,,4]);return[4,this.buildCartAndInit()];case 2:o=n.sent();if(!o){throw new Error("Error building cart")}submitGtag("zonos-checkout-start");return[3,4];case 3:e=n.sent();stripeStore.isFetchingSession=false;cartStoreUpdateToErrorState({messages:[translate("There's been an error creating your checkout session. Please reload and try again or contact support if the error persists")],title:translate("Error creating Checkout")});return[3,4];case 4:return[2]}}))}))}));t.removeAttribute("disabled");t.setAttribute("data-zonos-checkout-attached","true")}))};o.prototype.appearanceSettingsOverrideChanged=function(){if(!this.appearanceSettingsOverride){return}void this.applyStripeTheme()};o.prototype.init=function(){return __awaiter(this,void 0,void 0,(function(){var o,t;var e=this;return __generator(this,(function(n){stripeStore.stripe=window.Zonos.stripe;this.stripe=window.Zonos.stripe;o=setInterval((function(){var t=window.Zonos.internationalHideSelector;if(!t){clearInterval(o);return}var n=e.isShippableCountry(false);var s=document.querySelectorAll(t);if(!n){s===null||s===void 0?void 0:s.forEach((function(o){var t=o;var e=t.getAttribute("data-zonos-checkout-original-display")||getComputedStyle(t).display;t.style.display=e||"initial"}));return}s===null||s===void 0?void 0:s.forEach((function(o){var t=o;var e=t.style.display;t.setAttribute("data-zonos-checkout-original-display",e);t.style.display="none"}))}),100);t=setInterval((function(){stripeStore.stripe=window.Zonos.stripe;e.stripe=window.Zonos.stripe;if(!e.stripe){log("waiting for stripe to be loaded");return}if(e.storybookPaymentStatusOverride){clearInterval(t);return}log("init checkout");if(e.preview||e.forceDialogOpen){void e.buildCartAndInit()}else{e.attachCheckout();var o=new MutationObserver((function(){e.attachCheckout()}));o.observe(document.body,{childList:true,subtree:true})}clearInterval(t)}),50);setTimeout((function(){clearInterval(t)}),1e4);return[2]}))}))};o.prototype.setToFinishStep=function(o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){cartStore.step="finish";this.storybookPaymentStatusOverride=o;return[2]}))}))};o.prototype.handleCustomerInfoContinue=function(){return __awaiter(this,void 0,void 0,(function(){var o;var t=this;return __generator(this,(function(e){switch(e.label){case 0:this.submitLoading=true;return[4,stripeStorePrefetchLandedCost()];case 1:e.sent();o=setInterval((function(){if(cartStore.landedCostData||!stripeStore.isFetchingLandedCost){if(cartStore.landedCostData){cartStoreNextStep()}t.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(t){this.submitLoading=true;setTimeout((function(){cartStoreNextStep();o.submitLoading=false}),500);return[2]}))}))};o.prototype.handleCheckoutPaymentContinue=function(){return __awaiter(this,void 0,void 0,(function(){var o;return __generator(this,(function(t){switch(t.label){case 0:this.paymentError=false;this.submitLoading=true;t.label=1;case 1:t.trys.push([1,3,,4]);return[4,stripeStoreConfirmPayment()];case 2:t.sent();cartStoreNextStep();return[3,4];case 3:o=t.sent();console.error(o);this.paymentError=true;return[3,4];case 4:this.submitLoading=false;return[2]}}))}))};o.prototype.handleFinishClick=function(){return __awaiter(this,void 0,void 0,(function(){var o,t;return __generator(this,(function(e){switch(e.label){case 0:stripeStoreReset();if(!this.preview)return[3,2];cartStore.step="customer-info";return[4,this.init()];case 1:e.sent();return[2];case 2:cartStoreReset();o=window.location.href;t=o.split("?")[0];window.history.replaceState({},document.title,t);this.open=false;window.location.reload();return[2]}}))}))};o.prototype.handleBackClick=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:if(!(cartStore.step==="customer-info"))return[3,2];return[4,this.closeDialogHandler()];case 1:o.sent();return[2];case 2:cartStorePreviousStep();return[2]}}))}))};o.prototype.handleWindowResize=function(){this.isMobile=isCheckoutMobile(this.mobile);void this.applyStripeTheme();log("mobile: ".concat(this.isMobile))};o.prototype.handleMobileChange=function(){this.isMobile=isCheckoutMobile(this.mobile);void this.applyStripeTheme();log("mobile: ".concat(this.isMobile))};o.prototype.componentWillLoad=function(){void this.init();this.isMobile=isCheckoutMobile(this.mobile);log("mobile: ".concat(this.isMobile))};o.prototype.disconnectedCallback=function(){stripeStoreReset();cartStoreReset()};o.prototype.render=function(){var o=this;var t;var e=cartStore.step!=="finish"&&cartStore.step!=="error"&&!stripeStore.stripeElements||stripeStore.isFetchingSession;var n=mergeConfig(zonosStore.appearance,this.appearanceSettingsOverride),s=n.colorPrimary,c=n.colorSecondary,r=n.logoUrl,i=n.style;var a=zonosStore.appearance.zonosAttribution==="ENABLED";var u=zonosStore.appearance.theme;var l=s&&isDarkColor(s)?"DARK":"LIGHT";var d=this.isMobile?u:l;var f=!this.isMobile?c:undefined;var z=localizationStore.customMessages;var m=((t=z.find((function(o){return o.pageName==="checkout_default"})))===null||t===void 0?void 0:t.message)||"Know about duties and taxes before you buy. Shop with confidence!";var k=this.getCurrentLocalePageEnum();var v=z.filter((function(o){return o.pageName===k}));var p=function(){return h("div",{class:"zonos--logo"},r&&h("img",{alt:"".concat(zonosStore.organizationName," logo"),src:r,width:100}))};var g=function(){return h("zonos-v-stack",null,p(),v.map((function(o){return h("zonos-custom-message",{icon:MessageIcon,message:o.message})})),h("div",null,h("zonos-button",{class:"zonos--back-button",icon:h("zonos-icon",{content:LeftArrow}),noBackground:true,noPaddingLeft:true,noPaddingRight:true,onClick:function(){return o.handleBackClick()},theme:d},translate("Back"))))};var b=function(){return a&&h("div",{class:"zonos--footer","data-theme":u},h("zonos-text",{type:"hintText"},translate("Powered by")),h("zonos-logo",{theme:u,width:"100px"}))};var w=function(){var t;var e=o.isMobile?"primary":undefined;var n=(t=o.zonosReviewRef)===null||t===void 0?void 0:t.scrollHeight;return h("div",{class:"zonos--content",style:{"--border-radius":getBorderRadius(i)}},cartStore.step!=="finish"&&cartStore.step!=="error"&&h(Fragment,null,h("div",{class:"zonos--left","data-theme":d,style:{"--primary-color":!o.isMobile?s:""}},!o.isMobile&&g(),cartStore.step==="customer-info"&&h("zonos-customer-info",{continueLoading:o.submitLoading,defaultAddress:o.defaultAddress,onContinueClicked:function(){return o.handleCustomerInfoContinue()},submitBtnColor:f,submitBtnType:e}),cartStore.step==="shipping"&&h("zonos-shipping",{continueLoading:o.submitLoading,onContinueClicked:function(){return o.handleShippingContinue()},submitBtnColor:f,submitBtnType:e}),cartStore.step==="payment"&&h("zonos-checkout-payment",{continueLoading:o.submitLoading,onContinueClicked:function(){return o.handleCheckoutPaymentContinue()},paymentError:o.paymentError,submitBtnColor:f,submitBtnType:e})),h("div",{class:"zonos--right","data-theme":u},o.isMobile&&g(),!o.isMobile&&h("zonos-button",{class:"zonos--close-button",icon:h("zonos-icon",{content:RemoveIcon}),noBackground:true,onClick:function(){return o.closeDialogHandler()}}),h("div",{class:"flex--wrapper"},h("div",{class:"zonos--wrapper"},h("zonos-collapse",{collapseSize:n,collapsed:o.collapseReviewMobile&&o.isMobile},h("zonos-review",{collapsed:o.collapseReviewMobile,mobile:o.isMobile,onClick:function(){if(!o.isMobile){return}o.collapseReviewMobile=!o.collapseReviewMobile},ref:function(t){return o.zonosReviewRef=t}}),h("zonos-cart-items",null))),h("zonos-v-stack",{spacing:16},h("zonos-cart-subtotal",null),h("zonos-custom-message",{class:"zonos--checkout-default-message",icon:MessageIcon,message:m}))),!o.isMobile&&b()),o.isMobile&&b()),(cartStore.step==="finish"||cartStore.step==="error")&&h("div",{class:"zonos--done","data-theme":u},h("div",{class:"zonos--header"},p(),h("zonos-button",{class:"zonos--close-button",icon:h("zonos-icon",{content:RemoveIcon}),noBackground:true,onClick:function(){return o.handleFinishClick()},theme:u})),h("zonos-checkout-finish",{borderRadius:i,onCloseClick:function(){return o.handleFinishClick()},overrideNotification:cartStore.step==="error"&&!!cartStore.error?Object.assign(Object.assign({},cartStore.error),{type:"error"}):undefined,storybookForceStatus:o.storybookPaymentStatusOverride})))};return h(Host,{class:classes(["zonos--checkout zonos--elements",a&&"has-footer",this.preview&&"preview",this.isMobile&&"mobile"])},this.preview?w():h("zonos-dialog",{borderStyle:i,"data-theme":u,height:"980px",isLoading:e,mobile:this.isMobile,noBodyPadding:true,noBorder:true,noClickOutside:true,noCloseButton:true,onCloseDialog:function(){return o.closeDialogHandler()},open:this.open,width:"1200px"},w()))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});Object.defineProperty(o,"watchers",{get:function(){return{appearanceSettingsOverride:["appearanceSettingsOverrideChanged"],mobile:["handleMobileChange"]}},enumerable:false,configurable:true});return o}();ZonosCheckout.style=ZonosCheckoutStyle0;export{ZonosCheckout as zonos_checkout};
1
+ var __awaiter=this&&this.__awaiter||function(o,t,e,n){function s(o){return o instanceof e?o:new e((function(t){t(o)}))}return new(e||(e=Promise))((function(e,c){function r(o){try{a(n.next(o))}catch(o){c(o)}}function i(o){try{a(n["throw"](o))}catch(o){c(o)}}function a(o){o.done?e(o.value):s(o.value).then(r,i)}a((n=n.apply(o,t||[])).next())}))};var __generator=this&&this.__generator||function(o,t){var e={label:0,sent:function(){if(c[0]&1)throw c[1];return c[1]},trys:[],ops:[]},n,s,c,r;return r={next:i(0),throw:i(1),return:i(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function i(o){return function(t){return a([o,t])}}function a(i){if(n)throw new TypeError("Generator is already executing.");while(r&&(r=0,i[0]&&(e=0)),e)try{if(n=1,s&&(c=i[0]&2?s["return"]:i[0]?s["throw"]||((c=s["return"])&&c.call(s),0):s.next)&&!(c=c.call(s,i[1])).done)return c;if(s=0,c)i=[i[0]&2,c.value];switch(i[0]){case 0:case 1:c=i;break;case 4:e.label++;return{value:i[1],done:false};case 5:e.label++;s=i[1];i=[0];continue;case 7:i=e.ops.pop();e.trys.pop();continue;default:if(!(c=e.trys,c=c.length>0&&c[c.length-1])&&(i[0]===6||i[0]===2)){e=0;continue}if(i[0]===3&&(!c||i[1]>c[0]&&i[1]<c[3])){e.label=i[1];break}if(i[0]===6&&e.label<c[1]){e.label=c[1];c=i;break}if(c&&e.label<c[2]){e.label=c[2];e.ops.push(i);break}if(c[2])e.ops.pop();e.trys.pop();continue}i=t.call(o,e)}catch(o){i=[6,o];s=0}finally{n=c=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}};import{r as registerInstance,h,F as Fragment,H as Host}from"./index-81a199ef.js";import{k as initStripeElements,c as cartStore,h as cartStoreUpdateItems,g as cartStoreReset,s as stripeStore,l as stripeStoreInitCheckoutSession,j as cartStoreUpdateToErrorState,m as stripeStorePrefetchLandedCost,d as cartStoreNextStep,n as stripeStoreConfirmPayment,o as stripeStoreReset,e as cartStorePreviousStep}from"./cart-ba9b0d4c.js";import{a as localizationStore,l as log,t as translate}from"./localization-5d83fde2.js";import{z as zonosStore,m as mergeConfig}from"./zonosStore-e59617f8.js";import{s as submitGtag,i as isCheckoutMobile}from"./submitGtag-a7d07aec.js";import{c as classes}from"./classes-0d95c529.js";import{g as getBorderRadius}from"./getBorderRadius-9e4cb3b1.js";import{i as isDarkColor}from"./isDarkColor-8696cb70.js";var LeftArrow='<svg color="var(--amino-gray-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M9.707 16.707a1 1 0 0 1-1.414 0l-3.647-3.646a1.5 1.5 0 0 1 0-2.122l3.647-3.646a1 1 0 0 1 1.414 1.414L7.414 11H19a1 1 0 1 1 0 2H7.414l2.293 2.293a1 1 0 0 1 0 1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>';var MessageIcon='<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 RemoveIcon='<svg color="var(--amino-gray-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" data-is-secondary-color="true" fill="var(--amino-gray-200)" fill-rule="evenodd"></path><path clip-rule="evenodd" d="M8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>';var zonosCheckoutCss=".sc-zonos-checkout-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-checkout-h *.sc-zonos-checkout{font-family:var(--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::-webkit-scrollbar{width:10px}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-track{background:var(--amino-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(--border-radius, var(--amino-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:var(--amino-space-48) var(--amino-space-56)}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout{background-color:var(--primary-color, var(--amino-gray-0));border-right:1px solid var(--amino-gray-200)}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{background-color:var(--amino-gray-0);padding-bottom:var(--amino-space-80)}.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(--amino-gray-0);-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:var(--amino-space-24);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--header.sc-zonos-checkout img.sc-zonos-checkout{width:150px;min-width:150px}.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}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--back-button.sc-zonos-checkout{margin-bottom:var(--amino-space-24)}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{padding:0 var(--amino-space-8) var(--amino-space-8)}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--payment-error-banner.sc-zonos-checkout{margin-top:var(--amino-space-24)}.sc-zonos-checkout-h .zonos--right.sc-zonos-checkout{position:relative}.sc-zonos-checkout-h .zonos--right.sc-zonos-checkout .zonos--close-button.sc-zonos-checkout{position:absolute;right:var(--amino-space-24);top:var(--amino-space-24)}.sc-zonos-checkout-h .zonos--footer.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-pack:end;justify-content:flex-end;-ms-flex-align:center;align-items:center;position:absolute;bottom:var(--amino-space-32);right:var(--amino-space-56);gap:var(--amino-space-8)}.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.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--checkout-default-message.sc-zonos-checkout{margin-left:var(--amino-space-76);margin-bottom:var(--amino-space-8)}.preview.sc-zonos-checkout-h{min-width:500px;margin:auto}.preview.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{border:var(--amino-border)}.preview.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{padding:var(--amino-space-32)}.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:var(--amino-space-12)}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout{-ms-flex-order:2;order:2}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{-ms-flex-order:1;order:1;padding-top:var(--amino-space-16)}.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;gap:var(--amino-space-16);margin-top:var(--amino-space-24);border:var(--amino-border);border-radius:var(--border-radius, var(--amino-radius-10));background-color:var(--amino-gray-50);padding:var(--amino-space-12);margin-top:var(--amino-space-32)}.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}.mobile.sc-zonos-checkout-h .zonos--footer.sc-zonos-checkout{bottom:0;left:0;padding:var(--amino-space-12);position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background-color:var(--amino-gray-0)}";var ZonosCheckoutStyle0=zonosCheckoutCss;var ZonosCheckout=function(){function o(o){var t=this;registerInstance(this,o);this.applyStripeTheme=function(){return __awaiter(t,void 0,void 0,(function(){var o,t,e,n;return __generator(this,(function(s){switch(s.label){case 0:n=((o=this.appearanceSettingsOverride)===null||o===void 0?void 0:o.theme)||zonosStore.appearance.theme;return[4,initStripeElements({overrideBorderRaidus:(t=this.appearanceSettingsOverride)===null||t===void 0?void 0:t.style,overridePrimaryColor:(e=this.appearanceSettingsOverride)===null||e===void 0?void 0:e.colorPrimary,overrideTheme:this.isMobile?n:undefined})];case 1:s.sent();return[2]}}))}))};this.isShippableCountry=function(o){if(o===void 0){o=true}if(!localizationStore.localizationLoaded){return false}if(!localizationStore.isShippableCountry){if(o){log("Checkout: not shippable country")}return false}return true};this.getCurrentLocalePageEnum=function(){switch(cartStore.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.defaultAddress=null;this.forceDialogOpen=false;this.open=this.forceDialogOpen;this.stripe=window.Zonos.stripe;this.submitLoading=false;this.paymentError=false;this.collapseReviewMobile=false;this.isAttachError=false;this.isMobile=false;this.zonosReviewRef=undefined;this.storybookPaymentStatusOverride=undefined}o.prototype.initCartInfoHandler=function(o){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){t=o.detail;void cartStoreUpdateItems(t);return[2]}))}))};o.prototype.closeDialogHandler=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){submitGtag("zonos-checkout-close");this.open=this.forceDialogOpen||false;if(!this.preview&&cartStore.step==="finish"){cartStoreReset()}cartStore.step="customer-info";return[2]}))}))};o.prototype.buildCartAndInit=function(){return __awaiter(this,void 0,void 0,(function(){var o,t;return __generator(this,(function(e){switch(e.label){case 0:if(!zonosStore.checkoutSettings.buildCartDetail)return[3,3];log("build cart detail");return[4,zonosStore.checkoutSettings.buildCartDetail()];case 1:o=e.sent();return[4,cartStoreUpdateItems(o)];case 2:e.sent();e.label=3;case 3:if(!!stripeStore.clientSecret)return[3,5];return[4,stripeStoreInitCheckoutSession()];case 4:t=e.sent();log("stripeStoreInitCheckoutSession: ".concat(t));if(!t){return[2,false]}e.label=5;case 5:return[4,this.applyStripeTheme()];case 6:e.sent();return[2,true]}}))}))};o.prototype.attachCheckout=function(){var o=this;var t=zonosStore.checkoutSettings.placeOrderButtonSelector;if(!t){return}var e=document.querySelectorAll(t);e.forEach((function(t){var e=t.getAttribute("data-zonos-checkout-attached");if(e){return}t.addEventListener("click",(function(t){return __awaiter(o,void 0,void 0,(function(){var o,e;return __generator(this,(function(n){switch(n.label){case 0:if(!this.isShippableCountry()){return[2]}t.preventDefault();t.stopPropagation();log("zonos checkout button clicked");stripeStore.isFetchingSession=true;this.open=true;n.label=1;case 1:n.trys.push([1,3,,4]);return[4,this.buildCartAndInit()];case 2:o=n.sent();if(!o){throw new Error("Error building cart")}submitGtag("zonos-checkout-start");return[3,4];case 3:e=n.sent();stripeStore.isFetchingSession=false;cartStoreUpdateToErrorState({messages:[translate("There's been an error creating your checkout session. Please reload and try again or contact support if the error persists")],title:translate("Error creating Checkout")});return[3,4];case 4:return[2]}}))}))}));t.removeAttribute("disabled");t.setAttribute("data-zonos-checkout-attached","true")}))};o.prototype.appearanceSettingsOverrideChanged=function(){if(!this.appearanceSettingsOverride){return}void this.applyStripeTheme()};o.prototype.init=function(){return __awaiter(this,void 0,void 0,(function(){var o,t;var e=this;return __generator(this,(function(n){stripeStore.stripe=window.Zonos.stripe;this.stripe=window.Zonos.stripe;o=setInterval((function(){var t=window.Zonos.internationalHideSelector;if(!t){clearInterval(o);return}var n=e.isShippableCountry(false);var s=document.querySelectorAll(t);if(!n){s===null||s===void 0?void 0:s.forEach((function(o){var t=o;var e=t.getAttribute("data-zonos-checkout-original-display")||getComputedStyle(t).display;t.style.display=e||"initial"}));return}s===null||s===void 0?void 0:s.forEach((function(o){var t=o;var e=t.style.display;t.setAttribute("data-zonos-checkout-original-display",e);t.style.display="none"}))}),100);t=setInterval((function(){stripeStore.stripe=window.Zonos.stripe;e.stripe=window.Zonos.stripe;if(!e.stripe){log("waiting for stripe to be loaded");return}if(e.storybookPaymentStatusOverride){clearInterval(t);return}log("init checkout");if(e.preview||e.forceDialogOpen){void e.buildCartAndInit()}else{e.attachCheckout();var o=new MutationObserver((function(){e.attachCheckout()}));o.observe(document.body,{childList:true,subtree:true})}clearInterval(t)}),50);setTimeout((function(){clearInterval(t)}),1e4);return[2]}))}))};o.prototype.setToFinishStep=function(o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){cartStore.step="finish";this.storybookPaymentStatusOverride=o;return[2]}))}))};o.prototype.handleCustomerInfoContinue=function(){return __awaiter(this,void 0,void 0,(function(){var o;var t=this;return __generator(this,(function(e){switch(e.label){case 0:this.submitLoading=true;return[4,stripeStorePrefetchLandedCost()];case 1:e.sent();o=setInterval((function(){if(cartStore.landedCostData||!stripeStore.isFetchingLandedCost){if(cartStore.landedCostData){cartStoreNextStep()}t.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(t){this.submitLoading=true;setTimeout((function(){cartStoreNextStep();o.submitLoading=false}),500);return[2]}))}))};o.prototype.handleCheckoutPaymentContinue=function(){return __awaiter(this,void 0,void 0,(function(){var o;return __generator(this,(function(t){switch(t.label){case 0:this.paymentError=false;this.submitLoading=true;t.label=1;case 1:t.trys.push([1,3,,4]);return[4,stripeStoreConfirmPayment()];case 2:t.sent();cartStoreNextStep();return[3,4];case 3:o=t.sent();console.error(o);this.paymentError=true;return[3,4];case 4:this.submitLoading=false;return[2]}}))}))};o.prototype.handleFinishClick=function(){return __awaiter(this,void 0,void 0,(function(){var o,t;return __generator(this,(function(e){switch(e.label){case 0:stripeStoreReset();if(!this.preview)return[3,2];cartStore.step="customer-info";return[4,this.init()];case 1:e.sent();return[2];case 2:cartStoreReset();o=window.location.href;t=o.split("?")[0];window.history.replaceState({},document.title,t);this.open=false;window.location.reload();return[2]}}))}))};o.prototype.handleBackClick=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:if(!(cartStore.step==="customer-info"))return[3,2];return[4,this.closeDialogHandler()];case 1:o.sent();return[2];case 2:cartStorePreviousStep();return[2]}}))}))};o.prototype.handleWindowResize=function(){this.isMobile=isCheckoutMobile(this.mobile);void this.applyStripeTheme();log("mobile: ".concat(this.isMobile))};o.prototype.handleMobileChange=function(){this.isMobile=isCheckoutMobile(this.mobile);void this.applyStripeTheme();log("mobile: ".concat(this.isMobile))};o.prototype.componentWillLoad=function(){void this.init();this.isMobile=isCheckoutMobile(this.mobile);log("mobile: ".concat(this.isMobile))};o.prototype.disconnectedCallback=function(){stripeStoreReset();cartStoreReset()};o.prototype.render=function(){var o=this;var t;var e=cartStore.step!=="finish"&&cartStore.step!=="error"&&!stripeStore.stripeElements||stripeStore.isFetchingSession;var n=mergeConfig(zonosStore.appearance,this.appearanceSettingsOverride),s=n.colorPrimary,c=n.colorSecondary,r=n.logoUrl,i=n.style;var a=zonosStore.appearance.zonosAttribution==="ENABLED";var u=zonosStore.appearance.theme;var l=s&&isDarkColor(s)?"DARK":"LIGHT";var d=this.isMobile?u:l;var f=!this.isMobile?c:undefined;var z=localizationStore.customMessages;var m=((t=z.find((function(o){return o.pageName==="checkout_default"})))===null||t===void 0?void 0:t.message)||"Know about duties and taxes before you buy. Shop with confidence!";var k=this.getCurrentLocalePageEnum();var v=z.filter((function(o){return o.pageName===k}));var p=function(){return h("div",{class:"zonos--logo"},r&&h("img",{alt:"".concat(zonosStore.organizationName," logo"),src:r,width:100}))};var g=function(){return h("zonos-v-stack",null,p(),v.map((function(o){return h("zonos-custom-message",{icon:MessageIcon,message:o.message})})),h("div",null,h("zonos-button",{class:"zonos--back-button",icon:h("zonos-icon",{content:LeftArrow}),noBackground:true,noPaddingLeft:true,noPaddingRight:true,onClick:function(){return o.handleBackClick()},theme:d},translate("Back"))))};var b=function(){return a&&h("div",{class:"zonos--footer","data-theme":u},h("zonos-text",{type:"hintText"},translate("Powered by")),h("zonos-logo",{theme:u,width:"100px"}))};var w=function(){var t;var e=o.isMobile?"primary":undefined;var n=(t=o.zonosReviewRef)===null||t===void 0?void 0:t.scrollHeight;return h("div",{class:"zonos--content",style:{"--border-radius":getBorderRadius(i)}},cartStore.step!=="finish"&&cartStore.step!=="error"&&h(Fragment,null,h("div",{class:"zonos--left","data-theme":d,style:{"--primary-color":!o.isMobile?s:""}},!o.isMobile&&g(),cartStore.step==="customer-info"&&h("zonos-customer-info",{continueLoading:o.submitLoading,defaultAddress:o.defaultAddress,onContinueClicked:function(){return o.handleCustomerInfoContinue()},submitBtnColor:f,submitBtnType:e}),cartStore.step==="shipping"&&h("zonos-shipping",{continueLoading:o.submitLoading,onContinueClicked:function(){return o.handleShippingContinue()},submitBtnColor:f,submitBtnType:e}),cartStore.step==="payment"&&h("zonos-checkout-payment",{continueLoading:o.submitLoading,onContinueClicked:function(){return o.handleCheckoutPaymentContinue()},paymentError:o.paymentError,submitBtnColor:f,submitBtnType:e})),h("div",{class:"zonos--right","data-theme":u},o.isMobile&&g(),!o.isMobile&&h("zonos-button",{class:"zonos--close-button",icon:h("zonos-icon",{content:RemoveIcon}),noBackground:true,onClick:function(){return o.closeDialogHandler()}}),h("div",{class:"flex--wrapper"},h("div",{class:"zonos--wrapper"},h("zonos-collapse",{collapseSize:n,collapsed:o.collapseReviewMobile&&o.isMobile},h("zonos-review",{collapsed:o.collapseReviewMobile,mobile:o.isMobile,onClick:function(){if(!o.isMobile){return}o.collapseReviewMobile=!o.collapseReviewMobile},ref:function(t){return o.zonosReviewRef=t}}),h("zonos-cart-items",null))),h("zonos-v-stack",{spacing:16},h("zonos-cart-subtotal",null),h("zonos-custom-message",{class:"zonos--checkout-default-message",icon:MessageIcon,message:m}))),!o.isMobile&&b()),o.isMobile&&b()),(cartStore.step==="finish"||cartStore.step==="error")&&h("div",{class:"zonos--done","data-theme":u},h("div",{class:"zonos--header"},p(),h("zonos-button",{class:"zonos--close-button",icon:h("zonos-icon",{content:RemoveIcon}),noBackground:true,onClick:function(){return o.handleFinishClick()},theme:u})),h("zonos-checkout-finish",{borderRadius:i,onCloseClick:function(){return o.handleFinishClick()},overrideNotification:cartStore.step==="error"&&!!cartStore.error?Object.assign(Object.assign({},cartStore.error),{type:"error"}):undefined,storybookForceStatus:o.storybookPaymentStatusOverride})))};return h(Host,{class:classes(["zonos--checkout zonos--elements",a&&"has-footer",this.preview&&"preview",this.isMobile&&"mobile"])},this.preview?w():h("zonos-dialog",{borderStyle:i,"data-theme":u,height:"980px",isLoading:e,mobile:this.isMobile,noBodyPadding:true,noBorder:true,noClickOutside:true,noCloseButton:true,onCloseDialog:function(){return o.closeDialogHandler()},open:this.open,width:"1200px"},w()))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});Object.defineProperty(o,"watchers",{get:function(){return{appearanceSettingsOverride:["appearanceSettingsOverrideChanged"],mobile:["handleMobileChange"]}},enumerable:false,configurable:true});return o}();ZonosCheckout.style=ZonosCheckoutStyle0;export{ZonosCheckout as zonos_checkout};
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(t,o,n,e){function r(t){return t instanceof n?t:new n((function(o){o(t)}))}return new(n||(n=Promise))((function(n,i){function s(t){try{c(e.next(t))}catch(t){i(t)}}function a(t){try{c(e["throw"](t))}catch(t){i(t)}}function c(t){t.done?n(t.value):r(t.value).then(s,a)}c((e=e.apply(t,o||[])).next())}))};var __generator=this&&this.__generator||function(t,o){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},e,r,i,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(t){return function(o){return c([t,o])}}function c(a){if(e)throw new TypeError("Generator is already executing.");while(s&&(s=0,a[0]&&(n=0)),n)try{if(e=1,r&&(i=a[0]&2?r["return"]:a[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;if(r=0,i)a=[a[0]&2,i.value];switch(a[0]){case 0:case 1:i=a;break;case 4:n.label++;return{value:a[1],done:false};case 5:n.label++;r=a[1];a=[0];continue;case 7:a=n.ops.pop();n.trys.pop();continue;default:if(!(i=n.trys,i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){n.label=a[1];break}if(a[0]===6&&n.label<i[1]){n.label=i[1];i=a;break}if(i&&n.label<i[2]){n.label=i[2];n.ops.push(a);break}if(i[2])n.ops.pop();n.trys.pop();continue}a=o.call(t,n)}catch(t){a=[6,t];r=0}finally{e=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host}from"./index-81a199ef.js";import{s as stripeStore}from"./cart-c9124cc3.js";import{h as handleFetch,b as logError,i as isValidSelector,l as log,c as initLocalizationStore,d as localizationStoreUpdateSelectedCountryCode}from"./localization-5d83fde2.js";import{z as zonosStore,b as zonosStoreInitSetting,d as zonosStoreFontFamily}from"./zonosStore-e59617f8.js";import"./isDarkColor-8696cb70.js";import"./getBorderRadius-9e4cb3b1.js";var getZonosSettings=function(){return __awaiter(void 0,void 0,void 0,(function(){var t,o,n,e;return __generator(this,(function(r){switch(r.label){case 0:t="".concat("https://v1.route.js.zonos.com","/api/zonos-elements/zonos-settings");return[4,handleFetch(t)];case 1:o=r.sent(),n=o.errors,e=o.json;if(n.length){logError("Error occurred when getting zonos settings. If this is not an unauthorized error, it will use user settings or default settings");return[2,{errors:n,json:null}]}return[2,{errors:[],json:e}]}}))}))};var injectCheckoutElement=function(){var t=document.querySelector("zonos-checkout");if(!t){var o=document.createElement("zonos-checkout");document.body.appendChild(o)}};var initCheckout=function(t){if(!t.placeOrderButtonSelector){return}if(!isValidSelector(t.placeOrderButtonSelector)){logError('Selector checkoutButtonAnchor "'.concat(t.placeOrderButtonSelector,'" is not a valid selector'));return}injectCheckoutElement()};var injectHelloComponent=function(t){var o=document.querySelector("zonos-hello");if(!o&&t){var n=document.createElement("zonos-hello");t.appendChild(n)}};var initHello=function(t){return __awaiter(void 0,void 0,void 0,(function(){var o,n;return __generator(this,(function(e){o=t.anchorElementSelector;if(!o||!isValidSelector(o)){logError('Selector anchorElementSelector "'.concat(t.anchorElementSelector,'" is not a valid selector.'));return[2]}n=document.querySelector(o);log("Hello init complete");injectHelloComponent(n);return[2]}))}))};var zonosControllerCss=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{visibility:hidden;opacity:0;height:0}";var ZonosControllerStyle0=zonosControllerCss;var ZonosController=function(){function t(t){registerInstance(this,t);this.stripeInitEvent=createEvent(this,"stripeInitEvent",7);this.config=undefined;this.zonosApiKey=undefined}t.prototype.initCheckoutElement=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){if(!t){log("Stripe is not loaded yet - cannot init checkout element","warn");return[2]}stripeStore.stripe=t;void initCheckout(zonosStore.checkoutSettings);log("init checkout element");return[2]}))}))};t.prototype.initZonosNotification=function(){var t=document.querySelector("zonos-notification");if(t){return}var o=document.createElement("zonos-notification");document.body.appendChild(o)};t.prototype.setupGoogleFont=function(t){return __awaiter(this,void 0,void 0,(function(){var o,n,e,r,i,s,a,c;return __generator(this,(function(u){switch(u.label){case 0:e=t||zonosStoreFontFamily();if(e==="Inter"){if(!t){return[2]}log("[FONT] Just applied Inter , but no need to inject since we already inject Inter on start","warn");zonosStore.appearance=Object.assign(Object.assign({},zonosStore.appearance),{fontFamily:t})}r="https://v1.route.js.zonos.com";return[4,handleFetch("".concat(r,"/api/zonos-elements/get-font-detail?family=").concat(e))];case 1:i=u.sent(),s=i.errors,a=i.json;if(s.length>0||!a){log("Failed to load font ".concat(e),"warn");return[2]}c=a.fontUrl;(n=(o=window.Zonos).injectSupportGoogleFont)===null||n===void 0?void 0:n.call(o,c);if(!t){return[2]}log("[FONT] ".concat(t," font override applied"));zonosStore.appearance=Object.assign(Object.assign({},zonosStore.appearance),{fontFamily:t});return[2]}}))}))};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(o){zonosStore.zonosApiKey=this.zonosApiKey;(function(){return __awaiter(t,void 0,void 0,(function(){var t,o,n,e,r,i;return __generator(this,(function(s){switch(s.label){case 0:return[4,getZonosSettings()];case 1:n=s.sent(),e=n.errors,r=n.json;if(((t=e[0])===null||t===void 0?void 0:t.type.toString())==="403"){log("Failed to load zonos settings. This domain may not have access","warn");return[2]}this.initZonosNotification();zonosStoreInitSetting({overrideSettings:this.config,zonosSettings:r});void this.setupGoogleFont();if(zonosStore.helloSettings){void initHello(zonosStore.helloSettings)}return[4,initLocalizationStore()];case 2:s.sent();i=((o=r===null||r===void 0?void 0:r.checkoutSettings)===null||o===void 0?void 0:o.externalServiceTokens.find((function(t){return t.type==="STRIPE_PUBLISHABLE_TOKEN"})))||null;if(!i||!this.stripeInitEvent){log("Checkout failed to load -- missing publishable key","warn");return[2]}if(zonosStore.checkoutSettings.subscriptionStatus==="INACTIVE"){log('=== Checkout subscription is "INACTIVE" - Cancel initializing for Checkout ===',"warn");log("zonos controller loaded");return[2]}if(zonosStore.checkoutSettings.visibilityStatus==="DISABLED"){log("=== Checkout is disabled by store owner ===","warn");log("zonos controller loaded");return[2]}this.stripeInitEvent.emit({publishableKey:i.token});log("zonos controller loaded");return[2]}}))}))})();return[2]}))}))};t.prototype.showNotification=function(t){return __awaiter(this,void 0,void 0,(function(){var o;return __generator(this,(function(n){o=document.querySelector("zonos-notification");if(!o){log("Failed to show notification - zonos-notification not found","warn");return[2]}void o.showNotification(t);return[2]}))}))};t.prototype.overrideConfig=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){zonosStoreInitSetting({overrideSettings:t,zonosSettings:null});return[2]}))}))};t.prototype.overrideCountry=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){void localizationStoreUpdateSelectedCountryCode(t);return[2]}))}))};t.prototype.getAppearanceSetting=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,zonosStore.appearance]}))}))};t.prototype.updateOrganizationName=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){zonosStore.organizationName=t;return[2]}))}))};t.prototype.render=function(){return h(Host,{key:"a94fb7ff23c45a9813ce5da857cda14c8455ff79",class:"zonos--elements"})};return t}();ZonosController.style=ZonosControllerStyle0;export{ZonosController as zonos_controller};
1
+ var __awaiter=this&&this.__awaiter||function(t,o,n,e){function r(t){return t instanceof n?t:new n((function(o){o(t)}))}return new(n||(n=Promise))((function(n,i){function s(t){try{c(e.next(t))}catch(t){i(t)}}function a(t){try{c(e["throw"](t))}catch(t){i(t)}}function c(t){t.done?n(t.value):r(t.value).then(s,a)}c((e=e.apply(t,o||[])).next())}))};var __generator=this&&this.__generator||function(t,o){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},e,r,i,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(t){return function(o){return c([t,o])}}function c(a){if(e)throw new TypeError("Generator is already executing.");while(s&&(s=0,a[0]&&(n=0)),n)try{if(e=1,r&&(i=a[0]&2?r["return"]:a[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;if(r=0,i)a=[a[0]&2,i.value];switch(a[0]){case 0:case 1:i=a;break;case 4:n.label++;return{value:a[1],done:false};case 5:n.label++;r=a[1];a=[0];continue;case 7:a=n.ops.pop();n.trys.pop();continue;default:if(!(i=n.trys,i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){n.label=a[1];break}if(a[0]===6&&n.label<i[1]){n.label=i[1];i=a;break}if(i&&n.label<i[2]){n.label=i[2];n.ops.push(a);break}if(i[2])n.ops.pop();n.trys.pop();continue}a=o.call(t,n)}catch(t){a=[6,t];r=0}finally{e=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host}from"./index-81a199ef.js";import{s as stripeStore}from"./cart-ba9b0d4c.js";import{h as handleFetch,b as logError,i as isValidSelector,l as log,c as initLocalizationStore,d as localizationStoreUpdateSelectedCountryCode}from"./localization-5d83fde2.js";import{z as zonosStore,b as zonosStoreInitSetting,d as zonosStoreFontFamily}from"./zonosStore-e59617f8.js";import"./isDarkColor-8696cb70.js";import"./getBorderRadius-9e4cb3b1.js";var getZonosSettings=function(){return __awaiter(void 0,void 0,void 0,(function(){var t,o,n,e;return __generator(this,(function(r){switch(r.label){case 0:t="".concat("https://v1.route.js.zonos.com","/api/zonos-elements/zonos-settings");return[4,handleFetch(t)];case 1:o=r.sent(),n=o.errors,e=o.json;if(n.length){logError("Error occurred when getting zonos settings. If this is not an unauthorized error, it will use user settings or default settings");return[2,{errors:n,json:null}]}return[2,{errors:[],json:e}]}}))}))};var injectCheckoutElement=function(){var t=document.querySelector("zonos-checkout");if(!t){var o=document.createElement("zonos-checkout");document.body.appendChild(o)}};var initCheckout=function(t){if(!t.placeOrderButtonSelector){return}if(!isValidSelector(t.placeOrderButtonSelector)){logError('Selector checkoutButtonAnchor "'.concat(t.placeOrderButtonSelector,'" is not a valid selector'));return}injectCheckoutElement()};var injectHelloComponent=function(t){var o=document.querySelector("zonos-hello");if(!o&&t){var n=document.createElement("zonos-hello");t.appendChild(n)}};var initHello=function(t){return __awaiter(void 0,void 0,void 0,(function(){var o,n;return __generator(this,(function(e){o=t.anchorElementSelector;if(!o||!isValidSelector(o)){logError('Selector anchorElementSelector "'.concat(t.anchorElementSelector,'" is not a valid selector.'));return[2]}n=document.querySelector(o);log("Hello init complete");injectHelloComponent(n);return[2]}))}))};var zonosControllerCss=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{visibility:hidden;opacity:0;height:0}";var ZonosControllerStyle0=zonosControllerCss;var ZonosController=function(){function t(t){registerInstance(this,t);this.stripeInitEvent=createEvent(this,"stripeInitEvent",7);this.config=undefined;this.zonosApiKey=undefined}t.prototype.initCheckoutElement=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){if(!t){log("Stripe is not loaded yet - cannot init checkout element","warn");return[2]}stripeStore.stripe=t;void initCheckout(zonosStore.checkoutSettings);log("init checkout element");return[2]}))}))};t.prototype.initZonosNotification=function(){var t=document.querySelector("zonos-notification");if(t){return}var o=document.createElement("zonos-notification");document.body.appendChild(o)};t.prototype.setupGoogleFont=function(t){return __awaiter(this,void 0,void 0,(function(){var o,n,e,r,i,s,a,c;return __generator(this,(function(u){switch(u.label){case 0:e=t||zonosStoreFontFamily();if(e==="Inter"){if(!t){return[2]}log("[FONT] Just applied Inter , but no need to inject since we already inject Inter on start","warn");zonosStore.appearance=Object.assign(Object.assign({},zonosStore.appearance),{fontFamily:t})}r="https://v1.route.js.zonos.com";return[4,handleFetch("".concat(r,"/api/zonos-elements/get-font-detail?family=").concat(e))];case 1:i=u.sent(),s=i.errors,a=i.json;if(s.length>0||!a){log("Failed to load font ".concat(e),"warn");return[2]}c=a.fontUrl;(n=(o=window.Zonos).injectSupportGoogleFont)===null||n===void 0?void 0:n.call(o,c);if(!t){return[2]}log("[FONT] ".concat(t," font override applied"));zonosStore.appearance=Object.assign(Object.assign({},zonosStore.appearance),{fontFamily:t});return[2]}}))}))};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(o){zonosStore.zonosApiKey=this.zonosApiKey;(function(){return __awaiter(t,void 0,void 0,(function(){var t,o,n,e,r,i;return __generator(this,(function(s){switch(s.label){case 0:return[4,getZonosSettings()];case 1:n=s.sent(),e=n.errors,r=n.json;if(((t=e[0])===null||t===void 0?void 0:t.type.toString())==="403"){log("Failed to load zonos settings. This domain may not have access","warn");return[2]}this.initZonosNotification();zonosStoreInitSetting({overrideSettings:this.config,zonosSettings:r});void this.setupGoogleFont();if(zonosStore.helloSettings){void initHello(zonosStore.helloSettings)}return[4,initLocalizationStore()];case 2:s.sent();i=((o=r===null||r===void 0?void 0:r.checkoutSettings)===null||o===void 0?void 0:o.externalServiceTokens.find((function(t){return t.type==="STRIPE_PUBLISHABLE_TOKEN"})))||null;if(!i||!this.stripeInitEvent){log("Checkout failed to load -- missing publishable key","warn");return[2]}if(zonosStore.checkoutSettings.subscriptionStatus==="INACTIVE"){log('=== Checkout subscription is "INACTIVE" - Cancel initializing for Checkout ===',"warn");log("zonos controller loaded");return[2]}if(zonosStore.checkoutSettings.visibilityStatus==="DISABLED"){log("=== Checkout is disabled by store owner ===","warn");log("zonos controller loaded");return[2]}this.stripeInitEvent.emit({publishableKey:i.token});log("zonos controller loaded");return[2]}}))}))})();return[2]}))}))};t.prototype.showNotification=function(t){return __awaiter(this,void 0,void 0,(function(){var o;return __generator(this,(function(n){o=document.querySelector("zonos-notification");if(!o){log("Failed to show notification - zonos-notification not found","warn");return[2]}void o.showNotification(t);return[2]}))}))};t.prototype.overrideConfig=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){zonosStoreInitSetting({overrideSettings:t,zonosSettings:null});return[2]}))}))};t.prototype.overrideCountry=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){void localizationStoreUpdateSelectedCountryCode(t);return[2]}))}))};t.prototype.getAppearanceSetting=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,zonosStore.appearance]}))}))};t.prototype.updateOrganizationName=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){zonosStore.organizationName=t;return[2]}))}))};t.prototype.render=function(){return h(Host,{key:"a94fb7ff23c45a9813ce5da857cda14c8455ff79",class:"zonos--elements"})};return t}();ZonosController.style=ZonosControllerStyle0;export{ZonosController as zonos_controller};
@@ -1 +1 @@
1
- import{r as registerInstance,h,H as Host,d as getElement}from"./index-81a199ef.js";import{s as stripeStore}from"./cart-c9124cc3.js";import"./zonosStore-e59617f8.js";import"./localization-5d83fde2.js";import"./isDarkColor-8696cb70.js";import"./getBorderRadius-9e4cb3b1.js";var zonosPaymentCss=".sc-zonos-payment-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-payment-h *.sc-zonos-payment{font-family:var(--font-family, Inter), Inter}.sc-zonos-payment-h img.sc-zonos-payment{max-width:100%}.sc-zonos-payment-h dl.sc-zonos-payment,.sc-zonos-payment-h dd.sc-zonos-payment,.sc-zonos-payment-h h1.sc-zonos-payment,.sc-zonos-payment-h h2.sc-zonos-payment,.sc-zonos-payment-h h3.sc-zonos-payment,.sc-zonos-payment-h h4.sc-zonos-payment,.sc-zonos-payment-h h5.sc-zonos-payment,.sc-zonos-payment-h h6.sc-zonos-payment,.sc-zonos-payment-h hr.sc-zonos-payment,.sc-zonos-payment-h figure.sc-zonos-payment,.sc-zonos-payment-h p.sc-zonos-payment,.sc-zonos-payment-h pre.sc-zonos-payment{margin:0}.sc-zonos-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-payment-h .zonos--title.sc-zonos-payment{margin-bottom:var(--amino-space-16)}";var ZonosPaymentStyle0=zonosPaymentCss;var ZonosPayment=function(){function n(n){registerInstance(this,n);this.titleText=undefined;this.stripe=stripeStore.stripe;this.stripeElements=stripeStore.stripeElements}n.prototype.watchInitStripe=function(){if(!this.stripeElements){return}var n=stripeStore.stripePaymentElement||this.stripeElements.create("payment",{layout:"tabs"});var o=this.el.querySelector(".zonos--payment-component");if(!o){console.error("Cannot find container element for paymentElement");return}n.mount(o);n.on("change",(function(n){stripeStore.stripePaymentEventData=n}));stripeStore.stripePaymentElement=n};n.prototype.componentDidLoad=function(){this.watchInitStripe()};n.prototype.render=function(){return h(Host,{key:"8a674f72e9235f9b6afcc8d8e0374639423e0bb3",class:"zonos--payment zonos--elements"},this.titleText&&h("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},this.titleText),h("div",{key:"94a0a064e6f6d8058bc11d114ecc4c3ab495e802",class:"zonos--payment-component"}))};Object.defineProperty(n.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(n,"watchers",{get:function(){return{stripeElements:["watchInitStripe"],stripe:["watchInitStripe"]}},enumerable:false,configurable:true});return n}();ZonosPayment.style=ZonosPaymentStyle0;export{ZonosPayment as zonos_payment};
1
+ import{r as registerInstance,h,H as Host,d as getElement}from"./index-81a199ef.js";import{s as stripeStore}from"./cart-ba9b0d4c.js";import"./zonosStore-e59617f8.js";import"./localization-5d83fde2.js";import"./isDarkColor-8696cb70.js";import"./getBorderRadius-9e4cb3b1.js";var zonosPaymentCss=".sc-zonos-payment-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-payment-h *.sc-zonos-payment{font-family:var(--font-family, Inter), Inter}.sc-zonos-payment-h img.sc-zonos-payment{max-width:100%}.sc-zonos-payment-h dl.sc-zonos-payment,.sc-zonos-payment-h dd.sc-zonos-payment,.sc-zonos-payment-h h1.sc-zonos-payment,.sc-zonos-payment-h h2.sc-zonos-payment,.sc-zonos-payment-h h3.sc-zonos-payment,.sc-zonos-payment-h h4.sc-zonos-payment,.sc-zonos-payment-h h5.sc-zonos-payment,.sc-zonos-payment-h h6.sc-zonos-payment,.sc-zonos-payment-h hr.sc-zonos-payment,.sc-zonos-payment-h figure.sc-zonos-payment,.sc-zonos-payment-h p.sc-zonos-payment,.sc-zonos-payment-h pre.sc-zonos-payment{margin:0}.sc-zonos-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-payment-h .zonos--title.sc-zonos-payment{margin-bottom:var(--amino-space-16)}";var ZonosPaymentStyle0=zonosPaymentCss;var ZonosPayment=function(){function n(n){registerInstance(this,n);this.titleText=undefined;this.stripe=stripeStore.stripe;this.stripeElements=stripeStore.stripeElements}n.prototype.watchInitStripe=function(){if(!this.stripeElements){return}var n=stripeStore.stripePaymentElement||this.stripeElements.create("payment",{layout:"tabs"});var o=this.el.querySelector(".zonos--payment-component");if(!o){console.error("Cannot find container element for paymentElement");return}n.mount(o);n.on("change",(function(n){stripeStore.stripePaymentEventData=n}));stripeStore.stripePaymentElement=n};n.prototype.componentDidLoad=function(){this.watchInitStripe()};n.prototype.render=function(){return h(Host,{key:"8a674f72e9235f9b6afcc8d8e0374639423e0bb3",class:"zonos--payment zonos--elements"},this.titleText&&h("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},this.titleText),h("div",{key:"94a0a064e6f6d8058bc11d114ecc4c3ab495e802",class:"zonos--payment-component"}))};Object.defineProperty(n.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(n,"watchers",{get:function(){return{stripeElements:["watchInitStripe"],stripe:["watchInitStripe"]}},enumerable:false,configurable:true});return n}();ZonosPayment.style=ZonosPaymentStyle0;export{ZonosPayment as zonos_payment};
@@ -1 +1 @@
1
- (function(){"use strict";"function"==typeof SuppressedError&&SuppressedError;const e=async({response:e,shouldLog:o=!0,shouldThrow:n=!1})=>{try{return await e.json()}catch(e){if(n)throw e;return o&&console.error(e),null}};const o=async(o,n)=>{const t=(function(e,o){var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&o.indexOf(t)<0&&(n[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(t=Object.getOwnPropertySymbols(e);s<t.length;s++)o.indexOf(t[s])<0&&Object.prototype.propertyIsEnumerable.call(e,t[s])&&(n[t[s]]=e[t[s]])}return n})(n||{},[]),s=t.body?JSON.stringify(t.body):void 0,r=t.method||"GET",i=new URL(o);i.searchParams.set("zToken",(function(e){try{return btoa(e).replace(/=/g,"")}catch(o){return e.replace(/[^A-Za-z0-9]/g,"").split("").reverse().join("")}})(window.location.hostname));const c=Object.assign({"Content-Type":"application/json","Zonos-Is-BigCommerce":window.Zonos.isBigCommerce.toString(),"Zonos-Referer":window.location.hostname,"Zonos-Version":window.Zonos.version,credentialtoken:window.Zonos.zonosApiKey},t.headers),a=Object.assign(Object.assign({},t),{body:"GET"===r?void 0:s,headers:c,method:r});return(async(o,n)=>{let t;try{t=await fetch(o,n)}catch(e){return e instanceof Error?{errors:[{message:e.message,type:"unknown"}],json:null,response:null}:{errors:[{message:"Fail to fetch",type:"unknown"}],json:null,response:null}}const s=t.headers.get("Zonos-Mode"),r=window.Zonos.zonosQaUrl;if(!window.Zonos.modeAlerted&&s&&r&&("production"===s&&alert("Please be aware that you are currently operating in the production environment. Any interactions with the customer store, including payments, will be processed as real transactions!"),"test"===s&&alert("For testing payments, you can utilize the test payment information provided at this link: https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements#web-test-the-integration"),window.Zonos.modeAlerted=!0),t.ok)return{errors:[],json:await e({response:t}),response:t};const i=t.status.toString();try{const o=await e({response:t,shouldThrow:!0});return{errors:[{message:`${i}: ${JSON.stringify(o)}`,type:i}],json:null,response:t}}catch(e){return{errors:[{message:`${i}: Unknown error`,type:i}],json:null,response:null}}})(i.toString(),a)};var n;class t{}n=t,t.isBigCommerce=!1,t.requested=!1,t.internationalHideSelector="",t.injectZonos=({initConfig:e,url:o,version:t})=>{const s=o.replace("https://","").replace("http://",""),r=document.createElement("script"),i=(new Date).getTime(),c=t&&t<"1.2.5"?"loadZonos.js":"zonos.js";r.src=`https://${s}/dist/scripts/${c}?timestamp=${i}`,r.addEventListener("load",(()=>{n.isBigCommerce||(n.isBigCommerce=!!window.stencilBootstrap||!!window.bcConfig||!!document.querySelector('script[src*="bigcommerce.com"]')),window.Zonos.internationalHideSelector=n.internationalHideSelector,window.Zonos.isBigCommerce=n.isBigCommerce,window.Zonos.version&&window.Zonos.init(e)})),document.head.appendChild(r)},t.init=async e=>{var t;const s="https://v1.3.4.js.zonos.com",r=null===(t=document.querySelector("script[src*='/loadZonos.js']"))||void 0===t?void 0:t.src,i=document.querySelector('script[src*="/zonos.js"]'),c=null==r?void 0:r.includes("timestamp=");if(!r||!c)return void console.error("[ZONOS] A timestamp is required as a query parameter in the loadZonos.js script source. This timestamp ensures that you are loading the most recent version of the script, avoiding any cached versions.");if(i||!r||n.requested)return;if(n.requested=!0,!e.storeId)return console.log("[ZONOS] loading latest script since storeId is not provided."),void n.injectZonos({initConfig:e,url:s,version:null});const a=new URL("https://v1.route.js.zonos.com/api/get-store-version");a.searchParams.set("storeId",e.storeId.toString());const{errors:l,json:d}=await o(a.toString());if(l.length||!d)return void n.injectZonos({initConfig:e,url:s,version:null});const{version:u}=d;if(!i){const o=["dev.elements.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"],t=["qa.js.zonos.com"],s=new URL(r).origin,i=o.some((e=>s.includes(e))),c=t.some((e=>s.includes(e))),a=i&&!c?s:`v${u}.js.zonos.com`,l=i&&!c?null:u;n.injectZonos({initConfig:e,url:a,version:l})}},void 0===window.Zonos&&(window.Zonos=t)})();
1
+ (function(){"use strict";"function"==typeof SuppressedError&&SuppressedError;const e=async({response:e,shouldLog:o=!0,shouldThrow:n=!1})=>{try{return await e.json()}catch(e){if(n)throw e;return o&&console.error(e),null}};const o=async(o,n)=>{const t=(function(e,o){var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&o.indexOf(t)<0&&(n[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(t=Object.getOwnPropertySymbols(e);s<t.length;s++)o.indexOf(t[s])<0&&Object.prototype.propertyIsEnumerable.call(e,t[s])&&(n[t[s]]=e[t[s]])}return n})(n||{},[]),s=t.body?JSON.stringify(t.body):void 0,r=t.method||"GET",i=new URL(o);i.searchParams.set("zToken",(function(e){try{return btoa(e).replace(/=/g,"")}catch(o){return e.replace(/[^A-Za-z0-9]/g,"").split("").reverse().join("")}})(window.location.hostname));const c=Object.assign({"Content-Type":"application/json","Zonos-Is-BigCommerce":window.Zonos.isBigCommerce.toString(),"Zonos-Referer":window.location.hostname,"Zonos-Version":window.Zonos.version,credentialtoken:window.Zonos.zonosApiKey},t.headers),a=Object.assign(Object.assign({},t),{body:"GET"===r?void 0:s,headers:c,method:r});return(async(o,n)=>{let t;try{t=await fetch(o,n)}catch(e){return e instanceof Error?{errors:[{message:e.message,type:"unknown"}],json:null,response:null}:{errors:[{message:"Fail to fetch",type:"unknown"}],json:null,response:null}}const s=t.headers.get("Zonos-Mode"),r=window.Zonos.zonosQaUrl;if(!window.Zonos.modeAlerted&&s&&r&&("production"===s&&alert("Please be aware that you are currently operating in the production environment. Any interactions with the customer store, including payments, will be processed as real transactions!"),"test"===s&&alert("For testing payments, you can utilize the test payment information provided at this link: https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements#web-test-the-integration"),window.Zonos.modeAlerted=!0),t.ok)return{errors:[],json:await e({response:t}),response:t};const i=t.status.toString();try{const o=await e({response:t,shouldThrow:!0});return{errors:[{message:`${i}: ${JSON.stringify(o)}`,type:i}],json:null,response:t}}catch(e){return{errors:[{message:`${i}: Unknown error`,type:i}],json:null,response:null}}})(i.toString(),a)};var n;class t{}n=t,t.isBigCommerce=!1,t.requested=!1,t.internationalHideSelector="",t.injectZonos=({initConfig:e,url:o,version:t})=>{const s=o.replace("https://","").replace("http://",""),r=document.createElement("script"),i=(new Date).getTime(),c=t&&t<"1.2.5"?"loadZonos.js":"zonos.js";r.src=`https://${s}/dist/scripts/${c}?timestamp=${i}`,r.addEventListener("load",(()=>{n.isBigCommerce||(n.isBigCommerce=!!window.stencilBootstrap||!!window.bcConfig||!!document.querySelector('script[src*="bigcommerce.com"]')),window.Zonos.internationalHideSelector=n.internationalHideSelector,window.Zonos.isBigCommerce=n.isBigCommerce,window.Zonos.version&&window.Zonos.init(e)})),document.head.appendChild(r)},t.init=async e=>{var t;const s="https://v1.3.5-alpha.0.js.zonos.com",r=null===(t=document.querySelector("script[src*='/loadZonos.js']"))||void 0===t?void 0:t.src,i=document.querySelector('script[src*="/zonos.js"]'),c=null==r?void 0:r.includes("timestamp=");if(!r||!c)return void console.error("[ZONOS] A timestamp is required as a query parameter in the loadZonos.js script source. This timestamp ensures that you are loading the most recent version of the script, avoiding any cached versions.");if(i||!r||n.requested)return;if(n.requested=!0,!e.storeId)return console.log("[ZONOS] loading latest script since storeId is not provided."),void n.injectZonos({initConfig:e,url:s,version:null});const a=new URL("https://v1.route.js.zonos.com/api/get-store-version");a.searchParams.set("storeId",e.storeId.toString());const{errors:l,json:d}=await o(a.toString());if(l.length||!d)return void n.injectZonos({initConfig:e,url:s,version:null});const{version:u}=d;if(!i){const o=["dev.elements.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"],t=["qa.js.zonos.com"],s=new URL(r).origin,i=o.some((e=>s.includes(e))),c=t.some((e=>s.includes(e))),a=i&&!c?s:`v${u}.js.zonos.com`,l=i&&!c?null:u;n.injectZonos({initConfig:e,url:a,version:l})}},void 0===window.Zonos&&(window.Zonos=t)})();
@@ -1 +1 @@
1
- (function(){"use strict";const e=(e,t,...n)=>{var o;if(!window.Zonos.debug)return;let r=document.querySelector("iframe#zonos---debug-logging-iframe");r||(r=document.createElement("iframe"),r.id="zonos---debug-logging-iframe",r.style.display="none",r.style.opacity="0",r.style.position="absolute",r.style.top="-9999px",r.style.left="-9999px",r.style.width="1px",r.style.height="1px",r.style.border="none",r.style.overflow="hidden",r.style.visibility="hidden",document.body.appendChild(r));const s=(null===(o=r.contentWindow)||void 0===o?void 0:o.window.console)||window.console;switch(t){case"warn":s.warn(e,...n);break;case"info":s.info(e,...n);break;default:s.groupCollapsed(e,...n),s.trace(),s.groupEnd()}},t=(e,...t)=>{console.error(e,...t)},n="https://js.stripe.com/v3",o=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,r="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let s=null;const i=e=>(null!==s||(s=new Promise(((s,i)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(r),window.Stripe)s(window.Stripe);else try{let l=(()=>{const e=document.querySelectorAll(`script[src^="${n}"]`);for(let t=0;t<e.length;t++){const n=e[t];if(n&&o.test(n.src))return n}return null})();l&&e?console.warn(r):l||(l=(e=>{const o=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",r=document.createElement("script");r.src=`${n}${o}`;const s=document.head||document.body;return s?(s.appendChild(r),r):(t("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})(e)),null==l||l.addEventListener("load",(()=>{window.Stripe?s(window.Stripe):i(new Error("Stripe.js not available"))})),null==l||l.addEventListener("error",(()=>{i(new Error("Failed to load Stripe.js"))}))}catch(e){return void i(e)}else s(null)}))),s),l=Promise.resolve().then((()=>i(null)));let c=!1;l.catch((e=>{c||console.warn(e)}));var a;const d=(()=>{const e=(e=>{if(!e)return null;const t=new URL(e).searchParams.get("zonosQaUrl");return t?/[^a-zA-Z0-9-_]+/.test(t)?null:t:null})(window.location.href);if(!e)return null;const t=`https://${e}.preview.js.zonos.com`;return console.warn(`[ZONOS-WARNING] using '${t}' for loading script`),fetch(t).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${t}' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE`);const e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");const{pathname:n}=window.location,o=`${n}?${e.toString()}`;return window.history.replaceState({},"",o),window.location.reload(),null})),t})(),u=d||"https://v1.3.4.js.zonos.com",m="https://unpkg.com/@zonos/elements@1.3.4",p="https://rsms.me",h="https://fonts.googleapis.com",y=/^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;class w{}a=w,w.doneInit=!1,w.debug=!!window.location.search.match(/\?.*(&*)zonosDebug=1/),w.isBigCommerce=!1,w.internationalHideSelector="",w.zonosQaUrl=d,w.version="v1.3.4",w.modeAlerted=!1,w.getCurrentTimestamp=()=>(new Date).getTime(),w.zonosController=null,w.init=async({appearance:n,checkoutSettings:o,currencyConverter:r,helloSettings:s,storeId:i,zonosApiKey:l})=>{a.doneInit||(e(`====== ZONOS DEBUG MODE: on (${a.version}) ======`),l?(a.zonosApiKey=l,a.storeId=i,e("init zonos"),a.injectSentryScript(),a.injectZonosCdn(),a.injectZonosCss(),a.injectFonts(),a.injectController({config:{appearance:n,checkoutSettings:o,currencyConverter:r,helloSettings:s},zonosApiKey:l}),a.doneInit=!0):t("Missing Zonos API key"))},w.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},w.showNotification=e=>{var t;null===(t=a.zonosController)||void 0===t||t.showNotification(e)},w.updateOrganizationName=e=>{var t;null===(t=a.zonosController)||void 0===t||t.updateOrganizationName(e)},w.disablePlaceOrderButtons=({autoEnable:e=!0,disable:t,placeOrderButtonSelector:n})=>{if(n){const o=document.querySelectorAll(n),r=e=>{e.target.getAttribute("disabled")&&(e.preventDefault(),e.stopPropagation())};o.forEach((e=>{e.getAttribute("data-zonos-checkout-attached")||(t?(e.setAttribute("disabled","true"),e.addEventListener("click",r)):(e.removeAttribute("disabled"),e.removeEventListener("click",r)))})),e&&t&&setTimeout((()=>{o.forEach((e=>{e.removeAttribute("disabled"),e.removeEventListener("click",r)}))}),5e3)}},w.injectController=({config:n,zonosApiKey:o})=>{var r;if(document.querySelector("zonos-controller"))return;if(null===(r=n.checkoutSettings)||void 0===r?void 0:r.placeOrderButtonSelector){const e=n.checkoutSettings.placeOrderButtonSelector;a.disablePlaceOrderButtons({disable:!0,placeOrderButtonSelector:e});new MutationObserver((()=>{a.disablePlaceOrderButtons({disable:!0,placeOrderButtonSelector:e})})).observe(document.body,{childList:!0,subtree:!0})}const s=document.createElement("zonos-controller");s.config=n,s.zonosApiKey=o,s.addEventListener("stripeInitEvent",(async n=>{const{detail:o}=n;e("loading Stripe");const r=await(async(...e)=>{c=!0;const t=Date.now();return l.then((n=>((e,t,n)=>{if(null===e)return null;const o=e.apply(void 0,t);return((e,t)=>{e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",startTime:t})})(o,n),o})(n,e,t)))})(o.publishableKey);r?(window.Zonos.stripe=r,s.initCheckoutElement(r)):t("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(s),a.zonosController=s,e("Zonos controller injected!")},w.injectSentryScript=()=>{const n="https://browser.sentry-cdn.com/7.88.0/bundle.tracing.min.js";if(document.querySelector(`script[src="${n}"]`))return void e("Sentry script already exists in the document","warn");const o=document.head||document.body,r=document.createElement("script");r.crossOrigin="anonymous",r.src=n,r.integrity="sha384-z/aQww1Fr6Mes0MO/2wlzQd2nXBCdDcKPXDTsMDMNPgTGRPqii3a4bzH79I+Vo8l",r.setAttribute("data-lazy","no"),r.onerror=()=>{t(`Failed to load ${r.src}`)},r.onload=()=>{var e;null===(e=window.Sentry)||void 0===e||e.init({allowUrls:[/js.zonos.com/],dsn:"https://19168bd05af0e2e0e7520ad58953e4f2@o446983.ingest.sentry.io/4506400622837760",release:`zonos-elements@${a.version}`})},o.appendChild(r)},w.injectScript=({fallBackDomain:n,isModule:o,scriptDomain:r,theRestUrl:s})=>{const i=`${r}/${s}`;if(document.querySelector(`script[src="${i}"]`))return void e(`Zonos script "${i}" already exists in the document`,"warn");const l=document.head||document.body,c=document.createElement("script");o?c.type="module":c.noModule=!0,c.src=i,c.crossOrigin="anonymous",c.onerror=()=>{/\/\/v\d+\./g.test(r)?(n&&a.injectScript({isModule:o,scriptDomain:n,theRestUrl:s}),t(`Failed to load ${c.src}`)):e("No need to fallback since this is not a versioned domain","warn")},l.appendChild(c)},w.injectZonosCdn=()=>{a.injectScript({fallBackDomain:m,isModule:!0,scriptDomain:u,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),a.injectScript({fallBackDomain:m,isModule:!1,scriptDomain:u,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),e("Zonos cdn script injected!")},w.injectStylesheet=({fallBackDomain:n,stylesheetDomain:o,theRestUrl:r})=>{const s=document.head||document.body,i=document.createElement("link");i.rel="preconnect",i.href=`${u}/`,s.appendChild(i);const l=document.createElement("link");l.rel="stylesheet",l.href=`${o}/${r}`,l.onerror=()=>{const s=/\/\/v\d+\./g.test(o);s?(n&&s&&a.injectStylesheet({stylesheetDomain:n,theRestUrl:r}),t(`Failed to load ${l.href}`)):e("No need to fallback since this is not a versioned domain","warn")},s.appendChild(l)},w.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?e("Zonos style links already injected","warn"):(a.injectStylesheet({fallBackDomain:m,stylesheetDomain:u,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),e("Zonos style css injected!"))},w.injectFonts=()=>{if((()=>{const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${p}"]`);for(let t=0;t<e.length;t++){const n=e[t];if(n&&!y.test(n.href))return n}return null})())return void e("Inter font already injected","warn");const t=document.head||document.body,n=document.createElement("link");n.rel="preconnect",n.href=p,t.appendChild(n);const o=document.createElement("link");o.rel="stylesheet",o.href=`${p}/inter/inter.css`,t.appendChild(o),e("Zonos font injected!")},w.setupGoogleFont=e=>{var t;null===(t=a.zonosController)||void 0===t||t.setupGoogleFont(e)},w.injectSupportGoogleFont=t=>{var n;e(`[FONT] injecting ${t}`);const o=null===(n=t.match(/family=(.*?):/))||void 0===n?void 0:n[1],r=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${h}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=h,r.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${t}"]`))return void e(`[FONT] ${o} font already injected`,"warn");const s=document.createElement("link");s.rel="stylesheet",s.href=t,r.appendChild(s),e(`[FONT] ${o} font injected!`)},window.Zonos=w})();
1
+ (function(){"use strict";const e=(e,t,...n)=>{var o;if(!window.Zonos.debug)return;let r=document.querySelector("iframe#zonos---debug-logging-iframe");r||(r=document.createElement("iframe"),r.id="zonos---debug-logging-iframe",r.style.display="none",r.style.opacity="0",r.style.position="absolute",r.style.top="-9999px",r.style.left="-9999px",r.style.width="1px",r.style.height="1px",r.style.border="none",r.style.overflow="hidden",r.style.visibility="hidden",document.body.appendChild(r));const s=(null===(o=r.contentWindow)||void 0===o?void 0:o.window.console)||window.console;switch(t){case"warn":s.warn(e,...n);break;case"info":s.info(e,...n);break;default:s.groupCollapsed(e,...n),s.trace(),s.groupEnd()}},t=(e,...t)=>{console.error(e,...t)},n="https://js.stripe.com/v3",o=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,r="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let s=null;const i=e=>(null!==s||(s=new Promise(((s,i)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(r),window.Stripe)s(window.Stripe);else try{let l=(()=>{const e=document.querySelectorAll(`script[src^="${n}"]`);for(let t=0;t<e.length;t++){const n=e[t];if(n&&o.test(n.src))return n}return null})();l&&e?console.warn(r):l||(l=(e=>{const o=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",r=document.createElement("script");r.src=`${n}${o}`;const s=document.head||document.body;return s?(s.appendChild(r),r):(t("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})(e)),null==l||l.addEventListener("load",(()=>{window.Stripe?s(window.Stripe):i(new Error("Stripe.js not available"))})),null==l||l.addEventListener("error",(()=>{i(new Error("Failed to load Stripe.js"))}))}catch(e){return void i(e)}else s(null)}))),s),l=Promise.resolve().then((()=>i(null)));let c=!1;l.catch((e=>{c||console.warn(e)}));var a;const d=(()=>{const e=(e=>{if(!e)return null;const t=new URL(e).searchParams.get("zonosQaUrl");return t?/[^a-zA-Z0-9-_]+/.test(t)?null:t:null})(window.location.href);if(!e)return null;const t=`https://${e}.preview.js.zonos.com`;return console.warn(`[ZONOS-WARNING] using '${t}' for loading script`),fetch(t).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${t}' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE`);const e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");const{pathname:n}=window.location,o=`${n}?${e.toString()}`;return window.history.replaceState({},"",o),window.location.reload(),null})),t})(),u=d||"https://v1.3.5-alpha.0.js.zonos.com",p="https://unpkg.com/@zonos/elements@1.3.5-alpha.0",m="https://rsms.me",h="https://fonts.googleapis.com",y=/^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;class w{}a=w,w.doneInit=!1,w.debug=!!window.location.search.match(/\?.*(&*)zonosDebug=1/),w.isBigCommerce=!1,w.internationalHideSelector="",w.zonosQaUrl=d,w.version="v1.3.5-alpha.0",w.modeAlerted=!1,w.getCurrentTimestamp=()=>(new Date).getTime(),w.zonosController=null,w.init=async({appearance:n,checkoutSettings:o,currencyConverter:r,helloSettings:s,storeId:i,zonosApiKey:l})=>{a.doneInit||(e(`====== ZONOS DEBUG MODE: on (${a.version}) ======`),l?(a.zonosApiKey=l,a.storeId=i,e("init zonos"),a.injectSentryScript(),a.injectZonosCdn(),a.injectZonosCss(),a.injectFonts(),a.injectController({config:{appearance:n,checkoutSettings:o,currencyConverter:r,helloSettings:s},zonosApiKey:l}),a.doneInit=!0):t("Missing Zonos API key"))},w.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},w.showNotification=e=>{var t;null===(t=a.zonosController)||void 0===t||t.showNotification(e)},w.updateOrganizationName=e=>{var t;null===(t=a.zonosController)||void 0===t||t.updateOrganizationName(e)},w.disablePlaceOrderButtons=({autoEnable:e=!0,disable:t,placeOrderButtonSelector:n})=>{if(n){const o=document.querySelectorAll(n),r=e=>{e.target.getAttribute("disabled")&&(e.preventDefault(),e.stopPropagation())};o.forEach((e=>{e.getAttribute("data-zonos-checkout-attached")||(t?(e.setAttribute("disabled","true"),e.addEventListener("click",r)):(e.removeAttribute("disabled"),e.removeEventListener("click",r)))})),e&&t&&setTimeout((()=>{o.forEach((e=>{e.removeAttribute("disabled"),e.removeEventListener("click",r)}))}),5e3)}},w.injectController=({config:n,zonosApiKey:o})=>{var r;if(document.querySelector("zonos-controller"))return;if(null===(r=n.checkoutSettings)||void 0===r?void 0:r.placeOrderButtonSelector){const e=n.checkoutSettings.placeOrderButtonSelector;a.disablePlaceOrderButtons({disable:!0,placeOrderButtonSelector:e});new MutationObserver((()=>{a.disablePlaceOrderButtons({disable:!0,placeOrderButtonSelector:e})})).observe(document.body,{childList:!0,subtree:!0})}const s=document.createElement("zonos-controller");s.config=n,s.zonosApiKey=o,s.addEventListener("stripeInitEvent",(async n=>{const{detail:o}=n;e("loading Stripe");const r=await(async(...e)=>{c=!0;const t=Date.now();return l.then((n=>((e,t,n)=>{if(null===e)return null;const o=e.apply(void 0,t);return((e,t)=>{e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",startTime:t})})(o,n),o})(n,e,t)))})(o.publishableKey);r?(window.Zonos.stripe=r,s.initCheckoutElement(r)):t("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(s),a.zonosController=s,e("Zonos controller injected!")},w.injectSentryScript=()=>{const n="https://browser.sentry-cdn.com/7.88.0/bundle.tracing.min.js";if(document.querySelector(`script[src="${n}"]`))return void e("Sentry script already exists in the document","warn");const o=document.head||document.body,r=document.createElement("script");r.crossOrigin="anonymous",r.src=n,r.integrity="sha384-z/aQww1Fr6Mes0MO/2wlzQd2nXBCdDcKPXDTsMDMNPgTGRPqii3a4bzH79I+Vo8l",r.setAttribute("data-lazy","no"),r.onerror=()=>{t(`Failed to load ${r.src}`)},r.onload=()=>{var e;null===(e=window.Sentry)||void 0===e||e.init({allowUrls:[/js.zonos.com/],dsn:"https://19168bd05af0e2e0e7520ad58953e4f2@o446983.ingest.sentry.io/4506400622837760",release:`zonos-elements@${a.version}`})},o.appendChild(r)},w.injectScript=({fallBackDomain:n,isModule:o,scriptDomain:r,theRestUrl:s})=>{const i=`${r}/${s}`;if(document.querySelector(`script[src="${i}"]`))return void e(`Zonos script "${i}" already exists in the document`,"warn");const l=document.head||document.body,c=document.createElement("script");o?c.type="module":c.noModule=!0,c.src=i,c.crossOrigin="anonymous",c.onerror=()=>{/\/\/v\d+\./g.test(r)?(n&&a.injectScript({isModule:o,scriptDomain:n,theRestUrl:s}),t(`Failed to load ${c.src}`)):e("No need to fallback since this is not a versioned domain","warn")},l.appendChild(c)},w.injectZonosCdn=()=>{a.injectScript({fallBackDomain:p,isModule:!0,scriptDomain:u,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),a.injectScript({fallBackDomain:p,isModule:!1,scriptDomain:u,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),e("Zonos cdn script injected!")},w.injectStylesheet=({fallBackDomain:n,stylesheetDomain:o,theRestUrl:r})=>{const s=document.head||document.body,i=document.createElement("link");i.rel="preconnect",i.href=`${u}/`,s.appendChild(i);const l=document.createElement("link");l.rel="stylesheet",l.href=`${o}/${r}`,l.onerror=()=>{const s=/\/\/v\d+\./g.test(o);s?(n&&s&&a.injectStylesheet({stylesheetDomain:n,theRestUrl:r}),t(`Failed to load ${l.href}`)):e("No need to fallback since this is not a versioned domain","warn")},s.appendChild(l)},w.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?e("Zonos style links already injected","warn"):(a.injectStylesheet({fallBackDomain:p,stylesheetDomain:u,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),e("Zonos style css injected!"))},w.injectFonts=()=>{if((()=>{const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${m}"]`);for(let t=0;t<e.length;t++){const n=e[t];if(n&&!y.test(n.href))return n}return null})())return void e("Inter font already injected","warn");const t=document.head||document.body,n=document.createElement("link");n.rel="preconnect",n.href=m,t.appendChild(n);const o=document.createElement("link");o.rel="stylesheet",o.href=`${m}/inter/inter.css`,t.appendChild(o),e("Zonos font injected!")},w.setupGoogleFont=e=>{var t;null===(t=a.zonosController)||void 0===t||t.setupGoogleFont(e)},w.injectSupportGoogleFont=t=>{var n;e(`[FONT] injecting ${t}`);const o=null===(n=t.match(/family=(.*?):/))||void 0===n?void 0:n[1],r=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${h}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=h,r.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${t}"]`))return void e(`[FONT] ${o} font already injected`,"warn");const s=document.createElement("link");s.rel="stylesheet",s.href=t,r.appendChild(s),e(`[FONT] ${o} font injected!`)},window.Zonos=w})();
@@ -1 +1 @@
1
- (function(){"use strict";const e=(e,t,...n)=>{var o;if(!window.Zonos.debug)return;let r=document.querySelector("iframe#zonos---debug-logging-iframe");r||(r=document.createElement("iframe"),r.id="zonos---debug-logging-iframe",r.style.display="none",r.style.opacity="0",r.style.position="absolute",r.style.top="-9999px",r.style.left="-9999px",r.style.width="1px",r.style.height="1px",r.style.border="none",r.style.overflow="hidden",r.style.visibility="hidden",document.body.appendChild(r));const s=(null===(o=r.contentWindow)||void 0===o?void 0:o.window.console)||window.console;switch(t){case"warn":s.warn(e,...n);break;case"info":s.info(e,...n);break;default:s.groupCollapsed(e,...n),s.trace(),s.groupEnd()}},t=(e,...t)=>{console.error(e,...t)},n="https://js.stripe.com/v3",o=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,r="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let s=null;const i=e=>(null!==s||(s=new Promise(((s,i)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(r),window.Stripe)s(window.Stripe);else try{let l=(()=>{const e=document.querySelectorAll(`script[src^="${n}"]`);for(let t=0;t<e.length;t++){const n=e[t];if(n&&o.test(n.src))return n}return null})();l&&e?console.warn(r):l||(l=(e=>{const o=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",r=document.createElement("script");r.src=`${n}${o}`;const s=document.head||document.body;return s?(s.appendChild(r),r):(t("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})(e)),null==l||l.addEventListener("load",(()=>{window.Stripe?s(window.Stripe):i(new Error("Stripe.js not available"))})),null==l||l.addEventListener("error",(()=>{i(new Error("Failed to load Stripe.js"))}))}catch(e){return void i(e)}else s(null)}))),s),l=Promise.resolve().then((()=>i(null)));let c=!1;l.catch((e=>{c||console.warn(e)}));var a;const d=(()=>{const e=(e=>{if(!e)return null;const t=new URL(e).searchParams.get("zonosQaUrl");return t?/[^a-zA-Z0-9-_]+/.test(t)?null:t:null})(window.location.href);if(!e)return null;const t=`https://${e}.preview.js.zonos.com`;return console.warn(`[ZONOS-WARNING] using '${t}' for loading script`),fetch(t).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${t}' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE`);const e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");const{pathname:n}=window.location,o=`${n}?${e.toString()}`;return window.history.replaceState({},"",o),window.location.reload(),null})),t})(),u=d||"https://v1.3.4.js.zonos.com",m="https://unpkg.com/@zonos/elements@1.3.4",p="https://rsms.me",h="https://fonts.googleapis.com",y=/^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;class w{}a=w,w.doneInit=!1,w.debug=!!window.location.search.match(/\?.*(&*)zonosDebug=1/),w.isBigCommerce=!1,w.internationalHideSelector="",w.zonosQaUrl=d,w.version="v1.3.4",w.modeAlerted=!1,w.getCurrentTimestamp=()=>(new Date).getTime(),w.zonosController=null,w.init=async({appearance:n,checkoutSettings:o,currencyConverter:r,helloSettings:s,storeId:i,zonosApiKey:l})=>{a.doneInit||(e(`====== ZONOS DEBUG MODE: on (${a.version}) ======`),l?(a.zonosApiKey=l,a.storeId=i,e("init zonos"),a.injectSentryScript(),a.injectZonosCdn(),a.injectZonosCss(),a.injectFonts(),a.injectController({config:{appearance:n,checkoutSettings:o,currencyConverter:r,helloSettings:s},zonosApiKey:l}),a.doneInit=!0):t("Missing Zonos API key"))},w.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},w.showNotification=e=>{var t;null===(t=a.zonosController)||void 0===t||t.showNotification(e)},w.updateOrganizationName=e=>{var t;null===(t=a.zonosController)||void 0===t||t.updateOrganizationName(e)},w.disablePlaceOrderButtons=({autoEnable:e=!0,disable:t,placeOrderButtonSelector:n})=>{if(n){const o=document.querySelectorAll(n),r=e=>{e.target.getAttribute("disabled")&&(e.preventDefault(),e.stopPropagation())};o.forEach((e=>{e.getAttribute("data-zonos-checkout-attached")||(t?(e.setAttribute("disabled","true"),e.addEventListener("click",r)):(e.removeAttribute("disabled"),e.removeEventListener("click",r)))})),e&&t&&setTimeout((()=>{o.forEach((e=>{e.removeAttribute("disabled"),e.removeEventListener("click",r)}))}),5e3)}},w.injectController=({config:n,zonosApiKey:o})=>{var r;if(document.querySelector("zonos-controller"))return;if(null===(r=n.checkoutSettings)||void 0===r?void 0:r.placeOrderButtonSelector){const e=n.checkoutSettings.placeOrderButtonSelector;a.disablePlaceOrderButtons({disable:!0,placeOrderButtonSelector:e});new MutationObserver((()=>{a.disablePlaceOrderButtons({disable:!0,placeOrderButtonSelector:e})})).observe(document.body,{childList:!0,subtree:!0})}const s=document.createElement("zonos-controller");s.config=n,s.zonosApiKey=o,s.addEventListener("stripeInitEvent",(async n=>{const{detail:o}=n;e("loading Stripe");const r=await(async(...e)=>{c=!0;const t=Date.now();return l.then((n=>((e,t,n)=>{if(null===e)return null;const o=e.apply(void 0,t);return((e,t)=>{e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",startTime:t})})(o,n),o})(n,e,t)))})(o.publishableKey);r?(window.Zonos.stripe=r,s.initCheckoutElement(r)):t("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(s),a.zonosController=s,e("Zonos controller injected!")},w.injectSentryScript=()=>{const n="https://browser.sentry-cdn.com/7.88.0/bundle.tracing.min.js";if(document.querySelector(`script[src="${n}"]`))return void e("Sentry script already exists in the document","warn");const o=document.head||document.body,r=document.createElement("script");r.crossOrigin="anonymous",r.src=n,r.integrity="sha384-z/aQww1Fr6Mes0MO/2wlzQd2nXBCdDcKPXDTsMDMNPgTGRPqii3a4bzH79I+Vo8l",r.setAttribute("data-lazy","no"),r.onerror=()=>{t(`Failed to load ${r.src}`)},r.onload=()=>{var e;null===(e=window.Sentry)||void 0===e||e.init({allowUrls:[/js.zonos.com/],dsn:"https://19168bd05af0e2e0e7520ad58953e4f2@o446983.ingest.sentry.io/4506400622837760",release:`zonos-elements@${a.version}`})},o.appendChild(r)},w.injectScript=({fallBackDomain:n,isModule:o,scriptDomain:r,theRestUrl:s})=>{const i=`${r}/${s}`;if(document.querySelector(`script[src="${i}"]`))return void e(`Zonos script "${i}" already exists in the document`,"warn");const l=document.head||document.body,c=document.createElement("script");o?c.type="module":c.noModule=!0,c.src=i,c.crossOrigin="anonymous",c.onerror=()=>{/\/\/v\d+\./g.test(r)?(n&&a.injectScript({isModule:o,scriptDomain:n,theRestUrl:s}),t(`Failed to load ${c.src}`)):e("No need to fallback since this is not a versioned domain","warn")},l.appendChild(c)},w.injectZonosCdn=()=>{a.injectScript({fallBackDomain:m,isModule:!0,scriptDomain:u,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),a.injectScript({fallBackDomain:m,isModule:!1,scriptDomain:u,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),e("Zonos cdn script injected!")},w.injectStylesheet=({fallBackDomain:n,stylesheetDomain:o,theRestUrl:r})=>{const s=document.head||document.body,i=document.createElement("link");i.rel="preconnect",i.href=`${u}/`,s.appendChild(i);const l=document.createElement("link");l.rel="stylesheet",l.href=`${o}/${r}`,l.onerror=()=>{const s=/\/\/v\d+\./g.test(o);s?(n&&s&&a.injectStylesheet({stylesheetDomain:n,theRestUrl:r}),t(`Failed to load ${l.href}`)):e("No need to fallback since this is not a versioned domain","warn")},s.appendChild(l)},w.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?e("Zonos style links already injected","warn"):(a.injectStylesheet({fallBackDomain:m,stylesheetDomain:u,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),e("Zonos style css injected!"))},w.injectFonts=()=>{if((()=>{const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${p}"]`);for(let t=0;t<e.length;t++){const n=e[t];if(n&&!y.test(n.href))return n}return null})())return void e("Inter font already injected","warn");const t=document.head||document.body,n=document.createElement("link");n.rel="preconnect",n.href=p,t.appendChild(n);const o=document.createElement("link");o.rel="stylesheet",o.href=`${p}/inter/inter.css`,t.appendChild(o),e("Zonos font injected!")},w.setupGoogleFont=e=>{var t;null===(t=a.zonosController)||void 0===t||t.setupGoogleFont(e)},w.injectSupportGoogleFont=t=>{var n;e(`[FONT] injecting ${t}`);const o=null===(n=t.match(/family=(.*?):/))||void 0===n?void 0:n[1],r=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${h}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=h,r.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${t}"]`))return void e(`[FONT] ${o} font already injected`,"warn");const s=document.createElement("link");s.rel="stylesheet",s.href=t,r.appendChild(s),e(`[FONT] ${o} font injected!`)},exports.Zonos=w})();
1
+ (function(){"use strict";const e=(e,t,...n)=>{var o;if(!window.Zonos.debug)return;let r=document.querySelector("iframe#zonos---debug-logging-iframe");r||(r=document.createElement("iframe"),r.id="zonos---debug-logging-iframe",r.style.display="none",r.style.opacity="0",r.style.position="absolute",r.style.top="-9999px",r.style.left="-9999px",r.style.width="1px",r.style.height="1px",r.style.border="none",r.style.overflow="hidden",r.style.visibility="hidden",document.body.appendChild(r));const s=(null===(o=r.contentWindow)||void 0===o?void 0:o.window.console)||window.console;switch(t){case"warn":s.warn(e,...n);break;case"info":s.info(e,...n);break;default:s.groupCollapsed(e,...n),s.trace(),s.groupEnd()}},t=(e,...t)=>{console.error(e,...t)},n="https://js.stripe.com/v3",o=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,r="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let s=null;const i=e=>(null!==s||(s=new Promise(((s,i)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(r),window.Stripe)s(window.Stripe);else try{let l=(()=>{const e=document.querySelectorAll(`script[src^="${n}"]`);for(let t=0;t<e.length;t++){const n=e[t];if(n&&o.test(n.src))return n}return null})();l&&e?console.warn(r):l||(l=(e=>{const o=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",r=document.createElement("script");r.src=`${n}${o}`;const s=document.head||document.body;return s?(s.appendChild(r),r):(t("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})(e)),null==l||l.addEventListener("load",(()=>{window.Stripe?s(window.Stripe):i(new Error("Stripe.js not available"))})),null==l||l.addEventListener("error",(()=>{i(new Error("Failed to load Stripe.js"))}))}catch(e){return void i(e)}else s(null)}))),s),l=Promise.resolve().then((()=>i(null)));let c=!1;l.catch((e=>{c||console.warn(e)}));var a;const d=(()=>{const e=(e=>{if(!e)return null;const t=new URL(e).searchParams.get("zonosQaUrl");return t?/[^a-zA-Z0-9-_]+/.test(t)?null:t:null})(window.location.href);if(!e)return null;const t=`https://${e}.preview.js.zonos.com`;return console.warn(`[ZONOS-WARNING] using '${t}' for loading script`),fetch(t).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${t}' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE`);const e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");const{pathname:n}=window.location,o=`${n}?${e.toString()}`;return window.history.replaceState({},"",o),window.location.reload(),null})),t})(),u=d||"https://v1.3.5-alpha.0.js.zonos.com",p="https://unpkg.com/@zonos/elements@1.3.5-alpha.0",m="https://rsms.me",h="https://fonts.googleapis.com",y=/^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;class w{}a=w,w.doneInit=!1,w.debug=!!window.location.search.match(/\?.*(&*)zonosDebug=1/),w.isBigCommerce=!1,w.internationalHideSelector="",w.zonosQaUrl=d,w.version="v1.3.5-alpha.0",w.modeAlerted=!1,w.getCurrentTimestamp=()=>(new Date).getTime(),w.zonosController=null,w.init=async({appearance:n,checkoutSettings:o,currencyConverter:r,helloSettings:s,storeId:i,zonosApiKey:l})=>{a.doneInit||(e(`====== ZONOS DEBUG MODE: on (${a.version}) ======`),l?(a.zonosApiKey=l,a.storeId=i,e("init zonos"),a.injectSentryScript(),a.injectZonosCdn(),a.injectZonosCss(),a.injectFonts(),a.injectController({config:{appearance:n,checkoutSettings:o,currencyConverter:r,helloSettings:s},zonosApiKey:l}),a.doneInit=!0):t("Missing Zonos API key"))},w.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},w.showNotification=e=>{var t;null===(t=a.zonosController)||void 0===t||t.showNotification(e)},w.updateOrganizationName=e=>{var t;null===(t=a.zonosController)||void 0===t||t.updateOrganizationName(e)},w.disablePlaceOrderButtons=({autoEnable:e=!0,disable:t,placeOrderButtonSelector:n})=>{if(n){const o=document.querySelectorAll(n),r=e=>{e.target.getAttribute("disabled")&&(e.preventDefault(),e.stopPropagation())};o.forEach((e=>{e.getAttribute("data-zonos-checkout-attached")||(t?(e.setAttribute("disabled","true"),e.addEventListener("click",r)):(e.removeAttribute("disabled"),e.removeEventListener("click",r)))})),e&&t&&setTimeout((()=>{o.forEach((e=>{e.removeAttribute("disabled"),e.removeEventListener("click",r)}))}),5e3)}},w.injectController=({config:n,zonosApiKey:o})=>{var r;if(document.querySelector("zonos-controller"))return;if(null===(r=n.checkoutSettings)||void 0===r?void 0:r.placeOrderButtonSelector){const e=n.checkoutSettings.placeOrderButtonSelector;a.disablePlaceOrderButtons({disable:!0,placeOrderButtonSelector:e});new MutationObserver((()=>{a.disablePlaceOrderButtons({disable:!0,placeOrderButtonSelector:e})})).observe(document.body,{childList:!0,subtree:!0})}const s=document.createElement("zonos-controller");s.config=n,s.zonosApiKey=o,s.addEventListener("stripeInitEvent",(async n=>{const{detail:o}=n;e("loading Stripe");const r=await(async(...e)=>{c=!0;const t=Date.now();return l.then((n=>((e,t,n)=>{if(null===e)return null;const o=e.apply(void 0,t);return((e,t)=>{e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",startTime:t})})(o,n),o})(n,e,t)))})(o.publishableKey);r?(window.Zonos.stripe=r,s.initCheckoutElement(r)):t("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(s),a.zonosController=s,e("Zonos controller injected!")},w.injectSentryScript=()=>{const n="https://browser.sentry-cdn.com/7.88.0/bundle.tracing.min.js";if(document.querySelector(`script[src="${n}"]`))return void e("Sentry script already exists in the document","warn");const o=document.head||document.body,r=document.createElement("script");r.crossOrigin="anonymous",r.src=n,r.integrity="sha384-z/aQww1Fr6Mes0MO/2wlzQd2nXBCdDcKPXDTsMDMNPgTGRPqii3a4bzH79I+Vo8l",r.setAttribute("data-lazy","no"),r.onerror=()=>{t(`Failed to load ${r.src}`)},r.onload=()=>{var e;null===(e=window.Sentry)||void 0===e||e.init({allowUrls:[/js.zonos.com/],dsn:"https://19168bd05af0e2e0e7520ad58953e4f2@o446983.ingest.sentry.io/4506400622837760",release:`zonos-elements@${a.version}`})},o.appendChild(r)},w.injectScript=({fallBackDomain:n,isModule:o,scriptDomain:r,theRestUrl:s})=>{const i=`${r}/${s}`;if(document.querySelector(`script[src="${i}"]`))return void e(`Zonos script "${i}" already exists in the document`,"warn");const l=document.head||document.body,c=document.createElement("script");o?c.type="module":c.noModule=!0,c.src=i,c.crossOrigin="anonymous",c.onerror=()=>{/\/\/v\d+\./g.test(r)?(n&&a.injectScript({isModule:o,scriptDomain:n,theRestUrl:s}),t(`Failed to load ${c.src}`)):e("No need to fallback since this is not a versioned domain","warn")},l.appendChild(c)},w.injectZonosCdn=()=>{a.injectScript({fallBackDomain:p,isModule:!0,scriptDomain:u,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),a.injectScript({fallBackDomain:p,isModule:!1,scriptDomain:u,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),e("Zonos cdn script injected!")},w.injectStylesheet=({fallBackDomain:n,stylesheetDomain:o,theRestUrl:r})=>{const s=document.head||document.body,i=document.createElement("link");i.rel="preconnect",i.href=`${u}/`,s.appendChild(i);const l=document.createElement("link");l.rel="stylesheet",l.href=`${o}/${r}`,l.onerror=()=>{const s=/\/\/v\d+\./g.test(o);s?(n&&s&&a.injectStylesheet({stylesheetDomain:n,theRestUrl:r}),t(`Failed to load ${l.href}`)):e("No need to fallback since this is not a versioned domain","warn")},s.appendChild(l)},w.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?e("Zonos style links already injected","warn"):(a.injectStylesheet({fallBackDomain:p,stylesheetDomain:u,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),e("Zonos style css injected!"))},w.injectFonts=()=>{if((()=>{const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${m}"]`);for(let t=0;t<e.length;t++){const n=e[t];if(n&&!y.test(n.href))return n}return null})())return void e("Inter font already injected","warn");const t=document.head||document.body,n=document.createElement("link");n.rel="preconnect",n.href=m,t.appendChild(n);const o=document.createElement("link");o.rel="stylesheet",o.href=`${m}/inter/inter.css`,t.appendChild(o),e("Zonos font injected!")},w.setupGoogleFont=e=>{var t;null===(t=a.zonosController)||void 0===t||t.setupGoogleFont(e)},w.injectSupportGoogleFont=t=>{var n;e(`[FONT] injecting ${t}`);const o=null===(n=t.match(/family=(.*?):/))||void 0===n?void 0:n[1],r=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${h}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=h,r.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${t}"]`))return void e(`[FONT] ${o} font already injected`,"warn");const s=document.createElement("link");s.rel="stylesheet",s.href=t,r.appendChild(s),e(`[FONT] ${o} font injected!`)},exports.Zonos=w})();