import{_ as y}from"./client-only-CuDeK6DU.js";import{ref as o,watch as d,nextTick as B,computed as u,mergeProps as E,useSSRContext as M}from"vue";import{ssrRenderAttrs as A,ssrRenderComponent as I}from"vue/server-renderer";import{a as O,b as P,u as T}from"../server.mjs";import"hookable";import"ofetch";import"#internal/nuxt/paths";import"unctx";import"h3";import"unhead";import"@unhead/shared";import"vue-router";import"radix3";import"defu";import"klona";import"cookie-es";import"destr";import"ohash";import"@vue/devtools-api";import"pinia";import"axios";const C={__name:"HomeSearch",__ssrInlineRender:!0,setup(i){O();const{t:m,locale:t,setLocale:V}=P();let s=T();o(t.value=="ar"?"اختر ماركة السيارة ":"choose car brand");let L=o(t.value=="ar"?"اختر موديل السيارة ":"choose car model"),S=o(t.value=="ar"?"اختر اسم السيارة ":"choose car name"),g=o(""),x=o(""),H=o("");o();let b=o(),D=o();const a=o(null),p=o(null),v=o(null),r=o(null),h=()=>{const e=r.value;if((void 0).querySelector(".load-more-dropdown")){const n=e.scrollHeight-e.scrollTop<=e.clientHeight}};d(()=>a.value.isOpen,async e=>{e?(await B(),r.value&&r.value.addEventListener("scroll",h)):r.value&&r.value.removeEventListener("scroll",h)}),u(()=>a.value.items.filter(e=>e.name.toLowerCase().includes(g.value.toLowerCase())));let w=o([]),f=o([]);return u(()=>w.value.filter(e=>e.name.toLowerCase().includes(x.value.toLowerCase()))),u(()=>f.value.filter(e=>e.name.toLowerCase().includes(H.value.toLowerCase()))),d([()=>s.SearchCars2,()=>s.brands,()=>s.SearchModels2,()=>s.brands2],([e,l,n,c])=>{a.value.items=c,p.value.items=n,v.value.items=e}),d(()=>w.value,e=>{e.length==0&&(f.value=[],b.value=void 0,D.value=void 0,p.value.selected=L.value,v.value.selected=S.value)}),(e,l,n,c)=>{const R=y;l(`<div${A(E({class:"container search-home-p"},c))}>`),l(I(R,null,{},n)),l("</div>")}}},_=C.setup;C.setup=(i,m)=>{const t=M();return(t.modules||(t.modules=new Set)).add("components/home/HomeSearch.vue"),_?_(i,m):void 0};export{C as default};
