@zonos/elements 1.3.100 → 1.3.101

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 (156) hide show
  1. package/dist/cjs/{cart-ba56e884.js → cart-8a7426ab.js} +1 -1
  2. package/dist/cjs/{createCustomEvent-56d8ca50.js → createCustomEvent-32315aa3.js} +1 -1
  3. package/dist/cjs/index.cjs.js +9 -7
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/{paypal-184805ac.js → paypal-afaff757.js} +1 -1
  6. package/dist/cjs/zonos-address_7.cjs.entry.js +4 -4
  7. package/dist/cjs/zonos-button_3.cjs.entry.js +1 -1
  8. package/dist/cjs/{zonos-cart-items_12.cjs.entry.js → zonos-cart-items_13.cjs.entry.js} +116 -31
  9. package/dist/cjs/zonos-checkout.cjs.entry.js +5 -5
  10. package/dist/cjs/zonos-component.cjs.entry.js +1 -1
  11. package/dist/cjs/zonos-controller.cjs.entry.js +2 -2
  12. package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -1
  13. package/dist/cjs/zonos-country-select_4.cjs.entry.js +5 -5
  14. package/dist/cjs/zonos-elements.cjs.js +1 -1
  15. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +5 -5
  16. package/dist/cjs/zonos-hello.cjs.entry.js +1 -1
  17. package/dist/cjs/zonos-language-select_2.cjs.entry.js +1 -1
  18. package/dist/cjs/zonos-notification_3.cjs.entry.js +4 -4
  19. package/dist/cjs/zonos-toggle.cjs.entry.js +32 -0
  20. package/dist/cjs/zonos-tooltip.cjs.entry.js +3 -3
  21. package/dist/cjs/zonos-v-stack.cjs.entry.js +2 -2
  22. package/dist/collection/collection-manifest.json +2 -0
  23. package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-display/zonos-address-display.css +1 -1
  24. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-items/zonos-cart-items.js +6 -7
  25. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-restricted-items/zonos-cart-restricted-items.js +3 -3
  26. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.js +14 -13
  27. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.js +3 -3
  28. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.css +3 -1
  29. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +1 -1
  30. package/dist/collection/components/checkout/zonos-checkout/zonos-currency-toggle/zonos-currency-toggle.js +41 -0
  31. package/dist/collection/components/checkout/zonos-checkout/zonos-review/zonos-review.js +3 -3
  32. package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +19 -6
  33. package/dist/collection/components/common/zonos-button/zonos-button.css +2 -2
  34. package/dist/collection/components/common/zonos-toggle/zonos-toggle.css +79 -0
  35. package/dist/collection/components/common/zonos-toggle/zonos-toggle.js +92 -0
  36. package/dist/collection/components/common/zonos-tooltip/zonos-tooltip.css +1 -1
  37. package/dist/collection/components/common/zonos-tooltip/zonos-tooltip.js +2 -2
  38. package/dist/collection/components/common/zonos-v-stack/zonos-v-stack.js +2 -2
  39. package/dist/collection/components/common/zonos-virtual-scroll/zonos-virtual-scroll.js +2 -2
  40. package/dist/collection/components/component-template/zonos-component/zonos-component.js +1 -1
  41. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.js +2 -2
  42. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +4 -4
  43. package/dist/collection/components/main/zonos-controller.js +1 -1
  44. package/dist/collection/components/paypal/zonos-paypal-payment.js +1 -1
  45. package/dist/collection/components/store/checkout/cart.js +1 -1
  46. package/dist/collection/components/stripe/zonos-address/zonos-address.js +1 -1
  47. package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js +1 -1
  48. package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +1 -1
  49. package/dist/collection/components/utils/checkout/getDisplayCurrency.js +9 -0
  50. package/dist/collection/components/utils/checkout/renderCheckoutCurrency.js +31 -0
  51. package/dist/collection/scripts/_zonosBase.js +2 -0
  52. package/dist/collection/types/common-ui/Toggle.js +1 -0
  53. package/dist/esm/{cart-b7bbf95b.js → cart-3ea28cb4.js} +1 -1
  54. package/dist/esm/{createCustomEvent-4bfd1290.js → createCustomEvent-58dee713.js} +1 -1
  55. package/dist/esm/index.js +9 -7
  56. package/dist/esm/loader.js +1 -1
  57. package/dist/esm/{paypal-5eaa95d4.js → paypal-2c061943.js} +1 -1
  58. package/dist/esm/zonos-address_7.entry.js +4 -4
  59. package/dist/esm/zonos-button_3.entry.js +1 -1
  60. package/dist/esm/{zonos-cart-items_12.entry.js → zonos-cart-items_13.entry.js} +116 -32
  61. package/dist/esm/zonos-checkout.entry.js +5 -5
  62. package/dist/esm/zonos-component.entry.js +1 -1
  63. package/dist/esm/zonos-controller.entry.js +2 -2
  64. package/dist/esm/zonos-country-flag.entry.js +1 -1
  65. package/dist/esm/zonos-country-select_4.entry.js +5 -5
  66. package/dist/esm/zonos-elements.js +1 -1
  67. package/dist/esm/zonos-hello-dialog.entry.js +5 -5
  68. package/dist/esm/zonos-hello.entry.js +1 -1
  69. package/dist/esm/zonos-language-select_2.entry.js +1 -1
  70. package/dist/esm/zonos-notification_3.entry.js +4 -4
  71. package/dist/esm/zonos-toggle.entry.js +28 -0
  72. package/dist/esm/zonos-tooltip.entry.js +3 -3
  73. package/dist/esm/zonos-v-stack.entry.js +2 -2
  74. package/dist/esm-es5/{cart-b7bbf95b.js → cart-3ea28cb4.js} +1 -1
  75. package/dist/esm-es5/{createCustomEvent-4bfd1290.js → createCustomEvent-58dee713.js} +1 -1
  76. package/dist/esm-es5/index.js +1 -1
  77. package/dist/esm-es5/loader.js +1 -1
  78. package/dist/esm-es5/{paypal-5eaa95d4.js → paypal-2c061943.js} +1 -1
  79. package/dist/esm-es5/zonos-address_7.entry.js +1 -1
  80. package/dist/esm-es5/zonos-button_3.entry.js +1 -1
  81. package/dist/esm-es5/zonos-cart-items_13.entry.js +1 -0
  82. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  83. package/dist/esm-es5/zonos-component.entry.js +1 -1
  84. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  85. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  86. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  87. package/dist/esm-es5/zonos-elements.js +1 -1
  88. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  89. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  90. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  91. package/dist/esm-es5/zonos-notification_3.entry.js +1 -1
  92. package/dist/esm-es5/zonos-toggle.entry.js +1 -0
  93. package/dist/esm-es5/zonos-tooltip.entry.js +1 -1
  94. package/dist/esm-es5/zonos-v-stack.entry.js +1 -1
  95. package/dist/scripts/index.d.ts +74 -0
  96. package/dist/scripts/index.js +1 -1
  97. package/dist/scripts/loadZonos.js +1 -1
  98. package/dist/scripts/zonos.js +1 -1
  99. package/dist/types/components/checkout/zonos-checkout/zonos-currency-toggle/zonos-currency-toggle.d.ts +5 -0
  100. package/dist/types/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.d.ts +2 -0
  101. package/dist/types/components/common/zonos-toggle/zonos-toggle.d.ts +17 -0
  102. package/dist/types/components/store/checkout/cart.d.ts +4 -0
  103. package/dist/types/components/utils/checkout/getDisplayCurrency.d.ts +1 -0
  104. package/dist/types/components/utils/checkout/renderCheckoutCurrency.d.ts +10 -0
  105. package/dist/types/components.d.ts +63 -0
  106. package/dist/types/scripts/_zonosBase.d.ts +7 -0
  107. package/dist/types/types/common-ui/Toggle.d.ts +5 -0
  108. package/dist/zonos-elements/index.esm.js +1 -1
  109. package/dist/zonos-elements/p-004e7de3.system.entry.js +1 -0
  110. package/dist/zonos-elements/{p-7aa41ee0.system.entry.js → p-059e3dc1.system.entry.js} +1 -1
  111. package/dist/zonos-elements/p-0761b386.system.entry.js +1 -0
  112. package/dist/zonos-elements/{p-5657fa8b.entry.js → p-0b9e2866.entry.js} +1 -1
  113. package/dist/zonos-elements/{p-89ba9d89.entry.js → p-0bb121ff.entry.js} +1 -1
  114. package/dist/zonos-elements/{p-4c06d4d9.system.entry.js → p-1776cc80.system.entry.js} +1 -1
  115. package/dist/zonos-elements/{p-7ac03155.js → p-1a0a4174.js} +1 -1
  116. package/dist/zonos-elements/{p-93e2a2ed.system.entry.js → p-1a89c199.system.entry.js} +1 -1
  117. package/dist/zonos-elements/{p-afad2fae.entry.js → p-1a9a51bf.entry.js} +1 -1
  118. package/dist/zonos-elements/p-1b1f2e33.system.entry.js +1 -0
  119. package/dist/zonos-elements/p-1e921c35.js +1 -0
  120. package/dist/zonos-elements/{p-22e81fee.system.entry.js → p-32c29205.system.entry.js} +1 -1
  121. package/dist/zonos-elements/{p-c5bd3dd0.system.js → p-360c8c41.system.js} +1 -1
  122. package/dist/zonos-elements/{p-10392331.entry.js → p-36eaad7e.entry.js} +1 -1
  123. package/dist/zonos-elements/{p-5400d785.entry.js → p-4af472bf.entry.js} +1 -1
  124. package/dist/zonos-elements/{p-ea68ee1f.entry.js → p-4eb3e354.entry.js} +1 -1
  125. package/dist/zonos-elements/{p-01cb4d70.system.entry.js → p-5c892684.system.entry.js} +1 -1
  126. package/dist/zonos-elements/{p-b3c1a516.entry.js → p-65b46761.entry.js} +1 -1
  127. package/dist/zonos-elements/p-71fe8da9.entry.js +1 -0
  128. package/dist/zonos-elements/p-72595eda.system.js +1 -0
  129. package/dist/zonos-elements/{p-2b62fe10.system.entry.js → p-77b74009.system.entry.js} +1 -1
  130. package/dist/zonos-elements/{p-fe6d226f.system.entry.js → p-87d1ae39.system.entry.js} +1 -1
  131. package/dist/zonos-elements/{p-2156c4b3.entry.js → p-8821c276.entry.js} +1 -1
  132. package/dist/zonos-elements/{p-32bc9718.entry.js → p-89aeef91.entry.js} +1 -1
  133. package/dist/zonos-elements/{p-74014018.system.entry.js → p-939d363c.system.entry.js} +1 -1
  134. package/dist/zonos-elements/{p-ff3bd453.entry.js → p-a7b8efc4.entry.js} +1 -1
  135. package/dist/zonos-elements/{p-10b7320c.system.entry.js → p-b4e88de9.system.entry.js} +1 -1
  136. package/dist/zonos-elements/{p-c60675df.entry.js → p-b5af39b4.entry.js} +1 -1
  137. package/dist/zonos-elements/{p-c1494500.system.js → p-be195761.system.js} +1 -1
  138. package/dist/zonos-elements/{p-38886017.system.entry.js → p-bfd73737.system.entry.js} +1 -1
  139. package/dist/zonos-elements/{p-f6dad0d3.entry.js → p-c3677d1b.entry.js} +1 -1
  140. package/dist/zonos-elements/p-c78dd680.system.js +1 -1
  141. package/dist/zonos-elements/p-cf88af9c.entry.js +1 -0
  142. package/dist/zonos-elements/{p-3e29a09d.system.entry.js → p-d04d1517.system.entry.js} +1 -1
  143. package/dist/zonos-elements/p-d343e994.entry.js +1 -0
  144. package/dist/zonos-elements/{p-0450d72d.js → p-d72a8183.js} +1 -1
  145. package/dist/zonos-elements/{p-6df9bd63.system.js → p-df3ccf9b.system.js} +2 -2
  146. package/dist/zonos-elements/{p-8615f779.system.entry.js → p-f234b5dc.system.entry.js} +1 -1
  147. package/dist/zonos-elements/zonos-elements.css +22 -22
  148. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  149. package/package.json +1 -1
  150. package/dist/esm-es5/zonos-cart-items_12.entry.js +0 -1
  151. package/dist/zonos-elements/p-38c109e5.system.entry.js +0 -1
  152. package/dist/zonos-elements/p-9bf95d37.system.entry.js +0 -1
  153. package/dist/zonos-elements/p-bcbf4821.entry.js +0 -1
  154. package/dist/zonos-elements/p-d3dfda31.system.js +0 -1
  155. package/dist/zonos-elements/p-d8cbd4ea.js +0 -1
  156. package/dist/zonos-elements/p-ecb8676d.entry.js +0 -1
@@ -1 +1 @@
1
- import{r as registerInstance,h,H as Host}from"./index-86b8247e.js";import{Q as localizationStoreUpdateSelectedLocale,t as translate,l as localizationStore}from"./cart-b7bbf95b.js";import{d as zonosStoreFontFamily}from"./zonosStore-7798ac16.js";import{l as languages}from"./ILanguage-cd6acb72.js";import"./handleFetch-ce924688.js";import"./isDarkColor-4261bc3c.js";import"./getBorderRadius-e55a9df1.js";var GreenCheckDuotoneIcon='<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M7.99996 2.6665C5.05444 2.6665 2.66663 5.05432 2.66663 7.99984C2.66663 10.9454 5.05444 13.3332 7.99996 13.3332C10.9455 13.3332 13.3333 10.9454 13.3333 7.99984C13.3333 5.05432 10.9455 2.6665 7.99996 2.6665Z" fill="#AFF8C3"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M10.1403 6.10535C10.3582 6.27488 10.3975 6.58902 10.228 6.80699L8.01055 9.65797C7.76436 9.97449 7.29646 10.0036 7.01291 9.72008L5.81307 8.52024C5.61781 8.32498 5.61781 8.0084 5.81307 7.81314C6.00833 7.61787 6.32492 7.61787 6.52018 7.81314L7.45301 8.74597L9.43862 6.19305C9.60815 5.97508 9.92229 5.93581 10.1403 6.10535Z" fill="#246627"/>\n</svg>\n';var zonosLanguageSelectCss=":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--language-select{width:100%}:host .zonos--language-select .zonos--language-select-content{display:grid;grid-template-columns:repeat(3, minmax(-webkit-max-content, 1fr));grid-template-columns:repeat(3, minmax(max-content, 1fr));padding:16px;padding-top:0px}:host .zonos--language-select .zonos--language-select-content .zonos--language-select-button{display:-ms-flexbox;display:flex;padding:8px;gap:4px;-ms-flex-align:center;align-items:center;border-radius:var(--zonos-elements-radius-4);cursor:pointer;width:100%;border:none;background:none}:host .zonos--language-select .zonos--language-select-content .zonos--language-select-button:hover{background:var(--zonos-elements-gray-100)}@media (max-width: 400px){:host .zonos--language-select .zonos--language-select-content{grid-template-columns:1fr 1fr}}";var ZonosLanguageSelectStyle0=zonosLanguageSelectCss;var ZonosLanguageSelect=function(){function e(e){var o=this;registerInstance(this,e);this.languageSelected=function(e){void localizationStoreUpdateSelectedLocale(e);o.handleOnClose()};this.handleOnClose=function(){}}e.prototype.render=function(){var e=this;var o=localizationStore.selectedLocale;return h(Host,{key:"bea77d8916a999eade4d1201adbf37803b65901a",class:"zonos--elements",style:{"--font-family":zonosStoreFontFamily()}},h("div",{key:"7c16efd7518f5952dac402c1fc2993e110d78fef",class:"zonos--language-select"},h("zonos-select-dialog-header",{key:"52c7626a8378bd7c956a3fa9d339a263f686f80a",handleOnClose:function(){return e.handleOnClose()},label:translate("Select a language")}),h("div",{key:"6c00ad9b3270ae435ee32600651600a0a237ff07",class:"zonos--language-select-content"},languages.map((function(t){return h("button",{class:"zonos--language-select-button",onClick:function(){return e.languageSelected(t.code)}},h("zonos-text",{textColor:"gray-800"},t.translatedLabel),t.code===o&&h("zonos-icon",{content:GreenCheckDuotoneIcon,size:16}))})))))};return e}();ZonosLanguageSelect.style=ZonosLanguageSelectStyle0;var RemoveIcon='<svg xmlns="https://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="#C5C6CA" fill-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" clip-rule="evenodd"/><path fill="#4D505A" fill-rule="evenodd" d="M8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" clip-rule="evenodd"/></svg>';var zonosSelectDialogHeaderCss=":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--select-dialog-header-wrapper{position:-webkit-sticky;position:sticky;top:0;background:var(--zonos-elements-surface-color);padding:16px}:host .zonos--select-dialog-header-wrapper .zonos--select-dialog-header{position:relative;-ms-flex-pack:justify;justify-content:space-between;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}";var ZonosSelectDialogHeaderStyle0=zonosSelectDialogHeaderCss;var ZonosSelectDialogHeader=function(){function e(e){registerInstance(this,e);this.handleOnClose=function(){};this.label=""}e.prototype.render=function(){var e=this;return h(Host,{key:"a1b2433a81210b6a0a78be3cb027f885cd870d2c",class:"zonos--elements",style:{"--font-family":zonosStoreFontFamily()}},h("zonos-v-stack",{key:"a9e61575c6c6c34c6097dd937dea7c199130f7f0",class:"zonos--select-dialog-header-wrapper",spacing:8},h("div",{key:"266b89174f64825bec793bd30d44c1f75f220b1f",class:"zonos--select-dialog-header"},h("zonos-text",{key:"7fd1f62f22610a2601497e897e98d5f5e0437601",type:"boldLabel"},this.label),h("zonos-button",{key:"afa95565fae19d97e038885f5244ee292f960a69",class:"zonos--close-button",icon:h("zonos-icon",{"aria-label":"Close select dialog",content:RemoveIcon,size:20}),noBackground:true,onClick:function(){return e.handleOnClose()}})),h("slot",{key:"c28af84460321290623f17120ef1583aaf898105"})))};return e}();ZonosSelectDialogHeader.style=ZonosSelectDialogHeaderStyle0;export{ZonosLanguageSelect as zonos_language_select,ZonosSelectDialogHeader as zonos_select_dialog_header};
1
+ import{r as registerInstance,h,H as Host}from"./index-86b8247e.js";import{Q as localizationStoreUpdateSelectedLocale,t as translate,l as localizationStore}from"./cart-3ea28cb4.js";import{d as zonosStoreFontFamily}from"./zonosStore-7798ac16.js";import{l as languages}from"./ILanguage-cd6acb72.js";import"./handleFetch-ce924688.js";import"./isDarkColor-4261bc3c.js";import"./getBorderRadius-e55a9df1.js";var GreenCheckDuotoneIcon='<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M7.99996 2.6665C5.05444 2.6665 2.66663 5.05432 2.66663 7.99984C2.66663 10.9454 5.05444 13.3332 7.99996 13.3332C10.9455 13.3332 13.3333 10.9454 13.3333 7.99984C13.3333 5.05432 10.9455 2.6665 7.99996 2.6665Z" fill="#AFF8C3"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M10.1403 6.10535C10.3582 6.27488 10.3975 6.58902 10.228 6.80699L8.01055 9.65797C7.76436 9.97449 7.29646 10.0036 7.01291 9.72008L5.81307 8.52024C5.61781 8.32498 5.61781 8.0084 5.81307 7.81314C6.00833 7.61787 6.32492 7.61787 6.52018 7.81314L7.45301 8.74597L9.43862 6.19305C9.60815 5.97508 9.92229 5.93581 10.1403 6.10535Z" fill="#246627"/>\n</svg>\n';var zonosLanguageSelectCss=":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--language-select{width:100%}:host .zonos--language-select .zonos--language-select-content{display:grid;grid-template-columns:repeat(3, minmax(-webkit-max-content, 1fr));grid-template-columns:repeat(3, minmax(max-content, 1fr));padding:16px;padding-top:0px}:host .zonos--language-select .zonos--language-select-content .zonos--language-select-button{display:-ms-flexbox;display:flex;padding:8px;gap:4px;-ms-flex-align:center;align-items:center;border-radius:var(--zonos-elements-radius-4);cursor:pointer;width:100%;border:none;background:none}:host .zonos--language-select .zonos--language-select-content .zonos--language-select-button:hover{background:var(--zonos-elements-gray-100)}@media (max-width: 400px){:host .zonos--language-select .zonos--language-select-content{grid-template-columns:1fr 1fr}}";var ZonosLanguageSelectStyle0=zonosLanguageSelectCss;var ZonosLanguageSelect=function(){function e(e){var o=this;registerInstance(this,e);this.languageSelected=function(e){void localizationStoreUpdateSelectedLocale(e);o.handleOnClose()};this.handleOnClose=function(){}}e.prototype.render=function(){var e=this;var o=localizationStore.selectedLocale;return h(Host,{key:"bea77d8916a999eade4d1201adbf37803b65901a",class:"zonos--elements",style:{"--font-family":zonosStoreFontFamily()}},h("div",{key:"7c16efd7518f5952dac402c1fc2993e110d78fef",class:"zonos--language-select"},h("zonos-select-dialog-header",{key:"52c7626a8378bd7c956a3fa9d339a263f686f80a",handleOnClose:function(){return e.handleOnClose()},label:translate("Select a language")}),h("div",{key:"6c00ad9b3270ae435ee32600651600a0a237ff07",class:"zonos--language-select-content"},languages.map((function(t){return h("button",{class:"zonos--language-select-button",onClick:function(){return e.languageSelected(t.code)}},h("zonos-text",{textColor:"gray-800"},t.translatedLabel),t.code===o&&h("zonos-icon",{content:GreenCheckDuotoneIcon,size:16}))})))))};return e}();ZonosLanguageSelect.style=ZonosLanguageSelectStyle0;var RemoveIcon='<svg xmlns="https://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="#C5C6CA" fill-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" clip-rule="evenodd"/><path fill="#4D505A" fill-rule="evenodd" d="M8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" clip-rule="evenodd"/></svg>';var zonosSelectDialogHeaderCss=":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--select-dialog-header-wrapper{position:-webkit-sticky;position:sticky;top:0;background:var(--zonos-elements-surface-color);padding:16px}:host .zonos--select-dialog-header-wrapper .zonos--select-dialog-header{position:relative;-ms-flex-pack:justify;justify-content:space-between;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}";var ZonosSelectDialogHeaderStyle0=zonosSelectDialogHeaderCss;var ZonosSelectDialogHeader=function(){function e(e){registerInstance(this,e);this.handleOnClose=function(){};this.label=""}e.prototype.render=function(){var e=this;return h(Host,{key:"a1b2433a81210b6a0a78be3cb027f885cd870d2c",class:"zonos--elements",style:{"--font-family":zonosStoreFontFamily()}},h("zonos-v-stack",{key:"a9e61575c6c6c34c6097dd937dea7c199130f7f0",class:"zonos--select-dialog-header-wrapper",spacing:8},h("div",{key:"266b89174f64825bec793bd30d44c1f75f220b1f",class:"zonos--select-dialog-header"},h("zonos-text",{key:"7fd1f62f22610a2601497e897e98d5f5e0437601",type:"boldLabel"},this.label),h("zonos-button",{key:"afa95565fae19d97e038885f5244ee292f960a69",class:"zonos--close-button",icon:h("zonos-icon",{"aria-label":"Close select dialog",content:RemoveIcon,size:20}),noBackground:true,onClick:function(){return e.handleOnClose()}})),h("slot",{key:"c28af84460321290623f17120ef1583aaf898105"})))};return e}();ZonosSelectDialogHeader.style=ZonosSelectDialogHeaderStyle0;export{ZonosLanguageSelect as zonos_language_select,ZonosSelectDialogHeader as zonos_select_dialog_header};
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(n,o,t,e){function a(n){return n instanceof t?n:new t((function(o){o(n)}))}return new(t||(t=Promise))((function(t,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?t(n.value):a(n.value).then(i,r)}c((e=e.apply(n,o||[])).next())}))};var __generator=this&&this.__generator||function(n,o){var t={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(o){return c([n,o])}}function c(r){if(e)throw new TypeError("Generator is already executing.");while(i&&(i=0,r[0]&&(t=0)),t)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:t.label++;return{value:r[1],done:false};case 5:t.label++;a=r[1];r=[0];continue;case 7:r=t.ops.pop();t.trys.pop();continue;default:if(!(s=t.trys,s=s.length>0&&s[s.length-1])&&(r[0]===6||r[0]===2)){t=0;continue}if(r[0]===3&&(!s||r[1]>s[0]&&r[1]<s[3])){t.label=r[1];break}if(r[0]===6&&t.label<s[1]){t.label=s[1];s=r;break}if(s&&t.label<s[2]){t.label=s[2];t.ops.push(r);break}if(s[2])t.ops.pop();t.trys.pop();continue}r=o.call(n,t)}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,o,t){if(t||arguments.length===2)for(var e=0,a=o.length,s;e<a;e++){if(s||!(e in o)){if(!s)s=Array.prototype.slice.call(o,0,e);s[e]=o[e]}}return n.concat(s||Array.prototype.slice.call(o))};import{r as registerInstance,h,H as Host,d as getElement,c as createEvent}from"./index-86b8247e.js";import{d as zonosStoreFontFamily}from"./zonosStore-7798ac16.js";import{c as classes}from"./classes-0d95c529.js";import{j as stripeStore}from"./cart-b7bbf95b.js";import{a as logError,l as log}from"./handleFetch-ce924688.js";import{c as paypalStoreInitButtons}from"./paypal-5eaa95d4.js";import"./isDarkColor-4261bc3c.js";import"./getBorderRadius-e55a9df1.js";var zonosNotificationCss=":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 ZonosNotificationStyle0=zonosNotificationCss;var ZonosNotification=function(){function n(n){registerInstance(this,n);this.notificationArray=[]}n.prototype.showNotification=function(n){return __awaiter(this,void 0,void 0,(function(){var o,t;var e=this;return __generator(this,(function(a){o="id-".concat(Math.random().toString(36).substring(2,9));t=Object.assign(Object.assign({},n),{id:o,timeout:n.timeout||5e3,transitionClass:"",type:n.type||"success"});this.notificationArray=__spreadArray(__spreadArray([],this.notificationArray,true),[t],false);setTimeout((function(){e.updateTransitionClass({id:o,transitionClass:"show"})}),50);setTimeout((function(){e.removeNotification(o)}),t.timeout);return[2]}))}))};n.prototype.updateTransitionClass=function(n){var o=n.id,t=n.transitionClass;this.notificationArray=this.notificationArray.map((function(n){if(n.id===o){return Object.assign(Object.assign({},n),{transitionClass:t})}return n}))};n.prototype.removeNotification=function(n){var o=this;this.updateTransitionClass({id:n,transitionClass:""});setTimeout((function(){o.notificationArray=o.notificationArray.filter((function(o){return o.id!==n}))}),300)};n.prototype.render=function(){var n=this;return h(Host,{key:"17c08c90c6c1dfade4e43451c196127a0f53429e",class:classes(["zonos--elements zonos--notification"]),style:{"--font-family":zonosStoreFontFamily()}},h("div",{key:"6624419d86a5c7518539069dbc5c9d7c08262c75",class:"zonos--notification-items"},this.notificationArray.map((function(o){return h("div",{"aria-hidden":"true",class:classes(["zonos--notification-item",o.type,o.transitionClass]),key:o.id,onClick:function(){n.removeNotification(o.id)}},h("zonos-text",{textColor:"gray-0"},o.message))}))))};return n}();ZonosNotification.style=ZonosNotificationStyle0;var zonosPaymentCss=".sc-zonos-payment-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-payment-h *.sc-zonos-payment{font-family:var(--font-family, Inter), Inter}.sc-zonos-payment-h img.sc-zonos-payment{max-width:100%}.sc-zonos-payment-h dl.sc-zonos-payment,.sc-zonos-payment-h dd.sc-zonos-payment,.sc-zonos-payment-h h1.sc-zonos-payment,.sc-zonos-payment-h h2.sc-zonos-payment,.sc-zonos-payment-h h3.sc-zonos-payment,.sc-zonos-payment-h h4.sc-zonos-payment,.sc-zonos-payment-h h5.sc-zonos-payment,.sc-zonos-payment-h h6.sc-zonos-payment,.sc-zonos-payment-h hr.sc-zonos-payment,.sc-zonos-payment-h figure.sc-zonos-payment,.sc-zonos-payment-h p.sc-zonos-payment,.sc-zonos-payment-h pre.sc-zonos-payment{margin:0}.sc-zonos-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-payment-h .zonos--title.sc-zonos-payment{margin-bottom:16px}";var ZonosPaymentStyle0=zonosPaymentCss;var ZonosPayment=function(){function n(n){registerInstance(this,n);this.titleText=undefined;this.stripe=stripeStore.stripe;this.stripeElements=stripeStore.stripeElements}n.prototype.watchInitStripe=function(){if(!this.stripeElements){return}var n=stripeStore.stripePaymentElement||this.stripeElements.create("payment",{layout:"tabs"});var o=this.el.querySelector(".zonos--payment-component");if(!o){logError("Cannot find container element for paymentElement");return}n.mount(o);n.on("change",(function(n){stripeStore.stripePaymentEventData=n}));stripeStore.stripePaymentElement=n};n.prototype.componentDidLoad=function(){this.watchInitStripe()};n.prototype.render=function(){return h(Host,{key:"cf616ec959fd1b7396ed86b23561f459e0da8722",class:"zonos--payment zonos--elements"},this.titleText&&h("zonos-text",{key:"e5564db71ba2c0d67d372cb1804d6d462cdf1b33",class:"zonos--title",type:"semiBoldLabel"},this.titleText),h("div",{key:"3ea47f2c0a541590210d181bc73ecb3fb27e7783",class:"zonos--payment-component"}),h("div",{key:"d3a46a127448568caf4309806e88556594075c12",class:"zonos--payment-paypal-container"}))};Object.defineProperty(n.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(n,"watchers",{get:function(){return{stripeElements:["watchInitStripe"],stripe:["watchInitStripe"]}},enumerable:false,configurable:true});return n}();ZonosPayment.style=ZonosPaymentStyle0;var zonosPaypalPaymentCss=".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 ZonosPaypalPaymentStyle0=zonosPaypalPaymentCss;var ZonosPaypalPayment=function(){function n(n){registerInstance(this,n);this.paypalSessionDone=createEvent(this,"paypalSessionDone",7);this.paypalSessionFail=createEvent(this,"paypalSessionFail",7)}n.prototype.loadPaypal=function(){return __awaiter(this,void 0,void 0,(function(){var n,o;var t=this;return __generator(this,(function(e){if(!window.Zonos.paypal){log("Paypal is not available");return[2]}n=paypalStoreInitButtons({onPaypalFail:function(){log("onPaypalFail");t.paypalSessionFail.emit()},onPaypalSessionDone:function(n){var o=n.orderId;log("onPaypalSessionDone","info",{orderId:o});t.paypalSessionDone.emit({orderId:o})}});if(!(n===null||n===void 0?void 0:n.length)){log("There are no paypal buttons available");return[2]}o=this.el.querySelector(".zonos--payment-paypal-container");if(!o){log("Cannot find container element for paypal buttons");return[2]}n.forEach((function(n){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,n.render(o)];case 1:t.sent();return[2]}}))}))}));return[2]}))}))};n.prototype.componentDidLoad=function(){void this.loadPaypal()};n.prototype.render=function(){return h(Host,{key:"6bfc962de500edbb105b7eb899711e48def78167",class:"zonos--paypal-payment zonos--elements"},h("div",{key:"92d1b1c416f5e233c54e50d47129be375ef0a68b",class:"zonos--payment-paypal-container"}))};Object.defineProperty(n.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return n}();ZonosPaypalPayment.style=ZonosPaypalPaymentStyle0;export{ZonosNotification as zonos_notification,ZonosPayment as zonos_payment,ZonosPaypalPayment as zonos_paypal_payment};
1
+ var __awaiter=this&&this.__awaiter||function(n,o,t,a){function e(n){return n instanceof t?n:new t((function(o){o(n)}))}return new(t||(t=Promise))((function(t,s){function i(n){try{c(a.next(n))}catch(n){s(n)}}function r(n){try{c(a["throw"](n))}catch(n){s(n)}}function c(n){n.done?t(n.value):e(n.value).then(i,r)}c((a=a.apply(n,o||[])).next())}))};var __generator=this&&this.__generator||function(n,o){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},a,e,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(o){return c([n,o])}}function c(r){if(a)throw new TypeError("Generator is already executing.");while(i&&(i=0,r[0]&&(t=0)),t)try{if(a=1,e&&(s=r[0]&2?e["return"]:r[0]?e["throw"]||((s=e["return"])&&s.call(e),0):e.next)&&!(s=s.call(e,r[1])).done)return s;if(e=0,s)r=[r[0]&2,s.value];switch(r[0]){case 0:case 1:s=r;break;case 4:t.label++;return{value:r[1],done:false};case 5:t.label++;e=r[1];r=[0];continue;case 7:r=t.ops.pop();t.trys.pop();continue;default:if(!(s=t.trys,s=s.length>0&&s[s.length-1])&&(r[0]===6||r[0]===2)){t=0;continue}if(r[0]===3&&(!s||r[1]>s[0]&&r[1]<s[3])){t.label=r[1];break}if(r[0]===6&&t.label<s[1]){t.label=s[1];s=r;break}if(s&&t.label<s[2]){t.label=s[2];t.ops.push(r);break}if(s[2])t.ops.pop();t.trys.pop();continue}r=o.call(n,t)}catch(n){r=[6,n];e=0}finally{a=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,o,t){if(t||arguments.length===2)for(var a=0,e=o.length,s;a<e;a++){if(s||!(a in o)){if(!s)s=Array.prototype.slice.call(o,0,a);s[a]=o[a]}}return n.concat(s||Array.prototype.slice.call(o))};import{r as registerInstance,h,H as Host,d as getElement,c as createEvent}from"./index-86b8247e.js";import{d as zonosStoreFontFamily}from"./zonosStore-7798ac16.js";import{c as classes}from"./classes-0d95c529.js";import{j as stripeStore}from"./cart-3ea28cb4.js";import{a as logError,l as log}from"./handleFetch-ce924688.js";import{c as paypalStoreInitButtons}from"./paypal-2c061943.js";import"./isDarkColor-4261bc3c.js";import"./getBorderRadius-e55a9df1.js";var zonosNotificationCss=":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 ZonosNotificationStyle0=zonosNotificationCss;var ZonosNotification=function(){function n(n){registerInstance(this,n);this.notificationArray=[]}n.prototype.showNotification=function(n){return __awaiter(this,void 0,void 0,(function(){var o,t;var a=this;return __generator(this,(function(e){o="id-".concat(Math.random().toString(36).substring(2,9));t=Object.assign(Object.assign({},n),{id:o,timeout:n.timeout||5e3,transitionClass:"",type:n.type||"success"});this.notificationArray=__spreadArray(__spreadArray([],this.notificationArray,true),[t],false);setTimeout((function(){a.updateTransitionClass({id:o,transitionClass:"show"})}),50);setTimeout((function(){a.removeNotification(o)}),t.timeout);return[2]}))}))};n.prototype.updateTransitionClass=function(n){var o=n.id,t=n.transitionClass;this.notificationArray=this.notificationArray.map((function(n){if(n.id===o){return Object.assign(Object.assign({},n),{transitionClass:t})}return n}))};n.prototype.removeNotification=function(n){var o=this;this.updateTransitionClass({id:n,transitionClass:""});setTimeout((function(){o.notificationArray=o.notificationArray.filter((function(o){return o.id!==n}))}),300)};n.prototype.render=function(){var n=this;return h(Host,{key:"17c08c90c6c1dfade4e43451c196127a0f53429e",class:classes(["zonos--elements zonos--notification"]),style:{"--font-family":zonosStoreFontFamily()}},h("div",{key:"6624419d86a5c7518539069dbc5c9d7c08262c75",class:"zonos--notification-items"},this.notificationArray.map((function(o){return h("div",{"aria-hidden":"true",class:classes(["zonos--notification-item",o.type,o.transitionClass]),key:o.id,onClick:function(){n.removeNotification(o.id)}},h("zonos-text",{textColor:"gray-0"},o.message))}))))};return n}();ZonosNotification.style=ZonosNotificationStyle0;var zonosPaymentCss=".sc-zonos-payment-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-payment-h *.sc-zonos-payment{font-family:var(--font-family, Inter), Inter}.sc-zonos-payment-h img.sc-zonos-payment{max-width:100%}.sc-zonos-payment-h dl.sc-zonos-payment,.sc-zonos-payment-h dd.sc-zonos-payment,.sc-zonos-payment-h h1.sc-zonos-payment,.sc-zonos-payment-h h2.sc-zonos-payment,.sc-zonos-payment-h h3.sc-zonos-payment,.sc-zonos-payment-h h4.sc-zonos-payment,.sc-zonos-payment-h h5.sc-zonos-payment,.sc-zonos-payment-h h6.sc-zonos-payment,.sc-zonos-payment-h hr.sc-zonos-payment,.sc-zonos-payment-h figure.sc-zonos-payment,.sc-zonos-payment-h p.sc-zonos-payment,.sc-zonos-payment-h pre.sc-zonos-payment{margin:0}.sc-zonos-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-payment-h .zonos--title.sc-zonos-payment{margin-bottom:16px}";var ZonosPaymentStyle0=zonosPaymentCss;var ZonosPayment=function(){function n(n){registerInstance(this,n);this.titleText=undefined;this.stripe=stripeStore.stripe;this.stripeElements=stripeStore.stripeElements}n.prototype.watchInitStripe=function(){if(!this.stripeElements){return}var n=stripeStore.stripePaymentElement||this.stripeElements.create("payment",{layout:"tabs"});var o=this.el.querySelector(".zonos--payment-component");if(!o){logError("Cannot find container element for paymentElement");return}n.mount(o);n.on("change",(function(n){stripeStore.stripePaymentEventData=n}));stripeStore.stripePaymentElement=n};n.prototype.componentDidLoad=function(){this.watchInitStripe()};n.prototype.render=function(){return h(Host,{key:"b0f902ab028fc148e5ac2e6b6620844aa88329f0",class:"zonos--payment zonos--elements"},this.titleText&&h("zonos-text",{key:"826ddc56d763a6064e4ba5bd331853950d68a8b5",class:"zonos--title",type:"semiBoldLabel"},this.titleText),h("div",{key:"4f987cfa5d2d1d2b0db48f435f9119095b1a7373",class:"zonos--payment-component"}),h("div",{key:"bbdfdeee14b9a919b896bbe525763d850739cb4a",class:"zonos--payment-paypal-container"}))};Object.defineProperty(n.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(n,"watchers",{get:function(){return{stripeElements:["watchInitStripe"],stripe:["watchInitStripe"]}},enumerable:false,configurable:true});return n}();ZonosPayment.style=ZonosPaymentStyle0;var zonosPaypalPaymentCss=".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 ZonosPaypalPaymentStyle0=zonosPaypalPaymentCss;var ZonosPaypalPayment=function(){function n(n){registerInstance(this,n);this.paypalSessionDone=createEvent(this,"paypalSessionDone",7);this.paypalSessionFail=createEvent(this,"paypalSessionFail",7)}n.prototype.loadPaypal=function(){return __awaiter(this,void 0,void 0,(function(){var n,o;var t=this;return __generator(this,(function(a){if(!window.Zonos.paypal){log("Paypal is not available");return[2]}n=paypalStoreInitButtons({onPaypalFail:function(){log("onPaypalFail");t.paypalSessionFail.emit()},onPaypalSessionDone:function(n){var o=n.orderId;log("onPaypalSessionDone","info",{orderId:o});t.paypalSessionDone.emit({orderId:o})}});if(!(n===null||n===void 0?void 0:n.length)){log("There are no paypal buttons available");return[2]}o=this.el.querySelector(".zonos--payment-paypal-container");if(!o){log("Cannot find container element for paypal buttons");return[2]}n.forEach((function(n){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return[4,n.render(o)];case 1:t.sent();return[2]}}))}))}));return[2]}))}))};n.prototype.componentDidLoad=function(){void this.loadPaypal()};n.prototype.render=function(){return h(Host,{key:"23a85e68d356392c530adc7d006cbe4ffc5ff87c",class:"zonos--paypal-payment zonos--elements"},h("div",{key:"1488f9507505eaea91141c09265295acff6ca085",class:"zonos--payment-paypal-container"}))};Object.defineProperty(n.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return n}();ZonosPaypalPayment.style=ZonosPaypalPaymentStyle0;export{ZonosNotification as zonos_notification,ZonosPayment as zonos_payment,ZonosPaypalPayment as zonos_paypal_payment};
@@ -0,0 +1 @@
1
+ import{r as registerInstance,c as createEvent,h,H as Host}from"./index-86b8247e.js";import{d as zonosStoreFontFamily}from"./zonosStore-7798ac16.js";import{c as classes}from"./classes-0d95c529.js";var zonosToggleCss=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex}:host .wrapper{position:relative;border-radius:6px;background-color:var(--zonos-elements-gray-50);display:-ms-flexbox;display:flex}:host .zonos--toggle-selected-slider{z-index:1;position:absolute;background-color:var(--zonos-elements-raised-surface-color);height:100%;-webkit-box-shadow:var(--zonos-elements-shadow-button-standard);box-shadow:var(--zonos-elements-shadow-button-standard);border-radius:6px;-webkit-animation:translate 0.3s ease-in-out;animation:translate 0.3s ease-in-out}:host .zonos--option{background:transparent;border:0;z-index:2;cursor:pointer;padding:4px 12px;border-radius:6px;-webkit-transition:var(--zonos-elements-transition);transition:var(--zonos-elements-transition);font-size:var(--zonos-elements-font-size-base);font-weight:500;color:var(--zonos-elements-text-color-secondary)}:host .zonos--option:focus{outline:none}:host .zonos--option:hover:not(.selected){color:var(--zonos-elements-text-color)}:host .zonos--option.selected{color:var(--zonos-elements-text-color);background-color:var(--zonos-elements-raised-surface-color);height:100%;-webkit-box-shadow:var(--zonos-elements-shadow-button-standard);box-shadow:var(--zonos-elements-shadow-button-standard);border-radius:6px;-webkit-animation:translate 0.3s ease-in-out;animation:translate 0.3s ease-in-out}";var ZonosToggleStyle0=zonosToggleCss;var ZonosToggle=function(){function o(o){registerInstance(this,o);this.toggleChanged=createEvent(this,"toggleChanged",7);this.options=[];this.value=undefined}o.prototype.render=function(){var o=this;return h(Host,{key:"6af4c4574aed8e5a8d12e20d403f0e681429ce45",class:classes(["zonos--elements zonos--toggle"]),style:{"--font-family":zonosStoreFontFamily()}},h("div",{key:"8535f709cb6f2a2ad30cbaf782fc6d20363ca1dc",class:"wrapper"},this.options.map((function(s){var e=s.value===o.value;return h("button",{class:classes(["zonos--option",e&&"selected"]),key:s.value,onClick:function(){o.toggleChanged.emit(s.value)}},s.label)}))))};return o}();ZonosToggle.style=ZonosToggleStyle0;export{ZonosToggle as zonos_toggle};
@@ -1 +1 @@
1
- import{r as registerInstance,h,H as Host}from"./index-86b8247e.js";import{c as classes}from"./classes-0d95c529.js";var zonosTooltipCss=":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--tooltip{position:relative}:host .zonos--tooltip .zonos--tooltip-content{position:absolute;bottom:100%;left:0;width:-webkit-max-content;width:-moz-max-content;width:max-content;padding:12px;background-color:var(--zonos-elements-gray-1200);opacity:0;-webkit-transform:scale(0);transform:scale(0);-webkit-transition:all 0.2s ease-in-out;transition:all 0.2s ease-in-out;-webkit-transform-origin:bottom left;transform-origin:bottom left;border-radius:var(--zonos-elements-radius-4);z-index:100;-webkit-box-shadow:var(--zonos-elements-v3-shadow-large);box-shadow:var(--zonos-elements-v3-shadow-large)}:host .zonos--tooltip .zonos--tooltip-content.zonos--show-tooltip{opacity:1;-webkit-transform:scale(1);transform:scale(1)}";var ZonosTooltipStyle0=zonosTooltipCss;var ZonosTooltip=function(){function o(o){registerInstance(this,o);this.label="";this.subtitle="";this.showTooltip=false}o.prototype.render=function(){var o=this;return h(Host,{key:"091516a0a68f8b4ab2580a8118900c34b39e931c",class:"zonos--elements"},h("div",{key:"77769b18201f87d601d5bdb860a4bc8c84bb4e90",class:"zonos--tooltip",onMouseEnter:function(){return o.showTooltip=true},onMouseLeave:function(){return o.showTooltip=false}},h("slot",{key:"139c1de415b94e12b8d575e3662cba9faf56cb2f"}),h("div",{key:"60c38adf74e9b776001844c2205ac87a4562b525",class:classes([this.showTooltip&&"zonos--show-tooltip","zonos--tooltip-content"])},h("zonos-text",{key:"bb87c44ee7831c24b47c43b17d2b04c79112e900",size:"s",textColor:"gray-0",type:"boldLabel"},this.label),h("zonos-text",{key:"5d114d284a15a1661e926bfe5fae9251513c7370",size:"xs",textColor:"gray-0"},this.subtitle))))};return o}();ZonosTooltip.style=ZonosTooltipStyle0;export{ZonosTooltip as zonos_tooltip};
1
+ import{r as registerInstance,h,H as Host}from"./index-86b8247e.js";import{c as classes}from"./classes-0d95c529.js";var zonosTooltipCss=":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--tooltip{position:relative}:host .zonos--tooltip .zonos--tooltip-content{position:absolute;bottom:100%;left:0;width:-webkit-max-content;width:-moz-max-content;width:max-content;padding:12px;background-color:var(--zonos-elements-gray-1000);opacity:0;-webkit-transform:scale(0);transform:scale(0);-webkit-transition:all 0.2s ease-in-out;transition:all 0.2s ease-in-out;-webkit-transform-origin:bottom left;transform-origin:bottom left;border-radius:var(--zonos-elements-radius-4);z-index:100;-webkit-box-shadow:var(--zonos-elements-v3-shadow-large);box-shadow:var(--zonos-elements-v3-shadow-large)}:host .zonos--tooltip .zonos--tooltip-content.zonos--show-tooltip{opacity:1;-webkit-transform:scale(1);transform:scale(1)}";var ZonosTooltipStyle0=zonosTooltipCss;var ZonosTooltip=function(){function o(o){registerInstance(this,o);this.label="";this.subtitle="";this.showTooltip=false}o.prototype.render=function(){var o=this;return h(Host,{key:"214a19120cd770e0477c82fc9b25bd813bf05463",class:"zonos--elements"},h("div",{key:"cccee37a2e9a41dcb34427a652a83241277a54fd",class:"zonos--tooltip",onMouseEnter:function(){return o.showTooltip=true},onMouseLeave:function(){return o.showTooltip=false}},h("slot",{key:"67a0541e0bce6f73655b240973d51f9b6acca46b"}),h("div",{key:"6ce5cd0b9ecb34c4542d5ca9463e26347cf13a5a",class:classes([this.showTooltip&&"zonos--show-tooltip","zonos--tooltip-content"])},h("zonos-text",{key:"377287cc5ea7cd6840203dfef0e1cbee64621b98",size:"s",textColor:"gray-0",type:"boldLabel"},this.label),h("zonos-text",{key:"a7f46dedc27427fced022bbbd33f65428cb98f82",size:"xs",textColor:"gray-0"},this.subtitle))))};return o}();ZonosTooltip.style=ZonosTooltipStyle0;export{ZonosTooltip as zonos_tooltip};
@@ -1 +1 @@
1
- import{r as registerInstance,h,H as Host}from"./index-86b8247e.js";import{d as zonosStoreFontFamily}from"./zonosStore-7798ac16.js";import{c as classes}from"./classes-0d95c529.js";var zonosVStackCss=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .vstack{display:grid;grid-auto-columns:minmax(0, 1fr);grid-row-gap:var(--spacing, 24px);grid-auto-flow:row}";var ZonosVStackStyle0=zonosVStackCss;var VStack=function(){function t(t){registerInstance(this,t);this.spacing=24}t.prototype.render=function(){return h(Host,{key:"fca41f57f80879bf7cb32fa7858777a26a36755d",style:{"--font-family":zonosStoreFontFamily()}},h("div",{key:"8b608328327817a540c56dca58ad32ebe622d48e",class:classes(["vstack"]),style:{"grid-row-gap":"".concat(this.spacing,"px")}},h("slot",{key:"c29eeb4c2d0f781bdca44d355d2da75e15576d86"})))};return t}();VStack.style=ZonosVStackStyle0;export{VStack as zonos_v_stack};
1
+ import{r as registerInstance,h,H as Host}from"./index-86b8247e.js";import{d as zonosStoreFontFamily}from"./zonosStore-7798ac16.js";import{c as classes}from"./classes-0d95c529.js";var zonosVStackCss=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .vstack{display:grid;grid-auto-columns:minmax(0, 1fr);grid-row-gap:var(--spacing, 24px);grid-auto-flow:row}";var ZonosVStackStyle0=zonosVStackCss;var VStack=function(){function t(t){registerInstance(this,t);this.spacing=24}t.prototype.render=function(){return h(Host,{key:"b8c901920bc5f0822e1a14d68fceb4b0a71de8d0",style:{"--font-family":zonosStoreFontFamily()}},h("div",{key:"64db301d73963c2df229737bfa8c5d680ca748f2",class:classes(["vstack"]),style:{"grid-row-gap":"".concat(this.spacing,"px")}},h("slot",{key:"9381e547ba984aac20197e309c1893c95f817986"})))};return t}();VStack.style=ZonosVStackStyle0;export{VStack as zonos_v_stack};
@@ -1558,6 +1558,12 @@ type ShippingRichRadioItem = {
1558
1558
 
1559
1559
  type SpinnerColor = 'primary' | 'info' | 'success' | 'danger' | 'warning' | 'black' | 'white';
1560
1560
 
1561
+ type ToggleItem<TValue> = {
1562
+ isDisabled?: boolean;
1563
+ label: string;
1564
+ value: TValue;
1565
+ };
1566
+
1561
1567
  type GridSpacing = 0 | 4 | 8 | 12 | 16 | 20 | 24 | 32 | 40;
1562
1568
 
1563
1569
  /* eslint-disable */
@@ -2095,6 +2101,8 @@ declare namespace Components {
2095
2101
  */
2096
2102
  "handleOnClose": () => void;
2097
2103
  }
2104
+ interface ZonosCurrencyToggle {
2105
+ }
2098
2106
  interface ZonosCustomMessage {
2099
2107
  /**
2100
2108
  * The custom message icon
@@ -2488,6 +2496,16 @@ declare namespace Components {
2488
2496
  */
2489
2497
  "weight"?: FontWeight;
2490
2498
  }
2499
+ interface ZonosToggle {
2500
+ /**
2501
+ * Options for the toggle
2502
+ */
2503
+ "options": ToggleItem<string>[];
2504
+ /**
2505
+ * The selected option
2506
+ */
2507
+ "value": string;
2508
+ }
2491
2509
  interface ZonosTooltip {
2492
2510
  /**
2493
2511
  * The title of the tooltip
@@ -2596,6 +2614,10 @@ interface ZonosShippingRichRadioCustomEvent<T> extends CustomEvent<T> {
2596
2614
  detail: T;
2597
2615
  target: HTMLZonosShippingRichRadioElement;
2598
2616
  }
2617
+ interface ZonosToggleCustomEvent<T> extends CustomEvent<T> {
2618
+ detail: T;
2619
+ target: HTMLZonosToggleElement;
2620
+ }
2599
2621
  declare global {
2600
2622
  interface HTMLZonosAddressElementEventMap {
2601
2623
  "invalidCharacters": boolean;
@@ -2828,6 +2850,12 @@ declare global {
2828
2850
  prototype: HTMLZonosCountrySelectElement;
2829
2851
  new (): HTMLZonosCountrySelectElement;
2830
2852
  };
2853
+ interface HTMLZonosCurrencyToggleElement extends Components.ZonosCurrencyToggle, HTMLStencilElement {
2854
+ }
2855
+ var HTMLZonosCurrencyToggleElement: {
2856
+ prototype: HTMLZonosCurrencyToggleElement;
2857
+ new (): HTMLZonosCurrencyToggleElement;
2858
+ };
2831
2859
  interface HTMLZonosCustomMessageElement extends Components.ZonosCustomMessage, HTMLStencilElement {
2832
2860
  }
2833
2861
  var HTMLZonosCustomMessageElement: {
@@ -3038,6 +3066,23 @@ declare global {
3038
3066
  prototype: HTMLZonosTextElement;
3039
3067
  new (): HTMLZonosTextElement;
3040
3068
  };
3069
+ interface HTMLZonosToggleElementEventMap {
3070
+ "toggleChanged": string;
3071
+ }
3072
+ interface HTMLZonosToggleElement extends Components.ZonosToggle, HTMLStencilElement {
3073
+ addEventListener<K extends keyof HTMLZonosToggleElementEventMap>(type: K, listener: (this: HTMLZonosToggleElement, ev: ZonosToggleCustomEvent<HTMLZonosToggleElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
3074
+ addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
3075
+ addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
3076
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
3077
+ removeEventListener<K extends keyof HTMLZonosToggleElementEventMap>(type: K, listener: (this: HTMLZonosToggleElement, ev: ZonosToggleCustomEvent<HTMLZonosToggleElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
3078
+ removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
3079
+ removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
3080
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
3081
+ }
3082
+ var HTMLZonosToggleElement: {
3083
+ prototype: HTMLZonosToggleElement;
3084
+ new (): HTMLZonosToggleElement;
3085
+ };
3041
3086
  interface HTMLZonosTooltipElement extends Components.ZonosTooltip, HTMLStencilElement {
3042
3087
  }
3043
3088
  var HTMLZonosTooltipElement: {
@@ -3085,6 +3130,7 @@ declare global {
3085
3130
  "zonos-controller": HTMLZonosControllerElement;
3086
3131
  "zonos-country-flag": HTMLZonosCountryFlagElement;
3087
3132
  "zonos-country-select": HTMLZonosCountrySelectElement;
3133
+ "zonos-currency-toggle": HTMLZonosCurrencyToggleElement;
3088
3134
  "zonos-custom-message": HTMLZonosCustomMessageElement;
3089
3135
  "zonos-customer-info": HTMLZonosCustomerInfoElement;
3090
3136
  "zonos-dialog": HTMLZonosDialogElement;
@@ -3107,6 +3153,7 @@ declare global {
3107
3153
  "zonos-shipping-rich-radio": HTMLZonosShippingRichRadioElement;
3108
3154
  "zonos-spinner": HTMLZonosSpinnerElement;
3109
3155
  "zonos-text": HTMLZonosTextElement;
3156
+ "zonos-toggle": HTMLZonosToggleElement;
3110
3157
  "zonos-tooltip": HTMLZonosTooltipElement;
3111
3158
  "zonos-v-stack": HTMLZonosVStackElement;
3112
3159
  "zonos-virtual-scroll": HTMLZonosVirtualScrollElement;
@@ -3635,6 +3682,8 @@ declare namespace LocalJSX {
3635
3682
  */
3636
3683
  "handleOnClose"?: () => void;
3637
3684
  }
3685
+ interface ZonosCurrencyToggle {
3686
+ }
3638
3687
  interface ZonosCustomMessage {
3639
3688
  /**
3640
3689
  * The custom message icon
@@ -4027,6 +4076,20 @@ declare namespace LocalJSX {
4027
4076
  */
4028
4077
  "weight"?: FontWeight;
4029
4078
  }
4079
+ interface ZonosToggle {
4080
+ /**
4081
+ * Event emitted when the toggle changes
4082
+ */
4083
+ "onToggleChanged"?: (event: ZonosToggleCustomEvent<string>) => void;
4084
+ /**
4085
+ * Options for the toggle
4086
+ */
4087
+ "options"?: ToggleItem<string>[];
4088
+ /**
4089
+ * The selected option
4090
+ */
4091
+ "value": string;
4092
+ }
4030
4093
  interface ZonosTooltip {
4031
4094
  /**
4032
4095
  * The title of the tooltip
@@ -4098,6 +4161,7 @@ declare namespace LocalJSX {
4098
4161
  "zonos-controller": ZonosController;
4099
4162
  "zonos-country-flag": ZonosCountryFlag;
4100
4163
  "zonos-country-select": ZonosCountrySelect;
4164
+ "zonos-currency-toggle": ZonosCurrencyToggle;
4101
4165
  "zonos-custom-message": ZonosCustomMessage;
4102
4166
  "zonos-customer-info": ZonosCustomerInfo;
4103
4167
  "zonos-dialog": ZonosDialog;
@@ -4120,6 +4184,7 @@ declare namespace LocalJSX {
4120
4184
  "zonos-shipping-rich-radio": ZonosShippingRichRadio;
4121
4185
  "zonos-spinner": ZonosSpinner;
4122
4186
  "zonos-text": ZonosText;
4187
+ "zonos-toggle": ZonosToggle;
4123
4188
  "zonos-tooltip": ZonosTooltip;
4124
4189
  "zonos-v-stack": ZonosVStack;
4125
4190
  "zonos-virtual-scroll": ZonosVirtualScroll;
@@ -4152,6 +4217,7 @@ declare module "@stencil/core" {
4152
4217
  "zonos-controller": LocalJSX.ZonosController & JSXBase.HTMLAttributes<HTMLZonosControllerElement>;
4153
4218
  "zonos-country-flag": LocalJSX.ZonosCountryFlag & JSXBase.HTMLAttributes<HTMLZonosCountryFlagElement>;
4154
4219
  "zonos-country-select": LocalJSX.ZonosCountrySelect & JSXBase.HTMLAttributes<HTMLZonosCountrySelectElement>;
4220
+ "zonos-currency-toggle": LocalJSX.ZonosCurrencyToggle & JSXBase.HTMLAttributes<HTMLZonosCurrencyToggleElement>;
4155
4221
  "zonos-custom-message": LocalJSX.ZonosCustomMessage & JSXBase.HTMLAttributes<HTMLZonosCustomMessageElement>;
4156
4222
  "zonos-customer-info": LocalJSX.ZonosCustomerInfo & JSXBase.HTMLAttributes<HTMLZonosCustomerInfoElement>;
4157
4223
  "zonos-dialog": LocalJSX.ZonosDialog & JSXBase.HTMLAttributes<HTMLZonosDialogElement>;
@@ -4174,6 +4240,7 @@ declare module "@stencil/core" {
4174
4240
  "zonos-shipping-rich-radio": LocalJSX.ZonosShippingRichRadio & JSXBase.HTMLAttributes<HTMLZonosShippingRichRadioElement>;
4175
4241
  "zonos-spinner": LocalJSX.ZonosSpinner & JSXBase.HTMLAttributes<HTMLZonosSpinnerElement>;
4176
4242
  "zonos-text": LocalJSX.ZonosText & JSXBase.HTMLAttributes<HTMLZonosTextElement>;
4243
+ "zonos-toggle": LocalJSX.ZonosToggle & JSXBase.HTMLAttributes<HTMLZonosToggleElement>;
4177
4244
  "zonos-tooltip": LocalJSX.ZonosTooltip & JSXBase.HTMLAttributes<HTMLZonosTooltipElement>;
4178
4245
  "zonos-v-stack": LocalJSX.ZonosVStack & JSXBase.HTMLAttributes<HTMLZonosVStackElement>;
4179
4246
  /**
@@ -4418,6 +4485,12 @@ interface Zonos {
4418
4485
  * Version release timestamp
4419
4486
  */
4420
4487
  releaseDate: string;
4488
+ /**
4489
+ * Show toggle on checkout modal to show amount in base or foreign currency.
4490
+ * Set this to true or set param `zonosShowBaseForeign=1` in url to show the toggle
4491
+ * @default false
4492
+ */
4493
+ showBaseForeign: boolean;
4421
4494
  storeId: number;
4422
4495
  /** Stripe instance */
4423
4496
  stripe: Stripe;
@@ -4449,6 +4522,7 @@ declare abstract class Zonos {
4449
4522
  static isBigCommerce: boolean;
4450
4523
  static releaseDate: string;
4451
4524
  static isLegacyCheckout: boolean;
4525
+ static showBaseForeign: boolean;
4452
4526
  /**
4453
4527
  * By default, the package will load from npm
4454
4528
  */
@@ -1 +1 @@
1
- (function(){"use strict";const e=performance.now(),t=e=>{if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(t){if(e&&"function"==typeof e.toString){return e.toString()}return"Unable to stringify info"}},o=(o,n,...r)=>{var s,i;const l=performance.now()-e,a=[`(${l>1e3?`${(l/1e3).toFixed(2)}s`:`${l.toFixed(2)}ms`})`,...r];a.map(t).join(" ");if(!(!!(null===(s=window.Zonos)||void 0===s?void 0:s.debug)||!!window.location.search.match(/\?.*(&*)zonosDebug=1/)))return void("error"===n&&console.error(o,...a));let c=document.querySelector("iframe#zonos---debug-logging-iframe");c||(c=document.createElement("iframe"),c.id="zonos---debug-logging-iframe",c.style.display="none",c.style.opacity="0",c.style.position="absolute",c.style.top="-9999px",c.style.left="-9999px",c.style.width="1px",c.style.height="1px",c.style.border="none",c.style.overflow="hidden",c.style.visibility="hidden",document.body.appendChild(c));const d=(null===(i=c.contentWindow)||void 0===i?void 0:i.window.console)||window.console;switch(n){case"warn":d.warn(o,...a);break;case"info":d.info(o,...a);break;case"error":d.error(o,...a);break;default:d.groupCollapsed(o,...a),d.trace(),d.groupEnd()}},n=(e,...t)=>{o(e,"error",...t)},r=["jsdelivr","cdnjs","unpkg","vercel"],s="jsdelivr",i=e=>{const t=r.indexOf(e);return r[t+1]||null},l=()=>{const e=window&&window.location.href.includes("forceLoadCdn");if("undefined"==typeof window||e)return null;const t=(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.100.js.zonos.com";if(!t&&(n.includes("test.")||n.includes("test-")))return n;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 r=`https://${t}.preview.js.zonos.com`;return o(`[ZONOS-WARNING] using '${r}' for loading elements 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},a="https://js.stripe.com/v3",c=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,d="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let u=null;const p=e=>(null!==u||(u=new Promise(((t,o)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(d),window.Stripe)t(window.Stripe);else try{let r=(()=>{const e=document.querySelectorAll(`script[src^="${a}"]`);for(let t=0;t<e.length;t++){const o=e[t];if(o&&c.test(o.src))return o}return null})();r&&e?console.warn(d):r||(r=(e=>{const t=document.createElement("script");t.src=`${a}`;const o=document.head||document.body;return o?(o.appendChild(t),t):(n("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})()),null==r||r.addEventListener("load",(()=>{window.Stripe?t(window.Stripe):o(new Error("Stripe.js not available"))})),null==r||r.addEventListener("error",(()=>{o(new Error("Failed to load Stripe.js"))}))}catch(e){return void o(e)}else t(null)}))),u),m=Promise.resolve().then((()=>p(null)));let h=!1;m.catch((e=>{h||console.warn(e)}));function y(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 w=["cloudflare","vercel"],f=w[0],g={cloudflare:"https://route.elements.zonos.com",vercel:"https://v1.route.js.zonos.com"},v=g[f],b=(e=f)=>{const t=w.indexOf(e),o=w[t+1];return o||null},S=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(e){return null}return null},z=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}},j=async({basePathType:e,options:t,path:o})=>{let n;const r=window.Zonos.zonosQaUrlApi||g[e]||f,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 z({response:n}),response:n,zonosMode:i}}const a=n.status.toString();try{const e=await z({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}}},O=async({basePathType:e,options:t,path:n})=>{var r,s;const i=n.startsWith("/api/bigcommerce")?"vercel":e,l=await j({basePathType:i,options:t,path:n}),{errors:a,response:c}=l,d=y(l,["errors","response"]),u=b(i),p=!!a.find((({type:e})=>"unknown"===e))||404===(null==c?void 0:c.status),m=u&&p;return p&&(async({endpoint:e,errors:t,metadata:n,shouldPostReleaseErrorReporting:r})=>{if(o("sendErrorLog","warn",e,n,t),r){const e=Number(window.Zonos.releaseDate);if((new Date).getTime()-e>36e5)return}const s="userAgentData"in window.navigator?window.navigator.userAgentData:null,i={endpoint:e,errors:t,metadata:Object.assign({href:window.location.href,userAgent:s&&s.brands.length>0?s:window.navigator.userAgent},n)};try{fetch(`${v}/api/zonos-elements/log-error`,{body:JSON.stringify(i),headers:{"Zonos-Referer":window.location.hostname},method:"POST"})}catch(e){const t=b();if(!t)return;fetch(`${g[t]}/api/zonos-elements/log-error`,{body:JSON.stringify(i),method:"POST"})}})({endpoint:g[i]+n,errors:a.map((({message:e})=>`API: ${e}`)),metadata:{currentBasePath:i,nextFallbackApiType:u,requestHeaders:null==t?void 0:t.headers,requestPayload:S(null===(r=null==t?void 0:t.body)||void 0===r?void 0:r.toString())||(null===(s=null==t?void 0:t.body)||void 0===s?void 0:s.toString()),status:null==c?void 0:c.status,statusText:null==c?void 0:c.statusText},shouldPostReleaseErrorReporting:!0}),m?(o(`=== "${n}" failed to fetch, trying next fallback ${u}`),O({basePathType:u,options:t,path:n})):Object.assign({errors:a,response:c},d)},C=async e=>{const t="1"===new URLSearchParams(window.location.search).get("zonosTestMode"),{errors:n,json:r}=await(async(e,t)=>{const n=y(t||{},[]),r=n.body?JSON.stringify(n.body):void 0,s=n.method||"GET",i=Object.assign({"Content-Type":"application/json","Zonos-Is-BigCommerce":window.Zonos.isBigCommerce.toString(),"Zonos-Referer":window.location.hostname,"Zonos-Version":window.Zonos.version,credentialtoken:window.Zonos.zonosApiKey||"Empty credential token from zonos-elements"},n.headers),l=Object.assign(Object.assign({},n),{body:"GET"===s?void 0:r,headers:i,method:s}),a=new URLSearchParams(window.location.search).get("useFallbackApi");return o(e,"info"),O({basePathType:a||f,options:l,path:e})})("/api/zonos-elements/get-temp-cart",{body:{isTestMode:t,tempCartUUID:e},headers:{"Content-Type":"application/json"},method:"POST"});return!r||n.length?null:r};var k;const E=(()=>{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","dev.assets-checkout.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})(),A="https://v1.3.100.js.zonos.com",U=E||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.100",Z="https://rsms.me",T="https://fonts.googleapis.com",$=/^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;class P{}k=P,P.doneInit=!1,P.debug="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/),P.zonosConversionTest="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/),P._paypalMockResponse=null,P.isBigCommerce=!1,P.releaseDate="1729193940551",P.isLegacyCheckout=!1,P.isNpm=!0,P.zonosQaUrl=null,P.zonosQaUrlApi=null,P.version="v1.3.100",P.modeAlerted=!1,P.cartData=null,P.paypal=null,P.getCurrentTimestamp=()=>(new Date).getTime(),P.zonosController=null,P.init=async({appearance:e,checkoutSettings:t,currencyConverter:r,helloSettings:s,onCountryChange:i,overrideCurrencyFormat:l,storeId:a,zonosApiKey:c})=>{if(k.cartId=new URLSearchParams(window.location.search).get("tempCartUUID"),!k.doneInit){if(o(`====== ZONOS DEBUG MODE: on (${k.version}) ======`),k.zonosApiKey=c,k.storeId=a,k.isNpm){if(o("====== ZONOS LOADING FROM NPM ======"),!c&&!k.cartId)return void n("Zonos API key is required unless `tempCartUUID` is provided in url query params.");if(!k.cartData&&k.cartId){o("Initialize cart data");const e=await(async e=>{const t=await C(e);return o("[ZONOS - loadZonos] getting temp cart data","info",t),t?{cartData:t.cartData,storeFavicon:t.storeFaviconUrl,storeId:t.cartData.storeId,storeLogo:t.storeLogoUrl,zonosApiKey:t.cartData.credentialToken}:(n("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),null)})(k.cartId);if(!e)return void n("Failed to get cart data");k.cartData=e.cartData,k.zonosApiKey=e.zonosApiKey}}if(k.cartId&&k.cartData){o("Cart data is available, inject hidden button and trigger checkout");const e=document.createElement("button");e.style.display="none",e.id="zonos--checkout-hidden-button",document.body.appendChild(e)}o("init zonos"),k.injectZonosCdn(),k.injectZonosCss(),k.injectFonts(),k.injectController({config:{appearance:e,checkoutSettings:t,currencyConverter:r,helloSettings:s,onCountryChange:i,overrideCurrencyFormat:l}}),k.doneInit=!0}},P.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},P.openHelloDialog=e=>{const t=document.querySelector("zonos-hello");t&&t.openHelloDialog(null==e||e)},P.showNotification=e=>{var t;null===(t=k.zonosController)||void 0===t||t.showNotification(e)},P.updateOrganizationName=e=>{var t;null===(t=k.zonosController)||void 0===t||t.updateOrganizationName(e)},P.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)}},P.injectController=({config:e})=>{var t;if(document.querySelector("zonos-controller"))return;if(null===(t=e.checkoutSettings)||void 0===t?void 0:t.placeOrderButtonSelector){const t=e.checkoutSettings.placeOrderButtonSelector;k.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:t});new MutationObserver((()=>{k.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:t})})).observe(document.body,{childList:!0,subtree:!0})}const r=document.createElement("zonos-controller");r.config=e,r.zonosApiKey=k.zonosApiKey||"",r.addEventListener("stripeInitEvent",(async e=>{const{detail:t}=e;o("loading Stripe");const s=await(async(...e)=>{h=!0;const t=Date.now();return m.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)))})(t.publishableKey);s?(window.Zonos.stripe=s,r.initCheckoutElement(s)):n("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(r),k.zonosController=r,o("Zonos controller injected!")},P.injectScript=({cdnType:e,isModule:t,theRestUrl:r})=>{const s=`${k.getZonosUrl(e)}/${r}`;if(document.querySelector(`script[src="${s}"]`))return void o(`Zonos script "${s}" already exists in the document`,"warn");const l=document.head||document.body,a=document.createElement("script");t?a.type="module":a.noModule=!0,a.src=s,a.crossOrigin="anonymous",a.onerror=()=>{n(`Failed to load ${a.src}`);const o=i(e);o&&k.injectScript({cdnType:o,isModule:t,theRestUrl:r})},l.appendChild(a)},P.getZonosUrl=e=>{const t=()=>{switch(e){case"jsdelivr":return U;case"unpkg":return"https://unpkg.com/@zonos/elements@1.3.100";case"cdnjs":return"https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.100";case"vercel":return A}};if(k.isNpm){return l()||t()}return t()},P.injectZonosCdn=()=>{k.injectScript({cdnType:s,isModule:!0,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),k.injectScript({cdnType:s,isModule:!1,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),o("Zonos cdn script injected!")},P.injectStylesheet=({cdnType:e,theRestUrl:t})=>{const o=k.getZonosUrl(e),r=document.head||document.body,s=document.createElement("link");s.rel="preconnect",s.href=`${A}/`,r.appendChild(s);const l=document.createElement("link");l.rel="stylesheet",l.href=`${o}/${t}`,l.onerror=()=>{n(`Failed to load ${l.href}`);const o=i(e);o&&k.injectStylesheet({cdnType:o,theRestUrl:t})},r.appendChild(l)},P.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?o("Zonos style links already injected","warn"):(k.injectStylesheet({cdnType:s,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),o("Zonos style css injected!"))},P.injectFonts=()=>{if((()=>{const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${Z}"]`);for(let t=0;t<e.length;t++){const o=e[t];if(o&&!$.test(o.href))return o}return null})())return void o("Inter font already injected","warn");const e=document.head||document.body,t=document.createElement("link");t.rel="preconnect",t.href=Z,e.appendChild(t);const n=document.createElement("link");n.rel="stylesheet",n.href=`${Z}/inter/inter.css`,e.appendChild(n),o("Zonos font injected!")},P.setupGoogleFont=e=>{var t;null===(t=k.zonosController)||void 0===t||t.setupGoogleFont(e)},P.injectSupportGoogleFont=e=>{var t;o(`[FONT] injecting ${e}`);const n=null===(t=e.match(/family=(.*?):/))||void 0===t?void 0:t[1],r=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${T}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=T,r.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${e}"]`))return void o(`[FONT] ${n} font already injected`,"warn");const s=document.createElement("link");s.rel="stylesheet",s.href=e,r.appendChild(s),o(`[FONT] ${n} font injected!`)},exports.Zonos=P})();
1
+ (function(){"use strict";const e=performance.now(),t=e=>{if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(t){if(e&&"function"==typeof e.toString){return e.toString()}return"Unable to stringify info"}},o=(o,n,...r)=>{var s,i;const l=performance.now()-e,a=[`(${l>1e3?`${(l/1e3).toFixed(2)}s`:`${l.toFixed(2)}ms`})`,...r];a.map(t).join(" ");if(!(!!(null===(s=window.Zonos)||void 0===s?void 0:s.debug)||!!window.location.search.match(/\?.*(&*)zonosDebug=1/)))return void("error"===n&&console.error(o,...a));let c=document.querySelector("iframe#zonos---debug-logging-iframe");c||(c=document.createElement("iframe"),c.id="zonos---debug-logging-iframe",c.style.display="none",c.style.opacity="0",c.style.position="absolute",c.style.top="-9999px",c.style.left="-9999px",c.style.width="1px",c.style.height="1px",c.style.border="none",c.style.overflow="hidden",c.style.visibility="hidden",document.body.appendChild(c));const d=(null===(i=c.contentWindow)||void 0===i?void 0:i.window.console)||window.console;switch(n){case"warn":d.warn(o,...a);break;case"info":d.info(o,...a);break;case"error":d.error(o,...a);break;default:d.groupCollapsed(o,...a),d.trace(),d.groupEnd()}},n=(e,...t)=>{o(e,"error",...t)},r=["jsdelivr","cdnjs","unpkg","vercel"],s="jsdelivr",i=e=>{const t=r.indexOf(e);return r[t+1]||null},l=()=>{const e=window&&window.location.href.includes("forceLoadCdn");if("undefined"==typeof window||e)return null;const t=(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.101.js.zonos.com";if(!t&&(n.includes("test.")||n.includes("test-")))return n;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 r=`https://${t}.preview.js.zonos.com`;return o(`[ZONOS-WARNING] using '${r}' for loading elements 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},a="https://js.stripe.com/v3",c=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,d="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let u=null;const p=e=>(null!==u||(u=new Promise(((t,o)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(d),window.Stripe)t(window.Stripe);else try{let r=(()=>{const e=document.querySelectorAll(`script[src^="${a}"]`);for(let t=0;t<e.length;t++){const o=e[t];if(o&&c.test(o.src))return o}return null})();r&&e?console.warn(d):r||(r=(e=>{const t=document.createElement("script");t.src=`${a}`;const o=document.head||document.body;return o?(o.appendChild(t),t):(n("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})()),null==r||r.addEventListener("load",(()=>{window.Stripe?t(window.Stripe):o(new Error("Stripe.js not available"))})),null==r||r.addEventListener("error",(()=>{o(new Error("Failed to load Stripe.js"))}))}catch(e){return void o(e)}else t(null)}))),u),m=Promise.resolve().then((()=>p(null)));let h=!1;m.catch((e=>{h||console.warn(e)}));function y(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 w=["cloudflare","vercel"],f=w[0],g={cloudflare:"https://route.elements.zonos.com",vercel:"https://v1.route.js.zonos.com"},v=g[f],b=(e=f)=>{const t=w.indexOf(e),o=w[t+1];return o||null},S=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(e){return null}return null},z=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}},j=async({basePathType:e,options:t,path:o})=>{let n;const r=window.Zonos.zonosQaUrlApi||g[e]||f,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 z({response:n}),response:n,zonosMode:i}}const a=n.status.toString();try{const e=await z({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}}},O=async({basePathType:e,options:t,path:n})=>{var r,s;const i=n.startsWith("/api/bigcommerce")?"vercel":e,l=await j({basePathType:i,options:t,path:n}),{errors:a,response:c}=l,d=y(l,["errors","response"]),u=b(i),p=!!a.find((({type:e})=>"unknown"===e))||404===(null==c?void 0:c.status),m=u&&p;return p&&(async({endpoint:e,errors:t,metadata:n,shouldPostReleaseErrorReporting:r})=>{if(o("sendErrorLog","warn",e,n,t),r){const e=Number(window.Zonos.releaseDate);if((new Date).getTime()-e>36e5)return}const s="userAgentData"in window.navigator?window.navigator.userAgentData:null,i={endpoint:e,errors:t,metadata:Object.assign({href:window.location.href,userAgent:s&&s.brands.length>0?s:window.navigator.userAgent},n)};try{fetch(`${v}/api/zonos-elements/log-error`,{body:JSON.stringify(i),headers:{"Zonos-Referer":window.location.hostname},method:"POST"})}catch(e){const t=b();if(!t)return;fetch(`${g[t]}/api/zonos-elements/log-error`,{body:JSON.stringify(i),method:"POST"})}})({endpoint:g[i]+n,errors:a.map((({message:e})=>`API: ${e}`)),metadata:{currentBasePath:i,nextFallbackApiType:u,requestHeaders:null==t?void 0:t.headers,requestPayload:S(null===(r=null==t?void 0:t.body)||void 0===r?void 0:r.toString())||(null===(s=null==t?void 0:t.body)||void 0===s?void 0:s.toString()),status:null==c?void 0:c.status,statusText:null==c?void 0:c.statusText},shouldPostReleaseErrorReporting:!0}),m?(o(`=== "${n}" failed to fetch, trying next fallback ${u}`),O({basePathType:u,options:t,path:n})):Object.assign({errors:a,response:c},d)},C=async e=>{const t="1"===new URLSearchParams(window.location.search).get("zonosTestMode"),{errors:n,json:r}=await(async(e,t)=>{const n=y(t||{},[]),r=n.body?JSON.stringify(n.body):void 0,s=n.method||"GET",i=Object.assign({"Content-Type":"application/json","Zonos-Is-BigCommerce":window.Zonos.isBigCommerce.toString(),"Zonos-Referer":window.location.hostname,"Zonos-Version":window.Zonos.version,credentialtoken:window.Zonos.zonosApiKey||"Empty credential token from zonos-elements"},n.headers),l=Object.assign(Object.assign({},n),{body:"GET"===s?void 0:r,headers:i,method:s}),a=new URLSearchParams(window.location.search).get("useFallbackApi");return o(e,"info"),O({basePathType:a||f,options:l,path:e})})("/api/zonos-elements/get-temp-cart",{body:{isTestMode:t,tempCartUUID:e},headers:{"Content-Type":"application/json"},method:"POST"});return!r||n.length?null:r};var k;const E=(()=>{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","dev.assets-checkout.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})(),A="https://v1.3.101.js.zonos.com",U=E||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.101",Z="https://rsms.me",T="https://fonts.googleapis.com",$=/^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;class P{}k=P,P.doneInit=!1,P.debug="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/),P.zonosConversionTest="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/),P._paypalMockResponse=null,P.isBigCommerce=!1,P.releaseDate="1729200065858",P.isLegacyCheckout=!1,P.showBaseForeign="undefined"!=typeof window&&window.location.search.includes("zonosShowBaseForeign"),P.isNpm=!0,P.zonosQaUrl=null,P.zonosQaUrlApi=null,P.version="v1.3.101",P.modeAlerted=!1,P.cartData=null,P.paypal=null,P.getCurrentTimestamp=()=>(new Date).getTime(),P.zonosController=null,P.init=async({appearance:e,checkoutSettings:t,currencyConverter:r,helloSettings:s,onCountryChange:i,overrideCurrencyFormat:l,storeId:a,zonosApiKey:c})=>{if(k.cartId=new URLSearchParams(window.location.search).get("tempCartUUID"),!k.doneInit){if(o(`====== ZONOS DEBUG MODE: on (${k.version}) ======`),k.zonosApiKey=c,k.storeId=a,k.isNpm){if(o("====== ZONOS LOADING FROM NPM ======"),!c&&!k.cartId)return void n("Zonos API key is required unless `tempCartUUID` is provided in url query params.");if(!k.cartData&&k.cartId){o("Initialize cart data");const e=await(async e=>{const t=await C(e);return o("[ZONOS - loadZonos] getting temp cart data","info",t),t?{cartData:t.cartData,storeFavicon:t.storeFaviconUrl,storeId:t.cartData.storeId,storeLogo:t.storeLogoUrl,zonosApiKey:t.cartData.credentialToken}:(n("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),null)})(k.cartId);if(!e)return void n("Failed to get cart data");k.cartData=e.cartData,k.zonosApiKey=e.zonosApiKey}}if(k.cartId&&k.cartData){o("Cart data is available, inject hidden button and trigger checkout");const e=document.createElement("button");e.style.display="none",e.id="zonos--checkout-hidden-button",document.body.appendChild(e)}o("init zonos"),k.injectZonosCdn(),k.injectZonosCss(),k.injectFonts(),k.injectController({config:{appearance:e,checkoutSettings:t,currencyConverter:r,helloSettings:s,onCountryChange:i,overrideCurrencyFormat:l}}),k.doneInit=!0}},P.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},P.openHelloDialog=e=>{const t=document.querySelector("zonos-hello");t&&t.openHelloDialog(null==e||e)},P.showNotification=e=>{var t;null===(t=k.zonosController)||void 0===t||t.showNotification(e)},P.updateOrganizationName=e=>{var t;null===(t=k.zonosController)||void 0===t||t.updateOrganizationName(e)},P.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)}},P.injectController=({config:e})=>{var t;if(document.querySelector("zonos-controller"))return;if(null===(t=e.checkoutSettings)||void 0===t?void 0:t.placeOrderButtonSelector){const t=e.checkoutSettings.placeOrderButtonSelector;k.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:t});new MutationObserver((()=>{k.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:t})})).observe(document.body,{childList:!0,subtree:!0})}const r=document.createElement("zonos-controller");r.config=e,r.zonosApiKey=k.zonosApiKey||"",r.addEventListener("stripeInitEvent",(async e=>{const{detail:t}=e;o("loading Stripe");const s=await(async(...e)=>{h=!0;const t=Date.now();return m.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)))})(t.publishableKey);s?(window.Zonos.stripe=s,r.initCheckoutElement(s)):n("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(r),k.zonosController=r,o("Zonos controller injected!")},P.injectScript=({cdnType:e,isModule:t,theRestUrl:r})=>{const s=`${k.getZonosUrl(e)}/${r}`;if(document.querySelector(`script[src="${s}"]`))return void o(`Zonos script "${s}" already exists in the document`,"warn");const l=document.head||document.body,a=document.createElement("script");t?a.type="module":a.noModule=!0,a.src=s,a.crossOrigin="anonymous",a.onerror=()=>{n(`Failed to load ${a.src}`);const o=i(e);o&&k.injectScript({cdnType:o,isModule:t,theRestUrl:r})},l.appendChild(a)},P.getZonosUrl=e=>{const t=()=>{switch(e){case"jsdelivr":return U;case"unpkg":return"https://unpkg.com/@zonos/elements@1.3.101";case"cdnjs":return"https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.101";case"vercel":return A}};if(k.isNpm){return l()||t()}return t()},P.injectZonosCdn=()=>{k.injectScript({cdnType:s,isModule:!0,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),k.injectScript({cdnType:s,isModule:!1,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),o("Zonos cdn script injected!")},P.injectStylesheet=({cdnType:e,theRestUrl:t})=>{const o=k.getZonosUrl(e),r=document.head||document.body,s=document.createElement("link");s.rel="preconnect",s.href=`${A}/`,r.appendChild(s);const l=document.createElement("link");l.rel="stylesheet",l.href=`${o}/${t}`,l.onerror=()=>{n(`Failed to load ${l.href}`);const o=i(e);o&&k.injectStylesheet({cdnType:o,theRestUrl:t})},r.appendChild(l)},P.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?o("Zonos style links already injected","warn"):(k.injectStylesheet({cdnType:s,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),o("Zonos style css injected!"))},P.injectFonts=()=>{if((()=>{const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${Z}"]`);for(let t=0;t<e.length;t++){const o=e[t];if(o&&!$.test(o.href))return o}return null})())return void o("Inter font already injected","warn");const e=document.head||document.body,t=document.createElement("link");t.rel="preconnect",t.href=Z,e.appendChild(t);const n=document.createElement("link");n.rel="stylesheet",n.href=`${Z}/inter/inter.css`,e.appendChild(n),o("Zonos font injected!")},P.setupGoogleFont=e=>{var t;null===(t=k.zonosController)||void 0===t||t.setupGoogleFont(e)},P.injectSupportGoogleFont=e=>{var t;o(`[FONT] injecting ${e}`);const n=null===(t=e.match(/family=(.*?):/))||void 0===t?void 0:t[1],r=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${T}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=T,r.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${e}"]`))return void o(`[FONT] ${n} font already injected`,"warn");const s=document.createElement("link");s.rel="stylesheet",s.href=e,r.appendChild(s),o(`[FONT] ${n} font injected!`)},exports.Zonos=P})();
@@ -1 +1 @@
1
- (function(){"use strict";function e(e,o){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&o.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var t=0;for(r=Object.getOwnPropertySymbols(e);t<r.length;t++)o.indexOf(r[t])<0&&Object.prototype.propertyIsEnumerable.call(e,r[t])&&(n[r[t]]=e[r[t]])}return n}"function"==typeof SuppressedError&&SuppressedError;const o=["cloudflare","vercel"],n=o[0],r={cloudflare:"https://route.elements.zonos.com",vercel:"https://v1.route.js.zonos.com"},t=r[n],s=(e=n)=>{const r=o.indexOf(e),t=o[r+1];return t||null},i=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(e){return null}return null},a=performance.now(),c=e=>{if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(o){if(e&&"function"==typeof e.toString){return e.toString()}return"Unable to stringify info"}},l=(e,o,...n)=>{var r,t;const s=performance.now()-a,i=[`(${s>1e3?`${(s/1e3).toFixed(2)}s`:`${s.toFixed(2)}ms`})`,...n];i.map(c).join(" ");if(!(!!(null===(r=window.Zonos)||void 0===r?void 0:r.debug)||!!window.location.search.match(/\?.*(&*)zonosDebug=1/)))return void("error"===o&&console.error(e,...i));let l=document.querySelector("iframe#zonos---debug-logging-iframe");l||(l=document.createElement("iframe"),l.id="zonos---debug-logging-iframe",l.style.display="none",l.style.opacity="0",l.style.position="absolute",l.style.top="-9999px",l.style.left="-9999px",l.style.width="1px",l.style.height="1px",l.style.border="none",l.style.overflow="hidden",l.style.visibility="hidden",document.body.appendChild(l));const d=(null===(t=l.contentWindow)||void 0===t?void 0:t.window.console)||window.console;switch(o){case"warn":d.warn(e,...i);break;case"info":d.info(e,...i);break;case"error":d.error(e,...i);break;default:d.groupCollapsed(e,...i),d.trace(),d.groupEnd()}},d=async({endpoint:e,errors:o,metadata:n,shouldPostReleaseErrorReporting:i})=>{if(l("sendErrorLog","warn",e,n,o),i){const e=Number(window.Zonos.releaseDate);if((new Date).getTime()-e>36e5)return}const a="userAgentData"in window.navigator?window.navigator.userAgentData:null,c={endpoint:e,errors:o,metadata:Object.assign({href:window.location.href,userAgent:a&&a.brands.length>0?a:window.navigator.userAgent},n)};try{fetch(`${t}/api/zonos-elements/log-error`,{body:JSON.stringify(c),headers:{"Zonos-Referer":window.location.hostname},method:"POST"})}catch(e){const o=s();if(!o)return;fetch(`${r[o]}/api/zonos-elements/log-error`,{body:JSON.stringify(c),method:"POST"})}},p=async({response:e,shouldLog:o=!0,shouldThrow:n=!1})=>{try{return await e.json()}catch(e){if(n)throw e;return o&&console.error(e),null}},u=async({basePathType:e,options:o,path:t})=>{let s;const i=window.Zonos.zonosQaUrlApi||r[e]||n,a=new URL(i+t);a.searchParams.set("zToken",(e=>{try{return btoa(e).replace(/=/g,"")}catch(o){return e.replace(/[^A-Za-z0-9]/g,"").split("").reverse().join("")}})(window.location.hostname));try{s=await fetch(a.toString(),o)}catch(e){if(e instanceof Error)return{baseUrl:i,errors:[{message:e.message,type:"unknown"}],json:null,response:null,zonosMode:null};return{baseUrl:i,errors:[{message:"Failed to fetch",type:"unknown"}],json:null,response:null,zonosMode:null}}const c=s.headers.get("Zonos-Mode"),l=window.Zonos.zonosQaUrl;if(!window.Zonos.modeAlerted&&c&&l&&(window.Zonos.modeAlerted=!0),s.ok){return{baseUrl:i,errors:[],json:await p({response:s}),response:s,zonosMode:c}}const d=s.status.toString();try{const e=await p({response:s,shouldThrow:!0});return{baseUrl:i,errors:[{message:JSON.stringify(e),type:d}],json:null,response:s,zonosMode:c}}catch(e){return{baseUrl:i,errors:[{message:`${d}: ${"Unknown error"}`,type:d}],json:null,response:null,zonosMode:c}}},m=async({basePathType:o,options:n,path:t})=>{var a,c;const p=t.startsWith("/api/bigcommerce")?"vercel":o,g=await u({basePathType:p,options:n,path:t}),{errors:w,response:f}=g,h=e(g,["errors","response"]),y=s(p),v=!!w.find((({type:e})=>"unknown"===e))||404===(null==f?void 0:f.status),S=y&&v;return v&&d({endpoint:r[p]+t,errors:w.map((({message:e})=>`API: ${e}`)),metadata:{currentBasePath:p,nextFallbackApiType:y,requestHeaders:null==n?void 0:n.headers,requestPayload:i(null===(a=null==n?void 0:n.body)||void 0===a?void 0:a.toString())||(null===(c=null==n?void 0:n.body)||void 0===c?void 0:c.toString()),status:null==f?void 0:f.status,statusText:null==f?void 0:f.statusText},shouldPostReleaseErrorReporting:!0}),S?(l(`=== "${t}" failed to fetch, trying next fallback ${y}`),m({basePathType:y,options:n,path:t})):Object.assign({errors:w,response:f},h)},g=async(o,r)=>{const t=e(r||{},[]),s=t.body?JSON.stringify(t.body):void 0,i=t.method||"GET",a=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"},t.headers),c=Object.assign(Object.assign({},t),{body:"GET"===i?void 0:s,headers:a,method:i}),d=new URLSearchParams(window.location.search).get("useFallbackApi");return l(o,"info"),m({basePathType:d||n,options:c,path:o})},w=(e,...o)=>{l(e,"error",...o)},f=["jsdelivr","cdnjs","unpkg","vercel"],h=e=>{if(!e)return null;const o=new URL(e).searchParams.get("zonosQaUrl");if(!o)return null;return/[^a-zA-Z0-9-_]+/.test(o)?null:o},y=async e=>{const o=await(async e=>{const o="1"===new URLSearchParams(window.location.search).get("zonosTestMode"),{errors:n,json:r}=await g("/api/zonos-elements/get-temp-cart",{body:{isTestMode:o,tempCartUUID:e},headers:{"Content-Type":"application/json"},method:"POST"});return!r||n.length?null:r})(e);return l("[ZONOS - loadZonos] getting temp cart data","info",o),o?{cartData:o.cartData,storeFavicon:o.storeFaviconUrl,storeId:o.cartData.storeId,storeLogo:o.storeLogoUrl,zonosApiKey:o.cartData.credentialToken}:(w("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),null)};var v;const S=(()=>{const e=window&&window.location.href.includes("forceLoadCdn");if("undefined"==typeof window||e)return null;const o=h(window.location.href),n="https://v1.3.100.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 l(`[ZONOS-WARNING] using '${r}' for loading elements 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:o}=window.location,n=`${o}?${e.toString()}`;return window.history.replaceState(window.history.state,"",n),window.location.reload(),null})),r})(),z=(()=>{const e=(e=>{if(!e)return null;const o=new URL(e).searchParams.get("zonosQaUrlApi");return o?/[^a-zA-Z0-9-_]+/.test(o)?null:o:null})(window.location.href),o=h(window.location.href),n=e||o;if(!n&&["dev.demo.elements.zonos.com"].includes(window.location.hostname))return"https://dev.demo.elements.zonos.com";if(!n)return null;if("dev-elements"===n)return"https://dev.demo.elements.zonos.com";if(!e)return null;const r=`https://${e}.route.js.zonos.com`;return l(`[ZONOS-WARNING] using '${r}' for serverless API`,"warn"),r})();class L{static get isNpm(){return!1}}v=L,L.isBigCommerce=!1,L.requested=!1,L.cartData=null,L.isLegacyCheckout=!1,L.legacyStoreLogo=null,L.legacyStoreFavicon=null,L.parallelLoadTimes=[],L.parallelLoadState="off",L.releaseDate="1729193940551",L.loadScriptLogHandler=async({cdnLoadTime:e,fallbackLoadTime:o,isError:n,metadata:r,scriptLoadUrl:t,storeId:s,type:i})=>{try{const e=window.performance.getEntriesByType("resource").find((e=>{const o=e;return o.name.includes(t)&&"script"===o.initiatorType}));null==e||e.transferSize;(async e=>{})((e&&(null==e?void 0:e.duration)>0?parseFloat(e.duration.toFixed(2)):parseFloat(o.toFixed(2)),Object.assign({decodedBodySize:null==e?void 0:e.decodedBodySize,encodedBodySize:null==e?void 0:e.encodedBodySize,fallbackLoadTime:o,isError:!!n},r)))}catch(e){}},L.loadScriptLogParallelHandler=async e=>{try{if(v.parallelLoadTimes.push(e),2===v.parallelLoadTimes.length){const e=v.parallelLoadTimes.find((e=>"vercel"===e.type)),o=v.parallelLoadTimes.find((e=>"jsdelivr"===e.type));if(!e||!o)return;if(e.isError&&o.isError)return void d({endpoint:`<${e.scriptLoadUrl}> <${o.scriptLoadUrl}>`,errors:["Failed to fetch both Vercel and jsdelivr CDN. Perhaps network issue on customer site."],metadata:{cdnLoadTime:o.fallbackLoadTime,cdnType:o.type,vercelLoadTime:e.fallbackLoadTime}});v.loadScriptLogHandler({cdnLoadTime:o.fallbackLoadTime,fallbackLoadTime:e.fallbackLoadTime,isError:e.isError,metadata:{cdnScriptFallbackTime:o.fallbackLoadTime,cdnScriptIsError:!!o.isError,cdnScriptLoadUrl:o.scriptLoadUrl,cdnScriptType:o.type},scriptLoadUrl:e.scriptLoadUrl,storeId:e.storeId,type:e.type})}}catch(e){}},L.legacyCheckoutErrorHandler=({message:e})=>{w(`[ZONOS - loadZonos] ${e}`),d({endpoint:"LegacyCheckoutInit",errors:[e],metadata:{tempCartUUID:v.cartId}}),document.dispatchEvent(new CustomEvent("legacyCheckoutError",{detail:e}))},L.getGithubCdn=({type:e,version:o})=>{let n="https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.100";"cdnjs"===e?n="https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.100":"unpkg"===e&&(n="https://unpkg.com/@zonos/elements@1.3.100");return o&&"alpha"!==o?n.replace(/@zonos\/elements@(.+)/,`@zonos/elements@${o}`).replace(/\/zonos-elements\/(.+)/,`/zonos-elements/${o}`):n},L.injectZonos=({cdnType:e="jsdelivr",initConfig:o,parallelLoaded:n,vercelUrl:r,version:t})=>{var s;const i="vercel"===e?r:v.getGithubCdn({type:e,version:t}),a=S||i,c=a.replace("https://","").replace("http://",""),p=document.createElement("script"),u=t&&t<"1.2.5"?"loadZonos.js":"zonos.js";p.src=`https://${c}/dist/scripts/${u}`,l(`[ZONOS - loadZonos] Injecting "${u}" from "${c}"`,"info");const m="4g"===(null===(s=(()=>{const e="connection"in window.navigator?window.navigator.connection:null,o="mozConnection"in window.navigator?window.navigator.mozConnection:null,n="webkitConnection"in window.navigator?window.navigator.webkitConnection:null;return e||o||n})())||void 0===s?void 0:s.effectiveType),g=["dev.elements.zonos.com","zonos.com"].some((e=>window.location.href.includes(e))),w=f[0]===e,h=f[1],y="on"===v.parallelLoadState&&m&&w&&h&&!g;y&&v.injectZonos({cdnType:h,initConfig:o,parallelLoaded:!0,vercelUrl:r,version:t});const L=performance.now();p.addEventListener("load",(()=>{var r;if(y||n?v.loadScriptLogParallelHandler({fallbackLoadTime:performance.now()-L,scriptLoadUrl:p.src,storeId:v.storeId,type:e}):v.loadScriptLogHandler({fallbackLoadTime:performance.now()-L,scriptLoadUrl:p.src,storeId:v.storeId,type:e}),v.isBigCommerce||(v.isBigCommerce=!!window.stencilBootstrap||!!window.bcConfig||!!document.querySelector('script[src*="bigcommerce.com"]')),window.Zonos.isNpm=!1,window.Zonos.zonosQaUrl=S,window.Zonos.zonosQaUrlApi=z,window.Zonos.isBigCommerce=v.isBigCommerce,v.cartId){if(!v.zonosApiKey)throw v.legacyCheckoutErrorHandler({message:"zonosApiKey is missing to initiate checkout"}),new Error("zonosApiKey is required for legacy checkout");if(!v.cartData)throw v.legacyCheckoutErrorHandler({message:"cartData is missing to initiate legacy checkout"}),new Error("cartData is required for legacy checkout");if(v.legacyStoreFavicon&&v.isLegacyCheckout){const e=document.createElement("link");e.rel="shortcut icon",e.type="image/x-icon",e.href=v.legacyStoreFavicon,document.head.appendChild(e)}window.Zonos.cartData=v.cartData,window.Zonos.isLegacyCheckout=v.isLegacyCheckout;const e=v.isLegacyCheckout&&"CLOSE_MODAL"===(null===(r=o.checkoutSettings)||void 0===r?void 0:r.successBehavior),n=Object.assign(Object.assign({},o),{appearance:Object.assign(Object.assign({},o.appearance),{logoUrl:v.legacyStoreLogo||""}),checkoutSettings:Object.assign(Object.assign({},o.checkoutSettings),{successBehavior:e?"ZONOS_SUCCESS_PAGE":void 0,successRedirectUrl:e?v.cartData.storeBaseUrl:void 0}),zonosApiKey:v.zonosApiKey});o=n}window.Zonos.version&&(l(`[ZONOS - loadZonos] Execute "Zonos.init" from "${u}" from "${c}"`,"info"),window.Zonos.init(o))})),p.addEventListener("error",(async()=>{const s=(e=>{const o=f.indexOf(e);return f[o+1]||null})(e);if(!y&&!n){if(!s)return;v.injectZonos({cdnType:s,initConfig:o,vercelUrl:r,version:t})}if(["localhost",".zonos.com"].some((e=>window.location.href.includes(e)))||S)return;if(y||n)return void v.loadScriptLogParallelHandler({fallbackLoadTime:performance.now()-L,isError:!0,scriptLoadUrl:p.src,storeId:v.storeId,type:e});["unpkg","cdnjs","vercel"].includes(e)?d({endpoint:p.src,errors:[`zonos.js - Failed to fetch ${e} CDN.`],metadata:{cdnLoadTime:performance.now()-L,cdnType:e,loadUrl:a,version:t},shouldPostReleaseErrorReporting:!!s}):d({endpoint:p.src,errors:["[Info] Using alternative CDN. Failed to fetch script"],metadata:{cdnType:e,vercelLoadTime:performance.now()-L}})})),document.head.appendChild(p)},L.init=async e=>{var o;v.cartId=new URLSearchParams(window.location.search).get("tempCartUUID");const n="https://v1.3.100.js.zonos.com",r=document.querySelector('script[src*="/zonos.js"]'),t=null===(o=document.querySelector("script[src*='/loadZonos.js']"))||void 0===o?void 0:o.src;l(`[ZONOS - init] first load script src: ${t}`,"info"),window.Zonos.zonosQaUrl=S,window.Zonos.zonosQaUrlApi=z,window.Zonos.zonosQaUrl&&l(`[ZONOS - init] using zonosQaUrl: ${window.Zonos.zonosQaUrl}`,"info"),window.Zonos.zonosQaUrlApi&&l(`[ZONOS - init] using zonosQaUrlApi: ${window.Zonos.zonosQaUrlApi}`,"info");const s=null==t?void 0:t.includes("timestamp=");if(!(v.isNpm||t&&s))return void w("[ZONOS - loadZonos] A timestamp is required as a query parameter in the loadZonos.js script source. This timestamp ensures that you are loading the most recent version of the script, avoiding any cached versions.");if(r||!t||v.requested)return void l("[ZONOS - loadZonos] script is already loaded or requested","info");if(!e.zonosApiKey&&!v.cartId)return v.legacyCheckoutErrorHandler({message:"Zonos API key is required unless `tempCartUUID` is provided in url query params."}),void w("Zonos API key is required unless `tempCartUUID` is provided in url query params.");if(v.requested=!0,v.zonosApiKey=e.zonosApiKey,v.storeId=e.storeId,v.cartId){const e=await y(v.cartId);if(!e)throw v.legacyCheckoutErrorHandler({message:"Error getting cart data"}),new Error("Error getting cart data");v.cartData=e.cartData,v.zonosApiKey=e.zonosApiKey,v.legacyStoreLogo=e.storeLogo,v.legacyStoreFavicon=e.storeFavicon,v.storeId=e.storeId,v.zonosApiKey=e.zonosApiKey}if(!v.zonosApiKey)return void w('"zonosApiKey" is required to initialize Zonos');if(!v.storeId)return l("[ZONOS - loadZonos] loading latest script since storeId is not provided."),void v.injectZonos({initConfig:e,vercelUrl:n,version:null});const i=v.storeId||e.storeId;l(`[ZONOS - loadZonos] Store ID: ${i}`,"info");const a=new URLSearchParams;a.set("storeId",i.toString());const{errors:c,json:d}=await g(`/api/get-store-version?${a.toString()}`);if(c.length||!d)return l("[ZONOS - loadZonos] Error getting store version, loading the latest version.","error"),void v.injectZonos({initConfig:e,vercelUrl:n,version:null});const{isDifferent:p,source:u,version:m}=d;if(l(`[ZONOS - loadZonos] Store version: ${m}, source: ${u}`,"info"),p){l(`[ZONOS - loadZonos] Updating saved store version to ${m}`,"info");const e={storeId:i,version:m};g(`/api/set-store-version?${a.toString()}`,{body:e,method:"POST"}).catch((e=>w("Unable to save store's vesrion",e)))}if(!r){const{currentLoadScriptUrl:o,isForceLoadVersionDomain:n,isWhiteListed:r}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const o=new URL(e).origin,n=["dev.elements.zonos.com","dev.assets-checkout.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>o.includes(e))),r=["qa.js.zonos.com"].some((e=>o.includes(e)));return{currentLoadScriptUrl:o,isForceLoadVersionDomain:r,isWhiteListed:n}})({loadScriptSrc:t}),s=r&&!n?o:`${"alpha"===m?"alpha":`v${m}`}.js.zonos.com`,i=r&&!n?null:m;l("[ZONOS - loadZonos] injecting zonos script","info",{currentLoadScriptUrl:o,isForceLoadVersionDomain:n,isWhiteListed:r,loadUrl:s,loadVersion:i,version:m}),v.injectZonos({initConfig:e,vercelUrl:s,version:i})}},void 0===window.Zonos&&(window.Zonos=L)})();
1
+ (function(){"use strict";function e(e,o){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&o.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var t=0;for(r=Object.getOwnPropertySymbols(e);t<r.length;t++)o.indexOf(r[t])<0&&Object.prototype.propertyIsEnumerable.call(e,r[t])&&(n[r[t]]=e[r[t]])}return n}"function"==typeof SuppressedError&&SuppressedError;const o=["cloudflare","vercel"],n=o[0],r={cloudflare:"https://route.elements.zonos.com",vercel:"https://v1.route.js.zonos.com"},t=r[n],s=(e=n)=>{const r=o.indexOf(e),t=o[r+1];return t||null},i=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(e){return null}return null},a=performance.now(),c=e=>{if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(o){if(e&&"function"==typeof e.toString){return e.toString()}return"Unable to stringify info"}},l=(e,o,...n)=>{var r,t;const s=performance.now()-a,i=[`(${s>1e3?`${(s/1e3).toFixed(2)}s`:`${s.toFixed(2)}ms`})`,...n];i.map(c).join(" ");if(!(!!(null===(r=window.Zonos)||void 0===r?void 0:r.debug)||!!window.location.search.match(/\?.*(&*)zonosDebug=1/)))return void("error"===o&&console.error(e,...i));let l=document.querySelector("iframe#zonos---debug-logging-iframe");l||(l=document.createElement("iframe"),l.id="zonos---debug-logging-iframe",l.style.display="none",l.style.opacity="0",l.style.position="absolute",l.style.top="-9999px",l.style.left="-9999px",l.style.width="1px",l.style.height="1px",l.style.border="none",l.style.overflow="hidden",l.style.visibility="hidden",document.body.appendChild(l));const d=(null===(t=l.contentWindow)||void 0===t?void 0:t.window.console)||window.console;switch(o){case"warn":d.warn(e,...i);break;case"info":d.info(e,...i);break;case"error":d.error(e,...i);break;default:d.groupCollapsed(e,...i),d.trace(),d.groupEnd()}},d=async({endpoint:e,errors:o,metadata:n,shouldPostReleaseErrorReporting:i})=>{if(l("sendErrorLog","warn",e,n,o),i){const e=Number(window.Zonos.releaseDate);if((new Date).getTime()-e>36e5)return}const a="userAgentData"in window.navigator?window.navigator.userAgentData:null,c={endpoint:e,errors:o,metadata:Object.assign({href:window.location.href,userAgent:a&&a.brands.length>0?a:window.navigator.userAgent},n)};try{fetch(`${t}/api/zonos-elements/log-error`,{body:JSON.stringify(c),headers:{"Zonos-Referer":window.location.hostname},method:"POST"})}catch(e){const o=s();if(!o)return;fetch(`${r[o]}/api/zonos-elements/log-error`,{body:JSON.stringify(c),method:"POST"})}},p=async({response:e,shouldLog:o=!0,shouldThrow:n=!1})=>{try{return await e.json()}catch(e){if(n)throw e;return o&&console.error(e),null}},u=async({basePathType:e,options:o,path:t})=>{let s;const i=window.Zonos.zonosQaUrlApi||r[e]||n,a=new URL(i+t);a.searchParams.set("zToken",(e=>{try{return btoa(e).replace(/=/g,"")}catch(o){return e.replace(/[^A-Za-z0-9]/g,"").split("").reverse().join("")}})(window.location.hostname));try{s=await fetch(a.toString(),o)}catch(e){if(e instanceof Error)return{baseUrl:i,errors:[{message:e.message,type:"unknown"}],json:null,response:null,zonosMode:null};return{baseUrl:i,errors:[{message:"Failed to fetch",type:"unknown"}],json:null,response:null,zonosMode:null}}const c=s.headers.get("Zonos-Mode"),l=window.Zonos.zonosQaUrl;if(!window.Zonos.modeAlerted&&c&&l&&(window.Zonos.modeAlerted=!0),s.ok){return{baseUrl:i,errors:[],json:await p({response:s}),response:s,zonosMode:c}}const d=s.status.toString();try{const e=await p({response:s,shouldThrow:!0});return{baseUrl:i,errors:[{message:JSON.stringify(e),type:d}],json:null,response:s,zonosMode:c}}catch(e){return{baseUrl:i,errors:[{message:`${d}: ${"Unknown error"}`,type:d}],json:null,response:null,zonosMode:c}}},m=async({basePathType:o,options:n,path:t})=>{var a,c;const p=t.startsWith("/api/bigcommerce")?"vercel":o,g=await u({basePathType:p,options:n,path:t}),{errors:w,response:f}=g,h=e(g,["errors","response"]),y=s(p),v=!!w.find((({type:e})=>"unknown"===e))||404===(null==f?void 0:f.status),S=y&&v;return v&&d({endpoint:r[p]+t,errors:w.map((({message:e})=>`API: ${e}`)),metadata:{currentBasePath:p,nextFallbackApiType:y,requestHeaders:null==n?void 0:n.headers,requestPayload:i(null===(a=null==n?void 0:n.body)||void 0===a?void 0:a.toString())||(null===(c=null==n?void 0:n.body)||void 0===c?void 0:c.toString()),status:null==f?void 0:f.status,statusText:null==f?void 0:f.statusText},shouldPostReleaseErrorReporting:!0}),S?(l(`=== "${t}" failed to fetch, trying next fallback ${y}`),m({basePathType:y,options:n,path:t})):Object.assign({errors:w,response:f},h)},g=async(o,r)=>{const t=e(r||{},[]),s=t.body?JSON.stringify(t.body):void 0,i=t.method||"GET",a=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"},t.headers),c=Object.assign(Object.assign({},t),{body:"GET"===i?void 0:s,headers:a,method:i}),d=new URLSearchParams(window.location.search).get("useFallbackApi");return l(o,"info"),m({basePathType:d||n,options:c,path:o})},w=(e,...o)=>{l(e,"error",...o)},f=["jsdelivr","cdnjs","unpkg","vercel"],h=e=>{if(!e)return null;const o=new URL(e).searchParams.get("zonosQaUrl");if(!o)return null;return/[^a-zA-Z0-9-_]+/.test(o)?null:o},y=async e=>{const o=await(async e=>{const o="1"===new URLSearchParams(window.location.search).get("zonosTestMode"),{errors:n,json:r}=await g("/api/zonos-elements/get-temp-cart",{body:{isTestMode:o,tempCartUUID:e},headers:{"Content-Type":"application/json"},method:"POST"});return!r||n.length?null:r})(e);return l("[ZONOS - loadZonos] getting temp cart data","info",o),o?{cartData:o.cartData,storeFavicon:o.storeFaviconUrl,storeId:o.cartData.storeId,storeLogo:o.storeLogoUrl,zonosApiKey:o.cartData.credentialToken}:(w("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),null)};var v;const S=(()=>{const e=window&&window.location.href.includes("forceLoadCdn");if("undefined"==typeof window||e)return null;const o=h(window.location.href),n="https://v1.3.101.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 l(`[ZONOS-WARNING] using '${r}' for loading elements 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:o}=window.location,n=`${o}?${e.toString()}`;return window.history.replaceState(window.history.state,"",n),window.location.reload(),null})),r})(),z=(()=>{const e=(e=>{if(!e)return null;const o=new URL(e).searchParams.get("zonosQaUrlApi");return o?/[^a-zA-Z0-9-_]+/.test(o)?null:o:null})(window.location.href),o=h(window.location.href),n=e||o;if(!n&&["dev.demo.elements.zonos.com"].includes(window.location.hostname))return"https://dev.demo.elements.zonos.com";if(!n)return null;if("dev-elements"===n)return"https://dev.demo.elements.zonos.com";if(!e)return null;const r=`https://${e}.route.js.zonos.com`;return l(`[ZONOS-WARNING] using '${r}' for serverless API`,"warn"),r})();class L{static get isNpm(){return!1}}v=L,L.isBigCommerce=!1,L.requested=!1,L.cartData=null,L.isLegacyCheckout=!1,L.legacyStoreLogo=null,L.legacyStoreFavicon=null,L.parallelLoadTimes=[],L.parallelLoadState="off",L.releaseDate="1729200065858",L.loadScriptLogHandler=async({cdnLoadTime:e,fallbackLoadTime:o,isError:n,metadata:r,scriptLoadUrl:t,storeId:s,type:i})=>{try{const e=window.performance.getEntriesByType("resource").find((e=>{const o=e;return o.name.includes(t)&&"script"===o.initiatorType}));null==e||e.transferSize;(async e=>{})((e&&(null==e?void 0:e.duration)>0?parseFloat(e.duration.toFixed(2)):parseFloat(o.toFixed(2)),Object.assign({decodedBodySize:null==e?void 0:e.decodedBodySize,encodedBodySize:null==e?void 0:e.encodedBodySize,fallbackLoadTime:o,isError:!!n},r)))}catch(e){}},L.loadScriptLogParallelHandler=async e=>{try{if(v.parallelLoadTimes.push(e),2===v.parallelLoadTimes.length){const e=v.parallelLoadTimes.find((e=>"vercel"===e.type)),o=v.parallelLoadTimes.find((e=>"jsdelivr"===e.type));if(!e||!o)return;if(e.isError&&o.isError)return void d({endpoint:`<${e.scriptLoadUrl}> <${o.scriptLoadUrl}>`,errors:["Failed to fetch both Vercel and jsdelivr CDN. Perhaps network issue on customer site."],metadata:{cdnLoadTime:o.fallbackLoadTime,cdnType:o.type,vercelLoadTime:e.fallbackLoadTime}});v.loadScriptLogHandler({cdnLoadTime:o.fallbackLoadTime,fallbackLoadTime:e.fallbackLoadTime,isError:e.isError,metadata:{cdnScriptFallbackTime:o.fallbackLoadTime,cdnScriptIsError:!!o.isError,cdnScriptLoadUrl:o.scriptLoadUrl,cdnScriptType:o.type},scriptLoadUrl:e.scriptLoadUrl,storeId:e.storeId,type:e.type})}}catch(e){}},L.legacyCheckoutErrorHandler=({message:e})=>{w(`[ZONOS - loadZonos] ${e}`),d({endpoint:"LegacyCheckoutInit",errors:[e],metadata:{tempCartUUID:v.cartId}}),document.dispatchEvent(new CustomEvent("legacyCheckoutError",{detail:e}))},L.getGithubCdn=({type:e,version:o})=>{let n="https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.101";"cdnjs"===e?n="https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.101":"unpkg"===e&&(n="https://unpkg.com/@zonos/elements@1.3.101");return o&&"alpha"!==o?n.replace(/@zonos\/elements@(.+)/,`@zonos/elements@${o}`).replace(/\/zonos-elements\/(.+)/,`/zonos-elements/${o}`):n},L.injectZonos=({cdnType:e="jsdelivr",initConfig:o,parallelLoaded:n,vercelUrl:r,version:t})=>{var s;const i="vercel"===e?r:v.getGithubCdn({type:e,version:t}),a=S||i,c=a.replace("https://","").replace("http://",""),p=document.createElement("script"),u=t&&t<"1.2.5"?"loadZonos.js":"zonos.js";p.src=`https://${c}/dist/scripts/${u}`,l(`[ZONOS - loadZonos] Injecting "${u}" from "${c}"`,"info");const m="4g"===(null===(s=(()=>{const e="connection"in window.navigator?window.navigator.connection:null,o="mozConnection"in window.navigator?window.navigator.mozConnection:null,n="webkitConnection"in window.navigator?window.navigator.webkitConnection:null;return e||o||n})())||void 0===s?void 0:s.effectiveType),g=["dev.elements.zonos.com","zonos.com"].some((e=>window.location.href.includes(e))),w=f[0]===e,h=f[1],y="on"===v.parallelLoadState&&m&&w&&h&&!g;y&&v.injectZonos({cdnType:h,initConfig:o,parallelLoaded:!0,vercelUrl:r,version:t});const L=performance.now();p.addEventListener("load",(()=>{var r;if(y||n?v.loadScriptLogParallelHandler({fallbackLoadTime:performance.now()-L,scriptLoadUrl:p.src,storeId:v.storeId,type:e}):v.loadScriptLogHandler({fallbackLoadTime:performance.now()-L,scriptLoadUrl:p.src,storeId:v.storeId,type:e}),v.isBigCommerce||(v.isBigCommerce=!!window.stencilBootstrap||!!window.bcConfig||!!document.querySelector('script[src*="bigcommerce.com"]')),window.Zonos.isNpm=!1,window.Zonos.zonosQaUrl=S,window.Zonos.zonosQaUrlApi=z,window.Zonos.isBigCommerce=v.isBigCommerce,v.cartId){if(!v.zonosApiKey)throw v.legacyCheckoutErrorHandler({message:"zonosApiKey is missing to initiate checkout"}),new Error("zonosApiKey is required for legacy checkout");if(!v.cartData)throw v.legacyCheckoutErrorHandler({message:"cartData is missing to initiate legacy checkout"}),new Error("cartData is required for legacy checkout");if(v.legacyStoreFavicon&&v.isLegacyCheckout){const e=document.createElement("link");e.rel="shortcut icon",e.type="image/x-icon",e.href=v.legacyStoreFavicon,document.head.appendChild(e)}window.Zonos.cartData=v.cartData,window.Zonos.isLegacyCheckout=v.isLegacyCheckout;const e=v.isLegacyCheckout&&"CLOSE_MODAL"===(null===(r=o.checkoutSettings)||void 0===r?void 0:r.successBehavior),n=Object.assign(Object.assign({},o),{appearance:Object.assign(Object.assign({},o.appearance),{logoUrl:v.legacyStoreLogo||""}),checkoutSettings:Object.assign(Object.assign({},o.checkoutSettings),{successBehavior:e?"ZONOS_SUCCESS_PAGE":void 0,successRedirectUrl:e?v.cartData.storeBaseUrl:void 0}),zonosApiKey:v.zonosApiKey});o=n}window.Zonos.version&&(l(`[ZONOS - loadZonos] Execute "Zonos.init" from "${u}" from "${c}"`,"info"),window.Zonos.init(o))})),p.addEventListener("error",(async()=>{const s=(e=>{const o=f.indexOf(e);return f[o+1]||null})(e);if(!y&&!n){if(!s)return;v.injectZonos({cdnType:s,initConfig:o,vercelUrl:r,version:t})}if(["localhost",".zonos.com"].some((e=>window.location.href.includes(e)))||S)return;if(y||n)return void v.loadScriptLogParallelHandler({fallbackLoadTime:performance.now()-L,isError:!0,scriptLoadUrl:p.src,storeId:v.storeId,type:e});["unpkg","cdnjs","vercel"].includes(e)?d({endpoint:p.src,errors:[`zonos.js - Failed to fetch ${e} CDN.`],metadata:{cdnLoadTime:performance.now()-L,cdnType:e,loadUrl:a,version:t},shouldPostReleaseErrorReporting:!!s}):d({endpoint:p.src,errors:["[Info] Using alternative CDN. Failed to fetch script"],metadata:{cdnType:e,vercelLoadTime:performance.now()-L}})})),document.head.appendChild(p)},L.init=async e=>{var o;v.cartId=new URLSearchParams(window.location.search).get("tempCartUUID");const n="https://v1.3.101.js.zonos.com",r=document.querySelector('script[src*="/zonos.js"]'),t=null===(o=document.querySelector("script[src*='/loadZonos.js']"))||void 0===o?void 0:o.src;l(`[ZONOS - init] first load script src: ${t}`,"info"),window.Zonos.zonosQaUrl=S,window.Zonos.zonosQaUrlApi=z,window.Zonos.zonosQaUrl&&l(`[ZONOS - init] using zonosQaUrl: ${window.Zonos.zonosQaUrl}`,"info"),window.Zonos.zonosQaUrlApi&&l(`[ZONOS - init] using zonosQaUrlApi: ${window.Zonos.zonosQaUrlApi}`,"info");const s=null==t?void 0:t.includes("timestamp=");if(!(v.isNpm||t&&s))return void w("[ZONOS - loadZonos] A timestamp is required as a query parameter in the loadZonos.js script source. This timestamp ensures that you are loading the most recent version of the script, avoiding any cached versions.");if(r||!t||v.requested)return void l("[ZONOS - loadZonos] script is already loaded or requested","info");if(!e.zonosApiKey&&!v.cartId)return v.legacyCheckoutErrorHandler({message:"Zonos API key is required unless `tempCartUUID` is provided in url query params."}),void w("Zonos API key is required unless `tempCartUUID` is provided in url query params.");if(v.requested=!0,v.zonosApiKey=e.zonosApiKey,v.storeId=e.storeId,v.cartId){const e=await y(v.cartId);if(!e)throw v.legacyCheckoutErrorHandler({message:"Error getting cart data"}),new Error("Error getting cart data");v.cartData=e.cartData,v.zonosApiKey=e.zonosApiKey,v.legacyStoreLogo=e.storeLogo,v.legacyStoreFavicon=e.storeFavicon,v.storeId=e.storeId,v.zonosApiKey=e.zonosApiKey}if(!v.zonosApiKey)return void w('"zonosApiKey" is required to initialize Zonos');if(!v.storeId)return l("[ZONOS - loadZonos] loading latest script since storeId is not provided."),void v.injectZonos({initConfig:e,vercelUrl:n,version:null});const i=v.storeId||e.storeId;l(`[ZONOS - loadZonos] Store ID: ${i}`,"info");const a=new URLSearchParams;a.set("storeId",i.toString());const{errors:c,json:d}=await g(`/api/get-store-version?${a.toString()}`);if(c.length||!d)return l("[ZONOS - loadZonos] Error getting store version, loading the latest version.","error"),void v.injectZonos({initConfig:e,vercelUrl:n,version:null});const{isDifferent:p,source:u,version:m}=d;if(l(`[ZONOS - loadZonos] Store version: ${m}, source: ${u}`,"info"),p){l(`[ZONOS - loadZonos] Updating saved store version to ${m}`,"info");const e={storeId:i,version:m};g(`/api/set-store-version?${a.toString()}`,{body:e,method:"POST"}).catch((e=>w("Unable to save store's vesrion",e)))}if(!r){const{currentLoadScriptUrl:o,isForceLoadVersionDomain:n,isWhiteListed:r}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const o=new URL(e).origin,n=["dev.elements.zonos.com","dev.assets-checkout.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>o.includes(e))),r=["qa.js.zonos.com"].some((e=>o.includes(e)));return{currentLoadScriptUrl:o,isForceLoadVersionDomain:r,isWhiteListed:n}})({loadScriptSrc:t}),s=r&&!n?o:`${"alpha"===m?"alpha":`v${m}`}.js.zonos.com`,i=r&&!n?null:m;l("[ZONOS - loadZonos] injecting zonos script","info",{currentLoadScriptUrl:o,isForceLoadVersionDomain:n,isWhiteListed:r,loadUrl:s,loadVersion:i,version:m}),v.injectZonos({initConfig:e,vercelUrl:s,version:i})}},void 0===window.Zonos&&(window.Zonos=L)})();
@@ -1 +1 @@
1
- (function(){"use strict";const e=performance.now(),t=e=>{if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(t){if(e&&"function"==typeof e.toString){return e.toString()}return"Unable to stringify info"}},o=(o,n,...r)=>{var s,i;const l=performance.now()-e,a=[`(${l>1e3?`${(l/1e3).toFixed(2)}s`:`${l.toFixed(2)}ms`})`,...r];a.map(t).join(" ");if(!(!!(null===(s=window.Zonos)||void 0===s?void 0:s.debug)||!!window.location.search.match(/\?.*(&*)zonosDebug=1/)))return void("error"===n&&console.error(o,...a));let c=document.querySelector("iframe#zonos---debug-logging-iframe");c||(c=document.createElement("iframe"),c.id="zonos---debug-logging-iframe",c.style.display="none",c.style.opacity="0",c.style.position="absolute",c.style.top="-9999px",c.style.left="-9999px",c.style.width="1px",c.style.height="1px",c.style.border="none",c.style.overflow="hidden",c.style.visibility="hidden",document.body.appendChild(c));const d=(null===(i=c.contentWindow)||void 0===i?void 0:i.window.console)||window.console;switch(n){case"warn":d.warn(o,...a);break;case"info":d.info(o,...a);break;case"error":d.error(o,...a);break;default:d.groupCollapsed(o,...a),d.trace(),d.groupEnd()}},n=(e,...t)=>{o(e,"error",...t)},r=["jsdelivr","cdnjs","unpkg","vercel"],s="jsdelivr",i=e=>{const t=r.indexOf(e);return r[t+1]||null},l=()=>{const e=window&&window.location.href.includes("forceLoadCdn");if("undefined"==typeof window||e)return null;const t=(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.100.js.zonos.com";if(!t&&(n.includes("test.")||n.includes("test-")))return n;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 r=`https://${t}.preview.js.zonos.com`;return o(`[ZONOS-WARNING] using '${r}' for loading elements 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},a="https://js.stripe.com/v3",c=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,d="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let u=null;const p=e=>(null!==u||(u=new Promise(((t,o)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(d),window.Stripe)t(window.Stripe);else try{let r=(()=>{const e=document.querySelectorAll(`script[src^="${a}"]`);for(let t=0;t<e.length;t++){const o=e[t];if(o&&c.test(o.src))return o}return null})();r&&e?console.warn(d):r||(r=(e=>{const t=document.createElement("script");t.src=`${a}`;const o=document.head||document.body;return o?(o.appendChild(t),t):(n("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})()),null==r||r.addEventListener("load",(()=>{window.Stripe?t(window.Stripe):o(new Error("Stripe.js not available"))})),null==r||r.addEventListener("error",(()=>{o(new Error("Failed to load Stripe.js"))}))}catch(e){return void o(e)}else t(null)}))),u),m=Promise.resolve().then((()=>p(null)));let h=!1;m.catch((e=>{h||console.warn(e)}));function y(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 w=["cloudflare","vercel"],f=w[0],g={cloudflare:"https://route.elements.zonos.com",vercel:"https://v1.route.js.zonos.com"},v=g[f],b=(e=f)=>{const t=w.indexOf(e),o=w[t+1];return o||null},S=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(e){return null}return null},z=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}},j=async({basePathType:e,options:t,path:o})=>{let n;const r=window.Zonos.zonosQaUrlApi||g[e]||f,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 z({response:n}),response:n,zonosMode:i}}const a=n.status.toString();try{const e=await z({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}}},O=async({basePathType:e,options:t,path:n})=>{var r,s;const i=n.startsWith("/api/bigcommerce")?"vercel":e,l=await j({basePathType:i,options:t,path:n}),{errors:a,response:c}=l,d=y(l,["errors","response"]),u=b(i),p=!!a.find((({type:e})=>"unknown"===e))||404===(null==c?void 0:c.status),m=u&&p;return p&&(async({endpoint:e,errors:t,metadata:n,shouldPostReleaseErrorReporting:r})=>{if(o("sendErrorLog","warn",e,n,t),r){const e=Number(window.Zonos.releaseDate);if((new Date).getTime()-e>36e5)return}const s="userAgentData"in window.navigator?window.navigator.userAgentData:null,i={endpoint:e,errors:t,metadata:Object.assign({href:window.location.href,userAgent:s&&s.brands.length>0?s:window.navigator.userAgent},n)};try{fetch(`${v}/api/zonos-elements/log-error`,{body:JSON.stringify(i),headers:{"Zonos-Referer":window.location.hostname},method:"POST"})}catch(e){const t=b();if(!t)return;fetch(`${g[t]}/api/zonos-elements/log-error`,{body:JSON.stringify(i),method:"POST"})}})({endpoint:g[i]+n,errors:a.map((({message:e})=>`API: ${e}`)),metadata:{currentBasePath:i,nextFallbackApiType:u,requestHeaders:null==t?void 0:t.headers,requestPayload:S(null===(r=null==t?void 0:t.body)||void 0===r?void 0:r.toString())||(null===(s=null==t?void 0:t.body)||void 0===s?void 0:s.toString()),status:null==c?void 0:c.status,statusText:null==c?void 0:c.statusText},shouldPostReleaseErrorReporting:!0}),m?(o(`=== "${n}" failed to fetch, trying next fallback ${u}`),O({basePathType:u,options:t,path:n})):Object.assign({errors:a,response:c},d)},C=async e=>{const t="1"===new URLSearchParams(window.location.search).get("zonosTestMode"),{errors:n,json:r}=await(async(e,t)=>{const n=y(t||{},[]),r=n.body?JSON.stringify(n.body):void 0,s=n.method||"GET",i=Object.assign({"Content-Type":"application/json","Zonos-Is-BigCommerce":window.Zonos.isBigCommerce.toString(),"Zonos-Referer":window.location.hostname,"Zonos-Version":window.Zonos.version,credentialtoken:window.Zonos.zonosApiKey||"Empty credential token from zonos-elements"},n.headers),l=Object.assign(Object.assign({},n),{body:"GET"===s?void 0:r,headers:i,method:s}),a=new URLSearchParams(window.location.search).get("useFallbackApi");return o(e,"info"),O({basePathType:a||f,options:l,path:e})})("/api/zonos-elements/get-temp-cart",{body:{isTestMode:t,tempCartUUID:e},headers:{"Content-Type":"application/json"},method:"POST"});return!r||n.length?null:r};var k;const E=(()=>{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","dev.assets-checkout.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})(),A="https://v1.3.100.js.zonos.com",U=E||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.100",Z="https://rsms.me",T="https://fonts.googleapis.com",$=/^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;class P{}k=P,P.doneInit=!1,P.debug="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/),P.zonosConversionTest="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/),P._paypalMockResponse=null,P.isBigCommerce=!1,P.releaseDate="1729193940551",P.isLegacyCheckout=!1,P.isNpm=!0,P.zonosQaUrl=null,P.zonosQaUrlApi=null,P.version="v1.3.100",P.modeAlerted=!1,P.cartData=null,P.paypal=null,P.getCurrentTimestamp=()=>(new Date).getTime(),P.zonosController=null,P.init=async({appearance:e,checkoutSettings:t,currencyConverter:r,helloSettings:s,onCountryChange:i,overrideCurrencyFormat:l,storeId:a,zonosApiKey:c})=>{if(k.cartId=new URLSearchParams(window.location.search).get("tempCartUUID"),!k.doneInit){if(o(`====== ZONOS DEBUG MODE: on (${k.version}) ======`),k.zonosApiKey=c,k.storeId=a,k.isNpm){if(o("====== ZONOS LOADING FROM NPM ======"),!c&&!k.cartId)return void n("Zonos API key is required unless `tempCartUUID` is provided in url query params.");if(!k.cartData&&k.cartId){o("Initialize cart data");const e=await(async e=>{const t=await C(e);return o("[ZONOS - loadZonos] getting temp cart data","info",t),t?{cartData:t.cartData,storeFavicon:t.storeFaviconUrl,storeId:t.cartData.storeId,storeLogo:t.storeLogoUrl,zonosApiKey:t.cartData.credentialToken}:(n("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),null)})(k.cartId);if(!e)return void n("Failed to get cart data");k.cartData=e.cartData,k.zonosApiKey=e.zonosApiKey}}if(k.cartId&&k.cartData){o("Cart data is available, inject hidden button and trigger checkout");const e=document.createElement("button");e.style.display="none",e.id="zonos--checkout-hidden-button",document.body.appendChild(e)}o("init zonos"),k.injectZonosCdn(),k.injectZonosCss(),k.injectFonts(),k.injectController({config:{appearance:e,checkoutSettings:t,currencyConverter:r,helloSettings:s,onCountryChange:i,overrideCurrencyFormat:l}}),k.doneInit=!0}},P.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},P.openHelloDialog=e=>{const t=document.querySelector("zonos-hello");t&&t.openHelloDialog(null==e||e)},P.showNotification=e=>{var t;null===(t=k.zonosController)||void 0===t||t.showNotification(e)},P.updateOrganizationName=e=>{var t;null===(t=k.zonosController)||void 0===t||t.updateOrganizationName(e)},P.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)}},P.injectController=({config:e})=>{var t;if(document.querySelector("zonos-controller"))return;if(null===(t=e.checkoutSettings)||void 0===t?void 0:t.placeOrderButtonSelector){const t=e.checkoutSettings.placeOrderButtonSelector;k.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:t});new MutationObserver((()=>{k.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:t})})).observe(document.body,{childList:!0,subtree:!0})}const r=document.createElement("zonos-controller");r.config=e,r.zonosApiKey=k.zonosApiKey||"",r.addEventListener("stripeInitEvent",(async e=>{const{detail:t}=e;o("loading Stripe");const s=await(async(...e)=>{h=!0;const t=Date.now();return m.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)))})(t.publishableKey);s?(window.Zonos.stripe=s,r.initCheckoutElement(s)):n("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(r),k.zonosController=r,o("Zonos controller injected!")},P.injectScript=({cdnType:e,isModule:t,theRestUrl:r})=>{const s=`${k.getZonosUrl(e)}/${r}`;if(document.querySelector(`script[src="${s}"]`))return void o(`Zonos script "${s}" already exists in the document`,"warn");const l=document.head||document.body,a=document.createElement("script");t?a.type="module":a.noModule=!0,a.src=s,a.crossOrigin="anonymous",a.onerror=()=>{n(`Failed to load ${a.src}`);const o=i(e);o&&k.injectScript({cdnType:o,isModule:t,theRestUrl:r})},l.appendChild(a)},P.getZonosUrl=e=>{const t=()=>{switch(e){case"jsdelivr":return U;case"unpkg":return"https://unpkg.com/@zonos/elements@1.3.100";case"cdnjs":return"https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.100";case"vercel":return A}};if(k.isNpm){return l()||t()}return t()},P.injectZonosCdn=()=>{k.injectScript({cdnType:s,isModule:!0,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),k.injectScript({cdnType:s,isModule:!1,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),o("Zonos cdn script injected!")},P.injectStylesheet=({cdnType:e,theRestUrl:t})=>{const o=k.getZonosUrl(e),r=document.head||document.body,s=document.createElement("link");s.rel="preconnect",s.href=`${A}/`,r.appendChild(s);const l=document.createElement("link");l.rel="stylesheet",l.href=`${o}/${t}`,l.onerror=()=>{n(`Failed to load ${l.href}`);const o=i(e);o&&k.injectStylesheet({cdnType:o,theRestUrl:t})},r.appendChild(l)},P.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?o("Zonos style links already injected","warn"):(k.injectStylesheet({cdnType:s,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),o("Zonos style css injected!"))},P.injectFonts=()=>{if((()=>{const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${Z}"]`);for(let t=0;t<e.length;t++){const o=e[t];if(o&&!$.test(o.href))return o}return null})())return void o("Inter font already injected","warn");const e=document.head||document.body,t=document.createElement("link");t.rel="preconnect",t.href=Z,e.appendChild(t);const n=document.createElement("link");n.rel="stylesheet",n.href=`${Z}/inter/inter.css`,e.appendChild(n),o("Zonos font injected!")},P.setupGoogleFont=e=>{var t;null===(t=k.zonosController)||void 0===t||t.setupGoogleFont(e)},P.injectSupportGoogleFont=e=>{var t;o(`[FONT] injecting ${e}`);const n=null===(t=e.match(/family=(.*?):/))||void 0===t?void 0:t[1],r=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${T}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=T,r.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${e}"]`))return void o(`[FONT] ${n} font already injected`,"warn");const s=document.createElement("link");s.rel="stylesheet",s.href=e,r.appendChild(s),o(`[FONT] ${n} font injected!`)},window.Zonos&&window.Zonos.doneInit||(window.Zonos=P)})();
1
+ (function(){"use strict";const e=performance.now(),o=e=>{if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(o){if(e&&"function"==typeof e.toString){return e.toString()}return"Unable to stringify info"}},t=(t,n,...r)=>{var s,i;const l=performance.now()-e,a=[`(${l>1e3?`${(l/1e3).toFixed(2)}s`:`${l.toFixed(2)}ms`})`,...r];a.map(o).join(" ");if(!(!!(null===(s=window.Zonos)||void 0===s?void 0:s.debug)||!!window.location.search.match(/\?.*(&*)zonosDebug=1/)))return void("error"===n&&console.error(t,...a));let c=document.querySelector("iframe#zonos---debug-logging-iframe");c||(c=document.createElement("iframe"),c.id="zonos---debug-logging-iframe",c.style.display="none",c.style.opacity="0",c.style.position="absolute",c.style.top="-9999px",c.style.left="-9999px",c.style.width="1px",c.style.height="1px",c.style.border="none",c.style.overflow="hidden",c.style.visibility="hidden",document.body.appendChild(c));const d=(null===(i=c.contentWindow)||void 0===i?void 0:i.window.console)||window.console;switch(n){case"warn":d.warn(t,...a);break;case"info":d.info(t,...a);break;case"error":d.error(t,...a);break;default:d.groupCollapsed(t,...a),d.trace(),d.groupEnd()}},n=(e,...o)=>{t(e,"error",...o)},r=["jsdelivr","cdnjs","unpkg","vercel"],s="jsdelivr",i=e=>{const o=r.indexOf(e);return r[o+1]||null},l=()=>{const e=window&&window.location.href.includes("forceLoadCdn");if("undefined"==typeof window||e)return null;const o=(e=>{if(!e)return null;const o=new URL(e).searchParams.get("zonosQaUrl");return o?/[^a-zA-Z0-9-_]+/.test(o)?null:o:null})(window.location.href),n="https://v1.3.101.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 t(`[ZONOS-WARNING] using '${r}' for loading elements 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:o}=window.location,t=`${o}?${e.toString()}`;return window.history.replaceState(window.history.state,"",t),window.location.reload(),null})),r},a="https://js.stripe.com/v3",c=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,d="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let u=null;const p=e=>(null!==u||(u=new Promise(((o,t)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(d),window.Stripe)o(window.Stripe);else try{let r=(()=>{const e=document.querySelectorAll(`script[src^="${a}"]`);for(let o=0;o<e.length;o++){const t=e[o];if(t&&c.test(t.src))return t}return null})();r&&e?console.warn(d):r||(r=(e=>{const o=document.createElement("script");o.src=`${a}`;const t=document.head||document.body;return t?(t.appendChild(o),o):(n("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})()),null==r||r.addEventListener("load",(()=>{window.Stripe?o(window.Stripe):t(new Error("Stripe.js not available"))})),null==r||r.addEventListener("error",(()=>{t(new Error("Failed to load Stripe.js"))}))}catch(e){return void t(e)}else o(null)}))),u),m=Promise.resolve().then((()=>p(null)));let h=!1;m.catch((e=>{h||console.warn(e)}));function y(e,o){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&o.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)o.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(t[n[r]]=e[n[r]])}return t}"function"==typeof SuppressedError&&SuppressedError;const w=["cloudflare","vercel"],f=w[0],g={cloudflare:"https://route.elements.zonos.com",vercel:"https://v1.route.js.zonos.com"},v=g[f],b=(e=f)=>{const o=w.indexOf(e),t=w[o+1];return t||null},S=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(e){return null}return null},z=async({response:e,shouldLog:o=!0,shouldThrow:t=!1})=>{try{return await e.json()}catch(e){if(t)throw e;return o&&console.error(e),null}},j=async({basePathType:e,options:o,path:t})=>{let n;const r=window.Zonos.zonosQaUrlApi||g[e]||f,s=new URL(r+t);s.searchParams.set("zToken",(e=>{try{return btoa(e).replace(/=/g,"")}catch(o){return e.replace(/[^A-Za-z0-9]/g,"").split("").reverse().join("")}})(window.location.hostname));try{n=await fetch(s.toString(),o)}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 z({response:n}),response:n,zonosMode:i}}const a=n.status.toString();try{const e=await z({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}}},O=async({basePathType:e,options:o,path:n})=>{var r,s;const i=n.startsWith("/api/bigcommerce")?"vercel":e,l=await j({basePathType:i,options:o,path:n}),{errors:a,response:c}=l,d=y(l,["errors","response"]),u=b(i),p=!!a.find((({type:e})=>"unknown"===e))||404===(null==c?void 0:c.status),m=u&&p;return p&&(async({endpoint:e,errors:o,metadata:n,shouldPostReleaseErrorReporting:r})=>{if(t("sendErrorLog","warn",e,n,o),r){const e=Number(window.Zonos.releaseDate);if((new Date).getTime()-e>36e5)return}const s="userAgentData"in window.navigator?window.navigator.userAgentData:null,i={endpoint:e,errors:o,metadata:Object.assign({href:window.location.href,userAgent:s&&s.brands.length>0?s:window.navigator.userAgent},n)};try{fetch(`${v}/api/zonos-elements/log-error`,{body:JSON.stringify(i),headers:{"Zonos-Referer":window.location.hostname},method:"POST"})}catch(e){const o=b();if(!o)return;fetch(`${g[o]}/api/zonos-elements/log-error`,{body:JSON.stringify(i),method:"POST"})}})({endpoint:g[i]+n,errors:a.map((({message:e})=>`API: ${e}`)),metadata:{currentBasePath:i,nextFallbackApiType:u,requestHeaders:null==o?void 0:o.headers,requestPayload:S(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}),m?(t(`=== "${n}" failed to fetch, trying next fallback ${u}`),O({basePathType:u,options:o,path:n})):Object.assign({errors:a,response:c},d)},C=async e=>{const o="1"===new URLSearchParams(window.location.search).get("zonosTestMode"),{errors:n,json:r}=await(async(e,o)=>{const n=y(o||{},[]),r=n.body?JSON.stringify(n.body):void 0,s=n.method||"GET",i=Object.assign({"Content-Type":"application/json","Zonos-Is-BigCommerce":window.Zonos.isBigCommerce.toString(),"Zonos-Referer":window.location.hostname,"Zonos-Version":window.Zonos.version,credentialtoken:window.Zonos.zonosApiKey||"Empty credential token from zonos-elements"},n.headers),l=Object.assign(Object.assign({},n),{body:"GET"===s?void 0:r,headers:i,method:s}),a=new URLSearchParams(window.location.search).get("useFallbackApi");return t(e,"info"),O({basePathType:a||f,options:l,path:e})})("/api/zonos-elements/get-temp-cart",{body:{isTestMode:o,tempCartUUID:e},headers:{"Content-Type":"application/json"},method:"POST"});return!r||n.length?null:r};var k;const E=(()=>{if("undefined"==typeof document)return null;const e=document.querySelector('script[src*="/zonos.js"]'),{currentLoadScriptUrl:o,isWhiteListed:t}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const o=new URL(e).origin,t=["dev.elements.zonos.com","dev.assets-checkout.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>o.includes(e))),n=["qa.js.zonos.com"].some((e=>o.includes(e)));return{currentLoadScriptUrl:o,isForceLoadVersionDomain:n,isWhiteListed:t}})({loadScriptSrc:null==e?void 0:e.src});return t?o:null})(),A="https://v1.3.101.js.zonos.com",U=E||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.101",Z="https://rsms.me",T="https://fonts.googleapis.com",$=/^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;class P{}k=P,P.doneInit=!1,P.debug="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/),P.zonosConversionTest="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/),P._paypalMockResponse=null,P.isBigCommerce=!1,P.releaseDate="1729200065858",P.isLegacyCheckout=!1,P.showBaseForeign="undefined"!=typeof window&&window.location.search.includes("zonosShowBaseForeign"),P.isNpm=!0,P.zonosQaUrl=null,P.zonosQaUrlApi=null,P.version="v1.3.101",P.modeAlerted=!1,P.cartData=null,P.paypal=null,P.getCurrentTimestamp=()=>(new Date).getTime(),P.zonosController=null,P.init=async({appearance:e,checkoutSettings:o,currencyConverter:r,helloSettings:s,onCountryChange:i,overrideCurrencyFormat:l,storeId:a,zonosApiKey:c})=>{if(k.cartId=new URLSearchParams(window.location.search).get("tempCartUUID"),!k.doneInit){if(t(`====== ZONOS DEBUG MODE: on (${k.version}) ======`),k.zonosApiKey=c,k.storeId=a,k.isNpm){if(t("====== ZONOS LOADING FROM NPM ======"),!c&&!k.cartId)return void n("Zonos API key is required unless `tempCartUUID` is provided in url query params.");if(!k.cartData&&k.cartId){t("Initialize cart data");const e=await(async e=>{const o=await C(e);return t("[ZONOS - loadZonos] getting temp cart data","info",o),o?{cartData:o.cartData,storeFavicon:o.storeFaviconUrl,storeId:o.cartData.storeId,storeLogo:o.storeLogoUrl,zonosApiKey:o.cartData.credentialToken}:(n("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),null)})(k.cartId);if(!e)return void n("Failed to get cart data");k.cartData=e.cartData,k.zonosApiKey=e.zonosApiKey}}if(k.cartId&&k.cartData){t("Cart data is available, inject hidden button and trigger checkout");const e=document.createElement("button");e.style.display="none",e.id="zonos--checkout-hidden-button",document.body.appendChild(e)}t("init zonos"),k.injectZonosCdn(),k.injectZonosCss(),k.injectFonts(),k.injectController({config:{appearance:e,checkoutSettings:o,currencyConverter:r,helloSettings:s,onCountryChange:i,overrideCurrencyFormat:l}}),k.doneInit=!0}},P.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},P.openHelloDialog=e=>{const o=document.querySelector("zonos-hello");o&&o.openHelloDialog(null==e||e)},P.showNotification=e=>{var o;null===(o=k.zonosController)||void 0===o||o.showNotification(e)},P.updateOrganizationName=e=>{var o;null===(o=k.zonosController)||void 0===o||o.updateOrganizationName(e)},P.disablePlaceOrderButtons=({autoEnable:e=!0,config:o,disable:t,placeOrderButtonSelector:n})=>{var r;if(!(null===(r=o.checkoutSettings)||void 0===r?void 0:r.disablePlaceOrderButtonActivation)&&n){const o=document.querySelectorAll(n),r=e=>{e.target.getAttribute("disabled")&&(e.preventDefault(),e.stopPropagation())};o.forEach((e=>{e.getAttribute("data-zonos-checkout-attached")||(t?(e.setAttribute("disabled","true"),e.addEventListener("click",r)):(e.removeAttribute("disabled"),e.removeEventListener("click",r)))})),e&&t&&setTimeout((()=>{o.forEach((e=>{e.removeAttribute("disabled"),e.removeEventListener("click",r)}))}),5e3)}},P.injectController=({config:e})=>{var o;if(document.querySelector("zonos-controller"))return;if(null===(o=e.checkoutSettings)||void 0===o?void 0:o.placeOrderButtonSelector){const o=e.checkoutSettings.placeOrderButtonSelector;k.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:o});new MutationObserver((()=>{k.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:o})})).observe(document.body,{childList:!0,subtree:!0})}const r=document.createElement("zonos-controller");r.config=e,r.zonosApiKey=k.zonosApiKey||"",r.addEventListener("stripeInitEvent",(async e=>{const{detail:o}=e;t("loading Stripe");const s=await(async(...e)=>{h=!0;const o=Date.now();return m.then((t=>((e,o,t)=>{if(null===e)return null;const n=e.apply(void 0,o);return((e,o)=>{e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",startTime:o})})(n,t),n})(t,e,o)))})(o.publishableKey);s?(window.Zonos.stripe=s,r.initCheckoutElement(s)):n("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(r),k.zonosController=r,t("Zonos controller injected!")},P.injectScript=({cdnType:e,isModule:o,theRestUrl:r})=>{const s=`${k.getZonosUrl(e)}/${r}`;if(document.querySelector(`script[src="${s}"]`))return void t(`Zonos script "${s}" already exists in the document`,"warn");const l=document.head||document.body,a=document.createElement("script");o?a.type="module":a.noModule=!0,a.src=s,a.crossOrigin="anonymous",a.onerror=()=>{n(`Failed to load ${a.src}`);const t=i(e);t&&k.injectScript({cdnType:t,isModule:o,theRestUrl:r})},l.appendChild(a)},P.getZonosUrl=e=>{const o=()=>{switch(e){case"jsdelivr":return U;case"unpkg":return"https://unpkg.com/@zonos/elements@1.3.101";case"cdnjs":return"https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.101";case"vercel":return A}};if(k.isNpm){return l()||o()}return o()},P.injectZonosCdn=()=>{k.injectScript({cdnType:s,isModule:!0,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),k.injectScript({cdnType:s,isModule:!1,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),t("Zonos cdn script injected!")},P.injectStylesheet=({cdnType:e,theRestUrl:o})=>{const t=k.getZonosUrl(e),r=document.head||document.body,s=document.createElement("link");s.rel="preconnect",s.href=`${A}/`,r.appendChild(s);const l=document.createElement("link");l.rel="stylesheet",l.href=`${t}/${o}`,l.onerror=()=>{n(`Failed to load ${l.href}`);const t=i(e);t&&k.injectStylesheet({cdnType:t,theRestUrl:o})},r.appendChild(l)},P.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?t("Zonos style links already injected","warn"):(k.injectStylesheet({cdnType:s,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),t("Zonos style css injected!"))},P.injectFonts=()=>{if((()=>{const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${Z}"]`);for(let o=0;o<e.length;o++){const t=e[o];if(t&&!$.test(t.href))return t}return null})())return void t("Inter font already injected","warn");const e=document.head||document.body,o=document.createElement("link");o.rel="preconnect",o.href=Z,e.appendChild(o);const n=document.createElement("link");n.rel="stylesheet",n.href=`${Z}/inter/inter.css`,e.appendChild(n),t("Zonos font injected!")},P.setupGoogleFont=e=>{var o;null===(o=k.zonosController)||void 0===o||o.setupGoogleFont(e)},P.injectSupportGoogleFont=e=>{var o;t(`[FONT] injecting ${e}`);const n=null===(o=e.match(/family=(.*?):/))||void 0===o?void 0:o[1],r=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${T}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=T,r.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${e}"]`))return void t(`[FONT] ${n} font already injected`,"warn");const s=document.createElement("link");s.rel="stylesheet",s.href=e,r.appendChild(s),t(`[FONT] ${n} font injected!`)},window.Zonos&&window.Zonos.doneInit||(window.Zonos=P)})();
@@ -0,0 +1,5 @@
1
+ export declare class ZonosCurrencyToggle {
2
+ errorImages: string[];
3
+ private handleToggleChanged;
4
+ render(): any;
5
+ }
@@ -32,6 +32,7 @@ export declare class ZonosShipping {
32
32
  serviceLevelsDAP: ShippingRichRadioItem[];
33
33
  serviceLevelsOther: ShippingRichRadioItem[];
34
34
  serviceLevelsAll: ShippingRichRadioItem[];
35
+ displayBaseCurrency: boolean;
35
36
  private handleRadioSelected;
36
37
  private handleValidate;
37
38
  private isOutdatedShippingData;
@@ -41,6 +42,7 @@ export declare class ZonosShipping {
41
42
  private continueClickHandler;
42
43
  private getLandedCostMethodLabelSuffix;
43
44
  private initServiceLevels;
45
+ private isCurrencyToggled;
44
46
  private preselectFirstShippingMethod;
45
47
  componentWillLoad(): void;
46
48
  render(): any;