1(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`cf126d4e-0ad2-4d34-b8c8-52e3d90085d5`,e._sentryDebugIdIdentifier=`sentry-dbid-cf126d4e-0ad2-4d34-b8c8-52e3d90085d5`)}catch{}})();import{n as e}from"./DLx7bSOm.js";import{D as t,E as ee,Ht as n,Kt as r,On as i,Qn as te,Ut as a,Yt as o,_ as s,b as c,bt as ne,g as l,k as u,mt as d,nr as f,o as re,qt as ie,un as p,v as ae,vn as m,y as oe}from"./cN6o73f0.js";import{b as se,w as ce,x as le}from"./vov0F2jA.js";import{f as h,p as g}from"./S9afSNl8.js";import{c as _}from"./Jkx6DC02.js";import{n as ue}from"./CDaL4DIN.js";import{d as v,h as y,p as b,u as de}from"./BWRas3Pk.js";import{t as x}from"./BuuqxS5P.js";import{i as fe}from"./DGcLkm102.js";import{t as pe}from"./CQfdEdmu.js";import{t as me}from"./DuyFVAxz.js";import{t as he}from"./CTybAnOs.js";import{t as S}from"./B0v-1JZV.js";import{t as C}from"./_wGBAbGa.js";import{t as w}from"./CgvlW22X.js";var T={class:`product-list-container`},E={class:`search-bar`},D=[`placeholder`],O=[`aria-label`],k={for:`sort-dropdown`},A={value:`FEATURED`},j={value:`PRICE_ASC`},M={value:`PRICE_DESC`},N={class:`products-grid`},P={key:0,class:`load-more`},F=x(u({__name:`index`,async setup(u){let x,F,{siteState:I}=_(),L=g(),R=h(),{t:z}=e(),B=m(typeof R.query.query==`string`?R.query.query:``),V=m([]),H=m(!1),U=m(null),W={FEATURED:y.RELEVANCE,PRICE_ASC:y.PRICE,PRICE_DESC:y.PRICE},G=m(typeof R.query.sort==`string`&&R.query.sort in W?R.query.sort:`FEATURED`),ge=l(()=>G.value.endsWith(`_DESC`)),K=l(()=>b[I.value?.prefix?.toUpperCase()]??b.EN),q=m([]),J=m(null),Y=w({availableFilters:q,fetchFilters:async e=>(await de({query:B.value,filters:e,language:K.value}))?.search?.productFilters,priceBoundsOverride:J});Y.readFromUrl(),[x,F]=r(()=>Y.refreshScope()),await x,F();let{data:X,refresh:Z,pending:_e,error:ve}=([x,F]=r(()=>ue(`search-products-${B.value}`,()=>v({first:50,query:B.value,after:U.value,filters:Y.buildFilters(),filtersWithoutPrice:Y.buildFilters(`price`),reverse:ge.value,sortKey:W[G.value],language:K.value}))),x=await x,F(),x);a(()=>{let e=X.value?.priceBounds,t=(e?.edges??[]).flatMap(e=>`priceRange`in e.node?[{min:Number(e.node.priceRange.minVariantPrice.amount),max:Number(e.node.priceRange.maxVariantPrice.amount)}]:[]);if(!t.length||e?.pageInfo.hasNextPage){J.value=null;return}J.value={min:Math.floor(Math.min(...t.map(e=>e.min))),max:Math.ceil(Math.max(...t.map(e=>e.max)))}});let Q=l(()=>ve.value?z(`products.loadError`):!_e.value&&!V.value.length?z(`products.noResults`):``);n(X,e=>{e?.search?.edges&&(V.value.length&&U.value?V.value.push(...e.search.edges):V.value=e.search.edges,H.value=e.search.pageInfo.hasNextPage,U.value=e.search.pageInfo.endCursor??null,q.value=e.search.productFilters)},{immediate:!0});let $=async()=>{V.value=[],U.value=null,await Z()},ye=()=>{L.replace({query:{...R.query,query:B.value??void 0}}),V.value=[],U.value=null,Z(),Y.refreshScope()};return n(G,e=>{L.replace({query:{...R.query,sort:e===`FEATURED`?void 0:e}}),$()}),fe([Y.selectedValues,Y.selectedRanges,Y.activeScope],async()=>{Y.writeToUrl(),await $(),await Y.refreshCounts()},{deep:!0,debounce:300}),(e,n)=>{let r=pe,a=he,l=S,u=me,m=C;return d(),c(`div`,T,[s(`div`,E,[s(`span`,null,f(i(z)(`products.totalResults`,{n:i(X)?.search.totalCount})),1),s(`form`,{class:`search-bar__input`,onSubmit:ce(ye,[`prevent`])},[o(s(`input`,{"onUpdate:modelValue":n[0]||=e=>p(B)?B.value=e:null,type:`text`,placeholder:i(z)(`search.placeholder`),class:`search-input`},null,8,D),[[le,i(B)]]),s(`button`,{class:`btn btn-02--out`,"aria-label":i(z)(`search.title`),type:`submit`},f(i(z)(`search.title`)),9,O)],32)]),t(a,{"active-count":i(Y).activeFilterCount.value,"result-count":i(V).length,open:i(Y).isDrawerOpen.value,onOpen:n[2]||=e=>i(Y).isDrawerOpen.value=!0},{sort:ie(()=>[s(`label`,k,[t(r,{"aria-hidden":`true`}),ee(` `+f(i(z)(`products.sort.sort`)),1)]),o(s(`select`,{id:`sort-dropdown`,"onUpdate:modelValue":n[1]||=e=>p(G)?G.value=e:null,class:`sort-dropdown`},[s(`option`,A,f(i(z)(`products.sort.featured`)),1),s(`option`,j,f(i(z)(`products.sort.priceLow`)),1),s(`option`,M,f(i(z)(`products.sort.priceHigh`)),1)],512),[[se,i(G)]])]),_:1},8,[`active-count`,`result-count`,`open`]),t(l,{chips:i(Y).chips.value,onRemove:n[3]||=e=>i(Y).removeChip(e),onClear:n[4]||=e=>i(Y).clearAll()},null,8,[`chips`]),s(`div`,N,[(d(!0),c(re,null,ne(i(V),e=>(d(),ae(u,{key:e.node.id,product:e.node},null,8,[`product`]))),128))]),s(`div`,{role:`status`,class:te({"no-results":i(Q)})},f(i(Q)),3),i(H)?(d(),c(`div`,P,[s(`button`,{class:`btn btn-01`,type:`button`,onClick:n[5]||=e=>i(Z)()},f(i(z)(`products.loadMore`)),1)])):oe(``,!0),t(m,{filters:i(Y),open:i(Y).isDrawerOpen.value,"result-count":i(V).length,onClose:n[6]||=e=>i(Y).isDrawerOpen.value=!1},null,8,[`filters`,`open`,`result-count`])])}}}),[[`__scopeId`,`data-v-35dc6567`]]);export{F 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.