1import{p as L,d as x,I as N,J as R,o as z,A as D,e as B,f as _,h as m,k as v,F as A,r as S,S as I,t as C,s as F,l as $,m as T,a as J,M as Y,i as P,j,Y as K,g as V,B as W,aj as X,n as Q,ai as Z,q as U}from"./Bd53cF0q.js";import{b as ee,c as te}from"./F-E6Ullx.js";const re=L("/images/select-arrow.png"),se={key:0,class:"product-filter"},ae={class:"mobile-filter-sort-list"},oe=["onClick"],ne=x({__name:"CatalogSelectorsDropdown",props:{sortOptions:{},isExpanded:{}},setup(b){const n=N(),g=R(),c=b,u=$(()=>c.sortOptions||[]),a=T("0"),r=t=>{a.value=t;const i={...n.query};a.value!=="0"?i.OrderBy=a.value:delete i.OrderBy,g.push({query:i})};return z(()=>{const t=u.value.find(i=>i.selected);t&&(a.value=t.value)}),D(()=>n.query.OrderBy,t=>{if(t){const i=c.sortOptions.find(o=>o.value===t);i&&(a.value=i.value,c.sortOptions.forEach(o=>{o.selected=o.value===i.value}))}else a.value="0"},{immediate:!0}),(t,i)=>B(u).length>0?(_(),m("div",se,[v("ul",ae,[(_(!0),m(A,null,S(B(u),o=>(_(),m("li",{key:o.value,class:I({selected:a.value===o.value}),onClick:p=>r(o.value)},C(o.text),11,oe))),128))])])):F("",!0)}}),le=Object.assign(ne,{__name:"CatalogSelectorsDropdown"}),ie={class:"mobile-filter-bar-filters"},ce={class:"filter-buttons-wrapper"},de=["onClick"],ue={class:"filter-label"},pe={key:0,class:"filter-count"},_e={key:0,class:"filter-separator"},fe={key:0,class:"filter-drawer-container"},me={class:"filter-drawer"},ge={class:"drawer-content"},ve={key:0,class:"filter-drawer-bottom mobile"},be=["disabled"],he=x({__name:"MobileFiltersBar",props:{filterParams:{type:Object,default:()=>({})},CategoryModel:{type:Object,default:()=>({})},loading:{type:Boolean,default:!1},numberOfProducts:{type:Number,default:0},drawerOpened:{type:Boolean,default:!1},activeDrawerFilter:{type:String,required:!0}},emits:["update:drawerOpened","update:activeDrawerFilter"],setup(b,{emit:n}){const g=J(),c=R(),u=b,a=s=>{const e=s.flatMap(d=>d.districts).filter(d=>d.selected);return e.length===0?g.t("Filtering.LocationFilter"):e.length===1?e[0].name:`${e[0].name}â
â
â
`},r=s=>{const e=s.filter(y=>y.selected);return e.length===0?g.t("Filtering.CheckupItems"):new Set(e.map(y=>y.name)).size===1?e[0].name:`${e[0].name}â
â
â
`},t=$(()=>[{name:"sort",label:g.t("Filtering.SortFilter"),component:le,checkProp:e=>e?.catalog_products_model?.available_sort_options?.length>0},{name:"location",label:a(u.CategoryModel.catalog_products_model.location_filter.areas),selected:u.CategoryModel.catalog_products_model.location_filter.areas.flatMap(e=>e.districts).filter(e=>e.selected).length,component:ee,checkProp:e=>e?.catalog_products_model?.location_filter?.areas?.length>0},{name:"attributes",label:r(u.CategoryModel.catalog_products_model.specification_filter.attributes),selected:new Set(u.CategoryModel.catalog_products_model.specification_filter.attributes.filter(e=>e.selected).map(e=>e.name)).size,component:te,checkProp:e=>e?.catalog_products_model?.specification_filter?.attributes?.length>0}]),i=$(()=>t.value.filter(s=>s.checkProp(u.CategoryModel))),o=T(!1),p=T(""),w=$(()=>t.value.find(e=>e.name===p.value)?.component||null),l=s=>{p.value===s&&o.value?k():h(s)},f=n,h=s=>{p.value=s,o.value=!0,f("update:drawerOpened",!0),f("update:activeDrawerFilter",s)},k=()=>{o.value=!1,f("update:drawerOpened",!1),p.value="",f("update:activeDrawerFilter","")},M=()=>{switch(p.value){case"location":u.CategoryModel.catalog_products_model.location_filter.areas.forEach(d=>{d.districts.forEach(y=>{y.selected=!1})});const s={...E.query};delete s.ds,c.replace({query:s});break;case"attributes":u.CategoryModel.catalog_products_model.specification_filter.attributes.forEach(d=>{d.selected=!1});const e={...E.query};delete e.attr,delete e.attrs,c.replace({query:e});break}},H=()=>{const s=t.value.find(e=>e.name===p.value);if(!s)return{};switch(s.name){case"sort":return{sortOptions:u.CategoryModel.catalog_products_model.available_sort_options,isExpanded:!0};case"location":return{areas:u.CategoryModel.catalog_products_model.location_filter.areas,isExpanded:!0};case"attributes":return{attributes:u.CategoryModel.catalog_products_model.specification_filter.attributes,isExpanded:!0};default:return{}}},O=()=>{const s=document.querySelector(".filter-drawer"),e=document.querySelector(".filter-buttons-wrapper"),d=e?.getBoundingClientRect().top;if(s&&e){const y=e.offsetHeight,q=s.getBoundingClientRect(),G=y+q.height;requestAnimationFrame(()=>{document.documentElement.style.setProperty("--drawer-height",`${G}px`),document.documentElement.style.setProperty("--scroll-position",`${d}px`)})}};D([()=>o.value,()=>p.value],([s,e])=>{s&&(O(),requestAnimationFrame(()=>{O()}))}),z(()=>{const s=document.querySelector(".filter-drawer");s&&new ResizeObserver(()=>{o.value&&O()}).observe(s);let e=!1;const d=()=>{!e&&o.value&&(requestAnimationFrame(()=>{O(),e=!1}),e=!0)};window.addEventListener("scroll",d,{passive:!0}),window.addEventListener("resize",O),Y(()=>{window.removeEventListener("scroll",d),window.removeEventListener("resize",O)})});const E=N();return D(()=>E.query.OrderBy,(s,e)=>{o.value&&p.value==="sort"&&s!==e&&k()}),(s,e)=>(_(),m("div",ie,[v("div",ce,[(_(!0),m(A,null,S(i.value,(d,y)=>(_(),m(A,{key:y},[v("button",{onClick:q=>l(d.name),class:I(["filter-button",{active:p.value===d.name&&o.value,inactive:p.value&&p.value!==d.name&&o.value}])},[v("span",ue,C(d.label),1),d.selected>1?(_(),m("span",pe,"("+C(d.selected)+")",1)):F("",!0),e[0]||(e[0]=v("img",{src:re,width:"10",class:"mobile-filter-bar-filter-arrow"},null,-1))],10,de),y<i.value.length-1?(_(),m("div",_e)):F("",!0)],64))),128))]),P(K,{name:"drawer"},{default:j(()=>[o.value?(_(),m("div",fe,[v("div",me,[v("div",ge,[(_(),V(X(w.value),W(H(),{onClose:k}),null,16))])]),v("div",{class:"filter-drawer-overlay",onClick:k})])):F("",!0)]),_:1}),o.value&&p.value!=="sort"?(_(),m("div",ve,[v("span",{class:"filter-text",id:"clearAllFilter",onClick:M},C(s.$t("Filtering.ClearAll")),1),v("button",{class:I(["filter-search-button",{"loading bg-green":b.loading,"bg-gray":b.numberOfProducts==0}]),onClick:l,disabled:b.loading},C(b.loading?"":s.$t("Filtering.Show",[b.numberOfProducts])),11,be)])):F("",!0)]))}}),Ee=Object.assign(Q(he,[["__scopeId","data-v-52732cf3"]]),{__name:"CatalogMobileFiltersBar"}),ye={key:0},Ce={class:"breadcrumb"},we={class:"breadcrumb-item"},ke=["aria-current"],Fe={key:1},Oe=x({__name:"CategoryBreadCrumbs",props:{homepageUrl:{},breadcrumbTopTitle:{},breadcrumbDelimiter:{},categoryBreadcrumb:{}},setup(b){const n=b,g=c=>`/category/${encodeURIComponent(c)}`;return(c,u)=>{const a=Z;return n.categoryBreadcrumb&&n.categoryBreadcrumb.length>0?(_(),m("nav",ye,[v("ol",Ce,[v("li",we,[P(a,{to:n.homepageUrl},{default:j(()=>[U(C(n.breadcrumbTopTitle),1)]),_:1},8,["to"])]),(_(!0),m(A,null,S(n.categoryBreadcrumb,(r,t)=>(_(),m("li",{key:r.id,class:"breadcrumb-item","aria-current":t===n.categoryBreadcrumb.length-1?"page":void 0},[t!==n.categoryBreadcrumb.length-1?(_(),V(a,{key:0,to:g(r.se_name)},{default:j(()=>[U(C(r.name),1)]),_:2}
1,1032,["to"])):(_(),m("span",Fe,C(r.name),1))],8,ke))),128))])])):F("",!0)}}}),De=Object.assign(Oe,{__name:"CatalogCategoryBreadCrumbs"}),$e={key:0,class:"active-filters"},Ae={class:"filters-wrapper"},Be=["onClick"],xe=x({__name:"ActiveFilters",props:{CategoryProductsModel:{type:Object,required:!0,default:()=>({catalog_products_model:{products:[],total_items:0}})}},setup(b){const n=N(),g=R(),c=b,u=async r=>{const t={...n.query};switch(r.filterType){case"attr":const o=decodeURIComponent(t.attr?.toString()||"").split(",").filter(h=>Number.parseInt(h)!==r.id);o.length&&o[0]!==""?t.attr=o.join("%2C"):delete t.attr;break;case"ds":const w=decodeURIComponent(t.ds?.toString()||"").split(",").filter(h=>Number.parseInt(h)!==r.id);w.length&&w[0]!==""?t.ds=w.join("%2C"):delete t.ds;break;case"ven":const f=decodeURIComponent(t.ven?.toString()||"").split(",").filter(h=>Number.parseInt(h)!==r.id);f.length&&f[0]!==""?t.ven=f.join("%2C"):delete t.ven;break;case"attrs":if(r.ids){const k=decodeURIComponent(t.attrs?.toString()||"").split(",").filter(M=>!r.ids.includes(Number.parseInt(M)));k.length&&k[0]!==""?t.attrs=k.join("%2C"):delete t.attrs}break;case"price":delete t.price;break}await g.push({query:t})},a=$(()=>{const r=[],t=n.query.price?.toString();if(t){const[l,f]=t.split("-");r.push({filterType:"price",id:0,label:`$${l} - $${f}`})}const i=c.CategoryProductsModel?.catalog_products_model?.location_filter?.areas;i?.length&&i.forEach(l=>{l.districts?.filter(h=>h.selected)?.forEach(h=>{r.push({filterType:"ds",id:h.id,label:h.name})})});const o=c.CategoryProductsModel?.catalog_products_model?.vendor_filter?.vendors?.filter(l=>l.selected);o?.length&&o.forEach(l=>{r.push({filterType:"ven",id:Number.parseInt(l.value),label:l.text})});const p=new Map,w=c.CategoryProductsModel?.catalog_products_model?.specification_filter?.attributes;w?.length&&w.filter(l=>l.selected).forEach(l=>{p.has(l.name)?p.get(l.name).ids.push(l.id):p.set(l.name,{name:l.name,ids:[l.id]})});for(const[l,f]of p)f.ids.length>1?r.push({filterType:"attrs",ids:f.ids,id:f.ids[0],label:l}):r.push({filterType:"attr",id:f.ids[0],label:l});return r});return(r,t)=>B(a).length>0?(_(),m("div",$e,[v("div",Ae,[(_(!0),m(A,null,S(B(a),i=>(_(),m("div",{key:`${i.filterType}-${i.id}`,class:"filter-tag"},[v("span",null,C(i.label),1),v("i",{class:"icon icon-cross",onClick:o=>u(i)},null,8,Be)]))),128))])])):F("",!0)}}),Ie=Object.assign(Q(xe,[["__scopeId","data-v-88cca0e3"]]),{__name:"CatalogActiveFilters"}),Te=L("/img/home/btn-back.png"),je=L("/images/icon-filter.png"),Le=()=>({createAnalyticsFilters:(n,g)=>{const c={};if(n.price&&(c.price=n.price),n.attr?.length||n.attrs?.length){const a=[],r=Array.from(new Set([...n.attr||[],...n.attrs||[]]));g?.specification_filter?.attributes?.forEach(t=>{r.includes(t.id)&&a.push(t.name)}),c.specification=Array.from(new Set(a))}if(n.ven?.length&&(c.vendor=g?.vendor_filter?.vendors?.filter(a=>n.ven.includes(Number(a.value)))?.map(a=>a.text)||[]),n.ds?.length){const a=[];g?.location_filter?.areas?.forEach(r=>{r.districts&&a.push(...r.districts)}),c.district=a.filter(r=>n.ds.includes(r.id)).map(r=>r.name)||[]}const u=n.OrderBy?g?.available_sort_options?.find(a=>a.value===n.OrderBy):g?.available_sort_options?.find(a=>a.selected);return c.order_by=u?.text,c}});export{Te as _,je as a,Ee as b,Ie as c,De as d,Le 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.