(this["webpackJsonpocpp-cs"]=this["webpackJsonpocpp-cs"]||[]).push([[8],{1339:function(e,t,n){"use strict";n.r(t);var a=n(9),r=n(27),i=n(22),c=n(21),o=n(29),s=n(30),l=n(870),d=n(745),u=n(844),p=n(0),h=n.n(p),g=n(112),f=n(210),b=n(53),m=n(823),j=n(99),v=n(111),O=n(179),x=n(784),y=n(778),w=n(3),k=n(7),S=n(32),C=n(447),I=n(802),P=n(803),L=n(834),N=n(144),E=(n(833),n(189)),T=n(773),q=n(875),D=n(775),K=n(2);D.a.tick();var F=function(e){Object(o.a)(n,e);var t=Object(s.a)(n);function n(e){var c;return Object(i.a)(this,n),(c=t.call(this,e)).m=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"stations.";return c.props.intl.formatMessage({id:t+e})},c.pendingStart=function(){c.props.onPendingStart?c.props.onPendingStart():c.setState({pending:!0})},c.pendingEnd=function(){c.props.onPendingEnd?c.props.onPendingEnd():c.setState({pending:!1})},c.load=Object(r.a)(Object(a.a)().mark((function e(){var t,n,r,i,o,s;return Object(a.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!c.props.stationId){e.next=13;break}return c.pendingStart(),t=[c.context.api.q("/charge_point/get",{id:c.props.stationId}),c.context.api.q("/object/access/decode",{id:c.props.stationId}),c.context.api.q("/object/file",{id:c.props.stationId},{toArray:!0})],e.next=5,Promise.allSettled(t);case 5:n=e.sent.map((function(e){return e.value})),r=Object(k.a)(n,3),i=r[0],o=r[1],s=r[2],c.setState({item:i,access:o,files:s},(function(){return c.pendingEnd()})),e.next=14;break;case 13:c.setState({item:{},access:{},files:[]});case 14:case"end":return e.stop()}}),e)}))),c.chargeToggle=Object(r.a)(Object(a.a)().mark((function e(){var t,n,r=arguments;return Object(a.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t=r.length>0&&void 0!==r[0]?r[0]:{}).id){e.next=16;break}if(c.setState({detailPending:!0}),n=!1,!t.charging){e.next=10;break}return e.next=7,c.context.api.q("/connector/remote/stop",{id:t.id});case 7:n=e.sent,e.next=13;break;case 10:return e.next=12,c.context.api.q("/connector/remote/start",{id:t.id});case 12:n=e.sent;case 13:c.setState({detailPending:!1}),!1===n?C.b.error(c.m("method.fail","")):C.b.success(c.m("method.success","")),c.load();case 16:case"end":return e.stop()}}),e)}))),c.reserveToggle=Object(r.a)(Object(a.a)().mark((function e(){var t,n,r=arguments;return Object(a.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t=r.length>0&&void 0!==r[0]?r[0]:{}).id){e.next=16;break}if(c.setState({detailPending:!0}),n=!1,!t.reserved){e.next=10;break}return e.next=7,c.context.api.q("/connector/reserve/cancel",{id:t.id});case 7:n=e.sent,e.next=13;break;case 10:return e.next=12,c.context.api.q("/connector/reserve/now",{id:t.id});case 12:n=e.sent;case 13:c.setState({detailPending:!1}),!1===n?C.b.error(c.m("method.fail","")):C.b.success(c.m("method.success","")),c.load();case 16:case"end":return e.stop()}}),e)}))),c.state={detailPending:!1,pending:!1,stationId:!1,item:{},access:{},files:[]},c}return Object(c.a)(n,[{key:"componentDidMount",value:function(){this.load()}},{key:"componentDidUpdate",value:function(e){var t=this;e.stationId===this.props.stationId&&e.intl.locale===this.props.intl.locale||this.setState({item:{}},(function(){return t.load()}))}},{key:"render",value:function(){var e=this,t=this.state,n=t.pending,a=t.item,r=t.access,i=t.files,c=a.connectors||[],o=function(t){var n=t.item,a=t.property,r=t.connected,i=null===n||void 0===n?void 0:n[a];return"string"===typeof i?"lastupdate"!==a&&"created"!==a&&"connectionupdate"!==a||(i=new Date(i).toLocaleString()):"boolean"===typeof i&&(i=i?e.m("true"):e.m("false")),i?Object(K.jsxs)(I.a,{gutter:[16,16],className:"gx-mb-2",children:[Object(K.jsx)(P.a,{className:"gx-text-muted gx-font-weight-light gx-pr-2",xs:10,children:"connectionupdate"===a?r?e.m(a):e.m("disconnected"):e.m(a)}),Object(K.jsx)(P.a,{xs:14,children:i})]}):null};return Object(K.jsx)("div",{children:Object(K.jsxs)(L.a,{spinning:n,children:[!(null!==a&&void 0!==a&&a.id)&&Object(K.jsx)(l.a,{}),(null===a||void 0===a?void 0:a.id)&&Object(K.jsxs)("div",{className:"gx-mb-3",children:[(null===a||void 0===a?void 0:a.description)&&Object(K.jsx)("div",{className:"gx-text-muted gx-font-weight-light gx-mb-3",children:a.description}),Object(K.jsxs)(E.a,{between:!0,className:"gx-mb-3 gx-pr-1",children:[Object(K.jsx)("h4",{children:this.m("details")}),Object(K.jsx)(T.a,Object(w.a)(Object(w.a)({},a),{},{readOnly:!(null!==r&&void 0!==r&&r.u),onFinish:this.load}))]}),["identity","modelname","vendorname","serialnumber","boxserialnumber","iccid","imsi","networkname","connected","connectionupdate","lastupdate"].map((function(e){return Object(K.jsx)(o,{item:a,property:e,connected:a.connected},e)})),c.length>0&&Object(K.jsx)(K.Fragment,{children:Object(K.jsxs)(L.a,{spinning:this.state.detailPending,children:[Object(K.jsx)("hr",{}),c.map((function(t,n){return Object(K.jsx)("div",{className:"gx-mb-2",children:Object(K.jsxs)(E.a,{between:!0,children:[Object(K.jsxs)("div",{children:[t.chargername,Object(K.jsx)("div",{className:"gx-font-weight-light gx-text-small gx-text-muted",children:t.chargerdescription})]}),Object(K.jsxs)("div",{className:"gx-ml-2 gx-mr-1",children:[Object(K.jsx)(T.a,Object(w.a)(Object(w.a)({},t),{},{readOnly:!0,onFinish:e.load})),Object(K.jsx)("div",{style:{whiteSpace:"nowrap"},children:Object(K.jsx)(q.a,Object(w.a)(Object(w.a)({m:e.m},t),{},{chargeToggle:function(n){return e.chargeToggle(t,n)},reserveToggle:function(n){return e.reserveToggle(t,n)}}))})]})]})},n)}))]})}),(null===r||void 0===r?void 0:r.u)&&Object(K.jsx)(S.a,{to:"/crm/station/".concat(a.id),children:Object(K.jsx)(N.a,{className:"gx-mb-0 gx-mt-4",children:this.m("edit","")})}),i.length>0&&Object(K.jsxs)(K.Fragment,{children:[Object(K.jsx)("hr",{}),i.map((function(e,t){return Object(K.jsx)("img",{alt:"",src:e.link},t)}))]})]})]})})}}]),n}(h.a.Component);F.contextType=v.a;var A=Object(b.i)(Object(f.c)(F)),G=(n(835),function(e){Object(o.a)(n,e);var t=Object(s.a)(n);function n(e){var c;return Object(i.a)(this,n),(c=t.call(this,e)).pendingStart=function(){c.props.onPendingStart?c.props.onPendingStart():c.setState({pending:!0})},c.pendingEnd=function(){c.props.onPendingEnd?c.props.onPendingEnd():c.setState({pending:!1})},c.m=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"stations.map.";return c.props.intl.formatMessage({id:t+e})},c.setParams=function(){var e=c.props.match.params,t=e.param1,n=e.param2;c.setState({carId:t,chargerId:n},(function(){return c.load()}))},c.load=Object(r.a)(Object(a.a)().mark((function e(){var t,n;return Object(a.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c.pendingStart(),t=[],c.state.chargerId&&t.push({field:"connectors",compare:"GIN",value:[{charger:c.state.chargerId}]}),e.next=5,c.context.api.q("/charge_point/list",{search:t},{toArray:!0});case 5:n=e.sent,c.setState({stations:n},(function(){return c.pendingEnd()}));case 7:case"end":return e.stop()}}),e)}))),c.getItemGeo=function(e){var t,n=(null===e||void 0===e||null===(t=e.geo)||void 0===t?void 0:t[0])||{},a=n.latitude,r=n.longitude;return a&&r?[a,r]:null},c.drawerClose=function(){c.setState({drawerVisible:!1})},c.onPlacemarkClick=function(e){c.setState({drawerItem:e,drawerVisible:!0})},c.config=window.appConfig||{mapLanguage:"ru_RU"},c.state={mapLoaded:!1,pending:!1,stations:[],carId:!1,chargerId:!1,drawerVisible:!1,drawerItem:{}},c}return Object(c.a)(n,[{key:"componentDidMount",value:function(){this.setParams(),this.load()}},{key:"componentDidUpdate",value:function(e){Object(x.a)(e,this.props)&&this.setParams(),e.intl.locale!==this.props.intl.locale&&this.load()}},{key:"render",value:function(){var e=this,t=this.state,n=t.stations,a=t.mapLoaded,r=t.pending,i=t.drawerItem;window.appConfig.mapDefaultCenter;if(!Array.isArray(n))return null;if(0===n.length)return Object(K.jsx)(l.a,{});var c=n.map((function(t){return e.getItemGeo(t)})).filter((function(e){return e}));if(0===c.length)return Object(K.jsx)("div",{className:this.props.className,children:Object(K.jsx)(l.a,{})});var o=h.a.createRef(),s=this.config.mapLanguage;return Object(K.jsxs)(K.Fragment,{children:[(!a||r)&&Object(K.jsx)(j.a,{}),Object(K.jsx)(d.a,{title:null===i||void 0===i?void 0:i.label,placement:"right",onClose:this.drawerClose,visible:this.state.drawerVisible,children:Object(K.jsx)(O.a,{children:Object(K.jsx)(A,{stationId:null===i||void 0===i?void 0:i.id})})}),Object(K.jsx)(g.a,{children:Object(K.jsx)("title",{children:this.m("stations")})}),Object(K.jsxs)("div",{className:"gx-st-map huge",style:{visibility:a&&!r?"visible":"hidden"},children:[Object(K.jsx)("div",{className:"filterbox",children:Object(K.jsx)(u.a,{size:"small",children:Object(K.jsx)(y.a,{value:this.state.carId,placeholder:this.m("forcar"),formatLabel:function(e){return"".concat(e.label," ").concat(e.identity)},extraFields:["identity","chargerac"],enabledOnly:!0,labelKey:"label",query:"/car/list",onChange:function(t,n){e.props.history.push("/driver/stations/".concat(t,"/").concat(n.chargerac||""))}})})}),Object(K.jsx)(m.c,{query:{lang:s},children:Object(K.jsxs)(m.a,{defaultState:{center:c[0]||[50.85045,4.34878],zoom:9},width:"100%",height:"100%",modules:["geoObject.addon.balloon","util.bounds"],onLoad:function(t){e.setState({mapLoaded:!0}),c.length>1&&o.current.setBounds(t.util.bounds.fromPoints(c))},instanceRef:function(e){e&&(o.current=e)},children:[0!==n.length?n.map((function(t,n){var a=e.getItemGeo(t);if(!a)return null;var r=[];return t.description&&r.push("<div>".concat(t.description||"","</div>")),t.modelname&&r.push("<div>".concat(t.modelname||""," ").concat(t.vendorname||"","</div>")),Object(K.jsx)(m.b,{defaultGeometry:a,onClick:function(){return e.onPlacemarkClick(t)},options:{iconLayout:"default#image",iconImageHref:"/assets/images/images-32-removebg-preview.png",iconImageSize:[32,32]}},n)})):[],Object(K.jsx)(m.d,{})]})},s)]})]})}}]),n}(h.a.Component));G.contextType=v.a;t.default=Object(b.i)(Object(f.c)(G))},773:function(e,t,n){"use strict";var a=n(9),r=n(27),i=n(22),c=n(21),o=n(29),s=n(30),l=n(744),d=n(447),u=n(776),p=n(310),h=n(834),g=n(210),f=n(0),b=n.n(f),m=n(111),j=n(158),v=n(775),O=n(2),x=l.a.confirm,y=function(e){Object(o.a)(n,e);var t=Object(s.a)(n);function n(e){var c;return Object(i.a)(this,n),(c=t.call(this,e)).popoverToggle=function(){c.setState((function(e){return{popoverOpen:!e.popoverOpen,methods:e.popoverOpen?e.methods:[]}}),(function(){return c.load()}))},c.pendingStart=function(){c.props.onPendingStart?c.props.onPendingStart():c.setState({pending:!0})},c.pendingEnd=function(){c.props.onPendingEnd?c.props.onPendingEnd():c.setState({pending:!1})},c.load=Object(r.a)(Object(a.a)().mark((function e(){var t;return Object(a.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!c.state.popoverOpen){e.next=6;break}return c.pendingStart(),e.next=4,c.context.api.q("/".concat(c.props.classcode,"/method"),{id:c.props.id},{toArray:!0});case 4:t=e.sent,c.setState({methods:t},(function(){return c.pendingEnd()}));case 6:case"end":return e.stop()}}),e)}))),c.run=function(){var e=Object(r.a)(Object(a.a)().mark((function e(t){var n;return Object(a.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c.pendingStart(),e.next=3,c.context.api.q("/method/run",{id:c.props.id,method:t.id});case 3:n=e.sent,c.pendingEnd(),c.popoverToggle(),n?(d.b.success(c.m("method.success")),c.props.onFinish&&c.props.onFinish(t)):(d.b.error(c.m("method.fail")),c.setState({pending:!1}));case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),c.ask=function(){var e=Object(r.a)(Object(a.a)().mark((function e(t){return Object(a.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:"drop"===t.actioncode?x({title:c.m("method.confirm.title"),content:c.m("method.confirm.text"),icon:Object(O.jsx)(j.a,{}),onOk:function(){c.run(t)}}):c.run(t);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),c.m=function(e){return c.props.intl.formatMessage({id:e})},c.state={popoverOpen:!1,methods:[]},c}return Object(c.a)(n,[{key:"render",value:function(){var e,t=this;if(null===(e=this.props)||void 0===e||!e.statelabel)return null;var n=this.state,a=n.pending,r=n.methods,i=void 0===r?[]:r,c=Object(O.jsx)(u.a,{className:"gx-m-0",color:{created:"processing",enabled:"success",disabled:"default",deleted:"error"}[this.props.statetypecode],children:this.props.statelabel});return this.props.readOnly?c:Object(O.jsx)(p.a,{content:Object(O.jsx)("div",{className:"".concat(0===i.length&&"gx-p-3"),children:Object(O.jsx)(h.a,{spinning:a,children:i.map((function(e){return e.visible?Object(O.jsx)("div",{onClick:function(){return t.ask(e)},className:"gx-my-2 gx-pointer gx-link",children:e.label},e.id):null}))})}),trigger:"click",visible:this.state.popoverOpen,onVisibleChange:this.popoverToggle,children:Object(O.jsx)("div",{className:"gx-pointer",children:c})})}}]),n}(b.a.Component);y.contextType=m.a;t.a=Object(v.b)(Object(g.c)(y),{statelabel:function(e){return e.statenewlabel},statetypecode:function(e){return e.statenewtypecode}})},775:function(e,t,n){"use strict";n.d(t,"a",(function(){return f})),n.d(t,"b",(function(){return b}));var a=n(3),r=n(22),i=n(21),c=n(29),o=n(30),s=n(9),l=n(27),d=n(0),u=n.n(d),p=n(46),h=n(163),g=n(2),f={is:!1,tick:function(){f.fetch()},goOffline:function(){f.is&&(f.is=!1,f.dispatch("onlineGoOffline"),f.log("Went offline"))},goOnline:function(){f.is||(f.is=!0,f.dispatch("onlineGoOnline"),f.log("Back On Line"))},dispatch:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};window.dispatchEvent(new CustomEvent(e,{detail:t}))},fetch:function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(Object(l.a)(Object(s.a)().mark((function e(){var t,n,a,r,i,c,o,l,d,u,g,b;return Object(s.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t=h.a.get())){e.next=30;break}return(n=new Date).setMilliseconds(n.getMilliseconds()-(p.a.apiCheckInterval+5e3)),a=JSON.stringify({search:[{field:"datetime",value:n,compare:"GEQ"}],reclimit:500,orderby:["datetime DESC"]}),r=null,i=null,(c=new Headers).append("Content-Type","application/json"),c.append("Authorization","Bearer ".concat(t)),o="".concat(p.a.apiDomain).concat(p.a.apiPath,"/notification/list"),e.prev=11,e.next=14,fetch(o,{method:"POST",headers:c,body:a,mode:"cors",cache:"no-store"});case 14:if(!(i=e.sent)){e.next=21;break}return e.next=18,i.json();case 18:if(r=e.sent,null===(l=r)||void 0===l||!l.error){e.next=21;break}return e.abrupt("return",f.error(null===(d=r)||void 0===d||null===(u=d.error)||void 0===u?void 0:u.message));case 21:f.goOnline(),e.next=28;break;case 24:return e.prev=24,e.t0=e.catch(11),f.goOffline(),e.abrupt("return",f.error(e.t0.message));case 28:return r&&(g={},(Array.isArray(r)?r:[r]).forEach((function(e){g[e.object]||(g[e.object]=e)})),(b=Object.keys(g).length)>0&&(f.dispatch("onlineChanged",{items:g}),f.log("messages count "+b))),e.abrupt("return",!1);case 30:case"end":return e.stop()}}),e,null,[[11,24]])})))),error:function(e){return p.a.debug&&console.log('%c OnLine: ERROR "'.concat(e,'"'),"color: orange"),!1},log:function(e){p.a.debug&&console.log("%c OnLine: ".concat(e),"color: cyan")}};function b(e,t){var n=Object.keys(t);return function(s){Object(c.a)(d,s);var l=Object(o.a)(d);function d(e){var a;return Object(r.a)(this,d),(a=l.call(this,e)).onOnlineChanged=function(e){var r,i=null===e||void 0===e||null===(r=e.detail)||void 0===r?void 0:r.items[a.props.id];i&&(a.setState((function(e){var a=e.passProps;return n.forEach((function(e){a[e]=t[e](i)})),{passProps:a}})),a.setState({data:i}))},a.state={data:{},passProps:{}},a}return Object(i.a)(d,[{key:"componentDidMount",value:function(){window.addEventListener("onlineChanged",this.onOnlineChanged)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("onlineChanged",this.onOnlineChanged)}},{key:"componentDidUpdate",value:function(e){var t=this,a=this.state.passProps,r=!1;n.forEach((function(n){e[n]!==t.props[n]&&(a[n]=t.props[n],r=!0)})),r&&this.setState({passProps:a})}},{key:"render",value:function(){var t=this.state.passProps;return Object(g.jsx)(e,Object(a.a)(Object(a.a)({},this.props),t))}}]),d}(u.a.Component)}!window.onlineInterval&&p.a.apiCheckInterval&&window.setInterval((function(){return f.tick()}),p.a.apiCheckInterval)},778:function(e,t,n){"use strict";var a=n(9),r=n(27),i=n(22),c=n(21),o=n(29),s=n(30),l=n(0),d=n.n(l),u=n(210),p=n(873),h=n(111),g=n(2),f=p.a.Option,b=function(e){Object(o.a)(n,e);var t=Object(s.a)(n);function n(e){var c;return Object(i.a)(this,n),(c=t.call(this,e)).createSearch=function(){var e=c.props.search||[];return c.state.searchText&&c.props.async&&e.push({field:c.props.labelKey||"label",compare:"IKE",value:"%".concat(c.state.searchText,"%")}),c.props.enabledOnly&&e.push({field:"statetypecode",compare:"EQL",value:"enabled"}),e},c.getLabelKey=function(){return c.props.labelKey||"label"},c.getIdKey=function(){return c.props.valueKey||"id"},c.shureHaveValue=Object(r.a)(Object(a.a)().mark((function e(){var t;return Object(a.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!c.props.async){e.next=8;break}if(c.state.items.find((function(e){return e[c.getIdKey()]===c.props.value}))){e.next=8;break}return c.setState({pending:!0}),e.next=5,c.context.api.q("/object/get",{id:c.props.value,fields:[c.getIdKey(),c.getLabelKey()]});case 5:t=e.sent,c.setState({pending:!1}),null!==t&&void 0!==t&&t[c.getLabelKey()]&&c.setState((function(e){var n=e.items;return n.push(t),{items:n}}));case 8:case"end":return e.stop()}}),e)}))),c.load=Object(r.a)(Object(a.a)().mark((function e(){var t,n,r,i,o;return Object(a.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!c.props.items){e.next=3;break}return c.setState({items:c.props.items}),e.abrupt("return");case 3:if(t=[],n=c.props.async?1:0,!c.props.query){e.next=14;break}return c.setState({pending:!0}),r=c.createSearch(),i=[c.getIdKey(),c.getLabelKey()].concat(c.props.extraFields||[]),o=c.props.cache?c.context.api.cache:c.context.api.q,e.next=12,o(c.props.query,{search:r,reclimit:n,fields:i},{toArray:!0});case 12:t=e.sent,c.setState({pending:!1,items:t});case 14:case"end":return e.stop()}}),e)}))),c.onSearch=function(){var e=Object(r.a)(Object(a.a)().mark((function e(t){return Object(a.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:c.props.async&&c.setState({searchText:t},(function(){return c.load()}));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),c.onChange=function(e){var t=c.state.items.find((function(t){return t[c.getIdKey()]===e}));c.props.onChange(e,t)},c.state={searchText:"",pending:!1,items:[]},c}return Object(c.a)(n,[{key:"componentDidMount",value:function(){this.load().then(this.shureHaveValue())}},{key:"componentDidUpdate",value:function(e){e.value!==this.props.value&&this.shureHaveValue()}},{key:"render",value:function(){var e=this,t=this.state.items.map((function(t,n){var a=t||{},r=a[e.getIdKey()],i=e.props.formatLabel?e.props.formatLabel(t):a[e.getLabelKey()];return r===e.props.value&&!0,Object(g.jsx)(f,{value:r,children:i},n)}));return Object(g.jsx)(p.a,{defaultActiveFirstOption:!1,allowClear:this.props.allowClear,loading:!!this.state.pending,value:this.state.pending?null:this.props.value,showSearch:!0,placeholder:this.props.placeholder,optionFilterProp:"children",onChange:this.onChange,onSearch:this.onSearch,filterOption:function(e,t){return t.children.toLowerCase().indexOf(e.toLowerCase())>=0},children:t})}}]),n}(d.a.Component);b.contextType=h.a,t.a=Object(u.c)(b)},784:function(e,t,n){"use strict";function a(e,t){var n=e.match.params||{},a=t.match.params||{};return n.param1!==a.param1||n.param2!==a.param2||n.param3!==a.param3}n.d(t,"a",(function(){return a}))},833:function(e,t,n){"use strict";function a(e){return!!e&&("Invalid Date"!==new Date(e)&&!isNaN(new Date(e)))}n.d(t,"a",(function(){return a}))},835:function(e,t,n){"use strict";var a=n(22),r=n(21),i=n(29),c=n(30),o=n(0),s=n.n(o),l=n(870),d=n(834),u=n(210),p=n(823),h=n(2),g=function(e){Object(i.a)(n,e);var t=Object(c.a)(n);function n(e){var r;return Object(a.a)(this,n),(r=t.call(this,e)).m=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"stations.map.";return r.props.intl.formatMessage({id:t+e})},r.getItemGeo=function(e){var t,n=(null===e||void 0===e||null===(t=e.geo)||void 0===t?void 0:t[0])||{},a=n.latitude,r=n.longitude;return a&&r?[a,r]:null},r.config=window.appConfig||{mapLanguage:"ru_RU"},r.state={mapLoaded:!1},r}return Object(r.a)(n,[{key:"render",value:function(){var e=this,t=this.props.stations;if(!Array.isArray(t))return null;if(0===t.length)return Object(h.jsx)(l.a,{});var n=s.a.createRef(),a=t.map((function(t){return e.getItemGeo(t)})).filter((function(e){return e}));if(0===a.length)return Object(h.jsx)("div",{className:this.props.className,children:Object(h.jsx)(l.a,{})});var r=this.config.mapLanguage;return Object(h.jsxs)("div",{className:this.props.className,children:[!this.state.mapLoaded&&Object(h.jsx)(d.a,{spinning:!0}),Object(h.jsx)(p.c,{query:{lang:r},children:Object(h.jsxs)(p.a,{defaultState:{center:a[0]||[],zoom:9},width:"100%",height:"100%",modules:["geoObject.addon.balloon","util.bounds"],onLoad:function(t){e.setState({mapLoaded:!0}),a.length>1&&n.current.setBounds(t.util.bounds.fromPoints(a))},instanceRef:function(e){e&&(n.current=e)},children:[t.map((function(t,n){var a=e.getItemGeo(t);if(!a)return null;var r=[];return t.description&&r.push("<div>".concat(t.description||"","</div>")),t.modelname&&r.push("<div>".concat(t.modelname||""," ").concat(t.vendorname||"","</div>")),Object(h.jsx)(p.b,{defaultGeometry:a,options:{iconLayout:"default#image",iconImageHref:"/assets/images/images-32-removebg-preview.png",iconImageSize:[32,32]},properties:{balloonContentHeader:"".concat(t.label),balloonContent:r.join(""),balloonContentFooter:'<a href="/crm/station/'.concat(t.id,'">').concat(e.m("more"),"</a>")}},n)})),Object(h.jsx)(p.d,{})]})},r)]})}}]),n}(s.a.Component);t.a=Object(u.c)(g)},875:function(e,t,n){"use strict";var a=n(758),r=n(1313),i=n(164),c=n(144),o=n(0),s=n.n(o),l=n(775),d=n(2);t.a=Object(l.b)((function(e){var t=["charging"].includes(e.statecode),n=["reserved"].includes(e.statecode);return Object(d.jsxs)(s.a.Fragment,{children:[Object(d.jsx)(i.a,{title:e.m("btn.charge"),children:Object(d.jsx)(c.a,{className:"gx-mr-1",onClick:function(n){n.stopPropagation(),e.chargeToggle(t)},icon:Object(d.jsx)(a.a,{className:"".concat(t?"gx-text-warning":"")})})}),Object(d.jsx)(i.a,{title:e.m("btn.reserve"),children:Object(d.jsx)(c.a,{onClick:function(t){t.stopPropagation(),e.reserveToggle(n)},icon:Object(d.jsx)(r.a,{className:"".concat(n?"gx-text-warning":"")})})})]})}),{statecode:function(e){return e.statenewcode}})}}]);
//# sourceMappingURL=8.f904c86b.chunk.js.map