1import{S as r}from"./SBAutoComplete.X7Ihhq3-.js";import{mapActions as l,mapState as n}from"./vuex.esm.browser.CyPgdje4.js";import m from"./AnimatedLoading.BDcJA78s.js";import c from"./searchBox.BDt0eo6G.js";import h from"./ChooseOnMap.CVrg4zRY.js";import{r as p}from"./redirect.D7LFhqeD.js";import{u as a}from"./index.Dbgga_3F.js";import{n as d}from"./_plugin-vue2_normalizer.D8LNvuNP.js";import"./debounce.BgibKyH_.js";import"./isSymbol.CCC4HJaK.js";import"./toNumber.x9MXpNBe.js";import"./search.lVRWKT8r.js";import"./networking.B2HGPy6s.js";import"./lazy-module.B4indqDa.js";import"./user.B2Swm8sd.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t.SENTRY_RELEASE={id:"v3.302.1"};var e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="0a3c4a61-1950-473e-8610-505e59d7e574",t._sentryDebugIdIdentifier="sentry-dbid-0a3c4a61-1950-473e-8610-505e59d7e574")}catch{}})();const u={props:["forSale","translates"],components:{ChooseOnMap:h,AnimatedLoading:m,SBAutoComplete:r},computed:{...n({searchBoxValue:t=>t.searchBox.value,items:t=>t.searchBox.items}),isEmptyQuery(){return this.query===""||!this.query},itemsUngroup(){const{items:t=[]}=this;return t.reduce((e,s)=>[...e,...s.options],[])}},data(){return{src:`${window.url}api/smart-search/autocomplete`,loading:!1,query:"",isMobile:window.site.isMobile,previousResultItems:[],previousQuery:""}},beforeCreate(){const t=this.$store;t&&t.state&&t.state.searchBox||t.registerModule("searchBox",c)},beforeDestroy(){this.autocompleteAbort&&this.autocompleteAbort.abort()},methods:{...l("searchBox",["updateItems"]),remoteMethod(t){if(t===this.previousQuery&&this.previousResultItems.length){this.updateItems(this.previousResultItems);return}this.query=t,this.loading=!0,this.autocompleteAbort&&this.autocompleteAbort.abort(),this.autocompleteAbort=new AbortController,axios.get(`${window.url}api/geometric/auto-complete?q=${t}&forSale=${this.forSale}`,{signal:this.autocompleteAbort.signal}).then(e=>{this.loading=!1,this.previousQuery=t,this.previousResultItems=e.data.data,this.updateItems(e.data.data)}).catch(e=>{axios.isCancel(e)||(this.loading=!1)})},onSelect(t){const{itemsUngroup:e}=this,s=e.find(o=>{const{value:i={}}=o;return i.id===t});if(s){const{defaultSearch:o,label:i}=s;this.query=i,this.loading=!0,window.location.href=o}},onClear(){this.query="",this.updateItems([]),$("body").removeClass("search-open-mobile-homepage"),$("html").removeClass("search-open-mobile-homepage")},onClickChooseOnMap(){this.$modal.show("location-picker-modal")},onClickNearMe(){const{forSale:t}=this,e=t?a.search.nearMeForSale:a.search.nearMeForRent;p(e)}}};var f=function(){var e=this,s=e._self._c;return s("div",{staticClass:"Typeahead"},[s("s-b-auto-complete",{attrs:{"for-sale":e.forSale,"on-change":e.onSelect,value:e.query,placeholder:e.translates.searchByRegionLocationOrProject,"remote-method":e.remoteMethod,items:e.items,translates:e.translates}},[s("template",{slot:"suggest-options"},[e.isMobile?s("div",{staticClass:"filter-type",on:{click:e.onClickNearMe}},[s("img",{attrs:{loading:"lazy",src:"/images/icon/filter-near-me.svg",width:"15",height:"15",alt:""}}),e._v(" "+e._s(e.translates.nearMe)+" ")]):e._e(),e.isMobile?s("div",{staticClass:"filter-type",on:{click:e.onClickChooseOnMap}},[s("img",{attrs:{loading:"lazy",src:"/images/icon/filter-choose-map.svg",width:"15",height:"15",alt:""}}),e._v(" "+e._s(e.translates.chooseOnMap)+" ")]):e._e()])],2),e.isMobile?s("choose-on-map",{attrs:{translates:e.translates}}):e._e(),e.loading?s("div",{staticClass:"auto-complete-icon"},[s("animated-loading",{attrs:{loading:e.loading,size:8}})],1):[s("div",{directives:[{name:"show",rawName:"v-show",value:e.isEmptyQuery||!e.isEmptyQuery&&e.isMobile,expression:"isEmptyQuery || (!isEmptyQuery && isMobile)"}],staticClass:"auto-complete-icon"},[s("svg",{attrs:{"aria-hidden":"true",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"}},[s("path",{attrs:{d:"M23.7898 22.7761L17.9575 16.9437C19.522 15.145 20.4692 12.7982 20.4692 10.2333C20.4692 4.58714 15.8767 0 10.2359 0C4.58983 0 0.00268555 4.59246 0.00268555 10.2333C0.00268555 15.8741 4.59515 20.4665 10.2359 20.4665C12.8009 20.4665 15.147
17 19.5193 16.9464 17.9548L22.7787 23.7871C22.9171 23.9255 23.1034 24 23.2843 24C23.4652 24 23.6515 23.9308 23.7898 23.7871C24.0665 23.5104 24.0665 23.0528 23.7898 22.7761ZM1.43417 10.2333C1.43417 5.38004 5.38273 1.43681 10.2306 1.43681C15.0838 1.43681 19.0271 5.38537 19.0271 10.2333C19.0271 15.0812 15.0838 19.035 10.2306 19.035C5.38273 19.035 1.43417 15.0865 1.43417 10.2333Z",fill:"white"}})])]),s("div",{directives:[{name:"show",rawName:"v-show",value:!e.isEmptyQuery&&!e.isMobile,expression:"!isEmptyQuery && !isMobile"}],staticClass:"auto-complete-icon",on:{click:e.onClear}},[s("svg",{attrs:{"aria-hidden":"true",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"}},[s("path",{attrs:{d:"M10.8528 11.9198L0.22982 22.5428C-0.0653047 22.8379 -0.0653047 23.316 0.22982 23.6111C0.377195 23.7589 0.570695 23.8324 0.76382 23.8324C0.95732 23.8324 1.15045 23.7589 1.29782 23.6111L12.0007 12.9083L22.7036 23.6111C22.8513 23.7589 23.0444 23.8324 23.2376 23.8324C23.4307 23.8324 23.6242 23.7589 23.7716 23.6111C24.0667 23.316 24.0667 22.8379 23.7716 22.5428L13.1489 11.9198L23.7787 1.28925C24.0738 0.994129 24.0738 0.516004 23.7787 0.220879C23.4836 -0.0738706 23.0054 -0.0738706 22.7107 0.220879L12.0011 10.9313L1.29032 0.221254C0.995195 -0.0734956 0.517445 -0.0734956 0.22232 0.221254C-0.0728047 0.516379 -0.0728047 0.994504 0.22232 1.28963L10.8528 11.9198Z",fill:"white"}})])])]],2)},g=[],C=d(u,f,g,!1,null,"04541ca9");const R=C.exports;export{R as default};
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.