@zonos/elements 1.3.31 → 1.3.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{cart-62ff7ee7.js → cart-d07e8ea1.js} +460 -41
- package/dist/cjs/index.cjs.js +4 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{submitGtag-a5f8eaab.js → submitGtag-f1aeac3e.js} +4 -1
- package/dist/cjs/zonos-address_8.cjs.entry.js +11 -11
- package/dist/cjs/zonos-badge_2.cjs.entry.js +6 -6
- package/dist/cjs/zonos-button_3.cjs.entry.js +6 -3
- package/dist/cjs/zonos-card.cjs.entry.js +47 -0
- package/dist/cjs/zonos-cart-items_12.cjs.entry.js +53 -36
- package/dist/cjs/zonos-checkout.cjs.entry.js +18 -10
- package/dist/cjs/zonos-component.cjs.entry.js +1 -1
- package/dist/cjs/zonos-controller.cjs.entry.js +2 -2
- package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -1
- package/dist/cjs/zonos-country-select_3.cjs.entry.js +7 -7
- package/dist/cjs/zonos-elements.cjs.js +1 -1
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +5 -5
- package/dist/cjs/zonos-hello.cjs.entry.js +1 -1
- package/dist/cjs/zonos-input.cjs.entry.js +4 -4
- package/dist/cjs/{zonos-card_2.cjs.entry.js → zonos-language-select_2.cjs.entry.js} +23 -29
- package/dist/cjs/zonos-link.cjs.entry.js +1 -1
- package/dist/cjs/zonos-logo.cjs.entry.js +2 -2
- package/dist/cjs/zonos-notification_2.cjs.entry.js +123 -0
- package/dist/cjs/zonos-v-stack.cjs.entry.js +25 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.css +15 -4
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +16 -15
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-footer/zonos-checkout-footer.js +2 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/assets/CheckmarkLineIcon.svg +1 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/assets/RemoveLineIcon.svg +1 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.css +8 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.js +20 -4
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.css +9 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +17 -6
- package/dist/collection/components/checkout/zonos-checkout/zonos-review/zonos-review.js +3 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +1 -1
- package/dist/collection/components/common/zonos-badge/zonos-badge.css +10 -0
- package/dist/collection/components/common/zonos-badge/zonos-badge.js +6 -6
- package/dist/collection/components/common/zonos-button/zonos-button.js +28 -4
- package/dist/collection/components/common/zonos-card/zonos-card.css +3 -1
- package/dist/collection/components/common/zonos-card/zonos-card.js +61 -3
- package/dist/collection/components/common/zonos-checkbox/zonos-checkbox.js +3 -3
- package/dist/collection/components/common/zonos-checkout-progress-tabs/zonos-checkout-progress-tabs.js +3 -3
- package/dist/collection/components/common/zonos-collapse/zonos-collapse.js +2 -2
- package/dist/collection/components/common/zonos-confirm-dialog/zonos-confirm-dialog.js +3 -3
- package/dist/collection/components/common/zonos-country-select/zonos-country-select.js +2 -2
- package/dist/collection/components/common/zonos-custom-message/zonos-custom-message.js +2 -2
- package/dist/collection/components/common/zonos-dialog/zonos-dialog.js +3 -3
- package/dist/collection/components/common/zonos-input/zonos-input.js +4 -4
- package/dist/collection/components/common/zonos-language-select/zonos-language-select.js +2 -2
- package/dist/collection/components/common/zonos-link/zonos-link.js +1 -1
- package/dist/collection/components/common/zonos-logo/zonos-logo.js +2 -2
- package/dist/collection/components/common/zonos-notification/zonos-notification.css +1 -1
- package/dist/collection/components/common/zonos-rest-state/zonos-rest-state.js +3 -3
- package/dist/collection/components/common/zonos-select-dialog-header/zonos-select-dialog-header.js +2 -2
- package/dist/collection/components/common/zonos-tooltip/zonos-tooltip.js +2 -2
- package/dist/collection/components/common/zonos-v-stack/zonos-v-stack.js +2 -2
- package/dist/collection/components/component-template/zonos-component/zonos-component.js +1 -1
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.js +2 -2
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +4 -4
- package/dist/collection/components/main/zonos-controller.js +1 -1
- package/dist/collection/components/store/checkout/stripe.js +0 -1
- package/dist/collection/components/store/translationStore/strings.arabic.js +23 -2
- package/dist/collection/components/store/translationStore/strings.base.js +23 -2
- package/dist/collection/components/store/translationStore/strings.chinese.js +23 -2
- package/dist/collection/components/store/translationStore/strings.danish.js +23 -2
- package/dist/collection/components/store/translationStore/strings.dutch.js +23 -2
- package/dist/collection/components/store/translationStore/strings.french.js +23 -2
- package/dist/collection/components/store/translationStore/strings.german.js +23 -2
- package/dist/collection/components/store/translationStore/strings.hebrew.js +23 -2
- package/dist/collection/components/store/translationStore/strings.indonesian.js +23 -2
- package/dist/collection/components/store/translationStore/strings.italian.js +23 -2
- package/dist/collection/components/store/translationStore/strings.japanese.js +23 -2
- package/dist/collection/components/store/translationStore/strings.korean.js +23 -2
- package/dist/collection/components/store/translationStore/strings.norwegian.js +23 -2
- package/dist/collection/components/store/translationStore/strings.polish.js +23 -2
- package/dist/collection/components/store/translationStore/strings.portuguese.js +23 -2
- package/dist/collection/components/store/translationStore/strings.russian.js +23 -2
- package/dist/collection/components/store/translationStore/strings.spanish.js +23 -2
- package/dist/collection/components/store/translationStore/strings.swedish.js +23 -2
- package/dist/collection/components/store/translationStore/strings.turkish.js +23 -2
- package/dist/collection/components/store/translationStore/strings.vietnamese.js +23 -2
- package/dist/collection/components/stripe/zonos-address/zonos-address.js +1 -1
- package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js +1 -1
- package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +1 -1
- package/dist/collection/components/utils/checkout/getIsTestMode.js +1 -0
- package/dist/esm/{cart-b96aaa4f.js → cart-a90aa9ae.js} +460 -41
- package/dist/esm/index.js +4 -4
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{submitGtag-6e271d76.js → submitGtag-849e2bc9.js} +4 -2
- package/dist/esm/zonos-address_8.entry.js +11 -11
- package/dist/esm/zonos-badge_2.entry.js +6 -6
- package/dist/esm/zonos-button_3.entry.js +6 -3
- package/dist/esm/zonos-card.entry.js +43 -0
- package/dist/esm/zonos-cart-items_12.entry.js +53 -36
- package/dist/esm/zonos-checkout.entry.js +18 -10
- package/dist/esm/zonos-component.entry.js +1 -1
- package/dist/esm/zonos-controller.entry.js +2 -2
- package/dist/esm/zonos-country-flag.entry.js +1 -1
- package/dist/esm/zonos-country-select_3.entry.js +7 -7
- package/dist/esm/zonos-elements.js +1 -1
- package/dist/esm/zonos-hello-dialog.entry.js +5 -5
- package/dist/esm/zonos-hello.entry.js +1 -1
- package/dist/esm/zonos-input.entry.js +4 -4
- package/dist/esm/zonos-language-select_2.entry.js +56 -0
- package/dist/esm/zonos-link.entry.js +1 -1
- package/dist/esm/zonos-logo.entry.js +2 -2
- package/dist/esm/zonos-notification_2.entry.js +118 -0
- package/dist/esm/zonos-v-stack.entry.js +21 -0
- package/dist/esm-es5/cart-a90aa9ae.js +1 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/submitGtag-849e2bc9.js +1 -0
- package/dist/esm-es5/zonos-address_8.entry.js +1 -1
- package/dist/esm-es5/zonos-badge_2.entry.js +1 -1
- package/dist/esm-es5/zonos-button_3.entry.js +1 -1
- package/dist/esm-es5/zonos-card.entry.js +1 -0
- package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-component.entry.js +1 -1
- package/dist/esm-es5/zonos-controller.entry.js +1 -1
- package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
- package/dist/esm-es5/zonos-country-select_3.entry.js +1 -1
- package/dist/esm-es5/zonos-elements.js +1 -1
- package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm-es5/zonos-hello.entry.js +1 -1
- package/dist/esm-es5/zonos-input.entry.js +1 -1
- package/dist/esm-es5/zonos-language-select_2.entry.js +1 -0
- package/dist/esm-es5/zonos-link.entry.js +1 -1
- package/dist/esm-es5/zonos-logo.entry.js +1 -1
- package/dist/esm-es5/zonos-notification_2.entry.js +1 -0
- package/dist/esm-es5/zonos-v-stack.entry.js +1 -0
- package/dist/scripts/index.d.ts +34 -6
- package/dist/scripts/index.js +1 -1
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/types/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.d.ts +1 -0
- package/dist/types/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.d.ts +1 -0
- package/dist/types/components/checkout/zonos-checkout/zonos-checkout.d.ts +1 -0
- package/dist/types/components/common/zonos-badge/zonos-badge.d.ts +2 -2
- package/dist/types/components/common/zonos-button/zonos-button.d.ts +6 -1
- package/dist/types/components/common/zonos-card/zonos-card.d.ts +10 -0
- package/dist/types/components/store/translationStore/strings.arabic.d.ts +22 -1
- package/dist/types/components/store/translationStore/strings.base.d.ts +22 -1
- package/dist/types/components/store/translationStore/strings.chinese.d.ts +22 -1
- package/dist/types/components/store/translationStore/strings.danish.d.ts +22 -1
- package/dist/types/components/store/translationStore/strings.dutch.d.ts +22 -1
- package/dist/types/components/store/translationStore/strings.french.d.ts +22 -1
- package/dist/types/components/store/translationStore/strings.german.d.ts +22 -1
- package/dist/types/components/store/translationStore/strings.hebrew.d.ts +22 -1
- package/dist/types/components/store/translationStore/strings.indonesian.d.ts +22 -1
- package/dist/types/components/store/translationStore/strings.italian.d.ts +22 -1
- package/dist/types/components/store/translationStore/strings.japanese.d.ts +22 -1
- package/dist/types/components/store/translationStore/strings.korean.d.ts +22 -1
- package/dist/types/components/store/translationStore/strings.norwegian.d.ts +22 -1
- package/dist/types/components/store/translationStore/strings.polish.d.ts +22 -1
- package/dist/types/components/store/translationStore/strings.portuguese.d.ts +22 -1
- package/dist/types/components/store/translationStore/strings.russian.d.ts +22 -1
- package/dist/types/components/store/translationStore/strings.spanish.d.ts +22 -1
- package/dist/types/components/store/translationStore/strings.swedish.d.ts +22 -1
- package/dist/types/components/store/translationStore/strings.turkish.d.ts +22 -1
- package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +22 -1
- package/dist/types/components/store/translationStore.d.ts +1 -1
- package/dist/types/components/utils/checkout/getIsTestMode.d.ts +1 -0
- package/dist/types/components.d.ts +36 -6
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/p-057380ad.system.js +1 -0
- package/dist/zonos-elements/{p-b208fec6.system.entry.js → p-16ab16f9.system.entry.js} +1 -1
- package/dist/zonos-elements/p-1eab7a86.entry.js +1 -0
- package/dist/zonos-elements/p-21b61106.system.entry.js +1 -0
- package/dist/zonos-elements/p-22882fd6.entry.js +1 -0
- package/dist/zonos-elements/p-2a45c837.system.entry.js +1 -0
- package/dist/zonos-elements/p-2d6d0d57.js +1 -0
- package/dist/zonos-elements/{p-7664dec5.entry.js → p-344ce057.entry.js} +1 -1
- package/dist/zonos-elements/{p-c4e38b85.entry.js → p-3523c3b4.entry.js} +1 -1
- package/dist/zonos-elements/{p-2cb880e7.system.entry.js → p-38a90e86.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-9b0aa65c.system.js → p-3ba86711.system.js} +1 -1
- package/dist/zonos-elements/p-41ef293d.js +1 -0
- package/dist/zonos-elements/{p-6cb9812b.entry.js → p-63a27875.entry.js} +1 -1
- package/dist/zonos-elements/{p-9cdfb51b.system.entry.js → p-672e80e5.system.entry.js} +1 -1
- package/dist/zonos-elements/p-6c3390b7.entry.js +1 -0
- package/dist/zonos-elements/{p-666d1605.system.entry.js → p-6de51a79.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-725c2d57.entry.js → p-6f04e132.entry.js} +1 -1
- package/dist/zonos-elements/{p-10b9a681.system.entry.js → p-717faabd.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-a90393e0.system.entry.js → p-71882ac9.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-78a839b8.entry.js → p-7a6dcfa2.entry.js} +1 -1
- package/dist/zonos-elements/p-85503e70.system.entry.js +1 -0
- package/dist/zonos-elements/{p-9c32b924.entry.js → p-8aadefbb.entry.js} +1 -1
- package/dist/zonos-elements/p-8b771620.entry.js +1 -0
- package/dist/zonos-elements/{p-692816a7.entry.js → p-93e493ce.entry.js} +1 -1
- package/dist/zonos-elements/{p-dda78e8e.system.entry.js → p-966ab4e7.system.entry.js} +1 -1
- package/dist/zonos-elements/p-9d599745.entry.js +1 -0
- package/dist/zonos-elements/{p-3dc59d89.system.entry.js → p-9de374a7.system.entry.js} +1 -1
- package/dist/zonos-elements/p-af0d3ca0.system.entry.js +1 -0
- package/dist/zonos-elements/p-b6c515e1.system.entry.js +1 -0
- package/dist/zonos-elements/{p-13454044.system.entry.js → p-b903af96.system.entry.js} +1 -1
- package/dist/zonos-elements/p-c21802e9.entry.js +1 -0
- package/dist/zonos-elements/{p-d4724ac8.entry.js → p-c3619b3d.entry.js} +1 -1
- package/dist/zonos-elements/{p-89664e49.system.js → p-ca8fb99c.system.js} +1 -1
- package/dist/zonos-elements/p-cc965417.entry.js +1 -0
- package/dist/zonos-elements/{p-941a01be.system.entry.js → p-d2992457.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-2701e08c.entry.js → p-d8c1eb99.entry.js} +1 -1
- package/dist/zonos-elements/p-da2e5289.system.entry.js +1 -0
- package/dist/zonos-elements/{p-d8027710.system.entry.js → p-da787898.system.entry.js} +1 -1
- package/dist/zonos-elements/p-e0bf9666.system.js +1 -1
- package/dist/zonos-elements/{p-4a0cf47b.entry.js → p-e344cb12.entry.js} +1 -1
- package/dist/zonos-elements/p-e3c014ae.entry.js +1 -0
- package/dist/zonos-elements/p-ed333de6.system.entry.js +1 -0
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/zonos-notification.cjs.entry.js +0 -72
- package/dist/cjs/zonos-payment.cjs.entry.js +0 -58
- package/dist/cjs/zonos-select-dialog-header_2.cjs.entry.js +0 -45
- package/dist/esm/zonos-card_2.entry.js +0 -62
- package/dist/esm/zonos-notification.entry.js +0 -68
- package/dist/esm/zonos-payment.entry.js +0 -54
- package/dist/esm/zonos-select-dialog-header_2.entry.js +0 -40
- package/dist/esm-es5/cart-b96aaa4f.js +0 -1
- package/dist/esm-es5/submitGtag-6e271d76.js +0 -1
- package/dist/esm-es5/zonos-card_2.entry.js +0 -1
- package/dist/esm-es5/zonos-notification.entry.js +0 -1
- package/dist/esm-es5/zonos-payment.entry.js +0 -1
- package/dist/esm-es5/zonos-select-dialog-header_2.entry.js +0 -1
- package/dist/zonos-elements/p-087c83a5.system.entry.js +0 -1
- package/dist/zonos-elements/p-1a40aaf4.system.js +0 -1
- package/dist/zonos-elements/p-2613b5d3.system.entry.js +0 -1
- package/dist/zonos-elements/p-27d648c3.system.entry.js +0 -1
- package/dist/zonos-elements/p-4e01d1ab.system.entry.js +0 -1
- package/dist/zonos-elements/p-5441b729.entry.js +0 -1
- package/dist/zonos-elements/p-5857ad65.entry.js +0 -1
- package/dist/zonos-elements/p-5d53f9a4.js +0 -1
- package/dist/zonos-elements/p-75ba695c.entry.js +0 -1
- package/dist/zonos-elements/p-8c9e7980.entry.js +0 -1
- package/dist/zonos-elements/p-8f8baabf.system.entry.js +0 -1
- package/dist/zonos-elements/p-9f7c0472.entry.js +0 -1
- package/dist/zonos-elements/p-acfb9be6.system.entry.js +0 -1
- package/dist/zonos-elements/p-b468f941.js +0 -1
- package/dist/zonos-elements/p-bb5a9eaa.entry.js +0 -1
- package/dist/zonos-elements/p-be2b32f5.entry.js +0 -1
- package/dist/zonos-elements/p-c63a7dde.entry.js +0 -1
- package/dist/zonos-elements/p-f38fd0d9.system.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(o,e,t,n){function i(o){return o instanceof t?o:new t((function(e){e(o)}))}return new(t||(t=Promise))((function(t,a){function s(o){try{l(n.next(o))}catch(o){a(o)}}function r(o){try{l(n["throw"](o))}catch(o){a(o)}}function l(o){o.done?t(o.value):i(o.value).then(s,r)}l((n=n.apply(o,e||[])).next())}))};var __generator=this&&this.__generator||function(o,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,s;return s={next:r(0),throw:r(1),return:r(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function r(o){return function(e){return l([o,e])}}function l(r){if(n)throw new TypeError("Generator is already executing.");while(s&&(s=0,r[0]&&(t=0)),t)try{if(n=1,i&&(a=r[0]&2?i["return"]:r[0]?i["throw"]||((a=i["return"])&&a.call(i),0):i.next)&&!(a=a.call(i,r[1])).done)return a;if(i=0,a)r=[r[0]&2,a.value];switch(r[0]){case 0:case 1:a=r;break;case 4:t.label++;return{value:r[1],done:false};case 5:t.label++;i=r[1];r=[0];continue;case 7:r=t.ops.pop();t.trys.pop();continue;default:if(!(a=t.trys,a=a.length>0&&a[a.length-1])&&(r[0]===6||r[0]===2)){t=0;continue}if(r[0]===3&&(!a||r[1]>a[0]&&r[1]<a[3])){t.label=r[1];break}if(r[0]===6&&t.label<a[1]){t.label=a[1];a=r;break}if(a&&t.label<a[2]){t.label=a[2];t.ops.push(r);break}if(a[2])t.ops.pop();t.trys.pop();continue}r=e.call(o,t)}catch(o){r=[6,o];i=0}finally{n=a=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host}from"./index-3b46f3c3.js";import{l as localizationStore,B as currencyFormat,t as translate}from"./cart-b96aaa4f.js";import{z as zonosStore}from"./zonosStore-ba9e541e.js";import{c as classes}from"./classes-0d95c529.js";import{f as formatStringWithLinks}from"./formatStringWithLinks-9e819405.js";import{g as getHasMoreSpaceOnRight}from"./getHasMoreSpaceOnRight-70eb913a.js";import"./logError-c456c092.js";import"./isDarkColor-f8324c10.js";import"./getBorderRadius-947c24de.js";var getHasMoreSpaceAbove=function(o){var e=o.getBoundingClientRect();var t=e.top;var n=window.innerHeight-e.bottom;return t>=n};var wrapStringWithLink=function(o){var e=o.href,t=o.text;return'<zonos-link href="'.concat(e,'" target="_blank" rel="noopener noreferrer">').concat(t,"</zonos-link>")};var BagIcon='<svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M9.66666 4.16667C9.20642 4.16667 8.83333 4.53976 8.83333 5V5.83333H12.1667V5C12.1667 4.53976 11.7936 4.16667 11.3333 4.16667H9.66666ZM13.8333 5.83333V5C13.8333 3.61929 12.714 2.5 11.3333 2.5H9.66666C8.28595 2.5 7.16666 3.61929 7.16666 5V5.83333H6.77759C5.44832 5.83333 4.35149 6.87354 4.2811 8.20094L3.92756 14.8676C3.85169 16.2983 4.99133 17.5 6.42405 17.5H14.5759C16.0087 17.5 17.1483 16.2983 17.0724 14.8676L16.7189 8.20094C16.6485 6.87354 15.5517 5.83333 14.2224 5.83333H13.8333ZM12.1667 7.5V8.33333C12.1667 8.79357 12.5398 9.16667 13 9.16667C13.4602 9.16667 13.8333 8.79357 13.8333 8.33333V7.5H14.2224C14.6655 7.5 15.0311 7.84674 15.0546 8.2892L15.4081 14.9559C15.4334 15.4328 15.0535 15.8333 14.5759 15.8333H6.42405C5.94648 15.8333 5.5666 15.4328 5.59189 14.9559L5.94542 8.2892C5.96889 7.84674 6.3345 7.5 6.77759 7.5H7.16666V8.33333C7.16666 8.79357 7.53976 9.16667 7.99999 9.16667C8.46023 9.16667 8.83333 8.79357 8.83333 8.33333V7.5H12.1667Z" fill="#4D505A"/>\n</svg>\n';var ImportIcon='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M9.35028 11.5744C9.05738 11.2815 8.58251 11.2815 8.28962 11.5744C7.99672 11.8673 7.99672 12.3422 8.28962 12.635L11.2917 15.6372C11.6823 16.0277 12.3154 16.0277 12.7059 15.6372L15.708 12.6351C16.0009 12.3422 16.0009 11.8674 15.708 11.5745C15.4151 11.2816 14.9402 11.2816 14.6473 11.5745L12.7488 13.4729V4.68005C12.7488 4.26584 12.413 3.93005 11.9988 3.93005C11.5846 3.93005 11.2488 4.26584 11.2488 4.68005L11.2488 13.4729L9.35028 11.5744Z" fill="#4D505A"/>\n<path d="M20 14C20 13.5858 19.6642 13.25 19.25 13.25C18.8358 13.25 18.5 13.5858 18.5 14L18.5 17.25C18.5 17.9404 17.9404 18.5 17.25 18.5L6.75 18.5C6.05964 18.5 5.5 17.9404 5.5 17.25L5.5 14C5.5 13.5858 5.16421 13.25 4.75 13.25C4.33579 13.25 4 13.5858 4 14V17.25C4 18.7688 5.23122 20 6.75 20H17.25C18.7688 20 20 18.7688 20 17.25L20 14Z" fill="#4D505A"/>\n</svg>\n';var MessageIcon='<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M2.25 4.5C2.25 3.25736 3.25736 2.25 4.5 2.25H13.5C14.7426 2.25 15.75 3.25736 15.75 4.5V10.5C15.75 11.7426 14.7426 12.75 13.5 12.75H8.25C8.01393 12.75 7.79164 12.8611 7.65 13.05L6.3 14.85C5.87508 15.4166 5.2082 15.75 4.5 15.75C3.25736 15.75 2.25 14.7426 2.25 13.5V4.5ZM4.5 3.75C4.08579 3.75 3.75 4.08579 3.75 4.5V13.5C3.75 13.9142 4.08579 14.25 4.5 14.25C4.73607 14.25 4.95836 14.1389 5.1 13.95L6.45 12.15C6.87492 11.5834 7.5418 11.25 8.25 11.25H13.5C13.9142 11.25 14.25 10.9142 14.25 10.5V4.5C14.25 4.08579 13.9142 3.75 13.5 3.75H4.5ZM5.25 6C5.25 5.58579 5.58579 5.25 6 5.25H12C12.4142 5.25 12.75 5.58579 12.75 6C12.75 6.41421 12.4142 6.75 12 6.75H6C5.58579 6.75 5.25 6.41421 5.25 6ZM5.25 9C5.25 8.58579 5.58579 8.25 6 8.25H8.25C8.66421 8.25 9 8.58579 9 9C9 9.41421 8.66421 9.75 8.25 9.75H6C5.58579 9.75 5.25 9.41421 5.25 9Z" fill="#4D505A"/>\n</svg>\n';var MoneyIcon='<svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M2.16666 5.83301C2.16666 4.4523 3.28594 3.33301 4.66666 3.33301H16.3333C17.714 3.33301 18.8333 4.4523 18.8333 5.83301V14.1663C18.8333 15.5471 17.714 16.6663 16.3333 16.6663H4.66666C3.28594 16.6663 2.16666 15.5471 2.16666 14.1663V5.83301ZM4.66666 4.99967C4.20642 4.99967 3.83332 5.37277 3.83332 5.83301V14.1663C3.83332 14.6266 4.20642 14.9997 4.66666 14.9997H16.3333C16.7936 14.9997 17.1667 14.6266 17.1667 14.1663V5.83301C17.1667 5.37277 16.7936 4.99967 16.3333 4.99967H4.66666ZM6.33332 8.33301C6.79356 8.33301 7.16666 8.7061 7.16666 9.16634V10.833C7.16666 11.2932 6.79356 11.6663 6.33332 11.6663C5.87309 11.6663 5.49999 11.2932 5.49999 10.833V9.16634C5.49999 8.7061 5.87309 8.33301 6.33332 8.33301ZM8.83332 9.99967C8.83332 9.0792 9.57952 8.33301 10.5 8.33301C11.4205 8.33301 12.1667 9.0792 12.1667 9.99967C12.1667 10.9201 11.4205 11.6663 10.5 11.6663C9.57952 11.6663 8.83332 10.9201 8.83332 9.99967ZM14.6667 8.33301C15.1269 8.33301 15.5 8.7061 15.5 9.16634V10.833C15.5 11.2932 15.1269 11.6663 14.6667 11.6663C14.2064 11.6663 13.8333 11.2932 13.8333 10.833V9.16634C13.8333 8.7061 14.2064 8.33301 14.6667 8.33301Z" fill="#4D505A"/>\n</svg>\n';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 zonosHelloDialogCss=":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--hello-country-flag{height:18px;width:18px;position:relative;overflow:hidden;border-radius:30px;-webkit-box-shadow:var(--zonos-elements-v3-shadow-medium);box-shadow:var(--zonos-elements-v3-shadow-medium);z-index:10;justify-self:center}:host .zonos--hello-dialog{position:absolute;background:var(--zonos-elements-surface-color);width:100vw;max-width:430px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;max-height:600px;border-radius:var(--zonos-elements-radius-12);outline:none;-webkit-box-shadow:var(--zonos-elements-v3-shadow-xxl);box-shadow:var(--zonos-elements-v3-shadow-xxl);overflow-y:auto;top:-2px;right:-2px;opacity:0;-webkit-transition:opacity 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;transition:opacity 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;transition:opacity 0.3s ease-in-out, transform 0.3s ease-in-out;transition:opacity 0.3s ease-in-out, transform 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;-webkit-transform:scale(0);transform:scale(0);-webkit-transform-origin:top right;transform-origin:top right;z-index:1001}:host .zonos--hello-dialog .zonos--hello-dialog-header{text-align:center}:host .zonos--hello-dialog.zonos--hello-dialog-animate-from-left{-webkit-transform-origin:top left;transform-origin:top left;right:unset;left:-2px}:host .zonos--hello-dialog.zonos--hello-dialog-animate-from-bottom{-webkit-transform-origin:bottom right;transform-origin:bottom right;bottom:calc(100% - 32px);top:unset}:host .zonos--hello-dialog.zonos--hello-dialog-animate-from-bottom.zonos--hello-dialog-animate-from-left{-webkit-transform-origin:bottom left;transform-origin:bottom left}:host .zonos--hello-dialog::-webkit-scrollbar{width:12px;height:12px}:host .zonos--hello-dialog::-webkit-scrollbar-track{background:#f5f5f5;border-top-right-radius:var(--zonos-elements-radius-12);border-bottom-right-radius:var(--zonos-elements-radius-12)}:host .zonos--hello-dialog::-webkit-scrollbar-thumb{border-radius:10px;background:#ccc;border:4px solid transparent;background-clip:content-box}:host .zonos--hello-dialog::-webkit-scrollbar-thumb:hover{background:#999}:host .zonos--hello-dialog .zonos--animate-content{opacity:0;height:0;-webkit-transition:all 0.3s ease-in-out;transition:all 0.3s ease-in-out}:host .zonos--hello-dialog .zonos--show-animate-content{opacity:1;height:100%}:host .zonos--hello-dialog.zonos--hello-dialog-open{opacity:1;-webkit-transform:scale(1);transform:scale(1)}:host .zonos--hello-dialog .zonos--close-button{position:absolute;right:8px;top:8px;width:var(--zonos-elements-size-md);height:var(--zonos-elements-size-md);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;cursor:pointer;z-index:10}:host .zonos--hello-dialog .zonos--close-button:hover{background:var(--zonos-elements-hover-color);border-radius:var(--zonos-elements-radius-6)}:host .zonos--hello-dialog .zonos--hello-dialog-content{padding:16px}:host .zonos--hello-dialog .zonos--hello-dialog-content .zonos--hello-country-flag{border-radius:var(--zonos-elements-radius-4);width:32px;height:24px}:host .zonos--hello-dialog .zonos--flex-message{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:12px}:host .zonos--hello-dialog.zonos--hello-dialog-mobile-override{position:-webkit-sticky;position:sticky;top:unset;left:unset;right:unset;bottom:0;width:100vw;max-width:100vw;max-height:500px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;-webkit-transform:scaleY(0);transform:scaleY(0);border-radius:0;-webkit-transform-origin:bottom;transform-origin:bottom}@media (max-height: 600px){:host .zonos--hello-dialog.zonos--hello-dialog-mobile-override{max-height:80vh}}:host .zonos--hello-dialog.zonos--hello-dialog-mobile-override.zonos--hello-dialog-animate-from-left{-webkit-transform-origin:bottom;transform-origin:bottom}:host .zonos--hello-dialog.zonos--hello-dialog-mobile-override.zonos--hello-dialog-open{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1)}@media (max-width: 768px){:host .zonos--hello-dialog{position:-webkit-sticky;position:sticky;top:unset;left:unset;right:unset;bottom:0;width:100vw;max-width:100vw;max-height:500px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;-webkit-transform:scaleY(0);transform:scaleY(0);border-radius:0;-webkit-transform-origin:bottom;transform-origin:bottom}}@media (max-width: 768px) and (max-height: 600px){:host .zonos--hello-dialog{max-height:80vh}}@media (max-width: 768px){:host .zonos--hello-dialog.zonos--hello-dialog-animate-from-left{-webkit-transform-origin:bottom;transform-origin:bottom}}@media (max-width: 768px){:host .zonos--hello-dialog.zonos--hello-dialog-open{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1)}}";var ZonosHelloDialogStyle0=zonosHelloDialogCss;var ZonosHelloDialog=function(){function o(o){var e=this;registerInstance(this,o);this.closeDialog=createEvent(this,"closeDialog",7);this.clickOutsideDialogHandler=function(o){if(!o.composedPath().includes(e.dialogRef)&&e.isOpen){e.setIsOpen(false)}};this.getCurrentPageEnum=function(){switch(zonosStore.currentHelloPage){case"home":return"hello_homepage";case"cart":return"hello_cart";case"productList":return"hello_item_list";case"productDetail":return"hello_item_details";default:return null}};this.setShowCountrySelect=function(o){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(e){this.showCountrySelect=o;return[2]}))}))};this.setShowLanguageSelect=function(o){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(e){this.showLanguageSelect=o;return[2]}))}))};this.hasTaxId=function(){var o;return(o=localizationStore.countryLandedCost)===null||o===void 0?void 0:o.hasTaxId};this.isNoThresholdCountry=function(o){if(!o||!e.hasTaxId()){return false}return["AU"].includes(o)};this.getDutyMessage=function(){var o=localizationStore.countryLandedCost;var t=(o===null||o===void 0?void 0:o.dutyDeminimus)?currencyFormat({amount:o.dutyDeminimus}):null;return t&&!e.isNoThresholdCountry(o===null||o===void 0?void 0:o.countryCode)?translate("Spend [threshold] duty free",{threshold:t}):translate("Duties will apply to all orders")};this.getTaxMessage=function(){var o=localizationStore.countryLandedCost;var t=(o===null||o===void 0?void 0:o.vatTaxDeminimus)?currencyFormat({amount:o.vatTaxDeminimus}):null;return t&&!e.isNoThresholdCountry(o===null||o===void 0?void 0:o.countryCode)?translate("Spend [threshold] tax free",{threshold:t}):translate("Taxes will apply to all orders")};this.getUkDutyTaxMessage=function(o){if(o.allowLowValueOrders){return null}var e=o.dutyDeminimus;return[translate("Orders to [countryName] must be over [threshold] to ship.",{countryName:"United Kingdom",threshold:currencyFormat({amount:e})})]};this.getAustraliaDutyTaxMessage=function(o){return[translate("Duties & taxes in Australia, VAT or GST is [percentage] and is due on all orders",{percentage:"".concat(o.vatTaxRate*100,"%")}),"".concat(translate("The low-value GST law passed July 1st, 2018 applies to this retailer.")," ").concat(wrapStringWithLink({href:"https://zonos.com/docs/global-ecommerce/landed-cost/tax-remittance/australia-gst",text:translate("Learn more.")}))]};this.getNewZealandDutyTaxMessge=function(o){return[translate("[percentage] GST due on any order above [threshold] along with an import entry transaction fee and MPI levy.",{percentage:"".concat(o.vatTaxRate*100,"%"),threshold:currencyFormat({amount:o.vatTaxDeminimus})})]};this.getAdditionalDutyTaxMessage=function(){if(!localizationStore.countryLandedCost){return null}if(!e.hasTaxId()){return null}switch(localizationStore.countryLandedCost.countryCode){case"GB":return e.getUkDutyTaxMessage(localizationStore.countryLandedCost);case"AU":return e.getAustraliaDutyTaxMessage(localizationStore.countryLandedCost);case"NZ":return e.getNewZealandDutyTaxMessge(localizationStore.countryLandedCost);default:return null}};this.isOpen=false;this.setIsOpen=function(){};this.mobileLocationOverride=undefined;this.animateFromLeftOverride=undefined;this.appearanceSettings=undefined;this.restrictedItems=[];this.welcomeMessage="Welcome to our Demo App!";this.showCountrySelect=false;this.showLanguageSelect=false}o.prototype.globalClickHandler=function(o){this.clickOutsideDialogHandler(o)};o.prototype.isOpenHandler=function(o){if(!o){void this.setShowCountrySelect(false);void this.setShowLanguageSelect(false)}};o.prototype.render=function(){var o=this;var e;var t=localizationStore.selectedCountryCode;var n=this.getDutyMessage();var i=this.getTaxMessage();var a=this.getAdditionalDutyTaxMessage();var s=this.animateFromLeftOverride||this.dialogRef&&getHasMoreSpaceOnRight(this.dialogRef);var r=this.dialogRef&&getHasMoreSpaceAbove(this.dialogRef);var l=localizationStore.customMessages;var c=translate("Welcome to [storeName]",{storeName:zonosStore.organizationName});var d=((e=l.find((function(o){return o.pageName==="hello_default"})))===null||e===void 0?void 0:e.message)||translate("Know about duties and taxes before you buy. Shop with confidence!");var f=formatStringWithLinks(d);var u=this.getCurrentPageEnum();var g=l.filter((function(o){return o.pageName===u}));return h(Host,{key:"1194b1466981cf8ba04d726eff3ba34b19510258",class:"zonos--elements"},h("div",{key:"ffea099f72ff3f42ddbd5b5947a5b8ca0f3d206d","aria-hidden":"true",class:classes(["zonos--hello-dialog",s&&"zonos--hello-dialog-animate-from-left",r&&"zonos--hello-dialog-animate-from-bottom",!!this.mobileLocationOverride&&"zonos--hello-dialog-mobile-override",this.isOpen&&"zonos--hello-dialog-open"]),ref:function(e){return e&&(o.dialogRef=e)}},!this.showCountrySelect&&!this.showLanguageSelect&&h("div",{key:"7396d7cd91c69f77d5f2f4ae9a088b1a763c6988"},h("div",{key:"aedfda83797a58fc2a0432a89503cbc7774d5c8b",class:"zonos--hello-dialog-content"},h("zonos-button",{key:"0c9ad53d902ce7c45cdf9192dbe8ea7f9f46f7d4",class:"zonos--close-button",icon:h("zonos-icon",{"aria-label":"Close Zonos Hello dialog",content:RemoveIcon}),noBackground:true,onClick:function(){return o.setIsOpen(false)}}),h("zonos-v-stack",{key:"9a359684275e946fc26bdc6ea7b8a371bf49dea5",spacing:24},h("zonos-country-flag",{key:"ca230fb4426ecb39febb0972d9a6ce15435c4e1d",class:"zonos--hello-country-flag",countryCode:t}),h("zonos-v-stack",{key:"17bbc6a70143a9165b8f088b5b2ea1e6e69622ed",class:"zonos--hello-dialog-header",spacing:4},h("zonos-text",{key:"33c66273d9fd8330ee4cf2bfcdf5b454a89e0ae0",type:"boldSubheader"},c),h("zonos-text",{key:"57cfdcd587ab62fad99016a389771d3a169ad297",innerHTML:f,textColor:"gray-800"})),h("zonos-v-stack",{key:"28b9b9e7967e81ca50bc4d0cfe45c9545a8b9dde",spacing:8},this.restrictedItems.map((function(o){var e;return o&&h("zonos-banner",{bannerTitle:o.name,intent:"error"},(e=o.itemRestrictions)===null||e===void 0?void 0:e.map((function(o){return h("zonos-text",{textColor:"red-800"},o===null||o===void 0?void 0:o.note)})))})),h("zonos-card",{key:"94ef9064b4e523c3f0fc9cd50142da36f003006d",spacing:"12px"},h("zonos-v-stack",{key:"01b3550b5b080d106eaecedf78b13275e01ae159",spacing:12},h("div",{key:"19b1ba3e12dab87250d3ad19a5dc8e13b6f871d6",class:"zonos--flex-message"},h("zonos-icon",{key:"9773bf4ad57752437a367c2093de0737693bf588","aria-label":"Duty de minimis",content:ImportIcon}),h("zonos-text",{key:"4c75d971f37db399e6f4332a6c92b53758629b6b"},n)),h("div",{key:"52640f51d3664582d7bb3c26f2d2d17d82ad856e",class:"zonos--flex-message"},h("zonos-icon",{key:"9afe9273e6b19aada01018152a64973449b87094","aria-label":"Tax de minimis",content:MoneyIcon}),h("zonos-text",{key:"b2481af13570471cc2907c48b54c7039ec31e92c"},i)),a===null||a===void 0?void 0:a.map((function(o){return h("div",{class:"zonos--flex-message"},h("zonos-icon",{"aria-label":"Additional information for buying goods from selected country",content:BagIcon}),h("zonos-text",{innerHTML:o}))})))),g.map((function(o){return h("zonos-custom-message",{icon:MessageIcon,message:o.message})}))))),h("zonos-hello-dialog-footer",{key:"a6b2d31ee922db13cf9987a823e99d6088c392b0",appearanceSettings:this.appearanceSettings,setShowCountrySelect:function(e){return o.setShowCountrySelect(e)},setShowLanguageSelect:function(e){return o.setShowLanguageSelect(e)}})),this.showCountrySelect&&h("div",{key:"21d187502c3f0ccef0c351f09aa943566228944f"},h("zonos-country-select",{key:"3dbd522e8a5004c2a1ed766ba92c9d0387f845d8",handleOnClose:function(){return o.setShowCountrySelect(false)}})),this.showLanguageSelect&&h("div",{key:"686d8bba48fefd49bf2bf15dc295fb79b9cd5299"},h("zonos-language-select",{key:"22ba1b42ec7ba1808fd806ad3529a377d34b4ac8",handleOnClose:function(){return o.setShowLanguageSelect(false)}}))))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});Object.defineProperty(o,"watchers",{get:function(){return{isOpen:["isOpenHandler"]}},enumerable:false,configurable:true});return o}();ZonosHelloDialog.style=ZonosHelloDialogStyle0;export{ZonosHelloDialog as zonos_hello_dialog};
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(o,e,t,n){function i(o){return o instanceof t?o:new t((function(e){e(o)}))}return new(t||(t=Promise))((function(t,a){function s(o){try{l(n.next(o))}catch(o){a(o)}}function r(o){try{l(n["throw"](o))}catch(o){a(o)}}function l(o){o.done?t(o.value):i(o.value).then(s,r)}l((n=n.apply(o,e||[])).next())}))};var __generator=this&&this.__generator||function(o,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,s;return s={next:r(0),throw:r(1),return:r(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function r(o){return function(e){return l([o,e])}}function l(r){if(n)throw new TypeError("Generator is already executing.");while(s&&(s=0,r[0]&&(t=0)),t)try{if(n=1,i&&(a=r[0]&2?i["return"]:r[0]?i["throw"]||((a=i["return"])&&a.call(i),0):i.next)&&!(a=a.call(i,r[1])).done)return a;if(i=0,a)r=[r[0]&2,a.value];switch(r[0]){case 0:case 1:a=r;break;case 4:t.label++;return{value:r[1],done:false};case 5:t.label++;i=r[1];r=[0];continue;case 7:r=t.ops.pop();t.trys.pop();continue;default:if(!(a=t.trys,a=a.length>0&&a[a.length-1])&&(r[0]===6||r[0]===2)){t=0;continue}if(r[0]===3&&(!a||r[1]>a[0]&&r[1]<a[3])){t.label=r[1];break}if(r[0]===6&&t.label<a[1]){t.label=a[1];a=r;break}if(a&&t.label<a[2]){t.label=a[2];t.ops.push(r);break}if(a[2])t.ops.pop();t.trys.pop();continue}r=e.call(o,t)}catch(o){r=[6,o];i=0}finally{n=a=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host}from"./index-3b46f3c3.js";import{l as localizationStore,B as currencyFormat,t as translate}from"./cart-a90aa9ae.js";import{z as zonosStore}from"./zonosStore-ba9e541e.js";import{c as classes}from"./classes-0d95c529.js";import{f as formatStringWithLinks}from"./formatStringWithLinks-9e819405.js";import{g as getHasMoreSpaceOnRight}from"./getHasMoreSpaceOnRight-70eb913a.js";import"./logError-c456c092.js";import"./isDarkColor-f8324c10.js";import"./getBorderRadius-947c24de.js";var getHasMoreSpaceAbove=function(o){var e=o.getBoundingClientRect();var t=e.top;var n=window.innerHeight-e.bottom;return t>=n};var wrapStringWithLink=function(o){var e=o.href,t=o.text;return'<zonos-link href="'.concat(e,'" target="_blank" rel="noopener noreferrer">').concat(t,"</zonos-link>")};var BagIcon='<svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M9.66666 4.16667C9.20642 4.16667 8.83333 4.53976 8.83333 5V5.83333H12.1667V5C12.1667 4.53976 11.7936 4.16667 11.3333 4.16667H9.66666ZM13.8333 5.83333V5C13.8333 3.61929 12.714 2.5 11.3333 2.5H9.66666C8.28595 2.5 7.16666 3.61929 7.16666 5V5.83333H6.77759C5.44832 5.83333 4.35149 6.87354 4.2811 8.20094L3.92756 14.8676C3.85169 16.2983 4.99133 17.5 6.42405 17.5H14.5759C16.0087 17.5 17.1483 16.2983 17.0724 14.8676L16.7189 8.20094C16.6485 6.87354 15.5517 5.83333 14.2224 5.83333H13.8333ZM12.1667 7.5V8.33333C12.1667 8.79357 12.5398 9.16667 13 9.16667C13.4602 9.16667 13.8333 8.79357 13.8333 8.33333V7.5H14.2224C14.6655 7.5 15.0311 7.84674 15.0546 8.2892L15.4081 14.9559C15.4334 15.4328 15.0535 15.8333 14.5759 15.8333H6.42405C5.94648 15.8333 5.5666 15.4328 5.59189 14.9559L5.94542 8.2892C5.96889 7.84674 6.3345 7.5 6.77759 7.5H7.16666V8.33333C7.16666 8.79357 7.53976 9.16667 7.99999 9.16667C8.46023 9.16667 8.83333 8.79357 8.83333 8.33333V7.5H12.1667Z" fill="#4D505A"/>\n</svg>\n';var ImportIcon='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M9.35028 11.5744C9.05738 11.2815 8.58251 11.2815 8.28962 11.5744C7.99672 11.8673 7.99672 12.3422 8.28962 12.635L11.2917 15.6372C11.6823 16.0277 12.3154 16.0277 12.7059 15.6372L15.708 12.6351C16.0009 12.3422 16.0009 11.8674 15.708 11.5745C15.4151 11.2816 14.9402 11.2816 14.6473 11.5745L12.7488 13.4729V4.68005C12.7488 4.26584 12.413 3.93005 11.9988 3.93005C11.5846 3.93005 11.2488 4.26584 11.2488 4.68005L11.2488 13.4729L9.35028 11.5744Z" fill="#4D505A"/>\n<path d="M20 14C20 13.5858 19.6642 13.25 19.25 13.25C18.8358 13.25 18.5 13.5858 18.5 14L18.5 17.25C18.5 17.9404 17.9404 18.5 17.25 18.5L6.75 18.5C6.05964 18.5 5.5 17.9404 5.5 17.25L5.5 14C5.5 13.5858 5.16421 13.25 4.75 13.25C4.33579 13.25 4 13.5858 4 14V17.25C4 18.7688 5.23122 20 6.75 20H17.25C18.7688 20 20 18.7688 20 17.25L20 14Z" fill="#4D505A"/>\n</svg>\n';var MessageIcon='<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M2.25 4.5C2.25 3.25736 3.25736 2.25 4.5 2.25H13.5C14.7426 2.25 15.75 3.25736 15.75 4.5V10.5C15.75 11.7426 14.7426 12.75 13.5 12.75H8.25C8.01393 12.75 7.79164 12.8611 7.65 13.05L6.3 14.85C5.87508 15.4166 5.2082 15.75 4.5 15.75C3.25736 15.75 2.25 14.7426 2.25 13.5V4.5ZM4.5 3.75C4.08579 3.75 3.75 4.08579 3.75 4.5V13.5C3.75 13.9142 4.08579 14.25 4.5 14.25C4.73607 14.25 4.95836 14.1389 5.1 13.95L6.45 12.15C6.87492 11.5834 7.5418 11.25 8.25 11.25H13.5C13.9142 11.25 14.25 10.9142 14.25 10.5V4.5C14.25 4.08579 13.9142 3.75 13.5 3.75H4.5ZM5.25 6C5.25 5.58579 5.58579 5.25 6 5.25H12C12.4142 5.25 12.75 5.58579 12.75 6C12.75 6.41421 12.4142 6.75 12 6.75H6C5.58579 6.75 5.25 6.41421 5.25 6ZM5.25 9C5.25 8.58579 5.58579 8.25 6 8.25H8.25C8.66421 8.25 9 8.58579 9 9C9 9.41421 8.66421 9.75 8.25 9.75H6C5.58579 9.75 5.25 9.41421 5.25 9Z" fill="#4D505A"/>\n</svg>\n';var MoneyIcon='<svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M2.16666 5.83301C2.16666 4.4523 3.28594 3.33301 4.66666 3.33301H16.3333C17.714 3.33301 18.8333 4.4523 18.8333 5.83301V14.1663C18.8333 15.5471 17.714 16.6663 16.3333 16.6663H4.66666C3.28594 16.6663 2.16666 15.5471 2.16666 14.1663V5.83301ZM4.66666 4.99967C4.20642 4.99967 3.83332 5.37277 3.83332 5.83301V14.1663C3.83332 14.6266 4.20642 14.9997 4.66666 14.9997H16.3333C16.7936 14.9997 17.1667 14.6266 17.1667 14.1663V5.83301C17.1667 5.37277 16.7936 4.99967 16.3333 4.99967H4.66666ZM6.33332 8.33301C6.79356 8.33301 7.16666 8.7061 7.16666 9.16634V10.833C7.16666 11.2932 6.79356 11.6663 6.33332 11.6663C5.87309 11.6663 5.49999 11.2932 5.49999 10.833V9.16634C5.49999 8.7061 5.87309 8.33301 6.33332 8.33301ZM8.83332 9.99967C8.83332 9.0792 9.57952 8.33301 10.5 8.33301C11.4205 8.33301 12.1667 9.0792 12.1667 9.99967C12.1667 10.9201 11.4205 11.6663 10.5 11.6663C9.57952 11.6663 8.83332 10.9201 8.83332 9.99967ZM14.6667 8.33301C15.1269 8.33301 15.5 8.7061 15.5 9.16634V10.833C15.5 11.2932 15.1269 11.6663 14.6667 11.6663C14.2064 11.6663 13.8333 11.2932 13.8333 10.833V9.16634C13.8333 8.7061 14.2064 8.33301 14.6667 8.33301Z" fill="#4D505A"/>\n</svg>\n';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 zonosHelloDialogCss=":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--hello-country-flag{height:18px;width:18px;position:relative;overflow:hidden;border-radius:30px;-webkit-box-shadow:var(--zonos-elements-v3-shadow-medium);box-shadow:var(--zonos-elements-v3-shadow-medium);z-index:10;justify-self:center}:host .zonos--hello-dialog{position:absolute;background:var(--zonos-elements-surface-color);width:100vw;max-width:430px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;max-height:600px;border-radius:var(--zonos-elements-radius-12);outline:none;-webkit-box-shadow:var(--zonos-elements-v3-shadow-xxl);box-shadow:var(--zonos-elements-v3-shadow-xxl);overflow-y:auto;top:-2px;right:-2px;opacity:0;-webkit-transition:opacity 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;transition:opacity 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;transition:opacity 0.3s ease-in-out, transform 0.3s ease-in-out;transition:opacity 0.3s ease-in-out, transform 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;-webkit-transform:scale(0);transform:scale(0);-webkit-transform-origin:top right;transform-origin:top right;z-index:1001}:host .zonos--hello-dialog .zonos--hello-dialog-header{text-align:center}:host .zonos--hello-dialog.zonos--hello-dialog-animate-from-left{-webkit-transform-origin:top left;transform-origin:top left;right:unset;left:-2px}:host .zonos--hello-dialog.zonos--hello-dialog-animate-from-bottom{-webkit-transform-origin:bottom right;transform-origin:bottom right;bottom:calc(100% - 32px);top:unset}:host .zonos--hello-dialog.zonos--hello-dialog-animate-from-bottom.zonos--hello-dialog-animate-from-left{-webkit-transform-origin:bottom left;transform-origin:bottom left}:host .zonos--hello-dialog::-webkit-scrollbar{width:12px;height:12px}:host .zonos--hello-dialog::-webkit-scrollbar-track{background:#f5f5f5;border-top-right-radius:var(--zonos-elements-radius-12);border-bottom-right-radius:var(--zonos-elements-radius-12)}:host .zonos--hello-dialog::-webkit-scrollbar-thumb{border-radius:10px;background:#ccc;border:4px solid transparent;background-clip:content-box}:host .zonos--hello-dialog::-webkit-scrollbar-thumb:hover{background:#999}:host .zonos--hello-dialog .zonos--animate-content{opacity:0;height:0;-webkit-transition:all 0.3s ease-in-out;transition:all 0.3s ease-in-out}:host .zonos--hello-dialog .zonos--show-animate-content{opacity:1;height:100%}:host .zonos--hello-dialog.zonos--hello-dialog-open{opacity:1;-webkit-transform:scale(1);transform:scale(1)}:host .zonos--hello-dialog .zonos--close-button{position:absolute;right:8px;top:8px;width:var(--zonos-elements-size-md);height:var(--zonos-elements-size-md);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;cursor:pointer;z-index:10}:host .zonos--hello-dialog .zonos--close-button:hover{background:var(--zonos-elements-hover-color);border-radius:var(--zonos-elements-radius-6)}:host .zonos--hello-dialog .zonos--hello-dialog-content{padding:16px}:host .zonos--hello-dialog .zonos--hello-dialog-content .zonos--hello-country-flag{border-radius:var(--zonos-elements-radius-4);width:32px;height:24px}:host .zonos--hello-dialog .zonos--flex-message{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:12px}:host .zonos--hello-dialog.zonos--hello-dialog-mobile-override{position:-webkit-sticky;position:sticky;top:unset;left:unset;right:unset;bottom:0;width:100vw;max-width:100vw;max-height:500px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;-webkit-transform:scaleY(0);transform:scaleY(0);border-radius:0;-webkit-transform-origin:bottom;transform-origin:bottom}@media (max-height: 600px){:host .zonos--hello-dialog.zonos--hello-dialog-mobile-override{max-height:80vh}}:host .zonos--hello-dialog.zonos--hello-dialog-mobile-override.zonos--hello-dialog-animate-from-left{-webkit-transform-origin:bottom;transform-origin:bottom}:host .zonos--hello-dialog.zonos--hello-dialog-mobile-override.zonos--hello-dialog-open{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1)}@media (max-width: 768px){:host .zonos--hello-dialog{position:-webkit-sticky;position:sticky;top:unset;left:unset;right:unset;bottom:0;width:100vw;max-width:100vw;max-height:500px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;-webkit-transform:scaleY(0);transform:scaleY(0);border-radius:0;-webkit-transform-origin:bottom;transform-origin:bottom}}@media (max-width: 768px) and (max-height: 600px){:host .zonos--hello-dialog{max-height:80vh}}@media (max-width: 768px){:host .zonos--hello-dialog.zonos--hello-dialog-animate-from-left{-webkit-transform-origin:bottom;transform-origin:bottom}}@media (max-width: 768px){:host .zonos--hello-dialog.zonos--hello-dialog-open{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1)}}";var ZonosHelloDialogStyle0=zonosHelloDialogCss;var ZonosHelloDialog=function(){function o(o){var e=this;registerInstance(this,o);this.closeDialog=createEvent(this,"closeDialog",7);this.clickOutsideDialogHandler=function(o){if(!o.composedPath().includes(e.dialogRef)&&e.isOpen){e.setIsOpen(false)}};this.getCurrentPageEnum=function(){switch(zonosStore.currentHelloPage){case"home":return"hello_homepage";case"cart":return"hello_cart";case"productList":return"hello_item_list";case"productDetail":return"hello_item_details";default:return null}};this.setShowCountrySelect=function(o){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(e){this.showCountrySelect=o;return[2]}))}))};this.setShowLanguageSelect=function(o){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(e){this.showLanguageSelect=o;return[2]}))}))};this.hasTaxId=function(){var o;return(o=localizationStore.countryLandedCost)===null||o===void 0?void 0:o.hasTaxId};this.isNoThresholdCountry=function(o){if(!o||!e.hasTaxId()){return false}return["AU"].includes(o)};this.getDutyMessage=function(){var o=localizationStore.countryLandedCost;var t=(o===null||o===void 0?void 0:o.dutyDeminimus)?currencyFormat({amount:o.dutyDeminimus}):null;return t&&!e.isNoThresholdCountry(o===null||o===void 0?void 0:o.countryCode)?translate("Spend [threshold] duty free",{threshold:t}):translate("Duties will apply to all orders")};this.getTaxMessage=function(){var o=localizationStore.countryLandedCost;var t=(o===null||o===void 0?void 0:o.vatTaxDeminimus)?currencyFormat({amount:o.vatTaxDeminimus}):null;return t&&!e.isNoThresholdCountry(o===null||o===void 0?void 0:o.countryCode)?translate("Spend [threshold] tax free",{threshold:t}):translate("Taxes will apply to all orders")};this.getUkDutyTaxMessage=function(o){if(o.allowLowValueOrders){return null}var e=o.dutyDeminimus;return[translate("Orders to [countryName] must be over [threshold] to ship.",{countryName:"United Kingdom",threshold:currencyFormat({amount:e})})]};this.getAustraliaDutyTaxMessage=function(o){return[translate("Duties & taxes in Australia, VAT or GST is [percentage] and is due on all orders",{percentage:"".concat(o.vatTaxRate*100,"%")}),"".concat(translate("The low-value GST law passed July 1st, 2018 applies to this retailer.")," ").concat(wrapStringWithLink({href:"https://zonos.com/docs/global-ecommerce/landed-cost/tax-remittance/australia-gst",text:translate("Learn more.")}))]};this.getNewZealandDutyTaxMessge=function(o){return[translate("[percentage] GST due on any order above [threshold] along with an import entry transaction fee and MPI levy.",{percentage:"".concat(o.vatTaxRate*100,"%"),threshold:currencyFormat({amount:o.vatTaxDeminimus})})]};this.getAdditionalDutyTaxMessage=function(){if(!localizationStore.countryLandedCost){return null}if(!e.hasTaxId()){return null}switch(localizationStore.countryLandedCost.countryCode){case"GB":return e.getUkDutyTaxMessage(localizationStore.countryLandedCost);case"AU":return e.getAustraliaDutyTaxMessage(localizationStore.countryLandedCost);case"NZ":return e.getNewZealandDutyTaxMessge(localizationStore.countryLandedCost);default:return null}};this.isOpen=false;this.setIsOpen=function(){};this.mobileLocationOverride=undefined;this.animateFromLeftOverride=undefined;this.appearanceSettings=undefined;this.restrictedItems=[];this.welcomeMessage="Welcome to our Demo App!";this.showCountrySelect=false;this.showLanguageSelect=false}o.prototype.globalClickHandler=function(o){this.clickOutsideDialogHandler(o)};o.prototype.isOpenHandler=function(o){if(!o){void this.setShowCountrySelect(false);void this.setShowLanguageSelect(false)}};o.prototype.render=function(){var o=this;var e;var t=localizationStore.selectedCountryCode;var n=this.getDutyMessage();var i=this.getTaxMessage();var a=this.getAdditionalDutyTaxMessage();var s=this.animateFromLeftOverride||this.dialogRef&&getHasMoreSpaceOnRight(this.dialogRef);var r=this.dialogRef&&getHasMoreSpaceAbove(this.dialogRef);var l=localizationStore.customMessages;var c=translate("Welcome to [storeName]",{storeName:zonosStore.organizationName});var d=((e=l.find((function(o){return o.pageName==="hello_default"})))===null||e===void 0?void 0:e.message)||translate("Know about duties and taxes before you buy. Shop with confidence!");var f=formatStringWithLinks(d);var u=this.getCurrentPageEnum();var g=l.filter((function(o){return o.pageName===u}));return h(Host,{key:"af2c46bcc413205d644a2b94ee2ff568d3d004f2",class:"zonos--elements"},h("div",{key:"67a563de9e702e370d057ee3cc45bc0c14feedc5","aria-hidden":"true",class:classes(["zonos--hello-dialog",s&&"zonos--hello-dialog-animate-from-left",r&&"zonos--hello-dialog-animate-from-bottom",!!this.mobileLocationOverride&&"zonos--hello-dialog-mobile-override",this.isOpen&&"zonos--hello-dialog-open"]),ref:function(e){return e&&(o.dialogRef=e)}},!this.showCountrySelect&&!this.showLanguageSelect&&h("div",{key:"412a8d2f4c01e4ff216feb92a979be5987bcd8c7"},h("div",{key:"b2921acfc77c6a402a14256a6f1c28607f6533e7",class:"zonos--hello-dialog-content"},h("zonos-button",{key:"aa623c0533a5f852dab7f0f98d6dc26f62ef899a",class:"zonos--close-button",icon:h("zonos-icon",{"aria-label":"Close Zonos Hello dialog",content:RemoveIcon}),noBackground:true,onClick:function(){return o.setIsOpen(false)}}),h("zonos-v-stack",{key:"4fdac9331a5b2506a5ca1c7c1b6bfecf822bfcd9",spacing:24},h("zonos-country-flag",{key:"57afef45e0bebe9bdfa715306f6ec2c30aca8dc1",class:"zonos--hello-country-flag",countryCode:t}),h("zonos-v-stack",{key:"954b970c82fd631efadbd9c916e8bad78f0e1321",class:"zonos--hello-dialog-header",spacing:4},h("zonos-text",{key:"cde98a9636e6150d6cab009970938a0cf61bc05a",type:"boldSubheader"},c),h("zonos-text",{key:"b63fc79317f23854737c1f2dd2cbde38f3841f2a",innerHTML:f,textColor:"gray-800"})),h("zonos-v-stack",{key:"e115a03222d2271b358c3f1ae3feb938bafcdbef",spacing:8},this.restrictedItems.map((function(o){var e;return o&&h("zonos-banner",{bannerTitle:o.name,intent:"error"},(e=o.itemRestrictions)===null||e===void 0?void 0:e.map((function(o){return h("zonos-text",{textColor:"red-800"},o===null||o===void 0?void 0:o.note)})))})),h("zonos-card",{key:"6f5ef13c8ce1171b99c148f43f491ced8f29cd57",spacing:"12px"},h("zonos-v-stack",{key:"816a373a6dcf69976279af51f09d136f18c6b4a8",spacing:12},h("div",{key:"51fc31937cb4885c7a98ee5fbc0755a00158f172",class:"zonos--flex-message"},h("zonos-icon",{key:"bc659d649b3a7f046225270870e7ae31597027f4","aria-label":"Duty de minimis",content:ImportIcon}),h("zonos-text",{key:"e63ce2eb6f381718ca26962c7429f266bf8cf8d9"},n)),h("div",{key:"6f49eac81be52709ad8f35c04cccd7d2fec03b7a",class:"zonos--flex-message"},h("zonos-icon",{key:"d95f29c3c42480c89a34e831740cfdbb3d64c058","aria-label":"Tax de minimis",content:MoneyIcon}),h("zonos-text",{key:"c226092fef030070af3af1d45debab989fb4f1b7"},i)),a===null||a===void 0?void 0:a.map((function(o){return h("div",{class:"zonos--flex-message"},h("zonos-icon",{"aria-label":"Additional information for buying goods from selected country",content:BagIcon}),h("zonos-text",{innerHTML:o}))})))),g.map((function(o){return h("zonos-custom-message",{icon:MessageIcon,message:o.message})}))))),h("zonos-hello-dialog-footer",{key:"32739e817940a937b59380197934ced91f2afc50",appearanceSettings:this.appearanceSettings,setShowCountrySelect:function(e){return o.setShowCountrySelect(e)},setShowLanguageSelect:function(e){return o.setShowLanguageSelect(e)}})),this.showCountrySelect&&h("div",{key:"be58e393680370837ae35d5d4f85f77cf9620db2"},h("zonos-country-select",{key:"bc5c7e086513a44f817e5769acf2ca382b01fcc4",handleOnClose:function(){return o.setShowCountrySelect(false)}})),this.showLanguageSelect&&h("div",{key:"7cbee089b9661602bb23e5e2821030d04891f18a"},h("zonos-language-select",{key:"55d654b2b339cfd83e3fe9814d914a382a891af3",handleOnClose:function(){return o.setShowLanguageSelect(false)}}))))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});Object.defineProperty(o,"watchers",{get:function(){return{isOpen:["isOpenHandler"]}},enumerable:false,configurable:true});return o}();ZonosHelloDialog.style=ZonosHelloDialogStyle0;export{ZonosHelloDialog as zonos_hello_dialog};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,o,t,r){function n(e){return e instanceof t?e:new t((function(o){o(e)}))}return new(t||(t=Promise))((function(t,i){function s(e){try{l(r.next(e))}catch(e){i(e)}}function a(e){try{l(r["throw"](e))}catch(e){i(e)}}function l(e){e.done?t(e.value):n(e.value).then(s,a)}l((r=r.apply(e,o||[])).next())}))};var __generator=this&&this.__generator||function(e,o){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,n,i,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(e){return function(o){return l([e,o])}}function l(a){if(r)throw new TypeError("Generator is already executing.");while(s&&(s=0,a[0]&&(t=0)),t)try{if(r=1,n&&(i=a[0]&2?n["return"]:a[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;if(n=0,i)a=[a[0]&2,i.value];switch(a[0]){case 0:case 1:i=a;break;case 4:t.label++;return{value:a[1],done:false};case 5:t.label++;n=a[1];a=[0];continue;case 7:a=t.ops.pop();t.trys.pop();continue;default:if(!(i=t.trys,i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){t=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){t.label=a[1];break}if(a[0]===6&&t.label<i[1]){t.label=i[1];i=a;break}if(i&&t.label<i[2]){t.label=i[2];t.ops.push(a);break}if(i[2])t.ops.pop();t.trys.pop();continue}a=o.call(e,t)}catch(e){a=[6,e];n=0}finally{r=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{r as registerInstance,h,H as Host}from"./index-3b46f3c3.js";import{_ as _root,e as _baseGetTag,i as isObjectLike_1,f as isObject_1,z as zonosStore,g as getZonosStoreTheme,m as mergeConfig}from"./zonosStore-ba9e541e.js";import{r as handleFetch,l as localizationStore,u as isValidSelector,t as translate,w as getZCountryUrlParam,x as setZCountryUrlParam,y as currencyDisplay,z as currencyConvertAndFormat,A as currencyConvert,B as currencyFormat}from"./cart-b96aaa4f.js";import{c as classes}from"./classes-0d95c529.js";import{a as logError,l as log}from"./logError-c456c092.js";import{g as getHasMoreSpaceOnRight}from"./getHasMoreSpaceOnRight-70eb913a.js";import"./isDarkColor-f8324c10.js";import"./getBorderRadius-947c24de.js";var root=_root;var now$1=function(){return root.Date.now()};var now_1=now$1;var reWhitespace=/\s/;function trimmedEndIndex$1(e){var o=e.length;while(o--&&reWhitespace.test(e.charAt(o))){}return o}var _trimmedEndIndex=trimmedEndIndex$1;var trimmedEndIndex=_trimmedEndIndex;var reTrimStart=/^\s+/;function baseTrim$1(e){return e?e.slice(0,trimmedEndIndex(e)+1).replace(reTrimStart,""):e}var _baseTrim=baseTrim$1;var baseGetTag=_baseGetTag,isObjectLike=isObjectLike_1;var symbolTag="[object Symbol]";function isSymbol$1(e){return typeof e=="symbol"||isObjectLike(e)&&baseGetTag(e)==symbolTag}var isSymbol_1=isSymbol$1;var baseTrim=_baseTrim,isObject$1=isObject_1,isSymbol=isSymbol_1;var NAN=0/0;var reIsBadHex=/^[-+]0x[0-9a-f]+$/i;var reIsBinary=/^0b[01]+$/i;var reIsOctal=/^0o[0-7]+$/i;var freeParseInt=parseInt;function toNumber$1(e){if(typeof e=="number"){return e}if(isSymbol(e)){return NAN}if(isObject$1(e)){var o=typeof e.valueOf=="function"?e.valueOf():e;e=isObject$1(o)?o+"":o}if(typeof e!="string"){return e===0?e:+e}e=baseTrim(e);var t=reIsBinary.test(e);return t||reIsOctal.test(e)?freeParseInt(e.slice(2),t?2:8):reIsBadHex.test(e)?NAN:+e}var toNumber_1=toNumber$1;var isObject=isObject_1,now=now_1,toNumber=toNumber_1;var FUNC_ERROR_TEXT="Expected a function";var nativeMax=Math.max,nativeMin=Math.min;function debounce(e,o,t){var r,n,i,s,a,l,d=0,h=false,u=false,c=true;if(typeof e!="function"){throw new TypeError(FUNC_ERROR_TEXT)}o=toNumber(o)||0;if(isObject(t)){h=!!t.leading;u="maxWait"in t;i=u?nativeMax(toNumber(t.maxWait)||0,o):i;c="trailing"in t?!!t.trailing:c}function f(o){var t=r,i=n;r=n=undefined;d=o;s=e.apply(i,t);return s}function m(e){d=e;a=setTimeout(z,o);return h?f(e):s}function g(e){var t=e-l,r=e-d,n=o-t;return u?nativeMin(n,i-r):n}function v(e){var t=e-l,r=e-d;return l===undefined||t>=o||t<0||u&&r>=i}function z(){var e=now();if(v(e)){return w(e)}a=setTimeout(z,g(e))}function w(e){a=undefined;if(c&&r){return f(e)}r=n=undefined;return s}function p(){if(a!==undefined){clearTimeout(a)}d=0;r=l=n=a=undefined}function b(){return a===undefined?s:w(now())}function x(){var e=now(),t=v(e);r=arguments;n=this;l=e;if(t){if(a===undefined){return m(l)}if(u){clearTimeout(a);a=setTimeout(z,o);return f(l)}}if(a===undefined){a=setTimeout(z,o)}return s}x.cancel=p;x.flush=b;return x}var debounce_1=debounce;var checkItemRestrictions=function(e){return __awaiter(void 0,[e],void 0,(function(e){var o,t,r,n,i,s;var a=e.items,l=e.shipFrom,d=e.shipTo;return __generator(this,(function(e){switch(e.label){case 0:t="".concat("https://v1.route.js.zonos.com","/api/zonos-elements/check-item-restrictions");r={items:a,shipFrom:l,shipTo:d};return[4,handleFetch(t,{body:r,method:"POST"})];case 1:n=e.sent(),i=n.errors,s=n.json;if(i.length||!s){logError("Error fetching item restrictions: ".concat((o=i.find(Boolean))===null||o===void 0?void 0:o.message));return[2,[]]}return[2,s.filter(Boolean)]}}))}))};var detectItemRestrictions=function(e){return __awaiter(void 0,void 0,void 0,(function(){var o,t,r,n;return __generator(this,(function(i){switch(i.label){case 0:if(!e.length){return[2,[]]}o=localizationStore.selectedCountryCode;if(!o){logError("Hello Could not check item restrictions - No country code selected");return[2,[]]}t=e.map((function(e){return{description:e.description,name:e.title}}));return[4,checkItemRestrictions({items:t,shipFrom:"AD",shipTo:o})];case 1:r=i.sent();n=r.map((function(e){var o;var r=((o=t.filter((function(o){return o.description===e.itemDescription})).find(Boolean))===null||o===void 0?void 0:o.name)||"";return Object.assign(Object.assign({},e),{name:r})}));return[2,n]}}))}))};var matchUrlPattern=function(e){var o=e===null||e===void 0?void 0:e.replace("www.","").replace("https://","");return o&&new RegExp(o).test(window.location.href)};var getCurrentHelloLocalePage=function(){var e=zonosStore.helloSettings,o=e.cartUrlPattern,t=e.homepageUrlPattern,r=e.productDetailUrlPattern,n=e.productListUrlPattern;if(matchUrlPattern(o)){return"cart"}if(matchUrlPattern(r)){return"productDetail"}if(matchUrlPattern(n)){return"productList"}if(matchUrlPattern(t)){return"home"}return""};var getProductsOnPage=function(){var e,o;var t=zonosStore.helloSettings,r=t.productAddToCartElementSelector,n=t.productDescriptionElementSelector,i=t.productTitleElementSelector,s=t.restrictionBehavior;if(!i||!n){logError("Hello Could not check item restrictions - must provide title and description selectors.")}var a=i&&isValidSelector(i)&&document.querySelectorAll(i)||[];var l=n&&isValidSelector(n)&&document.querySelectorAll(n)||[];if(a.length!==l.length){logError("Hello Could not check item restrictions - Title and description selectors do not match");return[]}var d=s==="RESTRICT_AND_BLOCK";var h=d&&r&&isValidSelector(r)&&document.querySelectorAll(r)||[];if(d&&h.length!==l.length){logError('Hello could not disable "Add to cart" buttons - Title and add to cart selectors do not match')}var u=[];for(var c=0;c<a.length;c++){var f=a[c];var m=l[c];var g=h[c];if(f&&m){var v={cartButtonNode:g||null,description:((e=m.textContent)===null||e===void 0?void 0:e.trim())||"",title:((o=f.textContent)===null||o===void 0?void 0:o.trim())||""};u.push(v)}}return u};var zonosHelloCss=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:inline-block}:host .zonos--hello-wrapper{position:relative}:host .zonos--hello-wrapper .zonos--hello-dialog-wrapper-mobile-override{position:fixed;bottom:0;left:0;width:100vw;z-index:1001;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}@media (max-width: 768px){:host .zonos--hello-wrapper{position:fixed;bottom:0;left:0;width:100vw;z-index:1001;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}}:host .zonos--hello-widget{-webkit-transition:all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);transition:all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);padding:6px;border-radius:30px;background:var(--zonos-elements-page-background);font-size:var(--zonos-elements-font-size-s);border:var(--zonos-elements-border);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;cursor:pointer;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;position:relative;z-index:1000}:host .zonos--hello-widget>.zonos--hello-message{-ms-flex-order:0;order:0;max-width:0;height:100%;white-space:nowrap;-webkit-transition:border 0.3s ease-in, all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);transition:border 0.3s ease-in, all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);overflow:hidden;color:var(--zonos-elements-text-color);position:absolute;background:var(--zonos-elements-page-background);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-top-left-radius:30px;border-bottom-left-radius:30px;left:0;-webkit-transform:translateX(calc(-100% + 16px));transform:translateX(calc(-100% + 16px));width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border-top:var(--zonos-elements-border);border-bottom:var(--zonos-elements-border)}:host .zonos--hello-widget.zonos--hello-has-restrictions{background:var(--zonos-elements-red-100);border:1px solid var(--zonos-elements-red-200)}:host .zonos--hello-widget.zonos--hello-has-restrictions>.zonos--hello-message{background:var(--zonos-elements-red-100);color:var(--zonos-elements-red-800);font-weight:500}:host .zonos--hello-widget.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:1px solid var(--zonos-elements-red-200)}:host .zonos--hello-widget.zonos--hello-show-peek-message{max-width:100vw;width:100%}:host .zonos--hello-widget.zonos--hello-show-peek-message>.zonos--hello-message{max-width:100vw;padding:0 6px;padding-right:16px;border:var(--zonos-elements-border)}:host .zonos--hello-widget.zonos--hello-show-peek-message:not(.zonos--hello-widget-animate-from-left){border-top-left-radius:0;border-bottom-left-radius:0}:host .zonos--hello-widget.zonos--hello-show-peek-message:not(.zonos--hello-widget-animate-from-left)>.zonos--hello-message{border-right:none}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left{border-top-right-radius:0;border-bottom-right-radius:0}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{border-left:0}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:16px;padding-right:6px;border-left:none}:host .zonos--hello-widget.zonos--hello-widget-animate-from-left>.zonos--hello-message{-ms-flex-order:1;order:1;-webkit-transform:translateX(calc(100% - 16px));transform:translateX(calc(100% - 16px));right:0;left:auto;border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:30px;border-bottom-right-radius:30px}:host .zonos--hello-widget .zonos--hello-country-flag-wrapper{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}:host .zonos--hello-widget .zonos--hello-country-flag-wrapper .zonos--hello-country-flag{height:18px;width:18px;position:relative;overflow:hidden;border-radius:30px;-webkit-box-shadow:var(--zonos-elements-v3-shadow-medium);box-shadow:var(--zonos-elements-v3-shadow-medium);z-index:10;justify-self:center}@media (max-width: 768px){:host .zonos--hello-widget .zonos--hello-country-flag-wrapper .zonos--hello-country-flag{border-radius:var(--zonos-elements-radius-4);width:24px}}@media (max-width: 768px){:host .zonos--hello-widget{position:fixed;bottom:32px;right:32px;border-radius:var(--zonos-elements-radius-4);padding:4px;border:1px solid transparent}:host .zonos--hello-widget.zonos--hello-widget-left{left:32px;right:auto}:host .zonos--hello-widget.zonos--hello-widget-top{bottom:auto;top:32px}:host .zonos--hello-widget.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:none}:host .zonos--hello-widget>.zonos--hello-message{position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-radius:30px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;top:0;bottom:0;left:0;-webkit-transform:translateX(0);transform:translateX(0);width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border:none}:host .zonos--hello-widget.zonos--hello-widget-animate-from-left>.zonos--hello-message{-webkit-transform:translateX(0);transform:translateX(0)}:host .zonos--hello-widget.zonos--hello-show-peek-message{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}:host .zonos--hello-widget.zonos--hello-show-peek-message:not(.zonos--hello-widget-animate-from-left){border-top-left-radius:var(--zonos-elements-radius-4);border-bottom-left-radius:var(--zonos-elements-radius-4)}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left{border-top-right-radius:var(--zonos-elements-radius-4);border-bottom-right-radius:var(--zonos-elements-radius-4)}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:8px;padding-right:4px}:host .zonos--hello-widget.zonos--hello-show-peek-message>.zonos--hello-message{padding:0 var(--zonos-elements-radius-4);padding-right:6px;border:none}:host .zonos--hello-widget .zonos--hello-country-flag-wrapper{border-radius:var(--zonos-elements-radius-4)}}:host .zonos--hello-mobile-override.zonos--hello-widget{position:fixed;bottom:32px;right:32px;border-radius:var(--zonos-elements-radius-4);padding:4px;border:1px solid transparent}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-left{left:32px;right:auto}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-top{bottom:auto;top:32px}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:none}:host .zonos--hello-mobile-override.zonos--hello-widget>.zonos--hello-message{position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-radius:30px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;top:0;bottom:0;left:0;-webkit-transform:translateX(0);transform:translateX(0);width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border:none}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-animate-from-left>.zonos--hello-message{-webkit-transform:translateX(0);transform:translateX(0)}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-show-peek-message{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-show-peek-message:not(.zonos--hello-widget-animate-from-left){border-top-left-radius:var(--zonos-elements-radius-4);border-bottom-left-radius:var(--zonos-elements-radius-4)}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left{border-top-right-radius:var(--zonos-elements-radius-4);border-bottom-right-radius:var(--zonos-elements-radius-4)}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:8px;padding-right:4px}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-show-peek-message>.zonos--hello-message{padding:0 var(--zonos-elements-radius-4);padding-right:6px;border:none}:host .zonos--hello-mobile-override.zonos--hello-widget .zonos--hello-country-flag-wrapper{border-radius:var(--zonos-elements-radius-4)}:host .zonos--hello-mobile-override.zonos--hello-widget .zonos--hello-country-flag{border-radius:var(--zonos-elements-radius-4);width:24px}";var ZonosHelloStyle0=zonosHelloCss;var PEEK_MESSAGE_CLOSE_DELAY_MS=3e3;var RESIZE_DEBOUNCE_DELAY_MS=500;var ZonosHello=function(){function e(e){var o=this;registerInstance(this,e);this.getHelloPeekMessage=function(e){var t=zonosStore.currentHelloPage==="productDetail"||zonosStore.currentHelloPage==="productList";if(t&&o.allRestrictedItems.length){var r=translate("click to learn more");var n=zonosStore.currentHelloPage==="productDetail"?translate("Restricted item"):translate("Restricted items found");return"".concat(n," - ").concat(r)}switch(zonosStore.currentHelloPage){case"cart":return translate("Prepay duties and taxes at checkout");case"productList":case"productDetail":return translate("See duty and tax thresholds");default:return translate("Welcome to [storeName]",{storeName:e})}};this.enableShowPeekMessage=function(){if(o.peekMessage){o.showPeekMessage=true}};this.getNewItemRestrictions=function(e){return __awaiter(o,void 0,void 0,(function(){var o,t;return __generator(this,(function(r){switch(r.label){case 0:o=zonosStore.currentHelloPage==="productDetail"||zonosStore.currentHelloPage==="productList";if(!o||zonosStore.helloSettings.restrictionBehavior==="DISABLED"){return[2,[]]}return[4,detectItemRestrictions(e)];case 1:t=r.sent();return[2,t]}}))}))};this.triggerShowPeekMessage=function(){o.peekMessage=o.getHelloPeekMessage(zonosStore.organizationName);var e=zonosStore.helloSettings,t=e.peekMessageBehavior,r=e.peekMessageDelay;var n=r*1e3;if(t==="ENABLED"){setTimeout((function(){o.enableShowPeekMessage();var e=o.allRestrictedItems.some((function(e){return o.productsOnPage.some((function(o){return o.description===e.itemDescription}))}));if(!e){setTimeout((function(){o.showPeekMessage=false}),PEEK_MESSAGE_CLOSE_DELAY_MS)}}),n)}};this.disableAddToCartButtons=function(){if(o.productsOnPage.length){o.productsOnPage.forEach((function(e){var t,r;var n=o.allRestrictedItems.some((function(o){return o.itemDescription===e.description}));if(n){(t=e.cartButtonNode)===null||t===void 0?void 0:t.setAttribute("disabled","disabled")}else{(r=e.cartButtonNode)===null||r===void 0?void 0:r.removeAttribute("disabled")}}))}};this.handleItemRestrictions=function(){return __awaiter(o,void 0,void 0,(function(){var e,o;var t,r;var n=this;return __generator(this,(function(i){switch(i.label){case 0:this.productsOnPage=getProductsOnPage();e=this.productsOnPage.filter((function(e){return!n.allFoundProducts.some((function(o){return o.title===e.title}))}));return[4,this.getNewItemRestrictions(e)];case 1:o=i.sent();(t=this.allRestrictedItems).push.apply(t,o);(r=this.allFoundProducts).push.apply(r,e);this.disableAddToCartButtons();return[2]}}))}))};this.reloadHelloData=function(){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,this.handleItemRestrictions()];case 1:e.sent();this.triggerShowPeekMessage();return[2]}}))}))};this.handleProductCountChange=debounce_1((function(){var e=zonosStore.helloSettings.productTitleElementSelector;if(e){var t=getProductsOnPage();if(o.allFoundProducts.length!==t.length&&window.location.href===o.initialUrl){if(!o.allFoundProducts.length){return}void o.reloadHelloData()}}}),1e3);this.watchProductCountChange=function(){var e=new MutationObserver(o.handleProductCountChange);e.observe(document.body,{childList:true,subtree:true})};this.watchPriceChange=function(){var e=new MutationObserver((function(){return void o.displayCurrency()}));e.observe(document.body,{attributes:true,childList:true,subtree:true})};this.updateHelloOnPageChange=function(){o.watchProductCountChange();setInterval((function(){if(window.location.href!==o.initialUrl){var e=o.initialUrl&&new URL(o.initialUrl);var t=e&&getZCountryUrlParam(e.searchParams);if(t!==localizationStore.selectedCountryCode){o.allFoundProducts=[];o.allRestrictedItems=[];o.productsOnPage=[]}o.initialUrl=window.location.href;zonosStore.currentHelloPage=getCurrentHelloLocalePage();var r=new URL(window.location.href);var n=getZCountryUrlParam(r.searchParams);if(!n){setZCountryUrlParam(localizationStore.selectedCountryCode);return}void o.reloadHelloData()}}),1e3)};this.changeShowDialog=function(e){o.showDialog=e};this.shouldAnimateLeftDesktop=function(){var e=o.helloRef&&getComputedStyle(o.helloRef).position;if(o.helloRef&&e==="relative"){var t=getHasMoreSpaceOnRight(o.helloRef);return t}};this.shouldRenderHello=function(e){if(e===void 0){e=true}if(!localizationStore.localizationLoaded){return false}var o=zonosStore.helloSettings.showForCountries;if(e){if(!localizationStore.isShippableCountry){log("Hello: not shippable country - Show for countries: ".concat(o))}}if(o==="ONLY_SHIPPABLE"){return localizationStore.isShippableCountry}if(o==="ALL"){return true}return o===null||o===void 0?void 0:o.includes(localizationStore.selectedCountryCode||"")};this.mobileLocationOverride=undefined;this.animateFromLeftOverride=undefined;this.appearanceSettingsOverride=undefined;this.showPeekMessage=false;this.zonosStoreHelloSettings=zonosStore.helloSettings;this.showDialog=false;this.peekMessage="";this.initialUrl="";this.allRestrictedItems=[];this.allFoundProducts=[];this.productsOnPage=[];this.isHelloWidgetRendered=false}e.prototype.componentWillLoad=function(){var e=this;var o=setInterval((function(){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(e){if(!this.helloRef){return[2]}if(zonosStore.loadedConfig){this.helloRef.setAttribute("data-zonos-hello-loaded","");this.updateHelloOnPageChange();this.watchPriceChange();this.handleAppearanceSettingsOverrideChange();clearInterval(o)}return[2]}))}))}),100)};e.prototype.displayCurrency=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(zonosStore.helloSettings.currencyBehavior==="DISABLED"){return[2]}if(!localizationStore.exchangeRate){log("Could not display currency. Exchange rate and format data is not available.","warn");return[2]}currencyDisplay();return[2]}))}))};e.prototype.convertAndFormat=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){return[2,currencyConvertAndFormat(e)]}))}))};e.prototype.convert=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){return[2,currencyConvert(e)]}))}))};e.prototype.format=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){return[2,currencyFormat({amount:e})]}))}))};e.prototype.openHelloDialog=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){this.changeShowDialog(e);return[2]}))}))};e.prototype.handleResize=function(){debounce_1(this.render.bind(this),RESIZE_DEBOUNCE_DELAY_MS)};e.prototype.handleHelloWidgetInitializedState=function(e){var o=e.countryCode,t=e.currencyCode;var r,n;if(this.isHelloWidgetRendered){return}if(localizationStore.selectedCountryCode&&typeof zonosStore.helloSettings.onInitSuccess==="function"){this.isHelloWidgetRendered=true;void((n=(r=zonosStore.helloSettings).onInitSuccess)===null||n===void 0?void 0:n.call(r,{countryCode:o,currencyCode:t}))}};e.prototype.handleAppearanceSettingsOverrideChange=function(){var e;if((e=this.appearanceSettingsOverride)===null||e===void 0?void 0:e.theme){this.appearanceSettingsOverride.theme=getZonosStoreTheme(this.appearanceSettingsOverride.theme)}};e.prototype.render=function(){var e=this;var o,t;var r=(o=zonosStore.helloSettings.excludedUrlPatterns)===null||o===void 0?void 0:o.some((function(e){return new RegExp(e).test(window.location.href)}));if(r){log("Hello is excluded on this url","warn");return null}var n=localizationStore.selectedCountryCode,i=localizationStore.targetCurrency;var s=this.mobileLocationOverride||zonosStore.helloSettings.mobileLocation;var a=window.innerWidth<768;var l=this.animateFromLeftOverride||a&&s.includes("LEFT")||this.shouldAnimateLeftDesktop()||false;var d=s.includes("TOP");var u=mergeConfig(zonosStore.appearance,this.appearanceSettingsOverride);var c=u.theme;var f=(t=this.allRestrictedItems)===null||t===void 0?void 0:t.filter((function(o){return e.productsOnPage.some((function(e){return e.description===o.itemDescription}))}));this.peekMessage=this.getHelloPeekMessage(zonosStore.organizationName);var m=this.shouldRenderHello()&&!!n;if(m&&!this.isHelloWidgetRendered){this.handleHelloWidgetInitializedState({countryCode:n,currencyCode:i})}return h(Host,{class:"zonos--hello zonos--elements","data-theme":c},m&&h("div",{class:"zonos--hello-wrapper"},h("button",{class:classes(["zonos--hello-widget",this.showPeekMessage&&"zonos--hello-show-peek-message",this.mobileLocationOverride&&"zonos--hello-mobile-override",l&&"zonos--hello-widget-left zonos--hello-widget-animate-from-left",d&&"zonos--hello-widget-top",!!this.allRestrictedItems.length&&"zonos--hello-has-restrictions"]),onClick:function(){void e.changeShowDialog(!e.showDialog)},onMouseEnter:function(){return e.enableShowPeekMessage()},onMouseLeave:function(){return e.showPeekMessage=false},ref:function(o){return o&&(e.helloRef=o)}},h("zonos-text",{class:"zonos--hello-message"},this.peekMessage),n&&h("div",{class:"zonos--hello-country-flag-wrapper"},h("zonos-country-flag",{class:"zonos--hello-country-flag",countryCode:n}))),h("div",{class:classes(["zonos--hello-dialog-wrapper",this.mobileLocationOverride&&"zonos--hello-dialog-wrapper-mobile-override"]),style:{height:this.showDialog?"fit-content":"0px"}},h("zonos-hello-dialog",{animateFromLeftOverride:this.animateFromLeftOverride,appearanceSettings:u,isOpen:this.showDialog,mobileLocationOverride:this.mobileLocationOverride,restrictedItems:f,setIsOpen:this.changeShowDialog}))))};Object.defineProperty(e,"watchers",{get:function(){return{appearanceSettingsOverride:["handleAppearanceSettingsOverrideChange"]}},enumerable:false,configurable:true});return e}();ZonosHello.style=ZonosHelloStyle0;export{ZonosHello as zonos_hello};
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,o,t,r){function n(e){return e instanceof t?e:new t((function(o){o(e)}))}return new(t||(t=Promise))((function(t,i){function s(e){try{l(r.next(e))}catch(e){i(e)}}function a(e){try{l(r["throw"](e))}catch(e){i(e)}}function l(e){e.done?t(e.value):n(e.value).then(s,a)}l((r=r.apply(e,o||[])).next())}))};var __generator=this&&this.__generator||function(e,o){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,n,i,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(e){return function(o){return l([e,o])}}function l(a){if(r)throw new TypeError("Generator is already executing.");while(s&&(s=0,a[0]&&(t=0)),t)try{if(r=1,n&&(i=a[0]&2?n["return"]:a[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;if(n=0,i)a=[a[0]&2,i.value];switch(a[0]){case 0:case 1:i=a;break;case 4:t.label++;return{value:a[1],done:false};case 5:t.label++;n=a[1];a=[0];continue;case 7:a=t.ops.pop();t.trys.pop();continue;default:if(!(i=t.trys,i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){t=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){t.label=a[1];break}if(a[0]===6&&t.label<i[1]){t.label=i[1];i=a;break}if(i&&t.label<i[2]){t.label=i[2];t.ops.push(a);break}if(i[2])t.ops.pop();t.trys.pop();continue}a=o.call(e,t)}catch(e){a=[6,e];n=0}finally{r=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{r as registerInstance,h,H as Host}from"./index-3b46f3c3.js";import{_ as _root,e as _baseGetTag,i as isObjectLike_1,f as isObject_1,z as zonosStore,g as getZonosStoreTheme,m as mergeConfig}from"./zonosStore-ba9e541e.js";import{r as handleFetch,l as localizationStore,u as isValidSelector,t as translate,w as getZCountryUrlParam,x as setZCountryUrlParam,y as currencyDisplay,z as currencyConvertAndFormat,A as currencyConvert,B as currencyFormat}from"./cart-a90aa9ae.js";import{c as classes}from"./classes-0d95c529.js";import{a as logError,l as log}from"./logError-c456c092.js";import{g as getHasMoreSpaceOnRight}from"./getHasMoreSpaceOnRight-70eb913a.js";import"./isDarkColor-f8324c10.js";import"./getBorderRadius-947c24de.js";var root=_root;var now$1=function(){return root.Date.now()};var now_1=now$1;var reWhitespace=/\s/;function trimmedEndIndex$1(e){var o=e.length;while(o--&&reWhitespace.test(e.charAt(o))){}return o}var _trimmedEndIndex=trimmedEndIndex$1;var trimmedEndIndex=_trimmedEndIndex;var reTrimStart=/^\s+/;function baseTrim$1(e){return e?e.slice(0,trimmedEndIndex(e)+1).replace(reTrimStart,""):e}var _baseTrim=baseTrim$1;var baseGetTag=_baseGetTag,isObjectLike=isObjectLike_1;var symbolTag="[object Symbol]";function isSymbol$1(e){return typeof e=="symbol"||isObjectLike(e)&&baseGetTag(e)==symbolTag}var isSymbol_1=isSymbol$1;var baseTrim=_baseTrim,isObject$1=isObject_1,isSymbol=isSymbol_1;var NAN=0/0;var reIsBadHex=/^[-+]0x[0-9a-f]+$/i;var reIsBinary=/^0b[01]+$/i;var reIsOctal=/^0o[0-7]+$/i;var freeParseInt=parseInt;function toNumber$1(e){if(typeof e=="number"){return e}if(isSymbol(e)){return NAN}if(isObject$1(e)){var o=typeof e.valueOf=="function"?e.valueOf():e;e=isObject$1(o)?o+"":o}if(typeof e!="string"){return e===0?e:+e}e=baseTrim(e);var t=reIsBinary.test(e);return t||reIsOctal.test(e)?freeParseInt(e.slice(2),t?2:8):reIsBadHex.test(e)?NAN:+e}var toNumber_1=toNumber$1;var isObject=isObject_1,now=now_1,toNumber=toNumber_1;var FUNC_ERROR_TEXT="Expected a function";var nativeMax=Math.max,nativeMin=Math.min;function debounce(e,o,t){var r,n,i,s,a,l,d=0,h=false,u=false,c=true;if(typeof e!="function"){throw new TypeError(FUNC_ERROR_TEXT)}o=toNumber(o)||0;if(isObject(t)){h=!!t.leading;u="maxWait"in t;i=u?nativeMax(toNumber(t.maxWait)||0,o):i;c="trailing"in t?!!t.trailing:c}function f(o){var t=r,i=n;r=n=undefined;d=o;s=e.apply(i,t);return s}function m(e){d=e;a=setTimeout(z,o);return h?f(e):s}function g(e){var t=e-l,r=e-d,n=o-t;return u?nativeMin(n,i-r):n}function v(e){var t=e-l,r=e-d;return l===undefined||t>=o||t<0||u&&r>=i}function z(){var e=now();if(v(e)){return w(e)}a=setTimeout(z,g(e))}function w(e){a=undefined;if(c&&r){return f(e)}r=n=undefined;return s}function p(){if(a!==undefined){clearTimeout(a)}d=0;r=l=n=a=undefined}function b(){return a===undefined?s:w(now())}function x(){var e=now(),t=v(e);r=arguments;n=this;l=e;if(t){if(a===undefined){return m(l)}if(u){clearTimeout(a);a=setTimeout(z,o);return f(l)}}if(a===undefined){a=setTimeout(z,o)}return s}x.cancel=p;x.flush=b;return x}var debounce_1=debounce;var checkItemRestrictions=function(e){return __awaiter(void 0,[e],void 0,(function(e){var o,t,r,n,i,s;var a=e.items,l=e.shipFrom,d=e.shipTo;return __generator(this,(function(e){switch(e.label){case 0:t="".concat("https://v1.route.js.zonos.com","/api/zonos-elements/check-item-restrictions");r={items:a,shipFrom:l,shipTo:d};return[4,handleFetch(t,{body:r,method:"POST"})];case 1:n=e.sent(),i=n.errors,s=n.json;if(i.length||!s){logError("Error fetching item restrictions: ".concat((o=i.find(Boolean))===null||o===void 0?void 0:o.message));return[2,[]]}return[2,s.filter(Boolean)]}}))}))};var detectItemRestrictions=function(e){return __awaiter(void 0,void 0,void 0,(function(){var o,t,r,n;return __generator(this,(function(i){switch(i.label){case 0:if(!e.length){return[2,[]]}o=localizationStore.selectedCountryCode;if(!o){logError("Hello Could not check item restrictions - No country code selected");return[2,[]]}t=e.map((function(e){return{description:e.description,name:e.title}}));return[4,checkItemRestrictions({items:t,shipFrom:"AD",shipTo:o})];case 1:r=i.sent();n=r.map((function(e){var o;var r=((o=t.filter((function(o){return o.description===e.itemDescription})).find(Boolean))===null||o===void 0?void 0:o.name)||"";return Object.assign(Object.assign({},e),{name:r})}));return[2,n]}}))}))};var matchUrlPattern=function(e){var o=e===null||e===void 0?void 0:e.replace("www.","").replace("https://","");return o&&new RegExp(o).test(window.location.href)};var getCurrentHelloLocalePage=function(){var e=zonosStore.helloSettings,o=e.cartUrlPattern,t=e.homepageUrlPattern,r=e.productDetailUrlPattern,n=e.productListUrlPattern;if(matchUrlPattern(o)){return"cart"}if(matchUrlPattern(r)){return"productDetail"}if(matchUrlPattern(n)){return"productList"}if(matchUrlPattern(t)){return"home"}return""};var getProductsOnPage=function(){var e,o;var t=zonosStore.helloSettings,r=t.productAddToCartElementSelector,n=t.productDescriptionElementSelector,i=t.productTitleElementSelector,s=t.restrictionBehavior;if(!i||!n){logError("Hello Could not check item restrictions - must provide title and description selectors.")}var a=i&&isValidSelector(i)&&document.querySelectorAll(i)||[];var l=n&&isValidSelector(n)&&document.querySelectorAll(n)||[];if(a.length!==l.length){logError("Hello Could not check item restrictions - Title and description selectors do not match");return[]}var d=s==="RESTRICT_AND_BLOCK";var h=d&&r&&isValidSelector(r)&&document.querySelectorAll(r)||[];if(d&&h.length!==l.length){logError('Hello could not disable "Add to cart" buttons - Title and add to cart selectors do not match')}var u=[];for(var c=0;c<a.length;c++){var f=a[c];var m=l[c];var g=h[c];if(f&&m){var v={cartButtonNode:g||null,description:((e=m.textContent)===null||e===void 0?void 0:e.trim())||"",title:((o=f.textContent)===null||o===void 0?void 0:o.trim())||""};u.push(v)}}return u};var zonosHelloCss=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:inline-block}:host .zonos--hello-wrapper{position:relative}:host .zonos--hello-wrapper .zonos--hello-dialog-wrapper-mobile-override{position:fixed;bottom:0;left:0;width:100vw;z-index:1001;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}@media (max-width: 768px){:host .zonos--hello-wrapper{position:fixed;bottom:0;left:0;width:100vw;z-index:1001;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}}:host .zonos--hello-widget{-webkit-transition:all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);transition:all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);padding:6px;border-radius:30px;background:var(--zonos-elements-page-background);font-size:var(--zonos-elements-font-size-s);border:var(--zonos-elements-border);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;cursor:pointer;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;position:relative;z-index:1000}:host .zonos--hello-widget>.zonos--hello-message{-ms-flex-order:0;order:0;max-width:0;height:100%;white-space:nowrap;-webkit-transition:border 0.3s ease-in, all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);transition:border 0.3s ease-in, all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);overflow:hidden;color:var(--zonos-elements-text-color);position:absolute;background:var(--zonos-elements-page-background);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-top-left-radius:30px;border-bottom-left-radius:30px;left:0;-webkit-transform:translateX(calc(-100% + 16px));transform:translateX(calc(-100% + 16px));width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border-top:var(--zonos-elements-border);border-bottom:var(--zonos-elements-border)}:host .zonos--hello-widget.zonos--hello-has-restrictions{background:var(--zonos-elements-red-100);border:1px solid var(--zonos-elements-red-200)}:host .zonos--hello-widget.zonos--hello-has-restrictions>.zonos--hello-message{background:var(--zonos-elements-red-100);color:var(--zonos-elements-red-800);font-weight:500}:host .zonos--hello-widget.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:1px solid var(--zonos-elements-red-200)}:host .zonos--hello-widget.zonos--hello-show-peek-message{max-width:100vw;width:100%}:host .zonos--hello-widget.zonos--hello-show-peek-message>.zonos--hello-message{max-width:100vw;padding:0 6px;padding-right:16px;border:var(--zonos-elements-border)}:host .zonos--hello-widget.zonos--hello-show-peek-message:not(.zonos--hello-widget-animate-from-left){border-top-left-radius:0;border-bottom-left-radius:0}:host .zonos--hello-widget.zonos--hello-show-peek-message:not(.zonos--hello-widget-animate-from-left)>.zonos--hello-message{border-right:none}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left{border-top-right-radius:0;border-bottom-right-radius:0}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{border-left:0}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:16px;padding-right:6px;border-left:none}:host .zonos--hello-widget.zonos--hello-widget-animate-from-left>.zonos--hello-message{-ms-flex-order:1;order:1;-webkit-transform:translateX(calc(100% - 16px));transform:translateX(calc(100% - 16px));right:0;left:auto;border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:30px;border-bottom-right-radius:30px}:host .zonos--hello-widget .zonos--hello-country-flag-wrapper{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}:host .zonos--hello-widget .zonos--hello-country-flag-wrapper .zonos--hello-country-flag{height:18px;width:18px;position:relative;overflow:hidden;border-radius:30px;-webkit-box-shadow:var(--zonos-elements-v3-shadow-medium);box-shadow:var(--zonos-elements-v3-shadow-medium);z-index:10;justify-self:center}@media (max-width: 768px){:host .zonos--hello-widget .zonos--hello-country-flag-wrapper .zonos--hello-country-flag{border-radius:var(--zonos-elements-radius-4);width:24px}}@media (max-width: 768px){:host .zonos--hello-widget{position:fixed;bottom:32px;right:32px;border-radius:var(--zonos-elements-radius-4);padding:4px;border:1px solid transparent}:host .zonos--hello-widget.zonos--hello-widget-left{left:32px;right:auto}:host .zonos--hello-widget.zonos--hello-widget-top{bottom:auto;top:32px}:host .zonos--hello-widget.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:none}:host .zonos--hello-widget>.zonos--hello-message{position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-radius:30px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;top:0;bottom:0;left:0;-webkit-transform:translateX(0);transform:translateX(0);width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border:none}:host .zonos--hello-widget.zonos--hello-widget-animate-from-left>.zonos--hello-message{-webkit-transform:translateX(0);transform:translateX(0)}:host .zonos--hello-widget.zonos--hello-show-peek-message{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}:host .zonos--hello-widget.zonos--hello-show-peek-message:not(.zonos--hello-widget-animate-from-left){border-top-left-radius:var(--zonos-elements-radius-4);border-bottom-left-radius:var(--zonos-elements-radius-4)}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left{border-top-right-radius:var(--zonos-elements-radius-4);border-bottom-right-radius:var(--zonos-elements-radius-4)}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:8px;padding-right:4px}:host .zonos--hello-widget.zonos--hello-show-peek-message>.zonos--hello-message{padding:0 var(--zonos-elements-radius-4);padding-right:6px;border:none}:host .zonos--hello-widget .zonos--hello-country-flag-wrapper{border-radius:var(--zonos-elements-radius-4)}}:host .zonos--hello-mobile-override.zonos--hello-widget{position:fixed;bottom:32px;right:32px;border-radius:var(--zonos-elements-radius-4);padding:4px;border:1px solid transparent}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-left{left:32px;right:auto}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-top{bottom:auto;top:32px}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:none}:host .zonos--hello-mobile-override.zonos--hello-widget>.zonos--hello-message{position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-radius:30px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;top:0;bottom:0;left:0;-webkit-transform:translateX(0);transform:translateX(0);width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border:none}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-animate-from-left>.zonos--hello-message{-webkit-transform:translateX(0);transform:translateX(0)}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-show-peek-message{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-show-peek-message:not(.zonos--hello-widget-animate-from-left){border-top-left-radius:var(--zonos-elements-radius-4);border-bottom-left-radius:var(--zonos-elements-radius-4)}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left{border-top-right-radius:var(--zonos-elements-radius-4);border-bottom-right-radius:var(--zonos-elements-radius-4)}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:8px;padding-right:4px}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-show-peek-message>.zonos--hello-message{padding:0 var(--zonos-elements-radius-4);padding-right:6px;border:none}:host .zonos--hello-mobile-override.zonos--hello-widget .zonos--hello-country-flag-wrapper{border-radius:var(--zonos-elements-radius-4)}:host .zonos--hello-mobile-override.zonos--hello-widget .zonos--hello-country-flag{border-radius:var(--zonos-elements-radius-4);width:24px}";var ZonosHelloStyle0=zonosHelloCss;var PEEK_MESSAGE_CLOSE_DELAY_MS=3e3;var RESIZE_DEBOUNCE_DELAY_MS=500;var ZonosHello=function(){function e(e){var o=this;registerInstance(this,e);this.getHelloPeekMessage=function(e){var t=zonosStore.currentHelloPage==="productDetail"||zonosStore.currentHelloPage==="productList";if(t&&o.allRestrictedItems.length){var r=translate("click to learn more");var n=zonosStore.currentHelloPage==="productDetail"?translate("Restricted item"):translate("Restricted items found");return"".concat(n," - ").concat(r)}switch(zonosStore.currentHelloPage){case"cart":return translate("Prepay duties and taxes at checkout");case"productList":case"productDetail":return translate("See duty and tax thresholds");default:return translate("Welcome to [storeName]",{storeName:e})}};this.enableShowPeekMessage=function(){if(o.peekMessage){o.showPeekMessage=true}};this.getNewItemRestrictions=function(e){return __awaiter(o,void 0,void 0,(function(){var o,t;return __generator(this,(function(r){switch(r.label){case 0:o=zonosStore.currentHelloPage==="productDetail"||zonosStore.currentHelloPage==="productList";if(!o||zonosStore.helloSettings.restrictionBehavior==="DISABLED"){return[2,[]]}return[4,detectItemRestrictions(e)];case 1:t=r.sent();return[2,t]}}))}))};this.triggerShowPeekMessage=function(){o.peekMessage=o.getHelloPeekMessage(zonosStore.organizationName);var e=zonosStore.helloSettings,t=e.peekMessageBehavior,r=e.peekMessageDelay;var n=r*1e3;if(t==="ENABLED"){setTimeout((function(){o.enableShowPeekMessage();var e=o.allRestrictedItems.some((function(e){return o.productsOnPage.some((function(o){return o.description===e.itemDescription}))}));if(!e){setTimeout((function(){o.showPeekMessage=false}),PEEK_MESSAGE_CLOSE_DELAY_MS)}}),n)}};this.disableAddToCartButtons=function(){if(o.productsOnPage.length){o.productsOnPage.forEach((function(e){var t,r;var n=o.allRestrictedItems.some((function(o){return o.itemDescription===e.description}));if(n){(t=e.cartButtonNode)===null||t===void 0?void 0:t.setAttribute("disabled","disabled")}else{(r=e.cartButtonNode)===null||r===void 0?void 0:r.removeAttribute("disabled")}}))}};this.handleItemRestrictions=function(){return __awaiter(o,void 0,void 0,(function(){var e,o;var t,r;var n=this;return __generator(this,(function(i){switch(i.label){case 0:this.productsOnPage=getProductsOnPage();e=this.productsOnPage.filter((function(e){return!n.allFoundProducts.some((function(o){return o.title===e.title}))}));return[4,this.getNewItemRestrictions(e)];case 1:o=i.sent();(t=this.allRestrictedItems).push.apply(t,o);(r=this.allFoundProducts).push.apply(r,e);this.disableAddToCartButtons();return[2]}}))}))};this.reloadHelloData=function(){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,this.handleItemRestrictions()];case 1:e.sent();this.triggerShowPeekMessage();return[2]}}))}))};this.handleProductCountChange=debounce_1((function(){var e=zonosStore.helloSettings.productTitleElementSelector;if(e){var t=getProductsOnPage();if(o.allFoundProducts.length!==t.length&&window.location.href===o.initialUrl){if(!o.allFoundProducts.length){return}void o.reloadHelloData()}}}),1e3);this.watchProductCountChange=function(){var e=new MutationObserver(o.handleProductCountChange);e.observe(document.body,{childList:true,subtree:true})};this.watchPriceChange=function(){var e=new MutationObserver((function(){return void o.displayCurrency()}));e.observe(document.body,{attributes:true,childList:true,subtree:true})};this.updateHelloOnPageChange=function(){o.watchProductCountChange();setInterval((function(){if(window.location.href!==o.initialUrl){var e=o.initialUrl&&new URL(o.initialUrl);var t=e&&getZCountryUrlParam(e.searchParams);if(t!==localizationStore.selectedCountryCode){o.allFoundProducts=[];o.allRestrictedItems=[];o.productsOnPage=[]}o.initialUrl=window.location.href;zonosStore.currentHelloPage=getCurrentHelloLocalePage();var r=new URL(window.location.href);var n=getZCountryUrlParam(r.searchParams);if(!n){setZCountryUrlParam(localizationStore.selectedCountryCode);return}void o.reloadHelloData()}}),1e3)};this.changeShowDialog=function(e){o.showDialog=e};this.shouldAnimateLeftDesktop=function(){var e=o.helloRef&&getComputedStyle(o.helloRef).position;if(o.helloRef&&e==="relative"){var t=getHasMoreSpaceOnRight(o.helloRef);return t}};this.shouldRenderHello=function(e){if(e===void 0){e=true}if(!localizationStore.localizationLoaded){return false}var o=zonosStore.helloSettings.showForCountries;if(e){if(!localizationStore.isShippableCountry){log("Hello: not shippable country - Show for countries: ".concat(o))}}if(o==="ONLY_SHIPPABLE"){return localizationStore.isShippableCountry}if(o==="ALL"){return true}return o===null||o===void 0?void 0:o.includes(localizationStore.selectedCountryCode||"")};this.mobileLocationOverride=undefined;this.animateFromLeftOverride=undefined;this.appearanceSettingsOverride=undefined;this.showPeekMessage=false;this.zonosStoreHelloSettings=zonosStore.helloSettings;this.showDialog=false;this.peekMessage="";this.initialUrl="";this.allRestrictedItems=[];this.allFoundProducts=[];this.productsOnPage=[];this.isHelloWidgetRendered=false}e.prototype.componentWillLoad=function(){var e=this;var o=setInterval((function(){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(e){if(!this.helloRef){return[2]}if(zonosStore.loadedConfig){this.helloRef.setAttribute("data-zonos-hello-loaded","");this.updateHelloOnPageChange();this.watchPriceChange();this.handleAppearanceSettingsOverrideChange();clearInterval(o)}return[2]}))}))}),100)};e.prototype.displayCurrency=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(zonosStore.helloSettings.currencyBehavior==="DISABLED"){return[2]}if(!localizationStore.exchangeRate){log("Could not display currency. Exchange rate and format data is not available.","warn");return[2]}currencyDisplay();return[2]}))}))};e.prototype.convertAndFormat=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){return[2,currencyConvertAndFormat(e)]}))}))};e.prototype.convert=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){return[2,currencyConvert(e)]}))}))};e.prototype.format=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){return[2,currencyFormat({amount:e})]}))}))};e.prototype.openHelloDialog=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){this.changeShowDialog(e);return[2]}))}))};e.prototype.handleResize=function(){debounce_1(this.render.bind(this),RESIZE_DEBOUNCE_DELAY_MS)};e.prototype.handleHelloWidgetInitializedState=function(e){var o=e.countryCode,t=e.currencyCode;var r,n;if(this.isHelloWidgetRendered){return}if(localizationStore.selectedCountryCode&&typeof zonosStore.helloSettings.onInitSuccess==="function"){this.isHelloWidgetRendered=true;void((n=(r=zonosStore.helloSettings).onInitSuccess)===null||n===void 0?void 0:n.call(r,{countryCode:o,currencyCode:t}))}};e.prototype.handleAppearanceSettingsOverrideChange=function(){var e;if((e=this.appearanceSettingsOverride)===null||e===void 0?void 0:e.theme){this.appearanceSettingsOverride.theme=getZonosStoreTheme(this.appearanceSettingsOverride.theme)}};e.prototype.render=function(){var e=this;var o,t;var r=(o=zonosStore.helloSettings.excludedUrlPatterns)===null||o===void 0?void 0:o.some((function(e){return new RegExp(e).test(window.location.href)}));if(r){log("Hello is excluded on this url","warn");return null}var n=localizationStore.selectedCountryCode,i=localizationStore.targetCurrency;var s=this.mobileLocationOverride||zonosStore.helloSettings.mobileLocation;var a=window.innerWidth<768;var l=this.animateFromLeftOverride||a&&s.includes("LEFT")||this.shouldAnimateLeftDesktop()||false;var d=s.includes("TOP");var u=mergeConfig(zonosStore.appearance,this.appearanceSettingsOverride);var c=u.theme;var f=(t=this.allRestrictedItems)===null||t===void 0?void 0:t.filter((function(o){return e.productsOnPage.some((function(e){return e.description===o.itemDescription}))}));this.peekMessage=this.getHelloPeekMessage(zonosStore.organizationName);var m=this.shouldRenderHello()&&!!n;if(m&&!this.isHelloWidgetRendered){this.handleHelloWidgetInitializedState({countryCode:n,currencyCode:i})}return h(Host,{class:"zonos--hello zonos--elements","data-theme":c},m&&h("div",{class:"zonos--hello-wrapper"},h("button",{class:classes(["zonos--hello-widget",this.showPeekMessage&&"zonos--hello-show-peek-message",this.mobileLocationOverride&&"zonos--hello-mobile-override",l&&"zonos--hello-widget-left zonos--hello-widget-animate-from-left",d&&"zonos--hello-widget-top",!!this.allRestrictedItems.length&&"zonos--hello-has-restrictions"]),onClick:function(){void e.changeShowDialog(!e.showDialog)},onMouseEnter:function(){return e.enableShowPeekMessage()},onMouseLeave:function(){return e.showPeekMessage=false},ref:function(o){return o&&(e.helloRef=o)}},h("zonos-text",{class:"zonos--hello-message"},this.peekMessage),n&&h("div",{class:"zonos--hello-country-flag-wrapper"},h("zonos-country-flag",{class:"zonos--hello-country-flag",countryCode:n}))),h("div",{class:classes(["zonos--hello-dialog-wrapper",this.mobileLocationOverride&&"zonos--hello-dialog-wrapper-mobile-override"]),style:{height:this.showDialog?"fit-content":"0px"}},h("zonos-hello-dialog",{animateFromLeftOverride:this.animateFromLeftOverride,appearanceSettings:u,isOpen:this.showDialog,mobileLocationOverride:this.mobileLocationOverride,restrictedItems:f,setIsOpen:this.changeShowDialog}))))};Object.defineProperty(e,"watchers",{get:function(){return{appearanceSettingsOverride:["handleAppearanceSettingsOverrideChange"]}},enumerable:false,configurable:true});return e}();ZonosHello.style=ZonosHelloStyle0;export{ZonosHello as zonos_hello};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as registerInstance,c as createEvent,h,H as Host,d as getElement}from"./index-3b46f3c3.js";import{d as zonosStoreFontFamily}from"./zonosStore-ba9e541e.js";import{c as classes}from"./classes-0d95c529.js";import{g as getBorderRadius}from"./getBorderRadius-947c24de.js";var zonosInputCss=':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{margin:1px;}:host .zonos--label-wrapper{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;height:100%;width:100%;background:var(--zonos-elements-input-background);border-radius:var(--border-radius);border:var(--zonos-elements-border)}:host .zonos--label-wrapper:hover{border:1px solid var(--zonos-elements-gray-300)}:host .zonos--floated-input{-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;padding:0 16px;outline:none;-webkit-transition:var(--zonos-elements-transition);transition:var(--zonos-elements-transition);width:100%;border-radius:var(--border-radius);background:var(--zonos-elements-input-background);border:0;-ms-flex-order:2;order:2;font-weight:500}:host .zonos--floated-input :-internal-autofill-selected{border-radius:var(--zonos-elements-radius-6) 0 0 var(--zonos-elements-radius-6)}:host .zonos--floated-input :-internal-autofill-selected+label+div{background-color:#e8f0fe}:host .zonos--floated-input.has-label{padding:16px 4px 8px 16px}:host .zonos--floated-input.has-label.has-input-prefix{padding-left:0}:host .zonos--floated-input.has-label.has-input-prefix+.zonos--floated-label::before{margin-left:0}:host .zonos--floated-input:not(.has-label)::-webkit-input-placeholder{opacity:var(--zonos-elements-opacity-disabled)}:host .zonos--floated-input:not(.has-label)::-moz-placeholder{opacity:var(--zonos-elements-opacity-disabled)}:host .zonos--floated-input:not(.has-label):-ms-input-placeholder{opacity:var(--zonos-elements-opacity-disabled)}:host .zonos--floated-input:not(.has-label)::-ms-input-placeholder{opacity:var(--zonos-elements-opacity-disabled)}:host .zonos--floated-input:not(.has-label)::placeholder{opacity:var(--zonos-elements-opacity-disabled)}:host .zonos--floated-input::-webkit-input-placeholder{-webkit-transition:var(--zonos-elements-transition);transition:var(--zonos-elements-transition);opacity:0}:host .zonos--floated-input::-moz-placeholder{-moz-transition:var(--zonos-elements-transition);transition:var(--zonos-elements-transition);opacity:0}:host .zonos--floated-input:-ms-input-placeholder{-ms-transition:var(--zonos-elements-transition);transition:var(--zonos-elements-transition);opacity:0}:host .zonos--floated-input::-ms-input-placeholder{-ms-transition:var(--zonos-elements-transition);transition:var(--zonos-elements-transition);opacity:0}:host .zonos--floated-input::placeholder{-webkit-transition:var(--zonos-elements-transition);transition:var(--zonos-elements-transition);opacity:0}:host .zonos--floated-input:focus{outline:none}:host .zonos--floated-input:focus+.zonos--floated-label::after{-webkit-box-shadow:var(--zonos-elements-glow-blue);box-shadow:var(--zonos-elements-glow-blue)}:host .zonos--floated-input.has-error+.zonos--floated-label::after{-webkit-box-shadow:var(--zonos-elements-glow-error);box-shadow:var(--zonos-elements-glow-error)}:host .zonos--floated-input.has-content::-webkit-input-placeholder,:host .zonos--floated-input:focus::-webkit-input-placeholder{opacity:var(--zonos-elements-opacity-disabled)}:host .zonos--floated-input.has-content::-moz-placeholder,:host .zonos--floated-input:focus::-moz-placeholder{opacity:var(--zonos-elements-opacity-disabled)}:host .zonos--floated-input.has-content:-ms-input-placeholder,:host .zonos--floated-input:focus:-ms-input-placeholder{opacity:var(--zonos-elements-opacity-disabled)}:host .zonos--floated-input.has-content::-ms-input-placeholder,:host .zonos--floated-input:focus::-ms-input-placeholder{opacity:var(--zonos-elements-opacity-disabled)}:host .zonos--floated-input.has-content::placeholder,:host .zonos--floated-input:focus::placeholder{opacity:var(--zonos-elements-opacity-disabled)}:host .zonos--floated-input.has-content+.zonos--floated-label::before,:host .zonos--floated-input:focus+.zonos--floated-label::before{top:11px;-webkit-transform:scale(0.8);transform:scale(0.8)}:host .zonos--floated-input:-webkit-autofill,:host .zonos--floated-input:-moz-autofill{background-color:var(--zonos-elements-input-background);color:var(--zonos-elements-text-color)}:host .zonos--floated-label{display:block;max-height:0;pointer-events:none;-ms-flex-order:1;order:1}:host .zonos--floated-label::before{content:attr(data-label);color:var(--zonos-elements-gray-800);position:absolute;font-size:var(--zonos-elements-font-size-base);line-height:var(--zonos-elements-font-size-base);display:inline-block;-webkit-filter:blur(0);filter:blur(0);-webkit-transform-origin:left top;transform-origin:left top;-webkit-transition:var(--zonos-elements-transition);transition:var(--zonos-elements-transition);margin-left:16px;top:calc(50% - var(--zonos-elements-font-size-base) / 2);z-index:1}:host .zonos--floated-label::after{content:"";position:absolute;left:0;right:0;top:0;bottom:0;border-radius:var(--border-radius)}:host .disabled .zonos--floated-label{pointer-events:inherit}:host .disabled .zonos--floated-label::after{cursor:not-allowed;z-index:1}:host(.sm){height:calc(var(--zonos-elements-size-sm) - 2px)}:host(.sm) .zonos--floated-input.has-label{padding-top:13px;padding-bottom:0}:host(.sm) .zonos--floated-input.has-label:focus+.zonos--floated-label::before,:host(.sm) .zonos--floated-input.has-label.has-content+.zonos--floated-label::before{top:2px}:host(.md){height:calc(var(--zonos-elements-size-md) - 2px)}:host(.md) .zonos--floated-input.has-label{padding-top:20px}:host(.md) .zonos--floated-input.has-label:focus+.zonos--floated-label::before,:host(.md) .zonos--floated-input.has-label.has-content+.zonos--floated-label::before{top:6px}:host(.lg){height:calc(var(--zonos-elements-size-lg) - 2px)}:host(.lg) .zonos--floated-input.has-label:focus+.zonos--floated-label::before,:host(.lg) .zonos--floated-input.has-label.has-content+.zonos--floated-label::before{top:10px}:host(.xl){height:calc(var(--zonos-elements-size-xl) - 2px)}:host(.xl) .zonos--floated-input.has-label{padding-bottom:2px}';var ZonosInputStyle0=zonosInputCss;var ZonosInput=function(){function o(o){registerInstance(this,o);this.inputChange=createEvent(this,"inputChange",7);this.inputValue="";this.inputLabel=undefined;this.inputSize="md";this.isDisabled=false;this.isError=false;this.inputPlaceholder="";this.value=this.inputValue}o.prototype.onInputValueChange=function(o){this.value=o;this.inputChange.emit(o)};o.prototype.render=function(){var o=this;return h(Host,{key:"
|
|
1
|
+
import{r as registerInstance,c as createEvent,h,H as Host,d as getElement}from"./index-3b46f3c3.js";import{d as zonosStoreFontFamily}from"./zonosStore-ba9e541e.js";import{c as classes}from"./classes-0d95c529.js";import{g as getBorderRadius}from"./getBorderRadius-947c24de.js";var zonosInputCss=':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{margin:1px;}:host .zonos--label-wrapper{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;height:100%;width:100%;background:var(--zonos-elements-input-background);border-radius:var(--border-radius);border:var(--zonos-elements-border)}:host .zonos--label-wrapper:hover{border:1px solid var(--zonos-elements-gray-300)}:host .zonos--floated-input{-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;padding:0 16px;outline:none;-webkit-transition:var(--zonos-elements-transition);transition:var(--zonos-elements-transition);width:100%;border-radius:var(--border-radius);background:var(--zonos-elements-input-background);border:0;-ms-flex-order:2;order:2;font-weight:500}:host .zonos--floated-input :-internal-autofill-selected{border-radius:var(--zonos-elements-radius-6) 0 0 var(--zonos-elements-radius-6)}:host .zonos--floated-input :-internal-autofill-selected+label+div{background-color:#e8f0fe}:host .zonos--floated-input.has-label{padding:16px 4px 8px 16px}:host .zonos--floated-input.has-label.has-input-prefix{padding-left:0}:host .zonos--floated-input.has-label.has-input-prefix+.zonos--floated-label::before{margin-left:0}:host .zonos--floated-input:not(.has-label)::-webkit-input-placeholder{opacity:var(--zonos-elements-opacity-disabled)}:host .zonos--floated-input:not(.has-label)::-moz-placeholder{opacity:var(--zonos-elements-opacity-disabled)}:host .zonos--floated-input:not(.has-label):-ms-input-placeholder{opacity:var(--zonos-elements-opacity-disabled)}:host .zonos--floated-input:not(.has-label)::-ms-input-placeholder{opacity:var(--zonos-elements-opacity-disabled)}:host .zonos--floated-input:not(.has-label)::placeholder{opacity:var(--zonos-elements-opacity-disabled)}:host .zonos--floated-input::-webkit-input-placeholder{-webkit-transition:var(--zonos-elements-transition);transition:var(--zonos-elements-transition);opacity:0}:host .zonos--floated-input::-moz-placeholder{-moz-transition:var(--zonos-elements-transition);transition:var(--zonos-elements-transition);opacity:0}:host .zonos--floated-input:-ms-input-placeholder{-ms-transition:var(--zonos-elements-transition);transition:var(--zonos-elements-transition);opacity:0}:host .zonos--floated-input::-ms-input-placeholder{-ms-transition:var(--zonos-elements-transition);transition:var(--zonos-elements-transition);opacity:0}:host .zonos--floated-input::placeholder{-webkit-transition:var(--zonos-elements-transition);transition:var(--zonos-elements-transition);opacity:0}:host .zonos--floated-input:focus{outline:none}:host .zonos--floated-input:focus+.zonos--floated-label::after{-webkit-box-shadow:var(--zonos-elements-glow-blue);box-shadow:var(--zonos-elements-glow-blue)}:host .zonos--floated-input.has-error+.zonos--floated-label::after{-webkit-box-shadow:var(--zonos-elements-glow-error);box-shadow:var(--zonos-elements-glow-error)}:host .zonos--floated-input.has-content::-webkit-input-placeholder,:host .zonos--floated-input:focus::-webkit-input-placeholder{opacity:var(--zonos-elements-opacity-disabled)}:host .zonos--floated-input.has-content::-moz-placeholder,:host .zonos--floated-input:focus::-moz-placeholder{opacity:var(--zonos-elements-opacity-disabled)}:host .zonos--floated-input.has-content:-ms-input-placeholder,:host .zonos--floated-input:focus:-ms-input-placeholder{opacity:var(--zonos-elements-opacity-disabled)}:host .zonos--floated-input.has-content::-ms-input-placeholder,:host .zonos--floated-input:focus::-ms-input-placeholder{opacity:var(--zonos-elements-opacity-disabled)}:host .zonos--floated-input.has-content::placeholder,:host .zonos--floated-input:focus::placeholder{opacity:var(--zonos-elements-opacity-disabled)}:host .zonos--floated-input.has-content+.zonos--floated-label::before,:host .zonos--floated-input:focus+.zonos--floated-label::before{top:11px;-webkit-transform:scale(0.8);transform:scale(0.8)}:host .zonos--floated-input:-webkit-autofill,:host .zonos--floated-input:-moz-autofill{background-color:var(--zonos-elements-input-background);color:var(--zonos-elements-text-color)}:host .zonos--floated-label{display:block;max-height:0;pointer-events:none;-ms-flex-order:1;order:1}:host .zonos--floated-label::before{content:attr(data-label);color:var(--zonos-elements-gray-800);position:absolute;font-size:var(--zonos-elements-font-size-base);line-height:var(--zonos-elements-font-size-base);display:inline-block;-webkit-filter:blur(0);filter:blur(0);-webkit-transform-origin:left top;transform-origin:left top;-webkit-transition:var(--zonos-elements-transition);transition:var(--zonos-elements-transition);margin-left:16px;top:calc(50% - var(--zonos-elements-font-size-base) / 2);z-index:1}:host .zonos--floated-label::after{content:"";position:absolute;left:0;right:0;top:0;bottom:0;border-radius:var(--border-radius)}:host .disabled .zonos--floated-label{pointer-events:inherit}:host .disabled .zonos--floated-label::after{cursor:not-allowed;z-index:1}:host(.sm){height:calc(var(--zonos-elements-size-sm) - 2px)}:host(.sm) .zonos--floated-input.has-label{padding-top:13px;padding-bottom:0}:host(.sm) .zonos--floated-input.has-label:focus+.zonos--floated-label::before,:host(.sm) .zonos--floated-input.has-label.has-content+.zonos--floated-label::before{top:2px}:host(.md){height:calc(var(--zonos-elements-size-md) - 2px)}:host(.md) .zonos--floated-input.has-label{padding-top:20px}:host(.md) .zonos--floated-input.has-label:focus+.zonos--floated-label::before,:host(.md) .zonos--floated-input.has-label.has-content+.zonos--floated-label::before{top:6px}:host(.lg){height:calc(var(--zonos-elements-size-lg) - 2px)}:host(.lg) .zonos--floated-input.has-label:focus+.zonos--floated-label::before,:host(.lg) .zonos--floated-input.has-label.has-content+.zonos--floated-label::before{top:10px}:host(.xl){height:calc(var(--zonos-elements-size-xl) - 2px)}:host(.xl) .zonos--floated-input.has-label{padding-bottom:2px}';var ZonosInputStyle0=zonosInputCss;var ZonosInput=function(){function o(o){registerInstance(this,o);this.inputChange=createEvent(this,"inputChange",7);this.inputValue="";this.inputLabel=undefined;this.inputSize="md";this.isDisabled=false;this.isError=false;this.inputPlaceholder="";this.value=this.inputValue}o.prototype.onInputValueChange=function(o){this.value=o;this.inputChange.emit(o)};o.prototype.render=function(){var o=this;return h(Host,{key:"f4b7ad75b2aebce3bc05a482fe20fee290a3a4e7",class:classes(["zonos--input zonos--elements",this.inputSize,this.isError&&"has-error"]),style:{"--border-radius":getBorderRadius(),"--font-family":zonosStoreFontFamily()}},h("div",{key:"356e16c11c1cd9edf137f69978ebaa3eb2c28d4e",class:classes(["zonos--label-wrapper",this.isDisabled&&"disabled"])},h("input",{key:"71659072bd58942efebb88be65ced18ad29be8ab",class:classes(["zonos--floated-input",!!this.inputLabel&&"has-label",this.inputValue&&"has-content",this.isError&&"has-error"]),disabled:this.isDisabled,onInput:function(e){var t=e.target;o.inputChange.emit(t.value)},placeholder:this.inputPlaceholder,type:"text",value:this.value}),h("label",{key:"b84c60836fc969c23aedc314c67337e8e87f2ab6",class:"zonos--floated-label","data-label":this.inputLabel})))};Object.defineProperty(o.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(o,"watchers",{get:function(){return{inputValue:["onInputValueChange"]}},enumerable:false,configurable:true});return o}();ZonosInput.style=ZonosInputStyle0;export{ZonosInput as zonos_input};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as registerInstance,h,H as Host}from"./index-3b46f3c3.js";import{H as localizationStoreUpdateSelectedLocale,t as translate,l as localizationStore}from"./cart-a90aa9ae.js";import{d as zonosStoreFontFamily}from"./zonosStore-ba9e541e.js";import{l as languages}from"./ILanguage-cd6acb72.js";import"./logError-c456c092.js";import"./isDarkColor-f8324c10.js";import"./getBorderRadius-947c24de.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:"6682af3d631bac1a8d3783418c30364ff7694792",class:"zonos--elements",style:{"--font-family":zonosStoreFontFamily()}},h("div",{key:"9f7e60bc5c4e9d1c0cc31afcbbaec444a7da630e",class:"zonos--language-select"},h("zonos-select-dialog-header",{key:"f790ef85eeb0bed05773d98793437ab4d6e64c8d",handleOnClose:function(){return e.handleOnClose()},label:translate("Select a language")}),h("div",{key:"7385a1134b21ae4b39947483ee643da021e6c54c",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:"21cd3c3e35baf172ecad7f47a76810e8f39bdeff",class:"zonos--elements",style:{"--font-family":zonosStoreFontFamily()}},h("zonos-v-stack",{key:"0470633326b6fca9b45a8be67e0d77819561f634",class:"zonos--select-dialog-header-wrapper",spacing:8},h("div",{key:"8713cbf368658af22bb88825d32175117d47c95b",class:"zonos--select-dialog-header"},h("zonos-text",{key:"2f94e9f6139570398897ca55934c5244df7f82e8",type:"boldLabel"},this.label),h("zonos-button",{key:"c247dabcc8f487a4cc5a814fb1aa4d9a68fa4ba3",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:"26727e634ec09a3b9e3912ada3b920a87a1ba4d0"})))};return e}();ZonosSelectDialogHeader.style=ZonosSelectDialogHeaderStyle0;export{ZonosLanguageSelect as zonos_language_select,ZonosSelectDialogHeader as zonos_select_dialog_header};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as registerInstance,h,H as Host}from"./index-3b46f3c3.js";var zonosLinkCss=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:inline-block}:host a{padding-bottom:2px;color:var(--zonos-elements-primary);-webkit-box-shadow:none;box-shadow:none;text-decoration:none;word-break:break-word;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;overflow-wrap:break-word}:host a:link,:host a:visited{color:var(--zonos-elements-primary);-webkit-transition:all 150ms ease-in-out;transition:all 150ms ease-in-out}:host a:hover,:host a:active{color:var(--zonos-elements-primary);-webkit-box-shadow:0 1px 0 var(--zonos-elements-primary);box-shadow:0 1px 0 var(--zonos-elements-primary)}";var ZonosLinkStyle0=zonosLinkCss;var ZonosLink=function(){function o(o){registerInstance(this,o);this.href="";this.rel=undefined;this.target=undefined;this.linkTitle=undefined}o.prototype.render=function(){return h(Host,{key:"
|
|
1
|
+
import{r as registerInstance,h,H as Host}from"./index-3b46f3c3.js";var zonosLinkCss=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:inline-block}:host a{padding-bottom:2px;color:var(--zonos-elements-primary);-webkit-box-shadow:none;box-shadow:none;text-decoration:none;word-break:break-word;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;overflow-wrap:break-word}:host a:link,:host a:visited{color:var(--zonos-elements-primary);-webkit-transition:all 150ms ease-in-out;transition:all 150ms ease-in-out}:host a:hover,:host a:active{color:var(--zonos-elements-primary);-webkit-box-shadow:0 1px 0 var(--zonos-elements-primary);box-shadow:0 1px 0 var(--zonos-elements-primary)}";var ZonosLinkStyle0=zonosLinkCss;var ZonosLink=function(){function o(o){registerInstance(this,o);this.href="";this.rel=undefined;this.target=undefined;this.linkTitle=undefined}o.prototype.render=function(){return h(Host,{key:"bba0da02c0dee468bd0cacd268f339f7ec4f1008",class:"zonos--elements"},h("a",{key:"19515197e397b2b24237e77d3e89de75382c14e1",href:this.href,rel:this.rel,target:this.target,title:this.linkTitle},h("slot",{key:"63d597a3091e954c9302e461030646b38ee2396e"})))};return o}();ZonosLink.style=ZonosLinkStyle0;export{ZonosLink as zonos_link};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as registerInstance,h,a as getAssetPath,H as Host}from"./index-3b46f3c3.js";import{d as zonosStoreFontFamily}from"./zonosStore-ba9e541e.js";import{c as classes}from"./classes-0d95c529.js";var zonosLogoCss=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex}:host img{-webkit-filter:var(--filter-color);filter:var(--filter-color);width:var(--width)}";var ZonosLogoStyle0=zonosLogoCss;var ZonosLogo=function(){function o(o){registerInstance(this,o);this.theme="LIGHT";this.width="auto"}o.prototype.render=function(){var o=this.theme==="DARK"?"invert(100%) sepia(100%) saturate(0%) hue-rotate(288deg) brightness(102%) contrast(102%)":"whiteinvert(0%) sepia(100%) saturate(32%) hue-rotate(92deg) brightness(107%) contrast(107%)";return h(Host,{key:"
|
|
1
|
+
import{r as registerInstance,h,a as getAssetPath,H as Host}from"./index-3b46f3c3.js";import{d as zonosStoreFontFamily}from"./zonosStore-ba9e541e.js";import{c as classes}from"./classes-0d95c529.js";var zonosLogoCss=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex}:host img{-webkit-filter:var(--filter-color);filter:var(--filter-color);width:var(--width)}";var ZonosLogoStyle0=zonosLogoCss;var ZonosLogo=function(){function o(o){registerInstance(this,o);this.theme="LIGHT";this.width="auto"}o.prototype.render=function(){var o=this.theme==="DARK"?"invert(100%) sepia(100%) saturate(0%) hue-rotate(288deg) brightness(102%) contrast(102%)":"whiteinvert(0%) sepia(100%) saturate(32%) hue-rotate(92deg) brightness(107%) contrast(107%)";return h(Host,{key:"08ef20244bc204125a7a308efed42cd7fc86c885",class:classes(["zonos--elements zonos--logo"]),style:{"--filter-color":o,"--font-family":zonosStoreFontFamily(),"--width":this.width}},h("img",{key:"9202f0619fa3874a19ca3050477719b19592d82a",alt:"Zonos Logo",src:getAssetPath("./assets/ZonosLogo.png")}))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return o}();ZonosLogo.style=ZonosLogoStyle0;export{ZonosLogo as zonos_logo};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(t,o,n,e){function s(t){return t instanceof n?t:new n((function(o){o(t)}))}return new(n||(n=Promise))((function(n,i){function a(t){try{c(e.next(t))}catch(t){i(t)}}function r(t){try{c(e["throw"](t))}catch(t){i(t)}}function c(t){t.done?n(t.value):s(t.value).then(a,r)}c((e=e.apply(t,o||[])).next())}))};var __generator=this&&this.__generator||function(t,o){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},e,s,i,a;return a={next:r(0),throw:r(1),return:r(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function r(t){return function(o){return c([t,o])}}function c(r){if(e)throw new TypeError("Generator is already executing.");while(a&&(a=0,r[0]&&(n=0)),n)try{if(e=1,s&&(i=r[0]&2?s["return"]:r[0]?s["throw"]||((i=s["return"])&&i.call(s),0):s.next)&&!(i=i.call(s,r[1])).done)return i;if(s=0,i)r=[r[0]&2,i.value];switch(r[0]){case 0:case 1:i=r;break;case 4:n.label++;return{value:r[1],done:false};case 5:n.label++;s=r[1];r=[0];continue;case 7:r=n.ops.pop();n.trys.pop();continue;default:if(!(i=n.trys,i=i.length>0&&i[i.length-1])&&(r[0]===6||r[0]===2)){n=0;continue}if(r[0]===3&&(!i||r[1]>i[0]&&r[1]<i[3])){n.label=r[1];break}if(r[0]===6&&n.label<i[1]){n.label=i[1];i=r;break}if(i&&n.label<i[2]){n.label=i[2];n.ops.push(r);break}if(i[2])n.ops.pop();n.trys.pop();continue}r=o.call(t,n)}catch(t){r=[6,t];s=0}finally{e=i=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(t,o,n){if(n||arguments.length===2)for(var e=0,s=o.length,i;e<s;e++){if(i||!(e in o)){if(!i)i=Array.prototype.slice.call(o,0,e);i[e]=o[e]}}return t.concat(i||Array.prototype.slice.call(o))};import{r as registerInstance,h,H as Host,d as getElement}from"./index-3b46f3c3.js";import{d as zonosStoreFontFamily}from"./zonosStore-ba9e541e.js";import{c as classes}from"./classes-0d95c529.js";import{h as stripeStore}from"./cart-a90aa9ae.js";import{a as logError}from"./logError-c456c092.js";import"./isDarkColor-f8324c10.js";import"./getBorderRadius-947c24de.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 t(t){registerInstance(this,t);this.notificationArray=[]}t.prototype.showNotification=function(t){return __awaiter(this,void 0,void 0,(function(){var o,n;var e=this;return __generator(this,(function(s){o="id-".concat(Math.random().toString(36).substring(2,9));n=Object.assign(Object.assign({},t),{id:o,timeout:t.timeout||5e3,transitionClass:"",type:t.type||"success"});this.notificationArray=__spreadArray(__spreadArray([],this.notificationArray,true),[n],false);setTimeout((function(){e.updateTransitionClass({id:o,transitionClass:"show"})}),50);setTimeout((function(){e.removeNotification(o)}),n.timeout);return[2]}))}))};t.prototype.updateTransitionClass=function(t){var o=t.id,n=t.transitionClass;this.notificationArray=this.notificationArray.map((function(t){if(t.id===o){return Object.assign(Object.assign({},t),{transitionClass:n})}return t}))};t.prototype.removeNotification=function(t){var o=this;this.updateTransitionClass({id:t,transitionClass:""});setTimeout((function(){o.notificationArray=o.notificationArray.filter((function(o){return o.id!==t}))}),300)};t.prototype.render=function(){var t=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(){t.removeNotification(o.id)}},h("zonos-text",{textColor:"gray-0"},o.message))}))))};return t}();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 t(t){registerInstance(this,t);this.titleText=undefined;this.stripe=stripeStore.stripe;this.stripeElements=stripeStore.stripeElements}t.prototype.watchInitStripe=function(){if(!this.stripeElements){return}var t=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}t.mount(o);t.on("change",(function(t){stripeStore.stripePaymentEventData=t}));stripeStore.stripePaymentElement=t};t.prototype.componentDidLoad=function(){this.watchInitStripe()};t.prototype.render=function(){return h(Host,{key:"870d7a4cb6132332368d356488c5eedd1dea16f3",class:"zonos--payment zonos--elements"},this.titleText&&h("zonos-text",{key:"7aef62f6daae0c5b59caa685c4255fb78eebc1be",class:"zonos--title",type:"semiBoldLabel"},this.titleText),h("div",{key:"073976bceadf5f8efa78d0b1f6098e94bfa3d1a6",class:"zonos--payment-component"}))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{stripeElements:["watchInitStripe"],stripe:["watchInitStripe"]}},enumerable:false,configurable:true});return t}();ZonosPayment.style=ZonosPaymentStyle0;export{ZonosNotification as zonos_notification,ZonosPayment as zonos_payment};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as registerInstance,h,H as Host}from"./index-3b46f3c3.js";import{d as zonosStoreFontFamily}from"./zonosStore-ba9e541e.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:"8cdee94089af0eac57784a7914e169f363472577",style:{"--font-family":zonosStoreFontFamily()}},h("div",{key:"d60da826d77b4cf7e5349b75927fc746f0053ddd",class:classes(["vstack"]),style:{"grid-row-gap":"".concat(this.spacing,"px")}},h("slot",{key:"97b0e8232cbac73938225e1310712c1607997073"})))};return t}();VStack.style=ZonosVStackStyle0;export{VStack as zonos_v_stack};
|
package/dist/scripts/index.d.ts
CHANGED
|
@@ -1185,10 +1185,10 @@ declare namespace Components {
|
|
|
1185
1185
|
}
|
|
1186
1186
|
interface ZonosBadge {
|
|
1187
1187
|
/**
|
|
1188
|
-
* The
|
|
1188
|
+
* The color of the badge
|
|
1189
1189
|
* @default 24
|
|
1190
1190
|
*/
|
|
1191
|
-
"badgeColor": ColorPrefix;
|
|
1191
|
+
"badgeColor": ColorPrefix | 'transparent';
|
|
1192
1192
|
/**
|
|
1193
1193
|
* Whether or not the badge is bold
|
|
1194
1194
|
* @default false
|
|
@@ -1227,7 +1227,7 @@ declare namespace Components {
|
|
|
1227
1227
|
}
|
|
1228
1228
|
interface ZonosButton {
|
|
1229
1229
|
/**
|
|
1230
|
-
* The color of the button
|
|
1230
|
+
* The color of the button **NOTE**: If the button `variant` is set to 'standard', backgroundColor will be disregarded
|
|
1231
1231
|
*/
|
|
1232
1232
|
"backgroundColor"?: Color | (string & { _placeholder?: never });
|
|
1233
1233
|
/**
|
|
@@ -1257,6 +1257,11 @@ declare namespace Components {
|
|
|
1257
1257
|
* @prop () also affect that. <Host> is also referred to a component itself, if disabled prop is true, the `zonos-button` will have disabled attribute. So let's say when the loading state is true, and the component consume the zonos-button doesn't pass the disabled prop down. It accidentally turns the disabled prop on even thought the disabled state is not changed from the outside.
|
|
1258
1258
|
*/
|
|
1259
1259
|
"isDisabled": boolean;
|
|
1260
|
+
/**
|
|
1261
|
+
* The content alignment within the button
|
|
1262
|
+
* @default 'center'
|
|
1263
|
+
*/
|
|
1264
|
+
"justifyContent": 'center' | 'flex-end' | 'flex-start';
|
|
1260
1265
|
/**
|
|
1261
1266
|
* Whether or not the button is loading
|
|
1262
1267
|
*/
|
|
@@ -1305,6 +1310,15 @@ declare namespace Components {
|
|
|
1305
1310
|
* The actions to display in the header of the card
|
|
1306
1311
|
*/
|
|
1307
1312
|
"actions"?: HTMLElement;
|
|
1313
|
+
/**
|
|
1314
|
+
* The background color of the card
|
|
1315
|
+
*/
|
|
1316
|
+
"backgroundColor"?: Color;
|
|
1317
|
+
/**
|
|
1318
|
+
* The border radius of the card
|
|
1319
|
+
* @default 6
|
|
1320
|
+
*/
|
|
1321
|
+
"borderRadius"?: number;
|
|
1308
1322
|
/**
|
|
1309
1323
|
* The actions to display in the footer of the card
|
|
1310
1324
|
*/
|
|
@@ -2636,10 +2650,10 @@ declare namespace LocalJSX {
|
|
|
2636
2650
|
}
|
|
2637
2651
|
interface ZonosBadge {
|
|
2638
2652
|
/**
|
|
2639
|
-
* The
|
|
2653
|
+
* The color of the badge
|
|
2640
2654
|
* @default 24
|
|
2641
2655
|
*/
|
|
2642
|
-
"badgeColor"?: ColorPrefix;
|
|
2656
|
+
"badgeColor"?: ColorPrefix | 'transparent';
|
|
2643
2657
|
/**
|
|
2644
2658
|
* Whether or not the badge is bold
|
|
2645
2659
|
* @default false
|
|
@@ -2678,7 +2692,7 @@ declare namespace LocalJSX {
|
|
|
2678
2692
|
}
|
|
2679
2693
|
interface ZonosButton {
|
|
2680
2694
|
/**
|
|
2681
|
-
* The color of the button
|
|
2695
|
+
* The color of the button **NOTE**: If the button `variant` is set to 'standard', backgroundColor will be disregarded
|
|
2682
2696
|
*/
|
|
2683
2697
|
"backgroundColor"?: Color | (string & { _placeholder?: never });
|
|
2684
2698
|
/**
|
|
@@ -2708,6 +2722,11 @@ declare namespace LocalJSX {
|
|
|
2708
2722
|
* @prop () also affect that. <Host> is also referred to a component itself, if disabled prop is true, the `zonos-button` will have disabled attribute. So let's say when the loading state is true, and the component consume the zonos-button doesn't pass the disabled prop down. It accidentally turns the disabled prop on even thought the disabled state is not changed from the outside.
|
|
2709
2723
|
*/
|
|
2710
2724
|
"isDisabled"?: boolean;
|
|
2725
|
+
/**
|
|
2726
|
+
* The content alignment within the button
|
|
2727
|
+
* @default 'center'
|
|
2728
|
+
*/
|
|
2729
|
+
"justifyContent"?: 'center' | 'flex-end' | 'flex-start';
|
|
2711
2730
|
/**
|
|
2712
2731
|
* Whether or not the button is loading
|
|
2713
2732
|
*/
|
|
@@ -2756,6 +2775,15 @@ declare namespace LocalJSX {
|
|
|
2756
2775
|
* The actions to display in the header of the card
|
|
2757
2776
|
*/
|
|
2758
2777
|
"actions"?: HTMLElement;
|
|
2778
|
+
/**
|
|
2779
|
+
* The background color of the card
|
|
2780
|
+
*/
|
|
2781
|
+
"backgroundColor"?: Color;
|
|
2782
|
+
/**
|
|
2783
|
+
* The border radius of the card
|
|
2784
|
+
* @default 6
|
|
2785
|
+
*/
|
|
2786
|
+
"borderRadius"?: number;
|
|
2759
2787
|
/**
|
|
2760
2788
|
* The actions to display in the footer of the card
|
|
2761
2789
|
*/
|
package/dist/scripts/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";const e=(e,t,...n)=>{var o,r;if(!(!!(null===(o=window.Zonos)||void 0===o?void 0:o.debug)||!!window.location.search.match(/\?.*(&*)zonosDebug=1/)))return void("error"===t&&console.error(e,...n));let s=document.querySelector("iframe#zonos---debug-logging-iframe");s||(s=document.createElement("iframe"),s.id="zonos---debug-logging-iframe",s.style.display="none",s.style.opacity="0",s.style.position="absolute",s.style.top="-9999px",s.style.left="-9999px",s.style.width="1px",s.style.height="1px",s.style.border="none",s.style.overflow="hidden",s.style.visibility="hidden",document.body.appendChild(s));const i=(null===(r=s.contentWindow)||void 0===r?void 0:r.window.console)||window.console;switch(t){case"warn":i.warn(e,...n);break;case"info":i.info(e,...n);break;case"error":i.error(e,...n);break;default:i.groupCollapsed(e,...n),i.trace(),i.groupEnd()}},t=(t,...n)=>{e(t,"error",...n)},n=["jsdelivr","unpkg","vercel"],o=e=>{const t=n.indexOf(e);return n[t+1]||null},r=()=>{if("undefined"==typeof window)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);if(!t)return null;if("dev-elements"===t)return"https://dev.elements.zonos.com";const n=`https://${t}.preview.js.zonos.com`;return e(`[ZONOS-WARNING] using '${n}' for loading script`,"warn"),fetch(n).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${n}' 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})),n},s="https://js.stripe.com/v3",i=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,l="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let c=null;const d=e=>(null!==c||(c=new Promise(((n,o)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(l),window.Stripe)n(window.Stripe);else try{let r=(()=>{const e=document.querySelectorAll(`script[src^="${s}"]`);for(let t=0;t<e.length;t++){const n=e[t];if(n&&i.test(n.src))return n}return null})();r&&e?console.warn(l):r||(r=(e=>{const n=document.createElement("script");n.src=`${s}`;const o=document.head||document.body;return o?(o.appendChild(n),n):(t("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})()),null==r||r.addEventListener("load",(()=>{window.Stripe?n(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 n(null)}))),c),a=Promise.resolve().then((()=>d(null)));let u=!1;a.catch((e=>{u||console.warn(e)}));var p;const m=(()=>{if("undefined"==typeof document)return null;const e=document.querySelector('script[src*="/zonos.js"]'),{currentLoadScriptUrl:t,isWhiteListed:n}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const t=new URL(e).origin,n=["dev.elements.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>t.includes(e))),o=["qa.js.zonos.com"].some((e=>t.includes(e)));return{currentLoadScriptUrl:t,isForceLoadVersionDomain:o,isWhiteListed:n}})({loadScriptSrc:null==e?void 0:e.src});return n?t:null})(),h="https://v1.3.
|
|
1
|
+
(function(){"use strict";const e=(e,t,...n)=>{var o,r;if(!(!!(null===(o=window.Zonos)||void 0===o?void 0:o.debug)||!!window.location.search.match(/\?.*(&*)zonosDebug=1/)))return void("error"===t&&console.error(e,...n));let s=document.querySelector("iframe#zonos---debug-logging-iframe");s||(s=document.createElement("iframe"),s.id="zonos---debug-logging-iframe",s.style.display="none",s.style.opacity="0",s.style.position="absolute",s.style.top="-9999px",s.style.left="-9999px",s.style.width="1px",s.style.height="1px",s.style.border="none",s.style.overflow="hidden",s.style.visibility="hidden",document.body.appendChild(s));const i=(null===(r=s.contentWindow)||void 0===r?void 0:r.window.console)||window.console;switch(t){case"warn":i.warn(e,...n);break;case"info":i.info(e,...n);break;case"error":i.error(e,...n);break;default:i.groupCollapsed(e,...n),i.trace(),i.groupEnd()}},t=(t,...n)=>{e(t,"error",...n)},n=["jsdelivr","unpkg","vercel"],o=e=>{const t=n.indexOf(e);return n[t+1]||null},r=()=>{if("undefined"==typeof window)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);if(!t)return null;if("dev-elements"===t)return"https://dev.elements.zonos.com";const n=`https://${t}.preview.js.zonos.com`;return e(`[ZONOS-WARNING] using '${n}' for loading script`,"warn"),fetch(n).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${n}' 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})),n},s="https://js.stripe.com/v3",i=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,l="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let c=null;const d=e=>(null!==c||(c=new Promise(((n,o)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(l),window.Stripe)n(window.Stripe);else try{let r=(()=>{const e=document.querySelectorAll(`script[src^="${s}"]`);for(let t=0;t<e.length;t++){const n=e[t];if(n&&i.test(n.src))return n}return null})();r&&e?console.warn(l):r||(r=(e=>{const n=document.createElement("script");n.src=`${s}`;const o=document.head||document.body;return o?(o.appendChild(n),n):(t("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})()),null==r||r.addEventListener("load",(()=>{window.Stripe?n(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 n(null)}))),c),a=Promise.resolve().then((()=>d(null)));let u=!1;a.catch((e=>{u||console.warn(e)}));var p;const m=(()=>{if("undefined"==typeof document)return null;const e=document.querySelector('script[src*="/zonos.js"]'),{currentLoadScriptUrl:t,isWhiteListed:n}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const t=new URL(e).origin,n=["dev.elements.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>t.includes(e))),o=["qa.js.zonos.com"].some((e=>t.includes(e)));return{currentLoadScriptUrl:t,isForceLoadVersionDomain:o,isWhiteListed:n}})({loadScriptSrc:null==e?void 0:e.src});return n?t:null})(),h="https://v1.3.32.js.zonos.com",y=m||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.32",w="jsdelivr",f="https://rsms.me",g="https://fonts.googleapis.com",v=/^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;class S{}p=S,S.doneInit=!1,S.debug="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/),S.zonosConversionTest="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/),S.isBigCommerce=!1,S.isNpm=!0,S.zonosQaUrl=null,S.version="v1.3.32",S.modeAlerted=!1,S.tempCartData=null,S.getCurrentTimestamp=()=>(new Date).getTime(),S.zonosController=null,S.init=async({appearance:n,checkoutSettings:o,currencyConverter:r,helloSettings:s,onCountryChange:i,overrideCurrencyFormat:l,storeId:c,zonosApiKey:d})=>{p.doneInit||(e(`====== ZONOS DEBUG MODE: on (${p.version}) ======`),d?(p.zonosApiKey=d,p.storeId=c,e("init zonos"),p.injectZonosCdn(),p.injectZonosCss(),p.injectFonts(),p.injectController({config:{appearance:n,checkoutSettings:o,currencyConverter:r,helloSettings:s,onCountryChange:i,overrideCurrencyFormat:l},zonosApiKey:d}),p.doneInit=!0):t("Missing Zonos API key"))},S.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},S.openHelloDialog=e=>{const t=document.querySelector("zonos-hello");t&&t.openHelloDialog(null==e||e)},S.showNotification=e=>{var t;null===(t=p.zonosController)||void 0===t||t.showNotification(e)},S.updateOrganizationName=e=>{var t;null===(t=p.zonosController)||void 0===t||t.updateOrganizationName(e)},S.disablePlaceOrderButtons=({autoEnable:e=!0,disable:t,placeOrderButtonSelector:n})=>{if(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)}},S.injectController=({config:n,zonosApiKey:o})=>{var r;if(document.querySelector("zonos-controller"))return;if(null===(r=n.checkoutSettings)||void 0===r?void 0:r.placeOrderButtonSelector){const e=n.checkoutSettings.placeOrderButtonSelector;p.disablePlaceOrderButtons({disable:!0,placeOrderButtonSelector:e});new MutationObserver((()=>{p.disablePlaceOrderButtons({disable:!0,placeOrderButtonSelector:e})})).observe(document.body,{childList:!0,subtree:!0})}const s=document.createElement("zonos-controller");s.config=n,s.zonosApiKey=o,s.addEventListener("stripeInitEvent",(async n=>{const{detail:o}=n;e("loading Stripe");const r=await(async(...e)=>{u=!0;const t=Date.now();return a.then((n=>((e,t,n)=>{if(null===e)return null;const o=e.apply(void 0,t);return((e,t)=>{e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",startTime:t})})(o,n),o})(n,e,t)))})(o.publishableKey);r?(window.Zonos.stripe=r,s.initCheckoutElement(r)):t("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(s),p.zonosController=s,e("Zonos controller injected!")},S.injectScript=({cdnType:n,isModule:r,theRestUrl:s})=>{const i=`${p.getZonosUrl(n)}/${s}`;if(document.querySelector(`script[src="${i}"]`))return void e(`Zonos script "${i}" already exists in the document`,"warn");const l=document.head||document.body,c=document.createElement("script");r?c.type="module":c.noModule=!0,c.src=i,c.crossOrigin="anonymous",c.onerror=()=>{t(`Failed to load ${c.src}`);const e=o(n);e&&p.injectScript({cdnType:e,isModule:r,theRestUrl:s})},l.appendChild(c)},S.getZonosUrl=e=>{const t=()=>{switch(e){case"jsdelivr":return y;case"unpkg":return"https://unpkg.com/@zonos/elements@1.3.32";default:return h}};if(p.isNpm){return r()||t()}return t()},S.injectZonosCdn=()=>{p.injectScript({cdnType:w,isModule:!0,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),p.injectScript({cdnType:w,isModule:!1,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),e("Zonos cdn script injected!")},S.injectStylesheet=({cdnType:e,theRestUrl:n})=>{const r=p.getZonosUrl(e),s=document.head||document.body,i=document.createElement("link");i.rel="preconnect",i.href=`${h}/`,s.appendChild(i);const l=document.createElement("link");l.rel="stylesheet",l.href=`${r}/${n}`,l.onerror=()=>{t(`Failed to load ${l.href}`);const r=o(e);r&&p.injectStylesheet({cdnType:r,theRestUrl:n})},s.appendChild(l)},S.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?e("Zonos style links already injected","warn"):(p.injectStylesheet({cdnType:w,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),e("Zonos style css injected!"))},S.injectFonts=()=>{if((()=>{const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${f}"]`);for(let t=0;t<e.length;t++){const n=e[t];if(n&&!v.test(n.href))return n}return null})())return void e("Inter font already injected","warn");const t=document.head||document.body,n=document.createElement("link");n.rel="preconnect",n.href=f,t.appendChild(n);const o=document.createElement("link");o.rel="stylesheet",o.href=`${f}/inter/inter.css`,t.appendChild(o),e("Zonos font injected!")},S.setupGoogleFont=e=>{var t;null===(t=p.zonosController)||void 0===t||t.setupGoogleFont(e)},S.injectSupportGoogleFont=t=>{var n;e(`[FONT] injecting ${t}`);const o=null===(n=t.match(/family=(.*?):/))||void 0===n?void 0:n[1],r=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${g}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=g,r.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${t}"]`))return void e(`[FONT] ${o} font already injected`,"warn");const s=document.createElement("link");s.rel="stylesheet",s.href=t,r.appendChild(s),e(`[FONT] ${o} font injected!`)},exports.Zonos=S})();
|