{"version":3,"sources":["webpack:///./src/views/account/darkstores/components/ZoneManagement.vue?58da","webpack:///./src/assets/markers/darkstore-dark-marker.png","webpack:///./src/views/account/darkstores/components/ZoneManagement.vue?1099","webpack:///./src/views/account/darkstores/components/ZoneManagement.vue","webpack:///./src/views/account/darkstores/components/ZoneManagement.vue?10fb","webpack:///./node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper.js","webpack:///./src/views/account/darkstores/components/ZoneManagement.vue?a5aa"],"names":["module","exports","_withScopeId","n","_pushScopeId","_popScopeId","_hoisted_1","class","_hoisted_2","_createElementVNode","id","_hoisted_3","key","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","render","_ctx","_cache","$props","$setup","$data","$options","_openBlock","_createElementBlock","confirm","_createTextVNode","_toDisplayString","$t","isAssign","zone","name","disabled","loading","onClick","$event","addAssignUnAssignHandler","polygon","_Fragment","_createCommentVNode","google","window","defineComponent","props","darkstore","type","Object","required","data","assignedZones","unAssignedZones","map","drawingManager","polygons","textOverlays","darkstoreMarker","methods","fetch","$store","dispatch","ZoneActions","FETCH_ZONES","pageSize","pageNumber","zones","filter","z","darkstores","some","ZoneModel","convertToMapPolygonFormat","every","init","keys","length","clearTextOverlays","clearPolygons","drawPolygons","initMap","$nextTick","_center","lat","this","latitude","lng","longitude","maps","Map","document","getElementById","center","zoom","fullscreenControl","mapTypeControl","icon","url","require","size","Size","origin","Point","anchor","Marker","position","LatLng","zIndex","coordinatesGroup","isAssigned","coordinates","Polygon","paths","editable","draggable","fillColor","fillOpacity","strokeWeight","addTextOverlay","addListeners","push","updatePolygon","setOptions","removeListeners","text","path","getPath","getArray","bounds","LatLngBounds","point","extend","getCenter","emptyImage","scaledSize","marker","label","color","className","fontSize","fontWeight","toRaw","setMap","overlay","getCoordinatesCenter","allZoneCoordinates","coordinate","latLng","centerMap","setCenter","event","addListener","showConfirm","clearListeners","payload","zone_id","dark_store_id","action","UN_ASSIGN_ZONE_TO_DARKSTORE","ASSIGN_ZONE_TO_DARKSTORE","then","finally","computed","getters","created","__exports__","_createForOfIteratorHelper","o","allowArrayLike","it","Symbol","iterator","Array","isArray","unsupportedIterableToArray","i","F","s","done","value","e","_e","f","TypeError","err","normalCompletion","didErr","call","step","next","_e2"],"mappings":"gKAAA,W,mBCAAA,EAAOC,QAAU,0wI,qECEXC,EAAe,SAAAC,GAAC,OAAKC,yBAAa,mBAAmBD,EAAEA,IAAIE,0BAAcF,GACzEG,EAAa,CAAEC,MAAO,qBACtBC,EAA2BN,GAAa,kBAAmBO,gCAAoB,MAAO,CAC1FC,GAAI,gCACJH,MAAO,+BACN,MAAO,MACJI,EAAa,CACjBC,IAAK,EACLL,MAAO,2CAEHM,EAAa,CAAEN,MAAO,2EACtBO,EAAa,CAAEP,MAAO,gCACtBQ,EAAa,CAAER,MAAO,kCACtBS,EAAa,CAAC,YACdC,EAAa,CAAC,YAEd,SAAUC,EAAOC,EAAUC,EAAYC,EAAYC,EAAYC,EAAWC,GAC9E,OAAQC,yBAAcC,gCAAoB,MAAOpB,EAAY,CAC3DE,EACCW,EAAKQ,SACDF,yBAAcC,gCAAoB,MAAOf,EAAY,CACpDF,gCAAoB,MAAOI,EAAY,CACrCJ,gCAAoB,MAAOK,EAAY,CACrCc,6BAAiBC,6BAAiBV,EAAKW,GAAGX,EAAKQ,QAAQI,SAAW,iCAAmC,8BAA+B,CAACZ,EAAKQ,QAAQK,KAAKC,QAAU,IAAK,GACtKxB,gCAAoB,MAAOM,EAAY,CACrCN,gCAAoB,SAAU,CAC5BF,MAAO,yBACP2B,SAAUf,EAAKgB,QACfC,QAAShB,EAAO,KAAOA,EAAO,GAAK,SAACiB,GAAD,OAAkBlB,EAAKmB,yBAAyBnB,EAAKQ,QAAQY,QAASpB,EAAKQ,QAAQK,KAAMb,EAAKQ,QAAQI,aACxI,CACAZ,EAAKgB,SACDV,yBAAcC,gCAAoBc,cAAW,CAAE5B,IAAK,GAAK,CACxDgB,6BAAiBC,6BAAiBV,EAAKW,G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,WAEN,OAAOkB,KAAKxB,OAAOuG,QAAQ,mBAE7BlB,mBAJQ,WAKN,OAAO7D,KAAKlB,MAAMb,KAAI,SAACe,GACrB,sBACKG,OAAUC,0BAA0BJ,EAAE7B,eAKjD6H,QA7N6B,WA8N3BhF,KAAKV,U,2CC/NT,MAAM2F,EAA2B,IAAgB,EAAQ,CAAC,CAAC,SAASnJ,GAAQ,CAAC,YAAY,qBAE1E,gB,0JCTA,SAASoJ,EAA2BC,EAAGC,GACpD,IAAIC,EAAuB,qBAAXC,QAA0BH,EAAEG,OAAOC,WAAaJ,EAAE,cAElE,IAAKE,EAAI,CACP,GAAIG,MAAMC,QAAQN,KAAOE,EAAKK,eAA2BP,KAAOC,GAAkBD,GAAyB,kBAAbA,EAAE3F,OAAqB,CAC/G6F,IAAIF,EAAIE,GACZ,IAAIM,EAAI,EAEJC,EAAI,aAER,MAAO,CACLC,EAAGD,EACH7K,EAAG,WACD,OAAI4K,GAAKR,EAAE3F,OAAe,CACxBsG,MAAM,GAED,CACLA,MAAM,EACNC,MAAOZ,EAAEQ,OAGbK,EAAG,SAAWC,GACZ,MAAMA,GAERC,EAAGN,GAIP,MAAM,IAAIO,UAAU,yIAGtB,IAEIC,EAFAC,GAAmB,EACnBC,GAAS,EAEb,MAAO,CACLT,EAAG,WACDR,EAAKA,EAAGkB,KAAKpB,IAEfpK,EAAG,WACD,IAAIyL,EAAOnB,EAAGoB,OAEd,OADAJ,EAAmBG,EAAKV,KACjBU,GAETR,EAAG,SAAWU,GACZJ,GAAS,EACTF,EAAMM,GAERR,EAAG,WACD,IACOG,GAAoC,MAAhBhB,EAAG,WAAmBA,EAAG,YADpD,QAGE,GAAIiB,EAAQ,MAAMF,O,kCCpD1B","file":"js/chunk-0483bb8a.bf6f8bda.js","sourcesContent":["export * from \"-!../../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--7-oneOf-1-0!../../../../../node_modules/css-loader/dist/cjs.js??ref--7-oneOf-1-1!../../../../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/src/index.js??ref--7-oneOf-1-2!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader-v16/dist/index.js??ref--1-1!./ZoneManagement.vue?vue&type=style&index=1&id=13d11eef&lag=scss&scoped=true&lang=css\"","module.exports = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC4AAABLCAYAAAAPgLXeAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAxJSURBVHgB7VtbbBzVGT5nZnZn13ZiJyEXubTZpJXiXAmSkUqpxDpIbRRVkFA5VAJKQngg9IFEBVp6s02hKpeKuA8kDwQMAanBqJQoLTRSvcsDqBKRMHHi2OqFRVWRDQEcfNndufb/zuysZ9czu7O7BrVSP2m8s3M5853/fP/lnFlztojo6EgmTIm1KbKc4MxuwzGb8SnbNqdyM2w4k0lPsUUCZw0gkUi2NS+V9tk2u15iLGkz1sYqP2zKYixNu69aupUeG0tnWJ2oi3jHlmRS5ryHbk+yhmCnaUSeGx0ZGmA1oibi1QgvWdLCvtS+mrXThn3ggw8mxefY+D/Y9PRMUNMZi/HDF0f+8gcWEqGIQxItS6RnSQq7y89d07mNdXVdx3bQBsKVME7k0YFTp86wt8++63fJgKlbfWEkVJX4pk3J7VyWXgF/9xisedute2j7Lu03s3qAkTh67Hk2lHqrfCQytmntGR1ND7N6iW/elryD2dKA99htt97MDt79/boJl8PtwKs0CqXMrH0XzqWfC7pPDjpRThpWPvbUr1h393eYqkbZYgHtQmYbNnyVnRsZ81if7161Zm3mo8mMr6Z8Lb5x6w27JWa/4n5vb1/Dnnn6iaoabhSw/p133UefE/MHAyy/gDiSiBKR3nFj8oYNXxOka5XG+PjfhTXR6VoAi4M8HLmAKXLYq8sdViq/UY5IKZc0Htr/ZG9NpPHgo8dOsO5bDrKdu24X+7UAne1/ss/b4TZw2r49WZLcSiy+ZduOHsqCvW4D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KybBmT6YF0jMuxmEU+p3FdV7gsa4W244z81opGDduy4mZWzllNVou5dCkzW1tbDXJgIx6Pm2+88YYVxinrIh7UGcRsitWiPeoYp7fHxXanyTnwmUzi/5toAaUPcZ01HNf/AxUBPPNHIGq9AAAAAElFTkSuQmCC\"","import { createElementVNode as _createElementVNode, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-13d11eef\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"zone-map relative\" }\nconst _hoisted_2 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", {\n id: \"darkstore-zone-management-map\",\n class: \"w-full h-full overflow-auto\"\n}, null, -1))\nconst _hoisted_3 = {\n key: 0,\n class: \"w-full h-full absolute top-0 confirm-bg\"\n}\nconst _hoisted_4 = { class: \"absolute custom-assign-confirm p-4 shadow-lg border rounded-lg bg-white\" }\nconst _hoisted_5 = { class: \"text-lg text-black font-bold\" }\nconst _hoisted_6 = { class: \"flex justify-center gap-4 mt-4\" }\nconst _hoisted_7 = [\"disabled\"]\nconst _hoisted_8 = [\"disabled\"]\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _hoisted_2,\n (_ctx.confirm)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_3, [\n _createElementVNode(\"div\", _hoisted_4, [\n _createElementVNode(\"div\", _hoisted_5, [\n _createTextVNode(_toDisplayString(_ctx.$t(_ctx.confirm.isAssign ? 'zones.do_you_want_to_un_assign' : 'zones.do_you_want_to_assign', [_ctx.confirm.zone.name])) + \" \", 1),\n _createElementVNode(\"div\", _hoisted_6, [\n _createElementVNode(\"button\", {\n class: \"primary h-10 px-5 ml-4\",\n disabled: _ctx.loading,\n onClick: _cache[0] || (_cache[0] = ($event: any) => (_ctx.addAssignUnAssignHandler(_ctx.confirm.polygon, _ctx.confirm.zone, _ctx.confirm.isAssign)))\n }, [\n (_ctx.loading)\n ? (_openBlock(), _createElementBlock(_Fragment, { key: 0 }, [\n _createTextVNode(_toDisplayString(_ctx.$t('buttons.processing')), 1)\n ], 64))\n : (_openBlock(), _createElementBlock(_Fragment, { key: 1 }, [\n _createTextVNode(_toDisplayString(_ctx.$t(_ctx.confirm.isAssign ? 'buttons.yesUnassign' : 'buttons.yesAssign')), 1)\n ], 64))\n ], 8, _hoisted_7),\n _createElementVNode(\"button\", {\n disabled: _ctx.loading,\n class: \"tertiary h-10 px-5 ml-4\",\n onClick: _cache[1] || (_cache[1] = ($event: any) => (_ctx.confirm = null))\n }, _toDisplayString(_ctx.$t('cancel')), 9, _hoisted_8)\n ])\n ])\n ])\n ]))\n : _createCommentVNode(\"\", true)\n ]))\n}","\nimport { defineComponent, PropType, toRaw } from 'vue'\nimport { DarkStoreInterface } from '@/shared/interfaces/darkstore.interface'\nimport { ZoneActions } from '@/store/modules/zones/actions'\nimport { ZoneInterface } from '@/shared/interfaces/zone.interface'\nimport { ZoneModel } from '@/shared/models/zone.model'\n\nconst google = window.google\n\nexport default defineComponent({\n name: 'ZoneManagement',\n props: {\n darkstore: {\n type: Object as PropType,\n required: true\n }\n },\n data () {\n return {\n assignedZones: [] as any,\n unAssignedZones: [] as any,\n map: {} as any,\n drawingManager: {} as any,\n polygons: [] as any,\n textOverlays: [] as any[],\n confirm: null as any,\n loading: false,\n darkstoreMarker: null as any\n }\n },\n methods: {\n async fetch () {\n await this.$store.dispatch(`zones/${ZoneActions.FETCH_ZONES}`, { pageSize: 9999, pageNumber: 1 })\n this.assignedZones = this.zones.filter((z:ZoneInterface) => z.darkstores\n .some((darkstore:DarkStoreInterface) => darkstore.id === this.darkstore.id))\n .map((z: ZoneInterface) => {\n return {\n polygons: ZoneModel.convertToMapPolygonFormat(z.polygon),\n zone: z\n }\n })\n\n this.unAssignedZones = this.zones.filter((z:ZoneInterface) => z.darkstores\n .every((darkstore:DarkStoreInterface) => darkstore.id !== this.darkstore.id))\n .map((z: ZoneInterface) => {\n return {\n polygons: ZoneModel.convertToMapPolygonFormat(z.polygon),\n zone: z\n }\n })\n },\n async init () {\n await this.fetch()\n if (Object.keys(this.map).length) {\n this.clearTextOverlays()\n this.clearPolygons()\n this.drawPolygons(this.assignedZones, true)\n this.drawPolygons(this.unAssignedZones)\n } else {\n this.initMap()\n this.$nextTick(() => {\n this.clearTextOverlays()\n this.clearPolygons()\n this.drawPolygons(this.assignedZones, true)\n this.drawPolygons(this.unAssignedZones)\n // this.centerMap() // center of all of the zones\n })\n }\n },\n initMap () {\n // const _center = this.allZoneCoordinates.length ? this.getCoordinatesCenter() : null\n const _center = { lat: this.darkstore.latitude, lng: this.darkstore.longitude } // center is darkstore\n // create a map\n this.map = new google.maps.Map(document.getElementById('darkstore-zone-management-map')!, {\n center: _center || { lat: 33.312805, lng: 44.361488 },\n zoom: 12,\n fullscreenControl: false,\n mapTypeControl: false\n })\n\n // init darkstore marker\n if (this.darkstoreMarker == null) {\n const icon = {\n url: require('../../../../assets/markers/darkstore-dark-marker.png'),\n size: new google.maps.Size(55, 70),\n origin: new google.maps.Point(0, 0),\n anchor: new google.maps.Point(22, 67)\n }\n this.darkstoreMarker = new google.maps.Marker({\n position: new google.maps.LatLng(this.darkstore.latitude, this.darkstore.longitude),\n map: this.map,\n icon,\n zIndex: 9999\n })\n }\n },\n drawPolygons (coordinatesGroup:any, isAssigned = false) {\n for (const coordinates of coordinatesGroup) {\n const polygon = new google.maps.Polygon({\n paths: coordinates.polygons,\n editable: false,\n draggable: false,\n map: this.map,\n zIndex: 100,\n fillColor: isAssigned ? '#13fb03' : '#000',\n fillOpacity: isAssigned ? 0.5 : 0.35,\n strokeWeight: 1.5\n })\n this.addTextOverlay(polygon, coordinates.zone.name)\n this.addListeners(polygon, isAssigned, coordinates.zone)\n this.polygons.push(polygon)\n }\n },\n updatePolygon (polygon: any, isAssigned: boolean, zone: ZoneInterface) {\n polygon.setOptions({\n fillColor: isAssigned ? '#13fb03' : '#000',\n fillOpacity: isAssigned ? 0.5 : 0.35\n })\n this.removeListeners(polygon)\n this.addListeners(polygon, isAssigned, zone)\n },\n addTextOverlay (polygon: any, text: string) {\n const path = polygon.getPath().getArray()\n const bounds = new google.maps.LatLngBounds()\n for (const point of path) {\n bounds.extend(point)\n }\n\n const center = bounds.getCenter()\n\n // 1p x 1px empty transparent image\n const emptyImage = 'data:image/png;base64,' + 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII='\n const icon = {\n url: emptyImage,\n scaledSize: new google.maps.Size(50, 50), // scaled size\n origin: new google.maps.Point(0, 0), // origin\n anchor: new google.maps.Point(0, 0) // anchor\n }\n\n const marker = new google.maps.Marker({\n position: center,\n map: this.map,\n icon,\n label: {\n text,\n color: 'black',\n className: 'google-map-zone-label',\n fontSize: '11px',\n fontWeight: 'bold'\n },\n zIndex: 9999\n })\n this.textOverlays.push(marker)\n },\n clearPolygons () {\n // remove all polygons\n for (const polygon of this.polygons) {\n this.removeListeners(polygon)\n toRaw(polygon).setMap(null)\n polygon.setMap(null)\n }\n this.polygons = []\n },\n clearTextOverlays () {\n // remove all overlays\n for (const overlay of this.textOverlays) {\n toRaw(overlay).setMap(null)\n overlay.setMap(null)\n }\n this.textOverlays = []\n },\n getCoordinatesCenter () {\n if (!this.allZoneCoordinates.length) return false\n const bounds = new google.maps.LatLngBounds()\n for (const coordinates of this.allZoneCoordinates) {\n for (const coordinate of coordinates) {\n const latLng = new google.maps.LatLng(coordinate.lat, coordinate.lng)\n bounds.extend(latLng)\n }\n }\n return bounds.getCenter()\n },\n centerMap () {\n const center = this.getCoordinatesCenter()\n this.map.setCenter(center)\n },\n addListeners (polygon:any, isAssigned = true, zone: ZoneInterface) {\n google.maps.event.addListener(polygon, 'click', () => {\n this.showConfirm(polygon, zone, isAssigned)\n })\n },\n removeListeners (polygon:any) {\n google.maps.event.clearListeners(polygon, 'click')\n },\n showConfirm (polygon: any, zone: ZoneInterface, isAssign: boolean) {\n this.confirm = {\n polygon,\n zone,\n isAssign\n }\n },\n addAssignUnAssignHandler (polygon: any, zone: ZoneInterface, isAssign: boolean) {\n this.loading = true\n const payload = {\n zone_id: zone.id,\n dark_store_id: this.darkstore.id\n }\n const action = !isAssign ? ZoneActions.ASSIGN_ZONE_TO_DARKSTORE : ZoneActions.UN_ASSIGN_ZONE_TO_DARKSTORE\n this.$store.dispatch(`zones/${action}`, payload)\n .then(() => {\n this.updatePolygon(polygon, !isAssign, zone)\n this.confirm = null\n })\n .finally(() => {\n this.loading = false\n })\n }\n },\n computed: {\n zones (): ZoneInterface[] {\n return this.$store.getters['zones/getZones']\n },\n allZoneCoordinates () {\n return this.zones.map((z: ZoneInterface) => {\n return [\n ...ZoneModel.convertToMapPolygonFormat(z.polygon)\n ]\n })\n }\n },\n created () {\n this.init()\n }\n})\n","import { render } from \"./ZoneManagement.vue?vue&type=template&id=13d11eef&scoped=true&ts=true\"\nimport script from \"./ZoneManagement.vue?vue&type=script&lang=ts\"\nexport * from \"./ZoneManagement.vue?vue&type=script&lang=ts\"\n\nimport \"./ZoneManagement.vue?vue&type=style&index=0&id=13d11eef&lag=scss&lang=css\"\nimport \"./ZoneManagement.vue?vue&type=style&index=1&id=13d11eef&lag=scss&scoped=true&lang=css\"\n\nimport exportComponent from \"/usr/src/app/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-13d11eef\"]])\n\nexport default __exports__","import unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nexport default function _createForOfIteratorHelper(o, allowArrayLike) {\n var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"];\n\n if (!it) {\n if (Array.isArray(o) || (it = unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") {\n if (it) o = it;\n var i = 0;\n\n var F = function F() {};\n\n return {\n s: F,\n n: function n() {\n if (i >= o.length) return {\n done: true\n };\n return {\n done: false,\n value: o[i++]\n };\n },\n e: function e(_e) {\n throw _e;\n },\n f: F\n };\n }\n\n throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n }\n\n var normalCompletion = true,\n didErr = false,\n err;\n return {\n s: function s() {\n it = it.call(o);\n },\n n: function n() {\n var step = it.next();\n normalCompletion = step.done;\n return step;\n },\n e: function e(_e2) {\n didErr = true;\n err = _e2;\n },\n f: function f() {\n try {\n if (!normalCompletion && it[\"return\"] != null) it[\"return\"]();\n } finally {\n if (didErr) throw err;\n }\n }\n };\n}","export * from \"-!../../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--7-oneOf-1-0!../../../../../node_modules/css-loader/dist/cjs.js??ref--7-oneOf-1-1!../../../../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/src/index.js??ref--7-oneOf-1-2!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/vue-loader-v16/dist/index.js??ref--1-1!./ZoneManagement.vue?vue&type=style&index=0&id=13d11eef&lag=scss&lang=css\""],"sourceRoot":""}