1import{h as d,j as $,e as M,f as O,d as v,n as p,i as x,g as n,s as S,y as k,x as m,c as y,r as u,z as w,t as g,o as B,w as F,p as z}from"./cartStore.CgI04MAR.chunk.min.js";import{F as H}from"./focus-trap-vue.esm-browser.C337wZfY.chunk.min.js";import{_ as P,a as j}from"./ProductVendor.CXE6cXJ8.chunk.min.js";import{_ as C}from"./ProductPricing.B0OWdTRd.chunk.min.js";import{o as N}from"./theme.CzG4Qrqe.bundle.min.js";const D={__name:"ModalProduct",props:{active:{type:Boolean,default:!1},allowOutsideClick:{type:Boolean,default:!0},clickOutsideDeactivates:{type:Boolean,default:!0},escapeDeactivates:{type:Boolean,default:!0},initialFocus:{type:[String,Function],default:"[data-modal]"},coordinates:{type:Object,default:null}},emits:["update:active"],setup(a){const o=a;return(s,r)=>(d(),$("div",{role:"dialog","aria-modal":"true","data-modal":"",class:p(["overflow-y-auto",{hidden:!o.active}])},[M(n(H),{active:o.active,"allow-outside-click":o.allowOutsideClick,"escape-deactivates":o.escapeDeactivates,"click-outside-deactivates":o.clickOutsideDeactivates,"initial-focus":o.initialFocus,"onUpdate:active":r[0]||(r[0]=e=>s.$emit("update:active",e))},{default:O(()=>[v("div",{class:p(["relative w-full rounded-general border-tile border-scheme-border bg-scheme-background py-3 tb:py-4",{"pl-3 pr-10 tb:pl-6 tb:pr-12":o.coordinates.x>50,"pl-10 pr-3 tb:pl-12 tb:pr-6":o.coordinates.x<=50}])},[x(s.$slots,"default")],2)]),_:3},8,["active","allow-outside-click","escape-deactivates","click-outside-deactivates","initial-focus"])],2))}},T=["disabled","aria-label"],q=["href"],I=["href","aria-label"],A={__name:"HotspotWidget",props:{coordinates:{type:Object,required:!0},product:{type:Object,required:!0},hotspotColor:{type:String,default:"#000000"},index:{type:Number,required:!0},currentSlide:{type:Number,required:!0}},emits:{"update:key":0},setup(a,{emit:o}){const{isMoreOptionsVisible:s,productTiles:{showVendor:r}}=S,e=a,i=u(!1);function f(t){i.value=t}const b=w(()=>{const t={top:`${e.coordinates.y}%`,left:`${e.coordinates.x}%`,transform:`translate(-${e.coordinates.x}%, -${e.coordinates.y}%)`};return Object.keys(t).map(l=>`${l}:${t[l]};`).join("")}),c=w(()=>{const t={color:`${e.hotspotColor}`,filter:i.value?"drop-shadow(0 0 1px rgb(var(--scheme-text)))":"none"};return Object.keys(t).map(l=>`${l}:${t[l]};`).join("")}),h=o,V=(t,l)=>{l?i.value=!i.value:h("update:key",t)};return(t,l)=>(d(),$("div",{class:p(["absolute",{"z-above":i.value&&t.$matchMedia.tablet}]),style:k(b.value)},[a.product?(d(),$("button",{key:0,class:p(["touch-target-aa relative",{"z-above":i.value&&t.$matchMedia.tablet}]),style:k(c.value),disabled:t.$matchMedia.tablet?i.value:e.currentSlide===e.index,"aria-label":t.$t("product.modal.aria_label_button",{product_name:a.product.title}),onClick:l[0]||(l[0]=U=>V(e.index,t.$matchMedia.tablet))},[v("span",{class:p(["icon",{"icon-hotspot-unfilled":!i.value&&t.$matchMedia.tablet||e.currentSlide!==e.index&&!t.$matchMedia.tablet,"icon-hotspot-filled":i.value&&t.$matchMedia.tablet||e.currentSlide===e.index&&!t.$matchMedia.tablet}]),"aria-hidden":""},null,2)],14,T)):m("",!0),t.$matchMedia.tablet&&i.value?(d(),y(n(D),{key:1,active:i.value,coordinates:e.coordinates,class:p(["absolute min-w-[180px] tb:min-w-[300px]",{"right-0":e.coordinates.x>50,"left-0":e.coordinates.x<=50,"bottom-0":e.coordinates.y>50,"top-0":e.coordinates.y<=50}]),"onUpdate:active":f},{default:O(()=>[n(r)?(d(),y(n(P),{key:0,"product-vendor":a.product.vendor},null,8,["product-vendor"])):m("",!0),v("a",{class:"inline-block text-sm font-normal no-underline",href:a.product.url,tabindex:"-1","aria-hidden":"true"},g(a.product.title),9,q),M(n(C),{class:"mt-1",product:a.product},null,8,["product"]),n(s)&&!a.product.has_only_default_variant?(d(),y(n(j),{key:1})):m("",!0),v("a",{class:"link mt-2 tb:mt-4",href:a.product.url,"aria-label":t.$t("product.modal.aria_label_link",{product_name:a.product.title})},g(t.$t("product.modal.shop")),9,I)]),_:1},8,["active","coordinates","class"])):m("",!0)],6))}},{isMoreOptionsVisible:E,productTiles:{showVendor:_}}=S,Q={components:{HotspotWidget:A,ProductPricing:C,ProductVendor:P,ProductOptionsAvailable:j},setup(){const a=u(null),o=u(!1),s=u([]),r=u(0),e=u(null);function i(){e.value&&(Object.assign(e.value,{slidesPerView:1,allowTouchMove:!1}),e.value.initialize())}async function f(){await N(a.value),o.value=!0;const c=JSON.parse(a.value.dataset.productHandles);c&&(s.value=await Promise.all(c.map(h=>z.load({},{handle:h}))))}function b(c){r.value=c,e.value.swiper.slideTo(c,10,!0)}return B(()=>{a.value&&f()}),F(()=>e.value,()=>{i()}
1),{rootElement:a,hasIntersected:o,products:s,currentSlide:r,swiperEl:e,isMoreOptionsVisible:E,showVendor:_,setCurrentSlide:b}}};export{Q as default};
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.