2 lines
No EOL
780 KiB
JavaScript
2 lines
No EOL
780 KiB
JavaScript
(this["webpackJsonplamassu-admin"]=this["webpackJsonplamassu-admin"]||[]).push([[0],{625:function(e,t){},628:function(e,t){},629:function(e,t){},651:function(e,t){},653:function(e,t){},661:function(e,t){},663:function(e,t){},783:function(e,t,n){"use strict";n.r(t);var a=n(1),r=n.n(a),i=n(44),o=n.n(i),l=n(2),c=n(9),s=n(6),d=n(47),u=n(8),m=n(920),h=n(824),p=n(318),b=n(462),f=n(331),j=n(823),g=n(906),O=n(10),x=n.n(O),v=n(70),y=n(412),w=n(149),C=n(51),k=r.a.createContext(),E=n(830),N=n(829),S=n(7),I=n.n(S),F=n(844),L=n(421),P=n(443),D=n(433),R=n(89),B=n(424),T=n(826),A=n(178),M=n(273),W=n(827),z=n(5),q=n(20),$="#5f668a",H="#44e188",V="#ecfbef",U="#3fd07e",G="#ebefff",X="#dbdfed",_="#16d6d3",Z="#5a67ff",K="#ffffff",Q="#ff584a",Y="#ffeceb",J="#1b2559",ee="#48f694",te=H,ne=U,ae="#fafbff",re=G,ie=X,oe="#dddddd",le="#f2f2f2",ce=J,se=$,de="#72799d",ue=$,me=Q,he=1200,pe=ee,be="Mont",fe="MuseoSans",je=24,ge=20,Oe=16,xe=14,ve=13;var ye=ve,we=xe,Ce=Oe,ke=je,Ee=500,Ne=fe,Se=32,Ie=48;var Fe=2*Se,Le=J,Pe=Y,De=V,Re={lineHeight:"120%",color:ce},Be={h1:{extend:Re,fontSize:je,fontFamily:be,fontWeight:900},h2:{extend:Re,fontSize:ge,fontFamily:be,fontWeight:900},h3:{extend:Re,fontSize:xe,fontFamily:be,fontWeight:900},h4:{extend:Re,fontSize:xe,fontFamily:be,fontWeight:700},h5:{extend:Re,fontSize:Oe,fontFamily:be,fontWeight:700},p:{extend:Re,fontSize:xe,fontFamily:fe,fontWeight:500},tl1:{extend:Re,fontSize:ge,fontFamily:fe,fontWeight:700},tl2:{extend:Re,fontSize:xe,fontFamily:fe,fontWeight:700},info1:{extend:Re,fontSize:je,fontFamily:fe,fontWeight:700},info2:{extend:Re,fontSize:Oe,fontFamily:fe,fontWeight:700},info3:{extend:Re,fontSize:Oe,fontFamily:fe,fontWeight:500},mono:{extend:Re,fontSize:xe,fontFamily:"BPmono",fontWeight:500},monoBold:{fontWeight:700},monoSmall:{fontSize:ve},inputFont:{fontSize:ge,fontFamily:fe,fontWeight:500,lineHeight:"110%",color:ce},regularLabel:{fontSize:xe,fontFamily:fe,fontWeight:500,lineHeight:"110%"},label1:{fontSize:ve,fontFamily:fe,fontWeight:500,color:ce},label2:{fontSize:ve,fontFamily:fe,fontWeight:700,color:ce},label3:{fontSize:xe,fontFamily:fe,fontWeight:500,color:ce},confirmationCode:{extend:Re,fontSize:35,fontFamily:be,fontWeight:900},inline:{display:"inline"},noMargin:{margin:0}},Te=function(e,t,n){return{backgroundColor:e,"&:hover":{backgroundColor:t},"&:active":{backgroundColor:n}}},Ae={actionButton:{extend:Be.p,cursor:"pointer",border:"none",height:28,outline:0,borderRadius:6,padding:"0 8px",display:"flex",alignItems:"center"},primary:{extend:Te(re,ie,se),"&:active":{color:K,"& $actionButtonIcon":{display:"none"},"& $actionButtonIconActive":{display:"flex"}},"& $actionButtonIconActive":{display:"none"}},secondary:{extend:Te(se,de,"#525772"),color:K,"&:active":{"& $actionButtonIcon":{display:"flex"},"& $actionButtonIconActive":{display:"none"}},"& $actionButtonIcon":{display:"none"},"& $actionButtonIconActive":{display:"flex"}},spring:{extend:Te(te,ee,ne),color:K,"&:active":{"& $actionButtonIcon":{display:"flex"},"& $actionButtonIconActive":{display:"none"}},"& $actionButtonIcon":{display:"none"},"& $actionButtonIconActive":{display:"flex"}},tomato:{extend:Te("#E45043",me,"#CE463A"),color:K,"&:active":{"& $actionButtonIcon":{display:"flex"},"& $actionButtonIconActive":{display:"none"}},"& $actionButtonIcon":{display:"none"},"& $actionButtonIconActive":{display:"flex"}},actionButtonIcon:{display:"flex",paddingRight:7,"@global":{svg:{width:14,height:14}}},actionButtonIconActive:{}},Me=n(0),We=Object(f.a)(Ae),ze=Object(a.memo)((function(e){var t,n=e.className,a=e.Icon,r=e.InverseIcon,i=e.color,o=e.children,l=Object(q.a)(e,["className","Icon","InverseIcon","color","children"]),c=We(),d=(t={},Object(z.a)(t,c.actionButton,!0),Object(z.a)(t,c.primary,"primary"===i),Object(z.a)(t,c.secondary,"secondary"===i),Object(z.a)(t,c.spring,"spring"===i),Object(z.a)(t,c.tomato,"tomato"===i),t);return Object(Me.jsxs)("button",Object(s.a)(Object(s.a)({className:I()(d,n)},l),{},{children:[a&&Object(Me.jsx)("div",{className:c.actionButtonIcon,children:Object(Me.jsx)(a,{})}),r&&Object(Me.jsx)("div",{className:I()(c.actionButtonIcon,c.actionButtonIconActive),children:Object(Me.jsx)(r,{})}),o&&Object(Me.jsx)("div",{children:o})]}))})),qe=Object(f.a)(Be);function $e(e){var t,n=e.children,a=e.noMargin,r=e.className,i=Object(q.a)(e,["children","noMargin","className"]),o=qe(),l=(t={},Object(z.a)(t,o.h1,!0),Object(z.a)(t,o.noMargin,a),Object(z.a)(t,r,!!r),t);return Object(Me.jsx)("h1",Object(s.a)(Object(s.a)({className:I()(l)},i),{},{children:n}))}function He(e){var t,n=e.children,a=e.noMargin,r=e.className,i=Object(q.a)(e,["children","noMargin","className"]),o=qe(),l=(t={},Object(z.a)(t,o.h2,!0),Object(z.a)(t,o.noMargin,a),Object(z.a)(t,r,!!r),t);return Object(Me.jsx)("h2",Object(s.a)(Object(s.a)({className:I()(l)},i),{},{children:n}))}function Ve(e){var t,n=e.children,a=e.noMargin,r=e.className,i=Object(q.a)(e,["children","noMargin","className"]),o=qe(),l=(t={},Object(z.a)(t,o.h3,!0),Object(z.a)(t,o.noMargin,a),Object(z.a)(t,r,!!r),t);return Object(Me.jsx)("h3",Object(s.a)(Object(s.a)({className:I()(l)},i),{},{children:n}))}function Ue(e){var t,n=e.children,a=e.noMargin,r=e.className,i=Object(q.a)(e,["children","noMargin","className"]),o=qe(),l=(t={},Object(z.a)(t,o.h4,!0),Object(z.a)(t,o.noMargin,a),Object(z.a)(t,r,!!r),t);return Object(Me.jsx)("h4",Object(s.a)(Object(s.a)({className:I()(l)},i),{},{children:n}))}function Ge(e){var t,n=e.children,a=e.noMargin,r=e.className,i=Object(q.a)(e,["children","noMargin","className"]),o=qe(),l=(t={},Object(z.a)(t,o.h5,!0),Object(z.a)(t,o.noMargin,a),Object(z.a)(t,r,!!r),t);return Object(Me.jsx)("h5",Object(s.a)(Object(s.a)({className:I()(l)},i),{},{children:n}))}var Xe=at("p"),_e=at("info1"),Ze=at("info2"),Ke=at("info3"),Qe=at("mono"),Ye=at("tl1"),Je=at("tl2"),et=at("label1"),tt=at("label2"),nt=at("label3");function at(e){return function(t){var n,a=t.inline,r=t.noMargin,i=t.className,o=t.children,l=Object(q.a)(t,["inline","noMargin","className","children"]),c=qe(),d=(n={},Object(z.a)(n,i,!!i),Object(z.a)(n,c[e],e),Object(z.a)(n,c.inline,a),Object(z.a)(n,c.noMargin,r),n);return Object(Me.jsx)("p",Object(s.a)(Object(s.a)({className:I()(d)},l),{},{children:o}))}}function rt(){return(rt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function it(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var ot=a.createElement("desc",null,"Created with Sketch."),lt=a.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"nav-/-primary-/-1440",transform:"translate(-1295.000000, -19.000000)",stroke:"#1B2559",strokeWidth:2},a.createElement("g",{id:"icon/menu/notification",transform:"translate(1296.000000, 20.000000)"},a.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"}),a.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 ct(e,t){var n=e.title,r=e.titleId,i=it(e,["title","titleId"]);return a.createElement("svg",rt({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":r},i),n?a.createElement("title",{id:r},n):null,ot,lt)}var st=a.forwardRef(ct);n.p;function dt(){return(dt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function ut(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var mt=a.createElement("desc",null,"Created with Sketch."),ht=a.createElement("g",{id:"icon/stage/spring/empty",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.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 pt(e,t){var n=e.title,r=e.titleId,i=ut(e,["title","titleId"]);return a.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":r},i),n?a.createElement("title",{id:r},n):null,mt,ht)}var bt=a.forwardRef(pt);n.p;function ft(){return(ft=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function jt(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var gt=a.createElement("desc",null,"Created with Sketch."),Ot=a.createElement("g",{id:"icon/stage/zodiac/empty",stroke:"none",strokeWidth:2,fill:"none",fillRule:"evenodd"},a.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,r=e.titleId,i=jt(e,["title","titleId"]);return a.createElement("svg",ft({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":r},i),n?a.createElement("title",{id:r},n):null,gt,Ot)}var vt=a.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 a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function wt(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Ct=a.createElement("desc",null,"Created with Sketch."),kt=a.createElement("g",{id:"icon/stage/zodiac/full",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("circle",{id:"Oval-2-Copy",fill:"#1B2559",cx:9,cy:9,r:8}),a.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 Et(e,t){var n=e.title,r=e.titleId,i=wt(e,["title","titleId"]);return a.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":r},i),n?a.createElement("title",{id:r},n):null,Ct,kt)}var Nt=a.forwardRef(Et),St=(n.p,{background:{position:"absolute",width:"100vw",height:"100vh",left:0,top:0,zIndex:-1,backgroundColor:K,boxShadow:"0 0 14px 0 rgba(0, 0, 0, 0.24)"},container:{left:-200,top:-42,backgroundColor:K,height:"110vh"},header:{display:"flex",justifyContent:"space-between"},headerText:{marginTop:20,marginLeft:24},actionButtons:{display:"flex",marginLeft:16,height:0},notificationIcon:function(e){var t=e.buttonCoords,n=e.xOffset;return{position:"absolute",top:t?t.y-1:0,left:t?t.x-n:0,cursor:"pointer",background:"transparent",boxShadow:"0px 0px 0px transparent",border:"0px solid transparent",textShadow:"0px 0px 0px transparent",outline:"none"}},clearAllButton:{marginTop:-16,marginLeft:8,backgroundColor:G},notificationsList:{width:440,height:"90vh",maxHeight:"100vh",marginTop:24,marginLeft:0,marginRight:-50,overflowY:"auto",overflowX:"hidden",backgroundColor:K,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",$]],borderRadius:"50%",cursor:"pointer",zIndex:1},notificationTitle:{margin:0,color:$},notificationBody:{margin:0},notificationSubtitle:{margin:0,marginBottom:8,color:$},stripes:{position:"absolute",height:"100%",top:"0px",opacity:"60%"},hasUnread:{position:"absolute",top:0,left:16,width:"9px",height:"9px",backgroundColor:ee,borderRadius:"50%"}}),It=n(416),Ft=n.n(It);function Lt(){return(Lt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Pt(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Dt=a.createElement("g",{id:"\\u21B3-notification-center",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"notification-center_v01a#2-(open)",transform:"translate(-1023.000000, -459.000000)",stroke:"#1B2559"},a.createElement("g",{id:"Group-5",transform:"translate(1000.000000, 0.000000)"},a.createElement("g",{id:"icon/sf-small/wrench",transform:"translate(24.000000, 460.000000)"},a.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 Rt(e,t){var n=e.title,r=e.titleId,i=Pt(e,["title","titleId"]);return a.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":r},i),n?a.createElement("title",{id:r},n):null,Dt)}var Bt=a.forwardRef(Rt);n.p;function Tt(){return(Tt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function At(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Mt=a.createElement("g",{id:"\\u21B3-notification-center",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"notification-center_v01a#1-(marked-one-as-read)",transform:"translate(-1023.000000, -123.000000)",stroke:"#1B2559"},a.createElement("g",{id:"Group-5",transform:"translate(1000.000000, 0.000000)"},a.createElement("g",{id:"Group-4",transform:"translate(24.000000, 124.000000)"},a.createElement("g",{id:"Group-3"},a.createElement("line",{x1:0,y1:4,x2:16,y2:4,id:"Path-2"}),a.createElement("polyline",{id:"Path-3",points:"12 0 16 4 12 8"})),a.createElement("g",{id:"Group-2",transform:"translate(8.000000, 12.000000) scale(-1, 1) translate(-8.000000, -12.000000) translate(0.000000, 8.000000)"},a.createElement("line",{x1:0,y1:4,x2:16,y2:4,id:"Path-2-Copy"}),a.createElement("polyline",{id:"Path-3-Copy",points:"12 0 16 4 12 8"}))))));function Wt(e,t){var n=e.title,r=e.titleId,i=At(e,["title","titleId"]);return a.createElement("svg",Tt({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":r},i),n?a.createElement("title",{id:r},n):null,Mt)}var zt=a.forwardRef(Wt);n.p;function qt(){return(qt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function $t(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Ht=a.createElement("defs",null,a.createElement("pattern",{id:"pattern_68JiZ",patternUnits:"userSpaceOnUse",width:5.5,height:5.5,patternTransform:"rotate(45)"},a.createElement("line",{x1:0,y:0,x2:0,y2:5.5,stroke:"#DBDFED",strokeWidth:3}))),Vt=a.createElement("rect",{width:"100%",height:"100%",fill:"url(#pattern_68JiZ)",opacity:1});function Ut(e,t){var n=e.title,r=e.titleId,i=$t(e,["title","titleId"]);return a.createElement("svg",qt({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"36px",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,Ht,"{' '}\n ",Vt)}var Gt=a.forwardRef(Ut);n.p;function Xt(){return(Xt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function _t(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Zt=a.createElement("desc",null,"Created with Sketch."),Kt=a.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"icon/warning-icon/tomato"},a.createElement("rect",{id:"Rectangle",stroke:"#FF584A",strokeWidth:2,x:1,y:1,width:22,height:22,rx:11}),a.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,r=e.titleId,i=_t(e,["title","titleId"]);return a.createElement("svg",Xt({width:"24px",height:"24px",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,Zt,Kt)}var Yt,Jt,en,tn=a.forwardRef(Qt),nn=(n.p,Object(f.a)(St)),an={transaction:{display:"Transactions",icon:Object(Me.jsx)(zt,{})},highValueTransaction:{display:"Transactions",icon:Object(Me.jsx)(zt,{})},fiatBalance:{display:"Maintenance",icon:Object(Me.jsx)(Bt,{})},cryptoBalance:{display:"Maintenance",icon:Object(Me.jsx)(Bt,{})},compliance:{display:"Compliance",icon:Object(Me.jsx)(tn,{})},error:{display:"Error",icon:Object(Me.jsx)(tn,{})}},rn=function(e){var t,n,a,r=e.id,i=e.type,o=(e.detail,e.message),l=e.deviceName,c=e.created,s=e.read,d=e.valid,u=e.toggleClear,m=nn(),p=null!==(t=A.a([i,"display"])(an))&&void 0!==t?t:null,b=null!==(n=A.a([i,"icon"])(an))&&void 0!==n?n:Object(Me.jsx)(Bt,{}),f=Ft()((new Date).getTime()-new Date(c).getTime(),{compact:!0,verbose:!0}),j=p&&l?"".concat(p," - ").concat(l):"".concat(!p&&l?l:p),g=(a={},Object(z.a)(a,m.readIcon,s),Object(z.a)(a,m.unreadIcon,!s),a);return Object(Me.jsxs)(h.a,{container:!0,className:I()(m.notificationRow,!s&&d?m.unread:""),children:[Object(Me.jsx)(h.a,{item:!0,xs:2,className:m.notificationRowIcon,children:b}),Object(Me.jsxs)(h.a,{item:!0,container:!0,xs:7,direction:"row",children:[Object(Me.jsx)(h.a,{item:!0,xs:12,children:Object(Me.jsx)(tt,{className:m.notificationTitle,children:j})}),Object(Me.jsx)(h.a,{item:!0,xs:12,children:Object(Me.jsx)(Je,{className:m.notificationBody,children:o})}),Object(Me.jsx)(h.a,{item:!0,xs:12,children:Object(Me.jsx)(et,{className:m.notificationSubtitle,children:f})})]}),Object(Me.jsx)(h.a,{item:!0,xs:3,style:{zIndex:1},children:Object(Me.jsx)("div",{onClick:function(){return u(r)},className:I()(g)})}),!d&&Object(Me.jsx)(Gt,{className:m.stripes})]})},on=Object(f.a)(St),ln=x()(Yt||(Yt=Object(c.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"]))),cn=x()(Jt||(Jt=Object(c.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(c.a)(["\n mutation clearAllNotifications {\n clearAllNotifications {\n id\n }\n }\n"]))),dn=function(e){var t,n,r=e.close,i=e.hasUnreadProp,o=e.buttonCoords,c=e.popperRef,s=e.refetchHasUnreadHeader,d=Object(u.c)(ln,{pollInterval:6e4}),m=d.data,h=d.loading,p=Object(a.useState)(300),b=Object(l.a)(p,2),f=b[0],j=b[1],g=Object(a.useState)(!1),O=Object(l.a)(g,2),x=O[0],v=O[1],y=on({buttonCoords:o,xOffset:f}),w=L.a(R.a(B.a("name")),T.a(B.a("deviceId")))(null!==(t=A.a(["machines"])(m))&&void 0!==t?t:[]),C=null!==(n=A.a(["notifications"])(m))&&void 0!==n?n:[],k=Object(a.useState)(i),E=Object(l.a)(k,2),N=E[0],S=E[1],I=Object(u.b)(cn,{onError:function(){return console.error("Error while clearing notification")},refetchQueries:function(){return["getNotifications"]}}),F=Object(l.a)(I,1)[0],P=Object(u.b)(sn,{onError:function(){return console.error("Error while clearing all notifications")},refetchQueries:function(){return["getNotifications"]}}),D=Object(l.a)(P,1)[0];Object(a.useEffect)((function(){j(c.current.getBoundingClientRect().x),m&&m.hasUnreadNotifications!==N&&(s(),S(!N))}),[c,m,N,s]);return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)("div",{className:y.container,children:[Object(Me.jsxs)("div",{className:y.header,children:[Object(Me.jsx)(Ge,{className:y.headerText,children:"Notifications"}),Object(Me.jsxs)("button",{onClick:r,className:y.notificationIcon,children:[Object(Me.jsx)(st,{}),N&&Object(Me.jsx)("div",{className:y.hasUnread})]})]}),Object(Me.jsxs)("div",{className:y.actionButtons,children:[N&&Object(Me.jsx)(ze,{color:"primary",Icon:Nt,InverseIcon:bt,className:y.clearAllButton,onClick:function(){return v(!x)},children:x?"Show all":"Show unread"}),N&&Object(Me.jsx)(ze,{color:"primary",Icon:vt,InverseIcon:bt,className:y.clearAllButton,onClick:D,children:"Mark all as read"})]}),Object(Me.jsx)("div",{className:y.notificationsList,children:!h&&(x&&N?M.a(W.a("read",!1))(C):C).map((function(e){return Object(Me.jsx)(rn,{id:e.id,type:e.type,detail:e.detail,message:e.message,deviceName:w[e.detail.deviceId],created:e.created,read:e.read,valid:e.valid,toggleClear:function(){return F({variables:{id:e.id,read:!e.read}})}},e.id)}))})]}),Object(Me.jsx)("div",{className:y.background})]})},un=n(842),mn=n(843),hn=n(317),pn=n(247),bn=n(11),fn=n(140),jn=n.n(fn),gn=n(441),On=n(841),xn=n(4),vn=Object(f.a)({title:{marginTop:24,marginBottom:24}}),yn=Object(a.memo)((function(e){var t=e.children,n=vn();return Object(Me.jsx)($e,{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 a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Cn(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var kn=a.createElement("desc",null,"Created with Sketch."),En=a.createElement("g",{id:"icon/button/add/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.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"}),a.createElement("line",{x1:6,y1:3.69230769,x2:6,y2:8.30769231,id:"Stroke-3",stroke:"#1B2559"}),a.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,r=e.titleId,i=Cn(e,["title","titleId"]);return a.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":r},i),n?a.createElement("title",{id:r},n):null,kn,En)}var Sn=a.forwardRef(Nn),In=(n.p,{button:{extend:Be.p,border:"none",backgroundColor:G,cursor:"pointer",outline:0,display:"flex",justifyContent:"center",alignItems:"center",width:167,height:48,color:ce,"&:hover":{backgroundColor:X},"&:active":{backgroundColor:$,color:K,"& svg g *":{stroke:K}},"& svg":{marginRight:8}}}),Fn=Object(f.a)(In),Ln=Object(a.memo)((function(e){var t=e.className,n=e.children,a=Object(q.a)(e,["className","children"]),r=Fn();return Object(Me.jsxs)("button",Object(s.a)(Object(s.a)({className:I()(r.button,t)},a),{},{children:[Object(Me.jsx)(Sn,{}),n]}))})),Pn=Be.h1,Dn=Be.h3,Rn=function(e){switch(e){case"xl":return 61;case"sm":return 32;case"lg":default:return 40}},Bn={wrapper:function(e){var t=e.size,n=Rn(t);return{height:n+n/12/2}},button:function(e){var t=e.size,n=Rn(t),a="xl"===t?3:n/12;return{extend:"xl"===t?Pn:Dn,border:"none",color:K,cursor:"pointer",fontWeight:900,outline:0,backgroundColor:ee,"&:disabled":{backgroundColor:oe,boxShadow:"none","&:hover":{backgroundColor:oe,boxShadow:"none"},"&:active":{marginTop:0}},shadowSize:a,height:n,padding:"0 ".concat("xl"===t?20:n/2,"px"),borderRadius:n/4,boxShadow:"0 ".concat(a,"px ").concat(te),"&:hover":{backgroundColor:te,boxShadow:"0 ".concat(a,"px ").concat(ne)},"&:active":{marginTop:a/2,backgroundColor:te,boxShadow:"0 ".concat(a/2,"px ").concat(ne)}}}},Tn=Object(f.a)(Bn),An=Object(a.memo)((function(e){var t=e.size,n=void 0===t?"lg":t,a=e.children,r=e.className,i=e.buttonClassName,o=Object(q.a)(e,["size","children","className","buttonClassName"]),l=Tn({size:n});return Object(Me.jsx)("div",{className:I()(r,l.wrapper),children:Object(Me.jsx)("button",Object(s.a)(Object(s.a)({className:I()(i,l.button)},o),{},{children:a}))})})),Mn=function(e,t,n){return{backgroundColor:e,"&:hover":{backgroundColor:t},"&:active":{backgroundColor:n}}},Wn={baseButton:{extend:Mn(re,ie,se),cursor:"pointer",border:"none",outline:0,height:32,color:ce,"&:active":{color:K}},primary:{extend:Mn(re,ie,se),"&:active":{color:K,"& $buttonIcon":{display:"none"},"& $buttonIconActive":{display:"block"}},"& $buttonIconActive":{display:"none"}},secondary:{extend:Mn(se,de,K),color:K,"&:active":{color:ce,"& $buttonIcon":{display:"flex"},"& $buttonIconActive":{display:"none"}},"& $buttonIcon":{display:"none"},"& $buttonIconActive":{display:"flex"}}},zn=Wn.baseButton,qn=Wn.primary,$n={featureButton:{extend:zn,width:zn.height,borderRadius:zn.height/2,display:"flex",padding:0},primary:qn,buttonIcon:{margin:"auto","& svg":{width:16,height:16,overflow:"visible","& g":{strokeWidth:1.8}}},buttonIconActive:{}},Hn=Object(f.a)($n),Vn=Object(a.memo)((function(e){var t,n=e.className,a=e.Icon,r=e.InverseIcon,i=e.children,o=Object(q.a)(e,["className","Icon","InverseIcon","children"]),l=Hn(),c=(t={},Object(z.a)(t,l.featureButton,!0),Object(z.a)(t,l.primary,!0),t);return Object(Me.jsxs)("button",Object(s.a)(Object(s.a)({className:I()(c,n)},o),{},{children:[a&&Object(Me.jsx)("div",{className:l.buttonIcon,children:Object(Me.jsx)(a,{})}),r&&Object(Me.jsx)("div",{className:I()(l.buttonIcon,l.buttonIconActive),children:Object(Me.jsx)(r,{})}),i]}))})),Un=n(324),Gn=n(828),Xn=function(e){var t,n=e.children,r=e.bgColor,i=void 0===r?K:r,o=e.arrowSize,c=void 0===o?6:o,d=e.className,u=Object(q.a)(e,["children","bgColor","arrowSize","className"]),m=Object(a.useState)(null),h=Object(l.a)(m,2),p=h[0],b=h[1],j={popover:{zIndex:3e3,backgroundColor:i,borderRadius:4},arrow:{position:"absolute",fontSize:c,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*c,height:3*c,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*c,height:3*c,marginLeft:0,bottom:0,top:-(4*c+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(f.a)(j)(),O=(t={},Object(z.a)(t,g.arrow,!0),Object(z.a)(t,g.arrowBottom,"bottom"===u.placement),Object(z.a)(t,g.arrowTop,"top"===u.placement),Object(z.a)(t,g.arrowRight,"right"===u.placement),Object(z.a)(t,g.arrowLeft,"left"===u.placement),t),x=Gn.a(u.modifiers,{flip:{enabled:!1},preventOverflow:{enabled:!0,boundariesElement:"scrollParent"},offset:{enabled:!0,offset:"0, 10"},arrow:{enabled:!0,element:p},computeStyle:{gpuAcceleration:!1}});return Object(Me.jsx)(Me.Fragment,{children:Object(Me.jsx)(N.a,Object(s.a)(Object(s.a)({disablePortal:!1,modifiers:x,className:g.popover},u),{},{children:Object(Me.jsxs)(Un.a,{className:I()(g.root,d),children:[Object(Me.jsx)("span",{className:I()(O),ref:b}),n]})}))})},_n=Be.info2,Zn=function(e,t,n){return{backgroundColor:e,"&:hover":{backgroundColor:t},"&:active":{backgroundColor:n}}},Kn={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:Zn(re,ie,se)},open:{extend:Zn(se,se,se)},popoverContent:{extend:_n,padding:8,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:4,"& img":{maxHeight:145}}},Qn=Object(f.a)(Kn),Yn=Object(a.memo)((function(e){var t,n=e.name,r=e.className,i=e.Icon,o=e.InverseIcon,c=(e.popoverWidth,e.children),d=e.popoverClassname,u=Object(q.a)(e,["name","className","Icon","InverseIcon","popoverWidth","children","popoverClassname"]),m=Object(a.useState)(null),h=Object(l.a)(m,2),p=h[0],b=h[1],f=Qn(),j=Boolean(p),g=j?"simple-popper-".concat(n):void 0,O=(t={},Object(z.a)(t,f.idButton,!0),Object(z.a)(t,f.primary,!0),Object(z.a)(t,f.open,j),Object(z.a)(t,f.closed,!j),t),x=Object(z.a)({},f.buttonIcon,!0),v=function(){b(null)};return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(E.a,{onClickAway:v,children:Object(Me.jsxs)("button",Object(s.a)(Object(s.a)({"aria-describedby":g,onClick:function(e){b(p?null:e.currentTarget)},className:I()(O,r)},u),{},{children:[i&&!j&&Object(Me.jsx)("div",{className:I()(x),children:Object(Me.jsx)(i,{})}),o&&j&&Object(Me.jsx)("div",{className:I()(x),children:Object(Me.jsx)(o,{})})]}))}),Object(Me.jsx)(Xn,{className:d,id:g,open:j,anchorEl:p,onClose:v,arrowSize:3,placement:"top",children:Object(Me.jsx)("div",{className:f.popoverContent,children:Object(Me.jsx)("div",{children:c})})})]})})),Jn={label:function(e){var t=e.size;return{width:t,height:t}},root:{"& svg":{flex:1},"&:hover":{backgroundColor:"inherit"},"&:hover rect":{stroke:$},"&:hover polygon":{stroke:$},"&:hover path":{stroke:$}}},ea=Object(f.a)(Jn),ta=function(e){var t=e.size,n=e.children,a=e.onClick,r=Object(q.a)(e,["size","children","onClick"]),i=ea({size:t});return Object(Me.jsx)(hn.a,Object(s.a)(Object(s.a)({},r),{},{size:"small",classes:{root:i.root,label:i.label},disableRipple:!0,onClick:a,children:n}))},na=n(213),aa=function(e){return{boxShadow:"inset 0 -4px 0 0 ".concat(Object(na.fade)(e,.8)),"&:hover":{boxShadow:"none",backgroundColor:Object(na.fade)(e,.8)}}},ra={link:{extend:Be.h4,textDecoration:"none",border:"none",backgroundColor:"transparent",cursor:"pointer",padding:"0",height:"100%"},primary:{extend:aa(pe)},secondary:{extend:aa("#ff584a"),"&:hover":{color:K}},noColor:{extend:aa(K)},action:{extend:aa(pe),color:G}},ia=Object(f.a)(ra),oa=Object(a.memo)((function(e){var t,n=e.submit,a=e.className,r=e.children,i=e.color,o=void 0===i?"primary":i,l=Object(q.a)(e,["submit","className","children","color"]),c=ia(),d=(t={},Object(z.a)(t,c.link,!0),Object(z.a)(t,c.primary,"primary"===o),Object(z.a)(t,c.secondary,"secondary"===o),Object(z.a)(t,c.noColor,"noColor"===o),Object(z.a)(t,c.action,"action"===o),t);return Object(Me.jsx)("button",Object(s.a)(Object(s.a)({type:n?"submit":"button",className:I()(d,a)},l),{},{children:r}))})),la=Wn.baseButton,ca=Wn.primary,sa={button:{extend:la,borderRadius:la.height/2,outline:0,padding:"0 20px"},primary:ca,buttonIcon:{marginTop:4,marginRight:4,"& svg":{width:20,height:20,overflow:"visible"}},buttonIconActive:{}};Object(f.a)(sa);function da(){return(da=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function ua(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var ma=a.createElement("desc",null,"Created with Sketch."),ha=a.createElement("g",{id:"icon/button/cancel/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"Group-5",transform:"translate(1.000000, 1.000000)",stroke:"#FFFFFF"},a.createElement("line",{x1:10,y1:0,x2:0,y2:10,id:"Stroke-1"}),a.createElement("line",{x1:0,y1:0,x2:10,y2:10,id:"Stroke-3"})));function pa(e,t){var n=e.title,r=e.titleId,i=ua(e,["title","titleId"]);return a.createElement("svg",da({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":r},i),n?a.createElement("title",{id:r},n):null,ma,ha)}var ba=a.forwardRef(pa),fa=(n.p,Wn.baseButton),ja={button:{extend:fa,padding:0,color:K,borderRadius:fa.height/2},normalButton:{width:fa.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:K}},ga=Object(f.a)(ja),Oa=Object(a.memo)((function(e){var t,n=e.className,r=e.Icon,i=e.InverseIcon,o=e.toggle,c=e.forceDisable,s=void 0!==c&&c,d=e.children,u=Object(a.useState)(!1),m=Object(l.a)(u,2),h=m[0],p=m[1],b=!s&&h,f=ga(),j=(t={},Object(z.a)(t,f.button,!0),Object(z.a)(t,f.normalButton,!b),Object(z.a)(t,f.activeButton,b),t),g=Object(Me.jsx)(r,{className:f.buttonIcon}),O=Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(i,{className:I()(f.buttonIcon,f.buttonIconActiveLeft)}),Object(Me.jsx)(Ue,{className:f.white,children:d}),Object(Me.jsx)(ba,{className:I()(f.buttonIcon,f.buttonIconActiveRight)})]});return Object(Me.jsx)("button",{className:I()(j,n),onClick:function(){s=!1;var e=!b;o(e),p(e)},children:b?O:g})}));function xa(){return(xa=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function va(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var ya=a.createElement("desc",null,"Created with Sketch."),wa=a.createElement("g",{id:"icon/action/external-link/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.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"}),a.createElement("polyline",{id:"Stroke-3",stroke:"#FFFFFF",strokeWidth:2,points:"14.4443 1 20.0003 1 20.0003 6.556"}),a.createElement("line",{x1:10,y1:11,x2:20,y2:1,id:"Stroke-5",stroke:"#FFFFFF",strokeWidth:2}));function Ca(e,t){var n=e.title,r=e.titleId,i=va(e,["title","titleId"]);return a.createElement("svg",xa({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":r},i),n?a.createElement("title",{id:r},n):null,ya,wa)}var ka=a.forwardRef(Ca);n.p;function Ea(){return(Ea=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Na(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Sa=a.createElement("desc",null,"Created with Sketch."),Ia=a.createElement("g",{id:"icon/action/external-link/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"Group-7",transform:"translate(0.000000, 1.000000)",stroke:"#1B2559",strokeWidth:2},a.createElement("polyline",{id:"Stroke-1",points:"20 11.1113 20 20.0003 0 20.0003 0 0.0003 8.889 0.0003"}),a.createElement("polyline",{id:"Stroke-3",points:"14.4443 0 20.0003 0 20.0003 5.556"}),a.createElement("line",{x1:10,y1:10,x2:20,y2:0,id:"Stroke-5"})));function Fa(e,t){var n=e.title,r=e.titleId,i=Na(e,["title","titleId"]);return a.createElement("svg",Ea({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":r},i),n?a.createElement("title",{id:r},n):null,Sa,Ia)}var La=a.forwardRef(Fa),Pa=(n.p,Object(f.a)({actionButton:{marginBottom:32},actionButtonLink:{textDecoration:"none",color:J}})),Da=function(e){var t=e.link,n=e.label,a=Pa();return Object(Me.jsx)("a",{className:a.actionButtonLink,target:"_blank",rel:"noopener noreferrer",href:t,children:Object(Me.jsx)(ze,{className:a.actionButton,color:"primary",Icon:La,InverseIcon:ka,children:n})})},Ra=n(212),Ba=n(928),Ta=n(431),Aa=n(937),Ma=n(835),Wa=n(936),za=n(435),qa=n(836),$a=n(948),Ha=function(e){switch(e){case"sm":return{fontSize:we};case"lg":return{fontSize:ke,fontWeight:700};default:return{fontSize:Ce}}},Va={fontWeight:700},Ua={size:function(e){var t=e.size;return Object(s.a)({marginTop:"lg"===t?0:2},Ha(t))},bold:Va,root:function(e){return{width:e.width,"& input":{textAlign:e.textAlign}}},underline:{"&:before":{borderBottomColor:ee},"&:hover:not(.Mui-disabled)::before":{borderBottomColor:ee}}},Ga=Object(f.a)(Ua),Xa=Object(a.memo)((function(e){var t=e.name,n=e.isPasswordFilled,a=e.onChange,r=e.onBlur,i=e.value,o=e.error,l=(e.suffix,e.textAlign),c=e.width,d=e.size,u=e.bold,m=e.className,h=e.InputProps,p=Object(q.a)(e,["name","isPasswordFilled","onChange","onBlur","value","error","suffix","textAlign","width","size","bold","className","InputProps"]),b=Ga({textAlign:l,width:c,size:d}),f=!o&&!D.a(i)&&!Wa.a(i),j=n||f,g=Object(z.a)({},b.bold,u);return Object(Me.jsx)($a.a,Object(s.a)({id:t,onChange:a,onBlur:r,error:o,value:i,classes:{root:b.root},className:m,InputProps:Object(s.a)({className:I()(g),classes:{root:b.size,underline:j?b.underline:null}},h)},p))})),_a=function(e){e.optionsLimit;var t=e.limit,n=e.options,a=e.label,r=e.valueProp,i=e.multiple,o=e.onChange,l=e.labelProp,c=(e.shouldStayOpen,e.value),d=e.error,u=e.fullWidth,m=e.textAlign,h=e.size,p=e.autoFocus,b=Object(q.a)(e,["optionsLimit","limit","options","label","valueProp","multiple","onChange","labelProp","shouldStayOpen","value","error","fullWidth","textAlign","size","autoFocus"]),f=function(e){return function(t){return Aa.a(W.a(r,t))(e)}},j=B.a(r),g=r?(i?R.a(f(n)):f(n))(c):c,O=function(){return D.a(g)?[]:i?g:[g]};return Object(Me.jsx)(Ba.a,Object(s.a)(Object(s.a)({options:n,multiple:i,value:g,onChange:function(e,t){if(!r)return o(e,t);var n=i?R.a(j)(t):j(t);o(e,n)},getOptionLabel:A.a([l]),forcePopupIcon:!1,filterOptions:function(e,n){var a=n.inputValue;return Ma.a(Wa.a(a)?O():[],function(e,t){return t?Object(Ta.a)(e,t,{keys:[r,l]}):e}(e,a)).slice(0,za.a(void 0)(t)&&Math.max(t,Wa.a(a)?O().length:0))},openOnFocus:!0,autoHighlight:!0,disableClearable:!0,ChipProps:{onDelete:null},clearOnEscape:!0,getOptionSelected:qa.a(r)},b),{},{renderInput:function(e){return Object(Me.jsx)(Xa,Object(s.a)(Object(s.a)({},e),{},{autoFocus:p,label:a,value:c,error:d,size:h,fullWidth:u,textAlign:m}))}}))},Za=n(929),Ka=n(438),Qa=n.n(Ka),Ya=n(437),Ja=n.n(Ya);function er(){return(er=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function tr(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var nr=a.createElement("desc",null,"Created with Sketch."),ar=a.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"icon/warning-icon/comet"},a.createElement("rect",{id:"Rectangle",stroke:"#5F668A",strokeWidth:2,x:1,y:1,width:22,height:22,rx:11}),a.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 rr(e,t){var n=e.title,r=e.titleId,i=tr(e,["title","titleId"]);return a.createElement("svg",er({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":r},i),n?a.createElement("title",{id:r},n):null,nr,ar)}var ir=a.forwardRef(rr),or=(n.p,Object(f.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"}})),lr=function(e){var t=e.name,n=e.onChange,a=e.value,r=e.settings,i=Object(q.a)(e,["name","onChange","value","settings"]),o=r.enabled,l=r.label,c=r.disabledMessage,d=or();return Object(Me.jsx)(Me.Fragment,{children:o?Object(Me.jsxs)("div",{className:d.checkBoxLabel,children:[Object(Me.jsx)(tt,{children:l}),Object(Me.jsx)(Za.a,Object(s.a)({id:t,classes:{root:d.root,checked:d.checked},onChange:n,value:a,checked:a,icon:Object(Me.jsx)(Ja.a,{style:{marginLeft:2,fontSize:Oe}}),checkedIcon:Object(Me.jsx)(Qa.a,{style:{fontSize:ge}}),disableRipple:!0},i))]}):Object(Me.jsxs)("div",{className:d.wrapper,children:[Object(Me.jsx)(ir,{}),Object(Me.jsx)(Ke,{className:d.message,children:c})]})})},cr=n(439),sr=n.n(cr),dr={input:{width:"3.5rem !important",height:"5rem",border:"2px solid",borderColor:G,borderRadius:"4px"},focus:{color:J,border:"2px solid",borderColor:J,borderRadius:"4px"},error:{borderColor:me},container:{justifyContent:"space-evenly"}},ur=Object(f.a)(dr),mr=Object(f.a)(Be),hr=function(e){var t=e.name,n=e.value,a=e.onChange,r=e.numInputs,i=e.error,o=e.inputStyle,l=e.containerStyle,c=Object(q.a)(e,["name","value","onChange","numInputs","error","inputStyle","containerStyle"]),d=ur(),u=mr();return Object(Me.jsx)(sr.a,Object(s.a)({id:t,value:n,onChange:a,numInputs:r,separator:Object(Me.jsx)("span",{children:" "}),containerStyle:I()(l,d.container),inputStyle:I()(o,d.input,u.confirmationCode),focusStyle:d.focus,errorStyle:d.error,hasErrored:i,isInputNum:!0},c))},pr=n(833),br=n(950),fr=n(837),jr=n(923),gr=function(e){var t=e.label,n=e.name,a=e.options,r=e.onChange,i=e.value,o=e.className;return Object(Me.jsxs)(pr.a,{className:I()(o),children:[Object(Me.jsx)(br.a,{children:t}),Object(Me.jsx)(jr.a,{autoWidth:!0,labelId:t,id:n,value:i,onChange:r,children:a.map((function(e,t){return Object(Me.jsx)(fr.a,{value:e.value,children:e.display},t)}))})]})},Or=n(440),xr=Object(a.memo)((function(e){var t=e.name,n=e.onChange,a=e.onBlur,r=e.value,i=e.error,o=e.suffix,l=e.textAlign,c=e.width,d=e.size,u=e.bold,m=e.className,h=e.decimalPlaces,p=(e.InputProps,Object(q.a)(e,["name","onChange","onBlur","value","error","suffix","textAlign","width","size","bold","className","decimalPlaces","InputProps"]));return Object(Me.jsx)(Or.a,Object(s.a)({name:t,onChange:n,onBlur:a,value:r,error:i,suffix:o,textAlign:l,width:c,size:d,bold:u,className:m,customInput:Xa,decimalScale:h,onValueChange:function(e){n({target:{id:t,value:e.floatValue}})}},p))})),vr=n(952),yr=n(838),wr=n(927),Cr={label:{height:16,lineHeight:"16px",margin:[[0,0,4,0]],paddingLeft:3},subtitle:{marginTop:-8,marginLeft:32,color:se}},kr=Object(f.a)(Cr),Er=function(e){var t=e.name,n=e.label,a=e.value,i=e.options,o=e.onChange,l=e.className,c=e.labelClassName,s=e.radioClassName,d=kr();return Object(Me.jsxs)(Me.Fragment,{children:[n&&Object(Me.jsx)(et,{className:d.label,children:n}),Object(Me.jsx)(vr.a,{name:t,value:a,onChange:o,className:I()(l),children:i.map((function(e,t){return Object(Me.jsx)(r.a.Fragment,{children:Object(Me.jsxs)("div",{children:[Object(Me.jsx)(yr.a,{disabled:e.disabled,value:e.code,control:Object(Me.jsx)(wr.a,{className:s}),label:e.display,className:I()(c)}),e.subtitle&&Object(Me.jsx)(et,{className:d.subtitle,children:e.subtitle})]})},t)}))})]})},Nr=Object(a.memo)((function(e){var t=e.value,n=e.onFocus,r=e.isPasswordFilled,i=e.onBlur,o=Object(q.a)(e,["value","onFocus","isPasswordFilled","onBlur"]),c=Object(a.useState)(!1),d=Object(l.a)(c,2),u=d[0],m=d[1];return Object(Me.jsx)(Xa,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:r,value:t,InputProps:{value:t},InputLabelProps:{shrink:r||t||u},placeholder:r?"\u26ac \u26ac \u26ac This field is set \u26ac \u26ac \u26ac":""}))})),Sr=n(839),Ir=Object(f.a)((function(e){return{root:{width:32,height:20,padding:0,margin:e.spacing(1)},switchBase:{padding:2,"&$disabled":{color:le,"& + $track":{backgroundColor:oe,opacity:1}},"&$checked":{transform:"translateX(58%)",color:e.palette.common.white,"&$disabled":{color:le},"& + $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:{}}})),Fr=Object(a.memo)((function(e){var t=Object.assign({},e),n=Ir();return Object(Me.jsx)(Sr.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))})),Lr=n(966),Pr=n(840),Dr={noTextTransform:{textTransform:"none"},flex:{display:"flex",alignItems:"center",justifyContent:"start",width:"90%",overflow:"hidden",maxHeight:80},buttonTextContent:{marginLeft:32,textTransform:"none",textAlign:"left"},button:{backgroundColor:ae,marginBottom:16},paragraph:{color:$,marginTop:-10}},Rr=Object(f.a)(Dr),Br=function(e){var t=e.name,n=e.orientation,a=void 0===n?"vertical":n,r=e.value,i=e.exclusive,o=void 0===i||i,l=e.onChange,c=e.size,s=void 0===c?"small":c,d=Object(q.a)(e,["name","orientation","value","exclusive","onChange","size"]),u=Rr();return Object(Me.jsx)(Lr.a,{size:s,name:t,orientation:a,value:r,exclusive:o,onChange:l,children:d.options.map((function(e){return Object(Me.jsx)(Pr.a,{className:u.button,value:e.value,"aria-label":e.value,children:Object(Me.jsxs)("div",{className:u.flex,children:[Object(Me.jsx)(e.icon,{}),Object(Me.jsxs)("div",{className:u.buttonTextContent,children:[Object(Me.jsx)(Ue,{children:e.title}),Object(Me.jsxs)(Xe,{className:u.paragraph,children:[" ",e.description]})]})]})},e.value)}))})},Tr=function(e){var t=e.options,n=e.onChange,r=Object(q.a)(e,["options","onChange"]),i=Object(a.useState)(!1),o=Object(l.a)(i,2),c=o[0],d=o[1],u=r.field,m=u.name,h=u.onBlur,p=u.value,b=r.form,f=b.touched,j=b.errors,g=b.setFieldValue,O=b.setFieldTouched,x=!(!f[m]||!j[m]),v=Object(bn.f)(),y=v.initialValues,w=v.values,C="Function"===Ra.a(t)?t(y,w):t,k=function(e){return g(m,e)},E=!!r.shouldStayOpen;return Object(Me.jsx)(_a,Object(s.a)({name:m,onChange:function(e,t){if(n)return n(p,t,k);g(m,t)},onBlur:function(e){m&&O(m,!0),h&&h(e)},value:p,error:x,open:c,options:C,onOpen:function(){if(!r.multiple)return d(!0);d((null===p||void 0===p?void 0:p.length)!==r.limit)},onClose:function(e,t){d(!(!E||"blur"===t))}},r))},Ar=n(951),Mr=n(24),Wr=Object(a.memo)((function(e){var t=e.classes,n=Object(q.a)(e,["classes"]);return Object(Me.jsx)(Ar.a,Object(s.a)({size:"small",classes:t},n))})),zr=Object(Mr.a)((function(e){return{root:{backgroundColor:re,borderRadius:4,margin:e.spacing(.5,.25),height:18},label:{fontSize:ye,color:ce,fontWeight:Ee,fontFamily:Ne,paddingRight:4,paddingLeft:4}}}))(Wr),qr={cashOut:{empty:Q,full:J},cashIn:{empty:J,full:Q}},$r=function(e){var t=e.cashOut,n=e.applyColorVariant,a=e.isLow;return qr[t?"cashOut":"cashIn"][n||!a?"full":"empty"]},Hr={cashbox:{borderColor:$r,backgroundColor:$r,height:118,width:function(e){var t=e.width;return null!==t&&void 0!==t?t:80},border:"2px solid",textAlign:"end",display:"inline-block"},fiatBalanceAlertCashbox:{borderColor:$r,backgroundColor:$r,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:$r,display:"inline-block",position:"absolute",margin:0,bottom:0,right:0}},fullPart:{backgroundColor:$r,"& > p":{color:"white",display:"inline"}}},Vr={row:{display:"flex"},innerRow:{display:"flex",justifyContent:"flex-start"},col2:{marginLeft:14},noMarginText:{marginTop:0,marginBottom:0},link:{marginTop:8},chip:{margin:[[0,0,0,7]]}},Ur=Object(f.a)(Hr),Gr=Object(f.a)(Vr),Xr=function(e){var t,n=e.percent,a=void 0===n?0:n,r=e.cashOut,i=void 0!==r&&r,o=e.width,l=e.className,c=e.emptyPartClassName,s=e.labelClassName,d=e.applyColorVariant,u=e.applyFiatBalanceAlertsStyling,m=e.omitInnerPercentage,h=e.isLow,p=Ur({percent:a,cashOut:i,width:o,applyColorVariant:d,isLow:h}),b=a<=51,f=(t={},Object(z.a)(t,p.fiatBalanceAlertCashbox,u),Object(z.a)(t,p.cashbox,!u),t);return Object(Me.jsxs)("div",{className:I()(l,f),children:[Object(Me.jsx)("div",{className:I()(c,p.emptyPart),children:!m&&b&&Object(Me.jsxs)(tt,{className:s,children:[a.toFixed(0),"%"]})}),Object(Me.jsx)("div",{className:p.fullPart,children:!m&&!b&&Object(Me.jsxs)(tt,{className:s,children:[a.toFixed(0),"%"]})})]})},_r=function(e){e.currency;var t=e.notes,n=(e.total,Gr());return Object(Me.jsx)(Me.Fragment,{children:Object(Me.jsx)("div",{className:n.row,children:Object(Me.jsxs)("div",{children:[Object(Me.jsx)("div",{className:n.innerRow,children:Object(Me.jsxs)(Ze,{className:n.noMarginText,children:[t," notes"]})}),Object(Me.jsx)("div",{className:n.innerRow})]})})})},Zr=function(e){var t=e.capacity,n=void 0===t?500:t,a=e.denomination,r=void 0===a?0:a,i=e.currency,o=e.notes,l=e.className,c=e.editingMode,s=void 0!==c&&c,d=e.threshold,u=e.width,m=100*o/n,h=m<d,p=Gr();return Object(Me.jsx)(Me.Fragment,{children:Object(Me.jsxs)("div",{className:p.row,children:[Object(Me.jsx)("div",{className:p.col,children:Object(Me.jsx)(Xr,{className:l,percent:m,cashOut:!0,isLow:h,width:u})}),!s&&Object(Me.jsxs)("div",{className:p.col2,children:[Object(Me.jsxs)("div",{className:p.innerRow,children:[Object(Me.jsx)(Ze,{className:p.noMarginText,children:o}),Object(Me.jsx)(zr,{className:p.chip,label:"".concat(r," ").concat(i.code)})]}),Object(Me.jsx)("div",{className:p.innerRow,children:Object(Me.jsxs)(et,{className:p.noMarginText,children:[o*r," ",i.code]})})]})]})})},Kr=Object(f.a)({flex:{display:"flex"},cashCassette:{height:36,marginRight:14}}),Qr=Object(a.memo)((function(e){var t=e.decimalPlaces,n=e.width,r=e.threshold,i=e.inputClassName,o=Object(q.a)(e,["decimalPlaces","width","threshold","inputClassName"]),c=Kr(),d=o.field,u=d.name,m=d.onChange,h=d.onBlur,p=d.value,b=o.form,f=b.touched,j=b.errors,g=Object(a.useState)(p),O=Object(l.a)(g,2),x=O[0],v=O[1],y=!(!f[u]||!j[u]);return Object(Me.jsxs)("div",{className:c.flex,children:[Object(Me.jsx)(Zr,{className:I()(c.cashCassette,i),notes:x,editingMode:!0,width:n,threshold:r}),Object(Me.jsx)(xr,Object(s.a)({name:u,onChange:function(e){return v(e.target.value),m(e)},onBlur:h,value:p,error:y,decimalPlaces:t},o))]})})),Yr=Object(a.memo)((function(e){var t=e.label,n=(e.textAlign,e.fullWidth,e.enabled),a=void 0===n||n,r=e.disabledMessage,i=void 0===r?"":r,o=Object(q.a)(e,["label","textAlign","fullWidth","enabled","disabledMessage"]),l=o.field,c=l.name,d=l.onChange,u=l.value,m={enabled:a,label:t,disabledMessage:i};return Object(Me.jsx)(lr,Object(s.a)({name:c,onChange:d,value:u,settings:m},o))})),Jr=Object(a.memo)((function(e){var t=e.label,n=Object(q.a)(e,["label"]),a=n.field,r=a.name,i=a.value,o=n.form.setFieldValue;return Object(Me.jsx)(gr,Object(s.a)({name:r,label:t,value:i,options:n.options,ariaLabel:r,onChange:function(e){o(r,e.target.value),n.resetError&&n.resetError()},className:n.className},n))})),ei=Object(a.memo)((function(e){var t=e.decimalPlaces,n=Object(q.a)(e,["decimalPlaces"]),a=n.field,r=a.name,i=a.onChange,o=a.onBlur,l=a.value,c=n.form,d=c.touched,u=c.errors,m=!(!d[r]||!u[r]);return Object(Me.jsx)(xr,Object(s.a)({name:r,onChange:i,onBlur:o,value:l,error:m,decimalPlaces:t},n))})),ti=Object(a.memo)((function(e){var t=e.label,n=Object(q.a)(e,["label"]),a=n.field,r=a.name,i=a.onChange,o=a.value;return Object(Me.jsx)(Er,Object(s.a)({name:r,label:t,value:o,options:n.options,ariaLabel:r,onChange:function(e){i(e),n.resetError&&n.resetError()},className:n.className},n))})),ni=Object(a.memo)((function(e){var t=e.isPasswordFilled,n=Object(q.a)(e,["isPasswordFilled"]),a=n.field,r=a.name,i=a.onChange,o=a.onBlur,l=a.value,c=n.form,d=c.touched,u=c.errors,m=!t&&!(!d[r]||!u[r]);return Object(Me.jsx)(Nr,Object(s.a)({name:r,isPasswordFilled:t,onChange:i,onBlur:o,value:l,error:m},n))})),ai=Object(a.memo)((function(e){var t=Object.assign({},e),n=t.field,a=n.name,r=n.onChange,i=n.onBlur,o=n.value,l=t.form,c=l.touched,d=l.errors,u=!(!c[a]||!d[a]);return Object(Me.jsx)(Xa,Object(s.a)({name:a,onChange:r,onBlur:i,value:o,error:u},t))}));function ri(){return(ri=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function ii(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var oi=a.createElement("desc",null,"Created with Sketch."),li=a.createElement("g",{id:"icon/stage/zodiac/complete",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.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}),a.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 ci(e,t){var n=e.title,r=e.titleId,i=ii(e,["title","titleId"]);return a.createElement("svg",ri({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":r},i),n?a.createElement("title",{id:r},n):null,oi,li)}var si=a.forwardRef(ci);n.p;function di(){return(di=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function ui(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var mi=a.createElement("desc",null,"Created with Sketch."),hi=a.createElement("g",{id:"icon/stage/zodiac/current",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("circle",{id:"Oval-2-Copy",fill:"#1B2559",cx:9,cy:9,r:4}),a.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 pi(e,t){var n=e.title,r=e.titleId,i=ui(e,["title","titleId"]);return a.createElement("svg",di({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":r},i),n?a.createElement("title",{id:r},n):null,mi,hi)}var bi,fi=a.forwardRef(pi),ji=(n.p,Be.tl2),gi=Be.p,Oi=G,xi={sidebar:Object(z.a)({display:"flex",backgroundColor:Oi,width:520,marginLeft:-300,boxShadow:"-500px 0px 0px 0px ".concat(Oi),borderRadius:"0 20px 0 0",alignItems:"flex-end",padding:24,flexDirection:"column"},(bi=1440,"@media only screen and (max-width: ".concat(bi,")")),{width:"auto",marginLeft:0,minWidth:250,boxShadow:"-200px 0px 0px 0px ".concat(Oi)}),link:{extend:gi,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:ji,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:gi,color:ue,marginRight:24},itemTextActive:{extend:ji,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]]}},vi=Object(f.a)(xi),yi=function(e){var t=e.data,n=e.displayName,a=e.isSelected,r=e.onClick,i=e.children,o=e.itemRender,l=e.loading,c=void 0!==l&&l,s=vi();return Object(Me.jsxs)("div",{className:s.sidebar,children:[c&&Object(Me.jsx)(Xe,{children:"Loading..."}),!c&&(null===t||void 0===t?void 0:t.map((function(e,t){var i;return Object(Me.jsx)("div",{className:I()((i={},Object(z.a)(i,s.activeLink,a(e)),Object(z.a)(i,s.customRenderActiveLink,o&&a(e)),Object(z.a)(i,s.customRenderLink,o),Object(z.a)(i,s.link,!0),i)),onClick:function(){return r(e)},children:o?o(e,a(e)):n(e)},t)}))),!c&&i]})},wi=function(e){var t,n,a=e.step,r=e.it,i=e.idx,o=e.steps,l=vi(),c=a===i,s=i<a,d=i>a;return Object(Me.jsxs)("div",{className:l.item,children:[Object(Me.jsx)("span",{className:I()((t={},Object(z.a)(t,l.itemText,!0),Object(z.a)(t,l.itemTextActive,c),Object(z.a)(t,l.itemTextPast,s),t)),children:r.label}),c&&Object(Me.jsx)(fi,{}),s&&Object(Me.jsx)(si,{}),d&&Object(Me.jsx)(vt,{}),i<o.length-1&&Object(Me.jsx)("div",{className:I()((n={},Object(z.a)(n,l.stepperPath,!0),Object(z.a)(n,l.stepperPast,s),n))})]})};function Ci(){return(Ci=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function ki(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Ei=a.createElement("g",{id:"icon/ID/photo/new/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.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 Ni(e,t){var n=e.title,r=e.titleId,i=ki(e,["title","titleId"]);return a.createElement("svg",Ci({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":r},i),void 0===n?a.createElement("title",{id:r},"icon/ID/photo/new/zodiac"):n?a.createElement("title",{id:r},n):null,Ei)}var Si=a.forwardRef(Ni);n.p;function Ii(){return(Ii=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Fi(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Li=a.createElement("style",{type:"text/css"},"\n\t.st0{fill-rule:evenodd;clip-rule:evenodd;fill:#1B2559;}\n"),Pi=a.createElement("desc",null,"Created with Sketch."),Di=a.createElement("g",{id:"color_x2F_primary_x2F_zodiac",transform:"translate(-0.000000, 0.000000)"},a.createElement("g",{id:"Mask"},a.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 Ri(e,t){var n=e.title,r=e.titleId,i=Fi(e,["title","titleId"]);return a.createElement("svg",Ii({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":r},i),n?a.createElement("title",{id:r},n):null,Li,Pi,Di)}var Bi=a.forwardRef(Ri);n.p;function Ti(){return(Ti=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Ai(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Mi=a.createElement("desc",null,"Created with Sketch."),Wi=a.createElement("g",{id:"icon/stage/spring/complete",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.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}),a.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 zi(e,t){var n=e.title,r=e.titleId,i=Ai(e,["title","titleId"]);return a.createElement("svg",Ti({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":r},i),n?a.createElement("title",{id:r},n):null,Mi,Wi)}var qi,$i,Hi=a.forwardRef(zi),Vi=(n.p,"100%"),Ui="column",Gi={dialog:{backgroundColor:ae,width:Vi,minHeight:Vi,display:"flex",flexDirection:Ui,padding:0},wrapper:{width:he,height:Vi,margin:"0 auto",flex:1,display:"flex",flexDirection:Ui},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:Be.p,color:ue,marginRight:24},itemTextActive:{extend:Be.tl2,color:J},itemTextPast:{color:J},stepperPath:{position:"absolute",height:25,width:1,border:[[1,"solid",ue]],right:8,top:18},stepperPast:{border:[[1,"solid",J]]},successMessageWrapper:{backgroundColor:V,display:"flex",flexDirection:"row",padding:"0px 10px",borderRadius:"8px"},successMessage:{color:H,margin:"8px 0px"},successMessageIcon:{marginRight:16,marginBottom:2,display:"flex",flexDirection:"col",alignItems:"center"},errorMessage:{color:me},qrCodeImageWrapper:{display:"flex",flexDirection:"column",backgroundColor:"white",border:"5px solid ".concat(J),padding:5,borderRadius:15},qrCodeScanMessage:{display:"flex",flexDirection:"row",alignItems:"center",margin:[[0,0,20,20]],"& > p":{marginLeft:10}}},Xi=x()(qi||(qi=Object(c.a)(["\n mutation createPairingTotem($name: String!) {\n createPairingTotem(name: $name)\n }\n"]))),_i=x()($i||($i=Object(c.a)(["\n {\n machines {\n name\n deviceId\n }\n }\n"]))),Zi=Object(f.a)(Gi),Ki=L.a(gn.a,On.a([],["machines"])),Qi={name:""},Yi=xn.f().shape({name:xn.h().required("Machine name is required.").max(50).test("unique-name","Machine name is already in use.",(function(e,t){return!t.options.context.machineNames.includes(e)}))}),Ji=[{label:"Machine name",component:function(e){var t=e.nextStep,n=e.classes,a=e.setQrCode,r=e.setName,i=Object(u.b)(Xi,{onCompleted:function(e){var n=e.createPairingTotem;a(n),t()},onError:function(e){return console.log(e)}}),o=Object(l.a)(i,1)[0],c=Object(u.c)(_i).data,s=R.a(B.a("name"),(null===c||void 0===c?void 0:c.machines)||{});return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Ze,{className:n.nameTitle,children:"Machine Name (ex: Coffee shop 01)"}),Object(Me.jsx)(bn.e,{validateOnBlur:!1,validateOnChange:!1,initialValues:Qi,validate:function(e){try{Yi.validateSync(e,{context:{machineNames:s}})}catch(t){return t}},onSubmit:function(e){var t=e.name;r(t),o({variables:{name:t}})},children:function(e){var t=e.errors;return Object(Me.jsxs)(bn.d,{className:n.form,children:[Object(Me.jsx)("div",{children:Object(Me.jsx)(bn.a,{name:"name",label:"Enter machine name",component:ai})}),t&&Object(Me.jsx)(Xe,{className:n.errorMessage,children:t.message}),Object(Me.jsx)("div",{className:n.button,children:Object(Me.jsx)(An,{type:"submit",children:"Submit"})})]})}})]})}},{label:"Scan QR code",component:function(e){var t,n=e.classes,r=e.qrCode,i=e.name,o=e.count,l=e.onPaired,c=Object(a.useRef)(null),s=Object(u.c)(_i,{pollInterval:1e4}).data;Object(a.useEffect)((function(){return function(){c.current&&clearTimeout(c.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=Ki(s)>o&&d;return m&&(c.current=setTimeout((function(){return l(d)}),2e3)),Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Ze,{className:n.qrTitle,children:"Scan QR code with your new cryptomat"}),Object(Me.jsxs)("div",{className:n.qrCodeWrapper,children:[Object(Me.jsxs)("div",{className:n.qrCodeImageWrapper,children:[Object(Me.jsx)(jn.a,{size:280,fgColor:J,includeMargin:!0,value:r,className:n.qrCodeBorder}),Object(Me.jsxs)("div",{className:n.qrCodeScanMessage,children:[Object(Me.jsx)(Si,{}),Object(Me.jsx)(Xe,{noMargin:!0,children:"Snap a picture and scan"})]})]}),Object(Me.jsxs)("div",{className:n.qrTextWrapper,children:[Object(Me.jsxs)("div",{className:n.qrTextInfoWrapper,children:[Object(Me.jsx)("div",{className:n.qrTextIcon,children:Object(Me.jsx)(ir,{})}),Object(Me.jsx)("div",{className:n.textWrapper,children:Object(Me.jsx)(Xe,{className:n.qrText,children:"To pair the machine you need scan the QR code with your machine. To do this either snap a picture of this QR code or download it through the button above and scan it with the scanning bay on your machine."})})]}),m&&Object(Me.jsxs)("div",{className:n.successMessageWrapper,children:[Object(Me.jsx)("div",{className:n.successMessageIcon,children:Object(Me.jsx)(Hi,{})}),Object(Me.jsx)(Ze,{className:n.successMessage,children:"Machine has been successfully paired!"})]})]})]})]})}}],eo=Object(a.memo)((function(e){var t=e.close,n=e.onPaired,r=Zi(),i=Object(u.c)(_i).data,o=Object(a.useState)(""),c=Object(l.a)(o,2),s=c[0],d=c[1],m=Object(a.useState)(""),h=Object(l.a)(m,2),p=h[0],b=h[1],f=Object(a.useState)(0),j=Object(l.a)(f,2),g=j[0],O=j[1],x=Ki(i),v=Ji[g].component;return Object(Me.jsx)("div",{children:Object(Me.jsx)(un.a,{fullScreen:!0,className:r.dialog,open:!0,"aria-labelledby":"form-dialog-title",children:Object(Me.jsx)(mn.a,{className:r.dialog,children:Object(Me.jsxs)("div",{className:r.wrapper,children:[Object(Me.jsxs)("div",{className:r.headerDiv,children:[Object(Me.jsx)(yn,{children:"Add Machine"}),Object(Me.jsx)(hn.a,{disableRipple:!0,onClick:t,children:Object(Me.jsx)(pn.a,{color:"error",children:Object(Me.jsx)(Bi,{})})})]}),Object(Me.jsxs)("div",{className:r.contentDiv,children:[Object(Me.jsx)(yi,{children:Ji.map((function(e,t){return function(e,t,n,a){var r,i,o=e===n,l=n<e,c=n>e;return Object(Me.jsxs)("div",{className:a.item,children:[Object(Me.jsx)("span",{className:I()((r={},Object(z.a)(r,a.itemText,!0),Object(z.a)(r,a.itemTextActive,o),Object(z.a)(r,a.itemTextPast,l),r)),children:t.label}),o&&Object(Me.jsx)(fi,{}),l&&Object(Me.jsx)(si,{}),c&&Object(Me.jsx)(vt,{}),n<Ji.length-1&&Object(Me.jsx)("div",{className:I()((i={},Object(z.a)(i,a.stepperPath,!0),Object(z.a)(i,a.stepperPast,l),i))})]})}(g,e,t,r)}))}),Object(Me.jsx)("div",{className:r.contentWrapper,children:Object(Me.jsx)(v,{classes:r,nextStep:function(){return O(1)},count:x,onPaired:n,qrCode:s,setQrCode:d,name:p,setName:b})})]})]})})})})}));function to(){return(to=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function no(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var ao=a.createElement("desc",null,"Created with Sketch."),ro=a.createElement("g",{id:"icon/button/add/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.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"}),a.createElement("line",{x1:6,y1:3.69230769,x2:6,y2:8.30769231,id:"Stroke-3",stroke:"#FFFFFF"}),a.createElement("line",{x1:3.69230769,y1:6,x2:8.30769231,y2:6,id:"Stroke-5",stroke:"#FFFFFF"}));function io(e,t){var n=e.title,r=e.titleId,i=no(e,["title","titleId"]);return a.createElement("svg",to({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":r},i),n?a.createElement("title",{id:r},n):null,ao,ro)}var oo=a.forwardRef(io);n.p;function lo(){return(lo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function co(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var so=a.createElement("desc",null,"Created with Sketch."),uo=a.createElement("defs",null,a.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"})),mo=a.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"nav-/-primary-/-1440",transform:"translate(-128.000000, -14.000000)"},a.createElement("g",{id:"icon/lamassu-logo",transform:"translate(128.000000, 14.000000)"},a.createElement("g",{id:"color/amaz/default"},a.createElement("mask",{id:"mask-2",fill:"white"},a.createElement("use",{xlinkHref:"#path-1"})),a.createElement("use",{id:"Mask",fill:"#16D6D3",xlinkHref:"#path-1"})))));function ho(e,t){var n=e.title,r=e.titleId,i=co(e,["title","titleId"]);return a.createElement("svg",lo({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":r},i),n?a.createElement("title",{id:r},n):null,so,uo,mo)}var po=a.forwardRef(ho);n.p;function bo(){return(bo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function fo(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var jo=a.createElement("desc",null,"Created with Sketch."),go=a.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"nav-/-primary-/-1440",transform:"translate(-1295.000000, -19.000000)",stroke:"#FFFFFF",strokeWidth:2},a.createElement("g",{id:"icon/menu/notification",transform:"translate(1296.000000, 20.000000)"},a.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"}),a.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 Oo(e,t){var n=e.title,r=e.titleId,i=fo(e,["title","titleId"]);return a.createElement("svg",bo({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":r},i),n?a.createElement("title",{id:r},n):null,jo,go)}var xo=a.forwardRef(Oo),vo=(n.p,Be.tl2),yo=Be.p,wo=56,Co=40;var ko,Eo,No,So,Io,Fo,Lo,Po,Do,Ro,Bo,To,Ao,Mo,Wo,zo,qo,$o,Ho,Vo={headerContainer:{position:"relative"},header:{backgroundColor:J,color:K,height:wo,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:K,margin:[[20,20,0,20]],"&:hover":{color:K},"&:hover::after":{width:"50%",marginLeft:"-25%"},position:"relative","&:after":{content:'""',display:"block",background:K,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:yo,textDecoration:"none",border:"none",color:K,backgroundColor:"transparent"},forceSize:{display:"inline-block",textAlign:"center","&:after":{display:"block",content:"attr(forcesize)",fontWeight:700,height:0,overflow:"hidden",visibility:"hidden"}},activeLink:{color:K,"& li::after":{width:"50%",marginLeft:"-25%"}},addMachine:{marginLeft:"auto"},subheader:{backgroundColor:re,color:K,height:Co,display:"flex"},subheaderUl:{display:"flex",paddingLeft:0},subheaderLi:{extend:vo,display:"flex",alignItems:"center",height:24,listStyle:"none",padding:[[0,20]],"&:first-child":{paddingLeft:0}},subheaderLink:{extend:yo,textDecoration:"none",border:"none",color:ue},activeSubheaderLink:{extend:vo,color:ce},white:{color:K},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}},Uo=Object(f.a)(Vo),Go=x()(ko||(ko=Object(c.a)(["\n query getUnread {\n hasUnreadNotifications\n }\n"]))),Xo=function(e){var t=e.item,n=e.classes,r=e.user,i=Object(a.useState)(null),o=Object(l.a)(i,2),c=o[0],s=o[1];return Object(Me.jsx)("div",{className:n.subheader,children:Object(Me.jsx)("div",{className:n.content,children:Object(Me.jsx)("nav",{children:Object(Me.jsx)("ul",{className:n.subheaderUl,children:t.children.map((function(e,t){return F.a(r.role,e.allowedRoles)?Object(Me.jsx)("li",{className:n.subheaderLi,children:Object(Me.jsx)(C.c,{to:{pathname:e.route,state:{prev:c}},className:n.subheaderLink,activeClassName:n.activeSubheaderLink,isActive:function(t){return!!t&&(s(e.route),!0)},children:e.label})},t):Object(Me.jsx)(Me.Fragment,{})}))})})})})},_o=L.a(P.a,D.a),Zo=Object(a.memo)((function(e){var t=e.tree,n=e.user,r=Object(a.useState)(!1),i=Object(l.a)(r,2),o=i[0],c=i[1],s=Object(a.useState)(null),d=Object(l.a)(s,2),m=d[0],h=d[1],p=Object(a.useState)({x:0,y:0}),b=Object(l.a)(p,2),f=b[0],j=b[1],g=Object(a.useState)(),O=Object(l.a)(g,2),x=O[0],v=O[1],y=Object(a.useState)(!1),k=Object(l.a)(y,2),S=k[0],L=k[1],P=Object(u.c)(Go),D=P.data,R=P.refetch,B=P.startPolling,T=P.stopPolling,A=Object(a.useRef)(),M=Object(a.useRef)(),W=Object(w.h)(),z=Uo();Object(a.useEffect)((function(){return(null===D||void 0===D?void 0:D.hasUnreadNotifications)?L(!0):_o(null===D||void 0===D?void 0:D.hasUnreadNotifications)?L(!1):void 0}),[D]),Object(a.useEffect)((function(){return B(6e4),T}));var q=function(){h(null),document.querySelector("#root").classList.remove("root-notifcenter-open"),document.querySelector("body").classList.remove("body-notifcenter-open")},$=Boolean(m),H=$?"notifications-popper":void 0;return Object(Me.jsxs)("header",{className:z.headerContainer,children:[Object(Me.jsx)("div",{className:z.header,children:Object(Me.jsxs)("div",{className:z.content,children:[Object(Me.jsxs)("div",{onClick:function(){v(!1),W.push("/dashboard")},className:I()(z.logo,z.logoLink),children:[Object(Me.jsx)(po,{}),Object(Me.jsx)(Ue,{className:z.white,children:"Lamassu Admin"})]}),Object(Me.jsx)("nav",{className:z.nav,children:Object(Me.jsx)("ul",{className:z.ul,children:t.map((function(e,t){return F.a(n.role,e.allowedRoles)?Object(Me.jsx)(C.c,{to:e.route||e.children[0].route,isActive:function(t){return!!t&&(v(e),!0)},className:I()(z.link,z.whiteLink),activeClassName:z.activeLink,children:Object(Me.jsx)("li",{className:z.li,children:Object(Me.jsx)("span",{className:z.forceSize,forcesize:e.label,children:e.label})})},t):Object(Me.jsx)(Me.Fragment,{})}))})}),Object(Me.jsxs)("div",{className:z.actionButtonsContainer,children:[Object(Me.jsx)(ze,{color:"secondary",Icon:Sn,InverseIcon:oo,onClick:function(){return c(!0)},children:"Add machine"}),Object(Me.jsx)(E.a,{onClickAway:q,children:Object(Me.jsxs)("div",{ref:A,children:[Object(Me.jsxs)("button",{onClick:function(e){var t=A.current.getBoundingClientRect();j({x:t.x,y:t.y}),h(m?null:e.currentTarget),document.querySelector("#root").classList.add("root-notifcenter-open"),document.querySelector("body").classList.add("body-notifcenter-open")},className:z.notificationIcon,children:[Object(Me.jsx)(xo,{}),S&&Object(Me.jsx)("div",{className:z.hasUnread})]}),Object(Me.jsx)(N.a,{ref:M,id:H,open:$,anchorEl:m,className:z.popper,disablePortal:!1,modifiers:{preventOverflow:{enabled:!0,boundariesElement:"viewport"}},children:Object(Me.jsx)(dn,{popperRef:M,buttonCoords:f,close:q,hasUnreadProp:S,refetchHasUnreadHeader:R})})]})})]})]})}),x&&x.children&&Object(Me.jsx)(Xo,{item:x,classes:z,user:n}),o&&Object(Me.jsx)(eo,{close:function(){return c(!1)},onPaired:function(e){c(!1),W.push("/maintenance/machine-status",{id:e.deviceId})}})]})})),Ko=n(922),Qo={wrapper:{display:"flex",alignItems:"center","& > svg":{marginRight:10}},message:{display:"flex",alignItems:"center",color:me,margin:0,whiteSpace:"break-spaces"}},Yo=Object(f.a)(Qo),Jo=function(e){var t=e.className,n=e.children,a=(Object(q.a)(e,["className","children"]),Yo());return Object(Me.jsxs)("div",{className:I()(a.wrapper,t),children:[Object(Me.jsx)(tn,{}),Object(Me.jsx)(Ke,{className:a.message,children:n})]})},el={titleWrapper:{display:"flex",justifyContent:"space-between",alignItems:"center",flexDirection:"row"},titleAndButtonsContainer:{display:"flex",alignItems:"center"},error:{marginLeft:12},subpageButton:{marginLeft:12},buttonText:{color:ae,fontSize:15},icon:{marginRight:6},label:{marginRight:24}},tl=Object(f.a)(el),nl=function(e){var t=e.className,n=e.title,a=e.error,r=e.labels,i=e.buttons,o=void 0===i?[]:i,l=e.children,c=e.appendix,s=e.appendixClassName,d=tl();return Object(Me.jsxs)("div",{className:I()(d.titleWrapper,t),children:[Object(Me.jsxs)("div",{className:d.titleAndButtonsContainer,children:[Object(Me.jsx)(yn,{children:n}),c&&Object(Me.jsx)("div",{className:s,children:c}),a&&Object(Me.jsx)(Jo,{className:d.error,children:"Failed to save"}),o.length>0&&Object(Me.jsx)(Me.Fragment,{children:o.map((function(e,t){return Object(Me.jsx)(Oa,{className:d.subpageButton,Icon:e.icon,InverseIcon:e.inverseIcon,toggle:e.toggle,forceDisable:e.forceDisable,children:Object(Me.jsx)(_e,{className:d.buttonText,children:e.text})},t)}))})]}),Object(Me.jsx)(Ko.a,{display:"flex",flexDirection:"row",children:(null!==r&&void 0!==r?r:[]).map((function(e,t){var n=e.icon,a=e.label;return Object(Me.jsxs)(Ko.a,{display:"flex",alignItems:"center",children:[Object(Me.jsx)("div",{className:d.icon,children:n}),Object(Me.jsx)(et,{className:d.label,children:a})]},t)}))}),l]})},al=n(255),rl=n(919),il=n(939),ol=n(885),ll=n(891),cl=n(943),sl=n(931),dl=n(932),ul=n(888),ml=n(938),hl=n(124),pl=n.n(hl),bl={title:{paddingTop:8},input:{marginBottom:25,marginTop:-15},wrapper:{padding:"2.5em 4em",width:575,display:"flex",flexDirection:"column"},titleWrapper:{display:"flex",flexDirection:"row",alignItems:"center",marginBottom:30},rememberMeWrapper:{marginTop:35,display:"flex",flexDirection:"row"},icon:{transform:"scale(1.5)",marginRight:25},checkbox:{transform:"scale(1.5)",marginRight:5,marginLeft:-5},footer:{marginTop:"10vh"},twofaFooter:{marginTop:"6vh"},fidoLoginButtonWrapper:{marginBottom:12},loginButton:{display:"block",width:"100%"},welcomeBackground:{background:"url(/wizard-background.svg) no-repeat center center fixed",backgroundColor:ae,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}},fl="LOGIN",jl="SETUP2FA",gl="INPUT2FA",Ol="FIDO",xl=Object(f.a)(bl),vl=x()(Eo||(Eo=Object(c.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"]))),yl=x()(No||(No=Object(c.a)(["\n {\n userData {\n id\n username\n role\n }\n }\n"]))),wl=function(e){var t=e.state,n=e.dispatch,r=xl(),i=Object(w.h)(),o=Object(a.useContext)(k).setUserData,c=Object(a.useState)(!1),s=Object(l.a)(c,2),d=s[0],m=s[1],h=Object(u.a)(yl,{onCompleted:function(e){var t=e.userData;o(t),i.push("/")}}),p=Object(l.a)(h,2),b=p[0],f=p[1].error,j=Object(u.b)(vl,{onCompleted:function(e){if(e.input2FA){var n={context:{headers:{"Pazuz-Operator-Identifier":pl.a.encode(t.clientField)}}};return b(n)}return m(!0)}}),g=Object(l.a)(j,2),O=g[0],x=g[1].error,v=f?"Internal server error":6!==t.twoFAField.length&&d?"The code should have 6 characters!":x||d?"Code is invalid. Please try again.":null;return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Ye,{className:r.info,children:"Enter your two-factor authentication code"}),Object(Me.jsx)(hr,{name:"2fa",value:t.twoFAField,onChange:function(e){n({type:gl,payload:{twoFAField:e}}),m(!1)},numInputs:6,error:d,shouldAutoFocus:!0}),Object(Me.jsxs)("div",{className:r.twofaFooter,children:[v&&Object(Me.jsx)(Xe,{className:r.errorMessage,children:v}),Object(Me.jsx)(An,{onClick:function(){if(6===t.twoFAField.length){var e={variables:{username:t.clientField,password:t.passwordField,code:t.twoFAField,rememberMe:t.rememberMeField},context:{headers:{"Pazuz-Operator-Identifier":pl.a.encode(t.clientField)}}};O(e)}else m(!0)},buttonClassName:r.loginButton,children:"Login"})]})]})},Cl=n(187),kl=Object(f.a)(bl),El=x()(So||(So=Object(c.a)(["\n {\n userData {\n id\n username\n role\n }\n }\n"]))),Nl=xn.f().shape({localClient:xn.h().required("Client field is required!").email("Username field should be in an email format!"),localRememberMe:xn.b()}),Sl={localClient:"",localRememberMe:!1},Il=function(e){var t=e.state,n=e.strategy,r=x()(Io||(Io=Object(c.a)(["\n query generateAssertionOptions($username: String!",") {\n generateAssertionOptions(username: $username",")\n }\n "])),"FIDO2FA"===n?", $password: String!":"","FIDO2FA"===n?", password: $password":""),i=x()(Fo||(Fo=Object(c.a)(["\n mutation validateAssertion(\n $username: String!\n ","\n $rememberMe: Boolean!\n $assertionResponse: JSONObject!\n ) {\n validateAssertion(\n username: $username\n ","\n rememberMe: $rememberMe\n assertionResponse: $assertionResponse\n )\n }\n "])),"FIDO2FA"===n?", $password: String!":"","FIDO2FA"===n?"password: $password":""),o=kl(),s=Object(w.h)(),d=Object(a.useContext)(k).setUserData,m=Object(a.useState)(""),h=Object(l.a)(m,2),p=h[0],b=h[1],f=Object(a.useState)(!1),j=Object(l.a)(f,2),g=j[0],O=j[1],v=Object(a.useState)(!1),y=Object(l.a)(v,2),C=y[0],E=y[1],N=Object(a.useState)(!1),S=Object(l.a)(N,2),I=S[0],F=S[1],L=Object(u.b)(i,{onCompleted:function(e){e.validateAssertion?q():F(!0)}}),P=Object(l.a)(L,2),D=P[0],R=P[1].error,B=Object(u.a)(r,{variables:"FIDO2FA"===n?{username:t.clientField,password:t.passwordField}:{username:p},onCompleted:function(e){var a=e.generateAssertionOptions;Object(Cl.a)(a).then((function(e){var a="FIDO2FA"===n?{username:t.clientField,password:t.passwordField,rememberMe:t.rememberMeField,assertionResponse:e}:{username:p,rememberMe:g,assertionResponse:e};D({variables:a})})).catch((function(e){console.error(e),F(!0)}))}}),T=Object(l.a)(B,2),A=T[0],M=T[1].error,W=Object(u.a)(El,{onCompleted:function(e){var t=e.userData;d(t),s.push("/")}}),z=Object(l.a)(W,2),q=z[0],$=z[1].error,H=function(e,t){return e&&t?M||$||R?"Internal server error":e.client&&t.client?e.client:C?"Invalid login.":I?"Code is invalid. Please try again.":null:null};return Object(Me.jsxs)(Me.Fragment,{children:["FIDOPasswordless"===n&&Object(Me.jsx)(bn.e,{validationSchema:Nl,initialValues:Sl,onSubmit:function(e){E(!1),b(e.localClient),O(e.localRememberMe),A()},children:function(e){var t=e.errors,n=e.touched;return Object(Me.jsxs)(bn.d,{id:"fido-form",children:[Object(Me.jsx)(bn.b,{name:"localClient",label:"Client",size:"lg",component:ai,fullWidth:!0,autoFocus:!0,className:o.input,error:H(t,n),onKeyUp:function(){C&&E(!1)}}),Object(Me.jsxs)("div",{className:o.rememberMeWrapper,children:[Object(Me.jsx)(bn.b,{name:"localRememberMe",className:o.checkbox,component:Yr}),Object(Me.jsx)(tt,{className:o.inputLabel,children:"Keep me logged in"})]}),Object(Me.jsxs)("div",{className:o.twofaFooter,children:[H(t,n)&&Object(Me.jsx)(Xe,{className:o.errorMessage,children:H(t,n)}),Object(Me.jsx)(An,{type:"submit",form:"fido-form",buttonClassName:o.loginButton,children:"Use FIDO"})]})]})}}),"FIDO2FA"===n&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(He,{className:o.info,children:"Insert your hardware key and follow the instructions"}),Object(Me.jsx)(An,{type:"button",form:"fido-form",onClick:function(){return A()},buttonClassName:o.loginButton,children:"Use FIDO"})]})]})},Fl=n(33),Ll=n.n(Fl),Pl=n(62),Dl=Object(f.a)(bl),Rl=x()(Lo||(Lo=Object(c.a)(["\n mutation login($username: String!, $password: String!) {\n login(username: $username, password: $password)\n }\n"]))),Bl=x()(Po||(Po=Object(c.a)(["\n query generateAssertionOptions {\n generateAssertionOptions\n }\n"]))),Tl=x()(Do||(Do=Object(c.a)(["\n mutation validateAssertion($assertionResponse: JSONObject!) {\n validateAssertion(assertionResponse: $assertionResponse)\n }\n"]))),Al=x()(Ro||(Ro=Object(c.a)(["\n {\n userData {\n id\n username\n role\n }\n }\n"]))),Ml=xn.f().shape({client:xn.h().required("Client field is required!").email("Username field should be in an email format!"),password:xn.h().required("Password field is required"),rememberMe:xn.b()}),Wl={client:"",password:"",rememberMe:!1},zl=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},ql=function(e){e.state;var t=e.dispatch,n=e.strategy,r=Dl(),i=Object(w.h)(),o=Object(a.useContext)(k).setUserData,c=Object(u.b)(Rl),s=Object(l.a)(c,2),d=s[0],m=s[1].error,h=function(){var e=Object(Pl.a)(Ll.a.mark((function e(n,a,r){var i,o,l;return Ll.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i={variables:{username:n,password:a},context:{headers:{"Pazuz-Operator-Identifier":pl.a.encode(n)}}},e.next=3,d(i);case 3:if(o=e.sent,(l=o.data).login){e.next=7;break}return e.abrupt("return");case 7:return e.abrupt("return",t({type:l.login,payload:{clientField:n,passwordField:a,rememberMeField:r}}));case 8:case"end":return e.stop()}}),e)})));return function(t,n,a){return e.apply(this,arguments)}}(),p=Object(u.b)(Tl,{onCompleted:function(e){return e.validateAssertion&&E()}}),b=Object(l.a)(p,2),f=b[0],j=b[1].error,g=Object(u.a)(Bl,{onCompleted:function(e){var t=e.generateAssertionOptions;Object(Cl.a)(t).then((function(e){f({variables:{assertionResponse:e}})})).catch((function(e){console.error(e)}))}}),O=Object(l.a)(g,2),x=O[0],v=O[1].error,y=Object(u.a)(Al,{onCompleted:function(e){var t=e.userData;o(t),i.push("/")}}),C=Object(l.a)(y,2),E=C[0],N=C[1].error;return Object(Me.jsx)(bn.e,{validationSchema:Ml,initialValues:Wl,onSubmit:function(e){return h(e.client,e.password,e.rememberMe)},children:function(e){var a=e.errors,i=e.touched;return Object(Me.jsxs)(bn.d,{id:"login-form",children:[Object(Me.jsx)(bn.b,{name:"client",label:"Client",size:"lg",component:ai,fullWidth:!0,autoFocus:!0,className:r.input,error:zl(a,i,m||j||v||N)}),Object(Me.jsx)(bn.b,{name:"password",size:"lg",component:ni,label:"Password",fullWidth:!0,error:zl(a,i,m||j||v||N)}),Object(Me.jsxs)("div",{className:r.rememberMeWrapper,children:[Object(Me.jsx)(bn.b,{name:"rememberMe",className:r.checkbox,component:Yr}),Object(Me.jsx)(nt,{children:"Keep me logged in"})]}),Object(Me.jsxs)("div",{className:r.footer,children:[zl(a,i,m||j||v||N)&&Object(Me.jsx)(Xe,{className:r.errorMessage,children:zl(a,i,m||j||v||N)}),"FIDO2FA"!==n&&Object(Me.jsx)(An,{type:"button",onClick:function(){return"FIDOUsernameless"===n?x():t({type:"FIDO",payload:{}})},buttonClassName:r.loginButton,className:r.fidoLoginButtonWrapper,children:"I have a hardware key"}),Object(Me.jsx)(An,{type:"submit",form:"login-form",buttonClassName:r.loginButton,children:"Login"})]})]})}})},$l=x()(Bo||(Bo=Object(c.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"]))),Hl=x()(To||(To=Object(c.a)(["\n query get2FASecret($username: String!, $password: String!) {\n get2FASecret(username: $username, password: $password) {\n secret\n otpauth\n }\n }\n"]))),Vl=x()(Ao||(Ao=Object(c.a)(["\n {\n userData {\n id\n username\n role\n }\n }\n"]))),Ul=Object(f.a)(bl),Gl=function(e){var t=e.state,n=(e.dispatch,Ul()),r=Object(w.h)(),i=Object(a.useContext)(k).setUserData,o=Object(a.useState)(null),c=Object(l.a)(o,2),s=c[0],d=c[1],m=Object(a.useState)(null),h=Object(l.a)(m,2),p=h[0],b=h[1],f=Object(a.useState)(!1),j=Object(l.a)(f,2),g=j[0],O=j[1],x=Object(a.useState)(!1),v=Object(l.a)(x,2),y=v[0],C=v[1],E=Object(a.useState)(""),N=Object(l.a)(E,2),S=N[0],I=N[1],F={variables:{username:t.clientField,password:t.passwordField},context:{headers:{"Pazuz-Operator-Identifier":pl.a.encode(t.clientField)}},onCompleted:function(e){var t=e.get2FASecret;d(t.secret),b(t.otpauth)}},L={variables:{username:t.clientField,password:t.passwordField,rememberMe:t.rememberMeField,codeConfirmation:S},context:{headers:{"Pazuz-Operator-Identifier":pl.a.encode(t.clientField)}}},P=Object(u.c)(Hl,F).error,D=Object(u.a)(Vl,{onCompleted:function(e){var t=e.userData;i(t),r.push("/")}}),R=Object(l.a)(D,1)[0],B=Object(u.b)($l,{onCompleted:function(e){var n=e.setup2FA,a={context:{headers:{"Pazuz-Operator-Identifier":pl.a.encode(t.clientField)}}};n?R(a):C(!0)}}),T=Object(l.a)(B,2),A=T[0],M=T[1].error,W=function(){return M||P?"Internal server error.":6!==S.length&&y?"The code should have 6 characters!":y?"Code is invalid. Please try again.":null};return s&&p&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)("div",{className:n.infoWrapper,children:[Object(Me.jsx)(nt,{className:n.info2,children:"We detected that this account does not have its two-factor authentication enabled. In order to protect the resources in the system, a two-factor authentication is enforced."}),Object(Me.jsx)(nt,{className:n.info2,children:"To finish this process, please scan the following QR code or insert the secret further below on an authentication app of your choice, such as Google Authenticator or Authy."})]}),Object(Me.jsx)("div",{className:n.qrCodeWrapper,children:Object(Me.jsx)(jn.a,{size:240,fgColor:J,value:p})}),Object(Me.jsxs)("div",{className:n.secretWrapper,children:[Object(Me.jsx)(nt,{className:n.secretLabel,children:"Your secret:"}),Object(Me.jsx)(nt,{className:g?n.secret:n.hiddenSecret,children:s}),Object(Me.jsx)(ze,{disabled:!s&&!p,color:"primary",onClick:function(){O(!g)},children:g?"Hide":"Show"})]}),Object(Me.jsx)("div",{className:n.confirm2FAInput,children:Object(Me.jsx)(hr,{name:"2fa",value:S,onChange:function(e){I(e),C(!1)},numInputs:6,error:y,shouldAutoFocus:!0})}),Object(Me.jsxs)("div",{className:n.twofaFooter,children:[W()&&Object(Me.jsx)(Xe,{className:n.errorMessage,children:W()}),Object(Me.jsx)(An,{onClick:function(){6===S.length?A(L):C(!0)},buttonClassName:n.loginButton,children:"Done"})]})]})},Xl="FIDO2FA",_l=Object(f.a)(bl),Zl={twoFAField:"",clientField:"",passwordField:"",rememberMeField:!1,loginState:fl},Kl=function(e,t){var n=t.type,a=t.payload;return Object(s.a)(Object(s.a)(Object(s.a)({},e),a),{},{loginState:n})},Ql=function(){var e=_l(),t=Object(a.useReducer)(Kl,Zl),n=Object(l.a)(t,2),r=n[0],i=n[1];return Object(Me.jsx)(Un.a,{elevation:1,children:Object(Me.jsxs)("div",{className:e.wrapper,children:[Object(Me.jsxs)("div",{className:e.titleWrapper,children:[Object(Me.jsx)(po,{className:e.icon}),Object(Me.jsx)(Ge,{className:e.title,children:"Lamassu Admin"})]}),function(){switch(r.loginState){case fl:return Object(Me.jsx)(ql,{state:r,dispatch:i,strategy:Xl});case gl:return Object(Me.jsx)(wl,{state:r,dispatch:i});case jl:return Object(Me.jsx)(Gl,{state:r,dispatch:i});case Ol:return Object(Me.jsx)(Il,{state:r,strategy:Xl})}}()]})})},Yl=Object(f.a)(bl),Jl=function(){var e=Yl();return Object(Me.jsx)(h.a,{container:!0,spacing:0,direction:"column",alignItems:"center",justify:"center",className:e.welcomeBackground,children:Object(Me.jsx)(h.a,{children:Object(Me.jsx)(Ql,{})})})},ec=function(){return new URLSearchParams(Object(w.i)().search)},tc=Object(f.a)(bl),nc=x()(Mo||(Mo=Object(c.a)(["\n query validateRegisterLink($token: String!) {\n validateRegisterLink(token: $token) {\n username\n role\n }\n }\n"]))),ac=x()(Wo||(Wo=Object(c.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"]))),rc=xn.f({password:xn.h().required("A password is required").min(8,"Your password must contain at least ".concat(8," characters")),confirmPassword:xn.h().required("Please confirm the password").oneOf([xn.g("password")],"Passwords must match")}),ic={password:"",confirmPassword:""},oc={username:null,role:null,result:""},lc=function(e,t){var n=t.type,a=t.payload;return Object(s.a)(Object(s.a)(Object(s.a)({},e),a),{},{result:n})},cc=function(e,t,n,a){return e&&t?n||a?"Internal server error":e.password&&t.password?e.password:e.confirmPassword&&t.confirmPassword?e.confirmPassword:null:null},sc=function(){var e,t=tc(),n=Object(w.h)(),r=ec().get("t"),i=null!==(e=ec().get("id"))&&void 0!==e?e:null,o=Object(a.useReducer)(lc,oc),c=Object(l.a)(o,2),s=c[0],d=c[1],m={context:{headers:{"Pazuz-Operator-Identifier":i}},variables:{token:r},onCompleted:function(e){var t=e.validateRegisterLink;if(!t)return d({type:"failure"});d({type:"success",payload:{username:t.username,role:t.role}})},onError:function(){return d({type:"failure"})}},p=Object(u.c)(nc,m),b=p.error,f=p.loading,j=Object(u.b)(ac,{onCompleted:function(e){e.register&&n.push("/wizard",{fromAuthRegister:!0})}}),g=Object(l.a)(j,2),O=g[0],x=g[1].error;return Object(Me.jsx)(h.a,{container:!0,spacing:0,direction:"column",alignItems:"center",justify:"center",className:t.welcomeBackground,children:Object(Me.jsx)(h.a,{children:Object(Me.jsx)("div",{children:Object(Me.jsx)(Un.a,{elevation:1,children:Object(Me.jsxs)("div",{className:t.wrapper,children:[Object(Me.jsxs)("div",{className:t.titleWrapper,children:[Object(Me.jsx)(po,{className:t.icon}),Object(Me.jsx)(He,{className:t.title,children:"Lamassu Admin"})]}),!f&&"success"===s.result&&Object(Me.jsx)(bn.e,{validationSchema:rc,initialValues:ic,onSubmit:function(e){O({variables:{token:r,username:s.username,password:e.password,role:s.role}})},children:function(e){var n=e.errors,a=e.touched;return Object(Me.jsxs)(bn.d,{id:"register-form",children:[Object(Me.jsx)(bn.b,{name:"password",label:"Insert a password",autoFocus:!0,component:ni,size:"lg",fullWidth:!0,className:t.input}),Object(Me.jsx)(bn.b,{name:"confirmPassword",label:"Confirm your password",component:ni,size:"lg",fullWidth:!0}),Object(Me.jsxs)("div",{className:t.footer,children:[cc(n,a,b,x)&&Object(Me.jsx)(Xe,{className:t.errorMessage,children:cc(n,a,b,x)}),Object(Me.jsx)(An,{type:"submit",form:"register-form",buttonClassName:t.loginButton,children:"Done"})]})]})}}),!f&&"failure"===s.result&&Object(Me.jsx)(Me.Fragment,{children:Object(Me.jsx)(nt,{children:"Link has expired"})})]})})})})})},dc=Object(f.a)(bl),uc=x()(zo||(zo=Object(c.a)(["\n query validateReset2FALink($token: String!) {\n validateReset2FALink(token: $token) {\n user_id\n secret\n otpauth\n }\n }\n"]))),mc=x()(qo||(qo=Object(c.a)(["\n mutation reset2FA($token: String!, $userID: ID!, $code: String!) {\n reset2FA(token: $token, userID: $userID, code: $code)\n }\n"]))),hc={userID:null,secret:null,otpauth:null,result:null},pc=function(e,t){var n=t.type,a=t.payload;return Object(s.a)(Object(s.a)(Object(s.a)({},e),a),{},{result:n})},bc=function(){var e=dc(),t=Object(w.h)(),n=new URLSearchParams(Object(w.i)().search).get("t"),r=Object(a.useState)(!1),i=Object(l.a)(r,2),o=i[0],c=i[1],s=Object(a.useState)(!1),d=Object(l.a)(s,2),m=d[0],p=d[1],b=Object(a.useState)(""),f=Object(l.a)(b,2),j=f[0],g=f[1],O=Object(a.useReducer)(pc,hc),x=Object(l.a)(O,2),v=x[0],y=x[1],C=Object(u.c)(uc,{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,E=C.loading,N=Object(u.b)(mc,{onCompleted:function(e){e.reset2FA?t.push("/"):p(!0)}}),S=Object(l.a)(N,2),I=S[0],F=S[1].error,L=function(){return k?"Internal server error":6!==j.length&&m?"The code should have 6 characters!":F||m?"Code is invalid. Please try again.":null};return Object(Me.jsx)(h.a,{container:!0,spacing:0,direction:"column",alignItems:"center",justify:"center",className:e.welcomeBackground,children:Object(Me.jsx)(h.a,{children:Object(Me.jsx)("div",{children:Object(Me.jsx)(Un.a,{elevation:1,children:Object(Me.jsxs)("div",{className:e.wrapper,children:[Object(Me.jsxs)("div",{className:e.titleWrapper,children:[Object(Me.jsx)(po,{className:e.icon}),Object(Me.jsx)(He,{className:e.title,children:"Lamassu Admin"})]}),!E&&"success"===v.result&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)("div",{className:e.infoWrapper,children:Object(Me.jsx)(tt,{className:e.info2,children:"To finish this process, please scan the following QR code or insert the secret further below on an authentication app of your choice, such Google Authenticator or Authy."})}),Object(Me.jsx)("div",{className:e.qrCodeWrapper,children:Object(Me.jsx)(jn.a,{size:240,fgColor:J,value:v.otpauth})}),Object(Me.jsxs)("div",{className:e.secretWrapper,children:[Object(Me.jsx)(tt,{className:e.secretLabel,children:"Your secret:"}),Object(Me.jsx)(tt,{className:o?e.secret:e.hiddenSecret,children:v.secret}),Object(Me.jsx)(ze,{color:"primary",onClick:function(){c(!o)},children:o?"Hide":"Show"})]}),Object(Me.jsx)("div",{className:e.confirm2FAInput,children:Object(Me.jsx)(hr,{name:"2fa",value:j,onChange:function(e){g(e),p(!1)},numInputs:6,error:m,shouldAutoFocus:!0})}),Object(Me.jsxs)("div",{className:e.twofaFooter,children:[L()&&Object(Me.jsx)(Xe,{className:e.errorMessage,children:L()}),Object(Me.jsx)(An,{onClick:function(){6===j.length?I({variables:{token:n,userID:v.userID,code:j}}):p(!0)},buttonClassName:e.loginButton,children:"Done"})]})]}),!E&&"failure"===v.result&&Object(Me.jsx)(Me.Fragment,{children:Object(Me.jsx)(nt,{children:"Link has expired"})})]})})})})})},fc=Object(f.a)(bl),jc=x()($o||($o=Object(c.a)(["\n query validateResetPasswordLink($token: String!) {\n validateResetPasswordLink(token: $token) {\n id\n }\n }\n"]))),gc=x()(Ho||(Ho=Object(c.a)(["\n mutation resetPassword($token: String!, $userID: ID!, $newPassword: String!) {\n resetPassword(token: $token, userID: $userID, newPassword: $newPassword)\n }\n"]))),Oc=xn.f().shape({password:xn.h().required("A new password is required").test("len","New password must contain more than 8 characters",(function(e){return e.length>=8})),confirmPassword:xn.h().oneOf([xn.g("password"),null],"Passwords must match")}),xc={password:"",confirmPassword:""},vc=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},yc=function(){var e=fc(),t=Object(w.h)(),n=new URLSearchParams(Object(w.i)().search).get("t"),r=Object(a.useState)(null),i=Object(l.a)(r,2),o=i[0],c=i[1],s=Object(a.useState)(!0),d=Object(l.a)(s,2),m=d[0],p=d[1],b=Object(a.useState)(!1),f=Object(l.a)(b,2),j=f[0],g=f[1];Object(u.c)(jc,{variables:{token:n},onCompleted:function(e){var t=e.validateResetPasswordLink;p(!1),t?(g(!0),c(t.id)):g(!1)},onError:function(){p(!1),g(!1)}});var O=Object(u.b)(gc,{onCompleted:function(e){e.resetPassword&&t.push("/")}}),x=Object(l.a)(O,2),v=x[0],y=x[1].error;return Object(Me.jsx)(h.a,{container:!0,spacing:0,direction:"column",alignItems:"center",justify:"center",className:e.welcomeBackground,children:Object(Me.jsx)(h.a,{children:Object(Me.jsx)("div",{children:Object(Me.jsx)(Un.a,{elevation:1,children:Object(Me.jsxs)("div",{className:e.wrapper,children:[Object(Me.jsxs)("div",{className:e.titleWrapper,children:[Object(Me.jsx)(po,{className:e.icon}),Object(Me.jsx)(He,{className:e.title,children:"Lamassu Admin"})]}),!m&&j&&Object(Me.jsx)(bn.e,{validationSchema:Oc,initialValues:xc,onSubmit:function(e){v({variables:{token:n,userID:o,newPassword:e.confirmPassword}})},children:function(t){var n=t.errors,a=t.touched;return Object(Me.jsxs)(bn.d,{id:"reset-password",children:[Object(Me.jsx)(bn.b,{name:"password",autoFocus:!0,size:"lg",component:ni,label:"New password",fullWidth:!0,className:e.input}),Object(Me.jsx)(bn.b,{name:"confirmPassword",size:"lg",component:ni,label:"Confirm your password",fullWidth:!0}),Object(Me.jsxs)("div",{className:e.footer,children:[vc(n,a,y)&&Object(Me.jsx)(Xe,{className:e.errorMessage,children:vc(n,a,y)}),Object(Me.jsx)(An,{type:"submit",form:"reset-password",buttonClassName:e.loginButton,children:"Done"})]})]})}}),!m&&!j&&Object(Me.jsx)(Me.Fragment,{children:Object(Me.jsx)(nt,{children:"Link has expired"})})]})})})})})};function wc(){return(wc=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Cc(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var kc=a.createElement("desc",null,"Created with Sketch."),Ec=a.createElement("g",{id:"Styleguide",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"icon/direction/cash-in",transform:"translate(-1.000000, 0.000000)",fill:"#16D6D3"},a.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 Nc(e,t){var n=e.title,r=e.titleId,i=Cc(e,["title","titleId"]);return a.createElement("svg",wc({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":r},i),n?a.createElement("title",{id:r},n):null,kc,Ec)}var Sc=a.forwardRef(Nc);n.p;function Ic(){return(Ic=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Fc(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Lc=a.createElement("desc",null,"Created with Sketch."),Pc=a.createElement("g",{id:"Styleguide",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"icon/direction/cash-out",transform:"translate(-1.000000, 0.000000)",fill:"#5A67FF"},a.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 Dc(e,t){var n=e.title,r=e.titleId,i=Fc(e,["title","titleId"]);return a.createElement("svg",Ic({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":r},i),n?a.createElement("title",{id:r},n):null,Lc,Pc)}var Rc,Bc=a.forwardRef(Dc),Tc=(n.p,{headerLabels:{display:"flex",flexDirection:"row"},headerLabelContainerMargin:{marginRight:24},headerLabelContainer:{display:"flex",alignItems:"center"},headerLabelSpan:{extend:Be.label1,marginLeft:6},root:{flexGrow:1,display:"flex",marginBottom:120},emptyMachinesRoot:{height:300,backgroundColor:G,border:"solid 2px ".concat(X)},card:{wordWrap:"break-word",boxShadow:"0 0 4px 0 rgba(0, 0, 0, 0.08)",borderRadius:12,padding:24,backgroundColor:K,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"},inline:{display:"inline"},emptyMachinesContent:{display:"flex",flexDirection:"column",height:"100%",justifyContent:"center",alignItems:"center","& > :first-child":{marginTop:0},"& > *":{marginTop:25}},offColor:{color:de}}),Ac=n(36),Mc=n.n(Ac),Wc=n(90),zc=n(845),qc=n(846),$c=n(444),Hc=n(847),Vc=n(848),Uc="cashOut",Gc="wallets",Xc="operatorInfo",_c="notifications",Zc="locale",Kc="commissions",Qc="receipt",Yc="coinAtmRadar",Jc="termsConditions",es="triggersConfig",ts=zc.a((function(e,t){return qc.a(R.a($c.a(0,e),Hc.a(t)))})),ns=zc.a((function(e,t){return qc.a(M.a((function(t){return e(t[0])}),Hc.a(t)))})),as=zc.a((function(e,t){return Vc.a(e,t)?t.slice(e.length):t})),rs=zc.a((function(e,t){return L.a(function(e){return ts(as("".concat(e,"_")))}(e),function(e){return ns(Vc.a("".concat(e,"_")))}(e))(t)})),is=zc.a((function(e,t){return ts((function(t){return"".concat(e,"_").concat(t)}))(t)})),os={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:K,textAlign:"left",boxShadow:"0px -1px 10px 0px rgba(50, 50, 50, 0.1)"}},tickerLabel:{color:se,marginTop:-5},content:{width:1200,backgroundColor:K,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}}},ls=x()(Rc||(Rc=Object(c.a)(["\n query getData {\n cryptoRates\n cryptoCurrencies {\n code\n display\n }\n config\n accountsConfig {\n code\n display\n }\n }\n"])));Mc.a.config({ROUNDING_MODE:Mc.a.ROUND_HALF_UP});var cs=Object(f.a)(os),ss=function(){var e,t,n,r,i,o=Object(u.c)(ls).data,c=Object(a.useState)(!1),s=Object(l.a)(c,2),d=s[0],m=s[1],p=Object(a.useState)(null),b=Object(l.a)(p,2),f=b[0],j=b[1],g=null!==(e=A.a(["cryptoRates","withCommissions"])(o))&&void 0!==e?e:{},O=cs({bigFooter:Wc.a(g).length>8,expanded:d}),x=null!==(t=A.a(["config"])(o))&&void 0!==t?t:{},v=Wc.a(g).length>4,y=rs("wallets")(x),w=null!==(n=A.a(["cryptoCurrencies"])(o))&&void 0!==n?n:[],C=null!==(r=A.a(["accountsConfig"])(o))&&void 0!==r?r:[],k=null!==(i=A.a(["locale_fiatCurrency"])(x))&&void 0!==i?i:"";return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)("div",{className:O.mouseWatcher,onMouseLeave:function(){clearTimeout(f),m(!1)},onMouseEnter:function(){j(setTimeout((function(){return v&&m(!0)}),300))}}),Object(Me.jsx)("div",{className:O.content,children:Object(Me.jsx)(h.a,{container:!0,spacing:1,children:Object(Me.jsx)(h.a,{container:!0,className:O.footerContainer,children:Wc.a(g).map((function(e){return function(e){var t=ml.a(W.a("code",e))(w),n=y["".concat(e,"_ticker")],a=ml.a(W.a("code",n))(C),r=a>-1?C[a].display:"",i=parseFloat(A.a(["cryptoRates","withoutCommissions",e,"cashIn"])(o)),l=parseFloat(A.a(["cryptoRates","withoutCommissions",e,"cashOut"])(o)),c=new Mc.a((i+l)/2).toFormat(2),s=new Mc.a(parseFloat(A.a(["cryptoRates","withCommissions",e,"cashIn"])(o))).toFormat(2),d=new Mc.a(parseFloat(A.a(["cryptoRates","withCommissions",e,"cashOut"])(o))).toFormat(2);return Object(Me.jsxs)(h.a,{item:!0,xs:3,children:[Object(Me.jsx)(tt,{className:O.label,children:w[t].display}),Object(Me.jsxs)("div",{className:O.headerLabels,children:[Object(Me.jsxs)("div",{className:O.headerLabel,children:[Object(Me.jsx)(Sc,{}),Object(Me.jsx)(tt,{children:" ".concat(s," ").concat(k)})]}),Object(Me.jsxs)("div",{className:I()(O.headerLabel,O.txOutMargin),children:[Object(Me.jsx)(Bc,{}),Object(Me.jsx)(tt,{children:" ".concat(d," ").concat(k)})]})]}),Object(Me.jsx)(tt,{className:O.tickerLabel,children:"".concat(r,": ").concat(c," ").concat(k)})]},e)}(e)}))})})}),Object(Me.jsx)("div",{className:O.footer})]})},ds=n(852),us=n(955),ms=n(853),hs=n(179),ps=n(925);function bs(){return(bs=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function fs(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var js=a.createElement("defs",null,a.createElement("circle",{id:"path-100",cx:80,cy:80,r:80}),a.createElement("rect",{id:"path-300",x:28,y:44,width:104,height:116,rx:4}),a.createElement("filter",{x:"-23.1%",y:"-20.7%",width:"146.2%",height:"141.4%",filterUnits:"objectBoundingBox",id:"filter-4"},a.createElement("feOffset",{dx:0,dy:0,in:"SourceAlpha",result:"shadowOffsetOuter1"}),a.createElement("feGaussianBlur",{stdDeviation:8,in:"shadowOffsetOuter1",result:"shadowBlurOuter1"}),a.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"})),a.createElement("rect",{id:"path-5",x:37,y:66,width:84,height:8,rx:2}),a.createElement("mask",{id:"mask-6",maskContentUnits:"userSpaceOnUse",maskUnits:"objectBoundingBox",x:0,y:0,width:84,height:8,fill:"white"},a.createElement("use",{xlinkHref:"#path-5"})),a.createElement("rect",{id:"path-7",x:37,y:78,width:84,height:8,rx:2}),a.createElement("mask",{id:"mask-8",maskContentUnits:"userSpaceOnUse",maskUnits:"objectBoundingBox",x:0,y:0,width:84,height:8,fill:"white"},a.createElement("use",{xlinkHref:"#path-7"})),a.createElement("rect",{id:"path-9",x:37,y:90,width:84,height:8,rx:2}),a.createElement("mask",{id:"mask-10",maskContentUnits:"userSpaceOnUse",maskUnits:"objectBoundingBox",x:0,y:0,width:84,height:8,fill:"white"},a.createElement("use",{xlinkHref:"#path-9"})),a.createElement("rect",{id:"path-11",x:37,y:102,width:84,height:8,rx:2}),a.createElement("mask",{id:"mask-12",maskContentUnits:"userSpaceOnUse",maskUnits:"objectBoundingBox",x:0,y:0,width:84,height:8,fill:"white"},a.createElement("use",{xlinkHref:"#path-11"}))),gs=a.createElement("g",{id:"\\u21B3-v13a",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"transactions_v13a#1-(empty-table)",transform:"translate(-640.000000, -220.000000)"},a.createElement("g",{id:"Group-2",transform:"translate(640.000000, 220.000000)"},a.createElement("g",{id:"Rectangle"},a.createElement("mask",{id:"mask-200",fill:"white"},a.createElement("use",{xlinkHref:"#path-100"})),a.createElement("use",{id:"Mask",fill:"#EBEFFF",xlinkHref:"#path-100"}),a.createElement("g",{mask:"url(#mask-200)"},a.createElement("use",{fill:"black",fillOpacity:1,filter:"url(#filter-4)",xlinkHref:"#path-300"}),a.createElement("use",{fill:"#FFFFFF",fillRule:"evenodd",xlinkHref:"#path-300"}))),a.createElement("use",{id:"Rectangle",stroke:"#5F668A",mask:"url(#mask-6)",strokeDasharray:1,xlinkHref:"#path-5"}),a.createElement("use",{id:"Rectangle-Copy",stroke:"#5F668A",mask:"url(#mask-8)",strokeDasharray:1,xlinkHref:"#path-7"}),a.createElement("use",{id:"Rectangle-Copy-2",stroke:"#5F668A",mask:"url(#mask-10)",strokeDasharray:1,xlinkHref:"#path-9"}),a.createElement("use",{id:"Rectangle-Copy-3",stroke:"#5F668A",mask:"url(#mask-12)",strokeDasharray:1,xlinkHref:"#path-11"}),a.createElement("rect",{id:"Rectangle",fill:"#EBEFFF",x:37,y:56,width:84,height:6,rx:2}))));function Os(e,t){var n=e.title,r=e.titleId,i=fs(e,["title","titleId"]);return a.createElement("svg",bs({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":r},i),n?a.createElement("title",{id:r},n):null,js,gs)}var xs=a.forwardRef(Os),vs=(n.p,Object(f.a)({emptyTable:{width:"100%",display:"flex",flexDirection:"column",alignItems:"center",marginTop:52}})),ys=Object(a.memo)((function(e){var t=e.message,n=e.className,a=vs();return Object(Me.jsxs)("div",{className:I()(n,a.emptyTable),children:[Object(Me.jsx)(xs,{}),Object(Me.jsx)(Ue,{children:t})]})})),ws=Object(f.a)({table:{tableLayout:"fixed",borderCollapse:"separate",borderSpacing:"0 0"}}),Cs=Object(a.memo)((function(e){var t=e.className,n=e.children,a=Object(q.a)(e,["className","children"]),r=ws();return Object(Me.jsx)("table",Object(s.a)(Object(s.a)({},a),{},{className:I()(r.table,t),children:n}))})),ks=Object(a.memo)((function(e){var t=e.children,n=Object(q.a)(e,["children"]);return Object(Me.jsx)("tbody",Object(s.a)(Object(s.a)({},n),{},{children:t}))})),Es=Object(f.a)({td:{padding:[[0,24]]},alignRight:{textAlign:"right"}}),Ns=Object(a.memo)((function(e){var t,n=e.colspan,a=e.rightAlign,r=e.className,i=e.children,o=Object(q.a)(e,["colspan","rightAlign","className","children"]),l=Es(),c=(t={},Object(z.a)(t,l.td,!0),Object(z.a)(t,l.alignRight,a),t);return Object(Me.jsx)("td",Object(s.a)(Object(s.a)({colSpan:n,className:I()(c,r)},o),{},{children:i}))})),Ss=Object(a.memo)((function(e){var t=e.children,n=Object(q.a)(e,["children"]);return Object(Me.jsx)("thead",Object(s.a)(Object(s.a)({},n),{},{children:t}))})),Is=Be.tl2,Fs=Object(f.a)({th:{extend:Is,backgroundColor:Le,height:Se,textAlign:"left",color:K,padding:"0 ".concat(24,"px")},alignRight:{textAlign:"right"}}),Ls=Object(a.memo)((function(e){var t,n=e.rightAlign,a=e.children,r=e.className,i=Object(q.a)(e,["rightAlign","children","className"]),o=Fs(),l=(t={},Object(z.a)(t,o.th,!0),Object(z.a)(t,o.alignRight,n),t);return Object(Me.jsx)("th",Object(s.a)(Object(s.a)({},i),{},{className:I()(l,r),children:a}))})),Ps=Be.info2,Ds=Be.p,Rs=Object(f.a)({tr:{extend:Ds,padding:4,height:Ie,backgroundColor:"#ffffff"},lg:{extend:Ps,height:76},sm:{height:30},error:{backgroundColor:Pe},success:{backgroundColor:De}}),Bs=Object(a.memo)((function(e){var t,n=e.className,a=e.children,r=e.header,i=e.error,o=e.success,l=e.size,c=void 0===l?"sm":l,d=Object(q.a)(e,["className","children","header","error","success","size"]),u=Rs(),m=(t={},Object(z.a)(t,u.tr,!r),Object(z.a)(t,u.sm,!r&&"sm"===c),Object(z.a)(t,u.lg,!r&&"lg"===c),Object(z.a)(t,u.error,i),Object(z.a)(t,u.success,o),t);return Object(Me.jsx)("tr",Object(s.a)(Object(s.a)({className:I()(m,n)},d),{},{children:a}))}));function Ts(){return(Ts=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function As(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Ms=a.createElement("g",{id:"icon/label/icon/down",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"Group-6"},a.createElement("circle",{id:"Oval",fill:"#FFECEB",cx:6,cy:6,r:6}),a.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"},a.createElement("polyline",{id:"Path-2",points:"3.15780333 -4.54747351e-13 6.15780333 2.82998193 3.15780333 5.65996386"}),a.createElement("line",{x1:5.42178888,y1:2.82998193,x2:-545696821e-21,y2:2.82998193,id:"Path-3"}))));function Ws(e,t){var n=e.title,r=e.titleId,i=As(e,["title","titleId"]);return a.createElement("svg",Ts({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":r},i),n?a.createElement("title",{id:r},n):null,Ms)}var zs=a.forwardRef(Ws);n.p;function qs(){return(qs=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function $s(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Hs=a.createElement("g",{id:"icon/label/icon/equal",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"Group-6",fill:"#EBEFFF"},a.createElement("circle",{id:"Oval",cx:6,cy:6,r:6})),a.createElement("g",{id:"Group",transform:"translate(4.000000, 4.000000)",stroke:"#5F668A",strokeLinecap:"square"},a.createElement("line",{x1:0,y1:1,x2:4,y2:1,id:"Line-12"}),a.createElement("line",{x1:0,y1:3,x2:4,y2:3,id:"Line-12"})));function Vs(e,t){var n=e.title,r=e.titleId,i=$s(e,["title","titleId"]);return a.createElement("svg",qs({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":r},i),n?a.createElement("title",{id:r},n):null,Hs)}var Us=a.forwardRef(Vs);n.p;function Gs(){return(Gs=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Xs(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var _s=a.createElement("g",{id:"icon/label/icon/up",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"Group-6"},a.createElement("circle",{id:"Oval",fill:"#ECFBEF",cx:6,cy:6,r:6}),a.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"},a.createElement("polyline",{id:"Path-2",points:"3.15780333 -4.54747351e-13 6.15780333 2.82998193 3.15780333 5.65996386"}),a.createElement("line",{x1:5.42178888,y1:2.82998193,x2:-545696821e-21,y2:2.82998193,id:"Path-3"}))));function Zs(e,t){var n=e.title,r=e.titleId,i=Xs(e,["title","titleId"]);return a.createElement("svg",Gs({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":r},i),n?a.createElement("title",{id:r},n):null,_s)}var Ks,Qs=a.forwardRef(Zs),Ys=(n.p,n(964)),Js=n(965),ed=n(849),td=function(e){var t=Intl.DateTimeFormat().resolvedOptions().timeZone;return Object(Ys.a)(t,e)},nd=function(e,t){var n=Intl.DateTimeFormat().resolvedOptions().timeZone;return Object(Js.a)(t,Object(Ys.a)(n,e))},ad=function(e,t,n){var a=Intl.DateTimeFormat().resolvedOptions().timeZone,r=Object(Js.a)(t,Object(Ys.a)(a,e));return Object(ed.a)(n,r)},rd=function(e,t){return Object(ed.a)(t,e)},id={wrapper:{display:"flex",height:130,marginTop:-8},percentageBox:{height:130,borderRadius:4,display:"flex",alignItems:"center",justifyContent:"center",whiteSpace:"pre"},label:{color:K},inColor:{backgroundColor:_},outColor:{backgroundColor:Z},other:{minWidth:"6px",borderRadius:2},inWidth:{width:function(e){return"".concat(e,"%")}},outWidth:{width:function(e){return"".concat(100-e,"%")},marginRight:4}},od=Object(f.a)(id),ld=function(e){var t,n=e.cashIn,a=e.cashOut,r=n||0!==a?n:50,i=od(r),o=function(e){if(!(e<=15))return Object(Me.jsxs)(et,{className:i.label,children:[e,"%"]})},l=(t={},Object(z.a)(t,i.percentageBox,!0),Object(z.a)(t,i.other,r<5&&r>0),t);return Object(Me.jsxs)("div",{className:i.wrapper,children:[Object(Me.jsx)("div",{className:I()(l,i.outColor,i.outWidth),children:o(100-r)}),Object(Me.jsx)("div",{className:I()(l,i.inColor,i.inWidth),children:o(r)})]})},cd=n(28),sd=n(850),dd=n(272),ud=n(851),md=function(e){var t=e.cashInFee?Number.parseFloat(e.cashInFee):0;return Number.parseFloat(e.commissionPercentage)*Number.parseFloat(e.fiat)+t},hd=function(e,t,n){return{created:new Date(new Date(e.created).getTime()+t).toISOString(),profit:n}},pd=function(e){var t=e.created;return new Date(t).toISOString().substring(0,10)},bd=function(e){var t=e.created;return new Date(t).toISOString().substring(0,13)},fd=function(e,t){var n=e.profit||0;return Object(s.a)(Object(s.a)({},t),{},{profit:n+md(t)})},jd={Day:864e5,Week:6048e5,Month:2592e6},gd=function(e){var t=e.data,n=e.previousTimeData,r=e.previousProfit,i=e.timeFrame,o=Object(a.useRef)(),c=Object(a.useCallback)((function(){var e=cd.select(o.current),a=0,c=0,s=0,d=336-s-c,u=128-a-0,m=function(){var e="Day"===i?bd:pd,a=sd.a(dd.a(fd,[],e,t));if(!a.length&&!n.length){var o={created:(new Date).toISOString(),profit:0};return[[o,hd(o,-36e5,0)],!0]}if(!a.length&&n.length){var l={created:(new Date).toISOString(),profit:0};return[[l,hd(l,-jd[i],1)],!1]}if(a.length&&!n.length){var c={created:(new Date).toISOString(),profit:1};return[[c,hd(c,-jd[i],0)],!1]}return 1===a.length?[ud.a({created:new Date(Date.now()-jd[i]).toISOString(),profit:r},a),!1]:[a,!1]}(),h=Object(l.a)(m,2),p=h[0],b=h[1];e.attr("width",d),e.append("rect").attr("x",0).attr("y",-a).attr("width",d+s+c).attr("height",u+a).attr("fill",ae).attr("transform","translate(".concat(0,",",a,")")),e.append("linearGradient").attr("id","area-gradient").attr("gradientUnits","userSpaceOnUse").attr("x1",0).attr("y1",0).attr("x2",0).attr("y2","100%").selectAll("stop").data([{offset:"0%",color:G},{offset:"25%",color:G},{offset:"100%",color:ae}]).enter().append("stop").attr("offset",(function(e){return e.offset})).attr("stop-color",(function(e){return e.color}));var f=e.append("g").attr("transform","translate(".concat(s,",").concat(a,")")),j=cd.extent(p,(function(e){return e.created})),g=b?[0,.1]:[0,cd.max(p,(function(e){return e.profit}))],O=cd.scaleLinear().range([u,30]).domain([0,g[1]]),x=cd.scaleTime().domain([new Date(j[0]),new Date(j[1])]).range([0,d]),v=cd.line().x((function(e){return x(new Date(e.created))})).y((function(e){return O(e.profit)})),y=cd.area().x((function(e){return x(new Date(e.created))})).y0(u).y1((function(e){return O(e.profit)}));f.append("path").datum(p).attr("d",y).attr("fill","url(#area-gradient)"),f.append("path").datum(p).attr("d",v).attr("fill","none").attr("stroke-width","2").attr("stroke-linejoin","round").attr("stroke",J)}),[t,i,n,r]);return Object(a.useEffect)((function(){cd.select(o.current).selectAll("*").remove(),c()}),[c,t]),Object(Me.jsx)(Me.Fragment,{children:Object(Me.jsx)("svg",{ref:o})})},Od=n(954),xd=function(e){var t=e.data,n=e.timeFrame,r=e.timezone,i=Object(a.useRef)(),o=Object(a.useCallback)((function(){var e=cd.select(i.current),a=25,o=15,l=555-o-0,c=150-a-25;e.attr("width",l),e.append("rect").attr("x",0).attr("y",0).attr("width",l).attr("height",c+a).attr("fill",ae);var s=e.append("g").attr("transform","translate(".concat(o,",").concat(a,")")),d=function(){if(0===t.length)return 100;var e=100*Math.ceil(cd.max(t,(function(e){return parseFloat(e.fiat)}))/100),n=Math.max(100,e);return n%1e3===0?n+100:n}(),u=function(){switch(n){case"Week":return{nice:7,ticks:7,subtractDays:7,timeRange:[50,500]};case"Month":return{nice:6,ticks:6,subtractDays:30,timeRange:[50,500]};default:return{nice:null,ticks:4,subtractDays:1,timeRange:[50,500]}}}(),m=cd.scaleLinear().range([c,0]).domain([0,d]).nice(3),h=cd.scaleTime().domain([Object(Od.a)({days:-u.subtractDays},new Date).valueOf(),(new Date).valueOf()]).range(u.timeRange).nice(u.nice);s.append("g").style("color","#eef1ff").call(cd.axisLeft(m).ticks(4).tickSize(-l).tickFormat("")).call((function(e){return e.select(".domain").remove()})),s.append("g").attr("transform","translate(0,"+c+")").style("font-size","13px").style("color","#5f668a").style("font-family","MuseoSans").style("margin-top","11px").call(cd.axisBottom(h).ticks(u.ticks).tickSize(0).tickFormat((function(e){switch(n){case"Week":return cd.timeFormat("%a %d")(e);case"Month":return cd.timeFormat("%b %d")(e);default:return ad(e,r,"HH:mm")}}))).selectAll("text").attr("dy","1.5em"),s.append("g").attr("transform","translate(0,"+c+")").style("color","#eef1ff").call(cd.axisBottom(h).ticks(6).tickSize(0).tickFormat("")).selectAll("text").attr("dy","1.5em"),s.append("g").style("font-size","13px").style("color","#5f668a").style("font-family","MuseoSans").style("margin-top","11px").call(cd.axisLeft(m).ticks(4).tickSize(0)).call((function(e){return e.select(".domain").remove()})).selectAll("text").attr("dy","-0.40em").attr("dx","3em"),e.append("g").attr("transform","translate(".concat(o,",").concat(a,")")).selectAll("circle").data(t).enter().append("circle").attr("cx",(function(e){return function(e){var t=td(e);return h(t.valueOf())}(e.created)})).attr("cy",(function(e){return m(e.fiat)})).attr("r",4).style("fill",(function(e){return"cashIn"===e.txClass?_:Z}))}),[t,n,r]);return Object(a.useEffect)((function(){cd.select(i.current).selectAll("*").remove(),o()}),[o]),Object(Me.jsx)(Me.Fragment,{children:Object(Me.jsx)("svg",{ref:i})})},vd=function(e){var t=e.info,n=e.label;return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(_e,{style:{marginBottom:0},children:t}),Object(Me.jsx)(et,{style:{margin:0},children:n})]})},yd=n(103),wd={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:fe,fontWeight:700,color:ce},percentUp:{fontSize:Oe,fontFamily:fe,fontWeight:700,color:U,height:10},percentDown:{fontSize:Oe,fontFamily:fe,fontWeight:700,color:Q,height:13},percentNeutral:{fontSize:Oe,fontFamily:fe,fontWeight:700,color:$},profitContainer:{display:"flex",justifyContent:"space-between",margin:"0 26px -30px 16px",position:"relative"},gridContainer:{marginTop:30,height:225},inSquare:{width:8,height:8,borderRadius:2,marginTop:18,marginRight:4,backgroundColor:_},outSquare:{width:8,height:8,borderRadius:2,marginTop:18,marginRight:4,backgroundColor:Z},directionLabelContainer:{display:"flex"},dirLabContMargin:{marginRight:20},directionIcon:{width:16,height:16,marginBottom:-2,marginRight:4},labelMargin:{marginBottom:20,marginRight:32},emptyTransactions:{paddingTop:40}},Cd=Object(f.a)(wd),kd=["Month","Week","Day"],Ed=function(e){var t=e.handleSetRange,n=e.showPicker,r=Cd(),i=Object(a.useState)("Day"),o=Object(l.a)(i,2),c=o[0],s=o[1],d=yd.a(c);return Object(Me.jsxs)("div",{className:I()(r.titleWrapper),children:[Object(Me.jsx)("div",{className:r.titleAndButtonsContainer,children:Object(Me.jsx)(Ue,{className:r.h4,children:"System performance"})}),n&&Object(Me.jsx)("div",{className:r.navContainer,children:kd.map((function(e,n){return Object(Me.jsx)("div",{onClick:function(e){return n=e.target.innerText,s(n),void t(n);var n},className:d(e)?I()(r.newHighlightedLabel,r.navButton):I()(r.label,r.navButton),children:e},n)}))})]})};Mc.a.config({ROUNDING_MODE:Mc.a.ROUND_HALF_UP});var Nd=R.a(B.a("fiat")),Sd=Object(f.a)(wd),Id=R.a(B.a("cashInFee")),Fd=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=t?new Date(t):new Date;return Object(ds.a)({seconds:e},n)},Ld={Day:{left:Fd(172800,new Date),right:Fd(86400,new Date)},Week:{left:Fd(1209600,new Date),right:Fd(604800,new Date)},Month:{left:Fd(5184e3,new Date),right:Fd(2592e3,new Date)}},Pd=x()(Ks||(Ks=Object(c.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"]))),Dd=function(e,t){return e+Number.parseFloat(t.commissionPercentage)*Number.parseFloat(t.fiat)},Rd=function(){var e,t,n,r=Sd(),i=Object(a.useState)("Day"),o=Object(l.a)(i,2),c=o[0],d=o[1],m=Object(u.c)(Pd),p=m.data,b=m.loading,f=rs("locale")(null===p||void 0===p?void 0:p.config).fiatCurrency,j=rs("locale")(null===p||void 0===p?void 0:p.config).timezone,g=function(e){return function(t){return null===t.error&&(e?null===t.error&&Object(us.a)(Ld[c].left,nd(t.created,j))&&Object(us.a)(nd(t.created,j),Ld[c].right):null===t.error&&Object(us.a)(Ld[c].right,nd(t.created,j))&&Object(us.a)(nd(t.created,j),new Date))}},O=function(e){if(e.fiatCode===f)return e;var t=Aa.a(W.a("code",e.fiatCode))(p.fiatRates),n=Aa.a(W.a("code",f))(p.fiatRates).rate/t.rate;return Object(s.a)(Object(s.a)({},e),{},{fiat:parseFloat(e.fiat)*n})},x=R.a(O)(M.a(g(!1),null!==(e=null===p||void 0===p?void 0:p.transactions)&&void 0!==e?e:[])),v=R.a(O)(M.a(g(!0),null!==(t=null===p||void 0===p?void 0:p.transactions)&&void 0!==t?t:[])),y=function(e){var t=ms.a(Id(e)),n=hs.a(Dd,0,e);return new Mc.a(n+t)},w=function(){var e=ps.a(W.a("txClass","cashIn"))(x),t=Object(l.a)(e,2),n=t[0],a=t[1],r=n.length+a.length;return 0===r?{cashIn:0,cashOut:0}:{cashIn:Math.round(n.length/r*100),cashOut:Math.round(a.length/r*100)}},C=function(){var e=y(x),t=y(v);return e.eq(t)?0:t.eq(0)?100:e.minus(t).times(100).div(t).toNumber()}(),k=(n={},Object(z.a)(n,r.percentDown,C<0),Object(z.a)(n,r.percentUp,C>0),Object(z.a)(n,r.percentNeutral,0===C),n);return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Ed,{showPicker:!b&&!Wa.a(p.transactions),handleSetRange:d}),!b&&Wa.a(p.transactions)&&Object(Me.jsx)(ys,{className:r.emptyTransactions,message:"No transactions so far"}),!b&&!Wa.a(p.transactions)&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)(h.a,{container:!0,spacing:2,children:[Object(Me.jsx)(h.a,{item:!0,xs:3,children:Object(Me.jsx)(vd,{info:gn.a(x),label:"transactions"})}),Object(Me.jsx)(h.a,{item:!0,xs:3,children:Object(Me.jsx)(vd,{info:new Mc.a(ms.a(Nd(x))).toFormat(2),label:"".concat(null===p||void 0===p?void 0:p.config.locale_fiatCurrency," volume")})})]}),Object(Me.jsx)(h.a,{container:!0,className:r.gridContainer,children:Object(Me.jsxs)(h.a,{item:!0,xs:12,children:[Object(Me.jsx)(tt,{children:"Transactions"}),Object(Me.jsx)(xd,{timeFrame:c,data:x,timezone:j})]})}),Object(Me.jsxs)(h.a,{container:!0,className:r.gridContainer,children:[Object(Me.jsxs)(h.a,{item:!0,xs:8,children:[Object(Me.jsx)(tt,{className:r.labelMargin,children:"Profit from commissions"}),Object(Me.jsxs)("div",{className:r.profitContainer,children:[Object(Me.jsx)("div",{className:r.profitLabel,children:"".concat(y(x).toFormat(2)," ").concat(null===p||void 0===p?void 0:p.config.locale_fiatCurrency)}),Object(Me.jsxs)("div",{className:I()(k),children:[0===C?Object(Me.jsx)(Us,{className:r.directionIcon}):C>0?Object(Me.jsx)(Qs,{className:r.directionIcon}):Object(Me.jsx)(zs,{className:r.directionIcon}),"".concat(new Mc.a(C).toFormat(2),"%")]})]}),Object(Me.jsx)(gd,{timeFrame:c,data:x,previousTimeData:v,previousProfit:y(v)})]}),Object(Me.jsxs)(h.a,{item:!0,xs:4,children:[Object(Me.jsxs)(h.a,{container:!0,children:[Object(Me.jsx)(h.a,{item:!0,children:Object(Me.jsx)(tt,{className:r.labelMargin,children:"Direction"})}),Object(Me.jsxs)(h.a,{item:!0,className:I()(r.directionLabelContainer,r.dirLabContMargin),children:[Object(Me.jsx)("div",{className:r.outSquare}),Object(Me.jsx)(et,{className:r.directionLabel,children:"Out"})]}),Object(Me.jsxs)(h.a,{item:!0,className:r.directionLabelContainer,children:[Object(Me.jsx)("div",{className:r.inSquare}),Object(Me.jsx)(et,{className:r.directionLabel,children:"In"})]})]}),Object(Me.jsx)(h.a,{item:!0,xs:!0,children:Object(Me.jsx)(ld,{cashIn:w().cashIn,cashOut:w().cashOut})})]})]})]})]})},Bd=Object(f.a)(Tc),Td=function(){var e=Bd();return Object(Me.jsx)(h.a,{item:!0,xs:12,className:e.displayFlex,children:Object(Me.jsx)("div",{className:e.card,children:Object(Me.jsx)(Rd,{})})})},Ad=n(854),Md=Object.freeze({DEFAULT:"default",SHRUNK:"shrunk",EXPANDED:"expanded"}),Wd={card:{wordWrap:"break-word",boxShadow:"0 0 4px 0 rgba(0, 0, 0, 0.08)",borderRadius:12,padding:24,backgroundColor:K}},zd=Object(f.a)(Wd),qd=function(e){var t=e.className,n=e.state,a=e.shrunkComponent,r=e.children,i=zd();return Object(Me.jsx)(h.a,{item:!0,className:I()(t,i.card),children:n===Md.SHRUNK?a:r})},$d={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:$,marginLeft:-5,height:100},table:{maxHeight:465,overflowX:"hidden",overflowY:"auto"},listItemText:{margin:"8px 0 8px 0"},linkIcon:{marginLeft:"auto",cursor:"pointer"}},Hd=n(834),Vd=n(788),Ud=n(110);function Gd(){return(Gd=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Xd(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var _d=a.createElement("desc",null,"Created with Sketch."),Zd=a.createElement("g",{id:"icon/button/link/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"Group-7",stroke:"#1B2559",strokeWidth:1.2},a.createElement("polyline",{id:"Stroke-1",points:"12 6.66678 12 12.00018 0 12.00018 0 0.00018 5.3334 0.00018"}),a.createElement("polyline",{id:"Stroke-3",points:"8.66658 0 12.00018 0 12.00018 3.3336"}),a.createElement("line",{x1:6,y1:6,x2:12,y2:0,id:"Stroke-5"})));function Kd(e,t){var n=e.title,r=e.titleId,i=Xd(e,["title","titleId"]);return a.createElement("svg",Gd({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":r},i),n?a.createElement("title",{id:r},n):null,_d,Zd)}var Qd=a.forwardRef(Kd);n.p;function Yd(){return(Yd=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Jd(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var eu=a.createElement("g",{id:"DASHBOARD",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"dashboard_v9#1-(week)",transform:"translate(-772.000000, -212.000000)"},a.createElement("g",{id:"dashboard/row/alert/positive",transform:"translate(756.000000, 204.000000)"},a.createElement("g",{id:"Group-2",transform:"translate(16.000000, 8.000000)"},a.createElement("polygon",{id:"Rectangle-2-Copy-45",fill:"#FF584A",fillRule:"nonzero",points:"0 11 16 11 16 16 0 16"}),a.createElement("rect",{id:"Rectangle-Copy-10",stroke:"#FF584A",strokeWidth:2,x:1,y:1,width:14,height:14})))));function tu(e,t){var n=e.title,r=e.titleId,i=Jd(e,["title","titleId"]);return a.createElement("svg",Yd({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":r},i),void 0===n?a.createElement("title",{id:r},"07E3DD15-D5E4-46A8-BF7B-064F598230CE"):n?a.createElement("title",{id:r},n):null,eu)}var nu,au=a.forwardRef(tu),ru=(n.p,Object(f.a)($d)),iu={error:Object(Me.jsx)(tn,{style:{height:20,width:20,marginRight:12}}),fiatBalance:Object(Me.jsx)(au,{style:{height:18,width:18,marginRight:14}})},ou={error:"/maintenance/machine-status",fiatBalance:"/maintenance/cash-cassettes",cryptoBalance:"/maintenance/funding"},lu=function(e){var t=e.numToRender,n=e.alerts,a=e.machines,r=Object(w.h)(),i=ru(),o=Ud.a(0,t,n),l=function(e){var t=e.detail.deviceId;if(!t)return"".concat(e.message);var n=za.a("Unpaired device",a[t]);return"".concat(e.message," - ").concat(n)};return Object(Me.jsx)(Hd.a,{dense:!0,className:i.table,children:o.map((function(e,t){return Object(Me.jsxs)(Vd.a,{children:[iu[e.type]||Object(Me.jsx)(Bt,{style:{height:23,width:23,marginRight:8}}),Object(Me.jsx)(Xe,{className:i.listItemText,children:l(e)}),Object(Me.jsx)(Qd,{className:i.linkIcon,onClick:function(){return r.push(ou[e.type]||"/dashboard")}})]},t)}))})},cu=x()(nu||(nu=Object(c.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"]))),su=Object(f.a)($d),du=function(e){var t,n,a,r=e.onReset,i=e.onExpand,o=e.size,l=su(),c=o===Md.EXPANDED,s=Object(u.c)(cu).data,d=null!==(t=A.a(["alerts"])(s))&&void 0!==t?t:[],m=L.a(R.a(B.a("name")),T.a(B.a("deviceId")))(null!==(n=null===s||void 0===s?void 0:s.machines)&&void 0!==n?n:[]),p=d.length,b=(a={},Object(z.a)(a,l.alertsTableContainer,!c),Object(z.a)(a,l.expandedAlertsTableContainer,c),a);return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)("div",{className:l.container,children:[Object(Me.jsx)(Ue,{className:l.h4,children:"Alerts (".concat(p,")")}),c&&Object(Me.jsx)(et,{className:l.upperButtonLabel,children:Object(Me.jsx)(Ad.a,{onClick:r,size:"small",disableRipple:!0,disableFocusRipple:!0,className:l.button,children:"Show less"})})]}),Object(Me.jsx)(h.a,{className:I()(b),container:!0,spacing:1,children:Object(Me.jsxs)(h.a,{item:!0,xs:12,children:[!d.length&&Object(Me.jsx)(et,{className:l.noAlertsLabel,children:"No new alerts. Your system is running smoothly."}),Object(Me.jsx)(lu,{numToRender:c?d.length:3,alerts:d,machines:m})]})}),!c&&p>3&&Object(Me.jsx)(h.a,{item:!0,xs:12,children:Object(Me.jsx)(et,{className:l.centerLabel,children:Object(Me.jsx)(Ad.a,{onClick:function(){return i("alerts")},size:"small",disableRipple:!0,disableFocusRipple:!0,className:l.button,children:"Show all (".concat(d.length,")")})})})]})},uu=n(857),mu=n(861),hu=n(855),pu=n(856),bu=n(858),fu=n(859),ju=n(459),gu=n(860),Ou=n(434),xu=n(862),vu={error:Q,warning:"#ff7311",success:ne,neutral:J},yu={error:Y,warning:"#fbf3ec",success:V,neutral:G},wu=Object(f.a)({root:{borderRadius:4,marginTop:4,marginRight:2,marginBottom:4,marginLeft:2,height:24,backgroundColor:function(e){var t=e.type;return yu[t]}},label:{fontSize:ye,fontWeight:Ee,fontFamily:Ne,paddingRight:4,paddingLeft:4,color:function(e){var t=e.type;return vu[t]}}}),Cu=function(e){var t=e.status,n=wu({type:t.type});return Object(Me.jsx)(Ar.a,{type:t.type,label:t.label,classes:n})},ku=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],a={label:"+".concat(t.length-1),type:n.type};return Object(Me.jsxs)("div",{children:[Object(Me.jsx)(Cu,{status:n}),t.length>1&&Object(Me.jsx)(Cu,{status:a})]})};function Eu(){return(Eu=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Nu(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Su=a.createElement("defs",null,a.createElement("circle",{id:"path-1-right",cx:10,cy:10,r:10})),Iu=a.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"pop-up/action/download-logs/date-range-copy-2",transform:"translate(-232.000000, -187.000000)"},a.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)"},a.createElement("mask",{id:"mask-2",fill:"white"},a.createElement("use",{xlinkHref:"#path-1-right"})),a.createElement("use",{id:"Mask",fill:"#EBEFFF",fillRule:"nonzero",xlinkHref:"#path-1-right"}),a.createElement("g",{id:"icon/sf-small/wizzard",mask:"url(#mask-2)",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{transform:"translate(6.666667, 6.000000)",id:"Group"},a.createElement("g",null,a.createElement("polyline",{id:"Path-3",stroke:"#1B2559",strokeWidth:2,points:"0 4.83333333 3.33333333 8.16666667 6.66666667 4.83333333"}),a.createElement("line",{x1:3.33333333,y1:.25,x2:3.33333333,y2:6.5,id:"Path-4",stroke:"#1B2559",strokeWidth:2})))))));function Fu(e,t){var n=e.title,r=e.titleId,i=Nu(e,["title","titleId"]);return a.createElement("svg",Eu({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":r},i),n?a.createElement("title",{id:r},n):null,Su,Iu)}var Lu,Pu,Du,Ru=a.forwardRef(Fu),Bu=(n.p,{container:{display:"flex",justifyContent:"space-between"},label:{margin:0,color:se},row:{backgroundColor:ae,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}}),Tu=x()(Lu||(Lu=Object(c.a)(["\n query getConfig {\n config\n }\n"]))),Au=Object(f.a)(Bu),Mu=Object(Mr.a)({root:{borderBottom:"4px solid white",padding:0,paddingLeft:15}})(hu.a),Wu=Object(Mr.a)({root:{borderBottom:"4px solid white",padding:0,paddingLeft:15,backgroundColor:"white"}})(hu.a),zu=function(e){var t,n=e.machines,a=void 0===n?[]:n,r=e.numToRender,i=Au(),o=Object(w.h)(),l=Object(u.c)(Tu).data,c=rs("notifications",null!==(t=A.a(["config"],l))&&void 0!==t?t:{}),s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500;return Math.round(e/t*100)},m=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:500,a=s(t,n),r=ju.a(A.a(["fillingPercentageCassette".concat(e)]),za.a(20))(c);return a<r?Object(Me.jsx)(Je,{className:i.error,children:"".concat(a,"%")}):Object(Me.jsx)(Je,{children:"".concat(a,"%")})},h=function(e){var t=e.name,n=e.deviceId;return o.push("/machines/".concat(n),{selectedMachine:t})},p=Math.max.apply(Math,Object(d.a)(R.a((function(e){return e.numberOfCassettes}),a)).concat([0]));return Object(Me.jsx)(pu.a,{className:i.table,children:Object(Me.jsxs)(uu.a,{children:[Object(Me.jsx)(bu.a,{children:Object(Me.jsxs)(fu.a,{children:[Object(Me.jsx)(Wu,{children:Object(Me.jsx)("div",{className:i.header,children:Object(Me.jsx)(tt,{className:i.label,children:"Machines"})})}),Object(Me.jsx)(Wu,{children:Object(Me.jsx)("div",{className:"".concat(i.header," ").concat(i.statusHeader),children:Object(Me.jsx)(tt,{className:i.label,children:"Status"})})}),R.a((function(e){return Object(Me.jsx)(Wu,{children:Object(Me.jsxs)("div",{className:i.header,children:[Object(Me.jsx)(Bc,{}),Object(Me.jsxs)(tt,{className:i.label,children:[" ",e+1]})]})})}),gu.a(Ou.a,p))]})}),Object(Me.jsx)(mu.a,{children:a.map((function(e,t){return t<r?Object(Me.jsxs)(fu.a,{onClick:function(){return h(e)},className:I()(i.row),children:[Object(Me.jsxs)(Mu,{align:"left",className:i.machineNameWrapper,children:[Object(Me.jsx)(Je,{children:e.name}),Object(Me.jsx)(Ru,{className:I()(i.machineRedirectIcon,i.clickableRow),onClick:function(){return h(e)}})]}),Object(Me.jsx)(Mu,{children:Object(Me.jsx)(Cu,{status:e.statuses[0]})}),R.a((function(t){return e.numberOfCassettes>=t?Object(Me.jsx)(Mu,{align:"left",children:m(t,e["cassette".concat(t)])}):Object(Me.jsx)(Mu,{align:"left",children:Object(Me.jsx)(Je,{children:"\u2014 %"})})}),xu.a(1,p+1))]},e.deviceId+t):null}))})]})})},qu=Object(f.a)(Bu),$u=x()(Pu||(Pu=Object(c.a)(["\n query getData {\n machines {\n name\n deviceId\n cashbox\n cassette1\n cassette2\n cassette3\n cassette4\n numberOfCassettes\n statuses {\n label\n type\n }\n }\n serverVersion\n uptime {\n name\n state\n uptime\n }\n }\n"]))),Hu=function(e){var t,n,a=e.onReset,r=e.onExpand,i=e.size,o=qu(),l=Object(u.c)($u),c=l.data,s=l.loading,d=null!==(t=A.a(["machines"])(c))&&void 0!==t?t:[],m=i===Md.EXPANDED,p=(n={},Object(z.a)(n,o.machinesTableContainer,!m),Object(z.a)(n,o.expandedMachinesTableContainer,m),n);return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)("div",{className:o.container,children:[Object(Me.jsx)(Ue,{className:o.h4,children:"System status"})," ",m&&Object(Me.jsx)(et,{className:o.upperButtonLabel,children:Object(Me.jsx)(Ad.a,{onClick:a,size:"small",disableRipple:!0,disableFocusRipple:!0,className:o.button,children:"Show less"})})]}),!s&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)(h.a,{container:!0,spacing:1,children:[Object(Me.jsxs)(h.a,{item:!0,xs:4,children:[Object(Me.jsx)(Je,{className:o.tl2,children:null===c||void 0===c?void 0:c.serverVersion}),Object(Me.jsx)(et,{className:o.label1,children:" server version"})]}),Object(Me.jsx)(h.a,{item:!0,xs:4})]}),Object(Me.jsx)(h.a,{container:!0,spacing:1,className:I()(p),children:Object(Me.jsx)(h.a,{item:!0,xs:12,children:Object(Me.jsx)(zu,{numToRender:m?1/0:4,machines:d})})}),!m&&d.length>4&&Object(Me.jsx)(h.a,{item:!0,xs:12,children:Object(Me.jsx)(et,{className:o.centerLabel,children:Object(Me.jsx)(Ad.a,{onClick:function(){return r()},size:"small",disableRipple:!0,disableFocusRipple:!0,className:o.button,children:"Show all (".concat(d.length,")")})})})]})]})},Vu=Object(f.a)(Tc),Uu=function(e){var t=e.title,n=e.buttonName,a=e.onUnshrink,r=Vu();return Object(Me.jsxs)("div",{className:r.container,children:[Object(Me.jsx)(Ue,{className:r.h4,children:t}),Object(Me.jsx)(et,{className:r.upperButtonLabel,children:Object(Me.jsx)(Ad.a,{onClick:a,size:"small",disableRipple:!0,disableFocusRipple:!0,className:r.button,children:n})})]})},Gu=function(){var e,t,n=Vu(),r=Object(a.useState)(Md.DEFAULT),i=Object(l.a)(r,2),o=i[0],c=i[1],s=Object(a.useState)(Md.DEFAULT),d=Object(l.a)(s,2),u=d[0],m=d[1],p=function(){m(Md.DEFAULT),c(Md.DEFAULT)};return Object(Me.jsx)(h.a,{item:!0,xs:12,className:n.displayFlex,children:Object(Me.jsx)("div",{style:{flex:1,display:"flex",flexDirection:"column"},children:Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(qd,{className:I()((e={},Object(z.a)(e,n.alertsCard,u!==Md.SHRUNK),Object(z.a)(e,n.shrunkCard,u===Md.SHRUNK),Object(z.a)(e,n.expandedCard,u===Md.EXPANDED),e)),state:u,shrunkComponent:Object(Me.jsx)(Uu,{title:"Alerts",buttonName:"Show alerts",onUnshrink:p}),children:Object(Me.jsx)(du,{onExpand:function(){m(Md.EXPANDED),c(Md.SHRUNK)},onReset:p,size:u})}),Object(Me.jsx)(qd,{className:I()((t={},Object(z.a)(t,n.shrunkCard,o===Md.SHRUNK),Object(z.a)(t,n.systemStatusCard,o!==Md.SHRUNK),Object(z.a)(t,n.expandedCard,u===Md.EXPANDED),t)),state:o,shrunkComponent:Object(Me.jsx)(Uu,{title:"System status",buttonName:"Show machines",onUnshrink:p}),children:Object(Me.jsx)(Hu,{onExpand:function(){c(Md.EXPANDED),m(Md.SHRUNK)},onReset:p,size:o})})]})})})},Xu=Object(f.a)(Tc),_u=x()(Du||(Du=Object(c.a)(["\n query getData {\n machines {\n name\n }\n serverVersion\n }\n"]))),Zu=function(){var e=Object(w.h)(),t=Xu(),n=Object(a.useState)(!1),r=Object(l.a)(n,2),i=r[0],o=r[1],c=Object(u.c)(_u),s=c.data;return c.loading?Object(Me.jsx)(Me.Fragment,{}):Wa.a(s.machines)?Object(Me.jsxs)(Me.Fragment,{children:[i&&Object(Me.jsx)(eo,{close:function(){return o(!1)},onPaired:function(t){o(!1),e.push("/maintenance/machine-status",{id:t.deviceId})}}),Object(Me.jsx)(nl,{title:"Dashboard",children:Object(Me.jsx)("div",{className:t.headerLabels,children:Object(Me.jsxs)("span",{children:[Object(Me.jsx)(Je,{className:t.inline,children:null===s||void 0===s?void 0:s.serverVersion})," ",Object(Me.jsx)(et,{className:t.inline,children:" server version"})]})})}),Object(Me.jsx)("div",{className:t.emptyMachinesRoot,children:Object(Me.jsxs)("div",{className:t.emptyMachinesContent,children:[Object(Me.jsx)($e,{className:t.offColor,children:"No machines on your system yet"}),Object(Me.jsx)(Ze,{className:t.offColor,children:"To fully take advantage of Lamassu Admin, add a new machine to your system"}),Object(Me.jsx)(An,{onClick:function(){return o(!0)},children:"+ Add new machine"})]})}),Object(Me.jsx)(ss,{})]}):Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(nl,{title:"Dashboard",children:Object(Me.jsx)("div",{className:t.headerLabels,children:Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)("div",{className:I()(t.headerLabelContainer,t.headerLabelContainerMargin),children:[Object(Me.jsx)(Bc,{}),Object(Me.jsx)("span",{className:t.headerLabelSpan,children:"Cash-out"})]}),Object(Me.jsxs)("div",{className:t.headerLabelContainer,children:[Object(Me.jsx)(Sc,{}),Object(Me.jsx)("span",{className:t.headerLabelSpan,children:"Cash-in"})]})]})})}),Object(Me.jsx)("div",{className:t.root,children:Object(Me.jsxs)(h.a,{container:!0,children:[Object(Me.jsx)(h.a,{container:!0,direction:"column",item:!0,xs:6,children:Object(Me.jsx)(Td,{})}),Object(Me.jsx)(h.a,{container:!0,direction:"column",item:!0,xs:6,children:Object(Me.jsx)(Gu,{})})]})}),Object(Me.jsx)(ss,{})]})},Ku=n(933),Qu=n(208),Yu=n.n(Qu),Ju=n(876),em=n(877),tm=n(878),nm=n(445),am=n(872),rm=n(940),im=n(870),om=n(193),lm=n(871),cm=n(935),sm="You have unsaved changes on this page. Are you sure you want to leave?",dm=function(e){var t=e.message,n=void 0===t?sm:t,r=Object(bn.f)(),i=r.dirty&&0===r.submitCount;Object(a.useEffect)((function(){window.onbeforeunload=i?o:void 0}),[i]);var o=function(){return sm};return Object(Me.jsx)(w.a,{when:i,message:n})},um=n(863),mm=n(864),hm=Be.tl2,pm=Be.label1,bm={size:function(e){var t=e.size;return Ha(t)},bold:Va,header:{extend:hm,backgroundColor:Le,height:Se,textAlign:"left",color:K,display:"flex",alignItems:"center"},doubleHeader:{extend:hm,backgroundColor:Le,height:Fe,color:K,display:"table-row"},thDoubleLevel:function(e){return{width:e.width,display:"table-cell","& > :first-child":{margin:[[0,10]],extend:pm,fontWeight:700,display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:se,color:K,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:Be.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}},fm=Object(f.a)(bm),jm=function(e){var t=e.children,n=e.className,a=Object(q.a)(e,["children","className"]);return Object(Me.jsx)("div",Object(s.a)(Object(s.a)({className:I()(n)},a),{},{children:t}))},gm=function(e){var t=e.children,n=e.className,a=fm();return Object(Me.jsx)("div",{className:I()(n,a.header),children:t})},Om=function(e){var t=e.children,n=e.className,a=fm();return Object(Me.jsx)("div",{className:I()(n,a.doubleHeader),children:t})},xm=function(e){var t=e.children,n=e.className;return Object(Me.jsx)("div",{className:I()(n),children:t})},vm=function(e){var t,n=e.children,a=e.header,r=e.className,i=e.width,o=void 0===i?100:i,l=e.size,c=e.bold,s=e.textAlign,d=e.action,u=fm({textAlign:s,width:o,size:l}),m=(t={},Object(z.a)(t,u.td,!0),Object(z.a)(t,u.tdHeader,a),Object(z.a)(t,u.actionCol,d),Object(z.a)(t,u.size,!a),Object(z.a)(t,u.bold,!a&&c),t);return Object(Me.jsx)("div",{className:I()(r,m),children:n})},ym=function(e){var t=e.children,n=Object(q.a)(e,["children"]);return Object(Me.jsx)(vm,Object(s.a)(Object(s.a)({header:!0},n),{},{children:t}))},wm=function(e){var t=e.title,n=e.children,a=e.className,r=e.width,i=fm({width:r});return Object(Me.jsxs)("div",{className:I()(a,i.thDoubleLevel),children:[Object(Me.jsx)("div",{children:t}),Object(Me.jsx)("div",{children:n})]})},Cm=function(e){var t,n=e.onClick,a=e.error,r=e.errorMessage,i=e.shouldShowError,o=e.children,l=e.className,c=e.size,s=e.newRow,d=fm({size:c}),u={root:d.cardContentRoot},m=(t={},Object(z.a)(t,d.tr,!0),Object(z.a)(t,d.trError,a),Object(z.a)(t,d.card,!0),Object(z.a)(t,d.trAdding,s),Object(z.a)(t,"className",l),t);return Object(Me.jsx)(Me.Fragment,{children:Object(Me.jsx)(um.a,{className:I()(m,l),onClick:n,children:Object(Me.jsxs)(mm.a,{classes:u,children:[Object(Me.jsx)("div",{className:d.mainContent,children:o}),a&&i&&Object(Me.jsx)("div",{className:d.errorContent,children:r})]})})})},km=r.a.createContext(),Em=n(866),Nm=n(867),Sm=n(865),Im=n(264),Fm=Im.create({checkTypes:!1,env:Im.env}),Lm=Fm.compose(Fm.joinWith(""))($c.a(0,Fm.toLower)),Pm=Fm.compose(Fm.joinWith(""))($c.a(0,Fm.toUpper)),Dm=Fm.compose(Pm)(Fm.toLower),Rm=L.a(Fm.splitOn(" "),Sm.a(/([A-Z])/g," $1"),Lm),Bm=L.a(Fm.joinWith(" "),Fm.map(Dm),Rm),Tm=function(e,t,n){return 1===parseInt(e)?t:n},Am=function(){var e=Object(a.useContext)(km),t=e.elements,n=e.enableEdit,r=e.enableEditText,i=e.editWidth,o=e.enableDelete,c=e.deleteWidth,s=e.enableToggle,d=e.toggleWidth,u=e.DEFAULT_COL_SIZE,m=function(e,t){var n=e.name,a=e.width,r=void 0===a?u:a,i=e.header,o=e.textAlign;return Object(Me.jsx)(vm,{header:!0,width:r,textAlign:o,children:i||Bm(n)},t)},h=function(e){var t=ps.a(il.a("doubleHeader"))(e),n=Object(l.a)(t,2),a=n[0],r=n[1];if(!a.length)return[e,gm];var i=Em.a(a[0],e),o=L.a(ms.a,R.a(A.a(["width"])))(a);return[Nm.a(i,{width:o,elements:a,name:a[0].doubleHeader},r),Om]}(t),p=Object(l.a)(h,2),b=p[0],f=p[1];return Object(Me.jsxs)(f,{children:[b.map((function(e,t){var n=e.width,a=e.elements,r=e.name;return a&&a.length?Object(Me.jsx)(wm,{width:n,title:r,children:a.map(m)},t):m(e,t)})),n&&Object(Me.jsx)(vm,{header:!0,width:i,textAlign:"center",children:null!==r&&void 0!==r?r:"Edit"}),o&&Object(Me.jsx)(vm,{header:!0,width:c,textAlign:"center",children:"Delete"}),s&&Object(Me.jsx)(vm,{header:!0,width:d,textAlign:"center",children:"Enable"})]})},Mm=n(869),Wm=n(868),zm=Object(f.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}}),qm=function(e){var t=e.children,n=e.close,a=zm();return Object(Me.jsxs)("div",{className:a.titleSection,children:[t,n&&Object(Me.jsx)(ta,{size:16,"aria-label":"close",onClick:n,className:a.closeButton,children:Object(Me.jsx)(Bi,{})})]})},$m=function(e){var t=e.title,n=void 0===t?"Confirm Delete":t,a=e.open,r=void 0!==a&&a,i=e.onConfirmed,o=e.onDismissed,l=e.item,c=void 0===l?"item":l,s=e.confirmationMessage,d=void 0===s?"Are you sure you want to delete this ".concat(c,"?"):s,u=e.errorMessage,m=void 0===u?"":u,h=zm();return Object(Me.jsxs)(un.a,{open:r,"aria-labelledby":"form-dialog-title",children:[Object(Me.jsx)(qm,{close:function(){return o()},children:Object(Me.jsx)(Ue,{className:h.title,children:n})}),m&&Object(Me.jsx)(qm,{children:Object(Me.jsx)(Jo,{children:m.split(":").map((function(e){return Object(Me.jsxs)(Me.Fragment,{children:[e,Object(Me.jsx)("br",{})]})}))})}),Object(Me.jsx)(mn.a,{className:h.content,children:d&&Object(Me.jsx)(Xe,{children:d})}),Object(Me.jsx)(Wm.a,{className:h.actions,children:Object(Me.jsx)(An,{onClick:i,children:"Confirm"})})]})},Hm=n(458);function Vm(){return(Vm=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Um(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Gm=a.createElement("desc",null,"Created with Sketch."),Xm=a.createElement("defs",null,a.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"})),_m=a.createElement("g",{id:"Styleguide",stroke:"none",strokeWidth:1,fillRule:"evenodd"},a.createElement("g",{id:"icon/action/arrow/regular"},a.createElement("mask",{id:"mask-2",fill:"white"},a.createElement("use",{xlinkHref:"#path-1"})),a.createElement("use",{id:"Mask",fillRule:"nonzero",xlinkHref:"#arrow-path"})));function Zm(e,t){var n=e.title,r=e.titleId,i=Um(e,["title","titleId"]);return a.createElement("svg",Vm({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":r},i),n?a.createElement("title",{id:r},n):null,Gm,Xm,_m)}var Km=a.forwardRef(Zm),Qm=(n.p,Be.p),Ym=152,Jm={selectedItem:{width:111,display:"block",whiteSpace:"nowrap",overflow:"hidden"},select:{width:Ym,zIndex:2,"& label":{extend:Be.label1,color:se,paddingLeft:10},"& button":{extend:Qm,position:"relative",border:0,backgroundColor:re,width:Ym,padding:[[6,0,6,12]],borderRadius:20,lineHeight:"1.14",textAlign:"left",color:se,cursor:"pointer",outline:"0 none"},"& ul":{maxHeight:"200px",width:Ym,overflowY:"auto",position:"absolute",margin:0,borderTop:0,padding:0,borderRadius:[[0,0,8,8]],backgroundColor:re,outline:"0 none","& li":{extend:Qm,listStyleType:"none",padding:[[6,12]],cursor:"pointer","& span":{width:"100%",display:"block",overflow:"hidden",whiteSpace:"nowrap"}},"& li:hover":{backgroundColor:se,color:K}},"& svg":{position:"absolute",top:12,right:14,fill:se}},selectFiltered:{"& button":{backgroundColor:se,color:K},"& ul":{"& li":{backgroundColor:se,color:K},"& li:hover":{backgroundColor:re,color:se}},"& svg":{fill:[[K],"!important"]}},open:{"& button":{borderRadius:[[8,8,0,0]]}}},eh=Object(f.a)(Jm);var th=function(e){var t,n=e.className,a=e.label,r=e.items,i=Object(q.a)(e,["className","label","items"]),o=eh(),l=Object(Hm.a)({items:r,selectedItem:i.selectedItem,onSelectedItemChange:function(e){i.onSelectedItemChange(e.selectedItem)}}),c=l.isOpen,d=l.selectedItem,u=l.getToggleButtonProps,m=l.getLabelProps,h=l.getMenuProps,p=l.getItemProps,b=(t={},Object(z.a)(t,o.select,!0),Object(z.a)(t,o.selectFiltered,d!==i.default),Object(z.a)(t,o.open,c),t);return Object(Me.jsxs)("div",{className:I()(b,n),children:[Object(Me.jsx)("label",Object(s.a)(Object(s.a)({},m()),{},{children:a})),Object(Me.jsxs)("button",Object(s.a)(Object(s.a)({},u()),{},{children:[Object(Me.jsx)("span",{className:o.selectedItem,children:d.display}),Object(Me.jsx)(Km,{})]})),Object(Me.jsx)("ul",Object(s.a)(Object(s.a)({},h()),{},{children:c&&r.map((function(e,t){var n=e.code,a=e.display;return Object(Me.jsx)("li",Object(s.a)(Object(s.a)({},p({code:n,index:t})),{},{children:Object(Me.jsx)("span",{children:a})}),"".concat(n).concat(t))}))}))]})};function nh(){return(nh=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function ah(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var rh=a.createElement("defs",null,a.createElement("path",{id:"a",d:"M0 0h22v22H0z"})),ih=a.createElement("g",{fill:"none",fillRule:"evenodd"},a.createElement("mask",{id:"b",fill:"#fff"},a.createElement("use",{xlinkHref:"#a"})),a.createElement("path",{stroke:"#9B9B9B",strokeWidth:2,strokeLinecap:"round",mask:"url(#b)",d:"M9 9v9M13 9v9"}),a.createElement("g",{mask:"url(#b)",stroke:"#9B9B9B",strokeLinecap:"round",strokeWidth:2},a.createElement("path",{strokeLinejoin:"round",d:"M3 6l2 15h12l2-15"}),a.createElement("path",{d:"M1 5h20M14 4a3 3 0 10-6 0"})));function oh(e,t){var n=e.title,r=e.titleId,i=ah(e,["title","titleId"]);return a.createElement("svg",nh({width:22,height:22,xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,rh,ih)}var lh=a.forwardRef(oh);n.p;function ch(){return(ch=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function sh(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var dh=a.createElement("desc",null,"Created with Sketch."),uh=a.createElement("g",{id:"icon/action/delete/enabled",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round"},a.createElement("line",{x1:9,y1:9,x2:9,y2:18,id:"Stroke-1",stroke:"#1B2559",strokeWidth:2}),a.createElement("line",{x1:13,y1:9,x2:13,y2:18,id:"Stroke-2",stroke:"#1B2559",strokeWidth:2}),a.createElement("polyline",{id:"Stroke-3",stroke:"#1B2559",strokeWidth:2,strokeLinejoin:"round",points:"3 6 5 21 17 21 19 6"}),a.createElement("line",{x1:1,y1:5,x2:21,y2:5,id:"Stroke-5",stroke:"#1B2559",strokeWidth:2}),a.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 mh(e,t){var n=e.title,r=e.titleId,i=sh(e,["title","titleId"]);return a.createElement("svg",ch({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":r},i),n?a.createElement("title",{id:r},n):null,dh,uh)}var hh=a.forwardRef(mh);n.p;function ph(){return(ph=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function bh(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var fh=a.createElement("desc",null,"Created with Sketch."),jh=a.createElement("g",{id:"icon/action/edit/disabled",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.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}),a.createElement("polygon",{id:"Stroke-3",stroke:"#9B9B9B",strokeWidth:2,points:"6 12 17 1 21 5 10 16 6 16"}));function gh(e,t){var n=e.title,r=e.titleId,i=bh(e,["title","titleId"]);return a.createElement("svg",ph({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":r},i),n?a.createElement("title",{id:r},n):null,fh,jh)}var Oh=a.forwardRef(gh);n.p;function xh(){return(xh=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function vh(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var yh=a.createElement("desc",null,"Created with Sketch."),wh=a.createElement("g",{id:"icon/action/edit/enabled",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.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}),a.createElement("polygon",{id:"Stroke-3",stroke:"#1B2559",strokeWidth:2,points:"6 12 17 1 21 5 10 16 6 16"}));function Ch(e,t){var n=e.title,r=e.titleId,i=vh(e,["title","titleId"]);return a.createElement("svg",xh({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":r},i),n?a.createElement("title",{id:r},n):null,yh,wh)}var kh=a.forwardRef(Ch),Eh=(n.p,{saveButton:{marginRight:20},lastOfGroup:{marginBottom:24},extraPadding:{paddingLeft:35,paddingRight:30},extraPaddingRight:{paddingRight:39},withSuffix:function(e){var t=e.textAlign;return{display:"flex",alignItems:"center",justifyContent:"right"===t?"flex-end":t}},suffix:{margin:[[0,0,0,7]]},size:function(e){var t=e.size;return Ha(t)},bold:Va}),Nh=Object(f.a)(Eh),Sh=function(e){var t=e.disabled,n=e.editing,r=Nh(),i=Object(bn.f)(),o=i.values,c=i.submitForm,s=i.resetForm,d=Object(a.useContext)(km),u=d.editWidth,m=d.onEdit,h=d.enableEdit,p=d.enableDelete,b=d.disableRowEdit,f=d.onDelete,j=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||b&&b(o),E=Object(a.useState)(!1),N=Object(l.a)(E,2),S=N[0],I=N[1];return Object(Me.jsxs)(Me.Fragment,{children:[n&&Object(Me.jsxs)(vm,{textAlign:"center",width:w,children:[Object(Me.jsx)(oa,{className:r.saveButton,type:"submit",color:"primary",onClick:c,children:"Save"}),!v&&Object(Me.jsx)(oa,{color:"secondary",onClick:function(){y(),s()},children:"Cancel"})]}),!n&&h&&Object(Me.jsx)(vm,{textAlign:"center",width:u,children:Object(Me.jsx)(ta,{disabled:k,className:r.editButton,onClick:function(){return m&&m(o.id)},children:k?Object(Me.jsx)(Oh,{}):Object(Me.jsx)(kh,{})})}),!n&&p&&Object(Me.jsxs)(vm,{textAlign:"center",width:j,children:[Object(Me.jsx)(ta,{disabled:t,onClick:function(){I(!0)},children:t?Object(Me.jsx)(lh,{}):Object(Me.jsx)(hh,{})}),Object(Me.jsx)($m,{open:S,setDeleteDialog:I,onConfirmed:function(){f(o.id).then((function(e){D.a(e)||I(!1)}))},onDismissed:function(){I(!1),y()},errorMessage:C})]}),!n&&g&&Object(Me.jsx)(vm,{textAlign:"center",width:x,children:Object(Me.jsx)(Fr,{checked:!!o.active,value:!!o.active,disabled:t,onChange:function(){return O(o.id)}})})]})},Ih=function(e){var t,n=e.editing,a=e.focus,r=e.config,i=e.extraPaddingRight,o=e.extraPadding,l=r.name,c=r.bypassField,d=r.input,u=r.editable,m=void 0===u||u,h=r.size,p=r.bold,b=r.width,f=r.textAlign,j=r.editingAlign,g=void 0===j?f:j,O=r.suffix,x=r.SuffixComponent,v=void 0===x?tt:x,y=r.textStyle,w=void 0===y?function(e){}:y,C=r.isHidden,k=void 0===C?function(e){return!1}:C,E=r.view,N=void 0===E?function(e){return null===e||void 0===e?void 0:e.toString()}:E,S=r.inputProps,I=void 0===S?{}:S,F=Object(bn.f)().values,L=n&&function(e){return"function"===typeof e?e(F):e}(m),P=!c,D=Nh({textAlign:L?g:f,size:h}),R=Object(s.a)({fullWidth:!0,autoFocus:a,size:h,bold:p,textAlign:L?g:f},I);return Object(Me.jsxs)(vm,{className:(t={},Object(z.a)(t,D.extraPaddingRight,i),Object(z.a)(t,D.extraPadding,o),Object(z.a)(t,D.withSuffix,O),t),width:b,size:h,bold:p,textAlign:f,children:[L&&P&&!k(F)&&Object(Me.jsx)(bn.b,Object(s.a)({name:l,component:d},R)),L&&!P&&!k(F)&&Object(Me.jsx)(r.input,{name:l}),!L&&F&&!k(F)&&Object(Me.jsx)("div",{style:w(F,L),children:N(F[l],F)}),O&&!k(F)&&Object(Me.jsx)(v,{className:D.suffix,style:L?{}:w(F,L),children:O}),k(F)&&Object(Me.jsx)(Gt,{})]})},Fh=function(e){var t=e.editing,n=e.disabled,r=e.lastOfGroup,i=e.newRow,o=Object(bn.f)(),c=o.touched,s=o.errors,d=o.values,u=Object(a.useContext)(km),m=u.elements,h=u.enableEdit,p=u.enableDelete,b=u.error,f=u.enableToggle,j=u.rowSize,g=u.stripeWhen,O=Nh(),x=!t&&g&&g(d)?function(e){var t=ps.a(W.a("stripe",!0))(e),n=Object(l.a)(t,2),a=n[0],r=n[1];if(!a.length)return e;var i=Em.a(a[0],e),o=L.a(ms.a,R.a(A.a(["width"])))(a);return Nm.a(i,{width:o,editable:!1,view:function(){return Object(Me.jsx)(Gt,{})}},r)}(m):m,v=ps.a(il.a("doubleHeader"))(m),y=Object(l.a)(v,1)[0],w=(null===y||void 0===y?void 0:y.length)?Em.a(y[0],m):-1,C=(null===y||void 0===y?void 0:y.length)?Em.a(y[y.length-1],m):-1,k=x.findIndex((function(e){return void 0===e.editable||e.editable})),E=Object(z.a)({},O.lastOfGroup,r),N=Mm.a(Wc.a(c),s),S=N&&Wc.a(N).length>0||!!b,F=b||N&&sd.a(N).join(", ");return Object(Me.jsxs)(Cm,{className:I()(E),size:j,error:t&&S,newRow:i&&!S,errorMessage:F,children:[x.map((function(e,n){return Object(Me.jsx)(Ih,{config:e,editing:t,focus:n===k&&t,extraPaddingRight:C===n,extraPadding:w===n},n)})),(h||p||f)&&Object(Me.jsx)(Sh,{disabled:n,editing:t})]})},Lh={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"}},Ph=Object(f.a)(Lh),Dh=L.a(hs.a(nm.a)(0),R.a((function(e){var t;return null!==(t=e.width)&&void 0!==t?t:100}))),Rh=function(e){var t,n,r,i=e.name,o=e.title,c=e.titleLg,d=e.elements,u=void 0===d?[]:d,m=e.data,h=void 0===m?[]:m,p=e.save,b=e.error,f=e.rowSize,j=void 0===f?"md":f,g=e.validationSchema,O=e.enableCreate,x=e.enableEdit,v=e.enableEditText,y=e.editWidth,w=e.enableDelete,C=e.deleteWidth,k=void 0===C?87:C,E=e.enableToggle,N=e.toggleWidth,S=void 0===N?87:N,I=e.onToggle,F=e.forceDisable,L=e.disableAdd,P=e.initialValues,D=e.setEditing,R=e.shouldOverrideEdit,T=e.editOverride,A=e.stripeWhen,M=e.disableRowEdit,q=e.groupBy,$=e.sortBy,H=e.createText,V=void 0===H?"Add override":H,U=e.forceAdd,G=void 0!==U&&U,X=e.tbodyWrapperClass,_=Object(a.useState)(null),Z=Object(l.a)(_,2),K=Z[0],Q=Z[1],Y=Object(a.useState)(!1),J=Object(l.a)(Y,2),ee=J[0],te=J[1],ne=Object(a.useState)(!1),ae=Object(l.a)(ne,2),re=ae[0],ie=ae[1],oe=Object(a.useState)(null),le=Object(l.a)(oe,2),ce=le[0],se=le[1];Object(a.useEffect)((function(){return se(b)}),[b]),Object(a.useEffect)((function(){se(null),te(G)}),[G]);var de=function(){var e=Object(Pl.a)(Ll.a.mark((function e(t){var n,a,r;return Ll.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(ie(!0),n=g.cast(t),a=ml.a(W.a("id",n.id))(h),r=-1!==a?rm.a(a,n,h):im.a(n,h),yd.a(h[a],n)){e.next=16;break}return e.prev=7,e.next=10,p(Object(z.a)({},i,r),n);case 10:e.next=16;break;case 12:return e.prev=12,e.t0=e.catch(7),ie(!1),e.abrupt("return");case 16:te(!1),D&&D(!1),ie(!1);case 19:case"end":return e.stop()}}),e,null,[[7,12]])})));return function(t){return e.apply(this,arguments)}}(),ue=function(){te(!1),Q(null),D&&D(!1)},me=function(){te(!0),se(null),D&&D(!0,!0)},he=w||E?87:174,pe=za.a(he)(y),be=(null!==(t=w&&k)&&void 0!==t?t:0)+(null!==(n=x&&pe)&&void 0!==n?n:0)+(null!==(r=E&&S)&&void 0!==r?r:0),fe=Dh(u)+be,je=Ph({width:fe}),ge=!h.length&&O&&!ee,Oe=!F&&!K&&!L&&!ee,xe=ee||0!==h.length,ve=$?lm.a($)(h):h,ye={elements:u,enableEdit:x,enableEditText:v,onEdit:function(e){if(R&&R(e))return T(e);Q(e),se(null),D&&D(e,!0)},clearError:function(){return se(null)},error:ce,disableRowEdit:M,editWidth:pe,enableDelete:w,onDelete:function(e){var t=om.a((function(t){return t.id===e}),h);return p(Object(z.a)({},i,t))},deleteWidth:k,enableToggle:E,rowSize:j,onToggle:I,toggleWidth:S,actionColSize:be,stripeWhen:A,forceAdd:G,DEFAULT_COL_SIZE:100};return Object(Me.jsx)(km.Provider,{value:ye,children:Object(Me.jsxs)("div",{className:je.wrapper,children:[ge&&Oe&&Object(Me.jsx)(Ln,{onClick:me,children:V}),xe&&Object(Me.jsxs)(Me.Fragment,{children:[(o||O)&&Object(Me.jsxs)("div",{className:je.outerHeader,children:[o&&c&&Object(Me.jsx)(Ye,{className:je.title,children:o}),o&&!c&&Object(Me.jsx)(Ze,{className:je.title,children:o}),O&&Oe&&Object(Me.jsx)(oa,{className:je.addLink,onClick:me,children:V})]}),Object(Me.jsxs)(jm,{children:[Object(Me.jsx)(Am,{}),Object(Me.jsx)("div",{className:X,children:Object(Me.jsxs)(xm,{children:[ee&&Object(Me.jsx)(bn.e,{validateOnBlur:!1,validateOnChange:!1,initialValues:Object(s.a)({id:Object(cm.a)()},P),onReset:ue,validationSchema:g,onSubmit:de,children:Object(Me.jsxs)(bn.d,{children:[Object(Me.jsx)(dm,{}),Object(Me.jsx)(Fh,{editing:!0,disabled:F,newRow:!0})]})}),ve.map((function(e,t){var n,a=ve[t+1],r=!!q&&a,i="Function"===Ra.a(q)?q:B.a(q),o=r&&i(e)!==i(a);return Object(Me.jsx)(bn.e,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,initialValues:e,onReset:ue,validationSchema:g,onSubmit:de,children:Object(Me.jsxs)(bn.d,{children:[Object(Me.jsx)(dm,{}),Object(Me.jsx)(Fh,{lastOfGroup:o,editing:K===e.id,disabled:F||K&&K!==e.id||ee})]})},null!==(n=e.id)&&void 0!==n?n:t)}))]})})]})]})]})})},Bh=function(e){var t=e.name,n=e.save,a=e.data,r=void 0===a?{}:a,i=e.namespaces,o=void 0===i?[]:i,l=Object(q.a)(e,["name","save","data","namespaces"]),c=R.a((function(e){return Object(s.a)({id:e},rs(e)(r))}))(o);return Object(Me.jsx)(Rh,Object(s.a)({name:t,data:c,save:function(){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];var r=t[1];return n(is(r.id)(am.a(["id2"],r)))}},l))},Th=n(463),Ah=Object(f.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]]}}}),Mh=function(e){var t=e.width,n=e.height,a=e.infoPanelHeight,r=e.title,i=e.small,o=e.xl,l=e.infoPanel,c=e.handleClose,d=e.children,u=(e.secondaryModal,e.className),m=e.closeOnEscape,h=e.closeOnBackdropClick,p=Object(q.a)(e,["width","height","infoPanelHeight","title","small","xl","infoPanel","handleClose","children","secondaryModal","className","closeOnEscape","closeOnBackdropClick"]),b=Ah({width:t,height:n,small:i,infoPanelHeight:a,xl:o}),f=i?Ue:$e,j=o?28:i?16:20;return Object(Me.jsx)(Th.a,Object(s.a)(Object(s.a)({onClose:function(e,t){(h||"backdropClick"!==t)&&(m||"escapeKeyDown"!==t)&&c()},className:b.modal},p),{},{children:Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)(Un.a,{className:I()(b.wrapper,u),children:[Object(Me.jsxs)("div",{className:b.header,children:[r&&Object(Me.jsx)(f,{className:b.title,children:r}),Object(Me.jsx)(ta,{size:j,className:b.button,onClick:function(){return c()},children:Object(Me.jsx)(Bi,{})})]}),Object(Me.jsx)("div",{className:b.content,children:d})]}),l&&Object(Me.jsx)(Un.a,{className:I()(b.infoPanelWrapper,u),children:Object(Me.jsx)("div",{className:b.panelContent,children:l})})]})}))},Wh=9999999,zh=n(941),qh=n(873),$h=n(874),Hh=zh.a(qh.a(Number),$h.a(yd.a(NaN))),Vh=function(e){return Hh(e)?e:null},Uh=n.p+"static/media/both-filled.7af80d5f.svg",Gh={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:$}},Xh=Object(f.a)(Gh),_h=function(e){var t=e.name,n=e.onContinue,a=Xh();return Object(Me.jsxs)("div",{className:a.modalContent,children:[Object(Me.jsx)("img",{width:"148",height:"196",alt:"cassette",src:Uh}),Object(Me.jsx)($e,{className:a.splashTitle,noMargin:!0,children:"Update counts"}),Object(Me.jsx)(Ze,{className:a.machineName,noMargin:!0,children:t}),Object(Me.jsxs)("div",{className:a.warningInfo,children:[Object(Me.jsx)(ir,{className:a.warningIcon}),Object(Me.jsx)(Xe,{noMargin:!0,className:a.warningText,children:"Before updating counts on Lamassu Admin, make sure you've done it before on the machines."})]}),Object(Me.jsxs)("div",{className:a.warningInfo,children:[Object(Me.jsx)(ir,{className:a.warningIcon}),Object(Me.jsx)(Xe,{noMargin:!0,className:a.warningText,children:"For cash-out cassettes, please make sure you've removed the remaining bills before adding the new ones."})]}),Object(Me.jsx)(An,{className:a.button,onClick:n,children:"Get started"})]})},Zh=n(875);function Kh(){return(Kh=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Qh(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Yh=a.createElement("desc",null,"Created with Sketch."),Jh=a.createElement("g",{id:"icon/stage/spring/current",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("circle",{id:"Oval-2-Copy",fill:"#48F694",cx:9,cy:9,r:4}),a.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 ep(e,t){var n=e.title,r=e.titleId,i=Qh(e,["title","titleId"]);return a.createElement("svg",Kh({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":r},i),n?a.createElement("title",{id:r},n):null,Yh,Jh)}var tp=a.forwardRef(ep),np=(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}}),ap=Object(f.a)(np),rp=Object(a.memo)((function(e){var t,n,a=e.steps,r=e.currentStep,i=e.color,o=void 0===i?"spring":i,l=e.className;if(r<1||r>a)throw Error("Value of currentStage is invalid");if(a<1)throw Error("Value of stages is invalid");var c=ap(),s=(t={},Object(z.a)(t,c.separator,!0),Object(z.a)(t,c.separatorSpring,"spring"===o),Object(z.a)(t,c.separatorZodiac,"zodiac"===o),t),d=(n={},Object(z.a)(n,c.separator,!0),Object(z.a)(n,c.separatorSpringEmpty,"spring"===o),Object(z.a)(n,c.separatorZodiacEmpty,"zodiac"===o),n);return Object(Me.jsxs)("div",{className:I()(l,c.stages),children:[xu.a(1,r).map((function(e){return Object(Me.jsxs)("div",{className:c.wrapper,children:[e>1&&Object(Me.jsx)("div",{className:I()(s)}),Object(Me.jsxs)("div",{className:c.stage,children:["spring"===o&&Object(Me.jsx)(Hi,{}),"zodiac"===o&&Object(Me.jsx)(si,{})]})]},e)})),Object(Me.jsxs)("div",{className:c.wrapper,children:[r>1&&Object(Me.jsx)("div",{className:I()(s)}),Object(Me.jsxs)("div",{className:c.stage,children:["spring"===o&&Object(Me.jsx)(tp,{}),"zodiac"===o&&Object(Me.jsx)(fi,{})]})]}),xu.a(r+1,a+1).map((function(e){return Object(Me.jsxs)("div",{className:c.wrapper,children:[Object(Me.jsx)("div",{className:I()(d)}),Object(Me.jsxs)("div",{className:c.stage,children:["spring"===o&&Object(Me.jsx)(bt,{}),"zodiac"===o&&Object(Me.jsx)(vt,{})]})]},e)}))]})}));function ip(){return(ip=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function op(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var lp=a.createElement("desc",null,"Created with Sketch."),cp=a.createElement("g",{id:"icon/action/help/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.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"}),a.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"}),a.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 sp(e,t){var n=e.title,r=e.titleId,i=op(e,["title","titleId"]);return a.createElement("svg",ip({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":r},i),n?a.createElement("title",{id:r},n):null,lp,cp)}var dp,up,mp,hp=a.forwardRef(sp),pp=(n.p,Object(f.a)({transparentButton:{border:"none",backgroundColor:"transparent",marginTop:4,outline:"none",cursor:"pointer"},popoverContent:function(e){return{width:e.width,padding:[[10,15]]}}})),bp=function(e){var t=pp({width:e}),n=Object(a.useState)(null),r=Object(l.a)(n,2),i=r[0],o=r[1],c=Boolean(i);return{classes:t,helpPopperAnchorEl:i,helpPopperOpen:c,handleOpenHelpPopper:function(e){o(i?null:e.currentTarget)},handleCloseHelpPopper:function(){o(null)}}},fp=Object(a.memo)((function(e){var t=e.children,n=e.width,a=e.Icon,r=void 0===a?hp:a,i=bp(n);return Object(Me.jsx)(E.a,{onClickAway:i.handleCloseHelpPopper,children:Object(Me.jsxs)("div",{children:[Object(Me.jsx)("button",{type:"button",className:i.classes.transparentButton,onClick:i.handleOpenHelpPopper,children:Object(Me.jsx)(r,{})}),Object(Me.jsx)(Xn,{open:i.helpPopperOpen,anchorEl:i.helpPopperAnchorEl,placement:"bottom",children:Object(Me.jsx)("div",{className:i.classes.popoverContent,children:t})})]})})})),jp=Object(a.memo)((function(e){var t=e.parentElements,n=e.children,a=e.width,r=bp(a);return Object(Me.jsxs)("div",{children:[Object(Me.jsx)("div",{onMouseEnter:r.handleOpenHelpPopper,onMouseLeave:r.handleCloseHelpPopper,children:t}),Object(Me.jsx)(Xn,{open:r.helpPopperOpen,anchorEl:r.helpPopperAnchorEl,placement:"bottom",children:Object(Me.jsx)("div",{className:r.classes.popoverContent,children:n})})]})})),gp=n.p+"static/media/acceptor-left.f37bcb1a.svg",Op=n.p+"static/media/dispenser-1.e4200f4e.svg",xp=n.p+"static/media/dispenser-2.9f7807a5.svg",vp=n.p+"static/media/3-cassettes-open-1-left.d6d9aa73.svg",yp=n.p+"static/media/3-cassettes-open-2-left.a9ee8d4c.svg",wp=n.p+"static/media/3-cassettes-open-3-left.08fed660.svg",Cp=n.p+"static/media/4-cassettes-open-1-left.7b00c51f.svg",kp=n.p+"static/media/4-cassettes-open-2-left.b3d9541c.svg",Ep=n.p+"static/media/4-cassettes-open-3-left.e8f1667c.svg",Np=n.p+"static/media/4-cassettes-open-4-left.bc1a9829.svg",Sp={content:{display:"flex",flexDirection:"column",justifyContent:"space-between",flex:1,paddingBottom:32},titleDiv:{marginBottom:32},title:{margin:[[0,0,12,0]],color:$},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:$},errorMessage:{color:me}},Ip=Object(f.a)(Sp),Fp=function(e,t){return[[Op,xp],[vp,yp,wp],[Cp,kp,Ep,Np]][e-2][t-2]},Lp=function(e){var t=e.step,n=e.name,a=e.machine,r=e.cashoutSettings,i=e.cassetteCapacity,o=(e.error,e.lastStep),l=e.steps,c=e.fiatCurrency,s=e.onContinue,d=e.initialValues,u=Ip(),m=o?"Finish":"Confirm",h=[{display:"Yes",code:"YES"},{display:"No",code:"NO"}],p="cassette".concat(t-1),b=a.numberOfCassettes,f=null===a||void 0===a?void 0:a[p],j=null===r||void 0===r?void 0:r[p],g=function(e){return e[p]||f},O=function(e){return g(e)*j},x=ju.a(g,(function(e){return e/i*100}),Zh.a(0,100));return Object(Me.jsxs)("div",{className:u.content,children:[Object(Me.jsxs)("div",{className:u.titleDiv,children:[Object(Me.jsx)(Ze,{className:u.title,children:n}),Object(Me.jsx)(rp,{steps:l.length,currentStep:t})]}),1===t&&Object(Me.jsx)(bn.e,{validateOnBlur:!1,validateOnChange:!1,onSubmit:s,initialValues:{wasCashboxEmptied:""},enableReinitialize:!0,validationSchema:l[0].schema,children:function(e){e.values;var t=e.errors;return Object(Me.jsxs)(bn.d,{children:[Object(Me.jsxs)("div",{className:I()(u.horizontalAlign,u.form),children:[Object(Me.jsx)("img",{className:u.stepImage,alt:"cassette",src:gp}),Object(Me.jsx)("div",{className:u.formWrapper,children:Object(Me.jsxs)("div",{className:I()(u.verticalAlign,u.fullWidth),children:[Object(Me.jsx)(Ue,{noMargin:!0,children:"Did you empty the cash-in box?"}),Object(Me.jsx)(bn.b,{component:ti,name:"wasCashboxEmptied",options:h,className:u.horizontalAlign}),t.wasCashboxEmptied&&Object(Me.jsx)("div",{className:u.errorMessage,children:t.wasCashboxEmptied}),Object(Me.jsxs)("div",{className:I()(u.horizontalAlign,u.centerAlignment),children:[Object(Me.jsx)(Xe,{children:"Since previous update"}),Object(Me.jsx)(fp,{width:215,children:Object(Me.jsx)(Xe,{children:"Number of bills inside the cashbox, since the last cashbox changes."})})]}),Object(Me.jsxs)("div",{className:I()(u.horizontalAlign,u.lineAlignment),children:[Object(Me.jsx)(_e,{noMargin:!0,className:u.cashboxBills,children:null===a||void 0===a?void 0:a.cashbox}),Object(Me.jsx)(Xe,{noMargin:!0,children:"accepted bills"})]})]})})]}),Object(Me.jsx)(An,{className:u.submit,type:"submit",children:m})]})}}),t>1&&Object(Me.jsx)(bn.e,{validateOnBlur:!1,validateOnChange:!1,onSubmit:s,initialValues:d,enableReinitialize:!0,validationSchema:l[t-1].schema,children:function(e){var n=e.values;e.errors;return Object(Me.jsxs)(bn.d,{children:[Object(Me.jsxs)("div",{className:I()(u.horizontalAlign,u.form),children:[Object(Me.jsx)("img",{className:u.stepImage,alt:"cassette",src:Fp(b,t)}),Object(Me.jsx)("div",{className:u.formWrapper,children:Object(Me.jsxs)("div",{className:I()(u.verticalAlign,u.fullWidth),children:[Object(Me.jsxs)("div",{className:I()(u.horizontalAlign,u.smBottomMargin),children:[Object(Me.jsxs)("div",{className:I()(u.horizontalAlign,u.cassetteFormTitle),children:[Object(Me.jsx)(Bc,{}),Object(Me.jsxs)(Ue,{className:u.cassetteFormTitleContent,noMargin:!0,children:["Cash-out ",t-1," (dispenser)"]})]}),Object(Me.jsx)(Xr,{className:u.cassetteCashbox,percent:x(n),cashOut:!0})]}),Object(Me.jsx)(Ue,{noMargin:!0,children:"Refill bill count"}),Object(Me.jsxs)("div",{className:I()(u.horizontalAlign,u.lineAlignment),children:[Object(Me.jsx)(bn.b,{component:ei,decimalPlaces:0,width:50,placeholder:f.toString(),name:p,className:u.cashboxBills}),Object(Me.jsxs)(Xe,{children:[j," ",c," bills loaded"]})]}),Object(Me.jsxs)(Xe,{noMargin:!0,className:u.fiatTotal,children:["= ",O(n)," ",c]})]})})]}),Object(Me.jsx)(An,{className:u.submit,type:"submit",children:m})]})}})]})},Pp=R.a((function(e){return"cassette".concat(e)}),xu.a(1,5)),Dp=function(e){var t=e.machine,n=e.cashoutSettings,r=e.locale,i=e.onClose,o=e.save,c=e.error,s=Object(a.useState)({step:0,config:{active:!0}}),d=Object(l.a)(s,2),u=d[0],m=u.step,h=u.config,p=d[1],b=Wa.a(n)||!(null===n||void 0===n?void 0:n.active)?0:t.numberOfCassettes,f=m===b+1,j=function(e){return hs.a((function(t,n){return t[n]=function(e){return Hh(parseInt(e))?parseInt(e):0}(e[n]),t}),{},Pp)},g=function(e){var n=Gn.a(h,e);if(f){var a=[null===h||void 0===h?void 0:h.wasCashboxEmptied,null===e||void 0===e?void 0:e.wasCashboxEmptied].includes("YES")?0:null===t||void 0===t?void 0:t.cashbox,r=j(e);return o(t.id,a,r),i()}p({step:m+1,config:n})},O=ju.a(nm.a(1),xu.a(1),R.a((function(e){return{type:"cassette ".concat(e),schema:xn.f().shape(Object(z.a)({},"cassette".concat(e),xn.e().label("Bill count").positive().integer().required().min(0).max(500)))}}))),x=im.a({type:"cashbox",schema:xn.f().shape({wasCashboxEmptied:xn.h().required("Select one option.")}),cashoutRequired:!1},O(b));return Object(Me.jsxs)(Mh,{title:0===m?null:"Update counts",handleClose:i,width:554,height:520,open:!0,children:[0===m&&Object(Me.jsx)(_h,{name:null===t||void 0===t?void 0:t.name,onContinue:function(){return g()}}),0!==m&&Object(Me.jsx)(Lp,{step:m,name:null===t||void 0===t?void 0:t.name,machine:t,cashoutSettings:n,cassetteCapacity:500,error:c,lastStep:f,steps:x,fiatCurrency:r.fiatCurrency,onContinue:g,initialValues:Wa.a(n)?{}:hs.a((function(e,t){return e["cassette".concat(t)]="",e}),{},xu.a(1,b+1))})]})},Rp={cashbox:{height:36}},Bp=Object(f.a)(Rp),Tp={2:{cashbox:116,cassette:280,cassetteGraph:80,editWidth:174},3:{cashbox:106,cassette:200,cassetteGraph:60,editWidth:145},4:{cashbox:106,cassette:164,cassetteGraph:40,editWidth:90}},Ap=xn.f().shape({name:xn.h().required("Required"),cashbox:xn.e().label("Cashbox").required().integer().min(0).max(1e3),cassette1:xn.e().required("Required").integer().min(0).max(500),cassette2:xn.e().required("Required").integer().min(0).max(500),cassette3:xn.e().required("Required").integer().min(0).max(500),cassette4:xn.e().required("Required").integer().min(0).max(500)}),Mp=x()(dp||(dp=Object(c.a)(["\n mutation MachineAction(\n $deviceId: ID!\n $action: MachineAction!\n $cashbox: Int!\n $cassette1: Int!\n $cassette2: Int!\n $cassette3: Int!\n $cassette4: Int!\n ) {\n machineAction(\n deviceId: $deviceId\n action: $action\n cashbox: $cashbox\n cassette1: $cassette1\n cassette2: $cassette2\n cassette3: $cassette3\n cassette4: $cassette4\n ) {\n deviceId\n cashbox\n cassette1\n cassette2\n cassette3\n cassette4\n }\n }\n"]))),Wp=function(e){var t=e.machine,n=e.config,r=e.refetchData,i=Bp(),o=Object(a.useState)(!1),c=Object(l.a)(o,2),d=c[0],m=c[1],h=n&&rs("cashOut")(n),p=n&&rs("locale")(n),b=n&&rs("notifications",n),f=null===p||void 0===p?void 0:p.fiatCurrency,j=t.numberOfCassettes,g=function(e){return rs(e)(h)},O=function(e){var t=e.deviceId;return!g(t).active},x=[{name:"cashbox",header:"Cashbox",width:Tp[j].cashbox,stripe:!1,view:function(e){return Object(Me.jsx)(_r,{currency:{code:f},notes:e,total:0})},input:ei,inputProps:{decimalPlaces:0}}];Ju.a(em.a(tm.a,j),(function(e){return x.push({name:"cassette".concat(e),header:"Cash-out ".concat(e),width:Tp[j].cassette,stripe:!0,doubleHeader:"Cash-out",view:function(n){var a;return Object(Me.jsx)(Zr,{className:i.cashbox,denomination:null===(a=g(t.deviceId))||void 0===a?void 0:a["cassette".concat(e)],currency:{code:f},notes:n,width:Tp[j].cassetteGraph,threshold:b["fillingPercentageCassette".concat(e)]})},isHidden:function(t){var n=t.numberOfCassettes;return e>n},input:Qr,inputProps:{decimalPlaces:0,width:Tp[j].cassetteGraph,inputClassName:i.cashbox}}),nm.a(1,e)}),1),x.push({name:"edit",header:"Edit",width:87,view:function(){return Object(Me.jsx)(ta,{onClick:function(){m(!0)},children:Object(Me.jsx)(kh,{})})}});var v=Object(u.b)(Mp,{refetchQueries:function(){return r()}}),y=Object(l.a)(v,2),w=y[0],C=y[1].error,k=function(e,n,a){return w({variables:Object(s.a)({action:"setCassetteBills",deviceId:t.deviceId,cashbox:n},a)})};return t.name?Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Rh,{error:null===C||void 0===C?void 0:C.message,editWidth:Tp[j].editWidth,stripeWhen:O,disableRowEdit:O,name:"cashboxes",elements:x,data:[t],save:k,validationSchema:Ap}),d&&Object(Me.jsx)(Dp,{machine:t,cashoutSettings:g(t.deviceId),onClose:function(){m(!1)},error:null===C||void 0===C?void 0:C.message,save:k,locale:p})]}):null},zp=n(879),qp={marginLeft:6},$p=Object(Me.jsxs)("div",{children:[Object(Me.jsx)(Sc,{}),Object(Me.jsx)("span",{style:qp,children:"Cash-in"})]}),Hp=Object(Me.jsxs)("div",{children:[Object(Me.jsx)(Bc,{}),Object(Me.jsx)("span",{style:qp,children:"Cash-out"})]}),Vp=function(e){return function(e){return[{name:"name",width:280,size:"sm",view:function(e){return"".concat(e)}},{header:$p,name:"cashIn",display:"Cash-in",width:130,textAlign:"right",suffix:"%"},{header:Hp,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)},Up=x()(up||(up=Object(c.a)(["\n query getData {\n config\n cryptoCurrencies {\n code\n display\n }\n machines {\n name\n deviceId\n }\n }\n"]))),Gp=x()(mp||(mp=Object(c.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),Xp=function(e){var t=e.name,n=e.id,a=Object(u.c)(Up),r=a.data,i=a.loading,o=Object(u.b)(Gp,{refetchQueries:function(){return["getData"]}}),c=Object(l.a)(o,1)[0],s=(null===r||void 0===r?void 0:r.config)&&rs(t)(r.config),d=A.a(["fiatCurrency"])(rs(Zc)(null===r||void 0===r?void 0:r.config)),m=function(){if(i||!n||!s)return[];var e={};zp.a((function(t){return e[B.a("code")(t)]={code:t.code,name:t.display,cashIn:s.cashIn,cashOut:s.cashOut,fixedFee:s.fixedFee,minimumTx:s.minimumTx}}))(r.cryptoCurrencies);var t=function(e){return W.a("machine",e)},a=s.overrides?M.a(t("ALL_MACHINES"))(s.overrides):[],o=function(t){e[t.cryptoCurrencies[0]].cashIn=t.cashIn,e[t.cryptoCurrencies[0]].cashOut=t.cashOut,e[t.cryptoCurrencies[0]].fixedFee=t.fixedFee,e[t.cryptoCurrencies[0]].minimumTx=t.minimumTx};zp.a(o)(a);var l=s.overrides?M.a(t(n))(s.overrides):[];return zp.a(o)(l),sd.a(e)}();return Object(Me.jsx)(Rh,{name:"overrides",save:function(e){var n=is(t)(e);return c({variables:{config:n}})},data:m,elements:Vp(d)})},_p={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:$},label3:{color:$,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"}},Zp=Object(f.a)(_p),Kp=function(e){var t=e.data,n=e.timezone,a=Zp();return Object(Me.jsxs)("div",{className:a.row,children:[Object(Me.jsxs)("div",{className:a.rowItem,children:[Object(Me.jsx)(nt,{className:a.label3,children:"Paired at"}),Object(Me.jsx)(Xe,{children:t.pairedAt?ad(t.pairedAt,n,"yyyy-MM-dd HH:mm:ss"):""})]}),Object(Me.jsxs)("div",{className:a.rowItem,children:[Object(Me.jsx)(nt,{className:a.label3,children:"Machine model"}),Object(Me.jsx)(Xe,{children:t.model})]}),Object(Me.jsxs)("div",{className:a.rowItem,children:[Object(Me.jsx)(nt,{className:a.label3,children:"Software version"}),Object(Me.jsx)(Xe,{children:t.version})]})]})},Qp=n(880),Yp=Object(f.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}}),Jp=function(e){var t=e.children,n=e.onClose,a=Yp();return Object(Me.jsxs)("div",{className:a.dialogTitle,children:[t,n&&Object(Me.jsx)(ta,{size:16,"aria-label":"close",onClick:n,children:Object(Me.jsx)(Bi,{})})]})},eb=Object(a.memo)((function(e){var t=e.title,n=void 0===t?"Confirm action":t,r=e.errorMessage,i=void 0===r?"This action requires confirmation":r,o=e.open,c=e.toBeConfirmed,d=e.saveButtonAlwaysEnabled,u=void 0!==d&&d,m=e.message,h=e.confirmationMessage,p=void 0===h?"Write '".concat(c,"' to confirm this action"):h,b=e.onConfirmed,f=e.onDismissed,j=e.initialValue,g=void 0===j?"":j,O=e.disabled,x=void 0!==O&&O,v=Object(q.a)(e,["title","errorMessage","open","toBeConfirmed","saveButtonAlwaysEnabled","message","confirmationMessage","onConfirmed","onDismissed","initialValue","disabled"]),y=Yp(),w=Object(a.useState)(g),C=Object(l.a)(w,2),k=C[0],E=C[1],N=Object(a.useState)(!1),S=Object(l.a)(N,2),I=S[0],F=S[1],L=!u&&c!==k||""===k;return Object(Me.jsxs)(un.a,Object(s.a)(Object(s.a)({open:o,"aria-labelledby":"form-dialog-title"},v),{},{children:[Object(Me.jsx)(Jp,{id:"customized-dialog-title",onClose:function(){E(""),F(!1),f()},children:Object(Me.jsx)(Ue,{children:n})}),i&&Object(Me.jsx)(Jp,{children:Object(Me.jsx)(Jo,{children:i.split(":").map((function(e){return Object(Me.jsxs)(Me.Fragment,{children:[e,Object(Me.jsx)("br",{})]})}))})}),Object(Me.jsxs)(mn.a,{className:y.dialogContent,children:[m&&Object(Me.jsx)(Xe,{children:m}),Object(Me.jsx)(br.a,{htmlFor:"confirm-input",children:p}),Object(Me.jsx)(Xa,{disabled:x,name:"confirm-input",autoFocus:!0,id:"confirm-input",type:"text",size:"sm",fullWidth:!0,value:k,touched:{},error:I,InputLabelProps:{shrink:!0},onChange:function(e){return E(e.target.value)}})]}),Object(Me.jsx)(Wm.a,{className:y.dialogActions,children:Object(Me.jsx)(An,{color:"green",disabled:L,onClick:function(){return b(k)},children:"Confirm"})})]}))}));function tb(){return(tb=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function nb(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var ab=a.createElement("desc",null,"Created with Sketch."),rb=a.createElement("g",{id:"icon/button/edit/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.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"}),a.createElement("polygon",{id:"Stroke-3",stroke:"#FFFFFF",points:"3 6.86666667 8.86666667 1 11 3.13333333 5.13333333 9 3 9"}));function ib(e,t){var n=e.title,r=e.titleId,i=nb(e,["title","titleId"]);return a.createElement("svg",tb({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":r},i),n?a.createElement("title",{id:r},n):null,ab,rb)}var ob=a.forwardRef(ib);n.p;function lb(){return(lb=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function cb(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var sb=a.createElement("desc",null,"Created with Sketch."),db=a.createElement("g",{id:"icon/button/edit/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.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"}),a.createElement("polygon",{id:"Stroke-3",stroke:"#1B2559",points:"3 6.86666667 8.86666667 1 11 3.13333333 5.13333333 9 3 9"}));function ub(e,t){var n=e.title,r=e.titleId,i=cb(e,["title","titleId"]);return a.createElement("svg",lb({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":r},i),n?a.createElement("title",{id:r},n):null,sb,db)}var mb=a.forwardRef(ub);n.p;function hb(){return(hb=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function pb(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var bb=a.createElement("desc",null,"Created with Sketch."),fb=a.createElement("g",{id:"icon/button/reboot/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"Group-3",stroke:"#FFFFFF"},a.createElement("g",{id:"Group-2"},a.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"}),a.createElement("polyline",{id:"Stroke-3",points:"3.37563213 1.84831169 3.36911784 0.595324675 2.18174122 4.15223411e-14"})),a.createElement("line",{x1:5.92223784,y1:7.57277922,x2:5.92223784,y2:3.98212987,id:"Stroke-9"}),a.createElement("g",{id:"Group-2",transform:"translate(9.818105, 6.000000) scale(-1, -1) translate(-9.818105, -6.000000) translate(7.636287, 0.000000)"},a.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"}),a.createElement("polyline",{id:"Stroke-3",points:"3.37563213 1.84831169 3.36911784 0.595324675 2.18174122 4.15223411e-14"}))));function jb(e,t){var n=e.title,r=e.titleId,i=pb(e,["title","titleId"]);return a.createElement("svg",hb({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":r},i),n?a.createElement("title",{id:r},n):null,bb,fb)}var gb=a.forwardRef(jb);n.p;function Ob(){return(Ob=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function xb(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var vb=a.createElement("desc",null,"Created with Sketch."),yb=a.createElement("g",{id:"icon/button/reboot/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"Group-3",stroke:"#1B2559"},a.createElement("g",{id:"Group-2"},a.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"}),a.createElement("polyline",{id:"Stroke-3",points:"3.37563213 1.84831169 3.36911784 0.595324675 2.18174122 4.15223411e-14"})),a.createElement("line",{x1:5.92223784,y1:7.57277922,x2:5.92223784,y2:3.98212987,id:"Stroke-9"}),a.createElement("g",{id:"Group-2",transform:"translate(9.818105, 6.000000) scale(-1, -1) translate(-9.818105, -6.000000) translate(7.636287, 0.000000)"},a.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"}),a.createElement("polyline",{id:"Stroke-3",points:"3.37563213 1.84831169 3.36911784 0.595324675 2.18174122 4.15223411e-14"}))));function wb(e,t){var n=e.title,r=e.titleId,i=xb(e,["title","titleId"]);return a.createElement("svg",Ob({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":r},i),n?a.createElement("title",{id:r},n):null,vb,yb)}var Cb=a.forwardRef(wb);n.p;function kb(){return(kb=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Eb(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Nb=a.createElement("desc",null,"Created with Sketch."),Sb=a.createElement("g",{id:"icon/button/shut-down/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"Group-5",transform:"translate(1.000000, 0.000000)",stroke:"#FFFFFF"},a.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"}),a.createElement("line",{x1:5,y1:.75,x2:5,y2:3.25,id:"Stroke-3"})));function Ib(e,t){var n=e.title,r=e.titleId,i=Eb(e,["title","titleId"]);return a.createElement("svg",kb({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":r},i),n?a.createElement("title",{id:r},n):null,Nb,Sb)}var Fb=a.forwardRef(Ib);n.p;function Lb(){return(Lb=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Pb(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Db=a.createElement("desc",null,"Created with Sketch."),Rb=a.createElement("g",{id:"icon/button/shut-down/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"Group-5",transform:"translate(1.000000, 0.000000)",stroke:"#1B2559"},a.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"}),a.createElement("line",{x1:5,y1:.75,x2:5,y2:3.25,id:"Stroke-3"})));function Bb(e,t){var n=e.title,r=e.titleId,i=Pb(e,["title","titleId"]);return a.createElement("svg",Lb({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":r},i),n?a.createElement("title",{id:r},n):null,Db,Rb)}var Tb=a.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 a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Mb(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Wb=a.createElement("desc",null,"Created with Sketch."),zb=a.createElement("g",{id:"icon/button/unpair/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"Group-12",stroke:"#FFFFFF"},a.createElement("g",{id:"Group-5"},a.createElement("polyline",{id:"Stroke-1",points:"3.75 6 2.25 6 0 3.75 3.75 0 6.75 3"}),a.createElement("polyline",{id:"Stroke-3",points:"8.25 6 9.75 6 12 8.25 8.25 12 5.25 9"})),a.createElement("line",{x1:8.25,y1:3,x2:8.25,y2:1.5,id:"Stroke-6"}),a.createElement("line",{x1:9.75,y1:3,x2:10.5,y2:2.25,id:"Stroke-7"}),a.createElement("line",{x1:9.75,y1:4.5,x2:11.25,y2:4.5,id:"Stroke-8"}),a.createElement("line",{x1:2.25,y1:7.5,x2:.75,y2:7.5,id:"Stroke-9"}),a.createElement("line",{x1:2.25,y1:9,x2:1.5,y2:9.75,id:"Stroke-10"}),a.createElement("line",{x1:3.75,y1:9,x2:3.75,y2:10.5,id:"Stroke-11"})));function qb(e,t){var n=e.title,r=e.titleId,i=Mb(e,["title","titleId"]);return a.createElement("svg",Ab({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":r},i),n?a.createElement("title",{id:r},n):null,Wb,zb)}var $b=a.forwardRef(qb);n.p;function Hb(){return(Hb=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Vb(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Ub=a.createElement("desc",null,"Created with Sketch."),Gb=a.createElement("g",{id:"icon/button/unpair/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"Group-12",stroke:"#1B2559"},a.createElement("g",{id:"Group-5"},a.createElement("polyline",{id:"Stroke-1",points:"3.75 6 2.25 6 0 3.75 3.75 0 6.75 3"}),a.createElement("polyline",{id:"Stroke-3",points:"8.25 6 9.75 6 12 8.25 8.25 12 5.25 9"})),a.createElement("line",{x1:8.25,y1:3,x2:8.25,y2:1.5,id:"Stroke-6"}),a.createElement("line",{x1:9.75,y1:3,x2:10.5,y2:2.25,id:"Stroke-7"}),a.createElement("line",{x1:9.75,y1:4.5,x2:11.25,y2:4.5,id:"Stroke-8"}),a.createElement("line",{x1:2.25,y1:7.5,x2:.75,y2:7.5,id:"Stroke-9"}),a.createElement("line",{x1:2.25,y1:9,x2:1.5,y2:9.75,id:"Stroke-10"}),a.createElement("line",{x1:3.75,y1:9,x2:3.75,y2:10.5,id:"Stroke-11"})));function Xb(e,t){var n=e.title,r=e.titleId,i=Vb(e,["title","titleId"]);return a.createElement("svg",Hb({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":r},i),n?a.createElement("title",{id:r},n):null,Ub,Gb)}var _b,Zb,Kb=a.forwardRef(Xb),Qb=(n.p,{label:{extend:Be.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}}),Yb=Object(f.a)(Qb),Jb=x()(_b||(_b=Object(c.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"]))),ef=x()(Zb||(Zb=Object(c.a)(["\n query getMachine($deviceId: ID!) {\n machine(deviceId: $deviceId) {\n latestEvent {\n note\n }\n }\n }\n"]))),tf=function(e){var t=e.children,n=Yb();return Object(Me.jsx)("div",{className:n.label,children:t})},nf=Object(a.memo)((function(e){var t=e.machine,n=e.onActionSuccess,r=Object(a.useState)({command:null}),i=Object(l.a)(r,2),o=i[0],c=i[1],d=Object(a.useState)({}),m=Object(l.a)(d,2),h=m[0],p=m[1],b=Object(a.useState)(null),f=Object(l.a)(b,2),j=f[0],g=f[1],O=Yb(),x=Object(Me.jsx)("span",{className:O.warning,children:"A user may be in the middle of a transaction and they could lose their funds if you continue."}),v=Object(u.a)(ef,h),y=Object(l.a)(v,2),w=y[0],C=y[1].loading,k=Object(u.b)(Jb,{onError:function(e){var t=e.message;g(null!==t&&void 0!==t?t:"An error ocurred")},onCompleted:function(){n&&n(),c({display:o.display,command:null})}}),E=Object(l.a)(k,2),N=E[0],S=E[1].loading,I=Boolean(o.command),F=!("restartServices"!==(null===o||void 0===o?void 0:o.command)||!C),L=function(e){p({variables:{deviceId:t.deviceId},onCompleted:function(t){var n,a=(n=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}(t))&&!["chooseCoin","idle","pendingIdle","dualIdle","networkDown","unpaired","maintenance","virgin","wifiList"].includes(n)?x:null;c(Object(s.a)(Object(s.a)({},e),{},{message:a}))}}),w()};return Object(Me.jsxs)("div",{children:[Object(Me.jsx)(tf,{children:"Actions"}),Object(Me.jsxs)("div",{className:O.stack,children:[Object(Me.jsx)(ze,{color:"primary",className:O.mr,Icon:mb,InverseIcon:ob,disabled:S,onClick:function(){return c({command:"rename",display:"Rename",confirmationMessage:"Write the new name for this machine"})},children:"Rename"}),Object(Me.jsx)(ze,{color:"primary",className:O.mr,Icon:Kb,InverseIcon:$b,disabled:S,onClick:function(){return c({command:"unpair",display:"Unpair"})},children:"Unpair"}),Object(Me.jsx)(ze,{color:"primary",className:O.mr,Icon:Cb,InverseIcon:gb,disabled:S,onClick:function(){return c({command:"reboot",display:"Reboot"})},children:"Reboot"}),Object(Me.jsx)(ze,{color:"primary",className:O.mr,Icon:Tb,InverseIcon:Fb,disabled:S,onClick:function(){return c({command:"shutdown",display:"Shutdown",message:"In order to bring it back online, the machine will need to be visited and its power reset."})},children:"Shutdown"}),Object(Me.jsx)(ze,{color:"primary",className:O.inlineChip,Icon:Cb,InverseIcon:gb,disabled:S,onClick:function(){L({command:"restartServices",display:"Restart services for"})},children:"Restart Services"})]}),Object(Me.jsx)(eb,{disabled:F,open:I,title:"".concat(o.display," this machine?"),errorMessage:j,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){g(null),N({variables:Object(s.a)({deviceId:t.deviceId,action:"".concat(null===o||void 0===o?void 0:o.command)},"rename"===(null===o||void 0===o?void 0:o.command)&&{newName:e})})},onDismissed:function(){c({display:o.display,command:null}),g(null)}})]})})),af=n(446);function rf(){return(rf=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function of(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var lf=a.createElement("desc",null,"Created with Sketch."),cf=a.createElement("g",{id:"Styleguide",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinejoin:"round"},a.createElement("g",{id:"icon/action/copy",transform:"translate(1.000000, 1.000000)",stroke:"#1B2559"},a.createElement("g",{id:"Group-5-Copy-2"},a.createElement("polyline",{id:"Stroke-1",strokeWidth:2,points:"6 1.2 6 -0.00024 16 -0.00024 16 13.06376 12 13.06376"}),a.createElement("polygon",{id:"Stroke-3",strokeWidth:2,strokeLinecap:"round",points:"0 15.9368 10 15.9368 10 2.9368 0 2.9368"}))));function sf(e,t){var n=e.title,r=e.titleId,i=of(e,["title","titleId"]);return a.createElement("svg",rf({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":r},i),n?a.createElement("title",{id:r},n):null,lf,cf)}var df=a.forwardRef(sf),uf=(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"}}}),mf=Be.label1,hf={wrapper:{extend:Be.mono,display:"flex",alignItems:"center"},address:{lineBreak:"anywhere"},buttonWrapper:{"& button":{border:"none",backgroundColor:"transparent",cursor:"pointer"}},popoverContent:{extend:mf,display:"flex",justifyContent:"center",alignItems:"center",color:K,borderRadius:4,padding:[[5,9]]}},pf={idCardDataCard:{extend:Be.p,display:"flex",padding:[[11,8]],"& > div":{display:"flex",flexDirection:"column","& > div":{width:144,height:37,marginBottom:15,"&:last-child":{marginBottom:0}}}}},bf={label:{extend:mf,color:se,marginBottom:4}},ff={titleWrapper:uf.titleWrapper,titleAndButtonsContainer:uf.titleAndButtonsContainer,buttonsWrapper:uf.buttonsWrapper,headerLabels:{display:"flex",flexDirection:"row","& div":{display:"flex",alignItems:"center"},"& > div":{marginLeft:24},"& > div:first-child":{marginLeft:0},"& span":{extend:mf,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}},jf=Object(f.a)(hf),gf=function(e){var t=e.className,n=e.buttonClassname,r=e.children,i=e.wrapperClassname,o=(Object(q.a)(e,["className","buttonClassname","children","wrapperClassname"]),Object(a.useState)(null)),c=Object(l.a)(o,2),s=c[0],d=c[1];Object(a.useEffect)((function(){s&&setTimeout((function(){return d(null)}),3e3)}),[s]);var u=jf(),m=Boolean(s),h=m?"simple-popper":void 0;return Object(Me.jsx)("div",{className:I()(u.wrapper,i),children:r&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)("div",{className:I()(u.address,t),children:r}),Object(Me.jsx)("div",{className:I()(u.buttonWrapper,n),children:Object(Me.jsx)(af.CopyToClipboard,{text:Sm.a(/\s/g,"")(r),children:Object(Me.jsx)("button",{"aria-describedby":h,onClick:function(e){return function(e){d(s?null:e.currentTarget)}(e)},children:Object(Me.jsx)(df,{})})})}),Object(Me.jsx)(Xn,{id:h,open:m,anchorEl:s,onClose:function(){d(null)},arrowSize:3,bgColor:$,placement:"top",children:Object(Me.jsx)("div",{className:u.popoverContent,children:Object(Me.jsx)("div",{children:"Copied to clipboard!"})})})]})})},Of=Object(f.a)(_p),xf=function(e){if(!e)return null;var t=Object(Qp.a)(e,new Date);if(t<60)return"".concat(t," ").concat(1===t?"second":"seconds"," ago");if(t<3600){var n=Math.round(t/60);return"".concat(n," ").concat(1===n?"minute":"minutes"," ago")}if(t<86400){var a=Math.round(t/3600);return"".concat(a," ").concat(1===a?"hour":"hours"," ago")}var r=Math.round(t/3600/24);return"".concat(r," ").concat(1===r?"day":"days"," ago")},vf=function(e){var t=e.data,n=e.onActionSuccess,a=Of();return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)("div",{className:a.row,children:Object(Me.jsx)("div",{className:a.rowItem,children:Object(Me.jsx)(Ve,{children:t.name})})}),Object(Me.jsx)("div",{className:a.row,children:Object(Me.jsxs)("div",{className:a.rowItem,children:[Object(Me.jsx)(nt,{className:a.label3,children:"Status"}),t&&t.statuses?Object(Me.jsx)(Cu,{status:t.statuses[0]}):null]})}),Object(Me.jsx)("div",{className:a.row,children:Object(Me.jsxs)("div",{className:a.rowItem,children:[Object(Me.jsx)(nt,{className:a.label3,children:"Last ping"}),Object(Me.jsx)(Xe,{children:xf(t.lastPing)})]})}),Object(Me.jsx)("div",{className:a.row,children:Object(Me.jsxs)("div",{className:a.rowItem,children:[Object(Me.jsx)(nt,{className:a.label3,children:"Network speed"}),Object(Me.jsx)(Xe,{children:t.downloadSpeed?new Mc.a(t.downloadSpeed).toFixed(4).toString()+" MB/s":"unavailable"})]})}),Object(Me.jsx)("div",{className:a.row,children:Object(Me.jsx)(nf,{machine:t,onActionSuccess:n})}),Object(Me.jsx)("div",{className:a.row,children:Object(Me.jsxs)("div",{className:a.rowItem,children:[Object(Me.jsx)(nt,{className:a.label3,children:"Device ID"}),Object(Me.jsx)(Xe,{children:Object(Me.jsx)(gf,{buttonClassname:a.copyToClipboard,children:t.deviceId})})]})})]})},yf=n(66),wf=n(882),Cf=n(883),kf=n(942),Ef=n(881),Nf=n(265),Sf=n.n(Nf),If=n(447),Ff=n.n(If);function Lf(){return(Lf=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Pf(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Df=a.createElement("g",{id:"icon/ID/card/new/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("polygon",{id:"Stroke-1",stroke:"#FFFFFF",strokeWidth:1.6,points:"1 17 23 17 23 1 1 1"}),a.createElement("line",{x1:12.7857143,y1:5,x2:19.8571429,y2:5,id:"Stroke-3",stroke:"#FFFFFF",strokeWidth:1.6}),a.createElement("line",{x1:12.7857143,y1:8.2,x2:19.8571429,y2:8.2,id:"Stroke-4",stroke:"#FFFFFF",strokeWidth:1.6}),a.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 Rf(e,t){var n=e.title,r=e.titleId,i=Pf(e,["title","titleId"]);return a.createElement("svg",Lf({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":r},i),void 0===n?a.createElement("title",{id:r},"icon/ID/card/new/white"):n?a.createElement("title",{id:r},n):null,Df)}var Bf=a.forwardRef(Rf);n.p;function Tf(){return(Tf=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Af(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Mf=a.createElement("g",{id:"icon/ID/card/new/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"Group-2",transform:"translate(1.000000, 1.000000)",stroke:"#1B2559",strokeWidth:1.6},a.createElement("g",{id:"id-copy"},a.createElement("polygon",{id:"Stroke-1",points:"0 16 22 16 22 0 0 0"}),a.createElement("line",{x1:11.7857143,y1:4,x2:18.8571429,y2:4,id:"Stroke-3"}),a.createElement("line",{x1:11.7857143,y1:7.2,x2:18.8571429,y2:7.2,id:"Stroke-4"}),a.createElement("polygon",{id:"Stroke-5",points:"3.14285714 11.2 8.64285714 11.2 8.64285714 4 3.14285714 4"}))));function Wf(e,t){var n=e.title,r=e.titleId,i=Af(e,["title","titleId"]);return a.createElement("svg",Tf({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":r},i),void 0===n?a.createElement("title",{id:r},"icon/ID/card/new/zodiac"):n?a.createElement("title",{id:r},n):null,Mf)}var zf=a.forwardRef(Wf);n.p;function qf(){return(qf=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function $f(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Hf=a.createElement("g",{id:"icon/ID/phone/new/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.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 Vf(e,t){var n=e.title,r=e.titleId,i=$f(e,["title","titleId"]);return a.createElement("svg",qf({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":r},i),void 0===n?a.createElement("title",{id:r},"icon/ID/phone/new/white"):n?a.createElement("title",{id:r},n):null,Hf)}var Uf=a.forwardRef(Vf);n.p;function Gf(){return(Gf=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Xf(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var _f=a.createElement("g",{id:"icon/ID/phone/new/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.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 Zf(e,t){var n=e.title,r=e.titleId,i=Xf(e,["title","titleId"]);return a.createElement("svg",Gf({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":r},i),void 0===n?a.createElement("title",{id:r},"icon/ID/phone/new/zodiac"):n?a.createElement("title",{id:r},n):null,_f)}var Kf=a.forwardRef(Zf);n.p;function Qf(){return(Qf=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Yf(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Jf=a.createElement("g",{id:"icon/ID/photo/new/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.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 ej(e,t){var n=e.title,r=e.titleId,i=Yf(e,["title","titleId"]);return a.createElement("svg",Qf({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":r},i),void 0===n?a.createElement("title",{id:r},"icon/ID/photo/new/white"):n?a.createElement("title",{id:r},n):null,Jf)}var tj=a.forwardRef(ej);n.p;function nj(){return(nj=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function aj(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var rj=a.createElement("desc",null,"Created with Sketch."),ij=a.createElement("g",{id:"icon/button/cancel/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"Group-5",stroke:"#1B2559",strokeWidth:1.2},a.createElement("line",{x1:12,y1:0,x2:0,y2:12,id:"Stroke-1"}),a.createElement("line",{x1:0,y1:0,x2:12,y2:12,id:"Stroke-3"})));function oj(e,t){var n=e.title,r=e.titleId,i=aj(e,["title","titleId"]);return a.createElement("svg",nj({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":r},i),n?a.createElement("title",{id:r},n):null,rj,ij)}var lj=a.forwardRef(oj);n.p;function cj(){return(cj=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function sj(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var dj=a.createElement("desc",null,"Created with Sketch."),uj=a.createElement("g",{id:"icon/button/download/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"icon/sf-small/wizzard",stroke:"#FFFFFF"},a.createElement("polyline",{id:"Path-3",points:"3.6 5.4 6 7.8 8.4 5.4"}),a.createElement("line",{x1:6,y1:.5,x2:6,y2:7.4,id:"Path-4"}),a.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 mj(e,t){var n=e.title,r=e.titleId,i=sj(e,["title","titleId"]);return a.createElement("svg",cj({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":r},i),n?a.createElement("title",{id:r},n):null,dj,uj)}var hj=a.forwardRef(mj);n.p;function pj(){return(pj=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function bj(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var fj=a.createElement("desc",null,"Created with Sketch."),jj=a.createElement("g",{id:"icon/button/download/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"icon/sf-small/wizzard",stroke:"#1B2559"},a.createElement("polyline",{id:"Path-3",points:"3.6 5.4 6 7.8 8.4 5.4"}),a.createElement("line",{x1:6,y1:.5,x2:6,y2:7.4,id:"Path-4"}),a.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 gj(e,t){var n=e.title,r=e.titleId,i=bj(e,["title","titleId"]);return a.createElement("svg",pj({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":r},i),n?a.createElement("title",{id:r},n):null,fj,jj)}var Oj,xj,vj,yj=a.forwardRef(gj),wj=(n.p,n(86)),Cj=n(456),kj=n(151),Ej=n(99),Nj=n(448),Sj=n(322),Ij="",Fj=Object(Sj.createUploadLink)({credentials:"include",uri:"".concat(Ij,"/graphql")}),Lj=Object(Sj.createUploadLink)({credentials:"include",uri:"".concat("","/graphql")}),Pj=function(e){var t=e.children,n=Object(w.h)(),r=Object(w.i)(),i=Object(a.useContext)(k),o=(i.userData,function(e,t,n,a,r){return new kj.a({link:Ej.ApolloLink.from([Object(Nj.a)((function(n){var r=n.graphQLErrors,i=n.networkError;r&&r.forEach((function(n){var r=n.message,i=n.locations,o=n.path,l=n.extensions;"UNAUTHENTICATED"===(null===l||void 0===l?void 0:l.code)&&(a(null),"/login"!==t.pathname&&e.push("/login")),console.log("[GraphQL error]: Message: ".concat(r,", Location: ").concat(i,", Path: ").concat(o))})),i&&console.log("[Network error]: ".concat(i))})),new Ej.ApolloLink((function(e,t){return t(e).map((function(t){var n=e.getContext().response.headers;if(n){var a=n.get("lamassu_role");r(a)}return t}))})),Ej.ApolloLink.split((function(e){return"pazuz"===e.getContext().clientName}),Lj,Fj)]),cache:new Cj.a,defaultOptions:{watchQuery:{fetchPolicy:"no-cache",errorPolicy:"ignore"},query:{fetchPolicy:"no-cache",errorPolicy:"all"},mutate:{errorPolicy:"all"}}})}(n,r,0,i.setUserData,i.setRole));return Object(Me.jsx)(wj.a,{client:o,children:t})},Dj={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:Be.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:$,color:K,height:24,marginBottom:-24,marginTop:-3,marginLeft:7,borderRadius:4},chipLabel:{color:K},otherActionsGroup:{display:"flex",flexDirection:"row"}},Rj=function(e){return"cashOut"===e.txClass?function(e){return"Operator cancel"===e.hasError?"Cancelled":e.hasError?"Error":e.dispense?"Success":e.expired?"Expired":"Pending"}(e):function(e){return e.operatorCompleted?"Cancelled":e.hasError?"Error":e.sendConfirmed?"Sent":e.expired?"Expired":e.batched?"Batched":"Pending"}(e)},Bj=function(e){return e.hasError?e.hasError:null},Tj=Object(f.a)(Dj),Aj=x()(Oj||(Oj=Object(c.a)(["\n query txSummaryAndLogs(\n $txId: ID!\n $deviceId: ID!\n $limit: Int\n $from: Date\n $until: Date\n $txClass: String\n $timezone: String\n ) {\n serverLogsCsv(\n limit: $limit\n from: $from\n until: $until\n timezone: $timezone\n )\n machineLogsCsv(\n deviceId: $deviceId\n limit: $limit\n from: $from\n until: $until\n timezone: $timezone\n )\n transactionCsv(id: $txId, txClass: $txClass, timezone: $timezone)\n txAssociatedDataCsv(id: $txId, txClass: $txClass, timezone: $timezone)\n }\n"]))),Mj=x()(xj||(xj=Object(c.a)(["\n mutation cancelCashOutTransaction($id: ID!) {\n cancelCashOutTransaction(id: $id) {\n id\n }\n }\n"]))),Wj=x()(vj||(vj=Object(c.a)(["\n mutation cancelCashInTransaction($id: ID!) {\n cancelCashInTransaction(id: $id) {\n id\n }\n }\n"]))),zj=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return yf.utils.formatCryptoAddress(e,t).replace(/(.{5})/g,"$1 ")},qj=function(e){var t=e.children,n=Tj();return Object(Me.jsx)(et,{className:n.label,children:t})},$j=function(e){var t=e.it,n=e.timezone,r=Tj(),i=Object(a.useState)({command:null}),o=Object(l.a)(i,2),c=o[0],s=o[1],d=Object(a.useState)(""),m=Object(l.a)(d,2),h=m[0],p=m[1],b="cashIn"===t.txClass,f=new Ff.a,j=Object(u.a)(Aj,{onCompleted:function(e){return L(e)}}),g=Object(l.a)(j,1)[0],O=Object(u.b)(b?Wj:Mj,{onError:function(e){var t=e.message;return p(null!==t&&void 0!==t?t:"An error occurred.")},refetchQueries:function(){return["transactions"]}}),x=Object(l.a)(O,1)[0],v=Number.parseFloat(t.fiat),y=yf.utils.toUnit(new Mc.a(t.cryptoAtoms),t.cryptoCode),w=Number.parseFloat(t.commissionPercentage,2),C=Number(v*w).toFixed(2),k=t.discount?"-".concat(t.discount,"%"):null,E=Mc()(v/y).toFormat(2),N="1 ".concat(t.cryptoCode," = ").concat(E," ").concat(t.fiatCode),S=t.customerIdCardData&&{name:"".concat(Dm(t.customerIdCardData.firstName)," ").concat(Dm(t.customerIdCardData.lastName)),age:Object(Ef.a)(t.customerIdCardData.dateOfBirth,new Date),country:t.customerIdCardData.country,idCardNumber:t.customerIdCardData.documentNumber,idCardExpirationDate:Object(ed.a)("dd-MM-yyyy",t.customerIdCardData.expirationDate)},I=Object(ds.a)({minutes:3},t.created),F=Object(Od.a)({minutes:3},t.created),L=function(){var e=Object(Pl.a)(Ll.a.mark((function e(n){var a,r,i;return Ll.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a="tx_".concat(t.id,"_summary.zip"),r=Wc.a(n),R.a((function(e){return f.file(e+".csv",n[e])}),r),e.next=5,f.generateAsync({type:"blob"});case 5:i=e.sent,Sf.a.saveAs(i,a);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),P=Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(qj,{children:"Transaction status"}),Object(Me.jsx)("span",{className:r.bold,children:Rj(t)})]});return Object(Me.jsxs)("div",{className:r.wrapper,children:[Object(Me.jsxs)("div",{className:r.row,children:[Object(Me.jsxs)("div",{className:r.direction,children:[Object(Me.jsx)(qj,{children:"Direction"}),Object(Me.jsxs)("div",{children:[Object(Me.jsx)("span",{className:r.txIcon,children:b?Object(Me.jsx)(Sc,{}):Object(Me.jsx)(Bc,{})}),Object(Me.jsx)("span",{children:b?"Cash-in":"Cash-out"})]})]}),Object(Me.jsxs)("div",{className:r.availableIds,children:[Object(Me.jsx)(qj,{children:"Available IDs"}),Object(Me.jsxs)(Ko.a,{display:"flex",flexDirection:"row",children:[t.customerPhone&&Object(Me.jsx)(Yn,{className:r.idButton,name:"phone",Icon:Kf,InverseIcon:Uf,children:t.customerPhone}),t.customerIdCardPhotoPath&&!t.customerIdCardData&&Object(Me.jsx)(Yn,{popoverClassname:r.clipboardPopover,className:r.idButton,name:"card",Icon:zf,InverseIcon:Bf,children:Object(Me.jsx)("img",{className:r.idCardPhoto,src:"".concat(Ij,"/id-card-photo/").concat(t.customerIdCardPhotoPath),alt:""})}),t.customerIdCardData&&Object(Me.jsx)(Yn,{className:r.idButton,name:"card",Icon:zf,InverseIcon:Bf,children:Object(Me.jsxs)("div",{className:r.idCardDataCard,children:[Object(Me.jsxs)("div",{children:[Object(Me.jsxs)("div",{children:[Object(Me.jsx)(qj,{children:"Name"}),Object(Me.jsx)("div",{children:S.name})]}),Object(Me.jsxs)("div",{children:[Object(Me.jsx)(qj,{children:"Age"}),Object(Me.jsx)("div",{children:S.age})]}),Object(Me.jsxs)("div",{children:[Object(Me.jsx)(qj,{children:"Country"}),Object(Me.jsx)("div",{children:S.country})]})]}),Object(Me.jsxs)("div",{children:[Object(Me.jsxs)("div",{children:[Object(Me.jsx)(qj,{children:"ID number"}),Object(Me.jsx)("div",{children:S.idCardNumber})]}),Object(Me.jsxs)("div",{children:[Object(Me.jsx)(qj,{children:"Expiration date"}),Object(Me.jsx)("div",{children:S.idCardExpirationDate})]})]})]})}),t.customerFrontCameraPath&&Object(Me.jsx)(Yn,{name:"cam",Icon:Si,InverseIcon:tj,children:Object(Me.jsx)("img",{src:"".concat(Ij,"/front-camera-photo/").concat(t.customerFrontCameraPath),alt:""})})]})]}),Object(Me.jsxs)("div",{className:r.exchangeRate,children:[Object(Me.jsx)(qj,{children:"Exchange rate"}),Object(Me.jsx)("div",{children:y>0?N:"-"})]}),Object(Me.jsxs)("div",{className:r.commission,children:[Object(Me.jsx)(qj,{children:"Commission"}),Object(Me.jsxs)("div",{className:r.container,children:["".concat(C," ").concat(t.fiatCode," (").concat(100*w," %)"),k&&Object(Me.jsx)("div",{className:r.chip,children:Object(Me.jsx)(et,{className:r.chipLabel,children:k})})]})]}),Object(Me.jsxs)("div",{children:[Object(Me.jsx)(qj,{children:"Fixed fee"}),Object(Me.jsx)("div",{children:b?"".concat(Number.parseFloat(t.cashInFee)," ").concat(t.fiatCode):"N/A"})]})]}),Object(Me.jsxs)("div",{className:r.secondRow,children:[Object(Me.jsxs)("div",{className:r.address,children:[Object(Me.jsx)(qj,{children:"Address"}),Object(Me.jsx)("div",{children:Object(Me.jsx)(gf,{children:zj(t.cryptoCode,t.toAddress)})})]}),Object(Me.jsxs)("div",{className:r.transactionId,children:[Object(Me.jsx)(qj,{children:"Transaction ID"}),Object(Me.jsx)("div",{children:"cashOut"===t.txClass?"N/A":Object(Me.jsx)(gf,{children:t.txHash})})]}),Object(Me.jsxs)("div",{className:r.sessionId,children:[Object(Me.jsx)(qj,{children:"Session ID"}),Object(Me.jsx)(gf,{children:t.id})]})]}),Object(Me.jsxs)("div",{className:r.lastRow,children:[Object(Me.jsxs)("div",{className:r.status,children:[Bj(t)?Object(Me.jsx)(jp,{parentElements:P,width:200,children:Object(Me.jsx)(Xe,{children:Bj(t)})}):P,"cashOut"===t.txClass&&"Pending"===Rj(t)&&Object(Me.jsx)(ze,{color:"primary",Icon:lj,InverseIcon:ba,className:r.cancelTransaction,onClick:function(){return s({command:"cancelTx"})},children:"Cancel transaction"})]}),Object(Me.jsxs)("div",{children:[Object(Me.jsx)(qj,{children:"Other actions"}),Object(Me.jsx)("div",{className:r.otherActionsGroup,children:Object(Me.jsx)(ze,{color:"primary",Icon:yj,InverseIcon:hj,className:r.downloadRawLogs,onClick:function(){return function(e,t){var n=e.id,a=e.deviceId,r=e.txClass;g({variables:{txId:n,from:I,until:F,deviceId:a,txClass:r,timezone:t}})}(t,n)},children:"Download raw logs"})})]})]}),Object(Me.jsx)(eb,{open:"cancelTx"===c.command,title:"Cancel this transaction?",errorMessage:h,toBeConfirmed:t.machineName,message:b?"The user will not be able to redeem the inserted bills, even if they subsequently confirm the transaction. If they've already deposited bills, you'll need to reconcile this transaction with them manually.":"The user will not be able to redeem the cash, even if they subsequently send the required coins. If they've already sent you coins, you'll need to reconcile this transaction with them manually.",onConfirmed:function(){p(null),s({command:null}),x({variables:{id:t.id}})},onDismissed:function(){s({command:null}),p(null)}})]})},Hj=Object(a.memo)($j,(function(e,t){return e.it.id===t.it.id&&e.it.hasError===t.it.hasError&&Rj(e.it)===Rj(t.it)})),Vj=n(127),Uj={expandButton:{outline:"none",border:"none",backgroundColor:"transparent",cursor:"pointer",padding:4},rowWrapper:{padding:1},row:{border:[[2,"solid","transparent"]],borderRadius:0},expanded:{border:[[2,"solid",G]],boxShadow:"0 0 8px 0 rgba(0,0,0,0.08)"},before:{paddingTop:12},after:{paddingBottom:12},pointer:{cursor:"pointer"},body:{flex:[[1,1,"auto"]]},table:function(e){return{marginBottom:30,minHeight:200,width:e.width,flex:1,display:"flex",flexDirection:"column"}},emptyTable:{width:"100%",display:"flex",flexDirection:"column",alignItems:"center",marginTop:52}};function Gj(){return(Gj=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Xj(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var _j=a.createElement("desc",null,"Created with Sketch."),Zj=a.createElement("g",{id:"Styleguide",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"icon/action/expand/closed",transform:"translate(1.000000, 1.000000)",stroke:"#1B2559",strokeWidth:1.5},a.createElement("circle",{id:"Oval-4",cx:14,cy:2,r:2}),a.createElement("circle",{id:"Oval-4-Copy",cx:8,cy:2,r:2}),a.createElement("circle",{id:"Oval-4-Copy-2",cx:2,cy:2,r:2})));function Kj(e,t){var n=e.title,r=e.titleId,i=Xj(e,["title","titleId"]);return a.createElement("svg",Gj({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":r},i),n?a.createElement("title",{id:r},n):null,_j,Zj)}var Qj=a.forwardRef(Kj);n.p;function Yj(){return(Yj=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Jj(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var eg=a.createElement("desc",null,"Created with Sketch."),tg=a.createElement("g",{id:"Styleguide",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"icon/action/expand/open",transform:"translate(1.000000, 1.000000)",fill:"#1B2559",stroke:"#1B2559",strokeWidth:1.5},a.createElement("circle",{id:"Oval-4",cx:14,cy:2,r:2}),a.createElement("circle",{id:"Oval-4-Copy",cx:8,cy:2,r:2}),a.createElement("circle",{id:"Oval-4-Copy-2",cx:2,cy:2,r:2})));function ng(e,t){var n=e.title,r=e.titleId,i=Jj(e,["title","titleId"]);return a.createElement("svg",Yj({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":r},i),n?a.createElement("title",{id:r},n):null,eg,tg)}var ag,rg,ig,og,lg,cg=a.forwardRef(ng),sg=(n.p,Object(f.a)(Uj)),dg=function(e){var t,n=e.id,a=e.elements,r=e.data,i=e.width,o=e.Details,l=e.expanded,c=e.expandRow,d=e.expWidth,u=e.expandable,m=e.onClick,h=sg(),p=m||u,b=(t={},Object(z.a)(t,h.pointer,p),Object(z.a)(t,h.row,!0),Object(z.a)(t,h.expanded,l),t);return Object(Me.jsxs)("div",{className:h.rowWrapper,children:[Object(Me.jsx)("div",{className:I()(Object(z.a)({},h.before,l&&0!==n)),children:Object(Me.jsxs)(Cm,{className:I()(b),onClick:function(){u&&c(n),m&&m(r)},error:r.error,errorMessage:r.errorMessage,children:[a.map((function(e,t){var n=e.view,a=void 0===n?function(e){return null===e||void 0===e?void 0:e.toString()}:n,i=Object(q.a)(e,["view"]);return Object(Me.jsx)(vm,Object(s.a)(Object(s.a)({},i),{},{children:a(r)}),t)})),u&&Object(Me.jsx)(vm,{width:d,textAlign:"center",children:Object(Me.jsxs)("button",{onClick:function(){return c(n)},className:h.expandButton,children:[l&&Object(Me.jsx)(cg,{}),!l&&Object(Me.jsx)(Qj,{})]})})]})}),u&&l&&Object(Me.jsx)("div",{className:h.after,children:Object(Me.jsx)(Cm,{className:I()(Object(z.a)({},h.expanded,l)),children:Object(Me.jsx)(vm,{width:i,children:Object(Me.jsx)(o,{it:r})})})})]})},ug=function(e){var t=e.elements,n=void 0===t?[]:t,r=e.data,i=void 0===r?[]:r,o=e.Details,c=(e.className,e.expandable),d=e.initialExpanded,u=e.onClick,m=e.loading,h=e.emptyText,p=e.extraHeight,b=Object(q.a)(e,["elements","data","Details","className","expandable","initialExpanded","onClick","loading","emptyText","extraHeight"]),f=Object(a.useState)(d),j=Object(l.a)(f,2),g=j[0],O=j[1];Object(a.useEffect)((function(){return O(d)}),[d]);var x=L.a(ms.a,R.a(B.a("width")))(n),v=850-x,y=x+(c?v:0),w=sg({width:y}),C=function(e){O(e===g?null:e)},k=new Vj.c({defaultHeight:62,fixedWidth:!0});function E(e){var t=e.index,a=e.key,r=e.parent,l=e.style;return Object(Me.jsx)(Vj.b,{cache:k,columnIndex:0,parent:r,rowIndex:t,children:Object(Me.jsx)("div",{style:l,children:Object(Me.jsx)(dg,{width:y,id:t,expWidth:v,elements:n,data:i[t],Details:o,expanded:t===g,expandRow:C,expandable:c,onClick:u})})},a)}return Object(Me.jsx)(Ko.a,{display:"flex",flex:"1",flexDirection:"column",children:Object(Me.jsxs)(jm,{className:w.table,children:[Object(Me.jsxs)(gm,{children:[n.map((function(e,t){var n=e.width,a=e.className,r=e.textAlign,i=e.header;return Object(Me.jsx)(ym,{width:n,className:a,textAlign:r,children:i},t)})),c&&Object(Me.jsx)(ym,{width:v})]}),Object(Me.jsxs)(xm,{className:w.body,children:[m&&Object(Me.jsx)(Ue,{children:"Loading..."}),!m&&Wa.a(i)&&Object(Me.jsx)(Ue,{children:h}),Object(Me.jsx)(Vj.a,{disableWidth:!0,disableHeight:!0,children:function(){return Object(Me.jsx)(Vj.d,Object(s.a)(Object(s.a)({style:{overflowX:"inherit",outline:"none"}},b),{},{height:62*i.length+p,width:y,rowCount:i.length,rowHeight:k.rowHeight,rowRenderer:E,overscanRowCount:50,deferredMeasurementCache:k}))}})]})]})})},mg=Object(f.a)(ff),hg=x()(ag||(ag=Object(c.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"]))),pg=x()(rg||(rg=Object(c.a)(["\n query getData {\n config\n }\n"]))),bg=function(e){var t=e.id,n=mg(),r=Object(a.useState)(0),i=Object(l.a)(r,2),o=i[0],c=i[1],s=Object(a.useState)(""),d=Object(l.a)(s,2),m=d[0],h=d[1],p=Object(u.a)(hg,{variables:{limit:5,deviceId:t}}),b=Object(l.a)(p,2),f=b[0],j=b[1],g=j.data,O=j.loading,x=Object(u.c)(pg),v=x.data,y=x.loading,w=A.a(["config","locale_timezone"],v),C=O&&y;!C&&g&&(g.transactions=g.transactions.splice(0,5)),Object(a.useEffect)((function(){null!==t&&f()}),[f,t]);var k=[{header:"",width:0,size:"sm",view:function(e){return"cashOut"===e.txClass?Object(Me.jsx)(Bc,{}):Object(Me.jsx)(Sc,{})}},{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(wf.a(Cf.a,kf.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(yf.utils.toUnit(new Mc.a(e.cryptoAtoms),e.cryptoCode).toFormat(5)," ").concat(e.cryptoCode)}},{header:"Address",view:function(e){return yf.utils.formatCryptoAddress(e.cryptoCode,e.toAddress)},className:n.overflowTd,size:"sm",textAlign:"left",width:140},{header:"Date (UTC)",view:function(e){return ad(e.created,w,"yyyy-MM-dd")},textAlign:"left",size:"sm",width:140},{header:"Status",view:function(e){return Rj(e)},size:"sm",width:20}];return Object(Me.jsx)(ug,{extraHeight:o,onClick:function(e){m===e.id?(h(""),c(0)):(h(e.id),c(310))},loading:C||null===t,emptyText:"No transactions so far",elements:k,data:A.a(["transactions"])(g),Details:Hj,expandable:!0})},fg=Object(f.a)(_p),jg=x()(ig||(ig=Object(c.a)(["\n query getMachine($deviceId: ID!) {\n machine(deviceId: $deviceId) {\n name\n deviceId\n paired\n lastPing\n pairedAt\n version\n model\n cashbox\n cassette1\n cassette2\n cassette3\n cassette4\n numberOfCassettes\n statuses {\n label\n type\n }\n downloadSpeed\n responseTime\n packetLoss\n latestEvent {\n note\n }\n }\n config\n }\n"]))),gg=function(e){return e.slice(e.lastIndexOf("/")+1)},Og=function(){var e,t,n,a,r,i=Object(w.i)(),o=Object(u.c)(jg,{variables:{deviceId:gg(i.pathname)}}),l=o.data,c=o.loading,s=o.refetch,d=fg(),m=null!==(e=A.a(["config","locale_timezone"],l))&&void 0!==e?e:{},p=null!==(t=A.a(["machine"])(l))&&void 0!==t?t:{},b=null!==(n=A.a(["config"])(l))&&void 0!==n?n:{},f=null!==(a=A.a(["name"])(p))&&void 0!==a?a:null,j=null!==(r=A.a(["deviceId"])(p))&&void 0!==r?r:null;return!c&&Object(Me.jsxs)(h.a,{container:!0,className:d.grid,children:[Object(Me.jsx)(h.a,{item:!0,xs:3,children:Object(Me.jsx)(h.a,{item:!0,xs:12,children:Object(Me.jsxs)("div",{className:d.breadcrumbsContainer,children:[Object(Me.jsxs)(Ku.a,{separator:Object(Me.jsx)(Yu.a,{fontSize:"small"}),children:[Object(Me.jsx)(C.b,{to:"/dashboard",className:d.breadcrumbLink,children:Object(Me.jsx)(nt,{noMargin:!0,className:d.subtitle,children:"Dashboard"})}),Object(Me.jsx)(Je,{noMargin:!0,className:d.subtitle,children:f})]}),Object(Me.jsx)(vf,{data:p,onActionSuccess:s})]})})}),Object(Me.jsx)(h.a,{item:!0,xs:9,children:Object(Me.jsxs)("div",{className:d.content,children:[Object(Me.jsxs)("div",{className:I()(d.detailItem,d.detailsMargin),children:[Object(Me.jsx)(Ye,{className:d.subtitle,children:"Details"}),Object(Me.jsx)(Kp,{data:p,timezone:m})]}),Object(Me.jsxs)("div",{className:d.detailItem,children:[Object(Me.jsx)(Ye,{className:d.subtitle,children:"Cash cassettes"}),Object(Me.jsx)(Wp,{refetchData:s,machine:p,config:null!==b&&void 0!==b&&b})]}),Object(Me.jsxs)("div",{className:d.transactionsItem,children:[Object(Me.jsx)(Ye,{className:d.subtitle,children:"Latest transactions"}),Object(Me.jsx)(bg,{id:j})]}),Object(Me.jsxs)("div",{className:d.detailItem,children:[Object(Me.jsx)(Ye,{className:d.subtitle,children:"Commissions"}),Object(Me.jsx)(Xp,{name:"commissions",id:j})]})]})})]})},xg=n(64),vg=n.n(xg),yg=n(884),wg=n(274),Cg=n(886),kg=n(887),Eg={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}},Ng=zc.a((function(e,t){var n=B.a("fiatCurrency")(e);return L.a(R.a((function(e){return{code:parseInt(e),display:e}})),Wc.a,A.a([n]))(t)})),Sg={name:"All Machines",deviceId:"ALL_MACHINES"},Ig={display:"All Coins",code:"ALL_COINS"},Fg={marginLeft:6},Lg=Object(Me.jsxs)("div",{children:[Object(Me.jsx)(Sc,{}),Object(Me.jsx)("span",{style:Fg,children:"Cash-in"})]}),Pg=Object(Me.jsxs)("div",{children:[Object(Me.jsx)(Bc,{}),Object(Me.jsx)("span",{style:Fg,children:"Cash-out"})]}),Dg=function(e,t,n){return function(a){if(!e)return"";var r=Aa.a(W.a(null!==n&&void 0!==n?n:"code",a))(e);return r?B.a(t,r):"Unpaired machine"}},Rg=function(e){return function(t){return t?L.a(yg.a(", "),R.a(Dg(e,"display")))(t):t}},Bg=function(e,t,n){var a=F.a(Ig.code)(t),r=F.a(Ig.code)(e);return a&&r&&gn.a(t)>1?n(om.a(yd.a(Ig.code))(t)):a&&!r?n([Ig.code]):void n(t)},Tg=function(e){return[{header:Lg,name:"cashIn",display:"Cash-in",width:169,size:"lg",editingAlign:"right",input:ei,suffix:"%",bold:Va,inputProps:{decimalPlaces:3}},{header:Pg,name:"cashOut",display:"Cash-out",width:169,size:"lg",editingAlign:"right",input:ei,suffix:"%",bold:Va,inputProps:{decimalPlaces:3}},{name:"fixedFee",display:"Fixed fee",width:169,size:"lg",doubleHeader:"Cash-in only",textAlign:"center",editingAlign:"right",input:ei,suffix:e,bold:Va,inputProps:{decimalPlaces:2}},{name:"minimumTx",display:"Minimun Tx",width:169,size:"lg",doubleHeader:"Cash-in only",textAlign:"center",editingAlign:"right",input:ei,suffix:e,bold:Va,inputProps:{decimalPlaces:2}}]},Ag=function(e,t,n){return function(e,t,n){var a=[Sg].concat(e(["machines"])),r=e(["cryptoCurrencies"]),i=[Ig].concat(R.a((function(e){return{display:e.code,code:e.code}}))(null!==r&&void 0!==r?r:[]));return[{name:"machine",width:196,size:"sm",view:Dg(a,"name","deviceId"),input:Tr,inputProps:{options:a,valueProp:"deviceId",labelProp:"name"}},{name:"cryptoCurrencies",width:280,size:"sm",view:Rg(i),input:Tr,inputProps:{options:i,valueProp:"code",labelProp:"display",multiple:!0,onChange:Bg,shouldStayOpen:!0}},{header:Lg,name:"cashIn",display:"Cash-in",width:130,input:ei,textAlign:"right",suffix:"%",bold:Va,inputProps:{decimalPlaces:3}},{header:Pg,name:"cashOut",display:"Cash-out",width:130,input:ei,textAlign:"right",suffix:"%",bold:Va,inputProps:{decimalPlaces:3}},{name:"fixedFee",display:"Fixed fee",width:144,input:ei,doubleHeader:"Cash-in only",textAlign:"right",suffix:t,bold:Va,inputProps:{decimalPlaces:2}},{name:"minimumTx",display:"Minimun Tx",width:169,doubleHeader:"Cash-in only",textAlign:"center",editingAlign:"right",input:ei,suffix:t,bold:Va,inputProps:{decimalPlaces:2}}]}(A.a(tm.a,e),t)},Mg=100,Wg=function(e){var t=Ng(e,Eg).map((function(e){return parseInt(e.code)})),n=Wa.a(t)?Wh:Math.max.apply(Math,Object(d.a)(t));return xn.f().shape({cashIn:xn.e().label("Cash-in").min(0).max(Mg).required(),cashOut:xn.e().label("Cash-out").min(0).max(Mg).required(),fixedFee:xn.e().label("Fixed Fee").min(0).max(n).required(),minimumTx:xn.e().label("Minimum Tx").min(0).max(n).required()})},zg=function(e,t,n){var a=A.a(tm.a,t),r=[Sg].concat(a(["machines"])),i=a(["cryptoCurrencies"]),o=[Ig].concat(R.a((function(e){return{display:e.code,code:e.code}}))(null!==i&&void 0!==i?i:[])),l=Ng(n,Eg).map((function(e){return parseInt(e.code)})),c=Wa.a(l)?Wh:Math.max.apply(Math,Object(d.a)(l));return xn.f().shape({machine:xn.h().nullable().label("Machine").required(),cryptoCurrencies:xn.a().test({test:function(){var t=this.parent,n=t.id,a=t.machine,i=t.cryptoCurrencies,l=function(e,t,n){var a=B.a("cryptoCurrencies"),r=B.a("machine"),i=M.a(W.a("machine",t))(n),o=Aa.a(W.a("id",e))(n),l=a(o),c=r(o),s=L.a(wg.a,ol.a,R.a(a))(i);return t!==c?null!==s&&void 0!==s?s:[]:Cg.a(s,l)}(n,a,e),c=a===Sg.deviceId,s=F.a(Ig.code,i);if(c&&s)return this.createError({message:"All machines and all coins should be configured in the default setup table"});var d=kg.a(l,i);if(!Wa.a(d)){var u=Rg(o)(d),m=Dg(r,"name","deviceId")(a),h="".concat(u," already overriden for machine: ").concat(m);return this.createError({message:h})}return!0}}).label("Crypto Currencies").required().min(1),cashIn:xn.e().label("Cash-in").min(0).max(Mg).required(),cashOut:xn.e().label("Cash-out").min(0).max(Mg).required(),fixedFee:xn.e().label("Fixed Fee").min(0).max(c).required(),minimumTx:xn.e().label("Minimum Tx").min(0).max(c).required()})},qg={cashIn:"",cashOut:"",fixedFee:"",minimumTx:""},$g={machine:null,cryptoCurrencies:[],cashIn:"",cashOut:"",fixedFee:"",minimumTx:""},Hg=function(e){var t=e.machine,n=e.cryptoCurrencies,a=t===Sg.deviceId,r=ul.a(Ig.code,n);return a&&r?0:a?1:r?2:3},Vg=function(e,t,n,a){return{minimumTx:a.minimumTx,fixedFee:a.fixedFee,cashOut:a.cashOut,cashIn:a.cashIn,machine:t,cryptoCurrencies:[e],default:n,id:Object(cm.a)()}},Ug=function(e){var t=Ng(e,Eg).map((function(e){return parseInt(e.code)})),n=Wa.a(t)?Wh:Math.max.apply(Math,Object(d.a)(t));return xn.f().shape({machine:xn.h().label("Machine").required(),cryptoCurrencies:xn.a().label("Crypto Currency").required().min(1),cashIn:xn.e().label("Cash-in").min(0).max(Mg).required(),cashOut:xn.e().label("Cash-out").min(0).max(Mg).required(),fixedFee:xn.e().label("Fixed Fee").min(0).max(n).required(),minimumTx:xn.e().label("Minimum Tx").min(0).max(n).required()})},Gg=function(e,t){return{color:e.default?J:te}},Xg=function(e,t,n){var a=A.a(tm.a,e);return _g(a,t,qg)},_g=function(e,t,n){var a=[Sg].concat(e(["machines"]));return[{name:"machine",width:196,size:"sm",view:Dg(a,"name","deviceId"),editable:!1},{name:"cryptoCurrencies",display:"Crypto Currency",width:265,view:B.a(0),size:"sm",editable:!1},{header:Lg,name:"cashIn",display:"Cash-in",width:130,input:ei,textAlign:"right",suffix:"%",textStyle:function(e){return Gg(e)},inputProps:{decimalPlaces:3}},{header:Pg,name:"cashOut",display:"Cash-out",width:130,input:ei,textAlign:"right",greenText:!0,suffix:"%",textStyle:function(e){return Gg(e)},inputProps:{decimalPlaces:3}},{name:"fixedFee",display:"Fixed fee",width:144,input:ei,doubleHeader:"Cash-in only",textAlign:"right",suffix:t,textStyle:function(e){return Gg(e)},inputProps:{decimalPlaces:2}},{name:"minimumTx",display:"Minimun Tx",width:144,input:ei,doubleHeader:"Cash-in only",textAlign:"right",suffix:t,textStyle:function(e){return Gg(e)},inputProps:{decimalPlaces:2}}]},Zg=n(890),Kg=n(457),Qg=n(889),Yg=function(e){var t=Hc.a(e);return hs.a((function(e,t){var n=Object(Qg.a)(t[0])<0,a=Object(Kg.a)({start:0,end:Math.abs(Object(Qg.a)(t[0]))}),r=a.hours.toLocaleString("en-US",{minimumIntegerDigits:2,useGrouping:!1}),i=a.minutes.toLocaleString("en-US",{minimumIntegerDigits:2,useGrouping:!1}),o="(GMT".concat(n?"-":"+").concat(r,":").concat(i,")");return e.push({label:"".concat(o," - ").concat(t[1]),code:t[0]}),e}),[],t)}({"Pacific/Midway":"Midway Island, Samoa","Pacific/Honolulu":"Hawaii","America/Juneau":"Alaska","America/Boise":"Mountain Time","America/Dawson":"Dawson, Yukon","America/Chihuahua":"Chihuahua, La Paz, Mazatlan","America/Phoenix":"Arizona","America/Chicago":"Central Time","America/Regina":"Saskatchewan","America/Mexico_City":"Guadalajara, Mexico City, Monterrey","America/Belize":"Central America","America/Detroit":"Eastern Time","America/Bogota":"Bogota, Lima, Quito","America/Caracas":"Caracas, La Paz","America/Santiago":"Santiago","America/St_Johns":"Newfoundland and Labrador","America/Sao_Paulo":"Brasilia","America/Tijuana":"Tijuana","America/Montevideo":"Montevideo","America/Argentina/Buenos_Aires":"Buenos Aires, Georgetown","America/Godthab":"Greenland","America/Los_Angeles":"Pacific Time","Atlantic/Azores":"Azores","Atlantic/Cape_Verde":"Cape Verde Islands",GMT:"UTC","Europe/London":"Edinburgh, London","Europe/Dublin":"Dublin","Europe/Lisbon":"Lisbon","Africa/Casablanca":"Casablanca, Monrovia","Atlantic/Canary":"Canary Islands","Europe/Belgrade":"Belgrade, Bratislava, Budapest, Ljubljana, Prague","Europe/Sarajevo":"Sarajevo, Skopje, Warsaw, Zagreb","Europe/Brussels":"Brussels, Copenhagen, Madrid, Paris","Europe/Amsterdam":"Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna","Africa/Algiers":"West Central Africa","Europe/Bucharest":"Bucharest","Africa/Cairo":"Cairo","Europe/Helsinki":"Helsinki, Kiev, Riga, Sofia, Tallinn, Vilnius","Europe/Athens":"Athens, Istanbul, Minsk","Asia/Jerusalem":"Jerusalem","Africa/Harare":"Harare, Pretoria","Europe/Moscow":"Moscow, St. Petersburg, Volgograd","Asia/Kuwait":"Kuwait, Riyadh","Africa/Nairobi":"Nairobi","Asia/Baghdad":"Baghdad","Asia/Tehran":"Tehran","Asia/Dubai":"Abu Dhabi, Muscat","Asia/Baku":"Baku, Tbilisi, Yerevan","Asia/Kabul":"Kabul","Asia/Yekaterinburg":"Ekaterinburg","Asia/Karachi":"Islamabad, Karachi, Tashkent","Asia/Kolkata":"Chennai, Kolkata, Mumbai, New Delhi","Asia/Kathmandu":"Kathmandu","Asia/Dhaka":"Astana, Dhaka","Asia/Colombo":"Sri Jayawardenepura","Asia/Almaty":"Almaty, Novosibirsk","Asia/Rangoon":"Yangon Rangoon","Asia/Bangkok":"Bangkok, Hanoi, Jakarta","Asia/Krasnoyarsk":"Krasnoyarsk","Asia/Shanghai":"Beijing, Chongqing, Hong Kong SAR, Urumqi","Asia/Kuala_Lumpur":"Kuala Lumpur, Singapore","Asia/Taipei":"Taipei","Australia/Perth":"Perth","Asia/Irkutsk":"Irkutsk, Ulaanbaatar","Asia/Seoul":"Seoul","Asia/Tokyo":"Osaka, Sapporo, Tokyo","Asia/Yakutsk":"Yakutsk","Australia/Darwin":"Darwin","Australia/Adelaide":"Adelaide","Australia/Sydney":"Canberra, Melbourne, Sydney","Australia/Brisbane":"Brisbane","Australia/Hobart":"Hobart","Asia/Vladivostok":"Vladivostok","Pacific/Guam":"Guam, Port Moresby","Asia/Magadan":"Magadan, Solomon Islands, New Caledonia","Asia/Kamchatka":"Kamchatka, Marshall Islands","Pacific/Fiji":"Fiji Islands","Pacific/Auckland":"Auckland, Wellington","Pacific/Tongatapu":"Nuku'alofa"}),Jg=function(e,t,n){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return M.a((function(e){return F.a(e.name,t)}),eO(e,n,a))},eO=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],a=function(e,t,n){return function(a){return e?L.a(B.a(t),Aa.a(W.a(null!==n&&void 0!==n?n:"code",a)))(e):""}},r=function(e){return function(t){return t?L.a(yg.a(", "),R.a(a(e,"code")))(t):t}},i=R.a((function(e){return e.machine}),n),o=function(e){return Zg.a((function(e,t){return e.deviceId===t}),e,i)},l=e(["machines"]),c=e(["countries"]),s=e(["currencies"]),d=e(["languages"]),u=e(["cryptoCurrencies"]),m=Yg,h=function(e){var t=Aa.a(W.a("deviceId",e.machine))(l);return t?[t]:[]};return[{name:"machine",width:200,size:"sm",view:a(l,"name","deviceId"),input:Tr,inputProps:{options:function(e){return ll.a(h(e))(o(l))},valueProp:"deviceId",labelProp:"name"}},{name:"country",width:200,size:"sm",view:a(c,"display"),input:Tr,inputProps:{options:c,valueProp:"code",labelProp:"display"}},{name:"fiatCurrency",width:150,size:"sm",view:a(s,"code"),input:Tr,inputProps:{options:s,valueProp:"code",labelProp:"code"}},{name:"languages",width:200,size:"sm",view:r(d),input:Tr,inputProps:{options:d,valueProp:"code",labelProp:"display",multiple:!0}},{name:"cryptoCurrencies",width:170,size:"sm",view:r(u),input:Tr,inputProps:{options:u,valueProp:"code",labelProp:"code",multiple:!0,optionsLimit:null,onChange:t}},{name:"timezone",width:320,size:"sm",view:a(m,"label"),input:Tr,inputProps:{options:m,valueProp:"code",labelProp:"label"}}]},tO=function(e,t){var n=A.a(tm.a,e);return Jg(n,["country","fiatCurrency","languages","cryptoCurrencies","timezone"],t,void 0)},nO=function(e,t,n){var a=A.a(tm.a,e);return Jg(a,["machine","country","languages","cryptoCurrencies"],n,t)},aO=xn.f().shape({country:xn.h().label("Country").required(),fiatCurrency:xn.h().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.h().label("Timezone").required()}),rO=xn.f().shape({machine:xn.h().label("Machine").required(),country:xn.h().label("Country").required(),languages:xn.a().label("Languages").required().min(1).max(4),cryptoCurrencies:xn.a().label("Crypto Currencies").required().min(1)}),iO={country:"",fiatCurrency:"",languages:[],cryptoCurrencies:[],timezone:""},oO={machine:"",country:"",languages:[],cryptoCurrencies:[]},lO={editDisabled:{color:oe}},cO=function(e){return M.a((function(t){return t.class===e}))},sO=function(e){var t=e.id;return M.a((function(e){return ul.a(t)(e.cryptos)}))},dO=xn.f().shape({ticker:xn.h().required(),wallet:xn.h().required(),exchange:xn.h().required(),zeroConf:xn.h().required(),zeroConfLimit:xn.e().integer().required("Zero Conf Limit is a required field").min(0).max(Wh).transform(Vh)}),uO=xn.f().shape({cryptoUnits:xn.h().required()}),mO=function(e,t){var n=zc.a((function(e,t){var n=Wc.a(e.getCryptoCurrency(t.id).units);return R.a((function(e){return{code:e,display:e}}))(n)}));return[{name:"id",header:"Cryptocurrency",width:180,view:function(t){return L.a(B.a(["display"]),Aa.a(W.a("code",t)))(e)},size:"sm",editable:!1},{name:"cryptoUnits",size:"sm",stripe:!0,width:190,input:Tr,inputProps:{options:n(t),valueProp:"code",labelProp:"display"}}]},hO=function(e,t,n){var a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=a?11:0,i=function(t){return L.a(B.a(["display"]),Aa.a(W.a("code",t)))(e)},o=function(e){return cO(e)(t||[])},l=function(e){return function(t){return L.a(B.a("display"),Aa.a(W.a("code",t)))(o(e))}},c=zc.a((function(e,t){return sO(t)(o(e))}));return[{name:"id",header:"Cryptocurrency",width:150-r,view:i,size:"sm",editable:!1},{name:"ticker",size:"sm",stripe:!0,view:l("ticker"),width:175-r,input:Tr,inputProps:{options:c("ticker"),valueProp:"code",labelProp:"display",optionsLimit:null}},{name:"wallet",size:"sm",stripe:!0,view:l("wallet"),width:175-r,input:Tr,inputProps:{options:c("wallet"),valueProp:"code",labelProp:"display",optionsLimit:null,onChange:n}},{name:"exchange",size:"sm",stripe:!0,view:l("exchange"),width:175-r,input:Tr,inputProps:{options:c("exchange"),valueProp:"code",labelProp:"display",optionsLimit:null,onChange:n}},{name:"zeroConf",header:"Confidence Checking",size:"sm",stripe:!0,view:l("zeroConf"),input:Tr,width:210-r,inputProps:{options:c("zeroConf"),valueProp:"code",labelProp:"display",optionsLimit:null,onChange:n}},{name:"zeroConfLimit",header:"0-conf Limit",size:"sm",stripe:!0,view:function(e,t){return"ETH"===t.id?Object(Me.jsx)("span",{style:lO.editDisabled,children:e}):e},input:ei,width:145-r,inputProps:{decimalPlaces:0},editable:function(e){return"ETH"!==e.id}}]},pO=Object(f.a)({subtitle:{color:se,marginTop:16,marginBottom:16},extraMarginTop:{marginTop:72}}),bO=Object(a.memo)((function(e){var t,n=e.children,a=e.className,r=e.extraMarginTop,i=pO(),o=(t={},Object(z.a)(t,i.subtitle,!0),Object(z.a)(t,i.extraMarginTop,r),t);return Object(Me.jsx)(Ye,{className:I()(o,a),children:n})})),fO=Object(f.a)({section:{marginBottom:72},sectionHeader:{display:"flex",alignItems:"center"},sectionTitle:{margin:[[16,20,23,0]]}}),jO=function(e){var t=e.error,n=e.children,a=e.title,r=fO();return Object(Me.jsxs)("div",{className:r.section,children:[(a||t)&&Object(Me.jsxs)("div",{className:r.sectionHeader,children:[Object(Me.jsx)(bO,{className:r.sectionTitle,children:a}),t&&Object(Me.jsx)(Jo,{children:"Failed to save changes"})]}),n]})},gO=Object(f.a)(Gi),OO=Object(f.a)({autoComplete:{width:"100%"}}),xO=x()(og||(og=Object(c.a)(["\n query getData {\n config\n }\n"]))),vO=x()(lg||(lg=Object(c.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"])));var yO,wO,CO=function(e){var t=e.isActive,n=e.doContinue,a=gO(),r=(OO(),Object(u.c)(xO).data),i=Object(u.b)(vO,{onCompleted:n}),o=Object(l.a)(i,1)[0],c=A.a(["fiatCurrency"])(rs(Zc)(null===r||void 0===r?void 0:r.config)),s=rs(Zc)(null===r||void 0===r?void 0:r.config);return Object(Me.jsxs)("div",{className:a.wrapper,children:[Object(Me.jsx)(nl,{title:"Commissions"}),Object(Me.jsx)(jO,{children:Object(Me.jsx)(Rh,{title:"Default setup",rowSize:"lg",titleLg:!0,name:"commissions",initialValues:qg,enableEdit:!0,forceAdd:t,save:function(e){var t=is("commissions")(e.commissions[0]);return o({variables:{config:t}})},validationSchema:Wg(s),data:[],elements:Tg(c)})})]})},kO=Object(f.a)(Gi),EO=x()(yO||(yO=Object(c.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"]))),NO=x()(wO||(wO=Object(c.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"])));var SO,IO,FO=function(e){var t=e.isActive,n=e.doContinue,a=kO(),r=Object(u.c)(EO).data,i=Object(u.b)(NO,{onCompleted:n}),o=Object(l.a)(i,1)[0],c=Zx((null===r||void 0===r?void 0:r.config)||{},(null===r||void 0===r?void 0:r.cryptoCurrencies)||[]);return Object(Me.jsxs)("div",{className:a.wrapper,children:[Object(Me.jsx)(nl,{title:"Locales"}),Object(Me.jsx)(jO,{children:Object(Me.jsx)(Rh,{title:"Default settings",rowSize:"lg",titleLg:!0,name:"locale",initialValues:iO,forceAdd:t,enableEdit:!0,save:function(e){var t=is("locale")(e.locale[0]);return o({variables:{config:t}})},validationSchema:aO,data:[],elements:tO(Gn.a(r,{cryptoCurrencies:c}),(function(e,t,n){return n(t)}))})})]})},LO=Object(f.a)({message:function(e){return{width:e.width,marginTop:4,marginLeft:16}}}),PO=function(e){var t=e.children,n=e.width,a=void 0===n?330:n,r=e.className,i=LO({width:a});return Object(Me.jsxs)(Ko.a,{display:"flex",className:r,children:[Object(Me.jsx)(ir,{}),Object(Me.jsx)(et,{className:i.message,children:t})]})},DO=n(892),RO=Object(f.a)({button:{margin:[["auto",0,32,"auto"]]},form:{flex:1,display:"flex",flexDirection:"column"},grid:{marginBottom:24,marginTop:12}}),BO=function(e){var t=e.validationSchema,n=e.elements,a=e.value,r=e.save,i=e.buttonLabel,o=void 0===i?"Save changes":i,l=e.buttonClass,c=e.xs,d=void 0===c?12:c,u=RO(),m=L.a(DO.a,R.a((function(e){var t,n=e.code;return Object(z.a)({},n,null!==(t=a&&a[n])&&void 0!==t?t:"")})))(n),p=Gn.a(m,a);return Object(Me.jsx)(bn.e,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,initialValues:p,validationSchema:t,onSubmit:function(e){var t=L.a(R.a(B.a("code")),M.a((function(t){return B.a("component",t)===ni&&Wa.a(e[B.a("code",t)])})))(n);return r(am.a(t,e))},children:Object(Me.jsxs)(bn.d,{className:u.form,children:[Object(Me.jsx)(h.a,{container:!0,spacing:3,className:u.grid,children:n.map((function(e){var t=e.component,n=e.code,a=e.display,r=e.settings,i=e.inputProps;return Object(Me.jsx)(h.a,{item:!0,xs:d,children:Object(Me.jsx)(bn.a,Object(s.a)(Object(s.a)({component:t},i),{},{name:n,label:a,settings:r,fullWidth:!0}))},n)}))}),Object(Me.jsx)(An,{className:I()(u.button,l),type:"submit",children:o})]})})},TO=function(e){return{test:function(t){return!D.a(e)||!D.a(t)||this.createError()}}},AO={code:"twilio",name:"Twilio",title:"Twilio (SMS)",elements:[{code:"accountSid",display:"Account SID",component:ai},{code:"authToken",display:"Auth Token",component:ni},{code:"fromNumber",display:"Twilio Number (international format)",component:ai,face:!0},{code:"toNumber",display:"Notifications Number (international format)",component:ai,face:!0}],getValidationSchema:function(e){return xn.f().shape({accountSid:xn.h().max(100,"Too long").required(),authToken:xn.h().max(100,"Too long").test(TO(null===e||void 0===e?void 0:e.authToken)),fromNumber:xn.h().max(100,"Too long").required(),toNumber:xn.h().max(100,"Too long").required()})}},MO={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]]}},WO=x()(SO||(SO=Object(c.a)(["\n {\n config\n accounts\n }\n"]))),zO=x()(IO||(IO=Object(c.a)(["\n mutation Save($accounts: JSONObject) {\n saveAccounts(accounts: $accounts)\n }\n"]))),qO=Object(f.a)(Object(s.a)(Object(s.a)({},MO),{},{content:{width:820},radioLabel:Object(s.a)(Object(s.a)({},MO.radioLabel),{},{width:280}),wrapper:{width:1200,height:100,margin:[[0,"auto"]]},title:{marginLeft:8,marginBottom:5},info:{marginTop:20,marginBottom:20}})),$O=[{code:"enable",display:"Yes, I will"},{code:"disable",display:"No, not for now"}];var HO,VO,UO,GO,XO,_O,ZO,KO,QO,YO,JO,ex=function(e){var t,n,r=e.doContinue,i=qO(),o=Object(a.useState)(null),c=Object(l.a)(o,2),s=c[0],d=c[1],m=Object(a.useState)(!1),h=Object(l.a)(m,2),p=h[0],b=h[1],f=Object(u.c)(WO),j=f.data,g=f.refetch,O=Object(u.b)(zO,{onCompleted:r}),x=Object(l.a)(O,1)[0],v=null!==(t=null===j||void 0===j?void 0:j.accounts)&&void 0!==t?t:[],y=(n={},Object(z.a)(n,i.title,!0),Object(z.a)(n,i.error,p),n);return Object(Me.jsx)("div",{className:i.wrapper,children:Object(Me.jsxs)("div",{className:i.content,children:[Object(Me.jsx)($e,{children:"Twilio (SMS service)"}),Object(Me.jsxs)(Ko.a,{display:"flex",alignItems:"end",children:[Object(Me.jsx)(Ue,{noMargin:!0,className:I()(y),children:"Will you setup a two way machine or compliance?"}),Object(Me.jsxs)(fp,{width:304,children:[Object(Me.jsx)(Xe,{children:"Two-way machines allow your customers not only to buy (cash-in) but also sell cryptocurrencies (cash-out)."}),Object(Me.jsx)(Xe,{children:"You\u2019ll need an SMS service for cash-out transactions and for any compliance triggers"})]})]}),Object(Me.jsx)(Er,{labelClassName:i.radioLabel,className:i.radioGroup,options:$O,value:s,onChange:function(e){d(e.target.value),b(!1)}}),Object(Me.jsx)(PO,{className:i.info,children:"To set up Twilio please read the instructions from our support portal."}),Object(Me.jsx)(Da,{link:"https://support.lamassu.is/hc/en-us/articles/115001203951-Twilio-for-SMS",label:"Twilio for SMS"}),"enable"===s&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Ue,{noMargin:!0,children:"Enter credentials"}),Object(Me.jsx)(BO,{xs:6,save:function(e){return x({variables:{accounts:{twilio:e}}}).then((function(){return g()}))},value:v.twilio,elements:AO.elements,validationSchema:AO.validationSchema,buttonLabel:"Continue",buttonClass:i.formButton})]}),"enable"!==s&&Object(Me.jsx)(An,{size:"lg",onClick:function(){if(!s)return b(!0);r()},className:i.button,children:"Continue"})]})})},tx=n(893),nx=Object(f.a)(MO),ax=x()(HO||(HO=Object(c.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"]))),rx=x()(VO||(VO=Object(c.a)(["\n mutation Save($config: JSONObject, $accounts: JSONObject) {\n saveConfig(config: $config)\n saveAccounts(accounts: $accounts)\n }\n"]))),ix=function(e){var t,n=e.data,r=e.doContinue,i=nx(),o=Object(u.c)(ax).data,c=Object(u.b)(rx,{onCompleted:r}),d=Object(l.a)(c,1)[0],m=Object(a.useState)(!1),h=Object(l.a)(m,2),p=h[0],b=h[1],f=null===n||void 0===n?void 0:n.coin,j=null===o||void 0===o?void 0:o.accountsConfig,g=null!==(t=null===o||void 0===o?void 0:o.cryptoCurrencies)&&void 0!==t?t:[];return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Ue,{className:p&&i.error,children:"All set"}),Object(Me.jsx)(Xe,{children:"These are your wallet settings. You can later edit these and add additional coins."}),Object(Me.jsx)(Bh,{rowSize:"lg",titleLg:!0,name:"All set",namespaces:[f],data:is(f,am.a("coin",n)),elements:hO(g,j,!0)}),Object(Me.jsx)(An,{size:"lg",onClick:function(){var e=kf.a(Wc.a(yf.utils.getCryptoCurrency(f).units)),t=Object(s.a)(Object(s.a)({zeroConfLimit:0},n),{},{cryptoUnits:e});if(!dO.isValidSync(t))return b(!0);var a=is(f,am.a("coin",t)),r=is(Gc)(a);return b(!1),d({variables:{config:r}})},className:i.button,children:"Continue"})]})},ox={code:"binanceus",name:"Binance.us",title:"Binance.us (Exchange)",elements:[{code:"apiKey",display:"API Key",component:ai,face:!0,long:!0},{code:"privateKey",display:"Private Key",component:ni}],getValidationSchema:function(e){return xn.f().shape({apiKey:xn.h().max(100,"Too long").required(),privateKey:xn.h().max(100,"Too long").test(TO(null===e||void 0===e?void 0:e.privateKey))})}},lx=function(e){return e&&e.length},cx=function(e,t){return xn.h().max(100,"Too long").when(e,{is:lx,then:xn.h().test(TO(t))})},sx={code:"bitgo",name:"BitGo",title:"BitGo (Wallet)",elements:[{code:"token",display:"API Token",component:ai,face:!0,long:!0},{code:"environment",display:"Environment",component:Tr,inputProps:{options:[{code:"prod",display:"prod"},{code:"test",display:"test"}],labelProp:"display",valueProp:"code"},face:!0},{code:"BTCWalletId",display:"BTC Wallet ID",component:ai},{code:"BTCWalletPassphrase",display:"BTC Wallet Passphrase",component:ni},{code:"LTCWalletId",display:"LTC Wallet ID",component:ai},{code:"LTCWalletPassphrase",display:"LTC Wallet Passphrase",component:ni},{code:"ZECWalletId",display:"ZEC Wallet ID",component:ai},{code:"ZECWalletPassphrase",display:"ZEC Wallet Passphrase",component:ni},{code:"BCHWalletId",display:"BCH Wallet ID",component:ai},{code:"BCHWalletPassphrase",display:"BCH Wallet Passphrase",component:ni},{code:"DASHWalletId",display:"DASH Wallet ID",component:ai},{code:"DASHWalletPassphrase",display:"DASH Wallet Passphrase",component:ni}],getValidationSchema:function(e){return xn.f().shape({token:xn.h().max(100,"Too long").required(),BTCWalletId:xn.h().max(100,"Too long"),BTCWalletPassphrase:cx("BTCWalletId",null===e||void 0===e?void 0:e.BTCWalletPassphrase),LTCWalletId:xn.h().max(100,"Too long"),LTCWalletPassphrase:cx("LTCWalletId",null===e||void 0===e?void 0:e.LTCWalletPassphrase),ZECWalletId:xn.h().max(100,"Too long"),ZECWalletPassphrase:cx("ZECWalletId",null===e||void 0===e?void 0:e.ZECWalletPassphrase),BCHWalletId:xn.h().max(100,"Too long"),BCHWalletPassphrase:cx("BCHWalletId",null===e||void 0===e?void 0:e.BCHWalletPassphrase),DASHWalletId:xn.h().max(100,"Too long"),DASHWalletPassphrase:cx("DASHWalletId",null===e||void 0===e?void 0:e.DASHWalletPassphrase),environment:xn.h().matches(/(prod|test)/).required()})}},dx={code:"bitstamp",name:"Bitstamp",title:"Bitstamp (Exchange)",elements:[{code:"clientId",display:"Client ID",component:ai,face:!0,long:!0},{code:"key",display:"API Key",component:ai,face:!0,long:!0},{code:"secret",display:"API Secret",component:ni}],getValidationSchema:function(e){return xn.f().shape({clientId:xn.h().max(100,"Too long").required(),key:xn.h().max(100,"Too long").required(),secret:xn.h().max(100,"Too long").test(TO(null===e||void 0===e?void 0:e.secret))})}},ux={code:"blockcypher",name:"Blockcypher",title:"Blockcypher (Payments)",elements:[{code:"token",display:"API Token",component:ai,face:!0,long:!0},{code:"confidenceFactor",display:"Confidence Factor",component:ai,face:!0},{code:"rbf",component:Yr,settings:{enabled:!0,disabledMessage:"RBF verification not available",label:"Enable RBF verification",requirement:"bitcoind"},face:!0}],getValidationSchema:function(){return xn.f().shape({token:xn.h().max(100,"Too long").required(),confidenceFactor:xn.e().integer("Please input a positive integer").positive("Please input a positive integer").required()})}},mx={code:"cex",name:"Cex",title:"Cex (Exchange)",elements:[{code:"apiKey",display:"API Key",component:ai,face:!0,long:!0},{code:"privateKey",display:"Private Key",component:ni}],getValidationSchema:function(e){return xn.f().shape({apiKey:xn.h().max(100,"Too long").required(),privateKey:xn.h().max(100,"Too long").test(TO(null===e||void 0===e?void 0:e.privateKey))})}},hx={code:"ftx",name:"Ftx",title:"Ftx (Exchange)",elements:[{code:"apiKey",display:"API Key",component:ai,face:!0,long:!0},{code:"privateKey",display:"Private Key",component:ni}],getValidationSchema:function(e){return xn.f().shape({apiKey:xn.h().max(100,"Too long").required(),privateKey:xn.h().max(100,"Too long").test(TO(null===e||void 0===e?void 0:e.privateKey))})}},px={code:"infura",name:"Infura",title:"Infura (Wallet)",elements:[{code:"apiKey",display:"Project ID",component:ai,face:!0,long:!0},{code:"apiSecret",display:"Project Secret",component:ni},{code:"endpoint",display:"Endpoint",component:ai,face:!0}],getValidationSchema:function(e){return xn.f().shape({apiKey:xn.h().max(100,"Too long").required(),apiSecret:xn.h().max(100,"Too long").test(TO(null===e||void 0===e?void 0:e.apiSecret)),endpoint:xn.h().max(100,"Too long").required()})}},bx={code:"itbit",name:"itBit",title:"itBit (Exchange)",elements:[{code:"userId",display:"User ID",component:ai,face:!0,long:!0},{code:"walletId",display:"Wallet ID",component:ai,face:!0,long:!0},{code:"clientKey",display:"Client Key",component:ai},{code:"clientSecret",display:"Client Secret",component:ni}],getValidationSchema:function(e){return xn.f().shape({userId:xn.h().max(100,"Too long").required(),walletId:xn.h().max(100,"Too long").required(),clientKey:xn.h().max(100,"Too long").required(),clientSecret:xn.h().max(100,"Too long").test(TO(null===e||void 0===e?void 0:e.clientSecret))})}},fx={code:"kraken",name:"Kraken",title:"Kraken (Exchange)",elements:[{code:"apiKey",display:"API Key",component:ai,face:!0,long:!0},{code:"privateKey",display:"Private Key",component:ni}],getValidationSchema:function(e){return xn.f().shape({apiKey:xn.h().max(100,"Too long").required(),privateKey:xn.h().max(100,"Too long").test(TO(null===e||void 0===e?void 0:e.privateKey))})}},jx={code:"mailgun",name:"Mailgun",title:"Mailgun (Email)",elements:[{code:"apiKey",display:"API Key",component:ai},{code:"domain",display:"Domain",component:ai},{code:"fromEmail",display:"From Email",component:ai,face:!0},{code:"toEmail",display:"To Email",component:ai,face:!0}],getValidationSchema:function(){return xn.f().shape({apiKey:xn.h().max(100,"Too long").required(),domain:xn.h().max(100,"Too long").required(),fromEmail:xn.h().max(100,"Too long").email("Please input a valid email address").required(),toEmail:xn.h().max(100,"Too long").email("Please input a valid email address").required()})}},gx=(UO={},Object(z.a)(UO,sx.code,sx),Object(z.a)(UO,dx.code,dx),Object(z.a)(UO,ux.code,ux),Object(z.a)(UO,px.code,px),Object(z.a)(UO,bx.code,bx),Object(z.a)(UO,fx.code,fx),Object(z.a)(UO,jx.code,jx),Object(z.a)(UO,AO.code,AO),Object(z.a)(UO,ox.code,ox),Object(z.a)(UO,mx.code,mx),Object(z.a)(UO,hx.code,hx),UO),Ox=Object(f.a)(Object(s.a)(Object(s.a)({},MO),{},{radioGroup:MO.radioGroup,radioLabel:Object(s.a)(Object(s.a)({},MO.radioLabel),{},{width:200})})),xx=x()(GO||(GO=Object(c.a)(["\n {\n accounts\n }\n"]))),vx=x()(XO||(XO=Object(c.a)(["\n mutation SaveAccountsBC($accounts: JSONObject) {\n saveAccounts(accounts: $accounts)\n }\n"]))),yx=[{code:"enable",display:"I will enable cash-out"},{code:"disable",display:"I won't enable cash-out"}],wx=function(e){var t,n=e.addData,r=Ox(),i=Object(u.c)(xx).data,o=Object(u.b)(vx,{onCompleted:function(){return n({zeroConf:"blockcypher"})}}),c=Object(l.a)(o,1)[0],s=Object(a.useState)(null),d=Object(l.a)(s,2),m=d[0],h=d[1],p=Object(a.useState)(!1),b=Object(l.a)(p,2),f=b[0],j=b[1],g=null!==(t=null===i||void 0===i?void 0:i.accounts)&&void 0!==t?t:[];return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Ue,{className:f&&r.error,children:"Blockcypher"}),Object(Me.jsx)(Xe,{children:"If you are enabling cash-out services, create a Blockcypher account."}),Object(Me.jsx)(Da,{link:"https://support.lamassu.is/hc/en-us/articles/115001209472-Blockcypher",label:"Configuring Blockcypher"}),Object(Me.jsx)(Er,{labelClassName:r.radioLabel,className:r.radioGroup,options:yx,value:m,onChange:function(e){h(e.target.value),j(!1)}}),Object(Me.jsxs)("div",{className:r.mdForm,children:["disable"===m&&Object(Me.jsx)(An,{size:"lg",onClick:function(){return n({zeroConf:"none",zeroConfLimit:0})},className:r.button,children:"Continue"}),"enable"===m&&Object(Me.jsx)(BO,{value:g.blockcypher,save:function(e){return c({variables:{accounts:{blockcypher:e}}})},elements:gx.blockcypher.elements,validationSchema:gx.blockcypher.validationSchema,buttonLabel:"Continue",buttonClass:r.formButton})]})]})},Cx=Object(f.a)(MO),kx=x()(_O||(_O=Object(c.a)(["\n {\n cryptoCurrencies {\n code\n display\n }\n }\n"]))),Ex=xn.f().shape({coin:xn.h().required()}),Nx=function(e){var t,n=e.addData,r=Cx(),i=Object(a.useState)(!1),o=Object(l.a)(i,2),c=o[0],s=o[1],d=Object(u.c)(kx).data,m=null!==(t=null===d||void 0===d?void 0:d.cryptoCurrencies)&&void 0!==t?t:[];return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Ue,{className:c&&r.error,children:"Choose your first cryptocurrency"}),Object(Me.jsx)(bn.e,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,initialValues:{coin:""},onSubmit:function(e){return Ex.isValidSync(e)?"BTC"!==e.coin?n({coin:e.coin,zeroConf:"none",zeroConfLimit:0}):void n(e):s(!0)},children:Object(Me.jsxs)(bn.d,{onChange:function(){return s(!1)},children:[Object(Me.jsx)(dm,{}),Object(Me.jsx)(bn.b,{component:ti,name:"coin",labelClassName:r.radioLabel,className:r.radioGroup,options:m}),Object(Me.jsx)(An,{size:"lg",type:"submit",className:r.button,children:"Continue"})]})})]})},Sx=function(e,t){return M.a((function(n){return function(e){return W.a("class",e)}(t)(n)&&function(e){return L.a(ul.a(e),B.a("cryptos"))}(e)(n)}))},Ix=function(e,t,n,a){var r=Sx(a,n)(e),i=ps.a((function(e){var n=e.code,a=function(e){return t&&t[e]}(n);return!gx[n]||(0,gx[n].getValidationSchema)(a).isValidSync(a)}))(r),o=Object(l.a)(i,2);return{filled:o[0],unfilled:o[1]}},Fx=Object(f.a)(MO),Lx=x()(ZO||(ZO=Object(c.a)(["\n {\n accounts\n accountsConfig {\n code\n display\n class\n cryptos\n }\n cryptoCurrencies {\n code\n display\n }\n }\n"]))),Px=x()(KO||(KO=Object(c.a)(["\n mutation Save($accounts: JSONObject) {\n saveAccounts(accounts: $accounts)\n }\n"]))),Dx=function(e){return!D.a(e)&&!ul.a(e)(["mock-exchange","no-exchange"])},Rx=function(e){var t,n,r,i=e.data,o=e.addData,c=Fx(),s=Object(u.c)(Lx).data,d=Object(u.b)(Px,{onCompleted:function(){return k()}}),m=Object(l.a)(d,1)[0],h=Object(a.useState)(null),p=Object(l.a)(h,2),b=p[0],f=p[1],j=Object(a.useState)(!1),g=Object(l.a)(j,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=Ix(y,v,"exchange",w),k=function(){if(!b)return x(!0);o({exchange:b})};return Object(Me.jsxs)("div",{className:c.mdForm,children:[Object(Me.jsx)(Ue,{className:O&&c.error,children:"Choose your exchange"}),Object(Me.jsx)(Er,{labelClassName:c.radioLabel,className:c.radioGroup,options:Ma.a(C.filled,C.unfilled),value:b,onChange:function(e){f(e.target.value),x(!1)}}),!Dx(b)&&Object(Me.jsx)(An,{size:"lg",onClick:k,className:c.button,children:"Continue"}),Dx(b)&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)("div",{className:c.infoMessage,children:[Object(Me.jsx)(ir,{}),Object(Me.jsxs)(Ke,{children:["Make sure you set up ",gx[b].name," to enter the necessary information below. Please follow the instructions on our support page if you haven\u2019t."]})]}),Object(Me.jsx)(Da,{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"}[b],label:"".concat(gx[b].name," trading")}),Object(Me.jsx)(Ue,{noMargin:!0,children:"Enter exchange information"}),Object(Me.jsx)(BO,{value:v[b],save:(r=b,function(e){var t=Object(z.a)({},r,e);return m({variables:{accounts:t}})}),elements:gx[b].elements,validationSchema:gx[b].validationSchema,buttonLabel:"Continue",buttonClass:c.formButton})]})]})},Bx=Object(f.a)(MO),Tx=x()(QO||(QO=Object(c.a)(["\n {\n accountsConfig {\n code\n display\n class\n cryptos\n }\n }\n"]))),Ax=function(e){var t,n,r=e.data,i=e.addData,o=Bx(),c=Object(u.c)(Tx).data,s=Object(a.useState)(null),d=Object(l.a)(s,2),m=d[0],h=d[1],p=Object(a.useState)(!1),b=Object(l.a)(p,2),f=b[0],j=b[1],g=null!==(t=null===c||void 0===c?void 0:c.accounts)&&void 0!==t?t:[],O=null!==(n=null===c||void 0===c?void 0:c.accountsConfig)&&void 0!==n?n:[],x=r.coin,v=Ix(O,g,"ticker",x);return Object(Me.jsxs)("div",{className:o.mdForm,children:[Object(Me.jsx)(Ue,{className:f&&o.error,children:"Choose your ticker"}),Object(Me.jsx)(Er,{labelClassName:o.radioLabel,className:o.radioGroup,options:Ma.a(v.filled,v.unfilled),value:m,onChange:function(e){h(e.target.value),j(!1)}}),Object(Me.jsx)(An,{size:"lg",onClick:function(){if(!m)return j(!0);i({ticker:m})},className:o.button,children:"Continue"})]})},Mx=function(e){var t;return{code:"bitgo",name:"BitGo",title:"BitGo (Wallet)",elements:[{code:"token",display:"API Token",component:ai,face:!0,long:!0},{code:"environment",display:"Environment",component:Tr,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:ai},{code:"".concat(e,"WalletPassphrase"),display:"".concat(e," Wallet Passphrase"),component:ni}],validationSchema:xn.f().shape((t={token:xn.h().max(100,"Too long").required(),environment:xn.h().matches(/(prod|test)/).required()},Object(z.a)(t,"".concat(e,"WalletId"),xn.h().max(100,"Too long").required()),Object(z.a)(t,"".concat(e,"WalletPassphrase"),xn.h().max(100,"Too long").required()),t))}},Wx=Object(f.a)(MO),zx=x()(YO||(YO=Object(c.a)(["\n {\n accounts\n accountsConfig {\n code\n display\n class\n cryptos\n }\n cryptoCurrencies {\n code\n display\n }\n }\n"]))),qx=x()(JO||(JO=Object(c.a)(["\n mutation Save($accounts: JSONObject) {\n saveAccounts(accounts: $accounts)\n }\n"]))),$x=function(e){return ul.a(e)(["infura","bitgo"])},Hx=function(e){var t,n,r,i=e.data,o=e.addData,c=Wx(),s=Object(u.c)(zx).data,d=Object(u.b)(qx,{onCompleted:function(){return E()}}),m=Object(l.a)(d,1)[0],h=Object(a.useState)(null),p=Object(l.a)(h,2),b=p[0],f=p[1],j=Object(a.useState)(!1),g=Object(l.a)(j,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=Ix(y,v,"wallet",w),k=function(e){return function(t){var n=Object(z.a)({},e,t);return m({variables:{accounts:n}})}},E=function(){if(!b)return x(!0);o({wallet:b})};return Object(Me.jsxs)("div",{className:c.mdForm,children:[Object(Me.jsx)(Ue,{className:O&&c.error,children:"Choose your wallet"}),Object(Me.jsx)(Er,{labelClassName:c.radioLabel,className:c.radioGroup,options:Ma.a(C.filled,C.unfilled),value:b,onChange:function(e){f(e.target.value),x(!1)}}),(r=b,ul.a(r)(["bitcoind","geth","litecoind","dashd","zcashd","bitcoincashd"])&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)("div",{className:c.infoMessage,children:[Object(Me.jsx)(ir,{}),Object(Me.jsxs)(Ke,{children:["To set up ",b," please read the node wallet instructions from our support portal."]})]}),Object(Me.jsx)(Da,{link:"https://support.lamassu.is/hc/en-us/articles/115001209552-Setting-up-your-node-wallets",label:"Support article"})]})),!$x(b)&&Object(Me.jsx)(An,{size:"lg",onClick:E,className:c.button,children:"Continue"}),"bitgo"===b&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)("div",{className:c.infoMessage,children:[Object(Me.jsx)(ir,{}),Object(Me.jsx)(Ke,{children:"Make sure you set up a BitGo wallet to enter the necessary information below. Please follow the instructions on our support page if you haven\u2019t."})]}),Object(Me.jsx)(Da,{link:"https://support.lamassu.is/hc/en-us/articles/360024455592-Setting-up-BitGo",label:"Support article"}),Object(Me.jsx)(Ue,{noMargin:!0,children:"Enter wallet information"}),Object(Me.jsx)(BO,{value:v.bitgo,save:k(b),elements:Mx(w).elements,validationSchema:Mx(w).validationSchema,buttonLabel:"Continue",buttonClass:c.formButton})]}),"infura"===b&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Ue,{noMargin:!0,children:"Enter wallet information"}),Object(Me.jsx)(BO,{value:v.infura,save:k(b),elements:gx.infura.elements,validationSchema:gx.infura.getValidationSchema(v.infura),buttonLabel:"Continue",buttonClass:c.formButton})]})]})},Vx=Object(f.a)(Gi),Ux=[{label:"Choose cryptocurrency",component:Nx},{label:"Choose wallet",component:Hx},{label:"Choose ticker",component:Ax},{label:"Exchange",component:Rx},{label:"Blockcypher",component:wx},{label:"All set",component:ix}],Gx=function(e){var t=e.doContinue,n=Object(a.useState)(0),r=Object(l.a)(n,2),i=r[0],o=r[1],c=Object(a.useState)({}),s=Object(l.a)(c,2),d=s[0],u=s[1],m=Vx(),h="BTC"===(null===d||void 0===d?void 0:d.coin)?Ux:tx.a(4,1,Ux),p=h[i].component;return Object(Me.jsxs)("div",{className:m.wrapper,children:[Object(Me.jsx)("div",{className:m.headerDiv,children:Object(Me.jsx)(nl,{title:"Wallet settings"})}),Object(Me.jsxs)("div",{className:m.contentDiv,children:[Object(Me.jsx)(yi,{children:h.map((function(e,t){return Object(Me.jsx)(wi,{step:i,it:e,idx:t,steps:h},t)}))}),Object(Me.jsx)("div",{className:m.contentWrapper,children:Object(Me.jsx)(p,{data:d,addData:function(e){u(Gn.a(d,e)),o(i+1)},doContinue:t})})]})]})},Xx={welcome:{textAlign:"center",paddingTop:256},title:{lineHeight:1,fontSize:48},getStarted:{fontSize:24,fontWeight:500,marginBottom:54,color:$}},_x=Object(f.a)(Xx);var Zx=function(e,t){var n=rs(Gc,e);return M.a((function(e){return dO.isValidSync(rs(e.code,n))}))(t)},Kx=function(e,t){return e?function(e,t){var n=rs(Gc,e),a=R.a((function(e){return rs(e.code,n)}))(t);return L.a(cl.a(Ou.a),R.a((function(e){return dO.isValidSync(e)})))(a)}(e,t)?function(e){var t=rs(Zc,e);return aO.isValidSync(t)}(e)?function(e){var t=rs(Kc,e),n=rs(Zc,e);return Wg(n).isValidSync(t)}(e)?0:3:2:1:0},Qx=[{id:"welcome",Component:function(e){var t=e.doContinue,n=_x();return Object(Me.jsxs)("div",{className:n.welcome,children:[Object(Me.jsx)($e,{className:n.title,children:"Welcome to the Lamassu Admin"}),Object(Me.jsxs)(Xe,{className:n.getStarted,children:["To get you started, we\u2019ve put together a wizard that will",Object(Me.jsx)("br",{}),"help set up what you need before pairing your machines."]}),Object(Me.jsx)(An,{size:"xl",onClick:t,children:"Get started"})]})}},{id:"wallet",Component:Gx,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:FO,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:ex,exImage:"/assets/wizard/fullexample.twilio.png",subtitle:"Twilio (SMS service)",text:Object(Me.jsxs)(Me.Fragment,{children:["Twilio is used for SMS operator notifications, phone number collection for compliance, and 1-confirmation redemptions on cash-out transactions.",Object(Me.jsx)("br",{}),"You'll need to configure Twilio if you're offering cash-out or any compliance options"]})},{id:"commissions",Component:CO,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."}],Yx=n(894),Jx=Object(f.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 ev,tv,nv,av,rv,iv,ov,lv,cv,sv,dv=function(e){var t,n=e.currentStep,r=e.steps,i=e.subtitle,o=e.text,c=e.exImage,s=e.open,d=e.start,u=Jx(),m=Object(a.useState)(!1),p=Object(l.a)(m,2),b=p[0],f=p[1],j=(t={},Object(z.a)(t,u.wrapper,!0),Object(z.a)(t,u.smallWrapper,!s),t);return Object(Me.jsxs)(Yx.a,{anchor:"bottom",open:!0,variant:"persistent",classes:{paperAnchorDockedBottom:u.drawer},children:[Object(Me.jsxs)("div",{className:I()(j),children:[Object(Me.jsxs)(h.a,{container:!0,direction:"row",justify:"center",alignItems:"baseline",children:[Object(Me.jsxs)(h.a,{item:!0,xs:5,container:!0,direction:s?"column":"row",justify:"flex-start",alignItems:"baseline",children:[Object(Me.jsx)(He,{className:u.title,children:"Setup Lamassu Admin"}),Object(Me.jsx)(Ze,{className:u.subtitle,children:i}),s&&Object(Me.jsx)(Xe,{children:o})]}),Object(Me.jsx)(h.a,{item:!0,xs:4,container:!0,direction:"column",justify:"flex-start",alignItems:"flex-end",spacing:5,children:Object(Me.jsx)(h.a,{item:!0,xs:12,children:r&&n&&Object(Me.jsx)(rp,{currentStep:n,steps:r})})})]}),s&&Object(Me.jsxs)(h.a,{container:!0,direction:"row",justify:"center",alignItems:"baseline",children:[Object(Me.jsx)(h.a,{item:!0,xs:5,container:!0,direction:"column",justify:"flex-start",alignItems:"flex-start",children:Object(Me.jsx)(oa,{onClick:function(){f(!0)},children:"See full example"})}),Object(Me.jsx)(h.a,{item:!0,xs:4,container:!0,direction:"column",justify:"flex-start",alignItems:"flex-end",spacing:5,children:Object(Me.jsx)(h.a,{item:!0,children:Object(Me.jsx)(An,{size:"lg",onClick:d,children:"Get Started"})})})]})]}),Object(Me.jsx)(Mh,{closeOnEscape:!0,closeOnBackdropClick:!0,className:u.modal,xl:!0,width:1328,handleClose:function(){f(!1)},open:b,children:Object(Me.jsx)("img",{width:1152,src:c,alt:""})})]})},uv=Object(f.a)({wrapper:{display:"flex",padding:[[16,0]],flexDirection:"column",justifyContent:"space-between",backgroundColor:ae},welcomeBackground:{background:"url(/wizard-background.svg) no-repeat center center fixed",backgroundColor:ae,backgroundSize:"cover"},blurred:{filter:"blur(4px)",pointerEvents:"none"}}),mv=x()(ev||(ev=Object(c.a)(["\n query getData {\n config\n accounts\n cryptoCurrencies {\n code\n display\n }\n }\n"]))),hv=function(e){e.fromAuthRegister;var t,n,r=uv(),i=Object(u.c)(mv),o=i.data,c=i.loading,s=Object(w.h)(),d=Object(a.useContext)(k).setWizardTested,m=Object(a.useState)(0),h=Object(l.a)(m,2),p=h[0],b=h[1],f=Object(a.useState)(!0),j=Object(l.a)(f,2),g=j[0],O=j[1],x=Object(a.useState)(!1),v=Object(l.a)(x,2),y=v[0],C=v[1];if(c)return Object(Me.jsx)(Me.Fragment,{});var E=Kx(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===E&&(d(!0),N?s.goBack():s.push("/"));var S=0===p,F=(n={},Object(z.a)(n,r.blurred,y),Object(z.a)(n,r.wrapper,!0),Object(z.a)(n,r.welcomeBackground,S),n),L=Qx[p];return Object(Me.jsxs)(un.a,{fullScreen:!0,open:g,children:[Object(Me.jsx)(mn.a,{className:I()(F),children:Object(Me.jsx)(L.Component,{doContinue:function(){p>=Qx.length-1&&(O(!1),s.push("/"));var e=0===p&&E?E:p+1;C(!0),b(e)},isActive:!y})}),!S&&Object(Me.jsx)(dv,{currentStep:p,steps:Qx.length-1,exImage:L.exImage,subtitle:L.subtitle,text:L.text,open:y,start:function(){C(!1)}})]})},pv=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)},bv="user",fv="superuser",jv=function(e){var t=Object.assign({},e),n=Object(a.useContext)(k).userData;return pv(n)?Object(Me.jsx)(w.c,Object(s.a)({},t)):Object(Me.jsx)(w.b,{to:"/login"})},gv=function(e){var t=e.component,n=e.restricted,r=Object(q.a)(e,["component","restricted"]),i=Object(a.useContext)(k).userData;return Object(Me.jsx)(w.c,Object(s.a)(Object(s.a)({},r),{},{render:function(e){return pv(i)&&n?Object(Me.jsx)(w.b,{to:"/"}):Object(Me.jsx)(t,Object(s.a)({},e))}}))},Ov=n(899),xv=n(930),vv=6e4,yv=864e5,wv=6048e5,Cv=2592e6,kv={overviewLegend:{display:"flex",justifyContent:"flex-end","& span":{marginRight:24},"& > :last-child":{marginRight:0}},legendEntry:{display:"flex",flexDirection:"row",alignItems:"center","& > :first-child":{marginRight:8}},dropdownsOverviewWrapper:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:16},verticalLine:{height:64,width:1,border:"solid",borderWidth:.5,borderColor:de},dropdowns:{display:"flex",flexDirection:"row","& div":{marginRight:24},"& > :last-child":{marginRight:0}},overview:{display:"flex",flexDirection:"row",alignItems:"center","& div":{marginRight:40},"& > :last-child":{marginRight:0}},overviewFieldWrapper:{marginTop:6,marginBottom:6,"& span":{fontSize:24}},overviewGrowth:{display:"flex",flexDirection:"row",alignItems:"center","& p":{marginLeft:4}},growthPercentage:{fontWeight:"bold"},growth:{color:"#00CD5A"},decline:{color:Q},graphHeaderWrapper:{display:"flex",flexDirection:"row",justifyContent:"space-between",marginBottom:40},graphHeaderLeft:{display:"flex",flexDirection:"column"},graphHeaderRight:{marginTop:15,display:"flex",flexDirection:"row","& > *":{marginRight:30,"&:last-child":{marginRight:0}}},graphLegend:{display:"flex",flexDirection:"row",alignItems:"center","& span":{marginRight:24},"& > :last-child":{marginRight:0}},machineSelector:{width:248},cashInIcon:{width:12,height:12,borderRadius:12,backgroundColor:_},cashOutIcon:{width:12,height:12,borderRadius:12,backgroundColor:Z},txIcon:{width:12,height:12,borderRadius:12,backgroundColor:"#000"},topMachinesRadio:{display:"flex",flexDirection:"row"}},Ev=Object(f.a)(kv),Nv=function(e){var t=e.IconElement,n=e.IconComponent,a=e.label,r=Ev();return Object(Me.jsxs)("span",{className:r.legendEntry,children:[!!n&&Object(Me.jsx)(n,{height:12}),!!t&&t,Object(Me.jsx)(Xe,{children:a})]})},Sv=n(956),Iv=n(898),Fv={dotOtWrapper:{position:"absolute",top:function(e){var t;return null!==(t=null===e||void 0===e?void 0:e.y)&&void 0!==t?t:0},left:function(e){var t;return null!==(t=null===e||void 0===e?void 0:e.x)&&void 0!==t?t:0},width:150,padding:12,borderRadius:8},dotOtTransactionAmount:{margin:[[8,0,8,0]]},dotOtTransactionVolume:{color:$},dotOtTransactionClasses:{marginTop:15,"& p > span":{marginLeft:5},"& p:last-child":{marginTop:5}}},Lv=Object(f.a)(Fv),Pv=function(e){var t,n=e.coords,a=e.data,r=e.dateInterval,i=e.period,o=e.currency,l=e.representing,c=Lv(n),s=F.a("hourOfDay",l.code)?[rd(r[1],"HH:mm"),rd(r[0],"HH:mm")]:[ad(r[1],null,"day"===i.code?"MMM d, HH:mm":"MMM d"),ad(r[0],null,"day"===i.code?"HH:mm":"MMM d")],d=hs.a((function(e,t){return e.volume+=parseInt(t.fiat),"cashIn"===t.txClass&&e.cashIn++,"cashOut"===t.txClass&&e.cashOut++,e}),{volume:0,cashIn:0,cashOut:0},a);return Object(Me.jsxs)(Un.a,{className:c.dotOtWrapper,children:[Object(Me.jsx)(Ze,{noMargin:!0,children:"day"===i.code||F.a("hourOfDay",l.code)?"".concat(s[0]," - ").concat(s[1]):"".concat(s[0])}),Object(Me.jsxs)(Xe,{noMargin:!0,className:c.dotOtTransactionAmount,children:[gn.a(a)," ",Tm(gn.a(a),"transaction","transactions")]}),Object(Me.jsxs)(Xe,{noMargin:!0,className:c.dotOtTransactionVolume,children:[(t=d.volume,t.toLocaleString("en-US",{maximumFractionDigits:2}))," ",o," in volume"]}),Object(Me.jsxs)("div",{className:c.dotOtTransactionClasses,children:[Object(Me.jsxs)(nt,{noMargin:!0,children:[Object(Me.jsx)(Sc,{}),Object(Me.jsxs)("span",{children:[d.cashIn," cash-in"]})]}),Object(Me.jsxs)(nt,{noMargin:!0,children:[Object(Me.jsx)(Bc,{}),Object(Me.jsxs)("span",{children:[d.cashOut," cash-out"]})]})]})]})},Dv=Object(a.memo)(Pv,(function(e,t){return e.coords===t.coords})),Rv=n(895),Bv=n(896),Tv=function(e){var t=e.data,n=e.timezone,r=e.setSelectionCoords,i=e.setSelectionData,o=e.setSelectionDateInterval,l=Object(a.useRef)(null),c=10,s=401,d=1163,u=Object(a.useMemo)((function(){return{top:25,right:.5,bottom:27,left:36.5}}),[]),m=Object(Qg.a)(n),h=function(e,t){for(var n=[],a=new Date(e[0]),r=new Date(e[1]),i=xv.a(a);i<=r;)n.push(xv.a(i)),i.setUTCHours(i.getUTCHours()+t);return n},p=Object(a.useCallback)((function(e,n){return M.a((function(t){var a=new Date(t.created).setTime(new Date(t.created).getTime()+new Date(t.created).getTimezoneOffset()*vv+m),r=new Date(a);return e.getUTCHours()<n.getUTCHours()&&r.getUTCHours()>=new Date(e).getUTCHours()&&r.getUTCHours()<new Date(n).getUTCHours()||e.getUTCHours()>n.getUTCHours()&&r.getUTCHours()<=new Date(e).getUTCHours()&&r.getUTCHours()<new Date(n).getUTCHours()}),t)}),[t,m]),b=Object(a.useCallback)((function(e,t){return hs.a((function(e,t){return"cashIn"===t.txClass&&(e.cashIn+=Mc()(t.fiat).toNumber()),"cashOut"===t.txClass&&(e.cashOut+=Mc()(t.fiat).toNumber()),e}),{cashIn:0,cashOut:0},p(e,t))}),[p]),f=cd.scaleUtc().domain([td(Object(Rv.a)(new Date)),td(Object(Od.a)({days:1},Object(Rv.a)(new Date)))]).rangeRound([u.left,d-u.right]),j=R.a((function(e){var t=xv.a(e);e.setUTCHours(e.getUTCHours()+2);var n=xv.a(e);return[t,p(t,n)]}),Bv.a(h(f.domain(),2))),g=R.a((function(e){var t=xv.a(e);e.setUTCHours(e.getUTCHours()+2);var n=xv.a(e);return[t,b(t,n)]}),Bv.a(h(f.domain(),2))),O=cd.scaleLinear().domain([0,0!==cd.max(g.map((function(e){return e[1]})),(function(e){return e.cashIn+e.cashOut}))?cd.max(g.map((function(e){return e[1]})),(function(e){return e.cashIn+e.cashOut})):50]).range([s-u.bottom,u.top]),x=Object(a.useCallback)((function(e){return e.attr("transform","translate(0, ".concat(s-u.bottom,")")).call(cd.axisBottom(f).ticks(cd.timeHour.every(2)).tickFormat(cd.timeFormat("%H:%M")))}),[u,f]),v=Object(a.useCallback)((function(e){return e.attr("transform","translate(".concat(u.left,", 0)")).call(cd.axisLeft(O).ticks(4.01).tickSize(0).tickFormat("")).call((function(e){return e.select(".domain").remove()}))}),[u,O]),y=Object(a.useCallback)((function(e){return e.attr("stroke",ie).append("g").selectAll("line").data(h(f.domain(),2)).join("line").attr("x1",(function(e){var t=f(e),n=h(f.domain(),2);return t===f(n[gn.a(n)-1])?t-1:.5+t})).attr("x2",(function(e){var t=f(e),n=h(f.domain(),2);return t===f(n[gn.a(n)-1])?t-1:.5+t})).attr("y1",u.top).attr("y2",s-u.bottom)}),[u,f]),w=Object(a.useCallback)((function(e){return e.append("g").selectAll("line").data(h(f.domain(),2)).join("rect").attr("x",(function(e){return f(e)})).attr("y",u.top).attr("width",(function(e){var t=Math.round(100*f(e))/100,n=h(f.domain(),2).map((function(e){return f(e)})),a=ml.a((function(e){return e===t}),n),r=a+1===gn.a(n)?0:n[a+1]-n[a];return Math.round(100*r)/100})).attr("height",s-u.bottom-u.top).attr("stroke","transparent").attr("fill","transparent").on("mouseover",(function(e){var t=xv.a(new Date(e.target.__data__)),n=xv.a(t);t.setUTCHours(t.getUTCHours()+2);var a=xv.a(t),l=j.find((function(e){return yd.a(n,e[0])}))[1],c=xv.a(e.target.getBoundingClientRect().x),s=xv.a(e.target.getBoundingClientRect().x+e.target.getBoundingClientRect().width),d=e.target.x.baseVal.value<872.25?s+25:c-150-25,u=xv.a(e.target.getBoundingClientRect().y);o([a,n]),i(l),r({x:Math.round(d),y:Math.round(u)}),cd.select("#event-rect-".concat(f(e.target.__data__))).attr("fill",re)})).on("mouseleave",(function(e){cd.select("#event-rect-".concat(f(e.target.__data__))).attr("fill","transparent"),o(null),i(null),r(null)}))}),[u,j,r,i,o,f]),C=Object(a.useCallback)((function(e){return e.append("g").selectAll("line").data(h(f.domain(),2)).join("rect").attr("id",(function(e){return"event-rect-".concat(f(e))})).attr("x",(function(e){return f(e)})).attr("y",u.top).attr("width",(function(e){var t=Math.round(100*f(e))/100,n=h(f.domain(),2).map((function(e){return f(e)})),a=ml.a((function(e){return e===t}),n),r=a+1===gn.a(n)?0:n[a+1]-n[a];return Math.round(100*r)/100})).attr("height",s-u.bottom-u.top).attr("stroke","transparent").attr("fill","transparent")}),[u,f]),k=Object(a.useCallback)((function(){return cd.selectAll(".tick text").style("stroke",ce).style("fill",ce).style("stroke-width",.5).style("font-family",fe)}),[]),E=Object(a.useCallback)((function(e){e.selectAll("rect").data(Bv.a(h(f.domain(),2))).join("rect").attr("stroke",_).attr("fill",_).attr("x",(function(e){return f(e)+5})).attr("y",(function(e){var t=Aa.a((function(t){return yd.a(t[0],e)}),g);return O(t[1].cashIn)-u.top+u.bottom})).attr("height",(function(e){var t=Aa.a((function(t){return yd.a(t[0],e)}),g);return Zh.a(0,s,s-O(t[1].cashIn)-u.bottom-5)})).attr("width",(function(e){var t=Math.round(100*f(e))/100,n=h(f.domain(),2).map((function(e){return f(e)})),a=ml.a((function(e){return e===t}),n),r=a===gn.a(n)?0:n[a+1]-n[a];return Math.round(100*(r-c))/100})).attr("rx",2.5)}),[f,O,u,g]),N=Object(a.useCallback)((function(e){e.selectAll("rect").data(Bv.a(h(f.domain(),2))).join("rect").attr("stroke",Z).attr("fill",Z).attr("x",(function(e){return f(e)+5})).attr("y",(function(e){var t=Aa.a((function(t){return yd.a(t[0],e)}),g);return O(t[1].cashIn+t[1].cashOut)-u.top+u.bottom})).attr("height",(function(e){var t=Aa.a((function(t){return yd.a(t[0],e)}),g);return Zh.a(0,s,s-O(t[1].cashOut)-u.bottom-5)})).attr("width",(function(e){var t=Math.round(100*f(e))/100,n=h(f.domain(),2).map((function(e){return f(e)})),a=ml.a((function(e){return e===t}),n),r=a===gn.a(n)?0:n[a+1]-n[a];return Math.round(100*(r-c))/100})).attr("rx",2.5)}),[f,O,u,g]),S=Object(a.useCallback)((function(){var e=cd.select(l.current).attr("viewBox",[0,0,d,s]);return e.append("g").call(x),e.append("g").call(v),e.append("g").call(y),e.append("g").call(C),e.append("g").call(k),e.append("g").call(E),e.append("g").call(N),e.append("g").call(w),e.node()}),[x,v,C,w,y,E,k,N]);return Object(a.useEffect)((function(){cd.select(l.current).selectAll("*").remove(),S()}),[S]),Object(Me.jsx)("svg",{ref:l})},Av=Object(a.memo)(Tv,(function(e,t){return yd.a(e.period,t.period)&&yd.a(e.selectedDay,t.selectedDay)})),Mv=n(957),Wv=function(e){var t,n=e.data,r=e.period,i=e.timezone,o=e.setSelectionCoords,l=e.setSelectionData,c=e.setSelectionDateInterval,s=Object(a.useRef)(null),u=401,m=1163,h=Object(a.useMemo)((function(){return{top:25,right:.5,bottom:27,left:36.5}}),[]),p=Object(Qg.a)(i),b=Date.now()+p,f={day:[b-yv,b],week:[b-wv,b],month:[b-Cv,b]},j=Object(a.useMemo)((function(){return{day:{freq:24,step:36e5,tick:cd.utcHour.every(1),labelFormat:"%H:%M"},week:{freq:7,step:864e5,tick:cd.utcDay.every(1),labelFormat:"%a %d"},month:{freq:30,step:864e5,tick:cd.utcDay.every(1),labelFormat:"%d"}}}),[]),g=Object(a.useCallback)((function(e){var t=new Date(e),n=t.getUTCDate(),a=t.getUTCDay(),r=t.getUTCMonth(),i=new Date(t.getTime());i.setUTCDate(n-1);var o=i.getUTCDate(),l=i.getUTCDay(),c=i.getUTCMonth(),s=Array.from(Array(7)).map((function(e,t){return Object(ed.a)("EEE",Object(Od.a)({days:t},Object(Sv.a)(new Date)))})),d=Array.from(Array(12)).map((function(e,t){return Object(ed.a)("LLL",Object(Od.a)({months:t},Object(Mv.a)(new Date)))}));return{previous:r!==c?d[c]:"".concat(s[l]," ").concat(o),current:r!==c?d[r]:"".concat(s[a]," ").concat(n)}}),[]),O=Object(a.useCallback)((function(e){for(var t=[],n=function(e){var t=j[r.code].step;return new Date(Math.ceil(e.valueOf()/t)*t)},a=0;a<=j[r.code].freq;a++){var i=new Date(b-a*j[r.code].step);n(i)>e[1]||(i<e[0]||t.push(n(i)))}return t}),[b,j,r.code]),x=Object(a.useCallback)((function(e){var t=[];t.push(e[1]);for(var n=function(e){var t=j[r.code].step;return new Date(Math.ceil(e.valueOf()/t)*t)},a=0;a<=j[r.code].freq;a++){var i=new Date(b-a*j[r.code].step);n(i)>new Date(e[1])||(i<new Date(e[0])||t.push(n(i)))}return t.push(e[0]),t}),[b,j,r.code]),v=cd.scaleUtc().domain(f[r.code]).range([h.left,m-h.right]),y=cd.scaleLinear().domain([0,1.03*(null!==(t=cd.max(n,(function(e){return new Mc.a(e.fiat).toNumber()})))&&void 0!==t?t:1e3)]).nice().range([u-h.bottom,h.top]),w=function(e,t){for(var n=[t[1]].concat(Object(d.a)(M.a((function(e){return e>t[0]&&e<t[1]}),e)),[t[0]]),a=[],r=0;r<n.length-1;r++)a.push([n[r],n[r+1]]);return a},C=Object(a.useCallback)((function(e){return e.attr("transform","translate(0, ".concat(u-h.bottom,")")).call(cd.axisBottom(v).ticks(j[r.code].tick).tickFormat((function(e){return cd.timeFormat(j[r.code].labelFormat)(e.getTime()+e.getTimezoneOffset()*vv)}))).call((function(e){return e.select(".domain").remove()})).call((function(e){return e.append("line").attr("x1",h.left).attr("y1",-401+h.top+h.bottom).attr("x2",h.left).attr("stroke",J).attr("stroke-width",1)}))}),[h,j,r.code,v]),k=Object(a.useCallback)((function(e){return e.attr("transform","translate(".concat(h.left,", 0)")).call(cd.axisLeft(y).ticks(4.01)).call((function(e){return e.select(".domain").remove()})).call((function(e){return e.selectAll(".tick line").filter((function(e){return 0===e})).clone().attr("x2",m-h.right-h.left).attr("stroke-width",1).attr("stroke",J)}))}),[h,y]),E=Object(a.useCallback)((function(e){e.attr("stroke",ie).attr("fill",ie).call((function(e){return e.append("g").selectAll("line").data(O(v.domain())).join("line").attr("x1",(function(e){return.5+v(e)})).attr("x2",(function(e){return.5+v(e)})).attr("y1",h.top).attr("y2",u-h.bottom)})).call((function(e){return e.append("g").selectAll("line").data(cd.axisLeft(y).scale().ticks(4.01)).join("line").attr("y1",(function(e){return.5+y(e)})).attr("y2",(function(e){return.5+y(e)})).attr("x1",h.left).attr("x2",m-h.right)})).call((function(e){return e.append("g").selectAll("line").data(x(v.domain())).join("rect").attr("x",(function(e){return v(e)})).attr("y",h.top).attr("width",(function(e){var t=Math.round(100*v(e))/100,n=function(e,t){var n;return null!==(n=Aa.a((function(e){return t<=e[0]&&t>=e[1]}),e))&&void 0!==n?n:[0,0]}(w(x(v.domain()).map((function(e){return Math.round(100*v(e))/100})),v.range()),t);return Math.round(100*(n[0]-n[1]))/100})).attr("height",u-h.bottom-h.top).attr("stroke","transparent").attr("fill","transparent").on("mouseover",(function(e){var t=Math.round(100*e.target.x.baseVal.value)/100,a=function(e,t,n){for(var a=wg.a(ol.a(t)),r=t.length-1;r>=0;r--)if(n<a[r])return[e[r],e[r+1]]}(x(v.domain()),w(x(v.domain()).map((function(e){return Math.round(100*v(e))/100})),v.range()),t),r=n.filter((function(e){var t=new Date(e.created),n=t.setTime(t.getTime()+p);return n>new Date(a[1])&&n<=new Date(a[0])})),i=xv.a(e.target.getBoundingClientRect().x),s=xv.a(e.target.getBoundingClientRect().x+e.target.getBoundingClientRect().width),d=e.target.x.baseVal.value<872.25?s+25:i-150-25,u=xv.a(e.target.getBoundingClientRect().y);c(a),l(r),o({x:Math.round(d),y:Math.round(u)}),cd.select(e.target).attr("fill",re)})).on("mouseleave",(function(e){cd.select(e.target).attr("fill","transparent"),c(null),l(null),o(null)}))})).call((function(e){return e.append("g").selectAll("line").data(O(v.domain()).filter((function(e){return"day"===r.code?0===e.getUTCHours():1===e.getUTCDate()}))).join("line").attr("class","dateSeparator").attr("x1",(function(e){return.5+v(e)})).attr("x2",(function(e){return.5+v(e)})).attr("y1",h.top-50).attr("y2",u-h.bottom).attr("stroke-width",5).join("text")})).call((function(e){var t,n,a=null===cd||void 0===cd||null===(t=cd.select(".dateSeparator"))||void 0===t||null===(n=t.node())||void 0===n?void 0:n.getBBox();if(a){var i=O(v.domain()).filter((function(e){return"day"===r.code?0===e.getUTCHours():1===e.getUTCDate()})),o=g(i);return e.append("text").attr("x",a.x-10).attr("y",a.y+33).attr("text-anchor","end").attr("dy",".25em").text(o.previous)}})).call((function(e){var t,n,a=null===cd||void 0===cd||null===(t=cd.select(".dateSeparator"))||void 0===t||null===(n=t.node())||void 0===n?void 0:n.getBBox();if(a){var i=O(v.domain()).filter((function(e){return"day"===r.code?0===e.getUTCHours():1===e.getUTCDate()})),o=g(i);return e.append("text").attr("x",a.x+10).attr("y",a.y+33).attr("text-anchor","start").attr("dy",".25em").text(o.current)}}))}),[h,O,g,v,y,r,x,n,p,o,l,c]),N=Object(a.useCallback)((function(){return cd.selectAll(".tick text").style("stroke",ce).style("fill",ce).style("stroke-width",.5).style("font-family",fe)}),[]),S=Object(a.useCallback)((function(){return cd.selectAll("text").style("stroke",se).style("fill",se).style("stroke-width",.5).style("font-family",fe)}),[]),I=Object(a.useCallback)((function(){cd.selectAll(".tick line").style("stroke",J).style("fill",J)}),[]),F=Object(a.useCallback)((function(e){e.attr("stroke",J).attr("stroke-width",3).attr("stroke-dasharray","10, 5").call((function(e){var t,a;return e.append("line").attr("y1",.5+y(null!==(t=cd.mean(n,(function(e){return new Mc.a(e.fiat).toNumber()})))&&void 0!==t?t:0)).attr("y2",.5+y(null!==(a=cd.mean(n,(function(e){return new Mc.a(e.fiat).toNumber()})))&&void 0!==a?a:0)).attr("x1",h.left).attr("x2",m-h.right)}))}),[h,y,n]),L=Object(a.useCallback)((function(e){e.selectAll("circle").data(n).join("circle").attr("cx",(function(e){var t=new Date(e.created);return v(t.setTime(t.getTime()+p))})).attr("cy",(function(e){return y(new Mc.a(e.fiat).toNumber())})).attr("fill",(function(e){return"cashIn"===e.txClass?_:Z})).attr("r",3.5)}),[n,p,v,y]),P=Object(a.useCallback)((function(){var e=cd.select(s.current).attr("viewBox",[0,0,m,u]);return e.append("g").call(E),e.append("g").call(F),e.append("g").call(C),e.append("g").call(k),e.append("g").call(N),e.append("g").call(S),e.append("g").call(I),e.append("g").call(L),e.node()}),[F,E,C,k,L,S,I,N]);return Object(a.useEffect)((function(){cd.select(s.current).selectAll("*").remove(),P()}),[P]),Object(Me.jsx)("svg",{ref:s})},zv=Object(a.memo)(Wv,(function(e,t){return yd.a(e.period,t.period)&&yd.a(e.selectedMachine,t.selectedMachine)})),qv=n(897),$v=n(275),Hv=n(422),Vv=function(e){var t=e.data,n=e.machines,r=e.currency,i=Object(a.useRef)(null),o=.15,l=401,c=Object(a.useMemo)((function(){return{top:25,right:.5,bottom:27,left:36.5}}),[]),s=xv.a(n),d=gn.a(n)>=5?s:R.a((function(e){return D.a(s[e])?{code:"ghostMachine".concat(e),display:""}:s[e]}),gu.a(Ou.a,5)),u=hs.a((function(e,n){return e[n.code]=M.a((function(e){return e.deviceId===n.code}),t),e}),{},d),m=qv.a((function(e,t){return t[1]-e[1]}),R.a((function(e){return[e.code,(t=e.code,hs.a((function(e,t){return e+Mc()(t.fiat).toNumber()}),0,u[t]))];var t}),d)),h=$v.a(5,m),p=qc.a(R.a((function(e){return[e[0],(t=e[0],hs.a((function(e,t){return"cashIn"===t.txClass&&(e.cashIn+=Mc()(t.fiat).toNumber()),"cashOut"===t.txClass&&(e.cashOut+=Mc()(t.fiat).toNumber()),e}),{cashIn:0,cashOut:0},u[t]))];var t}),h)),b=cd.scaleBand().domain(h).range([c.left,1163-c.right]).paddingInner(o),f=cd.scaleLinear().domain([0,0!==cd.max(h,(function(e){return e[1]}))?cd.max(h,(function(e){return e[1]})):50]).range([l-c.bottom,c.top]),j=Object(a.useCallback)((function(e){return e.attr("class","x-axis-1").attr("transform","translate(0, ".concat(l-c.bottom,")")).call(cd.axisBottom(b).tickFormat((function(e){var t;return"".concat(null!==(t=Aa.a((function(t){return t.code===e[0]}),d).display)&&void 0!==t?t:"")})).tickSize(0).tickPadding(10))}),[c,b,d]),g=Object(a.useCallback)((function(e){e.attr("class","x-axis-2").attr("transform","translate(0, ".concat(l-c.bottom,")")).call(cd.axisBottom(b).tickFormat((function(e){return F.a("ghostMachine",e[0])?"":"".concat(e[1].toFixed(2)," ").concat(r)})).tickSize(0).tickPadding(10))}),[c,b,r]),O=Object(a.useCallback)((function(){cd.selectAll(".x-axis-1 .tick text").attr("transform",(function(e){var t=(b.range()[1]-b.range()[0])/5;return"translate(".concat(-t/2.25+this.getBBox().width/2,", 0)")}))}),[b]),x=Object(a.useCallback)((function(){cd.selectAll(".x-axis-2 .tick text").attr("transform",(function(e){var t=(b.range()[1]-b.range()[0])/5;return"translate(".concat(t/2.25-this.getBBox().width/2,", 0)")}))}),[b]),v=Object(a.useCallback)((function(e){return e.attr("transform","translate(".concat(c.left,", 0)")).call(cd.axisLeft(f).ticks(4.01).tickSize(0).tickFormat("")).call((function(e){return e.select(".domain").remove()}))}),[c,f]),y=Object(a.useCallback)((function(){return cd.selectAll(".tick text").style("stroke",ce).style("fill",ce).style("stroke-width",.5).style("font-family",fe)}),[]),w=Object(a.useCallback)((function(e){e.attr("stroke",ie).attr("fill",ie).call((function(e){return e.append("g").selectAll("line").data(Hv.a(b.domain())).join("line").attr("x1",(function(e){var t=ml.a((function(t){return yd.a(t,e)}),b.domain()),n=.075*(b(b.domain()[t])-b(b.domain()[t-1]));return.5+b(e)-n})).attr("x2",(function(e){var t=ml.a((function(t){return yd.a(t,e)}),b.domain()),n=.075*(b(b.domain()[t])-b(b.domain()[t-1]));return.5+b(e)-n})).attr("y1",c.top).attr("y2",l-c.bottom)}))}),[c,b]),C=Object(a.useCallback)((function(e){e.selectAll("rect").data(Hc.a(p)).join("rect").attr("fill",_).attr("x",(function(e){return b([e[0],e[1].cashIn+e[1].cashOut])})).attr("y",(function(e){return f(e[1].cashIn)-c.top+c.bottom})).attr("height",(function(e){return Zh.a(0,l,l-f(e[1].cashIn)-c.bottom-10)})).attr("width",b.bandwidth()).attr("rx",2.5)}),[p,b,f,c]),k=Object(a.useCallback)((function(e){e.selectAll("rect").data(Hc.a(p)).join("rect").attr("fill",Z).attr("x",(function(e){return b([e[0],e[1].cashIn+e[1].cashOut])})).attr("y",(function(e){return f(e[1].cashIn+e[1].cashOut)-c.top+c.bottom})).attr("height",(function(e){return Zh.a(0,l,l-f(e[1].cashOut)-c.bottom-5)})).attr("width",b.bandwidth()).attr("rx",2.5)}),[p,b,f,c]),E=Object(a.useCallback)((function(){var e=cd.select(i.current).attr("viewBox",[0,0,1163,l]);return e.append("g").call(j),e.append("g").call(g),e.append("g").call(v),e.append("g").call(y),e.append("g").call(w),e.append("g").call(C),e.append("g").call(k),e.append("g").call(O),e.append("g").call(x),e.node()}),[j,g,O,x,v,y,w,C,k]);return Object(a.useEffect)((function(){cd.select(i.current).selectAll("*").remove(),E()}),[E]),Object(Me.jsx)("svg",{ref:i})},Uv=Object(a.memo)(Vv,(function(e,t){return yd.a(e.period,t.period)})),Gv=function(e){var t=e.data,n=e.representing,r=e.period,i=e.timezone,o=e.currency,c=e.selectedMachine,s=e.machines,d=e.selectedDay,u=Object(a.useState)(null),m=Object(l.a)(u,2),h=m[0],p=m[1],b=Object(a.useState)(null),f=Object(l.a)(b,2),j=f[0],g=f[1],O=Object(a.useState)(null),x=Object(l.a)(O,2),v=x[0],y=x[1];return Object(Me.jsxs)("div",{children:[!D.a(h)&&Object(Me.jsx)(Dv,{coords:h,dateInterval:j,data:v,period:r,currency:o,timezone:i,representing:n}),function(e){switch(e.code){case"overTime":return Object(Me.jsx)(zv,{data:t,period:r,timezone:i,setSelectionCoords:p,setSelectionDateInterval:g,setSelectionData:y,selectedMachine:c});case"topMachinesVolume":case"topMachinesTransactions":return Object(Me.jsx)(Uv,{data:t,period:r,timezone:i,setSelectionCoords:p,setSelectionDateInterval:g,setSelectionData:y,selectedMachine:c,machines:M.a((function(e){return"all"!==e.code}),s),currency:o});case"hourOfDayVolume":case"hourOfDayTransactions":return Object(Me.jsx)(Av,{data:t,period:r,timezone:i,setSelectionCoords:p,setSelectionDateInterval:g,setSelectionData:y,selectedMachine:c,machines:M.a((function(e){return"all"!==e.code}),s),currency:o,selectedDay:d});default:throw new Error("There's no graph to represent ".concat(e))}}(n)]})},Xv=Object(a.memo)(Gv),_v=Object(f.a)(kv),Zv=[{code:"hourOfDayTransactions",display:"Transactions"},{code:"hourOfDayVolume",display:"Volume"}],Kv=R.a((function(e){return{code:Iv.a(e),display:e}}),Array.from(Array(7)).map((function(e,t){return Object(ed.a)("EEEE",Object(Od.a)({days:t},Object(Sv.a)(new Date)))}))),Qv=function(e){var t=e.title,n=e.period,r=e.data,i=e.machines,o=e.selectedMachine,c=e.handleMachineChange,s=e.timezone,d=e.currency,u=_v(),m=Object(a.useState)(Zv[0].code),h=Object(l.a)(m,2),p=h[0],b=h[1],f=Object(a.useState)(Kv[0]),j=Object(l.a)(f,2),g=j[0],O=j[1],x={cashIn:Object(Me.jsx)("div",{className:u.cashInIcon}),cashOut:Object(Me.jsx)("div",{className:u.cashOutIcon})},v=Object(Qg.a)(s),y=hs.a((function(e,t){var n=new Date(t.created);switch(n.setTime(n.getTime()+n.getTimezoneOffset()*vv+v),n.getDay()){case 0:e.sunday.push(t);break;case 1:e.monday.push(t);break;case 2:e.tuesday.push(t);break;case 3:e.wednesday.push(t);break;case 4:e.thursday.push(t);break;case 5:e.friday.push(t);break;case 6:e.saturday.push(t);break;default:throw new Error("Day of week not recognized")}return e}),qc.a(R.a((function(e){return[e.code,[]]}),Kv)),r);return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)("div",{className:u.graphHeaderWrapper,children:[Object(Me.jsxs)("div",{className:u.graphHeaderLeft,children:[Object(Me.jsx)(He,{noMargin:!0,children:t}),Object(Me.jsxs)(Ko.a,{className:u.graphLegend,children:[Object(Me.jsx)(Nv,{IconElement:x.cashIn,label:"Cash-in"}),Object(Me.jsx)(Nv,{IconElement:x.cashOut,label:"Cash-out"})]})]}),Object(Me.jsxs)("div",{className:u.graphHeaderRight,children:[Object(Me.jsx)(Er,{options:Zv,className:u.topMachinesRadio,value:p,onChange:function(e){return b(e.target.value)}}),Object(Me.jsx)(th,{label:"Day of the week",items:Kv,default:Kv[0],selectedItem:g,onSelectedItemChange:O}),Object(Me.jsx)(th,{label:"Machines",onSelectedItemChange:c,items:i,default:i[0],selectedItem:o})]})]}),Object(Me.jsx)(Xv,{representing:Aa.a((function(e){return e.code===p}))(Zv),period:n,data:y[g.code],timezone:s,currency:d,selectedMachine:o,machines:i,selectedDay:g})]})},Yv=Object(f.a)(kv),Jv=function(e){var t=e.title,n=e.representing,a=e.period,r=e.data,i=e.machines,o=e.selectedMachine,l=e.handleMachineChange,c=e.timezone,s=e.currency,d=Yv(),u={cashIn:Object(Me.jsx)("div",{className:d.cashInIcon}),cashOut:Object(Me.jsx)("div",{className:d.cashOutIcon}),transaction:Object(Me.jsx)("div",{className:d.txIcon}),average:Object(Me.jsx)("svg",{height:"12",width:"18",children:Object(Me.jsx)("path",{stroke:J,strokeWidth:"3",strokeDasharray:"5, 2",d:"M 5 6 l 20 0"})})};return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)("div",{className:d.graphHeaderWrapper,children:[Object(Me.jsxs)("div",{className:d.graphHeaderLeft,children:[Object(Me.jsx)(He,{noMargin:!0,children:t}),Object(Me.jsxs)(Ko.a,{className:d.graphLegend,children:[Object(Me.jsx)(Nv,{IconElement:u.cashIn,label:"Cash-in"}),Object(Me.jsx)(Nv,{IconElement:u.cashOut,label:"Cash-out"}),Object(Me.jsx)(Nv,{IconElement:u.transaction,label:"One transaction"}),Object(Me.jsx)(Nv,{IconElement:u.average,label:"Average"})]})]}),Object(Me.jsx)("div",{className:d.graphHeaderRight,children:Object(Me.jsx)(th,{label:"Machines",onSelectedItemChange:l,items:i,default:i[0],selectedItem:o})})]}),Object(Me.jsx)(Xv,{representing:n,period:a,data:r,timezone:c,currency:s,selectedMachine:o,machines:i})]})},ey=Object(f.a)(kv),ty=[{code:"topMachinesTransactions",display:"Transactions"},{code:"topMachinesVolume",display:"Volume"}],ny=function(e){var t=e.title,n=e.period,r=e.data,i=e.machines,o=e.selectedMachine,c=e.timezone,s=e.currency,d=ey(),u=Object(a.useState)(ty[0].code),m=Object(l.a)(u,2),h=m[0],p=m[1],b={cashIn:Object(Me.jsx)("div",{className:d.cashInIcon}),cashOut:Object(Me.jsx)("div",{className:d.cashOutIcon})};return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)("div",{className:d.graphHeaderWrapper,children:[Object(Me.jsxs)("div",{className:d.graphHeaderLeft,children:[Object(Me.jsx)(He,{noMargin:!0,children:t}),Object(Me.jsxs)(Ko.a,{className:d.graphLegend,children:[Object(Me.jsx)(Nv,{IconElement:b.cashIn,label:"Cash-in"}),Object(Me.jsx)(Nv,{IconElement:b.cashOut,label:"Cash-out"})]})]}),Object(Me.jsx)("div",{className:d.graphHeaderRight,children:Object(Me.jsx)(Er,{options:ty,className:d.topMachinesRadio,value:h,onChange:function(e){return p(e.target.value)}})})]}),Object(Me.jsx)(Xv,{representing:Aa.a(W.a("code",h),ty),period:n,data:r,timezone:c,currency:s,selectedMachine:o,machines:i})]})},ay=Object(f.a)(kv),ry=[{code:"all",display:"All machines"}],iy=[{code:"overTime",display:"Over time"},{code:"topMachines",display:"Top Machines"},{code:"hourOfTheDay",display:"Hour of the day"}],oy=[{code:"day",display:"Last 24 hours"},{code:"week",display:"Last 7 days"},{code:"month",display:"Last 30 days"}],ly={day:yv,week:wv,month:Cv},cy=x()(tv||(tv=Object(c.a)(["\n query transactions($limit: Int, $from: Date, $until: Date) {\n transactions(limit: $limit, from: $from, until: $until) {\n id\n txClass\n txHash\n toAddress\n commissionPercentage\n expired\n machineName\n operatorCompleted\n sendConfirmed\n dispense\n hasError: error\n deviceId\n fiat\n cashInFee\n fiatCode\n cryptoAtoms\n cryptoCode\n toAddress\n created\n }\n }\n"]))),sy=x()(nv||(nv=Object(c.a)(["\n query getData {\n config\n machines {\n name\n deviceId\n }\n fiatRates {\n code\n name\n rate\n }\n }\n"]))),dy=function(e){var t,n=e.label,a=e.value,r=e.oldValue,i=e.currency,o=ay(),l=100*(a-r)/(!r||yd.a(r,0)?1:r),c=(t={},Object(z.a)(t,o.growthPercentage,!0),Object(z.a)(t,o.growth,em.a(a,r)),Object(z.a)(t,o.decline,em.a(r,a)),t);return Object(Me.jsxs)("div",{className:o.overviewEntry,children:[Object(Me.jsx)(Xe,{noMargin:!0,children:n}),Object(Me.jsxs)(Ze,{noMargin:!0,className:o.overviewFieldWrapper,children:[Object(Me.jsx)("span",{children:a.toLocaleString("en-US",{maximumFractionDigits:2})}),!!i&&" ".concat(i)]}),Object(Me.jsxs)("span",{className:o.overviewGrowth,children:[em.a(l,0)&&Object(Me.jsx)(Qs,{height:10}),Ov.a(l,0)&&Object(Me.jsx)(zs,{height:10}),yd.a(l,0)&&Object(Me.jsx)(Us,{height:10}),Object(Me.jsxs)(Xe,{noMargin:!0,className:I()(c),children:[l.toLocaleString("en-US",{maximumFractionDigits:2}),"%"]})]})]})},uy=function(){var e,t,n,r,i,o=ay(),c=Object(u.c)(cy),d=c.data,m=c.loading,h=Object(u.c)(sy),p=h.data,b=h.loading,f=Object(a.useState)(iy[0]),j=Object(l.a)(f,2),g=j[0],O=j[1],x=Object(a.useState)(oy[0]),v=Object(l.a)(x,2),y=v[0],w=v[1],C=Object(a.useState)(ry[0]),k=Object(l.a)(C,2),E=k[0],N=k[1],S=m||b,I=null!==(e=A.a(["transactions"])(d))&&void 0!==e?e:[],F=null!==(t=A.a(["machines"])(p))&&void 0!==t?t:[],L=null!==(n=A.a(["config"])(p))&&void 0!==n?n:[],P=null!==(r=A.a(["fiatRates"])(p))&&void 0!==r?r:[],D=rs("locale")(L).fiatCurrency,B=null===L||void 0===L?void 0:L.locale_timezone,T=function(e){if(e.fiatCode===D)return e;var t=Aa.a(W.a("code",e.fiatCode))(P),n=Aa.a(W.a("code",D))(P),a=(null===n||void 0===n?void 0:n.rate)/(null===t||void 0===t?void 0:t.rate);return Object(s.a)(Object(s.a)({},e),{},{fiat:parseFloat(e.fiat)*a})},z=null!==(i=R.a(T)(null===I||void 0===I?void 0:I.filter((function(e){return(!e.dispensed||!e.expired)&&(e.sendConfirmed||e.dispense)}))))&&void 0!==i?i:[],q=xv.a(ry);zp.a((function(e){return q.push({code:e.deviceId,display:e.name})}),F);var $=M.a((function(e){return"all"===E.code||e.deviceId===E.code}),z),H=function(e){var t,n;return{current:null!==(t=$.filter((function(t){return new Date(t.created)>=Date.now()-ly[e]})))&&void 0!==t?t:[],previous:null!==(n=$.filter((function(t){return new Date(t.created)<Date.now()-ly[e]&&new Date(t.created)>=Date.now()-2*ly[e]})))&&void 0!==n?n:[]}},V={current:H(y.code).current.length,previous:H(y.code).previous.length},U={current:ms.a(R.a((function(e){return e.fiat}),H(y.code).current))/(0===V.current?1:V.current),previous:ms.a(R.a((function(e){return e.fiat}),H(y.code).previous))/(0===V.previous?1:V.previous)},G={current:ms.a(R.a((function(e){return e.fiat}),H(y.code).current)),previous:ms.a(R.a((function(e){return e.fiat}),H(y.code).previous))},X={current:ms.a(R.a((function(e){return e.fiat*e.commissionPercentage}),H(y.code).current)),previous:ms.a(R.a((function(e){return e.fiat*e.commissionPercentage}),H(y.code).previous))};return!S&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(nl,{title:"Analytics",children:Object(Me.jsxs)(Ko.a,{className:o.overviewLegend,children:[Object(Me.jsx)(Nv,{IconComponent:Qs,label:"Up since last period"}),Object(Me.jsx)(Nv,{IconComponent:zs,label:"Down since last period"}),Object(Me.jsx)(Nv,{IconComponent:Us,label:"Same since last period"})]})}),Object(Me.jsxs)("div",{className:o.dropdownsOverviewWrapper,children:[Object(Me.jsxs)("div",{className:o.dropdowns,children:[Object(Me.jsx)(th,{label:"Representing",onSelectedItemChange:O,items:iy,default:iy[0],selectedItem:g}),Object(Me.jsx)(th,{label:"Time period",onSelectedItemChange:w,items:oy,default:oy[0],selectedItem:y})]}),Object(Me.jsxs)("div",{className:o.overview,children:[Object(Me.jsx)(dy,{label:"Transactions",value:V.current,oldValue:V.previous}),Object(Me.jsx)("div",{className:o.verticalLine}),Object(Me.jsx)(dy,{label:"Avg. txn amount",value:U.current,oldValue:U.previous,currency:D}),Object(Me.jsx)("div",{className:o.verticalLine}),Object(Me.jsx)(dy,{label:"Volume",value:G.current,oldValue:G.previous,currency:D}),Object(Me.jsx)("div",{className:o.verticalLine}),Object(Me.jsx)(dy,{label:"Commissions",value:X.current,oldValue:X.previous,currency:D})]})]}),function(e){switch(e.code){case"overTime":return Object(Me.jsx)(Jv,{title:"Transactions over time",representing:e,period:y,data:R.a(T)(H(y.code).current),machines:q,selectedMachine:E,handleMachineChange:N,timezone:B,currency:D});case"topMachines":return Object(Me.jsx)(ny,{title:"Transactions over time",representing:e,period:y,data:R.a(T)(H(y.code).current),machines:q,selectedMachine:E,handleMachineChange:N,timezone:B,currency:D});case"hourOfTheDay":return Object(Me.jsx)(Qv,{title:"Avg. transactions per hour of the day",representing:e,period:y,data:R.a(T)(H(y.code).current),machines:q,selectedMachine:E,handleMachineChange:N,timezone:B,currency:D});default:throw new Error("There's no graph info to represent ".concat(e))}}(g)]})},my=n(900),hy={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:K},deleteButton:{paddingLeft:13},addressRow:{marginLeft:8},error:{color:me}},py=Object(f.a)(hy),by=function(e){var t=e.onClose,n=e.selectedCoin,a=e.addToBlacklist,r=e.errorMsg,i=py();return Object(Me.jsxs)(Mh,{closeOnBackdropClick:!0,width:676,height:200,handleClose:t,open:!0,children:[Object(Me.jsx)(bn.e,{validateOnBlur:!1,validateOnChange:!1,initialValues:{address:""},validationSchema:xn.f({address:xn.h().trim().required("An address is required")}),onSubmit:function(e,t){var r=e.address,i=t.resetForm;!function(e){"BCH"!==n.code||e.startsWith("bitcoincash:")||(e="bitcoincash:"+e),a(n.code,e)}(r.trim()),i()},children:Object(Me.jsxs)(bn.d,{id:"address-form",children:[Object(Me.jsx)(Ve,{className:i.modalTitle,children:n.display?"Blacklist ".concat(Iv.a(n.display)," address"):""}),Object(Me.jsx)("span",{className:i.error,children:r}),Object(Me.jsx)(bn.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:ai})]})}),Object(Me.jsx)("div",{className:i.footer,children:Object(Me.jsx)(Ko.a,{display:"flex",justifyContent:"flex-end",children:Object(Me.jsx)(oa,{type:"submit",form:"address-form",children:"Blacklist address"})})})]})},fy=Object(f.a)(Uj),jy=function(e){var t,n=e.id,a=e.index,r=e.elements,i=e.data,o=e.width,l=e.Details,c=e.expanded,d=e.expandRow,u=e.expWidth,m=e.expandable,h=e.onClick,p=e.size,b=Object(q.a)(e,["id","index","elements","data","width","Details","expanded","expandRow","expWidth","expandable","onClick","size"]),f=fy(),j=h||m,g=(t={},Object(z.a)(t,f.pointer,j),Object(z.a)(t,f.row,!0),Object(z.a)(t,f.expanded,c),t);return Object(Me.jsxs)("div",{className:f.rowWrapper,children:[Object(Me.jsx)("div",{className:I()(Object(z.a)({},f.before,c&&0!==a)),children:Object(Me.jsxs)(Cm,{size:p,className:I()(g),onClick:function(){m&&d(n,i),h&&h(i)},error:i.error||i.hasError,shouldShowError:!1,errorMessage:i.errorMessage||i.hasError,children:[r.map((function(e,t){var n=e.view,a=void 0===n?function(e){return null===e||void 0===e?void 0:e.toString()}:n,r=Object(q.a)(e,["view"]);return Object(Me.jsx)(vm,Object(s.a)(Object(s.a)({},r),{},{children:a(i)}),t)})),m&&Object(Me.jsx)(vm,{width:u,textAlign:"center",children:Object(Me.jsxs)("button",{onClick:function(){return d(n,i)},className:f.expandButton,children:[c&&Object(Me.jsx)(cg,{}),!c&&Object(Me.jsx)(Qj,{})]})})]})}),m&&c&&Object(Me.jsx)("div",{className:f.after,children:Object(Me.jsx)(Cm,{className:I()(Object(z.a)({},f.expanded,c)),children:Object(Me.jsx)(vm,{width:o,children:Object(Me.jsx)(l,{it:i,timezone:b.timezone})})})})]})},gy=function(e){var t=e.elements,n=void 0===t?[]:t,r=e.data,i=void 0===r?[]:r,o=e.Details,c=(e.className,e.expandable),d=e.initialExpanded,u=e.onClick,m=e.loading,h=e.emptyText,p=e.rowSize,b=Object(q.a)(e,["elements","data","Details","className","expandable","initialExpanded","onClick","loading","emptyText","rowSize"]),f=Object(a.useState)(d),j=Object(l.a)(f,2),g=j[0],O=j[1];Object(a.useEffect)((function(){return O(d)}),[d]);var x=L.a(ms.a,R.a(B.a("width")))(n),v=1200-x,y=x+(c?v:0),w=fy({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 Vj.c({defaultHeight:58,fixedWidth:!0});function E(e){var t=e.index,a=e.key,r=e.parent,l=e.style;return Object(Me.jsx)(Vj.b,{cache:k,columnIndex:0,parent:r,rowIndex:t,children:function(e){var a=e.registerChild;return Object(Me.jsx)("div",{ref:a,style:l,children:Object(Me.jsx)(jy,{width:y,size:p,id:i[t].id?i[t].id:t,index:t,expWidth:v,elements:n,data:i[t],Details:o,expanded:i[t].id?i[t].id===g:t===g,expandRow:C,expandable:c,onClick:u,timezone:b.timezone})})}},a)}return Object(Me.jsx)(Ko.a,{display:"flex",flex:"1",flexDirection:"column",children:Object(Me.jsxs)(jm,{className:w.table,children:[Object(Me.jsxs)(gm,{children:[n.map((function(e,t){var n=e.width,a=e.className,r=e.textAlign,i=e.header;return Object(Me.jsx)(ym,{width:n,className:a,textAlign:r,children:i},t)})),c&&Object(Me.jsx)(ym,{width:v})]}),Object(Me.jsxs)(xm,{className:w.body,children:[m&&Object(Me.jsx)(Ue,{children:"Loading..."}),!m&&Wa.a(i)&&Object(Me.jsx)(ys,{message:h}),Object(Me.jsx)(Vj.a,{disableWidth:!0,children:function(e){var t=e.height;return Object(Me.jsx)(Vj.d,Object(s.a)(Object(s.a)({style:{overflow:"inherit",outline:"none"}},b),{},{height:m?0:t,width:y,rowCount:i.length,rowHeight:k.rowHeight,rowRenderer:E,overscanRowCount:5,deferredMeasurementCache:k}))}})]})]})})},Oy=Object(f.a)(hy),xy=function(e){var t=e.data,n=e.selectedCoin,r=e.handleDeleteEntry,i=e.errorMessage,o=e.setErrorMessage,c=e.deleteDialog,s=e.setDeleteDialog,d=Oy(),u=Object(a.useState)(),m=Object(l.a)(u,2),h=m[0],p=m[1],b=[{name:"address",header:Object(Me.jsx)(et,{className:d.white,children:"Addresses"}),width:800,textAlign:"left",size:"sm",view:function(e){return Object(Me.jsx)("div",{className:d.addressRow,children:Object(Me.jsx)(gf,{children:A.a(["address"],e)})})}},{name:"deleteButton",header:Object(Me.jsx)(et,{className:d.white,children:"Delete"}),width:130,textAlign:"center",size:"sm",view:function(e){return Object(Me.jsx)(ta,{className:d.deleteButton,onClick:function(){s(!0),p(e)},children:Object(Me.jsx)(hh,{})})}}],f=n?t[n.code]:t[Wc.a(t)[0]];return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(gy,{data:f,elements:b,emptyText:"No blacklisted addresses so far",name:"blacklistTable"}),Object(Me.jsx)($m,{open:c,onDismissed:function(){s(!1),o(null)},onConfirmed:function(){o(null),r(A.a(["cryptoCode"],h),A.a(["address"],h))},errorMessage:i})]})},vy=Object(f.a)(hy),yy=my.a((function(e){return e.cryptoCode})),wy=x()(av||(av=Object(c.a)(["\n mutation DeleteBlacklistRow($cryptoCode: String!, $address: String!) {\n deleteBlacklistRow(cryptoCode: $cryptoCode, address: $address) {\n cryptoCode\n address\n }\n }\n"]))),Cy=x()(rv||(rv=Object(c.a)(["\n query getBlacklistData {\n blacklist {\n cryptoCode\n address\n }\n cryptoCurrencies {\n display\n code\n }\n }\n"]))),ky=x()(iv||(iv=Object(c.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),Ey=x()(ov||(ov=Object(c.a)(["\n query getData {\n config\n }\n"]))),Ny=x()(lv||(lv=Object(c.a)(["\n mutation InsertBlacklistRow($cryptoCode: String!, $address: String!) {\n insertBlacklistRow(cryptoCode: $cryptoCode, address: $address) {\n cryptoCode\n address\n }\n }\n"]))),Sy=function(){var e,t,n,r=Object(u.c)(Cy).data,i=Object(u.c)(Ey).data,o=Object(a.useState)(!1),c=Object(l.a)(o,2),s=c[0],d=c[1],m=Object(a.useState)({code:"BTC",display:"Bitcoin"}),p=Object(l.a)(m,2),b=p[0],f=p[1],j=Object(a.useState)(null),g=Object(l.a)(j,2),O=g[0],x=g[1],v=Object(a.useState)(!1),y=Object(l.a)(v,2),w=y[0],C=y[1],k=Object(u.b)(wy,{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"]}}),E=Object(l.a)(k,1)[0],N=Object(u.b)(Ny,{onError:function(){return console.log("Error while adding row")},refetchQueries:function(){return["getBlacklistData"]}}),S=Object(l.a)(N,1)[0],I=Object(u.b)(ky,{refetchQueries:function(){return["getData"]}}),F=Object(l.a)(I,1)[0],L=vy(),P=null!==(e=A.a(["blacklist"])(r))&&void 0!==e?e:[],R=null!==(t=A.a(["cryptoCurrencies"],r))&&void 0!==t?t:[],B=yy(P),T=(null===i||void 0===i?void 0:i.config)&&rs("compliance")(i.config),M=null!==(n=null===T||void 0===T?void 0:T.rejectAddressReuse)&&void 0!==n&&n,z=function(e,t){try{return!D.a(yf.utils.parseUrl(e,"main",t))}catch(n){return!1}},q=function(){var e=Object(Pl.a)(Ll.a.mark((function e(t,n){var a,r;return Ll.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(x(null),z(t,n)){e.next=4;break}return x("Invalid address"),e.abrupt("return");case 4:return e.next=6,S({variables:{cryptoCode:t,address:n}});case 6:if((a=e.sent).errors){e.next=9;break}return e.abrupt("return",d(!1));case 9:r=a.errors.some((function(e){return e.message.includes("duplicate")})),x(r?"This address is already being blocked":"Server error");case 11:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(nl,{title:"Blacklisted addresses",children:Object(Me.jsx)(Ko.a,{display:"flex",justifyContent:"flex-end",children:Object(Me.jsx)(oa,{color:"primary",onClick:function(){return d(!0)},children:"Blacklist new addresses"})})}),Object(Me.jsxs)(h.a,{container:!0,className:L.grid,children:[Object(Me.jsx)(yi,{data:R,isSelected:W.a("code",b.code),displayName:function(e){return e.display},onClick:function(e){f({code:e.code,display:e.display})}}),Object(Me.jsxs)("div",{className:L.content,children:[Object(Me.jsxs)(Ko.a,{display:"flex",justifyContent:"space-between",mb:3,children:[Object(Me.jsxs)(Ue,{noMargin:!0,className:L.subtitle,children:[b.display?"".concat(b.display," blacklisted addresses"):""," "]}),Object(Me.jsxs)(Ko.a,{display:"flex",alignItems:"center",justifyContent:"flex-end",mr:"-5px",children:[Object(Me.jsx)(Xe,{children:"Reject reused addresses"}),Object(Me.jsx)(Fr,{checked:M,onChange:function(e){!function(e){var t=is("compliance")(e);F({variables:{config:t}})}({rejectAddressReuse:e.target.checked})},value:M}),Object(Me.jsx)(tt,{children:M?"On":"Off"}),Object(Me.jsx)(fp,{width:304,children:Object(Me.jsx)(Xe,{children:'The "Reject reused addresses" option means that all addresses that are used once will be automatically rejected if there\'s an attempt to use them again on a new transaction.'})})]})]}),Object(Me.jsx)(xy,{data:B,selectedCoin:b,handleDeleteEntry:function(e,t){E({variables:{cryptoCode:e,address:t}})},errorMessage:O,setErrorMessage:x,deleteDialog:w,setDeleteDialog:C})]})]}),s&&Object(Me.jsx)(by,{onClose:function(){x(null),d(!1)},errorMsg:O,selectedCoin:b,addToBlacklist:q})]})},Iy={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:Z,marginBottom:12,marginTop:30,textAlign:"center"},titleDecorator:{verticalAlign:"bottom",marginRight:12,width:24,height:26}},Fy=Object(f.a)(Iy),Ly=function(e){var t=e.name,n=e.onContinue,a=Fy();return Object(Me.jsxs)("div",{className:a.modalContent,children:[Object(Me.jsxs)("div",{className:a.innerContent,children:[Object(Me.jsxs)($e,{className:a.title,children:[Object(Me.jsx)(Bc,{className:a.titleDecorator}),Object(Me.jsx)("span",{children:"Enable cash-out"})]}),Object(Me.jsx)(Ze,{className:a.subtitle,children:t}),Object(Me.jsxs)(Xe,{children:["You are about to activate cash-out functionality on your ",t," ","machine which will allow your customers to sell crypto to you."]}),Object(Me.jsx)(Xe,{children:"In order to activate cash-out for this machine, please enter the denominations for the machine."})]}),Object(Me.jsx)(An,{className:a.button,onClick:n,children:"Start configuration"})]})},Py=n.p+"static/media/cashout-cassette-1.fac6c691.svg",Dy=n.p+"static/media/cashout-cassette-2.34a98cfa.svg",Ry={title:{margin:[[0,0,12,0]]},titleDiv:{paddingBottom:32},subtitle:{margin:[[32,0,21,0]]},edit:{margin:[[0,0,0,0]]},error:{color:me},bill:{width:131,display:"flex",alignItems:"center",justifyContent:"end"},billInput:{width:"100%"},suffix:{paddingLeft:16},button:{marginLeft:"auto"},submit:{float:"right"},picker:{width:150},header:{display:"flex",marginBottom:95},thirdStepHeader:{display:"flex",paddingBottom:188},step:{flex:1},stepImage:{position:"relative",top:-20,right:14},content:{display:"flex",flexDirection:"column",justifyContent:"space-between",flex:1,paddingBottom:32},disclaimer:{display:"flex",flex:1,flexDirection:"column",justifyContent:"space-between"},disclaimerIcon:{float:"left",margin:[[-4,16,48,0]]}},By=Object(f.a)(Ry),Ty=function(e){var t=e.name,n=e.step,a=e.schema,r=e.error,i=e.lastStep,o=e.onContinue,l=e.steps,c=e.fiatCurrency,s=e.options,d=e.numberOfCassettes,u=By(),m=i?"Finish":"Next";return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)("div",{className:u.titleDiv,children:[Object(Me.jsx)(Ze,{className:u.title,children:t}),Object(Me.jsx)(rp,{steps:l.length+1,currentStep:n})]}),n<=d&&Object(Me.jsx)(bn.e,{validateOnBlur:!1,validateOnChange:!1,onSubmit:o,initialValues:{cassette1:"",cassette2:"",cassette3:"",cassette4:""},enableReinitialize:!0,validationSchema:a,children:Object(Me.jsxs)(bn.d,{children:[Object(Me.jsxs)("div",{className:u.header,children:[l.map((function(e,t){var a=e.type,r=e.display,i=e.component;return 1+t===n&&Object(Me.jsxs)("div",{className:u.step,children:[Object(Me.jsxs)(Ue,{className:u.edit,children:["Edit ",r]}),Object(Me.jsx)(et,{children:"Choose bill denomination"}),Object(Me.jsxs)("div",{className:u.bill,children:[Object(Me.jsx)(bn.b,{className:u.billInput,type:"text",size:"lg",autoFocus:1+t===n,component:(null===s||void 0===s?void 0:s.length)>0?i:ei,fullWidth:!0,decimalPlaces:0,name:a,options:s,valueProp:"code",labelProp:"display"}),Object(Me.jsx)(_e,{noMargin:!0,className:u.suffix,children:c})]})]},t)})),Object(Me.jsx)("img",{className:u.stepImage,alt:"cassette",width:"148",height:"205",src:{2:{1:Py,2:Dy},3:{1:vp,2:yp,3:wp},4:{1:Cp,2:kp,3:Ep,4:Np}}[d][n]})]}),Object(Me.jsx)(An,{className:u.submit,type:"submit",children:m})]})}),n===d+1&&Object(Me.jsx)(bn.e,{validateOnBlur:!1,validateOnChange:!1,onSubmit:o,initialValues:{zeroConfLimit:""},enableReinitialize:!0,validationSchema:l[n-1].schema,children:Object(Me.jsxs)(bn.d,{children:[Object(Me.jsx)("div",{className:u.thirdStepHeader,children:Object(Me.jsxs)("div",{className:u.step,children:[Object(Me.jsx)(Ue,{className:u.edit,children:"Edit 0-conf Limit"}),Object(Me.jsx)(et,{children:"Choose a limit"}),Object(Me.jsxs)("div",{className:u.bill,children:[Object(Me.jsx)(bn.b,{className:u.billInput,type:"text",size:"lg",autoFocus:!0,component:ei,fullWidth:!0,decimalPlaces:0,name:l[n-1].type}),Object(Me.jsx)(_e,{noMargin:!0,className:u.suffix,children:c})]})]})}),Object(Me.jsx)(An,{className:u.submit,type:"submit",children:m})]})}),i&&Object(Me.jsxs)("div",{className:u.disclaimer,children:[Object(Me.jsx)(Ze,{className:u.title,children:"Cash-out Bill Count"}),Object(Me.jsxs)(Xe,{children:[Object(Me.jsx)(ir,{className:u.disclaimerIcon}),"When enabling cash-out, your bill count will be automatically set to zero. Make sure you physically put cash inside the cash cassettes to allow the machine to dispense it to your users. If you already did, make sure you set the correct cash-out bill count for this machine on your Cash Cassettes tab under Maintenance."]}),Object(Me.jsx)(Ze,{className:u.title,children:"Default Commissions"}),Object(Me.jsxs)(Xe,{children:[Object(Me.jsx)(ir,{className:u.disclaimerIcon}),"When enabling cash-out, default commissions will be set. To change commissions for this machine, please go to the Commissions tab under Settings where you can set exceptions for each of the available cryptocurrencies."]}),Object(Me.jsxs)("div",{children:[r&&Object(Me.jsx)(Jo,{children:"Failed to save"}),Object(Me.jsx)(An,{className:u.submit,onClick:function(){return o()},children:m})]})]})]})},Ay=xn.f().shape({cassette1:xn.e().label("Cassette 1").required().min(1).max(Wh),cassette2:xn.e().label("Cassette 2").required().min(1).max(Wh),cassette3:xn.e().label("Cassette 3").min(1).max(Wh).nullable().transform(Vh),cassette4:xn.e().label("Cassette 4").min(1).max(Wh).nullable().transform(Vh),zeroConfLimit:xn.e().label("0-conf Limit").required().min(0).max(Wh)}),My=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,a=B.a("fiatCurrency")(t),r=Math.max.apply(Math,Object(d.a)(R.a((function(e){return e.numberOfCassettes}),e)).concat([0])),i=Ng(t,Eg),o=(null===i||void 0===i?void 0:i.length)>0?{options:i,labelProp:"display",valueProp:"code",className:n.autoComplete}:{decimalPlaces:0},l=[{name:"id",header:"Machine",width:300,view:function(t){return e.find((function(e){return e.deviceId===t})).name},size:"sm",editable:!1}];return Ju.a(em.a(tm.a,r),(function(t){return l.push({name:"cassette".concat(t),header:"Cassette ".concat(t),size:"sm",stripe:!0,textAlign:"right",width:(r>2?600:460)/r,suffix:a,bold:Va,view:function(e){return e},input:(null===i||void 0===i?void 0:i.length)>0?Tr:ei,inputProps:o,doubleHeader:"Denominations",isHidden:function(n){return t>e.find((function(e){return e.deviceId===n.id})).numberOfCassettes}}),nm.a(1,t)}),1),l.push({name:"zeroConfLimit",header:"0-conf Limit",size:"sm",stripe:!0,textAlign:"right",width:r>2?150:290,input:ei,inputProps:{decimalPlaces:0},suffix:a}),l},Wy=function(e){var t=e.machine,n=e.locale,r=e.onClose,i=e.save,o=e.error,c=t.numberOfCassettes+2,s=Object(a.useState)({step:0,config:{active:!0}}),d=Object(l.a)(s,2),u=d[0],m=u.step,h=u.config,p=d[1],b=Ng(n,Eg),f=m===c,j=function(){var e=Object(Pl.a)(Ll.a.mark((function e(n){var a;return Ll.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!f){e.next=2;break}return e.abrupt("return",i(is(t.deviceId,Ay.cast(h,{assert:!1}))));case 2:a=Gn.a(h,n),p({step:m+1,config:a});case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),g=[];Ju.a(em.a(tm.a,t.numberOfCassettes),(function(e){return g.push({type:"cassette".concat(e),display:"Cassette ".concat(e),component:Tr,inputProps:{options:R.a((function(e){return{code:e,display:e}}))(b),labelProp:"display",valueProp:"code"}}),nm.a(1,e)}),1),g.push({type:"zeroConfLimit",display:"0-conf Limit",schema:xn.f().shape({zeroConfLimit:xn.e().required()})});return Object(Me.jsxs)(Mh,{title:0===m?null:"Enable cash-out",handleClose:r,width:554,height:520,open:!0,children:[0===m&&Object(Me.jsx)(Ly,{name:t.name,onContinue:function(){return j()}}),0!==m&&Object(Me.jsx)(Ty,{step:m,name:t.name,numberOfCassettes:t.numberOfCassettes,error:o,lastStep:f,steps:g,fiatCurrency:n.fiatCurrency,options:b,schema:xn.f().shape({cassette1:xn.e().required(),cassette2:t.numberOfCassettes>1&&m>=2?xn.e().required():xn.e().transform(Vh).nullable(),cassette3:t.numberOfCassettes>2&&m>=3?xn.e().required():xn.e().transform(Vh).nullable(),cassette4:t.numberOfCassettes>3&&m>=4?xn.e().required():xn.e().transform(Vh).nullable()}),onContinue:j})]})},zy=Object(f.a)({fudgeFactor:{display:"flex",alignItems:"center"},switchLabel:{margin:6,width:24},autoComplete:{width:"100%"}}),qy=x()(cv||(cv=Object(c.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),$y=x()(sv||(sv=Object(c.a)(["\n query getData {\n machines {\n name\n deviceId\n cashbox\n cassette1\n cassette2\n cassette3\n cassette4\n numberOfCassettes\n }\n config\n }\n"]))),Hy=function(e){var t,n,r=e.name,i=zy(),o=Object(a.useState)(!1),c=Object(l.a)(o,2),s=c[0],d=c[1],m=Object(u.c)($y).data,h=Object(u.b)(qy,{onCompleted:function(){return d(!1)},refetchQueries:function(){return["getData"]}}),p=Object(l.a)(h,2),b=p[0],f=p[1].error,j=function(e,t){var n=is(r)(e);return b({variables:{config:n,accounts:t}})},g=(null===m||void 0===m?void 0:m.config)&&rs(r)(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)&&rs("locale")(m.config),v=null!==(n=null===m||void 0===m?void 0:m.machines)&&void 0!==n?n:[];return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(nl,{title:"Cash-out",children:Object(Me.jsxs)("div",{className:i.fudgeFactor,children:[Object(Me.jsx)(Xe,{children:"Transaction fudge factor"}),Object(Me.jsx)(Fr,{checked:O,onChange:function(e){j({fudgeFactorActive:e.target.checked})},value:O}),Object(Me.jsx)(tt,{className:i.switchLabel,children:O?"On":"Off"}),Object(Me.jsxs)(fp,{width:304,children:[Object(Me.jsx)(Xe,{children:"Automatically accept customer deposits as complete if their received amount is 100 crypto atoms or less."}),Object(Me.jsx)(Xe,{children:"(Crypto atoms are the smallest unit in each cryptocurrency. E.g., satoshis in Bitcoin, or wei in Ethereum.)"})]})]})}),Object(Me.jsx)(Bh,{namespaces:R.a(A.a(["deviceId"]))(v),data:g,stripeWhen:function(e){return 1===L.a(gn.a,Wc.a)(e)},enableEdit:!0,editWidth:134,enableToggle:!0,toggleWidth:109,onToggle:function(e){var t=rs(e)(g);if(!Ay.isValidSync(t))return d(e);j(is(e,{active:!(null===t||void 0===t?void 0:t.active)}))},save:j,error:null===f||void 0===f?void 0:f.message,validationSchema:Ay,disableRowEdit:L.a(P.a,A.a(["active"])),elements:My(v,x,i)}),Wa.a(v)&&Object(Me.jsx)(ys,{message:"No machines so far"}),s&&Object(Me.jsx)(Wy,{machine:Aa.a(W.a("deviceId",s))(v),onClose:function(){return d(!1)},save:j,error:null===f||void 0===f?void 0:f.message,locale:x})]})},Vy=n(904),Uy=n(905);function Gy(){return(Gy=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Xy(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var _y=a.createElement("desc",null,"Created with Sketch."),Zy=a.createElement("g",{id:"icon/sf-small/listing/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("line",{x1:0,y1:1,x2:20,y2:1,id:"Path-4",stroke:"#FFFFFF",strokeWidth:2}),a.createElement("line",{x1:0,y1:7,x2:9,y2:7,id:"Path-4-Copy",stroke:"#FFFFFF",strokeWidth:2}),a.createElement("line",{x1:0,y1:13,x2:20,y2:13,id:"Path-4-Copy-2",stroke:"#FFFFFF",strokeWidth:2}),a.createElement("line",{x1:0,y1:19,x2:12,y2:19,id:"Path-4-Copy-3",stroke:"#FFFFFF",strokeWidth:2}));function Ky(e,t){var n=e.title,r=e.titleId,i=Xy(e,["title","titleId"]);return a.createElement("svg",Gy({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":r},i),n?a.createElement("title",{id:r},n):null,_y,Zy)}var Qy=a.forwardRef(Ky);n.p;function Yy(){return(Yy=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Jy(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var ew=a.createElement("desc",null,"Created with Sketch."),tw=a.createElement("g",{id:"icon/sf-small/listing/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("line",{x1:0,y1:1,x2:20,y2:1,id:"Path-4",stroke:"#1B2559",strokeWidth:2}),a.createElement("line",{x1:0,y1:7,x2:9,y2:7,id:"Path-4-Copy",stroke:"#1B2559",strokeWidth:2}),a.createElement("line",{x1:0,y1:13,x2:20,y2:13,id:"Path-4-Copy-2",stroke:"#1B2559",strokeWidth:2}),a.createElement("line",{x1:0,y1:19,x2:12,y2:19,id:"Path-4-Copy-3",stroke:"#1B2559",strokeWidth:2}));function nw(e,t){var n=e.title,r=e.titleId,i=Jy(e,["title","titleId"]);return a.createElement("svg",Yy({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":r},i),n?a.createElement("title",{id:r},n):null,ew,tw)}var aw=a.forwardRef(nw);n.p;function rw(){return(rw=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function iw(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var ow=a.createElement("rect",{width:12,height:12,rx:3,ry:3,fill:"#44e188"});function lw(e,t){var n=e.title,r=e.titleId,i=iw(e,["title","titleId"]);return a.createElement("svg",rw({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":r},i),n?a.createElement("title",{id:r},n):null,ow)}var cw,sw,dw=a.forwardRef(lw),uw=(n.p,n(901)),mw=n(944),hw=Object(a.memo)((function(e){var t,n=e.config,r=e.locale,i=e.currency,o=e.data,c=e.error,s=e.save,d=e.saveOverrides,u=Object(a.useState)(!1),m=Object(l.a)(u,2),h=m[0],p=m[1],b=Object(a.useState)(!1),f=Object(l.a)(b,2),j=f[0],g=f[1],O=n&&!Wa.a(n)?n:qg,x=null!==(t=null===O||void 0===O?void 0:O.overrides)&&void 0!==t?t:[],v=lm.a([uw.a(Hg),uw.a(B.a("machine"))])(x);return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(jO,{children:Object(Me.jsx)(Rh,{error:null===c||void 0===c?void 0:c.message,title:"Default setup",rowSize:"lg",titleLg:!0,name:"commissions",enableEdit:!0,initialValues:O,save:s,validationSchema:Wg(r),data:mw.a(O),elements:Tg(i),setEditing:function(e,t){return p(t)},forceDisable:j})}),Object(Me.jsx)(jO,{children:Object(Me.jsx)(Rh,{error:null===c||void 0===c?void 0:c.message,title:"Overrides",titleLg:!0,name:"overrides",enableDelete:!0,enableEdit:!0,enableCreate:!0,groupBy:Hg,initialValues:$g,save:d,validationSchema:zg(v,o,r),data:v,elements:Ag(o,i),setEditing:function(e,t){return g(t)},forceDisable:h})})]})})),pw=n(902),bw=n(903),fw=n(926),jw={code:"SHOW_ALL",display:"Show all"},gw=[{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"}],Ow=Object(f.a)({headerLine:{display:"flex",justifyContent:"",marginBottom:24},select:{marginRight:24},tableWrapper:{flex:1,display:"block",overflowY:"auto",width:"100%",maxHeight:"70vh"}}),xw=function(e,t){return{code:e,display:t||e}},vw=Object(a.memo)((function(e){var t,n=e.config,r=e.localeConfig,i=e.currency,o=e.data,c=e.error,s=e.saveOverrides,d=Ow(),u=Object(a.useState)(jw),m=Object(l.a)(u,2),h=m[0],p=m[1],b=Object(a.useState)(jw),f=Object(l.a)(b,2),j=f[0],g=f[1],O=Object(a.useState)(gw[0]),x=Object(l.a)(O,2),v=x[0],y=x[1],w=null!==(t=B.a("cryptoCurrencies",r))&&void 0!==t?t:[],C=R.a(xw)(w),k=pw.a(B.a("display"),R.a((function(e){return xw(B.a("deviceId",e),B.a("name",e))}))(B.a("machines",o))),E=fw.a(R.a((function(e){var t,n=null===(t=B.a("overrides",r))||void 0===t?void 0:t.find(W.a("machine",e)),a=n?B.a("cryptoCurrencies",n):w;return bw.a([e],a)}))(k.map(B.a("code")))),N=R.a((function(e){var t=Object(l.a)(e,2),a=t[0];return function(e,t,n){var a,r=null!==(a=B.a("overrides",n))&&void 0!==a?a:[];if(!r&&Wa.a(r))return Vg(e,t,!0,n);var i=Aa.a((function(n){return n.machine===t&&xg.includes(e)(n.cryptoCurrencies)}))(r);if(void 0!==i)return Vg(e,t,!1,i);var o=Aa.a((function(e){return e.machine===t&&xg.includes("ALL_COINS")(e.cryptoCurrencies)}))(r);if(void 0!==o)return Vg(e,t,!1,o);var l=Aa.a((function(t){return"ALL_MACHINES"===t.machine&&xg.includes(e)(t.cryptoCurrencies)}))(r);return void 0!==l?Vg(e,t,!1,l):Vg(e,t,!0,n)}(t[1],a,n)}))(E),S=L.a(function(e){switch(e){case gw[0]:return pw.a(Aa.a(W.a("code",B.a("machine"))));case gw[1]:return pw.a(A.a(["cryptoCurrencies",0]));default:return pw.a(B.a(e.code))}}(v),function(e,t){return L.a(M.a((function(e){return t===jw|t.code===e.machine})),M.a((function(t){return e===jw|e.code===t.cryptoCurrencies[0]})))}(j,h))(N);return Object(Me.jsxs)("div",{children:[Object(Me.jsxs)("div",{className:d.headerLine,children:[Object(Me.jsx)(th,{className:d.select,onSelectedItemChange:p,label:"Machines",default:jw,items:[jw].concat(k),selectedItem:h}),Object(Me.jsx)(th,{className:d.select,onSelectedItemChange:g,label:"Cryptocurrency",default:jw,items:[jw].concat(C),selectedItem:j}),Object(Me.jsx)(th,{onSelectedItemChange:y,label:"Sort by",default:gw[0],items:gw,selectedItem:v})]}),Object(Me.jsx)("div",{className:d.tableWrapper,children:Object(Me.jsx)(Rh,{error:null===c||void 0===c?void 0:c.message,name:"comissionsList",enableEdit:!0,save:s,initialValues:$g,validationSchema:Ug(r),data:S,elements:Xg(o,i)})})]})})),yw=Object(f.a)({listViewButton:{marginLeft:4}}),ww=x()(cw||(cw=Object(c.a)(["\n query getData {\n config\n cryptoCurrencies {\n code\n display\n }\n machines {\n name\n deviceId\n }\n }\n"]))),Cw=x()(sw||(sw=Object(c.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),kw=function(e){var t,n=e.name,r=yw(),i=Object(a.useState)(!1),o=Object(l.a)(i,2),c=o[0],s=o[1],d=Object(a.useState)(null),m=Object(l.a)(d,2),h=m[0],p=m[1],b=Object(u.c)(ww),f=b.data,j=b.loading,g=Object(u.b)(Cw,{refetchQueries:function(){return["getData"]},onError:function(e){return p(e)}}),O=Object(l.a)(g,1)[0],x=(null===f||void 0===f?void 0:f.config)&&rs(n)(f.config),v=(null===f||void 0===f?void 0:f.config)&&rs(Zc)(f.config),y=B.a("fiatCurrency")(v),w=B.a("overrides")(x),C=c?[{label:"Override value",icon:Object(Me.jsx)(dw,{})}]:[];return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(nl,{title:"Commissions",labels:C,buttons:[{text:"List view",icon:aw,inverseIcon:Qy,toggle:s}],iconClassName:r.listViewButton}),!c&&!j&&Object(Me.jsx)(hw,{config:x,locale:v,currency:y,data:f,error:h,save:function(e){var t=is(n)(e.commissions[0]);return O({variables:{config:t}})},saveOverrides:function(e){var t=is(n)(e);return p(null),O({variables:{config:t}})},classes:r}),c&&!j&&Object(Me.jsx)(vw,{config:x,localeConfig:v,currency:y,data:f,error:h,saveOverrides:(t=w,function(e,n){var a,r=A.a(["cryptoCurrencies",0],n),i=qa.a("machine",n),o=M.a(zh.a(i,(function(e){return!qa.a("cryptoCurrencies",n,e)}))),l=(a=r,function(e){return Vy.a(e,{cryptoCurrencies:Uy.a([a],e.cryptoCurrencies)})}),c=R.a(l)(o(t)).concat(M.a((function(e){return!i(e)}),t)),s={commissions_overrides:im.a(n,c)};return O({variables:{config:s}})})})]})},Ew=n(911);function Nw(){return(Nw=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Sw(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Iw=a.createElement("desc",null,"Created with Sketch."),Fw=a.createElement("g",{id:"icon/button/authorize/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("circle",{id:"Oval",stroke:"#FFFFFF",cx:6,cy:6,r:5}),a.createElement("polyline",{id:"Stroke-13",stroke:"#FFFFFF",strokeLinecap:"round",strokeLinejoin:"round",points:"4 6.66666667 5 8 8 4"}));function Lw(e,t){var n=e.title,r=e.titleId,i=Sw(e,["title","titleId"]);return a.createElement("svg",Nw({viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,Iw,Fw)}var Pw=a.forwardRef(Lw);n.p;function Dw(){return(Dw=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Rw(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Bw=a.createElement("desc",null,"Created with Sketch."),Tw=a.createElement("g",{id:"icon/button/authorize/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"Group-9",stroke:"#1B2559"},a.createElement("circle",{id:"Oval",cx:6,cy:6,r:5})),a.createElement("polyline",{id:"Stroke-13",stroke:"#1B2559",strokeLinecap:"round",strokeLinejoin:"round",points:"4 6.66666667 5 8 8 4"}));function Aw(e,t){var n=e.title,r=e.titleId,i=Rw(e,["title","titleId"]);return a.createElement("svg",Dw({viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,Bw,Tw)}var Mw=a.forwardRef(Aw),Ww=(n.p,{label1:{display:"flex",marginBottom:2,marginTop:"auto",width:85},label1Pending:{color:$},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:K,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"}}),zw=(Object(f.a)(Ww),"automatic"),qw="verified",$w="blocked";function Hw(){return(Hw=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Vw(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Uw=a.createElement("desc",null,"Created with Sketch."),Gw=a.createElement("g",{id:"icon/button/block/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"Group-5",stroke:"#FFFFFF"},a.createElement("circle",{id:"Oval",cx:6,cy:6,r:5}),a.createElement("line",{x1:9,y1:3,x2:3,y2:9,id:"Stroke-3"})));function Xw(e,t){var n=e.title,r=e.titleId,i=Vw(e,["title","titleId"]);return a.createElement("svg",Hw({viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,Uw,Gw)}var _w=a.forwardRef(Xw);n.p;function Zw(){return(Zw=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Kw(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Qw=a.createElement("desc",null,"Created with Sketch."),Yw=a.createElement("g",{id:"icon/button/block/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"Group-5",stroke:"#1B2559"},a.createElement("circle",{id:"Oval",cx:6,cy:6,r:5}),a.createElement("line",{x1:9,y1:3,x2:3,y2:9,id:"Stroke-3"})));function Jw(e,t){var n=e.title,r=e.titleId,i=Kw(e,["title","titleId"]);return a.createElement("svg",Zw({viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,Qw,Yw)}var eC=a.forwardRef(Jw);n.p;function tC(){return(tC=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function nC(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var aC=a.createElement("g",{id:"icon/button/data/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"Data-icon---small",transform:"translate(0.500000, 0.500000)",stroke:"#FFFFFF"},a.createElement("path",{d:"M11,2.44444444 L11,5.5 C11,6.85002939 8.53756612,7.94444444 5.5,7.94444444 C2.521994,7.94444444 0.0939612041,6.81341452 1.11160464e-12,5.5 L0.00282594991,2.44444444",id:"oval-3"}),a.createElement("path",{d:"M11,5.5 L11,8.55555556 C11,9.90558494 8.53756612,11 5.5,11 C2.521994,11 0.0939612041,9.86897007 1.11160464e-12,8.55555556 L0.00282594991,5.5",id:"oval-2"}),a.createElement("ellipse",{id:"oval-1",cx:5.5,cy:2.44444444,rx:5.5,ry:2.44444444})),a.createElement("g",{id:"Group-9",transform:"translate(0.000000, 4.000000)"},a.createElement("circle",{id:"Oval",stroke:"#FFFFFF",fill:"#5F668A",cx:4,cy:4,r:3.5}),a.createElement("polygon",{id:"Path",fill:"#FFFFFF",fillRule:"nonzero",points:"4.33333333 3.66666667 6 3.66666667 6 4.33333333 4.33333333 4.33333333 4.33333333 6 3.66666667 6 3.66666667 4.33333333 2 4.33333333 2 3.66666667 3.66666667 3.66666667 3.66666667 2 4.33333333 2"})));function rC(e,t){var n=e.title,r=e.titleId,i=nC(e,["title","titleId"]);return a.createElement("svg",tC({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":r},i),n?a.createElement("title",{id:r},n):null,aC)}var iC=a.forwardRef(rC);n.p;function oC(){return(oC=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function lC(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var cC=a.createElement("g",{id:"icon/button/data/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"Data-icon---small",transform:"translate(1.500000, 0.500000)",stroke:"#1B2559"},a.createElement("path",{d:"M10,2 L10,4.77777778 C10,6.00507722 7.76142375,7 5,7 C2.29272181,7 0.0854192765,5.97179097 0,4.77777778 L0.00256904537,2",id:"oval-3"}),a.createElement("path",{d:"M10,5 L10,7.77777778 C10,9.00507722 7.76142375,10 5,10 C2.29272181,10 0.0854192765,8.97179097 0,7.77777778 L0.00256904537,5",id:"oval-2"}),a.createElement("ellipse",{id:"oval-1",cx:5,cy:2,rx:5,ry:2})),a.createElement("g",{id:"Group-9",transform:"translate(0.000000, 4.000000)"},a.createElement("circle",{id:"Oval",stroke:"#1B2559",fill:"#EBEFFF",cx:4,cy:4,r:3.5}),a.createElement("polygon",{id:"Path",fill:"#1B2559",fillRule:"nonzero",points:"4.33333333 3.66666667 6 3.66666667 6 4.33333333 4.33333333 4.33333333 4.33333333 6 3.66666667 6 3.66666667 4.33333333 2 4.33333333 2 3.66666667 3.66666667 3.66666667 3.66666667 2 4.33333333 2"})));function sC(e,t){var n=e.title,r=e.titleId,i=lC(e,["title","titleId"]);return a.createElement("svg",oC({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":r},i),n?a.createElement("title",{id:r},n):null,cC)}var dC=a.forwardRef(sC);n.p;function uC(){return(uC=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function mC(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var hC=a.createElement("g",{id:"icon/button/loyalty/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("polygon",{id:"Stroke-2",stroke:"#FFFFFF",strokeLinejoin:"round",points:"8.27822222 0.5 3.72177778 0.5 0.5 3.72177778 0.5 8.27822222 3.72177778 11.5 8.27822222 11.5 11.5 8.27822222 11.5 3.72177778"}),a.createElement("path",{d:"M7.55533889,6.66641667 C8.04667222,6.66641667 8.44450556,7.06486111 8.44450556,7.55558333 C8.44450556,8.04630556 8.04667222,8.44475 7.55533889,8.44475 C7.06461667,8.44475 6.66678333,8.04630556 6.66678333,7.55558333 C6.66678333,7.06486111 7.06461667,6.66641667 7.55533889,6.66641667 Z M8.44481111,3.55555556 L4.44447778,8.44444444 L3.55592222,8.44444444 L7.55564444,3.55555556 L8.44481111,3.55555556 Z M4.44423333,3.55525 C4.93556667,3.55525 5.3334,3.95369444 5.3334,4.44441667 C5.3334,4.93513889 4.93556667,5.33358333 4.44423333,5.33358333 C3.95351111,5.33358333 3.55567778,4.93513889 3.55567778,4.44441667 C3.55567778,3.95369444 3.95351111,3.55525 4.44423333,3.55525 Z",id:"Combined-Shape",fill:"#FFFFFF"}));function pC(e,t){var n=e.title,r=e.titleId,i=mC(e,["title","titleId"]);return a.createElement("svg",uC({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":r},i),n?a.createElement("title",{id:r},n):null,hC)}var bC=a.forwardRef(pC);n.p;function fC(){return(fC=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function jC(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var gC=a.createElement("g",{id:"icon/button/loyalty/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("polygon",{id:"Stroke-2",stroke:"#1B2559",strokeLinejoin:"round",points:"8.27822222 0.5 3.72177778 0.5 0.5 3.72177778 0.5 8.27822222 3.72177778 11.5 8.27822222 11.5 11.5 8.27822222 11.5 3.72177778"}),a.createElement("path",{d:"M7.55533889,6.66641667 C8.04667222,6.66641667 8.44450556,7.06486111 8.44450556,7.55558333 C8.44450556,8.04630556 8.04667222,8.44475 7.55533889,8.44475 C7.06461667,8.44475 6.66678333,8.04630556 6.66678333,7.55558333 C6.66678333,7.06486111 7.06461667,6.66641667 7.55533889,6.66641667 Z M8.44481111,3.55555556 L4.44447778,8.44444444 L3.55592222,8.44444444 L7.55564444,3.55555556 L8.44481111,3.55555556 Z M4.44423333,3.55525 C4.93556667,3.55525 5.3334,3.95369444 5.3334,4.44441667 C5.3334,4.93513889 4.93556667,5.33358333 4.44423333,5.33358333 C3.95351111,5.33358333 3.55567778,4.93513889 3.55567778,4.44441667 C3.55567778,3.95369444 3.95351111,3.55525 4.44423333,3.55525 Z",id:"Combined-Shape",fill:"#1B2559"}));function OC(e,t){var n=e.title,r=e.titleId,i=jC(e,["title","titleId"]);return a.createElement("svg",fC({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":r},i),n?a.createElement("title",{id:r},n):null,gC)}var xC=a.forwardRef(OC),vC=(n.p,n(907)),yC=n(924);function wC(){return(wC=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function CC(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var kC=a.createElement("desc",null,"Created with Sketch."),EC=a.createElement("g",{id:"icon/sf-small/search/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.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}),a.createElement("line",{x1:13.7035238,y1:13.7046667,x2:19.4844762,y2:19.485619,id:"Stroke-3",stroke:"#FFFFFF",strokeWidth:2,strokeLinecap:"round"}));function NC(e,t){var n=e.title,r=e.titleId,i=CC(e,["title","titleId"]);return a.createElement("svg",wC({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":r},i),n?a.createElement("title",{id:r},n):null,kC,EC)}var SC=a.forwardRef(NC);n.p;function IC(){return(IC=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function FC(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var LC=a.createElement("g",{id:"icon/search/dark02",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"Group",transform:"translate(1.000000, 1.000000)",stroke:"#1B2559",strokeWidth:2},a.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"}),a.createElement("line",{x1:12.3331714,y1:12.3342,x2:17.5360286,y2:17.5370571,id:"Stroke-3",strokeLinecap:"round"})));function PC(e,t){var n=e.title,r=e.titleId,i=FC(e,["title","titleId"]);return a.createElement("svg",IC({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":r},i),void 0===n?a.createElement("title",{id:r},"icon/search/dark02"):n?a.createElement("title",{id:r},n):null,LC)}var DC=a.forwardRef(PC),RC=(n.p,Object(f.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]]}})),BC=Object(a.memo)((function(e){var t=e.className,n=e.width,r=e.height,i=e.popupWidth,o=e.popupHeight,c=e.src,s=RC({width:n,height:r,popupWidth:i,popupHeight:o}),d=Object(a.useState)(null),u=Object(l.a)(d,2),m=u[0],h=u[1],p=Boolean(m),b=function(e){var t=e.className;return Object(Me.jsx)("img",{className:I()(t),src:c,alt:""})};return Object(Me.jsx)(E.a,{onClickAway:function(){h(null)},children:Object(Me.jsxs)("div",{className:I()(s.row,t),children:[Object(Me.jsx)(b,{className:s.image}),Object(Me.jsx)(Vn,{Icon:DC,InverseIcon:SC,className:s.button,onClick:function(e){h(m?null:e.currentTarget)}}),Object(Me.jsx)(Xn,{open:p,anchorEl:m,placement:"top",children:Object(Me.jsx)("div",{className:s.popoverContent,children:Object(Me.jsx)(b,{className:s.popupImage})})})]})})}));function TC(){return(TC=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function AC(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var MC=a.createElement("g",{id:"icon/ID/card/new/comet",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("polygon",{id:"Stroke-1",stroke:"#5F668A",strokeWidth:1.6,points:"1 17 23 17 23 1 1 1"}),a.createElement("line",{x1:12.7857143,y1:5,x2:19.8571429,y2:5,id:"Stroke-3",stroke:"#5F668A",strokeWidth:1.6}),a.createElement("line",{x1:12.7857143,y1:8.2,x2:19.8571429,y2:8.2,id:"Stroke-4",stroke:"#5F668A",strokeWidth:1.6}),a.createElement("polygon",{id:"Stroke-5",stroke:"#5F668A",strokeWidth:1.6,points:"4.14285714 12.2 9.64285714 12.2 9.64285714 5 4.14285714 5"}));function WC(e,t){var n=e.title,r=e.titleId,i=AC(e,["title","titleId"]);return a.createElement("svg",TC({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":r},i),void 0===n?a.createElement("title",{id:r},"icon/ID/card/new/comet"):n?a.createElement("title",{id:r},n):null,MC)}var zC=a.forwardRef(WC);n.p;function qC(){return(qC=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function $C(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var HC=a.createElement("g",{id:"icon/ID/phone/new/comet",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("path",{d:"M7.47150618,13.52898 C10.939556,16.9970298 14.7804112,17.1146315 16.4756355,16.9586292 C17.0220434,16.9090285 17.5308507,16.6578249 17.9188563,16.2698193 L20.0004862,14.1881894 L18.0220577,12.210561 L16.0436293,11.5505516 L14.7244104,12.8697705 C14.7244104,12.8697705 13.4059914,14.1881894 10.1091441,10.8905421 C6.81229671,7.59449473 8.13071565,6.27527578 8.13071565,6.27527578 L9.4499346,4.95605683 L8.78992512,2.97842842 L6.81229671,1 L4.73066681,3.0816299 C4.34186123,3.46963548 4.09145763,3.97844279 4.04105691,4.52485063 C3.88585468,6.22007499 4.00345637,10.0601301 7.47150618,13.52898 Z",id:"Stroke-1-Copy",stroke:"#5F668A",strokeWidth:1.6}));function VC(e,t){var n=e.title,r=e.titleId,i=$C(e,["title","titleId"]);return a.createElement("svg",qC({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":r},i),void 0===n?a.createElement("title",{id:r},"icon/ID/phone/new/comet"):n?a.createElement("title",{id:r},n):null,HC)}var UC=a.forwardRef(VC);n.p;function GC(){return(GC=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function XC(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var _C=a.createElement("desc",null,"Created with Sketch."),ZC=a.createElement("g",{id:"icon/crossed-camera",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"crossed-camera"},a.createElement("g",{id:"Group-2"},a.createElement("g",{id:"icon/ID/cam/zodiac",transform:"translate(0.000000, 3.657143)",fill:"#1B2559",fillRule:"nonzero"},a.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"})),a.createElement("line",{x1:32,y1:0,x2:0,y2:32,id:"Line",stroke:"#FF584A",strokeWidth:2,strokeLinecap:"square"}))));function KC(e,t){var n=e.title,r=e.titleId,i=XC(e,["title","titleId"]);return a.createElement("svg",GC({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":r},i),n?a.createElement("title",{id:r},n):null,_C,ZC)}var QC=a.forwardRef(KC);n.p;function YC(){return(YC=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function JC(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var ek=a.createElement("desc",null,"Created with Sketch."),tk=a.createElement("g",{id:"icon/action/edit/disabled",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("path",{d:"M1,18 L1,18 C1,19.657 2.343,21 4,21 L18,21 C19.657,21 21,19.657 21,18",id:"Stroke-1",stroke:"#5f668a",strokeWidth:2}),a.createElement("polygon",{id:"Stroke-3",stroke:"#5f668a",strokeWidth:2,points:"6 12 17 1 21 5 10 16 6 16"}));function nk(e,t){var n=e.title,r=e.titleId,i=JC(e,["title","titleId"]);return a.createElement("svg",YC({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":r},i),n?a.createElement("title",{id:r},n):null,ek,tk)}var ak=a.forwardRef(nk);n.p;function rk(){return(rk=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function ik(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var ok=a.createElement("g",{id:"icon/sf-small/listing/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("line",{x1:1,y1:1,x2:19.0952381,y2:1,id:"Path-4",stroke:"#FFFFFF",strokeWidth:2}),a.createElement("line",{x1:1,y1:7,x2:19.0952381,y2:7,id:"Path-4-Copy",stroke:"#FFFFFF",strokeWidth:2}),a.createElement("line",{x1:1,y1:13,x2:19.0952381,y2:13,id:"Path-4-Copy-2",stroke:"#FFFFFF",strokeWidth:2}),a.createElement("line",{x1:1,y1:19,x2:19.0952381,y2:19,id:"Path-4-Copy-3",stroke:"#FFFFFF",strokeWidth:2}));function lk(e,t){var n=e.title,r=e.titleId,i=ik(e,["title","titleId"]);return a.createElement("svg",rk({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":r},i),n?a.createElement("title",{id:r},n):null,ok)}var ck=a.forwardRef(lk);n.p;function sk(){return(sk=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function dk(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var uk=a.createElement("g",{id:"icon/sf-small/listing/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("line",{x1:1,y1:1,x2:19.0952381,y2:1,id:"Path-4",stroke:"#1B2559",strokeWidth:2}),a.createElement("line",{x1:1,y1:7,x2:19.0952381,y2:7,id:"Path-4-Copy",stroke:"#1B2559",strokeWidth:2}),a.createElement("line",{x1:1,y1:13,x2:19.0952381,y2:13,id:"Path-4-Copy-2",stroke:"#1B2559",strokeWidth:2}),a.createElement("line",{x1:1,y1:19,x2:19.0952381,y2:19,id:"Path-4-Copy-3",stroke:"#1B2559",strokeWidth:2}));function mk(e,t){var n=e.title,r=e.titleId,i=dk(e,["title","titleId"]);return a.createElement("svg",sk({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":r},i),n?a.createElement("title",{id:r},n):null,uk)}var hk=a.forwardRef(mk);n.p;function pk(){return(pk=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function bk(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var fk=a.createElement("g",{id:"icon/sf-small/overview/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("rect",{id:"Rectangle",stroke:"#FFFFFF",strokeWidth:2,x:1,y:1,width:7,height:7,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-2",stroke:"#FFFFFF",strokeWidth:2,x:1,y:12,width:7,height:7,rx:2}),a.createElement("rect",{id:"Rectangle-Copy",stroke:"#FFFFFF",strokeWidth:2,x:12,y:1,width:7,height:7,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-3",stroke:"#FFFFFF",strokeWidth:2,x:12,y:12,width:7,height:7,rx:2}));function jk(e,t){var n=e.title,r=e.titleId,i=bk(e,["title","titleId"]);return a.createElement("svg",pk({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":r},i),n?a.createElement("title",{id:r},n):null,fk)}var gk=a.forwardRef(jk);n.p;function Ok(){return(Ok=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function xk(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var vk=a.createElement("g",{id:"icon/sf-small/overview/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("rect",{id:"Rectangle",stroke:"#1B2559",strokeWidth:2,x:1,y:1,width:7,height:7,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-2",stroke:"#1B2559",strokeWidth:2,x:1,y:12,width:7,height:7,rx:2}),a.createElement("rect",{id:"Rectangle-Copy",stroke:"#1B2559",strokeWidth:2,x:12,y:1,width:7,height:7,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-3",stroke:"#1B2559",strokeWidth:2,x:12,y:12,width:7,height:7,rx:2}));function yk(e,t){var n=e.title,r=e.titleId,i=xk(e,["title","titleId"]);return a.createElement("svg",Ok({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":r},i),n?a.createElement("title",{id:r},n):null,vk)}var wk=a.forwardRef(yk),Ck=(n.p,{header:{display:"flex",flexDirection:"row",marginBottom:15},title:{marginTop:7,marginRight:24},editIcon:{marginTop:5},cardIcon:{marginTop:7},viewIcons:{marginRight:12},wrapper:{display:"block",overflow:"hidden",whiteSpace:"nowrap"},separator:{color:se,margin:[[8,0,8,150]],position:"relative",display:"inline-block","&:before, &:after":{content:'""',position:"absolute",background:se,top:"50%",width:1e3,height:1},"&:before":{right:"100%",marginRight:15},"&:after":{left:"100%",marginLeft:15}}}),kk=n(921),Ek=Object(f.a)({radio:{padding:4,margin:4},radioGroup:{flexDirection:"row"},error:{color:me},specialLabel:{height:40,padding:0,width:250},label:{height:40,padding:0},specialGrid:{display:"grid",gridTemplateColumns:[[182,162,141]]}}),Nk=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"}},Sk=function(e,t){var n=e&&t?Object(kk.a)(e,t):null;return n?n.formatInternational():e},Ik=function(e){var t,n,a=A.a(["idCardData"])(e);return"".concat(null!==(t=A.a(["firstName"])(a))&&void 0!==t?t:""," ").concat(null!==(n=A.a(["lastName"])(a))&&void 0!==n?n:"").trim()},Fk=[{display:"Custom entry",code:"custom"},{display:"Populate existing requirement",code:"requirement"}],Lk=[{display:"Text",code:"text"},{display:"File",code:"file"},{display:"Image",code:"image"}],Pk=[{display:"Birthdate",code:"birthdate"},{display:"ID card image",code:"idCardPhoto"},{display:"ID data",code:"idCardData"},{display:"Customer camera",code:"facephoto"},{display:"US SSN",code:"usSsn"}],Dk=[{display:"Data entry title",code:"title"}],Rk=xn.f().shape({entryType:xn.h().required()}),Bk=xn.f().shape({title:xn.h().required(),file:xn.d().required()}),Tk=xn.f().shape({title:xn.h().required(),image:xn.d().required()}),Ak=function(e){var t=e.selectedValues,n=null===t||void 0===t?void 0:t.dataType,a="file"===n||"image"===n;return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Ko.a,{display:"flex",alignItems:"center",children:Object(Me.jsx)(Ue,{children:"Custom ".concat(n," entry")})}),Mk[n].options.map((function(e){var t=e.display,n=e.code;return Object(Me.jsx)(bn.b,{name:n,label:t,component:ai,width:390})})),a&&Object(Me.jsx)(eS,{type:n})]})},Mk={text:{schema:xn.f().shape({title:xn.h().required(),data:xn.h().required()}),options:[{display:"Data entry title",code:"title"},{display:"Data entry",code:"data"}],Component:Ak,initialValues:{data:"",title:""}},file:{schema:Bk,options:Dk,Component:Ak,initialValues:{file:"",title:""}},image:{schema:Tk,options:Dk,Component:Ak,initialValues:{image:"",title:""}}},Wk={schema:Rk,options:Fk,Component:function(){var e=Ek(),t=Object(bn.f)().values,n="custom"===t.entryType,a="requirement"===t.entryType;return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Ko.a,{display:"flex",alignItems:"center",children:Object(Me.jsx)(Ue,{children:"Type of entry"})}),Object(Me.jsx)(bn.b,{component:ti,name:"entryType",options:Fk,labelClassName:e.specialLabel,radioClassName:e.radio,className:I()(e.radioGroup,e.specialGrid)}),n&&Object(Me.jsxs)("div",{children:[Object(Me.jsx)(Ko.a,{display:"flex",alignItems:"center",children:Object(Me.jsx)(Ue,{children:"Type of data"})}),Object(Me.jsx)(bn.b,{component:ti,name:"dataType",options:Lk,labelClassName:e.label,radioClassName:e.radio,className:I()(e.radioGroup,e.specialGrid)})]}),a&&Object(Me.jsxs)("div",{children:[Object(Me.jsx)(Ko.a,{display:"flex",alignItems:"center",children:Object(Me.jsx)(Ue,{children:"Requirements"})}),Object(Me.jsx)(bn.b,{component:ti,name:"requirement",options:Pk,labelClassName:e.label,radioClassName:e.radio,className:I()(e.radioGroup,e.specialGrid)})]})]})},initialValues:{entryType:""}},zk=R.a((function(e){return il.a("id")(e)?Object(s.a)(Object(s.a)({},e),{},{photoDir:"operator-data/customersphotos"}):Object(s.a)(Object(s.a)({},e),{},{photoDir:"front-camera-photo"})})),qk=R.a(L.a(qc.a,R.a((function(e){var t=Object(l.a)(e,2),n=t[0],a=t[1];return"txCustomerPhotoPath"===n||"frontCameraPath"===n?["path",a]:"txCustomerPhotoAt"===n||"frontCameraAt"===n?["date",a]:e})),Hc.a)),$k=M.a((function(e){return!D.a(e.date)&&!D.a(e.path)})),Hk=L.a($k,zk,qk),Vk={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:$},blankSpace:{padding:[[0,30]],margin:[[0,4,0,2]],borderBottom:"1px solid ".concat($),display:"inline-block"}},Uk=Object(f.a)(Vk),Gk=function(e){var t=e.onClose,n=e.save,r=e.error,i=Uk(),o=Object(a.useState)(null),c=Object(l.a)(o,2),d=c[0],u=c[1],m=Object(a.useState)({step:1}),h=Object(l.a)(m,2),p=h[0],b=p.step,f=p.config,j=h[1],g=2===b,O=function(e,t){switch(e){case 1:return Wk;case 2:return Mk[null===t||void 0===t?void 0:t.dataType];default:return a.Fragment}}(b,d),x=function(){var e=Object(Pl.a)(Ll.a.mark((function e(t){var a;return Ll.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=Gn.a(f,O.schema.cast(t)),u(a),!g){e.next=4;break}return e.abrupt("return",n(a));case 4:j({step:b+1,config:a});case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return Object(Me.jsx)(Me.Fragment,{children:Object(Me.jsxs)(Mh,{title:"Manual data entry",handleClose:t,width:520,height:520,open:!0,children:[Object(Me.jsx)(rp,{className:i.stepper,steps:2,currentStep:b}),Object(Me.jsx)(bn.e,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,onSubmit:x,initialValues:O.initialValues,validationSchema:O.schema,children:Object(Me.jsxs)(bn.d,{className:i.form,children:[Object(Me.jsx)(O.Component,Object(s.a)({selectedValues:d},O.props)),Object(Me.jsxs)("div",{className:i.submit,children:[r&&Object(Me.jsx)(Jo,{children:"Failed to save"}),Object(Me.jsx)(An,{className:i.button,type:"submit",children:g?"Add Data":"Next"})]})]})})]})})},Xk={titleWrapper:uf.titleWrapper,titleAndButtonsContainer:uf.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:Be.label1,marginLeft:6}},photo:{width:92,height:92,borderRadius:8,backgroundColor:G,margin:[[0,28,0,0]],alignItems:"center",justifyContent:"center",display:"flex"},img:{width:80},customerName:{marginBottom:32},icon:{marginRight:11},name:{display:"flex",flexDirection:"row",alignItems:"center"},value:{height:16},label:{marginBottom:4,color:$},txSummaryValue:{height:16,marginRight:25},txSummaryLabel:{marginBottom:4,color:$,marginRight:25},idIcon:{marginRight:10},subpageButton:{marginLeft:16},txTableSpacing:{marginTop:40}},_k=n(281),Zk=Object(f.a)({closeButton:{display:"flex",padding:[[16,16,0,16]],paddingRight:12,justifyContent:"end"},title:{margin:[[0,16,8,20]]}}),Kk=Object(a.memo)((function(e){var t=e.title,n=void 0===t?"":t,a=e.open,r=e.onDissmised,i=(e.disabled,e.data),o=Object(q.a)(e,["title","open","onDissmised","disabled","data"]),l=Zk();return Object(Me.jsxs)(un.a,Object(s.a)(Object(s.a)({PaperProps:{style:{borderRadius:8}},fullWidth:!0,open:a,"aria-labelledby":"form-dialog-title"},o),{},{children:[Object(Me.jsx)("div",{className:l.closeButton,children:Object(Me.jsx)(ta,{size:16,"aria-label":"close",onClick:function(){r()},children:Object(Me.jsx)(Bi,{})})}),Object(Me.jsx)($e,{className:l.title,children:n}),Object(Me.jsx)(mn.a,{className:l.dialogContent,children:i})]}))})),Qk={photo:{width:135,height:135,borderRadius:8,backgroundColor:G,margin:[[0,28,0,0]],alignItems:"center",justifyContent:"center",display:"flex"},img:{objectFit:"cover",objectPosition:"center",width:135,height:135},container:{position:"relative","& > img":{display:"block"},"& > circle":{position:"absolute",top:"0",right:"0",marginRight:5,marginTop:5}},circle:{background:ae,borderRadius:"50%",width:25,height:25,alignItems:"center",justifyContent:"center",display:"flex"}},Yk=n(451),Jk=n.n(Yk);function eE(){return(eE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function tE(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var nE=a.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("polygon",{id:"Simple-Arrow-White",fill:"#FFFFFF",fillRule:"nonzero",points:"12.1912718 1.56064837 10.8306233 0.395663059 0.196798664 16.2200463 10.8250965 32.3956631 12.1967987 31.2473125 2.33241023 16.233075"}));function aE(e,t){var n=e.title,r=e.titleId,i=tE(e,["title","titleId"]);return a.createElement("svg",eE({width:"13px",height:"33px",viewBox:"0 0 13 33",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,nE)}var rE=a.forwardRef(aE);n.p;function iE(){return(iE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function oE(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var lE=a.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"Group-2-Copy",transform:"translate(1.000000, 1.000000)",stroke:"#FFFFFF",strokeWidth:2},a.createElement("polyline",{id:"Path-4-Copy",points:"0 0 12 15.8202247 0 32"})));function cE(e,t){var n=e.title,r=e.titleId,i=oE(e,["title","titleId"]);return a.createElement("svg",iE({width:"15px",height:"34px",viewBox:"0 0 15 34",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,lE)}var sE=a.forwardRef(cE),dE=(n.p,Object(f.a)({imgWrapper:{alignItems:"center",justifyContent:"center",display:"flex",width:550},imgInner:{objectFit:"cover",objectPosition:"center",width:550,marginBottom:40}})),uE=Object(a.memo)((function(e){var t=e.photosData,n=e.slidePhoto,a=dE();return Object(Me.jsx)(Me.Fragment,{children:Object(Me.jsx)(Jk.a,{PrevIcon:Object(Me.jsx)(rE,{}),NextIcon:Object(Me.jsx)(sE,{}),navButtonsProps:{style:{backgroundColor:"transparent",borderRadius:0,width:50,color:"transparent",opacity:1}},autoPlay:!1,indicators:!1,navButtonsAlwaysVisible:!0,next:function(e){return n(e)},prev:function(e){return n(e)},children:t.map((function(e,t){return Object(Me.jsx)("div",{children:Object(Me.jsx)("div",{className:a.imgWrapper,children:Object(Me.jsx)("img",{className:a.imgInner,src:"".concat(Ij,"/").concat(null===e||void 0===e?void 0:e.photoDir,"/").concat(null===e||void 0===e?void 0:e.path),alt:""})})})}))})})})),mE={label:{color:se,margin:[[0,0,6,0]]},firstRow:{padding:[[8]],display:"flex",flexDirection:"column"},secondRow:{extend:Be.p,display:"flex",padding:[[8]],"& > div":{display:"flex",flexDirection:"column","& > div":{width:144,height:37,marginBottom:15,marginRight:55}}}},hE=Object(f.a)(mE),pE=Object(a.memo)((function(e){var t,n,r=e.photosData,i=hE(),o=Object(a.useState)(0),c=Object(l.a)(o,2),s=c[0],d=c[1],u=function(e){var t=e.children,n=hE();return Object(Me.jsx)(et,{className:n.label,children:t})},m=!il.a("id")(r[s]);return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(uE,{photosData:r,slidePhoto:function(e){return d(e)}}),!m&&Object(Me.jsxs)("div",{className:i.firstRow,children:[Object(Me.jsx)(u,{children:"Session ID"}),Object(Me.jsx)(gf,{children:r&&(null===(t=r[s])||void 0===t?void 0:t.id)})]}),Object(Me.jsxs)("div",{className:i.secondRow,children:[Object(Me.jsx)("div",{children:Object(Me.jsxs)("div",{children:[Object(Me.jsx)(u,{children:"Date"}),Object(Me.jsx)("div",{children:r&&(null===(n=r[s])||void 0===n?void 0:n.date)})]})}),Object(Me.jsxs)("div",{children:[Object(Me.jsx)(u,{children:"Taken by"}),Object(Me.jsx)("div",{children:m?"Compliance scan":"Acceptance of T&C"})]})]})]})})),bE=Object(f.a)(Qk),fE=Object(a.memo)((function(e){var t=e.photosData,n=bE(),r=Object(a.useState)(!1),i=Object(l.a)(r,2),o=i[0],c=i[1],s=kf.a(t);return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(um.a,{className:n.photo,elevation:0,children:Object(Me.jsx)(_k.a,{disabled:!s,className:n.button,onClick:function(){c(!0)},children:s?Object(Me.jsxs)("div",{className:n.container,children:[Object(Me.jsx)("img",{className:n.img,src:"".concat(Ij,"/").concat(s.photoDir,"/").concat(s.path),alt:""}),Object(Me.jsx)("circle",{className:n.circle,children:Object(Me.jsx)("div",{children:Object(Me.jsx)(Ze,{children:t.length})})})]}):Object(Me.jsx)(QC,{})})}),Object(Me.jsx)(Kk,{open:o,title:"Photo roll",data:Object(Me.jsx)(pE,{photosData:t}),onDissmised:function(){c(!1)}})]})})),jE=Object(f.a)(Xk),gE=Object(a.memo)((function(e){var t=e.customer,n=e.photosData,a=e.locale,r=jE(),i=A.a(["idCardData","documentNumber"])(t),o=A.a(["usSsn"])(t),l=[{header:"Phone number",size:172,value:Sk(t.phone,a.country)}];i&&l.push({header:"ID number",size:172,value:i}),o&&l.push({header:"US SSN",size:127,value:o});var c=Ik(t);return Object(Me.jsxs)(Ko.a,{display:"flex",children:[Object(Me.jsx)(fE,{photosData:n}),Object(Me.jsxs)(Ko.a,{display:"flex",flexDirection:"column",children:[Object(Me.jsxs)("div",{className:r.name,children:[Object(Me.jsx)(zf,{className:r.idIcon}),Object(Me.jsx)(He,{noMargin:!0,children:c.length?c:Sk(A.a(["phone"])(t),a.country)})]}),Object(Me.jsx)(Ko.a,{display:"flex",mt:"auto",children:l.map((function(e,t){var n=e.size,a=e.header;return Object(Me.jsx)(et,{noMargin:!0,className:r.label,style:{width:n},children:a},t)}))}),Object(Me.jsx)(Ko.a,{display:"flex",children:l.map((function(e,t){var n=e.size,a=e.value;return Object(Me.jsx)(Xe,{noMargin:!0,className:r.value,style:{width:n},children:a},t)}))})]})]})}));function OE(){return(OE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function xE(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var vE=a.createElement("g",{id:"icon/customer-nav/data/comet",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("path",{d:"M19,5 L19,10 C19,12.209139 14.9705627,14 10,14 C5.12689927,14 1.1537547,12.1492238 1,10 L1.00462428,5",id:"Path-Copy-3",stroke:"#5F668A",strokeWidth:2}),a.createElement("path",{d:"M19,10 L19,15 C19,17.209139 14.9705627,19 10,19 C5.12689927,19 1.1537547,17.1492238 1,15 L1.00462428,10",id:"Path-Copy-3",stroke:"#5F668A",strokeWidth:2}),a.createElement("ellipse",{id:"Oval-Copy-3",stroke:"#5F668A",strokeWidth:2,cx:10,cy:5,rx:9,ry:4}));function yE(e,t){var n=e.title,r=e.titleId,i=xE(e,["title","titleId"]);return a.createElement("svg",OE({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":r},i),n?a.createElement("title",{id:r},n):null,vE)}var wE=a.forwardRef(yE);n.p;function CE(){return(CE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function kE(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var EE=a.createElement("g",{id:"icon/customer-nav/data/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("path",{d:"M19,5 L19,10 C19,12.209139 14.9705627,14 10,14 C5.12689927,14 1.1537547,12.1492238 1,10 L1.00462428,5",id:"Path-Copy-3",stroke:"#FFFFFF",strokeWidth:2}),a.createElement("path",{d:"M19,10 L19,15 C19,17.209139 14.9705627,19 10,19 C5.12689927,19 1.1537547,17.1492238 1,15 L1.00462428,10",id:"Path-Copy-3",stroke:"#FFFFFF",strokeWidth:2}),a.createElement("ellipse",{id:"Oval-Copy-3",stroke:"#FFFFFF",strokeWidth:2,cx:10,cy:5,rx:9,ry:4}));function NE(e,t){var n=e.title,r=e.titleId,i=kE(e,["title","titleId"]);return a.createElement("svg",CE({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":r},i),n?a.createElement("title",{id:r},n):null,EE)}var SE=a.forwardRef(NE);n.p;function IE(){return(IE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function FE(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var LE=a.createElement("g",{id:"icon/customer-nav/note/comet",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("path",{d:"M18,1 C18.2761424,1 18.5261424,1.11192881 18.7071068,1.29289322 C18.8880712,1.47385763 19,1.72385763 19,2 L19,2 L19,18 C19,18.2761424 18.8880712,18.5261424 18.7071068,18.7071068 C18.5261424,18.8880712 18.2761424,19 18,19 L18,19 L2,19 C1.72385763,19 1.47385763,18.8880712 1.29289322,18.7071068 C1.11192881,18.5261424 1,18.2761424 1,18 L1,18 L1,2 C1,1.72385763 1.11192881,1.47385763 1.29289322,1.29289322 C1.47385763,1.11192881 1.72385763,1 2,1 L2,1 Z",id:"Rectangle",stroke:"#5F668A",strokeWidth:2}),a.createElement("line",{x1:5,y1:5,x2:15,y2:5,id:"Line-4",stroke:"#5F668A",strokeWidth:2,strokeLinecap:"round"}),a.createElement("line",{x1:5,y1:13,x2:10,y2:13,id:"Line-4-Copy",stroke:"#5F668A",strokeWidth:2,strokeLinecap:"round"}),a.createElement("line",{x1:5,y1:9,x2:15,y2:9,id:"Line-4",stroke:"#5F668A",strokeWidth:2,strokeLinecap:"round"}));function PE(e,t){var n=e.title,r=e.titleId,i=FE(e,["title","titleId"]);return a.createElement("svg",IE({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":r},i),n?a.createElement("title",{id:r},n):null,LE)}var DE=a.forwardRef(PE);n.p;function RE(){return(RE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function BE(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var TE=a.createElement("g",{id:"icon/customer-nav/note/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("path",{d:"M18,1 C18.2761424,1 18.5261424,1.11192881 18.7071068,1.29289322 C18.8880712,1.47385763 19,1.72385763 19,2 L19,2 L19,18 C19,18.2761424 18.8880712,18.5261424 18.7071068,18.7071068 C18.5261424,18.8880712 18.2761424,19 18,19 L18,19 L2,19 C1.72385763,19 1.47385763,18.8880712 1.29289322,18.7071068 C1.11192881,18.5261424 1,18.2761424 1,18 L1,18 L1,2 C1,1.72385763 1.11192881,1.47385763 1.29289322,1.29289322 C1.47385763,1.11192881 1.72385763,1 2,1 L2,1 Z",id:"Rectangle",stroke:"#FFFFFF",strokeWidth:2}),a.createElement("line",{x1:5,y1:5,x2:15,y2:5,id:"Line-4",stroke:"#FFFFFF",strokeWidth:2,strokeLinecap:"round"}),a.createElement("line",{x1:5,y1:13,x2:10,y2:13,id:"Line-4-Copy",stroke:"#FFFFFF",strokeWidth:2,strokeLinecap:"round"}),a.createElement("line",{x1:5,y1:9,x2:15,y2:9,id:"Line-4",stroke:"#FFFFFF",strokeWidth:2,strokeLinecap:"round"}));function AE(e,t){var n=e.title,r=e.titleId,i=BE(e,["title","titleId"]);return a.createElement("svg",RE({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":r},i),n?a.createElement("title",{id:r},n):null,TE)}var ME=a.forwardRef(AE);n.p;function WE(){return(WE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function zE(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var qE=a.createElement("g",{id:"icon/customer-nav/overview/comet",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("rect",{id:"Rectangle",stroke:"#5F668A",strokeWidth:2,x:1,y:1,width:7,height:7,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-2",stroke:"#5F668A",strokeWidth:2,x:1,y:12,width:7,height:7,rx:2}),a.createElement("rect",{id:"Rectangle-Copy",stroke:"#5F668A",strokeWidth:2,x:12,y:1,width:7,height:7,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-3",stroke:"#5F668A",strokeWidth:2,x:12,y:12,width:7,height:7,rx:2}));function $E(e,t){var n=e.title,r=e.titleId,i=zE(e,["title","titleId"]);return a.createElement("svg",WE({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":r},i),n?a.createElement("title",{id:r},n):null,qE)}var HE=a.forwardRef($E);n.p;function VE(){return(VE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function UE(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var GE=a.createElement("g",{id:"icon/customer-nav/overview/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("rect",{id:"Rectangle",stroke:"#FFFFFF",strokeWidth:2,x:1,y:1,width:7,height:7,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-2",stroke:"#FFFFFF",strokeWidth:2,x:1,y:12,width:7,height:7,rx:2}),a.createElement("rect",{id:"Rectangle-Copy",stroke:"#FFFFFF",strokeWidth:2,x:12,y:1,width:7,height:7,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-3",stroke:"#FFFFFF",strokeWidth:2,x:12,y:12,width:7,height:7,rx:2}));function XE(e,t){var n=e.title,r=e.titleId,i=UE(e,["title","titleId"]);return a.createElement("svg",VE({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":r},i),n?a.createElement("title",{id:r},n):null,GE)}var _E=a.forwardRef(XE);n.p;function ZE(){return(ZE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function KE(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var QE=a.createElement("g",{id:"icon/customer-nav/photos/comet",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("rect",{id:"Rectangle",stroke:"#5F668A",strokeWidth:2,x:1,y:1,width:18,height:18,rx:1}),a.createElement("circle",{id:"Oval",stroke:"#5F668A",strokeWidth:2,cx:15,cy:5,r:1}),a.createElement("polyline",{id:"Path",stroke:"#5F668A",strokeWidth:2,strokeLinejoin:"round",points:"1 19 7 13 13 19"}),a.createElement("path",{d:"M13.3333333,14 L18,19 L13.3333333,19 L11,16.5 L13.3333333,14 Z",id:"Combined-Shape",stroke:"#5F668A",strokeWidth:2,strokeLinejoin:"round"}));function YE(e,t){var n=e.title,r=e.titleId,i=KE(e,["title","titleId"]);return a.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":r},i),void 0===n?a.createElement("title",{id:r},"icon/customer-nav/photos/comet"):n?a.createElement("title",{id:r},n):null,QE)}var JE=a.forwardRef(YE);n.p;function eN(){return(eN=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function tN(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var nN=a.createElement("g",{id:"icon/customer-nav/photos/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("rect",{id:"Rectangle",stroke:"#FFFFFF",strokeWidth:2,x:1,y:1,width:18,height:18,rx:1}),a.createElement("circle",{id:"Oval",stroke:"#FFFFFF",strokeWidth:2,cx:15,cy:5,r:1}),a.createElement("polyline",{id:"Path",stroke:"#FFFFFF",strokeWidth:2,strokeLinejoin:"round",points:"1 19 7 13 13 19"}),a.createElement("path",{d:"M13.3333333,14 L18,19 L13.3333333,19 L11,16.5 L13.3333333,14 Z",id:"Combined-Shape",stroke:"#FFFFFF",strokeWidth:2,strokeLinejoin:"round"}));function aN(e,t){var n=e.title,r=e.titleId,i=tN(e,["title","titleId"]);return a.createElement("svg",eN({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":r},i),void 0===n?a.createElement("title",{id:r},"icon/customer-nav/photos/white"):n?a.createElement("title",{id:r},n):null,nN)}var rN=a.forwardRef(aN),iN=(n.p,{sidebar:{display:"flex",backgroundColor:"#ebefff",width:219,flexDirection:"column",borderRadius:5,marginBottom:50},link:{alignItems:"center",display:"flex",extend:Be.p,position:"relative",color:de,padding:15,cursor:"pointer"},activeLink:{display:"flex",alignItems:"center",extend:Be.tl2,color:K,backgroundColor:de,"&:first-child":{borderRadius:[[5,5,0,0]]},"&:last-child":{borderRadius:[[0,0,5,5]]}},icon:{marginRight:15}}),oN=Object(f.a)(iN),lN=function(e){var t=e.isSelected,n=e.onClick,a=oN(),r=[{code:"overview",display:"Overview",Icon:_E,InverseIcon:HE},{code:"customerData",display:"Customer Data",Icon:SE,InverseIcon:wE},{code:"notes",display:"Notes",Icon:ME,InverseIcon:DE},{code:"photos",display:"Photos & files",Icon:rN,InverseIcon:JE}];return Object(Me.jsx)("div",{className:a.sidebar,children:null===r||void 0===r?void 0:r.map((function(e){var r,i=e.Icon,o=e.InverseIcon,l=e.display,c=e.code;return Object(Me.jsxs)("div",{className:I()((r={},Object(z.a)(r,a.activeLink,t(c)),Object(z.a)(r,a.link,!0),r)),onClick:function(){return n(c)},children:[Object(Me.jsx)("div",{className:a.icon,children:t(c)?Object(Me.jsx)(i,{}):Object(Me.jsx)(o,{})}),l]})}))})};function cN(){return(cN=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function sN(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var dN=a.createElement("desc",null,"Created with Sketch."),uN=a.createElement("defs",null,a.createElement("rect",{id:"path-1",x:0,y:0,width:22,height:22})),mN=a.createElement("g",{id:"icon/action/delete/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("mask",{id:"mask-2",fill:"white"},a.createElement("use",{xlinkHref:"#path-1"})),a.createElement("g",{id:"Background"}),a.createElement("line",{x1:9,y1:9,x2:9,y2:18,id:"Stroke-1",stroke:"#FFFFFF",strokeWidth:2,strokeLinecap:"round",mask:"url(#mask-2)"}),a.createElement("line",{x1:13,y1:9,x2:13,y2:18,id:"Stroke-2",stroke:"#FFFFFF",strokeWidth:2,strokeLinecap:"round",mask:"url(#mask-2)"}),a.createElement("g",{id:"Group-9",mask:"url(#mask-2)",stroke:"#FFFFFF",strokeLinecap:"round",strokeWidth:2},a.createElement("g",{transform:"translate(1.000000, 1.000000)"},a.createElement("polyline",{id:"Stroke-3",strokeLinejoin:"round",points:"2 5 4 20 16 20 18 5"}),a.createElement("line",{x1:0,y1:4,x2:20,y2:4,id:"Stroke-5"}),a.createElement("path",{d:"M13,3 C13,1.343 11.657,0 10,0 C8.343,0 7,1.343 7,3",id:"Stroke-7"}))));function hN(e,t){var n=e.title,r=e.titleId,i=sN(e,["title","titleId"]);return a.createElement("svg",cN({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":r},i),n?a.createElement("title",{id:r},n):null,dN,uN,mN)}var pN=a.forwardRef(hN);n.p;function bN(){return(bN=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function fN(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var jN=a.createElement("desc",null,"Created with Sketch."),gN=a.createElement("g",{id:"icon/action/edit/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.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}),a.createElement("polygon",{id:"Stroke-3",stroke:"#FFFFFF",strokeWidth:2,points:"6 12 17 1 21 5 10 16 6 16"}));function ON(e,t){var n=e.title,r=e.titleId,i=fN(e,["title","titleId"]);return a.createElement("svg",bN({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":r},i),n?a.createElement("title",{id:r},n):null,jN,gN)}var xN=a.forwardRef(ON);n.p;function vN(){return(vN=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function yN(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var wN=a.createElement("g",{id:"icon/button/replace/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"Group-3",transform:"translate(0.500000, 0.500000)",stroke:"#FFFFFF"},a.createElement("g",{id:"Group-2"},a.createElement("path",{d:"M3.27636475,10.2264084 C2.67216087,9.96069246 2.10487152,9.58126145 1.60869691,9.087544 C-0.521488181,6.9675304 -0.538316861,3.54693703 1.57123953,1.44692357 C1.86137314,1.15837428 2.17625375,0.909794042 2.50930653,0.701182852",id:"Stroke-1"}),a.createElement("polyline",{id:"Stroke-3",points:"3.0943493 1.69429658 3.08837783 0.545717786 1.99994228 0"})),a.createElement("g",{id:"Group-2",transform:"translate(8.999987, 5.500035) scale(-1, -1) translate(-8.999987, -5.500035) translate(6.999974, 0.000000)"},a.createElement("path",{d:"M3.27636475,10.2264084 C2.67216087,9.96069246 2.10487152,9.58126145 1.60869691,9.087544 C-0.521488181,6.9675304 -0.538316861,3.54693703 1.57123953,1.44692357 C1.86137314,1.15837428 2.17625375,0.909794042 2.50930653,0.701182852",id:"Stroke-1"}),a.createElement("polyline",{id:"Stroke-3",points:"3.0943493 1.69429658 3.08837783 0.545717786 1.99994228 3.80623901e-14"}))));function CN(e,t){var n=e.title,r=e.titleId,i=yN(e,["title","titleId"]);return a.createElement("svg",vN({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":r},i),n?a.createElement("title",{id:r},n):null,wN)}var kN=a.forwardRef(CN);n.p;function EN(){return(EN=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function NN(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var SN=a.createElement("desc",null,"Created with Sketch."),IN=a.createElement("defs",null,a.createElement("polygon",{id:"path-1",points:"0 21 21 21 21 0 0 0"})),FN=a.createElement("g",{id:"icon/sf-small/save/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"Group"},a.createElement("polygon",{id:"Stroke-1",stroke:"#FFFFFF",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",points:"20.5 20.5 0.5 20.5 0.5 0.5 16.75 0.5 20.5 4.25"}),a.createElement("mask",{id:"mask-2",fill:"white"},a.createElement("use",{xlinkHref:"#path-1"})),a.createElement("g",{id:"Clip-4"}),a.createElement("polygon",{id:"Stroke-5",stroke:"#FFFFFF",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",mask:"url(#mask-2)",points:"4.25 7.5 16.75 7.5 16.75 0.5 4.25 0.5"}),a.createElement("circle",{id:"Oval",stroke:"#FFFFFF",strokeWidth:2,mask:"url(#mask-2)",cx:11,cy:14,r:3})));function LN(e,t){var n=e.title,r=e.titleId,i=NN(e,["title","titleId"]);return a.createElement("svg",EN({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":r},i),n?a.createElement("title",{id:r},n):null,SN,IN,FN)}var PN=a.forwardRef(LN),DN=(n.p,{label1:{display:"flex",width:85,justifyContent:"right"},label1Pending:{color:$},label1Rejected:{color:Q},label1Accepted:{color:U},editButton:{marginTop:20,display:"flex",justifyContent:"right"},deleteButton:{marginRight:8},headerWrapper:{display:"flex",flexDirection:"row",justifyContent:"space-between",height:40},editingWrapper:{display:"flex",flexDirection:"row",justifyContent:"space-between",marginTop:20},replace:{marginRight:5},input:{display:"none"},button:{marginRight:5},editingButtons:{display:"flex",justifyContent:"right"},card:{borderRadius:10,marginRight:15,marginBottom:15},cardHeader:{display:"flex",flexDirection:"row",marginBottom:15},editIcon:{marginTop:5},cardIcon:{marginTop:7},cardTitle:{margin:[[8,15,15,15]]}}),RN=Object(f.a)(DN),BN={field:{position:"relative",width:280,height:48,padding:[[0,4,4,0]],marginTop:2},label:{color:$,margin:[[0,0,0,0]]},notEditing:{display:"flex",flexDirection:"column","& > p:first-child":{height:16,lineHeight:"16px",transformOrigin:"left",paddingLeft:0,margin:[[3,0,3,0]]},"& > p:last-child":{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",margin:0}},editing:{"& > div":{"& > input":{padding:0,fontSize:14}}}},TN=Object(f.a)(BN),AN=function(e){var t,n=e.editing,a=e.field,r=e.value,i=e.size,o=Object(q.a)(e,["editing","field","value","size"]),l=TN(),c=(t={},Object(z.a)(t,l.field,!0),Object(z.a)(t,l.notEditing,!n),t);return Object(Me.jsxs)("div",{className:I()(c),children:[!n&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(et,{className:l.label,children:a.label}),Object(Me.jsx)(Xe,{children:r})]}),n&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(et,{className:l.label,children:a.label}),Object(Me.jsx)(bn.b,Object(s.a)({className:l.editing,id:a.name,name:a.name,component:a.component,type:a.type,width:i},o))]})]})},MN=function(e){var t,n=e.fields,r=e.save,i=e.authorize,o=e.hasImage,c=e.reject,s=e.state,d=e.title,u=e.titleIcon,m=e.children,p=e.validationSchema,b=e.initialValues,f=e.deleteEditedData,j=RN(),g=Object(a.useState)(!1),O=Object(l.a)(g,2),x=O[0],v=O[1],y=Object(a.useState)(null),w=Object(l.a)(y,2),C=w[0],k=w[1],E=Object(a.useState)(null),N=Object(l.a)(E,2),S=N[0],F=N[1],L=(t={},Object(z.a)(t,j.label1,!0),Object(z.a)(t,j.label1Pending,s===zw),Object(z.a)(t,j.label1Rejected,s===$w),Object(z.a)(t,j.label1Accepted,s===qw),t),P=s===zw?{label:"Pending",type:"neutral"}:s===$w?{label:"Rejected",type:"error"}:{label:"Accepted",type:"success"};return Object(Me.jsx)("div",{children:Object(Me.jsx)(um.a,{className:j.card,children:Object(Me.jsxs)(mm.a,{children:[Object(Me.jsxs)("div",{className:j.headerWrapper,children:[Object(Me.jsxs)("div",{className:j.cardHeader,children:[u,Object(Me.jsx)(Ve,{className:j.cardTitle,children:d}),Object(Me.jsx)(fp,{width:304})]}),s&&Object(Me.jsx)("div",{className:I()(L),children:Object(Me.jsx)(ku,{statuses:[P]})})]}),m,Object(Me.jsx)(bn.e,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,validationSchema:p,initialValues:b,onSubmit:function(e){r(e),v(!1)},onReset:function(){v(!1),F(!1)},children:function(e){e.values,e.touched,e.errors;var t=e.setFieldValue;return Object(Me.jsxs)(bn.d,{children:[Object(Me.jsx)(dm,{}),Object(Me.jsx)("div",{className:j.row,children:Object(Me.jsxs)(h.a,{container:!0,children:[Object(Me.jsx)(h.a,{container:!0,direction:"column",item:!0,xs:6,children:!o&&(null===n||void 0===n?void 0:n.map((function(e,t){return t>=0&&t<4?Object(Me.jsx)(AN,{field:e,value:b[e.name],editing:x,size:180}):null})))}),Object(Me.jsx)(h.a,{container:!0,direction:"column",item:!0,xs:6,children:!o&&(null===n||void 0===n?void 0:n.map((function(e,t){return t>=4?Object(Me.jsx)(AN,{field:e,value:b[e.name],editing:x,size:180}):null})))})]})}),Object(Me.jsxs)("div",{className:j.edit,children:[!x&&Object(Me.jsxs)("div",{className:j.editButton,children:[Object(Me.jsx)("div",{className:j.deleteButton,children:Object(Me.jsx)(ze,{color:"primary",type:"button",Icon:hh,InverseIcon:pN,onClick:function(){return f()},children:"Delete"})}),Object(Me.jsx)(ze,{color:"primary",Icon:kh,InverseIcon:xN,onClick:function(){return v(!0)},children:"Edit"})]}),x&&Object(Me.jsxs)("div",{className:j.editingWrapper,children:[Object(Me.jsx)("div",{className:j.replace,children:o&&Object(Me.jsx)(ze,{color:"secondary",type:"button",Icon:kN,InverseIcon:kN,onClick:function(){return C.click()},children:Object(Me.jsxs)("div",{children:[Object(Me.jsx)("input",{type:"file",alt:"",accept:"image/*",className:j.input,ref:function(e){return k(e)},onChange:function(e){var a=kf.a(e.target.files);a&&t(kf.a(n).name,a)}}),"Replace"]})})}),Object(Me.jsxs)("div",{className:j.editingButtons,children:[n&&Object(Me.jsx)("div",{className:j.button,children:Object(Me.jsx)(ze,{color:"secondary",Icon:PN,InverseIcon:PN,type:"submit",children:"Save"})}),Object(Me.jsx)("div",{className:j.button,children:Object(Me.jsx)(ze,{color:"secondary",Icon:ba,InverseIcon:ba,type:"reset",children:"Cancel"})}),"Accepted"!==P.label&&Object(Me.jsx)("div",{className:j.button,children:Object(Me.jsx)(ze,{color:"spring",type:"button",Icon:Pw,InverseIcon:Pw,onClick:function(){return i()},children:"Authorize"})}),"Rejected"!==P.label&&Object(Me.jsx)(ze,{color:"tomato",type:"button",Icon:_w,InverseIcon:_w,onClick:function(){return c()},children:"Reject"}),S&&Object(Me.jsx)(Jo,{children:"Failed to save changes"})]})]})]})]})}})]})})})},WN=(Object(f.a)({field:{height:46},label:{color:$,margin:[[0,3]]},value:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",margin:0,paddingLeft:4}}),function(e,t){return D.a(e)?"":t}),zN=Object(f.a)(Xk),qN=function(e){var t,n,a=e.customer,r=e.data,i=e.loading,o=e.locale,l=zN(),c="cashOut"===a.lastTxClass?Bc:Sc,s=!(Wa.a(r)||D.a(r)),d=o.timezone,u=(t={},Object(z.a)(t,l.titleAndButtonsContainer,i||!i&&!s),Object(z.a)(t,l.txTableSpacing,!i&&s),t),m=[{header:"Transactions",size:127,value:WN(a.totalTxs,"".concat(Number.parseInt(a.totalTxs)))},{header:"Transaction volume",size:167,value:WN(a.totalSpent,"".concat(Number.parseFloat(a.totalSpent)," ").concat(a.lastTxFiatCode))},{header:"Last active",size:142,value:!D.a(d)&&(null!==(n=a.lastActive&&ad(a.lastActive,d,"yyyy-MM-dd"))&&void 0!==n?n:"")},{header:"Last transaction",size:198,value:WN(a.lastTxFiat,Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(c,{className:l.icon}),"".concat(Number.parseFloat(a.lastTxFiat)," \n ").concat(a.lastTxFiatCode)]}))}],h=[{header:"Machine",width:160,view:A.a(["machineName"])},{width:125,view:function(e){return Object(Me.jsx)(Me.Fragment,{children:"cashOut"===e.txClass?Object(Me.jsx)(Bc,{className:l.txClassIconLeft}):Object(Me.jsx)(Sc,{className:l.txClassIconLeft})})}},{header:"Transaction ID",width:145,view:function(e){return Object(Me.jsx)(gf,{className:l.txId,children:e.id})}},{header:"Cash",width:155,textAlign:"right",view:function(e){return Object(Me.jsxs)(Me.Fragment,{children:["".concat(Number.parseFloat(e.fiat)," "),Object(Me.jsx)(tt,{inline:!0,children:e.fiatCode})]})}},{header:"Crypto",width:145,textAlign:"right",view:function(e){return Object(Me.jsxs)(Me.Fragment,{children:["".concat(yf.utils.toUnit(new Mc.a(e.cryptoAtoms),e.cryptoCode).toFormat(5)," "),Object(Me.jsx)(tt,{inline:!0,children:e.cryptoCode})]})}},{header:"Date",width:100,view:function(e){return ad(e.created,d,"yyyy-MM-dd")}},{header:"Time (h:m:s)",width:130,view:function(e){return ad(e.created,d,"HH:mm:ss")}}];return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Ve,{children:"Transactions"}),Object(Me.jsxs)(Ko.a,{display:"flex",flexDirection:"column",children:[Object(Me.jsx)(Ko.a,{display:"flex",mt:"auto",children:m.map((function(e,t){var n=e.size,a=e.header;return Object(Me.jsx)(et,{noMargin:!0,className:l.txSummaryLabel,style:{width:n},children:a},t)}))}),Object(Me.jsx)(Ko.a,{display:"flex",children:m.map((function(e,t){var n=e.size,a=e.value;return Object(Me.jsx)(Xe,{noMargin:!0,className:l.txSummaryValue,style:{width:n},children:a},t)}))})]}),Object(Me.jsx)("div",{className:l.titleWrapper,children:Object(Me.jsx)("div",{className:I()(u),children:i?Object(Me.jsx)(Ue,{children:"Loading"}):s?"":Object(Me.jsx)(Ue,{children:"No transactions so far"})})}),s&&Object(Me.jsx)(gy,{elements:h,data:r})]})},$N=n(455);function HN(){return(HN=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function VN(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var UN=a.createElement("g",{id:"icon/button/photo/zodiac-resized",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"Group-2"},a.createElement("g",{id:"Group",transform:"translate(11.666667, 8.333333) scale(-1, 1) translate(-11.666667, -8.333333) translate(3.333333, 0.000000)",stroke:"#1B2559"},a.createElement("rect",{id:"Rectangle-Copy",x:.5,y:.5,width:15.6666667,height:15.6666667,rx:1}),a.createElement("circle",{id:"Oval-Copy",fill:"#1B2559",cx:12.5,cy:4.16666667,r:1}),a.createElement("g",{id:"Group-14",transform:"translate(0.775621, 9.722222)",strokeLinejoin:"round"},a.createElement("polyline",{id:"Path-Copy-2",points:"0 4.58204149 5.10673153 0 11.6154223 6.31150113"}),a.createElement("polyline",{id:"Path",points:"9.02830015 3.23981481 11.3158819 0.925925926 15.0663146 4.81868037"}))),a.createElement("g",{id:"Group-9",transform:"translate(0.000000, 6.666667)"},a.createElement("circle",{id:"Oval",stroke:"#1B2559",fill:"#EBEFFF",cx:6.66666667,cy:6.66666667,r:6.16666667}),a.createElement("polygon",{id:"Path",fill:"#1B2559",fillRule:"nonzero",points:"7.22222222 6.11111111 10 6.11111111 10 7.22222222 7.22222222 7.22222222 7.22222222 10 6.11111111 10 6.11111111 7.22222222 3.33333333 7.22222222 3.33333333 6.11111111 6.11111111 6.11111111 6.11111111 3.33333333 7.22222222 3.33333333"}))));function GN(e,t){var n=e.title,r=e.titleId,i=VN(e,["title","titleId"]);return a.createElement("svg",HN({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":r},i),n?a.createElement("title",{id:r},n):null,UN)}var XN=a.forwardRef(GN);n.p;function _N(){return(_N=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function ZN(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var KN=a.createElement("g",{id:"icon/button/upload-file/zodiac-resized",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"Add-File-Icon",transform:"translate(0.000000, 0.500000)"},a.createElement("g",{id:"file-icon",transform:"translate(5.934783, 0.000000)",stroke:"#1B2559"},a.createElement("g",{id:"lines",transform:"translate(3.130435, 7.826087)",strokeLinecap:"round"},a.createElement("line",{x1:0,y1:7.04347826,x2:7.82608696,y2:7.04347826,id:"line-3"}),a.createElement("line",{x1:0,y1:3.91304348,x2:7.82608696,y2:3.91304348,id:"line-2"}),a.createElement("line",{x1:0,y1:.782608696,x2:5.47826087,y2:.782608696,id:"line-1"})),a.createElement("polygon",{id:"paper",strokeLinecap:"round",strokeLinejoin:"round",points:"13.5652174 18.6521739 0 18.6521739 -1.18243096e-12 0 8.47826087 2.91569667e-12 13.5652174 5.08695652"}),a.createElement("polygon",{id:"fold",strokeLinejoin:"round",points:"8.47826087 0 8.47826087 5.08695652 13.5652174 5.08695652"})),a.createElement("g",{id:"plus-sign",transform:"translate(0.000000, 5.934783)"},a.createElement("circle",{id:"Oval",stroke:"#1B2559",fill:"#EBEFFF",cx:6.7826087,cy:6.7826087,r:6.2826087}),a.createElement("polygon",{id:"Path",fill:"#1B2559",fillRule:"nonzero",points:"7.34782609 6.2173913 10.173913 6.2173913 10.173913 7.34782609 7.34782609 7.34782609 7.34782609 10.173913 6.2173913 10.173913 6.2173913 7.34782609 3.39130435 7.34782609 3.39130435 6.2173913 6.2173913 6.2173913 6.2173913 3.39130435 7.34782609 3.39130435"}))));function QN(e,t){var n=e.title,r=e.titleId,i=ZN(e,["title","titleId"]);return a.createElement("svg",_N({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":r},i),n?a.createElement("title",{id:r},n):null,KN)}var YN=a.forwardRef(QN),JN=(n.p,Object(f.a)({box:{boxSizing:"border-box",marginTop:40,width:450,height:120,borderStyle:"dashed",borderColor:se,borderRadius:4,borderWidth:1,backgroundColor:re,display:"flex",justifyContent:"center"},inputContent:{marginTop:35,display:"flex"},uploadContent:{marginTop:50,display:"flex"},board:{width:450,height:120},icon:{margin:[[14,20,0,0]]}})),eS=function(e){var t=e.type,n=JN(),r=Object(a.useState)({}),i=Object(l.a)(r,2),o=i[0],c=i[1],d=Object(bn.f)().setFieldValue,u="image",m=t===u,h=Object(a.useCallback)((function(e){d(t,kf.a(e).name),c({preview:m?URL.createObjectURL(kf.a(e)):kf.a(e).name})}),[m,t,d]),p=Object($N.a)({onDrop:h}),b=p.getRootProps,f=p.getInputProps;return Object(Me.jsx)(Me.Fragment,{children:Object(Me.jsxs)("div",Object(s.a)(Object(s.a)({},b()),{},{className:n.board,children:[Wa.a(o)&&Object(Me.jsxs)("div",{className:n.box,children:[Object(Me.jsx)("input",Object(s.a)({},f())),Object(Me.jsxs)("div",{className:n.inputContent,children:[m?Object(Me.jsx)(XN,{className:n.icon}):Object(Me.jsx)(YN,{className:n.icon}),Object(Me.jsx)(nt,{children:"Drag and drop ".concat(m?"an image":"a file"," or click to open the explorer")})]})]}),!Wa.a(o)&&t===u&&Object(Me.jsx)("div",{children:Object(Me.jsx)("img",{src:o.preview,className:n.box,alt:""})},o.name),!Wa.a(o)&&t!==u&&Object(Me.jsx)("div",{className:n.box,children:Object(Me.jsx)(Ve,{className:n.uploadContent,children:o.preview})})]}))})},tS=Object(f.a)(Ck),nS=function(e){var t=e.show,n=e.src,a=tS({width:165});return Object(Me.jsx)(Me.Fragment,{children:t?Object(Me.jsx)(BC,{src:n,width:165,height:32,popupWidth:360,popupHeight:240}):Object(Me.jsx)("div",{className:a.photoWrapper,children:Object(Me.jsx)(QC,{})})})},aS=function(e){var t,n,r,i,o,c,s,d,u,m=e.customer,p=e.updateCustomer,b=e.replacePhoto,f=e.editCustomer,j=e.deleteEditedData,g=e.updateCustomRequest,O=e.authorizeCustomRequest,x=tS(),v=Object(a.useState)(!1),y=Object(l.a)(v,2),w=y[0],C=y[1],k=A.a(["idCardData"])(m),E=A.a(["expirationDate"])(k),N=A.a(["dateOfBirth"])(k),S=A.a(["sanctions"])(m),I=A.a(["sanctionsAt"])(m)?S?"Passed":"Failed":"Not checked yet",F=pw.a(L.a(Iv.a,A.a(["customInfoRequest","customRequest","name"]))),P=[],D=F(null!==(t=A.a(["customInfoRequests"])(m))&&void 0!==t?t:[]),R=function(e){return e%2===0},B=vg.a.filter((function(e){return e.isAvailable})),T={idScan:xn.f().shape({firstName:xn.h().required(),lastName:xn.h().required(),documentNumber:xn.h().required(),dateOfBirth:xn.h().test({test:function(e){return Object(vC.a)(Object(yC.a)(new Date,"yyyy-MM-dd",e))}}).required(),gender:xn.h().required(),country:xn.h().required(),expirationDate:xn.h().test({test:function(e){return Object(vC.a)(Object(yC.a)(new Date,"yyyy-MM-dd",e))}}).required()}),usSsn:xn.f().shape({usSsn:xn.h().required()}),idCardPhoto:xn.f().shape({idCardPhoto:xn.d().required()}),frontCamera:xn.f().shape({frontCamera:xn.d().required()})},M=[{name:"firstName",label:"First name",component:ai},{name:"documentNumber",label:"ID number",component:ai},{name:"dateOfBirth",label:"Birthdate",component:ai},{name:"gender",label:"Gender",component:ai},{name:"lastName",label:"Last name",component:ai},{name:"expirationDate",label:"Expiration Date",component:ai},{name:"country",label:"Country",component:ai}],W=[{name:"usSsn",label:"US SSN",component:ai,size:190}],q={idScan:{firstName:null!==(n=A.a(["firstName"])(k))&&void 0!==n?n:"",lastName:null!==(r=A.a(["lastName"])(k))&&void 0!==r?r:"",documentNumber:null!==(i=A.a(["documentNumber"])(k))&&void 0!==i?i:"",dateOfBirth:null!==(o=N&&Object(ed.a)("yyyy-MM-dd")(Object(yC.a)(new Date,"yyyyMMdd",N)))&&void 0!==o?o:"",gender:null!==(c=A.a(["gender"])(k))&&void 0!==c?c:"",country:null!==(s=A.a(["country"])(k))&&void 0!==s?s:"",expirationDate:null!==(d=E&&Object(ed.a)("yyyy-MM-dd")(Object(yC.a)(new Date,"yyyyMMdd",E)))&&void 0!==d?d:""},usSsn:{usSsn:null!==(u=m.usSsn)&&void 0!==u?u:""},frontCamera:{frontCamera:null},idCardPhoto:{idCardPhoto:null}},$=function(e){return vg.a.map((function(t){return e[t]=Object(ed.a)("yyyyMMdd")(Object(yC.a)(new Date,"yyyy-MM-dd",e[t]))}))(["dateOfBirth","expirationDate"]),e},H=[{fields:M,title:"ID Scan",titleIcon:Object(Me.jsx)(zC,{className:x.cardIcon}),state:A.a(["idCardDataOverride"])(m),authorize:function(){return p({idCardDataOverride:qw})},reject:function(){return p({idCardDataOverride:$w})},deleteEditedData:function(){return j({idCardData:null})},save:function(e){return f({idCardData:vg.a.merge(k,$(e))})},validationSchema:T.idScan,initialValues:q.idScan,isAvailable:!vg.a.isNil(k)},{title:"SMS Confirmation",titleIcon:Object(Me.jsx)(UC,{className:x.cardIcon}),authorize:function(){},reject:function(){},save:function(){},isAvailable:!1},{title:"Name",titleIcon:Object(Me.jsx)(ak,{className:x.editIcon}),authorize:function(){},reject:function(){},save:function(){},isAvailable:!1},{title:"Sanctions check",titleIcon:Object(Me.jsx)(ak,{className:x.editIcon}),state:A.a(["sanctionsOverride"])(m),authorize:function(){return p({sanctionsOverride:qw})},reject:function(){return p({sanctionsOverride:$w})},children:Object(Me.jsx)(Ke,{children:I}),isAvailable:!vg.a.isNil(S)},{fields:[{name:"frontCamera"}],title:"Front facing camera",titleIcon:Object(Me.jsx)(ak,{className:x.editIcon}),state:A.a(["frontCameraOverride"])(m),authorize:function(){return p({frontCameraOverride:qw})},reject:function(){return p({frontCameraOverride:$w})},save:function(e){return b({newPhoto:e.frontCamera,photoType:"frontCamera"})},deleteEditedData:function(){return j({frontCamera:null})},children:m.frontCameraPath?Object(Me.jsx)(nS,{show:m.frontCameraPath,src:"".concat(Ij,"/front-camera-photo/").concat(A.a(["frontCameraPath"])(m))}):null,hasImage:!0,validationSchema:T.frontCamera,initialValues:q.frontCamera,isAvailable:!vg.a.isNil(m.frontCameraPath)},{fields:[{name:"idCardPhoto"}],title:"ID card image",titleIcon:Object(Me.jsx)(ak,{className:x.editIcon}),state:A.a(["idCardPhotoOverride"])(m),authorize:function(){return p({idCardPhotoOverride:qw})},reject:function(){return p({idCardPhotoOverride:$w})},save:function(e){return b({newPhoto:e.idCardPhoto,photoType:"idCardPhoto"})},deleteEditedData:function(){return j({idCardPhoto:null})},children:m.idCardPhotoPath?Object(Me.jsx)(nS,{show:m.idCardPhotoPath,src:"".concat(Ij,"/id-card-photo/").concat(A.a(["idCardPhotoPath"])(m))}):null,hasImage:!0,validationSchema:T.idCardPhoto,initialValues:q.idCardPhoto,isAvailable:!vg.a.isNil(m.idCardPhotoPath)},{fields:W,title:"US SSN",titleIcon:Object(Me.jsx)(zC,{className:x.cardIcon}),state:A.a(["usSsnOverride"])(m),authorize:function(){return p({usSsnOverride:qw})},reject:function(){return p({usSsnOverride:$w})},save:function(e){return f({usSsn:e.usSsn})},deleteEditedData:function(){return j({usSsn:null})},validationSchema:T.usSsn,initialValues:q.usSsn,isAvailable:!vg.a.isNil(m.usSsn)}];zp.a((function(e){var t,n;console.log("it",e),P.push({fields:[{name:e.customInfoRequest.id,label:e.customInfoRequest.customRequest.name,value:null!==(t=e.customerData.data)&&void 0!==t?t:"",component:ai}],title:e.customInfoRequest.customRequest.name,titleIcon:Object(Me.jsx)(zC,{className:x.cardIcon}),authorize:function(){return O({variables:{customerId:e.customerId,infoRequestId:e.customInfoRequest.id,isAuthorized:!0}})},reject:function(){return O({variables:{customerId:e.customerId,infoRequestId:e.customInfoRequest.id,isAuthorized:!1}})},save:function(t){g({variables:{customerId:e.customerId,infoRequestId:e.customInfoRequest.id,data:{info_request_id:e.customInfoRequest.id,data:t[e.customInfoRequest.id]}}})},deleteEditedData:function(){},validationSchema:xn.f().shape(Object(z.a)({},e.customInfoRequest.id,xn.h())),initialValues:Object(z.a)({},e.customInfoRequest.id,null!==(n=e.customerData.data)&&void 0!==n?n:"")})}),D);var V=function(e,t){var n=e.title,a=e.authorize,r=e.reject,i=e.state,o=e.titleIcon,l=e.fields,c=e.save,s=e.deleteEditedData,d=e.children,u=e.validationSchema,m=e.initialValues,h=e.hasImage;return Object(Me.jsx)(MN,{title:n,authorize:a,reject:r,state:i,titleIcon:o,hasImage:h,fields:l,children:d,validationSchema:u,initialValues:m,save:c,deleteEditedData:s},t)},U=B(H);return Object(Me.jsxs)("div",{children:[Object(Me.jsxs)("div",{className:x.header,children:[Object(Me.jsx)(Ve,{className:x.title,children:"Customer data"}),Object(Me.jsx)(Vn,{active:!w,className:x.viewIcons,Icon:wk,InverseIcon:gk,onClick:function(){return C(!1)}}),Object(Me.jsx)(Vn,{active:w,className:x.viewIcons,Icon:hk,InverseIcon:ck,onClick:function(){return C(!0)}})]}),Object(Me.jsxs)("div",{children:[!w&&m&&Object(Me.jsxs)(h.a,{container:!0,children:[Object(Me.jsx)(h.a,{container:!0,direction:"column",item:!0,xs:6,children:U.map((function(e,t){return R(t)?V(e,t):null}))}),Object(Me.jsx)(h.a,{container:!0,direction:"column",item:!0,xs:6,children:U.map((function(e,t){return R(t)?null:V(e,t)}))})]}),null,!Wa.a(P)&&Object(Me.jsxs)("div",{className:x.wrapper,children:[Object(Me.jsx)("span",{className:x.separator,children:"Custom requirements"}),Object(Me.jsxs)(h.a,{container:!0,children:[Object(Me.jsx)(h.a,{container:!0,direction:"column",item:!0,xs:6,children:P.map((function(e,t){return R(t)?V(e,t):null}))}),Object(Me.jsx)(h.a,{container:!0,direction:"column",item:!0,xs:6,children:P.map((function(e,t){return R(t)?null:V(e,t)}))})]})]})]})]})},rS={header:{display:"flex",flexDirection:"row"},title:{marginTop:7,marginRight:24},notesChipList:{display:"flex",flexDirection:"row",flexWrap:"wrap"}},iS={noteCardWrapper:{flexGrow:0,flexShrink:0,flexBasis:"25%",minWidth:0,maxWidth:500,"&:nth-child(4n+1)":{"& > div":{margin:[[0,10,0,0]]}},"&:nth-child(4n)":{"& > div":{margin:[[0,0,0,10]]}},margin:[[10,0]]},noteCardChip:{height:200,margin:[[0,10]],padding:[[10,10]],cursor:"pointer"},newNoteCard:{backgroundColor:G,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},noteCardHeader:{display:"flex",flexDirection:"row",justifyContent:"space-between",width:"100%"},noteCardTitle:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",marginRight:10},noteCardContent:{display:"box",lineClamp:7,boxOrient:"vertical",margin:[[15,0]],overflow:"hidden",textOverflow:"ellipsis",wordWrap:"break-word"},editCardChip:{height:325,padding:15},editCardHeader:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:15},editCardActions:{display:"flex",flexDirection:"row",alignItems:"center","& > *":{marginRight:10},"& > *:last-child":{marginRight:0}},editNotesContent:{"& > div":{"&:after":{borderBottom:"none"},"&:before":{borderBottom:"none"},"&:hover:not(.Mui-disabled)::before":{borderBottom:"none"}}}},oS=Object(f.a)(iS),lS=function(e){var t=e.setOpenModal,n=oS();return Object(Me.jsx)("div",{className:n.noteCardWrapper,onClick:function(){return t(!0)},children:Object(Me.jsxs)(Un.a,{className:I()(n.noteCardChip,n.newNoteCard),children:[Object(Me.jsx)(Sn,{width:20,height:20}),Object(Me.jsx)(Xe,{children:"Add new"})]})})},cS={form:{display:"flex",flexDirection:"column",height:"100%","& > *":{marginTop:20},"& > *:last-child":{marginTop:"auto"}},submit:{margin:[["auto",0,0,"auto"]]},footer:{display:"flex",flexDirection:"row",margin:[["auto",0,24,0]]}},sS=Object(f.a)(cS),dS={title:"",content:""},uS=xn.f().shape({title:xn.h().required().trim().max(25),content:xn.h().required()}),mS=function(e){var t=e.showModal,n=e.onClose,a=e.onSubmit,r=e.errorMsg,i=sS();return Object(Me.jsx)(Me.Fragment,{children:Object(Me.jsx)(Mh,{title:"New note",closeOnBackdropClick:!0,width:416,height:472,handleClose:n,open:t,children:Object(Me.jsx)(bn.e,{validateOnBlur:!1,validateOnChange:!1,initialValues:dS,validationSchema:uS,onSubmit:function(e){var t=e.title,n=e.content;a({title:t,content:n})},children:Object(Me.jsxs)(bn.d,{id:"note-form",className:i.form,children:[Object(Me.jsx)(bn.b,{name:"title",autofocus:!0,size:"md",autoComplete:"off",width:350,component:ai,label:"Note title"}),Object(Me.jsx)(bn.b,{name:"content",size:"sm",autoComplete:"off",width:350,component:ai,multiline:!0,rows:11,label:"Note content"}),Object(Me.jsxs)("div",{className:i.footer,children:[r&&Object(Me.jsx)(Jo,{children:r}),Object(Me.jsx)(An,{type:"submit",form:"note-form",className:i.submit,children:"Add note"})]})]})})})})},hS=n(908),pS=Object(f.a)(iS),bS=function(e){var t=hS.a(/\n/)(e);return R.a((function(e,n){return n===t.length?Object(Me.jsx)(Me.Fragment,{children:e}):Object(Me.jsxs)(Me.Fragment,{children:[e,Object(Me.jsx)("br",{})]})}),t)},fS=function(e){var t=e.note,n=e.deleteNote,a=e.handleClick,r=e.timezone,i=pS();return Object(Me.jsx)("div",{className:i.noteCardWrapper,children:Object(Me.jsxs)(Un.a,{className:i.noteCardChip,onClick:function(){return a(t)},children:[Object(Me.jsxs)("div",{className:i.noteCardHeader,children:[Object(Me.jsxs)("div",{className:i.noteCardTitle,children:[Object(Me.jsx)(Ve,{noMargin:!0,children:null===t||void 0===t?void 0:t.title}),Object(Me.jsx)(Xe,{noMargin:!0,children:ad(null===t||void 0===t?void 0:t.created,r,"yyyy-MM-dd")})]}),Object(Me.jsx)("div",{children:Object(Me.jsx)(hh,{className:i.deleteIcon,onClick:function(e){e.stopPropagation(),n({noteId:t.id})}})})]}),Object(Me.jsx)(Xe,{noMargin:!0,className:i.noteCardContent,children:bS(null===t||void 0===t?void 0:t.content)})]})})},jS=n(958),gS=n(909);function OS(){return(OS=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function xS(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var vS=a.createElement("desc",null,"Created with Sketch."),yS=a.createElement("defs",null,a.createElement("polygon",{id:"path-1",points:"0 21 21 21 21 0 0 0"})),wS=a.createElement("g",{id:"icon/sf-small/save/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"Group"},a.createElement("g",{id:"Group-10"},a.createElement("g",{id:"Group-6"},a.createElement("polygon",{id:"Stroke-1",stroke:"#1B2559",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",points:"20.5 20.5 0.5 20.5 0.5 0.5 16.75 0.5 20.5 4.25"}),a.createElement("mask",{id:"mask-2",fill:"white"},a.createElement("use",{xlinkHref:"#path-1"})),a.createElement("g",{id:"Clip-4"}),a.createElement("polygon",{id:"Stroke-5",stroke:"#1B2559",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",mask:"url(#mask-2)",points:"4.25 7.5 16.75 7.5 16.75 0.5 4.25 0.5"}))),a.createElement("circle",{id:"Oval",stroke:"#1B2559",strokeWidth:2,cx:11,cy:14,r:3})));function CS(e,t){var n=e.title,r=e.titleId,i=xS(e,["title","titleId"]);return a.createElement("svg",OS({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":r},i),n?a.createElement("title",{id:r},n):null,vS,yS,wS)}var kS=a.forwardRef(CS),ES=(n.p,Object(f.a)(iS)),NS=function(e){var t=e.note,n=e.cancel,r=e.edit,i=e.timezone,o=Object(a.useRef)(),l=ES(),c=xn.f().shape({content:xn.h()}),s={content:t.content};return Object(Me.jsxs)(Un.a,{className:l.editCardChip,children:[Object(Me.jsxs)("div",{className:l.editCardHeader,children:[Object(Me.jsxs)(Xe,{noMargin:!0,children:["Last edited ",Object(jS.a)({delimited:", "},Object(gS.a)({start:nd(new Date(t.lastEditedAt),i),end:nd(new Date,i)}))," ago"]}),Object(Me.jsxs)("div",{className:l.editCardActions,children:[Object(Me.jsx)(ze,{color:"primary",type:"button",Icon:lj,InverseIcon:ba,onClick:n,children:"Cancel"}),Object(Me.jsx)(ze,{color:"primary",type:"submit",form:"edit-note",Icon:kS,InverseIcon:PN,children:"Save changes"}),Object(Me.jsx)(ze,{color:"primary",type:"button",Icon:lj,InverseIcon:ba,onClick:function(){return o.current.setFieldValue("content","")},children:"Clear content"})]})]}),Object(Me.jsx)(bn.e,{validateOnChange:!1,validateOnBlur:!1,validationSchema:c,initialValues:s,onSubmit:function(e){var n=e.content;return r({noteId:t.id,newContent:n,oldContent:t.content})},innerRef:o,children:Object(Me.jsx)(bn.d,{id:"edit-note",children:Object(Me.jsx)(bn.b,{name:"content",component:ai,className:l.editNotesContent,size:"sm",autoComplete:"off",fullWidth:!0,multiline:!0,rows:15})})})]})},SS=Object(f.a)(rS),IS=function(e){var t,n=e.customer,r=e.createNote,i=e.deleteNote,o=e.editNote,c=e.timezone,s=SS(),d=Object(a.useState)(!1),u=Object(l.a)(d,2),m=u[0],h=u[1],p=Object(a.useState)(null),b=Object(l.a)(p,2),f=b[0],j=b[1],g=qv.a((function(e,t){return new Date(null===t||void 0===t?void 0:t.created).getTime()-new Date(null===e||void 0===e?void 0:e.created).getTime()}),null!==(t=n.notes)&&void 0!==t?t:[]),O=function(){h(!1)};return Object(Me.jsxs)("div",{children:[Object(Me.jsx)("div",{className:s.header,children:Object(Me.jsx)(Ve,{className:s.title,children:"Notes"})}),D.a(f)&&Object(Me.jsxs)("div",{className:s.notesChipList,children:[Object(Me.jsx)(lS,{setOpenModal:h}),R.a((function(e){return Object(Me.jsx)(fS,{note:e,deleteNote:i,handleClick:j,timezone:c})}),g)]}),!D.a(f)&&Object(Me.jsx)(NS,{note:f,cancel:function(){j(null)},edit:function(e){yd.a(e.newContent,e.oldContent)||o({noteId:e.noteId,newContent:e.newContent}),j(null)},timezone:c}),m&&Object(Me.jsx)(mS,{showModal:m,onClose:O,onSubmit:function(e){return r(e),O()}})]})},FS=n(423),LS=n(910);function PS(){return(PS=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function DS(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var RS=a.createElement("g",{id:"icon/ID/photo/new/comet",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.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:"#5F668A",strokeWidth:1.6}));function BS(e,t){var n=e.title,r=e.titleId,i=DS(e,["title","titleId"]);return a.createElement("svg",PS({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":r},i),void 0===n?a.createElement("title",{id:r},"icon/ID/photo/new/comet"):n?a.createElement("title",{id:r},n):null,RS)}var TS,AS,MS,WS,zS,qS,$S,HS,VS,US,GS,XS=a.forwardRef(BS),_S=(n.p,{header:{display:"flex",flexDirection:"row"},title:{marginTop:7,marginRight:24,marginBottom:32},photosChipList:{display:"flex",flexDirection:"row",flexWrap:"wrap"},image:{objectFit:"cover",objectPosition:"center",width:224,height:200,borderTopLeftRadius:4,borderTopRightRadius:4},photoCardChip:{margin:[[0,16,0,0]]},footer:{display:"flex",flexDirection:"row",margin:[[8,0,0,8]]},date:{margin:[[0,0,8,12]]}}),ZS=Object(f.a)(_S),KS=function(e){var t=e.idx,n=e.date,a=e.src,r=e.setPhotosDialog,i=e.setPhotoClickIndex,o=ZS();return Object(Me.jsxs)(Un.a,{className:o.photoCardChip,onClick:function(){i(t),r(!0)},children:[Object(Me.jsx)("img",{className:o.image,src:a,alt:""}),Object(Me.jsxs)("div",{className:o.footer,children:[Object(Me.jsx)(XS,{}),Object(Me.jsx)(tt,{className:o.date,children:Object(ed.a)("yyyy-MM-dd",new Date(n))})]})]})},QS=function(e){var t=e.photosData,n=ZS(),r=Object(a.useState)(!1),i=Object(l.a)(r,2),o=i[0],c=i[1],s=Object(a.useState)(null),d=Object(l.a)(s,2),u=d[0],m=d[1],h=D.a(u)?t:L.a(ol.a,FS.a,LS.a(u))(t);return Object(Me.jsxs)("div",{children:[Object(Me.jsx)("div",{className:n.header,children:Object(Me.jsx)(Ve,{className:n.title,children:"Photos & files"})}),Object(Me.jsx)("div",{className:n.photosChipList,children:t.map((function(e,t){return Object(Me.jsx)(KS,{idx:t,date:e.date,src:"".concat(Ij,"/").concat(e.photoDir,"/").concat(e.path),setPhotosDialog:c,setPhotoClickIndex:m})}))}),Object(Me.jsx)(Kk,{open:o,title:"Photo roll",data:Object(Me.jsx)(pE,{photosData:h}),onDissmised:function(){c(!1),m(null)}})]})},YS={labelLink:{cursor:"pointer",color:$},breadcrumbs:{margin:[[20,0]]},actionLabel:{color:$,margin:[[4,0]]},customerDetails:{marginBottom:18},customerBlock:function(e){return{display:"flex",flexDirection:"row",margin:[[0,0,4,0]],padding:[[0,e.blocked?35:48,0]]}},customerDiscount:{display:"flex",flexDirection:"row",margin:[[0,0,4,0]],padding:[[0,23.5,0]]},customerManualDataEntry:{display:"flex",flexDirection:"row",margin:[[8,0,4,0]],padding:[[0,40.5,0]]},retrieveInformation:{display:"flex",flexDirection:"row",margin:[[0,0,4,0]],padding:[[0,32.5,0]]},panels:{display:"flex"},rightSidePanel:{display:"block",width:1100},leftSidePanel:{width:300}},JS=Object(f.a)(YS),eI=x()(TS||(TS=Object(c.a)(["\n query customer($customerId: ID!) {\n config\n customer(customerId: $customerId) {\n id\n authorizedOverride\n frontCameraPath\n frontCameraAt\n frontCameraOverride\n phone\n isAnonymous\n smsOverride\n idCardData\n idCardDataOverride\n idCardDataExpiration\n idCardPhotoPath\n idCardPhotoOverride\n usSsn\n usSsnOverride\n sanctions\n sanctionsAt\n sanctionsOverride\n totalTxs\n totalSpent\n lastActive\n lastTxFiat\n lastTxFiatCode\n lastTxClass\n daysSuspended\n isSuspended\n customFields {\n id\n label\n value\n }\n notes {\n id\n customerId\n title\n content\n created\n lastEditedAt\n }\n transactions {\n txClass\n id\n fiat\n fiatCode\n cryptoAtoms\n cryptoCode\n created\n machineName\n errorMessage: error\n error: errorCode\n txCustomerPhotoAt\n txCustomerPhotoPath\n }\n customInfoRequests {\n customerId\n approved\n customerData\n customInfoRequest {\n id\n enabled\n customRequest\n }\n }\n }\n }\n"]))),tI=x()(AS||(AS=Object(c.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"]))),nI=x()(MS||(MS=Object(c.a)(["\n mutation editCustomer($customerId: ID!, $customerEdit: CustomerEdit) {\n editCustomer(customerId: $customerId, customerEdit: $customerEdit) {\n id\n idCardData\n usSsn\n }\n }\n"]))),aI=x()(WS||(WS=Object(c.a)(["\n mutation replacePhoto(\n $customerId: ID!\n $photoType: String\n $newPhoto: Upload\n ) {\n replacePhoto(\n customerId: $customerId\n photoType: $photoType\n newPhoto: $newPhoto\n ) {\n id\n newPhoto\n photoType\n }\n }\n"]))),rI=x()(zS||(zS=Object(c.a)(["\n mutation deleteEditedData($customerId: ID!, $customerEdit: CustomerEdit) {\n deleteEditedData(customerId: $customerId, customerEdit: $customerEdit) {\n id\n frontCameraPath\n idCardData\n idCardPhotoPath\n usSsn\n }\n }\n"]))),iI=x()(qS||(qS=Object(c.a)(["\n mutation setAuthorizedCustomRequest(\n $customerId: ID!\n $infoRequestId: ID!\n $isAuthorized: Boolean!\n ) {\n setAuthorizedCustomRequest(\n customerId: $customerId\n infoRequestId: $infoRequestId\n isAuthorized: $isAuthorized\n )\n }\n"]))),oI=x()($S||($S=Object(c.a)(["\n mutation setCustomerCustomInfoRequest(\n $customerId: ID!\n $infoRequestId: ID!\n $data: JSON!\n ) {\n setCustomerCustomInfoRequest(\n customerId: $customerId\n infoRequestId: $infoRequestId\n data: $data\n )\n }\n"]))),lI=x()(HS||(HS=Object(c.a)(["\n mutation createCustomerNote(\n $customerId: ID!\n $title: String!\n $content: String!\n ) {\n createCustomerNote(\n customerId: $customerId\n title: $title\n content: $content\n )\n }\n"]))),cI=x()(VS||(VS=Object(c.a)(["\n mutation deleteCustomerNote($noteId: ID!) {\n deleteCustomerNote(noteId: $noteId)\n }\n"]))),sI=x()(US||(US=Object(c.a)(["\n mutation editCustomerNote($noteId: ID!, $newContent: String!) {\n editCustomerNote(noteId: $noteId, newContent: $newContent)\n }\n"]))),dI=x()(GS||(GS=Object(c.a)(["\n query getData {\n config\n }\n"]))),uI=Object(a.memo)((function(){var e,t,n,r=Object(w.h)(),i=Object(a.useState)(!1),o=Object(l.a)(i,2),c=o[0],s=o[1],d=Object(a.useState)(!1),m=Object(l.a)(d,2),h=m[0],p=m[1],b=Object(a.useState)(null),f=Object(l.a)(b,1)[0],j=Object(a.useState)("overview"),g=Object(l.a)(j,2),O=g[0],x=g[1],v=Object(w.j)().id,y=Object(u.c)(eI,{variables:{customerId:v}}),C=y.data,k=y.refetch,E=y.loading,N=Object(u.c)(dI),S=N.data,I=N.loading,F=Object(u.b)(aI,{onCompleted:function(){return k()}}),L=Object(l.a)(F,1)[0],P=Object(u.b)(nI,{onCompleted:function(){return k()}}),D=Object(l.a)(P,1)[0],T=Object(u.b)(rI,{onCompleted:function(){return k()}}),M=Object(l.a)(T,1)[0],W=Object(u.b)(tI,{onCompleted:function(){return k()}}),z=Object(l.a)(W,1)[0],q=Object(u.b)(iI,{onCompleted:function(){return k()}}),$=Object(l.a)(q,1)[0],H=Object(u.b)(oI,{onCompleted:function(){return k()}}),V=Object(l.a)(H,1)[0],U=Object(u.b)(lI,{onCompleted:function(){return k()}}),G=Object(l.a)(U,1)[0],X=Object(u.b)(cI,{onCompleted:function(){return k()}}),_=Object(l.a)(X,1)[0],Z=Object(u.b)(sI,{onCompleted:function(){return k()}}),K=Object(l.a)(Z,1)[0],Q=function(e){return z({variables:{customerId:v,customerInput:e}})},Y=null!==(e=A.a(["config"])(C))&&void 0!==e?e:[],J=Y&&rs(Zc,Y),ee=null!==(t=A.a(["customer"])(C))&&void 0!==t?t:[],te=null!==(n=A.a(["transactions"])(ee))&&void 0!==n?n:[],ne=qv.a(Ew.a(B.a("cryptoAtoms")))(te),ae=Ik(ee),re=A.a(["authorizedOverride"])(ee)===$w,ie=ee.isSuspended,oe="customerData"===O,le="overview"===O,ce="notes"===O,se="photos"===O,de=Mm.a(["frontCameraPath","frontCameraAt"])(ee),ue=ne&&R.a(Mm.a(["id","txCustomerPhotoPath","txCustomerPhotoAt"]))(ne),me=Hk(ud.a(de,ue)),he=E&&I,pe=A.a(["config","locale_timezone"],S),be=JS({blocked:re});return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)(Ku.a,{classes:{root:be.breadcrumbs},separator:Object(Me.jsx)(Yu.a,{fontSize:"small"}),"aria-label":"breadcrumb",children:[Object(Me.jsx)(et,{noMargin:!0,className:be.labelLink,onClick:function(){return r.push("/compliance/customers")},children:"Customers"}),Object(Me.jsx)(tt,{noMargin:!0,className:be.labelLink,children:ae.length?ae:Sk(A.a(["phone"])(ee),J.country)})]}),Object(Me.jsxs)("div",{className:be.panels,children:[Object(Me.jsx)("div",{className:be.leftSidePanel,children:!he&&!ee.isAnonymous&&Object(Me.jsxs)("div",{children:[Object(Me.jsx)("div",{children:Object(Me.jsx)(lN,{isSelected:function(e){return e===O},onClick:function(e){return x(e)}})}),Object(Me.jsx)(et,{className:be.actionLabel,children:"Actions"}),Object(Me.jsx)("div",{children:Object(Me.jsx)(ze,{className:be.customerManualDataEntry,color:"primary",Icon:dC,InverseIcon:iC,onClick:function(){return p(!0)},children:"Manual data entry"})}),Object(Me.jsx)("div",{children:Object(Me.jsx)(ze,{className:be.customerDiscount,color:"primary",Icon:xC,InverseIcon:bC,onClick:function(){},children:"Add individual discount"})}),Object(Me.jsxs)("div",{children:[ie&&Object(Me.jsx)(ze,{color:"primary",Icon:Mw,InverseIcon:Pw,onClick:function(){return Q({suspendedUntil:null})},children:"Unsuspend customer"}),Object(Me.jsx)(ze,{color:"primary",className:be.customerBlock,Icon:re?Mw:eC,InverseIcon:re?Pw:_w,onClick:function(){return Q({authorizedOverride:re?qw:$w})},children:"".concat(re?"Authorize":"Block"," customer")}),Object(Me.jsx)(ze,{color:"primary",className:be.retrieveInformation,Icon:re?Mw:eC,InverseIcon:re?Pw:_w,onClick:function(){return z({variables:{customerId:v,customerInput:{subscriberInfo:!0}}})},children:"Retrieve information"})]})]})}),Object(Me.jsxs)("div",{className:be.rightSidePanel,children:[le&&Object(Me.jsxs)("div",{children:[Object(Me.jsx)(Ko.a,{className:be.customerDetails,display:"flex",justifyContent:"space-between",children:Object(Me.jsx)(gE,{customer:ee,photosData:me,locale:J,setShowCompliance:function(){return s(!c)}})}),Object(Me.jsx)("div",{children:Object(Me.jsx)(qN,{customer:ee,data:ne,locale:J,loading:he})})]}),oe&&Object(Me.jsx)("div",{children:Object(Me.jsx)(aS,{customer:ee,updateCustomer:Q,replacePhoto:function(e){return L({variables:{customerId:v,newPhoto:e.newPhoto,photoType:e.photoType}})},editCustomer:function(e){return D({variables:{customerId:v,customerEdit:e}})},deleteEditedData:function(e){return M({variables:{customerId:v,customerEdit:e}})},updateCustomRequest:V,authorizeCustomRequest:$})}),ce&&Object(Me.jsx)("div",{children:Object(Me.jsx)(IS,{customer:ee,createNote:function(e){return G({variables:{customerId:v,title:e.title,content:e.content}})},deleteNote:function(e){return _({variables:{noteId:e.noteId}})},editNote:function(e){return K({variables:{noteId:e.noteId,newContent:e.newContent}})},timezone:pe})}),se&&Object(Me.jsx)("div",{children:Object(Me.jsx)(QS,{photosData:me})})]}),h&&Object(Me.jsx)(Gk,{error:null===f||void 0===f?void 0:f.message,save:function(){},onClose:function(){return p(null)}})]})]})})),mI=n(945),hI=n(464),pI=Wn.baseButton,bI=pI.height/2,fI=pI.height/4,jI="rgba(0, 0, 0, 0.08)",gI="0 4px 4px 0 ".concat(jI),OI={size:function(e){var t=e.size;return Object(s.a)({marginTop:"lg"===t?0:2},Ha(t))},bold:Va,autocomplete:{'&[data-focus="true"]':{backgroundColor:jI}},popup:{display:"flex",flexDirection:"column",borderRadius:[[0,0,fI,fI]],backgroundColor:G,boxShadow:gI},separator:{width:"88%",height:1,margin:"0 auto",border:"solid 0.5px",borderColor:$},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:$,margin:[0]},input:{display:"flex",flex:1,width:273,padding:[[8,12]],alignItems:"center",height:32,borderRadius:bI,backgroundColor:G,color:J},inputWithPopup:{borderRadius:[[fI,fI,0,0]],boxShadow:gI},iconButton:{marginRight:12}},xI=Object(f.a)(OI),vI=Object(a.memo)((function(e){var t,n=e.loading,r=void 0!==n&&n,i=e.filters,o=void 0===i?[]:i,c=e.options,d=void 0===c?[]:c,u=e.inputPlaceholder,m=void 0===u?"":u,h=e.size,p=e.onChange,b=Object(q.a)(e,["loading","filters","options","inputPlaceholder","size","onChange"]),f=xI({size:h}),j=Object(a.useState)(!1),g=Object(l.a)(j,2),O=g[0],x=g[1],v=(t={},Object(z.a)(t,f.input,!0),Object(z.a)(t,f.inputWithPopup,O),t),y=function(e){return p(e)};return Object(Me.jsx)(Ba.a,Object(s.a)({loading:r,classes:{option:f.autocomplete},value:o,options:d,getOptionLabel:function(e){return e.value},renderOption:function(e){return Object(Me.jsxs)("div",{className:f.item,children:[Object(Me.jsx)(Xe,{className:f.itemLabel,children:e.value}),Object(Me.jsx)(Xe,{className:f.itemType,children:e.type})]})},autoHighlight:!0,disableClearable:!0,clearOnEscape:!0,multiple:!0,filterSelectedOptions:!0,getOptionSelected:function(e,t){return e.type===t.type},PaperComponent:function(e){var t=e.children;return Object(Me.jsxs)(Un.a,{elevation:0,className:f.popup,children:[Object(Me.jsx)("div",{className:f.separator}),t]})},renderInput:function(e){return Object(Me.jsx)(hI.a,Object(s.a)(Object(s.a)({ref:e.InputProps.ref},e),{},{className:I()(v),startAdornment:Object(Me.jsx)(DC,{className:f.iconButton}),placeholder:m,inputProps:Object(s.a)({className:f.bold,classes:{root:f.size}},e.inputProps)}))},onOpen:function(){return x(!0)},onClose:function(){return x(!1)},onChange:function(e,t){return y(t)}},b))}));function yI(){return(yI=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function wI(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var CI=a.createElement("g",{id:"icon/button/filter/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("path",{d:"M0.6,-3.33066907e-16 L0.509218076,0.00652107669 C0.068925647,0.0708166555 -0.160361948,0.596737342 0.124968515,0.966531156 L4.166,6.204 L4.16660432,9.6 C4.16660432,9.79162756 4.25813682,9.97172829 4.41293455,10.0846831 L6.8797259,11.8846831 L6.96095139,11.9350192 C7.34801849,12.1353088 7.83339568,11.8580867 7.83339568,11.4 L7.833,6.204 L11.8750315,0.966531156 C12.179384,0.572084421 11.8982155,-3.33066907e-16 11.4,-3.33066907e-16 L0.6,-3.33066907e-16 Z M10.179,1.199 L6.75836419,5.63346884 L6.70465653,5.71638775 C6.65811535,5.80315577 6.63339568,5.90052663 6.63339568,6 L6.633,10.219 L5.366,9.294 L5.36660432,6 L5.35847177,5.90154229 C5.34231401,5.80441508 5.30240262,5.71222382 5.24163581,5.63346884 L1.82,1.199 L10.179,1.199 Z",id:"Path",fill:"#FFFFFF",fillRule:"nonzero"}));function kI(e,t){var n=e.title,r=e.titleId,i=wI(e,["title","titleId"]);return a.createElement("svg",yI({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":r},i),void 0===n?a.createElement("title",{id:r},"icon/button/filter/white"):n?a.createElement("title",{id:r},n):null,CI)}var EI=a.forwardRef(kI);n.p;function NI(){return(NI=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function SI(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var II=a.createElement("g",{id:"icon/button/filter/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("path",{d:"M0.6,-4.56301663e-14 L0.509218076,0.00652107669 C0.068925647,0.0708166555 -0.160361948,0.596737342 0.124968515,0.966531156 L4.166,6.204 L4.16660432,9.6 C4.16660432,9.79162756 4.25813682,9.97172829 4.41293455,10.0846831 L6.8797259,11.8846831 L6.96095139,11.9350192 C7.34801849,12.1353088 7.83339568,11.8580867 7.83339568,11.4 L7.833,6.204 L11.8750315,0.966531156 C12.179384,0.572084421 11.8982155,-4.56301663e-14 11.4,-4.56301663e-14 L0.6,-4.56301663e-14 Z M10.179,1.199 L6.75836419,5.63346884 L6.70465653,5.71638775 C6.65811535,5.80315577 6.63339568,5.90052663 6.63339568,6 L6.633,10.219 L5.366,9.294 L5.36660432,6 L5.35847177,5.90154229 C5.34231401,5.80441508 5.30240262,5.71222382 5.24163581,5.63346884 L1.82,1.199 L10.179,1.199 Z",id:"Path",fill:"#1B2559",fillRule:"nonzero"}));function FI(e,t){var n=e.title,r=e.titleId,i=SI(e,["title","titleId"]);return a.createElement("svg",NI({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":r},i),void 0===n?a.createElement("title",{id:r},"icon/button/filter/zodiac"):n?a.createElement("title",{id:r},n):null,II)}var LI,PI,DI,RI=a.forwardRef(FI),BI=(n.p,{root:{marginLeft:0,height:20,backgroundColor:G,"&:hover, &:focus, &:active":{backgroundColor:G},marginBottom:"auto"},label:{fontSize:ye,fontWeight:Ee,fontFamily:Ne,paddingRight:0,paddingLeft:8,color:J}}),TI={button:{width:8,height:8,marginLeft:8,marginRight:8},text:{marginTop:0,marginBottom:0},filters:{display:"flex",marginBottom:16},deleteWrapper:{display:"flex",marginLeft:"auto",justifyContent:"flex-end",flexDirection:"row"},entries:{color:se,margin:"auto",marginRight:12},chips:{marginTop:"auto"}},AI=Object(f.a)(BI),MI=Object(f.a)(TI),WI=function(e){var t=e.filters,n=e.onFilterDelete,a=e.deleteAllFilters,r=e.entries,i=AI(),o=MI();return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Xe,{className:o.text,children:"Filters:"}),Object(Me.jsxs)("div",{className:o.filters,children:[Object(Me.jsx)("div",{className:o.chips,children:t.map((function(e,t){return Object(Me.jsx)(zr,{classes:i,label:"".concat(Dm(e.type),": ").concat(e.value),onDelete:function(){return n(e)},deleteIcon:Object(Me.jsx)(Bi,{className:o.button})},t)}))}),Object(Me.jsxs)("div",{className:o.deleteWrapper,children:[Object(Me.jsx)(nt,{className:o.entries,children:"".concat(null!==r&&void 0!==r?r:0," entries")}),Object(Me.jsx)(ze,{color:"secondary",Icon:RI,InverseIcon:EI,className:o.deleteButton,onClick:a,children:"Delete filters"})]})]})]})},zI=Object(f.a)(Xk),qI=function(e){var t=e.data,n=e.locale,a=e.onClick,r=e.loading,i=zI(),o=[{header:"Phone",width:175,view:function(e){return Sk(e.phone,n.country)}},{header:"Name",width:247,view:Ik},{header:"Total TXs",width:130,textAlign:"right",view:function(e){return"".concat(Number.parseInt(e.totalTxs))}},{header:"Total spent",width:155,textAlign:"right",view:function(e){var t;return"".concat(Number.parseFloat(e.totalSpent)," ").concat(null!==(t=e.lastTxFiatCode)&&void 0!==t?t:"")}},{header:"Last active",width:137,view:function(e){var t;return null!==(t=e.lastActive&&Object(ed.a)("yyyy-MM-dd",new Date(e.lastActive)))&&void 0!==t?t:""}},{header:"Last transaction",width:165,textAlign:"right",view:function(e){var t,n=!D.a(e.lastTxFiatCode),a="cashOut"===e.lastTxClass?Bc:Sc,r=Object(Me.jsx)(a,{className:i.txClassIconRight});return Object(Me.jsxs)(Me.Fragment,{children:[n&&"".concat(parseFloat(e.lastTxFiat)," ").concat(null!==(t=e.lastTxFiatCode)&&void 0!==t?t:""),n&&r]})}},{header:"Status",width:191,view:function(e){return Object(Me.jsx)(ku,{statuses:[Nk(e)]})}}];return Object(Me.jsx)(Me.Fragment,{children:Object(Me.jsx)(gy,{loading:r,emptyText:"No customers so far",elements:o,data:t,onClick:a})})},$I=x()(LI||(LI=Object(c.a)(["\n query filters {\n customerFilters {\n type\n value\n }\n }\n"]))),HI=x()(PI||(PI=Object(c.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"]))),VI=Object(f.a)(uf),UI=function(){var e,t=VI(),n=Object(w.h)(),r=Object(a.useState)([]),i=Object(l.a)(r,2),o=i[0],c=i[1],s=Object(a.useState)({}),d=Object(l.a)(s,2),m=d[0],h=d[1],p=Object(a.useState)([]),b=Object(l.a)(p,2),f=b[0],j=b[1],g=Object(u.c)(HI,{variables:m,onCompleted:function(e){return c(A.a(["customers"])(e))}}),O=g.data,x=g.loading,v=g.refetch,y=Object(u.c)($I),C=y.data,k=y.loading,E=null!==(e=A.a(["config"])(O))&&void 0!==e?e:[],N=E&&rs(Zc,E),S=lm.a([Ew.a(B.a("lastActive"))])(null!==o&&void 0!==o?o:[]),I=A.a(["customerFilters"])(C);return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(nl,{title:"Customers",appendix:Object(Me.jsx)("div",{children:Object(Me.jsx)(vI,{loading:k,filters:f,options:I,inputPlaceholder:"Search customers",onChange:function(e){var t=L.a(DO.a,R.a((function(e){return Object(z.a)({},e.type,e.value)})))(e);j(e),h({phone:t.phone,name:t.name,address:t.address,id:t.id}),v&&v()}})}),appendixClassName:t.buttonsWrapper,labels:[{label:"Cash-in",icon:Object(Me.jsx)(Sc,{})},{label:"Cash-out",icon:Object(Me.jsx)(Bc,{})}]}),f.length>0&&Object(Me.jsx)(WI,{filters:f,onFilterDelete:function(e){return j(M.a((function(t){return!mI.a(Mm.a(["type","value"],t),e)}))(f))},setFilters:j}),Object(Me.jsx)(qI,{data:S,locale:N,onClick:function(e){return n.push("/compliance/customer/".concat(e.id))},loading:x})]})},GI=n(790),XI=Object(GI.a)({wrapper:{display:"flex",alignItems:"center"},colorIndicator:{borderRadius:3,height:12,width:12,marginRight:8}}),_I=function(e){var t=e.className,n=e.label,a=e.color,r=Object(q.a)(e,["className","label","color"]),i=XI();return Object(Me.jsxs)("div",Object(s.a)(Object(s.a)({className:I()(i.wrapper,t)},r),{},{children:[a&&Object(Me.jsx)("div",{className:i.colorIndicator,style:{backgroundColor:a}}),Object(Me.jsx)(et,Object(s.a)(Object(s.a)({},r),{},{children:n}))]}))},ZI=Be.label1,KI=Be.mono,QI={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:re},address:{width:375,margin:"".concat(12,"px ").concat(24,"px")},itemWrapper:{textAlign:"end"},item:{extend:ZI,margin:2},inactiveItem:{color:$},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:le},copyToClipboard:{marginLeft:"auto",paddingTop:6,paddingLeft:15,marginRight:-11},mono:{extend:KI,width:375,margin:"".concat(12,"px ").concat(24,"px")}},YI=Object(f.a)(QI),JI=165,eF=140,tF=130,nF=x()(DI||(DI=Object(c.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"]))),aF=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return yf.utils.formatCryptoAddress(e,t).replace(/(.{4})/g,"$1 ")},rF=function(e,t){return e.plus(t)},iF=function(e){return new Mc.a(e).toFormat(2)},oF=function(e){return iF(e.filter((function(e){return!e.errorMsg})).map((function(e){return new Mc.a(e.fiatConfirmedBalance)})).reduce(rF,new Mc.a(0)))},lF=function(){var e,t=Object(a.useState)(null),n=Object(l.a)(t,2),r=n[0],i=n[1],o=Object(a.useState)(!1),c=Object(l.a)(o,1)[0],s=YI(),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)(nF),h=m.data,p=m.loading,b=null!==(e=A.a(["funding"])(h))&&void 0!==e?e:[];b.length&&!r&&i(b[0]);var f=iF(b.filter((function(e){return!e.errorMsg})).map((function(e){return new Mc.a(e.fiatPending)})).reduce(rF,new Mc.a(0))),j=function(e){return e>=0?"+":""};return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)("div",{children:Object(Me.jsx)(yn,{children:"Funding"})}),Object(Me.jsxs)("div",{className:s.wrapper,children:[Object(Me.jsx)(yi,{data:b,isSelected:function(e){return r&&r.cryptoCode===e.cryptoCode},onClick:i,displayName:function(e){return e.display},itemRender:function(e,t){var n,a,r=(n={},Object(z.a)(n,s.item,!0),Object(z.a)(n,s.inactiveItem,!t),n),i=(a={},Object(z.a)(a,s.itemWrapper,!0),Object(z.a)(a,s.error,e.errorMsg),a);return Object(Me.jsxs)("div",{className:I()(i),children:[Object(Me.jsx)("div",{className:s.firstItem,children:e.display}),!e.errorMsg&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)("div",{className:I()(r),children:[iF(e.fiatConfirmedBalance)," ",e.fiatCode]}),Object(Me.jsxs)("div",{className:I()(r),children:[e.confirmedBalance," ",e.cryptoCode]})]})]})},loading:p,children:b.length&&Object(Me.jsxs)("div",{className:s.total,children:[Object(Me.jsx)(et,{className:s.totalTitle,children:"Total Crypto Balance"}),Object(Me.jsxs)(_e,{noMargin:!0,children:[oF(b),b[0].fiatCode]}),Object(Me.jsxs)(et,{className:s.totalPending,children:["(",j(f)," ",f," pending)"]})]})}),r&&!c&&r.errorMsg&&Object(Me.jsx)("div",{className:s.main,children:Object(Me.jsx)("div",{className:s.firstSide,children:Object(Me.jsx)(Ke,{className:s.error,children:r.errorMsg})})}),r&&!c&&!r.errorMsg&&Object(Me.jsxs)("div",{className:s.main,children:[Object(Me.jsxs)("div",{className:s.firstSide,children:[Object(Me.jsxs)(Ve,{children:["Balance (",r.display,")"]}),Object(Me.jsxs)("div",{className:s.coinTotal,children:[Object(Me.jsx)(_e,{inline:!0,noMargin:!0,children:"".concat(r.confirmedBalance," ").concat(r.cryptoCode)}),Object(Me.jsx)(Ze,{inline:!0,noMargin:!0,className:s.leftSpacer,children:"(".concat(j(r.pending)," ").concat(r.pending," pending)")})]}),Object(Me.jsxs)("div",{className:s.coinTotal,children:[Object(Me.jsx)(Ke,{inline:!0,noMargin:!0,children:"= ".concat(iF(r.fiatConfirmedBalance)," ").concat(r.fiatCode)}),Object(Me.jsx)(nt,{inline:!0,noMargin:!0,className:s.leftSpacer,children:"(".concat(j(r.fiatPending)," ").concat(iF(r.fiatPending)," pending)")})]}),Object(Me.jsx)(Ve,{className:s.topSpacer,children:"Address"}),Object(Me.jsx)("div",{className:s.addressWrapper,children:Object(Me.jsx)("div",{className:s.mono,children:Object(Me.jsx)("strong",{children:Object(Me.jsx)(gf,{buttonClassname:s.copyToClipboard,children:aF(r.cryptoCode,r.fundingAddress)})})})})]}),Object(Me.jsxs)("div",{className:s.secondSide,children:[Object(Me.jsxs)(et,{children:["Scan to send ",r.display]}),Object(Me.jsx)(jn.a,{size:240,fgColor:J,value:r.fundingAddressUrl})]})]}),r&&c&&Object(Me.jsxs)("div",{children:[Object(Me.jsx)(_I,{className:s.tableLabel,label:"Pending",color:"#cacaca"}),Object(Me.jsxs)(jm,{className:s.table,children:[Object(Me.jsxs)(gm,{children:[Object(Me.jsx)(vm,{header:!0,width:JI,children:"Amount Entered"}),Object(Me.jsx)(vm,{header:!0,width:JI,children:"Balance After"}),Object(Me.jsx)(vm,{header:!0,width:JI,children:"Cash Value"}),Object(Me.jsx)(vm,{header:!0,width:tF,children:"Date"}),Object(Me.jsx)(vm,{header:!0,width:eF,children:"Time (h:m:s)"}),Object(Me.jsx)(vm,{header:!0,width:JI,children:"Performed By"})]}),Object(Me.jsx)(xm,{children:d.map((function(e,t){return Object(Me.jsxs)(Cm,{className:I()(Object(z.a)({},s.pending,e.pending)),children:[Object(Me.jsxs)(vm,{width:JI,children:[e.cryptoAmount," ",r.cryptoCode]}),Object(Me.jsxs)(vm,{width:JI,children:[e.balance," ",r.cryptoCode]}),Object(Me.jsxs)(vm,{width:JI,children:[e.fiatValue," ",r.fiatCode]}),Object(Me.jsx)(vm,{width:tF,children:Object(ed.a)("yyyy-MM-dd",e.date)}),Object(Me.jsx)(vm,{width:eF,children:Object(ed.a)("hh:mm:ss",e.date)}),Object(Me.jsx)(vm,{width:JI,children:"add"})]},t)}))})]})]})]})]})};function cF(){return(cF=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function sF(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var dF=a.createElement("circle",{cx:52,cy:32,r:32,fill:"#F7931A"}),uF=a.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 mF(e,t){var n=e.title,r=e.titleId,i=sF(e,["title","titleId"]);return a.createElement("svg",cF({xmlns:"http://www.w3.org/2000/svg",width:104,height:64,ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,dF,uF)}var hF=a.forwardRef(mF);n.p;function pF(){return(pF=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function bF(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var fF=a.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"}),jF=a.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 gF(e,t){var n=e.title,r=e.titleId,i=bF(e,["title","titleId"]);return a.createElement("svg",pF({xmlns:"http://www.w3.org/2000/svg",width:104,height:64,ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,fF,jF)}var OF=a.forwardRef(gF);n.p;function xF(){return(xF=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function vF(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var yF=a.createElement("circle",{cx:1e3,cy:1e3,r:1e3,fill:"#2573c2"}),wF=a.createElement("g",{fill:"#fff"},a.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"}),a.createElement("path",{d:"M882.2 911.6H409l-63.6 176.2h478z"}));function CF(e,t){var n=e.title,r=e.titleId,i=vF(e,["title","titleId"]);return a.createElement("svg",xF({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2000 2000",width:2500,height:2500,ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,yF,wF)}var kF=a.forwardRef(CF);n.p;function EF(){return(EF=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function NF(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var SF=a.createElement("g",null,a.createElement("polygon",{fill:"#343434",points:"127.9611 0 125.1661 9.5 125.1661 285.168 127.9611 287.958 255.9231 212.32"}),a.createElement("polygon",{fill:"#8C8C8C",points:"127.962 0 0 212.32 127.962 287.959 127.962 154.158"}),a.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"}),a.createElement("polygon",{fill:"#8C8C8C",points:"127.962 416.9052 127.962 312.1852 0 236.5852"}),a.createElement("polygon",{fill:"#141414",points:"127.9611 287.9577 255.9211 212.3207 127.9611 154.1587"}),a.createElement("polygon",{fill:"#393939",points:"0.0009 212.3208 127.9609 287.9578 127.9609 154.1588"}));function IF(e,t){var n=e.title,r=e.titleId,i=NF(e,["title","titleId"]);return a.createElement("svg",EF({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":r},i),n?a.createElement("title",{id:r},n):null,SF)}var FF=a.forwardRef(IF);n.p;function LF(){return(LF=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function PF(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var DF=a.createElement("circle",{fill:"#989898",cx:52,cy:32,r:32}),RF=a.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 BF(e,t){var n=e.title,r=e.titleId,i=PF(e,["title","titleId"]);return a.createElement("svg",LF({xmlns:"http://www.w3.org/2000/svg",width:104,height:64,ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,DF,RF)}var TF=a.forwardRef(BF);n.p;function AF(){return(AF=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function MF(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var WF=a.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"}),zF=a.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 qF(e,t){var n=e.title,r=e.titleId,i=MF(e,["title","titleId"]);return a.createElement("svg",AF({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2000 2000",width:2500,height:2500,ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,WF,zF)}var $F=a.forwardRef(qF);n.p;function HF(){return(HF=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function VF(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var UF=a.createElement("style",{type:"text/css"},"\n\t.st0{fill:#231F20;}\n\t.st1{fill:#F4B728;}\n"),GF=a.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"}),XF=a.createElement("circle",{className:"st1",cx:245.4,cy:245.4,r:177.6}),_F=a.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 ZF(e,t){var n=e.title,r=e.titleId,i=VF(e,["title","titleId"]);return a.createElement("svg",HF({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":r},i),UF,void 0===n?a.createElement("title",{id:r},"headerArtboard 7"):n?a.createElement("title",{id:r},n):null,GF,XF,_F)}var KF,QF,YF,JF,eL,tL,nL,aL,rL,iL=a.forwardRef(ZF),oL=(n.p,Object(f.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}})),lL=function(e){var t=e.code,n=e.name,a=e.onContinue,r=oL(),i=function(e){switch(e){case"BTC":return hF;case"BCH":return OF;case"DASH":return kF;case"ETH":return FF;case"LTC":return TF;case"ZEC":return iL;case"USDT":return $F;default:return null}}(t);return Object(Me.jsxs)("div",{className:r.modalContent,children:[Object(Me.jsx)(i,{className:r.logo}),Object(Me.jsxs)($e,{className:r.title,children:["Enable ",n]}),Object(Me.jsxs)(Xe,{className:r.text,children:["You are about to enable ",n," on your system. This will allow you to use this cryptocurrency on your machines. To be able to do that, you\u2019ll have to set up all the necessary 3rd party services."]}),Object(Me.jsx)(An,{className:r.button,onClick:a,children:"Start configuration"})]})},cL={title:{margin:[[0,0,12,0]]},subtitle:{margin:[[32,0,21,0]]},error:{color:me},button:{marginLeft:"auto"},submit:{display:"flex",flexDirection:"row",margin:[["auto",0,24]]},radioGroup:{flexDirection:"row"},radioLabel:{width:150,height:48},radio:{padding:4,margin:4},setupNew:{display:"flex",alignItems:"center",height:48},picker:{width:150},horizontalAlign:{display:"flex",flexDirection:"row"},centerAlignment:{alignItems:"center"},zeroConfLimit:{marginRight:5,"& > div":{fontSize:je,fontFamily:be,fontWeight:300,"& > input":{padding:[[6,0,2]]}}}},sL=Object(f.a)(cL),dL={form:null,selected:null,isNew:!1,iError:!1},uL=function(e,t){switch(t.type){case"select":return{form:null,selected:t.selected,isNew:null,iError:!1};case"new":return{form:e.form,selected:null,isNew:!0,iError:!1};case"form":return{form:t.form,selected:t.form.code,isNew:!0,iError:!1};case"error":return Gn.a(e,{innerError:!0});case"reset":return dL;default:throw new Error}},mL=function(e){var t,n=e.type,r=e.schema,i=e.coin,o=e.name,c=e.step,s=e.error,d=e.lastStep,u=e.onContinue,m=e.fiatCurrency,h=e.filled,p=e.unfilled,b=e.getValue,f=sL(),j=Object(a.useReducer)(uL,dL),g=Object(l.a)(j,2),O=g[0],x=O.innerError,v=O.selected,y=O.form,w=O.isNew,C=g[1];Object(a.useEffect)((function(){C({type:"reset"})}),[c]);var k=function(e,t){if(!e||!e[n])return C({type:"error"});u(e,t)},E=d?"Finish":"Next",N=null!==o&&void 0!==o?o:n,S=(t={},Object(z.a)(t,f.subtitle,!0),Object(z.a)(t,f.error,x),t);return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Ze,{className:f.title,children:Bm(N)}),Object(Me.jsx)(rp,{steps:5,currentStep:c}),Object(Me.jsx)(Ue,{className:I()(S),children:c<4?"Select a ".concat(N," or set up a new one"):"Select ".concat(N," for ").concat(i)}),5!==c&&Object(Me.jsx)(Er,{options:h,value:v,className:f.radioGroup,onChange:function(e,t){C({type:"select",selected:t})},labelClassName:f.radioLabel,radioClassName:f.radio}),5===c&&Object(Me.jsx)(bn.e,{validateOnBlur:!1,validateOnChange:!0,initialValues:{zeroConfLimit:""},enableReinitialize:!0,validationSchema:r,children:function(e){e.values;var t=e.setFieldValue;return Object(Me.jsx)(bn.d,{children:Object(Me.jsxs)("div",{className:I()(f.horizontalAlign,f.lineAlignment),children:[Object(Me.jsx)(bn.b,{component:ei,decimalPlaces:0,width:50,placeholder:"0",name:"zeroConfLimit",onChange:function(e){C({type:"select",selected:e.target.value}),t(e.target.id,e.target.value)},className:f.zeroConfLimit}),Object(Me.jsx)(Ze,{children:m})]})})}}),Object(Me.jsxs)("div",{className:f.setupNew,children:[!Wa.a(p)&&!D.a(p)&&Object(Me.jsx)(Er,{value:w,onChange:function(e,t){C({type:"new"})},labelClassName:f.radioLabel,radioClassName:f.radio,options:[{display:"Set up new",code:!0}]}),w&&Object(Me.jsx)(_a,{fullWidth:!0,label:"Select ".concat(N),className:f.picker,getOptionSelected:qa.a("code"),labelProp:"display",options:p,onChange:function(e,t){C({type:"form",form:t})}})]}),y&&Object(Me.jsx)(BO,{save:function(e){return k(Object(z.a)({},n,y.code),Object(z.a)({},y.code,e))},elements:gx[y.code].elements,validationSchema:gx[y.code].validationSchema,value:b(y.code),buttonLabel:E}),!y&&Object(Me.jsxs)("div",{className:f.submit,children:[s&&Object(Me.jsx)(Jo,{children:"Failed to save"}),Object(Me.jsx)(An,{className:f.button,onClick:function(){return k(Object(z.a)({},n,v))},children:E})]})]})},hL=function(e,t){return M.a((function(n){return function(e){return W.a("class",e)}(t)(n)&&function(e){return L.a(ul.a(e),B.a("cryptos"))}(e)(n)}))},pL=M.a((function(e){return!e.deprecated})),bL=function(e,t,n,a){var r=pL(hL(a,n)(e)),i=ps.a((function(e){var n=e.code,a=function(e){return t&&t[e]}(n);return!gx[n]||(0,gx[n].getValidationSchema)(a).isValidSync(a)}))(r),o=Object(l.a)(i,2);return{filled:o[0],unfilled:o[1]}},fL=function(e){var t=e.coin,n=e.onClose,r=e.accountsConfig,i=e.accounts,o=e.fiatCurrency,c=e.save,d=e.error,u=Object(a.useState)({step:0,config:{active:!0},accountsToSave:{}}),m=Object(l.a)(u,2),h=m[0],p=h.step,b=h.config,f=h.accountsToSave,j=m[1],g="Enable ".concat(t.display),O=5===p,x={filled:hL(t.code,"ticker")(r)},v=bL(r,i,"wallet",t.code),y=bL(r,i,"exchange",t.code),w=bL(r,i,"zeroConf",t.code),C=function(){var e=Object(Pl.a)(Ll.a.mark((function e(n,a){var r,i,o,l;return Ll.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=Gn.a(b,n),i=a?Gn.a(f,a):f,!O){e.next=6;break}return o=kf.a(Wc.a(yf.utils.getCryptoCurrency(t.code).units)),l=Object(s.a)(Object(s.a)({},r),{},{cryptoUnits:o}),e.abrupt("return",c(is(t.code,l),i));case 6:j({step:p+1,config:r,accountsToSave:i});case 7:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();return Object(Me.jsxs)(Mh,{title:0===p?null:g,handleClose:n,width:554,open:!0,children:[0===p&&Object(Me.jsx)(lL,{code:t.code,name:t.display,onContinue:function(){return C()}}),0!==p&&Object(Me.jsx)(mL,Object(s.a)(Object(s.a)({step:p,coin:t.display,fiatCurrency:o,error:d,lastStep:O},function(){switch(p){case 1:return Object(s.a)({type:"ticker"},x);case 2:return Object(s.a)({type:"wallet"},v);case 3:return Object(s.a)({type:"exchange"},y);case 4:return Object(s.a)({type:"zeroConf",name:"confidence checking",schema:xn.f().shape({zeroConfLimit:xn.e().required()})},w);case 5:return Object(s.a)({type:"zeroConfLimit",name:"0-conf limit"},w);default:return null}}()),{},{onContinue:C,getValue:function(e){return Aa.a(W.a("code",e))(i)}}))]})},jL=Object(f.a)({rightAligned:{marginTop:"20px",marginLeft:"auto",marginBottom:"20px"},rightLink:{marginLeft:"20px"}}),gL=x()(KF||(KF=Object(c.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"]))),OL=x()(QF||(QF=Object(c.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),xL=function(e){var t=e.open,n=e.close,a=e.save,r=jL();return Object(Me.jsxs)(Mh,{title:"Change fiat currency?",handleClose:n,width:450,height:310,open:t,children:[Object(Me.jsx)(Xe,{children:"Please note that all values you set that were based on your prior fiat currency are still the same. If you need to adjust these to reflect the new fiat currency (such as minimum transaction amounts, fixed fees, and compliance triggers, for example), please do so now."}),Object(Me.jsx)(Xe,{children:"Also, if you have cash-out enabled, you must define new dispenser bill counts for the new currency for cash-out on the new currency to work."}),Object(Me.jsxs)("div",{className:r.rightAligned,children:[Object(Me.jsx)(oa,{onClick:n,color:"secondary",children:"Cancel"}),Object(Me.jsx)(oa,{className:r.rightLink,onClick:a,color:"primary",children:"Save"})]})]})},vL=function(e){var t,n,r,i,o,c,s=e.name,d=Object(a.useState)(!1),m=Object(l.a)(d,2),h=m[0],p=m[1],b=Object(a.useState)(null),f=Object(l.a)(b,2),j=f[0],g=f[1],O=Object(a.useState)(null),x=Object(l.a)(O,2),v=x[0],y=x[1],w=Object(a.useState)(!1),C=Object(l.a)(w,2),k=C[0],E=C[1],N=Object(a.useState)(!1),S=Object(l.a)(N,2),I=S[0],F=S[1],P=Object(u.c)(gL).data,D=Object(u.b)(OL,{onCompleted:function(){return p(!1)},refetchQueries:function(){return["getData"]},onError:function(e){return y(e)}}),R=Object(l.a)(D,1)[0],B=Object(a.useState)(null),T=Object(l.a)(B,2),A=T[0],M=T[1],z=(null===P||void 0===P?void 0:P.config)&&rs(s)(P.config),q=(null===P||void 0===P?void 0:P.config)&&rs(Gc)(P.config),$=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=z&&!Wa.a(z)?z:iO,G=null!==(r=U.overrides)&&void 0!==r?r:[],X=function(e){return M(null),R({variables:{config:e}})},_=function(e,t,n){var a=Cg.a(t,e)[0];if(!a)return n(t);var r=rs(a)(q);if(!dO.isValidSync(r))return g((function(){return function(){return n(t)}})),void p(a);n(t)};return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(xL,{open:A,close:function(){return M(null)},save:function(){return A&&X(A)}}),Object(Me.jsx)(nl,{title:"Locales"}),Object(Me.jsx)(jO,{children:Object(Me.jsx)(Rh,{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=is(s)(e.locale[0]);return z.fiatCurrency&&t.locale_fiatCurrency!==z.fiatCurrency?M(t):X(t)},validationSchema:aO,data:mw.a(U),elements:tO(P,_),setEditing:function(e,t){return E(t)},forceDisable:I})}),Object(Me.jsx)(jO,{children:Object(Me.jsx)(Rh,{error:null===v||void 0===v?void 0:v.message,title:"Overrides",titleLg:!0,name:"overrides",enableDelete:!0,enableEdit:!0,enableCreate:!0,initialValues:oO,save:function(e){var t=is(s)(e);return y(null),R({variables:{config:t}})},validationSchema:rO,data:null!==G&&void 0!==G?G:[],elements:nO(P,G,_),disableAdd:L.a(Wa.a,Cg.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===G||void 0===G?void 0:G.map((function(e){return e.machine})))&&void 0!==o?o:[]),setEditing:function(e,t){return F(t)},forceDisable:k})}),h&&Object(Me.jsx)(fL,{coin:Aa.a(W.a("code",h))(V),onClose:function(){return p(!1)},save:function(e){return X(is(Gc)(e)).then((function(e){return j(),g(null),e}))},error:null===v||void 0===v?void 0:v.message,cryptoCurrencies:V,userAccounts:null===P||void 0===P||null===(c=P.config)||void 0===c?void 0:c.accounts,accounts:H,accountsConfig:$})]})},yL={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}},wL=Object(f.a)(yL),CL={customer:"",discount:""},kL=xn.f().shape({customer:xn.h().required("A customer is required!"),discount:xn.e().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%!")}),EL=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},NL=function(e){var t=e.showModal,n=e.setShowModal,a=e.onClose,r=e.creationError,i=e.addDiscount,o=e.customers,l=wL();return Object(Me.jsx)(Me.Fragment,{children:t&&Object(Me.jsx)(Mh,{title:"Add individual customer discount",closeOnBackdropClick:!0,width:600,height:500,handleClose:a,open:!0,children:Object(Me.jsx)(bn.e,{validateOnBlur:!1,validateOnChange:!1,initialValues:CL,validationSchema:kL,onSubmit:function(e){!function(e,t){i({variables:{customerId:e,discount:parseInt(t)}}),n(!1)}(e.customer,e.discount)},children:function(e){var t=e.errors,n=e.touched;return Object(Me.jsxs)(bn.d,{id:"individual-discount-form",className:l.form,children:[Object(Me.jsx)("div",{className:l.customerAutocomplete,children:Object(Me.jsx)(bn.b,{name:"customer",label:"Select a customer",component:Tr,fullWidth:!0,options:R.a((function(e){var t,n,a,r,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===(a=e.idCardData)||void 0===a?void 0:a.firstName)&&(null===e||void 0===e||null===(r=e.idCardData)||void 0===r?void 0:r.lastName)?" ":"").concat(null!==(i=null===e||void 0===e||null===(o=e.idCardData)||void 0===o?void 0:o.lastName)&&void 0!==i?i:""," (").concat(e.phone,")")}}))(o),labelProp:"display",valueProp:"code"})}),Object(Me.jsxs)("div",{children:[Object(Me.jsxs)("div",{className:l.discountRateWrapper,children:[Object(Me.jsx)(Ve,{children:"Define discount rate"}),Object(Me.jsxs)(fp,{width:304,children:[Object(Me.jsx)(Xe,{children:"This is a percentage discount off of your existing commission rates for a customer entering this code at the machine."}),Object(Me.jsx)(Xe,{children:"For instance, if you charge 8% commissions, and this code is set for 50%, then you'll instead be charging 4% on transactions using the code."})]})]}),Object(Me.jsxs)("div",{className:l.discountInput,children:[Object(Me.jsx)(bn.b,{name:"discount",size:"lg",autoComplete:"off",width:50,decimalScale:0,className:l.discountInputField,component:ei}),Object(Me.jsx)(Ye,{inline:!0,className:l.inputLabel,children:"%"})]})]}),Object(Me.jsxs)("div",{className:l.footer,children:[EL(t,n,r)&&Object(Me.jsx)(Jo,{children:EL(t,n,r)}),Object(Me.jsx)(An,{type:"submit",form:"individual-discount-form",className:l.submit,children:"Add discount"})]})]})}})})})},SL=Object(f.a)(yL),IL=x()(YF||(YF=Object(c.a)(["\n query individualDiscounts {\n individualDiscounts {\n id\n customerId\n discount\n }\n }\n"]))),FL=x()(JF||(JF=Object(c.a)(["\n mutation deleteIndividualDiscount($discountId: ID!) {\n deleteIndividualDiscount(discountId: $discountId) {\n id\n }\n }\n"]))),LL=x()(eL||(eL=Object(c.a)(["\n mutation createIndividualDiscount($customerId: ID!, $discount: Int!) {\n createIndividualDiscount(customerId: $customerId, discount: $discount) {\n id\n }\n }\n"]))),PL=x()(tL||(tL=Object(c.a)(["\n {\n customers {\n id\n phone\n idCardData\n phone\n }\n }\n"]))),DL=function(){var e=SL(),t=Object(a.useState)(!1),n=Object(l.a)(t,2),r=n[0],i=n[1],o=Object(a.useState)(),c=Object(l.a)(o,2),s=c[0],d=c[1],m=Object(a.useState)(""),h=Object(l.a)(m,2),p=h[0],b=h[1],f=Object(a.useState)(!1),j=Object(l.a)(f,2),g=j[0],O=j[1],x=function(){return O(!g)},v=Object(u.c)(IL),y=v.data,w=v.loading,C=Object(u.c)(PL),k=C.data,E=C.loading,N=Object(u.b)(LL,{refetchQueries:function(){return["individualDiscounts"]}}),S=Object(l.a)(N,2),I=S[0],F=S[1].error,L=function(e){var t=A.a(["customers"])(k);return Aa.a(W.a("id",e))(t)},P=Object(u.b)(FL,{onError:function(e){var t=e.message;b(null!==t&&void 0!==t?t:"Error while deleting row")},onCompleted:function(){return i(!1)},refetchQueries:function(){return["individualDiscounts"]}}),R=Object(l.a)(P,1)[0],B=[{header:"Identification",width:312,textAlign:"left",size:"sm",view:function(t){var n,a,r=L(t.customerId);return Object(Me.jsxs)("div",{className:e.identification,children:[Object(Me.jsx)(Kf,{}),Object(Me.jsx)("span",{children:r.phone}),(null===r||void 0===r||null===(n=r.idCardData)||void 0===n?void 0:n.documentNumber)&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(zf,{}),Object(Me.jsx)("span",{children:null===r||void 0===r||null===(a=r.idCardData)||void 0===a?void 0:a.documentNumber})]})]})}},{header:"Name",width:300,textAlign:"left",size:"sm",view:function(e){var t,n,a=L(e.customerId);return D.a(a.idCardData)?Object(Me.jsx)(Me.Fragment,{children:"-"}):Object(Me.jsx)(Me.Fragment,{children:"".concat(null!==(t=a.idCardData.firstName)&&void 0!==t?t:"").concat(a.idCardData.firstName&&a.idCardData.lastName?" ":"").concat(null!==(n=a.idCardData.lastName)&&void 0!==n?n:"")})}},{header:"Discount rate",width:220,textAlign:"left",size:"sm",view:function(e){return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Ye,{inline:!0,children:e.discount})," %"]})}},{header:"Revoke",width:100,textAlign:"center",size:"sm",view:function(e){return Object(Me.jsx)(ta,{onClick:function(){i(!0),d({variables:{discountId:e.id}})},children:Object(Me.jsx)(hh,{})})}}],T=w||E;return Object(Me.jsxs)(Me.Fragment,{children:[!T&&!Wa.a(y.individualDiscounts)&&Object(Me.jsx)(Ko.a,{marginBottom:4,marginTop:-7,className:e.tableWidth,display:"flex",justifyContent:"flex-end",children:Object(Me.jsx)(oa,{color:"primary",onClick:x,children:"Add new code"})}),!T&&!Wa.a(y.individualDiscounts)&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(gy,{elements:B,data:A.a(["individualDiscounts"])(y)}),Object(Me.jsx)($m,{open:r,onDismissed:function(){i(!1),b(null)},onConfirmed:function(){b(null),R(s)},errorMessage:p})]}),!T&&Wa.a(y.individualDiscounts)&&Object(Me.jsxs)(Ko.a,{display:"flex",alignItems:"left",flexDirection:"column",children:[Object(Me.jsx)(nt,{children:"It seems there are no active individual customer discounts on your network."}),Object(Me.jsx)(An,{onClick:x,children:"Add individual discount"})]}),Object(Me.jsx)(NL,{showModal:g,setShowModal:O,onClose:function(){O(!1)},creationError:F,addDiscount:I,customers:A.a(["customers"])(k)})]})},RL={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:be,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"]]}},BL=Object(f.a)(RL),TL={code:"",discount:""},AL=xn.f().shape({code:xn.h().required().trim().max(25),discount:xn.e().required().min(0).max(100)}),ML=function(e){var t=e.showModal,n=e.onClose,a=e.errorMsg,r=e.addCode,i=BL();return Object(Me.jsx)(Me.Fragment,{children:t&&Object(Me.jsx)(Mh,{title:"Add promo code discount",closeOnBackdropClick:!0,width:600,height:500,handleClose:n,open:!0,children:Object(Me.jsx)(bn.e,{validateOnBlur:!1,validateOnChange:!1,initialValues:TL,validationSchema:AL,onSubmit:function(e){!function(e,t){r(Cf.a(e),parseInt(t))}(e.code,e.discount)},children:Object(Me.jsxs)(bn.d,{id:"promo-form",className:i.form,children:[Object(Me.jsx)(Ve,{className:i.modalLabel1,children:"Promo code name"}),Object(Me.jsx)(bn.b,{name:"code",autoFocus:!0,size:"lg",autoComplete:"off",width:338,inputProps:{style:{textTransform:"uppercase"}},component:ai}),Object(Me.jsxs)("div",{className:i.modalLabel2Wrapper,children:[Object(Me.jsx)(Ve,{className:i.modalLabel2,children:"Define discount rate"}),Object(Me.jsxs)(fp,{width:304,children:[Object(Me.jsx)(Xe,{children:"This is a percentage discount off of your existing commission rates for a customer entering this code at the machine."}),Object(Me.jsx)(Xe,{children:"For instance, if you charge 8% commissions, and this code is set for 50%, then you'll instead be charging 4% on transactions using the code."})]})]}),Object(Me.jsxs)("div",{className:i.discountInput,children:[Object(Me.jsx)(bn.b,{name:"discount",size:"lg",autoComplete:"off",width:50,decimalScale:0,className:i.discountInputField,component:ei}),Object(Me.jsx)(Ye,{inline:!0,className:i.inputLabel,children:"%"})]}),Object(Me.jsxs)("div",{className:i.footer,children:[a&&Object(Me.jsx)(Jo,{children:a}),Object(Me.jsx)(An,{type:"submit",form:"promo-form",className:i.submit,children:"Add code"})]})]})})})})},WL=Object(f.a)(RL),zL="Failed to save",qL=x()(nL||(nL=Object(c.a)(["\n query promoCodes {\n promoCodes {\n id\n code\n discount\n }\n }\n"]))),$L=x()(aL||(aL=Object(c.a)(["\n mutation deletePromoCode($codeId: ID!) {\n deletePromoCode(codeId: $codeId) {\n id\n }\n }\n"]))),HL=x()(rL||(rL=Object(c.a)(["\n mutation createPromoCode($code: String!, $discount: Int!) {\n createPromoCode(code: $code, discount: $discount) {\n id\n code\n discount\n }\n }\n"]))),VL=function(){var e=WL(),t=Object(a.useState)(!1),n=Object(l.a)(t,2),r=n[0],i=n[1],o=Object(a.useState)(),c=Object(l.a)(o,2),s=c[0],d=c[1],m=Object(a.useState)(!1),h=Object(l.a)(m,2),p=h[0],b=h[1],f=Object(a.useState)(null),j=Object(l.a)(f,2),g=j[0],O=j[1],x=function(){return b(!p)},v=Object(u.c)(qL),y=v.data,w=v.loading,C=Object(u.b)($L,{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(l.a)(C,1)[0],E=Object(u.b)(HL,{refetchQueries:function(){return["promoCodes"]}}),N=Object(l.a)(E,1)[0],S=[{header:"Code",width:300,textAlign:"left",size:"sm",view:function(e){return e.code}},{header:"Discount",width:220,textAlign:"left",size:"sm",view:function(e){return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Ye,{inline:!0,children:e.discount})," % in commissions"]})}},{header:"Delete",width:100,textAlign:"center",size:"sm",view:function(e){return Object(Me.jsx)(ta,{onClick:function(){i(!0),d({variables:{codeId:e.id}})},children:Object(Me.jsx)(hh,{})})}}];return Object(Me.jsxs)(Me.Fragment,{children:[!w&&!Wa.a(y.promoCodes)&&Object(Me.jsx)(Ko.a,{marginBottom:4,marginTop:-7,className:e.tableWidth,display:"flex",justifyContent:"flex-end",children:Object(Me.jsx)(oa,{color:"primary",onClick:x,children:"Add new code"})}),!w&&!Wa.a(y.promoCodes)&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(gy,{elements:S,data:A.a(["promoCodes"])(y)}),Object(Me.jsx)($m,{open:r,onDismissed:function(){i(!1),O(null)},onConfirmed:function(){O(null),k(s)},errorMessage:g})]}),!w&&Wa.a(y.promoCodes)&&Object(Me.jsxs)(Ko.a,{display:"flex",alignItems:"left",flexDirection:"column",children:[Object(Me.jsx)(nt,{children:"Currently, there are no active promo codes on your network."}),Object(Me.jsx)(An,{onClick:x,children:"Add Code"})]}),Object(Me.jsx)(ML,{showModal:p,onClose:function(){O(null),b(!1)},errorMsg:g,addCode:function(e,t){O(null),N({variables:{code:e,discount:t}}).then((function(e){if(!e.errors)return b(!1);var t=cl.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!":zL)})).catch((function(e){O(zL),console.log(e)}))}})]})},UL=n(963);function GL(){return(GL=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function XL(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var _L=a.createElement("desc",null,"Created with Sketch."),ZL=a.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"pop-up/action/download-logs/date-range-copy-3",transform:"translate(-117.000000, -116.000000)",stroke:"#1B2559",strokeWidth:2},a.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)"},a.createElement("polyline",{id:"Path-3",points:"0 13.3571429 7.14285714 20.5 14.2857143 13.3571429"}),a.createElement("line",{x1:7.14285714,y1:.142857143,x2:7.14285714,y2:20.1428571,id:"Path-4"}))));function KL(e,t){var n=e.title,r=e.titleId,i=XL(e,["title","titleId"]);return a.createElement("svg",GL({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":r},i),void 0===n?a.createElement("title",{id:r},"arrow download logs"):n?a.createElement("title",{id:r},n):null,_L,ZL)}var QL=a.forwardRef(KL),YL=(n.p,n(914)),JL=n(962),eP=n(913),tP=n(934),nP=n(912),aP=n(959),rP=n(960),iP=n(961);function oP(){return(oP=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function lP(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var cP=a.createElement("desc",null,"Created with Sketch."),sP=a.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"pop-up/action/download-logs/date-range-copy-2",transform:"translate(-20.000000, -187.000000)"},a.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)"},a.createElement("g",{id:"icon/sf-small/wizzard",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{transform:"translate(6.666667, 6.000000)",id:"Group"},a.createElement("g",null,a.createElement("polyline",{id:"Path-3",stroke:"#1B2559",strokeWidth:2,points:"0 4.83333333 3.33333333 8.16666667 6.66666667 4.83333333"}),a.createElement("line",{x1:3.33333333,y1:.25,x2:3.33333333,y2:6.5,id:"Path-4",stroke:"#1B2559",strokeWidth:2})))))));function dP(e,t){var n=e.title,r=e.titleId,i=lP(e,["title","titleId"]);return a.createElement("svg",oP({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":r},i),n?a.createElement("title",{id:r},n):null,cP,sP)}var uP=a.forwardRef(dP);n.p;function mP(){return(mP=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function hP(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var pP=a.createElement("desc",null,"Created with Sketch."),bP=a.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"pop-up/action/download-logs/date-range-copy-2",transform:"translate(-20.000000, -187.000000)"},a.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)"},a.createElement("g",{id:"icon/sf-small/wizzard",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{transform:"translate(6.666667, 6.000000)",id:"Group"},a.createElement("g",null,a.createElement("polyline",{id:"Path-3",stroke:"#1B2559",strokeWidth:2,points:"0 4.83333333 3.33333333 8.16666667 6.66666667 4.83333333"}),a.createElement("line",{x1:3.33333333,y1:.25,x2:3.33333333,y2:6.5,id:"Path-4",stroke:"#1B2559",strokeWidth:2})))))));function fP(e,t){var n=e.title,r=e.titleId,i=hP(e,["title","titleId"]);return a.createElement("svg",mP({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":r},i),n?a.createElement("title",{id:r},n):null,pP,bP)}var jP,gP,OP,xP,vP=a.forwardRef(fP),yP=(n.p,{wrapper:{height:26,display:"flex",alignItems:"center",justifyContent:"center",position:"relative",overflow:"hidden"},button:{outline:"none",extend:Be.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"}}),wP=Object(f.a)(yP),CP=function(e){var t,n,a,r=e.isLowerBound,i=e.isUpperBound,o=e.isBetween,l=e.isDisabled,c=e.children,s=(Object(q.a)(e,["isLowerBound","isUpperBound","isBetween","isDisabled","children"]),wP()),d=r||i,u=(t={},Object(z.a)(t,s.between,o&&!(r&&i)),Object(z.a)(t,s.lowerBound,r&&!i),Object(z.a)(t,s.upperBound,i&&!r),t),m=(n={},Object(z.a)(n,s.wrapper,!0),Object(z.a)(n,s.selected,d),n),h=(a={},Object(z.a)(a,s.button,!0),Object(z.a)(a,s.disabled,l),a);return Object(Me.jsxs)("div",{className:s.wrapper,children:[Object(Me.jsx)("div",{className:I()(u)}),Object(Me.jsx)("div",{className:I()(m),children:Object(Me.jsx)("button",{className:I()(h),children:c})})]})},kP={wrapper:{display:"flex",flexDirection:"column",alignItems:"center"},button:{outline:"none"},navbar:{extend:Be.p,display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%",padding:[[15,15]],color:J,"& button":{display:"flex",alignItems:"center",padding:0,border:"none",backgroundColor:G,cursor:"pointer",borderRadius:"50%",width:20,height:20,position:"relative",overflow:"hidden","& svg":{position:"absolute",left:0}}},table:{borderCollapse:"collapse",width:"100%",color:J,"& tr":{"&:first-child":{paddingLeft:5},"&:last-child":{paddingRight:5}},"& th, & td":{margin:0,padding:[[3,0,3,0]]},"& th":{extend:Be.label2}}},EP=Object(f.a)(kP),NP=function(e){var t=e.minDate,n=e.maxDate,r=e.handleSelect,i=Object(q.a)(e,["minDate","maxDate","handleSelect"]),o=Object(a.useState)(new Date),c=Object(l.a)(o,2),s=c[0],d=c[1],u=EP(),m=Array.from(Array(7)).map((function(e,t){return Object(ed.a)("EEEEE",Object(Od.a)({days:t},Object(Sv.a)(new Date)))})),h=function(e){var t=Object(ds.a)({months:1},e),n=xu.a(0,Object(aP.a)(Object(rP.a)(e))).reverse(),a=R.a((function(e){return Object(ds.a)({days:e},Object(iP.a)(t))}))(n),r=xu.a(0,function(e){return Object(nP.a)(e)}(e)),i=R.a((function(t){return Object(Od.a)({days:t},Object(rP.a)(e))}))(r),o=Object(Od.a)({months:1},e),l=xu.a(0,42-a.length-i.length),c=R.a((function(e){return Object(Od.a)({days:e},Object(rP.a)(o))}))(l);return ll.a(ll.a(a,i),c)},p=function(e,t){return h(e).slice(7*t-7,7*t)};return Object(Me.jsxs)("div",{className:u.wrapper,children:[Object(Me.jsxs)("div",{className:u.navbar,children:[Object(Me.jsx)("button",{className:u.button,onClick:function(){return function(e){var n=Object(ds.a)({months:1},e);d(t?Object(JL.a)(t,n)||Object(eP.a)(t,n)>0?n:s:n)}(s)},children:Object(Me.jsx)(uP,{})}),Object(Me.jsx)("span",{children:"".concat(Object(ed.a)("MMMM",s)," ").concat(Object(ed.a)("yyyy",s))}),Object(Me.jsx)("button",{className:u.button,onClick:function(){return function(e){var t=Object(Od.a)({months:1},e);d(n?Object(JL.a)(n,t)||Object(eP.a)(t,n)>0?t:s:t)}(s)},children:Object(Me.jsx)(vP,{})})]}),Object(Me.jsxs)("table",{className:u.table,children:[Object(Me.jsx)("thead",{children:Object(Me.jsx)("tr",{children:m.map((function(e,t){return Object(Me.jsx)("th",{children:e},t)}))})}),Object(Me.jsx)("tbody",{children:xu.a(1,8).map((function(e,a){return Object(Me.jsx)("tr",{children:p(s,e).map((function(e,a){return Object(Me.jsx)("td",{onClick:function(){return r(e,t,n)},children:Object(Me.jsx)(CP,{isDisabled:n&&Object(us.a)(n,e)||t&&Object(us.a)(e,t),isLowerBound:Object(UL.a)(i.from,e),isUpperBound:Object(UL.a)(i.to,e),isBetween:Object(us.a)(i.from,e)&&Object(us.a)(e,i.to),children:Object(ed.a)("d",e)})},a)}))},a)}))})]})]})},SP=Object(f.a)({wrapper:{backgroundColor:"white",borderRadius:10}}),IP=function(e){var t=e.minDate,n=e.maxDate,r=e.className,i=e.onRangeChange,o=Object(a.useState)(null),c=Object(l.a)(o,2),s=c[0],d=c[1],u=Object(a.useState)(null),m=Object(l.a)(u,2),h=m[0],p=m[1];Object(a.useEffect)((function(){i(s,h)}),[s,i,h]);var b=SP();return Object(Me.jsx)(Me.Fragment,{children:Object(Me.jsx)("div",{className:I()(b.wrapper,r),children:Object(Me.jsx)(NP,{from:s,to:h,minDate:t,maxDate:n,handleSelect:function(e,t,n){if(!(n&&Object(YL.a)(n,e)>0||t&&Object(YL.a)(e,t)>0))return s&&!h&&Object(YL.a)(e,s)>0?(p(s),void d(e)):void(s&&!h&&(Object(JL.a)(s,e)||Object(eP.a)(s,e)>0)?p(Object(tP.a)({hours:23,minutes:59,seconds:59,milliseconds:999},e)):(d(e),p(null)))}})})})},FP=Be.label1,LP=Be.h4,PP={wrapper:{height:46,width:99},container:{display:"flex"},monthWeekDayContainer:{display:"flex",flexDirection:"column"},label:{extend:FP,lineHeight:1.33,color:J},bigNumber:{extend:Be.info1,lineHeight:1,marginRight:7},monthYear:{extend:Be.label2,lineHeight:1.17,color:J},weekDay:{extend:FP,lineHeight:1.33,color:se}},DP=Object(f.a)(PP),RP=function(e){var t=e.date,n=e.children,a=(Object(q.a)(e,["date","children"]),DP());return Object(Me.jsxs)("div",{className:a.wrapper,children:[Object(Me.jsx)("div",{className:a.label,children:n}),t&&Object(Me.jsx)(Me.Fragment,{children:Object(Me.jsxs)("div",{className:a.container,children:[Object(Me.jsx)("div",{className:a.bigNumber,children:Object(ed.a)("d",t)}),Object(Me.jsxs)("div",{className:a.monthWeekDayContainer,children:[Object(Me.jsx)("span",{className:a.monthYear,children:"".concat(Object(ed.a)("MMM",t)," ").concat(Object(ed.a)("yyyy",t))}),Object(Me.jsx)("span",{className:a.weekDay,children:Object(ed.a)("EEEE",t)})]})]})})]})},BP={popoverContent:{width:280},popoverHeader:{extend:LP,padding:[[15,15,0,15]]},radioButtonsContainer:{padding:[[5,15,5,15]]},radioButtons:{display:"flex",justifyContent:"space-between",flexDirection:"row",color:J},dateRangePickerShowing:{display:"block",height:"100%"},dateRangePickerHidden:{display:"none",height:0},download:{padding:[[10,15]]},dateContainerWrapper:{display:"flex",justifyContent:"space-between",alignItems:"center",position:"relative",backgroundColor:G,padding:[[0,15]],minHeight:70},arrowContainer:{position:"absolute",left:125,top:26},arrow:{margin:"auto"}},TP=Object(f.a)(BP),AP="all",MP="range",WP="advanced",zP="simplified",qP=function(e){var t,n=e.name,r=e.query,i=e.args,o=e.title,c=e.getLogs,d=e.timezone,m=e.simplified,h=Object(a.useState)(AP),p=Object(l.a)(h,2),b=p[0],f=p[1],j=Object(a.useState)(WP),g=Object(l.a)(j,2),O=g[0],x=g[1],v=Object(a.useState)({from:null,until:null}),y=Object(l.a)(v,2),w=y[0],C=y[1],k=Object(a.useState)(null),N=Object(l.a)(k,2),S=N[0],F=N[1],L=Object(u.a)(r,{onCompleted:function(e){return T(c(e),w)}}),P=Object(l.a)(L,1)[0],D=TP(),R=(t={},Object(z.a)(t,D.dateRangePickerShowing,b===MP),Object(z.a)(t,D.dateRangePickerHidden,b===AP),t),B=Object(a.useCallback)((function(e,t){C({from:e,until:t})}),[C]),T=function(e,t){var a=function(e){return ad(e,d,"yyyy-MM-dd_HH-mm")},r=new window.Blob([e],{type:"text/plain;charset=utf-8"});Sf.a.saveAs(r,b===AP?"".concat(a(new Date),"_").concat(n,".csv"):"".concat(a(t.from),"_").concat(a(t.until),"_").concat(n,".csv"))},M=[{display:"All logs",code:AP},{display:"Date range",code:MP}],W=[{display:"Advanced logs",code:WP},{display:"Simplified logs",code:zP}],q=Boolean(S),$=q?"date-range-popover":void 0;return Object(Me.jsx)(E.a,{onClickAway:function(){F(null)},children:Object(Me.jsxs)("div",{children:[Object(Me.jsx)(Vn,{Icon:yj,InverseIcon:hj,onClick:function(e){F(S?null:e.currentTarget)},variant:"contained"}),Object(Me.jsx)(Xn,{id:$,open:q,anchorEl:S,placement:"bottom",children:Object(Me.jsxs)("div",{className:D.popoverContent,children:[Object(Me.jsx)("div",{className:D.popoverHeader,children:o}),Object(Me.jsx)("div",{className:D.radioButtonsContainer,children:Object(Me.jsx)(Er,{name:"logs-select",value:b,options:M,ariaLabel:"logs-select",onChange:function(e){var t=A.a(["target","value"])(e);f(t),t===AP&&C({from:null,until:null})},className:D.radioButtons})}),b===MP&&Object(Me.jsxs)("div",{className:I()(R),children:[Object(Me.jsx)("div",{className:D.dateContainerWrapper,children:w&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(RP,{date:w.from,children:"From"}),Object(Me.jsx)("div",{className:D.arrowContainer,children:Object(Me.jsx)(QL,{className:D.arrow})}),Object(Me.jsx)(RP,{date:w.until,children:"To"})]})}),Object(Me.jsx)(IP,{maxDate:new Date,onRangeChange:B})]}),m&&Object(Me.jsx)("div",{className:D.radioButtonsContainer,children:Object(Me.jsx)(Er,{name:"simplified-tx-logs",value:O,options:W,ariaLabel:"simplified-tx-logs",onChange:function(e){var t=A.a(["target","value"])(e);x(t)},className:D.radioButtons})}),Object(Me.jsx)("div",{className:D.download,children:Object(Me.jsx)(oa,{color:"primary",onClick:function(){return function(e,t){b===AP&&P({variables:Object(s.a)(Object(s.a)({},t),{},{simplified:O===zP})}),e&&e.from&&(e.from&&!e.until&&(e.until=new Date),Object(UL.a)(e.until,e.from)&&(e.until=new Date),b===MP&&P({variables:Object(s.a)(Object(s.a)({},t),{},{from:e.from,until:e.until,simplified:O===zP})}))}(w,i)},children:"Download"})})]})})]})})},$P=Object(f.a)(uf),HP=x()(jP||(jP=Object(c.a)(["\n {\n machines {\n name\n deviceId\n }\n }\n"]))),VP=x()(gP||(gP=Object(c.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"]))),UP=x()(OP||(OP=Object(c.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"]))),GP=x()(xP||(xP=Object(c.a)(["\n query getData {\n config\n }\n"]))),XP=function(){var e,t,n=$P(),r=Object(a.useState)(null),i=Object(l.a)(r,2),o=i[0],c=i[1],s=Object(a.useState)(null),d=Object(l.a)(s,2),m=d[0],h=d[1],p=null===o||void 0===o?void 0:o.deviceId,b=Object(u.c)(HP).data,f=Object(u.c)(GP).data,j=A.a(["config","locale_timezone"],f),g=Object(u.c)(UP,{variables:{deviceId:p,limit:500},skip:!o,onCompleted:function(){return h("")}}),O=g.data,x=g.loading;(null===b||void 0===b||null===(e=b.machines)||void 0===e?void 0:e.length)&&!o&&c(null===b||void 0===b?void 0:b.machines[0]);return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)("div",{className:n.titleWrapper,children:Object(Me.jsxs)("div",{className:n.titleAndButtonsContainer,children:[Object(Me.jsx)(yn,{children:"Machine Logs"}),O&&Object(Me.jsxs)("div",{className:n.buttonsWrapper,children:[Object(Me.jsx)(qP,{title:"Download logs",name:o.name,query:VP,args:{deviceId:p,timezone:j},getLogs:function(e){return A.a(["machineLogsCsv"])(e)},timezone:j}),Object(Me.jsx)(Ke,{children:m})]})]})}),Object(Me.jsxs)("div",{className:n.wrapper,children:[Object(Me.jsx)(yi,{displayName:function(e){return e.name},data:(null===b||void 0===b?void 0:b.machines)||[],isSelected:function(e){return A.a(["deviceId"])(o)===e.deviceId},onClick:c}),Object(Me.jsxs)("div",{className:n.tableWrapper,children:[Object(Me.jsxs)(Cs,{className:n.table,children:[Object(Me.jsx)(Ss,{children:Object(Me.jsxs)(Bs,{header:!0,children:[Object(Me.jsx)(Ls,{className:n.dateColumn,children:"Date"}),Object(Me.jsx)(Ls,{className:n.levelColumn,children:"Level"}),Object(Me.jsx)(Ls,{className:n.fillColumn})]})}),Object(Me.jsx)(ks,{children:O&&O.machineLogs.map((function(e,t){return Object(Me.jsxs)(Bs,{size:"sm",children:[Object(Me.jsx)(Ns,{children:j&&ad(e.timestamp,j,"yyyy-MM-dd HH:mm")}),Object(Me.jsx)(Ns,{children:e.logLevel}),Object(Me.jsx)(Ns,{children:e.message})]},t)}))})]}),x&&Object(Me.jsx)(Ue,{children:"Loading..."}),!x&&!(null===O||void 0===O||null===(t=O.machineLogs)||void 0===t?void 0:t.length)&&Object(Me.jsx)(Ue,{children:"No activity so far"})]})]})]})};function _P(){return(_P=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function ZP(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var KP=a.createElement("desc",null,"Created with Sketch."),QP=a.createElement("g",{id:"icon/sf-small/clock/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"Group-7",stroke:"#FFFFFF",strokeWidth:2},a.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"}),a.createElement("polyline",{id:"Stroke-3",points:"13 11 10 11.063 10 7"}),a.createElement("polyline",{id:"Stroke-5",points:"3 0 3 3 5 4"})));function YP(e,t){var n=e.title,r=e.titleId,i=ZP(e,["title","titleId"]);return a.createElement("svg",_P({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":r},i),n?a.createElement("title",{id:r},n):null,KP,QP)}var JP=a.forwardRef(YP);n.p;function eD(){return(eD=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function tD(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var nD=a.createElement("desc",null,"Created with Sketch."),aD=a.createElement("g",{id:"icon/sf-small/clock/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"Group-7",stroke:"#1B2559",strokeWidth:2},a.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"}),a.createElement("polyline",{id:"Stroke-3",points:"13 11 10 11.063 10 7"}),a.createElement("polyline",{id:"Stroke-5",points:"3 0 3 3 5 4"})));function rD(e,t){var n=e.title,r=e.titleId,i=tD(e,["title","titleId"]);return a.createElement("svg",eD({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":r},i),n?a.createElement("title",{id:r},n):null,nD,aD)}var iD,oD,lD,cD,sD,dD,uD=a.forwardRef(rD),mD=(n.p,{cashbox:{height:36},tableContainer:{flex:1,marginBottom:100},tBody:{maxHeight:"65vh",overflow:"auto"},tableWidth:{display:"flex",alignItems:"center",marginRight:1},descriptions:{color:se,marginTop:0},cashboxReset:{color:se,margin:[[13,0,-5,20]]},selection:{marginRight:12}}),hD={footerLabel:{color:$,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"}},pD=Object(f.a)(hD),bD=function(e){var t=e.machines,n=e.config,a=e.currencyCode,r=(e.bills,e.deviceIds,pD()),i=n&&rs("cashOut")(n),o=function(e){return rs(e)(i)},l=ms.a(hs.a((function(e,t){var n,a,r,i,l=t.cassette1,c=t.cassette2,s=t.cassette3,d=t.cassette4,u=t.id,m=null!==(n=o(u).cassette1)&&void 0!==n?n:0,h=null!==(a=o(u).cassette2)&&void 0!==a?a:0,p=null!==(r=o(u).cassette3)&&void 0!==r?r:0,b=null!==(i=o(u).cassette4)&&void 0!==i?i:0;return[e[0]+=l*m,e[1]+=c*h,e[2]+=s*p,e[3]+=d*b]}),[0,0,0,0],t));return Object(Me.jsx)("div",{className:r.footerContainer,children:Object(Me.jsxs)("div",{className:r.footerContent,children:[Object(Me.jsx)(Ke,{className:r.footerLabel,children:"Cash value in System"}),Object(Me.jsxs)("div",{className:r.flex,children:[Object(Me.jsx)(Bc,{className:r.icon}),Object(Me.jsx)(Ze,{className:r.iconLabel,children:"Cash-out:"}),Object(Me.jsxs)(_e,{className:r.valueDisplay,children:[l," ",a]})]})]})})},fD=n(453),jD=x()(iD||(iD=Object(c.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"]))),gD=x()(oD||(oD=Object(c.a)(["\n mutation editBatch($id: ID, $performedBy: String) {\n editBatch(id: $id, performedBy: $performedBy) {\n id\n }\n }\n"]))),OD=x()(lD||(lD=Object(c.a)(["\n query getData {\n config\n }\n"]))),xD=xn.f().shape({performedBy:xn.h().nullable()}),vD=Object(f.a)({operationType:{marginLeft:8},operationTypeWrapper:{display:"flex",flexDirection:"row",alignItems:"center"},saveAndCancel:{display:"flex",flexDirection:"row",justifyContent:"space-between"}}),yD=function(e){var t=e.machines,n=e.currency,r=vD(),i=Object(a.useState)(!1),o=Object(l.a)(i,2),c=o[0],d=o[1],m=Object(a.useState)(null),h=Object(l.a)(m,2),p=h[0],b=h[1],f=Object(a.useState)(!1),j=Object(l.a)(f,2),g=j[0],O=j[1],x=Object(u.c)(jD),v=x.data,y=x.loading,w=Object(u.b)(gD,{refetchQueries:function(){return["cashboxBatches"]}}),C=Object(l.a)(w,1)[0],k=Object(u.c)(OD),E=k.data,N=k.loading,S=A.a(["config","locale_timezone"],E),I=y&&N,F=A.a(["cashboxBatches"])(v),L=hs.a((function(e,t){return ju.a(fD.a("cash-out-".concat(t,"-refill"),Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Bc,{}),Object(Me.jsxs)("span",{className:r.operationType,children:["Cash-out ",t," refill"]})]})),fD.a("cash-out-".concat(t,"-empty"),Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Bc,{}),Object(Me.jsxs)("span",{className:r.operationType,children:["Cash-out ",t," emptied"]})]})))(e)}),{"cash-in-empty":Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Sc,{}),Object(Me.jsx)("span",{className:r.operationType,children:"Cash-in emptied"})]})},xu.a(1,5)),P=function(){O(!1),b(null)},T=function(e){return(null===p||void 0===p?void 0:p.id)!==e},M=[{name:"operation",header:"Operation",width:200,textAlign:"left",view:function(e){return Object(Me.jsx)("div",{className:r.operationTypeWrapper,children:L[e.operationType]})}},{name:"machine",header:"Machine",width:200,textAlign:"left",view:function(e){return Aa.a(W.a("id",e.deviceId))(t).name}},{name:"billCount",header:"Bill Count",width:115,textAlign:"left",input:ei,inputProps:{decimalPlaces:0},view:function(e){return D.a(e.customBillCount)?e.bills.length:e.customBillCount}},{name:"total",header:"Total",width:180,textAlign:"right",view:function(e){return Object(Me.jsxs)("span",{children:[ms.a(R.a((function(e){return B.a("fiat",e)}),e.bills))," ",n]})}},{name:"date",header:"Date",width:135,textAlign:"right",view:function(e){return ad(e.created,S,"yyyy-MM-dd")}},{name:"time",header:"Time (h:m)",width:125,textAlign:"right",view:function(e){return ad(e.created,S,"HH:mm")}},{name:"performedBy",header:"Performed by",width:180,textAlign:"left",view:function(e){return T(e.id)?D.a(e.performedBy)?"Unknown entity":e.performedBy:Object(Me.jsx)(Xa,{onChange:function(e){return b(Object(s.a)(Object(s.a)({},p),{},{performedBy:e.target.value}))},error:c,width:161.5,value:null===p||void 0===p?void 0:p.performedBy})}},{name:"",header:"Edit",width:80,textAlign:"right",view:function(e){return T(e.id)?Object(Me.jsx)(ta,{disabled:g,onClick:function(){b({id:e.id,performedBy:e.performedBy}),O(!0)},children:g?Object(Me.jsx)(Oh,{}):Object(Me.jsx)(kh,{})}):Object(Me.jsxs)("div",{className:r.saveAndCancel,children:[Object(Me.jsx)(oa,{type:"submit",color:"primary",onClick:function(){return function(e){var t=""===p.performedBy?null:p.performedBy;return xD.isValid(p).then((function(){d(!1),C({variables:{id:e.id,performedBy:t}})})).catch(d(!0)),P()}(e)},children:"Save"}),Object(Me.jsx)(oa,{color:"secondary",onClick:P,children:"Cancel"})]})}}];return Object(Me.jsx)(Me.Fragment,{children:!I&&Object(Me.jsx)(gy,{name:"cashboxHistory",elements:M,data:F,emptyText:"No cashbox batches so far"})})},wD=Object(f.a)(mD),CD=xn.f().shape({name:xn.h().required(),cashbox:xn.e().label("Cashbox").required().integer().min(0).max(1e3),cassette1:xn.e().label("Cassette 1").required().integer().min(0).max(500),cassette2:xn.e().label("Cassette 2").required().integer().min(0).max(500),cassette3:xn.e().label("Cassette 3").required().integer().min(0).max(500),cassette4:xn.e().label("Cassette 4").required().integer().min(0).max(500)}),kD=x()(cD||(cD=Object(c.a)(["\n query getData {\n machines {\n name\n id: deviceId\n cashbox\n cassette1\n cassette2\n cassette3\n cassette4\n numberOfCassettes\n }\n config\n }\n"]))),ED=x()(sD||(sD=Object(c.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),ND=x()(dD||(dD=Object(c.a)(["\n mutation MachineAction(\n $deviceId: ID!\n $action: MachineAction!\n $cashbox: Int!\n $cassette1: Int!\n $cassette2: Int!\n $cassette3: Int!\n $cassette4: Int!\n ) {\n machineAction(\n deviceId: $deviceId\n action: $action\n cashbox: $cashbox\n cassette1: $cassette1\n cassette2: $cassette2\n cassette3: $cassette3\n cassette4: $cassette4\n ) {\n deviceId\n cashbox\n cassette1\n cassette2\n cassette3\n cassette4\n }\n }\n"]))),SD=function(){var e,t,n,r,i=wD(),o=Object(a.useState)(!1),c=Object(l.a)(o,2),m=c[0],h=c[1],p=Object(a.useState)(null),b=Object(l.a)(p,2),f=b[0],j=b[1],g=Object(a.useState)(null),O=Object(l.a)(g,2),x=O[0],v=O[1],y=Object(u.c)(kD).data,w=Object(a.useState)(!1),C=Object(l.a)(w,2),k=C[0],E=C[1],N=Object(a.useState)(""),S=Object(l.a)(N,2),I=S[0],F=S[1],L=null!==(e=A.a(["machines"])(y))&&void 0!==e?e:[],P=null!==(t=A.a(["config"])(y))&&void 0!==t?t:{},D=rs("notifications",P),T=Object(u.b)(ND,{refetchQueries:function(){return["getData"]}}),M=Object(l.a)(T,2),z=M[0],q=M[1].error,$=Object(u.b)(ED,{onCompleted:function(){return j(!1)},refetchQueries:function(){return["getData"]}}),H=Object(l.a)($,1)[0],V=my.a((function(e){return e.deviceId}))(null!==(n=A.a(["bills"])(y))&&void 0!==n?n:[]),U=wg.a(R.a(B.a("deviceId"))(null!==(r=A.a(["bills"])(y))&&void 0!==r?r:[])),G=(null===y||void 0===y?void 0:y.config)&&rs("cashOut")(y.config),X=(null===y||void 0===y?void 0:y.config)&&rs("locale")(y.config),_=null===X||void 0===X?void 0:X.fiatCurrency,Z=Math.max.apply(Math,Object(d.a)(R.a((function(e){return e.numberOfCassettes}),L)).concat([0])),K=function(e){return rs(e)(G)},Q=(null===y||void 0===y?void 0:y.config)&&rs("cashIn")(y.config).cashboxReset,Y=function(e){e&&(!function(e){var t=is("cashIn")(e);H({variables:{config:t}})}({cashboxReset:e}),j(!1))},J=[{display:"Automatic",code:"automatic"},{display:"Manual",code:"manual"}],ee=function(e){var t=A.a(["target","value"])(e);v(t)},te=[{name:"name",header:"Machine",width:184,view:function(e){return Object(Me.jsx)(Me.Fragment,{children:e})},input:function(e){var t=e.field.value;return Object(Me.jsx)(Me.Fragment,{children:t})}},{name:"cashbox",header:"Cash-in",width:Z>2?140:280,view:function(e){return Object(Me.jsx)(_r,{currency:{code:_},notes:e,total:0})},input:ei,inputProps:{decimalPlaces:0}}];return Ju.a(em.a(tm.a,Z),(function(e){return te.push({name:"cassette".concat(e),header:"Cassette ".concat(e),width:(Z>2?700:560)/Z,stripe:!0,doubleHeader:"Cash-out",view:function(t,n){var a,r=n.id;return Object(Me.jsx)(Zr,{className:i.cashbox,denomination:null===(a=K(r))||void 0===a?void 0:a["cassette".concat(e)],currency:{code:_},notes:t,width:50,threshold:D["fillingPercentageCassette".concat(e)]})},isHidden:function(t){var n=t.numberOfCassettes;return e>n},input:Qr,inputProps:{decimalPlaces:0,width:50,inputClassName:i.cashbox}}),nm.a(1,e)}),1),te.push({name:"edit",header:"Edit",width:87,view:function(e,t){var n=t.id;return Object(Me.jsx)(ta,{onClick:function(){F(n),E(!0)},children:Object(Me.jsx)(kh,{})})}}),Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(nl,{title:"Cash Cassettes",button:{text:"Cashbox history",icon:uD,inverseIcon:JP,toggle:h},iconClassName:i.listViewButton,className:i.tableWidth,children:!m&&Object(Me.jsxs)(Ko.a,{alignItems:"center",justifyContent:"flex-end",children:[Object(Me.jsx)(et,{className:i.cashboxReset,children:"Cashbox reset"}),Object(Me.jsxs)(Ko.a,{display:"flex",alignItems:"center",justifyContent:"flex-end",mr:"-4px",children:[Q&&Object(Me.jsx)(Xe,{className:i.selection,children:Dm(Q)}),Object(Me.jsx)(ta,{onClick:function(){return j(!0)},className:i.button,children:Object(Me.jsx)(kh,{})})]})]})}),Object(Me.jsxs)("div",{className:i.tableContainer,children:[!m&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Rh,{error:null===q||void 0===q?void 0:q.message,name:"cashboxes",stripeWhen:function(e){var t=e.id;return!K(t).active},elements:te,data:L,validationSchema:CD,tbodyWrapperClass:i.tBody}),y&&Wa.a(L)&&Object(Me.jsx)(ys,{message:"No machines so far"})]}),m&&Object(Me.jsx)(yD,{machines:L,currency:_})]}),Object(Me.jsx)(bD,{currencyCode:_,machines:L,config:P,bills:V,deviceIds:U}),k&&Object(Me.jsx)(Dp,{machine:Aa.a(W.a("id",I))(L),cashoutSettings:K(I),onClose:function(){E(!1)},error:null===q||void 0===q?void 0:q.message,save:function(e,t,n){return z({variables:Object(s.a)({action:"setCassetteBills",deviceId:e,cashbox:t},n)})},locale:X}),f&&Object(Me.jsxs)(Mh,{title:"Cashbox reset",width:478,handleClose:function(){return j(null)},open:!0,children:[Object(Me.jsx)(Xe,{className:i.descriptions,children:"Specify if you want your cash-in counts to be reset automatically or manually."}),Object(Me.jsx)(Er,{name:"set-automatic-reset",value:null!==x&&void 0!==x?x:Q,options:[J[0]],onChange:ee,className:i.radioButtons}),Object(Me.jsx)(Xe,{className:i.descriptions,children:"Choose this option if you want your cash-in cashbox count to be reset automatically when it is physically removed from the machine."}),Object(Me.jsx)(Er,{name:"set-manual-reset",value:null!==x&&void 0!==x?x:Q,options:[J[1]],onChange:ee,className:i.radioButtons}),Object(Me.jsx)(Xe,{className:i.descriptions,children:"Choose this option if you want to edit your cash-in counts manually on Lamassu Admin, after you physically remove the bills from the cashbox."}),Object(Me.jsx)(Wm.a,{className:i.actions,children:Object(Me.jsx)(An,{onClick:function(){return Y(x)},children:"Confirm"})})]})]})},ID=n(915);function FD(){return(FD=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function LD(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var PD=a.createElement("rect",{width:12,height:12,rx:3,ry:3,fill:"#ff7311"});function DD(e,t){var n=e.title,r=e.titleId,i=LD(e,["title","titleId"]);return a.createElement("svg",FD({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":r},i),n?a.createElement("title",{id:r},n):null,PD)}var RD=a.forwardRef(DD);n.p;function BD(){return(BD=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function TD(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var AD=a.createElement("rect",{width:12,height:12,rx:3,ry:3,fill:"#ff584a"});function MD(e,t){var n=e.title,r=e.titleId,i=TD(e,["title","titleId"]);return a.createElement("svg",BD({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":r},i),n?a.createElement("title",{id:r},n):null,AD)}var WD,zD,qD,$D,HD=a.forwardRef(MD),VD=(n.p,{douro1:"Douro",sintra:"Sintra",gaia:"Gaia"}),UD=Object(s.a)(Object(s.a)({},pf),{},{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(na.fade)($,.5)}}),GD=Object(f.a)(bf),XD=function(e){var t=e.children,n=GD();return Object(Me.jsx)("div",{className:n.label,children:t})},_D=Object(f.a)(UD),ZD=function(e){var t=e.children,n=Object(q.a)(e,["children"]);return Object(Me.jsx)(h.a,Object(s.a)(Object(s.a)({container:!0,spacing:4},n),{},{children:t}))},KD=function(e){var t=e.children,n=Object(q.a)(e,["children"]);return Object(Me.jsx)(h.a,Object(s.a)(Object(s.a)({item:!0,xs:!0},n),{},{children:t}))},QD=function(e){var t=e.it,n=e.onActionSuccess,a=e.timezone,r=_D();return Object(Me.jsx)(ZD,{className:r.wrapper,children:Object(Me.jsx)(KD,{xs:!0,children:Object(Me.jsxs)(ZD,{className:r.row,children:[Object(Me.jsxs)(KD,{xs:2,children:[Object(Me.jsx)(XD,{children:"Machine Model"}),Object(Me.jsx)("span",{children:VD[t.model]})]}),Object(Me.jsxs)(KD,{xs:4,children:[Object(Me.jsx)(XD,{children:"Paired at"}),Object(Me.jsx)("span",{children:a&&ad(t.pairedAt,a,"yyyy-MM-dd HH:mm:ss")})]}),Object(Me.jsx)(KD,{xs:6,children:Object(Me.jsx)(nf,{machine:t,onActionSuccess:n})}),Object(Me.jsxs)(KD,{xs:2,children:[Object(Me.jsx)(XD,{children:"Network speed"}),Object(Me.jsx)("span",{children:t.downloadSpeed?new Mc.a(t.downloadSpeed).toFixed(4).toString()+" MB/s":"unavailable"})]}),Object(Me.jsxs)(KD,{xs:2,children:[Object(Me.jsx)(XD,{children:"Latency"}),Object(Me.jsx)("span",{children:t.responseTime?new Mc.a(t.responseTime).toFixed(3).toString()+" ms":"unavailable"})]}),Object(Me.jsxs)(KD,{xs:2,children:[Object(Me.jsx)(XD,{children:"Packet Loss"}),Object(Me.jsx)("span",{children:t.packetLoss?new Mc.a(t.packetLoss).toFixed(3).toString()+" %":"unavailable"})]})]})})})},YD=x()(WD||(WD=Object(c.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"]))),JD=x()(zD||(zD=Object(c.a)(["\n query getData {\n config\n }\n"]))),eR=Object(f.a)(ff),tR=function(){var e,t=eR(),n=Object(w.h)(),a=Object(w.i)().state,r=null===a||void 0===a?void 0:a.id,i=Object(u.c)(YD),o=i.data,l=i.refetch,c=i.loading,s=Object(u.c)(JD),d=s.data,m=s.configLoading,h=A.a(["config","locale_timezone"],d),p=[{header:"Machine Name",width:250,size:"sm",textAlign:"left",view:function(e){return Object(Me.jsxs)("div",{className:t.flexRow,children:[e.name,Object(Me.jsx)("div",{className:t.machineRedirectContainer,onClick:function(){n.push("/machines/".concat(e.deviceId))},children:Object(Me.jsx)(Ru,{})})]})}},{header:"Status",width:350,size:"sm",textAlign:"left",view:function(e){return Object(Me.jsx)(ku,{statuses:e.statuses})}},{header:"Last ping",width:200,size:"sm",textAlign:"left",view:function(e){return e.lastPing?Object(ID.a)(new Date(e.lastPing),new Date,{addSuffix:!0}):"unknown"}},{header:"Software Version",width:200,size:"sm",textAlign:"left",view:function(e){return e.version||"unknown"}}],b=null!==(e=A.a(["machines"])(o))&&void 0!==e?e:[],f=ml.a(W.a("deviceId",r))(b);return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)("div",{className:t.titleWrapper,children:[Object(Me.jsx)("div",{className:t.titleAndButtonsContainer,children:Object(Me.jsx)(yn,{children:"Machine Status"})}),Object(Me.jsxs)("div",{className:t.headerLabels,children:[Object(Me.jsxs)("div",{children:[Object(Me.jsx)(RD,{}),Object(Me.jsx)("span",{children:"Warning"})]}),Object(Me.jsxs)("div",{children:[Object(Me.jsx)(HD,{}),Object(Me.jsx)("span",{children:"Error"})]})]})]}),Object(Me.jsx)(gy,{loading:c&&m,elements:p,data:b,Details:function(e){var t=e.it;return Object(Me.jsx)(QD,{it:t,onActionSuccess:l,timezone:h})},initialExpanded:f,emptyText:"No machines so far",expandable:!0})]})},nR=r.a.createContext(),aR=Object(f.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}}),rR=function(e){var t=e.title,n=e.editing,a=e.disabled,r=e.setEditing,i=aR();return Object(Me.jsxs)("div",{className:i.header,children:[Object(Me.jsx)(Ue,{className:i.title,children:t}),!n&&Object(Me.jsx)(ta,{onClick:function(){return r(!0)},className:i.button,disabled:a,children:a?Object(Me.jsx)(Oh,{}):Object(Me.jsx)(kh,{})}),n&&Object(Me.jsxs)("div",{className:i.editingButtons,children:[Object(Me.jsx)(oa,{color:"primary",type:"submit",children:"Save"}),Object(Me.jsx)(oa,{color:"secondary",type:"reset",children:"Cancel"})]})]})},iR=Object(f.a)({text:{margin:[[7,0,7,1]]},fieldWrapper:{height:53},valueWrapper:{display:"flex",alignItems:"baseline"},label:{margin:0},decoration:{margin:[[0,0,0,7]]}}),oR=function(e){var t,n=e.label,a=e.name,r=e.editing,i=e.displayValue,o=e.decoration,l=e.className,c=e.decimalPlaces,s=void 0===c?0:c,d=e.width,u=void 0===d?80:d,m=iR({width:u,editing:r}),h=Object(bn.f)().values,p=(t={},Object(z.a)(t,m.fieldWrapper,!0),Object(z.a)(t,"className",l),t);return Object(Me.jsxs)("div",{className:I()(p),children:[n&&Object(Me.jsx)(et,{className:m.label,children:n}),Object(Me.jsxs)("div",{className:m.valueWrapper,children:[!r&&Object(Me.jsx)(_e,{className:m.text,children:i(h[a])}),r&&Object(Me.jsx)(bn.b,{id:a,size:"lg",fullWidth:!0,name:a,component:ei,textAlign:"right",width:u,decimalPlaces:s}),Object(Me.jsx)(Je,{className:m.decoration,children:o})]})]})},lR=function(e){var t,n=e.title,r=e.label,i=e.width,o=void 0===i?80:i,c=e.min,s=void 0===c?0:c,d=e.max,u=void 0===d?9999999:d,m=e.name,h=e.section,p=e.className,b=Object(a.useState)(!1),f=Object(l.a)(b,2),j=f[0],g=f[1],O=function(){var e=Object(Pl.a)(Ll.a.mark((function e(t,n){return Ll.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!j){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(a.useContext)(nR),v=x.save,y=x.data,w=x.currency,C=x.isEditing,k=x.isDisabled,E=x.setEditing,N=xn.f().shape(Object(z.a)({},m,xn.e().transform(Vh).integer().min(s).max(u).nullable()));return Object(Me.jsx)(bn.e,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,initialValues:Object(z.a)({},m,null!==(t=y&&y[m])&&void 0!==t?t:""),validationSchema:N,onSubmit:function(e){return O(h,N.cast(e))},onReset:function(){E(m,!1)},children:Object(Me.jsxs)(bn.d,{className:p,children:[Object(Me.jsx)(dm,{}),Object(Me.jsx)(rR,{title:n,editing:C(m),disabled:k(m),setEditing:function(e){return E(m,e)}}),Object(Me.jsx)(oR,{label:r,name:m,editing:C(m),width:o,displayValue:function(e){return""===e?"-":e},decoration:w})]})})},cR="cryptoLowBalance",sR="cryptoHighBalance",dR=Object(f.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"]]}}),uR=function(e){var t=e.section,n=e.fieldWidth,r=dR(),i=Object(a.useContext)(nR),o=i.data,l=i.save,c=i.currency,s=i.setEditing,d=i.isEditing,u=i.isDisabled;return Object(Me.jsxs)("div",{className:r.cryptoBalanceAlerts,children:[Object(Me.jsx)(lR,{name:cR,data:o,save:l,section:t,decoration:c,className:r.cryptoBalanceAlertsForm,title:"Default (Low Balance)",label:"Alert me under",editing:d(cR),disabled:u(cR),setEditing:function(e){return s(cR,e)},width:n}),Object(Me.jsx)("div",{className:r.vertSeparator}),Object(Me.jsx)(lR,{name:sR,data:o,section:t,save:l,decoration:c,className:r.cryptoBalanceAlertsSecondForm,title:"Default (High Balance)",label:"Alert me over",editing:d(sR),disabled:u(sR),setEditing:function(e){return s(sR,e)},width:n})]})},mR="highBalance",hR="lowBalance",pR="cryptoCurrency",bR="cryptoBalanceOverrides",fR=function(e){var t,n,r,i=e.section,o=Object(a.useContext)(nR),l=o.cryptoCurrencies,c=void 0===l?[]:l,s=o.data,d=o.save,u=o.error,m=o.currency,h=o.isDisabled,p=o.setEditing,b=null!==(t=null===s||void 0===s?void 0:s.cryptoBalanceOverrides)&&void 0!==t?t:[],f=R.a(B.a(pR))(b),j=M.a((function(e){return!ul.a(e.code,f)}))(c),g=(n={},Object(z.a)(n,pR,null),Object(z.a)(n,hR,""),Object(z.a)(n,mR,""),n),O=xn.f().shape((r={},Object(z.a)(r,pR,xn.h().label("Cryptocurrency").nullable().required()),Object(z.a)(r,hR,xn.e().label("Low Balance").when(mR,{is:function(e){return!e},then:xn.e().required()}).transform(Vh).integer().min(0).max(Wh).nullable()),Object(z.a)(r,mR,xn.e().label("High Balance").when(hR,{is:function(e){return!e},then:xn.e().required()}).transform(Vh).integer().min(0).max(Wh).nullable()),r),[hR,mR]),x=[{name:pR,header:"Cryptocurrency",width:166,size:"sm",view:function(e){return L.a(A.a(["display"]),Aa.a(W.a("code",e)))(c)},input:Tr,inputProps:{options:function(e){return ll.a(j,function(e){var t=L.a(Aa.a(W.a("code",null===e||void 0===e?void 0:e.cryptoCurrency)))(c);return t?[t]:[]}(e))},optionsLimit:null,valueProp:"code",labelProp:"display"}},{name:hR,width:155,textAlign:"right",bold:!0,input:ei,suffix:m,inputProps:{decimalPlaces:2}},{name:mR,width:155,textAlign:"right",bold:!0,input:ei,suffix:m,inputProps:{decimalPlaces:2}}];return Object(Me.jsx)(Rh,{name:bR,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(bR)||!c,data:b,elements:x,disableAdd:!(null===j||void 0===j?void 0:j.length),onDelete:function(e){var t={cryptoBalanceOverrides:om.a((function(t){return t.id===e}),b)};return d(t)},setEditing:function(e){return p(bR,e)}})},jR={wrapper:{display:"flex"},form:{marginBottom:36},title:{marginTop:0},row:{width:236,display:"grid",gridTemplateColumns:"repeat(2,1fr)",gridTemplateRows:"1fr",gridColumnGap:18,gridRowGap:0},col2:{width:136},cashboxLabel:{marginRight:4,fontSize:20},cashboxEmptyPart:{backgroundColor:"".concat(ae)}},gR=Object(f.a)(jR),OR="fiatBalanceAlerts",xR=function(e){var t,n,r,i,o=e.section,l=e.min,c=void 0===l?0:l,s=e.max,u=void 0===s?100:s,m=e.fieldWidth,h=void 0===m?80:m,p=Object(a.useContext)(nR),b=p.isEditing,f=p.isDisabled,j=p.setEditing,g=p.data,O=p.save,x=p.machines,v=void 0===x?[]:x,y=gR(),w=Math.max.apply(Math,Object(d.a)(R.a((function(e){return e.numberOfCassettes}),v)).concat([2])),C=b(OR),k=xn.f().shape({fillingPercentageCassette1:xn.e().transform(Vh).integer().min(c).max(u).nullable(),fillingPercentageCassette2:xn.e().transform(Vh).integer().min(c).max(u).nullable(),fiatBalanceCassette3:xn.e().transform(Vh).integer().min(c).max(u).nullable(),fiatBalanceCassette4:xn.e().transform(Vh).integer().min(c).max(u).nullable()});return Object(Me.jsx)(bn.e,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,initialValues:{fillingPercentageCassette1:null!==(t=null===g||void 0===g?void 0:g.fillingPercentageCassette1)&&void 0!==t?t:"",fillingPercentageCassette2:null!==(n=null===g||void 0===g?void 0:g.fillingPercentageCassette2)&&void 0!==n?n:"",fillingPercentageCassette3:null!==(r=null===g||void 0===g?void 0:g.fillingPercentageCassette3)&&void 0!==r?r:"",fillingPercentageCassette4:null!==(i=null===g||void 0===g?void 0:g.fillingPercentageCassette4)&&void 0!==i?i:""},validationSchema:k,onSubmit:function(e){return O(o,k.cast(e))},onReset:function(){j(OR,!1)},children:function(e){var t=e.values;return Object(Me.jsxs)(bn.d,{className:y.form,children:[Object(Me.jsx)(dm,{}),Object(Me.jsx)(rR,{title:"Cash out (Empty)",editing:C,disabled:f(OR),setEditing:function(e){return j(OR,e)}}),Object(Me.jsx)("div",{className:y.wrapper,children:R.a((function(e){var n;return Object(Me.jsx)(Me.Fragment,{children:Object(Me.jsxs)("div",{className:y.row,children:[Object(Me.jsx)(Xr,{labelClassName:y.cashboxLabel,emptyPartClassName:y.cashboxEmptyPart,percent:null!==(n=t["fillingPercentageCassette".concat(e+1)])&&void 0!==n?n:g["cassette".concat(e+1)],applyColorVariant:!0,applyFiatBalanceAlertsStyling:!0,omitInnerPercentage:!0,cashOut:!0}),Object(Me.jsxs)("div",{className:y.col2,children:[Object(Me.jsxs)(Je,{className:y.title,children:["Cassette ",e+1]}),Object(Me.jsx)(oR,{label:"Alert me under",name:"fillingPercentageCassette".concat(e+1),editing:C,displayValue:function(e){return""===e?"-":e},decoration:"%",width:h})]})]})})}),gu.a(Ou.a,w))})]})}})},vR="fillingPercentageCassette1",yR="fillingPercentageCassette2",wR="fillingPercentageCassette3",CR="fillingPercentageCassette4",kR="machine",ER="fiatBalanceOverrides",NR=[vR,yR,wR,CR],SR=function(e){var t,n,r,i=e.section,o=Object(a.useContext)(nR),l=o.machines,c=void 0===l?[]:l,s=o.data,u=o.save,m=o.isDisabled,h=o.setEditing,p=o.error,b=null!==(t=null===s||void 0===s?void 0:s.fiatBalanceOverrides)&&void 0!==t?t:[],f=R.a((function(e){return e.machine}),b),j=M.a((function(e){return!ul.a(e.deviceId,f)}))(c),g=(n={},Object(z.a)(n,kR,null),Object(z.a)(n,vR,""),Object(z.a)(n,yR,""),Object(z.a)(n,wR,""),Object(z.a)(n,CR,""),n),O=Math.max.apply(Math,Object(d.a)(R.a((function(e){return e.numberOfCassettes}),c)).concat([0])),x=100,v=xn.f().shape((r={},Object(z.a)(r,kR,xn.h().label("Machine").nullable().required()),Object(z.a)(r,vR,xn.e().label("Cassette 1").transform(Vh).integer().min(0).max(x).nullable()),Object(z.a)(r,yR,xn.e().label("Cassette 2").transform(Vh).integer().min(0).max(x).nullable()),Object(z.a)(r,wR,xn.e().label("Cassette 3").transform(Vh).integer().min(0).max(x).nullable()),Object(z.a)(r,CR,xn.e().label("Cassette 4").transform(Vh).integer().min(0).max(x).nullable()),r)).test((function(e,t){var n=Mm.a(NR,e);if(!NR.some((function(e){return!D.a(n[e])})))return t.createError({path:vR,message:"At least one of the cassettes must have a value"})})),y=[{name:kR,width:238,size:"sm",view:function(e){return L.a(A.a(["name"]),Aa.a(W.a("deviceId",e)))(c)},input:Tr,inputProps:{options:function(e){return ll.a(j,function(e){var t=L.a(Aa.a(W.a("deviceId",null===e||void 0===e?void 0:e.machine)))(c);return t?[t]:[]}(e))},valueProp:"deviceId",labelProp:"name"}}];return Ju.a(em.a(tm.a,O),(function(e){return y.push({name:"fillingPercentageCassette".concat(e),display:"Cash-out ".concat(e),width:155,textAlign:"right",doubleHeader:"Cash-out (Cassette Empty)",bold:!0,input:ei,suffix:"%",inputProps:{decimalPlaces:0},view:function(e){var t;return null!==(t=null===e||void 0===e?void 0:e.toString())&&void 0!==t?t:"\u2014"},isHidden:function(t){var n;return e>(null===(n=c.find((function(e){return e.deviceId===t.machine})))||void 0===n?void 0:n.numberOfCassettes)}}),nm.a(1,e)}),1),Object(Me.jsx)(Rh,{name:ER,title:"Overrides",error:null===p||void 0===p?void 0:p.message,enableDelete:!0,enableEdit:!0,enableCreate:!0,save:function(e){return u(i,v.cast(e))},initialValues:g,validationSchema:v,forceDisable:m(ER)||!c,data:b,elements:y,disableAdd:!(null===j||void 0===j?void 0:j.length),setEditing:function(e){return h(ER,e)}})},IR={balance:152,transactions:184,compliance:178,errors:142,security:152,active:263},FR=function(e){var t=e.namespace,n=e.forceDisable,r=Object(a.useContext)(nR),i=r.data,o=r.save,l=L.a(o(null),is(t)),c=rs(t)(i),s=n||!c||!c.active,d=function(e){var t=e.name,n=e.disabled,a=!(!c||!c[t]);return Object(Me.jsx)(vm,{width:IR[t],textAlign:"center",children:Object(Me.jsx)(Fr,{disabled:n,checked:a,onChange:function(e){l(Object(z.a)({},t,e.target.checked))},value:a})})};return Object(Me.jsxs)(Cm,{children:[Object(Me.jsx)(vm,{width:129,children:Bm(t)}),Object(Me.jsx)(d,{name:"balance",disabled:s}),Object(Me.jsx)(d,{name:"transactions",disabled:s}),Object(Me.jsx)(d,{name:"compliance",disabled:s}),Object(Me.jsx)(d,{name:"errors",disabled:s}),Object(Me.jsx)(d,{name:"security",disabled:s}),Object(Me.jsx)(d,{name:"active",disabled:n})]})},LR=Object(f.a)({wizardTable:{width:930}}),PR=function(e){var t=e.wizard,n=e.forceDisable,a=t?20:0,r=LR();return Object(Me.jsxs)(jm,{className:t?r.wizardTable:null,children:[Object(Me.jsxs)(gm,{children:[Object(Me.jsx)(ym,{width:129-a,children:"Channel"}),Object.keys(IR).map((function(e){return Object(Me.jsx)(ym,{width:IR[e]-a,textAlign:"center",children:Bm(e)},e)}))]}),Object(Me.jsxs)(xm,{children:[Object(Me.jsx)(FR,{namespace:"email",forceDisable:n}),Object(Me.jsx)(FR,{namespace:"sms",forceDisable:n}),Object(Me.jsx)(FR,{namespace:"notificationCenter",forceDisable:n})]})]})},DR=function(e){var t=e.section,n=e.fieldWidth;return Object(Me.jsx)(lR,{section:t,title:"High value transaction",label:"Alert me over",name:"highValueTransaction",width:n})},RR=x()(qD||(qD=Object(c.a)(["\n query getData {\n config\n machines {\n name\n deviceId\n numberOfCassettes\n }\n cryptoCurrencies {\n code\n display\n }\n }\n"]))),BR=x()($D||($D=Object(c.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),TR=function(e){var t=e.name,n=e.displaySetup,r=void 0===n||n,i=e.displayTransactionAlerts,o=void 0===i||i,c=e.displayFiatAlerts,s=void 0===c||c,d=e.displayCryptoAlerts,m=void 0===d||d,h=e.displayOverrides,p=void 0===h||h,b=e.displayTitle,f=void 0===b||b,j=e.wizard,g=void 0!==j&&j,O=Object(a.useState)(null),x=Object(l.a)(O,2),v=x[0],y=x[1],w=Object(a.useState)(null),C=Object(l.a)(w,2),k=C[0],E=C[1],N=Object(a.useState)(null),S=Object(l.a)(N,2),I=S[0],F=S[1],L=Object(u.c)(RR).data,P=Object(u.b)(BR,{refetchQueries:["getData"],onCompleted:function(){return F(null)},onError:function(e){return E(e)}}),D=Object(l.a)(P,1)[0],R=rs(t)(null===L||void 0===L?void 0:L.config),B=null===L||void 0===L?void 0:L.machines,T=null===L||void 0===L?void 0:L.cryptoCurrencies,M=A.a(["fiatCurrency"])(rs(Zc)(null===L||void 0===L?void 0:L.config)),W={save:zc.a((function(e,n){var a=is(t)(n);return y(e),E(null),D({variables:{config:a}})})),error:k,editingKey:I,data:R,currency:M,isEditing:function(e){return I===e},isDisabled:function(e){return I&&I!==e},setEditing:function(e,t){t||E(null),F(t?e:null)},setSection:y,machines:B,cryptoCurrencies:T};return Object(Me.jsxs)(nR.Provider,{value:W,children:[f&&Object(Me.jsx)(nl,{title:"Notifications"}),r&&Object(Me.jsx)(jO,{title:"Setup",error:k&&!v,children:Object(Me.jsx)(PR,{forceDisable:!!I,wizard:g})}),o&&Object(Me.jsx)(jO,{title:"Transaction alerts",error:k&&"tx"===v,children:Object(Me.jsx)(DR,{section:"tx",fieldWidth:130})}),s&&Object(Me.jsxs)(jO,{title:"Fiat balance alerts",error:k&&"fiat"===v,children:[Object(Me.jsx)(xR,{section:"fiat",max:100,fieldWidth:50}),p&&Object(Me.jsx)(SR,{section:"fiat"})]}),m&&Object(Me.jsxs)(jO,{title:"Crypto balance alerts",error:k&&"crypto"===v,children:[Object(Me.jsx)(uR,{section:"crypto",fieldWidth:130}),p&&Object(Me.jsx)(fR,{section:"crypto",fieldWidth:130})]})]})};function AR(){return(AR=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function MR(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var WR=a.createElement("g",{id:"\\u21B3\\u21B3-Coin-ATM-Radar",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"operator-info_v4-CAR#1",transform:"translate(-832.000000, -608.000000)",fill:"#FF584A",fillRule:"nonzero"},a.createElement("g",{id:"Group",transform:"translate(832.000000, 608.000000)"},a.createElement("polygon",{id:"Line-7",points:"13.0484874 0 16 2.95151255 2.95151255 16 0 13.0484874"}),a.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 zR(e,t){var n=e.title,r=e.titleId,i=MR(e,["title","titleId"]);return a.createElement("svg",AR({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":r},i),void 0===n?a.createElement("title",{id:r},"Group"):n?a.createElement("title",{id:r},n):null,WR)}var qR=a.forwardRef(zR);n.p;function $R(){return($R=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function HR(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var VR=a.createElement("desc",null,"Created with Sketch."),UR=a.createElement("g",{id:"icon/table/true",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.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 GR(e,t){var n=e.title,r=e.titleId,i=HR(e,["title","titleId"]);return a.createElement("svg",$R({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":r},i),void 0===n?a.createElement("title",{id:r},"icon/table/true"):n?a.createElement("title",{id:r},n):null,VR,UR)}var XR,_R,ZR,KR,QR,YR,JR,eB,tB,nB,aB,rB,iB,oB,lB,cB,sB,dB,uB,mB,hB=a.forwardRef(GR),pB=(n.p,{booleanPropertiesTableWrapper:{display:"flex",flexDirection:"column",width:396},tableRow:{display:"flex",alignItems:"center",justifyContent:"space-between","&:nth-child(even)":{backgroundColor:ae},"&:nth-child(odd)":{backgroundColor:G},minHeight:32,height:"auto",padding:[[8,16,8,24]],boxShadow:"0 0 0 0 rgba(0, 0, 0, 0)"},leftTableCell:{display:"flex",alignItems:"center",justifyContent:"left",width:200,padding:[0]},rightTableCell:{display:"flex",alignItems:"center",justifyContent:"right",padding:[0]},transparentButton:{"& > *":{margin:"auto 12px"},"& button":{border:"none",backgroundColor:"transparent",cursor:"pointer"}},rowWrapper:{display:"flex",alignItems:"center",position:"relative",flex:"wrap"},rightAligned:{marginLeft:"auto"},radioButtons:{display:"flex",flexDirection:"row",margin:[-15]},rightLink:{marginLeft:"20px"},fillColumn:uf.fillColumn,popoverContent:{width:272,padding:[[10,15]]}}),bB=Object(f.a)(pB),fB=function(e){var t=e.name;return"true"===Object(bn.f)().values[t]?Object(Me.jsx)(hB,{}):Object(Me.jsx)(qR,{})},jB=Object(a.memo)((function(e){var t=e.title,n=e.disabled,r=e.data,i=e.elements,o=e.save,c=e.forcedEditing,s=void 0!==c&&c,d=qc.a(i.map((function(e){var t;return[e.name,null!==(t=r[e.name])&&void 0!==t?t:null]}))),u=qc.a(i.map((function(e){return[e.name,xn.b().required()]}))),m=Object(a.useState)(s),h=Object(l.a)(m,2),p=h[0],b=h[1],f=bB(),j=function(){var e=Object(Pl.a)(Ll.a.mark((function e(t){return Ll.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o(M.a($h.a(D.a),t)),b(!1);case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),g=[{display:"Yes",code:"true"},{display:"No",code:"false"}];return Object(Me.jsx)("div",{className:f.booleanPropertiesTableWrapper,children:Object(Me.jsx)(bn.e,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,onSubmit:j,initialValues:d,schemaValidation:u,children:function(e){var a=e.resetForm;return Object(Me.jsxs)(bn.d,{children:[Object(Me.jsxs)("div",{className:f.rowWrapper,children:[Object(Me.jsx)(Ue,{children:t}),p?Object(Me.jsxs)("div",{className:f.rightAligned,children:[Object(Me.jsx)(oa,{type:"submit",color:"primary",children:"Save"}),Object(Me.jsx)(oa,{type:"reset",className:f.rightLink,onClick:function(){a(),b(!1)},color:"secondary",children:"Cancel"})]}):Object(Me.jsx)(ta,{className:f.transparentButton,onClick:function(){return b(!0)},children:n?Object(Me.jsx)(Oh,{}):Object(Me.jsx)(kh,{})})]}),Object(Me.jsx)(dm,{}),Object(Me.jsx)(Cs,{className:f.fillColumn,children:Object(Me.jsx)(ks,{className:f.fillColumn,children:i.map((function(e,t){return Object(Me.jsxs)(Bs,{size:"sm",className:f.tableRow,children:[Object(Me.jsx)(Ns,{className:f.leftTableCell,children:e.display}),Object(Me.jsxs)(Ns,{className:f.rightTableCell,children:[p&&Object(Me.jsx)(bn.b,{component:ti,name:e.name,options:g,className:I()(f.radioButtons,f.rightTableCell)}),!p&&Object(Me.jsx)(fB,{name:e.name})]})]},t)}))})})]})}})})})),gB={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]]}},OB=Object(f.a)(gB),xB=x()(XR||(XR=Object(c.a)(["\n query getData {\n config\n }\n"]))),vB=x()(_R||(_R=Object(c.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),yB=Object(a.memo)((function(e){var t=e.title,n=e.disabled,a=void 0!==n&&n,r=e.checked,i=e.save,o=e.label,l=OB();return Object(Me.jsxs)("div",{className:l.switchRow,children:[Object(Me.jsx)(Xe,{children:t}),Object(Me.jsxs)("div",{className:l.switch,children:[Object(Me.jsx)(Fr,{disabled:a,checked:r,onChange:function(e){return i&&i(e.target.checked)}}),o&&Object(Me.jsx)(tt,{children:o})]})]})})),wB=Object(a.memo)((function(e){var t=e.wizard,n=OB(),a=Object(u.c)(xB).data,r=Object(u.b)(vB,{refetchQueries:["getData"]}),i=Object(l.a)(r,1)[0],o=function(e){return i({variables:{config:is(Yc,e)}})},c=(null===a||void 0===a?void 0:a.config)&&rs(Yc,a.config);return c?Object(Me.jsx)("div",{className:n.content,children:Object(Me.jsxs)("div",{children:[Object(Me.jsxs)("div",{className:n.header,children:[Object(Me.jsx)(Ue,{children:"Coin ATM Radar share settings"}),Object(Me.jsx)(fp,{width:304,children:Object(Me.jsxs)(Xe,{children:["For details on configuring this panel, please read the relevant knowledgebase article"," ",Object(Me.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://support.lamassu.is/hc/en-us/articles/360023720472-Coin-ATM-Radar",children:"here"}),"."]})})]}),Object(Me.jsx)(yB,{title:"Share information?",checked:c.active,save:function(e){return o({active:e})},label:c.active?"Yes":"No"}),Object(Me.jsx)(jB,{editing:t,title:"Machine info",data:c,elements:[{name:"commissions",display:"Commissions"},{name:"limitsAndVerification",display:"Limits and verification"}],save:o})]})}):null})),CB={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}}},kB=Object(f.a)(CB),EB=function(e){var t,n=e.editing,a=e.field,r=e.displayValue,i=Object(q.a)(e,["editing","field","displayValue"]),o=kB(),l=(t={},Object(z.a)(t,o.field,!0),Object(z.a)(t,o.notEditing,!n),t);return Object(Me.jsxs)("div",{className:I()(l),children:[!n&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(nt,{children:a.label}),Object(Me.jsx)(Ke,{children:r(a.value)})]}),n&&Object(Me.jsx)(bn.b,Object(s.a)({id:a.name,name:a.name,component:a.component,placeholder:a.placeholder,type:a.type,label:a.label,width:280},i))]})},NB=x()(ZR||(ZR=Object(c.a)(["\n query getData {\n config\n }\n"]))),SB=x()(KR||(KR=Object(c.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),IB=Object(f.a)(gB),FB=function(e){var t,n,r,i,o=e.wizard,c=IB(),s=Object(a.useState)(o||!1),d=Object(l.a)(s,2),m=d[0],h=d[1],p=Object(a.useState)(null),b=Object(l.a)(p,2),f=b[0],j=b[1],g=Object(u.b)(SB,{onCompleted:function(){return h(!1)},refetchQueries:function(){return["getData"]},onError:function(e){return j(e)}}),O=Object(l.a)(g,1)[0],x=Object(u.c)(NB).data,v=function(e){return O({variables:{config:is(Xc,e)}})},y=(null===x||void 0===x?void 0:x.config)&&rs(Xc,x.config);if(!y)return null;var w=xn.f().shape({active:xn.b(),name:xn.h(),phone:xn.h(),email:xn.h().email("Please enter a valid email address").required("An email is required"),website:xn.h(),companyNumber:xn.h()}),C=[{name:"name",label:"Full name",value:null!==(t=y.name)&&void 0!==t?t:"",component:ai},{name:"phone",label:"Phone number",value:y.phone,component:ai},{name:"email",label:"Email",value:null!==(n=y.email)&&void 0!==n?n:"",component:ai},{name:"website",label:"Website",value:null!==(r=y.website)&&void 0!==r?r:"",component:ai},{name:"companyNumber",label:"Company number",value:null!==(i=y.companyNumber)&&void 0!==i?i:"",component:ai}],k=function(e){return Aa.a(W.a("name",e))(C)},E=function(e){return k(e).value},N=function(e){return e},S={initialValues:{active:y.active,name:E("name"),phone:E("phone"),email:E("email"),website:E("website"),companyNumber:E("companyNumber")}},F=function(e){return D.a(e.email)?null:e.email};return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)("div",{className:c.header,children:Object(Me.jsx)(Ue,{children:"Contact information"})}),Object(Me.jsxs)("div",{className:c.switchRow,children:[Object(Me.jsx)(Xe,{children:"Info card enabled?"}),Object(Me.jsxs)("div",{className:c.switch,children:[Object(Me.jsx)(Fr,{checked:y.active,onChange:function(e){return v({active:e.target.checked})}}),Object(Me.jsx)(tt,{children:y.active?"Yes":"No"})]})]}),Object(Me.jsxs)("div",{className:c.section,children:[Object(Me.jsxs)("div",{className:c.header,children:[Object(Me.jsx)(Ue,{children:"Info card"}),!m&&Object(Me.jsx)(ta,{className:c.transparentButton,onClick:function(){return h(!0)},children:Object(Me.jsx)(kh,{})})]}),Object(Me.jsx)(bn.e,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,initialValues:S.initialValues,validationSchema:w,onSubmit:function(e){return v(w.cast(e))},onReset:function(){h(!1),j(null)},children:function(e){var t=e.errors;return Object(Me.jsxs)(bn.d,{children:[Object(Me.jsx)(dm,{}),Object(Me.jsxs)("div",{className:c.row,children:[Object(Me.jsx)(EB,{field:k("name"),editing:m,displayValue:N,onFocus:function(){return j(null)}}),Object(Me.jsx)(EB,{field:k("phone"),editing:m,displayValue:N,onFocus:function(){return j(null)}})]}),Object(Me.jsxs)("div",{className:c.row,children:[Object(Me.jsx)(EB,{field:k("email"),editing:m,displayValue:N,onFocus:function(){return j(null)}}),Object(Me.jsx)(EB,{field:k("website"),editing:m,displayValue:N,onFocus:function(){return j(null)}})]}),Object(Me.jsx)("div",{className:c.row,children:Object(Me.jsx)(EB,{field:k("companyNumber"),editing:m,displayValue:N,onFocus:function(){return j(null)}})}),m&&!!F(t)&&Object(Me.jsx)(Jo,{className:c.formErrorMsg,children:F(t)}),Object(Me.jsx)("div",{className:I()(c.row,c.submit),children:m&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(oa,{color:"primary",type:"submit",children:"Save"}),Object(Me.jsx)(oa,{color:"secondary",type:"reset",children:"Cancel"}),f&&Object(Me.jsx)(Jo,{children:"Failed to save changes"})]})})]})}})]}),!o&&Object(Me.jsxs)("div",{className:I()(c.section,c.infoMessage),children:[Object(Me.jsx)(ir,{}),Object(Me.jsx)(et,{children:"Sharing your information with your customers through your machines allows them to contact you in case there's a problem with a machine in your network or a transaction."})]})]})},LB={header:{display:"flex",position:"relative",alignItems:"center",justifyContent:"space-between",width:800},form:{"& > *":{marginTop:20},display:"flex",flexDirection:"column",height:"100%"},footer:{display:"flex",flexDirection:"row",margin:[["auto",0,24,0]]},submit:{margin:[["auto",0,0,"auto"]]}},PB=Object(f.a)(LB),DB=function(e,t,n){return e&&t?n?"Internal server error":e.event&&t.event?e.event:e.message&&t.message?e.message:null:null},RB={smsCode:{validator:xn.h().required("The message content is required!").trim().test({name:"has-code-tag",message:"A #code tag is missing from the message!",exclusive:!1,test:function(e){var t;return(null===e||void 0===e||null===(t=e.match(/#code/g))||void 0===t?void 0:t.length)>0}}).test({name:"has-single-code-tag",message:"There should be a single #code tag!",exclusive:!1,test:function(e){var t;return 1===(null===e||void 0===e||null===(t=e.match(/#code/g))||void 0===t?void 0:t.length)}})},cashOutDispenseReady:{validator:xn.h().required("The message content is required!").trim().test({name:"has-timestamp-tag",message:"A #timestamp tag is missing from the message!",exclusive:!1,test:function(e){var t;return(null===e||void 0===e||null===(t=e.match(/#timestamp/g))||void 0===t?void 0:t.length)>0}}).test({name:"has-single-timestamp-tag",message:"There should be a single #timestamp tag!",exclusive:!1,test:function(e){var t;return 1===(null===e||void 0===e||null===(t=e.match(/#timestamp/g))||void 0===t?void 0:t.length)}})}},BB=function(e){var t,n,r=e.showModal,i=e.onClose,o=e.sms,c=e.eventOptions,s=e.creationError,d=e.submit,u=PB(),m=Object(a.useState)(null===o||void 0===o?void 0:o.event),h=Object(l.a)(m,2),p=h[0],b=h[1],f={event:D.a(o)?"":o.event,message:D.a(o)?"":o.message},j=xn.f().shape({event:xn.h().required("An event is required!"),message:null!==(t=null===(n=RB[p])||void 0===n?void 0:n.validator)&&void 0!==t?t:xn.h().required("The message content is required!").trim()});return Object(Me.jsx)(Me.Fragment,{children:r&&Object(Me.jsx)(Mh,{title:D.a(o)?"Add custom SMS":"Edit custom SMS",closeOnBackdropClick:!0,width:600,height:500,open:!0,handleClose:i,children:Object(Me.jsx)(bn.e,{validateOnBlur:!1,validateOnChange:!1,initialValues:f,validationSchema:j,onSubmit:function(e,t,n){return function(e){d(o?{variables:{id:o.id,event:e.event,message:e.message}}:{variables:{event:e.event,message:e.message}}),i()}(e)},children:function(e){var t=e.values,n=e.errors,a=e.touched;return Object(Me.jsxs)(bn.d,{id:"custom-sms",className:u.form,children:[Object(Me.jsx)(bn.b,{name:"event",label:"Event",fullWidth:!0,onChange:b(t.event),options:c,labelProp:"display",valueProp:"code",component:Tr}),Object(Me.jsx)(bn.b,{name:"message",label:"Message content",fullWidth:!0,multiline:!0,rows:6,component:ai}),Object(Me.jsxs)("div",{className:u.footer,children:[DB(n,a,s)&&Object(Me.jsx)(Jo,{children:DB(n,a,s)}),Object(Me.jsx)(An,{type:"submit",form:"custom-sms",className:u.submit,children:D.a(o)?"Create SMS":"Confirm"})]})]})}})})})},TB=Object(f.a)(LB),AB=x()(QR||(QR=Object(c.a)(["\n query customMessages {\n customMessages {\n id\n event\n message\n }\n }\n"]))),MB=x()(YR||(YR=Object(c.a)(["\n mutation createCustomMessage($event: CustomMessageEvent!, $message: String!) {\n createCustomMessage(event: $event, message: $message) {\n id\n }\n }\n"]))),WB=x()(JR||(JR=Object(c.a)(["\n mutation editCustomMessage(\n $id: ID!\n $event: CustomMessageEvent!\n $message: String!\n ) {\n editCustomMessage(id: $id, event: $event, message: $message) {\n id\n }\n }\n"]))),zB=x()(eB||(eB=Object(c.a)(["\n mutation deleteCustomMessage($id: ID!) {\n deleteCustomMessage(id: $id) {\n id\n }\n }\n"]))),qB=[{code:"smsCode",display:"On SMS confirmation code"},{code:"cashOutDispenseReady",display:"Cash out dispense ready"}],$B=function(){var e=TB(),t=Object(a.useState)(!1),n=Object(l.a)(t,2),r=n[0],i=n[1],o=Object(a.useState)(!1),c=Object(l.a)(o,2),s=c[0],d=c[1],m=Object(a.useState)(null),h=Object(l.a)(m,2),p=h[0],b=h[1],f=Object(a.useState)(""),j=Object(l.a)(f,2),g=j[0],O=j[1],x=Object(u.c)(AB),v=x.data,y=x.loading,w=Object(u.b)(MB,{onError:function(e){var t=e.msg;return O(t)},refetchQueries:function(){return["customMessages"]}}),C=Object(l.a)(w,1)[0],k=Object(u.b)(WB,{onError:function(e){var t=e.msg;return O(t)},refetchQueries:function(){return["customMessages"]}}),E=Object(l.a)(k,1)[0],N=Object(u.b)(zB,{onError:function(e){var t=e.msg;return O(t)},refetchQueries:function(){return["customMessages"]}}),S=Object(l.a)(N,1)[0],I=y,F=function(){b(null),d(!1),i(!1)},L=[{header:"Event",width:600,size:"sm",textAlign:"left",view:function(e){return Aa.a((function(t){return W.a("event",t.code,e)}),qB).display}},{header:"Edit",width:100,size:"sm",textAlign:"center",view:function(e){return Object(Me.jsx)(ta,{onClick:function(){b(e),d(!0)},children:Object(Me.jsx)(kh,{})})}},{header:"Delete",width:100,size:"sm",textAlign:"center",view:function(e){return Object(Me.jsx)(ta,{onClick:function(){b(e),i(!0)},children:Object(Me.jsx)(hh,{})})}}];return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)("div",{className:e.header,children:[Object(Me.jsx)(Ue,{children:"Custom SMS message"}),Object(Me.jsx)(Ko.a,{display:"flex",justifyContent:"flex-end",children:Object(Me.jsx)(oa,{color:"primary",onClick:function(){return O(""),void d(!0)},children:"Add custom SMS"})})]}),s&&Object(Me.jsx)(BB,{showModal:s,onClose:F,eventOptions:qB,sms:p,creationError:g,submit:p?E:C}),Object(Me.jsx)($m,{open:r,onDismissed:function(){F()},onConfirmed:function(){F(),S({variables:{id:p.id}})},errorMessage:g}),Object(Me.jsx)(gy,{emptyText:"No custom SMS so far",elements:L,loading:I,data:A.a(["customMessages"])(v)})]})},HB=Object(f.a)(gB),VB=x()(tB||(tB=Object(c.a)(["\n query getData {\n config\n }\n"]))),UB=x()(nB||(nB=Object(c.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),GB=Object(a.memo)((function(e){var t=e.wizard,n=HB(),a=Object(u.c)(VB).data,r=Object(u.b)(UB,{refetchQueries:function(){return["getData"]}}),i=Object(l.a)(r,1)[0],o=(null===a||void 0===a?void 0:a.config)&&rs(Qc,a.config);return o?Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)("div",{className:n.header,children:Object(Me.jsx)(Ue,{children:"Receipt options"})}),Object(Me.jsxs)("div",{className:n.switchRow,children:[Object(Me.jsx)(Xe,{children:"Enable receipt printing"}),Object(Me.jsxs)("div",{className:n.switch,children:[Object(Me.jsx)(Fr,{checked:o.active,onChange:function(e){return i({variables:{config:is(Qc,Gn.a(o,{active:e.target.checked}))}})}}),Object(Me.jsx)(tt,{children:o.active?"Yes":"No"})]})]}),Object(Me.jsxs)("div",{className:n.switchRow,children:[Object(Me.jsx)(Xe,{children:"Offer SMS receipt"}),Object(Me.jsxs)("div",{className:n.switch,children:[Object(Me.jsx)(Fr,{checked:o.sms,onChange:function(e){return i({variables:{config:is(Qc,Gn.a(o,{sms:e.target.checked}))}})}}),Object(Me.jsx)(tt,{children:o.sms?"Yes":"No"})]})]}),Object(Me.jsx)(jB,{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:is(Qc,e)}})}})]}):null})),XB=Object(f.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}}}),_B=function(e){var t,n=e.editing,a=e.name,r=e.width,i=e.placeholder,o=e.label,l=e.value,c=e.multiline,d=void 0!==c&&c,u=e.rows,m=e.onFocus,h=Object(q.a)(e,["editing","name","width","placeholder","label","value","multiline","rows","onFocus"]),p=XB(),b=(t={},Object(z.a)(t,p.field,!0),Object(z.a)(t,p.notEditing,!n),Object(z.a)(t,p.notEditingSingleLine,!n&&!d),Object(z.a)(t,p.notEditingMultiline,!n&&d),t);return Object(Me.jsxs)("div",{className:I()(b),children:[!n&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(nt,{children:o}),Object(Me.jsx)(Ke,{children:l})]}),n&&Object(Me.jsx)(bn.b,Object(s.a)({id:a,name:a,component:ai,width:r,placeholder:i,type:"text",label:o,multiline:d,rows:u,rowsMax:"6",onFocus:m},h))]})},ZB=x()(aB||(aB=Object(c.a)(["\n query getData {\n config\n }\n"]))),KB=x()(rB||(rB=Object(c.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),QB=Object(f.a)(gB),YB=function(){var e,t,n,r,i,o,c=Object(a.useState)(null),s=Object(l.a)(c,2),d=s[0],m=s[1],h=Object(a.useState)(!1),p=Object(l.a)(h,2),b=p[0],f=p[1],j=Object(u.b)(KB,{onCompleted:function(){m(null),f(!1)},refetchQueries:function(){return["getData"]},onError:function(e){return m(e)}}),g=Object(l.a)(j,1)[0],O=QB(),x=Object(u.c)(ZB).data,v=(null===x||void 0===x?void 0:x.config)&&rs(Jc,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:is(Jc,e)}})},E=[{name:"title",label:"Screen title",value:null!==(n=y.title)&&void 0!==n?n:"",width:282},{name:"text",label:"Text content",value:null!==(r=y.text)&&void 0!==r?r:"",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 Aa.a(W.a("name",e))(E)}(e).value},S={title:N("title"),text:N("text"),acceptButtonText:N("acceptButtonText"),cancelButtonText:N("cancelButtonText")},F=xn.f().shape({title:xn.h().required().max(50,"Too long"),text:xn.h().required(),acceptButtonText:xn.h().required().max(50,"Too long"),cancelButtonText:xn.h().required().max(50,"Too long")});return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)("div",{className:O.header,children:Object(Me.jsx)(Ue,{children:"Terms & Conditions"})}),Object(Me.jsxs)("div",{className:O.switchRow,children:[Object(Me.jsx)(Xe,{children:"Show on screen"}),Object(Me.jsxs)("div",{className:O.switch,children:[Object(Me.jsx)(Fr,{checked:w,onChange:function(e){return k({active:e.target.checked})}}),Object(Me.jsx)(tt,{children:w?"Yes":"No"})]})]}),Object(Me.jsxs)("div",{className:O.switchRow,children:[Object(Me.jsx)(Xe,{children:"Add 7 seconds delay on screen"}),Object(Me.jsxs)("div",{className:O.switch,children:[Object(Me.jsx)(Fr,{checked:C,onChange:function(e){return k({delay:e.target.checked})}}),Object(Me.jsx)(tt,{children:C?"Yes":"No"})]})]}),Object(Me.jsxs)("div",{className:O.header,children:[Object(Me.jsx)(Ze,{children:"Info card"}),!b&&Object(Me.jsx)(ta,{className:O.transparentButton,onClick:function(){return f(!0)},children:Object(Me.jsx)(kh,{})})]}),Object(Me.jsx)(bn.e,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,initialValues:S,validationSchema:F,onSubmit:function(e){return k(e)},onReset:function(){f(!1),m(null)},children:Object(Me.jsxs)(bn.d,{children:[Object(Me.jsx)(dm,{}),E.map((function(e,t){return Object(Me.jsx)("div",{className:O.row,children:Object(Me.jsx)(_B,{editing:b,name:e.name,width:e.width,placeholder:e.placeholder,label:e.label,value:e.value,multiline:e.multiline,rows:e.rows,onFocus:function(){return m(null)}})},t)})),Object(Me.jsx)("div",{className:I()(O.row,O.submit),children:b&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(oa,{color:"primary",type:"submit",children:"Save"}),Object(Me.jsx)(oa,{color:"secondary",type:"reset",children:"Cancel"}),d&&Object(Me.jsx)(Jo,{children:"Failed to save changes"})]})})]})})]})},JB={running:ne,notRunning:"#ffeceb"},eT={running:"#ecfbef",notRunning:me},tT={uptimeContainer:{display:"inline-block",minWidth:104,margin:[[0,20]]},name:{extend:Be.label1,paddingLeft:4,color:se}},nT=Object(f.a)(tT),aT=Object(f.a)({root:{borderRadius:4,marginTop:4,marginRight:2,marginBottom:4,marginLeft:2,height:24,backgroundColor:function(e){var t=e.type;return eT[t]}},label:{fontSize:ye,fontWeight:Ee,fontFamily:Ne,padding:[[4,8]],color:function(e){var t=e.type;return JB[t]}}}),rT=function(e){var t,n=e.process,a=(Object(q.a)(e,["process"]),nT());return Object(Me.jsxs)("div",{className:a.uptimeContainer,children:[Object(Me.jsx)("div",{className:a.name,children:Iv.a(n.name)}),Object(Me.jsx)(Ar.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"))):Dm(n.state),classes:aT({type:"RUNNING"===n.state?"running":"notRunning"})})]})},iT={serverTableWrapper:{extend:uf.tableWrapper,maxWidth:"100%",marginLeft:0},serverVersion:{extend:Be.p,color:se,margin:"auto 0 auto 0"},headerLine2:{display:"flex",justifyContent:"space-between",marginBottom:24},uptimeContainer:{margin:"auto 0 auto 0"}},oT=Gn.a(uf,iT),lT=Object(f.a)(oT),cT={code:"SHOW_ALL",display:"Show all"},sT=x()(iB||(iB=Object(c.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"]))),dT=x()(oB||(oB=Object(c.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"]))),uT=x()(lB||(lB=Object(c.a)(["\n query getData {\n config\n }\n"]))),mT=function(){var e,t,n=lT(),r=Object(a.useRef)(),i=Object(a.useState)(null),o=Object(l.a)(i,2),c=o[0],s=o[1],d=Object(a.useState)(cT),m=Object(l.a)(d,2),h=m[0],p=m[1],b=Object(u.c)(dT,{onCompleted:function(){return s("")},variables:{limit:500}}),f=b.data,j=b.loading,g=Object(u.c)(uT),O=g.data,x=g.configLoading,v=A.a(["config","locale_timezone"],O),y=null===f||void 0===f?void 0:f.serverVersion,w=null!==(e=null===f||void 0===f?void 0:f.uptime)&&void 0!==e?e:[],C=L.a(im.a(cT),wg.a,ll.a([{code:"error",display:"Error"},{code:"info",display:"Info"},{code:"debug",display:"Debug"}]),R.a((function(e){return{code:A.a(["logLevel"])(e),display:Bm(A.a(["logLevel"])(e))}})),A.a(["serverLogs"]));return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)("div",{className:n.titleWrapper,children:[Object(Me.jsxs)("div",{className:n.titleAndButtonsContainer,children:[Object(Me.jsx)(yn,{children:"Server"}),f&&Object(Me.jsxs)("div",{className:n.buttonsWrapper,children:[Object(Me.jsx)(qP,{title:"Download logs",name:"server-logs",query:sT,args:{timezone:v},logs:f.serverLogs,getLogs:function(e){return A.a(["serverLogsCsv"])(e)},timezone:v}),Object(Me.jsx)(Ke,{children:c})]})]}),Object(Me.jsx)("div",{className:n.serverVersion,children:y&&Object(Me.jsxs)("span",{children:["Server version: v",y]})})]}),Object(Me.jsxs)("div",{className:n.headerLine2,children:[f&&Object(Me.jsx)(th,{onSelectedItemChange:function(e){r.current&&r.current.scrollTo(0,0),p(e)},label:"Level",items:C(f),default:cT,selectedItem:h}),Object(Me.jsx)("div",{className:n.uptimeContainer,children:w&&w.map((function(e,t){return Object(Me.jsx)(rT,{process:e},t)}))})]}),Object(Me.jsx)("div",{className:n.wrapper,children:Object(Me.jsxs)("div",{ref:r,className:n.serverTableWrapper,children:[Object(Me.jsxs)(Cs,{className:n.table,children:[Object(Me.jsx)(Ss,{children:Object(Me.jsxs)(Bs,{header:!0,children:[Object(Me.jsx)(Ls,{className:n.dateColumn,children:"Date"}),Object(Me.jsx)(Ls,{className:n.levelColumn,children:"Level"}),Object(Me.jsx)(Ls,{className:n.fillColumn})]})}),Object(Me.jsx)(ks,{children:f&&f.serverLogs.filter((function(e){return h===cT||e.logLevel===h.code})).map((function(e,t){return Object(Me.jsxs)(Bs,{size:"sm",children:[Object(Me.jsx)(Ns,{children:v&&ad(e.timestamp,v,"yyyy-MM-dd HH:mm")}),Object(Me.jsx)(Ns,{children:e.logLevel}),Object(Me.jsx)(Ns,{children:e.message})]},t)}))})]}),j&&x&&Object(Me.jsx)(Ue,{children:"Loading..."}),!j&&!x&&!(null===f||void 0===f||null===(t=f.serverLogs)||void 0===t?void 0:t.length)&&Object(Me.jsx)(Ue,{children:"No activity so far"})]})})]})},hT=n(946),pT=n(916),bT=n(917),fT={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:Be.label1,color:se,marginBottom:4},item:{extend:Be.p,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},jT=Object(f.a)(fT),gT=function(e){var t=e.width,n=void 0===t?378:t,a=e.height,r=void 0===a?128:a,i=e.title,o=e.items,l=e.onEdit,c=e.className,s=jT({width:n,height:r});return Object(Me.jsx)(Me.Fragment,{children:Object(Me.jsxs)(jm,{className:I()(c,s.table),children:[Object(Me.jsx)(gm,{children:Object(Me.jsxs)(ym,{className:s.head,children:[i,Object(Me.jsx)(ta,{onClick:l,className:s.button,children:Object(Me.jsx)(xN,{})})]})}),Object(Me.jsx)(xm,{children:Object(Me.jsx)(Cm,{className:s.tr,children:Object(Me.jsx)(vm,{width:n,children:o&&Object(Me.jsxs)(Me.Fragment,{children:[o[0]&&Object(Me.jsxs)("div",{className:s.itemWrapper,children:[Object(Me.jsx)("div",{className:s.label,children:o[0].label}),Object(Me.jsx)("div",{className:s.item,children:o[0].value})]}),o[1]&&Object(Me.jsxs)("div",{className:s.itemWrapper,children:[Object(Me.jsx)("div",{className:s.label,children:o[1].label}),Object(Me.jsx)("div",{className:s.item,children:o[1].value})]})]})})})})]})})},OT=x()(cB||(cB=Object(c.a)(["\n query getData {\n accounts\n config\n }\n"]))),xT=x()(sB||(sB=Object(c.a)(["\n mutation Save($accounts: JSONObject) {\n saveAccounts(accounts: $accounts)\n }\n"]))),vT=Object(f.a)({wrapper:{marginLeft:1}}),yT=function(){var e,t=Object(a.useState)(null),n=Object(l.a)(t,2),r=n[0],i=n[1],o=Object(u.c)(OT).data,c=Object(u.b)(xT,{onCompleted:function(){return i(null)},refetchQueries:["getData"]}),d=Object(l.a)(c,1)[0],m=vT(),p=null!==(e=null===o||void 0===o?void 0:o.accounts)&&void 0!==e?e:{},b=function(e,t){var n=M.a(B.a("face"))(t),a=p[e]||{};return R.a((function(e){var t,n=e.display,r=e.code;return{label:n,value:e.long?(t=a[r],!t||t.length<=20?t:"".concat(t.slice(0,8),"(...)").concat(t.slice(t.length-8,t.length))):a[r]}}))(n)};return Object(Me.jsxs)("div",{className:m.wrapper,children:[Object(Me.jsx)(nl,{title:"3rd Party Services"}),Object(Me.jsx)(h.a,{container:!0,spacing:4,children:sd.a(gx).map((function(e){return Object(Me.jsx)(h.a,{item:!0,children:Object(Me.jsx)(gT,{editMessage:"Configure "+e.title,title:e.title,onEdit:function(){return i(e)},items:b(e.code,e.elements)})},e.code)}))}),r&&Object(Me.jsx)(Mh,{title:"Edit ".concat(r.name),width:478,handleClose:function(){return i(null)},open:!0,children:Object(Me.jsx)(BO,{save:function(e){return d({variables:{accounts:Object(z.a)({},r.code,e)}})},elements:function(e){var t=e.code,n=e.elements;return R.a((function(e){return e.component===Yr?function(e){var t=e.settings,n=hT.a(["config","wallets_BTC_wallet"]),a=yd.a(pT.a(n,o),t.requirement);return t.enabled=a,e}(e):e.component!==ni?e:Object(s.a)(Object(s.a)({},e),{},{inputProps:{isPasswordFilled:!D.a(p[t])&&!D.a(A.a([e.code],p[t]))}})}),n)}(r),validationSchema:function(e){var t=e.code,n=e.getValidationSchema;return n(p[t])}(r),value:function(e){var t=e.elements,n=e.code,a=p[n],r=M.a(W.a("component",ni)),i=R.a(B.a(["code"])),o=L.a(i,r)(t);return bT.a((function(e,t){return F.a(t,o)?"":e}),a)}(r)})})]})},wT=n(454),CT=n.n(wT),kT=x()(dB||(dB=Object(c.a)(["\n query sessions {\n sessions {\n sid\n sess\n expire\n }\n }\n"]))),ET=x()(uB||(uB=Object(c.a)(["\n mutation deleteSession($sid: String!) {\n deleteSession(sid: $sid) {\n sid\n }\n }\n"]))),NT=x()(mB||(mB=Object(c.a)(["\n query getData {\n config\n }\n"]))),ST=function(){var e=Object(u.c)(kT),t=e.data,n=e.loading,a=Object(u.b)(ET,{refetchQueries:function(){return["sessions"]}}),r=Object(l.a)(a,1)[0],i=Object(u.c)(NT),o=i.data,c=i.loading,s=A.a(["config","locale_timezone"],o),d=[{header:"Login",width:207,textAlign:"left",size:"sm",view:function(e){return e.sess.user.username}},{header:"Last known use",width:305,textAlign:"center",size:"sm",view:function(e){if(D.a(e.sess.ua))return"No Record";var t=CT()(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(ad(e.expire,s,"yyyy-MM-dd")," ").concat(ad(e.expire,s,"HH:mm:ss"))}},{header:"",width:80,textAlign:"center",size:"sm",view:function(e){return Object(Me.jsx)(ta,{onClick:function(){r({variables:{sid:e.sid}})},children:Object(Me.jsx)(hh,{})})}}];return!(n&&c)&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(nl,{title:"Session Management"}),Object(Me.jsx)(gy,{elements:d,data:A.a(["sessions"])(t)})]})};function IT(){return(IT=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function FT(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var LT=a.createElement("defs",null,a.createElement("circle",{id:"path-1-right",cx:10,cy:10,r:10})),PT=a.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"pop-up/action/download-logs/date-range-copy-2",transform:"translate(-232.000000, -187.000000)"},a.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)"},a.createElement("mask",{id:"mask-2",fill:"white"},a.createElement("use",{xlinkHref:"#path-1-right"})),a.createElement("use",{id:"Mask",fill:"#FFFFFF",fillRule:"nonzero",xlinkHref:"#path-1-right"}),a.createElement("g",{id:"icon/sf-small/wizzard",mask:"url(#mask-2)",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{transform:"translate(6.666667, 6.000000)",id:"Group"},a.createElement("g",null,a.createElement("polyline",{id:"Path-3",stroke:"#1B2559",strokeWidth:2,points:"0 4.83333333 3.33333333 8.16666667 6.66666667 4.83333333"}),a.createElement("line",{x1:3.33333333,y1:.25,x2:3.33333333,y2:6.5,id:"Path-4",stroke:"#1B2559",strokeWidth:2})))))));function DT(e,t){var n=e.title,r=e.titleId,i=FT(e,["title","titleId"]);return a.createElement("svg",IT({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":r},i),n?a.createElement("title",{id:r},n):null,LT,PT)}var RT,BT,TT,AT,MT=a.forwardRef(DT),WT=(n.p,Object(f.a)(ff)),zT=1e3,qT=x()(RT||(RT=Object(c.a)(["\n query getData {\n config\n }\n"]))),$T=x()(BT||(BT=Object(c.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"]))),HT=x()(TT||(TT=Object(c.a)(["\n query filters {\n transactionFilters {\n type\n value\n }\n }\n"]))),VT=x()(AT||(AT=Object(c.a)(["\n query transactions(\n $limit: Int\n $from: Date\n $until: Date\n $txClass: String\n $machineName: String\n $customerName: String\n $fiatCode: String\n $cryptoCode: String\n $toAddress: String\n $status: String\n ) {\n transactions(\n limit: $limit\n from: $from\n until: $until\n txClass: $txClass\n machineName: $machineName\n customerName: $customerName\n fiatCode: $fiatCode\n cryptoCode: $cryptoCode\n toAddress: $toAddress\n status: $status\n ) {\n id\n txClass\n txHash\n toAddress\n commissionPercentage\n expired\n machineName\n operatorCompleted\n sendConfirmed\n dispense\n hasError: error\n deviceId\n fiat\n cashInFee\n fiatCode\n cryptoAtoms\n cryptoCode\n toAddress\n created\n customerName\n customerIdCardData\n customerIdCardPhotoPath\n customerFrontCameraPath\n customerPhone\n discount\n customerId\n isAnonymous\n batched\n batchTime\n }\n }\n"]))),UT=function(e){return hs.a((function(e,t){return Object(s.a)(Object(s.a)({},e),{},Object(z.a)({},t.type,t.value))}),{},e)},GT=function(){var e,t=WT(),n=Object(w.h)(),r=Object(a.useState)([]),i=Object(l.a)(r,2),o=i[0],c=i[1],s=Object(u.c)(HT),d=s.data,m=s.loading,h=Object(a.useState)({limit:zT}),p=Object(l.a)(h,2),b=p[0],f=p[1],j=Object(u.c)(VT,{variables:b}),g=j.data,O=j.loading,x=j.refetch,v=j.startPolling,y=j.stopPolling;Object(a.useEffect)((function(){return v(1e4),y}));var C=null!==(e=null===g||void 0===g?void 0:g.transactions)&&void 0!==e?e:[],k=Object(u.c)(qT),E=k.data,N=k.configLoading,S=A.a(["config","locale_timezone"],E),I=function(e){return e.isAnonymous?"Anonymous":e.customerName?e.customerName:e.customerIdCardData?function(e){var t=e.firstName,n=e.lastName;return"".concat(wf.a(Cf.a,kf.a)(t),". ").concat(n)}(e.customerIdCardData):e.customerPhone},F=[{header:"",width:32,size:"sm",view:function(e){return"cashOut"===e.txClass?Object(Me.jsx)(Bc,{}):Object(Me.jsx)(Sc,{})}},{header:"Machine",name:"machineName",width:160,size:"sm",view:A.a(["machineName"])},{header:"Customer",width:202,size:"sm",view:function(e){return Object(Me.jsxs)("div",{className:t.flexWrapper,children:[Object(Me.jsx)("div",{className:t.overflowTd,children:I(e)}),!e.isAnonymous&&Object(Me.jsx)("div",{onClick:function(){return t=e.customerId,n.push("/compliance/customer/".concat(t));var t},children:e.hasError?Object(Me.jsx)(MT,{className:t.customerLinkIcon}):Object(Me.jsx)(Ru,{className:t.customerLinkIcon})})]})}},{header:"Cash",width:144,textAlign:"right",size:"sm",view:function(e){return"".concat(Number.parseFloat(e.fiat)," ").concat(e.fiatCode)}},{header:"Crypto",width:150,textAlign:"right",size:"sm",view:function(e){return"".concat(yf.utils.toUnit(new Mc.a(e.cryptoAtoms),e.cryptoCode)," ").concat(e.cryptoCode)}},{header:"Address",view:function(e){return yf.utils.formatCryptoAddress(e.cryptoCode,e.toAddress)},className:t.overflowTd,size:"sm",width:140},{header:"Date (UTC)",view:function(e){return S&&ad(e.created,S,"yyyy-MM-dd HH:mm:ss")},textAlign:"right",size:"sm",width:195},{header:"Status",view:function(e){return Rj(e)},textAlign:"left",size:"sm",width:80}],L=A.a(["transactionFilters"])(d),P=O||m||N,D=Object(Me.jsx)("svg",{width:12,height:12,children:Object(Me.jsx)("rect",{width:12,height:12,rx:3,fill:me})});return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)("div",{className:t.titleWrapper,children:[Object(Me.jsxs)("div",{className:t.titleAndButtonsContainer,children:[Object(Me.jsx)(yn,{children:"Transactions"}),Object(Me.jsx)("div",{className:t.buttonsWrapper,children:Object(Me.jsx)(vI,{loading:m,filters:o,options:L,inputPlaceholder:"Search Transactions",onChange:function(e){var t=UT(e);c(e),f({limit:zT,txClass:t.type,machineName:t.machine,customerName:t.customer,fiatCode:t.fiat,cryptoCode:t.crypto,toAddress:t.address,status:t.status}),x&&x()}})}),C&&Object(Me.jsx)("div",{className:t.buttonsWrapper,children:Object(Me.jsx)(qP,{title:"Download logs",name:"transactions",query:$T,getLogs:function(e){return A.a(["transactionsCsv"])(e)},simplified:!0,timezone:S,args:{timezone:S}})})]}),Object(Me.jsxs)("div",{className:t.headerLabels,children:[Object(Me.jsxs)("div",{children:[Object(Me.jsx)(Sc,{}),Object(Me.jsx)("span",{children:"Cash-in"})]}),Object(Me.jsxs)("div",{children:[Object(Me.jsx)(Bc,{}),Object(Me.jsx)("span",{children:"Cash-out"})]}),Object(Me.jsxs)("div",{children:[D,Object(Me.jsx)("span",{children:"Transaction error"})]})]})]}),o.length>0&&Object(Me.jsx)(WI,{entries:C.length,filters:o,onFilterDelete:function(e){var t=M.a((function(t){return!mI.a(Mm.a(["type","value"],t),e)}))(o);c(t);var n=UT(t);f({limit:zT,txClass:n.type,machineName:n.machine,customerName:n.customer,fiatCode:n.fiat,cryptoCode:n.crypto,toAddress:n.address,status:n.status}),x&&x()},deleteAllFilters:function(){c([]);var e=UT([]);f({limit:zT,txClass:e.type,machineName:e.machine,customerName:e.customer,fiatCode:e.fiat,cryptoCode:e.crypto,toAddress:e.address,status:e.status}),x&&x()}}),Object(Me.jsx)(gy,{loading:P,emptyText:"No transactions so far",elements:F,data:C,Details:Hj,expandable:!0,rowSize:"sm",timezone:S})]})};function XT(){return(XT=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function _T(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var ZT=a.createElement("desc",null,"Created with Sketch."),KT=a.createElement("g",{id:"icon/sf-small/filter/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("path",{d:"M19,2.5 C19,1.11909091 17.8809091,0 16.5,0 C15.1190909,0 14,1.11909091 14,2.5 C14,3.88090909 15.1190909,5 16.5,5 C17.8809091,5 19,3.88090909 19,2.5 Z",id:"Stroke-1",stroke:"#FFFFFF",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),a.createElement("path",{d:"M5,9.5 C5,8.11909091 3.88090909,7 2.5,7 C1.11909091,7 0,8.11909091 0,9.5 C0,10.8818182 1.11909091,12 2.5,12 C3.88090909,12 5,10.8818182 5,9.5 Z",id:"Stroke-7",stroke:"#FFFFFF",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),a.createElement("path",{d:"M19,17.5 C19,16.1190909 17.8809091,15 16.5,15 C15.1190909,15 14,16.1190909 14,17.5 C14,18.8809091 15.1190909,20 16.5,20 C17.8809091,20 19,18.8809091 19,17.5 Z",id:"Stroke-9",stroke:"#FFFFFF",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),a.createElement("line",{x1:14,y1:2.5,x2:.498999482,y2:2.5,id:"Line-3",stroke:"#FFFFFF",strokeWidth:2,strokeLinecap:"square"}),a.createElement("line",{x1:20,y1:9.5,x2:6.49899948,y2:9.5,id:"Line-3-Copy",stroke:"#FFFFFF",strokeWidth:2,strokeLinecap:"square"}),a.createElement("line",{x1:14,y1:17.5,x2:.498999482,y2:17.5,id:"Line-3-Copy-2",stroke:"#FFFFFF",strokeWidth:2,strokeLinecap:"square"}));function QT(e,t){var n=e.title,r=e.titleId,i=_T(e,["title","titleId"]);return a.createElement("svg",XT({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":r},i),n?a.createElement("title",{id:r},n):null,ZT,KT)}var YT=a.forwardRef(QT);n.p;function JT(){return(JT=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function eA(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var tA=a.createElement("desc",null,"Created with Sketch."),nA=a.createElement("g",{id:"icon/sf-small/filter/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("path",{d:"M19,2.5 C19,1.11909091 17.8809091,0 16.5,0 C15.1190909,0 14,1.11909091 14,2.5 C14,3.88090909 15.1190909,5 16.5,5 C17.8809091,5 19,3.88090909 19,2.5 Z",id:"Stroke-1",stroke:"#1B2559",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),a.createElement("path",{d:"M5,9.5 C5,8.11909091 3.88090909,7 2.5,7 C1.11909091,7 0,8.11909091 0,9.5 C0,10.8818182 1.11909091,12 2.5,12 C3.88090909,12 5,10.8818182 5,9.5 Z",id:"Stroke-7",stroke:"#1B2559",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),a.createElement("path",{d:"M19,17.5 C19,16.1190909 17.8809091,15 16.5,15 C15.1190909,15 14,16.1190909 14,17.5 C14,18.8809091 15.1190909,20 16.5,20 C17.8809091,20 19,18.8809091 19,17.5 Z",id:"Stroke-9",stroke:"#1B2559",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),a.createElement("line",{x1:14,y1:2.5,x2:.498999482,y2:2.5,id:"Line-3",stroke:"#1B2559",strokeWidth:2,strokeLinecap:"square"}),a.createElement("line",{x1:20,y1:9.5,x2:6.49899948,y2:9.5,id:"Line-3-Copy",stroke:"#1B2559",strokeWidth:2,strokeLinecap:"square"}),a.createElement("line",{x1:14,y1:17.5,x2:.498999482,y2:17.5,id:"Line-3-Copy-2",stroke:"#1B2559",strokeWidth:2,strokeLinecap:"square"}));function aA(e,t){var n=e.title,r=e.titleId,i=eA(e,["title","titleId"]);return a.createElement("svg",JT({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":r},i),n?a.createElement("title",{id:r},n):null,tA,nA)}var rA=a.forwardRef(aA);n.p;function iA(){return(iA=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function oA(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var lA=a.createElement("desc",null,"Created with Sketch."),cA=a.createElement("g",{id:"icon/sf-small/settings/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinejoin:"round"},a.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 sA(e,t){var n=e.title,r=e.titleId,i=oA(e,["title","titleId"]);return a.createElement("svg",iA({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":r},i),n?a.createElement("title",{id:r},n):null,lA,cA)}var dA=a.forwardRef(sA);n.p;function uA(){return(uA=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function mA(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var hA=a.createElement("desc",null,"Created with Sketch."),pA=a.createElement("g",{id:"icon/sf-small/settings/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinejoin:"round"},a.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 bA(e,t){var n=e.title,r=e.titleId,i=mA(e,["title","titleId"]);return a.createElement("svg",uA({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":r},i),n?a.createElement("title",{id:r},n):null,hA,pA)}var fA=a.forwardRef(bA),jA=(n.p,Object(f.a)({flex:{display:"flex"},column:{flexDirection:"column"},halfWidth:{width:"50%",marginBottom:15,marginRight:50},marginTop:{marginTop:20},marginBottom:{marginBottom:20}})),gA=function(e){var t=e.it.customRequest,n=jA();return Object(Me.jsxs)("div",{children:[Object(Me.jsxs)("div",{className:I()(n.flex,n.row,n.marginTop),children:[Object(Me.jsxs)("div",{className:n.halfWidth,children:[Object(Me.jsx)(Ze,{children:"Screen 1 title"}),Object(Me.jsx)(et,{children:t.screen1.title})]}),Object(Me.jsx)("div",{className:I()(n.halfWidth,n.flex),children:function(){var e="spaceSeparation"===t.input.constraintType?"First word label":"Text entry label";switch(t.input.type){case"text":return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)("div",{className:n.halfWidth,children:[Object(Me.jsx)(Ze,{children:e}),Object(Me.jsx)(et,{children:t.input.label1})]}),"spaceSeparation"===t.input.constraintType&&Object(Me.jsxs)("div",{className:n.halfWidth,children:[Object(Me.jsx)(Ze,{children:"Second word label"}),Object(Me.jsx)(et,{children:t.input.label2})]})]});default:return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)("div",{className:n.halfWidth,children:[Object(Me.jsx)(Ze,{children:"Screen 2 input title"}),Object(Me.jsx)(et,{children:t.screen2.title})]}),Object(Me.jsxs)("div",{className:n.halfWidth,children:[Object(Me.jsx)(Ze,{children:"Screen 2 input description"}),Object(Me.jsx)(et,{children:t.screen2.text})]})]})}}()})]}),Object(Me.jsxs)("div",{className:I()(n.flex,n.row,n.marginBottom),children:[Object(Me.jsxs)("div",{className:n.halfWidth,children:[Object(Me.jsx)(Ze,{children:"Screen 1 text"}),Object(Me.jsx)(et,{children:t.screen1.text})]}),Object(Me.jsx)("div",{className:n.halfWidth,children:Object(Me.jsxs)(Me.Fragment,{children:[t.input.choiceList&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Ze,{children:"Choices"}),t.input.choiceList.map((function(e,t){return Object(Me.jsx)(et,{children:e},t)}))]}),t.input.numDigits&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Ze,{children:"Number of digits"}),Object(Me.jsx)(et,{children:t.input.numDigits})]})]})})]})]})},OA=n(460),xA=n(947),vA=Object(a.memo)((function(e){var t=e.enforceValueSet,n=void 0===t||t,a=Object(q.a)(e,["enforceValueSet"]),r=a.field,i=r.name,o=r.value,l=a.form.setFieldValue;return Object(Me.jsx)(Br,Object(s.a)({name:i,value:o,options:a.options,ariaLabel:i,onChange:function(e,t){if(n&&!t)return null;l(i,t),a.resetError&&a.resetError()},className:a.className},a))}));function yA(){return(yA=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function wA(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var CA=a.createElement("g",{id:"entry-icon/keyboard",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"Group-2-Copy-2",transform:"translate(0.000000, 6.000000)",fill:"#1B2559"},a.createElement("rect",{id:"Rectangle",x:0,y:0,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-5",x:0,y:12,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-8",x:0,y:24,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-3",x:12,y:113686838e-21,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-6",x:12,y:12,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-9",x:12,y:24,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-11",x:64,y:24,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-32",x:52,y:24,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-4",x:24,y:113686838e-21,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-26",x:36,y:113686838e-21,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-27",x:48,y:113686838e-21,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-28",x:60,y:113686838e-21,width:12,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-7",x:24,y:12,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-29",x:36,y:12,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-30",x:48,y:12,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-31",x:60,y:12,width:12,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-10",x:24,y:24,width:24,height:8,rx:2})));function kA(e,t){var n=e.title,r=e.titleId,i=wA(e,["title","titleId"]);return a.createElement("svg",yA({width:"72px",height:"44px",viewBox:"0 0 72 44",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),void 0===n?a.createElement("title",{id:r},"entry-icon/keyboard"):n?a.createElement("title",{id:r},n):null,CA)}var EA=a.forwardRef(kA);n.p;function NA(){return(NA=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function SA(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var IA=a.createElement("g",{id:"entry-icon/keypad",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"Group",transform:"translate(20.000000, 0.000000)",fill:"#1B2559"},a.createElement("rect",{id:"Rectangle",x:0,y:0,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-5",x:0,y:12,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-8",x:0,y:24,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-3",x:12,y:0,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-6",x:12,y:12,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-9",x:12,y:24,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-11",x:12,y:36,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-4",x:24,y:0,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-7",x:24,y:12,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-10",x:24,y:24,width:8,height:8,rx:2})));function FA(e,t){var n=e.title,r=e.titleId,i=SA(e,["title","titleId"]);return a.createElement("svg",NA({width:"72px",height:"44px",viewBox:"0 0 72 44",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),void 0===n?a.createElement("title",{id:r},"entry-icon/keypad"):n?a.createElement("title",{id:r},n):null,IA)}var LA=a.forwardRef(FA);n.p;function PA(){return(PA=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function DA(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var RA=a.createElement("g",{id:"entry-icon/list",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"Group-4",transform:"translate(8.000000, 0.000000)",fill:"#1B2559"},a.createElement("rect",{id:"Rectangle-Copy-33",x:0,y:0,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-35",x:0,y:12,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-37",x:0,y:24,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-39",x:0,y:36,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-34",x:12,y:2,width:44,height:4,rx:1}),a.createElement("rect",{id:"Rectangle-Copy-36",x:12,y:14,width:44,height:4,rx:1}),a.createElement("rect",{id:"Rectangle-Copy-38",x:12,y:26,width:44,height:4,rx:1}),a.createElement("rect",{id:"Rectangle-Copy-40",x:12,y:38,width:44,height:4,rx:1})));function BA(e,t){var n=e.title,r=e.titleId,i=DA(e,["title","titleId"]);return a.createElement("svg",PA({width:"72px",height:"44px",viewBox:"0 0 72 44",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),void 0===n?a.createElement("title",{id:r},"entry-icon/list"):n?a.createElement("title",{id:r},n):null,RA)}var TA=a.forwardRef(BA),AA=(n.p,function(e){return Object(Me.jsx)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:G,borderRadius:4,maxWidth:104,maxHeight:64,minWidth:104,minHeight:64},children:Object(Me.jsx)(e,{style:{maxWidth:80}})})}),MA=xn.f().shape({inputType:xn.h().required()}),WA={inputType:""},zA=function(){var e=[{value:"numerical",title:"Numerical entry",description:"User will enter information with a keypad. Good for dates, ID numbers, etc.",icon:function(){return AA(LA)}},{value:"text",title:"Text entry",description:"User will entry information with a keyboard. Good for names, email, address, etc.",icon:function(){return AA(EA)}},{value:"choiceList",title:"Choice list",description:"Gives user multiple options to choose from.",icon:function(){return AA(TA)}}];return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Ue,{children:"Choose the type of data entry"}),Object(Me.jsx)(bn.b,{name:"inputType",component:vA,orientation:"vertical",exclusive:!0,options:e})]})},qA=xn.f().shape({requirementName:xn.h().required()}),$A={requirementName:""},HA=function(){return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Ue,{children:"Name of the requirement"})," ",Object(Me.jsx)(Xe,{children:"The name of the requirement will only be visible to you on the dashboard on the requirement list, as well as on the custom information request list. The user won't see this name. Make sure to make it distinguishable and short."}),Object(Me.jsx)(bn.b,{component:ai,label:"Requirement name",name:"requirementName",fullWidth:!0})]})},VA=xn.f().shape({screen1Title:xn.h().required(),screen1Text:xn.h().required()}),UA={screen1Title:"",screen1Text:""},GA=function(){return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Ue,{children:"Screen 1 Information"})," ",Object(Me.jsx)(Xe,{children:"On screen 1 you will request the user if he agrees on providing this information, or if he wishes to terminate the transaction instead."}),Object(Me.jsx)(bn.b,{component:ai,label:"Screen title",name:"screen1Title",fullWidth:!0}),Object(Me.jsx)(bn.b,{component:ai,label:"Screen text",name:"screen1Text",multiline:!0,fullWidth:!0,rows:5})]})},XA=xn.f().shape({screen2Title:xn.h().required(),screen2Text:xn.h().required()}),_A={screen2Title:"",screen2Text:""},ZA=function(){return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Ue,{children:"Screen 2 Information"})," ",Object(Me.jsx)(Xe,{children:"If the user agrees, on screen 2 is where the user will enter the custom information."}),Object(Me.jsx)(bn.b,{component:ai,label:"Screen 2 input title",name:"screen2Title",fullWidth:!0}),Object(Me.jsx)(bn.b,{component:ai,label:"Screen 2 input description",name:"screen2Text",fullWidth:!0})]})},KA={flex:{display:"flex"},column:{flexDirection:"column"},choiceList:{display:"flex",flexDirection:"column",maxHeight:240,overflowY:"auto"},button:{width:120,height:28,marginTop:28},textInput:{width:420},row:{flexDirection:"row"},subtitle:{marginBottom:0},radioSubtitle:{marginBottom:0},error:{color:me},tl1:{marginLeft:8,marginTop:25},numberField:{marginTop:109,maxWidth:115},label:{width:200,marginRight:8}},QA=Object(f.a)(KA),YA=function(e){return e.text&&e.text.length},JA=[{display:"Select just one",code:"selectOne"},{display:"Select multiple",code:"selectMultiple"}],eM=function(){var e,t,n,r=QA(),i=Object(bn.f)(),o=Object(a.useRef)(null),l=null!==(e=A.a(["values","listChoices"])(i))&&void 0!==e?e:[],c=null!==(t=A.a(["errors","listChoices"])(i))&&void 0!==t&&t,s=(n={},Object(z.a)(n,r.radioSubtitle,!0),Object(z.a)(n,r.error,!A.a(["values","constraintType"])(i)&&A.a(["errors","constraintType"])(i)),n),d=function(e){return c&&M.a(YA)(l).length<2&&0===e.text.length};Object(a.useEffect)((function(){u()}),[l.length]);var u=function(){var e;null===(e=o.current)||void 0===e||e.scrollIntoView()};return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Ue,{className:I()(s),children:"Choice list constraints"}),Object(Me.jsx)(bn.b,{component:ti,options:JA,className:r.row,name:"constraintType"}),Object(Me.jsx)(bn.c,{name:"listChoices",children:function(e){var t=e.push;return Object(Me.jsxs)("div",{className:I()(r.flex,r.column),children:[Object(Me.jsx)(Ue,{className:r.subtitle,children:"Choices"}),Object(Me.jsx)("div",{className:r.choiceList,children:l.map((function(e,t){return Object(Me.jsx)("div",{ref:o,children:Object(Me.jsx)(bn.b,{className:r.textInput,error:d(e),component:ai,name:"listChoices[".concat(t,"].text"),label:"Choice ".concat(t+1)})},t)}))}),Object(Me.jsx)(ze,{Icon:Sn,color:"primary",InverseIcon:oo,className:r.button,onClick:function(e){return e.preventDefault(),t({text:""})},children:"Add choice"})]})}})]})},tM=Object(f.a)(KA),nM=[{display:"None",code:"none"},{display:"Date",code:"date"},{display:"Length",code:"length"}],aM=function(){var e,t,n=tM(),a=Object(bn.f)(),r="length"===(null!==(e=A.a(["values","constraintType"])(Object(bn.f)()))&&void 0!==e?e:null),i=(t={},Object(z.a)(t,n.radioSubtitle,!0),Object(z.a)(t,n.error,!A.a(["values","constraintType"])(a)&&A.a(["errors","constraintType"])(a)),t);return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Ue,{className:I()(i),children:"Numerical entry constraints"}),Object(Me.jsx)(bn.b,{className:n.row,component:ti,options:nM,name:"constraintType"}),r&&Object(Me.jsxs)("div",{className:I()(n.flex,n.numberField),children:[Object(Me.jsx)(bn.b,{component:ei,name:"inputLength",label:"Length",decimalPlaces:0,allowNegative:!1}),Object(Me.jsx)(Ye,{className:n.tl1,children:"digits"})]})]})},rM=Object(f.a)(KA),iM=[{display:"None",code:"none"},{display:"Email",code:"email"},{display:"Space separation",subtitle:"(e.g. first and last name)",code:"spaceSeparation"}],oM=function(){var e,t=rM(),n=Object(bn.f)(),a=(e={},Object(z.a)(e,t.radioSubtitle,!0),Object(z.a)(e,t.error,!A.a(["values","constraintType"])(n)&&A.a(["errors","constraintType"])(n)),e);return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Ue,{className:I()(a),children:"Text entry constraints"}),Object(Me.jsx)(bn.b,{className:t.row,component:ti,options:iM,name:"constraintType"}),function(){switch(n.values.constraintType){case"spaceSeparation":return Object(Me.jsxs)("div",{className:t.flex,children:[Object(Me.jsx)(bn.b,{className:t.label,component:ai,name:"inputLabel1",label:"First word label"}),Object(Me.jsx)(bn.b,{className:t.label,component:ai,name:"inputLabel2",label:"Second word label"})]});default:return Object(Me.jsx)(bn.b,{className:t.label,component:ai,name:"inputLabel1",label:"Text entry label"})}}()]})},lM=function(e){return e.text&&e.text.length},cM={constraintType:"",inputLength:"",inputLabel1:"",inputLabel2:"",listChoices:[{text:""},{text:""}]},sM=xn.c((function(e){switch(e.inputType){case"numerical":return xn.f({constraintType:xn.h().required(),inputLength:xn.e().when("constraintType",{is:"length",then:xn.e().min(0).required(),else:xn.d().notRequired()})});case"text":return xn.f({constraintType:xn.h().required(),inputLabel1:xn.h().required(),inputLabel2:xn.h().when("constraintType",{is:"spaceSeparation",then:xn.h().required(),else:xn.d().notRequired()})});case"choiceList":return xn.f({constraintType:xn.h().required(),listChoices:xn.a().test("has-2-or-more","Choice list needs to have two or more non empty fields",(function(e,t){return M.a(lM)(e).length>1}))});default:return xn.d().notRequired()}})),dM=function(){var e,t=null!==(e=A.a(["values","inputType"])(Object(bn.f)()))&&void 0!==e?e:null,n=function(e){switch(e){case"numerical":return aM;case"text":return oM;case"choiceList":return eM;default:return aM}}(t);return t&&Object(Me.jsx)(n,{})};function uM(){return(uM=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function mM(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var hM=a.createElement("defs",null,a.createElement("style",null,".cls-1,.cls-9{fill:#dee5fc;}.cls-2,.cls-9{opacity:0.8;}.cls-3{isolation:isolate;}.cls-4{clip-path:url(#clip-path);}.cls-5{clip-path:url(#clip-path-2);}.cls-6{fill:#ccd8ff;opacity:0.74;}.cls-7{clip-path:url(#clip-path-3);}.cls-8{fill:#ebefff;}.cls-10{clip-path:url(#clip-path-4);}.cls-11{clip-path:url(#clip-path-5);}.cls-12{clip-path:url(#clip-path-6);}.cls-13{clip-path:url(#clip-path-7);}.cls-14{clip-path:url(#clip-path-8);}.cls-15{clip-path:url(#clip-path-9);}.cls-16{clip-path:url(#clip-path-10);}.cls-17{clip-path:url(#clip-path-11);}.cls-18{clip-path:url(#clip-path-12);}.cls-19{clip-path:url(#clip-path-13);}.cls-20{clip-path:url(#clip-path-14);}.cls-21{clip-path:url(#clip-path-15);}.cls-22{clip-path:url(#clip-path-16);}.cls-23{clip-path:url(#clip-path-17);}.cls-24{clip-path:url(#clip-path-18);}.cls-25{clip-path:url(#clip-path-19);}.cls-26{clip-path:url(#clip-path-20);}.cls-27{clip-path:url(#clip-path-21);}.cls-28{clip-path:url(#clip-path-22);}.cls-29{clip-path:url(#clip-path-23);}.cls-30{clip-path:url(#clip-path-24);}.cls-31{clip-path:url(#clip-path-25);}.cls-32{clip-path:url(#clip-path-26);}.cls-33{clip-path:url(#clip-path-27);}.cls-34{clip-path:url(#clip-path-28);}.cls-35{clip-path:url(#clip-path-29);}.cls-36{clip-path:url(#clip-path-30);}.cls-37{clip-path:url(#clip-path-31);}.cls-38{clip-path:url(#clip-path-32);}.cls-39{clip-path:url(#clip-path-33);}.cls-40{clip-path:url(#clip-path-34);}.cls-41{clip-path:url(#clip-path-35);}.cls-42{clip-path:url(#clip-path-36);}.cls-43{clip-path:url(#clip-path-37);}.cls-44{clip-path:url(#clip-path-38);}.cls-45{clip-path:url(#clip-path-39);}.cls-46{clip-path:url(#clip-path-40);}.cls-47{clip-path:url(#clip-path-41);}.cls-48{clip-path:url(#clip-path-42);}.cls-49{clip-path:url(#clip-path-43);}.cls-50{clip-path:url(#clip-path-44);}.cls-51{clip-path:url(#clip-path-45);}.cls-52{clip-path:url(#clip-path-46);}.cls-53{clip-path:url(#clip-path-47);}.cls-54{clip-path:url(#clip-path-48);}.cls-55{clip-path:url(#clip-path-49);}.cls-56{clip-path:url(#clip-path-50);}.cls-57{clip-path:url(#clip-path-51);}.cls-58{clip-path:url(#clip-path-52);}.cls-59{clip-path:url(#clip-path-53);}.cls-60{clip-path:url(#clip-path-54);}.cls-61{clip-path:url(#clip-path-55);}.cls-62{clip-path:url(#clip-path-56);}.cls-63{clip-path:url(#clip-path-57);}.cls-64{clip-path:url(#clip-path-58);}.cls-65{clip-path:url(#clip-path-59);}.cls-66{clip-path:url(#clip-path-60);}.cls-67{clip-path:url(#clip-path-61);}.cls-68{clip-path:url(#clip-path-62);}.cls-69{clip-path:url(#clip-path-63);}.cls-70{clip-path:url(#clip-path-64);}.cls-71{clip-path:url(#clip-path-65);}.cls-72{clip-path:url(#clip-path-66);}.cls-73{clip-path:url(#clip-path-69);}.cls-74{clip-path:url(#clip-path-70);}.cls-75{clip-path:url(#clip-path-71);}.cls-76{clip-path:url(#clip-path-72);}.cls-77{clip-path:url(#clip-path-73);}.cls-78{clip-path:url(#clip-path-74);}.cls-79{clip-path:url(#clip-path-75);}.cls-80{clip-path:url(#clip-path-76);}.cls-81{clip-path:url(#clip-path-77);}.cls-82{clip-path:url(#clip-path-78);}.cls-83{clip-path:url(#clip-path-79);}.cls-84{clip-path:url(#clip-path-80);}.cls-85{clip-path:url(#clip-path-81);}.cls-86{clip-path:url(#clip-path-82);}.cls-87{fill:#4b5fef;}.cls-88{clip-path:url(#clip-path-83);}.cls-89{fill:#5a67ff;}.cls-90{fill:#7687ff;}"),a.createElement("clipPath",{id:"clip-path"},a.createElement("polygon",{className:"cls-1",points:"58.25 54.32 77.66 65.53 77.66 87.95 58.25 76.74 58.25 54.32"})),a.createElement("clipPath",{id:"clip-path-2"},a.createElement("polygon",{className:"cls-1",points:"77.66 65.53 77.66 87.95 58.25 99.16 58.25 76.74 77.66 65.53"})),a.createElement("clipPath",{id:"clip-path-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 76.74 58.25 99.16 38.83 87.95 38.83 65.53 58.25 76.74"})),a.createElement("clipPath",{id:"clip-path-4"},a.createElement("polygon",{className:"cls-1",points:"77.66 65.53 97.08 76.74 97.08 99.16 77.66 87.95 77.66 65.53"})),a.createElement("clipPath",{id:"clip-path-5"},a.createElement("polygon",{className:"cls-1",points:"97.08 76.74 97.08 99.16 77.66 110.37 77.66 87.95 97.08 76.74"})),a.createElement("clipPath",{id:"clip-path-6"},a.createElement("polygon",{className:"cls-1",points:"77.66 87.95 77.66 110.37 58.25 99.16 58.25 76.74 77.66 87.95"})),a.createElement("clipPath",{id:"clip-path-7"},a.createElement("polygon",{className:"cls-1",points:"58.25 76.74 77.66 87.95 77.66 110.37 58.25 99.16 58.25 76.74"})),a.createElement("clipPath",{id:"clip-path-8"},a.createElement("polygon",{className:"cls-1",points:"77.66 87.95 77.66 110.37 58.25 121.58 58.25 99.16 77.66 87.95"})),a.createElement("clipPath",{id:"clip-path-9"},a.createElement("polygon",{className:"cls-1",points:"58.25 99.16 58.25 121.58 38.83 110.37 38.83 87.95 58.25 99.16"})),a.createElement("clipPath",{id:"clip-path-10"},a.createElement("polygon",{className:"cls-1",points:"38.83 65.53 58.25 76.74 58.25 99.16 38.83 87.95 38.83 65.53"})),a.createElement("clipPath",{id:"clip-path-11"},a.createElement("polygon",{className:"cls-1",points:"58.25 76.74 58.25 99.16 38.83 110.37 38.83 87.95 58.25 76.74"})),a.createElement("clipPath",{id:"clip-path-12"},a.createElement("polygon",{className:"cls-1",points:"38.83 87.95 38.83 110.37 19.42 99.16 19.42 76.74 38.83 87.95"})),a.createElement("clipPath",{id:"clip-path-13"},a.createElement("polygon",{className:"cls-1",points:"19.42 76.74 38.83 87.95 38.83 110.37 19.42 99.16 19.42 76.74"})),a.createElement("clipPath",{id:"clip-path-14"},a.createElement("polygon",{className:"cls-1",points:"38.83 87.95 38.83 110.37 19.42 121.58 19.42 99.16 38.83 87.95"})),a.createElement("clipPath",{id:"clip-path-15"},a.createElement("polygon",{className:"cls-1",points:"19.42 99.16 19.42 121.58 0 110.37 0 87.95 19.42 99.16"})),a.createElement("clipPath",{id:"clip-path-16"},a.createElement("polygon",{className:"cls-1",points:"38.83 87.95 58.25 99.16 58.25 121.58 38.83 110.37 38.83 87.95"})),a.createElement("clipPath",{id:"clip-path-17"},a.createElement("polygon",{className:"cls-1",points:"58.25 99.16 58.25 121.58 38.83 132.79 38.83 110.37 58.25 99.16"})),a.createElement("clipPath",{id:"clip-path-18"},a.createElement("polygon",{className:"cls-1",points:"38.83 110.37 38.83 132.79 19.42 121.58 19.42 99.16 38.83 110.37"})),a.createElement("clipPath",{id:"clip-path-19"},a.createElement("polygon",{className:"cls-1",points:"97.08 76.74 116.5 87.95 116.5 110.37 97.08 99.16 97.08 76.74"})),a.createElement("clipPath",{id:"clip-path-20"},a.createElement("polygon",{className:"cls-1",points:"116.5 87.95 116.5 110.37 97.08 121.58 97.08 99.16 116.5 87.95"})),a.createElement("clipPath",{id:"clip-path-21"},a.createElement("polygon",{className:"cls-1",points:"97.08 99.16 97.08 121.58 77.66 110.37 77.66 87.95 97.08 99.16"})),a.createElement("clipPath",{id:"clip-path-22"},a.createElement("polygon",{className:"cls-1",points:"77.66 87.95 97.08 99.16 97.08 121.58 77.66 110.37 77.66 87.95"})),a.createElement("clipPath",{id:"clip-path-23"},a.createElement("polygon",{className:"cls-1",points:"97.08 99.16 97.08 121.58 77.66 132.79 77.66 110.37 97.08 99.16"})),a.createElement("clipPath",{id:"clip-path-24"},a.createElement("polygon",{className:"cls-1",points:"77.66 110.37 77.66 132.79 58.25 121.58 58.25 99.16 77.66 110.37"})),a.createElement("clipPath",{id:"clip-path-25"},a.createElement("polygon",{className:"cls-1",points:"58.25 99.16 77.66 110.37 77.66 132.79 58.25 121.58 58.25 99.16"})),a.createElement("clipPath",{id:"clip-path-26"},a.createElement("polygon",{className:"cls-1",points:"77.66 110.37 77.66 132.79 58.25 144 58.25 121.58 77.66 110.37"})),a.createElement("clipPath",{id:"clip-path-27"},a.createElement("polygon",{className:"cls-1",points:"58.25 121.58 58.25 144 38.83 132.79 38.83 110.37 58.25 121.58"})),a.createElement("clipPath",{id:"clip-path-28"},a.createElement("polygon",{className:"cls-1",points:"58.25 31.9 77.66 43.11 77.66 65.53 58.25 54.32 58.25 31.9"})),a.createElement("clipPath",{id:"clip-path-29"},a.createElement("polygon",{className:"cls-1",points:"77.66 43.11 77.66 65.53 58.25 76.74 58.25 54.32 77.66 43.11"})),a.createElement("clipPath",{id:"clip-path-30"},a.createElement("polygon",{className:"cls-1",points:"58.25 54.32 58.25 76.74 38.83 65.53 38.83 43.11 58.25 54.32"})),a.createElement("clipPath",{id:"clip-path-31"},a.createElement("polygon",{className:"cls-1",points:"77.66 43.11 97.08 54.32 97.08 76.74 77.66 65.53 77.66 43.11"})),a.createElement("clipPath",{id:"clip-path-32"},a.createElement("polygon",{className:"cls-1",points:"97.08 54.32 97.08 76.74 77.66 87.95 77.66 65.53 97.08 54.32"})),a.createElement("clipPath",{id:"clip-path-33"},a.createElement("polygon",{className:"cls-1",points:"77.66 65.53 77.66 87.95 58.25 76.74 58.25 54.32 77.66 65.53"})),a.createElement("clipPath",{id:"clip-path-34"},a.createElement("polygon",{className:"cls-1",points:"97.08 54.32 116.5 65.53 116.5 87.95 97.08 76.74 97.08 54.32"})),a.createElement("clipPath",{id:"clip-path-35"},a.createElement("polygon",{className:"cls-1",points:"116.5 65.53 116.5 87.95 97.08 99.16 97.08 76.74 116.5 65.53"})),a.createElement("clipPath",{id:"clip-path-36"},a.createElement("polygon",{className:"cls-1",points:"97.08 76.74 97.08 99.16 77.66 87.95 77.66 65.53 97.08 76.74"})),a.createElement("clipPath",{id:"clip-path-37"},a.createElement("polygon",{className:"cls-1",points:"58.25 54.32 77.66 65.53 77.66 87.95 58.25 76.74 58.25 54.32"})),a.createElement("clipPath",{id:"clip-path-38"},a.createElement("polygon",{className:"cls-1",points:"77.66 65.53 77.66 87.95 58.25 99.16 58.25 76.74 77.66 65.53"})),a.createElement("clipPath",{id:"clip-path-39"},a.createElement("polygon",{className:"cls-1",points:"58.25 76.74 58.25 99.16 38.83 87.95 38.83 65.53 58.25 76.74"})),a.createElement("clipPath",{id:"clip-path-40"},a.createElement("polygon",{className:"cls-1",points:"38.83 43.11 58.25 54.32 58.25 76.74 38.83 65.53 38.83 43.11"})),a.createElement("clipPath",{id:"clip-path-41"},a.createElement("polygon",{className:"cls-1",points:"58.25 54.32 58.25 76.74 38.83 87.95 38.83 65.53 58.25 54.32"})),a.createElement("clipPath",{id:"clip-path-42"},a.createElement("polygon",{className:"cls-1",points:"38.83 65.53 38.83 87.95 19.42 76.74 19.42 54.32 38.83 65.53"})),a.createElement("clipPath",{id:"clip-path-43"},a.createElement("polygon",{className:"cls-1",points:"77.66 65.53 97.08 76.74 97.08 99.16 77.66 87.95 77.66 65.53"})),a.createElement("clipPath",{id:"clip-path-44"},a.createElement("polygon",{className:"cls-1",points:"97.08 76.74 97.08 99.16 77.66 110.37 77.66 87.95 97.08 76.74"})),a.createElement("clipPath",{id:"clip-path-45"},a.createElement("polygon",{className:"cls-1",points:"77.66 87.95 77.66 110.37 58.25 99.16 58.25 76.74 77.66 87.95"})),a.createElement("clipPath",{id:"clip-path-46"},a.createElement("polygon",{className:"cls-1",points:"19.42 54.32 38.83 65.53 38.83 87.95 19.42 76.74 19.42 54.32"})),a.createElement("clipPath",{id:"clip-path-47"},a.createElement("polygon",{className:"cls-1",points:"38.83 65.53 38.83 87.95 19.42 99.16 19.42 76.74 38.83 65.53"})),a.createElement("clipPath",{id:"clip-path-48"},a.createElement("polygon",{className:"cls-1",points:"19.42 76.74 19.42 99.16 0 87.95 0 65.53 19.42 76.74"})),a.createElement("clipPath",{id:"clip-path-49"},a.createElement("polygon",{className:"cls-1",points:"38.83 65.53 58.25 76.74 58.25 99.16 38.83 87.95 38.83 65.53"})),a.createElement("clipPath",{id:"clip-path-50"},a.createElement("polygon",{className:"cls-1",points:"58.25 76.74 58.25 99.16 38.83 110.37 38.83 87.95 58.25 76.74"})),a.createElement("clipPath",{id:"clip-path-51"},a.createElement("polygon",{className:"cls-1",points:"38.83 87.95 38.83 110.37 19.42 99.16 19.42 76.74 38.83 87.95"})),a.createElement("clipPath",{id:"clip-path-52"},a.createElement("polygon",{className:"cls-1",points:"58.25 76.74 77.66 87.95 77.66 110.37 58.25 99.16 58.25 76.74"})),a.createElement("clipPath",{id:"clip-path-53"},a.createElement("polygon",{className:"cls-1",points:"77.66 87.95 77.66 110.37 58.25 121.58 58.25 99.16 77.66 87.95"})),a.createElement("clipPath",{id:"clip-path-54"},a.createElement("polygon",{className:"cls-1",points:"58.25 99.16 58.25 121.58 38.83 110.37 38.83 87.95 58.25 99.16"})),a.createElement("clipPath",{id:"clip-path-55"},a.createElement("polygon",{className:"cls-1",points:"58.25 9.48 77.66 20.69 77.66 43.11 58.25 31.9 58.25 9.48"})),a.createElement("clipPath",{id:"clip-path-56"},a.createElement("polygon",{className:"cls-1",points:"77.66 20.69 77.66 43.11 58.25 54.32 58.25 31.9 77.66 20.69"})),a.createElement("clipPath",{id:"clip-path-57"},a.createElement("polygon",{className:"cls-1",points:"58.25 31.9 58.25 54.32 38.83 43.11 38.83 20.69 58.25 31.9"})),a.createElement("clipPath",{id:"clip-path-58"},a.createElement("polygon",{className:"cls-1",points:"58.25 31.9 77.66 43.11 77.66 65.53 58.25 54.32 58.25 31.9"})),a.createElement("clipPath",{id:"clip-path-59"},a.createElement("polygon",{className:"cls-1",points:"77.66 43.11 77.66 65.53 58.25 76.74 58.25 54.32 77.66 43.11"})),a.createElement("clipPath",{id:"clip-path-60"},a.createElement("polygon",{className:"cls-1",points:"58.25 54.32 58.25 76.74 38.83 65.53 38.83 43.11 58.25 54.32"})),a.createElement("clipPath",{id:"clip-path-61"},a.createElement("polygon",{className:"cls-1",points:"77.66 20.69 97.08 31.9 97.08 54.32 77.66 43.11 77.66 20.69"})),a.createElement("clipPath",{id:"clip-path-62"},a.createElement("polygon",{className:"cls-1",points:"97.08 31.9 97.08 54.32 77.66 65.53 77.66 43.11 97.08 31.9"})),a.createElement("clipPath",{id:"clip-path-63"},a.createElement("polygon",{className:"cls-1",points:"77.66 43.11 77.66 65.53 58.25 54.32 58.25 31.9 77.66 43.11"})),a.createElement("clipPath",{id:"clip-path-64"},a.createElement("polygon",{className:"cls-1",points:"38.83 20.69 58.25 31.9 58.25 54.32 38.83 43.11 38.83 20.69"})),a.createElement("clipPath",{id:"clip-path-65"},a.createElement("polygon",{className:"cls-1",points:"58.25 31.9 58.25 54.32 38.83 65.53 38.83 43.11 58.25 31.9"})),a.createElement("clipPath",{id:"clip-path-66"},a.createElement("polygon",{className:"cls-1",points:"38.83 43.11 38.83 65.53 19.42 54.32 19.42 31.9 38.83 43.11"})),a.createElement("clipPath",{id:"clip-path-69"},a.createElement("polygon",{className:"cls-1",points:"19.42 31.9 38.83 43.11 38.83 65.53 19.42 54.32 19.42 31.9"})),a.createElement("clipPath",{id:"clip-path-70"},a.createElement("polygon",{className:"cls-1",points:"38.83 43.11 38.83 65.53 19.42 76.74 19.42 54.32 38.83 43.11"})),a.createElement("clipPath",{id:"clip-path-71"},a.createElement("polygon",{className:"cls-1",points:"19.42 54.32 19.42 76.74 0 65.53 0 43.11 19.42 54.32"})),a.createElement("clipPath",{id:"clip-path-72"},a.createElement("polygon",{className:"cls-1",points:"38.83 43.11 58.25 54.32 58.25 76.74 38.83 65.53 38.83 43.11"})),a.createElement("clipPath",{id:"clip-path-73"},a.createElement("polygon",{className:"cls-1",points:"58.25 54.32 58.25 76.74 38.83 87.95 38.83 65.53 58.25 54.32"})),a.createElement("clipPath",{id:"clip-path-74"},a.createElement("polygon",{className:"cls-1",points:"38.83 65.53 38.83 87.95 19.42 76.74 19.42 54.32 38.83 65.53"})),a.createElement("clipPath",{id:"clip-path-75"},a.createElement("polygon",{className:"cls-1",points:"97.08 31.9 116.5 43.11 116.5 65.53 97.08 54.32 97.08 31.9"})),a.createElement("clipPath",{id:"clip-path-76"},a.createElement("polygon",{className:"cls-1",points:"116.5 43.11 116.5 65.53 97.08 76.74 97.08 54.32 116.5 43.11"})),a.createElement("clipPath",{id:"clip-path-77"},a.createElement("polygon",{className:"cls-1",points:"97.08 54.32 97.08 76.74 77.66 65.53 77.66 43.11 97.08 54.32"})),a.createElement("clipPath",{id:"clip-path-78"},a.createElement("polygon",{className:"cls-1",points:"77.66 43.11 97.08 54.32 97.08 76.74 77.66 65.53 77.66 43.11"})),a.createElement("clipPath",{id:"clip-path-79"},a.createElement("polygon",{className:"cls-1",points:"97.08 54.32 97.08 76.74 77.66 87.95 77.66 65.53 97.08 54.32"})),a.createElement("clipPath",{id:"clip-path-80"},a.createElement("polygon",{className:"cls-1",points:"77.66 65.53 77.66 87.95 58.25 76.74 58.25 54.32 77.66 65.53"})),a.createElement("clipPath",{id:"clip-path-81"},a.createElement("polygon",{className:"cls-1",points:"58.25 0 77.66 11.21 77.66 33.63 58.25 22.42 58.25 0"})),a.createElement("clipPath",{id:"clip-path-82"},a.createElement("polygon",{className:"cls-1",points:"77.66 11.21 77.66 33.63 58.25 44.84 58.25 22.42 77.66 11.21"})),a.createElement("clipPath",{id:"clip-path-83"},a.createElement("polygon",{className:"cls-1",points:"58.25 22.42 58.25 44.84 38.83 33.63 38.83 11.21 58.25 22.42"}))),pM=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 54.32 77.66 65.53 77.66 87.95 58.25 76.74 58.25 54.32"}),a.createElement("g",{className:"cls-4"},a.createElement("polygon",{className:"cls-1",points:"58.25 54.32 77.66 65.53 77.66 87.95 58.25 76.74 58.25 54.32"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 65.53 77.66 87.95 58.25 99.16 58.25 76.74 77.66 65.53"}),a.createElement("g",{className:"cls-5"},a.createElement("polygon",{className:"cls-6",points:"77.66 65.53 77.66 87.95 58.25 99.16 58.25 76.74 77.66 65.53"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 76.74 58.25 99.16 38.83 87.95 38.83 65.53 58.25 76.74"}),a.createElement("g",{className:"cls-7"},a.createElement("polygon",{className:"cls-8",points:"58.25 76.74 58.25 99.16 38.83 87.95 38.83 65.53 58.25 76.74"}))))),bM=a.createElement("polygon",{className:"cls-9",points:"38.83 65.53 58.25 54.32 77.66 65.53 58.25 76.74 38.83 65.53"}),fM=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 65.53 97.08 76.74 97.08 99.16 77.66 87.95 77.66 65.53"}),a.createElement("g",{className:"cls-10"},a.createElement("polygon",{className:"cls-1",points:"77.66 65.53 97.08 76.74 97.08 99.16 77.66 87.95 77.66 65.53"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"97.08 76.74 97.08 99.16 77.66 110.37 77.66 87.95 97.08 76.74"}),a.createElement("g",{className:"cls-11"},a.createElement("polygon",{className:"cls-6",points:"97.08 76.74 97.08 99.16 77.66 110.37 77.66 87.95 97.08 76.74"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 87.95 77.66 110.37 58.25 99.16 58.25 76.74 77.66 87.95"}),a.createElement("g",{className:"cls-12"},a.createElement("polygon",{className:"cls-8",points:"77.66 87.95 77.66 110.37 58.25 99.16 58.25 76.74 77.66 87.95"}))))),jM=a.createElement("polygon",{className:"cls-9",points:"58.25 76.74 77.66 65.53 97.08 76.74 77.66 87.95 58.25 76.74"}),gM=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 76.74 77.66 87.95 77.66 110.37 58.25 99.16 58.25 76.74"}),a.createElement("g",{className:"cls-13"},a.createElement("polygon",{className:"cls-1",points:"58.25 76.74 77.66 87.95 77.66 110.37 58.25 99.16 58.25 76.74"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 87.95 77.66 110.37 58.25 121.58 58.25 99.16 77.66 87.95"}),a.createElement("g",{className:"cls-14"},a.createElement("polygon",{className:"cls-6",points:"77.66 87.95 77.66 110.37 58.25 121.58 58.25 99.16 77.66 87.95"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 99.16 58.25 121.58 38.83 110.37 38.83 87.95 58.25 99.16"}),a.createElement("g",{className:"cls-15"},a.createElement("polygon",{className:"cls-8",points:"58.25 99.16 58.25 121.58 38.83 110.37 38.83 87.95 58.25 99.16"}))))),OM=a.createElement("polygon",{className:"cls-9",points:"38.83 87.95 58.25 76.74 77.66 87.95 58.25 99.16 38.83 87.95"}),xM=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"38.83 65.53 58.25 76.74 58.25 99.16 38.83 87.95 38.83 65.53"}),a.createElement("g",{className:"cls-16"},a.createElement("polygon",{className:"cls-1",points:"38.83 65.53 58.25 76.74 58.25 99.16 38.83 87.95 38.83 65.53"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 76.74 58.25 99.16 38.83 110.37 38.83 87.95 58.25 76.74"}),a.createElement("g",{className:"cls-17"},a.createElement("polygon",{className:"cls-6",points:"58.25 76.74 58.25 99.16 38.83 110.37 38.83 87.95 58.25 76.74"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"38.83 87.95 38.83 110.37 19.42 99.16 19.42 76.74 38.83 87.95"}),a.createElement("g",{className:"cls-18"},a.createElement("polygon",{className:"cls-8",points:"38.83 87.95 38.83 110.37 19.42 99.16 19.42 76.74 38.83 87.95"}))))),vM=a.createElement("polygon",{className:"cls-9",points:"19.42 76.74 38.83 65.53 58.25 76.74 38.83 87.95 19.42 76.74"}),yM=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"19.42 76.74 38.83 87.95 38.83 110.37 19.42 99.16 19.42 76.74"}),a.createElement("g",{className:"cls-19"},a.createElement("polygon",{className:"cls-1",points:"19.42 76.74 38.83 87.95 38.83 110.37 19.42 99.16 19.42 76.74"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"38.83 87.95 38.83 110.37 19.42 121.58 19.42 99.16 38.83 87.95"}),a.createElement("g",{className:"cls-20"},a.createElement("polygon",{className:"cls-6",points:"38.83 87.95 38.83 110.37 19.42 121.58 19.42 99.16 38.83 87.95"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"19.42 99.16 19.42 121.58 0 110.37 0 87.95 19.42 99.16"}),a.createElement("g",{className:"cls-21"},a.createElement("polygon",{className:"cls-8",points:"19.42 99.16 19.42 121.58 0 110.37 0 87.95 19.42 99.16"}))))),wM=a.createElement("polygon",{className:"cls-9",points:"0 87.95 19.42 76.74 38.83 87.95 19.42 99.16 0 87.95"}),CM=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"38.83 87.95 58.25 99.16 58.25 121.58 38.83 110.37 38.83 87.95"}),a.createElement("g",{className:"cls-22"},a.createElement("polygon",{className:"cls-1",points:"38.83 87.95 58.25 99.16 58.25 121.58 38.83 110.37 38.83 87.95"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 99.16 58.25 121.58 38.83 132.79 38.83 110.37 58.25 99.16"}),a.createElement("g",{className:"cls-23"},a.createElement("polygon",{className:"cls-6",points:"58.25 99.16 58.25 121.58 38.83 132.79 38.83 110.37 58.25 99.16"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"38.83 110.37 38.83 132.79 19.42 121.58 19.42 99.16 38.83 110.37"}),a.createElement("g",{className:"cls-24"},a.createElement("polygon",{className:"cls-8",points:"38.83 110.37 38.83 132.79 19.42 121.58 19.42 99.16 38.83 110.37"}))))),kM=a.createElement("polygon",{className:"cls-9",points:"19.42 99.16 38.83 87.95 58.25 99.16 38.83 110.37 19.42 99.16"}),EM=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"97.08 76.74 116.5 87.95 116.5 110.37 97.08 99.16 97.08 76.74"}),a.createElement("g",{className:"cls-25"},a.createElement("polygon",{className:"cls-1",points:"97.08 76.74 116.5 87.95 116.5 110.37 97.08 99.16 97.08 76.74"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"116.5 87.95 116.5 110.37 97.08 121.58 97.08 99.16 116.5 87.95"}),a.createElement("g",{className:"cls-26"},a.createElement("polygon",{className:"cls-6",points:"116.5 87.95 116.5 110.37 97.08 121.58 97.08 99.16 116.5 87.95"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"97.08 99.16 97.08 121.58 77.66 110.37 77.66 87.95 97.08 99.16"}),a.createElement("g",{className:"cls-27"},a.createElement("polygon",{className:"cls-8",points:"97.08 99.16 97.08 121.58 77.66 110.37 77.66 87.95 97.08 99.16"}))))),NM=a.createElement("polygon",{className:"cls-9",points:"77.66 87.95 97.08 76.74 116.5 87.95 97.08 99.16 77.66 87.95"}),SM=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 87.95 97.08 99.16 97.08 121.58 77.66 110.37 77.66 87.95"}),a.createElement("g",{className:"cls-28"},a.createElement("polygon",{className:"cls-1",points:"77.66 87.95 97.08 99.16 97.08 121.58 77.66 110.37 77.66 87.95"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"97.08 99.16 97.08 121.58 77.66 132.79 77.66 110.37 97.08 99.16"}),a.createElement("g",{className:"cls-29"},a.createElement("polygon",{className:"cls-6",points:"97.08 99.16 97.08 121.58 77.66 132.79 77.66 110.37 97.08 99.16"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 110.37 77.66 132.79 58.25 121.58 58.25 99.16 77.66 110.37"}),a.createElement("g",{className:"cls-30"},a.createElement("polygon",{className:"cls-8",points:"77.66 110.37 77.66 132.79 58.25 121.58 58.25 99.16 77.66 110.37"}))))),IM=a.createElement("polygon",{className:"cls-9",points:"58.25 99.16 77.66 87.95 97.08 99.16 77.66 110.37 58.25 99.16"}),FM=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 99.16 77.66 110.37 77.66 132.79 58.25 121.58 58.25 99.16"}),a.createElement("g",{className:"cls-31"},a.createElement("polygon",{className:"cls-1",points:"58.25 99.16 77.66 110.37 77.66 132.79 58.25 121.58 58.25 99.16"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 110.37 77.66 132.79 58.25 144 58.25 121.58 77.66 110.37"}),a.createElement("g",{className:"cls-32"},a.createElement("polygon",{className:"cls-6",points:"77.66 110.37 77.66 132.79 58.25 144 58.25 121.58 77.66 110.37"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 121.58 58.25 144 38.83 132.79 38.83 110.37 58.25 121.58"}),a.createElement("g",{className:"cls-33"},a.createElement("polygon",{className:"cls-8",points:"58.25 121.58 58.25 144 38.83 132.79 38.83 110.37 58.25 121.58"}))))),LM=a.createElement("polygon",{className:"cls-9",points:"38.83 110.37 58.25 99.16 77.66 110.37 58.25 121.58 38.83 110.37"}),PM=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 31.9 77.66 43.11 77.66 65.53 58.25 54.32 58.25 31.9"}),a.createElement("g",{className:"cls-34"},a.createElement("polygon",{className:"cls-1",points:"58.25 31.9 77.66 43.11 77.66 65.53 58.25 54.32 58.25 31.9"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 43.11 77.66 65.53 58.25 76.74 58.25 54.32 77.66 43.11"}),a.createElement("g",{className:"cls-35"},a.createElement("polygon",{className:"cls-6",points:"77.66 43.11 77.66 65.53 58.25 76.74 58.25 54.32 77.66 43.11"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 54.32 58.25 76.74 38.83 65.53 38.83 43.11 58.25 54.32"}),a.createElement("g",{className:"cls-36"},a.createElement("polygon",{className:"cls-8",points:"58.25 54.32 58.25 76.74 38.83 65.53 38.83 43.11 58.25 54.32"}))))),DM=a.createElement("polygon",{className:"cls-9",points:"38.83 43.11 58.25 31.9 77.66 43.11 58.25 54.32 38.83 43.11"}),RM=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 43.11 97.08 54.32 97.08 76.74 77.66 65.53 77.66 43.11"}),a.createElement("g",{className:"cls-37"},a.createElement("polygon",{className:"cls-1",points:"77.66 43.11 97.08 54.32 97.08 76.74 77.66 65.53 77.66 43.11"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"97.08 54.32 97.08 76.74 77.66 87.95 77.66 65.53 97.08 54.32"}),a.createElement("g",{className:"cls-38"},a.createElement("polygon",{className:"cls-6",points:"97.08 54.32 97.08 76.74 77.66 87.95 77.66 65.53 97.08 54.32"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 65.53 77.66 87.95 58.25 76.74 58.25 54.32 77.66 65.53"}),a.createElement("g",{className:"cls-39"},a.createElement("polygon",{className:"cls-8",points:"77.66 65.53 77.66 87.95 58.25 76.74 58.25 54.32 77.66 65.53"}))))),BM=a.createElement("polygon",{className:"cls-9",points:"58.25 54.32 77.66 43.11 97.08 54.32 77.66 65.53 58.25 54.32"}),TM=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"97.08 54.32 116.5 65.53 116.5 87.95 97.08 76.74 97.08 54.32"}),a.createElement("g",{className:"cls-40"},a.createElement("polygon",{className:"cls-1",points:"97.08 54.32 116.5 65.53 116.5 87.95 97.08 76.74 97.08 54.32"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"116.5 65.53 116.5 87.95 97.08 99.16 97.08 76.74 116.5 65.53"}),a.createElement("g",{className:"cls-41"},a.createElement("polygon",{className:"cls-6",points:"116.5 65.53 116.5 87.95 97.08 99.16 97.08 76.74 116.5 65.53"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"97.08 76.74 97.08 99.16 77.66 87.95 77.66 65.53 97.08 76.74"}),a.createElement("g",{className:"cls-42"},a.createElement("polygon",{className:"cls-8",points:"97.08 76.74 97.08 99.16 77.66 87.95 77.66 65.53 97.08 76.74"}))))),AM=a.createElement("polygon",{className:"cls-9",points:"77.66 65.53 97.08 54.32 116.5 65.53 97.08 76.74 77.66 65.53"}),MM=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 54.32 77.66 65.53 77.66 87.95 58.25 76.74 58.25 54.32"}),a.createElement("g",{className:"cls-43"},a.createElement("polygon",{className:"cls-1",points:"58.25 54.32 77.66 65.53 77.66 87.95 58.25 76.74 58.25 54.32"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 65.53 77.66 87.95 58.25 99.16 58.25 76.74 77.66 65.53"}),a.createElement("g",{className:"cls-44"},a.createElement("polygon",{className:"cls-6",points:"77.66 65.53 77.66 87.95 58.25 99.16 58.25 76.74 77.66 65.53"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 76.74 58.25 99.16 38.83 87.95 38.83 65.53 58.25 76.74"}),a.createElement("g",{className:"cls-45"},a.createElement("polygon",{className:"cls-8",points:"58.25 76.74 58.25 99.16 38.83 87.95 38.83 65.53 58.25 76.74"}))))),WM=a.createElement("polygon",{className:"cls-9",points:"38.83 65.53 58.25 54.32 77.66 65.53 58.25 76.74 38.83 65.53"}),zM=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"38.83 43.11 58.25 54.32 58.25 76.74 38.83 65.53 38.83 43.11"}),a.createElement("g",{className:"cls-46"},a.createElement("polygon",{className:"cls-1",points:"38.83 43.11 58.25 54.32 58.25 76.74 38.83 65.53 38.83 43.11"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 54.32 58.25 76.74 38.83 87.95 38.83 65.53 58.25 54.32"}),a.createElement("g",{className:"cls-47"},a.createElement("polygon",{className:"cls-6",points:"58.25 54.32 58.25 76.74 38.83 87.95 38.83 65.53 58.25 54.32"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"38.83 65.53 38.83 87.95 19.42 76.74 19.42 54.32 38.83 65.53"}),a.createElement("g",{className:"cls-48"},a.createElement("polygon",{className:"cls-8",points:"38.83 65.53 38.83 87.95 19.42 76.74 19.42 54.32 38.83 65.53"}))))),qM=a.createElement("polygon",{className:"cls-9",points:"19.42 54.32 38.83 43.11 58.25 54.32 38.83 65.53 19.42 54.32"}),$M=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 65.53 97.08 76.74 97.08 99.16 77.66 87.95 77.66 65.53"}),a.createElement("g",{className:"cls-49"},a.createElement("polygon",{className:"cls-1",points:"77.66 65.53 97.08 76.74 97.08 99.16 77.66 87.95 77.66 65.53"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"97.08 76.74 97.08 99.16 77.66 110.37 77.66 87.95 97.08 76.74"}),a.createElement("g",{className:"cls-50"},a.createElement("polygon",{className:"cls-6",points:"97.08 76.74 97.08 99.16 77.66 110.37 77.66 87.95 97.08 76.74"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 87.95 77.66 110.37 58.25 99.16 58.25 76.74 77.66 87.95"}),a.createElement("g",{className:"cls-51"},a.createElement("polygon",{className:"cls-8",points:"77.66 87.95 77.66 110.37 58.25 99.16 58.25 76.74 77.66 87.95"}))))),HM=a.createElement("polygon",{className:"cls-9",points:"58.25 76.74 77.66 65.53 97.08 76.74 77.66 87.95 58.25 76.74"}),VM=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"19.42 54.32 38.83 65.53 38.83 87.95 19.42 76.74 19.42 54.32"}),a.createElement("g",{className:"cls-52"},a.createElement("polygon",{className:"cls-1",points:"19.42 54.32 38.83 65.53 38.83 87.95 19.42 76.74 19.42 54.32"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"38.83 65.53 38.83 87.95 19.42 99.16 19.42 76.74 38.83 65.53"}),a.createElement("g",{className:"cls-53"},a.createElement("polygon",{className:"cls-6",points:"38.83 65.53 38.83 87.95 19.42 99.16 19.42 76.74 38.83 65.53"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"19.42 76.74 19.42 99.16 0 87.95 0 65.53 19.42 76.74"}),a.createElement("g",{className:"cls-54"},a.createElement("polygon",{className:"cls-8",points:"19.42 76.74 19.42 99.16 0 87.95 0 65.53 19.42 76.74"}))))),UM=a.createElement("polygon",{className:"cls-9",points:"0 65.53 19.42 54.32 38.83 65.53 19.42 76.74 0 65.53"}),GM=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"38.83 65.53 58.25 76.74 58.25 99.16 38.83 87.95 38.83 65.53"}),a.createElement("g",{className:"cls-55"},a.createElement("polygon",{className:"cls-1",points:"38.83 65.53 58.25 76.74 58.25 99.16 38.83 87.95 38.83 65.53"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 76.74 58.25 99.16 38.83 110.37 38.83 87.95 58.25 76.74"}),a.createElement("g",{className:"cls-56"},a.createElement("polygon",{className:"cls-6",points:"58.25 76.74 58.25 99.16 38.83 110.37 38.83 87.95 58.25 76.74"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"38.83 87.95 38.83 110.37 19.42 99.16 19.42 76.74 38.83 87.95"}),a.createElement("g",{className:"cls-57"},a.createElement("polygon",{className:"cls-8",points:"38.83 87.95 38.83 110.37 19.42 99.16 19.42 76.74 38.83 87.95"}))))),XM=a.createElement("polygon",{className:"cls-9",points:"19.42 76.74 38.83 65.53 58.25 76.74 38.83 87.95 19.42 76.74"}),_M=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 76.74 77.66 87.95 77.66 110.37 58.25 99.16 58.25 76.74"}),a.createElement("g",{className:"cls-58"},a.createElement("polygon",{className:"cls-1",points:"58.25 76.74 77.66 87.95 77.66 110.37 58.25 99.16 58.25 76.74"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 87.95 77.66 110.37 58.25 121.58 58.25 99.16 77.66 87.95"}),a.createElement("g",{className:"cls-59"},a.createElement("polygon",{className:"cls-6",points:"77.66 87.95 77.66 110.37 58.25 121.58 58.25 99.16 77.66 87.95"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 99.16 58.25 121.58 38.83 110.37 38.83 87.95 58.25 99.16"}),a.createElement("g",{className:"cls-60"},a.createElement("polygon",{className:"cls-8",points:"58.25 99.16 58.25 121.58 38.83 110.37 38.83 87.95 58.25 99.16"}))))),ZM=a.createElement("polygon",{className:"cls-9",points:"38.83 87.95 58.25 76.74 77.66 87.95 58.25 99.16 38.83 87.95"}),KM=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 9.48 77.66 20.69 77.66 43.11 58.25 31.9 58.25 9.48"}),a.createElement("g",{className:"cls-61"},a.createElement("polygon",{className:"cls-1",points:"58.25 9.48 77.66 20.69 77.66 43.11 58.25 31.9 58.25 9.48"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 20.69 77.66 43.11 58.25 54.32 58.25 31.9 77.66 20.69"}),a.createElement("g",{className:"cls-62"},a.createElement("polygon",{className:"cls-6",points:"77.66 20.69 77.66 43.11 58.25 54.32 58.25 31.9 77.66 20.69"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 31.9 58.25 54.32 38.83 43.11 38.83 20.69 58.25 31.9"}),a.createElement("g",{className:"cls-63"},a.createElement("polygon",{className:"cls-8",points:"58.25 31.9 58.25 54.32 38.83 43.11 38.83 20.69 58.25 31.9"}))))),QM=a.createElement("polygon",{className:"cls-9",points:"38.83 20.69 58.25 9.48 77.66 20.69 58.25 31.9 38.83 20.69"}),YM=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 31.9 77.66 43.11 77.66 65.53 58.25 54.32 58.25 31.9"}),a.createElement("g",{className:"cls-64"},a.createElement("polygon",{className:"cls-1",points:"58.25 31.9 77.66 43.11 77.66 65.53 58.25 54.32 58.25 31.9"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 43.11 77.66 65.53 58.25 76.74 58.25 54.32 77.66 43.11"}),a.createElement("g",{className:"cls-65"},a.createElement("polygon",{className:"cls-6",points:"77.66 43.11 77.66 65.53 58.25 76.74 58.25 54.32 77.66 43.11"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 54.32 58.25 76.74 38.83 65.53 38.83 43.11 58.25 54.32"}),a.createElement("g",{className:"cls-66"},a.createElement("polygon",{className:"cls-8",points:"58.25 54.32 58.25 76.74 38.83 65.53 38.83 43.11 58.25 54.32"}))))),JM=a.createElement("polygon",{className:"cls-9",points:"38.83 43.11 58.25 31.9 77.66 43.11 58.25 54.32 38.83 43.11"}),eW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 20.69 97.08 31.9 97.08 54.32 77.66 43.11 77.66 20.69"}),a.createElement("g",{className:"cls-67"},a.createElement("polygon",{className:"cls-1",points:"77.66 20.69 97.08 31.9 97.08 54.32 77.66 43.11 77.66 20.69"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"97.08 31.9 97.08 54.32 77.66 65.53 77.66 43.11 97.08 31.9"}),a.createElement("g",{className:"cls-68"},a.createElement("polygon",{className:"cls-6",points:"97.08 31.9 97.08 54.32 77.66 65.53 77.66 43.11 97.08 31.9"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 43.11 77.66 65.53 58.25 54.32 58.25 31.9 77.66 43.11"}),a.createElement("g",{className:"cls-69"},a.createElement("polygon",{className:"cls-8",points:"77.66 43.11 77.66 65.53 58.25 54.32 58.25 31.9 77.66 43.11"}))))),tW=a.createElement("polygon",{className:"cls-9",points:"58.25 31.9 77.66 20.69 97.08 31.9 77.66 43.11 58.25 31.9"}),nW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"38.83 20.69 58.25 31.9 58.25 54.32 38.83 43.11 38.83 20.69"}),a.createElement("g",{className:"cls-70"},a.createElement("polygon",{className:"cls-1",points:"38.83 20.69 58.25 31.9 58.25 54.32 38.83 43.11 38.83 20.69"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 31.9 58.25 54.32 38.83 65.53 38.83 43.11 58.25 31.9"}),a.createElement("g",{className:"cls-71"},a.createElement("polygon",{className:"cls-6",points:"58.25 31.9 58.25 54.32 38.83 65.53 38.83 43.11 58.25 31.9"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"38.83 43.11 38.83 65.53 19.42 54.32 19.42 31.9 38.83 43.11"}),a.createElement("g",{className:"cls-72"},a.createElement("polygon",{className:"cls-8",points:"38.83 43.11 38.83 65.53 19.42 54.32 19.42 31.9 38.83 43.11"}))))),aW=a.createElement("polygon",{className:"cls-9",points:"19.42 31.9 38.83 20.69 58.25 31.9 38.83 43.11 19.42 31.9"}),rW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 43.11 77.66 65.53 58.25 76.74 58.25 54.32 77.66 43.11"}),a.createElement("g",{className:"cls-35"},a.createElement("polygon",{className:"cls-6",points:"77.66 43.11 77.66 65.53 58.25 76.74 58.25 54.32 77.66 43.11"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 54.32 58.25 76.74 38.83 65.53 38.83 43.11 58.25 54.32"}),a.createElement("g",{className:"cls-36"},a.createElement("polygon",{className:"cls-8",points:"58.25 54.32 58.25 76.74 38.83 65.53 38.83 43.11 58.25 54.32"}))),a.createElement("polygon",{className:"cls-1",points:"38.83 43.11 58.25 31.9 77.66 43.11 58.25 54.32 38.83 43.11"}))),iW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"19.42 31.9 38.83 43.11 38.83 65.53 19.42 54.32 19.42 31.9"}),a.createElement("g",{className:"cls-73"},a.createElement("polygon",{className:"cls-1",points:"19.42 31.9 38.83 43.11 38.83 65.53 19.42 54.32 19.42 31.9"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"38.83 43.11 38.83 65.53 19.42 76.74 19.42 54.32 38.83 43.11"}),a.createElement("g",{className:"cls-74"},a.createElement("polygon",{className:"cls-6",points:"38.83 43.11 38.83 65.53 19.42 76.74 19.42 54.32 38.83 43.11"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"19.42 54.32 19.42 76.74 0 65.53 0 43.11 19.42 54.32"}),a.createElement("g",{className:"cls-75"},a.createElement("polygon",{className:"cls-8",points:"19.42 54.32 19.42 76.74 0 65.53 0 43.11 19.42 54.32"}))))),oW=a.createElement("polygon",{className:"cls-9",points:"0 43.11 19.42 31.9 38.83 43.11 19.42 54.32 0 43.11"}),lW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"38.83 43.11 58.25 54.32 58.25 76.74 38.83 65.53 38.83 43.11"}),a.createElement("g",{className:"cls-76"},a.createElement("polygon",{className:"cls-1",points:"38.83 43.11 58.25 54.32 58.25 76.74 38.83 65.53 38.83 43.11"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 54.32 58.25 76.74 38.83 87.95 38.83 65.53 58.25 54.32"}),a.createElement("g",{className:"cls-77"},a.createElement("polygon",{className:"cls-6",points:"58.25 54.32 58.25 76.74 38.83 87.95 38.83 65.53 58.25 54.32"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"38.83 65.53 38.83 87.95 19.42 76.74 19.42 54.32 38.83 65.53"}),a.createElement("g",{className:"cls-78"},a.createElement("polygon",{className:"cls-8",points:"38.83 65.53 38.83 87.95 19.42 76.74 19.42 54.32 38.83 65.53"}))))),cW=a.createElement("polygon",{className:"cls-9",points:"19.42 54.32 38.83 43.11 58.25 54.32 38.83 65.53 19.42 54.32"}),sW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"97.08 31.9 116.5 43.11 116.5 65.53 97.08 54.32 97.08 31.9"}),a.createElement("g",{className:"cls-79"},a.createElement("polygon",{className:"cls-1",points:"97.08 31.9 116.5 43.11 116.5 65.53 97.08 54.32 97.08 31.9"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"116.5 43.11 116.5 65.53 97.08 76.74 97.08 54.32 116.5 43.11"}),a.createElement("g",{className:"cls-80"},a.createElement("polygon",{className:"cls-6",points:"116.5 43.11 116.5 65.53 97.08 76.74 97.08 54.32 116.5 43.11"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"97.08 54.32 97.08 76.74 77.66 65.53 77.66 43.11 97.08 54.32"}),a.createElement("g",{className:"cls-81"},a.createElement("polygon",{className:"cls-8",points:"97.08 54.32 97.08 76.74 77.66 65.53 77.66 43.11 97.08 54.32"}))))),dW=a.createElement("polygon",{className:"cls-9",points:"77.66 43.11 97.08 31.9 116.5 43.11 97.08 54.32 77.66 43.11"}),uW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 43.11 97.08 54.32 97.08 76.74 77.66 65.53 77.66 43.11"}),a.createElement("g",{className:"cls-82"},a.createElement("polygon",{className:"cls-1",points:"77.66 43.11 97.08 54.32 97.08 76.74 77.66 65.53 77.66 43.11"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"97.08 54.32 97.08 76.74 77.66 87.95 77.66 65.53 97.08 54.32"}),a.createElement("g",{className:"cls-83"},a.createElement("polygon",{className:"cls-6",points:"97.08 54.32 97.08 76.74 77.66 87.95 77.66 65.53 97.08 54.32"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 65.53 77.66 87.95 58.25 76.74 58.25 54.32 77.66 65.53"}),a.createElement("g",{className:"cls-84"},a.createElement("polygon",{className:"cls-8",points:"77.66 65.53 77.66 87.95 58.25 76.74 58.25 54.32 77.66 65.53"}))))),mW=a.createElement("polygon",{className:"cls-9",points:"58.25 54.32 77.66 43.11 97.08 54.32 77.66 65.53 58.25 54.32"}),hW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 0 77.66 11.21 77.66 33.63 58.25 22.42 58.25 0"}),a.createElement("g",{className:"cls-85"},a.createElement("polygon",{className:"cls-1",points:"58.25 0 77.66 11.21 77.66 33.63 58.25 22.42 58.25 0"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 11.21 77.66 33.63 58.25 44.84 58.25 22.42 77.66 11.21"}),a.createElement("g",{className:"cls-86"},a.createElement("polygon",{className:"cls-87",points:"77.66 11.21 77.66 33.63 58.25 44.84 58.25 22.42 77.66 11.21"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 22.42 58.25 44.84 38.83 33.63 38.83 11.21 58.25 22.42"}),a.createElement("g",{className:"cls-88"},a.createElement("polygon",{className:"cls-89",points:"58.25 22.42 58.25 44.84 38.83 33.63 38.83 11.21 58.25 22.42"}))))),pW=a.createElement("polygon",{className:"cls-90",points:"38.83 11.21 58.25 0 77.66 11.21 58.25 22.42 38.83 11.21"});function bW(e,t){var n=e.title,r=e.titleId,i=mM(e,["title","titleId"]);return a.createElement("svg",uM({id:"Layer_1","data-name":"Layer 1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 116.5 144",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,hM,pM,bM,fM,jM,gM,OM,xM,vM,yM,wM,CM,kM,EM,NM,SM,IM,FM,LM,PM,DM,RM,BM,TM,AM,MM,WM,zM,qM,$M,HM,VM,UM,GM,XM,_M,ZM,KM,QM,YM,JM,eW,tW,nW,aW,rW,iW,oW,lW,cW,sW,dW,uW,mW,hW,pW)}var fW,jW,gW,OW,xW,vW,yW,wW,CW,kW,EW,NW,SW,IW,FW,LW,PW,DW,RW,BW,TW,AW,MW,WW,zW,qW,$W,HW,VW,UW,GW,XW=a.forwardRef(bW),_W=(n.p,Object(f.a)({logo:{maxHeight:150,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}})),ZW=function(e){var t=e.onContinue,n=_W();return Object(Me.jsxs)("div",{className:n.modalContent,children:[Object(Me.jsx)(XW,{className:n.logo}),Object(Me.jsx)($e,{className:n.title,children:"Custom information request"}),Object(Me.jsx)(Xe,{className:n.text,children:"A custom information request allows you to have an extra option to ask specific information about your customers when adding a trigger that isn't an option on the default requirements list."}),Object(Me.jsx)(Xe,{children:"Note that adding a custom information request isn't the same as adding triggers. You will still need to add a trigger with the new requirement to get this information from your customers."}),Object(Me.jsx)(An,{className:n.button,onClick:t,children:"Get started"})]})},KW=Object(f.a)({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"}}),QW=function(e){return e.text&&e.text.length},YW=function(e,t){var n,a="choiceList"===e.inputType,r=a?t?A.a(["listChoices"])(e):R.a((function(e){return e.text}))(null!==(n=M.a(QW)(e.listChoices))&&void 0!==n?n:[]):[],i="length"===e.constraintType,o=i?e.inputLength:"",l={name:e.requirementName,screen1:{text:e.screen1Text,title:e.screen1Title},screen2:{title:e.screen2Title,text:e.screen2Text},input:{type:e.inputType,constraintType:e.constraintType}};return a&&(l=OA.a(["input","choiceList"],r,l)),i&&(l=OA.a(["input","numDigits"],o,l)),e.inputLabel1&&(l=OA.a(["input","label1"],e.inputLabel1,l)),e.inputLabel2&&(l=OA.a(["input","label2"],e.inputLabel2,l)),t&&(l=OA.a(["id"],e.id,l)),l},JW=function(e,t){return D.a(t)?e:t},ez=function(e){var t=e.onClose,n=(e.error,e.toBeEdited),r=e.onSave,i=e.hasError,o=KW(),c=!D.a(n),d=Object(a.useState)(c?1:0),u=Object(l.a)(d,2),m=u[0],h=u[1],p=function(e){switch(e){case 1:return{schema:qA,Component:HA};case 2:return{schema:VA,Component:GA};case 3:return{schema:MA,Component:zA};case 4:return{schema:XA,Component:ZA};case 5:return{schema:sM,Component:dM};default:return{schema:{},Component:function(){return Object(Me.jsx)("h1",{children:"Default component step"})}}}}(m),b=5===m,f=function(e,t){var n="numerical"===e.inputType||"choiceList"===e.inputType;return c&&2===m?n?h(4):r(YW(e,c),c):c&&4===m?r(YW(e,c),c):3===m?h(n?m+1:m+2):b?r(YW(e,c),c):h(m+1)},j=c?function(e){var t=e.customRequest;return{id:e.id,requirementName:t.name,screen1Title:t.screen1.title,screen1Text:t.screen1.text,screen2Title:t.screen2.title,screen2Text:t.screen2.text,inputType:t.input.type,inputLabel1:t.input.label1,inputLabel2:t.input.label2,listChoices:t.input.choiceList,constraintType:t.input.constraintType,inputLength:t.input.numDigits}}(n):{},g=c?"Editing custom requirement":"New custom requirement";return Object(Me.jsxs)(Mh,{title:m>0?g:"",handleClose:t,width:520,height:620,open:!0,children:[m>0&&Object(Me.jsx)(rp,{className:o.stepper,steps:5,currentStep:m}),0===m&&!c&&Object(Me.jsx)(ZW,{onContinue:f}),m>0&&Object(Me.jsx)(bn.e,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,onSubmit:f,initialValues:xA.a(JW,Object(s.a)(Object(s.a)(Object(s.a)(Object(s.a)(Object(s.a)({},$A),UA),_A),WA),cM),j),validationSchema:p.schema,children:Object(Me.jsxs)(bn.d,{className:o.form,id:"custom-requirement-form",children:[Object(Me.jsx)(p.Component,{}),Object(Me.jsxs)("div",{className:o.submit,children:[i&&Object(Me.jsx)(Jo,{children:"Failed to save"}),Object(Me.jsx)(An,{className:o.button,type:"submit",children:b?"Save":"Next"})]})]})})]})},tz=Object(f.a)({m0:{margin:0},mb10:{marginBottom:10},centerItems:{display:"flex",flexDirection:"column",alignItems:"center",height:"50%",justifyContent:"center"},alignWithTitleSection:{marginTop:-47,display:"flex"}}),nz={numerical:"Numerical",text:"Text",choiceList:"Choice list"},az={date:"Date",none:"None",email:"Email",length:"Length",selectOne:"Select one",selectMultiple:"Select multiple",spaceSeparation:"Space separation"},rz=x()(fW||(fW=Object(c.a)(["\n mutation insertCustomInfoRequest($customRequest: CustomRequestInput!) {\n insertCustomInfoRequest(customRequest: $customRequest) {\n id\n }\n }\n"]))),iz=x()(jW||(jW=Object(c.a)(["\n mutation editCustomInfoRequest(\n $id: ID!\n $customRequest: CustomRequestInput!\n ) {\n editCustomInfoRequest(id: $id, customRequest: $customRequest) {\n id\n }\n }\n"]))),oz=x()(gW||(gW=Object(c.a)(["\n mutation removeCustomInfoRequest($id: ID!) {\n removeCustomInfoRequest(id: $id) {\n id\n }\n }\n"]))),lz=function(e){var t=e.showWizard,n=e.toggleWizard,r=e.data,i=tz(),o=Object(a.useState)(),c=Object(l.a)(o,2),d=c[0],m=c[1],h=Object(a.useState)(),p=Object(l.a)(h,2),b=p[0],f=p[1],j=Object(a.useState)(!1),g=Object(l.a)(j,2),O=g[0],x=g[1],v=Object(a.useState)(!1),y=Object(l.a)(v,2),w=y[0],C=y[1],k=Object(u.b)(rz,{onError:function(){console.log("Error while adding custom info request"),C(!0)},onCompleted:function(){C(!1),n()},refetchQueries:function(){return["customInfoRequests"]}}),E=Object(l.a)(k,1)[0],N=Object(u.b)(iz,{onError:function(){console.log("Error while editing custom info request"),C(!0)},onCompleted:function(){C(!1),f(null),n()},refetchQueries:function(){return["customInfoRequests"]}}),S=Object(l.a)(N,1)[0],F=Object(u.b)(oz,{onError:function(){console.log("Error while removing custom info request"),C(!0)},onCompleted:function(){x(!1),C(!1)},refetchQueries:function(){return["customInfoRequests"]}}),L=Object(l.a)(F,1)[0],P=function(e,t){return t?S({variables:{id:e.id,customRequest:am.a(["id"])(e)}}):E({variables:{customRequest:Object(s.a)({},e)}})};return Object(Me.jsxs)(Me.Fragment,{children:[r.length>0&&Object(Me.jsx)(gy,{emptyText:"No custom info requests so far",elements:[{header:"Requirement name",width:300,textAlign:"left",size:"sm",view:function(e){return e.customRequest.name}},{header:"Data entry type",width:300,textAlign:"left",size:"sm",view:function(e){return nz[e.customRequest.input.type]}},{header:"Constraints",width:300,textAlign:"left",size:"sm",view:function(e){return az[e.customRequest.input.constraintType]}},{header:"Edit",width:100,textAlign:"center",size:"sm",view:function(e){return Object(Me.jsx)(ta,{onClick:function(){return f(e),n()},children:Object(Me.jsx)(kh,{})})}},{header:"Delete",width:100,textAlign:"center",size:"sm",view:function(e){return Object(Me.jsx)(ta,{onClick:function(){return m(e.id),x(!0)},children:Object(Me.jsx)(hh,{})})}}],data:r,Details:gA,expandable:!0,rowSize:"sm"}),!r.length&&Object(Me.jsxs)("div",{className:i.centerItems,children:[Object(Me.jsx)(_e,{className:I()(i.m0,i.mb10),children:"It seems you haven't added any custom information requests yet."}),Object(Me.jsxs)(Ke,{className:I()(i.m0,i.mb10),children:["Please read our"," ",Object(Me.jsx)("a",{href:"https://support.lamassu.is/hc/en-us/sections/115000817232-Compliance",children:Object(Me.jsx)(oa,{children:"Support Article"})})," ","on Compliance before adding new information requests."]}),Object(Me.jsx)(An,{onClick:function(){return n()},children:"Add custom information request"})]}),t&&Object(Me.jsx)(ez,{hasError:w,onClose:function(){f(null),C(!1),n()},toBeEdited:b,onSave:function(){return P.apply(void 0,arguments)}}),Object(Me.jsx)($m,{errorMessage:w?"Failed to delete":"",open:O,onDismissed:function(){x(!1),C(!1)},onConfirmed:function(){L({variables:{id:d}})}})]})},cz=lz,sz={switchLabel:{margin:6,width:24},tableRadioGroup:{flexDirection:"row",justifyContent:"space-between"},tableRadioLabel:{marginRight:0},tableWidth:{width:918}},dz=n(918),uz=Object(f.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,181]]},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},dropdownField:{marginTop:16,minWidth:155}}),mz=xn.h().required(),hz=xn.f().shape({threshold:xn.e().nullable().transform(Vh).label("Invalid threshold"),thresholdDays:xn.e().transform(Vh).nullable().label("Invalid threshold days")}),pz=xn.f().shape({requirement:xn.h().required(),suspensionDays:xn.e().transform(Vh).nullable()}),bz=xn.f().shape({triggerType:mz,requirement:pz,threshold:hz}).test((function(e,t){var n=e.threshold,a=e.triggerType;if(!a||!{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}}[a](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"}}[a](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"})})),fz=xn.f().shape({triggerType:xn.h().required(),threshold:xn.f({threshold:xn.e().transform(Vh).nullable(),thresholdDays:xn.e().transform(Vh).nullable()})}).test((function(e,t){var n=e.threshold,a=e.triggerType;if(!a||!{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}}[a](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"}}[a](n)})})),jz=[{display:"Transaction amount",code:"txAmount"},{display:"Transaction volume",code:"txVolume"},{display:"Transaction velocity",code:"txVelocity"},{display:"Consecutive days",code:"consecutiveDays"}],gz=function(e){var t,n,a,r,i,o,l=Object.assign({},e),c=uz(),s=Object(bn.f)(),d=s.errors,u=s.touched,m=s.values,h=s.setTouched,p=s.handleChange,b=Object(z.a)({},c.error,d.triggerType&&u.triggerType),f=ul.a(null===m||void 0===m?void 0:m.triggerType),j=f(["txAmount","txVolume"]),g=f(["txVelocity"]),O=f(["txVolume","txVelocity"]),x=f(["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===(a=m.threshold)||void 0===a?void 0:a.threshold)<0),y=!!d.threshold&&!!(null===(r=u.threshold)||void 0===r?void 0:r.thresholdDays)&&!f(["txAmount"])&&(!(null===(i=m.threshold)||void 0===i?void 0:i.thresholdDays)||(null===(o=m.threshold)||void 0===o?void 0:o.thresholdDays)<0),w=!(!y&&!v),C=Object(z.a)({},c.error,w);return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Ko.a,{display:"flex",alignItems:"center",children:Object(Me.jsx)(Ue,{className:I()(b),children:"Choose trigger type"})}),Object(Me.jsx)(bn.b,{component:ti,name:"triggerType",options:jz,labelClassName:c.radioLabel,radioClassName:c.radio,className:c.radioGroup,onChange:function(e){p(e),h({threshold:!1,thresholdDays:!1})}}),Object(Me.jsxs)("div",{className:c.thresholdWrapper,children:[(j||g||O||x)&&Object(Me.jsx)(Ue,{className:I()(C,c.thresholdTitle),children:"Threshold"}),Object(Me.jsxs)("div",{className:c.thresholdContentWrapper,children:[j&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(bn.b,{className:c.thresholdField,component:ei,size:"lg",name:"threshold.threshold",error:v}),Object(Me.jsx)(_e,{className:I()(c.description),children:l.currency})]}),g&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(bn.b,{className:c.thresholdField,component:ei,size:"lg",name:"threshold.threshold",error:v}),Object(Me.jsx)(_e,{className:I()(c.description),children:"transactions"})]}),O&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(_e,{className:I()(b,c.space,c.description),children:"in"}),Object(Me.jsx)(bn.b,{className:c.thresholdField,component:ei,size:"lg",name:"threshold.thresholdDays",error:y}),Object(Me.jsx)(_e,{className:I()(c.description),children:"days"})]}),x&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(bn.b,{className:c.thresholdField,component:ei,size:"lg",name:"threshold.thresholdDays",error:y}),Object(Me.jsx)(_e,{className:I()(c.description),children:"consecutive days"})]})]})]})]})},Oz=xn.f().shape({requirement:xn.f({requirement:xn.h().required(),suspensionDays:xn.e().when("requirement",{is:function(e){return"suspend"===e},then:xn.e().nullable().transform(Vh),otherwise:xn.e().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"})})),xz=[{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"}],vz=x()(OW||(OW=Object(c.a)(["\n query customInfoRequests($onlyEnabled: Boolean) {\n customInfoRequests(onlyEnabled: $onlyEnabled) {\n id\n customRequest\n }\n }\n"]))),yz={schema:Oz,options:xz,Component:function(){var e,t,n,a,r,i,o=uz(),l=Object(bn.f)(),c=l.touched,d=l.errors,m=l.values,h=l.handleChange,p=l.setTouched,b=Object(u.c)(vz,{variables:{onlyEnabled:!0}}).data,f="suspend"===(null===m||void 0===m||null===(e=m.requirement)||void 0===e?void 0:e.requirement),j="custom"===(null===m||void 0===m||null===(t=m.requirement)||void 0===t?void 0:t.requirement),g=!!d.requirement&&!!(null===(n=c.requirement)||void 0===n?void 0:n.suspensionDays)&&(!(null===(a=m.requirement)||void 0===a?void 0:a.suspensionDays)||(null===(r=m.requirement)||void 0===r?void 0:r.suspensionDays)<0),O=null!==(i=A.a(["customInfoRequests"])(b))&&void 0!==i?i:[],x=O.length>0,v={display:"Custom information requirement",code:"custom"},y=[].concat(xz,x?[v]:[Object(s.a)(Object(s.a)({},v),{},{disabled:!0})]),w=Object(z.a)({},o.error,!!d.requirement&&!f||f&&g);return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Ko.a,{display:"flex",alignItems:"center",children:Object(Me.jsx)(Ue,{className:I()(w),children:"Choose a requirement"})}),Object(Me.jsx)(bn.b,{component:ti,name:"requirement.requirement",options:y,labelClassName:o.specialLabel,radioClassName:o.radio,className:I()(o.radioGroup,o.specialGrid),onChange:function(e){h(e),p({suspensionDays:!1})}}),f&&Object(Me.jsx)(bn.b,{className:o.thresholdField,component:ei,label:"Days",size:"lg",name:"requirement.suspensionDays",error:g}),j&&Object(Me.jsx)("div",{children:Object(Me.jsx)(bn.b,{className:o.dropdownField,component:Jr,label:"Available requests",name:"requirement.customInfoRequestId",options:O.map((function(e){return{value:e.id,display:e.customRequest.name}}))})})]})},initialValues:{requirement:{requirement:"",suspensionDays:"",customInfoRequestId:""}}},wz=function(e,t,n){return function(a){return e?L.a(B.a(t),Aa.a(W.a(null!==n&&void 0!==n?n:"code",a)))(e):""}},Cz=function(e){return function(t){return t.id===e}},kz=function(e){var t,n,a,r=e.customInfoRequests,i=Object(bn.f)().values,o=uz(),l=null===i||void 0===i||null===(t=i.requirement)||void 0===t?void 0:t.requirement,c=null!==(n=A.a(["requirement","customInfoRequestId"])(i))&&void 0!==n?n:"",s="suspend"===l,d=c?null!==(a=A.a(["customRequest","name"])(Aa.a(Cz(c))(r)))&&void 0!==a?a:"":wz(xz,"display")(l);return Object(Me.jsxs)(Ko.a,{display:"flex",alignItems:"baseline",children:["".concat(d," ").concat(s?"for":""),s&&Object(Me.jsx)(bn.b,{bold:!0,className:o.suspensionDays,name:"requirement.suspensionDays",component:ei,textAlign:"center"}),s&&"days"]})},Ez=function(e){var t,n=e.requirement,a=e.suspensionDays,r=e.customInfoRequestId,i=e.customInfoRequests,o=uz(),l="custom"===n?null!==(t=A.a(["customRequest","name"])(Aa.a(Cz(r))(i)))&&void 0!==t?t:"":wz(xz,"display")(n),c="suspend"===n;return Object(Me.jsxs)(Ko.a,{display:"flex",alignItems:"baseline",children:["".concat(l," ").concat(c?"for":""),c&&Object(Me.jsx)(Ze,{className:o.space,noMargin:!0,children:a}),c&&"days"]})},Nz=function(e){var t,n,a,r=e.config,i=e.currency,o=e.isEdit,l=uz(),c=(t={},Object(z.a)(t,l.input,!0),Object(z.a)(t,l.limitedInput,"txVelocity"===(null===r||void 0===r?void 0:r.triggerType)),Object(z.a)(t,l.daysInput,"consecutiveDays"===(null===r||void 0===r?void 0:r.triggerType)),t),s=null===r||void 0===r||null===(n=r.threshold)||void 0===n?void 0:n.threshold,d=null===r||void 0===r||null===(a=r.threshold)||void 0===a?void 0:a.thresholdDays,u=o?Object(Me.jsx)(bn.b,{bold:!0,className:I()(c),name:"threshold.threshold",component:ei,textAlign:"right"}):Object(Me.jsx)(Ze,{noMargin:!0,children:s}),m=o?Object(Me.jsx)(bn.b,{bold:!0,className:I()(c),name:"threshold.thresholdDays",component:ei,textAlign:"right"}):Object(Me.jsx)(Ze,{noMargin:!0,children:d});switch(null===r||void 0===r?void 0:r.triggerType){case"txAmount":return Object(Me.jsxs)(Ko.a,{display:"flex",alignItems:"baseline",justifyContent:"right",children:[u,Object(Me.jsx)(tt,{noMargin:!0,className:l.lastSpace,children:i})]});case"txVolume":return Object(Me.jsxs)(Ko.a,{display:"flex",alignItems:"baseline",justifyContent:"right",children:[u,Object(Me.jsx)(tt,{noMargin:!0,className:l.lastSpace,children:i}),Object(Me.jsx)(et,{noMargin:!0,className:l.space,children:"in"}),m,Object(Me.jsx)(et,{noMargin:!0,className:l.lastSpace,children:"days"})]});case"txVelocity":return Object(Me.jsxs)(Ko.a,{display:"flex",alignItems:"baseline",justifyContent:"right",children:[u,Object(Me.jsx)(et,{className:l.space,noMargin:!0,children:"transactions in"}),m,Object(Me.jsx)(et,{className:l.lastSpace,noMargin:!0,children:"days"})]});case"consecutiveDays":return Object(Me.jsxs)(Ko.a,{display:"flex",alignItems:"baseline",justifyContent:"right",children:[m,Object(Me.jsx)(et,{className:l.lastSpace,noMargin:!0,children:"days"})]});default:return""}},Sz=Object(a.memo)((function(e){var t=e.currency,n=Object(bn.f)().values;return Object(Me.jsx)(Nz,{isEdit:!0,config:n,currency:t})})),Iz=function(e){var t=e.config,n=e.currency;return Object(Me.jsx)(Nz,{config:t,currency:n})},Fz=function(e,t,n){return[{name:"triggerType",size:"sm",width:230,input:function(e){var t=e.field.value;return Object(Me.jsx)(Me.Fragment,{children:wz(jz,"display")(t)})},view:wz(jz,"display"),inputProps:{options:jz,valueProp:"code",labelProp:"display",optionsLimit:null}},{name:"requirement",size:"sm",width:230,bypassField:!0,input:function(){return Object(Me.jsx)(kz,{customInfoRequests:n})},view:function(e){return Object(Me.jsx)(Ez,Object(s.a)(Object(s.a)({},e),{},{customInfoRequests:n}))}},{name:"threshold",size:"sm",width:284,textAlign:"right",input:function(){return Object(Me.jsx)(Sz,{currency:e})},view:function(t,n){return Object(Me.jsx)(Iz,{config:n,currency:e})}}]},Lz=R.a(B.a("code"))(jz),Pz=[dz.a((function(e,t){return Lz.indexOf(e.triggerType)<Lz.indexOf(t.triggerType)}))],Dz=function(e){return R.a((function(e){var t=e.requirement,n=e.threshold,a=Object(q.a)(e,["requirement","threshold"]);return Object(s.a)({requirement:t.requirement,suspensionDays:t.suspensionDays,threshold:n.threshold,thresholdDays:n.thresholdDays,customInfoRequestId:t.customInfoRequestId},a)}))(e)},Rz={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:$},blankSpace:{padding:[[0,30]],margin:[[0,4,0,2]],borderBottom:"1px solid ".concat($),display:"inline-block"}},Bz=Object(f.a)(Rz),Tz=function(e,t){switch(e){case 1:return function(e){return{schema:fz,options:jz,Component:gz,props:{currency:e},initialValues:{triggerType:"",threshold:{threshold:"",thresholdDays:""}}}}(t);case 2:return yz;default:return a.Fragment}},Az=function(e,t,n,a){switch(e){case 1:return Object(Me.jsxs)(Me.Fragment,{children:["If the user ",Wz(t,n,a)]});case 2:return Object(Me.jsxs)(Me.Fragment,{children:["the user will be ",zz(t,a),"."]});default:return Object(Me.jsx)(Me.Fragment,{})}},Mz=function(e,t){var n=Object(Me.jsx)("span",{className:t.blankSpace});return Wa.a(e)||D.a(e)?n:e},Wz=function(e,t,n){switch(e.triggerType){case"txAmount":return Object(Me.jsxs)(Me.Fragment,{children:["makes a single transaction over"," ",Mz(e.threshold.threshold,n)," ",t]});case"txVolume":return Object(Me.jsxs)(Me.Fragment,{children:["makes more than ",Mz(e.threshold.threshold,n)," ",t," worth of transactions within"," ",Mz(e.threshold.thresholdDays,n)," ",Tm(e.threshold.thresholdDays,"day","days")]});case"txVelocity":return Object(Me.jsxs)(Me.Fragment,{children:["makes more than ",Mz(e.threshold.threshold,n)," ",Tm(e.threshold.threshold,"transaction","transactions")," ","in ",Mz(e.threshold.thresholdDays,n)," ",Tm(e.threshold.thresholdDays,"day","days")]});case"consecutiveDays":return Object(Me.jsxs)(Me.Fragment,{children:["at least one transaction every day for"," ",Mz(e.threshold.thresholdDays,n)," ",Tm(e.threshold.thresholdDays,"day","days")]});default:return Object(Me.jsx)(Me.Fragment,{})}},zz=function(e,t){var n;switch(null===(n=e.requirement)||void 0===n?void 0:n.requirement){case"sms":return Object(Me.jsx)(Me.Fragment,{children:"asked to enter code provided through SMS verification"});case"idCardPhoto":return Object(Me.jsx)(Me.Fragment,{children:"asked to scan a ID with photo"});case"idCardData":return Object(Me.jsx)(Me.Fragment,{children:"asked to scan a ID"});case"facephoto":return Object(Me.jsx)(Me.Fragment,{children:"asked to have a photo taken"});case"usSsn":return Object(Me.jsx)(Me.Fragment,{children:"asked to input his social security number"});case"sanctions":return Object(Me.jsx)(Me.Fragment,{children:"matched against the OFAC sanctions list"});case"superuser":return Object(Me.jsx)(Me.Fragment,{});case"suspend":return Object(Me.jsxs)(Me.Fragment,{children:["suspended for"," ",Mz(e.requirement.suspensionDays,t)," ",Tm(e.requirement.suspensionDays,"day","days")]});case"block":return Object(Me.jsx)(Me.Fragment,{children:"blocked"});case"custom":return Object(Me.jsx)(Me.Fragment,{children:"asked to fulfill a custom requirement"});default:return Mz(null,t)}},qz=function(e){var t=e.step,n=e.config,a=void 0===n?{}:n,i=e.liveValues,o=void 0===i?{}:i,l=e.currency,c=Bz(),s=xu.a(1,t).map((function(e,t){return Object(Me.jsx)(r.a.Fragment,{children:Az(e,a,l,c)},t)})),d=Az(t,o,l,c),u=2===t;return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Ge,{className:c.infoTitle,children:"Trigger overview so far"}),Object(Me.jsxs)(Ke,{noMargin:!0,className:c.infoText,children:[s,1!==t&&", ",d,!u&&"..."]})]})},$z=function(e){var t=e.setValues,n=Object(bn.f)().values;return Object(a.useEffect)((function(){t&&n&&t(n)}),[t,n]),null},Hz=function(e){var t=e.onClose,n=e.save,r=e.error,i=e.currency,o=Bz(),c=Object(a.useState)({}),d=Object(l.a)(c,2),u=d[0],m=d[1],h=Object(a.useState)({step:1}),p=Object(l.a)(h,2),b=p[0],f=b.step,j=b.config,g=p[1],O=2===f,x=Tz(f,i),v=function(){var e=Object(Pl.a)(Ll.a.mark((function e(t){var a;return Ll.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=Gn.a(j,x.schema.cast(t)),!O){e.next=3;break}return e.abrupt("return",n(a));case 3:g({step:f+1,config:a});case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),y=function(e,t,n){var a,r,i,o,l,c,s,d,u,m,h=null===n||void 0===n?void 0:n.triggerType,p=ul.a(h),b="suspend"===(null===n||void 0===n||null===(a=n.requirement)||void 0===a?void 0:a.requirement),f=!!e.requirement&&!!(null===(r=t.requirement)||void 0===r?void 0:r.suspensionDays)&&(!(null===(i=n.requirement)||void 0===i?void 0:i.suspensionDays)||(null===(o=n.requirement)||void 0===o?void 0:o.suspensionDays)<0),j=!!e.threshold&&!!(null===(l=t.threshold)||void 0===l?void 0:l.threshold)&&!p(["consecutiveDays"])&&(!(null===(c=n.threshold)||void 0===c?void 0:c.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)&&!p(["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 p(["txAmount","txVolume","txVelocity"])&&j||p(["txVolume","txVelocity","consecutiveDays"])&&g?e.threshold:b&&f?e.requirement:void 0};return Object(Me.jsx)(Me.Fragment,{children:Object(Me.jsxs)(Mh,{title:"New compliance trigger",handleClose:t,width:560,height:520,infoPanel:Object(Me.jsx)(qz,{currency:i,step:f,config:j,liveValues:u}),infoPanelHeight:172,open:!0,children:[Object(Me.jsx)(rp,{className:o.stepper,steps:2,currentStep:f}),Object(Me.jsx)(bn.e,{validateOnBlur:!1,validateOnChange:!0,enableReinitialize:!0,onSubmit:v,initialValues:x.initialValues,validationSchema:x.schema,children:function(e){var t=e.errors,n=e.touched,a=e.values;return Object(Me.jsxs)(bn.d,{className:o.form,children:[Object(Me.jsx)($z,{setValues:m}),Object(Me.jsx)(x.Component,Object(s.a)({},x.props)),Object(Me.jsxs)("div",{className:o.submit,children:[r&&Object(Me.jsx)(Jo,{children:"Failed to save"}),y(t,n,a)&&Object(Me.jsx)(Jo,{children:y(t,n,a)}),Object(Me.jsx)(An,{className:o.button,type:"submit",children:O?"Finish":"Next"})]})]})}})]})})},Vz=Object(f.a)(sz),Uz=x()(xW||(xW=Object(c.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),Gz=function(e){var t=e.triggers,n=e.showWizard,r=e.config,i=e.toggleWizard,o=e.customInfoRequests,c=A.a(["fiatCurrency"])(rs(Zc)(r)),d=(Vz(),Object(a.useState)(null)),m=Object(l.a)(d,2),h=m[0],p=m[1],b=Object(u.b)(Uz,{onCompleted:function(){return i("off")},refetchQueries:function(){return["getData"]},onError:function(e){return p(e)}}),f=Object(l.a)(b,1)[0];return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Rh,{data:t,name:"triggers",enableEdit:!0,sortBy:Pz,groupBy:"triggerType",enableDelete:!0,error:null===h||void 0===h?void 0:h.message,save:function(e){return p(null),f({variables:{config:{triggers:Dz(e.triggers)}}})},validationSchema:bz,elements:Fz(c,0,o)}),n&&Object(Me.jsx)(Hz,{currency:c,error:null===h||void 0===h?void 0:h.message,save:function(e){var n=ll.a([Object(s.a)({id:Object(cm.a)(),direction:"both"},e)])(t);return f({variables:{config:{triggers:Dz(n)}}})},onClose:i}),Wa.a(t)&&Object(Me.jsxs)(Ko.a,{display:"flex",alignItems:"center",flexDirection:"column",mt:15,children:[Object(Me.jsx)(He,{children:"It seems there are no active compliance triggers on your network"}),Object(Me.jsx)(An,{onClick:function(){return i()},children:"Add first trigger"})]})]})},Xz=[{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"}],_z=xn.f().shape({expirationTime:xn.h().label("Expiration time").required(),automation:xn.h().label("Automation").matches(/(Manual|Automatic)/).required()}),Zz=[{expirationTime:"Forever",automation:"Automatic"}],Kz={requirement:"",expirationTime:"Forever",automation:"Automatic"},Qz=x()(vW||(vW=Object(c.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),Yz=x()(yW||(yW=Object(c.a)(["\n query getData {\n config\n }\n"]))),Jz=Object(a.memo)((function(){var e,t,n=es,r=Object(a.useState)(null),i=Object(l.a)(r,2),o=i[0],c=i[1],s=Object(a.useState)(!1),d=Object(l.a)(s,2),m=d[0],h=d[1],p=Object(a.useState)(!1),b=Object(l.a)(p,2),f=b[0],j=b[1],g=Object(u.c)(Yz).data,O=Object(u.b)(Qz,{refetchQueries:function(){return["getData"]},onError:function(e){return c(e)}}),x=Object(l.a)(O,1)[0],v=(null===g||void 0===g?void 0:g.config)&&rs(n)(null===g||void 0===g?void 0:g.config),y=v&&!Wa.a(v)?v:Zz,w=null!==(e=null===v||void 0===v?void 0:v.overrides)&&void 0!==e?e:[];return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(jO,{children:Object(Me.jsx)(Rh,{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=is(n)(e.triggersConfig[0]);return c(null),x({variables:{config:t}})},validationSchema:_z,data:mw.a(y),elements:[{name:"expirationTime",header:"Expiration Time",width:196,size:"sm",editable:!1},{name:"automation",header:"Automation",width:196,size:"sm",input:Tr,inputProps:{options:[{code:"Automatic",display:"Automatic"},{code:"Manual",display:"Manual"}],labelProp:"display",valueProp:"code"}}],setEditing:function(e,t){return h(t)},forceDisable:f})}),Object(Me.jsx)(jO,{children:Object(Me.jsx)(Rh,{error:null===o||void 0===o?void 0:o.message,title:"Overrides",titleLg:!0,name:"overrides",enableDelete:!0,enableEdit:!0,enableCreate:!0,initialValues:Kz,save:function(e){var t=is(n)(e);return c(null),x({variables:{config:t}})},validationSchema:(t=w,xn.f().shape({id:xn.h().label("Requirement").required().test({test:function(){var e,n=this.parent.requirement;return!Aa.a(W.a("requirement",n))(t)||this.createError({message:"Requirement ".concat((e=n,B.a("display",Aa.a(W.a("code",e))(Xz)))," already overriden")})}}),expirationTime:xn.h().label("Expiration time").required(),automation:xn.h().label("Automation").matches(/(Manual|Automatic)/).required()})),data:w,elements:[{name:"requirement",header:"Requirement",width:196,size:"sm",view:wz(Xz,"display"),input:Tr,inputProps:{options:Xz,labelProp:"display",valueProp:"code"}},{name:"expirationTime",header:"Expiration Time",width:196,size:"sm",editable:!1},{name:"automation",header:"Automation",width:196,size:"sm",input:Tr,inputProps:{options:[{code:"Automatic",display:"Automatic"},{code:"Manual",display:"Manual"}],labelProp:"display",valueProp:"code"}}],setEditing:function(e,t){return j(t)},forceDisable:m})})]})})),eq=Object(f.a)(sz),tq=x()(wW||(wW=Object(c.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),nq=x()(CW||(CW=Object(c.a)(["\n query getData {\n config\n }\n"]))),aq=x()(kW||(kW=Object(c.a)(["\n query customInfoRequests {\n customInfoRequests {\n id\n customRequest\n enabled\n }\n }\n"]))),rq=function(){var e,t,n,r,i,o=eq(),c=Object(a.useState)(!1),d=Object(l.a)(c,2),m=d[0],h=d[1],p=Object(u.c)(nq),b=p.data,f=p.loading,j=Object(u.c)(aq).data,g=Object(a.useState)(null),O=Object(l.a)(g,2),x=O[0],v=O[1],y=Object(a.useState)(!1),w=Object(l.a)(y,2),C=w[0],k=w[1],E=null!==(e=A.a(["customInfoRequests"])(j))&&void 0!==e?e:[],N=M.a(W.a("enabled",!0))(E),S=function(e,t){return R.a((function(e){var t=e.requirement,n=e.suspensionDays,a=e.threshold,r=e.thresholdDays,i=e.customInfoRequestId,o=Object(q.a)(e,["requirement","suspensionDays","threshold","thresholdDays","customInfoRequestId"]);return Object(s.a)({requirement:{requirement:t,suspensionDays:n,customInfoRequestId:i},threshold:{threshold:a,thresholdDays:r}},o)}))(e)}(null!==(t=null===b||void 0===b||null===(n=b.config)||void 0===n?void 0:n.triggers)&&void 0!==t?t:[]),F=(null===b||void 0===b?void 0:b.config)&&rs("compliance")(b.config),L=null!==(r=null===F||void 0===F?void 0:F.rejectAddressReuse)&&void 0!==r&&r,P=Object(u.b)(tq,{onCompleted:function(){return h(!1)},refetchQueries:function(){return["getData"]},onError:function(e){return v(e)}}),D=Object(l.a)(P,1)[0],B=Object(z.a)({},o.tableWidth,"customInfoRequests"===!C),T=function(e){return e?document.querySelector("#root").classList.add("root-blur"):document.querySelector("#root").classList.remove("root-blur")},$=function(e){return function(t){return m===e||t?(T(!1),h(null)):(T(!0),h(e))}};return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)(nl,{title:"Compliance Triggers",buttons:[{text:"Advanced settings",icon:fA,inverseIcon:dA,forceDisable:!("advancedSettings"===C),toggle:function(e){k(!!e&&"advancedSettings")}},{text:"Custom info requests",icon:rA,inverseIcon:YT,forceDisable:!("customInfoRequests"===C),toggle:function(e){k(!!e&&"customInfoRequests")}}],className:I()(B),children:[!C&&Object(Me.jsx)(Ko.a,{display:"flex",alignItems:"center",children:Object(Me.jsxs)(Ko.a,{display:"flex",alignItems:"center",justifyContent:"flex-end",mr:"-5px",children:[Object(Me.jsx)(Xe,{children:"Reject reused addresses"}),Object(Me.jsx)(Fr,{checked:L,onChange:function(e){!function(e){var t=is("compliance")(e);D({variables:{config:t}})}({rejectAddressReuse:e.target.checked})},value:L}),Object(Me.jsx)(tt,{className:o.switchLabel,children:L?"On":"Off"}),Object(Me.jsx)(fp,{width:304,children:Object(Me.jsx)(Xe,{children:"This option requires a user to scan a different cryptocurrency address if they attempt to scan one that had been previously used for a transaction in your network"})})]})}),"customInfoRequests"===C&&!Wa.a(N)&&Object(Me.jsx)(Ko.a,{display:"flex",justifyContent:"flex-end",children:Object(Me.jsx)(oa,{color:"primary",onClick:function(){return $("newCustomRequest")()},children:"+ Add new custom info request"})}),!f&&!C&&!Wa.a(S)&&Object(Me.jsx)(Ko.a,{display:"flex",justifyContent:"flex-end",children:Object(Me.jsx)(oa,{color:"primary",onClick:function(){return $("newTrigger")()},children:"+ Add new trigger"})})]}),!f&&"customInfoRequests"===C&&Object(Me.jsx)(cz,{data:N,showWizard:"newCustomRequest"===m,toggleWizard:$("newCustomRequest")}),!f&&!C&&Object(Me.jsx)(Gz,{triggers:S,showWizard:"newTrigger"===m,config:null!==(i=null===b||void 0===b?void 0:b.config)&&void 0!==i?i:{},toggleWizard:$("newTrigger"),customInfoRequests:E}),!f&&"advancedSettings"===C&&Object(Me.jsx)(Jz,{error:x,save:D,data:b})]})},iq={footer:{display:"flex",flexDirection:"row",margin:[["auto",0,24,0]]},modalTitle:{marginTop:-5,color:J,fontFamily:be},modalLabel1:{marginTop:20},modalLabel2:{marginTop:40},inputLabel:{color:J,fontFamily:be,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:re,fontFamily:be,marginLeft:10},actionChip:{backgroundColor:re,marginRight:15},info:{fontFamily:fe,textAlign:"justify"},addressWrapper:{backgroundColor:re,marginTop:8,height:35},address:{margin:"0px ".concat(16,"px 0px ").concat(16,"px"),paddingRight:-15},errorMessage:{fontFamily:fe,color:me},codeContainer:{marginTop:15,marginBottom:15},form:{display:"flex",flexDirection:"column",height:"100%"},submit:{margin:[["auto",0,0,"auto"]]},error:{color:me},link:{position:"absolute",top:10,left:0,bottom:"-20px",right:"-20px",whiteSpace:"nowrap",overflowX:"auto",width:"92.5%"},linkWrapper:{width:"100%",height:"100%",overflow:"hidden",position:"relative"},loginWrapper:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},username:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",width:"100%"},roleSwitch:{marginLeft:15}},oq=Object(f.a)(iq),lq=x()(EW||(EW=Object(c.a)(["\n query confirm2FA($code: String!) {\n confirm2FA(code: $code)\n }\n"]))),cq=function(e){var t=e.showModal,n=e.handleClose,r=e.setConfirmation,i=oq(),o=Object(a.useState)(""),c=Object(l.a)(o,2),s=c[0],d=c[1],m=Object(a.useState)(!1),h=Object(l.a)(m,2),p=h[0],b=h[1],f=Object(u.a)(lq,{onCompleted:function(e){return e.confirm2FA?(r(s),d(""),void b(!1)):b(!0)}}),j=Object(l.a)(f,2),g=j[0],O=j[1].error,x=function(){return O?"Internal server error":6!==s.length&&p?"The code should have 6 characters!":p?"Code is invalid. Please try again.":null};return t&&Object(Me.jsxs)(Mh,{closeOnBackdropClick:!0,width:500,height:350,handleClose:n,open:!0,children:[Object(Me.jsx)(Ze,{className:i.modalTitle,children:"Confirm action"}),Object(Me.jsx)(Xe,{className:i.info,children:"To make changes on this user, please confirm this action by entering your two-factor authentication code below."}),Object(Me.jsx)(hr,{name:"2fa",value:s,onChange:function(e){d(e),b(!1)},numInputs:6,error:p,containerStyle:i.codeContainer,shouldAutoFocus:!0}),x()&&Object(Me.jsx)(Xe,{className:i.errorMessage,children:x()}),Object(Me.jsx)("div",{className:i.footer,children:Object(Me.jsx)(An,{className:i.submit,onClick:function(){6===s.length?g({variables:{code:s}}):b(!0)},children:"Confirm"})})]})},sq=x()(NW||(NW=Object(c.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"]))),dq=Object(f.a)(iq),uq=function(e){var t=e.state,n=e.dispatch,r=e.user,i=e.requiresConfirmation,o=dq(),c=Object(u.b)(sq,{onCompleted:function(){return j()},refetchQueries:function(){return["users"]}}),s=Object(l.a)(c,2),d=s[0],m=s[1].error,h=Object(a.useState)(null),p=Object(l.a)(h,2),b=p[0],f=p[1],j=function(){f(null),n({type:"close",payload:"showRoleModal"})};return t.showRoleModal&&i&&!b&&Object(Me.jsx)(cq,{showModal:t.showRoleModal,handleClose:j,setConfirmation:f})||t.showRoleModal&&Object(Me.jsxs)(Mh,{closeOnBackdropClick:!0,width:450,height:250,handleClose:j,open:!0,children:[Object(Me.jsxs)(Ze,{className:o.modalTitle,children:["Change ",r.username,"'s role?"]}),Object(Me.jsxs)(Xe,{className:o.info,children:["You are about to alter ",r.username,"'s role. This will change this user's permission to access certain resources."]}),Object(Me.jsx)(Xe,{className:o.info,children:"Do you wish to proceed?"}),Object(Me.jsxs)("div",{className:o.footer,children:[m&&Object(Me.jsx)(Jo,{children:m}),Object(Me.jsx)(An,{className:o.submit,onClick:function(){d({variables:{confirmationCode:b,id:r.id,newRole:"superuser"===r.role?"user":"superuser"}})},children:"Confirm"})]})]})},mq="https://".concat(window.location.hostname),hq=function(e){return"".concat(mq).concat(e)},pq=Object(f.a)(iq),bq=x()(SW||(SW=Object(c.a)(["\n mutation createRegisterToken($username: String!, $role: String!) {\n createRegisterToken(username: $username, role: $role) {\n token\n expire\n }\n }\n"]))),fq=xn.f().shape({username:xn.h().email("Username field should be in an email format!").required("Username field is required!"),role:xn.h().required("Role field is required!")}),jq={username:"",role:""},gq=[{code:"user",display:"Regular user"},{code:"superuser",display:"Superuser"}],Oq=function(e,t,n){return e&&t?n?"Internal server error":e.username&&t.username?e.username:null:null},xq=function(e){var t=e.state,n=e.dispatch,r=pq(),i=Object(a.useState)(""),o=Object(l.a)(i,2),c=o[0],s=o[1],d=Object(a.useState)(null),m=Object(l.a)(d,2),h=m[0],p=m[1],b=function(){p(null),n({type:"close",payload:"showCreateUserModal"})},f=Object(u.b)(bq,{onCompleted:function(e){var t=e.createRegisterToken,n="t=".concat(t.token);p(hq("/register?".concat(n)))}}),j=Object(l.a)(f,2),g=j[0],O=j[1].error;return Object(Me.jsxs)(Me.Fragment,{children:[t.showCreateUserModal&&!h&&Object(Me.jsx)(Mh,{closeOnBackdropClick:!0,width:600,height:400,handleClose:b,open:!0,children:Object(Me.jsx)(bn.e,{validationSchema:fq,initialValues:jq,onSubmit:function(e){s(e.username),g({variables:{username:e.username,role:e.role}})},children:function(e){var t,n,a=e.errors,i=e.touched;return Object(Me.jsxs)(bn.d,{id:"register-user-form",className:r.form,children:[Object(Me.jsx)($e,{className:r.modalTitle,children:"Create new user"}),Object(Me.jsx)(bn.b,{component:ai,name:"username",width:338,autoFocus:!0,label:"User login"}),Object(Me.jsx)(Ve,{className:I()((t=a,n=i,Object(z.a)({},r.error,t.role&&n.role)),r.modalLabel2),children:"Role"}),Object(Me.jsx)(bn.b,{component:ti,name:"role",labelClassName:r.radioLabel,className:r.radioGroup,options:gq}),Object(Me.jsxs)("div",{className:r.footer,children:[Oq(a,i,O)&&Object(Me.jsx)(Jo,{children:Oq(a,i,O)}),Object(Me.jsx)(An,{type:"submit",form:"register-user-form",className:r.submit,children:"Finish"})]})]})}})}),t.showCreateUserModal&&h&&Object(Me.jsxs)(Mh,{closeOnBackdropClick:!0,width:500,height:200,handleClose:b,open:!0,children:[Object(Me.jsxs)(Ze,{className:r.modalTitle,children:["Creating ",c,"..."]}),Object(Me.jsxs)(Xe,{className:r.info,children:["Safely share this link with ",c," to finish the registration process."]}),Object(Me.jsx)("div",{className:r.addressWrapper,children:Object(Me.jsx)(Qe,{className:r.address,children:Object(Me.jsx)("strong",{children:Object(Me.jsx)(gf,{className:r.link,buttonClassname:r.copyToClipboard,wrapperClassname:r.linkWrapper,children:h})})})})]})]})},vq=x()(IW||(IW=Object(c.a)(["\n mutation enableUser($confirmationCode: String, $id: ID!) {\n enableUser(confirmationCode: $confirmationCode, id: $id) {\n id\n }\n }\n"]))),yq=x()(FW||(FW=Object(c.a)(["\n mutation disableUser($confirmationCode: String, $id: ID!) {\n disableUser(confirmationCode: $confirmationCode, id: $id) {\n id\n }\n }\n"]))),wq=Object(f.a)(iq),Cq=function(e){var t=e.state,n=e.dispatch,r=e.user,i=e.requiresConfirmation,o=wq(),c=Object(u.b)(vq,{onCompleted:function(){return y()},refetchQueries:function(){return["users"]}}),s=Object(l.a)(c,2),d=s[0],m=s[1].error,h=Object(u.b)(yq,{onCompleted:function(){return y()},refetchQueries:function(){return["users"]}}),p=Object(l.a)(h,2),b=p[0],f=p[1].error,j=Object(a.useState)(null),g=Object(l.a)(j,2),O=g[0],x=g[1],v=function(){(null===r||void 0===r?void 0:r.enabled)?b({variables:{confirmationCode:O,id:r.id}}):d({variables:{confirmationCode:O,id:r.id}})},y=function(){x(null),n({type:"close",payload:"showEnableUserModal"})};return t.showEnableUserModal&&i&&!O&&Object(Me.jsx)(cq,{showModal:t.showEnableUserModal,handleClose:y,setConfirmation:x})||t.showEnableUserModal&&Object(Me.jsxs)(Mh,{closeOnBackdropClick:!0,width:450,height:275,handleClose:y,open:!0,children:[!r.enabled&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)(Ze,{className:o.modalTitle,children:["Enable ",r.username,"?"]}),Object(Me.jsxs)(Xe,{className:o.info,children:["You are about to enable ",r.username," into the system, activating previous eligible sessions and grant permissions to access the system."]}),Object(Me.jsx)(Xe,{className:o.info,children:"Do you wish to proceed?"})]}),r.enabled&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)(Ze,{className:o.modalTitle,children:["Disable ",r.username,"?"]}),Object(Me.jsxs)(Xe,{className:o.info,children:["You are about to disable ",r.username," from the system, deactivating previous eligible sessions and removing permissions to access the system."]}),Object(Me.jsx)(Xe,{className:o.info,children:"Do you wish to proceed?"})]}),Object(Me.jsxs)("div",{className:o.footer,children:[f&&Object(Me.jsx)(Jo,{children:f}),m&&Object(Me.jsx)(Jo,{children:m}),Object(Me.jsx)(An,{className:o.submit,onClick:function(){return v()},children:"Confirm"})]})]})},kq=x()(LW||(LW=Object(c.a)(["\n mutation createReset2FAToken($confirmationCode: String, $userID: ID!) {\n createReset2FAToken(confirmationCode: $confirmationCode, userID: $userID) {\n token\n user_id\n expire\n }\n }\n"]))),Eq=Object(f.a)(iq),Nq=function(e){var t=e.state,n=e.dispatch,r=e.user,i=e.requiresConfirmation,o=Eq(),c=Object(a.useState)(""),s=Object(l.a)(c,2),d=s[0],m=s[1],h=Object(u.b)(kq,{onCompleted:function(e){var t=e.createReset2FAToken;m(hq("/reset2fa?t=".concat(t.token)))}}),p=Object(l.a)(h,2),b=p[0],f=p[1],j=f.loading,g=f.error,O=Object(a.useState)(null),x=Object(l.a)(O,2),v=x[0],y=x[1];Object(a.useEffect)((function(){t.showReset2FAModal&&(v||!i)&&b({variables:{confirmationCode:v,userID:null===r||void 0===r?void 0:r.id}})}),[v,b,i,t.showReset2FAModal,null===r||void 0===r?void 0:r.id]);var w=function(){y(null),n({type:"close",payload:"showReset2FAModal"})};return t.showReset2FAModal&&i&&!v&&Object(Me.jsx)(cq,{showModal:t.showReset2FAModal,handleClose:w,setConfirmation:y})||t.showReset2FAModal&&(v||!i)&&!j&&Object(Me.jsxs)(Mh,{closeOnBackdropClick:!0,width:500,height:200,handleClose:w,open:!0,children:[Object(Me.jsxs)(Ze,{className:o.modalTitle,children:["Reset 2FA for ",r.username]}),Object(Me.jsxs)(Xe,{className:o.info,children:["Safely share this link with ",r.username," for a two-factor authentication reset."]}),!g&&Object(Me.jsx)("div",{className:o.addressWrapper,children:Object(Me.jsx)(Qe,{className:o.address,children:Object(Me.jsx)("strong",{children:Object(Me.jsx)(gf,{className:o.link,buttonClassname:o.copyToClipboard,wrapperClassname:o.linkWrapper,children:d})})})}),g&&Object(Me.jsx)(Jo,{children:g})]})},Sq=x()(PW||(PW=Object(c.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"]))),Iq=Object(f.a)(iq),Fq=function(e){var t=e.state,n=e.dispatch,r=e.user,i=e.requiresConfirmation,o=Iq(),c=Object(a.useState)(""),s=Object(l.a)(c,2),d=s[0],m=s[1],h=Object(u.b)(Sq,{onCompleted:function(e){var t=e.createResetPasswordToken;m(hq("/resetpassword?t=".concat(t.token)))}}),p=Object(l.a)(h,2),b=p[0],f=p[1],j=f.loading,g=f.error,O=Object(a.useState)(null),x=Object(l.a)(O,2),v=x[0],y=x[1];Object(a.useEffect)((function(){t.showResetPasswordModal&&(v||!i)&&b({variables:{confirmationCode:v,userID:null===r||void 0===r?void 0:r.id}})}),[v,b,i,t.showResetPasswordModal,null===r||void 0===r?void 0:r.id]);var w=function(){y(null),n({type:"close",payload:"showResetPasswordModal"})};return t.showResetPasswordModal&&i&&!v&&Object(Me.jsx)(cq,{showModal:t.showResetPasswordModal,handleClose:w,setConfirmation:y})||t.showResetPasswordModal&&(v||!i)&&!j&&Object(Me.jsxs)(Mh,{closeOnBackdropClick:!0,width:500,height:180,handleClose:w,open:!0,children:[Object(Me.jsxs)(Ze,{className:o.modalTitle,children:["Reset password for ",r.username]}),Object(Me.jsxs)(Xe,{className:o.info,children:["Safely share this link with ",r.username," for a password reset."]}),!g&&Object(Me.jsx)("div",{className:o.addressWrapper,children:Object(Me.jsx)(Qe,{className:o.address,children:Object(Me.jsx)("strong",{children:Object(Me.jsx)(gf,{className:o.link,buttonClassname:o.copyToClipboard,wrapperClassname:o.linkWrapper,children:d})})})}),g&&Object(Me.jsx)(Jo,{children:g})]})},Lq=Object(f.a)(iq),Pq=x()(DW||(DW=Object(c.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"]))),Dq=x()(RW||(RW=Object(c.a)(["\n query generateAttestationOptions($userID: ID!) {\n generateAttestationOptions(userID: $userID)\n }\n"]))),Rq=x()(BW||(BW=Object(c.a)(["\n mutation validateAttestation(\n $userID: ID!\n $attestationResponse: JSONObject!\n ) {\n validateAttestation(\n userID: $userID\n attestationResponse: $attestationResponse\n )\n }\n"]))),Bq={showCreateUserModal:!1,showResetPasswordModal:!1,showReset2FAModal:!1,showRoleModal:!1,showEnableUserModal:!1},Tq=function(e,t){var n=t.type,a=t.payload;switch(n){case"close":return Bq;case"open":return Object(s.a)(Object(s.a)({},Bq),{},Object(z.a)({},a,!0));default:return Bq}},Aq={user:"Regular",superuser:"Superuser"},Mq=function(){var e=Lq(),t=Object(a.useContext)(k).userData,n=Object(u.c)(Pq).data,r=Object(a.useReducer)(Tq,Bq),i=Object(l.a)(r,2),o=i[0],c=i[1],s=Object(a.useState)(null),d=Object(l.a)(s,2),m=d[0],h=d[1],p=Object(u.b)(Rq,{onCompleted:function(e){}}),b=Object(l.a)(p,1)[0],f=Object(u.a)(Dq,{onCompleted:function(e){var t=e.generateAttestationOptions;Object(Cl.b)(t).then((function(e){b({variables:{userID:m.id,attestationResponse:e}})}))}}),j=Object(l.a)(f,1)[0],g=[{header:"Login",width:307,textAlign:"left",size:"sm",view:function(n){return t.id===n.id?Object(Me.jsxs)("div",{className:e.loginWrapper,children:[Object(Me.jsx)("span",{className:e.username,children:n.username}),Object(Me.jsx)(Ar.a,{size:"small",label:"You",className:e.chip})]}):Object(Me.jsx)("span",{className:e.username,children:n.username})}},{header:"Role",width:160,textAlign:"left",size:"sm",view:function(n){return Object(Me.jsxs)("div",{className:e.loginWrapper,children:[Object(Me.jsx)("span",{children:Aq[n.role]}),Object(Me.jsx)(Fr,{className:e.roleSwitch,disabled:t.id===n.id,checked:"superuser"===n.role,onClick:function(){h(n),c({type:"open",payload:"showRoleModal"})},value:"superuser"===n.role})]})}},{header:"Actions",width:565,textAlign:"left",size:"sm",view:function(t){return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Ar.a,{size:"small",label:"Reset password",className:e.actionChip,onClick:function(){h(t),c({type:"open",payload:"showResetPasswordModal"})}}),Object(Me.jsx)(Ar.a,{size:"small",label:"Reset 2FA",className:e.actionChip,onClick:function(){h(t),c({type:"open",payload:"showReset2FAModal"})}}),Object(Me.jsx)(Ar.a,{size:"small",label:"Add FIDO",className:e.actionChip,onClick:function(){h(t),j({variables:{userID:t.id}})}})]})}},{header:"Enabled",width:100,textAlign:"center",size:"sm",view:function(e){return Object(Me.jsx)(Fr,{disabled:t.id===e.id,checked:e.enabled,onClick:function(){h(e),c({type:"open",payload:"showEnableUserModal"})},value:e.enabled})}}];return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(nl,{title:"User Management"}),Object(Me.jsx)(Ko.a,{marginBottom:3,marginTop:-5,className:e.tableWidth,display:"flex",justifyContent:"flex-end",children:Object(Me.jsx)(oa,{color:"primary",onClick:function(){c({type:"open",payload:"showCreateUserModal"})},children:"Add new user"})}),Object(Me.jsx)(gy,{elements:g,data:A.a(["users"])(n)}),Object(Me.jsx)(xq,{state:o,dispatch:c}),Object(Me.jsx)(Fq,{state:o,dispatch:c,user:m,requiresConfirmation:"superuser"===(null===m||void 0===m?void 0:m.role)}),Object(Me.jsx)(Nq,{state:o,dispatch:c,user:m,requiresConfirmation:"superuser"===(null===m||void 0===m?void 0:m.role)}),Object(Me.jsx)(uq,{state:o,dispatch:c,user:m,requiresConfirmation:"superuser"===(null===m||void 0===m?void 0:m.role)}),Object(Me.jsx)(Cq,{state:o,dispatch:c,user:m,requiresConfirmation:"superuser"===(null===m||void 0===m?void 0:m.role)})]})},Wq=x()(TW||(TW=Object(c.a)(["\n mutation Save($config: JSONObject, $accounts: JSONObject) {\n saveConfig(config: $config)\n saveAccounts(accounts: $accounts)\n }\n"]))),zq=x()(AW||(AW=Object(c.a)(["\n query getData {\n config\n accounts\n cryptoCurrencies {\n code\n display\n }\n }\n"]))),qq=function(){var e,t=Gc,n=Object(u.c)(zq).data,a=Object(u.b)(Wq,{refetchQueries:function(){return["getData"]}}),r=Object(l.a)(a,2),i=r[0],o=r[1].error,c=(null===n||void 0===n?void 0:n.config)&&rs(t)(n.config),s=null!==(e=null===n||void 0===n?void 0:n.cryptoCurrencies)&&void 0!==e?e:[];return Object(Me.jsx)(Bh,{name:"advancedWallet",namespaces:R.a(A.a(["code"]))(s),data:c,error:null===o||void 0===o?void 0:o.message,enableEdit:!0,editWidth:174,save:function(e,n){var a=is(t)(e);return i({variables:{config:a,accounts:n}})},validationSchema:uO,elements:mO(s,yf.utils)})},$q={header:{display:"flex",alignItems:"center",justifyContent:"space-between"},feeDiscountLabel:{color:se,margin:[[13,0,-5,20]]},selection:{marginRight:12}},Hq=x()(MW||(MW=Object(c.a)(["\n mutation Save($config: JSONObject, $accounts: JSONObject) {\n saveConfig(config: $config)\n saveAccounts(accounts: $accounts)\n }\n"]))),Vq=x()(WW||(WW=Object(c.a)(["\n mutation Save($accounts: JSONObject) {\n saveAccounts(accounts: $accounts)\n }\n"]))),Uq=x()(zW||(zW=Object(c.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"]))),Gq=Object(f.a)($q),Xq=function(e){var t,n,r,i=e.name,o=Gq(),c=Object(a.useState)(null),s=Object(l.a)(c,2),d=s[0],m=s[1],h=Object(a.useState)(null),p=Object(l.a)(h,2),b=p[0],f=p[1],j=Object(a.useState)(null),g=Object(l.a)(j,2),O=g[0],x=g[1],v=Object(a.useState)(null),y=Object(l.a)(v,2),w=y[0],C=y[1],k=Object(a.useState)(!1),E=Object(l.a)(k,2),N=E[0],S=E[1],I=Object(a.useState)(!1),F=Object(l.a)(I,2),L=F[0],P=F[1],D=Object(u.c)(Uq).data,B=Object(u.b)(Hq,{onCompleted:function(){return S(!1)},refetchQueries:function(){return["getData"]}}),T=Object(l.a)(B,2),M=T[0],q=T[1].error,$=Object(u.b)(Vq,{onCompleted:function(){return x(null)},refetchQueries:function(){return["getData"]}}),H=Object(l.a)($,1)[0],V=function(e,t){var n=is(i)(e);return M({variables:{config:n,accounts:t}})},U=(null===D||void 0===D?void 0:D.config)&&rs("locale")(D.config).fiatCurrency,G=(null===D||void 0===D?void 0:D.config)&&rs(i)(D.config),X=null===D||void 0===D?void 0:D.accountsConfig,_=null!==(t=null===D||void 0===D?void 0:D.cryptoCurrencies)&&void 0!==t?t:[],Z=null!==(n=null===D||void 0===D?void 0:D.accounts)&&void 0!==n?n:[];return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)("div",{className:o.header,children:[Object(Me.jsx)(nl,{title:"Wallet Settings",button:{text:"Advanced settings",icon:fA,inverseIcon:dA,toggle:P}}),Object(Me.jsxs)(Ko.a,{alignItems:"center",justifyContent:"end",children:[Object(Me.jsx)(et,{className:o.feeDiscountLabel,children:"Fee discount"}),Object(Me.jsxs)(Ko.a,{display:"flex",alignItems:"center",justifyContent:"end",mr:"-4px",children:[Object(Me.jsx)(Xe,{className:o.selection,children:b}),Object(Me.jsx)(ta,{onClick:function(){return m(!0)},children:Object(Me.jsx)(kh,{})})]})]})]}),!L&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Bh,{name:"test",namespaces:R.a(A.a(["code"]))(_),data:G,error:null===q||void 0===q?void 0:q.message,stripeWhen:function(e){return!dO.isValidSync(e)},enableEdit:!0,shouldOverrideEdit:function(e){var t=rs(e)(G);return!dO.isValidSync(t)},editOverride:S,editWidth:174,save:V,validationSchema:dO,elements:hO(_,X,(function(e,t,n){return t?!Z[t]&&gx[t]?(x(gx[t]),void C((function(){return function(){return n(t)}}))):void n(t):n(t)}))}),N&&Object(Me.jsx)(fL,{coin:Aa.a(W.a("code",N))(_),onClose:function(){return S(!1)},save:V,error:null===q||void 0===q?void 0:q.message,cryptoCurrencies:_,fiatCurrency:U,userAccounts:null===D||void 0===D||null===(r=D.config)||void 0===r?void 0:r.accounts,accounts:Z,accountsConfig:X}),O&&Object(Me.jsx)(Mh,{title:"Edit ".concat(O.name),width:478,handleClose:function(){return x(null)},open:!0,children:Object(Me.jsx)(BO,{save:function(e){return H({variables:{accounts:Object(z.a)({},O.code,e)}}).then((function(e){return w(),C(null),e}))},elements:O.elements,validationSchema:O.validationSchema,value:Z[O.code]})})]}),L&&Object(Me.jsx)(qq,{}),d&&Object(Me.jsxs)(Mh,{title:"Fee discount for BTC",width:478,handleClose:function(){return m(null)},open:!0,children:[Object(Me.jsx)(Xe,{children:"Set a priority level for your outgoing BTC transactions, selecting a percentage off of the fee estimate your wallet uses."}),Object(Me.jsx)(Er,{name:"set-automatic-reset",value:b,options:[{display:"+20%",code:"1.2"},{display:"Default",code:"1"},{display:"-20%",code:"0.8"},{display:"-40%",code:"0.6"},{display:"-60%",code:"0.4"}],onChange:function(e){var t=A.a(["target","value"])(e);f(t)}}),Object(Me.jsx)(Wm.a,{children:Object(Me.jsx)(An,{onClick:function(){return function(e){var t=is(i)(e);return m(!1),M({variables:{config:t}})}({BTC_feeMultiplier:b})},children:"Confirm"})})]})]})},_q=function(){return[{key:"transactions",label:"Transactions",route:"/transactions",allowedRoles:[bv,fv],component:GT},{key:"maintenance",label:"Maintenance",route:"/maintenance",allowedRoles:[bv,fv],get component(){var e=this;return function(){return Object(Me.jsx)(w.b,{to:e.children[0].route})}},children:[{key:"cash_cassettes",label:"Cash Cassettes",route:"/maintenance/cash-cassettes",allowedRoles:[bv,fv],component:SD},{key:"funding",label:"Funding",route:"/maintenance/funding",allowedRoles:[bv,fv],component:lF},{key:"logs",label:"Machine Logs",route:"/maintenance/logs",allowedRoles:[bv,fv],component:XP},{key:"machine-status",label:"Machine Status",route:"/maintenance/machine-status",allowedRoles:[bv,fv],component:tR},{key:"server-logs",label:"Server",route:"/maintenance/server-logs",allowedRoles:[bv,fv],component:mT}]},{key:"analytics",label:"Analytics",route:"/analytics",allowedRoles:[bv,fv],component:uy},{key:"settings",label:"Settings",route:"/settings",allowedRoles:[bv,fv],get component(){var e=this;return function(){return Object(Me.jsx)(w.b,{to:e.children[0].route})}},children:[{key:Kc,label:"Commissions",route:"/settings/commissions",allowedRoles:[bv,fv],component:kw},{key:Zc,label:"Locales",route:"/settings/locale",allowedRoles:[bv,fv],component:vL},{key:Uc,label:"Cash-out",route:"/settings/cash-out",allowedRoles:[bv,fv],component:Hy},{key:_c,label:"Notifications",route:"/settings/notifications",allowedRoles:[bv,fv],component:TR},{key:"services",label:"3rd party services",route:"/settings/3rd-party-services",allowedRoles:[bv,fv],component:yT},{key:Gc,label:"Wallet",route:"/settings/wallet-settings",allowedRoles:[bv,fv],component:Xq},{key:Xc,label:"Operator Info",route:"/settings/operator-info",title:"Operator Information",allowedRoles:[bv,fv],get component(){var e=this;return function(){var t;return Object(Me.jsx)(w.b,{to:{pathname:e.children[0].route,state:{prev:null===(t=e.state)||void 0===t?void 0:t.prev}}})}},children:[{key:"contact-info",label:"Contact information",route:"/settings/operator-info/contact-info",allowedRoles:[bv,fv],component:FB},{key:"receipt-printing",label:"Receipt",route:"/settings/operator-info/receipt-printing",allowedRoles:[bv,fv],component:GB},{key:"custom-sms",label:"Custom SMS",route:"/settings/operator-info/custom-sms",allowedRoles:[bv,fv],component:$B},{key:"coin-atm-radar",label:"Coin ATM Radar",route:"/settings/operator-info/coin-atm-radar",allowedRoles:[bv,fv],component:wB},{key:"terms-conditions",label:"Terms & Conditions",route:"/settings/operator-info/terms-conditions",allowedRoles:[bv,fv],component:YB}]}]},{key:"compliance",label:"Compliance",route:"/compliance",allowedRoles:[bv,fv],get component(){var e=this;return function(){return Object(Me.jsx)(w.b,{to:e.children[0].route})}},children:[{key:"triggers",label:"Triggers",route:"/compliance/triggers",allowedRoles:[bv,fv],component:rq},{key:"customers",label:"Customers",route:"/compliance/customers",allowedRoles:[bv,fv],component:UI},{key:"blacklist",label:"Blacklist",route:"/compliance/blacklist",allowedRoles:[bv,fv],component:Sy},{key:"loyalty",label:"Loyalty",route:"/compliance/loyalty",title:"Loyalty Panel",allowedRoles:[bv,fv],get component(){var e=this;return function(){var t;return Object(Me.jsx)(w.b,{to:{pathname:e.children[0].route,state:{prev:null===(t=e.state)||void 0===t?void 0:t.prev}}})}},children:[{key:"individual-discounts",label:"Individual Discounts",route:"/compliance/loyalty/individual-discounts",allowedRoles:[bv,fv],component:DL},{key:"promo-codes",label:"Promo Codes",route:"/compliance/loyalty/codes",allowedRoles:[bv,fv],component:VL}]},{key:"customer",route:"/compliance/customer/:id",allowedRoles:[bv,fv],component:uI}]},{key:"system",label:"System",route:"/system",allowedRoles:[fv],get component(){var e=this;return function(){return Object(Me.jsx)(w.b,{to:e.children[0].route})}},children:[{key:"user-management",label:"User Management",route:"/system/user-management",allowedRoles:[fv],component:Mq},{key:"session-management",label:"Session Management",route:"/system/session-management",allowedRoles:[fv],component:ST}]}]},Zq=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}}},Kq=(Object(f.a)(Zq),x()(qW||(qW=Object(c.a)(["\n query operatorByUsername($username: String) {\n operatorByUsername(username: $username) {\n id\n entityId\n name\n fiatBalances\n cryptoBalances\n machines\n joined\n assetValue\n preferredFiatCurrency\n contactInfo {\n name\n email\n }\n fundings {\n id\n origin\n destination\n fiatAmount\n fiatBalanceAfter\n fiatCurrency\n created\n status\n description\n }\n }\n }\n"]))),function(){return{totalAssetWrapper:{display:"flex",flexDirection:"row"},totalAssetFieldWrapper:{display:"flex",flexDirection:"column"},fieldHeader:{color:se,marginBottom:5},fieldValue:{fontSize:36},fieldCurrency:{fontSize:20,alignSelf:"flex-end",margin:[[0,0,5,5]]},separator:{fontSize:32,alignSelf:"center",margin:[[25,20,0,20]]},tableTitle:{marginTop:35},operation:{display:"flex",flexDirection:"row",alignItems:"center"}}}),Qq=(Object(f.a)(Kq),x()($W||($W=Object(c.a)(["\n query operatorByUsername($username: String) {\n operatorByUsername(username: $username) {\n id\n entityId\n name\n fiatBalances\n cryptoBalances\n machines\n joined\n assetValue\n preferredFiatCurrency\n contactInfo {\n name\n email\n }\n fundings {\n id\n origin\n destination\n fiatAmount\n fiatBalanceAfter\n fiatCurrency\n created\n status\n description\n }\n }\n }\n"]))),x()(HW||(HW=Object(c.a)(["\n query getData {\n config\n }\n"]))),function(){return{card:{wordWrap:"break-word",boxShadow:"0 0 4px 0 rgba(0, 0, 0, 0.08)",borderRadius:12,padding:24,backgroundColor:K},h4:{marginTop:0},label:{margin:0,color:se},asset:{float:"left"},amount:{float:"right"},row:{backgroundColor:ae,borderBottom:"none"},totalRow:{backgroundColor:re,borderBottom:"none"},leftSide:{margin:[[0,10,20,0]]},rightSide:{margin:[[0,0,0,10]]}}}),Yq=(Object(f.a)(Qq),x()(VW||(VW=Object(c.a)(["\n query operatorByUsername($username: String) {\n operatorByUsername(username: $username) {\n id\n entityId\n name\n fiatBalances\n cryptoBalances\n machines\n joined\n assetValue\n preferredFiatCurrency\n contactInfo {\n name\n email\n }\n fundings {\n id\n origin\n destination\n fiatAmount\n fiatBalanceAfter\n fiatCurrency\n created\n status\n description\n }\n }\n }\n"]))),{borderBottom:"4px solid white",padding:0,paddingLeft:20,paddingRight:20}),Jq=(Object(Mr.a)({root:Yq})(hu.a),Object(Mr.a)({root:Object(s.a)(Object(s.a)({},Yq),{},{backgroundColor:"white"})})(hu.a),Object(f.a)({wrapper:{flex:1,display:"flex",flexDirection:"column",height:"100%"}})),e$=_q(),t$=R.a(rl.a(il.a("children"),B.a("children"))),n$=L.a(ol.a,t$)(e$),a$=M.a(il.a("children"))(n$).concat(M.a(il.a("children"))(e$)),r$=L.a(ol.a,t$)(n$),i$=ll.a(r$,a$),o$=function(){var e=Jq(),t=Object(w.h)(),n=Object(w.i)(),r=Object(a.useContext)(k),i=r.wizardTested,o=r.userData;if(!i&&!ul.a(n.pathname)(["/404","/register","/wizard","/login","/register","/resetpassword","/reset2fa"]))return t.push("/wizard"),null;var l=n.state?p.a:al.a,c=l===p.a?{direction:ml.a(W.a("route",n.state.prev))(r$)>ml.a(W.a("route",n.pathname))(r$)?"right":"left"}:{timeout:400};return Object(Me.jsxs)(w.e,{children:[Object(Me.jsx)(jv,{exact:!0,path:"/",children:Object(Me.jsx)(w.b,{to:{pathname:"/dashboard"}})}),Object(Me.jsx)(jv,{path:"/dashboard",children:Object(Me.jsx)(l,Object(s.a)(Object(s.a)({className:e.wrapper},c),{},{in:!0,mountOnEnter:!0,unmountOnExit:!0,children:Object(Me.jsx)("div",{className:e.wrapper,children:Object(Me.jsx)(Zu,{})})}))}),Object(Me.jsx)(jv,{path:"/machines",component:Og}),Object(Me.jsx)(jv,{path:"/wizard",component:hv}),Object(Me.jsx)(gv,{path:"/register",component:sc}),Object(Me.jsx)(gv,{path:"/login",restricted:!0,component:Jl}),Object(Me.jsx)(gv,{path:"/resetpassword",component:yc}),Object(Me.jsx)(gv,{path:"/reset2fa",component:bc}),(o?i$.filter((function(e){var t=e.allowedRoles;return F.a(o.role,t)})):[]).map((function(t){var a=t.route,r=t.component,i=t.key;return Object(Me.jsx)(jv,{path:a,children:Object(Me.jsx)(l,Object(s.a)(Object(s.a)({className:e.wrapper},c),{},{in:!!Object(w.g)(n.pathname,{path:a}),mountOnEnter:!0,unmountOnExit:!0,children:Object(Me.jsx)("div",{className:e.wrapper,children:Object(Me.jsx)(jv,{path:a,children:Object(Me.jsx)(r,{name:i})},i)})}))},i)})),Object(Me.jsx)(gv,{path:"/404"}),Object(Me.jsx)(gv,{path:"*",children:Object(Me.jsx)(w.b,{to:{pathname:"/404"}})})]})},l$="100%",c$={"@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"}]}),{},(UW={"#root":{width:l$,minHeight:l$},".root-notifcenter-open":{overflowY:"auto",position:"absolute",top:0,bottom:0,left:0},".body-notifcenter-open":{overflow:"hidden"},".root-blur":{filter:"blur(1px)",pointerEvents:"none"},html:{height:l$},body:{width:he,display:"flex",minHeight:l$,"@media screen and (min-width: 1200px)":{width:"auto"}}},Object(z.a)(UW,'a::-moz-focus-inner,\n \'input[type="submit"]::-moz-focus-inner,\n input[type="button"]::-moz-focus-inner',{border:0}),Object(z.a)(UW,'a::-moz-focus-inner,\n input[type="submit"]::-moz-focus-inner,\n input[type="button"]::-moz-focus-inner',{border:0}),Object(z.a)(UW,"a,\n a:visited,\n a:focus,\n a:active,\n a:hover",{outline:"0 none"}),Object(z.a)(UW,"button::-moz-focus-inner",{border:0}),Object(z.a)(UW,".ReactVirtualized__Grid__innerScrollContainer",{overflow:"inherit !important"}),UW))},s$=n(176),d$=Be.p,u$=Object(s$.a)({typography:{fontFamily:Ne,body1:Object(s.a)({},d$)},MuiButtonBase:{disableRipple:!0},palette:{primary:{light:ee,dark:ee,main:ee},secondary:{light:ee,dark:ee,main:ee},background:{default:ae}},overrides:{MuiRadio:{colorSecondary:{color:ee}},MuiAutocomplete:{root:{color:ce},noOptions:{padding:[[6,16]]},option:{'&[data-focus="true"]':{backgroundColor:re}},paper:{color:ce,margin:0},listbox:{padding:0},tag:{'&[data-tag-index="0"]':{marginLeft:0},margin:2,backgroundColor:re,borderRadius:4,height:18}},MuiChip:{label:{paddingLeft:4,paddingRight:4,color:ce,fontSize:ve}},MuiInput:{root:{color:ce},underline:{"&:before":{borderBottom:[[2,"solid",ce]]}}},MuiInputLabel:{root:{font:"inherit",fontSize:Oe,color:se},shrink:{color:ce,transform:"translate(0, 1.7px) scale(0.83)"}},MuiFormLabel:{root:{"&$focused":{color:ce}}},MuiListItem:{root:{"&:nth-of-type(odd)":{backgroundColor:ae}}},MuiToggleButton:{root:{"&$selected":{backgroundColor:G,borderColor:J,borderTopColor:[J,"!important"],"&:hover":{backgroundColor:X}},"&:hover":{backgroundColor:X}}},MuiToggleButtonGroup:{groupedVertical:{borderRadius:8,border:"1px solid",borderColor:G,"&:not(:first-child)":{borderTop:"1px solid",borderTopColor:G,borderTopRightRadius:8,borderTopLeftRadius:8,borderBottomRightRadius:8,borderBottomLeftRadius:8},"&:not(:last-child)":{borderTop:"1px solid",borderTopColor:G,borderTopRightRadius:8,borderTopLeftRadius:8,borderBottomRightRadius:8,borderBottomLeftRadius:8}}}}}),m$=Object(v.c)({plugins:[Object(y.a)()].concat(Object(d.a)(Object(b.a)().plugins))}),h$="100%",p$="column",b$=Object(f.a)(Object(s.a)(Object(s.a)({},c$),{},{root:{backgroundColor:ae,width:h$,minHeight:h$,display:"flex",flexDirection:p$},wrapper:{width:he,height:h$,margin:"0 auto",flex:1,display:"flex",flexDirection:p$},grid:{flex:1,height:"100%"},contentWithSidebar:{flex:1,marginLeft:48,paddingTop:15},contentWithoutSidebar:{width:he}})),f$=x()(GW||(GW=Object(c.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"]))),j$=function(){var e=b$(),t=Object(w.i)(),n=Object(w.h)(),r=Object(a.useContext)(k),i=r.wizardTested,o=r.userData,l=r.setUserData,c=Object(u.c)(f$,{onCompleted:function(e){!o&&(null===e||void 0===e?void 0:e.userData)&&l(e.userData)}}).loading,s=t.pathname,d=function(e){return cl.a((function(t){return t.route===e}))(L.a(ol.a,R.a(B.a("children")),M.a(il.a("children")))(n$))}(s),m=d?function(e){return Aa.a(W.a("route",sl.a(1,dl.a((function(e){return"/"!==e}),e))))(i$)}(s):{},b="/404"===t.pathname,f=d?e.contentWithSidebar:e.contentWithoutSidebar;return Object(Me.jsxs)("div",{className:e.root,children:[!b&&i&&o&&Object(Me.jsx)(Zo,{tree:e$,user:o}),Object(Me.jsxs)("main",{className:e.wrapper,children:[d&&!b&&i&&Object(Me.jsx)(p.a,{direction:"left",in:!0,mountOnEnter:!0,unmountOnExit:!0,children:Object(Me.jsx)("div",{children:Object(Me.jsx)(nl,{title:m.title})})}),Object(Me.jsxs)(h.a,{container:!0,className:e.grid,children:[d&&!b&&i&&Object(Me.jsx)(yi,{data:m.children,isSelected:function(e){return t.pathname===e.route},displayName:function(e){return e.label},onClick:function(e){return n.push(e.route)}}),Object(Me.jsx)("div",{className:f,children:!c&&Object(Me.jsx)(o$,{})})]})]})]})},g$=function(){var e=Object(a.useState)(!1),t=Object(l.a)(e,2),n=t[0],r=t[1],i=Object(a.useState)(null),o=Object(l.a)(i,2),c=o[0],d=o[1];return Object(Me.jsx)(k.Provider,{value:{wizardTested:n,setWizardTested:r,userData:c,setUserData:d,setRole:function(e){c&&e&&c.role!==e&&d(Object(s.a)(Object(s.a)({},c),{},{role:e}))}},children:Object(Me.jsx)(C.a,{children:Object(Me.jsx)(Pj,{children:Object(Me.jsx)(j.b,{jss:m$,children:Object(Me.jsxs)(g.a,{theme:u$,children:[Object(Me.jsx)(m.a,{}),Object(Me.jsx)(j$,{})]})})})})})};Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));Promise.resolve().then((function(){return o.a.render(Object(Me.jsx)(r.a.StrictMode,{children:Object(Me.jsx)(g$,{})}),document.getElementById("root"))})),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then((function(e){e.unregister()}))}},[[783,1,2]]]);
|
|
//# sourceMappingURL=main.af6b9292.chunk.js.map
|