@zonos/elements 1.3.85 → 1.3.87
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/{cart-fc426d98.js → cart-120d68f9.js} +38 -23
- package/dist/cjs/{createCustomEvent-354c8e63.js → createCustomEvent-ed9156dc.js} +1 -1
- package/dist/cjs/index.cjs.js +7 -7
- package/dist/cjs/{paypal-1fe5ed0c.js → paypal-875cfaf1.js} +1 -1
- package/dist/cjs/zonos-address_7.cjs.entry.js +1 -1
- package/dist/cjs/zonos-cart-items_12.cjs.entry.js +8 -8
- package/dist/cjs/zonos-checkout.cjs.entry.js +3 -3
- package/dist/cjs/zonos-controller.cjs.entry.js +1 -1
- package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -1
- package/dist/cjs/zonos-country-select_4.cjs.entry.js +1 -1
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +1 -1
- package/dist/cjs/zonos-hello.cjs.entry.js +1 -1
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +1 -1
- package/dist/cjs/zonos-notification_3.cjs.entry.js +2 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.js +2 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +3 -3
- package/dist/collection/components/store/checkout/cart.js +22 -12
- package/dist/collection/components/store/checkout/stripe.js +16 -11
- package/dist/collection/types/generated/graphql.frontend.types.js +5 -5
- package/dist/esm/{cart-6c44367a.js → cart-9f1caabf.js} +38 -23
- package/dist/esm/{createCustomEvent-ec15a4a7.js → createCustomEvent-464c49c0.js} +1 -1
- package/dist/esm/index.js +7 -7
- package/dist/esm/{paypal-a562a640.js → paypal-fb449438.js} +1 -1
- package/dist/esm/zonos-address_7.entry.js +1 -1
- package/dist/esm/zonos-cart-items_12.entry.js +8 -8
- package/dist/esm/zonos-checkout.entry.js +3 -3
- package/dist/esm/zonos-controller.entry.js +1 -1
- package/dist/esm/zonos-country-flag.entry.js +1 -1
- package/dist/esm/zonos-country-select_4.entry.js +1 -1
- package/dist/esm/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm/zonos-hello.entry.js +1 -1
- package/dist/esm/zonos-language-select_2.entry.js +1 -1
- package/dist/esm/zonos-notification_3.entry.js +2 -2
- package/dist/esm-es5/{cart-6c44367a.js → cart-9f1caabf.js} +1 -1
- package/dist/esm-es5/{createCustomEvent-ec15a4a7.js → createCustomEvent-464c49c0.js} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{paypal-a562a640.js → paypal-fb449438.js} +1 -1
- package/dist/esm-es5/zonos-address_7.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-controller.entry.js +1 -1
- package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
- package/dist/esm-es5/zonos-country-select_4.entry.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/scripts/index.d.ts +1 -1
- 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/store/checkout/cart.d.ts +7 -3
- package/dist/types/types/generated/graphql.frontend.types.d.ts +28 -29
- package/dist/types/types/generated/graphql.frontend.types.ts +43 -44
- package/dist/types/types/generated/graphql.internal.types.d.ts +3 -3
- package/dist/types/types/generated/graphql.internal.types.ts +3 -3
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-1eb59b7c.system.entry.js → p-0b01b9b1.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-5ba198b3.entry.js → p-253cbdae.entry.js} +1 -1
- package/dist/zonos-elements/{p-b9645c27.system.js → p-294026a0.system.js} +1 -1
- package/dist/zonos-elements/{p-63a33354.system.entry.js → p-35577bd8.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-7b4a5b9b.system.entry.js → p-3d521899.system.entry.js} +1 -1
- package/dist/zonos-elements/p-4412b94b.system.entry.js +1 -0
- package/dist/zonos-elements/{p-d7b341e3.system.entry.js → p-49a3a2a5.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-35b6b151.system.entry.js → p-5bef550e.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-76013796.system.entry.js → p-69bb9b53.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-6b7fa35e.system.js → p-6c380fa8.system.js} +1 -1
- package/dist/zonos-elements/{p-b5316c2c.entry.js → p-72513d54.entry.js} +1 -1
- package/dist/zonos-elements/p-7f21c1c4.entry.js +1 -0
- package/dist/zonos-elements/{p-a858a304.entry.js → p-7fce2a19.entry.js} +1 -1
- package/dist/zonos-elements/{p-092961f1.system.js → p-89d2a27b.system.js} +1 -1
- package/dist/zonos-elements/{p-01604d44.entry.js → p-92f1cf70.entry.js} +1 -1
- package/dist/zonos-elements/{p-133595ff.system.entry.js → p-94589f18.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-3b3cb2a4.entry.js → p-9f36076f.entry.js} +1 -1
- package/dist/zonos-elements/{p-51e2df70.entry.js → p-a7b6fd9c.entry.js} +1 -1
- package/dist/zonos-elements/{p-95241447.entry.js → p-b58f4433.entry.js} +1 -1
- package/dist/zonos-elements/{p-5ebde561.system.entry.js → p-c0a7750c.system.entry.js} +1 -1
- package/dist/zonos-elements/p-c78dd680.system.js +1 -1
- package/dist/zonos-elements/{p-ee8b5e53.js → p-cb9ff4df.js} +1 -1
- package/dist/zonos-elements/{p-64b67900.entry.js → p-d33a87fc.entry.js} +1 -1
- package/dist/zonos-elements/{p-08fee913.system.js → p-d7cf2a25.system.js} +1 -1
- package/dist/zonos-elements/{p-cbb742ab.js → p-d81f35bf.js} +2 -2
- package/dist/zonos-elements/{p-c37b99dd.system.entry.js → p-e05eed8e.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-e78c2429.entry.js → p-e6129027.entry.js} +1 -1
- package/dist/zonos-elements/{p-710ac059.js → p-f7ec6999.js} +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/zonos-elements/p-a26a8ca5.system.entry.js +0 -1
- package/dist/zonos-elements/p-de6c2a4a.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,c as t,h as n,H as e}from"./p-5b7da777.js";import{x as i,j as s,y as r,d as a,a as c}from"./p-
|
|
1
|
+
import{r as o,c as t,h as n,H as e}from"./p-5b7da777.js";import{x as i,j as s,y as r,d as a,a as c}from"./p-cb9ff4df.js";import{z as l,b as d,d as h}from"./p-1086aac3.js";import{h as u,a as m,l as f}from"./p-ad7ce197.js";import"./p-a1b755bf.js";import"./p-1ca5696d.js";const p=o=>{const t=document.querySelector(o);if(!document.querySelector("zonos-hello")&&t){const o=document.createElement("zonos-hello");return t.appendChild(o),!0}return!1},w=async o=>{if(window.Zonos.isLegacyCheckout)return void f("Hello is disabled when isLegacyCheckout","info");const{anchorElementSelector:t}=o;let n=t;if(!o.anchorElementSelector&&o.desktopLocation){const o=(({position:o="bottom-right"})=>{const t=".zonos--hello-mobile-wrapper";if(document.querySelector(t))return t;const n=document.createElement("div");return n.className="zonos--hello-mobile-wrapper",n.style.position="fixed","top-right"===o&&(n.style.top="72px",n.style.right="24px"),"top-left"===o&&(n.style.top="72px",n.style.left="24px"),"bottom-right"===o&&(n.style.bottom="72px",n.style.right="24px"),"bottom-left"===o&&(n.style.bottom="72px",n.style.left="24px"),n.style.zIndex="2147483007",document.body.appendChild(n),t})({position:"bottom-right"});n=o}if(n&&i(n)){if(f("Hello init complete"),!p(n)){const o=new MutationObserver((()=>{p(n)&&o.disconnect()}));o.observe(document.body,{childList:!0,subtree:!0}),setTimeout((()=>{p(n)}),1e3)}}else m(`Selector anchorElementSelector "${o.anchorElementSelector}" is not a valid selector.`)},b=class{constructor(n){o(this,n),this.paypalInitEvent=t(this,"paypalInitEvent",7),this.stripeInitEvent=t(this,"stripeInitEvent",7),this.config=void 0,this.zonosApiKey=void 0}async initCheckoutElement(o){var t;o?(s.stripe=o,((t=l.checkoutSettings).placeOrderButtonSelector||window.Zonos.cartData)&&(!t.placeOrderButtonSelector||i(t.placeOrderButtonSelector)?(()=>{if(!document.querySelector("zonos-checkout")){const o=document.createElement("zonos-checkout");document.body.appendChild(o)}})():m(`Selector checkoutButtonAnchor "${t.placeOrderButtonSelector}" is not a valid selector`)),f("init checkout element")):f("Stripe is not loaded yet - cannot init checkout element","warn")}initZonosNotification(){if(document.querySelector("zonos-notification"))return;const o=document.createElement("zonos-notification");document.body.appendChild(o)}async setupGoogleFont(o){var t,n;const e=o||h();if("Inter"===e){if(!o)return;f("[FONT] Just applied Inter , but no need to inject since we already inject Inter on start","warn"),l.appearance=Object.assign(Object.assign({},l.appearance),{fontFamily:o})}const i=new URLSearchParams;i.set("family",e);const{errors:s,json:r}=await u(`/api/zonos-elements/get-font-detail?${i.toString()}`);if(s.length>0||!(null==r?void 0:r.fontUrl))return f(`Failed to load font ${e}`,"warn"),void(l.appearance=Object.assign(Object.assign({},l.appearance),{fontFamily:"Inter"}));null===(n=(t=window.Zonos).injectSupportGoogleFont)||void 0===n||n.call(t,r.fontUrl),o&&(f(`[FONT] ${o} font override applied`),l.appearance=Object.assign(Object.assign({},l.appearance),{fontFamily:o}))}handleLocationChange(){w(l.helloSettings)}initHistoryListener(){const o=history.pushState;history.pushState=function(){return window.dispatchEvent(new window.Event("pushstate")),window.dispatchEvent(new window.Event("locationchange")),o.apply(this,arguments)};const t=history.replaceState;history.replaceState=function(){return window.dispatchEvent(new window.Event("replacestate")),window.dispatchEvent(new window.Event("locationchange")),t.apply(this,arguments)}}async componentWillLoad(){this.initHistoryListener(),l.zonosApiKey=this.zonosApiKey,(async()=>{var o,t;const{errors:n,json:e,zonosMode:i}=await(async()=>{const{errors:o,json:t,zonosMode:n}=await u("/api/zonos-elements/zonos-settings");return o.length?(m("Error occurred when getting zonos settings. If this is not an unauthorized error, it will use user settings or default settings"),{errors:o,json:null,zonosMode:n}):{errors:[],json:t,zonosMode:n}})();if("403"===(null===(o=n[0])||void 0===o?void 0:o.type.toString()))return void f("Failed to load zonos settings. This domain may not have access","warn");this.initZonosNotification();const s=Object.assign(Object.assign({},this.config),{appearance:Object.assign(Object.assign({},this.config.appearance),{logoUrl:(()=>{var o,t,n;return window.Zonos.isLegacyCheckout?(null===(o=null==e?void 0:e.appearanceSettings)||void 0===o?void 0:o.logoUrl)||(null===(t=this.config.appearance)||void 0===t?void 0:t.logoUrl):null===(n=this.config.appearance)||void 0===n?void 0:n.logoUrl})()}),checkoutSettings:this.config.checkoutSettings?Object.assign(Object.assign({},this.config.checkoutSettings),{subscriptionStatus:void 0}):void 0});d({overrideSettings:s,zonosSettings:e}),l.zonosMode=i,this.setupGoogleFont(),"DISABLED"===l.helloSettings.visibilityStatus&&f("=== Hello is disabled by store owner ===","warn"),l.helloSettings&&"ENABLED"===l.helloSettings.visibilityStatus&&(f("Initializing hello"),w(l.helloSettings)),await r();const a=(null===(t=null==e?void 0:e.checkoutSettings)||void 0===t?void 0:t.externalServiceTokens.find((o=>"STRIPE_PUBLISHABLE_TOKEN"===o.type)))||null;if(a&&this.stripeInitEvent)return"INACTIVE"===l.checkoutSettings.subscriptionStatus?(f('=== Checkout subscription is "INACTIVE" - Cancel initializing for Checkout ===',"warn"),void f("zonos controller loaded")):"DISABLED"===l.checkoutSettings.visibilityStatus?(f("=== Checkout is disabled by store owner ===","warn"),void f("zonos controller loaded")):void this.stripeInitEvent.emit({publishableKey:a.token});f("Checkout failed to load -- missing publishable key","warn")})()}async showNotification(o){const t=document.querySelector("zonos-notification");t?t.showNotification(o):f("Failed to show notification - zonos-notification not found","warn")}async reset(){a.checkoutSessionId=null,s.clientSecret=null}async overrideConfig(o){d({overrideSettings:o,zonosSettings:null})}async overrideCountry(o){f(`Override country code to ${o}`),c(o)}async getAppearanceSetting(){return l.appearance}async updateOrganizationName(o){l.organizationName=o}render(){return n(e,{key:"133cc684aab52bfe4be6c4a318b1769928acc7a8",class:"zonos--elements"})}};b.style=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{visibility:hidden;opacity:0;height:0}";export{b as zonos_controller}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,h as s,H as e,F as t}from"./p-5b7da777.js";import{l as n,s as c,a as i,b as r,c as a,i as h,d,e as l,f as u,g as m,h as z,j as k,k as p,m as g,n as f,t as b,D as w,o as v,p as y,q as C,r as x,u as S,v as I,w as A}from"./p-ee8b5e53.js";import{s as j,p as O}from"./p-cbb742ab.js";import{z as B,g as L,m as P}from"./p-1086aac3.js";import{t as T,c as D,g as $}from"./p-710ac059.js";import{i as H}from"./p-81a54668.js";import{l as N,a as _,s as M,b as R}from"./p-ad7ce197.js";import{c as E}from"./p-b4b7f705.js";import{g as U}from"./p-1ca5696d.js";import{i as F}from"./p-a1b755bf.js";import{s as Z,d as V,c as W}from"./p-b8e85bf5.js";import{R as q}from"./p-08e7107d.js";const G=o=>{const s=o.items.map((o=>({amount:o.amount,attributes:o.attributes||[],countryOfOrigin:o.countryOfOrigin||void 0,currencyCode:o.currencyCode,description:o.description||"",imageUrl:o.imageUrl||"",itemType:o.itemType||"PHYSICAL_GOOD",measurements:o.measurements||[],name:o.name||o.description||"",productId:o.productId||"",quantity:o.quantity||0,sku:o.sku||""})))||[];return{adjustments:o.adjustments,cartItems:s}},K=(o=!0)=>!(!n.localizationLoaded||!n.isShippableCountry&&(o&&N("Checkout: not shippable country"),1)),Q='<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M2.25 4.5C2.25 3.25736 3.25736 2.25 4.5 2.25H13.5C14.7426 2.25 15.75 3.25736 15.75 4.5V10.5C15.75 11.7426 14.7426 12.75 13.5 12.75H8.25C8.01393 12.75 7.79164 12.8611 7.65 13.05L6.3 14.85C5.87508 15.4166 5.2082 15.75 4.5 15.75C3.25736 15.75 2.25 14.7426 2.25 13.5V4.5ZM4.5 3.75C4.08579 3.75 3.75 4.08579 3.75 4.5V13.5C3.75 13.9142 4.08579 14.25 4.5 14.25C4.73607 14.25 4.95836 14.1389 5.1 13.95L6.45 12.15C6.87492 11.5834 7.5418 11.25 8.25 11.25H13.5C13.9142 11.25 14.25 10.9142 14.25 10.5V4.5C14.25 4.08579 13.9142 3.75 13.5 3.75H4.5ZM5.25 6C5.25 5.58579 5.58579 5.25 6 5.25H12C12.4142 5.25 12.75 5.58579 12.75 6C12.75 6.41421 12.4142 6.75 12 6.75H6C5.58579 6.75 5.25 6.41421 5.25 6ZM5.25 9C5.25 8.58579 5.58579 8.25 6 8.25H8.25C8.66421 8.25 9 8.58579 9 9C9 9.41421 8.66421 9.75 8.25 9.75H6C5.58579 9.75 5.25 9.41421 5.25 9Z" fill="#4D505A"/>\n</svg>\n',Y=class{constructor(s){o(this,s),this.onChangeLocaleListener=()=>{},this.applyStripeTheme=async()=>{var o,s,e,t;const n=(null===(o=this.appearanceSettingsOverride)||void 0===o?void 0:o.theme)||B.appearance.theme;await h({overrideBorderRadius:null===(s=this.appearanceSettingsOverride)||void 0===s?void 0:s.style,overridePrimaryColor:null===(e=this.appearanceSettingsOverride)||void 0===e?void 0:e.colorPrimary,overrideSecondaryColor:null===(t=this.appearanceSettingsOverride)||void 0===t?void 0:t.colorSecondary,overrideTheme:this.isMobile?n:void 0})},this.getCurrentLocalePageEnum=()=>{switch(d.step){case"customer-info":return"checkout_customer_info";case"shipping":return"checkout_shipping_info";case"payment":return"checkout_payment_info";default:return null}},this.appearanceSettingsOverride=void 0,this.preview=!1,this.mobile=!1,this.defaultAddress=null,this.forceDialogOpen=!1,this.open=this.forceDialogOpen,this.stripe=window.Zonos.stripe,this.submitLoading=!1,this.collapseReviewMobile=!0,this.isAttachError=!1,this.isMobile=!1,this.zonosReviewRef=void 0,this.storybookPaymentStatusOverride=void 0,this.isLegacyCheckout=window.Zonos.isLegacyCheckout,this.confirmDialogOpen=!1,this.inventoryCheckErrorMessage=null}async initCartInfoHandler(o){l({adjustments:d.adjustments,cartItems:o.detail})}async handleKeyPress(o){"Escape"===o.key&&this.closeDialogHandler()}async closeDialogHandler(o){var s,e;this.open&&((null==o?void 0:o.confirmed)?(this.confirmDialogOpen=!1,j("zonos-checkout-close"),this.open=this.forceDialogOpen||!1,this.preview||"finish"!==d.step||u(),d.step="customer-info",m(),z(),null===(e=(s=B.checkoutSettings).onClose)||void 0===e||e.call(s)):this.confirmDialogOpen=!0)}async buildCartAndInit(){if(window.Zonos.cartData){N("tempCartUUID is provided, start building cart");const{adjustments:o,cartItems:s}=G(window.Zonos.cartData);await l({adjustments:o,cartItems:s})}else if("function"==typeof B.checkoutSettings.createCartId){N('"createCartId" is provided, start building cart');const o=await B.checkoutSettings.createCartId();window.Zonos.cartId=o;const s=await Z(o),e=null==s?void 0:s.cartData;if(!e)return void _("Failed to build cart, please try again.");const{adjustments:t,cartItems:n}=G(e);await l({adjustments:t,cartItems:n})}else if(B.checkoutSettings.buildCartDetail&&n.selectedCountryCode){N("build cart detail");const o=await B.checkoutSettings.buildCartDetail({countryCode:n.selectedCountryCode,currencyCode:n.targetCurrency});await l({adjustments:[],cartItems:o})}if(!k.clientSecret){const o=await p();if(N(`stripeStoreInitCheckoutSession: ${o}`),!o)return!1}return await this.applyStripeTheme(),!0}reloadCheckoutSession(){window.location.reload()}attachCheckout(){const o=B.checkoutSettings.placeOrderButtonSelector;if(N(`attach checkout ${o}`),!o&&!window.Zonos.cartData)return;const s=[o,`#${V}`,`#${W}`].filter(Boolean);document.querySelectorAll(s.join(",")).forEach((s=>{s.getAttribute("data-zonos-checkout-attached")||(N(`attached event to button ${o}`,"info",{button:s}),s.addEventListener("click",(async o=>{var s;if(window.Zonos.isLegacyCheckout||K()&&!((o=!0)=>!n.localizationLoaded||!!n.isDisabledCountry&&(o&&N("Checkout: disabled country"),!0))()){o.preventDefault(),o.stopPropagation(),N("zonos checkout button clicked"),k.isFetchingSession=!0,this.open=!0;try{if(!await this.buildCartAndInit())throw new Error("Error building cart");g({isPreview:this.preview,sessionTimeout:54e5}),j("zonos-checkout-start"),T("checkout_open")}catch(o){k.isFetchingSession=!1,f({messages:[b("There's been an error creating your checkout session. Please reload and try again or contact support if the error persists")],title:b("Error creating Checkout")}),M({endpoint:"Error creating Checkout",errors:[o instanceof Error?o.toString():"Unknown error"],metadata:{allLogs:R,cartId:window.Zonos.cartId,href:window.location.href,storeBaseUrl:null===(s=window.Zonos.cartData)||void 0===s?void 0:s.storeBaseUrl}})}}}),{capture:!0,passive:!1}),B.checkoutSettings.disablePlaceOrderButtonActivation||s.removeAttribute("disabled"),s.setAttribute("data-zonos-checkout-attached","true"),s.matches(V)&&(s.dispatchEvent(D("click")),r(),s.remove()),s.matches(`#${W}`)&&(s.dispatchEvent(D("click")),s.remove()))}))}appearanceSettingsOverrideChanged(){this.appearanceSettingsOverride&&this.applyStripeTheme()}useLegacyQueryParams(){const o=new URLSearchParams(window.location.search),s={country:o.get("country")||n.selectedCountryCode||w,customerAddress1:o.get("customerAddress1"),customerAddress2:o.get("customerAddress2"),customerCity:o.get("customerCity"),customerEmail:o.get("customerEmail"),customerName:o.get("customerName"),customerPhone:o.get("customerPhone"),customerState:o.get("customerState"),customerZip:o.get("customerZip")};s.customerAddress1&&s.customerCity&&s.customerName&&s.customerPhone&&s.country?this.defaultAddress={address:{city:s.customerCity,country:s.country,line1:s.customerAddress1,line2:s.customerAddress2||"",postal_code:s.customerZip||"",state:s.customerState||""},email:s.customerEmail||"",name:s.customerName,phone:s.customerPhone}:N("Missing some query params so it can not be prefilled","info",s)}async init(){k.stripe=window.Zonos.stripe,this.stripe=window.Zonos.stripe,(({domesticRedirectedBtnSelector:o,onShippingAddressSessionFound:s})=>{if(!window.Zonos.isBigCommerce)return;const e=new MutationObserver((async()=>{const t=document.querySelector(o),n=c();if(!t&&n){const o=document.createElement("button");return o.style.display="none",o.id="zonos--domestic-redirected-checkout-button",document.body.appendChild(o),null==s||s(n),void e.disconnect()}const h=document.querySelector('select[name="shippingAddress.countryCode"]'),d=document.querySelector("#checkout-shipping-continue");h&&d&&(e.disconnect(),d.addEventListener("click",(async o=>{var s,e;const t=h.value;if(!t)return;if(i(t),!K(!1))return void r();const n=document.querySelector("form");if(!n)return;const c=new FormData(n),d=document.querySelector("input#addressLine1Input"),l={address1:null!==(s=c.get("shippingAddress.address1"))&&void 0!==s?s:d&&d.value,address2:c.get("shippingAddress.address2"),city:c.get("shippingAddress.city"),countryCode:c.get("shippingAddress.countryCode"),firstName:c.get("shippingAddress.firstName"),lastName:c.get("shippingAddress.lastName"),phone:c.get("shippingAddress.phone"),postalCode:c.get("shippingAddress.postalCode"),stateOrProvince:null!==(e=c.get("shippingAddress.stateOrProvince"))&&void 0!==e?e:c.get("shippingAddress.stateOrProvinceCode")};if(Object.values(l).some((o=>null==o)))return _("One or more shipping address field is missing",Object.entries(l)),void M({endpoint:"No endpoint, domestic checkout form missing fields",errors:["Bigcommerce: One or more shipping address field is missing in the domestic checkout form",JSON.stringify(Object.entries(l))],metadata:{domain:window.location.hostname,storeId:B.storeId}});a({address1:l.address1,address2:l.address2,city:l.city,countryCode:l.countryCode,firstName:l.firstName,lastName:l.lastName,phone:l.phone,postalCode:l.postalCode,state:l.stateOrProvince}),o.preventDefault(),o.stopPropagation(),window.location.href="/"})))}));e.observe(document.body,{childList:!0,subtree:!0})})({domesticRedirectedBtnSelector:V,onShippingAddressSessionFound:o=>{this.defaultAddress={address:{city:o.city,country:o.countryCode,line1:o.address1,line2:o.address2,postal_code:o.postalCode,state:o.state},email:"",name:`${o.firstName} ${o.lastName}`,phone:o.phone}}}),window.Zonos&&this.useLegacyQueryParams();const o=setInterval((()=>{k.stripe=window.Zonos.stripe,this.stripe=window.Zonos.stripe,this.stripe?(this.storybookPaymentStatusOverride||(N("init checkout"),this.preview||this.forceDialogOpen?this.buildCartAndInit():window.Zonos.isLegacyCheckout?this.attachCheckout():window&&(this.attachCheckout(),new MutationObserver((()=>{this.attachCheckout()})).observe(document.body,{childList:!0,subtree:!0}))),clearInterval(o)):N("waiting for stripe to be loaded")}),50);setTimeout((()=>{clearInterval(o)}),1e4)}async setToFinishStep(o){d.step="finish",this.storybookPaymentStatusOverride=o}async mockCheckoutSession(o){v(o)}async handleCustomerInfoContinue(){this.submitLoading=!0,await y();const o=setInterval((()=>{!d.landedCostData&&k.isFetchingLandedCost||(d.landedCostData&&(O({currency:d.currency}),C()),this.submitLoading=!1,clearInterval(o))}),500)}async handleShippingContinue(){this.submitLoading=!0,setTimeout((()=>{C(),this.submitLoading=!1}),500)}handleInventoryCheckDialogCancel(){d.inventoryCheckErrorMessage=null}handleInventoryCheckDialogConfirm(){d.inventoryCheckErrorMessage=null,this.closeDialogHandler({confirmed:!0})}async handleStripePaymentContinue(){k.hasPaymentError=!1,this.submitLoading=!0,d.inventoryCheckErrorMessage=null;try{d.inventoryCheckErrorMessage=await x()}catch(o){d.inventoryCheckErrorMessage=b("Unable to check inventory. Please try again.")}if(d.inventoryCheckErrorMessage)this.submitLoading=!1;else{try{await S(),C(),z()}catch(o){_(o),k.hasPaymentError=!0}this.submitLoading=!1}}async handleFinishClick(){if(I(),this.preview)return d.step="customer-info",void await this.init();if(u(),window.Zonos.isLegacyCheckout&&window.Zonos.cartData){const o=window.Zonos.cartData.storeBaseUrl;return void(window.location.href=o)}const o=window.location.href.split("?")[0],s=$();this.open=!1,s||(window.history.replaceState(window.history.state,document.title,o),window.location.reload())}handleWindowResize(){this.isMobile=H(this.mobile),this.applyStripeTheme(),N(`mobile: ${this.isMobile}`)}handleMobileChange(){this.isMobile=H(this.mobile),this.applyStripeTheme(),N(`mobile: ${this.isMobile}`)}handleAppearanceSettingsOverrideChange(){var o;(null===(o=this.appearanceSettingsOverride)||void 0===o?void 0:o.theme)&&(this.appearanceSettingsOverride.theme=L(this.appearanceSettingsOverride.theme))}handleAddressChange(){I()}componentWillLoad(){this.init(),this.isMobile=H(this.mobile),this.handleAppearanceSettingsOverrideChange(),this.onChangeLocaleListener=A("selectedLocale",(()=>{this.applyStripeTheme()})),N(`mobile: ${this.isMobile}`)}disconnectedCallback(){I(),u(),this.onChangeLocaleListener()}render(){var o;const c="finish"!==d.step&&"error"!==d.step&&!k.stripeElements||k.isFetchingSession,{colorPrimary:i,colorSecondary:r,logoUrl:a,style:h}=P(B.appearance,this.appearanceSettingsOverride),l="ENABLED"===B.appearance.zonosAttribution,u=B.appearance.theme,m=i&&F(i)?"DARK":"LIGHT",z=this.isMobile?u:m,p=this.isMobile?void 0:r,{customMessages:g}=n,f=null===(o=g.find((o=>"checkout_default"===o.pageName)))||void 0===o?void 0:o.message,w=this.getCurrentLocalePageEnum(),v=g.filter((o=>o.pageName===w)),y=()=>{const o=this.preview?`${a}?timestamp=${Date.now()}`:a;return s("div",{class:"zonos--logo"},o&&s("img",{alt:`${B.organizationName} logo`,src:o}))},C=$(),x=()=>{const o=new URLSearchParams(window.location.search),e=o.get("zonosQaUrl"),t=o.get("zonosDebug");return s("zonos-v-stack",null,s("div",{class:"zonos--logo-wrapper"},y(),C&&s("zonos-badge",{badgeColor:"orange",size:"small"},b("Test mode")),"1"===t&&s("zonos-badge",{badgeColor:"cyan",size:"small"},"debug"),e&&s("zonos-badge",{badgeColor:"purple",size:"small"},e)),s("zonos-checkout-progress-tabs",{backgroundColor:this.isMobile?"--zonos-elements-gray-0":null}),v.map((o=>s("zonos-custom-message",{icon:Q,message:o.message}))))},S=()=>d.checkoutSessionTimeoutShow?s("zonos-rest-state",{class:"zonos--session-timeout",restStateSubtitle:b("Your checkout session has expired. Please reload the page to continue."),restStateTitle:b("Session timed out"),restStateType:"Warning"},s("zonos-button",{onClick:()=>this.reloadCheckoutSession(),variant:"primary"},b("Reload"))):s("div",{class:"zonos--content",style:{"--border-radius":U({overrideBorderStyle:h})}},"finish"!==d.step&&"error"!==d.step&&s(t,null,s("div",{class:"zonos--left","data-theme":z,style:{"--primary-color":this.isMobile?"":i}},!this.isMobile&&x(),"customer-info"===d.step&&s("zonos-customer-info",{continueLoading:this.submitLoading,defaultAddress:this.defaultAddress,isMobile:this.isMobile,onContinueClicked:()=>this.handleCustomerInfoContinue(),submitBtnColor:p}),"shipping"===d.step&&s("zonos-shipping",{continueLoading:this.submitLoading,onContinueClicked:()=>this.handleShippingContinue(),submitBtnColor:p}),"payment"===d.step&&s("zonos-checkout-payment",{continueLoading:this.submitLoading,onContinueClicked:async()=>{await this.handleStripePaymentContinue()},submitBtnColor:p})),s("div",{class:"zonos--right","data-theme":u},this.isMobile&&x(),!this.isLegacyCheckout&&s("zonos-button",{class:"zonos--close-button",icon:s("zonos-icon",{"aria-label":"Close checkout dialog",content:q}),noBackground:!0,onClick:()=>this.closeDialogHandler()}),s("div",{class:"flex--wrapper"},s("div",{class:"zonos--wrapper"},s("zonos-review",{collapsed:this.collapseReviewMobile,mobile:this.isMobile,onClick:()=>{this.isMobile&&(this.collapseReviewMobile=!this.collapseReviewMobile)}}),s("zonos-collapse",{collapsed:this.collapseReviewMobile&&this.isMobile},s("zonos-cart-items",null),this.isMobile&&s("zonos-v-stack",{spacing:16},s("zonos-cart-subtotal",{submitBtnColor:p}),s("zonos-custom-message",{class:"zonos--checkout-default-message",icon:Q,message:f})))),s("zonos-cart-restricted-items",null),!this.isMobile&&s("zonos-v-stack",{spacing:16},s("zonos-cart-subtotal",null),s("zonos-custom-message",{class:"zonos--checkout-default-message",icon:Q,message:f}))))),("finish"===d.step||"error"===d.step)&&s("div",{class:"zonos--done","data-theme":u},s("div",{class:"zonos--header"},y(),s("zonos-button",{class:"zonos--close-button",icon:s("zonos-icon",{"aria-label":"Close checkout dialog",content:q}),noBackground:!0,onClick:()=>this.handleFinishClick(),theme:u})),s("zonos-checkout-finish",{borderRadius:h,onCloseClick:()=>this.handleFinishClick(),overrideNotification:"error"===d.step&&d.error?Object.assign(Object.assign({},d.error),{type:"error"}):void 0,storybookForceStatus:this.storybookPaymentStatusOverride})),s("zonos-checkout-footer",{"data-theme":u,mobile:this.isMobile,slot:this.isMobile?void 0:"dialog-footer"}));return s(e,{class:E(["zonos--checkout zonos--elements",l&&"has-footer",this.preview&&"preview",this.isMobile&&"mobile"])},this.preview?S():s("zonos-dialog",{borderStyle:h,"data-theme":u,height:"980px",isLoading:c,mobile:this.isMobile,noBodyPadding:!0,noBorder:!0,noClickOutside:!0,noCloseButton:!0,onCloseDialog:()=>this.closeDialogHandler(),open:this.open,width:"1200px"},S()),s("zonos-confirm-dialog",{class:"zonos--close-confirm-dialog",dialogCancelBtnText:b("Don't close"),dialogConfirmBtnText:b("Close"),dialogIntent:"warn",dialogOpen:this.confirmDialogOpen,dialogSubtitle:b("Would you like to close checkout and return to the site?"),dialogTitle:b("Are you sure?"),onCancelClicked:()=>{this.confirmDialogOpen=!1},onConfirmClicked:()=>this.closeDialogHandler({confirmed:!0})}),s("zonos-confirm-dialog",{class:"zonos--inventory-check-failure-dialog",dialogConfirmBtnText:b("Return to cart"),dialogIntent:"danger",dialogOpen:!!d.inventoryCheckErrorMessage,dialogSubtitle:d.inventoryCheckErrorMessage,dialogTitle:b("Couldn't place order"),dialogType:"alert",onCancelClicked:()=>{this.handleInventoryCheckDialogCancel()},onConfirmClicked:()=>this.handleInventoryCheckDialogConfirm()}))}static get assetsDirs(){return["assets"]}static get watchers(){return{appearanceSettingsOverride:["appearanceSettingsOverrideChanged","handleAppearanceSettingsOverrideChange"],mobile:["handleMobileChange"],defaultAddress:["handleAddressChange"]}}};Y.style=".sc-zonos-checkout-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-checkout-h *.sc-zonos-checkout{font-family:var(--font-family, Inter), Inter}.sc-zonos-checkout-h img.sc-zonos-checkout{max-width:100%}.sc-zonos-checkout-h dl.sc-zonos-checkout,.sc-zonos-checkout-h dd.sc-zonos-checkout,.sc-zonos-checkout-h h1.sc-zonos-checkout,.sc-zonos-checkout-h h2.sc-zonos-checkout,.sc-zonos-checkout-h h3.sc-zonos-checkout,.sc-zonos-checkout-h h4.sc-zonos-checkout,.sc-zonos-checkout-h h5.sc-zonos-checkout,.sc-zonos-checkout-h h6.sc-zonos-checkout,.sc-zonos-checkout-h hr.sc-zonos-checkout,.sc-zonos-checkout-h figure.sc-zonos-checkout,.sc-zonos-checkout-h p.sc-zonos-checkout,.sc-zonos-checkout-h pre.sc-zonos-checkout{margin:0}.sc-zonos-checkout-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-checkout-h *.sc-zonos-checkout{-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar{width:10px}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{display:-ms-flexbox;display:flex;height:100%;overflow:hidden;border-radius:var(--border-radius, var(--zonos-elements-radius-10))}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{-ms-flex:1;flex:1;padding:32px}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout{background-color:var(--primary-color, var(--zonos-elements-gray-0));border-right:1px solid var(--zonos-elements-gray-200)}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{background-color:var(--zonos-elements-gray-0)}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{width:100%;max-height:100%;height:100%;overflow:auto;-ms-flex-direction:column;flex-direction:column;background-color:var(--zonos-elements-gray-0);-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:24px;padding-bottom:50px}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout .zonos--header.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;width:100%}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout .zonos--header.sc-zonos-checkout img.sc-zonos-checkout{width:150px;min-width:150px}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout .zonos--logo.sc-zonos-checkout{margin-bottom:0}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout zonos-checkout-finish.sc-zonos-checkout{-ms-flex:1;flex:1}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:relative}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{padding:0 8px 8px}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--payment-error-banner.sc-zonos-checkout{margin-top:24px}.sc-zonos-checkout-h .zonos--right.sc-zonos-checkout{position:relative}.sc-zonos-checkout-h .zonos--right.sc-zonos-checkout .zonos--close-button.sc-zonos-checkout{position:absolute;right:24px;top:24px;z-index:2}.sc-zonos-checkout-h .zonos--wrapper.sc-zonos-checkout{overflow:auto;max-height:100%;position:relative}.sc-zonos-checkout-h .flex--wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;max-height:100%}.sc-zonos-checkout-h .zonos--logo-wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;gap:16px;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--logo-wrapper.sc-zonos-checkout>*.sc-zonos-checkout{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}.sc-zonos-checkout-h .zonos--logo.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--logo.sc-zonos-checkout img.sc-zonos-checkout{max-height:72px}.sc-zonos-checkout-h .zonos--checkout-default-message.sc-zonos-checkout{margin-left:76px;margin-bottom:8px}.zonos--close-button.sc-zonos-checkout{-ms-flex-item-align:start;align-self:flex-start}.preview.sc-zonos-checkout-h{min-width:500px;margin:auto}.preview.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{border:var(--zonos-elements-border)}.preview.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{padding:32px}.mobile.sc-zonos-checkout-h{min-width:auto}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow:auto;border-radius:0;max-height:100%;height:100%;border:0}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{padding:12px;padding-bottom:76px}@media (max-width: 768px){.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{padding-bottom:0}}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout{-ms-flex-order:2;order:2;border-right:none}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{-ms-flex-order:1;order:1;padding-top:16px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border:var(--zonos-elements-border);border-radius:var(--border-radius, var(--zonos-elements-radius-10));background-color:var(--zonos-elements-gray-50);padding:12px;margin-top:32px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--review.sc-zonos-checkout{margin-bottom:0}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--cart-items.sc-zonos-checkout{margin-top:8px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout zonos-checkout-footer.sc-zonos-checkout{-ms-flex-order:3;order:3}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{max-height:100%}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--footer.sc-zonos-checkout{-ms-flex-order:3;order:3}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{width:auto}.mobile.sc-zonos-checkout-h .zonos--cart-subtotal.sc-zonos-checkout{margin:0}";export{Y as zonos_checkout}
|
|
1
|
+
import{r as o,h as s,H as e,F as t}from"./p-5b7da777.js";import{l as n,s as c,a as i,b as r,c as a,i as h,d,e as l,f as u,g as m,h as z,j as k,k as p,m as g,n as f,t as b,D as w,o as v,p as y,q as C,r as x,u as S,v as I,w as A}from"./p-cb9ff4df.js";import{s as j,p as O}from"./p-d81f35bf.js";import{z as B,g as L,m as P}from"./p-1086aac3.js";import{t as T,c as D,g as $}from"./p-f7ec6999.js";import{i as H}from"./p-81a54668.js";import{l as N,a as _,s as M,b as R}from"./p-ad7ce197.js";import{c as E}from"./p-b4b7f705.js";import{g as U}from"./p-1ca5696d.js";import{i as F}from"./p-a1b755bf.js";import{s as Z,d as V,c as W}from"./p-b8e85bf5.js";import{R as q}from"./p-08e7107d.js";const G=o=>{const s=o.items.map((o=>({amount:o.amount,attributes:o.attributes||[],countryOfOrigin:o.countryOfOrigin||void 0,currencyCode:o.currencyCode,description:o.description||"",imageUrl:o.imageUrl||"",itemType:o.itemType||"PHYSICAL_GOOD",measurements:o.measurements||[],name:o.name||o.description||"",productId:o.productId||"",quantity:o.quantity||0,sku:o.sku||""})))||[];return{adjustments:o.adjustments,cartItems:s}},K=(o=!0)=>!(!n.localizationLoaded||!n.isShippableCountry&&(o&&N("Checkout: not shippable country"),1)),Q='<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M2.25 4.5C2.25 3.25736 3.25736 2.25 4.5 2.25H13.5C14.7426 2.25 15.75 3.25736 15.75 4.5V10.5C15.75 11.7426 14.7426 12.75 13.5 12.75H8.25C8.01393 12.75 7.79164 12.8611 7.65 13.05L6.3 14.85C5.87508 15.4166 5.2082 15.75 4.5 15.75C3.25736 15.75 2.25 14.7426 2.25 13.5V4.5ZM4.5 3.75C4.08579 3.75 3.75 4.08579 3.75 4.5V13.5C3.75 13.9142 4.08579 14.25 4.5 14.25C4.73607 14.25 4.95836 14.1389 5.1 13.95L6.45 12.15C6.87492 11.5834 7.5418 11.25 8.25 11.25H13.5C13.9142 11.25 14.25 10.9142 14.25 10.5V4.5C14.25 4.08579 13.9142 3.75 13.5 3.75H4.5ZM5.25 6C5.25 5.58579 5.58579 5.25 6 5.25H12C12.4142 5.25 12.75 5.58579 12.75 6C12.75 6.41421 12.4142 6.75 12 6.75H6C5.58579 6.75 5.25 6.41421 5.25 6ZM5.25 9C5.25 8.58579 5.58579 8.25 6 8.25H8.25C8.66421 8.25 9 8.58579 9 9C9 9.41421 8.66421 9.75 8.25 9.75H6C5.58579 9.75 5.25 9.41421 5.25 9Z" fill="#4D505A"/>\n</svg>\n',Y=class{constructor(s){o(this,s),this.onChangeLocaleListener=()=>{},this.applyStripeTheme=async()=>{var o,s,e,t;const n=(null===(o=this.appearanceSettingsOverride)||void 0===o?void 0:o.theme)||B.appearance.theme;await h({overrideBorderRadius:null===(s=this.appearanceSettingsOverride)||void 0===s?void 0:s.style,overridePrimaryColor:null===(e=this.appearanceSettingsOverride)||void 0===e?void 0:e.colorPrimary,overrideSecondaryColor:null===(t=this.appearanceSettingsOverride)||void 0===t?void 0:t.colorSecondary,overrideTheme:this.isMobile?n:void 0})},this.getCurrentLocalePageEnum=()=>{switch(d.step){case"customer-info":return"checkout_customer_info";case"shipping":return"checkout_shipping_info";case"payment":return"checkout_payment_info";default:return null}},this.appearanceSettingsOverride=void 0,this.preview=!1,this.mobile=!1,this.defaultAddress=null,this.forceDialogOpen=!1,this.open=this.forceDialogOpen,this.stripe=window.Zonos.stripe,this.submitLoading=!1,this.collapseReviewMobile=!0,this.isAttachError=!1,this.isMobile=!1,this.zonosReviewRef=void 0,this.storybookPaymentStatusOverride=void 0,this.isLegacyCheckout=window.Zonos.isLegacyCheckout,this.confirmDialogOpen=!1,this.inventoryCheckErrorMessage=null}async initCartInfoHandler(o){l({adjustments:d.adjustments,cartItems:o.detail})}async handleKeyPress(o){"Escape"===o.key&&this.closeDialogHandler()}async closeDialogHandler(o){var s,e;this.open&&((null==o?void 0:o.confirmed)?(this.confirmDialogOpen=!1,j("zonos-checkout-close"),this.open=this.forceDialogOpen||!1,this.preview||"finish"!==d.step||u(),d.step="customer-info",m(),z(),null===(e=(s=B.checkoutSettings).onClose)||void 0===e||e.call(s)):this.confirmDialogOpen=!0)}async buildCartAndInit(){if(window.Zonos.cartData){N("tempCartUUID is provided, start building cart");const{adjustments:o,cartItems:s}=G(window.Zonos.cartData);await l({adjustments:o,cartItems:s})}else if("function"==typeof B.checkoutSettings.createCartId){N('"createCartId" is provided, start building cart');const o=await B.checkoutSettings.createCartId();window.Zonos.cartId=o;const s=await Z(o),e=null==s?void 0:s.cartData;if(!e)return void _("Failed to build cart, please try again.");const{adjustments:t,cartItems:n}=G(e);await l({adjustments:t,cartItems:n})}else if(B.checkoutSettings.buildCartDetail&&n.selectedCountryCode){N("build cart detail");const o=await B.checkoutSettings.buildCartDetail({countryCode:n.selectedCountryCode,currencyCode:n.targetCurrency});await l({adjustments:[],cartItems:o})}if(!k.clientSecret){const o=await p();if(N(`stripeStoreInitCheckoutSession: ${o}`),!o)return!1}return await this.applyStripeTheme(),!0}reloadCheckoutSession(){window.location.reload()}attachCheckout(){const o=B.checkoutSettings.placeOrderButtonSelector;if(N(`attach checkout ${o}`),!o&&!window.Zonos.cartData)return;const s=[o,`#${V}`,`#${W}`].filter(Boolean);document.querySelectorAll(s.join(",")).forEach((s=>{s.getAttribute("data-zonos-checkout-attached")||(N(`attached event to button ${o}`,"info",{button:s}),s.addEventListener("click",(async o=>{var s;if(window.Zonos.isLegacyCheckout||K()&&!((o=!0)=>!n.localizationLoaded||!!n.isDisabledCountry&&(o&&N("Checkout: disabled country"),!0))()){o.preventDefault(),o.stopPropagation(),N("zonos checkout button clicked"),k.isFetchingSession=!0,this.open=!0;try{if(!await this.buildCartAndInit())throw new Error("Error building cart");g({isPreview:this.preview,sessionTimeout:54e5}),j("zonos-checkout-start"),T("checkout_open")}catch(o){k.isFetchingSession=!1,f({messages:[b("There's been an error creating your checkout session. Please reload and try again or contact support if the error persists")],title:b("Error creating Checkout")}),M({endpoint:"Error creating Checkout",errors:[o instanceof Error?o.toString():"Unknown error"],metadata:{allLogs:R,cartId:window.Zonos.cartId,href:window.location.href,storeBaseUrl:null===(s=window.Zonos.cartData)||void 0===s?void 0:s.storeBaseUrl}})}}}),{capture:!0,passive:!1}),B.checkoutSettings.disablePlaceOrderButtonActivation||s.removeAttribute("disabled"),s.setAttribute("data-zonos-checkout-attached","true"),s.matches(V)&&(s.dispatchEvent(D("click")),r(),s.remove()),s.matches(`#${W}`)&&(s.dispatchEvent(D("click")),s.remove()))}))}appearanceSettingsOverrideChanged(){this.appearanceSettingsOverride&&this.applyStripeTheme()}useLegacyQueryParams(){const o=new URLSearchParams(window.location.search),s={country:o.get("country")||n.selectedCountryCode||w,customerAddress1:o.get("customerAddress1"),customerAddress2:o.get("customerAddress2"),customerCity:o.get("customerCity"),customerEmail:o.get("customerEmail"),customerName:o.get("customerName"),customerPhone:o.get("customerPhone"),customerState:o.get("customerState"),customerZip:o.get("customerZip")};s.customerAddress1&&s.customerCity&&s.customerName&&s.customerPhone&&s.country?this.defaultAddress={address:{city:s.customerCity,country:s.country,line1:s.customerAddress1,line2:s.customerAddress2||"",postal_code:s.customerZip||"",state:s.customerState||""},email:s.customerEmail||"",name:s.customerName,phone:s.customerPhone}:N("Missing some query params so it can not be prefilled","info",s)}async init(){k.stripe=window.Zonos.stripe,this.stripe=window.Zonos.stripe,(({domesticRedirectedBtnSelector:o,onShippingAddressSessionFound:s})=>{if(!window.Zonos.isBigCommerce)return;const e=new MutationObserver((async()=>{const t=document.querySelector(o),n=c();if(!t&&n){const o=document.createElement("button");return o.style.display="none",o.id="zonos--domestic-redirected-checkout-button",document.body.appendChild(o),null==s||s(n),void e.disconnect()}const h=document.querySelector('select[name="shippingAddress.countryCode"]'),d=document.querySelector("#checkout-shipping-continue");h&&d&&(e.disconnect(),d.addEventListener("click",(async o=>{var s,e;const t=h.value;if(!t)return;if(i(t),!K(!1))return void r();const n=document.querySelector("form");if(!n)return;const c=new FormData(n),d=document.querySelector("input#addressLine1Input"),l={address1:null!==(s=c.get("shippingAddress.address1"))&&void 0!==s?s:d&&d.value,address2:c.get("shippingAddress.address2"),city:c.get("shippingAddress.city"),countryCode:c.get("shippingAddress.countryCode"),firstName:c.get("shippingAddress.firstName"),lastName:c.get("shippingAddress.lastName"),phone:c.get("shippingAddress.phone"),postalCode:c.get("shippingAddress.postalCode"),stateOrProvince:null!==(e=c.get("shippingAddress.stateOrProvince"))&&void 0!==e?e:c.get("shippingAddress.stateOrProvinceCode")};if(Object.values(l).some((o=>null==o)))return _("One or more shipping address field is missing",Object.entries(l)),void M({endpoint:"No endpoint, domestic checkout form missing fields",errors:["Bigcommerce: One or more shipping address field is missing in the domestic checkout form",JSON.stringify(Object.entries(l))],metadata:{domain:window.location.hostname,storeId:B.storeId}});a({address1:l.address1,address2:l.address2,city:l.city,countryCode:l.countryCode,firstName:l.firstName,lastName:l.lastName,phone:l.phone,postalCode:l.postalCode,state:l.stateOrProvince}),o.preventDefault(),o.stopPropagation(),window.location.href="/"})))}));e.observe(document.body,{childList:!0,subtree:!0})})({domesticRedirectedBtnSelector:V,onShippingAddressSessionFound:o=>{this.defaultAddress={address:{city:o.city,country:o.countryCode,line1:o.address1,line2:o.address2,postal_code:o.postalCode,state:o.state},email:"",name:`${o.firstName} ${o.lastName}`,phone:o.phone}}}),window.Zonos&&this.useLegacyQueryParams();const o=setInterval((()=>{k.stripe=window.Zonos.stripe,this.stripe=window.Zonos.stripe,this.stripe?(this.storybookPaymentStatusOverride||(N("init checkout"),this.preview||this.forceDialogOpen?this.buildCartAndInit():window.Zonos.isLegacyCheckout?this.attachCheckout():window&&(this.attachCheckout(),new MutationObserver((()=>{this.attachCheckout()})).observe(document.body,{childList:!0,subtree:!0}))),clearInterval(o)):N("waiting for stripe to be loaded")}),50);setTimeout((()=>{clearInterval(o)}),1e4)}async setToFinishStep(o){d.step="finish",this.storybookPaymentStatusOverride=o}async mockCheckoutSession(o){v(o)}async handleCustomerInfoContinue(){this.submitLoading=!0,await y();const o=setInterval((()=>{!d.landedCostData&&k.isFetchingLandedCost||(d.landedCostData&&(O({currency:d.currency}),C()),this.submitLoading=!1,clearInterval(o))}),500)}async handleShippingContinue(){this.submitLoading=!0,setTimeout((()=>{C(),this.submitLoading=!1}),500)}handleInventoryCheckDialogCancel(){d.inventoryCheckErrorMessage=null}handleInventoryCheckDialogConfirm(){d.inventoryCheckErrorMessage=null,this.closeDialogHandler({confirmed:!0})}async handleStripePaymentContinue(){k.hasPaymentError=!1,this.submitLoading=!0,d.inventoryCheckErrorMessage=null;try{d.inventoryCheckErrorMessage=await x()}catch(o){d.inventoryCheckErrorMessage=b("Unable to check inventory. Please try again.")}if(d.inventoryCheckErrorMessage)this.submitLoading=!1;else{try{await S(),C(),z()}catch(o){_(o),k.hasPaymentError=!0}this.submitLoading=!1}}async handleFinishClick(){if(I(),this.preview)return d.step="customer-info",void await this.init();if(u(),window.Zonos.isLegacyCheckout&&window.Zonos.cartData){const o=window.Zonos.cartData.storeBaseUrl;return void(window.location.href=o)}const o=window.location.href.split("?")[0],s=$();this.open=!1,s||(window.history.replaceState(window.history.state,document.title,o),window.location.reload())}handleWindowResize(){this.isMobile=H(this.mobile),this.applyStripeTheme(),N(`mobile: ${this.isMobile}`)}handleMobileChange(){this.isMobile=H(this.mobile),this.applyStripeTheme(),N(`mobile: ${this.isMobile}`)}handleAppearanceSettingsOverrideChange(){var o;(null===(o=this.appearanceSettingsOverride)||void 0===o?void 0:o.theme)&&(this.appearanceSettingsOverride.theme=L(this.appearanceSettingsOverride.theme))}handleAddressChange(){I()}componentWillLoad(){this.init(),this.isMobile=H(this.mobile),this.handleAppearanceSettingsOverrideChange(),this.onChangeLocaleListener=A("selectedLocale",(()=>{this.applyStripeTheme()})),N(`mobile: ${this.isMobile}`)}disconnectedCallback(){I(),u(),this.onChangeLocaleListener()}render(){var o;const c="finish"!==d.step&&"error"!==d.step&&!k.stripeElements||k.isFetchingSession,{colorPrimary:i,colorSecondary:r,logoUrl:a,style:h}=P(B.appearance,this.appearanceSettingsOverride),l="ENABLED"===B.appearance.zonosAttribution,u=B.appearance.theme,m=i&&F(i)?"DARK":"LIGHT",z=this.isMobile?u:m,p=this.isMobile?void 0:r,{customMessages:g}=n,f=null===(o=g.find((o=>"checkout_default"===o.pageName)))||void 0===o?void 0:o.message,w=this.getCurrentLocalePageEnum(),v=g.filter((o=>o.pageName===w)),y=()=>{const o=this.preview?`${a}?timestamp=${Date.now()}`:a;return s("div",{class:"zonos--logo"},o&&s("img",{alt:`${B.organizationName} logo`,src:o}))},C=$(),x=()=>{const o=new URLSearchParams(window.location.search),e=o.get("zonosQaUrl"),t=o.get("zonosDebug");return s("zonos-v-stack",null,s("div",{class:"zonos--logo-wrapper"},y(),C&&s("zonos-badge",{badgeColor:"orange",size:"small"},b("Test mode")),"1"===t&&s("zonos-badge",{badgeColor:"cyan",size:"small"},"debug"),e&&s("zonos-badge",{badgeColor:"purple",size:"small"},e)),s("zonos-checkout-progress-tabs",{backgroundColor:this.isMobile?"--zonos-elements-gray-0":null}),v.map((o=>s("zonos-custom-message",{icon:Q,message:o.message}))))},S=()=>d.checkoutSessionTimeoutShow?s("zonos-rest-state",{class:"zonos--session-timeout",restStateSubtitle:b("Your checkout session has expired. Please reload the page to continue."),restStateTitle:b("Session timed out"),restStateType:"Warning"},s("zonos-button",{onClick:()=>this.reloadCheckoutSession(),variant:"primary"},b("Reload"))):s("div",{class:"zonos--content",style:{"--border-radius":U({overrideBorderStyle:h})}},"finish"!==d.step&&"error"!==d.step&&s(t,null,s("div",{class:"zonos--left","data-theme":z,style:{"--primary-color":this.isMobile?"":i}},!this.isMobile&&x(),"customer-info"===d.step&&s("zonos-customer-info",{continueLoading:this.submitLoading,defaultAddress:this.defaultAddress,isMobile:this.isMobile,onContinueClicked:()=>this.handleCustomerInfoContinue(),submitBtnColor:p}),"shipping"===d.step&&s("zonos-shipping",{continueLoading:this.submitLoading,onContinueClicked:()=>this.handleShippingContinue(),submitBtnColor:p}),"payment"===d.step&&s("zonos-checkout-payment",{continueLoading:this.submitLoading,onContinueClicked:async()=>{await this.handleStripePaymentContinue()},submitBtnColor:p})),s("div",{class:"zonos--right","data-theme":u},this.isMobile&&x(),!this.isLegacyCheckout&&s("zonos-button",{class:"zonos--close-button",icon:s("zonos-icon",{"aria-label":"Close checkout dialog",content:q}),noBackground:!0,onClick:()=>this.closeDialogHandler()}),s("div",{class:"flex--wrapper"},s("div",{class:"zonos--wrapper"},s("zonos-review",{collapsed:this.collapseReviewMobile,mobile:this.isMobile,onClick:()=>{this.isMobile&&(this.collapseReviewMobile=!this.collapseReviewMobile)}}),s("zonos-collapse",{collapsed:this.collapseReviewMobile&&this.isMobile},s("zonos-cart-items",null),this.isMobile&&s("zonos-v-stack",{spacing:16},s("zonos-cart-subtotal",{submitBtnColor:p}),s("zonos-custom-message",{class:"zonos--checkout-default-message",icon:Q,message:f})))),s("zonos-cart-restricted-items",null),!this.isMobile&&s("zonos-v-stack",{spacing:16},s("zonos-cart-subtotal",null),s("zonos-custom-message",{class:"zonos--checkout-default-message",icon:Q,message:f}))))),("finish"===d.step||"error"===d.step)&&s("div",{class:"zonos--done","data-theme":u},s("div",{class:"zonos--header"},y(),s("zonos-button",{class:"zonos--close-button",icon:s("zonos-icon",{"aria-label":"Close checkout dialog",content:q}),noBackground:!0,onClick:()=>this.handleFinishClick(),theme:u})),s("zonos-checkout-finish",{borderRadius:h,onCloseClick:()=>this.handleFinishClick(),overrideNotification:"error"===d.step&&d.error?Object.assign(Object.assign({},d.error),{type:"error"}):void 0,storybookForceStatus:this.storybookPaymentStatusOverride})),s("zonos-checkout-footer",{"data-theme":u,mobile:this.isMobile,slot:this.isMobile?void 0:"dialog-footer"}));return s(e,{class:E(["zonos--checkout zonos--elements",l&&"has-footer",this.preview&&"preview",this.isMobile&&"mobile"])},this.preview?S():s("zonos-dialog",{borderStyle:h,"data-theme":u,height:"980px",isLoading:c,mobile:this.isMobile,noBodyPadding:!0,noBorder:!0,noClickOutside:!0,noCloseButton:!0,onCloseDialog:()=>this.closeDialogHandler(),open:this.open,width:"1200px"},S()),s("zonos-confirm-dialog",{class:"zonos--close-confirm-dialog",dialogCancelBtnText:b("Don't close"),dialogConfirmBtnText:b("Close"),dialogIntent:"warn",dialogOpen:this.confirmDialogOpen,dialogSubtitle:b("Would you like to close checkout and return to the site?"),dialogTitle:b("Are you sure?"),onCancelClicked:()=>{this.confirmDialogOpen=!1},onConfirmClicked:()=>this.closeDialogHandler({confirmed:!0})}),s("zonos-confirm-dialog",{class:"zonos--inventory-check-failure-dialog",dialogConfirmBtnText:b("Return to cart"),dialogIntent:"danger",dialogOpen:!!d.inventoryCheckErrorMessage,dialogSubtitle:d.inventoryCheckErrorMessage,dialogTitle:b("Couldn't place order"),dialogType:"alert",onCancelClicked:()=>{this.handleInventoryCheckDialogCancel()},onConfirmClicked:()=>this.handleInventoryCheckDialogConfirm()}))}static get assetsDirs(){return["assets"]}static get watchers(){return{appearanceSettingsOverride:["appearanceSettingsOverrideChanged","handleAppearanceSettingsOverrideChange"],mobile:["handleMobileChange"],defaultAddress:["handleAddressChange"]}}};Y.style=".sc-zonos-checkout-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-checkout-h *.sc-zonos-checkout{font-family:var(--font-family, Inter), Inter}.sc-zonos-checkout-h img.sc-zonos-checkout{max-width:100%}.sc-zonos-checkout-h dl.sc-zonos-checkout,.sc-zonos-checkout-h dd.sc-zonos-checkout,.sc-zonos-checkout-h h1.sc-zonos-checkout,.sc-zonos-checkout-h h2.sc-zonos-checkout,.sc-zonos-checkout-h h3.sc-zonos-checkout,.sc-zonos-checkout-h h4.sc-zonos-checkout,.sc-zonos-checkout-h h5.sc-zonos-checkout,.sc-zonos-checkout-h h6.sc-zonos-checkout,.sc-zonos-checkout-h hr.sc-zonos-checkout,.sc-zonos-checkout-h figure.sc-zonos-checkout,.sc-zonos-checkout-h p.sc-zonos-checkout,.sc-zonos-checkout-h pre.sc-zonos-checkout{margin:0}.sc-zonos-checkout-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-checkout-h *.sc-zonos-checkout{-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar{width:10px}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{display:-ms-flexbox;display:flex;height:100%;overflow:hidden;border-radius:var(--border-radius, var(--zonos-elements-radius-10))}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{-ms-flex:1;flex:1;padding:32px}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout{background-color:var(--primary-color, var(--zonos-elements-gray-0));border-right:1px solid var(--zonos-elements-gray-200)}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{background-color:var(--zonos-elements-gray-0)}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{width:100%;max-height:100%;height:100%;overflow:auto;-ms-flex-direction:column;flex-direction:column;background-color:var(--zonos-elements-gray-0);-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:24px;padding-bottom:50px}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout .zonos--header.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;width:100%}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout .zonos--header.sc-zonos-checkout img.sc-zonos-checkout{width:150px;min-width:150px}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout .zonos--logo.sc-zonos-checkout{margin-bottom:0}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout zonos-checkout-finish.sc-zonos-checkout{-ms-flex:1;flex:1}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:relative}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{padding:0 8px 8px}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--payment-error-banner.sc-zonos-checkout{margin-top:24px}.sc-zonos-checkout-h .zonos--right.sc-zonos-checkout{position:relative}.sc-zonos-checkout-h .zonos--right.sc-zonos-checkout .zonos--close-button.sc-zonos-checkout{position:absolute;right:24px;top:24px;z-index:2}.sc-zonos-checkout-h .zonos--wrapper.sc-zonos-checkout{overflow:auto;max-height:100%;position:relative}.sc-zonos-checkout-h .flex--wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;max-height:100%}.sc-zonos-checkout-h .zonos--logo-wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;gap:16px;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--logo-wrapper.sc-zonos-checkout>*.sc-zonos-checkout{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}.sc-zonos-checkout-h .zonos--logo.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--logo.sc-zonos-checkout img.sc-zonos-checkout{max-height:72px}.sc-zonos-checkout-h .zonos--checkout-default-message.sc-zonos-checkout{margin-left:76px;margin-bottom:8px}.zonos--close-button.sc-zonos-checkout{-ms-flex-item-align:start;align-self:flex-start}.preview.sc-zonos-checkout-h{min-width:500px;margin:auto}.preview.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{border:var(--zonos-elements-border)}.preview.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{padding:32px}.mobile.sc-zonos-checkout-h{min-width:auto}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow:auto;border-radius:0;max-height:100%;height:100%;border:0}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{padding:12px;padding-bottom:76px}@media (max-width: 768px){.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{padding-bottom:0}}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout{-ms-flex-order:2;order:2;border-right:none}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{-ms-flex-order:1;order:1;padding-top:16px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border:var(--zonos-elements-border);border-radius:var(--border-radius, var(--zonos-elements-radius-10));background-color:var(--zonos-elements-gray-50);padding:12px;margin-top:32px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--review.sc-zonos-checkout{margin-bottom:0}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--cart-items.sc-zonos-checkout{margin-top:8px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout zonos-checkout-footer.sc-zonos-checkout{-ms-flex-order:3;order:3}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{max-height:100%}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--footer.sc-zonos-checkout{-ms-flex-order:3;order:3}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{width:auto}.mobile.sc-zonos-checkout-h .zonos--cart-subtotal.sc-zonos-checkout{margin:0}";export{Y as zonos_checkout}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s,c as o,h as e,H as t,d as n}from"./p-5b7da777.js";import{j as i,l as a,D as d,t as l}from"./p-ee8b5e53.js";import{i as r}from"./p-81a54668.js";import{a as c}from"./p-ad7ce197.js";import{i as h,c as f}from"./p-0c64dbbb.js";import{z as b,d as p}from"./p-1086aac3.js";import{c as m}from"./p-b4b7f705.js";import{R as u}from"./p-08e7107d.js";import{g as z}from"./p-1ca5696d.js";import{i as y}from"./p-a1b755bf.js";const g=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:i.stripeBillingAddressElement,stripeAddressEventData:i.stripeBillingAddressEventData,stripeElements:i.stripeElementsForBillingAddress}:{stripeAddressElement:i.stripeAddressElement,stripeAddressEventData:i.stripeAddressEventData,stripeElements:i.stripeElements}}updateAddressEventData({event:s,type:o}){"billing"===o?i.stripeBillingAddressEventData=s:i.stripeAddressEventData=s}updateAddressElement({stripeAddressElement:s,type:o}){"shipping"!==o?i.stripeBillingAddressElement=s:i.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 c("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 n=a.shippingZoneCountries,i=n?Object.values(n).map((s=>s.code)):[],l=t.create("address",{allowedCountries:"shipping"===this.type?i:[],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||d}),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"}}});l.mount(this.el.querySelector(".zonos--address-component")),l.on("change",(s=>{const o=s.value;!this.isDirtyAddress&&o.address.line1.length>=3&&(this.isDirtyAddress=!0,setTimeout((()=>{if(r())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:l,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:"aa9a569b302099681082cd4219b553f9c70842ea",class:"zonos--address zonos--elements"},e("zonos-text",{key:"60050e9f8f0b80dde9acc9ffbd868333fdabf2b3",class:"zonos--title",type:"semiBoldLabel"},this.titleText),e("div",{key:"5af7ee4f23d75fc877cdde7babe0edaefef14da8",class:"zonos--address-component"}))}get el(){return n(this)}static get watchers(){return{stripe:["watchInitStripe"]}}};g.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 v=class{constructor(o){s(this,o),this.currentAddress=void 0,this.addressType=void 0}render(){var s;const{city:o,country:n,email:i,line1:d,line2:r,name:c,phone:f,postal_code:b,state:p}=this.currentAddress,m=null===(s=a.shippingZoneCountries)||void 0===s?void 0:s[n],u=({bold:s,content:o})=>{const t=h(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"},l("shipping"===this.addressType?"Shipping":"Billing"))),e("div",{class:"zonos--address-group"},c&&e("div",{class:"zonos--address-line"},u({bold:!0,content:c})),i&&e("div",{class:"zonos--address-line"},u({content:i})),f&&e("div",{class:"zonos--address-line"},u({content:f})),d&&e("div",{class:"zonos--address-line"},u({content:d})),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}))))}};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: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 x=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,n,i;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===(n=this.translatedAddress.postal_code)||void 0===n?void 0:n[c])||c,state:(null===(i=this.translatedAddress.state)||void 0===i?void 0:i[h])||h})}componentWillLoad(){this.watchCurrentAddress()}render(){const{city:s,country:o,line1:n,line2:i,name:a,phone:d,postal_code:r,state:c}=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"},l("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"},l("Contact")),e("zonos-input",{key:"1c39c38767fd306c5eb1164cdc989b8291209cf0",class:"zonos--form-email",inputLabel:l("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:l("First name"),inputValue:f,isError:h(f),onInputChange:s=>this.onInputChange({key:"name",value:`${s.detail} ${b}`})}),e("zonos-input",{key:"8ce5fa5c15c6f7928339ea10009ce0e68954a91f",class:"zonos--form-last-name",inputLabel:l("Last name"),inputValue:b,isError:h(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"},l("Address")),e("zonos-input",{key:"a622025924ca86bdbf1d3c04b79e6dee172b4c42",class:"zonos--form-country",inputLabel:l("Country"),inputValue:o,isDisabled:!0}),e("zonos-input",{key:"f99b3a74db09ab5730878e80705b9aeac76bf800",class:"zonos--form-line1",inputLabel:l("Address line 1"),inputValue:n,isError:h(n),onInputChange:s=>this.onInputChange({key:"line1",value:s.detail})}),e("zonos-input",{key:"5d16aefa45a78045c87d166aaaec0255606e455e",class:"zonos--form-line2",inputLabel:l("Address line 2"),inputValue:i,isError:h(i),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:l("City"),inputValue:s,isError:h(s),onInputChange:s=>this.onInputChange({key:"city",value:s.detail})}),e("zonos-input",{key:"d4f97900b5fe2e1619950a52d1d1f716a8bc19ff",class:"zonos--form-state",inputLabel:l("State/Province"),inputValue:c,isError:h(c),onInputChange:s=>this.onInputChange({key:"state",value:s.detail})})),e("zonos-input",{key:"cf1eb0ca5cd15c8412a2e1246aaf2e39361dc733",class:"zonos--form-postal-code",inputLabel:l("Postal code"),inputValue:r,isError:h(r),onInputChange:s=>this.onInputChange({key:"postal_code",value:s.detail})}),e("zonos-input",{key:"7421c82847eded6bdbcce49ef8196124d8e50c1d",class:"zonos--form-phone",inputLabel:l("Phone number"),inputValue:d,onInputChange:s=>this.onInputChange({key:"phone",value:s.detail})}))))}static get watchers(){return{translatedAddress:["watchCurrentAddress"]}}};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--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 k=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,n,i,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===(n=o.line2)||void 0===n?void 0:n[c])||c,name:(null===(i=o.name)||void 0===i?void 0:i[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,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})),d=!!Object.keys(i).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"),n=null==t?void 0:t[0],i=null==t?void 0:t[1],a=(null===(o=null==n?void 0:n.shadowRoot)||void 0===o?void 0:o.querySelector(".has-error"))||(null===(e=null==i?void 0:i.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:n})},this.buildTranslateAddressState=({currentAddress:s,translatedAddress:o})=>{const{city:e,line1:t,line2:n,name:i,postal_code:a,state:d}=s;return{city:{[e]:o.city},line1:{[t]:o.line1},line2:{[n]:o.line2},name:{[i]: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||b.appearance.colorSecondary)?"outline":this.submitBtnType||"standard",o=this.billingAddress,n=this.shippingAddress;return e(t,{key:"655845cef04f4af526b1a1c4e49243c4f2b4c7f6",class:m(["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"},l("Update your address")),e("zonos-button",{key:"66abf7b74045e68e84e631298504236d32ca9c4e",class:"zonos--close-button",icon:e("zonos-icon",{"aria-label":"Close checkout dialog",content:u}),noBackground:!0,onClick:()=>this.closeUpdateDialogHandler()})),e("zonos-text",{key:"ffb3d8f169867d5f6dff269e1becd99c98c5a7da"},l("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"},l("What you entered")),e("div",{key:"6ac8f9c14472370c501af1b0d50bd8f8746b7694",class:"zonos--address-display-group"},e("zonos-address-display",{key:"ea2c67a7bba51c99f80be968e448beeffcf1f863",addressType:"shipping",currentAddress:n}),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"},l("Translated address")),e("zonos-address-form",{key:"c55d9d3c658565ceb7c7b879f444e3937b9f7ad6",addressType:"shipping",class:"zonos--shipping-address-form",currentAddress:n,onAddressChange:s=>{this.translatedShippingAddressState=this.buildTranslateAddressState({currentAddress:n,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"},l("Cancel")),e("zonos-button",{key:"acbacb92cedb325b46843d8f3aff13f4e7c86ab5",backgroundColor:this.submitBtnColor,class:"zonos--update-btn",loading:this.continueLoading,onClick:()=>this.continueClickHandler(),size:"sm",variant:s},l("Update address")))))))}get el(){return n(this)}static get watchers(){return{translatedShippingAddress:["watchTranslatedShippingAddress"],translatedBillingAddress:["watchTranslatedBillingAddress"]}}};k.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 w=["blue","cyan","green","orange","purple","red","gray","glass"],A=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=w.includes(this.backgroundColor),o=s?`var(--zonos-elements-${this.backgroundColor}-600)`:this.backgroundColor,n=s?`var(--zonos-elements-${this.backgroundColor}-200)`:y(o)?"var(--zonos-elements-gray-0)":"var(--zonos-elements-gray-800)",i=z({customRoundRadius:"4px",overrideBorderStyle:this.borderStyle});return e(t,{key:"8613d885c639d01671743dbdb0583c390718c732",class:m(["zonos--elements zonos--checkbox"]),style:{"--background-color":o,"--border-radius":i,"--font-family":p(),"--size":`${this.size}px`}},e("label",{key:"803434d7a63e1735bf0ef15a9e4c7fb515bfff41",class:m([this.isDisabled&&"disabled"])},e("input",{key:"a19a46a896597f4c47d4ec790a21b5133c13b952",checked:this.isChecked,disabled:this.isDisabled,hidden:!0,onChange:s=>{this.checkboxSelected.emit(s.target.checked)},type:"checkbox"}),e("span",{key:"7f4b933f9626bc05f052d79fa25a0c46ee16f492",class:"checkmark-container"},e("svg",{key:"775d0b011a1430f712e8f633e2850d6f6e193f36",class:"checkmark",color:n,fill:"none",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e("path",{key:"eef97178731ac1bf9885d5cfd57afa514c20df5f","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:"0f72347f0b21817cd176393219374008a056b590",size:this.fontSize},this.label)))}};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{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 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=z({overrideBorderStyle:this.borderStyle});return e(t,{key:"0ba21daff1a07b91701cec30ff80c0b10a8f5344",class:m(["zonos--elements",this.open&&"open",this.isLoading&&"is-loading",this.noBorder&&"no-border",this.isMobile&&"mobile"]),style:{"--border-radius":s,"--font-family":p(),"--height":this.height||"initial","--min-height":this.minHeight||"500px","--width":this.width}},e("div",{key:"84c2c67ff9b89cf28cd7864a79e76daf9d0c5093",class:"zonos--backdrop"}),e("div",{key:"c621463f2ca3721aacfdf666b0dd5a4749dd385a",class:"zonos--dialog-layout",inert:!this.open,onClick:this.clickOutsideDialogHandler},e("div",{key:"61bf1362b55f4a7e515f3ab1b4fd9a0e1e1794b2",class:"zonos--dialog"},this.isLoading&&e("div",{key:"c84edec7ec322fc6a7eaf17ed54aeffd23dd4480",class:"zonos--loading"},e("zonos-spinner",{key:"4f8e004e7286d053f195f9eea578dc416ff1d142",size:30})),(this.headerText||!this.noCloseButton)&&e("div",{key:"196316fc1ec1e099b87ea36829d334c45c3a6a24",class:"zonos--header"},this.headerText&&e("h3",{key:"452ba8e853ffe1fc278e4cb48dbdcc407d5257e6",class:"zonos--header-text"},this.headerText),!this.noCloseButton&&e("zonos-button",{key:"40933095b20bf1a993e142d58df10b50c0359b23",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:"69a696e723483aafa595176dace2ed8bc3274836",class:m(["zonos--body",this.noBodyPadding&&"zonos--no-body-padding"])},e("slot",{key:"53f5ea4e4bab900f4ddf720e3589862a40e3e91f"})),e("slot",{key:"1f7628b5749261e4e5ad703a78b5c9b276ad18e9",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=i.stripe}watchInitStripe(){if(!this.stripe||!i.stripeElements)return;const s=i.stripeLinkElement||i.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=>{i.stripeLinkEventData=s})),i.stripeLinkElement=s):c("Cannot find container element for linkAuthenticationElement")}componentDidLoad(){this.watchInitStripe()}render(){return e(t,{key:"7c110f013b4e24c92a4194045dc084fb795d0f91",class:"zonos--link-authentication zonos--elements"},e("zonos-text",{key:"dcbbd48a47c696641fbd64cdfff16946824ffc46",class:"zonos--title",type:"semiBoldLabel"},this.titleText),e("div",{key:"a77b5cb13e7e15b2a69efaa179abacc52061e9d0",class:"zonos--link-authentication-component"}))}get el(){return n(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{g as zonos_address,v as zonos_address_display,x as zonos_address_form,k as zonos_address_update_dialog,A as zonos_checkbox,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 n}from"./p-5b7da777.js";import{j as i,l as a,D as d,t as l}from"./p-cb9ff4df.js";import{i as r}from"./p-81a54668.js";import{a as c}from"./p-ad7ce197.js";import{i as h,c as f}from"./p-0c64dbbb.js";import{z as b,d as p}from"./p-1086aac3.js";import{c as m}from"./p-b4b7f705.js";import{R as u}from"./p-08e7107d.js";import{g as z}from"./p-1ca5696d.js";import{i as y}from"./p-a1b755bf.js";const g=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:i.stripeBillingAddressElement,stripeAddressEventData:i.stripeBillingAddressEventData,stripeElements:i.stripeElementsForBillingAddress}:{stripeAddressElement:i.stripeAddressElement,stripeAddressEventData:i.stripeAddressEventData,stripeElements:i.stripeElements}}updateAddressEventData({event:s,type:o}){"billing"===o?i.stripeBillingAddressEventData=s:i.stripeAddressEventData=s}updateAddressElement({stripeAddressElement:s,type:o}){"shipping"!==o?i.stripeBillingAddressElement=s:i.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 c("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 n=a.shippingZoneCountries,i=n?Object.values(n).map((s=>s.code)):[],l=t.create("address",{allowedCountries:"shipping"===this.type?i:[],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||d}),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"}}});l.mount(this.el.querySelector(".zonos--address-component")),l.on("change",(s=>{const o=s.value;!this.isDirtyAddress&&o.address.line1.length>=3&&(this.isDirtyAddress=!0,setTimeout((()=>{if(r())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:l,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:"aa9a569b302099681082cd4219b553f9c70842ea",class:"zonos--address zonos--elements"},e("zonos-text",{key:"60050e9f8f0b80dde9acc9ffbd868333fdabf2b3",class:"zonos--title",type:"semiBoldLabel"},this.titleText),e("div",{key:"5af7ee4f23d75fc877cdde7babe0edaefef14da8",class:"zonos--address-component"}))}get el(){return n(this)}static get watchers(){return{stripe:["watchInitStripe"]}}};g.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 v=class{constructor(o){s(this,o),this.currentAddress=void 0,this.addressType=void 0}render(){var s;const{city:o,country:n,email:i,line1:d,line2:r,name:c,phone:f,postal_code:b,state:p}=this.currentAddress,m=null===(s=a.shippingZoneCountries)||void 0===s?void 0:s[n],u=({bold:s,content:o})=>{const t=h(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"},l("shipping"===this.addressType?"Shipping":"Billing"))),e("div",{class:"zonos--address-group"},c&&e("div",{class:"zonos--address-line"},u({bold:!0,content:c})),i&&e("div",{class:"zonos--address-line"},u({content:i})),f&&e("div",{class:"zonos--address-line"},u({content:f})),d&&e("div",{class:"zonos--address-line"},u({content:d})),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}))))}};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: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 x=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,n,i;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===(n=this.translatedAddress.postal_code)||void 0===n?void 0:n[c])||c,state:(null===(i=this.translatedAddress.state)||void 0===i?void 0:i[h])||h})}componentWillLoad(){this.watchCurrentAddress()}render(){const{city:s,country:o,line1:n,line2:i,name:a,phone:d,postal_code:r,state:c}=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"},l("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"},l("Contact")),e("zonos-input",{key:"1c39c38767fd306c5eb1164cdc989b8291209cf0",class:"zonos--form-email",inputLabel:l("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:l("First name"),inputValue:f,isError:h(f),onInputChange:s=>this.onInputChange({key:"name",value:`${s.detail} ${b}`})}),e("zonos-input",{key:"8ce5fa5c15c6f7928339ea10009ce0e68954a91f",class:"zonos--form-last-name",inputLabel:l("Last name"),inputValue:b,isError:h(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"},l("Address")),e("zonos-input",{key:"a622025924ca86bdbf1d3c04b79e6dee172b4c42",class:"zonos--form-country",inputLabel:l("Country"),inputValue:o,isDisabled:!0}),e("zonos-input",{key:"f99b3a74db09ab5730878e80705b9aeac76bf800",class:"zonos--form-line1",inputLabel:l("Address line 1"),inputValue:n,isError:h(n),onInputChange:s=>this.onInputChange({key:"line1",value:s.detail})}),e("zonos-input",{key:"5d16aefa45a78045c87d166aaaec0255606e455e",class:"zonos--form-line2",inputLabel:l("Address line 2"),inputValue:i,isError:h(i),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:l("City"),inputValue:s,isError:h(s),onInputChange:s=>this.onInputChange({key:"city",value:s.detail})}),e("zonos-input",{key:"d4f97900b5fe2e1619950a52d1d1f716a8bc19ff",class:"zonos--form-state",inputLabel:l("State/Province"),inputValue:c,isError:h(c),onInputChange:s=>this.onInputChange({key:"state",value:s.detail})})),e("zonos-input",{key:"cf1eb0ca5cd15c8412a2e1246aaf2e39361dc733",class:"zonos--form-postal-code",inputLabel:l("Postal code"),inputValue:r,isError:h(r),onInputChange:s=>this.onInputChange({key:"postal_code",value:s.detail})}),e("zonos-input",{key:"7421c82847eded6bdbcce49ef8196124d8e50c1d",class:"zonos--form-phone",inputLabel:l("Phone number"),inputValue:d,onInputChange:s=>this.onInputChange({key:"phone",value:s.detail})}))))}static get watchers(){return{translatedAddress:["watchCurrentAddress"]}}};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--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 k=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,n,i,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===(n=o.line2)||void 0===n?void 0:n[c])||c,name:(null===(i=o.name)||void 0===i?void 0:i[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,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})),d=!!Object.keys(i).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"),n=null==t?void 0:t[0],i=null==t?void 0:t[1],a=(null===(o=null==n?void 0:n.shadowRoot)||void 0===o?void 0:o.querySelector(".has-error"))||(null===(e=null==i?void 0:i.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:n})},this.buildTranslateAddressState=({currentAddress:s,translatedAddress:o})=>{const{city:e,line1:t,line2:n,name:i,postal_code:a,state:d}=s;return{city:{[e]:o.city},line1:{[t]:o.line1},line2:{[n]:o.line2},name:{[i]: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||b.appearance.colorSecondary)?"outline":this.submitBtnType||"standard",o=this.billingAddress,n=this.shippingAddress;return e(t,{key:"655845cef04f4af526b1a1c4e49243c4f2b4c7f6",class:m(["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"},l("Update your address")),e("zonos-button",{key:"66abf7b74045e68e84e631298504236d32ca9c4e",class:"zonos--close-button",icon:e("zonos-icon",{"aria-label":"Close checkout dialog",content:u}),noBackground:!0,onClick:()=>this.closeUpdateDialogHandler()})),e("zonos-text",{key:"ffb3d8f169867d5f6dff269e1becd99c98c5a7da"},l("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"},l("What you entered")),e("div",{key:"6ac8f9c14472370c501af1b0d50bd8f8746b7694",class:"zonos--address-display-group"},e("zonos-address-display",{key:"ea2c67a7bba51c99f80be968e448beeffcf1f863",addressType:"shipping",currentAddress:n}),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"},l("Translated address")),e("zonos-address-form",{key:"c55d9d3c658565ceb7c7b879f444e3937b9f7ad6",addressType:"shipping",class:"zonos--shipping-address-form",currentAddress:n,onAddressChange:s=>{this.translatedShippingAddressState=this.buildTranslateAddressState({currentAddress:n,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"},l("Cancel")),e("zonos-button",{key:"acbacb92cedb325b46843d8f3aff13f4e7c86ab5",backgroundColor:this.submitBtnColor,class:"zonos--update-btn",loading:this.continueLoading,onClick:()=>this.continueClickHandler(),size:"sm",variant:s},l("Update address")))))))}get el(){return n(this)}static get watchers(){return{translatedShippingAddress:["watchTranslatedShippingAddress"],translatedBillingAddress:["watchTranslatedBillingAddress"]}}};k.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 w=["blue","cyan","green","orange","purple","red","gray","glass"],A=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=w.includes(this.backgroundColor),o=s?`var(--zonos-elements-${this.backgroundColor}-600)`:this.backgroundColor,n=s?`var(--zonos-elements-${this.backgroundColor}-200)`:y(o)?"var(--zonos-elements-gray-0)":"var(--zonos-elements-gray-800)",i=z({customRoundRadius:"4px",overrideBorderStyle:this.borderStyle});return e(t,{key:"8613d885c639d01671743dbdb0583c390718c732",class:m(["zonos--elements zonos--checkbox"]),style:{"--background-color":o,"--border-radius":i,"--font-family":p(),"--size":`${this.size}px`}},e("label",{key:"803434d7a63e1735bf0ef15a9e4c7fb515bfff41",class:m([this.isDisabled&&"disabled"])},e("input",{key:"a19a46a896597f4c47d4ec790a21b5133c13b952",checked:this.isChecked,disabled:this.isDisabled,hidden:!0,onChange:s=>{this.checkboxSelected.emit(s.target.checked)},type:"checkbox"}),e("span",{key:"7f4b933f9626bc05f052d79fa25a0c46ee16f492",class:"checkmark-container"},e("svg",{key:"775d0b011a1430f712e8f633e2850d6f6e193f36",class:"checkmark",color:n,fill:"none",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e("path",{key:"eef97178731ac1bf9885d5cfd57afa514c20df5f","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:"0f72347f0b21817cd176393219374008a056b590",size:this.fontSize},this.label)))}};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{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 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=z({overrideBorderStyle:this.borderStyle});return e(t,{key:"0ba21daff1a07b91701cec30ff80c0b10a8f5344",class:m(["zonos--elements",this.open&&"open",this.isLoading&&"is-loading",this.noBorder&&"no-border",this.isMobile&&"mobile"]),style:{"--border-radius":s,"--font-family":p(),"--height":this.height||"initial","--min-height":this.minHeight||"500px","--width":this.width}},e("div",{key:"84c2c67ff9b89cf28cd7864a79e76daf9d0c5093",class:"zonos--backdrop"}),e("div",{key:"c621463f2ca3721aacfdf666b0dd5a4749dd385a",class:"zonos--dialog-layout",inert:!this.open,onClick:this.clickOutsideDialogHandler},e("div",{key:"61bf1362b55f4a7e515f3ab1b4fd9a0e1e1794b2",class:"zonos--dialog"},this.isLoading&&e("div",{key:"c84edec7ec322fc6a7eaf17ed54aeffd23dd4480",class:"zonos--loading"},e("zonos-spinner",{key:"4f8e004e7286d053f195f9eea578dc416ff1d142",size:30})),(this.headerText||!this.noCloseButton)&&e("div",{key:"196316fc1ec1e099b87ea36829d334c45c3a6a24",class:"zonos--header"},this.headerText&&e("h3",{key:"452ba8e853ffe1fc278e4cb48dbdcc407d5257e6",class:"zonos--header-text"},this.headerText),!this.noCloseButton&&e("zonos-button",{key:"40933095b20bf1a993e142d58df10b50c0359b23",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:"69a696e723483aafa595176dace2ed8bc3274836",class:m(["zonos--body",this.noBodyPadding&&"zonos--no-body-padding"])},e("slot",{key:"53f5ea4e4bab900f4ddf720e3589862a40e3e91f"})),e("slot",{key:"1f7628b5749261e4e5ad703a78b5c9b276ad18e9",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=i.stripe}watchInitStripe(){if(!this.stripe||!i.stripeElements)return;const s=i.stripeLinkElement||i.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=>{i.stripeLinkEventData=s})),i.stripeLinkElement=s):c("Cannot find container element for linkAuthenticationElement")}componentDidLoad(){this.watchInitStripe()}render(){return e(t,{key:"7c110f013b4e24c92a4194045dc084fb795d0f91",class:"zonos--link-authentication zonos--elements"},e("zonos-text",{key:"dcbbd48a47c696641fbd64cdfff16946824ffc46",class:"zonos--title",type:"semiBoldLabel"},this.titleText),e("div",{key:"a77b5cb13e7e15b2a69efaa179abacc52061e9d0",class:"zonos--link-authentication-component"}))}get el(){return n(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{g as zonos_address,v as zonos_address_display,x as zonos_address_form,k as zonos_address_update_dialog,A as zonos_checkbox,C as zonos_dialog,I as zonos_link_authentication}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(t,n,i,o){function e(t){return t instanceof i?t:new i((function(n){n(t)}))}return new(i||(i=Promise))((function(i,r){function u(t){try{a(o.next(t))}catch(t){r(t)}}function s(t){try{a(o["throw"](t))}catch(t){r(t)}}function a(t){t.done?i(t.value):e(t.value).then(u,s)}a((o=o.apply(t,n||[])).next())}))};var __generator=this&&this.__generator||function(t,n){var i={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},o,e,r,u;return u={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(u[Symbol.iterator]=function(){return this}),u;function s(t){return function(n){return a([t,n])}}function a(s){if(o)throw new TypeError("Generator is already executing.");while(u&&(u=0,s[0]&&(i=0)),i)try{if(o=1,e&&(r=s[0]&2?e["return"]:s[0]?e["throw"]||((r=e["return"])&&r.call(e),0):e.next)&&!(r=r.call(e,s[1])).done)return r;if(e=0,r)s=[s[0]&2,r.value];switch(s[0]){case 0:case 1:r=s;break;case 4:i.label++;return{value:s[1],done:false};case 5:i.label++;e=s[1];s=[0];continue;case 7:s=i.ops.pop();i.trys.pop();continue;default:if(!(r=i.trys,r=r.length>0&&r[r.length-1])&&(s[0]===6||s[0]===2)){i=0;continue}if(s[0]===3&&(!r||s[1]>r[0]&&s[1]<r[3])){i.label=s[1];break}if(s[0]===6&&i.label<r[1]){i.label=r[1];r=s;break}if(r&&i.label<r[2]){i.label=r[2];i.ops.push(s);break}if(r[2])i.ops.pop();i.trys.pop();continue}s=n.call(t,i)}catch(t){s=[6,t];e=0}finally{o=r=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-fd061229.system.js","./p-6b7fa35e.system.js","./p-b74ff880.system.js","./p-197c5707.system.js","./p-91462d96.system.js","./p-455b7545.system.js"],(function(t){"use strict";var n,i,o,e,r,u,s,a,c,f,d,h,l,v,w;return{setters:[function(t){n=t.r;i=t.c;o=t.h;e=t.H},function(t){r=t.x;u=t.j;s=t.y;a=t.d;c=t.a},function(t){f=t.z;d=t.b;h=t.d},function(t){l=t.h;v=t.a;w=t.l},function(){},function(){}],execute:function(){var m=this;var _=function(){return __awaiter(m,void 0,void 0,(function(){var t,n,i,o;return __generator(this,(function(e){switch(e.label){case 0:return[4,l("/api/zonos-elements/zonos-settings")];case 1:t=e.sent(),n=t.errors,i=t.json,o=t.zonosMode;if(n.length){v("Error occurred when getting zonos settings. If this is not an unauthorized error, it will use user settings or default settings");return[2,{errors:n,json:null,zonosMode:o}]}return[2,{errors:[],json:i,zonosMode:o}]}}))}))};var b=function(){var t=document.querySelector("zonos-checkout");if(!t){var n=document.createElement("zonos-checkout");document.body.appendChild(n)}};var p=function(t){if(!t.placeOrderButtonSelector&&!window.Zonos.cartData){return}if(t.placeOrderButtonSelector&&!r(t.placeOrderButtonSelector)){v('Selector checkoutButtonAnchor "'.concat(t.placeOrderButtonSelector,'" is not a valid selector'));return}b()};var g=function(t){var n=document.querySelector(t);var i=document.querySelector("zonos-hello");if(!i&&n){var o=document.createElement("zonos-hello");n.appendChild(o);return true}return false};var y=function(t){var n=t.position,i=n===void 0?"bottom-right":n;var o=".zonos--hello-mobile-wrapper";var e=document.querySelector(o);if(e){return o}var r=document.createElement("div");r.className="zonos--hello-mobile-wrapper";r.style.position="fixed";if(i==="top-right"){r.style.top="72px";r.style.right="24px"}if(i==="top-left"){r.style.top="72px";r.style.left="24px"}if(i==="bottom-right"){r.style.bottom="72px";r.style.right="24px"}if(i==="bottom-left"){r.style.bottom="72px";r.style.left="24px"}r.style.zIndex="2147483007";document.body.appendChild(r);return o};var z=function(t){return __awaiter(m,void 0,void 0,(function(){var n,i,o,e,u;return __generator(this,(function(s){if(window.Zonos.isLegacyCheckout){w("Hello is disabled when isLegacyCheckout","info");return[2]}n=t.anchorElementSelector;i=n;if(!t.anchorElementSelector&&t.desktopLocation){o=y({position:"bottom-right"});i=o}if(!i||!r(i)){v('Selector anchorElementSelector "'.concat(t.anchorElementSelector,'" is not a valid selector.'));return[2]}w("Hello init complete");e=g(i);if(!e){u=new MutationObserver((function(){var t=g(i);if(t){u.disconnect()}}));u.observe(document.body,{childList:true,subtree:true});setTimeout((function(){g(i)}),1e3)}return[2]}))}))};var j=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{visibility:hidden;opacity:0;height:0}";var I=j;var k=t("zonos_controller",function(){function t(t){n(this,t);this.paypalInitEvent=i(this,"paypalInitEvent",7);this.stripeInitEvent=i(this,"stripeInitEvent",7);this.config=undefined;this.zonosApiKey=undefined}t.prototype.initCheckoutElement=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){if(!t){w("Stripe is not loaded yet - cannot init checkout element","warn");return[2]}u.stripe=t;void p(f.checkoutSettings);w("init checkout element");return[2]}))}))};t.prototype.initZonosNotification=function(){var t=document.querySelector("zonos-notification");if(t){return}var n=document.createElement("zonos-notification");document.body.appendChild(n)};t.prototype.setupGoogleFont=function(t){return __awaiter(this,void 0,void 0,(function(){var n,i,o,e,r,u,s,a;return __generator(this,(function(c){switch(c.label){case 0:o=t||h();if(o==="Inter"){if(!t){return[2]}w("[FONT] Just applied Inter , but no need to inject since we already inject Inter on start","warn");f.appearance=Object.assign(Object.assign({},f.appearance),{fontFamily:t})}e=new URLSearchParams;e.set("family",o);return[4,l("/api/zonos-elements/get-font-detail?".concat(e.toString()))];case 1:r=c.sent(),u=r.errors,s=r.json;if(u.length>0||!(s===null||s===void 0?void 0:s.fontUrl)){w("Failed to load font ".concat(o),"warn");f.appearance=Object.assign(Object.assign({},f.appearance),{fontFamily:"Inter"});return[2]}a=s.fontUrl;(i=(n=window.Zonos).injectSupportGoogleFont)===null||i===void 0?void 0:i.call(n,a);if(!t){return[2]}w("[FONT] ".concat(t," font override applied"));f.appearance=Object.assign(Object.assign({},f.appearance),{fontFamily:t});return[2]}}))}))};t.prototype.handleLocationChange=function(){void z(f.helloSettings)};t.prototype.initHistoryListener=function(){var t=history.pushState;history.pushState=function n(){window.dispatchEvent(new window.Event("pushstate"));window.dispatchEvent(new window.Event("locationchange"));return t.apply(this,arguments)};var n=history.replaceState;history.replaceState=function t(){window.dispatchEvent(new window.Event("replacestate"));window.dispatchEvent(new window.Event("locationchange"));return n.apply(this,arguments)}};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(n){this.initHistoryListener();f.zonosApiKey=this.zonosApiKey;(function(){return __awaiter(t,void 0,void 0,(function(){var t,n,i,o,e,r,u,a,c;var h=this;return __generator(this,(function(l){switch(l.label){case 0:return[4,_()];case 1:i=l.sent(),o=i.errors,e=i.json,r=i.zonosMode;if(((t=o[0])===null||t===void 0?void 0:t.type.toString())==="403"){w("Failed to load zonos settings. This domain may not have access","warn");return[2]}this.initZonosNotification();u=function(){var t,n,i;if(window.Zonos.isLegacyCheckout){return((t=e===null||e===void 0?void 0:e.appearanceSettings)===null||t===void 0?void 0:t.logoUrl)||((n=h.config.appearance)===null||n===void 0?void 0:n.logoUrl)}return(i=h.config.appearance)===null||i===void 0?void 0:i.logoUrl};a=Object.assign(Object.assign({},this.config),{appearance:Object.assign(Object.assign({},this.config.appearance),{logoUrl:u()}),checkoutSettings:this.config.checkoutSettings?Object.assign(Object.assign({},this.config.checkoutSettings),{subscriptionStatus:undefined}):undefined});d({overrideSettings:a,zonosSettings:e});f.zonosMode=r;void this.setupGoogleFont();if(f.helloSettings.visibilityStatus==="DISABLED"){w("=== Hello is disabled by store owner ===","warn")}if(f.helloSettings&&f.helloSettings.visibilityStatus==="ENABLED"){w("Initializing hello");void z(f.helloSettings)}return[4,s()];case 2:l.sent();c=((n=e===null||e===void 0?void 0:e.checkoutSettings)===null||n===void 0?void 0:n.externalServiceTokens.find((function(t){return t.type==="STRIPE_PUBLISHABLE_TOKEN"})))||null;if(!c||!this.stripeInitEvent){w("Checkout failed to load -- missing publishable key","warn");return[2]}if(f.checkoutSettings.subscriptionStatus==="INACTIVE"){w('=== Checkout subscription is "INACTIVE" - Cancel initializing for Checkout ===',"warn");w("zonos controller loaded");return[2]}if(f.checkoutSettings.visibilityStatus==="DISABLED"){w("=== Checkout is disabled by store owner ===","warn");w("zonos controller loaded");return[2]}this.stripeInitEvent.emit({publishableKey:c.token});return[2]}}))}))})();return[2]}))}))};t.prototype.showNotification=function(t){return __awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(i){n=document.querySelector("zonos-notification");if(!n){w("Failed to show notification - zonos-notification not found","warn");return[2]}void n.showNotification(t);return[2]}))}))};t.prototype.reset=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){a.checkoutSessionId=null;u.clientSecret=null;return[2]}))}))};t.prototype.overrideConfig=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){d({overrideSettings:t,zonosSettings:null});return[2]}))}))};t.prototype.overrideCountry=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){w("Override country code to ".concat(t));void c(t);return[2]}))}))};t.prototype.getAppearanceSetting=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,f.appearance]}))}))};t.prototype.updateOrganizationName=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){f.organizationName=t;return[2]}))}))};t.prototype.render=function(){return o(e,{key:"133cc684aab52bfe4be6c4a318b1769928acc7a8",class:"zonos--elements"})};return t}());k.style=I}}}));
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(t,n,i,o){function e(t){return t instanceof i?t:new i((function(n){n(t)}))}return new(i||(i=Promise))((function(i,r){function u(t){try{a(o.next(t))}catch(t){r(t)}}function s(t){try{a(o["throw"](t))}catch(t){r(t)}}function a(t){t.done?i(t.value):e(t.value).then(u,s)}a((o=o.apply(t,n||[])).next())}))};var __generator=this&&this.__generator||function(t,n){var i={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},o,e,r,u;return u={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(u[Symbol.iterator]=function(){return this}),u;function s(t){return function(n){return a([t,n])}}function a(s){if(o)throw new TypeError("Generator is already executing.");while(u&&(u=0,s[0]&&(i=0)),i)try{if(o=1,e&&(r=s[0]&2?e["return"]:s[0]?e["throw"]||((r=e["return"])&&r.call(e),0):e.next)&&!(r=r.call(e,s[1])).done)return r;if(e=0,r)s=[s[0]&2,r.value];switch(s[0]){case 0:case 1:r=s;break;case 4:i.label++;return{value:s[1],done:false};case 5:i.label++;e=s[1];s=[0];continue;case 7:s=i.ops.pop();i.trys.pop();continue;default:if(!(r=i.trys,r=r.length>0&&r[r.length-1])&&(s[0]===6||s[0]===2)){i=0;continue}if(s[0]===3&&(!r||s[1]>r[0]&&s[1]<r[3])){i.label=s[1];break}if(s[0]===6&&i.label<r[1]){i.label=r[1];r=s;break}if(r&&i.label<r[2]){i.label=r[2];i.ops.push(s);break}if(r[2])i.ops.pop();i.trys.pop();continue}s=n.call(t,i)}catch(t){s=[6,t];e=0}finally{o=r=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-fd061229.system.js","./p-6c380fa8.system.js","./p-b74ff880.system.js","./p-197c5707.system.js","./p-91462d96.system.js","./p-455b7545.system.js"],(function(t){"use strict";var n,i,o,e,r,u,s,a,c,f,d,h,l,v,w;return{setters:[function(t){n=t.r;i=t.c;o=t.h;e=t.H},function(t){r=t.x;u=t.j;s=t.y;a=t.d;c=t.a},function(t){f=t.z;d=t.b;h=t.d},function(t){l=t.h;v=t.a;w=t.l},function(){},function(){}],execute:function(){var m=this;var _=function(){return __awaiter(m,void 0,void 0,(function(){var t,n,i,o;return __generator(this,(function(e){switch(e.label){case 0:return[4,l("/api/zonos-elements/zonos-settings")];case 1:t=e.sent(),n=t.errors,i=t.json,o=t.zonosMode;if(n.length){v("Error occurred when getting zonos settings. If this is not an unauthorized error, it will use user settings or default settings");return[2,{errors:n,json:null,zonosMode:o}]}return[2,{errors:[],json:i,zonosMode:o}]}}))}))};var b=function(){var t=document.querySelector("zonos-checkout");if(!t){var n=document.createElement("zonos-checkout");document.body.appendChild(n)}};var p=function(t){if(!t.placeOrderButtonSelector&&!window.Zonos.cartData){return}if(t.placeOrderButtonSelector&&!r(t.placeOrderButtonSelector)){v('Selector checkoutButtonAnchor "'.concat(t.placeOrderButtonSelector,'" is not a valid selector'));return}b()};var g=function(t){var n=document.querySelector(t);var i=document.querySelector("zonos-hello");if(!i&&n){var o=document.createElement("zonos-hello");n.appendChild(o);return true}return false};var y=function(t){var n=t.position,i=n===void 0?"bottom-right":n;var o=".zonos--hello-mobile-wrapper";var e=document.querySelector(o);if(e){return o}var r=document.createElement("div");r.className="zonos--hello-mobile-wrapper";r.style.position="fixed";if(i==="top-right"){r.style.top="72px";r.style.right="24px"}if(i==="top-left"){r.style.top="72px";r.style.left="24px"}if(i==="bottom-right"){r.style.bottom="72px";r.style.right="24px"}if(i==="bottom-left"){r.style.bottom="72px";r.style.left="24px"}r.style.zIndex="2147483007";document.body.appendChild(r);return o};var z=function(t){return __awaiter(m,void 0,void 0,(function(){var n,i,o,e,u;return __generator(this,(function(s){if(window.Zonos.isLegacyCheckout){w("Hello is disabled when isLegacyCheckout","info");return[2]}n=t.anchorElementSelector;i=n;if(!t.anchorElementSelector&&t.desktopLocation){o=y({position:"bottom-right"});i=o}if(!i||!r(i)){v('Selector anchorElementSelector "'.concat(t.anchorElementSelector,'" is not a valid selector.'));return[2]}w("Hello init complete");e=g(i);if(!e){u=new MutationObserver((function(){var t=g(i);if(t){u.disconnect()}}));u.observe(document.body,{childList:true,subtree:true});setTimeout((function(){g(i)}),1e3)}return[2]}))}))};var j=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{visibility:hidden;opacity:0;height:0}";var I=j;var k=t("zonos_controller",function(){function t(t){n(this,t);this.paypalInitEvent=i(this,"paypalInitEvent",7);this.stripeInitEvent=i(this,"stripeInitEvent",7);this.config=undefined;this.zonosApiKey=undefined}t.prototype.initCheckoutElement=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){if(!t){w("Stripe is not loaded yet - cannot init checkout element","warn");return[2]}u.stripe=t;void p(f.checkoutSettings);w("init checkout element");return[2]}))}))};t.prototype.initZonosNotification=function(){var t=document.querySelector("zonos-notification");if(t){return}var n=document.createElement("zonos-notification");document.body.appendChild(n)};t.prototype.setupGoogleFont=function(t){return __awaiter(this,void 0,void 0,(function(){var n,i,o,e,r,u,s,a;return __generator(this,(function(c){switch(c.label){case 0:o=t||h();if(o==="Inter"){if(!t){return[2]}w("[FONT] Just applied Inter , but no need to inject since we already inject Inter on start","warn");f.appearance=Object.assign(Object.assign({},f.appearance),{fontFamily:t})}e=new URLSearchParams;e.set("family",o);return[4,l("/api/zonos-elements/get-font-detail?".concat(e.toString()))];case 1:r=c.sent(),u=r.errors,s=r.json;if(u.length>0||!(s===null||s===void 0?void 0:s.fontUrl)){w("Failed to load font ".concat(o),"warn");f.appearance=Object.assign(Object.assign({},f.appearance),{fontFamily:"Inter"});return[2]}a=s.fontUrl;(i=(n=window.Zonos).injectSupportGoogleFont)===null||i===void 0?void 0:i.call(n,a);if(!t){return[2]}w("[FONT] ".concat(t," font override applied"));f.appearance=Object.assign(Object.assign({},f.appearance),{fontFamily:t});return[2]}}))}))};t.prototype.handleLocationChange=function(){void z(f.helloSettings)};t.prototype.initHistoryListener=function(){var t=history.pushState;history.pushState=function n(){window.dispatchEvent(new window.Event("pushstate"));window.dispatchEvent(new window.Event("locationchange"));return t.apply(this,arguments)};var n=history.replaceState;history.replaceState=function t(){window.dispatchEvent(new window.Event("replacestate"));window.dispatchEvent(new window.Event("locationchange"));return n.apply(this,arguments)}};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(n){this.initHistoryListener();f.zonosApiKey=this.zonosApiKey;(function(){return __awaiter(t,void 0,void 0,(function(){var t,n,i,o,e,r,u,a,c;var h=this;return __generator(this,(function(l){switch(l.label){case 0:return[4,_()];case 1:i=l.sent(),o=i.errors,e=i.json,r=i.zonosMode;if(((t=o[0])===null||t===void 0?void 0:t.type.toString())==="403"){w("Failed to load zonos settings. This domain may not have access","warn");return[2]}this.initZonosNotification();u=function(){var t,n,i;if(window.Zonos.isLegacyCheckout){return((t=e===null||e===void 0?void 0:e.appearanceSettings)===null||t===void 0?void 0:t.logoUrl)||((n=h.config.appearance)===null||n===void 0?void 0:n.logoUrl)}return(i=h.config.appearance)===null||i===void 0?void 0:i.logoUrl};a=Object.assign(Object.assign({},this.config),{appearance:Object.assign(Object.assign({},this.config.appearance),{logoUrl:u()}),checkoutSettings:this.config.checkoutSettings?Object.assign(Object.assign({},this.config.checkoutSettings),{subscriptionStatus:undefined}):undefined});d({overrideSettings:a,zonosSettings:e});f.zonosMode=r;void this.setupGoogleFont();if(f.helloSettings.visibilityStatus==="DISABLED"){w("=== Hello is disabled by store owner ===","warn")}if(f.helloSettings&&f.helloSettings.visibilityStatus==="ENABLED"){w("Initializing hello");void z(f.helloSettings)}return[4,s()];case 2:l.sent();c=((n=e===null||e===void 0?void 0:e.checkoutSettings)===null||n===void 0?void 0:n.externalServiceTokens.find((function(t){return t.type==="STRIPE_PUBLISHABLE_TOKEN"})))||null;if(!c||!this.stripeInitEvent){w("Checkout failed to load -- missing publishable key","warn");return[2]}if(f.checkoutSettings.subscriptionStatus==="INACTIVE"){w('=== Checkout subscription is "INACTIVE" - Cancel initializing for Checkout ===',"warn");w("zonos controller loaded");return[2]}if(f.checkoutSettings.visibilityStatus==="DISABLED"){w("=== Checkout is disabled by store owner ===","warn");w("zonos controller loaded");return[2]}this.stripeInitEvent.emit({publishableKey:c.token});return[2]}}))}))})();return[2]}))}))};t.prototype.showNotification=function(t){return __awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(i){n=document.querySelector("zonos-notification");if(!n){w("Failed to show notification - zonos-notification not found","warn");return[2]}void n.showNotification(t);return[2]}))}))};t.prototype.reset=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){a.checkoutSessionId=null;u.clientSecret=null;return[2]}))}))};t.prototype.overrideConfig=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){d({overrideSettings:t,zonosSettings:null});return[2]}))}))};t.prototype.overrideCountry=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){w("Override country code to ".concat(t));void c(t);return[2]}))}))};t.prototype.getAppearanceSetting=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,f.appearance]}))}))};t.prototype.updateOrganizationName=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){f.organizationName=t;return[2]}))}))};t.prototype.render=function(){return o(e,{key:"133cc684aab52bfe4be6c4a318b1769928acc7a8",class:"zonos--elements"})};return t}());k.style=I}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,o,i){function n(e){return e instanceof o?e:new o((function(t){t(e)}))}return new(o||(o=Promise))((function(o,s){function r(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i["throw"](e))}catch(e){s(e)}}function l(e){e.done?o(e.value):n(e.value).then(r,a)}l((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var o={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,r;return r={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function a(e){return function(t){return l([e,t])}}function l(a){if(i)throw new TypeError("Generator is already executing.");while(r&&(r=0,a[0]&&(o=0)),o)try{if(i=1,n&&(s=a[0]&2?n["return"]:a[0]?n["throw"]||((s=n["return"])&&s.call(n),0):n.next)&&!(s=s.call(n,a[1])).done)return s;if(n=0,s)a=[a[0]&2,s.value];switch(a[0]){case 0:case 1:s=a;break;case 4:o.label++;return{value:a[1],done:false};case 5:o.label++;n=a[1];a=[0];continue;case 7:a=o.ops.pop();o.trys.pop();continue;default:if(!(s=o.trys,s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){o=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){o.label=a[1];break}if(a[0]===6&&o.label<s[1]){o.label=s[1];s=a;break}if(s&&o.label<s[2]){o.label=s[2];o.ops.push(a);break}if(s[2])o.ops.pop();o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e];n=0}finally{i=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};System.register(["./p-fd061229.system.js","./p-56ba5cbf.system.js"],(function(e,t){"use strict";var o,i,n;return{setters:[function(t){o=t.p;i=t.b;e("setNonce",t.s)},function(e){n=e.g}],execute:function(){var e=this;var s=function(){var e=t.meta.url;var i={};if(e!==""){i.resourcesUrl=new URL(".",e).href}return o(i)};s().then((function(t){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,n()];case 1:e.sent();return[2,i(JSON.parse('[["p-d7b341e3.system",[[2,"zonos-checkout",{"appearanceSettingsOverride":[16],"preview":[4],"mobile":[4],"defaultAddress":[16],"forceDialogOpen":[4,"force-dialog-open"],"open":[32],"stripe":[32],"submitLoading":[32],"collapseReviewMobile":[32],"isAttachError":[32],"isMobile":[32],"zonosReviewRef":[32],"storybookPaymentStatusOverride":[32],"isLegacyCheckout":[32],"confirmDialogOpen":[32],"inventoryCheckErrorMessage":[32],"closeDialogHandler":[64],"init":[64],"setToFinishStep":[64],"mockCheckoutSession":[64]},[[16,"zonos--init-cart-info","initCartInfoHandler"],[4,"keydown","handleKeyPress"],[9,"resize","handleWindowResize"]],{"appearanceSettingsOverride":["appearanceSettingsOverrideChanged","handleAppearanceSettingsOverrideChange"],"mobile":["handleMobileChange"],"defaultAddress":["handleAddressChange"]}]]],["p-7b4a5b9b.system",[[1,"zonos-hello",{"mobileLocationOverride":[1,"mobile-location-override"],"animateFromLeftOverride":[4,"animate-from-left-override"],"appearanceSettingsOverride":[16],"showPeekMessage":[32],"zonosStoreHelloSettings":[32],"showDialog":[32],"peekMessage":[32],"initialUrl":[32],"allRestrictedItems":[32],"allFoundProducts":[32],"productsOnPage":[32],"isHelloWidgetRendered":[32],"isMobile":[32],"getCountryList":[64],"displayCurrency":[64],"convertAndFormat":[64],"convert":[64],"format":[64],"openHelloDialog":[64]},[[9,"resize","handleResize"]],{"appearanceSettingsOverride":["handleAppearanceSettingsOverrideChange"]}]]],["p-5ebde561.system",[[1,"zonos-controller",{"config":[16],"zonosApiKey":[1,"zonos-api-key"],"initCheckoutElement":[64],"setupGoogleFont":[64],"showNotification":[64],"reset":[64],"overrideConfig":[64],"overrideCountry":[64],"getAppearanceSetting":[64],"updateOrganizationName":[64]},[[8,"locationchange","handleLocationChange"]]]]],["p-38886017.system",[[1,"zonos-tooltip",{"label":[1],"subtitle":[1],"showTooltip":[32]}]]],["p-22e81fee.system",[[1,"zonos-component",{"first":[1],"middle":[1],"last":[1]}]]],["p-ae7526a2.system",[[1,"zonos-link",{"href":[1],"rel":[1],"target":[1],"linkTitle":[1,"link-title"]}]]],["p-f7bbdd0c.system",[[1,"zonos-logo",{"theme":[1],"width":[1]}]]],["p-c2b7b670.system",[[1,"zonos-card",{"actions":[16],"backgroundColor":[1,"background-color"],"borderRadius":[2,"border-radius"],"footerActions":[16],"footerContent":[16],"footerHeight":[2,"footer-height"],"label":[16],"spacing":[1]}]]],["p-d621f462.system",[[1,"zonos-input",{"inputValue":[1,"input-value"],"inputLabel":[1,"input-label"],"inputSize":[1,"input-size"],"isDisabled":[4,"is-disabled"],"isError":[4,"is-error"],"inputPlaceholder":[1,"input-placeholder"],"value":[32]},null,{"inputValue":["onInputValueChange"]}]]],["p-698f7fd8.system",[[1,"zonos-banner",{"bannerTitle":[1,"banner-title"],"intent":[1],"hasContent":[32]}]]],["p-f68c38d8.system",[[1,"zonos-v-stack",{"spacing":[2]}]]],["p-04553c97.system",[[1,"zonos-text",{"textColor":[1,"text-color"],"size":[1],"type":[1],"weight":[2],"ready":[32]}]]],["p-1eb59b7c.system",[[1,"zonos-language-select",{"handleOnClose":[16]}],[1,"zonos-select-dialog-header",{"handleOnClose":[16],"label":[1]}]]],["p-35b6b151.system",[[1,"zonos-hello-dialog",{"isOpen":[4,"is-open"],"setIsOpen":[16],"mobileLocationOverride":[1,"mobile-location-override"],"animateFromLeftOverride":[4,"animate-from-left-override"],"appearanceSettings":[16],"restrictedItems":[16],"welcomeMessage":[32],"showCountrySelect":[32],"showLanguageSelect":[32]},[[4,"click","globalClickHandler"]],{"isOpen":["isOpenHandler"]}]]],["p-1a92ff9a.system",[[1,"zonos-badge",{"bold":[4],"badgeColor":[1,"badge-color"],"icon":[16],"iconRight":[4,"icon-right"],"size":[1],"rounded":[4],"loading":[4],"dismissHandler":[16]}]]],["p-9931bea7.system",[[1,"zonos-shipping-rich-radio",{"items":[16],"borderColor":[1,"border-color"],"borderStyle":[1,"border-style"],"theme":[1],"selectedItem":[16]}]]],["p-4abca0e9.system",[[1,"zonos-collapse",{"collapsed":[4],"collapseSize":[2,"collapse-size"],"height":[32],"iframe":[32]}]]],["p-133595ff.system",[[2,"zonos-payment",{"titleText":[1,"title-text"],"stripe":[32],"stripeElements":[32]},null,{"stripeElements":["watchInitStripe"],"stripe":["watchInitStripe"]}],[2,"zonos-paypal-payment"],[1,"zonos-notification",{"notificationArray":[32],"showNotification":[64]}]]],["p-63a33354.system",[[1,"zonos-country-flag",{"countryCode":[1,"country-code"],"size":[2]}]]],["p-5d186fc7.system",[[17,"zonos-button",{"buttonColor":[1,"button-color"],"backgroundColor":[1,"background-color"],"borderStyle":[1,"border-style"],"isDisabled":[4,"is-disabled"],"icon":[16],"iconRight":[4,"icon-right"],"size":[1],"variant":[1],"noBackground":[4,"no-background"],"withBoxShadow":[4,"with-box-shadow"],"noPaddingLeft":[4,"no-padding-left"],"noPaddingRight":[4,"no-padding-right"],"loading":[4],"justifyContent":[1,"justify-content"],"theme":[1],"hasIcon":[32],"hasContent":[32]},[[2,"click","clickHandler"]],{"icon":["iconChangeHandler"]}],[1,"zonos-spinner",{"size":[2],"spinnerColor":[1,"spinner-color"]}],[1,"zonos-icon",{"autoHeight":[4,"auto-height"],"iconColor":[1,"icon-color"],"content":[1],"size":[2]}]]],["p-76013796.system",[[1,"zonos-country-select",{"handleOnClose":[16],"inputValue":[32]}],[1,"zonos-hello-dialog-footer",{"appearanceSettings":[16],"setShowCountrySelect":[16],"setShowLanguageSelect":[16]}],[1,"zonos-custom-message",{"icon":[1],"message":[1]}],[2,"zonos-virtual-scroll",{"renderItem":[16],"itemWidth":[2,"item-width"],"fallbackItemHeight":[2,"fallback-item-height"],"itemHeights":[16],"container":[32],"scrollTop":[32],"totalHeight":[32]},null,{"itemHeights":["updateTotalHeight"],"fallbackItemHeight":["updateTotalHeight"]}]]],["p-c37b99dd.system",[[1,"zonos-address-update-dialog",{"continueLoading":[4,"continue-loading"],"dialogLoading":[4,"dialog-loading"],"dialogOpen":[4,"dialog-open"],"submitBtnType":[1,"submit-btn-type"],"submitBtnColor":[1,"submit-btn-color"],"isMobile":[4,"is-mobile"],"shippingAddress":[16],"billingAddress":[16],"translatedShippingAddress":[16],"translatedBillingAddress":[16],"showErrorBanner":[32],"translatedShippingAddressState":[32],"translatedBillingAddressState":[32]},null,{"translatedShippingAddress":["watchTranslatedShippingAddress"],"translatedBillingAddress":["watchTranslatedBillingAddress"]}],[2,"zonos-address",{"type":[1],"titleText":[1,"title-text"],"defaultAddress":[16],"stripe":[32],"isDirtyAddress":[32]},null,{"stripe":["watchInitStripe"]}],[1,"zonos-checkbox",{"backgroundColor":[1,"background-color"],"label":[1],"isChecked":[4,"is-checked"],"isDisabled":[4,"is-disabled"],"size":[2],"fontSize":[1,"font-size"],"borderStyle":[1,"border-style"]},[[1,"click","onClick"]]],[2,"zonos-link-authentication",{"titleText":[1,"title-text"],"defaultEmail":[1,"default-email"],"stripe":[32]},null,{"stripe":["watchInitStripe"]}],[1,"zonos-dialog",{"open":[4],"headerText":[1,"header-text"],"width":[1],"height":[1],"minHeight":[1,"min-height"],"noHeader":[4,"no-header"],"noBodyPadding":[4,"no-body-padding"],"noBorder":[4,"no-border"],"borderStyle":[1,"border-style"],"noCloseButton":[4,"no-close-button"],"noClickOutside":[4,"no-click-outside"],"mobile":[4],"isLoading":[4,"is-loading"],"isMobile":[32]},[[9,"resize","handleWindowResize"],[4,"keydown","handleKeyDown"]]],[1,"zonos-address-display",{"currentAddress":[16],"addressType":[1,"address-type"]}],[1,"zonos-address-form",{"currentAddress":[16],"translatedAddress":[16],"addressType":[1,"address-type"],"localAddress":[32]},null,{"translatedAddress":["watchCurrentAddress"]}]]],["p-a26a8ca5.system",[[2,"zonos-customer-info",{"continueLoading":[4,"continue-loading"],"submitBtnType":[1,"submit-btn-type"],"submitBtnColor":[1,"submit-btn-color"],"isMobile":[4,"is-mobile"],"defaultAddress":[16],"showErrorBanner":[32],"shippingCountry":[32],"isCheckingForRestrictedItems":[32],"isValidatingAddress":[32],"invalidShippingCharacterList":[32],"invalidBillingCharacterList":[32],"openAddressValidationDialog":[32]}],[2,"zonos-checkout-payment",{"submitBtnType":[1,"submit-btn-type"],"continueLoading":[4,"continue-loading"],"submitBtnColor":[1,"submit-btn-color"],"showErrorBanner":[32]}],[1,"zonos-checkout-footer",{"mobile":[4],"dataTheme":[1,"data-theme"],"showLanguageDialog":[32],"isMobile":[32]},[[4,"click","handleGlobalClick"]],{"mobile":["handleMobileChange"]}],[2,"zonos-shipping",{"continueLoading":[4,"continue-loading"],"submitBtnColor":[1,"submit-btn-color"],"submitBtnType":[1,"submit-btn-type"],"selectedShippingMethod":[32],"collapsedDAPOptions":[32],"isSelecting":[32],"showErrorBanner":[32],"serviceLevelsDDP":[32],"serviceLevelsDAP":[32],"serviceLevelsOther":[32]}],[1,"zonos-cart-subtotal",{"submitBtnType":[1,"submit-btn-type"],"submitBtnColor":[1,"submit-btn-color"],"loading":[32]}],[1,"zonos-cart-restricted-items",{"hide":[4],"errorImages":[32],"internalCollapsed":[32],"firstRender":[32]}],[1,"zonos-checkout-finish",{"borderRadius":[1,"border-radius"],"storybookForceStatus":[1,"storybook-force-status"],"overrideNotification":[16],"isLoading":[32],"notificationType":[32],"notificationTitle":[32],"notificationMessages":[32],"notificationActionText":[32],"order":[32]}],[1,"zonos-confirm-dialog",{"dialogTitle":[1,"dialog-title"],"dialogIntent":[1,"dialog-intent"],"dialogSubtitle":[1,"dialog-subtitle"],"submitBtnColor":[1,"submit-btn-color"],"dialogConfirmBtnText":[1,"dialog-confirm-btn-text"],"dialogCancelBtnText":[1,"dialog-cancel-btn-text"],"dialogType":[1,"dialog-type"],"isMobile":[4,"is-mobile"],"dialogOpen":[4,"dialog-open"],"noClickOutside":[4,"no-click-outside"]},[[4,"keydown","handleKeyDown"]]],[1,"zonos-checkout-progress-tabs",{"tabColor":[1,"tab-color"],"backgroundColor":[1,"background-color"],"setTabItems":[64],"setTabSelected":[64]}],[1,"zonos-review",{"mobile":[4],"collapsed":[4],"isMobile":[32]},[[9,"resize","handleWindowResize"]]],[1,"zonos-cart-items",{"errorImages":[32]}],[1,"zonos-rest-state",{"restStateSubtitle":[1,"rest-state-subtitle"],"restStateTitle":[1,"rest-state-title"],"restStateType":[1,"rest-state-type"],"isErrorImageLoad":[32]}]]]]'),t)]}}))}))}))}}}));
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,t,o,i){function n(e){return e instanceof o?e:new o((function(t){t(e)}))}return new(o||(o=Promise))((function(o,s){function r(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i["throw"](e))}catch(e){s(e)}}function l(e){e.done?o(e.value):n(e.value).then(r,a)}l((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var o={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,r;return r={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function a(e){return function(t){return l([e,t])}}function l(a){if(i)throw new TypeError("Generator is already executing.");while(r&&(r=0,a[0]&&(o=0)),o)try{if(i=1,n&&(s=a[0]&2?n["return"]:a[0]?n["throw"]||((s=n["return"])&&s.call(n),0):n.next)&&!(s=s.call(n,a[1])).done)return s;if(n=0,s)a=[a[0]&2,s.value];switch(a[0]){case 0:case 1:s=a;break;case 4:o.label++;return{value:a[1],done:false};case 5:o.label++;n=a[1];a=[0];continue;case 7:a=o.ops.pop();o.trys.pop();continue;default:if(!(s=o.trys,s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){o=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){o.label=a[1];break}if(a[0]===6&&o.label<s[1]){o.label=s[1];s=a;break}if(s&&o.label<s[2]){o.label=s[2];o.ops.push(a);break}if(s[2])o.ops.pop();o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e];n=0}finally{i=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};System.register(["./p-fd061229.system.js","./p-56ba5cbf.system.js"],(function(e,t){"use strict";var o,i,n;return{setters:[function(t){o=t.p;i=t.b;e("setNonce",t.s)},function(e){n=e.g}],execute:function(){var e=this;var s=function(){var e=t.meta.url;var i={};if(e!==""){i.resourcesUrl=new URL(".",e).href}return o(i)};s().then((function(t){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,n()];case 1:e.sent();return[2,i(JSON.parse('[["p-49a3a2a5.system",[[2,"zonos-checkout",{"appearanceSettingsOverride":[16],"preview":[4],"mobile":[4],"defaultAddress":[16],"forceDialogOpen":[4,"force-dialog-open"],"open":[32],"stripe":[32],"submitLoading":[32],"collapseReviewMobile":[32],"isAttachError":[32],"isMobile":[32],"zonosReviewRef":[32],"storybookPaymentStatusOverride":[32],"isLegacyCheckout":[32],"confirmDialogOpen":[32],"inventoryCheckErrorMessage":[32],"closeDialogHandler":[64],"init":[64],"setToFinishStep":[64],"mockCheckoutSession":[64]},[[16,"zonos--init-cart-info","initCartInfoHandler"],[4,"keydown","handleKeyPress"],[9,"resize","handleWindowResize"]],{"appearanceSettingsOverride":["appearanceSettingsOverrideChanged","handleAppearanceSettingsOverrideChange"],"mobile":["handleMobileChange"],"defaultAddress":["handleAddressChange"]}]]],["p-3d521899.system",[[1,"zonos-hello",{"mobileLocationOverride":[1,"mobile-location-override"],"animateFromLeftOverride":[4,"animate-from-left-override"],"appearanceSettingsOverride":[16],"showPeekMessage":[32],"zonosStoreHelloSettings":[32],"showDialog":[32],"peekMessage":[32],"initialUrl":[32],"allRestrictedItems":[32],"allFoundProducts":[32],"productsOnPage":[32],"isHelloWidgetRendered":[32],"isMobile":[32],"getCountryList":[64],"displayCurrency":[64],"convertAndFormat":[64],"convert":[64],"format":[64],"openHelloDialog":[64]},[[9,"resize","handleResize"]],{"appearanceSettingsOverride":["handleAppearanceSettingsOverrideChange"]}]]],["p-c0a7750c.system",[[1,"zonos-controller",{"config":[16],"zonosApiKey":[1,"zonos-api-key"],"initCheckoutElement":[64],"setupGoogleFont":[64],"showNotification":[64],"reset":[64],"overrideConfig":[64],"overrideCountry":[64],"getAppearanceSetting":[64],"updateOrganizationName":[64]},[[8,"locationchange","handleLocationChange"]]]]],["p-38886017.system",[[1,"zonos-tooltip",{"label":[1],"subtitle":[1],"showTooltip":[32]}]]],["p-22e81fee.system",[[1,"zonos-component",{"first":[1],"middle":[1],"last":[1]}]]],["p-ae7526a2.system",[[1,"zonos-link",{"href":[1],"rel":[1],"target":[1],"linkTitle":[1,"link-title"]}]]],["p-f7bbdd0c.system",[[1,"zonos-logo",{"theme":[1],"width":[1]}]]],["p-c2b7b670.system",[[1,"zonos-card",{"actions":[16],"backgroundColor":[1,"background-color"],"borderRadius":[2,"border-radius"],"footerActions":[16],"footerContent":[16],"footerHeight":[2,"footer-height"],"label":[16],"spacing":[1]}]]],["p-d621f462.system",[[1,"zonos-input",{"inputValue":[1,"input-value"],"inputLabel":[1,"input-label"],"inputSize":[1,"input-size"],"isDisabled":[4,"is-disabled"],"isError":[4,"is-error"],"inputPlaceholder":[1,"input-placeholder"],"value":[32]},null,{"inputValue":["onInputValueChange"]}]]],["p-698f7fd8.system",[[1,"zonos-banner",{"bannerTitle":[1,"banner-title"],"intent":[1],"hasContent":[32]}]]],["p-f68c38d8.system",[[1,"zonos-v-stack",{"spacing":[2]}]]],["p-04553c97.system",[[1,"zonos-text",{"textColor":[1,"text-color"],"size":[1],"type":[1],"weight":[2],"ready":[32]}]]],["p-0b01b9b1.system",[[1,"zonos-language-select",{"handleOnClose":[16]}],[1,"zonos-select-dialog-header",{"handleOnClose":[16],"label":[1]}]]],["p-5bef550e.system",[[1,"zonos-hello-dialog",{"isOpen":[4,"is-open"],"setIsOpen":[16],"mobileLocationOverride":[1,"mobile-location-override"],"animateFromLeftOverride":[4,"animate-from-left-override"],"appearanceSettings":[16],"restrictedItems":[16],"welcomeMessage":[32],"showCountrySelect":[32],"showLanguageSelect":[32]},[[4,"click","globalClickHandler"]],{"isOpen":["isOpenHandler"]}]]],["p-1a92ff9a.system",[[1,"zonos-badge",{"bold":[4],"badgeColor":[1,"badge-color"],"icon":[16],"iconRight":[4,"icon-right"],"size":[1],"rounded":[4],"loading":[4],"dismissHandler":[16]}]]],["p-9931bea7.system",[[1,"zonos-shipping-rich-radio",{"items":[16],"borderColor":[1,"border-color"],"borderStyle":[1,"border-style"],"theme":[1],"selectedItem":[16]}]]],["p-4abca0e9.system",[[1,"zonos-collapse",{"collapsed":[4],"collapseSize":[2,"collapse-size"],"height":[32],"iframe":[32]}]]],["p-94589f18.system",[[2,"zonos-payment",{"titleText":[1,"title-text"],"stripe":[32],"stripeElements":[32]},null,{"stripeElements":["watchInitStripe"],"stripe":["watchInitStripe"]}],[2,"zonos-paypal-payment"],[1,"zonos-notification",{"notificationArray":[32],"showNotification":[64]}]]],["p-35577bd8.system",[[1,"zonos-country-flag",{"countryCode":[1,"country-code"],"size":[2]}]]],["p-5d186fc7.system",[[17,"zonos-button",{"buttonColor":[1,"button-color"],"backgroundColor":[1,"background-color"],"borderStyle":[1,"border-style"],"isDisabled":[4,"is-disabled"],"icon":[16],"iconRight":[4,"icon-right"],"size":[1],"variant":[1],"noBackground":[4,"no-background"],"withBoxShadow":[4,"with-box-shadow"],"noPaddingLeft":[4,"no-padding-left"],"noPaddingRight":[4,"no-padding-right"],"loading":[4],"justifyContent":[1,"justify-content"],"theme":[1],"hasIcon":[32],"hasContent":[32]},[[2,"click","clickHandler"]],{"icon":["iconChangeHandler"]}],[1,"zonos-spinner",{"size":[2],"spinnerColor":[1,"spinner-color"]}],[1,"zonos-icon",{"autoHeight":[4,"auto-height"],"iconColor":[1,"icon-color"],"content":[1],"size":[2]}]]],["p-69bb9b53.system",[[1,"zonos-country-select",{"handleOnClose":[16],"inputValue":[32]}],[1,"zonos-hello-dialog-footer",{"appearanceSettings":[16],"setShowCountrySelect":[16],"setShowLanguageSelect":[16]}],[1,"zonos-custom-message",{"icon":[1],"message":[1]}],[2,"zonos-virtual-scroll",{"renderItem":[16],"itemWidth":[2,"item-width"],"fallbackItemHeight":[2,"fallback-item-height"],"itemHeights":[16],"container":[32],"scrollTop":[32],"totalHeight":[32]},null,{"itemHeights":["updateTotalHeight"],"fallbackItemHeight":["updateTotalHeight"]}]]],["p-e05eed8e.system",[[1,"zonos-address-update-dialog",{"continueLoading":[4,"continue-loading"],"dialogLoading":[4,"dialog-loading"],"dialogOpen":[4,"dialog-open"],"submitBtnType":[1,"submit-btn-type"],"submitBtnColor":[1,"submit-btn-color"],"isMobile":[4,"is-mobile"],"shippingAddress":[16],"billingAddress":[16],"translatedShippingAddress":[16],"translatedBillingAddress":[16],"showErrorBanner":[32],"translatedShippingAddressState":[32],"translatedBillingAddressState":[32]},null,{"translatedShippingAddress":["watchTranslatedShippingAddress"],"translatedBillingAddress":["watchTranslatedBillingAddress"]}],[2,"zonos-address",{"type":[1],"titleText":[1,"title-text"],"defaultAddress":[16],"stripe":[32],"isDirtyAddress":[32]},null,{"stripe":["watchInitStripe"]}],[1,"zonos-checkbox",{"backgroundColor":[1,"background-color"],"label":[1],"isChecked":[4,"is-checked"],"isDisabled":[4,"is-disabled"],"size":[2],"fontSize":[1,"font-size"],"borderStyle":[1,"border-style"]},[[1,"click","onClick"]]],[2,"zonos-link-authentication",{"titleText":[1,"title-text"],"defaultEmail":[1,"default-email"],"stripe":[32]},null,{"stripe":["watchInitStripe"]}],[1,"zonos-dialog",{"open":[4],"headerText":[1,"header-text"],"width":[1],"height":[1],"minHeight":[1,"min-height"],"noHeader":[4,"no-header"],"noBodyPadding":[4,"no-body-padding"],"noBorder":[4,"no-border"],"borderStyle":[1,"border-style"],"noCloseButton":[4,"no-close-button"],"noClickOutside":[4,"no-click-outside"],"mobile":[4],"isLoading":[4,"is-loading"],"isMobile":[32]},[[9,"resize","handleWindowResize"],[4,"keydown","handleKeyDown"]]],[1,"zonos-address-display",{"currentAddress":[16],"addressType":[1,"address-type"]}],[1,"zonos-address-form",{"currentAddress":[16],"translatedAddress":[16],"addressType":[1,"address-type"],"localAddress":[32]},null,{"translatedAddress":["watchCurrentAddress"]}]]],["p-4412b94b.system",[[2,"zonos-customer-info",{"continueLoading":[4,"continue-loading"],"submitBtnType":[1,"submit-btn-type"],"submitBtnColor":[1,"submit-btn-color"],"isMobile":[4,"is-mobile"],"defaultAddress":[16],"showErrorBanner":[32],"shippingCountry":[32],"isCheckingForRestrictedItems":[32],"isValidatingAddress":[32],"invalidShippingCharacterList":[32],"invalidBillingCharacterList":[32],"openAddressValidationDialog":[32]}],[2,"zonos-checkout-payment",{"submitBtnType":[1,"submit-btn-type"],"continueLoading":[4,"continue-loading"],"submitBtnColor":[1,"submit-btn-color"],"showErrorBanner":[32]}],[1,"zonos-checkout-footer",{"mobile":[4],"dataTheme":[1,"data-theme"],"showLanguageDialog":[32],"isMobile":[32]},[[4,"click","handleGlobalClick"]],{"mobile":["handleMobileChange"]}],[2,"zonos-shipping",{"continueLoading":[4,"continue-loading"],"submitBtnColor":[1,"submit-btn-color"],"submitBtnType":[1,"submit-btn-type"],"selectedShippingMethod":[32],"collapsedDAPOptions":[32],"isSelecting":[32],"showErrorBanner":[32],"serviceLevelsDDP":[32],"serviceLevelsDAP":[32],"serviceLevelsOther":[32]}],[1,"zonos-cart-subtotal",{"submitBtnType":[1,"submit-btn-type"],"submitBtnColor":[1,"submit-btn-color"],"loading":[32]}],[1,"zonos-cart-restricted-items",{"hide":[4],"errorImages":[32],"internalCollapsed":[32],"firstRender":[32]}],[1,"zonos-checkout-finish",{"borderRadius":[1,"border-radius"],"storybookForceStatus":[1,"storybook-force-status"],"overrideNotification":[16],"isLoading":[32],"notificationType":[32],"notificationTitle":[32],"notificationMessages":[32],"notificationActionText":[32],"order":[32]}],[1,"zonos-confirm-dialog",{"dialogTitle":[1,"dialog-title"],"dialogIntent":[1,"dialog-intent"],"dialogSubtitle":[1,"dialog-subtitle"],"submitBtnColor":[1,"submit-btn-color"],"dialogConfirmBtnText":[1,"dialog-confirm-btn-text"],"dialogCancelBtnText":[1,"dialog-cancel-btn-text"],"dialogType":[1,"dialog-type"],"isMobile":[4,"is-mobile"],"dialogOpen":[4,"dialog-open"],"noClickOutside":[4,"no-click-outside"]},[[4,"keydown","handleKeyDown"]]],[1,"zonos-checkout-progress-tabs",{"tabColor":[1,"tab-color"],"backgroundColor":[1,"background-color"],"setTabItems":[64],"setTabSelected":[64]}],[1,"zonos-review",{"mobile":[4],"collapsed":[4],"isMobile":[32]},[[9,"resize","handleWindowResize"]]],[1,"zonos-cart-items",{"errorImages":[32]}],[1,"zonos-rest-state",{"restStateSubtitle":[1,"rest-state-subtitle"],"restStateTitle":[1,"rest-state-title"],"restStateType":[1,"rest-state-type"],"isErrorImageLoad":[32]}]]]]'),t)]}}))}))}))}}}));
|