@zonos/elements 1.3.51 → 1.3.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/CheckoutConfig-65376e00.js +40 -0
- package/dist/cjs/{cart-546d1602.js → cart-61a8983d.js} +238 -375
- package/dist/cjs/{createCustomEvent-9b91480b.js → createCustomEvent-228027b5.js} +3 -2
- package/dist/cjs/handleFetch-842c95b0.js +322 -0
- package/dist/cjs/index.cjs.js +75 -35
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{paypal-83f49f9a.js → paypal-f1eb6621.js} +16 -16
- package/dist/cjs/zonos-address_8.cjs.entry.js +4 -4
- package/dist/cjs/{zonos-cart-items_12.cjs.entry.js → zonos-badge_13.cjs.entry.js} +41 -9
- package/dist/cjs/zonos-checkout.cjs.entry.js +75 -174
- package/dist/cjs/zonos-controller.cjs.entry.js +29 -27
- package/dist/cjs/zonos-country-flag.cjs.entry.js +2 -2
- package/dist/cjs/zonos-country-select_4.cjs.entry.js +2 -2
- 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 +11 -11
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +2 -2
- package/dist/cjs/zonos-notification_3.cjs.entry.js +9 -9
- package/dist/cjs/zonos-tooltip.cjs.entry.js +27 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.js +5 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +44 -20
- package/dist/collection/components/main/zonos-controller.js +2 -2
- package/dist/collection/components/store/checkout/cart.js +14 -2
- package/dist/collection/components/store/checkout/stripe.js +9 -4
- package/dist/collection/components/store/translationStore/strings.arabic.js +3 -3
- package/dist/collection/components/store/translationStore/strings.base.js +3 -3
- package/dist/collection/components/store/translationStore/strings.chinese.js +3 -3
- package/dist/collection/components/store/translationStore/strings.danish.js +3 -3
- package/dist/collection/components/store/translationStore/strings.dutch.js +3 -3
- package/dist/collection/components/store/translationStore/strings.french.js +3 -3
- package/dist/collection/components/store/translationStore/strings.german.js +3 -3
- package/dist/collection/components/store/translationStore/strings.hebrew.js +3 -3
- package/dist/collection/components/store/translationStore/strings.indonesian.js +3 -3
- package/dist/collection/components/store/translationStore/strings.italian.js +3 -3
- package/dist/collection/components/store/translationStore/strings.japanese.js +3 -3
- package/dist/collection/components/store/translationStore/strings.korean.js +3 -3
- package/dist/collection/components/store/translationStore/strings.norwegian.js +3 -3
- package/dist/collection/components/store/translationStore/strings.polish.js +3 -3
- package/dist/collection/components/store/translationStore/strings.portuguese.js +3 -3
- package/dist/collection/components/store/translationStore/strings.russian.js +3 -3
- package/dist/collection/components/store/translationStore/strings.spanish.js +3 -3
- package/dist/collection/components/store/translationStore/strings.swedish.js +3 -3
- package/dist/collection/components/store/translationStore/strings.turkish.js +3 -3
- package/dist/collection/components/store/translationStore/strings.vietnamese.js +3 -3
- package/dist/collection/components/utils/api/buildCartItemsByTempCart.js +14 -14
- package/dist/collection/components/utils/api/calculateLandedCostNormalized.js +28 -0
- package/dist/collection/components/utils/api/cartCalculateLandedCost.js +19 -0
- package/dist/collection/components/utils/api/prepCalculateLandedCost.js +65 -0
- package/dist/collection/components/utils/checkout/initCheckout.js +4 -2
- package/dist/collection/environment.js +1 -1
- package/dist/collection/scripts/_getNextFallbackUrl.js +1 -0
- package/dist/collection/scripts/_getTempCartById.js +14 -0
- package/dist/collection/scripts/_zonosBase.js +39 -10
- package/dist/collection/scripts/cart/_getCartIdFromParam.js +9 -0
- package/dist/collection/scripts/cart/_setupCartData.js +18 -0
- package/dist/collection/types/checkout/CheckoutConfig.js +2 -1
- package/dist/collection/types/generated/graphql.customer.types.js +12 -0
- package/dist/collection/utils/formattedCloudflareApiUrl.js +8 -2
- package/dist/collection/utils/generateCloudflareDeployUrl.js +3 -0
- package/dist/esm/CheckoutConfig-57350b28.js +36 -0
- package/dist/esm/{cart-51529af2.js → cart-45d2861f.js} +193 -327
- package/dist/esm/{createCustomEvent-b8bbdf5e.js → createCustomEvent-3fcc948a.js} +2 -1
- package/dist/esm/handleFetch-37cea185.js +315 -0
- package/dist/esm/index.js +56 -17
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{paypal-905325d0.js → paypal-ee310945.js} +2 -2
- package/dist/esm/zonos-address_8.entry.js +2 -2
- package/dist/esm/{zonos-cart-items_12.entry.js → zonos-badge_13.entry.js} +40 -9
- package/dist/esm/zonos-checkout.entry.js +61 -160
- package/dist/esm/zonos-controller.entry.js +8 -6
- package/dist/esm/zonos-country-flag.entry.js +2 -2
- package/dist/esm/zonos-country-select_4.entry.js +2 -2
- 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 +2 -2
- package/dist/esm/zonos-language-select_2.entry.js +2 -2
- package/dist/esm/zonos-notification_3.entry.js +3 -3
- package/dist/esm/zonos-tooltip.entry.js +23 -0
- package/dist/esm-es5/CheckoutConfig-57350b28.js +1 -0
- package/dist/esm-es5/cart-45d2861f.js +1 -0
- package/dist/esm-es5/{createCustomEvent-b8bbdf5e.js → createCustomEvent-3fcc948a.js} +1 -1
- package/dist/esm-es5/handleFetch-37cea185.js +1 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/{paypal-905325d0.js → paypal-ee310945.js} +1 -1
- package/dist/esm-es5/zonos-address_8.entry.js +1 -1
- package/dist/esm-es5/zonos-badge_13.entry.js +1 -0
- 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.entry.js +1 -1
- package/dist/esm-es5/zonos-country-select_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-language-select_2.entry.js +1 -1
- package/dist/esm-es5/zonos-notification_3.entry.js +1 -1
- package/dist/esm-es5/zonos-tooltip.entry.js +1 -0
- package/dist/scripts/index.d.ts +74 -87
- package/dist/scripts/index.js +1 -1
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/types/components/checkout/zonos-checkout/zonos-checkout.d.ts +0 -2
- package/dist/types/components/store/checkout/cart.d.ts +13 -3
- package/dist/types/components/store/checkout/stripe.d.ts +3 -1
- package/dist/types/components/store/translationStore/strings.arabic.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.base.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.chinese.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.danish.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.dutch.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.french.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.german.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.hebrew.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.indonesian.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.italian.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.japanese.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.korean.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.norwegian.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.polish.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.portuguese.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.russian.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.spanish.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.swedish.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.turkish.d.ts +3 -3
- package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +3 -3
- package/dist/types/components/store/translationStore.d.ts +1 -1
- package/dist/types/components/utils/api/buildCartItemsByTempCart.d.ts +8 -3
- package/dist/types/components/utils/api/calculateLandedCostNormalized.d.ts +2 -0
- package/dist/types/components/utils/api/cartCalculateLandedCost.d.ts +5 -0
- package/dist/types/components/utils/api/prepCalculateLandedCost.d.ts +5 -1
- package/dist/types/components/utils/checkout/getIsTestMode.d.ts +1 -1
- package/dist/types/scripts/_getNextFallbackUrl.d.ts +1 -0
- package/dist/types/scripts/_getTempCartById.d.ts +8 -0
- package/dist/types/scripts/_zonosBase.d.ts +15 -12
- package/dist/types/scripts/cart/_getCartIdFromParam.d.ts +4 -0
- package/dist/types/scripts/cart/_setupCartData.d.ts +7 -0
- package/dist/types/types/checkout/CheckoutConfig.d.ts +18 -3
- package/dist/types/types/checkout/api/CalculateLandedCostRequest.d.ts +42 -1
- package/dist/types/types/checkout/api/NormalizedTempCart.d.ts +37 -0
- package/dist/types/types/generated/graphql.customer.types.d.ts +249 -2
- package/dist/types/types/generated/graphql.customer.types.ts +251 -3
- package/dist/types/utils/formattedCloudflareApiUrl.d.ts +2 -2
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/p-01f0b13d.entry.js +1 -0
- package/dist/zonos-elements/p-042c466d.system.entry.js +1 -0
- package/dist/zonos-elements/p-10cb0064.entry.js +1 -0
- package/dist/zonos-elements/p-217e1aa1.system.entry.js +1 -0
- package/dist/zonos-elements/{p-5e56828a.entry.js → p-259ccf8d.entry.js} +1 -1
- package/dist/zonos-elements/p-2a47d2cc.system.entry.js +1 -0
- package/dist/zonos-elements/{p-ffd76226.entry.js → p-31eb835c.entry.js} +1 -1
- package/dist/zonos-elements/{p-58d9803d.entry.js → p-36360905.entry.js} +1 -1
- package/dist/zonos-elements/{p-1828a4ff.system.entry.js → p-3703b814.system.entry.js} +1 -1
- package/dist/zonos-elements/p-4146feec.js +1 -0
- package/dist/zonos-elements/p-446c8f02.system.entry.js +1 -0
- package/dist/zonos-elements/{p-2c323311.system.js → p-5590f90c.system.js} +1 -1
- package/dist/zonos-elements/p-588396df.js +1 -0
- package/dist/zonos-elements/{p-aa5d669b.js → p-6e59c6e4.js} +2 -2
- package/dist/zonos-elements/p-6eedc3f8.entry.js +1 -0
- package/dist/zonos-elements/p-747eed39.entry.js +1 -0
- package/dist/zonos-elements/{p-00100b17.system.entry.js → p-8228e87c.system.entry.js} +1 -1
- package/dist/zonos-elements/p-827868e6.entry.js +1 -0
- package/dist/zonos-elements/{p-cc7a4fca.entry.js → p-88005b94.entry.js} +1 -1
- package/dist/zonos-elements/p-895fdefb.js +1 -0
- package/dist/zonos-elements/p-8f7773b0.system.js +1 -0
- package/dist/zonos-elements/{p-9a0401fd.entry.js → p-8fa49d94.entry.js} +1 -1
- package/dist/zonos-elements/p-a74a7afa.system.js +1 -0
- package/dist/zonos-elements/{p-8473f99a.system.entry.js → p-b842b96a.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-9e976332.entry.js → p-bb186075.entry.js} +1 -1
- package/dist/zonos-elements/{p-b1a8b874.system.entry.js → p-c008648a.system.entry.js} +1 -1
- package/dist/zonos-elements/p-c22bac78.system.js +1 -0
- package/dist/zonos-elements/p-c78dd680.system.js +1 -1
- package/dist/zonos-elements/{p-6b42fa1b.system.entry.js → p-cd4ad1be.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-59e85369.system.entry.js → p-d62e6bb0.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-496e040f.system.entry.js → p-dc12f30a.system.entry.js} +1 -1
- package/dist/zonos-elements/p-eb2aedd0.js +1 -0
- package/dist/zonos-elements/{p-c89859cf.system.js → p-f124e459.system.js} +2 -2
- package/dist/zonos-elements/p-f87a635b.system.js +1 -0
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/logError-4e2f2020.js +0 -58
- package/dist/cjs/zonos-badge_2.cjs.entry.js +0 -57
- package/dist/collection/components/utils/api/tempCartItem/getAttributes.js +0 -66
- package/dist/collection/components/utils/api/tempCartItem/getMeasurements.js +0 -58
- package/dist/esm/logError-c456c092.js +0 -55
- package/dist/esm/zonos-badge_2.entry.js +0 -52
- package/dist/esm-es5/cart-51529af2.js +0 -1
- package/dist/esm-es5/logError-c456c092.js +0 -1
- package/dist/esm-es5/zonos-badge_2.entry.js +0 -1
- package/dist/esm-es5/zonos-cart-items_12.entry.js +0 -1
- package/dist/types/components/utils/api/tempCartItem/getAttributes.d.ts +0 -11
- package/dist/types/components/utils/api/tempCartItem/getMeasurements.d.ts +0 -7
- package/dist/types/types/checkout/api/TempCart.d.ts +0 -80
- package/dist/zonos-elements/p-101c41bf.entry.js +0 -1
- package/dist/zonos-elements/p-3c4eec63.system.entry.js +0 -1
- package/dist/zonos-elements/p-47945026.system.entry.js +0 -1
- package/dist/zonos-elements/p-47c72c50.system.entry.js +0 -1
- package/dist/zonos-elements/p-4e77ed65.system.entry.js +0 -1
- package/dist/zonos-elements/p-6013e370.entry.js +0 -1
- package/dist/zonos-elements/p-63db40b9.system.js +0 -1
- package/dist/zonos-elements/p-8b8ef484.entry.js +0 -1
- package/dist/zonos-elements/p-b57d24f2.entry.js +0 -1
- package/dist/zonos-elements/p-ba0289f9.entry.js +0 -1
- package/dist/zonos-elements/p-c8a3303b.js +0 -1
- package/dist/zonos-elements/p-d413cd13.js +0 -1
- package/dist/zonos-elements/p-e758ec31.system.js +0 -1
- package/dist/zonos-elements/p-eaa335e1.js +0 -1
- package/dist/zonos-elements/p-fcfde531.system.js +0 -1
- /package/dist/collection/types/checkout/api/{TempCart.js → NormalizedTempCart.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s,c as o,h as e,H as t,d as i}from"./p-5b7da777.js";import{k as n,l as a,t as d}from"./p-d413cd13.js";import{i as l}from"./p-81a54668.js";import{a as r}from"./p-eaa335e1.js";import{i as c,c as h}from"./p-0c64dbbb.js";import{z as f,d as b}from"./p-9dd6b00d.js";import{c as p}from"./p-b4b7f705.js";import{R as m}from"./p-08e7107d.js";import{g as u}from"./p-f05f3e27.js";import{i as z}from"./p-23a84835.js";const y=class{constructor(e){s(this,e),this.invalidCharacters=o(this,"invalidCharacters",7),this.type=void 0,this.titleText=void 0,this.defaultAddress=null,this.stripe=window.Zonos.stripe,this.isDirtyAddress=!1}getStripeAddressInstance(){return"billing"===this.type?{stripeAddressElement:n.stripeBillingAddressElement,stripeAddressEventData:n.stripeBillingAddressEventData,stripeElements:n.stripeElementsForBillingAddress}:{stripeAddressElement:n.stripeAddressElement,stripeAddressEventData:n.stripeAddressEventData,stripeElements:n.stripeElements}}updateAddressEventData({event:s,type:o}){"billing"===o?n.stripeBillingAddressEventData=s:n.stripeAddressEventData=s}updateAddressElement({stripeAddressElement:s,type:o}){"shipping"!==o?n.stripeBillingAddressElement=s:n.stripeAddressElement=s}async watchInitStripe(){var s,o;this.stripe=window.Zonos.stripe;const{stripeAddressEventData:e,stripeElements:t}=this.getStripeAddressInstance();if(!this.stripe||!t)return void r("Stripe is not initialized. Couldn't load stripe element.");(null===(s=this.defaultAddress)||void 0===s?void 0:s.phone)||null===(o=this.defaultAddress)||void 0===o||delete o.phone;const i=a.shippingZoneCountries,n=i?Object.values(i).map((s=>s.code)):[],d=t.create("address",{allowedCountries:"shipping"===this.type?n:[],contacts:this.defaultAddress&&!e?[this.defaultAddress]:[],defaultValues:{address:Object.assign(Object.assign({},null==e?void 0:e.value.address),{country:(null==e?void 0:e.value.address.country)||a.selectedCountryCode||"AL"}),firstName:null==e?void 0:e.value.firstName,lastName:null==e?void 0:e.value.lastName,phone:null==e?void 0:e.value.phone},display:{name:"split"},fields:{phone:"always"},mode:this.type,validation:{phone:{required:"always"}}});d.mount(this.el.querySelector(".zonos--address-component")),d.on("change",(s=>{const o=s.value;!this.isDirtyAddress&&o.address.line1.length>=3&&(this.isDirtyAddress=!0,setTimeout((()=>{if(l())this.el.scrollIntoView({behavior:"smooth",block:"end"});else{const s="shipping"===this.type?100:600,o=this.el.closest(".zonos--group"),e=this.el.getBoundingClientRect().top+s;null==o||o.scrollTo({behavior:"smooth",top:e})}}),600)),this.updateAddressEventData({event:Object.assign(Object.assign({},s),{elementMode:this.type,elementType:"address",value:Object.assign(Object.assign({},o),{firstName:o.firstName||o.name.split(" ")[0],lastName:o.lastName||o.name.split(" ")[1]})}),type:this.type})})),this.updateAddressElement({stripeAddressElement:d,type:this.type})}disconnectedCallback(){const s=this.getStripeAddressInstance().stripeAddressElement;null==s||s.destroy()}componentDidLoad(){const s=this.getStripeAddressInstance().stripeAddressEventData;this.isDirtyAddress=!!s&&s.value.address.line1.length>0,this.watchInitStripe()}render(){return e(t,{key:"2cecb49ed22bd0d5ce22c4f2110b37ecf7935cca",class:"zonos--address zonos--elements"},e("zonos-text",{key:"101635210ab6cb3b9a44b47eec101187d1c3a4ac",class:"zonos--title",type:"semiBoldLabel"},this.titleText),e("div",{key:"049f2b86986471d45bd413813307ec489d9f1993",class:"zonos--address-component"}))}get el(){return i(this)}static get watchers(){return{stripe:["watchInitStripe"]}}};y.style=".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:16px}.sc-zonos-address-h zonos-banner.sc-zonos-address{margin-top:8px}";const g=class{constructor(o){s(this,o),this.currentAddress=void 0,this.addressType=void 0}render(){var s;const{city:o,country:i,email:n,line1:l,line2:r,name:h,phone:f,postal_code:b,state:p}=this.currentAddress,m=null===(s=a.shippingZoneCountries)||void 0===s?void 0:s[i],u=({bold:s,content:o})=>{const t=c(o)?"red-600":"gray-1200";return e("zonos-text",{textColor:t,type:s?"boldLabel":"body"},o)};return e(t,{class:"zonos--address-form zonos--elements"},e("div",{class:"zonos--title"},e("zonos-text",{textColor:"gray-700",type:"smallHeader"},d("shipping"===this.addressType?"Shipping":"Billing"))),e("div",{class:"zonos--address-group"},h&&e("div",{class:"zonos--address-line"},u({bold:!0,content:h})),n&&e("div",{class:"zonos--address-line"},u({content:n})),f&&e("div",{class:"zonos--address-line"},u({content:f})),l&&e("div",{class:"zonos--address-line"},u({content:l})),r&&e("div",{class:"zonos--address-line"},u({content:r})),e("div",{class:"zonos--address-line"},o&&u({content:o}),p&&u({content:p}),b&&u({content:b})),m&&e("div",{class:"zonos--address-line"},e("zonos-country-flag",{class:"zonos--country-flag",countryCode:m.code})," ",u({content:m.displayName}))))}};g.style=':host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--title{margin-bottom:12px}:host .zonos--address-group{display:-ms-flexbox;display:flex;gap:4px;-ms-flex-direction:column;flex-direction:column}:host .zonos--address-line{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .zonos--address-line zonos-text+zonos-text::before{content:", ";color:var(--zonos-elements-gray-1200);margin-right:4px}:host .zonos--country-flag{width:20px;height:14px;border-radius:2px;margin:1px;position:relative;overflow:hidden;-webkit-box-shadow:var(--zonos-elements-v3-shadow-medium);box-shadow:var(--zonos-elements-v3-shadow-medium);margin-right:8px;z-index:10;justify-self:center}';const v=class{constructor(e){s(this,e),this.addressChange=o(this,"addressChange",7),this.onInputChange=({key:s,value:o})=>{this.addressChange.emit(Object.assign(Object.assign({},this.localAddress),{[s]:o}))},this.currentAddress=void 0,this.translatedAddress=void 0,this.addressType=void 0,this.localAddress=this.currentAddress}watchCurrentAddress(){var s,o,e,t,i,n;const{city:a,line1:d,line2:l,name:r,postal_code:c,state:h}=this.currentAddress;this.localAddress=Object.assign(Object.assign({},this.currentAddress),{city:(null===(s=this.translatedAddress.city)||void 0===s?void 0:s[a])||a,line1:(null===(o=this.translatedAddress.line1)||void 0===o?void 0:o[d])||d,line2:(null===(e=this.translatedAddress.line2)||void 0===e?void 0:e[l])||l,name:(null===(t=this.translatedAddress.name)||void 0===t?void 0:t[r])||r,postal_code:(null===(i=this.translatedAddress.postal_code)||void 0===i?void 0:i[c])||c,state:(null===(n=this.translatedAddress.state)||void 0===n?void 0:n[h])||h})}componentWillLoad(){this.watchCurrentAddress()}render(){const{city:s,country:o,line1:i,line2:n,name:a,phone:l,postal_code:r,state:h}=this.localAddress,f=a.split(" ")[0]||"",b=a.split(" ").slice(1).join(" ")||"";return e(t,{key:"8b578737e33203a23563be7e9be0778deec99bbf",class:"zonos--address-form zonos--elements"},e("div",{key:"793675a1348547bf3f781788956befe325191011",class:"zonos--title"},e("zonos-text",{key:"13de35cb0a7c98a48342e3fb86ae3ade9f5b88d9",textColor:"gray-700",type:"smallHeader"},d("shipping"===this.addressType?"Shipping":"Billing"))),e("div",{key:"2c5de5b5283fb99ee5f8b61d7a217177986fc2db",class:"zonos--address-group"},e("div",{key:"23bf3c893071000d5995a5f175867bab11929193",class:"zonos--contact"},e("zonos-text",{key:"7cdfe2a84ebad89ba5b16498d75def99cf392384",type:"label"},d("Contact")),e("zonos-input",{key:"1c39c38767fd306c5eb1164cdc989b8291209cf0",class:"zonos--form-email",inputLabel:d("Email"),inputValue:this.currentAddress.email,isDisabled:!0}),e("div",{key:"cbdf61217125e22b1a6cec9a340ef0aca2c75670",class:"zonos--name zonos--address-row"},e("zonos-input",{key:"360c99e7b2c6caa64580d5768b5bb53368927275",class:"zonos--form-first-name",inputLabel:d("First name"),inputValue:f,isError:c(f),onInputChange:s=>this.onInputChange({key:"name",value:`${s.detail} ${b}`})}),e("zonos-input",{key:"8ce5fa5c15c6f7928339ea10009ce0e68954a91f",class:"zonos--form-last-name",inputLabel:d("Last name"),inputValue:b,isError:c(b),onInputChange:s=>this.onInputChange({key:"name",value:`${f} ${s.detail}`})}))),e("div",{key:"7b4fa2d3baa6cb257e7688e5ba6777123898b3fd",class:"zonos--address"},e("zonos-text",{key:"9d5782331b2642755a755aeb7f98c9f4d87f9a20",type:"label"},d("Address")),e("zonos-input",{key:"a622025924ca86bdbf1d3c04b79e6dee172b4c42",class:"zonos--form-country",inputLabel:d("Country"),inputValue:o,isDisabled:!0}),e("zonos-input",{key:"f99b3a74db09ab5730878e80705b9aeac76bf800",class:"zonos--form-line1",inputLabel:d("Address line 1"),inputValue:i,isError:c(i),onInputChange:s=>this.onInputChange({key:"line1",value:s.detail})}),e("zonos-input",{key:"5d16aefa45a78045c87d166aaaec0255606e455e",class:"zonos--form-line2",inputLabel:d("Address line 2"),inputValue:n,isError:c(n),onInputChange:s=>this.onInputChange({key:"line2",value:s.detail})}),e("div",{key:"dc166be9381142835d72e731cb38a718522a068a",class:"zonos--address-row"},e("zonos-input",{key:"4f1a98f9d10ce0cff3ef18a3037a12382552b31d",class:"zonos--form-city",inputLabel:d("City"),inputValue:s,isError:c(s),onInputChange:s=>this.onInputChange({key:"city",value:s.detail})}),e("zonos-input",{key:"d4f97900b5fe2e1619950a52d1d1f716a8bc19ff",class:"zonos--form-state",inputLabel:d("State/Province"),inputValue:h,isError:c(h),onInputChange:s=>this.onInputChange({key:"state",value:s.detail})})),e("zonos-input",{key:"cf1eb0ca5cd15c8412a2e1246aaf2e39361dc733",class:"zonos--form-postal-code",inputLabel:d("Postal code"),inputValue:r,isError:c(r),onInputChange:s=>this.onInputChange({key:"postal_code",value:s.detail})}),e("zonos-input",{key:"7421c82847eded6bdbcce49ef8196124d8e50c1d",class:"zonos--form-phone",inputLabel:d("Phone number"),inputValue:l,onInputChange:s=>this.onInputChange({key:"phone",value:s.detail})}))))}static get watchers(){return{translatedAddress:["watchCurrentAddress"]}}};v.style=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--title{margin-bottom:20px}:host .zonos--address-group{display:-ms-flexbox;display:flex;gap:20px;-ms-flex-direction:column;flex-direction:column;margin:1px}:host .zonos--contact{display:-ms-flexbox;display:flex;gap:8px;-ms-flex-direction:column;flex-direction:column}:host .zonos--address-row{display:-ms-flexbox;display:flex;gap:8px}:host .zonos--address-row>*{-ms-flex:1;flex:1}:host .zonos--address{display:-ms-flexbox;display:flex;gap:8px;-ms-flex-direction:column;flex-direction:column}";const x=class{constructor(e){s(this,e),this.closeUpdateDialog=o(this,"closeUpdateDialog",7),this.continueClicked=o(this,"continueClicked",7),this.closeUpdateDialogHandler=()=>{this.closeUpdateDialog.emit()},this.getTranslatedAddress=({currentAddress:s,translatedAddress:o})=>{var e,t,i,n,a,d;const{city:l,line1:r,line2:c,name:h,postal_code:f,state:b}=s;return{city:(null===(e=o.city)||void 0===e?void 0:e[l])||l,line1:(null===(t=o.line1)||void 0===t?void 0:t[r])||r,line2:(null===(i=o.line2)||void 0===i?void 0:i[c])||c,name:(null===(n=o.name)||void 0===n?void 0:n[h])||h,postal_code:(null===(a=o.postal_code)||void 0===a?void 0:a[f])||f,state:(null===(d=o.state)||void 0===d?void 0:d[b])||b}},this.continueClickHandler=async()=>{var s,o,e;this.continueLoading=!0;const t=this.billingAddress?this.getTranslatedAddress({currentAddress:this.billingAddress,translatedAddress:this.translatedBillingAddressState}):null,i=this.getTranslatedAddress({currentAddress:this.shippingAddress,translatedAddress:this.translatedShippingAddressState}),n=h(Object.assign(Object.assign({},i),{country:this.shippingAddress.country})),a=t&&this.billingAddress&&h(Object.assign(Object.assign({},t),{country:this.billingAddress.country})),d=!!Object.keys(n).length,l=!!a&&!!Object.keys(a).length;if(d||l){const t=null===(s=this.el.shadowRoot)||void 0===s?void 0:s.querySelectorAll("zonos-address-form"),i=null==t?void 0:t[0],n=null==t?void 0:t[1],a=(null===(o=null==i?void 0:i.shadowRoot)||void 0===o?void 0:o.querySelector(".has-error"))||(null===(e=null==n?void 0:n.shadowRoot)||void 0===e?void 0:e.querySelector(".has-error"));return a&&a.scrollIntoView({behavior:"smooth",block:"center"}),void(this.continueLoading=!1)}this.continueClicked.emit({billingAddress:t,shippingAddress:i})},this.buildTranslateAddressState=({currentAddress:s,translatedAddress:o})=>{const{city:e,line1:t,line2:i,name:n,postal_code:a,state:d}=s;return{city:{[e]:o.city},line1:{[t]:o.line1},line2:{[i]:o.line2},name:{[n]:o.name},postal_code:{[a]:o.postal_code},state:{[d]:o.state}}},this.continueLoading=!1,this.dialogLoading=void 0,this.dialogOpen=!1,this.submitBtnType=void 0,this.submitBtnColor=void 0,this.isMobile=!1,this.shippingAddress=void 0,this.billingAddress=void 0,this.translatedShippingAddress=void 0,this.translatedBillingAddress=void 0,this.showErrorBanner=!1,this.translatedShippingAddressState={},this.translatedBillingAddressState={}}watchTranslatedShippingAddress(){this.translatedShippingAddressState=this.translatedShippingAddress}watchTranslatedBillingAddress(){this.translatedBillingAddressState=this.translatedBillingAddress}componentWillLoad(){this.watchTranslatedBillingAddress(),this.watchTranslatedShippingAddress()}render(){const s="#ffffff"===(this.submitBtnColor||f.appearance.colorSecondary)?"outline":this.submitBtnType||"standard",o=this.billingAddress,i=this.shippingAddress;return e(t,{key:"655845cef04f4af526b1a1c4e49243c4f2b4c7f6",class:p(["zonos--address-update-dialog zonos--elements",this.isMobile&&"mobile"])},e("zonos-dialog",{key:"eab429bb78ce6f05ba463d8748d7edd5499402fa",isLoading:this.dialogLoading,mobile:this.isMobile,noBodyPadding:!0,noBorder:!0,noClickOutside:!0,noCloseButton:!0,onCloseDialog:()=>this.closeUpdateDialog.emit(),open:this.dialogOpen,width:"568px"},e("div",{key:"08f0400e62addfcaffd91bf5200999d29bbd2da9",class:"zonos--body"},e("div",{key:"8699df5e2f823e19066fbb552ba2a66c127c05e9",class:"zonos--dialog-header"},e("div",{key:"92e0ff932dcdb0e5b59ea34b688d1ef8e31bfeb3",class:"zonos--dialog-title"},e("zonos-text",{key:"aaac3375526bddb319ce7c8f49bde30da7210264",type:"title"},d("Update your address")),e("zonos-button",{key:"66abf7b74045e68e84e631298504236d32ca9c4e",class:"zonos--close-button",icon:e("zonos-icon",{"aria-label":"Close checkout dialog",content:m}),noBackground:!0,onClick:()=>this.closeUpdateDialogHandler()})),e("zonos-text",{key:"ffb3d8f169867d5f6dff269e1becd99c98c5a7da"},d("To ensure delivery all address details must be in Latin characters."))),e("div",{key:"2cb61f06ce174e2317870decfdd337c67c5cf128",class:"zonos--group"},e("zonos-text",{key:"a616c540984120b468e52bccfb380ea3974ced22",class:"zonos--what-you-entered",type:"semiBoldLabel"},d("What you entered")),e("div",{key:"6ac8f9c14472370c501af1b0d50bd8f8746b7694",class:"zonos--address-display-group"},e("zonos-address-display",{key:"ea2c67a7bba51c99f80be968e448beeffcf1f863",addressType:"shipping",currentAddress:i}),o&&e("zonos-address-display",{key:"7ea1683dc04a292810e04ed6550d86086f25186f",addressType:"billing",currentAddress:o})),e("div",{key:"4d1cd9096943518b8b4e267608a5e1542befb6a9",class:"zonos--address-form-section"},e("zonos-text",{key:"e4184a2cc618d26d43979fa8cfe06070cf8b5af8",type:"semiBoldLabel"},d("Translated address")),e("zonos-address-form",{key:"c55d9d3c658565ceb7c7b879f444e3937b9f7ad6",addressType:"shipping",class:"zonos--shipping-address-form",currentAddress:i,onAddressChange:s=>{this.translatedShippingAddressState=this.buildTranslateAddressState({currentAddress:i,translatedAddress:s.detail})},translatedAddress:this.translatedShippingAddressState}),o&&e("zonos-address-form",{key:"c3facc295b1322bb00baa6081f343dcea4f10777",addressType:"billing",class:"zonos--billing-address-form",currentAddress:o,onAddressChange:s=>{this.translatedBillingAddressState=this.buildTranslateAddressState({currentAddress:o,translatedAddress:s.detail})},translatedAddress:this.translatedBillingAddressState}))),e("div",{key:"1c89c9604ba0dece40275fcfac97e7f93706b430",class:"zonos--group-btn"},e("div",{key:"e47d393940b094b4e123864e4070daa87f0616f0",class:"zonos--button-wrapper"},e("zonos-button",{key:"216b7afe268a4acd6bb8a76b7f5a32dc09bdd4f6",class:"zonos--cancel-btn",onClick:()=>this.closeUpdateDialogHandler(),variant:"subtle"},d("Cancel")),e("zonos-button",{key:"acbacb92cedb325b46843d8f3aff13f4e7c86ab5",backgroundColor:this.submitBtnColor,class:"zonos--update-btn",loading:this.continueLoading,onClick:()=>this.continueClickHandler(),size:"sm",variant:s},d("Update address")))))))}get el(){return i(this)}static get watchers(){return{translatedShippingAddress:["watchTranslatedShippingAddress"],translatedBillingAddress:["watchTranslatedBillingAddress"]}}};x.style=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--body{padding:0 24px;position:relative}:host .zonos--dialog-header{margin-bottom:32px;position:-webkit-sticky;position:sticky;padding-top:24px;top:0;z-index:11;background:var(--zonos-elements-gray-0)}:host .zonos--dialog-title{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;margin-bottom:12px}:host .zonos--group{overflow:auto;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:8px;-ms-scroll-chaining:none;overscroll-behavior:contain}:host .zonos--group::-webkit-scrollbar{width:10px}:host .zonos--group::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}:host .zonos--group::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}:host .zonos--group::-webkit-scrollbar-thumb:hover{background:#d6d6d6}:host .zonos--address-display-group{display:-ms-flexbox;display:flex;gap:8px;margin-bottom:20px}:host .zonos--address-display-group zonos-address-display{-ms-flex:1;flex:1}:host .zonos--what-you-entered{margin-bottom:8px}:host .zonos--address-form-section{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:24px}:host .zonos--group-btn{position:-webkit-sticky;position:sticky;padding:24px 0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-pack:end;justify-content:end;background:var(--zonos-elements-gray-0);z-index:11}:host .zonos--group-btn .zonos--button-wrapper{display:-ms-flexbox;display:flex;gap:8px}:host(.mobile) .zonos--button-wrapper{-ms-flex-direction:column;flex-direction:column;width:100%}:host(.mobile) .zonos--button-wrapper zonos-button{width:100%}:host(.mobile) .zonos--button-wrapper .zonos--cancel-btn{-ms-flex-order:2;order:2}:host(.mobile) .zonos--button-wrapper .zonos--update-btn{-ms-flex-order:1;order:1}";const k=["blue","cyan","green","orange","purple","red","gray","glass"],w=class{constructor(e){s(this,e),this.checkboxSelected=o(this,"checkboxSelected",7),this.backgroundColor="blue",this.label=void 0,this.isChecked=!1,this.isDisabled=!1,this.size=12,this.fontSize="base",this.borderStyle=void 0}onClick(){this.isDisabled||this.checkboxSelected.emit(!this.isChecked)}render(){const s=k.includes(this.backgroundColor),o=s?`var(--zonos-elements-${this.backgroundColor}-600)`:this.backgroundColor,i=s?`var(--zonos-elements-${this.backgroundColor}-200)`:z(o)?"var(--zonos-elements-gray-0)":"var(--zonos-elements-gray-800)",n=u({customRoundRadius:"4px",overrideBorderStyle:this.borderStyle});return e(t,{key:"bf51dd642e88096e874d78023a29dd68239e8d3a",class:p(["zonos--elements zonos--checkbox"]),style:{"--background-color":o,"--border-radius":n,"--font-family":b(),"--size":`${this.size}px`}},e("label",{key:"3598c9f21285304499aaafbab5226d619ecf4e69",class:p([this.isDisabled&&"disabled"])},e("input",{key:"277507f643404e6e44191c2d715b70f38fc6af85",checked:this.isChecked,disabled:this.isDisabled,hidden:!0,onChange:s=>{this.checkboxSelected.emit(s.target.checked)},type:"checkbox"}),e("span",{key:"3f0fd0d458e8cf660fa883ceaa241e3397829548",class:"checkmark-container"},e("svg",{key:"0d654744bea5b5696ddcf3778a155fb622022f1e",class:"checkmark",color:i,fill:"none",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e("path",{key:"cc19837ee088feb7053fdaeaea0d1213cbc60775","clip-rule":"evenodd",d:"M17.456 7.404a.75.75 0 0 1 .14 1.052l-6.5 8.5a.75.75 0 0 1-1.126.074l-4-4a.75.75 0 0 1 1.06-1.06l3.395 3.394 5.98-7.82a.75.75 0 0 1 1.05-.14Z",fill:"currentColor","fill-rule":"evenodd"}))),this.label&&e("zonos-text",{key:"cb85d59651f67a33126d37c3ebfb1e8a91b457fe",size:this.fontSize},this.label)))}};w.style=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex;cursor:pointer}:host label{display:-ms-inline-flexbox;display:inline-flex;position:relative;gap:8px;-ms-flex-align:center;align-items:center}:host label.disabled{cursor:not-allowed;opacity:0.6}:host input[type=checkbox]{opacity:0;position:absolute;left:0;width:0;height:0;top:0;z-index:-99999}:host svg{opacity:0}:host .checkmark-container{height:var(--size);width:var(--size);background-color:transparent;border:1.5px solid var(--zonos-elements-gray-400);position:relative;border-radius:var(--border-radius, var(--zonos-elements-radius-4))}:host .checkmark{opacity:0;position:absolute;top:-1.5px;left:-1.5px;right:-1.5px;bottom:-1.5px;width:calc(100% + 3px);-webkit-transition:0.3s all cubic-bezier(0.175, 0.885, 0.32, 1.275);transition:0.3s all cubic-bezier(0.175, 0.885, 0.32, 1.275);-webkit-transform:scale(0.4);transform:scale(0.4);background-color:var(--background-color);border-radius:var(--border-radius, var(--zonos-elements-radius-4))}:host input[type=checkbox]:checked~.checkmark-container .checkmark{opacity:1;-webkit-transform:scale(1);transform:scale(1)}";const A=class{constructor(o){s(this,o),this.collapsed=!1,this.collapseSize=0,this.height=this.el.scrollHeight,this.iframe=null}getElementHeight(){return this.collapsed?`${this.collapseSize}px`:`${this.height}px`}componentDidLoad(){this.height=this.el.scrollHeight}componentDidRender(){var s,o,e;this.iframe=(null===(s=this.el.shadowRoot)||void 0===s?void 0:s.querySelector("iframe"))||null,null===(e=null===(o=this.iframe)||void 0===o?void 0:o.contentWindow)||void 0===e||e.addEventListener("resize",(()=>{this.iframe&&(this.height=parseFloat(getComputedStyle(this.iframe).height))}))}render(){return this.collapsed?this.el.style.overflow="hidden":setTimeout((()=>{this.collapsed||(this.el.style.overflow="visible")}),300),e(t,{key:"7cc2167ab3dab1a975d141f3c58d3c5982c1645a",class:"zonos--elements zonos--collapse",style:{"--font-family":b(),height:this.getElementHeight()}},e("div",{key:"1b791702f95066643ac82402a9fcff19b0fcc706"},e("iframe",{key:"08f678a4ce92f5600c584e329e3039bc4588ff3a",class:"height-change-listener",tabindex:"-1",title:"collapse-height-change-listener"}),e("slot",{key:"83119f9ba9764c46fa7d1dd7b4c0b08c49033607"})))}get el(){return i(this)}};A.style=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{-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}";const C=class{constructor(e){s(this,e),this.closeDialog=o(this,"closeDialog",3),this.isMobileMode=()=>this.mobile||window.innerWidth<=768,this.closeButtonHandler=()=>{this.open&&this.closeDialog.emit()},this.clickOutsideDialogHandler=s=>{s.target!==s.currentTarget||this.noClickOutside||this.closeDialog.emit()},this.open=!1,this.headerText="",this.width="460px",this.height=void 0,this.minHeight=void 0,this.noHeader=!1,this.noBodyPadding=!1,this.noBorder=!1,this.borderStyle=void 0,this.noCloseButton=!1,this.noClickOutside=!1,this.mobile=!1,this.isLoading=!0,this.isMobile=!1}handleWindowResize(){this.isMobile=this.isMobileMode()}handleKeyDown(s){"Escape"===s.key&&this.closeButtonHandler()}componentDidLoad(){this.isMobile=this.isMobileMode()}render(){document.body.style.overflow=this.open?"hidden":"auto";const s=u({overrideBorderStyle:this.borderStyle});return e(t,{key:"03735385e07c7f6c8a87df42ad95f8c9d9533668",class:p(["zonos--elements",this.open&&"open",this.isLoading&&"is-loading",this.noBorder&&"no-border",this.isMobile&&"mobile"]),style:{"--border-radius":s,"--font-family":b(),"--height":this.height||"initial","--min-height":this.minHeight||"500px","--width":this.width}},e("div",{key:"da5d599e1a247f7e3364e6f5c9b2eae3db9539f5",class:"zonos--backdrop"}),e("div",{key:"cda1a996d9521c2e0b307f7a03ca3ee3d4915b8d",class:"zonos--dialog-layout",inert:!this.open,onClick:this.clickOutsideDialogHandler},e("div",{key:"471d8a069d4f580233bdb3e9e971efdb268ef57d",class:"zonos--dialog"},this.isLoading&&e("div",{key:"57220007aabcaef133c2c0782fa238cc43d63964",class:"zonos--loading"},e("zonos-spinner",{key:"0298b754341abd61ec07706128d05df5332f915d",size:30})),(this.headerText||!this.noCloseButton)&&e("div",{key:"5103dbc1c7593a8042505f767d8290825f9d10e7",class:"zonos--header"},this.headerText&&e("h3",{key:"a2d9cd4c8cb359aa64cf104a172ca960068c20a0",class:"zonos--header-text"},this.headerText),!this.noCloseButton&&e("zonos-button",{key:"de9bf8a949344d19fcb8bfb496719282553be194",class:"zonos--close-button",icon:e("zonos-icon",{"aria-label":"Close dialog",content:'<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>'}),noBackground:!0,onClick:this.closeButtonHandler,variant:"subtle"})),e("div",{key:"1ec2cdca0f186cd0b28602580022ed0cb4b0eec9",class:p(["zonos--body",this.noBodyPadding&&"zonos--no-body-padding"])},e("slot",{key:"5071d921f48bf792a951a390d83b121e32771668"})),e("slot",{key:"c1818ac301afc845f5b14fd0f2ac9a1fd3a27b99",name:"dialog-footer"}))))}static get assetsDirs(){return["assets"]}};C.style=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .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:0;top:0;background:var(--zonos-elements-backdrop-color);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:2147483009;background:var(--zonos-elements-gray-0);border-radius:var(--border-radius, var(--zonos-elements-radius-10))}: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(--zonos-elements-text-color);visibility:hidden}:host .zonos--dialog{position:relative;z-index:2147483008;background:var(--zonos-elements-gray-0);max-width:90vw;max-height:90vh;min-height:var(--min-height, auto);height:var(--height, auto);width:var(--width, auto);border-radius:var(--border-radius, var(--zonos-elements-radius-10));outline:none;-webkit-box-shadow:var(--zonos-elements-v3-shadow-xxl);box-shadow:var(--zonos-elements-v3-shadow-xxl);border:var(--zonos-elements-border);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:16px 24px}:host .zonos--header .-zonos-stencil-library--header-text{-ms-flex-positive:1;flex-grow:1}:host .zonos--header .zonos--close-button{width:var(--zonos-elements-size-md);height:var(--zonos-elements-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(--zonos-elements-radius-10);-ms-flex-item-align:start;align-self:flex-start}:host .zonos--header .zonos--close-button:hover{background:var(--zonos-elements-hover-color)}:host .zonos--body{padding:8px 24px;max-height:100%;height:100%;overflow:auto}:host .zonos--body.zonos--no-body-padding{padding:0}:host .zonos--footer{padding:16px 24px}:host(.open) .zonos--dialog-layout,:host(.open) .zonos--backdrop{visibility:visible}:host(.open) .zonos--backdrop{z-index:2147483008;opacity:0.65}:host(.open) .zonos--dialog-layout{opacity:1;z-index:2147483009;-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}";const I=class{constructor(o){s(this,o),this.titleText=void 0,this.defaultEmail=null,this.stripe=n.stripe}watchInitStripe(){if(!this.stripe||!n.stripeElements)return;const s=n.stripeLinkElement||n.stripeElements.create("linkAuthentication",{defaultValues:(this.defaultEmail?{email:this.defaultEmail}:void 0)||void 0}),o=this.el.querySelector(".zonos--link-authentication-component");o?(s.mount(o),s.on("change",(s=>{n.stripeLinkEventData=s})),n.stripeLinkElement=s):r("Cannot find container element for linkAuthenticationElement")}componentDidLoad(){this.watchInitStripe()}render(){return e(t,{key:"f0b26abf99ef99c6665dabdddebc9ff086b6816c",class:"zonos--link-authentication zonos--elements"},e("zonos-text",{key:"898dbdffac06fe2a68af90610a22044bb72391ce",class:"zonos--title",type:"semiBoldLabel"},this.titleText),e("div",{key:"e2ec9abb0cf76a39a1262e1366e375dd898450cd",class:"zonos--link-authentication-component"}))}get el(){return i(this)}static get watchers(){return{stripe:["watchInitStripe"]}}};I.style=".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:16px}";export{y as zonos_address,g as zonos_address_display,v as zonos_address_form,x as zonos_address_update_dialog,w as zonos_checkbox,A as zonos_collapse,C as zonos_dialog,I as zonos_link_authentication}
|
|
1
|
+
import{r as s,c as o,h as e,H as t,d as i}from"./p-5b7da777.js";import{j as n,l as a,t as d}from"./p-895fdefb.js";import{i as l}from"./p-81a54668.js";import{a as r}from"./p-4146feec.js";import{i as c,c as h}from"./p-0c64dbbb.js";import{z as f,d as b}from"./p-9dd6b00d.js";import{c as p}from"./p-b4b7f705.js";import{R as m}from"./p-08e7107d.js";import{g as u}from"./p-f05f3e27.js";import{i as z}from"./p-23a84835.js";const y=class{constructor(e){s(this,e),this.invalidCharacters=o(this,"invalidCharacters",7),this.type=void 0,this.titleText=void 0,this.defaultAddress=null,this.stripe=window.Zonos.stripe,this.isDirtyAddress=!1}getStripeAddressInstance(){return"billing"===this.type?{stripeAddressElement:n.stripeBillingAddressElement,stripeAddressEventData:n.stripeBillingAddressEventData,stripeElements:n.stripeElementsForBillingAddress}:{stripeAddressElement:n.stripeAddressElement,stripeAddressEventData:n.stripeAddressEventData,stripeElements:n.stripeElements}}updateAddressEventData({event:s,type:o}){"billing"===o?n.stripeBillingAddressEventData=s:n.stripeAddressEventData=s}updateAddressElement({stripeAddressElement:s,type:o}){"shipping"!==o?n.stripeBillingAddressElement=s:n.stripeAddressElement=s}async watchInitStripe(){var s,o;this.stripe=window.Zonos.stripe;const{stripeAddressEventData:e,stripeElements:t}=this.getStripeAddressInstance();if(!this.stripe||!t)return void r("Stripe is not initialized. Couldn't load stripe element.");(null===(s=this.defaultAddress)||void 0===s?void 0:s.phone)||null===(o=this.defaultAddress)||void 0===o||delete o.phone;const i=a.shippingZoneCountries,n=i?Object.values(i).map((s=>s.code)):[],d=t.create("address",{allowedCountries:"shipping"===this.type?n:[],contacts:this.defaultAddress&&!e?[this.defaultAddress]:[],defaultValues:{address:Object.assign(Object.assign({},null==e?void 0:e.value.address),{country:(null==e?void 0:e.value.address.country)||a.selectedCountryCode||"AL"}),firstName:null==e?void 0:e.value.firstName,lastName:null==e?void 0:e.value.lastName,phone:null==e?void 0:e.value.phone},display:{name:"split"},fields:{phone:"always"},mode:this.type,validation:{phone:{required:"always"}}});d.mount(this.el.querySelector(".zonos--address-component")),d.on("change",(s=>{const o=s.value;!this.isDirtyAddress&&o.address.line1.length>=3&&(this.isDirtyAddress=!0,setTimeout((()=>{if(l())this.el.scrollIntoView({behavior:"smooth",block:"end"});else{const s="shipping"===this.type?100:600,o=this.el.closest(".zonos--group"),e=this.el.getBoundingClientRect().top+s;null==o||o.scrollTo({behavior:"smooth",top:e})}}),600)),this.updateAddressEventData({event:Object.assign(Object.assign({},s),{elementMode:this.type,elementType:"address",value:Object.assign(Object.assign({},o),{firstName:o.firstName||o.name.split(" ")[0],lastName:o.lastName||o.name.split(" ")[1]})}),type:this.type})})),this.updateAddressElement({stripeAddressElement:d,type:this.type})}disconnectedCallback(){const s=this.getStripeAddressInstance().stripeAddressElement;null==s||s.destroy()}componentDidLoad(){const s=this.getStripeAddressInstance().stripeAddressEventData;this.isDirtyAddress=!!s&&s.value.address.line1.length>0,this.watchInitStripe()}render(){return e(t,{key:"2cecb49ed22bd0d5ce22c4f2110b37ecf7935cca",class:"zonos--address zonos--elements"},e("zonos-text",{key:"101635210ab6cb3b9a44b47eec101187d1c3a4ac",class:"zonos--title",type:"semiBoldLabel"},this.titleText),e("div",{key:"049f2b86986471d45bd413813307ec489d9f1993",class:"zonos--address-component"}))}get el(){return i(this)}static get watchers(){return{stripe:["watchInitStripe"]}}};y.style=".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:16px}.sc-zonos-address-h zonos-banner.sc-zonos-address{margin-top:8px}";const g=class{constructor(o){s(this,o),this.currentAddress=void 0,this.addressType=void 0}render(){var s;const{city:o,country:i,email:n,line1:l,line2:r,name:h,phone:f,postal_code:b,state:p}=this.currentAddress,m=null===(s=a.shippingZoneCountries)||void 0===s?void 0:s[i],u=({bold:s,content:o})=>{const t=c(o)?"red-600":"gray-1200";return e("zonos-text",{textColor:t,type:s?"boldLabel":"body"},o)};return e(t,{class:"zonos--address-form zonos--elements"},e("div",{class:"zonos--title"},e("zonos-text",{textColor:"gray-700",type:"smallHeader"},d("shipping"===this.addressType?"Shipping":"Billing"))),e("div",{class:"zonos--address-group"},h&&e("div",{class:"zonos--address-line"},u({bold:!0,content:h})),n&&e("div",{class:"zonos--address-line"},u({content:n})),f&&e("div",{class:"zonos--address-line"},u({content:f})),l&&e("div",{class:"zonos--address-line"},u({content:l})),r&&e("div",{class:"zonos--address-line"},u({content:r})),e("div",{class:"zonos--address-line"},o&&u({content:o}),p&&u({content:p}),b&&u({content:b})),m&&e("div",{class:"zonos--address-line"},e("zonos-country-flag",{class:"zonos--country-flag",countryCode:m.code})," ",u({content:m.displayName}))))}};g.style=':host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--title{margin-bottom:12px}:host .zonos--address-group{display:-ms-flexbox;display:flex;gap:4px;-ms-flex-direction:column;flex-direction:column}:host .zonos--address-line{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .zonos--address-line zonos-text+zonos-text::before{content:", ";color:var(--zonos-elements-gray-1200);margin-right:4px}:host .zonos--country-flag{width:20px;height:14px;border-radius:2px;margin:1px;position:relative;overflow:hidden;-webkit-box-shadow:var(--zonos-elements-v3-shadow-medium);box-shadow:var(--zonos-elements-v3-shadow-medium);margin-right:8px;z-index:10;justify-self:center}';const v=class{constructor(e){s(this,e),this.addressChange=o(this,"addressChange",7),this.onInputChange=({key:s,value:o})=>{this.addressChange.emit(Object.assign(Object.assign({},this.localAddress),{[s]:o}))},this.currentAddress=void 0,this.translatedAddress=void 0,this.addressType=void 0,this.localAddress=this.currentAddress}watchCurrentAddress(){var s,o,e,t,i,n;const{city:a,line1:d,line2:l,name:r,postal_code:c,state:h}=this.currentAddress;this.localAddress=Object.assign(Object.assign({},this.currentAddress),{city:(null===(s=this.translatedAddress.city)||void 0===s?void 0:s[a])||a,line1:(null===(o=this.translatedAddress.line1)||void 0===o?void 0:o[d])||d,line2:(null===(e=this.translatedAddress.line2)||void 0===e?void 0:e[l])||l,name:(null===(t=this.translatedAddress.name)||void 0===t?void 0:t[r])||r,postal_code:(null===(i=this.translatedAddress.postal_code)||void 0===i?void 0:i[c])||c,state:(null===(n=this.translatedAddress.state)||void 0===n?void 0:n[h])||h})}componentWillLoad(){this.watchCurrentAddress()}render(){const{city:s,country:o,line1:i,line2:n,name:a,phone:l,postal_code:r,state:h}=this.localAddress,f=a.split(" ")[0]||"",b=a.split(" ").slice(1).join(" ")||"";return e(t,{key:"8b578737e33203a23563be7e9be0778deec99bbf",class:"zonos--address-form zonos--elements"},e("div",{key:"793675a1348547bf3f781788956befe325191011",class:"zonos--title"},e("zonos-text",{key:"13de35cb0a7c98a48342e3fb86ae3ade9f5b88d9",textColor:"gray-700",type:"smallHeader"},d("shipping"===this.addressType?"Shipping":"Billing"))),e("div",{key:"2c5de5b5283fb99ee5f8b61d7a217177986fc2db",class:"zonos--address-group"},e("div",{key:"23bf3c893071000d5995a5f175867bab11929193",class:"zonos--contact"},e("zonos-text",{key:"7cdfe2a84ebad89ba5b16498d75def99cf392384",type:"label"},d("Contact")),e("zonos-input",{key:"1c39c38767fd306c5eb1164cdc989b8291209cf0",class:"zonos--form-email",inputLabel:d("Email"),inputValue:this.currentAddress.email,isDisabled:!0}),e("div",{key:"cbdf61217125e22b1a6cec9a340ef0aca2c75670",class:"zonos--name zonos--address-row"},e("zonos-input",{key:"360c99e7b2c6caa64580d5768b5bb53368927275",class:"zonos--form-first-name",inputLabel:d("First name"),inputValue:f,isError:c(f),onInputChange:s=>this.onInputChange({key:"name",value:`${s.detail} ${b}`})}),e("zonos-input",{key:"8ce5fa5c15c6f7928339ea10009ce0e68954a91f",class:"zonos--form-last-name",inputLabel:d("Last name"),inputValue:b,isError:c(b),onInputChange:s=>this.onInputChange({key:"name",value:`${f} ${s.detail}`})}))),e("div",{key:"7b4fa2d3baa6cb257e7688e5ba6777123898b3fd",class:"zonos--address"},e("zonos-text",{key:"9d5782331b2642755a755aeb7f98c9f4d87f9a20",type:"label"},d("Address")),e("zonos-input",{key:"a622025924ca86bdbf1d3c04b79e6dee172b4c42",class:"zonos--form-country",inputLabel:d("Country"),inputValue:o,isDisabled:!0}),e("zonos-input",{key:"f99b3a74db09ab5730878e80705b9aeac76bf800",class:"zonos--form-line1",inputLabel:d("Address line 1"),inputValue:i,isError:c(i),onInputChange:s=>this.onInputChange({key:"line1",value:s.detail})}),e("zonos-input",{key:"5d16aefa45a78045c87d166aaaec0255606e455e",class:"zonos--form-line2",inputLabel:d("Address line 2"),inputValue:n,isError:c(n),onInputChange:s=>this.onInputChange({key:"line2",value:s.detail})}),e("div",{key:"dc166be9381142835d72e731cb38a718522a068a",class:"zonos--address-row"},e("zonos-input",{key:"4f1a98f9d10ce0cff3ef18a3037a12382552b31d",class:"zonos--form-city",inputLabel:d("City"),inputValue:s,isError:c(s),onInputChange:s=>this.onInputChange({key:"city",value:s.detail})}),e("zonos-input",{key:"d4f97900b5fe2e1619950a52d1d1f716a8bc19ff",class:"zonos--form-state",inputLabel:d("State/Province"),inputValue:h,isError:c(h),onInputChange:s=>this.onInputChange({key:"state",value:s.detail})})),e("zonos-input",{key:"cf1eb0ca5cd15c8412a2e1246aaf2e39361dc733",class:"zonos--form-postal-code",inputLabel:d("Postal code"),inputValue:r,isError:c(r),onInputChange:s=>this.onInputChange({key:"postal_code",value:s.detail})}),e("zonos-input",{key:"7421c82847eded6bdbcce49ef8196124d8e50c1d",class:"zonos--form-phone",inputLabel:d("Phone number"),inputValue:l,onInputChange:s=>this.onInputChange({key:"phone",value:s.detail})}))))}static get watchers(){return{translatedAddress:["watchCurrentAddress"]}}};v.style=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--title{margin-bottom:20px}:host .zonos--address-group{display:-ms-flexbox;display:flex;gap:20px;-ms-flex-direction:column;flex-direction:column;margin:1px}:host .zonos--contact{display:-ms-flexbox;display:flex;gap:8px;-ms-flex-direction:column;flex-direction:column}:host .zonos--address-row{display:-ms-flexbox;display:flex;gap:8px}:host .zonos--address-row>*{-ms-flex:1;flex:1}:host .zonos--address{display:-ms-flexbox;display:flex;gap:8px;-ms-flex-direction:column;flex-direction:column}";const x=class{constructor(e){s(this,e),this.closeUpdateDialog=o(this,"closeUpdateDialog",7),this.continueClicked=o(this,"continueClicked",7),this.closeUpdateDialogHandler=()=>{this.closeUpdateDialog.emit()},this.getTranslatedAddress=({currentAddress:s,translatedAddress:o})=>{var e,t,i,n,a,d;const{city:l,line1:r,line2:c,name:h,postal_code:f,state:b}=s;return{city:(null===(e=o.city)||void 0===e?void 0:e[l])||l,line1:(null===(t=o.line1)||void 0===t?void 0:t[r])||r,line2:(null===(i=o.line2)||void 0===i?void 0:i[c])||c,name:(null===(n=o.name)||void 0===n?void 0:n[h])||h,postal_code:(null===(a=o.postal_code)||void 0===a?void 0:a[f])||f,state:(null===(d=o.state)||void 0===d?void 0:d[b])||b}},this.continueClickHandler=async()=>{var s,o,e;this.continueLoading=!0;const t=this.billingAddress?this.getTranslatedAddress({currentAddress:this.billingAddress,translatedAddress:this.translatedBillingAddressState}):null,i=this.getTranslatedAddress({currentAddress:this.shippingAddress,translatedAddress:this.translatedShippingAddressState}),n=h(Object.assign(Object.assign({},i),{country:this.shippingAddress.country})),a=t&&this.billingAddress&&h(Object.assign(Object.assign({},t),{country:this.billingAddress.country})),d=!!Object.keys(n).length,l=!!a&&!!Object.keys(a).length;if(d||l){const t=null===(s=this.el.shadowRoot)||void 0===s?void 0:s.querySelectorAll("zonos-address-form"),i=null==t?void 0:t[0],n=null==t?void 0:t[1],a=(null===(o=null==i?void 0:i.shadowRoot)||void 0===o?void 0:o.querySelector(".has-error"))||(null===(e=null==n?void 0:n.shadowRoot)||void 0===e?void 0:e.querySelector(".has-error"));return a&&a.scrollIntoView({behavior:"smooth",block:"center"}),void(this.continueLoading=!1)}this.continueClicked.emit({billingAddress:t,shippingAddress:i})},this.buildTranslateAddressState=({currentAddress:s,translatedAddress:o})=>{const{city:e,line1:t,line2:i,name:n,postal_code:a,state:d}=s;return{city:{[e]:o.city},line1:{[t]:o.line1},line2:{[i]:o.line2},name:{[n]:o.name},postal_code:{[a]:o.postal_code},state:{[d]:o.state}}},this.continueLoading=!1,this.dialogLoading=void 0,this.dialogOpen=!1,this.submitBtnType=void 0,this.submitBtnColor=void 0,this.isMobile=!1,this.shippingAddress=void 0,this.billingAddress=void 0,this.translatedShippingAddress=void 0,this.translatedBillingAddress=void 0,this.showErrorBanner=!1,this.translatedShippingAddressState={},this.translatedBillingAddressState={}}watchTranslatedShippingAddress(){this.translatedShippingAddressState=this.translatedShippingAddress}watchTranslatedBillingAddress(){this.translatedBillingAddressState=this.translatedBillingAddress}componentWillLoad(){this.watchTranslatedBillingAddress(),this.watchTranslatedShippingAddress()}render(){const s="#ffffff"===(this.submitBtnColor||f.appearance.colorSecondary)?"outline":this.submitBtnType||"standard",o=this.billingAddress,i=this.shippingAddress;return e(t,{key:"655845cef04f4af526b1a1c4e49243c4f2b4c7f6",class:p(["zonos--address-update-dialog zonos--elements",this.isMobile&&"mobile"])},e("zonos-dialog",{key:"eab429bb78ce6f05ba463d8748d7edd5499402fa",isLoading:this.dialogLoading,mobile:this.isMobile,noBodyPadding:!0,noBorder:!0,noClickOutside:!0,noCloseButton:!0,onCloseDialog:()=>this.closeUpdateDialog.emit(),open:this.dialogOpen,width:"568px"},e("div",{key:"08f0400e62addfcaffd91bf5200999d29bbd2da9",class:"zonos--body"},e("div",{key:"8699df5e2f823e19066fbb552ba2a66c127c05e9",class:"zonos--dialog-header"},e("div",{key:"92e0ff932dcdb0e5b59ea34b688d1ef8e31bfeb3",class:"zonos--dialog-title"},e("zonos-text",{key:"aaac3375526bddb319ce7c8f49bde30da7210264",type:"title"},d("Update your address")),e("zonos-button",{key:"66abf7b74045e68e84e631298504236d32ca9c4e",class:"zonos--close-button",icon:e("zonos-icon",{"aria-label":"Close checkout dialog",content:m}),noBackground:!0,onClick:()=>this.closeUpdateDialogHandler()})),e("zonos-text",{key:"ffb3d8f169867d5f6dff269e1becd99c98c5a7da"},d("To ensure delivery all address details must be in Latin characters."))),e("div",{key:"2cb61f06ce174e2317870decfdd337c67c5cf128",class:"zonos--group"},e("zonos-text",{key:"a616c540984120b468e52bccfb380ea3974ced22",class:"zonos--what-you-entered",type:"semiBoldLabel"},d("What you entered")),e("div",{key:"6ac8f9c14472370c501af1b0d50bd8f8746b7694",class:"zonos--address-display-group"},e("zonos-address-display",{key:"ea2c67a7bba51c99f80be968e448beeffcf1f863",addressType:"shipping",currentAddress:i}),o&&e("zonos-address-display",{key:"7ea1683dc04a292810e04ed6550d86086f25186f",addressType:"billing",currentAddress:o})),e("div",{key:"4d1cd9096943518b8b4e267608a5e1542befb6a9",class:"zonos--address-form-section"},e("zonos-text",{key:"e4184a2cc618d26d43979fa8cfe06070cf8b5af8",type:"semiBoldLabel"},d("Translated address")),e("zonos-address-form",{key:"c55d9d3c658565ceb7c7b879f444e3937b9f7ad6",addressType:"shipping",class:"zonos--shipping-address-form",currentAddress:i,onAddressChange:s=>{this.translatedShippingAddressState=this.buildTranslateAddressState({currentAddress:i,translatedAddress:s.detail})},translatedAddress:this.translatedShippingAddressState}),o&&e("zonos-address-form",{key:"c3facc295b1322bb00baa6081f343dcea4f10777",addressType:"billing",class:"zonos--billing-address-form",currentAddress:o,onAddressChange:s=>{this.translatedBillingAddressState=this.buildTranslateAddressState({currentAddress:o,translatedAddress:s.detail})},translatedAddress:this.translatedBillingAddressState}))),e("div",{key:"1c89c9604ba0dece40275fcfac97e7f93706b430",class:"zonos--group-btn"},e("div",{key:"e47d393940b094b4e123864e4070daa87f0616f0",class:"zonos--button-wrapper"},e("zonos-button",{key:"216b7afe268a4acd6bb8a76b7f5a32dc09bdd4f6",class:"zonos--cancel-btn",onClick:()=>this.closeUpdateDialogHandler(),variant:"subtle"},d("Cancel")),e("zonos-button",{key:"acbacb92cedb325b46843d8f3aff13f4e7c86ab5",backgroundColor:this.submitBtnColor,class:"zonos--update-btn",loading:this.continueLoading,onClick:()=>this.continueClickHandler(),size:"sm",variant:s},d("Update address")))))))}get el(){return i(this)}static get watchers(){return{translatedShippingAddress:["watchTranslatedShippingAddress"],translatedBillingAddress:["watchTranslatedBillingAddress"]}}};x.style=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--body{padding:0 24px;position:relative}:host .zonos--dialog-header{margin-bottom:32px;position:-webkit-sticky;position:sticky;padding-top:24px;top:0;z-index:11;background:var(--zonos-elements-gray-0)}:host .zonos--dialog-title{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;margin-bottom:12px}:host .zonos--group{overflow:auto;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:8px;-ms-scroll-chaining:none;overscroll-behavior:contain}:host .zonos--group::-webkit-scrollbar{width:10px}:host .zonos--group::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}:host .zonos--group::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}:host .zonos--group::-webkit-scrollbar-thumb:hover{background:#d6d6d6}:host .zonos--address-display-group{display:-ms-flexbox;display:flex;gap:8px;margin-bottom:20px}:host .zonos--address-display-group zonos-address-display{-ms-flex:1;flex:1}:host .zonos--what-you-entered{margin-bottom:8px}:host .zonos--address-form-section{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:24px}:host .zonos--group-btn{position:-webkit-sticky;position:sticky;padding:24px 0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-pack:end;justify-content:end;background:var(--zonos-elements-gray-0);z-index:11}:host .zonos--group-btn .zonos--button-wrapper{display:-ms-flexbox;display:flex;gap:8px}:host(.mobile) .zonos--button-wrapper{-ms-flex-direction:column;flex-direction:column;width:100%}:host(.mobile) .zonos--button-wrapper zonos-button{width:100%}:host(.mobile) .zonos--button-wrapper .zonos--cancel-btn{-ms-flex-order:2;order:2}:host(.mobile) .zonos--button-wrapper .zonos--update-btn{-ms-flex-order:1;order:1}";const k=["blue","cyan","green","orange","purple","red","gray","glass"],w=class{constructor(e){s(this,e),this.checkboxSelected=o(this,"checkboxSelected",7),this.backgroundColor="blue",this.label=void 0,this.isChecked=!1,this.isDisabled=!1,this.size=12,this.fontSize="base",this.borderStyle=void 0}onClick(){this.isDisabled||this.checkboxSelected.emit(!this.isChecked)}render(){const s=k.includes(this.backgroundColor),o=s?`var(--zonos-elements-${this.backgroundColor}-600)`:this.backgroundColor,i=s?`var(--zonos-elements-${this.backgroundColor}-200)`:z(o)?"var(--zonos-elements-gray-0)":"var(--zonos-elements-gray-800)",n=u({customRoundRadius:"4px",overrideBorderStyle:this.borderStyle});return e(t,{key:"bf51dd642e88096e874d78023a29dd68239e8d3a",class:p(["zonos--elements zonos--checkbox"]),style:{"--background-color":o,"--border-radius":n,"--font-family":b(),"--size":`${this.size}px`}},e("label",{key:"3598c9f21285304499aaafbab5226d619ecf4e69",class:p([this.isDisabled&&"disabled"])},e("input",{key:"277507f643404e6e44191c2d715b70f38fc6af85",checked:this.isChecked,disabled:this.isDisabled,hidden:!0,onChange:s=>{this.checkboxSelected.emit(s.target.checked)},type:"checkbox"}),e("span",{key:"3f0fd0d458e8cf660fa883ceaa241e3397829548",class:"checkmark-container"},e("svg",{key:"0d654744bea5b5696ddcf3778a155fb622022f1e",class:"checkmark",color:i,fill:"none",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e("path",{key:"cc19837ee088feb7053fdaeaea0d1213cbc60775","clip-rule":"evenodd",d:"M17.456 7.404a.75.75 0 0 1 .14 1.052l-6.5 8.5a.75.75 0 0 1-1.126.074l-4-4a.75.75 0 0 1 1.06-1.06l3.395 3.394 5.98-7.82a.75.75 0 0 1 1.05-.14Z",fill:"currentColor","fill-rule":"evenodd"}))),this.label&&e("zonos-text",{key:"cb85d59651f67a33126d37c3ebfb1e8a91b457fe",size:this.fontSize},this.label)))}};w.style=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex;cursor:pointer}:host label{display:-ms-inline-flexbox;display:inline-flex;position:relative;gap:8px;-ms-flex-align:center;align-items:center}:host label.disabled{cursor:not-allowed;opacity:0.6}:host input[type=checkbox]{opacity:0;position:absolute;left:0;width:0;height:0;top:0;z-index:-99999}:host svg{opacity:0}:host .checkmark-container{height:var(--size);width:var(--size);background-color:transparent;border:1.5px solid var(--zonos-elements-gray-400);position:relative;border-radius:var(--border-radius, var(--zonos-elements-radius-4))}:host .checkmark{opacity:0;position:absolute;top:-1.5px;left:-1.5px;right:-1.5px;bottom:-1.5px;width:calc(100% + 3px);-webkit-transition:0.3s all cubic-bezier(0.175, 0.885, 0.32, 1.275);transition:0.3s all cubic-bezier(0.175, 0.885, 0.32, 1.275);-webkit-transform:scale(0.4);transform:scale(0.4);background-color:var(--background-color);border-radius:var(--border-radius, var(--zonos-elements-radius-4))}:host input[type=checkbox]:checked~.checkmark-container .checkmark{opacity:1;-webkit-transform:scale(1);transform:scale(1)}";const A=class{constructor(o){s(this,o),this.collapsed=!1,this.collapseSize=0,this.height=this.el.scrollHeight,this.iframe=null}getElementHeight(){return this.collapsed?`${this.collapseSize}px`:`${this.height}px`}componentDidLoad(){this.height=this.el.scrollHeight}componentDidRender(){var s,o,e;this.iframe=(null===(s=this.el.shadowRoot)||void 0===s?void 0:s.querySelector("iframe"))||null,null===(e=null===(o=this.iframe)||void 0===o?void 0:o.contentWindow)||void 0===e||e.addEventListener("resize",(()=>{this.iframe&&(this.height=parseFloat(getComputedStyle(this.iframe).height))}))}render(){return this.collapsed?this.el.style.overflow="hidden":setTimeout((()=>{this.collapsed||(this.el.style.overflow="visible")}),300),e(t,{key:"7cc2167ab3dab1a975d141f3c58d3c5982c1645a",class:"zonos--elements zonos--collapse",style:{"--font-family":b(),height:this.getElementHeight()}},e("div",{key:"1b791702f95066643ac82402a9fcff19b0fcc706"},e("iframe",{key:"08f678a4ce92f5600c584e329e3039bc4588ff3a",class:"height-change-listener",tabindex:"-1",title:"collapse-height-change-listener"}),e("slot",{key:"83119f9ba9764c46fa7d1dd7b4c0b08c49033607"})))}get el(){return i(this)}};A.style=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{-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}";const C=class{constructor(e){s(this,e),this.closeDialog=o(this,"closeDialog",3),this.isMobileMode=()=>this.mobile||window.innerWidth<=768,this.closeButtonHandler=()=>{this.open&&this.closeDialog.emit()},this.clickOutsideDialogHandler=s=>{s.target!==s.currentTarget||this.noClickOutside||this.closeDialog.emit()},this.open=!1,this.headerText="",this.width="460px",this.height=void 0,this.minHeight=void 0,this.noHeader=!1,this.noBodyPadding=!1,this.noBorder=!1,this.borderStyle=void 0,this.noCloseButton=!1,this.noClickOutside=!1,this.mobile=!1,this.isLoading=!0,this.isMobile=!1}handleWindowResize(){this.isMobile=this.isMobileMode()}handleKeyDown(s){"Escape"===s.key&&this.closeButtonHandler()}componentDidLoad(){this.isMobile=this.isMobileMode()}render(){document.body.style.overflow=this.open?"hidden":"auto";const s=u({overrideBorderStyle:this.borderStyle});return e(t,{key:"03735385e07c7f6c8a87df42ad95f8c9d9533668",class:p(["zonos--elements",this.open&&"open",this.isLoading&&"is-loading",this.noBorder&&"no-border",this.isMobile&&"mobile"]),style:{"--border-radius":s,"--font-family":b(),"--height":this.height||"initial","--min-height":this.minHeight||"500px","--width":this.width}},e("div",{key:"da5d599e1a247f7e3364e6f5c9b2eae3db9539f5",class:"zonos--backdrop"}),e("div",{key:"cda1a996d9521c2e0b307f7a03ca3ee3d4915b8d",class:"zonos--dialog-layout",inert:!this.open,onClick:this.clickOutsideDialogHandler},e("div",{key:"471d8a069d4f580233bdb3e9e971efdb268ef57d",class:"zonos--dialog"},this.isLoading&&e("div",{key:"57220007aabcaef133c2c0782fa238cc43d63964",class:"zonos--loading"},e("zonos-spinner",{key:"0298b754341abd61ec07706128d05df5332f915d",size:30})),(this.headerText||!this.noCloseButton)&&e("div",{key:"5103dbc1c7593a8042505f767d8290825f9d10e7",class:"zonos--header"},this.headerText&&e("h3",{key:"a2d9cd4c8cb359aa64cf104a172ca960068c20a0",class:"zonos--header-text"},this.headerText),!this.noCloseButton&&e("zonos-button",{key:"de9bf8a949344d19fcb8bfb496719282553be194",class:"zonos--close-button",icon:e("zonos-icon",{"aria-label":"Close dialog",content:'<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>'}),noBackground:!0,onClick:this.closeButtonHandler,variant:"subtle"})),e("div",{key:"1ec2cdca0f186cd0b28602580022ed0cb4b0eec9",class:p(["zonos--body",this.noBodyPadding&&"zonos--no-body-padding"])},e("slot",{key:"5071d921f48bf792a951a390d83b121e32771668"})),e("slot",{key:"c1818ac301afc845f5b14fd0f2ac9a1fd3a27b99",name:"dialog-footer"}))))}static get assetsDirs(){return["assets"]}};C.style=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .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:0;top:0;background:var(--zonos-elements-backdrop-color);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:2147483009;background:var(--zonos-elements-gray-0);border-radius:var(--border-radius, var(--zonos-elements-radius-10))}: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(--zonos-elements-text-color);visibility:hidden}:host .zonos--dialog{position:relative;z-index:2147483008;background:var(--zonos-elements-gray-0);max-width:90vw;max-height:90vh;min-height:var(--min-height, auto);height:var(--height, auto);width:var(--width, auto);border-radius:var(--border-radius, var(--zonos-elements-radius-10));outline:none;-webkit-box-shadow:var(--zonos-elements-v3-shadow-xxl);box-shadow:var(--zonos-elements-v3-shadow-xxl);border:var(--zonos-elements-border);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:16px 24px}:host .zonos--header .-zonos-stencil-library--header-text{-ms-flex-positive:1;flex-grow:1}:host .zonos--header .zonos--close-button{width:var(--zonos-elements-size-md);height:var(--zonos-elements-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(--zonos-elements-radius-10);-ms-flex-item-align:start;align-self:flex-start}:host .zonos--header .zonos--close-button:hover{background:var(--zonos-elements-hover-color)}:host .zonos--body{padding:8px 24px;max-height:100%;height:100%;overflow:auto}:host .zonos--body.zonos--no-body-padding{padding:0}:host .zonos--footer{padding:16px 24px}:host(.open) .zonos--dialog-layout,:host(.open) .zonos--backdrop{visibility:visible}:host(.open) .zonos--backdrop{z-index:2147483008;opacity:0.65}:host(.open) .zonos--dialog-layout{opacity:1;z-index:2147483009;-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}";const I=class{constructor(o){s(this,o),this.titleText=void 0,this.defaultEmail=null,this.stripe=n.stripe}watchInitStripe(){if(!this.stripe||!n.stripeElements)return;const s=n.stripeLinkElement||n.stripeElements.create("linkAuthentication",{defaultValues:(this.defaultEmail?{email:this.defaultEmail}:void 0)||void 0}),o=this.el.querySelector(".zonos--link-authentication-component");o?(s.mount(o),s.on("change",(s=>{n.stripeLinkEventData=s})),n.stripeLinkElement=s):r("Cannot find container element for linkAuthenticationElement")}componentDidLoad(){this.watchInitStripe()}render(){return e(t,{key:"f0b26abf99ef99c6665dabdddebc9ff086b6816c",class:"zonos--link-authentication zonos--elements"},e("zonos-text",{key:"898dbdffac06fe2a68af90610a22044bb72391ce",class:"zonos--title",type:"semiBoldLabel"},this.titleText),e("div",{key:"e2ec9abb0cf76a39a1262e1366e375dd898450cd",class:"zonos--link-authentication-component"}))}get el(){return i(this)}static get watchers(){return{stripe:["watchInitStripe"]}}};I.style=".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:16px}";export{y as zonos_address,g as zonos_address_display,v as zonos_address_form,x as zonos_address_update_dialog,w as zonos_checkbox,A as zonos_collapse,C as zonos_dialog,I as zonos_link_authentication}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(r,e,n,o){function t(r){return r instanceof n?r:new n((function(e){e(r)}))}return new(n||(n=Promise))((function(n,a){function i(r){try{u(o.next(r))}catch(r){a(r)}}function s(r){try{u(o["throw"](r))}catch(r){a(r)}}function u(r){r.done?n(r.value):t(r.value).then(i,s)}u((o=o.apply(r,e||[])).next())}))};var __generator=this&&this.__generator||function(r,e){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},o,t,a,i;return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(r){return function(e){return u([r,e])}}function u(s){if(o)throw new TypeError("Generator is already executing.");while(i&&(i=0,s[0]&&(n=0)),n)try{if(o=1,t&&(a=s[0]&2?t["return"]:s[0]?t["throw"]||((a=t["return"])&&a.call(t),0):t.next)&&!(a=a.call(t,s[1])).done)return a;if(t=0,a)s=[s[0]&2,a.value];switch(s[0]){case 0:case 1:a=s;break;case 4:n.label++;return{value:s[1],done:false};case 5:n.label++;t=s[1];s=[0];continue;case 7:s=n.ops.pop();n.trys.pop();continue;default:if(!(a=n.trys,a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){n.label=s[1];break}if(s[0]===6&&n.label<a[1]){n.label=a[1];a=s;break}if(a&&n.label<a[2]){n.label=a[2];n.ops.push(s);break}if(a[2])n.ops.pop();n.trys.pop();continue}s=e.call(r,n)}catch(r){s=[6,r];t=0}finally{o=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(r,e,n){if(n||arguments.length===2)for(var o=0,t=e.length,a;o<t;o++){if(a||!(o in e)){if(!a)a=Array.prototype.slice.call(e,0,o);a[o]=e[o]}}return r.concat(a||Array.prototype.slice.call(e))};System.register([],(function(r){"use strict";return{execute:function(){var e=this;var n=r("l",(function(r,e){var n=[];for(var o=2;o<arguments.length;o++){n[o-2]=arguments[o]}var t,a;var i=!!((t=window.Zonos)===null||t===void 0?void 0:t.debug)||!!window.location.search.match(/\?.*(&*)zonosDebug=1/);if(!i){if(e==="error"){console.error.apply(console,__spreadArray([r],n,false))}return}var s=document.querySelector("iframe#zonos---debug-logging-iframe");if(!s){s=document.createElement("iframe");s.id="zonos---debug-logging-iframe";s.style.display="none";s.style.opacity="0";s.style.position="absolute";s.style.top="-9999px";s.style.left="-9999px";s.style.width="1px";s.style.height="1px";s.style.border="none";s.style.overflow="hidden";s.style.visibility="hidden";document.body.appendChild(s)}var u=((a=s.contentWindow)===null||a===void 0?void 0:a.window.console)||window.console;switch(e){case"warn":u.warn.apply(u,__spreadArray([r],n,false));break;case"info":u.info.apply(u,__spreadArray([r],n,false));break;case"error":u.error.apply(u,__spreadArray([r],n,false));break;default:u.groupCollapsed.apply(u,__spreadArray([r],n,false));u.trace();u.groupEnd();break}}));var o=r("a",(function(r){var e=[];for(var o=1;o<arguments.length;o++){e[o-1]=arguments[o]}n.apply(void 0,__spreadArray([r,"error"],e,false))}));var t=["cloudflare","vercel"];var a=t[0];var i=r("f",{cloudflare:"https://route.elements.zonos.com",vercel:"https://v1.route.js.zonos.com"});var s=i[a];var u=function(r){if(r===void 0){r=a}var e=t.indexOf(r);var n=t[e+1];if(!n){return null}return n};var c=r("j",(function(r){if(typeof r==="string"){try{var e=JSON.parse(r);return e}catch(r){return null}}return null}));var f=1*3600*1e3;var l=r("s",(function(r){return __awaiter(e,[r],void 0,(function(r){var e,n,o,t,a;var c=r.endpoint,l=r.errors,d=r.metadata,v=r.shouldPostReleaseErrorReporting;return __generator(this,(function(r){if(v){e=Number(window.Zonos.releaseDate);n=(new Date).getTime();if(n-e>f){return[2]}}o="userAgentData"in window.navigator?window.navigator.userAgentData:null;t={endpoint:c,errors:l,metadata:Object.assign({href:window.location.href,userAgent:o&&o.brands.length>0?o:window.navigator.userAgent},d)};try{void fetch("".concat(s,"/api/zonos-elements/log-error"),{body:JSON.stringify(t),method:"POST"})}catch(r){a=u();if(!a){return[2]}void fetch("".concat(i[a],"/api/zonos-elements/log-error"),{body:JSON.stringify(t),method:"POST"})}return[2]}))}))}));var d=undefined&&undefined.__rest||function(r,e){var n={};for(var o in r)if(Object.prototype.hasOwnProperty.call(r,o)&&e.indexOf(o)<0)n[o]=r[o];if(r!=null&&typeof Object.getOwnPropertySymbols==="function")for(var t=0,o=Object.getOwnPropertySymbols(r);t<o.length;t++){if(e.indexOf(o[t])<0&&Object.prototype.propertyIsEnumerable.call(r,o[t]))n[o[t]]=r[o[t]]}return n};var v=function(r){return __awaiter(e,[r],void 0,(function(r){var e,n;var o=r.response,t=r.shouldLog,a=t===void 0?true:t,i=r.shouldThrow,s=i===void 0?false:i;return __generator(this,(function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);return[4,o.json()];case 1:e=r.sent();return[2,e];case 2:n=r.sent();if(s){throw n}if(a){console.error(n)}return[2,null];case 3:return[2]}}))}))};var w=function(r){try{var e=btoa(r).replace(/=/g,"");return e}catch(e){return r.replace(/[^A-Za-z0-9]/g,"").split("").reverse().join("")}};var h=function(r){return __awaiter(e,[r],void 0,(function(r){var e,n,o,t,s,u,c,f,l,d,l,u,h,u;var p=r.basePathType,b=r.options,y=r.path;return __generator(this,(function(r){switch(r.label){case 0:n=i[p]||a;o=n+y;t=new URL(o);t.searchParams.set("zToken",w(window.location.hostname));r.label=1;case 1:r.trys.push([1,3,,4]);return[4,fetch(t.toString(),b)];case 2:e=r.sent();return[3,4];case 3:s=r.sent();if(s instanceof Error){return[2,{baseUrl:n,errors:[{message:s.message,type:"unknown"}],json:null,response:null,zonosMode:null}]}u="Fail to fetch";return[2,{baseUrl:n,errors:[{message:u,type:"unknown"}],json:null,response:null,zonosMode:null}];case 4:c=e.headers.get("Zonos-Mode");f=window.Zonos.zonosQaUrl;if(!window.Zonos.modeAlerted&&c&&f){window.Zonos.modeAlerted=true}if(!e.ok)return[3,6];return[4,v({response:e})];case 5:l=r.sent();return[2,{baseUrl:n,errors:[],json:l,response:e,zonosMode:c}];case 6:d=e.status.toString();r.label=7;case 7:r.trys.push([7,9,,10]);return[4,v({response:e,shouldThrow:true})];case 8:l=r.sent();u=JSON.stringify(l);return[2,{baseUrl:n,errors:[{message:u,type:d}],json:null,response:e,zonosMode:c}];case 9:h=r.sent();u="Unknown error";return[2,{baseUrl:n,errors:[{message:"".concat(d,": ").concat(u),type:d}],json:null,response:null,zonosMode:c}];case 10:return[2]}}))}))};var p=function(r){return __awaiter(e,[r],void 0,(function(r){var e,o,t,a,s,f,v,w,b,y,_,m;var g=r.basePathType,k=r.options,j=r.path;return __generator(this,(function(r){switch(r.label){case 0:t=j.startsWith("/api/bigcommerce");a=t?"vercel":g;return[4,h({basePathType:a,options:k,path:j})];case 1:s=r.sent(),f=s.errors,v=s.response,w=d(s,["errors","response"]);b=u(a);y=f.find((function(r){var e=r.type;return e==="unknown"}));_=!!y||(v===null||v===void 0?void 0:v.status)===404;m=b&&_;if(_){void l({endpoint:i[a]+j,errors:f.map((function(r){var e=r.message;return e})),metadata:{currentBasePath:a,nextFallbackApiType:b,requestHeaders:k===null||k===void 0?void 0:k.headers,requestPayload:c((e=k===null||k===void 0?void 0:k.body)===null||e===void 0?void 0:e.toString())||((o=k===null||k===void 0?void 0:k.body)===null||o===void 0?void 0:o.toString()),status:v===null||v===void 0?void 0:v.status,statusText:v===null||v===void 0?void 0:v.statusText},shouldPostReleaseErrorReporting:true})}if(m){n('=== "'.concat(j,'" failed to fetch, trying next fallback ').concat(b));return[2,p({basePathType:b,options:k,path:j})]}return[2,Object.assign({errors:f,response:v},w)]}}))}))};var b=r("h",(function(r,n){return __awaiter(e,void 0,void 0,(function(){var e,o,t,i,s,u;return __generator(this,(function(c){e=d(n||{},[]);o=e.body?JSON.stringify(e.body):undefined;t=e.method||"GET";i=Object.assign({"Content-Type":"application/json","Zonos-Is-BigCommerce":window.Zonos.isBigCommerce.toString(),"Zonos-Referer":window.location.hostname,"Zonos-Version":window.Zonos.version,credentialtoken:window.Zonos.zonosApiKey||"Empty credential token from zonos-elements"},e.headers);s=Object.assign(Object.assign({},e),{body:t==="GET"?undefined:o,headers:i,method:t});u=new URLSearchParams(window.location.search).get("useFallbackApi");return[2,p({basePathType:u||a,options:s,path:r})]}))}))}))}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["./p-fd061229.system.js","./p-
|
|
1
|
+
System.register(["./p-fd061229.system.js","./p-8f7773b0.system.js","./p-8e8defdc.system.js","./p-23e7c655.system.js","./p-a74a7afa.system.js","./p-29814fd7.system.js","./p-e97793ce.system.js"],(function(t){"use strict";var s,e,n,o,i,a,h;return{setters:[function(t){s=t.r;e=t.h;n=t.H;o=t.d},function(t){i=t.l},function(t){a=t.d},function(t){h=t.c},function(){},function(){},function(){}],execute:function(){var r=":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 .flag-container{position:relative;overflow:hidden;width:100%;height:100%}:host .flag-icon{position:absolute;top:0;left:0;width:100%;height:100%;background-position:center;background-repeat:no-repeat;background-size:cover}";var f=r;var l="https://zonos-store-assets.s3.amazonaws.com/images/elements-flags";var c=t("zonos_country_flag",function(){function t(t){s(this,t);this.countryCode=i.selectedCountryCode;this.size=undefined}t.prototype.render=function(){if(!this.el.shadowRoot||!this.countryCode){return null}var t="".concat(l,"/").concat(this.countryCode,".svg");var s=a();return e(n,{class:"zonos--elements",style:this.size?{"--font-family":s,height:"".concat(this.size,"px"),width:"".concat(this.size,"px")}:{"--font-family":s}},e("div",{class:h(["flag-container"])},e("div",{class:"flag-icon",style:{backgroundImage:"url(".concat(t,")")}})))};Object.defineProperty(t.prototype,"el",{get:function(){return o(this)},enumerable:false,configurable:true});return t}());c.style=f}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,h as e,H as t}from"./p-5b7da777.js";import{_ as s,e as i,i as n,f as l,z as r,g as a,m as h}from"./p-9dd6b00d.js";import{x as d,l as c,z as m,t as f,B as p,C as g,D as u,E as w,F as z,G as b}from"./p-d413cd13.js";import{c as v}from"./p-b4b7f705.js";import{a as x,l as y}from"./p-eaa335e1.js";import{g as k}from"./p-5883217a.js";import"./p-23a84835.js";import"./p-f05f3e27.js";var L=s,C=/\s/,T=/^\s+/,O=i,E=n,D=function(o){return o?o.slice(0,function(o){for(var e=o.length;e--&&C.test(o.charAt(e)););return e}(o)+1).replace(T,""):o},S=l,I=/^[-+]0x[0-9a-f]+$/i,j=/^0b[01]+$/i,A=/^0o[0-7]+$/i,B=parseInt,F=l,X=function(){return L.Date.now()},H=function(o){if("number"==typeof o)return o;if(function(o){return"symbol"==typeof o||E(o)&&"[object Symbol]"==O(o)}(o))return NaN;if(S(o)){var e="function"==typeof o.valueOf?o.valueOf():o;o=S(e)?e+"":e}if("string"!=typeof o)return 0===o?o:+o;o=D(o);var t=j.test(o);return t||A.test(o)?B(o.slice(2),t?2:8):I.test(o)?NaN:+o},N=Math.max,M=Math.min;const P=o=>{const e=null==o?void 0:o.replace("www.","").replace("https://","");return e&&new RegExp(e).test(window.location.href)},R=()=>{var o,e;const{productAddToCartElementSelector:t,productDescriptionElementSelector:s,productTitleElementSelector:i,restrictionBehavior:n}=r.helloSettings;i&&s||x("Hello Could not check item restrictions - must provide title and description selectors.");const l=i&&m(i)&&document.querySelectorAll(i)||[],a=s&&m(s)&&document.querySelectorAll(s)||[];if(l.length!==a.length)return x("Hello Could not check item restrictions - Title and description selectors do not match"),[];const h="RESTRICT_AND_BLOCK"===n,d=h&&t&&m(t)&&document.querySelectorAll(t)||[];h&&d.length!==a.length&&x('Hello could not disable "Add to cart" buttons - Title and add to cart selectors do not match');const c=[];for(let t=0;t<l.length;t++){const s=l[t],i=a[t];if(s&&i){const n={cartButtonNode:d[t]||null,description:(null===(o=i.textContent)||void 0===o?void 0:o.trim())||"",title:(null===(e=s.textContent)||void 0===e?void 0:e.trim())||""};c.push(n)}}return c},$=class{constructor(e){o(this,e),this.getHelloPeekMessage=o=>{if(("productDetail"===r.currentHelloPage||"productList"===r.currentHelloPage)&&this.allRestrictedItems.length){const o=f("click to learn more");return`${f("productDetail"===r.currentHelloPage?"Restricted item":"Restricted items found")} - ${o}`}switch(r.currentHelloPage){case"cart":return f("Prepay duties and taxes at checkout");case"productList":case"productDetail":return f("See duty and tax thresholds");default:return f("Welcome to [storeName]",{storeName:o})}},this.enableShowPeekMessage=()=>{this.peekMessage&&(this.showPeekMessage=!0)},this.getNewItemRestrictions=async o=>"productDetail"!==r.currentHelloPage&&"productList"!==r.currentHelloPage||"DISABLED"===r.helloSettings.restrictionBehavior?[]:await(async o=>{if(!o.length)return[];const{selectedCountryCode:e}=c;if(!e)return x("Hello Could not check item restrictions - No country code selected"),[];const t=o.map((o=>({description:o.description,name:o.title})));return(await(async({items:o,shipFrom:e,shipTo:t})=>{var s;const i={items:o,shipFrom:e,shipTo:t},{errors:n,json:l}=await d("/api/zonos-elements/check-item-restrictions",{body:i,method:"POST"});return n.length||!l?(x(`Error fetching item restrictions: ${null===(s=n.find(Boolean))||void 0===s?void 0:s.message}`),[]):l.filter(Boolean)})({items:t,shipFrom:"AD",shipTo:e})).map((o=>{var e;const s=(null===(e=t.filter((e=>e.description===o.itemDescription)).find(Boolean))||void 0===e?void 0:e.name)||"";return Object.assign(Object.assign({},o),{name:s})}))})(o),this.triggerShowPeekMessage=()=>{this.peekMessage=this.getHelloPeekMessage(r.organizationName);const{peekMessageBehavior:o,peekMessageDelay:e}=r.helloSettings;"ENABLED"===o&&setTimeout((()=>{this.enableShowPeekMessage(),this.allRestrictedItems.some((o=>this.productsOnPage.some((e=>e.description===o.itemDescription))))||setTimeout((()=>{this.showPeekMessage=!1}),3e3)}),1e3*e)},this.disableAddToCartButtons=()=>{this.productsOnPage.length&&this.productsOnPage.forEach((o=>{var e,t;this.allRestrictedItems.some((e=>e.itemDescription===o.description))?null===(e=o.cartButtonNode)||void 0===e||e.setAttribute("disabled","disabled"):null===(t=o.cartButtonNode)||void 0===t||t.removeAttribute("disabled")}))},this.handleItemRestrictions=async()=>{this.productsOnPage=R();const o=this.productsOnPage.filter((o=>!this.allFoundProducts.some((e=>e.title===o.title)))),e=await this.getNewItemRestrictions(o);this.allRestrictedItems.push(...e),this.allFoundProducts.push(...o),this.disableAddToCartButtons()},this.reloadHelloData=async()=>{await this.handleItemRestrictions(),this.triggerShowPeekMessage()},this.handleProductCountChange=function(o,e,t){var s,i,n,l,r,a,h=0,d=!1,c=!1,m=!0;if("function"!=typeof o)throw new TypeError("Expected a function");function f(e){var t=s,n=i;return s=i=void 0,h=e,l=o.apply(n,t)}function p(o){var t=o-a;return void 0===a||t>=e||t<0||c&&o-h>=n}function g(){var o=X();if(p(o))return u(o);r=setTimeout(g,function(o){var t=e-(o-a);return c?M(t,n-(o-h)):t}(o))}function u(o){return r=void 0,m&&s?f(o):(s=i=void 0,l)}function w(){var o=X(),t=p(o);if(s=arguments,i=this,a=o,t){if(void 0===r)return function(o){return h=o,r=setTimeout(g,e),d?f(o):l}(a);if(c)return clearTimeout(r),r=setTimeout(g,e),f(a)}return void 0===r&&(r=setTimeout(g,e)),l}return e=H(e)||0,F(t)&&(d=!!t.leading,n=(c="maxWait"in t)?N(H(t.maxWait)||0,e):n,m="trailing"in t?!!t.trailing:m),w.cancel=function(){void 0!==r&&clearTimeout(r),h=0,s=a=i=r=void 0},w.flush=function(){return void 0===r?l:u(X())},w}((()=>{const{productTitleElementSelector:o}=r.helloSettings;if(o){const o=R();if(this.allFoundProducts.length!==o.length&&window.location.href===this.initialUrl){if(!this.allFoundProducts.length)return;this.reloadHelloData()}}}),1e3),this.watchProductCountChange=()=>{new MutationObserver(this.handleProductCountChange).observe(document.body,{childList:!0,subtree:!0})},this.watchPriceChange=()=>{new MutationObserver((()=>{this.displayCurrency()})).observe(document.body,{attributes:!0,childList:!0,subtree:!0})},this.updateHelloOnPageChange=()=>{this.watchProductCountChange(),setInterval((()=>{if(window.location.href!==this.initialUrl){const o=this.initialUrl&&new URL(this.initialUrl);(o&&p(o.searchParams))!==c.selectedCountryCode&&(this.allFoundProducts=[],this.allRestrictedItems=[],this.productsOnPage=[]),this.initialUrl=window.location.href,r.currentHelloPage=(()=>{const{cartUrlPattern:o,homepageUrlPattern:e,productDetailUrlPattern:t,productListUrlPattern:s}=r.helloSettings;return P(o)?"cart":P(t)?"productDetail":P(s)?"productList":P(e)?"home":""})();const e=new URL(window.location.href);if(!p(e.searchParams))return void g(c.selectedCountryCode);this.reloadHelloData()}}),1e3)},this.changeShowDialog=o=>{this.showDialog=o},this.shouldAnimateLeftDesktop=()=>{const o=this.helloRef&&getComputedStyle(this.helloRef).position;if(this.helloRef&&"relative"===o)return k(this.helloRef)},this.shouldRenderHello=(o=!0)=>{if(!c.localizationLoaded)return!1;const{showForCountries:e}=r.helloSettings;return o&&(c.isShippableCountry||y(`Hello: not shippable country - Show for countries: ${e}`)),"ONLY_SHIPPABLE"===e?c.isShippableCountry:"ALL"===e||(null==e?void 0:e.includes(c.selectedCountryCode||""))},this.mobileLocationOverride=void 0,this.animateFromLeftOverride=void 0,this.appearanceSettingsOverride=void 0,this.showPeekMessage=!1,this.zonosStoreHelloSettings=r.helloSettings,this.showDialog=!1,this.peekMessage="",this.initialUrl="",this.allRestrictedItems=[],this.allFoundProducts=[],this.productsOnPage=[],this.isHelloWidgetRendered=!1,this.isMobile=!1}async getCountryList(){return c.helloCountryList}componentWillLoad(){const o=setInterval((async()=>{this.helloRef&&r.loadedConfig&&(this.helloRef.setAttribute("data-zonos-hello-loaded",""),this.updateHelloOnPageChange(),this.watchPriceChange(),this.handleAppearanceSettingsOverrideChange(),clearInterval(o))}),100)}async displayCurrency(){"DISABLED"!==r.helloSettings.currencyBehavior&&(c.exchangeRate?u():y("Could not display currency. Exchange rate and format data is not available.","warn"))}async convertAndFormat(o){return w(o)}async convert(o){return z(o)}async format(o){return b({amount:o})}async openHelloDialog(o){this.changeShowDialog(o)}handleResize(){this.isMobile=window.innerWidth<=768}handleHelloWidgetInitializedState({countryCode:o,currencyCode:e}){var t,s;this.isHelloWidgetRendered||c.selectedCountryCode&&"function"==typeof r.helloSettings.onInitSuccess&&(this.isHelloWidgetRendered=!0,null===(s=(t=r.helloSettings).onInitSuccess)||void 0===s||s.call(t,{countryCode:o,currencyCode:e}))}getHelloLocation(){const o=this.mobileLocationOverride||r.helloSettings.mobileLocation,e=r.helloSettings.desktopLocation,t=this.isMobile;if(!0===t)return{isMobileWindow:t,isOnLeft:this.animateFromLeftOverride||(null==o?void 0:o.includes("LEFT")),isOnTop:null==o?void 0:o.includes("TOP"),shouldFloat:!!o};{const o=!r.helloSettings.anchorElementSelector&&!!e;return{isMobileWindow:t,isOnLeft:this.animateFromLeftOverride||(null==e?void 0:e.includes("LEFT"))||this.shouldAnimateLeftDesktop(),isOnTop:null==e?void 0:e.includes("TOP"),shouldFloat:o}}}handleAppearanceSettingsOverrideChange(){var o;(null===(o=this.appearanceSettingsOverride)||void 0===o?void 0:o.theme)&&(this.appearanceSettingsOverride.theme=a(this.appearanceSettingsOverride.theme))}componentDidLoad(){this.isMobile=window.innerWidth<=768}render(){var o,s;if(null===(o=r.helloSettings.excludedUrlPatterns)||void 0===o?void 0:o.some((o=>new RegExp(o).test(window.location.href))))return y("Hello is excluded on this url","warn"),null;const{selectedCountryCode:i,targetCurrency:n}=c,{isOnLeft:l,isOnTop:a,shouldFloat:d}=this.getHelloLocation(),m=h(r.appearance,this.appearanceSettingsOverride),{theme:f}=m,p=null===(s=this.allRestrictedItems)||void 0===s?void 0:s.filter((o=>this.productsOnPage.some((e=>e.description===o.itemDescription))));this.peekMessage=this.getHelloPeekMessage(r.organizationName);const g=this.shouldRenderHello()&&!!i;return g&&!this.isHelloWidgetRendered&&this.handleHelloWidgetInitializedState({countryCode:i,currencyCode:n}),e(t,{class:"zonos--hello zonos--elements","data-theme":f},g&&e("div",{class:v(["zonos--hello-wrapper",d&&"zonos--hello-widget-float"])},e("button",{class:v(["zonos--hello-widget",this.showPeekMessage&&"zonos--hello-show-peek-message",this.mobileLocationOverride&&"zonos--hello-mobile-override",l&&"zonos--hello-widget-left zonos--hello-widget-animate-from-left",a&&"zonos--hello-widget-top",!!this.allRestrictedItems.length&&"zonos--hello-has-restrictions",d&&"zonos--hello-widget-float"]),onClick:()=>{this.changeShowDialog(!this.showDialog)},onMouseEnter:()=>this.enableShowPeekMessage(),onMouseLeave:()=>this.showPeekMessage=!1,ref:o=>o&&(this.helloRef=o)},e("zonos-text",{class:"zonos--hello-message"},this.peekMessage),i&&e("div",{class:"zonos--hello-country-flag-wrapper"},e("zonos-country-flag",{class:"zonos--hello-country-flag",countryCode:i}))),e("div",{class:v(["zonos--hello-dialog-wrapper",this.mobileLocationOverride&&"zonos--hello-dialog-wrapper-mobile-override",d&&"zonos--hello-widget-float"]),style:{height:this.showDialog?"fit-content":"0px"}},e("zonos-hello-dialog",{animateFromLeftOverride:this.animateFromLeftOverride,appearanceSettings:m,isOpen:this.showDialog,mobileLocationOverride:this.mobileLocationOverride,restrictedItems:p,setIsOpen:this.changeShowDialog}))))}static get watchers(){return{appearanceSettingsOverride:["handleAppearanceSettingsOverrideChange"]}}};$.style=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:inline-block}:host .zonos--hello-wrapper{position:relative}:host .zonos--hello-wrapper .zonos--hello-dialog-wrapper-mobile-override{position:fixed;bottom:0;left:0;width:100vw;z-index:1001;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}@media (max-width: 768px){:host .zonos--hello-wrapper .zonos--hello-dialog-wrapper{position:fixed;bottom:0;left:0;width:100vw;z-index:1001;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}}:host .zonos--hello-widget{-webkit-transition:all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);transition:all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);padding:6px;border-radius:30px;background:var(--zonos-elements-page-background);font-size:var(--zonos-elements-font-size-s);border:var(--zonos-elements-border);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;cursor:pointer;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;position:relative;z-index:1000}:host .zonos--hello-widget>.zonos--hello-message{-ms-flex-order:0;order:0;max-width:0;height:100%;white-space:nowrap;-webkit-transition:border 0.3s ease-in, all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);transition:border 0.3s ease-in, all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);overflow:hidden;color:var(--zonos-elements-text-color);position:absolute;background:var(--zonos-elements-page-background);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-top-left-radius:30px;border-bottom-left-radius:30px;left:0;-webkit-transform:translateX(calc(-100% + 16px));transform:translateX(calc(-100% + 16px));width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border-top:var(--zonos-elements-border);border-bottom:var(--zonos-elements-border)}:host .zonos--hello-widget.zonos--hello-has-restrictions{background:var(--zonos-elements-red-100);border:1px solid var(--zonos-elements-red-200)}:host .zonos--hello-widget.zonos--hello-has-restrictions>.zonos--hello-message{background:var(--zonos-elements-red-100);color:var(--zonos-elements-red-800);font-weight:500}:host .zonos--hello-widget.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:1px solid var(--zonos-elements-red-200)}:host .zonos--hello-widget.zonos--hello-show-peek-message{max-width:100vw;width:100%}:host .zonos--hello-widget.zonos--hello-show-peek-message>.zonos--hello-message{max-width:100vw;padding:0 6px;padding-right:16px;border:var(--zonos-elements-border)}:host .zonos--hello-widget.zonos--hello-show-peek-message:not(.zonos--hello-widget-animate-from-left)>.zonos--hello-message{border-right:none}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{border-left:0}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:16px;padding-right:6px;border-left:none}:host .zonos--hello-widget.zonos--hello-widget-animate-from-left>.zonos--hello-message{-ms-flex-order:1;order:1;-webkit-transform:translateX(calc(100% - 16px));transform:translateX(calc(100% - 16px));right:0;left:auto;border-top-right-radius:30px;border-bottom-right-radius:30px}:host .zonos--hello-widget .zonos--hello-country-flag-wrapper{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}:host .zonos--hello-widget .zonos--hello-country-flag-wrapper .zonos--hello-country-flag{height:18px;width:18px;position:relative;overflow:hidden;border-radius:30px;-webkit-box-shadow:var(--zonos-elements-v3-shadow-medium);box-shadow:var(--zonos-elements-v3-shadow-medium);z-index:10;justify-self:center}:host .zonos--hello-widget.zonos--hello-widget-float{position:fixed;bottom:72px;right:32px}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-left{left:32px;right:auto}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-top{bottom:auto;top:32px}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:none}:host .zonos--hello-widget.zonos--hello-widget-float>.zonos--hello-message{position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-radius:30px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;top:0;bottom:0;left:0;-webkit-transform:translateX(0);transform:translateX(0);width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border:none}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-animate-from-left>.zonos--hello-message{-webkit-transform:translateX(0);transform:translateX(0)}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:8px;padding-right:4px}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message>.zonos--hello-message{padding:0 var(--zonos-elements-radius-4);padding-right:6px;border:none}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float{position:fixed;bottom:72px;right:32px}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-left{left:32px;right:auto}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-top{bottom:auto;top:32px}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:none}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float>.zonos--hello-message{position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-radius:30px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;top:0;bottom:0;left:0;-webkit-transform:translateX(0);transform:translateX(0);width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border:none}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-animate-from-left>.zonos--hello-message{-webkit-transform:translateX(0);transform:translateX(0)}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:8px;padding-right:4px}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message>.zonos--hello-message{padding:0 var(--zonos-elements-radius-4);padding-right:6px;border:none}";export{$ as zonos_hello}
|
|
1
|
+
import{r as o,h as e,H as t}from"./p-5b7da777.js";import{_ as s,e as i,i as n,f as l,z as r,g as h,m as a}from"./p-9dd6b00d.js";import{l as d,w as c,t as m,y as f,z as p,A as g,B as w,C as u,D as z}from"./p-895fdefb.js";import{c as b}from"./p-b4b7f705.js";import{h as v,a as x,l as y}from"./p-4146feec.js";import{g as k}from"./p-5883217a.js";import"./p-23a84835.js";import"./p-f05f3e27.js";var L=s,C=/\s/,T=/^\s+/,O=i,E=n,D=function(o){return o?o.slice(0,function(o){for(var e=o.length;e--&&C.test(o.charAt(e)););return e}(o)+1).replace(T,""):o},S=l,I=/^[-+]0x[0-9a-f]+$/i,j=/^0b[01]+$/i,A=/^0o[0-7]+$/i,B=parseInt,X=l,F=function(){return L.Date.now()},H=function(o){if("number"==typeof o)return o;if(function(o){return"symbol"==typeof o||E(o)&&"[object Symbol]"==O(o)}(o))return NaN;if(S(o)){var e="function"==typeof o.valueOf?o.valueOf():o;o=S(e)?e+"":e}if("string"!=typeof o)return 0===o?o:+o;o=D(o);var t=j.test(o);return t||A.test(o)?B(o.slice(2),t?2:8):I.test(o)?NaN:+o},N=Math.max,M=Math.min;const P=o=>{const e=null==o?void 0:o.replace("www.","").replace("https://","");return e&&new RegExp(e).test(window.location.href)},R=()=>{var o,e;const{productAddToCartElementSelector:t,productDescriptionElementSelector:s,productTitleElementSelector:i,restrictionBehavior:n}=r.helloSettings;i&&s||x("Hello Could not check item restrictions - must provide title and description selectors.");const l=i&&c(i)&&document.querySelectorAll(i)||[],h=s&&c(s)&&document.querySelectorAll(s)||[];if(l.length!==h.length)return x("Hello Could not check item restrictions - Title and description selectors do not match"),[];const a="RESTRICT_AND_BLOCK"===n,d=a&&t&&c(t)&&document.querySelectorAll(t)||[];a&&d.length!==h.length&&x('Hello could not disable "Add to cart" buttons - Title and add to cart selectors do not match');const m=[];for(let t=0;t<l.length;t++){const s=l[t],i=h[t];if(s&&i){const n={cartButtonNode:d[t]||null,description:(null===(o=i.textContent)||void 0===o?void 0:o.trim())||"",title:(null===(e=s.textContent)||void 0===e?void 0:e.trim())||""};m.push(n)}}return m},$=class{constructor(e){o(this,e),this.getHelloPeekMessage=o=>{if(("productDetail"===r.currentHelloPage||"productList"===r.currentHelloPage)&&this.allRestrictedItems.length){const o=m("click to learn more");return`${m("productDetail"===r.currentHelloPage?"Restricted item":"Restricted items found")} - ${o}`}switch(r.currentHelloPage){case"cart":return m("Prepay duties and taxes at checkout");case"productList":case"productDetail":return m("See duty and tax thresholds");default:return m("Welcome to [storeName]",{storeName:o})}},this.enableShowPeekMessage=()=>{this.peekMessage&&(this.showPeekMessage=!0)},this.getNewItemRestrictions=async o=>"productDetail"!==r.currentHelloPage&&"productList"!==r.currentHelloPage||"DISABLED"===r.helloSettings.restrictionBehavior?[]:await(async o=>{if(!o.length)return[];const{selectedCountryCode:e}=d;if(!e)return x("Hello Could not check item restrictions - No country code selected"),[];const t=o.map((o=>({description:o.description,name:o.title})));return(await(async({items:o,shipFrom:e,shipTo:t})=>{var s;const i={items:o,shipFrom:e,shipTo:t},{errors:n,json:l}=await v("/api/zonos-elements/check-item-restrictions",{body:i,method:"POST"});return n.length||!l?(x(`Error fetching item restrictions: ${null===(s=n.find(Boolean))||void 0===s?void 0:s.message}`),[]):l.filter(Boolean)})({items:t,shipFrom:"AD",shipTo:e})).map((o=>{var e;const s=(null===(e=t.filter((e=>e.description===o.itemDescription)).find(Boolean))||void 0===e?void 0:e.name)||"";return Object.assign(Object.assign({},o),{name:s})}))})(o),this.triggerShowPeekMessage=()=>{this.peekMessage=this.getHelloPeekMessage(r.organizationName);const{peekMessageBehavior:o,peekMessageDelay:e}=r.helloSettings;"ENABLED"===o&&setTimeout((()=>{this.enableShowPeekMessage(),this.allRestrictedItems.some((o=>this.productsOnPage.some((e=>e.description===o.itemDescription))))||setTimeout((()=>{this.showPeekMessage=!1}),3e3)}),1e3*e)},this.disableAddToCartButtons=()=>{this.productsOnPage.length&&this.productsOnPage.forEach((o=>{var e,t;this.allRestrictedItems.some((e=>e.itemDescription===o.description))?null===(e=o.cartButtonNode)||void 0===e||e.setAttribute("disabled","disabled"):null===(t=o.cartButtonNode)||void 0===t||t.removeAttribute("disabled")}))},this.handleItemRestrictions=async()=>{this.productsOnPage=R();const o=this.productsOnPage.filter((o=>!this.allFoundProducts.some((e=>e.title===o.title)))),e=await this.getNewItemRestrictions(o);this.allRestrictedItems.push(...e),this.allFoundProducts.push(...o),this.disableAddToCartButtons()},this.reloadHelloData=async()=>{await this.handleItemRestrictions(),this.triggerShowPeekMessage()},this.handleProductCountChange=function(o,e,t){var s,i,n,l,r,h,a=0,d=!1,c=!1,m=!0;if("function"!=typeof o)throw new TypeError("Expected a function");function f(e){var t=s,n=i;return s=i=void 0,a=e,l=o.apply(n,t)}function p(o){var t=o-h;return void 0===h||t>=e||t<0||c&&o-a>=n}function g(){var o=F();if(p(o))return w(o);r=setTimeout(g,function(o){var t=e-(o-h);return c?M(t,n-(o-a)):t}(o))}function w(o){return r=void 0,m&&s?f(o):(s=i=void 0,l)}function u(){var o=F(),t=p(o);if(s=arguments,i=this,h=o,t){if(void 0===r)return function(o){return a=o,r=setTimeout(g,e),d?f(o):l}(h);if(c)return clearTimeout(r),r=setTimeout(g,e),f(h)}return void 0===r&&(r=setTimeout(g,e)),l}return e=H(e)||0,X(t)&&(d=!!t.leading,n=(c="maxWait"in t)?N(H(t.maxWait)||0,e):n,m="trailing"in t?!!t.trailing:m),u.cancel=function(){void 0!==r&&clearTimeout(r),a=0,s=h=i=r=void 0},u.flush=function(){return void 0===r?l:w(F())},u}((()=>{const{productTitleElementSelector:o}=r.helloSettings;if(o){const o=R();if(this.allFoundProducts.length!==o.length&&window.location.href===this.initialUrl){if(!this.allFoundProducts.length)return;this.reloadHelloData()}}}),1e3),this.watchProductCountChange=()=>{new MutationObserver(this.handleProductCountChange).observe(document.body,{childList:!0,subtree:!0})},this.watchPriceChange=()=>{new MutationObserver((()=>{this.displayCurrency()})).observe(document.body,{attributes:!0,childList:!0,subtree:!0})},this.updateHelloOnPageChange=()=>{this.watchProductCountChange(),setInterval((()=>{if(window.location.href!==this.initialUrl){const o=this.initialUrl&&new URL(this.initialUrl);(o&&f(o.searchParams))!==d.selectedCountryCode&&(this.allFoundProducts=[],this.allRestrictedItems=[],this.productsOnPage=[]),this.initialUrl=window.location.href,r.currentHelloPage=(()=>{const{cartUrlPattern:o,homepageUrlPattern:e,productDetailUrlPattern:t,productListUrlPattern:s}=r.helloSettings;return P(o)?"cart":P(t)?"productDetail":P(s)?"productList":P(e)?"home":""})();const e=new URL(window.location.href);if(!f(e.searchParams))return void p(d.selectedCountryCode);this.reloadHelloData()}}),1e3)},this.changeShowDialog=o=>{this.showDialog=o},this.shouldAnimateLeftDesktop=()=>{const o=this.helloRef&&getComputedStyle(this.helloRef).position;if(this.helloRef&&"relative"===o)return k(this.helloRef)},this.shouldRenderHello=(o=!0)=>{if(!d.localizationLoaded)return!1;const{showForCountries:e}=r.helloSettings;return o&&(d.isShippableCountry||y(`Hello: not shippable country - Show for countries: ${e}`)),"ONLY_SHIPPABLE"===e?d.isShippableCountry:"ALL"===e||(null==e?void 0:e.includes(d.selectedCountryCode||""))},this.mobileLocationOverride=void 0,this.animateFromLeftOverride=void 0,this.appearanceSettingsOverride=void 0,this.showPeekMessage=!1,this.zonosStoreHelloSettings=r.helloSettings,this.showDialog=!1,this.peekMessage="",this.initialUrl="",this.allRestrictedItems=[],this.allFoundProducts=[],this.productsOnPage=[],this.isHelloWidgetRendered=!1,this.isMobile=!1}async getCountryList(){return d.helloCountryList}componentWillLoad(){const o=setInterval((async()=>{this.helloRef&&r.loadedConfig&&(this.helloRef.setAttribute("data-zonos-hello-loaded",""),this.updateHelloOnPageChange(),this.watchPriceChange(),this.handleAppearanceSettingsOverrideChange(),clearInterval(o))}),100)}async displayCurrency(){"DISABLED"!==r.helloSettings.currencyBehavior&&(d.exchangeRate?g():y("Could not display currency. Exchange rate and format data is not available.","warn"))}async convertAndFormat(o){return w(o)}async convert(o){return u(o)}async format(o){return z({amount:o})}async openHelloDialog(o){this.changeShowDialog(o)}handleResize(){this.isMobile=window.innerWidth<=768}handleHelloWidgetInitializedState({countryCode:o,currencyCode:e}){var t,s;this.isHelloWidgetRendered||d.selectedCountryCode&&"function"==typeof r.helloSettings.onInitSuccess&&(this.isHelloWidgetRendered=!0,null===(s=(t=r.helloSettings).onInitSuccess)||void 0===s||s.call(t,{countryCode:o,currencyCode:e}))}getHelloLocation(){const o=this.mobileLocationOverride||r.helloSettings.mobileLocation,e=r.helloSettings.desktopLocation,t=this.isMobile;if(!0===t)return{isMobileWindow:t,isOnLeft:this.animateFromLeftOverride||(null==o?void 0:o.includes("LEFT")),isOnTop:null==o?void 0:o.includes("TOP"),shouldFloat:!!o};{const o=!r.helloSettings.anchorElementSelector&&!!e;return{isMobileWindow:t,isOnLeft:this.animateFromLeftOverride||(null==e?void 0:e.includes("LEFT"))||this.shouldAnimateLeftDesktop(),isOnTop:null==e?void 0:e.includes("TOP"),shouldFloat:o}}}handleAppearanceSettingsOverrideChange(){var o;(null===(o=this.appearanceSettingsOverride)||void 0===o?void 0:o.theme)&&(this.appearanceSettingsOverride.theme=h(this.appearanceSettingsOverride.theme))}componentDidLoad(){this.isMobile=window.innerWidth<=768}render(){var o,s;if(null===(o=r.helloSettings.excludedUrlPatterns)||void 0===o?void 0:o.some((o=>new RegExp(o).test(window.location.href))))return y("Hello is excluded on this url","warn"),null;const{selectedCountryCode:i,targetCurrency:n}=d,{isOnLeft:l,isOnTop:h,shouldFloat:c}=this.getHelloLocation(),m=a(r.appearance,this.appearanceSettingsOverride),{theme:f}=m,p=null===(s=this.allRestrictedItems)||void 0===s?void 0:s.filter((o=>this.productsOnPage.some((e=>e.description===o.itemDescription))));this.peekMessage=this.getHelloPeekMessage(r.organizationName);const g=this.shouldRenderHello()&&!!i;return g&&!this.isHelloWidgetRendered&&this.handleHelloWidgetInitializedState({countryCode:i,currencyCode:n}),e(t,{class:"zonos--hello zonos--elements","data-theme":f},g&&e("div",{class:b(["zonos--hello-wrapper",c&&"zonos--hello-widget-float"])},e("button",{class:b(["zonos--hello-widget",this.showPeekMessage&&"zonos--hello-show-peek-message",this.mobileLocationOverride&&"zonos--hello-mobile-override",l&&"zonos--hello-widget-left zonos--hello-widget-animate-from-left",h&&"zonos--hello-widget-top",!!this.allRestrictedItems.length&&"zonos--hello-has-restrictions",c&&"zonos--hello-widget-float"]),onClick:()=>{this.changeShowDialog(!this.showDialog)},onMouseEnter:()=>this.enableShowPeekMessage(),onMouseLeave:()=>this.showPeekMessage=!1,ref:o=>o&&(this.helloRef=o)},e("zonos-text",{class:"zonos--hello-message"},this.peekMessage),i&&e("div",{class:"zonos--hello-country-flag-wrapper"},e("zonos-country-flag",{class:"zonos--hello-country-flag",countryCode:i}))),e("div",{class:b(["zonos--hello-dialog-wrapper",this.mobileLocationOverride&&"zonos--hello-dialog-wrapper-mobile-override",c&&"zonos--hello-widget-float"]),style:{height:this.showDialog?"fit-content":"0px"}},e("zonos-hello-dialog",{animateFromLeftOverride:this.animateFromLeftOverride,appearanceSettings:m,isOpen:this.showDialog,mobileLocationOverride:this.mobileLocationOverride,restrictedItems:p,setIsOpen:this.changeShowDialog}))))}static get watchers(){return{appearanceSettingsOverride:["handleAppearanceSettingsOverrideChange"]}}};$.style=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:inline-block}:host .zonos--hello-wrapper{position:relative}:host .zonos--hello-wrapper .zonos--hello-dialog-wrapper-mobile-override{position:fixed;bottom:0;left:0;width:100vw;z-index:1001;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}@media (max-width: 768px){:host .zonos--hello-wrapper .zonos--hello-dialog-wrapper{position:fixed;bottom:0;left:0;width:100vw;z-index:1001;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}}:host .zonos--hello-widget{-webkit-transition:all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);transition:all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);padding:6px;border-radius:30px;background:var(--zonos-elements-page-background);font-size:var(--zonos-elements-font-size-s);border:var(--zonos-elements-border);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;cursor:pointer;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;position:relative;z-index:1000}:host .zonos--hello-widget>.zonos--hello-message{-ms-flex-order:0;order:0;max-width:0;height:100%;white-space:nowrap;-webkit-transition:border 0.3s ease-in, all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);transition:border 0.3s ease-in, all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);overflow:hidden;color:var(--zonos-elements-text-color);position:absolute;background:var(--zonos-elements-page-background);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-top-left-radius:30px;border-bottom-left-radius:30px;left:0;-webkit-transform:translateX(calc(-100% + 16px));transform:translateX(calc(-100% + 16px));width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border-top:var(--zonos-elements-border);border-bottom:var(--zonos-elements-border)}:host .zonos--hello-widget.zonos--hello-has-restrictions{background:var(--zonos-elements-red-100);border:1px solid var(--zonos-elements-red-200)}:host .zonos--hello-widget.zonos--hello-has-restrictions>.zonos--hello-message{background:var(--zonos-elements-red-100);color:var(--zonos-elements-red-800);font-weight:500}:host .zonos--hello-widget.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:1px solid var(--zonos-elements-red-200)}:host .zonos--hello-widget.zonos--hello-show-peek-message{max-width:100vw;width:100%}:host .zonos--hello-widget.zonos--hello-show-peek-message>.zonos--hello-message{max-width:100vw;padding:0 6px;padding-right:16px;border:var(--zonos-elements-border)}:host .zonos--hello-widget.zonos--hello-show-peek-message:not(.zonos--hello-widget-animate-from-left)>.zonos--hello-message{border-right:none}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{border-left:0}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:16px;padding-right:6px;border-left:none}:host .zonos--hello-widget.zonos--hello-widget-animate-from-left>.zonos--hello-message{-ms-flex-order:1;order:1;-webkit-transform:translateX(calc(100% - 16px));transform:translateX(calc(100% - 16px));right:0;left:auto;border-top-right-radius:30px;border-bottom-right-radius:30px}:host .zonos--hello-widget .zonos--hello-country-flag-wrapper{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}:host .zonos--hello-widget .zonos--hello-country-flag-wrapper .zonos--hello-country-flag{height:18px;width:18px;position:relative;overflow:hidden;border-radius:30px;-webkit-box-shadow:var(--zonos-elements-v3-shadow-medium);box-shadow:var(--zonos-elements-v3-shadow-medium);z-index:10;justify-self:center}:host .zonos--hello-widget.zonos--hello-widget-float{position:fixed;bottom:72px;right:32px}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-left{left:32px;right:auto}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-top{bottom:auto;top:32px}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:none}:host .zonos--hello-widget.zonos--hello-widget-float>.zonos--hello-message{position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-radius:30px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;top:0;bottom:0;left:0;-webkit-transform:translateX(0);transform:translateX(0);width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border:none}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-animate-from-left>.zonos--hello-message{-webkit-transform:translateX(0);transform:translateX(0)}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:8px;padding-right:4px}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message>.zonos--hello-message{padding:0 var(--zonos-elements-radius-4);padding-right:6px;border:none}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float{position:fixed;bottom:72px;right:32px}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-left{left:32px;right:auto}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-top{bottom:auto;top:32px}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:none}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float>.zonos--hello-message{position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-radius:30px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;top:0;bottom:0;left:0;-webkit-transform:translateX(0);transform:translateX(0);width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border:none}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-animate-from-left>.zonos--hello-message{-webkit-transform:translateX(0);transform:translateX(0)}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:8px;padding-right:4px}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message>.zonos--hello-message{padding:0 var(--zonos-elements-radius-4);padding-right:6px;border:none}";export{$ as zonos_hello}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,o,s,t){function n(e){return e instanceof s?e:new s((function(o){o(e)}))}return new(s||(s=Promise))((function(s,i){function a(e){try{d(t.next(e))}catch(e){i(e)}}function r(e){try{d(t["throw"](e))}catch(e){i(e)}}function d(e){e.done?s(e.value):n(e.value).then(a,r)}d((t=t.apply(e,o||[])).next())}))};var __generator=this&&this.__generator||function(e,o){var s={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},t,n,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(e){return function(o){return d([e,o])}}function d(r){if(t)throw new TypeError("Generator is already executing.");while(a&&(a=0,r[0]&&(s=0)),s)try{if(t=1,n&&(i=r[0]&2?n["return"]:r[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,r[1])).done)return i;if(n=0,i)r=[r[0]&2,i.value];switch(r[0]){case 0:case 1:i=r;break;case 4:s.label++;return{value:r[1],done:false};case 5:s.label++;n=r[1];r=[0];continue;case 7:r=s.ops.pop();s.trys.pop();continue;default:if(!(i=s.trys,i=i.length>0&&i[i.length-1])&&(r[0]===6||r[0]===2)){s=0;continue}if(r[0]===3&&(!i||r[1]>i[0]&&r[1]<i[3])){s.label=r[1];break}if(r[0]===6&&s.label<i[1]){s.label=i[1];i=r;break}if(i&&s.label<i[2]){s.label=i[2];s.ops.push(r);break}if(i[2])s.ops.pop();s.trys.pop();continue}r=o.call(e,s)}catch(e){r=[6,e];n=0}finally{t=i=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};System.register(["./p-fd061229.system.js","./p-e758ec31.system.js","./p-aed0098c.system.js","./p-63db40b9.system.js","./p-2670438c.system.js","./p-8e8defdc.system.js","./p-23e7c655.system.js","./p-2770ba48.system.js","./p-e97793ce.system.js","./p-29814fd7.system.js"],(function(e){"use strict";var o,s,t,n,i,a,r,d,l,c,h,f,u,b,p,m,v,z;return{setters:[function(e){o=e.r;s=e.c;t=e.h;n=e.H;i=e.d},function(e){a=e.k;r=e.l;d=e.t},function(e){l=e.i},function(e){c=e.a},function(e){h=e.i;f=e.c},function(e){u=e.z;b=e.d},function(e){p=e.c},function(e){m=e.R},function(e){v=e.g},function(e){z=e.i}],execute:function(){var y=".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:16px}.sc-zonos-address-h zonos-banner.sc-zonos-address{margin-top:8px}";var g=y;var x=e("zonos_address",function(){function e(e){o(this,e);this.invalidCharacters=s(this,"invalidCharacters",7);this.type=undefined;this.titleText=undefined;this.defaultAddress=null;this.stripe=window.Zonos.stripe;this.isDirtyAddress=false}e.prototype.getStripeAddressInstance=function(){if(this.type==="billing"){return{stripeAddressElement:a.stripeBillingAddressElement,stripeAddressEventData:a.stripeBillingAddressEventData,stripeElements:a.stripeElementsForBillingAddress}}return{stripeAddressElement:a.stripeAddressElement,stripeAddressEventData:a.stripeAddressEventData,stripeElements:a.stripeElements}};e.prototype.updateAddressEventData=function(e){var o=e.event,s=e.type;switch(s){case"billing":a.stripeBillingAddressEventData=o;break;default:a.stripeAddressEventData=o;break}};e.prototype.updateAddressElement=function(e){var o=e.stripeAddressElement,s=e.type;if(s==="shipping"){a.stripeAddressElement=o;return}a.stripeBillingAddressElement=o};e.prototype.watchInitStripe=function(){return __awaiter(this,void 0,void 0,(function(){var e,o,s,t,n,i,a,d,h;var f=this;return __generator(this,(function(u){this.stripe=window.Zonos.stripe;s=this.getStripeAddressInstance(),t=s.stripeAddressEventData,n=s.stripeElements;if(!this.stripe||!n){c("Stripe is not initialized. Couldn't load stripe element.");return[2]}i=(e=this.defaultAddress)===null||e===void 0?void 0:e.phone;if(!i){(o=this.defaultAddress)===null||o===void 0?true:delete o.phone}a=r.shippingZoneCountries;d=a?Object.values(a).map((function(e){return e.code})):[];h=n.create("address",{allowedCountries:this.type==="shipping"?d:[],contacts:this.defaultAddress&&!t?[this.defaultAddress]:[],defaultValues:{address:Object.assign(Object.assign({},t===null||t===void 0?void 0:t.value.address),{country:(t===null||t===void 0?void 0:t.value.address.country)||r.selectedCountryCode||"AL"}),firstName:t===null||t===void 0?void 0:t.value.firstName,lastName:t===null||t===void 0?void 0:t.value.lastName,phone:t===null||t===void 0?void 0:t.value.phone},display:{name:"split"},fields:{phone:"always"},mode:this.type,validation:{phone:{required:"always"}}});h.mount(this.el.querySelector(".zonos--address-component"));h.on("change",(function(e){var o=e.value;if(!f.isDirtyAddress&&o.address.line1.length>=3){f.isDirtyAddress=true;setTimeout((function(){if(l()){f.el.scrollIntoView({behavior:"smooth",block:"end"})}else{var e=f.type==="shipping"?100:600;var o=f.el.closest(".zonos--group");var s=f.el.getBoundingClientRect().top+e;o===null||o===void 0?void 0:o.scrollTo({behavior:"smooth",top:s})}}),600)}f.updateAddressEventData({event:Object.assign(Object.assign({},e),{elementMode:f.type,elementType:"address",value:Object.assign(Object.assign({},o),{firstName:o.firstName||o.name.split(" ")[0],lastName:o.lastName||o.name.split(" ")[1]})}),type:f.type})}));this.updateAddressElement({stripeAddressElement:h,type:this.type});return[2]}))}))};e.prototype.disconnectedCallback=function(){var e=this.getStripeAddressInstance().stripeAddressElement;e===null||e===void 0?void 0:e.destroy()};e.prototype.componentDidLoad=function(){var e=this.getStripeAddressInstance().stripeAddressEventData;this.isDirtyAddress=!!e&&e.value.address.line1.length>0;void this.watchInitStripe()};e.prototype.render=function(){return t(n,{key:"2cecb49ed22bd0d5ce22c4f2110b37ecf7935cca",class:"zonos--address zonos--elements"},t("zonos-text",{key:"101635210ab6cb3b9a44b47eec101187d1c3a4ac",class:"zonos--title",type:"semiBoldLabel"},this.titleText),t("div",{key:"049f2b86986471d45bd413813307ec489d9f1993",class:"zonos--address-component"}))};Object.defineProperty(e.prototype,"el",{get:function(){return i(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{stripe:["watchInitStripe"]}},enumerable:false,configurable:true});return e}());x.style=g;var k=':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--title{margin-bottom:12px}:host .zonos--address-group{display:-ms-flexbox;display:flex;gap:4px;-ms-flex-direction:column;flex-direction:column}:host .zonos--address-line{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .zonos--address-line zonos-text+zonos-text::before{content:", ";color:var(--zonos-elements-gray-1200);margin-right:4px}:host .zonos--country-flag{width:20px;height:14px;border-radius:2px;margin:1px;position:relative;overflow:hidden;-webkit-box-shadow:var(--zonos-elements-v3-shadow-medium);box-shadow:var(--zonos-elements-v3-shadow-medium);margin-right:8px;z-index:10;justify-self:center}';var w=k;var j=e("zonos_address_display",function(){function e(e){o(this,e);this.currentAddress=undefined;this.addressType=undefined}e.prototype.render=function(){var e;var o=this.currentAddress,s=o.city,i=o.country,a=o.email,l=o.line1,c=o.line2,f=o.name,u=o.phone,b=o.postal_code,p=o.state;var m=(e=r.shippingZoneCountries)===null||e===void 0?void 0:e[i];var v=function(e){var o=e.bold,s=e.content;var n=h(s)?"red-600":"gray-1200";return t("zonos-text",{textColor:n,type:o?"boldLabel":"body"},s)};return t(n,{class:"zonos--address-form zonos--elements"},t("div",{class:"zonos--title"},t("zonos-text",{textColor:"gray-700",type:"smallHeader"},this.addressType==="shipping"?d("Shipping"):d("Billing"))),t("div",{class:"zonos--address-group"},f&&t("div",{class:"zonos--address-line"},v({bold:true,content:f})),a&&t("div",{class:"zonos--address-line"},v({content:a})),u&&t("div",{class:"zonos--address-line"},v({content:u})),l&&t("div",{class:"zonos--address-line"},v({content:l})),c&&t("div",{class:"zonos--address-line"},v({content:c})),t("div",{class:"zonos--address-line"},s&&v({content:s}),p&&v({content:p}),b&&v({content:b})),m&&t("div",{class:"zonos--address-line"},t("zonos-country-flag",{class:"zonos--country-flag",countryCode:m.code})," ",v({content:m.displayName}))))};return e}());j.style=w;var C=":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--title{margin-bottom:20px}:host .zonos--address-group{display:-ms-flexbox;display:flex;gap:20px;-ms-flex-direction:column;flex-direction:column;margin:1px}:host .zonos--contact{display:-ms-flexbox;display:flex;gap:8px;-ms-flex-direction:column;flex-direction:column}:host .zonos--address-row{display:-ms-flexbox;display:flex;gap:8px}:host .zonos--address-row>*{-ms-flex:1;flex:1}:host .zonos--address{display:-ms-flexbox;display:flex;gap:8px;-ms-flex-direction:column;flex-direction:column}";var I=C;var A=e("zonos_address_form",function(){function e(e){var t=this;o(this,e);this.addressChange=s(this,"addressChange",7);this.onInputChange=function(e){var o;var s=e.key,n=e.value;t.addressChange.emit(Object.assign(Object.assign({},t.localAddress),(o={},o[s]=n,o)))};this.currentAddress=undefined;this.translatedAddress=undefined;this.addressType=undefined;this.localAddress=this.currentAddress}e.prototype.watchCurrentAddress=function(){var e,o,s,t,n,i;var a=this.currentAddress,r=a.city,d=a.line1,l=a.line2,c=a.name,h=a.postal_code,f=a.state;this.localAddress=Object.assign(Object.assign({},this.currentAddress),{city:((e=this.translatedAddress.city)===null||e===void 0?void 0:e[r])||r,line1:((o=this.translatedAddress.line1)===null||o===void 0?void 0:o[d])||d,line2:((s=this.translatedAddress.line2)===null||s===void 0?void 0:s[l])||l,name:((t=this.translatedAddress.name)===null||t===void 0?void 0:t[c])||c,postal_code:((n=this.translatedAddress.postal_code)===null||n===void 0?void 0:n[h])||h,state:((i=this.translatedAddress.state)===null||i===void 0?void 0:i[f])||f})};e.prototype.componentWillLoad=function(){this.watchCurrentAddress()};e.prototype.render=function(){var e=this;var o=this.localAddress,s=o.city,i=o.country,a=o.line1,r=o.line2,l=o.name,c=o.phone,f=o.postal_code,u=o.state;var b=l.split(" ")[0]||"";var p=l.split(" ").slice(1).join(" ")||"";return t(n,{key:"8b578737e33203a23563be7e9be0778deec99bbf",class:"zonos--address-form zonos--elements"},t("div",{key:"793675a1348547bf3f781788956befe325191011",class:"zonos--title"},t("zonos-text",{key:"13de35cb0a7c98a48342e3fb86ae3ade9f5b88d9",textColor:"gray-700",type:"smallHeader"},this.addressType==="shipping"?d("Shipping"):d("Billing"))),t("div",{key:"2c5de5b5283fb99ee5f8b61d7a217177986fc2db",class:"zonos--address-group"},t("div",{key:"23bf3c893071000d5995a5f175867bab11929193",class:"zonos--contact"},t("zonos-text",{key:"7cdfe2a84ebad89ba5b16498d75def99cf392384",type:"label"},d("Contact")),t("zonos-input",{key:"1c39c38767fd306c5eb1164cdc989b8291209cf0",class:"zonos--form-email",inputLabel:d("Email"),inputValue:this.currentAddress.email,isDisabled:true}),t("div",{key:"cbdf61217125e22b1a6cec9a340ef0aca2c75670",class:"zonos--name zonos--address-row"},t("zonos-input",{key:"360c99e7b2c6caa64580d5768b5bb53368927275",class:"zonos--form-first-name",inputLabel:d("First name"),inputValue:b,isError:h(b),onInputChange:function(o){return e.onInputChange({key:"name",value:"".concat(o.detail," ").concat(p)})}}),t("zonos-input",{key:"8ce5fa5c15c6f7928339ea10009ce0e68954a91f",class:"zonos--form-last-name",inputLabel:d("Last name"),inputValue:p,isError:h(p),onInputChange:function(o){return e.onInputChange({key:"name",value:"".concat(b," ").concat(o.detail)})}}))),t("div",{key:"7b4fa2d3baa6cb257e7688e5ba6777123898b3fd",class:"zonos--address"},t("zonos-text",{key:"9d5782331b2642755a755aeb7f98c9f4d87f9a20",type:"label"},d("Address")),t("zonos-input",{key:"a622025924ca86bdbf1d3c04b79e6dee172b4c42",class:"zonos--form-country",inputLabel:d("Country"),inputValue:i,isDisabled:true}),t("zonos-input",{key:"f99b3a74db09ab5730878e80705b9aeac76bf800",class:"zonos--form-line1",inputLabel:d("Address line 1"),inputValue:a,isError:h(a),onInputChange:function(o){return e.onInputChange({key:"line1",value:o.detail})}}),t("zonos-input",{key:"5d16aefa45a78045c87d166aaaec0255606e455e",class:"zonos--form-line2",inputLabel:d("Address line 2"),inputValue:r,isError:h(r),onInputChange:function(o){return e.onInputChange({key:"line2",value:o.detail})}}),t("div",{key:"dc166be9381142835d72e731cb38a718522a068a",class:"zonos--address-row"},t("zonos-input",{key:"4f1a98f9d10ce0cff3ef18a3037a12382552b31d",class:"zonos--form-city",inputLabel:d("City"),inputValue:s,isError:h(s),onInputChange:function(o){return e.onInputChange({key:"city",value:o.detail})}}),t("zonos-input",{key:"d4f97900b5fe2e1619950a52d1d1f716a8bc19ff",class:"zonos--form-state",inputLabel:d("State/Province"),inputValue:u,isError:h(u),onInputChange:function(o){return e.onInputChange({key:"state",value:o.detail})}})),t("zonos-input",{key:"cf1eb0ca5cd15c8412a2e1246aaf2e39361dc733",class:"zonos--form-postal-code",inputLabel:d("Postal code"),inputValue:f,isError:h(f),onInputChange:function(o){return e.onInputChange({key:"postal_code",value:o.detail})}}),t("zonos-input",{key:"7421c82847eded6bdbcce49ef8196124d8e50c1d",class:"zonos--form-phone",inputLabel:d("Phone number"),inputValue:c,onInputChange:function(o){return e.onInputChange({key:"phone",value:o.detail})}}))))};Object.defineProperty(e,"watchers",{get:function(){return{translatedAddress:["watchCurrentAddress"]}},enumerable:false,configurable:true});return e}());A.style=I;var _=":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--body{padding:0 24px;position:relative}:host .zonos--dialog-header{margin-bottom:32px;position:-webkit-sticky;position:sticky;padding-top:24px;top:0;z-index:11;background:var(--zonos-elements-gray-0)}:host .zonos--dialog-title{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;margin-bottom:12px}:host .zonos--group{overflow:auto;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:8px;-ms-scroll-chaining:none;overscroll-behavior:contain}:host .zonos--group::-webkit-scrollbar{width:10px}:host .zonos--group::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}:host .zonos--group::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}:host .zonos--group::-webkit-scrollbar-thumb:hover{background:#d6d6d6}:host .zonos--address-display-group{display:-ms-flexbox;display:flex;gap:8px;margin-bottom:20px}:host .zonos--address-display-group zonos-address-display{-ms-flex:1;flex:1}:host .zonos--what-you-entered{margin-bottom:8px}:host .zonos--address-form-section{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:24px}:host .zonos--group-btn{position:-webkit-sticky;position:sticky;padding:24px 0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-pack:end;justify-content:end;background:var(--zonos-elements-gray-0);z-index:11}:host .zonos--group-btn .zonos--button-wrapper{display:-ms-flexbox;display:flex;gap:8px}:host(.mobile) .zonos--button-wrapper{-ms-flex-direction:column;flex-direction:column;width:100%}:host(.mobile) .zonos--button-wrapper zonos-button{width:100%}:host(.mobile) .zonos--button-wrapper .zonos--cancel-btn{-ms-flex-order:2;order:2}:host(.mobile) .zonos--button-wrapper .zonos--update-btn{-ms-flex-order:1;order:1}";var O=_;var L=e("zonos_address_update_dialog",function(){function e(e){var t=this;o(this,e);this.closeUpdateDialog=s(this,"closeUpdateDialog",7);this.continueClicked=s(this,"continueClicked",7);this.closeUpdateDialogHandler=function(){t.closeUpdateDialog.emit()};this.getTranslatedAddress=function(e){var o=e.currentAddress,s=e.translatedAddress;var t,n,i,a,r,d;var l=o.city,c=o.line1,h=o.line2,f=o.name,u=o.postal_code,b=o.state;return{city:((t=s.city)===null||t===void 0?void 0:t[l])||l,line1:((n=s.line1)===null||n===void 0?void 0:n[c])||c,line2:((i=s.line2)===null||i===void 0?void 0:i[h])||h,name:((a=s.name)===null||a===void 0?void 0:a[f])||f,postal_code:((r=s.postal_code)===null||r===void 0?void 0:r[u])||u,state:((d=s.state)===null||d===void 0?void 0:d[b])||b}};this.continueClickHandler=function(){return __awaiter(t,void 0,void 0,(function(){var e,o,s,t,n,i,a,r,d,l,c,h,u;return __generator(this,(function(b){this.continueLoading=true;t=this.billingAddress?this.getTranslatedAddress({currentAddress:this.billingAddress,translatedAddress:this.translatedBillingAddressState}):null;n=this.getTranslatedAddress({currentAddress:this.shippingAddress,translatedAddress:this.translatedShippingAddressState});i=f(Object.assign(Object.assign({},n),{country:this.shippingAddress.country}));a=t&&this.billingAddress&&f(Object.assign(Object.assign({},t),{country:this.billingAddress.country}));r=!!Object.keys(i).length;d=!!a&&!!Object.keys(a).length;if(r||d){l=(e=this.el.shadowRoot)===null||e===void 0?void 0:e.querySelectorAll("zonos-address-form");c=l===null||l===void 0?void 0:l[0];h=l===null||l===void 0?void 0:l[1];u=((o=c===null||c===void 0?void 0:c.shadowRoot)===null||o===void 0?void 0:o.querySelector(".has-error"))||((s=h===null||h===void 0?void 0:h.shadowRoot)===null||s===void 0?void 0:s.querySelector(".has-error"));if(u){u.scrollIntoView({behavior:"smooth",block:"center"})}this.continueLoading=false;return[2]}this.continueClicked.emit({billingAddress:t,shippingAddress:n});return[2]}))}))};this.buildTranslateAddressState=function(e){var o,s,t,n,i,a;var r=e.currentAddress,d=e.translatedAddress;var l=r.city,c=r.line1,h=r.line2,f=r.name,u=r.postal_code,b=r.state;return{city:(o={},o[l]=d.city,o),line1:(s={},s[c]=d.line1,s),line2:(t={},t[h]=d.line2,t),name:(n={},n[f]=d.name,n),postal_code:(i={},i[u]=d.postal_code,i),state:(a={},a[b]=d.state,a)}};this.continueLoading=false;this.dialogLoading=undefined;this.dialogOpen=false;this.submitBtnType=undefined;this.submitBtnColor=undefined;this.isMobile=false;this.shippingAddress=undefined;this.billingAddress=undefined;this.translatedShippingAddress=undefined;this.translatedBillingAddress=undefined;this.showErrorBanner=false;this.translatedShippingAddressState={};this.translatedBillingAddressState={}}e.prototype.watchTranslatedShippingAddress=function(){this.translatedShippingAddressState=this.translatedShippingAddress};e.prototype.watchTranslatedBillingAddress=function(){this.translatedBillingAddressState=this.translatedBillingAddress};e.prototype.componentWillLoad=function(){this.watchTranslatedBillingAddress();this.watchTranslatedShippingAddress()};e.prototype.render=function(){var e=this;var o=this.submitBtnColor||u.appearance.colorSecondary;var s=o==="#ffffff"?"outline":this.submitBtnType||"standard";var i=this.billingAddress;var a=this.shippingAddress;return t(n,{key:"655845cef04f4af526b1a1c4e49243c4f2b4c7f6",class:p(["zonos--address-update-dialog zonos--elements",this.isMobile&&"mobile"])},t("zonos-dialog",{key:"eab429bb78ce6f05ba463d8748d7edd5499402fa",isLoading:this.dialogLoading,mobile:this.isMobile,noBodyPadding:true,noBorder:true,noClickOutside:true,noCloseButton:true,onCloseDialog:function(){return e.closeUpdateDialog.emit()},open:this.dialogOpen,width:"568px"},t("div",{key:"08f0400e62addfcaffd91bf5200999d29bbd2da9",class:"zonos--body"},t("div",{key:"8699df5e2f823e19066fbb552ba2a66c127c05e9",class:"zonos--dialog-header"},t("div",{key:"92e0ff932dcdb0e5b59ea34b688d1ef8e31bfeb3",class:"zonos--dialog-title"},t("zonos-text",{key:"aaac3375526bddb319ce7c8f49bde30da7210264",type:"title"},d("Update your address")),t("zonos-button",{key:"66abf7b74045e68e84e631298504236d32ca9c4e",class:"zonos--close-button",icon:t("zonos-icon",{"aria-label":"Close checkout dialog",content:m}),noBackground:true,onClick:function(){return e.closeUpdateDialogHandler()}})),t("zonos-text",{key:"ffb3d8f169867d5f6dff269e1becd99c98c5a7da"},d("To ensure delivery all address details must be in Latin characters."))),t("div",{key:"2cb61f06ce174e2317870decfdd337c67c5cf128",class:"zonos--group"},t("zonos-text",{key:"a616c540984120b468e52bccfb380ea3974ced22",class:"zonos--what-you-entered",type:"semiBoldLabel"},d("What you entered")),t("div",{key:"6ac8f9c14472370c501af1b0d50bd8f8746b7694",class:"zonos--address-display-group"},t("zonos-address-display",{key:"ea2c67a7bba51c99f80be968e448beeffcf1f863",addressType:"shipping",currentAddress:a}),i&&t("zonos-address-display",{key:"7ea1683dc04a292810e04ed6550d86086f25186f",addressType:"billing",currentAddress:i})),t("div",{key:"4d1cd9096943518b8b4e267608a5e1542befb6a9",class:"zonos--address-form-section"},t("zonos-text",{key:"e4184a2cc618d26d43979fa8cfe06070cf8b5af8",type:"semiBoldLabel"},d("Translated address")),t("zonos-address-form",{key:"c55d9d3c658565ceb7c7b879f444e3937b9f7ad6",addressType:"shipping",class:"zonos--shipping-address-form",currentAddress:a,onAddressChange:function(o){var s=o.detail;e.translatedShippingAddressState=e.buildTranslateAddressState({currentAddress:a,translatedAddress:s})},translatedAddress:this.translatedShippingAddressState}),i&&t("zonos-address-form",{key:"c3facc295b1322bb00baa6081f343dcea4f10777",addressType:"billing",class:"zonos--billing-address-form",currentAddress:i,onAddressChange:function(o){var s=o.detail;e.translatedBillingAddressState=e.buildTranslateAddressState({currentAddress:i,translatedAddress:s})},translatedAddress:this.translatedBillingAddressState}))),t("div",{key:"1c89c9604ba0dece40275fcfac97e7f93706b430",class:"zonos--group-btn"},t("div",{key:"e47d393940b094b4e123864e4070daa87f0616f0",class:"zonos--button-wrapper"},t("zonos-button",{key:"216b7afe268a4acd6bb8a76b7f5a32dc09bdd4f6",class:"zonos--cancel-btn",onClick:function(){return e.closeUpdateDialogHandler()},variant:"subtle"},d("Cancel")),t("zonos-button",{key:"acbacb92cedb325b46843d8f3aff13f4e7c86ab5",backgroundColor:this.submitBtnColor,class:"zonos--update-btn",loading:this.continueLoading,onClick:function(){return e.continueClickHandler()},size:"sm",variant:s},d("Update address")))))))};Object.defineProperty(e.prototype,"el",{get:function(){return i(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{translatedShippingAddress:["watchTranslatedShippingAddress"],translatedBillingAddress:["watchTranslatedBillingAddress"]}},enumerable:false,configurable:true});return e}());L.style=O;var E=["blue","cyan","green","orange","purple","red","gray","glass"];var B=":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;cursor:pointer}:host label{display:-ms-inline-flexbox;display:inline-flex;position:relative;gap:8px;-ms-flex-align:center;align-items:center}:host label.disabled{cursor:not-allowed;opacity:0.6}:host input[type=checkbox]{opacity:0;position:absolute;left:0;width:0;height:0;top:0;z-index:-99999}:host svg{opacity:0}:host .checkmark-container{height:var(--size);width:var(--size);background-color:transparent;border:1.5px solid var(--zonos-elements-gray-400);position:relative;border-radius:var(--border-radius, var(--zonos-elements-radius-4))}:host .checkmark{opacity:0;position:absolute;top:-1.5px;left:-1.5px;right:-1.5px;bottom:-1.5px;width:calc(100% + 3px);-webkit-transition:0.3s all cubic-bezier(0.175, 0.885, 0.32, 1.275);transition:0.3s all cubic-bezier(0.175, 0.885, 0.32, 1.275);-webkit-transform:scale(0.4);transform:scale(0.4);background-color:var(--background-color);border-radius:var(--border-radius, var(--zonos-elements-radius-4))}:host input[type=checkbox]:checked~.checkmark-container .checkmark{opacity:1;-webkit-transform:scale(1);transform:scale(1)}";var S=B;var T=e("zonos_checkbox",function(){function e(e){o(this,e);this.checkboxSelected=s(this,"checkboxSelected",7);this.backgroundColor="blue";this.label=undefined;this.isChecked=false;this.isDisabled=false;this.size=12;this.fontSize="base";this.borderStyle=undefined}e.prototype.onClick=function(){if(this.isDisabled){return}this.checkboxSelected.emit(!this.isChecked)};e.prototype.render=function(){var e=this;var o=E.includes(this.backgroundColor);var s=o?"var(--zonos-elements-".concat(this.backgroundColor,"-600)"):this.backgroundColor;var i=o?"var(--zonos-elements-".concat(this.backgroundColor,"-200)"):!z(s)?"var(--zonos-elements-gray-800)":"var(--zonos-elements-gray-0)";var a=v({customRoundRadius:"4px",overrideBorderStyle:this.borderStyle});return t(n,{key:"bf51dd642e88096e874d78023a29dd68239e8d3a",class:p(["zonos--elements zonos--checkbox"]),style:{"--background-color":s,"--border-radius":a,"--font-family":b(),"--size":"".concat(this.size,"px")}},t("label",{key:"3598c9f21285304499aaafbab5226d619ecf4e69",class:p([this.isDisabled&&"disabled"])},t("input",{key:"277507f643404e6e44191c2d715b70f38fc6af85",checked:this.isChecked,disabled:this.isDisabled,hidden:true,onChange:function(o){e.checkboxSelected.emit(o.target.checked)},type:"checkbox"}),t("span",{key:"3f0fd0d458e8cf660fa883ceaa241e3397829548",class:"checkmark-container"},t("svg",{key:"0d654744bea5b5696ddcf3778a155fb622022f1e",class:"checkmark",color:i,fill:"none",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},t("path",{key:"cc19837ee088feb7053fdaeaea0d1213cbc60775","clip-rule":"evenodd",d:"M17.456 7.404a.75.75 0 0 1 .14 1.052l-6.5 8.5a.75.75 0 0 1-1.126.074l-4-4a.75.75 0 0 1 1.06-1.06l3.395 3.394 5.98-7.82a.75.75 0 0 1 1.05-.14Z",fill:"currentColor","fill-rule":"evenodd"}))),this.label&&t("zonos-text",{key:"cb85d59651f67a33126d37c3ebfb1e8a91b457fe",size:this.fontSize},this.label)))};return e}());T.style=S;var V=":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 D=V;var P=e("zonos_collapse",function(){function e(e){o(this,e);this.collapsed=false;this.collapseSize=0;this.height=this.el.scrollHeight;this.iframe=null}e.prototype.getElementHeight=function(){var e="".concat(this.height,"px");var o="".concat(this.collapseSize,"px");return this.collapsed?o:e};e.prototype.componentDidLoad=function(){this.height=this.el.scrollHeight};e.prototype.componentDidRender=function(){var e=this;var o,s,t;this.iframe=((o=this.el.shadowRoot)===null||o===void 0?void 0:o.querySelector("iframe"))||null;(t=(s=this.iframe)===null||s===void 0?void 0:s.contentWindow)===null||t===void 0?void 0:t.addEventListener("resize",(function(){if(!e.iframe){return}e.height=parseFloat(getComputedStyle(e.iframe).height)}))};e.prototype.render=function(){var e=this;if(!this.collapsed){setTimeout((function(){if(!e.collapsed){e.el.style.overflow="visible"}}),300)}else{this.el.style.overflow="hidden"}return t(n,{key:"7cc2167ab3dab1a975d141f3c58d3c5982c1645a",class:"zonos--elements zonos--collapse",style:{"--font-family":b(),height:this.getElementHeight()}},t("div",{key:"1b791702f95066643ac82402a9fcff19b0fcc706"},t("iframe",{key:"08f678a4ce92f5600c584e329e3039bc4588ff3a",class:"height-change-listener",tabindex:"-1",title:"collapse-height-change-listener"}),t("slot",{key:"83119f9ba9764c46fa7d1dd7b4c0b08c49033607"})))};Object.defineProperty(e.prototype,"el",{get:function(){return i(this)},enumerable:false,configurable:true});return e}());P.style=D;var M='<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 N=":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:0;top:0;background:var(--zonos-elements-backdrop-color);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:2147483009;background:var(--zonos-elements-gray-0);border-radius:var(--border-radius, var(--zonos-elements-radius-10))}: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(--zonos-elements-text-color);visibility:hidden}:host .zonos--dialog{position:relative;z-index:2147483008;background:var(--zonos-elements-gray-0);max-width:90vw;max-height:90vh;min-height:var(--min-height, auto);height:var(--height, auto);width:var(--width, auto);border-radius:var(--border-radius, var(--zonos-elements-radius-10));outline:none;-webkit-box-shadow:var(--zonos-elements-v3-shadow-xxl);box-shadow:var(--zonos-elements-v3-shadow-xxl);border:var(--zonos-elements-border);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:16px 24px}:host .zonos--header .-zonos-stencil-library--header-text{-ms-flex-positive:1;flex-grow:1}:host .zonos--header .zonos--close-button{width:var(--zonos-elements-size-md);height:var(--zonos-elements-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(--zonos-elements-radius-10);-ms-flex-item-align:start;align-self:flex-start}:host .zonos--header .zonos--close-button:hover{background:var(--zonos-elements-hover-color)}:host .zonos--body{padding:8px 24px;max-height:100%;height:100%;overflow:auto}:host .zonos--body.zonos--no-body-padding{padding:0}:host .zonos--footer{padding:16px 24px}:host(.open) .zonos--dialog-layout,:host(.open) .zonos--backdrop{visibility:visible}:host(.open) .zonos--backdrop{z-index:2147483008;opacity:0.65}:host(.open) .zonos--dialog-layout{opacity:1;z-index:2147483009;-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 U=N;var Z=e("zonos_dialog",function(){function e(e){var t=this;o(this,e);this.closeDialog=s(this,"closeDialog",3);this.isMobileMode=function(){return t.mobile||window.innerWidth<=768};this.closeButtonHandler=function(){if(!t.open){return}t.closeDialog.emit()};this.clickOutsideDialogHandler=function(e){if(e.target===e.currentTarget&&!t.noClickOutside){t.closeDialog.emit()}};this.open=false;this.headerText="";this.width="460px";this.height=undefined;this.minHeight=undefined;this.noHeader=false;this.noBodyPadding=false;this.noBorder=false;this.borderStyle=undefined;this.noCloseButton=false;this.noClickOutside=false;this.mobile=false;this.isLoading=true;this.isMobile=false}e.prototype.handleWindowResize=function(){this.isMobile=this.isMobileMode()};e.prototype.handleKeyDown=function(e){if(e.key==="Escape"){this.closeButtonHandler()}};e.prototype.componentDidLoad=function(){this.isMobile=this.isMobileMode()};e.prototype.render=function(){if(this.open){document.body.style.overflow="hidden"}else{document.body.style.overflow="auto"}var e=v({overrideBorderStyle:this.borderStyle});return t(n,{key:"03735385e07c7f6c8a87df42ad95f8c9d9533668",class:p(["zonos--elements",this.open&&"open",this.isLoading&&"is-loading",this.noBorder&&"no-border",this.isMobile&&"mobile"]),style:{"--border-radius":e,"--font-family":b(),"--height":this.height||"initial","--min-height":this.minHeight||"500px","--width":this.width}},t("div",{key:"da5d599e1a247f7e3364e6f5c9b2eae3db9539f5",class:"zonos--backdrop"}),t("div",{key:"cda1a996d9521c2e0b307f7a03ca3ee3d4915b8d",class:"zonos--dialog-layout",inert:!this.open,onClick:this.clickOutsideDialogHandler},t("div",{key:"471d8a069d4f580233bdb3e9e971efdb268ef57d",class:"zonos--dialog"},this.isLoading&&t("div",{key:"57220007aabcaef133c2c0782fa238cc43d63964",class:"zonos--loading"},t("zonos-spinner",{key:"0298b754341abd61ec07706128d05df5332f915d",size:30})),(this.headerText||!this.noCloseButton)&&t("div",{key:"5103dbc1c7593a8042505f767d8290825f9d10e7",class:"zonos--header"},this.headerText&&t("h3",{key:"a2d9cd4c8cb359aa64cf104a172ca960068c20a0",class:"zonos--header-text"},this.headerText),!this.noCloseButton&&t("zonos-button",{key:"de9bf8a949344d19fcb8bfb496719282553be194",class:"zonos--close-button",icon:t("zonos-icon",{"aria-label":"Close dialog",content:M}),noBackground:true,onClick:this.closeButtonHandler,variant:"subtle"})),t("div",{key:"1ec2cdca0f186cd0b28602580022ed0cb4b0eec9",class:p(["zonos--body",this.noBodyPadding&&"zonos--no-body-padding"])},t("slot",{key:"5071d921f48bf792a951a390d83b121e32771668"})),t("slot",{key:"c1818ac301afc845f5b14fd0f2ac9a1fd3a27b99",name:"dialog-footer"}))))};Object.defineProperty(e,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return e}());Z.style=U;var F=".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:16px}";var H=F;var R=e("zonos_link_authentication",function(){function e(e){o(this,e);this.titleText=undefined;this.defaultEmail=null;this.stripe=a.stripe}e.prototype.watchInitStripe=function(){if(!this.stripe||!a.stripeElements){return}var e=this.defaultEmail?{email:this.defaultEmail}:undefined;var o=a.stripeLinkElement||a.stripeElements.create("linkAuthentication",{defaultValues:e||undefined});var s=this.el.querySelector(".zonos--link-authentication-component");if(!s){c("Cannot find container element for linkAuthenticationElement");return}o.mount(s);o.on("change",(function(e){a.stripeLinkEventData=e}));a.stripeLinkElement=o};e.prototype.componentDidLoad=function(){this.watchInitStripe()};e.prototype.render=function(){return t(n,{key:"f0b26abf99ef99c6665dabdddebc9ff086b6816c",class:"zonos--link-authentication zonos--elements"},t("zonos-text",{key:"898dbdffac06fe2a68af90610a22044bb72391ce",class:"zonos--title",type:"semiBoldLabel"},this.titleText),t("div",{key:"e2ec9abb0cf76a39a1262e1366e375dd898450cd",class:"zonos--link-authentication-component"}))};Object.defineProperty(e.prototype,"el",{get:function(){return i(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{stripe:["watchInitStripe"]}},enumerable:false,configurable:true});return e}());R.style=H}}}));
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,o,s,t){function n(e){return e instanceof s?e:new s((function(o){o(e)}))}return new(s||(s=Promise))((function(s,i){function a(e){try{d(t.next(e))}catch(e){i(e)}}function r(e){try{d(t["throw"](e))}catch(e){i(e)}}function d(e){e.done?s(e.value):n(e.value).then(a,r)}d((t=t.apply(e,o||[])).next())}))};var __generator=this&&this.__generator||function(e,o){var s={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},t,n,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(e){return function(o){return d([e,o])}}function d(r){if(t)throw new TypeError("Generator is already executing.");while(a&&(a=0,r[0]&&(s=0)),s)try{if(t=1,n&&(i=r[0]&2?n["return"]:r[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,r[1])).done)return i;if(n=0,i)r=[r[0]&2,i.value];switch(r[0]){case 0:case 1:i=r;break;case 4:s.label++;return{value:r[1],done:false};case 5:s.label++;n=r[1];r=[0];continue;case 7:r=s.ops.pop();s.trys.pop();continue;default:if(!(i=s.trys,i=i.length>0&&i[i.length-1])&&(r[0]===6||r[0]===2)){s=0;continue}if(r[0]===3&&(!i||r[1]>i[0]&&r[1]<i[3])){s.label=r[1];break}if(r[0]===6&&s.label<i[1]){s.label=i[1];i=r;break}if(i&&s.label<i[2]){s.label=i[2];s.ops.push(r);break}if(i[2])s.ops.pop();s.trys.pop();continue}r=o.call(e,s)}catch(e){r=[6,e];n=0}finally{t=i=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};System.register(["./p-fd061229.system.js","./p-8f7773b0.system.js","./p-aed0098c.system.js","./p-a74a7afa.system.js","./p-2670438c.system.js","./p-8e8defdc.system.js","./p-23e7c655.system.js","./p-2770ba48.system.js","./p-e97793ce.system.js","./p-29814fd7.system.js"],(function(e){"use strict";var o,s,t,n,i,a,r,d,l,c,h,f,u,b,p,m,v,z;return{setters:[function(e){o=e.r;s=e.c;t=e.h;n=e.H;i=e.d},function(e){a=e.j;r=e.l;d=e.t},function(e){l=e.i},function(e){c=e.a},function(e){h=e.i;f=e.c},function(e){u=e.z;b=e.d},function(e){p=e.c},function(e){m=e.R},function(e){v=e.g},function(e){z=e.i}],execute:function(){var y=".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:16px}.sc-zonos-address-h zonos-banner.sc-zonos-address{margin-top:8px}";var g=y;var x=e("zonos_address",function(){function e(e){o(this,e);this.invalidCharacters=s(this,"invalidCharacters",7);this.type=undefined;this.titleText=undefined;this.defaultAddress=null;this.stripe=window.Zonos.stripe;this.isDirtyAddress=false}e.prototype.getStripeAddressInstance=function(){if(this.type==="billing"){return{stripeAddressElement:a.stripeBillingAddressElement,stripeAddressEventData:a.stripeBillingAddressEventData,stripeElements:a.stripeElementsForBillingAddress}}return{stripeAddressElement:a.stripeAddressElement,stripeAddressEventData:a.stripeAddressEventData,stripeElements:a.stripeElements}};e.prototype.updateAddressEventData=function(e){var o=e.event,s=e.type;switch(s){case"billing":a.stripeBillingAddressEventData=o;break;default:a.stripeAddressEventData=o;break}};e.prototype.updateAddressElement=function(e){var o=e.stripeAddressElement,s=e.type;if(s==="shipping"){a.stripeAddressElement=o;return}a.stripeBillingAddressElement=o};e.prototype.watchInitStripe=function(){return __awaiter(this,void 0,void 0,(function(){var e,o,s,t,n,i,a,d,h;var f=this;return __generator(this,(function(u){this.stripe=window.Zonos.stripe;s=this.getStripeAddressInstance(),t=s.stripeAddressEventData,n=s.stripeElements;if(!this.stripe||!n){c("Stripe is not initialized. Couldn't load stripe element.");return[2]}i=(e=this.defaultAddress)===null||e===void 0?void 0:e.phone;if(!i){(o=this.defaultAddress)===null||o===void 0?true:delete o.phone}a=r.shippingZoneCountries;d=a?Object.values(a).map((function(e){return e.code})):[];h=n.create("address",{allowedCountries:this.type==="shipping"?d:[],contacts:this.defaultAddress&&!t?[this.defaultAddress]:[],defaultValues:{address:Object.assign(Object.assign({},t===null||t===void 0?void 0:t.value.address),{country:(t===null||t===void 0?void 0:t.value.address.country)||r.selectedCountryCode||"AL"}),firstName:t===null||t===void 0?void 0:t.value.firstName,lastName:t===null||t===void 0?void 0:t.value.lastName,phone:t===null||t===void 0?void 0:t.value.phone},display:{name:"split"},fields:{phone:"always"},mode:this.type,validation:{phone:{required:"always"}}});h.mount(this.el.querySelector(".zonos--address-component"));h.on("change",(function(e){var o=e.value;if(!f.isDirtyAddress&&o.address.line1.length>=3){f.isDirtyAddress=true;setTimeout((function(){if(l()){f.el.scrollIntoView({behavior:"smooth",block:"end"})}else{var e=f.type==="shipping"?100:600;var o=f.el.closest(".zonos--group");var s=f.el.getBoundingClientRect().top+e;o===null||o===void 0?void 0:o.scrollTo({behavior:"smooth",top:s})}}),600)}f.updateAddressEventData({event:Object.assign(Object.assign({},e),{elementMode:f.type,elementType:"address",value:Object.assign(Object.assign({},o),{firstName:o.firstName||o.name.split(" ")[0],lastName:o.lastName||o.name.split(" ")[1]})}),type:f.type})}));this.updateAddressElement({stripeAddressElement:h,type:this.type});return[2]}))}))};e.prototype.disconnectedCallback=function(){var e=this.getStripeAddressInstance().stripeAddressElement;e===null||e===void 0?void 0:e.destroy()};e.prototype.componentDidLoad=function(){var e=this.getStripeAddressInstance().stripeAddressEventData;this.isDirtyAddress=!!e&&e.value.address.line1.length>0;void this.watchInitStripe()};e.prototype.render=function(){return t(n,{key:"2cecb49ed22bd0d5ce22c4f2110b37ecf7935cca",class:"zonos--address zonos--elements"},t("zonos-text",{key:"101635210ab6cb3b9a44b47eec101187d1c3a4ac",class:"zonos--title",type:"semiBoldLabel"},this.titleText),t("div",{key:"049f2b86986471d45bd413813307ec489d9f1993",class:"zonos--address-component"}))};Object.defineProperty(e.prototype,"el",{get:function(){return i(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{stripe:["watchInitStripe"]}},enumerable:false,configurable:true});return e}());x.style=g;var k=':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--title{margin-bottom:12px}:host .zonos--address-group{display:-ms-flexbox;display:flex;gap:4px;-ms-flex-direction:column;flex-direction:column}:host .zonos--address-line{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .zonos--address-line zonos-text+zonos-text::before{content:", ";color:var(--zonos-elements-gray-1200);margin-right:4px}:host .zonos--country-flag{width:20px;height:14px;border-radius:2px;margin:1px;position:relative;overflow:hidden;-webkit-box-shadow:var(--zonos-elements-v3-shadow-medium);box-shadow:var(--zonos-elements-v3-shadow-medium);margin-right:8px;z-index:10;justify-self:center}';var w=k;var j=e("zonos_address_display",function(){function e(e){o(this,e);this.currentAddress=undefined;this.addressType=undefined}e.prototype.render=function(){var e;var o=this.currentAddress,s=o.city,i=o.country,a=o.email,l=o.line1,c=o.line2,f=o.name,u=o.phone,b=o.postal_code,p=o.state;var m=(e=r.shippingZoneCountries)===null||e===void 0?void 0:e[i];var v=function(e){var o=e.bold,s=e.content;var n=h(s)?"red-600":"gray-1200";return t("zonos-text",{textColor:n,type:o?"boldLabel":"body"},s)};return t(n,{class:"zonos--address-form zonos--elements"},t("div",{class:"zonos--title"},t("zonos-text",{textColor:"gray-700",type:"smallHeader"},this.addressType==="shipping"?d("Shipping"):d("Billing"))),t("div",{class:"zonos--address-group"},f&&t("div",{class:"zonos--address-line"},v({bold:true,content:f})),a&&t("div",{class:"zonos--address-line"},v({content:a})),u&&t("div",{class:"zonos--address-line"},v({content:u})),l&&t("div",{class:"zonos--address-line"},v({content:l})),c&&t("div",{class:"zonos--address-line"},v({content:c})),t("div",{class:"zonos--address-line"},s&&v({content:s}),p&&v({content:p}),b&&v({content:b})),m&&t("div",{class:"zonos--address-line"},t("zonos-country-flag",{class:"zonos--country-flag",countryCode:m.code})," ",v({content:m.displayName}))))};return e}());j.style=w;var C=":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--title{margin-bottom:20px}:host .zonos--address-group{display:-ms-flexbox;display:flex;gap:20px;-ms-flex-direction:column;flex-direction:column;margin:1px}:host .zonos--contact{display:-ms-flexbox;display:flex;gap:8px;-ms-flex-direction:column;flex-direction:column}:host .zonos--address-row{display:-ms-flexbox;display:flex;gap:8px}:host .zonos--address-row>*{-ms-flex:1;flex:1}:host .zonos--address{display:-ms-flexbox;display:flex;gap:8px;-ms-flex-direction:column;flex-direction:column}";var I=C;var A=e("zonos_address_form",function(){function e(e){var t=this;o(this,e);this.addressChange=s(this,"addressChange",7);this.onInputChange=function(e){var o;var s=e.key,n=e.value;t.addressChange.emit(Object.assign(Object.assign({},t.localAddress),(o={},o[s]=n,o)))};this.currentAddress=undefined;this.translatedAddress=undefined;this.addressType=undefined;this.localAddress=this.currentAddress}e.prototype.watchCurrentAddress=function(){var e,o,s,t,n,i;var a=this.currentAddress,r=a.city,d=a.line1,l=a.line2,c=a.name,h=a.postal_code,f=a.state;this.localAddress=Object.assign(Object.assign({},this.currentAddress),{city:((e=this.translatedAddress.city)===null||e===void 0?void 0:e[r])||r,line1:((o=this.translatedAddress.line1)===null||o===void 0?void 0:o[d])||d,line2:((s=this.translatedAddress.line2)===null||s===void 0?void 0:s[l])||l,name:((t=this.translatedAddress.name)===null||t===void 0?void 0:t[c])||c,postal_code:((n=this.translatedAddress.postal_code)===null||n===void 0?void 0:n[h])||h,state:((i=this.translatedAddress.state)===null||i===void 0?void 0:i[f])||f})};e.prototype.componentWillLoad=function(){this.watchCurrentAddress()};e.prototype.render=function(){var e=this;var o=this.localAddress,s=o.city,i=o.country,a=o.line1,r=o.line2,l=o.name,c=o.phone,f=o.postal_code,u=o.state;var b=l.split(" ")[0]||"";var p=l.split(" ").slice(1).join(" ")||"";return t(n,{key:"8b578737e33203a23563be7e9be0778deec99bbf",class:"zonos--address-form zonos--elements"},t("div",{key:"793675a1348547bf3f781788956befe325191011",class:"zonos--title"},t("zonos-text",{key:"13de35cb0a7c98a48342e3fb86ae3ade9f5b88d9",textColor:"gray-700",type:"smallHeader"},this.addressType==="shipping"?d("Shipping"):d("Billing"))),t("div",{key:"2c5de5b5283fb99ee5f8b61d7a217177986fc2db",class:"zonos--address-group"},t("div",{key:"23bf3c893071000d5995a5f175867bab11929193",class:"zonos--contact"},t("zonos-text",{key:"7cdfe2a84ebad89ba5b16498d75def99cf392384",type:"label"},d("Contact")),t("zonos-input",{key:"1c39c38767fd306c5eb1164cdc989b8291209cf0",class:"zonos--form-email",inputLabel:d("Email"),inputValue:this.currentAddress.email,isDisabled:true}),t("div",{key:"cbdf61217125e22b1a6cec9a340ef0aca2c75670",class:"zonos--name zonos--address-row"},t("zonos-input",{key:"360c99e7b2c6caa64580d5768b5bb53368927275",class:"zonos--form-first-name",inputLabel:d("First name"),inputValue:b,isError:h(b),onInputChange:function(o){return e.onInputChange({key:"name",value:"".concat(o.detail," ").concat(p)})}}),t("zonos-input",{key:"8ce5fa5c15c6f7928339ea10009ce0e68954a91f",class:"zonos--form-last-name",inputLabel:d("Last name"),inputValue:p,isError:h(p),onInputChange:function(o){return e.onInputChange({key:"name",value:"".concat(b," ").concat(o.detail)})}}))),t("div",{key:"7b4fa2d3baa6cb257e7688e5ba6777123898b3fd",class:"zonos--address"},t("zonos-text",{key:"9d5782331b2642755a755aeb7f98c9f4d87f9a20",type:"label"},d("Address")),t("zonos-input",{key:"a622025924ca86bdbf1d3c04b79e6dee172b4c42",class:"zonos--form-country",inputLabel:d("Country"),inputValue:i,isDisabled:true}),t("zonos-input",{key:"f99b3a74db09ab5730878e80705b9aeac76bf800",class:"zonos--form-line1",inputLabel:d("Address line 1"),inputValue:a,isError:h(a),onInputChange:function(o){return e.onInputChange({key:"line1",value:o.detail})}}),t("zonos-input",{key:"5d16aefa45a78045c87d166aaaec0255606e455e",class:"zonos--form-line2",inputLabel:d("Address line 2"),inputValue:r,isError:h(r),onInputChange:function(o){return e.onInputChange({key:"line2",value:o.detail})}}),t("div",{key:"dc166be9381142835d72e731cb38a718522a068a",class:"zonos--address-row"},t("zonos-input",{key:"4f1a98f9d10ce0cff3ef18a3037a12382552b31d",class:"zonos--form-city",inputLabel:d("City"),inputValue:s,isError:h(s),onInputChange:function(o){return e.onInputChange({key:"city",value:o.detail})}}),t("zonos-input",{key:"d4f97900b5fe2e1619950a52d1d1f716a8bc19ff",class:"zonos--form-state",inputLabel:d("State/Province"),inputValue:u,isError:h(u),onInputChange:function(o){return e.onInputChange({key:"state",value:o.detail})}})),t("zonos-input",{key:"cf1eb0ca5cd15c8412a2e1246aaf2e39361dc733",class:"zonos--form-postal-code",inputLabel:d("Postal code"),inputValue:f,isError:h(f),onInputChange:function(o){return e.onInputChange({key:"postal_code",value:o.detail})}}),t("zonos-input",{key:"7421c82847eded6bdbcce49ef8196124d8e50c1d",class:"zonos--form-phone",inputLabel:d("Phone number"),inputValue:c,onInputChange:function(o){return e.onInputChange({key:"phone",value:o.detail})}}))))};Object.defineProperty(e,"watchers",{get:function(){return{translatedAddress:["watchCurrentAddress"]}},enumerable:false,configurable:true});return e}());A.style=I;var _=":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--body{padding:0 24px;position:relative}:host .zonos--dialog-header{margin-bottom:32px;position:-webkit-sticky;position:sticky;padding-top:24px;top:0;z-index:11;background:var(--zonos-elements-gray-0)}:host .zonos--dialog-title{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;margin-bottom:12px}:host .zonos--group{overflow:auto;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:8px;-ms-scroll-chaining:none;overscroll-behavior:contain}:host .zonos--group::-webkit-scrollbar{width:10px}:host .zonos--group::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}:host .zonos--group::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}:host .zonos--group::-webkit-scrollbar-thumb:hover{background:#d6d6d6}:host .zonos--address-display-group{display:-ms-flexbox;display:flex;gap:8px;margin-bottom:20px}:host .zonos--address-display-group zonos-address-display{-ms-flex:1;flex:1}:host .zonos--what-you-entered{margin-bottom:8px}:host .zonos--address-form-section{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:24px}:host .zonos--group-btn{position:-webkit-sticky;position:sticky;padding:24px 0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-pack:end;justify-content:end;background:var(--zonos-elements-gray-0);z-index:11}:host .zonos--group-btn .zonos--button-wrapper{display:-ms-flexbox;display:flex;gap:8px}:host(.mobile) .zonos--button-wrapper{-ms-flex-direction:column;flex-direction:column;width:100%}:host(.mobile) .zonos--button-wrapper zonos-button{width:100%}:host(.mobile) .zonos--button-wrapper .zonos--cancel-btn{-ms-flex-order:2;order:2}:host(.mobile) .zonos--button-wrapper .zonos--update-btn{-ms-flex-order:1;order:1}";var O=_;var L=e("zonos_address_update_dialog",function(){function e(e){var t=this;o(this,e);this.closeUpdateDialog=s(this,"closeUpdateDialog",7);this.continueClicked=s(this,"continueClicked",7);this.closeUpdateDialogHandler=function(){t.closeUpdateDialog.emit()};this.getTranslatedAddress=function(e){var o=e.currentAddress,s=e.translatedAddress;var t,n,i,a,r,d;var l=o.city,c=o.line1,h=o.line2,f=o.name,u=o.postal_code,b=o.state;return{city:((t=s.city)===null||t===void 0?void 0:t[l])||l,line1:((n=s.line1)===null||n===void 0?void 0:n[c])||c,line2:((i=s.line2)===null||i===void 0?void 0:i[h])||h,name:((a=s.name)===null||a===void 0?void 0:a[f])||f,postal_code:((r=s.postal_code)===null||r===void 0?void 0:r[u])||u,state:((d=s.state)===null||d===void 0?void 0:d[b])||b}};this.continueClickHandler=function(){return __awaiter(t,void 0,void 0,(function(){var e,o,s,t,n,i,a,r,d,l,c,h,u;return __generator(this,(function(b){this.continueLoading=true;t=this.billingAddress?this.getTranslatedAddress({currentAddress:this.billingAddress,translatedAddress:this.translatedBillingAddressState}):null;n=this.getTranslatedAddress({currentAddress:this.shippingAddress,translatedAddress:this.translatedShippingAddressState});i=f(Object.assign(Object.assign({},n),{country:this.shippingAddress.country}));a=t&&this.billingAddress&&f(Object.assign(Object.assign({},t),{country:this.billingAddress.country}));r=!!Object.keys(i).length;d=!!a&&!!Object.keys(a).length;if(r||d){l=(e=this.el.shadowRoot)===null||e===void 0?void 0:e.querySelectorAll("zonos-address-form");c=l===null||l===void 0?void 0:l[0];h=l===null||l===void 0?void 0:l[1];u=((o=c===null||c===void 0?void 0:c.shadowRoot)===null||o===void 0?void 0:o.querySelector(".has-error"))||((s=h===null||h===void 0?void 0:h.shadowRoot)===null||s===void 0?void 0:s.querySelector(".has-error"));if(u){u.scrollIntoView({behavior:"smooth",block:"center"})}this.continueLoading=false;return[2]}this.continueClicked.emit({billingAddress:t,shippingAddress:n});return[2]}))}))};this.buildTranslateAddressState=function(e){var o,s,t,n,i,a;var r=e.currentAddress,d=e.translatedAddress;var l=r.city,c=r.line1,h=r.line2,f=r.name,u=r.postal_code,b=r.state;return{city:(o={},o[l]=d.city,o),line1:(s={},s[c]=d.line1,s),line2:(t={},t[h]=d.line2,t),name:(n={},n[f]=d.name,n),postal_code:(i={},i[u]=d.postal_code,i),state:(a={},a[b]=d.state,a)}};this.continueLoading=false;this.dialogLoading=undefined;this.dialogOpen=false;this.submitBtnType=undefined;this.submitBtnColor=undefined;this.isMobile=false;this.shippingAddress=undefined;this.billingAddress=undefined;this.translatedShippingAddress=undefined;this.translatedBillingAddress=undefined;this.showErrorBanner=false;this.translatedShippingAddressState={};this.translatedBillingAddressState={}}e.prototype.watchTranslatedShippingAddress=function(){this.translatedShippingAddressState=this.translatedShippingAddress};e.prototype.watchTranslatedBillingAddress=function(){this.translatedBillingAddressState=this.translatedBillingAddress};e.prototype.componentWillLoad=function(){this.watchTranslatedBillingAddress();this.watchTranslatedShippingAddress()};e.prototype.render=function(){var e=this;var o=this.submitBtnColor||u.appearance.colorSecondary;var s=o==="#ffffff"?"outline":this.submitBtnType||"standard";var i=this.billingAddress;var a=this.shippingAddress;return t(n,{key:"655845cef04f4af526b1a1c4e49243c4f2b4c7f6",class:p(["zonos--address-update-dialog zonos--elements",this.isMobile&&"mobile"])},t("zonos-dialog",{key:"eab429bb78ce6f05ba463d8748d7edd5499402fa",isLoading:this.dialogLoading,mobile:this.isMobile,noBodyPadding:true,noBorder:true,noClickOutside:true,noCloseButton:true,onCloseDialog:function(){return e.closeUpdateDialog.emit()},open:this.dialogOpen,width:"568px"},t("div",{key:"08f0400e62addfcaffd91bf5200999d29bbd2da9",class:"zonos--body"},t("div",{key:"8699df5e2f823e19066fbb552ba2a66c127c05e9",class:"zonos--dialog-header"},t("div",{key:"92e0ff932dcdb0e5b59ea34b688d1ef8e31bfeb3",class:"zonos--dialog-title"},t("zonos-text",{key:"aaac3375526bddb319ce7c8f49bde30da7210264",type:"title"},d("Update your address")),t("zonos-button",{key:"66abf7b74045e68e84e631298504236d32ca9c4e",class:"zonos--close-button",icon:t("zonos-icon",{"aria-label":"Close checkout dialog",content:m}),noBackground:true,onClick:function(){return e.closeUpdateDialogHandler()}})),t("zonos-text",{key:"ffb3d8f169867d5f6dff269e1becd99c98c5a7da"},d("To ensure delivery all address details must be in Latin characters."))),t("div",{key:"2cb61f06ce174e2317870decfdd337c67c5cf128",class:"zonos--group"},t("zonos-text",{key:"a616c540984120b468e52bccfb380ea3974ced22",class:"zonos--what-you-entered",type:"semiBoldLabel"},d("What you entered")),t("div",{key:"6ac8f9c14472370c501af1b0d50bd8f8746b7694",class:"zonos--address-display-group"},t("zonos-address-display",{key:"ea2c67a7bba51c99f80be968e448beeffcf1f863",addressType:"shipping",currentAddress:a}),i&&t("zonos-address-display",{key:"7ea1683dc04a292810e04ed6550d86086f25186f",addressType:"billing",currentAddress:i})),t("div",{key:"4d1cd9096943518b8b4e267608a5e1542befb6a9",class:"zonos--address-form-section"},t("zonos-text",{key:"e4184a2cc618d26d43979fa8cfe06070cf8b5af8",type:"semiBoldLabel"},d("Translated address")),t("zonos-address-form",{key:"c55d9d3c658565ceb7c7b879f444e3937b9f7ad6",addressType:"shipping",class:"zonos--shipping-address-form",currentAddress:a,onAddressChange:function(o){var s=o.detail;e.translatedShippingAddressState=e.buildTranslateAddressState({currentAddress:a,translatedAddress:s})},translatedAddress:this.translatedShippingAddressState}),i&&t("zonos-address-form",{key:"c3facc295b1322bb00baa6081f343dcea4f10777",addressType:"billing",class:"zonos--billing-address-form",currentAddress:i,onAddressChange:function(o){var s=o.detail;e.translatedBillingAddressState=e.buildTranslateAddressState({currentAddress:i,translatedAddress:s})},translatedAddress:this.translatedBillingAddressState}))),t("div",{key:"1c89c9604ba0dece40275fcfac97e7f93706b430",class:"zonos--group-btn"},t("div",{key:"e47d393940b094b4e123864e4070daa87f0616f0",class:"zonos--button-wrapper"},t("zonos-button",{key:"216b7afe268a4acd6bb8a76b7f5a32dc09bdd4f6",class:"zonos--cancel-btn",onClick:function(){return e.closeUpdateDialogHandler()},variant:"subtle"},d("Cancel")),t("zonos-button",{key:"acbacb92cedb325b46843d8f3aff13f4e7c86ab5",backgroundColor:this.submitBtnColor,class:"zonos--update-btn",loading:this.continueLoading,onClick:function(){return e.continueClickHandler()},size:"sm",variant:s},d("Update address")))))))};Object.defineProperty(e.prototype,"el",{get:function(){return i(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{translatedShippingAddress:["watchTranslatedShippingAddress"],translatedBillingAddress:["watchTranslatedBillingAddress"]}},enumerable:false,configurable:true});return e}());L.style=O;var E=["blue","cyan","green","orange","purple","red","gray","glass"];var B=":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;cursor:pointer}:host label{display:-ms-inline-flexbox;display:inline-flex;position:relative;gap:8px;-ms-flex-align:center;align-items:center}:host label.disabled{cursor:not-allowed;opacity:0.6}:host input[type=checkbox]{opacity:0;position:absolute;left:0;width:0;height:0;top:0;z-index:-99999}:host svg{opacity:0}:host .checkmark-container{height:var(--size);width:var(--size);background-color:transparent;border:1.5px solid var(--zonos-elements-gray-400);position:relative;border-radius:var(--border-radius, var(--zonos-elements-radius-4))}:host .checkmark{opacity:0;position:absolute;top:-1.5px;left:-1.5px;right:-1.5px;bottom:-1.5px;width:calc(100% + 3px);-webkit-transition:0.3s all cubic-bezier(0.175, 0.885, 0.32, 1.275);transition:0.3s all cubic-bezier(0.175, 0.885, 0.32, 1.275);-webkit-transform:scale(0.4);transform:scale(0.4);background-color:var(--background-color);border-radius:var(--border-radius, var(--zonos-elements-radius-4))}:host input[type=checkbox]:checked~.checkmark-container .checkmark{opacity:1;-webkit-transform:scale(1);transform:scale(1)}";var S=B;var T=e("zonos_checkbox",function(){function e(e){o(this,e);this.checkboxSelected=s(this,"checkboxSelected",7);this.backgroundColor="blue";this.label=undefined;this.isChecked=false;this.isDisabled=false;this.size=12;this.fontSize="base";this.borderStyle=undefined}e.prototype.onClick=function(){if(this.isDisabled){return}this.checkboxSelected.emit(!this.isChecked)};e.prototype.render=function(){var e=this;var o=E.includes(this.backgroundColor);var s=o?"var(--zonos-elements-".concat(this.backgroundColor,"-600)"):this.backgroundColor;var i=o?"var(--zonos-elements-".concat(this.backgroundColor,"-200)"):!z(s)?"var(--zonos-elements-gray-800)":"var(--zonos-elements-gray-0)";var a=v({customRoundRadius:"4px",overrideBorderStyle:this.borderStyle});return t(n,{key:"bf51dd642e88096e874d78023a29dd68239e8d3a",class:p(["zonos--elements zonos--checkbox"]),style:{"--background-color":s,"--border-radius":a,"--font-family":b(),"--size":"".concat(this.size,"px")}},t("label",{key:"3598c9f21285304499aaafbab5226d619ecf4e69",class:p([this.isDisabled&&"disabled"])},t("input",{key:"277507f643404e6e44191c2d715b70f38fc6af85",checked:this.isChecked,disabled:this.isDisabled,hidden:true,onChange:function(o){e.checkboxSelected.emit(o.target.checked)},type:"checkbox"}),t("span",{key:"3f0fd0d458e8cf660fa883ceaa241e3397829548",class:"checkmark-container"},t("svg",{key:"0d654744bea5b5696ddcf3778a155fb622022f1e",class:"checkmark",color:i,fill:"none",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},t("path",{key:"cc19837ee088feb7053fdaeaea0d1213cbc60775","clip-rule":"evenodd",d:"M17.456 7.404a.75.75 0 0 1 .14 1.052l-6.5 8.5a.75.75 0 0 1-1.126.074l-4-4a.75.75 0 0 1 1.06-1.06l3.395 3.394 5.98-7.82a.75.75 0 0 1 1.05-.14Z",fill:"currentColor","fill-rule":"evenodd"}))),this.label&&t("zonos-text",{key:"cb85d59651f67a33126d37c3ebfb1e8a91b457fe",size:this.fontSize},this.label)))};return e}());T.style=S;var V=":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 D=V;var P=e("zonos_collapse",function(){function e(e){o(this,e);this.collapsed=false;this.collapseSize=0;this.height=this.el.scrollHeight;this.iframe=null}e.prototype.getElementHeight=function(){var e="".concat(this.height,"px");var o="".concat(this.collapseSize,"px");return this.collapsed?o:e};e.prototype.componentDidLoad=function(){this.height=this.el.scrollHeight};e.prototype.componentDidRender=function(){var e=this;var o,s,t;this.iframe=((o=this.el.shadowRoot)===null||o===void 0?void 0:o.querySelector("iframe"))||null;(t=(s=this.iframe)===null||s===void 0?void 0:s.contentWindow)===null||t===void 0?void 0:t.addEventListener("resize",(function(){if(!e.iframe){return}e.height=parseFloat(getComputedStyle(e.iframe).height)}))};e.prototype.render=function(){var e=this;if(!this.collapsed){setTimeout((function(){if(!e.collapsed){e.el.style.overflow="visible"}}),300)}else{this.el.style.overflow="hidden"}return t(n,{key:"7cc2167ab3dab1a975d141f3c58d3c5982c1645a",class:"zonos--elements zonos--collapse",style:{"--font-family":b(),height:this.getElementHeight()}},t("div",{key:"1b791702f95066643ac82402a9fcff19b0fcc706"},t("iframe",{key:"08f678a4ce92f5600c584e329e3039bc4588ff3a",class:"height-change-listener",tabindex:"-1",title:"collapse-height-change-listener"}),t("slot",{key:"83119f9ba9764c46fa7d1dd7b4c0b08c49033607"})))};Object.defineProperty(e.prototype,"el",{get:function(){return i(this)},enumerable:false,configurable:true});return e}());P.style=D;var M='<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 N=":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:0;top:0;background:var(--zonos-elements-backdrop-color);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:2147483009;background:var(--zonos-elements-gray-0);border-radius:var(--border-radius, var(--zonos-elements-radius-10))}: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(--zonos-elements-text-color);visibility:hidden}:host .zonos--dialog{position:relative;z-index:2147483008;background:var(--zonos-elements-gray-0);max-width:90vw;max-height:90vh;min-height:var(--min-height, auto);height:var(--height, auto);width:var(--width, auto);border-radius:var(--border-radius, var(--zonos-elements-radius-10));outline:none;-webkit-box-shadow:var(--zonos-elements-v3-shadow-xxl);box-shadow:var(--zonos-elements-v3-shadow-xxl);border:var(--zonos-elements-border);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:16px 24px}:host .zonos--header .-zonos-stencil-library--header-text{-ms-flex-positive:1;flex-grow:1}:host .zonos--header .zonos--close-button{width:var(--zonos-elements-size-md);height:var(--zonos-elements-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(--zonos-elements-radius-10);-ms-flex-item-align:start;align-self:flex-start}:host .zonos--header .zonos--close-button:hover{background:var(--zonos-elements-hover-color)}:host .zonos--body{padding:8px 24px;max-height:100%;height:100%;overflow:auto}:host .zonos--body.zonos--no-body-padding{padding:0}:host .zonos--footer{padding:16px 24px}:host(.open) .zonos--dialog-layout,:host(.open) .zonos--backdrop{visibility:visible}:host(.open) .zonos--backdrop{z-index:2147483008;opacity:0.65}:host(.open) .zonos--dialog-layout{opacity:1;z-index:2147483009;-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 U=N;var Z=e("zonos_dialog",function(){function e(e){var t=this;o(this,e);this.closeDialog=s(this,"closeDialog",3);this.isMobileMode=function(){return t.mobile||window.innerWidth<=768};this.closeButtonHandler=function(){if(!t.open){return}t.closeDialog.emit()};this.clickOutsideDialogHandler=function(e){if(e.target===e.currentTarget&&!t.noClickOutside){t.closeDialog.emit()}};this.open=false;this.headerText="";this.width="460px";this.height=undefined;this.minHeight=undefined;this.noHeader=false;this.noBodyPadding=false;this.noBorder=false;this.borderStyle=undefined;this.noCloseButton=false;this.noClickOutside=false;this.mobile=false;this.isLoading=true;this.isMobile=false}e.prototype.handleWindowResize=function(){this.isMobile=this.isMobileMode()};e.prototype.handleKeyDown=function(e){if(e.key==="Escape"){this.closeButtonHandler()}};e.prototype.componentDidLoad=function(){this.isMobile=this.isMobileMode()};e.prototype.render=function(){if(this.open){document.body.style.overflow="hidden"}else{document.body.style.overflow="auto"}var e=v({overrideBorderStyle:this.borderStyle});return t(n,{key:"03735385e07c7f6c8a87df42ad95f8c9d9533668",class:p(["zonos--elements",this.open&&"open",this.isLoading&&"is-loading",this.noBorder&&"no-border",this.isMobile&&"mobile"]),style:{"--border-radius":e,"--font-family":b(),"--height":this.height||"initial","--min-height":this.minHeight||"500px","--width":this.width}},t("div",{key:"da5d599e1a247f7e3364e6f5c9b2eae3db9539f5",class:"zonos--backdrop"}),t("div",{key:"cda1a996d9521c2e0b307f7a03ca3ee3d4915b8d",class:"zonos--dialog-layout",inert:!this.open,onClick:this.clickOutsideDialogHandler},t("div",{key:"471d8a069d4f580233bdb3e9e971efdb268ef57d",class:"zonos--dialog"},this.isLoading&&t("div",{key:"57220007aabcaef133c2c0782fa238cc43d63964",class:"zonos--loading"},t("zonos-spinner",{key:"0298b754341abd61ec07706128d05df5332f915d",size:30})),(this.headerText||!this.noCloseButton)&&t("div",{key:"5103dbc1c7593a8042505f767d8290825f9d10e7",class:"zonos--header"},this.headerText&&t("h3",{key:"a2d9cd4c8cb359aa64cf104a172ca960068c20a0",class:"zonos--header-text"},this.headerText),!this.noCloseButton&&t("zonos-button",{key:"de9bf8a949344d19fcb8bfb496719282553be194",class:"zonos--close-button",icon:t("zonos-icon",{"aria-label":"Close dialog",content:M}),noBackground:true,onClick:this.closeButtonHandler,variant:"subtle"})),t("div",{key:"1ec2cdca0f186cd0b28602580022ed0cb4b0eec9",class:p(["zonos--body",this.noBodyPadding&&"zonos--no-body-padding"])},t("slot",{key:"5071d921f48bf792a951a390d83b121e32771668"})),t("slot",{key:"c1818ac301afc845f5b14fd0f2ac9a1fd3a27b99",name:"dialog-footer"}))))};Object.defineProperty(e,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return e}());Z.style=U;var F=".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:16px}";var H=F;var R=e("zonos_link_authentication",function(){function e(e){o(this,e);this.titleText=undefined;this.defaultEmail=null;this.stripe=a.stripe}e.prototype.watchInitStripe=function(){if(!this.stripe||!a.stripeElements){return}var e=this.defaultEmail?{email:this.defaultEmail}:undefined;var o=a.stripeLinkElement||a.stripeElements.create("linkAuthentication",{defaultValues:e||undefined});var s=this.el.querySelector(".zonos--link-authentication-component");if(!s){c("Cannot find container element for linkAuthenticationElement");return}o.mount(s);o.on("change",(function(e){a.stripeLinkEventData=e}));a.stripeLinkElement=o};e.prototype.componentDidLoad=function(){this.watchInitStripe()};e.prototype.render=function(){return t(n,{key:"f0b26abf99ef99c6665dabdddebc9ff086b6816c",class:"zonos--link-authentication zonos--elements"},t("zonos-text",{key:"898dbdffac06fe2a68af90610a22044bb72391ce",class:"zonos--title",type:"semiBoldLabel"},this.titleText),t("div",{key:"e2ec9abb0cf76a39a1262e1366e375dd898450cd",class:"zonos--link-authentication-component"}))};Object.defineProperty(e.prototype,"el",{get:function(){return i(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{stripe:["watchInitStripe"]}},enumerable:false,configurable:true});return e}());R.style=H}}}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(n,e,t,r){function o(n){return n instanceof t?n:new t((function(e){e(n)}))}return new(t||(t=Promise))((function(t,i){function u(n){try{s(r.next(n))}catch(n){i(n)}}function a(n){try{s(r["throw"](n))}catch(n){i(n)}}function s(n){n.done?t(n.value):o(n.value).then(u,a)}s((r=r.apply(n,e||[])).next())}))};var __generator=this&&this.__generator||function(n,e){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,o,i,u;return u={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(u[Symbol.iterator]=function(){return this}),u;function a(n){return function(e){return s([n,e])}}function s(a){if(r)throw new TypeError("Generator is already executing.");while(u&&(u=0,a[0]&&(t=0)),t)try{if(r=1,o&&(i=a[0]&2?o["return"]:a[0]?o["throw"]||((i=o["return"])&&i.call(o),0):o.next)&&!(i=i.call(o,a[1])).done)return i;if(o=0,i)a=[a[0]&2,i.value];switch(a[0]){case 0:case 1:i=a;break;case 4:t.label++;return{value:a[1],done:false};case 5:t.label++;o=a[1];a=[0];continue;case 7:a=t.ops.pop();t.trys.pop();continue;default:if(!(i=t.trys,i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){t=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){t.label=a[1];break}if(a[0]===6&&t.label<i[1]){t.label=i[1];i=a;break}if(i&&t.label<i[2]){t.label=i[2];t.ops.push(a);break}if(i[2])t.ops.pop();t.trys.pop();continue}a=e.call(n,t)}catch(n){a=[6,n];o=0}finally{r=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};System.register(["./p-a74a7afa.system.js","./p-f87a635b.system.js"],(function(n){"use strict";var e,t,r,o;return{setters:[function(n){e=n.l;t=n.a},function(e){r=e.s;o=e.c;var t={};t.checkoutHiddenBtnSelector=e.c;t.domesticRedirectedBtnSelector=e.d;n(t)}],execute:function(){var i=this;var u=function(n){var e=n.loadScriptSrc;if(!e){return{currentLoadScriptUrl:"",isForceLoadVersionDomain:false,isWhiteListed:false}}var t=["dev.elements.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"];var r=["qa.js.zonos.com"];var o=new URL(e).origin;var i=t.some((function(n){return o.includes(n)}));var u=r.some((function(n){return o.includes(n)}));return{currentLoadScriptUrl:o,isForceLoadVersionDomain:u,isWhiteListed:i}};var a=["jsdelivr","cdnjs","unpkg","vercel"];var s="jsdelivr";var c=function(n){var e=a.indexOf(n);var t=a[e+1];return t||null};var l=function(n){if(!n){return null}var e=new URL(n).searchParams;var t=e.get("zonosQaUrl");if(!t){return null}var r=/[^a-zA-Z0-9-_]+/.test(t);if(!!r){return null}return t};var d=function(){var n=window&&window.location.href.includes("forceLoadCdn");if(typeof window==="undefined"||n){return null}var t=l(window.location.href);var r="https://v1.3.53.js.zonos.com";if(!t&&(r.includes("test.")||r.includes("test-"))){return r}if(!t&&["dev.demo.elements.zonos.com"].includes(window.location.hostname)){return"https://dev.elements.zonos.com"}if(!t){return null}if(t==="dev-elements"){return"https://dev.elements.zonos.com"}var o="preview.js.zonos.com";var i="https://".concat(t,".").concat(o);e("[ZONOS-WARNING] using '".concat(i,"' for loading script"),"warn");void fetch(i).then((function(){window.sessionStorage.removeItem("zonos--checkout-session-id");window.sessionStorage.removeItem("zonos--client-secret")})).catch((function(){alert("[ZONOS-WARNING] '".concat(i,"' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE"));var n=new URLSearchParams(window.location.search);n.delete("zonosQaUrl");var e=window.location.pathname;var t="".concat(e,"?").concat(n.toString());window.history.replaceState(window.history.state,"",t);window.location.reload();return null}));return i};var f="https://js.stripe.com/v3";var v=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/;var m="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";var w=function(){var n=document.querySelectorAll('script[src^="'.concat(f,'"]'));for(var e=0;e<n.length;e++){var t=n[e];if(!t){continue}if(!v.test(t.src)){continue}return t}return null};var p=null;var h=function(n){var e=n&&!n.advancedFraudSignals?"?advancedFraudSignals=false":"";var r=document.createElement("script");r.src="".concat(f).concat(e);var o=document.head||document.body;if(!o){t("Expected document.body not to be null. Stripe.js requires a <body> element.");return null}o.appendChild(r);return r};var y=function(n){if(p!==null){return p}p=new Promise((function(e,t){if(typeof window==="undefined"||typeof document==="undefined"){e(null);return}if(window.Stripe&&n){console.warn(m)}if(window.Stripe){e(window.Stripe);return}try{var r=w();if(r&&n){console.warn(m)}else if(!r){r=h(n)}r===null||r===void 0?void 0:r.addEventListener("load",(function(){if(window.Stripe){e(window.Stripe)}else{t(new Error("Stripe.js not available"))}}));r===null||r===void 0?void 0:r.addEventListener("error",(function(){t(new Error("Failed to load Stripe.js"))}))}catch(n){t(n);return}}));return p};var z=function(n,e){if(!n||!n._registerWrapper){return}n._registerWrapper({name:"stripe-js",startTime:e})};var j=function(n,e,t){if(n===null){return null}var r=n.apply(undefined,e);z(r,t);return r};var g=Promise.resolve().then((function(){return y(null)}));var b=false;g.catch((function(n){if(!b){console.warn(n)}}));var k=function(){var n=[];for(var e=0;e<arguments.length;e++){n[e]=arguments[e]}return __awaiter(i,void 0,void 0,(function(){var e;return __generator(this,(function(t){b=true;e=Date.now();return[2,g.then((function(t){return j(t,n,e)}))]}))}))};var S="tempCartUUID";var O=function(){var n=new URLSearchParams(window.location.search);var e=n.get(S);return e};var U;var L=function(){if(typeof document==="undefined"){return null}var n=document.querySelector('script[src*="/zonos.js"]');var e=u({loadScriptSrc:n===null||n===void 0?void 0:n.src}),t=e.currentLoadScriptUrl,r=e.isWhiteListed;if(r){return t}return null}();var N="https://v1.3.53.js.zonos.com";var _=L||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.53";var R="https://unpkg.com/@zonos/elements@1.3.53";var A="https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.53";var I="https://rsms.me";var E="https://fonts.googleapis.com";var F=/^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;var T=function(){function n(){}return n}();n("Zonos",T);U=T;T.doneInit=false;T.debug=typeof window!=="undefined"&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/);T.zonosConversionTest=typeof window!=="undefined"&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/);T._paypalMockResponse=null;T.isBigCommerce=false;T.releaseDate="1726614519273";T.isLegacyCheckout=false;T.isNpm=true;T.zonosQaUrl=null;T.version="v".concat("1.3.53");T.modeAlerted=false;T.cartData=null;T.paypal=null;T.getCurrentTimestamp=function(){return(new Date).getTime()};T.zonosController=null;T.init=function(n){return __awaiter(i,[n],void 0,(function(n){var i,u;var a=n.appearance,s=n.checkoutSettings,c=n.currencyConverter,l=n.helloSettings,d=n.onCountryChange,f=n.overrideCurrencyFormat,v=n.storeId,m=n.zonosApiKey;return __generator(this,(function(n){switch(n.label){case 0:U.cartId=O();if(U.doneInit){return[2]}e("====== ZONOS DEBUG MODE: on (".concat(U.version,") ======"));U.zonosApiKey=m;U.storeId=v;if(!U.isNpm)return[3,2];e("====== ZONOS LOADING FROM NPM ======");if(!m&&!U.cartId){t("Zonos API key is required unless `tempCartUUID` is provided in url query params.");return[2]}if(!(!U.cartData&&U.cartId))return[3,2];e("Initialize cart data");return[4,r(U.cartId)];case 1:i=n.sent();if(!i){t("Failed to get cart data");return[2]}U.cartData=i.cartData;U.zonosApiKey=i.zonosApiKey;n.label=2;case 2:if(U.cartId&&U.cartData){e("Cart data is available, inject hidden button and trigger checkout");u=document.createElement("button");u.style.display="none";u.id="".concat(o);document.body.appendChild(u)}e("init zonos");U.injectZonosCdn();U.injectZonosCss();U.injectFonts();U.injectController({config:{appearance:a,checkoutSettings:s,currencyConverter:c,helloSettings:l,onCountryChange:d,overrideCurrencyFormat:f}});U.doneInit=true;return[2]}}))}))};T.displayCurrency=function(){var n=document.querySelector("zonos-hello");if(n){void n.displayCurrency()}};T.openHelloDialog=function(n){var e=document.querySelector("zonos-hello");if(e){void e.openHelloDialog(n!==null&&n!==void 0?n:true)}};T.showNotification=function(n){var e;void((e=U.zonosController)===null||e===void 0?void 0:e.showNotification(n))};T.updateOrganizationName=function(n){var e;void((e=U.zonosController)===null||e===void 0?void 0:e.updateOrganizationName(n))};T.disablePlaceOrderButtons=function(n){var e=n.autoEnable,t=e===void 0?true:e,r=n.config,o=n.disable,i=n.placeOrderButtonSelector;var u;if((u=r.checkoutSettings)===null||u===void 0?void 0:u.disablePlaceOrderButtonActivation){return}if(i){var a=document.querySelectorAll(i);var s=function(n){var e=n.target;if(e.getAttribute("disabled")){n.preventDefault();n.stopPropagation()}};a.forEach((function(n){var e=n.getAttribute("data-zonos-checkout-attached");if(e){return}if(o){n.setAttribute("disabled","true");n.addEventListener("click",s)}else{n.removeAttribute("disabled");n.removeEventListener("click",s)}}));if(t&&o){setTimeout((function(){a.forEach((function(n){n.removeAttribute("disabled");n.removeEventListener("click",s)}))}),5e3)}}};T.injectController=function(n){var r=n.config;var o;if(document.querySelector("zonos-controller")){return}if((o=r.checkoutSettings)===null||o===void 0?void 0:o.placeOrderButtonSelector){var u=r.checkoutSettings.placeOrderButtonSelector;U.disablePlaceOrderButtons({config:r,disable:true,placeOrderButtonSelector:u});var a=new MutationObserver((function(){U.disablePlaceOrderButtons({config:r,disable:true,placeOrderButtonSelector:u})}));a.observe(document.body,{childList:true,subtree:true})}var s=document.createElement("zonos-controller");s.config=r;s.zonosApiKey=U.zonosApiKey||"";s.addEventListener("stripeInitEvent",(function(n){return __awaiter(i,void 0,void 0,(function(){var r,o;return __generator(this,(function(i){switch(i.label){case 0:r=n.detail;e("loading Stripe");return[4,k(r.publishableKey)];case 1:o=i.sent();if(!o){t("API seems to be invalid or missing. Failed to load Stripe");return[2]}window.Zonos.stripe=o;void s.initCheckoutElement(o);return[2]}}))}))}));document.body.appendChild(s);U.zonosController=s;e("Zonos controller injected!")};T.injectScript=function(n){var r=n.cdnType,o=n.isModule,i=n.theRestUrl;var u=U.getZonosUrl(r);var a="".concat(u,"/").concat(i);var s=function(){var n=document.querySelector('script[src="'.concat(a,'"]'));return!!n};if(s()){e('Zonos script "'.concat(a,'" already exists in the document'),"warn");return}var l=document.head||document.body;var d=document.createElement("script");if(!!o){d.type="module"}else{d.noModule=true}d.src=a;d.crossOrigin="anonymous";d.onerror=function(){t("Failed to load ".concat(d.src));var n=c(r);if(!n){return}U.injectScript({cdnType:n,isModule:o,theRestUrl:i})};l.appendChild(d)};T.getZonosUrl=function(n){var e=function(){switch(n){case"jsdelivr":return _;case"unpkg":return R;case"cdnjs":return A;case"vercel":return N}};if(U.isNpm){var t=d();return t||e()}return e()};T.injectZonosCdn=function(){U.injectScript({cdnType:s,isModule:true,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"});U.injectScript({cdnType:s,isModule:false,theRestUrl:"dist/zonos-elements/zonos-elements.js"});e("Zonos cdn script injected!")};T.injectStylesheet=function(n){var e=n.cdnType,r=n.theRestUrl;var o=U.getZonosUrl(e);var i=document.head||document.body;var u=document.createElement("link");u.rel="preconnect";u.href="".concat(N,"/");i.appendChild(u);var a=document.createElement("link");a.rel="stylesheet";a.href="".concat(o,"/").concat(r);a.onerror=function(){t("Failed to load ".concat(a.href));var n=c(e);if(!n){return}U.injectStylesheet({cdnType:n,theRestUrl:r})};i.appendChild(a)};T.injectZonosCss=function(){var n=function(){return!!document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')};if(n()){e("Zonos style links already injected","warn");return}U.injectStylesheet({cdnType:s,theRestUrl:"dist/zonos-elements/zonos-elements.css"});e("Zonos style css injected!")};T.injectFonts=function(){var n=function(){var n=document.querySelectorAll('link[rel="stylesheet"][href^="'.concat(I,'"]'));for(var e=0;e<n.length;e++){var t=n[e];if(!t){continue}if(F.test(t.href)){continue}return t}return null};if(n()){e("Inter font already injected","warn");return}var t=document.head||document.body;var r=document.createElement("link");r.rel="preconnect";r.href=I;t.appendChild(r);var o=document.createElement("link");o.rel="stylesheet";o.href="".concat(I,"/inter/inter.css");t.appendChild(o);e("Zonos font injected!")};T.setupGoogleFont=function(n){var e;void((e=U.zonosController)===null||e===void 0?void 0:e.setupGoogleFont(n))};T.injectSupportGoogleFont=function(n){var t;e("[FONT] injecting ".concat(n));var r=(t=n.match(/family=(.*?):/))===null||t===void 0?void 0:t[1];var o=document.head||document.body;if(!document.querySelector('link[rel="preconnect"][href^="'.concat(E,'"]'))){var i=document.createElement("link");i.rel="preconnect";i.href=E;o.appendChild(i)}if(document.querySelector('link[rel="stylesheet"][href="'.concat(n,'"]'))){e("[FONT] ".concat(r," font already injected"),"warn");return}var u=document.createElement("link");u.rel="stylesheet";u.href=n;o.appendChild(u);e("[FONT] ".concat(r," font injected!"))}}}}));
|