2 lines
No EOL
550 KiB
JavaScript
2 lines
No EOL
550 KiB
JavaScript
(this["webpackJsonplamassu-admin"]=this["webpackJsonplamassu-admin"]||[]).push([[0],{674:function(e,t){},677:function(e,t){},678:function(e,t){},700:function(e,t){},702:function(e,t){},711:function(e,t){},713:function(e,t){},817:function(e,t,n){"use strict";n.r(t);var r=n(1),a=n.n(r),i=n(35),o=n.n(i),c=n(2),l=n(9),s=n(5),d=n(71),u=n(8),m=n(934),h=n(859),b=n(822),j=n(938),p=n(857),f=n(959),g=n(933),O=n(10),x=n.n(O),v=n(67),y=n(372),w=n(131),C=n(46),k=a.a.createContext(),S=n(865),N=n(864),I=n(7),E=n.n(I),F=n(875),L=n(411),P=n(400),D=n(390),B=n(79),R=n(381),A=n(861),T=n(156),W=n(233),z=n(862),M=n(4),$=n(19),q="#5f668a",H="#44e188",V="#ecfbef",U="#3fd07e",Y="#ebefff",G="#dbdfed",X="#16d6d3",_="#5a67ff",Z="#ffffff",Q="#ff584a",K="#ffeceb",J="#1b2559",ee="#48f694",te=H,ne=U,re="#fafbff",ae=Y,ie=G,oe="#dddddd",ce="#f2f2f2",le=J,se=q,de="#72799d",ue=q,me=Q,he=1200,be=ee,je="Mont",pe="MuseoSans",fe=24,ge=20,Oe=16,xe=14,ve=13;var ye=ve,we=xe,Ce=Oe,ke=fe,Se=500,Ne=pe,Ie=32,Ee=48;var Fe=2*Ie,Le=J,Pe=K,De=V,Be={lineHeight:"120%",color:le},Re={h1:{extend:Be,fontSize:fe,fontFamily:je,fontWeight:900},h2:{extend:Be,fontSize:ge,fontFamily:je,fontWeight:900},h3:{extend:Be,fontSize:xe,fontFamily:je,fontWeight:900},h4:{extend:Be,fontSize:xe,fontFamily:je,fontWeight:700},h5:{extend:Be,fontSize:Oe,fontFamily:je,fontWeight:700},p:{extend:Be,fontSize:xe,fontFamily:pe,fontWeight:500},tl1:{extend:Be,fontSize:ge,fontFamily:pe,fontWeight:700},tl2:{extend:Be,fontSize:xe,fontFamily:pe,fontWeight:700},info1:{extend:Be,fontSize:fe,fontFamily:pe,fontWeight:700},info2:{extend:Be,fontSize:Oe,fontFamily:pe,fontWeight:700},info3:{extend:Be,fontSize:Oe,fontFamily:pe,fontWeight:500},mono:{extend:Be,fontSize:xe,fontFamily:"BPmono",fontWeight:500},monoBold:{fontWeight:700},monoSmall:{fontSize:ve},inputFont:{fontSize:ge,fontFamily:pe,fontWeight:500,lineHeight:"110%",color:le},regularLabel:{fontSize:xe,fontFamily:pe,fontWeight:500,lineHeight:"110%"},label1:{fontSize:ve,fontFamily:pe,fontWeight:500,color:le},label2:{fontSize:ve,fontFamily:pe,fontWeight:700,color:le},label3:{fontSize:xe,fontFamily:pe,fontWeight:500,color:le},confirmationCode:{extend:Be,fontSize:35,fontFamily:je,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:{}},We=n(0),ze=Object(p.a)(Te),Me=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=ze(),d=(t={},Object(M.a)(t,l.actionButton,!0),Object(M.a)(t,l.primary,"primary"===i),Object(M.a)(t,l.secondary,"secondary"===i),t);return Object(We.jsxs)("button",Object(s.a)(Object(s.a)({className:E()(d,n)},c),{},{children:[r&&Object(We.jsx)("div",{className:l.actionButtonIcon,children:Object(We.jsx)(r,{})}),a&&Object(We.jsx)("div",{className:E()(l.actionButtonIcon,l.actionButtonIconActive),children:Object(We.jsx)(a,{})}),o&&Object(We.jsx)("div",{children:o})]}))})),$e=Object(p.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(M.a)(t,o.h1,!0),Object(M.a)(t,o.noMargin,r),Object(M.a)(t,a,!!a),t);return Object(We.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(M.a)(t,o.h2,!0),Object(M.a)(t,o.noMargin,r),Object(M.a)(t,a,!!a),t);return Object(We.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(M.a)(t,o.h3,!0),Object(M.a)(t,o.noMargin,r),Object(M.a)(t,a,!!a),t);return Object(We.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(M.a)(t,o.h4,!0),Object(M.a)(t,o.noMargin,r),Object(M.a)(t,a,!!a),t);return Object(We.jsx)("h4",Object(s.a)(Object(s.a)({className:E()(c)},i),{},{children:n}))}function Ye(e){var t,n=e.children,r=e.noMargin,a=e.className,i=Object($.a)(e,["children","noMargin","className"]),o=$e(),c=(t={},Object(M.a)(t,o.h5,!0),Object(M.a)(t,o.noMargin,r),Object(M.a)(t,a,!!a),t);return Object(We.jsx)("h5",Object(s.a)(Object(s.a)({className:E()(c)},i),{},{children:n}))}var Ge=rt("p"),Xe=rt("info1"),_e=rt("info2"),Ze=rt("info3"),Qe=rt("mono"),Ke=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(M.a)(n,i,!!i),Object(M.a)(n,l[e],e),Object(M.a)(n,l.inline,r),Object(M.a)(n,l.noMargin,a),n);return Object(We.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 jt=r.forwardRef(bt);n.p;function pt(){return(pt=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",pt({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:Y},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(376),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 Pt(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 Dt=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=Pt(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,Dt)}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 Wt=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 zt(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,Wt)}var Mt=r.forwardRef(zt);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 Yt=r.forwardRef(Ut);n.p;function Gt(){return(Gt=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 Xt(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 _t=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 Qt(e,t){var n=e.title,a=e.titleId,i=Xt(e,["title","titleId"]);return r.createElement("svg",Gt({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,_t,Zt)}var Kt,Jt,en,tn=r.forwardRef(Qt),nn=(n.p,Object(p.a)(It)),rn={transaction:{display:"Transactions",icon:Object(We.jsx)(Mt,{})},highValueTransaction:{display:"Transactions",icon:Object(We.jsx)(Mt,{})},fiatBalance:{display:"Maintenance",icon:Object(We.jsx)(Rt,{})},cryptoBalance:{display:"Maintenance",icon:Object(We.jsx)(Rt,{})},compliance:{display:"Compliance",icon:Object(We.jsx)(tn,{})},error:{display:"Error",icon:Object(We.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,j=null!==(n=T.a([i,"icon"])(rn))&&void 0!==n?n:Object(We.jsx)(Rt,{}),p=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(M.a)(r,m.readIcon,s),Object(M.a)(r,m.unreadIcon,!s),r);return Object(We.jsxs)(h.a,{container:!0,className:E()(m.notificationRow,!s&&d?m.unread:""),children:[Object(We.jsx)(h.a,{item:!0,xs:2,className:m.notificationRowIcon,children:j}),Object(We.jsxs)(h.a,{item:!0,container:!0,xs:7,direction:"row",children:[Object(We.jsx)(h.a,{item:!0,xs:12,children:Object(We.jsx)(tt,{className:m.notificationTitle,children:f})}),Object(We.jsx)(h.a,{item:!0,xs:12,children:Object(We.jsx)(Je,{className:m.notificationBody,children:o})}),Object(We.jsx)(h.a,{item:!0,xs:12,children:Object(We.jsx)(et,{className:m.notificationSubtitle,children:p})})]}),Object(We.jsx)(h.a,{item:!0,xs:3,style:{zIndex:1},children:Object(We.jsx)("div",{onClick:function(){return u(a)},className:E()(g)})}),!d&&Object(We.jsx)(Yt,{className:m.stripes})]})},on=Object(p.a)(It),cn=x()(Kt||(Kt=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),j=Object(c.a)(b,2),p=j[0],f=j[1],g=Object(r.useState)(!1),O=Object(c.a)(g,2),x=O[0],v=O[1],y=on({buttonCoords:o,xOffset:p}),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],P=Object(u.b)(sn,{onError:function(){return console.error("Error while clearing all notifications")},refetchQueries:function(){return["getNotifications"]}}),D=Object(c.a)(P,1)[0];Object(r.useEffect)((function(){f(l.current.getBoundingClientRect().x),m&&m.hasUnreadNotifications!==N&&(s(),I(!N))}),[l,m,N,s]);return Object(We.jsxs)(We.Fragment,{children:[Object(We.jsxs)("div",{className:y.container,children:[Object(We.jsxs)("div",{className:y.header,children:[Object(We.jsx)(Ye,{className:y.headerText,children:"Notifications"}),Object(We.jsxs)("button",{onClick:a,className:y.notificationIcon,children:[Object(We.jsx)(st,{}),N&&Object(We.jsx)("div",{className:y.hasUnread})]})]}),Object(We.jsxs)("div",{className:y.actionButtons,children:[N&&Object(We.jsx)(Me,{color:"primary",Icon:Nt,InverseIcon:jt,className:y.clearAllButton,onClick:function(){return v(!x)},children:x?"Show all":"Show unread"}),N&&Object(We.jsx)(Me,{color:"primary",Icon:vt,InverseIcon:jt,className:y.clearAllButton,onClick:D,children:"Mark all as read"})]}),Object(We.jsx)("div",{className:y.notificationsList,children:!h&&(x&&N?W.a(z.a("read",!1))(C):C).map((function(e){return Object(We.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(We.jsx)("div",{className:y.background})]})},un=n(873),mn=n(874),hn=n(820),bn=n(216),jn=n(18),pn=n(124),fn=n.n(pn),gn=n(871),On=n(872),xn=n(6),vn=Object(p.a)({title:{marginTop:24,marginBottom:24}}),yn=Object(r.memo)((function(e){var t=e.children,n=vn();return Object(We.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:Y,cursor:"pointer",outline:0,display:"flex",justifyContent:"center",alignItems:"center",width:167,height:48,color:le,"&:hover":{backgroundColor:G},"&:active":{backgroundColor:q,color:Z,"& svg g *":{stroke:Z}},"& svg":{marginRight:8}}}),Fn=Object(p.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(We.jsxs)("button",Object(s.a)(Object(s.a)({className:E()(a.button,t)},r),{},{children:[Object(We.jsx)(In,{}),n]}))})),Pn=Re.h1,Dn=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?Pn:Dn,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(p.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(We.jsx)("div",{className:E()(a,c.wrapper),children:Object(We.jsx)("button",Object(s.a)(Object(s.a)({className:E()(i,c.button)},o),{},{children:r}))})})),Wn=function(e,t,n){return{backgroundColor:e,"&:hover":{backgroundColor:t},"&:active":{backgroundColor:n}}},zn={baseButton:{extend:Wn(ae,ie,se),cursor:"pointer",border:"none",outline:0,height:32,color:le,"&:active":{color:Z}},primary:{extend:Wn(ae,ie,se),"&:active":{color:Z,"& $buttonIcon":{display:"none"},"& $buttonIconActive":{display:"block"}},"& $buttonIconActive":{display:"none"}},secondary:{extend:Wn(se,de,Z),color:Z,"&:active":{color:le,"& $buttonIcon":{display:"flex"},"& $buttonIconActive":{display:"none"}},"& $buttonIcon":{display:"none"},"& $buttonIconActive":{display:"flex"}}},Mn=zn.baseButton,$n=zn.primary,qn={featureButton:{extend:Mn,width:Mn.height,borderRadius:Mn.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(p.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(M.a)(t,c.featureButton,!0),Object(M.a)(t,c.primary,!0),t);return Object(We.jsxs)("button",Object(s.a)(Object(s.a)({className:E()(l,n)},o),{},{children:[r&&Object(We.jsx)("div",{className:c.buttonIcon,children:Object(We.jsx)(r,{})}),a&&Object(We.jsx)("div",{className:E()(c.buttonIcon,c.buttonIconActive),children:Object(We.jsx)(a,{})}),i]}))})),Un=n(276),Yn=n(863),Gn=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],j=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(p.a)(f)(),O=(t={},Object(M.a)(t,g.arrow,!0),Object(M.a)(t,g.arrowBottom,"bottom"===u.placement),Object(M.a)(t,g.arrowTop,"top"===u.placement),Object(M.a)(t,g.arrowRight,"right"===u.placement),Object(M.a)(t,g.arrowLeft,"left"===u.placement),t),x=Yn.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(We.jsx)(We.Fragment,{children:Object(We.jsx)(N.a,Object(s.a)(Object(s.a)({disablePortal:!1,modifiers:x,className:g.popover},u),{},{children:Object(We.jsxs)(Un.a,{className:E()(g.root,d),children:[Object(We.jsx)("span",{className:E()(O),ref:j}),n]})}))})},Xn=Re.info2,_n=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:_n(ae,ie,se)},open:{extend:_n(se,se,se)},popoverContent:{extend:Xn,padding:8,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:4,"& img":{maxHeight:145}}},Qn=Object(p.a)(Zn),Kn=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],j=h[1],p=Qn(),f=Boolean(b),g=f?"simple-popper-".concat(n):void 0,O=(t={},Object(M.a)(t,p.idButton,!0),Object(M.a)(t,p.primary,!0),Object(M.a)(t,p.open,f),Object(M.a)(t,p.closed,!f),t),x=Object(M.a)({},p.buttonIcon,!0),v=function(){j(null)};return Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(S.a,{onClickAway:v,children:Object(We.jsxs)("button",Object(s.a)(Object(s.a)({"aria-describedby":g,onClick:function(e){j(b?null:e.currentTarget)},className:E()(O,a)},u),{},{children:[i&&!f&&Object(We.jsx)("div",{className:E()(x),children:Object(We.jsx)(i,{})}),o&&f&&Object(We.jsx)("div",{className:E()(x),children:Object(We.jsx)(o,{})})]}))}),Object(We.jsx)(Gn,{className:d,id:g,open:f,anchorEl:b,onClose:v,arrowSize:3,placement:"top",children:Object(We.jsx)("div",{className:p.popoverContent,children:Object(We.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(p.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(We.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(184),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:Y}},ir=Object(p.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(M.a)(t,l.link,!0),Object(M.a)(t,l.primary,"primary"===o),Object(M.a)(t,l.secondary,"secondary"===o),Object(M.a)(t,l.noColor,"noColor"===o),Object(M.a)(t,l.action,"action"===o),t);return Object(We.jsx)("button",Object(s.a)(Object(s.a)({type:n?"submit":"button",className:E()(d,r)},c),{},{children:a}))})),cr=zn.baseButton,lr=zn.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(p.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 jr=r.forwardRef(br),pr=(n.p,zn.baseButton),fr={button:{extend:pr,padding:0,color:Z,borderRadius:pr.height/2},normalButton:{width:pr.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(p.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(M.a)(t,h.button,!0),Object(M.a)(t,h.normalButton,!u),Object(M.a)(t,h.activeButton,u),t),j=Object(We.jsx)(a,{className:h.buttonIcon}),p=Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(i,{className:E()(h.buttonIcon,h.buttonIconActiveLeft)}),Object(We.jsx)(Ue,{className:h.white,children:l}),Object(We.jsx)(jr,{className:E()(h.buttonIcon,h.buttonIconActiveRight)})]});return Object(We.jsx)("button",{className:E()(b,n),onClick:function(){var e=!u;o(e),m(e)},children:u?p:j})}));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),Pr=(n.p,Object(p.a)({actionButton:{marginBottom:32},actionButtonLink:{textDecoration:"none",color:J}})),Dr=function(e){var t=e.link,n=e.label,r=Pr();return Object(We.jsx)("a",{className:r.actionButtonLink,target:"_blank",rel:"noopener noreferrer",href:t,children:Object(We.jsx)(Me,{className:r.actionButton,color:"primary",Icon:Lr,InverseIcon:kr,children:n})})},Br=n(271),Rr=n(943),Ar=n(388),Tr=n(950),Wr=n(867),zr=n(949),Mr=n(393),$r=n(868),qr=n(936),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}}},Yr=Object(p.a)(Ur),Gr=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"]),j=Yr({textAlign:c,width:l,size:d}),p=!o&&!D.a(i)&&!zr.a(i),f=n||p,g=Object(M.a)({},j.bold,u);return Object(We.jsx)(qr.a,Object(s.a)({id:t,onChange:r,onBlur:a,error:o,value:i,classes:{root:j.root},className:m,InputProps:Object(s.a)({className:E()(g),classes:{root:j.size,underline:f?j.underline:null}},h)},b))})),Xr=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,j=Object($.a)(e,["optionsLimit","limit","options","label","valueProp","multiple","onChange","labelProp","shouldStayOpen","value","error","fullWidth","textAlign","size","autoFocus"]),p=function(e){return function(t){return Tr.a(z.a(a,t))(e)}},f=R.a(a),g=a?(i?B.a(p(n)):p(n))(l):l,O=function(){return D.a(g)?[]:i?g:[g]};return Object(We.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 Wr.a(zr.a(r)?O():[],function(e,t){return t?Object(Ar.a)(e,t,{keys:[a,c]}):e}(e,r)).slice(0,Mr.a(void 0)(t)&&Math.max(t,zr.a(r)?O().length:0))},openOnFocus:!0,autoHighlight:!0,disableClearable:!0,ChipProps:{onDelete:null},clearOnEscape:!0,getOptionSelected:$r.a(a)},j),{},{renderInput:function(e){return Object(We.jsx)(Gr,Object(s.a)(Object(s.a)({},e),{},{autoFocus:b,label:r,value:l,error:d,size:h,fullWidth:u,textAlign:m}))}}))},_r=n(944),Zr=n(396),Qr=n.n(Zr),Kr=n(395),Jr=n.n(Kr);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(p.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(We.jsx)(We.Fragment,{children:o?Object(We.jsxs)("div",{className:d.checkBoxLabel,children:[Object(We.jsx)(tt,{children:c}),Object(We.jsx)(_r.a,Object(s.a)({id:t,classes:{root:d.root,checked:d.checked},onChange:n,value:r,checked:r,icon:Object(We.jsx)(Jr.a,{style:{marginLeft:2,fontSize:Oe}}),checkedIcon:Object(We.jsx)(Qr.a,{style:{fontSize:ge}}),disableRipple:!0},i))]}):Object(We.jsxs)("div",{className:d.wrapper,children:[Object(We.jsx)(ia,{}),Object(We.jsx)(Ze,{className:d.message,children:l})]})})},la=n(397),sa=n.n(la),da={input:{width:"3.5rem !important",height:"5rem",border:"2px solid",borderColor:Y,borderRadius:"4px"},focus:{color:J,border:"2px solid",borderColor:J,borderRadius:"4px"},error:{borderColor:me},container:{justifyContent:"space-evenly"}},ua=Object(p.a)(da),ma=Object(p.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(We.jsx)(sa.a,Object(s.a)({id:t,value:n,onChange:r,numInputs:a,separator:Object(We.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(398),ja=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(We.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:Gr,decimalScale:h,onValueChange:function(e){n({target:{id:t,value:e.floatValue}})}},b))})),pa=n(962),fa=n(869),ga=n(942),Oa=Object(p.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(We.jsxs)(We.Fragment,{children:[n&&Object(We.jsx)(et,{className:s.label,children:n}),Object(We.jsx)(pa.a,{name:t,value:r,onChange:i,className:E()(o),children:a.map((function(e,t){return Object(We.jsx)(fa.a,{value:e.code,control:Object(We.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(We.jsx)(Gr,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(870),wa=Object(p.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(We.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,j=a.form,p=j.touched,f=j.errors,g=j.setFieldValue,O=j.setFieldTouched,x=!(!p[m]||!f[m]),v=Object(jn.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(We.jsx)(Xr,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(961),Na=n(21),Ia=Object(r.memo)((function(e){var t=e.classes,n=Object($.a)(e,["classes"]);return Object(We.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:Q,full:J},cashIn:{empty:J,full:Q}},La=function(e){var t=e.percent,n=e.cashOut;return e.applyColorVariant?Fa[n?"cashOut":"cashIn"].full:Fa[n?"cashOut":"cashIn"][t>=50?"full":"empty"]},Pa={cashbox:{borderColor:La,backgroundColor:La,height:118,width: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"}}},Da={row:{display:"flex"},innerRow:{display:"flex",justifyContent:"flex-start"},col2:{marginLeft:16},noMarginText:{marginTop:0,marginBottom:0},link:{marginTop:8},chip:{margin:[[0,0,0,7]]}},Ba=Object(p.a)(Pa),Ra=Object(p.a)(Da),Aa=function(e){var t,n=e.percent,r=void 0===n?0:n,a=e.cashOut,i=void 0!==a&&a,o=e.className,c=e.emptyPartClassName,l=e.labelClassName,s=e.applyColorVariant,d=e.applyFiatBalanceAlertsStyling,u=e.omitInnerPercentage,m=Ba({percent:r,cashOut:i,applyColorVariant:s}),h=(t={},Object(M.a)(t,m.fiatBalanceAlertCashbox,d),Object(M.a)(t,m.cashbox,!d),t);return Object(We.jsxs)("div",{className:E()(o,h),children:[Object(We.jsx)("div",{className:E()(c,m.emptyPart),children:!u&&r<=51&&Object(We.jsxs)(tt,{className:l,children:[r.toFixed(0),"%"]})}),Object(We.jsx)("div",{className:m.fullPart,children:!u&&r>51&&Object(We.jsxs)(tt,{className:l,children:[r.toFixed(0),"%"]})})]})},Ta=function(e){e.currency;var t=e.notes,n=(e.total,Ra());return Object(We.jsx)(We.Fragment,{children:Object(We.jsx)("div",{className:n.row,children:Object(We.jsxs)("div",{children:[Object(We.jsx)("div",{className:n.innerRow,children:Object(We.jsxs)(_e,{className:n.noMarginText,children:[t," notes"]})}),Object(We.jsx)("div",{className:n.innerRow})]})})})},Wa=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=100*o/n,u=Ra();return Object(We.jsx)(We.Fragment,{children:Object(We.jsxs)("div",{className:u.row,children:[Object(We.jsx)("div",{className:u.col,children:Object(We.jsx)(Aa,{className:c,percent:d,cashOut:!0})}),!s&&Object(We.jsxs)("div",{className:u.col2,children:[Object(We.jsxs)("div",{className:u.innerRow,children:[Object(We.jsx)(_e,{className:u.noMarginText,children:o}),Object(We.jsx)(Ea,{className:u.chip,label:"".concat(a," ").concat(i.code)})]}),Object(We.jsx)("div",{className:u.innerRow,children:Object(We.jsxs)(et,{className:u.noMarginText,children:[o*a," ",i.code]})})]})]})})},za=Object(p.a)({flex:{display:"flex"},cashCassette:{width:80,height:36,marginRight:16}}),Ma=Object(r.memo)((function(e){var t=e.decimalPlaces,n=Object($.a)(e,["decimalPlaces"]),a=za(),i=n.field,o=i.name,l=i.onChange,d=i.onBlur,u=i.value,m=n.form,h=m.touched,b=m.errors,j=Object(r.useState)(u),p=Object(c.a)(j,2),f=p[0],g=p[1],O=!(!h[o]||!b[o]);return Object(We.jsxs)("div",{className:a.flex,children:[Object(We.jsx)(Wa,{className:a.cashCassette,notes:f,editingMode:!0}),Object(We.jsx)(ja,Object(s.a)({name:o,onChange:function(e){return g(e.target.value),l(e)},onBlur:d,value:u,error:O,decimalPlaces:t},n))]})})),$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(We.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(We.jsx)(ja,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(We.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(We.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(We.jsx)(Gr,Object(s.a)({name:r,onChange:a,onBlur:i,value:o,error:u},t))}));function Ya(){return(Ya=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 Ga(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 Xa=r.createElement("desc",null,"Created with Sketch."),_a=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=Ga(e,["title","titleId"]);return r.createElement("svg",Ya({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,Xa,_a)}var Qa=r.forwardRef(Za);n.p;function Ka(){return(Ka=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",Ka({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=Y,li={sidebar:Object(M.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(p.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(We.jsxs)("div",{className:s.sidebar,children:[l&&Object(We.jsx)(Ge,{children:"Loading..."}),!l&&(null===t||void 0===t?void 0:t.map((function(e,t){var i;return Object(We.jsx)("div",{className:E()((i={},Object(M.a)(i,s.activeLink,r(e)),Object(M.a)(i,s.customRenderActiveLink,o&&r(e)),Object(M.a)(i,s.customRenderLink,o),Object(M.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(We.jsxs)("div",{className:c.item,children:[Object(We.jsx)("span",{className:E()((t={},Object(M.a)(t,c.itemText,!0),Object(M.a)(t,c.itemTextActive,l),Object(M.a)(t,c.itemTextPast,s),t)),children:a.label}),l&&Object(We.jsx)(ai,{}),s&&Object(We.jsx)(Qa,{}),d&&Object(We.jsx)(vt,{}),i<o.length-1&&Object(We.jsx)("div",{className:E()((n={},Object(M.a)(n,c.stepperPath,!0),Object(M.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"),ji=r.createElement("desc",null,"Created with Sketch."),pi=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,ji,pi)}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"}},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"]))),Pi=Object(p.a)(Ei),Di=L.a(gn.a,On.a([],["machines"])),Bi={name:""},Ri=xn.d().shape({name:xn.f().required().max(50)}),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];return Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(_e,{className:n.nameTitle,children:"Machine Name (ex: Coffee shop 01)"}),Object(We.jsx)(jn.d,{validateOnBlur:!1,validateOnChange:!1,initialValues:Bi,validationSchema:Ri,onSubmit:function(e){var t=e.name;a(t),o({variables:{name:t}})},children:Object(We.jsxs)(jn.c,{className:n.form,children:[Object(We.jsx)("div",{children:Object(We.jsx)(jn.a,{name:"name",label:"Enter machine name",component:Ua})}),Object(We.jsx)("div",{className:n.button,children:Object(We.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=Di(s)>o&&d;return m&&(l.current=setTimeout((function(){return c(d)}),2e3)),Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(_e,{className:n.qrTitle,children:"Scan QR code with your new cryptomat"}),Object(We.jsxs)("div",{className:n.qrCodeWrapper,children:[Object(We.jsx)("div",{children:Object(We.jsx)(fn.a,{size:240,fgColor:J,value:a})}),Object(We.jsxs)("div",{className:n.qrTextWrapper,children:[Object(We.jsxs)("div",{className:n.qrTextInfoWrapper,children:[Object(We.jsx)("div",{className:n.qrTextIcon,children:Object(We.jsx)(ia,{})}),Object(We.jsx)("div",{className:n.textWrapper,children:Object(We.jsx)(Ge,{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(We.jsxs)("div",{className:n.successMessageWrapper,children:[Object(We.jsx)("div",{className:n.successMessageIcon,children:Object(We.jsx)(Si,{})}),Object(We.jsx)(_e,{className:n.successMessage,children:"Machine has been successfully paired!"})]})]})]})]})}}],Ti=Object(r.memo)((function(e){var t=e.close,n=e.onPaired,a=Pi(),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],j=h[1],p=Object(r.useState)(0),f=Object(c.a)(p,2),g=f[0],O=f[1],x=Di(i),v=Ai[g].component;return Object(We.jsx)("div",{children:Object(We.jsx)(un.a,{fullScreen:!0,className:a.dialog,open:!0,"aria-labelledby":"form-dialog-title",children:Object(We.jsx)(mn.a,{className:a.dialog,children:Object(We.jsxs)("div",{className:a.wrapper,children:[Object(We.jsxs)("div",{className:a.headerDiv,children:[Object(We.jsx)(yn,{children:"Add Machine"}),Object(We.jsx)(hn.a,{disableRipple:!0,onClick:t,children:Object(We.jsx)(bn.a,{color:"error",children:Object(We.jsx)(gi,{})})})]}),Object(We.jsxs)("div",{className:a.contentDiv,children:[Object(We.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(We.jsxs)("div",{className:r.item,children:[Object(We.jsx)("span",{className:E()((a={},Object(M.a)(a,r.itemText,!0),Object(M.a)(a,r.itemTextActive,o),Object(M.a)(a,r.itemTextPast,c),a)),children:t.label}),o&&Object(We.jsx)(ai,{}),c&&Object(We.jsx)(Qa,{}),l&&Object(We.jsx)(vt,{}),n<Ai.length-1&&Object(We.jsx)("div",{className:E()((i={},Object(M.a)(i,r.stepperPath,!0),Object(M.a)(i,r.stepperPast,c),i))})]})}(g,e,t,a)}))}),Object(We.jsx)("div",{className:a.contentWrapper,children:Object(We.jsx)(v,{classes:a,nextStep:function(){return O(1)},count:x,onPaired:n,qrCode:s,setQrCode:d,name:b,setName:j})})]})]})})})})}));function Wi(){return(Wi=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 zi(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 Mi=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=zi(e,["title","titleId"]);return r.createElement("svg",Wi({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,Mi,$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 Yi=r.createElement("desc",null,"Created with Sketch."),Gi=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"})),Xi=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 _i(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,Yi,Gi,Xi)}var Zi=r.forwardRef(_i);n.p;function Qi(){return(Qi=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 Ki(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=Ki(e,["title","titleId"]);return r.createElement("svg",Qi({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,jo,po,fo,go,Oo,xo,vo={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}},yo=Object(p.a)(vo),wo=x()(co||(co=Object(l.a)(["\n query getUnread {\n hasUnreadNotifications\n }\n"]))),Co=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(We.jsx)("div",{className:n.subheader,children:Object(We.jsx)("div",{className:n.content,children:Object(We.jsx)("nav",{children:Object(We.jsx)("ul",{className:n.subheaderUl,children:t.children.map((function(e,t){return F.a(a.role,e.allowedRoles)?Object(We.jsx)("li",{className:n.subheaderLi,children:Object(We.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(We.jsx)(We.Fragment,{})}))})})})})},ko=L.a(P.a,D.a),So=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}),j=Object(c.a)(b,2),p=j[0],f=j[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],P=Object(u.c)(wo),D=P.data,B=P.refetch,R=P.startPolling,A=P.stopPolling,T=Object(r.useRef)(),W=Object(r.useRef)(),z=Object(w.h)(),M=yo();Object(r.useEffect)((function(){return(null===D||void 0===D?void 0:D.hasUnreadNotifications)?L(!0):ko(null===D||void 0===D?void 0:D.hasUnreadNotifications)?L(!1):void 0}),[D]),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(We.jsxs)("header",{className:M.headerContainer,children:[Object(We.jsx)("div",{className:M.header,children:Object(We.jsxs)("div",{className:M.content,children:[Object(We.jsxs)("div",{onClick:function(){v(!1),z.push("/dashboard")},className:E()(M.logo,M.logoLink),children:[Object(We.jsx)(Zi,{}),Object(We.jsx)(Ue,{className:M.white,children:"Lamassu Admin"})]}),Object(We.jsx)("nav",{className:M.nav,children:Object(We.jsx)("ul",{className:M.ul,children:t.map((function(e,t){return F.a(n.role,e.allowedRoles)?Object(We.jsx)(C.c,{to:e.route||e.children[0].route,isActive:function(t){return!!t&&(v(e),!0)},className:E()(M.link,M.whiteLink),activeClassName:M.activeLink,children:Object(We.jsx)("li",{className:M.li,children:Object(We.jsx)("span",{className:M.forceSize,forcesize:e.label,children:e.label})})},t):Object(We.jsx)(We.Fragment,{})}))})}),Object(We.jsxs)("div",{className:M.actionButtonsContainer,children:[Object(We.jsx)(Me,{color:"secondary",Icon:In,InverseIcon:Hi,onClick:function(){return l(!0)},children:"Add machine"}),Object(We.jsx)(S.a,{onClickAway:$,children:Object(We.jsxs)("div",{ref:T,children:[Object(We.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:M.notificationIcon,children:[Object(We.jsx)(no,{}),I&&Object(We.jsx)("div",{className:M.hasUnread})]}),Object(We.jsx)(N.a,{ref:W,id:H,open:q,anchorEl:m,className:M.popper,disablePortal:!1,modifiers:{preventOverflow:{enabled:!0,boundariesElement:"viewport"}},children:Object(We.jsx)(dn,{popperRef:W,buttonCoords:p,close:$,hasUnreadProp:I,refetchHasUnreadHeader:B})})]})})]})]})}),x&&x.children&&Object(We.jsx)(Co,{item:x,classes:M,user:n}),o&&Object(We.jsx)(Ti,{close:function(){return l(!1)},onPaired:function(e){l(!1),z.push("/maintenance/machine-status",{id:e.deviceId})}})]})})),No=n(937),Io={wrapper:{display:"flex",alignItems:"center","& > svg":{marginRight:10}},message:{display:"flex",alignItems:"center",color:me,margin:0,whiteSpace:"break-spaces"}},Eo=Object(p.a)(Io),Fo=function(e){var t=e.className,n=e.children,r=(Object($.a)(e,["className","children"]),Eo());return Object(We.jsxs)("div",{className:E()(r.wrapper,t),children:[Object(We.jsx)(tn,{}),Object(We.jsx)(Ze,{className:r.message,children:n})]})},Lo={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}},Po=Object(p.a)(Lo),Do=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=Po();return Object(We.jsxs)("div",{className:E()(s.titleWrapper,t),children:[Object(We.jsxs)("div",{className:s.titleAndButtonsContainer,children:[Object(We.jsx)(yn,{children:n}),c&&Object(We.jsx)("div",{className:l,children:c}),r&&Object(We.jsx)(Fo,{className:s.error,children:"Failed to save"}),i&&Object(We.jsx)(Or,{className:s.subpageButton,Icon:i.icon,InverseIcon:i.inverseIcon,toggle:i.toggle,children:Object(We.jsx)(Xe,{className:s.buttonText,children:i.text})})]}),Object(We.jsx)(No.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(We.jsxs)(No.a,{display:"flex",alignItems:"center",children:[Object(We.jsx)("div",{className:s.icon,children:n}),Object(We.jsx)(et,{className:s.label,children:r})]},t)}))}),o]})},Bo=n(415),Ro=n(932),Ao=n(952),To=n(909),Wo=n(914),zo=n(956),Mo=n(945),$o=n(946),qo=n(912),Ho=n(951),Vo={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"},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}},Uo="LOGIN",Yo="SETUP2FA",Go="INPUT2FA",Xo=Object(p.a)(Vo),_o=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"]))),Zo=x()(so||(so=Object(l.a)(["\n {\n userData {\n id\n username\n role\n }\n }\n"]))),Qo=function(e){var t=e.state,n=e.dispatch,a=Xo(),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)(Zo,{onCompleted:function(e){var t=e.userData;o(t),i.push("/")}}),b=Object(c.a)(h,2),j=b[0],p=b[1].error,f=Object(u.b)(_o,{onCompleted:function(e){e.input2FA?j():m(!0)}}),g=Object(c.a)(f,2),O=g[0],x=g[1].error,v=p?"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(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(Ke,{className:a.info,children:"Enter your two-factor authentication code"}),Object(We.jsx)(ha,{name:"2fa",value:t.twoFAField,onChange:function(e){n({type:Go,payload:{twoFAField:e}}),m(!1)},numInputs:6,error:d,shouldAutoFocus:!0}),Object(We.jsxs)("div",{className:a.twofaFooter,children:[v&&Object(We.jsx)(Ge,{className:a.errorMessage,children:v}),Object(We.jsx)(Tn,{onClick:function(){6===t.twoFAField.length?O({variables:{username:t.clientField,password:t.passwordField,code:t.twoFAField,rememberMe:t.rememberMeField}}):m(!0)},buttonClassName:a.loginButton,children:"Login"})]})]})},Ko=n(37),Jo=n.n(Ko),ec=n(66),tc=Object(p.a)(Vo),nc=x()(uo||(uo=Object(l.a)(["\n mutation login($username: String!, $password: String!) {\n login(username: $username, password: $password)\n }\n"]))),rc=xn.d().shape({client:xn.f().required("Client field is required!").email("Username field should be in an email format!"),password:xn.f().required("Password field is required"),rememberMe:xn.b()}),ac={client:"",password:"",rememberMe:!1},ic=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},oc=function(e){e.state;var t=e.dispatch,n=tc(),r=Object(u.b)(nc),a=Object(c.a)(r,2),i=a[0],o=a[1].error,l=function(){var e=Object(ec.a)(Jo.a.mark((function e(n,r,a){var o,c,l;return Jo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i({variables:{username:n,password:r}});case 2:if(o=e.sent,(c=o.data).login){e.next=6;break}return e.abrupt("return");case 6:return l="INPUT2FA"===c.login?Go:Yo,e.abrupt("return",t({type:l,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)}}();return Object(We.jsx)(jn.d,{validationSchema:rc,initialValues:ac,onSubmit:function(e){return l(e.client,e.password,e.rememberMe)},children:function(e){var t=e.errors,r=e.touched;return Object(We.jsxs)(jn.c,{id:"login-form",children:[Object(We.jsx)(jn.b,{name:"client",label:"Client",size:"lg",component:Ua,fullWidth:!0,autoFocus:!0,className:n.input,error:ic(t,r,o)}),Object(We.jsx)(jn.b,{name:"password",size:"lg",component:Va,label:"Password",fullWidth:!0,error:ic(t,r,o)}),Object(We.jsxs)("div",{className:n.rememberMeWrapper,children:[Object(We.jsx)(jn.b,{name:"rememberMe",className:n.checkbox,component:$a}),Object(We.jsx)(nt,{children:"Keep me logged in"})]}),Object(We.jsxs)("div",{className:n.footer,children:[ic(t,r,o)&&Object(We.jsx)(Ge,{className:n.errorMessage,children:ic(t,r,o)}),Object(We.jsx)(Tn,{type:"submit",form:"login-form",buttonClassName:n.loginButton,children:"Login"})]})]})}})},cc=x()(mo||(mo=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"]))),lc=x()(ho||(ho=Object(l.a)(["\n query get2FASecret($username: String!, $password: String!) {\n get2FASecret(username: $username, password: $password) {\n secret\n otpauth\n }\n }\n"]))),sc=x()(bo||(bo=Object(l.a)(["\n {\n userData {\n id\n username\n role\n }\n }\n"]))),dc=Object(p.a)(Vo),uc=function(e){var t=e.state,n=(e.dispatch,dc()),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],j=h[1],p=Object(r.useState)(!1),f=Object(c.a)(p,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=Object(u.c)(lc,{variables:{username:t.clientField,password:t.passwordField},onCompleted:function(e){var t=e.get2FASecret;d(t.secret),j(t.otpauth)}}).error,L=Object(u.a)(sc,{onCompleted:function(e){var t=e.userData;i(t),a.push("/")}}),P=Object(c.a)(L,1)[0],D=Object(u.b)(cc,{onCompleted:function(e){e.setup2FA?P():C(!0)}}),B=Object(c.a)(D,2),R=B[0],A=B[1].error,T=function(){return A||F?"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(We.jsxs)(We.Fragment,{children:[Object(We.jsxs)("div",{className:n.infoWrapper,children:[Object(We.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(We.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(We.jsx)("div",{className:n.qrCodeWrapper,children:Object(We.jsx)(fn.a,{size:240,fgColor:J,value:b})}),Object(We.jsxs)("div",{className:n.secretWrapper,children:[Object(We.jsx)(nt,{className:n.secretLabel,children:"Your secret:"}),Object(We.jsx)(nt,{className:g?n.secret:n.hiddenSecret,children:s}),Object(We.jsx)(Me,{disabled:!s&&!b,color:"primary",onClick:function(){O(!g)},children:g?"Hide":"Show"})]}),Object(We.jsx)("div",{className:n.confirm2FAInput,children:Object(We.jsx)(ha,{name:"2fa",value:I,onChange:function(e){E(e),C(!1)},numInputs:6,error:y,shouldAutoFocus:!0})}),Object(We.jsxs)("div",{className:n.twofaFooter,children:[T()&&Object(We.jsx)(Ge,{className:n.errorMessage,children:T()}),Object(We.jsx)(Tn,{onClick:function(){6===I.length?R({variables:{username:t.clientField,password:t.passwordField,rememberMe:t.rememberMeField,codeConfirmation:I}}):C(!0)},buttonClassName:n.loginButton,children:"Done"})]})]})},mc=Object(p.a)(Vo),hc={twoFAField:"",clientField:"",passwordField:"",rememberMeField:!1,loginState:Uo},bc=function(e,t){var n=t.type,r=t.payload;return Object(s.a)(Object(s.a)(Object(s.a)({},e),r),{},{loginState:n})},jc=function(){var e=mc(),t=Object(r.useReducer)(bc,hc),n=Object(c.a)(t,2),a=n[0],i=n[1];return Object(We.jsx)(Un.a,{elevation:1,children:Object(We.jsxs)("div",{className:e.wrapper,children:[Object(We.jsxs)("div",{className:e.titleWrapper,children:[Object(We.jsx)(Zi,{className:e.icon}),Object(We.jsx)(Ye,{className:e.title,children:"Lamassu Admin"})]}),function(){switch(a.loginState){case Uo:return Object(We.jsx)(oc,{state:a,dispatch:i});case Go:return Object(We.jsx)(Qo,{state:a,dispatch:i});case Yo:return Object(We.jsx)(uc,{state:a,dispatch:i})}}()]})})},pc=Object(p.a)(Vo),fc=function(){var e=pc();return Object(We.jsx)(h.a,{container:!0,spacing:0,direction:"column",alignItems:"center",justify:"center",className:e.welcomeBackground,children:Object(We.jsx)(h.a,{children:Object(We.jsx)(jc,{})})})},gc=Object(p.a)(Vo),Oc=x()(jo||(jo=Object(l.a)(["\n query validateRegisterLink($token: String!) {\n validateRegisterLink(token: $token) {\n username\n role\n }\n }\n"]))),xc=x()(po||(po=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"]))),vc=xn.d().shape({password:xn.f().required("A password is required").test("len","Your password must contain more than 8 characters",(function(e){return e.length>=8})),confirmPassword:xn.f().oneOf([xn.e("password"),null],"Passwords must match")}),yc={password:"",confirmPassword:""},wc={username:null,role:null,result:""},Cc=function(e,t){var n=t.type,r=t.payload;return Object(s.a)(Object(s.a)(Object(s.a)({},e),r),{},{result:n})},kc=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},Sc=function(){var e=gc(),t=Object(w.h)(),n=new URLSearchParams(Object(w.i)().search).get("t"),a=Object(r.useReducer)(Cc,wc),i=Object(c.a)(a,2),o=i[0],l=i[1],s=Object(u.c)(Oc,{variables:{token:n},onCompleted:function(e){var t=e.validateRegisterLink;if(!t)return l({type:"failure"});l({type:"success",payload:{username:t.username,role:t.role}})},onError:function(){return l({type:"failure"})}}),d=s.error,m=s.loading,b=Object(u.b)(xc,{onCompleted:function(e){e.register&&t.push("/wizard",{fromAuthRegister:!0})}}),j=Object(c.a)(b,2),p=j[0],f=j[1].error;return Object(We.jsx)(h.a,{container:!0,spacing:0,direction:"column",alignItems:"center",justify:"center",className:e.welcomeBackground,children:Object(We.jsx)(h.a,{children:Object(We.jsx)("div",{children:Object(We.jsx)(Un.a,{elevation:1,children:Object(We.jsxs)("div",{className:e.wrapper,children:[Object(We.jsxs)("div",{className:e.titleWrapper,children:[Object(We.jsx)(Zi,{className:e.icon}),Object(We.jsx)(He,{className:e.title,children:"Lamassu Admin"})]}),!m&&"success"===o.result&&Object(We.jsx)(jn.d,{validationSchema:vc,initialValues:yc,onSubmit:function(e){p({variables:{token:n,username:o.username,password:e.password,role:o.role}})},children:function(t){var n=t.errors,r=t.touched;return Object(We.jsxs)(jn.c,{id:"register-form",children:[Object(We.jsx)(jn.b,{name:"password",label:"Insert a password",autoFocus:!0,component:Va,size:"lg",fullWidth:!0,className:e.input}),Object(We.jsx)(jn.b,{name:"confirmPassword",label:"Confirm your password",component:Va,size:"lg",fullWidth:!0}),Object(We.jsxs)("div",{className:e.footer,children:[kc(n,r,d,f)&&Object(We.jsx)(Ge,{className:e.errorMessage,children:kc(n,r,d,f)}),Object(We.jsx)(Tn,{type:"submit",form:"register-form",buttonClassName:e.loginButton,children:"Done"})]})]})}}),!m&&"failure"===o.result&&Object(We.jsx)(We.Fragment,{children:Object(We.jsx)(nt,{children:"Link has expired"})})]})})})})})},Nc=Object(p.a)(Vo),Ic=x()(fo||(fo=Object(l.a)(["\n query validateReset2FALink($token: String!) {\n validateReset2FALink(token: $token) {\n user_id\n secret\n otpauth\n }\n }\n"]))),Ec=x()(go||(go=Object(l.a)(["\n mutation reset2FA($token: String!, $userID: ID!, $code: String!) {\n reset2FA(token: $token, userID: $userID, code: $code)\n }\n"]))),Fc={userID:null,secret:null,otpauth:null,result:null},Lc=function(e,t){var n=t.type,r=t.payload;return Object(s.a)(Object(s.a)(Object(s.a)({},e),r),{},{result:n})},Pc=function(){var e=Nc(),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],j=Object(r.useState)(""),p=Object(c.a)(j,2),f=p[0],g=p[1],O=Object(r.useReducer)(Lc,Fc),x=Object(c.a)(O,2),v=x[0],y=x[1],C=Object(u.c)(Ic,{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)(Ec,{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(We.jsx)(h.a,{container:!0,spacing:0,direction:"column",alignItems:"center",justify:"center",className:e.welcomeBackground,children:Object(We.jsx)(h.a,{children:Object(We.jsx)("div",{children:Object(We.jsx)(Un.a,{elevation:1,children:Object(We.jsxs)("div",{className:e.wrapper,children:[Object(We.jsxs)("div",{className:e.titleWrapper,children:[Object(We.jsx)(Zi,{className:e.icon}),Object(We.jsx)(He,{className:e.title,children:"Lamassu Admin"})]}),!S&&"success"===v.result&&Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)("div",{className:e.infoWrapper,children:Object(We.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(We.jsx)("div",{className:e.qrCodeWrapper,children:Object(We.jsx)(fn.a,{size:240,fgColor:J,value:v.otpauth})}),Object(We.jsxs)("div",{className:e.secretWrapper,children:[Object(We.jsx)(tt,{className:e.secretLabel,children:"Your secret:"}),Object(We.jsx)(tt,{className:o?e.secret:e.hiddenSecret,children:v.secret}),Object(We.jsx)(Me,{color:"primary",onClick:function(){l(!o)},children:o?"Hide":"Show"})]}),Object(We.jsx)("div",{className:e.confirm2FAInput,children:Object(We.jsx)(ha,{name:"2fa",value:f,onChange:function(e){g(e),b(!1)},numInputs:6,error:m,shouldAutoFocus:!0})}),Object(We.jsxs)("div",{className:e.twofaFooter,children:[L()&&Object(We.jsx)(Ge,{className:e.errorMessage,children:L()}),Object(We.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(We.jsx)(We.Fragment,{children:Object(We.jsx)(nt,{children:"Link has expired"})})]})})})})})},Dc=Object(p.a)(Vo),Bc=x()(Oo||(Oo=Object(l.a)(["\n query validateResetPasswordLink($token: String!) {\n validateResetPasswordLink(token: $token) {\n id\n }\n }\n"]))),Rc=x()(xo||(xo=Object(l.a)(["\n mutation resetPassword($token: String!, $userID: ID!, $newPassword: String!) {\n resetPassword(token: $token, userID: $userID, newPassword: $newPassword)\n }\n"]))),Ac=xn.d().shape({password:xn.f().required("A new password is required").test("len","New password must contain more than 8 characters",(function(e){return e.length>=8})),confirmPassword:xn.f().oneOf([xn.e("password"),null],"Passwords must match")}),Tc={password:"",confirmPassword:""},Wc=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},zc=function(){var e=Dc(),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],j=Object(r.useState)(!1),p=Object(c.a)(j,2),f=p[0],g=p[1];Object(u.c)(Bc,{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)(Rc,{onCompleted:function(e){e.resetPassword&&t.push("/")}}),x=Object(c.a)(O,2),v=x[0],y=x[1].error;return Object(We.jsx)(h.a,{container:!0,spacing:0,direction:"column",alignItems:"center",justify:"center",className:e.welcomeBackground,children:Object(We.jsx)(h.a,{children:Object(We.jsx)("div",{children:Object(We.jsx)(Un.a,{elevation:1,children:Object(We.jsxs)("div",{className:e.wrapper,children:[Object(We.jsxs)("div",{className:e.titleWrapper,children:[Object(We.jsx)(Zi,{className:e.icon}),Object(We.jsx)(He,{className:e.title,children:"Lamassu Admin"})]}),!m&&f&&Object(We.jsx)(jn.d,{validationSchema:Ac,initialValues:Tc,onSubmit:function(e){v({variables:{token:n,userID:o,newPassword:e.confirmPassword}})},children:function(t){var n=t.errors,r=t.touched;return Object(We.jsxs)(jn.c,{id:"reset-password",children:[Object(We.jsx)(jn.b,{name:"password",autoFocus:!0,size:"lg",component:Va,label:"New password",fullWidth:!0,className:e.input}),Object(We.jsx)(jn.b,{name:"confirmPassword",size:"lg",component:Va,label:"Confirm your password",fullWidth:!0}),Object(We.jsxs)("div",{className:e.footer,children:[Wc(n,r,y)&&Object(We.jsx)(Ge,{className:e.errorMessage,children:Wc(n,r,y)}),Object(We.jsx)(Tn,{type:"submit",form:"reset-password",buttonClassName:e.loginButton,children:"Done"})]})]})}}),!m&&!f&&Object(We.jsx)(We.Fragment,{children:Object(We.jsx)(nt,{children:"Link has expired"})})]})})})})})};function Mc(){return(Mc=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("desc",null,"Created with Sketch."),Hc=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 Vc(e,t){var n=e.title,a=e.titleId,i=$c(e,["title","titleId"]);return r.createElement("svg",Mc({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,qc,Hc)}var Uc=r.forwardRef(Vc);n.p;function Yc(){return(Yc=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 Gc(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 Xc=r.createElement("desc",null,"Created with Sketch."),_c=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 Zc(e,t){var n=e.title,a=e.titleId,i=Gc(e,["title","titleId"]);return r.createElement("svg",Yc({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,Xc,_c)}var Qc,Kc=r.forwardRef(Zc),Jc=(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"}}),el=n(38),tl=n.n(el),nl=n(80),rl=n(876),al=n(877),il=n(401),ol=n(878),cl=n(879),ll="cashOut",sl="wallets",dl="operatorInfo",ul="notifications",ml="locale",hl="commissions",bl="receipt",jl="coinAtmRadar",pl="termsConditions",fl="triggersConfig",gl=rl.a((function(e,t){return al.a(B.a(il.a(0,e),ol.a(t)))})),Ol=rl.a((function(e,t){return al.a(W.a((function(t){return e(t[0])}),ol.a(t)))})),xl=rl.a((function(e,t){return cl.a(e,t)?t.slice(e.length):t})),vl=rl.a((function(e,t){return L.a(function(e){return gl(xl("".concat(e,"_")))}(e),function(e){return Ol(cl.a("".concat(e,"_")))}(e))(t)})),yl=rl.a((function(e,t){return gl((function(t){return"".concat(e,"_").concat(t)}))(t)})),wl={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}}},Cl=x()(Qc||(Qc=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"])));tl.a.config({ROUNDING_MODE:tl.a.ROUND_HALF_UP});var kl=Object(p.a)(wl),Sl=function(){var e,t,n,a,i,o=Object(u.c)(Cl).data,l=Object(r.useState)(!1),s=Object(c.a)(l,2),d=s[0],m=s[1],b=Object(r.useState)(null),j=Object(c.a)(b,2),p=j[0],f=j[1],g=null!==(e=T.a(["cryptoRates","withCommissions"])(o))&&void 0!==e?e:{},O=kl({bigFooter:nl.a(g).length>8,expanded:d}),x=null!==(t=T.a(["config"])(o))&&void 0!==t?t:{},v=nl.a(g).length>4,y=vl("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(We.jsxs)(We.Fragment,{children:[Object(We.jsx)("div",{className:O.mouseWatcher,onMouseLeave:function(){clearTimeout(p),m(!1)},onMouseEnter:function(){f(setTimeout((function(){return v&&m(!0)}),300))}}),Object(We.jsx)("div",{className:O.content,children:Object(We.jsx)(h.a,{container:!0,spacing:1,children:Object(We.jsx)(h.a,{container:!0,className:O.footerContainer,children:nl.a(g).map((function(e){return function(e){var t=Ho.a(z.a("code",e))(w),n=y["".concat(e,"_ticker")],r=Ho.a(z.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 tl.a((i+c)/2).toFormat(2),s=new tl.a(parseFloat(T.a(["cryptoRates","withCommissions",e,"cashIn"])(o))).toFormat(2),d=new tl.a(parseFloat(T.a(["cryptoRates","withCommissions",e,"cashOut"])(o))).toFormat(2);return Object(We.jsxs)(h.a,{item:!0,xs:3,children:[Object(We.jsx)(tt,{className:O.label,children:w[t].display}),Object(We.jsxs)("div",{className:O.headerLabels,children:[Object(We.jsxs)("div",{className:O.headerLabel,children:[Object(We.jsx)(Uc,{}),Object(We.jsx)(tt,{children:" ".concat(s," ").concat(k)})]}),Object(We.jsxs)("div",{className:E()(O.headerLabel,O.txOutMargin),children:[Object(We.jsx)(Kc,{}),Object(We.jsx)(tt,{children:" ".concat(d," ").concat(k)})]})]}),Object(We.jsx)(tt,{className:O.tickerLabel,children:"".concat(a,": ").concat(l," ").concat(k)})]},e)}(e)}))})})}),Object(We.jsx)("div",{className:O.footer})]})},Nl=n(26),Il=n.n(Nl),El=n(882),Fl=n(157),Ll=n(939);function Pl(){return(Pl=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 Dl(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("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 Rl(e,t){var n=e.title,a=e.titleId,i=Dl(e,["title","titleId"]);return r.createElement("svg",Pl({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,Bl)}var Al=r.forwardRef(Rl);n.p;function Tl(){return(Tl=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("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 Ml(e,t){var n=e.title,a=e.titleId,i=Wl(e,["title","titleId"]);return r.createElement("svg",Tl({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,zl)}var $l=r.forwardRef(Ml);n.p;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 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 Vl=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 Ul(e,t){var n=e.title,a=e.titleId,i=Hl(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,Vl)}var Yl,Gl=r.forwardRef(Ul),Xl=(n.p,{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:X},outColor:{backgroundColor:_},other:{minWidth:"6px",borderRadius:2},inWidth:{width:function(e){return"".concat(e,"%")}},outWidth:{width:function(e){return"".concat(100-e,"%")},marginRight:4}}),_l=Object(p.a)(Xl),Zl=function(e){var t,n=e.cashIn,r=e.cashOut,a=n||0!==r?n:50,i=_l(a),o=function(e){if(!(e<=15))return Object(We.jsxs)(et,{className:i.label,children:[e,"%"]})},c=(t={},Object(M.a)(t,i.percentageBox,!0),Object(M.a)(t,i.other,a<5&&a>0),t);return Object(We.jsxs)("div",{className:i.wrapper,children:[Object(We.jsx)("div",{className:E()(c,i.outColor,i.outWidth),children:o(100-a)}),Object(We.jsx)("div",{className:E()(c,i.inColor,i.inWidth),children:o(a)})]})},Ql=n(59),Kl=n(880),Jl=n(232),es=n(881),ts=function(e){var t=e.cashInFee?Number.parseFloat(e.cashInFee):0;return Number.parseFloat(e.commissionPercentage)*Number.parseFloat(e.fiat)+t},ns=function(e,t,n){return{created:new Date(new Date(e.created).getTime()+t).toISOString(),profit:n}},rs=function(e){var t=e.created;return new Date(t).toISOString().substring(0,10)},as=function(e){var t=e.created;return new Date(t).toISOString().substring(0,13)},is=function(e,t){var n=e.profit||0;return Object(s.a)(Object(s.a)({},t),{},{profit:n+ts(t)})},os={Day:864e5,Week:6048e5,Month:2592e6},cs=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=Ql.i(o.current),r=0,l=0,s=0,d=336-s-l,u=128-r-0,m=function(){var e="Day"===i?as:rs,r=Kl.a(Jl.a(is,[],e,t));if(!r.length&&!n.length){var o={created:(new Date).toISOString(),profit:0};return[[o,ns(o,-36e5,0)],!0]}if(!r.length&&n.length){var c={created:(new Date).toISOString(),profit:0};return[[c,ns(c,-os[i],1)],!1]}if(r.length&&!n.length){var l={created:(new Date).toISOString(),profit:1};return[[l,ns(l,-os[i],0)],!1]}return 1===r.length?[es.a({created:new Date(Date.now()-os[i]).toISOString(),profit:a},r),!1]:[r,!1]}(),h=Object(c.a)(m,2),b=h[0],j=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:Y},{offset:"25%",color:Y},{offset:"100%",color:re}]).enter().append("stop").attr("offset",(function(e){return e.offset})).attr("stop-color",(function(e){return e.color}));var p=e.append("g").attr("transform","translate(".concat(s,",").concat(r,")")),f=Ql.d(b,(function(e){return e.created})),g=j?[0,.1]:[0,Ql.f(b,(function(e){return e.profit}))],O=Ql.g().range([u,30]).domain([0,g[1]]),x=Ql.h().domain([new Date(f[0]),new Date(f[1])]).range([0,d]),v=Ql.e().x((function(e){return x(new Date(e.created))})).y((function(e){return O(e.profit)})),y=Ql.a().x((function(e){return x(new Date(e.created))})).y0(u).y1((function(e){return O(e.profit)}));p.append("path").datum(b).attr("d",y).attr("fill","url(#area-gradient)"),p.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(){Ql.i(o.current).selectAll("*").remove(),l()}),[l,t]),Object(We.jsx)(We.Fragment,{children:Object(We.jsx)("svg",{ref:o})})},ls=function(e){var t=e.data,n=e.timeFrame,a=e.timezone,i=Object(r.useRef)(),o=W.a(z.a("txClass","cashIn"))(t),c=W.a(z.a("txClass","cashOut"))(t),l=Object(r.useCallback)((function(){var e=Ql.i(i.current),r=25,l=0,s=15,d=555-s-l,u=150-r-25;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,")"));var m=e.append("g").attr("transform","translate(".concat(s,",").concat(r,")")),h=function(){if(0===t.length)return 100;var e=100*Math.ceil(Ql.f(t,(function(e){return parseFloat(e.fiat)}))/100),n=Math.max(100,e);return n%1e3===0?n+100:n}(),b=function(){switch(n){case"Week":return{nice:7,ticks:7,subtractDays:7,timeFormat:"%a %d",timeRange:[50,500]};case"Month":return{nice:6,ticks:6,subtractDays:30,timeFormat:"%b %d",timeRange:[50,500]};default:return{nice:null,ticks:4,subtractDays:1,timeFormat:"%H:%M",timeRange:[50,500]}}}(),j=Ql.g().range([u,0]).domain([0,h]).nice(3),p=Ql.h().domain([Il()().add(-b.subtractDays,"day").add(a.dstOffset,"minutes").valueOf(),Il()().add(a.dstOffset,"minutes").valueOf()]).range(b.timeRange).nice(b.nice);m.append("g").style("color","#eef1ff").call(Ql.c(j).ticks(4).tickSize(-d).tickFormat("")).call((function(e){return e.select(".domain").remove()})),m.append("g").attr("transform","translate(0,"+u+")").style("font-size","13px").style("color","#5f668a").style("font-family","MuseoSans").style("margin-top","11px").call(Ql.b(p).ticks(b.ticks).tickSize(0).tickFormat(Ql.j(b.timeFormat))).selectAll("text").attr("dy","1.5em"),m.append("g").attr("transform","translate(0,"+u+")").style("color","#eef1ff").call(Ql.b(p).ticks(6).tickSize(0).tickFormat("")).selectAll("text").attr("dy","1.5em"),m.append("g").style("font-size","13px").style("color","#5f668a").style("font-family","MuseoSans").style("margin-top","11px").call(Ql.c(j).ticks(4).tickSize(0)).call((function(e){return e.select(".domain").remove()})).selectAll("text").attr("dy","-0.40em").attr("dx","3em"),e.append("g").selectAll("dot").data(o).enter().append("circle").attr("cx",(function(e){var t=new Date(e.created);return p(t.setMinutes(t.getMinutes()+a.dstOffset))})).attr("cy",(function(e){return j(e.fiat)})).attr("r",4).attr("transform","translate("+s+",15)").style("fill",X),e.append("g").selectAll("dot").data(c).enter().append("circle").attr("cx",(function(e){return p(new Date(e.created))})).attr("cy",(function(e){return j(e.fiat)})).attr("r",4).attr("transform","translate("+s+",15)").style("fill",_)}),[o,c,t,n,a]);return Object(r.useEffect)((function(){Ql.i(i.current).selectAll("*").remove(),l()}),[l]),Object(We.jsx)(We.Fragment,{children:Object(We.jsx)("svg",{ref:i})})},ss=function(e){var t=e.info,n=e.label;return Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(Xe,{style:{marginBottom:0},children:t}),Object(We.jsx)(et,{style:{margin:0},children:n})]})},ds=n(94),us={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:pe,fontWeight:700,color:le},percentUp:{fontSize:Oe,fontFamily:pe,fontWeight:700,color:U,height:10},percentDown:{fontSize:Oe,fontFamily:pe,fontWeight:700,color:Q,height:13},percentNeutral:{fontSize:Oe,fontFamily:pe,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:X},outSquare:{width:8,height:8,borderRadius:2,marginTop:18,marginRight:4,backgroundColor:_},directionLabelContainer:{display:"flex"},dirLabContMargin:{marginRight:20},directionIcon:{width:16,height:16,marginBottom:-2,marginRight:4},labelMargin:{marginBottom:20,marginRight:32}},ms=Object(p.a)(us),hs=["Month","Week","Day"],bs=function(e){var t=e.handleSetRange,n=ms(),a=Object(r.useState)("Day"),i=Object(c.a)(a,2),o=i[0],l=i[1],s=ds.a(o);return Object(We.jsxs)("div",{className:E()(n.titleWrapper),children:[Object(We.jsx)("div",{className:n.titleAndButtonsContainer,children:Object(We.jsx)(Ue,{className:n.h4,children:"System performance"})}),Object(We.jsx)("div",{className:n.navContainer,children:hs.map((function(e,r){return Object(We.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)}))})]})};tl.a.config({ROUNDING_MODE:tl.a.ROUND_HALF_UP});var js=B.a(R.a("fiat")),ps=Object(p.a)(us),fs=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?Il()(t):Il()();return n.subtract(e,"second")},Os={Day:{left:gs(172800,Il()()),right:gs(86400,Il()())},Week:{left:gs(1209600,Il()()),right:gs(604800,Il()())},Month:{left:gs(5184e3,Il()()),right:gs(2592e3,Il()())}},xs=x()(Yl||(Yl=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"]))),vs=function(e,t){return e+Number.parseFloat(t.commissionPercentage)*Number.parseFloat(t.fiat)},ys=function(){var e,t,n,a=ps(),i=Object(r.useState)("Day"),o=Object(c.a)(i,2),l=o[0],d=o[1],m=Object(u.c)(xs),b=m.data,j=m.loading,p=vl("locale")(null===b||void 0===b?void 0:b.config).fiatCurrency,f=vl("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&&Il.a.utc(t.created).utcOffset(f).isBetween(Os[l].left,Os[l].right):null===t.error&&Il.a.utc(t.created).utcOffset(f).isBetween(Os[l].right,Il()()))}},O=function(e){if(e.fiatCode===p)return e;var t=Tr.a(z.a("code",e.fiatCode))(b.fiatRates),n=Tr.a(z.a("code",p))(b.fiatRates).rate/t.rate;return Object(s.a)(Object(s.a)({},e),{},{fiat:parseFloat(e.fiat)*n})},x=B.a(O)(W.a(g(!1),null!==(e=null===b||void 0===b?void 0:b.transactions)&&void 0!==e?e:[])),v=B.a(O)(W.a(g(!0),null!==(t=null===b||void 0===b?void 0:b.transactions)&&void 0!==t?t:[])),y=function(e){var t=El.a(fs(e)),n=Fl.a(vs,0,e);return new tl.a(n+t)},w=function(){var e=Ll.a(z.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(M.a)(n,a.percentDown,C<0),Object(M.a)(n,a.percentUp,C>0),Object(M.a)(n,a.percentNeutral,0===C),n);return Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(bs,{handleSetRange:d}),!j&&Object(We.jsxs)(We.Fragment,{children:[Object(We.jsxs)(h.a,{container:!0,spacing:2,children:[Object(We.jsx)(h.a,{item:!0,xs:3,children:Object(We.jsx)(ss,{info:gn.a(x),label:"transactions"})}),Object(We.jsx)(h.a,{item:!0,xs:3,children:Object(We.jsx)(ss,{info:new tl.a(El.a(js(x))).toFormat(2),label:"".concat(null===b||void 0===b?void 0:b.config.locale_fiatCurrency," volume")})})]}),Object(We.jsx)(h.a,{container:!0,className:a.gridContainer,children:Object(We.jsxs)(h.a,{item:!0,xs:12,children:[Object(We.jsx)(tt,{children:"Transactions"}),Object(We.jsx)(ls,{timeFrame:l,data:x,timezone:f})]})}),Object(We.jsxs)(h.a,{container:!0,className:a.gridContainer,children:[Object(We.jsxs)(h.a,{item:!0,xs:8,children:[Object(We.jsx)(tt,{className:a.labelMargin,children:"Profit from commissions"}),Object(We.jsxs)("div",{className:a.profitContainer,children:[Object(We.jsx)("div",{className:a.profitLabel,children:"".concat(y(x).toFormat(2)," ").concat(null===b||void 0===b?void 0:b.config.locale_fiatCurrency)}),Object(We.jsxs)("div",{className:E()(k),children:[0===C?Object(We.jsx)($l,{className:a.directionIcon}):C>0?Object(We.jsx)(Gl,{className:a.directionIcon}):Object(We.jsx)(Al,{className:a.directionIcon}),"".concat(new tl.a(C).toFormat(2),"%")]})]}),Object(We.jsx)(cs,{timeFrame:l,data:x,previousTimeData:v,previousProfit:y(v)})]}),Object(We.jsxs)(h.a,{item:!0,xs:4,children:[Object(We.jsxs)(h.a,{container:!0,children:[Object(We.jsx)(h.a,{item:!0,children:Object(We.jsx)(tt,{className:a.labelMargin,children:"Direction"})}),Object(We.jsxs)(h.a,{item:!0,className:E()(a.directionLabelContainer,a.dirLabContMargin),children:[Object(We.jsx)("div",{className:a.outSquare}),Object(We.jsx)(et,{className:a.directionLabel,children:"Out"})]}),Object(We.jsxs)(h.a,{item:!0,className:a.directionLabelContainer,children:[Object(We.jsx)("div",{className:a.inSquare}),Object(We.jsx)(et,{className:a.directionLabel,children:"In"})]})]}),Object(We.jsx)(h.a,{item:!0,xs:!0,children:Object(We.jsx)(Zl,{cashIn:w().cashIn,cashOut:w().cashOut})})]})]})]})]})},ws=Object(p.a)(Jc),Cs=function(){var e=ws();return Object(We.jsx)(h.a,{item:!0,xs:12,className:e.displayFlex,children:Object(We.jsx)("div",{className:e.card,children:Object(We.jsx)(ys,{})})})},ks=n(884),Ss=Object.freeze({DEFAULT:"default",SHRUNK:"shrunk",EXPANDED:"expanded"}),Ns={card:{wordWrap:"break-word",boxShadow:"0 0 4px 0 rgba(0, 0, 0, 0.08)",borderRadius:12,padding:24,backgroundColor:Z}},Is=Object(p.a)(Ns),Es=function(e){var t=e.className,n=e.state,r=e.shrunkComponent,a=e.children,i=Is();return Object(We.jsx)(h.a,{item:!0,className:E()(t,i.card),children:n===Ss.SHRUNK?r:a})},Fs={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"}},Ls=n(866),Ps=n(883),Ds=n(159);function Bs(){return(Bs=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 Rs(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 As=r.createElement("desc",null,"Created with Sketch."),Ts=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 Ws(e,t){var n=e.title,a=e.titleId,i=Rs(e,["title","titleId"]);return r.createElement("svg",Bs({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,As,Ts)}var zs=r.forwardRef(Ws);n.p;function Ms(){return(Ms=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:"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 Hs(e,t){var n=e.title,a=e.titleId,i=$s(e,["title","titleId"]);return r.createElement("svg",Ms({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,qs)}var Vs,Us=r.forwardRef(Hs),Ys=(n.p,Object(p.a)(Fs)),Gs={error:Object(We.jsx)(tn,{style:{height:20,width:20,marginRight:12}}),fiatBalance:Object(We.jsx)(Us,{style:{height:18,width:18,marginRight:14}})},Xs={error:"/maintenance/machine-status",fiatBalance:"/maintenance/cash-cassettes",cryptoBalance:"/maintenance/funding"},_s=function(e){var t=e.numToRender,n=e.alerts,r=e.machines,a=Object(w.h)(),i=Ys(),o=Ds.a(0,t,n);return Object(We.jsx)(Ls.a,{dense:!0,className:i.table,children:o.map((function(e,t){return Object(We.jsxs)(Ps.a,{children:[Gs[e.type]||Object(We.jsx)(Rt,{style:{height:23,width:23,marginRight:8}}),Object(We.jsx)(Ge,{className:i.listItemText,children:"".concat(e.message).concat(e.detail.deviceId&&" - "+r[e.detail.deviceId])}),Object(We.jsx)(zs,{className:i.linkIcon,onClick:function(){return a.push(Xs[e.type]||"/dashboard")}})]},t)}))})},Zs=x()(Vs||(Vs=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"]))),Qs=Object(p.a)(Fs),Ks=function(e){var t,n,r,a=e.onReset,i=e.onExpand,o=e.size,c=Qs(),l=o===Ss.EXPANDED,s=Object(u.c)(Zs).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,j=(r={},Object(M.a)(r,c.alertsTableContainer,!l),Object(M.a)(r,c.expandedAlertsTableContainer,l),r);return Object(We.jsxs)(We.Fragment,{children:[Object(We.jsxs)("div",{className:c.container,children:[Object(We.jsx)(Ue,{className:c.h4,children:"Alerts (".concat(b,")")}),l&&Object(We.jsx)(et,{className:c.upperButtonLabel,children:Object(We.jsx)(ks.a,{onClick:a,size:"small",disableRipple:!0,disableFocusRipple:!0,className:c.button,children:"Show less"})})]}),Object(We.jsx)(h.a,{className:E()(j),container:!0,spacing:1,children:Object(We.jsxs)(h.a,{item:!0,xs:12,children:[!d.length&&Object(We.jsx)(et,{className:c.noAlertsLabel,children:"No new alerts. Your system is running smoothly."}),Object(We.jsx)(_s,{numToRender:l?d.length:3,alerts:d,machines:m})]})}),!l&&b>3&&Object(We.jsx)(h.a,{item:!0,xs:12,children:Object(We.jsx)(et,{className:c.centerLabel,children:Object(We.jsx)(ks.a,{onClick:function(){return i("alerts")},size:"small",disableRipple:!0,disableFocusRipple:!0,className:c.button,children:"Show all (".concat(d.length,")")})})})]})},Js=n(887),ed=n(890),td=n(885),nd=n(886),rd=n(888),ad=n(889),id={error:Q,warning:"#ff7311",success:ne,neutral:J},od={error:K,warning:"#fbf3ec",success:V,neutral:Y},cd=Object(p.a)({root:{borderRadius:4,marginTop:4,marginRight:2,marginBottom:4,marginLeft:2,height:24,backgroundColor:function(e){var t=e.type;return od[t]}},label:{fontSize:ye,fontWeight:Se,fontFamily:Ne,paddingRight:4,paddingLeft:4,color:function(e){var t=e.type;return id[t]}}}),ld=function(e){var t=e.status,n=cd({type:t.type});return Object(We.jsx)(Sa.a,{type:t.type,label:t.label,classes:n})},sd=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(We.jsxs)("div",{children:[Object(We.jsx)(ld,{status:n}),t.length>1&&Object(We.jsx)(ld,{status:r})]})};function dd(){return(dd=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 ud(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 md=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 bd(e,t){var n=e.title,a=e.titleId,i=ud(e,["title","titleId"]);return r.createElement("svg",dd({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,md,hd)}var jd,pd=r.forwardRef(bd),fd=(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}}),gd=Object(p.a)(fd),Od=Object(Na.a)({root:{borderBottom:"4px solid white",padding:0,paddingLeft:15}})(td.a),xd=Object(Na.a)({root:{borderBottom:"4px solid white",padding:0,paddingLeft:15,backgroundColor:"white"}})(td.a),vd=function(e){var t=e.machines,n=e.numToRender,r=gd(),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(We.jsx)(Je,{className:r.error,children:"".concat(n,"%")}):Object(We.jsx)(Je,{children:"".concat(n,"%")})},c=function(e){var t=e.name,n=e.deviceId;return a.push("/machines/".concat(n),{selectedMachine:t})};return Object(We.jsx)(nd.a,{className:r.table,children:Object(We.jsxs)(Js.a,{children:[Object(We.jsx)(rd.a,{children:Object(We.jsxs)(ad.a,{children:[Object(We.jsx)(xd,{children:Object(We.jsx)("div",{className:r.header,children:Object(We.jsx)(tt,{className:r.label,children:"Machines"})})}),Object(We.jsx)(xd,{children:Object(We.jsx)("div",{className:"".concat(r.header," ").concat(r.statusHeader),children:Object(We.jsx)(tt,{className:r.label,children:"Status"})})}),Object(We.jsx)(xd,{children:Object(We.jsxs)("div",{className:r.header,children:[Object(We.jsx)(Kc,{}),Object(We.jsx)(tt,{className:r.label,children:" 1"})]})}),Object(We.jsx)(xd,{children:Object(We.jsxs)("div",{className:r.header,children:[Object(We.jsx)(Kc,{}),Object(We.jsx)(tt,{className:r.label,children:" 2"})]})})]})}),Object(We.jsx)(ed.a,{children:t.map((function(e,t){return t<n?Object(We.jsxs)(ad.a,{onClick:function(){return c(e)},className:E()(r.row),children:[Object(We.jsxs)(Od,{align:"left",className:r.machineNameWrapper,children:[Object(We.jsx)(Je,{children:e.name}),Object(We.jsx)(pd,{className:E()(r.machineRedirectIcon,r.clickableRow),onClick:function(){return c(e)}})]}),Object(We.jsx)(Od,{children:Object(We.jsx)(ld,{status:e.statuses[0]})}),Object(We.jsx)(Od,{align:"left",children:o(e.cassette1)}),Object(We.jsx)(Od,{align:"left",children:o(e.cassette2)})]},e.deviceId+t):null}))})]})})},yd=Object(p.a)(fd),wd=x()(jd||(jd=Object(l.a)(["\n query getData {\n machines {\n name\n deviceId\n cashbox\n cassette1\n cassette2\n statuses {\n label\n type\n }\n }\n serverVersion\n uptime {\n name\n state\n uptime\n }\n }\n"]))),Cd=function(e){var t,n,r=e.onReset,a=e.onExpand,i=e.size,o=yd(),c=Object(u.c)(wd),l=c.data,s=c.loading,d=null!==(t=T.a(["machines"])(l))&&void 0!==t?t:[],m=i===Ss.EXPANDED,b=(n={},Object(M.a)(n,o.machinesTableContainer,!m),Object(M.a)(n,o.expandedMachinesTableContainer,m),n);return Object(We.jsxs)(We.Fragment,{children:[Object(We.jsxs)("div",{className:o.container,children:[Object(We.jsx)(Ue,{className:o.h4,children:"System status"})," ",m&&Object(We.jsx)(et,{className:o.upperButtonLabel,children:Object(We.jsx)(ks.a,{onClick:r,size:"small",disableRipple:!0,disableFocusRipple:!0,className:o.button,children:"Show less"})})]}),!s&&Object(We.jsxs)(We.Fragment,{children:[Object(We.jsxs)(h.a,{container:!0,spacing:1,children:[Object(We.jsxs)(h.a,{item:!0,xs:4,children:[Object(We.jsx)(Je,{className:o.tl2,children:null===l||void 0===l?void 0:l.serverVersion}),Object(We.jsx)(et,{className:o.label1,children:" server version"})]}),Object(We.jsx)(h.a,{item:!0,xs:4})]}),Object(We.jsx)(h.a,{container:!0,spacing:1,className:E()(b),children:Object(We.jsx)(h.a,{item:!0,xs:12,children:Object(We.jsx)(vd,{numToRender:m?1/0:4,machines:d})})}),!m&&d.length>4&&Object(We.jsx)(h.a,{item:!0,xs:12,children:Object(We.jsx)(et,{className:o.centerLabel,children:Object(We.jsx)(ks.a,{onClick:function(){return a()},size:"small",disableRipple:!0,disableFocusRipple:!0,className:o.button,children:"Show all (".concat(d.length,")")})})})]})]})},kd=Object(p.a)(Jc),Sd=function(e){var t=e.title,n=e.buttonName,r=e.onUnshrink,a=kd();return Object(We.jsxs)("div",{className:a.container,children:[Object(We.jsx)(Ue,{className:a.h4,children:t}),Object(We.jsx)(et,{className:a.upperButtonLabel,children:Object(We.jsx)(ks.a,{onClick:r,size:"small",disableRipple:!0,disableFocusRipple:!0,className:a.button,children:n})})]})},Nd=function(){var e,t,n=kd(),a=Object(r.useState)(Ss.DEFAULT),i=Object(c.a)(a,2),o=i[0],l=i[1],s=Object(r.useState)(Ss.DEFAULT),d=Object(c.a)(s,2),u=d[0],m=d[1],b=function(){m(Ss.DEFAULT),l(Ss.DEFAULT)};return Object(We.jsx)(h.a,{item:!0,xs:12,className:n.displayFlex,children:Object(We.jsx)("div",{style:{flex:1,display:"flex",flexDirection:"column"},children:Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(Es,{className:E()((e={},Object(M.a)(e,n.alertsCard,u!==Ss.SHRUNK),Object(M.a)(e,n.shrunkCard,u===Ss.SHRUNK),Object(M.a)(e,n.expandedCard,u===Ss.EXPANDED),e)),state:u,shrunkComponent:Object(We.jsx)(Sd,{title:"Alerts",buttonName:"Show alerts",onUnshrink:b}),children:Object(We.jsx)(Ks,{onExpand:function(){m(Ss.EXPANDED),l(Ss.SHRUNK)},onReset:b,size:u})}),Object(We.jsx)(Es,{className:E()((t={},Object(M.a)(t,n.shrunkCard,o===Ss.SHRUNK),Object(M.a)(t,n.systemStatusCard,o!==Ss.SHRUNK),Object(M.a)(t,n.expandedCard,u===Ss.EXPANDED),t)),state:o,shrunkComponent:Object(We.jsx)(Sd,{title:"System status",buttonName:"Show machines",onUnshrink:b}),children:Object(We.jsx)(Cd,{onExpand:function(){l(Ss.EXPANDED),m(Ss.SHRUNK)},onReset:b,size:o})})]})})})},Id=Object(p.a)(Jc),Ed=function(){var e=Id();return Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(Do,{title:"Dashboard",children:Object(We.jsxs)("div",{className:e.headerLabels,children:[Object(We.jsxs)("div",{className:E()(e.headerLabelContainer,e.headerLabelContainerMargin),children:[Object(We.jsx)(Kc,{}),Object(We.jsx)("span",{className:e.headerLabelSpan,children:"Cash-out"})]}),Object(We.jsxs)("div",{className:e.headerLabelContainer,children:[Object(We.jsx)(Uc,{}),Object(We.jsx)("span",{className:e.headerLabelSpan,children:"Cash-in"})]})]})}),Object(We.jsx)("div",{className:e.root,children:Object(We.jsxs)(h.a,{container:!0,children:[Object(We.jsx)(h.a,{container:!0,direction:"column",item:!0,xs:6,children:Object(We.jsx)(Cs,{})}),Object(We.jsx)(h.a,{container:!0,direction:"column",item:!0,xs:6,children:Object(We.jsx)(Nd,{})})]})}),Object(We.jsx)(Sl,{})]})},Fd=n(947),Ld=n(228),Pd=n.n(Ld),Dd=n(900),Bd=n(402),Rd=n(953),Ad=n(898),Td=n(165),Wd=n(899),zd=n(948),Md="You have unsaved changes on this page. Are you sure you want to leave?",$d=function(e){var t=e.message,n=void 0===t?Md:t,a=Object(jn.e)(),i=a.dirty&&0===a.submitCount;Object(r.useEffect)((function(){window.onbeforeunload=i?o:void 0}),[i]);var o=function(){return Md};return Object(We.jsx)(w.a,{when:i,message:n})},qd=n(891),Hd=n(892),Vd=Re.tl2,Ud=Re.label1,Yd={size:function(e){var t=e.size;return Hr(t)},bold:Vr,header:{extend:Vd,backgroundColor:Le,height:Ie,textAlign:"left",color:Z,display:"flex",alignItems:"center"},doubleHeader:{extend:Vd,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:Ud,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:Pe},trAdding:{backgroundColor:De},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}},Gd=Object(p.a)(Yd),Xd=function(e){var t=e.children,n=e.className,r=Object($.a)(e,["children","className"]);return Object(We.jsx)("div",Object(s.a)(Object(s.a)({className:E()(n)},r),{},{children:t}))},_d=function(e){var t=e.children,n=e.className,r=Gd();return Object(We.jsx)("div",{className:E()(n,r.header),children:t})},Zd=function(e){var t=e.children,n=e.className,r=Gd();return Object(We.jsx)("div",{className:E()(n,r.doubleHeader),children:t})},Qd=function(e){var t=e.children,n=e.className;return Object(We.jsx)("div",{className:E()(n),children:t})},Kd=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=Gd({textAlign:s,width:o,size:c}),m=(t={},Object(M.a)(t,u.td,!0),Object(M.a)(t,u.tdHeader,r),Object(M.a)(t,u.actionCol,d),Object(M.a)(t,u.size,!r),Object(M.a)(t,u.bold,!r&&l),t);return Object(We.jsx)("div",{className:E()(a,m),children:n})},Jd=function(e){var t=e.children,n=Object($.a)(e,["children"]);return Object(We.jsx)(Kd,Object(s.a)(Object(s.a)({header:!0},n),{},{children:t}))},eu=function(e){var t=e.title,n=e.children,r=e.className,a=e.width,i=Gd({width:a});return Object(We.jsxs)("div",{className:E()(r,i.thDoubleLevel),children:[Object(We.jsx)("div",{children:t}),Object(We.jsx)("div",{children:n})]})},tu=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=Gd({size:c}),d={root:s.cardContentRoot},u=(t={},Object(M.a)(t,s.tr,!0),Object(M.a)(t,s.trError,r),Object(M.a)(t,s.card,!0),Object(M.a)(t,s.trAdding,l),Object(M.a)(t,"className",o),t);return Object(We.jsx)(We.Fragment,{children:Object(We.jsx)(qd.a,{className:E()(u,o),onClick:n,children:Object(We.jsxs)(Hd.a,{classes:d,children:[Object(We.jsx)("div",{className:s.mainContent,children:i}),r&&Object(We.jsx)("div",{className:s.errorContent,children:a})]})})})},nu=a.a.createContext(),ru=n(894),au=n(895),iu=n(893),ou=n(225),cu=ou.create({checkTypes:!1,env:ou.env}),lu=cu.compose(cu.joinWith(""))(il.a(0,cu.toLower)),su=cu.compose(cu.joinWith(""))(il.a(0,cu.toUpper)),du=cu.compose(su)(cu.toLower),uu=L.a(cu.splitOn(" "),iu.a(/([A-Z])/g," $1"),lu),mu=L.a(cu.joinWith(" "),cu.map(du),uu),hu=function(e,t,n){return 1===parseInt(e)?t:n},bu=function(){var e=Object(r.useContext)(nu),t=e.elements,n=e.enableEdit,a=e.editWidth,i=e.enableDelete,o=e.deleteWidth,l=e.enableToggle,s=e.toggleWidth,d=e.DEFAULT_COL_SIZE,u=function(e,t){var n=e.name,r=e.width,a=void 0===r?d:r,i=e.header,o=e.textAlign;return Object(We.jsx)(Kd,{header:!0,width:a,textAlign:o,children:i||mu(n)},t)},m=function(e){var t=Ll.a(Ao.a("doubleHeader"))(e),n=Object(c.a)(t,2),r=n[0],a=n[1];if(!r.length)return[e,_d];var i=ru.a(r[0],e),o=L.a(El.a,B.a(T.a(["width"])))(r);return[au.a(i,{width:o,elements:r,name:r[0].doubleHeader},a),Zd]}(t),h=Object(c.a)(m,2),b=h[0],j=h[1];return Object(We.jsxs)(j,{children:[b.map((function(e,t){var n=e.width,r=e.elements,a=e.name;return r&&r.length?Object(We.jsx)(eu,{width:n,title:a,children:r.map(u)},t):u(e,t)})),n&&Object(We.jsx)(Kd,{header:!0,width:a,textAlign:"center",children:"Edit"}),i&&Object(We.jsx)(Kd,{header:!0,width:o,textAlign:"center",children:"Delete"}),l&&Object(We.jsx)(Kd,{header:!0,width:s,textAlign:"center",children:"Enable"})]})},ju=n(897),pu=n(896),fu=Object(p.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}}),gu=function(e){var t=e.children,n=e.close,r=fu();return Object(We.jsxs)("div",{className:r.titleSection,children:[t,n&&Object(We.jsx)(tr,{size:16,"aria-label":"close",onClick:n,className:r.closeButton,children:Object(We.jsx)(gi,{})})]})},Ou=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=fu();return Object(We.jsxs)(un.a,{open:a,"aria-labelledby":"form-dialog-title",children:[Object(We.jsx)(gu,{close:function(){return o()},children:Object(We.jsx)(Ue,{className:h.title,children:n})}),m&&Object(We.jsx)(gu,{children:Object(We.jsx)(Fo,{children:m.split(":").map((function(e){return Object(We.jsxs)(We.Fragment,{children:[e,Object(We.jsx)("br",{})]})}))})}),Object(We.jsx)(mn.a,{className:h.content,children:d&&Object(We.jsx)(Ge,{children:d})}),Object(We.jsx)(pu.a,{className:h.actions,children:Object(We.jsx)(Tn,{onClick:i,children:"Confirm"})})]})},xu=n(414);function vu(){return(vu=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 yu(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 wu=r.createElement("desc",null,"Created with Sketch."),Cu=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"})),ku=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 Su(e,t){var n=e.title,a=e.titleId,i=yu(e,["title","titleId"]);return r.createElement("svg",vu({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,wu,Cu,ku)}var Nu=r.forwardRef(Su),Iu=(n.p,Re.p),Eu=152,Fu={selectedItem:{width:111,display:"block",whiteSpace:"nowrap",overflow:"hidden"},select:{width:Eu,zIndex:2,"& label":{extend:Re.label1,color:se,paddingLeft:10},"& button":{extend:Iu,position:"relative",border:0,backgroundColor:ae,width:Eu,padding:[[6,0,6,12]],borderRadius:20,lineHeight:"1.14",textAlign:"left",color:se,cursor:"pointer",outline:"0 none"},"& ul":{maxHeight:"200px",width:Eu,overflowY:"auto",position:"absolute",margin:0,borderTop:0,padding:0,borderRadius:[[0,0,8,8]],backgroundColor:ae,outline:"0 none","& li":{extend:Iu,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]]}}},Lu=Object(p.a)(Fu);var Pu=function(e){var t,n=e.className,r=e.label,a=e.items,i=Object($.a)(e,["className","label","items"]),o=Lu(),c=Object(xu.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,j=(t={},Object(M.a)(t,o.select,!0),Object(M.a)(t,o.selectFiltered,d!==i.default),Object(M.a)(t,o.open,l),t);return Object(We.jsxs)("div",{className:E()(j,n),children:[Object(We.jsx)("label",Object(s.a)(Object(s.a)({},m()),{},{children:r})),Object(We.jsxs)("button",Object(s.a)(Object(s.a)({},u()),{},{children:[Object(We.jsx)("span",{className:o.selectedItem,children:d.display}),Object(We.jsx)(Nu,{})]})),Object(We.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(We.jsx)("li",Object(s.a)(Object(s.a)({},b({code:n,index:t})),{},{children:Object(We.jsx)("span",{children:r})}),"".concat(n).concat(t))}))}))]})};function Du(){return(Du=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 Bu(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 Ru=r.createElement("defs",null,r.createElement("path",{id:"a",d:"M0 0h22v22H0z"})),Au=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 Tu(e,t){var n=e.title,a=e.titleId,i=Bu(e,["title","titleId"]);return r.createElement("svg",Du({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,Ru,Au)}var Wu=r.forwardRef(Tu);n.p;function zu(){return(zu=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 Mu(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 $u=r.createElement("desc",null,"Created with Sketch."),qu=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 Hu(e,t){var n=e.title,a=e.titleId,i=Mu(e,["title","titleId"]);return r.createElement("svg",zu({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,$u,qu)}var Vu=r.forwardRef(Hu);n.p;function Uu(){return(Uu=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 Yu(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 Gu=r.createElement("desc",null,"Created with Sketch."),Xu=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 _u(e,t){var n=e.title,a=e.titleId,i=Yu(e,["title","titleId"]);return r.createElement("svg",Uu({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,Gu,Xu)}var Zu=r.forwardRef(_u);n.p;function Qu(){return(Qu=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 Ku(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 Ju=r.createElement("desc",null,"Created with Sketch."),em=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 tm(e,t){var n=e.title,a=e.titleId,i=Ku(e,["title","titleId"]);return r.createElement("svg",Qu({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,Ju,em)}var nm,rm,am,im=r.forwardRef(tm),om=(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?"end":t}},suffix:{margin:[[0,0,0,7]]},size:function(e){var t=e.size;return Hr(t)},bold:Vr}),cm=Object(p.a)(om),lm=function(e){var t=e.disabled,n=e.editing,a=cm(),i=Object(jn.e)(),o=i.values,l=i.submitForm,s=i.resetForm,d=Object(r.useContext)(nu),u=d.editWidth,m=d.onEdit,h=d.enableEdit,b=d.enableDelete,j=d.disableRowEdit,p=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||j&&j(o),S=Object(r.useState)(!1),N=Object(c.a)(S,2),I=N[0],E=N[1];return Object(We.jsxs)(We.Fragment,{children:[n&&Object(We.jsxs)(Kd,{textAlign:"center",width:w,children:[Object(We.jsx)(or,{className:a.saveButton,type:"submit",color:"primary",onClick:l,children:"Save"}),!v&&Object(We.jsx)(or,{color:"secondary",onClick:function(){y(),s()},children:"Cancel"})]}),!n&&h&&Object(We.jsx)(Kd,{textAlign:"center",width:u,children:Object(We.jsx)(tr,{disabled:k,className:a.editButton,onClick:function(){return m&&m(o.id)},children:k?Object(We.jsx)(Zu,{}):Object(We.jsx)(im,{})})}),!n&&b&&Object(We.jsxs)(Kd,{textAlign:"center",width:f,children:[Object(We.jsx)(tr,{disabled:t,onClick:function(){E(!0)},children:t?Object(We.jsx)(Wu,{}):Object(We.jsx)(Vu,{})}),Object(We.jsx)(Ou,{open:I,setDeleteDialog:E,onConfirmed:function(){p(o.id).then((function(e){D.a(e)||E(!1)}))},onDismissed:function(){E(!1),y()},errorMessage:C})]}),!n&&g&&Object(We.jsx)(Kd,{textAlign:"center",width:x,children:Object(We.jsx)(Ca,{checked:!!o.active,value:!!o.active,disabled:t,onChange:function(){return O(o.id)}})})]})},sm=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,j=a.width,p=a.textAlign,f=a.editingAlign,g=void 0===f?p: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.view,k=void 0===C?function(e){return null===e||void 0===e?void 0:e.toString()}:C,S=a.inputProps,N=void 0===S?{}:S,I=Object(jn.e)().values,E=n&&function(e){return"function"===typeof e?e(I):e}(m),F=!l,L=cm({textAlign:E?g:p,size:h}),P=Object(s.a)({fullWidth:!0,autoFocus:r,size:h,bold:b,textAlign:E?g:p},N);return Object(We.jsxs)(Kd,{className:(t={},Object(M.a)(t,L.extraPaddingRight,i),Object(M.a)(t,L.extraPadding,o),Object(M.a)(t,L.withSuffix,O),t),width:j,size:h,bold:b,textAlign:p,children:[E&&F&&Object(We.jsx)(jn.b,Object(s.a)({name:c,component:d},P)),E&&!F&&Object(We.jsx)(a.input,{name:c}),!E&&I&&Object(We.jsx)("div",{style:w(I,E),children:k(I[c],I)}),O&&Object(We.jsx)(v,{className:L.suffix,style:E?{}:w(I,E),children:O})]})},dm=function(e){var t=e.editing,n=e.disabled,a=e.lastOfGroup,i=e.newRow,o=Object(jn.e)(),l=o.touched,s=o.errors,d=o.values,u=Object(r.useContext)(nu),m=u.elements,h=u.enableEdit,b=u.enableDelete,j=u.error,p=u.enableToggle,f=u.rowSize,g=u.stripeWhen,O=cm(),x=!t&&g&&g(d)?function(e){var t=Ll.a(z.a("stripe",!0))(e),n=Object(c.a)(t,2),r=n[0],a=n[1];if(!r.length)return e;var i=ru.a(r[0],e),o=L.a(El.a,B.a(T.a(["width"])))(r);return au.a(i,{width:o,editable:!1,view:function(){return Object(We.jsx)(Yt,{})}},a)}(m):m,v=Ll.a(Ao.a("doubleHeader"))(m),y=Object(c.a)(v,1)[0],w=(null===y||void 0===y?void 0:y.length)?ru.a(y[0],m):-1,C=(null===y||void 0===y?void 0:y.length)?ru.a(y[y.length-1],m):-1,k=x.findIndex((function(e){return void 0===e.editable||e.editable})),S=Object(M.a)({},O.lastOfGroup,a),N=ju.a(nl.a(l),s),I=N&&nl.a(N).length>0||!!j,F=j||N&&Kl.a(N).join(", ");return Object(We.jsxs)(tu,{className:E()(S),size:f,error:t&&I,newRow:i&&!I,errorMessage:F,children:[x.map((function(e,n){return Object(We.jsx)(sm,{config:e,editing:t,focus:n===k&&t,extraPaddingRight:C===n,extraPadding:w===n},n)})),(h||b||p)&&Object(We.jsx)(lm,{disabled:n,editing:t})]})},um={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"}},mm=Object(p.a)(um),hm=L.a(Fl.a(Bd.a)(0),B.a((function(e){var t;return null!==(t=e.width)&&void 0!==t?t:100}))),bm=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,j=e.error,p=e.rowSize,f=void 0===p?"md":p,g=e.validationSchema,O=e.enableCreate,x=e.enableEdit,v=e.editWidth,y=e.enableDelete,w=e.deleteWidth,C=void 0===w?87:w,k=e.enableToggle,S=e.toggleWidth,N=void 0===S?87:S,I=e.onToggle,E=e.forceDisable,F=e.disableAdd,L=e.initialValues,P=e.setEditing,D=e.shouldOverrideEdit,B=e.editOverride,A=e.stripeWhen,T=e.disableRowEdit,W=e.groupBy,$=e.sortBy,q=e.createText,H=void 0===q?"Add override":q,V=e.forceAdd,U=void 0!==V&&V,Y=e.tbodyWrapperClass,G=Object(r.useState)(null),X=Object(c.a)(G,2),_=X[0],Z=X[1],Q=Object(r.useState)(!1),K=Object(c.a)(Q,2),J=K[0],ee=K[1],te=Object(r.useState)(!1),ne=Object(c.a)(te,2),re=ne[0],ae=ne[1],ie=Object(r.useState)(null),oe=Object(c.a)(ie,2),ce=oe[0],le=oe[1];Object(r.useEffect)((function(){return le(j)}),[j]),Object(r.useEffect)((function(){le(null),ee(U)}),[U]);var se=function(){var e=Object(ec.a)(Jo.a.mark((function e(t){var n,r,a;return Jo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!re){e.next=2;break}return e.abrupt("return");case 2:if(ae(!0),n=g.cast(t),r=Ho.a(z.a("id",n.id))(h),a=-1!==r?Rd.a(r,n,h):Ad.a(n,h),ds.a(h[r],n)){e.next=16;break}return e.prev=7,e.next=10,b(Object(M.a)({},i,a),n);case 10:e.next=16;break;case 12:return e.prev=12,e.t0=e.catch(7),ae(!1),e.abrupt("return");case 16:ee(!1),Z(null),P&&P(!1),ae(!1);case 20:case"end":return e.stop()}}),e,null,[[7,12]])})));return function(t){return e.apply(this,arguments)}}(),de=function(){ee(!1),Z(null),P&&P(!1)},ue=function(){ee(!0),le(null),P&&P(!0,!0)},me=y||k?87:174,he=Mr.a(me)(v),be=(null!==(t=y&&C)&&void 0!==t?t:0)+(null!==(n=x&&he)&&void 0!==n?n:0)+(null!==(a=k&&N)&&void 0!==a?a:0),je=hm(u)+be,pe=mm({width:je}),fe=!h.length&&O&&!J,ge=!E&&!_&&!F&&!J,Oe=J||0!==h.length,xe=$?Wd.a($)(h):h,ve={elements:u,enableEdit:x,onEdit:function(e){if(D&&D(e))return B(e);Z(e),le(null),P&&P(e,!0)},clearError:function(){return le(null)},error:ce,disableRowEdit:T,editWidth:he,enableDelete:y,onDelete:function(e){var t=Td.a((function(t){return t.id===e}),h);return b(Object(M.a)({},i,t))},deleteWidth:C,enableToggle:k,rowSize:f,onToggle:I,toggleWidth:N,actionColSize:be,stripeWhen:A,forceAdd:U,DEFAULT_COL_SIZE:100};return Object(We.jsx)(nu.Provider,{value:ve,children:Object(We.jsxs)("div",{className:pe.wrapper,children:[fe&&ge&&Object(We.jsx)(Ln,{onClick:ue,children:H}),Oe&&Object(We.jsxs)(We.Fragment,{children:[(o||O)&&Object(We.jsxs)("div",{className:pe.outerHeader,children:[o&&l&&Object(We.jsx)(Ke,{className:pe.title,children:o}),o&&!l&&Object(We.jsx)(_e,{className:pe.title,children:o}),O&&ge&&Object(We.jsx)(or,{className:pe.addLink,onClick:ue,children:H})]}),Object(We.jsxs)(Xd,{children:[Object(We.jsx)(bu,{}),Object(We.jsx)("div",{className:Y,children:Object(We.jsxs)(Qd,{children:[J&&Object(We.jsx)(jn.d,{validateOnBlur:!1,validateOnChange:!1,initialValues:Object(s.a)({id:Object(zd.a)()},L),onReset:de,validationSchema:g,onSubmit:se,children:Object(We.jsxs)(jn.c,{children:[Object(We.jsx)($d,{}),Object(We.jsx)(dm,{editing:!0,disabled:E,newRow:!0})]})}),xe.map((function(e,t){var n,r=xe[t+1],a=!!W&&r,i="Function"===Br.a(W)?W:R.a(W),o=a&&i(e)!==i(r);return Object(We.jsx)(jn.d,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,initialValues:e,onReset:de,validationSchema:g,onSubmit:se,children:Object(We.jsxs)(jn.c,{children:[Object(We.jsx)($d,{}),Object(We.jsx)(dm,{lastOfGroup:o,editing:_===e.id,disabled:E||_&&_!==e.id||J})]})},null!==(n=e.id)&&void 0!==n?n:t)}))]})})]})]})]})})},jm=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},vl(e)(a))}))(o);return Object(We.jsx)(bm,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(yl(a.id)(Dd.a(["id2"],a)))}},c))},pm={cashbox:{width:80,height:36}},fm=Object(p.a)(pm),gm=xn.d().shape({name:xn.f().required("Required"),cashbox:xn.c().label("Cashbox").required().integer().min(0).max(1e3),cassette1:xn.c().required("Required").integer().min(0).max(500),cassette2:xn.c().required("Required").integer().min(0).max(500)}),Om=x()(nm||(nm=Object(l.a)(["\n mutation MachineAction(\n $deviceId: ID!\n $action: MachineAction!\n $cashbox: Int!\n $cassette1: Int!\n $cassette2: Int!\n ) {\n machineAction(\n deviceId: $deviceId\n action: $action\n cashbox: $cashbox\n cassette1: $cassette1\n cassette2: $cassette2\n ) {\n deviceId\n cashbox\n cassette1\n cassette2\n }\n }\n"]))),xm=function(e){var t=e.machine,n=e.config,r=e.refetchData,a={machine:t,config:n},i=fm(),o=(null===a||void 0===a?void 0:a.config)&&vl("cashOut")(a.config),l=(null===a||void 0===a?void 0:a.config)&&vl("locale")(a.config),s=null===l||void 0===l?void 0:l.fiatCurrency,d=function(e){return vl(e)(o)},m=function(e){var t=e.deviceId;return!d(t).active},h=[{name:"cashbox",header:"Cashbox",width:240,stripe:!1,view:function(e){return Object(We.jsx)(Ta,{currency:{code:s},notes:e,total:0})},input:qa,inputProps:{decimalPlaces:0}},{name:"cassette1",header:"Cash-out 1",width:265,stripe:!0,view:function(e,t){var n,r=t.deviceId;return Object(We.jsx)(Wa,{className:i.cashbox,denomination:null===(n=d(r))||void 0===n?void 0:n.top,currency:{code:s},notes:e})},input:qa,inputProps:{decimalPlaces:0}},{name:"cassette2",header:"Cash-out 2",width:265,stripe:!0,view:function(e,t){var n,r=t.deviceId;return Object(We.jsx)(Wa,{className:i.cashbox,denomination:null===(n=d(r))||void 0===n?void 0:n.bottom,currency:{code:s},notes:e})},input:qa,inputProps:{decimalPlaces:0}}],b=Object(u.b)(Om,{refetchQueries:function(){return r()}}),j=Object(c.a)(b,2),p=j[0],f=j[1].error;return t.name?Object(We.jsx)(bm,{error:null===f||void 0===f?void 0:f.message,stripeWhen:m,disableRowEdit:m,name:"cashboxes",elements:h,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;return p({variables:{action:"setCassetteBills",deviceId:a,cashbox:i,cassette1:o,cassette2:c}})},validationSchema:gm}):null},vm=n(901),ym={marginLeft:6},wm=Object(We.jsxs)("div",{children:[Object(We.jsx)(Uc,{}),Object(We.jsx)("span",{style:ym,children:"Cash-in"})]}),Cm=Object(We.jsxs)("div",{children:[Object(We.jsx)(Kc,{}),Object(We.jsx)("span",{style:ym,children:"Cash-out"})]}),km=function(e){return function(e){return[{name:"name",width:280,size:"sm",view:function(e){return"".concat(e)}},{header:wm,name:"cashIn",display:"Cash-in",width:130,textAlign:"right",suffix:"%"},{header:Cm,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)},Sm=x()(rm||(rm=Object(l.a)(["\n query getData {\n config\n cryptoCurrencies {\n code\n display\n }\n machines {\n name\n deviceId\n }\n }\n"]))),Nm=x()(am||(am=Object(l.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),Im=function(e){var t=e.name,n=e.id,r=Object(u.c)(Sm),a=r.data,i=r.loading,o=Object(u.b)(Nm,{refetchQueries:function(){return["getData"]}}),l=Object(c.a)(o,1)[0],s=(null===a||void 0===a?void 0:a.config)&&vl(t)(a.config),d=T.a(["fiatCurrency"])(vl(ml)(null===a||void 0===a?void 0:a.config)),m=function(){if(i||!n||!s)return[];var e={};vm.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 z.a("machine",e)},r=s.overrides?W.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};vm.a(o)(r);var c=s.overrides?W.a(t(n))(s.overrides):[];return vm.a(o)(c),Kl.a(e)}();return Object(We.jsx)(bm,{name:"overrides",save:function(e){var n=yl(t)(e);return l({variables:{config:n}})},data:m,elements:km(d)})},Em=n(391),Fm=n(902),Lm=n(903),Pm=n(904),Dm=function(e){return Fm.a(Lm.a(R.a("utcOffset")),B.a((function(t){return{utcOffset:t.utcOffset,dstOffset:t.dstOffset,utcOffsetStr:t.utcOffsetStr,dstOffsetStr:t.dstOffsetStr,cities:B.a((function(e){var t=Pm.a("/",e.name);return{region:t[0],city:iu.a(/_/g," ",t[1]),country:e.country}}),W.a((function(e){return $r.a("utcOffset",t,e)&&$r.a("dstOffset",t,e)&&!D.a(e.country)&&!F.a("Etc",e.name)&&F.a("/",e.name)}),e))}}),function(e){return B.a((function(e){return{utcOffset:e.utcOffset,dstOffset:e.dstOffset,utcOffsetStr:e.utcOffsetStr,dstOffsetStr:e.dstOffsetStr}}),Em.a((function(e){return[e.utcOffset,e.dstOffset,e.utcOffsetStr,e.dstOffsetStr]}),e))}(e)))},Bm=function(e){return B.a((function(e){return{label:(t=e,"(UTC".concat(t.utcOffsetStr,") ").concat(B.a((function(e){return e.city}),t.cities).join(", "))),code:"".concat(e.utcOffset,":").concat(e.dstOffset)};var t}),function(e){var t=Dm(e),n=W.a((function(e){return!zr.a(e.cities)}),t);return B.a((function(e){return Object(s.a)(Object(s.a)({},e),{},{cities:Em.a(R.a("country"),Em.a(R.a("city"),e.cities))})}),n)}(e))},Rm=function(e,t,n){var r=t.split(":")[1];return Il.a.utc(e).utcOffset(parseInt(r)).format(n)},Am={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"}},Tm=Object(p.a)(Am),Wm=function(e){var t=e.data,n=e.timezone,r=Tm();return Object(We.jsxs)("div",{className:r.row,children:[Object(We.jsxs)("div",{className:r.rowItem,children:[Object(We.jsx)(nt,{className:r.label3,children:"Paired at"}),Object(We.jsx)(Ge,{children:t.pairedAt?Rm(t.pairedAt,n,"YYYY-MM-DD HH:mm:ss"):""})]}),Object(We.jsxs)("div",{className:r.rowItem,children:[Object(We.jsx)(nt,{className:r.label3,children:"Machine model"}),Object(We.jsx)(Ge,{children:t.model})]}),Object(We.jsxs)("div",{className:r.rowItem,children:[Object(We.jsx)(nt,{className:r.label3,children:"Software version"}),Object(We.jsx)(Ge,{children:t.version})]})]})},zm=Object(p.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}}),Mm=function(e){var t=e.children,n=e.onClose,r=zm();return Object(We.jsxs)("div",{className:r.dialogTitle,children:[t,n&&Object(We.jsx)(tr,{size:16,"aria-label":"close",onClick:n,children:Object(We.jsx)(gi,{})})]})},$m=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,j=e.onConfirmed,p=e.onDissmised,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","onDissmised","initialValue","disabled"]),y=zm(),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(We.jsxs)(un.a,Object(s.a)(Object(s.a)({open:o,"aria-labelledby":"form-dialog-title"},v),{},{children:[Object(We.jsx)(Mm,{id:"customized-dialog-title",onClose:function(){S(""),F(!1),p()},children:Object(We.jsx)(Ue,{children:n})}),i&&Object(We.jsx)(Mm,{children:Object(We.jsx)(Fo,{children:i.split(":").map((function(e){return Object(We.jsxs)(We.Fragment,{children:[e,Object(We.jsx)("br",{})]})}))})}),Object(We.jsxs)(mn.a,{className:y.dialogContent,children:[m&&Object(We.jsx)(Ge,{children:m}),Object(We.jsx)(Gr,{disabled:x,label:b,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(We.jsx)(pu.a,{className:y.dialogActions,children:Object(We.jsx)(Tn,{color:"green",disabled:L,onClick:function(){return j(k)},children:"Confirm"})})]}))}));function qm(){return(qm=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 Vm=r.createElement("desc",null,"Created with Sketch."),Um=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 Ym(e,t){var n=e.title,a=e.titleId,i=Hm(e,["title","titleId"]);return r.createElement("svg",qm({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,Vm,Um)}var Gm=r.forwardRef(Ym);n.p;function Xm(){return(Xm=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 _m(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 Zm=r.createElement("desc",null,"Created with Sketch."),Qm=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 Km(e,t){var n=e.title,a=e.titleId,i=_m(e,["title","titleId"]);return r.createElement("svg",Xm({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,Zm,Qm)}var Jm=r.forwardRef(Km);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 th(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 nh=r.createElement("desc",null,"Created with Sketch."),rh=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 ah(e,t){var n=e.title,a=e.titleId,i=th(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,nh,rh)}var ih=r.forwardRef(ah);n.p;function oh(){return(oh=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 lh=r.createElement("desc",null,"Created with Sketch."),sh=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 dh(e,t){var n=e.title,a=e.titleId,i=ch(e,["title","titleId"]);return r.createElement("svg",oh({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,sh)}var uh=r.forwardRef(dh);n.p;function mh(){return(mh=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 hh(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 bh=r.createElement("desc",null,"Created with Sketch."),jh=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 ph(e,t){var n=e.title,a=e.titleId,i=hh(e,["title","titleId"]);return r.createElement("svg",mh({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,bh,jh)}var fh=r.forwardRef(ph);n.p;function gh(){return(gh=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 Oh(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 xh=r.createElement("desc",null,"Created with Sketch."),vh=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=Oh(e,["title","titleId"]);return r.createElement("svg",gh({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,xh,vh)}var wh=r.forwardRef(yh);n.p;function Ch(){return(Ch=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 kh(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 Sh=r.createElement("desc",null,"Created with Sketch."),Nh=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 Ih(e,t){var n=e.title,a=e.titleId,i=kh(e,["title","titleId"]);return r.createElement("svg",Ch({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,Sh,Nh)}var Eh=r.forwardRef(Ih);n.p;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 Lh(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 Ph=r.createElement("desc",null,"Created with Sketch."),Dh=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 Bh(e,t){var n=e.title,a=e.titleId,i=Lh(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,Ph,Dh)}var Rh,Ah,Th=r.forwardRef(Bh),Wh=(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}}),zh=Object(p.a)(Wh),Mh=x()(Rh||(Rh=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"]))),$h=x()(Ah||(Ah=Object(l.a)(["\n query getMachine($deviceId: ID!) {\n machine(deviceId: $deviceId) {\n latestEvent {\n note\n }\n }\n }\n"]))),qh=function(e){var t=e.children,n=zh();return Object(We.jsx)("div",{className:n.label,children:t})},Hh=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],j=zh(),p=Object(We.jsx)("span",{className:j.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)($h,{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)?p: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)(Mh,{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(We.jsxs)("div",{children:[Object(We.jsx)(qh,{children:"Actions"}),Object(We.jsxs)("div",{className:j.stack,children:[Object(We.jsx)(Me,{color:"primary",className:j.mr,Icon:Jm,InverseIcon:Gm,disabled:C,onClick:function(){return l({command:"rename",display:"Rename",confirmationMessage:"Write the new name for this machine"})},children:"Rename"}),Object(We.jsx)(Me,{color:"primary",className:j.mr,Icon:Th,InverseIcon:Eh,disabled:C,onClick:function(){return l({command:"unpair",display:"Unpair"})},children:"Unpair"}),Object(We.jsx)(Me,{color:"primary",className:j.mr,Icon:uh,InverseIcon:ih,disabled:C,onClick:function(){return l({command:"reboot",display:"Reboot"})},children:"Reboot"}),Object(We.jsx)(Me,{color:"primary",className:j.mr,Icon:wh,InverseIcon:fh,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(We.jsx)(Me,{color:"primary",className:j.inlineChip,Icon:uh,InverseIcon:ih,disabled:C,onClick:function(){O(),l({command:"restartServices",display:"Restart services for"})},children:"Restart Services"})]}),Object(We.jsx)($m,{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})})},onDissmised:function(){l({command:null}),b(null)}})]})})),Vh=Object(p.a)(Am),Uh=function(e){if(!e)return null;var t=Il()().diff(e,"seconds");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")},Yh=function(e){var t=e.data,n=e.onActionSuccess,r=Vh();return Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)("div",{className:r.row,children:Object(We.jsx)("div",{className:r.rowItem,children:Object(We.jsx)(Ve,{children:t.name})})}),Object(We.jsx)("div",{className:r.row,children:Object(We.jsxs)("div",{className:r.rowItem,children:[Object(We.jsx)(nt,{className:r.label3,children:"Status"}),t&&t.statuses?Object(We.jsx)(ld,{status:t.statuses[0]}):null]})}),Object(We.jsx)("div",{className:r.row,children:Object(We.jsxs)("div",{className:r.rowItem,children:[Object(We.jsx)(nt,{className:r.label3,children:"Last ping"}),Object(We.jsx)(Ge,{children:Uh(t.lastPing)})]})}),Object(We.jsx)("div",{className:r.row,children:Object(We.jsxs)("div",{className:r.rowItem,children:[Object(We.jsx)(nt,{className:r.label3,children:"Network speed"}),Object(We.jsx)(Ge,{children:t.downloadSpeed?new tl.a(t.downloadSpeed).toFixed(4).toString()+" MB/s":"unavailable"})]})}),Object(We.jsx)("div",{className:r.row,children:Object(We.jsx)(Hh,{machine:t,onActionSuccess:n})})]})},Gh=n(78),Xh=n(905),_h=n(906),Zh=n(954),Qh=n(226),Kh=n.n(Qh),Jh=n(403),eb=n.n(Jh);function tb(){return(tb=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 nb(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 rb=r.createElement("desc",null,"Created with Sketch."),ab=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 ib(e,t){var n=e.title,a=e.titleId,i=nb(e,["title","titleId"]);return r.createElement("svg",tb({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,rb,ab)}var ob=r.forwardRef(ib),cb=(n.p,Object(p.a)({transparentButton:{border:"none",backgroundColor:"transparent",marginTop:4,outline:"none",cursor:"pointer"},popoverContent:function(e){return{width:e.width,padding:[[10,15]]}}})),lb=function(e){var t=cb({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)}}},sb=Object(r.memo)((function(e){var t=e.children,n=e.width,r=e.Icon,a=void 0===r?ob:r,i=lb(n);return Object(We.jsx)(S.a,{onClickAway:i.handleCloseHelpPopper,children:Object(We.jsxs)("div",{children:[Object(We.jsx)("button",{type:"button",className:i.classes.transparentButton,onClick:i.handleOpenHelpPopper,children:Object(We.jsx)(a,{})}),Object(We.jsx)(Gn,{open:i.helpPopperOpen,anchorEl:i.helpPopperAnchorEl,placement:"bottom",children:Object(We.jsx)("div",{className:i.classes.popoverContent,children:t})})]})})})),db=Object(r.memo)((function(e){var t=e.parentElements,n=e.children,r=e.width,a=lb(r);return Object(We.jsxs)("div",{children:[Object(We.jsx)("div",{onMouseEnter:a.handleOpenHelpPopper,onMouseLeave:a.handleCloseHelpPopper,children:t}),Object(We.jsx)(Gn,{open:a.helpPopperOpen,anchorEl:a.helpPopperAnchorEl,placement:"bottom",children:Object(We.jsx)("div",{className:a.classes.popoverContent,children:n})})]})}));function ub(){return(ub=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 mb(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 hb=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 bb(e,t){var n=e.title,a=e.titleId,i=mb(e,["title","titleId"]);return r.createElement("svg",ub({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,hb)}var jb=r.forwardRef(bb);n.p;function pb(){return(pb=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 fb(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 gb=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 Ob(e,t){var n=e.title,a=e.titleId,i=fb(e,["title","titleId"]);return r.createElement("svg",pb({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,gb)}var xb=r.forwardRef(Ob);n.p;function vb(){return(vb=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 yb(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 wb=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 Cb(e,t){var n=e.title,a=e.titleId,i=yb(e,["title","titleId"]);return r.createElement("svg",vb({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,wb)}var kb=r.forwardRef(Cb);n.p;function Sb(){return(Sb=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 Nb(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 Ib=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 Eb(e,t){var n=e.title,a=e.titleId,i=Nb(e,["title","titleId"]);return r.createElement("svg",Sb({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,Ib)}var Fb=r.forwardRef(Eb);n.p;function Lb(){return(Lb=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 Pb(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 Db=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 Bb(e,t){var n=e.title,a=e.titleId,i=Pb(e,["title","titleId"]);return r.createElement("svg",Lb({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,Db)}var Rb=r.forwardRef(Bb);n.p;function Ab(){return(Ab=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 Tb(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 Wb=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 zb(e,t){var n=e.title,a=e.titleId,i=Tb(e,["title","titleId"]);return r.createElement("svg",Ab({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,Wb)}var Mb=r.forwardRef(zb);n.p;function $b(){return($b=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 qb(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 Hb=r.createElement("desc",null,"Created with Sketch."),Vb=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 Ub(e,t){var n=e.title,a=e.titleId,i=qb(e,["title","titleId"]);return r.createElement("svg",$b({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,Hb,Vb)}var Yb=r.forwardRef(Ub);n.p;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."),Zb=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 Qb(e,t){var n=e.title,a=e.titleId,i=Xb(e,["title","titleId"]);return r.createElement("svg",Gb({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,_b,Zb)}var Kb=r.forwardRef(Qb);n.p;function Jb(){return(Jb=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 ej(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 tj=r.createElement("desc",null,"Created with Sketch."),nj=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 rj(e,t){var n=e.title,a=e.titleId,i=ej(e,["title","titleId"]);return r.createElement("svg",Jb({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,tj,nj)}var aj=r.forwardRef(rj),ij=(n.p,n(75)),oj=n(412),cj=n(132),lj=n(76),sj=n(404),dj=n(413),uj="",mj=function(e){var t=e.children,n=Object(w.h)(),a=Object(w.i)(),i=Object(r.useContext)(k),o=function(e,t,n,r){return new cj.a({link:lj.a.from([Object(sj.a)((function(r){var a=r.graphQLErrors,i=r.networkError;a&&a.forEach((function(r){var a=r.message,i=r.locations,o=r.path,c=r.extensions;"UNAUTHENTICATED"===(null===c||void 0===c?void 0:c.code)&&(n(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 lj.a((function(e,t){return t(e).map((function(t){var n=e.getContext().response.headers;if(n){var a=n.get("role");r(a)}return t}))})),new dj.a({credentials:"include",uri:"".concat(uj,"/graphql")})]),cache:new oj.a,defaultOptions:{watchQuery:{fetchPolicy:"no-cache",errorPolicy:"ignore"},query:{fetchPolicy:"no-cache",errorPolicy:"all"},mutate:{errorPolicy:"all"}}})}(n,a,i.setUserData,i.setRole);return Object(We.jsx)(ij.a,{client:o,children:t})},hj=n(405);function bj(){return(bj=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 jj(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 pj=r.createElement("desc",null,"Created with Sketch."),fj=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 gj(e,t){var n=e.title,a=e.titleId,i=jj(e,["title","titleId"]);return r.createElement("svg",bj({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,pj,fj)}var Oj,xj,vj=r.forwardRef(gj),yj=(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"}}}),wj=Re.label1,Cj={wrapper:{extend:Re.mono,display:"flex",alignItems:"center"},address:{lineBreak:"anywhere"},buttonWrapper:{"& button":{border:"none",backgroundColor:"transparent",cursor:"pointer"}},popoverContent:{extend:wj,display:"flex",justifyContent:"center",alignItems:"center",color:Z,borderRadius:4,padding:[[5,9]]}},kj={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}}}}},Sj={label:{extend:wj,color:se,marginBottom:4}},Nj={titleWrapper:yj.titleWrapper,titleAndButtonsContainer:yj.titleAndButtonsContainer,buttonsWrapper:yj.buttonsWrapper,headerLabels:{display:"flex",flexDirection:"row","& div":{display:"flex",alignItems:"center"},"& > div:first-child":{marginRight:24},"& span":{extend:wj,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}},Ij=Object(p.a)(Cj),Ej=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=Ij(),m=Boolean(s),h=m?"simple-popper":void 0;return Object(We.jsx)("div",{className:E()(u.wrapper,i),children:a&&Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)("div",{className:E()(u.address,t),children:a}),Object(We.jsx)("div",{className:E()(u.buttonWrapper,n),children:Object(We.jsx)(hj.CopyToClipboard,{text:iu.a(/\s/g,"")(a),children:Object(We.jsx)("button",{"aria-describedby":h,onClick:function(e){return function(e){d(s?null:e.currentTarget)}(e)},children:Object(We.jsx)(vj,{})})})}),Object(We.jsx)(Gn,{id:h,open:m,anchorEl:s,onClose:function(){d(null)},arrowSize:3,bgColor:q,placement:"top",children:Object(We.jsx)("div",{className:u.popoverContent,children:Object(We.jsx)("div",{children:"Copied to clipboard!"})})})]})})},Fj={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":"Pending"}(e)},Pj=function(e){return e.hasError?e.hasError:null},Dj=Object(p.a)(Fj),Bj=x()(Oj||(Oj=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"]))),Rj=x()(xj||(xj=Object(l.a)(["\n mutation cancelCashOutTransaction($id: ID!) {\n cancelCashOutTransaction(id: $id) {\n id\n }\n }\n"]))),Aj=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Gh.utils.formatCryptoAddress(e,t).replace(/(.{5})/g,"$1 ")},Tj=function(e){var t=e.children,n=Dj();return Object(We.jsx)(et,{className:n.label,children:t})},Wj=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],j=new eb.a,p=Object(u.a)(Bj,{onCompleted:function(e){return F(e)}}),f=Object(c.a)(p,1)[0],g=Object(u.b)(Rj,{onError:function(e){var t=e.message;return b(null!==t&&void 0!==t?t:"An error occurred.")},refetchQueries:function(){return["transactions"]}}),O=Object(c.a)(g,1)[0],x=Number.parseFloat(t.fiat),v=Gh.utils.toUnit(new tl.a(t.cryptoAtoms),t.cryptoCode),y=Number.parseFloat(t.commissionPercentage,2),w=Number(x*y).toFixed(2),C=t.discount?"-".concat(t.discount,"%"):null,k=tl()(x/v).toFormat(2),S="1 ".concat(t.cryptoCode," = ").concat(k," ").concat(t.fiatCode),N=t.customerIdCardData&&{name:"".concat(du(t.customerIdCardData.firstName)," ").concat(du(t.customerIdCardData.lastName)),age:Il()().diff(Il()(t.customerIdCardData.dateOfBirth),"years"),country:t.customerIdCardData.country,idCardNumber:t.customerIdCardData.documentNumber,idCardExpirationDate:Il()(t.customerIdCardData.expirationDate).format("DD-MM-YYYY")},I=Il()(t.created).subtract(3,"m").format(),E=Il()(t.created).add(3,"m").format(),F=function(){var e=Object(ec.a)(Jo.a.mark((function e(n){var r,a,i;return Jo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r="tx_".concat(t.id,"_summary.zip"),a=nl.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,Kh.a.saveAs(i,r);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),L=Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(Tj,{children:"Transaction status"}),Object(We.jsx)("span",{className:a.bold,children:Lj(t)})]});return Object(We.jsxs)("div",{className:a.wrapper,children:[Object(We.jsxs)("div",{className:a.row,children:[Object(We.jsxs)("div",{className:a.direction,children:[Object(We.jsx)(Tj,{children:"Direction"}),Object(We.jsxs)("div",{children:[Object(We.jsx)("span",{className:a.txIcon,children:"cashOut"===t.txClass?Object(We.jsx)(Kc,{}):Object(We.jsx)(Uc,{})}),Object(We.jsx)("span",{children:"cashOut"===t.txClass?"Cash-out":"Cash-in"})]})]}),Object(We.jsxs)("div",{className:a.availableIds,children:[Object(We.jsx)(Tj,{children:"Available IDs"}),Object(We.jsxs)(No.a,{display:"flex",flexDirection:"row",children:[t.customerPhone&&Object(We.jsx)(Kn,{className:a.idButton,name:"phone",Icon:Fb,InverseIcon:kb,children:t.customerPhone}),t.customerIdCardPhotoPath&&!t.customerIdCardData&&Object(We.jsx)(Kn,{popoverClassname:a.clipboardPopover,className:a.idButton,name:"card",Icon:xb,InverseIcon:jb,children:Object(We.jsx)("img",{className:a.idCardPhoto,src:"".concat(uj,"/id-card-photo/").concat(t.customerIdCardPhotoPath),alt:""})}),t.customerIdCardData&&Object(We.jsx)(Kn,{className:a.idButton,name:"card",Icon:xb,InverseIcon:jb,children:Object(We.jsxs)("div",{className:a.idCardDataCard,children:[Object(We.jsxs)("div",{children:[Object(We.jsxs)("div",{children:[Object(We.jsx)(Tj,{children:"Name"}),Object(We.jsx)("div",{children:N.name})]}),Object(We.jsxs)("div",{children:[Object(We.jsx)(Tj,{children:"Age"}),Object(We.jsx)("div",{children:N.age})]}),Object(We.jsxs)("div",{children:[Object(We.jsx)(Tj,{children:"Country"}),Object(We.jsx)("div",{children:N.country})]})]}),Object(We.jsxs)("div",{children:[Object(We.jsxs)("div",{children:[Object(We.jsx)(Tj,{children:"ID number"}),Object(We.jsx)("div",{children:N.idCardNumber})]}),Object(We.jsxs)("div",{children:[Object(We.jsx)(Tj,{children:"Expiration date"}),Object(We.jsx)("div",{children:N.idCardExpirationDate})]})]})]})}),t.customerFrontCameraPath&&Object(We.jsx)(Kn,{name:"cam",Icon:Mb,InverseIcon:Rb,children:Object(We.jsx)("img",{src:"".concat(uj,"/front-camera-photo/").concat(t.customerFrontCameraPath),alt:""})})]})]}),Object(We.jsxs)("div",{className:a.exchangeRate,children:[Object(We.jsx)(Tj,{children:"Exchange rate"}),Object(We.jsx)("div",{children:v>0?S:"-"})]}),Object(We.jsxs)("div",{className:a.commission,children:[Object(We.jsx)(Tj,{children:"Commission"}),Object(We.jsxs)("div",{className:a.container,children:["".concat(w," ").concat(t.fiatCode," (").concat(100*y," %)"),C&&Object(We.jsx)("div",{className:a.chip,children:Object(We.jsx)(et,{className:a.chipLabel,children:C})})]})]}),Object(We.jsxs)("div",{children:[Object(We.jsx)(Tj,{children:"Fixed fee"}),Object(We.jsx)("div",{children:"cashIn"===t.txClass?"".concat(Number.parseFloat(t.cashInFee)," ").concat(t.fiatCode):"N/A"})]})]}),Object(We.jsxs)("div",{className:a.secondRow,children:[Object(We.jsxs)("div",{className:a.address,children:[Object(We.jsx)(Tj,{children:"Address"}),Object(We.jsx)("div",{children:Object(We.jsx)(Ej,{children:Aj(t.cryptoCode,t.toAddress)})})]}),Object(We.jsxs)("div",{className:a.transactionId,children:[Object(We.jsx)(Tj,{children:"Transaction ID"}),Object(We.jsx)("div",{children:"cashOut"===t.txClass?"N/A":Object(We.jsx)(Ej,{children:t.txHash})})]}),Object(We.jsxs)("div",{className:a.sessionId,children:[Object(We.jsx)(Tj,{children:"Session ID"}),Object(We.jsx)(Ej,{children:t.id})]})]}),Object(We.jsxs)("div",{className:a.lastRow,children:[Object(We.jsxs)("div",{className:a.status,children:[Pj(t)?Object(We.jsx)(db,{parentElements:L,width:200,children:Object(We.jsx)(Ge,{children:Pj(t)})}):L,"cashOut"===t.txClass&&"Pending"===Lj(t)&&Object(We.jsx)(Me,{color:"primary",Icon:Yb,InverseIcon:jr,className:a.cancelTransaction,onClick:function(){return s({command:"cancelTx"})},children:"Cancel transaction"})]}),Object(We.jsxs)("div",{children:[Object(We.jsx)(Tj,{children:"Other actions"}),Object(We.jsx)("div",{className:a.otherActionsGroup,children:Object(We.jsx)(Me,{color:"primary",Icon:aj,InverseIcon:Kb,className:a.downloadRawLogs,onClick:function(){return function(e,t){var n=e.id,r=e.deviceId,a=e.txClass;f({variables:{txId:n,from:I,until:E,deviceId:r,txClass:a,timezone:t}})}(t,n)},children:"Download raw logs"})})]})]}),Object(We.jsx)($m,{open:"cancelTx"===l.command,title:"Cancel this transaction?",errorMessage:h,toBeConfirmed:t.machineName,message:"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}),O({variables:{id:t.id}})},onDissmised:function(){s({command:null}),b(null)}})]})},zj=Object(r.memo)(Wj,(function(e,t){return e.it.id===t.it.id&&e.it.hasError===t.it.hasError})),Mj=n(108),$j={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",Y]],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 qj(){return(qj=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 Hj(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 Vj=r.createElement("desc",null,"Created with Sketch."),Uj=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 Yj(e,t){var n=e.title,a=e.titleId,i=Hj(e,["title","titleId"]);return r.createElement("svg",qj({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,Vj,Uj)}var Gj=r.forwardRef(Yj);n.p;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 _j(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 Zj=r.createElement("desc",null,"Created with Sketch."),Qj=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 Kj(e,t){var n=e.title,a=e.titleId,i=_j(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,Zj,Qj)}var Jj,ep,tp,np,rp=r.forwardRef(Kj),ap=(n.p,Object(p.a)($j)),ip=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=ap(),b=m||u,j=(t={},Object(M.a)(t,h.pointer,b),Object(M.a)(t,h.row,!0),Object(M.a)(t,h.expanded,c),t);return Object(We.jsxs)("div",{className:h.rowWrapper,children:[Object(We.jsx)("div",{className:E()(Object(M.a)({},h.before,c&&0!==n)),children:Object(We.jsxs)(tu,{className:E()(j),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(We.jsx)(Kd,Object(s.a)(Object(s.a)({},i),{},{children:r(a)}),t)})),u&&Object(We.jsx)(Kd,{width:d,textAlign:"center",children:Object(We.jsxs)("button",{onClick:function(){return l(n)},className:h.expandButton,children:[c&&Object(We.jsx)(rp,{}),!c&&Object(We.jsx)(Gj,{})]})})]})}),u&&c&&Object(We.jsx)("div",{className:h.after,children:Object(We.jsx)(tu,{className:E()(Object(M.a)({},h.expanded,c)),children:Object(We.jsx)(Kd,{width:i,children:Object(We.jsx)(o,{it:a})})})})]})},op=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,j=Object($.a)(e,["elements","data","Details","className","expandable","initialExpanded","onClick","loading","emptyText","extraHeight"]),p=Object(r.useState)(d),f=Object(c.a)(p,2),g=f[0],O=f[1];Object(r.useEffect)((function(){return O(d)}),[d]);var x=L.a(El.a,B.a(R.a("width")))(n),v=850-x,y=x+(l?v:0),w=ap({width:y}),C=function(e){O(e===g?null:e)},k=new Mj.c({defaultHeight:62,fixedWidth:!0});function S(e){var t=e.index,r=e.key,a=e.parent,c=e.style;return Object(We.jsx)(Mj.b,{cache:k,columnIndex:0,parent:a,rowIndex:t,children:Object(We.jsx)("div",{style:c,children:Object(We.jsx)(ip,{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(We.jsx)(No.a,{display:"flex",flex:"1",flexDirection:"column",children:Object(We.jsxs)(Xd,{className:w.table,children:[Object(We.jsxs)(_d,{children:[n.map((function(e,t){var n=e.width,r=e.className,a=e.textAlign,i=e.header;return Object(We.jsx)(Jd,{width:n,className:r,textAlign:a,children:i},t)})),l&&Object(We.jsx)(Jd,{width:v})]}),Object(We.jsxs)(Qd,{className:w.body,children:[m&&Object(We.jsx)(Ue,{children:"Loading..."}),!m&&zr.a(i)&&Object(We.jsx)(Ue,{children:h}),Object(We.jsx)(Mj.a,{disableWidth:!0,disableHeight:!0,children:function(){return Object(We.jsx)(Mj.d,Object(s.a)(Object(s.a)({style:{overflowX:"inherit",outline:"none"}},j),{},{height:62*i.length+b,width:y,rowCount:i.length,rowHeight:k.rowHeight,rowRenderer:S,overscanRowCount:50,deferredMeasurementCache:k}))}})]})]})})},cp=Object(p.a)(Nj),lp=x()(Jj||(Jj=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"]))),sp=function(e){var t=e.id,n=cp(),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)(lp,{variables:{limit:5,deviceId:t}}),j=Object(c.a)(b,2),p=j[0],f=j[1],g=f.data,O=f.loading;!O&&g&&(g.transactions=g.transactions.splice(0,5)),Object(r.useEffect)((function(){null!==t&&p()}),[p,t]);var x=[{header:"",width:0,size:"sm",view:function(e){return"cashOut"===e.txClass?Object(We.jsx)(Kc,{}):Object(We.jsx)(Uc,{})}},{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(Xh.a(_h.a,Zh.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(Gh.utils.toUnit(new tl.a(e.cryptoAtoms),e.cryptoCode).toFormat(5)," ").concat(e.cryptoCode)}},{header:"Address",view:function(e){return Gh.utils.formatCryptoAddress(e.cryptoCode,e.toAddress)},className:n.overflowTd,size:"sm",textAlign:"left",width:140},{header:"Date (UTC)",view:function(e){return Il.a.utc(e.created).format("YYYY-MM-DD")},textAlign:"left",size:"sm",width:140},{header:"Status",view:function(e){return Lj(e)},size:"sm",width:20}];return Object(We.jsx)(op,{extraHeight:o,onClick:function(e){m===e.id?(h(""),l(0)):(h(e.id),l(310))},loading:O||null===t,emptyText:"No transactions so far",elements:x,data:T.a(["transactions"])(g),Details:zj,expandable:!0})},dp=Object(p.a)(Am),up=x()(ep||(ep=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 statuses {\n label\n type\n }\n downloadSpeed\n responseTime\n packetLoss\n latestEvent {\n note\n }\n }\n config\n }\n"]))),mp=function(e){return e.slice(e.lastIndexOf("/")+1)},hp=function(){var e,t,n,r,a,i=Object(w.i)(),o=Object(u.c)(up,{variables:{deviceId:mp(i.pathname)}}),c=o.data,l=o.refetch,s=dp(),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:{},j=null!==(r=T.a(["name"])(m))&&void 0!==r?r:null,p=null!==(a=T.a(["deviceId"])(m))&&void 0!==a?a:null;return Object(We.jsxs)(h.a,{container:!0,className:s.grid,children:[Object(We.jsxs)(h.a,{item:!0,xs:3,children:[Object(We.jsx)(h.a,{item:!0,xs:12,children:Object(We.jsxs)("div",{className:s.breadcrumbsContainer,children:[Object(We.jsxs)(Fd.a,{separator:Object(We.jsx)(Pd.a,{fontSize:"small"}),children:[Object(We.jsx)(C.b,{to:"/dashboard",className:s.breadcrumbLink,children:Object(We.jsx)(nt,{noMargin:!0,className:s.subtitle,children:"Dashboard"})}),Object(We.jsx)(Je,{noMargin:!0,className:s.subtitle,children:j})]}),Object(We.jsx)(Yh,{data:m,onActionSuccess:l})]})}),Object(We.jsx)(h.a,{item:!0,xs:12})]}),Object(We.jsx)(h.a,{item:!0,xs:9,children:Object(We.jsxs)("div",{className:s.content,children:[Object(We.jsxs)("div",{className:E()(s.detailItem,s.detailsMargin),children:[Object(We.jsx)(Ke,{className:s.subtitle,children:"Details"}),Object(We.jsx)(Wm,{data:m,timezone:d})]}),Object(We.jsxs)("div",{className:s.detailItem,children:[Object(We.jsx)(Ke,{className:s.subtitle,children:"Cash cassettes"}),Object(We.jsx)(xm,{refetchData:l,machine:m,config:null!==b&&void 0!==b&&b})]}),Object(We.jsxs)("div",{className:s.transactionsItem,children:[Object(We.jsx)(Ke,{className:s.subtitle,children:"Latest transactions"}),Object(We.jsx)(sp,{id:p})]}),Object(We.jsxs)("div",{className:s.detailItem,children:[Object(We.jsx)(Ke,{className:s.subtitle,children:"Commissions"}),Object(We.jsx)(Im,{name:"commissions",id:p})]})]})})]})},bp=n(392),jp=n(90),pp=n(907),fp=n(908),gp=n(219),Op=n(910),xp=n(911),vp={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}},yp=rl.a((function(e,t){var n=R.a("fiatCurrency")(e);return L.a(B.a((function(e){return{code:parseInt(e),display:e}})),nl.a,T.a([n]))(t)})),wp=9999999,Cp={name:"All Machines",deviceId:"ALL_MACHINES"},kp={display:"All Coins",code:"ALL_COINS"},Sp={marginLeft:6},Np=Object(We.jsxs)("div",{children:[Object(We.jsx)(Uc,{}),Object(We.jsx)("span",{style:Sp,children:"Cash-in"})]}),Ip=Object(We.jsxs)("div",{children:[Object(We.jsx)(Kc,{}),Object(We.jsx)("span",{style:Sp,children:"Cash-out"})]}),Ep=function(e,t,n){return function(r){if(!e)return"";var a=Tr.a(z.a(null!==n&&void 0!==n?n:"code",r))(e);return a?R.a(t,a):"Unpaired machine"}},Fp=function(e){return function(t){return t?L.a(pp.a(", "),B.a(Ep(e,"display")))(t):t}},Lp=function(e,t,n){var r=F.a(kp.code)(t),a=F.a(kp.code)(e);return r&&a&&gn.a(t)>1?n(Td.a(ds.a(kp.code))(t)):r&&!a?n([kp.code]):void n(t)},Pp=function(e){return[{header:Np,name:"cashIn",display:"Cash-in",width:169,size:"lg",editingAlign:"right",input:qa,suffix:"%",bold:Vr,inputProps:{decimalPlaces:3}},{header:Ip,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}}]},Dp=function(e,t,n){return function(e,t,n){var r=[Cp].concat(e(["machines"])),a=e(["cryptoCurrencies"]),i=[kp].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:Ep(r,"name","deviceId"),input:ka,inputProps:{options:r,valueProp:"deviceId",labelProp:"name"}},{name:"cryptoCurrencies",width:280,size:"sm",view:Fp(i),input:ka,inputProps:{options:i,valueProp:"code",labelProp:"display",multiple:!0,onChange:Lp,shouldStayOpen:!0}},{header:Np,name:"cashIn",display:"Cash-in",width:130,input:qa,textAlign:"right",suffix:"%",bold:Vr,inputProps:{decimalPlaces:3}},{header:Ip,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(fp.a,e),t)},Bp=100,Rp=function(e){var t=yp(e,vp).map((function(e){return parseInt(e.code)})),n=zr.a(t)?wp:Math.max.apply(Math,Object(d.a)(t));return xn.d().shape({cashIn:xn.c().label("Cash-in").min(0).max(Bp).required(),cashOut:xn.c().label("Cash-out").min(0).max(Bp).required(),fixedFee:xn.c().label("Fixed Fee").min(0).max(n).required(),minimumTx:xn.c().label("Minimum Tx").min(0).max(n).required()})},Ap=function(e,t,n){var r=T.a(fp.a,t),a=[Cp].concat(r(["machines"])),i=r(["cryptoCurrencies"]),o=[kp].concat(B.a((function(e){return{display:e.code,code:e.code}}))(null!==i&&void 0!==i?i:[])),c=yp(n,vp).map((function(e){return parseInt(e.code)})),l=zr.a(c)?wp:Math.max.apply(Math,Object(d.a)(c));return xn.d().shape({machine:xn.f().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=W.a(z.a("machine",t))(n),o=Tr.a(z.a("id",e))(n),c=r(o),l=a(o),s=L.a(gp.a,To.a,B.a(r))(i);return t!==l?null!==s&&void 0!==s?s:[]:Op.a(s,c)}(n,r,e),l=r===Cp.deviceId,s=F.a(kp.code,i);if(l&&s)return this.createError({message:"All machines and all coins should be configured in the default setup table"});var d=xp.a(c,i);if(!zr.a(d)){var u=Fp(o)(d),m=Ep(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.c().label("Cash-in").min(0).max(Bp).required(),cashOut:xn.c().label("Cash-out").min(0).max(Bp).required(),fixedFee:xn.c().label("Fixed Fee").min(0).max(l).required(),minimumTx:xn.c().label("Minimum Tx").min(0).max(l).required()})},Tp={cashIn:"",cashOut:"",fixedFee:"",minimumTx:""},Wp={machine:null,cryptoCurrencies:[],cashIn:"",cashOut:"",fixedFee:"",minimumTx:""},zp=function(e){var t=e.machine,n=e.cryptoCurrencies,r=t===Cp.deviceId,a=qo.a(kp.code,n);return r&&a?0:r?1:a?2:3},Mp=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(zd.a)()}},$p=function(e){var t=yp(e,vp).map((function(e){return parseInt(e.code)})),n=zr.a(t)?wp:Math.max.apply(Math,Object(d.a)(t));return xn.d().shape({machine:xn.f().label("Machine").required(),cryptoCurrencies:xn.a().label("Crypto Currency").required().min(1),cashIn:xn.c().label("Cash-in").min(0).max(Bp).required(),cashOut:xn.c().label("Cash-out").min(0).max(Bp).required(),fixedFee:xn.c().label("Fixed Fee").min(0).max(n).required(),minimumTx:xn.c().label("Minimum Tx").min(0).max(n).required()})},qp=function(e,t){return{color:e.default?J:te}},Hp=function(e,t,n){var r=T.a(fp.a,e);return Vp(r,t,Tp)},Vp=function(e,t,n){var r=[Cp].concat(e(["machines"]));return[{name:"machine",width:196,size:"sm",view:Ep(r,"name","deviceId"),editable:!1},{name:"cryptoCurrencies",display:"Crypto Currency",width:265,view:R.a(0),size:"sm",editable:!1},{header:Np,name:"cashIn",display:"Cash-in",width:130,input:qa,textAlign:"right",suffix:"%",textStyle:function(e){return qp(e)},inputProps:{decimalPlaces:3}},{header:Ip,name:"cashOut",display:"Cash-out",width:130,input:qa,textAlign:"right",greenText:!0,suffix:"%",textStyle:function(e){return qp(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 qp(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 qp(e)},inputProps:{decimalPlaces:2}}]},Up=n(408),Yp=n(913),Gp=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return W.a((function(e){return F.a(e.name,t)}),Xp(e,n,r))},Xp=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(z.a(null!==n&&void 0!==n?n:"code",r)))(e):""}},a=function(e){return function(t){return t?L.a(pp.a(", "),B.a(r(e,"code")))(t):t}},i=B.a((function(e){return e.machine}),n),o=function(e){return Yp.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=Kl.a(Up.getAllTimezones()),h=Bm(m),b=function(e){var t=Tr.a(z.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 Wo.a(b(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(h,"label"),input:ka,inputProps:{options:h,valueProp:"code",labelProp:"label"}}]},_p=function(e,t){var n=T.a(fp.a,e);return Gp(n,["country","fiatCurrency","languages","cryptoCurrencies","timezone"],t)},Zp=function(e,t,n){var r=T.a(fp.a,e);return Gp(r,["machine","country","languages","cryptoCurrencies"],n,t)},Qp=xn.d().shape({country:xn.f().label("Country").required(),fiatCurrency:xn.f().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.f().label("Timezone").required()}),Kp=xn.d().shape({machine:xn.f().label("Machine").required(),country:xn.f().label("Country").required(),languages:xn.a().label("Languages").required().min(1),cryptoCurrencies:xn.a().label("Crypto Currencies").required().min(1)}),Jp={country:"",fiatCurrency:"",languages:[],cryptoCurrencies:[],timezone:""},ef={machine:"",country:"",languages:[],cryptoCurrencies:[]},tf=n(955),nf=n(915),rf=n(916),af=tf.a(nf.a(Number),rf.a(ds.a(NaN))),of=function(e){return af(e)?e:null},cf={editDisabled:{color:oe}},lf=function(e){return W.a((function(t){return t.class===e}))},sf=function(e){var t=e.id;return W.a((function(e){return qo.a(t)(e.cryptos)}))},df=xn.d().shape({ticker:xn.f().required(),wallet:xn.f().required(),exchange:xn.f().required(),zeroConf:xn.f().required(),zeroConfLimit:xn.c().integer().required("Zero Conf Limit is a required field").min(0).max(wp).transform(of)}),uf=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(z.a("code",t)))(e)},o=function(e){return lf(e)(t||[])},c=function(e){return function(t){return L.a(R.a("display"),Tr.a(z.a("code",t)))(o(e))}},l=rl.a((function(e,t){return sf(t)(o(e))}));return[{name:"id",header:"Cryptocurrency",width:180-a,view:i,size:"sm",editable:!1},{name:"ticker",size:"sm",stripe:!0,view:c("ticker"),width:190-a,input:ka,inputProps:{options:l("ticker"),valueProp:"code",labelProp:"display",optionsLimit:null}},{name:"wallet",size:"sm",stripe:!0,view:c("wallet"),width:190-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:190-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:220-a,inputProps:{options:l("zeroConf"),valueProp:"code",labelProp:"display",optionsLimit:null,onChange:n}},{name:"zeroConfLimit",size:"sm",stripe:!0,view:function(e,t){return"ETH"===t.id?Object(We.jsx)("span",{style:cf.editDisabled,children:e}):e},input:qa,width:190-a,inputProps:{decimalPlaces:0},editable:function(e){return"ETH"!==e.id}}]},mf=Object(p.a)({subtitle:{color:se,marginTop:16,marginBottom:16},extraMarginTop:{marginTop:72}}),hf=Object(r.memo)((function(e){var t,n=e.children,r=e.className,a=e.extraMarginTop,i=mf(),o=(t={},Object(M.a)(t,i.subtitle,!0),Object(M.a)(t,i.extraMarginTop,a),t);return Object(We.jsx)(Ke,{className:E()(o,r),children:n})})),bf=Object(p.a)({section:{marginBottom:72},sectionHeader:{display:"flex",alignItems:"center"},sectionTitle:{margin:[[16,20,23,0]]}}),jf=function(e){var t=e.error,n=e.children,r=e.title,a=bf();return Object(We.jsxs)("div",{className:a.section,children:[(r||t)&&Object(We.jsxs)("div",{className:a.sectionHeader,children:[Object(We.jsx)(hf,{className:a.sectionTitle,children:r}),t&&Object(We.jsx)(Fo,{children:"Failed to save changes"})]}),n]})},pf=Object(p.a)(Ei),ff=Object(p.a)({autoComplete:{width:"100%"}}),gf=x()(tp||(tp=Object(l.a)(["\n query getData {\n config\n }\n"]))),Of=x()(np||(np=Object(l.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"])));var xf,vf,yf=function(e){var t=e.isActive,n=e.doContinue,r=pf(),a=(ff(),Object(u.c)(gf).data),i=Object(u.b)(Of,{onCompleted:n}),o=Object(c.a)(i,1)[0],l=T.a(["fiatCurrency"])(vl(ml)(null===a||void 0===a?void 0:a.config)),s=vl(ml)(null===a||void 0===a?void 0:a.config);return Object(We.jsxs)("div",{className:r.wrapper,children:[Object(We.jsx)(Do,{title:"Commissions"}),Object(We.jsx)(jf,{children:Object(We.jsx)(bm,{title:"Default setup",rowSize:"lg",titleLg:!0,name:"commissions",initialValues:Tp,enableEdit:!0,forceAdd:t,save:function(e){var t=yl("commissions")(e.commissions[0]);return o({variables:{config:t}})},validationSchema:Rp(s),data:[],elements:Pp(l)})})]})},wf=Object(p.a)(Ei),Cf=x()(xf||(xf=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"]))),kf=x()(vf||(vf=Object(l.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"])));var Sf,Nf,If=function(e){var t=e.isActive,n=e.doContinue,r=wf(),a=Object(u.c)(Cf).data,i=Object(u.b)(kf,{onCompleted:n}),o=Object(c.a)(i,1)[0],l=Vg((null===a||void 0===a?void 0:a.config)||{},(null===a||void 0===a?void 0:a.cryptoCurrencies)||[]);return Object(We.jsxs)("div",{className:r.wrapper,children:[Object(We.jsx)(Do,{title:"Locales"}),Object(We.jsx)(jf,{children:Object(We.jsx)(bm,{title:"Default settings",rowSize:"lg",titleLg:!0,name:"locale",initialValues:Jp,forceAdd:t,enableEdit:!0,save:function(e){var t=yl("locale")(e.locale[0]);return o({variables:{config:t}})},validationSchema:Qp,data:[],elements:_p(Yn.a(a,{cryptoCurrencies:l}),(function(e,t,n){return n(t)}))})})]})},Ef=Object(p.a)({message:function(e){return{width:e.width,marginTop:4,marginLeft:16}}}),Ff=function(e){var t=e.children,n=e.width,r=void 0===n?330:n,a=e.className,i=Ef({width:r});return Object(We.jsxs)(No.a,{display:"flex",className:a,children:[Object(We.jsx)(ia,{}),Object(We.jsx)(et,{className:i.message,children:t})]})},Lf=n(917),Pf=Object(p.a)({button:{margin:[["auto",0,32,"auto"]]},form:{flex:1,display:"flex",flexDirection:"column"},grid:{marginBottom:24,marginTop:12}}),Df=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=Pf(),m=L.a(Lf.a,B.a((function(e){var t,n=e.code;return Object(M.a)({},n,null!==(t=r&&r[n])&&void 0!==t?t:"")})))(n),b=Yn.a(m,r);return Object(We.jsx)(jn.d,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,initialValues:b,validationSchema:t,onSubmit:function(e){var t=L.a(B.a(R.a("code")),W.a((function(t){return R.a("component",t)===Va&&zr.a(e[R.a("code",t)])})))(n);return a(Dd.a(t,e))},children:Object(We.jsxs)(jn.c,{className:u.form,children:[Object(We.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(We.jsx)(h.a,{item:!0,xs:d,children:Object(We.jsx)(jn.a,Object(s.a)(Object(s.a)({component:t},i),{},{name:n,label:r,settings:a,fullWidth:!0}))},n)}))}),Object(We.jsx)(Tn,{className:E()(u.button,c),type:"submit",children:o})]})})},Bf=function(e){return{test:function(t){return!D.a(e)||!D.a(t)||this.createError()}}},Rf={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.d().shape({accountSid:xn.f().max(100,"Too long").required(),authToken:xn.f().max(100,"Too long").test(Bf(null===e||void 0===e?void 0:e.authToken)),fromNumber:xn.f().max(100,"Too long").required(),toNumber:xn.f().max(100,"Too long").required()})}},Af={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]]}},Tf=x()(Sf||(Sf=Object(l.a)(["\n {\n config\n accounts\n }\n"]))),Wf=x()(Nf||(Nf=Object(l.a)(["\n mutation Save($accounts: JSONObject) {\n saveAccounts(accounts: $accounts)\n }\n"]))),zf=Object(p.a)(Object(s.a)(Object(s.a)({},Af),{},{content:{width:820},radioLabel:Object(s.a)(Object(s.a)({},Af.radioLabel),{},{width:280}),wrapper:{width:1200,height:100,margin:[[0,"auto"]]},title:{marginLeft:8,marginBottom:5},info:{marginTop:20,marginBottom:20}})),Mf=[{code:"enable",display:"Yes, I will"},{code:"disable",display:"No, not for now"}];var $f,qf,Hf,Vf,Uf,Yf,Gf,Xf,_f,Zf,Qf,Kf=function(e){var t,n,a=e.doContinue,i=zf(),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],j=h[1],p=Object(u.c)(Tf),f=p.data,g=p.refetch,O=Object(u.b)(Wf,{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(M.a)(n,i.title,!0),Object(M.a)(n,i.error,b),n);return Object(We.jsx)("div",{className:i.wrapper,children:Object(We.jsxs)("div",{className:i.content,children:[Object(We.jsx)(qe,{children:"Twilio (SMS service)"}),Object(We.jsxs)(No.a,{display:"flex",alignItems:"end",children:[Object(We.jsx)(Ue,{noMargin:!0,className:E()(y),children:"Will you setup a two way machine or compliance?"}),Object(We.jsxs)(sb,{width:304,children:[Object(We.jsx)(Ge,{children:"Two-way machines allow your customers not only to buy (cash-in) but also sell cryptocurrencies (cash-out)."}),Object(We.jsx)(Ge,{children:"You\u2019ll need an SMS service for cash-out transactions and for any compliance triggers"})]})]}),Object(We.jsx)(xa,{labelClassName:i.radioLabel,className:i.radioGroup,options:Mf,value:s,onChange:function(e){d(e.target.value),j(!1)}}),Object(We.jsx)(Ff,{className:i.info,children:"To set up Twilio please read the instructions from our support portal."}),Object(We.jsx)(Dr,{link:"https://support.lamassu.is/hc/en-us/articles/115001203951-Twilio-for-SMS",label:"Twilio for SMS"}),"enable"===s&&Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(Ue,{noMargin:!0,children:"Enter credentials"}),Object(We.jsx)(Df,{xs:6,save:function(e){return x({variables:{accounts:{twilio:e}}}).then((function(){return g()}))},value:v.twilio,elements:Rf.elements,validationSchema:Rf.validationSchema,buttonLabel:"Continue",buttonClass:i.formButton})]}),"enable"!==s&&Object(We.jsx)(Tn,{size:"lg",onClick:function(){if(!s)return j(!0);a()},className:i.button,children:"Continue"})]})})},Jf=n(918),eg=Object(p.a)(Af),tg=x()($f||($f=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"]))),ng=x()(qf||(qf=Object(l.a)(["\n mutation Save($config: JSONObject, $accounts: JSONObject) {\n saveConfig(config: $config)\n saveAccounts(accounts: $accounts)\n }\n"]))),rg=function(e){var t,n=e.data,a=e.doContinue,i=eg(),o=Object(u.c)(tg).data,l=Object(u.b)(ng,{onCompleted:a}),d=Object(c.a)(l,1)[0],m=Object(r.useState)(!1),h=Object(c.a)(m,2),b=h[0],j=h[1],p=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(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(Ue,{className:b&&i.error,children:"All set"}),Object(We.jsx)(Ge,{children:"These are your wallet settings. You can later edit these and add additional coins."}),Object(We.jsx)(jm,{rowSize:"lg",titleLg:!0,name:"All set",namespaces:[p],data:yl(p,Dd.a("coin",n)),elements:uf(g,f,!0)}),Object(We.jsx)(Tn,{size:"lg",onClick:function(){var e=Object(s.a)({zeroConfLimit:0},n);if(!df.isValidSync(e))return j(!0);var t=yl(p,Dd.a("coin",e)),r=yl(sl)(t);return j(!1),d({variables:{config:r}})},className:i.button,children:"Continue"})]})},ag=function(e){return e&&e.length},ig=function(e,t){return xn.f().max(100,"Too long").when(e,{is:ag,then:xn.f().test(Bf(t))})},og={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.d().shape({token:xn.f().max(100,"Too long").required(),BTCWalletId:xn.f().max(100,"Too long"),BTCWalletPassphrase:ig("BTCWalletId",null===e||void 0===e?void 0:e.BTCWalletPassphrase),LTCWalletId:xn.f().max(100,"Too long"),LTCWalletPassphrase:ig("LTCWalletId",null===e||void 0===e?void 0:e.LTCWalletPassphrase),ZECWalletId:xn.f().max(100,"Too long"),ZECWalletPassphrase:ig("ZECWalletId",null===e||void 0===e?void 0:e.ZECWalletPassphrase),BCHWalletId:xn.f().max(100,"Too long"),BCHWalletPassphrase:ig("BCHWalletId",null===e||void 0===e?void 0:e.BCHWalletPassphrase),DASHWalletId:xn.f().max(100,"Too long"),DASHWalletPassphrase:ig("DASHWalletId",null===e||void 0===e?void 0:e.DASHWalletPassphrase),environment:xn.f().matches(/(prod|test)/).required()})}},cg={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.d().shape({clientId:xn.f().max(100,"Too long").required(),key:xn.f().max(100,"Too long").required(),secret:xn.f().max(100,"Too long").test(Bf(null===e||void 0===e?void 0:e.secret))})}},lg={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.d().shape({token:xn.f().max(100,"Too long").required(),confidenceFactor:xn.c().integer("Please input a positive integer").positive("Please input a positive integer").required()})}},sg={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.d().shape({apiKey:xn.f().max(100,"Too long").required(),apiSecret:xn.f().max(100,"Too long").test(Bf(null===e||void 0===e?void 0:e.apiSecret)),endpoint:xn.f().max(100,"Too long").required()})}},dg={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.d().shape({userId:xn.f().max(100,"Too long").required(),walletId:xn.f().max(100,"Too long").required(),clientKey:xn.f().max(100,"Too long").required(),clientSecret:xn.f().max(100,"Too long").test(Bf(null===e||void 0===e?void 0:e.clientSecret))})}},ug={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.d().shape({apiKey:xn.f().max(100,"Too long").required(),privateKey:xn.f().max(100,"Too long").test(Bf(null===e||void 0===e?void 0:e.privateKey))})}},mg={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.d().shape({apiKey:xn.f().max(100,"Too long").required(),domain:xn.f().max(100,"Too long").required(),fromEmail:xn.f().max(100,"Too long").email("Please input a valid email address").required(),toEmail:xn.f().max(100,"Too long").email("Please input a valid email address").required()})}},hg=(Hf={},Object(M.a)(Hf,og.code,og),Object(M.a)(Hf,cg.code,cg),Object(M.a)(Hf,lg.code,lg),Object(M.a)(Hf,sg.code,sg),Object(M.a)(Hf,dg.code,dg),Object(M.a)(Hf,ug.code,ug),Object(M.a)(Hf,mg.code,mg),Object(M.a)(Hf,Rf.code,Rf),Hf),bg=Object(p.a)(Object(s.a)(Object(s.a)({},Af),{},{radioGroup:Af.radioGroup,radioLabel:Object(s.a)(Object(s.a)({},Af.radioLabel),{},{width:200})})),jg=x()(Vf||(Vf=Object(l.a)(["\n {\n accounts\n }\n"]))),pg=x()(Uf||(Uf=Object(l.a)(["\n mutation SaveAccountsBC($accounts: JSONObject) {\n saveAccounts(accounts: $accounts)\n }\n"]))),fg=[{code:"enable",display:"I will enable cash-out"},{code:"disable",display:"I won't enable cash-out"}],gg=function(e){var t,n=e.addData,a=bg(),i=Object(u.c)(jg).data,o=Object(u.b)(pg,{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),j=Object(c.a)(b,2),p=j[0],f=j[1],g=null!==(t=null===i||void 0===i?void 0:i.accounts)&&void 0!==t?t:[];return Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(Ue,{className:p&&a.error,children:"Blockcypher"}),Object(We.jsx)(Ge,{children:"If you are enabling cash-out services, create a Blockcypher account."}),Object(We.jsx)(Dr,{link:"https://support.lamassu.is/hc/en-us/articles/115001209472-Blockcypher",label:"Configuring Blockcypher"}),Object(We.jsx)(xa,{labelClassName:a.radioLabel,className:a.radioGroup,options:fg,value:m,onChange:function(e){h(e.target.value),f(!1)}}),Object(We.jsxs)("div",{className:a.mdForm,children:["disable"===m&&Object(We.jsx)(Tn,{size:"lg",onClick:function(){return n({zeroConf:"all-zero-conf"})},className:a.button,children:"Continue"}),"enable"===m&&Object(We.jsx)(Df,{value:g.blockcypher,save:function(e){return l({variables:{accounts:{blockcypher:e}}})},elements:hg.blockcypher.elements,validationSchema:hg.blockcypher.validationSchema,buttonLabel:"Continue",buttonClass:a.formButton})]})]})},Og=Object(p.a)(Af),xg=x()(Yf||(Yf=Object(l.a)(["\n {\n cryptoCurrencies {\n code\n display\n }\n }\n"]))),vg=xn.d().shape({coin:xn.f().required()}),yg=function(e){var t,n=e.addData,a=Og(),i=Object(r.useState)(!1),o=Object(c.a)(i,2),l=o[0],s=o[1],d=Object(u.c)(xg).data,m=null!==(t=null===d||void 0===d?void 0:d.cryptoCurrencies)&&void 0!==t?t:[];return Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(Ue,{className:l&&a.error,children:"Choose your first cryptocurrency"}),Object(We.jsx)(jn.d,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,initialValues:{coin:""},onSubmit:function(e){return vg.isValidSync(e)?"BTC"!==e.coin?n({coin:e.coin,zeroConf:"all-zero-conf"}):void n(e):s(!0)},children:Object(We.jsxs)(jn.c,{onChange:function(){return s(!1)},children:[Object(We.jsx)($d,{}),Object(We.jsx)(jn.b,{component:Ha,name:"coin",labelClassName:a.radioLabel,className:a.radioGroup,options:m}),Object(We.jsx)(Tn,{size:"lg",type:"submit",className:a.button,children:"Continue"})]})})]})},wg=function(e,t){return W.a((function(n){return function(e){return z.a("class",e)}(t)(n)&&function(e){return L.a(qo.a(e),R.a("cryptos"))}(e)(n)}))},Cg=function(e,t,n,r){var a=wg(r,n)(e),i=Ll.a((function(e){var n=e.code,r=function(e){return t&&t[e]}(n);return!hg[n]||(0,hg[n].getValidationSchema)(r).isValidSync(r)}))(a),o=Object(c.a)(i,2);return{filled:o[0],unfilled:o[1]}},kg=Object(p.a)(Af),Sg=x()(Gf||(Gf=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"]))),Ng=x()(Xf||(Xf=Object(l.a)(["\n mutation Save($accounts: JSONObject) {\n saveAccounts(accounts: $accounts)\n }\n"]))),Ig=function(e){return qo.a(e)(["kraken","itbit","bitstamp"])},Eg=function(e){var t,n,a,i=e.data,o=e.addData,l=kg(),s=Object(u.c)(Sg).data,d=Object(u.b)(Ng,{onCompleted:function(){return k()}}),m=Object(c.a)(d,1)[0],h=Object(r.useState)(null),b=Object(c.a)(h,2),j=b[0],p=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=Cg(y,v,"exchange",w),k=function(){if(!j)return x(!0);o({exchange:j})};return Object(We.jsxs)("div",{className:l.mdForm,children:[Object(We.jsx)(Ue,{className:O&&l.error,children:"Choose your exchange"}),Object(We.jsx)(xa,{labelClassName:l.radioLabel,className:l.radioGroup,options:Wr.a(C.filled,C.unfilled),value:j,onChange:function(e){p(e.target.value),x(!1)}}),!Ig(j)&&Object(We.jsx)(Tn,{size:"lg",onClick:k,className:l.button,children:"Continue"}),Ig(j)&&Object(We.jsxs)(We.Fragment,{children:[Object(We.jsxs)("div",{className:l.infoMessage,children:[Object(We.jsx)(ia,{}),Object(We.jsxs)(Ze,{children:["Make sure you set up ",hg[j].name," to enter the necessary information below. Please follow the instructions on our support page if you haven\u2019t."]})]}),Object(We.jsx)(Dr,{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"}[j],label:"".concat(hg[j].name," trading")}),Object(We.jsx)(Ue,{noMargin:!0,children:"Enter exchange information"}),Object(We.jsx)(Df,{value:v[j],save:(a=j,function(e){var t=Object(M.a)({},a,e);return m({variables:{accounts:t}})}),elements:hg[j].elements,validationSchema:hg[j].validationSchema,buttonLabel:"Continue",buttonClass:l.formButton})]})]})},Fg=Object(p.a)(Af),Lg=x()(_f||(_f=Object(l.a)(["\n {\n accountsConfig {\n code\n display\n class\n cryptos\n }\n }\n"]))),Pg=function(e){var t,n,a=e.data,i=e.addData,o=Fg(),l=Object(u.c)(Lg).data,s=Object(r.useState)(null),d=Object(c.a)(s,2),m=d[0],h=d[1],b=Object(r.useState)(!1),j=Object(c.a)(b,2),p=j[0],f=j[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=Cg(O,g,"ticker",x);return Object(We.jsxs)("div",{className:o.mdForm,children:[Object(We.jsx)(Ue,{className:p&&o.error,children:"Choose your ticker"}),Object(We.jsx)(xa,{labelClassName:o.radioLabel,className:o.radioGroup,options:Wr.a(v.filled,v.unfilled),value:m,onChange:function(e){h(e.target.value),f(!1)}}),Object(We.jsx)(Tn,{size:"lg",onClick:function(){if(!m)return f(!0);i({ticker:m})},className:o.button,children:"Continue"})]})},Dg=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.d().shape((t={token:xn.f().max(100,"Too long").required(),environment:xn.f().matches(/(prod|test)/).required()},Object(M.a)(t,"".concat(e,"WalletId"),xn.f().max(100,"Too long").required()),Object(M.a)(t,"".concat(e,"WalletPassphrase"),xn.f().max(100,"Too long").required()),t))}},Bg=Object(p.a)(Af),Rg=x()(Zf||(Zf=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"]))),Ag=x()(Qf||(Qf=Object(l.a)(["\n mutation Save($accounts: JSONObject) {\n saveAccounts(accounts: $accounts)\n }\n"]))),Tg=function(e){return qo.a(e)(["infura","bitgo"])},Wg=function(e){var t,n,a,i=e.data,o=e.addData,l=Bg(),s=Object(u.c)(Rg).data,d=Object(u.b)(Ag,{onCompleted:function(){return S()}}),m=Object(c.a)(d,1)[0],h=Object(r.useState)(null),b=Object(c.a)(h,2),j=b[0],p=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=Cg(y,v,"wallet",w),k=function(e){return function(t){var n=Object(M.a)({},e,t);return m({variables:{accounts:n}})}},S=function(){if(!j)return x(!0);o({wallet:j})};return Object(We.jsxs)("div",{className:l.mdForm,children:[Object(We.jsx)(Ue,{className:O&&l.error,children:"Choose your wallet"}),Object(We.jsx)(xa,{labelClassName:l.radioLabel,className:l.radioGroup,options:Wr.a(C.filled,C.unfilled),value:j,onChange:function(e){p(e.target.value),x(!1)}}),(a=j,qo.a(a)(["bitcoind","geth","litecoind","dashd","zcashd","bitcoincashd"])&&Object(We.jsxs)(We.Fragment,{children:[Object(We.jsxs)("div",{className:l.infoMessage,children:[Object(We.jsx)(ia,{}),Object(We.jsxs)(Ze,{children:["To set up ",j," please read the node wallet instructions from our support portal."]})]}),Object(We.jsx)(Dr,{link:"https://support.lamassu.is/hc/en-us/articles/115001209552-Setting-up-your-node-wallets",label:"Support article"})]})),!Tg(j)&&Object(We.jsx)(Tn,{size:"lg",onClick:S,className:l.button,children:"Continue"}),"bitgo"===j&&Object(We.jsxs)(We.Fragment,{children:[Object(We.jsxs)("div",{className:l.infoMessage,children:[Object(We.jsx)(ia,{}),Object(We.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(We.jsx)(Dr,{link:"https://support.lamassu.is/hc/en-us/articles/360024455592-Setting-up-BitGo",label:"Support article"}),Object(We.jsx)(Ue,{noMargin:!0,children:"Enter wallet information"}),Object(We.jsx)(Df,{value:v.bitgo,save:k(j),elements:Dg(w).elements,validationSchema:Dg(w).validationSchema,buttonLabel:"Continue",buttonClass:l.formButton})]}),"infura"===j&&Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(Ue,{noMargin:!0,children:"Enter wallet information"}),Object(We.jsx)(Df,{value:v.infura,save:k(j),elements:hg.infura.elements,validationSchema:hg.infura.getValidationSchema(v.infura),buttonLabel:"Continue",buttonClass:l.formButton})]})]})},zg=Object(p.a)(Ei),Mg=[{label:"Choose cryptocurrency",component:yg},{label:"Choose wallet",component:Wg},{label:"Choose ticker",component:Pg},{label:"Exchange",component:Eg},{label:"Blockcypher",component:gg},{label:"All set",component:rg}],$g=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=zg(),h="BTC"===(null===d||void 0===d?void 0:d.coin)?Mg:Jf.a(4,1,Mg),b=h[i].component;return Object(We.jsxs)("div",{className:m.wrapper,children:[Object(We.jsx)("div",{className:m.headerDiv,children:Object(We.jsx)(Do,{title:"Wallet settings"})}),Object(We.jsxs)("div",{className:m.contentDiv,children:[Object(We.jsx)(di,{children:h.map((function(e,t){return Object(We.jsx)(ui,{step:i,it:e,idx:t,steps:h},t)}))}),Object(We.jsx)("div",{className:m.contentWrapper,children:Object(We.jsx)(b,{data:d,addData:function(e){u(Yn.a(d,e)),o(i+1)},doContinue:t})})]})]})},qg={welcome:{textAlign:"center",paddingTop:256},title:{lineHeight:1,fontSize:48},getStarted:{fontSize:24,fontWeight:500,marginBottom:54,color:q}},Hg=Object(p.a)(qg);var Vg=function(e,t){var n=vl(sl,e);return W.a((function(e){return df.isValidSync(vl(e.code,n))}))(t)},Ug=function(e,t){return e?function(e,t){var n=vl(sl,e),r=B.a((function(e){return vl(e.code,n)}))(t);return L.a(zo.a(bp.a),B.a((function(e){return df.isValidSync(e)})))(r)}(e,t)?function(e){var t=vl(ml,e);return Qp.isValidSync(t)}(e)?function(e){var t=vl(hl,e),n=vl(ml,e);return Rp(n).isValidSync(t)}(e)?0:3:2:1:0},Yg=[{id:"welcome",Component:function(e){var t=e.doContinue,n=Hg();return Object(We.jsxs)("div",{className:n.welcome,children:[Object(We.jsx)(qe,{className:n.title,children:"Welcome to the Lamassu Admin"}),Object(We.jsxs)(Ge,{className:n.getStarted,children:["To get you started, we\u2019ve put together a wizard that will",Object(We.jsx)("br",{}),"help set up what you need before pairing your machines."]}),Object(We.jsx)(Tn,{size:"xl",onClick:t,children:"Get started"})]})}},{id:"wallet",Component:$g,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:If,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:Kf,exImage:"/assets/wizard/fullexample.twilio.png",subtitle:"Twilio (SMS service)",text:Object(We.jsxs)(We.Fragment,{children:["Twilio is used for SMS operator notifications, phone number collection for compliance, and 1-confirmation redemptions on cash-out transactions.",Object(We.jsx)("br",{}),"You'll need to configure Twilio if you're offering cash-out or any compliance options"]})},{id:"commissions",Component:yf,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."}],Gg=n(920),Xg=n(417),_g=Object(p.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]]}}}),Zg=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"]),j=_g({width:t,height:n,small:i,infoPanelHeight:r,xl:o}),p=i?Ue:qe,f=o?28:i?16:20;return Object(We.jsx)(Xg.a,Object(s.a)(Object(s.a)({onClose:function(e,t){(h||"backdropClick"!==t)&&(m||"escapeKeyDown"!==t)&&l()},className:j.modal},b),{},{children:Object(We.jsxs)(We.Fragment,{children:[Object(We.jsxs)(Un.a,{className:E()(j.wrapper,u),children:[Object(We.jsxs)("div",{className:j.header,children:[a&&Object(We.jsx)(p,{className:j.title,children:a}),Object(We.jsx)(tr,{size:f,className:j.button,onClick:function(){return l()},children:Object(We.jsx)(gi,{})})]}),Object(We.jsx)("div",{className:j.content,children:d})]}),c&&Object(We.jsx)(Un.a,{className:E()(j.infoPanelWrapper,u),children:Object(We.jsx)("div",{className:j.panelContent,children:c})})]})}))},Qg=n(919);function Kg(){return(Kg=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 Jg(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 eO=r.createElement("desc",null,"Created with Sketch."),tO=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 nO(e,t){var n=e.title,a=e.titleId,i=Jg(e,["title","titleId"]);return r.createElement("svg",Kg({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,eO,tO)}var rO=r.forwardRef(nO),aO=(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}}),iO=Object(p.a)(aO),oO=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=iO(),s=(t={},Object(M.a)(t,l.separator,!0),Object(M.a)(t,l.separatorSpring,"spring"===o),Object(M.a)(t,l.separatorZodiac,"zodiac"===o),t),d=(n={},Object(M.a)(n,l.separator,!0),Object(M.a)(n,l.separatorSpringEmpty,"spring"===o),Object(M.a)(n,l.separatorZodiacEmpty,"zodiac"===o),n);return Object(We.jsxs)("div",{className:E()(c,l.stages),children:[Qg.a(1,a).map((function(e){return Object(We.jsxs)("div",{className:l.wrapper,children:[e>1&&Object(We.jsx)("div",{className:E()(s)}),Object(We.jsxs)("div",{className:l.stage,children:["spring"===o&&Object(We.jsx)(Si,{}),"zodiac"===o&&Object(We.jsx)(Qa,{})]})]},e)})),Object(We.jsxs)("div",{className:l.wrapper,children:[a>1&&Object(We.jsx)("div",{className:E()(s)}),Object(We.jsxs)("div",{className:l.stage,children:["spring"===o&&Object(We.jsx)(rO,{}),"zodiac"===o&&Object(We.jsx)(ai,{})]})]}),Qg.a(a+1,r+1).map((function(e){return Object(We.jsxs)("div",{className:l.wrapper,children:[Object(We.jsx)("div",{className:E()(d)}),Object(We.jsxs)("div",{className:l.stage,children:["spring"===o&&Object(We.jsx)(jt,{}),"zodiac"===o&&Object(We.jsx)(vt,{})]})]},e)}))]})})),cO=Object(p.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 lO,sO=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=cO(),m=Object(r.useState)(!1),b=Object(c.a)(m,2),j=b[0],p=b[1],f=(t={},Object(M.a)(t,u.wrapper,!0),Object(M.a)(t,u.smallWrapper,!s),t);return Object(We.jsxs)(Gg.a,{anchor:"bottom",open:!0,variant:"persistent",classes:{paperAnchorDockedBottom:u.drawer},children:[Object(We.jsxs)("div",{className:E()(f),children:[Object(We.jsxs)(h.a,{container:!0,direction:"row",justify:"center",alignItems:"baseline",children:[Object(We.jsxs)(h.a,{item:!0,xs:5,container:!0,direction:s?"column":"row",justify:"flex-start",alignItems:"baseline",children:[Object(We.jsx)(He,{className:u.title,children:"Setup Lamassu Admin"}),Object(We.jsx)(_e,{className:u.subtitle,children:i}),s&&Object(We.jsx)(Ge,{children:o})]}),Object(We.jsx)(h.a,{item:!0,xs:4,container:!0,direction:"column",justify:"flex-start",alignItems:"flex-end",spacing:5,children:Object(We.jsx)(h.a,{item:!0,xs:12,children:a&&n&&Object(We.jsx)(oO,{currentStep:n,steps:a})})})]}),s&&Object(We.jsxs)(h.a,{container:!0,direction:"row",justify:"center",alignItems:"baseline",children:[Object(We.jsx)(h.a,{item:!0,xs:5,container:!0,direction:"column",justify:"flex-start",alignItems:"flex-start",children:Object(We.jsx)(or,{onClick:function(){p(!0)},children:"See full example"})}),Object(We.jsx)(h.a,{item:!0,xs:4,container:!0,direction:"column",justify:"flex-start",alignItems:"flex-end",spacing:5,children:Object(We.jsx)(h.a,{item:!0,children:Object(We.jsx)(Tn,{size:"lg",onClick:d,children:"Get Started"})})})]})]}),Object(We.jsx)(Zg,{closeOnEscape:!0,closeOnBackdropClick:!0,className:u.modal,xl:!0,width:1328,handleClose:function(){p(!1)},open:j,children:Object(We.jsx)("img",{width:1152,src:l,alt:""})})]})},dO=Object(p.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"}}),uO=x()(lO||(lO=Object(l.a)(["\n query getData {\n config\n accounts\n cryptoCurrencies {\n code\n display\n }\n }\n"]))),mO=function(e){e.fromAuthRegister;var t,n,a=dO(),i=Object(u.c)(uO),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],j=h[1],p=Object(r.useState)(!0),f=Object(c.a)(p,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(We.jsx)(We.Fragment,{});var S=Ug(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(M.a)(n,a.blurred,y),Object(M.a)(n,a.wrapper,!0),Object(M.a)(n,a.welcomeBackground,I),n),L=Yg[b];return Object(We.jsxs)(un.a,{fullScreen:!0,open:g,children:[Object(We.jsx)(mn.a,{className:E()(F),children:Object(We.jsx)(L.Component,{doContinue:function(){b>=Yg.length-1&&(O(!1),s.push("/"));var e=0===b&&S?S:b+1;C(!0),j(e)},isActive:!y})}),!I&&Object(We.jsx)(sO,{currentStep:b,steps:Yg.length-1,exImage:L.exImage,subtitle:L.subtitle,text:L.text,open:y,start:function(){C(!1)}})]})},hO=function(e){return!D.a(null===e||void 0===e?void 0:e.id)&&!D.a(null===e||void 0===e?void 0:e.username)&&!D.a(null===e||void 0===e?void 0:e.role)},bO="user",jO="superuser",pO=function(e){var t=Object.assign({},e),n=Object(r.useContext)(k).userData;return hO(n)?Object(We.jsx)(w.c,Object(s.a)({},t)):Object(We.jsx)(w.b,{to:"/login"})},fO=function(e){var t=e.component,n=e.restricted,a=Object($.a)(e,["component","restricted"]),i=Object(r.useContext)(k).userData;return Object(We.jsx)(w.c,Object(s.a)(Object(s.a)({},a),{},{render:function(e){return hO(i)&&n?Object(We.jsx)(w.b,{to:"/"}):Object(We.jsx)(t,Object(s.a)({},e))}}))},gO=n(922),OO={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}},xO=n(921),vO=Object(p.a)(OO),yO=function(e){var t=e.onClose,n=e.selectedCoin,r=e.addToBlacklist,a=e.errorMsg,i=vO();return Object(We.jsxs)(Zg,{closeOnBackdropClick:!0,width:676,height:200,handleClose:t,open:!0,children:[Object(We.jsx)(jn.d,{validateOnBlur:!1,validateOnChange:!1,initialValues:{address:""},validationSchema:xn.d({address:xn.f().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(We.jsxs)(jn.c,{id:"address-form",children:[Object(We.jsx)(Ve,{className:i.modalTitle,children:n.display?"Blacklist ".concat(xO.a(n.display)," address"):""}),Object(We.jsx)("span",{className:i.error,children:a}),Object(We.jsx)(jn.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(We.jsx)("div",{className:i.footer,children:Object(We.jsx)(No.a,{display:"flex",justifyContent:"flex-end",children:Object(We.jsx)(or,{type:"submit",form:"address-form",children:"Blacklist address"})})})]})};function wO(){return(wO=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 CO(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 kO=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"}))),SO=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 NO(e,t){var n=e.title,a=e.titleId,i=CO(e,["title","titleId"]);return r.createElement("svg",wO({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,kO,SO)}var IO,EO,FO,LO,PO,DO,BO,RO=r.forwardRef(NO),AO=(n.p,Object(p.a)({emptyTable:{width:"100%",display:"flex",flexDirection:"column",alignItems:"center",marginTop:52}})),TO=Object(r.memo)((function(e){var t=e.message,n=AO();return Object(We.jsxs)("div",{className:n.emptyTable,children:[Object(We.jsx)(RO,{}),Object(We.jsx)(Ue,{children:t})]})})),WO=Object(p.a)({table:{tableLayout:"fixed",borderCollapse:"separate",borderSpacing:"0 0"}}),zO=Object(r.memo)((function(e){var t=e.className,n=e.children,r=Object($.a)(e,["className","children"]),a=WO();return Object(We.jsx)("table",Object(s.a)(Object(s.a)({},r),{},{className:E()(a.table,t),children:n}))})),MO=Object(r.memo)((function(e){var t=e.children,n=Object($.a)(e,["children"]);return Object(We.jsx)("tbody",Object(s.a)(Object(s.a)({},n),{},{children:t}))})),$O=Object(p.a)({td:{padding:[[0,24]]},alignRight:{textAlign:"right"}}),qO=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=$O(),l=(t={},Object(M.a)(t,c.td,!0),Object(M.a)(t,c.alignRight,r),t);return Object(We.jsx)("td",Object(s.a)(Object(s.a)({colSpan:n,className:E()(l,a)},o),{},{children:i}))})),HO=Object(r.memo)((function(e){var t=e.children,n=Object($.a)(e,["children"]);return Object(We.jsx)("thead",Object(s.a)(Object(s.a)({},n),{},{children:t}))})),VO=Re.tl2,UO=Object(p.a)({th:{extend:VO,backgroundColor:Le,height:Ie,textAlign:"left",color:Z,padding:"0 ".concat(24,"px")},alignRight:{textAlign:"right"}}),YO=Object(r.memo)((function(e){var t,n=e.rightAlign,r=e.children,a=e.className,i=Object($.a)(e,["rightAlign","children","className"]),o=UO(),c=(t={},Object(M.a)(t,o.th,!0),Object(M.a)(t,o.alignRight,n),t);return Object(We.jsx)("th",Object(s.a)(Object(s.a)({},i),{},{className:E()(c,a),children:r}))})),GO=Re.info2,XO=Re.p,_O=Object(p.a)({tr:{extend:XO,padding:4,height:Ee,backgroundColor:"#ffffff"},lg:{extend:GO,height:76},sm:{height:30},error:{backgroundColor:Pe},success:{backgroundColor:De}}),ZO=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=_O(),m=(t={},Object(M.a)(t,u.tr,!a),Object(M.a)(t,u.sm,!a&&"sm"===l),Object(M.a)(t,u.lg,!a&&"lg"===l),Object(M.a)(t,u.error,i),Object(M.a)(t,u.success,o),t);return Object(We.jsx)("tr",Object(s.a)(Object(s.a)({className:E()(m,n)},d),{},{children:r}))})),QO=Object(p.a)($j),KO=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"]),j=QO(),p=m||u,f=(t={},Object(M.a)(t,j.pointer,p),Object(M.a)(t,j.row,!0),Object(M.a)(t,j.expanded,c),t);return Object(We.jsxs)("div",{className:j.rowWrapper,children:[Object(We.jsx)("div",{className:E()(Object(M.a)({},j.before,c&&0!==n)),children:Object(We.jsxs)(tu,{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(We.jsx)(Kd,Object(s.a)(Object(s.a)({},i),{},{children:r(a)}),t)})),u&&Object(We.jsx)(Kd,{width:d,textAlign:"center",children:Object(We.jsxs)("button",{onClick:function(){return l(n,a)},className:j.expandButton,children:[c&&Object(We.jsx)(rp,{}),!c&&Object(We.jsx)(Gj,{})]})})]})}),u&&c&&Object(We.jsx)("div",{className:j.after,children:Object(We.jsx)(tu,{className:E()(Object(M.a)({},j.expanded,c)),children:Object(We.jsx)(Kd,{width:i,children:Object(We.jsx)(o,{it:a,timezone:b.timezone})})})})]})},JO=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,j=Object($.a)(e,["elements","data","Details","className","expandable","initialExpanded","onClick","loading","emptyText","rowSize"]),p=Object(r.useState)(d),f=Object(c.a)(p,2),g=f[0],O=f[1];Object(r.useEffect)((function(){return O(d)}),[d]);var x=L.a(El.a,B.a(R.a("width")))(n),v=1200-x,y=x+(l?v:0),w=QO({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 Mj.c({defaultHeight:58,fixedWidth:!0});function S(e){var t=e.index,r=e.key,a=e.parent,c=e.style;return Object(We.jsx)(Mj.b,{cache:k,columnIndex:0,parent:a,rowIndex:t,children:function(e){var r=e.registerChild;return Object(We.jsx)("div",{ref:r,style:c,children:Object(We.jsx)(KO,{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:j.timezone})})}},r)}return Object(We.jsx)(No.a,{display:"flex",flex:"1",flexDirection:"column",children:Object(We.jsxs)(Xd,{className:w.table,children:[Object(We.jsxs)(_d,{children:[n.map((function(e,t){var n=e.width,r=e.className,a=e.textAlign,i=e.header;return Object(We.jsx)(Jd,{width:n,className:r,textAlign:a,children:i},t)})),l&&Object(We.jsx)(Jd,{width:v})]}),Object(We.jsxs)(Qd,{className:w.body,children:[m&&Object(We.jsx)(Ue,{children:"Loading..."}),!m&&zr.a(i)&&Object(We.jsx)(TO,{message:h}),Object(We.jsx)(Mj.a,{disableWidth:!0,children:function(e){var t=e.height;return Object(We.jsx)(Mj.d,Object(s.a)(Object(s.a)({style:{overflowX:"inherit",overflowY:"inherit",outline:"none"}},j),{},{height:m?0:t,width:y,rowCount:i.length,rowHeight:k.rowHeight,rowRenderer:S,overscanRowCount:5,deferredMeasurementCache:k}))}})]})]})})},ex=Object(p.a)(OO),tx=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=ex(),u=Object(r.useState)(),m=Object(c.a)(u,2),h=m[0],b=m[1],j=[{name:"address",header:Object(We.jsx)(et,{className:d.white,children:"Addresses"}),width:800,textAlign:"left",size:"sm",view:function(e){return Object(We.jsx)("div",{className:d.addressRow,children:Object(We.jsx)(Ej,{children:T.a(["address"],e)})})}},{name:"deleteButton",header:Object(We.jsx)(et,{className:d.white,children:"Delete"}),width:130,textAlign:"center",size:"sm",view:function(e){return Object(We.jsx)(tr,{className:d.deleteButton,onClick:function(){s(!0),b(e)},children:Object(We.jsx)(Vu,{})})}}],p=n?t[n.code]:t[nl.a(t)[0]];return Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(JO,{data:p,elements:j,emptyText:"No blacklisted addresses so far",name:"blacklistTable"}),Object(We.jsx)(Ou,{open:l,onDismissed:function(){s(!1),o(null)},onConfirmed:function(){o(null),a(T.a(["cryptoCode"],h),T.a(["address"],h))},errorMessage:i})]})},nx=Object(p.a)(OO),rx=gO.a((function(e){return e.cryptoCode})),ax=x()(IO||(IO=Object(l.a)(["\n mutation DeleteBlacklistRow($cryptoCode: String!, $address: String!) {\n deleteBlacklistRow(cryptoCode: $cryptoCode, address: $address) {\n cryptoCode\n address\n }\n }\n"]))),ix=x()(EO||(EO=Object(l.a)(["\n query getBlacklistData {\n blacklist {\n cryptoCode\n address\n }\n cryptoCurrencies {\n display\n code\n }\n }\n"]))),ox=x()(FO||(FO=Object(l.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),cx=x()(LO||(LO=Object(l.a)(["\n query getData {\n config\n }\n"]))),lx=x()(PO||(PO=Object(l.a)(["\n mutation InsertBlacklistRow($cryptoCode: String!, $address: String!) {\n insertBlacklistRow(cryptoCode: $cryptoCode, address: $address) {\n cryptoCode\n address\n }\n }\n"]))),sx=function(){var e,t,n,a=Object(u.c)(ix).data,i=Object(u.c)(cx).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),j=b[0],p=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)(ax,{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)(lx,{onError:function(){return console.log("Error while adding row")},refetchQueries:function(){return["getBlacklistData"]}}),I=Object(c.a)(N,1)[0],E=Object(u.b)(ox,{refetchQueries:function(){return["getData"]}}),F=Object(c.a)(E,1)[0],L=nx(),P=null!==(e=T.a(["blacklist"])(a))&&void 0!==e?e:[],B=null!==(t=T.a(["cryptoCurrencies"],a))&&void 0!==t?t:[],R=rx(P),A=(null===i||void 0===i?void 0:i.config)&&vl("compliance")(i.config),W=null!==(n=null===A||void 0===A?void 0:A.rejectAddressReuse)&&void 0!==n&&n,M=function(e,t){try{return!D.a(Gh.utils.parseUrl(e,"main",t))}catch(n){return!1}},$=function(){var e=Object(ec.a)(Jo.a.mark((function e(t,n){var r,a;return Jo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(x(null),M(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(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(Do,{title:"Blacklisted addresses",children:Object(We.jsx)(No.a,{display:"flex",justifyContent:"flex-end",children:Object(We.jsx)(or,{color:"primary",onClick:function(){return d(!0)},children:"Blacklist new addresses"})})}),Object(We.jsxs)(h.a,{container:!0,className:L.grid,children:[Object(We.jsx)(di,{data:B,isSelected:z.a("code",j.code),displayName:function(e){return e.display},onClick:function(e){p({code:e.code,display:e.display})}}),Object(We.jsxs)("div",{className:L.content,children:[Object(We.jsxs)(No.a,{display:"flex",justifyContent:"space-between",mb:3,children:[Object(We.jsxs)(Ue,{noMargin:!0,className:L.subtitle,children:[j.display?"".concat(j.display," blacklisted addresses"):""," "]}),Object(We.jsxs)(No.a,{display:"flex",alignItems:"center",justifyContent:"flex-end",mr:"-5px",children:[Object(We.jsx)(Ge,{children:"Reject reused addresses"}),Object(We.jsx)(Ca,{checked:W,onChange:function(e){!function(e){var t=yl("compliance")(e);F({variables:{config:t}})}({rejectAddressReuse:e.target.checked})},value:W}),Object(We.jsx)(tt,{children:W?"On":"Off"}),Object(We.jsx)(sb,{width:304,children:Object(We.jsx)(Ge,{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(We.jsx)(tx,{data:R,selectedCoin:j,handleDeleteEntry:function(e,t){S({variables:{cryptoCode:e,address:t}})},errorMessage:O,setErrorMessage:x,deleteDialog:w,setDeleteDialog:C})]})]}),s&&Object(We.jsx)(yO,{onClose:function(){x(null),d(!1)},errorMsg:O,selectedCoin:j,addToBlacklist:$})]})},dx={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:_,marginBottom:12,marginTop:30,textAlign:"center"},titleDecorator:{verticalAlign:"bottom",marginRight:12,width:24,height:26}},ux=Object(p.a)(dx),mx=function(e){var t=e.name,n=e.onContinue,r=ux();return Object(We.jsxs)("div",{className:r.modalContent,children:[Object(We.jsxs)("div",{className:r.innerContent,children:[Object(We.jsxs)(qe,{className:r.title,children:[Object(We.jsx)(Kc,{className:r.titleDecorator}),Object(We.jsx)("span",{children:"Enable cash-out"})]}),Object(We.jsx)(_e,{className:r.subtitle,children:t}),Object(We.jsxs)(Ge,{children:["You are about to activate cash-out functionality on your ",t," ","machine which will allow your customers to sell crypto to you."]}),Object(We.jsx)(Ge,{children:"In order to activate cash-out for this machine, please enter the denominations for the machine."})]}),Object(We.jsx)(Tn,{className:r.button,onClick:n,children:"Start configuration"})]})},hx=n.p+"static/media/cashout-cassette-1.fac6c691.svg",bx=n.p+"static/media/cashout-cassette-2.34a98cfa.svg",jx={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",paddingBottom: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]]}},px=Object(p.a)(jx),fx=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=px(),u=i?"Finish":"Next",m={1:hx,2:bx};return Object(We.jsxs)("div",{className:d.content,children:[Object(We.jsxs)("div",{className:d.titleDiv,children:[Object(We.jsx)(_e,{className:d.title,children:t}),Object(We.jsx)(oO,{steps:3,currentStep:n})]}),n<=2&&Object(We.jsx)(jn.d,{validateOnBlur:!1,validateOnChange:!1,onSubmit:o,initialValues:{top:"",bottom:""},enableReinitialize:!0,validationSchema:r,children:Object(We.jsxs)(jn.c,{children:[Object(We.jsxs)("div",{className:d.header,children:[c.map((function(e,t){var r=e.type,a=e.display,i=e.component;return 1+t===n&&Object(We.jsxs)("div",{className:d.step,children:[Object(We.jsxs)(Ue,{className:d.edit,children:["Edit ",a]}),Object(We.jsx)(et,{children:"Choose bill denomination"}),Object(We.jsxs)("div",{className:d.bill,children:[Object(We.jsx)(jn.b,{className:d.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(We.jsx)(Xe,{noMargin:!0,className:d.suffix,children:l})]})]},t)})),Object(We.jsx)("img",{className:d.stepImage,alt:"cassette",width:"148",height:"196",src:m[n]})]}),Object(We.jsx)(Tn,{className:d.submit,type:"submit",children:u})]})}),i&&Object(We.jsxs)("div",{className:d.disclaimer,children:[Object(We.jsx)(_e,{className:d.title,children:"Cash-out Bill Count"}),Object(We.jsxs)(Ge,{children:[Object(We.jsx)(ia,{className:d.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(We.jsx)(_e,{className:d.title,children:"Default Commissions"}),Object(We.jsxs)(Ge,{children:[Object(We.jsx)(ia,{className:d.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(We.jsxs)("div",{children:[a&&Object(We.jsx)(Fo,{children:"Failed to save"}),Object(We.jsx)(Tn,{className:d.submit,onClick:function(){return o()},children:u})]})]})]})},gx=xn.d().shape({top:xn.c().label("Cassette 1 (Top)").required().min(1).max(wp),bottom:xn.c().label("Cassette 2 (Bottom)").required().min(1).max(wp)}),Ox=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=yp(t,vp),a=(null===r||void 0===r?void 0:r.length)>0?{options:r,labelProp:"display",valueProp:"code",className:n.autoComplete}:{decimalPlaces:0};return[{name:"id",header:"Machine",width:300,view:function(t){return e.find((function(e){return e.deviceId===t})).name},size:"sm",editable:!1},{name:"top",header:"Cassette 1 (Top)",stripe:!0,width:250,textAlign:"right",view:function(e){return e},input:(null===r||void 0===r?void 0:r.length)>0?ka:qa,inputProps:a,suffix:R.a("fiatCurrency")(t),bold:Vr},{name:"bottom",header:"Cassette 2 (Bottom)",stripe:!0,textAlign:"right",width:250,view:function(e){return e},input:(null===r||void 0===r?void 0:r.length)>0?ka:qa,inputProps:a,suffix:R.a("fiatCurrency")(t),bold:Vr}]},xx=function(e){var t=e.machine,n=e.locale,a=e.onClose,i=e.save,o=e.error,l=Object(r.useState)({step:0,config:{active:!0}}),s=Object(c.a)(l,2),d=s[0],u=d.step,m=d.config,h=s[1],b=yp(n,vp),j=3===u,p=function(){var e=Object(ec.a)(Jo.a.mark((function e(n){var r;return Jo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!j){e.next=2;break}return e.abrupt("return",i(yl(t.deviceId,gx.cast(m))));case 2:r=Yn.a(m,n),h({step:u+1,config:r});case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),f=[{type:"top",display:"Cassette 1 (Top)",component:ka,inputProps:{options:B.a((function(e){return{code:e,display:e}}))(b),labelProp:"display",valueProp:"code"}},{type:"bottom",display:"Cassette 2",component:ka,inputProps:{options:B.a((function(e){return{code:e,display:e}}))(b),labelProp:"display",valueProp:"code"}}];return Object(We.jsxs)(Zg,{title:0===u?null:"Enable cash-out",handleClose:a,width:554,height:520,open:!0,children:[0===u&&Object(We.jsx)(mx,{name:t.name,onContinue:function(){return p()}}),0!==u&&Object(We.jsx)(fx,{step:u,name:t.name,error:o,lastStep:j,steps:f,fiatCurrency:n.fiatCurrency,options:b,schema:xn.d().shape({top:xn.c().required(),bottom:u>=2?xn.c().required():xn.c()}),onContinue:p})]})},vx=Object(p.a)({fudgeFactor:{display:"flex",alignItems:"center",marginRight:156},switchLabel:{margin:6,width:24},autoComplete:{width:"100%"}}),yx=x()(DO||(DO=Object(l.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),wx=x()(BO||(BO=Object(l.a)(["\n query getData {\n machines {\n name\n deviceId\n cashbox\n cassette1\n cassette2\n }\n config\n }\n"]))),Cx=function(e){var t,n,a=e.name,i=vx(),o=Object(r.useState)(!1),l=Object(c.a)(o,2),s=l[0],d=l[1],m=Object(u.c)(wx).data,h=Object(u.b)(yx,{onCompleted:function(){return d(!1)},refetchQueries:function(){return["getData"]}}),b=Object(c.a)(h,2),j=b[0],p=b[1].error,f=function(e,t){var n=yl(a)(e);return j({variables:{config:n,accounts:t}})},g=(null===m||void 0===m?void 0:m.config)&&vl(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)&&vl("locale")(m.config),v=null!==(n=null===m||void 0===m?void 0:m.machines)&&void 0!==n?n:[];return Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(Do,{title:"Cash-out",children:Object(We.jsxs)("div",{className:i.fudgeFactor,children:[Object(We.jsx)(Ge,{children:"Transaction fudge factor"}),Object(We.jsx)(Ca,{checked:O,onChange:function(e){f({fudgeFactorActive:e.target.checked})},value:O}),Object(We.jsx)(tt,{className:i.switchLabel,children:O?"On":"Off"}),Object(We.jsxs)(sb,{width:304,children:[Object(We.jsx)(Ge,{children:"Automatically accept customer deposits as complete if their received amount is 100 crypto atoms or less."}),Object(We.jsx)(Ge,{children:"(Crypto atoms are the smallest unit in each cryptocurrency. E.g., satoshis in Bitcoin, or wei in Ethereum.)"})]})]})}),Object(We.jsx)(jm,{namespaces:B.a(T.a(["deviceId"]))(v),data:g,stripeWhen:function(e){return 1===L.a(gn.a,nl.a)(e)},enableEdit:!0,editWidth:134,enableToggle:!0,toggleWidth:109,onToggle:function(e){var t=vl(e)(g);if(!gx.isValidSync(t))return d(e);f(yl(e,{active:!(null===t||void 0===t?void 0:t.active)}))},save:f,error:null===p||void 0===p?void 0:p.message,validationSchema:gx,disableRowEdit:L.a(P.a,T.a(["active"])),elements:Ox(v,x,i)}),zr.a(v)&&Object(We.jsx)(TO,{message:"No machines so far"}),s&&Object(We.jsx)(xx,{machine:Tr.a(z.a("deviceId",s))(v),onClose:function(){return d(!1)},save:f,error:null===p||void 0===p?void 0:p.message,locale:x})]})},kx=n(925),Sx=n(926);function Nx(){return(Nx=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 Ix(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 Ex=r.createElement("desc",null,"Created with Sketch."),Fx=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 Lx(e,t){var n=e.title,a=e.titleId,i=Ix(e,["title","titleId"]);return r.createElement("svg",Nx({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,Ex,Fx)}var Px=r.forwardRef(Lx);n.p;function Dx(){return(Dx=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 Bx(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 Rx=r.createElement("desc",null,"Created with Sketch."),Ax=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 Tx(e,t){var n=e.title,a=e.titleId,i=Bx(e,["title","titleId"]);return r.createElement("svg",Dx({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,Rx,Ax)}var Wx=r.forwardRef(Tx);n.p;function zx(){return(zx=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 Mx(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 $x=r.createElement("rect",{width:12,height:12,rx:3,ry:3,fill:"#44e188"});function qx(e,t){var n=e.title,a=e.titleId,i=Mx(e,["title","titleId"]);return r.createElement("svg",zx({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,$x)}var Hx,Vx,Ux=r.forwardRef(qx),Yx=(n.p,n(957)),Gx=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],j=Object(r.useState)(!1),p=Object(c.a)(j,2),f=p[0],g=p[1],O=n&&!zr.a(n)?n:Tp,x=null!==(t=null===O||void 0===O?void 0:O.overrides)&&void 0!==t?t:[],v=Wd.a([Lm.a(zp),Lm.a(R.a("machine"))])(x);return Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(jf,{children:Object(We.jsx)(bm,{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:Rp(a),data:Yx.a(O),elements:Pp(i),setEditing:function(e,t){return b(t)},forceDisable:f})}),Object(We.jsx)(jf,{children:Object(We.jsx)(bm,{error:null===l||void 0===l?void 0:l.message,title:"Overrides",titleLg:!0,name:"overrides",enableDelete:!0,enableEdit:!0,enableCreate:!0,groupBy:zp,initialValues:Wp,save:d,validationSchema:Ap(v,o,a),data:v,elements:Dp(o,i),setEditing:function(e,t){return g(t)},forceDisable:h})})]})})),Xx=n(923),_x=n(924),Zx=n(940),Qx={code:"SHOW_ALL",display:"Show all"},Kx=[{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"}],Jx=Object(p.a)({headerLine:{display:"flex",justifyContent:"",marginBottom:24},select:{marginRight:24},tableWrapper:{flex:1,display:"block",overflowY:"auto",width:"100%",maxHeight:"70vh"}}),ev=function(e,t){return{code:e,display:t||e}},tv=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=Jx(),u=Object(r.useState)(Qx),m=Object(c.a)(u,2),h=m[0],b=m[1],j=Object(r.useState)(Qx),p=Object(c.a)(j,2),f=p[0],g=p[1],O=Object(r.useState)(Kx[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(ev)(w),k=Xx.a(R.a("display"),B.a((function(e){return ev(R.a("deviceId",e),R.a("name",e))}))(R.a("machines",o))),S=Zx.a(B.a((function(e){var t,n=null===(t=R.a("overrides",a))||void 0===t?void 0:t.find(z.a("machine",e)),r=n?R.a("cryptoCurrencies",n):w;return _x.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&&zr.a(a))return Mp(e,t,!0,n);var i=Tr.a((function(n){return n.machine===t&&jp.includes(e)(n.cryptoCurrencies)}))(a);if(void 0!==i)return Mp(e,t,!1,i);var o=Tr.a((function(e){return e.machine===t&&jp.includes("ALL_COINS")(e.cryptoCurrencies)}))(a);if(void 0!==o)return Mp(e,t,!1,o);var c=Tr.a((function(t){return"ALL_MACHINES"===t.machine&&jp.includes(e)(t.cryptoCurrencies)}))(a);return void 0!==c?Mp(e,t,!1,c):Mp(e,t,!0,n)}(t[1],r,n)}))(S),I=L.a(function(e){switch(e){case Kx[0]:return Xx.a(Tr.a(z.a("code",R.a("machine"))));case Kx[1]:return Xx.a(T.a(["cryptoCurrencies",0]));default:return Xx.a(R.a(e.code))}}(v),function(e,t){return L.a(W.a((function(e){return t===Qx|t.code===e.machine})),W.a((function(t){return e===Qx|e.code===t.cryptoCurrencies[0]})))}(f,h))(N);return Object(We.jsxs)("div",{children:[Object(We.jsxs)("div",{className:d.headerLine,children:[Object(We.jsx)(Pu,{className:d.select,onSelectedItemChange:b,label:"Machines",default:Qx,items:[Qx].concat(k),selectedItem:h}),Object(We.jsx)(Pu,{className:d.select,onSelectedItemChange:g,label:"Cryptocurrency",default:Qx,items:[Qx].concat(C),selectedItem:f}),Object(We.jsx)(Pu,{onSelectedItemChange:y,label:"Sort by",default:Kx[0],items:Kx,selectedItem:v})]}),Object(We.jsx)("div",{className:d.tableWrapper,children:Object(We.jsx)(bm,{error:null===l||void 0===l?void 0:l.message,name:"comissionsList",enableEdit:!0,save:s,initialValues:Wp,validationSchema:$p(a),data:I,elements:Hp(o,i)})})]})})),nv=Object(p.a)({listViewButton:{marginLeft:4}}),rv=x()(Hx||(Hx=Object(l.a)(["\n query getData {\n config\n cryptoCurrencies {\n code\n display\n }\n machines {\n name\n deviceId\n }\n }\n"]))),av=x()(Vx||(Vx=Object(l.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),iv=function(e){var t,n=e.name,a=nv(),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],j=Object(u.c)(rv),p=j.data,f=j.loading,g=Object(u.b)(av,{refetchQueries:function(){return["getData"]},onError:function(e){return b(e)}}),O=Object(c.a)(g,1)[0],x=(null===p||void 0===p?void 0:p.config)&&vl(n)(p.config),v=(null===p||void 0===p?void 0:p.config)&&vl(ml)(p.config),y=R.a("fiatCurrency")(v),w=R.a("overrides")(x),C=l?[{label:"Override value",icon:Object(We.jsx)(Ux,{})}]:[];return Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(Do,{title:"Commissions",labels:C,button:{text:"List view",icon:Wx,inverseIcon:Px,toggle:s},iconClassName:a.listViewButton}),!l&&!f&&Object(We.jsx)(Gx,{config:x,locale:v,currency:y,data:p,error:h,save:function(e){var t=yl(n)(e.commissions[0]);return O({variables:{config:t}})},saveOverrides:function(e){var t=yl(n)(e);return b(null),O({variables:{config:t}})},classes:a}),l&&!f&&Object(We.jsx)(tv,{config:x,localeConfig:v,currency:y,data:p,error:h,saveOverrides:(t=w,function(e,n){var r,a=T.a(["cryptoCurrencies",0],n),i=$r.a("machine",n),o=W.a(tf.a(i,(function(e){return!$r.a("cryptoCurrencies",n,e)}))),c=(r=a,function(e){return kx.a(e,{cryptoCurrencies:Sx.a([r],e.cryptoCurrencies)})}),l=B.a(c)(o(t)).concat(W.a((function(e){return!i(e)}),t)),s={commissions_overrides:Ad.a(n,l)};return O({variables:{config:s}})})})]})},ov=n(927);function cv(){return(cv=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 lv(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 sv=r.createElement("desc",null,"Created with Sketch."),dv=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 uv(e,t){var n=e.title,a=e.titleId,i=lv(e,["title","titleId"]);return r.createElement("svg",cv({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,sv,dv)}var mv=r.forwardRef(uv);n.p;function hv(){return(hv=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 bv(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 jv=r.createElement("desc",null,"Created with Sketch."),pv=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 fv(e,t){var n=e.title,a=e.titleId,i=bv(e,["title","titleId"]);return r.createElement("svg",hv({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,jv,pv)}var gv=r.forwardRef(fv),Ov=(n.p,{label1:{display:"flex",marginBottom:2,marginTop:"auto",width:85},label1Pending:{color:q},label1Rejected:{color:Q},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"}}),xv=Object(p.a)(Ov),vv="automatic",yv="verified",wv="blocked",Cv=Object(r.memo)((function(e){var t,n=e.className,r=e.title,a=e.state,i=e.authorize,o=e.reject,c=e.children,l=xv(),s=(t={},Object(M.a)(t,l.label1,!0),Object(M.a)(t,l.label1Pending,a===vv),Object(M.a)(t,l.label1Rejected,a===wv),Object(M.a)(t,l.label1Accepted,a===yv),t),d=a===vv?{label:"Pending",type:"neutral"}:a===wv?{label:"Rejected",type:"error"}:{label:"Accepted",type:"success"};return Object(We.jsxs)(Un.a,{className:E()(l.propertyCard,n),elevation:0,children:[Object(We.jsx)(Ve,{className:l.propertyCardTopRow,children:r}),Object(We.jsxs)("div",{className:l.propertyCardBottomRow,children:[Object(We.jsx)("div",{className:E()(s),children:Object(We.jsx)(sd,{statuses:[d]})}),c,Object(We.jsxs)("div",{className:l.buttonsWrapper,children:[i&&a!==yv&&Object(We.jsx)(Me,{className:l.cardActionButton,color:"secondary",Icon:gv,InverseIcon:mv,onClick:function(){return i()},children:"Authorize"}),o&&a!==wv&&Object(We.jsx)(Me,{className:l.cardActionButton,color:"secondary",Icon:Yb,InverseIcon:jr,onClick:function(){return o()},children:"Reject"})]})]})]})}));function kv(){return(kv=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 Sv(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 Nv=r.createElement("desc",null,"Created with Sketch."),Iv=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 Ev(e,t){var n=e.title,a=e.titleId,i=Sv(e,["title","titleId"]);return r.createElement("svg",kv({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,Nv,Iv)}var Fv=r.forwardRef(Ev);n.p;function Lv(){return(Lv=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 Pv(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 Dv=r.createElement("desc",null,"Created with Sketch."),Bv=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 Rv(e,t){var n=e.title,a=e.titleId,i=Pv(e,["title","titleId"]);return r.createElement("svg",Lv({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,Dv,Bv)}var Av=r.forwardRef(Rv),Tv=(n.p,{labelLink:{cursor:"pointer",color:q},breadcrumbs:{margin:[[20,0]]},actionLabel:{color:q,margin:[[4,0]]},customerDetails:{marginBottom:18},customerActions:{display:"flex",flexDirection:"row","& button":{marginRight:15},"& > :last-child":{marginRight:0}}});function Wv(){return(Wv=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 zv(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 Mv=r.createElement("desc",null,"Created with Sketch."),$v=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 qv(e,t){var n=e.title,a=e.titleId,i=zv(e,["title","titleId"]);return r.createElement("svg",Wv({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,Mv,$v)}var Hv=r.forwardRef(qv);n.p;function Vv(){return(Vv=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 Uv(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 Yv=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 Gv(e,t){var n=e.title,a=e.titleId,i=Uv(e,["title","titleId"]);return r.createElement("svg",Vv({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,Yv)}var Xv=r.forwardRef(Gv),_v=(n.p,Object(p.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]]}})),Zv=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=_v({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),j=function(e){var t=e.className;return Object(We.jsx)("img",{className:E()(t),src:l,alt:""})};return Object(We.jsx)(S.a,{onClickAway:function(){h(null)},children:Object(We.jsxs)("div",{className:E()(s.row,t),children:[Object(We.jsx)(j,{className:s.image}),Object(We.jsx)(Vn,{Icon:Xv,InverseIcon:Hv,className:s.button,onClick:function(e){h(m?null:e.currentTarget)}}),Object(We.jsx)(Gn,{open:b,anchorEl:m,placement:"top",children:Object(We.jsx)("div",{className:s.popoverContent,children:Object(We.jsx)(j,{className:s.popupImage})})})]})})}));function Qv(){return(Qv=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 Kv(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 Jv=r.createElement("desc",null,"Created with Sketch."),ey=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 ty(e,t){var n=e.title,a=e.titleId,i=Kv(e,["title","titleId"]);return r.createElement("svg",Qv({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,Jv,ey)}var ny=r.forwardRef(ty),ry=(n.p,Object(p.a)({field:{height:46},label:{color:q,margin:[[0,3]]},value:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",margin:0,paddingLeft:4}})),ay=Object(r.memo)((function(e){var t=e.label,n=e.display,r=e.size,a=e.className,i=ry();return Object(We.jsxs)("div",{className:E()(i.field,a),style:{width:r},children:[Object(We.jsx)(et,{className:i.label,children:t}),Object(We.jsx)(Ze,{className:i.value,children:n})]})})),iy=Object(p.a)({complianceDetailsGrid:{display:"flex",flexDirection:"row"},firstColumn:{display:"flex",flexDirection:"column",width:"100%",marginRight:10},lastColumn:{display:"flex",flexDirection:"column",width:"100%",marginLeft:10},photoWrapper:function(e){return{display:"flex",justifyContent:"center",width:e.width}}}),oy=function(e){var t=e.show,n=e.src,r=iy({width:165});return Object(We.jsx)(We.Fragment,{children:t?Object(We.jsx)(Zv,{src:n,width:165,height:45,popupWidth:360,popupHeight:240}):Object(We.jsx)("div",{className:r.photoWrapper,children:Object(We.jsx)(ny,{})})})},cy=function(e){var t=e.customer,n=e.updateCustomer,r=iy({width:165}),a=T.a(["sanctions"])(t),i=T.a(["sanctionsAt"])(t)?a?"Passed":"Failed":"Not checked yet";return Object(We.jsxs)("div",{children:[Object(We.jsx)(Ve,{children:"Compliance details"}),Object(We.jsxs)("div",{children:[Object(We.jsx)(Dy,{customerData:t,updateCustomer:n}),Object(We.jsxs)(No.a,{className:r.complianceDetailsGrid,children:[Object(We.jsxs)(No.a,{className:r.firstColumn,children:[Object(We.jsx)(Cv,{title:"ID card image",state:T.a(["idCardPhotoOverride"])(t),authorize:function(){return n({idCardPhotoOverride:yv})},reject:function(){return n({idCardPhotoOverride:wv})},children:Object(We.jsx)(oy,{show:t.idCardPhotoPath,src:"".concat(uj,"/id-card-photo/").concat(T.a(["idCardPhotoPath"])(t))})}),Object(We.jsx)(Cv,{title:"Front facing camera",state:T.a(["frontCameraOverride"])(t),authorize:function(){return n({frontCameraOverride:yv})},reject:function(){return n({frontCameraOverride:wv})},children:Object(We.jsx)(oy,{show:t.frontCameraPath,src:"".concat(uj,"/front-camera-photo/").concat(T.a(["frontCameraPath"])(t))})})]}),Object(We.jsxs)(No.a,{className:r.lastColumn,children:[Object(We.jsx)(Cv,{title:"US SSN",state:T.a(["usSsnOverride"])(t),authorize:function(){return n({usSsnOverride:yv})},reject:function(){return n({usSsnOverride:wv})},children:Object(We.jsx)(ay,{label:"US SSN",display:t.usSsn})}),Object(We.jsx)(Cv,{title:"Sanctions check",state:T.a(["sanctionsOverride"])(t),authorize:function(){return n({sanctionsOverride:yv})},reject:function(){return n({sanctionsOverride:wv})},children:Object(We.jsx)(Ze,{children:i})})]})]})]})]})};function ly(){return(ly=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 sy(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 dy=r.createElement("g",{id:"icon/sf-small/law/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"bevel"},r.createElement("line",{x1:8.4141,y1:7.4648,x2:14.0711,y2:1.8078,id:"Stroke-1",stroke:"#FFFFFF",strokeWidth:2}),r.createElement("line",{x1:12.6568,y1:.3936,x2:15.4858,y2:3.2216,id:"Stroke-3",stroke:"#FFFFFF",strokeWidth:2}),r.createElement("line",{x1:7,y1:6.0498,x2:9.829,y2:8.8788,id:"Stroke-6",stroke:"#FFFFFF",strokeWidth:2}),r.createElement("line",{x1:11.2427,y1:4.6357,x2:19.2427,y2:12.6357,id:"Stroke-7",stroke:"#FFFFFF",strokeWidth:2}),r.createElement("line",{x1:3,y1:16.5,x2:10,y2:16.5,id:"Stroke-9",stroke:"#FFFFFF",strokeWidth:2}),r.createElement("line",{x1:0,y1:19.5,x2:13,y2:19.5,id:"Stroke-10",stroke:"#FFFFFF",strokeWidth:2}));function uy(e,t){var n=e.title,a=e.titleId,i=sy(e,["title","titleId"]);return r.createElement("svg",ly({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,dy)}var my=r.forwardRef(uy);n.p;function hy(){return(hy=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 by(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 jy=r.createElement("g",{id:"icon/sf-small/law/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"bevel"},r.createElement("line",{x1:8.4141,y1:7.4648,x2:14.0711,y2:1.8078,id:"Stroke-1",stroke:"#1B2559",strokeWidth:2}),r.createElement("line",{x1:12.6568,y1:.3936,x2:15.4858,y2:3.2216,id:"Stroke-3",stroke:"#1B2559",strokeWidth:2}),r.createElement("line",{x1:7,y1:6.0498,x2:9.829,y2:8.8788,id:"Stroke-6",stroke:"#1B2559",strokeWidth:2}),r.createElement("line",{x1:11.2427,y1:4.6357,x2:19.2427,y2:12.6357,id:"Stroke-7",stroke:"#1B2559",strokeWidth:2}),r.createElement("line",{x1:3,y1:16.5,x2:10,y2:16.5,id:"Stroke-9",stroke:"#1B2559",strokeWidth:2}),r.createElement("line",{x1:0,y1:19.5,x2:13,y2:19.5,id:"Stroke-10",stroke:"#1B2559",strokeWidth:2}));function py(e,t){var n=e.title,a=e.titleId,i=by(e,["title","titleId"]);return r.createElement("svg",hy({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,jy)}var fy,gy,Oy,xy,vy,yy=r.forwardRef(py),wy=(n.p,{titleWrapper:yj.titleWrapper,titleAndButtonsContainer:yj.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:Y,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}}),Cy=n(935),ky=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"}},Sy=function(e,t){var n=e&&t?Object(Cy.a)(e,t):null;return n?n.formatInternational():e},Ny=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()},Iy=Object(p.a)(wy),Ey=Object(r.memo)((function(e){var t=e.frontCameraPath,n=Iy();return Object(We.jsx)(Un.a,{className:n.photo,elevation:0,children:t?Object(We.jsx)("img",{className:n.img,src:"".concat(uj,"/front-camera-photo/").concat(t),alt:""}):Object(We.jsx)(ny,{})})})),Fy=Object(p.a)(wy),Ly=Object(r.memo)((function(e){var t=e.customer,n=e.locale,r=e.setShowCompliance,a=Fy(),i=T.a(["idCardData","documentNumber"])(t),o=T.a(["usSsn"])(t),c=[{header:"Phone number",size:172,value:Sy(t.phone,n.country)}];i&&c.push({header:"ID number",size:172,value:i}),o&&c.push({header:"US SSN",size:127,value:o});var l=Ny(t);return Object(We.jsxs)(No.a,{display:"flex",children:[Object(We.jsx)(Ey,{frontCameraPath:T.a(["frontCameraPath"])(t)}),Object(We.jsxs)(No.a,{display:"flex",flexDirection:"column",children:[Object(We.jsxs)("div",{className:a.name,children:[Object(We.jsx)(xb,{className:a.idIcon}),Object(We.jsx)(He,{noMargin:!0,children:l.length?l:Sy(T.a(["phone"])(t),n.country)}),Object(We.jsx)(Or,{className:a.subpageButton,Icon:yy,InverseIcon:my,toggle:r,children:"Compliance details"})]}),Object(We.jsx)(No.a,{display:"flex",mt:"auto",children:c.map((function(e,t){var n=e.size,r=e.header;return Object(We.jsx)(et,{noMargin:!0,className:a.label,style:{width:n},children:r},t)}))}),Object(We.jsx)(No.a,{display:"flex",children:c.map((function(e,t){var n=e.size,r=e.value;return Object(We.jsx)(Ge,{noMargin:!0,className:a.value,style:{width:n},children:r},t)}))})]})]})})),Py=function(e,t){return D.a(e)?"":t},Dy=Object(r.memo)((function(e){var t,n=e.customerData,r=e.updateCustomer,a=T.a(["idCardData"])(n),i=T.a(["expirationDate"])(a),o=T.a(["country"])(a),c=T.a(["dateOfBirth"])(a),l=[{header:"Name",display:"".concat(Ny(n)),size:190},{header:"ID number",display:T.a(["documentNumber"])(a),size:160},{header:"Birth Date",display:Py(c,Il.a.utc(c).format("YYYY-MM-DD")),size:110},{header:"Age",display:Py(c,Il.a.utc().diff(Il.a.utc(c).format("YYYY-MM-DD"),"years")),size:50},{header:"Gender",display:null!==(t=T.a(["gender"])(a))&&void 0!==t?t:T.a(["sex"])(a),size:80},{header:"Canada"===o?"Province":"State",display:T.a(["state"])(a),size:120},{header:"Expiration Date",display:Py(i,Il.a.utc(i).format("YYYY-MM-DD"))}];return Object(We.jsx)(Cv,{title:"ID data",state:T.a(["idCardDataOverride"])(n),authorize:function(){return r({idCardDataOverride:yv})},reject:function(){return r({idCardDataOverride:wv})},children:Object(We.jsx)(No.a,{display:"flex",alignItems:"center",children:l.map((function(e,t){var n=e.header,r=e.display,a=e.size;return Object(We.jsx)(ay,{label:n,display:r,size:a},t)}))})})})),By=Object(p.a)(wy),Ry=function(e){var t,n=e.customer,r=e.data,a=e.loading,i=e.locale,o=By(),c="cashOut"===n.lastTxClass?Kc:Uc,l=!(zr.a(r)||D.a(r)),s=i.timezone,d=(t={},Object(M.a)(t,o.titleAndButtonsContainer,a||!a&&!l),Object(M.a)(t,o.txTableSpacing,!a&&l),t),u=[{header:"Transactions",size:127,value:Py(n.totalTxs,"".concat(Number.parseInt(n.totalTxs)))},{header:"Transaction volume",size:167,value:Py(n.totalSpent,"".concat(Number.parseFloat(n.totalSpent)," ").concat(n.lastTxFiatCode))},{header:"Last active",size:142,value:!D.a(s)&&Py(n.lastActive,Rm(n.lastActive,s,"YYYY-MM-D"))},{header:"Last transaction",size:198,value:Py(n.lastTxFiat,Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(c,{className:o.icon}),"".concat(Number.parseFloat(n.lastTxFiat)," \n ").concat(n.lastTxFiatCode)]}))}],m=[{header:"Direction",width:207,view:function(e){return Object(We.jsxs)(We.Fragment,{children:["cashOut"===e.txClass?Object(We.jsx)(Kc,{className:o.txClassIconLeft}):Object(We.jsx)(Uc,{className:o.txClassIconLeft}),"cashOut"===e.txClass?"Cash-out":"Cash-in"]})}},{header:"Transaction ID",width:414,view:function(e){return Object(We.jsx)(Ej,{className:o.txId,children:e.id})}},{header:"Cash",width:146,textAlign:"right",view:function(e){return Object(We.jsxs)(We.Fragment,{children:["".concat(Number.parseFloat(e.fiat)," "),Object(We.jsx)(tt,{inline:!0,children:e.fiatCode})]})}},{header:"Crypto",width:142,textAlign:"right",view:function(e){return Object(We.jsxs)(We.Fragment,{children:["".concat(Gh.utils.toUnit(new tl.a(e.cryptoAtoms),e.cryptoCode).toFormat(5)," "),Object(We.jsx)(tt,{inline:!0,children:e.cryptoCode})]})}},{header:"Date",width:157,view:function(e){return Rm(e.created,s,"YYYY-MM-D")}},{header:"Time (h:m:s)",width:134,view:function(e){return Rm(e.created,s,"HH:mm:ss")}}];return Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(Ve,{children:"Transactions"}),Object(We.jsxs)(No.a,{display:"flex",flexDirection:"column",children:[Object(We.jsx)(No.a,{display:"flex",mt:"auto",children:u.map((function(e,t){var n=e.size,r=e.header;return Object(We.jsx)(et,{noMargin:!0,className:o.txSummaryLabel,style:{width:n},children:r},t)}))}),Object(We.jsx)(No.a,{display:"flex",children:u.map((function(e,t){var n=e.size,r=e.value;return Object(We.jsx)(Ge,{noMargin:!0,className:o.txSummaryValue,style:{width:n},children:r},t)}))})]}),Object(We.jsx)("div",{className:o.titleWrapper,children:Object(We.jsx)("div",{className:E()(d),children:a?Object(We.jsx)(Ue,{children:"Loading"}):l?"":Object(We.jsx)(Ue,{children:"No transactions so far"})})}),l&&Object(We.jsx)(JO,{elements:m,data:r})]})},Ay=Object(p.a)(Tv),Ty=x()(fy||(fy=Object(l.a)(["\n query customer($customerId: ID!) {\n config\n customer(customerId: $customerId) {\n id\n authorizedOverride\n frontCameraPath\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 transactions {\n txClass\n id\n fiat\n fiatCode\n cryptoAtoms\n cryptoCode\n created\n errorMessage: error\n error: errorCode\n }\n }\n }\n"]))),Wy=x()(gy||(gy=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"]))),zy=Object(r.memo)((function(){var e,t,n,a=Ay(),i=Object(w.h)(),o=Object(r.useState)(!1),l=Object(c.a)(o,2),s=l[0],d=l[1],m=Object(w.j)().id,h=Object(u.c)(Ty,{variables:{customerId:m}}),b=h.data,j=h.refetch,p=h.loading,f=Object(u.b)(Wy,{onCompleted:function(){return j()}}),g=Object(c.a)(f,1)[0],O=function(e){return g({variables:{customerId:m,customerInput:e}})},x=null!==(e=T.a(["config"])(b))&&void 0!==e?e:[],v=x&&vl(ml,x),y=null!==(t=T.a(["customer"])(b))&&void 0!==t?t:[],C=null!==(n=T.a(["transactions"])(y))&&void 0!==n?n:[],k=Fm.a(ov.a(R.a("cryptoAtoms")))(C),S=Ny(y),N=T.a(["authorizedOverride"])(y)===wv,I=y.isSuspended;return Object(We.jsxs)(We.Fragment,{children:[Object(We.jsxs)(Fd.a,{classes:{root:a.breadcrumbs},separator:Object(We.jsx)(Pd.a,{fontSize:"small"}),"aria-label":"breadcrumb",children:[Object(We.jsx)(et,{noMargin:!0,className:a.labelLink,onClick:function(){return i.push("/compliance/customers")},children:"Customers"}),Object(We.jsx)(tt,{noMargin:!0,className:a.labelLink,children:S.length?S:Sy(T.a(["phone"])(y),v.country)})]}),Object(We.jsx)("div",{children:Object(We.jsxs)(No.a,{className:a.customerDetails,display:"flex",justifyContent:"space-between",children:[Object(We.jsx)(Ly,{customer:y,locale:v,setShowCompliance:function(){return d(!s)}}),!p&&!y.isAnonymous&&Object(We.jsxs)("div",{children:[Object(We.jsx)(et,{className:a.actionLabel,children:"Actions"}),Object(We.jsxs)("div",{className:a.customerActions,children:[I&&Object(We.jsx)(Me,{color:"primary",Icon:gv,InverseIcon:mv,onClick:function(){return O({suspendedUntil:null})},children:"Unsuspend customer"}),Object(We.jsx)(Me,{color:"primary",Icon:N?gv:Av,InverseIcon:N?mv:Fv,onClick:function(){return O({authorizedOverride:N?yv:wv})},children:"".concat(N?"Authorize":"Block"," customer")}),Object(We.jsx)(Me,{color:"primary",Icon:N?gv:Av,InverseIcon:N?mv:Fv,onClick:function(){return g({variables:{customerId:m,customerInput:{subscriberInfo:!0}}})},children:"Retrieve information"})]})]})]})}),!s&&Object(We.jsx)(Ry,{customer:y,data:k,locale:v,loading:p}),s&&Object(We.jsx)(cy,{customer:y,updateCustomer:O})]})})),My=n(958),$y=n(960),qy=zn.baseButton,Hy=qy.height/2,Vy=qy.height/4,Uy="rgba(0, 0, 0, 0.08)",Yy="0 4px 4px 0 ".concat(Uy),Gy={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:Uy}},popup:{display:"flex",flexDirection:"column",borderRadius:[[0,0,Vy,Vy]],backgroundColor:Y,boxShadow:Yy},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:Hy,backgroundColor:Y,color:J},inputWithPopup:{borderRadius:[[Vy,Vy,0,0]],boxShadow:Yy},iconButton:{marginRight:12}},Xy=Object(p.a)(Gy),_y=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,j=Object($.a)(e,["loading","filters","options","inputPlaceholder","size","onChange"]),p=Xy({size:h}),f=Object(r.useState)(!1),g=Object(c.a)(f,2),O=g[0],x=g[1],v=(t={},Object(M.a)(t,p.input,!0),Object(M.a)(t,p.inputWithPopup,O),t),y=function(e){return b(e)};return Object(We.jsx)(Rr.a,Object(s.a)({loading:a,classes:{option:p.autocomplete},value:o,options:d,getOptionLabel:function(e){return e.value},renderOption:function(e){return Object(We.jsxs)("div",{className:p.item,children:[Object(We.jsx)(Ge,{className:p.itemLabel,children:e.value}),Object(We.jsx)(Ge,{className:p.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(We.jsxs)(Un.a,{elevation:0,className:p.popup,children:[Object(We.jsx)("div",{className:p.separator}),t]})},renderInput:function(e){return Object(We.jsx)($y.a,Object(s.a)(Object(s.a)({ref:e.InputProps.ref},e),{},{className:E()(v),startAdornment:Object(We.jsx)(Xv,{className:p.iconButton}),placeholder:m,inputProps:Object(s.a)({className:p.bold,classes:{root:p.size}},e.inputProps)}))},onOpen:function(){return x(!0)},onClose:function(){return x(!1)},onChange:function(e,t){return y(t)}},j))})),Zy={root:{borderRadius:4,marginTop:4,marginRight:2,marginBottom:4,marginLeft:2,height:24,backgroundColor:Y,"&:hover, &:focus, &:active":{backgroundColor:Y}},label:{fontSize:ye,fontWeight:Se,fontFamily:Ne,paddingRight:4,paddingLeft:4,color:J}},Qy=Object(p.a)(Zy),Ky=Object(p.a)({button:{width:8,height:8,marginLeft:8},text:{marginTop:0,marginBottom:0}}),Jy=function(e){var t=e.filters,n=e.onFilterDelete,r=e.setFilters,a=Qy(),i=Ky();return Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(Ge,{className:i.text,children:"Filters:"}),Object(We.jsxs)("div",{children:[t.map((function(e,t){return Object(We.jsx)(Ea,{classes:a,label:"".concat(e.type,": ").concat(e.value),onDelete:function(){return n(e)},deleteIcon:Object(We.jsx)(gi,{className:i.button})},t)})),Object(We.jsx)(Ea,{classes:a,label:"Delete filters",onDelete:function(){return r([])},deleteIcon:Object(We.jsx)(gi,{className:i.button})})]})]})},ew=Object(p.a)(wy),tw=function(e){var t=e.data,n=e.locale,r=e.onClick,a=e.loading,i=ew(),o=[{header:"Phone",width:172,view:function(e){return Sy(e.phone,n.country)}},{header:"Name",width:241,view:Ny},{header:"Total TXs",width:126,textAlign:"right",view:function(e){return"".concat(Number.parseInt(e.totalTxs))}},{header:"Total spent",width:152,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:133,view:function(e){return Py(e.lastActive,Il.a.utc(e.lastActive).format("YYYY-MM-D"))}},{header:"Last transaction",width:161,textAlign:"right",view:function(e){var t,n=!D.a(e.lastTxFiatCode),r="cashOut"===e.lastTxClass?Kc:Uc,a=Object(We.jsx)(r,{className:i.txClassIconRight});return Object(We.jsxs)(We.Fragment,{children:[n&&"".concat(parseFloat(e.lastTxFiat)," ").concat(null!==(t=e.lastTxFiatCode)&&void 0!==t?t:""),n&&a]})}},{header:"Status",width:188,view:function(e){return Object(We.jsx)(sd,{statuses:[ky(e)]})}}];return Object(We.jsx)(We.Fragment,{children:Object(We.jsx)(JO,{loading:a,emptyText:"No customers so far",elements:o,data:t,onClick:r})})},nw=x()(Oy||(Oy=Object(l.a)(["\n query filters {\n customerFilters {\n type\n value\n }\n }\n"]))),rw=x()(xy||(xy=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"]))),aw=Object(p.a)(yj),iw=function(){var e,t=aw(),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)([]),j=Object(c.a)(b,2),p=j[0],f=j[1],g=Object(u.c)(rw,{variables:m,onCompleted:function(e){return l(T.a(["customers"])(e))}}),O=g.data,x=g.loading,v=g.refetch,y=Object(u.c)(nw),C=y.data,k=y.loading,S=null!==(e=T.a(["config"])(O))&&void 0!==e?e:[],N=S&&vl(ml,S),I=Wd.a([ov.a(R.a("lastActive"))])(null!==o&&void 0!==o?o:[]),E=T.a(["customerFilters"])(C);return Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(Do,{title:"Customers",appendix:Object(We.jsx)("div",{children:Object(We.jsx)(_y,{loading:k,filters:p,options:E,inputPlaceholder:"Search customers",onChange:function(e){var t=L.a(Lf.a,B.a((function(e){return Object(M.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(We.jsx)(Uc,{})},{label:"Cash-out",icon:Object(We.jsx)(Kc,{})}]}),p.length>0&&Object(We.jsx)(Jy,{filters:p,onFilterDelete:function(e){return f(W.a((function(t){return!My.a(ju.a(["type","value"],t),e)}))(p))},setFilters:f}),Object(We.jsx)(tw,{data:I,locale:N,onClick:function(e){return n.push("/compliance/customer/".concat(e.id))},loading:x})]})},ow=n(823),cw=Object(ow.a)({wrapper:{display:"flex",alignItems:"center"},colorIndicator:{borderRadius:3,height:12,width:12,marginRight:8}}),lw=function(e){var t=e.className,n=e.label,r=e.color,a=Object($.a)(e,["className","label","color"]),i=cw();return Object(We.jsxs)("div",Object(s.a)(Object(s.a)({className:E()(i.wrapper,t)},a),{},{children:[r&&Object(We.jsx)("div",{className:i.colorIndicator,style:{backgroundColor:r}}),Object(We.jsx)(et,Object(s.a)(Object(s.a)({},a),{},{children:n}))]}))},sw=Re.label1,dw=Re.mono,uw={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:sw,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:dw,width:375,margin:"".concat(12,"px ").concat(24,"px")}},mw=Object(p.a)(uw),hw=165,bw=140,jw=130,pw=x()(vy||(vy=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"]))),fw=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Gh.utils.formatCryptoAddress(e,t).replace(/(.{4})/g,"$1 ")},gw=function(e,t){return e.plus(t)},Ow=function(e){return new tl.a(e).toFormat(2)},xw=function(e){return Ow(e.filter((function(e){return!e.errorMsg})).map((function(e){return new tl.a(e.fiatConfirmedBalance)})).reduce(gw,new tl.a(0)))},vw=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=mw(),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)(pw),h=m.data,b=m.loading,j=null!==(e=T.a(["funding"])(h))&&void 0!==e?e:[];j.length&&!a&&i(j[0]);var p=Ow(j.filter((function(e){return!e.errorMsg})).map((function(e){return new tl.a(e.fiatPending)})).reduce(gw,new tl.a(0))),f=function(e){return e>=0?"+":""};return Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)("div",{children:Object(We.jsx)(yn,{children:"Funding"})}),Object(We.jsxs)("div",{className:s.wrapper,children:[Object(We.jsx)(di,{data:j,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(M.a)(n,s.item,!0),Object(M.a)(n,s.inactiveItem,!t),n),i=(r={},Object(M.a)(r,s.itemWrapper,!0),Object(M.a)(r,s.error,e.errorMsg),r);return Object(We.jsxs)("div",{className:E()(i),children:[Object(We.jsx)("div",{className:s.firstItem,children:e.display}),!e.errorMsg&&Object(We.jsxs)(We.Fragment,{children:[Object(We.jsxs)("div",{className:E()(a),children:[Ow(e.fiatConfirmedBalance)," ",e.fiatCode]}),Object(We.jsxs)("div",{className:E()(a),children:[e.confirmedBalance," ",e.cryptoCode]})]})]})},loading:b,children:j.length&&Object(We.jsxs)("div",{className:s.total,children:[Object(We.jsx)(et,{className:s.totalTitle,children:"Total Crypto Balance"}),Object(We.jsxs)(Xe,{noMargin:!0,children:[xw(j),j[0].fiatCode]}),Object(We.jsxs)(et,{className:s.totalPending,children:["(",f(p)," ",p," pending)"]})]})}),a&&!l&&a.errorMsg&&Object(We.jsx)("div",{className:s.main,children:Object(We.jsx)("div",{className:s.firstSide,children:Object(We.jsx)(Ze,{className:s.error,children:a.errorMsg})})}),a&&!l&&!a.errorMsg&&Object(We.jsxs)("div",{className:s.main,children:[Object(We.jsxs)("div",{className:s.firstSide,children:[Object(We.jsxs)(Ve,{children:["Balance (",a.display,")"]}),Object(We.jsxs)("div",{className:s.coinTotal,children:[Object(We.jsx)(Xe,{inline:!0,noMargin:!0,children:"".concat(a.confirmedBalance," ").concat(a.cryptoCode)}),Object(We.jsx)(_e,{inline:!0,noMargin:!0,className:s.leftSpacer,children:"(".concat(f(a.pending)," ").concat(a.pending," pending)")})]}),Object(We.jsxs)("div",{className:s.coinTotal,children:[Object(We.jsx)(Ze,{inline:!0,noMargin:!0,children:"= ".concat(Ow(a.fiatConfirmedBalance)," ").concat(a.fiatCode)}),Object(We.jsx)(nt,{inline:!0,noMargin:!0,className:s.leftSpacer,children:"(".concat(f(a.fiatPending)," ").concat(Ow(a.fiatPending)," pending)")})]}),Object(We.jsx)(Ve,{className:s.topSpacer,children:"Address"}),Object(We.jsx)("div",{className:s.addressWrapper,children:Object(We.jsx)("div",{className:s.mono,children:Object(We.jsx)("strong",{children:Object(We.jsx)(Ej,{buttonClassname:s.copyToClipboard,children:fw(a.cryptoCode,a.fundingAddress)})})})})]}),Object(We.jsxs)("div",{className:s.secondSide,children:[Object(We.jsxs)(et,{children:["Scan to send ",a.display]}),Object(We.jsx)(fn.a,{size:240,fgColor:J,value:a.fundingAddressUrl})]})]}),a&&l&&Object(We.jsxs)("div",{children:[Object(We.jsx)(lw,{className:s.tableLabel,label:"Pending",color:"#cacaca"}),Object(We.jsxs)(Xd,{className:s.table,children:[Object(We.jsxs)(_d,{children:[Object(We.jsx)(Kd,{header:!0,width:hw,children:"Amount Entered"}),Object(We.jsx)(Kd,{header:!0,width:hw,children:"Balance After"}),Object(We.jsx)(Kd,{header:!0,width:hw,children:"Cash Value"}),Object(We.jsx)(Kd,{header:!0,width:jw,children:"Date"}),Object(We.jsx)(Kd,{header:!0,width:bw,children:"Time (h:m:s)"}),Object(We.jsx)(Kd,{header:!0,width:hw,children:"Performed By"})]}),Object(We.jsx)(Qd,{children:d.map((function(e,t){return Object(We.jsxs)(tu,{className:E()(Object(M.a)({},s.pending,e.pending)),children:[Object(We.jsxs)(Kd,{width:hw,children:[e.cryptoAmount," ",a.cryptoCode]}),Object(We.jsxs)(Kd,{width:hw,children:[e.balance," ",a.cryptoCode]}),Object(We.jsxs)(Kd,{width:hw,children:[e.fiatValue," ",a.fiatCode]}),Object(We.jsx)(Kd,{width:jw,children:Il()(e.date).format("YYYY-MM-DD")}),Object(We.jsx)(Kd,{width:bw,children:Il()(e.date).format("hh:mm:ss")}),Object(We.jsx)(Kd,{width:hw,children:"add"})]},t)}))})]})]})]})]})};function yw(){return(yw=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 ww(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 Cw=r.createElement("circle",{cx:52,cy:32,r:32,fill:"#F7931A"}),kw=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 Sw(e,t){var n=e.title,a=e.titleId,i=ww(e,["title","titleId"]);return r.createElement("svg",yw({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,Cw,kw)}var Nw=r.forwardRef(Sw);n.p;function Iw(){return(Iw=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 Ew(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 Fw=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"}),Lw=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 Pw(e,t){var n=e.title,a=e.titleId,i=Ew(e,["title","titleId"]);return r.createElement("svg",Iw({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,Fw,Lw)}var Dw=r.forwardRef(Pw);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("circle",{cx:1e3,cy:1e3,r:1e3,fill:"#2573c2"}),Tw=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 Ww(e,t){var n=e.title,a=e.titleId,i=Rw(e,["title","titleId"]);return r.createElement("svg",Bw({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,Aw,Tw)}var zw=r.forwardRef(Ww);n.p;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 $w(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",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 Hw(e,t){var n=e.title,a=e.titleId,i=$w(e,["title","titleId"]);return r.createElement("svg",Mw({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,qw)}var Vw=r.forwardRef(Hw);n.p;function Uw(){return(Uw=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 Gw=r.createElement("circle",{fill:"#989898",cx:52,cy:32,r:32}),Xw=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 _w(e,t){var n=e.title,a=e.titleId,i=Yw(e,["title","titleId"]);return r.createElement("svg",Uw({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,Gw,Xw)}var Zw=r.forwardRef(_w);n.p;function Qw(){return(Qw=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 Jw=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"}),eC=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 tC(e,t){var n=e.title,a=e.titleId,i=Kw(e,["title","titleId"]);return r.createElement("svg",Qw({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,Jw,eC)}var nC=r.forwardRef(tC);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 iC=r.createElement("style",{type:"text/css"},"\n\t.st0{fill:#231F20;}\n\t.st1{fill:#F4B728;}\n"),oC=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"}),cC=r.createElement("circle",{className:"st1",cx:245.4,cy:245.4,r:177.6}),lC=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 sC(e,t){var n=e.title,a=e.titleId,i=aC(e,["title","titleId"]);return r.createElement("svg",rC({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),iC,void 0===n?r.createElement("title",{id:a},"headerArtboard 7"):n?r.createElement("title",{id:a},n):null,oC,cC,lC)}var dC,uC,mC,hC,bC,jC,pC,fC,gC,OC=r.forwardRef(sC),xC=(n.p,Object(p.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}})),vC=function(e){var t=e.code,n=e.name,r=e.onContinue,a=xC(),i=function(e){switch(e){case"BTC":return Nw;case"BCH":return Dw;case"DASH":return zw;case"ETH":return Vw;case"LTC":return Zw;case"ZEC":return OC;case"USDT":return nC;default:return null}}(t);return Object(We.jsxs)("div",{className:a.modalContent,children:[Object(We.jsx)(i,{className:a.logo}),Object(We.jsxs)(qe,{className:a.title,children:["Enable ",n]}),Object(We.jsxs)(Ge,{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(We.jsx)(Tn,{className:a.button,onClick:r,children:"Start configuration"})]})},yC={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}},wC=Object(p.a)(yC),CC={form:null,selected:null,isNew:!1,iError:!1},kC=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 Yn.a(e,{innerError:!0});case"reset":return CC;default:throw new Error}},SC=function(e){var t,n=e.type,a=e.name,i=e.step,o=e.error,l=e.lastStep,s=e.onContinue,d=e.filled,u=e.unfilled,m=e.getValue,h=wC(),b=Object(r.useReducer)(kC,CC),j=Object(c.a)(b,2),p=j[0],f=p.innerError,g=p.selected,O=p.form,x=p.isNew,v=j[1];Object(r.useEffect)((function(){v({type:"reset"})}),[i]);var y=function(e,t){if(!e||!e[n])return v({type:"error"});s(e,t)},w=l?"Finish":"Next",C=null!==a&&void 0!==a?a:n,k=(t={},Object(M.a)(t,h.subtitle,!0),Object(M.a)(t,h.error,f),t);return Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(_e,{className:h.title,children:mu(n)}),Object(We.jsx)(oO,{steps:4,currentStep:i}),Object(We.jsxs)(Ue,{className:E()(k),children:["Select a ",C," or set up a new one"]}),Object(We.jsx)(xa,{options:d,value:g,className:h.radioGroup,onChange:function(e,t){v({type:"select",selected:t})},labelClassName:h.radioLabel,radioClassName:h.radio}),Object(We.jsxs)("div",{className:h.setupNew,children:[!zr.a(u)&&!D.a(u)&&Object(We.jsx)(xa,{value:x,onChange:function(e,t){v({type:"new"})},labelClassName:h.radioLabel,radioClassName:h.radio,options:[{display:"Set up new",code:!0}]}),x&&Object(We.jsx)(Xr,{fullWidth:!0,label:"Select ".concat(C),className:h.picker,getOptionSelected:$r.a("code"),labelProp:"display",options:u,onChange:function(e,t){v({type:"form",form:t})}})]}),O&&Object(We.jsx)(Df,{save:function(e){return y(Object(M.a)({},n,O.code),Object(M.a)({},O.code,e))},elements:hg[O.code].elements,validationSchema:hg[O.code].validationSchema,value:m(O.code),buttonLabel:w}),!O&&Object(We.jsxs)("div",{className:h.submit,children:[o&&Object(We.jsx)(Fo,{children:"Failed to save"}),Object(We.jsx)(Tn,{className:h.button,onClick:function(){return y(Object(M.a)({},n,g))},children:w})]})]})},NC=function(e,t){return W.a((function(n){return function(e){return z.a("class",e)}(t)(n)&&function(e){return L.a(qo.a(e),R.a("cryptos"))}(e)(n)}))},IC=W.a((function(e){return!e.deprecated})),EC=function(e,t,n,r){var a=IC(NC(r,n)(e)),i=Ll.a((function(e){var n=e.code,r=function(e){return t&&t[e]}(n);return!hg[n]||(0,hg[n].getValidationSchema)(r).isValidSync(r)}))(a),o=Object(c.a)(i,2);return{filled:o[0],unfilled:o[1]}},FC=function(e){var t=e.coin,n=e.onClose,a=e.accountsConfig,i=e.accounts,o=e.save,l=e.error,d=Object(r.useState)({step:0,config:{active:!0},accountsToSave:{}}),u=Object(c.a)(d,2),m=u[0],h=m.step,b=m.config,j=m.accountsToSave,p=u[1],f="Enable ".concat(t.display),g=4===h,O={filled:NC(t.code,"ticker")(a)},x=EC(a,i,"wallet",t.code),v=EC(a,i,"exchange",t.code),y=EC(a,i,"zeroConf",t.code),w=function(){var e=Object(ec.a)(Jo.a.mark((function e(n,r){var a,i,c;return Jo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=Yn.a(b,n),i=r?Yn.a(j,r):j,!g){e.next=5;break}return c=Object(s.a)(Object(s.a)({},a),{},{zeroConfLimit:0}),e.abrupt("return",o(yl(t.code,c),i));case 5:p({step:h+1,config:a,accountsToSave:i});case 6:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();return Object(We.jsxs)(Zg,{title:0===h?null:f,handleClose:n,width:554,open:!0,children:[0===h&&Object(We.jsx)(vC,{code:t.code,name:t.display,onContinue:function(){return w()}}),0!==h&&Object(We.jsx)(SC,Object(s.a)(Object(s.a)({step:h,error:l,lastStep:g},function(){switch(h){case 1:return Object(s.a)({type:"ticker"},O);case 2:return Object(s.a)({type:"wallet"},x);case 3:return Object(s.a)({type:"exchange"},v);case 4:return Object(s.a)({type:"zeroConf",name:"zero conf"},y);default:return null}}()),{},{onContinue:w,getValue:function(e){return Tr.a(z.a("code",e))(i)}}))]})},LC=Object(p.a)({rightAligned:{marginTop:"20px",marginLeft:"auto",marginBottom:"20px"},rightLink:{marginLeft:"20px"}}),PC=x()(dC||(dC=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"]))),DC=x()(uC||(uC=Object(l.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),BC=function(e){var t=e.open,n=e.close,r=e.save,a=LC();return Object(We.jsxs)(Zg,{title:"Change fiat currency?",handleClose:n,width:450,height:310,open:t,children:[Object(We.jsx)(Ge,{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(We.jsx)(Ge,{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(We.jsxs)("div",{className:a.rightAligned,children:[Object(We.jsx)(or,{onClick:n,color:"secondary",children:"Cancel"}),Object(We.jsx)(or,{className:a.rightLink,onClick:r,color:"primary",children:"Save"})]})]})},RC=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],j=Object(r.useState)(null),p=Object(c.a)(j,2),f=p[0],g=p[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],P=Object(u.c)(PC).data,D=Object(u.b)(DC,{onCompleted:function(){return b(!1)},refetchQueries:function(){return["getData"]},onError:function(e){return y(e)}}),B=Object(c.a)(D,1)[0],R=Object(r.useState)(null),A=Object(c.a)(R,2),T=A[0],W=A[1],M=(null===P||void 0===P?void 0:P.config)&&vl(s)(P.config),$=(null===P||void 0===P?void 0:P.config)&&vl(sl)(P.config),q=null===P||void 0===P?void 0:P.accountsConfig,H=null!==(t=null===P||void 0===P?void 0:P.accounts)&&void 0!==t?t:[],V=null!==(n=null===P||void 0===P?void 0:P.cryptoCurrencies)&&void 0!==n?n:[],U=M&&!zr.a(M)?M:Jp,Y=null!==(a=U.overrides)&&void 0!==a?a:[],G=function(e){return W(null),B({variables:{config:e}})},X=function(e,t,n){var r=Op.a(t,e)[0];if(!r)return n(t);var a=vl(r)($);if(!df.isValidSync(a))return g((function(){return function(){return n(t)}})),void b(r);n(t)};return Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(BC,{open:T,close:function(){return W(null)},save:function(){return T&&G(T)}}),Object(We.jsx)(Do,{title:"Locales"}),Object(We.jsx)(jf,{children:Object(We.jsx)(bm,{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=yl(s)(e.locale[0]);return M.fiatCurrency&&t.locale_fiatCurrency!==M.fiatCurrency?W(t):G(t)},validationSchema:Qp,data:Yx.a(U),elements:_p(P,X),setEditing:function(e,t){return S(t)},forceDisable:E})}),Object(We.jsx)(jf,{children:Object(We.jsx)(bm,{error:null===v||void 0===v?void 0:v.message,title:"Overrides",titleLg:!0,name:"overrides",enableDelete:!0,enableEdit:!0,enableCreate:!0,initialValues:ef,save:function(e){var t=yl(s)(e);return y(null),B({variables:{config:t}})},validationSchema:Kp,data:null!==Y&&void 0!==Y?Y:[],elements:Zp(P,Y,X),disableAdd:L.a(zr.a,Op.a)(null!==(i=null===P||void 0===P?void 0:P.machines.map((function(e){return e.deviceId})))&&void 0!==i?i:[],null!==(o=null===Y||void 0===Y?void 0:Y.map((function(e){return e.machine})))&&void 0!==o?o:[]),setEditing:function(e,t){return F(t)},forceDisable:k})}),h&&Object(We.jsx)(FC,{coin:Tr.a(z.a("code",h))(V),onClose:function(){return b(!1)},save:function(e){return G(yl(sl)(e)).then((function(e){return f(),g(null),e}))},error:null===v||void 0===v?void 0:v.message,cryptoCurrencies:V,userAccounts:null===P||void 0===P||null===(l=P.config)||void 0===l?void 0:l.accounts,accounts:H,accountsConfig:q})]})},AC={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}},TC=Object(p.a)(AC),WC={customer:"",discount:""},zC=xn.d().shape({customer:xn.f().required("A customer is required!"),discount:xn.c().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%!")}),MC=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},$C=function(e){var t=e.showModal,n=e.setShowModal,r=e.onClose,a=e.creationError,i=e.addDiscount,o=e.customers,c=TC();return Object(We.jsx)(We.Fragment,{children:t&&Object(We.jsx)(Zg,{title:"Add individual customer discount",closeOnBackdropClick:!0,width:600,height:500,handleClose:r,open:!0,children:Object(We.jsx)(jn.d,{validateOnBlur:!1,validateOnChange:!1,initialValues:WC,validationSchema:zC,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(We.jsxs)(jn.c,{id:"individual-discount-form",className:c.form,children:[Object(We.jsx)("div",{className:c.customerAutocomplete,children:Object(We.jsx)(jn.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(We.jsxs)("div",{children:[Object(We.jsxs)("div",{className:c.discountRateWrapper,children:[Object(We.jsx)(Ve,{children:"Define discount rate"}),Object(We.jsxs)(sb,{width:304,children:[Object(We.jsx)(Ge,{children:"This is a percentage discount off of your existing commission rates for a customer entering this code at the machine."}),Object(We.jsx)(Ge,{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(We.jsxs)("div",{className:c.discountInput,children:[Object(We.jsx)(jn.b,{name:"discount",size:"lg",autoComplete:"off",width:50,decimalScale:0,className:c.discountInputField,component:qa}),Object(We.jsx)(Ke,{inline:!0,className:c.inputLabel,children:"%"})]})]}),Object(We.jsxs)("div",{className:c.footer,children:[MC(t,n,a)&&Object(We.jsx)(Fo,{children:MC(t,n,a)}),Object(We.jsx)(Tn,{type:"submit",form:"individual-discount-form",className:c.submit,children:"Add discount"})]})]})}})})})},qC=Object(p.a)(AC),HC=x()(mC||(mC=Object(l.a)(["\n query individualDiscounts {\n individualDiscounts {\n id\n customerId\n discount\n }\n }\n"]))),VC=x()(hC||(hC=Object(l.a)(["\n mutation deleteIndividualDiscount($discountId: ID!) {\n deleteIndividualDiscount(discountId: $discountId) {\n id\n }\n }\n"]))),UC=x()(bC||(bC=Object(l.a)(["\n mutation createIndividualDiscount($customerId: ID!, $discount: Int!) {\n createIndividualDiscount(customerId: $customerId, discount: $discount) {\n id\n }\n }\n"]))),YC=x()(jC||(jC=Object(l.a)(["\n {\n customers {\n id\n phone\n idCardData\n phone\n }\n }\n"]))),GC=function(){var e=qC(),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],j=h[1],p=Object(r.useState)(!1),f=Object(c.a)(p,2),g=f[0],O=f[1],x=function(){return O(!g)},v=Object(u.c)(HC),y=v.data,w=v.loading,C=Object(u.c)(YC),k=C.data,S=C.loading,N=Object(u.b)(UC,{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(z.a("id",e))(t)},P=Object(u.b)(VC,{onError:function(e){var t=e.message;j(null!==t&&void 0!==t?t:"Error while deleting row")},onCompleted:function(){return i(!1)},refetchQueries:function(){return["individualDiscounts"]}}),B=Object(c.a)(P,1)[0],R=[{header:"Identification",width:312,textAlign:"left",size:"sm",view:function(t){var n,r,a=L(t.customerId);return Object(We.jsxs)("div",{className:e.identification,children:[Object(We.jsx)(Fb,{}),Object(We.jsx)("span",{children:a.phone}),(null===a||void 0===a||null===(n=a.idCardData)||void 0===n?void 0:n.documentNumber)&&Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(xb,{}),Object(We.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 D.a(r.idCardData)?Object(We.jsx)(We.Fragment,{children:"-"}):Object(We.jsx)(We.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(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(Ke,{inline:!0,children:e.discount})," %"]})}},{header:"Revoke",width:100,textAlign:"center",size:"sm",view:function(e){return Object(We.jsx)(tr,{onClick:function(){i(!0),d({variables:{discountId:e.id}})},children:Object(We.jsx)(Vu,{})})}}],A=w||S;return Object(We.jsxs)(We.Fragment,{children:[!A&&!zr.a(y.individualDiscounts)&&Object(We.jsx)(No.a,{marginBottom:4,marginTop:-7,className:e.tableWidth,display:"flex",justifyContent:"flex-end",children:Object(We.jsx)(or,{color:"primary",onClick:x,children:"Add new code"})}),!A&&!zr.a(y.individualDiscounts)&&Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(JO,{elements:R,data:T.a(["individualDiscounts"])(y)}),Object(We.jsx)(Ou,{open:a,onDismissed:function(){i(!1),j(null)},onConfirmed:function(){j(null),B(s)},errorMessage:b})]}),!A&&zr.a(y.individualDiscounts)&&Object(We.jsxs)(No.a,{display:"flex",alignItems:"left",flexDirection:"column",children:[Object(We.jsx)(nt,{children:"It seems there are no active individual customer discounts on your network."}),Object(We.jsx)(Tn,{onClick:x,children:"Add individual discount"})]}),Object(We.jsx)($C,{showModal:g,setShowModal:O,onClose:function(){O(!1)},creationError:F,addDiscount:E,customers:T.a(["customers"])(k)})]})},XC={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:je,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"]]}},_C=Object(p.a)(XC),ZC={code:"",discount:""},QC=xn.d().shape({code:xn.f().required().trim().max(25),discount:xn.c().required().min(0).max(100)}),KC=function(e){var t=e.showModal,n=e.onClose,r=e.errorMsg,a=e.addCode,i=_C();return Object(We.jsx)(We.Fragment,{children:t&&Object(We.jsx)(Zg,{title:"Add promo code discount",closeOnBackdropClick:!0,width:600,height:500,handleClose:n,open:!0,children:Object(We.jsx)(jn.d,{validateOnBlur:!1,validateOnChange:!1,initialValues:ZC,validationSchema:QC,onSubmit:function(e){!function(e,t){a(_h.a(e),parseInt(t))}(e.code,e.discount)},children:Object(We.jsxs)(jn.c,{id:"promo-form",className:i.form,children:[Object(We.jsx)(Ve,{className:i.modalLabel1,children:"Promo code name"}),Object(We.jsx)(jn.b,{name:"code",autoFocus:!0,size:"lg",autoComplete:"off",width:338,inputProps:{style:{textTransform:"uppercase"}},component:Ua}),Object(We.jsxs)("div",{className:i.modalLabel2Wrapper,children:[Object(We.jsx)(Ve,{className:i.modalLabel2,children:"Define discount rate"}),Object(We.jsxs)(sb,{width:304,children:[Object(We.jsx)(Ge,{children:"This is a percentage discount off of your existing commission rates for a customer entering this code at the machine."}),Object(We.jsx)(Ge,{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(We.jsxs)("div",{className:i.discountInput,children:[Object(We.jsx)(jn.b,{name:"discount",size:"lg",autoComplete:"off",width:50,decimalScale:0,className:i.discountInputField,component:qa}),Object(We.jsx)(Ke,{inline:!0,className:i.inputLabel,children:"%"})]}),Object(We.jsxs)("div",{className:i.footer,children:[r&&Object(We.jsx)(Fo,{children:r}),Object(We.jsx)(Tn,{type:"submit",form:"promo-form",className:i.submit,children:"Add code"})]})]})})})})},JC=Object(p.a)(XC),ek="Failed to save",tk=x()(pC||(pC=Object(l.a)(["\n query promoCodes {\n promoCodes {\n id\n code\n discount\n }\n }\n"]))),nk=x()(fC||(fC=Object(l.a)(["\n mutation deletePromoCode($codeId: ID!) {\n deletePromoCode(codeId: $codeId) {\n id\n }\n }\n"]))),rk=x()(gC||(gC=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"]))),ak=function(){var e=JC(),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],j=h[1],p=Object(r.useState)(null),f=Object(c.a)(p,2),g=f[0],O=f[1],x=function(){return j(!b)},v=Object(u.c)(tk),y=v.data,w=v.loading,C=Object(u.b)(nk,{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)(rk,{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(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(Ke,{inline:!0,children:e.discount})," % in commissions"]})}},{header:"Delete",width:100,textAlign:"center",size:"sm",view:function(e){return Object(We.jsx)(tr,{onClick:function(){i(!0),d({variables:{codeId:e.id}})},children:Object(We.jsx)(Vu,{})})}}];return Object(We.jsxs)(We.Fragment,{children:[!w&&!zr.a(y.promoCodes)&&Object(We.jsx)(No.a,{marginBottom:4,marginTop:-7,className:e.tableWidth,display:"flex",justifyContent:"flex-end",children:Object(We.jsx)(or,{color:"primary",onClick:x,children:"Add new code"})}),!w&&!zr.a(y.promoCodes)&&Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(JO,{elements:I,data:T.a(["promoCodes"])(y)}),Object(We.jsx)(Ou,{open:a,onDismissed:function(){i(!1),O(null)},onConfirmed:function(){O(null),k(s)},errorMessage:g})]}),!w&&zr.a(y.promoCodes)&&Object(We.jsxs)(No.a,{display:"flex",alignItems:"left",flexDirection:"column",children:[Object(We.jsx)(nt,{children:"Currently, there are no active promo codes on your network."}),Object(We.jsx)(Tn,{onClick:x,children:"Add Code"})]}),Object(We.jsx)(KC,{showModal:b,onClose:function(){O(null),j(!1)},errorMsg:g,addCode:function(e,t){O(null),N({variables:{code:e,discount:t}}).then((function(e){if(!e.errors)return j(!1);var t=zo.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!":ek)})).catch((function(e){O(ek),console.log(e)}))}})]})};function ik(){return(ik=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 ok(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 ck=r.createElement("desc",null,"Created with Sketch."),lk=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 sk(e,t){var n=e.title,a=e.titleId,i=ok(e,["title","titleId"]);return r.createElement("svg",ik({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,ck,lk)}var dk=r.forwardRef(sk);n.p;function uk(){return(uk=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 mk(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("desc",null,"Created with Sketch."),bk=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 jk(e,t){var n=e.title,a=e.titleId,i=mk(e,["title","titleId"]);return r.createElement("svg",uk({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,bk)}var pk=r.forwardRef(jk);n.p;function fk(){return(fk=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 gk(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 Ok=r.createElement("desc",null,"Created with Sketch."),xk=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 vk(e,t){var n=e.title,a=e.titleId,i=gk(e,["title","titleId"]);return r.createElement("svg",fk({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,Ok,xk)}var yk,wk,Ck,kk,Sk=r.forwardRef(vk),Nk=(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"}}),Ik=Object(p.a)(Nk),Ek=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"]),Ik()),d=a||i,u=(t={},Object(M.a)(t,s.between,o&&!(a&&i)),Object(M.a)(t,s.lowerBound,a&&!i),Object(M.a)(t,s.upperBound,i&&!a),t),m=(n={},Object(M.a)(n,s.wrapper,!0),Object(M.a)(n,s.selected,d),n),h=(r={},Object(M.a)(r,s.button,!0),Object(M.a)(r,s.disabled,c),r);return Object(We.jsxs)("div",{className:s.wrapper,children:[Object(We.jsx)("div",{className:E()(u)}),Object(We.jsx)("div",{className:E()(m),children:Object(We.jsx)("button",{className:E()(h),children:l})})]})},Fk={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:Y,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}}},Lk=Object(p.a)(Fk),Pk=function(e){var t=e.minDate,n=e.maxDate,a=e.handleSelect,i=Object($.a)(e,["minDate","maxDate","handleSelect"]),o=Object(r.useState)(Il()()),l=Object(c.a)(o,2),s=l[0],d=l[1],u=Lk(),m=Il.a.weekdaysMin().map((function(e){return e.slice(0,1)})),h=function(e){var t=Il()(e).subtract(1,"month"),n=Qg.a(0,Il()(e).startOf("month").weekday()).reverse(),r=B.a((function(e){return Il()(t).endOf("month").subtract(e,"days")}))(n),a=Qg.a(0,function(e){return Number.parseInt(Il()(e).endOf("month").format("D"))}(e)),i=B.a((function(t){return Il()(e).startOf("month").add(t,"days")}))(a),o=Il()(e).add(1,"month"),c=Qg.a(0,42-r.length-i.length),l=B.a((function(e){return Il()(o).startOf("month").add(e,"days")}))(c);return Wo.a(Wo.a(r,i),l)},b=function(e,t){return h(e).slice(7*t-7,7*t)};return Object(We.jsxs)("div",{className:u.wrapper,children:[Object(We.jsxs)("div",{className:u.navbar,children:[Object(We.jsx)("button",{className:u.button,onClick:function(){return function(e){var n=Il()(e).subtract(1,"month");d(t?n.isSameOrAfter(t,"month")?n:s:n)}(s)},children:Object(We.jsx)(pk,{})}),Object(We.jsx)("span",{children:"".concat(s.format("MMMM")," ").concat(s.format("YYYY"))}),Object(We.jsx)("button",{className:u.button,onClick:function(){return function(e){var t=Il()(e).add(1,"month");d(n?t.isSameOrBefore(n,"month")?t:s:t)}(s)},children:Object(We.jsx)(Sk,{})})]}),Object(We.jsxs)("table",{className:u.table,children:[Object(We.jsx)("thead",{children:Object(We.jsx)("tr",{children:m.map((function(e,t){return Object(We.jsx)("th",{children:e},t)}))})}),Object(We.jsx)("tbody",{children:Qg.a(1,8).map((function(e,r){return Object(We.jsx)("tr",{children:b(s,e).map((function(e,r){return Object(We.jsx)("td",{onClick:function(){return a(e,t,n)},children:Object(We.jsx)(Ek,{isDisabled:n&&e.isAfter(n,"day")||t&&e.isBefore(t,"day"),isLowerBound:e.isSame(i.from,"day"),isUpperBound:e.isSame(i.to,"day"),isBetween:e.isBetween(i.from,i.to,"day",[]),children:e.format("D")})},r)}))},r)}))})]})]})},Dk=Object(p.a)({wrapper:{backgroundColor:"white",borderRadius:10}}),Bk=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 j=Dk();return Object(We.jsx)(We.Fragment,{children:Object(We.jsx)("div",{className:E()(j.wrapper,a),children:Object(We.jsx)(Pk,{from:s,to:h,minDate:t,maxDate:n,handleSelect:function(e,t,n){if(!(n&&e.isAfter(n,"day")||t&&e.isBefore(t,"day")))return s&&!h&&e.isBefore(s,"day")?(b(s),void d(e)):void(s&&!h&&e.isSameOrAfter(s,"day")?b(Il()(e.toDate().setHours(23,59,59,999))):(d(e),b(null)))}})})})},Rk=Re.label1,Ak=Re.h4,Tk={wrapper:{height:46,width:99},container:{display:"flex"},monthWeekDayContainer:{display:"flex",flexDirection:"column"},label:{extend:Rk,lineHeight:1.33,color:J},bigNumber:{extend:Re.info1,lineHeight:1,marginRight:7},monthYear:{extend:Re.label2,lineHeight:1.17,color:J},weekDay:{extend:Rk,lineHeight:1.33,color:se}},Wk=Object(p.a)(Tk),zk=function(e){var t=e.date,n=e.children,r=(Object($.a)(e,["date","children"]),Wk());return Object(We.jsxs)("div",{className:r.wrapper,children:[Object(We.jsx)("div",{className:r.label,children:n}),t&&Object(We.jsx)(We.Fragment,{children:Object(We.jsxs)("div",{className:r.container,children:[Object(We.jsx)("div",{className:r.bigNumber,children:t.format("D")}),Object(We.jsxs)("div",{className:r.monthWeekDayContainer,children:[Object(We.jsx)("span",{className:r.monthYear,children:"".concat(t.format("MMM")," ").concat(t.format("YYYY"))}),Object(We.jsx)("span",{className:r.weekDay,children:t.format("dddd")})]})]})})]})},Mk={popoverContent:{width:280},popoverHeader:{extend:Ak,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:Y,padding:[[0,15]],minHeight:70},arrowContainer:{position:"absolute",left:125,top:26},arrow:{margin:"auto"}},$k=Object(p.a)(Mk),qk="all",Hk="range",Vk="advanced",Uk="simplified",Yk=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)(qk),b=Object(c.a)(h,2),j=b[0],p=b[1],f=Object(r.useState)(Vk),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)}}),P=Object(c.a)(L,1)[0],D=$k(),B=(t={},Object(M.a)(t,D.dateRangePickerShowing,j===Hk),Object(M.a)(t,D.dateRangePickerHidden,j===qk),t),R=Object(r.useCallback)((function(e,t){C({from:e,until:t})}),[C]),A=function(e,t){var r=function(e){return Rm(e,d,"YYYY-MM-DD_HH-mm")},a=new window.Blob([e],{type:"text/plain;charset=utf-8"});Kh.a.saveAs(a,j===qk?"".concat(r(new Date),"_").concat(n,".csv"):"".concat(r(t.from),"_").concat(r(t.until),"_").concat(n,".csv"))},W=[{display:"All logs",code:qk},{display:"Date range",code:Hk}],z=[{display:"Advanced logs",code:Vk},{display:"Simplified logs",code:Uk}],$=Boolean(I),q=$?"date-range-popover":void 0;return Object(We.jsx)(S.a,{onClickAway:function(){F(null)},children:Object(We.jsxs)("div",{children:[Object(We.jsx)(Vn,{Icon:aj,InverseIcon:Kb,onClick:function(e){F(I?null:e.currentTarget)},variant:"contained"}),Object(We.jsx)(Gn,{id:q,open:$,anchorEl:I,placement:"bottom",children:Object(We.jsxs)("div",{className:D.popoverContent,children:[Object(We.jsx)("div",{className:D.popoverHeader,children:o}),Object(We.jsx)("div",{className:D.radioButtonsContainer,children:Object(We.jsx)(xa,{name:"logs-select",value:j,options:W,ariaLabel:"logs-select",onChange:function(e){var t=T.a(["target","value"])(e);p(t),t===qk&&C({from:null,until:null})},className:D.radioButtons})}),j===Hk&&Object(We.jsxs)("div",{className:E()(B),children:[Object(We.jsx)("div",{className:D.dateContainerWrapper,children:w&&Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(zk,{date:w.from,children:"From"}),Object(We.jsx)("div",{className:D.arrowContainer,children:Object(We.jsx)(dk,{className:D.arrow})}),Object(We.jsx)(zk,{date:w.until,children:"To"})]})}),Object(We.jsx)(Bk,{maxDate:Il()(),onRangeChange:R})]}),m&&Object(We.jsx)("div",{className:D.radioButtonsContainer,children:Object(We.jsx)(xa,{name:"simplified-tx-logs",value:O,options:z,ariaLabel:"simplified-tx-logs",onChange:function(e){var t=T.a(["target","value"])(e);x(t)},className:D.radioButtons})}),Object(We.jsx)("div",{className:D.download,children:Object(We.jsx)(or,{color:"primary",onClick:function(){return function(e,t){j===qk&&P({variables:Object(s.a)(Object(s.a)({},t),{},{simplified:O===Uk})}),e&&e.from&&(e.from&&!e.until&&(e.until=Il()()),Il()(e.from).isSame(e.until,"day")&&(e.until=Il()()),j===Hk&&P({variables:Object(s.a)(Object(s.a)({},t),{},{from:e.from,until:e.until,simplified:O===Uk})}))}(w,i)},children:"Download"})})]})})]})})},Gk=Object(p.a)(yj),Xk=x()(yk||(yk=Object(l.a)(["\n {\n machines {\n name\n deviceId\n }\n }\n"]))),_k=x()(wk||(wk=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"]))),Zk=x()(Ck||(Ck=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"]))),Qk=x()(kk||(kk=Object(l.a)(["\n query getData {\n config\n }\n"]))),Kk=function(){var e,t,n=Gk(),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,j=Object(u.c)(Xk).data,p=Object(u.c)(Qk).data,f=T.a(["config","locale_timezone"],p),g=Object(u.c)(Zk,{variables:{deviceId:b,limit:500},skip:!o,onCompleted:function(){return h("")}}),O=g.data,x=g.loading;(null===j||void 0===j||null===(e=j.machines)||void 0===e?void 0:e.length)&&!o&&l(null===j||void 0===j?void 0:j.machines[0]);return Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)("div",{className:n.titleWrapper,children:Object(We.jsxs)("div",{className:n.titleAndButtonsContainer,children:[Object(We.jsx)(yn,{children:"Machine Logs"}),O&&Object(We.jsxs)("div",{className:n.buttonsWrapper,children:[Object(We.jsx)(Yk,{title:"Download logs",name:o.name,query:_k,args:{deviceId:b,timezone:f},getLogs:function(e){return T.a(["machineLogsCsv"])(e)},timezone:f}),Object(We.jsx)(Ze,{children:m})]})]})}),Object(We.jsxs)("div",{className:n.wrapper,children:[Object(We.jsx)(di,{displayName:function(e){return e.name},data:(null===j||void 0===j?void 0:j.machines)||[],isSelected:function(e){return T.a(["deviceId"])(o)===e.deviceId},onClick:l}),Object(We.jsxs)("div",{className:n.tableWrapper,children:[Object(We.jsxs)(zO,{className:n.table,children:[Object(We.jsx)(HO,{children:Object(We.jsxs)(ZO,{header:!0,children:[Object(We.jsx)(YO,{className:n.dateColumn,children:"Date"}),Object(We.jsx)(YO,{className:n.levelColumn,children:"Level"}),Object(We.jsx)(YO,{className:n.fillColumn})]})}),Object(We.jsx)(MO,{children:O&&O.machineLogs.map((function(e,t){return Object(We.jsxs)(ZO,{size:"sm",children:[Object(We.jsx)(qO,{children:f&&Rm(e.timestamp,f,"YYYY-MM-DD HH:mm")}),Object(We.jsx)(qO,{children:e.logLevel}),Object(We.jsx)(qO,{children:e.message})]},t)}))})]}),x&&Object(We.jsx)(Ue,{children:"Loading..."}),!x&&!(null===O||void 0===O||null===(t=O.machineLogs)||void 0===t?void 0:t.length)&&Object(We.jsx)(Ue,{children:"No activity so far"})]})]})]})};function Jk(){return(Jk=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 eS(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("desc",null,"Created with Sketch."),nS=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 rS(e,t){var n=e.title,a=e.titleId,i=eS(e,["title","titleId"]);return r.createElement("svg",Jk({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,nS)}var aS=r.forwardRef(rS);n.p;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/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 sS(e,t){var n=e.title,a=e.titleId,i=oS(e,["title","titleId"]);return r.createElement("svg",iS({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,cS,lS)}var dS,uS,mS,hS,bS,jS,pS=r.forwardRef(sS),fS=(n.p,{cashbox:{width:80,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}}),gS={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"}},OS=Object(p.a)(gS),xS=function(e){var t=e.machines,n=e.config,r=e.currencyCode,a=(e.bills,e.deviceIds,OS()),i=n&&vl("cashOut")(n),o=function(e){return vl(e)(i)},c=El.a(Fl.a((function(e,t){var n,r,a=t.cassette1,i=t.cassette2,c=t.id,l=null!==(n=o(c).top)&&void 0!==n?n:0,s=null!==(r=o(c).bottom)&&void 0!==r?r:0;return[e[0]+=a*l,e[1]+=i*s]}),[0,0],t));return Object(We.jsx)("div",{className:a.footerContainer,children:Object(We.jsxs)("div",{className:a.footerContent,children:[Object(We.jsx)(Ze,{className:a.footerLabel,children:"Cash value in System"}),Object(We.jsxs)("div",{className:a.flex,children:[Object(We.jsx)(Kc,{className:a.icon}),Object(We.jsx)(_e,{className:a.iconLabel,children:"Cash-out:"}),Object(We.jsxs)(Xe,{className:a.valueDisplay,children:[c," ",r]})]})]})})},vS=x()(dS||(dS=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"]))),yS=x()(uS||(uS=Object(l.a)(["\n mutation editBatch($id: ID, $performedBy: String) {\n editBatch(id: $id, performedBy: $performedBy) {\n id\n }\n }\n"]))),wS=xn.d().shape({performedBy:xn.f().nullable()}),CS=Object(p.a)({operationType:{marginLeft:8},operationTypeWrapper:{display:"flex",flexDirection:"row",alignItems:"center"},saveAndCancel:{display:"flex",flexDirection:"row",justifyContent:"space-between"}}),kS=function(e){var t=e.machines,n=e.currency,a=CS(),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],j=h[1],p=Object(r.useState)({}),f=Object(c.a)(p,2),g=f[0],O=f[1],x=Object(u.c)(vS),v=x.data,y=x.loading,w=Object(u.b)(yS,{refetchQueries:function(){return["cashboxBatches"]}}),C=Object(c.a)(w,1)[0],k=T.a(["cashboxBatches"])(v),S={"cash-in-empty":Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(Uc,{}),Object(We.jsx)("span",{className:a.operationType,children:"Cash-in emptied"})]}),"cash-out-1-refill":Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(Kc,{}),Object(We.jsx)("span",{className:a.operationType,children:"Cash-out 1 refill"})]}),"cash-out-1-empty":Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(Kc,{}),Object(We.jsx)("span",{className:a.operationType,children:"Cash-out 1 emptied"})]}),"cash-out-2-refill":Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(Kc,{}),Object(We.jsx)("span",{className:a.operationType,children:"Cash-out 2 refill"})]}),"cash-out-2-empty":Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(Kc,{}),Object(We.jsx)("span",{className:a.operationType,children:"Cash-out 2 emptied"})]})},N=function(){return O({}),d(!1)},I=[{name:"operation",header:"Operation",width:200,textAlign:"left",view:function(e){return Object(We.jsx)("div",{className:a.operationTypeWrapper,children:S[e.operationType]})}},{name:"machine",header:"Machine",width:200,textAlign:"left",view:function(e){return Tr.a(z.a("id",e.deviceId))(t).name}},{name:"billCount",header:"Bill Count",width:115,textAlign:"left",input:qa,inputProps:{decimalPlaces:0},view:function(e){return D.a(e.customBillCount)?e.bills.length:e.customBillCount}},{name:"total",header:"Total",width:100,textAlign:"right",view:function(e){return Object(We.jsxs)("span",{children:[El.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 Il.a.utc(e.created).format("YYYY-MM-DD")}},{name:"time",header:"Time (h:m)",width:125,textAlign:"right",view:function(e){return Il.a.utc(e.created).format("HH:mm")}},{name:"performedBy",header:"Performed by",width:180,textAlign:"left",view:function(e){var t;return l?Object(We.jsx)(Gr,{onChange:function(e){return O(Object(s.a)(Object(s.a)({},g),{},{performedBy:e.target.value}))},error:b,width:161.5,value:null!==(t=g.performedBy)&&void 0!==t?t:""}):D.a(e.performedBy)?"Unknown entity":e.performedBy}},{name:"",header:"Edit",width:150,textAlign:"right",view:function(e){return l?Object(We.jsxs)("div",{className:a.saveAndCancel,children:[Object(We.jsx)(or,{type:"submit",color:"primary",onClick:function(){return t=e,wS.isValid(g).then((function(){j(!1),C({variables:{id:t.id,performedBy:null===g||void 0===g?void 0:g.performedBy}})})).catch(j(!0)),N();var t},children:"Save"}),Object(We.jsx)(or,{color:"secondary",onClick:N,children:"Cancel"})]}):Object(We.jsx)(tr,{onClick:function(){O({}),d(!0)},children:Object(We.jsx)(im,{})})}}];return Object(We.jsx)(We.Fragment,{children:!y&&Object(We.jsx)(JO,{name:"cashboxHistory",elements:I,data:k,emptyText:"No cashbox batches so far"})})},SS=n.p+"static/media/both-filled.7af80d5f.svg",NS={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}},IS=Object(p.a)(NS),ES=function(e){var t=e.name,n=e.onContinue,r=IS();return Object(We.jsxs)("div",{className:r.modalContent,children:[Object(We.jsx)("img",{width:"148",height:"196",alt:"cassette",src:SS}),Object(We.jsx)(qe,{className:r.splashTitle,noMargin:!0,children:"Update counts"}),Object(We.jsx)(_e,{className:r.machineName,noMargin:!0,children:t}),Object(We.jsxs)("div",{className:r.warningInfo,children:[Object(We.jsx)(ia,{className:r.warningIcon}),Object(We.jsx)(Ge,{noMargin:!0,className:r.warningText,children:"Before updating counts on Lamassu Admin, make sure you've done it before on the machines."})]}),Object(We.jsxs)("div",{className:r.warningInfo,children:[Object(We.jsx)(ia,{className:r.warningIcon}),Object(We.jsx)(Ge,{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(We.jsx)(Tn,{className:r.button,onClick:n,children:"Get started"})]})},FS=n(928),LS=n.p+"static/media/acceptor-left.f37bcb1a.svg",PS=n.p+"static/media/dispenser-1.e4200f4e.svg",DS=n.p+"static/media/dispenser-2.9f7807a5.svg",BS={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}},RS=Object(p.a)(BS),AS=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=RS(),u=o?"Finish":"Confirm",m={1:LS,2:PS,3:DS},h=[{display:"Yes",code:"YES"},{display:"No",code:"NO"}],b={amount:2===t?null===r||void 0===r?void 0:r.cassette1:null===r||void 0===r?void 0:r.cassette2,denomination:2===t?a.top:a.bottom},j=function(e){var n=2===t?e.cassette1Count:e.cassette2Count,r=null!==n&&void 0!==n?n:b.amount;return FS.a(0,100,r/i*100)};return Object(We.jsxs)("div",{className:d.content,children:[Object(We.jsxs)("div",{className:d.titleDiv,children:[Object(We.jsx)(_e,{className:d.title,children:n}),Object(We.jsx)(oO,{steps:c.length,currentStep:t})]}),1===t&&Object(We.jsx)(jn.d,{validateOnBlur:!1,validateOnChange:!1,onSubmit:s,initialValues:{wasCashboxEmptied:""},enableReinitialize:!0,validationSchema:c[t-1].schema,children:function(e){e.values;return Object(We.jsxs)(jn.c,{children:[Object(We.jsxs)("div",{className:E()(d.horizontalAlign,d.form),children:[Object(We.jsx)("img",{className:d.stepImage,alt:"cassette",src:m[t]}),Object(We.jsx)("div",{className:d.formWrapper,children:Object(We.jsxs)("div",{className:E()(d.verticalAlign,d.fullWidth),children:[Object(We.jsx)(Ue,{noMargin:!0,children:"Did you empty the cash-in box?"}),Object(We.jsx)(jn.b,{component:Ha,name:"wasCashboxEmptied",options:h,className:d.horizontalAlign}),Object(We.jsxs)("div",{className:E()(d.horizontalAlign,d.centerAlignment),children:[Object(We.jsx)(Ge,{children:"Since previous update"}),Object(We.jsx)(sb,{width:215,children:Object(We.jsx)(Ge,{children:"Number of bills inside the cashbox, since the last cashbox changes."})})]}),Object(We.jsxs)("div",{className:E()(d.horizontalAlign,d.lineAlignment),children:[Object(We.jsx)(Xe,{noMargin:!0,className:d.cashboxBills,children:null===r||void 0===r?void 0:r.cashbox}),Object(We.jsx)(Ge,{noMargin:!0,children:"accepted bills"})]})]})})]}),Object(We.jsx)(Tn,{className:d.submit,type:"submit",children:u})]})}}),(2===t||3===t)&&Object(We.jsx)(jn.d,{validateOnBlur:!1,validateOnChange:!1,onSubmit:s,initialValues:{cassette1Count:"",cassette2Count:""},enableReinitialize:!0,validationSchema:c[t-1].schema,children:function(e){var n,r,a=e.values;return Object(We.jsxs)(jn.c,{children:[Object(We.jsxs)("div",{className:E()(d.horizontalAlign,d.form),children:[Object(We.jsx)("img",{className:d.stepImage,alt:"cassette",src:m[t]}),Object(We.jsx)("div",{className:d.formWrapper,children:Object(We.jsxs)("div",{className:E()(d.verticalAlign,d.fullWidth),children:[Object(We.jsxs)("div",{className:E()(d.horizontalAlign,d.smBottomMargin),children:[Object(We.jsxs)("div",{className:E()(d.horizontalAlign,d.cassetteFormTitle),children:[Object(We.jsx)(Kc,{}),Object(We.jsxs)(Ue,{className:d.cassetteFormTitleContent,noMargin:!0,children:["Cash-out ",t-1," (dispenser)"]})]}),Object(We.jsx)(Aa,{className:d.cassetteCashbox,percent:j(a),cashOut:!0})]}),Object(We.jsx)(Ue,{noMargin:!0,children:"Refill bill count"}),Object(We.jsxs)("div",{className:E()(d.horizontalAlign,d.lineAlignment),children:[Object(We.jsx)(jn.b,{component:qa,decimalPlaces:0,width:50,placeholder:b.amount.toString(),name:"cassette".concat(t-1,"Count"),className:d.cashboxBills}),Object(We.jsxs)(Ge,{children:[b.denomination," ",l," bills loaded"]})]}),Object(We.jsxs)(Ge,{noMargin:!0,className:d.fiatTotal,children:["="," ",2===t?(null!==(n=a.cassette1Count)&&void 0!==n?n:0)*b.denomination:(null!==(r=a.cassette2Count)&&void 0!==r?r:0)*b.denomination," ",l]})]})})]}),Object(We.jsx)(Tn,{className:d.submit,type:"submit",children:u})]})}})]})},TS=x()(mS||(mS=Object(l.a)(["\n mutation createBatch($deviceId: ID, $cashboxCount: Int) {\n createBatch(deviceId: $deviceId, cashboxCount: $cashboxCount) {\n id\n }\n }\n"]))),WS=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,j=d[1],p=Object(u.b)(TS),f=Object(c.a)(p,1)[0],g=zr.a(n)||!(null===n||void 0===n?void 0:n.active),O=h===(g?1:3),x=function(e){var n,r,a="YES"===(null===e||void 0===e?void 0:e.wasCashboxEmptied),c=a?0:null===t||void 0===t?void 0:t.cashbox,l=Yn.a(b,e);if(O)return a&&f({variables:{deviceId:t.id,cashboxCount:t.cashbox}}),o(t.id,parseInt(c),parseInt(null!==(n=e.cassette1Count)&&void 0!==n?n:0),parseInt(null!==(r=e.cassette2Count)&&void 0!==r?r:0)),i();j({step:h+1,config:l})},v=[{type:"cashbox",schema:xn.d().shape({wasCashboxEmptied:xn.f().required()}),cashoutRequired:!1},{type:"cassette 1",schema:xn.d().shape({cassette1Count:xn.c().required().min(0).max(500)}),cashoutRequired:!0},{type:"cassette 2",schema:xn.d().shape({cassette2Count:xn.c().required().min(0).max(500)}),cashoutRequired:!0}],y=W.a((function(e){return!e.cashoutRequired||!g&&e.cashoutRequired}),v);return Object(We.jsxs)(Zg,{title:0===h?null:"Update counts",handleClose:i,width:554,height:520,open:!0,children:[0===h&&Object(We.jsx)(ES,{name:null===t||void 0===t?void 0:t.name,onContinue:function(){return x()}}),0!==h&&Object(We.jsx)(AS,{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})]})},zS=Object(p.a)(fS),MS=xn.d().shape({name:xn.f().required(),cashbox:xn.c().label("Cashbox").required().integer().min(0).max(1e3),cassette1:xn.c().label("Cassette 1 (top)").required().integer().min(0).max(500),cassette2:xn.c().label("Cassette 2 (bottom)").required().integer().min(0).max(500)}),$S=x()(hS||(hS=Object(l.a)(["\n query getData {\n machines {\n name\n id: deviceId\n cashbox\n cassette1\n cassette2\n }\n config\n }\n"]))),qS=x()(bS||(bS=Object(l.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),HS=x()(jS||(jS=Object(l.a)(["\n mutation MachineAction(\n $deviceId: ID!\n $action: MachineAction!\n $cashbox: Int!\n $cassette1: Int!\n $cassette2: Int!\n ) {\n machineAction(\n deviceId: $deviceId\n action: $action\n cashbox: $cashbox\n cassette1: $cassette1\n cassette2: $cassette2\n ) {\n deviceId\n cashbox\n cassette1\n cassette2\n }\n }\n"]))),VS=function(){var e,t,n,a,i=zS(),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],j=h[1],p=Object(r.useState)(null),f=Object(c.a)(p,2),g=f[0],O=f[1],x=Object(u.c)($S).data,v=Object(r.useState)(!1),y=Object(c.a)(v,2),w=y[0],C=y[1],k=Object(r.useState)(""),S=Object(c.a)(k,2),N=S[0],I=S[1],E=null!==(e=T.a(["machines"])(x))&&void 0!==e?e:[],F=null!==(t=T.a(["config"])(x))&&void 0!==t?t:{},L=Object(u.b)(HS,{refetchQueries:function(){return["getData"]}}),P=Object(c.a)(L,2),D=P[0],A=P[1].error,W=Object(u.b)(qS,{onCompleted:function(){return j(!1)},refetchQueries:function(){return["getData"]}}),M=Object(c.a)(W,1)[0],$=gO.a((function(e){return e.deviceId}))(null!==(n=T.a(["bills"])(x))&&void 0!==n?n:[]),q=gp.a(B.a(R.a("deviceId"))(null!==(a=T.a(["bills"])(x))&&void 0!==a?a:[])),H=(null===x||void 0===x?void 0:x.config)&&vl("cashOut")(x.config),V=(null===x||void 0===x?void 0:x.config)&&vl("locale")(x.config),U=null===V||void 0===V?void 0:V.fiatCurrency,Y=(null===x||void 0===x?void 0:x.config)&&vl("cashIn")(x.config).cashboxReset,G=function(e){e&&(!function(e){var t=yl("cashIn")(e);M({variables:{config:t}})}({cashboxReset:e}),j(!1))},X=function(e,t,n,r){return D({variables:{action:"setCassetteBills",deviceId:e,cashbox:t,cassette1:n,cassette2:r}})},_=function(e){return vl(e)(H)},Z=[{display:"Automatic",code:"automatic"},{display:"Manual",code:"manual"}],Q=function(e){var t=T.a(["target","value"])(e);O(t)},K=[{name:"name",header:"Machine",width:254,view:function(e){return Object(We.jsx)(We.Fragment,{children:e})},input:function(e){var t=e.field.value;return Object(We.jsx)(We.Fragment,{children:t})}},{name:"cashbox",header:"Cashbox",width:240,view:function(e){return Object(We.jsx)(Ta,{currency:{code:U},notes:e,total:0})},input:qa,inputProps:{decimalPlaces:0}},{name:"cassette1",header:"Cassette 1 (Top)",width:265,stripe:!0,view:function(e,t){var n,r=t.id;return Object(We.jsx)(Wa,{className:i.cashbox,denomination:null===(n=_(r))||void 0===n?void 0:n.top,currency:{code:U},notes:e})},input:Ma,inputProps:{decimalPlaces:0}},{name:"cassette2",header:"Cassette 2 (Bottom)",width:265,stripe:!0,view:function(e,t){var n,r=t.id;return Object(We.jsx)(Wa,{className:i.cashbox,denomination:null===(n=_(r))||void 0===n?void 0:n.bottom,currency:{code:U},notes:e})},input:Ma,inputProps:{decimalPlaces:0}},{name:"edit",header:"Edit",width:175,textAlign:"center",view:function(e,t){var n=t.id;return Object(We.jsx)(tr,{onClick:function(){I(n),C(!0)},children:Object(We.jsx)(im,{})})}}];return Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(Do,{title:"Cash Cassettes",button:{text:"Cashbox history",icon:pS,inverseIcon:aS,toggle:d},iconClassName:i.listViewButton,className:i.tableWidth,children:!s&&Object(We.jsxs)(No.a,{alignItems:"center",justifyContent:"flex-end",children:[Object(We.jsx)(et,{className:i.cashboxReset,children:"Cashbox reset"}),Object(We.jsxs)(No.a,{display:"flex",alignItems:"center",justifyContent:"flex-end",mr:"-4px",children:[Y&&Object(We.jsx)(Ge,{className:i.selection,children:du(Y)}),Object(We.jsx)(tr,{onClick:function(){return j(!0)},className:i.button,children:Object(We.jsx)(im,{})})]})]})}),Object(We.jsxs)("div",{className:i.tableContainer,children:[!s&&Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(bm,{error:null===A||void 0===A?void 0:A.message,name:"cashboxes",stripeWhen:function(e){var t=e.id;return!_(t).active},elements:K,data:E,save:X,validationSchema:MS,tbodyWrapperClass:i.tBody}),x&&zr.a(E)&&Object(We.jsx)(TO,{message:"No machines so far"})]}),s&&Object(We.jsx)(kS,{machines:E,currency:U}),s&&Object(We.jsx)(kS,{machines:E})]}),Object(We.jsx)(xS,{currencyCode:U,machines:E,config:F,bills:$,deviceIds:q}),w&&Object(We.jsx)(WS,{machine:Tr.a(z.a("id",N))(E),cashoutSettings:_(N),onClose:function(){C(!1)},error:null===A||void 0===A?void 0:A.message,save:X,locale:V}),b&&Object(We.jsxs)(Zg,{title:"Cashbox reset",width:478,handleClose:function(){return j(null)},open:!0,children:[Object(We.jsx)(Ge,{className:i.descriptions,children:"Specify if you want your cash-in counts to be reset automatically or manually."}),Object(We.jsx)(xa,{name:"set-automatic-reset",value:null!==g&&void 0!==g?g:Y,options:[Z[0]],onChange:Q,className:i.radioButtons}),Object(We.jsx)(Ge,{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(We.jsx)(xa,{name:"set-manual-reset",value:null!==g&&void 0!==g?g:Y,options:[Z[1]],onChange:Q,className:i.radioButtons}),Object(We.jsx)(Ge,{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(We.jsx)(pu.a,{className:i.actions,children:Object(We.jsx)(Tn,{onClick:function(){return G(g)},children:"Confirm"})})]})]})};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 YS(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 GS=r.createElement("rect",{width:12,height:12,rx:3,ry:3,fill:"#ff7311"});function XS(e,t){var n=e.title,a=e.titleId,i=YS(e,["title","titleId"]);return r.createElement("svg",US({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,GS)}var _S=r.forwardRef(XS);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 QS(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 KS=r.createElement("rect",{width:12,height:12,rx:3,ry:3,fill:"#ff584a"});function JS(e,t){var n=e.title,a=e.titleId,i=QS(e,["title","titleId"]);return r.createElement("svg",ZS({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,KS)}var eN,tN,nN,rN,aN=r.forwardRef(JS),iN=(n.p,{douro1:"Douro",sintra:"Sintra",gaia:"Gaia"}),oN=Object(s.a)(Object(s.a)({},kj),{},{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)}}),cN=Object(p.a)(Sj),lN=function(e){var t=e.children,n=cN();return Object(We.jsx)("div",{className:n.label,children:t})},sN=Object(p.a)(oN),dN=function(e){var t=e.children,n=Object($.a)(e,["children"]);return Object(We.jsx)(h.a,Object(s.a)(Object(s.a)({container:!0,spacing:4},n),{},{children:t}))},uN=function(e){var t=e.children,n=Object($.a)(e,["children"]);return Object(We.jsx)(h.a,Object(s.a)(Object(s.a)({item:!0,xs:!0},n),{},{children:t}))},mN=function(e){var t=e.it,n=e.onActionSuccess,r=e.timezone,a=sN();return Object(We.jsx)(dN,{className:a.wrapper,children:Object(We.jsx)(uN,{xs:!0,children:Object(We.jsxs)(dN,{className:a.row,children:[Object(We.jsxs)(uN,{xs:2,children:[Object(We.jsx)(lN,{children:"Machine Model"}),Object(We.jsx)("span",{children:iN[t.model]})]}),Object(We.jsxs)(uN,{xs:4,children:[Object(We.jsx)(lN,{children:"Paired at"}),Object(We.jsx)("span",{children:r&&Rm(t.pairedAt,r,"YYYY-MM-DD HH:mm:ss")})]}),Object(We.jsx)(uN,{xs:6,children:Object(We.jsx)(Hh,{machine:t,onActionSuccess:n})}),Object(We.jsxs)(uN,{xs:2,children:[Object(We.jsx)(lN,{children:"Network speed"}),Object(We.jsx)("span",{children:t.downloadSpeed?new tl.a(t.downloadSpeed).toFixed(4).toString()+" MB/s":"unavailable"})]}),Object(We.jsxs)(uN,{xs:2,children:[Object(We.jsx)(lN,{children:"Latency"}),Object(We.jsx)("span",{children:t.responseTime?new tl.a(t.responseTime).toFixed(3).toString()+" ms":"unavailable"})]}),Object(We.jsxs)(uN,{xs:2,children:[Object(We.jsx)(lN,{children:"Packet Loss"}),Object(We.jsx)("span",{children:t.packetLoss?new tl.a(t.packetLoss).toFixed(3).toString()+" %":"unavailable"})]})]})})})},hN=x()(eN||(eN=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"]))),bN=x()(tN||(tN=Object(l.a)(["\n query getData {\n config\n }\n"]))),jN=Object(p.a)(Nj),pN=function(){var e,t=jN(),n=Object(w.h)(),r=Object(w.i)().state,a=null===r||void 0===r?void 0:r.id,i=Object(u.c)(hN),o=i.data,c=i.refetch,l=i.loading,s=Object(u.c)(bN),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(We.jsxs)("div",{className:t.flexRow,children:[e.name,Object(We.jsx)("div",{className:t.machineRedirectContainer,onClick:function(){n.push("/machines/".concat(e.deviceId))},children:Object(We.jsx)(pd,{})})]})}},{header:"Status",width:350,size:"sm",textAlign:"left",view:function(e){return Object(We.jsx)(sd,{statuses:e.statuses})}},{header:"Last ping",width:200,size:"sm",textAlign:"left",view:function(e){return e.lastPing?Il()(e.lastPing).fromNow():"unknown"}},{header:"Software Version",width:200,size:"sm",textAlign:"left",view:function(e){return e.version||"unknown"}}],j=null!==(e=T.a(["machines"])(o))&&void 0!==e?e:[],p=Ho.a(z.a("deviceId",a))(j);return Object(We.jsxs)(We.Fragment,{children:[Object(We.jsxs)("div",{className:t.titleWrapper,children:[Object(We.jsx)("div",{className:t.titleAndButtonsContainer,children:Object(We.jsx)(yn,{children:"Machine Status"})}),Object(We.jsxs)("div",{className:t.headerLabels,children:[Object(We.jsxs)("div",{children:[Object(We.jsx)(_S,{}),Object(We.jsx)("span",{children:"Warning"})]}),Object(We.jsxs)("div",{children:[Object(We.jsx)(aN,{}),Object(We.jsx)("span",{children:"Error"})]})]})]}),Object(We.jsx)(JO,{loading:l&&m,elements:b,data:j,Details:function(e){var t=e.it;return Object(We.jsx)(mN,{it:t,onActionSuccess:c,timezone:h})},initialExpanded:p,emptyText:"No machines so far",expandable:!0})]})},fN=a.a.createContext(),gN=Object(p.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}}),ON=function(e){var t=e.title,n=e.editing,r=e.disabled,a=e.setEditing,i=gN();return Object(We.jsxs)("div",{className:i.header,children:[Object(We.jsx)(Ue,{className:i.title,children:t}),!n&&Object(We.jsx)(tr,{onClick:function(){return a(!0)},className:i.button,disabled:r,children:r?Object(We.jsx)(Zu,{}):Object(We.jsx)(im,{})}),n&&Object(We.jsxs)("div",{className:i.editingButtons,children:[Object(We.jsx)(or,{color:"primary",type:"submit",children:"Save"}),Object(We.jsx)(or,{color:"secondary",type:"reset",children:"Cancel"})]})]})},xN=Object(p.a)({text:{margin:[[7,0,7,1]]},fieldWrapper:{height:53},valueWrapper:{display:"flex",alignItems:"baseline"},label:{margin:0},decoration:{margin:[[0,0,0,7]]}}),vN=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=xN({width:u,editing:a}),h=Object(jn.e)().values,b=(t={},Object(M.a)(t,m.fieldWrapper,!0),Object(M.a)(t,"className",c),t);return Object(We.jsxs)("div",{className:E()(b),children:[n&&Object(We.jsx)(et,{className:m.label,children:n}),Object(We.jsxs)("div",{className:m.valueWrapper,children:[!a&&Object(We.jsx)(Xe,{className:m.text,children:i(h[r])}),a&&Object(We.jsx)(jn.b,{id:r,size:"lg",fullWidth:!0,name:r,component:qa,textAlign:"right",width:u,decimalPlaces:s}),Object(We.jsx)(Je,{className:m.decoration,children:o})]})]})},yN=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,j=Object(r.useState)(!1),p=Object(c.a)(j,2),f=p[0],g=p[1],O=function(){var e=Object(ec.a)(Jo.a.mark((function e(t,n){return Jo.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)(fN),v=x.save,y=x.data,w=x.currency,C=x.isEditing,k=x.isDisabled,S=x.setEditing,N=xn.d().shape(Object(M.a)({},m,xn.c().transform(of).integer().min(s).max(u).nullable()));return Object(We.jsx)(jn.d,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,initialValues:Object(M.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(We.jsxs)(jn.c,{className:b,children:[Object(We.jsx)($d,{}),Object(We.jsx)(ON,{title:n,editing:C(m),disabled:k(m),setEditing:function(e){return S(m,e)}}),Object(We.jsx)(vN,{label:a,name:m,editing:C(m),width:o,displayValue:function(e){return""===e?"-":e},decoration:w})]})})},wN="cryptoLowBalance",CN="cryptoHighBalance",kN=Object(p.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"]]}}),SN=function(e){var t=e.section,n=e.fieldWidth,a=kN(),i=Object(r.useContext)(fN),o=i.data,c=i.save,l=i.currency,s=i.setEditing,d=i.isEditing,u=i.isDisabled;return Object(We.jsxs)("div",{className:a.cryptoBalanceAlerts,children:[Object(We.jsx)(yN,{name:wN,data:o,save:c,section:t,decoration:l,className:a.cryptoBalanceAlertsForm,title:"Default (Low Balance)",label:"Alert me under",editing:d(wN),disabled:u(wN),setEditing:function(e){return s(wN,e)},width:n}),Object(We.jsx)("div",{className:a.vertSeparator}),Object(We.jsx)(yN,{name:CN,data:o,section:t,save:c,decoration:l,className:a.cryptoBalanceAlertsSecondForm,title:"Default (High Balance)",label:"Alert me over",editing:d(CN),disabled:u(CN),setEditing:function(e){return s(CN,e)},width:n})]})},NN="highBalance",IN="lowBalance",EN="cryptoCurrency",FN="cryptoBalanceOverrides",LN=function(e){var t,n,a,i=e.section,o=Object(r.useContext)(fN),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,j=null!==(t=null===s||void 0===s?void 0:s.cryptoBalanceOverrides)&&void 0!==t?t:[],p=B.a(R.a(EN))(j),f=W.a((function(e){return!qo.a(e.code,p)}))(l),g=(n={},Object(M.a)(n,EN,null),Object(M.a)(n,IN,""),Object(M.a)(n,NN,""),n),O=xn.d().shape((a={},Object(M.a)(a,EN,xn.f().label("Cryptocurrency").nullable().required()),Object(M.a)(a,IN,xn.c().label("Low Balance").when(NN,{is:function(e){return!e},then:xn.c().required()}).transform(of).integer().min(0).max(wp).nullable()),Object(M.a)(a,NN,xn.c().label("High Balance").when(IN,{is:function(e){return!e},then:xn.c().required()}).transform(of).integer().min(0).max(wp).nullable()),a),[IN,NN]),x=[{name:EN,header:"Cryptocurrency",width:166,size:"sm",view:function(e){return L.a(T.a(["display"]),Tr.a(z.a("code",e)))(l)},input:ka,inputProps:{options:function(e){return Wo.a(f,function(e){var t=L.a(Tr.a(z.a("code",null===e||void 0===e?void 0:e.cryptoCurrency)))(l);return t?[t]:[]}(e))},optionsLimit:null,valueProp:"code",labelProp:"display"}},{name:IN,width:155,textAlign:"right",bold:!0,input:qa,suffix:m,inputProps:{decimalPlaces:2}},{name:NN,width:155,textAlign:"right",bold:!0,input:qa,suffix:m,inputProps:{decimalPlaces:2}}];return Object(We.jsx)(bm,{name:FN,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(FN)||!l,data:j,elements:x,disableAdd:!(null===f||void 0===f?void 0:f.length),onDelete:function(e){var t={cryptoBalanceOverrides:Td.a((function(t){return t.id===e}),j)};return d(t)},setEditing:function(e){return b(FN,e)}})},PN={wrapper:{display:"flex"},form:{marginBottom:36},first:{width:236},title:{marginTop:0},row:{width:183,display:"grid",gridTemplateColumns:"repeat(2,1fr)",gridTemplateRows:"1fr",gridColumnGap:18,gridRowGap:0},col2:{width:136},cashboxLabel:{marginRight:4,fontSize:20},cashboxEmptyPart:{backgroundColor:"".concat(re)}},DN=Object(p.a)(PN),BN="fiatBalanceAlerts",RN=function(e){var t,n,a=e.section,i=e.min,o=void 0===i?0:i,c=e.max,l=void 0===c?100:c,s=e.fieldWidth,d=void 0===s?80:s,u=Object(r.useContext)(fN),m=u.isEditing,h=u.isDisabled,b=u.setEditing,j=u.data,p=u.save,f=DN(),g=m(BN),O=xn.d().shape({fillingPercentageCassette1:xn.c().transform(of).integer().min(o).max(l).nullable(),fillingPercentageCassette2:xn.c().transform(of).integer().min(o).max(l).nullable()});return Object(We.jsx)(jn.d,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,initialValues:{fillingPercentageCassette1:null!==(t=T.a(["fillingPercentageCassette1"])(j))&&void 0!==t?t:"",fillingPercentageCassette2:null!==(n=T.a(["fillingPercentageCassette2"])(j))&&void 0!==n?n:""},validationSchema:O,onSubmit:function(e){return p(a,O.cast(e))},onReset:function(){b(BN,!1)},children:function(e){var t,n,r=e.values;return Object(We.jsxs)(jn.c,{className:f.form,children:[Object(We.jsx)($d,{}),Object(We.jsx)(ON,{title:"Cash out (Empty)",editing:g,disabled:h(BN),setEditing:function(e){return b(BN,e)}}),Object(We.jsxs)("div",{className:f.wrapper,children:[Object(We.jsx)("div",{className:f.first,children:Object(We.jsxs)("div",{className:f.row,children:[Object(We.jsx)(Aa,{labelClassName:f.cashboxLabel,emptyPartClassName:f.cashboxEmptyPart,percent:null!==(t=r.fillingPercentageCassette1)&&void 0!==t?t:null===j||void 0===j?void 0:j.fillingPercentageCassette1,applyColorVariant:!0,applyFiatBalanceAlertsStyling:!0,omitInnerPercentage:!0,cashOut:!0}),Object(We.jsxs)("div",{className:f.col2,children:[Object(We.jsx)(Je,{className:f.title,children:"Cassette 1 (Top)"}),Object(We.jsx)(vN,{label:"Alert me under",name:"fillingPercentageCassette1",editing:g,displayValue:function(e){return""===e?"-":e},decoration:"%",width:d})]})]})}),Object(We.jsxs)("div",{className:f.row,children:[Object(We.jsx)(Aa,{labelClassName:f.cashboxLabel,emptyPartClassName:f.cashboxEmptyPart,percent:null!==(n=r.fillingPercentageCassette2)&&void 0!==n?n:null===j||void 0===j?void 0:j.fillingPercentageCassette2,applyColorVariant:!0,applyFiatBalanceAlertsStyling:!0,omitInnerPercentage:!0,cashOut:!0}),Object(We.jsxs)("div",{className:f.col2,children:[Object(We.jsx)(Je,{className:f.title,children:"Cassette 2 (Bottom)"}),Object(We.jsx)(vN,{label:"Alert me under",name:"fillingPercentageCassette2",editing:g,displayValue:function(e){return""===e?"-":e},decoration:"%",width:d})]})]})]})]})}})},AN="fillingPercentageCassette1",TN="fillingPercentageCassette2",WN="machine",zN="fiatBalanceOverrides",MN=function(e){var t,n,a,i=e.section,o=Object(r.useContext)(fN),c=o.machines,l=void 0===c?[]:c,s=o.data,d=o.save,u=o.isDisabled,m=o.setEditing,h=o.error,b=null!==(t=null===s||void 0===s?void 0:s.fiatBalanceOverrides)&&void 0!==t?t:[],j=B.a((function(e){return e.machine}),b),p=W.a((function(e){return!qo.a(e.deviceId,j)}))(l),f=(n={},Object(M.a)(n,WN,null),Object(M.a)(n,AN,""),Object(M.a)(n,TN,""),n),g=xn.d().shape((a={},Object(M.a)(a,WN,xn.f().label("Machine").nullable().required()),Object(M.a)(a,AN,xn.c().label("Cassette 1 (top)").when(TN,{is:function(e){return!e},then:xn.c().required()}).transform(of).integer().min(0).max(100).nullable()),Object(M.a)(a,TN,xn.c().label("Cassette 2 (bottom)").when(AN,{is:function(e){return!e},then:xn.c().required()}).transform(of).integer().min(0).max(100).nullable()),a),[AN,TN]),O=[{name:WN,width:238,size:"sm",view:function(e){return L.a(T.a(["name"]),Tr.a(z.a("deviceId",e)))(l)},input:ka,inputProps:{options:function(e){return Wo.a(p,function(e){var t=L.a(Tr.a(z.a("deviceId",null===e||void 0===e?void 0:e.machine)))(l);return t?[t]:[]}(e))},valueProp:"deviceId",labelProp:"name"}},{name:AN,header:"Cash-out 1",width:155,textAlign:"right",doubleHeader:"Cash-out (Cassette Empty)",bold:!0,input:qa,suffix:"%",inputProps:{decimalPlaces:0}},{name:TN,header:"Cash-out 2",width:155,textAlign:"right",doubleHeader:"Cash-out (Cassette Empty)",bold:!0,input:qa,suffix:"%",inputProps:{decimalPlaces:0}}];return Object(We.jsx)(bm,{name:zN,title:"Overrides",error:null===h||void 0===h?void 0:h.message,enableDelete:!0,enableEdit:!0,enableCreate:!0,save:function(e){return d(i,g.cast(e))},initialValues:f,validationSchema:g,forceDisable:u(zN)||!l,data:b,elements:O,disableAdd:!(null===p||void 0===p?void 0:p.length),setEditing:function(e){return m(zN,e)}})},$N={balance:152,transactions:184,compliance:178,errors:142,security:152,active:263},qN=function(e){var t=e.namespace,n=e.forceDisable,a=Object(r.useContext)(fN),i=a.data,o=a.save,c=L.a(o(null),yl(t)),l=vl(t)(i),s=n||!l||!l.active,d=function(e){var t=e.name,n=e.disabled,r=!(!l||!l[t]);return Object(We.jsx)(Kd,{width:$N[t],textAlign:"center",children:Object(We.jsx)(Ca,{disabled:n,checked:r,onChange:function(e){c(Object(M.a)({},t,e.target.checked))},value:r})})};return Object(We.jsxs)(tu,{children:[Object(We.jsx)(Kd,{width:129,children:mu(t)}),Object(We.jsx)(d,{name:"balance",disabled:s}),Object(We.jsx)(d,{name:"transactions",disabled:s}),Object(We.jsx)(d,{name:"compliance",disabled:s}),Object(We.jsx)(d,{name:"errors",disabled:s}),Object(We.jsx)(d,{name:"security",disabled:s}),Object(We.jsx)(d,{name:"active",disabled:n})]})},HN=Object(p.a)({wizardTable:{width:930}}),VN=function(e){var t=e.wizard,n=e.forceDisable,r=t?20:0,a=HN();return Object(We.jsxs)(Xd,{className:t?a.wizardTable:null,children:[Object(We.jsxs)(_d,{children:[Object(We.jsx)(Jd,{width:129-r,children:"Channel"}),Object.keys($N).map((function(e){return Object(We.jsx)(Jd,{width:$N[e]-r,textAlign:"center",children:mu(e)},e)}))]}),Object(We.jsxs)(Qd,{children:[Object(We.jsx)(qN,{namespace:"email",forceDisable:n}),Object(We.jsx)(qN,{namespace:"sms",forceDisable:n}),Object(We.jsx)(qN,{namespace:"notificationCenter",forceDisable:n})]})]})},UN=function(e){var t=e.section,n=e.fieldWidth;return Object(We.jsx)(yN,{section:t,title:"High value transaction",label:"Alert me over",name:"highValueTransaction",width:n})},YN=x()(nN||(nN=Object(l.a)(["\n query getData {\n config\n machines {\n name\n deviceId\n }\n cryptoCurrencies {\n code\n display\n }\n }\n"]))),GN=x()(rN||(rN=Object(l.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),XN=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,j=e.displayTitle,p=void 0===j||j,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)(YN).data,P=Object(u.b)(GN,{refetchQueries:["getData"],onCompleted:function(){return F(null)},onError:function(e){return S(e)}}),D=Object(c.a)(P,1)[0],B=vl(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,W=T.a(["fiatCurrency"])(vl(ml)(null===L||void 0===L?void 0:L.config)),z={save:rl.a((function(e,n){var r=yl(t)(n);return y(e),S(null),D({variables:{config:r}})})),error:k,editingKey:E,data:B,currency:W,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(We.jsxs)(fN.Provider,{value:z,children:[p&&Object(We.jsx)(Do,{title:"Notifications"}),a&&Object(We.jsx)(jf,{title:"Setup",error:k&&!v,children:Object(We.jsx)(VN,{forceDisable:!!E,wizard:g})}),o&&Object(We.jsx)(jf,{title:"Transaction alerts",error:k&&"tx"===v,children:Object(We.jsx)(UN,{section:"tx",fieldWidth:130})}),s&&Object(We.jsxs)(jf,{title:"Fiat balance alerts",error:k&&"fiat"===v,children:[Object(We.jsx)(RN,{section:"fiat",max:100,fieldWidth:50}),b&&Object(We.jsx)(MN,{section:"fiat"})]}),m&&Object(We.jsxs)(jf,{title:"Crypto balance alerts",error:k&&"crypto"===v,children:[Object(We.jsx)(SN,{section:"crypto",fieldWidth:130}),b&&Object(We.jsx)(LN,{section:"crypto",fieldWidth:130})]})]})};function _N(){return(_N=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 ZN(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 QN=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 KN(e,t){var n=e.title,a=e.titleId,i=ZN(e,["title","titleId"]);return r.createElement("svg",_N({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,QN)}var JN=r.forwardRef(KN);n.p;function eI(){return(eI=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 tI(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 nI=r.createElement("desc",null,"Created with Sketch."),rI=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 aI(e,t){var n=e.title,a=e.titleId,i=tI(e,["title","titleId"]);return r.createElement("svg",eI({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,nI,rI)}var iI,oI,cI,lI,sI,dI,uI,mI,hI,bI,jI,pI=r.forwardRef(aI),fI=(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:Y},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:yj.fillColumn,popoverContent:{width:272,padding:[[10,15]]}}),gI=Object(p.a)(fI),OI=function(e){var t=e.name;return"true"===Object(jn.e)().values[t]?Object(We.jsx)(pI,{}):Object(We.jsx)(JN,{})},xI=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=al.a(i.map((function(e){var t;return[e.name,null!==(t=a[e.name])&&void 0!==t?t:null]}))),u=al.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],j=h[1],p=gI(),f=function(){var e=Object(ec.a)(Jo.a.mark((function e(t){return Jo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o(W.a(rf.a(D.a),t)),j(!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(We.jsx)("div",{className:p.booleanPropertiesTableWrapper,children:Object(We.jsx)(jn.d,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,onSubmit:f,initialValues:d,schemaValidation:u,children:function(e){var r=e.resetForm;return Object(We.jsxs)(jn.c,{children:[Object(We.jsxs)("div",{className:p.rowWrapper,children:[Object(We.jsx)(Ue,{children:t}),b?Object(We.jsxs)("div",{className:p.rightAligned,children:[Object(We.jsx)(or,{type:"submit",color:"primary",children:"Save"}),Object(We.jsx)(or,{type:"reset",className:p.rightLink,onClick:function(){r(),j(!1)},color:"secondary",children:"Cancel"})]}):Object(We.jsx)(tr,{className:p.transparentButton,onClick:function(){return j(!0)},children:n?Object(We.jsx)(Zu,{}):Object(We.jsx)(im,{})})]}),Object(We.jsx)($d,{}),Object(We.jsx)(zO,{className:p.fillColumn,children:Object(We.jsx)(MO,{className:p.fillColumn,children:i.map((function(e,t){return Object(We.jsxs)(ZO,{size:"sm",className:p.tableRow,children:[Object(We.jsx)(qO,{className:p.leftTableCell,children:e.display}),Object(We.jsxs)(qO,{className:p.rightTableCell,children:[b&&Object(We.jsx)(jn.b,{component:Ha,name:e.name,options:g,className:E()(p.radioButtons,p.rightTableCell)}),!b&&Object(We.jsx)(OI,{name:e.name})]})]},t)}))})})]})}})})})),vI={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]]}},yI=Object(p.a)(vI),wI=x()(iI||(iI=Object(l.a)(["\n query getData {\n config\n }\n"]))),CI=x()(oI||(oI=Object(l.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),kI=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=yI();return Object(We.jsxs)("div",{className:c.switchRow,children:[Object(We.jsx)(Ge,{children:t}),Object(We.jsxs)("div",{className:c.switch,children:[Object(We.jsx)(Ca,{disabled:r,checked:a,onChange:function(e){return i&&i(e.target.checked)}}),o&&Object(We.jsx)(tt,{children:o})]})]})})),SI=Object(r.memo)((function(e){var t=e.wizard,n=yI(),r=Object(u.c)(wI).data,a=Object(u.b)(CI,{refetchQueries:["getData"]}),i=Object(c.a)(a,1)[0],o=function(e){return i({variables:{config:yl(jl,e)}})},l=(null===r||void 0===r?void 0:r.config)&&vl(jl,r.config);return l?Object(We.jsx)("div",{className:n.content,children:Object(We.jsxs)("div",{children:[Object(We.jsxs)("div",{className:n.header,children:[Object(We.jsx)(Ue,{children:"Coin ATM Radar share settings"}),Object(We.jsx)(sb,{width:304,children:Object(We.jsxs)(Ge,{children:["For details on configuring this panel, please read the relevant knowledgebase article"," ",Object(We.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://support.lamassu.is/hc/en-us/articles/360023720472-Coin-ATM-Radar",children:"here"}),"."]})})]}),Object(We.jsx)(kI,{title:"Share information?",checked:l.active,save:function(e){return o({active:e})},label:l.active?"Yes":"No"}),Object(We.jsx)(xI,{editing:t,title:"Machine info",data:l,elements:[{name:"commissions",display:"Commissions"},{name:"limitsAndVerification",display:"Limits and verification"}],save:o})]})}):null})),NI={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}}},II=Object(p.a)(NI),EI=function(e){var t,n=e.editing,r=e.field,a=e.displayValue,i=Object($.a)(e,["editing","field","displayValue"]),o=II(),c=(t={},Object(M.a)(t,o.field,!0),Object(M.a)(t,o.notEditing,!n),t);return Object(We.jsxs)("div",{className:E()(c),children:[!n&&Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(nt,{children:r.label}),Object(We.jsx)(Ze,{children:a(r.value)})]}),n&&Object(We.jsx)(jn.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))]})},FI=x()(cI||(cI=Object(l.a)(["\n query getData {\n config\n }\n"]))),LI=x()(lI||(lI=Object(l.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),PI=Object(p.a)(vI),DI=function(e){var t,n,a,i,o=e.wizard,l=PI(),s=Object(r.useState)(o||!1),d=Object(c.a)(s,2),m=d[0],h=d[1],b=Object(r.useState)(null),j=Object(c.a)(b,2),p=j[0],f=j[1],g=Object(u.b)(LI,{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)(FI).data,v=function(e){return O({variables:{config:yl(dl,e)}})},y=(null===x||void 0===x?void 0:x.config)&&vl(dl,x.config);if(!y)return null;var w=xn.d().shape({active:xn.b(),name:xn.f(),phone:xn.f(),email:xn.f().email("Please enter a valid email address").required("An email is required"),website:xn.f(),companyNumber:xn.f()}),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(z.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 D.a(e.email)?null:e.email};return Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)("div",{className:l.header,children:Object(We.jsx)(Ue,{children:"Contact information"})}),Object(We.jsxs)("div",{className:l.switchRow,children:[Object(We.jsx)(Ge,{children:"Info card enabled?"}),Object(We.jsxs)("div",{className:l.switch,children:[Object(We.jsx)(Ca,{checked:y.active,onChange:function(e){return v({active:e.target.checked})}}),Object(We.jsx)(tt,{children:y.active?"Yes":"No"})]})]}),Object(We.jsxs)("div",{className:l.section,children:[Object(We.jsxs)("div",{className:l.header,children:[Object(We.jsx)(Ue,{children:"Info card"}),!m&&Object(We.jsx)(tr,{className:l.transparentButton,onClick:function(){return h(!0)},children:Object(We.jsx)(im,{})})]}),Object(We.jsx)(jn.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(We.jsxs)(jn.c,{children:[Object(We.jsx)($d,{}),Object(We.jsxs)("div",{className:l.row,children:[Object(We.jsx)(EI,{field:k("name"),editing:m,displayValue:N,onFocus:function(){return f(null)}}),Object(We.jsx)(EI,{field:k("phone"),editing:m,displayValue:N,onFocus:function(){return f(null)}})]}),Object(We.jsxs)("div",{className:l.row,children:[Object(We.jsx)(EI,{field:k("email"),editing:m,displayValue:N,onFocus:function(){return f(null)}}),Object(We.jsx)(EI,{field:k("website"),editing:m,displayValue:N,onFocus:function(){return f(null)}})]}),Object(We.jsx)("div",{className:l.row,children:Object(We.jsx)(EI,{field:k("companyNumber"),editing:m,displayValue:N,onFocus:function(){return f(null)}})}),m&&!!F(t)&&Object(We.jsx)(Fo,{className:l.formErrorMsg,children:F(t)}),Object(We.jsx)("div",{className:E()(l.row,l.submit),children:m&&Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(or,{color:"primary",type:"submit",children:"Save"}),Object(We.jsx)(or,{color:"secondary",type:"reset",children:"Cancel"}),p&&Object(We.jsx)(Fo,{children:"Failed to save changes"})]})})]})}})]}),!o&&Object(We.jsxs)("div",{className:E()(l.section,l.infoMessage),children:[Object(We.jsx)(ia,{}),Object(We.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."})]})]})},BI=Object(p.a)(vI),RI=x()(sI||(sI=Object(l.a)(["\n query getData {\n config\n }\n"]))),AI=x()(dI||(dI=Object(l.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),TI=Object(r.memo)((function(e){var t=e.wizard,n=BI(),r=Object(u.c)(RI).data,a=Object(u.b)(AI,{refetchQueries:function(){return["getData"]}}),i=Object(c.a)(a,1)[0],o=(null===r||void 0===r?void 0:r.config)&&vl(bl,r.config);return o?Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)("div",{className:n.header,children:Object(We.jsx)(Ue,{children:"Receipt options"})}),Object(We.jsxs)("div",{className:n.switchRow,children:[Object(We.jsx)(Ge,{children:"Enable receipt printing?"}),Object(We.jsxs)("div",{className:n.switch,children:[Object(We.jsx)(Ca,{checked:o.active,onChange:function(e){return i({variables:{config:yl(bl,Yn.a(o,{active:e.target.checked}))}})}}),Object(We.jsx)(tt,{children:o.active?"Yes":"No"})]})]}),Object(We.jsx)(xI,{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:yl(bl,e)}})}})]}):null})),WI=Object(p.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}}}),zI=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=WI(),j=(t={},Object(M.a)(t,b.field,!0),Object(M.a)(t,b.notEditing,!n),Object(M.a)(t,b.notEditingSingleLine,!n&&!d),Object(M.a)(t,b.notEditingMultiline,!n&&d),t);return Object(We.jsxs)("div",{className:E()(j),children:[!n&&Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(nt,{children:o}),Object(We.jsx)(Ze,{children:c})]}),n&&Object(We.jsx)(jn.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))]})},MI=x()(uI||(uI=Object(l.a)(["\n query getData {\n config\n }\n"]))),$I=x()(mI||(mI=Object(l.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),qI=Object(p.a)(vI),HI=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),j=b[0],p=b[1],f=Object(u.b)($I,{onCompleted:function(){m(null),p(!1)},refetchQueries:function(){return["getData"]},onError:function(e){return m(e)}}),g=Object(c.a)(f,1)[0],O=qI(),x=Object(u.c)(MI).data,v=(null===x||void 0===x?void 0:x.config)&&vl(pl,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:yl(pl,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(z.a("name",e))(S)}(e).value},I={title:N("title"),text:N("text"),acceptButtonText:N("acceptButtonText"),cancelButtonText:N("cancelButtonText")},F=xn.d().shape({title:xn.f().required().max(50,"Too long"),text:xn.f().required(),acceptButtonText:xn.f().required().max(50,"Too long"),cancelButtonText:xn.f().required().max(50,"Too long")});return Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)("div",{className:O.header,children:Object(We.jsx)(Ue,{children:"Terms & Conditions"})}),Object(We.jsxs)("div",{className:O.switchRow,children:[Object(We.jsx)(Ge,{children:"Show on screen"}),Object(We.jsxs)("div",{className:O.switch,children:[Object(We.jsx)(Ca,{checked:w,onChange:function(e){return k({active:e.target.checked})}}),Object(We.jsx)(tt,{children:w?"Yes":"No"})]})]}),Object(We.jsxs)("div",{className:O.switchRow,children:[Object(We.jsx)(Ge,{children:"Add 7 seconds delay on screen"}),Object(We.jsxs)("div",{className:O.switch,children:[Object(We.jsx)(Ca,{checked:C,onChange:function(e){return k({delay:e.target.checked})}}),Object(We.jsx)(tt,{children:C?"Yes":"No"})]})]}),Object(We.jsxs)("div",{className:O.header,children:[Object(We.jsx)(_e,{children:"Info card"}),!j&&Object(We.jsx)(tr,{className:O.transparentButton,onClick:function(){return p(!0)},children:Object(We.jsx)(im,{})})]}),Object(We.jsx)(jn.d,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,initialValues:I,validationSchema:F,onSubmit:function(e){return k(e)},onReset:function(){p(!1),m(null)},children:Object(We.jsxs)(jn.c,{children:[Object(We.jsx)($d,{}),S.map((function(e,t){return Object(We.jsx)("div",{className:O.row,children:Object(We.jsx)(zI,{editing:j,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(We.jsx)("div",{className:E()(O.row,O.submit),children:j&&Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(or,{color:"primary",type:"submit",children:"Save"}),Object(We.jsx)(or,{color:"secondary",type:"reset",children:"Cancel"}),d&&Object(We.jsx)(Fo,{children:"Failed to save changes"})]})})]})})]})},VI={running:ne,notRunning:"#ffeceb"},UI={running:"#ecfbef",notRunning:me},YI={uptimeContainer:{display:"inline-block",minWidth:104,margin:[[0,20]]},name:{extend:Re.label1,paddingLeft:4,color:se}},GI=Object(p.a)(YI),XI=Object(p.a)({root:{borderRadius:4,marginTop:4,marginRight:2,marginBottom:4,marginLeft:2,height:24,backgroundColor:function(e){var t=e.type;return UI[t]}},label:{fontSize:ye,fontWeight:Se,fontFamily:Ne,padding:[[4,8]],color:function(e){var t=e.type;return VI[t]}}}),_I=function(e){var t,n=e.process,r=(Object($.a)(e,["process"]),GI());return Object(We.jsxs)("div",{className:r.uptimeContainer,children:[Object(We.jsx)("div",{className:r.name,children:xO.a(n.name)}),Object(We.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"))):du(n.state),classes:XI({type:"RUNNING"===n.state?"running":"notRunning"})})]})},ZI={serverTableWrapper:{extend:yj.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"}},QI=Yn.a(yj,ZI),KI=Object(p.a)(QI),JI={code:"SHOW_ALL",display:"Show all"},eE=x()(hI||(hI=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"]))),tE=x()(bI||(bI=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"]))),nE=x()(jI||(jI=Object(l.a)(["\n query getData {\n config\n }\n"]))),rE=function(){var e,t,n=KI(),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)(JI),m=Object(c.a)(d,2),h=m[0],b=m[1],j=Object(u.c)(tE,{onCompleted:function(){return s("")},variables:{limit:500}}),p=j.data,f=j.loading,g=Object(u.c)(nE),O=g.data,x=g.configLoading,v=T.a(["config","locale_timezone"],O),y=null===p||void 0===p?void 0:p.serverVersion,w=null!==(e=null===p||void 0===p?void 0:p.uptime)&&void 0!==e?e:[],C=L.a(Ad.a(JI),gp.a,Wo.a([{code:"error",display:"Error"},{code:"info",display:"Info"},{code:"debug",display:"Debug"}]),B.a((function(e){return{code:T.a(["logLevel"])(e),display:mu(T.a(["logLevel"])(e))}})),T.a(["serverLogs"]));return Object(We.jsxs)(We.Fragment,{children:[Object(We.jsxs)("div",{className:n.titleWrapper,children:[Object(We.jsxs)("div",{className:n.titleAndButtonsContainer,children:[Object(We.jsx)(yn,{children:"Server"}),p&&Object(We.jsxs)("div",{className:n.buttonsWrapper,children:[Object(We.jsx)(Yk,{title:"Download logs",name:"server-logs",query:eE,args:{timezone:v},logs:p.serverLogs,getLogs:function(e){return T.a(["serverLogsCsv"])(e)},timezone:v}),Object(We.jsx)(Ze,{children:l})]})]}),Object(We.jsx)("div",{className:n.serverVersion,children:y&&Object(We.jsxs)("span",{children:["Server version: v",y]})})]}),Object(We.jsxs)("div",{className:n.headerLine2,children:[p&&Object(We.jsx)(Pu,{onSelectedItemChange:function(e){a.current&&a.current.scrollTo(0,0),b(e)},label:"Level",items:C(p),default:JI,selectedItem:h}),Object(We.jsx)("div",{className:n.uptimeContainer,children:w&&w.map((function(e,t){return Object(We.jsx)(_I,{process:e},t)}))})]}),Object(We.jsx)("div",{className:n.wrapper,children:Object(We.jsxs)("div",{ref:a,className:n.serverTableWrapper,children:[Object(We.jsxs)(zO,{className:n.table,children:[Object(We.jsx)(HO,{children:Object(We.jsxs)(ZO,{header:!0,children:[Object(We.jsx)(YO,{className:n.dateColumn,children:"Date"}),Object(We.jsx)(YO,{className:n.levelColumn,children:"Level"}),Object(We.jsx)(YO,{className:n.fillColumn})]})}),Object(We.jsx)(MO,{children:p&&p.serverLogs.filter((function(e){return h===JI||e.logLevel===h.code})).map((function(e,t){return Object(We.jsxs)(ZO,{size:"sm",children:[Object(We.jsx)(qO,{children:v&&Rm(e.timestamp,v,"YYYY-MM-DD HH:mm")}),Object(We.jsx)(qO,{children:e.logLevel}),Object(We.jsx)(qO,{children:e.message})]},t)}))})]}),f&&x&&Object(We.jsx)(Ue,{children:"Loading..."}),!f&&!x&&!(null===p||void 0===p||null===(t=p.serverLogs)||void 0===t?void 0:t.length)&&Object(We.jsx)(Ue,{children:"No activity so far"})]})})]})},aE=n(941),iE=n(929),oE=n(930);function cE(){return(cE=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 lE(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 sE=r.createElement("desc",null,"Created with Sketch."),dE=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 uE(e,t){var n=e.title,a=e.titleId,i=lE(e,["title","titleId"]);return r.createElement("svg",cE({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,sE,dE)}var mE,hE,bE,jE,pE,fE,gE,OE,xE=r.forwardRef(uE),vE=(n.p,{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"}}),yE=Object(p.a)(vE),wE=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=yE({width:n,height:a});return Object(We.jsx)(We.Fragment,{children:Object(We.jsxs)(Xd,{className:E()(l,s.table),children:[Object(We.jsx)(_d,{children:Object(We.jsxs)(Jd,{className:s.head,children:[i,Object(We.jsx)(tr,{onClick:c,className:s.button,children:Object(We.jsx)(xE,{})})]})}),Object(We.jsx)(Qd,{children:Object(We.jsx)(tu,{className:s.tr,children:Object(We.jsx)(Kd,{width:n,children:o&&Object(We.jsxs)(We.Fragment,{children:[o[0]&&Object(We.jsxs)("div",{className:s.itemWrapper,children:[Object(We.jsx)("div",{className:s.label,children:o[0].label}),Object(We.jsx)("div",{className:s.item,children:o[0].value})]}),o[1]&&Object(We.jsxs)("div",{className:s.itemWrapper,children:[Object(We.jsx)("div",{className:s.label,children:o[1].label}),Object(We.jsx)("div",{className:s.item,children:o[1].value})]})]})})})})]})})},CE=x()(mE||(mE=Object(l.a)(["\n query getData {\n accounts\n config\n }\n"]))),kE=x()(hE||(hE=Object(l.a)(["\n mutation Save($accounts: JSONObject) {\n saveAccounts(accounts: $accounts)\n }\n"]))),SE=Object(p.a)({wrapper:{marginLeft:1}}),NE=function(){var e,t=Object(r.useState)(null),n=Object(c.a)(t,2),a=n[0],i=n[1],o=Object(u.c)(CE).data,l=Object(u.b)(kE,{onCompleted:function(){return i(null)},refetchQueries:["getData"]}),d=Object(c.a)(l,1)[0],m=SE(),b=null!==(e=null===o||void 0===o?void 0:o.accounts)&&void 0!==e?e:{},j=function(e,t){var n=W.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(We.jsxs)("div",{className:m.wrapper,children:[Object(We.jsx)(Do,{title:"3rd Party Services"}),Object(We.jsx)(h.a,{container:!0,spacing:4,children:Kl.a(hg).map((function(e){return Object(We.jsx)(h.a,{item:!0,children:Object(We.jsx)(wE,{editMessage:"Configure "+e.title,title:e.title,onEdit:function(){return i(e)},items:j(e.code,e.elements)})},e.code)}))}),a&&Object(We.jsx)(Zg,{title:"Edit ".concat(a.name),width:478,handleClose:function(){return i(null)},open:!0,children:Object(We.jsx)(Df,{save:function(e){return d({variables:{accounts:Object(M.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=aE.a(["config","wallets_BTC_wallet"]),r=ds.a(iE.a(n,o),t.requirement);return t.enabled=r,e}(e):e.component!==Va?e:Object(s.a)(Object(s.a)({},e),{},{inputProps:{isPasswordFilled:!D.a(b[t])&&!D.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=W.a(z.a("component",Va)),i=B.a(R.a(["code"])),o=L.a(i,a)(t);return oE.a((function(e,t){return F.a(t,o)?"":e}),r)}(a)})})]})},IE=n(409),EE=n.n(IE),FE=x()(bE||(bE=Object(l.a)(["\n query sessions {\n sessions {\n sid\n sess\n expire\n }\n }\n"]))),LE=x()(jE||(jE=Object(l.a)(["\n mutation deleteSession($sid: String!) {\n deleteSession(sid: $sid) {\n sid\n }\n }\n"]))),PE=function(){var e=Object(u.c)(FE).data,t=Object(u.b)(LE,{refetchQueries:function(){return["sessions"]}}),n=Object(c.a)(t,1)[0],r=[{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(D.a(e.sess.ua))return"No Record";var t=EE()(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(Il.a.utc(e.expire).format("YYYY-MM-DD")," ").concat(Il.a.utc(e.expire).format("HH:mm:ss"))}},{header:"",width:80,textAlign:"center",size:"sm",view:function(e){return Object(We.jsx)(tr,{onClick:function(){n({variables:{sid:e.sid}})},children:Object(We.jsx)(Vu,{})})}}];return Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(Do,{title:"Session Management"}),Object(We.jsx)(JO,{elements:r,data:T.a(["sessions"])(e)})]})},DE=Object(p.a)(Nj),BE=x()(pE||(pE=Object(l.a)(["\n query getData {\n config\n }\n"]))),RE=x()(fE||(fE=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"]))),AE=x()(gE||(gE=Object(l.a)(["\n query filters {\n transactionFilters {\n type\n value\n }\n }\n"]))),TE=x()(OE||(OE=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 }\n }\n"]))),WE=function(){var e=DE(),t=Object(w.h)(),n=Object(r.useState)([]),a=Object(c.a)(n,2),i=a[0],o=a[1],l=Object(u.c)(AE),s=l.data,d=l.loading,m=Object(r.useState)([]),h=Object(c.a)(m,2),b=h[0],j=h[1],p=Object(r.useState)({limit:1e3}),f=Object(c.a)(p,2),g=f[0],O=f[1],x=Object(u.c)(TE,{variables:g,onCompleted:function(e){return j(T.a(["transactions"])(e))}}),v=x.data,y=x.loading,C=x.refetch,k=x.startPolling,S=x.stopPolling;Object(r.useEffect)((function(){return k(1e4),S}));var N=Object(u.c)(BE),I=N.data,E=N.configLoading,F=T.a(["config","locale_timezone"],I),P=function(e){return e.customerName?e.customerName:e.customerIdCardData?function(e){var t=e.firstName,n=e.lastName;return"".concat(Xh.a(_h.a,Zh.a)(t),". ").concat(n)}(e.customerIdCardData):e.customerPhone},D=[{header:"",width:32,size:"sm",view:function(e){return"cashOut"===e.txClass?Object(We.jsx)(Kc,{}):Object(We.jsx)(Uc,{})}},{header:"Machine",name:"machineName",width:160,size:"sm",view:T.a(["machineName"])},{header:"Customer",width:202,size:"sm",view:function(n){return Object(We.jsxs)("div",{className:e.flexWrapper,children:[Object(We.jsx)("div",{className:e.overflowTd,children:P(n)}),!n.isAnonymous&&Object(We.jsx)("div",{onClick:function(){return e=n.customerId,t.push("/compliance/customer/".concat(e));var e},children:Object(We.jsx)(pd,{className:e.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(Gh.utils.toUnit(new tl.a(e.cryptoAtoms),e.cryptoCode)," ").concat(e.cryptoCode)}},{header:"Address",view:function(e){return Gh.utils.formatCryptoAddress(e.cryptoCode,e.toAddress)},className:e.overflowTd,size:"sm",width:140},{header:"Date (UTC)",view:function(e){return F&&Rm(e.created,F,"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}],R=T.a(["transactionFilters"])(s);return Object(We.jsxs)(We.Fragment,{children:[Object(We.jsxs)("div",{className:e.titleWrapper,children:[Object(We.jsxs)("div",{className:e.titleAndButtonsContainer,children:[Object(We.jsx)(yn,{children:"Transactions"}),Object(We.jsx)("div",{className:e.buttonsWrapper,children:Object(We.jsx)(_y,{loading:d,filters:i,options:R,inputPlaceholder:"Search Transactions",onChange:function(e){var t=L.a(Lf.a,B.a((function(e){return Object(M.a)({},e.type,e.value)})))(e);o(e),O({limit:1e3,txClass:t.type,machineName:t.machine,customerName:t.customer,fiatCode:t.fiat,cryptoCode:t.crypto,toAddress:t.address,status:t.status}),C&&C()}})}),v&&Object(We.jsx)("div",{className:e.buttonsWrapper,children:Object(We.jsx)(Yk,{title:"Download logs",name:"transactions",query:RE,getLogs:function(e){return T.a(["transactionsCsv"])(e)},simplified:!0})})]}),Object(We.jsxs)("div",{className:e.headerLabels,children:[Object(We.jsxs)("div",{children:[Object(We.jsx)(Kc,{}),Object(We.jsx)("span",{children:"Cash-out"})]}),Object(We.jsxs)("div",{children:[Object(We.jsx)(Uc,{}),Object(We.jsx)("span",{children:"Cash-in"})]})]})]}),i.length>0&&Object(We.jsx)(Jy,{filters:i,onFilterDelete:function(e){return o(W.a((function(t){return!My.a(ju.a(["type","value"],t),e)}))(i))},setFilters:o}),Object(We.jsx)(JO,{loading:y&&E,emptyText:"No transactions so far",elements:D,data:b,Details:zj,expandable:!0,rowSize:"sm",timezone:F})]})};function zE(){return(zE=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 $E=r.createElement("desc",null,"Created with Sketch."),qE=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 HE(e,t){var n=e.title,a=e.titleId,i=ME(e,["title","titleId"]);return r.createElement("svg",zE({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,$E,qE)}var VE=r.forwardRef(HE);n.p;function UE(){return(UE=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 YE(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 GE=r.createElement("desc",null,"Created with Sketch."),XE=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 _E(e,t){var n=e.title,a=e.titleId,i=YE(e,["title","titleId"]);return r.createElement("svg",UE({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,GE,XE)}var ZE,QE,KE,JE,eF,tF,nF,rF,aF,iF,oF,cF,lF,sF,dF,uF,mF,hF=r.forwardRef(_E),bF=(n.p,n(931)),jF=Object(p.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}}),pF=xn.f().required(),fF=xn.d().shape({threshold:xn.c().nullable().transform(of).label("Invalid threshold"),thresholdDays:xn.c().transform(of).nullable().label("Invalid threshold days")}),gF=xn.d().shape({requirement:xn.f().required(),suspensionDays:xn.c().transform(of).nullable()}),OF=xn.d().shape({triggerType:pF,requirement:gF,threshold:fF}).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"})})),xF=xn.d().shape({triggerType:xn.f().required(),threshold:xn.d({threshold:xn.c().transform(of).nullable(),thresholdDays:xn.c().transform(of).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)})})),vF=[{display:"Transaction amount",code:"txAmount"},{display:"Transaction volume",code:"txVolume"},{display:"Transaction velocity",code:"txVelocity"},{display:"Consecutive days",code:"consecutiveDays"}],yF=function(e){var t,n,r,a,i,o,c=Object.assign({},e),l=jF(),s=Object(jn.e)(),d=s.errors,u=s.touched,m=s.values,h=s.setTouched,b=s.handleChange,j=Object(M.a)({},l.error,d.triggerType&&u.triggerType),p=qo.a(null===m||void 0===m?void 0:m.triggerType),f=p(["txAmount","txVolume"]),g=p(["txVelocity"]),O=p(["txVolume","txVelocity"]),x=p(["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)&&!p(["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(M.a)({},l.error,w);return Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(No.a,{display:"flex",alignItems:"center",children:Object(We.jsx)(Ue,{className:E()(j),children:"Choose trigger type"})}),Object(We.jsx)(jn.b,{component:Ha,name:"triggerType",options:vF,labelClassName:l.radioLabel,radioClassName:l.radio,className:l.radioGroup,onChange:function(e){b(e),h({threshold:!1,thresholdDays:!1})}}),Object(We.jsxs)("div",{className:l.thresholdWrapper,children:[(f||g||O||x)&&Object(We.jsx)(Ue,{className:E()(C,l.thresholdTitle),children:"Threshold"}),Object(We.jsxs)("div",{className:l.thresholdContentWrapper,children:[f&&Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(jn.b,{className:l.thresholdField,component:qa,size:"lg",name:"threshold.threshold",error:v}),Object(We.jsx)(Xe,{className:E()(l.description),children:c.currency})]}),g&&Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(jn.b,{className:l.thresholdField,component:qa,size:"lg",name:"threshold.threshold",error:v}),Object(We.jsx)(Xe,{className:E()(l.description),children:"transactions"})]}),O&&Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(Xe,{className:E()(j,l.space,l.description),children:"in"}),Object(We.jsx)(jn.b,{className:l.thresholdField,component:qa,size:"lg",name:"threshold.thresholdDays",error:y}),Object(We.jsx)(Xe,{className:E()(l.description),children:"days"})]}),x&&Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(jn.b,{className:l.thresholdField,component:qa,size:"lg",name:"threshold.thresholdDays",error:y}),Object(We.jsx)(Xe,{className:E()(l.description),children:"consecutive days"})]})]})]})]})},wF=xn.d().shape({requirement:xn.d({requirement:xn.f().required(),suspensionDays:xn.c().when("requirement",{is:function(e){return"suspend"===e},then:xn.c().nullable().transform(of),otherwise:xn.c().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"})})),CF=[{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"}],kF={schema:wF,options:CF,Component:function(){var e,t,n,r,a=jF(),i=Object(jn.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(M.a)({},a.error,!!c.requirement&&!m||m&&u);return Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(No.a,{display:"flex",alignItems:"center",children:Object(We.jsx)(Ue,{className:E()(h),children:"Choose a requirement"})}),Object(We.jsx)(jn.b,{component:Ha,name:"requirement.requirement",options:CF,labelClassName:a.specialLabel,radioClassName:a.radio,className:E()(a.radioGroup,a.specialGrid),onChange:function(e){s(e),d({suspensionDays:!1})}}),m&&Object(We.jsx)(jn.b,{className:a.thresholdField,component:qa,label:"Days",size:"lg",name:"requirement.suspensionDays",error:u})]})},initialValues:{requirement:{requirement:"",suspensionDays:""}}},SF=function(e,t,n){return function(r){return e?L.a(R.a(t),Tr.a(z.a(null!==n&&void 0!==n?n:"code",r)))(e):""}},NF=function(){var e,t=Object(jn.e)().values,n=jF(),r=null===t||void 0===t||null===(e=t.requirement)||void 0===e?void 0:e.requirement,a="suspend"===r,i=SF(CF,"display")(r);return Object(We.jsxs)(No.a,{display:"flex",alignItems:"baseline",children:["".concat(i," ").concat(a?"for":""),a&&Object(We.jsx)(jn.b,{bold:!0,className:n.suspensionDays,name:"requirement.suspensionDays",component:qa,textAlign:"center"}),a&&"days"]})},IF=function(e){var t=e.requirement,n=e.suspensionDays,r=jF(),a=SF(CF,"display")(t),i="suspend"===t;return Object(We.jsxs)(No.a,{display:"flex",alignItems:"baseline",children:["".concat(a," ").concat(i?"for":""),i&&Object(We.jsx)(_e,{className:r.space,noMargin:!0,children:n}),i&&"days"]})},EF=function(e){var t,n,r,a=e.config,i=e.currency,o=e.isEdit,c=jF(),l=(t={},Object(M.a)(t,c.input,!0),Object(M.a)(t,c.limitedInput,"txVelocity"===(null===a||void 0===a?void 0:a.triggerType)),Object(M.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(We.jsx)(jn.b,{bold:!0,className:E()(l),name:"threshold.threshold",component:qa,textAlign:"right"}):Object(We.jsx)(_e,{noMargin:!0,children:s}),m=o?Object(We.jsx)(jn.b,{bold:!0,className:E()(l),name:"threshold.thresholdDays",component:qa,textAlign:"right"}):Object(We.jsx)(_e,{noMargin:!0,children:d});switch(null===a||void 0===a?void 0:a.triggerType){case"txAmount":return Object(We.jsxs)(No.a,{display:"flex",alignItems:"baseline",justifyContent:"right",children:[u,Object(We.jsx)(tt,{noMargin:!0,className:c.lastSpace,children:i})]});case"txVolume":return Object(We.jsxs)(No.a,{display:"flex",alignItems:"baseline",justifyContent:"right",children:[u,Object(We.jsx)(tt,{noMargin:!0,className:c.lastSpace,children:i}),Object(We.jsx)(et,{noMargin:!0,className:c.space,children:"in"}),m,Object(We.jsx)(et,{noMargin:!0,className:c.lastSpace,children:"days"})]});case"txVelocity":return Object(We.jsxs)(No.a,{display:"flex",alignItems:"baseline",justifyContent:"right",children:[u,Object(We.jsx)(et,{className:c.space,noMargin:!0,children:"transactions in"}),m,Object(We.jsx)(et,{className:c.lastSpace,noMargin:!0,children:"days"})]});case"consecutiveDays":return Object(We.jsxs)(No.a,{display:"flex",alignItems:"baseline",justifyContent:"right",children:[m,Object(We.jsx)(et,{className:c.lastSpace,noMargin:!0,children:"days"})]});default:return""}},FF=Object(r.memo)((function(e){var t=e.currency,n=Object(jn.e)().values;return Object(We.jsx)(EF,{isEdit:!0,config:n,currency:t})})),LF=function(e){var t=e.config,n=e.currency;return Object(We.jsx)(EF,{config:t,currency:n})},PF=function(e,t){return[{name:"triggerType",size:"sm",width:230,input:function(e){var t=e.field.value;return Object(We.jsx)(We.Fragment,{children:SF(vF,"display")(t)})},view:SF(vF,"display"),inputProps:{options:vF,valueProp:"code",labelProp:"display",optionsLimit:null}},{name:"requirement",size:"sm",width:230,bypassField:!0,input:NF,view:function(e){return Object(We.jsx)(IF,Object(s.a)({},e))}},{name:"threshold",size:"sm",width:284,textAlign:"right",input:function(){return Object(We.jsx)(FF,{currency:e})},view:function(t,n){return Object(We.jsx)(LF,{config:n,currency:e})}}]},DF=B.a(R.a("code"))(vF),BF=[bF.a((function(e,t){return DF.indexOf(e.triggerType)<DF.indexOf(t.triggerType)}))],RF=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)},AF={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"}},TF=Object(p.a)(AF),WF=function(e,t){switch(e){case 1:return function(e){return{schema:xF,options:vF,Component:yF,props:{currency:e},initialValues:{triggerType:"",threshold:{threshold:"",thresholdDays:""}}}}(t);case 2:return kF;default:return r.Fragment}},zF=function(e,t,n,r){switch(e){case 1:return Object(We.jsxs)(We.Fragment,{children:["If the user ",$F(t,n,r)]});case 2:return Object(We.jsxs)(We.Fragment,{children:["the user will be ",qF(t,r),"."]});default:return Object(We.jsx)(We.Fragment,{})}},MF=function(e,t){var n=Object(We.jsx)("span",{className:t.blankSpace});return zr.a(e)||D.a(e)?n:e},$F=function(e,t,n){switch(e.triggerType){case"txAmount":return Object(We.jsxs)(We.Fragment,{children:["makes a single transaction over"," ",MF(e.threshold.threshold,n)," ",t]});case"txVolume":return Object(We.jsxs)(We.Fragment,{children:["makes ",MF(e.threshold.threshold,n)," ",t," ","worth of transactions within"," ",MF(e.threshold.thresholdDays,n)," ",hu(e.threshold.thresholdDays,"day","days")]});case"txVelocity":return Object(We.jsxs)(We.Fragment,{children:["makes ",MF(e.threshold.threshold,n)," ",hu(e.threshold.threshold,"transaction","transactions")," ","in ",MF(e.threshold.thresholdDays,n)," ",hu(e.threshold.thresholdDays,"day","days")]});case"consecutiveDays":return Object(We.jsxs)(We.Fragment,{children:["at least one transaction every day for"," ",MF(e.threshold.thresholdDays,n)," ",hu(e.threshold.thresholdDays,"day","days")]});default:return Object(We.jsx)(We.Fragment,{})}},qF=function(e,t){var n;switch(null===(n=e.requirement)||void 0===n?void 0:n.requirement){case"sms":return Object(We.jsx)(We.Fragment,{children:"asked to enter code provided through SMS verification"});case"idCardPhoto":return Object(We.jsx)(We.Fragment,{children:"asked to scan a ID with photo"});case"idCardData":return Object(We.jsx)(We.Fragment,{children:"asked to scan a ID"});case"facephoto":return Object(We.jsx)(We.Fragment,{children:"asked to have a photo taken"});case"usSsn":return Object(We.jsx)(We.Fragment,{children:"asked to input his social security number"});case"sanctions":return Object(We.jsx)(We.Fragment,{children:"matched against the OFAC sanctions list"});case"superuser":return Object(We.jsx)(We.Fragment,{});case"suspend":return Object(We.jsxs)(We.Fragment,{children:["suspended for"," ",MF(e.requirement.suspensionDays,t)," ",hu(e.requirement.suspensionDays,"day","days")]});case"block":return Object(We.jsx)(We.Fragment,{children:"blocked"});default:return MF(null,t)}},HF=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=TF(),l=Qg.a(1,t).map((function(e){return zF(e,r,o,c)})),s=zF(t,i,o,c),d=2===t;return Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(Ye,{className:c.infoTitle,children:"Trigger overview so far"}),Object(We.jsxs)(Ze,{noMargin:!0,className:c.infoText,children:[l,1!==t&&", ",s,!d&&"..."]})]})},VF=function(e){var t=e.setValues,n=Object(jn.e)().values;return Object(r.useEffect)((function(){t&&n&&t(n)}),[t,n]),null},UF=function(e){var t=e.onClose,n=e.save,a=e.error,i=e.currency,o=TF(),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),j=b[0],p=j.step,f=j.config,g=b[1],O=2===p,x=WF(p,i),v=function(){var e=Object(ec.a)(Jo.a.mark((function e(t){var r;return Jo.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=Yn.a(f,x.schema.cast(t)),!O){e.next=3;break}return e.abrupt("return",n(r));case 3:g({step:p+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=qo.a(h),j="suspend"===(null===n||void 0===n||null===(r=n.requirement)||void 0===r?void 0:r.requirement),p=!!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:j&&p?e.requirement:void 0};return Object(We.jsx)(We.Fragment,{children:Object(We.jsxs)(Zg,{title:"New compliance trigger",handleClose:t,width:520,height:520,infoPanel:Object(We.jsx)(HF,{currency:i,step:p,config:f,liveValues:u}),infoPanelHeight:172,open:!0,children:[Object(We.jsx)(oO,{className:o.stepper,steps:2,currentStep:p}),Object(We.jsx)(jn.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(We.jsxs)(jn.c,{className:o.form,children:[Object(We.jsx)(VF,{setValues:m}),Object(We.jsx)(x.Component,Object(s.a)({},x.props)),Object(We.jsxs)("div",{className:o.submit,children:[a&&Object(We.jsx)(Fo,{children:"Failed to save"}),y(t,n,r)&&Object(We.jsx)(Fo,{children:y(t,n,r)}),Object(We.jsx)(Tn,{className:o.button,type:"submit",children:O?"Finish":"Next"})]})]})}})]})})},YF=[{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"}],GF=xn.d().shape({expirationTime:xn.f().label("Expiration time").required(),automation:xn.f().label("Automation").matches(/(Manual|Automatic)/).required()}),XF=[{expirationTime:"Forever",automation:"Automatic"}],_F={requirement:"",expirationTime:"Forever",automation:"Automatic"},ZF=x()(ZE||(ZE=Object(l.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),QF=x()(QE||(QE=Object(l.a)(["\n query getData {\n config\n }\n"]))),KF=Object(r.memo)((function(){var e,t,n=fl,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),j=Object(c.a)(b,2),p=j[0],f=j[1],g=Object(u.c)(QF).data,O=Object(u.b)(ZF,{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)&&vl(n)(null===g||void 0===g?void 0:g.config),y=v&&!zr.a(v)?v:XF,w=null!==(e=null===v||void 0===v?void 0:v.overrides)&&void 0!==e?e:[];return Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(jf,{children:Object(We.jsx)(bm,{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=yl(n)(e.triggersConfig[0]);return l(null),x({variables:{config:t}})},validationSchema:GF,data:Yx.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:p})}),Object(We.jsx)(jf,{children:Object(We.jsx)(bm,{error:null===o||void 0===o?void 0:o.message,title:"Overrides",titleLg:!0,name:"overrides",enableDelete:!0,enableEdit:!0,enableCreate:!0,initialValues:_F,save:function(e){var t=yl(n)(e);return l(null),x({variables:{config:t}})},validationSchema:(t=w,xn.d().shape({id:xn.f().label("Requirement").required().test({test:function(){var e,n=this.parent.requirement;return!Tr.a(z.a("requirement",n))(t)||this.createError({message:"Requirement ".concat((e=n,R.a("display",Tr.a(z.a("code",e))(YF)))," already overriden")})}}),expirationTime:xn.f().label("Expiration time").required(),automation:xn.f().label("Automation").matches(/(Manual|Automatic)/).required()})),data:w,elements:[{name:"requirement",header:"Requirement",width:196,size:"sm",view:SF(YF,"display"),input:ka,inputProps:{options:YF,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})})]})})),JF=Object(p.a)({switchLabel:{margin:6,width:24},tableRadioGroup:{flexDirection:"row",justifyContent:"space-between"},tableRadioLabel:{marginRight:0},tableWidth:{width:918}}),eL=x()(KE||(KE=Object(l.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),tL=x()(JE||(JE=Object(l.a)(["\n query getData {\n config\n }\n"]))),nL=function(){var e,t,n,a=JF(),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],j=h[1],p=Object(u.c)(tL),f=p.data,g=p.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)&&vl("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)(eL,{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"])(vl(ml)(null===f||void 0===f?void 0:f.config));return Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(Do,{title:"Compliance Triggers",button:{text:"Advanced settings",icon:hF,inverseIcon:VE,toggle:j},className:a.tableWidth,children:!b&&Object(We.jsx)(No.a,{display:"flex",alignItems:"center",children:Object(We.jsxs)(No.a,{display:"flex",alignItems:"center",justifyContent:"flex-end",mr:"-5px",children:[Object(We.jsx)(Ge,{children:"Reject reused addresses"}),Object(We.jsx)(Ca,{checked:v,onChange:function(e){!function(e){var t=yl("compliance")(e);N({variables:{config:t}})}({rejectAddressReuse:e.target.checked})},value:v}),Object(We.jsx)(tt,{className:a.switchLabel,children:v?"On":"Off"}),Object(We.jsx)(sb,{width:304,children:Object(We.jsx)(Ge,{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(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(No.a,{marginBottom:2,className:a.tableWidth,display:"flex",justifyContent:"flex-end",children:!g&&!zr.a(O)&&Object(We.jsx)(or,{color:"primary",onClick:function(){return d(!0)},children:"+ Add new trigger"})}),Object(We.jsx)(bm,{data:O,name:"triggers",enableEdit:!0,sortBy:BF,groupBy:"triggerType",enableDelete:!0,error:null===C||void 0===C?void 0:C.message,save:function(e){return k(null),N({variables:{config:{triggers:RF(e.triggers)}}})},validationSchema:OF,elements:PF(I)}),l&&Object(We.jsx)(UF,{currency:I,error:null===C||void 0===C?void 0:C.message,save:function(e){var t=Wo.a([Object(s.a)({id:Object(zd.a)(),direction:"both"},e)])(O);return N({variables:{config:{triggers:RF(t)}}})},onClose:function(){return d(null)}}),!g&&zr.a(O)&&Object(We.jsxs)(No.a,{display:"flex",alignItems:"center",flexDirection:"column",mt:15,children:[Object(We.jsx)(He,{children:"It seems there are no active compliance triggers on your network"}),Object(We.jsx)(Tn,{onClick:function(){return d(!0)},children:"Add first trigger"})]})]}),b&&Object(We.jsx)(KF,{error:C,save:N,data:f})]})},rL={footer:{display:"flex",flexDirection:"row",margin:[["auto",0,24,0]]},modalTitle:{marginTop:-5,color:J,fontFamily:je},modalLabel1:{marginTop:20},modalLabel2:{marginTop:40},inputLabel:{color:J,fontFamily:je,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:je,marginLeft:15,marginTop:-5},actionChip:{backgroundColor:ae,marginRight:15,marginTop:-5},info:{fontFamily:pe,textAlign:"justify"},addressWrapper:{backgroundColor:ae,marginTop:8,height:35},address:{margin:"0px ".concat(16,"px 0px ").concat(16,"px"),paddingRight:-15},errorMessage:{fontFamily:pe,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"}},aL=Object(p.a)(rL),iL=x()(eF||(eF=Object(l.a)(["\n query confirm2FA($code: String!) {\n confirm2FA(code: $code)\n }\n"]))),oL=function(e){var t=e.showModal,n=e.handleClose,a=e.setConfirmation,i=aL(),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],j=h[1],p=Object(u.a)(iL,{onCompleted:function(e){return e.confirm2FA?(a(s),d(""),void j(!1)):j(!0)}}),f=Object(c.a)(p,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(We.jsxs)(Zg,{closeOnBackdropClick:!0,width:500,height:350,handleClose:n,open:!0,children:[Object(We.jsx)(_e,{className:i.modalTitle,children:"Confirm action"}),Object(We.jsx)(Ge,{className:i.info,children:"To make changes on this user, please confirm this action by entering your two-factor authentication code below."}),Object(We.jsx)(ha,{name:"2fa",value:s,onChange:function(e){d(e),j(!1)},numInputs:6,error:b,containerStyle:i.codeContainer,shouldAutoFocus:!0}),x()&&Object(We.jsx)(Ge,{className:i.errorMessage,children:x()}),Object(We.jsx)("div",{className:i.footer,children:Object(We.jsx)(Tn,{className:i.submit,onClick:function(){6===s.length?g({variables:{code:s}}):j(!0)},children:"Confirm"})})]})},cL=x()(tF||(tF=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"]))),lL=Object(p.a)(rL),sL=function(e){var t=e.state,n=e.dispatch,a=e.user,i=e.requiresConfirmation,o=lL(),l=Object(u.b)(cL,{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),j=b[0],p=b[1],f=function(){p(null),n({type:"close",payload:"showRoleModal"})};return t.showRoleModal&&i&&!j&&Object(We.jsx)(oL,{showModal:t.showRoleModal,handleClose:f,setConfirmation:p})||t.showRoleModal&&Object(We.jsxs)(Zg,{closeOnBackdropClick:!0,width:450,height:250,handleClose:f,open:!0,children:[Object(We.jsxs)(_e,{className:o.modalTitle,children:["Change ",a.username,"'s role?"]}),Object(We.jsxs)(Ge,{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(We.jsx)(Ge,{className:o.info,children:"Do you wish to proceed?"}),Object(We.jsxs)("div",{className:o.footer,children:[m&&Object(We.jsx)(Fo,{children:m}),Object(We.jsx)(Tn,{className:o.submit,onClick:function(){d({variables:{confirmationCode:j,id:a.id,newRole:"superuser"===a.role?"user":"superuser"}})},children:"Confirm"})]})]})},dL=function(e){return"".concat("").concat(e)},uL=Object(p.a)(rL),mL=x()(nF||(nF=Object(l.a)(["\n mutation createRegisterToken($username: String!, $role: String!) {\n createRegisterToken(username: $username, role: $role) {\n token\n expire\n }\n }\n"]))),hL=xn.d().shape({username:xn.f().email("Username field should be in an email format!").required("Username field is required!"),role:xn.f().required("Role field is required!")}),bL={username:"",role:""},jL=[{code:"user",display:"Regular user"},{code:"superuser",display:"Superuser"}],pL=function(e,t,n){return e&&t?n?"Internal server error":e.username&&t.username?e.username:null:null},fL=function(e){var t=e.state,n=e.dispatch,a=uL(),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],j=function(){b(null),n({type:"close",payload:"showCreateUserModal"})},p=Object(u.b)(mL,{onCompleted:function(e){var t=e.createRegisterToken;b(dL("/register?t=".concat(t.token)))}}),f=Object(c.a)(p,2),g=f[0],O=f[1].error;return Object(We.jsxs)(We.Fragment,{children:[t.showCreateUserModal&&!h&&Object(We.jsx)(Zg,{closeOnBackdropClick:!0,width:600,height:400,handleClose:j,open:!0,children:Object(We.jsx)(jn.d,{validationSchema:hL,initialValues:bL,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(We.jsxs)(jn.c,{id:"register-user-form",className:a.form,children:[Object(We.jsx)(qe,{className:a.modalTitle,children:"Create new user"}),Object(We.jsx)(jn.b,{component:Ua,name:"username",width:338,autoFocus:!0,label:"User login"}),Object(We.jsx)(Ve,{className:E()((t=r,n=i,Object(M.a)({},a.error,t.role&&n.role)),a.modalLabel2),children:"Role"}),Object(We.jsx)(jn.b,{component:Ha,name:"role",labelClassName:a.radioLabel,className:a.radioGroup,options:jL}),Object(We.jsxs)("div",{className:a.footer,children:[pL(r,i,O)&&Object(We.jsx)(Fo,{children:pL(r,i,O)}),Object(We.jsx)(Tn,{type:"submit",form:"register-user-form",className:a.submit,children:"Finish"})]})]})}})}),t.showCreateUserModal&&h&&Object(We.jsxs)(Zg,{closeOnBackdropClick:!0,width:500,height:200,handleClose:j,open:!0,children:[Object(We.jsxs)(_e,{className:a.modalTitle,children:["Creating ",l,"..."]}),Object(We.jsxs)(Ge,{className:a.info,children:["Safely share this link with ",l," to finish the registration process."]}),Object(We.jsx)("div",{className:a.addressWrapper,children:Object(We.jsx)(Qe,{className:a.address,children:Object(We.jsx)("strong",{children:Object(We.jsx)(Ej,{className:a.link,buttonClassname:a.copyToClipboard,wrapperClassname:a.linkWrapper,children:h})})})})]})]})},gL=x()(rF||(rF=Object(l.a)(["\n mutation enableUser($confirmationCode: String, $id: ID!) {\n enableUser(confirmationCode: $confirmationCode, id: $id) {\n id\n }\n }\n"]))),OL=x()(aF||(aF=Object(l.a)(["\n mutation disableUser($confirmationCode: String, $id: ID!) {\n disableUser(confirmationCode: $confirmationCode, id: $id) {\n id\n }\n }\n"]))),xL=Object(p.a)(rL),vL=function(e){var t=e.state,n=e.dispatch,a=e.user,i=e.requiresConfirmation,o=xL(),l=Object(u.b)(gL,{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)(OL,{onCompleted:function(){return y()},refetchQueries:function(){return["users"]}}),b=Object(c.a)(h,2),j=b[0],p=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)?j({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(We.jsx)(oL,{showModal:t.showEnableUserModal,handleClose:y,setConfirmation:x})||t.showEnableUserModal&&Object(We.jsxs)(Zg,{closeOnBackdropClick:!0,width:450,height:275,handleClose:y,open:!0,children:[!a.enabled&&Object(We.jsxs)(We.Fragment,{children:[Object(We.jsxs)(_e,{className:o.modalTitle,children:["Enable ",a.username,"?"]}),Object(We.jsxs)(Ge,{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(We.jsx)(Ge,{className:o.info,children:"Do you wish to proceed?"})]}),a.enabled&&Object(We.jsxs)(We.Fragment,{children:[Object(We.jsxs)(_e,{className:o.modalTitle,children:["Disable ",a.username,"?"]}),Object(We.jsxs)(Ge,{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(We.jsx)(Ge,{className:o.info,children:"Do you wish to proceed?"})]}),Object(We.jsxs)("div",{className:o.footer,children:[p&&Object(We.jsx)(Fo,{children:p}),m&&Object(We.jsx)(Fo,{children:m}),Object(We.jsx)(Tn,{className:o.submit,onClick:function(){return v()},children:"Confirm"})]})]})},yL=x()(iF||(iF=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"]))),wL=Object(p.a)(rL),CL=function(e){var t=e.state,n=e.dispatch,a=e.user,i=e.requiresConfirmation,o=wL(),l=Object(r.useState)(""),s=Object(c.a)(l,2),d=s[0],m=s[1],h=Object(u.b)(yL,{onCompleted:function(e){var t=e.createReset2FAToken;m(dL("/reset2fa?t=".concat(t.token)))}}),b=Object(c.a)(h,2),j=b[0],p=b[1],f=p.loading,g=p.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)&&j({variables:{confirmationCode:v,userID:null===a||void 0===a?void 0:a.id}})}),[v,j,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(We.jsx)(oL,{showModal:t.showReset2FAModal,handleClose:w,setConfirmation:y})||t.showReset2FAModal&&(v||!i)&&!f&&Object(We.jsxs)(Zg,{closeOnBackdropClick:!0,width:500,height:200,handleClose:w,open:!0,children:[Object(We.jsxs)(_e,{className:o.modalTitle,children:["Reset 2FA for ",a.username]}),Object(We.jsxs)(Ge,{className:o.info,children:["Safely share this link with ",a.username," for a two-factor authentication reset."]}),!g&&Object(We.jsx)("div",{className:o.addressWrapper,children:Object(We.jsx)(Qe,{className:o.address,children:Object(We.jsx)("strong",{children:Object(We.jsx)(Ej,{className:o.link,buttonClassname:o.copyToClipboard,wrapperClassname:o.linkWrapper,children:d})})})}),g&&Object(We.jsx)(Fo,{children:g})]})},kL=x()(oF||(oF=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"]))),SL=Object(p.a)(rL),NL=function(e){var t=e.state,n=e.dispatch,a=e.user,i=e.requiresConfirmation,o=SL(),l=Object(r.useState)(""),s=Object(c.a)(l,2),d=s[0],m=s[1],h=Object(u.b)(kL,{onCompleted:function(e){var t=e.createResetPasswordToken;m(dL("/resetpassword?t=".concat(t.token)))}}),b=Object(c.a)(h,2),j=b[0],p=b[1],f=p.loading,g=p.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)&&j({variables:{confirmationCode:v,userID:null===a||void 0===a?void 0:a.id}})}),[v,j,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(We.jsx)(oL,{showModal:t.showResetPasswordModal,handleClose:w,setConfirmation:y})||t.showResetPasswordModal&&(v||!i)&&!f&&Object(We.jsxs)(Zg,{closeOnBackdropClick:!0,width:500,height:180,handleClose:w,open:!0,children:[Object(We.jsxs)(_e,{className:o.modalTitle,children:["Reset password for ",a.username]}),Object(We.jsxs)(Ge,{className:o.info,children:["Safely share this link with ",a.username," for a password reset."]}),!g&&Object(We.jsx)("div",{className:o.addressWrapper,children:Object(We.jsx)(Qe,{className:o.address,children:Object(We.jsx)("strong",{children:Object(We.jsx)(Ej,{className:o.link,buttonClassname:o.copyToClipboard,wrapperClassname:o.linkWrapper,children:d})})})}),g&&Object(We.jsx)(Fo,{children:g})]})},IL=Object(p.a)(rL),EL=x()(cF||(cF=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"]))),FL={showCreateUserModal:!1,showResetPasswordModal:!1,showReset2FAModal:!1,showRoleModal:!1,showEnableUserModal:!1},LL=function(e,t){var n=t.type,r=t.payload;switch(n){case"close":return FL;case"open":return Object(s.a)(Object(s.a)({},FL),{},Object(M.a)({},r,!0));default:return FL}},PL=function(){var e=IL(),t=Object(r.useContext)(k).userData,n=Object(u.c)(EL).data,a=Object(r.useReducer)(LL,FL),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=[{header:"Login",width:257,textAlign:"left",size:"sm",view:function(n){return t.id===n.id?Object(We.jsxs)(We.Fragment,{children:[n.username,Object(We.jsx)(Sa.a,{size:"small",label:"You",className:e.chip})]}):n.username}},{header:"Role",width:105,textAlign:"center",size:"sm",view:function(e){switch(e.role){case"user":return"Regular";case"superuser":return"Superuser";default:return e.role}}},{header:"",width:80,textAlign:"center",size:"sm",view:function(e){return Object(We.jsx)(Ca,{disabled:t.id===e.id,checked:"superuser"===e.role,onClick:function(){h(e),l({type:"open",payload:"showRoleModal"})},value:"superuser"===e.role})}},{header:"",width:25,textAlign:"center",size:"sm",view:function(e){}},{header:"Actions",width:565,textAlign:"left",size:"sm",view:function(t){return Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(Sa.a,{size:"small",label:"Reset password",className:e.actionChip,onClick:function(){h(t),l({type:"open",payload:"showResetPasswordModal"})}}),Object(We.jsx)(Sa.a,{size:"small",label:"Reset 2FA",className:e.actionChip,onClick:function(){h(t),l({type:"open",payload:"showReset2FAModal"})}})]})}},{header:"Enabled",width:100,textAlign:"center",size:"sm",view:function(e){return Object(We.jsx)(Ca,{disabled:t.id===e.id,checked:e.enabled,onClick:function(){h(e),l({type:"open",payload:"showEnableUserModal"})},value:e.enabled})}}];return Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(Do,{title:"User Management"}),Object(We.jsx)(No.a,{marginBottom:3,marginTop:-5,className:e.tableWidth,display:"flex",justifyContent:"flex-end",children:Object(We.jsx)(or,{color:"primary",onClick:function(){l({type:"open",payload:"showCreateUserModal"})},children:"Add new user"})}),Object(We.jsx)(JO,{elements:b,data:T.a(["users"])(n)}),Object(We.jsx)(fL,{state:o,dispatch:l}),Object(We.jsx)(NL,{state:o,dispatch:l,user:m,requiresConfirmation:"superuser"===(null===m||void 0===m?void 0:m.role)}),Object(We.jsx)(CL,{state:o,dispatch:l,user:m,requiresConfirmation:"superuser"===(null===m||void 0===m?void 0:m.role)}),Object(We.jsx)(sL,{state:o,dispatch:l,user:m,requiresConfirmation:"superuser"===(null===m||void 0===m?void 0:m.role)}),Object(We.jsx)(vL,{state:o,dispatch:l,user:m,requiresConfirmation:"superuser"===(null===m||void 0===m?void 0:m.role)})]})},DL=x()(lF||(lF=Object(l.a)(["\n mutation Save($config: JSONObject, $accounts: JSONObject) {\n saveConfig(config: $config)\n saveAccounts(accounts: $accounts)\n }\n"]))),BL=x()(sF||(sF=Object(l.a)(["\n mutation Save($accounts: JSONObject) {\n saveAccounts(accounts: $accounts)\n }\n"]))),RL=x()(dF||(dF=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"]))),AL=function(e){var t,n,a,i=e.name,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],j=h[1],p=Object(r.useState)(!1),f=Object(c.a)(p,2),g=f[0],O=f[1],x=Object(u.c)(RL).data,v=Object(u.b)(DL,{onCompleted:function(){return O(!1)},refetchQueries:function(){return["getData"]}}),y=Object(c.a)(v,2),w=y[0],C=y[1].error,k=Object(u.b)(BL,{onCompleted:function(){return d(null)},refetchQueries:function(){return["getData"]}}),S=Object(c.a)(k,1)[0],N=function(e,t){var n=yl(i)(e);return w({variables:{config:n,accounts:t}})},I=(null===x||void 0===x?void 0:x.config)&&vl(i)(x.config),E=null===x||void 0===x?void 0:x.accountsConfig,F=null!==(t=null===x||void 0===x?void 0:x.cryptoCurrencies)&&void 0!==t?t:[],L=null!==(n=null===x||void 0===x?void 0:x.accounts)&&void 0!==n?n:[];return Object(We.jsxs)(We.Fragment,{children:[Object(We.jsx)(Do,{title:"Wallet Settings"}),Object(We.jsx)(jm,{name:"test",namespaces:B.a(T.a(["code"]))(F),data:I,error:null===C||void 0===C?void 0:C.message,stripeWhen:function(e){return!df.isValidSync(e)},enableEdit:!0,shouldOverrideEdit:function(e){var t=vl(e)(I);return!df.isValidSync(t)},editOverride:O,editWidth:174,save:N,validationSchema:df,elements:uf(F,E,(function(e,t,n){return t?!L[t]&&hg[t]?(d(hg[t]),void j((function(){return function(){return n(t)}}))):void n(t):n(t)}))}),g&&Object(We.jsx)(FC,{coin:Tr.a(z.a("code",g))(F),onClose:function(){return O(!1)},save:N,error:null===C||void 0===C?void 0:C.message,cryptoCurrencies:F,userAccounts:null===x||void 0===x||null===(a=x.config)||void 0===a?void 0:a.accounts,accounts:L,accountsConfig:E}),s&&Object(We.jsx)(Zg,{title:"Edit ".concat(s.name),width:478,handleClose:function(){return d(null)},open:!0,children:Object(We.jsx)(Df,{save:function(e){return S({variables:{accounts:Object(M.a)({},s.code,e)}}).then((function(e){return b(),j(null),e}))},elements:s.elements,validationSchema:s.validationSchema,value:L[s.code]})})]})},TL=function(){return[{key:"transactions",label:"Transactions",route:"/transactions",allowedRoles:[bO,jO],component:WE},{key:"maintenance",label:"Maintenance",route:"/maintenance",allowedRoles:[bO,jO],get component(){var e=this;return function(){return Object(We.jsx)(w.b,{to:e.children[0].route})}},children:[{key:"cash_cassettes",label:"Cash Cassettes",route:"/maintenance/cash-cassettes",allowedRoles:[bO,jO],component:VS},{key:"funding",label:"Funding",route:"/maintenance/funding",allowedRoles:[bO,jO],component:vw},{key:"logs",label:"Machine Logs",route:"/maintenance/logs",allowedRoles:[bO,jO],component:Kk},{key:"machine-status",label:"Machine Status",route:"/maintenance/machine-status",allowedRoles:[bO,jO],component:pN},{key:"server-logs",label:"Server",route:"/maintenance/server-logs",allowedRoles:[bO,jO],component:rE}]},{key:"settings",label:"Settings",route:"/settings",allowedRoles:[bO,jO],get component(){var e=this;return function(){return Object(We.jsx)(w.b,{to:e.children[0].route})}},children:[{key:hl,label:"Commissions",route:"/settings/commissions",allowedRoles:[bO,jO],component:iv},{key:ml,label:"Locales",route:"/settings/locale",allowedRoles:[bO,jO],component:RC},{key:ll,label:"Cash-out",route:"/settings/cash-out",allowedRoles:[bO,jO],component:Cx},{key:ul,label:"Notifications",route:"/settings/notifications",allowedRoles:[bO,jO],component:XN},{key:"services",label:"3rd party services",route:"/settings/3rd-party-services",allowedRoles:[bO,jO],component:NE},{key:sl,label:"Wallet",route:"/settings/wallet-settings",allowedRoles:[bO,jO],component:AL},{key:dl,label:"Operator Info",route:"/settings/operator-info",title:"Operator Information",allowedRoles:[bO,jO],get component(){var e=this;return function(){var t;return Object(We.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:[bO,jO],component:DI},{key:"receipt-printing",label:"Receipt",route:"/settings/operator-info/receipt-printing",allowedRoles:[bO,jO],component:TI},{key:"coin-atm-radar",label:"Coin ATM Radar",route:"/settings/operator-info/coin-atm-radar",allowedRoles:[bO,jO],component:SI},{key:"terms-conditions",label:"Terms & Conditions",route:"/settings/operator-info/terms-conditions",allowedRoles:[bO,jO],component:HI}]}]},{key:"compliance",label:"Compliance",route:"/compliance",allowedRoles:[bO,jO],get component(){var e=this;return function(){return Object(We.jsx)(w.b,{to:e.children[0].route})}},children:[{key:"triggers",label:"Triggers",route:"/compliance/triggers",allowedRoles:[bO,jO],component:nL},{key:"customers",label:"Customers",route:"/compliance/customers",allowedRoles:[bO,jO],component:iw},{key:"blacklist",label:"Blacklist",route:"/compliance/blacklist",allowedRoles:[bO,jO],component:sx},{key:"loyalty",label:"Loyalty",route:"/compliance/loyalty",title:"Loyalty Panel",allowedRoles:[bO,jO],get component(){var e=this;return function(){var t;return Object(We.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:[bO,jO],component:GC},{key:"promo-codes",label:"Promo Codes",route:"/compliance/loyalty/codes",allowedRoles:[bO,jO],component:ak}]},{key:"customer",route:"/compliance/customer/:id",allowedRoles:[bO,jO],component:zy}]},{key:"system",label:"System",route:"/system",allowedRoles:[jO],get component(){var e=this;return function(){return Object(We.jsx)(w.b,{to:e.children[0].route})}},children:[{key:"user-management",label:"User Management",route:"/system/user-management",allowedRoles:[jO],component:PL},{key:"session-management",label:"Session Management",route:"/system/session-management",allowedRoles:[jO],component:PE}]}]},WL=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}}},zL=(Object(p.a)(WL),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"}}}),ML=(Object(p.a)(zL),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]]}}}),$L=(Object(p.a)(ML),{borderBottom:"4px solid white",padding:0,paddingLeft:20,paddingRight:20}),qL=(Object(Na.a)({root:$L})(td.a),Object(Na.a)({root:Object(s.a)(Object(s.a)({},$L),{},{backgroundColor:"white"})})(td.a),Object(p.a)({wrapper:{flex:1,display:"flex",flexDirection:"column",height:"100%"}})),HL=TL(),VL=B.a(Ro.a(Ao.a("children"),R.a("children"))),UL=L.a(To.a,VL)(HL),YL=W.a(Ao.a("children"))(UL).concat(W.a(Ao.a("children"))(HL)),GL=L.a(To.a,VL)(UL),XL=Wo.a(GL,YL),_L=function(){var e=qL(),t=Object(w.h)(),n=Object(w.i)(),a=Object(r.useContext)(k),i=a.wizardTested,o=a.userData;if(!i&&!qo.a(n.pathname)(["/404","/register","/wizard","/login","/register","/resetpassword","/reset2fa"]))return t.push("/wizard"),null;var c=n.state?b.a:Bo.a,l=c===b.a?{direction:Ho.a(z.a("route",n.state.prev))(GL)>Ho.a(z.a("route",n.pathname))(GL)?"right":"left"}:{timeout:400};return Object(We.jsxs)(w.e,{children:[Object(We.jsx)(pO,{exact:!0,path:"/",children:Object(We.jsx)(w.b,{to:{pathname:"/dashboard"}})}),Object(We.jsx)(pO,{path:"/dashboard",children:Object(We.jsx)(c,Object(s.a)(Object(s.a)({className:e.wrapper},l),{},{in:!0,mountOnEnter:!0,unmountOnExit:!0,children:Object(We.jsx)("div",{className:e.wrapper,children:Object(We.jsx)(Ed,{})})}))}),Object(We.jsx)(pO,{path:"/machines",component:hp}),Object(We.jsx)(pO,{path:"/wizard",component:mO}),Object(We.jsx)(fO,{path:"/register",component:Sc}),Object(We.jsx)(fO,{path:"/login",restricted:!0,component:fc}),Object(We.jsx)(fO,{path:"/resetpassword",component:zc}),Object(We.jsx)(fO,{path:"/reset2fa",component:Pc}),(o?XL.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(We.jsx)(pO,{path:r,children:Object(We.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(We.jsx)("div",{className:e.wrapper,children:Object(We.jsx)(pO,{path:r,children:Object(We.jsx)(a,{name:i})},i)})}))},i)})),Object(We.jsx)(fO,{path:"/404"}),Object(We.jsx)(fO,{path:"*",children:Object(We.jsx)(w.b,{to:{pathname:"/404"}})})]})},ZL="100%",QL={"@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"}]}),{},(uF={"#root":{width:ZL,minHeight:ZL},".root-notifcenter-open":{overflowY:"auto",position:"absolute",top:0,bottom:0,left:0},".body-notifcenter-open":{overflow:"hidden"},html:{height:ZL},body:{width:he,display:"flex",minHeight:ZL,"@media screen and (min-width: 1200px)":{width:"auto"}}},Object(M.a)(uF,'a::-moz-focus-inner,\n \'input[type="submit"]::-moz-focus-inner,\n input[type="button"]::-moz-focus-inner',{border:0}),Object(M.a)(uF,'a::-moz-focus-inner,\n input[type="submit"]::-moz-focus-inner,\n input[type="button"]::-moz-focus-inner',{border:0}),Object(M.a)(uF,"a,\n a:visited,\n a:focus,\n a:active,\n a:hover",{outline:"0 none"}),Object(M.a)(uF,"button::-moz-focus-inner",{border:0}),Object(M.a)(uF,".ReactVirtualized__Grid__innerScrollContainer",{overflow:"inherit !important"}),uF))},KL=n(410),JL=Re.p,eP=Object(KL.a)({typography:{fontFamily:Ne,body1:Object(s.a)({},JL)},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}}}}}),tP=Object(v.b)({plugins:[Object(y.a)()].concat(Object(d.a)(Object(j.a)().plugins))}),nP="100%",rP="column",aP=Object(p.a)(Object(s.a)(Object(s.a)({},QL),{},{root:{backgroundColor:re,width:nP,minHeight:nP,display:"flex",flexDirection:rP},wrapper:{width:he,height:nP,margin:"0 auto",flex:1,display:"flex",flexDirection:rP},grid:{flex:1,height:"100%"},contentWithSidebar:{flex:1,marginLeft:48,paddingTop:15},contentWithoutSidebar:{width:he}})),iP=x()(mF||(mF=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"]))),oP=function(){var e=aP(),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)(iP,{onCompleted:function(e){!o&&(null===e||void 0===e?void 0:e.userData)&&c(e.userData)}}).loading,s=t.pathname,d=function(e){return zo.a((function(t){return t.route===e}))(L.a(To.a,B.a(R.a("children")),W.a(Ao.a("children")))(UL))}(s),m=d?function(e){return Tr.a(z.a("route",Mo.a(1,$o.a((function(e){return"/"!==e}),e))))(XL)}(s):{},j="/404"===t.pathname,p=d?e.contentWithSidebar:e.contentWithoutSidebar;return Object(We.jsxs)("div",{className:e.root,children:[!j&&i&&o&&Object(We.jsx)(So,{tree:HL,user:o}),Object(We.jsxs)("main",{className:e.wrapper,children:[d&&!j&&i&&Object(We.jsx)(b.a,{direction:"left",in:!0,mountOnEnter:!0,unmountOnExit:!0,children:Object(We.jsx)("div",{children:Object(We.jsx)(Do,{title:m.title})})}),Object(We.jsxs)(h.a,{container:!0,className:e.grid,children:[d&&!j&&i&&Object(We.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(We.jsx)("div",{className:p,children:!l&&Object(We.jsx)(_L,{})})]})]})]})},cP=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(We.jsx)(k.Provider,{value:{wizardTested:n,setWizardTested:a,userData:l,setUserData:d,setRole:function(e){l&&l.role!==e&&d(Object(s.a)(Object(s.a)({},l),{},{role:e}))}},children:Object(We.jsx)(C.a,{children:Object(We.jsx)(mj,{children:Object(We.jsx)(f.b,{jss:tP,children:Object(We.jsxs)(g.a,{theme:eP,children:[Object(We.jsx)(m.a,{}),Object(We.jsx)(oP,{})]})})})})})};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(We.jsx)(a.a.StrictMode,{children:Object(We.jsx)(cP,{})}),document.getElementById("root"))})),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then((function(e){e.unregister()}))}},[[817,1,2]]]);
|
|
//# sourceMappingURL=main.2eed1cc4.chunk.js.map
|