1import{u as q,d as he,h as z,g as we,o as Le,i as oe,_ as K}from"./_plugin-vue_export-helper.BhWc8lVu.js";import{c as Ge}from"./module.CKjUdtPN.js";import{r as y,c as J,a as Q,b as Pe,o as d,d as R,w as se,e as a,t as C,u as c,f as W,g as h,h as G,F as $,n as ge,i as Oe,j as P,k as Ve,l as Ne,m as X,p as pe,q as E,v as Se,s as ke,x as F,y as I,z as H,A as $e,B as Ce,C as be,T as me,D as re,E as Me,G as Te}from"./vendor.CgoHGfit.js";import{i as je}from"./index.ZI_r5tO8.js";import{s as ze}from"./loading.BNZ64zwI.js";import{m as Be,l as Je,_ as xe}from"./index.CPOJcdm0.js";import{g as Fe,f as qe}from"./house-format.DCIrdqJT.js";import{S as Ke,g as Ze,a as We,c as Ye,v as Qe,b as Xe}from"./mls-compliance.Bp6B-fCl.js";import{s as De,c as et}from"./index.BaAP9oVx.js";import{c as He,_ as tt,a as ot}from"./mobileFilter.Dp0ekbX4.js";import{_ as Ie}from"./index.96nRHlsU.js";import{P as st}from"./index.CXRsa9J7.js";import{_ as it}from"./index.DVRGWMeE.js";import{p as at}from"./standard.uu1fC-2F.js";import{M as fe}from"./marker.C9cyOpPH.js";import{d as Ue}from"./outsideclick.Bw_hMuzW.js";import{s as nt}from"./service.DvlC_QWo.js";import{u as _e}from"./user.Cd0ueROn.js";import{l as lt}from"./popup-trigger.BYK1jNZy.js";import{a as rt}from"./auto-login.L2yhzn_0.js";import{a as ut,s as ct}from"./popup-mls.CAze3Iy2.js";import"./date-format.BrUodQAJ.js";import"./index.Bc6WXVcf.js";import"./index.qJYthV_D.js";import"./number-format.CLdvQh6j.js";import"./google.BsSX3_PC.js";import"./reg-verify.BTwZqmDb.js";import"./popMgr.GM9319se.js";import"./index.Bzh8PCLp.js";import"./useConfirm.BiCpvJLr.js";const Re=q.getTimeZone(),ie={};function dt(t){const e={cancelList:null,cancelMap:null,module:t,hasMap:y(!0),showMap:y(!q.isMobile),featureListingName:y(""),listingType:J(()=>e.featureListingName.value&&!e.sold.value?"featured-listing":e.sold.value?"sold-listing":""),counts:y(0),totalPage:y(0),searchType:y("All"),listings:y([]),mlsList:Q([]),listingSort:y("RELEVANCE"),currPage:y(1),pageSize:y(12),address:y(""),condition:Q({}),uiConfig:Q({}),sold:y(!1),map:y(null),zoom:y(14),mapSyncList:y(!1),rect:null,mapSyncType:y(""),mapPath:y(""),needMapPath:J(()=>["mapArea","polygon"].includes(e.mapSyncType.value)),mapRadius:y([]),polygonPath:y([]),markerData:Q({aggregation:[],house:[],school:[],activeHouse:null,activeHouseKey:1}),showSchool:y(!1),schoolData:{},drawing:y(!1),geometry:y([]),shortCodeConfig:y({}),isShortCode:J(()=>!!e.shortCodeConfig.value.layout)},n={searchList:he(async function(){try{e.cancelList&&e.cancelList.cancel("search-list canceled due to new request."),e.cancelList=Pe.CancelToken.source();const o={condition:JSON.stringify(l.formatCondition()),pageSize:e.pageSize.value,page:e.currPage.value,currPage:e.currPage.value,listingSort:e.listingSort.value,listingType:e.listingType.value,featureListingName:e.featureListingName.value,timeline:!0,mls_list_id:JSON.stringify(e.mlsList),uiConfig:JSON.stringify(e.uiConfig),timezone:Re};if(e.mapSyncList.value){let k=l.formatCondition();if(e.mapSyncType.value==="radius")k.location={mapRadius:e.mapRadius.value};else if(e.needMapPath.value&&(k.location={mapPath:e.mapPath.value},!e.mapPath.value))return;o.condition=JSON.stringify(k)}const s={action:"lofty_idx_api",data:o,cancelToken:e.cancelList.token},i=e.module.$(".lofty-listing"),u=ze(i);i.classList.add("lofty-empty-listing"),l.asyncListConditionToUrl(o);const m=await z.get("/search/realTimeListings",s);u(),i.innerHTML=m.data.html,e.totalPage.value=m.data.totalPage,e.counts.value=m.data.counts,e.listings.value=m.data.listings,e.searchType.value=m.data.searchType;const g=i.querySelectorAll(".lofty-house-tag"),S=[];for(const k of m.data.listings)Ke.includes(k.mlsOrgId)&&S.push(k.id);if(S!=null&&S.length){const k=await Ze(S,e.listingType.value==="sold-listing");k&&Object.keys(k).length&&e.listings.value.forEach((j,U)=>{const Y=k[j.id]||!1;e.listings.value[U]={...j,mlsOrg:{...j.mlsOrg,cardTemplate:We(j,Y,"cardTemplate")}},g[U]&&(g[U].innerHTML=e.listings.value[U].mlsOrg.cardTemplate)})}g.forEach(k=>{k.style.display="block"}),i.classList.remove("lofty-empty-listing"),n.addCardEvents()}catch{}},300),searchMap:he(async function(){if(!(!e.showMap.value||!e.map.value||!Number.isInteger(e.zoom.value)))try{e.cancelMap&&e.cancelMap.cancel("search-map canceled due to new request."),e.cancelMap=Pe.CancelToken.source(),e.mapSyncList.value&&e.needMapPath.value&&(
1await n.getMapPath(),e.currPage.value=1,n.searchList());const o={mobile:q.isMobile,mapSearch:!0,layoutType:"map",listingSort:e.listingSort.value,listingType:e.listingType.value,featureListingName:e.featureListingName.value,zoom:e.zoom.value,rect:l.getRect(),condition:JSON.stringify(l.formatCondition()),timezone:Re};l.formatLocation(o);const s={action:"lofty_idx_api",data:o,cancelToken:e.cancelMap.token};n.searchSchool(e.schoolData),l.asyncMapConditionToUrl();const i=await z.get("/search/realTimeListings",s);e.markerData.aggregation=l.dealAggregationData(i.data.aggregation||[]),e.markerData.house=l.dealHouseData(i.data.house||[]),e.markerData.activeHouse=null,e.markerData.activeHouseKey=Date.now()}catch{}},300),searchSchool:he(async function(o){if(e.showSchool.value){e.schoolData=o;const s={...o,condition:JSON.stringify(l.formatCondition()),zoom:e.zoom.value,rect:l.getRect(),mapSearch:!1,t:Date.now()};if(e.mapSyncList.value){let u=l.formatCondition();u.location={},s.condition=JSON.stringify(u),l.formatLocation(s)}e.markerData.school=[];const i=await z.get("/search/schools",{data:s});i&&i.data&&(e.markerData.school=i.data.map(u=>(u.key=`school-${u.latitude}${u.longitude}${Date.now()}`,u.lat=+u.latitude,u.lng=+u.longitude,u)))}},300),async getMapPath(){const o={data:{mapPointList:Be.getFormatBounds(e.map.value)}};e.mapSyncType.value==="polygon"&&(o.data.mapPointList=e.polygonPath.value);const s=await z.post("/search/mapPath",o);e.mapPath.value=s.data.regionId},async restorePolygonFromMapPath(){var o;if(e.mapSyncType.value==="polygon"){if(e.mapPath.value&&!e.polygonPath.value.length){const s=e.mapPath.value;try{const u=(o=(await z.get("/search/mapPath",{data:{regionId:s}})).data)==null?void 0:o.pointList;u!=null&&u.length&&(e.polygonPath.value=u)}catch(i){console.warn("[polygon restore from hash] failed:",s,i)}}else if(!e.mapPath.value&&e.polygonPath.value.length)try{await n.getMapPath(),n.searchList()}catch(s){console.warn("[polygon restore from points] failed:",s)}}},removeMapTag(){e.mapSyncList.value=!1,e.mapSyncType.value="",e.mapPath.value=null,e.polygonPath.value=[],e.mapRadius.value=[]},addCardEvents(){const o=t.$all(".lofty-listing .lofty-house-item");Array.from(o).forEach(s=>{const i=s.querySelector(".collect-heart");i&&(i.onclick=()=>{const m=s.getAttribute("house-id"),g=i.classList.contains("lofty-icon-heart-fill");Ye(m,g,()=>{g?(i.classList.remove("lofty-icon-heart-fill"),i.classList.add("lofty-icon-heart")):(i.classList.remove("lofty-icon-heart"),i.classList.add("lofty-icon-heart-fill"))})});const u=s.querySelector(".lofty-house-login-box");u&&(u.querySelector(".lofty-register")&&(u.querySelector(".lofty-register").onclick=()=>{De(()=>{window.location.reload()},"","register")}),u.querySelector(".lofty-login")&&(u.querySelector(".lofty-login").onclick=()=>{De(()=>{window.location.reload()},"","login")}),u.querySelector(".lofty-verify")&&(u.querySelector(".lofty-verify").onclick=()=>{Qe()}))})}},l={formatCondition(){let o={};for(let s in e.condition){let i=e.condition[s];e.uiConfig[s]&&e.uiConfig[s].sqft==="acre"&&(i=i.split(",").map(u=>+u?+u*43560:"").toString()),je(i)&&(o[s]=i)}if(e.address.value="",o.location&&e.mapSyncList.value===!1){const s=Object.values(o.location).reduce((i,u)=>i.concat(u),[]);s.length===1&&(e.address.value=s[0].split(",")[0])}return o},formatLocation(o){if(e.mapSyncType.value==="polygon"){let s=l.formatCondition();s.location={mapPath:e.mapPath.value},o.condition=JSON.stringify(s)}else if(e.mapSyncType.value==="radius"){let s=l.formatCondition();s.location={mapRadius:e.mapRadius.value},o.condition=JSON.stringify(s)}},asyncListConditionToUrl(o){if(e.isShortCode.value)return;let s=window.location.pathname,i=we();Object.entries(o).forEach(([u,m])=>{let g=m;typeof m=="object"&&(g=JSON.stringify(m)),(u==="uiConfig"||u==="condition")&&(g=encodeURIComponent(g)),g&&["currPage","pageSize","listingSort","listingType","uiConfig","condition","featureListingName"].includes(u)&&(i[u]=g),i.address=encodeURIComponent(e.address.value),document.querySelector(".lofty-is-shortcode")||(i.pageKey=e.sold.value?"sold_listing":"search")}),i.hideMap=e.showMap.value?0:1,s=s+"?"+Le(i),window.history.pushState(null,"",s)},asyncMapConditionToUrl(){if(e.isShortCode.value)return;let o=window.location.pathname,s=we();delete s.rect,delete s.polygonPath,delete s.mapRadius,s.zoom=e.zoom.value,s.condition&&(s.condition=encodeURIComponent(s.condition)),s.uiConfig&&(s.uiConfig=encodeURIComponent(s.uiConfig)),e.mapSyncList.value&&(e.mapSyncType.value==="mapArea"?s.rect=encodeURIComponent(l.getRect()):e.mapSyncType.value==="polygon"?e.mapPath.value||(s.polygonPath=encodeURIComponent(JSON.stringify(e.polygonPath.value))):e.mapSyncType.value==="radius"&&(s.mapRa
1dius=encodeURIComponent(JSON.stringify(e.mapRadius.value)))),o=o+"?"+Le(s),window.history.pushState(null,"",o)},initConditionFromUrl(){var s,i;const o=we();if(o.currPage||o.condition){let u=o.condition?JSON.parse(decodeURIComponent(o.condition)):{},m=o.uiConfig?JSON.parse(decodeURIComponent(o.uiConfig)):{};if((s=u.location)!=null&&s.mapPath){const g=u.location.mapPath;typeof g=="string"?(e.mapPath.value=g,e.mapSyncType.value="polygon",e.mapSyncList.value=!0):Array.isArray(g)&&g.length>0&&(e.polygonPath.value=g.map(S=>typeof S=="string"?JSON.parse(S):S),e.mapSyncType.value="polygon",e.mapSyncList.value=!0),delete u.location.mapPath}(i=u.location)!=null&&i.mapRadius&&(o.mapRadius||(o.mapRadius=JSON.stringify(u.location.mapRadius)),delete u.location.mapRadius),o.rect?(e.rect=decodeURIComponent(o.rect),e.mapSyncType.value="mapArea",e.mapSyncList.value=!0):o.polygonPath?(e.polygonPath.value=JSON.parse(decodeURIComponent(o.polygonPath)),e.mapSyncType.value="polygon",e.mapSyncList.value=!0):o.mapRadius&&(e.mapSyncType.value="radius",e.mapRadius.value=JSON.parse(decodeURIComponent(o.mapRadius)),e.mapSyncList.value=!0),Object.keys(u).forEach(g=>{e.condition[g]=u[g]}),Object.keys(m).forEach(g=>{e.uiConfig[g]=m[g]}),e.address.value=decodeURIComponent(o.address||""),e.listingSort.value=o.listingSort||"RELEVANCE",e.currPage.value=+o.currPage||1,e.pageSize.value=+o.pageSize||12,e.zoom.value=+o.zoom||14,e.showMap.value=o.hideMap!=="1"}},dealAggregationData(o){return o.forEach(s=>{s.key=`key-${s.latitude}${s.longitude}${Date.now()}`,s.lat=+s.latitude,s.lng=+s.longitude,Array.isArray(s.bounds)&&(s.bounds=s.bounds.map(i=>({lat:i.latitude,lng:i.longitude})))}),o},dealHouseData(o){o=o.filter(u=>!Fe(u));function s(u){return u.reduce((m,g)=>{if(m===null)return g;let S=m.soldPrice||m.price;return(g.soldPrice||g.price)<S?g:m},null)}const i=Je.generateDataByLatlng(o);return i.forEach(u=>{const m=s(u.items);u.key=`key-${u.lat}${u.lng}${Date.now()}`,u.price=m.soldPrice||m.price,u.nodisclosureDes=m.nodisclosureDes,u.items.forEach(g=>qe(g))}),i},getRect(){const o=e.map.value.getViewModel().getLookAtData().bounds.getBoundingBox();if(o)return`${o.getTop()},${o.getLeft()},${o.getBottom()},${o.getRight()}`},toggleMap(){e.showMap.value=!e.showMap.value,e.currPage.value=1,e.pageSize.value=e.showMap.value?12:24,l.toggleClass(),n.searchList()},toggleClass(){e.hasMap.value&&(e.showMap.value?(t.$(".lofty-result-listing").classList.add("has-map"),t.$("#lofty-map-container").classList.remove("lofty-hidden")):(t.$(".lofty-result-listing").classList.remove("has-map"),t.$("#lofty-map-container").classList.add("lofty-hidden")))}},r=t.getModuleData();return e.counts.value=r.counts||0,e.mlsList=Q(r.mls_list),e.searchType.value=r.searchType,e.totalPage.value=r.totalPage||0,e.sold.value=r.sold,e.hasMap.value=r.hasMap,e.shortCodeConfig.value=r.shortcode_config||{},e.featureListingName.value=r.featureListingName||"",r.listingSort&&(e.listingSort.value=r.listingSort),e.shortCodeConfig.value.layout||(l.initConditionFromUrl(),n.restorePolygonFromMapPath()),n.searchList(),{...e,...n,formatCondition:l.formatCondition,formatLocation:l.formatLocation,getRect:l.getRect,toggleMap:l.toggleMap,toggleClass:l.toggleClass,dealHouseData:l.dealHouseData}}function ht(t){ie[t.id]=dt(t)}const pt={class:"lofty-show-more-name"},gt={key:0},mt={class:"lofty-more-panel"},ft={class:"lofty-more-filter-title"},yt={class:"lofty-more-filter-count"},vt={class:"lofty-group-name"},wt={class:"lofty-group-wrapper"},St={class:"lofty-condition-label"},Ct={__name:"moreFilter",props:{moreConfigs:{type:Array,required:!0},condition:Object,uiConfig:Object},setup(t){const e=t,n=J(()=>{const o=new Set;return e.moreConfigs.forEach(s=>{s.conditions.forEach(i=>{o.add(i.name)})}),o}),l=J(()=>{let o=0;for(let s in e.condition){const i=e.condition[s];if(je(i)&&n.value.has(s)&&(o++,typeof i=="string")){const u=i.split(",");u.length===2&&u.every(m=>!!m)&&o++}}return o});function r(){for(const o of n.value){const s=e.condition[o];Array.isArray(s)?e.condition[o]=[]:typeof s=="object"?e.condition[o]={}:typeof s=="boolean"?e.condition[o]=!1:typeof s=="string"&&(e.condition[o]="")}}return(o,s)=>(d(),R(Ie,{class:"lofty-more-box",right:0,menuStyle:{paddingRight:0},clickMenuClose:!1,"fit-width":!1},{menu:se(()=>[a("div",mt,[a("div",ft,[a("div",yt,C(c(l))+" Filters Applied",1),a("div",{class:"lofty-clear-filter",onClick:r},s[1]||(s[1]=[a("i",{class:"lofty_iconfont lofty-icon-reset"},null,-1),W(" Clear")]))]),(d(!0),h($,null,G(t.moreConfigs,i=>(d(),h("div",{class:"lofty-condition-group",key:i.name},[a("p",vt,C(i.nameText),1),a("div",wt,[(d(!0),h($,null,G(i.conditions,u=>(d(),h("div",{key:u.name,class:"lofty-condition-label-input",style:ge({width:u.inputType==="keyWord"?"100%":""})},[a("p",St,[a("span",null,C(u.label),1)]),(d(),R(Oe(c(He)[u.inputType]),{modelValue:t.condition[u.name],"onUpdate:modelValue":m=>t.condition[u.name]=m,key:u.name,uiConfig:t.uiConfig,config:u},null,8,["modelValue","onUpdate:modelValue","uiConfig","config"]))],4))),128))])]))),128))])]),default:se(()=>[a("span",pt,[s[0]||(s[0]=W("More ")),c(l)?(d(),h("span",gt,"("+C(c(l))+")",1)):P("",!0)])]),_:1}))}},bt={class:"lofty-listing-search"},Lt={key:1,class:"lofty-multi-filter"},Pt=["disabled"],kt={class:"save-search-pop-container"},Mt={class:"save-search-pop-content"},Tt={__name:"searchBar",props:{id:String},setup(t){const e=t,{counts:n,currPage:l,pageSize:r,searchList:o,condition:s,formatCondition:i,formatLocation:u,polygonPath:m,getRect:g,listingSort:S,uiConfig:k,sold:j,zoom:U,address:Y,mapSyncList:ae,mapSyncType:A,removeMapTag:ee,isShortCode:Z}=ie[e.id],[T,M,O,ne]=[y([]),y([]),y([]),y([])],ue=J(()=>{if(ae.value){if(A.value==="mapArea")return["Map Area"];if(A.value==="polygon")return["Polygon Search"];if(A.value==="radius")return["Radius Search"]}return[]}),ce=y({});async function ye(){const B={data:{isSold:j.value},headers:{}};Z.value||(B.headers.trackingpagekey=j.value?"sold_listing":"search");const w=await z.get("/search/center/conditions",B);
1w.data.configs.forEach(L=>{let D=null;L.conditions.forEach((N,ve)=>{N.name==="location"&&(D=ve,ce.value=N),N.inputType==="suggestion"&&!s[N.name]&&(s[N.name]={}),["multiSelect","singleSelect","keyWord"].includes(N.inputType)&&!s[N.name]&&(s[N.name]=[])}),D!==null&&L.conditions.splice(D,1)}),T.value=w.data.configs.filter(L=>L.conditions.length>0),ne.value=JSON.parse(JSON.stringify(T.value));let _=0;T.value.forEach(L=>{L.conditions.forEach(D=>{_<4&&["singleSelect","multiSelect","inputBox","checkBox"].includes(D.inputType)&&(M.value.push(D),_++)}),L.conditions=L.conditions.filter(D=>!M.value.some(N=>N.name===D.name)),L.conditions.length>0&&O.value.push(L)}),pe(s,()=>{l.value=1,o()})}const te=Ve("popRef");function de(){et(()=>{te.value.open()})}Ne(()=>{ye()});const v=J(()=>Object.values(i()).length===0&&!A.value),p=y(""),f=y(7),b=[{label:"Instantly",value:0},{label:"Daily",value:1},{label:"Weekly",value:7},{label:"Biweekly",value:14},{label:"Monthly",value:28}];async function V(){let B=p.value.trim();if(B){const w={condition:i(),uiConfig:k,address:Y.value,listingSort:S.value,currPage:l.value,pageSize:r.value,zoom:U.value,timezone:q.getTimeZone()};if(A.value==="polygon"&&(w.polygonPath=m.value),A.value==="mapArea"){const L=g(),D=L.split(",");w.rect=L;let N=[{lat:D[0],lng:D[1]},{lat:D[0],lng:D[3]},{lat:D[2],lng:D[3]},{lat:D[2],lng:D[1]}];N=N.map(ve=>JSON.stringify(ve)),w.condition.location={mapPath:N}}u(w);const _={saveName:B,searchCondition:JSON.stringify(w),mailFrequency:f.value};try{const L=await z.post("/wp-plugin/save-search/saveSearch",{data:_});L.status.code===0&&(p.value="",q.toast(L.data),te.value.close())}catch(L){console.error("save-search/saveSearch",L)}}}function x(){te.value.close()}return(B,w)=>(d(),h("div",bt,[X(tt,{class:"location-suggestion",modelValue:c(s).location,"onUpdate:modelValue":w[0]||(w[0]=_=>c(s).location=_),config:c(ce),"custom-tag":c(ue),onRemoveCustomTag:c(ee)},null,8,["modelValue","config","custom-tag","onRemoveCustomTag"]),c(oe)?(d(),R(ot,{key:0,condition:c(s),mobileConfigs:c(ne),uiConfig:c(k),counts:c(n),onSaveSearch:de},null,8,["condition","mobileConfigs","uiConfig","counts"])):(d(),h("div",Lt,[(d(!0),h($,null,G(c(M),_=>(d(),R(Oe(c(He)[_.inputType]),{modelValue:c(s)[_.name],"onUpdate:modelValue":L=>c(s)[_.name]=L,class:"lofty-filter-block","show-default-label":!0,"fit-width":!1,uiConfig:c(k),config:_,outSide:""},null,8,["modelValue","onUpdate:modelValue","uiConfig","config"]))),256)),c(O).length>0?(d(),R(Ct,{key:0,class:"lofty-filter-block",moreConfigs:c(O),uiConfig:c(k),condition:c(s)},null,8,["moreConfigs","uiConfig","condition"])):P("",!0),c(j)?P("",!0):(d(),h("button",{key:1,class:"save-search lofty-btn",disabled:c(v),onClick:de},w[3]||(w[3]=[a("span",null,"Save Search",-1)]),8,Pt))])),X(st,{ref_key:"popRef",ref:te,class:"save-search-pop"},{default:se(()=>[a("div",kt,[w[6]||(w[6]=a("div",{class:"title"},"SAVE THIS SEARCH",-1)),a("div",Mt,[w[4]||(w[4]=a("div",{class:"label"},"Name This Search",-1)),E(a("input",{"onUpdate:modelValue":w[1]||(w[1]=_=>ke(p)?p.value=_:null),placeholder:"Type Something"},null,512),[[Se,c(p)]]),w[5]||(w[5]=a("div",{class:"label mt20"},"Property Alert",-1)),X(it,{class:"mt20",modelValue:c(f),"onUpdate:modelValue":w[2]||(w[2]=_=>ke(f)?f.value=_:null),list:b},null,8,["modelValue"])]),a("div",{class:"save-search-footer"},[a("div",{class:"footer-cancel",onClick:x},"Cancel"),a("div",{class:"footer-save lofty-btn",onClick:V},"Save")])])]),_:1},512)]))}},Dt={class:"lofty-listing-top"},_t={key:0,class:"lofty-page-title"},Rt={key:1,class:"lofty-page-title"},Et={key:0},At={key:0,class:"lofty-current-filter"},Ot={key:1,class:"lofty-map-filter"},Nt={style:{margin:"0 10px"}},$t={class:"lofty-sort-list"},jt=["onClick"],Bt={class:"lofty_iconfont lofty-icon-checked"},Ht={class:"lofty-filter-name"},It={__name:"listingFilter",props:{id:String},setup(t){const e=t,{counts:n,listingSort:l,currPage:r,searchType:o,searchList:s,hasMap:i,showMap:u,address:m,sold:g,toggleMap:S,toggleClass:k}=ie[e.id],j=J(()=>n.value?n.value.toString().replace(/\B(?=(\d{3})+(?!\d))/g,","):"0"),U=J(()=>o.value==="sold"?n.value===1?"Sold Property Available":"Sold Properties Available":o.value==="For Rent"?n.value===1?"Property ForRent":"Properties For Rent":o.value==="For Sale"?n.value===1?"Property ForSale":"Properties For Sale":o.value==="neighborhood"?n.value===1?"Property AvailableNearby":"Properties AvailableNearby":"Properties Available"),Y=J(()=>g.value?A.value:ae.value),ae=y([{value:"RELEVANCE",label:"Default"},{value:"PRICE_DESC",label:"Price-High To Low"},{value:"PRICE_ASC",label:"Price-Low To High"},{value:"MLS_LIST_DATE_L_DESC",label:"Newest Listings"},{value:"BEDROOMS_DESC",label:"Beds (Most)"},{value:"BATHS_DESC",label:"Baths (Most)"},{value:"BUILT_YEAR_DESC",label:"Year Built (Newest)"},{value:"SQFT_DESC",label:"Square Feet (Biggest)"}]),A=y([{value:"RELEVANCE",label:"Default"},{value:"MLS_LIST_DATE_L_DESC",label:"Most Recent"},{value:"PRICE_DESC",label:"Price-Highest"},{value:"PRICE_ASC",label:"Price-Lowest"},{value:"BEDROOMS_DESC",label:"Beds (Most)"},{value:"BATHS_DESC",label:"Baths (Most)"},{value:"BUILT_YEAR_DESC",label:"Year Built (Newest)"}]),ee=J(()=>{var T;return(T=Y.value.find(M=>M.value===l.value))==null?void 0:T.label});function Z(T){l.value!==T.value&&(l.value=T.value,r.value=1,s())}return Ne(()=>{k()}),(T,M)=>E((d(),h("div",Dt,[c(n)===0?(d(),h("p",_t,"0 Properties")):(d(),h("p",Rt,[W(C(c(j))+" "+C(c(U))+" ",1),c(m)?(d(),h("span",Et," In "+C(c(m)),1)):P("",!0)])),X(Ie,{class:"lofty-sort-filter",top:40,right:c(oe)?"auto":0,left:c(oe)?0:"auto","fit-width":!1,hideArrow:!0},{menu:se(()=>[a("ul",$t,[(d(!0),h($,null,G(c(Y),O=>(d(),h("li",{class:"lofty-filter-item",onClick:ne=>Z(O)},[W(C(O.label)+" ",1),E(a("i",Bt,null,512),[[F,c(l)===O.value]])],8,
1jt))),256))])]),default:se(()=>[c(oe)?(d(),h("span",At,[W(C(c(ee))+" ",1),M[2]||(M[2]=a("i",{class:"lofty_iconfont lofty-icon-sort_04"},null,-1))])):(d(),h("span",Ot,[M[3]||(M[3]=a("span",{style:{color:"#A8A8A8"}},"Sort by",-1)),a("span",Nt,C(c(ee)),1),M[4]||(M[4]=a("i",{class:"lofty_iconfont lofty-icon-sort_04"},null,-1))]))]),_:1},8,["right","left"]),!c(oe)&&c(i)?(d(),h("span",{key:2,class:"lofty-map-filter",onClick:M[0]||(M[0]=(...O)=>c(S)&&c(S)(...O))},[a("span",Ht,C(c(u)?"Hide Map":"Show Map"),1),M[5]||(M[5]=a("i",{class:"lofty_iconfont lofty-icon-map_01"},null,-1))])):P("",!0),c(oe)&&c(i)?(d(),h("div",{key:3,class:"lofty-map-mobile-btn",onClick:M[1]||(M[1]=(...O)=>c(S)&&c(S)(...O))},M[6]||(M[6]=[a("i",{class:"lofty_iconfont lofty-icon-map_01"},null,-1),a("span",null,"Map",-1)]))):P("",!0)],512)),[[F,!c(oe)||!c(u)||!c(i)]])}},Ut={__name:"listingPagination",props:{id:String},setup(t){const e=t,{currPage:n,totalPage:l,counts:r,searchList:o}=ie[e.id],s=i=>{n.value=i.page,o()};return(i,u)=>c(r)>1?(d(),R(at,{key:0,totalPage:c(l),onPageChange:s,pageSize:24,noScroll:!0,pageNum:c(n)},null,8,["totalPage","pageNum"])):P("",!0)}},Gt={name:"Select",inject:["isMobile"],directives:{outSideClick:Ue},props:{value:{default:()=>({label:"1 Miles",value:1})},dataList:{type:Array,default:()=>[]}},data(){return{showList:!1}},methods:{changeSelect(t){this.$emit("change",t),this.showList=!1},switchDataList(){this.showList=!this.showList,this.$emit("closeSuggestion")},closeDataList(){this.showList=!1}},mounted(){this.isMobile?(this.$refs.switch.addEventListener("touchend",this.switchDataList),window.addEventListener("resize",this.closeDataList)):this.$refs.switch.addEventListener("click",this.switchDataList)},beforeDestroy(){this.isMobile&&window.removeEventListener("resize",this.closeDataList)}},Vt={class:"select-wrapper"},zt={ref:"switch"},Jt={class:"label-txt"},xt=["onClick"];function Ft(t,e,n,l,r,o){const s=$e("out-side-click");return E((d(),h("div",Vt,[a("div",zt,[a("span",Jt,C(n.value.label),1),a("span",{class:I(["lofty_iconfont lofty-icon-arrow-down",{up:r.showList}])},null,2)],512),E(a("div",{class:"data-list",id:"select-radius-list",onWheel:H(()=>{},["stop"]),onDrag:H(()=>{},["stop"]),onTouchmove:H(()=>{},["stop"]),onTouchstart:H(()=>{},["stop"]),onTouchend:H(()=>{},["stop"])},[a("ul",null,[(d(!0),h($,null,G(n.dataList,(i,u)=>(d(),h("li",{key:u,onClick:m=>o.changeSelect(i)},C(i.label),9,xt))),128))])],544),[[F,r.showList]])])),[[s,()=>{r.showList=!1}]])}const qt=K(Gt,[["render",Ft]]);let le="";const Kt={name:"radius-search",inject:["isMobile"],data(){return{location:le,suggestList:[],latlng:null,mileList:[1,1.5,2,2.5,3,3.5,4,4.5,5,10,15,20,25,30,50].map(t=>({value:t,label:t+(t>1?" miles":" mile")})),showSuggest:!1}},computed:{radiusValue(){return{value:this.radius,label:`${this.radius} ${this.radius>1?"miles":"mile"}`}}},props:{map:{type:Object},showRadiusOption:{type:Boolean},clearKey:{type:Number,default:1},radius:{type:Number,default:1}},components:{Select:qt},watch:{clearKey(){le=""}},methods:{searchSuggest:q.debounce(async function(t){const e={query:t.target.value,country:"usa",beginHighlight:encodeURIComponent("<mark>"),endHighlight:encodeURIComponent("</mark>"),maxresults:20},l=(await z.get("/search/home-j/here-api/autoSuggest",{data:e})).data.filter(o=>!!o.address.street),r=[];for(let o=0,s=0,i=l.length;s<5&&o<i;o++){let u=this.formatAddress(l[o]);u&&r.indexOf(u)===-1&&(r.push(u),s++)}this.suggestList=r,this.showSuggest=!0}),async changeLocation(t){le=t.replace(/<mark>|<\/mark>/g,""),this.location=le;let e=await nt.geocode(t.replace(/<mark>|<\/mark>/g,""),!0);this.latlng=e.center,this.$emit("submit",{location:this.latlng,radius:this.radiusValue.value}),this.showSuggest=!1},changeRadius(t){this.$emit("submit",{location:this.latlng,radius:t.value})},clearLocation(){le="",this.location="",this.showSuggest=!1},handleMutual(){this.$refs.select.showList=!1,this.showSuggest=!0},stopResizeEvent(t){return t&&t.preeventDefault?t.preeventDefault():window.event.returnValue=!1,!1},closeSuggestion(){this.showSuggest=!1},formatAddress(t){let e=t.address,n=this.getAddressItem(e,["houseNumber","street"])+this.getAddressItem(e,["city"]);return n?decodeURIComponent(n+this.getAddressItem(e,["state","postalCode"],!1)):null},getAddressItem(t,e,n){let l=[],r;for(let o=0,s=e.length;o<s;o++){let i=t[e[o]];i&&r!==i&&l.push(r=i)}return l.length?l.join(" ")+(n===!1?"":", "):""}},mounted(){this.isMobileSize&&window.addEventListener("resize",this.stopResizeEvent,!1)},beforeUnmount(){this.isMobile&&window.removeEventListener("resize",this.stopResizeEvent)}},Zt={class:"radius-search"},Wt={class:"position-wrapper"},Yt={class:"select-container"},Qt={class:"key-search"},Xt={class:"autocomplete"},eo=["onClick"],to=["innerHTML"];function oo(t,e,n,l,r,o){const s=Ce("Select");return E((d(),h("div",Zt,[e[12]||(e[12]=a("div",{class:"radius-search-title"},"Radius",-1)),a("div",Wt,[a("div",Yt,[X(s,{dataList:r.mileList,value:o.radiusValue,onChange:o.changeRadius,onCloseSuggestion:o.closeSuggestion,ref:"select"},null,8,["dataList","value","onChange","onCloseSuggestion"]),e[8]||(e[8]=a("span",{class:"select-tag"},"near",-1))]),a("div",Qt,[e[9]||(e[9]=a("i",{class:"lofty_iconfont lofty-icon-search"},null,-1)),E(a("input",{type:"text","onUpdate:modelValue":e[0]||(e[0]=i=>r.location=i),onMousedown:e[1]||(e[1]=H(()=>{},["stop"])),onDblclick:e[2]||(e[2]=H(()=>{},["stop"])),onFocus:e[3]||(e[3]=H((...i)=>
1o.handleMutual&&o.handleMutual(...i),["stop"])),onTouchstart:e[4]||(e[4]=H((...i)=>o.handleMutual&&o.handleMutual(...i),["stop"])),onInput:e[5]||(e[5]=H((...i)=>o.searchSuggest&&o.searchSuggest(...i),["stop"])),placeholder:"Input a location to center the map",ref:"input",class:I({"show-clear-content":r.location})},null,34),[[Se,r.location]]),r.location?(d(),h("i",{key:0,class:"lofty_iconfont lofty-icon-close",onClick:e[6]||(e[6]=(...i)=>o.clearLocation&&o.clearLocation(...i))})):P("",!0)]),e[11]||(e[11]=a("div",{class:"arrow-style"},null,-1)),E(a("ul",Xt,[(d(!0),h($,null,G(r.suggestList,i=>(d(),h("li",{key:i,class:"item",onClick:u=>o.changeLocation(i)},[e[10]||(e[10]=a("i",{class:"lofty_iconfont lofty-icon-location_02"},null,-1)),a("span",{innerHTML:i},null,8,to)],8,eo))),128))],512),[[F,r.suggestList.length>0&&r.showSuggest]]),a("span",{class:"lofty_iconfont lofty-icon-close",id:"close_radius_search_form",onClick:e[7]||(e[7]=H(i=>t.$emit("onClose"),["stop"]))})])],512)),[[F,n.showRadiusOption]])}const so=K(Kt,[["render",oo]]),io=1609.344,ao={mixins:[fe],inject:["isMobile"],props:{radius:{type:Number,default:1},clearKey:{type:Number,default:1}},components:{radiusOption:so},data(){return{showRadiusOption:!1,className:"search-radius"}},methods:{async initCircle(){this.circle&&this.map.removeObject(this.circle),this.circle=new window.H.map.Circle(this.data,this.radius*io,{style:{strokeColor:getComputedStyle(document.documentElement).getPropertyValue("--lofty-map-polygon-borderColor")||"rgb(25, 25, 25)",lineWidth:2,fillColor:getComputedStyle(document.documentElement).getPropertyValue("--lofty-map-polygon-bgColor")||"rgba(25, 25, 25, 0.2)"}}),this.circle.addEventListener("tap",()=>{this.showRadiusOption=!0}),this.circle.addEventListener("pointerenter",()=>{document.body.style.cursor="pointer"}),this.circle.addEventListener("pointerleave",()=>{document.body.style.cursor="default"}),this.map.addObject(this.circle),this.updateRadiusOption()},updateRadiusOption(){this.map&&this.circle&&this.map.getViewModel().setLookAtData({bounds:this.circle.getBoundingBox()},!0)},updateCircle(t){const e={location:t.location||this.data,radius:t.radius||this.radius};this.$emit("updateCircle",e)},onOpen(){this.showRadiusOption=!0},onClose(){this.showRadiusOption=!1}},mounted(){this.showRadiusOption=!0,this.initCircle()},unmounted(){this.circle&&this.map.removeObject(this.circle)}};function no(t,e,n,l,r,o){const s=Ce("radius-option");return t.parentDom?(d(),R(me,{key:0,to:t.parentDom},[a("div",be({class:"radius-center",onClick:e[0]||(e[0]=(...i)=>o.onOpen&&o.onOpen(...i)),onTouch:e[1]||(e[1]=(...i)=>o.onOpen&&o.onOpen(...i)),id:"open_radius_search_form"},t.$attrs),[X(s,{showRadiusOption:r.showRadiusOption,map:t.map,radius:n.radius,clearKey:n.clearKey,onSubmit:o.updateCircle,onOnClose:o.onClose},null,8,["showRadiusOption","map","radius","clearKey","onSubmit","onOnClose"])],16)],8,["to"])):P("",!0)}const lo=K(ao,[["render",no]]),ro={name:"tip"},uo={class:"draw-tip"};function co(t,e,n,l,r,o){return d(),h("div",uo,[a("p",null,[e[1]||(e[1]=W("Click and drag to draw your search ")),a("span",{class:"cancel",onClick:e[0]||(e[0]=s=>t.$emit("cancel"))}," Cancel")])])}const ho=K(ro,[["render",co]]),Ee=35,po={inject:["store","isMobile","mapbox"],props:{map:Object,showPolygon:{type:Boolean,default:!0},showRadius:{type:Boolean,default:!0}},data(){return{path:[],lines:[],points:[],showTip:!1,drawing:!1,outPath:[],showSelectDraw:!1,showCircle:!1,location:null,circleRadius:1,timer:null,clearKey:1}},watch:{mapSyncType:{handler(t){this.map&&(t==="mapArea"||!t)&&this.clearDraw()}},outPath(){if(this.outPath&&this.outPath.length>0){let t=JSON.stringify(this.outPath);this.store.polygonPath.value=JSON.parse(t),this.store.mapSyncType.value="polygon",this.store.mapSyncList.value=!0,this.store.geometry.value=[],this.store.condition.location={}}else{if(this.mapSyncType==="mapArea")return;this.store.mapPath.value="",this.store.mapSyncType.value="",this.store.mapSyncList.value=!1,this.store.searchMap(),this.store.searchList()}}},computed:{mapSyncType(){return this.store.mapSyncType.value}},methods:{handleMouseenter(){this.isMobile||(clearTimeout(this.timer),this.showSelectDraw=!0)},handleMouseleave(){this.isMobile||(this.timer=setTimeout(()=>{this.showSelectDraw=!1},300))},handleClick(){this.isMobile&&(this.showSelectDraw=!this.showSelectDraw)},outsidetouchstart(){this.isMobile&&(this.showSelectDraw=!1)},startDraw(){this.store.drawing.value||(this.store.drawing.value=!0,this.showTip=!0,this.tapCb||(this.tapCb=t=>{var e=this.map.screenToGeo(t.currentPointer.viewportX,t.currentPointer.viewportY);this.addPoint(e)}),this.pointermoveThrottle||(this.pointermoveThrottle=q.throttle(t=>{var e=this.map.screenToGeo(t.currentPointer.viewportX,t.currentPointer.viewportY);this.hoverPoint(e)},200)),this.pointermoveCb||(this.pointermoveCb=t=>{this.pointermoveThrottle(t)}),this.createTip(),this.map.addEventListener("pointerdown",this.tapCb),this.map.addEventListener("pointermove",this.pointermoveCb))},endDraw(){this.store.drawing.value=!1,this.showTip=!0,this.tapCb&&this.map.removeEventListener("pointerdown",this.tapCb),this.pointermoveCb&&this.map.removeEventListener("pointermove",this.pointermoveCb),this.clearDashedLine(),this.destroyTip()},clearDraw(){this.path=[],this.outPath=[],this.endDraw(),this.stopListenDragPoint(),this.mainGroup&&(this.pointGroup&&this.mainGroup.removeObject(this.pointGroup),this.mapPolygon&&this.mainGroup.removeObject(this.mapPolygon),this.mapPolyline&&this.mainGroup.removeObject(this.mapPolyline),this.map.removeObject(this.mainGroup)),this.mainGroup=null,this.pointGroup=null,this.mapPolygon=null,this.mapPolyline=null,this.geoLineString=null,this.clearKey=Date.now(),setTimeout(()=>{this.showCircle=!1},100),this.showTip=!1,this.store.drawing.value=!1,this.mapSyncType!=="mapArea"&&this.store.removeMapTag(),this.destroyTip(),this.showSelectDraw=!1},addLineStringPoint(t){this.geoLineString||(this.geoLineString=new window.H.geo.LineString),this.geoLineString.pushLatLngAlt(t.lat,t.lng,0)},closeLineString(t){var e=t.toGeoJSON().coordinates[0];t.pushLatLngAlt(e[1],e[0],e[2]),this.geoLineString.isClosed=!0},initDraw(){this.pointGroup=new window.H.map.Group({visibility:!0}),this.mainGroup=new window.H.map.Group({volatility:!0,objects:[this.pointGroup]}),this.map.addObject(this.mainGroup)},drawPoint(t,e){var n=`<svg width="12" height="12" version="1.1" xmlns="http://www.w3.org/2000/svg"> 2 <circle stroke="#fff" fill="rgb(25,25,25)" stroke-width="2" cx="6" cy="6" r="5"/> 3 </svg>`,l=new window.H.map.Marker(t,{icon:new window.H.map.Icon(n,{anchor:{x:6,y:6}})});l.draggable=!0,l.setData({index:e}),this.pointGroup.addObject(l)},drawLines(t){this.mapPolyline?this.mapPolyline.setGeometry(t):(this.mapPolyline=new window.H.map.Polyline(t,{style:{lineWidth:2,strokeColor:getComputedStyle(document.documentElement).getPropertyValue("--lofty-map-polygon-borderColor")||"rgb(25, 25, 25)"}}),this.mainGroup.addObject(this.mapPolyline))},drawPolygon(t){var e=new window.H.geo.Polygon(t);this.mapPolygon?this.mapPolygon.setGeometry(e):(this.mapPolygon=new window.H.map.Polygon(e,{style:{fillColor:getComputedStyle(document.documentElement).getPropertyValue("--lofty-map-polygon-bgColor")||"rgba(25, 25, 25, 0.2)",lineWidth:0}}),this.mainGroup.addObject(this.mapPolygon))},addPoint(t){var e=this.path.length;if(e===0&&this.initDraw(),e>=3&&this.closeToFirstPoint(t)){this.closePath();return}if(e>=Ee){q.toast(`Maximum support for ${Ee} strokes`);return}var n=this.path.length;this.path.push(t),this.addLineStringPoint(t),e++,this.drawPoint(t,n),e>=2&&(this.drawLines(this.geoLineString),e>=3&&this.drawPolygon(this.geoLineString))},closeToFirstPoint(t){var e=this.path,n=Be.distance(e[0],t),l=3e-6*Math.pow(2,22-this.map.getZoom());return n<l},drawDashedLine(t,e){var n=new window.H.geo.LineString;n.pushLatLngAlt(t.lat,t.lng,0),n.pushLatLngAlt(e.lat,e.lng,0),this.tempDashedline?this.tempDashedline.setGeometry(n):(this.tempDashedline=new window.H.map.Polyline(n,{style:{lineWidth:2,strokeColor:getComputedStyle(document.documentElement).getPropertyValue("--lofty-map-polygon-borderColor")||"rgb(25, 25, 25)",lineDash:[2,4]}}),this.mainGroup.addObject(this.tempDashedline))},clearDashedLine(){this.tempDashedline&&setTimeout(()=>{this.mainGroup&&this.mainGroup.removeObject(this.tempDashedline),this.tempDashedline=null},210)},hoverPoint(t){var e=this.path.length;if(e>=1){e>=3&&this.closeToFirstPoint(t)&&(t=this.path[0]);var n=this.path[this.path.length-1];if(this.drawDashedLine(n,t),e>=2){this.geoLineString.pushLatLngAlt(t.lat,t.lng,0),this.drawPolygon(this.geoLineString);var l=this.geoLineString.getPointCount();this.geoLineString.removePoint(l-1)}}},closePath(){this.closeLineString(this.geoLineString),this.drawLines(this.geoLineString),this.outPath=this.path,this.endDraw(),this.listenDragPoint()},listenDragPoint(){this.pointGroup&&(this.pointerenterCb||(this.pointerenterCb=()=>{document.body.style.cursor="pointer"}),this.pointGroup.addEventListener("pointerenter",this.pointerenterCb,!0),this.pointerleaveCb||(this.pointerleaveCb=()=>{document.body.style.cursor="default"}),this.pointGroup.addEventListener("pointerleave",this.pointerleaveCb,!0),this.dragCb||(this.dragCb=t=>{var e=t.currentPointer,n=this.map.screenToGeo(e.viewportX,e.viewportY);t.target.setGeometry(n);var l=t.target.getData().index;if(this.geoLineString.removePoint(l),this.geoLineString.insertPoint(l,n),l===0&&this.geoLineString.isClosed){var r=this.geoLineString.getPointCount()-1;this.geoLineString.removePoint(r),this.geoLineString.pushPoint(n)}this.drawLines(this.geoLineString),this.drawPolygon(this.geoLineString),t.stopPropagation()}),this.pointGroup.addEventListener("drag",this.dragCb,!0),this.dragendCb||(this.dragendCb=t=>{var e=t.currentPointer,n=this.map.screenToGeo(e.viewportX,e.viewportY),l=t.target.getData().index;this.path.splice(l,1,n),this.outPath=[...this.path]}),this.pointGroup.addEventListener("dragend",this.dragendCb,!0))},stopListenDragPoint(){this.pointGroup&&(this.pointerenterCb&&this.pointGroup.removeEventListener("pointerenter",this.pointerenterCb,!0),this.pointerleaveCb&&this.pointGroup.removeEventListener("pointerleave",this.pointerleaveCb,!0),this.dragCb&&this.pointGroup.removeEventListener("drag",this.dragCb,!0),this.dragendCb&&this.pointGroup.removeEventListener("dragend",this.dragendCb,!0))},drawPath(t,e=!1){this.initDraw(),this.path=t,this.geoLineString=new window.H.geo.LineString,t.forEach((n,l)=>{this.geoLineString.pushLatLngAlt(n.lat,n.lng,0),this.drawPoint(n,l)}),this.closeLineString(this.geoLineString),this.drawLines(this.geoLineString),this.drawPolygon(this.geoLineString),this.listenDragPoint(),this.showTip=!0,e&&this.map.getViewModel().setLookAtData({bounds:this.geoLineString.getBoundingBox()},!0)},openDrawCircle({location:t,radius:e}){var r,o;(o=(r=this.map)==null?void 0:r.clearBoundary)==null||o.call(r),e=e||1,this.circleRadius=e,t=t||this.map.getCenter();let{lng:n,lat:l}=t;
3Object.prototype.toString.call(n)==="[object Function]"&&(n=n(),l=l()),this.location={lng:n,lat:l},this.map.setCenter(this.location),this.showCircle=!0,this.showTip=!0,this.store.mapRadius.value=this.formatBackendQuery({location:this.location,radius:e}),this.store.mapSyncType.value="radius",this.store.mapSyncList.value=!0,this.store.geometry.value=[],this.store.condition.location={}},createTip(){if(this.destroyTip(),this.mapbox){const t=this.mapbox.parentElement.querySelector("#tip");this.tipComp=re(ho,{onCancel:()=>{this.clearDraw()}}),this.tipComp.mount(t)}},destroyTip(){this.tipComp&&(this.tipComp.unmount(),this.tipComp=null)},updateCircle({location:t,radius:e}){this.map.setCenter(t),this.circleRadius=e,this.location=t,this.showCircle=!1,this.$nextTick(()=>{this.drawing=!1,this.showCircle=!0,this.showTip=!0,this.store.mapRadius.value=this.formatBackendQuery({location:this.location,radius:e}),this.store.searchMap(),this.store.searchList()})},formatBackendQuery({location:t,radius:e}){return[JSON.stringify({originPoint:t,radius:e,unit:"miles"})]}},mounted(){if(this.store.polygonPath.value.length>0&&this.drawPath(this.store.polygonPath.value,!0),this.store.mapRadius.value.length>0){let{originPoint:t,radius:e}=JSON.parse(this.store.mapRadius.value[0]);this.openDrawCircle({location:t,radius:e},!1)}},components:{circleSearch:lo}},go={class:"draw"},mo={class:"btn-lofty"},fo={class:"select-item"};function yo(t,e,n,l,r,o){const s=Ce("circle-search");return d(),h("div",go,[a("div",mo,[r.showTip?(d(),h("span",{key:1,class:"btn-lofty-txt clear",onClick:e[5]||(e[5]=(...i)=>o.clearDraw&&o.clearDraw(...i))},"Clear")):(d(),h("div",{key:0,class:I(["btn-lofty-select",{unfold:r.showSelectDraw}]),onMouseenter:e[2]||(e[2]=(...i)=>o.handleMouseenter&&o.handleMouseenter(...i)),onMouseleave:e[3]||(e[3]=(...i)=>o.handleMouseleave&&o.handleMouseleave(...i)),onClick:e[4]||(e[4]=(...i)=>o.handleClick&&o.handleClick(...i))},[e[7]||(e[7]=a("span",{class:"btn-lofty-txt"},"Draw",-1)),e[8]||(e[8]=a("span",{class:"lofty_iconfont lofty-icon-arrow-down"},null,-1)),E(a("div",fo,[n.showPolygon?(d(),h("p",{key:0,onClick:e[0]||(e[0]=(...i)=>o.startDraw&&o.startDraw(...i))},"Polygon")):P("",!0),n.showRadius?(d(),h("p",{key:1,onClick:e[1]||(e[1]=(...i)=>o.openDrawCircle&&o.openDrawCircle(...i))},"Radius")):P("",!0),e[6]||(e[6]=a("div",{class:"opacity"},null,-1))],512),[[F,r.showSelectDraw]])],34))]),r.showCircle?(d(),R(s,{key:0,map:n.map,clearKey:r.clearKey,data:r.location,radius:r.circleRadius,onUpdateCircle:o.updateCircle},null,8,["map","clearKey","data","radius","onUpdateCircle"])):P("",!0)])}const vo=K(po,[["render",yo]]),wo={inject:["store","isMobile"],computed:{hideMapAreaButton(){return this.store.mapSyncList.value&&this.store.mapSyncType.value==="mapArea"}},methods:{handler(){this.store.mapSyncList.value=!0,this.store.mapSyncType.value="mapArea",this.store.condition.location={}},showList(){this.store.toggleMap()}}},So={key:0,class:"lofty-search"},Co={key:1,class:"lofty-search"},bo={class:"split-line"};function Lo(t,e,n,l,r,o){return o.isMobile?(d(),h("div",Co,[E(a("span",{class:"search-text",onClick:e[1]||(e[1]=(...s)=>o.handler&&o.handler(...s))},"Search this area",512),[[F,!o.hideMapAreaButton]]),E(a("span",bo,null,512),[[F,!o.hideMapAreaButton]]),a("span",{class:"change-grid",onClick:e[2]||(e[2]=(...s)=>o.showList&&o.showList(...s))},e[3]||(e[3]=[a("i",{class:"lofty_iconfont lofty-icon-grid-fill"},null,-1),a("span",null,"Grid",-1)]))])):E((d(),h("div",So,[a("span",{class:"search-text",onClick:e[0]||(e[0]=(...s)=>o.handler&&o.handler(...s))},"Redo Search On Map Area")],512)),[[F,!o.hideMapAreaButton]])}const Po=K(wo,[["render",Lo]]),ko={inject:["store","isMobile"],data(){return{isPop:!1,rating:"0",schoolChecked:this.store.showSchool.value,level:Q({elementary:{label:"Elementary",value:!0},middle:{label:"Middle",value:!0},high:{label:"High",value:!0}}),timer:null}},computed:{ratingText(){let t=this.rating;return t==="0"?"All":t+(t==="10"?"":"+")},schoolData(){return{admission:"public,private",level:Object.keys(this.level).filter(t=>this.level[t].value).join(","),rating:this.rating}}},watch:{schoolData:{handler:he(function(){this.searchSchool()},300)}},methods:{toggleSchool(t){const e=t.target.checked;this.store.showSchool.value=e,e?this.searchSchool():this.store.markerData.school=[]},searchSchool(){this.store.searchSchool(this.schoolData)},handleMouseenter(){this.isMobile||(clearTimeout(this.timer),this.isPop=!0)},handleMouseleave(){this.isMobile||(this.timer=setTimeout(()=>{this.isPop=!1},100))},handleClick(){this.isMobile&&(this.isPop=!this.isPop)},updateRangeStyle(){const t=100*+this.rating/10;this.$refs.range.style.background=`linear-gradient(to right, #191919 ${t}%, rgba(218, 218, 218, 0.5) ${t}%)`}},mounted(){this.updateRangeStyle()}},Mo={class:"school"},To={class:"switch"},Do={class:"school"},_o=["onUpdate:modelValue","value"],Ro={class:"rating"},Eo={class:"range"},Ao={class:"label"};function Oo(t,e,n,l,r,o){return d(),h("div",Mo,[a("div",{class:I(["school-btn",{unfold:r.isPop}]),onClick:e[0]||(e[0]=(...s)=>o.handleClick&&o.handleClick(...s)),onMouseenter:e[1]||(e[1]=(...s)=>o.handleMouseenter&&o.handleMouseenter(...s)),onMouseleave:e[2]||(e[2]=(...s)=>o.handleMouseleave&&o.handleMouseleave(...s))},e[9]||(e[9]=[a("span",{class:"btn-txt"},"School",-1),a("span",{class:"lofty_iconfont lofty-icon-arrow-down"},null,-1)]),34),E(a("div",{class:"pop-school-search",ref:"pop",onMouseenter:e[7]||
3(e[7]=(...s)=>o.handleMouseenter&&o.handleMouseenter(...s)),onMouseleave:e[8]||(e[8]=(...s)=>o.handleMouseleave&&o.handleMouseleave(...s))},[a("div",To,[a("label",null,[E(a("input",{type:"checkbox",name:"switch","onUpdate:modelValue":e[3]||(e[3]=s=>r.schoolChecked=s),onInput:e[4]||(e[4]=(...s)=>o.toggleSchool&&o.toggleSchool(...s))},null,544),[[Me,r.schoolChecked]]),a("span",{class:I(["lofty_iconfont lofty-icon-checked",{mobile:o.isMobile}])},null,2),e[10]||(e[10]=a("span",null,"Show Schools On Map",-1))])]),e[14]||(e[14]=a("div",{class:"divider"},null,-1)),a("div",Do,[(d(!0),h($,null,G(Object.keys(r.level),s=>(d(),h("label",{key:s},[E(a("input",{type:"checkbox",name:"level","onUpdate:modelValue":i=>r.level[s].value=i,value:s},null,8,_o),[[Me,r.level[s].value]]),a("span",{class:I(["lofty_iconfont lofty-icon-checked",{mobile:o.isMobile}])},null,2),W(" "+C(s),1)]))),128))]),e[15]||(e[15]=a("div",{class:"divider"},null,-1)),e[16]||(e[16]=a("p",{class:"rating-title"},"GreatSchools Rating",-1)),a("div",Ro,[a("div",Eo,[e[12]||(e[12]=a("span",null,"Low",-1)),a("div",null,[E(a("input",{ref:"range",type:"range",name:"rating",min:"0",max:"10","onUpdate:modelValue":e[5]||(e[5]=s=>r.rating=s),onInput:e[6]||(e[6]=(...s)=>o.updateRangeStyle&&o.updateRangeStyle(...s))},null,544),[[Se,r.rating]]),e[11]||(e[11]=a("div",{class:"bar"},null,-1))]),e[13]||(e[13]=a("span",null,"High",-1))]),a("span",Ao,C(o.ratingText),1)])],544),[[F,r.isPop]])])}const No=K(ko,[["render",Oo]]),$o={mixins:[fe],data(){return{type:"house"}},computed:{houses(){return this.data.items},housesStatus(){return"house-status-"+(this.houses[0].listingStatus||"").toLowerCase()}}},jo={key:0,class:"house-header"},Bo={class:"house-list"},Ho=["href"],Io={class:"house-top"},Uo=["src"],Go={class:"house-info"},Vo={key:0,class:"price"},zo={key:1,class:"price"},Jo={class:"info"},xo={class:"addr"},Fo={class:"house-bottom"},qo={class:"detail"},Ko={key:0,class:"house-mls-id"},Zo=["src"];function Wo(t,e,n,l,r,o){return t.parentDom?(d(),R(me,{key:0,to:t.parentDom},[a("div",be({ref:"marker",class:["marker-house map-marker",{active:t.active===t.fmLatlng,hidden:t.data.destroyed}],onMouseenter:e[0]||(e[0]=(...s)=>t.onMouseEnter&&t.onMouseEnter(...s)),onMouseleave:e[1]||(e[1]=(...s)=>t.onMouseLeave&&t.onMouseLeave(...s)),onClick:e[2]||(e[2]=(...s)=>t.onClick&&t.onClick(...s)),onWheel:e[3]||(e[3]=H(()=>{},["stop"])),onMousewheel:e[4]||(e[4]=H(()=>{},["stop"]))},t.$attrs),[a("span",{class:I(["marker-shape",[{highlight:t.data.keepHighlight},o.housesStatus]])},[t.data.nodisclosureDes?(d(),h($,{key:0},[W("﹡﹡﹡﹡﹡")],64)):P("",!0),t.data.nodisclosureDes?P("",!0):(d(),h($,{key:1},[W(C(t.showPrice),1)],64))],2),a("div",{ref:"pop",class:I(["marker-pop",{multi:o.houses.length>1,bottom:t.popBottom}]),style:ge(t.popStyle)},[o.houses.length>1?(d(),h("div",jo,[a("span",null,C(o.houses.length)+" units here ",1)])):P("",!0),a("ul",Bo,[(d(!0),h($,null,G(o.houses,s=>(d(),h("li",{class:"house-item",key:s.id},[a("a",{href:s.detailLink||s.detailUrl,target:"_blank",rel:"noopener noreferrer"},[a("div",Io,[a("img",{class:"img-container",src:s.previewPicture,alt:""},null,8,Uo),a("div",Go,[s.nodisclosureDes?(d(),h("p",zo,C(s.nodisclosureDes),1)):(d(),h("p",Vo,C(s.soldDate?s.soldPrice:s.price),1)),a("div",Jo,[(d(!0),h($,null,G(s.basic,i=>(d(),h("span",{class:"desc-span",key:i.key},C(i.text),1))),128))]),a("p",xo,C(s.streetAddress),1)])]),a("div",Fo,[a("div",qo,[s.showMls?(d(),h("p",Ko," Listing # "+C(s.mlsListingId),1)):P("",!0)]),s.mlsLogo?(d(),h("img",{key:0,class:"house-mls-logo",height:"18",src:s.mlsLogo,alt:"house mls logo"},null,8,Zo)):P("",!0)])],8,Ho)]))),128))])],6)],16)],8,["to"])):P("",!0)}const Ae=K($o,[["render",Wo]]),Yo={emits:["update:active"],mixins:[fe],inject:["store"],directives:{outSideClick:Ue},data(){return{type:"school"}},methods:{pushLocation(){const{location:t}=this.store.condition;this.store.removeMapTag();const{keywordType:e,label:n}=this.data;t[e]?t[e].includes(n)===-1&&t[e].push(n):t[e]=[n]},touchstart(t){this.active||t.preventDefault(),this.onClick()},outClick(){this.active&&this.$emit("update:active","")}}},Qo={class:"school-list"},Xo={class:"info"},es={class:"left"},ts={class:"name"},os={class:"tip"},ss={class:"right"};function is(t,e,n,l,r,o){const s=$e("out-side-click");return t.parentDom?(d(),R(me,{key:0,to:t.parentDom},[a("div",{class:I(["marker-school map-marker",{active:t.active===t.fmLatlng}]),onMouseenter:e[1]||(e[1]=(...i)=>t.onMouseEnter&&t.onMouseEnter(...i)),onMouseleave:e[2]||(e[2]=(...i)=>t.onMouseLeave&&t.onMouseLeave(...i)),onTouchstart:e[3]||(e[3]=(...i)=>o.touchstart&&o.touchstart(...i))},[e[5]||(e[5]=a("i",{class:"lofty_iconfont lofty-icon-school2"},null,-1)),a("div",{ref:"pop",class:I(["marker-pop",{bottom:t.popBottom}]),style:ge(t.popStyle)},[a("span",{ref:"pointer",class:"pointer",style:ge(t.pointerStyle)}
3,null,4),E((d(),h("ul",Qo,[a("li",null,[a("div",Xo,[a("div",es,[a("p",ts,C(t.data.name),1),a("span",os,C(t.data.type)+" · "+C(t.data.gradeRange),1)]),a("div",ss,[a("div",{class:I({rating:!0,high:t.data.gsRating>9,middle:t.data.gsRating>=6&&t.data.gsRating<=9})},C(t.data.gsRating),3),e[4]||(e[4]=a("span",{class:"tip"},"Out of 10",-1))])]),a("div",{class:"link",onClick:e[0]||(e[0]=(...i)=>o.pushLocation&&o.pushLocation(...i))},"View Homes in This School Area")])])),[[s,o.outClick]])],6)],34)],8,["to"])):P("",!0)}const as=K(Yo,[["render",is]]),ns={mixins:[fe],data(){return{type:"aggre"}},methods:{showBoundary(){if(this.boundary&&!this.isMobile)this.boundary.setVisibility(!0);else{const t={strokeColor:getComputedStyle(document.documentElement).getPropertyValue("--lofty-map-polygon-borderColor")||"rgb(25, 25, 25)",fillColor:getComputedStyle(document.documentElement).getPropertyValue("--lofty-map-polygon-bgColor")||"rgba(25, 25, 25, 0.2)",lineWidth:2},e=new window.H.geo.LineString,n=[];this.data.bounds.forEach((o,s)=>{if(Array.isArray(o))if(s===0)o.forEach(i=>{e.pushPoint(i)});else{const i=new window.H.geo.LineString;o.forEach(u=>{i.pushPoint(u)}),n.push(i)}else e.pushPoint(o)});const r=new window.H.geo.Polygon(e,n);this.boundary=new window.H.map.Polygon(r,{style:t}),this.map.addObject(this.boundary),this.boundary.setVisibility(!0)}this.onMouseEnter()},hideBoundary(){this.boundary&&this.boundary.setVisibility(!1),this.onMouseLeave()},onClick(){const t=this.events&&this.events.click;t&&t.call(this),this.hideBoundary();let{lat:e,lng:n}=this.data,l=this.map.getZoom();this.isMobile?l+=2:l+=l<10?3:l<=16?2:1,this.map.getViewModel().setLookAtData({position:{lat:e,lng:n},zoom:l},!0)}},beforeUnmount(){this.boundary&&this.map&&this.map.removeObject(this.boundary)}},ls={class:"marker-shape"},rs={class:"info"},us={class:"count"};function cs(t,e,n,l,r,o){return t.parentDom?(d(),R(me,{key:0,to:t.parentDom},[a("div",be({class:["marker-aggre map-marker",{active:t.active===t.fmLatlng}],onMouseenter:e[0]||(e[0]=(...s)=>o.showBoundary&&o.showBoundary(...s)),onMouseleave:e[1]||(e[1]=(...s)=>o.hideBoundary&&o.hideBoundary(...s)),onClick:e[2]||(e[2]=(...s)=>o.onClick&&o.onClick(...s))},t.$attrs),[a("div",ls,[a("div",rs,[a("span",us,C(t.data.count),1)])])],16)],8,["to"])):P("",!0)}const ds=K(ns,[["render",cs]]),hs={class:"marker-box aggre"},ps={class:"marker-box house"},gs={class:"marker-box school"},ms={__name:"listingMap",props:{id:String},setup(t){const e=t,{module:n,zoom:l,map:r,sold:o,rect:s,geometry:i,drawing:u,searchMap:m,listings:g,markerData:S,mlsList:k,condition:j,showMap:U,mapSyncType:Y,dealHouseData:ae}=ie[e.id],A=Q({aggre:"",house:"",school:""});Te("isMobile",q.isMobile),Te("store",ie[e.id]);const ee=y(!1),Z=Q({lat:0,lng:0}),T={minZoom:4,maxZoom:20,zoom:l.value,center:{lat:40.00267,lng:-75.3057}};M();async function M(){const v=n.getModuleData().mapCenter;if(s){const p=s.split(",");T.center.lat=(+p[0]+ +p[2])/2,T.center.lng=(+p[1]+ +p[3])/2}else if(v)T.center.lng=+v.lng,T.center.lat=+v.lat,T.zoom=11,l.value=11;else{const p=await z.get("search/centerPoint");p.centerLatitude&&p.centerLongitude&&(T.center.lat=p.centerLatitude,T.center.lng=p.centerLongitude,l.value=p.zoom)}ee.value=!0}const O=["city","zipCode","neighborhood"];function ne(){pe([j,U],async()=>{if(!U.value)return;const v=j.location||{};Object.keys(v).filter(f=>f!=="mapPath"&&f!=="mapRadius").length>0&&await ce(v),O.some(f=>!!v[f])?ye(v):i.value=[],m()},{immediate:!0})}pe(g,()=>{const v=n.$all(".lofty-listing .lofty-house-item");Array.from(v).forEach(p=>{p.onmouseenter=f=>{const b=f.target.getAttribute("house-id"),V=g.value.find(B=>String(B.id)===b),x=ae([JSON.parse(JSON.stringify(V))]);S.activeHouse=x[0],S.activeHouseKey=Date.now()}})}),pe(U,v=>{if(v&&g.value[0]){const p=g.value[0];Z.lat=+p.latitude,Z.lng=+p.longitude}});const ue=y([]);async function ce(v){const p={mlsOrgIds:k};for(let b in v){let V=v[b];["streetAddress"].includes(b)&&(V=v[b].map(x=>x.split(",")[0])),p[b]=V.join(";")}const{data:f}=await z.post("search/listing/locationSearch",{data:p});if(f&&f.length===2){const[b,V,x,B]=[f[0].longitude,f[1].longitude,f[0].latitude,f[1].latitude],w=Math.min(b,V),_=Math.max(b,V),L=Math.min(x,B),D=Math.max(x,B);ue.value=[[w,L],[w,D],[_,D],[_,L]]}else f.length===1&&(Z.lat=f[0].latitude,Z.lng=f[0].longitude,l.value=18,r.value.setZoom(18))}async function ye(v){const p={};O.forEach(b=>{v[b]&&(p[b]=v[b].join(";"))});const f=await z.get("search/hj/getBoundary",{data:p});i.value=f.geometry}const te=q.debounce(m,300);function de(v){r.value=v,v.addEventListener("dragend",()=>{["polygon","radius"].includes(Y.value)||te()}),v.addEventListener("dbltap",p=>{let f=v.getZoom(),{viewportX:b,viewportY:V}=p.currentPointer,x=v.screenToGeo(b,V);const B=T.maxZoom||20,w=Math.min(f+1,B);v.getViewModel().setLookAtData({position:x,zoom:w}
3,!0),m()}),v.addEventListener("mapviewchangeend",()=>{const p=Math.round(r.value.getZoom());l.value!==p&&(l.value=p,te())}),ne()}return(v,p)=>c(ee)?(d(),R(xe,{key:0,onInit:de,config:T,center:c(Z),boundary:c(ue),geometry:c(i),class:I({drawing:c(u)})},{default:se(()=>[X(Po,{class:"map-tool"}),c(o)?P("",!0):(d(),R(No,{key:0,class:"map-tool"})),X(vo,{class:I(["map-tool",{"draw-is-sold":c(o)}]),map:c(r)},null,8,["class","map"]),p[3]||(p[3]=a("div",{id:"tip"},null,-1)),a("div",hs,[(d(!0),h($,null,G(c(S).aggregation,f=>(d(),R(ds,{key:f.key,map:c(r),class:"map-marker",data:f,active:c(A).aggre,"onUpdate:active":p[0]||(p[0]=b=>c(A).aggre=b)},null,8,["map","data","active"]))),128))]),a("div",ps,[(d(!0),h($,null,G(c(S).house,f=>(d(),R(Ae,{key:f.key,map:c(r),class:"map-marker",data:f,active:c(A).house,"onUpdate:active":p[1]||(p[1]=b=>c(A).house=b)},null,8,["map","data","active"]))),128)),c(S).activeHouse?(d(),R(Ae,{map:c(r),key:c(S).activeHouseKey,class:"map-marker active-house",data:c(S).activeHouse},null,8,["map","data"])):P("",!0)]),a("div",gs,[(d(!0),h($,null,G(c(S).school,f=>(d(),R(as,{key:f.key,map:c(r),class:"map-marker",data:f,active:c(A).school,"onUpdate:active":p[2]||(p[2]=b=>c(A).school=b)},null,8,["map","data","active"]))),128))])]),_:1},8,["center","boundary","geometry","class"])):P("",!0)}};(async()=>(rt(),ut(),await _e.initState(()=>{var t,e;lt(),(e=(t=_e.mlsList)==null?void 0:t.forEach)==null||e.call(t,n=>ct(n))}),Xe(),jQuery(".lofty-listing-page").ready(function(){const t=document.querySelectorAll(".lofty-listing-page");t.length>0&&t.forEach(e=>{const n=e.getAttribute("id"),l=Ge(n),{id:r,$:o}=l;ht(l);const s=l.getModuleData();re(Tt,{id:r}).mount(o("#lofty-listing-search")),re(It,{id:r}).mount(o("#lofty_filter_container")),re(Ut,{id:r}).mount(o("#lofty_pagination_container")),s.hasMap&&re(ms,{id:r}).mount(o("#lofty-map-container"))})})))();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.