import{j as i}from"./jsx-runtime-CkriR1t1.js";import{r as m,s as X,A as Y,L as z,h as tt}from"./chunk-NL6KNZEE-DOSnOpPR.js";import{a as et,c as j}from"./cn-sElhP03s.js";const rt="2025-04",nt={storeDomain:"test",storefrontToken:"abc123",storefrontApiVersion:rt,countryIsoCode:"US",languageIsoCode:"EN",getStorefrontApiUrl(){return""},getPublicTokenHeaders(){return{}},getShopifyDomain(){return""}},ot=m.createContext(nt);function it(){const t=m.useContext(ot);if(!t)throw new Error("'useShop()' must be a descendent of ");return t}function st(t){const{countryIsoCode:r,languageIsoCode:n}=it(),e=n.includes("_")?n.replace("_","-"):`${n}-${r}`;if(!e)throw new Error("useMoney(): Unable to get 'locale' from 'useShop()', which means that 'locale' was not passed to ''. 'locale' is required for 'useMoney()' to work");const o=parseFloat(t.amount),{defaultFormatter:s,nameFormatter:l,narrowSymbolFormatter:u,withoutTrailingZerosFormatter:g,withoutCurrencyFormatter:a,withoutTrailingZerosOrCurrencyFormatter:x}=m.useMemo(()=>{const c={style:"currency",currency:t.currencyCode};return{defaultFormatter:y(e,c),nameFormatter:y(e,{...c,currencyDisplay:"name"}),narrowSymbolFormatter:y(e,{...c,currencyDisplay:"narrowSymbol"}),withoutTrailingZerosFormatter:y(e,{...c,minimumFractionDigits:0,maximumFractionDigits:0}),withoutCurrencyFormatter:y(e),withoutTrailingZerosOrCurrencyFormatter:y(e,{minimumFractionDigits:0,maximumFractionDigits:0})}},[t.currencyCode,e]),h=c=>c.type==="currency",d=m.useMemo(()=>({original:()=>t,currencyCode:()=>t.currencyCode,localizedString:()=>s().format(o),parts:()=>s().formatToParts(o),withoutTrailingZeros:()=>o%1===0?g().format(o):s().format(o),withoutTrailingZerosAndCurrency:()=>o%1===0?x().format(o):a().format(o),currencyName:()=>{var c;return((c=l().formatToParts(o).find(h))==null?void 0:c.value)??t.currencyCode},currencySymbol:()=>{var c;return((c=s().formatToParts(o).find(h))==null?void 0:c.value)??t.currencyCode},currencyNarrowSymbol:()=>{var c;return((c=u().formatToParts(o).find(h))==null?void 0:c.value)??""},amount:()=>s().formatToParts(o).filter(c=>["decimal","fraction","group","integer","literal"].includes(c.type)).map(c=>c.value).join("")}),[t,o,l,s,u,a,g,x]);return m.useMemo(()=>new Proxy(d,{get:(c,v)=>{var f;return(f=Reflect.get(c,v))==null?void 0:f.call(null)}}),[d])}const P=new Map;function y(t,r){const n=JSON.stringify([t,r]);return function(){let e=P.get(n);return e||(e=new Intl.NumberFormat(t,r),P.set(n,e)),e}}function L({data:t,as:r,withoutCurrency:n,withoutTrailingZeros:e,measurement:o,measurementSeparator:s="/",...l}){if(!ct(t))throw new Error(" needs a valid 'data' prop that has 'amount' and 'currencyCode'");const u=st(t),g=r??"div";let a=u.localizedString;return(n||e)&&(n&&!e?a=u.amount:!n&&e?a=u.withoutTrailingZeros:a=u.withoutTrailingZerosAndCurrency),i.jsxs(g,{...l,children:[a,o&&o.referenceUnit&&i.jsxs(i.Fragment,{children:[s,o.referenceUnit]})]})}function ct(t){return typeof t.amount=="string"&&!!t.amount&&typeof t.currencyCode=="string"&&!!t.currencyCode}const _=m.forwardRef(({alt:t,aspectRatio:r,crop:n="center",data:e,decoding:o="async",height:s="auto",loader:l=C,loading:u="lazy",sizes:g,src:a,srcSetOptions:x={intervals:15,startingWidth:200,incrementSize:200,placeholderWidth:100},width:h="100%",...d},c)=>{const v=m.useMemo(()=>{const I=e!=null&&e.width&&(e!=null&&e.height)?e==null?void 0:e.width:void 0,b=e!=null&&e.width&&(e!=null&&e.height)?e==null?void 0:e.height:void 0;return{width:I,height:b,unitsMatch:!!H(I,b)}},[e]),f=m.useMemo(()=>{const b=S((h||"100%").toString()),V=`${b.number}${b.unit}`,A=s==null,T=A?null:S(s.toString()),q=T?`${T.number}${T.unit}`:"",B=A?"auto":q,J=a||(e==null?void 0:e.url),K=e!=null&&e.altText&&!t?e==null?void 0:e.altText:t||"",Q=r||(v.unitsMatch?[F(v.width),F(v.height)].join("/"):void 0);return{width:V,height:B,src:J,alt:K,aspectRatio:Q}},[h,s,a,e,t,r,v,d==null?void 0:d.key]),{intervals:p,startingWidth:w,incrementSize:N,placeholderWidth:M}=x,E=m.useMemo(()=>lt(h,p,w,N),[h,p,w,N]);return O(f.width)?i.jsx(ut,{aspectRatio:r,crop:n,decoding:o,height:s,imageWidths:E,loader:l,loading:u,normalizedProps:f,passthroughProps:d,ref:c,width:h,data:e}):i.jsx(at,{aspectRatio:r,crop:n,decoding:o,imageWidths:E,loader:l,loading:u,normalizedProps:f,passthroughProps:d,placeholderWidth:M,ref:c,sizes:g,data:e})}),ut=m.forwardRef(({aspectRatio:t,crop:r,decoding:n,height:e,imageWidths:o,loader:s=C,loading:l,normalizedProps:u,passthroughProps:g,width:a,data:x},h)=>{const d=m.useMemo(()=>{const c=F(a),v=F(e),f=t||(H(u.width,u.height)?[c,v].join("/"):u.aspectRatio?u.aspectRatio:void 0),p=o===void 0?void 0:W(o,f,r,{width:(x==null?void 0:x.width)??void 0,height:(x==null?void 0:x.height)??void 0}),w=v||(f&&c?c*(R(f)??1):void 0),N=U(u.src,p,s),M=s({src:u.src,width:c,height:w,crop:u.height==="auto"?void 0:r});return{width:c,aspectRatio:f,height:w,srcSet:N,src:M}},[t,r,x,e,o,s,u,a]);return i.jsx("img",{ref:h,alt:u.alt,decoding:n,height:d.height,loading:l,src:d.src,srcSet:d.srcSet,width:d.width,style:{aspectRatio:d.aspectRatio,...g.style},...g})}),at=m.forwardRef(({crop:t,decoding:r,imageWidths:n,loader:e=C,loading:o,normalizedProps:s,passthroughProps:l,placeholderWidth:u,sizes:g,data:a},x)=>{const h=m.useMemo(()=>{const d=n===void 0?void 0:W(n,s.aspectRatio,t,{width:(a==null?void 0:a.width)??void 0,height:(a==null?void 0:a.height)??void 0}),c=s.aspectRatio&&u?u*(R(s.aspectRatio)??1):void 0,v=U(s.src,d,e),f=e({src:s.src,width:u,height:c,crop:t});return{placeholderHeight:c,srcSet:v,src:f}},[t,a,n,e,s,u]);return i.jsx("img",{ref:x,alt:s.alt,decoding:r,height:h.placeholderHeight,loading:o,sizes:g,src:h.src,srcSet:h.srcSet,width:u,...l,style:{width:s.width,aspectRatio:s.aspectRatio,...l.style}})}),k="https://placeholder.shopify.com";function C({src:t,width:r,height:n,crop:e}){if(!t)return"";const o=new URL(t,k);return r&&o.searchParams.append("width",Math.round(r).toString()),n&&o.searchParams.append("height",Math.round(n).toString()),e&&o.searchParams.append("crop",e),o.href.replace(k,"")}function H(t="100%",r="auto"){return S(t.toString()).unit===S(r.toString()).unit}function S(t){const r=t.replace(/[0-9.]/g,""),n=parseFloat(t.replace(r,""));return{unit:r===""?n===void 0?"auto":"px":r,number:n}}function F(t){if(t===void 0)return;const{unit:r,number:n}=S(t.toString());switch(r){case"em":return n*16;case"rem":return n*16;case"px":return n;case"":return n;default:return}}function O(t){return typeof t=="number"||/\d(px|em|rem)$/.test(t)}function U(t,r,n=C){return t?(r==null?void 0:r.length)===0||!r?t:r.map((e,o)=>`${n({src:t,width:e.width,height:e.height,crop:e.crop})} ${r.length===3?`${o+1}x`:`${e.width??0}w`}`).join(", "):""}function lt(t="100%",r,n,e){const o=Array.from({length:r},(l,u)=>u*e+n),s=Array.from({length:3},(l,u)=>(u+1)*(F(t)??0));return O(t)?s:o}function R(t){if(!t)return;const[r,n]=t.split("/");return 1/(Number(r)/Number(n))}function W(t,r,n="center",e){if(t)return t.map(o=>({width:o,height:r?o*(R(r)??1):void 0,crop:n})).filter(({width:o,height:s})=>!(e!=null&&e.width&&o>e.width||e!=null&&e.height&&s&&s>e.height))}function dt({numberOfProducts:t,endCursor:r,collectionHandle:n,initialProducts:e,hasNextPage:o}){let s=X(),[l,u]=m.useState({products:e,hasNextPage:o,endCursor:r}),{Form:g,data:a,...x}=s;m.useEffect(()=>{a!=null&&a.products&&u(f=>{let p=new Map([...f.products,...a.products].map(w=>[w.id,w]));return{products:Array.from(p.values()),hasNextPage:a.productsPageInfo.hasNextPage,endCursor:a.productsPageInfo.endCursor??void 0}})},[a]);let{hasNextPage:h,endCursor:d}=l,c=s.state!=="idle";return{Form:m.useCallback(({children:f,...p})=>h?i.jsxs(g,{method:"get",action:"/_resources/load-more-products",...p,children:[i.jsx("input",{type:"hidden",name:"numberOfProducts",value:t}),i.jsx("input",{type:"hidden",name:"collectionHandle",value:n}),d&&i.jsx("input",{type:"hidden",name:"endCursor",value:d}),i.jsx("button",{className:"bg-blue-brand hover:text-blue-brand disabled:text-blue-brand w-full py-9 text-center text-xl font-bold text-white transition-colors hover:bg-white disabled:bg-white/80",type:"submit",disabled:c,children:i.jsx("span",{children:c?"Loading...":"Load more"})}),f]}):null,[h,g,t,n,d,c]),products:l.products,...x}}let D=12;function wt({products:t,loadMoreProducts:r,loadingProductCount:n=D,className:e}){const{Form:o,products:s}=dt({...r,initialProducts:t});return i.jsx("div",{className:et("3xl:grid-cols-5 grid grid-cols-1 gap-y-9 bg-linear-to-b from-[#2d2d38] to-black md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-3 2xl:grid-cols-4",e),children:"then"in s?i.jsx(m.Suspense,{fallback:i.jsx(ht,{loadingProductCount:n}),children:i.jsx(Y,{resolve:s,errorElement:i.jsx("div",{className:"h-[1000px]"}),children:l=>l.map(u=>i.jsx($,{product:u},u.id))})}):i.jsxs(i.Fragment,{children:[s.map(l=>i.jsx($,{product:l},l.id)),i.jsx("div",{className:"col-span-full",children:i.jsx(o,{})})]})})}function ht({loadingProductCount:t=D}){return Array.from({length:t}).map((r,n)=>i.jsxs(Z,{children:[i.jsx(G,{children:i.jsx("div",{className:"animate-pulse-radial aspect-square w-full rounded-full bg-radial from-white/10 to-black/10 bg-center bg-no-repeat blur-lg"})}),i.jsx("div",{className:"h-14"})]},n))}function $({product:t}){let{handle:r,title:n,price:e}=t;return i.jsxs(Z,{className:"group",children:[i.jsx(ft,{images:t.images.nodes}),i.jsxs("div",{className:"flex h-14 flex-col items-center justify-center gap-2.5 text-base/none text-white",children:[i.jsxs(z,{prefetch:"intent",to:tt("/:locale?/products/:handle",{handle:r}),className:"font-bold hover:text-white",children:[i.jsx("span",{className:"absolute inset-0"}),n]}),i.jsx(mt,{price:e})]})]})}function ft({images:t}){let r=t[0],n=t.length>1?t[1]:null,e="(min-width: 1536px) 20vw, (min-width: 1280px) 25vw, (min-width: 1024px) 33vw, (min-width: 768px) 50vw, 100vw",o="max-h-[90%] object-cover object-center";return i.jsxs(G,{className:"group-hover:scale-105",children:[i.jsx(_,{data:r,sizes:e,className:j(o,n&&"relative opacity-100 group-hover:absolute group-hover:opacity-0"),loading:"lazy"}),n&&i.jsx(_,{data:n,sizes:e,className:j(o,"absolute opacity-0 group-hover:relative group-hover:opacity-100"),loading:"lazy"})]})}function mt({price:t,compareAtPrice:r,layout:n="product"}){if(!t)return null;let e=Number(t.amount||0),o=Number((r==null?void 0:r.amount)||0);return r&&e