import{A as U,W as z,a9 as H,bo as ae,B as q,C as re,b5 as oe,r as l,G as c,X as O,P as _,H as m,a0 as d,y as v,I as h,Z as D,L as A,O as V,ag as C,ah as L,_ as se,a8 as ne,D as ie,ae as le,E as B,ad as ce,bv as ue,aE as x,ap as r,F as pe,af as j,bw as F,N as M,bx as N,ai as me}from"./index-lCRwTiBk.js";import{u as de}from"./vue.f36acd1f-DPCG9g2X.js";import{_ as he}from"./DetailPageMain.vue_vue_type_style_index_0_lang-IdjIICI1.js";import{V as ge}from"./VContainer-Dh2-a32C.js";import"./VSnackbar-cGWp3cpK.js";const fe={id:"search-main"},_e={key:0,class:"a-top-margin"},ye={key:0,class:"v-col-12 v-col-xs-11 v-col-md-10 v-col-xl-7 a-top-margin"},ve={class:"pa-0 ma-0 text-truncate",style:{"font-size":"1.2em"}},be={class:"pa-0 ma-0 text-truncate",style:{"font-size":"1.1em"}},Se=U({__name:"SearchMain",props:{h1:{},headerInfo:{}},setup(G){const n=z(),g=H(),{isLoggedIn:a,preferences:i}=ae(g),w=q(),o=re(),I=C(()=>L(()=>import("./RealEstateListMain-DLi0jFSN.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28]))),f=C(()=>L(()=>import("./AddSearchOrderMain-GRYb6Rvz.js"),__vite__mapDeps([10,1,2,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]))),y=C(()=>L(()=>import("./MapMain-Ma_vZ003.js"),__vite__mapDeps([29,1,2,30,6,7,31,8,32,33]))),b=oe("$isHeadless"),S=l({get(){return n.searchMobileCurrentView},set(u){n.setSearchMobileCurrentView(u),o.push({path:w.fullPath,query:{ig_smcv:u}})}});return(u,k)=>(c(),O("div",fe,[S.value==="mapView"?(c(),O("div",_e,[_(b)?d("",!0):(c(),m(_(y),{key:0,class:"a-map-main-mobile a-top-margin"}))])):d("",!0),v(D,{"no-gutters":"",justify:"center"},{default:h(()=>[S.value==="listView"?(c(),O("div",ye,[v(D,{class:"v-col-12 py-0","no-gutters":""},{default:h(()=>[A("h1",ve,V(u.headerInfo),1)]),_:1}),u.h1?(c(),m(D,{key:0,class:"v-col-12 py-0","no-gutters":""},{default:h(()=>[A("h1",be,V(u.h1),1)]),_:1})):d("",!0),v(_(I),{class:"a-real-estate-list-main-mobile"})])):d("",!0)]),_:1}),_(a)&&_(i).subscription_tier!=="Business-Owner-Premium"?(c(),m(_(f),{key:1,class:"sticky-button",origin:"sticky-button"})):d("",!0)]))}}),Ee=se(Se,[["__scopeId","data-v-c478d51b"]]),we={style:{width:"100%","background-color":"white"}},Le=U({__name:"SearchPage",setup(G){const n=q(),g=ne(),a=ie(),i=H(),w=z(),o=le(),I=C(()=>L(()=>import("./StepperView-731ZiGZj.js"),__vite__mapDeps([34,1,2,35,36,4,5,17,18,37,38,39,40,41]))),f=B(!1);n.query.utm_source==="google"&&(f.value=!0);const y=B(!1),b=B(0),S=l(()=>i.isLoggedIn);window.onpopstate=function(){location.reload()};const u=l(()=>o.searchLocations.map(t=>t.text).join(", ")),k=l(()=>{let e="";n.params.distinct_search&&n.params.distinct_search.includes("zimmer")&&(e=r.global.t("pages.SearchPage.metaData.roomsCount",{rooms:n.params.distinct_search.split("-")[0]}));let t=`pages.SearchPage.metaData.${o.offerType}.${o.objectType}.h1`,s=a.realEstates.count;if(a.realEstates.count<3e4?s=r.global.n(a.realEstates.count,"decimal"):a.realEstates.count>3e4&&(s="30.000+"),!(!r.global.te(t)||!u.value||!s))return r.global.t(t,{location:u.value,reCount:s,rooms:e})}),W=l(()=>a.realEstateLoadingState==="loading"?r.global.t("pages.SearchPage.loadingText"):r.global.t("pages.SearchPage.searchedPortals")),T=l(()=>{let e="";n.params.distinct_search&&n.params.distinct_search.includes("zimmer")&&(e=r.global.t("pages.SearchPage.metaData.roomsCount",{rooms:n.params.distinct_search.split("-")[0]}));let t=`pages.SearchPage.metaData.${o.offerType}.${o.objectType}.title`;return!r.global.te(t)||!u.value?r.global.t("pages.SearchPage.metaData.fallBack.title"):r.global.t(t,{location:u.value,rooms:e})}),K=l(()=>{let e=[];return a.realEstates&&a.realEstates.results&&a.realEstates.results[0]&&a.realEstates.results[0].images&&a.realEstates.results[0].images[0]&&a.realEstates.results[0].images[0].original_url&&e.push(a.realEstates.results[0].images[0].original_url),e}),R=l(()=>k.value?k.value+" - "+r.global.t("pages.SearchPage.metaData.description"):r.global.t("pages.SearchPage.metaData.description")),P=l(()=>"https://www.areaone.io/s/"+n.params.object_type+"/"+n.params.offer_type+"/"+n.params.search_location+"/");l(()=>a.currentOpenedRealEstate);const E=l({get(){return a.currentOpenedRealEstate.isOpened},set(e){a.currentOpenedRealEstate={realEstateId:[],currentIdx:a.currentOpenedRealEstate.currentIdx,goToSec:null,isOpened:e,travelRoutes:null}}}),X=l(()=>i.data.subscription_tier);ce(()=>{a.checkCurrentUrlForState()}),ue(()=>{if(i.isLoggedIn&&g.get("premiumSubscription")&&(y.value||$(),X.value!=="Premium")){let e={};e.Authorization=i.data.accessToken,x.get("https://user-management-service.prod.api.areaone.io/user",{headers:e}).then(t=>{t.data.subscription_tier!=="Premium"&&(window.location.href=`https://buy.stripe.com/7sI3fkfuT2L76DS4gh?client_reference_id=${i.data.uid}&prefilled_email=${i.data.email}`)})}});function Z(){E.value=!1}function $(){if(y.value=!0,b.value>9)return;const e=a.createRealEstateSettingsBody("getRealEstates");for(const p in e)p.includes("pg")&&delete e[p];let t={frontend_filter:e,name:g.get("premiumName"),interval:g.get("premiumInterval"),notification_type:g.get("premiumNotificationType"),display_data:{object_type:J(),offer_type:Q(),search_region:Y()}},s={};s.Authorization=i.data.accessToken,x.post("https://user-management-service.prod.api.areaone.io/search-orders",t,{headers:s}).then(p=>{p.status===200&&setTimeout(()=>{g.remove("premiumSubscription"),y.value=!1},1e3)}).catch(()=>{setTimeout(()=>{y.value=!1,b.value=b.value+1,$()},1e3)})}function J(){if(o.objectType==="wohnung")return r.global.t("components.sharedComponents.mainFilterOptions.objectTypeFilter.flat");if(o.objectType==="haus")return r.global.t("components.sharedComponents.mainFilterOptions.objectTypeFilter.house")}function Q(){if(o.offerType==="kaufen")return r.global.t("components.sharedComponents.mainFilterOptions.offerTypeFilter.buy");if(o.offerType==="mieten")return r.global.t("components.sharedComponents.mainFilterOptions.offerTypeFilter.rent")}function Y(){let e="";return o.currentSearchType==="searchByLocation"&&o.searchLocations.forEach((t,s)=>{e+=t.text,o.searchLocations[s+1]&&(e+=", ")}),o.currentSearchType==="searchByIsochrone"&&o.isochroneLocations.forEach((t,s)=>{e+="<"+Math.floor(t.range/60)+"min "+r.global.t("components.search.appBar.addSearchOrder.AddSearchOrderDetails."+t.mode)+" "+r.global.t("components.search.appBar.addSearchOrder.AddSearchOrderDetails.to")+" "+t.destinationName,o.isochroneLocations[s+1]&&(e+=" | ")}),e}pe(S,()=>{S.value?x.get("https://user-management-service.prod.api.areaone.io/bookmarks",{headers:{Authorization:i.data.accessToken}}).then(e=>{var t,s;(t=e.data)!=null&&t.real_estate_ids?i.setBookmarks((s=e.data)==null?void 0:s.real_estate_ids):i.setBookmarks([])}).catch(()=>{i.setBookmarks([])}):i.setBookmarks([])},{immediate:!0}),de({link:[{rel:"canonical",href:P}],title:T,meta:[{name:"description",content:R},{property:"og:title",content:T},{property:"og:description",content:R},{property:"og:site_name",content:"AreaOne Immobilien Suche"},{property:"og:image",content:w.baseUrl+"/static/area-one-icon-thumpnail.jpeg"},{property:"og:type",content:"website"},{property:"og:url",content:P},{property:"article:published_time",content:a.currentRealEstate?a.currentRealEstate.provider_date:""},{property:"twitter:card",content:"summary"},{property:"twitter:site",content:"@areaoneio"},{property:"twitter:url",content:P},{property:"twitter:title",content:T},{property:"twitter:image",content:w.baseUrl+"/static/area-one-icon-thumpnail.jpeg"},{property:"twitter:description",content:R},{property:"robots",content:"index,follow"},{name:"viewport",content:"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"}]});const ee=l(()=>({"@context":"http://schema.org","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Suche",item:"https://www.areaone.io/"},{"@type":"ListItem",position:2,name:n.params.search_location,item:P}]})),te=l(()=>({"@context":"http://schema.org","@type":"Product",name:T,image:K,offers:{"@type":"AggregateOffer",priceCurrency:"EUR",offerCount:a.realEstates.count,lowPrice:a.realEstates.price_min,highPrice:a.realEstates.price_max}}));return(e,t)=>(c(),O(me,null,[v(ge,{class:"pa-0",fluid:"","full-height":"",id:"searchPage",style:{width:"100vw"}},{default:h(()=>{var s;return[v(Ee,{"header-info":W.value,h1:k.value,id:"searchMain"},null,8,["header-info","h1"]),E.value&&((s=e.$route.name)!=null&&s.toString().startsWith("App-Search"))?(c(),m(j,{key:0,modelValue:E.value,"onUpdate:modelValue":t[1]||(t[1]=p=>E.value=p),fullscreen:e.$vuetify.display.width<700,height:e.$vuetify.display.width>700?"100vh":"",width:"700"},{default:h(()=>[E.value?(c(),m(he,{key:0,onClose:t[0]||(t[0]=p=>Z())})):d("",!0)]),_:1},8,["modelValue","fullscreen","height"])):d("",!0),f.value?(c(),m(j,{key:1,modelValue:f.value,"onUpdate:modelValue":t[3]||(t[3]=p=>f.value=p),class:"pa-0 ma-0",fullscreen:"",transition:"dialog-bottom-transition"},{default:h(()=>[A("div",we,[v(_(I),{onCloseSearchPageStepper:t[2]||(t[2]=p=>f.value=!1)})])]),_:1},8,["modelValue"])):d("",!0)]}),_:1}),(c(),m(N,{to:"head"},[(c(),m(F("script"),{type:"application/ld+json"},{default:h(()=>[M(V(te.value),1)]),_:1}))])),(c(),m(N,{to:"head"},[(c(),m(F("script"),{type:"application/ld+json"},{default:h(()=>[M(V(ee.value),1)]),_:1}))]))],64))}});export{Le as default};
function __vite__mapDeps(indexes) {
  if (!__vite__mapDeps.viteFileDeps) {
    __vite__mapDeps.viteFileDeps = ["assets/RealEstateListMain-DLi0jFSN.js","assets/index-lCRwTiBk.js","assets/index-CrRwc5TH.css","assets/RealEstateListItemMain-BD54GNih.js","assets/GenericInfoDialog-DvwpXbwJ.js","assets/GenericInfoDialog-awu9jP6T.css","assets/BookmarkItem-BSBXTbem.js","assets/BookmarkItem-XhoOFjR-.css","assets/VContainer-Dh2-a32C.js","assets/RealEstateListItemMain-t6m5lorr.css","assets/AddSearchOrderMain-GRYb6Rvz.js","assets/AddSearchOrderDetails.vue_vue_type_style_index_0_lang-BKsVC4KF.js","assets/vee-validate.esm-AVLHj3OD.js","assets/VSwitch-mdus1ial.js","assets/VSwitch-CgSUOCXK.css","assets/VForm-Cfq88vy1.js","assets/VSelect-B9wO2vEw.js","assets/VTextField-BVu1t86b.js","assets/VTextField-DYXPqM99.css","assets/VMenu-CtaEYHGo.js","assets/VMenu-CgD6wuJt.css","assets/VSelect-BDC0WV_n.css","assets/AddSearchOrderDetails-CqpxK4Zb.css","assets/VBottomSheet-kHl2deMm.js","assets/VBottomSheet-CEnZc7NB.css","assets/AddSearchOrderMain-zmMYlo2Z.css","assets/VPagination-DXbkj_Fc.js","assets/VPagination-osFSi_du.css","assets/RealEstateListMain-BKzygL5P.css","assets/MapMain-Ma_vZ003.js","assets/index-Dbp1qNyY.js","assets/home-Bxa_-3is.js","assets/index-_vbXjPry.js","assets/MapMain-bhNZEyap.css","assets/StepperView-731ZiGZj.js","assets/vue.f36acd1f-DPCG9g2X.js","assets/StepperBasicsPage-uMF5UepZ.js","assets/VRangeSlider-DKB64m55.js","assets/VSliderTrack-D-hDXkWe.js","assets/VSliderTrack-DYiZbM5l.css","assets/StepperBasicsPage-CFWj2M-3.css","assets/StepperView-DY4qVQN0.css"]
  }
  return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
}