import{d as O,k as S,c as o,o as c,b as a,f as u,t as f,a as d,u as l,P as b,E as h,G as m,j as v,F as _,r as P}from"./app-BidmlC59.js";import{S as j}from"./simplebar.min-hRaQJumN.js";const q={class:"filters simplebar-container mb-3 w-100",style:{"max-width":"100%"}},N={class:"nav nav-pills nav-tabs align-items-center",id:"sort-tab",role:"tablist",style:{"min-width":"1000px"}},R={class:"d-inline-flex filter-list-title lts-05 align-items-center nav-item me-3 text-muted"},$={class:"nav-item",role:"presentation"},z=O({__name:"FilterList",props:{filters:{},routeParam:{}},setup(g){const w=g;typeof window<"u"&&S(()=>{window.ResizeObserver=ResizeObserver,document.querySelectorAll(".simplebar-container").forEach(t=>{new j(t,{autoHide:!0})})});const n=(...t)=>{let r=m().url;if(r.indexOf("?")===-1)return{};r=r.substring(r.indexOf("?")+1);let s=Object.fromEntries(new URLSearchParams(r));for(let e in s)e=="search"||e=="cat"||e=="tag"||e=="profile"||e=="random"||e=="color"||e=="price"||e=="available"||e=="discount"||delete s[e];return{search:Object.assign(s,...t),all:Object.fromEntries(new URLSearchParams(r))}},y=(t,r,...s)=>{let i=`{ "${t}": ${r} }`.replace(/'/g,'"');return Object.assign(JSON.parse(i),...s)},p=(t,r)=>{let s={...n().all};if(s.hasOwnProperty(t)&&r)return!0;if(t=="all"){let e=!0;for(let i in w.filters)i in s&&(e=!1);return e}return!1};return(t,r)=>(c(),o("div",q,[a("ul",N,[a("li",R,[r[0]||(r[0]=a("i",{class:"ri-equalizer-line me-2"},null,-1)),u(" "+f(t.$t("messages.sentence.sort_by"))+": ",1)]),a("li",$,[d(l(b),{href:t.route(l(m)().props.currentRouteName,{...t.routeParam,...n().search}),as:"button",replace:"","preserve-scroll":"",class:h({"nav-link":!0,"lts-05":!0,active:p("all",!0)})},{default:v(()=>[u(f(t.$t("messages.word.all")),1)]),_:1},8,["href","class"])]),(c(!0),o(_,null,P(t.filters,(s,e)=>(c(),o("li",{key:e,class:"nav-item",role:"presentation"},[d(l(b),{href:t.route(l(m)().props.currentRouteName,{...t.routeParam,...n().search,...y(e,!0)}),as:"button",replace:"","preserve-scroll":"",class:h({"nav-link":!0,"lts-05":!0,active:p(e,!0)})},{default:v(()=>[u(f(s),1)]),_:2},1032,["href","class"])]))),128))])]))}});export{z as _};
