@zonos/elements 1.3.61 → 1.3.63

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/dist/cjs/{cart-22476910.js → cart-dee65a87.js} +2 -3
  2. package/dist/cjs/{createCustomEvent-f1848925.js → createCustomEvent-b19ee73d.js} +1 -1
  3. package/dist/cjs/index.cjs.js +7 -7
  4. package/dist/cjs/{paypal-3c6fcdd7.js → paypal-d4a21b6a.js} +1 -1
  5. package/dist/cjs/zonos-address_8.cjs.entry.js +1 -1
  6. package/dist/cjs/zonos-badge_13.cjs.entry.js +3 -3
  7. package/dist/cjs/zonos-checkout.cjs.entry.js +3 -3
  8. package/dist/cjs/zonos-controller.cjs.entry.js +12 -3
  9. package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -1
  10. package/dist/cjs/zonos-country-select_4.cjs.entry.js +1 -1
  11. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +1 -1
  12. package/dist/cjs/zonos-hello.cjs.entry.js +1 -1
  13. package/dist/cjs/zonos-language-select_2.cjs.entry.js +1 -1
  14. package/dist/cjs/zonos-notification_3.cjs.entry.js +2 -2
  15. package/dist/collection/components/main/zonos-controller.js +11 -2
  16. package/dist/collection/components/store/checkout/cart.js +2 -3
  17. package/dist/esm/{cart-c2bd0e1d.js → cart-a875cea7.js} +2 -3
  18. package/dist/esm/{createCustomEvent-540e5c74.js → createCustomEvent-0ff4506c.js} +1 -1
  19. package/dist/esm/index.js +7 -7
  20. package/dist/esm/{paypal-96d0a3d0.js → paypal-1eab776e.js} +1 -1
  21. package/dist/esm/zonos-address_8.entry.js +1 -1
  22. package/dist/esm/zonos-badge_13.entry.js +3 -3
  23. package/dist/esm/zonos-checkout.entry.js +3 -3
  24. package/dist/esm/zonos-controller.entry.js +12 -3
  25. package/dist/esm/zonos-country-flag.entry.js +1 -1
  26. package/dist/esm/zonos-country-select_4.entry.js +1 -1
  27. package/dist/esm/zonos-hello-dialog.entry.js +1 -1
  28. package/dist/esm/zonos-hello.entry.js +1 -1
  29. package/dist/esm/zonos-language-select_2.entry.js +1 -1
  30. package/dist/esm/zonos-notification_3.entry.js +2 -2
  31. package/dist/esm-es5/{cart-c2bd0e1d.js → cart-a875cea7.js} +1 -1
  32. package/dist/esm-es5/{createCustomEvent-540e5c74.js → createCustomEvent-0ff4506c.js} +1 -1
  33. package/dist/esm-es5/index.js +1 -1
  34. package/dist/esm-es5/{paypal-96d0a3d0.js → paypal-1eab776e.js} +1 -1
  35. package/dist/esm-es5/zonos-address_8.entry.js +1 -1
  36. package/dist/esm-es5/zonos-badge_13.entry.js +1 -1
  37. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  38. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  39. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  40. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  41. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  42. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  43. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  44. package/dist/esm-es5/zonos-notification_3.entry.js +1 -1
  45. package/dist/scripts/index.js +1 -1
  46. package/dist/scripts/loadZonos.js +1 -1
  47. package/dist/scripts/zonos.js +1 -1
  48. package/dist/types/components/store/checkout/cart.d.ts +4 -1
  49. package/dist/zonos-elements/index.esm.js +1 -1
  50. package/dist/zonos-elements/{p-78f6354c.js → p-0864b21c.js} +2 -2
  51. package/dist/zonos-elements/{p-1cbc77c6.entry.js → p-15b5200b.entry.js} +1 -1
  52. package/dist/zonos-elements/{p-094d1cd6.system.js → p-27f40576.system.js} +1 -1
  53. package/dist/zonos-elements/{p-08d50098.system.entry.js → p-396fd3eb.system.entry.js} +1 -1
  54. package/dist/zonos-elements/{p-e4d88f11.system.entry.js → p-3fbb3f57.system.entry.js} +1 -1
  55. package/dist/zonos-elements/{p-ba76d50f.js → p-4a8753ca.js} +1 -1
  56. package/dist/zonos-elements/{p-7b0a7afd.system.entry.js → p-5ab7d154.system.entry.js} +1 -1
  57. package/dist/zonos-elements/{p-4bae8815.system.entry.js → p-5e5045a6.system.entry.js} +1 -1
  58. package/dist/zonos-elements/{p-fc040c52.system.entry.js → p-6c05299c.system.entry.js} +1 -1
  59. package/dist/zonos-elements/{p-1a940770.system.js → p-7c0b5743.system.js} +1 -1
  60. package/dist/zonos-elements/{p-bd50ac54.system.js → p-7c15fe35.system.js} +1 -1
  61. package/dist/zonos-elements/{p-227f082e.system.entry.js → p-8a259a5c.system.entry.js} +1 -1
  62. package/dist/zonos-elements/{p-869ee990.system.entry.js → p-8d59de18.system.entry.js} +1 -1
  63. package/dist/zonos-elements/{p-3007d9c6.entry.js → p-944ef745.entry.js} +1 -1
  64. package/dist/zonos-elements/{p-38b85799.entry.js → p-9c50823c.entry.js} +1 -1
  65. package/dist/zonos-elements/{p-c5fd32f4.entry.js → p-9fed08ac.entry.js} +1 -1
  66. package/dist/zonos-elements/{p-d4e92269.entry.js → p-a170d7cc.entry.js} +1 -1
  67. package/dist/zonos-elements/{p-9972bc02.entry.js → p-a75c2916.entry.js} +1 -1
  68. package/dist/zonos-elements/{p-ea0ee9e7.system.entry.js → p-b1386fff.system.entry.js} +1 -1
  69. package/dist/zonos-elements/{p-8a8fa05c.js → p-b7ff0fb5.js} +1 -1
  70. package/dist/zonos-elements/{p-081ff323.system.js → p-bf53c6aa.system.js} +1 -1
  71. package/dist/zonos-elements/p-c78dd680.system.js +1 -1
  72. package/dist/zonos-elements/p-d52ea1ea.system.entry.js +1 -0
  73. package/dist/zonos-elements/{p-e4c9e92c.entry.js → p-e04581f4.entry.js} +1 -1
  74. package/dist/zonos-elements/{p-55cc6046.entry.js → p-e58e5939.entry.js} +1 -1
  75. package/dist/zonos-elements/{p-8cbaae6e.system.entry.js → p-e89289ba.system.entry.js} +1 -1
  76. package/dist/zonos-elements/{p-bf2b90af.entry.js → p-ec4c219a.entry.js} +1 -1
  77. package/dist/zonos-elements/{p-654b1660.entry.js → p-fbeef2f8.entry.js} +1 -1
  78. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  79. package/package.json +1 -1
  80. package/dist/zonos-elements/p-44d15ef5.system.entry.js +0 -1
@@ -1 +1 @@
1
- (function(){"use strict";const e=(e,t,...o)=>{var n,r;if(!(!!(null===(n=window.Zonos)||void 0===n?void 0:n.debug)||!!window.location.search.match(/\?.*(&*)zonosDebug=1/)))return void("error"===t&&console.error(e,...o));let s=document.querySelector("iframe#zonos---debug-logging-iframe");s||(s=document.createElement("iframe"),s.id="zonos---debug-logging-iframe",s.style.display="none",s.style.opacity="0",s.style.position="absolute",s.style.top="-9999px",s.style.left="-9999px",s.style.width="1px",s.style.height="1px",s.style.border="none",s.style.overflow="hidden",s.style.visibility="hidden",document.body.appendChild(s));const i=(null===(r=s.contentWindow)||void 0===r?void 0:r.window.console)||window.console;switch(t){case"warn":i.warn(e,...o);break;case"info":i.info(e,...o);break;case"error":i.error(e,...o);break;default:i.groupCollapsed(e,...o),i.trace(),i.groupEnd()}},t=(t,...o)=>{e(t,"error",...o)},o=["jsdelivr","cdnjs","unpkg","vercel"],n="jsdelivr",r=e=>{const t=o.indexOf(e);return o[t+1]||null},s=()=>{const t=window&&window.location.href.includes("forceLoadCdn");if("undefined"==typeof window||t)return null;const o=(e=>{if(!e)return null;const t=new URL(e).searchParams.get("zonosQaUrl");return t?/[^a-zA-Z0-9-_]+/.test(t)?null:t:null})(window.location.href),n="https://v1.3.61.js.zonos.com";if(!o&&(n.includes("test.")||n.includes("test-")))return n;if(!o&&["dev.demo.elements.zonos.com"].includes(window.location.hostname))return"https://dev.elements.zonos.com";if(!o)return null;if("dev-elements"===o)return"https://dev.elements.zonos.com";const r=`https://${o}.preview.js.zonos.com`;return e(`[ZONOS-WARNING] using '${r}' for loading script`,"warn"),fetch(r).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${r}' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE`);const e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");const{pathname:t}=window.location,o=`${t}?${e.toString()}`;return window.history.replaceState(window.history.state,"",o),window.location.reload(),null})),r},i="https://js.stripe.com/v3",l=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,a="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let c=null;const d=e=>(null!==c||(c=new Promise(((o,n)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(a),window.Stripe)o(window.Stripe);else try{let r=(()=>{const e=document.querySelectorAll(`script[src^="${i}"]`);for(let t=0;t<e.length;t++){const o=e[t];if(o&&l.test(o.src))return o}return null})();r&&e?console.warn(a):r||(r=(e=>{const o=document.createElement("script");o.src=`${i}`;const n=document.head||document.body;return n?(n.appendChild(o),o):(t("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})()),null==r||r.addEventListener("load",(()=>{window.Stripe?o(window.Stripe):n(new Error("Stripe.js not available"))})),null==r||r.addEventListener("error",(()=>{n(new Error("Failed to load Stripe.js"))}))}catch(e){return void n(e)}else o(null)}))),c),u=Promise.resolve().then((()=>d(null)));let p=!1;u.catch((e=>{p||console.warn(e)}));function m(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(o[n[r]]=e[n[r]])}return o}"function"==typeof SuppressedError&&SuppressedError;const h=["cloudflare","vercel"],y=h[0],w={cloudflare:"https://route.elements.zonos.com",vercel:"https://v1.route.js.zonos.com"},g=w[y],f=(e=y)=>{const t=h.indexOf(e),o=h[t+1];return o||null},v=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(e){return null}return null},b=async({response:e,shouldLog:t=!0,shouldThrow:o=!1})=>{try{return await e.json()}catch(e){if(o)throw e;return t&&console.error(e),null}},S=async({basePathType:e,options:t,path:o})=>{let n;const r=w[e]||y,s=new URL(r+o);s.searchParams.set("zToken",(e=>{try{return btoa(e).replace(/=/g,"")}catch(t){return e.replace(/[^A-Za-z0-9]/g,"").split("").reverse().join("")}})(window.location.hostname));try{n=await fetch(s.toString(),t)}catch(e){if(e instanceof Error)return{baseUrl:r,errors:[{message:e.message,type:"unknown"}],json:null,response:null,zonosMode:null};return{baseUrl:r,errors:[{message:"Failed to fetch",type:"unknown"}],json:null,response:null,zonosMode:null}}const i=n.headers.get("Zonos-Mode"),l=window.Zonos.zonosQaUrl;if(!window.Zonos.modeAlerted&&i&&l&&(window.Zonos.modeAlerted=!0),n.ok){return{baseUrl:r,errors:[],json:await b({response:n}),response:n,zonosMode:i}}const a=n.status.toString();try{const e=await b({response:n,shouldThrow:!0});return{baseUrl:r,errors:[{message:JSON.stringify(e),type:a}],json:null,response:n,zonosMode:i}}catch(e){return{baseUrl:r,errors:[{message:`${a}: ${"Unknown error"}`,type:a}],json:null,response:null,zonosMode:i}}},z=async({basePathType:t,options:o,path:n})=>{var r,s;const i=n.startsWith("/api/bigcommerce")?"vercel":t,l=await S({basePathType:i,options:o,path:n}),{errors:a,response:c}=l,d=m(l,["errors","response"]),u=f(i),p=!!a.find((({type:e})=>"unknown"===e))||404===(null==c?void 0:c.status),h=u&&p;return p&&(async({endpoint:e,errors:t,metadata:o,shouldPostReleaseErrorReporting:n})=>{if(n){const e=Number(window.Zonos.releaseDate);if((new Date).getTime()-e>36e5)return}const r="userAgentData"in window.navigator?window.navigator.userAgentData:null,s={endpoint:e,errors:t,metadata:Object.assign({href:window.location.href,userAgent:r&&r.brands.length>0?r:window.navigator.userAgent},o)};try{fetch(`${g}/api/zonos-elements/log-error`,{body:JSON.stringify(s),headers:{"Zonos-Referer":window.location.hostname},method:"POST"})}catch(e){const t=f();if(!t)return;fetch(`${w[t]}/api/zonos-elements/log-error`,{body:JSON.stringify(s),method:"POST"})}})({endpoint:w[i]+n,errors:a.map((({message:e})=>`API: ${e}`)),metadata:{currentBasePath:i,nextFallbackApiType:u,requestHeaders:null==o?void 0:o.headers,requestPayload:v(null===(r=null==o?void 0:o.body)||void 0===r?void 0:r.toString())||(null===(s=null==o?void 0:o.body)||void 0===s?void 0:s.toString()),status:null==c?void 0:c.status,statusText:null==c?void 0:c.statusText},shouldPostReleaseErrorReporting:!0}),h?(e(`=== "${n}" failed to fetch, trying next fallback ${u}`),z({basePathType:u,options:o,path:n})):Object.assign({errors:a,response:c},d)},j=async e=>{const{errors:t,json:o}=await(async(e,t)=>{const o=m(t||{},[]),n=o.body?JSON.stringify(o.body):void 0,r=o.method||"GET",s=Object.assign({"Content-Type":"application/json","Zonos-Is-BigCommerce":window.Zonos.isBigCommerce.toString(),"Zonos-Referer":window.location.hostname,"Zonos-Version":window.Zonos.version,credentialtoken:window.Zonos.zonosApiKey||"Empty credential token from zonos-elements"},o.headers),i=Object.assign(Object.assign({},o),{body:"GET"===r?void 0:n,headers:s,method:r}),l=new URLSearchParams(window.location.search).get("useFallbackApi");return z({basePathType:l||y,options:i,path:e})})("/api/zonos-elements/get-temp-cart",{body:{tempCartUUID:e},headers:{"Content-Type":"application/json"},method:"POST"});return!o||t.length?null:o};var O;const C=(()=>{if("undefined"==typeof document)return null;const e=document.querySelector('script[src*="/zonos.js"]'),{currentLoadScriptUrl:t,isWhiteListed:o}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const t=new URL(e).origin,o=["dev.elements.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>t.includes(e))),n=["qa.js.zonos.com"].some((e=>t.includes(e)));return{currentLoadScriptUrl:t,isForceLoadVersionDomain:n,isWhiteListed:o}})({loadScriptSrc:null==e?void 0:e.src});return o?t:null})(),k="https://v1.3.61.js.zonos.com",E=C||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.61",A="https://rsms.me",Z="https://fonts.googleapis.com",U=/^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;class T{}O=T,T.doneInit=!1,T.debug="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/),T.zonosConversionTest="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/),T._paypalMockResponse=null,T.isBigCommerce=!1,T.releaseDate="1727820260282",T.isLegacyCheckout=!1,T.isNpm=!0,T.zonosQaUrl=null,T.version="v1.3.61",T.modeAlerted=!1,T.cartData=null,T.paypal=null,T.getCurrentTimestamp=()=>(new Date).getTime(),T.zonosController=null,T.init=async({appearance:o,checkoutSettings:n,currencyConverter:r,helloSettings:s,onCountryChange:i,overrideCurrencyFormat:l,storeId:a,zonosApiKey:c})=>{if(O.cartId=new URLSearchParams(window.location.search).get("tempCartUUID"),!O.doneInit){if(e(`====== ZONOS DEBUG MODE: on (${O.version}) ======`),O.zonosApiKey=c,O.storeId=a,O.isNpm){if(e("====== ZONOS LOADING FROM NPM ======"),!c&&!O.cartId)return void t("Zonos API key is required unless `tempCartUUID` is provided in url query params.");if(!O.cartData&&O.cartId){e("Initialize cart data");const o=await(async o=>{const n=await j(o);return e("[ZONOS - loadZonos] getting temp cart data","info",n),n?{cartData:n.cartData,storeFavicon:n.storeFaviconUrl,storeId:n.cartData.storeId,storeLogo:n.storeLogoUrl,zonosApiKey:n.cartData.credentialToken}:(t("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),null)})(O.cartId);if(!o)return void t("Failed to get cart data");O.cartData=o.cartData,O.zonosApiKey=o.zonosApiKey}}if(O.cartId&&O.cartData){e("Cart data is available, inject hidden button and trigger checkout");const t=document.createElement("button");t.style.display="none",t.id="zonos--checkout-hidden-button",document.body.appendChild(t)}e("init zonos"),O.injectZonosCdn(),O.injectZonosCss(),O.injectFonts(),O.injectController({config:{appearance:o,checkoutSettings:n,currencyConverter:r,helloSettings:s,onCountryChange:i,overrideCurrencyFormat:l}}),O.doneInit=!0}},T.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},T.openHelloDialog=e=>{const t=document.querySelector("zonos-hello");t&&t.openHelloDialog(null==e||e)},T.showNotification=e=>{var t;null===(t=O.zonosController)||void 0===t||t.showNotification(e)},T.updateOrganizationName=e=>{var t;null===(t=O.zonosController)||void 0===t||t.updateOrganizationName(e)},T.disablePlaceOrderButtons=({autoEnable:e=!0,config:t,disable:o,placeOrderButtonSelector:n})=>{var r;if(!(null===(r=t.checkoutSettings)||void 0===r?void 0:r.disablePlaceOrderButtonActivation)&&n){const t=document.querySelectorAll(n),r=e=>{e.target.getAttribute("disabled")&&(e.preventDefault(),e.stopPropagation())};t.forEach((e=>{e.getAttribute("data-zonos-checkout-attached")||(o?(e.setAttribute("disabled","true"),e.addEventListener("click",r)):(e.removeAttribute("disabled"),e.removeEventListener("click",r)))})),e&&o&&setTimeout((()=>{t.forEach((e=>{e.removeAttribute("disabled"),e.removeEventListener("click",r)}))}),5e3)}},T.injectController=({config:o})=>{var n;if(document.querySelector("zonos-controller"))return;if(null===(n=o.checkoutSettings)||void 0===n?void 0:n.placeOrderButtonSelector){const e=o.checkoutSettings.placeOrderButtonSelector;O.disablePlaceOrderButtons({config:o,disable:!0,placeOrderButtonSelector:e});new MutationObserver((()=>{O.disablePlaceOrderButtons({config:o,disable:!0,placeOrderButtonSelector:e})})).observe(document.body,{childList:!0,subtree:!0})}const r=document.createElement("zonos-controller");r.config=o,r.zonosApiKey=O.zonosApiKey||"",r.addEventListener("stripeInitEvent",(async o=>{const{detail:n}=o;e("loading Stripe");const s=await(async(...e)=>{p=!0;const t=Date.now();return u.then((o=>((e,t,o)=>{if(null===e)return null;const n=e.apply(void 0,t);return((e,t)=>{e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",startTime:t})})(n,o),n})(o,e,t)))})(n.publishableKey);s?(window.Zonos.stripe=s,r.initCheckoutElement(s)):t("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(r),O.zonosController=r,e("Zonos controller injected!")},T.injectScript=({cdnType:o,isModule:n,theRestUrl:s})=>{const i=`${O.getZonosUrl(o)}/${s}`;if(document.querySelector(`script[src="${i}"]`))return void e(`Zonos script "${i}" already exists in the document`,"warn");const l=document.head||document.body,a=document.createElement("script");n?a.type="module":a.noModule=!0,a.src=i,a.crossOrigin="anonymous",a.onerror=()=>{t(`Failed to load ${a.src}`);const e=r(o);e&&O.injectScript({cdnType:e,isModule:n,theRestUrl:s})},l.appendChild(a)},T.getZonosUrl=e=>{const t=()=>{switch(e){case"jsdelivr":return E;case"unpkg":return"https://unpkg.com/@zonos/elements@1.3.61";case"cdnjs":return"https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.61";case"vercel":return k}};if(O.isNpm){return s()||t()}return t()},T.injectZonosCdn=()=>{O.injectScript({cdnType:n,isModule:!0,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),O.injectScript({cdnType:n,isModule:!1,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),e("Zonos cdn script injected!")},T.injectStylesheet=({cdnType:e,theRestUrl:o})=>{const n=O.getZonosUrl(e),s=document.head||document.body,i=document.createElement("link");i.rel="preconnect",i.href=`${k}/`,s.appendChild(i);const l=document.createElement("link");l.rel="stylesheet",l.href=`${n}/${o}`,l.onerror=()=>{t(`Failed to load ${l.href}`);const n=r(e);n&&O.injectStylesheet({cdnType:n,theRestUrl:o})},s.appendChild(l)},T.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?e("Zonos style links already injected","warn"):(O.injectStylesheet({cdnType:n,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),e("Zonos style css injected!"))},T.injectFonts=()=>{if((()=>{const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${A}"]`);for(let t=0;t<e.length;t++){const o=e[t];if(o&&!U.test(o.href))return o}return null})())return void e("Inter font already injected","warn");const t=document.head||document.body,o=document.createElement("link");o.rel="preconnect",o.href=A,t.appendChild(o);const n=document.createElement("link");n.rel="stylesheet",n.href=`${A}/inter/inter.css`,t.appendChild(n),e("Zonos font injected!")},T.setupGoogleFont=e=>{var t;null===(t=O.zonosController)||void 0===t||t.setupGoogleFont(e)},T.injectSupportGoogleFont=t=>{var o;e(`[FONT] injecting ${t}`);const n=null===(o=t.match(/family=(.*?):/))||void 0===o?void 0:o[1],r=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${Z}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=Z,r.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${t}"]`))return void e(`[FONT] ${n} font already injected`,"warn");const s=document.createElement("link");s.rel="stylesheet",s.href=t,r.appendChild(s),e(`[FONT] ${n} font injected!`)},window.Zonos&&window.Zonos.doneInit||(window.Zonos=T)})();
1
+ (function(){"use strict";const e=(e,t,...o)=>{var n,r;if(!(!!(null===(n=window.Zonos)||void 0===n?void 0:n.debug)||!!window.location.search.match(/\?.*(&*)zonosDebug=1/)))return void("error"===t&&console.error(e,...o));let s=document.querySelector("iframe#zonos---debug-logging-iframe");s||(s=document.createElement("iframe"),s.id="zonos---debug-logging-iframe",s.style.display="none",s.style.opacity="0",s.style.position="absolute",s.style.top="-9999px",s.style.left="-9999px",s.style.width="1px",s.style.height="1px",s.style.border="none",s.style.overflow="hidden",s.style.visibility="hidden",document.body.appendChild(s));const i=(null===(r=s.contentWindow)||void 0===r?void 0:r.window.console)||window.console;switch(t){case"warn":i.warn(e,...o);break;case"info":i.info(e,...o);break;case"error":i.error(e,...o);break;default:i.groupCollapsed(e,...o),i.trace(),i.groupEnd()}},t=(t,...o)=>{e(t,"error",...o)},o=["jsdelivr","cdnjs","unpkg","vercel"],n="jsdelivr",r=e=>{const t=o.indexOf(e);return o[t+1]||null},s=()=>{const t=window&&window.location.href.includes("forceLoadCdn");if("undefined"==typeof window||t)return null;const o=(e=>{if(!e)return null;const t=new URL(e).searchParams.get("zonosQaUrl");return t?/[^a-zA-Z0-9-_]+/.test(t)?null:t:null})(window.location.href),n="https://v1.3.63.js.zonos.com";if(!o&&(n.includes("test.")||n.includes("test-")))return n;if(!o&&["dev.demo.elements.zonos.com"].includes(window.location.hostname))return"https://dev.elements.zonos.com";if(!o)return null;if("dev-elements"===o)return"https://dev.elements.zonos.com";const r=`https://${o}.preview.js.zonos.com`;return e(`[ZONOS-WARNING] using '${r}' for loading script`,"warn"),fetch(r).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${r}' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE`);const e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");const{pathname:t}=window.location,o=`${t}?${e.toString()}`;return window.history.replaceState(window.history.state,"",o),window.location.reload(),null})),r},i="https://js.stripe.com/v3",l=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,a="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let c=null;const d=e=>(null!==c||(c=new Promise(((o,n)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(a),window.Stripe)o(window.Stripe);else try{let r=(()=>{const e=document.querySelectorAll(`script[src^="${i}"]`);for(let t=0;t<e.length;t++){const o=e[t];if(o&&l.test(o.src))return o}return null})();r&&e?console.warn(a):r||(r=(e=>{const o=document.createElement("script");o.src=`${i}`;const n=document.head||document.body;return n?(n.appendChild(o),o):(t("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})()),null==r||r.addEventListener("load",(()=>{window.Stripe?o(window.Stripe):n(new Error("Stripe.js not available"))})),null==r||r.addEventListener("error",(()=>{n(new Error("Failed to load Stripe.js"))}))}catch(e){return void n(e)}else o(null)}))),c),u=Promise.resolve().then((()=>d(null)));let p=!1;u.catch((e=>{p||console.warn(e)}));function m(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(o[n[r]]=e[n[r]])}return o}"function"==typeof SuppressedError&&SuppressedError;const h=["cloudflare","vercel"],y=h[0],w={cloudflare:"https://route.elements.zonos.com",vercel:"https://v1.route.js.zonos.com"},g=w[y],f=(e=y)=>{const t=h.indexOf(e),o=h[t+1];return o||null},v=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(e){return null}return null},b=async({response:e,shouldLog:t=!0,shouldThrow:o=!1})=>{try{return await e.json()}catch(e){if(o)throw e;return t&&console.error(e),null}},S=async({basePathType:e,options:t,path:o})=>{let n;const r=w[e]||y,s=new URL(r+o);s.searchParams.set("zToken",(e=>{try{return btoa(e).replace(/=/g,"")}catch(t){return e.replace(/[^A-Za-z0-9]/g,"").split("").reverse().join("")}})(window.location.hostname));try{n=await fetch(s.toString(),t)}catch(e){if(e instanceof Error)return{baseUrl:r,errors:[{message:e.message,type:"unknown"}],json:null,response:null,zonosMode:null};return{baseUrl:r,errors:[{message:"Failed to fetch",type:"unknown"}],json:null,response:null,zonosMode:null}}const i=n.headers.get("Zonos-Mode"),l=window.Zonos.zonosQaUrl;if(!window.Zonos.modeAlerted&&i&&l&&(window.Zonos.modeAlerted=!0),n.ok){return{baseUrl:r,errors:[],json:await b({response:n}),response:n,zonosMode:i}}const a=n.status.toString();try{const e=await b({response:n,shouldThrow:!0});return{baseUrl:r,errors:[{message:JSON.stringify(e),type:a}],json:null,response:n,zonosMode:i}}catch(e){return{baseUrl:r,errors:[{message:`${a}: ${"Unknown error"}`,type:a}],json:null,response:null,zonosMode:i}}},z=async({basePathType:t,options:o,path:n})=>{var r,s;const i=n.startsWith("/api/bigcommerce")?"vercel":t,l=await S({basePathType:i,options:o,path:n}),{errors:a,response:c}=l,d=m(l,["errors","response"]),u=f(i),p=!!a.find((({type:e})=>"unknown"===e))||404===(null==c?void 0:c.status),h=u&&p;return p&&(async({endpoint:e,errors:t,metadata:o,shouldPostReleaseErrorReporting:n})=>{if(n){const e=Number(window.Zonos.releaseDate);if((new Date).getTime()-e>36e5)return}const r="userAgentData"in window.navigator?window.navigator.userAgentData:null,s={endpoint:e,errors:t,metadata:Object.assign({href:window.location.href,userAgent:r&&r.brands.length>0?r:window.navigator.userAgent},o)};try{fetch(`${g}/api/zonos-elements/log-error`,{body:JSON.stringify(s),headers:{"Zonos-Referer":window.location.hostname},method:"POST"})}catch(e){const t=f();if(!t)return;fetch(`${w[t]}/api/zonos-elements/log-error`,{body:JSON.stringify(s),method:"POST"})}})({endpoint:w[i]+n,errors:a.map((({message:e})=>`API: ${e}`)),metadata:{currentBasePath:i,nextFallbackApiType:u,requestHeaders:null==o?void 0:o.headers,requestPayload:v(null===(r=null==o?void 0:o.body)||void 0===r?void 0:r.toString())||(null===(s=null==o?void 0:o.body)||void 0===s?void 0:s.toString()),status:null==c?void 0:c.status,statusText:null==c?void 0:c.statusText},shouldPostReleaseErrorReporting:!0}),h?(e(`=== "${n}" failed to fetch, trying next fallback ${u}`),z({basePathType:u,options:o,path:n})):Object.assign({errors:a,response:c},d)},j=async e=>{const{errors:t,json:o}=await(async(e,t)=>{const o=m(t||{},[]),n=o.body?JSON.stringify(o.body):void 0,r=o.method||"GET",s=Object.assign({"Content-Type":"application/json","Zonos-Is-BigCommerce":window.Zonos.isBigCommerce.toString(),"Zonos-Referer":window.location.hostname,"Zonos-Version":window.Zonos.version,credentialtoken:window.Zonos.zonosApiKey||"Empty credential token from zonos-elements"},o.headers),i=Object.assign(Object.assign({},o),{body:"GET"===r?void 0:n,headers:s,method:r}),l=new URLSearchParams(window.location.search).get("useFallbackApi");return z({basePathType:l||y,options:i,path:e})})("/api/zonos-elements/get-temp-cart",{body:{tempCartUUID:e},headers:{"Content-Type":"application/json"},method:"POST"});return!o||t.length?null:o};var O;const C=(()=>{if("undefined"==typeof document)return null;const e=document.querySelector('script[src*="/zonos.js"]'),{currentLoadScriptUrl:t,isWhiteListed:o}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const t=new URL(e).origin,o=["dev.elements.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>t.includes(e))),n=["qa.js.zonos.com"].some((e=>t.includes(e)));return{currentLoadScriptUrl:t,isForceLoadVersionDomain:n,isWhiteListed:o}})({loadScriptSrc:null==e?void 0:e.src});return o?t:null})(),k="https://v1.3.63.js.zonos.com",E=C||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.63",A="https://rsms.me",Z="https://fonts.googleapis.com",U=/^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;class T{}O=T,T.doneInit=!1,T.debug="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/),T.zonosConversionTest="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/),T._paypalMockResponse=null,T.isBigCommerce=!1,T.releaseDate="1727890785158",T.isLegacyCheckout=!1,T.isNpm=!0,T.zonosQaUrl=null,T.version="v1.3.63",T.modeAlerted=!1,T.cartData=null,T.paypal=null,T.getCurrentTimestamp=()=>(new Date).getTime(),T.zonosController=null,T.init=async({appearance:o,checkoutSettings:n,currencyConverter:r,helloSettings:s,onCountryChange:i,overrideCurrencyFormat:l,storeId:a,zonosApiKey:c})=>{if(O.cartId=new URLSearchParams(window.location.search).get("tempCartUUID"),!O.doneInit){if(e(`====== ZONOS DEBUG MODE: on (${O.version}) ======`),O.zonosApiKey=c,O.storeId=a,O.isNpm){if(e("====== ZONOS LOADING FROM NPM ======"),!c&&!O.cartId)return void t("Zonos API key is required unless `tempCartUUID` is provided in url query params.");if(!O.cartData&&O.cartId){e("Initialize cart data");const o=await(async o=>{const n=await j(o);return e("[ZONOS - loadZonos] getting temp cart data","info",n),n?{cartData:n.cartData,storeFavicon:n.storeFaviconUrl,storeId:n.cartData.storeId,storeLogo:n.storeLogoUrl,zonosApiKey:n.cartData.credentialToken}:(t("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),null)})(O.cartId);if(!o)return void t("Failed to get cart data");O.cartData=o.cartData,O.zonosApiKey=o.zonosApiKey}}if(O.cartId&&O.cartData){e("Cart data is available, inject hidden button and trigger checkout");const t=document.createElement("button");t.style.display="none",t.id="zonos--checkout-hidden-button",document.body.appendChild(t)}e("init zonos"),O.injectZonosCdn(),O.injectZonosCss(),O.injectFonts(),O.injectController({config:{appearance:o,checkoutSettings:n,currencyConverter:r,helloSettings:s,onCountryChange:i,overrideCurrencyFormat:l}}),O.doneInit=!0}},T.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},T.openHelloDialog=e=>{const t=document.querySelector("zonos-hello");t&&t.openHelloDialog(null==e||e)},T.showNotification=e=>{var t;null===(t=O.zonosController)||void 0===t||t.showNotification(e)},T.updateOrganizationName=e=>{var t;null===(t=O.zonosController)||void 0===t||t.updateOrganizationName(e)},T.disablePlaceOrderButtons=({autoEnable:e=!0,config:t,disable:o,placeOrderButtonSelector:n})=>{var r;if(!(null===(r=t.checkoutSettings)||void 0===r?void 0:r.disablePlaceOrderButtonActivation)&&n){const t=document.querySelectorAll(n),r=e=>{e.target.getAttribute("disabled")&&(e.preventDefault(),e.stopPropagation())};t.forEach((e=>{e.getAttribute("data-zonos-checkout-attached")||(o?(e.setAttribute("disabled","true"),e.addEventListener("click",r)):(e.removeAttribute("disabled"),e.removeEventListener("click",r)))})),e&&o&&setTimeout((()=>{t.forEach((e=>{e.removeAttribute("disabled"),e.removeEventListener("click",r)}))}),5e3)}},T.injectController=({config:o})=>{var n;if(document.querySelector("zonos-controller"))return;if(null===(n=o.checkoutSettings)||void 0===n?void 0:n.placeOrderButtonSelector){const e=o.checkoutSettings.placeOrderButtonSelector;O.disablePlaceOrderButtons({config:o,disable:!0,placeOrderButtonSelector:e});new MutationObserver((()=>{O.disablePlaceOrderButtons({config:o,disable:!0,placeOrderButtonSelector:e})})).observe(document.body,{childList:!0,subtree:!0})}const r=document.createElement("zonos-controller");r.config=o,r.zonosApiKey=O.zonosApiKey||"",r.addEventListener("stripeInitEvent",(async o=>{const{detail:n}=o;e("loading Stripe");const s=await(async(...e)=>{p=!0;const t=Date.now();return u.then((o=>((e,t,o)=>{if(null===e)return null;const n=e.apply(void 0,t);return((e,t)=>{e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",startTime:t})})(n,o),n})(o,e,t)))})(n.publishableKey);s?(window.Zonos.stripe=s,r.initCheckoutElement(s)):t("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(r),O.zonosController=r,e("Zonos controller injected!")},T.injectScript=({cdnType:o,isModule:n,theRestUrl:s})=>{const i=`${O.getZonosUrl(o)}/${s}`;if(document.querySelector(`script[src="${i}"]`))return void e(`Zonos script "${i}" already exists in the document`,"warn");const l=document.head||document.body,a=document.createElement("script");n?a.type="module":a.noModule=!0,a.src=i,a.crossOrigin="anonymous",a.onerror=()=>{t(`Failed to load ${a.src}`);const e=r(o);e&&O.injectScript({cdnType:e,isModule:n,theRestUrl:s})},l.appendChild(a)},T.getZonosUrl=e=>{const t=()=>{switch(e){case"jsdelivr":return E;case"unpkg":return"https://unpkg.com/@zonos/elements@1.3.63";case"cdnjs":return"https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.63";case"vercel":return k}};if(O.isNpm){return s()||t()}return t()},T.injectZonosCdn=()=>{O.injectScript({cdnType:n,isModule:!0,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),O.injectScript({cdnType:n,isModule:!1,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),e("Zonos cdn script injected!")},T.injectStylesheet=({cdnType:e,theRestUrl:o})=>{const n=O.getZonosUrl(e),s=document.head||document.body,i=document.createElement("link");i.rel="preconnect",i.href=`${k}/`,s.appendChild(i);const l=document.createElement("link");l.rel="stylesheet",l.href=`${n}/${o}`,l.onerror=()=>{t(`Failed to load ${l.href}`);const n=r(e);n&&O.injectStylesheet({cdnType:n,theRestUrl:o})},s.appendChild(l)},T.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?e("Zonos style links already injected","warn"):(O.injectStylesheet({cdnType:n,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),e("Zonos style css injected!"))},T.injectFonts=()=>{if((()=>{const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${A}"]`);for(let t=0;t<e.length;t++){const o=e[t];if(o&&!U.test(o.href))return o}return null})())return void e("Inter font already injected","warn");const t=document.head||document.body,o=document.createElement("link");o.rel="preconnect",o.href=A,t.appendChild(o);const n=document.createElement("link");n.rel="stylesheet",n.href=`${A}/inter/inter.css`,t.appendChild(n),e("Zonos font injected!")},T.setupGoogleFont=e=>{var t;null===(t=O.zonosController)||void 0===t||t.setupGoogleFont(e)},T.injectSupportGoogleFont=t=>{var o;e(`[FONT] injecting ${t}`);const n=null===(o=t.match(/family=(.*?):/))||void 0===o?void 0:o[1],r=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${Z}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=Z,r.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${t}"]`))return void e(`[FONT] ${n} font already injected`,"warn");const s=document.createElement("link");s.rel="stylesheet",s.href=t,r.appendChild(s),e(`[FONT] ${n} font injected!`)},window.Zonos&&window.Zonos.doneInit||(window.Zonos=T)})();
@@ -57,7 +57,10 @@ type CartStore = {
57
57
  * Adjustments from cart
58
58
  */
59
59
  adjustments: CartAdjustment[];
60
- checkoutSession: CheckoutSessionDetailsFragment | null;
60
+ /**
61
+ * Remove ID type from this so it is forced to be used from the `checkoutSessionId` which could also be loaded from session storage.
62
+ */
63
+ checkoutSession: Omit<CheckoutSessionDetailsFragment, 'id'> | null;
61
64
  checkoutSessionId: string | null;
62
65
  /**
63
66
  * Checkout session timeout
@@ -1 +1 @@
1
- import{l as e,a as n}from"./p-fb59c3c3.js";import{s as t,c as o}from"./p-f9c2288f.js";export{c as checkoutHiddenBtnSelector,d as domesticRedirectedBtnSelector}from"./p-f9c2288f.js";const s=["jsdelivr","cdnjs","unpkg","vercel"],r="jsdelivr",i=e=>{const n=s.indexOf(e);return s[n+1]||null},l="https://js.stripe.com/v3",u=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,a="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let m=null;const p=Promise.resolve().then((()=>{return e=null,null!==m||(m=new Promise(((t,o)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(a),window.Stripe)t(window.Stripe);else try{let s=(()=>{const e=document.querySelectorAll(`script[src^="${l}"]`);for(let n=0;n<e.length;n++){const t=e[n];if(t&&u.test(t.src))return t}return null})();s&&e?console.warn(a):s||(s=(e=>{const t=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",o=document.createElement("script");o.src=`${l}${t}`;const s=document.head||document.body;return s?(s.appendChild(o),o):(n("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})(e)),null==s||s.addEventListener("load",(()=>{window.Stripe?t(window.Stripe):o(new Error("Stripe.js not available"))})),null==s||s.addEventListener("error",(()=>{o(new Error("Failed to load Stripe.js"))}))}catch(e){return void o(e)}else t(null)}))),m;var e}));let f=!1;var w;p.catch((e=>{f||console.warn(e)}));const h=(()=>{if("undefined"==typeof document)return null;const e=document.querySelector('script[src*="/zonos.js"]'),{currentLoadScriptUrl:n,isWhiteListed:t}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const n=new URL(e).origin,t=["dev.elements.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>n.includes(e))),o=["qa.js.zonos.com"].some((e=>n.includes(e)));return{currentLoadScriptUrl:n,isForceLoadVersionDomain:o,isWhiteListed:t}})({loadScriptSrc:null==e?void 0:e.src});return t?n:null})(),v="https://v1.3.61.js.zonos.com",y=h||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.61",z="https://rsms.me",j="https://fonts.googleapis.com",S=/^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;class g{}w=g,g.doneInit=!1,g.debug="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/),g.zonosConversionTest="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/),g._paypalMockResponse=null,g.isBigCommerce=!1,g.releaseDate="1727820219191",g.isLegacyCheckout=!1,g.isNpm=!0,g.zonosQaUrl=null,g.version="v1.3.61",g.modeAlerted=!1,g.cartData=null,g.paypal=null,g.getCurrentTimestamp=()=>(new Date).getTime(),g.zonosController=null,g.init=async({appearance:s,checkoutSettings:r,currencyConverter:i,helloSettings:c,onCountryChange:l,overrideCurrencyFormat:d,storeId:u,zonosApiKey:a})=>{if(w.cartId=new URLSearchParams(window.location.search).get("tempCartUUID"),!w.doneInit){if(e(`====== ZONOS DEBUG MODE: on (${w.version}) ======`),w.zonosApiKey=a,w.storeId=u,w.isNpm){if(e("====== ZONOS LOADING FROM NPM ======"),!a&&!w.cartId)return void n("Zonos API key is required unless `tempCartUUID` is provided in url query params.");if(!w.cartData&&w.cartId){e("Initialize cart data");const o=await t(w.cartId);if(!o)return void n("Failed to get cart data");w.cartData=o.cartData,w.zonosApiKey=o.zonosApiKey}}if(w.cartId&&w.cartData){e("Cart data is available, inject hidden button and trigger checkout");const n=document.createElement("button");n.style.display="none",n.id=`${o}`,document.body.appendChild(n)}e("init zonos"),w.injectZonosCdn(),w.injectZonosCss(),w.injectFonts(),w.injectController({config:{appearance:s,checkoutSettings:r,currencyConverter:i,helloSettings:c,onCountryChange:l,overrideCurrencyFormat:d}}),w.doneInit=!0}},g.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},g.openHelloDialog=e=>{const n=document.querySelector("zonos-hello");n&&n.openHelloDialog(null==e||e)},g.showNotification=e=>{var n;null===(n=w.zonosController)||void 0===n||n.showNotification(e)},g.updateOrganizationName=e=>{var n;null===(n=w.zonosController)||void 0===n||n.updateOrganizationName(e)},g.disablePlaceOrderButtons=({autoEnable:e=!0,config:n,disable:t,placeOrderButtonSelector:o})=>{var s;if(!(null===(s=n.checkoutSettings)||void 0===s?void 0:s.disablePlaceOrderButtonActivation)&&o){const n=document.querySelectorAll(o),s=e=>{e.target.getAttribute("disabled")&&(e.preventDefault(),e.stopPropagation())};n.forEach((e=>{e.getAttribute("data-zonos-checkout-attached")||(t?(e.setAttribute("disabled","true"),e.addEventListener("click",s)):(e.removeAttribute("disabled"),e.removeEventListener("click",s)))})),e&&t&&setTimeout((()=>{n.forEach((e=>{e.removeAttribute("disabled"),e.removeEventListener("click",s)}))}),5e3)}},g.injectController=({config:t})=>{var o;if(document.querySelector("zonos-controller"))return;if(null===(o=t.checkoutSettings)||void 0===o?void 0:o.placeOrderButtonSelector){const e=t.checkoutSettings.placeOrderButtonSelector;w.disablePlaceOrderButtons({config:t,disable:!0,placeOrderButtonSelector:e}),new MutationObserver((()=>{w.disablePlaceOrderButtons({config:t,disable:!0,placeOrderButtonSelector:e})})).observe(document.body,{childList:!0,subtree:!0})}const s=document.createElement("zonos-controller");s.config=t,s.zonosApiKey=w.zonosApiKey||"",s.addEventListener("stripeInitEvent",(async t=>{const{detail:o}=t;e("loading Stripe");const r=await(async(...e)=>{f=!0;const n=Date.now();return p.then((t=>((e,n,t)=>{if(null===e)return null;const o=e.apply(void 0,n);return((e,n)=>{e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",startTime:n})})(o,t),o})(t,e,n)))})(o.publishableKey);r?(window.Zonos.stripe=r,s.initCheckoutElement(r)):n("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(s),w.zonosController=s,e("Zonos controller injected!")},g.injectScript=({cdnType:t,isModule:o,theRestUrl:s})=>{const r=`${w.getZonosUrl(t)}/${s}`;if(document.querySelector(`script[src="${r}"]`))return void e(`Zonos script "${r}" already exists in the document`,"warn");const c=document.head||document.body,l=document.createElement("script");o?l.type="module":l.noModule=!0,l.src=r,l.crossOrigin="anonymous",l.onerror=()=>{n(`Failed to load ${l.src}`);const e=i(t);e&&w.injectScript({cdnType:e,isModule:o,theRestUrl:s})},c.appendChild(l)},g.getZonosUrl=n=>{const t=()=>{switch(n){case"jsdelivr":return y;case"unpkg":return"https://unpkg.com/@zonos/elements@1.3.61";case"cdnjs":return"https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.61";case"vercel":return v}};return w.isNpm&&(()=>{const n=window&&window.location.href.includes("forceLoadCdn");if("undefined"==typeof window||n)return null;const t=(e=>{if(!e)return null;const n=new URL(e).searchParams.get("zonosQaUrl");return n?/[^a-zA-Z0-9-_]+/.test(n)?null:n:null})(window.location.href),o="https://v1.3.61.js.zonos.com";if(!t&&(o.includes("test.")||o.includes("test-")))return o;if(!t&&["dev.demo.elements.zonos.com"].includes(window.location.hostname))return"https://dev.elements.zonos.com";if(!t)return null;if("dev-elements"===t)return"https://dev.elements.zonos.com";const s=`https://${t}.preview.js.zonos.com`;return e(`[ZONOS-WARNING] using '${s}' for loading script`,"warn"),fetch(s).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${s}' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE`);const e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");const{pathname:n}=window.location,t=`${n}?${e.toString()}`;return window.history.replaceState(window.history.state,"",t),window.location.reload(),null})),s})()||t()},g.injectZonosCdn=()=>{w.injectScript({cdnType:r,isModule:!0,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),w.injectScript({cdnType:r,isModule:!1,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),e("Zonos cdn script injected!")},g.injectStylesheet=({cdnType:e,theRestUrl:t})=>{const o=w.getZonosUrl(e),s=document.head||document.body,r=document.createElement("link");r.rel="preconnect",r.href=`${v}/`,s.appendChild(r);const c=document.createElement("link");c.rel="stylesheet",c.href=`${o}/${t}`,c.onerror=()=>{n(`Failed to load ${c.href}`);const o=i(e);o&&w.injectStylesheet({cdnType:o,theRestUrl:t})},s.appendChild(c)},g.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?e("Zonos style links already injected","warn"):(w.injectStylesheet({cdnType:r,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),e("Zonos style css injected!"))},g.injectFonts=()=>{if((()=>{const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${z}"]`);for(let n=0;n<e.length;n++){const t=e[n];if(t&&!S.test(t.href))return t}return null})())return void e("Inter font already injected","warn");const n=document.head||document.body,t=document.createElement("link");t.rel="preconnect",t.href=z,n.appendChild(t);const o=document.createElement("link");o.rel="stylesheet",o.href=`${z}/inter/inter.css`,n.appendChild(o),e("Zonos font injected!")},g.setupGoogleFont=e=>{var n;null===(n=w.zonosController)||void 0===n||n.setupGoogleFont(e)},g.injectSupportGoogleFont=n=>{var t;e(`[FONT] injecting ${n}`);const o=null===(t=n.match(/family=(.*?):/))||void 0===t?void 0:t[1],s=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${j}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=j,s.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${n}"]`))return void e(`[FONT] ${o} font already injected`,"warn");const r=document.createElement("link");r.rel="stylesheet",r.href=n,s.appendChild(r),e(`[FONT] ${o} font injected!`)};export{g as Zonos}
1
+ import{l as e,a as n}from"./p-fb59c3c3.js";import{s as t,c as o}from"./p-f9c2288f.js";export{c as checkoutHiddenBtnSelector,d as domesticRedirectedBtnSelector}from"./p-f9c2288f.js";const s=["jsdelivr","cdnjs","unpkg","vercel"],r="jsdelivr",i=e=>{const n=s.indexOf(e);return s[n+1]||null},l="https://js.stripe.com/v3",u=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,a="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let m=null;const p=Promise.resolve().then((()=>{return e=null,null!==m||(m=new Promise(((t,o)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(a),window.Stripe)t(window.Stripe);else try{let s=(()=>{const e=document.querySelectorAll(`script[src^="${l}"]`);for(let n=0;n<e.length;n++){const t=e[n];if(t&&u.test(t.src))return t}return null})();s&&e?console.warn(a):s||(s=(e=>{const t=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",o=document.createElement("script");o.src=`${l}${t}`;const s=document.head||document.body;return s?(s.appendChild(o),o):(n("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})(e)),null==s||s.addEventListener("load",(()=>{window.Stripe?t(window.Stripe):o(new Error("Stripe.js not available"))})),null==s||s.addEventListener("error",(()=>{o(new Error("Failed to load Stripe.js"))}))}catch(e){return void o(e)}else t(null)}))),m;var e}));let f=!1;var w;p.catch((e=>{f||console.warn(e)}));const h=(()=>{if("undefined"==typeof document)return null;const e=document.querySelector('script[src*="/zonos.js"]'),{currentLoadScriptUrl:n,isWhiteListed:t}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const n=new URL(e).origin,t=["dev.elements.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>n.includes(e))),o=["qa.js.zonos.com"].some((e=>n.includes(e)));return{currentLoadScriptUrl:n,isForceLoadVersionDomain:o,isWhiteListed:t}})({loadScriptSrc:null==e?void 0:e.src});return t?n:null})(),v="https://v1.3.63.js.zonos.com",y=h||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.63",z="https://rsms.me",j="https://fonts.googleapis.com",S=/^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;class g{}w=g,g.doneInit=!1,g.debug="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/),g.zonosConversionTest="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/),g._paypalMockResponse=null,g.isBigCommerce=!1,g.releaseDate="1727890739919",g.isLegacyCheckout=!1,g.isNpm=!0,g.zonosQaUrl=null,g.version="v1.3.63",g.modeAlerted=!1,g.cartData=null,g.paypal=null,g.getCurrentTimestamp=()=>(new Date).getTime(),g.zonosController=null,g.init=async({appearance:s,checkoutSettings:r,currencyConverter:i,helloSettings:c,onCountryChange:l,overrideCurrencyFormat:d,storeId:u,zonosApiKey:a})=>{if(w.cartId=new URLSearchParams(window.location.search).get("tempCartUUID"),!w.doneInit){if(e(`====== ZONOS DEBUG MODE: on (${w.version}) ======`),w.zonosApiKey=a,w.storeId=u,w.isNpm){if(e("====== ZONOS LOADING FROM NPM ======"),!a&&!w.cartId)return void n("Zonos API key is required unless `tempCartUUID` is provided in url query params.");if(!w.cartData&&w.cartId){e("Initialize cart data");const o=await t(w.cartId);if(!o)return void n("Failed to get cart data");w.cartData=o.cartData,w.zonosApiKey=o.zonosApiKey}}if(w.cartId&&w.cartData){e("Cart data is available, inject hidden button and trigger checkout");const n=document.createElement("button");n.style.display="none",n.id=`${o}`,document.body.appendChild(n)}e("init zonos"),w.injectZonosCdn(),w.injectZonosCss(),w.injectFonts(),w.injectController({config:{appearance:s,checkoutSettings:r,currencyConverter:i,helloSettings:c,onCountryChange:l,overrideCurrencyFormat:d}}),w.doneInit=!0}},g.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},g.openHelloDialog=e=>{const n=document.querySelector("zonos-hello");n&&n.openHelloDialog(null==e||e)},g.showNotification=e=>{var n;null===(n=w.zonosController)||void 0===n||n.showNotification(e)},g.updateOrganizationName=e=>{var n;null===(n=w.zonosController)||void 0===n||n.updateOrganizationName(e)},g.disablePlaceOrderButtons=({autoEnable:e=!0,config:n,disable:t,placeOrderButtonSelector:o})=>{var s;if(!(null===(s=n.checkoutSettings)||void 0===s?void 0:s.disablePlaceOrderButtonActivation)&&o){const n=document.querySelectorAll(o),s=e=>{e.target.getAttribute("disabled")&&(e.preventDefault(),e.stopPropagation())};n.forEach((e=>{e.getAttribute("data-zonos-checkout-attached")||(t?(e.setAttribute("disabled","true"),e.addEventListener("click",s)):(e.removeAttribute("disabled"),e.removeEventListener("click",s)))})),e&&t&&setTimeout((()=>{n.forEach((e=>{e.removeAttribute("disabled"),e.removeEventListener("click",s)}))}),5e3)}},g.injectController=({config:t})=>{var o;if(document.querySelector("zonos-controller"))return;if(null===(o=t.checkoutSettings)||void 0===o?void 0:o.placeOrderButtonSelector){const e=t.checkoutSettings.placeOrderButtonSelector;w.disablePlaceOrderButtons({config:t,disable:!0,placeOrderButtonSelector:e}),new MutationObserver((()=>{w.disablePlaceOrderButtons({config:t,disable:!0,placeOrderButtonSelector:e})})).observe(document.body,{childList:!0,subtree:!0})}const s=document.createElement("zonos-controller");s.config=t,s.zonosApiKey=w.zonosApiKey||"",s.addEventListener("stripeInitEvent",(async t=>{const{detail:o}=t;e("loading Stripe");const r=await(async(...e)=>{f=!0;const n=Date.now();return p.then((t=>((e,n,t)=>{if(null===e)return null;const o=e.apply(void 0,n);return((e,n)=>{e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",startTime:n})})(o,t),o})(t,e,n)))})(o.publishableKey);r?(window.Zonos.stripe=r,s.initCheckoutElement(r)):n("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(s),w.zonosController=s,e("Zonos controller injected!")},g.injectScript=({cdnType:t,isModule:o,theRestUrl:s})=>{const r=`${w.getZonosUrl(t)}/${s}`;if(document.querySelector(`script[src="${r}"]`))return void e(`Zonos script "${r}" already exists in the document`,"warn");const c=document.head||document.body,l=document.createElement("script");o?l.type="module":l.noModule=!0,l.src=r,l.crossOrigin="anonymous",l.onerror=()=>{n(`Failed to load ${l.src}`);const e=i(t);e&&w.injectScript({cdnType:e,isModule:o,theRestUrl:s})},c.appendChild(l)},g.getZonosUrl=n=>{const t=()=>{switch(n){case"jsdelivr":return y;case"unpkg":return"https://unpkg.com/@zonos/elements@1.3.63";case"cdnjs":return"https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.63";case"vercel":return v}};return w.isNpm&&(()=>{const n=window&&window.location.href.includes("forceLoadCdn");if("undefined"==typeof window||n)return null;const t=(e=>{if(!e)return null;const n=new URL(e).searchParams.get("zonosQaUrl");return n?/[^a-zA-Z0-9-_]+/.test(n)?null:n:null})(window.location.href),o="https://v1.3.63.js.zonos.com";if(!t&&(o.includes("test.")||o.includes("test-")))return o;if(!t&&["dev.demo.elements.zonos.com"].includes(window.location.hostname))return"https://dev.elements.zonos.com";if(!t)return null;if("dev-elements"===t)return"https://dev.elements.zonos.com";const s=`https://${t}.preview.js.zonos.com`;return e(`[ZONOS-WARNING] using '${s}' for loading script`,"warn"),fetch(s).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${s}' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE`);const e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");const{pathname:n}=window.location,t=`${n}?${e.toString()}`;return window.history.replaceState(window.history.state,"",t),window.location.reload(),null})),s})()||t()},g.injectZonosCdn=()=>{w.injectScript({cdnType:r,isModule:!0,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),w.injectScript({cdnType:r,isModule:!1,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),e("Zonos cdn script injected!")},g.injectStylesheet=({cdnType:e,theRestUrl:t})=>{const o=w.getZonosUrl(e),s=document.head||document.body,r=document.createElement("link");r.rel="preconnect",r.href=`${v}/`,s.appendChild(r);const c=document.createElement("link");c.rel="stylesheet",c.href=`${o}/${t}`,c.onerror=()=>{n(`Failed to load ${c.href}`);const o=i(e);o&&w.injectStylesheet({cdnType:o,theRestUrl:t})},s.appendChild(c)},g.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?e("Zonos style links already injected","warn"):(w.injectStylesheet({cdnType:r,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),e("Zonos style css injected!"))},g.injectFonts=()=>{if((()=>{const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${z}"]`);for(let n=0;n<e.length;n++){const t=e[n];if(t&&!S.test(t.href))return t}return null})())return void e("Inter font already injected","warn");const n=document.head||document.body,t=document.createElement("link");t.rel="preconnect",t.href=z,n.appendChild(t);const o=document.createElement("link");o.rel="stylesheet",o.href=`${z}/inter/inter.css`,n.appendChild(o),e("Zonos font injected!")},g.setupGoogleFont=e=>{var n;null===(n=w.zonosController)||void 0===n||n.setupGoogleFont(e)},g.injectSupportGoogleFont=n=>{var t;e(`[FONT] injecting ${n}`);const o=null===(t=n.match(/family=(.*?):/))||void 0===t?void 0:t[1],s=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${j}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=j,s.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${n}"]`))return void e(`[FONT] ${o} font already injected`,"warn");const r=document.createElement("link");r.rel="stylesheet",r.href=n,s.appendChild(r),e(`[FONT] ${o} font injected!`)};export{g as Zonos}
@@ -1,4 +1,4 @@
1
- import{z as o,c as e}from"./p-1086aac3.js";import{d as r,r as n,t,q as a,h as i}from"./p-8a8fa05c.js";import{h as s,l as c,a as l,j as u}from"./p-fb59c3c3.js";import{t as d}from"./p-a1b755bf.js";
1
+ import{z as o,c as e}from"./p-1086aac3.js";import{d as r,r as n,t,q as a,h as i}from"./p-b7ff0fb5.js";import{h as s,l as c,a as l,j as u}from"./p-fb59c3c3.js";import{t as d}from"./p-a1b755bf.js";
2
2
  /*!
3
3
  * paypal-js v8.1.0 (2024-06-07T16:55:00.122Z)
4
4
  * Copyright 2020-present, PayPal, Inc. All rights reserved.
@@ -14,4 +14,4 @@ import{z as o,c as e}from"./p-1086aac3.js";import{d as r,r as n,t,q as a,h as i}
14
14
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
15
  * See the License for the specific language governing permissions and
16
16
  * limitations under the License.
17
- */function p(o,e){void 0===e&&(e={});var r=document.createElement("script");return r.src=o,Object.keys(e).forEach((function(o){r.setAttribute(o,e[o]),"data-csp-nonce"===o&&r.setAttribute("nonce",e["data-csp-nonce"])})),r}function y(o){return window[o]}function v(o,e){if("object"!=typeof o||null===o)throw new Error("Expected an options object.");var r=o.environment;if(r&&"production"!==r&&"sandbox"!==r)throw new Error('The `environment` option must be either "production" or "sandbox".');if(void 0!==e&&"function"!=typeof e)throw new Error("Expected PromisePonyfill to be a function.")}const f=({backgroundColor1:o,backgroundColor2:e})=>d.readability(o,e)>2.5,w=e=>{const r=o.checkoutSettings.analyticsProviders.find((o=>"GOOGLE_ANALYTICS"===o.type));r&&"DISABLED"!==(null==r?void 0:r.status)&&"function"==typeof window.gtag&&(c("Zonos submits gtag event","log",e),window.gtag("event",e,{}))},{reset:b,state:h}=e((()=>({orderIdCreated:null,paypalButtons:[],paypalClientId:"",paypalErrorMessage:null}))),m=({checkoutSessionId:e,onPaypalFail:c,onPaypalSessionDone:d,overrideBorderRaidus:p,overridePrimaryColor:y})=>({createOrder:async()=>{try{h.paypalErrorMessage=null,r.inventoryCheckErrorMessage=null;try{r.inventoryCheckErrorMessage=await n()}catch(o){r.inventoryCheckErrorMessage=t("Unable to check inventory. Please try again.")}return r.inventoryCheckErrorMessage?"":await(async({checkoutSessionId:o})=>{var e,r;const{errors:n,json:t}=await(async({checkoutSessionId:o})=>{const{errors:e,json:r}=await s("/api/zonos-elements/create-paypal-order",{body:{checkoutSessionId:o},method:"POST"});return{errors:e,json:r}})({checkoutSessionId:o}),a=null===(e=null==t?void 0:t.paypalOrderCreate)||void 0===e?void 0:e.paypalOrderId;if(n.length||!a)throw new Error((null===(r=n.find(Boolean))||void 0===r?void 0:r.message)||"An unexpected error occurred when creating paypal order.");return a})({checkoutSessionId:e})}catch(o){return l("Failed to create paypal order",o),h.paypalErrorMessage=t("Failed to create PayPal order. Please try again, or consider using an alternative method."),null==c||c(),""}},onApprove:async()=>{try{h.paypalErrorMessage=null,w("zonos-checkout-payment-info");const o=await(async({checkoutSessionId:o,paypalMockResponse:e})=>{var r,n;new URL(window.location.href);const{errors:a,json:i}=await(async({checkoutSessionId:o,paypalMockResponse:e})=>{const{errors:r,json:n}=await s("/api/zonos-elements/capture-paypal-order",{body:{checkoutSessionId:o,paypalMockResponse:e},method:"POST"});return{errors:r,json:n}})({checkoutSessionId:o,paypalMockResponse:e}),c=null===(r=null==i?void 0:i.paypalOrderCapture.order)||void 0===r?void 0:r.id;if(a.length||!c)throw new Error((null===(n=a.find(Boolean))||void 0===n?void 0:n.message)||t("An unexpected error occurred when processing PayPal order."));return c})({checkoutSessionId:e,paypalMockResponse:window.Zonos._paypalMockResponse});h.orderIdCreated=o,null==d||d({orderId:o}),a(),i()}catch(o){if(l("==== Failed to capture paypal order",o),o instanceof Error)return(({error:o})=>{var e;const r=u(o.message),n=null===(e=null==r?void 0:r.errors.find(Boolean))||void 0===e?void 0:e.message,a=(null==n?void 0:n.match(/\[(.*?)\] (.*)/i))||[];a||(h.paypalErrorMessage=t("An unexpected error occurred when processing PayPal order."));const i=a[2]||t("An unexpected error occurred when processing PayPal order.");h.paypalErrorMessage=i})({error:o});null==c||c()}},style:{borderRadius:"SHARP"===p?0:10,color:f({backgroundColor1:"#ffc33a",backgroundColor2:y||o.appearance.colorPrimary||""})?"gold":"blue",shape:"rect"}}),P=async({currency:e})=>{var r;if(!(null===(r=o.checkoutSettings.externalPaymentMethods)||void 0===r?void 0:r.find((o=>"PAYPAL"===o.type&&"ENABLED"===o.status))))return void c("=== Paypal is disabled for this store","warn");const n=o.checkoutSettings.externalServiceTokens.find((o=>"PAYPAL_CLIENT_ID"===o.type));if(!n)return void c("Failed to load paypal -- missing paypal publishable key","warn");const t="production"===o.zonosMode&&"LIVE"===o.checkoutSettings.mode?"production":"sandbox";window.Zonos.paypal=await function(o,e){if(void 0===e&&(e=Promise),v(o,e),"undefined"==typeof document)return e.resolve(null);var r=function(o){var e="sandbox"===o.environment?"https://www.sandbox.paypal.com/sdk/js":"https://www.paypal.com/sdk/js";delete o.environment,o.sdkBaseUrl&&(e=o.sdkBaseUrl,delete o.sdkBaseUrl);var r,n,t=o,a=Object.keys(t).filter((function(o){return null!=t[o]&&""!==t[o]})).reduce((function(o,e){var r=t[e].toString();return"data"===(e=e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(function(o,e){return(e?"-":"")+o.toLowerCase()}))).substring(0,4)||"crossorigin"===e?o.attributes[e]=r:o.queryParams[e]=r,o}),{queryParams:{},attributes:{}}),i=a.queryParams,s=a.attributes;return i["merchant-id"]&&-1!==i["merchant-id"].indexOf(",")&&(s["data-merchant-id"]=i["merchant-id"],i["merchant-id"]="*"),{url:"".concat(e,"?").concat((r=i,n="",Object.keys(r).forEach((function(o){0!==n.length&&(n+="&"),n+=o+"="+r[o]})),n)),attributes:s}}(o),n=r.url,t=r.attributes,a=t["data-namespace"]||"paypal",i=y(a);return t["data-js-sdk-library"]||(t["data-js-sdk-library"]="paypal-js"),function(o,e){var r=document.querySelector('script[src="'.concat(o,'"]'));if(null===r)return null;var n=p(o,e),t=r.cloneNode();if(delete t.dataset.uidAuto,Object.keys(t.dataset).length!==Object.keys(n.dataset).length)return null;var a=!0;return Object.keys(t.dataset).forEach((function(o){t.dataset[o]!==n.dataset[o]&&(a=!1)})),a?r:null}(n,t)&&i?e.resolve(i):function(o,e){void 0===e&&(e=Promise),v(o,e);var r=o.url,n=o.attributes;if("string"!=typeof r||0===r.length)throw new Error("Invalid url.");if(void 0!==n&&"object"!=typeof n)throw new Error("Expected attributes to be an object.");return new e((function(o,e){if("undefined"==typeof document)return o();!function(o){var e=o.onSuccess,r=o.onError,n=p(o.url,o.attributes);n.onerror=r,n.onload=e,document.head.insertBefore(n,document.head.firstElementChild)}({url:r,attributes:n,onSuccess:function(){return o()},onError:function(){var o=new Error('The script "'.concat(r,'" failed to load. Check the HTTP status code and response body in DevTools to learn more.'));return e(o)}})}))}({url:n,attributes:t},e).then((function(){var o=y(a);if(o)return o;throw new Error("The window.".concat(a," global variable is not available."))}))}({clientId:n.token,currency:e,environment:t}),c("==== Paypal script loaded")},k=o=>{var e;const n=window.Zonos.paypal;if(!n)return c("Paypal is not available"),null;const t=r.checkoutSessionId;if(!t)return c("Paypal is not available due to checkoutSessionId is not available"),null;c("==== Loading Paypal buttons"),h.paypalButtons.length&&(h.paypalButtons.forEach((async o=>{await o.close()})),h.paypalButtons=[]);const a=[null===(e=n.FUNDING)||void 0===e?void 0:e.PAYPAL].filter(Boolean);return h.paypalButtons=a.map((e=>{var r;let a=null;try{a=(null===(r=n.Buttons)||void 0===r?void 0:r.call(n,Object.assign(Object.assign({},m(Object.assign({checkoutSessionId:t,fundingSource:e},o))),{fundingSource:e})))||null}catch(o){c(`===== Failed to load paypal's "${e}" button`,"warn",o)}return(null==a?void 0:a.isEligible())?(c(`==== Paypal button ${e} loaded`),a):null})).filter(Boolean),h.paypalButtons},j=()=>!!h.paypalButtons.length;export{h as a,b,j as c,k as d,f as i,P as p,w as s}
17
+ */function p(o,e){void 0===e&&(e={});var r=document.createElement("script");return r.src=o,Object.keys(e).forEach((function(o){r.setAttribute(o,e[o]),"data-csp-nonce"===o&&r.setAttribute("nonce",e["data-csp-nonce"])})),r}function f(o){return window[o]}function y(o,e){if("object"!=typeof o||null===o)throw new Error("Expected an options object.");var r=o.environment;if(r&&"production"!==r&&"sandbox"!==r)throw new Error('The `environment` option must be either "production" or "sandbox".');if(void 0!==e&&"function"!=typeof e)throw new Error("Expected PromisePonyfill to be a function.")}const v=({backgroundColor1:o,backgroundColor2:e})=>d.readability(o,e)>2.5,w=e=>{const r=o.checkoutSettings.analyticsProviders.find((o=>"GOOGLE_ANALYTICS"===o.type));r&&"DISABLED"!==(null==r?void 0:r.status)&&"function"==typeof window.gtag&&(c("Zonos submits gtag event","log",e),window.gtag("event",e,{}))},{reset:b,state:h}=e((()=>({orderIdCreated:null,paypalButtons:[],paypalClientId:"",paypalErrorMessage:null}))),m=({checkoutSessionId:e,onPaypalFail:c,onPaypalSessionDone:d,overrideBorderRaidus:p,overridePrimaryColor:f})=>({createOrder:async()=>{try{h.paypalErrorMessage=null,r.inventoryCheckErrorMessage=null;try{r.inventoryCheckErrorMessage=await n()}catch(o){r.inventoryCheckErrorMessage=t("Unable to check inventory. Please try again.")}return r.inventoryCheckErrorMessage?"":await(async({checkoutSessionId:o})=>{var e,r;const{errors:n,json:t}=await(async({checkoutSessionId:o})=>{const{errors:e,json:r}=await s("/api/zonos-elements/create-paypal-order",{body:{checkoutSessionId:o},method:"POST"});return{errors:e,json:r}})({checkoutSessionId:o}),a=null===(e=null==t?void 0:t.paypalOrderCreate)||void 0===e?void 0:e.paypalOrderId;if(n.length||!a)throw new Error((null===(r=n.find(Boolean))||void 0===r?void 0:r.message)||"An unexpected error occurred when creating paypal order.");return a})({checkoutSessionId:e})}catch(o){return l("Failed to create paypal order",o),h.paypalErrorMessage=t("Failed to create PayPal order. Please try again, or consider using an alternative method."),null==c||c(),""}},onApprove:async()=>{try{h.paypalErrorMessage=null,w("zonos-checkout-payment-info");const o=await(async({checkoutSessionId:o,paypalMockResponse:e})=>{var r,n;new URL(window.location.href);const{errors:a,json:i}=await(async({checkoutSessionId:o,paypalMockResponse:e})=>{const{errors:r,json:n}=await s("/api/zonos-elements/capture-paypal-order",{body:{checkoutSessionId:o,paypalMockResponse:e},method:"POST"});return{errors:r,json:n}})({checkoutSessionId:o,paypalMockResponse:e}),c=null===(r=null==i?void 0:i.paypalOrderCapture.order)||void 0===r?void 0:r.id;if(a.length||!c)throw new Error((null===(n=a.find(Boolean))||void 0===n?void 0:n.message)||t("An unexpected error occurred when processing PayPal order."));return c})({checkoutSessionId:e,paypalMockResponse:window.Zonos._paypalMockResponse});h.orderIdCreated=o,null==d||d({orderId:o}),a(),i()}catch(o){if(l("==== Failed to capture paypal order",o),o instanceof Error)return(({error:o})=>{var e;const r=u(o.message),n=null===(e=null==r?void 0:r.errors.find(Boolean))||void 0===e?void 0:e.message,a=(null==n?void 0:n.match(/\[(.*?)\] (.*)/i))||[];a||(h.paypalErrorMessage=t("An unexpected error occurred when processing PayPal order."));const i=a[2]||t("An unexpected error occurred when processing PayPal order.");h.paypalErrorMessage=i})({error:o});null==c||c()}},style:{borderRadius:"SHARP"===p?0:10,color:v({backgroundColor1:"#ffc33a",backgroundColor2:f||o.appearance.colorPrimary||""})?"gold":"blue",shape:"rect"}}),P=async({currency:e})=>{var r;if(!(null===(r=o.checkoutSettings.externalPaymentMethods)||void 0===r?void 0:r.find((o=>"PAYPAL"===o.type&&"ENABLED"===o.status))))return void c("=== Paypal is disabled for this store","warn");const n=o.checkoutSettings.externalServiceTokens.find((o=>"PAYPAL_CLIENT_ID"===o.type));if(!n)return void c("Failed to load paypal -- missing paypal publishable key","warn");const t="production"===o.zonosMode&&"LIVE"===o.checkoutSettings.mode?"production":"sandbox";window.Zonos.paypal=await function(o,e){if(void 0===e&&(e=Promise),y(o,e),"undefined"==typeof document)return e.resolve(null);var r=function(o){var e="sandbox"===o.environment?"https://www.sandbox.paypal.com/sdk/js":"https://www.paypal.com/sdk/js";delete o.environment,o.sdkBaseUrl&&(e=o.sdkBaseUrl,delete o.sdkBaseUrl);var r,n,t=o,a=Object.keys(t).filter((function(o){return null!=t[o]&&""!==t[o]})).reduce((function(o,e){var r=t[e].toString();return"data"===(e=e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(function(o,e){return(e?"-":"")+o.toLowerCase()}))).substring(0,4)||"crossorigin"===e?o.attributes[e]=r:o.queryParams[e]=r,o}),{queryParams:{},attributes:{}}),i=a.queryParams,s=a.attributes;return i["merchant-id"]&&-1!==i["merchant-id"].indexOf(",")&&(s["data-merchant-id"]=i["merchant-id"],i["merchant-id"]="*"),{url:"".concat(e,"?").concat((r=i,n="",Object.keys(r).forEach((function(o){0!==n.length&&(n+="&"),n+=o+"="+r[o]})),n)),attributes:s}}(o),n=r.url,t=r.attributes,a=t["data-namespace"]||"paypal",i=f(a);return t["data-js-sdk-library"]||(t["data-js-sdk-library"]="paypal-js"),function(o,e){var r=document.querySelector('script[src="'.concat(o,'"]'));if(null===r)return null;var n=p(o,e),t=r.cloneNode();if(delete t.dataset.uidAuto,Object.keys(t.dataset).length!==Object.keys(n.dataset).length)return null;var a=!0;return Object.keys(t.dataset).forEach((function(o){t.dataset[o]!==n.dataset[o]&&(a=!1)})),a?r:null}(n,t)&&i?e.resolve(i):function(o,e){void 0===e&&(e=Promise),y(o,e);var r=o.url,n=o.attributes;if("string"!=typeof r||0===r.length)throw new Error("Invalid url.");if(void 0!==n&&"object"!=typeof n)throw new Error("Expected attributes to be an object.");return new e((function(o,e){if("undefined"==typeof document)return o();!function(o){var e=o.onSuccess,r=o.onError,n=p(o.url,o.attributes);n.onerror=r,n.onload=e,document.head.insertBefore(n,document.head.firstElementChild)}({url:r,attributes:n,onSuccess:function(){return o()},onError:function(){var o=new Error('The script "'.concat(r,'" failed to load. Check the HTTP status code and response body in DevTools to learn more.'));return e(o)}})}))}({url:n,attributes:t},e).then((function(){var o=f(a);if(o)return o;throw new Error("The window.".concat(a," global variable is not available."))}))}({clientId:n.token,currency:e,environment:t}),c("==== Paypal script loaded")},k=o=>{var e;const n=window.Zonos.paypal;if(!n)return c("Paypal is not available"),null;const t=r.checkoutSessionId;if(!t)return c("Paypal is not available due to checkoutSessionId is not available"),null;c("==== Loading Paypal buttons"),h.paypalButtons.length&&(h.paypalButtons.forEach((async o=>{await o.close()})),h.paypalButtons=[]);const a=[null===(e=n.FUNDING)||void 0===e?void 0:e.PAYPAL].filter(Boolean);return h.paypalButtons=a.map((e=>{var r;let a=null;try{a=(null===(r=n.Buttons)||void 0===r?void 0:r.call(n,Object.assign(Object.assign({},m(Object.assign({checkoutSessionId:t,fundingSource:e},o))),{fundingSource:e})))||null}catch(o){c(`===== Failed to load paypal's "${e}" button`,"warn",o)}return(null==a?void 0:a.isEligible())?(c(`==== Paypal button ${e} loaded`),a):null})).filter(Boolean),h.paypalButtons},j=()=>!!h.paypalButtons.length;export{h as a,b,j as c,k as d,v as i,P as p,w as s}
@@ -1 +1 @@
1
- import{r as o,h as e,H as t}from"./p-5b7da777.js";import{_ as s,e as i,i as n,f as l,z as r,g as a,m as h}from"./p-1086aac3.js";import{l as d,x as c,t as m,z as f,A as p,B as g,C as u,D as w,E as z}from"./p-8a8fa05c.js";import{c as b}from"./p-b4b7f705.js";import{h as v,a as x,l as y}from"./p-fb59c3c3.js";import{g as k}from"./p-5883217a.js";import"./p-a1b755bf.js";import"./p-1ca5696d.js";var L=s,T=/\s/,C=/^\s+/,O=i,E=n,D=function(o){return o?o.slice(0,function(o){for(var e=o.length;e--&&T.test(o.charAt(e)););return e}(o)+1).replace(C,""):o},S=l,I=/^[-+]0x[0-9a-f]+$/i,j=/^0b[01]+$/i,A=/^0o[0-7]+$/i,B=parseInt,X=l,F=function(){return L.Date.now()},H=function(o){if("number"==typeof o)return o;if(function(o){return"symbol"==typeof o||E(o)&&"[object Symbol]"==O(o)}(o))return NaN;if(S(o)){var e="function"==typeof o.valueOf?o.valueOf():o;o=S(e)?e+"":e}if("string"!=typeof o)return 0===o?o:+o;o=D(o);var t=j.test(o);return t||A.test(o)?B(o.slice(2),t?2:8):I.test(o)?NaN:+o},N=Math.max,M=Math.min;const P=o=>{const e=null==o?void 0:o.replace("www.","").replace("https://","");return e&&new RegExp(e).test(window.location.href)},R=()=>{var o,e;const{productAddToCartElementSelector:t,productDescriptionElementSelector:s,productTitleElementSelector:i,restrictionBehavior:n}=r.helloSettings;i&&s||x("Hello could not check item restrictions - must provide title and description selectors.");const l=i&&c(i)&&document.querySelectorAll(i)||[],a=s&&c(s)&&document.querySelectorAll(s)||[];if(l.length!==a.length)return x("Hello could not check item restrictions - Title and description selectors do not match"),[];const h="RESTRICT_AND_BLOCK"===n,d=h&&t&&c(t)&&document.querySelectorAll(t)||[];h&&d.length!==a.length&&x('Hello could not disable "Add to cart" buttons - Title and add to cart selectors do not match');const m=[];for(let t=0;t<l.length;t++){const s=l[t],i=a[t];if(s&&i){const n={cartButtonNode:d[t]||null,description:(null===(o=i.textContent)||void 0===o?void 0:o.trim())||"",title:(null===(e=s.textContent)||void 0===e?void 0:e.trim())||""};m.push(n)}}return m},$=class{constructor(e){o(this,e),this.getHelloPeekMessage=o=>{if(("productDetail"===r.currentHelloPage||"productList"===r.currentHelloPage)&&this.allRestrictedItems.length){const o=m("click to learn more");return`${m("productDetail"===r.currentHelloPage?"Restricted item":"Restricted items found")} - ${o}`}switch(r.currentHelloPage){case"cart":return m("Prepay duties and taxes at checkout");case"productList":case"productDetail":return m("See duty and tax thresholds");default:return m("Welcome to [storeName]",{storeName:o})}},this.enableShowPeekMessage=()=>{this.peekMessage&&(this.showPeekMessage=!0)},this.getNewItemRestrictions=async o=>"productDetail"!==r.currentHelloPage&&"productList"!==r.currentHelloPage||"DISABLED"===r.helloSettings.restrictionBehavior?[]:await(async o=>{if(!o.length)return[];const{selectedCountryCode:e}=d;if(!e)return x("Hello could not check item restrictions - No country code selected"),[];const t=o.map((o=>({description:o.description,name:o.title})));return(await(async({items:o,shipFrom:e,shipTo:t})=>{var s;const i={items:o,shipFrom:e,shipTo:t},{errors:n,json:l}=await v("/api/zonos-elements/check-item-restrictions",{body:i,method:"POST"});return n.length||!l?(x(`Error fetching item restrictions: ${null===(s=n.find(Boolean))||void 0===s?void 0:s.message}`),[]):l.filter(Boolean)})({items:t,shipFrom:"AD",shipTo:e})).map((o=>{var e;const s=(null===(e=t.filter((e=>e.description===o.itemDescription)).find(Boolean))||void 0===e?void 0:e.name)||"";return Object.assign(Object.assign({},o),{name:s})}))})(o),this.triggerShowPeekMessage=()=>{this.peekMessage=this.getHelloPeekMessage(r.organizationName);const{peekMessageBehavior:o,peekMessageDelay:e}=r.helloSettings;"ENABLED"===o&&setTimeout((()=>{this.enableShowPeekMessage(),this.allRestrictedItems.some((o=>this.productsOnPage.some((e=>e.description===o.itemDescription))))||setTimeout((()=>{this.showPeekMessage=!1}),3e3)}),1e3*e)},this.disableAddToCartButtons=()=>{this.productsOnPage.length&&this.productsOnPage.forEach((o=>{var e,t;this.allRestrictedItems.some((e=>e.itemDescription===o.description))?null===(e=o.cartButtonNode)||void 0===e||e.setAttribute("disabled","disabled"):null===(t=o.cartButtonNode)||void 0===t||t.removeAttribute("disabled")}))},this.handleItemRestrictions=async()=>{this.productsOnPage=R();const o=this.productsOnPage.filter((o=>!this.allFoundProducts.some((e=>e.title===o.title)))),e=await this.getNewItemRestrictions(o);this.allRestrictedItems.push(...e),this.allFoundProducts.push(...o),this.disableAddToCartButtons()},this.reloadHelloData=async()=>{await this.handleItemRestrictions(),this.triggerShowPeekMessage()},this.handleProductCountChange=function(o,e,t){var s,i,n,l,r,a,h=0,d=!1,c=!1,m=!0;if("function"!=typeof o)throw new TypeError("Expected a function");function f(e){var t=s,n=i;return s=i=void 0,h=e,l=o.apply(n,t)}function p(o){var t=o-a;return void 0===a||t>=e||t<0||c&&o-h>=n}function g(){var o=F();if(p(o))return u(o);r=setTimeout(g,function(o){var t=e-(o-a);return c?M(t,n-(o-h)):t}(o))}function u(o){return r=void 0,m&&s?f(o):(s=i=void 0,l)}function w(){var o=F(),t=p(o);if(s=arguments,i=this,a=o,t){if(void 0===r)return function(o){return h=o,r=setTimeout(g,e),d?f(o):l}(a);if(c)return clearTimeout(r),r=setTimeout(g,e),f(a)}return void 0===r&&(r=setTimeout(g,e)),l}return e=H(e)||0,X(t)&&(d=!!t.leading,n=(c="maxWait"in t)?N(H(t.maxWait)||0,e):n,m="trailing"in t?!!t.trailing:m),w.cancel=function(){void 0!==r&&clearTimeout(r),h=0,s=a=i=r=void 0},w.flush=function(){return void 0===r?l:u(F())},w}((()=>{const{productTitleElementSelector:o}=r.helloSettings;if(o){const o=R();if(this.allFoundProducts.length!==o.length&&window.location.href===this.initialUrl){if(!this.allFoundProducts.length)return;this.reloadHelloData()}}}),1e3),this.watchProductCountChange=()=>{new MutationObserver(this.handleProductCountChange).observe(document.body,{childList:!0,subtree:!0})},this.watchPriceChange=()=>{new MutationObserver((()=>{this.displayCurrency()})).observe(document.body,{attributes:!0,childList:!0,subtree:!0})},this.updateHelloOnPageChange=()=>{this.watchProductCountChange(),setInterval((()=>{if(window.location.href!==this.initialUrl){const o=this.initialUrl&&new URL(this.initialUrl);(o&&f(o.searchParams))!==d.selectedCountryCode&&(this.allFoundProducts=[],this.allRestrictedItems=[],this.productsOnPage=[]),this.initialUrl=window.location.href,r.currentHelloPage=(()=>{const{cartUrlPattern:o,homepageUrlPattern:e,productDetailUrlPattern:t,productListUrlPattern:s}=r.helloSettings;return P(o)?"cart":P(t)?"productDetail":P(s)?"productList":P(e)?"home":""})();const e=new URL(window.location.href);if(!f(e.searchParams))return void p(d.selectedCountryCode);this.reloadHelloData()}}),1e3)},this.changeShowDialog=o=>{this.showDialog=o},this.shouldAnimateLeftDesktop=()=>{const o=this.helloRef&&getComputedStyle(this.helloRef).position;if(this.helloRef&&"relative"===o)return k(this.helloRef)},this.shouldRenderHello=(o=!0)=>{if(!d.localizationLoaded)return!1;const{showForCountries:e}=r.helloSettings;return o&&(d.isShippableCountry||y(`Hello: not shippable country - Show for countries: ${e}`)),"ONLY_SHIPPABLE"===e?d.isShippableCountry:"ALL"===e||(null==e?void 0:e.includes(d.selectedCountryCode||""))},this.mobileLocationOverride=void 0,this.animateFromLeftOverride=void 0,this.appearanceSettingsOverride=void 0,this.showPeekMessage=!1,this.zonosStoreHelloSettings=r.helloSettings,this.showDialog=!1,this.peekMessage="",this.initialUrl="",this.allRestrictedItems=[],this.allFoundProducts=[],this.productsOnPage=[],this.isHelloWidgetRendered=!1,this.isMobile=!1}async getCountryList(){return d.helloCountryList}componentWillLoad(){const o=setInterval((async()=>{this.helloRef&&r.loadedConfig&&(this.helloRef.setAttribute("data-zonos-hello-loaded",""),this.updateHelloOnPageChange(),this.watchPriceChange(),this.handleAppearanceSettingsOverrideChange(),clearInterval(o))}),100)}async displayCurrency(){"DISABLED"!==r.helloSettings.currencyBehavior&&(d.exchangeRate?g():y("Could not display currency. Exchange rate and format data is not available.","warn"))}async convertAndFormat(o){return u(o)}async convert(o){return w(o)}async format(o){return z({amount:o})}async openHelloDialog(o){this.changeShowDialog(o)}handleResize(){this.isMobile=window.innerWidth<=768}handleHelloWidgetInitializedState({countryCode:o,currencyCode:e}){var t,s;this.isHelloWidgetRendered||d.selectedCountryCode&&"function"==typeof r.helloSettings.onInitSuccess&&(this.isHelloWidgetRendered=!0,null===(s=(t=r.helloSettings).onInitSuccess)||void 0===s||s.call(t,{countryCode:o,currencyCode:e}))}getHelloLocation(){const o=this.mobileLocationOverride||r.helloSettings.mobileLocation,e=r.helloSettings.desktopLocation,t=this.isMobile;if(!0===t)return{isMobileWindow:t,isOnLeft:this.animateFromLeftOverride||(null==o?void 0:o.includes("LEFT")),isOnTop:null==o?void 0:o.includes("TOP"),shouldFloat:!!o};{const o=!r.helloSettings.anchorElementSelector&&!!e;return{isMobileWindow:t,isOnLeft:this.animateFromLeftOverride||(null==e?void 0:e.includes("LEFT"))||this.shouldAnimateLeftDesktop(),isOnTop:null==e?void 0:e.includes("TOP"),shouldFloat:o}}}handleAppearanceSettingsOverrideChange(){var o;(null===(o=this.appearanceSettingsOverride)||void 0===o?void 0:o.theme)&&(this.appearanceSettingsOverride.theme=a(this.appearanceSettingsOverride.theme))}componentDidLoad(){this.isMobile=window.innerWidth<=768}render(){var o,s;if(null===(o=r.helloSettings.excludedUrlPatterns)||void 0===o?void 0:o.some((o=>new RegExp(o).test(window.location.href))))return y("Hello is excluded on this url","warn"),null;const{selectedCountryCode:i,targetCurrency:n}=d,{isOnLeft:l,isOnTop:a,shouldFloat:c}=this.getHelloLocation(),m=h(r.appearance,this.appearanceSettingsOverride),{theme:f}=m,p=null===(s=this.allRestrictedItems)||void 0===s?void 0:s.filter((o=>this.productsOnPage.some((e=>e.description===o.itemDescription))));this.peekMessage=this.getHelloPeekMessage(r.organizationName);const g=this.shouldRenderHello()&&!!i;return g&&!this.isHelloWidgetRendered&&this.handleHelloWidgetInitializedState({countryCode:i,currencyCode:n}),e(t,{class:"zonos--hello zonos--elements","data-theme":f},g&&e("div",{class:b(["zonos--hello-wrapper",c&&"zonos--hello-widget-float"])},e("button",{class:b(["zonos--hello-widget",this.showPeekMessage&&"zonos--hello-show-peek-message",this.mobileLocationOverride&&"zonos--hello-mobile-override",l&&"zonos--hello-widget-left zonos--hello-widget-animate-from-left",a&&"zonos--hello-widget-top",!!this.allRestrictedItems.length&&"zonos--hello-has-restrictions",c&&"zonos--hello-widget-float"]),onClick:()=>{this.changeShowDialog(!this.showDialog)},onMouseEnter:()=>this.enableShowPeekMessage(),onMouseLeave:()=>this.showPeekMessage=!1,ref:o=>o&&(this.helloRef=o)},e("zonos-text",{class:"zonos--hello-message"},this.peekMessage),i&&e("div",{class:"zonos--hello-country-flag-wrapper"},e("zonos-country-flag",{class:"zonos--hello-country-flag",countryCode:i}))),e("div",{class:b(["zonos--hello-dialog-wrapper",this.mobileLocationOverride&&"zonos--hello-dialog-wrapper-mobile-override",c&&"zonos--hello-widget-float"]),style:{height:this.showDialog?"fit-content":"0px"}},e("zonos-hello-dialog",{animateFromLeftOverride:this.animateFromLeftOverride,appearanceSettings:m,isOpen:this.showDialog,mobileLocationOverride:this.mobileLocationOverride,restrictedItems:p,setIsOpen:this.changeShowDialog}))))}static get watchers(){return{appearanceSettingsOverride:["handleAppearanceSettingsOverrideChange"]}}};$.style=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:inline-block}:host .zonos--hello-wrapper{position:relative}:host .zonos--hello-wrapper .zonos--hello-dialog-wrapper-mobile-override{position:fixed;bottom:0;left:0;width:100vw;z-index:1001;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}@media (max-width: 768px){:host .zonos--hello-wrapper .zonos--hello-dialog-wrapper{position:fixed;bottom:0;left:0;width:100vw;z-index:1001;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}}:host .zonos--hello-widget{-webkit-transition:all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);transition:all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);padding:6px;border-radius:30px;background:var(--zonos-elements-page-background);font-size:var(--zonos-elements-font-size-s);border:var(--zonos-elements-border);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;cursor:pointer;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;position:relative;z-index:1000}:host .zonos--hello-widget>.zonos--hello-message{-ms-flex-order:0;order:0;max-width:0;height:100%;white-space:nowrap;-webkit-transition:border 0.3s ease-in, all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);transition:border 0.3s ease-in, all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);overflow:hidden;color:var(--zonos-elements-text-color);position:absolute;background:var(--zonos-elements-page-background);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-top-left-radius:30px;border-bottom-left-radius:30px;left:0;-webkit-transform:translateX(calc(-100% + 16px));transform:translateX(calc(-100% + 16px));width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border-top:var(--zonos-elements-border);border-bottom:var(--zonos-elements-border)}:host .zonos--hello-widget.zonos--hello-has-restrictions{background:var(--zonos-elements-red-100);border:1px solid var(--zonos-elements-red-200)}:host .zonos--hello-widget.zonos--hello-has-restrictions>.zonos--hello-message{background:var(--zonos-elements-red-100);color:var(--zonos-elements-red-800);font-weight:500}:host .zonos--hello-widget.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:1px solid var(--zonos-elements-red-200)}:host .zonos--hello-widget.zonos--hello-show-peek-message{max-width:100vw;width:100%}:host .zonos--hello-widget.zonos--hello-show-peek-message>.zonos--hello-message{max-width:100vw;padding:0 6px;padding-right:16px;border:var(--zonos-elements-border)}:host .zonos--hello-widget.zonos--hello-show-peek-message:not(.zonos--hello-widget-animate-from-left)>.zonos--hello-message{border-right:none}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{border-left:0}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:16px;padding-right:6px;border-left:none}:host .zonos--hello-widget.zonos--hello-widget-animate-from-left>.zonos--hello-message{-ms-flex-order:1;order:1;-webkit-transform:translateX(calc(100% - 16px));transform:translateX(calc(100% - 16px));right:0;left:auto;border-top-right-radius:30px;border-bottom-right-radius:30px}:host .zonos--hello-widget .zonos--hello-country-flag-wrapper{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}:host .zonos--hello-widget .zonos--hello-country-flag-wrapper .zonos--hello-country-flag{height:18px;width:18px;position:relative;overflow:hidden;border-radius:30px;-webkit-box-shadow:var(--zonos-elements-v3-shadow-medium);box-shadow:var(--zonos-elements-v3-shadow-medium);z-index:10;justify-self:center}:host .zonos--hello-widget.zonos--hello-widget-float{position:fixed;bottom:72px;right:32px}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-left{left:32px;right:auto}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-top{bottom:auto;top:32px}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:none}:host .zonos--hello-widget.zonos--hello-widget-float>.zonos--hello-message{position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-radius:30px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;top:0;bottom:0;left:0;-webkit-transform:translateX(0);transform:translateX(0);width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border:none}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-animate-from-left>.zonos--hello-message{-webkit-transform:translateX(0);transform:translateX(0)}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:8px;padding-right:4px}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message>.zonos--hello-message{padding:0 var(--zonos-elements-radius-4);padding-right:6px;border:none}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float{position:fixed;bottom:72px;right:32px}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-left{left:32px;right:auto}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-top{bottom:auto;top:32px}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:none}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float>.zonos--hello-message{position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-radius:30px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;top:0;bottom:0;left:0;-webkit-transform:translateX(0);transform:translateX(0);width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border:none}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-animate-from-left>.zonos--hello-message{-webkit-transform:translateX(0);transform:translateX(0)}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:8px;padding-right:4px}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message>.zonos--hello-message{padding:0 var(--zonos-elements-radius-4);padding-right:6px;border:none}";export{$ as zonos_hello}
1
+ import{r as o,h as e,H as t}from"./p-5b7da777.js";import{_ as s,e as i,i as n,f as l,z as r,g as a,m as h}from"./p-1086aac3.js";import{l as d,x as c,t as m,z as f,A as p,B as g,C as u,D as w,E as z}from"./p-b7ff0fb5.js";import{c as b}from"./p-b4b7f705.js";import{h as v,a as x,l as y}from"./p-fb59c3c3.js";import{g as k}from"./p-5883217a.js";import"./p-a1b755bf.js";import"./p-1ca5696d.js";var L=s,T=/\s/,C=/^\s+/,O=i,E=n,D=function(o){return o?o.slice(0,function(o){for(var e=o.length;e--&&T.test(o.charAt(e)););return e}(o)+1).replace(C,""):o},S=l,I=/^[-+]0x[0-9a-f]+$/i,j=/^0b[01]+$/i,A=/^0o[0-7]+$/i,B=parseInt,X=l,F=function(){return L.Date.now()},H=function(o){if("number"==typeof o)return o;if(function(o){return"symbol"==typeof o||E(o)&&"[object Symbol]"==O(o)}(o))return NaN;if(S(o)){var e="function"==typeof o.valueOf?o.valueOf():o;o=S(e)?e+"":e}if("string"!=typeof o)return 0===o?o:+o;o=D(o);var t=j.test(o);return t||A.test(o)?B(o.slice(2),t?2:8):I.test(o)?NaN:+o},N=Math.max,M=Math.min;const P=o=>{const e=null==o?void 0:o.replace("www.","").replace("https://","");return e&&new RegExp(e).test(window.location.href)},R=()=>{var o,e;const{productAddToCartElementSelector:t,productDescriptionElementSelector:s,productTitleElementSelector:i,restrictionBehavior:n}=r.helloSettings;i&&s||x("Hello could not check item restrictions - must provide title and description selectors.");const l=i&&c(i)&&document.querySelectorAll(i)||[],a=s&&c(s)&&document.querySelectorAll(s)||[];if(l.length!==a.length)return x("Hello could not check item restrictions - Title and description selectors do not match"),[];const h="RESTRICT_AND_BLOCK"===n,d=h&&t&&c(t)&&document.querySelectorAll(t)||[];h&&d.length!==a.length&&x('Hello could not disable "Add to cart" buttons - Title and add to cart selectors do not match');const m=[];for(let t=0;t<l.length;t++){const s=l[t],i=a[t];if(s&&i){const n={cartButtonNode:d[t]||null,description:(null===(o=i.textContent)||void 0===o?void 0:o.trim())||"",title:(null===(e=s.textContent)||void 0===e?void 0:e.trim())||""};m.push(n)}}return m},$=class{constructor(e){o(this,e),this.getHelloPeekMessage=o=>{if(("productDetail"===r.currentHelloPage||"productList"===r.currentHelloPage)&&this.allRestrictedItems.length){const o=m("click to learn more");return`${m("productDetail"===r.currentHelloPage?"Restricted item":"Restricted items found")} - ${o}`}switch(r.currentHelloPage){case"cart":return m("Prepay duties and taxes at checkout");case"productList":case"productDetail":return m("See duty and tax thresholds");default:return m("Welcome to [storeName]",{storeName:o})}},this.enableShowPeekMessage=()=>{this.peekMessage&&(this.showPeekMessage=!0)},this.getNewItemRestrictions=async o=>"productDetail"!==r.currentHelloPage&&"productList"!==r.currentHelloPage||"DISABLED"===r.helloSettings.restrictionBehavior?[]:await(async o=>{if(!o.length)return[];const{selectedCountryCode:e}=d;if(!e)return x("Hello could not check item restrictions - No country code selected"),[];const t=o.map((o=>({description:o.description,name:o.title})));return(await(async({items:o,shipFrom:e,shipTo:t})=>{var s;const i={items:o,shipFrom:e,shipTo:t},{errors:n,json:l}=await v("/api/zonos-elements/check-item-restrictions",{body:i,method:"POST"});return n.length||!l?(x(`Error fetching item restrictions: ${null===(s=n.find(Boolean))||void 0===s?void 0:s.message}`),[]):l.filter(Boolean)})({items:t,shipFrom:"AD",shipTo:e})).map((o=>{var e;const s=(null===(e=t.filter((e=>e.description===o.itemDescription)).find(Boolean))||void 0===e?void 0:e.name)||"";return Object.assign(Object.assign({},o),{name:s})}))})(o),this.triggerShowPeekMessage=()=>{this.peekMessage=this.getHelloPeekMessage(r.organizationName);const{peekMessageBehavior:o,peekMessageDelay:e}=r.helloSettings;"ENABLED"===o&&setTimeout((()=>{this.enableShowPeekMessage(),this.allRestrictedItems.some((o=>this.productsOnPage.some((e=>e.description===o.itemDescription))))||setTimeout((()=>{this.showPeekMessage=!1}),3e3)}),1e3*e)},this.disableAddToCartButtons=()=>{this.productsOnPage.length&&this.productsOnPage.forEach((o=>{var e,t;this.allRestrictedItems.some((e=>e.itemDescription===o.description))?null===(e=o.cartButtonNode)||void 0===e||e.setAttribute("disabled","disabled"):null===(t=o.cartButtonNode)||void 0===t||t.removeAttribute("disabled")}))},this.handleItemRestrictions=async()=>{this.productsOnPage=R();const o=this.productsOnPage.filter((o=>!this.allFoundProducts.some((e=>e.title===o.title)))),e=await this.getNewItemRestrictions(o);this.allRestrictedItems.push(...e),this.allFoundProducts.push(...o),this.disableAddToCartButtons()},this.reloadHelloData=async()=>{await this.handleItemRestrictions(),this.triggerShowPeekMessage()},this.handleProductCountChange=function(o,e,t){var s,i,n,l,r,a,h=0,d=!1,c=!1,m=!0;if("function"!=typeof o)throw new TypeError("Expected a function");function f(e){var t=s,n=i;return s=i=void 0,h=e,l=o.apply(n,t)}function p(o){var t=o-a;return void 0===a||t>=e||t<0||c&&o-h>=n}function g(){var o=F();if(p(o))return u(o);r=setTimeout(g,function(o){var t=e-(o-a);return c?M(t,n-(o-h)):t}(o))}function u(o){return r=void 0,m&&s?f(o):(s=i=void 0,l)}function w(){var o=F(),t=p(o);if(s=arguments,i=this,a=o,t){if(void 0===r)return function(o){return h=o,r=setTimeout(g,e),d?f(o):l}(a);if(c)return clearTimeout(r),r=setTimeout(g,e),f(a)}return void 0===r&&(r=setTimeout(g,e)),l}return e=H(e)||0,X(t)&&(d=!!t.leading,n=(c="maxWait"in t)?N(H(t.maxWait)||0,e):n,m="trailing"in t?!!t.trailing:m),w.cancel=function(){void 0!==r&&clearTimeout(r),h=0,s=a=i=r=void 0},w.flush=function(){return void 0===r?l:u(F())},w}((()=>{const{productTitleElementSelector:o}=r.helloSettings;if(o){const o=R();if(this.allFoundProducts.length!==o.length&&window.location.href===this.initialUrl){if(!this.allFoundProducts.length)return;this.reloadHelloData()}}}),1e3),this.watchProductCountChange=()=>{new MutationObserver(this.handleProductCountChange).observe(document.body,{childList:!0,subtree:!0})},this.watchPriceChange=()=>{new MutationObserver((()=>{this.displayCurrency()})).observe(document.body,{attributes:!0,childList:!0,subtree:!0})},this.updateHelloOnPageChange=()=>{this.watchProductCountChange(),setInterval((()=>{if(window.location.href!==this.initialUrl){const o=this.initialUrl&&new URL(this.initialUrl);(o&&f(o.searchParams))!==d.selectedCountryCode&&(this.allFoundProducts=[],this.allRestrictedItems=[],this.productsOnPage=[]),this.initialUrl=window.location.href,r.currentHelloPage=(()=>{const{cartUrlPattern:o,homepageUrlPattern:e,productDetailUrlPattern:t,productListUrlPattern:s}=r.helloSettings;return P(o)?"cart":P(t)?"productDetail":P(s)?"productList":P(e)?"home":""})();const e=new URL(window.location.href);if(!f(e.searchParams))return void p(d.selectedCountryCode);this.reloadHelloData()}}),1e3)},this.changeShowDialog=o=>{this.showDialog=o},this.shouldAnimateLeftDesktop=()=>{const o=this.helloRef&&getComputedStyle(this.helloRef).position;if(this.helloRef&&"relative"===o)return k(this.helloRef)},this.shouldRenderHello=(o=!0)=>{if(!d.localizationLoaded)return!1;const{showForCountries:e}=r.helloSettings;return o&&(d.isShippableCountry||y(`Hello: not shippable country - Show for countries: ${e}`)),"ONLY_SHIPPABLE"===e?d.isShippableCountry:"ALL"===e||(null==e?void 0:e.includes(d.selectedCountryCode||""))},this.mobileLocationOverride=void 0,this.animateFromLeftOverride=void 0,this.appearanceSettingsOverride=void 0,this.showPeekMessage=!1,this.zonosStoreHelloSettings=r.helloSettings,this.showDialog=!1,this.peekMessage="",this.initialUrl="",this.allRestrictedItems=[],this.allFoundProducts=[],this.productsOnPage=[],this.isHelloWidgetRendered=!1,this.isMobile=!1}async getCountryList(){return d.helloCountryList}componentWillLoad(){const o=setInterval((async()=>{this.helloRef&&r.loadedConfig&&(this.helloRef.setAttribute("data-zonos-hello-loaded",""),this.updateHelloOnPageChange(),this.watchPriceChange(),this.handleAppearanceSettingsOverrideChange(),clearInterval(o))}),100)}async displayCurrency(){"DISABLED"!==r.helloSettings.currencyBehavior&&(d.exchangeRate?g():y("Could not display currency. Exchange rate and format data is not available.","warn"))}async convertAndFormat(o){return u(o)}async convert(o){return w(o)}async format(o){return z({amount:o})}async openHelloDialog(o){this.changeShowDialog(o)}handleResize(){this.isMobile=window.innerWidth<=768}handleHelloWidgetInitializedState({countryCode:o,currencyCode:e}){var t,s;this.isHelloWidgetRendered||d.selectedCountryCode&&"function"==typeof r.helloSettings.onInitSuccess&&(this.isHelloWidgetRendered=!0,null===(s=(t=r.helloSettings).onInitSuccess)||void 0===s||s.call(t,{countryCode:o,currencyCode:e}))}getHelloLocation(){const o=this.mobileLocationOverride||r.helloSettings.mobileLocation,e=r.helloSettings.desktopLocation,t=this.isMobile;if(!0===t)return{isMobileWindow:t,isOnLeft:this.animateFromLeftOverride||(null==o?void 0:o.includes("LEFT")),isOnTop:null==o?void 0:o.includes("TOP"),shouldFloat:!!o};{const o=!r.helloSettings.anchorElementSelector&&!!e;return{isMobileWindow:t,isOnLeft:this.animateFromLeftOverride||(null==e?void 0:e.includes("LEFT"))||this.shouldAnimateLeftDesktop(),isOnTop:null==e?void 0:e.includes("TOP"),shouldFloat:o}}}handleAppearanceSettingsOverrideChange(){var o;(null===(o=this.appearanceSettingsOverride)||void 0===o?void 0:o.theme)&&(this.appearanceSettingsOverride.theme=a(this.appearanceSettingsOverride.theme))}componentDidLoad(){this.isMobile=window.innerWidth<=768}render(){var o,s;if(null===(o=r.helloSettings.excludedUrlPatterns)||void 0===o?void 0:o.some((o=>new RegExp(o).test(window.location.href))))return y("Hello is excluded on this url","warn"),null;const{selectedCountryCode:i,targetCurrency:n}=d,{isOnLeft:l,isOnTop:a,shouldFloat:c}=this.getHelloLocation(),m=h(r.appearance,this.appearanceSettingsOverride),{theme:f}=m,p=null===(s=this.allRestrictedItems)||void 0===s?void 0:s.filter((o=>this.productsOnPage.some((e=>e.description===o.itemDescription))));this.peekMessage=this.getHelloPeekMessage(r.organizationName);const g=this.shouldRenderHello()&&!!i;return g&&!this.isHelloWidgetRendered&&this.handleHelloWidgetInitializedState({countryCode:i,currencyCode:n}),e(t,{class:"zonos--hello zonos--elements","data-theme":f},g&&e("div",{class:b(["zonos--hello-wrapper",c&&"zonos--hello-widget-float"])},e("button",{class:b(["zonos--hello-widget",this.showPeekMessage&&"zonos--hello-show-peek-message",this.mobileLocationOverride&&"zonos--hello-mobile-override",l&&"zonos--hello-widget-left zonos--hello-widget-animate-from-left",a&&"zonos--hello-widget-top",!!this.allRestrictedItems.length&&"zonos--hello-has-restrictions",c&&"zonos--hello-widget-float"]),onClick:()=>{this.changeShowDialog(!this.showDialog)},onMouseEnter:()=>this.enableShowPeekMessage(),onMouseLeave:()=>this.showPeekMessage=!1,ref:o=>o&&(this.helloRef=o)},e("zonos-text",{class:"zonos--hello-message"},this.peekMessage),i&&e("div",{class:"zonos--hello-country-flag-wrapper"},e("zonos-country-flag",{class:"zonos--hello-country-flag",countryCode:i}))),e("div",{class:b(["zonos--hello-dialog-wrapper",this.mobileLocationOverride&&"zonos--hello-dialog-wrapper-mobile-override",c&&"zonos--hello-widget-float"]),style:{height:this.showDialog?"fit-content":"0px"}},e("zonos-hello-dialog",{animateFromLeftOverride:this.animateFromLeftOverride,appearanceSettings:m,isOpen:this.showDialog,mobileLocationOverride:this.mobileLocationOverride,restrictedItems:p,setIsOpen:this.changeShowDialog}))))}static get watchers(){return{appearanceSettingsOverride:["handleAppearanceSettingsOverrideChange"]}}};$.style=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:inline-block}:host .zonos--hello-wrapper{position:relative}:host .zonos--hello-wrapper .zonos--hello-dialog-wrapper-mobile-override{position:fixed;bottom:0;left:0;width:100vw;z-index:1001;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}@media (max-width: 768px){:host .zonos--hello-wrapper .zonos--hello-dialog-wrapper{position:fixed;bottom:0;left:0;width:100vw;z-index:1001;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}}:host .zonos--hello-widget{-webkit-transition:all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);transition:all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);padding:6px;border-radius:30px;background:var(--zonos-elements-page-background);font-size:var(--zonos-elements-font-size-s);border:var(--zonos-elements-border);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;cursor:pointer;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;position:relative;z-index:1000}:host .zonos--hello-widget>.zonos--hello-message{-ms-flex-order:0;order:0;max-width:0;height:100%;white-space:nowrap;-webkit-transition:border 0.3s ease-in, all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);transition:border 0.3s ease-in, all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);overflow:hidden;color:var(--zonos-elements-text-color);position:absolute;background:var(--zonos-elements-page-background);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-top-left-radius:30px;border-bottom-left-radius:30px;left:0;-webkit-transform:translateX(calc(-100% + 16px));transform:translateX(calc(-100% + 16px));width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border-top:var(--zonos-elements-border);border-bottom:var(--zonos-elements-border)}:host .zonos--hello-widget.zonos--hello-has-restrictions{background:var(--zonos-elements-red-100);border:1px solid var(--zonos-elements-red-200)}:host .zonos--hello-widget.zonos--hello-has-restrictions>.zonos--hello-message{background:var(--zonos-elements-red-100);color:var(--zonos-elements-red-800);font-weight:500}:host .zonos--hello-widget.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:1px solid var(--zonos-elements-red-200)}:host .zonos--hello-widget.zonos--hello-show-peek-message{max-width:100vw;width:100%}:host .zonos--hello-widget.zonos--hello-show-peek-message>.zonos--hello-message{max-width:100vw;padding:0 6px;padding-right:16px;border:var(--zonos-elements-border)}:host .zonos--hello-widget.zonos--hello-show-peek-message:not(.zonos--hello-widget-animate-from-left)>.zonos--hello-message{border-right:none}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{border-left:0}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:16px;padding-right:6px;border-left:none}:host .zonos--hello-widget.zonos--hello-widget-animate-from-left>.zonos--hello-message{-ms-flex-order:1;order:1;-webkit-transform:translateX(calc(100% - 16px));transform:translateX(calc(100% - 16px));right:0;left:auto;border-top-right-radius:30px;border-bottom-right-radius:30px}:host .zonos--hello-widget .zonos--hello-country-flag-wrapper{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}:host .zonos--hello-widget .zonos--hello-country-flag-wrapper .zonos--hello-country-flag{height:18px;width:18px;position:relative;overflow:hidden;border-radius:30px;-webkit-box-shadow:var(--zonos-elements-v3-shadow-medium);box-shadow:var(--zonos-elements-v3-shadow-medium);z-index:10;justify-self:center}:host .zonos--hello-widget.zonos--hello-widget-float{position:fixed;bottom:72px;right:32px}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-left{left:32px;right:auto}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-top{bottom:auto;top:32px}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:none}:host .zonos--hello-widget.zonos--hello-widget-float>.zonos--hello-message{position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-radius:30px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;top:0;bottom:0;left:0;-webkit-transform:translateX(0);transform:translateX(0);width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border:none}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-animate-from-left>.zonos--hello-message{-webkit-transform:translateX(0);transform:translateX(0)}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:8px;padding-right:4px}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message>.zonos--hello-message{padding:0 var(--zonos-elements-radius-4);padding-right:6px;border:none}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float{position:fixed;bottom:72px;right:32px}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-left{left:32px;right:auto}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-top{bottom:auto;top:32px}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:none}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float>.zonos--hello-message{position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-radius:30px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;top:0;bottom:0;left:0;-webkit-transform:translateX(0);transform:translateX(0);width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border:none}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-animate-from-left>.zonos--hello-message{-webkit-transform:translateX(0);transform:translateX(0)}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:8px;padding-right:4px}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message>.zonos--hello-message{padding:0 var(--zonos-elements-radius-4);padding-right:6px;border:none}";export{$ as zonos_hello}
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(n,t,e,r){function i(n){return n instanceof e?n:new e((function(t){t(n)}))}return new(e||(e=Promise))((function(e,o){function u(n){try{a(r.next(n))}catch(n){o(n)}}function c(n){try{a(r["throw"](n))}catch(n){o(n)}}function a(n){n.done?e(n.value):i(n.value).then(u,c)}a((r=r.apply(n,t||[])).next())}))};var __generator=this&&this.__generator||function(n,t){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,u;return u={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(u[Symbol.iterator]=function(){return this}),u;function c(n){return function(t){return a([n,t])}}function a(c){if(r)throw new TypeError("Generator is already executing.");while(u&&(u=0,c[0]&&(e=0)),e)try{if(r=1,i&&(o=c[0]&2?i["return"]:c[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;if(i=0,o)c=[c[0]&2,o.value];switch(c[0]){case 0:case 1:o=c;break;case 4:e.label++;return{value:c[1],done:false};case 5:e.label++;i=c[1];c=[0];continue;case 7:c=e.ops.pop();e.trys.pop();continue;default:if(!(o=e.trys,o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){e=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){e.label=c[1];break}if(c[0]===6&&e.label<o[1]){e.label=o[1];o=c;break}if(o&&e.label<o[2]){e.label=o[2];e.ops.push(c);break}if(o[2])e.ops.pop();e.trys.pop();continue}c=t.call(n,e)}catch(n){c=[6,n];i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}};System.register(["./p-1a940770.system.js","./p-b74ff880.system.js","./p-e89c2805.system.js"],(function(n){"use strict";var t,e,r,i;return{setters:[function(n){t=n.d;e=n.l},function(n){r=n.z},function(n){i=n.h}],execute:function(){var o=this;var u=n("t",(function(n,u){return __awaiter(o,void 0,void 0,(function(){var o,c,a,s,f,d,v;return __generator(this,(function(w){switch(w.label){case 0:a=window.location.href.includes("zonos.com")||window.location.href.includes("checkout.iglobalstores.com")||!!((o=window.Zonos)===null||o===void 0?void 0:o.zonosQaUrl)||!!((c=window.Zonos)===null||c===void 0?void 0:c.debug);if(a&&!window.Zonos.zonosConversionTest){return[2]}s=e.selectedCountryCode;f=r.organizationId;d=t.checkoutSessionId;if(!d){return[2]}v={checkoutSessionId:d,countryCode:s,eventName:n,metadata:u,organizationId:f};return[4,i("/api/zonos-elements/track-conversion-event",{body:v,method:"POST"})];case 1:w.sent();return[2]}}))}))}));var c=n("g",(function(){var n;return(n=window.Zonos.zonosApiKey)===null||n===void 0?void 0:n.includes("test")}));var a=n("c",(function(n,t){return new CustomEvent(n,{detail:t})}))}}}));
1
+ var __awaiter=this&&this.__awaiter||function(n,t,e,r){function i(n){return n instanceof e?n:new e((function(t){t(n)}))}return new(e||(e=Promise))((function(e,o){function u(n){try{a(r.next(n))}catch(n){o(n)}}function c(n){try{a(r["throw"](n))}catch(n){o(n)}}function a(n){n.done?e(n.value):i(n.value).then(u,c)}a((r=r.apply(n,t||[])).next())}))};var __generator=this&&this.__generator||function(n,t){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,u;return u={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(u[Symbol.iterator]=function(){return this}),u;function c(n){return function(t){return a([n,t])}}function a(c){if(r)throw new TypeError("Generator is already executing.");while(u&&(u=0,c[0]&&(e=0)),e)try{if(r=1,i&&(o=c[0]&2?i["return"]:c[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;if(i=0,o)c=[c[0]&2,o.value];switch(c[0]){case 0:case 1:o=c;break;case 4:e.label++;return{value:c[1],done:false};case 5:e.label++;i=c[1];c=[0];continue;case 7:c=e.ops.pop();e.trys.pop();continue;default:if(!(o=e.trys,o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){e=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){e.label=c[1];break}if(c[0]===6&&e.label<o[1]){e.label=o[1];o=c;break}if(o&&e.label<o[2]){e.label=o[2];e.ops.push(c);break}if(o[2])e.ops.pop();e.trys.pop();continue}c=t.call(n,e)}catch(n){c=[6,n];i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}};System.register(["./p-7c0b5743.system.js","./p-b74ff880.system.js","./p-e89c2805.system.js"],(function(n){"use strict";var t,e,r,i;return{setters:[function(n){t=n.d;e=n.l},function(n){r=n.z},function(n){i=n.h}],execute:function(){var o=this;var u=n("t",(function(n,u){return __awaiter(o,void 0,void 0,(function(){var o,c,a,s,f,d,v;return __generator(this,(function(w){switch(w.label){case 0:a=window.location.href.includes("zonos.com")||window.location.href.includes("checkout.iglobalstores.com")||!!((o=window.Zonos)===null||o===void 0?void 0:o.zonosQaUrl)||!!((c=window.Zonos)===null||c===void 0?void 0:c.debug);if(a&&!window.Zonos.zonosConversionTest){return[2]}s=e.selectedCountryCode;f=r.organizationId;d=t.checkoutSessionId;if(!d){return[2]}v={checkoutSessionId:d,countryCode:s,eventName:n,metadata:u,organizationId:f};return[4,i("/api/zonos-elements/track-conversion-event",{body:v,method:"POST"})];case 1:w.sent();return[2]}}))}))}));var c=n("g",(function(){var n;return(n=window.Zonos.zonosApiKey)===null||n===void 0?void 0:n.includes("test")}));var a=n("c",(function(n,t){return new CustomEvent(n,{detail:t})}))}}}));
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(n,t,o,e){function a(n){return n instanceof o?n:new o((function(t){t(n)}))}return new(o||(o=Promise))((function(o,s){function i(n){try{c(e.next(n))}catch(n){s(n)}}function r(n){try{c(e["throw"](n))}catch(n){s(n)}}function c(n){n.done?o(n.value):a(n.value).then(i,r)}c((e=e.apply(n,t||[])).next())}))};var __generator=this&&this.__generator||function(n,t){var o={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},e,a,s,i;return i={next:r(0),throw:r(1),return:r(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function r(n){return function(t){return c([n,t])}}function c(r){if(e)throw new TypeError("Generator is already executing.");while(i&&(i=0,r[0]&&(o=0)),o)try{if(e=1,a&&(s=r[0]&2?a["return"]:r[0]?a["throw"]||((s=a["return"])&&s.call(a),0):a.next)&&!(s=s.call(a,r[1])).done)return s;if(a=0,s)r=[r[0]&2,s.value];switch(r[0]){case 0:case 1:s=r;break;case 4:o.label++;return{value:r[1],done:false};case 5:o.label++;a=r[1];r=[0];continue;case 7:r=o.ops.pop();o.trys.pop();continue;default:if(!(s=o.trys,s=s.length>0&&s[s.length-1])&&(r[0]===6||r[0]===2)){o=0;continue}if(r[0]===3&&(!s||r[1]>s[0]&&r[1]<s[3])){o.label=r[1];break}if(r[0]===6&&o.label<s[1]){o.label=s[1];s=r;break}if(s&&o.label<s[2]){o.label=s[2];o.ops.push(r);break}if(s[2])o.ops.pop();o.trys.pop();continue}r=t.call(n,o)}catch(n){r=[6,n];a=0}finally{e=s=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(n,t,o){if(o||arguments.length===2)for(var e=0,a=t.length,s;e<a;e++){if(s||!(e in t)){if(!s)s=Array.prototype.slice.call(t,0,e);s[e]=t[e]}}return n.concat(s||Array.prototype.slice.call(t))};System.register(["./p-fd061229.system.js","./p-b74ff880.system.js","./p-23e7c655.system.js","./p-1a940770.system.js","./p-e89c2805.system.js","./p-081ff323.system.js","./p-91462d96.system.js","./p-455b7545.system.js"],(function(n){"use strict";var t,o,e,a,s,i,r,c,p,f,y;return{setters:[function(n){t=n.r;o=n.h;e=n.H;a=n.d;s=n.c},function(n){i=n.d},function(n){r=n.c},function(n){c=n.j},function(n){p=n.a;f=n.l},function(n){y=n.d},function(){},function(){}],execute:function(){var l=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}:host .zonos--notification-items{position:fixed;z-index:9999999999;bottom:24px;gap:8px;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:column;flex-direction:column}:host .zonos--notification-item{cursor:pointer;-webkit-transition:all 0.3s ease;transition:all 0.3s ease;padding:8px;border-radius:var(--border-radius, var(--zonos-elements-radius-6));opacity:0;-ms-flex-negative:0.0001;flex-shrink:0.0001;-webkit-transform:translateY(100%);transform:translateY(100%)}:host .zonos--notification-item+:host .zonos--notification-item{margin-top:8px}:host .zonos--notification-item.show{opacity:1;-webkit-transform:translateY(0);transform:translateY(0);-ms-flex-positive:1000;flex-grow:1000}:host .zonos--notification-item.success{background-color:var(--zonos-elements-green-700)}:host .zonos--notification-item.error{background-color:var(--zonos-elements-red-700)}:host .zonos--notification-item.warning{background-color:var(--zonos-elements-orange-700)}";var m=l;var h=n("zonos_notification",function(){function n(n){t(this,n);this.notificationArray=[]}n.prototype.showNotification=function(n){return __awaiter(this,void 0,void 0,(function(){var t,o;var e=this;return __generator(this,(function(a){t="id-".concat(Math.random().toString(36).substring(2,9));o=Object.assign(Object.assign({},n),{id:t,timeout:n.timeout||5e3,transitionClass:"",type:n.type||"success"});this.notificationArray=__spreadArray(__spreadArray([],this.notificationArray,true),[o],false);setTimeout((function(){e.updateTransitionClass({id:t,transitionClass:"show"})}),50);setTimeout((function(){e.removeNotification(t)}),o.timeout);return[2]}))}))};n.prototype.updateTransitionClass=function(n){var t=n.id,o=n.transitionClass;this.notificationArray=this.notificationArray.map((function(n){if(n.id===t){return Object.assign(Object.assign({},n),{transitionClass:o})}return n}))};n.prototype.removeNotification=function(n){var t=this;this.updateTransitionClass({id:n,transitionClass:""});setTimeout((function(){t.notificationArray=t.notificationArray.filter((function(t){return t.id!==n}))}),300)};n.prototype.render=function(){var n=this;return o(e,{key:"17c08c90c6c1dfade4e43451c196127a0f53429e",class:r(["zonos--elements zonos--notification"]),style:{"--font-family":i()}},o("div",{key:"6624419d86a5c7518539069dbc5c9d7c08262c75",class:"zonos--notification-items"},this.notificationArray.map((function(t){return o("div",{"aria-hidden":"true",class:r(["zonos--notification-item",t.type,t.transitionClass]),key:t.id,onClick:function(){n.removeNotification(t.id)}},o("zonos-text",{textColor:"gray-0"},t.message))}))))};return n}());h.style=m;var u=".sc-zonos-payment-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-payment-h *.sc-zonos-payment{font-family:var(--font-family, Inter), Inter}.sc-zonos-payment-h img.sc-zonos-payment{max-width:100%}.sc-zonos-payment-h dl.sc-zonos-payment,.sc-zonos-payment-h dd.sc-zonos-payment,.sc-zonos-payment-h h1.sc-zonos-payment,.sc-zonos-payment-h h2.sc-zonos-payment,.sc-zonos-payment-h h3.sc-zonos-payment,.sc-zonos-payment-h h4.sc-zonos-payment,.sc-zonos-payment-h h5.sc-zonos-payment,.sc-zonos-payment-h h6.sc-zonos-payment,.sc-zonos-payment-h hr.sc-zonos-payment,.sc-zonos-payment-h figure.sc-zonos-payment,.sc-zonos-payment-h p.sc-zonos-payment,.sc-zonos-payment-h pre.sc-zonos-payment{margin:0}.sc-zonos-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-payment-h .zonos--title.sc-zonos-payment{margin-bottom:16px}";var z=u;var d=n("zonos_payment",function(){function n(n){t(this,n);this.titleText=undefined;this.stripe=c.stripe;this.stripeElements=c.stripeElements}n.prototype.watchInitStripe=function(){if(!this.stripeElements){return}var n=c.stripePaymentElement||this.stripeElements.create("payment",{layout:"accordion"});var t=this.el.querySelector(".zonos--payment-component");if(!t){p("Cannot find container element for paymentElement");return}n.mount(t);n.on("change",(function(n){c.stripePaymentEventData=n}));c.stripePaymentElement=n};n.prototype.componentDidLoad=function(){this.watchInitStripe()};n.prototype.render=function(){return o(e,{key:"ab601d9a0cc6fe2fee19f45d6321dcc81b418cff",class:"zonos--payment zonos--elements"},this.titleText&&o("zonos-text",{key:"27857c99c59e4913fa403ef5b23b5b7d7f32bd45",class:"zonos--title",type:"semiBoldLabel"},this.titleText),o("div",{key:"329b5a5617f0c5942b209df1ccf3bfcb4ddabb0c",class:"zonos--payment-component"}),o("div",{key:"7abb08922e9f607314713fc9fa762a3bb8a35b13",class:"zonos--payment-paypal-container"}))};Object.defineProperty(n.prototype,"el",{get:function(){return a(this)},enumerable:false,configurable:true});Object.defineProperty(n,"watchers",{get:function(){return{stripeElements:["watchInitStripe"],stripe:["watchInitStripe"]}},enumerable:false,configurable:true});return n}());d.style=z;var b=".sc-zonos-paypal-payment-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-paypal-payment-h *.sc-zonos-paypal-payment{font-family:var(--font-family, Inter), Inter}.sc-zonos-paypal-payment-h img.sc-zonos-paypal-payment{max-width:100%}.sc-zonos-paypal-payment-h dl.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h dd.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h1.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h2.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h3.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h4.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h5.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h6.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h hr.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h figure.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h p.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h pre.sc-zonos-paypal-payment{margin:0}.sc-zonos-paypal-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-paypal-payment-h{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:column;flex-direction:column}";var v=b;var g=n("zonos_paypal_payment",function(){function n(n){t(this,n);this.paypalSessionDone=s(this,"paypalSessionDone",7);this.paypalSessionFail=s(this,"paypalSessionFail",7)}n.prototype.loadPaypal=function(){return __awaiter(this,void 0,void 0,(function(){var n,t;var o=this;return __generator(this,(function(e){if(!window.Zonos.paypal){f("Paypal is not available");return[2]}n=y({onPaypalFail:function(){f("onPaypalFail");o.paypalSessionFail.emit()},onPaypalSessionDone:function(n){var t=n.orderId;f("onPaypalSessionDone","info",{orderId:t});o.paypalSessionDone.emit({orderId:t})}});if(!(n===null||n===void 0?void 0:n.length)){f("There are no paypal buttons available");return[2]}t=this.el.querySelector(".zonos--payment-paypal-container");if(!t){f("Cannot find container element for paypal buttons");return[2]}n.forEach((function(n){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:return[4,n.render(t)];case 1:o.sent();return[2]}}))}))}));return[2]}))}))};n.prototype.componentDidLoad=function(){void this.loadPaypal()};n.prototype.render=function(){return o(e,{key:"a09fe5b66b1ac971c10529ecb6213479f2870f08",class:"zonos--paypal-payment zonos--elements"},o("div",{key:"6ba337785b8a90965e0cba05fd62681bc92633fe",class:"zonos--payment-paypal-container"}))};Object.defineProperty(n.prototype,"el",{get:function(){return a(this)},enumerable:false,configurable:true});return n}());g.style=v}}}));
1
+ var __awaiter=this&&this.__awaiter||function(n,t,o,e){function a(n){return n instanceof o?n:new o((function(t){t(n)}))}return new(o||(o=Promise))((function(o,s){function i(n){try{c(e.next(n))}catch(n){s(n)}}function r(n){try{c(e["throw"](n))}catch(n){s(n)}}function c(n){n.done?o(n.value):a(n.value).then(i,r)}c((e=e.apply(n,t||[])).next())}))};var __generator=this&&this.__generator||function(n,t){var o={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},e,a,s,i;return i={next:r(0),throw:r(1),return:r(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function r(n){return function(t){return c([n,t])}}function c(r){if(e)throw new TypeError("Generator is already executing.");while(i&&(i=0,r[0]&&(o=0)),o)try{if(e=1,a&&(s=r[0]&2?a["return"]:r[0]?a["throw"]||((s=a["return"])&&s.call(a),0):a.next)&&!(s=s.call(a,r[1])).done)return s;if(a=0,s)r=[r[0]&2,s.value];switch(r[0]){case 0:case 1:s=r;break;case 4:o.label++;return{value:r[1],done:false};case 5:o.label++;a=r[1];r=[0];continue;case 7:r=o.ops.pop();o.trys.pop();continue;default:if(!(s=o.trys,s=s.length>0&&s[s.length-1])&&(r[0]===6||r[0]===2)){o=0;continue}if(r[0]===3&&(!s||r[1]>s[0]&&r[1]<s[3])){o.label=r[1];break}if(r[0]===6&&o.label<s[1]){o.label=s[1];s=r;break}if(s&&o.label<s[2]){o.label=s[2];o.ops.push(r);break}if(s[2])o.ops.pop();o.trys.pop();continue}r=t.call(n,o)}catch(n){r=[6,n];a=0}finally{e=s=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(n,t,o){if(o||arguments.length===2)for(var e=0,a=t.length,s;e<a;e++){if(s||!(e in t)){if(!s)s=Array.prototype.slice.call(t,0,e);s[e]=t[e]}}return n.concat(s||Array.prototype.slice.call(t))};System.register(["./p-fd061229.system.js","./p-b74ff880.system.js","./p-23e7c655.system.js","./p-7c0b5743.system.js","./p-e89c2805.system.js","./p-bf53c6aa.system.js","./p-91462d96.system.js","./p-455b7545.system.js"],(function(n){"use strict";var t,o,e,a,s,i,r,c,p,f,y;return{setters:[function(n){t=n.r;o=n.h;e=n.H;a=n.d;s=n.c},function(n){i=n.d},function(n){r=n.c},function(n){c=n.j},function(n){p=n.a;f=n.l},function(n){y=n.d},function(){},function(){}],execute:function(){var l=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}:host .zonos--notification-items{position:fixed;z-index:9999999999;bottom:24px;gap:8px;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:column;flex-direction:column}:host .zonos--notification-item{cursor:pointer;-webkit-transition:all 0.3s ease;transition:all 0.3s ease;padding:8px;border-radius:var(--border-radius, var(--zonos-elements-radius-6));opacity:0;-ms-flex-negative:0.0001;flex-shrink:0.0001;-webkit-transform:translateY(100%);transform:translateY(100%)}:host .zonos--notification-item+:host .zonos--notification-item{margin-top:8px}:host .zonos--notification-item.show{opacity:1;-webkit-transform:translateY(0);transform:translateY(0);-ms-flex-positive:1000;flex-grow:1000}:host .zonos--notification-item.success{background-color:var(--zonos-elements-green-700)}:host .zonos--notification-item.error{background-color:var(--zonos-elements-red-700)}:host .zonos--notification-item.warning{background-color:var(--zonos-elements-orange-700)}";var m=l;var h=n("zonos_notification",function(){function n(n){t(this,n);this.notificationArray=[]}n.prototype.showNotification=function(n){return __awaiter(this,void 0,void 0,(function(){var t,o;var e=this;return __generator(this,(function(a){t="id-".concat(Math.random().toString(36).substring(2,9));o=Object.assign(Object.assign({},n),{id:t,timeout:n.timeout||5e3,transitionClass:"",type:n.type||"success"});this.notificationArray=__spreadArray(__spreadArray([],this.notificationArray,true),[o],false);setTimeout((function(){e.updateTransitionClass({id:t,transitionClass:"show"})}),50);setTimeout((function(){e.removeNotification(t)}),o.timeout);return[2]}))}))};n.prototype.updateTransitionClass=function(n){var t=n.id,o=n.transitionClass;this.notificationArray=this.notificationArray.map((function(n){if(n.id===t){return Object.assign(Object.assign({},n),{transitionClass:o})}return n}))};n.prototype.removeNotification=function(n){var t=this;this.updateTransitionClass({id:n,transitionClass:""});setTimeout((function(){t.notificationArray=t.notificationArray.filter((function(t){return t.id!==n}))}),300)};n.prototype.render=function(){var n=this;return o(e,{key:"17c08c90c6c1dfade4e43451c196127a0f53429e",class:r(["zonos--elements zonos--notification"]),style:{"--font-family":i()}},o("div",{key:"6624419d86a5c7518539069dbc5c9d7c08262c75",class:"zonos--notification-items"},this.notificationArray.map((function(t){return o("div",{"aria-hidden":"true",class:r(["zonos--notification-item",t.type,t.transitionClass]),key:t.id,onClick:function(){n.removeNotification(t.id)}},o("zonos-text",{textColor:"gray-0"},t.message))}))))};return n}());h.style=m;var u=".sc-zonos-payment-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-payment-h *.sc-zonos-payment{font-family:var(--font-family, Inter), Inter}.sc-zonos-payment-h img.sc-zonos-payment{max-width:100%}.sc-zonos-payment-h dl.sc-zonos-payment,.sc-zonos-payment-h dd.sc-zonos-payment,.sc-zonos-payment-h h1.sc-zonos-payment,.sc-zonos-payment-h h2.sc-zonos-payment,.sc-zonos-payment-h h3.sc-zonos-payment,.sc-zonos-payment-h h4.sc-zonos-payment,.sc-zonos-payment-h h5.sc-zonos-payment,.sc-zonos-payment-h h6.sc-zonos-payment,.sc-zonos-payment-h hr.sc-zonos-payment,.sc-zonos-payment-h figure.sc-zonos-payment,.sc-zonos-payment-h p.sc-zonos-payment,.sc-zonos-payment-h pre.sc-zonos-payment{margin:0}.sc-zonos-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-payment-h .zonos--title.sc-zonos-payment{margin-bottom:16px}";var z=u;var d=n("zonos_payment",function(){function n(n){t(this,n);this.titleText=undefined;this.stripe=c.stripe;this.stripeElements=c.stripeElements}n.prototype.watchInitStripe=function(){if(!this.stripeElements){return}var n=c.stripePaymentElement||this.stripeElements.create("payment",{layout:"accordion"});var t=this.el.querySelector(".zonos--payment-component");if(!t){p("Cannot find container element for paymentElement");return}n.mount(t);n.on("change",(function(n){c.stripePaymentEventData=n}));c.stripePaymentElement=n};n.prototype.componentDidLoad=function(){this.watchInitStripe()};n.prototype.render=function(){return o(e,{key:"ab601d9a0cc6fe2fee19f45d6321dcc81b418cff",class:"zonos--payment zonos--elements"},this.titleText&&o("zonos-text",{key:"27857c99c59e4913fa403ef5b23b5b7d7f32bd45",class:"zonos--title",type:"semiBoldLabel"},this.titleText),o("div",{key:"329b5a5617f0c5942b209df1ccf3bfcb4ddabb0c",class:"zonos--payment-component"}),o("div",{key:"7abb08922e9f607314713fc9fa762a3bb8a35b13",class:"zonos--payment-paypal-container"}))};Object.defineProperty(n.prototype,"el",{get:function(){return a(this)},enumerable:false,configurable:true});Object.defineProperty(n,"watchers",{get:function(){return{stripeElements:["watchInitStripe"],stripe:["watchInitStripe"]}},enumerable:false,configurable:true});return n}());d.style=z;var b=".sc-zonos-paypal-payment-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-paypal-payment-h *.sc-zonos-paypal-payment{font-family:var(--font-family, Inter), Inter}.sc-zonos-paypal-payment-h img.sc-zonos-paypal-payment{max-width:100%}.sc-zonos-paypal-payment-h dl.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h dd.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h1.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h2.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h3.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h4.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h5.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h6.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h hr.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h figure.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h p.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h pre.sc-zonos-paypal-payment{margin:0}.sc-zonos-paypal-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-paypal-payment-h{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:column;flex-direction:column}";var v=b;var g=n("zonos_paypal_payment",function(){function n(n){t(this,n);this.paypalSessionDone=s(this,"paypalSessionDone",7);this.paypalSessionFail=s(this,"paypalSessionFail",7)}n.prototype.loadPaypal=function(){return __awaiter(this,void 0,void 0,(function(){var n,t;var o=this;return __generator(this,(function(e){if(!window.Zonos.paypal){f("Paypal is not available");return[2]}n=y({onPaypalFail:function(){f("onPaypalFail");o.paypalSessionFail.emit()},onPaypalSessionDone:function(n){var t=n.orderId;f("onPaypalSessionDone","info",{orderId:t});o.paypalSessionDone.emit({orderId:t})}});if(!(n===null||n===void 0?void 0:n.length)){f("There are no paypal buttons available");return[2]}t=this.el.querySelector(".zonos--payment-paypal-container");if(!t){f("Cannot find container element for paypal buttons");return[2]}n.forEach((function(n){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:return[4,n.render(t)];case 1:o.sent();return[2]}}))}))}));return[2]}))}))};n.prototype.componentDidLoad=function(){void this.loadPaypal()};n.prototype.render=function(){return o(e,{key:"a09fe5b66b1ac971c10529ecb6213479f2870f08",class:"zonos--paypal-payment zonos--elements"},o("div",{key:"6ba337785b8a90965e0cba05fd62681bc92633fe",class:"zonos--payment-paypal-container"}))};Object.defineProperty(n.prototype,"el",{get:function(){return a(this)},enumerable:false,configurable:true});return n}());g.style=v}}}));
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(e,o,s,t){function n(e){return e instanceof s?e:new s((function(o){o(e)}))}return new(s||(s=Promise))((function(s,i){function a(e){try{d(t.next(e))}catch(e){i(e)}}function r(e){try{d(t["throw"](e))}catch(e){i(e)}}function d(e){e.done?s(e.value):n(e.value).then(a,r)}d((t=t.apply(e,o||[])).next())}))};var __generator=this&&this.__generator||function(e,o){var s={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},t,n,i,a;return a={next:r(0),throw:r(1),return:r(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function r(e){return function(o){return d([e,o])}}function d(r){if(t)throw new TypeError("Generator is already executing.");while(a&&(a=0,r[0]&&(s=0)),s)try{if(t=1,n&&(i=r[0]&2?n["return"]:r[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,r[1])).done)return i;if(n=0,i)r=[r[0]&2,i.value];switch(r[0]){case 0:case 1:i=r;break;case 4:s.label++;return{value:r[1],done:false};case 5:s.label++;n=r[1];r=[0];continue;case 7:r=s.ops.pop();s.trys.pop();continue;default:if(!(i=s.trys,i=i.length>0&&i[i.length-1])&&(r[0]===6||r[0]===2)){s=0;continue}if(r[0]===3&&(!i||r[1]>i[0]&&r[1]<i[3])){s.label=r[1];break}if(r[0]===6&&s.label<i[1]){s.label=i[1];i=r;break}if(i&&s.label<i[2]){s.label=i[2];s.ops.push(r);break}if(i[2])s.ops.pop();s.trys.pop();continue}r=o.call(e,s)}catch(e){r=[6,e];n=0}finally{t=i=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};System.register(["./p-fd061229.system.js","./p-1a940770.system.js","./p-aed0098c.system.js","./p-e89c2805.system.js","./p-2670438c.system.js","./p-b74ff880.system.js","./p-23e7c655.system.js","./p-2770ba48.system.js","./p-455b7545.system.js","./p-91462d96.system.js"],(function(e){"use strict";var o,s,t,n,i,a,r,d,l,c,h,f,u,b,p,m,v,z;return{setters:[function(e){o=e.r;s=e.c;t=e.h;n=e.H;i=e.d},function(e){a=e.j;r=e.l;d=e.t},function(e){l=e.i},function(e){c=e.a},function(e){h=e.i;f=e.c},function(e){u=e.z;b=e.d},function(e){p=e.c},function(e){m=e.R},function(e){v=e.g},function(e){z=e.i}],execute:function(){var y=".sc-zonos-address-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-address-h *.sc-zonos-address{font-family:var(--font-family, Inter), Inter}.sc-zonos-address-h img.sc-zonos-address{max-width:100%}.sc-zonos-address-h dl.sc-zonos-address,.sc-zonos-address-h dd.sc-zonos-address,.sc-zonos-address-h h1.sc-zonos-address,.sc-zonos-address-h h2.sc-zonos-address,.sc-zonos-address-h h3.sc-zonos-address,.sc-zonos-address-h h4.sc-zonos-address,.sc-zonos-address-h h5.sc-zonos-address,.sc-zonos-address-h h6.sc-zonos-address,.sc-zonos-address-h hr.sc-zonos-address,.sc-zonos-address-h figure.sc-zonos-address,.sc-zonos-address-h p.sc-zonos-address,.sc-zonos-address-h pre.sc-zonos-address{margin:0}.sc-zonos-address-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-address-h .zonos--title.sc-zonos-address{margin-bottom:16px}.sc-zonos-address-h zonos-banner.sc-zonos-address{margin-top:8px}";var g=y;var x=e("zonos_address",function(){function e(e){o(this,e);this.invalidCharacters=s(this,"invalidCharacters",7);this.type=undefined;this.titleText=undefined;this.defaultAddress=null;this.stripe=window.Zonos.stripe;this.isDirtyAddress=false}e.prototype.getStripeAddressInstance=function(){if(this.type==="billing"){return{stripeAddressElement:a.stripeBillingAddressElement,stripeAddressEventData:a.stripeBillingAddressEventData,stripeElements:a.stripeElementsForBillingAddress}}return{stripeAddressElement:a.stripeAddressElement,stripeAddressEventData:a.stripeAddressEventData,stripeElements:a.stripeElements}};e.prototype.updateAddressEventData=function(e){var o=e.event,s=e.type;switch(s){case"billing":a.stripeBillingAddressEventData=o;break;default:a.stripeAddressEventData=o;break}};e.prototype.updateAddressElement=function(e){var o=e.stripeAddressElement,s=e.type;if(s==="shipping"){a.stripeAddressElement=o;return}a.stripeBillingAddressElement=o};e.prototype.watchInitStripe=function(){return __awaiter(this,void 0,void 0,(function(){var e,o,s,t,n,i,a,d,h;var f=this;return __generator(this,(function(u){this.stripe=window.Zonos.stripe;s=this.getStripeAddressInstance(),t=s.stripeAddressEventData,n=s.stripeElements;if(!this.stripe||!n){c("Stripe is not initialized. Couldn't load stripe element.");return[2]}i=(e=this.defaultAddress)===null||e===void 0?void 0:e.phone;if(!i){(o=this.defaultAddress)===null||o===void 0?true:delete o.phone}a=r.shippingZoneCountries;d=a?Object.values(a).map((function(e){return e.code})):[];h=n.create("address",{allowedCountries:this.type==="shipping"?d:[],contacts:this.defaultAddress&&!t?[this.defaultAddress]:[],defaultValues:{address:Object.assign(Object.assign({},t===null||t===void 0?void 0:t.value.address),{country:(t===null||t===void 0?void 0:t.value.address.country)||r.selectedCountryCode||"AL"}),firstName:t===null||t===void 0?void 0:t.value.firstName,lastName:t===null||t===void 0?void 0:t.value.lastName,phone:t===null||t===void 0?void 0:t.value.phone},display:{name:"split"},fields:{phone:"always"},mode:this.type,validation:{phone:{required:"always"}}});h.mount(this.el.querySelector(".zonos--address-component"));h.on("change",(function(e){var o=e.value;if(!f.isDirtyAddress&&o.address.line1.length>=3){f.isDirtyAddress=true;setTimeout((function(){if(l()){f.el.scrollIntoView({behavior:"smooth",block:"end"})}else{var e=f.type==="shipping"?100:600;var o=f.el.closest(".zonos--group");var s=f.el.getBoundingClientRect().top+e;o===null||o===void 0?void 0:o.scrollTo({behavior:"smooth",top:s})}}),600)}f.updateAddressEventData({event:Object.assign(Object.assign({},e),{elementMode:f.type,elementType:"address",value:Object.assign(Object.assign({},o),{firstName:o.firstName||o.name.split(" ")[0],lastName:o.lastName||o.name.split(" ")[1]})}),type:f.type})}));this.updateAddressElement({stripeAddressElement:h,type:this.type});return[2]}))}))};e.prototype.disconnectedCallback=function(){var e=this.getStripeAddressInstance().stripeAddressElement;e===null||e===void 0?void 0:e.destroy()};e.prototype.componentDidLoad=function(){var e=this.getStripeAddressInstance().stripeAddressEventData;this.isDirtyAddress=!!e&&e.value.address.line1.length>0;void this.watchInitStripe()};e.prototype.render=function(){return t(n,{key:"2cecb49ed22bd0d5ce22c4f2110b37ecf7935cca",class:"zonos--address zonos--elements"},t("zonos-text",{key:"101635210ab6cb3b9a44b47eec101187d1c3a4ac",class:"zonos--title",type:"semiBoldLabel"},this.titleText),t("div",{key:"049f2b86986471d45bd413813307ec489d9f1993",class:"zonos--address-component"}))};Object.defineProperty(e.prototype,"el",{get:function(){return i(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{stripe:["watchInitStripe"]}},enumerable:false,configurable:true});return e}());x.style=g;var k=':host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--title{margin-bottom:12px}:host .zonos--address-group{display:-ms-flexbox;display:flex;gap:4px;-ms-flex-direction:column;flex-direction:column}:host .zonos--address-line{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .zonos--address-line zonos-text+zonos-text::before{content:", ";color:var(--zonos-elements-gray-1200);margin-right:4px}:host .zonos--country-flag{width:20px;height:14px;border-radius:2px;margin:1px;position:relative;overflow:hidden;-webkit-box-shadow:var(--zonos-elements-v3-shadow-medium);box-shadow:var(--zonos-elements-v3-shadow-medium);margin-right:8px;z-index:10;justify-self:center}';var w=k;var j=e("zonos_address_display",function(){function e(e){o(this,e);this.currentAddress=undefined;this.addressType=undefined}e.prototype.render=function(){var e;var o=this.currentAddress,s=o.city,i=o.country,a=o.email,l=o.line1,c=o.line2,f=o.name,u=o.phone,b=o.postal_code,p=o.state;var m=(e=r.shippingZoneCountries)===null||e===void 0?void 0:e[i];var v=function(e){var o=e.bold,s=e.content;var n=h(s)?"red-600":"gray-1200";return t("zonos-text",{textColor:n,type:o?"boldLabel":"body"},s)};return t(n,{class:"zonos--address-form zonos--elements"},t("div",{class:"zonos--title"},t("zonos-text",{textColor:"gray-700",type:"smallHeader"},this.addressType==="shipping"?d("Shipping"):d("Billing"))),t("div",{class:"zonos--address-group"},f&&t("div",{class:"zonos--address-line"},v({bold:true,content:f})),a&&t("div",{class:"zonos--address-line"},v({content:a})),u&&t("div",{class:"zonos--address-line"},v({content:u})),l&&t("div",{class:"zonos--address-line"},v({content:l})),c&&t("div",{class:"zonos--address-line"},v({content:c})),t("div",{class:"zonos--address-line"},s&&v({content:s}),p&&v({content:p}),b&&v({content:b})),m&&t("div",{class:"zonos--address-line"},t("zonos-country-flag",{class:"zonos--country-flag",countryCode:m.code})," ",v({content:m.displayName}))))};return e}());j.style=w;var C=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--title{margin-bottom:20px}:host .zonos--address-group{display:-ms-flexbox;display:flex;gap:20px;-ms-flex-direction:column;flex-direction:column;margin:1px}:host .zonos--contact{display:-ms-flexbox;display:flex;gap:8px;-ms-flex-direction:column;flex-direction:column}:host .zonos--address-row{display:-ms-flexbox;display:flex;gap:8px}:host .zonos--address-row>*{-ms-flex:1;flex:1}:host .zonos--address{display:-ms-flexbox;display:flex;gap:8px;-ms-flex-direction:column;flex-direction:column}";var I=C;var A=e("zonos_address_form",function(){function e(e){var t=this;o(this,e);this.addressChange=s(this,"addressChange",7);this.onInputChange=function(e){var o;var s=e.key,n=e.value;t.addressChange.emit(Object.assign(Object.assign({},t.localAddress),(o={},o[s]=n,o)))};this.currentAddress=undefined;this.translatedAddress=undefined;this.addressType=undefined;this.localAddress=this.currentAddress}e.prototype.watchCurrentAddress=function(){var e,o,s,t,n,i;var a=this.currentAddress,r=a.city,d=a.line1,l=a.line2,c=a.name,h=a.postal_code,f=a.state;this.localAddress=Object.assign(Object.assign({},this.currentAddress),{city:((e=this.translatedAddress.city)===null||e===void 0?void 0:e[r])||r,line1:((o=this.translatedAddress.line1)===null||o===void 0?void 0:o[d])||d,line2:((s=this.translatedAddress.line2)===null||s===void 0?void 0:s[l])||l,name:((t=this.translatedAddress.name)===null||t===void 0?void 0:t[c])||c,postal_code:((n=this.translatedAddress.postal_code)===null||n===void 0?void 0:n[h])||h,state:((i=this.translatedAddress.state)===null||i===void 0?void 0:i[f])||f})};e.prototype.componentWillLoad=function(){this.watchCurrentAddress()};e.prototype.render=function(){var e=this;var o=this.localAddress,s=o.city,i=o.country,a=o.line1,r=o.line2,l=o.name,c=o.phone,f=o.postal_code,u=o.state;var b=l.split(" ")[0]||"";var p=l.split(" ").slice(1).join(" ")||"";return t(n,{key:"8b578737e33203a23563be7e9be0778deec99bbf",class:"zonos--address-form zonos--elements"},t("div",{key:"793675a1348547bf3f781788956befe325191011",class:"zonos--title"},t("zonos-text",{key:"13de35cb0a7c98a48342e3fb86ae3ade9f5b88d9",textColor:"gray-700",type:"smallHeader"},this.addressType==="shipping"?d("Shipping"):d("Billing"))),t("div",{key:"2c5de5b5283fb99ee5f8b61d7a217177986fc2db",class:"zonos--address-group"},t("div",{key:"23bf3c893071000d5995a5f175867bab11929193",class:"zonos--contact"},t("zonos-text",{key:"7cdfe2a84ebad89ba5b16498d75def99cf392384",type:"label"},d("Contact")),t("zonos-input",{key:"1c39c38767fd306c5eb1164cdc989b8291209cf0",class:"zonos--form-email",inputLabel:d("Email"),inputValue:this.currentAddress.email,isDisabled:true}),t("div",{key:"cbdf61217125e22b1a6cec9a340ef0aca2c75670",class:"zonos--name zonos--address-row"},t("zonos-input",{key:"360c99e7b2c6caa64580d5768b5bb53368927275",class:"zonos--form-first-name",inputLabel:d("First name"),inputValue:b,isError:h(b),onInputChange:function(o){return e.onInputChange({key:"name",value:"".concat(o.detail," ").concat(p)})}}),t("zonos-input",{key:"8ce5fa5c15c6f7928339ea10009ce0e68954a91f",class:"zonos--form-last-name",inputLabel:d("Last name"),inputValue:p,isError:h(p),onInputChange:function(o){return e.onInputChange({key:"name",value:"".concat(b," ").concat(o.detail)})}}))),t("div",{key:"7b4fa2d3baa6cb257e7688e5ba6777123898b3fd",class:"zonos--address"},t("zonos-text",{key:"9d5782331b2642755a755aeb7f98c9f4d87f9a20",type:"label"},d("Address")),t("zonos-input",{key:"a622025924ca86bdbf1d3c04b79e6dee172b4c42",class:"zonos--form-country",inputLabel:d("Country"),inputValue:i,isDisabled:true}),t("zonos-input",{key:"f99b3a74db09ab5730878e80705b9aeac76bf800",class:"zonos--form-line1",inputLabel:d("Address line 1"),inputValue:a,isError:h(a),onInputChange:function(o){return e.onInputChange({key:"line1",value:o.detail})}}),t("zonos-input",{key:"5d16aefa45a78045c87d166aaaec0255606e455e",class:"zonos--form-line2",inputLabel:d("Address line 2"),inputValue:r,isError:h(r),onInputChange:function(o){return e.onInputChange({key:"line2",value:o.detail})}}),t("div",{key:"dc166be9381142835d72e731cb38a718522a068a",class:"zonos--address-row"},t("zonos-input",{key:"4f1a98f9d10ce0cff3ef18a3037a12382552b31d",class:"zonos--form-city",inputLabel:d("City"),inputValue:s,isError:h(s),onInputChange:function(o){return e.onInputChange({key:"city",value:o.detail})}}),t("zonos-input",{key:"d4f97900b5fe2e1619950a52d1d1f716a8bc19ff",class:"zonos--form-state",inputLabel:d("State/Province"),inputValue:u,isError:h(u),onInputChange:function(o){return e.onInputChange({key:"state",value:o.detail})}})),t("zonos-input",{key:"cf1eb0ca5cd15c8412a2e1246aaf2e39361dc733",class:"zonos--form-postal-code",inputLabel:d("Postal code"),inputValue:f,isError:h(f),onInputChange:function(o){return e.onInputChange({key:"postal_code",value:o.detail})}}),t("zonos-input",{key:"7421c82847eded6bdbcce49ef8196124d8e50c1d",class:"zonos--form-phone",inputLabel:d("Phone number"),inputValue:c,onInputChange:function(o){return e.onInputChange({key:"phone",value:o.detail})}}))))};Object.defineProperty(e,"watchers",{get:function(){return{translatedAddress:["watchCurrentAddress"]}},enumerable:false,configurable:true});return e}());A.style=I;var _=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--body{padding:0 24px;position:relative}:host .zonos--dialog-header{margin-bottom:32px;position:-webkit-sticky;position:sticky;padding-top:24px;top:0;z-index:11;background:var(--zonos-elements-gray-0)}:host .zonos--dialog-title{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;margin-bottom:12px}:host .zonos--group{overflow:auto;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:8px;-ms-scroll-chaining:none;overscroll-behavior:contain}:host .zonos--group::-webkit-scrollbar{width:10px}:host .zonos--group::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}:host .zonos--group::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}:host .zonos--group::-webkit-scrollbar-thumb:hover{background:#d6d6d6}:host .zonos--address-display-group{display:-ms-flexbox;display:flex;gap:8px;margin-bottom:20px}:host .zonos--address-display-group zonos-address-display{-ms-flex:1;flex:1}:host .zonos--what-you-entered{margin-bottom:8px}:host .zonos--address-form-section{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:24px}:host .zonos--group-btn{position:-webkit-sticky;position:sticky;padding:24px 0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-pack:end;justify-content:end;background:var(--zonos-elements-gray-0);z-index:11}:host .zonos--group-btn .zonos--button-wrapper{display:-ms-flexbox;display:flex;gap:8px}:host(.mobile) .zonos--button-wrapper{-ms-flex-direction:column;flex-direction:column;width:100%}:host(.mobile) .zonos--button-wrapper zonos-button{width:100%}:host(.mobile) .zonos--button-wrapper .zonos--cancel-btn{-ms-flex-order:2;order:2}:host(.mobile) .zonos--button-wrapper .zonos--update-btn{-ms-flex-order:1;order:1}";var O=_;var L=e("zonos_address_update_dialog",function(){function e(e){var t=this;o(this,e);this.closeUpdateDialog=s(this,"closeUpdateDialog",7);this.continueClicked=s(this,"continueClicked",7);this.closeUpdateDialogHandler=function(){t.closeUpdateDialog.emit()};this.getTranslatedAddress=function(e){var o=e.currentAddress,s=e.translatedAddress;var t,n,i,a,r,d;var l=o.city,c=o.line1,h=o.line2,f=o.name,u=o.postal_code,b=o.state;return{city:((t=s.city)===null||t===void 0?void 0:t[l])||l,line1:((n=s.line1)===null||n===void 0?void 0:n[c])||c,line2:((i=s.line2)===null||i===void 0?void 0:i[h])||h,name:((a=s.name)===null||a===void 0?void 0:a[f])||f,postal_code:((r=s.postal_code)===null||r===void 0?void 0:r[u])||u,state:((d=s.state)===null||d===void 0?void 0:d[b])||b}};this.continueClickHandler=function(){return __awaiter(t,void 0,void 0,(function(){var e,o,s,t,n,i,a,r,d,l,c,h,u;return __generator(this,(function(b){this.continueLoading=true;t=this.billingAddress?this.getTranslatedAddress({currentAddress:this.billingAddress,translatedAddress:this.translatedBillingAddressState}):null;n=this.getTranslatedAddress({currentAddress:this.shippingAddress,translatedAddress:this.translatedShippingAddressState});i=f(Object.assign(Object.assign({},n),{country:this.shippingAddress.country}));a=t&&this.billingAddress&&f(Object.assign(Object.assign({},t),{country:this.billingAddress.country}));r=!!Object.keys(i).length;d=!!a&&!!Object.keys(a).length;if(r||d){l=(e=this.el.shadowRoot)===null||e===void 0?void 0:e.querySelectorAll("zonos-address-form");c=l===null||l===void 0?void 0:l[0];h=l===null||l===void 0?void 0:l[1];u=((o=c===null||c===void 0?void 0:c.shadowRoot)===null||o===void 0?void 0:o.querySelector(".has-error"))||((s=h===null||h===void 0?void 0:h.shadowRoot)===null||s===void 0?void 0:s.querySelector(".has-error"));if(u){u.scrollIntoView({behavior:"smooth",block:"center"})}this.continueLoading=false;return[2]}this.continueClicked.emit({billingAddress:t,shippingAddress:n});return[2]}))}))};this.buildTranslateAddressState=function(e){var o,s,t,n,i,a;var r=e.currentAddress,d=e.translatedAddress;var l=r.city,c=r.line1,h=r.line2,f=r.name,u=r.postal_code,b=r.state;return{city:(o={},o[l]=d.city,o),line1:(s={},s[c]=d.line1,s),line2:(t={},t[h]=d.line2,t),name:(n={},n[f]=d.name,n),postal_code:(i={},i[u]=d.postal_code,i),state:(a={},a[b]=d.state,a)}};this.continueLoading=false;this.dialogLoading=undefined;this.dialogOpen=false;this.submitBtnType=undefined;this.submitBtnColor=undefined;this.isMobile=false;this.shippingAddress=undefined;this.billingAddress=undefined;this.translatedShippingAddress=undefined;this.translatedBillingAddress=undefined;this.showErrorBanner=false;this.translatedShippingAddressState={};this.translatedBillingAddressState={}}e.prototype.watchTranslatedShippingAddress=function(){this.translatedShippingAddressState=this.translatedShippingAddress};e.prototype.watchTranslatedBillingAddress=function(){this.translatedBillingAddressState=this.translatedBillingAddress};e.prototype.componentWillLoad=function(){this.watchTranslatedBillingAddress();this.watchTranslatedShippingAddress()};e.prototype.render=function(){var e=this;var o=this.submitBtnColor||u.appearance.colorSecondary;var s=o==="#ffffff"?"outline":this.submitBtnType||"standard";var i=this.billingAddress;var a=this.shippingAddress;return t(n,{key:"655845cef04f4af526b1a1c4e49243c4f2b4c7f6",class:p(["zonos--address-update-dialog zonos--elements",this.isMobile&&"mobile"])},t("zonos-dialog",{key:"eab429bb78ce6f05ba463d8748d7edd5499402fa",isLoading:this.dialogLoading,mobile:this.isMobile,noBodyPadding:true,noBorder:true,noClickOutside:true,noCloseButton:true,onCloseDialog:function(){return e.closeUpdateDialog.emit()},open:this.dialogOpen,width:"568px"},t("div",{key:"08f0400e62addfcaffd91bf5200999d29bbd2da9",class:"zonos--body"},t("div",{key:"8699df5e2f823e19066fbb552ba2a66c127c05e9",class:"zonos--dialog-header"},t("div",{key:"92e0ff932dcdb0e5b59ea34b688d1ef8e31bfeb3",class:"zonos--dialog-title"},t("zonos-text",{key:"aaac3375526bddb319ce7c8f49bde30da7210264",type:"title"},d("Update your address")),t("zonos-button",{key:"66abf7b74045e68e84e631298504236d32ca9c4e",class:"zonos--close-button",icon:t("zonos-icon",{"aria-label":"Close checkout dialog",content:m}),noBackground:true,onClick:function(){return e.closeUpdateDialogHandler()}})),t("zonos-text",{key:"ffb3d8f169867d5f6dff269e1becd99c98c5a7da"},d("To ensure delivery all address details must be in Latin characters."))),t("div",{key:"2cb61f06ce174e2317870decfdd337c67c5cf128",class:"zonos--group"},t("zonos-text",{key:"a616c540984120b468e52bccfb380ea3974ced22",class:"zonos--what-you-entered",type:"semiBoldLabel"},d("What you entered")),t("div",{key:"6ac8f9c14472370c501af1b0d50bd8f8746b7694",class:"zonos--address-display-group"},t("zonos-address-display",{key:"ea2c67a7bba51c99f80be968e448beeffcf1f863",addressType:"shipping",currentAddress:a}),i&&t("zonos-address-display",{key:"7ea1683dc04a292810e04ed6550d86086f25186f",addressType:"billing",currentAddress:i})),t("div",{key:"4d1cd9096943518b8b4e267608a5e1542befb6a9",class:"zonos--address-form-section"},t("zonos-text",{key:"e4184a2cc618d26d43979fa8cfe06070cf8b5af8",type:"semiBoldLabel"},d("Translated address")),t("zonos-address-form",{key:"c55d9d3c658565ceb7c7b879f444e3937b9f7ad6",addressType:"shipping",class:"zonos--shipping-address-form",currentAddress:a,onAddressChange:function(o){var s=o.detail;e.translatedShippingAddressState=e.buildTranslateAddressState({currentAddress:a,translatedAddress:s})},translatedAddress:this.translatedShippingAddressState}),i&&t("zonos-address-form",{key:"c3facc295b1322bb00baa6081f343dcea4f10777",addressType:"billing",class:"zonos--billing-address-form",currentAddress:i,onAddressChange:function(o){var s=o.detail;e.translatedBillingAddressState=e.buildTranslateAddressState({currentAddress:i,translatedAddress:s})},translatedAddress:this.translatedBillingAddressState}))),t("div",{key:"1c89c9604ba0dece40275fcfac97e7f93706b430",class:"zonos--group-btn"},t("div",{key:"e47d393940b094b4e123864e4070daa87f0616f0",class:"zonos--button-wrapper"},t("zonos-button",{key:"216b7afe268a4acd6bb8a76b7f5a32dc09bdd4f6",class:"zonos--cancel-btn",onClick:function(){return e.closeUpdateDialogHandler()},variant:"subtle"},d("Cancel")),t("zonos-button",{key:"acbacb92cedb325b46843d8f3aff13f4e7c86ab5",backgroundColor:this.submitBtnColor,class:"zonos--update-btn",loading:this.continueLoading,onClick:function(){return e.continueClickHandler()},size:"sm",variant:s},d("Update address")))))))};Object.defineProperty(e.prototype,"el",{get:function(){return i(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{translatedShippingAddress:["watchTranslatedShippingAddress"],translatedBillingAddress:["watchTranslatedBillingAddress"]}},enumerable:false,configurable:true});return e}());L.style=O;var E=["blue","cyan","green","orange","purple","red","gray","glass"];var B=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex;cursor:pointer}:host label{display:-ms-inline-flexbox;display:inline-flex;position:relative;gap:8px;-ms-flex-align:center;align-items:center}:host label.disabled{cursor:not-allowed;opacity:0.6}:host input[type=checkbox]{opacity:0;position:absolute;left:0;width:0;height:0;top:0;z-index:-99999}:host svg{opacity:0}:host .checkmark-container{height:var(--size);width:var(--size);background-color:transparent;border:1.5px solid var(--zonos-elements-gray-400);position:relative;border-radius:var(--border-radius, var(--zonos-elements-radius-4))}:host .checkmark{opacity:0;position:absolute;top:-1.5px;left:-1.5px;right:-1.5px;bottom:-1.5px;width:calc(100% + 3px);-webkit-transition:0.3s all cubic-bezier(0.175, 0.885, 0.32, 1.275);transition:0.3s all cubic-bezier(0.175, 0.885, 0.32, 1.275);-webkit-transform:scale(0.4);transform:scale(0.4);background-color:var(--background-color);border-radius:var(--border-radius, var(--zonos-elements-radius-4))}:host input[type=checkbox]:checked~.checkmark-container .checkmark{opacity:1;-webkit-transform:scale(1);transform:scale(1)}";var S=B;var T=e("zonos_checkbox",function(){function e(e){o(this,e);this.checkboxSelected=s(this,"checkboxSelected",7);this.backgroundColor="blue";this.label=undefined;this.isChecked=false;this.isDisabled=false;this.size=12;this.fontSize="base";this.borderStyle=undefined}e.prototype.onClick=function(){if(this.isDisabled){return}this.checkboxSelected.emit(!this.isChecked)};e.prototype.render=function(){var e=this;var o=E.includes(this.backgroundColor);var s=o?"var(--zonos-elements-".concat(this.backgroundColor,"-600)"):this.backgroundColor;var i=o?"var(--zonos-elements-".concat(this.backgroundColor,"-200)"):!z(s)?"var(--zonos-elements-gray-800)":"var(--zonos-elements-gray-0)";var a=v({customRoundRadius:"4px",overrideBorderStyle:this.borderStyle});return t(n,{key:"bf51dd642e88096e874d78023a29dd68239e8d3a",class:p(["zonos--elements zonos--checkbox"]),style:{"--background-color":s,"--border-radius":a,"--font-family":b(),"--size":"".concat(this.size,"px")}},t("label",{key:"3598c9f21285304499aaafbab5226d619ecf4e69",class:p([this.isDisabled&&"disabled"])},t("input",{key:"277507f643404e6e44191c2d715b70f38fc6af85",checked:this.isChecked,disabled:this.isDisabled,hidden:true,onChange:function(o){e.checkboxSelected.emit(o.target.checked)},type:"checkbox"}),t("span",{key:"3f0fd0d458e8cf660fa883ceaa241e3397829548",class:"checkmark-container"},t("svg",{key:"0d654744bea5b5696ddcf3778a155fb622022f1e",class:"checkmark",color:i,fill:"none",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},t("path",{key:"cc19837ee088feb7053fdaeaea0d1213cbc60775","clip-rule":"evenodd",d:"M17.456 7.404a.75.75 0 0 1 .14 1.052l-6.5 8.5a.75.75 0 0 1-1.126.074l-4-4a.75.75 0 0 1 1.06-1.06l3.395 3.394 5.98-7.82a.75.75 0 0 1 1.05-.14Z",fill:"currentColor","fill-rule":"evenodd"}))),this.label&&t("zonos-text",{key:"cb85d59651f67a33126d37c3ebfb1e8a91b457fe",size:this.fontSize},this.label)))};return e}());T.style=S;var V=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{-webkit-transition:all 0.3s ease-in-out;transition:all 0.3s ease-in-out;overflow:hidden}:host div{position:relative}:host iframe{width:0;height:100%;position:absolute;top:0;border:0}";var D=V;var P=e("zonos_collapse",function(){function e(e){o(this,e);this.collapsed=false;this.collapseSize=0;this.height=this.el.scrollHeight;this.iframe=null}e.prototype.getElementHeight=function(){var e="".concat(this.height,"px");var o="".concat(this.collapseSize,"px");return this.collapsed?o:e};e.prototype.componentDidLoad=function(){this.height=this.el.scrollHeight};e.prototype.componentDidRender=function(){var e=this;var o,s,t;this.iframe=((o=this.el.shadowRoot)===null||o===void 0?void 0:o.querySelector("iframe"))||null;(t=(s=this.iframe)===null||s===void 0?void 0:s.contentWindow)===null||t===void 0?void 0:t.addEventListener("resize",(function(){if(!e.iframe){return}e.height=parseFloat(getComputedStyle(e.iframe).height)}))};e.prototype.render=function(){var e=this;if(!this.collapsed){setTimeout((function(){if(!e.collapsed){e.el.style.overflow="visible"}}),300)}else{this.el.style.overflow="hidden"}return t(n,{key:"7cc2167ab3dab1a975d141f3c58d3c5982c1645a",class:"zonos--elements zonos--collapse",style:{"--font-family":b(),height:this.getElementHeight()}},t("div",{key:"1b791702f95066643ac82402a9fcff19b0fcc706"},t("iframe",{key:"08f678a4ce92f5600c584e329e3039bc4588ff3a",class:"height-change-listener",tabindex:"-1",title:"collapse-height-change-listener"}),t("slot",{key:"83119f9ba9764c46fa7d1dd7b4c0b08c49033607"})))};Object.defineProperty(e.prototype,"el",{get:function(){return i(this)},enumerable:false,configurable:true});return e}());P.style=D;var M='<svg xmlns="https://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="#C5C6CA" fill-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" clip-rule="evenodd"/><path fill="#4D505A" fill-rule="evenodd" d="M8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" clip-rule="evenodd"/></svg>';var N=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--backdrop,:host .zonos--dialog-layout{opacity:0;z-index:-999;visibility:hidden;-webkit-transition:0.3s all ease;transition:0.3s all ease}:host .zonos--backdrop{width:100vw;height:100vh;left:0;top:0;background:var(--zonos-elements-backdrop-color);position:fixed}:host .zonos--loading{position:absolute;left:0;right:0;bottom:0;top:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;z-index:2147483009;background:var(--zonos-elements-gray-0);border-radius:var(--border-radius, var(--zonos-elements-radius-10))}:host .zonos--dialog-layout{width:100vw;height:100vh;left:0;top:0;position:fixed;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;color:var(--zonos-elements-text-color);visibility:hidden}:host .zonos--dialog{position:relative;z-index:2147483008;background:var(--zonos-elements-gray-0);max-width:90vw;max-height:90vh;min-height:var(--min-height, auto);height:var(--height, auto);width:var(--width, auto);border-radius:var(--border-radius, var(--zonos-elements-radius-10));outline:none;-webkit-box-shadow:var(--zonos-elements-v3-shadow-xxl);box-shadow:var(--zonos-elements-v3-shadow-xxl);border:var(--zonos-elements-border);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host .zonos--header{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;padding:16px 24px}:host .zonos--header .-zonos-stencil-library--header-text{-ms-flex-positive:1;flex-grow:1}:host .zonos--header .zonos--close-button{width:var(--zonos-elements-size-md);height:var(--zonos-elements-size-md);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;cursor:pointer;border-radius:var(--zonos-elements-radius-10);-ms-flex-item-align:start;align-self:flex-start}:host .zonos--header .zonos--close-button:hover{background:var(--zonos-elements-hover-color)}:host .zonos--body{padding:8px 24px;max-height:100%;height:100%;overflow:auto}:host .zonos--body.zonos--no-body-padding{padding:0}:host .zonos--footer{padding:16px 24px}:host(.open) .zonos--dialog-layout,:host(.open) .zonos--backdrop{visibility:visible}:host(.open) .zonos--backdrop{z-index:2147483008;opacity:0.65}:host(.open) .zonos--dialog-layout{opacity:1;z-index:2147483009;-webkit-transform:scale(1);transform:scale(1)}:host(.no-border) .zonos--dialog{border:none}:host(.mobile) .zonos--dialog{max-width:100vw;max-height:100vh;height:100%;width:100%;border-radius:0;-webkit-box-shadow:none;box-shadow:none;border:none}";var U=N;var Z=e("zonos_dialog",function(){function e(e){var t=this;o(this,e);this.closeDialog=s(this,"closeDialog",3);this.isMobileMode=function(){return t.mobile||window.innerWidth<=768};this.closeButtonHandler=function(){if(!t.open){return}t.closeDialog.emit()};this.clickOutsideDialogHandler=function(e){if(e.target===e.currentTarget&&!t.noClickOutside){t.closeDialog.emit()}};this.open=false;this.headerText="";this.width="460px";this.height=undefined;this.minHeight=undefined;this.noHeader=false;this.noBodyPadding=false;this.noBorder=false;this.borderStyle=undefined;this.noCloseButton=false;this.noClickOutside=false;this.mobile=false;this.isLoading=true;this.isMobile=false}e.prototype.handleWindowResize=function(){this.isMobile=this.isMobileMode()};e.prototype.handleKeyDown=function(e){if(e.key==="Escape"){this.closeButtonHandler()}};e.prototype.componentDidLoad=function(){this.isMobile=this.isMobileMode()};e.prototype.render=function(){if(this.open){document.body.style.overflow="hidden"}else{document.body.style.overflow="auto"}var e=v({overrideBorderStyle:this.borderStyle});return t(n,{key:"03735385e07c7f6c8a87df42ad95f8c9d9533668",class:p(["zonos--elements",this.open&&"open",this.isLoading&&"is-loading",this.noBorder&&"no-border",this.isMobile&&"mobile"]),style:{"--border-radius":e,"--font-family":b(),"--height":this.height||"initial","--min-height":this.minHeight||"500px","--width":this.width}},t("div",{key:"da5d599e1a247f7e3364e6f5c9b2eae3db9539f5",class:"zonos--backdrop"}),t("div",{key:"cda1a996d9521c2e0b307f7a03ca3ee3d4915b8d",class:"zonos--dialog-layout",inert:!this.open,onClick:this.clickOutsideDialogHandler},t("div",{key:"471d8a069d4f580233bdb3e9e971efdb268ef57d",class:"zonos--dialog"},this.isLoading&&t("div",{key:"57220007aabcaef133c2c0782fa238cc43d63964",class:"zonos--loading"},t("zonos-spinner",{key:"0298b754341abd61ec07706128d05df5332f915d",size:30})),(this.headerText||!this.noCloseButton)&&t("div",{key:"5103dbc1c7593a8042505f767d8290825f9d10e7",class:"zonos--header"},this.headerText&&t("h3",{key:"a2d9cd4c8cb359aa64cf104a172ca960068c20a0",class:"zonos--header-text"},this.headerText),!this.noCloseButton&&t("zonos-button",{key:"de9bf8a949344d19fcb8bfb496719282553be194",class:"zonos--close-button",icon:t("zonos-icon",{"aria-label":"Close dialog",content:M}),noBackground:true,onClick:this.closeButtonHandler,variant:"subtle"})),t("div",{key:"1ec2cdca0f186cd0b28602580022ed0cb4b0eec9",class:p(["zonos--body",this.noBodyPadding&&"zonos--no-body-padding"])},t("slot",{key:"5071d921f48bf792a951a390d83b121e32771668"})),t("slot",{key:"c1818ac301afc845f5b14fd0f2ac9a1fd3a27b99",name:"dialog-footer"}))))};Object.defineProperty(e,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return e}());Z.style=U;var F=".sc-zonos-link-authentication-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-link-authentication-h *.sc-zonos-link-authentication{font-family:var(--font-family, Inter), Inter}.sc-zonos-link-authentication-h img.sc-zonos-link-authentication{max-width:100%}.sc-zonos-link-authentication-h dl.sc-zonos-link-authentication,.sc-zonos-link-authentication-h dd.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h1.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h2.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h3.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h4.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h5.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h6.sc-zonos-link-authentication,.sc-zonos-link-authentication-h hr.sc-zonos-link-authentication,.sc-zonos-link-authentication-h figure.sc-zonos-link-authentication,.sc-zonos-link-authentication-h p.sc-zonos-link-authentication,.sc-zonos-link-authentication-h pre.sc-zonos-link-authentication{margin:0}.sc-zonos-link-authentication-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-link-authentication-h .zonos--title.sc-zonos-link-authentication{margin-bottom:16px}";var H=F;var R=e("zonos_link_authentication",function(){function e(e){o(this,e);this.titleText=undefined;this.defaultEmail=null;this.stripe=a.stripe}e.prototype.watchInitStripe=function(){if(!this.stripe||!a.stripeElements){return}var e=this.defaultEmail?{email:this.defaultEmail}:undefined;var o=a.stripeLinkElement||a.stripeElements.create("linkAuthentication",{defaultValues:e||undefined});var s=this.el.querySelector(".zonos--link-authentication-component");if(!s){c("Cannot find container element for linkAuthenticationElement");return}o.mount(s);o.on("change",(function(e){a.stripeLinkEventData=e}));a.stripeLinkElement=o};e.prototype.componentDidLoad=function(){this.watchInitStripe()};e.prototype.render=function(){return t(n,{key:"f0b26abf99ef99c6665dabdddebc9ff086b6816c",class:"zonos--link-authentication zonos--elements"},t("zonos-text",{key:"898dbdffac06fe2a68af90610a22044bb72391ce",class:"zonos--title",type:"semiBoldLabel"},this.titleText),t("div",{key:"e2ec9abb0cf76a39a1262e1366e375dd898450cd",class:"zonos--link-authentication-component"}))};Object.defineProperty(e.prototype,"el",{get:function(){return i(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{stripe:["watchInitStripe"]}},enumerable:false,configurable:true});return e}());R.style=H}}}));
1
+ var __awaiter=this&&this.__awaiter||function(e,o,s,t){function n(e){return e instanceof s?e:new s((function(o){o(e)}))}return new(s||(s=Promise))((function(s,i){function a(e){try{d(t.next(e))}catch(e){i(e)}}function r(e){try{d(t["throw"](e))}catch(e){i(e)}}function d(e){e.done?s(e.value):n(e.value).then(a,r)}d((t=t.apply(e,o||[])).next())}))};var __generator=this&&this.__generator||function(e,o){var s={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},t,n,i,a;return a={next:r(0),throw:r(1),return:r(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function r(e){return function(o){return d([e,o])}}function d(r){if(t)throw new TypeError("Generator is already executing.");while(a&&(a=0,r[0]&&(s=0)),s)try{if(t=1,n&&(i=r[0]&2?n["return"]:r[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,r[1])).done)return i;if(n=0,i)r=[r[0]&2,i.value];switch(r[0]){case 0:case 1:i=r;break;case 4:s.label++;return{value:r[1],done:false};case 5:s.label++;n=r[1];r=[0];continue;case 7:r=s.ops.pop();s.trys.pop();continue;default:if(!(i=s.trys,i=i.length>0&&i[i.length-1])&&(r[0]===6||r[0]===2)){s=0;continue}if(r[0]===3&&(!i||r[1]>i[0]&&r[1]<i[3])){s.label=r[1];break}if(r[0]===6&&s.label<i[1]){s.label=i[1];i=r;break}if(i&&s.label<i[2]){s.label=i[2];s.ops.push(r);break}if(i[2])s.ops.pop();s.trys.pop();continue}r=o.call(e,s)}catch(e){r=[6,e];n=0}finally{t=i=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};System.register(["./p-fd061229.system.js","./p-7c0b5743.system.js","./p-aed0098c.system.js","./p-e89c2805.system.js","./p-2670438c.system.js","./p-b74ff880.system.js","./p-23e7c655.system.js","./p-2770ba48.system.js","./p-455b7545.system.js","./p-91462d96.system.js"],(function(e){"use strict";var o,s,t,n,i,a,r,d,l,c,h,f,u,b,p,m,v,z;return{setters:[function(e){o=e.r;s=e.c;t=e.h;n=e.H;i=e.d},function(e){a=e.j;r=e.l;d=e.t},function(e){l=e.i},function(e){c=e.a},function(e){h=e.i;f=e.c},function(e){u=e.z;b=e.d},function(e){p=e.c},function(e){m=e.R},function(e){v=e.g},function(e){z=e.i}],execute:function(){var y=".sc-zonos-address-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-address-h *.sc-zonos-address{font-family:var(--font-family, Inter), Inter}.sc-zonos-address-h img.sc-zonos-address{max-width:100%}.sc-zonos-address-h dl.sc-zonos-address,.sc-zonos-address-h dd.sc-zonos-address,.sc-zonos-address-h h1.sc-zonos-address,.sc-zonos-address-h h2.sc-zonos-address,.sc-zonos-address-h h3.sc-zonos-address,.sc-zonos-address-h h4.sc-zonos-address,.sc-zonos-address-h h5.sc-zonos-address,.sc-zonos-address-h h6.sc-zonos-address,.sc-zonos-address-h hr.sc-zonos-address,.sc-zonos-address-h figure.sc-zonos-address,.sc-zonos-address-h p.sc-zonos-address,.sc-zonos-address-h pre.sc-zonos-address{margin:0}.sc-zonos-address-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-address-h .zonos--title.sc-zonos-address{margin-bottom:16px}.sc-zonos-address-h zonos-banner.sc-zonos-address{margin-top:8px}";var g=y;var x=e("zonos_address",function(){function e(e){o(this,e);this.invalidCharacters=s(this,"invalidCharacters",7);this.type=undefined;this.titleText=undefined;this.defaultAddress=null;this.stripe=window.Zonos.stripe;this.isDirtyAddress=false}e.prototype.getStripeAddressInstance=function(){if(this.type==="billing"){return{stripeAddressElement:a.stripeBillingAddressElement,stripeAddressEventData:a.stripeBillingAddressEventData,stripeElements:a.stripeElementsForBillingAddress}}return{stripeAddressElement:a.stripeAddressElement,stripeAddressEventData:a.stripeAddressEventData,stripeElements:a.stripeElements}};e.prototype.updateAddressEventData=function(e){var o=e.event,s=e.type;switch(s){case"billing":a.stripeBillingAddressEventData=o;break;default:a.stripeAddressEventData=o;break}};e.prototype.updateAddressElement=function(e){var o=e.stripeAddressElement,s=e.type;if(s==="shipping"){a.stripeAddressElement=o;return}a.stripeBillingAddressElement=o};e.prototype.watchInitStripe=function(){return __awaiter(this,void 0,void 0,(function(){var e,o,s,t,n,i,a,d,h;var f=this;return __generator(this,(function(u){this.stripe=window.Zonos.stripe;s=this.getStripeAddressInstance(),t=s.stripeAddressEventData,n=s.stripeElements;if(!this.stripe||!n){c("Stripe is not initialized. Couldn't load stripe element.");return[2]}i=(e=this.defaultAddress)===null||e===void 0?void 0:e.phone;if(!i){(o=this.defaultAddress)===null||o===void 0?true:delete o.phone}a=r.shippingZoneCountries;d=a?Object.values(a).map((function(e){return e.code})):[];h=n.create("address",{allowedCountries:this.type==="shipping"?d:[],contacts:this.defaultAddress&&!t?[this.defaultAddress]:[],defaultValues:{address:Object.assign(Object.assign({},t===null||t===void 0?void 0:t.value.address),{country:(t===null||t===void 0?void 0:t.value.address.country)||r.selectedCountryCode||"AL"}),firstName:t===null||t===void 0?void 0:t.value.firstName,lastName:t===null||t===void 0?void 0:t.value.lastName,phone:t===null||t===void 0?void 0:t.value.phone},display:{name:"split"},fields:{phone:"always"},mode:this.type,validation:{phone:{required:"always"}}});h.mount(this.el.querySelector(".zonos--address-component"));h.on("change",(function(e){var o=e.value;if(!f.isDirtyAddress&&o.address.line1.length>=3){f.isDirtyAddress=true;setTimeout((function(){if(l()){f.el.scrollIntoView({behavior:"smooth",block:"end"})}else{var e=f.type==="shipping"?100:600;var o=f.el.closest(".zonos--group");var s=f.el.getBoundingClientRect().top+e;o===null||o===void 0?void 0:o.scrollTo({behavior:"smooth",top:s})}}),600)}f.updateAddressEventData({event:Object.assign(Object.assign({},e),{elementMode:f.type,elementType:"address",value:Object.assign(Object.assign({},o),{firstName:o.firstName||o.name.split(" ")[0],lastName:o.lastName||o.name.split(" ")[1]})}),type:f.type})}));this.updateAddressElement({stripeAddressElement:h,type:this.type});return[2]}))}))};e.prototype.disconnectedCallback=function(){var e=this.getStripeAddressInstance().stripeAddressElement;e===null||e===void 0?void 0:e.destroy()};e.prototype.componentDidLoad=function(){var e=this.getStripeAddressInstance().stripeAddressEventData;this.isDirtyAddress=!!e&&e.value.address.line1.length>0;void this.watchInitStripe()};e.prototype.render=function(){return t(n,{key:"2cecb49ed22bd0d5ce22c4f2110b37ecf7935cca",class:"zonos--address zonos--elements"},t("zonos-text",{key:"101635210ab6cb3b9a44b47eec101187d1c3a4ac",class:"zonos--title",type:"semiBoldLabel"},this.titleText),t("div",{key:"049f2b86986471d45bd413813307ec489d9f1993",class:"zonos--address-component"}))};Object.defineProperty(e.prototype,"el",{get:function(){return i(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{stripe:["watchInitStripe"]}},enumerable:false,configurable:true});return e}());x.style=g;var k=':host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--title{margin-bottom:12px}:host .zonos--address-group{display:-ms-flexbox;display:flex;gap:4px;-ms-flex-direction:column;flex-direction:column}:host .zonos--address-line{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .zonos--address-line zonos-text+zonos-text::before{content:", ";color:var(--zonos-elements-gray-1200);margin-right:4px}:host .zonos--country-flag{width:20px;height:14px;border-radius:2px;margin:1px;position:relative;overflow:hidden;-webkit-box-shadow:var(--zonos-elements-v3-shadow-medium);box-shadow:var(--zonos-elements-v3-shadow-medium);margin-right:8px;z-index:10;justify-self:center}';var w=k;var j=e("zonos_address_display",function(){function e(e){o(this,e);this.currentAddress=undefined;this.addressType=undefined}e.prototype.render=function(){var e;var o=this.currentAddress,s=o.city,i=o.country,a=o.email,l=o.line1,c=o.line2,f=o.name,u=o.phone,b=o.postal_code,p=o.state;var m=(e=r.shippingZoneCountries)===null||e===void 0?void 0:e[i];var v=function(e){var o=e.bold,s=e.content;var n=h(s)?"red-600":"gray-1200";return t("zonos-text",{textColor:n,type:o?"boldLabel":"body"},s)};return t(n,{class:"zonos--address-form zonos--elements"},t("div",{class:"zonos--title"},t("zonos-text",{textColor:"gray-700",type:"smallHeader"},this.addressType==="shipping"?d("Shipping"):d("Billing"))),t("div",{class:"zonos--address-group"},f&&t("div",{class:"zonos--address-line"},v({bold:true,content:f})),a&&t("div",{class:"zonos--address-line"},v({content:a})),u&&t("div",{class:"zonos--address-line"},v({content:u})),l&&t("div",{class:"zonos--address-line"},v({content:l})),c&&t("div",{class:"zonos--address-line"},v({content:c})),t("div",{class:"zonos--address-line"},s&&v({content:s}),p&&v({content:p}),b&&v({content:b})),m&&t("div",{class:"zonos--address-line"},t("zonos-country-flag",{class:"zonos--country-flag",countryCode:m.code})," ",v({content:m.displayName}))))};return e}());j.style=w;var C=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--title{margin-bottom:20px}:host .zonos--address-group{display:-ms-flexbox;display:flex;gap:20px;-ms-flex-direction:column;flex-direction:column;margin:1px}:host .zonos--contact{display:-ms-flexbox;display:flex;gap:8px;-ms-flex-direction:column;flex-direction:column}:host .zonos--address-row{display:-ms-flexbox;display:flex;gap:8px}:host .zonos--address-row>*{-ms-flex:1;flex:1}:host .zonos--address{display:-ms-flexbox;display:flex;gap:8px;-ms-flex-direction:column;flex-direction:column}";var I=C;var A=e("zonos_address_form",function(){function e(e){var t=this;o(this,e);this.addressChange=s(this,"addressChange",7);this.onInputChange=function(e){var o;var s=e.key,n=e.value;t.addressChange.emit(Object.assign(Object.assign({},t.localAddress),(o={},o[s]=n,o)))};this.currentAddress=undefined;this.translatedAddress=undefined;this.addressType=undefined;this.localAddress=this.currentAddress}e.prototype.watchCurrentAddress=function(){var e,o,s,t,n,i;var a=this.currentAddress,r=a.city,d=a.line1,l=a.line2,c=a.name,h=a.postal_code,f=a.state;this.localAddress=Object.assign(Object.assign({},this.currentAddress),{city:((e=this.translatedAddress.city)===null||e===void 0?void 0:e[r])||r,line1:((o=this.translatedAddress.line1)===null||o===void 0?void 0:o[d])||d,line2:((s=this.translatedAddress.line2)===null||s===void 0?void 0:s[l])||l,name:((t=this.translatedAddress.name)===null||t===void 0?void 0:t[c])||c,postal_code:((n=this.translatedAddress.postal_code)===null||n===void 0?void 0:n[h])||h,state:((i=this.translatedAddress.state)===null||i===void 0?void 0:i[f])||f})};e.prototype.componentWillLoad=function(){this.watchCurrentAddress()};e.prototype.render=function(){var e=this;var o=this.localAddress,s=o.city,i=o.country,a=o.line1,r=o.line2,l=o.name,c=o.phone,f=o.postal_code,u=o.state;var b=l.split(" ")[0]||"";var p=l.split(" ").slice(1).join(" ")||"";return t(n,{key:"8b578737e33203a23563be7e9be0778deec99bbf",class:"zonos--address-form zonos--elements"},t("div",{key:"793675a1348547bf3f781788956befe325191011",class:"zonos--title"},t("zonos-text",{key:"13de35cb0a7c98a48342e3fb86ae3ade9f5b88d9",textColor:"gray-700",type:"smallHeader"},this.addressType==="shipping"?d("Shipping"):d("Billing"))),t("div",{key:"2c5de5b5283fb99ee5f8b61d7a217177986fc2db",class:"zonos--address-group"},t("div",{key:"23bf3c893071000d5995a5f175867bab11929193",class:"zonos--contact"},t("zonos-text",{key:"7cdfe2a84ebad89ba5b16498d75def99cf392384",type:"label"},d("Contact")),t("zonos-input",{key:"1c39c38767fd306c5eb1164cdc989b8291209cf0",class:"zonos--form-email",inputLabel:d("Email"),inputValue:this.currentAddress.email,isDisabled:true}),t("div",{key:"cbdf61217125e22b1a6cec9a340ef0aca2c75670",class:"zonos--name zonos--address-row"},t("zonos-input",{key:"360c99e7b2c6caa64580d5768b5bb53368927275",class:"zonos--form-first-name",inputLabel:d("First name"),inputValue:b,isError:h(b),onInputChange:function(o){return e.onInputChange({key:"name",value:"".concat(o.detail," ").concat(p)})}}),t("zonos-input",{key:"8ce5fa5c15c6f7928339ea10009ce0e68954a91f",class:"zonos--form-last-name",inputLabel:d("Last name"),inputValue:p,isError:h(p),onInputChange:function(o){return e.onInputChange({key:"name",value:"".concat(b," ").concat(o.detail)})}}))),t("div",{key:"7b4fa2d3baa6cb257e7688e5ba6777123898b3fd",class:"zonos--address"},t("zonos-text",{key:"9d5782331b2642755a755aeb7f98c9f4d87f9a20",type:"label"},d("Address")),t("zonos-input",{key:"a622025924ca86bdbf1d3c04b79e6dee172b4c42",class:"zonos--form-country",inputLabel:d("Country"),inputValue:i,isDisabled:true}),t("zonos-input",{key:"f99b3a74db09ab5730878e80705b9aeac76bf800",class:"zonos--form-line1",inputLabel:d("Address line 1"),inputValue:a,isError:h(a),onInputChange:function(o){return e.onInputChange({key:"line1",value:o.detail})}}),t("zonos-input",{key:"5d16aefa45a78045c87d166aaaec0255606e455e",class:"zonos--form-line2",inputLabel:d("Address line 2"),inputValue:r,isError:h(r),onInputChange:function(o){return e.onInputChange({key:"line2",value:o.detail})}}),t("div",{key:"dc166be9381142835d72e731cb38a718522a068a",class:"zonos--address-row"},t("zonos-input",{key:"4f1a98f9d10ce0cff3ef18a3037a12382552b31d",class:"zonos--form-city",inputLabel:d("City"),inputValue:s,isError:h(s),onInputChange:function(o){return e.onInputChange({key:"city",value:o.detail})}}),t("zonos-input",{key:"d4f97900b5fe2e1619950a52d1d1f716a8bc19ff",class:"zonos--form-state",inputLabel:d("State/Province"),inputValue:u,isError:h(u),onInputChange:function(o){return e.onInputChange({key:"state",value:o.detail})}})),t("zonos-input",{key:"cf1eb0ca5cd15c8412a2e1246aaf2e39361dc733",class:"zonos--form-postal-code",inputLabel:d("Postal code"),inputValue:f,isError:h(f),onInputChange:function(o){return e.onInputChange({key:"postal_code",value:o.detail})}}),t("zonos-input",{key:"7421c82847eded6bdbcce49ef8196124d8e50c1d",class:"zonos--form-phone",inputLabel:d("Phone number"),inputValue:c,onInputChange:function(o){return e.onInputChange({key:"phone",value:o.detail})}}))))};Object.defineProperty(e,"watchers",{get:function(){return{translatedAddress:["watchCurrentAddress"]}},enumerable:false,configurable:true});return e}());A.style=I;var _=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--body{padding:0 24px;position:relative}:host .zonos--dialog-header{margin-bottom:32px;position:-webkit-sticky;position:sticky;padding-top:24px;top:0;z-index:11;background:var(--zonos-elements-gray-0)}:host .zonos--dialog-title{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;margin-bottom:12px}:host .zonos--group{overflow:auto;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:8px;-ms-scroll-chaining:none;overscroll-behavior:contain}:host .zonos--group::-webkit-scrollbar{width:10px}:host .zonos--group::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}:host .zonos--group::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}:host .zonos--group::-webkit-scrollbar-thumb:hover{background:#d6d6d6}:host .zonos--address-display-group{display:-ms-flexbox;display:flex;gap:8px;margin-bottom:20px}:host .zonos--address-display-group zonos-address-display{-ms-flex:1;flex:1}:host .zonos--what-you-entered{margin-bottom:8px}:host .zonos--address-form-section{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:24px}:host .zonos--group-btn{position:-webkit-sticky;position:sticky;padding:24px 0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-pack:end;justify-content:end;background:var(--zonos-elements-gray-0);z-index:11}:host .zonos--group-btn .zonos--button-wrapper{display:-ms-flexbox;display:flex;gap:8px}:host(.mobile) .zonos--button-wrapper{-ms-flex-direction:column;flex-direction:column;width:100%}:host(.mobile) .zonos--button-wrapper zonos-button{width:100%}:host(.mobile) .zonos--button-wrapper .zonos--cancel-btn{-ms-flex-order:2;order:2}:host(.mobile) .zonos--button-wrapper .zonos--update-btn{-ms-flex-order:1;order:1}";var O=_;var L=e("zonos_address_update_dialog",function(){function e(e){var t=this;o(this,e);this.closeUpdateDialog=s(this,"closeUpdateDialog",7);this.continueClicked=s(this,"continueClicked",7);this.closeUpdateDialogHandler=function(){t.closeUpdateDialog.emit()};this.getTranslatedAddress=function(e){var o=e.currentAddress,s=e.translatedAddress;var t,n,i,a,r,d;var l=o.city,c=o.line1,h=o.line2,f=o.name,u=o.postal_code,b=o.state;return{city:((t=s.city)===null||t===void 0?void 0:t[l])||l,line1:((n=s.line1)===null||n===void 0?void 0:n[c])||c,line2:((i=s.line2)===null||i===void 0?void 0:i[h])||h,name:((a=s.name)===null||a===void 0?void 0:a[f])||f,postal_code:((r=s.postal_code)===null||r===void 0?void 0:r[u])||u,state:((d=s.state)===null||d===void 0?void 0:d[b])||b}};this.continueClickHandler=function(){return __awaiter(t,void 0,void 0,(function(){var e,o,s,t,n,i,a,r,d,l,c,h,u;return __generator(this,(function(b){this.continueLoading=true;t=this.billingAddress?this.getTranslatedAddress({currentAddress:this.billingAddress,translatedAddress:this.translatedBillingAddressState}):null;n=this.getTranslatedAddress({currentAddress:this.shippingAddress,translatedAddress:this.translatedShippingAddressState});i=f(Object.assign(Object.assign({},n),{country:this.shippingAddress.country}));a=t&&this.billingAddress&&f(Object.assign(Object.assign({},t),{country:this.billingAddress.country}));r=!!Object.keys(i).length;d=!!a&&!!Object.keys(a).length;if(r||d){l=(e=this.el.shadowRoot)===null||e===void 0?void 0:e.querySelectorAll("zonos-address-form");c=l===null||l===void 0?void 0:l[0];h=l===null||l===void 0?void 0:l[1];u=((o=c===null||c===void 0?void 0:c.shadowRoot)===null||o===void 0?void 0:o.querySelector(".has-error"))||((s=h===null||h===void 0?void 0:h.shadowRoot)===null||s===void 0?void 0:s.querySelector(".has-error"));if(u){u.scrollIntoView({behavior:"smooth",block:"center"})}this.continueLoading=false;return[2]}this.continueClicked.emit({billingAddress:t,shippingAddress:n});return[2]}))}))};this.buildTranslateAddressState=function(e){var o,s,t,n,i,a;var r=e.currentAddress,d=e.translatedAddress;var l=r.city,c=r.line1,h=r.line2,f=r.name,u=r.postal_code,b=r.state;return{city:(o={},o[l]=d.city,o),line1:(s={},s[c]=d.line1,s),line2:(t={},t[h]=d.line2,t),name:(n={},n[f]=d.name,n),postal_code:(i={},i[u]=d.postal_code,i),state:(a={},a[b]=d.state,a)}};this.continueLoading=false;this.dialogLoading=undefined;this.dialogOpen=false;this.submitBtnType=undefined;this.submitBtnColor=undefined;this.isMobile=false;this.shippingAddress=undefined;this.billingAddress=undefined;this.translatedShippingAddress=undefined;this.translatedBillingAddress=undefined;this.showErrorBanner=false;this.translatedShippingAddressState={};this.translatedBillingAddressState={}}e.prototype.watchTranslatedShippingAddress=function(){this.translatedShippingAddressState=this.translatedShippingAddress};e.prototype.watchTranslatedBillingAddress=function(){this.translatedBillingAddressState=this.translatedBillingAddress};e.prototype.componentWillLoad=function(){this.watchTranslatedBillingAddress();this.watchTranslatedShippingAddress()};e.prototype.render=function(){var e=this;var o=this.submitBtnColor||u.appearance.colorSecondary;var s=o==="#ffffff"?"outline":this.submitBtnType||"standard";var i=this.billingAddress;var a=this.shippingAddress;return t(n,{key:"655845cef04f4af526b1a1c4e49243c4f2b4c7f6",class:p(["zonos--address-update-dialog zonos--elements",this.isMobile&&"mobile"])},t("zonos-dialog",{key:"eab429bb78ce6f05ba463d8748d7edd5499402fa",isLoading:this.dialogLoading,mobile:this.isMobile,noBodyPadding:true,noBorder:true,noClickOutside:true,noCloseButton:true,onCloseDialog:function(){return e.closeUpdateDialog.emit()},open:this.dialogOpen,width:"568px"},t("div",{key:"08f0400e62addfcaffd91bf5200999d29bbd2da9",class:"zonos--body"},t("div",{key:"8699df5e2f823e19066fbb552ba2a66c127c05e9",class:"zonos--dialog-header"},t("div",{key:"92e0ff932dcdb0e5b59ea34b688d1ef8e31bfeb3",class:"zonos--dialog-title"},t("zonos-text",{key:"aaac3375526bddb319ce7c8f49bde30da7210264",type:"title"},d("Update your address")),t("zonos-button",{key:"66abf7b74045e68e84e631298504236d32ca9c4e",class:"zonos--close-button",icon:t("zonos-icon",{"aria-label":"Close checkout dialog",content:m}),noBackground:true,onClick:function(){return e.closeUpdateDialogHandler()}})),t("zonos-text",{key:"ffb3d8f169867d5f6dff269e1becd99c98c5a7da"},d("To ensure delivery all address details must be in Latin characters."))),t("div",{key:"2cb61f06ce174e2317870decfdd337c67c5cf128",class:"zonos--group"},t("zonos-text",{key:"a616c540984120b468e52bccfb380ea3974ced22",class:"zonos--what-you-entered",type:"semiBoldLabel"},d("What you entered")),t("div",{key:"6ac8f9c14472370c501af1b0d50bd8f8746b7694",class:"zonos--address-display-group"},t("zonos-address-display",{key:"ea2c67a7bba51c99f80be968e448beeffcf1f863",addressType:"shipping",currentAddress:a}),i&&t("zonos-address-display",{key:"7ea1683dc04a292810e04ed6550d86086f25186f",addressType:"billing",currentAddress:i})),t("div",{key:"4d1cd9096943518b8b4e267608a5e1542befb6a9",class:"zonos--address-form-section"},t("zonos-text",{key:"e4184a2cc618d26d43979fa8cfe06070cf8b5af8",type:"semiBoldLabel"},d("Translated address")),t("zonos-address-form",{key:"c55d9d3c658565ceb7c7b879f444e3937b9f7ad6",addressType:"shipping",class:"zonos--shipping-address-form",currentAddress:a,onAddressChange:function(o){var s=o.detail;e.translatedShippingAddressState=e.buildTranslateAddressState({currentAddress:a,translatedAddress:s})},translatedAddress:this.translatedShippingAddressState}),i&&t("zonos-address-form",{key:"c3facc295b1322bb00baa6081f343dcea4f10777",addressType:"billing",class:"zonos--billing-address-form",currentAddress:i,onAddressChange:function(o){var s=o.detail;e.translatedBillingAddressState=e.buildTranslateAddressState({currentAddress:i,translatedAddress:s})},translatedAddress:this.translatedBillingAddressState}))),t("div",{key:"1c89c9604ba0dece40275fcfac97e7f93706b430",class:"zonos--group-btn"},t("div",{key:"e47d393940b094b4e123864e4070daa87f0616f0",class:"zonos--button-wrapper"},t("zonos-button",{key:"216b7afe268a4acd6bb8a76b7f5a32dc09bdd4f6",class:"zonos--cancel-btn",onClick:function(){return e.closeUpdateDialogHandler()},variant:"subtle"},d("Cancel")),t("zonos-button",{key:"acbacb92cedb325b46843d8f3aff13f4e7c86ab5",backgroundColor:this.submitBtnColor,class:"zonos--update-btn",loading:this.continueLoading,onClick:function(){return e.continueClickHandler()},size:"sm",variant:s},d("Update address")))))))};Object.defineProperty(e.prototype,"el",{get:function(){return i(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{translatedShippingAddress:["watchTranslatedShippingAddress"],translatedBillingAddress:["watchTranslatedBillingAddress"]}},enumerable:false,configurable:true});return e}());L.style=O;var E=["blue","cyan","green","orange","purple","red","gray","glass"];var B=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex;cursor:pointer}:host label{display:-ms-inline-flexbox;display:inline-flex;position:relative;gap:8px;-ms-flex-align:center;align-items:center}:host label.disabled{cursor:not-allowed;opacity:0.6}:host input[type=checkbox]{opacity:0;position:absolute;left:0;width:0;height:0;top:0;z-index:-99999}:host svg{opacity:0}:host .checkmark-container{height:var(--size);width:var(--size);background-color:transparent;border:1.5px solid var(--zonos-elements-gray-400);position:relative;border-radius:var(--border-radius, var(--zonos-elements-radius-4))}:host .checkmark{opacity:0;position:absolute;top:-1.5px;left:-1.5px;right:-1.5px;bottom:-1.5px;width:calc(100% + 3px);-webkit-transition:0.3s all cubic-bezier(0.175, 0.885, 0.32, 1.275);transition:0.3s all cubic-bezier(0.175, 0.885, 0.32, 1.275);-webkit-transform:scale(0.4);transform:scale(0.4);background-color:var(--background-color);border-radius:var(--border-radius, var(--zonos-elements-radius-4))}:host input[type=checkbox]:checked~.checkmark-container .checkmark{opacity:1;-webkit-transform:scale(1);transform:scale(1)}";var S=B;var T=e("zonos_checkbox",function(){function e(e){o(this,e);this.checkboxSelected=s(this,"checkboxSelected",7);this.backgroundColor="blue";this.label=undefined;this.isChecked=false;this.isDisabled=false;this.size=12;this.fontSize="base";this.borderStyle=undefined}e.prototype.onClick=function(){if(this.isDisabled){return}this.checkboxSelected.emit(!this.isChecked)};e.prototype.render=function(){var e=this;var o=E.includes(this.backgroundColor);var s=o?"var(--zonos-elements-".concat(this.backgroundColor,"-600)"):this.backgroundColor;var i=o?"var(--zonos-elements-".concat(this.backgroundColor,"-200)"):!z(s)?"var(--zonos-elements-gray-800)":"var(--zonos-elements-gray-0)";var a=v({customRoundRadius:"4px",overrideBorderStyle:this.borderStyle});return t(n,{key:"bf51dd642e88096e874d78023a29dd68239e8d3a",class:p(["zonos--elements zonos--checkbox"]),style:{"--background-color":s,"--border-radius":a,"--font-family":b(),"--size":"".concat(this.size,"px")}},t("label",{key:"3598c9f21285304499aaafbab5226d619ecf4e69",class:p([this.isDisabled&&"disabled"])},t("input",{key:"277507f643404e6e44191c2d715b70f38fc6af85",checked:this.isChecked,disabled:this.isDisabled,hidden:true,onChange:function(o){e.checkboxSelected.emit(o.target.checked)},type:"checkbox"}),t("span",{key:"3f0fd0d458e8cf660fa883ceaa241e3397829548",class:"checkmark-container"},t("svg",{key:"0d654744bea5b5696ddcf3778a155fb622022f1e",class:"checkmark",color:i,fill:"none",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},t("path",{key:"cc19837ee088feb7053fdaeaea0d1213cbc60775","clip-rule":"evenodd",d:"M17.456 7.404a.75.75 0 0 1 .14 1.052l-6.5 8.5a.75.75 0 0 1-1.126.074l-4-4a.75.75 0 0 1 1.06-1.06l3.395 3.394 5.98-7.82a.75.75 0 0 1 1.05-.14Z",fill:"currentColor","fill-rule":"evenodd"}))),this.label&&t("zonos-text",{key:"cb85d59651f67a33126d37c3ebfb1e8a91b457fe",size:this.fontSize},this.label)))};return e}());T.style=S;var V=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{-webkit-transition:all 0.3s ease-in-out;transition:all 0.3s ease-in-out;overflow:hidden}:host div{position:relative}:host iframe{width:0;height:100%;position:absolute;top:0;border:0}";var D=V;var P=e("zonos_collapse",function(){function e(e){o(this,e);this.collapsed=false;this.collapseSize=0;this.height=this.el.scrollHeight;this.iframe=null}e.prototype.getElementHeight=function(){var e="".concat(this.height,"px");var o="".concat(this.collapseSize,"px");return this.collapsed?o:e};e.prototype.componentDidLoad=function(){this.height=this.el.scrollHeight};e.prototype.componentDidRender=function(){var e=this;var o,s,t;this.iframe=((o=this.el.shadowRoot)===null||o===void 0?void 0:o.querySelector("iframe"))||null;(t=(s=this.iframe)===null||s===void 0?void 0:s.contentWindow)===null||t===void 0?void 0:t.addEventListener("resize",(function(){if(!e.iframe){return}e.height=parseFloat(getComputedStyle(e.iframe).height)}))};e.prototype.render=function(){var e=this;if(!this.collapsed){setTimeout((function(){if(!e.collapsed){e.el.style.overflow="visible"}}),300)}else{this.el.style.overflow="hidden"}return t(n,{key:"7cc2167ab3dab1a975d141f3c58d3c5982c1645a",class:"zonos--elements zonos--collapse",style:{"--font-family":b(),height:this.getElementHeight()}},t("div",{key:"1b791702f95066643ac82402a9fcff19b0fcc706"},t("iframe",{key:"08f678a4ce92f5600c584e329e3039bc4588ff3a",class:"height-change-listener",tabindex:"-1",title:"collapse-height-change-listener"}),t("slot",{key:"83119f9ba9764c46fa7d1dd7b4c0b08c49033607"})))};Object.defineProperty(e.prototype,"el",{get:function(){return i(this)},enumerable:false,configurable:true});return e}());P.style=D;var M='<svg xmlns="https://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="#C5C6CA" fill-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" clip-rule="evenodd"/><path fill="#4D505A" fill-rule="evenodd" d="M8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" clip-rule="evenodd"/></svg>';var N=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--backdrop,:host .zonos--dialog-layout{opacity:0;z-index:-999;visibility:hidden;-webkit-transition:0.3s all ease;transition:0.3s all ease}:host .zonos--backdrop{width:100vw;height:100vh;left:0;top:0;background:var(--zonos-elements-backdrop-color);position:fixed}:host .zonos--loading{position:absolute;left:0;right:0;bottom:0;top:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;z-index:2147483009;background:var(--zonos-elements-gray-0);border-radius:var(--border-radius, var(--zonos-elements-radius-10))}:host .zonos--dialog-layout{width:100vw;height:100vh;left:0;top:0;position:fixed;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;color:var(--zonos-elements-text-color);visibility:hidden}:host .zonos--dialog{position:relative;z-index:2147483008;background:var(--zonos-elements-gray-0);max-width:90vw;max-height:90vh;min-height:var(--min-height, auto);height:var(--height, auto);width:var(--width, auto);border-radius:var(--border-radius, var(--zonos-elements-radius-10));outline:none;-webkit-box-shadow:var(--zonos-elements-v3-shadow-xxl);box-shadow:var(--zonos-elements-v3-shadow-xxl);border:var(--zonos-elements-border);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host .zonos--header{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;padding:16px 24px}:host .zonos--header .-zonos-stencil-library--header-text{-ms-flex-positive:1;flex-grow:1}:host .zonos--header .zonos--close-button{width:var(--zonos-elements-size-md);height:var(--zonos-elements-size-md);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;cursor:pointer;border-radius:var(--zonos-elements-radius-10);-ms-flex-item-align:start;align-self:flex-start}:host .zonos--header .zonos--close-button:hover{background:var(--zonos-elements-hover-color)}:host .zonos--body{padding:8px 24px;max-height:100%;height:100%;overflow:auto}:host .zonos--body.zonos--no-body-padding{padding:0}:host .zonos--footer{padding:16px 24px}:host(.open) .zonos--dialog-layout,:host(.open) .zonos--backdrop{visibility:visible}:host(.open) .zonos--backdrop{z-index:2147483008;opacity:0.65}:host(.open) .zonos--dialog-layout{opacity:1;z-index:2147483009;-webkit-transform:scale(1);transform:scale(1)}:host(.no-border) .zonos--dialog{border:none}:host(.mobile) .zonos--dialog{max-width:100vw;max-height:100vh;height:100%;width:100%;border-radius:0;-webkit-box-shadow:none;box-shadow:none;border:none}";var U=N;var Z=e("zonos_dialog",function(){function e(e){var t=this;o(this,e);this.closeDialog=s(this,"closeDialog",3);this.isMobileMode=function(){return t.mobile||window.innerWidth<=768};this.closeButtonHandler=function(){if(!t.open){return}t.closeDialog.emit()};this.clickOutsideDialogHandler=function(e){if(e.target===e.currentTarget&&!t.noClickOutside){t.closeDialog.emit()}};this.open=false;this.headerText="";this.width="460px";this.height=undefined;this.minHeight=undefined;this.noHeader=false;this.noBodyPadding=false;this.noBorder=false;this.borderStyle=undefined;this.noCloseButton=false;this.noClickOutside=false;this.mobile=false;this.isLoading=true;this.isMobile=false}e.prototype.handleWindowResize=function(){this.isMobile=this.isMobileMode()};e.prototype.handleKeyDown=function(e){if(e.key==="Escape"){this.closeButtonHandler()}};e.prototype.componentDidLoad=function(){this.isMobile=this.isMobileMode()};e.prototype.render=function(){if(this.open){document.body.style.overflow="hidden"}else{document.body.style.overflow="auto"}var e=v({overrideBorderStyle:this.borderStyle});return t(n,{key:"03735385e07c7f6c8a87df42ad95f8c9d9533668",class:p(["zonos--elements",this.open&&"open",this.isLoading&&"is-loading",this.noBorder&&"no-border",this.isMobile&&"mobile"]),style:{"--border-radius":e,"--font-family":b(),"--height":this.height||"initial","--min-height":this.minHeight||"500px","--width":this.width}},t("div",{key:"da5d599e1a247f7e3364e6f5c9b2eae3db9539f5",class:"zonos--backdrop"}),t("div",{key:"cda1a996d9521c2e0b307f7a03ca3ee3d4915b8d",class:"zonos--dialog-layout",inert:!this.open,onClick:this.clickOutsideDialogHandler},t("div",{key:"471d8a069d4f580233bdb3e9e971efdb268ef57d",class:"zonos--dialog"},this.isLoading&&t("div",{key:"57220007aabcaef133c2c0782fa238cc43d63964",class:"zonos--loading"},t("zonos-spinner",{key:"0298b754341abd61ec07706128d05df5332f915d",size:30})),(this.headerText||!this.noCloseButton)&&t("div",{key:"5103dbc1c7593a8042505f767d8290825f9d10e7",class:"zonos--header"},this.headerText&&t("h3",{key:"a2d9cd4c8cb359aa64cf104a172ca960068c20a0",class:"zonos--header-text"},this.headerText),!this.noCloseButton&&t("zonos-button",{key:"de9bf8a949344d19fcb8bfb496719282553be194",class:"zonos--close-button",icon:t("zonos-icon",{"aria-label":"Close dialog",content:M}),noBackground:true,onClick:this.closeButtonHandler,variant:"subtle"})),t("div",{key:"1ec2cdca0f186cd0b28602580022ed0cb4b0eec9",class:p(["zonos--body",this.noBodyPadding&&"zonos--no-body-padding"])},t("slot",{key:"5071d921f48bf792a951a390d83b121e32771668"})),t("slot",{key:"c1818ac301afc845f5b14fd0f2ac9a1fd3a27b99",name:"dialog-footer"}))))};Object.defineProperty(e,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return e}());Z.style=U;var F=".sc-zonos-link-authentication-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-link-authentication-h *.sc-zonos-link-authentication{font-family:var(--font-family, Inter), Inter}.sc-zonos-link-authentication-h img.sc-zonos-link-authentication{max-width:100%}.sc-zonos-link-authentication-h dl.sc-zonos-link-authentication,.sc-zonos-link-authentication-h dd.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h1.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h2.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h3.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h4.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h5.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h6.sc-zonos-link-authentication,.sc-zonos-link-authentication-h hr.sc-zonos-link-authentication,.sc-zonos-link-authentication-h figure.sc-zonos-link-authentication,.sc-zonos-link-authentication-h p.sc-zonos-link-authentication,.sc-zonos-link-authentication-h pre.sc-zonos-link-authentication{margin:0}.sc-zonos-link-authentication-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-link-authentication-h .zonos--title.sc-zonos-link-authentication{margin-bottom:16px}";var H=F;var R=e("zonos_link_authentication",function(){function e(e){o(this,e);this.titleText=undefined;this.defaultEmail=null;this.stripe=a.stripe}e.prototype.watchInitStripe=function(){if(!this.stripe||!a.stripeElements){return}var e=this.defaultEmail?{email:this.defaultEmail}:undefined;var o=a.stripeLinkElement||a.stripeElements.create("linkAuthentication",{defaultValues:e||undefined});var s=this.el.querySelector(".zonos--link-authentication-component");if(!s){c("Cannot find container element for linkAuthenticationElement");return}o.mount(s);o.on("change",(function(e){a.stripeLinkEventData=e}));a.stripeLinkElement=o};e.prototype.componentDidLoad=function(){this.watchInitStripe()};e.prototype.render=function(){return t(n,{key:"f0b26abf99ef99c6665dabdddebc9ff086b6816c",class:"zonos--link-authentication zonos--elements"},t("zonos-text",{key:"898dbdffac06fe2a68af90610a22044bb72391ce",class:"zonos--title",type:"semiBoldLabel"},this.titleText),t("div",{key:"e2ec9abb0cf76a39a1262e1366e375dd898450cd",class:"zonos--link-authentication-component"}))};Object.defineProperty(e.prototype,"el",{get:function(){return i(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{stripe:["watchInitStripe"]}},enumerable:false,configurable:true});return e}());R.style=H}}}));
@@ -1 +1 @@
1
- import{d as o,l as n}from"./p-8a8fa05c.js";import{z as t}from"./p-1086aac3.js";import{h as a}from"./p-fb59c3c3.js";const i=async(i,e)=>{var s,d;if((window.location.href.includes("zonos.com")||window.location.href.includes("checkout.iglobalstores.com")||(null===(s=window.Zonos)||void 0===s?void 0:s.zonosQaUrl)||(null===(d=window.Zonos)||void 0===d?void 0:d.debug))&&!window.Zonos.zonosConversionTest)return;const r=o.checkoutSessionId;if(!r)return;const c={checkoutSessionId:r,countryCode:n.selectedCountryCode,eventName:i,metadata:e,organizationId:t.organizationId};await a("/api/zonos-elements/track-conversion-event",{body:c,method:"POST"})},e=()=>{var o;return null===(o=window.Zonos.zonosApiKey)||void 0===o?void 0:o.includes("test")},s=(o,n)=>new CustomEvent(o,{detail:n});export{s as c,e as g,i as t}
1
+ import{d as o,l as n}from"./p-b7ff0fb5.js";import{z as t}from"./p-1086aac3.js";import{h as i}from"./p-fb59c3c3.js";const a=async(a,e)=>{var s,d;if((window.location.href.includes("zonos.com")||window.location.href.includes("checkout.iglobalstores.com")||(null===(s=window.Zonos)||void 0===s?void 0:s.zonosQaUrl)||(null===(d=window.Zonos)||void 0===d?void 0:d.debug))&&!window.Zonos.zonosConversionTest)return;const r=o.checkoutSessionId;if(!r)return;const c={checkoutSessionId:r,countryCode:n.selectedCountryCode,eventName:a,metadata:e,organizationId:t.organizationId};await i("/api/zonos-elements/track-conversion-event",{body:c,method:"POST"})},e=()=>{var o;return null===(o=window.Zonos.zonosApiKey)||void 0===o?void 0:o.includes("test")},s=(o,n)=>new CustomEvent(o,{detail:n});export{s as c,e as g,a as t}