1import{a as C,r as s,j as g,O as F}from"./index-xv_z3vzF.js";import{c as i,a as P,t as j,A,i as R}from"./cart-DEzWTSna.js";import{u as _,b as k,c as T}from"./components-B2K1csvH.js";import{c as u}from"./exports-BHX_e-Ry.js";try{(function(){var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="8ce46ba4-b904-443f-a810-a493cadee59e",t._sentryDebugIdIdentifier="sentry-dbid-8ce46ba4-b904-443f-a810-a493cadee59e")})()}catch{}function U(){const{country:t,locale:o,cart:f}=_(),n=C(),{submit:w}=k(),[L,S]=T(),[D,I]=s.useState(!1),[x,p]=s.useState("loading"),[m,b]=s.useState("unavailable"),[c,l]=s.useState("unavailable");s.useEffect(()=>{function e(){p("ready")}function a(d){u(d.error),p("errored")}const r=document.createElement("script");return r.src="//js.hsforms.net/forms/embed/v2.js",r.addEventListener("load",e),r.addEventListener("error",a),document.body.appendChild(r),()=>{r.removeEventListener("load",e),r.removeEventListener("error",a)}},[]),s.useEffect(()=>{function e(){b("ready")}return window.addEventListener("affirm-ready",e),()=>{window.removeEventListener("affirm-ready",e)}},[]),s.useEffect(()=>{var e,a;if(m==="ready"&&n.pathname)try{(a=(e=window.affirm)==null?void 0:e.ui)==null||a.refresh()}catch(r){u(r,{tags:{feature:"Affirm"}})}},[m,n.pathname]),s.useEffect(()=>{function e(){l("ready")}return window.addEventListener("stamped-ready",e),()=>{window.removeEventListener("stamped-ready",e)}},[]);const E=function(){return typeof window<"u"?!!window.isInitializedStamped:!1}();s.useEffect(()=>{E&&l("initialized")},[E]),s.useEffect(()=>{var e,a,r;if(c!=="unavailable"&&n.pathname)try{(e=window.StampedFn)==null||e.setOptions({is_force_jquery:!0}),(a=window.StampedFn)==null||a.init({apiKey:"pubkey-P6SnIqNWXhEC0hYWP85v0u028df79w",storeUrl:z(t.storefront)})}catch(d){u(d,{tags:{feature:"Stamped"}})}if(c==="initialized")try{(r=window.StampedFn)==null||r.loadBadges()}catch(d){u(d,{tags:{feature:"Stamped"}})}},[c,t.storefront,n.pathname]);const y=L.getAll(i.discountCode),h=f==null?void 0:f.id;s.useEffect(()=>{if(y.length>0&&h){S(a=>(a.delete(i.discountCode),a));const e=new FormData;e.append(i.actionType,P.applyDiscount),e.append(i.cartId,h);for(const a of y)e.append(i.discountCode,a);w(e,{method:"POST",action:`/${o.displayLocale}/store/cart`})}},[y,h,o.displayLocale,w,S]);const v=R();return s.useEffect(()=>{v&&j(n.pathname)},[n,v]),g.jsx(A.Provider,{value:{showLoginModal:D,setShowLoginModal:I,hubspotStatus:x,setHubspotStatus:p,affirmStatus:m,setAffirmStatus:b,stampedStatus:c,setStampedStatus:l},children:g.jsx(F,{})})}function z(t){switch(t==null?void 0:t.storeCode){case"eu":return"shapertools-eu.myshopify.com";case"uk":return"shapertools-uk.myshopify.com";case"ca":case"us":default:return"shapertools-us.myshopify.com"}}export{U as default}; 2//# sourceMappingURL=(_locale)-C5HODBWX.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.