@zonos/elements 1.3.266 → 1.3.267
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-efc42379.js → cart-ed2de167.js} +1 -1
- package/dist/cjs/{hasInclusivePrice-400be1b2.js → hasInclusivePrice-bf31fbdb.js} +1 -1
- package/dist/cjs/index.cjs.js +7 -7
- package/dist/cjs/{invoice-9e4d479f.js → invoice-542c23e7.js} +2 -2
- package/dist/cjs/{isCollectMobileTablet-630fcf87.js → isCollectMobileTablet-fe8149a5.js} +2 -2
- package/dist/cjs/{localization-4b17c530.js → localization-66d378ab.js} +51 -0
- package/dist/cjs/{paypal-3bb55914.js → paypal-d8282578.js} +2 -2
- package/dist/cjs/{placeTestOrder-313cbd78.js → placeTestOrder-0a4b9dd7.js} +2 -2
- package/dist/cjs/{renderCheckoutCurrency-e0436f1c.js → renderCheckoutCurrency-ac9083d9.js} +2 -2
- package/dist/cjs/zonos-address-display_8.cjs.entry.js +2 -2
- package/dist/cjs/zonos-address_4.cjs.entry.js +2 -2
- package/dist/cjs/zonos-card_5.cjs.entry.js +3 -3
- package/dist/cjs/zonos-cart-items_12.cjs.entry.js +6 -6
- package/dist/cjs/zonos-checkout.cjs.entry.js +3 -3
- package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +2 -2
- package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +6 -6
- package/dist/cjs/zonos-collect.cjs.entry.js +4 -4
- package/dist/cjs/zonos-controller.cjs.entry.js +122 -3
- package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -1
- package/dist/cjs/zonos-country-select_4.cjs.entry.js +1 -1
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +2 -2
- package/dist/cjs/zonos-hello.cjs.entry.js +1 -1
- package/dist/cjs/zonos-invoice-cart-items_2.cjs.entry.js +4 -4
- package/dist/cjs/zonos-invoice-finish_5.cjs.entry.js +6 -6
- package/dist/cjs/zonos-invoice.cjs.entry.js +4 -4
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +1 -1
- package/dist/cjs/zonos-store-credit.cjs.entry.js +3 -3
- package/dist/collection/components/common/zonos-stripe-phone-input/zonos-stripe-phone-input.js +1 -1
- package/dist/collection/components/main/zonos-controller.js +6 -2
- package/dist/collection/components/store/hello/localization.js +6 -0
- package/dist/collection/components/utils/checkout/injectDomesticElementHideStyle.js +116 -0
- package/dist/collection/types/generated/graphql.internal.types.js +287 -73
- package/dist/collection/utils/toggleBigcommerceNativeCurrencySelector.js +48 -0
- package/dist/esm/{cart-62c166fc.js → cart-49082718.js} +1 -1
- package/dist/esm/{hasInclusivePrice-a73f64b7.js → hasInclusivePrice-2323d514.js} +1 -1
- package/dist/esm/index.js +7 -7
- package/dist/esm/{invoice-fa4ff6fb.js → invoice-16c688e7.js} +2 -2
- package/dist/esm/{isCollectMobileTablet-5f50ec81.js → isCollectMobileTablet-910aea2e.js} +2 -2
- package/dist/esm/{localization-d2631105.js → localization-33a9f7ff.js} +51 -0
- package/dist/esm/{paypal-424d040d.js → paypal-2e9aa4ba.js} +2 -2
- package/dist/esm/{placeTestOrder-cf237d95.js → placeTestOrder-35c9b460.js} +2 -2
- package/dist/esm/{renderCheckoutCurrency-513ead96.js → renderCheckoutCurrency-b84a6da7.js} +2 -2
- package/dist/esm/zonos-address-display_8.entry.js +2 -2
- package/dist/esm/zonos-address_4.entry.js +2 -2
- package/dist/esm/zonos-card_5.entry.js +3 -3
- package/dist/esm/zonos-cart-items_12.entry.js +6 -6
- package/dist/esm/zonos-checkout.entry.js +3 -3
- package/dist/esm/zonos-collect-cart-items_3.entry.js +2 -2
- package/dist/esm/zonos-collect-finish_6.entry.js +6 -6
- package/dist/esm/zonos-collect.entry.js +4 -4
- package/dist/esm/zonos-controller.entry.js +122 -3
- package/dist/esm/zonos-country-flag.entry.js +1 -1
- package/dist/esm/zonos-country-select_4.entry.js +1 -1
- package/dist/esm/zonos-hello-dialog.entry.js +2 -2
- package/dist/esm/zonos-hello.entry.js +1 -1
- package/dist/esm/zonos-invoice-cart-items_2.entry.js +4 -4
- package/dist/esm/zonos-invoice-finish_5.entry.js +6 -6
- package/dist/esm/zonos-invoice.entry.js +4 -4
- package/dist/esm/zonos-language-select_2.entry.js +1 -1
- package/dist/esm/zonos-store-credit.entry.js +3 -3
- package/dist/esm-es5/{cart-62c166fc.js → cart-49082718.js} +1 -1
- package/dist/esm-es5/{hasInclusivePrice-a73f64b7.js → hasInclusivePrice-2323d514.js} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{invoice-fa4ff6fb.js → invoice-16c688e7.js} +1 -1
- package/dist/esm-es5/{isCollectMobileTablet-5f50ec81.js → isCollectMobileTablet-910aea2e.js} +1 -1
- package/dist/esm-es5/{localization-d2631105.js → localization-33a9f7ff.js} +1 -1
- package/dist/esm-es5/{paypal-424d040d.js → paypal-2e9aa4ba.js} +2 -2
- package/dist/esm-es5/{placeTestOrder-cf237d95.js → placeTestOrder-35c9b460.js} +1 -1
- package/dist/esm-es5/{renderCheckoutCurrency-513ead96.js → renderCheckoutCurrency-b84a6da7.js} +1 -1
- package/dist/esm-es5/zonos-address-display_8.entry.js +1 -1
- package/dist/esm-es5/zonos-address_4.entry.js +1 -1
- package/dist/esm-es5/zonos-card_5.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +1 -1
- package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -1
- package/dist/esm-es5/zonos-collect.entry.js +1 -1
- package/dist/esm-es5/zonos-controller.entry.js +1 -1
- package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
- package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
- package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm-es5/zonos-hello.entry.js +1 -1
- package/dist/esm-es5/zonos-invoice-cart-items_2.entry.js +1 -1
- package/dist/esm-es5/zonos-invoice-finish_5.entry.js +1 -1
- package/dist/esm-es5/zonos-invoice.entry.js +1 -1
- package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
- package/dist/esm-es5/zonos-store-credit.entry.js +1 -1
- package/dist/scripts/index.d.ts +33 -13
- 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/utils/api/getLocaleMessages.d.ts +1 -1
- package/dist/types/components/utils/checkout/injectDomesticElementHideStyle.d.ts +18 -0
- package/dist/types/scripts/cart/_setupCartDataWithSettings.d.ts +14 -13
- package/dist/types/types/checkout/CheckoutConfig.d.ts +9 -0
- package/dist/types/types/generated/graphql.frontend.types.d.ts +1 -1
- package/dist/types/types/generated/graphql.frontend.types.ts +1 -1
- package/dist/types/types/generated/graphql.internal.types.d.ts +341 -106
- package/dist/types/types/generated/graphql.internal.types.ts +419 -141
- package/dist/types/types/utils/ZonosSettings.d.ts +9 -0
- package/dist/types/utils/toggleBigcommerceNativeCurrencySelector.d.ts +17 -0
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-acf42bc1.entry.js → p-01497a20.entry.js} +1 -1
- package/dist/zonos-elements/p-029be4a8.entry.js +1 -0
- package/dist/zonos-elements/{p-5e10d4ff.system.entry.js → p-034ab928.system.entry.js} +1 -1
- package/dist/zonos-elements/p-07a76716.system.js +1 -0
- package/dist/zonos-elements/{p-08934304.system.entry.js → p-087520f2.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-889e5db0.entry.js → p-0ed70279.entry.js} +1 -1
- package/dist/zonos-elements/{p-0ea16658.system.entry.js → p-1325bbd6.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-305e2dd8.system.js → p-175c04a4.system.js} +1 -1
- package/dist/zonos-elements/{p-bb77b580.entry.js → p-180d3e3d.entry.js} +1 -1
- package/dist/zonos-elements/{p-f76d5249.entry.js → p-1ec9b3b0.entry.js} +1 -1
- package/dist/zonos-elements/{p-9aaa1d80.entry.js → p-1f256673.entry.js} +1 -1
- package/dist/zonos-elements/{p-7b74e5f2.system.entry.js → p-22ba60f6.system.entry.js} +1 -1
- package/dist/zonos-elements/p-29b60bf3.system.js +1 -1
- package/dist/zonos-elements/{p-781cc8de.system.entry.js → p-2a8fcb71.system.entry.js} +1 -1
- package/dist/zonos-elements/p-2c854197.system.entry.js +1 -0
- package/dist/zonos-elements/{p-01384124.system.js → p-311ba000.system.js} +1 -1
- package/dist/zonos-elements/{p-7c101a92.system.entry.js → p-3516340a.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-a9425900.system.js → p-3b1b3598.system.js} +1 -1
- package/dist/zonos-elements/p-458df669.js +1 -0
- package/dist/zonos-elements/{p-ce44c942.system.js → p-4f718ef9.system.js} +1 -1
- package/dist/zonos-elements/p-5d823ea7.system.js +1 -0
- package/dist/zonos-elements/{p-2431f95c.entry.js → p-5e1799bc.entry.js} +1 -1
- package/dist/zonos-elements/{p-72187e00.entry.js → p-601bb27e.entry.js} +1 -1
- package/dist/zonos-elements/{p-1d6f3ab9.js → p-6987f9c9.js} +1 -1
- package/dist/zonos-elements/{p-7b640194.entry.js → p-703fc360.entry.js} +1 -1
- package/dist/zonos-elements/{p-7677c45a.entry.js → p-71c7a1ff.entry.js} +1 -1
- package/dist/zonos-elements/{p-06c4d422.system.js → p-77c2e465.system.js} +1 -1
- package/dist/zonos-elements/{p-a75baf3e.js → p-843ced6c.js} +1 -1
- package/dist/zonos-elements/{p-cd88efdb.js → p-84dbf474.js} +1 -1
- package/dist/zonos-elements/{p-2b30beea.system.js → p-8570e88a.system.js} +1 -1
- package/dist/zonos-elements/{p-ea88f7f5.system.entry.js → p-8d5f413c.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-03e95598.entry.js → p-8f9e95c2.entry.js} +1 -1
- package/dist/zonos-elements/{p-227ef22f.entry.js → p-90c932fd.entry.js} +1 -1
- package/dist/zonos-elements/{p-9b660cd3.js → p-9a5a2043.js} +1 -1
- package/dist/zonos-elements/{p-209d7728.system.entry.js → p-9b0a6fe5.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-72efa5b7.system.entry.js → p-9e0cb5b3.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-6ab742d9.system.entry.js → p-a1bad0c3.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-d63e18a8.entry.js → p-a6db8883.entry.js} +1 -1
- package/dist/zonos-elements/{p-f1bbad73.entry.js → p-a78bc004.entry.js} +1 -1
- package/dist/zonos-elements/{p-0efd2d5a.js → p-adb9827c.js} +1 -1
- package/dist/zonos-elements/{p-bbbbae9a.system.entry.js → p-b5a26334.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-37207963.system.js → p-b6a36c25.system.js} +1 -1
- package/dist/zonos-elements/{p-4d433020.system.entry.js → p-b7e4a020.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-8cd0a098.system.entry.js → p-baf0b24c.system.entry.js} +1 -1
- package/dist/zonos-elements/p-becac995.js +1 -0
- package/dist/zonos-elements/{p-4495f149.system.entry.js → p-c9c17d08.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-27513bfe.system.entry.js → p-cb966d16.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-6b682a6b.system.entry.js → p-ce103c66.system.entry.js} +1 -1
- package/dist/zonos-elements/p-cfb0059f.js +1 -0
- package/dist/zonos-elements/{p-02d812c8.entry.js → p-d950b0b4.entry.js} +1 -1
- package/dist/zonos-elements/{p-5ae695a3.entry.js → p-db5f6b8c.entry.js} +1 -1
- package/dist/zonos-elements/{p-daeb57cb.entry.js → p-e056ae6b.entry.js} +1 -1
- package/dist/zonos-elements/{p-bce7bfcc.system.entry.js → p-e850e6e7.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-456a600b.entry.js → p-fb712719.entry.js} +1 -1
- package/dist/zonos-elements/zonos-elements.css +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/zonos-elements/p-1a470353.entry.js +0 -1
- package/dist/zonos-elements/p-27eeaf56.system.js +0 -1
- package/dist/zonos-elements/p-40a45837.system.entry.js +0 -1
- package/dist/zonos-elements/p-61d73d69.js +0 -1
- package/dist/zonos-elements/p-8ccd6d3f.js +0 -1
- package/dist/zonos-elements/p-a371f770.system.js +0 -1
- package/dist/zonos-elements/p-c7047a1c.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,o,t,n){function r(e){return e instanceof t?e:new t((function(o){o(e)}))}return new(t||(t=Promise))((function(t,i){function s(e){try{a(n.next(e))}catch(e){i(e)}}function c(e){try{a(n["throw"](e))}catch(e){i(e)}}function a(e){e.done?t(e.value):r(e.value).then(s,c)}a((n=n.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:[]},n,r,i,s;return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(e){return function(o){return a([e,o])}}function a(c){if(n)throw new TypeError("Generator is already executing.");while(s&&(s=0,c[0]&&(t=0)),t)try{if(n=1,r&&(i=c[0]&2?r["return"]:c[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,c[1])).done)return i;if(r=0,i)c=[c[0]&2,i.value];switch(c[0]){case 0:case 1:i=c;break;case 4:t.label++;return{value:c[1],done:false};case 5:t.label++;r=c[1];c=[0];continue;case 7:c=t.ops.pop();t.trys.pop();continue;default:if(!(i=t.trys,i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){t.label=c[1];break}if(c[0]===6&&t.label<i[1]){t.label=i[1];i=c;break}if(i&&t.label<i[2]){t.label=i[2];t.ops.push(c);break}if(i[2])t.ops.pop();t.trys.pop();continue}c=o.call(e,t)}catch(e){c=[6,e];r=0}finally{n=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,o,t){if(t||arguments.length===2)for(var n=0,r=o.length,i;n<r;n++){if(i||!(n in o)){if(!i)i=Array.prototype.slice.call(o,0,n);i[n]=o[n]}}return e.concat(i||Array.prototype.slice.call(o))};System.register(["./p-7261e245.system.js","./p-37207963.system.js","./p-a9425900.system.js","./p-06c4d422.system.js","./p-3689821f.system.js","./p-398d9022.system.js","./p-01174496.system.js","./p-0207c91e.system.js","./p-d938f42f.system.js","./p-40a4c8a2.system.js","./p-23e7c655.system.js","./p-bf37ccc7.system.js","./p-e5dfccd8.system.js","./p-eb99a625.system.js","./p-1aa93d1e.system.js","./p-2770ba48.system.js","./p-1bf9a1b9.system.js","./p-6a195559.system.js","./p-5e6f85f0.system.js"],(function(e){"use strict";var o,t,n,r,i,s,c,a,u,d,l,h,f,v,m,g,p,w,z,k,y,b,_,C,x,S,T,I,A,O,E,U,L,B,P,N,j,D,R,F,M,H,Z,G,K,V,Q,W,Y,q,J,X,$,ee,oe,te,ne,re,ie,se,ce,ae,ue,de,le,he,fe,ve,me,ge,pe,we,ze,ke,ye,be,_e;return{setters:[function(e){o=e.r;t=e.h;n=e.F;r=e.a},function(e){i=e.s;s=e.a;c=e.b;a=e.i;u=e.c;d=e.d;l=e.e;h=e.f;f=e.g;v=e.h;m=e.j;g=e.k;p=e.l;w=e.t;z=e.m;k=e.n;y=e.o;b=e.p;_=e.q;C=e.r;x=e.u;S=e.v;T=e.w;I=e.x;A=e.y;O=e.z;E=e.A;U=e.B;L=e.C;B=e.D;P=e.E;N=e.F},function(e){j=e.p;D=e.s;R=e.a;F=e.b},function(e){M=e.f;H=e.l;Z=e.a;G=e.g;K=e.s;V=e.V;Q=e.b;W=e.t;Y=e.c;q=e.d},function(e){J=e.z;X=e.g;$=e.m},function(e){ee=e.b},function(e){oe=e.h;te=e.l;ne=e.g;re=e.j;ie=e.b;se=e.s;ce=e.a;ae=e.i},function(e){ue=e.u},function(e){de=e.l;le=e.g;he=e.b},function(e){fe=e._;ve=e.c;me=e.a;ge=e.d;pe=e.g},function(e){we=e.c},function(e){ze=e.c},function(e){ke=e.g},function(e){ye=e.i},function(e){be=e.s},function(e){_e=e.R},function(){},function(){},function(){}],execute:function(){var Ce=this;var xe=function(){return __awaiter(Ce,void 0,void 0,(function(){var e,o,t;return __generator(this,(function(n){switch(n.label){case 0:return[4,oe("/api/zonos-elements/get-store-discount-enabled-status")];case 1:e=n.sent(),o=e.errors,t=e.json;if(o.length||!(t===null||t===void 0?void 0:t.enabled)){return[2,{enabled:false}]}return[2,{enabled:true}]}}))}))};var Se=function(e){return __awaiter(Ce,[e],void 0,(function(e){var o,t,n,r;var i=e.testKeys;return __generator(this,(function(e){switch(e.label){case 0:if(i.length===0){return[2,null]}return[4,oe("/api/zonos-elements/select-variance-test",{body:{testKeys:i},method:"POST"})];case 1:o=e.sent(),t=o.errors,n=o.json;if(t.length||!n){return[2,null]}r=M(n);return[2,r]}}))}))};var Te=function(e){var o=e.cartId,t=e.checkoutSessionId,n=e.customerAddress1,r=e.customerAddress2,i=e.customerCity,s=e.customerCountry,c=e.customerEmail,a=e.customerFirstName,u=e.customerLastName,d=e.customerPhone,l=e.customerState,h=e.customerZip,f=e.hostedCheckoutUrl,v=e.isTestMode,m=e.isVariantTest;var g=new URLSearchParams;g.set("tempCartUUID",o);if(a){g.set("customerFirstName",a)}if(u){g.set("customerLastName",u)}if(c){g.set("customerEmail",c)}if(d){g.set("customerPhone",d)}if(h){g.set("customerZip",h)}if(i){g.set("customerCity",i)}if(l){g.set("customerState",l)}if(s){g.set("zCountry",s)}if(n){g.set("customerAddress1",n)}if(r){g.set("customerAddress2",r)}if(v){g.set("zonosTestMode","1")}if(t){g.set("zonosCheckoutSessionId",t)}if(m){g.set("zonosVariantTest","1")}return"".concat(f,"?").concat(g.toString())};var Ie=function(){return __awaiter(Ce,void 0,void 0,(function(){var e,o,t,n,r;return __generator(this,(function(i){switch(i.label){case 0:i.trys.push([0,3,,4]);return[4,fetch("/api/storefront/cart",{credentials:"same-origin",headers:{Accept:"application/json"}})];case 1:t=i.sent();if(!t.ok){de("Failed to fetch BigCommerce cart: ".concat(String(t.status)),"error");return[2,null]}return[4,t.json()];case 2:n=i.sent();return[2,(o=(e=n===null||n===void 0?void 0:n[0])===null||e===void 0?void 0:e.id)!==null&&o!==void 0?o:null];case 3:r=i.sent();te("Error fetching BigCommerce cart data",r);return[2,null];case 4:return[2]}}))}))};var Ae=function(e){return __awaiter(Ce,void 0,void 0,(function(){var o,t;return __generator(this,(function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,fetch("/api/storefront/checkouts/".concat(e,"?include=customer.customerGroup,customer.addresses"),{credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}})];case 1:o=n.sent();if(!o.ok){de("Failed to fetch BigCommerce checkout: ".concat(String(o.status)),"error");return[2,null]}return[4,o.json()];case 2:return[2,n.sent()];case 3:t=n.sent();te("Error fetching BigCommerce checkout data",t);return[2,null];case 4:return[2]}}))}))};var Oe=function(e){var o;return!!((o=e===null||e===void 0?void 0:e.customer)===null||o===void 0?void 0:o.id)};var Ee="isInternationalCheckout";var Ue=function(){var e=new URLSearchParams;e.set(Ee,"true");var o=new URLSearchParams(window.location.search);var t=o.get("zonosQaUrl");if(t){e.set("zonosQaUrl",t)}var n=o.get("zonosQaUrlApi");if(n){e.set("zonosQaUrlApi",n)}if(ne()){e.set("zonosTestMode","1")}return"cart.php?".concat(e.toString())};var Le=function(e){var o=e===void 0?{}:e,t=o.action;var n=new URL("/login.php",window.location.origin);if(t){n.searchParams.set("action",t)}var r=new URLSearchParams(window.location.search);var i=r.get("zonosQaUrl");if(i){n.searchParams.set("zonosQaUrl",i)}var s=r.get("zonosQaUrlApi");if(s){n.searchParams.set("zonosQaUrlApi",s)}if(ne()){n.searchParams.set("zonosTestMode","1")}n.searchParams.set("from",Ue());return n.toString()};var Be=function(e){var o=new URL(e,window.location.origin);var t=new URLSearchParams(window.location.search).get("zonosQaUrl");if(t){o.searchParams.set("zonosQaUrl",t)}if(ne()){o.searchParams.set("zonosTestMode","1")}return o.toString()};var Pe={customerGroupId:null,shouldBypass:false};var Ne=function(e){return __awaiter(Ce,void 0,void 0,(function(){var o,t,n,r,i,s,c,a,u,d,l,h;return __generator(this,(function(f){switch(f.label){case 0:if(!window.Zonos.isBigCommerce){return[2,{conclusive:true,result:Pe}]}i=(o=J.genericSettings)===null||o===void 0?void 0:o.bigcommerceBypassCustomerGroupIds;if(!(i===null||i===void 0?void 0:i.length)){if(J.loadedConfig){return[2,{conclusive:true,result:Pe}]}return[2,{conclusive:false,result:Pe}]}if(!e)return[3,1];c=e.checkoutId;return[3,3];case 1:return[4,Ie()];case 2:c=f.sent();f.label=3;case 3:s=c;if(!s){de("BigCommerce bypass check: no active cart yet, will retry on next call","info");return[2,{conclusive:false,result:Pe}]}if(!e)return[3,4];u=e.checkout;return[3,6];case 4:return[4,Ae(s)];case 5:u=f.sent();f.label=6;case 6:a=u;if(!a){de("BigCommerce bypass check: failed to fetch checkout data, will retry","info");return[2,{conclusive:false,result:Pe}]}d=(r=(n=(t=a.customer)===null||t===void 0?void 0:t.customerGroup)===null||n===void 0?void 0:n.id)!==null&&r!==void 0?r:null;if(d===null){de("BigCommerce bypass check: no customer group found (guest user)","info");return[2,{conclusive:true,result:Pe}]}l=i.includes(d);h={customerGroupId:d,shouldBypass:l};if(l){de("BigCommerce bypass check: customer group ".concat(String(d)," is in bypass list; caller should keep the user on BC native checkout"),"info")}else{de("BigCommerce bypass check: customer group ".concat(String(d)," is not in bypass list"),"info")}return[2,{conclusive:true,result:h}]}}))}))};var je=null;var De=function(e){var o=Ne(e);var t=o.then((function(e){var o=e.conclusive,n=e.result;if(!o&&je===t){je=null}return n}));je=t;return t};var Re=function(){var e;if(!window.Zonos.isBigCommerce){return}var o=(e=J.genericSettings)===null||e===void 0?void 0:e.bigcommerceBypassCustomerGroupIds;if(!(o===null||o===void 0?void 0:o.length)){return}void De()};var Fe=function(){var e=[];for(var o=0;o<arguments.length;o++){e[o]=arguments[o]}return __awaiter(Ce,__spreadArray([],e,true),void 0,(function(e){if(e===void 0){e={}}return __generator(this,(function(o){if(e.forceRefresh||!je){return[2,De(e.preFetched)]}return[2,je]}))}))};var Me={guestCheckoutType:null};var He=60*60*1e3;var Ze="zonos--bc-checkout-settings";var Ge=function(e){try{var o=window.localStorage.getItem(Ze);if(!o){return null}var t=re(o);if(!t){return null}if(t.storeHash!==e){return null}if(t.expiresAt<Date.now()){return null}return{guestCheckoutType:t.guestCheckoutType}}catch(e){return null}};var Ke=function(e,o){try{var t={expiresAt:Date.now()+He,guestCheckoutType:o.guestCheckoutType,storeHash:e};window.localStorage.setItem(Ze,JSON.stringify(t))}catch(e){}};var Ve=function(){return __awaiter(Ce,void 0,void 0,(function(){var e,o,t,n,r,i,s;return __generator(this,(function(c){switch(c.label){case 0:if(!window.Zonos.isBigCommerce){return[2,Me]}o=(e=J.checkoutSettings.bigCommerceConfig)===null||e===void 0?void 0:e.storeHash;if(!o){de("BigCommerce checkout settings: no storeHash provided — skipping fetch","info");return[2,Me]}t=Ge(o);if(t){return[2,t]}return[4,oe("/api/bigcommerce/checkout-settings",{body:{storeHash:o},method:"POST"})];case 1:n=c.sent(),r=n.errors,i=n.json;if(r.length||!i){de("BigCommerce checkout settings: proxy call failed, falling back to guest-allowed behavior","info");return[2,Me]}s={guestCheckoutType:i.guestCheckoutType};Ke(o,s);return[2,s]}}))}))};var Qe={redirectUrl:null,shouldForceLogin:false};var We=null;var Ye=function(){if(!We){var e=Ve().then((function(o){var t=o.guestCheckoutType;if(!t){if(We===e){We=null}return false}return t==="no_guest_checkout"})).catch((function(){if(We===e){We=null}return false}));We=e}return We};var qe=function(){if(!window.Zonos.isBigCommerce){return}void Ye()};var Je=function(){var e=[];for(var o=0;o<arguments.length;o++){e[o]=arguments[o]}return __awaiter(Ce,__spreadArray([],e,true),void 0,(function(e){var o,t,n,r,i;var s=e===void 0?{}:e,c=s.preFetched;return __generator(this,(function(e){switch(e.label){case 0:if(!window.Zonos.isBigCommerce){return[2,Qe]}return[4,Ye()];case 1:o=e.sent();if(!o){return[2,Qe]}if(!c)return[3,2];n=c.checkoutId;return[3,4];case 2:return[4,Ie()];case 3:n=e.sent();e.label=4;case 4:t=n;if(!t){return[2,Qe]}if(!c)return[3,5];i=c.checkout;return[3,7];case 5:return[4,Ae(t)];case 6:i=e.sent();e.label=7;case 7:r=i;if(!r){de("BigCommerce force-login check: failed to fetch checkout data, allowing flow to continue","info");return[2,Qe]}if(Oe(r)){return[2,Qe]}de("BigCommerce force-login check: guest shopper on no-guest-checkout store, redirecting to /login.php","info");return[2,{redirectUrl:Le(),shouldForceLogin:true}]}}))}))};var Xe="data-zonos-login-from-rewritten";var $e='a[href*="login.php?action=create_account"]:not(['+Xe+"])";var eo=function(){var e=document.querySelectorAll($e);if(!e.length){return}var o=Le({action:"create_account"});e.forEach((function(e){e.setAttribute("href",o);e.setAttribute(Xe,"true")}))};var oo=function(){if(!window.Zonos.isBigCommerce){return}if(!window.location.pathname.includes("/login.php")){return}eo();var e=new MutationObserver((function(){eo()}));e.observe(document.body,{childList:true,subtree:true});setTimeout((function(){return e.disconnect()}),1e4)};var to=function(e,o){if(!e.address1||!e.countryCode){return null}var t=[e.firstName,e.lastName].filter(Boolean).join(" ").trim();return{address:{city:e.city||"",country:e.countryCode,line1:e.address1,line2:e.address2||"",postal_code:e.postalCode||"",state:e.stateOrProvinceCode||e.stateOrProvince||""},email:o,name:t,phone:e.phone||""}};var no=function(e){return[e.address.line1,e.address.line2||"",e.address.postal_code,e.address.country].join("|").toLowerCase()};var ro=function(e,o){var t,n,r,i;if(!((t=e===null||e===void 0?void 0:e.customer)===null||t===void 0?void 0:t.id)){return[]}var s=o.isShippable,c=o.selectedCountryCode;var a=e.customer.email||"";var u=(r=(n=e.consignments)===null||n===void 0?void 0:n.flatMap((function(e){return e.shippingAddress?[e.shippingAddress]:[]})))!==null&&r!==void 0?r:[];var d=(i=e.customer.addresses)!==null&&i!==void 0?i:[];var l=new Set;var h=[];for(var f=0,v=__spreadArray(__spreadArray([],d,true),u,true);f<v.length;f++){var m=v[f];var g=to(m,a);if(!g){continue}if(!s(g.address.country)){continue}var p=no(g);if(l.has(p)){continue}l.add(p);h.push(g)}if(!c){return h}return h.map((function(e,o){return{index:o,option:e}})).sort((function(e,o){var t=e.option.address.country===c;var n=o.option.address.country===c;if(t===n){return e.index-o.index}return t?-1:1})).map((function(e){return e.option}))};var io=function(e){if(e===void 0){e=true}if(!H.localizationLoaded){return true}if(H.isDisabledCountry){if(e){de("Checkout: disabled country")}return true}return false};var so=function(e,o){if(e===void 0){e=true}var t;if(!H.localizationLoaded){return false}if(o){var n=!!((t=H.shippingZoneCountries)===null||t===void 0?void 0:t[o])&&!J.disabledCountries.includes(o);if(e&&!n){de("Checkout: ".concat(o," is not a shippable country: ").concat(n))}return n}if(!H.isShippableCountry){if(e){de("Checkout: not shippable country")}return false}return true};var co='select[name="shippingAddress.countryCode"]';var ao=function(e){return __awaiter(Ce,[e],void 0,(function(e){var o,t,n,r,i,c,a,u,d,l,h,f,v,m,g,p,w,z;var k=e.onInternationalCheckoutSelected,y=e.onLoggedInInternationalAddressDetected;return __generator(this,(function(e){switch(e.label){case 0:return[4,Ie()];case 1:h=e.sent();if(!h){return[2,"noAction"]}return[4,Ae(h)];case 2:f=e.sent();v={checkout:f,checkoutId:h};return[4,Fe({preFetched:v})];case 3:m=e.sent().shouldBypass;if(m){return[2,"noAction"]}g=(t=(o=f===null||f===void 0?void 0:f.consignments)===null||o===void 0?void 0:o[0])===null||t===void 0?void 0:t.shippingAddress;if(!(g===null||g===void 0?void 0:g.countryCode)){return[2,"noAction"]}p=g.countryCode;if(!so(false,p)){return[2,"noAction"]}de(y?"Logged-in user has international shipping address: ".concat(p,", prompting user to choose checkout"):"Logged-in user has international shipping address: ".concat(p,", redirecting automatically (legacy behavior)"),"info");if(!y)return[3,5];return[4,y()];case 4:w=e.sent();if(w==="stay"){de("User opted to stay on BigCommerce native checkout despite international default address","info");return[2,"optedOut"]}e.label=5;case 5:return[4,Je({preFetched:v})];case 6:z=e.sent();if(z.shouldForceLogin&&z.redirectUrl){window.location.href=z.redirectUrl;return[2,"redirected"]}if(!k)return[3,8];return[4,k()];case 7:e.sent();e.label=8;case 8:Z({isInitializing:false,newSelectedCountryCode:p});s({address1:(n=g.address1)!==null&&n!==void 0?n:"",address2:(r=g.address2)!==null&&r!==void 0?r:"",city:(i=g.city)!==null&&i!==void 0?i:"",countryCode:p,firstName:(c=g.firstName)!==null&&c!==void 0?c:"",lastName:(a=g.lastName)!==null&&a!==void 0?a:"",phone:(u=g.phone)!==null&&u!==void 0?u:"",postalCode:(d=g.postalCode)!==null&&d!==void 0?d:"",state:(l=g.stateOrProvince)!==null&&l!==void 0?l:""});window.location.href=Be("/");return[2,"redirected"]}}))}))};var uo=function(e){var o=e.domesticRedirectedBtnSelector,t=e.onInternationalCheckoutSelected,n=e.onLoggedInInternationalAddressDetected,r=e.onShippingAddressSessionFound;if(!window.Zonos.isBigCommerce){return}var c=function(e){return __awaiter(Ce,void 0,void 0,(function(){var o,n,r,i,c,a,u,d,l,h;return __generator(this,(function(f){switch(f.label){case 0:n=document.querySelector(((o=J.genericSettings)===null||o===void 0?void 0:o.bigcommerceDomesticCheckoutCountrySelector)||co);r=(n===null||n===void 0?void 0:n.value)||e;if(!r){return[2,false]}if(!so(false,r)){return[2,false]}return[4,Ie()];case 1:i=f.sent();if(!i)return[3,3];return[4,Ae(i)];case 2:a=f.sent();return[3,4];case 3:a=null;f.label=4;case 4:c=a;u={checkout:c,checkoutId:i};return[4,Fe({forceRefresh:true,preFetched:u})];case 5:d=f.sent().shouldBypass;if(d){de("Bypass customer group detected on BC checkout, stopping interval","info");return[2,true]}return[4,Je({preFetched:u})];case 6:l=f.sent();if(l.shouldForceLogin&&l.redirectUrl){window.location.href=l.redirectUrl;return[2,true]}if(!t)return[3,8];return[4,t()];case 7:f.sent();f.label=8;case 8:Z({isInitializing:false,newSelectedCountryCode:r});h={address1:"",address2:"",city:"",countryCode:r,firstName:"",lastName:"",phone:"",postalCode:"",stateOrProvince:""};s({address1:h.address1,address2:h.address2,city:h.city,countryCode:h.countryCode,firstName:h.firstName,lastName:h.lastName,phone:h.phone,postalCode:h.postalCode,state:h.stateOrProvince});window.location.href=Be("/");return[2,true]}}))}))};var a=false;var u=false;var d=false;var l=false;var h=false;var f=new MutationObserver((function(){return __awaiter(Ce,void 0,void 0,(function(){var e,s,v,m,g,p,w,z,k,y;var b=this;return __generator(this,(function(_){switch(_.label){case 0:s=document.querySelector(o);v=i();if(!s&&v){m=document.createElement("button");m.style.display="none";m.id="zonos--domestic-redirected-checkout-button";document.body.appendChild(m);r===null||r===void 0?void 0:r(v);f.disconnect();return[2]}g=window.location.pathname.includes("/checkout")&&window.Zonos.isBigCommerce;if(!g){f.disconnect();return[2]}if(!(!l&&!d))return[3,5];d=true;h=true;_.label=1;case 1:_.trys.push([1,3,4,5]);return[4,ao({onInternationalCheckoutSelected:t,onLoggedInInternationalAddressDetected:n})];case 2:p=_.sent();if(p==="redirected"){f.disconnect();return[2]}if(p==="optedOut"){l=true}return[3,5];case 3:w=_.sent();te("Error checking logged-in user shipping address",w);return[3,5];case 4:d=false;h=false;return[7];case 5:z=document.querySelector(((e=J.genericSettings)===null||e===void 0?void 0:e.bigcommerceDomesticCheckoutCountrySelector)||co);if(!z){return[2]}de("Domestic checkout found - Listening for shipping country change","info",{value:z.value});if(u){return[2]}u=true;f.disconnect();k=setInterval((function(){return __awaiter(b,void 0,void 0,(function(){var e,o;return __generator(this,(function(t){switch(t.label){case 0:if(a||h){return[2]}a=true;t.label=1;case 1:t.trys.push([1,3,,4]);return[4,c()];case 2:e=t.sent();if(e){clearInterval(k);return[2]}a=false;return[3,4];case 3:o=t.sent();a=false;return[3,4];case 4:return[2]}}))}))}),1e3);y=setInterval((function(){var e;if(!window.bcStripeElements){clearInterval(y);return}var o=(e=window.bcStripeElements)===null||e===void 0?void 0:e.getElement("address");if(!o){return}clearInterval(y);o.on("change",(function(e){var o=e.value.address.country;if(o&&!h){void c(o)}}))}),500);return[2]}}))}))}));f.observe(document.body,{childList:true,subtree:true})};var lo=function(){var e=new URLSearchParams(window.location.search);de("legacy urlParams","info",Object.fromEntries(e.entries()));var o=function(o){var t=e.get(o);if(!t||t==="undefined"){return""}return t};var t=G(e)||H.selectedCountryCode||"US";var n=o("customerCity");var r=o("customerEmail");var i=o("customerAddress1");var s=o("customerAddress2");var c=o("customerName");var a=o("customerPhone");var u=o("customerZip");var d=o("customerState");var l=o("customerFirstName");var h=o("customerLastName");return{customerAddress1:i,customerAddress2:s,customerCity:n,customerCountry:t,customerEmail:r,customerFirstName:l,customerLastName:h,customerName:c,customerPhone:a,customerState:d,customerZip:u}};var ho=0;var fo=function(){return __awaiter(Ce,void 0,void 0,(function(){var e,o;var t;return __generator(this,(function(n){switch(n.label){case 0:if(window.Zonos.loadTimeApiInfoList.length===0){return[2]}de("Sending bulk load time api log","info",{loadTimeApiInfoList:window.Zonos.loadTimeApiInfoList});e={data:__spreadArray([],window.Zonos.loadTimeApiInfoList,true),storeId:window.Zonos.storeId||0};window.Zonos.loadTimeApiInfoList.length=0;return[4,oe("/api/zonos-elements/log-bulk-load-data",{body:e,method:"POST"})];case 1:o=n.sent().errors;if(o.length){(t=window.Zonos.loadTimeApiInfoList).push.apply(t,e.data);ho++;if(ho>5&&window.Zonos.logIntervalId){clearInterval(window.Zonos.logIntervalId)}}return[2]}}))}))};var vo=function(){return __awaiter(Ce,void 0,void 0,(function(){var e,o;return __generator(this,(function(t){e=le().elapsedTime;o={cache:"miss",eventName:"jsdelivr",flag:"LOG_CHECKOUT_FACADE_LOAD",href:window.location.href,loadTime:e,metadata:Object.assign({allLogs:he},ie()),scriptLoadUrl:"checkoutFacade",storeId:window.Zonos.storeId||0};void oe("/api/zonos-elements/log-script-load",{body:o,method:"POST"});return[2]}))}))};var mo=function(e){return __awaiter(Ce,[e],void 0,(function(e){var o;var t=e.loadTime;return __generator(this,(function(e){o={cache:"miss",eventName:"jsdelivr",flag:"LOG_NATIVE_CHECKOUT_LOAD",href:window.location.href,loadTime:t,metadata:Object.assign({allLogs:he},ie()),scriptLoadUrl:"nativeCheckout",storeId:window.Zonos.storeId||0};void oe("/api/zonos-elements/log-script-load",{body:o,method:"POST"});return[2]}))}))};var go=function(e){return(e===null||e===void 0?void 0:e.filter((function(e){if(e.expiresAt&&e.expiresAt<Date.now()||!e.expiresAt){return false}return true})))||[]};var po=function(e){var o;var t=(o=K.enabledVariantTestKeys)===null||o===void 0?void 0:o.find((function(o){return o.testKey===e}));return(t===null||t===void 0?void 0:t.selectedVariantKey)||null};var wo=function(e){return J.enabledVariantTestKeys.includes(e)};var zo=function(e){var o=e.baseTestObj,t=e.mergeTestObj;return o.map((function(e){var o=e.testKey;var n=t.find((function(e){var t=e.testKey;return t===o}));return{expiresAt:(n===null||n===void 0?void 0:n.expiresAt)||Date.now()+V,selectedVariantKey:(n===null||n===void 0?void 0:n.selectedVariantKey)||null,testKey:o}}))};var ko=function(e){return __awaiter(Ce,[e],void 0,(function(e){var o,t,n,r,i;var s=e.cartId,c=e.retries;return __generator(this,(function(e){switch(e.label){case 0:o=ne();return[4,oe("/api/zonos-elements/get-temp-cart",{body:{isTestMode:o,options:{noOnlineStoreSettings:true},tempCartUUID:s},headers:{"Content-Type":"application/json"},method:"POST"})];case 1:t=e.sent(),n=t.errors,r=t.json;i=!r||n.length;if(!(i&&c))return[3,3];de("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:c});return[4,new Promise((function(e){return setTimeout(e,500)}))];case 2:e.sent();return[2,ko({cartId:s,retries:c-1})];case 3:if(i){return[2,null]}return[2,r]}}))}))};var yo=function(e){return __awaiter(Ce,void 0,void 0,(function(){var o,t,n,r;return __generator(this,(function(i){switch(i.label){case 0:o=fe(e),t=o.isDgsCartId,n=o.isLegacyCartId;if(!n&&!t){te("[ZONOS - loadZonos] invalid cart id");return[2,null]}return[4,ko({cartId:e,retries:5})];case 1:r=i.sent();de("[ZONOS - loadZonos] getting temp cart data","info",r);if(!r){te("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process.");return[2,null]}window.Zonos.storeId=r.cartData.storeId;window.Zonos.zonosApiKey=r.cartData.credentialToken;return[2,{cartData:r.cartData,storeFavicon:r.storeFaviconUrl,storeId:r.cartData.storeId,storeLogo:r.storeLogoUrl,zonosApiKey:r.cartData.credentialToken}]}}))}))};var bo='<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 _o=".sc-zonos-checkout-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-checkout-h *.sc-zonos-checkout{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-checkout-h img.sc-zonos-checkout{max-width:100%}.sc-zonos-checkout-h dl.sc-zonos-checkout,.sc-zonos-checkout-h dd.sc-zonos-checkout,.sc-zonos-checkout-h h1.sc-zonos-checkout,.sc-zonos-checkout-h h2.sc-zonos-checkout,.sc-zonos-checkout-h h3.sc-zonos-checkout,.sc-zonos-checkout-h h4.sc-zonos-checkout,.sc-zonos-checkout-h h5.sc-zonos-checkout,.sc-zonos-checkout-h h6.sc-zonos-checkout,.sc-zonos-checkout-h hr.sc-zonos-checkout,.sc-zonos-checkout-h figure.sc-zonos-checkout,.sc-zonos-checkout-h p.sc-zonos-checkout,.sc-zonos-checkout-h pre.sc-zonos-checkout{margin:0}.sc-zonos-checkout-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-checkout-h{z-index:2147483647;position:fixed}.sc-zonos-checkout-h *.sc-zonos-checkout{-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar{width:10px}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{display:-ms-flexbox;display:flex;height:100%;overflow:hidden;border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10))}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{-ms-flex:1;flex:1;padding:32px}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout{background-color:var(--zonos--primary-color, var(--zonos-elements-gray-0));border-right:1px solid var(--zonos-elements-gray-200)}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{background-color:var(--zonos-elements-gray-0)}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{width:100%;max-height:100%;height:100%;overflow:auto;-ms-flex-direction:column;flex-direction:column;background-color:var(--zonos-elements-gray-0);-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:24px;padding-bottom:50px}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout .zonos--header.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;width:100%}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout .zonos--logo.sc-zonos-checkout{margin-bottom:0}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout zonos-checkout-finish.sc-zonos-checkout{-ms-flex:1;flex:1}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:relative}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{padding:0 8px 8px}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--payment-error-banner.sc-zonos-checkout{margin-top:24px}.sc-zonos-checkout-h .zonos--right.sc-zonos-checkout{position:relative}.sc-zonos-checkout-h .zonos--right.sc-zonos-checkout .zonos--right-actions.sc-zonos-checkout{position:absolute;right:24px;top:24px;z-index:2;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--wrapper.sc-zonos-checkout{overflow:auto;max-height:100%;position:relative}.sc-zonos-checkout-h .flex--wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;max-height:100%}.sc-zonos-checkout-h .zonos--logo-wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;gap:16px;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--logo-wrapper.sc-zonos-checkout>*.sc-zonos-checkout{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}.sc-zonos-checkout-h .zonos--logo.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--logo.sc-zonos-checkout img.sc-zonos-checkout{max-height:72px}.sc-zonos-checkout-h .zonos--checkout-default-message.sc-zonos-checkout{margin-left:76px;margin-bottom:8px}.zonos--close-button.sc-zonos-checkout{-ms-flex-item-align:start;align-self:flex-start}.preview.sc-zonos-checkout-h{min-width:500px;margin:auto;position:relative}.preview.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{border:var(--zonos-elements-border)}.preview.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{padding:32px}.hidden-mode.sc-zonos-checkout-h{height:0;opacity:0;pointer-events:none;position:absolute;visibility:hidden;width:0;z-index:-1}.mobile.sc-zonos-checkout-h{min-width:auto}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow:auto;border-radius:0;max-height:100%;height:100%;border:0}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{padding:12px;padding-bottom:76px}@media (max-width: 768px){.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{padding-bottom:0}}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout{-ms-flex-order:2;order:2;border-right:none}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{-ms-flex-order:1;order:1;padding-top:16px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border:var(--zonos-elements-border);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10));background-color:var(--zonos-elements-gray-50);padding:12px;margin-top:32px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--review.sc-zonos-checkout{margin-bottom:0}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--cart-items.sc-zonos-checkout{margin-top:8px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout zonos-checkout-footer.sc-zonos-checkout{-ms-flex-order:3;order:3}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{max-height:100%}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--footer.sc-zonos-checkout{-ms-flex-order:3;order:3}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{width:auto}.mobile.sc-zonos-checkout-h .zonos--cart-subtotal.sc-zonos-checkout{margin:0}.iframed.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{-ms-scroll-chaining:chained;overscroll-behavior:auto}.zonos--processing-payment.sc-zonos-checkout-h{z-index:2147483646}";var Co=_o;var xo=90*60*1e3;var So=6*60*60*1e3;var To=e("zonos_checkout",function(){function e(e){var t=this;o(this,e);this.storeUnsubscribeList=[];this.isRedirectAfterOrder=false;this.preview=false;this.hiddenMode=false;this.mobile=false;this.defaultAddress=[];this.forceDialogOpen=false;this.defaultAddressParams=[];this.defaultCustomerProfileAddress=[];this.customerProfile=null;this.open=this.forceDialogOpen;this.isOverlayLoading=false;this.stripe=window.Zonos.stripe;this.submitLoading=false;this.collapseReviewMobile=true;this.isAttachError=false;this.isMobile=false;this.isIframed=false;this.isLegacyCheckout=window.Zonos.isLegacyCheckout;this.confirmDialogOpen=false;this.isCartExpired=false;this.payInUsdConfirmDialogOpen=false;this.inventoryCheckErrorMessage=null;this.placedOrderInfo=null;this.shouldShowFedexShippingConsentDialog=false;this.detectedDomesticCheckoutDialogOpen=false;this.redirectToDomesticCheckoutDialogOpen=false;this.loggedInIntlAddressConfirmDialogOpen=false;this.loggedInIntlAddressResolver=null;this.clientSecret=c.clientSecret;this.stripeCustomerSessionClientSecret=c.stripeCustomerSessionClientSecret;this.applyStripeTheme=function(){return __awaiter(t,void 0,void 0,(function(){var e,o,t,n,r;return __generator(this,(function(i){switch(i.label){case 0:r=((e=this.appearanceSettingsOverride)===null||e===void 0?void 0:e.theme)||J.appearance.theme;return[4,a({overrideBorderRadius:(o=this.appearanceSettingsOverride)===null||o===void 0?void 0:o.style,overridePrimaryColor:(t=this.appearanceSettingsOverride)===null||t===void 0?void 0:t.colorPrimary,overrideSecondaryColor:(n=this.appearanceSettingsOverride)===null||n===void 0?void 0:n.colorSecondary,overrideTheme:this.isMobile?r:undefined,paypalEnabled:j()})];case 1:i.sent();return[2]}}))}))};this.checkStripePaymentIntentStatus=function(e){return __awaiter(t,[e],void 0,(function(e){var o,t,n,r,i,s,a,d,l;var h=e.triggeredButton;return __generator(this,(function(e){switch(e.label){case 0:o=h===null||h===void 0?void 0:h.matches("#".concat(ve));t=!!window.Zonos.cartData;n=new URL(window.location.href).searchParams;r=n.get("payment_intent_client_secret");i=n.get("zonosCheckoutSessionId");if(!o){de("Checkout is triggered by user, no need to check stripe payment intent status");return[2,{shouldAllowOrder:true}]}de("Payment intent exist, checking stripe payment intent status");if(!r){de("No stripe client secret found in the URL, proceed to order if cart data is available");return[2,{shouldAllowOrder:t}]}return[4,u({clientSecret:r})];case 1:s=e.sent(),a=s.error,d=s.status;l=new URLSearchParams(window.location.search).get("redirect_status");if(l){if(!a){de("Payment intent is succeeded or in a good state to move forward, show success screen")}else{de("Payment intent failed, show status from error")}this.open=true;K.checkoutSessionId=i;c.clientSecret=r;void this.setToFinishStep(d);return[2,{shouldAllowOrder:false}]}if(!t){de("Cart data is not available, only check payment intent status, skip order.");return[2,{shouldAllowOrder:false}]}de("Payment intent is not succeeded, proceed to order");return[2,{shouldAllowOrder:true}]}}))}))};this.initializeTestKeys=function(){K.enabledVariantTestKeys=go(K.enabledVariantTestKeys||[]);var e=J.enabledVariantTestKeys.map((function(e){var o;var t=(o=K.enabledVariantTestKeys)===null||o===void 0?void 0:o.find((function(o){var t=o.testKey;return t===e}));return{expiresAt:(t===null||t===void 0?void 0:t.expiresAt)||Date.now()+V,selectedVariantKey:(t===null||t===void 0?void 0:t.selectedVariantKey)||null,testKey:e}}));Q(e);return{allSelected:false}};this.shouldAllowHostedVsNativeTest=function(){if(typeof J.checkoutSettings.createCartId!=="function"){return false}var e=J.enabledVariantTestKeys.includes("hosted_vs_native");if(!e){return false}return true};this.registerTestHostedVsNative=function(){return __awaiter(t,void 0,void 0,(function(){var e,o,t,n;return __generator(this,(function(r){switch(r.label){case 0:e=this.shouldAllowHostedVsNativeTest();if(!e){return[2]}de("[TEST] - Registering hosted vs native test");o=po("hosted_vs_native");if(o){de("[TEST] - Hosted vs native test already has variant selected: ".concat(o));return[2]}return[4,Se({testKeys:["hosted_vs_native"]})];case 1:t=r.sent();if(!t){de("[TEST] - Failed to get selection for hosted vs native test");return[2]}n=zo({baseTestObj:K.enabledVariantTestKeys||[],mergeTestObj:t});Q(n);return[2]}}))}))};this.handleHostedVsNative=function(){return __awaiter(t,void 0,void 0,(function(){var e,o,t,n,r,i,s,c;return __generator(this,(function(a){switch(a.label){case 0:o=this.shouldAllowHostedVsNativeTest();if(!o){return[2,{redirected:false}]}t=po("hosted_vs_native");de("[TEST] - hosted_vs_native: ".concat(t));if(typeof J.checkoutSettings.createCartId!=="function"){de("[TEST] - createCartId is not provided, skipping hosted vs native test");return[2,{redirected:false}]}if(t!=="hosted"){de("[TEST] - Hosted vs native test is enabled for native, skipping");return[2,{redirected:false}]}if(!((e=J.genericSettings)===null||e===void 0?void 0:e.hostedCheckoutUrl)){de("[TEST] - Hosted checkout URL is not provided");return[2,{redirected:false}]}de('"createCartId" is provided, start building cart');return[4,J.checkoutSettings.createCartId()];case 1:n=a.sent();i=null;if(typeof n==="object"){r=n.cartId;i=n.shippingData||null}else{r=n}s=lo();c=Te(Object.assign(Object.assign({cartId:r,checkoutSessionId:K.checkoutSessionId||undefined,hostedCheckoutUrl:J.genericSettings.hostedCheckoutUrl,isTestMode:ne(),isVariantTest:true},s),i));de("[TEST] - Redirecting to: ".concat(c));window.open(c,"_blank");return[2,{redirected:true}]}}))}))};this.formatDate=function(e){if(!e){return""}var o=new Date(e);return o.toLocaleDateString()};this.formatTime=function(e){if(!e){return""}var o=new Date(e);return o.toLocaleTimeString()};this.getCurrentLocalePageEnum=function(){switch(d.step){case"customer-info":return"checkout_customer_info";case"shipping":return"checkout_shipping_info";case"payment":return"checkout_payment_info";default:return null}};this.getBaseCurrencySettlementInfo=function(){var e=d.selectedLandedCost;if(!e){return null}var o=e.landedCost.amountSubtotals;if(!o){return null}var t=(o.discounts||0)+o.items+o.landedCostTotal+o.shipping;return{settlementAmount:t}};this.prefillBigCommerceCustomerAddresses=function(){return __awaiter(t,void 0,void 0,(function(){var e,o,t,n;return __generator(this,(function(r){switch(r.label){case 0:if(!window.Zonos.isBigCommerce){return[2]}if(this.defaultCustomerProfileAddress.length){return[2]}e=Array.isArray(this.defaultAddress)&&this.defaultAddress.length>0||!Array.isArray(this.defaultAddress)&&typeof this.defaultAddress==="object"&&this.defaultAddress!==null;if(e){return[2]}return[4,Ie()];case 1:o=r.sent();if(!o){return[2]}return[4,Ae(o)];case 2:t=r.sent();if(!Oe(t)){return[2]}n=ro(t,{isShippable:function(e){return so(false,e)},selectedCountryCode:H.selectedCountryCode||undefined});if(!n.length){return[2]}if(this.defaultCustomerProfileAddress.length){return[2]}this.defaultCustomerProfileAddress=n;de("Prefilled ".concat(String(n.length)," BigCommerce customer address(es) for logged-in shopper"),"info");return[2]}}))}))};this.getDefaultAddress=function(){if(t.defaultCustomerProfileAddress.length){return t.defaultCustomerProfileAddress}if(Array.isArray(t.defaultAddress)&&t.defaultAddress.length){return t.defaultAddress}if(!Array.isArray(t.defaultAddress)&&typeof t.defaultAddress==="object"){return[t.defaultAddress]}return t.defaultAddressParams};this.handleHostedOpenWindowCallback=function(e){var o;var t=(o=J.genericSettings)===null||o===void 0?void 0:o.hostedCheckoutUrl;if(!origin){return}var n=["dev.checkout.elements.zonos.com"].some((function(o){return e.origin.includes(o)}));if(e.origin!==t&&!n){return}switch(e.data.type){case"zonos-checkout-session-update":K.checkoutSessionId=e.data.checkoutSessionId;break}};this.captureParamsRedirectedForVariantTest=function(){var e=new URL(window.location.href);var o=e.searchParams.get("zonosVariantTest")==="1";if(!o){return}var t=e.searchParams.get("zonosCheckoutSessionId");if(t){K.checkoutSessionId=t}var n=K.enabledVariantTestKeys||[];if(window.Zonos.isLegacyCheckout){var r=po("hosted_vs_native");if(!r){n.push({expiresAt:Date.now()+V,selectedVariantKey:"hosted",testKey:"hosted_vs_native"});Q(n)}else{Q(n.map((function(e){if(e.testKey==="hosted_vs_native"){return Object.assign(Object.assign({},e),{selectedVariantKey:"hosted"})}return e})))}}e.searchParams.delete("zonosCheckoutSessionId");e.searchParams.delete("zonosVariantTest");window.history.replaceState({},"",e.toString())}}e.prototype.initCartInfoHandler=function(e){return __awaiter(this,void 0,void 0,(function(){var o;return __generator(this,(function(t){o=e.detail;void l({adjustments:d.adjustments,cartItems:o});return[2]}))}))};e.prototype.handleKeyPress=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){if(e.key==="Escape"){void this.closeDialogHandler()}return[2]}))}))};e.prototype.closeDialogHandler=function(e){return __awaiter(this,void 0,void 0,(function(){var o,t;return __generator(this,(function(n){if(!this.open){return[2]}if(!(e===null||e===void 0?void 0:e.confirmed)){this.confirmDialogOpen=true;return[2]}this.confirmDialogOpen=false;D({event:"zonos-checkout-close",metadata:{checkoutSessionId:K.checkoutSessionId}});this.open=this.forceDialogOpen||false;if(!this.preview&&d.step==="finish"){h()}d.step="customer-info";f();v();(t=(o=J.checkoutSettings).onClose)===null||t===void 0?void 0:t.call(o);return[2]}))}))};e.prototype.buildCartAndInit=function(){return __awaiter(this,void 0,void 0,(function(){var e,o,t,n,r,i,s,c,i,s,s,a,u,i,h,f,v,p;return __generator(this,(function(w){switch(w.label){case 0:if(!(typeof J.checkoutSettings.createCartId==="function"))return[3,4];de('"createCartId" is provided, start building cart');d.customMessage=[];return[4,J.checkoutSettings.createCartId()];case 1:e=w.sent();o=void 0;if(typeof e==="object"){de("object detected, use cartId and prefill address from createCartId","info",e);o=e.cartId;this.useShippingDataFromCreateCartId(e.shippingData);d.customerAuthenticationToken=e.customerAuthenticationToken||null;d.customMessage=Array.isArray(e.customMessage)?e.customMessage.filter((function(e){return typeof e==="string"})):[]}else{o=e}window.Zonos.cartId=o;return[4,yo(o)];case 2:t=w.sent();n=t===null||t===void 0?void 0:t.cartData;if(!n){te("Failed to build cart, please try again.");return[2,false]}window.Zonos.cartData=n;r=ee(n),i=r.adjustments,s=r.cartItems;return[4,l({adjustments:i,cartItems:s})];case 3:w.sent();return[3,9];case 4:if(!window.Zonos.cartData)return[3,6];de("tempCartUUID is provided, start building cart");c=ee(window.Zonos.cartData),i=c.adjustments,s=c.cartItems;return[4,l({adjustments:i,cartItems:s})];case 5:w.sent();return[3,9];case 6:if(!(J.checkoutSettings.buildCartDetail&&H.selectedCountryCode))return[3,9];de("build cart detail");return[4,J.checkoutSettings.buildCartDetail({countryCode:H.selectedCountryCode,currencyCode:H.targetCurrency})];case 7:s=w.sent();a=s.filter((function(e){return e.amount>=0}));u=s.filter((function(e){return e.amount<0}));de("cartItems","info",{cartItems:s});i=u.map((function(e){return{amount:e.amount,currencyCode:e.currencyCode,description:e.name||e.description||"",productId:e.productId||null,sku:e.sku||null,type:"CART_TOTAL"}}));return[4,l({adjustments:i,cartItems:a})];case 8:w.sent();w.label=9;case 9:if(!!K.checkoutSessionId)return[3,11];return[4,m()];case 10:h=w.sent();de("stripeStoreInitCheckoutSession: ".concat(h));if(!h){return[2,false]}w.label=11;case 11:if(!d.isStagingMode){void g()}return[4,this.applyStripeTheme()];case 12:w.sent();f=J.checkoutSettings,v=f.successBehavior,p=f.successRedirectUrl;this.isRedirectAfterOrder=v==="REDIRECT_TO_SUCCESS_PAGE"||v==="CLOSE_MODAL"&&!!p||!!d.externalConfirmationPageURL;return[2,true]}}))}))};e.prototype.reloadCheckoutSession=function(){window.location.reload()};e.prototype.handleOrderDuplication=function(){var e=re(localStorage.getItem("zonos--placed-order-info"));if(!e){localStorage.removeItem("zonos--placed-order-info");return}var o=Date.now()-e.time;de("=== Existing placed order info: ".concat(e.orderId," - ").concat(this.formatDate(e.time)," - elapsed in hh:ss format: ").concat(new Date(o).toISOString().substring(11,8)),"warn");var t=parseFloat(new URLSearchParams(window.location.search).get("zonosOverrideExpiredDuplication")||"0")||So;if(o>t){de("=== Existing placed order info is older than ".concat(t,"ms, cleaning localStorage"),"warn");localStorage.removeItem("zonos--placed-order-info");return}this.placedOrderInfo=e;de("=== Showing order duplication confirmation","warn")};e.prototype.recordCheckoutInfo=function(){if(!K.checkoutSessionId){return}void ue({attributes:[{key:"APP_VERSION",value:window.Zonos.version},{key:"APP_VERSION_NPM_INTEGRATION",value:window.Zonos.isNpm?"1":"0"},{key:"LEGACY_CHECKOUT_FACADE",value:window.Zonos.isLegacyCheckout?"1":"0"}],checkoutSessionId:K.checkoutSessionId})};e.prototype.confirmProceedWithOrderDuplication=function(){this.placedOrderInfo=null;if(!K.checkoutSessionId){return}void ue({attributes:[{key:"ORDER_DUPLICATION_CONSENT",value:"1"}],checkoutSessionId:K.checkoutSessionId})};e.prototype.markTheSessionAsAbandonedCart=function(){if(!K.checkoutSessionId){return}void ue({attributes:[{key:"WITH_ABANDONED_CART_TOKEN",value:"1"}],checkoutSessionId:K.checkoutSessionId})};e.prototype.handleCancelOrderDuplication=function(){var e;this.placedOrderInfo=null;if(this.isLegacyCheckout){var o=((e=window.Zonos.cartData)===null||e===void 0?void 0:e.storeBaseUrl)||J.onlineStoreSettings.url;if(!o){return}if(window.parent){window.parent.location.href=o}window.location.href=o;return}void this.closeDialogHandler({confirmed:true})};e.prototype.attachCheckout=function(){var e=this;var o=J.checkoutSettings.placeOrderButtonSelector;var t=J.checkoutSettings.alwaysTriggerInternationalCheckoutSelector;var n=!!document.querySelector("#".concat(ve));de("attach checkout ".concat(o));de("attach checkout to always trigger international checkout selector: ".concat(t));if(!o&&!t&&!window.Zonos.cartData&&!n){return}var r=[o,t,"#".concat(ge),"#".concat(ve),"#".concat(me)].filter(Boolean);var i=document.querySelectorAll(r.join(","));i.forEach((function(n){var r=n.getAttribute("data-zonos-checkout-attached");if(r){return}de("attached event to button ".concat(o),"info",{button:n});n.addEventListener("click",(function(o){return __awaiter(e,void 0,void 0,(function(){var e,r,i,s,a,u,l,h,f,v,m,g,y,b,_,C,x,S;return __generator(this,(function(T){switch(T.label){case 0:i=performance.now();s=t&&n.matches(t);a=n.matches("#".concat(me));u=n.matches("#".concat(ge))||n.matches("#".concat(ve));if(!window.Zonos.isLegacyCheckout&&(!so()||io())&&!s&&!a&&!u){return[2]}o.preventDefault();o.stopPropagation();de("zonos checkout button clicked");return[4,this.checkStripePaymentIntentStatus({triggeredButton:o.target})];case 1:l=T.sent().shouldAllowOrder;if(!l){return[2]}if(!window.Zonos.logIntervalId){window.Zonos.logIntervalId=setInterval((function(){void fo()}),2e3)}if(!wo("hosted_vs_native"))return[3,4];this.isOverlayLoading=true;return[4,this.registerTestHostedVsNative()];case 2:T.sent();return[4,this.handleHostedVsNative()];case 3:h=T.sent().redirected;this.isOverlayLoading=false;if(h){return[2]}T.label=4;case 4:if(!window.Zonos.isBigCommerce)return[3,7];return[4,Fe()];case 5:f=T.sent().shouldBypass;if(f){de("Bypass customer group detected, redirecting to BigCommerce native checkout","info");window.location.href=Be("/checkout");return[2]}return[4,Je()];case 6:v=T.sent();if(v.shouldForceLogin&&v.redirectUrl){window.location.href=v.redirectUrl;return[2]}T.label=7;case 7:c.isFetchingSession=true;this.open=true;T.label=8;case 8:T.trys.push([8,11,,12]);return[4,this.buildCartAndInit()];case 9:m=T.sent();if(!m){throw new Error("Error building cart")}(e=window.opener)===null||e===void 0?void 0:e.postMessage({checkoutSessionId:K.checkoutSessionId,type:"zonos-checkout-session-update"},"*");p({isPreview:this.preview,sessionTimeout:xo});D({event:"zonos-checkout-start",metadata:{checkoutSessionId:K.checkoutSessionId}});g=K.checkoutSessionId;void w({checkoutSessionId:g,eventName:"checkout_open"});return[4,xe()];case 10:y=T.sent().enabled;d.shouldHideDiscountInput=!y;this.handleOrderDuplication();if(window.Zonos.isLegacyCheckout){void vo()}else{b=performance.now();_=b-i;void mo({loadTime:_})}this.recordCheckoutInfo();C=!!pe();if(C){this.markTheSessionAsAbandonedCart()}return[3,12];case 11:x=T.sent();if(x instanceof Error){S=x.message;if(S==="Cart is expired."){this.isCartExpired=true}}c.isFetchingSession=false;te(x);if(this.isCartExpired){c.isFetchingSession=true;return[2]}void se({endpoint:"Error creating Checkout",errors:[x instanceof Error?x.toString():"Unknown error"],metadata:{allLogs:he,cartId:window.Zonos.cartId,checkoutSessionBody:z(),href:window.location.href,storeBaseUrl:((r=window.Zonos.cartData)===null||r===void 0?void 0:r.storeBaseUrl)||J.onlineStoreSettings.url}});k({messages:[W("There's been an error creating your checkout session. Please reload and try again or contact support if the error persists")],title:W("Error creating Checkout")});return[3,12];case 12:return[2]}}))}))}),{capture:true,passive:false});if(!J.checkoutSettings.disablePlaceOrderButtonActivation){n.removeAttribute("disabled")}n.setAttribute("data-zonos-checkout-attached","true");if(n.matches("#".concat(ge))){n.dispatchEvent(ze("click"));y();n.remove()}if(n.matches("#".concat(ve))){n.dispatchEvent(ze("click"));n.remove()}}))};e.prototype.appearanceSettingsOverrideChanged=function(){if(!this.appearanceSettingsOverride){return}void this.applyStripeTheme()};e.prototype.useShippingDataFromCreateCartId=function(e){if(!e){return}de("shipping data from createCartId result","info",Object.entries(e));var o=e.customerAddress1,t=e.customerAddress2,n=e.customerCity,r=e.customerCountry,i=e.customerEmail,s=e.customerFirstName,c=e.customerLastName,a=e.customerName,u=e.customerPhone,d=e.customerState,l=e.customerZip;var h=new URLSearchParams(window.location.search);var f=r||G(h)||H.selectedCountryCode;this.applyPrefillAddress({customerAddress1:o,customerAddress2:t,customerCity:n,customerCountry:f,customerEmail:i,customerFirstName:s,customerLastName:c,customerName:a,customerPhone:u,customerState:d,customerZip:l})};e.prototype.useLegacyQueryParams=function(){var e=new URLSearchParams(window.location.search);de("legacy urlParams","info",Object.fromEntries(e.entries()));var o=function(o){var t=e.get(o);if(!t||t==="undefined"){return null}return t};var t=G(e)||H.selectedCountryCode;var n=o("customerCity");var r=o("customerEmail");var i=o("customerAddress1");var s=o("customerAddress2");var c=o("customerName");var a=o("customerFirstName");var u=o("customerLastName");var d=o("customerPhone");var l=o("customerZip");var h=o("customerState");this.applyPrefillAddress({customerAddress1:i,customerAddress2:s,customerCity:n,customerCountry:t,customerEmail:r,customerFirstName:a,customerLastName:u,customerName:c,customerPhone:d,customerState:h,customerZip:l})};e.prototype.applyPrefillAddress=function(e){var o=e.customerAddress1||"";var t=e.customerCountry||"";var n=e.customerAddress2||"";var r=e.customerCity||"";var i=e.customerEmail||"";var s=e.customerFirstName&&e.customerLastName?"".concat(e.customerFirstName," ").concat(e.customerLastName):e.customerName||"";var c=e.customerPhone||"";var a=e.customerZip||"";var u=e.customerState||"";if(!o||!s||!c||!t){de("Missing required query params so it can not be prefilled","info",[!o&&"line1",!s&&"name",!c&&"phone",!t&&"country"].filter(Boolean).join(", "));return}if(t&&H.shippingZoneCountries&&!(t in H.shippingZoneCountries)){de('Country "'.concat(t,'" is not in the shipping zone, so it can not be prefilled'),"warn");return}this.defaultAddressParams=[{address:{city:r||"",country:t,line1:o,line2:n,postal_code:a,state:u},email:i,name:s,phone:c}];de("Prefill address applied","info",{prefillAddress:this.defaultAddressParams,providedAddress:e})};e.prototype.overrideStagingModeChanged=function(){d.isStagingMode=!!this.overrideStagingMode};e.prototype.init=function(){return __awaiter(this,void 0,void 0,(function(){var e;var o=this;return __generator(this,(function(t){c.stripe=window.Zonos.stripe;this.stripe=window.Zonos.stripe;d.isStagingMode=ce();if(typeof this.overrideStagingMode!=="undefined"){d.isStagingMode=this.overrideStagingMode}Re();qe();oo();this.handleBigcommerceInternationalResumeFlag();void this.prefillBigCommerceCustomerAddresses();uo({domesticRedirectedBtnSelector:ge,onInternationalCheckoutSelected:function(){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:this.detectedDomesticCheckoutDialogOpen=true;return[4,new Promise((function(e){return setTimeout(e,2e3)}))];case 1:e.sent();return[2]}}))}))},onLoggedInInternationalAddressDetected:function(){return new Promise((function(e){o.loggedInIntlAddressResolver=e;o.loggedInIntlAddressConfirmDialogOpen=true}))},onShippingAddressSessionFound:function(e){o.defaultAddress=[{address:{city:e.city,country:e.countryCode,line1:e.address1,line2:e.address2,postal_code:e.postalCode,state:e.state},email:"",name:"".concat(e.firstName," ").concat(e.lastName),phone:e.phone}]}});if(window.Zonos){this.useLegacyQueryParams()}e=setInterval((function(){c.stripe=window.Zonos.stripe;o.stripe=window.Zonos.stripe;if(!o.stripe){de("waiting for stripe to be loaded");return}if(o.storybookPaymentStatusOverride){clearInterval(e);return}de("init checkout");if(o.preview||o.forceDialogOpen){void o.buildCartAndInit()}else if(window.Zonos.isLegacyCheckout){o.attachCheckout()}else if(window){o.attachCheckout();var t=new MutationObserver((function(){o.attachCheckout()}));t.observe(document.body,{childList:true,subtree:true})}clearInterval(e)}),50);setTimeout((function(){clearInterval(e)}),1e4);return[2]}))}))};e.prototype.handleBigcommerceInternationalResumeFlag=function(){if(!window.Zonos.isBigCommerce){return}var e=new URL(window.location.href);if(e.searchParams.get(Ee)!=="true"){return}e.searchParams.delete(Ee);window.history.replaceState({},"",e.toString());var o=Date.now();var t=setInterval((function(){if(!H.localizationLoaded||!H.selectedCountryCode){if(Date.now()-o>15e3){clearInterval(t);de("BigCommerce international checkout resume flag: localization did not initialize within 15s","info")}return}var e=document.querySelector("#".concat(me));if(e){clearInterval(t);e.dispatchEvent(ze("click"));return}if(Date.now()-o>15e3){clearInterval(t);de("BigCommerce international checkout resume flag: trigger button did not mount within 15s","info")}}),200)};e.prototype.setToFinishStep=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){d.step="finish";this.storybookPaymentStatusOverride=e;return[2]}))}))};e.prototype.mockCheckoutSession=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){b(e);return[2]}))}))};e.prototype.triggerCheckoutInternational=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(o){e=document.querySelector("#".concat(me));if(e){e.dispatchEvent(ze("click"))}return[2]}))}))};e.prototype.handleCustomerInfoContinue=function(){return __awaiter(this,void 0,void 0,(function(){var e,o,t,n,r,i,s,a;var u=this;return __generator(this,(function(l){switch(l.label){case 0:D({event:"zonos-checkout-customer-info",metadata:{checkoutSessionId:K.checkoutSessionId}});r=K.checkoutSessionId;void w({checkoutSessionId:r,eventName:"checkout_customerInfoCompleted"});this.submitLoading=true;return[4,_()];case 1:i=l.sent().isRequestNotReady;if(i&&d.addressFormRenderType==="stripe"){void se({endpoint:"ADDRESS_NOT_READY_AT_CUSTOMER_INFO_CONTINUE",errors:["Address not ready at customer info continue"],metadata:{address:(o=(e=c.stripeAddressEventData)===null||e===void 0?void 0:e.value)===null||o===void 0?void 0:o.address,billingAddress:(n=(t=c.stripeBillingAddressEventData)===null||t===void 0?void 0:t.value)===null||n===void 0?void 0:n.address,cartId:window.Zonos.cartId}})}s=function(e){if(d.step!=="customer-info"){clearInterval(e);return}if(!c.isFetchingLandedCost){if(d.landedCostData){void F({currency:d.currency});C()}u.submitLoading=false;if(e){clearInterval(e)}}};s();a=setInterval((function(){s(a)}),20);setTimeout((function(){clearInterval(a)}),1e4);return[2]}}))}))};e.prototype.handleShippingContinue=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){C();return[2]}))}))};e.prototype.handleInventoryCheckDialogConfirm=function(){d.inventoryCheckErrorMessage=null;if(!this.isLegacyCheckout){void this.closeDialogHandler({confirmed:true})}};e.prototype.handleCartExpiredDialogConfirm=function(){var e;this.isCartExpired=false;if(this.isLegacyCheckout){var o=(e=window.Zonos.cartData)===null||e===void 0?void 0:e.storeBaseUrl;if(!o){return}if(window.parent){window.parent.location.href=o}window.location.href=o;return}if(window.parent){window.parent.location.href=window.location.href}window.location.reload()};e.prototype.handleStripePaymentContinue=function(){return __awaiter(this,void 0,void 0,(function(){var e,o,t,n,r,i,s,a,u,l;return __generator(this,(function(h){switch(h.label){case 0:e=c.checkoutSettlementCurrency==="USD";if(e&&c.shouldRenderPayInUsdButton&&!this.payInUsdConfirmDialogOpen){this.payInUsdConfirmDialogOpen=true;return[2]}this.payInUsdConfirmDialogOpen=false;R.paypalErrorMessage=null;c.hasPaymentError=false;this.submitLoading=true;d.inventoryCheckErrorMessage=null;return[4,x()];case 1:o=h.sent();if(!o){c.hasPaymentError=true;c.customErrorMessage=W("Unable to complete payment in [currency]. Please try again or select a different currency. If the issue persists, contact our support team for assistance.",{currency:c.checkoutSettlementCurrency});this.submitLoading=false;return[2]}h.label=2;case 2:h.trys.push([2,4,,5]);t=d;return[4,S()];case 3:t.inventoryCheckErrorMessage=h.sent();return[3,5];case 4:n=h.sent();d.inventoryCheckErrorMessage=W("Unable to check inventory. Please try again.");return[3,5];case 5:if(d.inventoryCheckErrorMessage){this.submitLoading=false;return[2]}r=N();if(!(r>0))return[3,7];return[4,T()];case 6:i=h.sent();if(!i.success){c.hasPaymentError=true;c.customErrorMessage=i.error||W("Unable to apply store credit. Please try again.");this.submitLoading=false;return[2]}h.label=7;case 7:if(!I())return[3,13];h.label=8;case 8:h.trys.push([8,11,,12]);return[4,A()];case 9:s=h.sent();if(!s.valid){c.hasPaymentError=true;c.customErrorMessage=s.errorMessage;this.submitLoading=false;return[2]}return[4,O()];case 10:a=h.sent();if(!a.success){c.hasPaymentError=true;c.customErrorMessage=a.error||W("Unable to place order with store credit. Please try again.");this.submitLoading=false;return[2]}C();v();return[3,12];case 11:u=h.sent();te(u);D({event:"zonos-checkout-payment-fail",metadata:{checkoutSessionId:K.checkoutSessionId}});c.hasPaymentError=true;return[3,12];case 12:this.submitLoading=false;return[2];case 13:h.trys.push([13,15,,16]);return[4,E()];case 14:h.sent();C();v();return[3,16];case 15:l=h.sent();te(l);D({event:"zonos-checkout-payment-fail",metadata:{checkoutSessionId:K.checkoutSessionId}});c.hasPaymentError=true;if(c.shouldInventoryRefund){void U();c.shouldInventoryRefund=false}return[3,16];case 16:this.submitLoading=false;return[2]}}))}))};e.prototype.handleFinishClick=function(){return __awaiter(this,void 0,void 0,(function(){var e,o,t,n;return __generator(this,(function(r){switch(r.label){case 0:L();if(!this.preview)return[3,2];d.step="customer-info";return[4,this.init()];case 1:r.sent();return[2];case 2:h();if(window.Zonos.isLegacyCheckout&&window.Zonos.cartData){e=window.Zonos.cartData.storeBaseUrl||J.onlineStoreSettings.url;if(window.parent){window.parent.location.href=e}window.location.href=e;return[2]}o=window.location.href;t=o.split("?")[0];this.open=false;n=window.location.hostname.includes("dashboard.zonos.com");if(!n){window.history.replaceState(window.history.state,document.title,t);window.location.reload()}return[2]}}))}))};e.prototype.handleWindowResize=function(){this.isMobile=ae(this.mobile);void this.applyStripeTheme();de("mobile: ".concat(this.isMobile))};e.prototype.handleMobileChange=function(){this.isMobile=ae(this.mobile);void this.applyStripeTheme();de("mobile: ".concat(this.isMobile))};e.prototype.handleAppearanceSettingsOverrideChange=function(){var e;if((e=this.appearanceSettingsOverride)===null||e===void 0?void 0:e.theme){this.appearanceSettingsOverride.theme=X(this.appearanceSettingsOverride.theme)}};e.prototype.handleAddressChange=function(){L()};e.prototype.handleCustomerProfileChange=function(){var e,o;if(!this.customerProfile){de("No customer profile","info");this.defaultCustomerProfileAddress=[];return}de("Customer profile found","info",{customerProfile:this.customerProfile});this.defaultCustomerProfileAddress=((o=(e=c.customerProfile)===null||e===void 0?void 0:e.locations)===null||o===void 0?void 0:o.map((function(e){var o;return{address:{city:e.locality,country:e.countryCode,line1:e.line1,line2:e.line2||"",postal_code:e.postalCode,state:e.administrativeArea},email:e.email||((o=c.customerProfile)===null||o===void 0?void 0:o.email)||"",name:e.name||"",phone:e.phone||""}})))||[]};e.prototype.handleClientSecretChange=function(){de("==== Client secret changed","info",{clientSecret:this.clientSecret,stripeCustomerSessionClientSecret:this.stripeCustomerSessionClientSecret});void this.applyStripeTheme()};e.prototype.handleOpenChange=function(){var e="data-zonos-overflow-origin";var o=document.body;var t=document.documentElement;if(this.open){window.Zonos.openHelloDialog(false);if(o.style.overflow){o.setAttribute(e,o.style.overflow)}o.style.overflow="hidden";if(t.style.overflow){t.setAttribute(e,t.style.overflow)}t.style.overflow="hidden"}else{this.stripeCustomerSessionClientSecret=null;var n=o.getAttribute(e);var r=t.getAttribute(e);if(n){o.removeAttribute(e);o.style.overflow=n}else{o.style.removeProperty("overflow")}if(r){t.removeAttribute(e);t.style.overflow=r}else{t.style.removeProperty("overflow")}}};e.prototype.componentWillLoad=function(){var e=this;void this.init();this.isMobile=ae(this.mobile);this.isIframed=window.self!==window.top;de("iframed: ".concat(this.isIframed));if(window.Zonos.isLegacyCheckout){this.captureParamsRedirectedForVariantTest()}this.handleAppearanceSettingsOverrideChange();this.storeUnsubscribeList=[Y("selectedLocale",(function(){void e.applyStripeTheme()})),B("selectedShippingOption",(function(){var o,t,n,r;var i=d.selectedShippingOption;if(((o=J.genericSettings)===null||o===void 0?void 0:o.shouldFedExShippingConsentForCanadianShopper)&&((n=(t=i===null||i===void 0?void 0:i.shippingProfile)===null||t===void 0?void 0:t.serviceLevel.code)===null||n===void 0?void 0:n.toLowerCase().startsWith("fedex."))&&((r=c.stripeAddressEventData)===null||r===void 0?void 0:r.value.address.country)==="CA"){e.shouldShowFedexShippingConsentDialog=true}})),P("stripeAddressEventData",(function(o){var t;if(!window.Zonos.isBigCommerce||!o||e.redirectToDomesticCheckoutDialogOpen||!((t=J.genericSettings)===null||t===void 0?void 0:t.isBigcommerceDomesticCheckoutRedirectEnabled)||J.sourceCurrency!=="USD"){return}if(!e.open){return}if(window.location.pathname.includes("/checkout")){return}var n=o.value.address.country;if(n&&J.disabledCountries.includes(n)){e.redirectToDomesticCheckoutDialogOpen=true;de("Domestic country ".concat(n," selected in international checkout, redirecting to BigCommerce domestic checkout"),"info");setTimeout((function(){window.location.href=Be("/checkout")}),2e3)}}))];this.initializeTestKeys();window.addEventListener("message",this.handleHostedOpenWindowCallback);de("mobile: ".concat(this.isMobile))};e.prototype.disconnectedCallback=function(){L();h();this.storeUnsubscribeList.forEach((function(e){return e()}));window.removeEventListener("message",this.handleHostedOpenWindowCallback)};e.prototype.render=function(){var e=this;var o,i,s,a;this.customerProfile=c.customerProfile;this.clientSecret=c.clientSecret;if(c.stripeCustomerSessionClientSecret){this.stripeCustomerSessionClientSecret=c.stripeCustomerSessionClientSecret}var u=d.step!=="finish"&&d.step!=="error"&&!c.stripeElements||c.isFetchingSession;var l=$(J.appearance,this.appearanceSettingsOverride||null),h=l.colorPrimary,f=l.colorSecondary,v=l.logoUrl,m=l.style;var g=J.appearance.zonosAttribution==="ENABLED";var p=J.appearance.theme;var w=h&&ye(h)?"DARK":"LIGHT";var z=this.isMobile?p:w;var k=!this.isMobile?f:undefined;var y=H.customMessages;var b=(o=y.find((function(e){return e.pageName==="checkout_default"})))===null||o===void 0?void 0:o.message;var _=this.getCurrentLocalePageEnum();var C=y.filter((function(e){return e.pageName===_}));var x=this.getBaseCurrencySettlementInfo();var S=function(){var o=e.preview?"".concat(v,"?timestamp=").concat(Date.now()):v;return t("div",{class:"zonos--logo"},o&&t("img",{alt:"".concat(J.organizationName," logo"),src:o}))};var T=ne();var I=function(){var o=new URLSearchParams(window.location.search);var n=o.get("zonosQaUrl");var r=o.get("zonosDebug");var i=o.get("zonosE2ETest");var s=e.overrideStagingMode||ce();return t("zonos-v-stack",null,t("div",{class:"zonos--logo-wrapper"},S(),T&&t("zonos-badge",{badgeColor:"orange",size:"small"},W("Test mode")),s&&t("zonos-badge",{badgeColor:"red",size:"small"},W("Staging mode")),r==="1"&&t("zonos-badge",{badgeColor:"cyan",size:"small"},"debug"),n&&t("zonos-badge",{badgeColor:"purple",size:"small"},n),i&&t("zonos-badge",{badgeColor:"gray",size:"small"},"E2E Test")),t("zonos-checkout-progress-tabs",{backgroundColor:e.isMobile?"--zonos-elements-gray-0":null}),C.map((function(e){return t("zonos-custom-message",{icon:bo,message:e.message})})))};var A=function(){if(d.checkoutSessionTimeoutShow){return t("zonos-rest-state",{class:"zonos--session-timeout",restStateSubtitle:W("Your checkout session has expired. Please reload the page to continue."),restStateTitle:W("Session timed out"),restStateType:"Warning"},t("zonos-button",{onClick:function(){return e.reloadCheckoutSession()},variant:"primary"},W("Reload")))}return t("div",{class:"zonos--content",style:{"--zonos--border-radius":ke({overrideBorderStyle:m})}},d.step!=="finish"&&d.step!=="error"&&t(n,null,t("div",{class:"zonos--left","data-theme":z,style:be({"--zonos--primary-color":!e.isMobile?h:undefined})},!e.isMobile&&I(),d.step==="customer-info"&&t("zonos-customer-info",{continueLoading:e.submitLoading,defaultAddress:e.getDefaultAddress(),isMobile:e.isMobile,onContinueClicked:function(){return e.handleCustomerInfoContinue()},submitBtnColor:k}),d.step==="shipping"&&t("zonos-shipping",{continueLoading:e.submitLoading,isMobile:e.isMobile,onContinueClicked:function(){return e.handleShippingContinue()},submitBtnColor:k}),d.step==="payment"&&t("zonos-checkout-payment",{continueLoading:e.submitLoading,isMobile:e.isMobile,onContinueClicked:function(){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,this.handleStripePaymentContinue()];case 1:e.sent();return[2]}}))}))},submitBtnColor:k})),t("div",{class:"zonos--right","data-theme":p},e.isMobile&&I(),t("div",{class:"zonos--right-actions"},window.Zonos.showBaseForeign&&t("zonos-currency-toggle",null),!e.isLegacyCheckout&&t("zonos-button",{class:"zonos--close-button",icon:t("zonos-icon",{"aria-label":"Close checkout dialog",content:_e}),noBackground:true,onClick:function(){return e.closeDialogHandler()}})),t("div",{class:"flex--wrapper"},t("div",{class:"zonos--wrapper"},t("zonos-review",{collapsed:e.collapseReviewMobile,mobile:e.isMobile,onClick:function(){if(!e.isMobile){return}e.collapseReviewMobile=!e.collapseReviewMobile}}),t("zonos-collapse",{collapsed:e.collapseReviewMobile&&e.isMobile},t("zonos-cart-items",null),e.isMobile&&t("zonos-v-stack",{spacing:16},t("zonos-cart-subtotal",{submitBtnColor:k}),t("zonos-custom-message",{class:"zonos--checkout-default-message",icon:bo,message:b})))),t("zonos-cart-restricted-items",null),!e.isMobile&&t("zonos-v-stack",{spacing:16},t("zonos-cart-subtotal",null),t("zonos-custom-message",{class:"zonos--checkout-default-message",icon:bo,message:b}))))),(d.step==="finish"||d.step==="error")&&t("div",{class:"zonos--done","data-theme":p},t("div",{class:"zonos--header"},S(),!e.isRedirectAfterOrder&&t("zonos-button",{class:"zonos--close-button",icon:t("zonos-icon",{"aria-label":"Close checkout dialog",content:_e}),noBackground:true,onClick:function(){return e.handleFinishClick()},theme:p})),t("zonos-checkout-finish",{borderRadius:m,onCloseClick:function(){return e.handleFinishClick()},overrideNotification:d.step==="error"&&!!d.error?Object.assign(Object.assign({},d.error),{type:"error"}):undefined,storybookForceStatus:e.storybookPaymentStatusOverride})),t("zonos-checkout-footer",{"data-theme":p,mobile:e.isMobile,slot:!e.isMobile?"dialog-footer":undefined}))};return t(r,{class:we(["zonos--checkout zonos--elements",d.step==="payment"&&"zonos--processing-payment",g&&"has-footer",this.preview&&"preview",this.isMobile&&"mobile",this.isIframed&&"iframed",this.hiddenMode&&"hidden-mode"])},this.preview?A():t("zonos-dialog",{borderStyle:m,class:"zonos--checkout-dialog","data-theme":p,height:"980px",isLoading:u,mobile:this.isMobile,noBodyPadding:true,noBorder:true,noClickOutside:true,noCloseButton:true,onCloseDialog:function(){return e.closeDialogHandler()},open:this.open,width:"1200px"},A()),t("zonos-dialog",{isLoading:true,loadingText:W("You will be redirected to international checkout shortly."),loadingTitle:W("We detected that you are shipping to an international address."),noClickOutside:true,noCloseButton:true,open:this.detectedDomesticCheckoutDialogOpen,width:"450px"}),t("zonos-dialog",{isLoading:true,loadingText:W("You will be redirected to domestic checkout shortly."),loadingTitle:W("We detected that you are shipping to a domestic address."),noClickOutside:true,noCloseButton:true,open:this.redirectToDomesticCheckoutDialogOpen,width:"450px"}),t("zonos-confirm-dialog",{class:"zonos--logged-in-intl-address-dialog",dialogCancelBtnText:W("Stay on this page"),dialogConfirmBtnText:W("Continue to international checkout"),dialogIntent:"info",dialogOpen:this.loggedInIntlAddressConfirmDialogOpen,dialogSubtitle:W("Your saved default address ships internationally. Would you like to continue to international checkout, or stay here and select a domestic address?"),dialogTitle:W("International shipping address detected"),dialogWidth:480,onCancelClicked:function(){var o;e.loggedInIntlAddressConfirmDialogOpen=false;(o=e.loggedInIntlAddressResolver)===null||o===void 0?void 0:o.call(e,"stay");e.loggedInIntlAddressResolver=null},onConfirmClicked:function(){var o;e.loggedInIntlAddressConfirmDialogOpen=false;(o=e.loggedInIntlAddressResolver)===null||o===void 0?void 0:o.call(e,"redirect");e.loggedInIntlAddressResolver=null}}),t("zonos-confirm-dialog",{class:"zonos--close-confirm-dialog",dialogCancelBtnText:W("Don't close"),dialogConfirmBtnText:W("Close"),dialogIntent:"warn",dialogOpen:this.confirmDialogOpen,dialogSubtitle:W("Would you like to close checkout and return to the site?"),dialogTitle:W("Are you sure?"),onCancelClicked:function(){e.confirmDialogOpen=false},onConfirmClicked:function(){return e.closeDialogHandler({confirmed:true})}}),t("zonos-confirm-dialog",{class:"zonos--order-duplication-dialog",dialogCancelBtnText:W("Return to merchant site"),dialogConfirmBtnText:W("Proceed with order"),dialogIntent:"warn",dialogOpen:!!this.placedOrderInfo,dialogSubtitle:((i=this.placedOrderInfo)===null||i===void 0?void 0:i.zonosOrderNumber)?W("It looks like you placed an order recently ([date] at [time]) under order number #[orderNumber]. Check your email for the order confirmation. Are you sure you want to place another order?",{date:this.formatDate(this.placedOrderInfo.time),orderNumber:this.placedOrderInfo.zonosOrderNumber,time:this.formatTime(this.placedOrderInfo.time)}):W("It looks like you placed an order recently ([date] at [time]). Check your email for the order confirmation. Are you sure you want to place another one?",{date:this.formatDate(((s=this.placedOrderInfo)===null||s===void 0?void 0:s.time)||null),time:this.formatTime(((a=this.placedOrderInfo)===null||a===void 0?void 0:a.time)||null)}),dialogTitle:W("Are you sure?"),dialogWidth:530,onCancelClicked:function(){e.handleCancelOrderDuplication()},onConfirmClicked:function(){e.confirmProceedWithOrderDuplication()}}),t("zonos-confirm-dialog",{class:"zonos--fedex-shipping-dialog",dialogConfirmBtnText:W("Confirm"),dialogIntent:"info",dialogOpen:!!this.shouldShowFedexShippingConsentDialog,dialogSubtitle:t(n,null,W("If you select FedEx Ground as your shipping option, you'll need to complete a General Agency Agreement (GAA) after placing your order. This form allows FedEx to clear your package through Canadian customs on your behalf. FedEx will contact you directly—usually by email or phone—with instructions on how to complete the GAA. To avoid delays or the return of your package, please respond promptly to their request."),t("zonos-link",{href:"https://ftn.fedex.com/us/assets/docs/One-Time_GAA.pdf",target:"_blank"},W("View GAA Form."))),dialogTitle:W("Fedex Shipping Procedure"),dialogType:"alert",dialogWidth:500,onConfirmClicked:function(){return e.shouldShowFedexShippingConsentDialog=false}}),t("zonos-confirm-dialog",{class:"zonos--inventory-check-failure-dialog",dialogConfirmBtnText:W("Return to cart"),dialogIntent:"danger",dialogOpen:!!d.inventoryCheckErrorMessage,dialogSubtitle:d.inventoryCheckErrorMessage,dialogTitle:W("Couldn't place order"),dialogType:"alert",onConfirmClicked:function(){return e.handleInventoryCheckDialogConfirm()}}),x&&t("zonos-confirm-dialog",{class:"zonos--pay-in-usd-dialog",dialogCancelBtnText:W("Cancel"),dialogConfirmBtnText:W("Pay [orderTotal]",{orderTotal:q({amount:x.settlementAmount,currency:"USD"})}),dialogIntent:"warn",dialogOpen:this.payInUsdConfirmDialogOpen,dialogSubtitle:W("By paying in USD, your card will be charged directly with no currency conversion. However, using a non-USD based card may result in additional currency conversion fees at the bank level."),dialogTitle:W("Pay in USD (United States Dollar)?"),dialogType:"confirm",dialogWidth:480,onCancelClicked:function(){e.payInUsdConfirmDialogOpen=false},onConfirmClicked:function(){return e.handleStripePaymentContinue()}}),t("zonos-confirm-dialog",{class:"zonos--shopping-cart-expired-dialog",dialogConfirmBtnText:W("OK"),dialogIntent:"danger",dialogOpen:this.isCartExpired,dialogSubtitle:W("You are being sent back to the shop to re-add items to your cart."),dialogTitle:W("Shopping cart expired"),dialogType:"alert",onConfirmClicked:function(){return e.handleCartExpiredDialogConfirm()}}),t("zonos-loading-overlay",{open:this.isOverlayLoading}))};Object.defineProperty(e,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{appearanceSettingsOverride:["appearanceSettingsOverrideChanged","handleAppearanceSettingsOverrideChange"],overrideStagingMode:["overrideStagingModeChanged"],mobile:["handleMobileChange"],defaultAddress:["handleAddressChange"],customerProfile:["handleCustomerProfileChange"],clientSecret:["handleClientSecretChange"],stripeCustomerSessionClientSecret:["handleClientSecretChange"],open:["handleOpenChange"]}},enumerable:false,configurable:true});return e}());To.style=Co}}}));
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,o,t,n){function r(e){return e instanceof t?e:new t((function(o){o(e)}))}return new(t||(t=Promise))((function(t,i){function s(e){try{a(n.next(e))}catch(e){i(e)}}function c(e){try{a(n["throw"](e))}catch(e){i(e)}}function a(e){e.done?t(e.value):r(e.value).then(s,c)}a((n=n.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:[]},n,r,i,s;return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(e){return function(o){return a([e,o])}}function a(c){if(n)throw new TypeError("Generator is already executing.");while(s&&(s=0,c[0]&&(t=0)),t)try{if(n=1,r&&(i=c[0]&2?r["return"]:c[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,c[1])).done)return i;if(r=0,i)c=[c[0]&2,i.value];switch(c[0]){case 0:case 1:i=c;break;case 4:t.label++;return{value:c[1],done:false};case 5:t.label++;r=c[1];c=[0];continue;case 7:c=t.ops.pop();t.trys.pop();continue;default:if(!(i=t.trys,i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){t.label=c[1];break}if(c[0]===6&&t.label<i[1]){t.label=i[1];i=c;break}if(i&&t.label<i[2]){t.label=i[2];t.ops.push(c);break}if(i[2])t.ops.pop();t.trys.pop();continue}c=o.call(e,t)}catch(e){c=[6,e];r=0}finally{n=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,o,t){if(t||arguments.length===2)for(var n=0,r=o.length,i;n<r;n++){if(i||!(n in o)){if(!i)i=Array.prototype.slice.call(o,0,n);i[n]=o[n]}}return e.concat(i||Array.prototype.slice.call(o))};System.register(["./p-7261e245.system.js","./p-b6a36c25.system.js","./p-3b1b3598.system.js","./p-77c2e465.system.js","./p-3689821f.system.js","./p-398d9022.system.js","./p-01174496.system.js","./p-0207c91e.system.js","./p-d938f42f.system.js","./p-40a4c8a2.system.js","./p-23e7c655.system.js","./p-bf37ccc7.system.js","./p-e5dfccd8.system.js","./p-eb99a625.system.js","./p-1aa93d1e.system.js","./p-2770ba48.system.js","./p-1bf9a1b9.system.js","./p-6a195559.system.js","./p-5e6f85f0.system.js"],(function(e){"use strict";var o,t,n,r,i,s,c,a,u,d,l,h,f,v,m,g,p,w,z,k,y,b,_,C,x,S,T,I,A,O,E,U,L,B,P,N,j,D,R,F,M,H,Z,G,K,V,Q,W,Y,q,J,X,$,ee,oe,te,ne,re,ie,se,ce,ae,ue,de,le,he,fe,ve,me,ge,pe,we,ze,ke,ye,be,_e;return{setters:[function(e){o=e.r;t=e.h;n=e.F;r=e.a},function(e){i=e.s;s=e.a;c=e.b;a=e.i;u=e.c;d=e.d;l=e.e;h=e.f;f=e.g;v=e.h;m=e.j;g=e.k;p=e.l;w=e.t;z=e.m;k=e.n;y=e.o;b=e.p;_=e.q;C=e.r;x=e.u;S=e.v;T=e.w;I=e.x;A=e.y;O=e.z;E=e.A;U=e.B;L=e.C;B=e.D;P=e.E;N=e.F},function(e){j=e.p;D=e.s;R=e.a;F=e.b},function(e){M=e.f;H=e.l;Z=e.a;G=e.g;K=e.s;V=e.V;Q=e.b;W=e.t;Y=e.c;q=e.d},function(e){J=e.z;X=e.g;$=e.m},function(e){ee=e.b},function(e){oe=e.h;te=e.l;ne=e.g;re=e.j;ie=e.b;se=e.s;ce=e.a;ae=e.i},function(e){ue=e.u},function(e){de=e.l;le=e.g;he=e.b},function(e){fe=e._;ve=e.c;me=e.a;ge=e.d;pe=e.g},function(e){we=e.c},function(e){ze=e.c},function(e){ke=e.g},function(e){ye=e.i},function(e){be=e.s},function(e){_e=e.R},function(){},function(){},function(){}],execute:function(){var Ce=this;var xe=function(){return __awaiter(Ce,void 0,void 0,(function(){var e,o,t;return __generator(this,(function(n){switch(n.label){case 0:return[4,oe("/api/zonos-elements/get-store-discount-enabled-status")];case 1:e=n.sent(),o=e.errors,t=e.json;if(o.length||!(t===null||t===void 0?void 0:t.enabled)){return[2,{enabled:false}]}return[2,{enabled:true}]}}))}))};var Se=function(e){return __awaiter(Ce,[e],void 0,(function(e){var o,t,n,r;var i=e.testKeys;return __generator(this,(function(e){switch(e.label){case 0:if(i.length===0){return[2,null]}return[4,oe("/api/zonos-elements/select-variance-test",{body:{testKeys:i},method:"POST"})];case 1:o=e.sent(),t=o.errors,n=o.json;if(t.length||!n){return[2,null]}r=M(n);return[2,r]}}))}))};var Te=function(e){var o=e.cartId,t=e.checkoutSessionId,n=e.customerAddress1,r=e.customerAddress2,i=e.customerCity,s=e.customerCountry,c=e.customerEmail,a=e.customerFirstName,u=e.customerLastName,d=e.customerPhone,l=e.customerState,h=e.customerZip,f=e.hostedCheckoutUrl,v=e.isTestMode,m=e.isVariantTest;var g=new URLSearchParams;g.set("tempCartUUID",o);if(a){g.set("customerFirstName",a)}if(u){g.set("customerLastName",u)}if(c){g.set("customerEmail",c)}if(d){g.set("customerPhone",d)}if(h){g.set("customerZip",h)}if(i){g.set("customerCity",i)}if(l){g.set("customerState",l)}if(s){g.set("zCountry",s)}if(n){g.set("customerAddress1",n)}if(r){g.set("customerAddress2",r)}if(v){g.set("zonosTestMode","1")}if(t){g.set("zonosCheckoutSessionId",t)}if(m){g.set("zonosVariantTest","1")}return"".concat(f,"?").concat(g.toString())};var Ie=function(){return __awaiter(Ce,void 0,void 0,(function(){var e,o,t,n,r;return __generator(this,(function(i){switch(i.label){case 0:i.trys.push([0,3,,4]);return[4,fetch("/api/storefront/cart",{credentials:"same-origin",headers:{Accept:"application/json"}})];case 1:t=i.sent();if(!t.ok){de("Failed to fetch BigCommerce cart: ".concat(String(t.status)),"error");return[2,null]}return[4,t.json()];case 2:n=i.sent();return[2,(o=(e=n===null||n===void 0?void 0:n[0])===null||e===void 0?void 0:e.id)!==null&&o!==void 0?o:null];case 3:r=i.sent();te("Error fetching BigCommerce cart data",r);return[2,null];case 4:return[2]}}))}))};var Ae=function(e){return __awaiter(Ce,void 0,void 0,(function(){var o,t;return __generator(this,(function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,fetch("/api/storefront/checkouts/".concat(e,"?include=customer.customerGroup,customer.addresses"),{credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}})];case 1:o=n.sent();if(!o.ok){de("Failed to fetch BigCommerce checkout: ".concat(String(o.status)),"error");return[2,null]}return[4,o.json()];case 2:return[2,n.sent()];case 3:t=n.sent();te("Error fetching BigCommerce checkout data",t);return[2,null];case 4:return[2]}}))}))};var Oe=function(e){var o;return!!((o=e===null||e===void 0?void 0:e.customer)===null||o===void 0?void 0:o.id)};var Ee="isInternationalCheckout";var Ue=function(){var e=new URLSearchParams;e.set(Ee,"true");var o=new URLSearchParams(window.location.search);var t=o.get("zonosQaUrl");if(t){e.set("zonosQaUrl",t)}var n=o.get("zonosQaUrlApi");if(n){e.set("zonosQaUrlApi",n)}if(ne()){e.set("zonosTestMode","1")}return"cart.php?".concat(e.toString())};var Le=function(e){var o=e===void 0?{}:e,t=o.action;var n=new URL("/login.php",window.location.origin);if(t){n.searchParams.set("action",t)}var r=new URLSearchParams(window.location.search);var i=r.get("zonosQaUrl");if(i){n.searchParams.set("zonosQaUrl",i)}var s=r.get("zonosQaUrlApi");if(s){n.searchParams.set("zonosQaUrlApi",s)}if(ne()){n.searchParams.set("zonosTestMode","1")}n.searchParams.set("from",Ue());return n.toString()};var Be=function(e){var o=new URL(e,window.location.origin);var t=new URLSearchParams(window.location.search).get("zonosQaUrl");if(t){o.searchParams.set("zonosQaUrl",t)}if(ne()){o.searchParams.set("zonosTestMode","1")}return o.toString()};var Pe={customerGroupId:null,shouldBypass:false};var Ne=function(e){return __awaiter(Ce,void 0,void 0,(function(){var o,t,n,r,i,s,c,a,u,d,l,h;return __generator(this,(function(f){switch(f.label){case 0:if(!window.Zonos.isBigCommerce){return[2,{conclusive:true,result:Pe}]}i=(o=J.genericSettings)===null||o===void 0?void 0:o.bigcommerceBypassCustomerGroupIds;if(!(i===null||i===void 0?void 0:i.length)){if(J.loadedConfig){return[2,{conclusive:true,result:Pe}]}return[2,{conclusive:false,result:Pe}]}if(!e)return[3,1];c=e.checkoutId;return[3,3];case 1:return[4,Ie()];case 2:c=f.sent();f.label=3;case 3:s=c;if(!s){de("BigCommerce bypass check: no active cart yet, will retry on next call","info");return[2,{conclusive:false,result:Pe}]}if(!e)return[3,4];u=e.checkout;return[3,6];case 4:return[4,Ae(s)];case 5:u=f.sent();f.label=6;case 6:a=u;if(!a){de("BigCommerce bypass check: failed to fetch checkout data, will retry","info");return[2,{conclusive:false,result:Pe}]}d=(r=(n=(t=a.customer)===null||t===void 0?void 0:t.customerGroup)===null||n===void 0?void 0:n.id)!==null&&r!==void 0?r:null;if(d===null){de("BigCommerce bypass check: no customer group found (guest user)","info");return[2,{conclusive:true,result:Pe}]}l=i.includes(d);h={customerGroupId:d,shouldBypass:l};if(l){de("BigCommerce bypass check: customer group ".concat(String(d)," is in bypass list; caller should keep the user on BC native checkout"),"info")}else{de("BigCommerce bypass check: customer group ".concat(String(d)," is not in bypass list"),"info")}return[2,{conclusive:true,result:h}]}}))}))};var je=null;var De=function(e){var o=Ne(e);var t=o.then((function(e){var o=e.conclusive,n=e.result;if(!o&&je===t){je=null}return n}));je=t;return t};var Re=function(){var e;if(!window.Zonos.isBigCommerce){return}var o=(e=J.genericSettings)===null||e===void 0?void 0:e.bigcommerceBypassCustomerGroupIds;if(!(o===null||o===void 0?void 0:o.length)){return}void De()};var Fe=function(){var e=[];for(var o=0;o<arguments.length;o++){e[o]=arguments[o]}return __awaiter(Ce,__spreadArray([],e,true),void 0,(function(e){if(e===void 0){e={}}return __generator(this,(function(o){if(e.forceRefresh||!je){return[2,De(e.preFetched)]}return[2,je]}))}))};var Me={guestCheckoutType:null};var He=60*60*1e3;var Ze="zonos--bc-checkout-settings";var Ge=function(e){try{var o=window.localStorage.getItem(Ze);if(!o){return null}var t=re(o);if(!t){return null}if(t.storeHash!==e){return null}if(t.expiresAt<Date.now()){return null}return{guestCheckoutType:t.guestCheckoutType}}catch(e){return null}};var Ke=function(e,o){try{var t={expiresAt:Date.now()+He,guestCheckoutType:o.guestCheckoutType,storeHash:e};window.localStorage.setItem(Ze,JSON.stringify(t))}catch(e){}};var Ve=function(){return __awaiter(Ce,void 0,void 0,(function(){var e,o,t,n,r,i,s;return __generator(this,(function(c){switch(c.label){case 0:if(!window.Zonos.isBigCommerce){return[2,Me]}o=(e=J.checkoutSettings.bigCommerceConfig)===null||e===void 0?void 0:e.storeHash;if(!o){de("BigCommerce checkout settings: no storeHash provided — skipping fetch","info");return[2,Me]}t=Ge(o);if(t){return[2,t]}return[4,oe("/api/bigcommerce/checkout-settings",{body:{storeHash:o},method:"POST"})];case 1:n=c.sent(),r=n.errors,i=n.json;if(r.length||!i){de("BigCommerce checkout settings: proxy call failed, falling back to guest-allowed behavior","info");return[2,Me]}s={guestCheckoutType:i.guestCheckoutType};Ke(o,s);return[2,s]}}))}))};var Qe={redirectUrl:null,shouldForceLogin:false};var We=null;var Ye=function(){if(!We){var e=Ve().then((function(o){var t=o.guestCheckoutType;if(!t){if(We===e){We=null}return false}return t==="no_guest_checkout"})).catch((function(){if(We===e){We=null}return false}));We=e}return We};var qe=function(){if(!window.Zonos.isBigCommerce){return}void Ye()};var Je=function(){var e=[];for(var o=0;o<arguments.length;o++){e[o]=arguments[o]}return __awaiter(Ce,__spreadArray([],e,true),void 0,(function(e){var o,t,n,r,i;var s=e===void 0?{}:e,c=s.preFetched;return __generator(this,(function(e){switch(e.label){case 0:if(!window.Zonos.isBigCommerce){return[2,Qe]}return[4,Ye()];case 1:o=e.sent();if(!o){return[2,Qe]}if(!c)return[3,2];n=c.checkoutId;return[3,4];case 2:return[4,Ie()];case 3:n=e.sent();e.label=4;case 4:t=n;if(!t){return[2,Qe]}if(!c)return[3,5];i=c.checkout;return[3,7];case 5:return[4,Ae(t)];case 6:i=e.sent();e.label=7;case 7:r=i;if(!r){de("BigCommerce force-login check: failed to fetch checkout data, allowing flow to continue","info");return[2,Qe]}if(Oe(r)){return[2,Qe]}de("BigCommerce force-login check: guest shopper on no-guest-checkout store, redirecting to /login.php","info");return[2,{redirectUrl:Le(),shouldForceLogin:true}]}}))}))};var Xe="data-zonos-login-from-rewritten";var $e='a[href*="login.php?action=create_account"]:not(['+Xe+"])";var eo=function(){var e=document.querySelectorAll($e);if(!e.length){return}var o=Le({action:"create_account"});e.forEach((function(e){e.setAttribute("href",o);e.setAttribute(Xe,"true")}))};var oo=function(){if(!window.Zonos.isBigCommerce){return}if(!window.location.pathname.includes("/login.php")){return}eo();var e=new MutationObserver((function(){eo()}));e.observe(document.body,{childList:true,subtree:true});setTimeout((function(){return e.disconnect()}),1e4)};var to=function(e,o){if(!e.address1||!e.countryCode){return null}var t=[e.firstName,e.lastName].filter(Boolean).join(" ").trim();return{address:{city:e.city||"",country:e.countryCode,line1:e.address1,line2:e.address2||"",postal_code:e.postalCode||"",state:e.stateOrProvinceCode||e.stateOrProvince||""},email:o,name:t,phone:e.phone||""}};var no=function(e){return[e.address.line1,e.address.line2||"",e.address.postal_code,e.address.country].join("|").toLowerCase()};var ro=function(e,o){var t,n,r,i;if(!((t=e===null||e===void 0?void 0:e.customer)===null||t===void 0?void 0:t.id)){return[]}var s=o.isShippable,c=o.selectedCountryCode;var a=e.customer.email||"";var u=(r=(n=e.consignments)===null||n===void 0?void 0:n.flatMap((function(e){return e.shippingAddress?[e.shippingAddress]:[]})))!==null&&r!==void 0?r:[];var d=(i=e.customer.addresses)!==null&&i!==void 0?i:[];var l=new Set;var h=[];for(var f=0,v=__spreadArray(__spreadArray([],d,true),u,true);f<v.length;f++){var m=v[f];var g=to(m,a);if(!g){continue}if(!s(g.address.country)){continue}var p=no(g);if(l.has(p)){continue}l.add(p);h.push(g)}if(!c){return h}return h.map((function(e,o){return{index:o,option:e}})).sort((function(e,o){var t=e.option.address.country===c;var n=o.option.address.country===c;if(t===n){return e.index-o.index}return t?-1:1})).map((function(e){return e.option}))};var io=function(e){if(e===void 0){e=true}if(!H.localizationLoaded){return true}if(H.isDisabledCountry){if(e){de("Checkout: disabled country")}return true}return false};var so=function(e,o){if(e===void 0){e=true}var t;if(!H.localizationLoaded){return false}if(o){var n=!!((t=H.shippingZoneCountries)===null||t===void 0?void 0:t[o])&&!J.disabledCountries.includes(o);if(e&&!n){de("Checkout: ".concat(o," is not a shippable country: ").concat(n))}return n}if(!H.isShippableCountry){if(e){de("Checkout: not shippable country")}return false}return true};var co='select[name="shippingAddress.countryCode"]';var ao=function(e){return __awaiter(Ce,[e],void 0,(function(e){var o,t,n,r,i,c,a,u,d,l,h,f,v,m,g,p,w,z;var k=e.onInternationalCheckoutSelected,y=e.onLoggedInInternationalAddressDetected;return __generator(this,(function(e){switch(e.label){case 0:return[4,Ie()];case 1:h=e.sent();if(!h){return[2,"noAction"]}return[4,Ae(h)];case 2:f=e.sent();v={checkout:f,checkoutId:h};return[4,Fe({preFetched:v})];case 3:m=e.sent().shouldBypass;if(m){return[2,"noAction"]}g=(t=(o=f===null||f===void 0?void 0:f.consignments)===null||o===void 0?void 0:o[0])===null||t===void 0?void 0:t.shippingAddress;if(!(g===null||g===void 0?void 0:g.countryCode)){return[2,"noAction"]}p=g.countryCode;if(!so(false,p)){return[2,"noAction"]}de(y?"Logged-in user has international shipping address: ".concat(p,", prompting user to choose checkout"):"Logged-in user has international shipping address: ".concat(p,", redirecting automatically (legacy behavior)"),"info");if(!y)return[3,5];return[4,y()];case 4:w=e.sent();if(w==="stay"){de("User opted to stay on BigCommerce native checkout despite international default address","info");return[2,"optedOut"]}e.label=5;case 5:return[4,Je({preFetched:v})];case 6:z=e.sent();if(z.shouldForceLogin&&z.redirectUrl){window.location.href=z.redirectUrl;return[2,"redirected"]}if(!k)return[3,8];return[4,k()];case 7:e.sent();e.label=8;case 8:Z({isInitializing:false,newSelectedCountryCode:p});s({address1:(n=g.address1)!==null&&n!==void 0?n:"",address2:(r=g.address2)!==null&&r!==void 0?r:"",city:(i=g.city)!==null&&i!==void 0?i:"",countryCode:p,firstName:(c=g.firstName)!==null&&c!==void 0?c:"",lastName:(a=g.lastName)!==null&&a!==void 0?a:"",phone:(u=g.phone)!==null&&u!==void 0?u:"",postalCode:(d=g.postalCode)!==null&&d!==void 0?d:"",state:(l=g.stateOrProvince)!==null&&l!==void 0?l:""});window.location.href=Be("/");return[2,"redirected"]}}))}))};var uo=function(e){var o=e.domesticRedirectedBtnSelector,t=e.onInternationalCheckoutSelected,n=e.onLoggedInInternationalAddressDetected,r=e.onShippingAddressSessionFound;if(!window.Zonos.isBigCommerce){return}var c=function(e){return __awaiter(Ce,void 0,void 0,(function(){var o,n,r,i,c,a,u,d,l,h;return __generator(this,(function(f){switch(f.label){case 0:n=document.querySelector(((o=J.genericSettings)===null||o===void 0?void 0:o.bigcommerceDomesticCheckoutCountrySelector)||co);r=(n===null||n===void 0?void 0:n.value)||e;if(!r){return[2,false]}if(!so(false,r)){return[2,false]}return[4,Ie()];case 1:i=f.sent();if(!i)return[3,3];return[4,Ae(i)];case 2:a=f.sent();return[3,4];case 3:a=null;f.label=4;case 4:c=a;u={checkout:c,checkoutId:i};return[4,Fe({forceRefresh:true,preFetched:u})];case 5:d=f.sent().shouldBypass;if(d){de("Bypass customer group detected on BC checkout, stopping interval","info");return[2,true]}return[4,Je({preFetched:u})];case 6:l=f.sent();if(l.shouldForceLogin&&l.redirectUrl){window.location.href=l.redirectUrl;return[2,true]}if(!t)return[3,8];return[4,t()];case 7:f.sent();f.label=8;case 8:Z({isInitializing:false,newSelectedCountryCode:r});h={address1:"",address2:"",city:"",countryCode:r,firstName:"",lastName:"",phone:"",postalCode:"",stateOrProvince:""};s({address1:h.address1,address2:h.address2,city:h.city,countryCode:h.countryCode,firstName:h.firstName,lastName:h.lastName,phone:h.phone,postalCode:h.postalCode,state:h.stateOrProvince});window.location.href=Be("/");return[2,true]}}))}))};var a=false;var u=false;var d=false;var l=false;var h=false;var f=new MutationObserver((function(){return __awaiter(Ce,void 0,void 0,(function(){var e,s,v,m,g,p,w,z,k,y;var b=this;return __generator(this,(function(_){switch(_.label){case 0:s=document.querySelector(o);v=i();if(!s&&v){m=document.createElement("button");m.style.display="none";m.id="zonos--domestic-redirected-checkout-button";document.body.appendChild(m);r===null||r===void 0?void 0:r(v);f.disconnect();return[2]}g=window.location.pathname.includes("/checkout")&&window.Zonos.isBigCommerce;if(!g){f.disconnect();return[2]}if(!(!l&&!d))return[3,5];d=true;h=true;_.label=1;case 1:_.trys.push([1,3,4,5]);return[4,ao({onInternationalCheckoutSelected:t,onLoggedInInternationalAddressDetected:n})];case 2:p=_.sent();if(p==="redirected"){f.disconnect();return[2]}if(p==="optedOut"){l=true}return[3,5];case 3:w=_.sent();te("Error checking logged-in user shipping address",w);return[3,5];case 4:d=false;h=false;return[7];case 5:z=document.querySelector(((e=J.genericSettings)===null||e===void 0?void 0:e.bigcommerceDomesticCheckoutCountrySelector)||co);if(!z){return[2]}de("Domestic checkout found - Listening for shipping country change","info",{value:z.value});if(u){return[2]}u=true;f.disconnect();k=setInterval((function(){return __awaiter(b,void 0,void 0,(function(){var e,o;return __generator(this,(function(t){switch(t.label){case 0:if(a||h){return[2]}a=true;t.label=1;case 1:t.trys.push([1,3,,4]);return[4,c()];case 2:e=t.sent();if(e){clearInterval(k);return[2]}a=false;return[3,4];case 3:o=t.sent();a=false;return[3,4];case 4:return[2]}}))}))}),1e3);y=setInterval((function(){var e;if(!window.bcStripeElements){clearInterval(y);return}var o=(e=window.bcStripeElements)===null||e===void 0?void 0:e.getElement("address");if(!o){return}clearInterval(y);o.on("change",(function(e){var o=e.value.address.country;if(o&&!h){void c(o)}}))}),500);return[2]}}))}))}));f.observe(document.body,{childList:true,subtree:true})};var lo=function(){var e=new URLSearchParams(window.location.search);de("legacy urlParams","info",Object.fromEntries(e.entries()));var o=function(o){var t=e.get(o);if(!t||t==="undefined"){return""}return t};var t=G(e)||H.selectedCountryCode||"US";var n=o("customerCity");var r=o("customerEmail");var i=o("customerAddress1");var s=o("customerAddress2");var c=o("customerName");var a=o("customerPhone");var u=o("customerZip");var d=o("customerState");var l=o("customerFirstName");var h=o("customerLastName");return{customerAddress1:i,customerAddress2:s,customerCity:n,customerCountry:t,customerEmail:r,customerFirstName:l,customerLastName:h,customerName:c,customerPhone:a,customerState:d,customerZip:u}};var ho=0;var fo=function(){return __awaiter(Ce,void 0,void 0,(function(){var e,o;var t;return __generator(this,(function(n){switch(n.label){case 0:if(window.Zonos.loadTimeApiInfoList.length===0){return[2]}de("Sending bulk load time api log","info",{loadTimeApiInfoList:window.Zonos.loadTimeApiInfoList});e={data:__spreadArray([],window.Zonos.loadTimeApiInfoList,true),storeId:window.Zonos.storeId||0};window.Zonos.loadTimeApiInfoList.length=0;return[4,oe("/api/zonos-elements/log-bulk-load-data",{body:e,method:"POST"})];case 1:o=n.sent().errors;if(o.length){(t=window.Zonos.loadTimeApiInfoList).push.apply(t,e.data);ho++;if(ho>5&&window.Zonos.logIntervalId){clearInterval(window.Zonos.logIntervalId)}}return[2]}}))}))};var vo=function(){return __awaiter(Ce,void 0,void 0,(function(){var e,o;return __generator(this,(function(t){e=le().elapsedTime;o={cache:"miss",eventName:"jsdelivr",flag:"LOG_CHECKOUT_FACADE_LOAD",href:window.location.href,loadTime:e,metadata:Object.assign({allLogs:he},ie()),scriptLoadUrl:"checkoutFacade",storeId:window.Zonos.storeId||0};void oe("/api/zonos-elements/log-script-load",{body:o,method:"POST"});return[2]}))}))};var mo=function(e){return __awaiter(Ce,[e],void 0,(function(e){var o;var t=e.loadTime;return __generator(this,(function(e){o={cache:"miss",eventName:"jsdelivr",flag:"LOG_NATIVE_CHECKOUT_LOAD",href:window.location.href,loadTime:t,metadata:Object.assign({allLogs:he},ie()),scriptLoadUrl:"nativeCheckout",storeId:window.Zonos.storeId||0};void oe("/api/zonos-elements/log-script-load",{body:o,method:"POST"});return[2]}))}))};var go=function(e){return(e===null||e===void 0?void 0:e.filter((function(e){if(e.expiresAt&&e.expiresAt<Date.now()||!e.expiresAt){return false}return true})))||[]};var po=function(e){var o;var t=(o=K.enabledVariantTestKeys)===null||o===void 0?void 0:o.find((function(o){return o.testKey===e}));return(t===null||t===void 0?void 0:t.selectedVariantKey)||null};var wo=function(e){return J.enabledVariantTestKeys.includes(e)};var zo=function(e){var o=e.baseTestObj,t=e.mergeTestObj;return o.map((function(e){var o=e.testKey;var n=t.find((function(e){var t=e.testKey;return t===o}));return{expiresAt:(n===null||n===void 0?void 0:n.expiresAt)||Date.now()+V,selectedVariantKey:(n===null||n===void 0?void 0:n.selectedVariantKey)||null,testKey:o}}))};var ko=function(e){return __awaiter(Ce,[e],void 0,(function(e){var o,t,n,r,i;var s=e.cartId,c=e.retries;return __generator(this,(function(e){switch(e.label){case 0:o=ne();return[4,oe("/api/zonos-elements/get-temp-cart",{body:{isTestMode:o,options:{noOnlineStoreSettings:true},tempCartUUID:s},headers:{"Content-Type":"application/json"},method:"POST"})];case 1:t=e.sent(),n=t.errors,r=t.json;i=!r||n.length;if(!(i&&c))return[3,3];de("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:c});return[4,new Promise((function(e){return setTimeout(e,500)}))];case 2:e.sent();return[2,ko({cartId:s,retries:c-1})];case 3:if(i){return[2,null]}return[2,r]}}))}))};var yo=function(e){return __awaiter(Ce,void 0,void 0,(function(){var o,t,n,r;return __generator(this,(function(i){switch(i.label){case 0:o=fe(e),t=o.isDgsCartId,n=o.isLegacyCartId;if(!n&&!t){te("[ZONOS - loadZonos] invalid cart id");return[2,null]}return[4,ko({cartId:e,retries:5})];case 1:r=i.sent();de("[ZONOS - loadZonos] getting temp cart data","info",r);if(!r){te("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process.");return[2,null]}window.Zonos.storeId=r.cartData.storeId;window.Zonos.zonosApiKey=r.cartData.credentialToken;return[2,{cartData:r.cartData,storeFavicon:r.storeFaviconUrl,storeId:r.cartData.storeId,storeLogo:r.storeLogoUrl,zonosApiKey:r.cartData.credentialToken}]}}))}))};var bo='<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 _o=".sc-zonos-checkout-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-checkout-h *.sc-zonos-checkout{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-checkout-h img.sc-zonos-checkout{max-width:100%}.sc-zonos-checkout-h dl.sc-zonos-checkout,.sc-zonos-checkout-h dd.sc-zonos-checkout,.sc-zonos-checkout-h h1.sc-zonos-checkout,.sc-zonos-checkout-h h2.sc-zonos-checkout,.sc-zonos-checkout-h h3.sc-zonos-checkout,.sc-zonos-checkout-h h4.sc-zonos-checkout,.sc-zonos-checkout-h h5.sc-zonos-checkout,.sc-zonos-checkout-h h6.sc-zonos-checkout,.sc-zonos-checkout-h hr.sc-zonos-checkout,.sc-zonos-checkout-h figure.sc-zonos-checkout,.sc-zonos-checkout-h p.sc-zonos-checkout,.sc-zonos-checkout-h pre.sc-zonos-checkout{margin:0}.sc-zonos-checkout-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-checkout-h{z-index:2147483647;position:fixed}.sc-zonos-checkout-h *.sc-zonos-checkout{-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar{width:10px}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{display:-ms-flexbox;display:flex;height:100%;overflow:hidden;border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10))}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{-ms-flex:1;flex:1;padding:32px}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout{background-color:var(--zonos--primary-color, var(--zonos-elements-gray-0));border-right:1px solid var(--zonos-elements-gray-200)}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{background-color:var(--zonos-elements-gray-0)}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{width:100%;max-height:100%;height:100%;overflow:auto;-ms-flex-direction:column;flex-direction:column;background-color:var(--zonos-elements-gray-0);-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:24px;padding-bottom:50px}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout .zonos--header.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;width:100%}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout .zonos--logo.sc-zonos-checkout{margin-bottom:0}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout zonos-checkout-finish.sc-zonos-checkout{-ms-flex:1;flex:1}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:relative}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{padding:0 8px 8px}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--payment-error-banner.sc-zonos-checkout{margin-top:24px}.sc-zonos-checkout-h .zonos--right.sc-zonos-checkout{position:relative}.sc-zonos-checkout-h .zonos--right.sc-zonos-checkout .zonos--right-actions.sc-zonos-checkout{position:absolute;right:24px;top:24px;z-index:2;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--wrapper.sc-zonos-checkout{overflow:auto;max-height:100%;position:relative}.sc-zonos-checkout-h .flex--wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;max-height:100%}.sc-zonos-checkout-h .zonos--logo-wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;gap:16px;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--logo-wrapper.sc-zonos-checkout>*.sc-zonos-checkout{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}.sc-zonos-checkout-h .zonos--logo.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--logo.sc-zonos-checkout img.sc-zonos-checkout{max-height:72px}.sc-zonos-checkout-h .zonos--checkout-default-message.sc-zonos-checkout{margin-left:76px;margin-bottom:8px}.zonos--close-button.sc-zonos-checkout{-ms-flex-item-align:start;align-self:flex-start}.preview.sc-zonos-checkout-h{min-width:500px;margin:auto;position:relative}.preview.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{border:var(--zonos-elements-border)}.preview.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{padding:32px}.hidden-mode.sc-zonos-checkout-h{height:0;opacity:0;pointer-events:none;position:absolute;visibility:hidden;width:0;z-index:-1}.mobile.sc-zonos-checkout-h{min-width:auto}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow:auto;border-radius:0;max-height:100%;height:100%;border:0}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{padding:12px;padding-bottom:76px}@media (max-width: 768px){.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{padding-bottom:0}}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout{-ms-flex-order:2;order:2;border-right:none}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{-ms-flex-order:1;order:1;padding-top:16px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border:var(--zonos-elements-border);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10));background-color:var(--zonos-elements-gray-50);padding:12px;margin-top:32px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--review.sc-zonos-checkout{margin-bottom:0}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--cart-items.sc-zonos-checkout{margin-top:8px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout zonos-checkout-footer.sc-zonos-checkout{-ms-flex-order:3;order:3}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{max-height:100%}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--footer.sc-zonos-checkout{-ms-flex-order:3;order:3}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{width:auto}.mobile.sc-zonos-checkout-h .zonos--cart-subtotal.sc-zonos-checkout{margin:0}.iframed.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{-ms-scroll-chaining:chained;overscroll-behavior:auto}.zonos--processing-payment.sc-zonos-checkout-h{z-index:2147483646}";var Co=_o;var xo=90*60*1e3;var So=6*60*60*1e3;var To=e("zonos_checkout",function(){function e(e){var t=this;o(this,e);this.storeUnsubscribeList=[];this.isRedirectAfterOrder=false;this.preview=false;this.hiddenMode=false;this.mobile=false;this.defaultAddress=[];this.forceDialogOpen=false;this.defaultAddressParams=[];this.defaultCustomerProfileAddress=[];this.customerProfile=null;this.open=this.forceDialogOpen;this.isOverlayLoading=false;this.stripe=window.Zonos.stripe;this.submitLoading=false;this.collapseReviewMobile=true;this.isAttachError=false;this.isMobile=false;this.isIframed=false;this.isLegacyCheckout=window.Zonos.isLegacyCheckout;this.confirmDialogOpen=false;this.isCartExpired=false;this.payInUsdConfirmDialogOpen=false;this.inventoryCheckErrorMessage=null;this.placedOrderInfo=null;this.shouldShowFedexShippingConsentDialog=false;this.detectedDomesticCheckoutDialogOpen=false;this.redirectToDomesticCheckoutDialogOpen=false;this.loggedInIntlAddressConfirmDialogOpen=false;this.loggedInIntlAddressResolver=null;this.clientSecret=c.clientSecret;this.stripeCustomerSessionClientSecret=c.stripeCustomerSessionClientSecret;this.applyStripeTheme=function(){return __awaiter(t,void 0,void 0,(function(){var e,o,t,n,r;return __generator(this,(function(i){switch(i.label){case 0:r=((e=this.appearanceSettingsOverride)===null||e===void 0?void 0:e.theme)||J.appearance.theme;return[4,a({overrideBorderRadius:(o=this.appearanceSettingsOverride)===null||o===void 0?void 0:o.style,overridePrimaryColor:(t=this.appearanceSettingsOverride)===null||t===void 0?void 0:t.colorPrimary,overrideSecondaryColor:(n=this.appearanceSettingsOverride)===null||n===void 0?void 0:n.colorSecondary,overrideTheme:this.isMobile?r:undefined,paypalEnabled:j()})];case 1:i.sent();return[2]}}))}))};this.checkStripePaymentIntentStatus=function(e){return __awaiter(t,[e],void 0,(function(e){var o,t,n,r,i,s,a,d,l;var h=e.triggeredButton;return __generator(this,(function(e){switch(e.label){case 0:o=h===null||h===void 0?void 0:h.matches("#".concat(ve));t=!!window.Zonos.cartData;n=new URL(window.location.href).searchParams;r=n.get("payment_intent_client_secret");i=n.get("zonosCheckoutSessionId");if(!o){de("Checkout is triggered by user, no need to check stripe payment intent status");return[2,{shouldAllowOrder:true}]}de("Payment intent exist, checking stripe payment intent status");if(!r){de("No stripe client secret found in the URL, proceed to order if cart data is available");return[2,{shouldAllowOrder:t}]}return[4,u({clientSecret:r})];case 1:s=e.sent(),a=s.error,d=s.status;l=new URLSearchParams(window.location.search).get("redirect_status");if(l){if(!a){de("Payment intent is succeeded or in a good state to move forward, show success screen")}else{de("Payment intent failed, show status from error")}this.open=true;K.checkoutSessionId=i;c.clientSecret=r;void this.setToFinishStep(d);return[2,{shouldAllowOrder:false}]}if(!t){de("Cart data is not available, only check payment intent status, skip order.");return[2,{shouldAllowOrder:false}]}de("Payment intent is not succeeded, proceed to order");return[2,{shouldAllowOrder:true}]}}))}))};this.initializeTestKeys=function(){K.enabledVariantTestKeys=go(K.enabledVariantTestKeys||[]);var e=J.enabledVariantTestKeys.map((function(e){var o;var t=(o=K.enabledVariantTestKeys)===null||o===void 0?void 0:o.find((function(o){var t=o.testKey;return t===e}));return{expiresAt:(t===null||t===void 0?void 0:t.expiresAt)||Date.now()+V,selectedVariantKey:(t===null||t===void 0?void 0:t.selectedVariantKey)||null,testKey:e}}));Q(e);return{allSelected:false}};this.shouldAllowHostedVsNativeTest=function(){if(typeof J.checkoutSettings.createCartId!=="function"){return false}var e=J.enabledVariantTestKeys.includes("hosted_vs_native");if(!e){return false}return true};this.registerTestHostedVsNative=function(){return __awaiter(t,void 0,void 0,(function(){var e,o,t,n;return __generator(this,(function(r){switch(r.label){case 0:e=this.shouldAllowHostedVsNativeTest();if(!e){return[2]}de("[TEST] - Registering hosted vs native test");o=po("hosted_vs_native");if(o){de("[TEST] - Hosted vs native test already has variant selected: ".concat(o));return[2]}return[4,Se({testKeys:["hosted_vs_native"]})];case 1:t=r.sent();if(!t){de("[TEST] - Failed to get selection for hosted vs native test");return[2]}n=zo({baseTestObj:K.enabledVariantTestKeys||[],mergeTestObj:t});Q(n);return[2]}}))}))};this.handleHostedVsNative=function(){return __awaiter(t,void 0,void 0,(function(){var e,o,t,n,r,i,s,c;return __generator(this,(function(a){switch(a.label){case 0:o=this.shouldAllowHostedVsNativeTest();if(!o){return[2,{redirected:false}]}t=po("hosted_vs_native");de("[TEST] - hosted_vs_native: ".concat(t));if(typeof J.checkoutSettings.createCartId!=="function"){de("[TEST] - createCartId is not provided, skipping hosted vs native test");return[2,{redirected:false}]}if(t!=="hosted"){de("[TEST] - Hosted vs native test is enabled for native, skipping");return[2,{redirected:false}]}if(!((e=J.genericSettings)===null||e===void 0?void 0:e.hostedCheckoutUrl)){de("[TEST] - Hosted checkout URL is not provided");return[2,{redirected:false}]}de('"createCartId" is provided, start building cart');return[4,J.checkoutSettings.createCartId()];case 1:n=a.sent();i=null;if(typeof n==="object"){r=n.cartId;i=n.shippingData||null}else{r=n}s=lo();c=Te(Object.assign(Object.assign({cartId:r,checkoutSessionId:K.checkoutSessionId||undefined,hostedCheckoutUrl:J.genericSettings.hostedCheckoutUrl,isTestMode:ne(),isVariantTest:true},s),i));de("[TEST] - Redirecting to: ".concat(c));window.open(c,"_blank");return[2,{redirected:true}]}}))}))};this.formatDate=function(e){if(!e){return""}var o=new Date(e);return o.toLocaleDateString()};this.formatTime=function(e){if(!e){return""}var o=new Date(e);return o.toLocaleTimeString()};this.getCurrentLocalePageEnum=function(){switch(d.step){case"customer-info":return"checkout_customer_info";case"shipping":return"checkout_shipping_info";case"payment":return"checkout_payment_info";default:return null}};this.getBaseCurrencySettlementInfo=function(){var e=d.selectedLandedCost;if(!e){return null}var o=e.landedCost.amountSubtotals;if(!o){return null}var t=(o.discounts||0)+o.items+o.landedCostTotal+o.shipping;return{settlementAmount:t}};this.prefillBigCommerceCustomerAddresses=function(){return __awaiter(t,void 0,void 0,(function(){var e,o,t,n;return __generator(this,(function(r){switch(r.label){case 0:if(!window.Zonos.isBigCommerce){return[2]}if(this.defaultCustomerProfileAddress.length){return[2]}e=Array.isArray(this.defaultAddress)&&this.defaultAddress.length>0||!Array.isArray(this.defaultAddress)&&typeof this.defaultAddress==="object"&&this.defaultAddress!==null;if(e){return[2]}return[4,Ie()];case 1:o=r.sent();if(!o){return[2]}return[4,Ae(o)];case 2:t=r.sent();if(!Oe(t)){return[2]}n=ro(t,{isShippable:function(e){return so(false,e)},selectedCountryCode:H.selectedCountryCode||undefined});if(!n.length){return[2]}if(this.defaultCustomerProfileAddress.length){return[2]}this.defaultCustomerProfileAddress=n;de("Prefilled ".concat(String(n.length)," BigCommerce customer address(es) for logged-in shopper"),"info");return[2]}}))}))};this.getDefaultAddress=function(){if(t.defaultCustomerProfileAddress.length){return t.defaultCustomerProfileAddress}if(Array.isArray(t.defaultAddress)&&t.defaultAddress.length){return t.defaultAddress}if(!Array.isArray(t.defaultAddress)&&typeof t.defaultAddress==="object"){return[t.defaultAddress]}return t.defaultAddressParams};this.handleHostedOpenWindowCallback=function(e){var o;var t=(o=J.genericSettings)===null||o===void 0?void 0:o.hostedCheckoutUrl;if(!origin){return}var n=["dev.checkout.elements.zonos.com"].some((function(o){return e.origin.includes(o)}));if(e.origin!==t&&!n){return}switch(e.data.type){case"zonos-checkout-session-update":K.checkoutSessionId=e.data.checkoutSessionId;break}};this.captureParamsRedirectedForVariantTest=function(){var e=new URL(window.location.href);var o=e.searchParams.get("zonosVariantTest")==="1";if(!o){return}var t=e.searchParams.get("zonosCheckoutSessionId");if(t){K.checkoutSessionId=t}var n=K.enabledVariantTestKeys||[];if(window.Zonos.isLegacyCheckout){var r=po("hosted_vs_native");if(!r){n.push({expiresAt:Date.now()+V,selectedVariantKey:"hosted",testKey:"hosted_vs_native"});Q(n)}else{Q(n.map((function(e){if(e.testKey==="hosted_vs_native"){return Object.assign(Object.assign({},e),{selectedVariantKey:"hosted"})}return e})))}}e.searchParams.delete("zonosCheckoutSessionId");e.searchParams.delete("zonosVariantTest");window.history.replaceState({},"",e.toString())}}e.prototype.initCartInfoHandler=function(e){return __awaiter(this,void 0,void 0,(function(){var o;return __generator(this,(function(t){o=e.detail;void l({adjustments:d.adjustments,cartItems:o});return[2]}))}))};e.prototype.handleKeyPress=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){if(e.key==="Escape"){void this.closeDialogHandler()}return[2]}))}))};e.prototype.closeDialogHandler=function(e){return __awaiter(this,void 0,void 0,(function(){var o,t;return __generator(this,(function(n){if(!this.open){return[2]}if(!(e===null||e===void 0?void 0:e.confirmed)){this.confirmDialogOpen=true;return[2]}this.confirmDialogOpen=false;D({event:"zonos-checkout-close",metadata:{checkoutSessionId:K.checkoutSessionId}});this.open=this.forceDialogOpen||false;if(!this.preview&&d.step==="finish"){h()}d.step="customer-info";f();v();(t=(o=J.checkoutSettings).onClose)===null||t===void 0?void 0:t.call(o);return[2]}))}))};e.prototype.buildCartAndInit=function(){return __awaiter(this,void 0,void 0,(function(){var e,o,t,n,r,i,s,c,i,s,s,a,u,i,h,f,v,p;return __generator(this,(function(w){switch(w.label){case 0:if(!(typeof J.checkoutSettings.createCartId==="function"))return[3,4];de('"createCartId" is provided, start building cart');d.customMessage=[];return[4,J.checkoutSettings.createCartId()];case 1:e=w.sent();o=void 0;if(typeof e==="object"){de("object detected, use cartId and prefill address from createCartId","info",e);o=e.cartId;this.useShippingDataFromCreateCartId(e.shippingData);d.customerAuthenticationToken=e.customerAuthenticationToken||null;d.customMessage=Array.isArray(e.customMessage)?e.customMessage.filter((function(e){return typeof e==="string"})):[]}else{o=e}window.Zonos.cartId=o;return[4,yo(o)];case 2:t=w.sent();n=t===null||t===void 0?void 0:t.cartData;if(!n){te("Failed to build cart, please try again.");return[2,false]}window.Zonos.cartData=n;r=ee(n),i=r.adjustments,s=r.cartItems;return[4,l({adjustments:i,cartItems:s})];case 3:w.sent();return[3,9];case 4:if(!window.Zonos.cartData)return[3,6];de("tempCartUUID is provided, start building cart");c=ee(window.Zonos.cartData),i=c.adjustments,s=c.cartItems;return[4,l({adjustments:i,cartItems:s})];case 5:w.sent();return[3,9];case 6:if(!(J.checkoutSettings.buildCartDetail&&H.selectedCountryCode))return[3,9];de("build cart detail");return[4,J.checkoutSettings.buildCartDetail({countryCode:H.selectedCountryCode,currencyCode:H.targetCurrency})];case 7:s=w.sent();a=s.filter((function(e){return e.amount>=0}));u=s.filter((function(e){return e.amount<0}));de("cartItems","info",{cartItems:s});i=u.map((function(e){return{amount:e.amount,currencyCode:e.currencyCode,description:e.name||e.description||"",productId:e.productId||null,sku:e.sku||null,type:"CART_TOTAL"}}));return[4,l({adjustments:i,cartItems:a})];case 8:w.sent();w.label=9;case 9:if(!!K.checkoutSessionId)return[3,11];return[4,m()];case 10:h=w.sent();de("stripeStoreInitCheckoutSession: ".concat(h));if(!h){return[2,false]}w.label=11;case 11:if(!d.isStagingMode){void g()}return[4,this.applyStripeTheme()];case 12:w.sent();f=J.checkoutSettings,v=f.successBehavior,p=f.successRedirectUrl;this.isRedirectAfterOrder=v==="REDIRECT_TO_SUCCESS_PAGE"||v==="CLOSE_MODAL"&&!!p||!!d.externalConfirmationPageURL;return[2,true]}}))}))};e.prototype.reloadCheckoutSession=function(){window.location.reload()};e.prototype.handleOrderDuplication=function(){var e=re(localStorage.getItem("zonos--placed-order-info"));if(!e){localStorage.removeItem("zonos--placed-order-info");return}var o=Date.now()-e.time;de("=== Existing placed order info: ".concat(e.orderId," - ").concat(this.formatDate(e.time)," - elapsed in hh:ss format: ").concat(new Date(o).toISOString().substring(11,8)),"warn");var t=parseFloat(new URLSearchParams(window.location.search).get("zonosOverrideExpiredDuplication")||"0")||So;if(o>t){de("=== Existing placed order info is older than ".concat(t,"ms, cleaning localStorage"),"warn");localStorage.removeItem("zonos--placed-order-info");return}this.placedOrderInfo=e;de("=== Showing order duplication confirmation","warn")};e.prototype.recordCheckoutInfo=function(){if(!K.checkoutSessionId){return}void ue({attributes:[{key:"APP_VERSION",value:window.Zonos.version},{key:"APP_VERSION_NPM_INTEGRATION",value:window.Zonos.isNpm?"1":"0"},{key:"LEGACY_CHECKOUT_FACADE",value:window.Zonos.isLegacyCheckout?"1":"0"}],checkoutSessionId:K.checkoutSessionId})};e.prototype.confirmProceedWithOrderDuplication=function(){this.placedOrderInfo=null;if(!K.checkoutSessionId){return}void ue({attributes:[{key:"ORDER_DUPLICATION_CONSENT",value:"1"}],checkoutSessionId:K.checkoutSessionId})};e.prototype.markTheSessionAsAbandonedCart=function(){if(!K.checkoutSessionId){return}void ue({attributes:[{key:"WITH_ABANDONED_CART_TOKEN",value:"1"}],checkoutSessionId:K.checkoutSessionId})};e.prototype.handleCancelOrderDuplication=function(){var e;this.placedOrderInfo=null;if(this.isLegacyCheckout){var o=((e=window.Zonos.cartData)===null||e===void 0?void 0:e.storeBaseUrl)||J.onlineStoreSettings.url;if(!o){return}if(window.parent){window.parent.location.href=o}window.location.href=o;return}void this.closeDialogHandler({confirmed:true})};e.prototype.attachCheckout=function(){var e=this;var o=J.checkoutSettings.placeOrderButtonSelector;var t=J.checkoutSettings.alwaysTriggerInternationalCheckoutSelector;var n=!!document.querySelector("#".concat(ve));de("attach checkout ".concat(o));de("attach checkout to always trigger international checkout selector: ".concat(t));if(!o&&!t&&!window.Zonos.cartData&&!n){return}var r=[o,t,"#".concat(ge),"#".concat(ve),"#".concat(me)].filter(Boolean);var i=document.querySelectorAll(r.join(","));i.forEach((function(n){var r=n.getAttribute("data-zonos-checkout-attached");if(r){return}de("attached event to button ".concat(o),"info",{button:n});n.addEventListener("click",(function(o){return __awaiter(e,void 0,void 0,(function(){var e,r,i,s,a,u,l,h,f,v,m,g,y,b,_,C,x,S;return __generator(this,(function(T){switch(T.label){case 0:i=performance.now();s=t&&n.matches(t);a=n.matches("#".concat(me));u=n.matches("#".concat(ge))||n.matches("#".concat(ve));if(!window.Zonos.isLegacyCheckout&&(!so()||io())&&!s&&!a&&!u){return[2]}o.preventDefault();o.stopPropagation();de("zonos checkout button clicked");return[4,this.checkStripePaymentIntentStatus({triggeredButton:o.target})];case 1:l=T.sent().shouldAllowOrder;if(!l){return[2]}if(!window.Zonos.logIntervalId){window.Zonos.logIntervalId=setInterval((function(){void fo()}),2e3)}if(!wo("hosted_vs_native"))return[3,4];this.isOverlayLoading=true;return[4,this.registerTestHostedVsNative()];case 2:T.sent();return[4,this.handleHostedVsNative()];case 3:h=T.sent().redirected;this.isOverlayLoading=false;if(h){return[2]}T.label=4;case 4:if(!window.Zonos.isBigCommerce)return[3,7];return[4,Fe()];case 5:f=T.sent().shouldBypass;if(f){de("Bypass customer group detected, redirecting to BigCommerce native checkout","info");window.location.href=Be("/checkout");return[2]}return[4,Je()];case 6:v=T.sent();if(v.shouldForceLogin&&v.redirectUrl){window.location.href=v.redirectUrl;return[2]}T.label=7;case 7:c.isFetchingSession=true;this.open=true;T.label=8;case 8:T.trys.push([8,11,,12]);return[4,this.buildCartAndInit()];case 9:m=T.sent();if(!m){throw new Error("Error building cart")}(e=window.opener)===null||e===void 0?void 0:e.postMessage({checkoutSessionId:K.checkoutSessionId,type:"zonos-checkout-session-update"},"*");p({isPreview:this.preview,sessionTimeout:xo});D({event:"zonos-checkout-start",metadata:{checkoutSessionId:K.checkoutSessionId}});g=K.checkoutSessionId;void w({checkoutSessionId:g,eventName:"checkout_open"});return[4,xe()];case 10:y=T.sent().enabled;d.shouldHideDiscountInput=!y;this.handleOrderDuplication();if(window.Zonos.isLegacyCheckout){void vo()}else{b=performance.now();_=b-i;void mo({loadTime:_})}this.recordCheckoutInfo();C=!!pe();if(C){this.markTheSessionAsAbandonedCart()}return[3,12];case 11:x=T.sent();if(x instanceof Error){S=x.message;if(S==="Cart is expired."){this.isCartExpired=true}}c.isFetchingSession=false;te(x);if(this.isCartExpired){c.isFetchingSession=true;return[2]}void se({endpoint:"Error creating Checkout",errors:[x instanceof Error?x.toString():"Unknown error"],metadata:{allLogs:he,cartId:window.Zonos.cartId,checkoutSessionBody:z(),href:window.location.href,storeBaseUrl:((r=window.Zonos.cartData)===null||r===void 0?void 0:r.storeBaseUrl)||J.onlineStoreSettings.url}});k({messages:[W("There's been an error creating your checkout session. Please reload and try again or contact support if the error persists")],title:W("Error creating Checkout")});return[3,12];case 12:return[2]}}))}))}),{capture:true,passive:false});if(!J.checkoutSettings.disablePlaceOrderButtonActivation){n.removeAttribute("disabled")}n.setAttribute("data-zonos-checkout-attached","true");if(n.matches("#".concat(ge))){n.dispatchEvent(ze("click"));y();n.remove()}if(n.matches("#".concat(ve))){n.dispatchEvent(ze("click"));n.remove()}}))};e.prototype.appearanceSettingsOverrideChanged=function(){if(!this.appearanceSettingsOverride){return}void this.applyStripeTheme()};e.prototype.useShippingDataFromCreateCartId=function(e){if(!e){return}de("shipping data from createCartId result","info",Object.entries(e));var o=e.customerAddress1,t=e.customerAddress2,n=e.customerCity,r=e.customerCountry,i=e.customerEmail,s=e.customerFirstName,c=e.customerLastName,a=e.customerName,u=e.customerPhone,d=e.customerState,l=e.customerZip;var h=new URLSearchParams(window.location.search);var f=r||G(h)||H.selectedCountryCode;this.applyPrefillAddress({customerAddress1:o,customerAddress2:t,customerCity:n,customerCountry:f,customerEmail:i,customerFirstName:s,customerLastName:c,customerName:a,customerPhone:u,customerState:d,customerZip:l})};e.prototype.useLegacyQueryParams=function(){var e=new URLSearchParams(window.location.search);de("legacy urlParams","info",Object.fromEntries(e.entries()));var o=function(o){var t=e.get(o);if(!t||t==="undefined"){return null}return t};var t=G(e)||H.selectedCountryCode;var n=o("customerCity");var r=o("customerEmail");var i=o("customerAddress1");var s=o("customerAddress2");var c=o("customerName");var a=o("customerFirstName");var u=o("customerLastName");var d=o("customerPhone");var l=o("customerZip");var h=o("customerState");this.applyPrefillAddress({customerAddress1:i,customerAddress2:s,customerCity:n,customerCountry:t,customerEmail:r,customerFirstName:a,customerLastName:u,customerName:c,customerPhone:d,customerState:h,customerZip:l})};e.prototype.applyPrefillAddress=function(e){var o=e.customerAddress1||"";var t=e.customerCountry||"";var n=e.customerAddress2||"";var r=e.customerCity||"";var i=e.customerEmail||"";var s=e.customerFirstName&&e.customerLastName?"".concat(e.customerFirstName," ").concat(e.customerLastName):e.customerName||"";var c=e.customerPhone||"";var a=e.customerZip||"";var u=e.customerState||"";if(!o||!s||!c||!t){de("Missing required query params so it can not be prefilled","info",[!o&&"line1",!s&&"name",!c&&"phone",!t&&"country"].filter(Boolean).join(", "));return}if(t&&H.shippingZoneCountries&&!(t in H.shippingZoneCountries)){de('Country "'.concat(t,'" is not in the shipping zone, so it can not be prefilled'),"warn");return}this.defaultAddressParams=[{address:{city:r||"",country:t,line1:o,line2:n,postal_code:a,state:u},email:i,name:s,phone:c}];de("Prefill address applied","info",{prefillAddress:this.defaultAddressParams,providedAddress:e})};e.prototype.overrideStagingModeChanged=function(){d.isStagingMode=!!this.overrideStagingMode};e.prototype.init=function(){return __awaiter(this,void 0,void 0,(function(){var e;var o=this;return __generator(this,(function(t){c.stripe=window.Zonos.stripe;this.stripe=window.Zonos.stripe;d.isStagingMode=ce();if(typeof this.overrideStagingMode!=="undefined"){d.isStagingMode=this.overrideStagingMode}Re();qe();oo();this.handleBigcommerceInternationalResumeFlag();void this.prefillBigCommerceCustomerAddresses();uo({domesticRedirectedBtnSelector:ge,onInternationalCheckoutSelected:function(){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:this.detectedDomesticCheckoutDialogOpen=true;return[4,new Promise((function(e){return setTimeout(e,2e3)}))];case 1:e.sent();return[2]}}))}))},onLoggedInInternationalAddressDetected:function(){return new Promise((function(e){o.loggedInIntlAddressResolver=e;o.loggedInIntlAddressConfirmDialogOpen=true}))},onShippingAddressSessionFound:function(e){o.defaultAddress=[{address:{city:e.city,country:e.countryCode,line1:e.address1,line2:e.address2,postal_code:e.postalCode,state:e.state},email:"",name:"".concat(e.firstName," ").concat(e.lastName),phone:e.phone}]}});if(window.Zonos){this.useLegacyQueryParams()}e=setInterval((function(){c.stripe=window.Zonos.stripe;o.stripe=window.Zonos.stripe;if(!o.stripe){de("waiting for stripe to be loaded");return}if(o.storybookPaymentStatusOverride){clearInterval(e);return}de("init checkout");if(o.preview||o.forceDialogOpen){void o.buildCartAndInit()}else if(window.Zonos.isLegacyCheckout){o.attachCheckout()}else if(window){o.attachCheckout();var t=new MutationObserver((function(){o.attachCheckout()}));t.observe(document.body,{childList:true,subtree:true})}clearInterval(e)}),50);setTimeout((function(){clearInterval(e)}),1e4);return[2]}))}))};e.prototype.handleBigcommerceInternationalResumeFlag=function(){if(!window.Zonos.isBigCommerce){return}var e=new URL(window.location.href);if(e.searchParams.get(Ee)!=="true"){return}e.searchParams.delete(Ee);window.history.replaceState({},"",e.toString());var o=Date.now();var t=setInterval((function(){if(!H.localizationLoaded||!H.selectedCountryCode){if(Date.now()-o>15e3){clearInterval(t);de("BigCommerce international checkout resume flag: localization did not initialize within 15s","info")}return}var e=document.querySelector("#".concat(me));if(e){clearInterval(t);e.dispatchEvent(ze("click"));return}if(Date.now()-o>15e3){clearInterval(t);de("BigCommerce international checkout resume flag: trigger button did not mount within 15s","info")}}),200)};e.prototype.setToFinishStep=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){d.step="finish";this.storybookPaymentStatusOverride=e;return[2]}))}))};e.prototype.mockCheckoutSession=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){b(e);return[2]}))}))};e.prototype.triggerCheckoutInternational=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(o){e=document.querySelector("#".concat(me));if(e){e.dispatchEvent(ze("click"))}return[2]}))}))};e.prototype.handleCustomerInfoContinue=function(){return __awaiter(this,void 0,void 0,(function(){var e,o,t,n,r,i,s,a;var u=this;return __generator(this,(function(l){switch(l.label){case 0:D({event:"zonos-checkout-customer-info",metadata:{checkoutSessionId:K.checkoutSessionId}});r=K.checkoutSessionId;void w({checkoutSessionId:r,eventName:"checkout_customerInfoCompleted"});this.submitLoading=true;return[4,_()];case 1:i=l.sent().isRequestNotReady;if(i&&d.addressFormRenderType==="stripe"){void se({endpoint:"ADDRESS_NOT_READY_AT_CUSTOMER_INFO_CONTINUE",errors:["Address not ready at customer info continue"],metadata:{address:(o=(e=c.stripeAddressEventData)===null||e===void 0?void 0:e.value)===null||o===void 0?void 0:o.address,billingAddress:(n=(t=c.stripeBillingAddressEventData)===null||t===void 0?void 0:t.value)===null||n===void 0?void 0:n.address,cartId:window.Zonos.cartId}})}s=function(e){if(d.step!=="customer-info"){clearInterval(e);return}if(!c.isFetchingLandedCost){if(d.landedCostData){void F({currency:d.currency});C()}u.submitLoading=false;if(e){clearInterval(e)}}};s();a=setInterval((function(){s(a)}),20);setTimeout((function(){clearInterval(a)}),1e4);return[2]}}))}))};e.prototype.handleShippingContinue=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){C();return[2]}))}))};e.prototype.handleInventoryCheckDialogConfirm=function(){d.inventoryCheckErrorMessage=null;if(!this.isLegacyCheckout){void this.closeDialogHandler({confirmed:true})}};e.prototype.handleCartExpiredDialogConfirm=function(){var e;this.isCartExpired=false;if(this.isLegacyCheckout){var o=(e=window.Zonos.cartData)===null||e===void 0?void 0:e.storeBaseUrl;if(!o){return}if(window.parent){window.parent.location.href=o}window.location.href=o;return}if(window.parent){window.parent.location.href=window.location.href}window.location.reload()};e.prototype.handleStripePaymentContinue=function(){return __awaiter(this,void 0,void 0,(function(){var e,o,t,n,r,i,s,a,u,l;return __generator(this,(function(h){switch(h.label){case 0:e=c.checkoutSettlementCurrency==="USD";if(e&&c.shouldRenderPayInUsdButton&&!this.payInUsdConfirmDialogOpen){this.payInUsdConfirmDialogOpen=true;return[2]}this.payInUsdConfirmDialogOpen=false;R.paypalErrorMessage=null;c.hasPaymentError=false;this.submitLoading=true;d.inventoryCheckErrorMessage=null;return[4,x()];case 1:o=h.sent();if(!o){c.hasPaymentError=true;c.customErrorMessage=W("Unable to complete payment in [currency]. Please try again or select a different currency. If the issue persists, contact our support team for assistance.",{currency:c.checkoutSettlementCurrency});this.submitLoading=false;return[2]}h.label=2;case 2:h.trys.push([2,4,,5]);t=d;return[4,S()];case 3:t.inventoryCheckErrorMessage=h.sent();return[3,5];case 4:n=h.sent();d.inventoryCheckErrorMessage=W("Unable to check inventory. Please try again.");return[3,5];case 5:if(d.inventoryCheckErrorMessage){this.submitLoading=false;return[2]}r=N();if(!(r>0))return[3,7];return[4,T()];case 6:i=h.sent();if(!i.success){c.hasPaymentError=true;c.customErrorMessage=i.error||W("Unable to apply store credit. Please try again.");this.submitLoading=false;return[2]}h.label=7;case 7:if(!I())return[3,13];h.label=8;case 8:h.trys.push([8,11,,12]);return[4,A()];case 9:s=h.sent();if(!s.valid){c.hasPaymentError=true;c.customErrorMessage=s.errorMessage;this.submitLoading=false;return[2]}return[4,O()];case 10:a=h.sent();if(!a.success){c.hasPaymentError=true;c.customErrorMessage=a.error||W("Unable to place order with store credit. Please try again.");this.submitLoading=false;return[2]}C();v();return[3,12];case 11:u=h.sent();te(u);D({event:"zonos-checkout-payment-fail",metadata:{checkoutSessionId:K.checkoutSessionId}});c.hasPaymentError=true;return[3,12];case 12:this.submitLoading=false;return[2];case 13:h.trys.push([13,15,,16]);return[4,E()];case 14:h.sent();C();v();return[3,16];case 15:l=h.sent();te(l);D({event:"zonos-checkout-payment-fail",metadata:{checkoutSessionId:K.checkoutSessionId}});c.hasPaymentError=true;if(c.shouldInventoryRefund){void U();c.shouldInventoryRefund=false}return[3,16];case 16:this.submitLoading=false;return[2]}}))}))};e.prototype.handleFinishClick=function(){return __awaiter(this,void 0,void 0,(function(){var e,o,t,n;return __generator(this,(function(r){switch(r.label){case 0:L();if(!this.preview)return[3,2];d.step="customer-info";return[4,this.init()];case 1:r.sent();return[2];case 2:h();if(window.Zonos.isLegacyCheckout&&window.Zonos.cartData){e=window.Zonos.cartData.storeBaseUrl||J.onlineStoreSettings.url;if(window.parent){window.parent.location.href=e}window.location.href=e;return[2]}o=window.location.href;t=o.split("?")[0];this.open=false;n=window.location.hostname.includes("dashboard.zonos.com");if(!n){window.history.replaceState(window.history.state,document.title,t);window.location.reload()}return[2]}}))}))};e.prototype.handleWindowResize=function(){this.isMobile=ae(this.mobile);void this.applyStripeTheme();de("mobile: ".concat(this.isMobile))};e.prototype.handleMobileChange=function(){this.isMobile=ae(this.mobile);void this.applyStripeTheme();de("mobile: ".concat(this.isMobile))};e.prototype.handleAppearanceSettingsOverrideChange=function(){var e;if((e=this.appearanceSettingsOverride)===null||e===void 0?void 0:e.theme){this.appearanceSettingsOverride.theme=X(this.appearanceSettingsOverride.theme)}};e.prototype.handleAddressChange=function(){L()};e.prototype.handleCustomerProfileChange=function(){var e,o;if(!this.customerProfile){de("No customer profile","info");this.defaultCustomerProfileAddress=[];return}de("Customer profile found","info",{customerProfile:this.customerProfile});this.defaultCustomerProfileAddress=((o=(e=c.customerProfile)===null||e===void 0?void 0:e.locations)===null||o===void 0?void 0:o.map((function(e){var o;return{address:{city:e.locality,country:e.countryCode,line1:e.line1,line2:e.line2||"",postal_code:e.postalCode,state:e.administrativeArea},email:e.email||((o=c.customerProfile)===null||o===void 0?void 0:o.email)||"",name:e.name||"",phone:e.phone||""}})))||[]};e.prototype.handleClientSecretChange=function(){de("==== Client secret changed","info",{clientSecret:this.clientSecret,stripeCustomerSessionClientSecret:this.stripeCustomerSessionClientSecret});void this.applyStripeTheme()};e.prototype.handleOpenChange=function(){var e="data-zonos-overflow-origin";var o=document.body;var t=document.documentElement;if(this.open){window.Zonos.openHelloDialog(false);if(o.style.overflow){o.setAttribute(e,o.style.overflow)}o.style.overflow="hidden";if(t.style.overflow){t.setAttribute(e,t.style.overflow)}t.style.overflow="hidden"}else{this.stripeCustomerSessionClientSecret=null;var n=o.getAttribute(e);var r=t.getAttribute(e);if(n){o.removeAttribute(e);o.style.overflow=n}else{o.style.removeProperty("overflow")}if(r){t.removeAttribute(e);t.style.overflow=r}else{t.style.removeProperty("overflow")}}};e.prototype.componentWillLoad=function(){var e=this;void this.init();this.isMobile=ae(this.mobile);this.isIframed=window.self!==window.top;de("iframed: ".concat(this.isIframed));if(window.Zonos.isLegacyCheckout){this.captureParamsRedirectedForVariantTest()}this.handleAppearanceSettingsOverrideChange();this.storeUnsubscribeList=[Y("selectedLocale",(function(){void e.applyStripeTheme()})),B("selectedShippingOption",(function(){var o,t,n,r;var i=d.selectedShippingOption;if(((o=J.genericSettings)===null||o===void 0?void 0:o.shouldFedExShippingConsentForCanadianShopper)&&((n=(t=i===null||i===void 0?void 0:i.shippingProfile)===null||t===void 0?void 0:t.serviceLevel.code)===null||n===void 0?void 0:n.toLowerCase().startsWith("fedex."))&&((r=c.stripeAddressEventData)===null||r===void 0?void 0:r.value.address.country)==="CA"){e.shouldShowFedexShippingConsentDialog=true}})),P("stripeAddressEventData",(function(o){var t;if(!window.Zonos.isBigCommerce||!o||e.redirectToDomesticCheckoutDialogOpen||!((t=J.genericSettings)===null||t===void 0?void 0:t.isBigcommerceDomesticCheckoutRedirectEnabled)||J.sourceCurrency!=="USD"){return}if(!e.open){return}if(window.location.pathname.includes("/checkout")){return}var n=o.value.address.country;if(n&&J.disabledCountries.includes(n)){e.redirectToDomesticCheckoutDialogOpen=true;de("Domestic country ".concat(n," selected in international checkout, redirecting to BigCommerce domestic checkout"),"info");setTimeout((function(){window.location.href=Be("/checkout")}),2e3)}}))];this.initializeTestKeys();window.addEventListener("message",this.handleHostedOpenWindowCallback);de("mobile: ".concat(this.isMobile))};e.prototype.disconnectedCallback=function(){L();h();this.storeUnsubscribeList.forEach((function(e){return e()}));window.removeEventListener("message",this.handleHostedOpenWindowCallback)};e.prototype.render=function(){var e=this;var o,i,s,a;this.customerProfile=c.customerProfile;this.clientSecret=c.clientSecret;if(c.stripeCustomerSessionClientSecret){this.stripeCustomerSessionClientSecret=c.stripeCustomerSessionClientSecret}var u=d.step!=="finish"&&d.step!=="error"&&!c.stripeElements||c.isFetchingSession;var l=$(J.appearance,this.appearanceSettingsOverride||null),h=l.colorPrimary,f=l.colorSecondary,v=l.logoUrl,m=l.style;var g=J.appearance.zonosAttribution==="ENABLED";var p=J.appearance.theme;var w=h&&ye(h)?"DARK":"LIGHT";var z=this.isMobile?p:w;var k=!this.isMobile?f:undefined;var y=H.customMessages;var b=(o=y.find((function(e){return e.pageName==="checkout_default"})))===null||o===void 0?void 0:o.message;var _=this.getCurrentLocalePageEnum();var C=y.filter((function(e){return e.pageName===_}));var x=this.getBaseCurrencySettlementInfo();var S=function(){var o=e.preview?"".concat(v,"?timestamp=").concat(Date.now()):v;return t("div",{class:"zonos--logo"},o&&t("img",{alt:"".concat(J.organizationName," logo"),src:o}))};var T=ne();var I=function(){var o=new URLSearchParams(window.location.search);var n=o.get("zonosQaUrl");var r=o.get("zonosDebug");var i=o.get("zonosE2ETest");var s=e.overrideStagingMode||ce();return t("zonos-v-stack",null,t("div",{class:"zonos--logo-wrapper"},S(),T&&t("zonos-badge",{badgeColor:"orange",size:"small"},W("Test mode")),s&&t("zonos-badge",{badgeColor:"red",size:"small"},W("Staging mode")),r==="1"&&t("zonos-badge",{badgeColor:"cyan",size:"small"},"debug"),n&&t("zonos-badge",{badgeColor:"purple",size:"small"},n),i&&t("zonos-badge",{badgeColor:"gray",size:"small"},"E2E Test")),t("zonos-checkout-progress-tabs",{backgroundColor:e.isMobile?"--zonos-elements-gray-0":null}),C.map((function(e){return t("zonos-custom-message",{icon:bo,message:e.message})})))};var A=function(){if(d.checkoutSessionTimeoutShow){return t("zonos-rest-state",{class:"zonos--session-timeout",restStateSubtitle:W("Your checkout session has expired. Please reload the page to continue."),restStateTitle:W("Session timed out"),restStateType:"Warning"},t("zonos-button",{onClick:function(){return e.reloadCheckoutSession()},variant:"primary"},W("Reload")))}return t("div",{class:"zonos--content",style:{"--zonos--border-radius":ke({overrideBorderStyle:m})}},d.step!=="finish"&&d.step!=="error"&&t(n,null,t("div",{class:"zonos--left","data-theme":z,style:be({"--zonos--primary-color":!e.isMobile?h:undefined})},!e.isMobile&&I(),d.step==="customer-info"&&t("zonos-customer-info",{continueLoading:e.submitLoading,defaultAddress:e.getDefaultAddress(),isMobile:e.isMobile,onContinueClicked:function(){return e.handleCustomerInfoContinue()},submitBtnColor:k}),d.step==="shipping"&&t("zonos-shipping",{continueLoading:e.submitLoading,isMobile:e.isMobile,onContinueClicked:function(){return e.handleShippingContinue()},submitBtnColor:k}),d.step==="payment"&&t("zonos-checkout-payment",{continueLoading:e.submitLoading,isMobile:e.isMobile,onContinueClicked:function(){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,this.handleStripePaymentContinue()];case 1:e.sent();return[2]}}))}))},submitBtnColor:k})),t("div",{class:"zonos--right","data-theme":p},e.isMobile&&I(),t("div",{class:"zonos--right-actions"},window.Zonos.showBaseForeign&&t("zonos-currency-toggle",null),!e.isLegacyCheckout&&t("zonos-button",{class:"zonos--close-button",icon:t("zonos-icon",{"aria-label":"Close checkout dialog",content:_e}),noBackground:true,onClick:function(){return e.closeDialogHandler()}})),t("div",{class:"flex--wrapper"},t("div",{class:"zonos--wrapper"},t("zonos-review",{collapsed:e.collapseReviewMobile,mobile:e.isMobile,onClick:function(){if(!e.isMobile){return}e.collapseReviewMobile=!e.collapseReviewMobile}}),t("zonos-collapse",{collapsed:e.collapseReviewMobile&&e.isMobile},t("zonos-cart-items",null),e.isMobile&&t("zonos-v-stack",{spacing:16},t("zonos-cart-subtotal",{submitBtnColor:k}),t("zonos-custom-message",{class:"zonos--checkout-default-message",icon:bo,message:b})))),t("zonos-cart-restricted-items",null),!e.isMobile&&t("zonos-v-stack",{spacing:16},t("zonos-cart-subtotal",null),t("zonos-custom-message",{class:"zonos--checkout-default-message",icon:bo,message:b}))))),(d.step==="finish"||d.step==="error")&&t("div",{class:"zonos--done","data-theme":p},t("div",{class:"zonos--header"},S(),!e.isRedirectAfterOrder&&t("zonos-button",{class:"zonos--close-button",icon:t("zonos-icon",{"aria-label":"Close checkout dialog",content:_e}),noBackground:true,onClick:function(){return e.handleFinishClick()},theme:p})),t("zonos-checkout-finish",{borderRadius:m,onCloseClick:function(){return e.handleFinishClick()},overrideNotification:d.step==="error"&&!!d.error?Object.assign(Object.assign({},d.error),{type:"error"}):undefined,storybookForceStatus:e.storybookPaymentStatusOverride})),t("zonos-checkout-footer",{"data-theme":p,mobile:e.isMobile,slot:!e.isMobile?"dialog-footer":undefined}))};return t(r,{class:we(["zonos--checkout zonos--elements",d.step==="payment"&&"zonos--processing-payment",g&&"has-footer",this.preview&&"preview",this.isMobile&&"mobile",this.isIframed&&"iframed",this.hiddenMode&&"hidden-mode"])},this.preview?A():t("zonos-dialog",{borderStyle:m,class:"zonos--checkout-dialog","data-theme":p,height:"980px",isLoading:u,mobile:this.isMobile,noBodyPadding:true,noBorder:true,noClickOutside:true,noCloseButton:true,onCloseDialog:function(){return e.closeDialogHandler()},open:this.open,width:"1200px"},A()),t("zonos-dialog",{isLoading:true,loadingText:W("You will be redirected to international checkout shortly."),loadingTitle:W("We detected that you are shipping to an international address."),noClickOutside:true,noCloseButton:true,open:this.detectedDomesticCheckoutDialogOpen,width:"450px"}),t("zonos-dialog",{isLoading:true,loadingText:W("You will be redirected to domestic checkout shortly."),loadingTitle:W("We detected that you are shipping to a domestic address."),noClickOutside:true,noCloseButton:true,open:this.redirectToDomesticCheckoutDialogOpen,width:"450px"}),t("zonos-confirm-dialog",{class:"zonos--logged-in-intl-address-dialog",dialogCancelBtnText:W("Stay on this page"),dialogConfirmBtnText:W("Continue to international checkout"),dialogIntent:"info",dialogOpen:this.loggedInIntlAddressConfirmDialogOpen,dialogSubtitle:W("Your saved default address ships internationally. Would you like to continue to international checkout, or stay here and select a domestic address?"),dialogTitle:W("International shipping address detected"),dialogWidth:480,onCancelClicked:function(){var o;e.loggedInIntlAddressConfirmDialogOpen=false;(o=e.loggedInIntlAddressResolver)===null||o===void 0?void 0:o.call(e,"stay");e.loggedInIntlAddressResolver=null},onConfirmClicked:function(){var o;e.loggedInIntlAddressConfirmDialogOpen=false;(o=e.loggedInIntlAddressResolver)===null||o===void 0?void 0:o.call(e,"redirect");e.loggedInIntlAddressResolver=null}}),t("zonos-confirm-dialog",{class:"zonos--close-confirm-dialog",dialogCancelBtnText:W("Don't close"),dialogConfirmBtnText:W("Close"),dialogIntent:"warn",dialogOpen:this.confirmDialogOpen,dialogSubtitle:W("Would you like to close checkout and return to the site?"),dialogTitle:W("Are you sure?"),onCancelClicked:function(){e.confirmDialogOpen=false},onConfirmClicked:function(){return e.closeDialogHandler({confirmed:true})}}),t("zonos-confirm-dialog",{class:"zonos--order-duplication-dialog",dialogCancelBtnText:W("Return to merchant site"),dialogConfirmBtnText:W("Proceed with order"),dialogIntent:"warn",dialogOpen:!!this.placedOrderInfo,dialogSubtitle:((i=this.placedOrderInfo)===null||i===void 0?void 0:i.zonosOrderNumber)?W("It looks like you placed an order recently ([date] at [time]) under order number #[orderNumber]. Check your email for the order confirmation. Are you sure you want to place another order?",{date:this.formatDate(this.placedOrderInfo.time),orderNumber:this.placedOrderInfo.zonosOrderNumber,time:this.formatTime(this.placedOrderInfo.time)}):W("It looks like you placed an order recently ([date] at [time]). Check your email for the order confirmation. Are you sure you want to place another one?",{date:this.formatDate(((s=this.placedOrderInfo)===null||s===void 0?void 0:s.time)||null),time:this.formatTime(((a=this.placedOrderInfo)===null||a===void 0?void 0:a.time)||null)}),dialogTitle:W("Are you sure?"),dialogWidth:530,onCancelClicked:function(){e.handleCancelOrderDuplication()},onConfirmClicked:function(){e.confirmProceedWithOrderDuplication()}}),t("zonos-confirm-dialog",{class:"zonos--fedex-shipping-dialog",dialogConfirmBtnText:W("Confirm"),dialogIntent:"info",dialogOpen:!!this.shouldShowFedexShippingConsentDialog,dialogSubtitle:t(n,null,W("If you select FedEx Ground as your shipping option, you'll need to complete a General Agency Agreement (GAA) after placing your order. This form allows FedEx to clear your package through Canadian customs on your behalf. FedEx will contact you directly—usually by email or phone—with instructions on how to complete the GAA. To avoid delays or the return of your package, please respond promptly to their request."),t("zonos-link",{href:"https://ftn.fedex.com/us/assets/docs/One-Time_GAA.pdf",target:"_blank"},W("View GAA Form."))),dialogTitle:W("Fedex Shipping Procedure"),dialogType:"alert",dialogWidth:500,onConfirmClicked:function(){return e.shouldShowFedexShippingConsentDialog=false}}),t("zonos-confirm-dialog",{class:"zonos--inventory-check-failure-dialog",dialogConfirmBtnText:W("Return to cart"),dialogIntent:"danger",dialogOpen:!!d.inventoryCheckErrorMessage,dialogSubtitle:d.inventoryCheckErrorMessage,dialogTitle:W("Couldn't place order"),dialogType:"alert",onConfirmClicked:function(){return e.handleInventoryCheckDialogConfirm()}}),x&&t("zonos-confirm-dialog",{class:"zonos--pay-in-usd-dialog",dialogCancelBtnText:W("Cancel"),dialogConfirmBtnText:W("Pay [orderTotal]",{orderTotal:q({amount:x.settlementAmount,currency:"USD"})}),dialogIntent:"warn",dialogOpen:this.payInUsdConfirmDialogOpen,dialogSubtitle:W("By paying in USD, your card will be charged directly with no currency conversion. However, using a non-USD based card may result in additional currency conversion fees at the bank level."),dialogTitle:W("Pay in USD (United States Dollar)?"),dialogType:"confirm",dialogWidth:480,onCancelClicked:function(){e.payInUsdConfirmDialogOpen=false},onConfirmClicked:function(){return e.handleStripePaymentContinue()}}),t("zonos-confirm-dialog",{class:"zonos--shopping-cart-expired-dialog",dialogConfirmBtnText:W("OK"),dialogIntent:"danger",dialogOpen:this.isCartExpired,dialogSubtitle:W("You are being sent back to the shop to re-add items to your cart."),dialogTitle:W("Shopping cart expired"),dialogType:"alert",onConfirmClicked:function(){return e.handleCartExpiredDialogConfirm()}}),t("zonos-loading-overlay",{open:this.isOverlayLoading}))};Object.defineProperty(e,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{appearanceSettingsOverride:["appearanceSettingsOverrideChanged","handleAppearanceSettingsOverrideChange"],overrideStagingMode:["overrideStagingModeChanged"],mobile:["handleMobileChange"],defaultAddress:["handleAddressChange"],customerProfile:["handleCustomerProfileChange"],clientSecret:["handleClientSecretChange"],stripeCustomerSessionClientSecret:["handleClientSecretChange"],open:["handleOpenChange"]}},enumerable:false,configurable:true});return e}());To.style=Co}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(t,n,i,e){function o(t){return t instanceof i?t:new i((function(n){n(t)}))}return new(i||(i=Promise))((function(i,s){function a(t){try{c(e.next(t))}catch(t){s(t)}}function r(t){try{c(e["throw"](t))}catch(t){s(t)}}function c(t){t.done?i(t.value):o(t.value).then(a,r)}c((e=e.apply(t,n||[])).next())}))};var __generator=this&&this.__generator||function(t,n){var i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},e,o,s,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(n){return c([t,n])}}function c(r){if(e)throw new TypeError("Generator is already executing.");while(a&&(a=0,r[0]&&(i=0)),i)try{if(e=1,o&&(s=r[0]&2?o["return"]:r[0]?o["throw"]||((s=o["return"])&&s.call(o),0):o.next)&&!(s=s.call(o,r[1])).done)return s;if(o=0,s)r=[r[0]&2,s.value];switch(r[0]){case 0:case 1:s=r;break;case 4:i.label++;return{value:r[1],done:false};case 5:i.label++;o=r[1];r=[0];continue;case 7:r=i.ops.pop();i.trys.pop();continue;default:if(!(s=i.trys,s=s.length>0&&s[s.length-1])&&(r[0]===6||r[0]===2)){i=0;continue}if(r[0]===3&&(!s||r[1]>s[0]&&r[1]<s[3])){i.label=r[1];break}if(r[0]===6&&i.label<s[1]){i.label=s[1];s=r;break}if(s&&i.label<s[2]){i.label=s[2];i.ops.push(r);break}if(s[2])i.ops.pop();i.trys.pop();continue}r=n.call(t,i)}catch(t){r=[6,t];o=0}finally{e=s=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};System.register(["./p-7261e245.system.js","./p-e3292be8.system.js","./p-37207963.system.js","./p-06c4d422.system.js","./p-3689821f.system.js","./p-01174496.system.js","./p-48d55793.system.js","./p-23e7c655.system.js","./p-d938f42f.system.js","./p-2b8345d8.system.js","./p-e5dfccd8.system.js","./p-5e6f85f0.system.js","./p-eb99a625.system.js","./p-655ec440.system.js"],(function(t){"use strict";var n,i,e,o,s,a,r,c,l,d,h,u,f,p,v,m,z,b,y,g,k,w,x,C,j,I,_,E,A,S;return{setters:[function(t){n=t.r;i=t.d;e=t.h;o=t.a;s=t.g},function(t){a=t.t},function(t){r=t.b;c=t.t;l=t.Q;d=t.E;h=t.q;u=t.d},function(t){f=t.s;p=t.r;v=t.t;m=t.q;z=t.l},function(t){b=t.z;y=t.g;g=t.f},function(t){k=t.l;w=t.i;x=t.s},function(t){C=t.a;j=t.s},function(t){I=t.c},function(t){_=t.l},function(t){E=t.c;A=t.s},function(t){S=t.g},function(){},function(){},function(){}],execute:function(){var O=".sc-zonos-address-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-address-h *.sc-zonos-address{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-address-h img.sc-zonos-address{max-width:100%}.sc-zonos-address-h dl.sc-zonos-address,.sc-zonos-address-h dd.sc-zonos-address,.sc-zonos-address-h h1.sc-zonos-address,.sc-zonos-address-h h2.sc-zonos-address,.sc-zonos-address-h h3.sc-zonos-address,.sc-zonos-address-h h4.sc-zonos-address,.sc-zonos-address-h h5.sc-zonos-address,.sc-zonos-address-h h6.sc-zonos-address,.sc-zonos-address-h hr.sc-zonos-address,.sc-zonos-address-h figure.sc-zonos-address,.sc-zonos-address-h p.sc-zonos-address,.sc-zonos-address-h pre.sc-zonos-address{margin:0}.sc-zonos-address-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-address-h .zonos--title.sc-zonos-address{margin-bottom:16px}.sc-zonos-address-h .zonos--company-name-input.sc-zonos-address,.sc-zonos-address-h .zonos--tax-id-input.sc-zonos-address,.sc-zonos-address-h .zonos--short-address-code-input.sc-zonos-address{margin-bottom:16px}.sc-zonos-address-h zonos-banner.sc-zonos-address{margin-top:8px}";var L=O;var Z=t("zonos_address",function(){function t(t){n(this,t);this.invalidCharacters=i(this,"invalidCharacters",7);this.taxIdChanged=i(this,"taxIdChanged",7);this.storeUnsubscribeList=[];this.isAutoCompleteAdjusted=false;this.defaultAddress=[];this.taxIdErrorMessage="";this.shortAddressCodeErrorMessage="";this.stripe=window.Zonos.stripe;this.isDirtyAddress=false;this.isAddressFilled=false;this.checkoutSessionId=f.checkoutSessionId;this.prevCountry=null;this.prevPostalCode=null;this.trackingSent=false;this.prefetchLandedCost=a(h,1e3)}t.prototype.getStripeAddressInstance=function(){if(this.type==="billing"){return{stripeAddressElement:r.stripeBillingAddressElement,stripeAddressEventData:r.stripeBillingAddressEventData,stripeElements:r.stripeElementsForBillingAddress}}return{stripeAddressElement:r.stripeAddressElement,stripeAddressEventData:r.stripeAddressEventData,stripeElements:r.stripeElements}};t.prototype.updateAddressEventData=function(t){var n=t.event,i=t.type;switch(i){case"billing":r.stripeBillingAddressEventData=n;break;default:{r.stripeAddressEventData=n;break}}if(i==="shipping"){if(n.value.address.line1.length){void this.prefetchLandedCost()}}};t.prototype.isAddressFilledChanged=function(){if(!f.checkoutSessionId){return}if(this.isAddressFilled&&!this.trackingSent&&this.type==="shipping"){this.trackingSent=true;var t=f.checkoutSessionId;void c({checkoutSessionId:t,eventName:"checkout_customerInfoFilled"})}};t.prototype.updateAddressElement=function(t){var n=t.stripeAddressElement,i=t.type;if(i==="shipping"){r.stripeAddressElement=n;return}r.stripeBillingAddressElement=n};t.prototype.watchInitStripe=function(){return __awaiter(this,void 0,void 0,(function(){var t,n,i,e,o,s,a,r,c,d;var h=this;return __generator(this,(function(u){this.stripe=window.Zonos.stripe;t=this.getStripeAddressInstance(),n=t.stripeAddressEventData,i=t.stripeElements;if(!this.stripe||!i){k("Stripe is not initialized. Couldn't load stripe element.");return[2]}e=this.defaultAddress.map((function(t){return Object.assign(Object.assign({},t),{name:t.name,phone:t.phone||undefined})}));o=z.shippingZoneCountries;s=o?Object.values(o).map((function(t){return t.code})):[];a=new URLSearchParams(window.location.search).has("zonosCheckoutAllCountries");r=this.type==="shipping"?s:[];c=(n===null||n===void 0?void 0:n.value.address.country)||p(r);_("Stripe country code: ".concat(c),"info");d=i.create("address",{allowedCountries:a?[]:r,contacts:e.length&&!n?this.defaultAddress:[],defaultValues:{address:Object.assign(Object.assign({},n===null||n===void 0?void 0:n.value.address),{country:c}),firstName:n===null||n===void 0?void 0:n.value.firstName,lastName:n===null||n===void 0?void 0:n.value.lastName,phone:n===null||n===void 0?void 0:n.value.phone},display:{name:"split"},fields:{phone:"always"},mode:this.type,validation:{phone:{required:"always"}}});d.mount(this.el.querySelector(".zonos--address-component"));if(n===null||n===void 0?void 0:n.value.address){this.prevCountry=n.value.address.country;this.prevPostalCode=n.value.address.postal_code}d.on("change",(function(t){var n=t.value;if(!h.isDirtyAddress&&n.address.line1.length>=3){h.isDirtyAddress=true;if(!h.isAutoCompleteAdjusted){var i=h.el.querySelector('iframe[src*="autocomplete-suggestions"]');if(i){i.style.zIndex="3"}h.isAutoCompleteAdjusted=true}setTimeout((function(){if(w()){h.el.scrollIntoView({behavior:"smooth",block:"end"})}else{var t=h.type==="shipping"?100:600;var n=h.el.closest(".zonos--group");var i=h.el.getBoundingClientRect().top+t;n===null||n===void 0?void 0:n.scrollTo({behavior:"smooth",top:i})}}),600)}var e=l({firstName:n.firstName,lastName:n.lastName,name:n.name}),o=e.firstName,s=e.lastName;h.updateAddressEventData({event:Object.assign(Object.assign({},t),{elementMode:h.type,elementType:"address",value:Object.assign(Object.assign({},n),{firstName:o,lastName:s})}),type:h.type})}));this.updateAddressElement({stripeAddressElement:d,type:this.type});return[2]}))}))};t.prototype.defaultAddressChanged=function(t,n){var i=JSON.stringify(n);var e=JSON.stringify(t);if(i===e){return}_("Reset address element when default address property is changed","info",{defaultAddress:this.defaultAddress});var o=this.getStripeAddressInstance().stripeAddressElement;o===null||o===void 0?void 0:o.clear();o===null||o===void 0?void 0:o.destroy();if(this.type==="shipping"){r.stripeAddressEventData=null}else{r.stripeBillingAddressEventData=null}void this.watchInitStripe()};t.prototype.isInTaxIdCountry=function(t){return E.includes(t)};t.prototype.renderTaxIdInput=function(){var t=this;var n;if(this.type==="billing"){return null}var i=(n=r.stripeAddressEventData)===null||n===void 0?void 0:n.value.address.country;if(!i){return null}if(!this.isInTaxIdCountry(i)){return null}var o=C({companyName:r.companyName,countryCode:i});if(!o){return null}var s=A[i];return e("div",{class:"zonos--tax-id-input"},e("zonos-stripe-input",{inputLabel:v(s.friendlyName),inputPlaceholder:s.placeholder,inputValue:r.taxId||"",isError:!!this.taxIdErrorMessage,onInputChange:function(n){r.taxId=n.detail;t.taxIdChanged.emit(n.detail)}}),this.taxIdErrorMessage&&e("zonos-text",{textColor:"red-600",type:"caption"},this.taxIdErrorMessage))};t.prototype.renderShortAddressCodeInput=function(){var t;if(this.type==="billing"){return null}var n=(t=r.stripeAddressEventData)===null||t===void 0?void 0:t.value.address.country;if(!n){return null}var i=j({countryCode:n});if(!i){return null}return e("div",{class:"zonos--short-address-code-input"},e("zonos-stripe-input",{inputLabel:v("Short address code"),inputPlaceholder:"RRRD2929",inputValue:r.shortAddressCode||"",isError:!!this.shortAddressCodeErrorMessage,onInputChange:function(t){r.shortAddressCode=t.detail}}),this.shortAddressCodeErrorMessage&&e("zonos-text",{textColor:"red-600",type:"caption"},this.shortAddressCodeErrorMessage))};t.prototype.renderCompanyNameInput=function(){if(this.type==="billing"&&!window.Zonos.isCollect&&!window.Zonos.isInvoice){return null}var t=b.checkoutSettings.companyFieldsStatus==="ENABLED"||!!window.Zonos.isCollect||!!window.Zonos.isInvoice;if(!t){return null}return e("zonos-stripe-input",{class:"zonos--company-name-input",inputLabel:v("Company name (optional)"),inputValue:r.companyName,onInputChange:function(t){r.companyName=t.detail}})};t.prototype.disconnectedCallback=function(){var t=this.getStripeAddressInstance().stripeAddressElement;t===null||t===void 0?void 0:t.destroy();try{this.storeUnsubscribeList.forEach((function(t){return t()}))}catch(t){}};t.prototype.componentDidLoad=function(){var t=this;var n=this.getStripeAddressInstance().stripeAddressEventData;this.isDirtyAddress=!!n&&n.value.address.line1.length>0;void this.watchInitStripe();this.checkoutSessionId=f.checkoutSessionId;this.storeUnsubscribeList=[m("checkoutSessionId",(function(){t.checkoutSessionId=f.checkoutSessionId})),d("stripeElements",(function(){if(t.type==="shipping"){void t.watchInitStripe()}})),d("stripeElementsForBillingAddress",(function(){if(t.type==="billing"){void t.watchInitStripe()}}))]};t.prototype.render=function(){var t;this.checkoutSessionId=f.checkoutSessionId;if((t=r.stripeAddressEventData)===null||t===void 0?void 0:t.complete){this.isAddressFilled=true}return e(o,{key:"ebba5be32c456e8b71d397db63e666e5d5df1543",class:I(["zonos--address","zonos--elements","zonos--".concat(this.type,"-address")])},this.titleText&&e("zonos-text",{key:"25f15ea17b50ed055eb98b072850296312785b06",class:"zonos--title",type:"semiBoldLabel"},this.titleText),e("slot",{key:"631bc324d1bb96fb9e796b38a6da42ef6ca601a3",name:"below-title"}),this.renderCompanyNameInput(),this.renderTaxIdInput(),this.renderShortAddressCodeInput(),e("div",{key:"25f88c72f8fc9b788b042f2df2f1b8085132f683",class:"zonos--address-component"}))};Object.defineProperty(t.prototype,"el",{get:function(){return s(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{checkoutSessionId:["isAddressFilledChanged"],isAddressFilled:["isAddressFilledChanged"],stripe:["watchInitStripe"],defaultAddress:["defaultAddressChanged"]}},enumerable:false,configurable:true});return t}());Z.style=L;var N='<svg color="var(--zonos-elements-red-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" style="display: block;">\n <path d="M12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Z" data-is-secondary-color="true" fill="var(--zonos-elements-red-400)"></path>\n <path d="M12.75 9a.75.75 0 0 0-1.5 0v2.5a.75.75 0 0 0 1.5 0V9Zm0 5.5a.75.75 0 0 0-1.5 0v.5a.75.75 0 0 0 1.5 0v-.5Z" fill="currentColor"></path>\n</svg>';var B='<svg color="var(--zonos-elements-blue-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" style="display: block;">\n <path d="M12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Z" data-is-secondary-color="true" fill="var(--zonos-elements-blue-400)"></path>\n <path d="M10.25 10.25a1.75 1.75 0 1 1 2.431 1.613c-.616.26-1.431.885-1.431 1.887a.75.75 0 0 0 1.5 0c0-.053.02-.128.108-.228.092-.104.236-.205.408-.278A3.25 3.25 0 1 0 8.75 10.25a.75.75 0 0 0 1.5 0Zm2.5 5.75a.75.75 0 0 0-1.5 0v.25a.75.75 0 0 0 1.5 0V16Z" fill="currentColor"></path>\n</svg>';var D='<svg color="var(--zonos-elements-orange-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" style="display: block;">\n <path d="M14.46 5.492c-1.014-2.027-3.906-2.027-4.92 0L4.276 16.02c-.914 1.83.416 3.98 2.46 3.98h10.528c2.044 0 3.374-2.151 2.46-3.98L14.46 5.492Z" data-is-secondary-color="true" fill="var(--zonos-elements-orange-400)"></path>\n <path d="M12.75 10a.75.75 0 0 0-1.5 0v2.5a.75.75 0 0 0 1.5 0V10Zm0 5.5a.75.75 0 0 0-1.5 0v.5a.75.75 0 0 0 1.5 0v-.5Z" fill="currentColor"></path>\n</svg>';var M=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--backdrop,:host .zonos--confirm-layout{opacity:0;z-index:-999;visibility:hidden;-webkit-transition:opacity 0.3s, visibility 0.3s;transition:opacity 0.3s, visibility 0.3s}:host .zonos--backdrop{width:100vw;height:100vh;left:0;top:0;background:var(--zonos-elements-backdrop-color);position:fixed}:host .zonos--confirm-layout{width:100vw;height:100vh;left:0;top:0;position:fixed;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;color:var(--zonos-elements-text-color)}:host .zonos--confirm-dialog{position:relative;background:var(--zonos-elements-gray-0);max-width:90vw;max-height:90vh;width:var(--zonos--dialog-width);border-radius:var(--zonos--border-radius, 10px);outline:none;-webkit-box-shadow:var(--zonos-elements-v3-shadow-xxl);box-shadow:var(--zonos-elements-v3-shadow-xxl);border:var(--zonos-elements-border);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host .wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:24px;gap:24px}:host .icon-wrapper{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;height:40px;width:40px;border-radius:50%;background:var(--zonos-elements-blue-100)}:host .warn .icon-wrapper{background:var(--zonos-elements-orange-100)}:host .danger .icon-wrapper{background:var(--zonos-elements-red-100)}:host .footer{display:-ms-flexbox;display:flex;width:100%;gap:8px}:host .footer zonos-button{-ms-flex:1;flex:1}:host .content{display:-ms-flexbox;display:flex;gap:8px;-ms-flex-direction:column;flex-direction:column}:host .content zonos-text{text-align:center}:host(.open) .zonos--confirm-layout,:host(.open) .zonos--backdrop{visibility:visible}:host(.open) .zonos--backdrop{z-index:2147483009;opacity:0.65}:host(.open) .zonos--confirm-layout{opacity:1;z-index:2147483010;-webkit-transform:scale(1);transform:scale(1)}";var V=M;var T=t("zonos_confirm_dialog",function(){function t(t){var e=this;n(this,t);this.confirmClicked=i(this,"confirmClicked",7);this.cancelClicked=i(this,"cancelClicked",7);this.dialogTitle=v("Are you sure?");this.dialogIntent="info";this.dialogSubtitle=null;this.dialogWidth=350;this.dialogType="confirm";this.isMobile=false;this.noClickOutside=false;this.clickOutsideDialogHandler=function(t){if(t.target===t.currentTarget&&!e.noClickOutside){e.closeDialogHandler()}}}t.prototype.handleKeyDown=function(t){if(t.key==="Escape"){this.closeDialogHandler()}};t.prototype.focusDialog=function(){var t=this;if(this.dialogOpen){setTimeout((function(){var n,i;(i=(n=t.el.shadowRoot)===null||n===void 0?void 0:n.querySelector(".zonos--backdrop"))===null||i===void 0?void 0:i.focus()}),100)}};t.prototype.confirmDialogHandler=function(){if(!this.dialogOpen){return}this.confirmClicked.emit()};t.prototype.closeDialogHandler=function(){if(!this.dialogOpen){return}this.cancelClicked.emit()};t.prototype.renderIcon=function(){switch(this.dialogIntent){case"info":return e("zonos-icon",{content:B,iconColor:"blue-800"});case"danger":return e("zonos-icon",{content:N,iconColor:"red-800"});case"warn":return e("zonos-icon",{content:D,iconColor:"orange-800"})}};t.prototype.getButtonConfirmVariant=function(){switch(this.dialogIntent){case"warn":return"warning";case"danger":return"danger";default:return"primary"}};t.prototype.render=function(){var t=this;this.focusDialog();var n=S();var i=y(b.appearance.theme);return e(o,{key:"459abd25f9719554dc3b4387a660618056909846",class:I([this.dialogOpen&&"open","zonos--elements"]),"data-dialog-type":this.dialogType,"data-theme":i,style:{"--zonos--border-radius":n,"--zonos--dialog-width":"".concat(this.dialogWidth,"px"),"--zonos--font-family":g()}},e("div",{key:"f8a3c9bdbad91b046b3579eb140aad74e2784f8d",class:"zonos--backdrop",tabIndex:-1}),e("div",{key:"b41d27616223f89adb523269a3a8b982cd3559c7",class:I(["zonos--confirm-layout",this.dialogIntent]),onClick:function(n){return t.clickOutsideDialogHandler(n)}},e("div",{key:"69e7837a2aaaeea468e4887d14cbb0ea61d5f24a",class:"zonos--confirm-dialog",onBlur:function(){t.focusDialog()}},e("div",{key:"28ed6e2da0c8c56a00c46df985f21cf74c551894",class:"wrapper"},e("div",{key:"f20b3f00aeaef6fc306766a52607253554005cf4",class:"icon-wrapper"},this.renderIcon()),e("div",{key:"7bb44bb7a880c599a8cc4615df48257fd0f9c19d",class:"content"},e("div",{key:"584603b01b26b5d242f14c67a14d7b092d54b668",class:"title"},e("zonos-text",{key:"028e06e106587778f6da2301ee44727ab1bf487f",type:"subheader"},this.dialogTitle)),this.dialogSubtitle&&e("div",{key:"c986563425dc6130fa154ce3c8e15c2aa03fb6cb",class:"subtitle"},e("zonos-text",{key:"675899ceea2fd2de38ca8f87aa6ca69e4c7d8fc7",textColor:"gray-800"},this.dialogSubtitle))),e("div",{key:"8a034df1cd91f07e870fd6eccebc2f382edf59fb",class:"footer"},this.dialogType==="confirm"&&e("zonos-button",{key:"72e643fff73dabe0d5381e6ffc7f2237ef00f322",backgroundColor:"gray-0",class:"cancel-button",onClick:function(){return t.closeDialogHandler()},size:"lg",withBoxShadow:true},this.dialogCancelBtnText||v("Cancel")),e("zonos-button",{key:"e247f450feef41b44688b937b38df8e061f386a3",class:"confirm-button",onClick:function(){return t.confirmDialogHandler()},size:"lg",variant:this.getButtonConfirmVariant()},this.dialogConfirmBtnText))))))};Object.defineProperty(t,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"el",{get:function(){return s(this)},enumerable:false,configurable:true});return t}());T.style=V;var P=function(t){var n=/^[a-zA-Z0-9.%_+-]*@[a-zA-Z0-9][a-zA-Z0-9.-]*\.[a-zA-Z0-9]{2,}$/;return n.test(t)};var R=".sc-zonos-link-authentication-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-link-authentication-h *.sc-zonos-link-authentication{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-link-authentication-h img.sc-zonos-link-authentication{max-width:100%}.sc-zonos-link-authentication-h dl.sc-zonos-link-authentication,.sc-zonos-link-authentication-h dd.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h1.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h2.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h3.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h4.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h5.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h6.sc-zonos-link-authentication,.sc-zonos-link-authentication-h hr.sc-zonos-link-authentication,.sc-zonos-link-authentication-h figure.sc-zonos-link-authentication,.sc-zonos-link-authentication-h p.sc-zonos-link-authentication,.sc-zonos-link-authentication-h pre.sc-zonos-link-authentication{margin:0}.sc-zonos-link-authentication-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-link-authentication-h .zonos--title.sc-zonos-link-authentication{margin-bottom:16px}.sc-zonos-link-authentication-h .zonos--input-invalid.sc-zonos-link-authentication{border:2px solid var(--zonos-elements-red-600);border-radius:var(--zonos--border-radius)}";var F=R;var J=51;var q=t("zonos_link_authentication",function(){function t(t){var e=this;n(this,t);this.linkAuthenticationChange=i(this,"linkAuthenticationChange",7);this.storeUnsubscribeList=[];this.defaultEmail=null;this.isEmailError=false;this.stripe=r.stripe;this.isStagingMode=u.isStagingMode;this.clientSecret=r.clientSecret;this.retriesInitializeLink=0;this.setCustomEmailInputToLinkEvent=function(t){var n=P(t);var i={complete:!!n,elementType:"linkAuthentication",empty:!t,value:{email:t}};r.stripeLinkEventData=i};this.handleNormalEmailInput=function(t){var n;var i=t.detail;e.setCustomEmailInputToLinkEvent(i);(n=e.linkAuthenticationChange)===null||n===void 0?void 0:n.emit()}}t.prototype.watchIsStagingMode=function(){var t=this;setTimeout((function(){void t.watchInitStripe()}),0)};t.prototype.watchInitStripe=function(){return __awaiter(this,void 0,void 0,(function(){var t,n,i,e;var o=this;return __generator(this,(function(s){switch(s.label){case 0:if(!this.stripe||!r.stripeElements){return[2]}if(u.isStagingMode||!this.clientSecret){return[2]}t=this.defaultEmail?{email:this.defaultEmail}:undefined;s.label=1;case 1:s.trys.push([1,2,,6]);n=r.stripeLinkElement||r.stripeElements.create("linkAuthentication",{defaultValues:t});i=this.el.querySelector(".zonos--link-authentication-component");if(!i){k("Cannot find container element for linkAuthenticationElement");return[2]}n.mount(i);n.on("change",(function(t){var n;r.stripeLinkEventData=t;(n=o.linkAuthenticationChange)===null||n===void 0?void 0:n.emit()}));r.stripeLinkElement=n;this.retriesInitializeLink=0;if(this.retriesInitializeLink>11){_("Stripe link element initialized","info",{retriesInitializeLink:this.retriesInitializeLink,stripe:this.stripe});void x({endpoint:"stripe-link-authentication-init-long-running",errors:["Stripe link element initialized after 20 retries - 10 seconds"],metadata:{retriesInitializeLink:this.retriesInitializeLink}})}return[3,6];case 2:e=s.sent();if(!(e instanceof Error))return[3,5];this.retriesInitializeLink++;if(!(this.retriesInitializeLink<J))return[3,4];return[4,new Promise((function(t){return setTimeout(t,500)}))];case 3:s.sent();void this.watchInitStripe();s.label=4;case 4:if(this.retriesInitializeLink===J){void x({endpoint:"stripe-link-authentication-init-error",errors:[e.message],metadata:{retriesInitializeLink:this.retriesInitializeLink}})}s.label=5;case 5:return[3,6];case 6:return[2]}}))}))};t.prototype.watchDefaultEmail=function(t,n){var i,e;_("Default email is changed","info",{newDefaultEmail:t,oldDefaultEmail:n});if(n===t){return}if(!t){r.stripeLinkEventData=null}if(u.isStagingMode){this.setCustomEmailInputToLinkEvent(t||"");return}(i=r.stripeLinkElement)===null||i===void 0?void 0:i.clear();(e=r.stripeLinkElement)===null||e===void 0?void 0:e.destroy();r.stripeLinkElement=null;r.stripeLinkEventData=null;_("Reset stripe link element when default email is changed","info",{defaultEmail:t});void this.watchInitStripe()};t.prototype.disconnectedCallback=function(){try{this.storeUnsubscribeList.forEach((function(t){return t()}))}catch(t){}};t.prototype.componentDidLoad=function(){var t=this;this.storeUnsubscribeList=[d("stripeElements",(function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){void this.watchInitStripe();return[2]}))}))})),d("clientSecret",(function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){this.clientSecret=r.clientSecret;return[2]}))}))})),d("stripe",(function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){this.stripe=r.stripe;return[2]}))}))}))];void this.watchInitStripe();if(!this.defaultEmail){return}this.setCustomEmailInputToLinkEvent(this.defaultEmail)};t.prototype.render=function(){var t=this;this.isStagingMode=u.isStagingMode;this.clientSecret=r.clientSecret;var n=function(){var n;if(u.isStagingMode){return e("zonos-stripe-input",{inputLabel:v("Email"),inputValue:t.defaultEmail||((n=r.stripeLinkEventData)===null||n===void 0?void 0:n.value.email)||"",isError:t.isEmailError,onBlur:function(){var n;var i=((n=r.stripeLinkEventData)===null||n===void 0?void 0:n.value.email)||"";if(!i){return}var e=P(i);t.isEmailError=!e},onInputChange:t.handleNormalEmailInput})}return e("div",{class:"zonos--link-authentication-component ".concat(t.isEmailError&&"zonos--input-invalid")})};return e(o,{class:"zonos--link-authentication zonos--elements",style:{"--zonos--border-radius":S()}},this.titleText&&e("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},this.titleText),n(),this.isEmailError&&e("zonos-text",{textColor:"red-600"},v("Please enter a valid email address.")))};Object.defineProperty(t.prototype,"el",{get:function(){return s(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{isStagingMode:["watchIsStagingMode"],stripe:["watchInitStripe"],clientSecret:["watchInitStripe"],defaultEmail:["watchDefaultEmail"]}},enumerable:false,configurable:true});return t}());q.style=F;var G=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--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{position:fixed;inset:0;z-index:2147483010;pointer-events:none;display:block}:host .zonos--loading-overlay{position:fixed;inset:0;width:100vw;height:100vh;background:var(--zonos-elements-backdrop-color);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;opacity:0;visibility:hidden;-webkit-transition:opacity 0.3s ease, visibility 0.3s ease;transition:opacity 0.3s ease, visibility 0.3s ease;z-index:2147483010}:host(.zonos--open){pointer-events:auto}:host(.zonos--open) .zonos--loading-overlay{opacity:0.65;visibility:visible}";var U=G;var $=t("zonos_loading_overlay",function(){function t(t){n(this,t);this.open=false;this.size=40}t.prototype.render=function(){return e(o,{key:"8216ba7271f4eb12153620d0268fd7b5dea632ad",class:I(["zonos--elements",this.open&&"zonos--open"])},e("div",{key:"ad3ab1b7e51b2de173e1b1a489bce3cdacc798f1",class:"zonos--loading-overlay"},e("zonos-spinner",{key:"dc1dd642825268c01c5df120165a7aec85d121e9",size:this.size,spinnerColor:this.spinnerColor})))};return t}());$.style=U}}}));
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(t,n,i,e){function o(t){return t instanceof i?t:new i((function(n){n(t)}))}return new(i||(i=Promise))((function(i,s){function a(t){try{c(e.next(t))}catch(t){s(t)}}function r(t){try{c(e["throw"](t))}catch(t){s(t)}}function c(t){t.done?i(t.value):o(t.value).then(a,r)}c((e=e.apply(t,n||[])).next())}))};var __generator=this&&this.__generator||function(t,n){var i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},e,o,s,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(n){return c([t,n])}}function c(r){if(e)throw new TypeError("Generator is already executing.");while(a&&(a=0,r[0]&&(i=0)),i)try{if(e=1,o&&(s=r[0]&2?o["return"]:r[0]?o["throw"]||((s=o["return"])&&s.call(o),0):o.next)&&!(s=s.call(o,r[1])).done)return s;if(o=0,s)r=[r[0]&2,s.value];switch(r[0]){case 0:case 1:s=r;break;case 4:i.label++;return{value:r[1],done:false};case 5:i.label++;o=r[1];r=[0];continue;case 7:r=i.ops.pop();i.trys.pop();continue;default:if(!(s=i.trys,s=s.length>0&&s[s.length-1])&&(r[0]===6||r[0]===2)){i=0;continue}if(r[0]===3&&(!s||r[1]>s[0]&&r[1]<s[3])){i.label=r[1];break}if(r[0]===6&&i.label<s[1]){i.label=s[1];s=r;break}if(s&&i.label<s[2]){i.label=s[2];i.ops.push(r);break}if(s[2])i.ops.pop();i.trys.pop();continue}r=n.call(t,i)}catch(t){r=[6,t];o=0}finally{e=s=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};System.register(["./p-7261e245.system.js","./p-e3292be8.system.js","./p-b6a36c25.system.js","./p-77c2e465.system.js","./p-3689821f.system.js","./p-01174496.system.js","./p-48d55793.system.js","./p-23e7c655.system.js","./p-d938f42f.system.js","./p-2b8345d8.system.js","./p-e5dfccd8.system.js","./p-5e6f85f0.system.js","./p-eb99a625.system.js","./p-655ec440.system.js"],(function(t){"use strict";var n,i,e,o,s,a,r,c,l,d,h,u,f,p,v,m,z,b,y,g,k,w,x,C,j,I,_,E,A,S;return{setters:[function(t){n=t.r;i=t.d;e=t.h;o=t.a;s=t.g},function(t){a=t.t},function(t){r=t.b;c=t.t;l=t.Q;d=t.E;h=t.q;u=t.d},function(t){f=t.s;p=t.r;v=t.t;m=t.q;z=t.l},function(t){b=t.z;y=t.g;g=t.f},function(t){k=t.l;w=t.i;x=t.s},function(t){C=t.a;j=t.s},function(t){I=t.c},function(t){_=t.l},function(t){E=t.c;A=t.s},function(t){S=t.g},function(){},function(){},function(){}],execute:function(){var O=".sc-zonos-address-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-address-h *.sc-zonos-address{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-address-h img.sc-zonos-address{max-width:100%}.sc-zonos-address-h dl.sc-zonos-address,.sc-zonos-address-h dd.sc-zonos-address,.sc-zonos-address-h h1.sc-zonos-address,.sc-zonos-address-h h2.sc-zonos-address,.sc-zonos-address-h h3.sc-zonos-address,.sc-zonos-address-h h4.sc-zonos-address,.sc-zonos-address-h h5.sc-zonos-address,.sc-zonos-address-h h6.sc-zonos-address,.sc-zonos-address-h hr.sc-zonos-address,.sc-zonos-address-h figure.sc-zonos-address,.sc-zonos-address-h p.sc-zonos-address,.sc-zonos-address-h pre.sc-zonos-address{margin:0}.sc-zonos-address-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-address-h .zonos--title.sc-zonos-address{margin-bottom:16px}.sc-zonos-address-h .zonos--company-name-input.sc-zonos-address,.sc-zonos-address-h .zonos--tax-id-input.sc-zonos-address,.sc-zonos-address-h .zonos--short-address-code-input.sc-zonos-address{margin-bottom:16px}.sc-zonos-address-h zonos-banner.sc-zonos-address{margin-top:8px}";var L=O;var Z=t("zonos_address",function(){function t(t){n(this,t);this.invalidCharacters=i(this,"invalidCharacters",7);this.taxIdChanged=i(this,"taxIdChanged",7);this.storeUnsubscribeList=[];this.isAutoCompleteAdjusted=false;this.defaultAddress=[];this.taxIdErrorMessage="";this.shortAddressCodeErrorMessage="";this.stripe=window.Zonos.stripe;this.isDirtyAddress=false;this.isAddressFilled=false;this.checkoutSessionId=f.checkoutSessionId;this.prevCountry=null;this.prevPostalCode=null;this.trackingSent=false;this.prefetchLandedCost=a(h,1e3)}t.prototype.getStripeAddressInstance=function(){if(this.type==="billing"){return{stripeAddressElement:r.stripeBillingAddressElement,stripeAddressEventData:r.stripeBillingAddressEventData,stripeElements:r.stripeElementsForBillingAddress}}return{stripeAddressElement:r.stripeAddressElement,stripeAddressEventData:r.stripeAddressEventData,stripeElements:r.stripeElements}};t.prototype.updateAddressEventData=function(t){var n=t.event,i=t.type;switch(i){case"billing":r.stripeBillingAddressEventData=n;break;default:{r.stripeAddressEventData=n;break}}if(i==="shipping"){if(n.value.address.line1.length){void this.prefetchLandedCost()}}};t.prototype.isAddressFilledChanged=function(){if(!f.checkoutSessionId){return}if(this.isAddressFilled&&!this.trackingSent&&this.type==="shipping"){this.trackingSent=true;var t=f.checkoutSessionId;void c({checkoutSessionId:t,eventName:"checkout_customerInfoFilled"})}};t.prototype.updateAddressElement=function(t){var n=t.stripeAddressElement,i=t.type;if(i==="shipping"){r.stripeAddressElement=n;return}r.stripeBillingAddressElement=n};t.prototype.watchInitStripe=function(){return __awaiter(this,void 0,void 0,(function(){var t,n,i,e,o,s,a,r,c,d;var h=this;return __generator(this,(function(u){this.stripe=window.Zonos.stripe;t=this.getStripeAddressInstance(),n=t.stripeAddressEventData,i=t.stripeElements;if(!this.stripe||!i){k("Stripe is not initialized. Couldn't load stripe element.");return[2]}e=this.defaultAddress.map((function(t){return Object.assign(Object.assign({},t),{name:t.name,phone:t.phone||undefined})}));o=z.shippingZoneCountries;s=o?Object.values(o).map((function(t){return t.code})):[];a=new URLSearchParams(window.location.search).has("zonosCheckoutAllCountries");r=this.type==="shipping"?s:[];c=(n===null||n===void 0?void 0:n.value.address.country)||p(r);_("Stripe country code: ".concat(c),"info");d=i.create("address",{allowedCountries:a?[]:r,contacts:e.length&&!n?this.defaultAddress:[],defaultValues:{address:Object.assign(Object.assign({},n===null||n===void 0?void 0:n.value.address),{country:c}),firstName:n===null||n===void 0?void 0:n.value.firstName,lastName:n===null||n===void 0?void 0:n.value.lastName,phone:n===null||n===void 0?void 0:n.value.phone},display:{name:"split"},fields:{phone:"always"},mode:this.type,validation:{phone:{required:"always"}}});d.mount(this.el.querySelector(".zonos--address-component"));if(n===null||n===void 0?void 0:n.value.address){this.prevCountry=n.value.address.country;this.prevPostalCode=n.value.address.postal_code}d.on("change",(function(t){var n=t.value;if(!h.isDirtyAddress&&n.address.line1.length>=3){h.isDirtyAddress=true;if(!h.isAutoCompleteAdjusted){var i=h.el.querySelector('iframe[src*="autocomplete-suggestions"]');if(i){i.style.zIndex="3"}h.isAutoCompleteAdjusted=true}setTimeout((function(){if(w()){h.el.scrollIntoView({behavior:"smooth",block:"end"})}else{var t=h.type==="shipping"?100:600;var n=h.el.closest(".zonos--group");var i=h.el.getBoundingClientRect().top+t;n===null||n===void 0?void 0:n.scrollTo({behavior:"smooth",top:i})}}),600)}var e=l({firstName:n.firstName,lastName:n.lastName,name:n.name}),o=e.firstName,s=e.lastName;h.updateAddressEventData({event:Object.assign(Object.assign({},t),{elementMode:h.type,elementType:"address",value:Object.assign(Object.assign({},n),{firstName:o,lastName:s})}),type:h.type})}));this.updateAddressElement({stripeAddressElement:d,type:this.type});return[2]}))}))};t.prototype.defaultAddressChanged=function(t,n){var i=JSON.stringify(n);var e=JSON.stringify(t);if(i===e){return}_("Reset address element when default address property is changed","info",{defaultAddress:this.defaultAddress});var o=this.getStripeAddressInstance().stripeAddressElement;o===null||o===void 0?void 0:o.clear();o===null||o===void 0?void 0:o.destroy();if(this.type==="shipping"){r.stripeAddressEventData=null}else{r.stripeBillingAddressEventData=null}void this.watchInitStripe()};t.prototype.isInTaxIdCountry=function(t){return E.includes(t)};t.prototype.renderTaxIdInput=function(){var t=this;var n;if(this.type==="billing"){return null}var i=(n=r.stripeAddressEventData)===null||n===void 0?void 0:n.value.address.country;if(!i){return null}if(!this.isInTaxIdCountry(i)){return null}var o=C({companyName:r.companyName,countryCode:i});if(!o){return null}var s=A[i];return e("div",{class:"zonos--tax-id-input"},e("zonos-stripe-input",{inputLabel:v(s.friendlyName),inputPlaceholder:s.placeholder,inputValue:r.taxId||"",isError:!!this.taxIdErrorMessage,onInputChange:function(n){r.taxId=n.detail;t.taxIdChanged.emit(n.detail)}}),this.taxIdErrorMessage&&e("zonos-text",{textColor:"red-600",type:"caption"},this.taxIdErrorMessage))};t.prototype.renderShortAddressCodeInput=function(){var t;if(this.type==="billing"){return null}var n=(t=r.stripeAddressEventData)===null||t===void 0?void 0:t.value.address.country;if(!n){return null}var i=j({countryCode:n});if(!i){return null}return e("div",{class:"zonos--short-address-code-input"},e("zonos-stripe-input",{inputLabel:v("Short address code"),inputPlaceholder:"RRRD2929",inputValue:r.shortAddressCode||"",isError:!!this.shortAddressCodeErrorMessage,onInputChange:function(t){r.shortAddressCode=t.detail}}),this.shortAddressCodeErrorMessage&&e("zonos-text",{textColor:"red-600",type:"caption"},this.shortAddressCodeErrorMessage))};t.prototype.renderCompanyNameInput=function(){if(this.type==="billing"&&!window.Zonos.isCollect&&!window.Zonos.isInvoice){return null}var t=b.checkoutSettings.companyFieldsStatus==="ENABLED"||!!window.Zonos.isCollect||!!window.Zonos.isInvoice;if(!t){return null}return e("zonos-stripe-input",{class:"zonos--company-name-input",inputLabel:v("Company name (optional)"),inputValue:r.companyName,onInputChange:function(t){r.companyName=t.detail}})};t.prototype.disconnectedCallback=function(){var t=this.getStripeAddressInstance().stripeAddressElement;t===null||t===void 0?void 0:t.destroy();try{this.storeUnsubscribeList.forEach((function(t){return t()}))}catch(t){}};t.prototype.componentDidLoad=function(){var t=this;var n=this.getStripeAddressInstance().stripeAddressEventData;this.isDirtyAddress=!!n&&n.value.address.line1.length>0;void this.watchInitStripe();this.checkoutSessionId=f.checkoutSessionId;this.storeUnsubscribeList=[m("checkoutSessionId",(function(){t.checkoutSessionId=f.checkoutSessionId})),d("stripeElements",(function(){if(t.type==="shipping"){void t.watchInitStripe()}})),d("stripeElementsForBillingAddress",(function(){if(t.type==="billing"){void t.watchInitStripe()}}))]};t.prototype.render=function(){var t;this.checkoutSessionId=f.checkoutSessionId;if((t=r.stripeAddressEventData)===null||t===void 0?void 0:t.complete){this.isAddressFilled=true}return e(o,{key:"ebba5be32c456e8b71d397db63e666e5d5df1543",class:I(["zonos--address","zonos--elements","zonos--".concat(this.type,"-address")])},this.titleText&&e("zonos-text",{key:"25f15ea17b50ed055eb98b072850296312785b06",class:"zonos--title",type:"semiBoldLabel"},this.titleText),e("slot",{key:"631bc324d1bb96fb9e796b38a6da42ef6ca601a3",name:"below-title"}),this.renderCompanyNameInput(),this.renderTaxIdInput(),this.renderShortAddressCodeInput(),e("div",{key:"25f88c72f8fc9b788b042f2df2f1b8085132f683",class:"zonos--address-component"}))};Object.defineProperty(t.prototype,"el",{get:function(){return s(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{checkoutSessionId:["isAddressFilledChanged"],isAddressFilled:["isAddressFilledChanged"],stripe:["watchInitStripe"],defaultAddress:["defaultAddressChanged"]}},enumerable:false,configurable:true});return t}());Z.style=L;var N='<svg color="var(--zonos-elements-red-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" style="display: block;">\n <path d="M12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Z" data-is-secondary-color="true" fill="var(--zonos-elements-red-400)"></path>\n <path d="M12.75 9a.75.75 0 0 0-1.5 0v2.5a.75.75 0 0 0 1.5 0V9Zm0 5.5a.75.75 0 0 0-1.5 0v.5a.75.75 0 0 0 1.5 0v-.5Z" fill="currentColor"></path>\n</svg>';var B='<svg color="var(--zonos-elements-blue-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" style="display: block;">\n <path d="M12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Z" data-is-secondary-color="true" fill="var(--zonos-elements-blue-400)"></path>\n <path d="M10.25 10.25a1.75 1.75 0 1 1 2.431 1.613c-.616.26-1.431.885-1.431 1.887a.75.75 0 0 0 1.5 0c0-.053.02-.128.108-.228.092-.104.236-.205.408-.278A3.25 3.25 0 1 0 8.75 10.25a.75.75 0 0 0 1.5 0Zm2.5 5.75a.75.75 0 0 0-1.5 0v.25a.75.75 0 0 0 1.5 0V16Z" fill="currentColor"></path>\n</svg>';var D='<svg color="var(--zonos-elements-orange-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" style="display: block;">\n <path d="M14.46 5.492c-1.014-2.027-3.906-2.027-4.92 0L4.276 16.02c-.914 1.83.416 3.98 2.46 3.98h10.528c2.044 0 3.374-2.151 2.46-3.98L14.46 5.492Z" data-is-secondary-color="true" fill="var(--zonos-elements-orange-400)"></path>\n <path d="M12.75 10a.75.75 0 0 0-1.5 0v2.5a.75.75 0 0 0 1.5 0V10Zm0 5.5a.75.75 0 0 0-1.5 0v.5a.75.75 0 0 0 1.5 0v-.5Z" fill="currentColor"></path>\n</svg>';var M=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--backdrop,:host .zonos--confirm-layout{opacity:0;z-index:-999;visibility:hidden;-webkit-transition:opacity 0.3s, visibility 0.3s;transition:opacity 0.3s, visibility 0.3s}:host .zonos--backdrop{width:100vw;height:100vh;left:0;top:0;background:var(--zonos-elements-backdrop-color);position:fixed}:host .zonos--confirm-layout{width:100vw;height:100vh;left:0;top:0;position:fixed;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;color:var(--zonos-elements-text-color)}:host .zonos--confirm-dialog{position:relative;background:var(--zonos-elements-gray-0);max-width:90vw;max-height:90vh;width:var(--zonos--dialog-width);border-radius:var(--zonos--border-radius, 10px);outline:none;-webkit-box-shadow:var(--zonos-elements-v3-shadow-xxl);box-shadow:var(--zonos-elements-v3-shadow-xxl);border:var(--zonos-elements-border);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host .wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:24px;gap:24px}:host .icon-wrapper{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;height:40px;width:40px;border-radius:50%;background:var(--zonos-elements-blue-100)}:host .warn .icon-wrapper{background:var(--zonos-elements-orange-100)}:host .danger .icon-wrapper{background:var(--zonos-elements-red-100)}:host .footer{display:-ms-flexbox;display:flex;width:100%;gap:8px}:host .footer zonos-button{-ms-flex:1;flex:1}:host .content{display:-ms-flexbox;display:flex;gap:8px;-ms-flex-direction:column;flex-direction:column}:host .content zonos-text{text-align:center}:host(.open) .zonos--confirm-layout,:host(.open) .zonos--backdrop{visibility:visible}:host(.open) .zonos--backdrop{z-index:2147483009;opacity:0.65}:host(.open) .zonos--confirm-layout{opacity:1;z-index:2147483010;-webkit-transform:scale(1);transform:scale(1)}";var V=M;var T=t("zonos_confirm_dialog",function(){function t(t){var e=this;n(this,t);this.confirmClicked=i(this,"confirmClicked",7);this.cancelClicked=i(this,"cancelClicked",7);this.dialogTitle=v("Are you sure?");this.dialogIntent="info";this.dialogSubtitle=null;this.dialogWidth=350;this.dialogType="confirm";this.isMobile=false;this.noClickOutside=false;this.clickOutsideDialogHandler=function(t){if(t.target===t.currentTarget&&!e.noClickOutside){e.closeDialogHandler()}}}t.prototype.handleKeyDown=function(t){if(t.key==="Escape"){this.closeDialogHandler()}};t.prototype.focusDialog=function(){var t=this;if(this.dialogOpen){setTimeout((function(){var n,i;(i=(n=t.el.shadowRoot)===null||n===void 0?void 0:n.querySelector(".zonos--backdrop"))===null||i===void 0?void 0:i.focus()}),100)}};t.prototype.confirmDialogHandler=function(){if(!this.dialogOpen){return}this.confirmClicked.emit()};t.prototype.closeDialogHandler=function(){if(!this.dialogOpen){return}this.cancelClicked.emit()};t.prototype.renderIcon=function(){switch(this.dialogIntent){case"info":return e("zonos-icon",{content:B,iconColor:"blue-800"});case"danger":return e("zonos-icon",{content:N,iconColor:"red-800"});case"warn":return e("zonos-icon",{content:D,iconColor:"orange-800"})}};t.prototype.getButtonConfirmVariant=function(){switch(this.dialogIntent){case"warn":return"warning";case"danger":return"danger";default:return"primary"}};t.prototype.render=function(){var t=this;this.focusDialog();var n=S();var i=y(b.appearance.theme);return e(o,{key:"459abd25f9719554dc3b4387a660618056909846",class:I([this.dialogOpen&&"open","zonos--elements"]),"data-dialog-type":this.dialogType,"data-theme":i,style:{"--zonos--border-radius":n,"--zonos--dialog-width":"".concat(this.dialogWidth,"px"),"--zonos--font-family":g()}},e("div",{key:"f8a3c9bdbad91b046b3579eb140aad74e2784f8d",class:"zonos--backdrop",tabIndex:-1}),e("div",{key:"b41d27616223f89adb523269a3a8b982cd3559c7",class:I(["zonos--confirm-layout",this.dialogIntent]),onClick:function(n){return t.clickOutsideDialogHandler(n)}},e("div",{key:"69e7837a2aaaeea468e4887d14cbb0ea61d5f24a",class:"zonos--confirm-dialog",onBlur:function(){t.focusDialog()}},e("div",{key:"28ed6e2da0c8c56a00c46df985f21cf74c551894",class:"wrapper"},e("div",{key:"f20b3f00aeaef6fc306766a52607253554005cf4",class:"icon-wrapper"},this.renderIcon()),e("div",{key:"7bb44bb7a880c599a8cc4615df48257fd0f9c19d",class:"content"},e("div",{key:"584603b01b26b5d242f14c67a14d7b092d54b668",class:"title"},e("zonos-text",{key:"028e06e106587778f6da2301ee44727ab1bf487f",type:"subheader"},this.dialogTitle)),this.dialogSubtitle&&e("div",{key:"c986563425dc6130fa154ce3c8e15c2aa03fb6cb",class:"subtitle"},e("zonos-text",{key:"675899ceea2fd2de38ca8f87aa6ca69e4c7d8fc7",textColor:"gray-800"},this.dialogSubtitle))),e("div",{key:"8a034df1cd91f07e870fd6eccebc2f382edf59fb",class:"footer"},this.dialogType==="confirm"&&e("zonos-button",{key:"72e643fff73dabe0d5381e6ffc7f2237ef00f322",backgroundColor:"gray-0",class:"cancel-button",onClick:function(){return t.closeDialogHandler()},size:"lg",withBoxShadow:true},this.dialogCancelBtnText||v("Cancel")),e("zonos-button",{key:"e247f450feef41b44688b937b38df8e061f386a3",class:"confirm-button",onClick:function(){return t.confirmDialogHandler()},size:"lg",variant:this.getButtonConfirmVariant()},this.dialogConfirmBtnText))))))};Object.defineProperty(t,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"el",{get:function(){return s(this)},enumerable:false,configurable:true});return t}());T.style=V;var P=function(t){var n=/^[a-zA-Z0-9.%_+-]*@[a-zA-Z0-9][a-zA-Z0-9.-]*\.[a-zA-Z0-9]{2,}$/;return n.test(t)};var R=".sc-zonos-link-authentication-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-link-authentication-h *.sc-zonos-link-authentication{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-link-authentication-h img.sc-zonos-link-authentication{max-width:100%}.sc-zonos-link-authentication-h dl.sc-zonos-link-authentication,.sc-zonos-link-authentication-h dd.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h1.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h2.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h3.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h4.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h5.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h6.sc-zonos-link-authentication,.sc-zonos-link-authentication-h hr.sc-zonos-link-authentication,.sc-zonos-link-authentication-h figure.sc-zonos-link-authentication,.sc-zonos-link-authentication-h p.sc-zonos-link-authentication,.sc-zonos-link-authentication-h pre.sc-zonos-link-authentication{margin:0}.sc-zonos-link-authentication-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-link-authentication-h .zonos--title.sc-zonos-link-authentication{margin-bottom:16px}.sc-zonos-link-authentication-h .zonos--input-invalid.sc-zonos-link-authentication{border:2px solid var(--zonos-elements-red-600);border-radius:var(--zonos--border-radius)}";var F=R;var J=51;var q=t("zonos_link_authentication",function(){function t(t){var e=this;n(this,t);this.linkAuthenticationChange=i(this,"linkAuthenticationChange",7);this.storeUnsubscribeList=[];this.defaultEmail=null;this.isEmailError=false;this.stripe=r.stripe;this.isStagingMode=u.isStagingMode;this.clientSecret=r.clientSecret;this.retriesInitializeLink=0;this.setCustomEmailInputToLinkEvent=function(t){var n=P(t);var i={complete:!!n,elementType:"linkAuthentication",empty:!t,value:{email:t}};r.stripeLinkEventData=i};this.handleNormalEmailInput=function(t){var n;var i=t.detail;e.setCustomEmailInputToLinkEvent(i);(n=e.linkAuthenticationChange)===null||n===void 0?void 0:n.emit()}}t.prototype.watchIsStagingMode=function(){var t=this;setTimeout((function(){void t.watchInitStripe()}),0)};t.prototype.watchInitStripe=function(){return __awaiter(this,void 0,void 0,(function(){var t,n,i,e;var o=this;return __generator(this,(function(s){switch(s.label){case 0:if(!this.stripe||!r.stripeElements){return[2]}if(u.isStagingMode||!this.clientSecret){return[2]}t=this.defaultEmail?{email:this.defaultEmail}:undefined;s.label=1;case 1:s.trys.push([1,2,,6]);n=r.stripeLinkElement||r.stripeElements.create("linkAuthentication",{defaultValues:t});i=this.el.querySelector(".zonos--link-authentication-component");if(!i){k("Cannot find container element for linkAuthenticationElement");return[2]}n.mount(i);n.on("change",(function(t){var n;r.stripeLinkEventData=t;(n=o.linkAuthenticationChange)===null||n===void 0?void 0:n.emit()}));r.stripeLinkElement=n;this.retriesInitializeLink=0;if(this.retriesInitializeLink>11){_("Stripe link element initialized","info",{retriesInitializeLink:this.retriesInitializeLink,stripe:this.stripe});void x({endpoint:"stripe-link-authentication-init-long-running",errors:["Stripe link element initialized after 20 retries - 10 seconds"],metadata:{retriesInitializeLink:this.retriesInitializeLink}})}return[3,6];case 2:e=s.sent();if(!(e instanceof Error))return[3,5];this.retriesInitializeLink++;if(!(this.retriesInitializeLink<J))return[3,4];return[4,new Promise((function(t){return setTimeout(t,500)}))];case 3:s.sent();void this.watchInitStripe();s.label=4;case 4:if(this.retriesInitializeLink===J){void x({endpoint:"stripe-link-authentication-init-error",errors:[e.message],metadata:{retriesInitializeLink:this.retriesInitializeLink}})}s.label=5;case 5:return[3,6];case 6:return[2]}}))}))};t.prototype.watchDefaultEmail=function(t,n){var i,e;_("Default email is changed","info",{newDefaultEmail:t,oldDefaultEmail:n});if(n===t){return}if(!t){r.stripeLinkEventData=null}if(u.isStagingMode){this.setCustomEmailInputToLinkEvent(t||"");return}(i=r.stripeLinkElement)===null||i===void 0?void 0:i.clear();(e=r.stripeLinkElement)===null||e===void 0?void 0:e.destroy();r.stripeLinkElement=null;r.stripeLinkEventData=null;_("Reset stripe link element when default email is changed","info",{defaultEmail:t});void this.watchInitStripe()};t.prototype.disconnectedCallback=function(){try{this.storeUnsubscribeList.forEach((function(t){return t()}))}catch(t){}};t.prototype.componentDidLoad=function(){var t=this;this.storeUnsubscribeList=[d("stripeElements",(function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){void this.watchInitStripe();return[2]}))}))})),d("clientSecret",(function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){this.clientSecret=r.clientSecret;return[2]}))}))})),d("stripe",(function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){this.stripe=r.stripe;return[2]}))}))}))];void this.watchInitStripe();if(!this.defaultEmail){return}this.setCustomEmailInputToLinkEvent(this.defaultEmail)};t.prototype.render=function(){var t=this;this.isStagingMode=u.isStagingMode;this.clientSecret=r.clientSecret;var n=function(){var n;if(u.isStagingMode){return e("zonos-stripe-input",{inputLabel:v("Email"),inputValue:t.defaultEmail||((n=r.stripeLinkEventData)===null||n===void 0?void 0:n.value.email)||"",isError:t.isEmailError,onBlur:function(){var n;var i=((n=r.stripeLinkEventData)===null||n===void 0?void 0:n.value.email)||"";if(!i){return}var e=P(i);t.isEmailError=!e},onInputChange:t.handleNormalEmailInput})}return e("div",{class:"zonos--link-authentication-component ".concat(t.isEmailError&&"zonos--input-invalid")})};return e(o,{class:"zonos--link-authentication zonos--elements",style:{"--zonos--border-radius":S()}},this.titleText&&e("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},this.titleText),n(),this.isEmailError&&e("zonos-text",{textColor:"red-600"},v("Please enter a valid email address.")))};Object.defineProperty(t.prototype,"el",{get:function(){return s(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{isStagingMode:["watchIsStagingMode"],stripe:["watchInitStripe"],clientSecret:["watchInitStripe"],defaultEmail:["watchDefaultEmail"]}},enumerable:false,configurable:true});return t}());q.style=F;var G=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--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{position:fixed;inset:0;z-index:2147483010;pointer-events:none;display:block}:host .zonos--loading-overlay{position:fixed;inset:0;width:100vw;height:100vh;background:var(--zonos-elements-backdrop-color);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;opacity:0;visibility:hidden;-webkit-transition:opacity 0.3s ease, visibility 0.3s ease;transition:opacity 0.3s ease, visibility 0.3s ease;z-index:2147483010}:host(.zonos--open){pointer-events:auto}:host(.zonos--open) .zonos--loading-overlay{opacity:0.65;visibility:visible}";var U=G;var $=t("zonos_loading_overlay",function(){function t(t){n(this,t);this.open=false;this.size=40}t.prototype.render=function(){return e(o,{key:"8216ba7271f4eb12153620d0268fd7b5dea632ad",class:I(["zonos--elements",this.open&&"zonos--open"])},e("div",{key:"ad3ab1b7e51b2de173e1b1a489bce3cdacc798f1",class:"zonos--loading-overlay"},e("zonos-spinner",{key:"dc1dd642825268c01c5df120165a7aec85d121e9",size:this.size,spinnerColor:this.spinnerColor})))};return t}());$.style=U}}}));
|