@zonos/elements 1.2.4-alpha.8 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +80 -1
- package/dist/cjs/{cart-90f7c8c0.js → cart-cfa5d5fd.js} +4 -4
- package/dist/cjs/{getBorderRadius-bf4a4276.js → getBorderRadius-c3c63ee6.js} +1 -1
- package/dist/cjs/index.cjs.js +5 -5
- package/dist/cjs/{isDarkColor-ff6ff183.js → isDarkColor-fc8c294a.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{localization-9caf3397.js → localization-4746acf7.js} +2 -2
- package/dist/cjs/{submitGtag-b141b45d.js → submitGtag-ca175427.js} +2 -2
- package/dist/cjs/zonos-address_2.cjs.entry.js +5 -5
- package/dist/cjs/zonos-badge.cjs.entry.js +1 -1
- package/dist/cjs/zonos-banner.cjs.entry.js +1 -1
- package/dist/cjs/zonos-button_2.cjs.entry.js +3 -3
- package/dist/cjs/zonos-card_2.cjs.entry.js +1 -1
- package/dist/cjs/zonos-cart-items_10.cjs.entry.js +9 -15
- package/dist/cjs/zonos-checkout.cjs.entry.js +6 -6
- package/dist/cjs/zonos-controller.cjs.entry.js +14 -8
- package/dist/cjs/zonos-country-flag_4.cjs.entry.js +3 -3
- package/dist/cjs/zonos-elements.cjs.js +1 -1
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +2 -2
- package/dist/cjs/zonos-hello.cjs.entry.js +8 -5
- package/dist/cjs/zonos-icon.cjs.entry.js +1 -1
- package/dist/cjs/zonos-notification.cjs.entry.js +1 -1
- package/dist/cjs/zonos-payment.cjs.entry.js +5 -5
- package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +2 -2
- package/dist/cjs/zonos-text.cjs.entry.js +1 -1
- package/dist/cjs/{zonosStore-b43ef5db.js → zonosStore-10d1d6ff.js} +0 -8
- package/dist/collection/__tests__/build-utils/urlCheckOne.js +4 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +4 -10
- package/dist/collection/components/hello/zonos-hello/zonos-hello.js +6 -3
- package/dist/collection/components/main/zonos-controller.js +35 -8
- package/dist/collection/components/store/zonosStore.js +0 -8
- package/dist/collection/components/utils/api/{getZonosSetting.js → getZonosSettings.js} +2 -2
- package/dist/collection/components/utils/handleFetch.js +1 -1
- package/dist/collection/environment.js +14 -3
- package/dist/collection/scripts/{zonos.js → zonosBase.js} +7 -19
- package/dist/collection/types/generated/graphql.customer.types.js +31 -0
- package/dist/collection/types/generated/graphql.frontend.types.js +9 -0
- package/dist/components/localization.js +1 -1
- package/dist/components/zonos-checkout-finish2.js +5 -10
- package/dist/components/zonos-controller.js +11 -4
- package/dist/components/zonos-hello.js +6 -3
- package/dist/components/zonosStore.js +0 -8
- package/dist/esm/{cart-b439be00.js → cart-d81b92ea.js} +4 -4
- package/dist/esm/{getBorderRadius-178a0a05.js → getBorderRadius-77e97943.js} +1 -1
- package/dist/esm/index.js +5 -5
- package/dist/esm/{isDarkColor-416d6047.js → isDarkColor-69090b29.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{localization-a51ccbc2.js → localization-0c5b29fd.js} +2 -2
- package/dist/esm/{submitGtag-521826a2.js → submitGtag-8a0fbd41.js} +2 -2
- package/dist/esm/zonos-address_2.entry.js +5 -5
- package/dist/esm/zonos-badge.entry.js +1 -1
- package/dist/esm/zonos-banner.entry.js +1 -1
- package/dist/esm/zonos-button_2.entry.js +3 -3
- package/dist/esm/zonos-card_2.entry.js +1 -1
- package/dist/esm/zonos-cart-items_10.entry.js +9 -15
- package/dist/esm/zonos-checkout.entry.js +6 -6
- package/dist/esm/zonos-controller.entry.js +14 -8
- package/dist/esm/zonos-country-flag_4.entry.js +3 -3
- package/dist/esm/zonos-elements.js +1 -1
- package/dist/esm/zonos-hello-dialog.entry.js +2 -2
- package/dist/esm/zonos-hello.entry.js +8 -5
- package/dist/esm/zonos-icon.entry.js +1 -1
- package/dist/esm/zonos-notification.entry.js +1 -1
- package/dist/esm/zonos-payment.entry.js +5 -5
- package/dist/esm/zonos-shipping-rich-radio.entry.js +2 -2
- package/dist/esm/zonos-text.entry.js +1 -1
- package/dist/esm/{zonosStore-61e74f58.js → zonosStore-34f07ee8.js} +0 -8
- package/dist/esm-es5/{cart-b439be00.js → cart-d81b92ea.js} +1 -1
- package/dist/esm-es5/{getBorderRadius-178a0a05.js → getBorderRadius-77e97943.js} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{isDarkColor-416d6047.js → isDarkColor-69090b29.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/{localization-a51ccbc2.js → localization-0c5b29fd.js} +1 -1
- package/dist/esm-es5/{submitGtag-521826a2.js → submitGtag-8a0fbd41.js} +1 -1
- package/dist/esm-es5/zonos-address_2.entry.js +1 -1
- package/dist/esm-es5/zonos-badge.entry.js +1 -1
- package/dist/esm-es5/zonos-banner.entry.js +1 -1
- package/dist/esm-es5/zonos-button_2.entry.js +1 -1
- package/dist/esm-es5/zonos-card_2.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_10.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-controller.entry.js +1 -1
- package/dist/esm-es5/zonos-country-flag_4.entry.js +1 -1
- package/dist/esm-es5/zonos-elements.js +1 -1
- package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm-es5/zonos-hello.entry.js +1 -1
- package/dist/esm-es5/zonos-icon.entry.js +1 -1
- package/dist/esm-es5/zonos-notification.entry.js +1 -1
- package/dist/esm-es5/zonos-payment.entry.js +1 -1
- package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
- package/dist/esm-es5/zonos-text.entry.js +1 -1
- package/dist/esm-es5/{zonosStore-61e74f58.js → zonosStore-34f07ee8.js} +1 -1
- package/dist/scripts/extractZonosQaUrl.js +1 -30
- package/dist/scripts/loadStripe.js +1 -118
- package/dist/scripts/loadZonos.js +1 -565
- package/dist/scripts/stripe.js +1 -126
- package/dist/scripts/zonos.js +1 -565
- package/dist/scripts/zonosBase.js +1 -0
- package/dist/types/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.d.ts +2 -3
- package/dist/types/components/main/zonos-controller.d.ts +5 -1
- package/dist/types/components/store/zonosStore.d.ts +1 -3
- package/dist/types/components/utils/api/getLocaleMessages.d.ts +1 -1
- package/dist/types/components/utils/api/{getZonosSetting.d.ts → getZonosSettings.d.ts} +1 -1
- package/dist/types/components.d.ts +6 -2
- package/dist/types/scripts/{zonos.d.ts → zonosBase.d.ts} +6 -3
- package/dist/types/types/checkout/CheckoutConfig.d.ts +3 -2
- package/dist/types/types/generated/graphql.customer.types.d.ts +35 -0
- package/dist/types/types/generated/graphql.customer.types.ts +44 -0
- package/dist/types/types/generated/graphql.frontend.types.d.ts +34 -1
- package/dist/types/types/generated/graphql.frontend.types.ts +69 -1
- package/dist/types/types/global.d.ts +10 -2
- package/dist/types/types/hello/HelloConfig.d.ts +0 -1
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-1685c8df.js → p-06a332cd.js} +1 -1
- package/dist/zonos-elements/{p-4ed71bd7.entry.js → p-124857ae.entry.js} +1 -1
- package/dist/zonos-elements/{p-e98be2d0.system.entry.js → p-1f494581.system.entry.js} +1 -1
- package/dist/zonos-elements/p-24fbe845.system.js +1 -1
- package/dist/zonos-elements/{p-4846796a.js → p-2b41549a.js} +1 -1
- package/dist/zonos-elements/p-2e1e9074.js +1 -0
- package/dist/zonos-elements/{p-2801d868.entry.js → p-3509ffaa.entry.js} +1 -1
- package/dist/zonos-elements/{p-1d4a970b.entry.js → p-3c8763a7.entry.js} +1 -1
- package/dist/zonos-elements/{p-49f09b91.entry.js → p-3e7444c6.entry.js} +1 -1
- package/dist/zonos-elements/p-436faf98.system.entry.js +1 -0
- package/dist/zonos-elements/{p-55f49f1e.js → p-4b3baf99.js} +1 -1
- package/dist/zonos-elements/{p-a504f64f.system.js → p-5066955b.system.js} +1 -1
- package/dist/zonos-elements/{p-e5ae22a9.system.entry.js → p-53ea93c2.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-f367f2fe.system.entry.js → p-5bada106.system.entry.js} +1 -1
- package/dist/zonos-elements/p-5e87609f.entry.js +1 -0
- package/dist/zonos-elements/{p-b85be1ab.system.js → p-7730250d.system.js} +1 -1
- package/dist/zonos-elements/{p-089ba905.js → p-86f22026.js} +1 -1
- package/dist/zonos-elements/{p-a0e36ed3.entry.js → p-88600956.entry.js} +1 -1
- package/dist/zonos-elements/{p-89c210d6.entry.js → p-8b1cb8a4.entry.js} +1 -1
- package/dist/zonos-elements/p-8bd04aaa.entry.js +1 -0
- package/dist/zonos-elements/{p-47390db7.system.entry.js → p-935fa685.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-639396bb.entry.js → p-9c1f19b6.entry.js} +1 -1
- package/dist/zonos-elements/{p-4d93275c.entry.js → p-a063c4b7.entry.js} +1 -1
- package/dist/zonos-elements/p-a174d834.system.js +1 -0
- package/dist/zonos-elements/{p-3c6988d7.js → p-a244579e.js} +1 -1
- package/dist/zonos-elements/{p-24eed2a8.system.js → p-a54d8db3.system.js} +1 -1
- package/dist/zonos-elements/{p-e1f6ab97.entry.js → p-ab00288a.entry.js} +1 -1
- package/dist/zonos-elements/{p-b51de536.system.js → p-ab179c88.system.js} +1 -1
- package/dist/zonos-elements/{p-afe26069.entry.js → p-ad2b4bda.entry.js} +1 -1
- package/dist/zonos-elements/{p-4bee0bff.system.entry.js → p-b3a71ae4.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-d856a200.system.entry.js → p-b3e034bb.system.entry.js} +1 -1
- package/dist/zonos-elements/p-b7e061e7.entry.js +1 -0
- package/dist/zonos-elements/{p-3cea383b.system.entry.js → p-bb7de2c4.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-da060b1c.system.js → p-c1665c4f.system.js} +1 -1
- package/dist/zonos-elements/{p-2f43da39.system.entry.js → p-c1e298d5.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-8c5595d9.system.entry.js → p-c520d819.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-c9348bb0.system.entry.js → p-ca875e60.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-b4601210.system.entry.js → p-ccd1794a.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-f141519c.system.entry.js → p-daa10b8c.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-b6148206.entry.js → p-e3bca405.entry.js} +1 -1
- package/dist/zonos-elements/{p-a376a37f.entry.js → p-e58cc024.entry.js} +1 -1
- package/dist/zonos-elements/{p-938803f4.entry.js → p-e6556b0d.entry.js} +1 -1
- package/dist/zonos-elements/{p-d2217f09.system.js → p-ed074fbf.system.js} +1 -1
- package/dist/zonos-elements/{p-560aa686.system.entry.js → p-f1e9b431.system.entry.js} +1 -1
- package/dist/zonos-elements/p-f7b07128.system.entry.js +1 -0
- package/dist/zonos-elements/{p-4a15c5c7.system.entry.js → p-fbc09dae.system.entry.js} +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +9 -6
- package/dist/collection/types/online-store/OnlineStoreConfig.js +0 -1
- package/dist/types/types/online-store/OnlineStoreConfig.d.ts +0 -3
- package/dist/zonos-elements/p-06fb9d1f.system.entry.js +0 -1
- package/dist/zonos-elements/p-19942abb.system.entry.js +0 -1
- package/dist/zonos-elements/p-494c77a7.entry.js +0 -1
- package/dist/zonos-elements/p-8c48b75e.system.js +0 -1
- package/dist/zonos-elements/p-a3a8b5e7.entry.js +0 -1
- package/dist/zonos-elements/p-e9b832c5.entry.js +0 -1
- package/dist/zonos-elements/p-ff95f098.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-36ff6342.js";import{s as stripeStore,m as stripeStorePrefetchLandedCost}from"./cart-
|
|
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-36ff6342.js";import{s as stripeStore,m as stripeStorePrefetchLandedCost}from"./cart-d81b92ea.js";import{b as logError,a as localizationStore}from"./localization-0c5b29fd.js";import"./zonosStore-34f07ee8.js";import"./isDarkColor-69090b29.js";import"./getBorderRadius-77e97943.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 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,{class:"zonos--address zonos--elements"},h("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},this.titleText),h("div",{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=zonosAddressCss;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 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,{class:"zonos--link-authentication zonos--elements"},h("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},this.titleText),h("div",{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=zonosLinkAuthenticationCss;export{ZonosAddress as zonos_address,ZonosLinkAuthentication as zonos_link_authentication};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as registerInstance,h,H as Host}from"./index-36ff6342.js";import{e as zonosStoreFontFamily}from"./zonosStore-
|
|
1
|
+
import{r as registerInstance,h,H as Host}from"./index-36ff6342.js";import{e as zonosStoreFontFamily}from"./zonosStore-34f07ee8.js";import{c as classes}from"./classes-0d95c529.js";var zonosBadgeCss=":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 .zonos--badge-content{display:-ms-flexbox;display:flex;gap:var(--amino-space-8);font-size:var(--amino-font-size-s);padding:4px 8px;text-align:center;border-radius:var(--amino-radius-6);background-color:var(--amino-gray-100);color:var(--amino-gray-800);-ms-flex-align:center;align-items:center}:host p{font-weight:600;line-height:16px}:host .icon-right svg{-ms-flex-order:2;order:2}:host .small{padding:2px 8px}:host .rounded{border-radius:20px}:host .bold{background-color:var(--amino-gray-600);color:var(--amino-gray-100)}:host .blue{background-color:var(--amino-blue-100);color:var(--amino-blue-800)}:host .blue.bold{background-color:var(--amino-blue-600);color:var(--amino-blue-100)}:host .green{background-color:var(--amino-green-100);color:var(--amino-green-800)}:host .green.bold{background-color:var(--amino-green-600);color:var(--amino-green-100)}:host .red{background-color:var(--amino-red-100);color:var(--amino-red-800)}:host .red.bold{background-color:var(--amino-red-600);color:var(--amino-red-100)}:host .orange{background-color:var(--amino-orange-100);color:var(--amino-orange-800)}:host .orange.bold{background-color:var(--amino-orange-600);color:var(--amino-orange-100)}:host .purple{background-color:var(--amino-purple-100);color:var(--amino-purple-800)}:host .purple.bold{background-color:var(--amino-purple-600);color:var(--amino-purple-100)}:host .cyan{background-color:var(--amino-cyan-100);color:var(--amino-cyan-800)}:host .cyan.bold{background-color:var(--amino-cyan-600);color:var(--amino-cyan-100)}";var ZonosBadge=function(){function o(o){registerInstance(this,o);this.bold=false;this.color="gray";this.icon=undefined;this.iconRight=false;this.size="default";this.rounded=false;this.class=""}o.prototype.render=function(){return h(Host,{class:classes(["zonos--elements zonos--badge",this.class]),style:{"--font-family":zonosStoreFontFamily()}},h("div",{class:classes(["zonos--badge-content",this.color,this.rounded&&"rounded",this.iconRight&&"icon-right",this.size,this.bold&&"bold"])},this.icon,h("zonos-text",null,h("slot",null))))};return o}();ZonosBadge.style=zonosBadgeCss;export{ZonosBadge as zonos_badge};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as registerInstance,h,H as Host}from"./index-36ff6342.js";import{e as zonosStoreFontFamily}from"./zonosStore-
|
|
1
|
+
import{r as registerInstance,h,H as Host}from"./index-36ff6342.js";import{e as zonosStoreFontFamily}from"./zonosStore-34f07ee8.js";import{c as classes}from"./classes-0d95c529.js";var zonosBannerCss=':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{border-radius:var(--amino-radius-10);padding:var(--amino-space-16);background:var(--amino-gray-100)}:host .zonos--container{display:grid;-ms-flex-align:center;align-items:center;grid-template-areas:"icon header" ". content";grid-template-columns:32px auto 0}:host .zonos--icon-wrapper{grid-area:icon;display:-ms-flexbox;display:flex;justify-self:start}:host .zonos--header-wrapper{margin-top:var(--amino-space-0);grid-area:header}:host .zonos--content-wrapper{grid-area:content;margin-top:var(--amino-space-4)}:host(.info){background-color:var(--amino-blue-100);border:1px solid var(--amino-blue-200)}:host(.success){background-color:var(--amino-green-100);border:1px solid var(--amino-green-200)}:host(.error){background-color:var(--amino-red-100);border:1px solid var(--amino-red-200)}:host(.warning){background-color:var(--amino-orange-100);border:1px solid var(--amino-orange-200)}';var ZonosBanner=function(){function o(o){var r=this;registerInstance(this,o);this.handleSlotChange=function(){r.hasContent=true};this.bannerTitle=undefined;this.intent=undefined;this.class="";this.hasContent=false}o.prototype.render=function(){var o=this;var r=function(r){var a=r.color;var s="var(--amino-".concat(a,"-800)");var n="var(--amino-".concat(a,"-300)");var e=[o.bannerTitle,h("slot",{onSlotchange:o.handleSlotChange})].filter(Boolean),t=e[0],i=e[1];var l=a==="gray"?"gray-1200":"".concat(a,"-800");return h("div",{class:classes(["zonos--container"])},h("div",{class:"zonos--icon-wrapper"},h("svg",{color:s,fill:"none",height:"20",viewBox:"0 0 24 24",width:"20",xmlns:"https://www.w3.org/2000/svg"},h("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:n,"fill-rule":"evenodd"}),h("path",{"clip-rule":"evenodd",d:"M12 6.99a1 1 0 0 1 1 1V8a1 1 0 1 1-2 0v-.01a1 1 0 0 1 1-1ZM12 11a1 1 0 0 1 1 1v4a1 1 0 1 1-2 0v-4a1 1 0 0 1 1-1Z",fill:"currentColor","fill-rule":"evenodd"}))),h("div",{class:"zonos--header-wrapper"},h("zonos-text",{color:l,type:"label",weight:600},t)),i&&h("div",{class:"zonos--content-wrapper"},h("zonos-text",{color:l},i)))};var a=classes(["zonos--elements zonos--banner",this.class,this.intent]);var s=zonosStoreFontFamily();switch(this.intent){case"error":return h(Host,{class:a,style:{"--font-family":s}},r({color:"red"}));case"info":return h(Host,{class:a,style:{"--font-family":s}},r({color:"blue"}));case"success":return h(Host,{class:a,style:{"--font-family":s}},r({color:"green"}));case"warning":return h(Host,{class:a,style:{"--font-family":s}},r({color:"orange"}));default:return h(Host,{class:a,style:{"--font-family":s}},r({color:"gray"}))}};return o}();ZonosBanner.style=zonosBannerCss;export{ZonosBanner as zonos_banner};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as registerInstance,h,H as Host,d as getElement}from"./index-36ff6342.js";import{z as zonosStore,e as zonosStoreFontFamily}from"./zonosStore-61e74f58.js";import{c as classes}from"./classes-0d95c529.js";import{g as getBorderRadius}from"./getBorderRadius-178a0a05.js";import{i as isColorVariable}from"./isColorVariable-91c33804.js";import{i as isDarkColor}from"./isDarkColor-416d6047.js";var getButtonTheme=function(o){var t=o||zonosStore.appearance.colorSecondary;var n=t&&isColorVariable(t)?"var(--amino-".concat(t,")"):t;var r=n&&isDarkColor(n)?"DARK":"LIGHT";return r};var zonosButtonCss=":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 .zonos--spinner-wrapper{position:absolute;top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;background-color:var(--amino-surface-color);-ms-flex-pack:center;justify-content:center;border-radius:var(--amino-radius-10);gap:var(--amino-space-8)}:host button{width:100%;position:relative;font-size:14px;-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background-color:var(--amino-surface-color);border:none;outline:1px solid var(--amino-surface-color);border-radius:var(--border-radius, var(--amino-radius-10));-webkit-transition:var(--amino-transition);transition:var(--amino-transition);font-weight:500;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font-family:var(--font-family, Inter), Inter;letter-spacing:normal;cursor:pointer;white-space:nowrap;padding:var(--amino-space-8) var(--amino-space-24);color:var(--color, var(--amino-gray-1200));}:host button.sm.no-background,:host button.md.no-background,:host button.lg.no-background{background:none;outline:none}:host button.sm.no-padding-left,:host button.md.no-padding-left,:host button.lg.no-padding-left{padding-left:0}:host button.sm.no-padding-right,:host button.md.no-padding-right,:host button.lg.no-padding-right{padding-right:0}:host button[disabled]{cursor:not-allowed;background-color:var(--amino-gray-200)}:host button[disabled] .zonos--spinner-wrapper{background-color:var(--amino-gray-200)}:host button:active{-webkit-transform:scale(0.99);transform:scale(0.99)}:host button.sm{height:var(--amino-size-sm);line-height:var(--amino-size-sm);padding:var(--amino-space-4) var(--amino-space-8)}:host button.sm:not(.has-content).has-icon{padding:0 var(--amino-space-4)}:host button.md{height:var(--amino-size-md);line-height:var(--amino-size-md);padding:var(--amino-space-8) var(--amino-space-16)}:host button.md:not(.has-content).has-icon{padding:0 var(--amino-space-8)}:host button.lg{height:var(--amino-size-lg);line-height:var(--amino-size-lg);padding:var(--amino-space-12) var(--amino-space-24)}:host button.lg:not(.has-content).has-icon{padding:0 var(--amino-space-16)}:host button:not(.only-icon).has-icon{gap:var(--amino-space-8)}:host button.override-background{background-color:var(--background-color, var(--amino-gray-0));color:var(--color, var(--amino-gray-1200));outline:1px solid var(--background-color, var(--amino-gray-0))}:host button.override-background:disabled{opacity:0.8}:host button.override-background:not(:disabled):hover{opacity:0.9}:host button:not(.override-background){}:host button:not(.override-background).primary{background:var(--amino-blue-600);outline:1px solid var(--amino-blue-600);color:var(--amino-gray-0)}:host button:not(.override-background).primary:not([disabled]):hover{background-image:var(--amino-button-primary-hover)}:host button:not(.override-background).primary:not([disabled]):active{background:var(--amino-blue-700)}:host button:not(.override-background).primary:not([disabled]):focus{-webkit-box-shadow:var(--amino-focus-button);box-shadow:var(--amino-focus-button)}:host button:not(.override-background).primary[disabled]{background:var(--amino-blue-400)}:host button:not(.override-background).primary[disabled] .zonos--spinner-wrapper{background-color:var(--amino-blue-400)}:host button:not(.override-background).primary .zonos--spinner-wrapper{background-color:var(--amino-blue-600)}:host button:not(.override-background).success{background:var(--amino-green-600);outline:1px solid var(--amino-green-600);color:var(--amino-gray-0)}:host button:not(.override-background).success:not([disabled]):hover{background-image:var(--amino-button-success-hover)}:host button:not(.override-background).success:not([disabled]):active{background:var(--amino-green-700)}:host button:not(.override-background).success:not([disabled]):focus{-webkit-box-shadow:var(--amino-focus-button);box-shadow:var(--amino-focus-button)}:host button:not(.override-background).success[disabled]{background:var(--amino-green-400)}:host button:not(.override-background).success[disabled] .zonos--spinner-wrapper{background-color:var(--amino-green-400)}:host button:not(.override-background).danger{background:var(--amino-red-600);outline:1px solid var(--amino-red-600);color:var(--amino-gray-0)}:host button:not(.override-background).danger:not([disabled]):hover{background-image:var(--amino-button-danger-hover)}:host button:not(.override-background).danger:not([disabled]):active{background:var(--amino-red-700)}:host button:not(.override-background).danger:not([disabled]):focus{-webkit-box-shadow:var(--amino-focus-button);box-shadow:var(--amino-focus-button)}:host button:not(.override-background).danger[disabled]{background:var(--amino-red-400)}:host button:not(.override-background).danger[disabled] .zonos--spinner-wrapper{background-color:var(--amino-red-400)}:host button:not(.override-background).warning{background:var(--amino-orange-600);outline:1px solid var(--amino-orange-600);color:var(--amino-gray-0)}:host button:not(.override-background).warning:not([disabled]):hover{background-image:var(--amino-button-warning-hover)}:host button:not(.override-background).warning:not([disabled]):active{background:var(--amino-orange-700)}:host button:not(.override-background).warning:not([disabled]):focus{-webkit-box-shadow:var(--amino-focus-button);box-shadow:var(--amino-focus-button)}:host button:not(.override-background).warning[disabled]{background:var(--amino-orange-400)}:host button:not(.override-background).warning[disabled] .zonos--spinner-wrapper{background-color:var(--amino-orange-400)}:host button:not(.override-background).subtle{background:transparent;color:var(--color)}:host button:not(.override-background).subtle:not([disabled]):hover{background:var(--amino-gray-100)}:host button:not(.override-background).subtle:not([disabled]):active{background:var(--amino-gray-200)}:host button:not(.override-background).subtle:focus{-webkit-box-shadow:var(--amino-button-focus-ring);box-shadow:var(--amino-button-focus-ring)}:host button:not(.override-background).subtle[disabled] .content{opacity:0.6}:host button:not(.override-background).subtle[disabled] .zonos--spinner-wrapper{background-color:var(--amino-gray-0)}:host button:not(.override-background).outline{background:transparent;outline:1px solid var(--amino-gray-700)}:host button:not(.override-background).outline:not([disabled]):hover{background-color:var(--amino-gray-100)}:host button:not(.override-background).outline:not([disabled]):active{background:var(--amino-gray-200)}";var ZonosButton=function(){function o(o){var t=this;registerInstance(this,o);this.handleSlotChange=function(){t.hasContent=true};this.class="";this.color=undefined;this.backgroundColor=undefined;this.borderStyle=undefined;this.isDisabled=false;this.icon=null;this.iconRight=false;this.size="sm";this.variant="standard";this.noBackground=false;this.noPaddingLeft=false;this.noPaddingRight=false;this.loading=false;this.theme=undefined;this.hasIcon=!!this.icon;this.hasContent=false}o.prototype.iconChangeHandler=function(){this.hasIcon=!!this.icon};o.prototype.clickHandler=function(o){if(this.loading||this.isDisabled){o.preventDefault();o.stopPropagation()}};o.prototype.componentWillLoad=function(){this.iconChangeHandler()};o.prototype.render=function(){var o=this.loading||this.isDisabled;var t=this.color&&isColorVariable(this.color)?"var(--amino-".concat(this.color,")"):this.color;var n=this.backgroundColor||zonosStore.appearance.colorSecondary;var r=this.variant==="standard"?getButtonTheme(n):undefined;var a=getBorderRadius(this.borderStyle);return h(Host,{class:classes(["zonos--elements",this.class]),"data-theme":this.theme||r,disabled:o,style:{"--background-color":n,"--border-radius":a,"--color":t,"--font-family":zonosStoreFontFamily()}},h("button",{class:classes([this.hasIcon&&"has-icon",this.hasContent&&"has-content",this.noBackground&&"no-background",this.noPaddingLeft&&"no-padding-left",this.noPaddingRight&&"no-padding-right",this.iconRight&&"icon-right",this.variant,this.size,this.backgroundColor&&this.variant==="standard"&&"override-background"]),disabled:o},this.loading&&h("div",{class:"zonos--spinner-wrapper"},h("zonos-spinner",{size:16})),!this.loading&&!this.iconRight&&this.icon,h("slot",{onSlotchange:this.handleSlotChange}),!this.loading&&this.iconRight&&this.icon))};Object.defineProperty(o,"watchers",{get:function(){return{icon:["iconChangeHandler"]}},enumerable:false,configurable:true});return o}();ZonosButton.style=zonosButtonCss;var zonosSpinnerCss=":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{position:relative;overflow:hidden;width:var(--size);height:var(--size);display:-ms-inline-flexbox;display:inline-flex}:host svg{width:var(--size);height:var(--size);stroke:var(--amino-blue-600);-webkit-animation:rotate 2s linear infinite;animation:rotate 2s linear infinite}:host circle.track{stroke:var(--amino-gray-200)}:host.black{stroke:var(--amino-spinner-stroke-black)}:host.black circle.track{stroke:var(--amino-spinner-track-black)}:host.white{stroke:var(--amino-spinner-stroke-white)}:host.white circle.track{stroke:var(--amino-spinner-track-white)}:host.info{stroke:var(--amino-blue-600)}:host.info circle.track{stroke:var(--amino-blue-100)}:host.success{stroke:var(--amino-green-600)}:host.success circle.track{stroke:var(--amino-green-100)}:host.danger{stroke:var(--amino-red-600)}:host.danger circle.track{stroke:var(--amino-red-100)}:host.warning{stroke:var(--amino-orange-600)}:host.warning circle.track{stroke:var(--amino-orange-100)}@-webkit-keyframes rotate{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes rotate{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-webkit-keyframes dash{0%{stroke-dasharray:1, 150;stroke-dashoffset:0}50%{stroke-dasharray:90, 150;stroke-dashoffset:-35}100%{stroke-dasharray:90, 150;stroke-dashoffset:-124}}@keyframes dash{0%{stroke-dasharray:1, 150;stroke-dashoffset:0}50%{stroke-dasharray:90, 150;stroke-dashoffset:-35}100%{stroke-dasharray:90, 150;stroke-dashoffset:-124}}:host circle:not(.track){stroke-linecap:round;-webkit-animation:dash 1.5s ease-in-out infinite;animation:dash 1.5s ease-in-out infinite}";var ZonosSpinner=function(){function o(o){registerInstance(this,o);this.size=32;this.color=undefined}o.prototype.render=function(){if(!this.el.shadowRoot){return null}return h(Host,{class:classes(["zonos--elements",this.color]),style:{"--size":"".concat(this.size,"px")}},h("svg",{viewBox:"0 0 50 50"},h("circle",{class:"track",cx:"25",cy:"25",fill:"none",id:"loading-spinner-circle",r:"20","stroke-width":"5"}),h("circle",{cx:"25",cy:"25",fill:"none",id:"loading-spinner-circle",r:"20","stroke-width":"5"})))};Object.defineProperty(o.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return o}();ZonosSpinner.style=zonosSpinnerCss;export{ZonosButton as zonos_button,ZonosSpinner as zonos_spinner};
|
|
1
|
+
import{r as registerInstance,h,H as Host,d as getElement}from"./index-36ff6342.js";import{z as zonosStore,e as zonosStoreFontFamily}from"./zonosStore-34f07ee8.js";import{c as classes}from"./classes-0d95c529.js";import{g as getBorderRadius}from"./getBorderRadius-77e97943.js";import{i as isColorVariable}from"./isColorVariable-91c33804.js";import{i as isDarkColor}from"./isDarkColor-69090b29.js";var getButtonTheme=function(o){var t=o||zonosStore.appearance.colorSecondary;var n=t&&isColorVariable(t)?"var(--amino-".concat(t,")"):t;var r=n&&isDarkColor(n)?"DARK":"LIGHT";return r};var zonosButtonCss=":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 .zonos--spinner-wrapper{position:absolute;top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;background-color:var(--amino-surface-color);-ms-flex-pack:center;justify-content:center;border-radius:var(--amino-radius-10);gap:var(--amino-space-8)}:host button{width:100%;position:relative;font-size:14px;-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background-color:var(--amino-surface-color);border:none;outline:1px solid var(--amino-surface-color);border-radius:var(--border-radius, var(--amino-radius-10));-webkit-transition:var(--amino-transition);transition:var(--amino-transition);font-weight:500;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font-family:var(--font-family, Inter), Inter;letter-spacing:normal;cursor:pointer;white-space:nowrap;padding:var(--amino-space-8) var(--amino-space-24);color:var(--color, var(--amino-gray-1200));}:host button.sm.no-background,:host button.md.no-background,:host button.lg.no-background{background:none;outline:none}:host button.sm.no-padding-left,:host button.md.no-padding-left,:host button.lg.no-padding-left{padding-left:0}:host button.sm.no-padding-right,:host button.md.no-padding-right,:host button.lg.no-padding-right{padding-right:0}:host button[disabled]{cursor:not-allowed;background-color:var(--amino-gray-200)}:host button[disabled] .zonos--spinner-wrapper{background-color:var(--amino-gray-200)}:host button:active{-webkit-transform:scale(0.99);transform:scale(0.99)}:host button.sm{height:var(--amino-size-sm);line-height:var(--amino-size-sm);padding:var(--amino-space-4) var(--amino-space-8)}:host button.sm:not(.has-content).has-icon{padding:0 var(--amino-space-4)}:host button.md{height:var(--amino-size-md);line-height:var(--amino-size-md);padding:var(--amino-space-8) var(--amino-space-16)}:host button.md:not(.has-content).has-icon{padding:0 var(--amino-space-8)}:host button.lg{height:var(--amino-size-lg);line-height:var(--amino-size-lg);padding:var(--amino-space-12) var(--amino-space-24)}:host button.lg:not(.has-content).has-icon{padding:0 var(--amino-space-16)}:host button:not(.only-icon).has-icon{gap:var(--amino-space-8)}:host button.override-background{background-color:var(--background-color, var(--amino-gray-0));color:var(--color, var(--amino-gray-1200));outline:1px solid var(--background-color, var(--amino-gray-0))}:host button.override-background:disabled{opacity:0.8}:host button.override-background:not(:disabled):hover{opacity:0.9}:host button:not(.override-background){}:host button:not(.override-background).primary{background:var(--amino-blue-600);outline:1px solid var(--amino-blue-600);color:var(--amino-gray-0)}:host button:not(.override-background).primary:not([disabled]):hover{background-image:var(--amino-button-primary-hover)}:host button:not(.override-background).primary:not([disabled]):active{background:var(--amino-blue-700)}:host button:not(.override-background).primary:not([disabled]):focus{-webkit-box-shadow:var(--amino-focus-button);box-shadow:var(--amino-focus-button)}:host button:not(.override-background).primary[disabled]{background:var(--amino-blue-400)}:host button:not(.override-background).primary[disabled] .zonos--spinner-wrapper{background-color:var(--amino-blue-400)}:host button:not(.override-background).primary .zonos--spinner-wrapper{background-color:var(--amino-blue-600)}:host button:not(.override-background).success{background:var(--amino-green-600);outline:1px solid var(--amino-green-600);color:var(--amino-gray-0)}:host button:not(.override-background).success:not([disabled]):hover{background-image:var(--amino-button-success-hover)}:host button:not(.override-background).success:not([disabled]):active{background:var(--amino-green-700)}:host button:not(.override-background).success:not([disabled]):focus{-webkit-box-shadow:var(--amino-focus-button);box-shadow:var(--amino-focus-button)}:host button:not(.override-background).success[disabled]{background:var(--amino-green-400)}:host button:not(.override-background).success[disabled] .zonos--spinner-wrapper{background-color:var(--amino-green-400)}:host button:not(.override-background).danger{background:var(--amino-red-600);outline:1px solid var(--amino-red-600);color:var(--amino-gray-0)}:host button:not(.override-background).danger:not([disabled]):hover{background-image:var(--amino-button-danger-hover)}:host button:not(.override-background).danger:not([disabled]):active{background:var(--amino-red-700)}:host button:not(.override-background).danger:not([disabled]):focus{-webkit-box-shadow:var(--amino-focus-button);box-shadow:var(--amino-focus-button)}:host button:not(.override-background).danger[disabled]{background:var(--amino-red-400)}:host button:not(.override-background).danger[disabled] .zonos--spinner-wrapper{background-color:var(--amino-red-400)}:host button:not(.override-background).warning{background:var(--amino-orange-600);outline:1px solid var(--amino-orange-600);color:var(--amino-gray-0)}:host button:not(.override-background).warning:not([disabled]):hover{background-image:var(--amino-button-warning-hover)}:host button:not(.override-background).warning:not([disabled]):active{background:var(--amino-orange-700)}:host button:not(.override-background).warning:not([disabled]):focus{-webkit-box-shadow:var(--amino-focus-button);box-shadow:var(--amino-focus-button)}:host button:not(.override-background).warning[disabled]{background:var(--amino-orange-400)}:host button:not(.override-background).warning[disabled] .zonos--spinner-wrapper{background-color:var(--amino-orange-400)}:host button:not(.override-background).subtle{background:transparent;color:var(--color)}:host button:not(.override-background).subtle:not([disabled]):hover{background:var(--amino-gray-100)}:host button:not(.override-background).subtle:not([disabled]):active{background:var(--amino-gray-200)}:host button:not(.override-background).subtle:focus{-webkit-box-shadow:var(--amino-button-focus-ring);box-shadow:var(--amino-button-focus-ring)}:host button:not(.override-background).subtle[disabled] .content{opacity:0.6}:host button:not(.override-background).subtle[disabled] .zonos--spinner-wrapper{background-color:var(--amino-gray-0)}:host button:not(.override-background).outline{background:transparent;outline:1px solid var(--amino-gray-700)}:host button:not(.override-background).outline:not([disabled]):hover{background-color:var(--amino-gray-100)}:host button:not(.override-background).outline:not([disabled]):active{background:var(--amino-gray-200)}";var ZonosButton=function(){function o(o){var t=this;registerInstance(this,o);this.handleSlotChange=function(){t.hasContent=true};this.class="";this.color=undefined;this.backgroundColor=undefined;this.borderStyle=undefined;this.isDisabled=false;this.icon=null;this.iconRight=false;this.size="sm";this.variant="standard";this.noBackground=false;this.noPaddingLeft=false;this.noPaddingRight=false;this.loading=false;this.theme=undefined;this.hasIcon=!!this.icon;this.hasContent=false}o.prototype.iconChangeHandler=function(){this.hasIcon=!!this.icon};o.prototype.clickHandler=function(o){if(this.loading||this.isDisabled){o.preventDefault();o.stopPropagation()}};o.prototype.componentWillLoad=function(){this.iconChangeHandler()};o.prototype.render=function(){var o=this.loading||this.isDisabled;var t=this.color&&isColorVariable(this.color)?"var(--amino-".concat(this.color,")"):this.color;var n=this.backgroundColor||zonosStore.appearance.colorSecondary;var r=this.variant==="standard"?getButtonTheme(n):undefined;var a=getBorderRadius(this.borderStyle);return h(Host,{class:classes(["zonos--elements",this.class]),"data-theme":this.theme||r,disabled:o,style:{"--background-color":n,"--border-radius":a,"--color":t,"--font-family":zonosStoreFontFamily()}},h("button",{class:classes([this.hasIcon&&"has-icon",this.hasContent&&"has-content",this.noBackground&&"no-background",this.noPaddingLeft&&"no-padding-left",this.noPaddingRight&&"no-padding-right",this.iconRight&&"icon-right",this.variant,this.size,this.backgroundColor&&this.variant==="standard"&&"override-background"]),disabled:o},this.loading&&h("div",{class:"zonos--spinner-wrapper"},h("zonos-spinner",{size:16})),!this.loading&&!this.iconRight&&this.icon,h("slot",{onSlotchange:this.handleSlotChange}),!this.loading&&this.iconRight&&this.icon))};Object.defineProperty(o,"watchers",{get:function(){return{icon:["iconChangeHandler"]}},enumerable:false,configurable:true});return o}();ZonosButton.style=zonosButtonCss;var zonosSpinnerCss=":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{position:relative;overflow:hidden;width:var(--size);height:var(--size);display:-ms-inline-flexbox;display:inline-flex}:host svg{width:var(--size);height:var(--size);stroke:var(--amino-blue-600);-webkit-animation:rotate 2s linear infinite;animation:rotate 2s linear infinite}:host circle.track{stroke:var(--amino-gray-200)}:host.black{stroke:var(--amino-spinner-stroke-black)}:host.black circle.track{stroke:var(--amino-spinner-track-black)}:host.white{stroke:var(--amino-spinner-stroke-white)}:host.white circle.track{stroke:var(--amino-spinner-track-white)}:host.info{stroke:var(--amino-blue-600)}:host.info circle.track{stroke:var(--amino-blue-100)}:host.success{stroke:var(--amino-green-600)}:host.success circle.track{stroke:var(--amino-green-100)}:host.danger{stroke:var(--amino-red-600)}:host.danger circle.track{stroke:var(--amino-red-100)}:host.warning{stroke:var(--amino-orange-600)}:host.warning circle.track{stroke:var(--amino-orange-100)}@-webkit-keyframes rotate{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes rotate{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-webkit-keyframes dash{0%{stroke-dasharray:1, 150;stroke-dashoffset:0}50%{stroke-dasharray:90, 150;stroke-dashoffset:-35}100%{stroke-dasharray:90, 150;stroke-dashoffset:-124}}@keyframes dash{0%{stroke-dasharray:1, 150;stroke-dashoffset:0}50%{stroke-dasharray:90, 150;stroke-dashoffset:-35}100%{stroke-dasharray:90, 150;stroke-dashoffset:-124}}:host circle:not(.track){stroke-linecap:round;-webkit-animation:dash 1.5s ease-in-out infinite;animation:dash 1.5s ease-in-out infinite}";var ZonosSpinner=function(){function o(o){registerInstance(this,o);this.size=32;this.color=undefined}o.prototype.render=function(){if(!this.el.shadowRoot){return null}return h(Host,{class:classes(["zonos--elements",this.color]),style:{"--size":"".concat(this.size,"px")}},h("svg",{viewBox:"0 0 50 50"},h("circle",{class:"track",cx:"25",cy:"25",fill:"none",id:"loading-spinner-circle",r:"20","stroke-width":"5"}),h("circle",{cx:"25",cy:"25",fill:"none",id:"loading-spinner-circle",r:"20","stroke-width":"5"})))};Object.defineProperty(o.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return o}();ZonosSpinner.style=zonosSpinnerCss;export{ZonosButton as zonos_button,ZonosSpinner as zonos_spinner};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as registerInstance,h,H as Host}from"./index-36ff6342.js";import{e as zonosStoreFontFamily}from"./zonosStore-
|
|
1
|
+
import{r as registerInstance,h,H as Host}from"./index-36ff6342.js";import{e as zonosStoreFontFamily}from"./zonosStore-34f07ee8.js";import{c as classes}from"./classes-0d95c529.js";var zonosCardCss=":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 .styled-card{border:var(--amino-border);border-radius:var(--amino-radius-6);padding:var(--spacing, var(--amino-space-24));text-align:left}:host .styled-card hr{margin-left:calc(var(--spacing, var(--amino-space-24)) * -1);margin-right:calc(var(--spacing, var(--amino-space-24)) * -1)}:host .styled-card .card-header{margin:calc(var(--spacing, var(--amino-space-24)) * -1);padding:var(--spacing, var(--amino-space-24));display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;margin-bottom:var(--spacing, var(--amino-space-24));border-bottom:var(--amino-border);height:65px;line-height:65px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host .styled-card .card-header h5{margin-bottom:0;-ms-flex:1;flex:1}:host .styled-card .card-footer{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;margin:calc(var(--spacing, var(--amino-space-24)) * -1);padding:var(--spacing, var(--amino-space-24));border-top:var(--amino-border);background:var(--amino-surface-color-secondary);margin-top:var(--spacing, var(--amino-space-24));border-bottom-left-radius:var(--amino-radius-8);border-bottom-right-radius:var(--amino-radius-8);height:var(--footerHeight)}";var ZonosCard=function(){function s(s){registerInstance(this,s);this.actions=undefined;this.class=undefined;this.footerActions=undefined;this.footerContent=undefined;this.footerHeight=undefined;this.label=undefined;this.spacing="24px"}s.prototype.render=function(){return h(Host,{style:{"--font-family":zonosStoreFontFamily()}},h("div",{class:classes(["styled-card",this.class]),style:{padding:this.spacing}},this.label&&h("header",{class:"card-header",style:{padding:this.spacing}},h("zonos-text",{type:"subheader"},this.label),h("h-stack",{spacing:8},this.actions)),h("slot",null),(this.footerActions||this.footerContent)&&h("footer",{class:"card-footer",style:{height:this.footerHeight?"".concat(this.footerHeight,"px"):"auto",padding:this.spacing}},h("div",null,this.footerContent),h("h-stack",{spacing:8},this.footerActions))))};return s}();ZonosCard.style=zonosCardCss;var zonosVStackCss=":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 .vstack{display:grid;grid-auto-columns:minmax(0, 1fr);grid-row-gap:var(--spacing, 24px);grid-auto-flow:row}";var VStack=function(){function s(s){registerInstance(this,s);this.spacing=24;this.class=""}s.prototype.render=function(){return h(Host,{style:{"--font-family":zonosStoreFontFamily()}},h("div",{class:classes(["vstack",this.class]),style:{"grid-row-gap":"".concat(this.spacing,"px")}},h("slot",null)))};return s}();VStack.style=zonosVStackCss;export{ZonosCard as zonos_card,VStack as zonos_v_stack};
|
|
@@ -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 r(o){try{c(n.next(o))}catch(o){i(o)}}function a(o){try{c(n["throw"](o))}catch(o){i(o)}}function c(o){o.done?s(o.value):e(o.value).then(r,a)}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,r;return r={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function a(o){return function(t){return c([o,t])}}function c(a){if(n)throw new TypeError("Generator is already executing.");while(r&&(r=0,a[0]&&(s=0)),s)try{if(n=1,e&&(i=a[0]&2?e["return"]:a[0]?e["throw"]||((i=e["return"])&&i.call(e),0):e.next)&&!(i=i.call(e,a[1])).done)return i;if(e=0,i)a=[a[0]&2,i.value];switch(a[0]){case 0:case 1:i=a;break;case 4:s.label++;return{value:a[1],done:false};case 5:s.label++;e=a[1];a=[0];continue;case 7:a=s.ops.pop();s.trys.pop();continue;default:if(!(i=s.trys,i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){s=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(a[0]===6&&s.label<i[1]){s.label=i[1];i=a;break}if(i&&s.label<i[2]){s.label=i[2];s.ops.push(a);break}if(i[2])s.ops.pop();s.trys.pop();continue}a=t.call(o,s)}catch(o){a=[6,o];e=0}finally{n=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[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-36ff6342.js";import{c as cartStore,s as stripeStore,p as stripeStoreRetrievePayment,o as stripeStoreReset,i as cartStoreUpdateSelectedShippingOption,b as cartStoreGetShippingTransitInfo}from"./cart-b439be00.js";import{t as translate,h as handleFetch,b as logError}from"./localization-a51ccbc2.js";import{g as getBorderRadius}from"./getBorderRadius-178a0a05.js";import{s as submitGtag,i as isCheckoutMobile}from"./submitGtag-521826a2.js";import{e as zonosStoreFontFamily,z as zonosStore}from"./zonosStore-61e74f58.js";import{c as classes}from"./classes-0d95c529.js";import"./isDarkColor-416d6047.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 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,{class:"zonos--cart-items zonos--elements"},h("table",{class:"zonos--cart-table"},h("tbody",null,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=zonosCartItemsCss;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 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=zonosCartSubtotalCss;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 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,r,a,c;return __generator(this,(function(h){switch(h.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=h.sent(),i=e.errors,r=e.json;if(i.length||!(r===null||r===void 0?void 0:r.id)){return[2,null]}if(window.Zonos.isBigCommerce){a=r===null||r===void 0?void 0:r.id;c=(t=(o=r===null||r===void 0?void 0:r.metadata)===null||o===void 0?void 0:o.find((function(o){return(o===null||o===void 0?void 0:o.key)==="storeHash"})))===null||t===void 0?void 0:t.value;if(!a||!c){return[2,logError("Unable to trigger BigCommerce /success: Missing orderId or storeHash")]}void handleFetch("".concat(s,"/api/bigcommerce/success?orderId=").concat(a,"&storeHash=").concat(c))}return[2,r]}}))}))};this.getPullOrder=function(o){if(o===void 0){o=0}return __awaiter(t,void 0,void 0,(function(){var t;return __generator(this,(function(s){switch(s.label){case 0:return[4,this.pullOrder()];case 1:t=s.sent();if(!t)return[3,2];this.order=t;return[3,5];case 2:if(!(!t&&o<5))return[3,5];return[4,new Promise((function(o){return setTimeout(o,1e3)}))];case 3:s.sent();return[4,this.getPullOrder(o+1)];case 4:s.sent();s.label=5;case 5: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"){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,{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=zonosCheckoutFinishCss;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 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=zonosCheckoutPaymentCss;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 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,{class:"zonos--elements zonos--collapse",style:{"--font-family":zonosStoreFontFamily(),height:this.getElementHeight()}},h("div",null,h("iframe",{class:"height-change-listener",tabindex:"-1",title:"collapse-height-change-listener"}),h("slot",null)))};Object.defineProperty(o.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return o}();ZonosCollapse.style=zonosCollapseCss;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 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=zonosCustomerInfoCss;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:1002;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:1001;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:1001;opacity:0.65}:host(.open) .zonos--dialog-layout{opacity:1;z-index:1002;-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 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,{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",{class:"zonos--backdrop"}),h("div",{"aria-hidden":"true",class:"zonos--dialog-layout",onClick:this.clickOutsideDialogHandler},h("div",{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",{class:classes(["zonos--body",this.noBodyPadding&&"zonos--no-body-padding"])},h("slot",null)),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=zonosDialogCss;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 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,{class:classes(["zonos--elements zonos--logo",this.class]),style:{"--filter-color":o,"--font-family":zonosStoreFontFamily(),"--width":this.width}},h("img",{alt:"Zonos Logo",src:getAssetPath("./assets/ZonosLogo.png")}))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return o}();ZonosLogo.style=zonosLogoCss;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 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=zonosReviewCss;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 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,r=n.minTransit;var a=e?"".concat(translate("Expected delivery")," ").concat(e):"";var c=r&&i?"(".concat(r,"-").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:a,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=zonosShippingCss;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 r(o){try{c(n.next(o))}catch(o){i(o)}}function a(o){try{c(n["throw"](o))}catch(o){i(o)}}function c(o){o.done?s(o.value):e(o.value).then(r,a)}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,r;return r={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function a(o){return function(t){return c([o,t])}}function c(a){if(n)throw new TypeError("Generator is already executing.");while(r&&(r=0,a[0]&&(s=0)),s)try{if(n=1,e&&(i=a[0]&2?e["return"]:a[0]?e["throw"]||((i=e["return"])&&i.call(e),0):e.next)&&!(i=i.call(e,a[1])).done)return i;if(e=0,i)a=[a[0]&2,i.value];switch(a[0]){case 0:case 1:i=a;break;case 4:s.label++;return{value:a[1],done:false};case 5:s.label++;e=a[1];a=[0];continue;case 7:a=s.ops.pop();s.trys.pop();continue;default:if(!(i=s.trys,i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){s=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(a[0]===6&&s.label<i[1]){s.label=i[1];i=a;break}if(i&&s.label<i[2]){s.label=i[2];s.ops.push(a);break}if(i[2])s.ops.pop();s.trys.pop();continue}a=t.call(o,s)}catch(o){a=[6,o];e=0}finally{n=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[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-36ff6342.js";import{c as cartStore,s as stripeStore,p as stripeStoreRetrievePayment,o as stripeStoreReset,i as cartStoreUpdateSelectedShippingOption,b as cartStoreGetShippingTransitInfo}from"./cart-d81b92ea.js";import{t as translate,h as handleFetch}from"./localization-0c5b29fd.js";import{z as zonosStore,e as zonosStoreFontFamily}from"./zonosStore-34f07ee8.js";import{g as getBorderRadius}from"./getBorderRadius-77e97943.js";import{s as submitGtag,i as isCheckoutMobile}from"./submitGtag-8a0fbd41.js";import{c as classes}from"./classes-0d95c529.js";import"./isDarkColor-69090b29.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 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,{class:"zonos--cart-items zonos--elements"},h("table",{class:"zonos--cart-table"},h("tbody",null,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=zonosCartItemsCss;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 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=zonosCartSubtotalCss;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 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,r;return __generator(this,(function(a){switch(a.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=a.sent(),i=e.errors,r=e.json;if(i.length||!(r===null||r===void 0?void 0:r.id)){return[2,null]}return[4,(t=(o=zonosStore.checkoutSettings).onOrderSuccess)===null||t===void 0?void 0:t.call(o,r)];case 2:a.sent();return[2,r]}}))}))};this.getPullOrder=function(o){if(o===void 0){o=0}return __awaiter(t,void 0,void 0,(function(){var t;return __generator(this,(function(s){switch(s.label){case 0:return[4,this.pullOrder()];case 1:t=s.sent();if(!t)return[3,2];this.order=t;return[3,5];case 2:if(!(!t&&o<5))return[3,5];return[4,new Promise((function(o){return setTimeout(o,1e3)}))];case 3:s.sent();return[4,this.getPullOrder(o+1)];case 4:s.sent();s.label=5;case 5: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"){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,{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=zonosCheckoutFinishCss;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 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=zonosCheckoutPaymentCss;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 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,{class:"zonos--elements zonos--collapse",style:{"--font-family":zonosStoreFontFamily(),height:this.getElementHeight()}},h("div",null,h("iframe",{class:"height-change-listener",tabindex:"-1",title:"collapse-height-change-listener"}),h("slot",null)))};Object.defineProperty(o.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return o}();ZonosCollapse.style=zonosCollapseCss;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 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=zonosCustomerInfoCss;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:1002;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:1001;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:1001;opacity:0.65}:host(.open) .zonos--dialog-layout{opacity:1;z-index:1002;-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 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,{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",{class:"zonos--backdrop"}),h("div",{"aria-hidden":"true",class:"zonos--dialog-layout",onClick:this.clickOutsideDialogHandler},h("div",{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",{class:classes(["zonos--body",this.noBodyPadding&&"zonos--no-body-padding"])},h("slot",null)),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=zonosDialogCss;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 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,{class:classes(["zonos--elements zonos--logo",this.class]),style:{"--filter-color":o,"--font-family":zonosStoreFontFamily(),"--width":this.width}},h("img",{alt:"Zonos Logo",src:getAssetPath("./assets/ZonosLogo.png")}))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return o}();ZonosLogo.style=zonosLogoCss;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 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=zonosReviewCss;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 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,r=n.minTransit;var a=e?"".concat(translate("Expected delivery")," ").concat(e):"";var c=r&&i?"(".concat(r,"-").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:a,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=zonosShippingCss;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-36ff6342.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-b439be00.js";import{a as localizationStore,l as log,t as translate}from"./localization-a51ccbc2.js";import{z as zonosStore,m as mergeConfig}from"./zonosStore-61e74f58.js";import{s as submitGtag,i as isCheckoutMobile}from"./submitGtag-521826a2.js";import{c as classes}from"./classes-0d95c529.js";import{g as getBorderRadius}from"./getBorderRadius-178a0a05.js";import{i as isDarkColor}from"./isDarkColor-416d6047.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 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.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();setInterval((function(){e.attachCheckout()}),50)}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=zonosCheckoutCss;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-36ff6342.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-d81b92ea.js";import{a as localizationStore,l as log,t as translate}from"./localization-0c5b29fd.js";import{z as zonosStore,m as mergeConfig}from"./zonosStore-34f07ee8.js";import{s as submitGtag,i as isCheckoutMobile}from"./submitGtag-8a0fbd41.js";import{c as classes}from"./classes-0d95c529.js";import{g as getBorderRadius}from"./getBorderRadius-77e97943.js";import{i as isDarkColor}from"./isDarkColor-69090b29.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 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.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();setInterval((function(){e.attachCheckout()}),50)}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=zonosCheckoutCss;export{ZonosCheckout as zonos_checkout};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(t,o,n,e){function
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(t,o,n,e){function r(t){return t instanceof n?t:new n((function(o){o(t)}))}return new(n||(n=Promise))((function(n,i){function s(t){try{u(e.next(t))}catch(t){i(t)}}function a(t){try{u(e["throw"](t))}catch(t){i(t)}}function u(t){t.done?n(t.value):r(t.value).then(s,a)}u((e=e.apply(t,o||[])).next())}))};var __generator=this&&this.__generator||function(t,o){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},e,r,i,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(t){return function(o){return u([t,o])}}function u(a){if(e)throw new TypeError("Generator is already executing.");while(s&&(s=0,a[0]&&(n=0)),n)try{if(e=1,r&&(i=a[0]&2?r["return"]:a[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;if(r=0,i)a=[a[0]&2,i.value];switch(a[0]){case 0:case 1:i=a;break;case 4:n.label++;return{value:a[1],done:false};case 5:n.label++;r=a[1];a=[0];continue;case 7:a=n.ops.pop();n.trys.pop();continue;default:if(!(i=n.trys,i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){n.label=a[1];break}if(a[0]===6&&n.label<i[1]){n.label=i[1];i=a;break}if(i&&n.label<i[2]){n.label=i[2];n.ops.push(a);break}if(i[2])n.ops.pop();n.trys.pop();continue}a=o.call(t,n)}catch(t){a=[6,t];r=0}finally{e=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host}from"./index-36ff6342.js";import{s as stripeStore}from"./cart-d81b92ea.js";import{h as handleFetch,b as logError,i as isValidSelector,l as log,c as initLocalizationStore,d as localizationStoreUpdateSelectedCountryCode}from"./localization-0c5b29fd.js";import{z as zonosStore,d as zonosStoreInitSetting,e as zonosStoreFontFamily}from"./zonosStore-34f07ee8.js";import"./isDarkColor-69090b29.js";import"./getBorderRadius-77e97943.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 ZonosController=function(){function t(t){registerInstance(this,t);this.stripeInitEvent=createEvent(this,"stripeInitEvent",7);this.disablePlaceOrderButtons=function(t){var o=t.disable;var n=zonosStore.checkoutSettings.placeOrderButtonSelector;if(!n){return}var e=function(t){var o=t.target;if(o.getAttribute("disabled")){t.preventDefault();t.stopPropagation()}};var r=document.querySelectorAll(n);r.forEach((function(t){if(o){t.setAttribute("disabled","true");t.addEventListener("click",e)}else{t.removeAttribute("disabled");t.removeEventListener("click",e)}}));if(o){setTimeout((function(){r.forEach((function(t){t.removeAttribute("disabled");t.removeEventListener("click",e)}))}),5e3)}};this.config=undefined;this.zonosApiKey=undefined}t.prototype.initCheckoutElement=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){if(!t){log("Stripe is not loaded yet - cannot init checkout element","warn");return[2]}stripeStore.stripe=t;void initCheckout(zonosStore.checkoutSettings);log("init checkout element");this.disablePlaceOrderButtons({disable:false});return[2]}))}))};t.prototype.initZonosNotification=function(){var t=document.querySelector("zonos-notification");if(t){return}var o=document.createElement("zonos-notification");document.body.appendChild(o)};t.prototype.setupGoogleFont=function(t){return __awaiter(this,void 0,void 0,(function(){var o,n,e,r,i,s,a,u;return __generator(this,(function(c){switch(c.label){case 0:e=t||zonosStoreFontFamily();if(e==="Inter"){if(!t){return[2]}log("[FONT] Just applied Inter , but no need to inject since we already inject Inter on start","warn");zonosStore.appearance=Object.assign(Object.assign({},zonosStore.appearance),{fontFamily:t})}r="https://v1.route.js.zonos.com";return[4,handleFetch("".concat(r,"/api/zonos-elements/get-font-detail?family=").concat(e))];case 1:i=c.sent(),s=i.errors,a=i.json;if(s.length>0||!a){log("Failed to load font ".concat(e),"warn");return[2]}u=a.fontUrl;(n=(o=window.Zonos).injectSupportGoogleFont)===null||n===void 0?void 0:n.call(o,u);if(!t){return[2]}log("[FONT] ".concat(t," font override applied"));zonosStore.appearance=Object.assign(Object.assign({},zonosStore.appearance),{fontFamily:t});return[2]}}))}))};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(o){zonosStore.zonosApiKey=this.zonosApiKey;(function(){return __awaiter(t,void 0,void 0,(function(){var t,o,n,e,r,i;return __generator(this,(function(s){switch(s.label){case 0:return[4,getZonosSettings()];case 1:n=s.sent(),e=n.errors,r=n.json;if(((t=e[0])===null||t===void 0?void 0:t.type.toString())==="403"){log("Failed to load zonos settings. This domain may not have access","warn");return[2]}this.disablePlaceOrderButtons({disable:true});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,{class:"zonos--elements"})};return t}();ZonosController.style=zonosControllerCss;export{ZonosController as zonos_controller};
|