(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2e9adfaf"],{"0212":function(e,t,n){"use strict";n.r(t);var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticStyle:{position:"relative"}},[n("vehicle-card",{on:{vehicleSelected:e.onVehicleSelected}}),n("div",{attrs:{id:"map"}})],1)},i=[],o=(n("d81d"),function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"vehicle-card"},[n("div",{staticClass:"vehicle-card__search"},[n("v-select",{staticClass:"search-vehicle",attrs:{placeholder:"Sök på reg.nr",options:e.vehicles,reduce:function(e){return e.licencePlate},label:"licencePlate"},on:{input:e.getVehicleLocation},scopedSlots:e._u([{key:"no-options",fn:function(){return[e._v("Inga tillgängliga val.")]},proxy:!0}])})],1),e.address?n("div",{staticClass:"mt-4 vehicle-location"},[e._v(" "+e._s(e.address)+" ")]):e._e()])}),c=[],a=n("1da1"),u=(n("4de4"),n("96cf"),n("bb26")),s={data:function(){return{vehicles:[],address:null}},computed:{isCompanyAdmin:function(){return this.$store.getters.isCompanyAdmin},userEmail:function(){return this.$store.state.user.email}},methods:{getVehicleLocation:function(e){var t=this;return Object(a["a"])(regeneratorRuntime.mark((function n(){var r;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,u["a"].getCurrentLocation(e);case 3:r=n.sent,t.$emit("vehicleSelected",r),t.address=r.address,n.next=10;break;case 8:n.prev=8,n.t0=n["catch"](0);case 10:case"end":return n.stop()}}),n,null,[[0,8]])})))()}},created:function(){var e=this;return Object(a["a"])(regeneratorRuntime.mark((function t(){var n,r,i;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,n=e.isCompanyAdmin?null:"bound",t.next=4,u["a"].getVehicles({boxBindStatus:"bound",bindStatus:n});case 4:r=t.sent,i=r.vehicles,e.vehicles=i,e.isCompanyAdmin&&(e.vehicles=e.vehicles.filter((function(t){return e.userEmail===t.user.email||"private"!==t.vehicleCategory}))),t.next=12;break;case 10:t.prev=10,t.t0=t["catch"](0);case 12:case"end":return t.stop()}}),t,null,[[0,10]])})))()}},l=s,f=(n("9fb1"),n("89d3"),n("2877")),d=Object(f["a"])(l,o,c,!1,null,"207f0aed",null),p=d.exports;function v(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t){for(var n=0;n
'})},fitBounds:function(e,t){var n=new google.maps.LatLngBounds;n.extend(new google.maps.LatLng(e,t)),this.map.fitBounds(n),this.map.setZoom(13)}},mounted:function(){this.initMap(document.getElementById("map"))}},S=_,L=(n("ad53"),n("5292"),Object(f["a"])(S,r,i,!1,null,"0af0e62c",null));t["default"]=L.exports},"0538":function(e,t,n){"use strict";var r=n("1c0b"),i=n("861d"),o=[].slice,c={},a=function(e,t,n){if(!(t in c)){for(var r=[],i=0;i0&&void 0!==arguments[0]?arguments[0]:{},t=e.bindStatus,n=void 0===t?null:t,r=e.limit,i=void 0===r?null:r,c=e.page,a=void 0===c?null:c,u=e.search,s=void 0===u?null:u,l=e.company,f=void 0===l?null:l,d=e.boxBindStatus,p=void 0===d?null:d,v=e.includeDeleted,h=void 0===v?null:v;return a=a?a-1:null,o.a.get("/vehicles",{params:{bindStatus:n,limit:i,skip:a,search:s,company:f,boxBindStatus:p,includeDeleted:h}})},addVehicle:function(e){return o.a.post("/vehicles",Object(r["a"])({},e))},updateVehicle:function(e){return o.a.put("/vehicles",e)},deleteVehicle:function(e){return o.a.delete("/vehicles/".concat(e))},getMakers:function(){return o.a.get("/vehiclecodebook/make")},getModelsForMake:function(e){return o.a.get("/vehiclecodebook/make/".concat(e,"/model"))},getCurrentLocation:function(e){return o.a.get("vehicles/".concat(e,"/current-location"))}}},d81d:function(e,t,n){"use strict";var r=n("23e7"),i=n("b727").map,o=n("1dde"),c=o("map");r({target:"Array",proto:!0,forced:!c},{map:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},e2c0:function(e,t,n){},fbcf:function(e,t,n){}}]); //# sourceMappingURL=chunk-2e9adfaf.e842a948.js.map