2 lines
No EOL
664 KiB
JavaScript
2 lines
No EOL
664 KiB
JavaScript
(this["webpackJsonplamassu-admin"]=this["webpackJsonplamassu-admin"]||[]).push([[0],{604:function(e,t){},607:function(e,t){},608:function(e,t){},630:function(e,t){},632:function(e,t){},640:function(e,t){},642:function(e,t){},761:function(e,t,n){"use strict";n.r(t);var r=n(1),a=n.n(r),i=n(44),o=n.n(i),c=n(2),l=n(9),s=n(6),d=n(46),u=n(8),m=n(889),h=n(800),b=n(304),p=n(444),j=n(318),f=n(799),g=n(879),O=n(10),x=n.n(O),v=n(69),y=n(398),w=n(144),C=n(54),k=a.a.createContext(),S=n(806),N=n(805),I=n(7),E=n.n(I),F=n(816),L=n(441),D=n(426),P=n(417),B=n(90),R=n(408),A=n(802),T=n(171),M=n(264),W=n(803),z=n(4),$=n(20),q="#5f668a",H="#44e188",V="#ecfbef",U="#3fd07e",G="#ebefff",X="#dbdfed",_="#16d6d3",K="#5a67ff",Z="#ffffff",Y="#ff584a",Q="#ffeceb",J="#1b2559",ee="#48f694",te=H,ne=U,re="#fafbff",ae=G,ie=X,oe="#dddddd",ce="#f2f2f2",le=J,se=q,de="#72799d",ue=q,me=Y,he=1200,be=ee,pe="Mont",je="MuseoSans",fe=24,ge=20,Oe=16,xe=14,ve=13;var ye=ve,we=xe,Ce=Oe,ke=fe,Se=500,Ne=je,Ie=32,Ee=48;var Fe=2*Ie,Le=J,De=Q,Pe=V,Be={lineHeight:"120%",color:le},Re={h1:{extend:Be,fontSize:fe,fontFamily:pe,fontWeight:900},h2:{extend:Be,fontSize:ge,fontFamily:pe,fontWeight:900},h3:{extend:Be,fontSize:xe,fontFamily:pe,fontWeight:900},h4:{extend:Be,fontSize:xe,fontFamily:pe,fontWeight:700},h5:{extend:Be,fontSize:Oe,fontFamily:pe,fontWeight:700},p:{extend:Be,fontSize:xe,fontFamily:je,fontWeight:500},tl1:{extend:Be,fontSize:ge,fontFamily:je,fontWeight:700},tl2:{extend:Be,fontSize:xe,fontFamily:je,fontWeight:700},info1:{extend:Be,fontSize:fe,fontFamily:je,fontWeight:700},info2:{extend:Be,fontSize:Oe,fontFamily:je,fontWeight:700},info3:{extend:Be,fontSize:Oe,fontFamily:je,fontWeight:500},mono:{extend:Be,fontSize:xe,fontFamily:"BPmono",fontWeight:500},monoBold:{fontWeight:700},monoSmall:{fontSize:ve},inputFont:{fontSize:ge,fontFamily:je,fontWeight:500,lineHeight:"110%",color:le},regularLabel:{fontSize:xe,fontFamily:je,fontWeight:500,lineHeight:"110%"},label1:{fontSize:ve,fontFamily:je,fontWeight:500,color:le},label2:{fontSize:ve,fontFamily:je,fontWeight:700,color:le},label3:{fontSize:xe,fontFamily:je,fontWeight:500,color:le},confirmationCode:{extend:Be,fontSize:35,fontFamily:pe,fontWeight:900},inline:{display:"inline"},noMargin:{margin:0}},Ae=function(e,t,n){return{backgroundColor:e,"&:hover":{backgroundColor:t},"&:active":{backgroundColor:n}}},Te={actionButton:{extend:Re.p,cursor:"pointer",border:"none",height:28,outline:0,borderRadius:6,padding:"0 8px",display:"flex",alignItems:"center"},primary:{extend:Ae(ae,ie,se),"&:active":{color:Z,"& $actionButtonIcon":{display:"none"},"& $actionButtonIconActive":{display:"flex"}},"& $actionButtonIconActive":{display:"none"}},secondary:{extend:Ae(se,de,Z),color:Z,"&:active":{color:le,"& $actionButtonIcon":{display:"flex"},"& $actionButtonIconActive":{display:"none"}},"& $actionButtonIcon":{display:"none"},"& $actionButtonIconActive":{display:"flex"}},actionButtonIcon:{display:"flex",paddingRight:7,"@global":{svg:{width:14,height:14}}},actionButtonIconActive:{}},Me=n(0),We=Object(j.a)(Te),ze=Object(r.memo)((function(e){var t,n=e.className,r=e.Icon,a=e.InverseIcon,i=e.color,o=e.children,c=Object($.a)(e,["className","Icon","InverseIcon","color","children"]),l=We(),d=(t={},Object(z.a)(t,l.actionButton,!0),Object(z.a)(t,l.primary,"primary"===i),Object(z.a)(t,l.secondary,"secondary"===i),t);return Object(Me.jsxs)("button",Object(s.a)(Object(s.a)({className:E()(d,n)},c),{},{children:[r&&Object(Me.jsx)("div",{className:l.actionButtonIcon,children:Object(Me.jsx)(r,{})}),a&&Object(Me.jsx)("div",{className:E()(l.actionButtonIcon,l.actionButtonIconActive),children:Object(Me.jsx)(a,{})}),o&&Object(Me.jsx)("div",{children:o})]}))})),$e=Object(j.a)(Re);function qe(e){var t,n=e.children,r=e.noMargin,a=e.className,i=Object($.a)(e,["children","noMargin","className"]),o=$e(),c=(t={},Object(z.a)(t,o.h1,!0),Object(z.a)(t,o.noMargin,r),Object(z.a)(t,a,!!a),t);return Object(Me.jsx)("h1",Object(s.a)(Object(s.a)({className:E()(c)},i),{},{children:n}))}function He(e){var t,n=e.children,r=e.noMargin,a=e.className,i=Object($.a)(e,["children","noMargin","className"]),o=$e(),c=(t={},Object(z.a)(t,o.h2,!0),Object(z.a)(t,o.noMargin,r),Object(z.a)(t,a,!!a),t);return Object(Me.jsx)("h2",Object(s.a)(Object(s.a)({className:E()(c)},i),{},{children:n}))}function Ve(e){var t,n=e.children,r=e.noMargin,a=e.className,i=Object($.a)(e,["children","noMargin","className"]),o=$e(),c=(t={},Object(z.a)(t,o.h3,!0),Object(z.a)(t,o.noMargin,r),Object(z.a)(t,a,!!a),t);return Object(Me.jsx)("h3",Object(s.a)(Object(s.a)({className:E()(c)},i),{},{children:n}))}function Ue(e){var t,n=e.children,r=e.noMargin,a=e.className,i=Object($.a)(e,["children","noMargin","className"]),o=$e(),c=(t={},Object(z.a)(t,o.h4,!0),Object(z.a)(t,o.noMargin,r),Object(z.a)(t,a,!!a),t);return Object(Me.jsx)("h4",Object(s.a)(Object(s.a)({className:E()(c)},i),{},{children:n}))}function Ge(e){var t,n=e.children,r=e.noMargin,a=e.className,i=Object($.a)(e,["children","noMargin","className"]),o=$e(),c=(t={},Object(z.a)(t,o.h5,!0),Object(z.a)(t,o.noMargin,r),Object(z.a)(t,a,!!a),t);return Object(Me.jsx)("h5",Object(s.a)(Object(s.a)({className:E()(c)},i),{},{children:n}))}var Xe=rt("p"),_e=rt("info1"),Ke=rt("info2"),Ze=rt("info3"),Ye=rt("mono"),Qe=rt("tl1"),Je=rt("tl2"),et=rt("label1"),tt=rt("label2"),nt=rt("label3");function rt(e){return function(t){var n,r=t.inline,a=t.noMargin,i=t.className,o=t.children,c=Object($.a)(t,["inline","noMargin","className","children"]),l=$e(),d=(n={},Object(z.a)(n,i,!!i),Object(z.a)(n,l[e],e),Object(z.a)(n,l.inline,r),Object(z.a)(n,l.noMargin,a),n);return Object(Me.jsx)("p",Object(s.a)(Object(s.a)({className:E()(d)},c),{},{children:o}))}}function at(){return(at=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function it(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var ot=r.createElement("desc",null,"Created with Sketch."),ct=r.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"nav-/-primary-/-1440",transform:"translate(-1295.000000, -19.000000)",stroke:"#1B2559",strokeWidth:2},r.createElement("g",{id:"icon/menu/notification",transform:"translate(1296.000000, 20.000000)"},r.createElement("path",{d:"M10.1052632,14.3157895 C10.1052632,15.2454737 9.35073684,16 8.42105263,16 C7.49136842,16 6.73684211,15.2454737 6.73684211,14.3157895",id:"Stroke-1"}),r.createElement("path",{d:"M1.6,14.3157895 C0.7168,14.3157895 0,13.6031813 0,12.7251462 C0,11.8471111 0.7168,11.1345029 1.6,11.1345029 L1.6,6.3625731 C1.6,2.84884211 4.4656,0 8,0 C11.5344,0 14.4,2.84884211 14.4,6.3625731 L14.4,11.1345029 C15.2832,11.1345029 16,11.8471111 16,12.7251462 C16,13.6031813 15.2832,14.3157895 14.4,14.3157895 L1.6,14.3157895 Z",id:"Stroke-3",strokeLinejoin:"round"}))));function lt(e,t){var n=e.title,a=e.titleId,i=it(e,["title","titleId"]);return r.createElement("svg",at({width:"18px",height:"18px",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,ot,ct)}var st=r.forwardRef(lt);n.p;function dt(){return(dt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function ut(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var mt=r.createElement("desc",null,"Created with Sketch."),ht=r.createElement("g",{id:"icon/stage/spring/empty",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("circle",{id:"Oval-Copy-6",stroke:"#DDDDDD",strokeWidth:2,transform:"translate(9.000000, 9.000000) rotate(-270.000000) translate(-9.000000, -9.000000) ",cx:9,cy:9,r:8}));function bt(e,t){var n=e.title,a=e.titleId,i=ut(e,["title","titleId"]);return r.createElement("svg",dt({width:"18px",height:"18px",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,mt,ht)}var pt=r.forwardRef(bt);n.p;function jt(){return(jt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function ft(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var gt=r.createElement("desc",null,"Created with Sketch."),Ot=r.createElement("g",{id:"icon/stage/zodiac/empty",stroke:"none",strokeWidth:2,fill:"none",fillRule:"evenodd"},r.createElement("circle",{id:"Oval-Copy-6",stroke:"#5F668A",transform:"translate(9.000000, 9.000000) rotate(-270.000000) translate(-9.000000, -9.000000) ",cx:9,cy:9,r:8}));function xt(e,t){var n=e.title,a=e.titleId,i=ft(e,["title","titleId"]);return r.createElement("svg",jt({width:"18px",height:"18px",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,gt,Ot)}var vt=r.forwardRef(xt);n.p;function yt(){return(yt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function wt(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Ct=r.createElement("desc",null,"Created with Sketch."),kt=r.createElement("g",{id:"icon/stage/zodiac/full",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("circle",{id:"Oval-2-Copy",fill:"#1B2559",cx:9,cy:9,r:8}),r.createElement("circle",{id:"Oval-Copy-5",stroke:"#1B2559",strokeWidth:2,transform:"translate(9.000000, 9.000000) rotate(-270.000000) translate(-9.000000, -9.000000) ",cx:9,cy:9,r:8}));function St(e,t){var n=e.title,a=e.titleId,i=wt(e,["title","titleId"]);return r.createElement("svg",yt({width:"18px",height:"18px",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Ct,kt)}var Nt=r.forwardRef(St),It=(n.p,{background:{position:"absolute",width:"100vw",height:"100vh",left:0,top:0,zIndex:-1,backgroundColor:Z,boxShadow:"0 0 14px 0 rgba(0, 0, 0, 0.24)"},container:{left:-200,top:-42,backgroundColor:Z,height:"110vh"},header:{display:"flex",justifyContent:"space-between"},headerText:{marginTop:20,marginLeft:24},actionButtons:{display:"flex",marginLeft:16,height:0},notificationIcon:function(e){var t=e.buttonCoords,n=e.xOffset;return{position:"absolute",top:t?t.y-1:0,left:t?t.x-n:0,cursor:"pointer",background:"transparent",boxShadow:"0px 0px 0px transparent",border:"0px solid transparent",textShadow:"0px 0px 0px transparent",outline:"none"}},clearAllButton:{marginTop:-16,marginLeft:8,backgroundColor:G},notificationsList:{width:440,height:"90vh",maxHeight:"100vh",marginTop:24,marginLeft:0,marginRight:-50,overflowY:"auto",overflowX:"hidden",backgroundColor:Z,zIndex:10},notificationRow:{position:"relative",marginBottom:4,paddingTop:12},unread:{backgroundColor:V},notificationRowIcon:{alignSelf:"center","& > *":{marginLeft:24}},unreadIcon:{marginLeft:8,marginTop:5,width:"12px",height:"12px",backgroundColor:ee,borderRadius:"50%",cursor:"pointer",zIndex:1},readIcon:{marginLeft:8,marginTop:5,width:"12px",height:"12px",border:[[1,"solid",q]],borderRadius:"50%",cursor:"pointer",zIndex:1},notificationTitle:{margin:0,color:q},notificationBody:{margin:0},notificationSubtitle:{margin:0,marginBottom:8,color:q},stripes:{position:"absolute",height:"100%",top:"0px",opacity:"60%"},hasUnread:{position:"absolute",top:0,left:16,width:"9px",height:"9px",backgroundColor:ee,borderRadius:"50%"}}),Et=n(402),Ft=n.n(Et);function Lt(){return(Lt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Dt(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Pt=r.createElement("g",{id:"\\u21B3-notification-center",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("g",{id:"notification-center_v01a#2-(open)",transform:"translate(-1023.000000, -459.000000)",stroke:"#1B2559"},r.createElement("g",{id:"Group-5",transform:"translate(1000.000000, 0.000000)"},r.createElement("g",{id:"icon/sf-small/wrench",transform:"translate(24.000000, 460.000000)"},r.createElement("path",{d:"M15.7602493,3.10720971 L13.1962412,5.67121772 L10.3290323,5.67121772 L10.3290323,2.80400876 L12.8930403,0.24000075 C12.4378389,0.0872002725 11.9506373,0 11.4434358,0 C8.9282279,0 6.88822153,2.04000637 6.88822153,4.55681424 C6.88822153,5.08081588 6.98102182,5.58321745 7.14422233,6.05201891 L0.580201813,12.6168394 C-0.193400604,13.3904418 -0.193400604,14.6456458 0.580201813,15.4200482 C1.35460423,16.1936506 2.60980816,16.1936506 3.38341057,15.4200482 L9.94823109,8.85602767 C10.4170326,9.01922818 10.9186341,9.11202847 11.4434358,9.11202847 C13.9602436,9.11202847 16.00025,7.0720221 16.00025,4.55681424 C16.00025,4.04961265 15.9130497,3.56241113 15.7602493,3.10720971 Z",id:"Stroke-1"})))));function Bt(e,t){var n=e.title,a=e.titleId,i=Dt(e,["title","titleId"]);return r.createElement("svg",Lt({width:"32px",height:"32px",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Pt)}var Rt=r.forwardRef(Bt);n.p;function At(){return(At=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Tt(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Mt=r.createElement("g",{id:"\\u21B3-notification-center",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("g",{id:"notification-center_v01a#1-(marked-one-as-read)",transform:"translate(-1023.000000, -123.000000)",stroke:"#1B2559"},r.createElement("g",{id:"Group-5",transform:"translate(1000.000000, 0.000000)"},r.createElement("g",{id:"Group-4",transform:"translate(24.000000, 124.000000)"},r.createElement("g",{id:"Group-3"},r.createElement("line",{x1:0,y1:4,x2:16,y2:4,id:"Path-2"}),r.createElement("polyline",{id:"Path-3",points:"12 0 16 4 12 8"})),r.createElement("g",{id:"Group-2",transform:"translate(8.000000, 12.000000) scale(-1, 1) translate(-8.000000, -12.000000) translate(0.000000, 8.000000)"},r.createElement("line",{x1:0,y1:4,x2:16,y2:4,id:"Path-2-Copy"}),r.createElement("polyline",{id:"Path-3-Copy",points:"12 0 16 4 12 8"}))))));function Wt(e,t){var n=e.title,a=e.titleId,i=Tt(e,["title","titleId"]);return r.createElement("svg",At({width:"24px",height:"24px",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Mt)}var zt=r.forwardRef(Wt);n.p;function $t(){return($t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function qt(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Ht=r.createElement("defs",null,r.createElement("pattern",{id:"pattern_68JiZ",patternUnits:"userSpaceOnUse",width:5.5,height:5.5,patternTransform:"rotate(45)"},r.createElement("line",{x1:0,y:0,x2:0,y2:5.5,stroke:"#DBDFED",strokeWidth:3}))),Vt=r.createElement("rect",{width:"100%",height:"100%",fill:"url(#pattern_68JiZ)",opacity:1});function Ut(e,t){var n=e.title,a=e.titleId,i=qt(e,["title","titleId"]);return r.createElement("svg",$t({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"36px",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Ht,"{' '}\n ",Vt)}var Gt=r.forwardRef(Ut);n.p;function Xt(){return(Xt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function _t(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Kt=r.createElement("desc",null,"Created with Sketch."),Zt=r.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"icon/warning-icon/tomato"},r.createElement("rect",{id:"Rectangle",stroke:"#FF584A",strokeWidth:2,x:1,y:1,width:22,height:22,rx:11}),r.createElement("path",{d:"M11.2971429,14.4857143 L11.1085714,5.82857143 L13.3714286,5.82857143 L13.2,14.4857143 L11.2971429,14.4857143 Z M11.1942857,18 L11.1942857,15.9771429 L13.3028571,15.9771429 L13.3028571,18 L11.1942857,18 Z",id:"!",fill:"#FF584A",fillRule:"nonzero"})));function Yt(e,t){var n=e.title,a=e.titleId,i=_t(e,["title","titleId"]);return r.createElement("svg",Xt({width:"24px",height:"24px",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Kt,Zt)}var Qt,Jt,en,tn=r.forwardRef(Yt),nn=(n.p,Object(j.a)(It)),rn={transaction:{display:"Transactions",icon:Object(Me.jsx)(zt,{})},highValueTransaction:{display:"Transactions",icon:Object(Me.jsx)(zt,{})},fiatBalance:{display:"Maintenance",icon:Object(Me.jsx)(Rt,{})},cryptoBalance:{display:"Maintenance",icon:Object(Me.jsx)(Rt,{})},compliance:{display:"Compliance",icon:Object(Me.jsx)(tn,{})},error:{display:"Error",icon:Object(Me.jsx)(tn,{})}},an=function(e){var t,n,r,a=e.id,i=e.type,o=(e.detail,e.message),c=e.deviceName,l=e.created,s=e.read,d=e.valid,u=e.toggleClear,m=nn(),b=null!==(t=T.a([i,"display"])(rn))&&void 0!==t?t:null,p=null!==(n=T.a([i,"icon"])(rn))&&void 0!==n?n:Object(Me.jsx)(Rt,{}),j=Ft()((new Date).getTime()-new Date(l).getTime(),{compact:!0,verbose:!0}),f=b&&c?"".concat(b," - ").concat(c):"".concat(!b&&c?c:b),g=(r={},Object(z.a)(r,m.readIcon,s),Object(z.a)(r,m.unreadIcon,!s),r);return Object(Me.jsxs)(h.a,{container:!0,className:E()(m.notificationRow,!s&&d?m.unread:""),children:[Object(Me.jsx)(h.a,{item:!0,xs:2,className:m.notificationRowIcon,children:p}),Object(Me.jsxs)(h.a,{item:!0,container:!0,xs:7,direction:"row",children:[Object(Me.jsx)(h.a,{item:!0,xs:12,children:Object(Me.jsx)(tt,{className:m.notificationTitle,children:f})}),Object(Me.jsx)(h.a,{item:!0,xs:12,children:Object(Me.jsx)(Je,{className:m.notificationBody,children:o})}),Object(Me.jsx)(h.a,{item:!0,xs:12,children:Object(Me.jsx)(et,{className:m.notificationSubtitle,children:j})})]}),Object(Me.jsx)(h.a,{item:!0,xs:3,style:{zIndex:1},children:Object(Me.jsx)("div",{onClick:function(){return u(a)},className:E()(g)})}),!d&&Object(Me.jsx)(Gt,{className:m.stripes})]})},on=Object(j.a)(It),cn=x()(Qt||(Qt=Object(l.a)(["\n query getNotifications {\n notifications {\n id\n type\n detail\n message\n created\n read\n valid\n }\n hasUnreadNotifications\n machines {\n deviceId\n name\n }\n }\n"]))),ln=x()(Jt||(Jt=Object(l.a)(["\n mutation toggleClearNotification($id: ID!, $read: Boolean!) {\n toggleClearNotification(id: $id, read: $read) {\n id\n read\n }\n }\n"]))),sn=x()(en||(en=Object(l.a)(["\n mutation clearAllNotifications {\n clearAllNotifications {\n id\n }\n }\n"]))),dn=function(e){var t,n,a=e.close,i=e.hasUnreadProp,o=e.buttonCoords,l=e.popperRef,s=e.refetchHasUnreadHeader,d=Object(u.c)(cn,{pollInterval:6e4}),m=d.data,h=d.loading,b=Object(r.useState)(300),p=Object(c.a)(b,2),j=p[0],f=p[1],g=Object(r.useState)(!1),O=Object(c.a)(g,2),x=O[0],v=O[1],y=on({buttonCoords:o,xOffset:j}),w=L.a(B.a(R.a("name")),A.a(R.a("deviceId")))(null!==(t=T.a(["machines"])(m))&&void 0!==t?t:[]),C=null!==(n=T.a(["notifications"])(m))&&void 0!==n?n:[],k=Object(r.useState)(i),S=Object(c.a)(k,2),N=S[0],I=S[1],E=Object(u.b)(ln,{onError:function(){return console.error("Error while clearing notification")},refetchQueries:function(){return["getNotifications"]}}),F=Object(c.a)(E,1)[0],D=Object(u.b)(sn,{onError:function(){return console.error("Error while clearing all notifications")},refetchQueries:function(){return["getNotifications"]}}),P=Object(c.a)(D,1)[0];Object(r.useEffect)((function(){f(l.current.getBoundingClientRect().x),m&&m.hasUnreadNotifications!==N&&(s(),I(!N))}),[l,m,N,s]);return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)("div",{className:y.container,children:[Object(Me.jsxs)("div",{className:y.header,children:[Object(Me.jsx)(Ge,{className:y.headerText,children:"Notifications"}),Object(Me.jsxs)("button",{onClick:a,className:y.notificationIcon,children:[Object(Me.jsx)(st,{}),N&&Object(Me.jsx)("div",{className:y.hasUnread})]})]}),Object(Me.jsxs)("div",{className:y.actionButtons,children:[N&&Object(Me.jsx)(ze,{color:"primary",Icon:Nt,InverseIcon:pt,className:y.clearAllButton,onClick:function(){return v(!x)},children:x?"Show all":"Show unread"}),N&&Object(Me.jsx)(ze,{color:"primary",Icon:vt,InverseIcon:pt,className:y.clearAllButton,onClick:P,children:"Mark all as read"})]}),Object(Me.jsx)("div",{className:y.notificationsList,children:!h&&(x&&N?M.a(W.a("read",!1))(C):C).map((function(e){return Object(Me.jsx)(an,{id:e.id,type:e.type,detail:e.detail,message:e.message,deviceName:w[e.detail.deviceId],created:e.created,read:e.read,valid:e.valid,toggleClear:function(){return F({variables:{id:e.id,read:!e.read}})}},e.id)}))})]}),Object(Me.jsx)("div",{className:y.background})]})},un=n(814),mn=n(815),hn=n(303),bn=n(241),pn=n(16),jn=n(137),fn=n.n(jn),gn=n(812),On=n(813),xn=n(5),vn=Object(j.a)({title:{marginTop:24,marginBottom:24}}),yn=Object(r.memo)((function(e){var t=e.children,n=vn();return Object(Me.jsx)(qe,{className:n.title,children:t})}));function wn(){return(wn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Cn(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var kn=r.createElement("desc",null,"Created with Sketch."),Sn=r.createElement("g",{id:"icon/button/add/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("path",{d:"M11.5384615,6 C11.5384615,9.05815385 9.05815385,11.5384615 6,11.5384615 C2.94184615,11.5384615 0.461538462,9.05815385 0.461538462,6 C0.461538462,2.94184615 2.94184615,0.461538462 6,0.461538462 C9.05815385,0.461538462 11.5384615,2.94184615 11.5384615,6 Z",id:"Stroke-1",stroke:"#1B2559"}),r.createElement("line",{x1:6,y1:3.69230769,x2:6,y2:8.30769231,id:"Stroke-3",stroke:"#1B2559"}),r.createElement("line",{x1:3.69230769,y1:6,x2:8.30769231,y2:6,id:"Stroke-5",stroke:"#1B2559"}));function Nn(e,t){var n=e.title,a=e.titleId,i=Cn(e,["title","titleId"]);return r.createElement("svg",wn({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,kn,Sn)}var In=r.forwardRef(Nn),En=(n.p,{button:{extend:Re.p,border:"none",backgroundColor:G,cursor:"pointer",outline:0,display:"flex",justifyContent:"center",alignItems:"center",width:167,height:48,color:le,"&:hover":{backgroundColor:X},"&:active":{backgroundColor:q,color:Z,"& svg g *":{stroke:Z}},"& svg":{marginRight:8}}}),Fn=Object(j.a)(En),Ln=Object(r.memo)((function(e){var t=e.className,n=e.children,r=Object($.a)(e,["className","children"]),a=Fn();return Object(Me.jsxs)("button",Object(s.a)(Object(s.a)({className:E()(a.button,t)},r),{},{children:[Object(Me.jsx)(In,{}),n]}))})),Dn=Re.h1,Pn=Re.h3,Bn=function(e){switch(e){case"xl":return 61;case"sm":return 32;case"lg":default:return 40}},Rn={wrapper:function(e){var t=e.size,n=Bn(t);return{height:n+n/12/2}},button:function(e){var t=e.size,n=Bn(t),r="xl"===t?3:n/12;return{extend:"xl"===t?Dn:Pn,border:"none",color:Z,cursor:"pointer",fontWeight:900,outline:0,backgroundColor:ee,"&:disabled":{backgroundColor:oe,boxShadow:"none","&:hover":{backgroundColor:oe,boxShadow:"none"},"&:active":{marginTop:0}},shadowSize:r,height:n,padding:"0 ".concat("xl"===t?20:n/2,"px"),borderRadius:n/4,boxShadow:"0 ".concat(r,"px ").concat(te),"&:hover":{backgroundColor:te,boxShadow:"0 ".concat(r,"px ").concat(ne)},"&:active":{marginTop:r/2,backgroundColor:te,boxShadow:"0 ".concat(r/2,"px ").concat(ne)}}}},An=Object(j.a)(Rn),Tn=Object(r.memo)((function(e){var t=e.size,n=void 0===t?"lg":t,r=e.children,a=e.className,i=e.buttonClassName,o=Object($.a)(e,["size","children","className","buttonClassName"]),c=An({size:n});return Object(Me.jsx)("div",{className:E()(a,c.wrapper),children:Object(Me.jsx)("button",Object(s.a)(Object(s.a)({className:E()(i,c.button)},o),{},{children:r}))})})),Mn=function(e,t,n){return{backgroundColor:e,"&:hover":{backgroundColor:t},"&:active":{backgroundColor:n}}},Wn={baseButton:{extend:Mn(ae,ie,se),cursor:"pointer",border:"none",outline:0,height:32,color:le,"&:active":{color:Z}},primary:{extend:Mn(ae,ie,se),"&:active":{color:Z,"& $buttonIcon":{display:"none"},"& $buttonIconActive":{display:"block"}},"& $buttonIconActive":{display:"none"}},secondary:{extend:Mn(se,de,Z),color:Z,"&:active":{color:le,"& $buttonIcon":{display:"flex"},"& $buttonIconActive":{display:"none"}},"& $buttonIcon":{display:"none"},"& $buttonIconActive":{display:"flex"}}},zn=Wn.baseButton,$n=Wn.primary,qn={featureButton:{extend:zn,width:zn.height,borderRadius:zn.height/2,display:"flex",padding:0},primary:$n,buttonIcon:{margin:"auto","& svg":{width:16,height:16,overflow:"visible","& g":{strokeWidth:1.8}}},buttonIconActive:{}},Hn=Object(j.a)(qn),Vn=Object(r.memo)((function(e){var t,n=e.className,r=e.Icon,a=e.InverseIcon,i=e.children,o=Object($.a)(e,["className","Icon","InverseIcon","children"]),c=Hn(),l=(t={},Object(z.a)(t,c.featureButton,!0),Object(z.a)(t,c.primary,!0),t);return Object(Me.jsxs)("button",Object(s.a)(Object(s.a)({className:E()(l,n)},o),{},{children:[r&&Object(Me.jsx)("div",{className:c.buttonIcon,children:Object(Me.jsx)(r,{})}),a&&Object(Me.jsx)("div",{className:E()(c.buttonIcon,c.buttonIconActive),children:Object(Me.jsx)(a,{})}),i]}))})),Un=n(310),Gn=n(804),Xn=function(e){var t,n=e.children,a=e.bgColor,i=void 0===a?Z:a,o=e.arrowSize,l=void 0===o?6:o,d=e.className,u=Object($.a)(e,["children","bgColor","arrowSize","className"]),m=Object(r.useState)(null),h=Object(c.a)(m,2),b=h[0],p=h[1],f={popover:{zIndex:3e3,backgroundColor:i,borderRadius:4},arrow:{position:"absolute",fontSize:l,width:"3em",height:"3em"},arrowBottom:{top:0,width:0,height:0,borderLeft:[["2em","solid","transparent"]],borderRight:[["2em","solid","transparent"]],borderBottom:[["2em","solid",i]],marginTop:"-1.9em","&:after":{zIndex:-10,content:'""',position:"absolute",width:3*l,height:3*l,marginLeft:0,bottom:0,top:"calc(50% - 0px)",left:0,border:"5px solid #fff",borderColor:"transparent transparent #fff #fff",transformOrigin:"0 0",transform:"rotate(45deg)",boxShadow:"0px 2px 1px -1px rgba(0,0,0,0.2),0px 1px 1px 0px rgba(0,0,0,0.14),0px 1px 3px 0px rgba(0,0,0,0.12)"}},arrowTop:{bottom:0,width:0,height:0,borderLeft:[["2em","solid","transparent"]],borderRight:[["2em","solid","transparent"]],borderTop:[["2em","solid",i]],marginBottom:"-1.9em","&:after":{zIndex:-10,content:'""',position:"absolute",width:3*l,height:3*l,marginLeft:0,bottom:0,top:-(4*l+2),left:0,border:"5px solid #fff",borderColor:"transparent transparent #fff #fff",transformOrigin:"0 0",transform:"rotate(45deg)",boxShadow:"0px 2px 1px -1px rgba(0,0,0,0.2),0px 1px 1px 0px rgba(0,0,0,0.14),0px 1px 3px 0px rgba(0,0,0,0.12)"}},arrowRight:{left:0,width:0,height:0,borderTop:[["2em","solid","transparent"]],borderBottom:[["2em","solid","transparent"]],borderRight:[["2em","solid",i]],marginLeft:"-1.9em"},arrowLeft:{right:0,width:0,height:0,borderTop:[["2em","solid","transparent"]],borderBottom:[["2em","solid","transparent"]],borderLeft:[["2em","solid",i]],marginRight:"-1.9em"},root:{backgroundColor:i}},g=Object(j.a)(f)(),O=(t={},Object(z.a)(t,g.arrow,!0),Object(z.a)(t,g.arrowBottom,"bottom"===u.placement),Object(z.a)(t,g.arrowTop,"top"===u.placement),Object(z.a)(t,g.arrowRight,"right"===u.placement),Object(z.a)(t,g.arrowLeft,"left"===u.placement),t),x=Gn.a(u.modifiers,{flip:{enabled:!1},preventOverflow:{enabled:!0,boundariesElement:"scrollParent"},offset:{enabled:!0,offset:"0, 10"},arrow:{enabled:!0,element:b},computeStyle:{gpuAcceleration:!1}});return Object(Me.jsx)(Me.Fragment,{children:Object(Me.jsx)(N.a,Object(s.a)(Object(s.a)({disablePortal:!1,modifiers:x,className:g.popover},u),{},{children:Object(Me.jsxs)(Un.a,{className:E()(g.root,d),children:[Object(Me.jsx)("span",{className:E()(O),ref:p}),n]})}))})},_n=Re.info2,Kn=function(e,t,n){return{backgroundColor:e,"&:hover":{backgroundColor:t},"&:active":{backgroundColor:n}}},Zn={idButton:{width:34,height:28,display:"flex",borderRadius:4,padding:0,border:"none",cursor:"pointer"},buttonIcon:{margin:"auto",lineHeight:1,"& svg":{overflow:"visible"}},closed:{extend:Kn(ae,ie,se)},open:{extend:Kn(se,se,se)},popoverContent:{extend:_n,padding:8,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:4,"& img":{maxHeight:145}}},Yn=Object(j.a)(Zn),Qn=Object(r.memo)((function(e){var t,n=e.name,a=e.className,i=e.Icon,o=e.InverseIcon,l=(e.popoverWidth,e.children),d=e.popoverClassname,u=Object($.a)(e,["name","className","Icon","InverseIcon","popoverWidth","children","popoverClassname"]),m=Object(r.useState)(null),h=Object(c.a)(m,2),b=h[0],p=h[1],j=Yn(),f=Boolean(b),g=f?"simple-popper-".concat(n):void 0,O=(t={},Object(z.a)(t,j.idButton,!0),Object(z.a)(t,j.primary,!0),Object(z.a)(t,j.open,f),Object(z.a)(t,j.closed,!f),t),x=Object(z.a)({},j.buttonIcon,!0),v=function(){p(null)};return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(S.a,{onClickAway:v,children:Object(Me.jsxs)("button",Object(s.a)(Object(s.a)({"aria-describedby":g,onClick:function(e){p(b?null:e.currentTarget)},className:E()(O,a)},u),{},{children:[i&&!f&&Object(Me.jsx)("div",{className:E()(x),children:Object(Me.jsx)(i,{})}),o&&f&&Object(Me.jsx)("div",{className:E()(x),children:Object(Me.jsx)(o,{})})]}))}),Object(Me.jsx)(Xn,{className:d,id:g,open:f,anchorEl:b,onClose:v,arrowSize:3,placement:"top",children:Object(Me.jsx)("div",{className:j.popoverContent,children:Object(Me.jsx)("div",{children:l})})})]})})),Jn={label:function(e){var t=e.size;return{width:t,height:t}},root:{"& svg":{flex:1},"&:hover":{backgroundColor:"inherit"},"&:hover rect":{stroke:q},"&:hover polygon":{stroke:q},"&:hover path":{stroke:q}}},er=Object(j.a)(Jn),tr=function(e){var t=e.size,n=e.children,r=e.onClick,a=Object($.a)(e,["size","children","onClick"]),i=er({size:t});return Object(Me.jsx)(hn.a,Object(s.a)(Object(s.a)({},a),{},{size:"small",classes:{root:i.root,label:i.label},disableRipple:!0,onClick:r,children:n}))},nr=n(207),rr=function(e){return{boxShadow:"inset 0 -4px 0 0 ".concat(Object(nr.fade)(e,.8)),"&:hover":{boxShadow:"none",backgroundColor:Object(nr.fade)(e,.8)}}},ar={link:{extend:Re.h4,textDecoration:"none",border:"none",backgroundColor:"transparent",cursor:"pointer",padding:"0",height:"100%"},primary:{extend:rr(be)},secondary:{extend:rr("#ff584a"),"&:hover":{color:Z}},noColor:{extend:rr(Z)},action:{extend:rr(be),color:G}},ir=Object(j.a)(ar),or=Object(r.memo)((function(e){var t,n=e.submit,r=e.className,a=e.children,i=e.color,o=void 0===i?"primary":i,c=Object($.a)(e,["submit","className","children","color"]),l=ir(),d=(t={},Object(z.a)(t,l.link,!0),Object(z.a)(t,l.primary,"primary"===o),Object(z.a)(t,l.secondary,"secondary"===o),Object(z.a)(t,l.noColor,"noColor"===o),Object(z.a)(t,l.action,"action"===o),t);return Object(Me.jsx)("button",Object(s.a)(Object(s.a)({type:n?"submit":"button",className:E()(d,r)},c),{},{children:a}))})),cr=Wn.baseButton,lr=Wn.primary,sr={button:{extend:cr,borderRadius:cr.height/2,outline:0,padding:"0 20px"},primary:lr,buttonIcon:{marginTop:4,marginRight:4,"& svg":{width:20,height:20,overflow:"visible"}},buttonIconActive:{}};Object(j.a)(sr);function dr(){return(dr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function ur(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var mr=r.createElement("desc",null,"Created with Sketch."),hr=r.createElement("g",{id:"icon/button/cancel/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("g",{id:"Group-5",transform:"translate(1.000000, 1.000000)",stroke:"#FFFFFF"},r.createElement("line",{x1:10,y1:0,x2:0,y2:10,id:"Stroke-1"}),r.createElement("line",{x1:0,y1:0,x2:10,y2:10,id:"Stroke-3"})));function br(e,t){var n=e.title,a=e.titleId,i=ur(e,["title","titleId"]);return r.createElement("svg",dr({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,mr,hr)}var pr=r.forwardRef(br),jr=(n.p,Wn.baseButton),fr={button:{extend:jr,padding:0,color:Z,borderRadius:jr.height/2},normalButton:{width:jr.height},activeButton:{display:"flex",flexDirection:"row",alignItems:"center",backgroundColor:se,fontWeight:"bold",padding:"0 5px","&:hover":{backgroundColor:se}},buttonIcon:{width:16,height:16,overflow:"visible","& g":{strokeWidth:1.8}},buttonIconActiveLeft:{marginRight:12,marginLeft:4},buttonIconActiveRight:{marginRight:5,marginLeft:20},white:{color:Z}},gr=Object(j.a)(fr),Or=Object(r.memo)((function(e){var t,n=e.className,a=e.Icon,i=e.InverseIcon,o=e.toggle,l=e.children,s=Object(r.useState)(!1),d=Object(c.a)(s,2),u=d[0],m=d[1],h=gr(),b=(t={},Object(z.a)(t,h.button,!0),Object(z.a)(t,h.normalButton,!u),Object(z.a)(t,h.activeButton,u),t),p=Object(Me.jsx)(a,{className:h.buttonIcon}),j=Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(i,{className:E()(h.buttonIcon,h.buttonIconActiveLeft)}),Object(Me.jsx)(Ue,{className:h.white,children:l}),Object(Me.jsx)(pr,{className:E()(h.buttonIcon,h.buttonIconActiveRight)})]});return Object(Me.jsx)("button",{className:E()(b,n),onClick:function(){var e=!u;o(e),m(e)},children:u?j:p})}));function xr(){return(xr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function vr(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var yr=r.createElement("desc",null,"Created with Sketch."),wr=r.createElement("g",{id:"icon/action/external-link/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("polyline",{id:"Stroke-1",stroke:"#FFFFFF",strokeWidth:2,points:"20 12.1113 20 21.0003 0 21.0003 0 1.0003 8.889 1.0003"}),r.createElement("polyline",{id:"Stroke-3",stroke:"#FFFFFF",strokeWidth:2,points:"14.4443 1 20.0003 1 20.0003 6.556"}),r.createElement("line",{x1:10,y1:11,x2:20,y2:1,id:"Stroke-5",stroke:"#FFFFFF",strokeWidth:2}));function Cr(e,t){var n=e.title,a=e.titleId,i=vr(e,["title","titleId"]);return r.createElement("svg",xr({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,yr,wr)}var kr=r.forwardRef(Cr);n.p;function Sr(){return(Sr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Nr(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Ir=r.createElement("desc",null,"Created with Sketch."),Er=r.createElement("g",{id:"icon/action/external-link/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("g",{id:"Group-7",transform:"translate(0.000000, 1.000000)",stroke:"#1B2559",strokeWidth:2},r.createElement("polyline",{id:"Stroke-1",points:"20 11.1113 20 20.0003 0 20.0003 0 0.0003 8.889 0.0003"}),r.createElement("polyline",{id:"Stroke-3",points:"14.4443 0 20.0003 0 20.0003 5.556"}),r.createElement("line",{x1:10,y1:10,x2:20,y2:0,id:"Stroke-5"})));function Fr(e,t){var n=e.title,a=e.titleId,i=Nr(e,["title","titleId"]);return r.createElement("svg",Sr({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Ir,Er)}var Lr=r.forwardRef(Fr),Dr=(n.p,Object(j.a)({actionButton:{marginBottom:32},actionButtonLink:{textDecoration:"none",color:J}})),Pr=function(e){var t=e.link,n=e.label,r=Dr();return Object(Me.jsx)("a",{className:r.actionButtonLink,target:"_blank",rel:"noopener noreferrer",href:t,children:Object(Me.jsx)(ze,{className:r.actionButton,color:"primary",Icon:Lr,InverseIcon:kr,children:n})})},Br=n(206),Rr=n(896),Ar=n(415),Tr=n(907),Mr=n(808),Wr=n(906),zr=n(419),$r=n(809),qr=n(891),Hr=function(e){switch(e){case"sm":return{fontSize:we};case"lg":return{fontSize:ke,fontWeight:700};default:return{fontSize:Ce}}},Vr={fontWeight:700},Ur={size:function(e){var t=e.size;return Object(s.a)({marginTop:"lg"===t?0:2},Hr(t))},bold:Vr,root:function(e){return{width:e.width,"& input":{textAlign:e.textAlign}}},underline:{"&:before":{borderBottomColor:ee},"&:hover:not(.Mui-disabled)::before":{borderBottomColor:ee}}},Gr=Object(j.a)(Ur),Xr=Object(r.memo)((function(e){var t=e.name,n=e.isPasswordFilled,r=e.onChange,a=e.onBlur,i=e.value,o=e.error,c=(e.suffix,e.textAlign),l=e.width,d=e.size,u=e.bold,m=e.className,h=e.InputProps,b=Object($.a)(e,["name","isPasswordFilled","onChange","onBlur","value","error","suffix","textAlign","width","size","bold","className","InputProps"]),p=Gr({textAlign:c,width:l,size:d}),j=!o&&!P.a(i)&&!Wr.a(i),f=n||j,g=Object(z.a)({},p.bold,u);return Object(Me.jsx)(qr.a,Object(s.a)({id:t,onChange:r,onBlur:a,error:o,value:i,classes:{root:p.root},className:m,InputProps:Object(s.a)({className:E()(g),classes:{root:p.size,underline:f?p.underline:null}},h)},b))})),_r=function(e){e.optionsLimit;var t=e.limit,n=e.options,r=e.label,a=e.valueProp,i=e.multiple,o=e.onChange,c=e.labelProp,l=(e.shouldStayOpen,e.value),d=e.error,u=e.fullWidth,m=e.textAlign,h=e.size,b=e.autoFocus,p=Object($.a)(e,["optionsLimit","limit","options","label","valueProp","multiple","onChange","labelProp","shouldStayOpen","value","error","fullWidth","textAlign","size","autoFocus"]),j=function(e){return function(t){return Tr.a(W.a(a,t))(e)}},f=R.a(a),g=a?(i?B.a(j(n)):j(n))(l):l,O=function(){return P.a(g)?[]:i?g:[g]};return Object(Me.jsx)(Rr.a,Object(s.a)(Object(s.a)({options:n,multiple:i,value:g,onChange:function(e,t){if(!a)return o(e,t);var n=i?B.a(f)(t):f(t);o(e,n)},getOptionLabel:T.a([c]),forcePopupIcon:!1,filterOptions:function(e,n){var r=n.inputValue;return Mr.a(Wr.a(r)?O():[],function(e,t){return t?Object(Ar.a)(e,t,{keys:[a,c]}):e}(e,r)).slice(0,zr.a(void 0)(t)&&Math.max(t,Wr.a(r)?O().length:0))},openOnFocus:!0,autoHighlight:!0,disableClearable:!0,ChipProps:{onDelete:null},clearOnEscape:!0,getOptionSelected:$r.a(a)},p),{},{renderInput:function(e){return Object(Me.jsx)(Xr,Object(s.a)(Object(s.a)({},e),{},{autoFocus:b,label:r,value:l,error:d,size:h,fullWidth:u,textAlign:m}))}}))},Kr=n(898),Zr=n(422),Yr=n.n(Zr),Qr=n(421),Jr=n.n(Qr);function ea(){return(ea=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function ta(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var na=r.createElement("desc",null,"Created with Sketch."),ra=r.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"icon/warning-icon/comet"},r.createElement("rect",{id:"Rectangle",stroke:"#5F668A",strokeWidth:2,x:1,y:1,width:22,height:22,rx:11}),r.createElement("path",{d:"M11.2971429,14.4857143 L11.1085714,5.82857143 L13.3714286,5.82857143 L13.2,14.4857143 L11.2971429,14.4857143 Z M11.1942857,18 L11.1942857,15.9771429 L13.3028571,15.9771429 L13.3028571,18 L11.1942857,18 Z",id:"!",fill:"#5F668A",fillRule:"nonzero"})));function aa(e,t){var n=e.title,a=e.titleId,i=ta(e,["title","titleId"]);return r.createElement("svg",ea({width:"24px",height:"24px",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,na,ra)}var ia=r.forwardRef(aa),oa=(n.p,Object(j.a)({root:{color:ee,"&$checked":{color:ee}},checked:{},checkBoxLabel:{display:"flex"},wrapper:{display:"flex",alignItems:"center","& > svg":{marginRight:10}},message:{display:"flex",alignItems:"center",color:se,margin:0,whiteSpace:"break-spaces"}})),ca=function(e){var t=e.name,n=e.onChange,r=e.value,a=e.settings,i=Object($.a)(e,["name","onChange","value","settings"]),o=a.enabled,c=a.label,l=a.disabledMessage,d=oa();return Object(Me.jsx)(Me.Fragment,{children:o?Object(Me.jsxs)("div",{className:d.checkBoxLabel,children:[Object(Me.jsx)(tt,{children:c}),Object(Me.jsx)(Kr.a,Object(s.a)({id:t,classes:{root:d.root,checked:d.checked},onChange:n,value:r,checked:r,icon:Object(Me.jsx)(Jr.a,{style:{marginLeft:2,fontSize:Oe}}),checkedIcon:Object(Me.jsx)(Yr.a,{style:{fontSize:ge}}),disableRipple:!0},i))]}):Object(Me.jsxs)("div",{className:d.wrapper,children:[Object(Me.jsx)(ia,{}),Object(Me.jsx)(Ze,{className:d.message,children:l})]})})},la=n(423),sa=n.n(la),da={input:{width:"3.5rem !important",height:"5rem",border:"2px solid",borderColor:G,borderRadius:"4px"},focus:{color:J,border:"2px solid",borderColor:J,borderRadius:"4px"},error:{borderColor:me},container:{justifyContent:"space-evenly"}},ua=Object(j.a)(da),ma=Object(j.a)(Re),ha=function(e){var t=e.name,n=e.value,r=e.onChange,a=e.numInputs,i=e.error,o=e.inputStyle,c=e.containerStyle,l=Object($.a)(e,["name","value","onChange","numInputs","error","inputStyle","containerStyle"]),d=ua(),u=ma();return Object(Me.jsx)(sa.a,Object(s.a)({id:t,value:n,onChange:r,numInputs:a,separator:Object(Me.jsx)("span",{children:" "}),containerStyle:E()(c,d.container),inputStyle:E()(o,d.input,u.confirmationCode),focusStyle:d.focus,errorStyle:d.error,hasErrored:i,isInputNum:!0},l))},ba=n(424),pa=Object(r.memo)((function(e){var t=e.name,n=e.onChange,r=e.onBlur,a=e.value,i=e.error,o=e.suffix,c=e.textAlign,l=e.width,d=e.size,u=e.bold,m=e.className,h=e.decimalPlaces,b=(e.InputProps,Object($.a)(e,["name","onChange","onBlur","value","error","suffix","textAlign","width","size","bold","className","decimalPlaces","InputProps"]));return Object(Me.jsx)(ba.a,Object(s.a)({name:t,onChange:n,onBlur:r,value:a,error:i,suffix:o,textAlign:c,width:l,size:d,bold:u,className:m,customInput:Xr,decimalScale:h,onValueChange:function(e){n({target:{id:t,value:e.floatValue}})}},b))})),ja=n(919),fa=n(810),ga=n(895),Oa=Object(j.a)({label:{height:16,lineHeight:"16px",margin:[[0,0,4,0]],paddingLeft:3}}),xa=function(e){var t=e.name,n=e.label,r=e.value,a=e.options,i=e.onChange,o=e.className,c=e.labelClassName,l=e.radioClassName,s=Oa();return Object(Me.jsxs)(Me.Fragment,{children:[n&&Object(Me.jsx)(et,{className:s.label,children:n}),Object(Me.jsx)(ja.a,{name:t,value:r,onChange:i,className:E()(o),children:a.map((function(e,t){return Object(Me.jsx)(fa.a,{value:e.code,control:Object(Me.jsx)(ga.a,{className:l}),label:e.display,className:E()(c)},t)}))})]})},va=Object(r.memo)((function(e){var t=e.value,n=e.onFocus,a=e.isPasswordFilled,i=e.onBlur,o=Object($.a)(e,["value","onFocus","isPasswordFilled","onBlur"]),l=Object(r.useState)(!1),d=Object(c.a)(l,2),u=d[0],m=d[1];return Object(Me.jsx)(Xr,Object(s.a)(Object(s.a)({},o),{},{type:"password",onFocus:function(e){m(!0),n&&n(e)},onBlur:function(e){m(!1),i&&i(e)},isPasswordFilled:a,value:t,InputProps:{value:t},InputLabelProps:{shrink:a||t||u},placeholder:a?"\u26ac \u26ac \u26ac This field is set \u26ac \u26ac \u26ac":""}))})),ya=n(811),wa=Object(j.a)((function(e){return{root:{width:32,height:20,padding:0,margin:e.spacing(1)},switchBase:{padding:2,"&$disabled":{color:ce,"& + $track":{backgroundColor:oe,opacity:1}},"&$checked":{transform:"translateX(58%)",color:e.palette.common.white,"&$disabled":{color:ce},"& + $track":{backgroundColor:ee,opacity:1,border:"none"}},"&$focusVisible $thumb":{border:"6px solid #fff",boxShadow:"0 0 4px 0 rgba(0,0,0,0.24)"}},thumb:{width:16,height:16},track:{borderRadius:17,border:"none",backgroundColor:se,opacity:1,transition:e.transitions.create(["background-color","border"])},disabled:{},checked:{},focusVisible:{}}})),Ca=Object(r.memo)((function(e){var t=Object.assign({},e),n=wa();return Object(Me.jsx)(ya.a,Object(s.a)({focusVisibleClassName:n.focusVisible,disableRipple:!0,classes:{root:n.root,switchBase:n.switchBase,thumb:n.thumb,track:n.track,checked:n.checked,disabled:n.disabled}},t))})),ka=function(e){var t=e.options,n=e.onChange,a=Object($.a)(e,["options","onChange"]),i=Object(r.useState)(!1),o=Object(c.a)(i,2),l=o[0],d=o[1],u=a.field,m=u.name,h=u.onBlur,b=u.value,p=a.form,j=p.touched,f=p.errors,g=p.setFieldValue,O=p.setFieldTouched,x=!(!j[m]||!f[m]),v=Object(pn.e)(),y=v.initialValues,w=v.values,C="Function"===Br.a(t)?t(y,w):t,k=function(e){return g(m,e)},S=!!a.shouldStayOpen;return Object(Me.jsx)(_r,Object(s.a)({name:m,onChange:function(e,t){if(n)return n(b,t,k);g(m,t)},onBlur:function(e){m&&O(m,!0),h&&h(e)},value:b,error:x,open:l,options:C,onOpen:function(){if(!a.multiple)return d(!0);d((null===b||void 0===b?void 0:b.length)!==a.limit)},onClose:function(e,t){d(!(!S||"blur"===t))}},a))},Sa=n(918),Na=n(23),Ia=Object(r.memo)((function(e){var t=e.classes,n=Object($.a)(e,["classes"]);return Object(Me.jsx)(Sa.a,Object(s.a)({size:"small",classes:t},n))})),Ea=Object(Na.a)((function(e){return{root:{backgroundColor:ae,borderRadius:4,margin:e.spacing(.5,.25),height:18},label:{fontSize:ye,color:le,fontWeight:Se,fontFamily:Ne,paddingRight:4,paddingLeft:4}}}))(Ia),Fa={cashOut:{empty:Y,full:J},cashIn:{empty:J,full:Y}},La=function(e){var t=e.cashOut,n=e.applyColorVariant,r=e.isLow;return Fa[t?"cashOut":"cashIn"][n||!r?"full":"empty"]},Da={cashbox:{borderColor:La,backgroundColor:La,height:118,width:function(e){var t=e.width;return null!==t&&void 0!==t?t:80},border:"2px solid",textAlign:"end",display:"inline-block"},fiatBalanceAlertCashbox:{borderColor:La,backgroundColor:La,height:118,width:80,border:"4px solid"},emptyPart:{backgroundColor:"white",height:function(e){var t=e.percent;return"".concat(100-t,"%")},position:"relative","& > p":{color:La,display:"inline-block",position:"absolute",margin:0,bottom:0,right:0}},fullPart:{backgroundColor:La,"& > p":{color:"white",display:"inline"}}},Pa={row:{display:"flex"},innerRow:{display:"flex",justifyContent:"flex-start"},col2:{marginLeft:14},noMarginText:{marginTop:0,marginBottom:0},link:{marginTop:8},chip:{margin:[[0,0,0,7]]}},Ba=Object(j.a)(Da),Ra=Object(j.a)(Pa),Aa=function(e){var t,n=e.percent,r=void 0===n?0:n,a=e.cashOut,i=void 0!==a&&a,o=e.width,c=e.className,l=e.emptyPartClassName,s=e.labelClassName,d=e.applyColorVariant,u=e.applyFiatBalanceAlertsStyling,m=e.omitInnerPercentage,h=e.isLow,b=Ba({percent:r,cashOut:i,width:o,applyColorVariant:d,isLow:h}),p=r<=51,j=(t={},Object(z.a)(t,b.fiatBalanceAlertCashbox,u),Object(z.a)(t,b.cashbox,!u),t);return Object(Me.jsxs)("div",{className:E()(c,j),children:[Object(Me.jsx)("div",{className:E()(l,b.emptyPart),children:!m&&p&&Object(Me.jsxs)(tt,{className:s,children:[r.toFixed(0),"%"]})}),Object(Me.jsx)("div",{className:b.fullPart,children:!m&&!p&&Object(Me.jsxs)(tt,{className:s,children:[r.toFixed(0),"%"]})})]})},Ta=function(e){e.currency;var t=e.notes,n=(e.total,Ra());return Object(Me.jsx)(Me.Fragment,{children:Object(Me.jsx)("div",{className:n.row,children:Object(Me.jsxs)("div",{children:[Object(Me.jsx)("div",{className:n.innerRow,children:Object(Me.jsxs)(Ke,{className:n.noMarginText,children:[t," notes"]})}),Object(Me.jsx)("div",{className:n.innerRow})]})})})},Ma=function(e){var t=e.capacity,n=void 0===t?500:t,r=e.denomination,a=void 0===r?0:r,i=e.currency,o=e.notes,c=e.className,l=e.editingMode,s=void 0!==l&&l,d=e.threshold,u=e.width,m=100*o/n,h=m<d,b=Ra();return Object(Me.jsx)(Me.Fragment,{children:Object(Me.jsxs)("div",{className:b.row,children:[Object(Me.jsx)("div",{className:b.col,children:Object(Me.jsx)(Aa,{className:c,percent:m,cashOut:!0,isLow:h,width:u})}),!s&&Object(Me.jsxs)("div",{className:b.col2,children:[Object(Me.jsxs)("div",{className:b.innerRow,children:[Object(Me.jsx)(Ke,{className:b.noMarginText,children:o}),Object(Me.jsx)(Ea,{className:b.chip,label:"".concat(a," ").concat(i.code)})]}),Object(Me.jsx)("div",{className:b.innerRow,children:Object(Me.jsxs)(et,{className:b.noMarginText,children:[o*a," ",i.code]})})]})]})})},Wa=Object(j.a)({flex:{display:"flex"},cashCassette:{height:36,marginRight:14}}),za=Object(r.memo)((function(e){var t=e.decimalPlaces,n=e.width,a=e.threshold,i=e.inputClassName,o=Object($.a)(e,["decimalPlaces","width","threshold","inputClassName"]),l=Wa(),d=o.field,u=d.name,m=d.onChange,h=d.onBlur,b=d.value,p=o.form,j=p.touched,f=p.errors,g=Object(r.useState)(b),O=Object(c.a)(g,2),x=O[0],v=O[1],y=!(!j[u]||!f[u]);return Object(Me.jsxs)("div",{className:l.flex,children:[Object(Me.jsx)(Ma,{className:E()(l.cashCassette,i),notes:x,editingMode:!0,width:n,threshold:a}),Object(Me.jsx)(pa,Object(s.a)({name:u,onChange:function(e){return v(e.target.value),m(e)},onBlur:h,value:b,error:y,decimalPlaces:t},o))]})})),$a=Object(r.memo)((function(e){var t=e.label,n=(e.textAlign,e.fullWidth,e.enabled),r=void 0===n||n,a=e.disabledMessage,i=void 0===a?"":a,o=Object($.a)(e,["label","textAlign","fullWidth","enabled","disabledMessage"]),c=o.field,l=c.name,d=c.onChange,u=c.value,m={enabled:r,label:t,disabledMessage:i};return Object(Me.jsx)(ca,Object(s.a)({name:l,onChange:d,value:u,settings:m},o))})),qa=Object(r.memo)((function(e){var t=e.decimalPlaces,n=Object($.a)(e,["decimalPlaces"]),r=n.field,a=r.name,i=r.onChange,o=r.onBlur,c=r.value,l=n.form,d=l.touched,u=l.errors,m=!(!d[a]||!u[a]);return Object(Me.jsx)(pa,Object(s.a)({name:a,onChange:i,onBlur:o,value:c,error:m,decimalPlaces:t},n))})),Ha=Object(r.memo)((function(e){var t=e.label,n=Object($.a)(e,["label"]),r=n.field,a=r.name,i=r.onChange,o=r.value;return Object(Me.jsx)(xa,Object(s.a)({name:a,label:t,value:o,options:n.options,ariaLabel:a,onChange:function(e){i(e),n.resetError&&n.resetError()},className:n.className},n))})),Va=Object(r.memo)((function(e){var t=e.isPasswordFilled,n=Object($.a)(e,["isPasswordFilled"]),r=n.field,a=r.name,i=r.onChange,o=r.onBlur,c=r.value,l=n.form,d=l.touched,u=l.errors,m=!t&&!(!d[a]||!u[a]);return Object(Me.jsx)(va,Object(s.a)({name:a,isPasswordFilled:t,onChange:i,onBlur:o,value:c,error:m},n))})),Ua=Object(r.memo)((function(e){var t=Object.assign({},e),n=t.field,r=n.name,a=n.onChange,i=n.onBlur,o=n.value,c=t.form,l=c.touched,d=c.errors,u=!(!l[r]||!d[r]);return Object(Me.jsx)(Xr,Object(s.a)({name:r,onChange:a,onBlur:i,value:o,error:u},t))}));function Ga(){return(Ga=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Xa(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var _a=r.createElement("desc",null,"Created with Sketch."),Ka=r.createElement("g",{id:"icon/stage/zodiac/complete",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("circle",{id:"Oval",stroke:"#1B2559",transform:"translate(9.000000, 9.000000) rotate(-270.000000) translate(-9.000000, -9.000000) ",cx:9,cy:9,r:8}),r.createElement("path",{d:"M7.80983711,12 C7.54819546,12 7.28655382,11.9032616 7.08725647,11.710772 L5.29971255,9.98428824 C4.90009582,9.59832189 4.90009582,8.97445811 5.29971255,8.58849175 C5.69932929,8.2025254 6.34525711,8.2025254 6.74487384,8.58849175 L7.80983711,9.61707728 L11.2551262,6.28947477 C11.6547429,5.90350841 12.3016927,5.90350841 12.7002874,6.28947477 C13.0999042,6.674454 13.0999042,7.2993049 12.7002874,7.68527125 L8.53241776,11.710772 C8.33312041,11.9032616 8.07147876,12 7.80983711,12",id:"Path",fill:"#1B2559"}));function Za(e,t){var n=e.title,a=e.titleId,i=Xa(e,["title","titleId"]);return r.createElement("svg",Ga({width:"18px",height:"18px",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,_a,Ka)}var Ya=r.forwardRef(Za);n.p;function Qa(){return(Qa=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Ja(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var ei=r.createElement("desc",null,"Created with Sketch."),ti=r.createElement("g",{id:"icon/stage/zodiac/current",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("circle",{id:"Oval-2-Copy",fill:"#1B2559",cx:9,cy:9,r:4}),r.createElement("circle",{id:"Oval-Copy-5",stroke:"#1B2559",strokeWidth:2,transform:"translate(9.000000, 9.000000) rotate(-270.000000) translate(-9.000000, -9.000000) ",cx:9,cy:9,r:8}));function ni(e,t){var n=e.title,a=e.titleId,i=Ja(e,["title","titleId"]);return r.createElement("svg",Qa({width:"18px",height:"18px",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,ei,ti)}var ri,ai=r.forwardRef(ni),ii=(n.p,Re.tl2),oi=Re.p,ci=G,li={sidebar:Object(z.a)({display:"flex",backgroundColor:ci,width:520,marginLeft:-300,boxShadow:"-500px 0px 0px 0px ".concat(ci),borderRadius:"0 20px 0 0",alignItems:"flex-end",padding:24,flexDirection:"column"},(ri=1440,"@media only screen and (max-width: ".concat(ri,")")),{width:"auto",marginLeft:0,minWidth:250,boxShadow:"-200px 0px 0px 0px ".concat(ci)}),link:{extend:oi,position:"relative",color:ue,margin:"12px 24px 12px 0",cursor:"pointer","&:hover::after":{height:"140%"},"&:after":{content:'""',display:"block",background:J,width:4,height:0,left:"100%",marginLeft:20,bottom:-2,position:"absolute",borderRadius:1e3,transition:"all 0.2s cubic-bezier(0.95, 0.1, 0.45, 0.94)"}},activeLink:{extend:ii,color:J,"&::after":{height:"140%"}},customRenderLink:{"&:hover::after":{height:"100%"},"&:after":{bottom:0}},customRenderActiveLink:{"&::after":{height:"100%"}},item:{position:"relative",margin:"12px 0 12px 0",display:"flex"},itemText:{extend:oi,color:ue,marginRight:24},itemTextActive:{extend:ii,color:J},itemTextPast:{color:J},stepperPath:{position:"absolute",height:25,width:1,border:[[1,"solid",ue]],right:8,top:18},stepperPast:{border:[[1,"solid",J]]}},si=Object(j.a)(li),di=function(e){var t=e.data,n=e.displayName,r=e.isSelected,a=e.onClick,i=e.children,o=e.itemRender,c=e.loading,l=void 0!==c&&c,s=si();return Object(Me.jsxs)("div",{className:s.sidebar,children:[l&&Object(Me.jsx)(Xe,{children:"Loading..."}),!l&&(null===t||void 0===t?void 0:t.map((function(e,t){var i;return Object(Me.jsx)("div",{className:E()((i={},Object(z.a)(i,s.activeLink,r(e)),Object(z.a)(i,s.customRenderActiveLink,o&&r(e)),Object(z.a)(i,s.customRenderLink,o),Object(z.a)(i,s.link,!0),i)),onClick:function(){return a(e)},children:o?o(e,r(e)):n(e)},t)}))),!l&&i]})},ui=function(e){var t,n,r=e.step,a=e.it,i=e.idx,o=e.steps,c=si(),l=r===i,s=i<r,d=i>r;return Object(Me.jsxs)("div",{className:c.item,children:[Object(Me.jsx)("span",{className:E()((t={},Object(z.a)(t,c.itemText,!0),Object(z.a)(t,c.itemTextActive,l),Object(z.a)(t,c.itemTextPast,s),t)),children:a.label}),l&&Object(Me.jsx)(ai,{}),s&&Object(Me.jsx)(Ya,{}),d&&Object(Me.jsx)(vt,{}),i<o.length-1&&Object(Me.jsx)("div",{className:E()((n={},Object(z.a)(n,c.stepperPath,!0),Object(z.a)(n,c.stepperPast,s),n))})]})};function mi(){return(mi=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function hi(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var bi=r.createElement("style",{type:"text/css"},"\n\t.st0{fill-rule:evenodd;clip-rule:evenodd;fill:#1B2559;}\n"),pi=r.createElement("desc",null,"Created with Sketch."),ji=r.createElement("g",{id:"color_x2F_primary_x2F_zodiac",transform:"translate(-0.000000, 0.000000)"},r.createElement("g",{id:"Mask"},r.createElement("path",{id:"path-1_1_",className:"st0",d:"M11.1,9l6.5,6.5c0.6,0.6,0.6,1.5,0,2.1c-0.3,0.3-0.7,0.4-1.1,0.4c-0.4,0-0.8-0.2-1.1-0.4 L9,11.1l-6.5,6.5C2.3,17.8,1.9,18,1.5,18c-0.4,0-0.8-0.2-1.1-0.4c-0.6-0.6-0.6-1.5,0-2.1L6.9,9L0.4,2.5C-0.1,2-0.1,1,0.4,0.4 C1-0.1,2-0.1,2.5,0.4L9,6.9l6.5-6.5c0.6-0.6,1.5-0.6,2.1,0c0.6,0.6,0.6,1.5,0,2.1L11.1,9z"})));function fi(e,t){var n=e.title,a=e.titleId,i=hi(e,["title","titleId"]);return r.createElement("svg",mi({id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 18 18",style:{enableBackground:"new 0 0 18 18"},xmlSpace:"preserve",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,bi,pi,ji)}var gi=r.forwardRef(fi);n.p;function Oi(){return(Oi=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function xi(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var vi=r.createElement("desc",null,"Created with Sketch."),yi=r.createElement("g",{id:"icon/stage/spring/complete",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("circle",{id:"Oval",stroke:"#48F694",strokeWidth:2,transform:"translate(9.000000, 9.000000) rotate(-270.000000) translate(-9.000000, -9.000000) ",cx:9,cy:9,r:8}),r.createElement("path",{d:"M7.80983711,12 C7.54819546,12 7.28655382,11.9032616 7.08725647,11.710772 L5.29971255,9.98428824 C4.90009582,9.59832189 4.90009582,8.97445811 5.29971255,8.58849175 C5.69932929,8.2025254 6.34525711,8.2025254 6.74487384,8.58849175 L7.80983711,9.61707728 L11.2551262,6.28947477 C11.6547429,5.90350841 12.3016927,5.90350841 12.7002874,6.28947477 C13.0999042,6.674454 13.0999042,7.2993049 12.7002874,7.68527125 L8.53241776,11.710772 C8.33312041,11.9032616 8.07147876,12 7.80983711,12",id:"Path",fill:"#48F694"}));function wi(e,t){var n=e.title,a=e.titleId,i=xi(e,["title","titleId"]);return r.createElement("svg",Oi({width:"18px",height:"18px",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,vi,yi)}var Ci,ki,Si=r.forwardRef(wi),Ni=(n.p,"100%"),Ii="column",Ei={dialog:{backgroundColor:re,width:Ni,minHeight:Ni,display:"flex",flexDirection:Ii,padding:0},wrapper:{width:he,height:Ni,margin:"0 auto",flex:1,display:"flex",flexDirection:Ii},contentDiv:{display:"flex",flex:1,flexDirection:"row"},headerDiv:{display:"flex",justifyContent:"space-between",alignItems:"center"},contentWrapper:{marginLeft:48},button:{marginTop:64},nameTitle:{marginTop:16,marginBottom:25},qrTitle:{marginTop:12,marginBottom:40},qrCodeWrapper:{display:"flex"},qrTextInfoWrapper:{display:"flex",flexDirection:"row"},qrTextWrapper:{width:381,marginLeft:80,display:"flex",flexDirection:"column"},textWrapper:{display:"flex",flexDirection:"column"},qrTextIcon:{marginRight:16},qrText:{marginTop:0},item:{position:"relative",margin:"12px 0 12px 0",display:"flex"},itemText:{extend:Re.p,color:ue,marginRight:24},itemTextActive:{extend:Re.tl2,color:J},itemTextPast:{color:J},stepperPath:{position:"absolute",height:25,width:1,border:[[1,"solid",ue]],right:8,top:18},stepperPast:{border:[[1,"solid",J]]},successMessageWrapper:{backgroundColor:V,display:"flex",flexDirection:"row",padding:"0px 10px",borderRadius:"8px"},successMessage:{color:H,margin:"8px 0px"},successMessageIcon:{marginRight:16,marginBottom:2,display:"flex",flexDirection:"col",alignItems:"center"},errorMessage:{color:me}},Fi=x()(Ci||(Ci=Object(l.a)(["\n mutation createPairingTotem($name: String!) {\n createPairingTotem(name: $name)\n }\n"]))),Li=x()(ki||(ki=Object(l.a)(["\n {\n machines {\n name\n deviceId\n }\n }\n"]))),Di=Object(j.a)(Ei),Pi=L.a(gn.a,On.a([],["machines"])),Bi={name:""},Ri=xn.e().shape({name:xn.g().required("Machine name is required.").max(50).test("unique-name","Machine name is already in use.",(function(e,t){return!t.options.context.machineNames.includes(e)}))}),Ai=[{label:"Machine name",component:function(e){var t=e.nextStep,n=e.classes,r=e.setQrCode,a=e.setName,i=Object(u.b)(Fi,{onCompleted:function(e){var n=e.createPairingTotem;r(n),t()},onError:function(e){return console.log(e)}}),o=Object(c.a)(i,1)[0],l=Object(u.c)(Li).data,s=B.a(R.a("name"),(null===l||void 0===l?void 0:l.machines)||{});return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Ke,{className:n.nameTitle,children:"Machine Name (ex: Coffee shop 01)"}),Object(Me.jsx)(pn.d,{validateOnBlur:!1,validateOnChange:!1,initialValues:Bi,validate:function(e){try{Ri.validateSync(e,{context:{machineNames:s}})}catch(t){return t}},onSubmit:function(e){var t=e.name;a(t),o({variables:{name:t}})},children:function(e){var t=e.errors;return Object(Me.jsxs)(pn.c,{className:n.form,children:[Object(Me.jsx)("div",{children:Object(Me.jsx)(pn.a,{name:"name",label:"Enter machine name",component:Ua})}),t&&Object(Me.jsx)(Xe,{className:n.errorMessage,children:t.message}),Object(Me.jsx)("div",{className:n.button,children:Object(Me.jsx)(Tn,{type:"submit",children:"Submit"})})]})}})]})}},{label:"Scan QR code",component:function(e){var t,n=e.classes,a=e.qrCode,i=e.name,o=e.count,c=e.onPaired,l=Object(r.useRef)(null),s=Object(u.c)(Li,{pollInterval:1e4}).data;Object(r.useEffect)((function(){return function(){l.current&&clearTimeout(l.current)}}),[]);var d=null===s||void 0===s||null===(t=s.machines)||void 0===t?void 0:t.find((function(e){return e.name===i})),m=Pi(s)>o&&d;return m&&(l.current=setTimeout((function(){return c(d)}),2e3)),Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Ke,{className:n.qrTitle,children:"Scan QR code with your new cryptomat"}),Object(Me.jsxs)("div",{className:n.qrCodeWrapper,children:[Object(Me.jsx)("div",{children:Object(Me.jsx)(fn.a,{size:240,fgColor:J,value:a})}),Object(Me.jsxs)("div",{className:n.qrTextWrapper,children:[Object(Me.jsxs)("div",{className:n.qrTextInfoWrapper,children:[Object(Me.jsx)("div",{className:n.qrTextIcon,children:Object(Me.jsx)(ia,{})}),Object(Me.jsx)("div",{className:n.textWrapper,children:Object(Me.jsx)(Xe,{className:n.qrText,children:"To pair the machine you need scan the QR code with your machine. To do this either snap a picture of this QR code or download it through the button above and scan it with the scanning bay on your machine."})})]}),m&&Object(Me.jsxs)("div",{className:n.successMessageWrapper,children:[Object(Me.jsx)("div",{className:n.successMessageIcon,children:Object(Me.jsx)(Si,{})}),Object(Me.jsx)(Ke,{className:n.successMessage,children:"Machine has been successfully paired!"})]})]})]})]})}}],Ti=Object(r.memo)((function(e){var t=e.close,n=e.onPaired,a=Di(),i=Object(u.c)(Li).data,o=Object(r.useState)(""),l=Object(c.a)(o,2),s=l[0],d=l[1],m=Object(r.useState)(""),h=Object(c.a)(m,2),b=h[0],p=h[1],j=Object(r.useState)(0),f=Object(c.a)(j,2),g=f[0],O=f[1],x=Pi(i),v=Ai[g].component;return Object(Me.jsx)("div",{children:Object(Me.jsx)(un.a,{fullScreen:!0,className:a.dialog,open:!0,"aria-labelledby":"form-dialog-title",children:Object(Me.jsx)(mn.a,{className:a.dialog,children:Object(Me.jsxs)("div",{className:a.wrapper,children:[Object(Me.jsxs)("div",{className:a.headerDiv,children:[Object(Me.jsx)(yn,{children:"Add Machine"}),Object(Me.jsx)(hn.a,{disableRipple:!0,onClick:t,children:Object(Me.jsx)(bn.a,{color:"error",children:Object(Me.jsx)(gi,{})})})]}),Object(Me.jsxs)("div",{className:a.contentDiv,children:[Object(Me.jsx)(di,{children:Ai.map((function(e,t){return function(e,t,n,r){var a,i,o=e===n,c=n<e,l=n>e;return Object(Me.jsxs)("div",{className:r.item,children:[Object(Me.jsx)("span",{className:E()((a={},Object(z.a)(a,r.itemText,!0),Object(z.a)(a,r.itemTextActive,o),Object(z.a)(a,r.itemTextPast,c),a)),children:t.label}),o&&Object(Me.jsx)(ai,{}),c&&Object(Me.jsx)(Ya,{}),l&&Object(Me.jsx)(vt,{}),n<Ai.length-1&&Object(Me.jsx)("div",{className:E()((i={},Object(z.a)(i,r.stepperPath,!0),Object(z.a)(i,r.stepperPast,c),i))})]})}(g,e,t,a)}))}),Object(Me.jsx)("div",{className:a.contentWrapper,children:Object(Me.jsx)(v,{classes:a,nextStep:function(){return O(1)},count:x,onPaired:n,qrCode:s,setQrCode:d,name:b,setName:p})})]})]})})})})}));function Mi(){return(Mi=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Wi(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var zi=r.createElement("desc",null,"Created with Sketch."),$i=r.createElement("g",{id:"icon/button/add/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("path",{d:"M11.5384615,6 C11.5384615,9.05815385 9.05815385,11.5384615 6,11.5384615 C2.94184615,11.5384615 0.461538462,9.05815385 0.461538462,6 C0.461538462,2.94184615 2.94184615,0.461538462 6,0.461538462 C9.05815385,0.461538462 11.5384615,2.94184615 11.5384615,6 Z",id:"Stroke-1",stroke:"#FFFFFF"}),r.createElement("line",{x1:6,y1:3.69230769,x2:6,y2:8.30769231,id:"Stroke-3",stroke:"#FFFFFF"}),r.createElement("line",{x1:3.69230769,y1:6,x2:8.30769231,y2:6,id:"Stroke-5",stroke:"#FFFFFF"}));function qi(e,t){var n=e.title,a=e.titleId,i=Wi(e,["title","titleId"]);return r.createElement("svg",Mi({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,zi,$i)}var Hi=r.forwardRef(qi);n.p;function Vi(){return(Vi=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Ui(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Gi=r.createElement("desc",null,"Created with Sketch."),Xi=r.createElement("defs",null,r.createElement("path",{d:"M17.8413132,12.8764646 C17.8413132,12.8764646 16.6555879,12.5091919 15.661533,12.2855556 C15.661533,12.2855556 15.3477198,10.3246465 14.8939121,8.23646465 C14.8939121,8.23646465 15.1560495,8.21373737 15.3383242,8.8710101 L16.0223242,12.0219192 C16.0223242,12.0219192 17.2343571,12.2991919 18.1795549,12.6537374 L17.8413132,12.8764646 Z M15.2603407,6.10282828 L15.5328132,5.80555556 C16.0627253,5.87828283 16.3483516,6.02828283 16.3483516,6.02828283 L16.291978,6.11191919 L16.3972088,6.9310101 C16.2440604,6.93646465 16.0091703,7.05919192 16.0091703,7.05919192 L15.8315934,6.95010101 L15.8315934,6.38282828 C15.3026209,6.29919192 15.2556429,6.21828283 15.2556429,6.21828283 L15.2603407,6.10282828 Z M12.4557527,18.2873737 C11.2831813,18.4964646 9.84565385,18.2237374 9.84565385,18.2237374 L9.89732967,17.9991919 C9.89732967,17.9991919 11.6496099,18.1955556 12.6248736,17.8973737 C12.5553462,18.0628283 12.5356154,18.1137374 12.4557527,18.2873737 L12.4557527,18.2873737 Z M9.18984066,14.5464646 C8.379,15.1364646 7.56064286,15.6791919 7.00442308,16.1091919 C6.9705989,16.6955556 6.91516484,17.6464646 6.91516484,17.6464646 L5.46448352,18.5182828 L5.22207692,18.3737374 C5.27845055,17.9219192 5.34891758,17.5882828 5.34891758,17.5882828 L5.55186264,17.4410101 C5.50676374,17.7282828 5.48515385,18.1346465 5.48515385,18.1346465 L6.5928956,17.440101 C6.63705495,16.7019192 6.72443407,15.960101 6.72443407,15.960101 C6.9705989,15.7373737 8.73697253,14.5237374 10.0100803,13.6864646 C10.0100803,13.6864646 10.018533,13.9437374 9.18984066,14.5464646 L9.18984066,14.5464646 Z M14.977533,0.195555556 C15.2612802,0.167373737 15.5065055,0.184646465 15.7103901,0.228282828 L15.7103901,0.228282828 L15.8813901,0.697373737 L16.1003077,0.361919192 C16.2694286,0.447373737 16.3746593,0.547373737 16.4056648,0.624646465 C16.4056648,0.624646465 16.3615055,0.909191919 16.4319725,1.36464646 C16.5005604,1.80373737 16.6988077,2.78191919 16.6988077,2.78191919 C16.9740989,3.00646465 17.2850934,3.51282828 17.2850934,3.51282828 C17.4758242,4.41737374 17.4645495,5.04919192 17.4636099,5.1210101 C16.6734396,4.68646465 15.6173736,4.58555556 15.6173736,4.58555556 L15.6173736,4.58555556 L15.2481264,4.90828283 C15.9753462,5.00828283 16.8792033,5.26555556 17.1122143,5.44555556 C17.2484505,5.74737374 17.3386484,6.22828283 17.3386484,6.22828283 L17.3386484,6.22828283 L17.0445659,6.58919192 L17.3198571,6.8810101 C17.3386484,7.22464646 17.2183846,7.56919192 17.2183846,7.56919192 C17.7905769,7.93010101 17.9512418,8.79373737 18.3101538,10.250101 C18.6700055,11.7064646 18.9903956,12.9055556 18.9903956,12.9055556 L18.9903956,12.9055556 L18.4567253,13.2019192 C19.1623352,15.7282828 18.444511,17.7391919 17.5378352,19.0664646 C16.6320989,20.3946465 16.0862143,21.7137374 16.1031264,22.8910101 L16.1031264,22.8910101 L16.5475385,23.2346465 L16.7749121,23.9491919 L14.3048077,23.9491919 L14.293533,23.2728283 C14.2925934,21.5619192 14.9230385,20.1328283 14.9230385,20.1328283 C15.2857088,20.0473737 15.6596538,19.7628283 15.6596538,19.7628283 C15.0733681,19.8828283 14.3414505,19.7964646 14.3414505,19.7964646 C14.8676044,18.8537374 15.0292088,18.1773737 15.0292088,18.1773737 L15.0292088,18.1773737 L14.7811648,18.1228283 C14.6956648,18.310101 14.6073462,18.4937374 14.5133901,18.6710101 C13.8754286,19.8864646 13.1735769,20.6628283 12.7554725,22.4055556 L12.7554725,22.4055556 L13.1933077,22.7455556 L13.6987912,23.9491919 L10.8509835,23.9491919 C10.8340714,21.8246465 11.495522,20.2273737 11.7341703,19.7628283 C10.2233571,19.9264646 8.42128022,19.1782828 6.99314835,19.4664646 C6.60041209,21.9473737 4.59257143,22.4355556 3.65019231,22.300101 L3.65019231,22.300101 L2.97652747,23.4146465 L3.58724176,23.9491919 L1.33135714,23.9491919 C1.32008242,23.8546465 1.2918956,23.7537374 1.22988462,23.6591919 C1.22988462,23.6591919 1.97401648,22.5882828 2.48231868,21.150101 C2.89008791,21.3255556 3.75166484,20.9928283 3.78736813,20.1055556 C3.82401099,19.2191919 3.67086264,17.8419192 4.46854945,16.7891919 C5.2652967,15.7355556 6.12687363,15.1655556 7.25152747,14.3328283 C7.98250549,13.7910101 9.22084615,12.8755556 9.99974176,12.3010101 L9.99974176,12.3010101 L9.61546154,12.3864646 L6.81087363,14.6491919 L5.82997253,14.6491919 L8.66368681,12.1164646 L8.29725824,12.1091919 L5.33576374,14.6491919 L4.34170879,14.6491919 L7.27313736,11.720101 L6.9208022,11.7173737 L3.88038462,14.6491919 L2.86565934,14.6491919 L5.8093022,11.3037374 L5.46918132,11.3055556 L2.43534066,14.6491919 L1.36706044,14.6491919 L4.22614286,10.8528283 L3.89635714,10.8573737 L0.963989011,14.6491919 L0,14.6491919 C0,14.6491919 4.11809341,8.22464646 4.92893407,7.00737374 C5.73883516,5.79010101 6.6192033,4.62282828 8.06894505,4.38464646 C9.53465934,4.14282828 10.5343516,4.46646465 11.2502967,5.63373737 C11.636456,6.2610101 12.1034176,6.97828283 12.4698462,7.55919192 C12.0968407,8.1510101 11.6298791,8.6110101 11.5857198,9.32282828 C11.534044,10.1419192 12.0921429,10.6373737 12.6558791,10.6773737 C12.2321374,10.5282828 11.8976538,10.0337374 12.0489231,9.37646465 C12.2058297,8.69737374 12.7554725,8.35191919 13.1726374,7.80282828 C13.5315495,7.32828283 13.5371868,6.63282828 13.5108791,6.4010101 C13.4836319,6.16919192 13.2167967,5.98828283 13.2167967,5.98828283 C13.2167967,5.98828283 13.2252527,5.52373737 13.2167967,5.01646465 C13.2083407,4.51010101 13.4300769,4.21828283 13.4300769,4.21828283 C13.4300769,4.21828283 13.4216209,3.4610101 13.3943736,2.57646465 C13.3671264,1.72555556 13.2863242,1.46828283 13.205522,1.35464646 C13.205522,1.35464646 13.2694121,1.10919192 13.5099396,0.844646465 L13.5099396,0.844646465 L13.7542253,1.06282828 L13.8284505,0.571919192 C13.9825385,0.469191919 14.1723297,0.375555556 14.4072198,0.307373737 C14.4325879,0.30010101 14.4570165,0.294646465 14.4823846,0.288282828 L14.4823846,0.288282828 L14.7896209,0.644646465 Z M7.71628243,19.8937938 C8.32897736,19.8402566 9.02386307,19.9393405 9.75797621,20.0432188 L9.75797621,20.0432188 L9.86538462,20.058401 C9.7449004,20.8103202 9.02106112,21.7691969 7.79193531,22.0896215 L7.79193531,22.0896215 L9.01358923,23.5151515 L7.36136769,23.5151515 C7.15589073,23.2226941 6.50396838,22.32135 6.16586538,21.9681638 C6.72065317,21.6525335 7.42954868,21.0388524 7.71628243,19.8937938 Z",id:"path-1"})),_i=r.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"nav-/-primary-/-1440",transform:"translate(-128.000000, -14.000000)"},r.createElement("g",{id:"icon/lamassu-logo",transform:"translate(128.000000, 14.000000)"},r.createElement("g",{id:"color/amaz/default"},r.createElement("mask",{id:"mask-2",fill:"white"},r.createElement("use",{xlinkHref:"#path-1"})),r.createElement("use",{id:"Mask",fill:"#16D6D3",xlinkHref:"#path-1"})))));function Ki(e,t){var n=e.title,a=e.titleId,i=Ui(e,["title","titleId"]);return r.createElement("svg",Vi({width:"19px",height:"24px",viewBox:"0 0 19 24",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Gi,Xi,_i)}var Zi=r.forwardRef(Ki);n.p;function Yi(){return(Yi=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Qi(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Ji=r.createElement("desc",null,"Created with Sketch."),eo=r.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"nav-/-primary-/-1440",transform:"translate(-1295.000000, -19.000000)",stroke:"#FFFFFF",strokeWidth:2},r.createElement("g",{id:"icon/menu/notification",transform:"translate(1296.000000, 20.000000)"},r.createElement("path",{d:"M10.1052632,14.3157895 C10.1052632,15.2454737 9.35073684,16 8.42105263,16 C7.49136842,16 6.73684211,15.2454737 6.73684211,14.3157895",id:"Stroke-1"}),r.createElement("path",{d:"M1.6,14.3157895 C0.7168,14.3157895 0,13.6031813 0,12.7251462 C0,11.8471111 0.7168,11.1345029 1.6,11.1345029 L1.6,6.3625731 C1.6,2.84884211 4.4656,0 8,0 C11.5344,0 14.4,2.84884211 14.4,6.3625731 L14.4,11.1345029 C15.2832,11.1345029 16,11.8471111 16,12.7251462 C16,13.6031813 15.2832,14.3157895 14.4,14.3157895 L1.6,14.3157895 Z",id:"Stroke-3",strokeLinejoin:"round"}))));function to(e,t){var n=e.title,a=e.titleId,i=Qi(e,["title","titleId"]);return r.createElement("svg",Yi({width:"18px",height:"18px",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Ji,eo)}var no=r.forwardRef(to),ro=(n.p,Re.tl2),ao=Re.p,io=56,oo=40;var co,lo,so,uo,mo,ho,bo,po,jo,fo,go,Oo,xo,vo,yo,wo,Co,ko,So,No={headerContainer:{position:"relative"},header:{backgroundColor:J,color:Z,height:io,display:"flex"},content:{maxWidth:he,flex:1,display:"flex",alignItems:"center",margin:"0 auto"},nav:{flex:1,display:"flex",alignItems:"center",justifyContent:"space-between"},ul:{display:"flex",paddingLeft:36,height:56,margin:0},li:{listStyle:"none",color:Z,margin:[[20,20,0,20]],"&:hover":{color:Z},"&:hover::after":{width:"50%",marginLeft:"-25%"},position:"relative","&:after":{content:'""',display:"block",background:Z,width:0,height:4,left:"50%",marginLeft:0,bottom:-8,position:"absolute",borderRadius:1e3,transition:[["all","0.2s","cubic-bezier(0.95, 0.1, 0.45, 0.94)"]]}},link:{extend:ao,textDecoration:"none",border:"none",color:Z,backgroundColor:"transparent"},forceSize:{display:"inline-block",textAlign:"center","&:after":{display:"block",content:"attr(forcesize)",fontWeight:700,height:0,overflow:"hidden",visibility:"hidden"}},activeLink:{color:Z,"& li::after":{width:"50%",marginLeft:"-25%"}},addMachine:{marginLeft:"auto"},subheader:{backgroundColor:ae,color:Z,height:oo,display:"flex"},subheaderUl:{display:"flex",paddingLeft:0},subheaderLi:{extend:ro,display:"flex",alignItems:"center",height:24,listStyle:"none",padding:[[0,20]],"&:first-child":{paddingLeft:0}},subheaderLink:{extend:ao,textDecoration:"none",border:"none",color:ue},activeSubheaderLink:{extend:ro,color:le},white:{color:Z},logo:{display:"flex",alignItems:"center","& > svg":{marginRight:16}},logoLink:{cursor:"pointer"},actionButtonsContainer:{zIndex:1,position:"relative",display:"flex",justifyContent:"space-between",minWidth:200,transform:"translateZ(0)"},notificationIcon:{marginTop:4,cursor:"pointer",background:"transparent",boxShadow:"0px 0px 0px transparent",border:"0px solid transparent",textShadow:"0px 0px 0px transparent",outline:"none"},hasUnread:{position:"absolute",top:4,left:182,width:"9px",height:"9px",backgroundColor:ee,borderRadius:"50%"},popper:{zIndex:1}},Io=Object(j.a)(No),Eo=x()(co||(co=Object(l.a)(["\n query getUnread {\n hasUnreadNotifications\n }\n"]))),Fo=function(e){var t=e.item,n=e.classes,a=e.user,i=Object(r.useState)(null),o=Object(c.a)(i,2),l=o[0],s=o[1];return Object(Me.jsx)("div",{className:n.subheader,children:Object(Me.jsx)("div",{className:n.content,children:Object(Me.jsx)("nav",{children:Object(Me.jsx)("ul",{className:n.subheaderUl,children:t.children.map((function(e,t){return F.a(a.role,e.allowedRoles)?Object(Me.jsx)("li",{className:n.subheaderLi,children:Object(Me.jsx)(C.c,{to:{pathname:e.route,state:{prev:l}},className:n.subheaderLink,activeClassName:n.activeSubheaderLink,isActive:function(t){return!!t&&(s(e.route),!0)},children:e.label})},t):Object(Me.jsx)(Me.Fragment,{})}))})})})})},Lo=L.a(D.a,P.a),Do=Object(r.memo)((function(e){var t=e.tree,n=e.user,a=Object(r.useState)(!1),i=Object(c.a)(a,2),o=i[0],l=i[1],s=Object(r.useState)(null),d=Object(c.a)(s,2),m=d[0],h=d[1],b=Object(r.useState)({x:0,y:0}),p=Object(c.a)(b,2),j=p[0],f=p[1],g=Object(r.useState)(),O=Object(c.a)(g,2),x=O[0],v=O[1],y=Object(r.useState)(!1),k=Object(c.a)(y,2),I=k[0],L=k[1],D=Object(u.c)(Eo),P=D.data,B=D.refetch,R=D.startPolling,A=D.stopPolling,T=Object(r.useRef)(),M=Object(r.useRef)(),W=Object(w.h)(),z=Io();Object(r.useEffect)((function(){return(null===P||void 0===P?void 0:P.hasUnreadNotifications)?L(!0):Lo(null===P||void 0===P?void 0:P.hasUnreadNotifications)?L(!1):void 0}),[P]),Object(r.useEffect)((function(){return R(6e4),A}));var $=function(){h(null),document.querySelector("#root").classList.remove("root-notifcenter-open"),document.querySelector("body").classList.remove("body-notifcenter-open")},q=Boolean(m),H=q?"notifications-popper":void 0;return Object(Me.jsxs)("header",{className:z.headerContainer,children:[Object(Me.jsx)("div",{className:z.header,children:Object(Me.jsxs)("div",{className:z.content,children:[Object(Me.jsxs)("div",{onClick:function(){v(!1),W.push("/dashboard")},className:E()(z.logo,z.logoLink),children:[Object(Me.jsx)(Zi,{}),Object(Me.jsx)(Ue,{className:z.white,children:"Lamassu Admin"})]}),Object(Me.jsx)("nav",{className:z.nav,children:Object(Me.jsx)("ul",{className:z.ul,children:t.map((function(e,t){return F.a(n.role,e.allowedRoles)?Object(Me.jsx)(C.c,{to:e.route||e.children[0].route,isActive:function(t){return!!t&&(v(e),!0)},className:E()(z.link,z.whiteLink),activeClassName:z.activeLink,children:Object(Me.jsx)("li",{className:z.li,children:Object(Me.jsx)("span",{className:z.forceSize,forcesize:e.label,children:e.label})})},t):Object(Me.jsx)(Me.Fragment,{})}))})}),Object(Me.jsxs)("div",{className:z.actionButtonsContainer,children:[Object(Me.jsx)(ze,{color:"secondary",Icon:In,InverseIcon:Hi,onClick:function(){return l(!0)},children:"Add machine"}),Object(Me.jsx)(S.a,{onClickAway:$,children:Object(Me.jsxs)("div",{ref:T,children:[Object(Me.jsxs)("button",{onClick:function(e){var t=T.current.getBoundingClientRect();f({x:t.x,y:t.y}),h(m?null:e.currentTarget),document.querySelector("#root").classList.add("root-notifcenter-open"),document.querySelector("body").classList.add("body-notifcenter-open")},className:z.notificationIcon,children:[Object(Me.jsx)(no,{}),I&&Object(Me.jsx)("div",{className:z.hasUnread})]}),Object(Me.jsx)(N.a,{ref:M,id:H,open:q,anchorEl:m,className:z.popper,disablePortal:!1,modifiers:{preventOverflow:{enabled:!0,boundariesElement:"viewport"}},children:Object(Me.jsx)(dn,{popperRef:M,buttonCoords:j,close:$,hasUnreadProp:I,refetchHasUnreadHeader:B})})]})})]})]})}),x&&x.children&&Object(Me.jsx)(Fo,{item:x,classes:z,user:n}),o&&Object(Me.jsx)(Ti,{close:function(){return l(!1)},onPaired:function(e){l(!1),W.push("/maintenance/machine-status",{id:e.deviceId})}})]})})),Po=n(892),Bo={wrapper:{display:"flex",alignItems:"center","& > svg":{marginRight:10}},message:{display:"flex",alignItems:"center",color:me,margin:0,whiteSpace:"break-spaces"}},Ro=Object(j.a)(Bo),Ao=function(e){var t=e.className,n=e.children,r=(Object($.a)(e,["className","children"]),Ro());return Object(Me.jsxs)("div",{className:E()(r.wrapper,t),children:[Object(Me.jsx)(tn,{}),Object(Me.jsx)(Ze,{className:r.message,children:n})]})},To={titleWrapper:{display:"flex",justifyContent:"space-between",alignItems:"center",flexDirection:"row"},titleAndButtonsContainer:{display:"flex",alignItems:"center"},error:{marginLeft:12},subpageButton:{marginLeft:12},buttonText:{color:re,fontSize:15},icon:{marginRight:6},label:{marginRight:24}},Mo=Object(j.a)(To),Wo=function(e){var t=e.className,n=e.title,r=e.error,a=e.labels,i=e.button,o=e.children,c=e.appendix,l=e.appendixClassName,s=Mo();return Object(Me.jsxs)("div",{className:E()(s.titleWrapper,t),children:[Object(Me.jsxs)("div",{className:s.titleAndButtonsContainer,children:[Object(Me.jsx)(yn,{children:n}),c&&Object(Me.jsx)("div",{className:l,children:c}),r&&Object(Me.jsx)(Ao,{className:s.error,children:"Failed to save"}),i&&Object(Me.jsx)(Or,{className:s.subpageButton,Icon:i.icon,InverseIcon:i.inverseIcon,toggle:i.toggle,children:Object(Me.jsx)(_e,{className:s.buttonText,children:i.text})})]}),Object(Me.jsx)(Po.a,{display:"flex",flexDirection:"row",children:(null!==a&&void 0!==a?a:[]).map((function(e,t){var n=e.icon,r=e.label;return Object(Me.jsxs)(Po.a,{display:"flex",alignItems:"center",children:[Object(Me.jsx)("div",{className:s.icon,children:n}),Object(Me.jsx)(et,{className:s.label,children:r})]},t)}))}),o]})},zo=n(249),$o=n(888),qo=n(909),Ho=n(854),Vo=n(860),Uo=n(913),Go=n(901),Xo=n(902),_o=n(857),Ko=n(908),Zo=n(122),Yo=n.n(Zo),Qo={title:{paddingTop:8},input:{marginBottom:25,marginTop:-15},wrapper:{padding:"2.5em 4em",width:575,display:"flex",flexDirection:"column"},titleWrapper:{display:"flex",flexDirection:"row",alignItems:"center",marginBottom:30},rememberMeWrapper:{marginTop:35,display:"flex",flexDirection:"row"},icon:{transform:"scale(1.5)",marginRight:25},checkbox:{transform:"scale(1.5)",marginRight:5,marginLeft:-5},footer:{marginTop:"10vh"},twofaFooter:{marginTop:"6vh"},fidoLoginButtonWrapper:{marginBottom:12},loginButton:{display:"block",width:"100%"},welcomeBackground:{background:"url(/wizard-background.svg) no-repeat center center fixed",backgroundColor:re,backgroundSize:"cover",height:"100vh",width:"100vw",position:"relative",left:"50%",right:"50%",marginLeft:"-50vw",marginRight:"-50vw",minHeight:"100vh"},info:{marginBottom:"5vh"},info2:{textAlign:"justify"},infoWrapper:{marginBottom:"3vh"},errorMessage:{color:me},qrCodeWrapper:{display:"flex",justifyContent:"center",marginBottom:"3vh"},secretWrapper:{display:"flex",justifyContent:"center",alignItems:"center"},secretLabel:{marginRight:15},secret:{marginRight:35},hiddenSecret:{marginRight:35,filter:"blur(8px)"},confirm2FAInput:{marginTop:25},confirmPassword:{marginTop:25},error:{color:me}},Jo="LOGIN",ec="SETUP2FA",tc="INPUT2FA",nc="FIDO",rc=Object(j.a)(Qo),ac=x()(lo||(lo=Object(l.a)(["\n mutation input2FA(\n $username: String!\n $password: String!\n $code: String!\n $rememberMe: Boolean!\n ) {\n input2FA(\n username: $username\n password: $password\n code: $code\n rememberMe: $rememberMe\n )\n }\n"]))),ic=x()(so||(so=Object(l.a)(["\n {\n userData {\n id\n username\n role\n }\n }\n"]))),oc=function(e){var t=e.state,n=e.dispatch,a=rc(),i=Object(w.h)(),o=Object(r.useContext)(k).setUserData,l=Object(r.useState)(!1),s=Object(c.a)(l,2),d=s[0],m=s[1],h=Object(u.a)(ic,{onCompleted:function(e){var t=e.userData;o(t),i.push("/")}}),b=Object(c.a)(h,2),p=b[0],j=b[1].error,f=Object(u.b)(ac,{onCompleted:function(e){if(e.input2FA){var n={context:{headers:{"Pazuz-Operator-Identifier":Yo.a.encode(t.clientField)}}};return p(n)}return m(!0)}}),g=Object(c.a)(f,2),O=g[0],x=g[1].error,v=j?"Internal server error":6!==t.twoFAField.length&&d?"The code should have 6 characters!":x||d?"Code is invalid. Please try again.":null;return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Qe,{className:a.info,children:"Enter your two-factor authentication code"}),Object(Me.jsx)(ha,{name:"2fa",value:t.twoFAField,onChange:function(e){n({type:tc,payload:{twoFAField:e}}),m(!1)},numInputs:6,error:d,shouldAutoFocus:!0}),Object(Me.jsxs)("div",{className:a.twofaFooter,children:[v&&Object(Me.jsx)(Xe,{className:a.errorMessage,children:v}),Object(Me.jsx)(Tn,{onClick:function(){if(6===t.twoFAField.length){var e={variables:{username:t.clientField,password:t.passwordField,code:t.twoFAField,rememberMe:t.rememberMeField},context:{headers:{"Pazuz-Operator-Identifier":Yo.a.encode(t.clientField)}}};O(e)}else m(!0)},buttonClassName:a.loginButton,children:"Login"})]})]})},cc=n(180),lc=Object(j.a)(Qo),sc=x()(uo||(uo=Object(l.a)(["\n {\n userData {\n id\n username\n role\n }\n }\n"]))),dc=xn.e().shape({localClient:xn.g().required("Client field is required!").email("Username field should be in an email format!"),localRememberMe:xn.b()}),uc={localClient:"",localRememberMe:!1},mc=function(e){var t=e.state,n=e.strategy,a=x()(mo||(mo=Object(l.a)(["\n query generateAssertionOptions($username: String!",") {\n generateAssertionOptions(username: $username",")\n }\n "])),"FIDO2FA"===n?", $password: String!":"","FIDO2FA"===n?", password: $password":""),i=x()(ho||(ho=Object(l.a)(["\n mutation validateAssertion(\n $username: String!\n ","\n $rememberMe: Boolean!\n $assertionResponse: JSONObject!\n ) {\n validateAssertion(\n username: $username\n ","\n rememberMe: $rememberMe\n assertionResponse: $assertionResponse\n )\n }\n "])),"FIDO2FA"===n?", $password: String!":"","FIDO2FA"===n?"password: $password":""),o=lc(),s=Object(w.h)(),d=Object(r.useContext)(k).setUserData,m=Object(r.useState)(""),h=Object(c.a)(m,2),b=h[0],p=h[1],j=Object(r.useState)(!1),f=Object(c.a)(j,2),g=f[0],O=f[1],v=Object(r.useState)(!1),y=Object(c.a)(v,2),C=y[0],S=y[1],N=Object(r.useState)(!1),I=Object(c.a)(N,2),E=I[0],F=I[1],L=Object(u.b)(i,{onCompleted:function(e){e.validateAssertion?$():F(!0)}}),D=Object(c.a)(L,2),P=D[0],B=D[1].error,R=Object(u.a)(a,{variables:"FIDO2FA"===n?{username:t.clientField,password:t.passwordField}:{username:b},onCompleted:function(e){var r=e.generateAssertionOptions;Object(cc.a)(r).then((function(e){var r="FIDO2FA"===n?{username:t.clientField,password:t.passwordField,rememberMe:t.rememberMeField,assertionResponse:e}:{username:b,rememberMe:g,assertionResponse:e};P({variables:r})})).catch((function(e){console.error(e),F(!0)}))}}),A=Object(c.a)(R,2),T=A[0],M=A[1].error,W=Object(u.a)(sc,{onCompleted:function(e){var t=e.userData;d(t),s.push("/")}}),z=Object(c.a)(W,2),$=z[0],q=z[1].error,H=function(e,t){return e&&t?M||q||B?"Internal server error":e.client&&t.client?e.client:C?"Invalid login.":E?"Code is invalid. Please try again.":null:null};return Object(Me.jsxs)(Me.Fragment,{children:["FIDOPasswordless"===n&&Object(Me.jsx)(pn.d,{validationSchema:dc,initialValues:uc,onSubmit:function(e){S(!1),p(e.localClient),O(e.localRememberMe),T()},children:function(e){var t=e.errors,n=e.touched;return Object(Me.jsxs)(pn.c,{id:"fido-form",children:[Object(Me.jsx)(pn.b,{name:"localClient",label:"Client",size:"lg",component:Ua,fullWidth:!0,autoFocus:!0,className:o.input,error:H(t,n),onKeyUp:function(){C&&S(!1)}}),Object(Me.jsxs)("div",{className:o.rememberMeWrapper,children:[Object(Me.jsx)(pn.b,{name:"localRememberMe",className:o.checkbox,component:$a}),Object(Me.jsx)(tt,{className:o.inputLabel,children:"Keep me logged in"})]}),Object(Me.jsxs)("div",{className:o.twofaFooter,children:[H(t,n)&&Object(Me.jsx)(Xe,{className:o.errorMessage,children:H(t,n)}),Object(Me.jsx)(Tn,{type:"submit",form:"fido-form",buttonClassName:o.loginButton,children:"Use FIDO"})]})]})}}),"FIDO2FA"===n&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(He,{className:o.info,children:"Insert your hardware key and follow the instructions"}),Object(Me.jsx)(Tn,{type:"button",form:"fido-form",onClick:function(){return T()},buttonClassName:o.loginButton,children:"Use FIDO"})]})]})},hc=n(31),bc=n.n(hc),pc=n(61),jc=Object(j.a)(Qo),fc=x()(bo||(bo=Object(l.a)(["\n mutation login($username: String!, $password: String!) {\n login(username: $username, password: $password)\n }\n"]))),gc=x()(po||(po=Object(l.a)(["\n query generateAssertionOptions {\n generateAssertionOptions\n }\n"]))),Oc=x()(jo||(jo=Object(l.a)(["\n mutation validateAssertion($assertionResponse: JSONObject!) {\n validateAssertion(assertionResponse: $assertionResponse)\n }\n"]))),xc=x()(fo||(fo=Object(l.a)(["\n {\n userData {\n id\n username\n role\n }\n }\n"]))),vc=xn.e().shape({client:xn.g().required("Client field is required!").email("Username field should be in an email format!"),password:xn.g().required("Password field is required"),rememberMe:xn.b()}),yc={client:"",password:"",rememberMe:!1},wc=function(e,t,n){return e&&t?n?"Invalid login/password combination":e.client&&t.client?e.client:e.password&&t.password?e.password:null:null},Cc=function(e){e.state;var t=e.dispatch,n=e.strategy,a=jc(),i=Object(w.h)(),o=Object(r.useContext)(k).setUserData,l=Object(u.b)(fc),s=Object(c.a)(l,2),d=s[0],m=s[1].error,h=function(){var e=Object(pc.a)(bc.a.mark((function e(n,r,a){var i,o,c;return bc.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i={variables:{username:n,password:r},context:{headers:{"Pazuz-Operator-Identifier":Yo.a.encode(n)}}},e.next=3,d(i);case 3:if(o=e.sent,(c=o.data).login){e.next=7;break}return e.abrupt("return");case 7:return e.abrupt("return",t({type:c.login,payload:{clientField:n,passwordField:r,rememberMeField:a}}));case 8:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}(),b=Object(u.b)(Oc,{onCompleted:function(e){return e.validateAssertion&&S()}}),p=Object(c.a)(b,2),j=p[0],f=p[1].error,g=Object(u.a)(gc,{onCompleted:function(e){var t=e.generateAssertionOptions;Object(cc.a)(t).then((function(e){j({variables:{assertionResponse:e}})})).catch((function(e){console.error(e)}))}}),O=Object(c.a)(g,2),x=O[0],v=O[1].error,y=Object(u.a)(xc,{onCompleted:function(e){var t=e.userData;o(t),i.push("/")}}),C=Object(c.a)(y,2),S=C[0],N=C[1].error;return Object(Me.jsx)(pn.d,{validationSchema:vc,initialValues:yc,onSubmit:function(e){return h(e.client,e.password,e.rememberMe)},children:function(e){var r=e.errors,i=e.touched;return Object(Me.jsxs)(pn.c,{id:"login-form",children:[Object(Me.jsx)(pn.b,{name:"client",label:"Client",size:"lg",component:Ua,fullWidth:!0,autoFocus:!0,className:a.input,error:wc(r,i,m||f||v||N)}),Object(Me.jsx)(pn.b,{name:"password",size:"lg",component:Va,label:"Password",fullWidth:!0,error:wc(r,i,m||f||v||N)}),Object(Me.jsxs)("div",{className:a.rememberMeWrapper,children:[Object(Me.jsx)(pn.b,{name:"rememberMe",className:a.checkbox,component:$a}),Object(Me.jsx)(nt,{children:"Keep me logged in"})]}),Object(Me.jsxs)("div",{className:a.footer,children:[wc(r,i,m||f||v||N)&&Object(Me.jsx)(Xe,{className:a.errorMessage,children:wc(r,i,m||f||v||N)}),"FIDO2FA"!==n&&Object(Me.jsx)(Tn,{type:"button",onClick:function(){return"FIDOUsernameless"===n?x():t({type:"FIDO",payload:{}})},buttonClassName:a.loginButton,className:a.fidoLoginButtonWrapper,children:"I have a hardware key"}),Object(Me.jsx)(Tn,{type:"submit",form:"login-form",buttonClassName:a.loginButton,children:"Login"})]})]})}})},kc=x()(go||(go=Object(l.a)(["\n mutation setup2FA(\n $username: String!\n $password: String!\n $rememberMe: Boolean!\n $codeConfirmation: String!\n ) {\n setup2FA(\n username: $username\n password: $password\n rememberMe: $rememberMe\n codeConfirmation: $codeConfirmation\n )\n }\n"]))),Sc=x()(Oo||(Oo=Object(l.a)(["\n query get2FASecret($username: String!, $password: String!) {\n get2FASecret(username: $username, password: $password) {\n secret\n otpauth\n }\n }\n"]))),Nc=x()(xo||(xo=Object(l.a)(["\n {\n userData {\n id\n username\n role\n }\n }\n"]))),Ic=Object(j.a)(Qo),Ec=function(e){var t=e.state,n=(e.dispatch,Ic()),a=Object(w.h)(),i=Object(r.useContext)(k).setUserData,o=Object(r.useState)(null),l=Object(c.a)(o,2),s=l[0],d=l[1],m=Object(r.useState)(null),h=Object(c.a)(m,2),b=h[0],p=h[1],j=Object(r.useState)(!1),f=Object(c.a)(j,2),g=f[0],O=f[1],x=Object(r.useState)(!1),v=Object(c.a)(x,2),y=v[0],C=v[1],S=Object(r.useState)(""),N=Object(c.a)(S,2),I=N[0],E=N[1],F={variables:{username:t.clientField,password:t.passwordField},context:{headers:{"Pazuz-Operator-Identifier":Yo.a.encode(t.clientField)}},onCompleted:function(e){var t=e.get2FASecret;d(t.secret),p(t.otpauth)}},L={variables:{username:t.clientField,password:t.passwordField,rememberMe:t.rememberMeField,codeConfirmation:I},context:{headers:{"Pazuz-Operator-Identifier":Yo.a.encode(t.clientField)}}},D=Object(u.c)(Sc,F).error,P=Object(u.a)(Nc,{onCompleted:function(e){var t=e.userData;i(t),a.push("/")}}),B=Object(c.a)(P,1)[0],R=Object(u.b)(kc,{onCompleted:function(e){var n=e.setup2FA,r={context:{headers:{"Pazuz-Operator-Identifier":Yo.a.encode(t.clientField)}}};n?B(r):C(!0)}}),A=Object(c.a)(R,2),T=A[0],M=A[1].error,W=function(){return M||D?"Internal server error.":6!==I.length&&y?"The code should have 6 characters!":y?"Code is invalid. Please try again.":null};return s&&b&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)("div",{className:n.infoWrapper,children:[Object(Me.jsx)(nt,{className:n.info2,children:"We detected that this account does not have its two-factor authentication enabled. In order to protect the resources in the system, a two-factor authentication is enforced."}),Object(Me.jsx)(nt,{className:n.info2,children:"To finish this process, please scan the following QR code or insert the secret further below on an authentication app of your choice, such as Google Authenticator or Authy."})]}),Object(Me.jsx)("div",{className:n.qrCodeWrapper,children:Object(Me.jsx)(fn.a,{size:240,fgColor:J,value:b})}),Object(Me.jsxs)("div",{className:n.secretWrapper,children:[Object(Me.jsx)(nt,{className:n.secretLabel,children:"Your secret:"}),Object(Me.jsx)(nt,{className:g?n.secret:n.hiddenSecret,children:s}),Object(Me.jsx)(ze,{disabled:!s&&!b,color:"primary",onClick:function(){O(!g)},children:g?"Hide":"Show"})]}),Object(Me.jsx)("div",{className:n.confirm2FAInput,children:Object(Me.jsx)(ha,{name:"2fa",value:I,onChange:function(e){E(e),C(!1)},numInputs:6,error:y,shouldAutoFocus:!0})}),Object(Me.jsxs)("div",{className:n.twofaFooter,children:[W()&&Object(Me.jsx)(Xe,{className:n.errorMessage,children:W()}),Object(Me.jsx)(Tn,{onClick:function(){6===I.length?T(L):C(!0)},buttonClassName:n.loginButton,children:"Done"})]})]})},Fc="FIDO2FA",Lc=Object(j.a)(Qo),Dc={twoFAField:"",clientField:"",passwordField:"",rememberMeField:!1,loginState:Jo},Pc=function(e,t){var n=t.type,r=t.payload;return Object(s.a)(Object(s.a)(Object(s.a)({},e),r),{},{loginState:n})},Bc=function(){var e=Lc(),t=Object(r.useReducer)(Pc,Dc),n=Object(c.a)(t,2),a=n[0],i=n[1];return Object(Me.jsx)(Un.a,{elevation:1,children:Object(Me.jsxs)("div",{className:e.wrapper,children:[Object(Me.jsxs)("div",{className:e.titleWrapper,children:[Object(Me.jsx)(Zi,{className:e.icon}),Object(Me.jsx)(Ge,{className:e.title,children:"Lamassu Admin"})]}),function(){switch(a.loginState){case Jo:return Object(Me.jsx)(Cc,{state:a,dispatch:i,strategy:Fc});case tc:return Object(Me.jsx)(oc,{state:a,dispatch:i});case ec:return Object(Me.jsx)(Ec,{state:a,dispatch:i});case nc:return Object(Me.jsx)(mc,{state:a,strategy:Fc})}}()]})})},Rc=Object(j.a)(Qo),Ac=function(){var e=Rc();return Object(Me.jsx)(h.a,{container:!0,spacing:0,direction:"column",alignItems:"center",justify:"center",className:e.welcomeBackground,children:Object(Me.jsx)(h.a,{children:Object(Me.jsx)(Bc,{})})})},Tc=function(){return new URLSearchParams(Object(w.i)().search)},Mc=Object(j.a)(Qo),Wc=x()(vo||(vo=Object(l.a)(["\n query validateRegisterLink($token: String!) {\n validateRegisterLink(token: $token) {\n username\n role\n }\n }\n"]))),zc=x()(yo||(yo=Object(l.a)(["\n mutation register(\n $token: String!\n $username: String!\n $password: String!\n $role: String!\n ) {\n register(\n token: $token\n username: $username\n password: $password\n role: $role\n )\n }\n"]))),$c=xn.e().shape({password:xn.g().required("A password is required").test("len","Your password must contain more than 8 characters",(function(e){return e.length>=8})),confirmPassword:xn.g().oneOf([xn.f("password"),null],"Passwords must match")}),qc={password:"",confirmPassword:""},Hc={username:null,role:null,result:""},Vc=function(e,t){var n=t.type,r=t.payload;return Object(s.a)(Object(s.a)(Object(s.a)({},e),r),{},{result:n})},Uc=function(e,t,n,r){return e&&t?n||r?"Internal server error":e.password&&t.password?e.password:e.confirmPassword&&t.confirmPassword?e.confirmPassword:null:null},Gc=function(){var e,t=Mc(),n=Object(w.h)(),a=Tc().get("t"),i=null!==(e=Tc().get("id"))&&void 0!==e?e:null,o=Object(r.useReducer)(Vc,Hc),l=Object(c.a)(o,2),s=l[0],d=l[1],m={context:{headers:{"Pazuz-Operator-Identifier":i}},variables:{token:a},onCompleted:function(e){var t=e.validateRegisterLink;if(!t)return d({type:"failure"});d({type:"success",payload:{username:t.username,role:t.role}})},onError:function(){return d({type:"failure"})}},b=Object(u.c)(Wc,m),p=b.error,j=b.loading,f=Object(u.b)(zc,{onCompleted:function(e){e.register&&n.push("/wizard",{fromAuthRegister:!0})}}),g=Object(c.a)(f,2),O=g[0],x=g[1].error;return Object(Me.jsx)(h.a,{container:!0,spacing:0,direction:"column",alignItems:"center",justify:"center",className:t.welcomeBackground,children:Object(Me.jsx)(h.a,{children:Object(Me.jsx)("div",{children:Object(Me.jsx)(Un.a,{elevation:1,children:Object(Me.jsxs)("div",{className:t.wrapper,children:[Object(Me.jsxs)("div",{className:t.titleWrapper,children:[Object(Me.jsx)(Zi,{className:t.icon}),Object(Me.jsx)(He,{className:t.title,children:"Lamassu Admin"})]}),!j&&"success"===s.result&&Object(Me.jsx)(pn.d,{validationSchema:$c,initialValues:qc,onSubmit:function(e){O({variables:{token:a,username:s.username,password:e.password,role:s.role}})},children:function(e){var n=e.errors,r=e.touched;return Object(Me.jsxs)(pn.c,{id:"register-form",children:[Object(Me.jsx)(pn.b,{name:"password",label:"Insert a password",autoFocus:!0,component:Va,size:"lg",fullWidth:!0,className:t.input}),Object(Me.jsx)(pn.b,{name:"confirmPassword",label:"Confirm your password",component:Va,size:"lg",fullWidth:!0}),Object(Me.jsxs)("div",{className:t.footer,children:[Uc(n,r,p,x)&&Object(Me.jsx)(Xe,{className:t.errorMessage,children:Uc(n,r,p,x)}),Object(Me.jsx)(Tn,{type:"submit",form:"register-form",buttonClassName:t.loginButton,children:"Done"})]})]})}}),!j&&"failure"===s.result&&Object(Me.jsx)(Me.Fragment,{children:Object(Me.jsx)(nt,{children:"Link has expired"})})]})})})})})},Xc=Object(j.a)(Qo),_c=x()(wo||(wo=Object(l.a)(["\n query validateReset2FALink($token: String!) {\n validateReset2FALink(token: $token) {\n user_id\n secret\n otpauth\n }\n }\n"]))),Kc=x()(Co||(Co=Object(l.a)(["\n mutation reset2FA($token: String!, $userID: ID!, $code: String!) {\n reset2FA(token: $token, userID: $userID, code: $code)\n }\n"]))),Zc={userID:null,secret:null,otpauth:null,result:null},Yc=function(e,t){var n=t.type,r=t.payload;return Object(s.a)(Object(s.a)(Object(s.a)({},e),r),{},{result:n})},Qc=function(){var e=Xc(),t=Object(w.h)(),n=new URLSearchParams(Object(w.i)().search).get("t"),a=Object(r.useState)(!1),i=Object(c.a)(a,2),o=i[0],l=i[1],s=Object(r.useState)(!1),d=Object(c.a)(s,2),m=d[0],b=d[1],p=Object(r.useState)(""),j=Object(c.a)(p,2),f=j[0],g=j[1],O=Object(r.useReducer)(Yc,Zc),x=Object(c.a)(O,2),v=x[0],y=x[1],C=Object(u.c)(_c,{variables:{token:n},onCompleted:function(e){var t=e.validateReset2FALink;y(t?{type:"success",payload:{userID:t.user_id,secret:t.secret,otpauth:t.otpauth}}:{type:"failure"})},onError:function(){y({type:"failure"})}}),k=C.error,S=C.loading,N=Object(u.b)(Kc,{onCompleted:function(e){e.reset2FA?t.push("/"):b(!0)}}),I=Object(c.a)(N,2),E=I[0],F=I[1].error,L=function(){return k?"Internal server error":6!==f.length&&m?"The code should have 6 characters!":F||m?"Code is invalid. Please try again.":null};return Object(Me.jsx)(h.a,{container:!0,spacing:0,direction:"column",alignItems:"center",justify:"center",className:e.welcomeBackground,children:Object(Me.jsx)(h.a,{children:Object(Me.jsx)("div",{children:Object(Me.jsx)(Un.a,{elevation:1,children:Object(Me.jsxs)("div",{className:e.wrapper,children:[Object(Me.jsxs)("div",{className:e.titleWrapper,children:[Object(Me.jsx)(Zi,{className:e.icon}),Object(Me.jsx)(He,{className:e.title,children:"Lamassu Admin"})]}),!S&&"success"===v.result&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)("div",{className:e.infoWrapper,children:Object(Me.jsx)(tt,{className:e.info2,children:"To finish this process, please scan the following QR code or insert the secret further below on an authentication app of your choice, such Google Authenticator or Authy."})}),Object(Me.jsx)("div",{className:e.qrCodeWrapper,children:Object(Me.jsx)(fn.a,{size:240,fgColor:J,value:v.otpauth})}),Object(Me.jsxs)("div",{className:e.secretWrapper,children:[Object(Me.jsx)(tt,{className:e.secretLabel,children:"Your secret:"}),Object(Me.jsx)(tt,{className:o?e.secret:e.hiddenSecret,children:v.secret}),Object(Me.jsx)(ze,{color:"primary",onClick:function(){l(!o)},children:o?"Hide":"Show"})]}),Object(Me.jsx)("div",{className:e.confirm2FAInput,children:Object(Me.jsx)(ha,{name:"2fa",value:f,onChange:function(e){g(e),b(!1)},numInputs:6,error:m,shouldAutoFocus:!0})}),Object(Me.jsxs)("div",{className:e.twofaFooter,children:[L()&&Object(Me.jsx)(Xe,{className:e.errorMessage,children:L()}),Object(Me.jsx)(Tn,{onClick:function(){6===f.length?E({variables:{token:n,userID:v.userID,code:f}}):b(!0)},buttonClassName:e.loginButton,children:"Done"})]})]}),!S&&"failure"===v.result&&Object(Me.jsx)(Me.Fragment,{children:Object(Me.jsx)(nt,{children:"Link has expired"})})]})})})})})},Jc=Object(j.a)(Qo),el=x()(ko||(ko=Object(l.a)(["\n query validateResetPasswordLink($token: String!) {\n validateResetPasswordLink(token: $token) {\n id\n }\n }\n"]))),tl=x()(So||(So=Object(l.a)(["\n mutation resetPassword($token: String!, $userID: ID!, $newPassword: String!) {\n resetPassword(token: $token, userID: $userID, newPassword: $newPassword)\n }\n"]))),nl=xn.e().shape({password:xn.g().required("A new password is required").test("len","New password must contain more than 8 characters",(function(e){return e.length>=8})),confirmPassword:xn.g().oneOf([xn.f("password"),null],"Passwords must match")}),rl={password:"",confirmPassword:""},al=function(e,t,n){return e&&t?n?"Internal server error":e.password&&t.password?e.password:e.confirmPassword&&t.confirmPassword?e.confirmPassword:null:null},il=function(){var e=Jc(),t=Object(w.h)(),n=new URLSearchParams(Object(w.i)().search).get("t"),a=Object(r.useState)(null),i=Object(c.a)(a,2),o=i[0],l=i[1],s=Object(r.useState)(!0),d=Object(c.a)(s,2),m=d[0],b=d[1],p=Object(r.useState)(!1),j=Object(c.a)(p,2),f=j[0],g=j[1];Object(u.c)(el,{variables:{token:n},onCompleted:function(e){var t=e.validateResetPasswordLink;b(!1),t?(g(!0),l(t.id)):g(!1)},onError:function(){b(!1),g(!1)}});var O=Object(u.b)(tl,{onCompleted:function(e){e.resetPassword&&t.push("/")}}),x=Object(c.a)(O,2),v=x[0],y=x[1].error;return Object(Me.jsx)(h.a,{container:!0,spacing:0,direction:"column",alignItems:"center",justify:"center",className:e.welcomeBackground,children:Object(Me.jsx)(h.a,{children:Object(Me.jsx)("div",{children:Object(Me.jsx)(Un.a,{elevation:1,children:Object(Me.jsxs)("div",{className:e.wrapper,children:[Object(Me.jsxs)("div",{className:e.titleWrapper,children:[Object(Me.jsx)(Zi,{className:e.icon}),Object(Me.jsx)(He,{className:e.title,children:"Lamassu Admin"})]}),!m&&f&&Object(Me.jsx)(pn.d,{validationSchema:nl,initialValues:rl,onSubmit:function(e){v({variables:{token:n,userID:o,newPassword:e.confirmPassword}})},children:function(t){var n=t.errors,r=t.touched;return Object(Me.jsxs)(pn.c,{id:"reset-password",children:[Object(Me.jsx)(pn.b,{name:"password",autoFocus:!0,size:"lg",component:Va,label:"New password",fullWidth:!0,className:e.input}),Object(Me.jsx)(pn.b,{name:"confirmPassword",size:"lg",component:Va,label:"Confirm your password",fullWidth:!0}),Object(Me.jsxs)("div",{className:e.footer,children:[al(n,r,y)&&Object(Me.jsx)(Xe,{className:e.errorMessage,children:al(n,r,y)}),Object(Me.jsx)(Tn,{type:"submit",form:"reset-password",buttonClassName:e.loginButton,children:"Done"})]})]})}}),!m&&!f&&Object(Me.jsx)(Me.Fragment,{children:Object(Me.jsx)(nt,{children:"Link has expired"})})]})})})})})};function ol(){return(ol=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function cl(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var ll=r.createElement("desc",null,"Created with Sketch."),sl=r.createElement("g",{id:"Styleguide",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"icon/direction/cash-in",transform:"translate(-1.000000, 0.000000)",fill:"#16D6D3"},r.createElement("path",{d:"M3.99134364,0.321790399 L10.1430099,4.40569595 C11.0271728,4.99266501 11.2660914,6.1822461 10.6766494,7.06269968 C10.5357408,7.27317585 10.3543728,7.45378298 10.1430099,7.59410043 L3.99134364,11.678006 C3.10718075,12.264975 1.91258801,12.0270588 1.32314609,11.1466052 C1.11243854,10.8318699 1,10.4620686 1,10.0838037 L1,1.91599264 C1,0.857819122 1.86143307,0 2.92406462,0 C3.30392305,0 3.67528233,0.11196683 3.99134364,0.321790399 Z",id:"Path-3"})));function dl(e,t){var n=e.title,a=e.titleId,i=cl(e,["title","titleId"]);return r.createElement("svg",ol({width:"10px",height:"12px",viewBox:"0 0 10 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,ll,sl)}var ul=r.forwardRef(dl);n.p;function ml(){return(ml=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function hl(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var bl=r.createElement("desc",null,"Created with Sketch."),pl=r.createElement("g",{id:"Styleguide",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"icon/direction/cash-out",transform:"translate(-1.000000, 0.000000)",fill:"#5A67FF"},r.createElement("path",{d:"M3.99134364,0.321790399 L10.1430099,4.40569595 C11.0271728,4.99266501 11.2660914,6.1822461 10.6766494,7.06269968 C10.5357408,7.27317585 10.3543728,7.45378298 10.1430099,7.59410043 L3.99134364,11.678006 C3.10718075,12.264975 1.91258801,12.0270588 1.32314609,11.1466052 C1.11243854,10.8318699 1,10.4620686 1,10.0838037 L1,1.91599264 C1,0.857819122 1.86143307,0 2.92406462,0 C3.30392305,0 3.67528233,0.11196683 3.99134364,0.321790399 Z",id:"Path-3",transform:"translate(6.000000, 6.000000) scale(-1, 1) translate(-6.000000, -6.000000) "})));function jl(e,t){var n=e.title,a=e.titleId,i=hl(e,["title","titleId"]);return r.createElement("svg",ml({width:"10px",height:"12px",viewBox:"0 0 10 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,bl,pl)}var fl,gl=r.forwardRef(jl),Ol=(n.p,{headerLabels:{display:"flex",flexDirection:"row"},headerLabelContainerMargin:{marginRight:24},headerLabelContainer:{display:"flex",alignItems:"center"},headerLabelSpan:{extend:Re.label1,marginLeft:6},root:{flexGrow:1,display:"flex",marginBottom:120},card:{wordWrap:"break-word",boxShadow:"0 0 4px 0 rgba(0, 0, 0, 0.08)",borderRadius:12,padding:24,backgroundColor:Z,flex:1,marginRight:24},container:{display:"flex",justifyContent:"space-between"},button:{color:J,minHeight:0,minWidth:0,padding:0,textTransform:"none","&:hover":{backgroundColor:"transparent"}},upperButtonLabel:{textAlign:"center",marginBottom:0,marginTop:0,marginLeft:8},alertsCard:{marginBottom:8},h4:{marginTop:0},centerLabel:{marginTop:40,marginBottom:0},systemStatusCard:{flex:1,marginTop:8},expandedCard:{flex:.9},shrunkCard:{flex:.1},displayFlex:{display:"flex",flexDirection:"column"}}),xl=n(35),vl=n.n(xl),yl=n(91),wl=n(817),Cl=n(818),kl=n(427),Sl=n(819),Nl=n(820),Il="cashOut",El="wallets",Fl="operatorInfo",Ll="notifications",Dl="locale",Pl="commissions",Bl="receipt",Rl="coinAtmRadar",Al="termsConditions",Tl="triggersConfig",Ml=wl.a((function(e,t){return Cl.a(B.a(kl.a(0,e),Sl.a(t)))})),Wl=wl.a((function(e,t){return Cl.a(M.a((function(t){return e(t[0])}),Sl.a(t)))})),zl=wl.a((function(e,t){return Nl.a(e,t)?t.slice(e.length):t})),$l=wl.a((function(e,t){return L.a(function(e){return Ml(zl("".concat(e,"_")))}(e),function(e){return Wl(Nl.a("".concat(e,"_")))}(e))(t)})),ql=wl.a((function(e,t){return Ml((function(t){return"".concat(e,"_").concat(t)}))(t)})),Hl={label:{color:se},headerLabels:{whiteSpace:"pre",display:"flex",flexDirection:"row",marginTop:-20},headerLabel:{display:"flex",alignItems:"center"},txOutMargin:{marginLeft:24},footer:function(e){var t=e.expanded,n=e.bigFooter;return{height:t&&n?312:t?208:96,left:0,bottom:0,position:"fixed",width:"100vw",backgroundColor:Z,textAlign:"left",boxShadow:"0px -1px 10px 0px rgba(50, 50, 50, 0.1)"}},tickerLabel:{color:se,marginTop:-5},content:{width:1200,backgroundColor:Z,zIndex:1,position:"fixed",bottom:-8,transform:"translateY(-100%)"},footerContainer:function(e){var t=e.expanded,n=e.bigFooter;return{marginLeft:40,height:100,marginTop:t&&n?-300:t?-200:-100,overflow:!t&&"hidden"}},mouseWatcher:function(e){var t=e.expanded,n=e.bigFooter;return{position:"fixed",bottom:0,left:0,width:"100vw",height:t&&n?312:t?208:96,zIndex:2}}},Vl=x()(fl||(fl=Object(l.a)(["\n query getData {\n cryptoRates\n cryptoCurrencies {\n code\n display\n }\n config\n accountsConfig {\n code\n display\n }\n }\n"])));vl.a.config({ROUNDING_MODE:vl.a.ROUND_HALF_UP});var Ul=Object(j.a)(Hl),Gl=function(){var e,t,n,a,i,o=Object(u.c)(Vl).data,l=Object(r.useState)(!1),s=Object(c.a)(l,2),d=s[0],m=s[1],b=Object(r.useState)(null),p=Object(c.a)(b,2),j=p[0],f=p[1],g=null!==(e=T.a(["cryptoRates","withCommissions"])(o))&&void 0!==e?e:{},O=Ul({bigFooter:yl.a(g).length>8,expanded:d}),x=null!==(t=T.a(["config"])(o))&&void 0!==t?t:{},v=yl.a(g).length>4,y=$l("wallets")(x),w=null!==(n=T.a(["cryptoCurrencies"])(o))&&void 0!==n?n:[],C=null!==(a=T.a(["accountsConfig"])(o))&&void 0!==a?a:[],k=null!==(i=T.a(["locale_fiatCurrency"])(x))&&void 0!==i?i:"";return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)("div",{className:O.mouseWatcher,onMouseLeave:function(){clearTimeout(j),m(!1)},onMouseEnter:function(){f(setTimeout((function(){return v&&m(!0)}),300))}}),Object(Me.jsx)("div",{className:O.content,children:Object(Me.jsx)(h.a,{container:!0,spacing:1,children:Object(Me.jsx)(h.a,{container:!0,className:O.footerContainer,children:yl.a(g).map((function(e){return function(e){var t=Ko.a(W.a("code",e))(w),n=y["".concat(e,"_ticker")],r=Ko.a(W.a("code",n))(C),a=r>-1?C[r].display:"",i=parseFloat(T.a(["cryptoRates","withoutCommissions",e,"cashIn"])(o)),c=parseFloat(T.a(["cryptoRates","withoutCommissions",e,"cashOut"])(o)),l=new vl.a((i+c)/2).toFormat(2),s=new vl.a(parseFloat(T.a(["cryptoRates","withCommissions",e,"cashIn"])(o))).toFormat(2),d=new vl.a(parseFloat(T.a(["cryptoRates","withCommissions",e,"cashOut"])(o))).toFormat(2);return Object(Me.jsxs)(h.a,{item:!0,xs:3,children:[Object(Me.jsx)(tt,{className:O.label,children:w[t].display}),Object(Me.jsxs)("div",{className:O.headerLabels,children:[Object(Me.jsxs)("div",{className:O.headerLabel,children:[Object(Me.jsx)(ul,{}),Object(Me.jsx)(tt,{children:" ".concat(s," ").concat(k)})]}),Object(Me.jsxs)("div",{className:E()(O.headerLabel,O.txOutMargin),children:[Object(Me.jsx)(gl,{}),Object(Me.jsx)(tt,{children:" ".concat(d," ").concat(k)})]})]}),Object(Me.jsx)(tt,{className:O.tickerLabel,children:"".concat(a,": ").concat(l," ").concat(k)})]},e)}(e)}))})})}),Object(Me.jsx)("div",{className:O.footer})]})},Xl=n(824),_l=n(922),Kl=n(825),Zl=n(172),Yl=n(893);function Ql(){return(Ql=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Jl(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var es=r.createElement("g",{id:"icon/label/icon/down",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"Group-6"},r.createElement("circle",{id:"Oval",fill:"#FFECEB",cx:6,cy:6,r:6}),r.createElement("g",{id:"Group-5",transform:"translate(6.096194, 6.096194) rotate(-315.000000) translate(-6.096194, -6.096194) translate(2.596194, 3.096194)",stroke:"#FF584A"},r.createElement("polyline",{id:"Path-2",points:"3.15780333 -4.54747351e-13 6.15780333 2.82998193 3.15780333 5.65996386"}),r.createElement("line",{x1:5.42178888,y1:2.82998193,x2:-545696821e-21,y2:2.82998193,id:"Path-3"}))));function ts(e,t){var n=e.title,a=e.titleId,i=Jl(e,["title","titleId"]);return r.createElement("svg",Ql({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,es)}var ns=r.forwardRef(ts);n.p;function rs(){return(rs=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function as(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var is=r.createElement("g",{id:"icon/label/icon/equal",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"Group-6",fill:"#EBEFFF"},r.createElement("circle",{id:"Oval",cx:6,cy:6,r:6})),r.createElement("g",{id:"Group",transform:"translate(4.000000, 4.000000)",stroke:"#5F668A",strokeLinecap:"square"},r.createElement("line",{x1:0,y1:1,x2:4,y2:1,id:"Line-12"}),r.createElement("line",{x1:0,y1:3,x2:4,y2:3,id:"Line-12"})));function os(e,t){var n=e.title,a=e.titleId,i=as(e,["title","titleId"]);return r.createElement("svg",rs({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,is)}var cs=r.forwardRef(os);n.p;function ls(){return(ls=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function ss(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var ds=r.createElement("g",{id:"icon/label/icon/up",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"Group-6"},r.createElement("circle",{id:"Oval",fill:"#ECFBEF",cx:6,cy:6,r:6}),r.createElement("g",{id:"Group-5",transform:"translate(6.096194, 6.096194) rotate(-45.000000) translate(-6.096194, -6.096194) translate(2.596194, 3.096194)",stroke:"#00CD5A"},r.createElement("polyline",{id:"Path-2",points:"3.15780333 -4.54747351e-13 6.15780333 2.82998193 3.15780333 5.65996386"}),r.createElement("line",{x1:5.42178888,y1:2.82998193,x2:-545696821e-21,y2:2.82998193,id:"Path-3"}))));function us(e,t){var n=e.title,a=e.titleId,i=ss(e,["title","titleId"]);return r.createElement("svg",ls({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,ds)}var ms,hs=r.forwardRef(us),bs=(n.p,n(930)),ps=n(931),js=n(821),fs=function(e){var t=Intl.DateTimeFormat().resolvedOptions().timeZone;return Object(bs.a)(t,e)},gs=function(e,t){var n=Intl.DateTimeFormat().resolvedOptions().timeZone;return Object(ps.a)(t,Object(bs.a)(n,e))},Os=function(e,t,n){var r=Intl.DateTimeFormat().resolvedOptions().timeZone,a=Object(ps.a)(t,Object(bs.a)(r,e));return Object(js.a)(n,a)},xs=function(e,t){return Object(js.a)(t,e)},vs={wrapper:{display:"flex",height:130,marginTop:-8},percentageBox:{height:130,borderRadius:4,display:"flex",alignItems:"center",justifyContent:"center",whiteSpace:"pre"},label:{color:Z},inColor:{backgroundColor:_},outColor:{backgroundColor:K},other:{minWidth:"6px",borderRadius:2},inWidth:{width:function(e){return"".concat(e,"%")}},outWidth:{width:function(e){return"".concat(100-e,"%")},marginRight:4}},ys=Object(j.a)(vs),ws=function(e){var t,n=e.cashIn,r=e.cashOut,a=n||0!==r?n:50,i=ys(a),o=function(e){if(!(e<=15))return Object(Me.jsxs)(et,{className:i.label,children:[e,"%"]})},c=(t={},Object(z.a)(t,i.percentageBox,!0),Object(z.a)(t,i.other,a<5&&a>0),t);return Object(Me.jsxs)("div",{className:i.wrapper,children:[Object(Me.jsx)("div",{className:E()(c,i.outColor,i.outWidth),children:o(100-a)}),Object(Me.jsx)("div",{className:E()(c,i.inColor,i.inWidth),children:o(a)})]})},Cs=n(28),ks=n(822),Ss=n(263),Ns=n(823),Is=function(e){var t=e.cashInFee?Number.parseFloat(e.cashInFee):0;return Number.parseFloat(e.commissionPercentage)*Number.parseFloat(e.fiat)+t},Es=function(e,t,n){return{created:new Date(new Date(e.created).getTime()+t).toISOString(),profit:n}},Fs=function(e){var t=e.created;return new Date(t).toISOString().substring(0,10)},Ls=function(e){var t=e.created;return new Date(t).toISOString().substring(0,13)},Ds=function(e,t){var n=e.profit||0;return Object(s.a)(Object(s.a)({},t),{},{profit:n+Is(t)})},Ps={Day:864e5,Week:6048e5,Month:2592e6},Bs=function(e){var t=e.data,n=e.previousTimeData,a=e.previousProfit,i=e.timeFrame,o=Object(r.useRef)(),l=Object(r.useCallback)((function(){var e=Cs.select(o.current),r=0,l=0,s=0,d=336-s-l,u=128-r-0,m=function(){var e="Day"===i?Ls:Fs,r=ks.a(Ss.a(Ds,[],e,t));if(!r.length&&!n.length){var o={created:(new Date).toISOString(),profit:0};return[[o,Es(o,-36e5,0)],!0]}if(!r.length&&n.length){var c={created:(new Date).toISOString(),profit:0};return[[c,Es(c,-Ps[i],1)],!1]}if(r.length&&!n.length){var l={created:(new Date).toISOString(),profit:1};return[[l,Es(l,-Ps[i],0)],!1]}return 1===r.length?[Ns.a({created:new Date(Date.now()-Ps[i]).toISOString(),profit:a},r),!1]:[r,!1]}(),h=Object(c.a)(m,2),b=h[0],p=h[1];e.attr("width",d),e.append("rect").attr("x",0).attr("y",-r).attr("width",d+s+l).attr("height",u+r).attr("fill",re).attr("transform","translate(".concat(0,",",r,")")),e.append("linearGradient").attr("id","area-gradient").attr("gradientUnits","userSpaceOnUse").attr("x1",0).attr("y1",0).attr("x2",0).attr("y2","100%").selectAll("stop").data([{offset:"0%",color:G},{offset:"25%",color:G},{offset:"100%",color:re}]).enter().append("stop").attr("offset",(function(e){return e.offset})).attr("stop-color",(function(e){return e.color}));var j=e.append("g").attr("transform","translate(".concat(s,",").concat(r,")")),f=Cs.extent(b,(function(e){return e.created})),g=p?[0,.1]:[0,Cs.max(b,(function(e){return e.profit}))],O=Cs.scaleLinear().range([u,30]).domain([0,g[1]]),x=Cs.scaleTime().domain([new Date(f[0]),new Date(f[1])]).range([0,d]),v=Cs.line().x((function(e){return x(new Date(e.created))})).y((function(e){return O(e.profit)})),y=Cs.area().x((function(e){return x(new Date(e.created))})).y0(u).y1((function(e){return O(e.profit)}));j.append("path").datum(b).attr("d",y).attr("fill","url(#area-gradient)"),j.append("path").datum(b).attr("d",v).attr("fill","none").attr("stroke-width","2").attr("stroke-linejoin","round").attr("stroke",J)}),[t,i,n,a]);return Object(r.useEffect)((function(){Cs.select(o.current).selectAll("*").remove(),l()}),[l,t]),Object(Me.jsx)(Me.Fragment,{children:Object(Me.jsx)("svg",{ref:o})})},Rs=n(921),As=function(e){var t=e.data,n=e.timeFrame,a=e.timezone,i=Object(r.useRef)(),o=Object(r.useCallback)((function(){var e=Cs.select(i.current),r=25,o=15,c=555-o-0,l=150-r-25;e.attr("width",c),e.append("rect").attr("x",0).attr("y",0).attr("width",c).attr("height",l+r).attr("fill",re);var s=e.append("g").attr("transform","translate(".concat(o,",").concat(r,")")),d=function(){if(0===t.length)return 100;var e=100*Math.ceil(Cs.max(t,(function(e){return parseFloat(e.fiat)}))/100),n=Math.max(100,e);return n%1e3===0?n+100:n}(),u=function(){switch(n){case"Week":return{nice:7,ticks:7,subtractDays:7,timeRange:[50,500]};case"Month":return{nice:6,ticks:6,subtractDays:30,timeRange:[50,500]};default:return{nice:null,ticks:4,subtractDays:1,timeRange:[50,500]}}}(),m=Cs.scaleLinear().range([l,0]).domain([0,d]).nice(3),h=Cs.scaleTime().domain([Object(Rs.a)({days:-u.subtractDays},new Date).valueOf(),(new Date).valueOf()]).range(u.timeRange).nice(u.nice);s.append("g").style("color","#eef1ff").call(Cs.axisLeft(m).ticks(4).tickSize(-c).tickFormat("")).call((function(e){return e.select(".domain").remove()})),s.append("g").attr("transform","translate(0,"+l+")").style("font-size","13px").style("color","#5f668a").style("font-family","MuseoSans").style("margin-top","11px").call(Cs.axisBottom(h).ticks(u.ticks).tickSize(0).tickFormat((function(e){switch(n){case"Week":return Cs.timeFormat("%a %d")(e);case"Month":return Cs.timeFormat("%b %d")(e);default:return Os(e,a,"HH:mm")}}))).selectAll("text").attr("dy","1.5em"),s.append("g").attr("transform","translate(0,"+l+")").style("color","#eef1ff").call(Cs.axisBottom(h).ticks(6).tickSize(0).tickFormat("")).selectAll("text").attr("dy","1.5em"),s.append("g").style("font-size","13px").style("color","#5f668a").style("font-family","MuseoSans").style("margin-top","11px").call(Cs.axisLeft(m).ticks(4).tickSize(0)).call((function(e){return e.select(".domain").remove()})).selectAll("text").attr("dy","-0.40em").attr("dx","3em"),e.append("g").attr("transform","translate(".concat(o,",").concat(r,")")).selectAll("circle").data(t).enter().append("circle").attr("cx",(function(e){return function(e){var t=fs(e);return h(t.valueOf())}(e.created)})).attr("cy",(function(e){return m(e.fiat)})).attr("r",4).style("fill",(function(e){return"cashIn"===e.txClass?_:K}))}),[t,n,a]);return Object(r.useEffect)((function(){Cs.select(i.current).selectAll("*").remove(),o()}),[o]),Object(Me.jsx)(Me.Fragment,{children:Object(Me.jsx)("svg",{ref:i})})},Ts=function(e){var t=e.info,n=e.label;return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(_e,{style:{marginBottom:0},children:t}),Object(Me.jsx)(et,{style:{margin:0},children:n})]})},Ms=n(102),Ws={titleWrapper:{display:"flex",justifyContent:"space-between",alignItems:"center",flexDirection:"row"},titleAndButtonsContainer:{display:"flex"},error:{marginLeft:12},icon:{marginRight:6},h4:{margin:0,marginRight:64},label:{cursor:"pointer",minHeight:0,minWidth:0,padding:0,color:se,textTransform:"none",borderBottom:"2px solid transparent",display:"inline-block",lineHeight:1.5,"&:hover":{backgroundColor:"transparent"}},newHighlightedLabel:{cursor:"pointer",color:J,fontWeight:700,borderRadius:0,minHeight:0,minWidth:0,textTransform:"none",borderBottom:"2px solid ".concat(J),display:"inline-block",lineHeight:1.5,"&:hover":{backgroundColor:"transparent"}},navButton:{marginLeft:24},navContainer:{display:"flex"},profitLabel:{fontSize:Oe,fontFamily:je,fontWeight:700,color:le},percentUp:{fontSize:Oe,fontFamily:je,fontWeight:700,color:U,height:10},percentDown:{fontSize:Oe,fontFamily:je,fontWeight:700,color:Y,height:13},percentNeutral:{fontSize:Oe,fontFamily:je,fontWeight:700,color:q},profitContainer:{display:"flex",justifyContent:"space-between",margin:"0 26px -30px 16px",position:"relative"},gridContainer:{marginTop:30,height:225},inSquare:{width:8,height:8,borderRadius:2,marginTop:18,marginRight:4,backgroundColor:_},outSquare:{width:8,height:8,borderRadius:2,marginTop:18,marginRight:4,backgroundColor:K},directionLabelContainer:{display:"flex"},dirLabContMargin:{marginRight:20},directionIcon:{width:16,height:16,marginBottom:-2,marginRight:4},labelMargin:{marginBottom:20,marginRight:32}},zs=Object(j.a)(Ws),$s=["Month","Week","Day"],qs=function(e){var t=e.handleSetRange,n=zs(),a=Object(r.useState)("Day"),i=Object(c.a)(a,2),o=i[0],l=i[1],s=Ms.a(o);return Object(Me.jsxs)("div",{className:E()(n.titleWrapper),children:[Object(Me.jsx)("div",{className:n.titleAndButtonsContainer,children:Object(Me.jsx)(Ue,{className:n.h4,children:"System performance"})}),Object(Me.jsx)("div",{className:n.navContainer,children:$s.map((function(e,r){return Object(Me.jsx)("div",{onClick:function(e){return n=e.target.innerText,l(n),void t(n);var n},className:s(e)?E()(n.newHighlightedLabel,n.navButton):E()(n.label,n.navButton),children:e},r)}))})]})};vl.a.config({ROUNDING_MODE:vl.a.ROUND_HALF_UP});var Hs=B.a(R.a("fiat")),Vs=Object(j.a)(Ws),Us=B.a(R.a("cashInFee")),Gs=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=t?new Date(t):new Date;return Object(Xl.a)({seconds:e},n)},Xs={Day:{left:Gs(172800,new Date),right:Gs(86400,new Date)},Week:{left:Gs(1209600,new Date),right:Gs(604800,new Date)},Month:{left:Gs(5184e3,new Date),right:Gs(2592e3,new Date)}},_s=x()(ms||(ms=Object(l.a)(["\n query getData {\n transactions {\n fiatCode\n fiat\n cashInFee\n commissionPercentage\n created\n txClass\n error\n }\n fiatRates {\n code\n name\n rate\n }\n config\n }\n"]))),Ks=function(e,t){return e+Number.parseFloat(t.commissionPercentage)*Number.parseFloat(t.fiat)},Zs=function(){var e,t,n,a=Vs(),i=Object(r.useState)("Day"),o=Object(c.a)(i,2),l=o[0],d=o[1],m=Object(u.c)(_s),b=m.data,p=m.loading,j=$l("locale")(null===b||void 0===b?void 0:b.config).fiatCurrency,f=$l("locale")(null===b||void 0===b?void 0:b.config).timezone,g=function(e){return function(t){return null===t.error&&(e?null===t.error&&Object(_l.a)(Xs[l].left,gs(t.created,f))&&Object(_l.a)(gs(t.created,f),Xs[l].right):null===t.error&&Object(_l.a)(Xs[l].right,gs(t.created,f))&&Object(_l.a)(gs(t.created,f),new Date))}},O=function(e){if(e.fiatCode===j)return e;var t=Tr.a(W.a("code",e.fiatCode))(b.fiatRates),n=Tr.a(W.a("code",j))(b.fiatRates).rate/t.rate;return Object(s.a)(Object(s.a)({},e),{},{fiat:parseFloat(e.fiat)*n})},x=B.a(O)(M.a(g(!1),null!==(e=null===b||void 0===b?void 0:b.transactions)&&void 0!==e?e:[])),v=B.a(O)(M.a(g(!0),null!==(t=null===b||void 0===b?void 0:b.transactions)&&void 0!==t?t:[])),y=function(e){var t=Kl.a(Us(e)),n=Zl.a(Ks,0,e);return new vl.a(n+t)},w=function(){var e=Yl.a(W.a("txClass","cashIn"))(x),t=Object(c.a)(e,2),n=t[0],r=t[1],a=n.length+r.length;return 0===a?{cashIn:0,cashOut:0}:{cashIn:Math.round(n.length/a*100),cashOut:Math.round(r.length/a*100)}},C=function(){var e=y(x),t=y(v);return e.eq(t)?0:t.eq(0)?100:e.minus(t).times(100).div(t).toNumber()}(),k=(n={},Object(z.a)(n,a.percentDown,C<0),Object(z.a)(n,a.percentUp,C>0),Object(z.a)(n,a.percentNeutral,0===C),n);return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(qs,{handleSetRange:d}),!p&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)(h.a,{container:!0,spacing:2,children:[Object(Me.jsx)(h.a,{item:!0,xs:3,children:Object(Me.jsx)(Ts,{info:gn.a(x),label:"transactions"})}),Object(Me.jsx)(h.a,{item:!0,xs:3,children:Object(Me.jsx)(Ts,{info:new vl.a(Kl.a(Hs(x))).toFormat(2),label:"".concat(null===b||void 0===b?void 0:b.config.locale_fiatCurrency," volume")})})]}),Object(Me.jsx)(h.a,{container:!0,className:a.gridContainer,children:Object(Me.jsxs)(h.a,{item:!0,xs:12,children:[Object(Me.jsx)(tt,{children:"Transactions"}),Object(Me.jsx)(As,{timeFrame:l,data:x,timezone:f})]})}),Object(Me.jsxs)(h.a,{container:!0,className:a.gridContainer,children:[Object(Me.jsxs)(h.a,{item:!0,xs:8,children:[Object(Me.jsx)(tt,{className:a.labelMargin,children:"Profit from commissions"}),Object(Me.jsxs)("div",{className:a.profitContainer,children:[Object(Me.jsx)("div",{className:a.profitLabel,children:"".concat(y(x).toFormat(2)," ").concat(null===b||void 0===b?void 0:b.config.locale_fiatCurrency)}),Object(Me.jsxs)("div",{className:E()(k),children:[0===C?Object(Me.jsx)(cs,{className:a.directionIcon}):C>0?Object(Me.jsx)(hs,{className:a.directionIcon}):Object(Me.jsx)(ns,{className:a.directionIcon}),"".concat(new vl.a(C).toFormat(2),"%")]})]}),Object(Me.jsx)(Bs,{timeFrame:l,data:x,previousTimeData:v,previousProfit:y(v)})]}),Object(Me.jsxs)(h.a,{item:!0,xs:4,children:[Object(Me.jsxs)(h.a,{container:!0,children:[Object(Me.jsx)(h.a,{item:!0,children:Object(Me.jsx)(tt,{className:a.labelMargin,children:"Direction"})}),Object(Me.jsxs)(h.a,{item:!0,className:E()(a.directionLabelContainer,a.dirLabContMargin),children:[Object(Me.jsx)("div",{className:a.outSquare}),Object(Me.jsx)(et,{className:a.directionLabel,children:"Out"})]}),Object(Me.jsxs)(h.a,{item:!0,className:a.directionLabelContainer,children:[Object(Me.jsx)("div",{className:a.inSquare}),Object(Me.jsx)(et,{className:a.directionLabel,children:"In"})]})]}),Object(Me.jsx)(h.a,{item:!0,xs:!0,children:Object(Me.jsx)(ws,{cashIn:w().cashIn,cashOut:w().cashOut})})]})]})]})]})},Ys=Object(j.a)(Ol),Qs=function(){var e=Ys();return Object(Me.jsx)(h.a,{item:!0,xs:12,className:e.displayFlex,children:Object(Me.jsx)("div",{className:e.card,children:Object(Me.jsx)(Zs,{})})})},Js=n(827),ed=Object.freeze({DEFAULT:"default",SHRUNK:"shrunk",EXPANDED:"expanded"}),td={card:{wordWrap:"break-word",boxShadow:"0 0 4px 0 rgba(0, 0, 0, 0.08)",borderRadius:12,padding:24,backgroundColor:Z}},nd=Object(j.a)(td),rd=function(e){var t=e.className,n=e.state,r=e.shrunkComponent,a=e.children,i=nd();return Object(Me.jsx)(h.a,{item:!0,className:E()(t,i.card),children:n===ed.SHRUNK?r:a})},ad={container:{display:"flex",justifyContent:"space-between"},h4:{margin:0,marginBottom:10},centerLabel:{marginBottom:0,padding:0,textAlign:"center"},upperButtonLabel:{marginTop:-3,marginBottom:24},button:{color:J,marginTop:0,minHeight:0,minWidth:0,padding:0,textTransform:"none","&:hover":{backgroundColor:"transparent"}},alertsTableContainer:{margin:0},expandedAlertsTableContainer:{margin:0,maxHeight:460},noAlertsLabel:{color:q,marginLeft:-5,height:100},table:{maxHeight:465,overflowX:"hidden",overflowY:"auto"},listItemText:{margin:"8px 0 8px 0"},linkIcon:{marginLeft:"auto",cursor:"pointer"}},id=n(807),od=n(826),cd=n(136);function ld(){return(ld=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function sd(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var dd=r.createElement("desc",null,"Created with Sketch."),ud=r.createElement("g",{id:"icon/button/link/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("g",{id:"Group-7",stroke:"#1B2559",strokeWidth:1.2},r.createElement("polyline",{id:"Stroke-1",points:"12 6.66678 12 12.00018 0 12.00018 0 0.00018 5.3334 0.00018"}),r.createElement("polyline",{id:"Stroke-3",points:"8.66658 0 12.00018 0 12.00018 3.3336"}),r.createElement("line",{x1:6,y1:6,x2:12,y2:0,id:"Stroke-5"})));function md(e,t){var n=e.title,a=e.titleId,i=sd(e,["title","titleId"]);return r.createElement("svg",ld({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,dd,ud)}var hd=r.forwardRef(md);n.p;function bd(){return(bd=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function pd(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var jd=r.createElement("g",{id:"DASHBOARD",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"dashboard_v9#1-(week)",transform:"translate(-772.000000, -212.000000)"},r.createElement("g",{id:"dashboard/row/alert/positive",transform:"translate(756.000000, 204.000000)"},r.createElement("g",{id:"Group-2",transform:"translate(16.000000, 8.000000)"},r.createElement("polygon",{id:"Rectangle-2-Copy-45",fill:"#FF584A",fillRule:"nonzero",points:"0 11 16 11 16 16 0 16"}),r.createElement("rect",{id:"Rectangle-Copy-10",stroke:"#FF584A",strokeWidth:2,x:1,y:1,width:14,height:14})))));function fd(e,t){var n=e.title,a=e.titleId,i=pd(e,["title","titleId"]);return r.createElement("svg",bd({width:"16px",height:"16px",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),void 0===n?r.createElement("title",{id:a},"07E3DD15-D5E4-46A8-BF7B-064F598230CE"):n?r.createElement("title",{id:a},n):null,jd)}var gd,Od=r.forwardRef(fd),xd=(n.p,Object(j.a)(ad)),vd={error:Object(Me.jsx)(tn,{style:{height:20,width:20,marginRight:12}}),fiatBalance:Object(Me.jsx)(Od,{style:{height:18,width:18,marginRight:14}})},yd={error:"/maintenance/machine-status",fiatBalance:"/maintenance/cash-cassettes",cryptoBalance:"/maintenance/funding"},wd=function(e){var t=e.numToRender,n=e.alerts,r=e.machines,a=Object(w.h)(),i=xd(),o=cd.a(0,t,n);return Object(Me.jsx)(id.a,{dense:!0,className:i.table,children:o.map((function(e,t){return Object(Me.jsxs)(od.a,{children:[vd[e.type]||Object(Me.jsx)(Rt,{style:{height:23,width:23,marginRight:8}}),Object(Me.jsx)(Xe,{className:i.listItemText,children:"".concat(e.message).concat(e.detail.deviceId&&" - "+r[e.detail.deviceId])}),Object(Me.jsx)(hd,{className:i.linkIcon,onClick:function(){return a.push(yd[e.type]||"/dashboard")}})]},t)}))})},Cd=x()(gd||(gd=Object(l.a)(["\n query getAlerts {\n alerts {\n id\n type\n detail\n message\n created\n read\n valid\n }\n machines {\n deviceId\n name\n }\n }\n"]))),kd=Object(j.a)(ad),Sd=function(e){var t,n,r,a=e.onReset,i=e.onExpand,o=e.size,c=kd(),l=o===ed.EXPANDED,s=Object(u.c)(Cd).data,d=null!==(t=T.a(["alerts"])(s))&&void 0!==t?t:[],m=L.a(B.a(R.a("name")),A.a(R.a("deviceId")))(null!==(n=null===s||void 0===s?void 0:s.machines)&&void 0!==n?n:[]),b=d.length,p=(r={},Object(z.a)(r,c.alertsTableContainer,!l),Object(z.a)(r,c.expandedAlertsTableContainer,l),r);return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)("div",{className:c.container,children:[Object(Me.jsx)(Ue,{className:c.h4,children:"Alerts (".concat(b,")")}),l&&Object(Me.jsx)(et,{className:c.upperButtonLabel,children:Object(Me.jsx)(Js.a,{onClick:a,size:"small",disableRipple:!0,disableFocusRipple:!0,className:c.button,children:"Show less"})})]}),Object(Me.jsx)(h.a,{className:E()(p),container:!0,spacing:1,children:Object(Me.jsxs)(h.a,{item:!0,xs:12,children:[!d.length&&Object(Me.jsx)(et,{className:c.noAlertsLabel,children:"No new alerts. Your system is running smoothly."}),Object(Me.jsx)(wd,{numToRender:l?d.length:3,alerts:d,machines:m})]})}),!l&&b>3&&Object(Me.jsx)(h.a,{item:!0,xs:12,children:Object(Me.jsx)(et,{className:c.centerLabel,children:Object(Me.jsx)(Js.a,{onClick:function(){return i("alerts")},size:"small",disableRipple:!0,disableFocusRipple:!0,className:c.button,children:"Show all (".concat(d.length,")")})})})]})},Nd=n(830),Id=n(834),Ed=n(828),Fd=n(829),Ld=n(831),Dd=n(832),Pd=n(833),Bd=n(418),Rd={error:Y,warning:"#ff7311",success:ne,neutral:J},Ad={error:Q,warning:"#fbf3ec",success:V,neutral:G},Td=Object(j.a)({root:{borderRadius:4,marginTop:4,marginRight:2,marginBottom:4,marginLeft:2,height:24,backgroundColor:function(e){var t=e.type;return Ad[t]}},label:{fontSize:ye,fontWeight:Se,fontFamily:Ne,paddingRight:4,paddingLeft:4,color:function(e){var t=e.type;return Rd[t]}}}),Md=function(e){var t=e.status,n=Td({type:t.type});return Object(Me.jsx)(Sa.a,{type:t.type,label:t.label,classes:n})},Wd=function(e){var t=e.statuses,n=t.find((function(e){return"error"===e.type}))||t.find((function(e){return"warning"===e.type}))||t[0],r={label:"+".concat(t.length-1),type:n.type};return Object(Me.jsxs)("div",{children:[Object(Me.jsx)(Md,{status:n}),t.length>1&&Object(Me.jsx)(Md,{status:r})]})};function zd(){return(zd=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function $d(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var qd=r.createElement("defs",null,r.createElement("circle",{id:"path-1-right",cx:10,cy:10,r:10})),Hd=r.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"pop-up/action/download-logs/date-range-copy-2",transform:"translate(-232.000000, -187.000000)"},r.createElement("g",{id:"icon/sf-contain-b-copy-4",transform:"translate(242.000000, 197.000000) scale(-1, 1) rotate(-270.000000) translate(-242.000000, -197.000000) translate(232.000000, 187.000000)"},r.createElement("mask",{id:"mask-2",fill:"white"},r.createElement("use",{xlinkHref:"#path-1-right"})),r.createElement("use",{id:"Mask",fill:"#EBEFFF",fillRule:"nonzero",xlinkHref:"#path-1-right"}),r.createElement("g",{id:"icon/sf-small/wizzard",mask:"url(#mask-2)",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("g",{transform:"translate(6.666667, 6.000000)",id:"Group"},r.createElement("g",null,r.createElement("polyline",{id:"Path-3",stroke:"#1B2559",strokeWidth:2,points:"0 4.83333333 3.33333333 8.16666667 6.66666667 4.83333333"}),r.createElement("line",{x1:3.33333333,y1:.25,x2:3.33333333,y2:6.5,id:"Path-4",stroke:"#1B2559",strokeWidth:2})))))));function Vd(e,t){var n=e.title,a=e.titleId,i=$d(e,["title","titleId"]);return r.createElement("svg",zd({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,qd,Hd)}var Ud,Gd=r.forwardRef(Vd),Xd=(n.p,{container:{display:"flex",justifyContent:"space-between"},label:{margin:0,color:se},row:{backgroundColor:re,borderBottom:"none"},clickableRow:{cursor:"pointer"},header:{display:"flex",alignItems:"center",whiteSpace:"pre"},error:{color:me},button:{color:J,minHeight:0,minWidth:0,padding:0,textTransform:"none","&:hover":{backgroundColor:"transparent"},marginBottom:-40},buttonLabel:{position:"absolute",bottom:160,marginBottom:0},upperButtonLabel:{textAlign:"center",marginBottom:0,marginTop:0},statusHeader:{marginLeft:2},table:{maxHeight:440,"&::-webkit-scrollbar":{width:7},"&::-webkit-scrollbar-thumb":{backgroundColor:se,borderRadius:5}},tableBody:{overflow:"auto"},h4:{marginTop:0},tl2:{display:"inline"},label1:{display:"inline"},machinesTableContainer:{marginTop:10,height:220},expandedMachinesTableContainer:{marginTop:10,height:414},centerLabel:{marginBottom:0,padding:0,textAlign:"center"},machineNameWrapper:{display:"flex",flexDirection:"row",alignItems:"center"},machineRedirectIcon:{marginLeft:10}}),_d=Object(j.a)(Xd),Kd=Object(Na.a)({root:{borderBottom:"4px solid white",padding:0,paddingLeft:15}})(Ed.a),Zd=Object(Na.a)({root:{borderBottom:"4px solid white",padding:0,paddingLeft:15,backgroundColor:"white"}})(Ed.a),Yd=function(e){var t=e.machines,n=e.numToRender,r=_d(),a=Object(w.h)(),i=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500;return Math.round(e/t*100)},o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n=i(e,t);return n<20?Object(Me.jsx)(Je,{className:r.error,children:"".concat(n,"%")}):Object(Me.jsx)(Je,{children:"".concat(n,"%")})},c=function(e){var t=e.name,n=e.deviceId;return a.push("/machines/".concat(n),{selectedMachine:t})},l=Math.max.apply(Math,Object(d.a)(B.a((function(e){return e.numberOfCassettes}),t)));return Object(Me.jsx)(Fd.a,{className:r.table,children:Object(Me.jsxs)(Nd.a,{children:[Object(Me.jsx)(Ld.a,{children:Object(Me.jsxs)(Dd.a,{children:[Object(Me.jsx)(Zd,{children:Object(Me.jsx)("div",{className:r.header,children:Object(Me.jsx)(tt,{className:r.label,children:"Machines"})})}),Object(Me.jsx)(Zd,{children:Object(Me.jsx)("div",{className:"".concat(r.header," ").concat(r.statusHeader),children:Object(Me.jsx)(tt,{className:r.label,children:"Status"})})}),B.a((function(e){return Object(Me.jsx)(Zd,{children:Object(Me.jsxs)("div",{className:r.header,children:[Object(Me.jsx)(gl,{}),Object(Me.jsxs)(tt,{className:r.label,children:[" ",e+1]})]})})}),Pd.a(Bd.a,l))]})}),Object(Me.jsx)(Id.a,{children:t.map((function(e,t){return t<n?Object(Me.jsxs)(Dd.a,{onClick:function(){return c(e)},className:E()(r.row),children:[Object(Me.jsxs)(Kd,{align:"left",className:r.machineNameWrapper,children:[Object(Me.jsx)(Je,{children:e.name}),Object(Me.jsx)(Gd,{className:E()(r.machineRedirectIcon,r.clickableRow),onClick:function(){return c(e)}})]}),Object(Me.jsx)(Kd,{children:Object(Me.jsx)(Md,{status:e.statuses[0]})}),B.a((function(t){return e.numberOfCassettes>t?Object(Me.jsx)(Kd,{align:"left",children:o(e["cassette".concat(t+1)])}):Object(Me.jsx)(Kd,{align:"left",children:Object(Me.jsx)(Je,{children:"\u2014 %"})})}),Pd.a(Bd.a,l))]},e.deviceId+t):null}))})]})})},Qd=Object(j.a)(Xd),Jd=x()(Ud||(Ud=Object(l.a)(["\n query getData {\n machines {\n name\n deviceId\n cashbox\n cassette1\n cassette2\n cassette3\n cassette4\n numberOfCassettes\n statuses {\n label\n type\n }\n }\n serverVersion\n uptime {\n name\n state\n uptime\n }\n }\n"]))),eu=function(e){var t,n,r=e.onReset,a=e.onExpand,i=e.size,o=Qd(),c=Object(u.c)(Jd),l=c.data,s=c.loading,d=null!==(t=T.a(["machines"])(l))&&void 0!==t?t:[],m=i===ed.EXPANDED,b=(n={},Object(z.a)(n,o.machinesTableContainer,!m),Object(z.a)(n,o.expandedMachinesTableContainer,m),n);return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)("div",{className:o.container,children:[Object(Me.jsx)(Ue,{className:o.h4,children:"System status"})," ",m&&Object(Me.jsx)(et,{className:o.upperButtonLabel,children:Object(Me.jsx)(Js.a,{onClick:r,size:"small",disableRipple:!0,disableFocusRipple:!0,className:o.button,children:"Show less"})})]}),!s&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)(h.a,{container:!0,spacing:1,children:[Object(Me.jsxs)(h.a,{item:!0,xs:4,children:[Object(Me.jsx)(Je,{className:o.tl2,children:null===l||void 0===l?void 0:l.serverVersion}),Object(Me.jsx)(et,{className:o.label1,children:" server version"})]}),Object(Me.jsx)(h.a,{item:!0,xs:4})]}),Object(Me.jsx)(h.a,{container:!0,spacing:1,className:E()(b),children:Object(Me.jsx)(h.a,{item:!0,xs:12,children:Object(Me.jsx)(Yd,{numToRender:m?1/0:4,machines:d})})}),!m&&d.length>4&&Object(Me.jsx)(h.a,{item:!0,xs:12,children:Object(Me.jsx)(et,{className:o.centerLabel,children:Object(Me.jsx)(Js.a,{onClick:function(){return a()},size:"small",disableRipple:!0,disableFocusRipple:!0,className:o.button,children:"Show all (".concat(d.length,")")})})})]})]})},tu=Object(j.a)(Ol),nu=function(e){var t=e.title,n=e.buttonName,r=e.onUnshrink,a=tu();return Object(Me.jsxs)("div",{className:a.container,children:[Object(Me.jsx)(Ue,{className:a.h4,children:t}),Object(Me.jsx)(et,{className:a.upperButtonLabel,children:Object(Me.jsx)(Js.a,{onClick:r,size:"small",disableRipple:!0,disableFocusRipple:!0,className:a.button,children:n})})]})},ru=function(){var e,t,n=tu(),a=Object(r.useState)(ed.DEFAULT),i=Object(c.a)(a,2),o=i[0],l=i[1],s=Object(r.useState)(ed.DEFAULT),d=Object(c.a)(s,2),u=d[0],m=d[1],b=function(){m(ed.DEFAULT),l(ed.DEFAULT)};return Object(Me.jsx)(h.a,{item:!0,xs:12,className:n.displayFlex,children:Object(Me.jsx)("div",{style:{flex:1,display:"flex",flexDirection:"column"},children:Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(rd,{className:E()((e={},Object(z.a)(e,n.alertsCard,u!==ed.SHRUNK),Object(z.a)(e,n.shrunkCard,u===ed.SHRUNK),Object(z.a)(e,n.expandedCard,u===ed.EXPANDED),e)),state:u,shrunkComponent:Object(Me.jsx)(nu,{title:"Alerts",buttonName:"Show alerts",onUnshrink:b}),children:Object(Me.jsx)(Sd,{onExpand:function(){m(ed.EXPANDED),l(ed.SHRUNK)},onReset:b,size:u})}),Object(Me.jsx)(rd,{className:E()((t={},Object(z.a)(t,n.shrunkCard,o===ed.SHRUNK),Object(z.a)(t,n.systemStatusCard,o!==ed.SHRUNK),Object(z.a)(t,n.expandedCard,u===ed.EXPANDED),t)),state:o,shrunkComponent:Object(Me.jsx)(nu,{title:"System status",buttonName:"Show machines",onUnshrink:b}),children:Object(Me.jsx)(eu,{onExpand:function(){l(ed.EXPANDED),m(ed.SHRUNK)},onReset:b,size:o})})]})})})},au=Object(j.a)(Ol),iu=function(){var e=au();return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Wo,{title:"Dashboard",children:Object(Me.jsxs)("div",{className:e.headerLabels,children:[Object(Me.jsxs)("div",{className:E()(e.headerLabelContainer,e.headerLabelContainerMargin),children:[Object(Me.jsx)(gl,{}),Object(Me.jsx)("span",{className:e.headerLabelSpan,children:"Cash-out"})]}),Object(Me.jsxs)("div",{className:e.headerLabelContainer,children:[Object(Me.jsx)(ul,{}),Object(Me.jsx)("span",{className:e.headerLabelSpan,children:"Cash-in"})]})]})}),Object(Me.jsx)("div",{className:e.root,children:Object(Me.jsxs)(h.a,{container:!0,children:[Object(Me.jsx)(h.a,{container:!0,direction:"column",item:!0,xs:6,children:Object(Me.jsx)(Qs,{})}),Object(Me.jsx)(h.a,{container:!0,direction:"column",item:!0,xs:6,children:Object(Me.jsx)(ru,{})})]})}),Object(Me.jsx)(Gl,{})]})},ou=n(903),cu=n(202),lu=n.n(cu),su=n(845),du=n(846),uu=n(847),mu=n(428),hu=n(844),bu=n(910),pu=n(842),ju=n(186),fu=n(843),gu=n(905),Ou="You have unsaved changes on this page. Are you sure you want to leave?",xu=function(e){var t=e.message,n=void 0===t?Ou:t,a=Object(pn.e)(),i=a.dirty&&0===a.submitCount;Object(r.useEffect)((function(){window.onbeforeunload=i?o:void 0}),[i]);var o=function(){return Ou};return Object(Me.jsx)(w.a,{when:i,message:n})},vu=n(835),yu=n(836),wu=Re.tl2,Cu=Re.label1,ku={size:function(e){var t=e.size;return Hr(t)},bold:Vr,header:{extend:wu,backgroundColor:Le,height:Ie,textAlign:"left",color:Z,display:"flex",alignItems:"center"},doubleHeader:{extend:wu,backgroundColor:Le,height:Fe,color:Z,display:"table-row"},thDoubleLevel:function(e){return{width:e.width,display:"table-cell","& > :first-child":{margin:[[0,10]],extend:Cu,fontWeight:700,display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:se,color:Z,borderRadius:[[0,0,8,8]],height:28},"& > :last-child":{padding:[[0,11]],display:"table-cell",verticalAlign:"middle",height:Fe-28}}},cellDoubleLevel:{display:"flex",padding:[[0,16]]},td:function(e){var t=e.textAlign;return{width:e.width,padding:[[1,24,0,24]],textAlign:t}},tdHeader:{verticalAlign:"middle",display:"table-cell",padding:[[0,24]]},trError:{backgroundColor:De},trAdding:{backgroundColor:Pe},mainContent:function(e){return{display:"flex",alignItems:"center",minHeight:{sm:34,lg:68}[e.size]||48}},cardContentRoot:{margin:0,padding:0,"&:last-child":{padding:0}},card:{extend:Re.p,"&:before":{height:0},margin:[[4,0,0,0]],width:"100%",boxShadow:[[0,0,4,0,"rgba(0, 0, 0, 0.08)"]]},actionCol:{marginLeft:"auto"},errorContent:{padding:[[12,0,12,24]],color:me}},Su=Object(j.a)(ku),Nu=function(e){var t=e.children,n=e.className,r=Object($.a)(e,["children","className"]);return Object(Me.jsx)("div",Object(s.a)(Object(s.a)({className:E()(n)},r),{},{children:t}))},Iu=function(e){var t=e.children,n=e.className,r=Su();return Object(Me.jsx)("div",{className:E()(n,r.header),children:t})},Eu=function(e){var t=e.children,n=e.className,r=Su();return Object(Me.jsx)("div",{className:E()(n,r.doubleHeader),children:t})},Fu=function(e){var t=e.children,n=e.className;return Object(Me.jsx)("div",{className:E()(n),children:t})},Lu=function(e){var t,n=e.children,r=e.header,a=e.className,i=e.width,o=void 0===i?100:i,c=e.size,l=e.bold,s=e.textAlign,d=e.action,u=Su({textAlign:s,width:o,size:c}),m=(t={},Object(z.a)(t,u.td,!0),Object(z.a)(t,u.tdHeader,r),Object(z.a)(t,u.actionCol,d),Object(z.a)(t,u.size,!r),Object(z.a)(t,u.bold,!r&&l),t);return Object(Me.jsx)("div",{className:E()(a,m),children:n})},Du=function(e){var t=e.children,n=Object($.a)(e,["children"]);return Object(Me.jsx)(Lu,Object(s.a)(Object(s.a)({header:!0},n),{},{children:t}))},Pu=function(e){var t=e.title,n=e.children,r=e.className,a=e.width,i=Su({width:a});return Object(Me.jsxs)("div",{className:E()(r,i.thDoubleLevel),children:[Object(Me.jsx)("div",{children:t}),Object(Me.jsx)("div",{children:n})]})},Bu=function(e){var t,n=e.onClick,r=e.error,a=e.errorMessage,i=e.children,o=e.className,c=e.size,l=e.newRow,s=Su({size:c}),d={root:s.cardContentRoot},u=(t={},Object(z.a)(t,s.tr,!0),Object(z.a)(t,s.trError,r),Object(z.a)(t,s.card,!0),Object(z.a)(t,s.trAdding,l),Object(z.a)(t,"className",o),t);return Object(Me.jsx)(Me.Fragment,{children:Object(Me.jsx)(vu.a,{className:E()(u,o),onClick:n,children:Object(Me.jsxs)(yu.a,{classes:d,children:[Object(Me.jsx)("div",{className:s.mainContent,children:i}),r&&Object(Me.jsx)("div",{className:s.errorContent,children:a})]})})})},Ru=a.a.createContext(),Au=n(838),Tu=n(839),Mu=n(837),Wu=n(254),zu=Wu.create({checkTypes:!1,env:Wu.env}),$u=zu.compose(zu.joinWith(""))(kl.a(0,zu.toLower)),qu=zu.compose(zu.joinWith(""))(kl.a(0,zu.toUpper)),Hu=zu.compose(qu)(zu.toLower),Vu=L.a(zu.splitOn(" "),Mu.a(/([A-Z])/g," $1"),$u),Uu=L.a(zu.joinWith(" "),zu.map(Hu),Vu),Gu=function(e,t,n){return 1===parseInt(e)?t:n},Xu=function(){var e=Object(r.useContext)(Ru),t=e.elements,n=e.enableEdit,a=e.enableEditText,i=e.editWidth,o=e.enableDelete,l=e.deleteWidth,s=e.enableToggle,d=e.toggleWidth,u=e.DEFAULT_COL_SIZE,m=function(e,t){var n=e.name,r=e.width,a=void 0===r?u:r,i=e.header,o=e.textAlign;return Object(Me.jsx)(Lu,{header:!0,width:a,textAlign:o,children:i||Uu(n)},t)},h=function(e){var t=Yl.a(qo.a("doubleHeader"))(e),n=Object(c.a)(t,2),r=n[0],a=n[1];if(!r.length)return[e,Iu];var i=Au.a(r[0],e),o=L.a(Kl.a,B.a(T.a(["width"])))(r);return[Tu.a(i,{width:o,elements:r,name:r[0].doubleHeader},a),Eu]}(t),b=Object(c.a)(h,2),p=b[0],j=b[1];return Object(Me.jsxs)(j,{children:[p.map((function(e,t){var n=e.width,r=e.elements,a=e.name;return r&&r.length?Object(Me.jsx)(Pu,{width:n,title:a,children:r.map(m)},t):m(e,t)})),n&&Object(Me.jsx)(Lu,{header:!0,width:i,textAlign:"center",children:null!==a&&void 0!==a?a:"Edit"}),o&&Object(Me.jsx)(Lu,{header:!0,width:l,textAlign:"center",children:"Delete"}),s&&Object(Me.jsx)(Lu,{header:!0,width:d,textAlign:"center",children:"Enable"})]})},_u=n(841),Ku=n(840),Zu=Object(j.a)({content:{width:434,padding:16,paddingRight:28},titleSection:{padding:16,paddingRight:12,display:"flex",justifyContent:"space-between",margin:0},actions:{padding:32,paddingTop:16},title:{margin:0},closeButton:{padding:0,marginTop:-4}}),Yu=function(e){var t=e.children,n=e.close,r=Zu();return Object(Me.jsxs)("div",{className:r.titleSection,children:[t,n&&Object(Me.jsx)(tr,{size:16,"aria-label":"close",onClick:n,className:r.closeButton,children:Object(Me.jsx)(gi,{})})]})},Qu=function(e){var t=e.title,n=void 0===t?"Confirm Delete":t,r=e.open,a=void 0!==r&&r,i=e.onConfirmed,o=e.onDismissed,c=e.item,l=void 0===c?"item":c,s=e.confirmationMessage,d=void 0===s?"Are you sure you want to delete this ".concat(l,"?"):s,u=e.errorMessage,m=void 0===u?"":u,h=Zu();return Object(Me.jsxs)(un.a,{open:a,"aria-labelledby":"form-dialog-title",children:[Object(Me.jsx)(Yu,{close:function(){return o()},children:Object(Me.jsx)(Ue,{className:h.title,children:n})}),m&&Object(Me.jsx)(Yu,{children:Object(Me.jsx)(Ao,{children:m.split(":").map((function(e){return Object(Me.jsxs)(Me.Fragment,{children:[e,Object(Me.jsx)("br",{})]})}))})}),Object(Me.jsx)(mn.a,{className:h.content,children:d&&Object(Me.jsx)(Xe,{children:d})}),Object(Me.jsx)(Ku.a,{className:h.actions,children:Object(Me.jsx)(Tn,{onClick:i,children:"Confirm"})})]})},Ju=n(440);function em(){return(em=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function tm(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var nm=r.createElement("desc",null,"Created with Sketch."),rm=r.createElement("defs",null,r.createElement("path",{id:"arrow-path",d:"M5.3501239,7.53208616 L0.473798314,2.73082122 C-0.158421727,2.1051411 -0.158421727,1.0952488 0.476737158,0.466675069 C1.11220338,-0.155816755 2.1378971,-0.155816755 2.77494316,0.468226909 L6.49990857,4.13723769 L10.2264532,0.466675069 C10.8619195,-0.155816755 11.8876132,-0.155816755 12.5260183,0.469568675 C13.1582383,1.0952488 13.1582383,2.1051411 12.5245507,2.73226987 L7.64673876,7.53497972 C7.33802629,7.83583835 6.92590837,8 6.49990828,8 C6.0739082,8 5.66179027,7.83583835 5.3501239,7.53208616 Z"})),am=r.createElement("g",{id:"Styleguide",stroke:"none",strokeWidth:1,fillRule:"evenodd"},r.createElement("g",{id:"icon/action/arrow/regular"},r.createElement("mask",{id:"mask-2",fill:"white"},r.createElement("use",{xlinkHref:"#path-1"})),r.createElement("use",{id:"Mask",fillRule:"nonzero",xlinkHref:"#arrow-path"})));function im(e,t){var n=e.title,a=e.titleId,i=tm(e,["title","titleId"]);return r.createElement("svg",em({width:"13px",height:"8px",viewBox:"0 0 13 8",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,nm,rm,am)}var om=r.forwardRef(im),cm=(n.p,Re.p),lm=152,sm={selectedItem:{width:111,display:"block",whiteSpace:"nowrap",overflow:"hidden"},select:{width:lm,zIndex:2,"& label":{extend:Re.label1,color:se,paddingLeft:10},"& button":{extend:cm,position:"relative",border:0,backgroundColor:ae,width:lm,padding:[[6,0,6,12]],borderRadius:20,lineHeight:"1.14",textAlign:"left",color:se,cursor:"pointer",outline:"0 none"},"& ul":{maxHeight:"200px",width:lm,overflowY:"auto",position:"absolute",margin:0,borderTop:0,padding:0,borderRadius:[[0,0,8,8]],backgroundColor:ae,outline:"0 none","& li":{extend:cm,listStyleType:"none",padding:[[6,12]],cursor:"pointer","& span":{width:"100%",display:"block",overflow:"hidden",whiteSpace:"nowrap"}},"& li:hover":{backgroundColor:se,color:Z}},"& svg":{position:"absolute",top:12,right:14,fill:se}},selectFiltered:{"& button":{backgroundColor:se,color:Z},"& ul":{"& li":{backgroundColor:se,color:Z},"& li:hover":{backgroundColor:ae,color:se}},"& svg":{fill:[[Z],"!important"]}},open:{"& button":{borderRadius:[[8,8,0,0]]}}},dm=Object(j.a)(sm);var um=function(e){var t,n=e.className,r=e.label,a=e.items,i=Object($.a)(e,["className","label","items"]),o=dm(),c=Object(Ju.a)({items:a,selectedItem:i.selectedItem,onSelectedItemChange:function(e){i.onSelectedItemChange(e.selectedItem)}}),l=c.isOpen,d=c.selectedItem,u=c.getToggleButtonProps,m=c.getLabelProps,h=c.getMenuProps,b=c.getItemProps,p=(t={},Object(z.a)(t,o.select,!0),Object(z.a)(t,o.selectFiltered,d!==i.default),Object(z.a)(t,o.open,l),t);return Object(Me.jsxs)("div",{className:E()(p,n),children:[Object(Me.jsx)("label",Object(s.a)(Object(s.a)({},m()),{},{children:r})),Object(Me.jsxs)("button",Object(s.a)(Object(s.a)({},u()),{},{children:[Object(Me.jsx)("span",{className:o.selectedItem,children:d.display}),Object(Me.jsx)(om,{})]})),Object(Me.jsx)("ul",Object(s.a)(Object(s.a)({},h()),{},{children:l&&a.map((function(e,t){var n=e.code,r=e.display;return Object(Me.jsx)("li",Object(s.a)(Object(s.a)({},b({code:n,index:t})),{},{children:Object(Me.jsx)("span",{children:r})}),"".concat(n).concat(t))}))}))]})};function mm(){return(mm=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function hm(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var bm=r.createElement("defs",null,r.createElement("path",{id:"a",d:"M0 0h22v22H0z"})),pm=r.createElement("g",{fill:"none",fillRule:"evenodd"},r.createElement("mask",{id:"b",fill:"#fff"},r.createElement("use",{xlinkHref:"#a"})),r.createElement("path",{stroke:"#9B9B9B",strokeWidth:2,strokeLinecap:"round",mask:"url(#b)",d:"M9 9v9M13 9v9"}),r.createElement("g",{mask:"url(#b)",stroke:"#9B9B9B",strokeLinecap:"round",strokeWidth:2},r.createElement("path",{strokeLinejoin:"round",d:"M3 6l2 15h12l2-15"}),r.createElement("path",{d:"M1 5h20M14 4a3 3 0 10-6 0"})));function jm(e,t){var n=e.title,a=e.titleId,i=hm(e,["title","titleId"]);return r.createElement("svg",mm({width:22,height:22,xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,bm,pm)}var fm=r.forwardRef(jm);n.p;function gm(){return(gm=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Om(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var xm=r.createElement("desc",null,"Created with Sketch."),vm=r.createElement("g",{id:"icon/action/delete/enabled",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round"},r.createElement("line",{x1:9,y1:9,x2:9,y2:18,id:"Stroke-1",stroke:"#1B2559",strokeWidth:2}),r.createElement("line",{x1:13,y1:9,x2:13,y2:18,id:"Stroke-2",stroke:"#1B2559",strokeWidth:2}),r.createElement("polyline",{id:"Stroke-3",stroke:"#1B2559",strokeWidth:2,strokeLinejoin:"round",points:"3 6 5 21 17 21 19 6"}),r.createElement("line",{x1:1,y1:5,x2:21,y2:5,id:"Stroke-5",stroke:"#1B2559",strokeWidth:2}),r.createElement("path",{d:"M14,4 C14,2.343 12.657,1 11,1 C9.343,1 8,2.343 8,4",id:"Stroke-7",stroke:"#1B2559",strokeWidth:2}));function ym(e,t){var n=e.title,a=e.titleId,i=Om(e,["title","titleId"]);return r.createElement("svg",gm({width:"22px",height:"22px",viewBox:"0 0 22 22",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,xm,vm)}var wm=r.forwardRef(ym);n.p;function Cm(){return(Cm=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function km(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Sm=r.createElement("desc",null,"Created with Sketch."),Nm=r.createElement("g",{id:"icon/action/edit/disabled",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("path",{d:"M1,18 L1,18 C1,19.657 2.343,21 4,21 L18,21 C19.657,21 21,19.657 21,18",id:"Stroke-1",stroke:"#9B9B9B",strokeWidth:2}),r.createElement("polygon",{id:"Stroke-3",stroke:"#9B9B9B",strokeWidth:2,points:"6 12 17 1 21 5 10 16 6 16"}));function Im(e,t){var n=e.title,a=e.titleId,i=km(e,["title","titleId"]);return r.createElement("svg",Cm({width:"22px",height:"22px",viewBox:"0 0 22 22",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Sm,Nm)}var Em=r.forwardRef(Im);n.p;function Fm(){return(Fm=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Lm(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Dm=r.createElement("desc",null,"Created with Sketch."),Pm=r.createElement("g",{id:"icon/action/edit/enabled",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("path",{d:"M1,18 L1,18 C1,19.657 2.343,21 4,21 L18,21 C19.657,21 21,19.657 21,18",id:"Stroke-1",stroke:"#1B2559",strokeWidth:2}),r.createElement("polygon",{id:"Stroke-3",stroke:"#1B2559",strokeWidth:2,points:"6 12 17 1 21 5 10 16 6 16"}));function Bm(e,t){var n=e.title,a=e.titleId,i=Lm(e,["title","titleId"]);return r.createElement("svg",Fm({width:"22px",height:"22px",viewBox:"0 0 22 22",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Dm,Pm)}var Rm,Am,Tm,Mm=r.forwardRef(Bm),Wm=(n.p,{saveButton:{marginRight:20},lastOfGroup:{marginBottom:24},extraPadding:{paddingLeft:35,paddingRight:30},extraPaddingRight:{paddingRight:39},withSuffix:function(e){var t=e.textAlign;return{display:"flex",alignItems:"center",justifyContent:"right"===t?"flex-end":t}},suffix:{margin:[[0,0,0,7]]},size:function(e){var t=e.size;return Hr(t)},bold:Vr}),zm=Object(j.a)(Wm),$m=function(e){var t=e.disabled,n=e.editing,a=zm(),i=Object(pn.e)(),o=i.values,l=i.submitForm,s=i.resetForm,d=Object(r.useContext)(Ru),u=d.editWidth,m=d.onEdit,h=d.enableEdit,b=d.enableDelete,p=d.disableRowEdit,j=d.onDelete,f=d.deleteWidth,g=d.enableToggle,O=d.onToggle,x=d.toggleWidth,v=d.forceAdd,y=d.clearError,w=d.actionColSize,C=d.error,k=t||p&&p(o),S=Object(r.useState)(!1),N=Object(c.a)(S,2),I=N[0],E=N[1];return Object(Me.jsxs)(Me.Fragment,{children:[n&&Object(Me.jsxs)(Lu,{textAlign:"center",width:w,children:[Object(Me.jsx)(or,{className:a.saveButton,type:"submit",color:"primary",onClick:l,children:"Save"}),!v&&Object(Me.jsx)(or,{color:"secondary",onClick:function(){y(),s()},children:"Cancel"})]}),!n&&h&&Object(Me.jsx)(Lu,{textAlign:"center",width:u,children:Object(Me.jsx)(tr,{disabled:k,className:a.editButton,onClick:function(){return m&&m(o.id)},children:k?Object(Me.jsx)(Em,{}):Object(Me.jsx)(Mm,{})})}),!n&&b&&Object(Me.jsxs)(Lu,{textAlign:"center",width:f,children:[Object(Me.jsx)(tr,{disabled:t,onClick:function(){E(!0)},children:t?Object(Me.jsx)(fm,{}):Object(Me.jsx)(wm,{})}),Object(Me.jsx)(Qu,{open:I,setDeleteDialog:E,onConfirmed:function(){j(o.id).then((function(e){P.a(e)||E(!1)}))},onDismissed:function(){E(!1),y()},errorMessage:C})]}),!n&&g&&Object(Me.jsx)(Lu,{textAlign:"center",width:x,children:Object(Me.jsx)(Ca,{checked:!!o.active,value:!!o.active,disabled:t,onChange:function(){return O(o.id)}})})]})},qm=function(e){var t,n=e.editing,r=e.focus,a=e.config,i=e.extraPaddingRight,o=e.extraPadding,c=a.name,l=a.bypassField,d=a.input,u=a.editable,m=void 0===u||u,h=a.size,b=a.bold,p=a.width,j=a.textAlign,f=a.editingAlign,g=void 0===f?j:f,O=a.suffix,x=a.SuffixComponent,v=void 0===x?tt:x,y=a.textStyle,w=void 0===y?function(e){}:y,C=a.isHidden,k=void 0===C?function(e){return!1}:C,S=a.view,N=void 0===S?function(e){return null===e||void 0===e?void 0:e.toString()}:S,I=a.inputProps,E=void 0===I?{}:I,F=Object(pn.e)().values,L=n&&function(e){return"function"===typeof e?e(F):e}(m),D=!l,P=zm({textAlign:L?g:j,size:h}),B=Object(s.a)({fullWidth:!0,autoFocus:r,size:h,bold:b,textAlign:L?g:j},E);return Object(Me.jsxs)(Lu,{className:(t={},Object(z.a)(t,P.extraPaddingRight,i),Object(z.a)(t,P.extraPadding,o),Object(z.a)(t,P.withSuffix,O),t),width:p,size:h,bold:b,textAlign:j,children:[L&&D&&!k(F)&&Object(Me.jsx)(pn.b,Object(s.a)({name:c,component:d},B)),L&&!D&&!k(F)&&Object(Me.jsx)(a.input,{name:c}),!L&&F&&!k(F)&&Object(Me.jsx)("div",{style:w(F,L),children:N(F[c],F)}),O&&!k(F)&&Object(Me.jsx)(v,{className:P.suffix,style:L?{}:w(F,L),children:O}),k(F)&&Object(Me.jsx)(Gt,{})]})},Hm=function(e){var t=e.editing,n=e.disabled,a=e.lastOfGroup,i=e.newRow,o=Object(pn.e)(),l=o.touched,s=o.errors,d=o.values,u=Object(r.useContext)(Ru),m=u.elements,h=u.enableEdit,b=u.enableDelete,p=u.error,j=u.enableToggle,f=u.rowSize,g=u.stripeWhen,O=zm(),x=!t&&g&&g(d)?function(e){var t=Yl.a(W.a("stripe",!0))(e),n=Object(c.a)(t,2),r=n[0],a=n[1];if(!r.length)return e;var i=Au.a(r[0],e),o=L.a(Kl.a,B.a(T.a(["width"])))(r);return Tu.a(i,{width:o,editable:!1,view:function(){return Object(Me.jsx)(Gt,{})}},a)}(m):m,v=Yl.a(qo.a("doubleHeader"))(m),y=Object(c.a)(v,1)[0],w=(null===y||void 0===y?void 0:y.length)?Au.a(y[0],m):-1,C=(null===y||void 0===y?void 0:y.length)?Au.a(y[y.length-1],m):-1,k=x.findIndex((function(e){return void 0===e.editable||e.editable})),S=Object(z.a)({},O.lastOfGroup,a),N=_u.a(yl.a(l),s),I=N&&yl.a(N).length>0||!!p,F=p||N&&ks.a(N).join(", ");return Object(Me.jsxs)(Bu,{className:E()(S),size:f,error:t&&I,newRow:i&&!I,errorMessage:F,children:[x.map((function(e,n){return Object(Me.jsx)(qm,{config:e,editing:t,focus:n===k&&t,extraPaddingRight:C===n,extraPadding:w===n},n)})),(h||b||j)&&Object(Me.jsx)($m,{disabled:n,editing:t})]})},Vm={wrapper:function(e){return{width:e.width}},addLink:{marginLeft:"auto"},title:{margin:0,color:se},outerHeader:{minHeight:16,marginBottom:24,display:"flex",justifyContent:"space-between",alignItems:"center"}},Um=Object(j.a)(Vm),Gm=L.a(Zl.a(mu.a)(0),B.a((function(e){var t;return null!==(t=e.width)&&void 0!==t?t:100}))),Xm=function(e){var t,n,a,i=e.name,o=e.title,l=e.titleLg,d=e.elements,u=void 0===d?[]:d,m=e.data,h=void 0===m?[]:m,b=e.save,p=e.error,j=e.rowSize,f=void 0===j?"md":j,g=e.validationSchema,O=e.enableCreate,x=e.enableEdit,v=e.enableEditText,y=e.editWidth,w=e.enableDelete,C=e.deleteWidth,k=void 0===C?87:C,S=e.enableToggle,N=e.toggleWidth,I=void 0===N?87:N,E=e.onToggle,F=e.forceDisable,L=e.disableAdd,D=e.initialValues,P=e.setEditing,B=e.shouldOverrideEdit,A=e.editOverride,T=e.stripeWhen,M=e.disableRowEdit,$=e.groupBy,q=e.sortBy,H=e.createText,V=void 0===H?"Add override":H,U=e.forceAdd,G=void 0!==U&&U,X=e.tbodyWrapperClass,_=Object(r.useState)(null),K=Object(c.a)(_,2),Z=K[0],Y=K[1],Q=Object(r.useState)(!1),J=Object(c.a)(Q,2),ee=J[0],te=J[1],ne=Object(r.useState)(!1),re=Object(c.a)(ne,2),ae=re[0],ie=re[1],oe=Object(r.useState)(null),ce=Object(c.a)(oe,2),le=ce[0],se=ce[1];Object(r.useEffect)((function(){return se(p)}),[p]),Object(r.useEffect)((function(){se(null),te(G)}),[G]);var de=function(){var e=Object(pc.a)(bc.a.mark((function e(t){var n,r,a;return bc.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!ae){e.next=2;break}return e.abrupt("return");case 2:if(ie(!0),n=g.cast(t),r=Ko.a(W.a("id",n.id))(h),a=-1!==r?bu.a(r,n,h):pu.a(n,h),Ms.a(h[r],n)){e.next=16;break}return e.prev=7,e.next=10,b(Object(z.a)({},i,a),n);case 10:e.next=16;break;case 12:return e.prev=12,e.t0=e.catch(7),ie(!1),e.abrupt("return");case 16:te(!1),P&&P(!1),ie(!1);case 19:case"end":return e.stop()}}),e,null,[[7,12]])})));return function(t){return e.apply(this,arguments)}}(),ue=function(){te(!1),Y(null),P&&P(!1)},me=function(){te(!0),se(null),P&&P(!0,!0)},he=w||S?87:174,be=zr.a(he)(y),pe=(null!==(t=w&&k)&&void 0!==t?t:0)+(null!==(n=x&&be)&&void 0!==n?n:0)+(null!==(a=S&&I)&&void 0!==a?a:0),je=Gm(u)+pe,fe=Um({width:je}),ge=!h.length&&O&&!ee,Oe=!F&&!Z&&!L&&!ee,xe=ee||0!==h.length,ve=q?fu.a(q)(h):h,ye={elements:u,enableEdit:x,enableEditText:v,onEdit:function(e){if(B&&B(e))return A(e);Y(e),se(null),P&&P(e,!0)},clearError:function(){return se(null)},error:le,disableRowEdit:M,editWidth:be,enableDelete:w,onDelete:function(e){var t=ju.a((function(t){return t.id===e}),h);return b(Object(z.a)({},i,t))},deleteWidth:k,enableToggle:S,rowSize:f,onToggle:E,toggleWidth:I,actionColSize:pe,stripeWhen:T,forceAdd:G,DEFAULT_COL_SIZE:100};return Object(Me.jsx)(Ru.Provider,{value:ye,children:Object(Me.jsxs)("div",{className:fe.wrapper,children:[ge&&Oe&&Object(Me.jsx)(Ln,{onClick:me,children:V}),xe&&Object(Me.jsxs)(Me.Fragment,{children:[(o||O)&&Object(Me.jsxs)("div",{className:fe.outerHeader,children:[o&&l&&Object(Me.jsx)(Qe,{className:fe.title,children:o}),o&&!l&&Object(Me.jsx)(Ke,{className:fe.title,children:o}),O&&Oe&&Object(Me.jsx)(or,{className:fe.addLink,onClick:me,children:V})]}),Object(Me.jsxs)(Nu,{children:[Object(Me.jsx)(Xu,{}),Object(Me.jsx)("div",{className:X,children:Object(Me.jsxs)(Fu,{children:[ee&&Object(Me.jsx)(pn.d,{validateOnBlur:!1,validateOnChange:!1,initialValues:Object(s.a)({id:Object(gu.a)()},D),onReset:ue,validationSchema:g,onSubmit:de,children:Object(Me.jsxs)(pn.c,{children:[Object(Me.jsx)(xu,{}),Object(Me.jsx)(Hm,{editing:!0,disabled:F,newRow:!0})]})}),ve.map((function(e,t){var n,r=ve[t+1],a=!!$&&r,i="Function"===Br.a($)?$:R.a($),o=a&&i(e)!==i(r);return Object(Me.jsx)(pn.d,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,initialValues:e,onReset:ue,validationSchema:g,onSubmit:de,children:Object(Me.jsxs)(pn.c,{children:[Object(Me.jsx)(xu,{}),Object(Me.jsx)(Hm,{lastOfGroup:o,editing:Z===e.id,disabled:F||Z&&Z!==e.id||ee})]})},null!==(n=e.id)&&void 0!==n?n:t)}))]})})]})]})]})})},_m=function(e){var t=e.name,n=e.save,r=e.data,a=void 0===r?{}:r,i=e.namespaces,o=void 0===i?[]:i,c=Object($.a)(e,["name","save","data","namespaces"]),l=B.a((function(e){return Object(s.a)({id:e},$l(e)(a))}))(o);return Object(Me.jsx)(Xm,Object(s.a)({name:t,data:l,save:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var a=t[1];return n(ql(a.id)(hu.a(["id2"],a)))}},c))},Km={cashbox:{height:36}},Zm=Object(j.a)(Km),Ym={2:{cashbox:116,cassette:280,cassetteGraph:80,editWidth:174},3:{cashbox:106,cassette:200,cassetteGraph:60,editWidth:145},4:{cashbox:106,cassette:164,cassetteGraph:40,editWidth:90}},Qm=xn.e().shape({name:xn.g().required("Required"),cashbox:xn.d().label("Cashbox").required().integer().min(0).max(1e3),cassette1:xn.d().required("Required").integer().min(0).max(500),cassette2:xn.d().required("Required").integer().min(0).max(500),cassette3:xn.d().required("Required").integer().min(0).max(500),cassette4:xn.d().required("Required").integer().min(0).max(500)}),Jm=x()(Rm||(Rm=Object(l.a)(["\n mutation MachineAction(\n $deviceId: ID!\n $action: MachineAction!\n $cashbox: Int!\n $cassette1: Int!\n $cassette2: Int!\n $cassette3: Int!\n $cassette4: Int!\n ) {\n machineAction(\n deviceId: $deviceId\n action: $action\n cashbox: $cashbox\n cassette1: $cassette1\n cassette2: $cassette2\n cassette3: $cassette3\n cassette4: $cassette4\n ) {\n deviceId\n cashbox\n cassette1\n cassette2\n cassette3\n cassette4\n }\n }\n"]))),eh=function(e){var t=e.machine,n=e.config,r=e.refetchData,a=Zm(),i=n&&$l("cashOut")(n),o=n&&$l("locale")(n),l=n&&$l("notifications",n),s=null===o||void 0===o?void 0:o.fiatCurrency,d=t.numberOfCassettes,m=function(e){return $l(e)(i)},h=function(e){var t=e.deviceId;return!m(t).active},b=[{name:"cashbox",header:"Cashbox",width:Ym[d].cashbox,stripe:!1,view:function(e){return Object(Me.jsx)(Ta,{currency:{code:s},notes:e,total:0})},input:qa,inputProps:{decimalPlaces:0}}];su.a(du.a(uu.a,d),(function(e){return b.push({name:"cassette".concat(e),header:"Cash-out ".concat(e),width:Ym[d].cassette,stripe:!0,doubleHeader:"Cash-out",view:function(n){var r;return Object(Me.jsx)(Ma,{className:a.cashbox,denomination:null===(r=m(t.deviceId))||void 0===r?void 0:r["cassette".concat(e)],currency:{code:s},notes:n,width:Ym[d].cassetteGraph,threshold:l["fillingPercentageCassette".concat(e)]})},isHidden:function(t){var n=t.numberOfCassettes;return e>n},input:za,inputProps:{decimalPlaces:0,width:Ym[d].cassetteGraph,inputClassName:a.cashbox}}),mu.a(1,e)}),1);var p=Object(u.b)(Jm,{refetchQueries:function(){return r()}}),j=Object(c.a)(p,2),f=j[0],g=j[1].error;return t.name?Object(Me.jsx)(Xm,{error:null===g||void 0===g?void 0:g.message,enableEdit:!0,editWidth:Ym[d].editWidth,stripeWhen:h,disableRowEdit:h,name:"cashboxes",elements:b,data:[t]||!1,save:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t[1],a=r.deviceId,i=r.cashbox,o=r.cassette1,c=r.cassette2,l=r.cassette3,s=r.cassette4;return f({variables:{action:"setCassetteBills",deviceId:a,cashbox:i,cassette1:o,cassette2:c,cassette3:l,cassette4:s}})},validationSchema:Qm}):null},th=n(848),nh={marginLeft:6},rh=Object(Me.jsxs)("div",{children:[Object(Me.jsx)(ul,{}),Object(Me.jsx)("span",{style:nh,children:"Cash-in"})]}),ah=Object(Me.jsxs)("div",{children:[Object(Me.jsx)(gl,{}),Object(Me.jsx)("span",{style:nh,children:"Cash-out"})]}),ih=function(e){return function(e){return[{name:"name",width:280,size:"sm",view:function(e){return"".concat(e)}},{header:rh,name:"cashIn",display:"Cash-in",width:130,textAlign:"right",suffix:"%"},{header:ah,name:"cashOut",display:"Cash-out",width:130,textAlign:"right",suffix:"%",inputProps:{decimalPlaces:3}},{name:"fixedFee",display:"Fixed fee",width:144,doubleHeader:"Cash-in only",textAlign:"right",suffix:e},{name:"minimumTx",display:"Minimun Tx",width:144,doubleHeader:"Cash-in only",textAlign:"right",suffix:e}]}(e)},oh=x()(Am||(Am=Object(l.a)(["\n query getData {\n config\n cryptoCurrencies {\n code\n display\n }\n machines {\n name\n deviceId\n }\n }\n"]))),ch=x()(Tm||(Tm=Object(l.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),lh=function(e){var t=e.name,n=e.id,r=Object(u.c)(oh),a=r.data,i=r.loading,o=Object(u.b)(ch,{refetchQueries:function(){return["getData"]}}),l=Object(c.a)(o,1)[0],s=(null===a||void 0===a?void 0:a.config)&&$l(t)(a.config),d=T.a(["fiatCurrency"])($l(Dl)(null===a||void 0===a?void 0:a.config)),m=function(){if(i||!n||!s)return[];var e={};th.a((function(t){return e[R.a("code")(t)]={code:t.code,name:t.display,cashIn:s.cashIn,cashOut:s.cashOut,fixedFee:s.fixedFee,minimumTx:s.minimumTx}}))(a.cryptoCurrencies);var t=function(e){return W.a("machine",e)},r=s.overrides?M.a(t("ALL_MACHINES"))(s.overrides):[],o=function(t){e[t.cryptoCurrencies[0]].cashIn=t.cashIn,e[t.cryptoCurrencies[0]].cashOut=t.cashOut,e[t.cryptoCurrencies[0]].fixedFee=t.fixedFee,e[t.cryptoCurrencies[0]].minimumTx=t.minimumTx};th.a(o)(r);var c=s.overrides?M.a(t(n))(s.overrides):[];return th.a(o)(c),ks.a(e)}();return Object(Me.jsx)(Xm,{name:"overrides",save:function(e){var n=ql(t)(e);return l({variables:{config:n}})},data:m,elements:ih(d)})},sh={grid:{flex:1,height:"100%"},content:{display:"flex",flexDirection:"column",flex:1,marginLeft:48,maxWidth:900},subtitle:{display:"flex",justifyContent:"space-between",alignItems:"center",flexDirection:"row",color:q},label3:{color:q,marginTop:0},row:{display:"flex",flexDirection:"row",justifyContent:"space-around"},rowItem:{flex:1,marginBottom:16},detailItem:{marginBottom:32},actionButtonsContainer:{display:"flex",flexDirection:"row"},breadcrumbsContainer:{marginTop:32},breadcrumbLink:{textDecoration:"none"},detailsMargin:{marginTop:24},sidebarContainer:{height:400,overflowY:"auto"}},dh=Object(j.a)(sh),uh=function(e){var t=e.data,n=e.timezone,r=dh();return Object(Me.jsxs)("div",{className:r.row,children:[Object(Me.jsxs)("div",{className:r.rowItem,children:[Object(Me.jsx)(nt,{className:r.label3,children:"Paired at"}),Object(Me.jsx)(Xe,{children:t.pairedAt?Os(t.pairedAt,n,"yyyy-MM-dd HH:mm:ss"):""})]}),Object(Me.jsxs)("div",{className:r.rowItem,children:[Object(Me.jsx)(nt,{className:r.label3,children:"Machine model"}),Object(Me.jsx)(Xe,{children:t.model})]}),Object(Me.jsxs)("div",{className:r.rowItem,children:[Object(Me.jsx)(nt,{className:r.label3,children:"Software version"}),Object(Me.jsx)(Xe,{children:t.version})]})]})},mh=n(849),hh=n(917),bh=Object(j.a)({dialogContent:{width:434,padding:16,paddingRight:28},dialogTitle:{padding:16,paddingRight:12,display:"flex","justify-content":"space-between","& > h4":{margin:0},"& > button":{padding:0,marginTop:-4}},dialogActions:{padding:32,paddingTop:16}}),ph=function(e){var t=e.children,n=e.onClose,r=bh();return Object(Me.jsxs)("div",{className:r.dialogTitle,children:[t,n&&Object(Me.jsx)(tr,{size:16,"aria-label":"close",onClick:n,children:Object(Me.jsx)(gi,{})})]})},jh=Object(r.memo)((function(e){var t=e.title,n=void 0===t?"Confirm action":t,a=e.errorMessage,i=void 0===a?"This action requires confirmation":a,o=e.open,l=e.toBeConfirmed,d=e.saveButtonAlwaysEnabled,u=void 0!==d&&d,m=e.message,h=e.confirmationMessage,b=void 0===h?"Write '".concat(l,"' to confirm this action"):h,p=e.onConfirmed,j=e.onDismissed,f=e.initialValue,g=void 0===f?"":f,O=e.disabled,x=void 0!==O&&O,v=Object($.a)(e,["title","errorMessage","open","toBeConfirmed","saveButtonAlwaysEnabled","message","confirmationMessage","onConfirmed","onDismissed","initialValue","disabled"]),y=bh(),w=Object(r.useState)(g),C=Object(c.a)(w,2),k=C[0],S=C[1],N=Object(r.useState)(!1),I=Object(c.a)(N,2),E=I[0],F=I[1],L=!u&&l!==k||""===k;return Object(Me.jsxs)(un.a,Object(s.a)(Object(s.a)({open:o,"aria-labelledby":"form-dialog-title"},v),{},{children:[Object(Me.jsx)(ph,{id:"customized-dialog-title",onClose:function(){S(""),F(!1),j()},children:Object(Me.jsx)(Ue,{children:n})}),i&&Object(Me.jsx)(ph,{children:Object(Me.jsx)(Ao,{children:i.split(":").map((function(e){return Object(Me.jsxs)(Me.Fragment,{children:[e,Object(Me.jsx)("br",{})]})}))})}),Object(Me.jsxs)(mn.a,{className:y.dialogContent,children:[m&&Object(Me.jsx)(Xe,{children:m}),Object(Me.jsx)(hh.a,{htmlFor:"confirm-input",children:b}),Object(Me.jsx)(Xr,{disabled:x,name:"confirm-input",autoFocus:!0,id:"confirm-input",type:"text",size:"sm",fullWidth:!0,value:k,touched:{},error:E,InputLabelProps:{shrink:!0},onChange:function(e){return S(e.target.value)}})]}),Object(Me.jsx)(Ku.a,{className:y.dialogActions,children:Object(Me.jsx)(Tn,{color:"green",disabled:L,onClick:function(){return p(k)},children:"Confirm"})})]}))}));function fh(){return(fh=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function gh(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Oh=r.createElement("desc",null,"Created with Sketch."),xh=r.createElement("g",{id:"icon/button/edit/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("path",{d:"M0,10 L0,10 C0,10.9942 0.8058,11.8 1.8,11.8 L10.2,11.8 C11.1942,11.8 12,10.9942 12,10",id:"Stroke-1",stroke:"#FFFFFF"}),r.createElement("polygon",{id:"Stroke-3",stroke:"#FFFFFF",points:"3 6.86666667 8.86666667 1 11 3.13333333 5.13333333 9 3 9"}));function vh(e,t){var n=e.title,a=e.titleId,i=gh(e,["title","titleId"]);return r.createElement("svg",fh({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Oh,xh)}var yh=r.forwardRef(vh);n.p;function wh(){return(wh=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Ch(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var kh=r.createElement("desc",null,"Created with Sketch."),Sh=r.createElement("g",{id:"icon/button/edit/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("path",{d:"M0,10 L0,10 C0,10.9942 0.8058,11.8 1.8,11.8 L10.2,11.8 C11.1942,11.8 12,10.9942 12,10",id:"Stroke-1",stroke:"#1B2559"}),r.createElement("polygon",{id:"Stroke-3",stroke:"#1B2559",points:"3 6.86666667 8.86666667 1 11 3.13333333 5.13333333 9 3 9"}));function Nh(e,t){var n=e.title,a=e.titleId,i=Ch(e,["title","titleId"]);return r.createElement("svg",wh({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,kh,Sh)}var Ih=r.forwardRef(Nh);n.p;function Eh(){return(Eh=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Fh(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Lh=r.createElement("desc",null,"Created with Sketch."),Dh=r.createElement("g",{id:"icon/button/reboot/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("g",{id:"Group-3",stroke:"#FFFFFF"},r.createElement("g",{id:"Group-2"},r.createElement("path",{d:"M3.57419317,11.1560104 C2.91506589,10.8661403 2.29620875,10.4522182 1.75493083,9.91362078 C-0.568892549,7.60089351 -0.587250991,3.86936104 1.71406849,1.57845195 C2.03057585,1.26367293 2.37407977,0.992496226 2.73740775,0.764921841",id:"Stroke-1"}),r.createElement("polyline",{id:"Stroke-3",points:"3.37563213 1.84831169 3.36911784 0.595324675 2.18174122 4.15223411e-14"})),r.createElement("line",{x1:5.92223784,y1:7.57277922,x2:5.92223784,y2:3.98212987,id:"Stroke-9"}),r.createElement("g",{id:"Group-2",transform:"translate(9.818105, 6.000000) scale(-1, -1) translate(-9.818105, -6.000000) translate(7.636287, 0.000000)"},r.createElement("path",{d:"M3.57419317,11.1560104 C2.91506589,10.8661403 2.29620875,10.4522182 1.75493083,9.91362078 C-0.568892549,7.60089351 -0.587250991,3.86936104 1.71406849,1.57845195 C2.03057585,1.26367293 2.37407977,0.992496226 2.73740775,0.764921841",id:"Stroke-1"}),r.createElement("polyline",{id:"Stroke-3",points:"3.37563213 1.84831169 3.36911784 0.595324675 2.18174122 4.15223411e-14"}))));function Ph(e,t){var n=e.title,a=e.titleId,i=Fh(e,["title","titleId"]);return r.createElement("svg",Eh({width:"12px",height:"12px",viewBox:"-0.493 -0.5 12.993 13",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Lh,Dh)}var Bh=r.forwardRef(Ph);n.p;function Rh(){return(Rh=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Ah(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Th=r.createElement("desc",null,"Created with Sketch."),Mh=r.createElement("g",{id:"icon/button/reboot/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("g",{id:"Group-3",stroke:"#1B2559"},r.createElement("g",{id:"Group-2"},r.createElement("path",{d:"M3.57419317,11.1560104 C2.91506589,10.8661403 2.29620875,10.4522182 1.75493083,9.91362078 C-0.568892549,7.60089351 -0.587250991,3.86936104 1.71406849,1.57845195 C2.03057585,1.26367293 2.37407977,0.992496226 2.73740775,0.764921841",id:"Stroke-1"}),r.createElement("polyline",{id:"Stroke-3",points:"3.37563213 1.84831169 3.36911784 0.595324675 2.18174122 4.15223411e-14"})),r.createElement("line",{x1:5.92223784,y1:7.57277922,x2:5.92223784,y2:3.98212987,id:"Stroke-9"}),r.createElement("g",{id:"Group-2",transform:"translate(9.818105, 6.000000) scale(-1, -1) translate(-9.818105, -6.000000) translate(7.636287, 0.000000)"},r.createElement("path",{d:"M3.57419317,11.1560104 C2.91506589,10.8661403 2.29620875,10.4522182 1.75493083,9.91362078 C-0.568892549,7.60089351 -0.587250991,3.86936104 1.71406849,1.57845195 C2.03057585,1.26367293 2.37407977,0.992496226 2.73740775,0.764921841",id:"Stroke-1"}),r.createElement("polyline",{id:"Stroke-3",points:"3.37563213 1.84831169 3.36911784 0.595324675 2.18174122 4.15223411e-14"}))));function Wh(e,t){var n=e.title,a=e.titleId,i=Ah(e,["title","titleId"]);return r.createElement("svg",Rh({width:"12px",height:"12px",viewBox:"-0.493 -0.5 12.993 13",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Th,Mh)}var zh=r.forwardRef(Wh);n.p;function $h(){return($h=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function qh(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Hh=r.createElement("desc",null,"Created with Sketch."),Vh=r.createElement("g",{id:"icon/button/shut-down/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("g",{id:"Group-5",transform:"translate(1.000000, 0.000000)",stroke:"#FFFFFF"},r.createElement("path",{d:"M7.7735,2 C9.116,2.89710351 10,4.4271328 10,6.16330077 C10,8.92665975 7.7615,11.1666667 5,11.1666667 C2.2385,11.1666667 0,8.92665975 0,6.16330077 C0,4.43663919 0.8745,2.91361461 2.204,2.01450976",id:"Stroke-1"}),r.createElement("line",{x1:5,y1:.75,x2:5,y2:3.25,id:"Stroke-3"})));function Uh(e,t){var n=e.title,a=e.titleId,i=qh(e,["title","titleId"]);return r.createElement("svg",$h({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Hh,Vh)}var Gh=r.forwardRef(Uh);n.p;function Xh(){return(Xh=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function _h(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Kh=r.createElement("desc",null,"Created with Sketch."),Zh=r.createElement("g",{id:"icon/button/shut-down/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("g",{id:"Group-5",transform:"translate(1.000000, 0.000000)",stroke:"#1B2559"},r.createElement("path",{d:"M7.7735,2 C9.116,2.89710351 10,4.4271328 10,6.16330077 C10,8.92665975 7.7615,11.1666667 5,11.1666667 C2.2385,11.1666667 0,8.92665975 0,6.16330077 C0,4.43663919 0.8745,2.91361461 2.204,2.01450976",id:"Stroke-1"}),r.createElement("line",{x1:5,y1:.75,x2:5,y2:3.25,id:"Stroke-3"})));function Yh(e,t){var n=e.title,a=e.titleId,i=_h(e,["title","titleId"]);return r.createElement("svg",Xh({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Kh,Zh)}var Qh=r.forwardRef(Yh);n.p;function Jh(){return(Jh=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function eb(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var tb=r.createElement("desc",null,"Created with Sketch."),nb=r.createElement("g",{id:"icon/button/unpair/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("g",{id:"Group-12",stroke:"#FFFFFF"},r.createElement("g",{id:"Group-5"},r.createElement("polyline",{id:"Stroke-1",points:"3.75 6 2.25 6 0 3.75 3.75 0 6.75 3"}),r.createElement("polyline",{id:"Stroke-3",points:"8.25 6 9.75 6 12 8.25 8.25 12 5.25 9"})),r.createElement("line",{x1:8.25,y1:3,x2:8.25,y2:1.5,id:"Stroke-6"}),r.createElement("line",{x1:9.75,y1:3,x2:10.5,y2:2.25,id:"Stroke-7"}),r.createElement("line",{x1:9.75,y1:4.5,x2:11.25,y2:4.5,id:"Stroke-8"}),r.createElement("line",{x1:2.25,y1:7.5,x2:.75,y2:7.5,id:"Stroke-9"}),r.createElement("line",{x1:2.25,y1:9,x2:1.5,y2:9.75,id:"Stroke-10"}),r.createElement("line",{x1:3.75,y1:9,x2:3.75,y2:10.5,id:"Stroke-11"})));function rb(e,t){var n=e.title,a=e.titleId,i=eb(e,["title","titleId"]);return r.createElement("svg",Jh({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,tb,nb)}var ab=r.forwardRef(rb);n.p;function ib(){return(ib=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function ob(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var cb=r.createElement("desc",null,"Created with Sketch."),lb=r.createElement("g",{id:"icon/button/unpair/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("g",{id:"Group-12",stroke:"#1B2559"},r.createElement("g",{id:"Group-5"},r.createElement("polyline",{id:"Stroke-1",points:"3.75 6 2.25 6 0 3.75 3.75 0 6.75 3"}),r.createElement("polyline",{id:"Stroke-3",points:"8.25 6 9.75 6 12 8.25 8.25 12 5.25 9"})),r.createElement("line",{x1:8.25,y1:3,x2:8.25,y2:1.5,id:"Stroke-6"}),r.createElement("line",{x1:9.75,y1:3,x2:10.5,y2:2.25,id:"Stroke-7"}),r.createElement("line",{x1:9.75,y1:4.5,x2:11.25,y2:4.5,id:"Stroke-8"}),r.createElement("line",{x1:2.25,y1:7.5,x2:.75,y2:7.5,id:"Stroke-9"}),r.createElement("line",{x1:2.25,y1:9,x2:1.5,y2:9.75,id:"Stroke-10"}),r.createElement("line",{x1:3.75,y1:9,x2:3.75,y2:10.5,id:"Stroke-11"})));function sb(e,t){var n=e.title,a=e.titleId,i=ob(e,["title","titleId"]);return r.createElement("svg",ib({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,cb,lb)}var db,ub,mb=r.forwardRef(sb),hb=(n.p,{label:{extend:Re.label1,color:se,marginBottom:4},inlineChip:{marginInlineEnd:"0.25em"},stack:{display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"start"},mr:{marginRight:8,marginBottom:8},warning:{color:me}}),bb=Object(j.a)(hb),pb=x()(db||(db=Object(l.a)(["\n mutation MachineAction(\n $deviceId: ID!\n $action: MachineAction!\n $newName: String\n ) {\n machineAction(deviceId: $deviceId, action: $action, newName: $newName) {\n deviceId\n }\n }\n"]))),jb=x()(ub||(ub=Object(l.a)(["\n query getMachine($deviceId: ID!) {\n machine(deviceId: $deviceId) {\n latestEvent {\n note\n }\n }\n }\n"]))),fb=function(e){var t=e.children,n=bb();return Object(Me.jsx)("div",{className:n.label,children:t})},gb=Object(r.memo)((function(e){var t=e.machine,n=e.onActionSuccess,a=Object(r.useState)({command:null}),i=Object(c.a)(a,2),o=i[0],l=i[1],d=Object(r.useState)(null),m=Object(c.a)(d,2),h=m[0],b=m[1],p=bb(),j=Object(Me.jsx)("span",{className:p.warning,children:"A user may be in the middle of a transaction and they could lose their funds if you continue."}),f=Object(u.a)(jb,{variables:{deviceId:t.deviceId},onCompleted:function(e){var t,n=(t=function(e){var t,n;return JSON.parse(null!==(t=null===(n=e.machine.latestEvent)||void 0===n?void 0:n.note)&&void 0!==t?t:'{"state": null}').state}(e))&&!["chooseCoin","idle","pendingIdle","dualIdle","networkDown","unpaired","maintenance","virgin","wifiList"].includes(t)?j:null;l((function(e){return Object(s.a)(Object(s.a)({},e),{},{message:n})}))}}),g=Object(c.a)(f,2),O=g[0],x=g[1].loading,v=Object(u.b)(pb,{onError:function(e){var t=e.message;b(null!==t&&void 0!==t?t:"An error ocurred")},onCompleted:function(){n&&n(),l({command:null})}}),y=Object(c.a)(v,2),w=y[0],C=y[1].loading,k=Boolean(o.command),S=!("restartServices"!==(null===o||void 0===o?void 0:o.command)||!x);return Object(Me.jsxs)("div",{children:[Object(Me.jsx)(fb,{children:"Actions"}),Object(Me.jsxs)("div",{className:p.stack,children:[Object(Me.jsx)(ze,{color:"primary",className:p.mr,Icon:Ih,InverseIcon:yh,disabled:C,onClick:function(){return l({command:"rename",display:"Rename",confirmationMessage:"Write the new name for this machine"})},children:"Rename"}),Object(Me.jsx)(ze,{color:"primary",className:p.mr,Icon:mb,InverseIcon:ab,disabled:C,onClick:function(){return l({command:"unpair",display:"Unpair"})},children:"Unpair"}),Object(Me.jsx)(ze,{color:"primary",className:p.mr,Icon:zh,InverseIcon:Bh,disabled:C,onClick:function(){return l({command:"reboot",display:"Reboot"})},children:"Reboot"}),Object(Me.jsx)(ze,{color:"primary",className:p.mr,Icon:Qh,InverseIcon:Gh,disabled:C,onClick:function(){return l({command:"shutdown",display:"Shutdown",message:"In order to bring it back online, the machine will need to be visited and its power reset."})},children:"Shutdown"}),Object(Me.jsx)(ze,{color:"primary",className:p.inlineChip,Icon:zh,InverseIcon:Bh,disabled:C,onClick:function(){O(),l({command:"restartServices",display:"Restart services for"})},children:"Restart Services"})]}),Object(Me.jsx)(jh,{disabled:S,open:k,title:"".concat(null===o||void 0===o?void 0:o.display," this machine?"),errorMessage:h,toBeConfirmed:t.name,message:null===o||void 0===o?void 0:o.message,confirmationMessage:null===o||void 0===o?void 0:o.confirmationMessage,saveButtonAlwaysEnabled:"rename"===(null===o||void 0===o?void 0:o.command),onConfirmed:function(e){b(null),w({variables:Object(s.a)({deviceId:t.deviceId,action:"".concat(null===o||void 0===o?void 0:o.command)},"rename"===(null===o||void 0===o?void 0:o.command)&&{newName:e})})},onDismissed:function(){l({command:null}),b(null)}})]})})),Ob=n(429);function xb(){return(xb=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function vb(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var yb=r.createElement("desc",null,"Created with Sketch."),wb=r.createElement("g",{id:"Styleguide",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinejoin:"round"},r.createElement("g",{id:"icon/action/copy",transform:"translate(1.000000, 1.000000)",stroke:"#1B2559"},r.createElement("g",{id:"Group-5-Copy-2"},r.createElement("polyline",{id:"Stroke-1",strokeWidth:2,points:"6 1.2 6 -0.00024 16 -0.00024 16 13.06376 12 13.06376"}),r.createElement("polygon",{id:"Stroke-3",strokeWidth:2,strokeLinecap:"round",points:"0 15.9368 10 15.9368 10 2.9368 0 2.9368"}))));function Cb(e,t){var n=e.title,a=e.titleId,i=vb(e,["title","titleId"]);return r.createElement("svg",xb({width:"18px",height:"18px",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,yb,wb)}var kb=r.forwardRef(Cb),Sb=(n.p,{titleWrapper:{display:"flex",justifyContent:"space-between",alignItems:"center",flexDirection:"row"},wrapper:{flex:1,display:"flex",flexDirection:"row",height:"100%"},tableWrapper:{flex:1,marginLeft:40,display:"block",overflowX:"auto",width:"100%",maxWidth:"78%",maxHeight:"70vh"},table:{whiteSpace:"nowrap",display:"block","& th":{position:"sticky",top:0}},dateColumn:{minWidth:160},levelColumn:{minWidth:100},fillColumn:{width:"100%"},shareButton:{margin:8,display:"flex",alignItems:"center",fontSize:ve,padding:[[0,12]]},shareIcon:{marginRight:6},button:{margin:8},titleAndButtonsContainer:{display:"flex"},buttonsWrapper:{display:"flex",marginLeft:16,"& > *":{margin:"auto 6px"}}}),Nb=Re.label1,Ib={wrapper:{extend:Re.mono,display:"flex",alignItems:"center"},address:{lineBreak:"anywhere"},buttonWrapper:{"& button":{border:"none",backgroundColor:"transparent",cursor:"pointer"}},popoverContent:{extend:Nb,display:"flex",justifyContent:"center",alignItems:"center",color:Z,borderRadius:4,padding:[[5,9]]}},Eb={idCardDataCard:{extend:Re.p,display:"flex",padding:[[11,8]],"& > div":{display:"flex",flexDirection:"column","& > div":{width:144,height:37,marginBottom:15,"&:last-child":{marginBottom:0}}}}},Fb={label:{extend:Nb,color:se,marginBottom:4}},Lb={titleWrapper:Sb.titleWrapper,titleAndButtonsContainer:Sb.titleAndButtonsContainer,buttonsWrapper:Sb.buttonsWrapper,headerLabels:{display:"flex",flexDirection:"row","& div":{display:"flex",alignItems:"center"},"& > div:first-child":{marginRight:24},"& span":{extend:Nb,marginLeft:6}},overflowTd:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},flexWrapper:{display:"flex",alignItems:"center",justifyContent:"space-between",marginRight:16},customerLinkIcon:{marginLeft:2},flexRow:{display:"flex",flexDirection:"row",alignItems:"center"},machineRedirectContainer:{marginLeft:10,paddingLeft:5,paddingRight:5}},Db=Object(j.a)(Ib),Pb=function(e){var t=e.className,n=e.buttonClassname,a=e.children,i=e.wrapperClassname,o=(Object($.a)(e,["className","buttonClassname","children","wrapperClassname"]),Object(r.useState)(null)),l=Object(c.a)(o,2),s=l[0],d=l[1];Object(r.useEffect)((function(){s&&setTimeout((function(){return d(null)}),3e3)}),[s]);var u=Db(),m=Boolean(s),h=m?"simple-popper":void 0;return Object(Me.jsx)("div",{className:E()(u.wrapper,i),children:a&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)("div",{className:E()(u.address,t),children:a}),Object(Me.jsx)("div",{className:E()(u.buttonWrapper,n),children:Object(Me.jsx)(Ob.CopyToClipboard,{text:Mu.a(/\s/g,"")(a),children:Object(Me.jsx)("button",{"aria-describedby":h,onClick:function(e){return function(e){d(s?null:e.currentTarget)}(e)},children:Object(Me.jsx)(kb,{})})})}),Object(Me.jsx)(Xn,{id:h,open:m,anchorEl:s,onClose:function(){d(null)},arrowSize:3,bgColor:q,placement:"top",children:Object(Me.jsx)("div",{className:u.popoverContent,children:Object(Me.jsx)("div",{children:"Copied to clipboard!"})})})]})})},Bb=Object(j.a)(sh),Rb=function(e){if(!e)return null;var t=Object(mh.a)(e,new Date);if(t<60)return"".concat(t," ").concat(1===t?"second":"seconds"," ago");if(t<3600){var n=Math.round(t/60);return"".concat(n," ").concat(1===n?"minute":"minutes"," ago")}if(t<86400){var r=Math.round(t/3600);return"".concat(r," ").concat(1===r?"hour":"hours"," ago")}var a=Math.round(t/3600/24);return"".concat(a," ").concat(1===a?"day":"days"," ago")},Ab=function(e){var t=e.data,n=e.onActionSuccess,r=Bb();return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)("div",{className:r.row,children:Object(Me.jsx)("div",{className:r.rowItem,children:Object(Me.jsx)(Ve,{children:t.name})})}),Object(Me.jsx)("div",{className:r.row,children:Object(Me.jsxs)("div",{className:r.rowItem,children:[Object(Me.jsx)(nt,{className:r.label3,children:"Status"}),t&&t.statuses?Object(Me.jsx)(Md,{status:t.statuses[0]}):null]})}),Object(Me.jsx)("div",{className:r.row,children:Object(Me.jsxs)("div",{className:r.rowItem,children:[Object(Me.jsx)(nt,{className:r.label3,children:"Last ping"}),Object(Me.jsx)(Xe,{children:Rb(t.lastPing)})]})}),Object(Me.jsx)("div",{className:r.row,children:Object(Me.jsxs)("div",{className:r.rowItem,children:[Object(Me.jsx)(nt,{className:r.label3,children:"Network speed"}),Object(Me.jsx)(Xe,{children:t.downloadSpeed?new vl.a(t.downloadSpeed).toFixed(4).toString()+" MB/s":"unavailable"})]})}),Object(Me.jsx)("div",{className:r.row,children:Object(Me.jsx)(gb,{machine:t,onActionSuccess:n})}),Object(Me.jsx)("div",{className:r.row,children:Object(Me.jsxs)("div",{className:r.rowItem,children:[Object(Me.jsx)(nt,{className:r.label3,children:"Device ID"}),Object(Me.jsx)(Xe,{children:Object(Me.jsx)(Pb,{buttonClassname:r.copyToClipboard,children:t.deviceId})})]})})]})},Tb=n(65),Mb=n(851),Wb=n(852),zb=n(911),$b=n(850),qb=n(255),Hb=n.n(qb),Vb=n(430),Ub=n.n(Vb);function Gb(){return(Gb=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Xb(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var _b=r.createElement("desc",null,"Created with Sketch."),Kb=r.createElement("g",{id:"icon/action/help/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("path",{d:"M20.0004,11 C20.0004,6.03028475 15.9701153,2 11.0004,2 C6.03004556,2 2.0004,6.02992391 2.0004,11 C2.0004,15.9700761 6.03004556,20 11.0004,20 C15.9701153,20 20.0004,15.9697153 20.0004,11 Z M22.0004,11 C22.0004,17.0742847 17.0746847,22 11.0004,22 C4.92544514,22 0.000400000001,17.0746147 0.000400000001,11 C0.000400000001,4.92538534 4.92544514,0 11.0004,0 C17.0746847,0 22.0004,4.92571525 22.0004,11 Z",id:"Stroke-1",fill:"#1B2559",fillRule:"nonzero"}),r.createElement("path",{d:"M9.9164,8.9063 C9.9164,9.45858475 9.46868475,9.9063 8.9164,9.9063 C8.36411525,9.9063 7.9164,9.45858475 7.9164,8.9063 C7.9164,6.89094438 9.72972438,5.35290249 11.7463843,5.7072003 C13.0663562,5.93764844 14.1348314,7.00654285 14.3652323,8.32479116 C14.6130182,9.7312185 13.941375,11.0876584 12.732214,11.7545735 C12.370484,11.9534687 12.1664,12.2664153 12.1664,12.5913 L12.1664,12.6563 C12.1664,13.2085847 11.7186847,13.6563 11.1664,13.6563 C10.6141153,13.6563 10.1664,13.2085847 10.1664,12.6563 L10.1664,12.5913 C10.1664,11.5009567 10.7946963,10.5375141 11.7674377,10.0026589 C12.2360927,9.74417086 12.493064,9.22519581 12.3953326,8.67046887 C12.3098185,8.1811985 11.8915858,7.76280177 11.4013649,7.67721566 C10.6126181,7.53864454 9.9164,8.1291691 9.9164,8.9063 Z",id:"Stroke-3",fill:"#1B2559",fillRule:"nonzero"}),r.createElement("path",{d:"M10.1039,15.2188 C10.1039,14.6318 10.5799,14.1568 11.1659,14.1568 C11.7529,14.1568 12.2289,14.6318 12.2289,15.2188 C12.2289,15.8058 11.7529,16.2808 11.1659,16.2808 C10.5799,16.2808 10.1039,15.8058 10.1039,15.2188",id:"Fill-5",fill:"#1B2559"}));function Zb(e,t){var n=e.title,a=e.titleId,i=Xb(e,["title","titleId"]);return r.createElement("svg",Gb({width:"22px",height:"22px",viewBox:"0 0 22 22",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,_b,Kb)}var Yb=r.forwardRef(Zb),Qb=(n.p,Object(j.a)({transparentButton:{border:"none",backgroundColor:"transparent",marginTop:4,outline:"none",cursor:"pointer"},popoverContent:function(e){return{width:e.width,padding:[[10,15]]}}})),Jb=function(e){var t=Qb({width:e}),n=Object(r.useState)(null),a=Object(c.a)(n,2),i=a[0],o=a[1],l=Boolean(i);return{classes:t,helpPopperAnchorEl:i,helpPopperOpen:l,handleOpenHelpPopper:function(e){o(i?null:e.currentTarget)},handleCloseHelpPopper:function(){o(null)}}},ep=Object(r.memo)((function(e){var t=e.children,n=e.width,r=e.Icon,a=void 0===r?Yb:r,i=Jb(n);return Object(Me.jsx)(S.a,{onClickAway:i.handleCloseHelpPopper,children:Object(Me.jsxs)("div",{children:[Object(Me.jsx)("button",{type:"button",className:i.classes.transparentButton,onClick:i.handleOpenHelpPopper,children:Object(Me.jsx)(a,{})}),Object(Me.jsx)(Xn,{open:i.helpPopperOpen,anchorEl:i.helpPopperAnchorEl,placement:"bottom",children:Object(Me.jsx)("div",{className:i.classes.popoverContent,children:t})})]})})})),tp=Object(r.memo)((function(e){var t=e.parentElements,n=e.children,r=e.width,a=Jb(r);return Object(Me.jsxs)("div",{children:[Object(Me.jsx)("div",{onMouseEnter:a.handleOpenHelpPopper,onMouseLeave:a.handleCloseHelpPopper,children:t}),Object(Me.jsx)(Xn,{open:a.helpPopperOpen,anchorEl:a.helpPopperAnchorEl,placement:"bottom",children:Object(Me.jsx)("div",{className:a.classes.popoverContent,children:n})})]})}));function np(){return(np=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function rp(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var ap=r.createElement("g",{id:"icon/ID/card/new/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("polygon",{id:"Stroke-1",stroke:"#FFFFFF",strokeWidth:1.6,points:"1 17 23 17 23 1 1 1"}),r.createElement("line",{x1:12.7857143,y1:5,x2:19.8571429,y2:5,id:"Stroke-3",stroke:"#FFFFFF",strokeWidth:1.6}),r.createElement("line",{x1:12.7857143,y1:8.2,x2:19.8571429,y2:8.2,id:"Stroke-4",stroke:"#FFFFFF",strokeWidth:1.6}),r.createElement("polygon",{id:"Stroke-5",stroke:"#FFFFFF",strokeWidth:1.6,points:"4.14285714 12.2 9.64285714 12.2 9.64285714 5 4.14285714 5"}));function ip(e,t){var n=e.title,a=e.titleId,i=rp(e,["title","titleId"]);return r.createElement("svg",np({width:"24px",height:"18px",viewBox:"0 0 24 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),void 0===n?r.createElement("title",{id:a},"icon/ID/card/new/white"):n?r.createElement("title",{id:a},n):null,ap)}var op=r.forwardRef(ip);n.p;function cp(){return(cp=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function lp(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var sp=r.createElement("g",{id:"icon/ID/card/new/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("g",{id:"Group-2",transform:"translate(1.000000, 1.000000)",stroke:"#1B2559",strokeWidth:1.6},r.createElement("g",{id:"id-copy"},r.createElement("polygon",{id:"Stroke-1",points:"0 16 22 16 22 0 0 0"}),r.createElement("line",{x1:11.7857143,y1:4,x2:18.8571429,y2:4,id:"Stroke-3"}),r.createElement("line",{x1:11.7857143,y1:7.2,x2:18.8571429,y2:7.2,id:"Stroke-4"}),r.createElement("polygon",{id:"Stroke-5",points:"3.14285714 11.2 8.64285714 11.2 8.64285714 4 3.14285714 4"}))));function dp(e,t){var n=e.title,a=e.titleId,i=lp(e,["title","titleId"]);return r.createElement("svg",cp({width:"24px",height:"18px",viewBox:"0 0 24 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),void 0===n?r.createElement("title",{id:a},"icon/ID/card/new/zodiac"):n?r.createElement("title",{id:a},n):null,sp)}var up=r.forwardRef(dp);n.p;function mp(){return(mp=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function hp(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var bp=r.createElement("g",{id:"icon/ID/phone/new/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("path",{d:"M7.47150618,13.52898 C10.939556,16.9970298 14.7804112,17.1146315 16.4756355,16.9586292 C17.0220434,16.9090285 17.5308507,16.6578249 17.9188563,16.2698193 L20.0004862,14.1881894 L18.0220577,12.210561 L16.0436293,11.5505516 L14.7244104,12.8697705 C14.7244104,12.8697705 13.4059914,14.1881894 10.1091441,10.8905421 C6.81229671,7.59449473 8.13071565,6.27527578 8.13071565,6.27527578 L9.4499346,4.95605683 L8.78992512,2.97842842 L6.81229671,1 L4.73066681,3.0816299 C4.34186123,3.46963548 4.09145763,3.97844279 4.04105691,4.52485063 C3.88585468,6.22007499 4.00345637,10.0601301 7.47150618,13.52898 Z",id:"Stroke-1-Copy",stroke:"#FFFFFF",strokeWidth:1.6}));function pp(e,t){var n=e.title,a=e.titleId,i=hp(e,["title","titleId"]);return r.createElement("svg",mp({width:"24px",height:"18px",viewBox:"0 0 24 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),void 0===n?r.createElement("title",{id:a},"icon/ID/phone/new/white"):n?r.createElement("title",{id:a},n):null,bp)}var jp=r.forwardRef(pp);n.p;function fp(){return(fp=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function gp(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Op=r.createElement("g",{id:"icon/ID/phone/new/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("path",{d:"M7.47150618,13.52898 C10.939556,16.9970298 14.7804112,17.1146315 16.4756355,16.9586292 C17.0220434,16.9090285 17.5308507,16.6578249 17.9188563,16.2698193 L20.0004862,14.1881894 L18.0220577,12.210561 L16.0436293,11.5505516 L14.7244104,12.8697705 C14.7244104,12.8697705 13.4059914,14.1881894 10.1091441,10.8905421 C6.81229671,7.59449473 8.13071565,6.27527578 8.13071565,6.27527578 L9.4499346,4.95605683 L8.78992512,2.97842842 L6.81229671,1 L4.73066681,3.0816299 C4.34186123,3.46963548 4.09145763,3.97844279 4.04105691,4.52485063 C3.88585468,6.22007499 4.00345637,10.0601301 7.47150618,13.52898 Z",id:"Stroke-1-Copy",stroke:"#1B2559",strokeWidth:1.6}));function xp(e,t){var n=e.title,a=e.titleId,i=gp(e,["title","titleId"]);return r.createElement("svg",fp({width:"24px",height:"18px",viewBox:"0 0 24 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),void 0===n?r.createElement("title",{id:a},"icon/ID/phone/new/zodiac"):n?r.createElement("title",{id:a},n):null,Op)}var vp=r.forwardRef(xp);n.p;function yp(){return(yp=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function wp(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Cp=r.createElement("g",{id:"icon/ID/photo/new/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("path",{d:"M12,14 C9.7912,14 8,12.2088 8,10 C8,7.7912 9.7912,6 12,6 C14.2088,6 16,7.7912 16,10 C16,12.2088 14.2088,14 12,14 Z M16.7142857,3.4 L14.3571429,1 L9.64285714,1 L7.28571429,3.4 L1,3.4 L1,17 L23,17 L23,3.4 L16.7142857,3.4 Z",id:"Stroke-1",stroke:"#FFFFFF",strokeWidth:1.6}));function kp(e,t){var n=e.title,a=e.titleId,i=wp(e,["title","titleId"]);return r.createElement("svg",yp({width:"24px",height:"18px",viewBox:"0 0 24 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),void 0===n?r.createElement("title",{id:a},"icon/ID/photo/new/white"):n?r.createElement("title",{id:a},n):null,Cp)}var Sp=r.forwardRef(kp);n.p;function Np(){return(Np=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Ip(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Ep=r.createElement("g",{id:"icon/ID/photo/new/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("path",{d:"M12,14 C9.7912,14 8,12.2088 8,10 C8,7.7912 9.7912,6 12,6 C14.2088,6 16,7.7912 16,10 C16,12.2088 14.2088,14 12,14 Z M16.7142857,3.4 L14.3571429,1 L9.64285714,1 L7.28571429,3.4 L1,3.4 L1,17 L23,17 L23,3.4 L16.7142857,3.4 Z",id:"Stroke-1",stroke:"#1B2559",strokeWidth:1.6}));function Fp(e,t){var n=e.title,a=e.titleId,i=Ip(e,["title","titleId"]);return r.createElement("svg",Np({width:"24px",height:"18px",viewBox:"0 0 24 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),void 0===n?r.createElement("title",{id:a},"icon/ID/photo/new/zodiac"):n?r.createElement("title",{id:a},n):null,Ep)}var Lp=r.forwardRef(Fp);n.p;function Dp(){return(Dp=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Pp(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Bp=r.createElement("desc",null,"Created with Sketch."),Rp=r.createElement("g",{id:"icon/button/cancel/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("g",{id:"Group-5",stroke:"#1B2559",strokeWidth:1.2},r.createElement("line",{x1:12,y1:0,x2:0,y2:12,id:"Stroke-1"}),r.createElement("line",{x1:0,y1:0,x2:12,y2:12,id:"Stroke-3"})));function Ap(e,t){var n=e.title,a=e.titleId,i=Pp(e,["title","titleId"]);return r.createElement("svg",Dp({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Bp,Rp)}var Tp=r.forwardRef(Ap);n.p;function Mp(){return(Mp=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Wp(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var zp=r.createElement("desc",null,"Created with Sketch."),$p=r.createElement("g",{id:"icon/button/download/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("g",{id:"icon/sf-small/wizzard",stroke:"#FFFFFF"},r.createElement("polyline",{id:"Path-3",points:"3.6 5.4 6 7.8 8.4 5.4"}),r.createElement("line",{x1:6,y1:.5,x2:6,y2:7.4,id:"Path-4"}),r.createElement("path",{d:"M0,10 L0,10 C0,10.9942 0.8058,11.8 1.8,11.8 L10.2,11.8 C11.1942,11.8 12,10.9942 12,10",id:"Stroke-1"})));function qp(e,t){var n=e.title,a=e.titleId,i=Wp(e,["title","titleId"]);return r.createElement("svg",Mp({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,zp,$p)}var Hp=r.forwardRef(qp);n.p;function Vp(){return(Vp=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Up(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Gp=r.createElement("desc",null,"Created with Sketch."),Xp=r.createElement("g",{id:"icon/button/download/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("g",{id:"icon/sf-small/wizzard",stroke:"#1B2559"},r.createElement("polyline",{id:"Path-3",points:"3.6 5.4 6 7.8 8.4 5.4"}),r.createElement("line",{x1:6,y1:.5,x2:6,y2:7.4,id:"Path-4"}),r.createElement("path",{d:"M0,10 L0,10 C0,10.9942 0.8058,11.8 1.8,11.8 L10.2,11.8 C11.1942,11.8 12,10.9942 12,10",id:"Stroke-1"})));function _p(e,t){var n=e.title,a=e.titleId,i=Up(e,["title","titleId"]);return r.createElement("svg",Vp({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Gp,Xp)}var Kp,Zp,Yp,Qp=r.forwardRef(_p),Jp=(n.p,n(86)),ej=n(439),tj=n(146),nj=n(81),rj=n(431),aj=n(308),ij="",oj=function(e){var t=e.children,n=Object(w.h)(),a=Object(w.i)(),i=Object(r.useContext)(k),o=(i.userData,function(e,t,n,r,a){return new tj.a({link:nj.a.from([Object(rj.a)((function(n){var a=n.graphQLErrors,i=n.networkError;a&&a.forEach((function(n){var a=n.message,i=n.locations,o=n.path,c=n.extensions;"UNAUTHENTICATED"===(null===c||void 0===c?void 0:c.code)&&(r(null),"/login"!==t.pathname&&e.push("/login")),console.log("[GraphQL error]: Message: ".concat(a,", Location: ").concat(i,", Path: ").concat(o))})),i&&console.log("[Network error]: ".concat(i))})),new nj.a((function(e,t){return t(e).map((function(t){var n=e.getContext().response.headers;if(n){var r=n.get("lamassu_role");a(r)}return t}))})),nj.a.split((function(e){return"pazuz"===e.getContext().clientName}),new aj.a({credentials:"include",uri:"".concat("","/graphql")}),new aj.a({credentials:"include",uri:"".concat(ij,"/graphql")}))]),cache:new ej.a,defaultOptions:{watchQuery:{fetchPolicy:"no-cache",errorPolicy:"ignore"},query:{fetchPolicy:"no-cache",errorPolicy:"all"},mutate:{errorPolicy:"all"}}})}(n,a,0,i.setUserData,i.setRole));return Object(Me.jsx)(Jp.a,{client:o,children:t})},cj={wrapper:{display:"flex",flexDirection:"column",marginTop:24},row:{display:"flex",flexDirection:"row",marginBottom:36},secondRow:{display:"flex",flexDirection:"row",justifyContent:"space-between",marginBottom:36},lastRow:{display:"flex",flexDirection:"row",marginBottom:32},label:{color:se,margin:[[0,0,6,0]]},txIcon:{marginRight:10},clipboardPopover:{height:164,width:215},idButton:{marginRight:4},idCardDataCard:{extend:Re.p,display:"flex",padding:[[11,8]],"& > div":{display:"flex",flexDirection:"column","& > div":{width:144,height:37,marginBottom:15,"&:last-child":{marginBottom:0}}}},bold:{fontWeight:700},direction:{width:233},availableIds:{width:232},exchangeRate:{width:250},commission:{width:217},address:{width:280},downloadRawLogs:{width:180},cancelTransaction:{width:160},status:{width:230,"& > button":{marginTop:20}},transactionId:{width:280},sessionId:{width:215},container:{display:"flex"},chip:{display:"flex",alignItems:"center",padding:"4px 8px 4px 8px",backgroundColor:q,color:Z,height:24,marginBottom:-24,marginTop:-3,marginLeft:7,borderRadius:4},chipLabel:{color:Z},otherActionsGroup:{display:"flex",flexDirection:"row"}},lj=function(e){return"cashOut"===e.txClass?function(e){return"Operator cancel"===e.hasError?"Cancelled":e.hasError?"Error":e.dispense?"Success":e.expired?"Expired":"Pending"}(e):function(e){return e.operatorCompleted?"Cancelled":e.hasError?"Error":e.sendConfirmed?"Sent":e.expired?"Expired":e.batched?"Batched":"Pending"}(e)},sj=function(e){return e.hasError?e.hasError:null},dj=Object(j.a)(cj),uj=x()(Kp||(Kp=Object(l.a)(["\n query txSummaryAndLogs(\n $txId: ID!\n $deviceId: ID!\n $limit: Int\n $from: Date\n $until: Date\n $txClass: String\n $timezone: String\n ) {\n serverLogsCsv(\n limit: $limit\n from: $from\n until: $until\n timezone: $timezone\n )\n machineLogsCsv(\n deviceId: $deviceId\n limit: $limit\n from: $from\n until: $until\n timezone: $timezone\n )\n transactionCsv(id: $txId, txClass: $txClass, timezone: $timezone)\n txAssociatedDataCsv(id: $txId, txClass: $txClass, timezone: $timezone)\n }\n"]))),mj=x()(Zp||(Zp=Object(l.a)(["\n mutation cancelCashOutTransaction($id: ID!) {\n cancelCashOutTransaction(id: $id) {\n id\n }\n }\n"]))),hj=x()(Yp||(Yp=Object(l.a)(["\n mutation cancelCashInTransaction($id: ID!) {\n cancelCashInTransaction(id: $id) {\n id\n }\n }\n"]))),bj=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Tb.utils.formatCryptoAddress(e,t).replace(/(.{5})/g,"$1 ")},pj=function(e){var t=e.children,n=dj();return Object(Me.jsx)(et,{className:n.label,children:t})},jj=function(e){var t=e.it,n=e.timezone,a=dj(),i=Object(r.useState)({command:null}),o=Object(c.a)(i,2),l=o[0],s=o[1],d=Object(r.useState)(""),m=Object(c.a)(d,2),h=m[0],b=m[1],p="cashIn"===t.txClass,j=new Ub.a,f=Object(u.a)(uj,{onCompleted:function(e){return L(e)}}),g=Object(c.a)(f,1)[0],O=Object(u.b)(p?hj:mj,{onError:function(e){var t=e.message;return b(null!==t&&void 0!==t?t:"An error occurred.")},refetchQueries:function(){return["transactions"]}}),x=Object(c.a)(O,1)[0],v=Number.parseFloat(t.fiat),y=Tb.utils.toUnit(new vl.a(t.cryptoAtoms),t.cryptoCode),w=Number.parseFloat(t.commissionPercentage,2),C=Number(v*w).toFixed(2),k=t.discount?"-".concat(t.discount,"%"):null,S=vl()(v/y).toFormat(2),N="1 ".concat(t.cryptoCode," = ").concat(S," ").concat(t.fiatCode),I=t.customerIdCardData&&{name:"".concat(Hu(t.customerIdCardData.firstName)," ").concat(Hu(t.customerIdCardData.lastName)),age:Object($b.a)(t.customerIdCardData.dateOfBirth,new Date),country:t.customerIdCardData.country,idCardNumber:t.customerIdCardData.documentNumber,idCardExpirationDate:Object(js.a)("dd-MM-yyyy",t.customerIdCardData.expirationDate)},E=Object(Xl.a)({minutes:3},t.created),F=Object(Rs.a)({minutes:3},t.created),L=function(){var e=Object(pc.a)(bc.a.mark((function e(n){var r,a,i;return bc.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r="tx_".concat(t.id,"_summary.zip"),a=yl.a(n),B.a((function(e){return j.file(e+".csv",n[e])}),a),e.next=5,j.generateAsync({type:"blob"});case 5:i=e.sent,Hb.a.saveAs(i,r);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),D=Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(pj,{children:"Transaction status"}),Object(Me.jsx)("span",{className:a.bold,children:lj(t)})]});return Object(Me.jsxs)("div",{className:a.wrapper,children:[Object(Me.jsxs)("div",{className:a.row,children:[Object(Me.jsxs)("div",{className:a.direction,children:[Object(Me.jsx)(pj,{children:"Direction"}),Object(Me.jsxs)("div",{children:[Object(Me.jsx)("span",{className:a.txIcon,children:p?Object(Me.jsx)(ul,{}):Object(Me.jsx)(gl,{})}),Object(Me.jsx)("span",{children:p?"Cash-in":"Cash-out"})]})]}),Object(Me.jsxs)("div",{className:a.availableIds,children:[Object(Me.jsx)(pj,{children:"Available IDs"}),Object(Me.jsxs)(Po.a,{display:"flex",flexDirection:"row",children:[t.customerPhone&&Object(Me.jsx)(Qn,{className:a.idButton,name:"phone",Icon:vp,InverseIcon:jp,children:t.customerPhone}),t.customerIdCardPhotoPath&&!t.customerIdCardData&&Object(Me.jsx)(Qn,{popoverClassname:a.clipboardPopover,className:a.idButton,name:"card",Icon:up,InverseIcon:op,children:Object(Me.jsx)("img",{className:a.idCardPhoto,src:"".concat(ij,"/id-card-photo/").concat(t.customerIdCardPhotoPath),alt:""})}),t.customerIdCardData&&Object(Me.jsx)(Qn,{className:a.idButton,name:"card",Icon:up,InverseIcon:op,children:Object(Me.jsxs)("div",{className:a.idCardDataCard,children:[Object(Me.jsxs)("div",{children:[Object(Me.jsxs)("div",{children:[Object(Me.jsx)(pj,{children:"Name"}),Object(Me.jsx)("div",{children:I.name})]}),Object(Me.jsxs)("div",{children:[Object(Me.jsx)(pj,{children:"Age"}),Object(Me.jsx)("div",{children:I.age})]}),Object(Me.jsxs)("div",{children:[Object(Me.jsx)(pj,{children:"Country"}),Object(Me.jsx)("div",{children:I.country})]})]}),Object(Me.jsxs)("div",{children:[Object(Me.jsxs)("div",{children:[Object(Me.jsx)(pj,{children:"ID number"}),Object(Me.jsx)("div",{children:I.idCardNumber})]}),Object(Me.jsxs)("div",{children:[Object(Me.jsx)(pj,{children:"Expiration date"}),Object(Me.jsx)("div",{children:I.idCardExpirationDate})]})]})]})}),t.customerFrontCameraPath&&Object(Me.jsx)(Qn,{name:"cam",Icon:Lp,InverseIcon:Sp,children:Object(Me.jsx)("img",{src:"".concat(ij,"/front-camera-photo/").concat(t.customerFrontCameraPath),alt:""})})]})]}),Object(Me.jsxs)("div",{className:a.exchangeRate,children:[Object(Me.jsx)(pj,{children:"Exchange rate"}),Object(Me.jsx)("div",{children:y>0?N:"-"})]}),Object(Me.jsxs)("div",{className:a.commission,children:[Object(Me.jsx)(pj,{children:"Commission"}),Object(Me.jsxs)("div",{className:a.container,children:["".concat(C," ").concat(t.fiatCode," (").concat(100*w," %)"),k&&Object(Me.jsx)("div",{className:a.chip,children:Object(Me.jsx)(et,{className:a.chipLabel,children:k})})]})]}),Object(Me.jsxs)("div",{children:[Object(Me.jsx)(pj,{children:"Fixed fee"}),Object(Me.jsx)("div",{children:p?"".concat(Number.parseFloat(t.cashInFee)," ").concat(t.fiatCode):"N/A"})]})]}),Object(Me.jsxs)("div",{className:a.secondRow,children:[Object(Me.jsxs)("div",{className:a.address,children:[Object(Me.jsx)(pj,{children:"Address"}),Object(Me.jsx)("div",{children:Object(Me.jsx)(Pb,{children:bj(t.cryptoCode,t.toAddress)})})]}),Object(Me.jsxs)("div",{className:a.transactionId,children:[Object(Me.jsx)(pj,{children:"Transaction ID"}),Object(Me.jsx)("div",{children:"cashOut"===t.txClass?"N/A":Object(Me.jsx)(Pb,{children:t.txHash})})]}),Object(Me.jsxs)("div",{className:a.sessionId,children:[Object(Me.jsx)(pj,{children:"Session ID"}),Object(Me.jsx)(Pb,{children:t.id})]})]}),Object(Me.jsxs)("div",{className:a.lastRow,children:[Object(Me.jsxs)("div",{className:a.status,children:[sj(t)?Object(Me.jsx)(tp,{parentElements:D,width:200,children:Object(Me.jsx)(Xe,{children:sj(t)})}):D,"cashOut"===t.txClass&&"Pending"===lj(t)&&Object(Me.jsx)(ze,{color:"primary",Icon:Tp,InverseIcon:pr,className:a.cancelTransaction,onClick:function(){return s({command:"cancelTx"})},children:"Cancel transaction"})]}),Object(Me.jsxs)("div",{children:[Object(Me.jsx)(pj,{children:"Other actions"}),Object(Me.jsx)("div",{className:a.otherActionsGroup,children:Object(Me.jsx)(ze,{color:"primary",Icon:Qp,InverseIcon:Hp,className:a.downloadRawLogs,onClick:function(){return function(e,t){var n=e.id,r=e.deviceId,a=e.txClass;g({variables:{txId:n,from:E,until:F,deviceId:r,txClass:a,timezone:t}})}(t,n)},children:"Download raw logs"})})]})]}),Object(Me.jsx)(jh,{open:"cancelTx"===l.command,title:"Cancel this transaction?",errorMessage:h,toBeConfirmed:t.machineName,message:p?"The user will not be able to redeem the inserted bills, even if they subsequently confirm the transaction. If they've already deposited bills, you'll need to reconcile this transaction with them manually.":"The user will not be able to redeem the cash, even if they subsequently send the required coins. If they've already sent you coins, you'll need to reconcile this transaction with them manually.",onConfirmed:function(){b(null),s({command:null}),x({variables:{id:t.id}})},onDismissed:function(){s({command:null}),b(null)}})]})},fj=Object(r.memo)(jj,(function(e,t){return e.it.id===t.it.id&&e.it.hasError===t.it.hasError&&lj(e.it)===lj(t.it)})),gj=n(123),Oj={expandButton:{outline:"none",border:"none",backgroundColor:"transparent",cursor:"pointer",padding:4},rowWrapper:{padding:1},row:{border:[[2,"solid","transparent"]],borderRadius:0},expanded:{border:[[2,"solid",G]],boxShadow:"0 0 8px 0 rgba(0,0,0,0.08)"},before:{paddingTop:12},after:{paddingBottom:12},pointer:{cursor:"pointer"},body:{flex:[[1,1,"auto"]]},table:function(e){return{marginBottom:30,minHeight:200,width:e.width,flex:1,display:"flex",flexDirection:"column"}},emptyTable:{width:"100%",display:"flex",flexDirection:"column",alignItems:"center",marginTop:52}};function xj(){return(xj=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function vj(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var yj=r.createElement("desc",null,"Created with Sketch."),wj=r.createElement("g",{id:"Styleguide",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"icon/action/expand/closed",transform:"translate(1.000000, 1.000000)",stroke:"#1B2559",strokeWidth:1.5},r.createElement("circle",{id:"Oval-4",cx:14,cy:2,r:2}),r.createElement("circle",{id:"Oval-4-Copy",cx:8,cy:2,r:2}),r.createElement("circle",{id:"Oval-4-Copy-2",cx:2,cy:2,r:2})));function Cj(e,t){var n=e.title,a=e.titleId,i=vj(e,["title","titleId"]);return r.createElement("svg",xj({width:"18px",height:"6px",viewBox:"0 0 18 6",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,yj,wj)}var kj=r.forwardRef(Cj);n.p;function Sj(){return(Sj=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Nj(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Ij=r.createElement("desc",null,"Created with Sketch."),Ej=r.createElement("g",{id:"Styleguide",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"icon/action/expand/open",transform:"translate(1.000000, 1.000000)",fill:"#1B2559",stroke:"#1B2559",strokeWidth:1.5},r.createElement("circle",{id:"Oval-4",cx:14,cy:2,r:2}),r.createElement("circle",{id:"Oval-4-Copy",cx:8,cy:2,r:2}),r.createElement("circle",{id:"Oval-4-Copy-2",cx:2,cy:2,r:2})));function Fj(e,t){var n=e.title,a=e.titleId,i=Nj(e,["title","titleId"]);return r.createElement("svg",Sj({width:"18px",height:"6px",viewBox:"0 0 18 6",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Ij,Ej)}var Lj,Dj,Pj,Bj,Rj,Aj=r.forwardRef(Fj),Tj=(n.p,Object(j.a)(Oj)),Mj=function(e){var t,n=e.id,r=e.elements,a=e.data,i=e.width,o=e.Details,c=e.expanded,l=e.expandRow,d=e.expWidth,u=e.expandable,m=e.onClick,h=Tj(),b=m||u,p=(t={},Object(z.a)(t,h.pointer,b),Object(z.a)(t,h.row,!0),Object(z.a)(t,h.expanded,c),t);return Object(Me.jsxs)("div",{className:h.rowWrapper,children:[Object(Me.jsx)("div",{className:E()(Object(z.a)({},h.before,c&&0!==n)),children:Object(Me.jsxs)(Bu,{className:E()(p),onClick:function(){u&&l(n),m&&m(a)},error:a.error,errorMessage:a.errorMessage,children:[r.map((function(e,t){var n=e.view,r=void 0===n?function(e){return null===e||void 0===e?void 0:e.toString()}:n,i=Object($.a)(e,["view"]);return Object(Me.jsx)(Lu,Object(s.a)(Object(s.a)({},i),{},{children:r(a)}),t)})),u&&Object(Me.jsx)(Lu,{width:d,textAlign:"center",children:Object(Me.jsxs)("button",{onClick:function(){return l(n)},className:h.expandButton,children:[c&&Object(Me.jsx)(Aj,{}),!c&&Object(Me.jsx)(kj,{})]})})]})}),u&&c&&Object(Me.jsx)("div",{className:h.after,children:Object(Me.jsx)(Bu,{className:E()(Object(z.a)({},h.expanded,c)),children:Object(Me.jsx)(Lu,{width:i,children:Object(Me.jsx)(o,{it:a})})})})]})},Wj=function(e){var t=e.elements,n=void 0===t?[]:t,a=e.data,i=void 0===a?[]:a,o=e.Details,l=(e.className,e.expandable),d=e.initialExpanded,u=e.onClick,m=e.loading,h=e.emptyText,b=e.extraHeight,p=Object($.a)(e,["elements","data","Details","className","expandable","initialExpanded","onClick","loading","emptyText","extraHeight"]),j=Object(r.useState)(d),f=Object(c.a)(j,2),g=f[0],O=f[1];Object(r.useEffect)((function(){return O(d)}),[d]);var x=L.a(Kl.a,B.a(R.a("width")))(n),v=850-x,y=x+(l?v:0),w=Tj({width:y}),C=function(e){O(e===g?null:e)},k=new gj.c({defaultHeight:62,fixedWidth:!0});function S(e){var t=e.index,r=e.key,a=e.parent,c=e.style;return Object(Me.jsx)(gj.b,{cache:k,columnIndex:0,parent:a,rowIndex:t,children:Object(Me.jsx)("div",{style:c,children:Object(Me.jsx)(Mj,{width:y,id:t,expWidth:v,elements:n,data:i[t],Details:o,expanded:t===g,expandRow:C,expandable:l,onClick:u})})},r)}return Object(Me.jsx)(Po.a,{display:"flex",flex:"1",flexDirection:"column",children:Object(Me.jsxs)(Nu,{className:w.table,children:[Object(Me.jsxs)(Iu,{children:[n.map((function(e,t){var n=e.width,r=e.className,a=e.textAlign,i=e.header;return Object(Me.jsx)(Du,{width:n,className:r,textAlign:a,children:i},t)})),l&&Object(Me.jsx)(Du,{width:v})]}),Object(Me.jsxs)(Fu,{className:w.body,children:[m&&Object(Me.jsx)(Ue,{children:"Loading..."}),!m&&Wr.a(i)&&Object(Me.jsx)(Ue,{children:h}),Object(Me.jsx)(gj.a,{disableWidth:!0,disableHeight:!0,children:function(){return Object(Me.jsx)(gj.d,Object(s.a)(Object(s.a)({style:{overflowX:"inherit",outline:"none"}},p),{},{height:62*i.length+b,width:y,rowCount:i.length,rowHeight:k.rowHeight,rowRenderer:S,overscanRowCount:50,deferredMeasurementCache:k}))}})]})]})})},zj=Object(j.a)(Lb),$j=x()(Lj||(Lj=Object(l.a)(["\n query transactions($limit: Int, $from: Date, $until: Date, $deviceId: ID) {\n transactions(\n limit: $limit\n from: $from\n until: $until\n deviceId: $deviceId\n ) {\n id\n txClass\n txHash\n toAddress\n commissionPercentage\n expired\n machineName\n operatorCompleted\n sendConfirmed\n dispense\n hasError: error\n deviceId\n fiat\n cashInFee\n fiatCode\n cryptoAtoms\n cryptoCode\n toAddress\n created\n customerName\n customerIdCardData\n customerIdCardPhotoPath\n customerFrontCameraPath\n customerPhone\n discount\n customerId\n isAnonymous\n }\n }\n"]))),qj=x()(Dj||(Dj=Object(l.a)(["\n query getData {\n config\n }\n"]))),Hj=function(e){var t=e.id,n=zj(),a=Object(r.useState)(0),i=Object(c.a)(a,2),o=i[0],l=i[1],s=Object(r.useState)(""),d=Object(c.a)(s,2),m=d[0],h=d[1],b=Object(u.a)($j,{variables:{limit:5,deviceId:t}}),p=Object(c.a)(b,2),j=p[0],f=p[1],g=f.data,O=f.loading,x=Object(u.c)(qj),v=x.data,y=x.loading,w=T.a(["config","locale_timezone"],v),C=O&&y;!C&&g&&(g.transactions=g.transactions.splice(0,5)),Object(r.useEffect)((function(){null!==t&&j()}),[j,t]);var k=[{header:"",width:0,size:"sm",view:function(e){return"cashOut"===e.txClass?Object(Me.jsx)(gl,{}):Object(Me.jsx)(ul,{})}},{header:"Customer",width:122,size:"sm",view:function(e){return e.customerName?e.customerName:e.customerIdCardData?function(e){var t=e.firstName,n=e.lastName;return"".concat(Mb.a(Wb.a,zb.a)(t),". ").concat(n)}(e.customerIdCardData):e.customerPhone}},{header:"Cash",width:144,textAlign:"right",size:"sm",view:function(e){return"".concat(Number.parseFloat(e.fiat)," ").concat(e.fiatCode)}},{header:"Crypto",width:164,textAlign:"right",size:"sm",view:function(e){return"".concat(Tb.utils.toUnit(new vl.a(e.cryptoAtoms),e.cryptoCode).toFormat(5)," ").concat(e.cryptoCode)}},{header:"Address",view:function(e){return Tb.utils.formatCryptoAddress(e.cryptoCode,e.toAddress)},className:n.overflowTd,size:"sm",textAlign:"left",width:140},{header:"Date (UTC)",view:function(e){return Os(e.created,w,"yyyy-MM-dd")},textAlign:"left",size:"sm",width:140},{header:"Status",view:function(e){return lj(e)},size:"sm",width:20}];return Object(Me.jsx)(Wj,{extraHeight:o,onClick:function(e){m===e.id?(h(""),l(0)):(h(e.id),l(310))},loading:C||null===t,emptyText:"No transactions so far",elements:k,data:T.a(["transactions"])(g),Details:fj,expandable:!0})},Vj=Object(j.a)(sh),Uj=x()(Pj||(Pj=Object(l.a)(["\n query getMachine($deviceId: ID!) {\n machine(deviceId: $deviceId) {\n name\n deviceId\n paired\n lastPing\n pairedAt\n version\n model\n cashbox\n cassette1\n cassette2\n cassette3\n cassette4\n numberOfCassettes\n statuses {\n label\n type\n }\n downloadSpeed\n responseTime\n packetLoss\n latestEvent {\n note\n }\n }\n config\n }\n"]))),Gj=function(e){return e.slice(e.lastIndexOf("/")+1)},Xj=function(){var e,t,n,r,a,i=Object(w.i)(),o=Object(u.c)(Uj,{variables:{deviceId:Gj(i.pathname)}}),c=o.data,l=o.refetch,s=Vj(),d=null!==(e=T.a(["config","locale_timezone"],c))&&void 0!==e?e:{},m=null!==(t=T.a(["machine"])(c))&&void 0!==t?t:{},b=null!==(n=T.a(["config"])(c))&&void 0!==n?n:{},p=null!==(r=T.a(["name"])(m))&&void 0!==r?r:null,j=null!==(a=T.a(["deviceId"])(m))&&void 0!==a?a:null;return Object(Me.jsxs)(h.a,{container:!0,className:s.grid,children:[Object(Me.jsx)(h.a,{item:!0,xs:3,children:Object(Me.jsx)(h.a,{item:!0,xs:12,children:Object(Me.jsxs)("div",{className:s.breadcrumbsContainer,children:[Object(Me.jsxs)(ou.a,{separator:Object(Me.jsx)(lu.a,{fontSize:"small"}),children:[Object(Me.jsx)(C.b,{to:"/dashboard",className:s.breadcrumbLink,children:Object(Me.jsx)(nt,{noMargin:!0,className:s.subtitle,children:"Dashboard"})}),Object(Me.jsx)(Je,{noMargin:!0,className:s.subtitle,children:p})]}),Object(Me.jsx)(Ab,{data:m,onActionSuccess:l})]})})}),Object(Me.jsx)(h.a,{item:!0,xs:9,children:Object(Me.jsxs)("div",{className:s.content,children:[Object(Me.jsxs)("div",{className:E()(s.detailItem,s.detailsMargin),children:[Object(Me.jsx)(Qe,{className:s.subtitle,children:"Details"}),Object(Me.jsx)(uh,{data:m,timezone:d})]}),Object(Me.jsxs)("div",{className:s.detailItem,children:[Object(Me.jsx)(Qe,{className:s.subtitle,children:"Cash cassettes"}),Object(Me.jsx)(eh,{refetchData:l,machine:m,config:null!==b&&void 0!==b&&b})]}),Object(Me.jsxs)("div",{className:s.transactionsItem,children:[Object(Me.jsx)(Qe,{className:s.subtitle,children:"Latest transactions"}),Object(Me.jsx)(Hj,{id:j})]}),Object(Me.jsxs)("div",{className:s.detailItem,children:[Object(Me.jsx)(Qe,{className:s.subtitle,children:"Commissions"}),Object(Me.jsx)(lh,{name:"commissions",id:j})]})]})})]})},_j=n(75),Kj=n.n(_j),Zj=n(853),Yj=n(265),Qj=n(855),Jj=n(856),ef={AUD:{5:130,10:137,20:144,50:151,100:158},BBD:{2:150,5:150,10:150,20:150,50:150,100:150},CAD:{5:152,10:152,20:152,50:152,100:152},CHF:{10:126,20:137,50:148,100:159,200:170,1e3:181},DKK:{50:125,100:135,200:145,500:155,1e3:165},EUR:{5:120,10:127,20:133,50:140,100:147,200:153,500:160},GBP:{5:135,10:142,20:149,50:156},HKD:{10:134,20:143,50:148,100:153,500:158,1e3:163},HUF:{200:154,500:154,1e3:154,2e3:154,5e3:154,1e4:154,2e4:154},ILS:{20:129,50:136,100:143,200:150},JMD:{50:145,100:145,500:145,1e3:145,5e3:145},JPY:{1e3:150,2e3:154,5e3:156,1e4:160},KZT:{200:126,500:130,1e3:134,2e3:139,5e3:144,1e4:155,2e4:155},MXN:{20:120,50:127,100:134,200:141,500:148,1e3:155},MYR:{1:120,5:135,10:140,20:145,50:145,100:150},NZD:{5:135,10:140,20:145,50:150,100:155},PHP:{20:160,50:160,100:160,200:160,500:160,1e3:160},PLN:{10:120,20:126,50:132,100:138,200:144,500:150},SGD:{2:126,5:133,10:141,50:156,100:162,1e3:170},TWD:{100:145,200:150,500:155,1e3:160,2e3:165},UAH:{1:118,2:118,5:118,10:124,20:130,50:136,100:142,200:148,500:154},USD:{1:156,5:156,10:156,20:156,50:156,100:156},VND:{1e4:132,2e4:136,5e4:140,1e5:144,2e5:148,5e5:152},ZAR:{10:128,20:134,50:140,100:146,200:152}},tf=wl.a((function(e,t){var n=R.a("fiatCurrency")(e);return L.a(B.a((function(e){return{code:parseInt(e),display:e}})),yl.a,T.a([n]))(t)})),nf=9999999,rf={name:"All Machines",deviceId:"ALL_MACHINES"},af={display:"All Coins",code:"ALL_COINS"},of={marginLeft:6},cf=Object(Me.jsxs)("div",{children:[Object(Me.jsx)(ul,{}),Object(Me.jsx)("span",{style:of,children:"Cash-in"})]}),lf=Object(Me.jsxs)("div",{children:[Object(Me.jsx)(gl,{}),Object(Me.jsx)("span",{style:of,children:"Cash-out"})]}),sf=function(e,t,n){return function(r){if(!e)return"";var a=Tr.a(W.a(null!==n&&void 0!==n?n:"code",r))(e);return a?R.a(t,a):"Unpaired machine"}},df=function(e){return function(t){return t?L.a(Zj.a(", "),B.a(sf(e,"display")))(t):t}},uf=function(e,t,n){var r=F.a(af.code)(t),a=F.a(af.code)(e);return r&&a&&gn.a(t)>1?n(ju.a(Ms.a(af.code))(t)):r&&!a?n([af.code]):void n(t)},mf=function(e){return[{header:cf,name:"cashIn",display:"Cash-in",width:169,size:"lg",editingAlign:"right",input:qa,suffix:"%",bold:Vr,inputProps:{decimalPlaces:3}},{header:lf,name:"cashOut",display:"Cash-out",width:169,size:"lg",editingAlign:"right",input:qa,suffix:"%",bold:Vr,inputProps:{decimalPlaces:3}},{name:"fixedFee",display:"Fixed fee",width:169,size:"lg",doubleHeader:"Cash-in only",textAlign:"center",editingAlign:"right",input:qa,suffix:e,bold:Vr,inputProps:{decimalPlaces:2}},{name:"minimumTx",display:"Minimun Tx",width:169,size:"lg",doubleHeader:"Cash-in only",textAlign:"center",editingAlign:"right",input:qa,suffix:e,bold:Vr,inputProps:{decimalPlaces:2}}]},hf=function(e,t,n){return function(e,t,n){var r=[rf].concat(e(["machines"])),a=e(["cryptoCurrencies"]),i=[af].concat(B.a((function(e){return{display:e.code,code:e.code}}))(null!==a&&void 0!==a?a:[]));return[{name:"machine",width:196,size:"sm",view:sf(r,"name","deviceId"),input:ka,inputProps:{options:r,valueProp:"deviceId",labelProp:"name"}},{name:"cryptoCurrencies",width:280,size:"sm",view:df(i),input:ka,inputProps:{options:i,valueProp:"code",labelProp:"display",multiple:!0,onChange:uf,shouldStayOpen:!0}},{header:cf,name:"cashIn",display:"Cash-in",width:130,input:qa,textAlign:"right",suffix:"%",bold:Vr,inputProps:{decimalPlaces:3}},{header:lf,name:"cashOut",display:"Cash-out",width:130,input:qa,textAlign:"right",suffix:"%",bold:Vr,inputProps:{decimalPlaces:3}},{name:"fixedFee",display:"Fixed fee",width:144,input:qa,doubleHeader:"Cash-in only",textAlign:"right",suffix:t,bold:Vr,inputProps:{decimalPlaces:2}},{name:"minimumTx",display:"Minimun Tx",width:169,size:"lg",doubleHeader:"Cash-in only",textAlign:"center",editingAlign:"right",input:qa,suffix:t,bold:Vr,inputProps:{decimalPlaces:2}}]}(T.a(uu.a,e),t)},bf=100,pf=function(e){var t=tf(e,ef).map((function(e){return parseInt(e.code)})),n=Wr.a(t)?nf:Math.max.apply(Math,Object(d.a)(t));return xn.e().shape({cashIn:xn.d().label("Cash-in").min(0).max(bf).required(),cashOut:xn.d().label("Cash-out").min(0).max(bf).required(),fixedFee:xn.d().label("Fixed Fee").min(0).max(n).required(),minimumTx:xn.d().label("Minimum Tx").min(0).max(n).required()})},jf=function(e,t,n){var r=T.a(uu.a,t),a=[rf].concat(r(["machines"])),i=r(["cryptoCurrencies"]),o=[af].concat(B.a((function(e){return{display:e.code,code:e.code}}))(null!==i&&void 0!==i?i:[])),c=tf(n,ef).map((function(e){return parseInt(e.code)})),l=Wr.a(c)?nf:Math.max.apply(Math,Object(d.a)(c));return xn.e().shape({machine:xn.g().nullable().label("Machine").required(),cryptoCurrencies:xn.a().test({test:function(){var t=this.parent,n=t.id,r=t.machine,i=t.cryptoCurrencies,c=function(e,t,n){var r=R.a("cryptoCurrencies"),a=R.a("machine"),i=M.a(W.a("machine",t))(n),o=Tr.a(W.a("id",e))(n),c=r(o),l=a(o),s=L.a(Yj.a,Ho.a,B.a(r))(i);return t!==l?null!==s&&void 0!==s?s:[]:Qj.a(s,c)}(n,r,e),l=r===rf.deviceId,s=F.a(af.code,i);if(l&&s)return this.createError({message:"All machines and all coins should be configured in the default setup table"});var d=Jj.a(c,i);if(!Wr.a(d)){var u=df(o)(d),m=sf(a,"name","deviceId")(r),h="".concat(u," already overriden for machine: ").concat(m);return this.createError({message:h})}return!0}}).label("Crypto Currencies").required().min(1),cashIn:xn.d().label("Cash-in").min(0).max(bf).required(),cashOut:xn.d().label("Cash-out").min(0).max(bf).required(),fixedFee:xn.d().label("Fixed Fee").min(0).max(l).required(),minimumTx:xn.d().label("Minimum Tx").min(0).max(l).required()})},ff={cashIn:"",cashOut:"",fixedFee:"",minimumTx:""},gf={machine:null,cryptoCurrencies:[],cashIn:"",cashOut:"",fixedFee:"",minimumTx:""},Of=function(e){var t=e.machine,n=e.cryptoCurrencies,r=t===rf.deviceId,a=_o.a(af.code,n);return r&&a?0:r?1:a?2:3},xf=function(e,t,n,r){return{minimumTx:r.minimumTx,fixedFee:r.fixedFee,cashOut:r.cashOut,cashIn:r.cashIn,machine:t,cryptoCurrencies:[e],default:n,id:Object(gu.a)()}},vf=function(e){var t=tf(e,ef).map((function(e){return parseInt(e.code)})),n=Wr.a(t)?nf:Math.max.apply(Math,Object(d.a)(t));return xn.e().shape({machine:xn.g().label("Machine").required(),cryptoCurrencies:xn.a().label("Crypto Currency").required().min(1),cashIn:xn.d().label("Cash-in").min(0).max(bf).required(),cashOut:xn.d().label("Cash-out").min(0).max(bf).required(),fixedFee:xn.d().label("Fixed Fee").min(0).max(n).required(),minimumTx:xn.d().label("Minimum Tx").min(0).max(n).required()})},yf=function(e,t){return{color:e.default?J:te}},wf=function(e,t,n){var r=T.a(uu.a,e);return Cf(r,t,ff)},Cf=function(e,t,n){var r=[rf].concat(e(["machines"]));return[{name:"machine",width:196,size:"sm",view:sf(r,"name","deviceId"),editable:!1},{name:"cryptoCurrencies",display:"Crypto Currency",width:265,view:R.a(0),size:"sm",editable:!1},{header:cf,name:"cashIn",display:"Cash-in",width:130,input:qa,textAlign:"right",suffix:"%",textStyle:function(e){return yf(e)},inputProps:{decimalPlaces:3}},{header:lf,name:"cashOut",display:"Cash-out",width:130,input:qa,textAlign:"right",greenText:!0,suffix:"%",textStyle:function(e){return yf(e)},inputProps:{decimalPlaces:3}},{name:"fixedFee",display:"Fixed fee",width:144,input:qa,doubleHeader:"Cash-in only",textAlign:"right",suffix:t,textStyle:function(e){return yf(e)},inputProps:{decimalPlaces:2}},{name:"minimumTx",display:"Minimun Tx",width:144,input:qa,doubleHeader:"Cash-in only",textAlign:"right",suffix:t,textStyle:function(e){return yf(e)},inputProps:{decimalPlaces:2}}]},kf=n(859),Sf=n(899),Nf=n(858),If=function(e){var t=Sl.a(e);return Zl.a((function(e,t){var n=Object(Nf.a)(t[0])<0,r=Object(Sf.a)({start:0,end:Math.abs(Object(Nf.a)(t[0]))}),a=r.hours.toLocaleString("en-US",{minimumIntegerDigits:2,useGrouping:!1}),i=r.minutes.toLocaleString("en-US",{minimumIntegerDigits:2,useGrouping:!1}),o="(GMT".concat(n?"-":"+").concat(a,":").concat(i,")");return e.push({label:"".concat(o," - ").concat(t[1]),code:t[0]}),e}),[],t)}({"Pacific/Midway":"Midway Island, Samoa","Pacific/Honolulu":"Hawaii","America/Juneau":"Alaska","America/Boise":"Mountain Time","America/Dawson":"Dawson, Yukon","America/Chihuahua":"Chihuahua, La Paz, Mazatlan","America/Phoenix":"Arizona","America/Chicago":"Central Time","America/Regina":"Saskatchewan","America/Mexico_City":"Guadalajara, Mexico City, Monterrey","America/Belize":"Central America","America/Detroit":"Eastern Time","America/Bogota":"Bogota, Lima, Quito","America/Caracas":"Caracas, La Paz","America/Santiago":"Santiago","America/St_Johns":"Newfoundland and Labrador","America/Sao_Paulo":"Brasilia","America/Tijuana":"Tijuana","America/Montevideo":"Montevideo","America/Argentina/Buenos_Aires":"Buenos Aires, Georgetown","America/Godthab":"Greenland","America/Los_Angeles":"Pacific Time","Atlantic/Azores":"Azores","Atlantic/Cape_Verde":"Cape Verde Islands",GMT:"UTC","Europe/London":"Edinburgh, London","Europe/Dublin":"Dublin","Europe/Lisbon":"Lisbon","Africa/Casablanca":"Casablanca, Monrovia","Atlantic/Canary":"Canary Islands","Europe/Belgrade":"Belgrade, Bratislava, Budapest, Ljubljana, Prague","Europe/Sarajevo":"Sarajevo, Skopje, Warsaw, Zagreb","Europe/Brussels":"Brussels, Copenhagen, Madrid, Paris","Europe/Amsterdam":"Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna","Africa/Algiers":"West Central Africa","Europe/Bucharest":"Bucharest","Africa/Cairo":"Cairo","Europe/Helsinki":"Helsinki, Kiev, Riga, Sofia, Tallinn, Vilnius","Europe/Athens":"Athens, Istanbul, Minsk","Asia/Jerusalem":"Jerusalem","Africa/Harare":"Harare, Pretoria","Europe/Moscow":"Moscow, St. Petersburg, Volgograd","Asia/Kuwait":"Kuwait, Riyadh","Africa/Nairobi":"Nairobi","Asia/Baghdad":"Baghdad","Asia/Tehran":"Tehran","Asia/Dubai":"Abu Dhabi, Muscat","Asia/Baku":"Baku, Tbilisi, Yerevan","Asia/Kabul":"Kabul","Asia/Yekaterinburg":"Ekaterinburg","Asia/Karachi":"Islamabad, Karachi, Tashkent","Asia/Kolkata":"Chennai, Kolkata, Mumbai, New Delhi","Asia/Kathmandu":"Kathmandu","Asia/Dhaka":"Astana, Dhaka","Asia/Colombo":"Sri Jayawardenepura","Asia/Almaty":"Almaty, Novosibirsk","Asia/Rangoon":"Yangon Rangoon","Asia/Bangkok":"Bangkok, Hanoi, Jakarta","Asia/Krasnoyarsk":"Krasnoyarsk","Asia/Shanghai":"Beijing, Chongqing, Hong Kong SAR, Urumqi","Asia/Kuala_Lumpur":"Kuala Lumpur, Singapore","Asia/Taipei":"Taipei","Australia/Perth":"Perth","Asia/Irkutsk":"Irkutsk, Ulaanbaatar","Asia/Seoul":"Seoul","Asia/Tokyo":"Osaka, Sapporo, Tokyo","Asia/Yakutsk":"Yakutsk","Australia/Darwin":"Darwin","Australia/Adelaide":"Adelaide","Australia/Sydney":"Canberra, Melbourne, Sydney","Australia/Brisbane":"Brisbane","Australia/Hobart":"Hobart","Asia/Vladivostok":"Vladivostok","Pacific/Guam":"Guam, Port Moresby","Asia/Magadan":"Magadan, Solomon Islands, New Caledonia","Asia/Kamchatka":"Kamchatka, Marshall Islands","Pacific/Fiji":"Fiji Islands","Pacific/Auckland":"Auckland, Wellington","Pacific/Tongatapu":"Nuku'alofa"}),Ef=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return M.a((function(e){return F.a(e.name,t)}),Ff(e,n,r))},Ff=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=function(e,t,n){return function(r){return e?L.a(R.a(t),Tr.a(W.a(null!==n&&void 0!==n?n:"code",r)))(e):""}},a=function(e){return function(t){return t?L.a(Zj.a(", "),B.a(r(e,"code")))(t):t}},i=B.a((function(e){return e.machine}),n),o=function(e){return kf.a((function(e,t){return e.deviceId===t}),e,i)},c=e(["machines"]),l=e(["countries"]),s=e(["currencies"]),d=e(["languages"]),u=e(["cryptoCurrencies"]),m=If,h=function(e){var t=Tr.a(W.a("deviceId",e.machine))(c);return t?[t]:[]};return[{name:"machine",width:200,size:"sm",view:r(c,"name","deviceId"),input:ka,inputProps:{options:function(e){return Vo.a(h(e))(o(c))},valueProp:"deviceId",labelProp:"name"}},{name:"country",width:200,size:"sm",view:r(l,"display"),input:ka,inputProps:{options:l,valueProp:"code",labelProp:"display"}},{name:"fiatCurrency",width:150,size:"sm",view:r(s,"code"),input:ka,inputProps:{options:s,valueProp:"code",labelProp:"code"}},{name:"languages",width:200,size:"sm",view:a(d),input:ka,inputProps:{options:d,valueProp:"code",labelProp:"display",multiple:!0}},{name:"cryptoCurrencies",width:170,size:"sm",view:a(u),input:ka,inputProps:{options:u,valueProp:"code",labelProp:"code",multiple:!0,optionsLimit:null,onChange:t}},{name:"timezone",width:320,size:"sm",view:r(m,"label"),input:ka,inputProps:{options:m,valueProp:"code",labelProp:"label"}}]},Lf=function(e,t){var n=T.a(uu.a,e);return Ef(n,["country","fiatCurrency","languages","cryptoCurrencies","timezone"],t,void 0)},Df=function(e,t,n){var r=T.a(uu.a,e);return Ef(r,["machine","country","languages","cryptoCurrencies"],n,t)},Pf=xn.e().shape({country:xn.g().label("Country").required(),fiatCurrency:xn.g().label("Fiat Currency").required(),languages:xn.a().label("Languages").required().min(1).max(4),cryptoCurrencies:xn.a().label("Crypto Currencies").required().min(1),timezone:xn.g().label("Timezone").required()}),Bf=xn.e().shape({machine:xn.g().label("Machine").required(),country:xn.g().label("Country").required(),languages:xn.a().label("Languages").required().min(1).max(4),cryptoCurrencies:xn.a().label("Crypto Currencies").required().min(1)}),Rf={country:"",fiatCurrency:"",languages:[],cryptoCurrencies:[],timezone:""},Af={machine:"",country:"",languages:[],cryptoCurrencies:[]},Tf=n(912),Mf=n(861),Wf=n(862),zf=Tf.a(Mf.a(Number),Wf.a(Ms.a(NaN))),$f=function(e){return zf(e)?e:null},qf={editDisabled:{color:oe}},Hf=function(e){return M.a((function(t){return t.class===e}))},Vf=function(e){var t=e.id;return M.a((function(e){return _o.a(t)(e.cryptos)}))},Uf=xn.e().shape({ticker:xn.g().required(),wallet:xn.g().required(),exchange:xn.g().required(),zeroConf:xn.g().required(),zeroConfLimit:xn.d().integer().required("Zero Conf Limit is a required field").min(0).max(nf).transform($f)}),Gf=xn.e().shape({cryptoUnits:xn.g().required()}),Xf=function(e,t){var n=wl.a((function(e,t){var n=yl.a(e.getCryptoCurrency(t.id).units);return B.a((function(e){return{code:e,display:e}}))(n)}));return[{name:"id",header:"Cryptocurrency",width:180,view:function(t){return L.a(R.a(["display"]),Tr.a(W.a("code",t)))(e)},size:"sm",editable:!1},{name:"cryptoUnits",size:"sm",stripe:!0,width:190,input:ka,inputProps:{options:n(t),valueProp:"code",labelProp:"display"}}]},_f=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=r?11:0,i=function(t){return L.a(R.a(["display"]),Tr.a(W.a("code",t)))(e)},o=function(e){return Hf(e)(t||[])},c=function(e){return function(t){return L.a(R.a("display"),Tr.a(W.a("code",t)))(o(e))}},l=wl.a((function(e,t){return Vf(t)(o(e))}));return[{name:"id",header:"Cryptocurrency",width:150-a,view:i,size:"sm",editable:!1},{name:"ticker",size:"sm",stripe:!0,view:c("ticker"),width:175-a,input:ka,inputProps:{options:l("ticker"),valueProp:"code",labelProp:"display",optionsLimit:null}},{name:"wallet",size:"sm",stripe:!0,view:c("wallet"),width:175-a,input:ka,inputProps:{options:l("wallet"),valueProp:"code",labelProp:"display",optionsLimit:null,onChange:n}},{name:"exchange",size:"sm",stripe:!0,view:c("exchange"),width:175-a,input:ka,inputProps:{options:l("exchange"),valueProp:"code",labelProp:"display",optionsLimit:null,onChange:n}},{name:"zeroConf",header:"Confidence Checking",size:"sm",stripe:!0,view:c("zeroConf"),input:ka,width:210-a,inputProps:{options:l("zeroConf"),valueProp:"code",labelProp:"display",optionsLimit:null,onChange:n}},{name:"zeroConfLimit",header:"0-conf Limit",size:"sm",stripe:!0,view:function(e,t){return"ETH"===t.id?Object(Me.jsx)("span",{style:qf.editDisabled,children:e}):e},input:qa,width:145-a,inputProps:{decimalPlaces:0},editable:function(e){return"ETH"!==e.id}}]},Kf=Object(j.a)({subtitle:{color:se,marginTop:16,marginBottom:16},extraMarginTop:{marginTop:72}}),Zf=Object(r.memo)((function(e){var t,n=e.children,r=e.className,a=e.extraMarginTop,i=Kf(),o=(t={},Object(z.a)(t,i.subtitle,!0),Object(z.a)(t,i.extraMarginTop,a),t);return Object(Me.jsx)(Qe,{className:E()(o,r),children:n})})),Yf=Object(j.a)({section:{marginBottom:72},sectionHeader:{display:"flex",alignItems:"center"},sectionTitle:{margin:[[16,20,23,0]]}}),Qf=function(e){var t=e.error,n=e.children,r=e.title,a=Yf();return Object(Me.jsxs)("div",{className:a.section,children:[(r||t)&&Object(Me.jsxs)("div",{className:a.sectionHeader,children:[Object(Me.jsx)(Zf,{className:a.sectionTitle,children:r}),t&&Object(Me.jsx)(Ao,{children:"Failed to save changes"})]}),n]})},Jf=Object(j.a)(Ei),eg=Object(j.a)({autoComplete:{width:"100%"}}),tg=x()(Bj||(Bj=Object(l.a)(["\n query getData {\n config\n }\n"]))),ng=x()(Rj||(Rj=Object(l.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"])));var rg,ag,ig=function(e){var t=e.isActive,n=e.doContinue,r=Jf(),a=(eg(),Object(u.c)(tg).data),i=Object(u.b)(ng,{onCompleted:n}),o=Object(c.a)(i,1)[0],l=T.a(["fiatCurrency"])($l(Dl)(null===a||void 0===a?void 0:a.config)),s=$l(Dl)(null===a||void 0===a?void 0:a.config);return Object(Me.jsxs)("div",{className:r.wrapper,children:[Object(Me.jsx)(Wo,{title:"Commissions"}),Object(Me.jsx)(Qf,{children:Object(Me.jsx)(Xm,{title:"Default setup",rowSize:"lg",titleLg:!0,name:"commissions",initialValues:ff,enableEdit:!0,forceAdd:t,save:function(e){var t=ql("commissions")(e.commissions[0]);return o({variables:{config:t}})},validationSchema:pf(s),data:[],elements:mf(l)})})]})},og=Object(j.a)(Ei),cg=x()(rg||(rg=Object(l.a)(["\n query getData {\n config\n accounts\n currencies {\n code\n display\n }\n countries {\n code\n display\n }\n cryptoCurrencies {\n code\n display\n }\n languages {\n code\n display\n }\n machines {\n name\n deviceId\n }\n }\n"]))),lg=x()(ag||(ag=Object(l.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"])));var sg,dg,ug=function(e){var t=e.isActive,n=e.doContinue,r=og(),a=Object(u.c)(cg).data,i=Object(u.b)(lg,{onCompleted:n}),o=Object(c.a)(i,1)[0],l=FO((null===a||void 0===a?void 0:a.config)||{},(null===a||void 0===a?void 0:a.cryptoCurrencies)||[]);return Object(Me.jsxs)("div",{className:r.wrapper,children:[Object(Me.jsx)(Wo,{title:"Locales"}),Object(Me.jsx)(Qf,{children:Object(Me.jsx)(Xm,{title:"Default settings",rowSize:"lg",titleLg:!0,name:"locale",initialValues:Rf,forceAdd:t,enableEdit:!0,save:function(e){var t=ql("locale")(e.locale[0]);return o({variables:{config:t}})},validationSchema:Pf,data:[],elements:Lf(Gn.a(a,{cryptoCurrencies:l}),(function(e,t,n){return n(t)}))})})]})},mg=Object(j.a)({message:function(e){return{width:e.width,marginTop:4,marginLeft:16}}}),hg=function(e){var t=e.children,n=e.width,r=void 0===n?330:n,a=e.className,i=mg({width:r});return Object(Me.jsxs)(Po.a,{display:"flex",className:a,children:[Object(Me.jsx)(ia,{}),Object(Me.jsx)(et,{className:i.message,children:t})]})},bg=n(863),pg=Object(j.a)({button:{margin:[["auto",0,32,"auto"]]},form:{flex:1,display:"flex",flexDirection:"column"},grid:{marginBottom:24,marginTop:12}}),jg=function(e){var t=e.validationSchema,n=e.elements,r=e.value,a=e.save,i=e.buttonLabel,o=void 0===i?"Save changes":i,c=e.buttonClass,l=e.xs,d=void 0===l?12:l,u=pg(),m=L.a(bg.a,B.a((function(e){var t,n=e.code;return Object(z.a)({},n,null!==(t=r&&r[n])&&void 0!==t?t:"")})))(n),b=Gn.a(m,r);return Object(Me.jsx)(pn.d,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,initialValues:b,validationSchema:t,onSubmit:function(e){var t=L.a(B.a(R.a("code")),M.a((function(t){return R.a("component",t)===Va&&Wr.a(e[R.a("code",t)])})))(n);return a(hu.a(t,e))},children:Object(Me.jsxs)(pn.c,{className:u.form,children:[Object(Me.jsx)(h.a,{container:!0,spacing:3,className:u.grid,children:n.map((function(e){var t=e.component,n=e.code,r=e.display,a=e.settings,i=e.inputProps;return Object(Me.jsx)(h.a,{item:!0,xs:d,children:Object(Me.jsx)(pn.a,Object(s.a)(Object(s.a)({component:t},i),{},{name:n,label:r,settings:a,fullWidth:!0}))},n)}))}),Object(Me.jsx)(Tn,{className:E()(u.button,c),type:"submit",children:o})]})})},fg=function(e){return{test:function(t){return!P.a(e)||!P.a(t)||this.createError()}}},gg={code:"twilio",name:"Twilio",title:"Twilio (SMS)",elements:[{code:"accountSid",display:"Account SID",component:Ua},{code:"authToken",display:"Auth Token",component:Va},{code:"fromNumber",display:"Twilio Number (international format)",component:Ua,face:!0},{code:"toNumber",display:"Notifications Number (international format)",component:Ua,face:!0}],getValidationSchema:function(e){return xn.e().shape({accountSid:xn.g().max(100,"Too long").required(),authToken:xn.g().max(100,"Too long").test(fg(null===e||void 0===e?void 0:e.authToken)),fromNumber:xn.g().max(100,"Too long").required(),toNumber:xn.g().max(100,"Too long").required()})}},Og={radioGroup:{flexDirection:"row",width:600},radioLabel:{width:150,height:48},mdForm:{width:385},infoMessage:{display:"flex",marginBottom:20,"& > p":{width:330,marginTop:4,marginLeft:16}},actionButton:{marginBottom:32},actionButtonLink:{textDecoration:"none",color:J},error:{color:me},button:{marginTop:40},formButton:{margin:[[24,0,0]]}},xg=x()(sg||(sg=Object(l.a)(["\n {\n config\n accounts\n }\n"]))),vg=x()(dg||(dg=Object(l.a)(["\n mutation Save($accounts: JSONObject) {\n saveAccounts(accounts: $accounts)\n }\n"]))),yg=Object(j.a)(Object(s.a)(Object(s.a)({},Og),{},{content:{width:820},radioLabel:Object(s.a)(Object(s.a)({},Og.radioLabel),{},{width:280}),wrapper:{width:1200,height:100,margin:[[0,"auto"]]},title:{marginLeft:8,marginBottom:5},info:{marginTop:20,marginBottom:20}})),wg=[{code:"enable",display:"Yes, I will"},{code:"disable",display:"No, not for now"}];var Cg,kg,Sg,Ng,Ig,Eg,Fg,Lg,Dg,Pg,Bg,Rg=function(e){var t,n,a=e.doContinue,i=yg(),o=Object(r.useState)(null),l=Object(c.a)(o,2),s=l[0],d=l[1],m=Object(r.useState)(!1),h=Object(c.a)(m,2),b=h[0],p=h[1],j=Object(u.c)(xg),f=j.data,g=j.refetch,O=Object(u.b)(vg,{onCompleted:a}),x=Object(c.a)(O,1)[0],v=null!==(t=null===f||void 0===f?void 0:f.accounts)&&void 0!==t?t:[],y=(n={},Object(z.a)(n,i.title,!0),Object(z.a)(n,i.error,b),n);return Object(Me.jsx)("div",{className:i.wrapper,children:Object(Me.jsxs)("div",{className:i.content,children:[Object(Me.jsx)(qe,{children:"Twilio (SMS service)"}),Object(Me.jsxs)(Po.a,{display:"flex",alignItems:"end",children:[Object(Me.jsx)(Ue,{noMargin:!0,className:E()(y),children:"Will you setup a two way machine or compliance?"}),Object(Me.jsxs)(ep,{width:304,children:[Object(Me.jsx)(Xe,{children:"Two-way machines allow your customers not only to buy (cash-in) but also sell cryptocurrencies (cash-out)."}),Object(Me.jsx)(Xe,{children:"You\u2019ll need an SMS service for cash-out transactions and for any compliance triggers"})]})]}),Object(Me.jsx)(xa,{labelClassName:i.radioLabel,className:i.radioGroup,options:wg,value:s,onChange:function(e){d(e.target.value),p(!1)}}),Object(Me.jsx)(hg,{className:i.info,children:"To set up Twilio please read the instructions from our support portal."}),Object(Me.jsx)(Pr,{link:"https://support.lamassu.is/hc/en-us/articles/115001203951-Twilio-for-SMS",label:"Twilio for SMS"}),"enable"===s&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Ue,{noMargin:!0,children:"Enter credentials"}),Object(Me.jsx)(jg,{xs:6,save:function(e){return x({variables:{accounts:{twilio:e}}}).then((function(){return g()}))},value:v.twilio,elements:gg.elements,validationSchema:gg.validationSchema,buttonLabel:"Continue",buttonClass:i.formButton})]}),"enable"!==s&&Object(Me.jsx)(Tn,{size:"lg",onClick:function(){if(!s)return p(!0);a()},className:i.button,children:"Continue"})]})})},Ag=n(864),Tg=Object(j.a)(Og),Mg=x()(Cg||(Cg=Object(l.a)(["\n query getData {\n config\n accounts\n accountsConfig {\n code\n display\n class\n cryptos\n }\n cryptoCurrencies {\n code\n display\n }\n }\n"]))),Wg=x()(kg||(kg=Object(l.a)(["\n mutation Save($config: JSONObject, $accounts: JSONObject) {\n saveConfig(config: $config)\n saveAccounts(accounts: $accounts)\n }\n"]))),zg=function(e){var t,n=e.data,a=e.doContinue,i=Tg(),o=Object(u.c)(Mg).data,l=Object(u.b)(Wg,{onCompleted:a}),d=Object(c.a)(l,1)[0],m=Object(r.useState)(!1),h=Object(c.a)(m,2),b=h[0],p=h[1],j=null===n||void 0===n?void 0:n.coin,f=null===o||void 0===o?void 0:o.accountsConfig,g=null!==(t=null===o||void 0===o?void 0:o.cryptoCurrencies)&&void 0!==t?t:[];return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Ue,{className:b&&i.error,children:"All set"}),Object(Me.jsx)(Xe,{children:"These are your wallet settings. You can later edit these and add additional coins."}),Object(Me.jsx)(_m,{rowSize:"lg",titleLg:!0,name:"All set",namespaces:[j],data:ql(j,hu.a("coin",n)),elements:_f(g,f,!0)}),Object(Me.jsx)(Tn,{size:"lg",onClick:function(){var e=zb.a(yl.a(Tb.utils.getCryptoCurrency(j).units)),t=Object(s.a)(Object(s.a)({zeroConfLimit:0},n),{},{cryptoUnits:e});if(!Uf.isValidSync(t))return p(!0);var r=ql(j,hu.a("coin",t)),a=ql(El)(r);return p(!1),d({variables:{config:a}})},className:i.button,children:"Continue"})]})},$g={code:"binanceus",name:"Binance.us",title:"Binance.us (Exchange)",elements:[{code:"apiKey",display:"API Key",component:Ua,face:!0,long:!0},{code:"privateKey",display:"Private Key",component:Va}],getValidationSchema:function(e){return xn.e().shape({apiKey:xn.g().max(100,"Too long").required(),privateKey:xn.g().max(100,"Too long").test(fg(null===e||void 0===e?void 0:e.privateKey))})}},qg=function(e){return e&&e.length},Hg=function(e,t){return xn.g().max(100,"Too long").when(e,{is:qg,then:xn.g().test(fg(t))})},Vg={code:"bitgo",name:"BitGo",title:"BitGo (Wallet)",elements:[{code:"token",display:"API Token",component:Ua,face:!0,long:!0},{code:"environment",display:"Environment",component:ka,inputProps:{options:[{code:"prod",display:"prod"},{code:"test",display:"test"}],labelProp:"display",valueProp:"code"},face:!0},{code:"BTCWalletId",display:"BTC Wallet ID",component:Ua},{code:"BTCWalletPassphrase",display:"BTC Wallet Passphrase",component:Va},{code:"LTCWalletId",display:"LTC Wallet ID",component:Ua},{code:"LTCWalletPassphrase",display:"LTC Wallet Passphrase",component:Va},{code:"ZECWalletId",display:"ZEC Wallet ID",component:Ua},{code:"ZECWalletPassphrase",display:"ZEC Wallet Passphrase",component:Va},{code:"BCHWalletId",display:"BCH Wallet ID",component:Ua},{code:"BCHWalletPassphrase",display:"BCH Wallet Passphrase",component:Va},{code:"DASHWalletId",display:"DASH Wallet ID",component:Ua},{code:"DASHWalletPassphrase",display:"DASH Wallet Passphrase",component:Va}],getValidationSchema:function(e){return xn.e().shape({token:xn.g().max(100,"Too long").required(),BTCWalletId:xn.g().max(100,"Too long"),BTCWalletPassphrase:Hg("BTCWalletId",null===e||void 0===e?void 0:e.BTCWalletPassphrase),LTCWalletId:xn.g().max(100,"Too long"),LTCWalletPassphrase:Hg("LTCWalletId",null===e||void 0===e?void 0:e.LTCWalletPassphrase),ZECWalletId:xn.g().max(100,"Too long"),ZECWalletPassphrase:Hg("ZECWalletId",null===e||void 0===e?void 0:e.ZECWalletPassphrase),BCHWalletId:xn.g().max(100,"Too long"),BCHWalletPassphrase:Hg("BCHWalletId",null===e||void 0===e?void 0:e.BCHWalletPassphrase),DASHWalletId:xn.g().max(100,"Too long"),DASHWalletPassphrase:Hg("DASHWalletId",null===e||void 0===e?void 0:e.DASHWalletPassphrase),environment:xn.g().matches(/(prod|test)/).required()})}},Ug={code:"bitstamp",name:"Bitstamp",title:"Bitstamp (Exchange)",elements:[{code:"clientId",display:"Client ID",component:Ua,face:!0,long:!0},{code:"key",display:"API Key",component:Ua,face:!0,long:!0},{code:"secret",display:"API Secret",component:Va}],getValidationSchema:function(e){return xn.e().shape({clientId:xn.g().max(100,"Too long").required(),key:xn.g().max(100,"Too long").required(),secret:xn.g().max(100,"Too long").test(fg(null===e||void 0===e?void 0:e.secret))})}},Gg={code:"blockcypher",name:"Blockcypher",title:"Blockcypher (Payments)",elements:[{code:"token",display:"API Token",component:Ua,face:!0,long:!0},{code:"confidenceFactor",display:"Confidence Factor",component:Ua,face:!0},{code:"rbf",component:$a,settings:{enabled:!0,disabledMessage:"RBF verification not available",label:"Enable RBF verification",requirement:"bitcoind"},face:!0}],getValidationSchema:function(){return xn.e().shape({token:xn.g().max(100,"Too long").required(),confidenceFactor:xn.d().integer("Please input a positive integer").positive("Please input a positive integer").required()})}},Xg={code:"cex",name:"Cex",title:"Cex (Exchange)",elements:[{code:"apiKey",display:"API Key",component:Ua,face:!0,long:!0},{code:"privateKey",display:"Private Key",component:Va}],getValidationSchema:function(e){return xn.e().shape({apiKey:xn.g().max(100,"Too long").required(),privateKey:xn.g().max(100,"Too long").test(fg(null===e||void 0===e?void 0:e.privateKey))})}},_g={code:"ftx",name:"Ftx",title:"Ftx (Exchange)",elements:[{code:"apiKey",display:"API Key",component:Ua,face:!0,long:!0},{code:"privateKey",display:"Private Key",component:Va}],getValidationSchema:function(e){return xn.e().shape({apiKey:xn.g().max(100,"Too long").required(),privateKey:xn.g().max(100,"Too long").test(fg(null===e||void 0===e?void 0:e.privateKey))})}},Kg={code:"infura",name:"Infura",title:"Infura (Wallet)",elements:[{code:"apiKey",display:"Project ID",component:Ua,face:!0,long:!0},{code:"apiSecret",display:"Project Secret",component:Va},{code:"endpoint",display:"Endpoint",component:Ua,face:!0}],getValidationSchema:function(e){return xn.e().shape({apiKey:xn.g().max(100,"Too long").required(),apiSecret:xn.g().max(100,"Too long").test(fg(null===e||void 0===e?void 0:e.apiSecret)),endpoint:xn.g().max(100,"Too long").required()})}},Zg={code:"itbit",name:"itBit",title:"itBit (Exchange)",elements:[{code:"userId",display:"User ID",component:Ua,face:!0,long:!0},{code:"walletId",display:"Wallet ID",component:Ua,face:!0,long:!0},{code:"clientKey",display:"Client Key",component:Ua},{code:"clientSecret",display:"Client Secret",component:Va}],getValidationSchema:function(e){return xn.e().shape({userId:xn.g().max(100,"Too long").required(),walletId:xn.g().max(100,"Too long").required(),clientKey:xn.g().max(100,"Too long").required(),clientSecret:xn.g().max(100,"Too long").test(fg(null===e||void 0===e?void 0:e.clientSecret))})}},Yg={code:"kraken",name:"Kraken",title:"Kraken (Exchange)",elements:[{code:"apiKey",display:"API Key",component:Ua,face:!0,long:!0},{code:"privateKey",display:"Private Key",component:Va}],getValidationSchema:function(e){return xn.e().shape({apiKey:xn.g().max(100,"Too long").required(),privateKey:xn.g().max(100,"Too long").test(fg(null===e||void 0===e?void 0:e.privateKey))})}},Qg={code:"mailgun",name:"Mailgun",title:"Mailgun (Email)",elements:[{code:"apiKey",display:"API Key",component:Ua},{code:"domain",display:"Domain",component:Ua},{code:"fromEmail",display:"From Email",component:Ua,face:!0},{code:"toEmail",display:"To Email",component:Ua,face:!0}],getValidationSchema:function(){return xn.e().shape({apiKey:xn.g().max(100,"Too long").required(),domain:xn.g().max(100,"Too long").required(),fromEmail:xn.g().max(100,"Too long").email("Please input a valid email address").required(),toEmail:xn.g().max(100,"Too long").email("Please input a valid email address").required()})}},Jg=(Sg={},Object(z.a)(Sg,Vg.code,Vg),Object(z.a)(Sg,Ug.code,Ug),Object(z.a)(Sg,Gg.code,Gg),Object(z.a)(Sg,Kg.code,Kg),Object(z.a)(Sg,Zg.code,Zg),Object(z.a)(Sg,Yg.code,Yg),Object(z.a)(Sg,Qg.code,Qg),Object(z.a)(Sg,gg.code,gg),Object(z.a)(Sg,$g.code,$g),Object(z.a)(Sg,Xg.code,Xg),Object(z.a)(Sg,_g.code,_g),Sg),eO=Object(j.a)(Object(s.a)(Object(s.a)({},Og),{},{radioGroup:Og.radioGroup,radioLabel:Object(s.a)(Object(s.a)({},Og.radioLabel),{},{width:200})})),tO=x()(Ng||(Ng=Object(l.a)(["\n {\n accounts\n }\n"]))),nO=x()(Ig||(Ig=Object(l.a)(["\n mutation SaveAccountsBC($accounts: JSONObject) {\n saveAccounts(accounts: $accounts)\n }\n"]))),rO=[{code:"enable",display:"I will enable cash-out"},{code:"disable",display:"I won't enable cash-out"}],aO=function(e){var t,n=e.addData,a=eO(),i=Object(u.c)(tO).data,o=Object(u.b)(nO,{onCompleted:function(){return n({zeroConf:"blockcypher"})}}),l=Object(c.a)(o,1)[0],s=Object(r.useState)(null),d=Object(c.a)(s,2),m=d[0],h=d[1],b=Object(r.useState)(!1),p=Object(c.a)(b,2),j=p[0],f=p[1],g=null!==(t=null===i||void 0===i?void 0:i.accounts)&&void 0!==t?t:[];return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Ue,{className:j&&a.error,children:"Blockcypher"}),Object(Me.jsx)(Xe,{children:"If you are enabling cash-out services, create a Blockcypher account."}),Object(Me.jsx)(Pr,{link:"https://support.lamassu.is/hc/en-us/articles/115001209472-Blockcypher",label:"Configuring Blockcypher"}),Object(Me.jsx)(xa,{labelClassName:a.radioLabel,className:a.radioGroup,options:rO,value:m,onChange:function(e){h(e.target.value),f(!1)}}),Object(Me.jsxs)("div",{className:a.mdForm,children:["disable"===m&&Object(Me.jsx)(Tn,{size:"lg",onClick:function(){return n({zeroConf:"none",zeroConfLimit:0})},className:a.button,children:"Continue"}),"enable"===m&&Object(Me.jsx)(jg,{value:g.blockcypher,save:function(e){return l({variables:{accounts:{blockcypher:e}}})},elements:Jg.blockcypher.elements,validationSchema:Jg.blockcypher.validationSchema,buttonLabel:"Continue",buttonClass:a.formButton})]})]})},iO=Object(j.a)(Og),oO=x()(Eg||(Eg=Object(l.a)(["\n {\n cryptoCurrencies {\n code\n display\n }\n }\n"]))),cO=xn.e().shape({coin:xn.g().required()}),lO=function(e){var t,n=e.addData,a=iO(),i=Object(r.useState)(!1),o=Object(c.a)(i,2),l=o[0],s=o[1],d=Object(u.c)(oO).data,m=null!==(t=null===d||void 0===d?void 0:d.cryptoCurrencies)&&void 0!==t?t:[];return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Ue,{className:l&&a.error,children:"Choose your first cryptocurrency"}),Object(Me.jsx)(pn.d,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,initialValues:{coin:""},onSubmit:function(e){return cO.isValidSync(e)?"BTC"!==e.coin?n({coin:e.coin,zeroConf:"none",zeroConfLimit:0}):void n(e):s(!0)},children:Object(Me.jsxs)(pn.c,{onChange:function(){return s(!1)},children:[Object(Me.jsx)(xu,{}),Object(Me.jsx)(pn.b,{component:Ha,name:"coin",labelClassName:a.radioLabel,className:a.radioGroup,options:m}),Object(Me.jsx)(Tn,{size:"lg",type:"submit",className:a.button,children:"Continue"})]})})]})},sO=function(e,t){return M.a((function(n){return function(e){return W.a("class",e)}(t)(n)&&function(e){return L.a(_o.a(e),R.a("cryptos"))}(e)(n)}))},dO=function(e,t,n,r){var a=sO(r,n)(e),i=Yl.a((function(e){var n=e.code,r=function(e){return t&&t[e]}(n);return!Jg[n]||(0,Jg[n].getValidationSchema)(r).isValidSync(r)}))(a),o=Object(c.a)(i,2);return{filled:o[0],unfilled:o[1]}},uO=Object(j.a)(Og),mO=x()(Fg||(Fg=Object(l.a)(["\n {\n accounts\n accountsConfig {\n code\n display\n class\n cryptos\n }\n cryptoCurrencies {\n code\n display\n }\n }\n"]))),hO=x()(Lg||(Lg=Object(l.a)(["\n mutation Save($accounts: JSONObject) {\n saveAccounts(accounts: $accounts)\n }\n"]))),bO=function(e){return!_o.a(e)(["mock-exchange"])},pO=function(e){var t,n,a,i=e.data,o=e.addData,l=uO(),s=Object(u.c)(mO).data,d=Object(u.b)(hO,{onCompleted:function(){return k()}}),m=Object(c.a)(d,1)[0],h=Object(r.useState)(null),b=Object(c.a)(h,2),p=b[0],j=b[1],f=Object(r.useState)(!1),g=Object(c.a)(f,2),O=g[0],x=g[1],v=null!==(t=null===s||void 0===s?void 0:s.accounts)&&void 0!==t?t:[],y=null!==(n=null===s||void 0===s?void 0:s.accountsConfig)&&void 0!==n?n:[],w=i.coin,C=dO(y,v,"exchange",w),k=function(){if(!p)return x(!0);o({exchange:p})};return Object(Me.jsxs)("div",{className:l.mdForm,children:[Object(Me.jsx)(Ue,{className:O&&l.error,children:"Choose your exchange"}),Object(Me.jsx)(xa,{labelClassName:l.radioLabel,className:l.radioGroup,options:Mr.a(C.filled,C.unfilled),value:p,onChange:function(e){j(e.target.value),x(!1)}}),!bO(p)&&Object(Me.jsx)(Tn,{size:"lg",onClick:k,className:l.button,children:"Continue"}),bO(p)&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)("div",{className:l.infoMessage,children:[Object(Me.jsx)(ia,{}),Object(Me.jsxs)(Ze,{children:["Make sure you set up ",Jg[p].name," to enter the necessary information below. Please follow the instructions on our support page if you haven\u2019t."]})]}),Object(Me.jsx)(Pr,{link:{kraken:"https://support.lamassu.is/hc/en-us/articles/115001206891-Kraken-trading",itbit:"https://support.lamassu.is/hc/en-us/articles/360026195032-itBit-trading",bitstamp:"https://support.lamassu.is/hc/en-us/articles/115001206911-Bitstamp-trading"}[p],label:"".concat(Jg[p].name," trading")}),Object(Me.jsx)(Ue,{noMargin:!0,children:"Enter exchange information"}),Object(Me.jsx)(jg,{value:v[p],save:(a=p,function(e){var t=Object(z.a)({},a,e);return m({variables:{accounts:t}})}),elements:Jg[p].elements,validationSchema:Jg[p].validationSchema,buttonLabel:"Continue",buttonClass:l.formButton})]})]})},jO=Object(j.a)(Og),fO=x()(Dg||(Dg=Object(l.a)(["\n {\n accountsConfig {\n code\n display\n class\n cryptos\n }\n }\n"]))),gO=function(e){var t,n,a=e.data,i=e.addData,o=jO(),l=Object(u.c)(fO).data,s=Object(r.useState)(null),d=Object(c.a)(s,2),m=d[0],h=d[1],b=Object(r.useState)(!1),p=Object(c.a)(b,2),j=p[0],f=p[1],g=null!==(t=null===l||void 0===l?void 0:l.accounts)&&void 0!==t?t:[],O=null!==(n=null===l||void 0===l?void 0:l.accountsConfig)&&void 0!==n?n:[],x=a.coin,v=dO(O,g,"ticker",x);return Object(Me.jsxs)("div",{className:o.mdForm,children:[Object(Me.jsx)(Ue,{className:j&&o.error,children:"Choose your ticker"}),Object(Me.jsx)(xa,{labelClassName:o.radioLabel,className:o.radioGroup,options:Mr.a(v.filled,v.unfilled),value:m,onChange:function(e){h(e.target.value),f(!1)}}),Object(Me.jsx)(Tn,{size:"lg",onClick:function(){if(!m)return f(!0);i({ticker:m})},className:o.button,children:"Continue"})]})},OO=function(e){var t;return{code:"bitgo",name:"BitGo",title:"BitGo (Wallet)",elements:[{code:"token",display:"API Token",component:Ua,face:!0,long:!0},{code:"environment",display:"Environment",component:ka,inputProps:{options:[{code:"prod",display:"prod"},{code:"test",display:"test"}],labelProp:"display",valueProp:"code"},face:!0},{code:"".concat(e,"WalletId"),display:"".concat(e," Wallet ID"),component:Ua},{code:"".concat(e,"WalletPassphrase"),display:"".concat(e," Wallet Passphrase"),component:Va}],validationSchema:xn.e().shape((t={token:xn.g().max(100,"Too long").required(),environment:xn.g().matches(/(prod|test)/).required()},Object(z.a)(t,"".concat(e,"WalletId"),xn.g().max(100,"Too long").required()),Object(z.a)(t,"".concat(e,"WalletPassphrase"),xn.g().max(100,"Too long").required()),t))}},xO=Object(j.a)(Og),vO=x()(Pg||(Pg=Object(l.a)(["\n {\n accounts\n accountsConfig {\n code\n display\n class\n cryptos\n }\n cryptoCurrencies {\n code\n display\n }\n }\n"]))),yO=x()(Bg||(Bg=Object(l.a)(["\n mutation Save($accounts: JSONObject) {\n saveAccounts(accounts: $accounts)\n }\n"]))),wO=function(e){return _o.a(e)(["infura","bitgo"])},CO=function(e){var t,n,a,i=e.data,o=e.addData,l=xO(),s=Object(u.c)(vO).data,d=Object(u.b)(yO,{onCompleted:function(){return S()}}),m=Object(c.a)(d,1)[0],h=Object(r.useState)(null),b=Object(c.a)(h,2),p=b[0],j=b[1],f=Object(r.useState)(!1),g=Object(c.a)(f,2),O=g[0],x=g[1],v=null!==(t=null===s||void 0===s?void 0:s.accounts)&&void 0!==t?t:[],y=null!==(n=null===s||void 0===s?void 0:s.accountsConfig)&&void 0!==n?n:[],w=i.coin,C=dO(y,v,"wallet",w),k=function(e){return function(t){var n=Object(z.a)({},e,t);return m({variables:{accounts:n}})}},S=function(){if(!p)return x(!0);o({wallet:p})};return Object(Me.jsxs)("div",{className:l.mdForm,children:[Object(Me.jsx)(Ue,{className:O&&l.error,children:"Choose your wallet"}),Object(Me.jsx)(xa,{labelClassName:l.radioLabel,className:l.radioGroup,options:Mr.a(C.filled,C.unfilled),value:p,onChange:function(e){j(e.target.value),x(!1)}}),(a=p,_o.a(a)(["bitcoind","geth","litecoind","dashd","zcashd","bitcoincashd"])&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)("div",{className:l.infoMessage,children:[Object(Me.jsx)(ia,{}),Object(Me.jsxs)(Ze,{children:["To set up ",p," please read the node wallet instructions from our support portal."]})]}),Object(Me.jsx)(Pr,{link:"https://support.lamassu.is/hc/en-us/articles/115001209552-Setting-up-your-node-wallets",label:"Support article"})]})),!wO(p)&&Object(Me.jsx)(Tn,{size:"lg",onClick:S,className:l.button,children:"Continue"}),"bitgo"===p&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)("div",{className:l.infoMessage,children:[Object(Me.jsx)(ia,{}),Object(Me.jsx)(Ze,{children:"Make sure you set up a BitGo wallet to enter the necessary information below. Please follow the instructions on our support page if you haven\u2019t."})]}),Object(Me.jsx)(Pr,{link:"https://support.lamassu.is/hc/en-us/articles/360024455592-Setting-up-BitGo",label:"Support article"}),Object(Me.jsx)(Ue,{noMargin:!0,children:"Enter wallet information"}),Object(Me.jsx)(jg,{value:v.bitgo,save:k(p),elements:OO(w).elements,validationSchema:OO(w).validationSchema,buttonLabel:"Continue",buttonClass:l.formButton})]}),"infura"===p&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Ue,{noMargin:!0,children:"Enter wallet information"}),Object(Me.jsx)(jg,{value:v.infura,save:k(p),elements:Jg.infura.elements,validationSchema:Jg.infura.getValidationSchema(v.infura),buttonLabel:"Continue",buttonClass:l.formButton})]})]})},kO=Object(j.a)(Ei),SO=[{label:"Choose cryptocurrency",component:lO},{label:"Choose wallet",component:CO},{label:"Choose ticker",component:gO},{label:"Exchange",component:pO},{label:"Blockcypher",component:aO},{label:"All set",component:zg}],NO=function(e){var t=e.doContinue,n=Object(r.useState)(0),a=Object(c.a)(n,2),i=a[0],o=a[1],l=Object(r.useState)({}),s=Object(c.a)(l,2),d=s[0],u=s[1],m=kO(),h="BTC"===(null===d||void 0===d?void 0:d.coin)?SO:Ag.a(4,1,SO),b=h[i].component;return Object(Me.jsxs)("div",{className:m.wrapper,children:[Object(Me.jsx)("div",{className:m.headerDiv,children:Object(Me.jsx)(Wo,{title:"Wallet settings"})}),Object(Me.jsxs)("div",{className:m.contentDiv,children:[Object(Me.jsx)(di,{children:h.map((function(e,t){return Object(Me.jsx)(ui,{step:i,it:e,idx:t,steps:h},t)}))}),Object(Me.jsx)("div",{className:m.contentWrapper,children:Object(Me.jsx)(b,{data:d,addData:function(e){u(Gn.a(d,e)),o(i+1)},doContinue:t})})]})]})},IO={welcome:{textAlign:"center",paddingTop:256},title:{lineHeight:1,fontSize:48},getStarted:{fontSize:24,fontWeight:500,marginBottom:54,color:q}},EO=Object(j.a)(IO);var FO=function(e,t){var n=$l(El,e);return M.a((function(e){return Uf.isValidSync($l(e.code,n))}))(t)},LO=function(e,t){return e?function(e,t){var n=$l(El,e),r=B.a((function(e){return $l(e.code,n)}))(t);return L.a(Uo.a(Bd.a),B.a((function(e){return Uf.isValidSync(e)})))(r)}(e,t)?function(e){var t=$l(Dl,e);return Pf.isValidSync(t)}(e)?function(e){var t=$l(Pl,e),n=$l(Dl,e);return pf(n).isValidSync(t)}(e)?0:3:2:1:0},DO=[{id:"welcome",Component:function(e){var t=e.doContinue,n=EO();return Object(Me.jsxs)("div",{className:n.welcome,children:[Object(Me.jsx)(qe,{className:n.title,children:"Welcome to the Lamassu Admin"}),Object(Me.jsxs)(Xe,{className:n.getStarted,children:["To get you started, we\u2019ve put together a wizard that will",Object(Me.jsx)("br",{}),"help set up what you need before pairing your machines."]}),Object(Me.jsx)(Tn,{size:"xl",onClick:t,children:"Get started"})]})}},{id:"wallet",Component:NO,exImage:"/assets/wizard/fullexample.wallet.png",subtitle:"Wallet settings",text:"Your wallet settings are the first step for this wizard. \n We'll start by setting up one of cryptocurrencies to get you up and running,\n but you can later set up as many as you want."},{id:"locale",Component:ug,exImage:"/assets/wizard/fullexample.locale.png",subtitle:"Locales",text:"From the Locales panel, you can define default settings\n that will be applied to all machines you add to your network later on.\n These settings may be overridden for specific machines in the Overrides section."},{id:"twilio",Component:Rg,exImage:"/assets/wizard/fullexample.twilio.png",subtitle:"Twilio (SMS service)",text:Object(Me.jsxs)(Me.Fragment,{children:["Twilio is used for SMS operator notifications, phone number collection for compliance, and 1-confirmation redemptions on cash-out transactions.",Object(Me.jsx)("br",{}),"You'll need to configure Twilio if you're offering cash-out or any compliance options"]})},{id:"commissions",Component:ig,exImage:"/assets/wizard/fullexample.commissions.png",subtitle:"Commissions",text:"From the Commissions page, you can define all the commissions of your\n machines. The values set here will be default values of all machines\n you'll later add to your network. Default settings keep you from\n having to enter the same values everytime you add a new machine. Once\n a machine is added, you may override these values per machine and per\n cryptocurrency in the overrides section."}],PO=n(866),BO=n(445),RO=Object(j.a)({modal:{display:"flex",justifyContent:"center",flexDirection:"column",alignItems:"center"},wrapper:function(e){var t=e.width,n=e.height;return{width:t,height:n,display:"flex",flexDirection:"column",minHeight:null!==n&&void 0!==n?n:400,maxHeight:"90vh",overflowY:"auto",borderRadius:8,outline:0}},infoPanelWrapper:function(e){var t=e.width,n=e.infoPanelHeight;return{width:t,height:n,marginTop:16,display:"flex",flexDirection:"column",minHeight:null!==n&&void 0!==n?n:200,maxHeight:"90vh",overflowY:"auto",borderRadius:8,outline:0}},panelContent:{width:"100%",display:"flex",flexDirection:"column",flex:1,padding:[[0,24]]},content:function(e){var t=e.small;return{width:"100%",display:"flex",flexDirection:"column",flex:1,padding:e.xl?[[0,88]]:t?[[0,16]]:[[0,32]]}},button:function(e){var t=e.small,n=e.xl;return{padding:[[0,0,n?26:0,0]],margin:n?[[0,0,"auto","auto"]]:t?[[12,12,"auto","auto"]]:[[16,16,"auto","auto"]]}},header:{display:"flex"},title:function(e){return{margin:e.small?[[20,0,8,16]]:[[28,0,8,32]]}}}),AO=function(e){var t=e.width,n=e.height,r=e.infoPanelHeight,a=e.title,i=e.small,o=e.xl,c=e.infoPanel,l=e.handleClose,d=e.children,u=(e.secondaryModal,e.className),m=e.closeOnEscape,h=e.closeOnBackdropClick,b=Object($.a)(e,["width","height","infoPanelHeight","title","small","xl","infoPanel","handleClose","children","secondaryModal","className","closeOnEscape","closeOnBackdropClick"]),p=RO({width:t,height:n,small:i,infoPanelHeight:r,xl:o}),j=i?Ue:qe,f=o?28:i?16:20;return Object(Me.jsx)(BO.a,Object(s.a)(Object(s.a)({onClose:function(e,t){(h||"backdropClick"!==t)&&(m||"escapeKeyDown"!==t)&&l()},className:p.modal},b),{},{children:Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)(Un.a,{className:E()(p.wrapper,u),children:[Object(Me.jsxs)("div",{className:p.header,children:[a&&Object(Me.jsx)(j,{className:p.title,children:a}),Object(Me.jsx)(tr,{size:f,className:p.button,onClick:function(){return l()},children:Object(Me.jsx)(gi,{})})]}),Object(Me.jsx)("div",{className:p.content,children:d})]}),c&&Object(Me.jsx)(Un.a,{className:E()(p.infoPanelWrapper,u),children:Object(Me.jsx)("div",{className:p.panelContent,children:c})})]})}))},TO=n(865);function MO(){return(MO=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function WO(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var zO=r.createElement("desc",null,"Created with Sketch."),$O=r.createElement("g",{id:"icon/stage/spring/current",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("circle",{id:"Oval-2-Copy",fill:"#48F694",cx:9,cy:9,r:4}),r.createElement("circle",{id:"Oval-Copy-5",stroke:"#48F694",strokeWidth:2,transform:"translate(9.000000, 9.000000) rotate(-270.000000) translate(-9.000000, -9.000000) ",cx:9,cy:9,r:8}));function qO(e,t){var n=e.title,a=e.titleId,i=WO(e,["title","titleId"]);return r.createElement("svg",MO({width:"18px",height:"18px",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,zO,$O)}var HO=r.forwardRef(qO),VO=(n.p,{stages:{display:"flex",alignItems:"center"},wrapper:{display:"flex",alignItems:"center",margin:0},stage:{display:"flex",height:28,width:28,zIndex:2,"& > svg":{height:"100%",width:"100%",overflow:"visible"}},separator:{width:28,height:2,border:[[2,"solid"]],zIndex:1},separatorSpring:{borderColor:ee},separatorZodiac:{borderColor:J},separatorSpringEmpty:{borderColor:oe},separatorZodiacEmpty:{borderColor:se}}),UO=Object(j.a)(VO),GO=Object(r.memo)((function(e){var t,n,r=e.steps,a=e.currentStep,i=e.color,o=void 0===i?"spring":i,c=e.className;if(a<1||a>r)throw Error("Value of currentStage is invalid");if(r<1)throw Error("Value of stages is invalid");var l=UO(),s=(t={},Object(z.a)(t,l.separator,!0),Object(z.a)(t,l.separatorSpring,"spring"===o),Object(z.a)(t,l.separatorZodiac,"zodiac"===o),t),d=(n={},Object(z.a)(n,l.separator,!0),Object(z.a)(n,l.separatorSpringEmpty,"spring"===o),Object(z.a)(n,l.separatorZodiacEmpty,"zodiac"===o),n);return Object(Me.jsxs)("div",{className:E()(c,l.stages),children:[TO.a(1,a).map((function(e){return Object(Me.jsxs)("div",{className:l.wrapper,children:[e>1&&Object(Me.jsx)("div",{className:E()(s)}),Object(Me.jsxs)("div",{className:l.stage,children:["spring"===o&&Object(Me.jsx)(Si,{}),"zodiac"===o&&Object(Me.jsx)(Ya,{})]})]},e)})),Object(Me.jsxs)("div",{className:l.wrapper,children:[a>1&&Object(Me.jsx)("div",{className:E()(s)}),Object(Me.jsxs)("div",{className:l.stage,children:["spring"===o&&Object(Me.jsx)(HO,{}),"zodiac"===o&&Object(Me.jsx)(ai,{})]})]}),TO.a(a+1,r+1).map((function(e){return Object(Me.jsxs)("div",{className:l.wrapper,children:[Object(Me.jsx)("div",{className:E()(d)}),Object(Me.jsxs)("div",{className:l.stage,children:["spring"===o&&Object(Me.jsx)(pt,{}),"zodiac"===o&&Object(Me.jsx)(vt,{})]})]},e)}))]})})),XO=Object(j.a)((function(){return{drawer:{borderTop:"none",boxShadow:"0 0 4px 0 rgba(0, 0, 0, 0.08)"},wrapper:{padding:"32px 0",flexGrow:1,height:264},smallWrapper:{height:84},title:{margin:[[0,32,0,0]]},subtitle:{marginTop:8,marginBottom:6,lineHeight:1.25,display:"inline"},modal:{background:"none",boxShadow:"none"}}}));var _O,KO,ZO,YO=function(e){var t,n=e.currentStep,a=e.steps,i=e.subtitle,o=e.text,l=e.exImage,s=e.open,d=e.start,u=XO(),m=Object(r.useState)(!1),b=Object(c.a)(m,2),p=b[0],j=b[1],f=(t={},Object(z.a)(t,u.wrapper,!0),Object(z.a)(t,u.smallWrapper,!s),t);return Object(Me.jsxs)(PO.a,{anchor:"bottom",open:!0,variant:"persistent",classes:{paperAnchorDockedBottom:u.drawer},children:[Object(Me.jsxs)("div",{className:E()(f),children:[Object(Me.jsxs)(h.a,{container:!0,direction:"row",justify:"center",alignItems:"baseline",children:[Object(Me.jsxs)(h.a,{item:!0,xs:5,container:!0,direction:s?"column":"row",justify:"flex-start",alignItems:"baseline",children:[Object(Me.jsx)(He,{className:u.title,children:"Setup Lamassu Admin"}),Object(Me.jsx)(Ke,{className:u.subtitle,children:i}),s&&Object(Me.jsx)(Xe,{children:o})]}),Object(Me.jsx)(h.a,{item:!0,xs:4,container:!0,direction:"column",justify:"flex-start",alignItems:"flex-end",spacing:5,children:Object(Me.jsx)(h.a,{item:!0,xs:12,children:a&&n&&Object(Me.jsx)(GO,{currentStep:n,steps:a})})})]}),s&&Object(Me.jsxs)(h.a,{container:!0,direction:"row",justify:"center",alignItems:"baseline",children:[Object(Me.jsx)(h.a,{item:!0,xs:5,container:!0,direction:"column",justify:"flex-start",alignItems:"flex-start",children:Object(Me.jsx)(or,{onClick:function(){j(!0)},children:"See full example"})}),Object(Me.jsx)(h.a,{item:!0,xs:4,container:!0,direction:"column",justify:"flex-start",alignItems:"flex-end",spacing:5,children:Object(Me.jsx)(h.a,{item:!0,children:Object(Me.jsx)(Tn,{size:"lg",onClick:d,children:"Get Started"})})})]})]}),Object(Me.jsx)(AO,{closeOnEscape:!0,closeOnBackdropClick:!0,className:u.modal,xl:!0,width:1328,handleClose:function(){j(!1)},open:p,children:Object(Me.jsx)("img",{width:1152,src:l,alt:""})})]})},QO=Object(j.a)({wrapper:{display:"flex",padding:[[16,0]],flexDirection:"column",justifyContent:"space-between",backgroundColor:re},welcomeBackground:{background:"url(/wizard-background.svg) no-repeat center center fixed",backgroundColor:re,backgroundSize:"cover"},blurred:{filter:"blur(4px)",pointerEvents:"none"}}),JO=x()(_O||(_O=Object(l.a)(["\n query getData {\n config\n accounts\n cryptoCurrencies {\n code\n display\n }\n }\n"]))),ex=function(e){e.fromAuthRegister;var t,n,a=QO(),i=Object(u.c)(JO),o=i.data,l=i.loading,s=Object(w.h)(),d=Object(r.useContext)(k).setWizardTested,m=Object(r.useState)(0),h=Object(c.a)(m,2),b=h[0],p=h[1],j=Object(r.useState)(!0),f=Object(c.a)(j,2),g=f[0],O=f[1],x=Object(r.useState)(!1),v=Object(c.a)(x,2),y=v[0],C=v[1];if(l)return Object(Me.jsx)(Me.Fragment,{});var S=LO(null===o||void 0===o?void 0:o.config,null===o||void 0===o?void 0:o.cryptoCurrencies),N=s.length&&!(null===(t=s.location.state)||void 0===t?void 0:t.fromAuthRegister);0===S&&(d(!0),N?s.goBack():s.push("/"));var I=0===b,F=(n={},Object(z.a)(n,a.blurred,y),Object(z.a)(n,a.wrapper,!0),Object(z.a)(n,a.welcomeBackground,I),n),L=DO[b];return Object(Me.jsxs)(un.a,{fullScreen:!0,open:g,children:[Object(Me.jsx)(mn.a,{className:E()(F),children:Object(Me.jsx)(L.Component,{doContinue:function(){b>=DO.length-1&&(O(!1),s.push("/"));var e=0===b&&S?S:b+1;C(!0),p(e)},isActive:!y})}),!I&&Object(Me.jsx)(YO,{currentStep:b,steps:DO.length-1,exImage:L.exImage,subtitle:L.subtitle,text:L.text,open:y,start:function(){C(!1)}})]})},tx=function(e){return!P.a(null===e||void 0===e?void 0:e.id)&&!P.a(null===e||void 0===e?void 0:e.username)&&!P.a(null===e||void 0===e?void 0:e.role)},nx="user",rx="superuser",ax=function(e){var t=Object.assign({},e),n=Object(r.useContext)(k).userData;return tx(n)?Object(Me.jsx)(w.c,Object(s.a)({},t)):Object(Me.jsx)(w.b,{to:"/login"})},ix=function(e){var t=e.component,n=e.restricted,a=Object($.a)(e,["component","restricted"]),i=Object(r.useContext)(k).userData;return Object(Me.jsx)(w.c,Object(s.a)(Object(s.a)({},a),{},{render:function(e){return tx(i)&&n?Object(Me.jsx)(w.b,{to:"/"}):Object(Me.jsx)(t,Object(s.a)({},e))}}))},ox=n(872),cx=n(900),lx=6e4,sx=864e5,dx=6048e5,ux=2592e6,mx={overviewLegend:{display:"flex",justifyContent:"flex-end","& span":{marginRight:24},"& > :last-child":{marginRight:0}},legendEntry:{display:"flex",flexDirection:"row",alignItems:"center","& > :first-child":{marginRight:8}},dropdownsOverviewWrapper:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:16},verticalLine:{height:64,width:1,border:"solid",borderWidth:.5,borderColor:de},dropdowns:{display:"flex",flexDirection:"row","& div":{marginRight:24},"& > :last-child":{marginRight:0}},overview:{display:"flex",flexDirection:"row",alignItems:"center","& div":{marginRight:40},"& > :last-child":{marginRight:0}},overviewFieldWrapper:{marginTop:6,marginBottom:6,"& span":{fontSize:24}},overviewGrowth:{display:"flex",flexDirection:"row",alignItems:"center","& p":{marginLeft:4}},growthPercentage:{fontWeight:"bold"},growth:{color:"#00CD5A"},decline:{color:Y},graphHeaderWrapper:{display:"flex",flexDirection:"row",justifyContent:"space-between",marginBottom:40},graphHeaderLeft:{display:"flex",flexDirection:"column"},graphHeaderRight:{marginTop:15,display:"flex",flexDirection:"row","& > *":{marginRight:30,"&:last-child":{marginRight:0}}},graphLegend:{display:"flex",flexDirection:"row",alignItems:"center","& span":{marginRight:24},"& > :last-child":{marginRight:0}},machineSelector:{width:248},cashInIcon:{width:12,height:12,borderRadius:12,backgroundColor:_},cashOutIcon:{width:12,height:12,borderRadius:12,backgroundColor:K},txIcon:{width:12,height:12,borderRadius:12,backgroundColor:"#000"},topMachinesRadio:{display:"flex",flexDirection:"row"}},hx=Object(j.a)(mx),bx=function(e){var t=e.IconElement,n=e.IconComponent,r=e.label,a=hx();return Object(Me.jsxs)("span",{className:a.legendEntry,children:[!!n&&Object(Me.jsx)(n,{height:12}),!!t&&t,Object(Me.jsx)(Xe,{children:r})]})},px=n(923),jx=n(871),fx={dotOtWrapper:{position:"absolute",top:function(e){var t;return null!==(t=null===e||void 0===e?void 0:e.y)&&void 0!==t?t:0},left:function(e){var t;return null!==(t=null===e||void 0===e?void 0:e.x)&&void 0!==t?t:0},width:150,padding:12,borderRadius:8},dotOtTransactionAmount:{margin:[[8,0,8,0]]},dotOtTransactionVolume:{color:q},dotOtTransactionClasses:{marginTop:15,"& p > span":{marginLeft:5},"& p:last-child":{marginTop:5}}},gx=Object(j.a)(fx),Ox=function(e){var t,n=e.coords,r=e.data,a=e.dateInterval,i=e.period,o=e.currency,c=e.representing,l=gx(n),s=F.a("hourOfDay",c.code)?[xs(a[1],"HH:mm"),xs(a[0],"HH:mm")]:[Os(a[1],null,"day"===i.code?"MMM d, HH:mm":"MMM d"),Os(a[0],null,"day"===i.code?"HH:mm":"MMM d")],d=Zl.a((function(e,t){return e.volume+=parseInt(t.fiat),"cashIn"===t.txClass&&e.cashIn++,"cashOut"===t.txClass&&e.cashOut++,e}),{volume:0,cashIn:0,cashOut:0},r);return Object(Me.jsxs)(Un.a,{className:l.dotOtWrapper,children:[Object(Me.jsx)(Ke,{noMargin:!0,children:"day"===i.code||F.a("hourOfDay",c.code)?"".concat(s[0]," - ").concat(s[1]):"".concat(s[0])}),Object(Me.jsxs)(Xe,{noMargin:!0,className:l.dotOtTransactionAmount,children:[gn.a(r)," ",Gu(gn.a(r),"transaction","transactions")]}),Object(Me.jsxs)(Xe,{noMargin:!0,className:l.dotOtTransactionVolume,children:[(t=d.volume,t.toLocaleString("en-US",{maximumFractionDigits:2}))," ",o," in volume"]}),Object(Me.jsxs)("div",{className:l.dotOtTransactionClasses,children:[Object(Me.jsxs)(nt,{noMargin:!0,children:[Object(Me.jsx)(ul,{}),Object(Me.jsxs)("span",{children:[d.cashIn," cash-in"]})]}),Object(Me.jsxs)(nt,{noMargin:!0,children:[Object(Me.jsx)(gl,{}),Object(Me.jsxs)("span",{children:[d.cashOut," cash-out"]})]})]})]})},xx=Object(r.memo)(Ox,(function(e,t){return e.coords===t.coords})),vx=n(867),yx=n(868),wx=n(869),Cx=function(e){var t=e.data,n=e.timezone,a=e.setSelectionCoords,i=e.setSelectionData,o=e.setSelectionDateInterval,c=Object(r.useRef)(null),l=10,s=401,d=1163,u=Object(r.useMemo)((function(){return{top:25,right:.5,bottom:27,left:36.5}}),[]),m=Object(Nf.a)(n),h=function(e,t){for(var n=[],r=new Date(e[0]),a=new Date(e[1]),i=cx.a(r);i<=a;)n.push(cx.a(i)),i.setUTCHours(i.getUTCHours()+t);return n},b=Object(r.useCallback)((function(e,n){return M.a((function(t){var r=new Date(t.created).setTime(new Date(t.created).getTime()+new Date(t.created).getTimezoneOffset()*lx+m),a=new Date(r);return e.getUTCHours()<n.getUTCHours()&&a.getUTCHours()>=new Date(e).getUTCHours()&&a.getUTCHours()<new Date(n).getUTCHours()||e.getUTCHours()>n.getUTCHours()&&a.getUTCHours()<=new Date(e).getUTCHours()&&a.getUTCHours()<new Date(n).getUTCHours()}),t)}),[t,m]),p=Object(r.useCallback)((function(e,t){return Zl.a((function(e,t){return"cashIn"===t.txClass&&(e.cashIn+=vl()(t.fiat).toNumber()),"cashOut"===t.txClass&&(e.cashOut+=vl()(t.fiat).toNumber()),e}),{cashIn:0,cashOut:0},b(e,t))}),[b]),j=Cs.scaleUtc().domain([fs(Object(vx.a)(new Date)),fs(Object(Rs.a)({days:1},Object(vx.a)(new Date)))]).rangeRound([u.left,d-u.right]),f=B.a((function(e){var t=cx.a(e);e.setUTCHours(e.getUTCHours()+2);var n=cx.a(e);return[t,b(t,n)]}),yx.a(h(j.domain(),2))),g=B.a((function(e){var t=cx.a(e);e.setUTCHours(e.getUTCHours()+2);var n=cx.a(e);return[t,p(t,n)]}),yx.a(h(j.domain(),2))),O=Cs.scaleLinear().domain([0,0!==Cs.max(g.map((function(e){return e[1]})),(function(e){return e.cashIn+e.cashOut}))?Cs.max(g.map((function(e){return e[1]})),(function(e){return e.cashIn+e.cashOut})):50]).range([s-u.bottom,u.top]),x=Object(r.useCallback)((function(e){return e.attr("transform","translate(0, ".concat(s-u.bottom,")")).call(Cs.axisBottom(j).ticks(Cs.timeHour.every(2)).tickFormat(Cs.timeFormat("%H:%M")))}),[u,j]),v=Object(r.useCallback)((function(e){return e.attr("transform","translate(".concat(u.left,", 0)")).call(Cs.axisLeft(O).ticks(4.01).tickSize(0).tickFormat("")).call((function(e){return e.select(".domain").remove()}))}),[u,O]),y=Object(r.useCallback)((function(e){return e.attr("stroke",ie).append("g").selectAll("line").data(h(j.domain(),2)).join("line").attr("x1",(function(e){var t=j(e),n=h(j.domain(),2);return t===j(n[gn.a(n)-1])?t-1:.5+t})).attr("x2",(function(e){var t=j(e),n=h(j.domain(),2);return t===j(n[gn.a(n)-1])?t-1:.5+t})).attr("y1",u.top).attr("y2",s-u.bottom)}),[u,j]),w=Object(r.useCallback)((function(e){return e.append("g").selectAll("line").data(h(j.domain(),2)).join("rect").attr("x",(function(e){return j(e)})).attr("y",u.top).attr("width",(function(e){var t=Math.round(100*j(e))/100,n=h(j.domain(),2).map((function(e){return j(e)})),r=Ko.a((function(e){return e===t}),n),a=r+1===gn.a(n)?0:n[r+1]-n[r];return Math.round(100*a)/100})).attr("height",s-u.bottom-u.top).attr("stroke","transparent").attr("fill","transparent").on("mouseover",(function(e){var t=cx.a(new Date(e.target.__data__)),n=cx.a(t);t.setUTCHours(t.getUTCHours()+2);var r=cx.a(t),c=f.find((function(e){return Ms.a(n,e[0])}))[1],l=cx.a(e.target.getBoundingClientRect().x),s=cx.a(e.target.getBoundingClientRect().x+e.target.getBoundingClientRect().width),d=e.target.x.baseVal.value<872.25?s+25:l-150-25,u=cx.a(e.target.getBoundingClientRect().y);o([r,n]),i(c),a({x:Math.round(d),y:Math.round(u)}),Cs.select("#event-rect-".concat(j(e.target.__data__))).attr("fill",ae)})).on("mouseleave",(function(e){Cs.select("#event-rect-".concat(j(e.target.__data__))).attr("fill","transparent"),o(null),i(null),a(null)}))}),[u,f,a,i,o,j]),C=Object(r.useCallback)((function(e){return e.append("g").selectAll("line").data(h(j.domain(),2)).join("rect").attr("id",(function(e){return"event-rect-".concat(j(e))})).attr("x",(function(e){return j(e)})).attr("y",u.top).attr("width",(function(e){var t=Math.round(100*j(e))/100,n=h(j.domain(),2).map((function(e){return j(e)})),r=Ko.a((function(e){return e===t}),n),a=r+1===gn.a(n)?0:n[r+1]-n[r];return Math.round(100*a)/100})).attr("height",s-u.bottom-u.top).attr("stroke","transparent").attr("fill","transparent")}),[u,j]),k=Object(r.useCallback)((function(){return Cs.selectAll(".tick text").style("stroke",le).style("fill",le).style("stroke-width",.5).style("font-family",je)}),[]),S=Object(r.useCallback)((function(e){e.selectAll("rect").data(yx.a(h(j.domain(),2))).join("rect").attr("stroke",_).attr("fill",_).attr("x",(function(e){return j(e)+5})).attr("y",(function(e){var t=Tr.a((function(t){return Ms.a(t[0],e)}),g);return O(t[1].cashIn)-u.top+u.bottom})).attr("height",(function(e){var t=Tr.a((function(t){return Ms.a(t[0],e)}),g);return wx.a(0,s,s-O(t[1].cashIn)-u.bottom-5)})).attr("width",(function(e){var t=Math.round(100*j(e))/100,n=h(j.domain(),2).map((function(e){return j(e)})),r=Ko.a((function(e){return e===t}),n),a=r===gn.a(n)?0:n[r+1]-n[r];return Math.round(100*(a-l))/100})).attr("rx",2.5)}),[j,O,u,g]),N=Object(r.useCallback)((function(e){e.selectAll("rect").data(yx.a(h(j.domain(),2))).join("rect").attr("stroke",K).attr("fill",K).attr("x",(function(e){return j(e)+5})).attr("y",(function(e){var t=Tr.a((function(t){return Ms.a(t[0],e)}),g);return O(t[1].cashIn+t[1].cashOut)-u.top+u.bottom})).attr("height",(function(e){var t=Tr.a((function(t){return Ms.a(t[0],e)}),g);return wx.a(0,s,s-O(t[1].cashOut)-u.bottom-5)})).attr("width",(function(e){var t=Math.round(100*j(e))/100,n=h(j.domain(),2).map((function(e){return j(e)})),r=Ko.a((function(e){return e===t}),n),a=r===gn.a(n)?0:n[r+1]-n[r];return Math.round(100*(a-l))/100})).attr("rx",2.5)}),[j,O,u,g]),I=Object(r.useCallback)((function(){var e=Cs.select(c.current).attr("viewBox",[0,0,d,s]);return e.append("g").call(x),e.append("g").call(v),e.append("g").call(y),e.append("g").call(C),e.append("g").call(k),e.append("g").call(S),e.append("g").call(N),e.append("g").call(w),e.node()}),[x,v,C,w,y,S,k,N]);return Object(r.useEffect)((function(){Cs.select(c.current).selectAll("*").remove(),I()}),[I]),Object(Me.jsx)("svg",{ref:c})},kx=Object(r.memo)(Cx,(function(e,t){return Ms.a(e.period,t.period)&&Ms.a(e.selectedDay,t.selectedDay)})),Sx=n(924),Nx=function(e){var t,n=e.data,a=e.period,i=e.timezone,o=e.setSelectionCoords,c=e.setSelectionData,l=e.setSelectionDateInterval,s=Object(r.useRef)(null),u=401,m=1163,h=Object(r.useMemo)((function(){return{top:25,right:.5,bottom:27,left:36.5}}),[]),b=Object(Nf.a)(i),p=Date.now()+b,j={day:[p-sx,p],week:[p-dx,p],month:[p-ux,p]},f=Object(r.useMemo)((function(){return{day:{freq:24,step:36e5,tick:Cs.utcHour.every(1),labelFormat:"%H:%M"},week:{freq:7,step:864e5,tick:Cs.utcDay.every(1),labelFormat:"%a %d"},month:{freq:30,step:864e5,tick:Cs.utcDay.every(1),labelFormat:"%d"}}}),[]),g=Object(r.useCallback)((function(e){var t=new Date(e),n=t.getUTCDate(),r=t.getUTCDay(),a=t.getUTCMonth(),i=new Date(t.getTime());i.setUTCDate(n-1);var o=i.getUTCDate(),c=i.getUTCDay(),l=i.getUTCMonth(),s=Array.from(Array(7)).map((function(e,t){return Object(js.a)("EEE",Object(Rs.a)({days:t},Object(px.a)(new Date)))})),d=Array.from(Array(12)).map((function(e,t){return Object(js.a)("LLL",Object(Rs.a)({months:t},Object(Sx.a)(new Date)))}));return{previous:a!==l?d[l]:"".concat(s[c]," ").concat(o),current:a!==l?d[a]:"".concat(s[r]," ").concat(n)}}),[]),O=Object(r.useCallback)((function(e){for(var t=[],n=function(e){var t=f[a.code].step;return new Date(Math.ceil(e.valueOf()/t)*t)},r=0;r<=f[a.code].freq;r++){var i=new Date(p-r*f[a.code].step);n(i)>e[1]||(i<e[0]||t.push(n(i)))}return t}),[p,f,a.code]),x=Object(r.useCallback)((function(e){var t=[];t.push(e[1]);for(var n=function(e){var t=f[a.code].step;return new Date(Math.ceil(e.valueOf()/t)*t)},r=0;r<=f[a.code].freq;r++){var i=new Date(p-r*f[a.code].step);n(i)>new Date(e[1])||(i<new Date(e[0])||t.push(n(i)))}return t.push(e[0]),t}),[p,f,a.code]),v=Cs.scaleUtc().domain(j[a.code]).range([h.left,m-h.right]),y=Cs.scaleLinear().domain([0,1.03*(null!==(t=Cs.max(n,(function(e){return new vl.a(e.fiat).toNumber()})))&&void 0!==t?t:1e3)]).nice().range([u-h.bottom,h.top]),w=function(e,t){for(var n=[t[1]].concat(Object(d.a)(M.a((function(e){return e>t[0]&&e<t[1]}),e)),[t[0]]),r=[],a=0;a<n.length-1;a++)r.push([n[a],n[a+1]]);return r},C=Object(r.useCallback)((function(e){return e.attr("transform","translate(0, ".concat(u-h.bottom,")")).call(Cs.axisBottom(v).ticks(f[a.code].tick).tickFormat((function(e){return Cs.timeFormat(f[a.code].labelFormat)(e.getTime()+e.getTimezoneOffset()*lx)}))).call((function(e){return e.select(".domain").remove()})).call((function(e){return e.append("line").attr("x1",h.left).attr("y1",-401+h.top+h.bottom).attr("x2",h.left).attr("stroke",J).attr("stroke-width",1)}))}),[h,f,a.code,v]),k=Object(r.useCallback)((function(e){return e.attr("transform","translate(".concat(h.left,", 0)")).call(Cs.axisLeft(y).ticks(4.01)).call((function(e){return e.select(".domain").remove()})).call((function(e){return e.selectAll(".tick line").filter((function(e){return 0===e})).clone().attr("x2",m-h.right-h.left).attr("stroke-width",1).attr("stroke",J)}))}),[h,y]),S=Object(r.useCallback)((function(e){e.attr("stroke",ie).attr("fill",ie).call((function(e){return e.append("g").selectAll("line").data(O(v.domain())).join("line").attr("x1",(function(e){return.5+v(e)})).attr("x2",(function(e){return.5+v(e)})).attr("y1",h.top).attr("y2",u-h.bottom)})).call((function(e){return e.append("g").selectAll("line").data(Cs.axisLeft(y).scale().ticks(4.01)).join("line").attr("y1",(function(e){return.5+y(e)})).attr("y2",(function(e){return.5+y(e)})).attr("x1",h.left).attr("x2",m-h.right)})).call((function(e){return e.append("g").selectAll("line").data(x(v.domain())).join("rect").attr("x",(function(e){return v(e)})).attr("y",h.top).attr("width",(function(e){var t=Math.round(100*v(e))/100,n=function(e,t){var n;return null!==(n=Tr.a((function(e){return t<=e[0]&&t>=e[1]}),e))&&void 0!==n?n:[0,0]}(w(x(v.domain()).map((function(e){return Math.round(100*v(e))/100})),v.range()),t);return Math.round(100*(n[0]-n[1]))/100})).attr("height",u-h.bottom-h.top).attr("stroke","transparent").attr("fill","transparent").on("mouseover",(function(e){var t=Math.round(100*e.target.x.baseVal.value)/100,r=function(e,t,n){for(var r=Yj.a(Ho.a(t)),a=t.length-1;a>=0;a--)if(n<r[a])return[e[a],e[a+1]]}(x(v.domain()),w(x(v.domain()).map((function(e){return Math.round(100*v(e))/100})),v.range()),t),a=n.filter((function(e){var t=new Date(e.created),n=t.setTime(t.getTime()+b);return n>new Date(r[1])&&n<=new Date(r[0])})),i=cx.a(e.target.getBoundingClientRect().x),s=cx.a(e.target.getBoundingClientRect().x+e.target.getBoundingClientRect().width),d=e.target.x.baseVal.value<872.25?s+25:i-150-25,u=cx.a(e.target.getBoundingClientRect().y);l(r),c(a),o({x:Math.round(d),y:Math.round(u)}),Cs.select(e.target).attr("fill",ae)})).on("mouseleave",(function(e){Cs.select(e.target).attr("fill","transparent"),l(null),c(null),o(null)}))})).call((function(e){return e.append("g").selectAll("line").data(O(v.domain()).filter((function(e){return"day"===a.code?0===e.getUTCHours():1===e.getUTCDate()}))).join("line").attr("class","dateSeparator").attr("x1",(function(e){return.5+v(e)})).attr("x2",(function(e){return.5+v(e)})).attr("y1",h.top-50).attr("y2",u-h.bottom).attr("stroke-width",5).join("text")})).call((function(e){var t,n,r=null===Cs||void 0===Cs||null===(t=Cs.select(".dateSeparator"))||void 0===t||null===(n=t.node())||void 0===n?void 0:n.getBBox();if(r){var i=O(v.domain()).filter((function(e){return"day"===a.code?0===e.getUTCHours():1===e.getUTCDate()})),o=g(i);return e.append("text").attr("x",r.x-10).attr("y",r.y+33).attr("text-anchor","end").attr("dy",".25em").text(o.previous)}})).call((function(e){var t,n,r=null===Cs||void 0===Cs||null===(t=Cs.select(".dateSeparator"))||void 0===t||null===(n=t.node())||void 0===n?void 0:n.getBBox();if(r){var i=O(v.domain()).filter((function(e){return"day"===a.code?0===e.getUTCHours():1===e.getUTCDate()})),o=g(i);return e.append("text").attr("x",r.x+10).attr("y",r.y+33).attr("text-anchor","start").attr("dy",".25em").text(o.current)}}))}),[h,O,g,v,y,a,x,n,b,o,c,l]),N=Object(r.useCallback)((function(){return Cs.selectAll(".tick text").style("stroke",le).style("fill",le).style("stroke-width",.5).style("font-family",je)}),[]),I=Object(r.useCallback)((function(){return Cs.selectAll("text").style("stroke",se).style("fill",se).style("stroke-width",.5).style("font-family",je)}),[]),E=Object(r.useCallback)((function(){Cs.selectAll(".tick line").style("stroke",J).style("fill",J)}),[]),F=Object(r.useCallback)((function(e){e.attr("stroke",J).attr("stroke-width",3).attr("stroke-dasharray","10, 5").call((function(e){var t,r;return e.append("line").attr("y1",.5+y(null!==(t=Cs.mean(n,(function(e){return new vl.a(e.fiat).toNumber()})))&&void 0!==t?t:0)).attr("y2",.5+y(null!==(r=Cs.mean(n,(function(e){return new vl.a(e.fiat).toNumber()})))&&void 0!==r?r:0)).attr("x1",h.left).attr("x2",m-h.right)}))}),[h,y,n]),L=Object(r.useCallback)((function(e){e.selectAll("circle").data(n).join("circle").attr("cx",(function(e){var t=new Date(e.created);return v(t.setTime(t.getTime()+b))})).attr("cy",(function(e){return y(new vl.a(e.fiat).toNumber())})).attr("fill",(function(e){return"cashIn"===e.txClass?_:K})).attr("r",3.5)}),[n,b,v,y]),D=Object(r.useCallback)((function(){var e=Cs.select(s.current).attr("viewBox",[0,0,m,u]);return e.append("g").call(S),e.append("g").call(F),e.append("g").call(C),e.append("g").call(k),e.append("g").call(N),e.append("g").call(I),e.append("g").call(E),e.append("g").call(L),e.node()}),[F,S,C,k,L,I,E,N]);return Object(r.useEffect)((function(){Cs.select(s.current).selectAll("*").remove(),D()}),[D]),Object(Me.jsx)("svg",{ref:s})},Ix=Object(r.memo)(Nx,(function(e,t){return Ms.a(e.period,t.period)&&Ms.a(e.selectedMachine,t.selectedMachine)})),Ex=n(870),Fx=n(266),Lx=n(407),Dx=function(e){var t=e.data,n=e.machines,a=e.currency,i=Object(r.useRef)(null),o=.15,c=401,l=Object(r.useMemo)((function(){return{top:25,right:.5,bottom:27,left:36.5}}),[]),s=cx.a(n),d=gn.a(n)>=5?s:B.a((function(e){return P.a(s[e])?{code:"ghostMachine".concat(e),display:""}:s[e]}),Pd.a(Bd.a,5)),u=Zl.a((function(e,n){return e[n.code]=M.a((function(e){return e.deviceId===n.code}),t),e}),{},d),m=Ex.a((function(e,t){return t[1]-e[1]}),B.a((function(e){return[e.code,(t=e.code,Zl.a((function(e,t){return e+vl()(t.fiat).toNumber()}),0,u[t]))];var t}),d)),h=Fx.a(5,m),b=Cl.a(B.a((function(e){return[e[0],(t=e[0],Zl.a((function(e,t){return"cashIn"===t.txClass&&(e.cashIn+=vl()(t.fiat).toNumber()),"cashOut"===t.txClass&&(e.cashOut+=vl()(t.fiat).toNumber()),e}),{cashIn:0,cashOut:0},u[t]))];var t}),h)),p=Cs.scaleBand().domain(h).range([l.left,1163-l.right]).paddingInner(o),j=Cs.scaleLinear().domain([0,0!==Cs.max(h,(function(e){return e[1]}))?Cs.max(h,(function(e){return e[1]})):50]).range([c-l.bottom,l.top]),f=Object(r.useCallback)((function(e){return e.attr("class","x-axis-1").attr("transform","translate(0, ".concat(c-l.bottom,")")).call(Cs.axisBottom(p).tickFormat((function(e){var t;return"".concat(null!==(t=Tr.a((function(t){return t.code===e[0]}),d).display)&&void 0!==t?t:"")})).tickSize(0).tickPadding(10))}),[l,p,d]),g=Object(r.useCallback)((function(e){e.attr("class","x-axis-2").attr("transform","translate(0, ".concat(c-l.bottom,")")).call(Cs.axisBottom(p).tickFormat((function(e){return F.a("ghostMachine",e[0])?"":"".concat(e[1].toFixed(2)," ").concat(a)})).tickSize(0).tickPadding(10))}),[l,p,a]),O=Object(r.useCallback)((function(){Cs.selectAll(".x-axis-1 .tick text").attr("transform",(function(e){var t=(p.range()[1]-p.range()[0])/5;return"translate(".concat(-t/2.25+this.getBBox().width/2,", 0)")}))}),[p]),x=Object(r.useCallback)((function(){Cs.selectAll(".x-axis-2 .tick text").attr("transform",(function(e){var t=(p.range()[1]-p.range()[0])/5;return"translate(".concat(t/2.25-this.getBBox().width/2,", 0)")}))}),[p]),v=Object(r.useCallback)((function(e){return e.attr("transform","translate(".concat(l.left,", 0)")).call(Cs.axisLeft(j).ticks(4.01).tickSize(0).tickFormat("")).call((function(e){return e.select(".domain").remove()}))}),[l,j]),y=Object(r.useCallback)((function(){return Cs.selectAll(".tick text").style("stroke",le).style("fill",le).style("stroke-width",.5).style("font-family",je)}),[]),w=Object(r.useCallback)((function(e){e.attr("stroke",ie).attr("fill",ie).call((function(e){return e.append("g").selectAll("line").data(Lx.a(p.domain())).join("line").attr("x1",(function(e){var t=Ko.a((function(t){return Ms.a(t,e)}),p.domain()),n=.075*(p(p.domain()[t])-p(p.domain()[t-1]));return.5+p(e)-n})).attr("x2",(function(e){var t=Ko.a((function(t){return Ms.a(t,e)}),p.domain()),n=.075*(p(p.domain()[t])-p(p.domain()[t-1]));return.5+p(e)-n})).attr("y1",l.top).attr("y2",c-l.bottom)}))}),[l,p]),C=Object(r.useCallback)((function(e){e.selectAll("rect").data(Sl.a(b)).join("rect").attr("fill",_).attr("x",(function(e){return p([e[0],e[1].cashIn+e[1].cashOut])})).attr("y",(function(e){return j(e[1].cashIn)-l.top+l.bottom})).attr("height",(function(e){return wx.a(0,c,c-j(e[1].cashIn)-l.bottom-10)})).attr("width",p.bandwidth()).attr("rx",2.5)}),[b,p,j,l]),k=Object(r.useCallback)((function(e){e.selectAll("rect").data(Sl.a(b)).join("rect").attr("fill",K).attr("x",(function(e){return p([e[0],e[1].cashIn+e[1].cashOut])})).attr("y",(function(e){return j(e[1].cashIn+e[1].cashOut)-l.top+l.bottom})).attr("height",(function(e){return wx.a(0,c,c-j(e[1].cashOut)-l.bottom-5)})).attr("width",p.bandwidth()).attr("rx",2.5)}),[b,p,j,l]),S=Object(r.useCallback)((function(){var e=Cs.select(i.current).attr("viewBox",[0,0,1163,c]);return e.append("g").call(f),e.append("g").call(g),e.append("g").call(v),e.append("g").call(y),e.append("g").call(w),e.append("g").call(C),e.append("g").call(k),e.append("g").call(O),e.append("g").call(x),e.node()}),[f,g,O,x,v,y,w,C,k]);return Object(r.useEffect)((function(){Cs.select(i.current).selectAll("*").remove(),S()}),[S]),Object(Me.jsx)("svg",{ref:i})},Px=Object(r.memo)(Dx,(function(e,t){return Ms.a(e.period,t.period)})),Bx=function(e){var t=e.data,n=e.representing,a=e.period,i=e.timezone,o=e.currency,l=e.selectedMachine,s=e.machines,d=e.selectedDay,u=Object(r.useState)(null),m=Object(c.a)(u,2),h=m[0],b=m[1],p=Object(r.useState)(null),j=Object(c.a)(p,2),f=j[0],g=j[1],O=Object(r.useState)(null),x=Object(c.a)(O,2),v=x[0],y=x[1];return Object(Me.jsxs)("div",{children:[!P.a(h)&&Object(Me.jsx)(xx,{coords:h,dateInterval:f,data:v,period:a,currency:o,timezone:i,representing:n}),function(e){switch(e.code){case"overTime":return Object(Me.jsx)(Ix,{data:t,period:a,timezone:i,setSelectionCoords:b,setSelectionDateInterval:g,setSelectionData:y,selectedMachine:l});case"topMachinesVolume":case"topMachinesTransactions":return Object(Me.jsx)(Px,{data:t,period:a,timezone:i,setSelectionCoords:b,setSelectionDateInterval:g,setSelectionData:y,selectedMachine:l,machines:M.a((function(e){return"all"!==e.code}),s),currency:o});case"hourOfDayVolume":case"hourOfDayTransactions":return Object(Me.jsx)(kx,{data:t,period:a,timezone:i,setSelectionCoords:b,setSelectionDateInterval:g,setSelectionData:y,selectedMachine:l,machines:M.a((function(e){return"all"!==e.code}),s),currency:o,selectedDay:d});default:throw new Error("There's no graph to represent ".concat(e))}}(n)]})},Rx=Object(r.memo)(Bx),Ax=Object(j.a)(mx),Tx=[{code:"hourOfDayTransactions",display:"Transactions"},{code:"hourOfDayVolume",display:"Volume"}],Mx=B.a((function(e){return{code:jx.a(e),display:e}}),Array.from(Array(7)).map((function(e,t){return Object(js.a)("EEEE",Object(Rs.a)({days:t},Object(px.a)(new Date)))}))),Wx=function(e){var t=e.title,n=e.period,a=e.data,i=e.machines,o=e.selectedMachine,l=e.handleMachineChange,s=e.timezone,d=e.currency,u=Ax(),m=Object(r.useState)(Tx[0].code),h=Object(c.a)(m,2),b=h[0],p=h[1],j=Object(r.useState)(Mx[0]),f=Object(c.a)(j,2),g=f[0],O=f[1],x={cashIn:Object(Me.jsx)("div",{className:u.cashInIcon}),cashOut:Object(Me.jsx)("div",{className:u.cashOutIcon})},v=Object(Nf.a)(s),y=Zl.a((function(e,t){var n=new Date(t.created);switch(n.setTime(n.getTime()+n.getTimezoneOffset()*lx+v),n.getDay()){case 0:e.sunday.push(t);break;case 1:e.monday.push(t);break;case 2:e.tuesday.push(t);break;case 3:e.wednesday.push(t);break;case 4:e.thursday.push(t);break;case 5:e.friday.push(t);break;case 6:e.saturday.push(t);break;default:throw new Error("Day of week not recognized")}return e}),Cl.a(B.a((function(e){return[e.code,[]]}),Mx)),a);return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)("div",{className:u.graphHeaderWrapper,children:[Object(Me.jsxs)("div",{className:u.graphHeaderLeft,children:[Object(Me.jsx)(He,{noMargin:!0,children:t}),Object(Me.jsxs)(Po.a,{className:u.graphLegend,children:[Object(Me.jsx)(bx,{IconElement:x.cashIn,label:"Cash-in"}),Object(Me.jsx)(bx,{IconElement:x.cashOut,label:"Cash-out"})]})]}),Object(Me.jsxs)("div",{className:u.graphHeaderRight,children:[Object(Me.jsx)(xa,{options:Tx,className:u.topMachinesRadio,value:b,onChange:function(e){return p(e.target.value)}}),Object(Me.jsx)(um,{label:"Day of the week",items:Mx,default:Mx[0],selectedItem:g,onSelectedItemChange:O}),Object(Me.jsx)(um,{label:"Machines",onSelectedItemChange:l,items:i,default:i[0],selectedItem:o})]})]}),Object(Me.jsx)(Rx,{representing:Tr.a((function(e){return e.code===b}))(Tx),period:n,data:y[g.code],timezone:s,currency:d,selectedMachine:o,machines:i,selectedDay:g})]})},zx=Object(j.a)(mx),$x=function(e){var t=e.title,n=e.representing,r=e.period,a=e.data,i=e.machines,o=e.selectedMachine,c=e.handleMachineChange,l=e.timezone,s=e.currency,d=zx(),u={cashIn:Object(Me.jsx)("div",{className:d.cashInIcon}),cashOut:Object(Me.jsx)("div",{className:d.cashOutIcon}),transaction:Object(Me.jsx)("div",{className:d.txIcon}),average:Object(Me.jsx)("svg",{height:"12",width:"18",children:Object(Me.jsx)("path",{stroke:J,strokeWidth:"3",strokeDasharray:"5, 2",d:"M 5 6 l 20 0"})})};return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)("div",{className:d.graphHeaderWrapper,children:[Object(Me.jsxs)("div",{className:d.graphHeaderLeft,children:[Object(Me.jsx)(He,{noMargin:!0,children:t}),Object(Me.jsxs)(Po.a,{className:d.graphLegend,children:[Object(Me.jsx)(bx,{IconElement:u.cashIn,label:"Cash-in"}),Object(Me.jsx)(bx,{IconElement:u.cashOut,label:"Cash-out"}),Object(Me.jsx)(bx,{IconElement:u.transaction,label:"One transaction"}),Object(Me.jsx)(bx,{IconElement:u.average,label:"Average"})]})]}),Object(Me.jsx)("div",{className:d.graphHeaderRight,children:Object(Me.jsx)(um,{label:"Machines",onSelectedItemChange:c,items:i,default:i[0],selectedItem:o})})]}),Object(Me.jsx)(Rx,{representing:n,period:r,data:a,timezone:l,currency:s,selectedMachine:o,machines:i})]})},qx=Object(j.a)(mx),Hx=[{code:"topMachinesTransactions",display:"Transactions"},{code:"topMachinesVolume",display:"Volume"}],Vx=function(e){var t=e.title,n=e.period,a=e.data,i=e.machines,o=e.selectedMachine,l=e.timezone,s=e.currency,d=qx(),u=Object(r.useState)(Hx[0].code),m=Object(c.a)(u,2),h=m[0],b=m[1],p={cashIn:Object(Me.jsx)("div",{className:d.cashInIcon}),cashOut:Object(Me.jsx)("div",{className:d.cashOutIcon})};return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)("div",{className:d.graphHeaderWrapper,children:[Object(Me.jsxs)("div",{className:d.graphHeaderLeft,children:[Object(Me.jsx)(He,{noMargin:!0,children:t}),Object(Me.jsxs)(Po.a,{className:d.graphLegend,children:[Object(Me.jsx)(bx,{IconElement:p.cashIn,label:"Cash-in"}),Object(Me.jsx)(bx,{IconElement:p.cashOut,label:"Cash-out"})]})]}),Object(Me.jsx)("div",{className:d.graphHeaderRight,children:Object(Me.jsx)(xa,{options:Hx,className:d.topMachinesRadio,value:h,onChange:function(e){return b(e.target.value)}})})]}),Object(Me.jsx)(Rx,{representing:Tr.a(W.a("code",h),Hx),period:n,data:a,timezone:l,currency:s,selectedMachine:o,machines:i})]})},Ux=Object(j.a)(mx),Gx=[{code:"all",display:"All machines"}],Xx=[{code:"overTime",display:"Over time"},{code:"topMachines",display:"Top Machines"},{code:"hourOfTheDay",display:"Hour of the day"}],_x=[{code:"day",display:"Last 24 hours"},{code:"week",display:"Last 7 days"},{code:"month",display:"Last 30 days"}],Kx={day:sx,week:dx,month:ux},Zx=x()(KO||(KO=Object(l.a)(["\n query transactions($limit: Int, $from: Date, $until: Date) {\n transactions(limit: $limit, from: $from, until: $until) {\n id\n txClass\n txHash\n toAddress\n commissionPercentage\n expired\n machineName\n operatorCompleted\n sendConfirmed\n dispense\n hasError: error\n deviceId\n fiat\n cashInFee\n fiatCode\n cryptoAtoms\n cryptoCode\n toAddress\n created\n }\n }\n"]))),Yx=x()(ZO||(ZO=Object(l.a)(["\n query getData {\n config\n machines {\n name\n deviceId\n }\n fiatRates {\n code\n name\n rate\n }\n }\n"]))),Qx=function(e){var t,n=e.label,r=e.value,a=e.oldValue,i=e.currency,o=Ux(),c=100*(r-a)/(!a||Ms.a(a,0)?1:a),l=(t={},Object(z.a)(t,o.growthPercentage,!0),Object(z.a)(t,o.growth,du.a(r,a)),Object(z.a)(t,o.decline,du.a(a,r)),t);return Object(Me.jsxs)("div",{className:o.overviewEntry,children:[Object(Me.jsx)(Xe,{noMargin:!0,children:n}),Object(Me.jsxs)(Ke,{noMargin:!0,className:o.overviewFieldWrapper,children:[Object(Me.jsx)("span",{children:r.toLocaleString("en-US",{maximumFractionDigits:2})}),!!i&&" ".concat(i)]}),Object(Me.jsxs)("span",{className:o.overviewGrowth,children:[du.a(c,0)&&Object(Me.jsx)(hs,{height:10}),ox.a(c,0)&&Object(Me.jsx)(ns,{height:10}),Ms.a(c,0)&&Object(Me.jsx)(cs,{height:10}),Object(Me.jsxs)(Xe,{noMargin:!0,className:E()(l),children:[c.toLocaleString("en-US",{maximumFractionDigits:2}),"%"]})]})]})},Jx=function(){var e,t,n,a,i,o=Ux(),l=Object(u.c)(Zx),d=l.data,m=l.loading,h=Object(u.c)(Yx),b=h.data,p=h.loading,j=Object(r.useState)(Xx[0]),f=Object(c.a)(j,2),g=f[0],O=f[1],x=Object(r.useState)(_x[0]),v=Object(c.a)(x,2),y=v[0],w=v[1],C=Object(r.useState)(Gx[0]),k=Object(c.a)(C,2),S=k[0],N=k[1],I=m||p,E=null!==(e=T.a(["transactions"])(d))&&void 0!==e?e:[],F=null!==(t=T.a(["machines"])(b))&&void 0!==t?t:[],L=null!==(n=T.a(["config"])(b))&&void 0!==n?n:[],D=null!==(a=T.a(["fiatRates"])(b))&&void 0!==a?a:[],P=$l("locale")(L).fiatCurrency,R=null===L||void 0===L?void 0:L.locale_timezone,A=function(e){if(e.fiatCode===P)return e;var t=Tr.a(W.a("code",e.fiatCode))(D),n=Tr.a(W.a("code",P))(D),r=(null===n||void 0===n?void 0:n.rate)/(null===t||void 0===t?void 0:t.rate);return Object(s.a)(Object(s.a)({},e),{},{fiat:parseFloat(e.fiat)*r})},z=null!==(i=B.a(A)(null===E||void 0===E?void 0:E.filter((function(e){return(!e.dispensed||!e.expired)&&(e.sendConfirmed||e.dispense)}))))&&void 0!==i?i:[],$=cx.a(Gx);th.a((function(e){return $.push({code:e.deviceId,display:e.name})}),F);var q=M.a((function(e){return"all"===S.code||e.deviceId===S.code}),z),H=function(e){var t,n;return{current:null!==(t=q.filter((function(t){return new Date(t.created)>=Date.now()-Kx[e]})))&&void 0!==t?t:[],previous:null!==(n=q.filter((function(t){return new Date(t.created)<Date.now()-Kx[e]&&new Date(t.created)>=Date.now()-2*Kx[e]})))&&void 0!==n?n:[]}},V={current:H(y.code).current.length,previous:H(y.code).previous.length},U={current:Kl.a(B.a((function(e){return e.fiat}),H(y.code).current))/(0===V.current?1:V.current),previous:Kl.a(B.a((function(e){return e.fiat}),H(y.code).previous))/(0===V.previous?1:V.previous)},G={current:Kl.a(B.a((function(e){return e.fiat}),H(y.code).current)),previous:Kl.a(B.a((function(e){return e.fiat}),H(y.code).previous))},X={current:Kl.a(B.a((function(e){return e.fiat*e.commissionPercentage}),H(y.code).current)),previous:Kl.a(B.a((function(e){return e.fiat*e.commissionPercentage}),H(y.code).previous))};return!I&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Wo,{title:"Analytics",children:Object(Me.jsxs)(Po.a,{className:o.overviewLegend,children:[Object(Me.jsx)(bx,{IconComponent:hs,label:"Up since last period"}),Object(Me.jsx)(bx,{IconComponent:ns,label:"Down since last period"}),Object(Me.jsx)(bx,{IconComponent:cs,label:"Same since last period"})]})}),Object(Me.jsxs)("div",{className:o.dropdownsOverviewWrapper,children:[Object(Me.jsxs)("div",{className:o.dropdowns,children:[Object(Me.jsx)(um,{label:"Representing",onSelectedItemChange:O,items:Xx,default:Xx[0],selectedItem:g}),Object(Me.jsx)(um,{label:"Time period",onSelectedItemChange:w,items:_x,default:_x[0],selectedItem:y})]}),Object(Me.jsxs)("div",{className:o.overview,children:[Object(Me.jsx)(Qx,{label:"Transactions",value:V.current,oldValue:V.previous}),Object(Me.jsx)("div",{className:o.verticalLine}),Object(Me.jsx)(Qx,{label:"Avg. txn amount",value:U.current,oldValue:U.previous,currency:P}),Object(Me.jsx)("div",{className:o.verticalLine}),Object(Me.jsx)(Qx,{label:"Volume",value:G.current,oldValue:G.previous,currency:P}),Object(Me.jsx)("div",{className:o.verticalLine}),Object(Me.jsx)(Qx,{label:"Commissions",value:X.current,oldValue:X.previous,currency:P})]})]}),function(e){switch(e.code){case"overTime":return Object(Me.jsx)($x,{title:"Transactions over time",representing:e,period:y,data:B.a(A)(H(y.code).current),machines:$,selectedMachine:S,handleMachineChange:N,timezone:R,currency:P});case"topMachines":return Object(Me.jsx)(Vx,{title:"Transactions over time",representing:e,period:y,data:B.a(A)(H(y.code).current),machines:$,selectedMachine:S,handleMachineChange:N,timezone:R,currency:P});case"hourOfTheDay":return Object(Me.jsx)(Wx,{title:"Avg. transactions per hour of the day",representing:e,period:y,data:B.a(A)(H(y.code).current),machines:$,selectedMachine:S,handleMachineChange:N,timezone:R,currency:P});default:throw new Error("There's no graph info to represent ".concat(e))}}(g)]})},ev=n(873),tv={grid:{flex:1,height:"100%"},content:{display:"flex",flexDirection:"column",flex:1,marginLeft:48},footer:{margin:[["auto",0,24,"auto"]]},modalTitle:{margin:[["auto",0,8.5,"auto"]]},subtitle:{display:"flex",justifyContent:"space-between",alignItems:"center",flexDirection:"row"},white:{color:Z},deleteButton:{paddingLeft:13},addressRow:{marginLeft:8},error:{color:me}},nv=Object(j.a)(tv),rv=function(e){var t=e.onClose,n=e.selectedCoin,r=e.addToBlacklist,a=e.errorMsg,i=nv();return Object(Me.jsxs)(AO,{closeOnBackdropClick:!0,width:676,height:200,handleClose:t,open:!0,children:[Object(Me.jsx)(pn.d,{validateOnBlur:!1,validateOnChange:!1,initialValues:{address:""},validationSchema:xn.e({address:xn.g().trim().required("An address is required")}),onSubmit:function(e,t){var a=e.address,i=t.resetForm;!function(e){"BCH"!==n.code||e.startsWith("bitcoincash:")||(e="bitcoincash:"+e),r(n.code,e)}(a.trim()),i()},children:Object(Me.jsxs)(pn.c,{id:"address-form",children:[Object(Me.jsx)(Ve,{className:i.modalTitle,children:n.display?"Blacklist ".concat(jx.a(n.display)," address"):""}),Object(Me.jsx)("span",{className:i.error,children:a}),Object(Me.jsx)(pn.b,{name:"address",fullWidth:!0,autoComplete:"off",label:"Paste new address to blacklist here",placeholder:"ex: ".concat({BTC:"1ADwinnimZKGgQ3dpyfoUZvJh4p1UWSSpD",ETH:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F",LTC:"LPKvbjwV1Kaksktzkr7TMK3FQtQEEe6Wqa",DASH:"XqQ7gU8eM76rEfey726cJpT2RGKyJyBrcn",ZEC:"t1KGyyv24eL354C9gjveBGEe8Xz9UoPKvHR",BCH:"qrd6za97wm03lfyg82w0c9vqgc727rhemg5yd9k3dm"}[n.code]),component:Ua})]})}),Object(Me.jsx)("div",{className:i.footer,children:Object(Me.jsx)(Po.a,{display:"flex",justifyContent:"flex-end",children:Object(Me.jsx)(or,{type:"submit",form:"address-form",children:"Blacklist address"})})})]})};function av(){return(av=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function iv(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var ov=r.createElement("defs",null,r.createElement("circle",{id:"path-100",cx:80,cy:80,r:80}),r.createElement("rect",{id:"path-300",x:28,y:44,width:104,height:116,rx:4}),r.createElement("filter",{x:"-23.1%",y:"-20.7%",width:"146.2%",height:"141.4%",filterUnits:"objectBoundingBox",id:"filter-4"},r.createElement("feOffset",{dx:0,dy:0,in:"SourceAlpha",result:"shadowOffsetOuter1"}),r.createElement("feGaussianBlur",{stdDeviation:8,in:"shadowOffsetOuter1",result:"shadowBlurOuter1"}),r.createElement("feColorMatrix",{values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.08 0",type:"matrix",in:"shadowBlurOuter1"})),r.createElement("rect",{id:"path-5",x:37,y:66,width:84,height:8,rx:2}),r.createElement("mask",{id:"mask-6",maskContentUnits:"userSpaceOnUse",maskUnits:"objectBoundingBox",x:0,y:0,width:84,height:8,fill:"white"},r.createElement("use",{xlinkHref:"#path-5"})),r.createElement("rect",{id:"path-7",x:37,y:78,width:84,height:8,rx:2}),r.createElement("mask",{id:"mask-8",maskContentUnits:"userSpaceOnUse",maskUnits:"objectBoundingBox",x:0,y:0,width:84,height:8,fill:"white"},r.createElement("use",{xlinkHref:"#path-7"})),r.createElement("rect",{id:"path-9",x:37,y:90,width:84,height:8,rx:2}),r.createElement("mask",{id:"mask-10",maskContentUnits:"userSpaceOnUse",maskUnits:"objectBoundingBox",x:0,y:0,width:84,height:8,fill:"white"},r.createElement("use",{xlinkHref:"#path-9"})),r.createElement("rect",{id:"path-11",x:37,y:102,width:84,height:8,rx:2}),r.createElement("mask",{id:"mask-12",maskContentUnits:"userSpaceOnUse",maskUnits:"objectBoundingBox",x:0,y:0,width:84,height:8,fill:"white"},r.createElement("use",{xlinkHref:"#path-11"}))),cv=r.createElement("g",{id:"\\u21B3-v13a",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"transactions_v13a#1-(empty-table)",transform:"translate(-640.000000, -220.000000)"},r.createElement("g",{id:"Group-2",transform:"translate(640.000000, 220.000000)"},r.createElement("g",{id:"Rectangle"},r.createElement("mask",{id:"mask-200",fill:"white"},r.createElement("use",{xlinkHref:"#path-100"})),r.createElement("use",{id:"Mask",fill:"#EBEFFF",xlinkHref:"#path-100"}),r.createElement("g",{mask:"url(#mask-200)"},r.createElement("use",{fill:"black",fillOpacity:1,filter:"url(#filter-4)",xlinkHref:"#path-300"}),r.createElement("use",{fill:"#FFFFFF",fillRule:"evenodd",xlinkHref:"#path-300"}))),r.createElement("use",{id:"Rectangle",stroke:"#5F668A",mask:"url(#mask-6)",strokeDasharray:1,xlinkHref:"#path-5"}),r.createElement("use",{id:"Rectangle-Copy",stroke:"#5F668A",mask:"url(#mask-8)",strokeDasharray:1,xlinkHref:"#path-7"}),r.createElement("use",{id:"Rectangle-Copy-2",stroke:"#5F668A",mask:"url(#mask-10)",strokeDasharray:1,xlinkHref:"#path-9"}),r.createElement("use",{id:"Rectangle-Copy-3",stroke:"#5F668A",mask:"url(#mask-12)",strokeDasharray:1,xlinkHref:"#path-11"}),r.createElement("rect",{id:"Rectangle",fill:"#EBEFFF",x:37,y:56,width:84,height:6,rx:2}))));function lv(e,t){var n=e.title,a=e.titleId,i=iv(e,["title","titleId"]);return r.createElement("svg",av({width:"160px",height:"160px",viewBox:"0 0 160 160",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,ov,cv)}var sv,dv,uv,mv,hv,bv,pv,jv=r.forwardRef(lv),fv=(n.p,Object(j.a)({emptyTable:{width:"100%",display:"flex",flexDirection:"column",alignItems:"center",marginTop:52}})),gv=Object(r.memo)((function(e){var t=e.message,n=fv();return Object(Me.jsxs)("div",{className:n.emptyTable,children:[Object(Me.jsx)(jv,{}),Object(Me.jsx)(Ue,{children:t})]})})),Ov=Object(j.a)({table:{tableLayout:"fixed",borderCollapse:"separate",borderSpacing:"0 0"}}),xv=Object(r.memo)((function(e){var t=e.className,n=e.children,r=Object($.a)(e,["className","children"]),a=Ov();return Object(Me.jsx)("table",Object(s.a)(Object(s.a)({},r),{},{className:E()(a.table,t),children:n}))})),vv=Object(r.memo)((function(e){var t=e.children,n=Object($.a)(e,["children"]);return Object(Me.jsx)("tbody",Object(s.a)(Object(s.a)({},n),{},{children:t}))})),yv=Object(j.a)({td:{padding:[[0,24]]},alignRight:{textAlign:"right"}}),wv=Object(r.memo)((function(e){var t,n=e.colspan,r=e.rightAlign,a=e.className,i=e.children,o=Object($.a)(e,["colspan","rightAlign","className","children"]),c=yv(),l=(t={},Object(z.a)(t,c.td,!0),Object(z.a)(t,c.alignRight,r),t);return Object(Me.jsx)("td",Object(s.a)(Object(s.a)({colSpan:n,className:E()(l,a)},o),{},{children:i}))})),Cv=Object(r.memo)((function(e){var t=e.children,n=Object($.a)(e,["children"]);return Object(Me.jsx)("thead",Object(s.a)(Object(s.a)({},n),{},{children:t}))})),kv=Re.tl2,Sv=Object(j.a)({th:{extend:kv,backgroundColor:Le,height:Ie,textAlign:"left",color:Z,padding:"0 ".concat(24,"px")},alignRight:{textAlign:"right"}}),Nv=Object(r.memo)((function(e){var t,n=e.rightAlign,r=e.children,a=e.className,i=Object($.a)(e,["rightAlign","children","className"]),o=Sv(),c=(t={},Object(z.a)(t,o.th,!0),Object(z.a)(t,o.alignRight,n),t);return Object(Me.jsx)("th",Object(s.a)(Object(s.a)({},i),{},{className:E()(c,a),children:r}))})),Iv=Re.info2,Ev=Re.p,Fv=Object(j.a)({tr:{extend:Ev,padding:4,height:Ee,backgroundColor:"#ffffff"},lg:{extend:Iv,height:76},sm:{height:30},error:{backgroundColor:De},success:{backgroundColor:Pe}}),Lv=Object(r.memo)((function(e){var t,n=e.className,r=e.children,a=e.header,i=e.error,o=e.success,c=e.size,l=void 0===c?"sm":c,d=Object($.a)(e,["className","children","header","error","success","size"]),u=Fv(),m=(t={},Object(z.a)(t,u.tr,!a),Object(z.a)(t,u.sm,!a&&"sm"===l),Object(z.a)(t,u.lg,!a&&"lg"===l),Object(z.a)(t,u.error,i),Object(z.a)(t,u.success,o),t);return Object(Me.jsx)("tr",Object(s.a)(Object(s.a)({className:E()(m,n)},d),{},{children:r}))})),Dv=Object(j.a)(Oj),Pv=function(e){var t,n=e.id,r=e.elements,a=e.data,i=e.width,o=e.Details,c=e.expanded,l=e.expandRow,d=e.expWidth,u=e.expandable,m=e.onClick,h=e.size,b=Object($.a)(e,["id","elements","data","width","Details","expanded","expandRow","expWidth","expandable","onClick","size"]),p=Dv(),j=m||u,f=(t={},Object(z.a)(t,p.pointer,j),Object(z.a)(t,p.row,!0),Object(z.a)(t,p.expanded,c),t);return Object(Me.jsxs)("div",{className:p.rowWrapper,children:[Object(Me.jsx)("div",{className:E()(Object(z.a)({},p.before,c&&0!==n)),children:Object(Me.jsxs)(Bu,{size:h,className:E()(f),onClick:function(){u&&l(n,a),m&&m(a)},error:a.error,errorMessage:a.errorMessage,children:[r.map((function(e,t){var n=e.view,r=void 0===n?function(e){return null===e||void 0===e?void 0:e.toString()}:n,i=Object($.a)(e,["view"]);return Object(Me.jsx)(Lu,Object(s.a)(Object(s.a)({},i),{},{children:r(a)}),t)})),u&&Object(Me.jsx)(Lu,{width:d,textAlign:"center",children:Object(Me.jsxs)("button",{onClick:function(){return l(n,a)},className:p.expandButton,children:[c&&Object(Me.jsx)(Aj,{}),!c&&Object(Me.jsx)(kj,{})]})})]})}),u&&c&&Object(Me.jsx)("div",{className:p.after,children:Object(Me.jsx)(Bu,{className:E()(Object(z.a)({},p.expanded,c)),children:Object(Me.jsx)(Lu,{width:i,children:Object(Me.jsx)(o,{it:a,timezone:b.timezone})})})})]})},Bv=function(e){var t=e.elements,n=void 0===t?[]:t,a=e.data,i=void 0===a?[]:a,o=e.Details,l=(e.className,e.expandable),d=e.initialExpanded,u=e.onClick,m=e.loading,h=e.emptyText,b=e.rowSize,p=Object($.a)(e,["elements","data","Details","className","expandable","initialExpanded","onClick","loading","emptyText","rowSize"]),j=Object(r.useState)(d),f=Object(c.a)(j,2),g=f[0],O=f[1];Object(r.useEffect)((function(){return O(d)}),[d]);var x=L.a(Kl.a,B.a(R.a("width")))(n),v=1200-x,y=x+(l?v:0),w=Dv({width:y}),C=function(e,t){t.id?(k.clear(t.id),O(t.id===g?null:t.id)):(k.clear(e),O(e===g?null:e))},k=new gj.c({defaultHeight:58,fixedWidth:!0});function S(e){var t=e.index,r=e.key,a=e.parent,c=e.style;return Object(Me.jsx)(gj.b,{cache:k,columnIndex:0,parent:a,rowIndex:t,children:function(e){var r=e.registerChild;return Object(Me.jsx)("div",{ref:r,style:c,children:Object(Me.jsx)(Pv,{width:y,size:b,id:i[t].id?i[t].id:t,expWidth:v,elements:n,data:i[t],Details:o,expanded:i[t].id?i[t].id===g:t===g,expandRow:C,expandable:l,onClick:u,timezone:p.timezone})})}},r)}return Object(Me.jsx)(Po.a,{display:"flex",flex:"1",flexDirection:"column",children:Object(Me.jsxs)(Nu,{className:w.table,children:[Object(Me.jsxs)(Iu,{children:[n.map((function(e,t){var n=e.width,r=e.className,a=e.textAlign,i=e.header;return Object(Me.jsx)(Du,{width:n,className:r,textAlign:a,children:i},t)})),l&&Object(Me.jsx)(Du,{width:v})]}),Object(Me.jsxs)(Fu,{className:w.body,children:[m&&Object(Me.jsx)(Ue,{children:"Loading..."}),!m&&Wr.a(i)&&Object(Me.jsx)(gv,{message:h}),Object(Me.jsx)(gj.a,{disableWidth:!0,children:function(e){var t=e.height;return Object(Me.jsx)(gj.d,Object(s.a)(Object(s.a)({style:{overflow:"inherit",outline:"none"}},p),{},{height:m?0:t,width:y,rowCount:i.length,rowHeight:k.rowHeight,rowRenderer:S,overscanRowCount:5,deferredMeasurementCache:k}))}})]})]})})},Rv=Object(j.a)(tv),Av=function(e){var t=e.data,n=e.selectedCoin,a=e.handleDeleteEntry,i=e.errorMessage,o=e.setErrorMessage,l=e.deleteDialog,s=e.setDeleteDialog,d=Rv(),u=Object(r.useState)(),m=Object(c.a)(u,2),h=m[0],b=m[1],p=[{name:"address",header:Object(Me.jsx)(et,{className:d.white,children:"Addresses"}),width:800,textAlign:"left",size:"sm",view:function(e){return Object(Me.jsx)("div",{className:d.addressRow,children:Object(Me.jsx)(Pb,{children:T.a(["address"],e)})})}},{name:"deleteButton",header:Object(Me.jsx)(et,{className:d.white,children:"Delete"}),width:130,textAlign:"center",size:"sm",view:function(e){return Object(Me.jsx)(tr,{className:d.deleteButton,onClick:function(){s(!0),b(e)},children:Object(Me.jsx)(wm,{})})}}],j=n?t[n.code]:t[yl.a(t)[0]];return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Bv,{data:j,elements:p,emptyText:"No blacklisted addresses so far",name:"blacklistTable"}),Object(Me.jsx)(Qu,{open:l,onDismissed:function(){s(!1),o(null)},onConfirmed:function(){o(null),a(T.a(["cryptoCode"],h),T.a(["address"],h))},errorMessage:i})]})},Tv=Object(j.a)(tv),Mv=ev.a((function(e){return e.cryptoCode})),Wv=x()(sv||(sv=Object(l.a)(["\n mutation DeleteBlacklistRow($cryptoCode: String!, $address: String!) {\n deleteBlacklistRow(cryptoCode: $cryptoCode, address: $address) {\n cryptoCode\n address\n }\n }\n"]))),zv=x()(dv||(dv=Object(l.a)(["\n query getBlacklistData {\n blacklist {\n cryptoCode\n address\n }\n cryptoCurrencies {\n display\n code\n }\n }\n"]))),$v=x()(uv||(uv=Object(l.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),qv=x()(mv||(mv=Object(l.a)(["\n query getData {\n config\n }\n"]))),Hv=x()(hv||(hv=Object(l.a)(["\n mutation InsertBlacklistRow($cryptoCode: String!, $address: String!) {\n insertBlacklistRow(cryptoCode: $cryptoCode, address: $address) {\n cryptoCode\n address\n }\n }\n"]))),Vv=function(){var e,t,n,a=Object(u.c)(zv).data,i=Object(u.c)(qv).data,o=Object(r.useState)(!1),l=Object(c.a)(o,2),s=l[0],d=l[1],m=Object(r.useState)({code:"BTC",display:"Bitcoin"}),b=Object(c.a)(m,2),p=b[0],j=b[1],f=Object(r.useState)(null),g=Object(c.a)(f,2),O=g[0],x=g[1],v=Object(r.useState)(!1),y=Object(c.a)(v,2),w=y[0],C=y[1],k=Object(u.b)(Wv,{onError:function(e){var t=e.message;x(null!==t&&void 0!==t?t:"Error while deleting row")},onCompleted:function(){return C(!1)},refetchQueries:function(){return["getBlacklistData"]}}),S=Object(c.a)(k,1)[0],N=Object(u.b)(Hv,{onError:function(){return console.log("Error while adding row")},refetchQueries:function(){return["getBlacklistData"]}}),I=Object(c.a)(N,1)[0],E=Object(u.b)($v,{refetchQueries:function(){return["getData"]}}),F=Object(c.a)(E,1)[0],L=Tv(),D=null!==(e=T.a(["blacklist"])(a))&&void 0!==e?e:[],B=null!==(t=T.a(["cryptoCurrencies"],a))&&void 0!==t?t:[],R=Mv(D),A=(null===i||void 0===i?void 0:i.config)&&$l("compliance")(i.config),M=null!==(n=null===A||void 0===A?void 0:A.rejectAddressReuse)&&void 0!==n&&n,z=function(e,t){try{return!P.a(Tb.utils.parseUrl(e,"main",t))}catch(n){return!1}},$=function(){var e=Object(pc.a)(bc.a.mark((function e(t,n){var r,a;return bc.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(x(null),z(t,n)){e.next=4;break}return x("Invalid address"),e.abrupt("return");case 4:return e.next=6,I({variables:{cryptoCode:t,address:n}});case 6:if((r=e.sent).errors){e.next=9;break}return e.abrupt("return",d(!1));case 9:a=r.errors.some((function(e){return e.message.includes("duplicate")})),x(a?"This address is already being blocked":"Server error");case 11:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Wo,{title:"Blacklisted addresses",children:Object(Me.jsx)(Po.a,{display:"flex",justifyContent:"flex-end",children:Object(Me.jsx)(or,{color:"primary",onClick:function(){return d(!0)},children:"Blacklist new addresses"})})}),Object(Me.jsxs)(h.a,{container:!0,className:L.grid,children:[Object(Me.jsx)(di,{data:B,isSelected:W.a("code",p.code),displayName:function(e){return e.display},onClick:function(e){j({code:e.code,display:e.display})}}),Object(Me.jsxs)("div",{className:L.content,children:[Object(Me.jsxs)(Po.a,{display:"flex",justifyContent:"space-between",mb:3,children:[Object(Me.jsxs)(Ue,{noMargin:!0,className:L.subtitle,children:[p.display?"".concat(p.display," blacklisted addresses"):""," "]}),Object(Me.jsxs)(Po.a,{display:"flex",alignItems:"center",justifyContent:"flex-end",mr:"-5px",children:[Object(Me.jsx)(Xe,{children:"Reject reused addresses"}),Object(Me.jsx)(Ca,{checked:M,onChange:function(e){!function(e){var t=ql("compliance")(e);F({variables:{config:t}})}({rejectAddressReuse:e.target.checked})},value:M}),Object(Me.jsx)(tt,{children:M?"On":"Off"}),Object(Me.jsx)(ep,{width:304,children:Object(Me.jsx)(Xe,{children:'The "Reject reused addresses" option means that all addresses that are used once will be automatically rejected if there\'s an attempt to use them again on a new transaction.'})})]})]}),Object(Me.jsx)(Av,{data:R,selectedCoin:p,handleDeleteEntry:function(e,t){S({variables:{cryptoCode:e,address:t}})},errorMessage:O,setErrorMessage:x,deleteDialog:w,setDeleteDialog:C})]})]}),s&&Object(Me.jsx)(rv,{onClose:function(){x(null),d(!1)},errorMsg:O,selectedCoin:p,addToBlacklist:$})]})},Uv={logo:{maxHeight:80,maxWidth:200},subtitle:{margin:0,marginBottom:42,textAlign:"center"},text:{margin:0},button:{margin:[[0,"auto"]]},modalContent:{display:"flex",flexDirection:"column",justifyContent:"space-between",flex:1,padding:[[0,34,107,34]]},innerContent:{paddingBottom:72},title:{color:K,marginBottom:12,marginTop:30,textAlign:"center"},titleDecorator:{verticalAlign:"bottom",marginRight:12,width:24,height:26}},Gv=Object(j.a)(Uv),Xv=function(e){var t=e.name,n=e.onContinue,r=Gv();return Object(Me.jsxs)("div",{className:r.modalContent,children:[Object(Me.jsxs)("div",{className:r.innerContent,children:[Object(Me.jsxs)(qe,{className:r.title,children:[Object(Me.jsx)(gl,{className:r.titleDecorator}),Object(Me.jsx)("span",{children:"Enable cash-out"})]}),Object(Me.jsx)(Ke,{className:r.subtitle,children:t}),Object(Me.jsxs)(Xe,{children:["You are about to activate cash-out functionality on your ",t," ","machine which will allow your customers to sell crypto to you."]}),Object(Me.jsx)(Xe,{children:"In order to activate cash-out for this machine, please enter the denominations for the machine."})]}),Object(Me.jsx)(Tn,{className:r.button,onClick:n,children:"Start configuration"})]})},_v=n.p+"static/media/cashout-cassette-1.fac6c691.svg",Kv=n.p+"static/media/cashout-cassette-2.34a98cfa.svg",Zv=n.p+"static/media/3-cassettes-open-1-left.d6d9aa73.svg",Yv=n.p+"static/media/3-cassettes-open-2-left.a9ee8d4c.svg",Qv=n.p+"static/media/3-cassettes-open-3-left.08fed660.svg",Jv=n.p+"static/media/4-cassettes-open-1-left.7b00c51f.svg",ey=n.p+"static/media/4-cassettes-open-2-left.b3d9541c.svg",ty=n.p+"static/media/4-cassettes-open-3-left.e8f1667c.svg",ny=n.p+"static/media/4-cassettes-open-4-left.bc1a9829.svg",ry={title:{margin:[[0,0,12,0]]},titleDiv:{paddingBottom:32},subtitle:{margin:[[32,0,21,0]]},edit:{margin:[[0,0,0,0]]},error:{color:me},bill:{width:131,display:"flex",alignItems:"center",justifyContent:"end"},billInput:{width:"100%"},suffix:{paddingLeft:16},button:{marginLeft:"auto"},submit:{float:"right"},picker:{width:150},header:{display:"flex",marginBottom:95},thirdStepHeader:{display:"flex",paddingBottom:188},step:{flex:1},stepImage:{position:"relative",top:-20,right:14},content:{display:"flex",flexDirection:"column",justifyContent:"space-between",flex:1,paddingBottom:32},disclaimer:{display:"flex",flex:1,flexDirection:"column",justifyContent:"space-between"},disclaimerIcon:{float:"left",margin:[[-4,16,48,0]]}},ay=Object(j.a)(ry),iy=function(e){var t=e.name,n=e.step,r=e.schema,a=e.error,i=e.lastStep,o=e.onContinue,c=e.steps,l=e.fiatCurrency,s=e.options,d=e.numberOfCassettes,u=ay(),m=i?"Finish":"Next";return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)("div",{className:u.titleDiv,children:[Object(Me.jsx)(Ke,{className:u.title,children:t}),Object(Me.jsx)(GO,{steps:c.length+1,currentStep:n})]}),n<=d&&Object(Me.jsx)(pn.d,{validateOnBlur:!1,validateOnChange:!1,onSubmit:o,initialValues:{cassette1:"",cassette2:"",cassette3:"",cassette4:""},enableReinitialize:!0,validationSchema:r,children:Object(Me.jsxs)(pn.c,{children:[Object(Me.jsxs)("div",{className:u.header,children:[c.map((function(e,t){var r=e.type,a=e.display,i=e.component;return 1+t===n&&Object(Me.jsxs)("div",{className:u.step,children:[Object(Me.jsxs)(Ue,{className:u.edit,children:["Edit ",a]}),Object(Me.jsx)(et,{children:"Choose bill denomination"}),Object(Me.jsxs)("div",{className:u.bill,children:[Object(Me.jsx)(pn.b,{className:u.billInput,type:"text",size:"lg",autoFocus:1+t===n,component:(null===s||void 0===s?void 0:s.length)>0?i:qa,fullWidth:!0,decimalPlaces:0,name:r,options:s,valueProp:"code",labelProp:"display"}),Object(Me.jsx)(_e,{noMargin:!0,className:u.suffix,children:l})]})]},t)})),Object(Me.jsx)("img",{className:u.stepImage,alt:"cassette",width:"148",height:"205",src:{2:{1:_v,2:Kv},3:{1:Zv,2:Yv,3:Qv},4:{1:Jv,2:ey,3:ty,4:ny}}[d][n]})]}),Object(Me.jsx)(Tn,{className:u.submit,type:"submit",children:m})]})}),n===d+1&&Object(Me.jsx)(pn.d,{validateOnBlur:!1,validateOnChange:!1,onSubmit:o,initialValues:{zeroConfLimit:""},enableReinitialize:!0,validationSchema:c[n-1].schema,children:Object(Me.jsxs)(pn.c,{children:[Object(Me.jsx)("div",{className:u.thirdStepHeader,children:Object(Me.jsxs)("div",{className:u.step,children:[Object(Me.jsx)(Ue,{className:u.edit,children:"Edit 0-conf Limit"}),Object(Me.jsx)(et,{children:"Choose a limit"}),Object(Me.jsxs)("div",{className:u.bill,children:[Object(Me.jsx)(pn.b,{className:u.billInput,type:"text",size:"lg",autoFocus:!0,component:qa,fullWidth:!0,decimalPlaces:0,name:c[n-1].type}),Object(Me.jsx)(_e,{noMargin:!0,className:u.suffix,children:l})]})]})}),Object(Me.jsx)(Tn,{className:u.submit,type:"submit",children:m})]})}),i&&Object(Me.jsxs)("div",{className:u.disclaimer,children:[Object(Me.jsx)(Ke,{className:u.title,children:"Cash-out Bill Count"}),Object(Me.jsxs)(Xe,{children:[Object(Me.jsx)(ia,{className:u.disclaimerIcon}),"When enabling cash-out, your bill count will be automatically set to zero. Make sure you physically put cash inside the cash cassettes to allow the machine to dispense it to your users. If you already did, make sure you set the correct cash-out bill count for this machine on your Cash Cassettes tab under Maintenance."]}),Object(Me.jsx)(Ke,{className:u.title,children:"Default Commissions"}),Object(Me.jsxs)(Xe,{children:[Object(Me.jsx)(ia,{className:u.disclaimerIcon}),"When enabling cash-out, default commissions will be set. To change commissions for this machine, please go to the Commissions tab under Settings where you can set exceptions for each of the available cryptocurrencies."]}),Object(Me.jsxs)("div",{children:[a&&Object(Me.jsx)(Ao,{children:"Failed to save"}),Object(Me.jsx)(Tn,{className:u.submit,onClick:function(){return o()},children:m})]})]})]})},oy=xn.e().shape({cassette1:xn.d().label("Cassette 1").required().min(1).max(nf),cassette2:xn.d().label("Cassette 2").required().min(1).max(nf),cassette3:xn.d().label("Cassette 3").min(1).max(nf).nullable().transform($f),cassette4:xn.d().label("Cassette 4").min(1).max(nf).nullable().transform($f),zeroConfLimit:xn.d().label("0-conf Limit").required().min(0).max(nf)}),cy=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=R.a("fiatCurrency")(t),a=Math.max.apply(Math,Object(d.a)(B.a((function(e){return e.numberOfCassettes}),e))),i=tf(t,ef),o=(null===i||void 0===i?void 0:i.length)>0?{options:i,labelProp:"display",valueProp:"code",className:n.autoComplete}:{decimalPlaces:0},c=[{name:"id",header:"Machine",width:300,view:function(t){return e.find((function(e){return e.deviceId===t})).name},size:"sm",editable:!1}];return su.a(du.a(uu.a,a),(function(t){return c.push({name:"cassette".concat(t),header:"Cassette ".concat(t),size:"sm",stripe:!0,textAlign:"right",width:(a>2?600:460)/a,suffix:r,bold:Vr,view:function(e){return e},input:(null===i||void 0===i?void 0:i.length)>0?ka:qa,inputProps:o,doubleHeader:"Denominations",isHidden:function(n){return t>e.find((function(e){return e.deviceId===n.id})).numberOfCassettes}}),mu.a(1,t)}),1),c.push({name:"zeroConfLimit",header:"0-conf Limit",size:"sm",stripe:!0,textAlign:"right",width:a>2?150:290,input:qa,inputProps:{decimalPlaces:0},suffix:r}),c},ly=function(e){var t=e.machine,n=e.locale,a=e.onClose,i=e.save,o=e.error,l=t.numberOfCassettes+2,s=Object(r.useState)({step:0,config:{active:!0}}),d=Object(c.a)(s,2),u=d[0],m=u.step,h=u.config,b=d[1],p=tf(n,ef),j=m===l,f=function(){var e=Object(pc.a)(bc.a.mark((function e(n){var r;return bc.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!j){e.next=2;break}return e.abrupt("return",i(ql(t.deviceId,oy.cast(h,{assert:!1}))));case 2:r=Gn.a(h,n),b({step:m+1,config:r});case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),g=[];su.a(du.a(uu.a,t.numberOfCassettes),(function(e){return g.push({type:"cassette".concat(e),display:"Cassette ".concat(e),component:ka,inputProps:{options:B.a((function(e){return{code:e,display:e}}))(p),labelProp:"display",valueProp:"code"}}),mu.a(1,e)}),1),g.push({type:"zeroConfLimit",display:"0-conf Limit",schema:xn.e().shape({zeroConfLimit:xn.d().required()})});return Object(Me.jsxs)(AO,{title:0===m?null:"Enable cash-out",handleClose:a,width:554,height:520,open:!0,children:[0===m&&Object(Me.jsx)(Xv,{name:t.name,onContinue:function(){return f()}}),0!==m&&Object(Me.jsx)(iy,{step:m,name:t.name,numberOfCassettes:t.numberOfCassettes,error:o,lastStep:j,steps:g,fiatCurrency:n.fiatCurrency,options:p,schema:xn.e().shape({cassette1:xn.d().required(),cassette2:t.numberOfCassettes>1&&m>=2?xn.d().required():xn.d().transform($f).nullable(),cassette3:t.numberOfCassettes>2&&m>=3?xn.d().required():xn.d().transform($f).nullable(),cassette4:t.numberOfCassettes>3&&m>=4?xn.d().required():xn.d().transform($f).nullable()}),onContinue:f})]})},sy=Object(j.a)({fudgeFactor:{display:"flex",alignItems:"center"},switchLabel:{margin:6,width:24},autoComplete:{width:"100%"}}),dy=x()(bv||(bv=Object(l.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),uy=x()(pv||(pv=Object(l.a)(["\n query getData {\n machines {\n name\n deviceId\n cashbox\n cassette1\n cassette2\n cassette3\n cassette4\n numberOfCassettes\n }\n config\n }\n"]))),my=function(e){var t,n,a=e.name,i=sy(),o=Object(r.useState)(!1),l=Object(c.a)(o,2),s=l[0],d=l[1],m=Object(u.c)(uy).data,h=Object(u.b)(dy,{onCompleted:function(){return d(!1)},refetchQueries:function(){return["getData"]}}),b=Object(c.a)(h,2),p=b[0],j=b[1].error,f=function(e,t){var n=ql(a)(e);return p({variables:{config:n,accounts:t}})},g=(null===m||void 0===m?void 0:m.config)&&$l(a)(m.config),O=null!==(t=null===g||void 0===g?void 0:g.fudgeFactorActive)&&void 0!==t&&t,x=(null===m||void 0===m?void 0:m.config)&&$l("locale")(m.config),v=null!==(n=null===m||void 0===m?void 0:m.machines)&&void 0!==n?n:[];return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Wo,{title:"Cash-out",children:Object(Me.jsxs)("div",{className:i.fudgeFactor,children:[Object(Me.jsx)(Xe,{children:"Transaction fudge factor"}),Object(Me.jsx)(Ca,{checked:O,onChange:function(e){f({fudgeFactorActive:e.target.checked})},value:O}),Object(Me.jsx)(tt,{className:i.switchLabel,children:O?"On":"Off"}),Object(Me.jsxs)(ep,{width:304,children:[Object(Me.jsx)(Xe,{children:"Automatically accept customer deposits as complete if their received amount is 100 crypto atoms or less."}),Object(Me.jsx)(Xe,{children:"(Crypto atoms are the smallest unit in each cryptocurrency. E.g., satoshis in Bitcoin, or wei in Ethereum.)"})]})]})}),Object(Me.jsx)(_m,{namespaces:B.a(T.a(["deviceId"]))(v),data:g,stripeWhen:function(e){return 1===L.a(gn.a,yl.a)(e)},enableEdit:!0,editWidth:134,enableToggle:!0,toggleWidth:109,onToggle:function(e){var t=$l(e)(g);if(!oy.isValidSync(t))return d(e);f(ql(e,{active:!(null===t||void 0===t?void 0:t.active)}))},save:f,error:null===j||void 0===j?void 0:j.message,validationSchema:oy,disableRowEdit:L.a(D.a,T.a(["active"])),elements:cy(v,x,i)}),Wr.a(v)&&Object(Me.jsx)(gv,{message:"No machines so far"}),s&&Object(Me.jsx)(ly,{machine:Tr.a(W.a("deviceId",s))(v),onClose:function(){return d(!1)},save:f,error:null===j||void 0===j?void 0:j.message,locale:x})]})},hy=n(877),by=n(878);function py(){return(py=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function jy(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var fy=r.createElement("desc",null,"Created with Sketch."),gy=r.createElement("g",{id:"icon/sf-small/listing/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("line",{x1:0,y1:1,x2:20,y2:1,id:"Path-4",stroke:"#FFFFFF",strokeWidth:2}),r.createElement("line",{x1:0,y1:7,x2:9,y2:7,id:"Path-4-Copy",stroke:"#FFFFFF",strokeWidth:2}),r.createElement("line",{x1:0,y1:13,x2:20,y2:13,id:"Path-4-Copy-2",stroke:"#FFFFFF",strokeWidth:2}),r.createElement("line",{x1:0,y1:19,x2:12,y2:19,id:"Path-4-Copy-3",stroke:"#FFFFFF",strokeWidth:2}));function Oy(e,t){var n=e.title,a=e.titleId,i=jy(e,["title","titleId"]);return r.createElement("svg",py({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,fy,gy)}var xy=r.forwardRef(Oy);n.p;function vy(){return(vy=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function yy(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var wy=r.createElement("desc",null,"Created with Sketch."),Cy=r.createElement("g",{id:"icon/sf-small/listing/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("line",{x1:0,y1:1,x2:20,y2:1,id:"Path-4",stroke:"#1B2559",strokeWidth:2}),r.createElement("line",{x1:0,y1:7,x2:9,y2:7,id:"Path-4-Copy",stroke:"#1B2559",strokeWidth:2}),r.createElement("line",{x1:0,y1:13,x2:20,y2:13,id:"Path-4-Copy-2",stroke:"#1B2559",strokeWidth:2}),r.createElement("line",{x1:0,y1:19,x2:12,y2:19,id:"Path-4-Copy-3",stroke:"#1B2559",strokeWidth:2}));function ky(e,t){var n=e.title,a=e.titleId,i=yy(e,["title","titleId"]);return r.createElement("svg",vy({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,wy,Cy)}var Sy=r.forwardRef(ky);n.p;function Ny(){return(Ny=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Iy(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Ey=r.createElement("rect",{width:12,height:12,rx:3,ry:3,fill:"#44e188"});function Fy(e,t){var n=e.title,a=e.titleId,i=Iy(e,["title","titleId"]);return r.createElement("svg",Ny({width:12,height:12,viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Ey)}var Ly,Dy,Py=r.forwardRef(Fy),By=(n.p,n(874)),Ry=n(914),Ay=Object(r.memo)((function(e){var t,n=e.config,a=e.locale,i=e.currency,o=e.data,l=e.error,s=e.save,d=e.saveOverrides,u=Object(r.useState)(!1),m=Object(c.a)(u,2),h=m[0],b=m[1],p=Object(r.useState)(!1),j=Object(c.a)(p,2),f=j[0],g=j[1],O=n&&!Wr.a(n)?n:ff,x=null!==(t=null===O||void 0===O?void 0:O.overrides)&&void 0!==t?t:[],v=fu.a([By.a(Of),By.a(R.a("machine"))])(x);return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Qf,{children:Object(Me.jsx)(Xm,{error:null===l||void 0===l?void 0:l.message,title:"Default setup",rowSize:"lg",titleLg:!0,name:"commissions",enableEdit:!0,initialValues:O,save:s,validationSchema:pf(a),data:Ry.a(O),elements:mf(i),setEditing:function(e,t){return b(t)},forceDisable:f})}),Object(Me.jsx)(Qf,{children:Object(Me.jsx)(Xm,{error:null===l||void 0===l?void 0:l.message,title:"Overrides",titleLg:!0,name:"overrides",enableDelete:!0,enableEdit:!0,enableCreate:!0,groupBy:Of,initialValues:gf,save:d,validationSchema:jf(v,o,a),data:v,elements:hf(o,i),setEditing:function(e,t){return g(t)},forceDisable:h})})]})})),Ty=n(875),My=n(876),Wy=n(894),zy={code:"SHOW_ALL",display:"Show all"},$y=[{code:"machine",display:"Machine Name"},{code:"cryptoCurrencies",display:"Cryptocurrency"},{code:"cashIn",display:"Cash-in"},{code:"cashOut",display:"Cash-out"},{code:"fixedFee",display:"Fixed Fee"},{code:"minimumTx",display:"Minimum Tx"}],qy=Object(j.a)({headerLine:{display:"flex",justifyContent:"",marginBottom:24},select:{marginRight:24},tableWrapper:{flex:1,display:"block",overflowY:"auto",width:"100%",maxHeight:"70vh"}}),Hy=function(e,t){return{code:e,display:t||e}},Vy=Object(r.memo)((function(e){var t,n=e.config,a=e.localeConfig,i=e.currency,o=e.data,l=e.error,s=e.saveOverrides,d=qy(),u=Object(r.useState)(zy),m=Object(c.a)(u,2),h=m[0],b=m[1],p=Object(r.useState)(zy),j=Object(c.a)(p,2),f=j[0],g=j[1],O=Object(r.useState)($y[0]),x=Object(c.a)(O,2),v=x[0],y=x[1],w=null!==(t=R.a("cryptoCurrencies",a))&&void 0!==t?t:[],C=B.a(Hy)(w),k=Ty.a(R.a("display"),B.a((function(e){return Hy(R.a("deviceId",e),R.a("name",e))}))(R.a("machines",o))),S=Wy.a(B.a((function(e){var t,n=null===(t=R.a("overrides",a))||void 0===t?void 0:t.find(W.a("machine",e)),r=n?R.a("cryptoCurrencies",n):w;return My.a([e],r)}))(k.map(R.a("code")))),N=B.a((function(e){var t=Object(c.a)(e,2),r=t[0];return function(e,t,n){var r,a=null!==(r=R.a("overrides",n))&&void 0!==r?r:[];if(!a&&Wr.a(a))return xf(e,t,!0,n);var i=Tr.a((function(n){return n.machine===t&&_j.includes(e)(n.cryptoCurrencies)}))(a);if(void 0!==i)return xf(e,t,!1,i);var o=Tr.a((function(e){return e.machine===t&&_j.includes("ALL_COINS")(e.cryptoCurrencies)}))(a);if(void 0!==o)return xf(e,t,!1,o);var c=Tr.a((function(t){return"ALL_MACHINES"===t.machine&&_j.includes(e)(t.cryptoCurrencies)}))(a);return void 0!==c?xf(e,t,!1,c):xf(e,t,!0,n)}(t[1],r,n)}))(S),I=L.a(function(e){switch(e){case $y[0]:return Ty.a(Tr.a(W.a("code",R.a("machine"))));case $y[1]:return Ty.a(T.a(["cryptoCurrencies",0]));default:return Ty.a(R.a(e.code))}}(v),function(e,t){return L.a(M.a((function(e){return t===zy|t.code===e.machine})),M.a((function(t){return e===zy|e.code===t.cryptoCurrencies[0]})))}(f,h))(N);return Object(Me.jsxs)("div",{children:[Object(Me.jsxs)("div",{className:d.headerLine,children:[Object(Me.jsx)(um,{className:d.select,onSelectedItemChange:b,label:"Machines",default:zy,items:[zy].concat(k),selectedItem:h}),Object(Me.jsx)(um,{className:d.select,onSelectedItemChange:g,label:"Cryptocurrency",default:zy,items:[zy].concat(C),selectedItem:f}),Object(Me.jsx)(um,{onSelectedItemChange:y,label:"Sort by",default:$y[0],items:$y,selectedItem:v})]}),Object(Me.jsx)("div",{className:d.tableWrapper,children:Object(Me.jsx)(Xm,{error:null===l||void 0===l?void 0:l.message,name:"comissionsList",enableEdit:!0,save:s,initialValues:gf,validationSchema:vf(a),data:I,elements:wf(o,i)})})]})})),Uy=Object(j.a)({listViewButton:{marginLeft:4}}),Gy=x()(Ly||(Ly=Object(l.a)(["\n query getData {\n config\n cryptoCurrencies {\n code\n display\n }\n machines {\n name\n deviceId\n }\n }\n"]))),Xy=x()(Dy||(Dy=Object(l.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),_y=function(e){var t,n=e.name,a=Uy(),i=Object(r.useState)(!1),o=Object(c.a)(i,2),l=o[0],s=o[1],d=Object(r.useState)(null),m=Object(c.a)(d,2),h=m[0],b=m[1],p=Object(u.c)(Gy),j=p.data,f=p.loading,g=Object(u.b)(Xy,{refetchQueries:function(){return["getData"]},onError:function(e){return b(e)}}),O=Object(c.a)(g,1)[0],x=(null===j||void 0===j?void 0:j.config)&&$l(n)(j.config),v=(null===j||void 0===j?void 0:j.config)&&$l(Dl)(j.config),y=R.a("fiatCurrency")(v),w=R.a("overrides")(x),C=l?[{label:"Override value",icon:Object(Me.jsx)(Py,{})}]:[];return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Wo,{title:"Commissions",labels:C,button:{text:"List view",icon:Sy,inverseIcon:xy,toggle:s},iconClassName:a.listViewButton}),!l&&!f&&Object(Me.jsx)(Ay,{config:x,locale:v,currency:y,data:j,error:h,save:function(e){var t=ql(n)(e.commissions[0]);return O({variables:{config:t}})},saveOverrides:function(e){var t=ql(n)(e);return b(null),O({variables:{config:t}})},classes:a}),l&&!f&&Object(Me.jsx)(Vy,{config:x,localeConfig:v,currency:y,data:j,error:h,saveOverrides:(t=w,function(e,n){var r,a=T.a(["cryptoCurrencies",0],n),i=$r.a("machine",n),o=M.a(Tf.a(i,(function(e){return!$r.a("cryptoCurrencies",n,e)}))),c=(r=a,function(e){return hy.a(e,{cryptoCurrencies:by.a([r],e.cryptoCurrencies)})}),l=B.a(c)(o(t)).concat(M.a((function(e){return!i(e)}),t)),s={commissions_overrides:pu.a(n,l)};return O({variables:{config:s}})})})]})},Ky=n(880);function Zy(){return(Zy=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Yy(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Qy=r.createElement("desc",null,"Created with Sketch."),Jy=r.createElement("g",{id:"icon/button/authorize/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("circle",{id:"Oval",stroke:"#FFFFFF",cx:6,cy:6,r:5}),r.createElement("polyline",{id:"Stroke-13",stroke:"#FFFFFF",strokeLinecap:"round",strokeLinejoin:"round",points:"4 6.66666667 5 8 8 4"}));function ew(e,t){var n=e.title,a=e.titleId,i=Yy(e,["title","titleId"]);return r.createElement("svg",Zy({viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Qy,Jy)}var tw=r.forwardRef(ew);n.p;function nw(){return(nw=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function rw(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var aw=r.createElement("desc",null,"Created with Sketch."),iw=r.createElement("g",{id:"icon/button/authorize/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"Group-9",stroke:"#1B2559"},r.createElement("circle",{id:"Oval",cx:6,cy:6,r:5})),r.createElement("polyline",{id:"Stroke-13",stroke:"#1B2559",strokeLinecap:"round",strokeLinejoin:"round",points:"4 6.66666667 5 8 8 4"}));function ow(e,t){var n=e.title,a=e.titleId,i=rw(e,["title","titleId"]);return r.createElement("svg",nw({viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,aw,iw)}var cw=r.forwardRef(ow),lw=(n.p,{label1:{display:"flex",marginBottom:2,marginTop:"auto",width:85},label1Pending:{color:q},label1Rejected:{color:Y},label1Accepted:{color:U},cardActionButton:{display:"flex",height:28,marginRight:"auto",marginLeft:12},propertyCardTopRow:{display:"flex",margin:[[0,10,5,0]]},propertyCardBottomRow:{display:"flex",flexDirection:"row",height:45},propertyCard:{display:"flex",flexDirection:"column",borderRadius:8,width:"100%",height:100,padding:[[20]],boxSizing:"border-box",boxShadow:"0 0 8px 0 rgba(0, 0, 0, 0.04)",border:"solid 0",backgroundColor:Z,margin:[[20,0,0,0]]},rowSpaceBetween:{display:"flex",flexFlow:"row nowrap",alignItems:"center",justifyContent:"space-between"},columnSpaceBetween:{display:"flex",flexFlow:"column nowrap",alignItems:"center",justifyContent:"space-between",width:90},buttonsWrapper:{display:"flex",flexDirection:"row",justifyContent:"flex-end",marginLeft:"auto",marginTop:"auto"}}),sw=(Object(j.a)(lw),"automatic"),dw="verified",uw="blocked";function mw(){return(mw=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function hw(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var bw=r.createElement("desc",null,"Created with Sketch."),pw=r.createElement("g",{id:"icon/button/block/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("g",{id:"Group-5",stroke:"#FFFFFF"},r.createElement("circle",{id:"Oval",cx:6,cy:6,r:5}),r.createElement("line",{x1:9,y1:3,x2:3,y2:9,id:"Stroke-3"})));function jw(e,t){var n=e.title,a=e.titleId,i=hw(e,["title","titleId"]);return r.createElement("svg",mw({viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,bw,pw)}var fw=r.forwardRef(jw);n.p;function gw(){return(gw=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Ow(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var xw=r.createElement("desc",null,"Created with Sketch."),vw=r.createElement("g",{id:"icon/button/block/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("g",{id:"Group-5",stroke:"#1B2559"},r.createElement("circle",{id:"Oval",cx:6,cy:6,r:5}),r.createElement("line",{x1:9,y1:3,x2:3,y2:9,id:"Stroke-3"})));function yw(e,t){var n=e.title,a=e.titleId,i=Ow(e,["title","titleId"]);return r.createElement("svg",gw({viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,xw,vw)}var ww=r.forwardRef(yw);n.p;function Cw(){return(Cw=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function kw(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Sw=r.createElement("g",{id:"icon/button/data/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"Data-icon---small",transform:"translate(0.500000, 0.500000)",stroke:"#FFFFFF"},r.createElement("path",{d:"M11,2.44444444 L11,5.5 C11,6.85002939 8.53756612,7.94444444 5.5,7.94444444 C2.521994,7.94444444 0.0939612041,6.81341452 1.11160464e-12,5.5 L0.00282594991,2.44444444",id:"oval-3"}),r.createElement("path",{d:"M11,5.5 L11,8.55555556 C11,9.90558494 8.53756612,11 5.5,11 C2.521994,11 0.0939612041,9.86897007 1.11160464e-12,8.55555556 L0.00282594991,5.5",id:"oval-2"}),r.createElement("ellipse",{id:"oval-1",cx:5.5,cy:2.44444444,rx:5.5,ry:2.44444444})),r.createElement("g",{id:"Group-9",transform:"translate(0.000000, 4.000000)"},r.createElement("circle",{id:"Oval",stroke:"#FFFFFF",fill:"#5F668A",cx:4,cy:4,r:3.5}),r.createElement("polygon",{id:"Path",fill:"#FFFFFF",fillRule:"nonzero",points:"4.33333333 3.66666667 6 3.66666667 6 4.33333333 4.33333333 4.33333333 4.33333333 6 3.66666667 6 3.66666667 4.33333333 2 4.33333333 2 3.66666667 3.66666667 3.66666667 3.66666667 2 4.33333333 2"})));function Nw(e,t){var n=e.title,a=e.titleId,i=kw(e,["title","titleId"]);return r.createElement("svg",Cw({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Sw)}var Iw=r.forwardRef(Nw);n.p;function Ew(){return(Ew=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Fw(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Lw=r.createElement("g",{id:"icon/button/data/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"Data-icon---small",transform:"translate(1.500000, 0.500000)",stroke:"#1B2559"},r.createElement("path",{d:"M10,2 L10,4.77777778 C10,6.00507722 7.76142375,7 5,7 C2.29272181,7 0.0854192765,5.97179097 0,4.77777778 L0.00256904537,2",id:"oval-3"}),r.createElement("path",{d:"M10,5 L10,7.77777778 C10,9.00507722 7.76142375,10 5,10 C2.29272181,10 0.0854192765,8.97179097 0,7.77777778 L0.00256904537,5",id:"oval-2"}),r.createElement("ellipse",{id:"oval-1",cx:5,cy:2,rx:5,ry:2})),r.createElement("g",{id:"Group-9",transform:"translate(0.000000, 4.000000)"},r.createElement("circle",{id:"Oval",stroke:"#1B2559",fill:"#EBEFFF",cx:4,cy:4,r:3.5}),r.createElement("polygon",{id:"Path",fill:"#1B2559",fillRule:"nonzero",points:"4.33333333 3.66666667 6 3.66666667 6 4.33333333 4.33333333 4.33333333 4.33333333 6 3.66666667 6 3.66666667 4.33333333 2 4.33333333 2 3.66666667 3.66666667 3.66666667 3.66666667 2 4.33333333 2"})));function Dw(e,t){var n=e.title,a=e.titleId,i=Fw(e,["title","titleId"]);return r.createElement("svg",Ew({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Lw)}var Pw=r.forwardRef(Dw);n.p;function Bw(){return(Bw=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Rw(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Aw=r.createElement("g",{id:"icon/button/loyalty/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("polygon",{id:"Stroke-2",stroke:"#FFFFFF",strokeLinejoin:"round",points:"8.27822222 0.5 3.72177778 0.5 0.5 3.72177778 0.5 8.27822222 3.72177778 11.5 8.27822222 11.5 11.5 8.27822222 11.5 3.72177778"}),r.createElement("path",{d:"M7.55533889,6.66641667 C8.04667222,6.66641667 8.44450556,7.06486111 8.44450556,7.55558333 C8.44450556,8.04630556 8.04667222,8.44475 7.55533889,8.44475 C7.06461667,8.44475 6.66678333,8.04630556 6.66678333,7.55558333 C6.66678333,7.06486111 7.06461667,6.66641667 7.55533889,6.66641667 Z M8.44481111,3.55555556 L4.44447778,8.44444444 L3.55592222,8.44444444 L7.55564444,3.55555556 L8.44481111,3.55555556 Z M4.44423333,3.55525 C4.93556667,3.55525 5.3334,3.95369444 5.3334,4.44441667 C5.3334,4.93513889 4.93556667,5.33358333 4.44423333,5.33358333 C3.95351111,5.33358333 3.55567778,4.93513889 3.55567778,4.44441667 C3.55567778,3.95369444 3.95351111,3.55525 4.44423333,3.55525 Z",id:"Combined-Shape",fill:"#FFFFFF"}));function Tw(e,t){var n=e.title,a=e.titleId,i=Rw(e,["title","titleId"]);return r.createElement("svg",Bw({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Aw)}var Mw=r.forwardRef(Tw);n.p;function Ww(){return(Ww=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function zw(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var $w=r.createElement("g",{id:"icon/button/loyalty/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("polygon",{id:"Stroke-2",stroke:"#1B2559",strokeLinejoin:"round",points:"8.27822222 0.5 3.72177778 0.5 0.5 3.72177778 0.5 8.27822222 3.72177778 11.5 8.27822222 11.5 11.5 8.27822222 11.5 3.72177778"}),r.createElement("path",{d:"M7.55533889,6.66641667 C8.04667222,6.66641667 8.44450556,7.06486111 8.44450556,7.55558333 C8.44450556,8.04630556 8.04667222,8.44475 7.55533889,8.44475 C7.06461667,8.44475 6.66678333,8.04630556 6.66678333,7.55558333 C6.66678333,7.06486111 7.06461667,6.66641667 7.55533889,6.66641667 Z M8.44481111,3.55555556 L4.44447778,8.44444444 L3.55592222,8.44444444 L7.55564444,3.55555556 L8.44481111,3.55555556 Z M4.44423333,3.55525 C4.93556667,3.55525 5.3334,3.95369444 5.3334,4.44441667 C5.3334,4.93513889 4.93556667,5.33358333 4.44423333,5.33358333 C3.95351111,5.33358333 3.55567778,4.93513889 3.55567778,4.44441667 C3.55567778,3.95369444 3.95351111,3.55525 4.44423333,3.55525 Z",id:"Combined-Shape",fill:"#1B2559"}));function qw(e,t){var n=e.title,a=e.titleId,i=zw(e,["title","titleId"]);return r.createElement("svg",Ww({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,$w)}var Hw=r.forwardRef(qw);n.p;function Vw(){return(Vw=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Uw(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Gw=r.createElement("desc",null,"Created with Sketch."),Xw=r.createElement("g",{id:"icon/sf-small/search/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("path",{d:"M15.8635238,8.17028571 C15.8635238,12.4198095 12.4187619,15.8645714 8.1692381,15.8645714 C3.92066667,15.8645714 0.475904762,12.4198095 0.475904762,8.17028571 C0.475904762,3.9207619 3.92066667,0.476 8.1692381,0.476 C12.4187619,0.476 15.8635238,3.9207619 15.8635238,8.17028571 Z",id:"Stroke-1",stroke:"#FFFFFF",strokeWidth:2}),r.createElement("line",{x1:13.7035238,y1:13.7046667,x2:19.4844762,y2:19.485619,id:"Stroke-3",stroke:"#FFFFFF",strokeWidth:2,strokeLinecap:"round"}));function _w(e,t){var n=e.title,a=e.titleId,i=Uw(e,["title","titleId"]);return r.createElement("svg",Vw({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Gw,Xw)}var Kw=r.forwardRef(_w);n.p;function Zw(){return(Zw=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Yw(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Qw=r.createElement("g",{id:"icon/search/dark02",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"Group",transform:"translate(1.000000, 1.000000)",stroke:"#1B2559",strokeWidth:2},r.createElement("path",{d:"M14.2771714,7.35325714 C14.2771714,11.1778286 11.1768857,14.2781143 7.35231429,14.2781143 C3.5286,14.2781143 0.428314286,11.1778286 0.428314286,7.35325714 C0.428314286,3.52868571 3.5286,0.4284 7.35231429,0.4284 C11.1768857,0.4284 14.2771714,3.52868571 14.2771714,7.35325714 Z",id:"Stroke-1"}),r.createElement("line",{x1:12.3331714,y1:12.3342,x2:17.5360286,y2:17.5370571,id:"Stroke-3",strokeLinecap:"round"})));function Jw(e,t){var n=e.title,a=e.titleId,i=Yw(e,["title","titleId"]);return r.createElement("svg",Zw({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),void 0===n?r.createElement("title",{id:a},"icon/search/dark02"):n?r.createElement("title",{id:a},n):null,Qw)}var eC=r.forwardRef(Jw),tC=(n.p,Object(j.a)({row:{display:"flex",flexDirection:"row"},image:function(e){return{objectFit:"cover",borderRadius:"8px 0px 0px 8px",width:e.width,height:e.height}},popupImage:function(e){return{objectFit:"cover",width:e.popupWidth,height:e.popupHeight}},button:function(e){return{borderRadius:"0px 8px 8px 0px",height:e.height}},popoverContent:{display:"block",padding:[[10,15]]}})),nC=Object(r.memo)((function(e){var t=e.className,n=e.width,a=e.height,i=e.popupWidth,o=e.popupHeight,l=e.src,s=tC({width:n,height:a,popupWidth:i,popupHeight:o}),d=Object(r.useState)(null),u=Object(c.a)(d,2),m=u[0],h=u[1],b=Boolean(m),p=function(e){var t=e.className;return Object(Me.jsx)("img",{className:E()(t),src:l,alt:""})};return Object(Me.jsx)(S.a,{onClickAway:function(){h(null)},children:Object(Me.jsxs)("div",{className:E()(s.row,t),children:[Object(Me.jsx)(p,{className:s.image}),Object(Me.jsx)(Vn,{Icon:eC,InverseIcon:Kw,className:s.button,onClick:function(e){h(m?null:e.currentTarget)}}),Object(Me.jsx)(Xn,{open:b,anchorEl:m,placement:"top",children:Object(Me.jsx)("div",{className:s.popoverContent,children:Object(Me.jsx)(p,{className:s.popupImage})})})]})})}));function rC(){return(rC=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function aC(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var iC=r.createElement("g",{id:"icon/ID/card/new/comet",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("polygon",{id:"Stroke-1",stroke:"#5F668A",strokeWidth:1.6,points:"1 17 23 17 23 1 1 1"}),r.createElement("line",{x1:12.7857143,y1:5,x2:19.8571429,y2:5,id:"Stroke-3",stroke:"#5F668A",strokeWidth:1.6}),r.createElement("line",{x1:12.7857143,y1:8.2,x2:19.8571429,y2:8.2,id:"Stroke-4",stroke:"#5F668A",strokeWidth:1.6}),r.createElement("polygon",{id:"Stroke-5",stroke:"#5F668A",strokeWidth:1.6,points:"4.14285714 12.2 9.64285714 12.2 9.64285714 5 4.14285714 5"}));function oC(e,t){var n=e.title,a=e.titleId,i=aC(e,["title","titleId"]);return r.createElement("svg",rC({width:"24px",height:"18px",viewBox:"0 0 24 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),void 0===n?r.createElement("title",{id:a},"icon/ID/card/new/comet"):n?r.createElement("title",{id:a},n):null,iC)}var cC=r.forwardRef(oC);n.p;function lC(){return(lC=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function sC(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var dC=r.createElement("g",{id:"icon/ID/phone/new/comet",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("path",{d:"M7.47150618,13.52898 C10.939556,16.9970298 14.7804112,17.1146315 16.4756355,16.9586292 C17.0220434,16.9090285 17.5308507,16.6578249 17.9188563,16.2698193 L20.0004862,14.1881894 L18.0220577,12.210561 L16.0436293,11.5505516 L14.7244104,12.8697705 C14.7244104,12.8697705 13.4059914,14.1881894 10.1091441,10.8905421 C6.81229671,7.59449473 8.13071565,6.27527578 8.13071565,6.27527578 L9.4499346,4.95605683 L8.78992512,2.97842842 L6.81229671,1 L4.73066681,3.0816299 C4.34186123,3.46963548 4.09145763,3.97844279 4.04105691,4.52485063 C3.88585468,6.22007499 4.00345637,10.0601301 7.47150618,13.52898 Z",id:"Stroke-1-Copy",stroke:"#5F668A",strokeWidth:1.6}));function uC(e,t){var n=e.title,a=e.titleId,i=sC(e,["title","titleId"]);return r.createElement("svg",lC({width:"24px",height:"18px",viewBox:"0 0 24 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),void 0===n?r.createElement("title",{id:a},"icon/ID/phone/new/comet"):n?r.createElement("title",{id:a},n):null,dC)}var mC=r.forwardRef(uC);n.p;function hC(){return(hC=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function bC(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var pC=r.createElement("desc",null,"Created with Sketch."),jC=r.createElement("g",{id:"icon/crossed-camera",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"crossed-camera"},r.createElement("g",{id:"Group-2"},r.createElement("g",{id:"icon/ID/cam/zodiac",transform:"translate(0.000000, 3.657143)",fill:"#1B2559",fillRule:"nonzero"},r.createElement("path",{d:"M16,19.1876029 C12.4482116,19.1876029 9.56809571,16.389776 9.56809571,12.9394673 C9.56809571,9.48915858 12.4482116,6.69133172 16,6.69133172 C19.5517884,6.69133172 22.4319043,9.48915858 22.4319043,12.9394673 C22.4319043,16.389776 19.5517884,19.1876029 16,19.1876029 Z M16,17.104891 C18.3677075,17.104891 20.2879362,15.239526 20.2879362,12.9394673 C20.2879362,10.6394086 18.3677075,8.77404358 16,8.77404358 C13.6322925,8.77404358 11.7120638,10.6394086 11.7120638,12.9394673 C11.7120638,15.239526 13.6322925,17.104891 16,17.104891 Z M22.7667469,3.30692494 L30.7397807,3.30692494 C31.3318211,3.30692494 31.8117647,3.77315587 31.8117647,4.34828087 L31.8117647,22.0513317 C31.8117647,22.6264567 31.3318211,23.0926877 30.7397807,23.0926877 L1.26021934,23.0926877 C0.6681789,23.0926877 0.188235294,22.6264567 0.188235294,22.0513317 L0.188235294,4.34828087 C0.188235294,3.77315587 0.6681789,3.30692494 1.26021934,3.30692494 L9.23325311,3.30692494 L12.0766705,0.494526627 C12.2782333,0.295162767 12.5538198,0.182857143 12.8414756,0.182857143 L19.1585244,0.182857143 C19.4461802,0.182857143 19.7217667,0.295162767 19.9233295,0.494526627 L22.7667469,3.30692494 Z M29.6677966,5.3896368 L22.3170489,5.3896368 C22.0293931,5.3896368 21.7538065,5.27733118 21.5522438,5.07796732 L18.7088264,2.26556901 L13.2911736,2.26556901 L10.4477562,5.07796732 C10.2461935,5.27733118 9.97060695,5.3896368 9.68295115,5.3896368 L2.33220339,5.3896368 L2.33220339,21.0099758 L29.6677966,21.0099758 L29.6677966,5.3896368 Z",id:"Stroke-1"})),r.createElement("line",{x1:32,y1:0,x2:0,y2:32,id:"Line",stroke:"#FF584A",strokeWidth:2,strokeLinecap:"square"}))));function fC(e,t){var n=e.title,a=e.titleId,i=bC(e,["title","titleId"]);return r.createElement("svg",hC({width:"32px",height:"32px",viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,pC,jC)}var gC=r.forwardRef(fC);n.p;function OC(){return(OC=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function xC(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var vC=r.createElement("desc",null,"Created with Sketch."),yC=r.createElement("g",{id:"icon/action/edit/disabled",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("path",{d:"M1,18 L1,18 C1,19.657 2.343,21 4,21 L18,21 C19.657,21 21,19.657 21,18",id:"Stroke-1",stroke:"#5f668a",strokeWidth:2}),r.createElement("polygon",{id:"Stroke-3",stroke:"#5f668a",strokeWidth:2,points:"6 12 17 1 21 5 10 16 6 16"}));function wC(e,t){var n=e.title,a=e.titleId,i=xC(e,["title","titleId"]);return r.createElement("svg",OC({width:"22px",height:"22px",viewBox:"0 0 22 22",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,vC,yC)}var CC=r.forwardRef(wC);n.p;function kC(){return(kC=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function SC(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var NC=r.createElement("g",{id:"icon/sf-small/listing/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("line",{x1:1,y1:1,x2:19.0952381,y2:1,id:"Path-4",stroke:"#FFFFFF",strokeWidth:2}),r.createElement("line",{x1:1,y1:7,x2:19.0952381,y2:7,id:"Path-4-Copy",stroke:"#FFFFFF",strokeWidth:2}),r.createElement("line",{x1:1,y1:13,x2:19.0952381,y2:13,id:"Path-4-Copy-2",stroke:"#FFFFFF",strokeWidth:2}),r.createElement("line",{x1:1,y1:19,x2:19.0952381,y2:19,id:"Path-4-Copy-3",stroke:"#FFFFFF",strokeWidth:2}));function IC(e,t){var n=e.title,a=e.titleId,i=SC(e,["title","titleId"]);return r.createElement("svg",kC({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,NC)}var EC=r.forwardRef(IC);n.p;function FC(){return(FC=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function LC(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var DC=r.createElement("g",{id:"icon/sf-small/listing/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("line",{x1:1,y1:1,x2:19.0952381,y2:1,id:"Path-4",stroke:"#1B2559",strokeWidth:2}),r.createElement("line",{x1:1,y1:7,x2:19.0952381,y2:7,id:"Path-4-Copy",stroke:"#1B2559",strokeWidth:2}),r.createElement("line",{x1:1,y1:13,x2:19.0952381,y2:13,id:"Path-4-Copy-2",stroke:"#1B2559",strokeWidth:2}),r.createElement("line",{x1:1,y1:19,x2:19.0952381,y2:19,id:"Path-4-Copy-3",stroke:"#1B2559",strokeWidth:2}));function PC(e,t){var n=e.title,a=e.titleId,i=LC(e,["title","titleId"]);return r.createElement("svg",FC({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,DC)}var BC=r.forwardRef(PC);n.p;function RC(){return(RC=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function AC(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var TC=r.createElement("g",{id:"icon/sf-small/overview/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("rect",{id:"Rectangle",stroke:"#FFFFFF",strokeWidth:2,x:1,y:1,width:7,height:7,rx:2}),r.createElement("rect",{id:"Rectangle-Copy-2",stroke:"#FFFFFF",strokeWidth:2,x:1,y:12,width:7,height:7,rx:2}),r.createElement("rect",{id:"Rectangle-Copy",stroke:"#FFFFFF",strokeWidth:2,x:12,y:1,width:7,height:7,rx:2}),r.createElement("rect",{id:"Rectangle-Copy-3",stroke:"#FFFFFF",strokeWidth:2,x:12,y:12,width:7,height:7,rx:2}));function MC(e,t){var n=e.title,a=e.titleId,i=AC(e,["title","titleId"]);return r.createElement("svg",RC({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,TC)}var WC=r.forwardRef(MC);n.p;function zC(){return(zC=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function $C(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var qC=r.createElement("g",{id:"icon/sf-small/overview/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("rect",{id:"Rectangle",stroke:"#1B2559",strokeWidth:2,x:1,y:1,width:7,height:7,rx:2}),r.createElement("rect",{id:"Rectangle-Copy-2",stroke:"#1B2559",strokeWidth:2,x:1,y:12,width:7,height:7,rx:2}),r.createElement("rect",{id:"Rectangle-Copy",stroke:"#1B2559",strokeWidth:2,x:12,y:1,width:7,height:7,rx:2}),r.createElement("rect",{id:"Rectangle-Copy-3",stroke:"#1B2559",strokeWidth:2,x:12,y:12,width:7,height:7,rx:2}));function HC(e,t){var n=e.title,a=e.titleId,i=$C(e,["title","titleId"]);return r.createElement("svg",zC({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,qC)}var VC=r.forwardRef(HC),UC=(n.p,{header:{display:"flex",flexDirection:"row",marginBottom:15},title:{marginTop:7,marginRight:24},editIcon:{marginTop:5},cardIcon:{marginTop:7},viewIcons:{marginRight:12},wrapper:{display:"flex"},separator:{display:"flex",flexBasis:"100%",justifyContent:"center",color:se,margin:[[8,0,8,0]],"&::before, &::after":{content:"",flexGrow:1,background:se,height:1,fontSize:1,lineHeight:0,margin:[[0,8,0,8]]}}}),GC=n(890),XC=Object(j.a)({radio:{padding:4,margin:4},radioGroup:{flexDirection:"row"},error:{color:me},specialLabel:{height:40,padding:0,width:250},label:{height:40,padding:0},specialGrid:{display:"grid",gridTemplateColumns:[[182,162,141]]}}),_C=function(e){return"blocked"===e.authorizedOverride?{label:"Blocked",type:"error"}:e.isSuspended?e.daysSuspended>0?{label:"".concat(e.daysSuspended," day suspension"),type:"warning"}:{label:"< 1 day suspension",type:"warning"}:{label:"Authorized",type:"success"}},KC=function(e,t){var n=e&&t?Object(GC.a)(e,t):null;return n?n.formatInternational():e},ZC=function(e){var t,n,r=T.a(["idCardData"])(e);return"".concat(null!==(t=T.a(["firstName"])(r))&&void 0!==t?t:""," ").concat(null!==(n=T.a(["lastName"])(r))&&void 0!==n?n:"").trim()},YC=[{display:"Custom entry",code:"custom"},{display:"Populate existing requirement",code:"requirement"}],QC=[{display:"Text",code:"text"},{display:"File",code:"file"},{display:"Image",code:"image"}],JC=[{display:"Birthdate",code:"birthdate"},{display:"ID card image",code:"idCardPhoto"},{display:"ID data",code:"idCardData"},{display:"Customer camera",code:"facephoto"},{display:"US SSN",code:"usSsn"}],ek=[{display:"Data entry title",code:"title"}],tk=xn.e().shape({entryType:xn.g().required()}),nk=xn.e().shape({title:xn.g().required(),file:xn.c().required()}),rk=xn.e().shape({title:xn.g().required(),image:xn.c().required()}),ak=function(e){var t=e.selectedValues,n=null===t||void 0===t?void 0:t.dataType,r="file"===n||"image"===n;return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Po.a,{display:"flex",alignItems:"center",children:Object(Me.jsx)(Ue,{children:"Custom ".concat(n," entry")})}),ik[n].options.map((function(e){var t=e.display,n=e.code;return Object(Me.jsx)(pn.b,{name:n,label:t,component:Ua,width:390})})),r&&Object(Me.jsx)(_S,{type:n})]})},ik={text:{schema:xn.e().shape({title:xn.g().required(),data:xn.g().required()}),options:[{display:"Data entry title",code:"title"},{display:"Data entry",code:"data"}],Component:ak,initialValues:{data:"",title:""}},file:{schema:nk,options:ek,Component:ak,initialValues:{file:"",title:""}},image:{schema:rk,options:ek,Component:ak,initialValues:{image:"",title:""}}},ok={schema:tk,options:YC,Component:function(){var e=XC(),t=Object(pn.e)().values,n="custom"===t.entryType,r="requirement"===t.entryType;return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Po.a,{display:"flex",alignItems:"center",children:Object(Me.jsx)(Ue,{children:"Type of entry"})}),Object(Me.jsx)(pn.b,{component:Ha,name:"entryType",options:YC,labelClassName:e.specialLabel,radioClassName:e.radio,className:E()(e.radioGroup,e.specialGrid)}),n&&Object(Me.jsxs)("div",{children:[Object(Me.jsx)(Po.a,{display:"flex",alignItems:"center",children:Object(Me.jsx)(Ue,{children:"Type of data"})}),Object(Me.jsx)(pn.b,{component:Ha,name:"dataType",options:QC,labelClassName:e.label,radioClassName:e.radio,className:E()(e.radioGroup,e.specialGrid)})]}),r&&Object(Me.jsxs)("div",{children:[Object(Me.jsx)(Po.a,{display:"flex",alignItems:"center",children:Object(Me.jsx)(Ue,{children:"Requirements"})}),Object(Me.jsx)(pn.b,{component:Ha,name:"requirement",options:JC,labelClassName:e.label,radioClassName:e.radio,className:E()(e.radioGroup,e.specialGrid)})]})]})},initialValues:{entryType:""}},ck={stepper:{margin:[[16,0,14,0]]},submit:{display:"flex",flexDirection:"row",margin:[["auto",0,24]]},button:{marginLeft:"auto"},form:{height:"100%",display:"flex",flexDirection:"column"},infoTitle:{margin:[[18,0,20,0]]},infoCurrentText:{color:q},blankSpace:{padding:[[0,30]],margin:[[0,4,0,2]],borderBottom:"1px solid ".concat(q),display:"inline-block"}},lk=Object(j.a)(ck),sk=function(e){var t=e.onClose,n=e.save,a=e.error,i=lk(),o=Object(r.useState)(null),l=Object(c.a)(o,2),d=l[0],u=l[1],m=Object(r.useState)({step:1}),h=Object(c.a)(m,2),b=h[0],p=b.step,j=b.config,f=h[1],g=2===p,O=function(e,t){switch(e){case 1:return ok;case 2:return ik[null===t||void 0===t?void 0:t.dataType];default:return r.Fragment}}(p,d),x=function(){var e=Object(pc.a)(bc.a.mark((function e(t){var r;return bc.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=Gn.a(j,O.schema.cast(t)),u(r),!g){e.next=4;break}return e.abrupt("return",n(r));case 4:f({step:p+1,config:r});case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return Object(Me.jsx)(Me.Fragment,{children:Object(Me.jsxs)(AO,{title:"Manual data entry",handleClose:t,width:520,height:520,open:!0,children:[Object(Me.jsx)(GO,{className:i.stepper,steps:2,currentStep:p}),Object(Me.jsx)(pn.d,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,onSubmit:x,initialValues:O.initialValues,validationSchema:O.schema,children:Object(Me.jsxs)(pn.c,{className:i.form,children:[Object(Me.jsx)(O.Component,Object(s.a)({selectedValues:d},O.props)),Object(Me.jsxs)("div",{className:i.submit,children:[a&&Object(Me.jsx)(Ao,{children:"Failed to save"}),Object(Me.jsx)(Tn,{className:i.button,type:"submit",children:g?"Add Data":"Next"})]})]})})]})})},dk={titleWrapper:Sb.titleWrapper,titleAndButtonsContainer:Sb.titleAndButtonsContainer,row:{display:"flex",flexFlow:"row nowrap"},rowSpaceBetween:{display:"flex",flexFlow:"row nowrap",alignItems:"center",justifyContent:"space-between"},column:{display:"flex",flexFlow:"column nowrap",width:"100%",height:"100%",justifyContent:"space-between"},textInput:{width:144},p:{fontFamily:"MuseoSans",fontSize:xe,fontWeight:500,fontStretch:"normal",fontStyle:"normal",lineHeight:1.14,letterSpacing:"normal",color:J},txId:{fontFamily:"MuseoSans",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},txClassIconLeft:{marginRight:11},txClassIconRight:{marginLeft:11},headerLabels:{display:"flex",flexDirection:"row","& div":{display:"flex",alignItems:"center"},"& > div:first-child":{marginRight:24},"& span":{extend:Re.label1,marginLeft:6}},photo:{width:92,height:92,borderRadius:8,backgroundColor:G,margin:[[0,28,0,0]],alignItems:"center",justifyContent:"center",display:"flex"},img:{width:80},customerName:{marginBottom:32},icon:{marginRight:11},name:{display:"flex",flexDirection:"row",alignItems:"center"},value:{height:16},label:{marginBottom:4,color:q},txSummaryValue:{height:16,marginRight:25},txSummaryLabel:{marginBottom:4,color:q,marginRight:25},idIcon:{marginRight:10},subpageButton:{marginLeft:16},txTableSpacing:{marginTop:40}},uk=n(311),mk=n(434),hk=n.n(mk);function bk(){return(bk=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function pk(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var jk=r.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("polygon",{id:"Simple-Arrow-White",fill:"#FFFFFF",fillRule:"nonzero",points:"12.1912718 1.56064837 10.8306233 0.395663059 0.196798664 16.2200463 10.8250965 32.3956631 12.1967987 31.2473125 2.33241023 16.233075"}));function fk(e,t){var n=e.title,a=e.titleId,i=pk(e,["title","titleId"]);return r.createElement("svg",bk({width:"13px",height:"33px",viewBox:"0 0 13 33",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,jk)}var gk=r.forwardRef(fk);n.p;function Ok(){return(Ok=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function xk(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var vk=r.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"Group-2-Copy",transform:"translate(1.000000, 1.000000)",stroke:"#FFFFFF",strokeWidth:2},r.createElement("polyline",{id:"Path-4-Copy",points:"0 0 12 15.8202247 0 32"})));function yk(e,t){var n=e.title,a=e.titleId,i=xk(e,["title","titleId"]);return r.createElement("svg",Ok({width:"15px",height:"34px",viewBox:"0 0 15 34",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,vk)}var wk=r.forwardRef(yk),Ck=(n.p,Object(j.a)({imgWrapper:{alignItems:"center",justifyContent:"center",display:"flex",width:550},imgInner:{objectFit:"cover",objectPosition:"center",width:550,marginBottom:40}})),kk=Object(r.memo)((function(e){var t=e.photosData,n=e.slidePhoto,r=Ck();return Object(Me.jsx)(Me.Fragment,{children:Object(Me.jsx)(hk.a,{PrevIcon:Object(Me.jsx)(gk,{}),NextIcon:Object(Me.jsx)(wk,{}),navButtonsProps:{style:{backgroundColor:"transparent",borderRadius:0,width:50,color:"transparent",opacity:1}},autoPlay:!1,indicators:!1,navButtonsAlwaysVisible:!0,next:function(e){return n(e)},prev:function(e){return n(e)},children:t.map((function(e,t){return Object(Me.jsx)("div",{children:Object(Me.jsx)("div",{className:r.imgWrapper,children:Object(Me.jsx)("img",{className:r.imgInner,src:"".concat(ij,"/").concat(null===e||void 0===e?void 0:e.photoDir,"/").concat(null===e||void 0===e?void 0:e.path),alt:""})})})}))})})})),Sk=Object(j.a)({closeButton:{display:"flex",padding:[[16,16,0,16]],paddingRight:12,justifyContent:"end"},title:{margin:[[0,16,8,20]]}}),Nk=Object(r.memo)((function(e){var t=e.title,n=void 0===t?"":t,r=e.open,a=e.onDissmised,i=(e.disabled,e.data),o=Object($.a)(e,["title","open","onDissmised","disabled","data"]),c=Sk();return Object(Me.jsxs)(un.a,Object(s.a)(Object(s.a)({PaperProps:{style:{borderRadius:8}},fullWidth:!0,open:r,"aria-labelledby":"form-dialog-title"},o),{},{children:[Object(Me.jsx)("div",{className:c.closeButton,children:Object(Me.jsx)(tr,{size:16,"aria-label":"close",onClick:function(){a()},children:Object(Me.jsx)(gi,{})})}),Object(Me.jsx)(qe,{className:c.title,children:n}),Object(Me.jsx)(mn.a,{className:c.dialogContent,children:i})]}))})),Ik={photo:{width:135,height:135,borderRadius:8,backgroundColor:G,margin:[[0,28,0,0]],alignItems:"center",justifyContent:"center",display:"flex"},img:{objectFit:"cover",objectPosition:"center",width:135,height:135},container:{position:"relative","& > img":{display:"block"},"& > circle":{position:"absolute",top:"0",right:"0",marginRight:5,marginTop:5}},circle:{background:re,borderRadius:"50%",width:25,height:25,alignItems:"center",justifyContent:"center",display:"flex"},label:{color:se,margin:[[0,0,6,0]]},firstRow:{padding:[[8]],display:"flex",flexDirection:"column"},secondRow:{extend:Re.p,display:"flex",padding:[[8]],"& > div":{display:"flex",flexDirection:"column","& > div":{width:144,height:37,marginBottom:15,marginRight:55}}},imgWrapper:{alignItems:"center",justifyContent:"center",display:"flex",width:550,height:550},imgInner:{objectFit:"cover",objectPosition:"center",width:550,height:550,marginBottom:40}},Ek=Object(j.a)(Ik),Fk=function(e){var t=e.children,n=Ek();return Object(Me.jsx)(et,{className:n.label,children:t})},Lk=Object(r.memo)((function(e){var t=e.frontCameraData,n=e.txPhotosData,a=Ek(),i=Object(r.useState)(!1),o=Object(c.a)(i,2),l=o[0],d=o[1],u=B.a((function(e){return qo.a("id")(e)?Object(s.a)(Object(s.a)({},e),{},{photoDir:"operator-data/customersphotos"}):Object(s.a)(Object(s.a)({},e),{},{photoDir:"front-camera-photo"})})),m=B.a(L.a(Cl.a,B.a((function(e){var t=Object(c.a)(e,2),n=t[0],r=t[1];return"txCustomerPhotoPath"===n||"frontCameraPath"===n?["path",r]:"txCustomerPhotoAt"===n||"frontCameraAt"===n?["date",r]:e})),Sl.a)),h=M.a((function(e){return!P.a(e.date)&&!P.a(e.path)}))(u(m(Ns.a(t,n)))),b=zb.a(h);return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(vu.a,{className:a.photo,elevation:0,children:Object(Me.jsx)(uk.a,{disabled:!b,className:a.button,onClick:function(){d(!0)},children:b?Object(Me.jsxs)("div",{className:a.container,children:[Object(Me.jsx)("img",{className:a.img,src:"".concat(ij,"/").concat(b.photoDir,"/").concat(b.path),alt:""}),Object(Me.jsx)("circle",{className:a.circle,children:Object(Me.jsx)("div",{children:Object(Me.jsx)(Ke,{children:h.length})})})]}):Object(Me.jsx)(gC,{})})}),Object(Me.jsx)(Nk,{open:l,title:"Photo roll",data:Object(Me.jsx)(Dk,{photosData:h}),onDissmised:function(){d(!1)}})]})})),Dk=Object(r.memo)((function(e){var t,n,a=e.photosData,i=Ek(),o=Object(r.useState)(0),l=Object(c.a)(o,2),s=l[0],d=l[1],u=!qo.a("id")(a[s]);return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(kk,{photosData:a,slidePhoto:function(e){return d(e)}}),!u&&Object(Me.jsxs)("div",{className:i.firstRow,children:[Object(Me.jsx)(Fk,{children:"Session ID"}),Object(Me.jsx)(Pb,{children:a&&(null===(t=a[s])||void 0===t?void 0:t.id)})]}),Object(Me.jsxs)("div",{className:i.secondRow,children:[Object(Me.jsx)("div",{children:Object(Me.jsxs)("div",{children:[Object(Me.jsx)(Fk,{children:"Date"}),Object(Me.jsx)("div",{children:a&&(null===(n=a[s])||void 0===n?void 0:n.date)})]})}),Object(Me.jsxs)("div",{children:[Object(Me.jsx)(Fk,{children:"Taken by"}),Object(Me.jsx)("div",{children:u?"Compliance scan":"Acceptance of T&C"})]})]})]})})),Pk=Lk,Bk=Object(j.a)(dk),Rk=Object(r.memo)((function(e){var t=e.txData,n=e.customer,r=e.locale,a=(e.setShowCompliance,Bk()),i=T.a(["idCardData","documentNumber"])(n),o=T.a(["usSsn"])(n),c=[{header:"Phone number",size:172,value:KC(n.phone,r.country)}];i&&c.push({header:"ID number",size:172,value:i}),o&&c.push({header:"US SSN",size:127,value:o});var l=ZC(n);return Object(Me.jsxs)(Po.a,{display:"flex",children:[Object(Me.jsx)(Pk,{frontCameraData:_u.a(["frontCameraPath","frontCameraAt"])(n),txPhotosData:t&&B.a(_u.a(["id","txCustomerPhotoPath","txCustomerPhotoAt"]))(t)}),Object(Me.jsxs)(Po.a,{display:"flex",flexDirection:"column",children:[Object(Me.jsxs)("div",{className:a.name,children:[Object(Me.jsx)(up,{className:a.idIcon}),Object(Me.jsx)(He,{noMargin:!0,children:l.length?l:KC(T.a(["phone"])(n),r.country)})]}),Object(Me.jsx)(Po.a,{display:"flex",mt:"auto",children:c.map((function(e,t){var n=e.size,r=e.header;return Object(Me.jsx)(et,{noMargin:!0,className:a.label,style:{width:n},children:r},t)}))}),Object(Me.jsx)(Po.a,{display:"flex",children:c.map((function(e,t){var n=e.size,r=e.value;return Object(Me.jsx)(Xe,{noMargin:!0,className:a.value,style:{width:n},children:r},t)}))})]})]})}));function Ak(){return(Ak=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Tk(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Mk=r.createElement("g",{id:"icon/customer-nav/data/comet",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("path",{d:"M19,5 L19,10 C19,12.209139 14.9705627,14 10,14 C5.12689927,14 1.1537547,12.1492238 1,10 L1.00462428,5",id:"Path-Copy-3",stroke:"#5F668A",strokeWidth:2}),r.createElement("path",{d:"M19,10 L19,15 C19,17.209139 14.9705627,19 10,19 C5.12689927,19 1.1537547,17.1492238 1,15 L1.00462428,10",id:"Path-Copy-3",stroke:"#5F668A",strokeWidth:2}),r.createElement("ellipse",{id:"Oval-Copy-3",stroke:"#5F668A",strokeWidth:2,cx:10,cy:5,rx:9,ry:4}));function Wk(e,t){var n=e.title,a=e.titleId,i=Tk(e,["title","titleId"]);return r.createElement("svg",Ak({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Mk)}var zk=r.forwardRef(Wk);n.p;function $k(){return($k=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function qk(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Hk=r.createElement("g",{id:"icon/customer-nav/data/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("path",{d:"M19,5 L19,10 C19,12.209139 14.9705627,14 10,14 C5.12689927,14 1.1537547,12.1492238 1,10 L1.00462428,5",id:"Path-Copy-3",stroke:"#FFFFFF",strokeWidth:2}),r.createElement("path",{d:"M19,10 L19,15 C19,17.209139 14.9705627,19 10,19 C5.12689927,19 1.1537547,17.1492238 1,15 L1.00462428,10",id:"Path-Copy-3",stroke:"#FFFFFF",strokeWidth:2}),r.createElement("ellipse",{id:"Oval-Copy-3",stroke:"#FFFFFF",strokeWidth:2,cx:10,cy:5,rx:9,ry:4}));function Vk(e,t){var n=e.title,a=e.titleId,i=qk(e,["title","titleId"]);return r.createElement("svg",$k({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Hk)}var Uk=r.forwardRef(Vk);n.p;function Gk(){return(Gk=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Xk(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var _k=r.createElement("g",{id:"icon/customer-nav/overview/comet",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("rect",{id:"Rectangle",stroke:"#5F668A",strokeWidth:2,x:1,y:1,width:7,height:7,rx:2}),r.createElement("rect",{id:"Rectangle-Copy-2",stroke:"#5F668A",strokeWidth:2,x:1,y:12,width:7,height:7,rx:2}),r.createElement("rect",{id:"Rectangle-Copy",stroke:"#5F668A",strokeWidth:2,x:12,y:1,width:7,height:7,rx:2}),r.createElement("rect",{id:"Rectangle-Copy-3",stroke:"#5F668A",strokeWidth:2,x:12,y:12,width:7,height:7,rx:2}));function Kk(e,t){var n=e.title,a=e.titleId,i=Xk(e,["title","titleId"]);return r.createElement("svg",Gk({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,_k)}var Zk=r.forwardRef(Kk);n.p;function Yk(){return(Yk=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Qk(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Jk=r.createElement("g",{id:"icon/customer-nav/overview/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("rect",{id:"Rectangle",stroke:"#FFFFFF",strokeWidth:2,x:1,y:1,width:7,height:7,rx:2}),r.createElement("rect",{id:"Rectangle-Copy-2",stroke:"#FFFFFF",strokeWidth:2,x:1,y:12,width:7,height:7,rx:2}),r.createElement("rect",{id:"Rectangle-Copy",stroke:"#FFFFFF",strokeWidth:2,x:12,y:1,width:7,height:7,rx:2}),r.createElement("rect",{id:"Rectangle-Copy-3",stroke:"#FFFFFF",strokeWidth:2,x:12,y:12,width:7,height:7,rx:2}));function eS(e,t){var n=e.title,a=e.titleId,i=Qk(e,["title","titleId"]);return r.createElement("svg",Yk({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Jk)}var tS=r.forwardRef(eS),nS=(n.p,{sidebar:{display:"flex",backgroundColor:"#ebefff",width:219,flexDirection:"column",borderRadius:5,marginBottom:50},link:{alignItems:"center",display:"flex",extend:Re.p,position:"relative",color:de,padding:15,cursor:"pointer"},activeLink:{display:"flex",alignItems:"center",extend:Re.tl2,color:Z,backgroundColor:de,"&:first-child":{borderRadius:[5,5,0,0]},"&:last-child":{borderRadius:[0,0,5,5]}},icon:{marginRight:15}}),rS=Object(j.a)(nS),aS=function(e){var t=e.isSelected,n=e.onClick,r=rS(),a=[{code:"overview",display:"Overview",Icon:tS,InverseIcon:Zk},{code:"customerData",display:"Customer Data",Icon:Uk,InverseIcon:zk}];return Object(Me.jsx)("div",{className:r.sidebar,children:null===a||void 0===a?void 0:a.map((function(e){var a,i=e.Icon,o=e.InverseIcon,c=e.display,l=e.code;return Object(Me.jsxs)("div",{className:E()((a={},Object(z.a)(a,r.activeLink,t(l)),Object(z.a)(a,r.link,!0),a)),onClick:function(){return n(l)},children:[Object(Me.jsx)("div",{className:r.icon,children:t(l)?Object(Me.jsx)(i,{}):Object(Me.jsx)(o,{})}),c]})}))})};function iS(){return(iS=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function oS(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var cS=r.createElement("desc",null,"Created with Sketch."),lS=r.createElement("g",{id:"icon/action/edit/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("path",{d:"M1,18 L1,18 C1,19.657 2.343,21 4,21 L18,21 C19.657,21 21,19.657 21,18",id:"Stroke-1",stroke:"#FFFFFF",strokeWidth:2}),r.createElement("polygon",{id:"Stroke-3",stroke:"#FFFFFF",strokeWidth:2,points:"6 12 17 1 21 5 10 16 6 16"}));function sS(e,t){var n=e.title,a=e.titleId,i=oS(e,["title","titleId"]);return r.createElement("svg",iS({width:"22px",height:"22px",viewBox:"0 0 22 22",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,cS,lS)}var dS=r.forwardRef(sS);n.p;function uS(){return(uS=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function mS(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var hS=r.createElement("desc",null,"Created with Sketch."),bS=r.createElement("defs",null,r.createElement("polygon",{id:"path-1",points:"0 21 21 21 21 0 0 0"})),pS=r.createElement("g",{id:"icon/sf-small/save/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"Group"},r.createElement("polygon",{id:"Stroke-1",stroke:"#FFFFFF",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",points:"20.5 20.5 0.5 20.5 0.5 0.5 16.75 0.5 20.5 4.25"}),r.createElement("mask",{id:"mask-2",fill:"white"},r.createElement("use",{xlinkHref:"#path-1"})),r.createElement("g",{id:"Clip-4"}),r.createElement("polygon",{id:"Stroke-5",stroke:"#FFFFFF",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",mask:"url(#mask-2)",points:"4.25 7.5 16.75 7.5 16.75 0.5 4.25 0.5"}),r.createElement("circle",{id:"Oval",stroke:"#FFFFFF",strokeWidth:2,mask:"url(#mask-2)",cx:11,cy:14,r:3})));function jS(e,t){var n=e.title,a=e.titleId,i=mS(e,["title","titleId"]);return r.createElement("svg",uS({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,hS,bS,pS)}var fS=r.forwardRef(jS);n.p;function gS(){return(gS=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function OS(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var xS=r.createElement("desc",null,"Created with Sketch."),vS=r.createElement("defs",null,r.createElement("polygon",{id:"path-1",points:"0 21 21 21 21 0 0 0"})),yS=r.createElement("g",{id:"icon/sf-small/save/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"Group"},r.createElement("g",{id:"Group-10"},r.createElement("g",{id:"Group-6"},r.createElement("polygon",{id:"Stroke-1",stroke:"#1B2559",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",points:"20.5 20.5 0.5 20.5 0.5 0.5 16.75 0.5 20.5 4.25"}),r.createElement("mask",{id:"mask-2",fill:"white"},r.createElement("use",{xlinkHref:"#path-1"})),r.createElement("g",{id:"Clip-4"}),r.createElement("polygon",{id:"Stroke-5",stroke:"#1B2559",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",mask:"url(#mask-2)",points:"4.25 7.5 16.75 7.5 16.75 0.5 4.25 0.5"}))),r.createElement("circle",{id:"Oval",stroke:"#1B2559",strokeWidth:2,cx:11,cy:14,r:3})));function wS(e,t){var n=e.title,a=e.titleId,i=OS(e,["title","titleId"]);return r.createElement("svg",gS({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,xS,vS,yS)}var CS=r.forwardRef(wS),kS=(n.p,{label1:{display:"flex",width:85,justifyContent:"right"},label1Pending:{color:q},label1Rejected:{color:Y},label1Accepted:{color:U},editButton:{marginTop:30,display:"flex",justifyContent:"right"},button:{marginRight:8},editingButtons:{marginTop:30,display:"flex",justifyContent:"right"},card:{borderRadius:10,marginRight:15,marginBottom:15},cardHeader:{display:"flex",flexDirection:"row",marginBottom:15},editIcon:{marginTop:5},cardIcon:{marginTop:7},cardTitle:{margin:[[8,15,15,15]]}}),SS=Object(j.a)(kS),NS={field:{position:"relative",width:280,height:48,padding:[[0,4,4,0]]},label:{color:q,margin:[[0,0,0,0]]},notEditing:{display:"flex",flexDirection:"column","& > p:first-child":{height:16,lineHeight:"16px",transformOrigin:"left",paddingLeft:0,margin:[[3,0,3,0]]},"& > p:last-child":{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",margin:0}},editing:{"& > div":{"& > input":{padding:0}}}},IS=Object(j.a)(NS),ES=function(e){var t,n=e.editing,r=e.field,a=e.size,i=Object($.a)(e,["editing","field","size"]),o=IS(),c=(t={},Object(z.a)(t,o.field,!0),Object(z.a)(t,o.notEditing,!n),t);return Object(Me.jsxs)("div",{className:E()(c),children:[!n&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(et,{className:o.label,children:r.label}),Object(Me.jsx)(Ze,{children:r.value})]}),n&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(et,{className:o.label,children:r.label}),Object(Me.jsx)(pn.b,Object(s.a)({className:o.editing,id:r.name,component:r.component,value:r.value,type:r.type,width:a},i))]})]})},FS=function(e){var t,n=e.data,a=e.save,i=e.authorize,o=e.reject,l=e.state,s=e.title,d=e.titleIcon,u=e.children,m=SS(),b=Object(r.useState)(!1),p=Object(c.a)(b,2),j=p[0],f=p[1],g=Object(r.useState)(null),O=Object(c.a)(g,2),x=O[0],v=O[1],y=(t={},Object(z.a)(t,m.label1,!0),Object(z.a)(t,m.label1Pending,l===sw),Object(z.a)(t,m.label1Rejected,l===uw),Object(z.a)(t,m.label1Accepted,l===dw),t),w=l===sw?{label:"Pending",type:"neutral"}:l===uw?{label:"Rejected",type:"error"}:{label:"Accepted",type:"success"},C=function(e){return Object(Me.jsx)(ES,{field:e,editing:j,size:180})};return Object(Me.jsx)("div",{children:Object(Me.jsx)(vu.a,{className:m.card,children:Object(Me.jsxs)(yu.a,{children:[Object(Me.jsxs)("div",{className:m.cardHeader,children:[d,Object(Me.jsx)(Ve,{className:m.cardTitle,children:s}),Object(Me.jsx)(ep,{width:304}),Object(Me.jsx)("div",{className:E()(y),children:Object(Me.jsx)(Wd,{statuses:[w]})})]}),Object(Me.jsx)(pn.d,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,onSubmit:function(e){return a(e)},onReset:function(){f(!1),v(!1)},children:Object(Me.jsxs)(pn.c,{children:[Object(Me.jsx)(xu,{}),Object(Me.jsx)("div",{className:m.row,children:Object(Me.jsxs)(h.a,{container:!0,children:[Object(Me.jsx)(h.a,{container:!0,direction:"column",item:!0,xs:6,children:null===n||void 0===n?void 0:n.map((function(e,t){return t>=0&&t<4?C(e):null}))}),Object(Me.jsx)(h.a,{container:!0,direction:"column",item:!0,xs:6,children:null===n||void 0===n?void 0:n.map((function(e,t){return t>=4?C(e):null}))})]})}),u,Object(Me.jsxs)("div",{className:m.edit,children:[!j&&Object(Me.jsx)("div",{className:m.editButton,children:Object(Me.jsx)(ze,{color:"primary",Icon:Mm,InverseIcon:dS,onClick:function(){return f(!0)},children:"Edit"})}),j&&Object(Me.jsxs)("div",{className:m.editingButtons,children:[n&&Object(Me.jsx)("div",{className:m.button,children:Object(Me.jsx)(ze,{color:"secondary",Icon:CS,InverseIcon:fS,type:"submit",children:"Save"})}),Object(Me.jsx)("div",{className:m.button,children:Object(Me.jsx)(ze,{color:"secondary",Icon:Tp,InverseIcon:pr,type:"reset",children:"Cancel"})}),"Accepted"!==w.label&&Object(Me.jsx)("div",{className:m.button,children:Object(Me.jsx)(ze,{color:"secondary",Icon:cw,InverseIcon:tw,type:"submit",onClick:function(){return i()},children:"Authorize"})}),"Rejected"!==w.label&&Object(Me.jsx)(ze,{color:"secondary",Icon:Tp,InverseIcon:pr,type:"submit",onClick:function(){return o()},children:"Reject"}),x&&Object(Me.jsx)(Ao,{children:"Failed to save changes"})]})]})]})})]})})})},LS=(Object(j.a)({field:{height:46},label:{color:q,margin:[[0,3]]},value:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",margin:0,paddingLeft:4}}),function(e,t){return P.a(e)?"":t}),DS=Object(j.a)(dk),PS=function(e){var t,n=e.customer,r=e.data,a=e.loading,i=e.locale,o=DS(),c="cashOut"===n.lastTxClass?gl:ul,l=!(Wr.a(r)||P.a(r)),s=i.timezone,d=(t={},Object(z.a)(t,o.titleAndButtonsContainer,a||!a&&!l),Object(z.a)(t,o.txTableSpacing,!a&&l),t),u=[{header:"Transactions",size:127,value:LS(n.totalTxs,"".concat(Number.parseInt(n.totalTxs)))},{header:"Transaction volume",size:167,value:LS(n.totalSpent,"".concat(Number.parseFloat(n.totalSpent)," ").concat(n.lastTxFiatCode))},{header:"Last active",size:142,value:!P.a(s)&&LS(n.lastActive,Os(n.lastActive,s,"yyyy-MM-d"))},{header:"Last transaction",size:198,value:LS(n.lastTxFiat,Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(c,{className:o.icon}),"".concat(Number.parseFloat(n.lastTxFiat)," \n ").concat(n.lastTxFiatCode)]}))}],m=[{header:"Machine",width:160,view:T.a(["machineName"])},{header:"Direction",width:125,view:function(e){return Object(Me.jsx)(Me.Fragment,{children:"cashOut"===e.txClass?Object(Me.jsx)(gl,{className:o.txClassIconLeft}):Object(Me.jsx)(ul,{className:o.txClassIconLeft})})}},{header:"Transaction ID",width:145,view:function(e){return Object(Me.jsx)(Pb,{className:o.txId,children:e.id})}},{header:"Cash",width:155,textAlign:"right",view:function(e){return Object(Me.jsxs)(Me.Fragment,{children:["".concat(Number.parseFloat(e.fiat)," "),Object(Me.jsx)(tt,{inline:!0,children:e.fiatCode})]})}},{header:"Crypto",width:145,textAlign:"right",view:function(e){return Object(Me.jsxs)(Me.Fragment,{children:["".concat(Tb.utils.toUnit(new vl.a(e.cryptoAtoms),e.cryptoCode).toFormat(5)," "),Object(Me.jsx)(tt,{inline:!0,children:e.cryptoCode})]})}},{header:"Date",width:100,view:function(e){return Os(e.created,s,"yyyy-MM-d")}},{header:"Time (h:m:s)",width:130,view:function(e){return Os(e.created,s,"HH:mm:ss")}}];return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Ve,{children:"Transactions"}),Object(Me.jsxs)(Po.a,{display:"flex",flexDirection:"column",children:[Object(Me.jsx)(Po.a,{display:"flex",mt:"auto",children:u.map((function(e,t){var n=e.size,r=e.header;return Object(Me.jsx)(et,{noMargin:!0,className:o.txSummaryLabel,style:{width:n},children:r},t)}))}),Object(Me.jsx)(Po.a,{display:"flex",children:u.map((function(e,t){var n=e.size,r=e.value;return Object(Me.jsx)(Xe,{noMargin:!0,className:o.txSummaryValue,style:{width:n},children:r},t)}))})]}),Object(Me.jsx)("div",{className:o.titleWrapper,children:Object(Me.jsx)("div",{className:E()(d),children:a?Object(Me.jsx)(Ue,{children:"Loading"}):l?"":Object(Me.jsx)(Ue,{children:"No transactions so far"})})}),l&&Object(Me.jsx)(Bv,{elements:m,data:r})]})},BS=n(438);function RS(){return(RS=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function AS(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var TS=r.createElement("g",{id:"icon/button/photo/zodiac-resized",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"Group-2"},r.createElement("g",{id:"Group",transform:"translate(11.666667, 8.333333) scale(-1, 1) translate(-11.666667, -8.333333) translate(3.333333, 0.000000)",stroke:"#1B2559"},r.createElement("rect",{id:"Rectangle-Copy",x:.5,y:.5,width:15.6666667,height:15.6666667,rx:1}),r.createElement("circle",{id:"Oval-Copy",fill:"#1B2559",cx:12.5,cy:4.16666667,r:1}),r.createElement("g",{id:"Group-14",transform:"translate(0.775621, 9.722222)",strokeLinejoin:"round"},r.createElement("polyline",{id:"Path-Copy-2",points:"0 4.58204149 5.10673153 0 11.6154223 6.31150113"}),r.createElement("polyline",{id:"Path",points:"9.02830015 3.23981481 11.3158819 0.925925926 15.0663146 4.81868037"}))),r.createElement("g",{id:"Group-9",transform:"translate(0.000000, 6.666667)"},r.createElement("circle",{id:"Oval",stroke:"#1B2559",fill:"#EBEFFF",cx:6.66666667,cy:6.66666667,r:6.16666667}),r.createElement("polygon",{id:"Path",fill:"#1B2559",fillRule:"nonzero",points:"7.22222222 6.11111111 10 6.11111111 10 7.22222222 7.22222222 7.22222222 7.22222222 10 6.11111111 10 6.11111111 7.22222222 3.33333333 7.22222222 3.33333333 6.11111111 6.11111111 6.11111111 6.11111111 3.33333333 7.22222222 3.33333333"}))));function MS(e,t){var n=e.title,a=e.titleId,i=AS(e,["title","titleId"]);return r.createElement("svg",RS({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,TS)}var WS=r.forwardRef(MS);n.p;function zS(){return(zS=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function $S(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var qS=r.createElement("g",{id:"icon/button/upload-file/zodiac-resized",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"Add-File-Icon",transform:"translate(0.000000, 0.500000)"},r.createElement("g",{id:"file-icon",transform:"translate(5.934783, 0.000000)",stroke:"#1B2559"},r.createElement("g",{id:"lines",transform:"translate(3.130435, 7.826087)",strokeLinecap:"round"},r.createElement("line",{x1:0,y1:7.04347826,x2:7.82608696,y2:7.04347826,id:"line-3"}),r.createElement("line",{x1:0,y1:3.91304348,x2:7.82608696,y2:3.91304348,id:"line-2"}),r.createElement("line",{x1:0,y1:.782608696,x2:5.47826087,y2:.782608696,id:"line-1"})),r.createElement("polygon",{id:"paper",strokeLinecap:"round",strokeLinejoin:"round",points:"13.5652174 18.6521739 0 18.6521739 -1.18243096e-12 0 8.47826087 2.91569667e-12 13.5652174 5.08695652"}),r.createElement("polygon",{id:"fold",strokeLinejoin:"round",points:"8.47826087 0 8.47826087 5.08695652 13.5652174 5.08695652"})),r.createElement("g",{id:"plus-sign",transform:"translate(0.000000, 5.934783)"},r.createElement("circle",{id:"Oval",stroke:"#1B2559",fill:"#EBEFFF",cx:6.7826087,cy:6.7826087,r:6.2826087}),r.createElement("polygon",{id:"Path",fill:"#1B2559",fillRule:"nonzero",points:"7.34782609 6.2173913 10.173913 6.2173913 10.173913 7.34782609 7.34782609 7.34782609 7.34782609 10.173913 6.2173913 10.173913 6.2173913 7.34782609 3.39130435 7.34782609 3.39130435 6.2173913 6.2173913 6.2173913 6.2173913 3.39130435 7.34782609 3.39130435"}))));function HS(e,t){var n=e.title,a=e.titleId,i=$S(e,["title","titleId"]);return r.createElement("svg",zS({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,qS)}var VS,US,GS=r.forwardRef(HS),XS=(n.p,Object(j.a)({box:{boxSizing:"border-box",marginTop:40,width:450,height:120,borderStyle:"dashed",borderColor:se,borderRadius:4,borderWidth:1,backgroundColor:ae,display:"flex",justifyContent:"center"},inputContent:{marginTop:35,display:"flex"},uploadContent:{marginTop:50,display:"flex"},board:{width:450,height:120},icon:{margin:[[14,20,0,0]]}})),_S=function(e){var t=e.type,n=XS(),a=Object(r.useState)({}),i=Object(c.a)(a,2),o=i[0],l=i[1],d=Object(pn.e)().setFieldValue,u="image",m=t===u,h=Object(r.useCallback)((function(e){d(t,zb.a(e).name),l({preview:m?URL.createObjectURL(zb.a(e)):zb.a(e).name})}),[m,t,d]),b=Object(BS.a)({onDrop:h}),p=b.getRootProps,j=b.getInputProps;return Object(Me.jsx)(Me.Fragment,{children:Object(Me.jsxs)("div",Object(s.a)(Object(s.a)({},p()),{},{className:n.board,children:[Wr.a(o)&&Object(Me.jsxs)("div",{className:n.box,children:[Object(Me.jsx)("input",Object(s.a)({},j())),Object(Me.jsxs)("div",{className:n.inputContent,children:[m?Object(Me.jsx)(WS,{className:n.icon}):Object(Me.jsx)(GS,{className:n.icon}),Object(Me.jsx)(nt,{children:"Drag and drop ".concat(m?"an image":"a file"," or click to open the explorer")})]})]}),!Wr.a(o)&&t===u&&Object(Me.jsx)("div",{children:Object(Me.jsx)("img",{src:o.preview,className:n.box,alt:""})},o.name),!Wr.a(o)&&t!==u&&Object(Me.jsx)("div",{className:n.box,children:Object(Me.jsx)(Ve,{className:n.uploadContent,children:o.preview})})]}))})},KS=Object(j.a)(UC),ZS=function(e){var t=e.show,n=e.src,r=KS({width:165});return Object(Me.jsx)(Me.Fragment,{children:t?Object(Me.jsx)(nC,{src:n,width:165,height:45,popupWidth:360,popupHeight:240}):Object(Me.jsx)("div",{className:r.photoWrapper,children:Object(Me.jsx)(gC,{})})})},YS=function(e){var t,n,a,i,o,l,s,d=e.customer,u=e.updateCustomer,m=KS(),b=Object(r.useState)(!1),p=Object(c.a)(b,2),j=p[0],f=p[1],g=T.a(["idCardData"])(d),O=T.a(["expirationDate"])(g),x=T.a(["country"])(g),v=T.a(["dateOfBirth"])(g),y=T.a(["sanctions"])(d),w=T.a(["sanctionsAt"])(d)?y?"Passed":"Failed":"Not checked yet",C=function(e){return e%2===0},k=Kj.a.filter((function(e){return!Kj.a.isEmpty(e.data)||!Kj.a.isNil(e.children)})),S=Kj.a.filter((function(e){return""!==e.value})),N={idScan:xn.e().shape({name:xn.g(),idNumber:xn.g(),birthDate:xn.g(),age:xn.g(),gender:xn.g(),state:xn.g(),expirationDate:xn.g()}),usSsn:xn.e().shape({usSsn:xn.g()})},I=[{name:"name",label:"Name",value:"".concat(ZC(d)),component:Ua},{name:"idNumber",label:"ID number",value:null!==(t=T.a(["documentNumber"])(g))&&void 0!==t?t:"",component:Ua},{name:"birthDate",label:"Birth Date",value:null!==(n=v&&Object(js.a)("yyyy-MM-dd",v))&&void 0!==n?n:"",component:Ua},{name:"age",label:"Age",value:null!==(a=v&&Object($b.a)(v,new Date))&&void 0!==a?a:"",component:Ua},{name:"gender",label:"Gender",value:null!==(i=T.a(["gender"])(g))&&void 0!==i?i:"",component:Ua},{name:"state",label:"Canada"===x?"Province":"State",value:null!==(o=T.a(["state"])(g))&&void 0!==o?o:"",component:Ua},{name:"expirationDate",label:"Expiration Date",value:null!==(l=O&&Object(js.a)("yyyy-MM-dd",O))&&void 0!==l?l:"",component:Ua}],E=[{name:"us ssn",label:"US SSN",value:"".concat(null!==(s=d.usSsn)&&void 0!==s?s:""),component:Ua,size:190}],F={idScan:{name:"",idNumber:"",birthDate:"",age:"",gender:"",state:"",expirationDate:""},usSsn:{usSsn:""}},L=[{data:S(I),title:"ID Scan",titleIcon:Object(Me.jsx)(mC,{className:m.cardIcon}),state:T.a(["idCardDataOverride"])(d),authorize:function(){return u({idCardDataOverride:dw})},reject:function(){return u({idCardDataOverride:uw})},save:function(e){return console.log(e)},validationSchema:N.idScan,initialValues:F.idScan},{title:"SMS Confirmation",titleIcon:Object(Me.jsx)(cC,{className:m.cardIcon}),authorize:function(){},reject:function(){},save:function(){}},{title:"Name",titleIcon:Object(Me.jsx)(CC,{className:m.editIcon}),authorize:function(){},reject:function(){},save:function(){}},{title:"Sanctions check",titleIcon:Object(Me.jsx)(CC,{className:m.editIcon}),state:T.a(["sanctionsOverride"])(d),authorize:function(){return u({sanctionsOverride:dw})},reject:function(){return u({sanctionsOverride:uw})},save:function(){},children:Object(Me.jsx)(Ze,{children:w})},{title:"Front facing camera",titleIcon:Object(Me.jsx)(CC,{className:m.editIcon}),state:T.a(["frontCameraOverride"])(d),authorize:function(){return u({frontCameraOverride:dw})},reject:function(){return u({frontCameraOverride:uw})},save:function(){},children:d.frontCameraPath?Object(Me.jsx)(ZS,{show:d.frontCameraPath,src:"".concat(ij,"/front-camera-photo/").concat(T.a(["frontCameraPath"])(d))}):null},{title:"ID card image",titleIcon:Object(Me.jsx)(CC,{className:m.editIcon}),state:T.a(["idCardPhotoOverride"])(d),authorize:function(){return u({idCardPhotoOverride:dw})},reject:function(){return u({idCardPhotoOverride:uw})},save:function(){},children:d.idCardPhotoPath?Object(Me.jsx)(ZS,{show:d.idCardPhotoPath,src:"".concat(ij,"/id-card-photo/").concat(T.a(["idCardPhotoPath"])(d))}):null},{data:S(E),title:"US SSN",titleIcon:Object(Me.jsx)(cC,{className:m.cardIcon}),state:T.a(["usSsnOverride"])(d),authorize:function(){return u({usSsnOverride:dw})},reject:function(){return u({usSsnOverride:uw})},save:function(){},validationSchema:N.usSsn,initialValues:F.usSsn}],D=function(e,t){var n=e.title,r=e.authorize,a=e.reject,i=e.state,o=e.titleIcon,c=e.data,l=e.save,s=e.children,d=e.validationSchema,u=e.initialValues;return Object(Me.jsx)(FS,{title:n,authorize:r,reject:a,state:i,titleIcon:o,data:c,children:s,validationSchema:d,initialValues:u,save:l},t)},P=k(L);return Object(Me.jsxs)("div",{children:[Object(Me.jsxs)("div",{className:m.header,children:[Object(Me.jsx)(Ve,{className:m.title,children:"Customer data"}),Object(Me.jsx)(Vn,{active:!j,className:m.viewIcons,Icon:VC,InverseIcon:WC,onClick:function(){return f(!1)}}),Object(Me.jsx)(Vn,{active:j,className:m.viewIcons,Icon:BC,InverseIcon:EC,onClick:function(){return f(!0)}})]}),Object(Me.jsxs)("div",{children:[!j&&Object(Me.jsxs)(h.a,{container:!0,children:[Object(Me.jsx)(h.a,{container:!0,direction:"column",item:!0,xs:6,children:P.map((function(e,t){return C(t)?D(e,t):null}))}),Object(Me.jsx)(h.a,{container:!0,direction:"column",item:!0,xs:6,children:P.map((function(e,t){return C(t)?null:D(e,t)}))})]}),null]})]})},QS={labelLink:{cursor:"pointer",color:q},breadcrumbs:{margin:[[20,0]]},actionLabel:{color:q,margin:[[4,0]]},customerDetails:{marginBottom:18},customerBlock:function(e){return{display:"flex",flexDirection:"row",margin:[[0,0,4,0]],padding:[[0,e.blocked?35:48,0]]}},customerDiscount:{display:"flex",flexDirection:"row",margin:[[0,0,4,0]],padding:[[0,23.5,0]]},customerManualDataEntry:{display:"flex",flexDirection:"row",margin:[[8,0,4,0]],padding:[[0,40.5,0]]},panels:{display:"flex"},rightSidePanel:{display:"block",width:1100},leftSidePanel:{width:300}},JS=Object(j.a)(QS),eN=x()(VS||(VS=Object(l.a)(["\n query customer($customerId: ID!) {\n config\n customer(customerId: $customerId) {\n id\n authorizedOverride\n frontCameraPath\n frontCameraAt\n frontCameraOverride\n phone\n isAnonymous\n smsOverride\n idCardData\n idCardDataOverride\n idCardDataExpiration\n idCardPhotoPath\n idCardPhotoOverride\n usSsn\n usSsnOverride\n sanctions\n sanctionsAt\n sanctionsOverride\n totalTxs\n totalSpent\n lastActive\n lastTxFiat\n lastTxFiatCode\n lastTxClass\n daysSuspended\n isSuspended\n customFields {\n id\n label\n value\n }\n transactions {\n txClass\n id\n fiat\n fiatCode\n cryptoAtoms\n cryptoCode\n created\n machineName\n errorMessage: error\n error: errorCode\n txCustomerPhotoAt\n txCustomerPhotoPath\n }\n }\n }\n"]))),tN=x()(US||(US=Object(l.a)(["\n mutation setCustomer($customerId: ID!, $customerInput: CustomerInput) {\n setCustomer(customerId: $customerId, customerInput: $customerInput) {\n id\n authorizedOverride\n frontCameraPath\n frontCameraOverride\n phone\n smsOverride\n idCardData\n idCardDataOverride\n idCardDataExpiration\n idCardPhotoPath\n idCardPhotoOverride\n usSsn\n usSsnOverride\n sanctions\n sanctionsAt\n sanctionsOverride\n totalTxs\n totalSpent\n lastActive\n lastTxFiat\n lastTxFiatCode\n lastTxClass\n subscriberInfo\n }\n }\n"]))),nN=Object(r.memo)((function(){var e,t,n,a=Object(w.h)(),i=Object(r.useState)(!1),o=Object(c.a)(i,2),l=o[0],s=o[1],d=Object(r.useState)(!1),m=Object(c.a)(d,2),h=m[0],b=m[1],p=Object(r.useState)(null),j=Object(c.a)(p,1)[0],f=Object(r.useState)("overview"),g=Object(c.a)(f,2),O=g[0],x=g[1],v=Object(w.j)().id,y=Object(u.c)(eN,{variables:{customerId:v}}),C=y.data,k=y.refetch,S=y.loading,N=Object(u.b)(tN,{onCompleted:function(){return k()}}),I=Object(c.a)(N,1)[0],E=function(e){return I({variables:{customerId:v,customerInput:e}})},F=null!==(e=T.a(["config"])(C))&&void 0!==e?e:[],L=F&&$l(Dl,F),D=null!==(t=T.a(["customer"])(C))&&void 0!==t?t:[],P=null!==(n=T.a(["transactions"])(D))&&void 0!==n?n:[],B=Ex.a(Ky.a(R.a("cryptoAtoms")))(P),A=ZC(D),M=T.a(["authorizedOverride"])(D)===uw,W=D.isSuspended,z="customerData"===O,$="overview"===O,q=JS({blocked:M});return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)(ou.a,{classes:{root:q.breadcrumbs},separator:Object(Me.jsx)(lu.a,{fontSize:"small"}),"aria-label":"breadcrumb",children:[Object(Me.jsx)(et,{noMargin:!0,className:q.labelLink,onClick:function(){return a.push("/compliance/customers")},children:"Customers"}),Object(Me.jsx)(tt,{noMargin:!0,className:q.labelLink,children:A.length?A:KC(T.a(["phone"])(D),L.country)})]}),Object(Me.jsxs)("div",{className:q.panels,children:[Object(Me.jsx)("div",{className:q.leftSidePanel,children:!S&&!D.isAnonymous&&Object(Me.jsxs)("div",{children:[Object(Me.jsx)("div",{children:Object(Me.jsx)(aS,{isSelected:function(e){return e===O},onClick:function(e){return x(e)}})}),Object(Me.jsx)(et,{className:q.actionLabel,children:"Actions"}),Object(Me.jsx)("div",{children:Object(Me.jsx)(ze,{className:q.customerManualDataEntry,color:"primary",Icon:Pw,InverseIcon:Iw,onClick:function(){return b(!0)},children:"Manual data entry"})}),Object(Me.jsx)("div",{children:Object(Me.jsx)(ze,{className:q.customerDiscount,color:"primary",Icon:Hw,InverseIcon:Mw,onClick:function(){},children:"Add individual discount"})}),Object(Me.jsxs)("div",{children:[W&&Object(Me.jsx)(ze,{color:"primary",Icon:cw,InverseIcon:tw,onClick:function(){return E({suspendedUntil:null})},children:"Unsuspend customer"}),Object(Me.jsx)(ze,{color:"primary",className:q.customerBlock,Icon:M?cw:ww,InverseIcon:M?tw:fw,onClick:function(){return E({authorizedOverride:M?dw:uw})},children:"".concat(M?"Authorize":"Block"," customer")}),Object(Me.jsx)(ze,{color:"primary",Icon:M?cw:ww,InverseIcon:M?tw:fw,onClick:function(){return I({variables:{customerId:v,customerInput:{subscriberInfo:!0}}})},children:"Retrieve information"})]})]})}),Object(Me.jsxs)("div",{className:q.rightSidePanel,children:[$&&Object(Me.jsxs)("div",{children:[Object(Me.jsx)(Po.a,{className:q.customerDetails,display:"flex",justifyContent:"space-between",children:Object(Me.jsx)(Rk,{customer:D,locale:L,setShowCompliance:function(){return s(!l)}})}),Object(Me.jsx)("div",{children:Object(Me.jsx)(PS,{customer:D,data:B,locale:L,loading:S})})]}),z&&Object(Me.jsx)("div",{children:Object(Me.jsx)(YS,{customer:D,updateCustomer:E})})]}),h&&Object(Me.jsx)(sk,{error:null===j||void 0===j?void 0:j.message,save:function(){},onClose:function(){return b(null)}})]})]})})),rN=n(915),aN=n(916),iN=Wn.baseButton,oN=iN.height/2,cN=iN.height/4,lN="rgba(0, 0, 0, 0.08)",sN="0 4px 4px 0 ".concat(lN),dN={size:function(e){var t=e.size;return Object(s.a)({marginTop:"lg"===t?0:2},Hr(t))},bold:Vr,autocomplete:{'&[data-focus="true"]':{backgroundColor:lN}},popup:{display:"flex",flexDirection:"column",borderRadius:[[0,0,cN,cN]],backgroundColor:G,boxShadow:sN},separator:{width:"88%",height:1,margin:"0 auto",border:"solid 0.5px",borderColor:q},item:{display:"flex",flexDirection:"row",width:"100%",height:36,alignItems:"center"},itemLabel:{margin:[0],whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},itemType:{marginLeft:"auto",fontSize:12,color:q,margin:[0]},input:{display:"flex",flex:1,width:273,padding:[[8,12]],alignItems:"center",height:32,borderRadius:oN,backgroundColor:G,color:J},inputWithPopup:{borderRadius:[[cN,cN,0,0]],boxShadow:sN},iconButton:{marginRight:12}},uN=Object(j.a)(dN),mN=Object(r.memo)((function(e){var t,n=e.loading,a=void 0!==n&&n,i=e.filters,o=void 0===i?[]:i,l=e.options,d=void 0===l?[]:l,u=e.inputPlaceholder,m=void 0===u?"":u,h=e.size,b=e.onChange,p=Object($.a)(e,["loading","filters","options","inputPlaceholder","size","onChange"]),j=uN({size:h}),f=Object(r.useState)(!1),g=Object(c.a)(f,2),O=g[0],x=g[1],v=(t={},Object(z.a)(t,j.input,!0),Object(z.a)(t,j.inputWithPopup,O),t),y=function(e){return b(e)};return Object(Me.jsx)(Rr.a,Object(s.a)({loading:a,classes:{option:j.autocomplete},value:o,options:d,getOptionLabel:function(e){return e.value},renderOption:function(e){return Object(Me.jsxs)("div",{className:j.item,children:[Object(Me.jsx)(Xe,{className:j.itemLabel,children:e.value}),Object(Me.jsx)(Xe,{className:j.itemType,children:e.type})]})},autoHighlight:!0,disableClearable:!0,clearOnEscape:!0,multiple:!0,filterSelectedOptions:!0,getOptionSelected:function(e,t){return e.type===t.type},PaperComponent:function(e){var t=e.children;return Object(Me.jsxs)(Un.a,{elevation:0,className:j.popup,children:[Object(Me.jsx)("div",{className:j.separator}),t]})},renderInput:function(e){return Object(Me.jsx)(aN.a,Object(s.a)(Object(s.a)({ref:e.InputProps.ref},e),{},{className:E()(v),startAdornment:Object(Me.jsx)(eC,{className:j.iconButton}),placeholder:m,inputProps:Object(s.a)({className:j.bold,classes:{root:j.size}},e.inputProps)}))},onOpen:function(){return x(!0)},onClose:function(){return x(!1)},onChange:function(e,t){return y(t)}},p))}));function hN(){return(hN=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function bN(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var pN=r.createElement("g",{id:"icon/button/filter/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("path",{d:"M0.6,-3.33066907e-16 L0.509218076,0.00652107669 C0.068925647,0.0708166555 -0.160361948,0.596737342 0.124968515,0.966531156 L4.166,6.204 L4.16660432,9.6 C4.16660432,9.79162756 4.25813682,9.97172829 4.41293455,10.0846831 L6.8797259,11.8846831 L6.96095139,11.9350192 C7.34801849,12.1353088 7.83339568,11.8580867 7.83339568,11.4 L7.833,6.204 L11.8750315,0.966531156 C12.179384,0.572084421 11.8982155,-3.33066907e-16 11.4,-3.33066907e-16 L0.6,-3.33066907e-16 Z M10.179,1.199 L6.75836419,5.63346884 L6.70465653,5.71638775 C6.65811535,5.80315577 6.63339568,5.90052663 6.63339568,6 L6.633,10.219 L5.366,9.294 L5.36660432,6 L5.35847177,5.90154229 C5.34231401,5.80441508 5.30240262,5.71222382 5.24163581,5.63346884 L1.82,1.199 L10.179,1.199 Z",id:"Path",fill:"#FFFFFF",fillRule:"nonzero"}));function jN(e,t){var n=e.title,a=e.titleId,i=bN(e,["title","titleId"]);return r.createElement("svg",hN({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),void 0===n?r.createElement("title",{id:a},"icon/button/filter/white"):n?r.createElement("title",{id:a},n):null,pN)}var fN=r.forwardRef(jN);n.p;function gN(){return(gN=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function ON(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var xN=r.createElement("g",{id:"icon/button/filter/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("path",{d:"M0.6,-4.56301663e-14 L0.509218076,0.00652107669 C0.068925647,0.0708166555 -0.160361948,0.596737342 0.124968515,0.966531156 L4.166,6.204 L4.16660432,9.6 C4.16660432,9.79162756 4.25813682,9.97172829 4.41293455,10.0846831 L6.8797259,11.8846831 L6.96095139,11.9350192 C7.34801849,12.1353088 7.83339568,11.8580867 7.83339568,11.4 L7.833,6.204 L11.8750315,0.966531156 C12.179384,0.572084421 11.8982155,-4.56301663e-14 11.4,-4.56301663e-14 L0.6,-4.56301663e-14 Z M10.179,1.199 L6.75836419,5.63346884 L6.70465653,5.71638775 C6.65811535,5.80315577 6.63339568,5.90052663 6.63339568,6 L6.633,10.219 L5.366,9.294 L5.36660432,6 L5.35847177,5.90154229 C5.34231401,5.80441508 5.30240262,5.71222382 5.24163581,5.63346884 L1.82,1.199 L10.179,1.199 Z",id:"Path",fill:"#1B2559",fillRule:"nonzero"}));function vN(e,t){var n=e.title,a=e.titleId,i=ON(e,["title","titleId"]);return r.createElement("svg",gN({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),void 0===n?r.createElement("title",{id:a},"icon/button/filter/zodiac"):n?r.createElement("title",{id:a},n):null,xN)}var yN,wN,CN,kN=r.forwardRef(vN),SN=(n.p,{root:{marginLeft:0,height:20,backgroundColor:G,"&:hover, &:focus, &:active":{backgroundColor:G},marginBottom:"auto"},label:{fontSize:ye,fontWeight:Se,fontFamily:Ne,paddingRight:0,paddingLeft:8,color:J}}),NN={button:{width:8,height:8,marginLeft:8,marginRight:8},text:{marginTop:0,marginBottom:0},filters:{display:"flex",marginBottom:16},deleteWrapper:{display:"flex",marginLeft:"auto",justifyContent:"flex-end",flexDirection:"row"},entries:{color:se,margin:"auto",marginRight:12},chips:{marginTop:"auto"}},IN=Object(j.a)(SN),EN=Object(j.a)(NN),FN=function(e){var t=e.filters,n=e.onFilterDelete,r=e.deleteAllFilters,a=e.entries,i=IN(),o=EN();return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Xe,{className:o.text,children:"Filters:"}),Object(Me.jsxs)("div",{className:o.filters,children:[Object(Me.jsx)("div",{className:o.chips,children:t.map((function(e,t){return Object(Me.jsx)(Ea,{classes:i,label:"".concat(Hu(e.type),": ").concat(e.value),onDelete:function(){return n(e)},deleteIcon:Object(Me.jsx)(gi,{className:o.button})},t)}))}),Object(Me.jsxs)("div",{className:o.deleteWrapper,children:[Object(Me.jsx)(nt,{className:o.entries,children:"".concat(null!==a&&void 0!==a?a:0," entries")}),Object(Me.jsx)(ze,{color:"secondary",Icon:kN,InverseIcon:fN,className:o.deleteButton,onClick:r,children:"Delete filters"})]})]})]})},LN=Object(j.a)(dk),DN=function(e){var t=e.data,n=e.locale,r=e.onClick,a=e.loading,i=LN(),o=[{header:"Phone",width:175,view:function(e){return KC(e.phone,n.country)}},{header:"Name",width:247,view:ZC},{header:"Total TXs",width:130,textAlign:"right",view:function(e){return"".concat(Number.parseInt(e.totalTxs))}},{header:"Total spent",width:155,textAlign:"right",view:function(e){var t;return"".concat(Number.parseFloat(e.totalSpent)," ").concat(null!==(t=e.lastTxFiatCode)&&void 0!==t?t:"")}},{header:"Last active",width:137,view:function(e){var t;return null!==(t=e.lastActive&&Object(js.a)("yyyy-MM-d",new Date(e.lastActive)))&&void 0!==t?t:""}},{header:"Last transaction",width:165,textAlign:"right",view:function(e){var t,n=!P.a(e.lastTxFiatCode),r="cashOut"===e.lastTxClass?gl:ul,a=Object(Me.jsx)(r,{className:i.txClassIconRight});return Object(Me.jsxs)(Me.Fragment,{children:[n&&"".concat(parseFloat(e.lastTxFiat)," ").concat(null!==(t=e.lastTxFiatCode)&&void 0!==t?t:""),n&&a]})}},{header:"Status",width:191,view:function(e){return Object(Me.jsx)(Wd,{statuses:[_C(e)]})}}];return Object(Me.jsx)(Me.Fragment,{children:Object(Me.jsx)(Bv,{loading:a,emptyText:"No customers so far",elements:o,data:t,onClick:r})})},PN=x()(yN||(yN=Object(l.a)(["\n query filters {\n customerFilters {\n type\n value\n }\n }\n"]))),BN=x()(wN||(wN=Object(l.a)(["\n query configAndCustomers(\n $phone: String\n $name: String\n $address: String\n $id: String\n ) {\n config\n customers(phone: $phone, name: $name, address: $address, id: $id) {\n id\n idCardData\n phone\n totalTxs\n totalSpent\n lastActive\n lastTxFiat\n lastTxFiatCode\n lastTxClass\n authorizedOverride\n daysSuspended\n isSuspended\n }\n }\n"]))),RN=Object(j.a)(Sb),AN=function(){var e,t=RN(),n=Object(w.h)(),a=Object(r.useState)([]),i=Object(c.a)(a,2),o=i[0],l=i[1],s=Object(r.useState)({}),d=Object(c.a)(s,2),m=d[0],h=d[1],b=Object(r.useState)([]),p=Object(c.a)(b,2),j=p[0],f=p[1],g=Object(u.c)(BN,{variables:m,onCompleted:function(e){return l(T.a(["customers"])(e))}}),O=g.data,x=g.loading,v=g.refetch,y=Object(u.c)(PN),C=y.data,k=y.loading,S=null!==(e=T.a(["config"])(O))&&void 0!==e?e:[],N=S&&$l(Dl,S),I=fu.a([Ky.a(R.a("lastActive"))])(null!==o&&void 0!==o?o:[]),E=T.a(["customerFilters"])(C);return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Wo,{title:"Customers",appendix:Object(Me.jsx)("div",{children:Object(Me.jsx)(mN,{loading:k,filters:j,options:E,inputPlaceholder:"Search customers",onChange:function(e){var t=L.a(bg.a,B.a((function(e){return Object(z.a)({},e.type,e.value)})))(e);f(e),h({phone:t.phone,name:t.name,address:t.address,id:t.id}),v&&v()}})}),appendixClassName:t.buttonsWrapper,labels:[{label:"Cash-in",icon:Object(Me.jsx)(ul,{})},{label:"Cash-out",icon:Object(Me.jsx)(gl,{})}]}),j.length>0&&Object(Me.jsx)(FN,{filters:j,onFilterDelete:function(e){return f(M.a((function(t){return!rN.a(_u.a(["type","value"],t),e)}))(j))},setFilters:f}),Object(Me.jsx)(DN,{data:I,locale:N,onClick:function(e){return n.push("/compliance/customer/".concat(e.id))},loading:x})]})},TN=n(766),MN=Object(TN.a)({wrapper:{display:"flex",alignItems:"center"},colorIndicator:{borderRadius:3,height:12,width:12,marginRight:8}}),WN=function(e){var t=e.className,n=e.label,r=e.color,a=Object($.a)(e,["className","label","color"]),i=MN();return Object(Me.jsxs)("div",Object(s.a)(Object(s.a)({className:E()(i.wrapper,t)},a),{},{children:[r&&Object(Me.jsx)("div",{className:i.colorIndicator,style:{backgroundColor:r}}),Object(Me.jsx)(et,Object(s.a)(Object(s.a)({},a),{},{children:n}))]}))},zN=Re.label1,$N=Re.mono,qN={wrapper:{display:"flex",flex:1,flexDirection:"row",height:"100%"},main:{display:"flex",flex:1},firstSide:{margin:"0 ".concat(64,"px 0 ").concat(48,"px")},secondSide:{marginTop:-29},error:{color:me},coinTotal:{margin:"".concat(12,"px 0")},leftSpacer:{marginLeft:8},topSpacer:{marginTop:40},addressWrapper:{display:"flex",flexDirection:"column",flex:1,backgroundColor:ae},address:{width:375,margin:"".concat(12,"px ").concat(24,"px")},itemWrapper:{textAlign:"end"},item:{extend:zN,margin:2},inactiveItem:{color:q},firstItem:{fontWeight:700,margin:2},total:{marginTop:"auto",textAlign:"right",marginRight:24},totalPending:{marginTop:2},totalTitle:{color:ue,marginBottom:2},table:{marginTop:8,marginLeft:48},tableLabel:{justifyContent:"end",marginTop:-38},pending:{backgroundColor:ce},copyToClipboard:{marginLeft:"auto",paddingTop:6,paddingLeft:15,marginRight:-11},mono:{extend:$N,width:375,margin:"".concat(12,"px ").concat(24,"px")}},HN=Object(j.a)(qN),VN=165,UN=140,GN=130,XN=x()(CN||(CN=Object(l.a)(["\n {\n funding {\n cryptoCode\n errorMsg\n fundingAddress\n fundingAddressUrl\n confirmedBalance\n pending\n fiatConfirmedBalance\n fiatPending\n fiatCode\n display\n unitScale\n }\n }\n"]))),_N=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Tb.utils.formatCryptoAddress(e,t).replace(/(.{4})/g,"$1 ")},KN=function(e,t){return e.plus(t)},ZN=function(e){return new vl.a(e).toFormat(2)},YN=function(e){return ZN(e.filter((function(e){return!e.errorMsg})).map((function(e){return new vl.a(e.fiatConfirmedBalance)})).reduce(KN,new vl.a(0)))},QN=function(){var e,t=Object(r.useState)(null),n=Object(c.a)(t,2),a=n[0],i=n[1],o=Object(r.useState)(!1),l=Object(c.a)(o,1)[0],s=HN(),d=[{cryptoAmount:2,balance:10.23,fiatValue:1e3,date:new Date,performedBy:null,pending:!0},{cryptoAmount:10,balance:12.23,fiatValue:12e3,date:new Date,performedBy:null},{cryptoAmount:5,balance:5,fiatValue:5e4,date:new Date,performedBy:null}],m=Object(u.c)(XN),h=m.data,b=m.loading,p=null!==(e=T.a(["funding"])(h))&&void 0!==e?e:[];p.length&&!a&&i(p[0]);var j=ZN(p.filter((function(e){return!e.errorMsg})).map((function(e){return new vl.a(e.fiatPending)})).reduce(KN,new vl.a(0))),f=function(e){return e>=0?"+":""};return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)("div",{children:Object(Me.jsx)(yn,{children:"Funding"})}),Object(Me.jsxs)("div",{className:s.wrapper,children:[Object(Me.jsx)(di,{data:p,isSelected:function(e){return a&&a.cryptoCode===e.cryptoCode},onClick:i,displayName:function(e){return e.display},itemRender:function(e,t){var n,r,a=(n={},Object(z.a)(n,s.item,!0),Object(z.a)(n,s.inactiveItem,!t),n),i=(r={},Object(z.a)(r,s.itemWrapper,!0),Object(z.a)(r,s.error,e.errorMsg),r);return Object(Me.jsxs)("div",{className:E()(i),children:[Object(Me.jsx)("div",{className:s.firstItem,children:e.display}),!e.errorMsg&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)("div",{className:E()(a),children:[ZN(e.fiatConfirmedBalance)," ",e.fiatCode]}),Object(Me.jsxs)("div",{className:E()(a),children:[e.confirmedBalance," ",e.cryptoCode]})]})]})},loading:b,children:p.length&&Object(Me.jsxs)("div",{className:s.total,children:[Object(Me.jsx)(et,{className:s.totalTitle,children:"Total Crypto Balance"}),Object(Me.jsxs)(_e,{noMargin:!0,children:[YN(p),p[0].fiatCode]}),Object(Me.jsxs)(et,{className:s.totalPending,children:["(",f(j)," ",j," pending)"]})]})}),a&&!l&&a.errorMsg&&Object(Me.jsx)("div",{className:s.main,children:Object(Me.jsx)("div",{className:s.firstSide,children:Object(Me.jsx)(Ze,{className:s.error,children:a.errorMsg})})}),a&&!l&&!a.errorMsg&&Object(Me.jsxs)("div",{className:s.main,children:[Object(Me.jsxs)("div",{className:s.firstSide,children:[Object(Me.jsxs)(Ve,{children:["Balance (",a.display,")"]}),Object(Me.jsxs)("div",{className:s.coinTotal,children:[Object(Me.jsx)(_e,{inline:!0,noMargin:!0,children:"".concat(a.confirmedBalance," ").concat(a.cryptoCode)}),Object(Me.jsx)(Ke,{inline:!0,noMargin:!0,className:s.leftSpacer,children:"(".concat(f(a.pending)," ").concat(a.pending," pending)")})]}),Object(Me.jsxs)("div",{className:s.coinTotal,children:[Object(Me.jsx)(Ze,{inline:!0,noMargin:!0,children:"= ".concat(ZN(a.fiatConfirmedBalance)," ").concat(a.fiatCode)}),Object(Me.jsx)(nt,{inline:!0,noMargin:!0,className:s.leftSpacer,children:"(".concat(f(a.fiatPending)," ").concat(ZN(a.fiatPending)," pending)")})]}),Object(Me.jsx)(Ve,{className:s.topSpacer,children:"Address"}),Object(Me.jsx)("div",{className:s.addressWrapper,children:Object(Me.jsx)("div",{className:s.mono,children:Object(Me.jsx)("strong",{children:Object(Me.jsx)(Pb,{buttonClassname:s.copyToClipboard,children:_N(a.cryptoCode,a.fundingAddress)})})})})]}),Object(Me.jsxs)("div",{className:s.secondSide,children:[Object(Me.jsxs)(et,{children:["Scan to send ",a.display]}),Object(Me.jsx)(fn.a,{size:240,fgColor:J,value:a.fundingAddressUrl})]})]}),a&&l&&Object(Me.jsxs)("div",{children:[Object(Me.jsx)(WN,{className:s.tableLabel,label:"Pending",color:"#cacaca"}),Object(Me.jsxs)(Nu,{className:s.table,children:[Object(Me.jsxs)(Iu,{children:[Object(Me.jsx)(Lu,{header:!0,width:VN,children:"Amount Entered"}),Object(Me.jsx)(Lu,{header:!0,width:VN,children:"Balance After"}),Object(Me.jsx)(Lu,{header:!0,width:VN,children:"Cash Value"}),Object(Me.jsx)(Lu,{header:!0,width:GN,children:"Date"}),Object(Me.jsx)(Lu,{header:!0,width:UN,children:"Time (h:m:s)"}),Object(Me.jsx)(Lu,{header:!0,width:VN,children:"Performed By"})]}),Object(Me.jsx)(Fu,{children:d.map((function(e,t){return Object(Me.jsxs)(Bu,{className:E()(Object(z.a)({},s.pending,e.pending)),children:[Object(Me.jsxs)(Lu,{width:VN,children:[e.cryptoAmount," ",a.cryptoCode]}),Object(Me.jsxs)(Lu,{width:VN,children:[e.balance," ",a.cryptoCode]}),Object(Me.jsxs)(Lu,{width:VN,children:[e.fiatValue," ",a.fiatCode]}),Object(Me.jsx)(Lu,{width:GN,children:Object(js.a)("yyyy-MM-dd",e.date)}),Object(Me.jsx)(Lu,{width:UN,children:Object(js.a)("hh:mm:ss",e.date)}),Object(Me.jsx)(Lu,{width:VN,children:"add"})]},t)}))})]})]})]})]})};function JN(){return(JN=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function eI(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var tI=r.createElement("circle",{cx:52,cy:32,r:32,fill:"#F7931A"}),nI=r.createElement("path",{d:"m66.1 27.4c0.6-4.3-2.6-6.5-7-8.1l1.4-5.8-3.5-0.9-1.4 5.6c-0.9-0.2-1.9-0.4-2.8-0.7l1.4-5.7-3.5-0.9-1.4 5.8c-0.8-0.2-1.5-0.3-2.2-0.5l0 0-4.8-1.2-0.9 3.8s2.6 0.6 2.6 0.6c1.4 0.4 1.7 1.3 1.6 2l-1.6 6.6c0.1 0 0.2 0.1 0.4 0.1-0.1 0-0.2-0.1-0.4-0.1l-2.3 9.2c-0.2 0.4-0.6 1.1-1.6 0.8 0 0.1-2.6-0.6-2.6-0.6l-1.7 4 4.6 1.1c0.9 0.2 1.7 0.4 2.5 0.6l-1.5 5.8 3.5 0.9 1.4-5.8c1 0.3 1.9 0.5 2.8 0.7l-1.4 5.7 3.5 0.9 1.5-5.8c6 1.1 10.5 0.7 12.4-4.7 1.5-4.4-0.1-6.9-3.2-8.5 2.3-0.5 4-2 4.5-5.2zm-8 11.2c-1.1 4.4-8.4 2-10.8 1.4l1.9-7.7c2.4 0.6 10 1.8 8.9 6.3zm1.1-11.3c-1 4-7.1 2-9.1 1.5l1.7-7c2 0.5 8.4 1.4 7.3 5.6z",fill:"#FFF"});function rI(e,t){var n=e.title,a=e.titleId,i=eI(e,["title","titleId"]);return r.createElement("svg",JN({xmlns:"http://www.w3.org/2000/svg",width:104,height:64,ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,tI,nI)}var aI=r.forwardRef(rI);n.p;function iI(){return(iI=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function oI(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var cI=r.createElement("path",{fill:"#0AC18E",d:"m0,0l29.7,0a39,39,0,0,0,0,64l-29.7,0zm52,0a32,32,0,0,0,0,64a32,32,0,0,0,0,-64m52,0l-29.7,0a39,39,0,0,1,0,64l29.7,0z"}),lI=r.createElement("path",{fill:"#FFF",transform:"rotate(-28 52 32)",d:"m66.103,27.444c0.637-4.258-2.605-6.547-7.038-8.074l1.438-5.768-3.511-0.875-1.4,5.616c-0.923-0.23-1.871-0.447-2.813-0.662l1.41-5.653-3.509-0.875-1.439,5.766c-0.764-0.174-1.514-0.346-2.242-0.527l0.004-0.018-4.842-1.209-0.934,3.75s2.605,0.597,2.55,0.634c1.422,0.355,1.679,1.296,1.636,2.042l-1.638,6.571c0.098,0.025,0.225,0.061,0.365,0.117-0.117-0.029-0.242-0.061-0.371-0.092l-2.296,9.205c-0.174,0.432-0.615,1.08-1.609,0.834,0.035,0.051-2.552-0.637-2.552-0.637l-1.743,4.019,4.569,1.139c0.85,0.213,1.683,0.436,2.503,0.646l-1.453,5.834,3.507,0.875,1.439-5.772c0.958,0.26,1.888,0.5,2.798,0.726l-1.434,5.745,3.511,0.875,1.453-5.823c5.987,1.133,10.489,0.676,12.384-4.739,1.527-4.36-0.076-6.875-3.226-8.515,2.294-0.529,4.022-2.038,4.483-5.155zm-8.022,11.249c-1.085,4.36-8.426,2.003-10.806,1.412l1.928-7.729c2.38,0.594,10.012,1.77,8.878,6.317zm1.086-11.312c-0.99,3.966-7.1,1.951-9.082,1.457l1.748-7.01c1.982,0.494,8.365,1.416,7.334,5.553z"});function sI(e,t){var n=e.title,a=e.titleId,i=oI(e,["title","titleId"]);return r.createElement("svg",iI({xmlns:"http://www.w3.org/2000/svg",width:104,height:64,ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,cI,lI)}var dI=r.forwardRef(sI);n.p;function uI(){return(uI=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function mI(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var hI=r.createElement("circle",{cx:1e3,cy:1e3,r:1e3,fill:"#2573c2"}),bI=r.createElement("g",{fill:"#fff"},r.createElement("path",{d:"M1652.6 736.8a143.65 143.65 0 0 0-19.2-63.6c-10-20-27.8-35.6-48.6-43.6a143.51 143.51 0 0 0-68.4-15H628.8l-63.6 190.6h804.2l-127 389.6h-804l-63.6 190.6h891.8a246.33 246.33 0 0 0 77.8-15c25-14.2 53.6-28.6 77.8-48.6a382.69 382.69 0 0 0 63.6-63.6 432.2 432.2 0 0 0 39.2-73.4l117.8-370.4a137.38 137.38 0 0 0 9.8-77.6z"}),r.createElement("path",{d:"M882.2 911.6H409l-63.6 176.2h478z"}));function pI(e,t){var n=e.title,a=e.titleId,i=mI(e,["title","titleId"]);return r.createElement("svg",uI({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2000 2000",width:2500,height:2500,ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,hI,bI)}var jI=r.forwardRef(pI);n.p;function fI(){return(fI=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function gI(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var OI=r.createElement("g",null,r.createElement("polygon",{fill:"#343434",points:"127.9611 0 125.1661 9.5 125.1661 285.168 127.9611 287.958 255.9231 212.32"}),r.createElement("polygon",{fill:"#8C8C8C",points:"127.962 0 0 212.32 127.962 287.959 127.962 154.158"}),r.createElement("polygon",{fill:"#3C3C3B",points:"127.9611 312.1866 126.3861 314.1066 126.3861 412.3056 127.9611 416.9066 255.9991 236.5866"}),r.createElement("polygon",{fill:"#8C8C8C",points:"127.962 416.9052 127.962 312.1852 0 236.5852"}),r.createElement("polygon",{fill:"#141414",points:"127.9611 287.9577 255.9211 212.3207 127.9611 154.1587"}),r.createElement("polygon",{fill:"#393939",points:"0.0009 212.3208 127.9609 287.9578 127.9609 154.1588"}));function xI(e,t){var n=e.title,a=e.titleId,i=gI(e,["title","titleId"]);return r.createElement("svg",fI({width:"256px",height:"417px",viewBox:"0 0 256 417",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",preserveAspectRatio:"xMidYMid",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,OI)}var vI=r.forwardRef(xI);n.p;function yI(){return(yI=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function wI(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var CI=r.createElement("circle",{fill:"#989898",cx:52,cy:32,r:32}),kI=r.createElement("path",{fill:"#FFF",d:"m46.92598,12.31703l-4.97801,18.8088l-3.42705,1.32711l-1.64691,6.17189l3.42705,-1.29514l-2.8461,10.76083l30.60893,0l2.09993,-7.98401l-18.42505,0l2.09993,-7.82412l3.3631,-1.26316l1.6469,-6.17188l-3.36309,1.29513l3.6509,-13.83611l-12.21053,0z"});function SI(e,t){var n=e.title,a=e.titleId,i=wI(e,["title","titleId"]);return r.createElement("svg",yI({xmlns:"http://www.w3.org/2000/svg",width:104,height:64,ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,CI,kI)}var NI=r.forwardRef(SI);n.p;function II(){return(II=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function EI(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var FI=r.createElement("path",{d:"M1000 0c552.26 0 1000 447.74 1000 1000s-447.76 1000-1000 1000S0 1552.38 0 1000 447.68 0 1000 0",fill:"#53ae94"}),LI=r.createElement("path",{d:"M1123.42 866.76V718h340.18V491.34H537.28V718H877.5v148.64C601 879.34 393.1 934.1 393.1 999.7s208 120.36 484.4 133.14v476.5h246V1132.8c276-12.74 483.48-67.46 483.48-133s-207.48-120.26-483.48-133m0 225.64v-.12c-6.94.44-42.6 2.58-122 2.58-63.48 0-108.14-1.8-123.88-2.62v.2C633.34 1081.66 451 1039.12 451 988.22S633.36 894.84 877.62 884v166.1c16 1.1 61.76 3.8 124.92 3.8 75.86 0 114-3.16 121-3.8V884c243.8 10.86 425.72 53.44 425.72 104.16s-182 93.32-425.72 104.18",fill:"#fff"});function DI(e,t){var n=e.title,a=e.titleId,i=EI(e,["title","titleId"]);return r.createElement("svg",II({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2000 2000",width:2500,height:2500,ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,FI,LI)}var PI=r.forwardRef(DI);n.p;function BI(){return(BI=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function RI(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var AI=r.createElement("style",{type:"text/css"},"\n\t.st0{fill:#231F20;}\n\t.st1{fill:#F4B728;}\n"),TI=r.createElement("path",{className:"st0",d:"M245.4,20C121.1,20,20,121.1,20,245.4s101.1,225.4,225.4,225.4s225.4-101.1,225.4-225.4S369.7,20,245.4,20z M245.4,433.6c-103.8,0-188.2-84.4-188.2-188.2S141.6,57.2,245.4,57.2s188.2,84.4,188.2,188.2S349.2,433.6,245.4,433.6z"}),MI=r.createElement("circle",{className:"st1",cx:245.4,cy:245.4,r:177.6}),WI=r.createElement("polygon",{className:"st0",points:"165,315.5 165,349.9 226.5,349.9 226.5,387.6 264.3,387.6 264.3,349.9 325.8,349.9 325.8,304.4 230.4,304.4 325.8,175 325.8,140.6 264.3,140.6 264.3,103 226.5,103 226.5,140.6 165,140.6 165,186.2 260.4,186.2 "});function zI(e,t){var n=e.title,a=e.titleId,i=RI(e,["title","titleId"]);return r.createElement("svg",BI({id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 493.3 490.2",style:{enableBackground:"new 0 0 493.3 490.2"},xmlSpace:"preserve",ref:t,"aria-labelledby":a},i),AI,void 0===n?r.createElement("title",{id:a},"headerArtboard 7"):n?r.createElement("title",{id:a},n):null,TI,MI,WI)}var $I,qI,HI,VI,UI,GI,XI,_I,KI,ZI=r.forwardRef(zI),YI=(n.p,Object(j.a)({logo:{maxHeight:80,maxWidth:200},title:{margin:[[24,0,32,0]]},text:{margin:0},button:{marginTop:"auto",marginBottom:58},modalContent:{display:"flex",flexDirection:"column",alignItems:"center",padding:[[0,42]],flex:1}})),QI=function(e){var t=e.code,n=e.name,r=e.onContinue,a=YI(),i=function(e){switch(e){case"BTC":return aI;case"BCH":return dI;case"DASH":return jI;case"ETH":return vI;case"LTC":return NI;case"ZEC":return ZI;case"USDT":return PI;default:return null}}(t);return Object(Me.jsxs)("div",{className:a.modalContent,children:[Object(Me.jsx)(i,{className:a.logo}),Object(Me.jsxs)(qe,{className:a.title,children:["Enable ",n]}),Object(Me.jsxs)(Xe,{className:a.text,children:["You are about to enable ",n," on your system. This will allow you to use this cryptocurrency on your machines. To be able to do that, you\u2019ll have to set up all the necessary 3rd party services."]}),Object(Me.jsx)(Tn,{className:a.button,onClick:r,children:"Start configuration"})]})},JI={title:{margin:[[0,0,12,0]]},subtitle:{margin:[[32,0,21,0]]},error:{color:me},button:{marginLeft:"auto"},submit:{display:"flex",flexDirection:"row",margin:[["auto",0,24]]},radioGroup:{flexDirection:"row"},radioLabel:{width:150,height:48},radio:{padding:4,margin:4},setupNew:{display:"flex",alignItems:"center",height:48},picker:{width:150},horizontalAlign:{display:"flex",flexDirection:"row"},centerAlignment:{alignItems:"center"},zeroConfLimit:{marginRight:5,"& > div":{fontSize:fe,fontFamily:pe,fontWeight:300,"& > input":{padding:[[6,0,2]]}}}},eE=Object(j.a)(JI),tE={form:null,selected:null,isNew:!1,iError:!1},nE=function(e,t){switch(t.type){case"select":return{form:null,selected:t.selected,isNew:null,iError:!1};case"new":return{form:e.form,selected:null,isNew:!0,iError:!1};case"form":return{form:t.form,selected:t.form.code,isNew:!0,iError:!1};case"error":return Gn.a(e,{innerError:!0});case"reset":return tE;default:throw new Error}},rE=function(e){var t,n=e.type,a=e.schema,i=e.coin,o=e.name,l=e.step,s=e.error,d=e.lastStep,u=e.onContinue,m=e.fiatCurrency,h=e.filled,b=e.unfilled,p=e.getValue,j=eE(),f=Object(r.useReducer)(nE,tE),g=Object(c.a)(f,2),O=g[0],x=O.innerError,v=O.selected,y=O.form,w=O.isNew,C=g[1];Object(r.useEffect)((function(){C({type:"reset"})}),[l]);var k=function(e,t){if(!e||!e[n])return C({type:"error"});u(e,t)},S=d?"Finish":"Next",N=null!==o&&void 0!==o?o:n,I=(t={},Object(z.a)(t,j.subtitle,!0),Object(z.a)(t,j.error,x),t);return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Ke,{className:j.title,children:Uu(N)}),Object(Me.jsx)(GO,{steps:5,currentStep:l}),Object(Me.jsx)(Ue,{className:E()(I),children:l<4?"Select a ".concat(N," or set up a new one"):"Select ".concat(N," for ").concat(i)}),5!==l&&Object(Me.jsx)(xa,{options:h,value:v,className:j.radioGroup,onChange:function(e,t){C({type:"select",selected:t})},labelClassName:j.radioLabel,radioClassName:j.radio}),5===l&&Object(Me.jsx)(pn.d,{validateOnBlur:!1,validateOnChange:!0,initialValues:{zeroConfLimit:""},enableReinitialize:!0,validationSchema:a,children:function(e){e.values;var t=e.setFieldValue;return Object(Me.jsx)(pn.c,{children:Object(Me.jsxs)("div",{className:E()(j.horizontalAlign,j.lineAlignment),children:[Object(Me.jsx)(pn.b,{component:qa,decimalPlaces:0,width:50,placeholder:"0",name:"zeroConfLimit",onChange:function(e){C({type:"select",selected:e.target.value}),t(e.target.id,e.target.value)},className:j.zeroConfLimit}),Object(Me.jsx)(Ke,{children:m})]})})}}),Object(Me.jsxs)("div",{className:j.setupNew,children:[!Wr.a(b)&&!P.a(b)&&Object(Me.jsx)(xa,{value:w,onChange:function(e,t){C({type:"new"})},labelClassName:j.radioLabel,radioClassName:j.radio,options:[{display:"Set up new",code:!0}]}),w&&Object(Me.jsx)(_r,{fullWidth:!0,label:"Select ".concat(N),className:j.picker,getOptionSelected:$r.a("code"),labelProp:"display",options:b,onChange:function(e,t){C({type:"form",form:t})}})]}),y&&Object(Me.jsx)(jg,{save:function(e){return k(Object(z.a)({},n,y.code),Object(z.a)({},y.code,e))},elements:Jg[y.code].elements,validationSchema:Jg[y.code].validationSchema,value:p(y.code),buttonLabel:S}),!y&&Object(Me.jsxs)("div",{className:j.submit,children:[s&&Object(Me.jsx)(Ao,{children:"Failed to save"}),Object(Me.jsx)(Tn,{className:j.button,onClick:function(){return k(Object(z.a)({},n,v))},children:S})]})]})},aE=function(e,t){return M.a((function(n){return function(e){return W.a("class",e)}(t)(n)&&function(e){return L.a(_o.a(e),R.a("cryptos"))}(e)(n)}))},iE=M.a((function(e){return!e.deprecated})),oE=function(e,t,n,r){var a=iE(aE(r,n)(e)),i=Yl.a((function(e){var n=e.code,r=function(e){return t&&t[e]}(n);return!Jg[n]||(0,Jg[n].getValidationSchema)(r).isValidSync(r)}))(a),o=Object(c.a)(i,2);return{filled:o[0],unfilled:o[1]}},cE=function(e){var t=e.coin,n=e.onClose,a=e.accountsConfig,i=e.accounts,o=e.fiatCurrency,l=e.save,d=e.error,u=Object(r.useState)({step:0,config:{active:!0},accountsToSave:{}}),m=Object(c.a)(u,2),h=m[0],b=h.step,p=h.config,j=h.accountsToSave,f=m[1],g="Enable ".concat(t.display),O=5===b,x={filled:aE(t.code,"ticker")(a)},v=oE(a,i,"wallet",t.code),y=oE(a,i,"exchange",t.code),w=oE(a,i,"zeroConf",t.code),C=function(){var e=Object(pc.a)(bc.a.mark((function e(n,r){var a,i,o,c;return bc.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=Gn.a(p,n),i=r?Gn.a(j,r):j,!O){e.next=6;break}return o=zb.a(yl.a(Tb.utils.getCryptoCurrency(t.code).units)),c=Object(s.a)(Object(s.a)({},a),{},{cryptoUnits:o}),e.abrupt("return",l(ql(t.code,c),i));case 6:f({step:b+1,config:a,accountsToSave:i});case 7:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();return Object(Me.jsxs)(AO,{title:0===b?null:g,handleClose:n,width:554,open:!0,children:[0===b&&Object(Me.jsx)(QI,{code:t.code,name:t.display,onContinue:function(){return C()}}),0!==b&&Object(Me.jsx)(rE,Object(s.a)(Object(s.a)({step:b,coin:t.display,fiatCurrency:o,error:d,lastStep:O},function(){switch(b){case 1:return Object(s.a)({type:"ticker"},x);case 2:return Object(s.a)({type:"wallet"},v);case 3:return Object(s.a)({type:"exchange"},y);case 4:return Object(s.a)({type:"zeroConf",name:"confidence checking",schema:xn.e().shape({zeroConfLimit:xn.d().required()})},w);case 5:return Object(s.a)({type:"zeroConfLimit",name:"0-conf limit"},w);default:return null}}()),{},{onContinue:C,getValue:function(e){return Tr.a(W.a("code",e))(i)}}))]})},lE=Object(j.a)({rightAligned:{marginTop:"20px",marginLeft:"auto",marginBottom:"20px"},rightLink:{marginLeft:"20px"}}),sE=x()($I||($I=Object(l.a)(["\n query getData {\n config\n accounts\n accountsConfig {\n code\n display\n class\n cryptos\n }\n currencies {\n code\n display\n }\n countries {\n code\n display\n }\n cryptoCurrencies {\n code\n display\n }\n languages {\n code\n display\n }\n machines {\n name\n deviceId\n }\n }\n"]))),dE=x()(qI||(qI=Object(l.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),uE=function(e){var t=e.open,n=e.close,r=e.save,a=lE();return Object(Me.jsxs)(AO,{title:"Change fiat currency?",handleClose:n,width:450,height:310,open:t,children:[Object(Me.jsx)(Xe,{children:"Please note that all values you set that were based on your prior fiat currency are still the same. If you need to adjust these to reflect the new fiat currency (such as minimum transaction amounts, fixed fees, and compliance triggers, for example), please do so now."}),Object(Me.jsx)(Xe,{children:"Also, if you have cash-out enabled, you must define new dispenser bill counts for the new currency for cash-out on the new currency to work."}),Object(Me.jsxs)("div",{className:a.rightAligned,children:[Object(Me.jsx)(or,{onClick:n,color:"secondary",children:"Cancel"}),Object(Me.jsx)(or,{className:a.rightLink,onClick:r,color:"primary",children:"Save"})]})]})},mE=function(e){var t,n,a,i,o,l,s=e.name,d=Object(r.useState)(!1),m=Object(c.a)(d,2),h=m[0],b=m[1],p=Object(r.useState)(null),j=Object(c.a)(p,2),f=j[0],g=j[1],O=Object(r.useState)(null),x=Object(c.a)(O,2),v=x[0],y=x[1],w=Object(r.useState)(!1),C=Object(c.a)(w,2),k=C[0],S=C[1],N=Object(r.useState)(!1),I=Object(c.a)(N,2),E=I[0],F=I[1],D=Object(u.c)(sE).data,P=Object(u.b)(dE,{onCompleted:function(){return b(!1)},refetchQueries:function(){return["getData"]},onError:function(e){return y(e)}}),B=Object(c.a)(P,1)[0],R=Object(r.useState)(null),A=Object(c.a)(R,2),T=A[0],M=A[1],z=(null===D||void 0===D?void 0:D.config)&&$l(s)(D.config),$=(null===D||void 0===D?void 0:D.config)&&$l(El)(D.config),q=null===D||void 0===D?void 0:D.accountsConfig,H=null!==(t=null===D||void 0===D?void 0:D.accounts)&&void 0!==t?t:[],V=null!==(n=null===D||void 0===D?void 0:D.cryptoCurrencies)&&void 0!==n?n:[],U=z&&!Wr.a(z)?z:Rf,G=null!==(a=U.overrides)&&void 0!==a?a:[],X=function(e){return M(null),B({variables:{config:e}})},_=function(e,t,n){var r=Qj.a(t,e)[0];if(!r)return n(t);var a=$l(r)($);if(!Uf.isValidSync(a))return g((function(){return function(){return n(t)}})),void b(r);n(t)};return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(uE,{open:T,close:function(){return M(null)},save:function(){return T&&X(T)}}),Object(Me.jsx)(Wo,{title:"Locales"}),Object(Me.jsx)(Qf,{children:Object(Me.jsx)(Xm,{title:"Default settings",error:null===v||void 0===v?void 0:v.message,titleLg:!0,name:"locale",enableEdit:!0,initialValues:U,save:function(e){var t=ql(s)(e.locale[0]);return z.fiatCurrency&&t.locale_fiatCurrency!==z.fiatCurrency?M(t):X(t)},validationSchema:Pf,data:Ry.a(U),elements:Lf(D,_),setEditing:function(e,t){return S(t)},forceDisable:E})}),Object(Me.jsx)(Qf,{children:Object(Me.jsx)(Xm,{error:null===v||void 0===v?void 0:v.message,title:"Overrides",titleLg:!0,name:"overrides",enableDelete:!0,enableEdit:!0,enableCreate:!0,initialValues:Af,save:function(e){var t=ql(s)(e);return y(null),B({variables:{config:t}})},validationSchema:Bf,data:null!==G&&void 0!==G?G:[],elements:Df(D,G,_),disableAdd:L.a(Wr.a,Qj.a)(null!==(i=null===D||void 0===D?void 0:D.machines.map((function(e){return e.deviceId})))&&void 0!==i?i:[],null!==(o=null===G||void 0===G?void 0:G.map((function(e){return e.machine})))&&void 0!==o?o:[]),setEditing:function(e,t){return F(t)},forceDisable:k})}),h&&Object(Me.jsx)(cE,{coin:Tr.a(W.a("code",h))(V),onClose:function(){return b(!1)},save:function(e){return X(ql(El)(e)).then((function(e){return f(),g(null),e}))},error:null===v||void 0===v?void 0:v.message,cryptoCurrencies:V,userAccounts:null===D||void 0===D||null===(l=D.config)||void 0===l?void 0:l.accounts,accounts:H,accountsConfig:q})]})},hE={identification:{display:"flex",flexDirection:"row",alignItems:"center","& > *:first-child":{marginLeft:0},"& > *":{marginLeft:6},"& > *:nth-child(3)":{marginLeft:15}},form:{display:"flex",flexDirection:"column",height:"100%","& > *:first-child":{marginTop:10},"& > *":{marginBottom:20}},customerAutocomplete:{width:350},discountRateWrapper:{display:"flex",flexDirection:"row",alignItems:"center"},discountInput:{display:"flex",flexDirection:"row",alignItems:"center"},footer:{display:"flex",flexDirection:"row",margin:[["auto",0,24,0]]},submit:{margin:[["auto",0,0,"auto"]]},error:{color:me}},bE=Object(j.a)(hE),pE={customer:"",discount:""},jE=xn.e().shape({customer:xn.g().required("A customer is required!"),discount:xn.d().required("A discount rate is required!").min(0,"Discount rate should be a positive number!").max(100,"Discount rate should have a maximum value of 100%!")}),fE=function(e,t,n){return e&&t?n?"Internal server error":e.customer&&t.customer?e.customer:e.discount&&t.discount?e.discount:null:null},gE=function(e){var t=e.showModal,n=e.setShowModal,r=e.onClose,a=e.creationError,i=e.addDiscount,o=e.customers,c=bE();return Object(Me.jsx)(Me.Fragment,{children:t&&Object(Me.jsx)(AO,{title:"Add individual customer discount",closeOnBackdropClick:!0,width:600,height:500,handleClose:r,open:!0,children:Object(Me.jsx)(pn.d,{validateOnBlur:!1,validateOnChange:!1,initialValues:pE,validationSchema:jE,onSubmit:function(e){!function(e,t){i({variables:{customerId:e,discount:parseInt(t)}}),n(!1)}(e.customer,e.discount)},children:function(e){var t=e.errors,n=e.touched;return Object(Me.jsxs)(pn.c,{id:"individual-discount-form",className:c.form,children:[Object(Me.jsx)("div",{className:c.customerAutocomplete,children:Object(Me.jsx)(pn.b,{name:"customer",label:"Select a customer",component:ka,fullWidth:!0,options:B.a((function(e){var t,n,r,a,i,o;return{code:e.id,display:"".concat(null!==(t=null===e||void 0===e||null===(n=e.idCardData)||void 0===n?void 0:n.firstName)&&void 0!==t?t:"").concat((null===e||void 0===e||null===(r=e.idCardData)||void 0===r?void 0:r.firstName)&&(null===e||void 0===e||null===(a=e.idCardData)||void 0===a?void 0:a.lastName)?" ":"").concat(null!==(i=null===e||void 0===e||null===(o=e.idCardData)||void 0===o?void 0:o.lastName)&&void 0!==i?i:""," (").concat(e.phone,")")}}))(o),labelProp:"display",valueProp:"code"})}),Object(Me.jsxs)("div",{children:[Object(Me.jsxs)("div",{className:c.discountRateWrapper,children:[Object(Me.jsx)(Ve,{children:"Define discount rate"}),Object(Me.jsxs)(ep,{width:304,children:[Object(Me.jsx)(Xe,{children:"This is a percentage discount off of your existing commission rates for a customer entering this code at the machine."}),Object(Me.jsx)(Xe,{children:"For instance, if you charge 8% commissions, and this code is set for 50%, then you'll instead be charging 4% on transactions using the code."})]})]}),Object(Me.jsxs)("div",{className:c.discountInput,children:[Object(Me.jsx)(pn.b,{name:"discount",size:"lg",autoComplete:"off",width:50,decimalScale:0,className:c.discountInputField,component:qa}),Object(Me.jsx)(Qe,{inline:!0,className:c.inputLabel,children:"%"})]})]}),Object(Me.jsxs)("div",{className:c.footer,children:[fE(t,n,a)&&Object(Me.jsx)(Ao,{children:fE(t,n,a)}),Object(Me.jsx)(Tn,{type:"submit",form:"individual-discount-form",className:c.submit,children:"Add discount"})]})]})}})})})},OE=Object(j.a)(hE),xE=x()(HI||(HI=Object(l.a)(["\n query individualDiscounts {\n individualDiscounts {\n id\n customerId\n discount\n }\n }\n"]))),vE=x()(VI||(VI=Object(l.a)(["\n mutation deleteIndividualDiscount($discountId: ID!) {\n deleteIndividualDiscount(discountId: $discountId) {\n id\n }\n }\n"]))),yE=x()(UI||(UI=Object(l.a)(["\n mutation createIndividualDiscount($customerId: ID!, $discount: Int!) {\n createIndividualDiscount(customerId: $customerId, discount: $discount) {\n id\n }\n }\n"]))),wE=x()(GI||(GI=Object(l.a)(["\n {\n customers {\n id\n phone\n idCardData\n phone\n }\n }\n"]))),CE=function(){var e=OE(),t=Object(r.useState)(!1),n=Object(c.a)(t,2),a=n[0],i=n[1],o=Object(r.useState)(),l=Object(c.a)(o,2),s=l[0],d=l[1],m=Object(r.useState)(""),h=Object(c.a)(m,2),b=h[0],p=h[1],j=Object(r.useState)(!1),f=Object(c.a)(j,2),g=f[0],O=f[1],x=function(){return O(!g)},v=Object(u.c)(xE),y=v.data,w=v.loading,C=Object(u.c)(wE),k=C.data,S=C.loading,N=Object(u.b)(yE,{refetchQueries:function(){return["individualDiscounts"]}}),I=Object(c.a)(N,2),E=I[0],F=I[1].error,L=function(e){var t=T.a(["customers"])(k);return Tr.a(W.a("id",e))(t)},D=Object(u.b)(vE,{onError:function(e){var t=e.message;p(null!==t&&void 0!==t?t:"Error while deleting row")},onCompleted:function(){return i(!1)},refetchQueries:function(){return["individualDiscounts"]}}),B=Object(c.a)(D,1)[0],R=[{header:"Identification",width:312,textAlign:"left",size:"sm",view:function(t){var n,r,a=L(t.customerId);return Object(Me.jsxs)("div",{className:e.identification,children:[Object(Me.jsx)(vp,{}),Object(Me.jsx)("span",{children:a.phone}),(null===a||void 0===a||null===(n=a.idCardData)||void 0===n?void 0:n.documentNumber)&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(up,{}),Object(Me.jsx)("span",{children:null===a||void 0===a||null===(r=a.idCardData)||void 0===r?void 0:r.documentNumber})]})]})}},{header:"Name",width:300,textAlign:"left",size:"sm",view:function(e){var t,n,r=L(e.customerId);return P.a(r.idCardData)?Object(Me.jsx)(Me.Fragment,{children:"-"}):Object(Me.jsx)(Me.Fragment,{children:"".concat(null!==(t=r.idCardData.firstName)&&void 0!==t?t:"").concat(r.idCardData.firstName&&r.idCardData.lastName?" ":"").concat(null!==(n=r.idCardData.lastName)&&void 0!==n?n:"")})}},{header:"Discount rate",width:220,textAlign:"left",size:"sm",view:function(e){return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Qe,{inline:!0,children:e.discount})," %"]})}},{header:"Revoke",width:100,textAlign:"center",size:"sm",view:function(e){return Object(Me.jsx)(tr,{onClick:function(){i(!0),d({variables:{discountId:e.id}})},children:Object(Me.jsx)(wm,{})})}}],A=w||S;return Object(Me.jsxs)(Me.Fragment,{children:[!A&&!Wr.a(y.individualDiscounts)&&Object(Me.jsx)(Po.a,{marginBottom:4,marginTop:-7,className:e.tableWidth,display:"flex",justifyContent:"flex-end",children:Object(Me.jsx)(or,{color:"primary",onClick:x,children:"Add new code"})}),!A&&!Wr.a(y.individualDiscounts)&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Bv,{elements:R,data:T.a(["individualDiscounts"])(y)}),Object(Me.jsx)(Qu,{open:a,onDismissed:function(){i(!1),p(null)},onConfirmed:function(){p(null),B(s)},errorMessage:b})]}),!A&&Wr.a(y.individualDiscounts)&&Object(Me.jsxs)(Po.a,{display:"flex",alignItems:"left",flexDirection:"column",children:[Object(Me.jsx)(nt,{children:"It seems there are no active individual customer discounts on your network."}),Object(Me.jsx)(Tn,{onClick:x,children:"Add individual discount"})]}),Object(Me.jsx)(gE,{showModal:g,setShowModal:O,onClose:function(){O(!1)},creationError:F,addDiscount:E,customers:T.a(["customers"])(k)})]})},kE={footer:{display:"flex",flexDirection:"row",margin:[["auto",0,24,0]]},modalLabel1:{marginTop:20},modalLabel2Wrapper:{marginTop:40,display:"flex",flexDirection:"row",justifyContent:"flex-start"},discountInput:{display:"flex",flexDirection:"row",alignItems:"flex-start"},inputLabel:{color:J,fontFamily:pe,fontSize:24,marginLeft:8,marginTop:15},tableWidth:{width:620},error:{color:me},form:{display:"flex",flexDirection:"column",height:"100%"},submit:{margin:[["auto",0,0,"auto"]]}},SE=Object(j.a)(kE),NE={code:"",discount:""},IE=xn.e().shape({code:xn.g().required().trim().max(25),discount:xn.d().required().min(0).max(100)}),EE=function(e){var t=e.showModal,n=e.onClose,r=e.errorMsg,a=e.addCode,i=SE();return Object(Me.jsx)(Me.Fragment,{children:t&&Object(Me.jsx)(AO,{title:"Add promo code discount",closeOnBackdropClick:!0,width:600,height:500,handleClose:n,open:!0,children:Object(Me.jsx)(pn.d,{validateOnBlur:!1,validateOnChange:!1,initialValues:NE,validationSchema:IE,onSubmit:function(e){!function(e,t){a(Wb.a(e),parseInt(t))}(e.code,e.discount)},children:Object(Me.jsxs)(pn.c,{id:"promo-form",className:i.form,children:[Object(Me.jsx)(Ve,{className:i.modalLabel1,children:"Promo code name"}),Object(Me.jsx)(pn.b,{name:"code",autoFocus:!0,size:"lg",autoComplete:"off",width:338,inputProps:{style:{textTransform:"uppercase"}},component:Ua}),Object(Me.jsxs)("div",{className:i.modalLabel2Wrapper,children:[Object(Me.jsx)(Ve,{className:i.modalLabel2,children:"Define discount rate"}),Object(Me.jsxs)(ep,{width:304,children:[Object(Me.jsx)(Xe,{children:"This is a percentage discount off of your existing commission rates for a customer entering this code at the machine."}),Object(Me.jsx)(Xe,{children:"For instance, if you charge 8% commissions, and this code is set for 50%, then you'll instead be charging 4% on transactions using the code."})]})]}),Object(Me.jsxs)("div",{className:i.discountInput,children:[Object(Me.jsx)(pn.b,{name:"discount",size:"lg",autoComplete:"off",width:50,decimalScale:0,className:i.discountInputField,component:qa}),Object(Me.jsx)(Qe,{inline:!0,className:i.inputLabel,children:"%"})]}),Object(Me.jsxs)("div",{className:i.footer,children:[r&&Object(Me.jsx)(Ao,{children:r}),Object(Me.jsx)(Tn,{type:"submit",form:"promo-form",className:i.submit,children:"Add code"})]})]})})})})},FE=Object(j.a)(kE),LE="Failed to save",DE=x()(XI||(XI=Object(l.a)(["\n query promoCodes {\n promoCodes {\n id\n code\n discount\n }\n }\n"]))),PE=x()(_I||(_I=Object(l.a)(["\n mutation deletePromoCode($codeId: ID!) {\n deletePromoCode(codeId: $codeId) {\n id\n }\n }\n"]))),BE=x()(KI||(KI=Object(l.a)(["\n mutation createPromoCode($code: String!, $discount: Int!) {\n createPromoCode(code: $code, discount: $discount) {\n id\n code\n discount\n }\n }\n"]))),RE=function(){var e=FE(),t=Object(r.useState)(!1),n=Object(c.a)(t,2),a=n[0],i=n[1],o=Object(r.useState)(),l=Object(c.a)(o,2),s=l[0],d=l[1],m=Object(r.useState)(!1),h=Object(c.a)(m,2),b=h[0],p=h[1],j=Object(r.useState)(null),f=Object(c.a)(j,2),g=f[0],O=f[1],x=function(){return p(!b)},v=Object(u.c)(DE),y=v.data,w=v.loading,C=Object(u.b)(PE,{onError:function(e){var t=e.message;O(null!==t&&void 0!==t?t:"Error while deleting row")},onCompleted:function(){return i(!1)},refetchQueries:function(){return["promoCodes"]}}),k=Object(c.a)(C,1)[0],S=Object(u.b)(BE,{refetchQueries:function(){return["promoCodes"]}}),N=Object(c.a)(S,1)[0],I=[{header:"Code",width:300,textAlign:"left",size:"sm",view:function(e){return e.code}},{header:"Discount",width:220,textAlign:"left",size:"sm",view:function(e){return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Qe,{inline:!0,children:e.discount})," % in commissions"]})}},{header:"Delete",width:100,textAlign:"center",size:"sm",view:function(e){return Object(Me.jsx)(tr,{onClick:function(){i(!0),d({variables:{codeId:e.id}})},children:Object(Me.jsx)(wm,{})})}}];return Object(Me.jsxs)(Me.Fragment,{children:[!w&&!Wr.a(y.promoCodes)&&Object(Me.jsx)(Po.a,{marginBottom:4,marginTop:-7,className:e.tableWidth,display:"flex",justifyContent:"flex-end",children:Object(Me.jsx)(or,{color:"primary",onClick:x,children:"Add new code"})}),!w&&!Wr.a(y.promoCodes)&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Bv,{elements:I,data:T.a(["promoCodes"])(y)}),Object(Me.jsx)(Qu,{open:a,onDismissed:function(){i(!1),O(null)},onConfirmed:function(){O(null),k(s)},errorMessage:g})]}),!w&&Wr.a(y.promoCodes)&&Object(Me.jsxs)(Po.a,{display:"flex",alignItems:"left",flexDirection:"column",children:[Object(Me.jsx)(nt,{children:"Currently, there are no active promo codes on your network."}),Object(Me.jsx)(Tn,{onClick:x,children:"Add Code"})]}),Object(Me.jsx)(EE,{showModal:b,onClose:function(){O(null),p(!1)},errorMsg:g,addCode:function(e,t){O(null),N({variables:{code:e,discount:t}}).then((function(e){if(!e.errors)return p(!1);var t=Uo.a((function(e){return F.a("duplicate",null===e||void 0===e?void 0:e.message)}))(e.errors);O(t?"There is already a promotion with that code!":LE)})).catch((function(e){O(LE),console.log(e)}))}})]})},AE=n(929);function TE(){return(TE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function ME(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var WE=r.createElement("desc",null,"Created with Sketch."),zE=r.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("g",{id:"pop-up/action/download-logs/date-range-copy-3",transform:"translate(-117.000000, -116.000000)",stroke:"#1B2559",strokeWidth:2},r.createElement("g",{id:"arrow-download-logs",transform:"translate(128.500000, 124.500000) rotate(-90.000000) translate(-128.500000, -124.500000) translate(121.000000, 114.000000)"},r.createElement("polyline",{id:"Path-3",points:"0 13.3571429 7.14285714 20.5 14.2857143 13.3571429"}),r.createElement("line",{x1:7.14285714,y1:.142857143,x2:7.14285714,y2:20.1428571,id:"Path-4"}))));function $E(e,t){var n=e.title,a=e.titleId,i=ME(e,["title","titleId"]);return r.createElement("svg",TE({width:"23px",height:"17px",viewBox:"0 0 23 17",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),void 0===n?r.createElement("title",{id:a},"arrow download logs"):n?r.createElement("title",{id:a},n):null,WE,zE)}var qE=r.forwardRef($E),HE=(n.p,n(883)),VE=n(928),UE=n(882),GE=n(904),XE=n(881),_E=n(925),KE=n(926),ZE=n(927);function YE(){return(YE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function QE(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var JE=r.createElement("desc",null,"Created with Sketch."),eF=r.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"pop-up/action/download-logs/date-range-copy-2",transform:"translate(-20.000000, -187.000000)"},r.createElement("g",{id:"icon/sf-contain-b-copy-5",transform:"translate(30.000000, 197.000000) rotate(-270.000000) translate(-30.000000, -197.000000) translate(20.000000, 187.000000)"},r.createElement("g",{id:"icon/sf-small/wizzard",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("g",{transform:"translate(6.666667, 6.000000)",id:"Group"},r.createElement("g",null,r.createElement("polyline",{id:"Path-3",stroke:"#1B2559",strokeWidth:2,points:"0 4.83333333 3.33333333 8.16666667 6.66666667 4.83333333"}),r.createElement("line",{x1:3.33333333,y1:.25,x2:3.33333333,y2:6.5,id:"Path-4",stroke:"#1B2559",strokeWidth:2})))))));function tF(e,t){var n=e.title,a=e.titleId,i=QE(e,["title","titleId"]);return r.createElement("svg",YE({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,JE,eF)}var nF=r.forwardRef(tF);n.p;function rF(){return(rF=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function aF(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var iF=r.createElement("desc",null,"Created with Sketch."),oF=r.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"pop-up/action/download-logs/date-range-copy-2",transform:"translate(-20.000000, -187.000000)"},r.createElement("g",{id:"icon/sf-contain-b-copy-5",transform:"translate(30.000000, 197.000000) rotate(270.000000) translate(-30.000000, -197.000000) translate(20.000000, 187.000000)"},r.createElement("g",{id:"icon/sf-small/wizzard",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("g",{transform:"translate(6.666667, 6.000000)",id:"Group"},r.createElement("g",null,r.createElement("polyline",{id:"Path-3",stroke:"#1B2559",strokeWidth:2,points:"0 4.83333333 3.33333333 8.16666667 6.66666667 4.83333333"}),r.createElement("line",{x1:3.33333333,y1:.25,x2:3.33333333,y2:6.5,id:"Path-4",stroke:"#1B2559",strokeWidth:2})))))));function cF(e,t){var n=e.title,a=e.titleId,i=aF(e,["title","titleId"]);return r.createElement("svg",rF({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,iF,oF)}var lF,sF,dF,uF,mF=r.forwardRef(cF),hF=(n.p,{wrapper:{height:26,display:"flex",alignItems:"center",justifyContent:"center",position:"relative",overflow:"hidden"},button:{outline:"none",extend:Re.label1,border:"none",cursor:"pointer",backgroundColor:"transparent",color:J,zIndex:2},lowerBound:{left:"50%"},upperBound:{right:"50%"},selected:{width:26,height:26,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:H,borderRadius:"50%",position:"absolute",zIndex:1},between:{position:"absolute",width:"100%",height:"100%",zIndex:0,backgroundColor:V},disabled:{color:oe,cursor:"default"}}),bF=Object(j.a)(hF),pF=function(e){var t,n,r,a=e.isLowerBound,i=e.isUpperBound,o=e.isBetween,c=e.isDisabled,l=e.children,s=(Object($.a)(e,["isLowerBound","isUpperBound","isBetween","isDisabled","children"]),bF()),d=a||i,u=(t={},Object(z.a)(t,s.between,o&&!(a&&i)),Object(z.a)(t,s.lowerBound,a&&!i),Object(z.a)(t,s.upperBound,i&&!a),t),m=(n={},Object(z.a)(n,s.wrapper,!0),Object(z.a)(n,s.selected,d),n),h=(r={},Object(z.a)(r,s.button,!0),Object(z.a)(r,s.disabled,c),r);return Object(Me.jsxs)("div",{className:s.wrapper,children:[Object(Me.jsx)("div",{className:E()(u)}),Object(Me.jsx)("div",{className:E()(m),children:Object(Me.jsx)("button",{className:E()(h),children:l})})]})},jF={wrapper:{display:"flex",flexDirection:"column",alignItems:"center"},button:{outline:"none"},navbar:{extend:Re.p,display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%",padding:[[15,15]],color:J,"& button":{display:"flex",alignItems:"center",padding:0,border:"none",backgroundColor:G,cursor:"pointer",borderRadius:"50%",width:20,height:20,position:"relative",overflow:"hidden","& svg":{position:"absolute",left:0}}},table:{borderCollapse:"collapse",width:"100%",color:J,"& tr":{"&:first-child":{paddingLeft:5},"&:last-child":{paddingRight:5}},"& th, & td":{margin:0,padding:[[3,0,3,0]]},"& th":{extend:Re.label2}}},fF=Object(j.a)(jF),gF=function(e){var t=e.minDate,n=e.maxDate,a=e.handleSelect,i=Object($.a)(e,["minDate","maxDate","handleSelect"]),o=Object(r.useState)(new Date),l=Object(c.a)(o,2),s=l[0],d=l[1],u=fF(),m=Array.from(Array(7)).map((function(e,t){return Object(js.a)("EEEEE",Object(Rs.a)({days:t},Object(px.a)(new Date)))})),h=function(e){var t=Object(Xl.a)({months:1},e),n=TO.a(0,Object(_E.a)(Object(KE.a)(e))).reverse(),r=B.a((function(e){return Object(Xl.a)({days:e},Object(ZE.a)(t))}))(n),a=TO.a(0,function(e){return Object(XE.a)(e)}(e)),i=B.a((function(t){return Object(Rs.a)({days:t},Object(KE.a)(e))}))(a),o=Object(Rs.a)({months:1},e),c=TO.a(0,42-r.length-i.length),l=B.a((function(e){return Object(Rs.a)({days:e},Object(KE.a)(o))}))(c);return Vo.a(Vo.a(r,i),l)},b=function(e,t){return h(e).slice(7*t-7,7*t)};return Object(Me.jsxs)("div",{className:u.wrapper,children:[Object(Me.jsxs)("div",{className:u.navbar,children:[Object(Me.jsx)("button",{className:u.button,onClick:function(){return function(e){var n=Object(Xl.a)({months:1},e);d(t?Object(VE.a)(t,n)||Object(UE.a)(t,n)>0?n:s:n)}(s)},children:Object(Me.jsx)(nF,{})}),Object(Me.jsx)("span",{children:"".concat(Object(js.a)("MMMM",s)," ").concat(Object(js.a)("yyyy",s))}),Object(Me.jsx)("button",{className:u.button,onClick:function(){return function(e){var t=Object(Rs.a)({months:1},e);d(n?Object(VE.a)(n,t)||Object(UE.a)(t,n)>0?t:s:t)}(s)},children:Object(Me.jsx)(mF,{})})]}),Object(Me.jsxs)("table",{className:u.table,children:[Object(Me.jsx)("thead",{children:Object(Me.jsx)("tr",{children:m.map((function(e,t){return Object(Me.jsx)("th",{children:e},t)}))})}),Object(Me.jsx)("tbody",{children:TO.a(1,8).map((function(e,r){return Object(Me.jsx)("tr",{children:b(s,e).map((function(e,r){return Object(Me.jsx)("td",{onClick:function(){return a(e,t,n)},children:Object(Me.jsx)(pF,{isDisabled:n&&Object(_l.a)(n,e)||t&&Object(_l.a)(e,t),isLowerBound:Object(AE.a)(i.from,e),isUpperBound:Object(AE.a)(i.to,e),isBetween:Object(_l.a)(i.from,e)&&Object(_l.a)(e,i.to),children:Object(js.a)("d",e)})},r)}))},r)}))})]})]})},OF=Object(j.a)({wrapper:{backgroundColor:"white",borderRadius:10}}),xF=function(e){var t=e.minDate,n=e.maxDate,a=e.className,i=e.onRangeChange,o=Object(r.useState)(null),l=Object(c.a)(o,2),s=l[0],d=l[1],u=Object(r.useState)(null),m=Object(c.a)(u,2),h=m[0],b=m[1];Object(r.useEffect)((function(){i(s,h)}),[s,i,h]);var p=OF();return Object(Me.jsx)(Me.Fragment,{children:Object(Me.jsx)("div",{className:E()(p.wrapper,a),children:Object(Me.jsx)(gF,{from:s,to:h,minDate:t,maxDate:n,handleSelect:function(e,t,n){if(!(n&&Object(HE.a)(n,e)>0||t&&Object(HE.a)(e,t)>0))return s&&!h&&Object(HE.a)(e,s)>0?(b(s),void d(e)):void(s&&!h&&(Object(VE.a)(s,e)||Object(UE.a)(s,e)>0)?b(Object(GE.a)({hours:23,minutes:59,seconds:59,milliseconds:999},e)):(d(e),b(null)))}})})})},vF=Re.label1,yF=Re.h4,wF={wrapper:{height:46,width:99},container:{display:"flex"},monthWeekDayContainer:{display:"flex",flexDirection:"column"},label:{extend:vF,lineHeight:1.33,color:J},bigNumber:{extend:Re.info1,lineHeight:1,marginRight:7},monthYear:{extend:Re.label2,lineHeight:1.17,color:J},weekDay:{extend:vF,lineHeight:1.33,color:se}},CF=Object(j.a)(wF),kF=function(e){var t=e.date,n=e.children,r=(Object($.a)(e,["date","children"]),CF());return Object(Me.jsxs)("div",{className:r.wrapper,children:[Object(Me.jsx)("div",{className:r.label,children:n}),t&&Object(Me.jsx)(Me.Fragment,{children:Object(Me.jsxs)("div",{className:r.container,children:[Object(Me.jsx)("div",{className:r.bigNumber,children:Object(js.a)("d",t)}),Object(Me.jsxs)("div",{className:r.monthWeekDayContainer,children:[Object(Me.jsx)("span",{className:r.monthYear,children:"".concat(Object(js.a)("MMM",t)," ").concat(Object(js.a)("yyyy",t))}),Object(Me.jsx)("span",{className:r.weekDay,children:Object(js.a)("EEEE",t)})]})]})})]})},SF={popoverContent:{width:280},popoverHeader:{extend:yF,padding:[[15,15,0,15]]},radioButtonsContainer:{padding:[[5,15,5,15]]},radioButtons:{display:"flex",justifyContent:"space-between",flexDirection:"row",color:J},dateRangePickerShowing:{display:"block",height:"100%"},dateRangePickerHidden:{display:"none",height:0},download:{padding:[[10,15]]},dateContainerWrapper:{display:"flex",justifyContent:"space-between",alignItems:"center",position:"relative",backgroundColor:G,padding:[[0,15]],minHeight:70},arrowContainer:{position:"absolute",left:125,top:26},arrow:{margin:"auto"}},NF=Object(j.a)(SF),IF="all",EF="range",FF="advanced",LF="simplified",DF=function(e){var t,n=e.name,a=e.query,i=e.args,o=e.title,l=e.getLogs,d=e.timezone,m=e.simplified,h=Object(r.useState)(IF),b=Object(c.a)(h,2),p=b[0],j=b[1],f=Object(r.useState)(FF),g=Object(c.a)(f,2),O=g[0],x=g[1],v=Object(r.useState)({from:null,until:null}),y=Object(c.a)(v,2),w=y[0],C=y[1],k=Object(r.useState)(null),N=Object(c.a)(k,2),I=N[0],F=N[1],L=Object(u.a)(a,{onCompleted:function(e){return A(l(e),w)}}),D=Object(c.a)(L,1)[0],P=NF(),B=(t={},Object(z.a)(t,P.dateRangePickerShowing,p===EF),Object(z.a)(t,P.dateRangePickerHidden,p===IF),t),R=Object(r.useCallback)((function(e,t){C({from:e,until:t})}),[C]),A=function(e,t){var r=function(e){return Os(e,d,"yyyy-MM-dd_HH-mm")},a=new window.Blob([e],{type:"text/plain;charset=utf-8"});Hb.a.saveAs(a,p===IF?"".concat(r(new Date),"_").concat(n,".csv"):"".concat(r(t.from),"_").concat(r(t.until),"_").concat(n,".csv"))},M=[{display:"All logs",code:IF},{display:"Date range",code:EF}],W=[{display:"Advanced logs",code:FF},{display:"Simplified logs",code:LF}],$=Boolean(I),q=$?"date-range-popover":void 0;return Object(Me.jsx)(S.a,{onClickAway:function(){F(null)},children:Object(Me.jsxs)("div",{children:[Object(Me.jsx)(Vn,{Icon:Qp,InverseIcon:Hp,onClick:function(e){F(I?null:e.currentTarget)},variant:"contained"}),Object(Me.jsx)(Xn,{id:q,open:$,anchorEl:I,placement:"bottom",children:Object(Me.jsxs)("div",{className:P.popoverContent,children:[Object(Me.jsx)("div",{className:P.popoverHeader,children:o}),Object(Me.jsx)("div",{className:P.radioButtonsContainer,children:Object(Me.jsx)(xa,{name:"logs-select",value:p,options:M,ariaLabel:"logs-select",onChange:function(e){var t=T.a(["target","value"])(e);j(t),t===IF&&C({from:null,until:null})},className:P.radioButtons})}),p===EF&&Object(Me.jsxs)("div",{className:E()(B),children:[Object(Me.jsx)("div",{className:P.dateContainerWrapper,children:w&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(kF,{date:w.from,children:"From"}),Object(Me.jsx)("div",{className:P.arrowContainer,children:Object(Me.jsx)(qE,{className:P.arrow})}),Object(Me.jsx)(kF,{date:w.until,children:"To"})]})}),Object(Me.jsx)(xF,{maxDate:new Date,onRangeChange:R})]}),m&&Object(Me.jsx)("div",{className:P.radioButtonsContainer,children:Object(Me.jsx)(xa,{name:"simplified-tx-logs",value:O,options:W,ariaLabel:"simplified-tx-logs",onChange:function(e){var t=T.a(["target","value"])(e);x(t)},className:P.radioButtons})}),Object(Me.jsx)("div",{className:P.download,children:Object(Me.jsx)(or,{color:"primary",onClick:function(){return function(e,t){p===IF&&D({variables:Object(s.a)(Object(s.a)({},t),{},{simplified:O===LF})}),e&&e.from&&(e.from&&!e.until&&(e.until=new Date),Object(AE.a)(e.until,e.from)&&(e.until=new Date),p===EF&&D({variables:Object(s.a)(Object(s.a)({},t),{},{from:e.from,until:e.until,simplified:O===LF})}))}(w,i)},children:"Download"})})]})})]})})},PF=Object(j.a)(Sb),BF=x()(lF||(lF=Object(l.a)(["\n {\n machines {\n name\n deviceId\n }\n }\n"]))),RF=x()(sF||(sF=Object(l.a)(["\n query MachineLogs(\n $deviceId: ID!\n $limit: Int\n $from: Date\n $until: Date\n $timezone: String\n ) {\n machineLogsCsv(\n deviceId: $deviceId\n limit: $limit\n from: $from\n until: $until\n timezone: $timezone\n )\n }\n"]))),AF=x()(dF||(dF=Object(l.a)(["\n query MachineLogs($deviceId: ID!, $limit: Int, $from: Date, $until: Date) {\n machineLogs(\n deviceId: $deviceId\n limit: $limit\n from: $from\n until: $until\n ) {\n logLevel\n id\n timestamp\n message\n }\n }\n"]))),TF=x()(uF||(uF=Object(l.a)(["\n query getData {\n config\n }\n"]))),MF=function(){var e,t,n=PF(),a=Object(r.useState)(null),i=Object(c.a)(a,2),o=i[0],l=i[1],s=Object(r.useState)(null),d=Object(c.a)(s,2),m=d[0],h=d[1],b=null===o||void 0===o?void 0:o.deviceId,p=Object(u.c)(BF).data,j=Object(u.c)(TF).data,f=T.a(["config","locale_timezone"],j),g=Object(u.c)(AF,{variables:{deviceId:b,limit:500},skip:!o,onCompleted:function(){return h("")}}),O=g.data,x=g.loading;(null===p||void 0===p||null===(e=p.machines)||void 0===e?void 0:e.length)&&!o&&l(null===p||void 0===p?void 0:p.machines[0]);return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)("div",{className:n.titleWrapper,children:Object(Me.jsxs)("div",{className:n.titleAndButtonsContainer,children:[Object(Me.jsx)(yn,{children:"Machine Logs"}),O&&Object(Me.jsxs)("div",{className:n.buttonsWrapper,children:[Object(Me.jsx)(DF,{title:"Download logs",name:o.name,query:RF,args:{deviceId:b,timezone:f},getLogs:function(e){return T.a(["machineLogsCsv"])(e)},timezone:f}),Object(Me.jsx)(Ze,{children:m})]})]})}),Object(Me.jsxs)("div",{className:n.wrapper,children:[Object(Me.jsx)(di,{displayName:function(e){return e.name},data:(null===p||void 0===p?void 0:p.machines)||[],isSelected:function(e){return T.a(["deviceId"])(o)===e.deviceId},onClick:l}),Object(Me.jsxs)("div",{className:n.tableWrapper,children:[Object(Me.jsxs)(xv,{className:n.table,children:[Object(Me.jsx)(Cv,{children:Object(Me.jsxs)(Lv,{header:!0,children:[Object(Me.jsx)(Nv,{className:n.dateColumn,children:"Date"}),Object(Me.jsx)(Nv,{className:n.levelColumn,children:"Level"}),Object(Me.jsx)(Nv,{className:n.fillColumn})]})}),Object(Me.jsx)(vv,{children:O&&O.machineLogs.map((function(e,t){return Object(Me.jsxs)(Lv,{size:"sm",children:[Object(Me.jsx)(wv,{children:f&&Os(e.timestamp,f,"YYYY-MM-DD HH:mm")}),Object(Me.jsx)(wv,{children:e.logLevel}),Object(Me.jsx)(wv,{children:e.message})]},t)}))})]}),x&&Object(Me.jsx)(Ue,{children:"Loading..."}),!x&&!(null===O||void 0===O||null===(t=O.machineLogs)||void 0===t?void 0:t.length)&&Object(Me.jsx)(Ue,{children:"No activity so far"})]})]})]})},WF=n(436);function zF(){return(zF=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function $F(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var qF=r.createElement("desc",null,"Created with Sketch."),HF=r.createElement("g",{id:"icon/sf-small/clock/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("g",{id:"Group-7",stroke:"#FFFFFF",strokeWidth:2},r.createElement("path",{d:"M0,10 C0,15.522 4.478,20 10,20 C15.522,20 20,15.522 20,10 C20,4.478 15.522,0 10,0 C7.749,0 5.671,0.744 4,1.999",id:"Stroke-1"}),r.createElement("polyline",{id:"Stroke-3",points:"13 11 10 11.063 10 7"}),r.createElement("polyline",{id:"Stroke-5",points:"3 0 3 3 5 4"})));function VF(e,t){var n=e.title,a=e.titleId,i=$F(e,["title","titleId"]);return r.createElement("svg",zF({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,qF,HF)}var UF=r.forwardRef(VF);n.p;function GF(){return(GF=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function XF(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var _F=r.createElement("desc",null,"Created with Sketch."),KF=r.createElement("g",{id:"icon/sf-small/clock/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("g",{id:"Group-7",stroke:"#1B2559",strokeWidth:2},r.createElement("path",{d:"M0,10 C0,15.522 4.478,20 10,20 C15.522,20 20,15.522 20,10 C20,4.478 15.522,0 10,0 C7.749,0 5.671,0.744 4,1.999",id:"Stroke-1"}),r.createElement("polyline",{id:"Stroke-3",points:"13 11 10 11.063 10 7"}),r.createElement("polyline",{id:"Stroke-5",points:"3 0 3 3 5 4"})));function ZF(e,t){var n=e.title,a=e.titleId,i=XF(e,["title","titleId"]);return r.createElement("svg",GF({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,_F,KF)}var YF,QF,JF,eL,tL,nL,rL,aL,iL=r.forwardRef(ZF),oL=(n.p,{cashbox:{height:36},tableContainer:{flex:1,marginBottom:100},tBody:{maxHeight:"65vh",overflow:"auto"},tableWidth:{display:"flex",alignItems:"center",marginRight:1},descriptions:{color:se,marginTop:0},cashboxReset:{color:se,margin:[[13,0,-5,20]]},selection:{marginRight:12}}),cL={footerLabel:{color:q,alignSelf:"center"},footerContent:{width:1200,maxHeight:64,display:"flex",justifyContent:"space-around",position:"fixed"},footerContainer:{position:"fixed",height:64,left:0,bottom:0,width:"100vw",backgroundColor:"white",display:"flex",justifyContent:"space-around",boxShadow:[[0,-1,10,0,"rgba(50, 50, 50, 0.1)"]]},flex:{display:"flex",marginLeft:-640},icon:{alignSelf:"center",height:20,width:20,marginRight:8},iconLabel:{alignSelf:"center",marginRight:8},valueDisplay:{alignSelf:"center"}},lL=Object(j.a)(cL),sL=function(e){var t=e.machines,n=e.config,r=e.currencyCode,a=(e.bills,e.deviceIds,lL()),i=n&&$l("cashOut")(n),o=function(e){return $l(e)(i)},c=Kl.a(Zl.a((function(e,t){var n,r,a,i,c=t.cassette1,l=t.cassette2,s=t.cassette3,d=t.cassette4,u=t.id,m=null!==(n=o(u).cassette1)&&void 0!==n?n:0,h=null!==(r=o(u).cassette2)&&void 0!==r?r:0,b=null!==(a=o(u).cassette3)&&void 0!==a?a:0,p=null!==(i=o(u).cassette4)&&void 0!==i?i:0;return[e[0]+=c*m,e[1]+=l*h,e[2]+=s*b,e[3]+=d*p]}),[0,0,0,0],t));return Object(Me.jsx)("div",{className:a.footerContainer,children:Object(Me.jsxs)("div",{className:a.footerContent,children:[Object(Me.jsx)(Ze,{className:a.footerLabel,children:"Cash value in System"}),Object(Me.jsxs)("div",{className:a.flex,children:[Object(Me.jsx)(gl,{className:a.icon}),Object(Me.jsx)(Ke,{className:a.iconLabel,children:"Cash-out:"}),Object(Me.jsxs)(_e,{className:a.valueDisplay,children:[c," ",r]})]})]})})},dL=n(442),uL=x()(YF||(YF=Object(l.a)(["\n query cashboxBatches {\n cashboxBatches {\n id\n deviceId\n created\n operationType\n customBillCount\n performedBy\n bills {\n fiat\n deviceId\n created\n cashbox\n }\n }\n }\n"]))),mL=x()(QF||(QF=Object(l.a)(["\n mutation editBatch($id: ID, $performedBy: String) {\n editBatch(id: $id, performedBy: $performedBy) {\n id\n }\n }\n"]))),hL=x()(JF||(JF=Object(l.a)(["\n query getData {\n config\n }\n"]))),bL=xn.e().shape({performedBy:xn.g().nullable()}),pL=Object(j.a)({operationType:{marginLeft:8},operationTypeWrapper:{display:"flex",flexDirection:"row",alignItems:"center"},saveAndCancel:{display:"flex",flexDirection:"row",justifyContent:"space-between"}}),jL=function(e){var t=e.machines,n=e.currency,a=pL(),i=Object(r.useState)(!1),o=Object(c.a)(i,2),l=o[0],m=o[1],h=Object(r.useState)([]),b=Object(c.a)(h,2),p=b[0],j=b[1],f=Object(u.c)(uL),g=f.data,O=f.loading,x=Object(u.b)(mL,{refetchQueries:function(){return["cashboxBatches"]}}),v=Object(c.a)(x,1)[0],y=Object(u.c)(hL),w=y.data,C=y.loading,k=T.a(["config","locale_timezone"],w),S=O&&C,N=T.a(["cashboxBatches"])(g),I=Zl.a((function(e,t){return dL.a(WF.a("cash-out-".concat(t,"-refill"),Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(gl,{}),Object(Me.jsxs)("span",{className:a.operationType,children:["Cash-out ",t," refill"]})]})),WF.a("cash-out-".concat(t,"-empty"),Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(gl,{}),Object(Me.jsxs)("span",{className:a.operationType,children:["Cash-out ",t," emptied"]})]})))(e)}),{"cash-in-empty":Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(ul,{}),Object(Me.jsx)("span",{className:a.operationType,children:"Cash-in emptied"})]})},TO.a(1,5)),E=function(e){j(M.a((function(t){return t.id!==e}),p))},F=function(e){return!Uo.a(W.a("id",e),p)},L=[{name:"operation",header:"Operation",width:200,textAlign:"left",view:function(e){return Object(Me.jsx)("div",{className:a.operationTypeWrapper,children:I[e.operationType]})}},{name:"machine",header:"Machine",width:200,textAlign:"left",view:function(e){return Tr.a(W.a("id",e.deviceId))(t).name}},{name:"billCount",header:"Bill Count",width:115,textAlign:"left",input:qa,inputProps:{decimalPlaces:0},view:function(e){return P.a(e.customBillCount)?e.bills.length:e.customBillCount}},{name:"total",header:"Total",width:100,textAlign:"right",view:function(e){return Object(Me.jsxs)("span",{children:[Kl.a(B.a((function(e){return R.a("fiat",e)}),e.bills))," ",n]})}},{name:"date",header:"Date",width:135,textAlign:"right",view:function(e){return Os(e.created,k,"YYYY-MM-DD")}},{name:"time",header:"Time (h:m)",width:125,textAlign:"right",view:function(e){return Os(e.created,k,"HH:mm")}},{name:"performedBy",header:"Performed by",width:180,textAlign:"left",view:function(e){return F(e.id)?P.a(e.performedBy)?"Unknown entity":e.performedBy:Object(Me.jsx)(Xr,{onChange:function(t){return j(B.a((function(n){return n.id===e.id?Object(s.a)(Object(s.a)({},n),{},{performedBy:t.target.value}):n}),p))},error:l,width:161.5,value:R.a("performedBy",Tr.a((function(t){return t.id===e.id}),p))})}},{name:"",header:"Edit",width:150,textAlign:"right",view:function(e){return F(e.id)?Object(Me.jsx)(tr,{onClick:function(){j([].concat(Object(d.a)(p),[{id:e.id,performedBy:e.performedBy}]))},children:Object(Me.jsx)(Mm,{})}):Object(Me.jsxs)("div",{className:a.saveAndCancel,children:[Object(Me.jsx)(or,{type:"submit",color:"primary",onClick:function(){return function(e){var t=Tr.a((function(t){return t.id===e.id}),p),n=""===t.performedBy?null:t.performedBy;return bL.isValid(t).then((function(){m(!1),v({variables:{id:e.id,performedBy:n}})})).catch(m(!0)),E(e.id)}(e)},children:"Save"}),Object(Me.jsx)(or,{color:"secondary",onClick:function(){return E(e.id)},children:"Cancel"})]})}}];return Object(Me.jsx)(Me.Fragment,{children:!S&&Object(Me.jsx)(Bv,{name:"cashboxHistory",elements:L,data:N,emptyText:"No cashbox batches so far"})})},fL=n.p+"static/media/both-filled.7af80d5f.svg",gL={button:{margin:[[35,"auto",0,"auto"]]},modalContent:{display:"flex",flexDirection:"column",alignItems:"center",flex:1,padding:[[0,34]]},splashTitle:{marginTop:15},warningInfo:{display:"flex",flexDirection:"row",alignItems:"center",marginTop:15},warningIcon:{width:25,height:25,marginRight:8,display:"block"},warningText:{flexBasis:"100%",flexGrow:1},machineName:{margin:[[5,0]],color:q}},OL=Object(j.a)(gL),xL=function(e){var t=e.name,n=e.onContinue,r=OL();return Object(Me.jsxs)("div",{className:r.modalContent,children:[Object(Me.jsx)("img",{width:"148",height:"196",alt:"cassette",src:fL}),Object(Me.jsx)(qe,{className:r.splashTitle,noMargin:!0,children:"Update counts"}),Object(Me.jsx)(Ke,{className:r.machineName,noMargin:!0,children:t}),Object(Me.jsxs)("div",{className:r.warningInfo,children:[Object(Me.jsx)(ia,{className:r.warningIcon}),Object(Me.jsx)(Xe,{noMargin:!0,className:r.warningText,children:"Before updating counts on Lamassu Admin, make sure you've done it before on the machines."})]}),Object(Me.jsxs)("div",{className:r.warningInfo,children:[Object(Me.jsx)(ia,{className:r.warningIcon}),Object(Me.jsx)(Xe,{noMargin:!0,className:r.warningText,children:"For cash-out cassettes, please make sure you've removed the remaining bills before adding the new ones."})]}),Object(Me.jsx)(Tn,{className:r.button,onClick:n,children:"Get started"})]})},vL=n.p+"static/media/acceptor-left.f37bcb1a.svg",yL=n.p+"static/media/dispenser-1.e4200f4e.svg",wL=n.p+"static/media/dispenser-2.9f7807a5.svg",CL={content:{display:"flex",flexDirection:"column",justifyContent:"space-between",flex:1,paddingBottom:32},titleDiv:{marginBottom:32},title:{margin:[[0,0,12,0]],color:q},stepImage:{width:148,height:196},form:{paddingBottom:95},verticalAlign:{display:"flex",flexDirection:"column"},horizontalAlign:{display:"flex",flexDirection:"row"},centerAlignment:{alignItems:"center"},lineAlignment:{alignItems:"baseline"},fullWidth:{margin:[[0,"auto"]],flexBasis:"auto"},formWrapper:{flexBasis:"100%",display:"flex",justifyContent:"center"},submit:{float:"right"},cashboxBills:{marginRight:5},cassetteCashbox:{width:40,height:35},cassetteFormTitle:{marginTop:18},cassetteFormTitleContent:{marginLeft:10,marginRight:25},smBottomMargin:{marginBottom:25},fiatTotal:{color:q},errorMessage:{color:me}},kL=Object(j.a)(CL),SL=function(e,t){return[[yL,wL],[Zv,Yv,Qv],[Jv,ey,ty,ny]][e-2][t-2]},NL=function(e){var t=e.step,n=e.name,r=e.machine,a=e.cashoutSettings,i=e.cassetteCapacity,o=(e.error,e.lastStep),c=e.steps,l=e.fiatCurrency,s=e.onContinue,d=kL(),u=o?"Finish":"Confirm",m=[{display:"Yes",code:"YES"},{display:"No",code:"NO"}],h="cassette".concat(t-1),b=r.numberOfCassettes,p=null===r||void 0===r?void 0:r[h],j=null===a||void 0===a?void 0:a[h],f=function(e){return e[h]||p},g=function(e){return f(e)*j},O=dL.a(f,(function(e){return e/i*100}),wx.a(0,100));return Object(Me.jsxs)("div",{className:d.content,children:[Object(Me.jsxs)("div",{className:d.titleDiv,children:[Object(Me.jsx)(Ke,{className:d.title,children:n}),Object(Me.jsx)(GO,{steps:c.length,currentStep:t})]}),1===t&&Object(Me.jsx)(pn.d,{validateOnBlur:!1,validateOnChange:!1,onSubmit:s,initialValues:{wasCashboxEmptied:""},enableReinitialize:!0,validationSchema:c[0].schema,children:function(e){e.values;var t=e.errors;return Object(Me.jsxs)(pn.c,{children:[Object(Me.jsxs)("div",{className:E()(d.horizontalAlign,d.form),children:[Object(Me.jsx)("img",{className:d.stepImage,alt:"cassette",src:vL}),Object(Me.jsx)("div",{className:d.formWrapper,children:Object(Me.jsxs)("div",{className:E()(d.verticalAlign,d.fullWidth),children:[Object(Me.jsx)(Ue,{noMargin:!0,children:"Did you empty the cash-in box?"}),Object(Me.jsx)(pn.b,{component:Ha,name:"wasCashboxEmptied",options:m,className:d.horizontalAlign}),t.wasCashboxEmptied&&Object(Me.jsx)("div",{className:d.errorMessage,children:t.wasCashboxEmptied}),Object(Me.jsxs)("div",{className:E()(d.horizontalAlign,d.centerAlignment),children:[Object(Me.jsx)(Xe,{children:"Since previous update"}),Object(Me.jsx)(ep,{width:215,children:Object(Me.jsx)(Xe,{children:"Number of bills inside the cashbox, since the last cashbox changes."})})]}),Object(Me.jsxs)("div",{className:E()(d.horizontalAlign,d.lineAlignment),children:[Object(Me.jsx)(_e,{noMargin:!0,className:d.cashboxBills,children:null===r||void 0===r?void 0:r.cashbox}),Object(Me.jsx)(Xe,{noMargin:!0,children:"accepted bills"})]})]})})]}),Object(Me.jsx)(Tn,{className:d.submit,type:"submit",children:u})]})}}),t>1&&Object(Me.jsx)(pn.d,{validateOnBlur:!1,validateOnChange:!1,onSubmit:s,initialValues:{cassette1:"",cassette2:"",cassette3:"",cassette4:""},enableReinitialize:!0,validationSchema:c[t-1].schema,children:function(e){var n=e.values;e.errors;return Object(Me.jsxs)(pn.c,{children:[Object(Me.jsxs)("div",{className:E()(d.horizontalAlign,d.form),children:[Object(Me.jsx)("img",{className:d.stepImage,alt:"cassette",src:SL(b,t)}),Object(Me.jsx)("div",{className:d.formWrapper,children:Object(Me.jsxs)("div",{className:E()(d.verticalAlign,d.fullWidth),children:[Object(Me.jsxs)("div",{className:E()(d.horizontalAlign,d.smBottomMargin),children:[Object(Me.jsxs)("div",{className:E()(d.horizontalAlign,d.cassetteFormTitle),children:[Object(Me.jsx)(gl,{}),Object(Me.jsxs)(Ue,{className:d.cassetteFormTitleContent,noMargin:!0,children:["Cash-out ",t-1," (dispenser)"]})]}),Object(Me.jsx)(Aa,{className:d.cassetteCashbox,percent:O(n),cashOut:!0})]}),Object(Me.jsx)(Ue,{noMargin:!0,children:"Refill bill count"}),Object(Me.jsxs)("div",{className:E()(d.horizontalAlign,d.lineAlignment),children:[Object(Me.jsx)(pn.b,{component:qa,decimalPlaces:0,width:50,placeholder:p.toString(),name:h,className:d.cashboxBills}),Object(Me.jsxs)(Xe,{children:[j," ",l," bills loaded"]})]}),Object(Me.jsxs)(Xe,{noMargin:!0,className:d.fiatTotal,children:["= ",g(n)," ",l]})]})})]}),Object(Me.jsx)(Tn,{className:d.submit,type:"submit",children:u})]})}})]})},IL=x()(eL||(eL=Object(l.a)(["\n mutation createBatch($deviceId: ID, $cashboxCount: Int) {\n createBatch(deviceId: $deviceId, cashboxCount: $cashboxCount) {\n id\n }\n }\n"]))),EL=function(e){var t=e.machine,n=e.cashoutSettings,a=e.locale,i=e.onClose,o=e.save,l=e.error,s=Object(r.useState)({step:0,config:{active:!0}}),d=Object(c.a)(s,2),m=d[0],h=m.step,b=m.config,p=d[1],j=Object(u.b)(IL),f=Object(c.a)(j,1)[0],g=Wr.a(n)||!(null===n||void 0===n?void 0:n.active)?0:t.numberOfCassettes,O=h===g+1,x=function(e){var n=Gn.a(b,e);if(O){var r=[null===b||void 0===b?void 0:b.wasCashboxEmptied,null===e||void 0===e?void 0:e.wasCashboxEmptied].includes("YES"),a=r?0:null===t||void 0===t?void 0:t.cashbox;r&&f({variables:{deviceId:t.id,cashboxCount:t.cashbox}});var c=B.a(parseInt,e),l=c.cassette1,s=c.cassette2,d=c.cassette3,u=c.cassette4;return o(t.id,a,l,s,d,u),i()}p({step:h+1,config:n})},v=dL.a(mu.a(1),TO.a(1),B.a((function(e){return{type:"cassette ".concat(e),schema:xn.e().shape(Object(z.a)({},"cassette".concat(e),xn.d().label("Bill count").positive().integer().required().min(0).max(500)))}}))),y=pu.a({type:"cashbox",schema:xn.e().shape({wasCashboxEmptied:xn.g().required("Select one option.")}),cashoutRequired:!1},v(g));return Object(Me.jsxs)(AO,{title:0===h?null:"Update counts",handleClose:i,width:554,height:520,open:!0,children:[0===h&&Object(Me.jsx)(xL,{name:null===t||void 0===t?void 0:t.name,onContinue:function(){return x()}}),0!==h&&Object(Me.jsx)(NL,{step:h,name:null===t||void 0===t?void 0:t.name,machine:t,cashoutSettings:n,cassetteCapacity:500,error:l,lastStep:O,steps:y,fiatCurrency:a.fiatCurrency,onContinue:x})]})},FL=Object(j.a)(oL),LL=xn.e().shape({name:xn.g().required(),cashbox:xn.d().label("Cashbox").required().integer().min(0).max(1e3),cassette1:xn.d().label("Cassette 1").required().integer().min(0).max(500),cassette2:xn.d().label("Cassette 2").required().integer().min(0).max(500),cassette3:xn.d().label("Cassette 3").required().integer().min(0).max(500),cassette4:xn.d().label("Cassette 4").required().integer().min(0).max(500)}),DL=x()(tL||(tL=Object(l.a)(["\n mutation createBatch($deviceId: ID, $cashboxCount: Int) {\n createBatch(deviceId: $deviceId, cashboxCount: $cashboxCount) {\n id\n }\n }\n"]))),PL=x()(nL||(nL=Object(l.a)(["\n query getData {\n machines {\n name\n id: deviceId\n cashbox\n cassette1\n cassette2\n cassette3\n cassette4\n numberOfCassettes\n }\n config\n }\n"]))),BL=x()(rL||(rL=Object(l.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),RL=x()(aL||(aL=Object(l.a)(["\n mutation MachineAction(\n $deviceId: ID!\n $action: MachineAction!\n $cashbox: Int!\n $cassette1: Int!\n $cassette2: Int!\n $cassette3: Int!\n $cassette4: Int!\n ) {\n machineAction(\n deviceId: $deviceId\n action: $action\n cashbox: $cashbox\n cassette1: $cassette1\n cassette2: $cassette2\n cassette3: $cassette3\n cassette4: $cassette4\n ) {\n deviceId\n cashbox\n cassette1\n cassette2\n cassette3\n cassette4\n }\n }\n"]))),AL=function(){var e,t,n,a,i=FL(),o=Object(r.useState)(!1),l=Object(c.a)(o,2),s=l[0],m=l[1],h=Object(r.useState)(null),b=Object(c.a)(h,2),p=b[0],j=b[1],f=Object(r.useState)(null),g=Object(c.a)(f,2),O=g[0],x=g[1],v=Object(u.c)(PL).data,y=Object(r.useState)(!1),w=Object(c.a)(y,2),C=w[0],k=w[1],S=Object(r.useState)(""),N=Object(c.a)(S,2),I=N[0],E=N[1],F=null!==(e=T.a(["machines"])(v))&&void 0!==e?e:[],L=null!==(t=T.a(["config"])(v))&&void 0!==t?t:{},D=$l("notifications",L),P=Object(u.b)(RL,{refetchQueries:function(){return["getData"]}}),A=Object(c.a)(P,2),M=A[0],z=A[1].error,$=Object(u.b)(DL),q=Object(c.a)($,1)[0],H=Object(u.b)(BL,{onCompleted:function(){return j(!1)},refetchQueries:function(){return["getData"]}}),V=Object(c.a)(H,1)[0],U=ev.a((function(e){return e.deviceId}))(null!==(n=T.a(["bills"])(v))&&void 0!==n?n:[]),G=Yj.a(B.a(R.a("deviceId"))(null!==(a=T.a(["bills"])(v))&&void 0!==a?a:[])),X=(null===v||void 0===v?void 0:v.config)&&$l("cashOut")(v.config),_=(null===v||void 0===v?void 0:v.config)&&$l("locale")(v.config),K=null===_||void 0===_?void 0:_.fiatCurrency,Z=Math.max.apply(Math,Object(d.a)(B.a((function(e){return e.numberOfCassettes}),F))),Y=Zl.a((function(e,t){return WF.a(t.id,t.cashbox,e)}),{},F),Q=(null===v||void 0===v?void 0:v.config)&&$l("cashIn")(v.config).cashboxReset,J=function(e){e&&(!function(e){var t=ql("cashIn")(e);V({variables:{config:t}})}({cashboxReset:e}),j(!1))},ee=function(e){return $l(e)(X)},te=[{display:"Automatic",code:"automatic"},{display:"Manual",code:"manual"}],ne=function(e){var t=T.a(["target","value"])(e);x(t)},re=[{name:"name",header:"Machine",width:184,view:function(e){return Object(Me.jsx)(Me.Fragment,{children:e})},input:function(e){var t=e.field.value;return Object(Me.jsx)(Me.Fragment,{children:t})}},{name:"cashbox",header:"Cash-in",width:Z>2?140:280,view:function(e){return Object(Me.jsx)(Ta,{currency:{code:K},notes:e,total:0})},input:qa,inputProps:{decimalPlaces:0}}];return su.a(du.a(uu.a,Z),(function(e){return re.push({name:"cassette".concat(e),header:"Cassette ".concat(e),width:(Z>2?700:560)/Z,stripe:!0,doubleHeader:"Cash-out",view:function(t,n){var r,a=n.id;return Object(Me.jsx)(Ma,{className:i.cashbox,denomination:null===(r=ee(a))||void 0===r?void 0:r["cassette".concat(e)],currency:{code:K},notes:t,width:50,threshold:D["fillingPercentageCassette".concat(e)]})},isHidden:function(t){var n=t.numberOfCassettes;return e>n},input:za,inputProps:{decimalPlaces:0,width:50,inputClassName:i.cashbox}}),mu.a(1,e)}),1),re.push({name:"edit",header:"Edit",width:87,view:function(e,t){var n=t.id;return Object(Me.jsx)(tr,{onClick:function(){E(n),k(!0)},children:Object(Me.jsx)(Mm,{})})}}),Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Wo,{title:"Cash Cassettes",button:{text:"Cashbox history",icon:iL,inverseIcon:UF,toggle:m},iconClassName:i.listViewButton,className:i.tableWidth,children:!s&&Object(Me.jsxs)(Po.a,{alignItems:"center",justifyContent:"flex-end",children:[Object(Me.jsx)(et,{className:i.cashboxReset,children:"Cashbox reset"}),Object(Me.jsxs)(Po.a,{display:"flex",alignItems:"center",justifyContent:"flex-end",mr:"-4px",children:[Q&&Object(Me.jsx)(Xe,{className:i.selection,children:Hu(Q)}),Object(Me.jsx)(tr,{onClick:function(){return j(!0)},className:i.button,children:Object(Me.jsx)(Mm,{})})]})]})}),Object(Me.jsxs)("div",{className:i.tableContainer,children:[!s&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Xm,{error:null===z||void 0===z?void 0:z.message,name:"cashboxes",stripeWhen:function(e){var t=e.id;return!ee(t).active},elements:re,data:F,validationSchema:LL,tbodyWrapperClass:i.tBody}),v&&Wr.a(F)&&Object(Me.jsx)(gv,{message:"No machines so far"})]}),s&&Object(Me.jsx)(jL,{machines:F,currency:K})]}),Object(Me.jsx)(sL,{currencyCode:K,machines:F,config:L,bills:U,deviceIds:G}),C&&Object(Me.jsx)(EL,{machine:Tr.a(W.a("id",I))(F),cashoutSettings:ee(I),onClose:function(){k(!1)},error:null===z||void 0===z?void 0:z.message,save:function(e,t,n,r,a,i){var o=Y[e];return t<o&&q({variables:{deviceId:e,cashboxCount:o}}),M({variables:{action:"setCassetteBills",deviceId:e,cashbox:t,cassette1:n,cassette2:r,cassette3:a,cassette4:i}})},locale:_}),p&&Object(Me.jsxs)(AO,{title:"Cashbox reset",width:478,handleClose:function(){return j(null)},open:!0,children:[Object(Me.jsx)(Xe,{className:i.descriptions,children:"Specify if you want your cash-in counts to be reset automatically or manually."}),Object(Me.jsx)(xa,{name:"set-automatic-reset",value:null!==O&&void 0!==O?O:Q,options:[te[0]],onChange:ne,className:i.radioButtons}),Object(Me.jsx)(Xe,{className:i.descriptions,children:"Choose this option if you want your cash-in cashbox count to be reset automatically when it is physically removed from the machine."}),Object(Me.jsx)(xa,{name:"set-manual-reset",value:null!==O&&void 0!==O?O:Q,options:[te[1]],onChange:ne,className:i.radioButtons}),Object(Me.jsx)(Xe,{className:i.descriptions,children:"Choose this option if you want to edit your cash-in counts manually on Lamassu Admin, after you physically remove the bills from the cashbox."}),Object(Me.jsx)(Ku.a,{className:i.actions,children:Object(Me.jsx)(Tn,{onClick:function(){return J(O)},children:"Confirm"})})]})]})},TL=n(884);function ML(){return(ML=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function WL(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var zL=r.createElement("rect",{width:12,height:12,rx:3,ry:3,fill:"#ff7311"});function $L(e,t){var n=e.title,a=e.titleId,i=WL(e,["title","titleId"]);return r.createElement("svg",ML({width:12,height:12,viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,zL)}var qL=r.forwardRef($L);n.p;function HL(){return(HL=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function VL(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var UL=r.createElement("rect",{width:12,height:12,rx:3,ry:3,fill:"#ff584a"});function GL(e,t){var n=e.title,a=e.titleId,i=VL(e,["title","titleId"]);return r.createElement("svg",HL({width:12,height:12,viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,UL)}var XL,_L,KL,ZL,YL=r.forwardRef(GL),QL=(n.p,{douro1:"Douro",sintra:"Sintra",gaia:"Gaia"}),JL=Object(s.a)(Object(s.a)({},Eb),{},{wrapper:{display:"flex",marginTop:12,marginBottom:16,fontSize:xe},row:{display:"flex",flexDirection:"row"},list:{padding:0,margin:0,listStyle:"none"},item:{height:24,marginBottom:12},link:{color:J,textDecoration:"none"},separator:{width:1,height:170,zIndex:1,marginRight:60,marginLeft:"auto",background:Object(nr.fade)(q,.5)}}),eD=Object(j.a)(Fb),tD=function(e){var t=e.children,n=eD();return Object(Me.jsx)("div",{className:n.label,children:t})},nD=Object(j.a)(JL),rD=function(e){var t=e.children,n=Object($.a)(e,["children"]);return Object(Me.jsx)(h.a,Object(s.a)(Object(s.a)({container:!0,spacing:4},n),{},{children:t}))},aD=function(e){var t=e.children,n=Object($.a)(e,["children"]);return Object(Me.jsx)(h.a,Object(s.a)(Object(s.a)({item:!0,xs:!0},n),{},{children:t}))},iD=function(e){var t=e.it,n=e.onActionSuccess,r=e.timezone,a=nD();return Object(Me.jsx)(rD,{className:a.wrapper,children:Object(Me.jsx)(aD,{xs:!0,children:Object(Me.jsxs)(rD,{className:a.row,children:[Object(Me.jsxs)(aD,{xs:2,children:[Object(Me.jsx)(tD,{children:"Machine Model"}),Object(Me.jsx)("span",{children:QL[t.model]})]}),Object(Me.jsxs)(aD,{xs:4,children:[Object(Me.jsx)(tD,{children:"Paired at"}),Object(Me.jsx)("span",{children:r&&Os(t.pairedAt,r,"YYYY-MM-DD HH:mm:ss")})]}),Object(Me.jsx)(aD,{xs:6,children:Object(Me.jsx)(gb,{machine:t,onActionSuccess:n})}),Object(Me.jsxs)(aD,{xs:2,children:[Object(Me.jsx)(tD,{children:"Network speed"}),Object(Me.jsx)("span",{children:t.downloadSpeed?new vl.a(t.downloadSpeed).toFixed(4).toString()+" MB/s":"unavailable"})]}),Object(Me.jsxs)(aD,{xs:2,children:[Object(Me.jsx)(tD,{children:"Latency"}),Object(Me.jsx)("span",{children:t.responseTime?new vl.a(t.responseTime).toFixed(3).toString()+" ms":"unavailable"})]}),Object(Me.jsxs)(aD,{xs:2,children:[Object(Me.jsx)(tD,{children:"Packet Loss"}),Object(Me.jsx)("span",{children:t.packetLoss?new vl.a(t.packetLoss).toFixed(3).toString()+" %":"unavailable"})]})]})})})},oD=x()(XL||(XL=Object(l.a)(["\n {\n machines {\n name\n deviceId\n lastPing\n pairedAt\n version\n paired\n cashbox\n cassette1\n cassette2\n version\n model\n statuses {\n label\n type\n }\n downloadSpeed\n responseTime\n packetLoss\n }\n }\n"]))),cD=x()(_L||(_L=Object(l.a)(["\n query getData {\n config\n }\n"]))),lD=Object(j.a)(Lb),sD=function(){var e,t=lD(),n=Object(w.h)(),r=Object(w.i)().state,a=null===r||void 0===r?void 0:r.id,i=Object(u.c)(oD),o=i.data,c=i.refetch,l=i.loading,s=Object(u.c)(cD),d=s.data,m=s.configLoading,h=T.a(["config","locale_timezone"],d),b=[{header:"Machine Name",width:250,size:"sm",textAlign:"left",view:function(e){return Object(Me.jsxs)("div",{className:t.flexRow,children:[e.name,Object(Me.jsx)("div",{className:t.machineRedirectContainer,onClick:function(){n.push("/machines/".concat(e.deviceId))},children:Object(Me.jsx)(Gd,{})})]})}},{header:"Status",width:350,size:"sm",textAlign:"left",view:function(e){return Object(Me.jsx)(Wd,{statuses:e.statuses})}},{header:"Last ping",width:200,size:"sm",textAlign:"left",view:function(e){return e.lastPing?Object(TL.a)(new Date(e.lastPing),new Date,{addSuffix:!0}):"unknown"}},{header:"Software Version",width:200,size:"sm",textAlign:"left",view:function(e){return e.version||"unknown"}}],p=null!==(e=T.a(["machines"])(o))&&void 0!==e?e:[],j=Ko.a(W.a("deviceId",a))(p);return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)("div",{className:t.titleWrapper,children:[Object(Me.jsx)("div",{className:t.titleAndButtonsContainer,children:Object(Me.jsx)(yn,{children:"Machine Status"})}),Object(Me.jsxs)("div",{className:t.headerLabels,children:[Object(Me.jsxs)("div",{children:[Object(Me.jsx)(qL,{}),Object(Me.jsx)("span",{children:"Warning"})]}),Object(Me.jsxs)("div",{children:[Object(Me.jsx)(YL,{}),Object(Me.jsx)("span",{children:"Error"})]})]})]}),Object(Me.jsx)(Bv,{loading:l&&m,elements:b,data:p,Details:function(e){var t=e.it;return Object(Me.jsx)(iD,{it:t,onActionSuccess:c,timezone:h})},initialExpanded:j,emptyText:"No machines so far",expandable:!0})]})},dD=a.a.createContext(),uD=Object(j.a)({header:{display:"flex",alignItems:"center",marginBottom:16,height:26,margin:0},title:{flexShrink:2,margin:0,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},button:{border:"none",backgroundColor:"transparent",cursor:"pointer",marginLeft:8},editingButtons:{display:"flex",flexShrink:0,marginLeft:16,justifyContent:"space-between",width:110}}),mD=function(e){var t=e.title,n=e.editing,r=e.disabled,a=e.setEditing,i=uD();return Object(Me.jsxs)("div",{className:i.header,children:[Object(Me.jsx)(Ue,{className:i.title,children:t}),!n&&Object(Me.jsx)(tr,{onClick:function(){return a(!0)},className:i.button,disabled:r,children:r?Object(Me.jsx)(Em,{}):Object(Me.jsx)(Mm,{})}),n&&Object(Me.jsxs)("div",{className:i.editingButtons,children:[Object(Me.jsx)(or,{color:"primary",type:"submit",children:"Save"}),Object(Me.jsx)(or,{color:"secondary",type:"reset",children:"Cancel"})]})]})},hD=Object(j.a)({text:{margin:[[7,0,7,1]]},fieldWrapper:{height:53},valueWrapper:{display:"flex",alignItems:"baseline"},label:{margin:0},decoration:{margin:[[0,0,0,7]]}}),bD=function(e){var t,n=e.label,r=e.name,a=e.editing,i=e.displayValue,o=e.decoration,c=e.className,l=e.decimalPlaces,s=void 0===l?0:l,d=e.width,u=void 0===d?80:d,m=hD({width:u,editing:a}),h=Object(pn.e)().values,b=(t={},Object(z.a)(t,m.fieldWrapper,!0),Object(z.a)(t,"className",c),t);return Object(Me.jsxs)("div",{className:E()(b),children:[n&&Object(Me.jsx)(et,{className:m.label,children:n}),Object(Me.jsxs)("div",{className:m.valueWrapper,children:[!a&&Object(Me.jsx)(_e,{className:m.text,children:i(h[r])}),a&&Object(Me.jsx)(pn.b,{id:r,size:"lg",fullWidth:!0,name:r,component:qa,textAlign:"right",width:u,decimalPlaces:s}),Object(Me.jsx)(Je,{className:m.decoration,children:o})]})]})},pD=function(e){var t,n=e.title,a=e.label,i=e.width,o=void 0===i?80:i,l=e.min,s=void 0===l?0:l,d=e.max,u=void 0===d?9999999:d,m=e.name,h=e.section,b=e.className,p=Object(r.useState)(!1),j=Object(c.a)(p,2),f=j[0],g=j[1],O=function(){var e=Object(pc.a)(bc.a.mark((function e(t,n){return bc.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!f){e.next=2;break}return e.abrupt("return");case 2:return g(!0),e.next=5,v(t,n);case 5:g(!1);case 6:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),x=Object(r.useContext)(dD),v=x.save,y=x.data,w=x.currency,C=x.isEditing,k=x.isDisabled,S=x.setEditing,N=xn.e().shape(Object(z.a)({},m,xn.d().transform($f).integer().min(s).max(u).nullable()));return Object(Me.jsx)(pn.d,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,initialValues:Object(z.a)({},m,null!==(t=y&&y[m])&&void 0!==t?t:""),validationSchema:N,onSubmit:function(e){return O(h,N.cast(e))},onReset:function(){S(m,!1)},children:Object(Me.jsxs)(pn.c,{className:b,children:[Object(Me.jsx)(xu,{}),Object(Me.jsx)(mD,{title:n,editing:C(m),disabled:k(m),setEditing:function(e){return S(m,e)}}),Object(Me.jsx)(bD,{label:a,name:m,editing:C(m),width:o,displayValue:function(e){return""===e?"-":e},decoration:w})]})})},jD="cryptoLowBalance",fD="cryptoHighBalance",gD=Object(j.a)({cryptoBalanceAlerts:{display:"flex",marginBottom:36,height:135,alignItems:"center"},cryptoBalanceAlertsForm:{width:222,marginRight:32},cryptoBalanceAlertsSecondForm:{marginLeft:50},vertSeparator:{width:1,height:"100%",borderRight:[[1,"solid","black"]]}}),OD=function(e){var t=e.section,n=e.fieldWidth,a=gD(),i=Object(r.useContext)(dD),o=i.data,c=i.save,l=i.currency,s=i.setEditing,d=i.isEditing,u=i.isDisabled;return Object(Me.jsxs)("div",{className:a.cryptoBalanceAlerts,children:[Object(Me.jsx)(pD,{name:jD,data:o,save:c,section:t,decoration:l,className:a.cryptoBalanceAlertsForm,title:"Default (Low Balance)",label:"Alert me under",editing:d(jD),disabled:u(jD),setEditing:function(e){return s(jD,e)},width:n}),Object(Me.jsx)("div",{className:a.vertSeparator}),Object(Me.jsx)(pD,{name:fD,data:o,section:t,save:c,decoration:l,className:a.cryptoBalanceAlertsSecondForm,title:"Default (High Balance)",label:"Alert me over",editing:d(fD),disabled:u(fD),setEditing:function(e){return s(fD,e)},width:n})]})},xD="highBalance",vD="lowBalance",yD="cryptoCurrency",wD="cryptoBalanceOverrides",CD=function(e){var t,n,a,i=e.section,o=Object(r.useContext)(dD),c=o.cryptoCurrencies,l=void 0===c?[]:c,s=o.data,d=o.save,u=o.error,m=o.currency,h=o.isDisabled,b=o.setEditing,p=null!==(t=null===s||void 0===s?void 0:s.cryptoBalanceOverrides)&&void 0!==t?t:[],j=B.a(R.a(yD))(p),f=M.a((function(e){return!_o.a(e.code,j)}))(l),g=(n={},Object(z.a)(n,yD,null),Object(z.a)(n,vD,""),Object(z.a)(n,xD,""),n),O=xn.e().shape((a={},Object(z.a)(a,yD,xn.g().label("Cryptocurrency").nullable().required()),Object(z.a)(a,vD,xn.d().label("Low Balance").when(xD,{is:function(e){return!e},then:xn.d().required()}).transform($f).integer().min(0).max(nf).nullable()),Object(z.a)(a,xD,xn.d().label("High Balance").when(vD,{is:function(e){return!e},then:xn.d().required()}).transform($f).integer().min(0).max(nf).nullable()),a),[vD,xD]),x=[{name:yD,header:"Cryptocurrency",width:166,size:"sm",view:function(e){return L.a(T.a(["display"]),Tr.a(W.a("code",e)))(l)},input:ka,inputProps:{options:function(e){return Vo.a(f,function(e){var t=L.a(Tr.a(W.a("code",null===e||void 0===e?void 0:e.cryptoCurrency)))(l);return t?[t]:[]}(e))},optionsLimit:null,valueProp:"code",labelProp:"display"}},{name:vD,width:155,textAlign:"right",bold:!0,input:qa,suffix:m,inputProps:{decimalPlaces:2}},{name:xD,width:155,textAlign:"right",bold:!0,input:qa,suffix:m,inputProps:{decimalPlaces:2}}];return Object(Me.jsx)(Xm,{name:wD,title:"Overrides",error:null===u||void 0===u?void 0:u.message,enableDelete:!0,enableEdit:!0,enableCreate:!0,save:function(e){return d(i,e)},initialValues:g,validationSchema:O,forceDisable:h(wD)||!l,data:p,elements:x,disableAdd:!(null===f||void 0===f?void 0:f.length),onDelete:function(e){var t={cryptoBalanceOverrides:ju.a((function(t){return t.id===e}),p)};return d(t)},setEditing:function(e){return b(wD,e)}})},kD={wrapper:{display:"flex"},form:{marginBottom:36},title:{marginTop:0},row:{width:236,display:"grid",gridTemplateColumns:"repeat(2,1fr)",gridTemplateRows:"1fr",gridColumnGap:18,gridRowGap:0},col2:{width:136},cashboxLabel:{marginRight:4,fontSize:20},cashboxEmptyPart:{backgroundColor:"".concat(re)}},SD=Object(j.a)(kD),ND="fiatBalanceAlerts",ID=function(e){var t,n,a,i,o,c=e.section,l=e.min,s=void 0===l?0:l,u=e.max,m=void 0===u?100:u,h=e.fieldWidth,b=void 0===h?80:h,p=Object(r.useContext)(dD),j=p.isEditing,f=p.isDisabled,g=p.setEditing,O=p.data,x=p.save,v=p.machines,y=SD(),w=null!==(t=Math.max.apply(Math,Object(d.a)(B.a((function(e){return e.numberOfCassettes}),v))))&&void 0!==t?t:2,C=j(ND),k=xn.e().shape({fillingPercentageCassette1:xn.d().transform($f).integer().min(s).max(m).nullable(),fillingPercentageCassette2:xn.d().transform($f).integer().min(s).max(m).nullable(),fiatBalanceCassette3:xn.d().transform($f).integer().min(s).max(m).nullable(),fiatBalanceCassette4:xn.d().transform($f).integer().min(s).max(m).nullable()});return Object(Me.jsx)(pn.d,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,initialValues:{fillingPercentageCassette1:null!==(n=null===O||void 0===O?void 0:O.fillingPercentageCassette1)&&void 0!==n?n:"",fillingPercentageCassette2:null!==(a=null===O||void 0===O?void 0:O.fillingPercentageCassette2)&&void 0!==a?a:"",fillingPercentageCassette3:null!==(i=null===O||void 0===O?void 0:O.fillingPercentageCassette3)&&void 0!==i?i:"",fillingPercentageCassette4:null!==(o=null===O||void 0===O?void 0:O.fillingPercentageCassette4)&&void 0!==o?o:""},validationSchema:k,onSubmit:function(e){return x(c,k.cast(e))},onReset:function(){g(ND,!1)},children:function(e){var t=e.values;return Object(Me.jsxs)(pn.c,{className:y.form,children:[Object(Me.jsx)(xu,{}),Object(Me.jsx)(mD,{title:"Cash out (Empty)",editing:C,disabled:f(ND),setEditing:function(e){return g(ND,e)}}),Object(Me.jsx)("div",{className:y.wrapper,children:B.a((function(e){var n;return Object(Me.jsx)(Me.Fragment,{children:Object(Me.jsxs)("div",{className:y.row,children:[Object(Me.jsx)(Aa,{labelClassName:y.cashboxLabel,emptyPartClassName:y.cashboxEmptyPart,percent:null!==(n=t["fillingPercentageCassette".concat(e+1)])&&void 0!==n?n:O["cassette".concat(e+1)],applyColorVariant:!0,applyFiatBalanceAlertsStyling:!0,omitInnerPercentage:!0,cashOut:!0}),Object(Me.jsxs)("div",{className:y.col2,children:[Object(Me.jsxs)(Je,{className:y.title,children:["Cassette ",e+1]}),Object(Me.jsx)(bD,{label:"Alert me under",name:"fillingPercentageCassette".concat(e+1),editing:C,displayValue:function(e){return""===e?"-":e},decoration:"%",width:b})]})]})})}),Pd.a(Bd.a,w))})]})}})},ED="fillingPercentageCassette1",FD="fillingPercentageCassette2",LD="fillingPercentageCassette3",DD="fillingPercentageCassette4",PD="machine",BD="fiatBalanceOverrides",RD=[ED,FD,LD,DD],AD=function(e){var t,n,a,i=e.section,o=Object(r.useContext)(dD),c=o.machines,l=void 0===c?[]:c,s=o.data,u=o.save,m=o.isDisabled,h=o.setEditing,b=o.error,p=null!==(t=null===s||void 0===s?void 0:s.fiatBalanceOverrides)&&void 0!==t?t:[],j=B.a((function(e){return e.machine}),p),f=M.a((function(e){return!_o.a(e.deviceId,j)}))(l),g=(n={},Object(z.a)(n,PD,null),Object(z.a)(n,ED,""),Object(z.a)(n,FD,""),Object(z.a)(n,LD,""),Object(z.a)(n,DD,""),n),O=Math.max.apply(Math,Object(d.a)(B.a((function(e){return e.numberOfCassettes}),l))),x=100,v=xn.e().shape((a={},Object(z.a)(a,PD,xn.g().label("Machine").nullable().required()),Object(z.a)(a,ED,xn.d().label("Cassette 1").transform($f).integer().min(0).max(x).nullable()),Object(z.a)(a,FD,xn.d().label("Cassette 2").transform($f).integer().min(0).max(x).nullable()),Object(z.a)(a,LD,xn.d().label("Cassette 3").transform($f).integer().min(0).max(x).nullable()),Object(z.a)(a,DD,xn.d().label("Cassette 4").transform($f).integer().min(0).max(x).nullable()),a)).test((function(e,t){var n=_u.a(RD,e);if(!RD.some((function(e){return!P.a(n[e])})))return t.createError({path:ED,message:"At least one of the cassettes must have a value"})})),y=[{name:PD,width:238,size:"sm",view:function(e){return L.a(T.a(["name"]),Tr.a(W.a("deviceId",e)))(l)},input:ka,inputProps:{options:function(e){return Vo.a(f,function(e){var t=L.a(Tr.a(W.a("deviceId",null===e||void 0===e?void 0:e.machine)))(l);return t?[t]:[]}(e))},valueProp:"deviceId",labelProp:"name"}}];return su.a(du.a(uu.a,O),(function(e){return y.push({name:"fillingPercentageCassette".concat(e),display:"Cash-out ".concat(e),width:155,textAlign:"right",doubleHeader:"Cash-out (Cassette Empty)",bold:!0,input:qa,suffix:"%",inputProps:{decimalPlaces:0},view:function(e){var t;return null!==(t=null===e||void 0===e?void 0:e.toString())&&void 0!==t?t:"\u2014"},isHidden:function(t){var n;return e>(null===(n=l.find((function(e){return e.deviceId===t.machine})))||void 0===n?void 0:n.numberOfCassettes)}}),mu.a(1,e)}),1),Object(Me.jsx)(Xm,{name:BD,title:"Overrides",error:null===b||void 0===b?void 0:b.message,enableDelete:!0,enableEdit:!0,enableCreate:!0,save:function(e){return u(i,v.cast(e))},initialValues:g,validationSchema:v,forceDisable:m(BD)||!l,data:p,elements:y,disableAdd:!(null===f||void 0===f?void 0:f.length),setEditing:function(e){return h(BD,e)}})},TD={balance:152,transactions:184,compliance:178,errors:142,security:152,active:263},MD=function(e){var t=e.namespace,n=e.forceDisable,a=Object(r.useContext)(dD),i=a.data,o=a.save,c=L.a(o(null),ql(t)),l=$l(t)(i),s=n||!l||!l.active,d=function(e){var t=e.name,n=e.disabled,r=!(!l||!l[t]);return Object(Me.jsx)(Lu,{width:TD[t],textAlign:"center",children:Object(Me.jsx)(Ca,{disabled:n,checked:r,onChange:function(e){c(Object(z.a)({},t,e.target.checked))},value:r})})};return Object(Me.jsxs)(Bu,{children:[Object(Me.jsx)(Lu,{width:129,children:Uu(t)}),Object(Me.jsx)(d,{name:"balance",disabled:s}),Object(Me.jsx)(d,{name:"transactions",disabled:s}),Object(Me.jsx)(d,{name:"compliance",disabled:s}),Object(Me.jsx)(d,{name:"errors",disabled:s}),Object(Me.jsx)(d,{name:"security",disabled:s}),Object(Me.jsx)(d,{name:"active",disabled:n})]})},WD=Object(j.a)({wizardTable:{width:930}}),zD=function(e){var t=e.wizard,n=e.forceDisable,r=t?20:0,a=WD();return Object(Me.jsxs)(Nu,{className:t?a.wizardTable:null,children:[Object(Me.jsxs)(Iu,{children:[Object(Me.jsx)(Du,{width:129-r,children:"Channel"}),Object.keys(TD).map((function(e){return Object(Me.jsx)(Du,{width:TD[e]-r,textAlign:"center",children:Uu(e)},e)}))]}),Object(Me.jsxs)(Fu,{children:[Object(Me.jsx)(MD,{namespace:"email",forceDisable:n}),Object(Me.jsx)(MD,{namespace:"sms",forceDisable:n}),Object(Me.jsx)(MD,{namespace:"notificationCenter",forceDisable:n})]})]})},$D=function(e){var t=e.section,n=e.fieldWidth;return Object(Me.jsx)(pD,{section:t,title:"High value transaction",label:"Alert me over",name:"highValueTransaction",width:n})},qD=x()(KL||(KL=Object(l.a)(["\n query getData {\n config\n machines {\n name\n deviceId\n numberOfCassettes\n }\n cryptoCurrencies {\n code\n display\n }\n }\n"]))),HD=x()(ZL||(ZL=Object(l.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),VD=function(e){var t=e.name,n=e.displaySetup,a=void 0===n||n,i=e.displayTransactionAlerts,o=void 0===i||i,l=e.displayFiatAlerts,s=void 0===l||l,d=e.displayCryptoAlerts,m=void 0===d||d,h=e.displayOverrides,b=void 0===h||h,p=e.displayTitle,j=void 0===p||p,f=e.wizard,g=void 0!==f&&f,O=Object(r.useState)(null),x=Object(c.a)(O,2),v=x[0],y=x[1],w=Object(r.useState)(null),C=Object(c.a)(w,2),k=C[0],S=C[1],N=Object(r.useState)(null),I=Object(c.a)(N,2),E=I[0],F=I[1],L=Object(u.c)(qD).data,D=Object(u.b)(HD,{refetchQueries:["getData"],onCompleted:function(){return F(null)},onError:function(e){return S(e)}}),P=Object(c.a)(D,1)[0],B=$l(t)(null===L||void 0===L?void 0:L.config),R=null===L||void 0===L?void 0:L.machines,A=null===L||void 0===L?void 0:L.cryptoCurrencies,M=T.a(["fiatCurrency"])($l(Dl)(null===L||void 0===L?void 0:L.config)),W={save:wl.a((function(e,n){var r=ql(t)(n);return y(e),S(null),P({variables:{config:r}})})),error:k,editingKey:E,data:B,currency:M,isEditing:function(e){return E===e},isDisabled:function(e){return E&&E!==e},setEditing:function(e,t){t||S(null),F(t?e:null)},setSection:y,machines:R,cryptoCurrencies:A};return Object(Me.jsxs)(dD.Provider,{value:W,children:[j&&Object(Me.jsx)(Wo,{title:"Notifications"}),a&&Object(Me.jsx)(Qf,{title:"Setup",error:k&&!v,children:Object(Me.jsx)(zD,{forceDisable:!!E,wizard:g})}),o&&Object(Me.jsx)(Qf,{title:"Transaction alerts",error:k&&"tx"===v,children:Object(Me.jsx)($D,{section:"tx",fieldWidth:130})}),s&&Object(Me.jsxs)(Qf,{title:"Fiat balance alerts",error:k&&"fiat"===v,children:[Object(Me.jsx)(ID,{section:"fiat",max:100,fieldWidth:50}),b&&Object(Me.jsx)(AD,{section:"fiat"})]}),m&&Object(Me.jsxs)(Qf,{title:"Crypto balance alerts",error:k&&"crypto"===v,children:[Object(Me.jsx)(OD,{section:"crypto",fieldWidth:130}),b&&Object(Me.jsx)(CD,{section:"crypto",fieldWidth:130})]})]})};function UD(){return(UD=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function GD(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var XD=r.createElement("g",{id:"\\u21B3\\u21B3-Coin-ATM-Radar",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"operator-info_v4-CAR#1",transform:"translate(-832.000000, -608.000000)",fill:"#FF584A",fillRule:"nonzero"},r.createElement("g",{id:"Group",transform:"translate(832.000000, 608.000000)"},r.createElement("polygon",{id:"Line-7",points:"13.0484874 0 16 2.95151255 2.95151255 16 0 13.0484874"}),r.createElement("polygon",{id:"Line-7",transform:"translate(8.000000, 8.000000) scale(-1, 1) translate(-8.000000, -8.000000) ",points:"13.0484874 0 16 2.95151255 2.95151255 16 0 13.0484874"}))));function _D(e,t){var n=e.title,a=e.titleId,i=GD(e,["title","titleId"]);return r.createElement("svg",UD({width:"16px",height:"16px",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),void 0===n?r.createElement("title",{id:a},"Group"):n?r.createElement("title",{id:a},n):null,XD)}var KD=r.forwardRef(_D);n.p;function ZD(){return(ZD=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function YD(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var QD=r.createElement("desc",null,"Created with Sketch."),JD=r.createElement("g",{id:"icon/table/true",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("path",{d:"M4.17451294,13.3251347 L0.599425104,9.29667256 C-0.199808368,8.3960844 -0.199808368,6.94040225 0.599425104,6.03981409 C1.39865858,5.13922593 2.69051421,5.13922593 3.48974768,6.03981409 L5.61967423,8.439847 L12.5102523,0.675441122 C13.3094858,-0.225147041 14.6033855,-0.225147041 15.4005749,0.675441122 C16.1998084,1.57372599 16.1998084,3.03171143 15.4005749,3.93229959 L7.06483552,13.3251347 C6.66624082,13.7742771 6.14295752,14 5.61967423,14 C5.09639093,14 4.57310763,13.7742771 4.17451294,13.3251347 Z",id:"Fill-1",fill:"#48F694"}));function eP(e,t){var n=e.title,a=e.titleId,i=YD(e,["title","titleId"]);return r.createElement("svg",ZD({width:"16px",height:"14px",viewBox:"0 0 16 14",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),void 0===n?r.createElement("title",{id:a},"icon/table/true"):n?r.createElement("title",{id:a},n):null,QD,JD)}var tP,nP,rP,aP,iP,oP,cP,lP,sP,dP,uP,mP,hP,bP,pP,jP,fP,gP,OP,xP,vP,yP,wP,CP,kP=r.forwardRef(eP),SP=(n.p,{booleanPropertiesTableWrapper:{display:"flex",flexDirection:"column",width:396},tableRow:{display:"flex",alignItems:"center",justifyContent:"space-between","&:nth-child(even)":{backgroundColor:re},"&:nth-child(odd)":{backgroundColor:G},minHeight:32,height:"auto",padding:[[8,16,8,24]],boxShadow:"0 0 0 0 rgba(0, 0, 0, 0)"},leftTableCell:{display:"flex",alignItems:"center",justifyContent:"left",width:200,padding:[0]},rightTableCell:{display:"flex",alignItems:"center",justifyContent:"right",padding:[0]},transparentButton:{"& > *":{margin:"auto 12px"},"& button":{border:"none",backgroundColor:"transparent",cursor:"pointer"}},rowWrapper:{display:"flex",alignItems:"center",position:"relative",flex:"wrap"},rightAligned:{marginLeft:"auto"},radioButtons:{display:"flex",flexDirection:"row",margin:[-15]},rightLink:{marginLeft:"20px"},fillColumn:Sb.fillColumn,popoverContent:{width:272,padding:[[10,15]]}}),NP=Object(j.a)(SP),IP=function(e){var t=e.name;return"true"===Object(pn.e)().values[t]?Object(Me.jsx)(kP,{}):Object(Me.jsx)(KD,{})},EP=Object(r.memo)((function(e){var t=e.title,n=e.disabled,a=e.data,i=e.elements,o=e.save,l=e.forcedEditing,s=void 0!==l&&l,d=Cl.a(i.map((function(e){var t;return[e.name,null!==(t=a[e.name])&&void 0!==t?t:null]}))),u=Cl.a(i.map((function(e){return[e.name,xn.b().required()]}))),m=Object(r.useState)(s),h=Object(c.a)(m,2),b=h[0],p=h[1],j=NP(),f=function(){var e=Object(pc.a)(bc.a.mark((function e(t){return bc.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o(M.a(Wf.a(P.a),t)),p(!1);case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),g=[{display:"Yes",code:"true"},{display:"No",code:"false"}];return Object(Me.jsx)("div",{className:j.booleanPropertiesTableWrapper,children:Object(Me.jsx)(pn.d,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,onSubmit:f,initialValues:d,schemaValidation:u,children:function(e){var r=e.resetForm;return Object(Me.jsxs)(pn.c,{children:[Object(Me.jsxs)("div",{className:j.rowWrapper,children:[Object(Me.jsx)(Ue,{children:t}),b?Object(Me.jsxs)("div",{className:j.rightAligned,children:[Object(Me.jsx)(or,{type:"submit",color:"primary",children:"Save"}),Object(Me.jsx)(or,{type:"reset",className:j.rightLink,onClick:function(){r(),p(!1)},color:"secondary",children:"Cancel"})]}):Object(Me.jsx)(tr,{className:j.transparentButton,onClick:function(){return p(!0)},children:n?Object(Me.jsx)(Em,{}):Object(Me.jsx)(Mm,{})})]}),Object(Me.jsx)(xu,{}),Object(Me.jsx)(xv,{className:j.fillColumn,children:Object(Me.jsx)(vv,{className:j.fillColumn,children:i.map((function(e,t){return Object(Me.jsxs)(Lv,{size:"sm",className:j.tableRow,children:[Object(Me.jsx)(wv,{className:j.leftTableCell,children:e.display}),Object(Me.jsxs)(wv,{className:j.rightTableCell,children:[b&&Object(Me.jsx)(pn.b,{component:Ha,name:e.name,options:g,className:E()(j.radioButtons,j.rightTableCell)}),!b&&Object(Me.jsx)(IP,{name:e.name})]})]},t)}))})})]})}})})})),FP={content:{display:"flex"},header:{display:"flex",alignItems:"center",position:"relative",flex:"wrap"},section:{marginBottom:52},row:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:28,width:600,"&:last-child":{marginBottom:0}},switchRow:{display:"flex",alignItems:"center",position:"relative",flex:"wrap",justifyContent:"space-between",width:396},switch:{display:"flex",alignItems:"center"},submit:{justifyContent:"flex-start",alignItems:"center",padding:[[0,4,4,4]],"& > button":{marginRight:40}},transparentButton:{"& > *":{margin:"auto 12px"},"& button":{border:"none",backgroundColor:"transparent",cursor:"pointer"}},infoMessage:{display:"flex",marginBottom:52,"& > p":{width:330,color:se,marginTop:4,marginLeft:16}},formErrorMsg:{margin:[[0,0,20,0]]}},LP=Object(j.a)(FP),DP=x()(tP||(tP=Object(l.a)(["\n query getData {\n config\n }\n"]))),PP=x()(nP||(nP=Object(l.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),BP=Object(r.memo)((function(e){var t=e.title,n=e.disabled,r=void 0!==n&&n,a=e.checked,i=e.save,o=e.label,c=LP();return Object(Me.jsxs)("div",{className:c.switchRow,children:[Object(Me.jsx)(Xe,{children:t}),Object(Me.jsxs)("div",{className:c.switch,children:[Object(Me.jsx)(Ca,{disabled:r,checked:a,onChange:function(e){return i&&i(e.target.checked)}}),o&&Object(Me.jsx)(tt,{children:o})]})]})})),RP=Object(r.memo)((function(e){var t=e.wizard,n=LP(),r=Object(u.c)(DP).data,a=Object(u.b)(PP,{refetchQueries:["getData"]}),i=Object(c.a)(a,1)[0],o=function(e){return i({variables:{config:ql(Rl,e)}})},l=(null===r||void 0===r?void 0:r.config)&&$l(Rl,r.config);return l?Object(Me.jsx)("div",{className:n.content,children:Object(Me.jsxs)("div",{children:[Object(Me.jsxs)("div",{className:n.header,children:[Object(Me.jsx)(Ue,{children:"Coin ATM Radar share settings"}),Object(Me.jsx)(ep,{width:304,children:Object(Me.jsxs)(Xe,{children:["For details on configuring this panel, please read the relevant knowledgebase article"," ",Object(Me.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://support.lamassu.is/hc/en-us/articles/360023720472-Coin-ATM-Radar",children:"here"}),"."]})})]}),Object(Me.jsx)(BP,{title:"Share information?",checked:l.active,save:function(e){return o({active:e})},label:l.active?"Yes":"No"}),Object(Me.jsx)(EP,{editing:t,title:"Machine info",data:l,elements:[{name:"commissions",display:"Commissions"},{name:"limitsAndVerification",display:"Limits and verification"}],save:o})]})}):null})),AP={field:{position:"relative",width:280,height:48,padding:[[0,4,4,0]]},notEditing:{display:"flex",flexDirection:"column","& > p:first-child":{height:16,lineHeight:"16px",fontSize:ve,transformOrigin:"left",paddingLeft:0,margin:[[3,0,3,0]]},"& > p:last-child":{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",margin:0}}},TP=Object(j.a)(AP),MP=function(e){var t,n=e.editing,r=e.field,a=e.displayValue,i=Object($.a)(e,["editing","field","displayValue"]),o=TP(),c=(t={},Object(z.a)(t,o.field,!0),Object(z.a)(t,o.notEditing,!n),t);return Object(Me.jsxs)("div",{className:E()(c),children:[!n&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(nt,{children:r.label}),Object(Me.jsx)(Ze,{children:a(r.value)})]}),n&&Object(Me.jsx)(pn.b,Object(s.a)({id:r.name,name:r.name,component:r.component,placeholder:r.placeholder,type:r.type,label:r.label,width:280},i))]})},WP=x()(rP||(rP=Object(l.a)(["\n query getData {\n config\n }\n"]))),zP=x()(aP||(aP=Object(l.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),$P=Object(j.a)(FP),qP=function(e){var t,n,a,i,o=e.wizard,l=$P(),s=Object(r.useState)(o||!1),d=Object(c.a)(s,2),m=d[0],h=d[1],b=Object(r.useState)(null),p=Object(c.a)(b,2),j=p[0],f=p[1],g=Object(u.b)(zP,{onCompleted:function(){return h(!1)},refetchQueries:function(){return["getData"]},onError:function(e){return f(e)}}),O=Object(c.a)(g,1)[0],x=Object(u.c)(WP).data,v=function(e){return O({variables:{config:ql(Fl,e)}})},y=(null===x||void 0===x?void 0:x.config)&&$l(Fl,x.config);if(!y)return null;var w=xn.e().shape({active:xn.b(),name:xn.g(),phone:xn.g(),email:xn.g().email("Please enter a valid email address").required("An email is required"),website:xn.g(),companyNumber:xn.g()}),C=[{name:"name",label:"Full name",value:null!==(t=y.name)&&void 0!==t?t:"",component:Ua},{name:"phone",label:"Phone number",value:y.phone,component:Ua},{name:"email",label:"Email",value:null!==(n=y.email)&&void 0!==n?n:"",component:Ua},{name:"website",label:"Website",value:null!==(a=y.website)&&void 0!==a?a:"",component:Ua},{name:"companyNumber",label:"Company number",value:null!==(i=y.companyNumber)&&void 0!==i?i:"",component:Ua}],k=function(e){return Tr.a(W.a("name",e))(C)},S=function(e){return k(e).value},N=function(e){return e},I={initialValues:{active:y.active,name:S("name"),phone:S("phone"),email:S("email"),website:S("website"),companyNumber:S("companyNumber")}},F=function(e){return P.a(e.email)?null:e.email};return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)("div",{className:l.header,children:Object(Me.jsx)(Ue,{children:"Contact information"})}),Object(Me.jsxs)("div",{className:l.switchRow,children:[Object(Me.jsx)(Xe,{children:"Info card enabled?"}),Object(Me.jsxs)("div",{className:l.switch,children:[Object(Me.jsx)(Ca,{checked:y.active,onChange:function(e){return v({active:e.target.checked})}}),Object(Me.jsx)(tt,{children:y.active?"Yes":"No"})]})]}),Object(Me.jsxs)("div",{className:l.section,children:[Object(Me.jsxs)("div",{className:l.header,children:[Object(Me.jsx)(Ue,{children:"Info card"}),!m&&Object(Me.jsx)(tr,{className:l.transparentButton,onClick:function(){return h(!0)},children:Object(Me.jsx)(Mm,{})})]}),Object(Me.jsx)(pn.d,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,initialValues:I.initialValues,validationSchema:w,onSubmit:function(e){return v(w.cast(e))},onReset:function(){h(!1),f(null)},children:function(e){var t=e.errors;return Object(Me.jsxs)(pn.c,{children:[Object(Me.jsx)(xu,{}),Object(Me.jsxs)("div",{className:l.row,children:[Object(Me.jsx)(MP,{field:k("name"),editing:m,displayValue:N,onFocus:function(){return f(null)}}),Object(Me.jsx)(MP,{field:k("phone"),editing:m,displayValue:N,onFocus:function(){return f(null)}})]}),Object(Me.jsxs)("div",{className:l.row,children:[Object(Me.jsx)(MP,{field:k("email"),editing:m,displayValue:N,onFocus:function(){return f(null)}}),Object(Me.jsx)(MP,{field:k("website"),editing:m,displayValue:N,onFocus:function(){return f(null)}})]}),Object(Me.jsx)("div",{className:l.row,children:Object(Me.jsx)(MP,{field:k("companyNumber"),editing:m,displayValue:N,onFocus:function(){return f(null)}})}),m&&!!F(t)&&Object(Me.jsx)(Ao,{className:l.formErrorMsg,children:F(t)}),Object(Me.jsx)("div",{className:E()(l.row,l.submit),children:m&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(or,{color:"primary",type:"submit",children:"Save"}),Object(Me.jsx)(or,{color:"secondary",type:"reset",children:"Cancel"}),j&&Object(Me.jsx)(Ao,{children:"Failed to save changes"})]})})]})}})]}),!o&&Object(Me.jsxs)("div",{className:E()(l.section,l.infoMessage),children:[Object(Me.jsx)(ia,{}),Object(Me.jsx)(et,{children:"Sharing your information with your customers through your machines allows them to contact you in case there's a problem with a machine in your network or a transaction."})]})]})},HP={header:{display:"flex",position:"relative",alignItems:"center",justifyContent:"space-between",width:800},form:{"& > *":{marginTop:20},display:"flex",flexDirection:"column",height:"100%"},footer:{display:"flex",flexDirection:"row",margin:[["auto",0,24,0]]},submit:{margin:[["auto",0,0,"auto"]]}},VP=Object(j.a)(HP),UP=function(e,t,n){return e&&t?n?"Internal server error":e.event&&t.event?e.event:e.message&&t.message?e.message:null:null},GP={smsCode:{validator:xn.g().required("The message content is required!").trim().test({name:"has-code-tag",message:"A #code tag is missing from the message!",exclusive:!1,test:function(e){var t;return(null===e||void 0===e||null===(t=e.match(/#code/g))||void 0===t?void 0:t.length)>0}}).test({name:"has-single-code-tag",message:"There should be a single #code tag!",exclusive:!1,test:function(e){var t;return 1===(null===e||void 0===e||null===(t=e.match(/#code/g))||void 0===t?void 0:t.length)}})},cashOutDispenseReady:{validator:xn.g().required("The message content is required!").trim().test({name:"has-timestamp-tag",message:"A #timestamp tag is missing from the message!",exclusive:!1,test:function(e){var t;return(null===e||void 0===e||null===(t=e.match(/#timestamp/g))||void 0===t?void 0:t.length)>0}}).test({name:"has-single-timestamp-tag",message:"There should be a single #timestamp tag!",exclusive:!1,test:function(e){var t;return 1===(null===e||void 0===e||null===(t=e.match(/#timestamp/g))||void 0===t?void 0:t.length)}})}},XP=function(e){var t,n,a=e.showModal,i=e.onClose,o=e.sms,l=e.eventOptions,s=e.creationError,d=e.submit,u=VP(),m=Object(r.useState)(null===o||void 0===o?void 0:o.event),h=Object(c.a)(m,2),b=h[0],p=h[1],j={event:P.a(o)?"":o.event,message:P.a(o)?"":o.message},f=xn.e().shape({event:xn.g().required("An event is required!"),message:null!==(t=null===(n=GP[b])||void 0===n?void 0:n.validator)&&void 0!==t?t:xn.g().required("The message content is required!").trim()});return Object(Me.jsx)(Me.Fragment,{children:a&&Object(Me.jsx)(AO,{title:P.a(o)?"Add custom SMS":"Edit custom SMS",closeOnBackdropClick:!0,width:600,height:500,open:!0,handleClose:i,children:Object(Me.jsx)(pn.d,{validateOnBlur:!1,validateOnChange:!1,initialValues:j,validationSchema:f,onSubmit:function(e,t,n){return function(e){d(o?{variables:{id:o.id,event:e.event,message:e.message}}:{variables:{event:e.event,message:e.message}}),i()}(e)},children:function(e){var t=e.values,n=e.errors,r=e.touched;return Object(Me.jsxs)(pn.c,{id:"custom-sms",className:u.form,children:[Object(Me.jsx)(pn.b,{name:"event",label:"Event",fullWidth:!0,onChange:p(t.event),options:l,labelProp:"display",valueProp:"code",component:ka}),Object(Me.jsx)(pn.b,{name:"message",label:"Message content",fullWidth:!0,multiline:!0,rows:6,component:Ua}),Object(Me.jsxs)("div",{className:u.footer,children:[UP(n,r,s)&&Object(Me.jsx)(Ao,{children:UP(n,r,s)}),Object(Me.jsx)(Tn,{type:"submit",form:"custom-sms",className:u.submit,children:P.a(o)?"Create SMS":"Confirm"})]})]})}})})})},_P=Object(j.a)(HP),KP=x()(iP||(iP=Object(l.a)(["\n query customMessages {\n customMessages {\n id\n event\n message\n }\n }\n"]))),ZP=x()(oP||(oP=Object(l.a)(["\n mutation createCustomMessage($event: CustomMessageEvent!, $message: String!) {\n createCustomMessage(event: $event, message: $message) {\n id\n }\n }\n"]))),YP=x()(cP||(cP=Object(l.a)(["\n mutation editCustomMessage(\n $id: ID!\n $event: CustomMessageEvent!\n $message: String!\n ) {\n editCustomMessage(id: $id, event: $event, message: $message) {\n id\n }\n }\n"]))),QP=x()(lP||(lP=Object(l.a)(["\n mutation deleteCustomMessage($id: ID!) {\n deleteCustomMessage(id: $id) {\n id\n }\n }\n"]))),JP=[{code:"smsCode",display:"On SMS confirmation code"},{code:"cashOutDispenseReady",display:"Cash out dispense ready"}],eB=function(){var e=_P(),t=Object(r.useState)(!1),n=Object(c.a)(t,2),a=n[0],i=n[1],o=Object(r.useState)(!1),l=Object(c.a)(o,2),s=l[0],d=l[1],m=Object(r.useState)(null),h=Object(c.a)(m,2),b=h[0],p=h[1],j=Object(r.useState)(""),f=Object(c.a)(j,2),g=f[0],O=f[1],x=Object(u.c)(KP),v=x.data,y=x.loading,w=Object(u.b)(ZP,{onError:function(e){var t=e.msg;return O(t)},refetchQueries:function(){return["customMessages"]}}),C=Object(c.a)(w,1)[0],k=Object(u.b)(YP,{onError:function(e){var t=e.msg;return O(t)},refetchQueries:function(){return["customMessages"]}}),S=Object(c.a)(k,1)[0],N=Object(u.b)(QP,{onError:function(e){var t=e.msg;return O(t)},refetchQueries:function(){return["customMessages"]}}),I=Object(c.a)(N,1)[0],E=y,F=function(){p(null),d(!1),i(!1)},L=[{header:"Event",width:600,size:"sm",textAlign:"left",view:function(e){return Tr.a((function(t){return W.a("event",t.code,e)}),JP).display}},{header:"Edit",width:100,size:"sm",textAlign:"center",view:function(e){return Object(Me.jsx)(tr,{onClick:function(){p(e),d(!0)},children:Object(Me.jsx)(Mm,{})})}},{header:"Delete",width:100,size:"sm",textAlign:"center",view:function(e){return Object(Me.jsx)(tr,{onClick:function(){p(e),i(!0)},children:Object(Me.jsx)(wm,{})})}}];return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)("div",{className:e.header,children:[Object(Me.jsx)(Ue,{children:"Custom SMS message"}),Object(Me.jsx)(Po.a,{display:"flex",justifyContent:"flex-end",children:Object(Me.jsx)(or,{color:"primary",onClick:function(){return O(""),void d(!0)},children:"Add custom SMS"})})]}),s&&Object(Me.jsx)(XP,{showModal:s,onClose:F,eventOptions:JP,sms:b,creationError:g,submit:b?S:C}),Object(Me.jsx)(Qu,{open:a,onDismissed:function(){F()},onConfirmed:function(){F(),I({variables:{id:b.id}})},errorMessage:g}),Object(Me.jsx)(Bv,{emptyText:"No custom SMS so far",elements:L,loading:E,data:T.a(["customMessages"])(v)})]})},tB=Object(j.a)(FP),nB=x()(sP||(sP=Object(l.a)(["\n query getData {\n config\n }\n"]))),rB=x()(dP||(dP=Object(l.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),aB=Object(r.memo)((function(e){var t=e.wizard,n=tB(),r=Object(u.c)(nB).data,a=Object(u.b)(rB,{refetchQueries:function(){return["getData"]}}),i=Object(c.a)(a,1)[0],o=(null===r||void 0===r?void 0:r.config)&&$l(Bl,r.config);return o?Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)("div",{className:n.header,children:Object(Me.jsx)(Ue,{children:"Receipt options"})}),Object(Me.jsxs)("div",{className:n.switchRow,children:[Object(Me.jsx)(Xe,{children:"Enable receipt printing"}),Object(Me.jsxs)("div",{className:n.switch,children:[Object(Me.jsx)(Ca,{checked:o.active,onChange:function(e){return i({variables:{config:ql(Bl,Gn.a(o,{active:e.target.checked}))}})}}),Object(Me.jsx)(tt,{children:o.active?"Yes":"No"})]})]}),Object(Me.jsxs)("div",{className:n.switchRow,children:[Object(Me.jsx)(Xe,{children:"Offer SMS receipt"}),Object(Me.jsxs)("div",{className:n.switch,children:[Object(Me.jsx)(Ca,{checked:o.sms,onChange:function(e){return i({variables:{config:ql(Bl,Gn.a(o,{sms:e.target.checked}))}})}}),Object(Me.jsx)(tt,{children:o.sms?"Yes":"No"})]})]}),Object(Me.jsx)(EP,{editing:t,title:"Visible on the receipt (options)",data:o,elements:[{name:"operatorWebsite",display:"Operator website"},{name:"operatorEmail",display:"Operator email"},{name:"operatorPhone",display:"Operator phone"},{name:"companyNumber",display:"Company number"},{name:"machineLocation",display:"Machine location"},{name:"customerNameOrPhoneNumber",display:"Customer name or phone number (if known)"},{name:"exchangeRate",display:"Exchange rate"},{name:"addressQRCode",display:"Address QR code"}],save:function(e){return i({variables:{config:ql(Bl,e)}})}})]}):null})),iB=Object(j.a)({field:{position:"relative",width:280,padding:[[0,4,4,0]]},notEditing:{display:"flex",flexDirection:"column"},notEditingSingleLine:{"& > p:first-child":{height:16,lineHeight:"16px",transform:"scale(0.75)",transformOrigin:"left",paddingLeft:0,margin:[[1,0,6,0]]},"& > p:last-child":{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",height:25,margin:0}},notEditingMultiline:{"& > p:first-child":{height:16,lineHeight:"16px",transform:"scale(0.75)",transformOrigin:"left",paddingLeft:0,margin:[[1,0,5,0]]},"& > p:last-child":{width:502,height:121,overflowY:"auto",lineHeight:"19px",wordWrap:"anywhere",margin:0}}}),oB=function(e){var t,n=e.editing,r=e.name,a=e.width,i=e.placeholder,o=e.label,c=e.value,l=e.multiline,d=void 0!==l&&l,u=e.rows,m=e.onFocus,h=Object($.a)(e,["editing","name","width","placeholder","label","value","multiline","rows","onFocus"]),b=iB(),p=(t={},Object(z.a)(t,b.field,!0),Object(z.a)(t,b.notEditing,!n),Object(z.a)(t,b.notEditingSingleLine,!n&&!d),Object(z.a)(t,b.notEditingMultiline,!n&&d),t);return Object(Me.jsxs)("div",{className:E()(p),children:[!n&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(nt,{children:o}),Object(Me.jsx)(Ze,{children:c})]}),n&&Object(Me.jsx)(pn.b,Object(s.a)({id:r,name:r,component:Ua,width:a,placeholder:i,type:"text",label:o,multiline:d,rows:u,rowsMax:"6",onFocus:m},h))]})},cB=x()(uP||(uP=Object(l.a)(["\n query getData {\n config\n }\n"]))),lB=x()(mP||(mP=Object(l.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),sB=Object(j.a)(FP),dB=function(){var e,t,n,a,i,o,l=Object(r.useState)(null),s=Object(c.a)(l,2),d=s[0],m=s[1],h=Object(r.useState)(!1),b=Object(c.a)(h,2),p=b[0],j=b[1],f=Object(u.b)(lB,{onCompleted:function(){m(null),j(!1)},refetchQueries:function(){return["getData"]},onError:function(e){return m(e)}}),g=Object(c.a)(f,1)[0],O=sB(),x=Object(u.c)(cB).data,v=(null===x||void 0===x?void 0:x.config)&&$l(Al,x.config),y=null!==v&&void 0!==v?v:{},w=null!==(e=null===v||void 0===v?void 0:v.active)&&void 0!==e&&e,C=null!==(t=null===v||void 0===v?void 0:v.delay)&&void 0!==t&&t,k=function(e){return g({variables:{config:ql(Al,e)}})},S=[{name:"title",label:"Screen title",value:null!==(n=y.title)&&void 0!==n?n:"",width:282},{name:"text",label:"Text content",value:null!==(a=y.text)&&void 0!==a?a:"",width:502,multiline:!0,rows:6},{name:"acceptButtonText",label:"Accept button text",value:null!==(i=y.acceptButtonText)&&void 0!==i?i:"",placeholder:"I accept",width:282},{name:"cancelButtonText",label:"Cancel button text",value:null!==(o=y.cancelButtonText)&&void 0!==o?o:"",placeholder:"Cancel",width:282}],N=function(e){return function(e){return Tr.a(W.a("name",e))(S)}(e).value},I={title:N("title"),text:N("text"),acceptButtonText:N("acceptButtonText"),cancelButtonText:N("cancelButtonText")},F=xn.e().shape({title:xn.g().required().max(50,"Too long"),text:xn.g().required(),acceptButtonText:xn.g().required().max(50,"Too long"),cancelButtonText:xn.g().required().max(50,"Too long")});return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)("div",{className:O.header,children:Object(Me.jsx)(Ue,{children:"Terms & Conditions"})}),Object(Me.jsxs)("div",{className:O.switchRow,children:[Object(Me.jsx)(Xe,{children:"Show on screen"}),Object(Me.jsxs)("div",{className:O.switch,children:[Object(Me.jsx)(Ca,{checked:w,onChange:function(e){return k({active:e.target.checked})}}),Object(Me.jsx)(tt,{children:w?"Yes":"No"})]})]}),Object(Me.jsxs)("div",{className:O.switchRow,children:[Object(Me.jsx)(Xe,{children:"Add 7 seconds delay on screen"}),Object(Me.jsxs)("div",{className:O.switch,children:[Object(Me.jsx)(Ca,{checked:C,onChange:function(e){return k({delay:e.target.checked})}}),Object(Me.jsx)(tt,{children:C?"Yes":"No"})]})]}),Object(Me.jsxs)("div",{className:O.header,children:[Object(Me.jsx)(Ke,{children:"Info card"}),!p&&Object(Me.jsx)(tr,{className:O.transparentButton,onClick:function(){return j(!0)},children:Object(Me.jsx)(Mm,{})})]}),Object(Me.jsx)(pn.d,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,initialValues:I,validationSchema:F,onSubmit:function(e){return k(e)},onReset:function(){j(!1),m(null)},children:Object(Me.jsxs)(pn.c,{children:[Object(Me.jsx)(xu,{}),S.map((function(e,t){return Object(Me.jsx)("div",{className:O.row,children:Object(Me.jsx)(oB,{editing:p,name:e.name,width:e.width,placeholder:e.placeholder,label:e.label,value:e.value,multiline:e.multiline,rows:e.rows,onFocus:function(){return m(null)}})},t)})),Object(Me.jsx)("div",{className:E()(O.row,O.submit),children:p&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(or,{color:"primary",type:"submit",children:"Save"}),Object(Me.jsx)(or,{color:"secondary",type:"reset",children:"Cancel"}),d&&Object(Me.jsx)(Ao,{children:"Failed to save changes"})]})})]})})]})},uB={running:ne,notRunning:"#ffeceb"},mB={running:"#ecfbef",notRunning:me},hB={uptimeContainer:{display:"inline-block",minWidth:104,margin:[[0,20]]},name:{extend:Re.label1,paddingLeft:4,color:se}},bB=Object(j.a)(hB),pB=Object(j.a)({root:{borderRadius:4,marginTop:4,marginRight:2,marginBottom:4,marginLeft:2,height:24,backgroundColor:function(e){var t=e.type;return mB[t]}},label:{fontSize:ye,fontWeight:Se,fontFamily:Ne,padding:[[4,8]],color:function(e){var t=e.type;return uB[t]}}}),jB=function(e){var t,n=e.process,r=(Object($.a)(e,["process"]),bB());return Object(Me.jsxs)("div",{className:r.uptimeContainer,children:[Object(Me.jsx)("div",{className:r.name,children:jx.a(n.name)}),Object(Me.jsx)(Sa.a,{label:"RUNNING"===n.state?"Running for ".concat((t=n.uptime,t<60?"".concat(t,"s"):t<3600?"".concat(Math.floor(t/60),"m"):t<86400?"".concat(Math.floor(t/60/60),"h"):"".concat(Math.floor(t/60/60/24),"d"))):Hu(n.state),classes:pB({type:"RUNNING"===n.state?"running":"notRunning"})})]})},fB={serverTableWrapper:{extend:Sb.tableWrapper,maxWidth:"100%",marginLeft:0},serverVersion:{extend:Re.p,color:se,margin:"auto 0 auto 0"},headerLine2:{display:"flex",justifyContent:"space-between",marginBottom:24},uptimeContainer:{margin:"auto 0 auto 0"}},gB=Gn.a(Sb,fB),OB=Object(j.a)(gB),xB={code:"SHOW_ALL",display:"Show all"},vB=x()(hP||(hP=Object(l.a)(["\n query ServerData($limit: Int, $from: Date, $until: Date, $timezone: String) {\n serverLogsCsv(\n limit: $limit\n from: $from\n until: $until\n timezone: $timezone\n )\n }\n"]))),yB=x()(bP||(bP=Object(l.a)(["\n query ServerData($limit: Int, $from: Date, $until: Date) {\n serverVersion\n uptime {\n name\n state\n uptime\n }\n serverLogs(limit: $limit, from: $from, until: $until) {\n logLevel\n id\n timestamp\n message\n }\n }\n"]))),wB=x()(pP||(pP=Object(l.a)(["\n query getData {\n config\n }\n"]))),CB=function(){var e,t,n=OB(),a=Object(r.useRef)(),i=Object(r.useState)(null),o=Object(c.a)(i,2),l=o[0],s=o[1],d=Object(r.useState)(xB),m=Object(c.a)(d,2),h=m[0],b=m[1],p=Object(u.c)(yB,{onCompleted:function(){return s("")},variables:{limit:500}}),j=p.data,f=p.loading,g=Object(u.c)(wB),O=g.data,x=g.configLoading,v=T.a(["config","locale_timezone"],O),y=null===j||void 0===j?void 0:j.serverVersion,w=null!==(e=null===j||void 0===j?void 0:j.uptime)&&void 0!==e?e:[],C=L.a(pu.a(xB),Yj.a,Vo.a([{code:"error",display:"Error"},{code:"info",display:"Info"},{code:"debug",display:"Debug"}]),B.a((function(e){return{code:T.a(["logLevel"])(e),display:Uu(T.a(["logLevel"])(e))}})),T.a(["serverLogs"]));return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)("div",{className:n.titleWrapper,children:[Object(Me.jsxs)("div",{className:n.titleAndButtonsContainer,children:[Object(Me.jsx)(yn,{children:"Server"}),j&&Object(Me.jsxs)("div",{className:n.buttonsWrapper,children:[Object(Me.jsx)(DF,{title:"Download logs",name:"server-logs",query:vB,args:{timezone:v},logs:j.serverLogs,getLogs:function(e){return T.a(["serverLogsCsv"])(e)},timezone:v}),Object(Me.jsx)(Ze,{children:l})]})]}),Object(Me.jsx)("div",{className:n.serverVersion,children:y&&Object(Me.jsxs)("span",{children:["Server version: v",y]})})]}),Object(Me.jsxs)("div",{className:n.headerLine2,children:[j&&Object(Me.jsx)(um,{onSelectedItemChange:function(e){a.current&&a.current.scrollTo(0,0),b(e)},label:"Level",items:C(j),default:xB,selectedItem:h}),Object(Me.jsx)("div",{className:n.uptimeContainer,children:w&&w.map((function(e,t){return Object(Me.jsx)(jB,{process:e},t)}))})]}),Object(Me.jsx)("div",{className:n.wrapper,children:Object(Me.jsxs)("div",{ref:a,className:n.serverTableWrapper,children:[Object(Me.jsxs)(xv,{className:n.table,children:[Object(Me.jsx)(Cv,{children:Object(Me.jsxs)(Lv,{header:!0,children:[Object(Me.jsx)(Nv,{className:n.dateColumn,children:"Date"}),Object(Me.jsx)(Nv,{className:n.levelColumn,children:"Level"}),Object(Me.jsx)(Nv,{className:n.fillColumn})]})}),Object(Me.jsx)(vv,{children:j&&j.serverLogs.filter((function(e){return h===xB||e.logLevel===h.code})).map((function(e,t){return Object(Me.jsxs)(Lv,{size:"sm",children:[Object(Me.jsx)(wv,{children:v&&Os(e.timestamp,v,"yyyy-MM-dd HH:mm")}),Object(Me.jsx)(wv,{children:e.logLevel}),Object(Me.jsx)(wv,{children:e.message})]},t)}))})]}),f&&x&&Object(Me.jsx)(Ue,{children:"Loading..."}),!f&&!x&&!(null===j||void 0===j||null===(t=j.serverLogs)||void 0===t?void 0:t.length)&&Object(Me.jsx)(Ue,{children:"No activity so far"})]})})]})},kB=n(897),SB=n(885),NB=n(886),IB={tr:function(e){return{margin:0,height:e.height}},table:function(e){return{width:e.width}},head:{display:"flex",flex:1,justifyContent:"space-between",alignItems:"center",paddingRight:12},button:{marginBottom:1},itemWrapper:{display:"flex",flexDirection:"column",marginTop:16,minHeight:35},label:{extend:Re.label1,color:se,marginBottom:4},item:{extend:Re.p,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},EB=Object(j.a)(IB),FB=function(e){var t=e.width,n=void 0===t?378:t,r=e.height,a=void 0===r?128:r,i=e.title,o=e.items,c=e.onEdit,l=e.className,s=EB({width:n,height:a});return Object(Me.jsx)(Me.Fragment,{children:Object(Me.jsxs)(Nu,{className:E()(l,s.table),children:[Object(Me.jsx)(Iu,{children:Object(Me.jsxs)(Du,{className:s.head,children:[i,Object(Me.jsx)(tr,{onClick:c,className:s.button,children:Object(Me.jsx)(dS,{})})]})}),Object(Me.jsx)(Fu,{children:Object(Me.jsx)(Bu,{className:s.tr,children:Object(Me.jsx)(Lu,{width:n,children:o&&Object(Me.jsxs)(Me.Fragment,{children:[o[0]&&Object(Me.jsxs)("div",{className:s.itemWrapper,children:[Object(Me.jsx)("div",{className:s.label,children:o[0].label}),Object(Me.jsx)("div",{className:s.item,children:o[0].value})]}),o[1]&&Object(Me.jsxs)("div",{className:s.itemWrapper,children:[Object(Me.jsx)("div",{className:s.label,children:o[1].label}),Object(Me.jsx)("div",{className:s.item,children:o[1].value})]})]})})})})]})})},LB=x()(jP||(jP=Object(l.a)(["\n query getData {\n accounts\n config\n }\n"]))),DB=x()(fP||(fP=Object(l.a)(["\n mutation Save($accounts: JSONObject) {\n saveAccounts(accounts: $accounts)\n }\n"]))),PB=Object(j.a)({wrapper:{marginLeft:1}}),BB=function(){var e,t=Object(r.useState)(null),n=Object(c.a)(t,2),a=n[0],i=n[1],o=Object(u.c)(LB).data,l=Object(u.b)(DB,{onCompleted:function(){return i(null)},refetchQueries:["getData"]}),d=Object(c.a)(l,1)[0],m=PB(),b=null!==(e=null===o||void 0===o?void 0:o.accounts)&&void 0!==e?e:{},p=function(e,t){var n=M.a(R.a("face"))(t),r=b[e]||{};return B.a((function(e){var t,n=e.display,a=e.code;return{label:n,value:e.long?(t=r[a],!t||t.length<=20?t:"".concat(t.slice(0,8),"(...)").concat(t.slice(t.length-8,t.length))):r[a]}}))(n)};return Object(Me.jsxs)("div",{className:m.wrapper,children:[Object(Me.jsx)(Wo,{title:"3rd Party Services"}),Object(Me.jsx)(h.a,{container:!0,spacing:4,children:ks.a(Jg).map((function(e){return Object(Me.jsx)(h.a,{item:!0,children:Object(Me.jsx)(FB,{editMessage:"Configure "+e.title,title:e.title,onEdit:function(){return i(e)},items:p(e.code,e.elements)})},e.code)}))}),a&&Object(Me.jsx)(AO,{title:"Edit ".concat(a.name),width:478,handleClose:function(){return i(null)},open:!0,children:Object(Me.jsx)(jg,{save:function(e){return d({variables:{accounts:Object(z.a)({},a.code,e)}})},elements:function(e){var t=e.code,n=e.elements;return B.a((function(e){return e.component===$a?function(e){var t=e.settings,n=kB.a(["config","wallets_BTC_wallet"]),r=Ms.a(SB.a(n,o),t.requirement);return t.enabled=r,e}(e):e.component!==Va?e:Object(s.a)(Object(s.a)({},e),{},{inputProps:{isPasswordFilled:!P.a(b[t])&&!P.a(T.a([e.code],b[t]))}})}),n)}(a),validationSchema:function(e){var t=e.code,n=e.getValidationSchema;return n(b[t])}(a),value:function(e){var t=e.elements,n=e.code,r=b[n],a=M.a(W.a("component",Va)),i=B.a(R.a(["code"])),o=L.a(i,a)(t);return NB.a((function(e,t){return F.a(t,o)?"":e}),r)}(a)})})]})},RB=n(437),AB=n.n(RB),TB=x()(gP||(gP=Object(l.a)(["\n query sessions {\n sessions {\n sid\n sess\n expire\n }\n }\n"]))),MB=x()(OP||(OP=Object(l.a)(["\n mutation deleteSession($sid: String!) {\n deleteSession(sid: $sid) {\n sid\n }\n }\n"]))),WB=x()(xP||(xP=Object(l.a)(["\n query getData {\n config\n }\n"]))),zB=function(){var e=Object(u.c)(TB),t=e.data,n=e.loading,r=Object(u.b)(MB,{refetchQueries:function(){return["sessions"]}}),a=Object(c.a)(r,1)[0],i=Object(u.c)(WB),o=i.data,l=i.loading,s=T.a(["config","locale_timezone"],o),d=[{header:"Login",width:207,textAlign:"left",size:"sm",view:function(e){return e.sess.user.username}},{header:"Last known use",width:305,textAlign:"center",size:"sm",view:function(e){if(P.a(e.sess.ua))return"No Record";var t=AB()(e.sess.ua);return"".concat(t.browser.name," ").concat(t.browser.version," on ").concat(t.os.name," ").concat(t.os.version)}},{header:"Last known location",width:250,textAlign:"center",size:"sm",view:function(e){return"localhost"===(t=e.sess.ipAddress)||"::1"===t||"127.0.0.1"===t?"This device":e.sess.ipAddress;var t}},{header:"Expiration date (UTC)",width:290,textAlign:"right",size:"sm",view:function(e){return"".concat(Os(e.expire,s,"yyyy-MM-dd")," ").concat(Os(e.expire,s,"HH:mm:ss"))}},{header:"",width:80,textAlign:"center",size:"sm",view:function(e){return Object(Me.jsx)(tr,{onClick:function(){a({variables:{sid:e.sid}})},children:Object(Me.jsx)(wm,{})})}}];return!(n&&l)&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Wo,{title:"Session Management"}),Object(Me.jsx)(Bv,{elements:d,data:T.a(["sessions"])(t)})]})},$B=Object(j.a)(Lb),qB=1e3,HB=x()(vP||(vP=Object(l.a)(["\n query getData {\n config\n }\n"]))),VB=x()(yP||(yP=Object(l.a)(["\n query transactions(\n $simplified: Boolean\n $limit: Int\n $from: Date\n $until: Date\n $timezone: String\n ) {\n transactionsCsv(\n simplified: $simplified\n limit: $limit\n from: $from\n until: $until\n timezone: $timezone\n )\n }\n"]))),UB=x()(wP||(wP=Object(l.a)(["\n query filters {\n transactionFilters {\n type\n value\n }\n }\n"]))),GB=x()(CP||(CP=Object(l.a)(["\n query transactions(\n $limit: Int\n $from: Date\n $until: Date\n $txClass: String\n $machineName: String\n $customerName: String\n $fiatCode: String\n $cryptoCode: String\n $toAddress: String\n $status: String\n ) {\n transactions(\n limit: $limit\n from: $from\n until: $until\n txClass: $txClass\n machineName: $machineName\n customerName: $customerName\n fiatCode: $fiatCode\n cryptoCode: $cryptoCode\n toAddress: $toAddress\n status: $status\n ) {\n id\n txClass\n txHash\n toAddress\n commissionPercentage\n expired\n machineName\n operatorCompleted\n sendConfirmed\n dispense\n hasError: error\n deviceId\n fiat\n cashInFee\n fiatCode\n cryptoAtoms\n cryptoCode\n toAddress\n created\n customerName\n customerIdCardData\n customerIdCardPhotoPath\n customerFrontCameraPath\n customerPhone\n discount\n customerId\n isAnonymous\n batched\n batchTime\n }\n }\n"]))),XB=function(e){return Zl.a((function(e,t){return Object(s.a)(Object(s.a)({},e),{},Object(z.a)({},t.type,t.value))}),{},e)},_B=function(){var e,t=$B(),n=Object(w.h)(),a=Object(r.useState)([]),i=Object(c.a)(a,2),o=i[0],l=i[1],s=Object(u.c)(UB),d=s.data,m=s.loading,h=Object(r.useState)({limit:qB}),b=Object(c.a)(h,2),p=b[0],j=b[1],f=Object(u.c)(GB,{variables:p}),g=f.data,O=f.loading,x=f.refetch,v=f.startPolling,y=f.stopPolling;Object(r.useEffect)((function(){return v(1e4),y}));var C=null!==(e=null===g||void 0===g?void 0:g.transactions)&&void 0!==e?e:[],k=Object(u.c)(HB),S=k.data,N=k.configLoading,I=T.a(["config","locale_timezone"],S),E=function(e){return e.isAnonymous?"Anonymous":e.customerName?e.customerName:e.customerIdCardData?function(e){var t=e.firstName,n=e.lastName;return"".concat(Mb.a(Wb.a,zb.a)(t),". ").concat(n)}(e.customerIdCardData):e.customerPhone},F=[{header:"",width:32,size:"sm",view:function(e){return"cashOut"===e.txClass?Object(Me.jsx)(gl,{}):Object(Me.jsx)(ul,{})}},{header:"Machine",name:"machineName",width:160,size:"sm",view:T.a(["machineName"])},{header:"Customer",width:202,size:"sm",view:function(e){return Object(Me.jsxs)("div",{className:t.flexWrapper,children:[Object(Me.jsx)("div",{className:t.overflowTd,children:E(e)}),!e.isAnonymous&&Object(Me.jsx)("div",{onClick:function(){return t=e.customerId,n.push("/compliance/customer/".concat(t));var t},children:Object(Me.jsx)(Gd,{className:t.customerLinkIcon})})]})}},{header:"Cash",width:144,textAlign:"right",size:"sm",view:function(e){return"".concat(Number.parseFloat(e.fiat)," ").concat(e.fiatCode)}},{header:"Crypto",width:150,textAlign:"right",size:"sm",view:function(e){return"".concat(Tb.utils.toUnit(new vl.a(e.cryptoAtoms),e.cryptoCode)," ").concat(e.cryptoCode)}},{header:"Address",view:function(e){return Tb.utils.formatCryptoAddress(e.cryptoCode,e.toAddress)},className:t.overflowTd,size:"sm",width:140},{header:"Date (UTC)",view:function(e){return I&&Os(e.created,I,"yyyy-MM-dd HH:mm:ss")},textAlign:"right",size:"sm",width:195},{header:"Status",view:function(e){return lj(e)},textAlign:"left",size:"sm",width:80}],L=T.a(["transactionFilters"])(d);return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)("div",{className:t.titleWrapper,children:[Object(Me.jsxs)("div",{className:t.titleAndButtonsContainer,children:[Object(Me.jsx)(yn,{children:"Transactions"}),Object(Me.jsx)("div",{className:t.buttonsWrapper,children:Object(Me.jsx)(mN,{loading:m,filters:o,options:L,inputPlaceholder:"Search Transactions",onChange:function(e){var t=XB(e);l(e),j({limit:qB,txClass:t.type,machineName:t.machine,customerName:t.customer,fiatCode:t.fiat,cryptoCode:t.crypto,toAddress:t.address,status:t.status}),x&&x()}})}),C&&Object(Me.jsx)("div",{className:t.buttonsWrapper,children:Object(Me.jsx)(DF,{title:"Download logs",name:"transactions",query:VB,getLogs:function(e){return T.a(["transactionsCsv"])(e)},simplified:!0,timezone:I,args:{timezone:I}})})]}),Object(Me.jsxs)("div",{className:t.headerLabels,children:[Object(Me.jsxs)("div",{children:[Object(Me.jsx)(ul,{}),Object(Me.jsx)("span",{children:"Cash-in"})]}),Object(Me.jsxs)("div",{children:[Object(Me.jsx)(gl,{}),Object(Me.jsx)("span",{children:"Cash-out"})]})]})]}),o.length>0&&Object(Me.jsx)(FN,{entries:C.length,filters:o,onFilterDelete:function(e){var t=M.a((function(t){return!rN.a(_u.a(["type","value"],t),e)}))(o);l(t);var n=XB(t);j({limit:qB,txClass:n.type,machineName:n.machine,customerName:n.customer,fiatCode:n.fiat,cryptoCode:n.crypto,toAddress:n.address,status:n.status}),x&&x()},deleteAllFilters:function(){l([]);var e=XB([]);j({limit:qB,txClass:e.type,machineName:e.machine,customerName:e.customer,fiatCode:e.fiat,cryptoCode:e.crypto,toAddress:e.address,status:e.status}),x&&x()}}),Object(Me.jsx)(Bv,{loading:O&&N,emptyText:"No transactions so far",elements:F,data:C,Details:fj,expandable:!0,rowSize:"sm",timezone:I})]})};function KB(){return(KB=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function ZB(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var YB=r.createElement("desc",null,"Created with Sketch."),QB=r.createElement("g",{id:"icon/sf-small/settings/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinejoin:"round"},r.createElement("path",{d:"M10,13 C8.34325,13 7,11.65675 7,10 C7,8.34325 8.34325,7 10,7 C11.65675,7 13,8.34325 13,10 C13,11.65675 11.65675,13 10,13 Z M19.843,11.816 C19.945,11.391 20,10.45 20,10 C20,9.55 19.945,8.609 19.843,8.184 L17.649,7.656 C17.499,7.166 17.302,6.695 17.065,6.25 L18.244,4.324 C18.016,3.951 17.39,3.247 17.071,2.929 C16.753,2.61 16.049,1.984 15.676,1.756 L13.75,2.935 C13.305,2.698 12.834,2.501 12.344,2.351 L11.816,0.157 C11.391,0.055 10.45,0 10,0 C9.55,0 8.609,0.055 8.184,0.157 L7.656,2.351 C7.166,2.501 6.695,2.698 6.25,2.935 L4.324,1.756 C3.951,1.984 3.247,2.61 2.929,2.929 C2.61,3.247 1.984,3.951 1.756,4.324 L2.935,6.25 C2.698,6.695 2.501,7.166 2.351,7.656 L0.157,8.184 C0.055,8.609 0,9.55 0,10 C0,10.45 0.055,11.391 0.157,11.816 L2.351,12.344 C2.501,12.834 2.698,13.304 2.935,13.75 L1.756,15.676 C1.984,16.049 2.61,16.753 2.929,17.071 C3.247,17.39 3.951,18.016 4.324,18.244 L6.25,17.065 C6.696,17.302 7.166,17.499 7.656,17.649 L8.184,19.843 C8.609,19.945 9.55,20 10,20 C10.45,20 11.391,19.945 11.816,19.843 L12.344,17.649 C12.834,17.499 13.304,17.302 13.75,17.065 L15.676,18.244 C16.049,18.016 16.753,17.39 17.071,17.071 C17.39,16.753 18.016,16.049 18.244,15.676 L17.065,13.75 C17.302,13.304 17.499,12.834 17.649,12.344 L19.843,11.816 Z",id:"Stroke-1",stroke:"#FFFFFF",strokeWidth:2}));function JB(e,t){var n=e.title,a=e.titleId,i=ZB(e,["title","titleId"]);return r.createElement("svg",KB({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,YB,QB)}var eR=r.forwardRef(JB);n.p;function tR(){return(tR=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function nR(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var rR=r.createElement("desc",null,"Created with Sketch."),aR=r.createElement("g",{id:"icon/sf-small/settings/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinejoin:"round"},r.createElement("path",{d:"M10,13 C8.34325,13 7,11.65675 7,10 C7,8.34325 8.34325,7 10,7 C11.65675,7 13,8.34325 13,10 C13,11.65675 11.65675,13 10,13 Z M19.843,11.816 C19.945,11.391 20,10.45 20,10 C20,9.55 19.945,8.609 19.843,8.184 L17.649,7.656 C17.499,7.166 17.302,6.695 17.065,6.25 L18.244,4.324 C18.016,3.951 17.39,3.247 17.071,2.929 C16.753,2.61 16.049,1.984 15.676,1.756 L13.75,2.935 C13.305,2.698 12.834,2.501 12.344,2.351 L11.816,0.157 C11.391,0.055 10.45,0 10,0 C9.55,0 8.609,0.055 8.184,0.157 L7.656,2.351 C7.166,2.501 6.695,2.698 6.25,2.935 L4.324,1.756 C3.951,1.984 3.247,2.61 2.929,2.929 C2.61,3.247 1.984,3.951 1.756,4.324 L2.935,6.25 C2.698,6.695 2.501,7.166 2.351,7.656 L0.157,8.184 C0.055,8.609 0,9.55 0,10 C0,10.45 0.055,11.391 0.157,11.816 L2.351,12.344 C2.501,12.834 2.698,13.304 2.935,13.75 L1.756,15.676 C1.984,16.049 2.61,16.753 2.929,17.071 C3.247,17.39 3.951,18.016 4.324,18.244 L6.25,17.065 C6.696,17.302 7.166,17.499 7.656,17.649 L8.184,19.843 C8.609,19.945 9.55,20 10,20 C10.45,20 11.391,19.945 11.816,19.843 L12.344,17.649 C12.834,17.499 13.304,17.302 13.75,17.065 L15.676,18.244 C16.049,18.016 16.753,17.39 17.071,17.071 C17.39,16.753 18.016,16.049 18.244,15.676 L17.065,13.75 C17.302,13.304 17.499,12.834 17.649,12.344 L19.843,11.816 Z",id:"Stroke-1",stroke:"#1B2559",strokeWidth:2}));function iR(e,t){var n=e.title,a=e.titleId,i=nR(e,["title","titleId"]);return r.createElement("svg",tR({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,rR,aR)}var oR,cR,lR,sR,dR,uR,mR,hR,bR,pR,jR,fR,gR,OR,xR,vR,yR,wR,CR,kR,SR,NR,IR,ER,FR,LR=r.forwardRef(iR),DR=(n.p,n(887)),PR=Object(j.a)({radioLabel:{height:40,padding:[[0,10]]},radio:{padding:4,margin:4},radioGroup:{flexDirection:"row"},error:{color:me},specialLabel:{height:40,padding:0},specialGrid:{display:"grid",gridTemplateColumns:[[182,162,141]]},directionIcon:{marginRight:2},directionName:{marginLeft:6},thresholdWrapper:{display:"flex",flexDirection:"column"},thresholdTitle:{marginTop:50},thresholdContentWrapper:{display:"flex",flexDirection:"row"},thresholdField:{marginRight:6,width:75},description:{marginTop:7},space:{marginLeft:6,marginRight:6},lastSpace:{marginLeft:6},suspensionDays:{width:34},input:{marginTop:-2},limitedInput:{width:50},daysInput:{width:60}}),BR=xn.g().required(),RR=xn.e().shape({threshold:xn.d().nullable().transform($f).label("Invalid threshold"),thresholdDays:xn.d().transform($f).nullable().label("Invalid threshold days")}),AR=xn.e().shape({requirement:xn.g().required(),suspensionDays:xn.d().transform($f).nullable()}),TR=xn.e().shape({triggerType:BR,requirement:AR,threshold:RR}).test((function(e,t){var n=e.threshold,r=e.triggerType;if(!r||!{txAmount:function(e){return e.threshold>=0},txVolume:function(e){return e.threshold>=0&&e.thresholdDays>0},txVelocity:function(e){return e.threshold>0&&e.thresholdDays>0},consecutiveDays:function(e){return e.thresholdDays>0}}[r](n))return t.createError({path:"threshold",message:{txAmount:function(e){return"Amount must be greater than or equal to 0"},txVolume:function(e){var t=[];return e.threshold<0&&t.push("Volume must be greater than or equal to 0"),e.thresholdDays<=0&&t.push("Days must be greater than 0"),t.join(", ")},txVelocity:function(e){var t=[];return e.threshold<=0&&t.push("Transactions must be greater than 0"),e.thresholdDays<=0&&t.push("Days must be greater than 0"),t.join(", ")},consecutiveDays:function(e){return"Days must be greater than 0"}}[r](n)})})).test((function(e,t){var n=e.requirement;if(!n||!function(e){return"suspend"!==e.requirement||e.suspensionDays>0}(n))return t.createError({path:"requirement",message:"Suspension days must be greater than 0"})})),MR=xn.e().shape({triggerType:xn.g().required(),threshold:xn.e({threshold:xn.d().transform($f).nullable(),thresholdDays:xn.d().transform($f).nullable()})}).test((function(e,t){var n=e.threshold,r=e.triggerType;if(!r||!{txAmount:function(e){return e.threshold>=0},txVolume:function(e){return e.threshold>=0&&e.thresholdDays>0},txVelocity:function(e){return e.threshold>0&&e.thresholdDays>0},consecutiveDays:function(e){return e.thresholdDays>0}}[r](n))return t.createError({path:"threshold",message:{txAmount:function(e){return"Amount must be greater than or equal to 0"},txVolume:function(e){var t=[];return(!e.threshold||e.threshold<0)&&t.push("Volume must be greater than or equal to 0"),(!e.thresholdDays||e.thresholdDays<=0)&&t.push("Days must be greater than 0"),t.join(", ")},txVelocity:function(e){var t=[];return(!e.threshold||e.threshold<=0)&&t.push("Transactions must be greater than 0"),(!e.thresholdDays||e.thresholdDays<=0)&&t.push("Days must be greater than 0"),t.join(", ")},consecutiveDays:function(e){return"Days must be greater than 0"}}[r](n)})})),WR=[{display:"Transaction amount",code:"txAmount"},{display:"Transaction volume",code:"txVolume"},{display:"Transaction velocity",code:"txVelocity"},{display:"Consecutive days",code:"consecutiveDays"}],zR=function(e){var t,n,r,a,i,o,c=Object.assign({},e),l=PR(),s=Object(pn.e)(),d=s.errors,u=s.touched,m=s.values,h=s.setTouched,b=s.handleChange,p=Object(z.a)({},l.error,d.triggerType&&u.triggerType),j=_o.a(null===m||void 0===m?void 0:m.triggerType),f=j(["txAmount","txVolume"]),g=j(["txVelocity"]),O=j(["txVolume","txVelocity"]),x=j(["consecutiveDays"]),v=!!d.threshold&&!!(null===(t=u.threshold)||void 0===t?void 0:t.threshold)&&!x&&(!(null===(n=m.threshold)||void 0===n?void 0:n.threshold)||(null===(r=m.threshold)||void 0===r?void 0:r.threshold)<0),y=!!d.threshold&&!!(null===(a=u.threshold)||void 0===a?void 0:a.thresholdDays)&&!j(["txAmount"])&&(!(null===(i=m.threshold)||void 0===i?void 0:i.thresholdDays)||(null===(o=m.threshold)||void 0===o?void 0:o.thresholdDays)<0),w=!(!y&&!v),C=Object(z.a)({},l.error,w);return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Po.a,{display:"flex",alignItems:"center",children:Object(Me.jsx)(Ue,{className:E()(p),children:"Choose trigger type"})}),Object(Me.jsx)(pn.b,{component:Ha,name:"triggerType",options:WR,labelClassName:l.radioLabel,radioClassName:l.radio,className:l.radioGroup,onChange:function(e){b(e),h({threshold:!1,thresholdDays:!1})}}),Object(Me.jsxs)("div",{className:l.thresholdWrapper,children:[(f||g||O||x)&&Object(Me.jsx)(Ue,{className:E()(C,l.thresholdTitle),children:"Threshold"}),Object(Me.jsxs)("div",{className:l.thresholdContentWrapper,children:[f&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(pn.b,{className:l.thresholdField,component:qa,size:"lg",name:"threshold.threshold",error:v}),Object(Me.jsx)(_e,{className:E()(l.description),children:c.currency})]}),g&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(pn.b,{className:l.thresholdField,component:qa,size:"lg",name:"threshold.threshold",error:v}),Object(Me.jsx)(_e,{className:E()(l.description),children:"transactions"})]}),O&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(_e,{className:E()(p,l.space,l.description),children:"in"}),Object(Me.jsx)(pn.b,{className:l.thresholdField,component:qa,size:"lg",name:"threshold.thresholdDays",error:y}),Object(Me.jsx)(_e,{className:E()(l.description),children:"days"})]}),x&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(pn.b,{className:l.thresholdField,component:qa,size:"lg",name:"threshold.thresholdDays",error:y}),Object(Me.jsx)(_e,{className:E()(l.description),children:"consecutive days"})]})]})]})]})},$R=xn.e().shape({requirement:xn.e({requirement:xn.g().required(),suspensionDays:xn.d().when("requirement",{is:function(e){return"suspend"===e},then:xn.d().nullable().transform($f),otherwise:xn.d().nullable().transform((function(){return null}))})}).required()}).test((function(e,t){var n=e.requirement;if(!n||!function(e){return"suspend"!==e.requirement||e.suspensionDays>0}(n))return t.createError({path:"requirement",message:"Suspension days must be greater than 0"})})),qR=[{display:"SMS verification",code:"sms"},{display:"ID card image",code:"idCardPhoto"},{display:"ID data",code:"idCardData"},{display:"Customer camera",code:"facephoto"},{display:"Sanctions",code:"sanctions"},{display:"US SSN",code:"usSsn"},{display:"Suspend",code:"suspend"},{display:"Block",code:"block"}],HR={schema:$R,options:qR,Component:function(){var e,t,n,r,a=PR(),i=Object(pn.e)(),o=i.touched,c=i.errors,l=i.values,s=i.handleChange,d=i.setTouched,u=!!c.requirement&&!!(null===(e=o.requirement)||void 0===e?void 0:e.suspensionDays)&&(!(null===(t=l.requirement)||void 0===t?void 0:t.suspensionDays)||(null===(n=l.requirement)||void 0===n?void 0:n.suspensionDays)<0),m="suspend"===(null===l||void 0===l||null===(r=l.requirement)||void 0===r?void 0:r.requirement),h=Object(z.a)({},a.error,!!c.requirement&&!m||m&&u);return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Po.a,{display:"flex",alignItems:"center",children:Object(Me.jsx)(Ue,{className:E()(h),children:"Choose a requirement"})}),Object(Me.jsx)(pn.b,{component:Ha,name:"requirement.requirement",options:qR,labelClassName:a.specialLabel,radioClassName:a.radio,className:E()(a.radioGroup,a.specialGrid),onChange:function(e){s(e),d({suspensionDays:!1})}}),m&&Object(Me.jsx)(pn.b,{className:a.thresholdField,component:qa,label:"Days",size:"lg",name:"requirement.suspensionDays",error:u})]})},initialValues:{requirement:{requirement:"",suspensionDays:""}}},VR=function(e,t,n){return function(r){return e?L.a(R.a(t),Tr.a(W.a(null!==n&&void 0!==n?n:"code",r)))(e):""}},UR=function(){var e,t=Object(pn.e)().values,n=PR(),r=null===t||void 0===t||null===(e=t.requirement)||void 0===e?void 0:e.requirement,a="suspend"===r,i=VR(qR,"display")(r);return Object(Me.jsxs)(Po.a,{display:"flex",alignItems:"baseline",children:["".concat(i," ").concat(a?"for":""),a&&Object(Me.jsx)(pn.b,{bold:!0,className:n.suspensionDays,name:"requirement.suspensionDays",component:qa,textAlign:"center"}),a&&"days"]})},GR=function(e){var t=e.requirement,n=e.suspensionDays,r=PR(),a=VR(qR,"display")(t),i="suspend"===t;return Object(Me.jsxs)(Po.a,{display:"flex",alignItems:"baseline",children:["".concat(a," ").concat(i?"for":""),i&&Object(Me.jsx)(Ke,{className:r.space,noMargin:!0,children:n}),i&&"days"]})},XR=function(e){var t,n,r,a=e.config,i=e.currency,o=e.isEdit,c=PR(),l=(t={},Object(z.a)(t,c.input,!0),Object(z.a)(t,c.limitedInput,"txVelocity"===(null===a||void 0===a?void 0:a.triggerType)),Object(z.a)(t,c.daysInput,"consecutiveDays"===(null===a||void 0===a?void 0:a.triggerType)),t),s=null===a||void 0===a||null===(n=a.threshold)||void 0===n?void 0:n.threshold,d=null===a||void 0===a||null===(r=a.threshold)||void 0===r?void 0:r.thresholdDays,u=o?Object(Me.jsx)(pn.b,{bold:!0,className:E()(l),name:"threshold.threshold",component:qa,textAlign:"right"}):Object(Me.jsx)(Ke,{noMargin:!0,children:s}),m=o?Object(Me.jsx)(pn.b,{bold:!0,className:E()(l),name:"threshold.thresholdDays",component:qa,textAlign:"right"}):Object(Me.jsx)(Ke,{noMargin:!0,children:d});switch(null===a||void 0===a?void 0:a.triggerType){case"txAmount":return Object(Me.jsxs)(Po.a,{display:"flex",alignItems:"baseline",justifyContent:"right",children:[u,Object(Me.jsx)(tt,{noMargin:!0,className:c.lastSpace,children:i})]});case"txVolume":return Object(Me.jsxs)(Po.a,{display:"flex",alignItems:"baseline",justifyContent:"right",children:[u,Object(Me.jsx)(tt,{noMargin:!0,className:c.lastSpace,children:i}),Object(Me.jsx)(et,{noMargin:!0,className:c.space,children:"in"}),m,Object(Me.jsx)(et,{noMargin:!0,className:c.lastSpace,children:"days"})]});case"txVelocity":return Object(Me.jsxs)(Po.a,{display:"flex",alignItems:"baseline",justifyContent:"right",children:[u,Object(Me.jsx)(et,{className:c.space,noMargin:!0,children:"transactions in"}),m,Object(Me.jsx)(et,{className:c.lastSpace,noMargin:!0,children:"days"})]});case"consecutiveDays":return Object(Me.jsxs)(Po.a,{display:"flex",alignItems:"baseline",justifyContent:"right",children:[m,Object(Me.jsx)(et,{className:c.lastSpace,noMargin:!0,children:"days"})]});default:return""}},_R=Object(r.memo)((function(e){var t=e.currency,n=Object(pn.e)().values;return Object(Me.jsx)(XR,{isEdit:!0,config:n,currency:t})})),KR=function(e){var t=e.config,n=e.currency;return Object(Me.jsx)(XR,{config:t,currency:n})},ZR=function(e,t){return[{name:"triggerType",size:"sm",width:230,input:function(e){var t=e.field.value;return Object(Me.jsx)(Me.Fragment,{children:VR(WR,"display")(t)})},view:VR(WR,"display"),inputProps:{options:WR,valueProp:"code",labelProp:"display",optionsLimit:null}},{name:"requirement",size:"sm",width:230,bypassField:!0,input:UR,view:function(e){return Object(Me.jsx)(GR,Object(s.a)({},e))}},{name:"threshold",size:"sm",width:284,textAlign:"right",input:function(){return Object(Me.jsx)(_R,{currency:e})},view:function(t,n){return Object(Me.jsx)(KR,{config:n,currency:e})}}]},YR=B.a(R.a("code"))(WR),QR=[DR.a((function(e,t){return YR.indexOf(e.triggerType)<YR.indexOf(t.triggerType)}))],JR=function(e){return B.a((function(e){var t=e.requirement,n=e.threshold,r=Object($.a)(e,["requirement","threshold"]);return Object(s.a)({requirement:t.requirement,suspensionDays:t.suspensionDays,threshold:n.threshold,thresholdDays:n.thresholdDays},r)}))(e)},eA={stepper:{margin:[[16,0,14,0]]},submit:{display:"flex",flexDirection:"row",margin:[["auto",0,24]]},button:{marginLeft:"auto"},form:{height:"100%",display:"flex",flexDirection:"column"},infoTitle:{margin:[[18,0,20,0]]},infoCurrentText:{color:q},blankSpace:{padding:[[0,30]],margin:[[0,4,0,2]],borderBottom:"1px solid ".concat(q),display:"inline-block"}},tA=Object(j.a)(eA),nA=function(e,t){switch(e){case 1:return function(e){return{schema:MR,options:WR,Component:zR,props:{currency:e},initialValues:{triggerType:"",threshold:{threshold:"",thresholdDays:""}}}}(t);case 2:return HR;default:return r.Fragment}},rA=function(e,t,n,r){switch(e){case 1:return Object(Me.jsxs)(Me.Fragment,{children:["If the user ",iA(t,n,r)]});case 2:return Object(Me.jsxs)(Me.Fragment,{children:["the user will be ",oA(t,r),"."]});default:return Object(Me.jsx)(Me.Fragment,{})}},aA=function(e,t){var n=Object(Me.jsx)("span",{className:t.blankSpace});return Wr.a(e)||P.a(e)?n:e},iA=function(e,t,n){switch(e.triggerType){case"txAmount":return Object(Me.jsxs)(Me.Fragment,{children:["makes a single transaction over"," ",aA(e.threshold.threshold,n)," ",t]});case"txVolume":return Object(Me.jsxs)(Me.Fragment,{children:["makes more than ",aA(e.threshold.threshold,n)," ",t," worth of transactions within"," ",aA(e.threshold.thresholdDays,n)," ",Gu(e.threshold.thresholdDays,"day","days")]});case"txVelocity":return Object(Me.jsxs)(Me.Fragment,{children:["makes more than ",aA(e.threshold.threshold,n)," ",Gu(e.threshold.threshold,"transaction","transactions")," ","in ",aA(e.threshold.thresholdDays,n)," ",Gu(e.threshold.thresholdDays,"day","days")]});case"consecutiveDays":return Object(Me.jsxs)(Me.Fragment,{children:["at least one transaction every day for"," ",aA(e.threshold.thresholdDays,n)," ",Gu(e.threshold.thresholdDays,"day","days")]});default:return Object(Me.jsx)(Me.Fragment,{})}},oA=function(e,t){var n;switch(null===(n=e.requirement)||void 0===n?void 0:n.requirement){case"sms":return Object(Me.jsx)(Me.Fragment,{children:"asked to enter code provided through SMS verification"});case"idCardPhoto":return Object(Me.jsx)(Me.Fragment,{children:"asked to scan a ID with photo"});case"idCardData":return Object(Me.jsx)(Me.Fragment,{children:"asked to scan a ID"});case"facephoto":return Object(Me.jsx)(Me.Fragment,{children:"asked to have a photo taken"});case"usSsn":return Object(Me.jsx)(Me.Fragment,{children:"asked to input his social security number"});case"sanctions":return Object(Me.jsx)(Me.Fragment,{children:"matched against the OFAC sanctions list"});case"superuser":return Object(Me.jsx)(Me.Fragment,{});case"suspend":return Object(Me.jsxs)(Me.Fragment,{children:["suspended for"," ",aA(e.requirement.suspensionDays,t)," ",Gu(e.requirement.suspensionDays,"day","days")]});case"block":return Object(Me.jsx)(Me.Fragment,{children:"blocked"});default:return aA(null,t)}},cA=function(e){var t=e.step,n=e.config,r=void 0===n?{}:n,a=e.liveValues,i=void 0===a?{}:a,o=e.currency,c=tA(),l=TO.a(1,t).map((function(e){return rA(e,r,o,c)})),s=rA(t,i,o,c),d=2===t;return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Ge,{className:c.infoTitle,children:"Trigger overview so far"}),Object(Me.jsxs)(Ze,{noMargin:!0,className:c.infoText,children:[l,1!==t&&", ",s,!d&&"..."]})]})},lA=function(e){var t=e.setValues,n=Object(pn.e)().values;return Object(r.useEffect)((function(){t&&n&&t(n)}),[t,n]),null},sA=function(e){var t=e.onClose,n=e.save,a=e.error,i=e.currency,o=tA(),l=Object(r.useState)({}),d=Object(c.a)(l,2),u=d[0],m=d[1],h=Object(r.useState)({step:1}),b=Object(c.a)(h,2),p=b[0],j=p.step,f=p.config,g=b[1],O=2===j,x=nA(j,i),v=function(){var e=Object(pc.a)(bc.a.mark((function e(t){var r;return bc.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=Gn.a(f,x.schema.cast(t)),!O){e.next=3;break}return e.abrupt("return",n(r));case 3:g({step:j+1,config:r});case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),y=function(e,t,n){var r,a,i,o,c,l,s,d,u,m,h=null===n||void 0===n?void 0:n.triggerType,b=_o.a(h),p="suspend"===(null===n||void 0===n||null===(r=n.requirement)||void 0===r?void 0:r.requirement),j=!!e.requirement&&!!(null===(a=t.requirement)||void 0===a?void 0:a.suspensionDays)&&(!(null===(i=n.requirement)||void 0===i?void 0:i.suspensionDays)||(null===(o=n.requirement)||void 0===o?void 0:o.suspensionDays)<0),f=!!e.threshold&&!!(null===(c=t.threshold)||void 0===c?void 0:c.threshold)&&!b(["consecutiveDays"])&&(!(null===(l=n.threshold)||void 0===l?void 0:l.threshold)||(null===(s=n.threshold)||void 0===s?void 0:s.threshold)<0),g=!!e.threshold&&!!(null===(d=t.threshold)||void 0===d?void 0:d.thresholdDays)&&!b(["txAmount"])&&(!(null===(u=n.threshold)||void 0===u?void 0:u.thresholdDays)||(null===(m=n.threshold)||void 0===m?void 0:m.thresholdDays)<0);return b(["txAmount","txVolume","txVelocity"])&&f||b(["txVolume","txVelocity","consecutiveDays"])&&g?e.threshold:p&&j?e.requirement:void 0};return Object(Me.jsx)(Me.Fragment,{children:Object(Me.jsxs)(AO,{title:"New compliance trigger",handleClose:t,width:520,height:520,infoPanel:Object(Me.jsx)(cA,{currency:i,step:j,config:f,liveValues:u}),infoPanelHeight:172,open:!0,children:[Object(Me.jsx)(GO,{className:o.stepper,steps:2,currentStep:j}),Object(Me.jsx)(pn.d,{validateOnBlur:!1,validateOnChange:!0,enableReinitialize:!0,onSubmit:v,initialValues:x.initialValues,validationSchema:x.schema,children:function(e){var t=e.errors,n=e.touched,r=e.values;return Object(Me.jsxs)(pn.c,{className:o.form,children:[Object(Me.jsx)(lA,{setValues:m}),Object(Me.jsx)(x.Component,Object(s.a)({},x.props)),Object(Me.jsxs)("div",{className:o.submit,children:[a&&Object(Me.jsx)(Ao,{children:"Failed to save"}),y(t,n,r)&&Object(Me.jsx)(Ao,{children:y(t,n,r)}),Object(Me.jsx)(Tn,{className:o.button,type:"submit",children:O?"Finish":"Next"})]})]})}})]})})},dA=[{display:"Sanctions",code:"sanctions"},{display:"ID card image",code:"idCardPhoto"},{display:"ID data",code:"idCardData"},{display:"Customer camera",code:"facephoto"},{display:"US SSN",code:"usSsn"}],uA=xn.e().shape({expirationTime:xn.g().label("Expiration time").required(),automation:xn.g().label("Automation").matches(/(Manual|Automatic)/).required()}),mA=[{expirationTime:"Forever",automation:"Automatic"}],hA={requirement:"",expirationTime:"Forever",automation:"Automatic"},bA=x()(oR||(oR=Object(l.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),pA=x()(cR||(cR=Object(l.a)(["\n query getData {\n config\n }\n"]))),jA=Object(r.memo)((function(){var e,t,n=Tl,a=Object(r.useState)(null),i=Object(c.a)(a,2),o=i[0],l=i[1],s=Object(r.useState)(!1),d=Object(c.a)(s,2),m=d[0],h=d[1],b=Object(r.useState)(!1),p=Object(c.a)(b,2),j=p[0],f=p[1],g=Object(u.c)(pA).data,O=Object(u.b)(bA,{refetchQueries:function(){return["getData"]},onError:function(e){return l(e)}}),x=Object(c.a)(O,1)[0],v=(null===g||void 0===g?void 0:g.config)&&$l(n)(null===g||void 0===g?void 0:g.config),y=v&&!Wr.a(v)?v:mA,w=null!==(e=null===v||void 0===v?void 0:v.overrides)&&void 0!==e?e:[];return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Qf,{children:Object(Me.jsx)(Xm,{title:"Default requirement settings",error:null===o||void 0===o?void 0:o.message,titleLg:!0,name:"triggersConfig",enableEdit:!0,initialValues:y,save:function(e){var t=ql(n)(e.triggersConfig[0]);return l(null),x({variables:{config:t}})},validationSchema:uA,data:Ry.a(y),elements:[{name:"expirationTime",header:"Expiration Time",width:196,size:"sm",editable:!1},{name:"automation",header:"Automation",width:196,size:"sm",input:ka,inputProps:{options:[{code:"Automatic",display:"Automatic"},{code:"Manual",display:"Manual"}],labelProp:"display",valueProp:"code"}}],setEditing:function(e,t){return h(t)},forceDisable:j})}),Object(Me.jsx)(Qf,{children:Object(Me.jsx)(Xm,{error:null===o||void 0===o?void 0:o.message,title:"Overrides",titleLg:!0,name:"overrides",enableDelete:!0,enableEdit:!0,enableCreate:!0,initialValues:hA,save:function(e){var t=ql(n)(e);return l(null),x({variables:{config:t}})},validationSchema:(t=w,xn.e().shape({id:xn.g().label("Requirement").required().test({test:function(){var e,n=this.parent.requirement;return!Tr.a(W.a("requirement",n))(t)||this.createError({message:"Requirement ".concat((e=n,R.a("display",Tr.a(W.a("code",e))(dA)))," already overriden")})}}),expirationTime:xn.g().label("Expiration time").required(),automation:xn.g().label("Automation").matches(/(Manual|Automatic)/).required()})),data:w,elements:[{name:"requirement",header:"Requirement",width:196,size:"sm",view:VR(dA,"display"),input:ka,inputProps:{options:dA,labelProp:"display",valueProp:"code"}},{name:"expirationTime",header:"Expiration Time",width:196,size:"sm",editable:!1},{name:"automation",header:"Automation",width:196,size:"sm",input:ka,inputProps:{options:[{code:"Automatic",display:"Automatic"},{code:"Manual",display:"Manual"}],labelProp:"display",valueProp:"code"}}],setEditing:function(e,t){return f(t)},forceDisable:m})})]})})),fA=Object(j.a)({switchLabel:{margin:6,width:24},tableRadioGroup:{flexDirection:"row",justifyContent:"space-between"},tableRadioLabel:{marginRight:0},tableWidth:{width:918}}),gA=x()(lR||(lR=Object(l.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),OA=x()(sR||(sR=Object(l.a)(["\n query getData {\n config\n }\n"]))),xA=function(){var e,t,n,a=fA(),i=Object(r.useState)(!1),o=Object(c.a)(i,2),l=o[0],d=o[1],m=Object(r.useState)(!1),h=Object(c.a)(m,2),b=h[0],p=h[1],j=Object(u.c)(OA),f=j.data,g=j.loading,O=function(e){return B.a((function(e){var t=e.requirement,n=e.suspensionDays,r=e.threshold,a=e.thresholdDays,i=Object($.a)(e,["requirement","suspensionDays","threshold","thresholdDays"]);return Object(s.a)({requirement:{requirement:t,suspensionDays:n},threshold:{threshold:r,thresholdDays:a}},i)}))(e)}(null!==(e=null===f||void 0===f||null===(t=f.config)||void 0===t?void 0:t.triggers)&&void 0!==e?e:[]),x=(null===f||void 0===f?void 0:f.config)&&$l("compliance")(f.config),v=null!==(n=null===x||void 0===x?void 0:x.rejectAddressReuse)&&void 0!==n&&n,y=Object(r.useState)(null),w=Object(c.a)(y,2),C=w[0],k=w[1],S=Object(u.b)(gA,{onCompleted:function(){return d(!1)},refetchQueries:function(){return["getData"]},onError:function(e){return k(e)}}),N=Object(c.a)(S,1)[0],I=T.a(["fiatCurrency"])($l(Dl)(null===f||void 0===f?void 0:f.config));return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Wo,{title:"Compliance Triggers",button:{text:"Advanced settings",icon:LR,inverseIcon:eR,toggle:p},className:a.tableWidth,children:!b&&Object(Me.jsx)(Po.a,{display:"flex",alignItems:"center",children:Object(Me.jsxs)(Po.a,{display:"flex",alignItems:"center",justifyContent:"flex-end",mr:"-5px",children:[Object(Me.jsx)(Xe,{children:"Reject reused addresses"}),Object(Me.jsx)(Ca,{checked:v,onChange:function(e){!function(e){var t=ql("compliance")(e);N({variables:{config:t}})}({rejectAddressReuse:e.target.checked})},value:v}),Object(Me.jsx)(tt,{className:a.switchLabel,children:v?"On":"Off"}),Object(Me.jsx)(ep,{width:304,children:Object(Me.jsx)(Xe,{children:"This option requires a user to scan a different cryptocurrency address if they attempt to scan one that had been previously used for a transaction in your network"})})]})})}),!b&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Po.a,{marginBottom:2,className:a.tableWidth,display:"flex",justifyContent:"flex-end",children:!g&&!Wr.a(O)&&Object(Me.jsx)(or,{color:"primary",onClick:function(){return d(!0)},children:"+ Add new trigger"})}),Object(Me.jsx)(Xm,{data:O,name:"triggers",enableEdit:!0,sortBy:QR,groupBy:"triggerType",enableDelete:!0,error:null===C||void 0===C?void 0:C.message,save:function(e){return k(null),N({variables:{config:{triggers:JR(e.triggers)}}})},validationSchema:TR,elements:ZR(I)}),l&&Object(Me.jsx)(sA,{currency:I,error:null===C||void 0===C?void 0:C.message,save:function(e){var t=Vo.a([Object(s.a)({id:Object(gu.a)(),direction:"both"},e)])(O);return N({variables:{config:{triggers:JR(t)}}})},onClose:function(){return d(null)}}),!g&&Wr.a(O)&&Object(Me.jsxs)(Po.a,{display:"flex",alignItems:"center",flexDirection:"column",mt:15,children:[Object(Me.jsx)(He,{children:"It seems there are no active compliance triggers on your network"}),Object(Me.jsx)(Tn,{onClick:function(){return d(!0)},children:"Add first trigger"})]})]}),b&&Object(Me.jsx)(jA,{error:C,save:N,data:f})]})},vA={footer:{display:"flex",flexDirection:"row",margin:[["auto",0,24,0]]},modalTitle:{marginTop:-5,color:J,fontFamily:pe},modalLabel1:{marginTop:20},modalLabel2:{marginTop:40},inputLabel:{color:J,fontFamily:pe,fontSize:24,marginLeft:8,marginTop:15},tableWidth:{width:1132},radioGroup:{flexDirection:"row",width:500},radioLabel:{width:150,height:48},copyToClipboard:{marginLeft:"auto",paddingTop:7,marginRight:-5},chip:{backgroundColor:ae,fontFamily:pe,marginLeft:10},actionChip:{backgroundColor:ae,marginRight:15},info:{fontFamily:je,textAlign:"justify"},addressWrapper:{backgroundColor:ae,marginTop:8,height:35},address:{margin:"0px ".concat(16,"px 0px ").concat(16,"px"),paddingRight:-15},errorMessage:{fontFamily:je,color:me},codeContainer:{marginTop:15,marginBottom:15},form:{display:"flex",flexDirection:"column",height:"100%"},submit:{margin:[["auto",0,0,"auto"]]},error:{color:me},link:{position:"absolute",top:10,left:0,bottom:"-20px",right:"-20px",whiteSpace:"nowrap",overflowX:"auto",width:"92.5%"},linkWrapper:{width:"100%",height:"100%",overflow:"hidden",position:"relative"},loginWrapper:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},username:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",width:"100%"},roleSwitch:{marginLeft:15}},yA=Object(j.a)(vA),wA=x()(dR||(dR=Object(l.a)(["\n query confirm2FA($code: String!) {\n confirm2FA(code: $code)\n }\n"]))),CA=function(e){var t=e.showModal,n=e.handleClose,a=e.setConfirmation,i=yA(),o=Object(r.useState)(""),l=Object(c.a)(o,2),s=l[0],d=l[1],m=Object(r.useState)(!1),h=Object(c.a)(m,2),b=h[0],p=h[1],j=Object(u.a)(wA,{onCompleted:function(e){return e.confirm2FA?(a(s),d(""),void p(!1)):p(!0)}}),f=Object(c.a)(j,2),g=f[0],O=f[1].error,x=function(){return O?"Internal server error":6!==s.length&&b?"The code should have 6 characters!":b?"Code is invalid. Please try again.":null};return t&&Object(Me.jsxs)(AO,{closeOnBackdropClick:!0,width:500,height:350,handleClose:n,open:!0,children:[Object(Me.jsx)(Ke,{className:i.modalTitle,children:"Confirm action"}),Object(Me.jsx)(Xe,{className:i.info,children:"To make changes on this user, please confirm this action by entering your two-factor authentication code below."}),Object(Me.jsx)(ha,{name:"2fa",value:s,onChange:function(e){d(e),p(!1)},numInputs:6,error:b,containerStyle:i.codeContainer,shouldAutoFocus:!0}),x()&&Object(Me.jsx)(Xe,{className:i.errorMessage,children:x()}),Object(Me.jsx)("div",{className:i.footer,children:Object(Me.jsx)(Tn,{className:i.submit,onClick:function(){6===s.length?g({variables:{code:s}}):p(!0)},children:"Confirm"})})]})},kA=x()(uR||(uR=Object(l.a)(["\n mutation changeUserRole(\n $confirmationCode: String\n $id: ID!\n $newRole: String!\n ) {\n changeUserRole(\n confirmationCode: $confirmationCode\n id: $id\n newRole: $newRole\n ) {\n id\n }\n }\n"]))),SA=Object(j.a)(vA),NA=function(e){var t=e.state,n=e.dispatch,a=e.user,i=e.requiresConfirmation,o=SA(),l=Object(u.b)(kA,{onCompleted:function(){return f()},refetchQueries:function(){return["users"]}}),s=Object(c.a)(l,2),d=s[0],m=s[1].error,h=Object(r.useState)(null),b=Object(c.a)(h,2),p=b[0],j=b[1],f=function(){j(null),n({type:"close",payload:"showRoleModal"})};return t.showRoleModal&&i&&!p&&Object(Me.jsx)(CA,{showModal:t.showRoleModal,handleClose:f,setConfirmation:j})||t.showRoleModal&&Object(Me.jsxs)(AO,{closeOnBackdropClick:!0,width:450,height:250,handleClose:f,open:!0,children:[Object(Me.jsxs)(Ke,{className:o.modalTitle,children:["Change ",a.username,"'s role?"]}),Object(Me.jsxs)(Xe,{className:o.info,children:["You are about to alter ",a.username,"'s role. This will change this user's permission to access certain resources."]}),Object(Me.jsx)(Xe,{className:o.info,children:"Do you wish to proceed?"}),Object(Me.jsxs)("div",{className:o.footer,children:[m&&Object(Me.jsx)(Ao,{children:m}),Object(Me.jsx)(Tn,{className:o.submit,onClick:function(){d({variables:{confirmationCode:p,id:a.id,newRole:"superuser"===a.role?"user":"superuser"}})},children:"Confirm"})]})]})},IA="https://".concat(window.location.hostname),EA=function(e){return"".concat(IA).concat(e)},FA=Object(j.a)(vA),LA=x()(mR||(mR=Object(l.a)(["\n mutation createRegisterToken($username: String!, $role: String!) {\n createRegisterToken(username: $username, role: $role) {\n token\n expire\n }\n }\n"]))),DA=xn.e().shape({username:xn.g().email("Username field should be in an email format!").required("Username field is required!"),role:xn.g().required("Role field is required!")}),PA={username:"",role:""},BA=[{code:"user",display:"Regular user"},{code:"superuser",display:"Superuser"}],RA=function(e,t,n){return e&&t?n?"Internal server error":e.username&&t.username?e.username:null:null},AA=function(e){var t=e.state,n=e.dispatch,a=FA(),i=Object(r.useState)(""),o=Object(c.a)(i,2),l=o[0],s=o[1],d=Object(r.useState)(null),m=Object(c.a)(d,2),h=m[0],b=m[1],p=function(){b(null),n({type:"close",payload:"showCreateUserModal"})},j=Object(u.b)(LA,{onCompleted:function(e){var t=e.createRegisterToken,n="t=".concat(t.token);b(EA("/register?".concat(n)))}}),f=Object(c.a)(j,2),g=f[0],O=f[1].error;return Object(Me.jsxs)(Me.Fragment,{children:[t.showCreateUserModal&&!h&&Object(Me.jsx)(AO,{closeOnBackdropClick:!0,width:600,height:400,handleClose:p,open:!0,children:Object(Me.jsx)(pn.d,{validationSchema:DA,initialValues:PA,onSubmit:function(e){s(e.username),g({variables:{username:e.username,role:e.role}})},children:function(e){var t,n,r=e.errors,i=e.touched;return Object(Me.jsxs)(pn.c,{id:"register-user-form",className:a.form,children:[Object(Me.jsx)(qe,{className:a.modalTitle,children:"Create new user"}),Object(Me.jsx)(pn.b,{component:Ua,name:"username",width:338,autoFocus:!0,label:"User login"}),Object(Me.jsx)(Ve,{className:E()((t=r,n=i,Object(z.a)({},a.error,t.role&&n.role)),a.modalLabel2),children:"Role"}),Object(Me.jsx)(pn.b,{component:Ha,name:"role",labelClassName:a.radioLabel,className:a.radioGroup,options:BA}),Object(Me.jsxs)("div",{className:a.footer,children:[RA(r,i,O)&&Object(Me.jsx)(Ao,{children:RA(r,i,O)}),Object(Me.jsx)(Tn,{type:"submit",form:"register-user-form",className:a.submit,children:"Finish"})]})]})}})}),t.showCreateUserModal&&h&&Object(Me.jsxs)(AO,{closeOnBackdropClick:!0,width:500,height:200,handleClose:p,open:!0,children:[Object(Me.jsxs)(Ke,{className:a.modalTitle,children:["Creating ",l,"..."]}),Object(Me.jsxs)(Xe,{className:a.info,children:["Safely share this link with ",l," to finish the registration process."]}),Object(Me.jsx)("div",{className:a.addressWrapper,children:Object(Me.jsx)(Ye,{className:a.address,children:Object(Me.jsx)("strong",{children:Object(Me.jsx)(Pb,{className:a.link,buttonClassname:a.copyToClipboard,wrapperClassname:a.linkWrapper,children:h})})})})]})]})},TA=x()(hR||(hR=Object(l.a)(["\n mutation enableUser($confirmationCode: String, $id: ID!) {\n enableUser(confirmationCode: $confirmationCode, id: $id) {\n id\n }\n }\n"]))),MA=x()(bR||(bR=Object(l.a)(["\n mutation disableUser($confirmationCode: String, $id: ID!) {\n disableUser(confirmationCode: $confirmationCode, id: $id) {\n id\n }\n }\n"]))),WA=Object(j.a)(vA),zA=function(e){var t=e.state,n=e.dispatch,a=e.user,i=e.requiresConfirmation,o=WA(),l=Object(u.b)(TA,{onCompleted:function(){return y()},refetchQueries:function(){return["users"]}}),s=Object(c.a)(l,2),d=s[0],m=s[1].error,h=Object(u.b)(MA,{onCompleted:function(){return y()},refetchQueries:function(){return["users"]}}),b=Object(c.a)(h,2),p=b[0],j=b[1].error,f=Object(r.useState)(null),g=Object(c.a)(f,2),O=g[0],x=g[1],v=function(){(null===a||void 0===a?void 0:a.enabled)?p({variables:{confirmationCode:O,id:a.id}}):d({variables:{confirmationCode:O,id:a.id}})},y=function(){x(null),n({type:"close",payload:"showEnableUserModal"})};return t.showEnableUserModal&&i&&!O&&Object(Me.jsx)(CA,{showModal:t.showEnableUserModal,handleClose:y,setConfirmation:x})||t.showEnableUserModal&&Object(Me.jsxs)(AO,{closeOnBackdropClick:!0,width:450,height:275,handleClose:y,open:!0,children:[!a.enabled&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)(Ke,{className:o.modalTitle,children:["Enable ",a.username,"?"]}),Object(Me.jsxs)(Xe,{className:o.info,children:["You are about to enable ",a.username," into the system, activating previous eligible sessions and grant permissions to access the system."]}),Object(Me.jsx)(Xe,{className:o.info,children:"Do you wish to proceed?"})]}),a.enabled&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)(Ke,{className:o.modalTitle,children:["Disable ",a.username,"?"]}),Object(Me.jsxs)(Xe,{className:o.info,children:["You are about to disable ",a.username," from the system, deactivating previous eligible sessions and removing permissions to access the system."]}),Object(Me.jsx)(Xe,{className:o.info,children:"Do you wish to proceed?"})]}),Object(Me.jsxs)("div",{className:o.footer,children:[j&&Object(Me.jsx)(Ao,{children:j}),m&&Object(Me.jsx)(Ao,{children:m}),Object(Me.jsx)(Tn,{className:o.submit,onClick:function(){return v()},children:"Confirm"})]})]})},$A=x()(pR||(pR=Object(l.a)(["\n mutation createReset2FAToken($confirmationCode: String, $userID: ID!) {\n createReset2FAToken(confirmationCode: $confirmationCode, userID: $userID) {\n token\n user_id\n expire\n }\n }\n"]))),qA=Object(j.a)(vA),HA=function(e){var t=e.state,n=e.dispatch,a=e.user,i=e.requiresConfirmation,o=qA(),l=Object(r.useState)(""),s=Object(c.a)(l,2),d=s[0],m=s[1],h=Object(u.b)($A,{onCompleted:function(e){var t=e.createReset2FAToken;m(EA("/reset2fa?t=".concat(t.token)))}}),b=Object(c.a)(h,2),p=b[0],j=b[1],f=j.loading,g=j.error,O=Object(r.useState)(null),x=Object(c.a)(O,2),v=x[0],y=x[1];Object(r.useEffect)((function(){t.showReset2FAModal&&(v||!i)&&p({variables:{confirmationCode:v,userID:null===a||void 0===a?void 0:a.id}})}),[v,p,i,t.showReset2FAModal,null===a||void 0===a?void 0:a.id]);var w=function(){y(null),n({type:"close",payload:"showReset2FAModal"})};return t.showReset2FAModal&&i&&!v&&Object(Me.jsx)(CA,{showModal:t.showReset2FAModal,handleClose:w,setConfirmation:y})||t.showReset2FAModal&&(v||!i)&&!f&&Object(Me.jsxs)(AO,{closeOnBackdropClick:!0,width:500,height:200,handleClose:w,open:!0,children:[Object(Me.jsxs)(Ke,{className:o.modalTitle,children:["Reset 2FA for ",a.username]}),Object(Me.jsxs)(Xe,{className:o.info,children:["Safely share this link with ",a.username," for a two-factor authentication reset."]}),!g&&Object(Me.jsx)("div",{className:o.addressWrapper,children:Object(Me.jsx)(Ye,{className:o.address,children:Object(Me.jsx)("strong",{children:Object(Me.jsx)(Pb,{className:o.link,buttonClassname:o.copyToClipboard,wrapperClassname:o.linkWrapper,children:d})})})}),g&&Object(Me.jsx)(Ao,{children:g})]})},VA=x()(jR||(jR=Object(l.a)(["\n mutation createResetPasswordToken($confirmationCode: String, $userID: ID!) {\n createResetPasswordToken(\n confirmationCode: $confirmationCode\n userID: $userID\n ) {\n token\n user_id\n expire\n }\n }\n"]))),UA=Object(j.a)(vA),GA=function(e){var t=e.state,n=e.dispatch,a=e.user,i=e.requiresConfirmation,o=UA(),l=Object(r.useState)(""),s=Object(c.a)(l,2),d=s[0],m=s[1],h=Object(u.b)(VA,{onCompleted:function(e){var t=e.createResetPasswordToken;m(EA("/resetpassword?t=".concat(t.token)))}}),b=Object(c.a)(h,2),p=b[0],j=b[1],f=j.loading,g=j.error,O=Object(r.useState)(null),x=Object(c.a)(O,2),v=x[0],y=x[1];Object(r.useEffect)((function(){t.showResetPasswordModal&&(v||!i)&&p({variables:{confirmationCode:v,userID:null===a||void 0===a?void 0:a.id}})}),[v,p,i,t.showResetPasswordModal,null===a||void 0===a?void 0:a.id]);var w=function(){y(null),n({type:"close",payload:"showResetPasswordModal"})};return t.showResetPasswordModal&&i&&!v&&Object(Me.jsx)(CA,{showModal:t.showResetPasswordModal,handleClose:w,setConfirmation:y})||t.showResetPasswordModal&&(v||!i)&&!f&&Object(Me.jsxs)(AO,{closeOnBackdropClick:!0,width:500,height:180,handleClose:w,open:!0,children:[Object(Me.jsxs)(Ke,{className:o.modalTitle,children:["Reset password for ",a.username]}),Object(Me.jsxs)(Xe,{className:o.info,children:["Safely share this link with ",a.username," for a password reset."]}),!g&&Object(Me.jsx)("div",{className:o.addressWrapper,children:Object(Me.jsx)(Ye,{className:o.address,children:Object(Me.jsx)("strong",{children:Object(Me.jsx)(Pb,{className:o.link,buttonClassname:o.copyToClipboard,wrapperClassname:o.linkWrapper,children:d})})})}),g&&Object(Me.jsx)(Ao,{children:g})]})},XA=Object(j.a)(vA),_A=x()(fR||(fR=Object(l.a)(["\n query users {\n users {\n id\n username\n role\n enabled\n last_accessed\n last_accessed_from\n last_accessed_address\n }\n }\n"]))),KA=x()(gR||(gR=Object(l.a)(["\n query generateAttestationOptions($userID: ID!) {\n generateAttestationOptions(userID: $userID)\n }\n"]))),ZA=x()(OR||(OR=Object(l.a)(["\n mutation validateAttestation(\n $userID: ID!\n $attestationResponse: JSONObject!\n ) {\n validateAttestation(\n userID: $userID\n attestationResponse: $attestationResponse\n )\n }\n"]))),YA={showCreateUserModal:!1,showResetPasswordModal:!1,showReset2FAModal:!1,showRoleModal:!1,showEnableUserModal:!1},QA=function(e,t){var n=t.type,r=t.payload;switch(n){case"close":return YA;case"open":return Object(s.a)(Object(s.a)({},YA),{},Object(z.a)({},r,!0));default:return YA}},JA={user:"Regular",superuser:"Superuser"},eT=function(){var e=XA(),t=Object(r.useContext)(k).userData,n=Object(u.c)(_A).data,a=Object(r.useReducer)(QA,YA),i=Object(c.a)(a,2),o=i[0],l=i[1],s=Object(r.useState)(null),d=Object(c.a)(s,2),m=d[0],h=d[1],b=Object(u.b)(ZA,{onCompleted:function(e){}}),p=Object(c.a)(b,1)[0],j=Object(u.a)(KA,{onCompleted:function(e){var t=e.generateAttestationOptions;Object(cc.b)(t).then((function(e){p({variables:{userID:m.id,attestationResponse:e}})}))}}),f=Object(c.a)(j,1)[0],g=[{header:"Login",width:307,textAlign:"left",size:"sm",view:function(n){return t.id===n.id?Object(Me.jsxs)("div",{className:e.loginWrapper,children:[Object(Me.jsx)("span",{className:e.username,children:n.username}),Object(Me.jsx)(Sa.a,{size:"small",label:"You",className:e.chip})]}):Object(Me.jsx)("span",{className:e.username,children:n.username})}},{header:"Role",width:160,textAlign:"left",size:"sm",view:function(n){return Object(Me.jsxs)("div",{className:e.loginWrapper,children:[Object(Me.jsx)("span",{children:JA[n.role]}),Object(Me.jsx)(Ca,{className:e.roleSwitch,disabled:t.id===n.id,checked:"superuser"===n.role,onClick:function(){h(n),l({type:"open",payload:"showRoleModal"})},value:"superuser"===n.role})]})}},{header:"Actions",width:565,textAlign:"left",size:"sm",view:function(t){return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Sa.a,{size:"small",label:"Reset password",className:e.actionChip,onClick:function(){h(t),l({type:"open",payload:"showResetPasswordModal"})}}),Object(Me.jsx)(Sa.a,{size:"small",label:"Reset 2FA",className:e.actionChip,onClick:function(){h(t),l({type:"open",payload:"showReset2FAModal"})}}),Object(Me.jsx)(Sa.a,{size:"small",label:"Add FIDO",className:e.actionChip,onClick:function(){h(t),f({variables:{userID:t.id}})}})]})}},{header:"Enabled",width:100,textAlign:"center",size:"sm",view:function(e){return Object(Me.jsx)(Ca,{disabled:t.id===e.id,checked:e.enabled,onClick:function(){h(e),l({type:"open",payload:"showEnableUserModal"})},value:e.enabled})}}];return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Wo,{title:"User Management"}),Object(Me.jsx)(Po.a,{marginBottom:3,marginTop:-5,className:e.tableWidth,display:"flex",justifyContent:"flex-end",children:Object(Me.jsx)(or,{color:"primary",onClick:function(){l({type:"open",payload:"showCreateUserModal"})},children:"Add new user"})}),Object(Me.jsx)(Bv,{elements:g,data:T.a(["users"])(n)}),Object(Me.jsx)(AA,{state:o,dispatch:l}),Object(Me.jsx)(GA,{state:o,dispatch:l,user:m,requiresConfirmation:"superuser"===(null===m||void 0===m?void 0:m.role)}),Object(Me.jsx)(HA,{state:o,dispatch:l,user:m,requiresConfirmation:"superuser"===(null===m||void 0===m?void 0:m.role)}),Object(Me.jsx)(NA,{state:o,dispatch:l,user:m,requiresConfirmation:"superuser"===(null===m||void 0===m?void 0:m.role)}),Object(Me.jsx)(zA,{state:o,dispatch:l,user:m,requiresConfirmation:"superuser"===(null===m||void 0===m?void 0:m.role)})]})},tT=x()(xR||(xR=Object(l.a)(["\n mutation Save($config: JSONObject, $accounts: JSONObject) {\n saveConfig(config: $config)\n saveAccounts(accounts: $accounts)\n }\n"]))),nT=x()(vR||(vR=Object(l.a)(["\n query getData {\n config\n accounts\n cryptoCurrencies {\n code\n display\n }\n }\n"]))),rT=function(){var e,t=El,n=Object(u.c)(nT).data,r=Object(u.b)(tT,{refetchQueries:function(){return["getData"]}}),a=Object(c.a)(r,2),i=a[0],o=a[1].error,l=(null===n||void 0===n?void 0:n.config)&&$l(t)(n.config),s=null!==(e=null===n||void 0===n?void 0:n.cryptoCurrencies)&&void 0!==e?e:[];return Object(Me.jsx)(_m,{name:"advancedWallet",namespaces:B.a(T.a(["code"]))(s),data:l,error:null===o||void 0===o?void 0:o.message,enableEdit:!0,editWidth:174,save:function(e,n){var r=ql(t)(e);return i({variables:{config:r,accounts:n}})},validationSchema:Gf,elements:Xf(s,Tb.utils)})},aT={header:{display:"flex",alignItems:"center",justifyContent:"space-between"},feeDiscountLabel:{color:se,margin:[[13,0,-5,20]]},selection:{marginRight:12}},iT=x()(yR||(yR=Object(l.a)(["\n mutation Save($config: JSONObject, $accounts: JSONObject) {\n saveConfig(config: $config)\n saveAccounts(accounts: $accounts)\n }\n"]))),oT=x()(wR||(wR=Object(l.a)(["\n mutation Save($accounts: JSONObject) {\n saveAccounts(accounts: $accounts)\n }\n"]))),cT=x()(CR||(CR=Object(l.a)(["\n query getData {\n config\n accounts\n accountsConfig {\n code\n display\n class\n cryptos\n deprecated\n }\n cryptoCurrencies {\n code\n display\n }\n }\n"]))),lT=Object(j.a)(aT),sT=function(e){var t,n,a,i=e.name,o=lT(),l=Object(r.useState)(null),s=Object(c.a)(l,2),d=s[0],m=s[1],h=Object(r.useState)(null),b=Object(c.a)(h,2),p=b[0],j=b[1],f=Object(r.useState)(null),g=Object(c.a)(f,2),O=g[0],x=g[1],v=Object(r.useState)(null),y=Object(c.a)(v,2),w=y[0],C=y[1],k=Object(r.useState)(!1),S=Object(c.a)(k,2),N=S[0],I=S[1],E=Object(r.useState)(!1),F=Object(c.a)(E,2),L=F[0],D=F[1],P=Object(u.c)(cT).data,R=Object(u.b)(iT,{onCompleted:function(){return I(!1)},refetchQueries:function(){return["getData"]}}),A=Object(c.a)(R,2),M=A[0],$=A[1].error,q=Object(u.b)(oT,{onCompleted:function(){return x(null)},refetchQueries:function(){return["getData"]}}),H=Object(c.a)(q,1)[0],V=function(e,t){var n=ql(i)(e);return M({variables:{config:n,accounts:t}})},U=(null===P||void 0===P?void 0:P.config)&&$l("locale")(P.config).fiatCurrency,G=(null===P||void 0===P?void 0:P.config)&&$l(i)(P.config),X=null===P||void 0===P?void 0:P.accountsConfig,_=null!==(t=null===P||void 0===P?void 0:P.cryptoCurrencies)&&void 0!==t?t:[],K=null!==(n=null===P||void 0===P?void 0:P.accounts)&&void 0!==n?n:[];return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)("div",{className:o.header,children:[Object(Me.jsx)(Wo,{title:"Wallet Settings",button:{text:"Advanced settings",icon:LR,inverseIcon:eR,toggle:D}}),Object(Me.jsxs)(Po.a,{alignItems:"center",justifyContent:"end",children:[Object(Me.jsx)(et,{className:o.feeDiscountLabel,children:"Fee discount"}),Object(Me.jsxs)(Po.a,{display:"flex",alignItems:"center",justifyContent:"end",mr:"-4px",children:[Object(Me.jsx)(Xe,{className:o.selection,children:p}),Object(Me.jsx)(tr,{onClick:function(){return m(!0)},children:Object(Me.jsx)(Mm,{})})]})]})]}),!L&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(_m,{name:"test",namespaces:B.a(T.a(["code"]))(_),data:G,error:null===$||void 0===$?void 0:$.message,stripeWhen:function(e){return!Uf.isValidSync(e)},enableEdit:!0,shouldOverrideEdit:function(e){var t=$l(e)(G);return!Uf.isValidSync(t)},editOverride:I,editWidth:174,save:V,validationSchema:Uf,elements:_f(_,X,(function(e,t,n){return t?!K[t]&&Jg[t]?(x(Jg[t]),void C((function(){return function(){return n(t)}}))):void n(t):n(t)}))}),N&&Object(Me.jsx)(cE,{coin:Tr.a(W.a("code",N))(_),onClose:function(){return I(!1)},save:V,error:null===$||void 0===$?void 0:$.message,cryptoCurrencies:_,fiatCurrency:U,userAccounts:null===P||void 0===P||null===(a=P.config)||void 0===a?void 0:a.accounts,accounts:K,accountsConfig:X}),O&&Object(Me.jsx)(AO,{title:"Edit ".concat(O.name),width:478,handleClose:function(){return x(null)},open:!0,children:Object(Me.jsx)(jg,{save:function(e){return H({variables:{accounts:Object(z.a)({},O.code,e)}}).then((function(e){return w(),C(null),e}))},elements:O.elements,validationSchema:O.validationSchema,value:K[O.code]})})]}),L&&Object(Me.jsx)(rT,{}),d&&Object(Me.jsxs)(AO,{title:"Fee discount for BTC",width:478,handleClose:function(){return m(null)},open:!0,children:[Object(Me.jsx)(Xe,{children:"Set a priority level for your outgoing BTC transactions, selecting a percentage off of the fee estimate your wallet uses."}),Object(Me.jsx)(xa,{name:"set-automatic-reset",value:p,options:[{display:"+20%",code:"1.2"},{display:"Default",code:"1"},{display:"-20%",code:"0.8"},{display:"-40%",code:"0.6"},{display:"-60%",code:"0.4"}],onChange:function(e){var t=T.a(["target","value"])(e);j(t)}}),Object(Me.jsx)(Ku.a,{children:Object(Me.jsx)(Tn,{onClick:function(){return function(e){var t=ql(i)(e);return m(!1),M({variables:{config:t}})}({BTC_feeMultiplier:p})},children:"Confirm"})})]})]})},dT=function(){return[{key:"transactions",label:"Transactions",route:"/transactions",allowedRoles:[nx,rx],component:_B},{key:"maintenance",label:"Maintenance",route:"/maintenance",allowedRoles:[nx,rx],get component(){var e=this;return function(){return Object(Me.jsx)(w.b,{to:e.children[0].route})}},children:[{key:"cash_cassettes",label:"Cash Cassettes",route:"/maintenance/cash-cassettes",allowedRoles:[nx,rx],component:AL},{key:"funding",label:"Funding",route:"/maintenance/funding",allowedRoles:[nx,rx],component:QN},{key:"logs",label:"Machine Logs",route:"/maintenance/logs",allowedRoles:[nx,rx],component:MF},{key:"machine-status",label:"Machine Status",route:"/maintenance/machine-status",allowedRoles:[nx,rx],component:sD},{key:"server-logs",label:"Server",route:"/maintenance/server-logs",allowedRoles:[nx,rx],component:CB}]},{key:"analytics",label:"Analytics",route:"/analytics",allowedRoles:[nx,rx],component:Jx},{key:"settings",label:"Settings",route:"/settings",allowedRoles:[nx,rx],get component(){var e=this;return function(){return Object(Me.jsx)(w.b,{to:e.children[0].route})}},children:[{key:Pl,label:"Commissions",route:"/settings/commissions",allowedRoles:[nx,rx],component:_y},{key:Dl,label:"Locales",route:"/settings/locale",allowedRoles:[nx,rx],component:mE},{key:Il,label:"Cash-out",route:"/settings/cash-out",allowedRoles:[nx,rx],component:my},{key:Ll,label:"Notifications",route:"/settings/notifications",allowedRoles:[nx,rx],component:VD},{key:"services",label:"3rd party services",route:"/settings/3rd-party-services",allowedRoles:[nx,rx],component:BB},{key:El,label:"Wallet",route:"/settings/wallet-settings",allowedRoles:[nx,rx],component:sT},{key:Fl,label:"Operator Info",route:"/settings/operator-info",title:"Operator Information",allowedRoles:[nx,rx],get component(){var e=this;return function(){var t;return Object(Me.jsx)(w.b,{to:{pathname:e.children[0].route,state:{prev:null===(t=e.state)||void 0===t?void 0:t.prev}}})}},children:[{key:"contact-info",label:"Contact information",route:"/settings/operator-info/contact-info",allowedRoles:[nx,rx],component:qP},{key:"receipt-printing",label:"Receipt",route:"/settings/operator-info/receipt-printing",allowedRoles:[nx,rx],component:aB},{key:"custom-sms",label:"Custom SMS",route:"/settings/operator-info/custom-sms",allowedRoles:[nx,rx],component:eB},{key:"coin-atm-radar",label:"Coin ATM Radar",route:"/settings/operator-info/coin-atm-radar",allowedRoles:[nx,rx],component:RP},{key:"terms-conditions",label:"Terms & Conditions",route:"/settings/operator-info/terms-conditions",allowedRoles:[nx,rx],component:dB}]}]},{key:"compliance",label:"Compliance",route:"/compliance",allowedRoles:[nx,rx],get component(){var e=this;return function(){return Object(Me.jsx)(w.b,{to:e.children[0].route})}},children:[{key:"triggers",label:"Triggers",route:"/compliance/triggers",allowedRoles:[nx,rx],component:xA},{key:"customers",label:"Customers",route:"/compliance/customers",allowedRoles:[nx,rx],component:AN},{key:"blacklist",label:"Blacklist",route:"/compliance/blacklist",allowedRoles:[nx,rx],component:Vv},{key:"loyalty",label:"Loyalty",route:"/compliance/loyalty",title:"Loyalty Panel",allowedRoles:[nx,rx],get component(){var e=this;return function(){var t;return Object(Me.jsx)(w.b,{to:{pathname:e.children[0].route,state:{prev:null===(t=e.state)||void 0===t?void 0:t.prev}}})}},children:[{key:"individual-discounts",label:"Individual Discounts",route:"/compliance/loyalty/individual-discounts",allowedRoles:[nx,rx],component:CE},{key:"promo-codes",label:"Promo Codes",route:"/compliance/loyalty/codes",allowedRoles:[nx,rx],component:RE}]},{key:"customer",route:"/compliance/customer/:id",allowedRoles:[nx,rx],component:nN}]},{key:"system",label:"System",route:"/system",allowedRoles:[rx],get component(){var e=this;return function(){return Object(Me.jsx)(w.b,{to:e.children[0].route})}},children:[{key:"user-management",label:"User Management",route:"/system/user-management",allowedRoles:[rx],component:eT},{key:"session-management",label:"Session Management",route:"/system/session-management",allowedRoles:[rx],component:zB}]}]},uT=function(e){e.numberOfChips;return{totalAssetWrapper:{display:"flex",flexDirection:"row"},totalAssetFieldWrapper:{display:"flex",flexDirection:"column"},fieldHeader:{color:se,marginBottom:5},fieldValue:{fontSize:36},fieldCurrency:{fontSize:20,alignSelf:"flex-end",margin:[[0,0,5,5]]},separator:{fontSize:32,alignSelf:"center",margin:[[25,20,0,20]]},walletChipList:{display:"flex",flexDirection:"row",flexWrap:"wrap"},walletChipWrapper:{flexGrow:0,flexShrink:0,flexBasis:"16.66667%","&:nth-child(6n+1)":{"& > div":{margin:[[0,10,0,0]]}},"&:nth-child(6n)":{"& > div":{margin:[[0,0,0,10]]}},margin:[[10,0]]},walletChip:{height:200,margin:[[0,10]]},walletHeader:{display:"flex",flexDirection:"row",justifyContent:"space-between",height:50},logo:{transform:"scale(0.4, 0.4)",height:80,maxWidth:110,margin:[[-14,0,0,-26]]},zecLogo:{margin:[[-15,0,0,-10]]},bchLogo:{margin:[[-12,0,0,-18]]},hedgedText:{color:se,margin:[[13,12,0,0]]},walletValueWrapper:{display:"flex",flexDirection:"column",margin:[[0,0,0,15]]},walletValue:{fontSize:18,margin:[[0,0,10,0]]},walletChipTitle:{marginTop:50}}},mT=(Object(j.a)(uT),x()(kR||(kR=Object(l.a)(["\n query operatorByUsername($username: String) {\n operatorByUsername(username: $username) {\n id\n entityId\n name\n fiatBalances\n cryptoBalances\n machines\n joined\n assetValue\n preferredFiatCurrency\n contactInfo {\n name\n email\n }\n fundings {\n id\n origin\n destination\n fiatAmount\n fiatBalanceAfter\n fiatCurrency\n created\n status\n description\n }\n }\n }\n"]))),function(){return{totalAssetWrapper:{display:"flex",flexDirection:"row"},totalAssetFieldWrapper:{display:"flex",flexDirection:"column"},fieldHeader:{color:se,marginBottom:5},fieldValue:{fontSize:36},fieldCurrency:{fontSize:20,alignSelf:"flex-end",margin:[[0,0,5,5]]},separator:{fontSize:32,alignSelf:"center",margin:[[25,20,0,20]]},tableTitle:{marginTop:35},operation:{display:"flex",flexDirection:"row",alignItems:"center"}}}),hT=(Object(j.a)(mT),x()(SR||(SR=Object(l.a)(["\n query operatorByUsername($username: String) {\n operatorByUsername(username: $username) {\n id\n entityId\n name\n fiatBalances\n cryptoBalances\n machines\n joined\n assetValue\n preferredFiatCurrency\n contactInfo {\n name\n email\n }\n fundings {\n id\n origin\n destination\n fiatAmount\n fiatBalanceAfter\n fiatCurrency\n created\n status\n description\n }\n }\n }\n"]))),x()(NR||(NR=Object(l.a)(["\n query getData {\n config\n }\n"]))),function(){return{card:{wordWrap:"break-word",boxShadow:"0 0 4px 0 rgba(0, 0, 0, 0.08)",borderRadius:12,padding:24,backgroundColor:Z},h4:{marginTop:0},label:{margin:0,color:se},asset:{float:"left"},amount:{float:"right"},row:{backgroundColor:re,borderBottom:"none"},totalRow:{backgroundColor:ae,borderBottom:"none"},leftSide:{margin:[[0,10,20,0]]},rightSide:{margin:[[0,0,0,10]]}}}),bT=(Object(j.a)(hT),x()(IR||(IR=Object(l.a)(["\n query operatorByUsername($username: String) {\n operatorByUsername(username: $username) {\n id\n entityId\n name\n fiatBalances\n cryptoBalances\n machines\n joined\n assetValue\n preferredFiatCurrency\n contactInfo {\n name\n email\n }\n fundings {\n id\n origin\n destination\n fiatAmount\n fiatBalanceAfter\n fiatCurrency\n created\n status\n description\n }\n }\n }\n"]))),{borderBottom:"4px solid white",padding:0,paddingLeft:20,paddingRight:20}),pT=(Object(Na.a)({root:bT})(Ed.a),Object(Na.a)({root:Object(s.a)(Object(s.a)({},bT),{},{backgroundColor:"white"})})(Ed.a),Object(j.a)({wrapper:{flex:1,display:"flex",flexDirection:"column",height:"100%"}})),jT=dT(),fT=B.a($o.a(qo.a("children"),R.a("children"))),gT=L.a(Ho.a,fT)(jT),OT=M.a(qo.a("children"))(gT).concat(M.a(qo.a("children"))(jT)),xT=L.a(Ho.a,fT)(gT),vT=Vo.a(xT,OT),yT=function(){var e=pT(),t=Object(w.h)(),n=Object(w.i)(),a=Object(r.useContext)(k),i=a.wizardTested,o=a.userData;if(!i&&!_o.a(n.pathname)(["/404","/register","/wizard","/login","/register","/resetpassword","/reset2fa"]))return t.push("/wizard"),null;var c=n.state?b.a:zo.a,l=c===b.a?{direction:Ko.a(W.a("route",n.state.prev))(xT)>Ko.a(W.a("route",n.pathname))(xT)?"right":"left"}:{timeout:400};return Object(Me.jsxs)(w.e,{children:[Object(Me.jsx)(ax,{exact:!0,path:"/",children:Object(Me.jsx)(w.b,{to:{pathname:"/dashboard"}})}),Object(Me.jsx)(ax,{path:"/dashboard",children:Object(Me.jsx)(c,Object(s.a)(Object(s.a)({className:e.wrapper},l),{},{in:!0,mountOnEnter:!0,unmountOnExit:!0,children:Object(Me.jsx)("div",{className:e.wrapper,children:Object(Me.jsx)(iu,{})})}))}),Object(Me.jsx)(ax,{path:"/machines",component:Xj}),Object(Me.jsx)(ax,{path:"/wizard",component:ex}),Object(Me.jsx)(ix,{path:"/register",component:Gc}),Object(Me.jsx)(ix,{path:"/login",restricted:!0,component:Ac}),Object(Me.jsx)(ix,{path:"/resetpassword",component:il}),Object(Me.jsx)(ix,{path:"/reset2fa",component:Qc}),(o?vT.filter((function(e){var t=e.allowedRoles;return F.a(o.role,t)})):[]).map((function(t){var r=t.route,a=t.component,i=t.key;return Object(Me.jsx)(ax,{path:r,children:Object(Me.jsx)(c,Object(s.a)(Object(s.a)({className:e.wrapper},l),{},{in:!!Object(w.g)(n.pathname,{path:r}),mountOnEnter:!0,unmountOnExit:!0,children:Object(Me.jsx)("div",{className:e.wrapper,children:Object(Me.jsx)(ax,{path:r,children:Object(Me.jsx)(a,{name:i})},i)})}))},i)})),Object(Me.jsx)(ix,{path:"/404"}),Object(Me.jsx)(ix,{path:"*",children:Object(Me.jsx)(w.b,{to:{pathname:"/404"}})})]})},wT="100%",CT={"@global":Object(s.a)(Object(s.a)({},{"@font-face":[{fontFamily:"Mont",src:['url("/fonts/MontHeavy/mont-heavy-webfont.woff2") format("woff2")','url("/fonts/MontHeavy/mont-heavy-webfont.woff") format("woff")'],fontWeight:900,fontStyle:"normal"},{fontFamily:"Mont",src:['url("/fonts/MontHeavy/mont-bold-webfont.woff2") format("woff2")','url("/fonts/MontHeavy/mont-bold-webfont.woff") format("woff")'],fontWeight:700,fontStyle:"normal"},{fontFamily:"MuseoSans",src:['url("/fonts/MuseoSans/MuseoSans_500-webfont.woff2") format("woff2")','url("/fonts/MuseoSans/MuseoSans_500-webfont.woff") format("woff")'],fontWeight:500,fontStyle:"normal"},{fontFamily:"MuseoSans",src:['url("/fonts/MuseoSans/MuseoSans_700-webfont.woff2") format("woff2")','url("/fonts/MuseoSans/MuseoSans_700-webfont.woff") format("woff")'],fontWeight:700,fontStyle:"normal"},{fontFamily:"BPmono",src:'url("/fonts/BPmono/BPmono.ttf") format("truetype")',fontWeight:500,fontStyle:"normal"}]}),{},(ER={"#root":{width:wT,minHeight:wT},".root-notifcenter-open":{overflowY:"auto",position:"absolute",top:0,bottom:0,left:0},".body-notifcenter-open":{overflow:"hidden"},html:{height:wT},body:{width:he,display:"flex",minHeight:wT,"@media screen and (min-width: 1200px)":{width:"auto"}}},Object(z.a)(ER,'a::-moz-focus-inner,\n \'input[type="submit"]::-moz-focus-inner,\n input[type="button"]::-moz-focus-inner',{border:0}),Object(z.a)(ER,'a::-moz-focus-inner,\n input[type="submit"]::-moz-focus-inner,\n input[type="button"]::-moz-focus-inner',{border:0}),Object(z.a)(ER,"a,\n a:visited,\n a:focus,\n a:active,\n a:hover",{outline:"0 none"}),Object(z.a)(ER,"button::-moz-focus-inner",{border:0}),Object(z.a)(ER,".ReactVirtualized__Grid__innerScrollContainer",{overflow:"inherit !important"}),ER))},kT=n(169),ST=Re.p,NT=Object(kT.a)({typography:{fontFamily:Ne,body1:Object(s.a)({},ST)},MuiButtonBase:{disableRipple:!0},palette:{primary:{light:ee,dark:ee,main:ee},secondary:{light:ee,dark:ee,main:ee},background:{default:re}},overrides:{MuiRadio:{colorSecondary:{color:ee}},MuiAutocomplete:{root:{color:le},noOptions:{padding:[[6,16]]},option:{'&[data-focus="true"]':{backgroundColor:ae}},paper:{color:le,margin:0},listbox:{padding:0},tag:{'&[data-tag-index="0"]':{marginLeft:0},margin:2,backgroundColor:ae,borderRadius:4,height:18}},MuiChip:{label:{paddingLeft:4,paddingRight:4,color:le,fontSize:ve}},MuiInput:{root:{color:le},underline:{"&:before":{borderBottom:[[2,"solid",le]]}}},MuiInputLabel:{root:{font:"inherit",fontSize:Oe,color:se},shrink:{color:le,transform:"translate(0, 1.7px) scale(0.83)"}},MuiFormLabel:{root:{"&$focused":{color:le}}},MuiListItem:{root:{"&:nth-of-type(odd)":{backgroundColor:re}}}}}),IT=Object(v.c)({plugins:[Object(y.a)()].concat(Object(d.a)(Object(p.a)().plugins))}),ET="100%",FT="column",LT=Object(j.a)(Object(s.a)(Object(s.a)({},CT),{},{root:{backgroundColor:re,width:ET,minHeight:ET,display:"flex",flexDirection:FT},wrapper:{width:he,height:ET,margin:"0 auto",flex:1,display:"flex",flexDirection:FT},grid:{flex:1,height:"100%"},contentWithSidebar:{flex:1,marginLeft:48,paddingTop:15},contentWithoutSidebar:{width:he}})),DT=x()(FR||(FR=Object(l.a)(["\n query userData {\n userData {\n id\n username\n role\n enabled\n last_accessed\n last_accessed_from\n last_accessed_address\n }\n }\n"]))),PT=function(){var e=LT(),t=Object(w.i)(),n=Object(w.h)(),a=Object(r.useContext)(k),i=a.wizardTested,o=a.userData,c=a.setUserData,l=Object(u.c)(DT,{onCompleted:function(e){!o&&(null===e||void 0===e?void 0:e.userData)&&c(e.userData)}}).loading,s=t.pathname,d=function(e){return Uo.a((function(t){return t.route===e}))(L.a(Ho.a,B.a(R.a("children")),M.a(qo.a("children")))(gT))}(s),m=d?function(e){return Tr.a(W.a("route",Go.a(1,Xo.a((function(e){return"/"!==e}),e))))(vT)}(s):{},p="/404"===t.pathname,j=d?e.contentWithSidebar:e.contentWithoutSidebar;return Object(Me.jsxs)("div",{className:e.root,children:[!p&&i&&o&&Object(Me.jsx)(Do,{tree:jT,user:o}),Object(Me.jsxs)("main",{className:e.wrapper,children:[d&&!p&&i&&Object(Me.jsx)(b.a,{direction:"left",in:!0,mountOnEnter:!0,unmountOnExit:!0,children:Object(Me.jsx)("div",{children:Object(Me.jsx)(Wo,{title:m.title})})}),Object(Me.jsxs)(h.a,{container:!0,className:e.grid,children:[d&&!p&&i&&Object(Me.jsx)(di,{data:m.children,isSelected:function(e){return t.pathname===e.route},displayName:function(e){return e.label},onClick:function(e){return n.push(e.route)}}),Object(Me.jsx)("div",{className:j,children:!l&&Object(Me.jsx)(yT,{})})]})]})]})},BT=function(){var e=Object(r.useState)(!1),t=Object(c.a)(e,2),n=t[0],a=t[1],i=Object(r.useState)(null),o=Object(c.a)(i,2),l=o[0],d=o[1];return Object(Me.jsx)(k.Provider,{value:{wizardTested:n,setWizardTested:a,userData:l,setUserData:d,setRole:function(e){l&&e&&l.role!==e&&d(Object(s.a)(Object(s.a)({},l),{},{role:e}))}},children:Object(Me.jsx)(C.a,{children:Object(Me.jsx)(oj,{children:Object(Me.jsx)(f.b,{jss:IT,children:Object(Me.jsxs)(g.a,{theme:NT,children:[Object(Me.jsx)(m.a,{}),Object(Me.jsx)(PT,{})]})})})})})};Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));Promise.resolve().then((function(){return o.a.render(Object(Me.jsx)(a.a.StrictMode,{children:Object(Me.jsx)(BT,{})}),document.getElementById("root"))})),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then((function(e){e.unregister()}))}},[[761,1,2]]]);
|
|
//# sourceMappingURL=main.b19e2bb6.chunk.js.map
|