1import{j as w}from"./jsx-runtime-_4rOUqZA.js";import{r as m,B}from"./chunk-EPOLDU6W-CUtBjYhx.js";const P="2025-07",q={storeDomain:"test",storefrontToken:"abc123",storefrontApiVersion:P,countryIsoCode:"US",languageIsoCode:"EN",getStorefrontApiUrl(){return""},getPublicTokenHeaders(){return{}},getShopifyDomain(){return""}},J=m.createContext(q);function G(){const t=m.useContext(J);if(!t)throw new Error("'useShop()' must be a descendent of <ShopifyProvider/>");return t}function K(t){const{countryIsoCode:e,languageIsoCode:i}=G(),r=i.includes("_")?i.replace("_","-"):`${i}-${e}`;if(!r)throw new Error("useMoney(): Unable to get 'locale' from 'useShop()', which means that 'locale' was not passed to '<ShopifyProvider/>'. 'locale' is required for 'useMoney()' to work");const n=parseFloat(t.amount);let c=!0;try{new Intl.NumberFormat(r,{style:"currency",currency:t.currencyCode})}catch(o){o instanceof RangeError&&o.message.includes("currency")&&(c=!1)}const{defaultFormatter:s,nameFormatter:u,narrowSymbolFormatter:h,withoutTrailingZerosFormatter:a,withoutCurrencyFormatter:g,withoutTrailingZerosOrCurrencyFormatter:f}=m.useMemo(()=>{const o=c?{style:"currency",currency:t.currencyCode}:{style:"decimal",minimumFractionDigits:2,maximumFractionDigits:2};return{defaultFormatter:S(r,o),nameFormatter:S(r,{...o,currencyDisplay:"name"}),narrowSymbolFormatter:S(r,{...o,currencyDisplay:"narrowSymbol"}),withoutTrailingZerosFormatter:S(r,{...o,minimumFractionDigits:0,maximumFractionDigits:0}),withoutCurrencyFormatter:S(r,{minimumFractionDigits:2,maximumFractionDigits:2}),withoutTrailingZerosOrCurrencyFormatter:S(r,{minimumFractionDigits:0,maximumFractionDigits:0})}},[t.currencyCode,r,c]),l=o=>o.type==="currency",d=m.useMemo(()=>({original:()=>t,currencyCode:()=>t.currencyCode,localizedString:()=>{const o=s().format(n);return c?o:`${o} ${t.currencyCode}`},parts:()=>{const o=s().formatToParts(n);return c||o.push({type:"literal",value:" "},{type:"currency",value:t.currencyCode}),o},withoutTrailingZeros:()=>{const o=n%1===0?a().format(n):s().format(n);return c?o:`${o} ${t.currencyCode}`},withoutTrailingZerosAndCurrency:()=>n%1===0?f().format(n):g().format(n),currencyName:()=>{var o;return((o=u().formatToParts(n).find(l))==null?void 0:o.value)??t.currencyCode},currencySymbol:()=>{var o;return((o=s().formatToParts(n).find(l))==null?void 0:o.value)??t.currencyCode},currencyNarrowSymbol:()=>{var o;return((o=h().formatToParts(n).find(l))==null?void 0:o.value)??""},amount:()=>s().formatToParts(n).filter(o=>["decimal","fraction","group","integer","literal"].includes(o.type)).map(o=>o.value).join("")}),[t,n,c,u,s,h,g,a,f]);return m.useMemo(()=>new Proxy(d,{get:(o,y)=>{var v;return(v=Reflect.get(o,y))==null?void 0:v.call(null)}}),[d])}const A=new Map;function S(t,e){const i=JSON.stringify([t,e]);return function(){let r=A.get(i);if(!r){try{r=new Intl.NumberFormat(t,e)}catch(n){if(n instanceof RangeError&&n.message.includes("currency")){const c={...e};delete c.currency,delete c.currencyDisplay,delete c.currencySign,r=new Intl.NumberFormat(t,c)}else throw n}A.set(i,r)}return r}}function it({data:t,as:e,withoutCurrency:i,withoutTrailingZeros:r,measurement:n,measurementSeparator:c="/",...s}){if(!Q(t))throw new Error("<Money/> needs a valid 'data' prop that has 'amount' and 'currencyCode'");const u=K(t),h=e??"div";let a=u.localizedString;return(i||r)&&(i&&!r?a=u.amount:!i&&r?a=u.withoutTrailingZeros:a=u.withoutTrailingZerosAndCurrency),w.jsxs(h,{...s,children:[a,n&&n.referenceUnit&&w.jsxs(w.Fragment,{children:[c,n.referenceUnit]})]})}function Q(t){return typeof t.amount=="string"&&!!t.amount&&typeof t.currencyCode=="string"&&!!t.currencyCode}const ot=m.forwardRef(({alt:t,aspectRatio:e,crop:i="center",data:r,decoding:n="async",height:c="auto",loader:s=b,loading:u="lazy",sizes:h,src:a,srcSetOptions:g={intervals:15,startingWidth:200,incrementSize:200,placeholderWidth:100},width:f="100%",...l},d)=>{const o=m.useMemo(()=>{const R=r!=null&&r.width&&(r!=null&&r.height)?r==null?void 0:r.width:void 0,x=r!=null&&r.width&&(r!=null&&r.height)?r==null?void 0:r.height:void 0;return{width:R,height:x,unitsMatch:!!D(R,x)}},[r]),y=m.useMemo(()=>{const x=F((f||"100%").toString()),L=`${x.number}${x.unit}`,j=c==null,I=j?null:F(c.toString()),Z=I?`${I.number}${I.unit}`:"",W=j?"auto":Z,k=a||(r==null?void 0:r.url),V=r!=null&&r.altText&&!t?r==null?void 0:r.altText:t||"",O=e||(o.unitsMatch?[C(o.width),C(o.height)].join("/"):void 0);return{width:L,height:W,src:k,alt:V,aspectRatio:O}},[f,c,a,r,t,e,o,l==null?void 0:l.key]),{intervals:v,startingWidth:p,incrementSize:M,placeholderWidth:$}=g,E=m.useMemo(()=>z(f,v,p,M),[f,v,p,M]);return U(y.width)?w.jsx(X,{aspectRatio:e,crop:i,decoding:n,height:c,imageWidths:E,loader:s,loading:u,normalizedProps:y,passthroughProps:l,ref:d,width:f,data:r}):w.jsx(Y,{aspectRatio:e,crop:i,decoding:n,imageWidths:E,loader:s,loading:u,normalizedProps:y,passthroughProps:l,placeholderWidth:$,ref:d,sizes:h,data:r})}),X=m.forwardRef(({aspectRatio:t,crop:e,decoding:i,height:r,imageWidths:n,loader:c=b,loading:s,normalizedProps:u,passthroughProps:h,width:a,data:g},f)=>{const l=m.useMemo(()=>{const d=C(a),o=C(r),y=t||(D(u.width,u.height)?[d,o].join("/"):u.aspectRatio?u.aspectRatio:void 0),v=n===void 0?void 0:_(n,y,e,{width:(g==null?void 0:g.width)??void 0,height:(g==null?void 0:g.height)??void 0}),p=o||(y&&d?d*(T(y)??1):void 0),M=H(u.src,v,c),$=c({src:u.src,width:d,height:p,crop:u.height==="auto"?void 0:e});return{width:d,aspectRatio:y,height:p,srcSet:M,src:$}},[t,e,g,r,n,c,u,a]);return w.jsx("img",{ref:f,alt:u.alt,decoding:i,height:l.height,loading:s,src:l.src,srcSet:l.srcSet,width:l.width,style:{aspectRatio:l.aspectRatio,...h.style},...h})}),Y=m.forwardRef(({crop:t,decoding:e,imageWidths:i,loader:r=b,loading:n,normalizedProps:c,passthroughProps:s,placeholderWidth:u,sizes:h,data:a},g)=>{const f=m.useMemo(()=>{const l=i===void 0?void 0:_(i,c.aspectRatio,t,{width:(a==null?void 0:a.width)??void 0,height:(a==null?void 0:a.height)??void 0}),d=c.aspectRatio&&u?u*(T(c.aspectRatio)??1):void 0,o=H(c.src,l,r),y=r({
1src:c.src,width:u,height:d,crop:t});return{placeholderHeight:d,srcSet:o,src:y}},[t,a,i,r,c,u]);return w.jsx("img",{ref:g,alt:c.alt,decoding:e,height:f.placeholderHeight,loading:n,sizes:h,src:f.src,srcSet:f.srcSet,width:u,...s,style:{width:c.width,aspectRatio:c.aspectRatio,...s.style}})}),N="https://placeholder.shopify.com";function b({src:t,width:e,height:i,crop:r}){if(!t)return"";const n=new URL(t,N);return e&&n.searchParams.append("width",Math.round(e).toString()),i&&n.searchParams.append("height",Math.round(i).toString()),r&&n.searchParams.append("crop",r),n.href.replace(N,"")}function D(t="100%",e="auto"){return F(t.toString()).unit===F(e.toString()).unit}function F(t){const e=t.replace(/[0-9.]/g,""),i=parseFloat(t.replace(e,""));return{unit:e===""?i===void 0?"auto":"px":e,number:i}}function C(t){if(t===void 0)return;const{unit:e,number:i}=F(t.toString());switch(e){case"em":return i*16;case"rem":return i*16;case"px":return i;case"":return i;default:return}}function U(t){return typeof t=="number"||/\d(px|em|rem)$/.test(t)}function H(t,e,i=b){return t?(e==null?void 0:e.length)===0||!e?t:e.map((r,n)=>`${i({src:t,width:r.width,height:r.height,crop:r.crop})} ${e.length===3?`${n+1}x`:`${r.width??0}w`}`).join(", "):""}function z(t="100%",e,i,r){const n=Array.from({length:e},(s,u)=>u*r+i),c=Array.from({length:3},(s,u)=>(u+1)*(C(t)??0));return U(t)?c:n}function T(t){if(!t)return;const[e,i]=t.split("/");return 1/(Number(e)/Number(i))}function _(t,e,i="center",r){if(t)return t.map(n=>({width:n,height:e?n*(T(e)??1):void 0,crop:i})).filter(({width:n,height:c})=>!(r!=null&&r.width&&n>r.width||r!=null&&r.height&&c&&c>r.height))}function ct(t,e){const{pathname:i}=B();return m.useMemo(()=>tt({handle:t,pathname:i,searchParams:new URLSearchParams,selectedOptions:e}),[t,e,i])}function tt({handle:t,pathname:e,searchParams:i,selectedOptions:r}){const n=/(\/[a-zA-Z]{2}-[a-zA-Z]{2}\/)/g.exec(e),s=n&&n.length>0?`${n[0]}products/${t}`:`/products/${t}`;r==null||r.forEach(h=>{i.set(h.name,h.value)});const u=i.toString();return s+(u?"?"+i.toString():"")}export{ot as I,it as M,ct as u};
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.