import{E as u,aE as G,A as de,B as ve,C as pe,D as fe,ae as ge,W as he,a9 as me,bo as ye,r as _e,aa as Ee,d2 as we,G as o,X as $,L as h,H as p,P as i,K as I,a0 as f,O as g,J as P,y as _,I as m,N as R,d3 as Re,M,cu as Se,aU as O,a1 as be,Z as W,aM as ke,ap as z,ar as Ie,d4 as N,d5 as D,ag as E,ah as w}from"./index-lCRwTiBk.js";import{V as Oe}from"./VSnackbar-cGWp3cpK.js";const S=u({});function De(n){return n===4?"veryVeryFair":n===3?"veryFair":n===2?"fair":n===1?"unfair":n===0?"veryUnfair":"noScore"}function Ce(n){return n===4?["#0e8a4a","#0e8a4a","#0e8a4a","#0e8a4a","#0e8a4a"]:n===3?["#73c82c","#73c82c","#73c82c","#73c82c","lightgray"]:n===2?["#73c82c","#73c82c","#73c82c","lightgray","lightgray"]:n===1?["#fbc707","#fbc707","lightgray","lightgray","lightgray"]:n===0?["#ef3120","lightgray","lightgray","lightgray","lightgray"]:["lightgray","lightgray","lightgray","lightgray","lightgray"]}function Ve(n){const C={...n,geom:n.geometry};return G.post("https://real-estate-price-prediction.prod.api.areaone.io/predict",C).then(s=>(S.value=s.data,S.value.barColor=Ce(s.data.price_estimation.display_bar),S.value.barText=De(s.data.price_estimation.display_bar),S.value)).catch(s=>(console.log(s),S.value))}const $e={class:"modal-container"},Pe={class:"fixed-tabs-bar"},Te={class:"d-flex justify-space-between mb-1 pa-2"},xe={class:"mx-1"},Le={class:"text-h5"},je={class:"mx-1"},Fe={key:0,class:"d-flex justify-end align-center pa-1 reswitcher mt-n4"},Ae={class:"mx-2"},qe={class:"mt-16 pt-16"},We=de({__name:"DetailPageMain",emits:["close"],setup(n,{emit:C}){const s=ve();pe();const c=fe(),V=ge(),H=he(),J=E(()=>w(()=>import("./RealEstateListItemMain-BD54GNih.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8]))),K=E(()=>w(()=>import("./RealEstateItemOverview-DGYY8VbZ.js"),__vite__mapDeps([9,1,2,3,4,7,10]))),X=E(()=>w(()=>import("./RealEstatePriceAnalysis-BWrpi0_m.js"),__vite__mapDeps([11,1,2,12]))),Z=E(()=>w(()=>import("./DetailViewSurroundingMain-C5qOh_wM.js"),__vite__mapDeps([13,1,2,14,15,16,7,17,18,19,20]))),Q=E(()=>w(()=>import("./FinancingMain-yT0j3149.js"),__vite__mapDeps([21,1,2,3,4,22,23,24,25,26,27,28,29]))),Y=E(()=>w(()=>import("./DetailPageBottomBar-DNoaFqNZ.js"),__vite__mapDeps([30,1,2,27,28]))),ee=u(null),te=C,ae=u(0),a=u(null),y=u(!1),T=u(!0),x=u(!0),L=u(null),j=u(null),d=u(0),le=me(),{consultant:se}=ye(le),b=u({price_estimation:{predicted_price_per_square:0,display_bar:-1}}),v=u({show:!1,text:"",color:"",timeout:3e3});u(!1);const F=_e(()=>navigator.share);Ee(()=>{var t;(t=s.name)!=null&&t.toString().startsWith("Details")||(d.value=c.currentOpenedRealEstate.currentIdx),window.onpopstate=()=>{s.query.id||(x.value=!1,te("close",a.value.id))},U(),setTimeout(()=>{var e;T.value=!1,!((e=s.name)!=null&&e.toString().startsWith("Details"))&&c.currentOpenedRealEstate.goToSec&&(c.currentOpenedRealEstate.goToSec,void 0)},400)}),we(()=>{if(x.value){const t={};Object.keys(s.query).forEach(e=>{e!=="id"&&e!=="map"&&(t[e]=s.query[e])}),B(t)}});function Ue(t){}function ie(t){L.value=t}function ne(t){j.value=t}function A(){c.currentOpenedRealEstate.value={realEstateId:c.currentOpenedRealEstate.realEstateId,currentIdx:d.value,goToSec:null,isOpened:!0,travelRoutes:[]}}function q(t){t===1?(d.value=(d.value+t)%c.currentOpenedRealEstate.realEstateId.length,A()):(d.value=d.value+t<0?c.currentOpenedRealEstate.realEstateId.length-1:d.value+t,A()),U()}function U(){var t;if(!((t=s.name)!=null&&t.toString().startsWith("Details"))&&!s.fullPath.includes(c.currentOpenedRealEstate.realEstateId[d.value])){let e=Object.assign({},s.query);e.id=c.currentOpenedRealEstate.realEstateId[d.value],B(e)}re()}function B(t){history.pushState({},"",s.path+"?"+Object.keys(t).map(e=>encodeURIComponent(e)+"="+encodeURIComponent(t[e])).join("&"))}async function re(){var e;y.value=!0;let t=s.query;if((e=s.name)!=null&&e.toString().startsWith("Details")?t.id=s.params.id:t.id=c.currentOpenedRealEstate.realEstateId[d.value],V.currentSearchType==="searchByIsochrone"){let r="";V.isochroneLocations.forEach((l,ce)=>{ce>=1&&(r=r+","),r=r+(l.id?l.id:"")}),t.ps=r,t.ig_cst="true"}G.get("https://real-estate-service-api-ninja.prod.api.areaone.io/real-estate-details",{params:t}).then(async r=>{a.value=r.data,a.value.id=t.id,V.setCurrentRealEstateDetail(a.value),y.value=!1,b.value=await Ve(a.value)}).catch(r=>{console.log(r),y.value=!1})}function k(t){if(T.value)return;let e=t[0];if(e!=null&&e.isIntersecting){let r=e.target.id,l=Number(r.split("_")[1]);ae.value=l}}function oe(t){navigator.share({title:a.value.title,url:"https://www.areaone.io/details/"+t})}async function ue(t){try{await navigator.clipboard.writeText("https://www.areaone.io/details/"+t),v.value.text=z.global.t("pages.DetailPage.successfullyCopied"),v.value.color="success",v.value.show=!0}catch{v.value.text=z.global.t("pages.DetailPage.errorCopy"),v.value.color="error",v.value.show=!0}}return(t,e)=>{var r;return o(),$("div",$e,[h("div",Pe,[h("div",Te,[h("div",xe,[t.$route.name!=="Details"?(o(),p(I,{key:0,onClick:e[0]||(e[0]=l=>t.$emit("close",a.value.id)),icon:i(Ie),size:"x-small",elevation:"1"},null,8,["icon"])):f("",!0)]),h("div",Le,g(t.$t("pages.DetailPage.details")),1),h("div",je,[F.value?(o(),p(I,{key:0,onClick:e[1]||(e[1]=l=>oe(a.value.id)),icon:i(N),size:"x-small",elevation:"1"},null,8,["icon"])):f("",!0),F.value?f("",!0):(o(),p(I,{key:1,onClick:e[2]||(e[2]=l=>ue(a.value.id)),icon:i(N),size:"x-small",elevation:"1"},null,8,["icon"]))])])]),a.value?(o(),$("div",{key:0,class:P(["content-area pt-6",{"content-area_height":!t.$vuetify.display.mobile,"content-area_fullheight":t.$vuetify.display.mobile}])},[!((r=i(s).name)!=null&&r.toString().startsWith("Details"))&&i(c).currentOpenedRealEstate.realEstateId.length>1?(o(),$("div",Fe,[_(M,{onClick:e[3]||(e[3]=l=>q(-1))},{default:m(()=>[R(g(i(Re)),1)]),_:1}),h("span",Ae,g(d.value+1)+" von "+g(i(c).currentOpenedRealEstate.realEstateId.length)+" Inseraten ",1),_(M,{onClick:e[4]||(e[4]=l=>q(1))},{default:m(()=>[R(g(i(Se)),1)]),_:1})])):f("",!0),O((o(),p(i(J),{key:"relimm-"+a.value.id,"est-rate":L.value,"fin-state":j.value,"real-estate":a.value,"in-detail":!0,id:"hero_section",ref_key:"hero_section",ref:ee,onClose:e[5]||(e[5]=l=>t.$emit("close")),onGoToSec:e[6]||(e[6]=l=>void 0),onGoToFinancing:e[7]||(e[7]=l=>void 0),"prediction-object":b.value},null,8,["est-rate","fin-state","real-estate","prediction-object"])),[[D,{handler:k,options:{threshold:.5}}]]),a.value.offer_type==="rent"?(o(),p(I,{key:1,block:"",variant:"outlined",large:"",class:"text-none mt-1",href:"https://www.awin1.com/awclick.php?gid=325374&mid=9350&awinaffid=1056821&linkid=3578145&clickref=",id:"detail_view_schufa_click",onClick:e[8]||(e[8]=l=>t.$gtm.trackEvent({label:"detail_view_schufa_click",event:"detail_view_schufa_click",category:"affliate",action:"click",value:1})),rel:"nofollow",target:"_blank"},{default:m(()=>[R(g(t.$t("pages.DetailPage.buttons.schufaLink"))+" ",1),_(be,{class:"ml-2",src:i(H).baseUrl+"/static/companySite/schufaLogo.png",contain:"",height:"22px",width:"75px"},null,8,["src"])]),_:1})):f("",!0),O((o(),p(i(K),{key:"reio-"+a.value.id,"real-estate":a.value,id:"sec_0",ref:"sec_0"},null,8,["real-estate"])),[[D,{handler:k,options:{threshold:[.5]}}]]),O(_(i(Z),{"real-estate":a.value,id:"sec_1",ref:"sec_1",onClose:e[9]||(e[9]=l=>t.$emit("close",a.value.id))},null,8,["real-estate"]),[[D,{handler:k,options:{threshold:[.5]}}]]),a.value.offer_type==="buy"?O((o(),p(i(Q),{key:"finmain-"+a.value.id,realEstate:a.value,class:"pt-0",id:"sec_2",ref:"sec_2",onFinancing:e[10]||(e[10]=l=>ie(l)),onFinancingState:e[11]||(e[11]=l=>ne(l))},null,8,["realEstate"])),[[D,{handler:k,options:{threshold:.5}}]]):f("",!0),b.value.price_estimation.display_bar!==-1?(o(),p(i(X),{key:3,"real-estate":a.value,"prediction-object":b.value},null,8,["real-estate","prediction-object"])):f("",!0)],2)):f("",!0),!a.value&&!y.value?(o(),p(W,{key:1,"no-gutters":"",class:P(["pa-8",[t.$vuetify.display.mobile?"full-height":"desktop-height"]])},{default:m(()=>[R(g(t.$t("pages.DetailPage.noRealEstateFound")),1)]),_:1},8,["class"])):f("",!0),_(Oe,{modelValue:v.value.show,"onUpdate:modelValue":e[12]||(e[12]=l=>v.value.show=l),color:v.value.color,timeout:v.value.timeout},{default:m(()=>[R(g(v.value.text),1)]),_:1},8,["modelValue","color","timeout"]),y.value?(o(),p(W,{key:2,"no-gutters":"",class:P(["pa-6",[t.$vuetify.display.mobile?"full-height":"desktop-height"]])},{default:m(()=>[y.value?(o(),p(ke,{key:0,size:70,width:7,class:"ma-2 pa-0",color:"primary",indeterminate:"",style:{position:"absolute","z-index":"30",width:"80%",left:"50%",top:"20vh",transform:"translate(-50%, 0)"}},{default:m(()=>[h("div",qe,g(t.$t("pages.DetailPage.loadingRealEstate")),1)]),_:1})):f("",!0)]),_:1},8,["class"])):f("",!0),_(i(Y),{realEstate:a.value,consultant:i(se)},null,8,["realEstate","consultant"])])}}});export{We as _}; function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { __vite__mapDeps.viteFileDeps = ["assets/RealEstateListItemMain-BD54GNih.js","assets/index-lCRwTiBk.js","assets/index-CrRwc5TH.css","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/RealEstateItemOverview-DGYY8VbZ.js","assets/RealEstateItemOverview-D6q1wBYx.css","assets/RealEstatePriceAnalysis-BWrpi0_m.js","assets/RealEstatePriceAnalysis-B4NPCANA.css","assets/DetailViewSurroundingMain-C5qOh_wM.js","assets/index-Dbp1qNyY.js","assets/index-MFKEI4vu.js","assets/home-Bxa_-3is.js","assets/VSlider-Bqotb8PG.js","assets/VSliderTrack-D-hDXkWe.js","assets/VSliderTrack-DYiZbM5l.css","assets/DetailViewSurroundingMain-BCnfRTmG.css","assets/FinancingMain-yT0j3149.js","assets/VTextField-BVu1t86b.js","assets/VTextField-DYXPqM99.css","assets/VSkeletonLoader-CVzYsREO.js","assets/VSkeletonLoader-E5btiykZ.css","assets/VHover-BGGXdGRI.js","assets/VSnackbar-cGWp3cpK.js","assets/VSnackbar-CSt1vrFS.css","assets/FinancingMain-Bnw2PHsI.css","assets/DetailPageBottomBar-DNoaFqNZ.js"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) }