(this["webpackJsonpocpp-cs"]=this["webpackJsonpocpp-cs"]||[]).push([[33],{1338:function(e,t,n){"use strict";n.r(t);var a=n(9),c=n(7),r=n(27),s=n(22),o=n(21),i=n(29),l=n(30),d=n(0),p=n.n(d),u=n(769),h=n(210),m=n(32),j=n(53),b=n(871),O=n(144),f=n(1310),x=n(447),g=n(800);var v=n(111),y=n(784),S=n(758),N=n(3),C={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M904 160H120c-4.4 0-8 3.6-8 8v64c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-64c0-4.4-3.6-8-8-8zm0 624H120c-4.4 0-8 3.6-8 8v64c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-64c0-4.4-3.6-8-8-8zm0-312H120c-4.4 0-8 3.6-8 8v64c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-64c0-4.4-3.6-8-8-8z"}}]},name:"menu",theme:"outlined"},w=n(13),H=function(e,t){return d.createElement(w.a,Object(N.a)(Object(N.a)({},e),{},{ref:t,icon:C}))};H.displayName="MenuOutlined";var I=d.forwardRef(H),P=n(795),M=n(780),E=n(873),k=n(870),F=n(742),D=n(739),T=n(2),R=E.a.Option,z=function(e){Object(i.a)(n,e);var t=Object(l.a)(n);function n(){var e;Object(s.a)(this,n);for(var a=arguments.length,c=new Array(a),r=0;r<a;r++)c[r]=arguments[r];return(e=t.call.apply(t,[this].concat(c))).mc=function(t,n){return e.props.m(e.props.command+"."+t,n)},e.m=function(t,n){return e.props.m(t,n)},e}return Object(o.a)(n,[{key:"render",value:function(){var e=this;if(!this.props.station||!this.props.command)return Object(T.jsx)(k.a,{});var t=this.context.ocpp.commands[this.props.command],n=null===t||void 0===t?void 0:t.form;if(!n)return Object(T.jsx)(k.a,{});var a=function(e){switch(e.type){case"string":return e.enum?Object(T.jsx)(E.a,{children:e.enum.map((function(e){return Object(T.jsx)(R,{value:e,children:e},e)}))}):(e.format,Object(T.jsx)(D.a,{}));case"array":case"object":return Object(T.jsx)(D.a,{});case"integer":case"number":return Object(T.jsx)(D.a,{type:"number"});default:return null}};return Object(T.jsx)(T.Fragment,{children:Object(T.jsxs)(F.a,{layout:"vertical",name:"command",onFinish:this.props.onFinish,scrollToFirstError:!0,children:[function(t){var n=t.properties,r=t.required;return 0===Object.entries(n).length?Object(T.jsx)("div",{className:"gx-text-grey gx-font-weight-normal gx-mb-3",children:e.m("noform")}):Object.entries(n).map((function(t){var n=Object(c.a)(t,2),s=n[0],o=n[1];return Object(T.jsx)(F.a.Item,{rules:[{required:null===r||void 0===r?void 0:r.includes(s)}],label:e.mc(s),name:s,extra:Object(T.jsxs)("div",{className:"gx-text-grey gx-font-weight-light gx-text-small",children:[Object(T.jsx)("span",{className:"gx-font-weight-normal gx-mr-2",children:e.m("type."+o.type)}),e.mc(s+".description")]}),children:a(o)},s)}))}(n),Object(T.jsx)(O.a,{type:"primary",htmlType:"submit",children:this.m("submit","")})]},this.props.command)})}}]),n}(p.a.Component);z.contextType=v.a;var A=Object(h.c)(z),_=function(e){Object(i.a)(n,e);var t=Object(l.a)(n);function n(e){var o;return Object(s.a)(this,n),(o=t.call(this,e)).pendingStart=function(){o.props.onPendingStart?o.props.onPendingStart():o.setState({pending:!0})},o.pendingEnd=function(){o.props.onPendingEnd?o.props.onPendingEnd():o.setState({pending:!1})},o.setParams=function(){var e=o.props.match.params,t=e.param1,n=e.param2;o.setState({identity:t,command:n,commandResult:null})},o.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 o.setState({pending:!0}),e.t0=o.context.ocpp,e.next=4,o.context.ocpp.q("/ChargePointList",{});case 4:e.t1=e.sent,t=e.t0.getArray.call(e.t0,e.t1,"ChargePointList","Identity"),n=Object.entries(o.context.ocpp.commands).map((function(e){var t=Object(c.a)(e,1)[0];return{key:t,title:o.m(t)}})),o.setState({treeKey:Object(u.a)(),tree:n,stations:t,pending:!1});case 8:case"end":return e.stop()}}),e)}))),o.getStation=function(e){return o.state.stations.find((function(t){return t.Identity===e}))},o.onTreeSelect=function(e){Array.isArray(e)&&e[0]&&o.props.history.push("/ocpp/command/".concat(o.state.identity,"/").concat(e[0],"/"))},o.onTreeSearch=function(e){o.setState({treeSearch:e})},o.onFormFinish=function(){var e=Object(r.a)(Object(a.a)().mark((function e(t){var n,c,r,s,i;return Object(a.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=o.state,c=n.command,r=n.identity,o.pendingStart(),s=t,Object.keys(s).forEach((function(e){"reservationId"===e||"transactionId"===e||"connectorId"===e?s[e]=Number(s[e]):"csChargingProfiles"===e&&(s[e]=JSON.parse(s[e]))})),e.next=6,o.context.ocpp.q("/ChargePoint/".concat(r,"/").concat(c),s);case 6:i=e.sent,o.setState({commandResult:i}),o.pendingEnd();case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),o.m=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"ocpp.commands.";return o.props.intl.formatMessage({id:t+e})},o.state={treeSearch:"",treeKey:Object(u.a)(),tree:[],stations:[],identity:null,command:null,commandResult:null},o}return Object(o.a)(n,[{key:"componentDidMount",value:function(){this.setParams(),this.load()}},{key:"componentDidUpdate",value:function(e){Object(y.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.pending,a=t.treeKey,c=t.identity,r=t.command,s=t.commandResult,o=t.tree,i=t.treeSearch,l=this.getStation(c),d=i?o.filter((function(e){var t=new RegExp(function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}(i),"gi");return(e.title.toString().match(t)||[]).length>0})):o;return Object(T.jsxs)(T.Fragment,{children:[Object(T.jsx)(M.a,{title:this.m("commands"),url:"/ocpp/command",icon:Object(T.jsx)(S.a,{})}),Object(T.jsxs)(g.a,{pending:n,onSearch:this.onTreeSearch,searchDelay:0,children:[Object(T.jsx)("div",{children:l?Object(T.jsxs)(b.b,{children:[Object(T.jsx)(m.a,{to:"/ocpp",children:Object(T.jsx)("h3",{className:"gx-mb-0",children:l.Identity})}),Object(T.jsx)("div",{className:"gx-text-grey",children:l.Address})]}):Object(T.jsx)(T.Fragment,{children:!n&&Object(T.jsx)(m.a,{to:"/ocpp",children:this.m("pick")})})}),Object(T.jsx)("div",{className:"isoNoteBtns",children:Object(T.jsx)(b.b,{children:Object(T.jsx)(m.a,{to:"/ocpp",children:Object(T.jsx)(O.a,{onClick:this.onAddStart,type:"secondary",icon:Object(T.jsx)(I,{})})})})}),Object(T.jsx)(f.a,{defaultExpandParent:!0,defaultSelectedKeys:[r],defaultExpandedKeys:[r],treeData:d,onSelect:this.onTreeSelect},a),Object(T.jsxs)("div",{children:[Object(T.jsx)(A,{m:this.m,onFinish:this.onFormFinish,station:l,command:r}),s&&Object(T.jsxs)("div",{className:"inspector",children:[Object(T.jsx)("hr",{}),Object(T.jsxs)("h3",{children:[this.m("result"),Object(T.jsx)(O.a,{className:"gx-ml-2 gx-mb-0",onClick:function(){navigator.clipboard.writeText(JSON.stringify(s,null,2)),x.b.success(e.m("copied"))},icon:Object(T.jsx)(P.a,{})})]}),Object(T.jsx)("pre",{children:JSON.stringify(s,null,2)})]})]})]})]})}}]),n}(p.a.Component);_.contextType=v.a;t.default=Object(j.i)(Object(h.c)(_))},769:function(e,t,n){"use strict";function a(){return"f".concat((+new Date).toString(16)).concat((e=1e3,t=9999,e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e));var e,t}n.d(t,"a",(function(){return a}))},780:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var a=n(871),c=(n(0),n(112)),r=n(32),s=n(2);function o(e){return Object(s.jsxs)(s.Fragment,{children:[Object(s.jsx)(c.a,{children:Object(s.jsx)("title",{children:e.title})}),Object(s.jsx)("h2",{className:"title gx-mb-4",children:Object(s.jsx)(r.a,{to:e.url,className:"gx-text-dark",children:Object(s.jsxs)(a.b,{children:[e.icon,e.title]})})})]})}},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}))},792:function(e,t,n){"use strict";var a=n(22),c=n(21),r=n(29),s=n(30),o=n(0),i=n.n(o),l=n(739),d=n(210),p=n(2),u=null,h=function(e){Object(r.a)(n,e);var t=Object(s.a)(n);function n(e){var c;return Object(a.a)(this,n),(c=t.call(this,e)).searchHandle=function(e){c.setState({searchValue:e}),c.state.searchDelay||!c.props.onSearch?(c.setState({searchPending:!0}),window.clearTimeout(u),u=window.setTimeout((function(){c.setState({searchPending:!1}),c.props.onSearch&&c.props.onSearch(e)}),c.state.searchDelay)):c.props.onSearch(e)},c.searchOnChange=function(e){c.searchHandle(e.target.value)},c.state={searchValue:e.defaultValue||"",searchPending:!1,searchDelay:e.hasOwnProperty("searchDelay")?e.searchDelay:1e3},c}return Object(c.a)(n,[{key:"render",value:function(){var e=this,t=this.props,n=t.intl,a=t.className,c=this.state,r=c.searchValue,s=c.searchPending,o=this.props.placeholder||n.formatMessage({id:"search.placeholder"});return Object(p.jsx)(l.a.Search,{placeholder:o,className:a,value:r,onChange:this.searchOnChange,onSearch:function(){return e.searchHandle(r)},loading:s})}}]),n}(i.a.Component);t.a=Object(d.c)(h)},795:function(e,t,n){"use strict";var a=n(3),c=n(0),r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"}}]},name:"copy",theme:"outlined"},s=n(13),o=function(e,t){return c.createElement(s.a,Object(a.a)(Object(a.a)({},e),{},{ref:t,icon:r}))};o.displayName="CopyOutlined";t.a=c.forwardRef(o)},800:function(e,t,n){"use strict";var a=n(7),c=n(22),r=n(21),s=n(29),o=n(30),i=n(0),l=n.n(i),d=n(143),p=n(309),u=n(2),h=function(e){var t=e.id,n=e.style,a=e.children,c=e.className;return Object(u.jsx)(p.Scrollbars,{id:t,className:c,style:n,autoHide:!0,autoHideTimeout:1e3,autoHideDuration:200,autoHeightMin:0,autoHeightMax:200,thumbMinSize:30,universal:!0,children:a})},m=n(792),j=n(740),b=n(834),O=n(210),f=j.a.Header,x=j.a.Content,g=function(e){Object(s.a)(n,e);var t=Object(o.a)(n);function n(){return Object(c.a)(this,n),t.apply(this,arguments)}return Object(r.a)(n,[{key:"render",value:function(){var e=Object(a.a)(this.props.children,4),t=e[0],n=e[1],c=e[2],r=e[3];return Object(u.jsx)(u.Fragment,{children:Object(u.jsx)(b.a,{spinning:!!this.props.pending,children:Object(u.jsxs)("div",{className:"isomorphicNoteComponent",children:[Object(u.jsx)("div",{style:{width:"340px"},className:"isoNoteListSidebar",children:Object(u.jsxs)("div",{className:"isoNoteListWrapper",children:[this.props.onSearch&&Object(u.jsx)(m.a,{placeholder:this.props.searchPlaceholder,className:"isoSearchNotes",onSearch:this.props.onSearch,searchDelay:this.props.searchDelay}),Object(u.jsx)("div",{className:"isoNoteList",children:c?Object(u.jsx)(h,{children:Object(u.jsx)("div",{className:"isoNoteListHolder",children:c})}):Object(u.jsx)("span",{className:"isoNoResultMsg",children:Object(u.jsx)(d.a,{id:"nothing.found"})})})]})}),Object(u.jsxs)(j.a,{className:"isoNotepadWrapper",children:[Object(u.jsxs)(f,{className:"isoHeader",children:[t,n]}),Object(u.jsx)(x,{className:"isoNoteEditingArea",children:r&&Object(u.jsx)(h,{children:Object(u.jsx)("div",{className:"isoNoteContentHolder",children:r})})})]})]})})})}}]),n}(l.a.Component);t.a=Object(O.c)(g)},873:function(e,t,n){"use strict";var a=n(6),c=n(5),r=n(8),s=n.n(r),o=n(821),i=n(55),l=n(0),d=n(101),p=n(822),u=n(87),h=n(84),m=n(28),j=n(67),b=n(94),O=n(832),f=n(93),x=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var c=0;for(a=Object.getOwnPropertySymbols(e);c<a.length;c++)t.indexOf(a[c])<0&&Object.prototype.propertyIsEnumerable.call(e,a[c])&&(n[a[c]]=e[a[c]])}return n},g="SECRET_COMBOBOX_MODE_DO_NOT_USE",v=function(e,t){var n,r,v=e.prefixCls,y=e.bordered,S=void 0===y||y,N=e.className,C=e.getPopupContainer,w=e.dropdownClassName,H=e.popupClassName,I=e.listHeight,P=void 0===I?256:I,M=e.placement,E=e.listItemHeight,k=void 0===E?24:E,F=e.size,D=e.disabled,T=e.notFoundContent,R=e.status,z=e.showArrow,A=x(e,["prefixCls","bordered","className","getPopupContainer","dropdownClassName","popupClassName","listHeight","placement","listItemHeight","size","disabled","notFoundContent","status","showArrow"]),_=l.useContext(d.b),L=_.getPopupContainer,V=_.getPrefixCls,B=_.renderEmpty,J=_.direction,K=_.virtual,q=_.dropdownMatchSelectWidth,W=l.useContext(h.b),U=V("select",v),X=V(),$=Object(f.c)(U,J),G=$.compactSize,Q=$.compactItemClassnames,Y=l.useMemo((function(){var e=A.mode;if("combobox"!==e)return e===g?"combobox":e}),[A.mode]),Z="multiple"===Y||"tags"===Y,ee=void 0!==z?z:A.loading||!(Z||"combobox"===Y),te=Object(l.useContext)(m.b),ne=te.status,ae=te.hasFeedback,ce=te.isFormItemInput,re=te.feedbackIcon,se=Object(b.a)(ne,R);r=void 0!==T?T:"combobox"===Y?null:(B||p.a)("Select");var oe=Object(O.a)(Object(c.a)(Object(c.a)({},A),{multiple:Z,hasFeedback:ae,feedbackIcon:re,showArrow:ee,prefixCls:U})),ie=oe.suffixIcon,le=oe.itemIcon,de=oe.removeIcon,pe=oe.clearIcon,ue=Object(i.a)(A,["suffixIcon","itemIcon"]),he=s()(H||w,Object(a.a)({},"".concat(U,"-dropdown-").concat(J),"rtl"===J)),me=G||F||W,je=l.useContext(u.b),be=null!==D&&void 0!==D?D:je,Oe=s()((n={},Object(a.a)(n,"".concat(U,"-lg"),"large"===me),Object(a.a)(n,"".concat(U,"-sm"),"small"===me),Object(a.a)(n,"".concat(U,"-rtl"),"rtl"===J),Object(a.a)(n,"".concat(U,"-borderless"),!S),Object(a.a)(n,"".concat(U,"-in-form-item"),ce),n),Object(b.b)(U,se,ae),Q,N);return l.createElement(o.d,Object(c.a)({ref:t,virtual:K,dropdownMatchSelectWidth:q},ue,{transitionName:Object(j.c)(X,Object(j.b)(M),A.transitionName),listHeight:P,listItemHeight:k,mode:Y,prefixCls:U,placement:void 0!==M?M:"rtl"===J?"bottomRight":"bottomLeft",direction:J,inputIcon:ie,menuItemSelectedIcon:le,removeIcon:de,clearIcon:pe,notFoundContent:r,className:Oe,getPopupContainer:C||L,dropdownClassName:he,showArrow:ae||z,disabled:be}))},y=l.forwardRef(v);y.SECRET_COMBOBOX_MODE_DO_NOT_USE=g,y.Option=o.c,y.OptGroup=o.b,t.a=y}}]);
//# sourceMappingURL=33.36d812ee.chunk.js.map