1(()=>{(function(){try{var x=typeof window!="undefined"?window:typeof global!="undefined"?global:typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:{};x.SENTRY_RELEASE={id:"fe31f7b2c47495f5f9d2fb4ccb4264eb43d2388a"};var F=new x.Error().stack;F&&(x._sentryDebugIds=x._sentryDebugIds||{},x._sentryDebugIds[F]="87e500cb-62b0-43a4-8d08-e6e2b33f87ac",x._sentryDebugIdIdentifier="sentry-dbid-87e500cb-62b0-43a4-8d08-e6e2b33f87ac")}catch(e){}})();(self.webpackChunk=self.webpackChunk||[]).push([[946],{937:(x,F,e)=>{e.r(F),e.d(F,{default:()=>je});var z=e(85016),V=e.n(z),b=e(4520),w=e.n(b),ne=e(58566),X=e.n(ne),re=e(80919),ae=e.n(re),oe=e(76875),le=e.n(oe),ie=e(72747),k=e.n(ie),se=e(74857),ce=e(69970),H=e(67460),ue=e(93120),fe=e.n(ue),de=e(76900),ve=e.n(de),me=e(9010),he=e.n(me),ge=e(58293),Ee=e.n(ge),ye=e(92714),Ce=e.n(ye),pe=e(40698),Se=e.n(pe),t=e(32735),Ne=e(4943),j=e(73448),q=e(97614),Y=e(54287),_=e(93623),K=e(60517),Te=e(4935),Ie=e(6472),Ae=e(63457),Le=e(33434),ee=e(67695),Re=e(62894),Ze=e(76287),xe=e(84500),De=e(38437),Fe=e(28397),Oe=e(20991),te=e(19551),Me=e(15089),Ge=(0,q.ZL)()(function(o){return{root:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:24,position:"relative"},text:{fontSize:16,color:o.palette.text.primary},name:{fontWeight:"bold"},actions:{zIndex:1},icon:{color:o.palette.text.primary,height:30,width:30},button:{padding:0,height:30,width:30}}});function Pe(o){var n=o.name,L=o.email,g=o.onClick,E=o.onRemove,D=Ge(),c=D.classes,d=D.cx,T=(0,t.useState)(!1),l=(0,H.Z)(T,2),S=l[0],f=l[1],R=(0,t.useState)(null),v=(0,H.Z)(R,2),N=v[0],G=v[1],P=function(){f(function(Z){return!Z})},O=function(Z){N.contains(Z.target)||f(!1)};return t.createElement("div",{className:c.root},t.createElement("div",{className:c.content},t.createElement("div",{className:d(c.text,c.name)},n),t.createElement("div",{className:d(c.text,c.email)},L)),t.createElement("div",{className:c.actions},t.createElement(Re.Z,{ref:function(Z){G(Z)},"aria-owns":S?"menu-list-grow":null,"aria-haspopup":"true",onClick:P,className:c.button,color:"inherit"},t.createElement(Me.Z,null))),t.createElement(Ze.Z,{open:S,anchorEl:N,disablePortal:!0,slots:{transition:xe.Z},slotProps:{transition:{id:"menu-list-grow",style:{transformOrigin:"center bottom"}}}},t.createElement(De.Z,null,t.createElement(Fe.d,{onClickAway:O},t.createElement(Oe.Z,null,t.createElement(te.Z,{onClick:g},"Edit Client"),t.createElement(te.Z,{onClick:E},"Remove Client"))))))}const Be=Pe;function W(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var o,n,L=typeof w()=="function"?w():{},g=L.iterator||"@@iterator",E=L.toStringTag||"@@toStringTag";function D(v,N,G,P){var O=N&&N.prototype instanceof d?N:d,M=X()(O.prototype);return h(M,"_invoke",function(Z,J,Q){var I,i,m,B=0,r=Q||[],a=!1,u={p:0,n:0,v:o,a:y,f:ae()(y).call(y,o,4),d:function(C,A){return I=C,i=0,m=o,u.n=A,c}};function y(s,C){for(i=s,m=C,n=0;!a&&B&&!A&&n<r.length;n++){var A,p=r[n],$=u.p,U=p[2];s>3?(A=U===C)&&(m=p[(i=p[4])?5:(i=3,3)],p[4]=p[5]=o):p[0]<=$&&((A=s<2&&$<p[1])?(i=0,u.v=C,u.n=p[1]):$<U&&(A=s<3||p[0]>C||C>U)&&(p[4]=s,p[5]=C,u.n=U,i=0))}if(A||s>1)return c;throw a=!0,C}return function(s,C,A){if(B>1)throw TypeError("Generator is already running");for(a&&C===1&&y(C,A),i=C,m=A;(n=i<2?o:m)||!a;){I||(i?i<3?(i>1&&(u.n=-1),y(i,m)):u.n=m:u.v=m);try{if(B=2,I){if(i||(s="next"),n=I[s]){if(!(n=n.call(I,m)))throw TypeError("iterator result is not an object");if(!n.done)return n;m=n.value,i<2&&(i=0)}else i===1&&(n=I.return)&&n.call(I),i<2&&(m=TypeError("The iterator does not provide a '"+s+"' method"),i=1);I=o}else if((n=(a=u.n<0)?m:Z.call(J,u))!==c)break}catch(p){I=o,i=1,m=p}finally{B=1}}return{value:n,done:a}}}(v,G,P),!0),M}var c={};function d(){}function T(){}function l(){}n=le();var S=[][g]?n(n([][g]())):(h(n={},g,function(){return this}),n),f=l.prototype=d.prototype=X()(S);function R(v){return k()?k()(v,l):(v.__proto__=l,h(v,E,"GeneratorFunction")),v.prototype=X()(f),v}return T.prototype=l,h(f,"constructor",l),h(l,"constructor",T),T.displayName="GeneratorFunction",h(l,E,"GeneratorFunction"),h(f),h(f,E,"Generator"),h(f,g,function(){return this}),h(f,"toString",function(){return"[object Generator]"}),(W=function(){return{w:D,m:R}})()}function h(o,n,L,g){var E=V();try{E({},"",{})}catch(D){E=0}h=function(c,d,T,l){function S(f,R){h(c,f,function(v){return this._invoke(f,R,v)})}d?E?E(c,d,{value:T,enumerable:!l,configurable:!l,writable:!l}):c[d]=T:(S("next",0),S("throw",1),S("return",2))},h(o,n,L,g)}var He=1e3,Ye="NAME_ASC",Ue=function(){return t.createElement(K.Z,{type:"search",title:"No clients match that search."})},ze=function(){return t.createElement(K.Z,{type:"clients",title:"You haven\u2019t created any clients yet, but when you do they\u2019ll show up here.",description:"Select the + in the top right to get started."})},Ve=(0,q.ZL)()(function(){return{page:{display:"flex",flexDirection:"column",height:"100%",minHeight:0,overflow:"hidden"},header:{flexShrink:0,width:"100%"},section:{display:"flex",flexDirection:"column",flex:1,minHeight:0},search:{flexShrink:0,marginBottom:20,"@media (max-width: 1023px)":{marginBottom:16}},list:{flex:1,minHeight:0,overflowY:"auto",overscrollBehavior:"contain"}}});function Xe(){var o=(0,Ne.s0)(),n=(0,t.useState)(""),L=(0,H.Z)(n,2),g=L[0],E=L[1],D=(0,t.useState)({}),c=(0,H.Z)(D,2),d=c[0],T=c[1],l=(0,Y.v)(function(r){return r.clients.clients}),S=(0,Y.v)(function(r){return r.clients.count}),f=(0,Y.v)(function(r){return r.clients.loading}),R=(0,Y.I)(),v=Ve(),N=v.classes,G=fe()(g).call(g).toLowerCase(),P=G.length>0,O=P?ve()(l).call(l,function(r){var a;return he()(a=[r.name,r.email]).call(a,function(u){var y;return u==null?void 0:Ee()(y=u.toLowerCase()).call(y,G)})}):l;
1(0,t.useEffect)(function(){R(ee.Nw.loadClients({pagination:{skip:0,limit:He},sortBy:Ye})).catch(function(r){(0,j.Tb)(r),T({message:"Could not load clients. Please try again later or contact support."})})},[R]),(0,t.useEffect)(function(){if(!f&&S>l.length){var r;(0,j.Tb)(new Error(Ce()(r="Clients list truncated: fetched ".concat(l.length," of ")).call(r,S," clients")))}},[f,S,l.length]);var M=function(a){E(a.target.value)},Z=function(a){o("/clients/".concat(a))},J=function(){var r=(0,ce.Z)(W().m(function a(u){var y;return W().w(function(s){for(;;)switch(s.p=s.n){case 0:return s.p=0,s.n=1,R(ee.Nw.removeClient(u));case 1:s.n=3;break;case 2:s.p=2,y=s.v,(0,j.Tb)(y),y.message&&y.message===Le.cG.CLIENT_NOT_FOUND&&T({message:"The client does not exist in our records. If this was a mistake, please contact support."});case 3:return s.a(2)}},a,null,[[0,2]])}));return function(u){return r.apply(this,arguments)}}(),Q=function(){E("")},I=function(){return d!=null&&d.message?i():f?null:O.length?m():P?Ue():ze()},i=function(){var a="Internal Server Error. Please reload the page or contact support.";return t.createElement(K.Z,{type:"error",description:d.message||a,title:"Looks like something went wrong!"})},m=function(){return Se()(O).call(O,function(a){return t.createElement(Be,(0,se.Z)({key:a.id},a,{onClick:function(){return Z(a.id)},onRemove:function(){return J(a.id)}}))})},B=l.length||g;return t.createElement("div",{className:N.page},t.createElement("div",{className:N.header},t.createElement(Te.Z,{title:"Clients",actionText:"New Client",onCreate:function(){return o("/clients/create")}})),t.createElement(Ie.Z,{className:N.section},B&&t.createElement(Ae.Z,{name:"filter",type:"text",value:g,placeholder:"Search client by name or email",onChange:M,onClear:Q,className:N.search}),t.createElement(_.h8,{step:_.pK.clients},t.createElement("div",{className:N.list,"aria-label":"Clients list"},I()))))}const je=Xe},33434:(x,F,e)=>{e.d(F,{cG:()=>z,z4:()=>V});var z={INVALID_PHONE_FORMAT:"INVALID_PHONE_FORMAT",CLIENT_ALREADY_EXISTS:"CLIENT_ALREADY_EXISTS",CLIENT_NOT_FOUND:"CLIENT_NOT_FOUND"},V={INVALID_EMAIL_FORMAT:"Invalid email format",CLIENT_NOT_FOUND:"Client not found",CLIENT_ALREADY_EXISTS:"Client already exists"},b={}}}]);})(); 2 3//# sourceMappingURL=ClientsBase.9dfc048c5f34cc5f938b.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.