1import{d as O,c as l,b as g,e as C,E as D,V as q,o as c,t as x,a as r,f as P,g as b,z as M,_ as L,L as Q,N as j,O as U,F as X,r as Y,T,S as G,W as F,A as $,n as J,h as tt,k as V,X as H,Y as N,Z as et,u as z,i as ot,y as nt,P as rt,l as st,m as ct}from"./CsK60Gkw.js";import{_ as at}from"./CwpPHjNN.js";import{u as it}from"./ByeGOc_K.js";import{u as lt}from"./DLIZ3FbP.js";const ut={class:"shop-featured animate-in"},dt={class:"shop-featured__item","data-cursor":"View Product"},pt={class:"shop-featured__text"},_t={class:"shop-featured__title"},ht={key:0,class:"shop-featured__excerpt"},ft={key:1,class:"shop-featured__price"},gt=["src","alt"],mt=O({__name:"ShopFeaturedProduct",props:{product:{}},setup(e){const a=e,u=b(()=>{const i=a.product.variants.nodes[0];return i?M(i.price):M(a.product.priceRange.minVariantPrice)}),_=b(()=>a.product.excerptMetafield?.value?.trim()||null);return(i,m)=>{const d=q;return c(),l("section",ut,[g("article",dt,[g("div",pt,[C(d,{to:`/shop/${e.product.handle}/`,class:"shop-featured__title-link"},{default:D(()=>[g("h3",_t,x(e.product.title),1),r(_)?(c(),l("p",ht,x(r(_)),1)):P("",!0),r(u)?(c(),l("p",ft,x(r(u)),1)):P("",!0)]),_:1},8,["to"])]),C(d,{to:`/shop/${e.product.handle}/`,class:"shop-featured__media"},{default:D(()=>[e.product.featuredImage?.url?(c(),l("img",{key:0,class:"shop-featured__thumb",src:e.product.featuredImage.url,alt:e.product.featuredImage.altText||e.product.title,loading:"lazy"},null,8,gt)):P("",!0)]),_:1},8,["to"])])])}}}),yt=Object.assign(L(mt,[["__scopeId","data-v-1949413a"]]),{__name:"ShopFeaturedProduct"}),vt={class:"shop-category-filter__list"},Pt=["aria-current"],St=["aria-current","onClick"],Ct=150,kt=48,bt=O({__name:"ShopCategoryFilter",props:{collections:{},activeHandle:{},productCount:{}},emits:["select"],setup(e,{emit:a}){const u=e,_=a,i=$(null),m=$(null);let d=null,h=null,y=null;function S(s){const o=document.createElement("div");o.style.width="0",o.style.height=`var(${s})`,o.style.position="absolute",o.style.visibility="hidden",o.style.pointerEvents="none",document.body.appendChild(o);const f=o.getBoundingClientRect().height;return document.body.removeChild(o),f}function v(){const s=i.value?.closest(".shop-catalog"),o=m.value;return!s||!o?null:{catalog:s,nav:o}}function w(s,o,f){return s.offsetHeight-o.offsetHeight-f}function k(s,o,f){return w(s,o,f)>=kt}function n(){d?.kill(),d=null;const s=m.value;s&&T.set(s,{clearProps:"all"})}function t(){return window.matchMedia("(max-width: 812px)").matches}function p(){if(n(),h?.disconnect(),h=null,t())return;const s=v();if(!s)return;const{catalog:o,nav:f}=s;T.registerPlugin(F);const I=S("--gutter-5");k(o,f,I)&&(d=F.create({trigger:f,pin:!0,pinReparent:!0,pinSpacing:!1,start:`top top+=${I}`,endTrigger:o,end:"bottom bottom",anticipatePin:1,invalidateOnRefresh:!0}),h=new ResizeObserver(()=>{y&&clearTimeout(y),y=setTimeout(()=>{const E=v();if(!E)return;const A=S("--gutter-5");if(!k(E.catalog,E.nav,A)){n();return}F.refresh()},Ct)}),h.observe(o))}async function R(){await G(),requestAnimationFrame(()=>{p(),F.refresh()})}return Q(()=>{R()}),j(()=>[u.activeHandle,u.productCount],()=>{R()}),U(()=>{y&&clearTimeout(y),h?.disconnect(),h=null,n()}),(s,o)=>(c(),l("div",{ref_key:"filterRef",ref:i,class:"shop-category-filter"},[g("nav",{ref_key:"navRef",ref:m,class:"shop-category-filter__nav","aria-label":"Product categories"},[o[1]||(o[1]=g("h3",{class:"shop-category-filter__title"},"Catalog",-1)),g("ul",vt,[g("li",null,[g("button",{type:"button",class:"shop-category-filter__button","aria-current":e.activeHandle===null?"true":void 0,onClick:o[0]||(o[0]=f=>_("select",null))}," All ",8,Pt)]),(c(!0),l(X,null,Y(e.collections,f=>(c(),l("li",{key:f.id},[g("button",{type:"button",class:"shop-category-filter__button","aria-current":e.activeHandle===f.handle?"true":void 0,onClick:I=>_("select",f.handle)},x(f.title),9,St)]))),128))])],512)],512))}}),wt=Object.assign(L(bt,[["__scopeId","data-v-7f9ff91c"]]),{__name:"ShopCategoryFilter"}),Rt={class:"shop-product-card"},Tt=["src","alt"],$t={class:"shop-product-card__details"},xt={class:"shop-product-card__title"},It={key:0,class:"shop-product-card__price"},Et=O({__name:"ShopProductCard",props:{product:{}},setup(e){const a=e,u=b(()=>{const _=a.product.variants.nodes[0];return _?M(_.price):M(a.product.priceRange.minVariantPrice)});return(_,i)=>{const m=q;return c(),l("article",Rt,[C(m,{to:`/shop/${e.product.handle}/`,class:"shop-product-card__media","data-cursor":"View Product"},{default:D(()=>[e.product.featuredImage?.url?(c(),l("img",{key:0,class:"shop-product-card__image",src:e.product.featuredImage.url,alt:e.product.featuredImage.altText||e.product.title,loading:"lazy"}
1,null,8,Tt)):P("",!0),g("div",$t,[g("h3",xt,x(e.product.title),1),r(u)?(c(),l("p",It,x(r(u)),1)):P("",!0)])]),_:1},8,["to"])])}}}),Ot=Object.assign(L(Et,[["__scopeId","data-v-b46293ca"]]),{__name:"ShopProductCard"}),Lt=O({__name:"ShopProductGrid",props:{products:{},pending:{type:Boolean}},setup(e){const a=e,u=$(null),_=$(null),i=$([...a.products]),m=$(!0);let d=null;function h(t){return t>=2&&t%2===0}function y(t){return t.map(p=>p.id).join(",")}function S(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}function v(){const t=u.value;if(t)return[...t.querySelectorAll(".shop-product-grid__item")];const p=_.value;return p?[p]:[]}function w(t){t.length>0&&T.set(t,{clearProps:"all"})}function k(){const t=v();if(t.length!==0){if(S()){w(t),window.dispatchEvent(new Event("resize"));return}d?.kill(),T.set(t,{autoAlpha:0,y:30}),d=T.timeline({onComplete:()=>{w(t),window.dispatchEvent(new Event("resize"))}}),d.to(t,{autoAlpha:1,y:0,duration:.65,ease:"power4.inOut",stagger:{each:.075,from:"start"}})}}async function n(t){const p=v();if(S()){i.value=[...t];return}if(d?.kill(),p.length===0){i.value=[...t],await G(),k();return}d=T.timeline({onComplete:async()=>{i.value=[...t],await G(),k()}}),d.to(p,{autoAlpha:0,y:20,duration:.35,ease:"power4.inOut",stagger:{each:.04,from:"start"}})}return j(()=>({products:a.products,pending:a.pending??!1}),({products:t,pending:p})=>{if(m.value){if(p)return;i.value=[...t],m.value=!1;return}p||y(i.value)!==y(t)&&n(t)},{deep:!0,immediate:!0}),U(()=>{d?.kill()}),(t,p)=>{const R=Ot;return r(i).length?(c(),l("section",{key:0,ref_key:"gridRef",ref:u,class:"shop-product-grid"},[(c(!0),l(X,null,Y(r(i),(s,o)=>(c(),l("div",{key:s.id,class:J(["shop-product-grid__item",{"shop-product-grid__item--row-divider":h(o)}])},[C(R,{product:s},null,8,["product"])],2))),128))],512)):e.pending?P("",!0):(c(),l("p",{key:1,ref_key:"emptyRef",ref:_,class:"shop-product-grid__empty"}," No products in this category. ",512))}}}),Ft=Object.assign(L(Lt,[["__scopeId","data-v-93c4c6c6"]]),{__name:"ShopProductGrid"}),Mt="shopify-catalog",B=50,At=20,Ht=new Set(["frontpage"]);function Nt(){const e=tt(),a=b(()=>{const n=e.query.category,t=Array.isArray(n)?n[0]:n;return typeof t=="string"&&t.length>0?t:null}),{data:u,pending:_,error:i,refresh:m}=V(Mt,async()=>{try{const[n,t]=await Promise.all([H("GetProducts",N.GetProducts,{first:B}),H("GetCollections",N.GetCollections,{first:At})]);return{products:n.products.nodes,collections:t.collections.nodes}}catch{return{products:[],collections:[]}}},"$EXD3Wiki2l"),{data:d,pending:h,refresh:y}=V(()=>`shopify-collection-${a.value??"all"}`,async()=>{const n=a.value;if(!n)return null;try{return(await H("GetCollectionProducts",N.GetCollectionProducts,{handle:n,first:B})).collection?.products.nodes??[]}catch{return[]}},{watch:[a]}),S=b(()=>(u.value?.collections??[]).filter(n=>!Ht.has(n.handle))),v=b(()=>a.value?d.value??[]:u.value?.products??[]);function w(n,t){return t?n.filter(p=>p.handle!==t):n}function k(n){const t={...e.query};return n?t.category=n:delete t.category,et({path:e.path,query:t})}return{catalog:u,collections:S,activeProducts:v,categoryHandle:a,pending:b(()=>_.value||h.value),error:i,refresh:m,refreshCollectionProducts:y,productsExcludingHandle:w,setCategory:k}}const Dt={class:"page page-shop"},Gt={class:"page-shop__main"},Vt={class:"page-shop__inner"},zt={key:0,class:"page-shop__intro"},Bt={key:1,class:"page-shop__notice"},qt={key:2,class:"page-shop__notice"},jt={key:4,class:"shop-catalog animate-in"},Ut={class:"shop-catalog__inner"},Xt={key:0,class:"shop-catalog__sidebar"},Yt="Shop",Wt=O({__name:"index",setup(e){const{client:a}=z(),{isFilled:u}=z(),{siteDescription:_,siteOgImage:i}=ot().public,m=String(_),d=String(i),{data:h}=V("prismic-shop",()=>a.getSingle("shop")),y=b(()=>{const s=h.value?.data.featured_product_handle;return u.keyText(s)?s.trim():null}),{product:S}=it(y),{collections:v,activeProducts:w,categoryHandle:k,pending:n,error:t,setCategory:p}=Nt();lt({doc:h,siteTitle:"Neptis Foundation",fallbackTitle:Yt,fallbackDescription:m,fallbackOgImage:d});const R=b(()=>w.value);return(s,o)=>{const f=st,I=at,E=rt,A=yt,W=wt,K=Ft,Z=ct;return c(),l("div",Dt,[C(f),C(I),g("main",Gt,[g("div",Vt,[r(h)&&r(u).richText(r(h).data.shop_intro)?(c(),l("div",zt,[C(E,{field:r(h).data.shop_intro},null,8,["field"])])):P("",!0),r(t)?(c(),l("p",Bt," Shop catalog is unavailable. Check Shopify configuration. ")):r(n)?(c(),l("p",qt,"Loading shopâ¦")):P("",!0),r(S)?(c(),nt(A,{key:3,product:r(S)},null,8,["product"])):P("",!0),r(v).length||r(R).length?(c(),l("div",jt,[g("div",Ut,[r(v).length?(c(),l("div",Xt,[C(W,{collections:r(v),"active-handle":r(k),"product-count":r(R).length,onSelect:r(p)},null,8,["collections","active-handle","product-count","onSelect"])])
1):P("",!0),C(K,{products:r(R),pending:r(n)},null,8,["products","pending"])])])):P("",!0)])]),C(Z)])}}}),te=L(Wt,[["__scopeId","data-v-648b1766"]]);export{te 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.