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AInE,QAAQ,cAAc,UAAU,QAAUmE,EAAI/D,aAAa,CAACkE,EAAG,iBAAiB,CAACG,MAAM,CAAC,QAAUN,EAAIpD,YAAY,SAAWoD,EAAItD,cAAc,OAASsD,EAAIrD,aAAakE,GAAG,CAAC,WAAa,SAASC,GAAQd,EAAIrD,aAAY,CAAK,KAAKqD,EAAI4B,GAAG,KAAK5B,EAAI+B,GAAI/B,EAAkB,gBAAE,SAASvC,EAAMwE,GAAO,OAAO9B,EAAG,aAAa,CAACM,IAAIwB,EAAM3B,MAAM,CAAC,SAAW,CAAElD,IAAKC,WAAWI,EAAgB,UAAIH,IAAKD,WAAWI,EAAiB,YAAK,WAAY,EAAK,WAAY,EAAM,KAAOuC,EAAI/C,UAAU,MAAQQ,EAAY,MAAGoD,GAAG,CAAC,MAAQ,SAASC,GAAQ,OAAOd,EAAI3B,gBAAgBZ,EAAkB,WAAE,EAAE,UAAY,SAASqD,GAAQ,OAAOd,EAAIrC,iBAAiBF,EAAOwE,EAAM,IAAI,KAAI,IAAI,GAAGjC,EAAI8B,MAAM,EAAE,EACt/DI,EAAkB,E","sources":["webpack:///./resources/area/web/default/js/components/physical-stores/StoreSearch.vue?7b64","webpack:///./resources/area/web/default/js/components/physical-stores/StoreSearch.vue","webpack:///./resources/area/web/default/js/components/physical-stores/StoreSearch.vue?7198","webpack:///./resources/area/web/default/js/components/physical-stores/StoreSearch.vue?968e"],"sourcesContent":["\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nimport {Component, Vue, Prop} from 'vue-property-decorator';\nimport {required} from 'vee-validate/dist/rules';\nimport {ValidationProvider, ValidationObserver, extend} from 'vee-validate';\n\nextend('required', required);\n\n@Component({\n name: 'store-search',\n components: {\n ValidationProvider,\n ValidationObserver\n }\n})\n\nexport default class extends Vue {\n @Prop() private physicalStores: Array<object>;\n @Prop() private route: string;\n @Prop() private query: string;\n @Prop({default: true}) private showSearch: boolean;\n @Prop({default: 7}) private zoom: number;\n @Prop({default: false}) private center: boolean;\n @Prop({default: true}) private showMap: boolean;\n\n private searchQuery: string = '';\n private physicalStoresToShow: Array<object> = [];\n private physicalStoresResult: Array<object> = [];\n private updateMapCenter: boolean = false;\n private mapZoom: number = 0;\n private showResults: boolean = false;\n private resultQuery: string = '';\n private loading: boolean = false;\n\n private mapOptions: object = {\n zoomControl: false,\n mapTypeControl: false,\n scaleControl: false,\n streetViewControl: false,\n rotateControl: false,\n fullscreenControl: false,\n disableDefaultUi: true\n };\n\n private currentMidx: null | number = null;\n private infoWindowPos: object | null = null;\n private infoWinOpen: boolean = false;\n private infoOptions: object = {\n content: '',\n pixelOffset: {\n width: 0,\n height: -26\n }\n };\n\n private svgMarker: string = \"data:image/svg+xml,%0A%3Csvg width='18px' height='26px' viewBox='0 0 18 26' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg id='Page-1' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3E%3Cg id='marker' transform='translate(1.000000, 1.000000)' fill='%23FFD700' fill-rule='nonzero' stroke='%23000000' stroke-width='0.8'%3E%3Cpath d='M8,0 C3.802,0 0,3.403 0,7.602 C0,11.8 3.469,16.812 8,24 C12.531,16.812 16,11.8 16,7.602 C16,3.403 12.199,0 8,0 Z M8,11 C6.343,11 5,9.657 5,8 C5,6.343 6.343,5 8,5 C9.657,5 11,6.343 11,8 C11,9.657 9.657,11 8,11 Z' id='Shape'%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/svg%3E\";\n\n private get mapCenter(): object {\n if (this.updateMapCenter) {\n return {lat: parseFloat(this.physicalStoresToShow[0]['latitude']), lng: parseFloat(this.physicalStoresToShow[0]['longitude'])};\n }\n\n if (this.center) {\n let lat = 0.0;\n let lng = 0.0;\n this.physicalStoresToShow.forEach(store => {\n lat += parseFloat(store['latitude']);\n lng += parseFloat(store['longitude']);\n });\n\n return {lat: lat / this.physicalStoresToShow.length, lng: lng / this.physicalStoresToShow.length};\n\n }\n return {lat: 52.370216, lng: 4.895168};\n }\n\n private toggleInfoWindow(marker, idx): void {\n this.infoWindowPos = {lat: parseFloat(marker.latitude), lng: parseFloat(marker.longitude)};\n this.infoOptions['content'] = `<h4>${marker.name}</h4>`;\n this.infoOptions['content'] += `<p>${marker.street} ${marker.number}${marker.number_addition || ''}</p>`;\n this.infoOptions['content'] += `<p>${marker.city}</p>`;\n\n if (this.currentMidx == idx) {\n this.infoWinOpen = !this.infoWinOpen;\n } else {\n this.infoWinOpen = true;\n this.currentMidx = idx;\n }\n }\n\n private redirectToStore(identifier): void {\n window.location.href = `${this.route}/${identifier}`;\n }\n\n private async searchStore(): Promise<void> {\n this.loading = true;\n try {\n const {data} = await this.$solarClient.get(`/api/physical-store/list-by-distance?search=${this.searchQuery}`);\n\n if (data) {\n this.physicalStoresResult = data;\n this.physicalStoresToShow = [this.physicalStoresResult[0]];\n\n this.updateMapCenter = true;\n this.mapZoom = 15;\n\n this.showResults = true;\n this.resultQuery = this.searchQuery;\n\n const queryMatchesPhysicalStore = this.physicalStoresResult.filter(store => store['city'].toLowerCase() === this.searchQuery.toLowerCase());\n\n if (queryMatchesPhysicalStore.length === 1) {\n window.location.href = `${this.route}/${queryMatchesPhysicalStore[0]['identifier']}`;\n } else if (queryMatchesPhysicalStore.length > 1) {\n window.location.href = `${this.route}/${encodeURI(queryMatchesPhysicalStore[0]['city'].replace(/([^a-z\\-\\s])/ig, '').toLowerCase())}`;\n }\n }\n } finally {\n this.loading = false;\n }\n }\n\n private created(): void {\n this.physicalStoresToShow = this.physicalStores;\n this.mapZoom = this.zoom;\n if (this.query) {\n this.searchQuery = this.query;\n this.searchStore();\n }\n }\n}\n","import { render, staticRenderFns } from \"./StoreSearch.vue?vue&type=template&id=7c1ba706&\"\nimport script from \"./StoreSearch.vue?vue&type=script&lang=ts&\"\nexport * from \"./StoreSearch.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","import mod from \"-!../../../../../../../node_modules/ts-loader/index.js??clonedRuleSet-5[0].rules[0].use[0]!../../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./StoreSearch.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../../../../../node_modules/ts-loader/index.js??clonedRuleSet-5[0].rules[0].use[0]!../../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./StoreSearch.vue?vue&type=script&lang=ts&\"","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"stores__map\"},[(_vm.showSearch)?_c('ValidationObserver',{attrs:{\"slim\":\"\"},scopedSlots:_vm._u([{key:\"default\",fn:function(ref){\nvar handleSubmit = ref.handleSubmit;\nreturn [_c('div',{staticClass:\"search__container\"},[_c('form',{attrs:{\"enctype\":\"application/x-www-form-urlencoded\"},on:{\"submit\":function($event){$event.preventDefault();$event.stopPropagation();return handleSubmit(_vm.searchStore)}}},[_c('ValidationProvider',{attrs:{\"name\":_vm.$t('Postcode / city'),\"rules\":\"required\",\"skip-if-empty\":false,\"slim\":\"\"},scopedSlots:_vm._u([{key:\"default\",fn:function(ref){\nvar errors = ref.errors;\nvar classes = ref.classes;\nreturn [_c('div',{staticClass:\"form__container\"},[_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.searchQuery),expression:\"searchQuery\"}],class:classes,attrs:{\"type\":\"search\",\"name\":\"search\",\"placeholder\":_vm.$t('1234 AS / Amsterdam')},domProps:{\"value\":(_vm.searchQuery)},on:{\"input\":function($event){if($event.target.composing){ return; }_vm.searchQuery=$event.target.value}}}),_vm._v(\" \"),_c('button',{staticClass:\"--button --chevron\",attrs:{\"type\":\"submit\"}},[_vm._v(_vm._s(_vm.$t('Search store')))])]),_vm._v(\" \"),_c('span',{staticClass:\"global__message --error --margin--top\"},[_vm._v(_vm._s(_vm.$t(errors[0])))])]}}],null,true)})],1)])]}}],null,false,1302465723)}):_vm._e(),_vm._v(\" \"),(_vm.loading)?_c('span',{staticClass:\"--loading --small\"}):_vm._e(),_vm._v(\" \"),(_vm.showResults)?_c('div',{staticClass:\"stores__result\"},[_c('p',[_vm._v(_vm._s(_vm.$t('Search results for'))+\": \"),_c('strong',[_vm._v(_vm._s(_vm.resultQuery))])]),_vm._v(\" \"),_c('div',{staticClass:\"result__list\"},_vm._l((_vm.physicalStoresResult),function(store){return _c('a',{attrs:{\"href\":(_vm.route + \"/\" + (store['identifier']))}},[_vm._v(\"\\n \"+_vm._s(store['city'])+\" \"+_vm._s(store['distance'].toFixed(1))+\"KM\\n \")])}),0)]):_vm._e(),_vm._v(\" \"),(_vm.showMap)?_c('div',{staticClass:\"map__container\"},[_c('GmapMap',{attrs:{\"center\":_vm.mapCenter,\"zoom\":_vm.mapZoom,\"map-type-id\":\"terrain\",\"options\":_vm.mapOptions}},[_c('GmapInfoWindow',{attrs:{\"options\":_vm.infoOptions,\"position\":_vm.infoWindowPos,\"opened\":_vm.infoWinOpen},on:{\"closeclick\":function($event){_vm.infoWinOpen=false}}}),_vm._v(\" \"),_vm._l((_vm.physicalStores),function(store,index){return _c('GmapMarker',{key:index,attrs:{\"position\":{ lat: parseFloat(store['latitude']), lng: parseFloat(store['longitude']) },\"clickable\":true,\"draggable\":false,\"icon\":_vm.svgMarker,\"title\":store['name']},on:{\"click\":function($event){return _vm.redirectToStore(store['identifier'])},\"mouseover\":function($event){return _vm.toggleInfoWindow(store ,index)}}})})],2)],1):_vm._e()],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }"],"names":["extend","required","Vue","searchQuery","physicalStoresToShow","physicalStoresResult","updateMapCenter","mapZoom","showResults","resultQuery","loading","mapOptions","zoomControl","mapTypeControl","scaleControl","streetViewControl","rotateControl","fullscreenControl","disableDefaultUi","currentMidx","infoWindowPos","infoWinOpen","infoOptions","content","pixelOffset","width","height","svgMarker","mapCenter","this","lat","parseFloat","lng","center","forEach","store","length","toggleInfoWindow","marker","idx","latitude","longitude","name","street","number","number_addition","city","redirectToStore","identifier","window","location","href","route","searchStore","data","$solarClient","get","queryMatchesPhysicalStore","filter","toLowerCase","encodeURI","replace","created","physicalStores","zoom","query","Prop","Array","default","Component","components","ValidationProvider","ValidationObserver","render","_vm","_h","$createElement","_c","_self","staticClass","attrs","scopedSlots","_u","key","fn","ref","handleSubmit","on","$event","preventDefault","stopPropagation","$t","errors","classes","directives","rawName","value","expression","class","domProps","target","composing","_v","_s","_e","_l","toFixed","index","staticRenderFns"],"sourceRoot":""}