import{Q as x}from"./QPage-BfEPTOJq.js";import{u as y}from"./index-C91YIOYp.js";import{d as k,r as b,as as S,af as q,aj as w,al as o,ao as s,ap as u,aq as i,ae as c,ad as l,aN as p,ah as h}from"./index-BT5eY4j5.js";import{_ as B}from"./QuickSearch.vue_vue_type_script_setup_true_lang-GoI2xVcT.js";import{E as C,_ as P}from"./EntityCardSkeleton-DqdGeiW9.js";import{u as V}from"./vue-i18n-CUkMLu72.js";import"./QSelect-7Ay93ffU.js";import"./QItem-9vG9WSh3.js";import"./QMenu-lMfgNADA.js";import"./selection-DqxIs-MO.js";import"./QForm-_ScWQlBk.js";import"./index-3EQhSKDt.js";import"./QCarousel-Cjxkio9d.js";import"./use-panel-CWoWnVAV.js";import"./TouchSwipe-DbDTeaOO.js";import"./QSkeleton-B930fRUI.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";const A={class:"row q-col-gutter-y-md q-col-gutter-x-md q-pa-md"},E={class:"text-h4"},F={class:"col-12"},N={key:1,class:"col-12"},D={class:"text-subtitle text-center q-my-lg"},Z=k({__name:"SearchView",setup(I){const n=w(),a=b(),{state:m,isLoading:_,execute:f}=y(async()=>a.value?Promise.all([n.entities.filter.byPrice(a.value.price,a.value.currency).then(t=>t.data),n.entities.filter.byRating(a.value.rating).then(t=>t.data),n.entities.filter.byCity(a.value?.city).then(t=>t.data.entities)]).then(t=>(t.sort((r,e)=>r.length-e.length),console.log(t),t[0].filter(r=>t.every(e=>e.some(v=>r.id===v.id))))):[],[],{immediate:!1}),{t:d}=V();function g(t){a.value=t,f()}return(t,r)=>(o(),S(x,null,{default:q(()=>[s("div",null,[s("div",A,[s("h1",E,u(i(d)("pages.search")),1),s("div",F,[c(B,{autosubmit:"",onSubmit:g})]),i(_)?(o(),l(h,{key:0},p(4,e=>s("div",{key:e,class:"col-12 col-lg-6 col-xl-3"},[c(C)])),64)):i(m).length?(o(!0),l(h,{key:2},p(i(m),e=>(o(),l("div",{key:e.id,class:"col-12 col-lg-6 col-xl-3"},[c(P,{id:e.id,title:e.imeSalona,images:e.slike,address:e.adresa??"",rating:e.prosecnaOcena,"working-hours":e.radnoVreme,"payment-methods":e.paymentMethod.split(" "),"next-available-date":e.nextAvailableDate??null},null,8,["id","title","images","address","rating","working-hours","payment-methods","next-available-date"])]))),128)):(o(),l("div",N,[s("h3",D,u(i(d)("entities.notFound")),1)]))])])]),_:1}))}});export{Z as default};
