1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},i=(new e.Error).stack;i&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[i]="496a2806-ad8e-4df2-be2a-bed85c9eae6c",e._sentryDebugIdIdentifier="sentry-dbid-496a2806-ad8e-4df2-be2a-bed85c9eae6c")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3804],{5523:(e,i,t)=>{t.d(i,{R:()=>o,X:()=>l.X});var n=t(59643),l=t(31722);let o=(0,n.A)(e=>({label:{margin:"9px 0",fontSize:"14px",lineHeight:"17px"},textareaField:{width:"100%",minHeight:"173px",resize:"none",borderRadius:"5px",boxSizing:"border-box",border:"1px solid #C6C6C6"},enterCard:{color:"#4C7CFE",textDecoration:"underline",cursor:"pointer"},paddingTextField:{border:"1px solid #C6C6C6"},dialogHeader:{padding:"18px 20px 14px",display:"flex",justifyContent:"space-between"},dialogTitle:{fontSize:20,fontWeight:500},warningTitle:{backgroundColor:"#F8DAD7",border:"1px solid #EFC7C3",borderRadius:"5px",boxSizing:"border-box",padding:"10px 14px"},additionalSeats:{color:"#2A3037",fontSize:"20px",fontWeight:500,marginBottom:17},additionalSeatsContent:{fontSize:14,color:"#2A3037"},totalPayment:{fontSize:"16px",color:"#2A3037",fontWeight:500},proratedChargeContent:{fontSize:16,color:"#2A3037"},setWidth40:{maxWidth:"50%"},removeLabel:{"& .MuiInputBase-root":{borderRadius:4,"& fieldset":{top:"0 !important","& legend":{display:"none"}}}},gridTotal:{justifyContent:"space-between",display:"flex",marginBottom:10},content:{fontSize:"16px",color:"#3E4B5B"},cardPaymentToggleOption:{width:"50%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer",border:"2px solid white",transition:"all 0.3s",font:"inherit",fontSize:16,fontWeight:700,padding:0,margin:0,backgroundColor:"transparent",borderRadius:4,boxSizing:"border-box"}}))},7454:(e,i,t)=>{t.d(i,{u:()=>l});var n=t(85302);let l=e=>{let i=null==e?void 0:e.webapp;switch(null==i?void 0:i.status){case"active":return n.SUBSCRIPTION_STATUS.ACTIVE;case"cancelled":return n.SUBSCRIPTION_STATUS.CANCELLED;default:return n.SUBSCRIPTION_STATUS.INACTIVE}}},33804:(e,i,t)=>{t.r(i),t.d(i,{default:()=>T});var n=t(54568),l=t(7620),o=t(63358),a=t(55953),s=t(37187),r=t(70219),c=t(74665),d=t(40204),p=t(47394),h=t(2614),u=t(7454),g=t(35077),x=t(85302),A=t(99404),b=t(49157),S=t(6369),m=t(44939),C=t(87269),f=t(5523);let j=e=>{let{open:i,handleClose:t,isUnderAgentSubscription:l,type:o,onUpdate:a,isLoading:s}=e,r=(0,f.R)();return(0,n.jsxs)(A.A,{open:i,onClose:s?void 0:t,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[(0,n.jsx)(b.A,{dividers:!0,children:(0,n.jsx)(S.A,{id:"alert-dialog-description",className:r.content,children:l?"Are you sure you want to remove this client from your agent subscription?":o!==x.SUBSCRIPTION_STATUS.ACTIVE?"Are you sure you want to include this client to your agent subscription?":"Would you like to cancel the current subscription at the end of the billing period and include this client in your agent subscription from the next billing cycle?"})}),(0,n.jsxs)(m.A,{children:[(0,n.jsx)("span",{children:(0,n.jsx)(C.b5,{onClick:t,children:"Close"})}),(0,n.jsx)(C.qP,{width:90,onClick:a,isLoading:s,disabled:s,children:"Proceed"})]})]})};var v=t(22006),y=t(13866);let I=l.lazy(()=>Promise.all([t.e(4129),t.e(4269),t.e(1441),t.e(7585),t.e(139),t.e(575),t.e(7382),t.e(5541),t.e(8476),t.e(7362),t.e(7167),t.e(2747)]).then(t.bind(t,80427))),T=e=>{var i,t;let{state:A}=e,{reactState:b,client:S,removeClient:m,setAgentData:C,changeClientEmail:f,excludeClientToBill:T,addClientToBill:N,isAgentSubscription:_,confirmPopup:w,payrollerToken:P,onReloadClients:k,onCopyId:U,hideBillingAndInvite:E,gaIds:z}=A,B=(0,h.I)(),R=(0,y.d4)(v.Uq).listAgentClient,[D,L]=(0,l.useState)(null),[O,H]=(0,l.useState)(!1),[W,F]=(0,l.useState)(!1),[V,q]=(0,l.useState)(!1),[M,X]=(0,l.useState)(!1),Z="v2"===A.projectVersion;(0,l.useEffect)(()=>{Z&&P&&(localStorage.pr_token=P)},[Z,P]);let G=()=>{L(null)},J=()=>{Z?S.isUnderAgentSubscription?T():N():q(!0),G()},K=(0,u.u)(null==S?void 0:S.subscriptionStatus),Q=!E&&!S.isUnderAgentSubscription,Y=()=>{};
1return(0,n.jsxs)(s.A,{width:"100%",bgcolor:"Background",children:[(0,n.jsx)(r.A,{"aria-label":"more","aria-controls":"menu","aria-haspopup":"true",onClick:e=>{e.stopPropagation(),L(e.currentTarget)},children:Z?(0,n.jsx)(a.A,{}):(0,n.jsx)(o.A,{})}),!!D&&(0,n.jsxs)(c.A,{id:"menu",anchorEl:D,keepMounted:!0,open:!!D,onClose:e=>{e.stopPropagation(),G()},children:[Q&&(K===x.SUBSCRIPTION_STATUS.CANCELLED||K===x.SUBSCRIPTION_STATUS.INACTIVE)&&(0,n.jsx)(d.A,{className:Z?B.v2ActionPopover:B.actionPopover,onClick:e=>{e.stopPropagation(),H(!0),G()},children:(0,n.jsx)(s.A,{fontSize:16,children:"Invite client to pay for subscription"})}),Q&&(K===x.SUBSCRIPTION_STATUS.ACTIVE||K===x.SUBSCRIPTION_STATUS.INACTIVE||K===x.SUBSCRIPTION_STATUS.CANCELLED)&&(null==S||null==(t=S.subscriptionStatus)||null==(i=t.webapp)?void 0:i.end)!=="2050-01-01T00:00:00.000Z"&&(0,n.jsx)(d.A,{className:Z?B.v2ActionPopover:B.actionPopover,onClick:e=>{e.stopPropagation(),G(),window.localStorage.pr_client_id=A.client._id,F(!0)},children:(0,n.jsx)(s.A,{fontSize:16,children:"Billing"})}),_&&!S.isUnderAgentSubscription&&(0,n.jsx)(d.A,{className:Z?B.v2ActionPopover:B.actionPopover,onClick:()=>J(),children:(0,n.jsx)(s.A,{fontSize:16,children:Z?"Include this client in my Central Agent Subscription":"Include this client in my bill"})}),_&&S.isUnderAgentSubscription&&S.ai!==S._id&&(0,n.jsx)(d.A,{className:Z?B.v2ActionPopover:B.actionPopover,onClick:()=>J(),children:(0,n.jsx)(s.A,{fontSize:16,children:Z?"Exclude this client from my Central Agent Subscription":"Exclude this client in my bill"})}),(0,n.jsx)(d.A,{className:Z?B.v2ActionPopover:B.actionPopover,onClick:()=>void(G(),f(S)),children:(0,n.jsx)(s.A,{fontSize:16,children:"Change email"})}),Z&&(0,n.jsx)(d.A,{className:Z?B.v2ActionPopover:B.actionPopover,onClick:e=>{navigator.clipboard.writeText(S._id),G(),U()},children:(0,n.jsx)(s.A,{fontSize:16,children:"Copy ID"})}),Z&&(0,n.jsx)(p.A,{}),(0,n.jsx)(d.A,{className:Z?B.v2ActionPopover:B.actionPopover,onClick:e=>Z?void(m(),G()):m(S),children:(0,n.jsx)(s.A,{fontSize:16,color:"error.main",children:"Delete"})})]}),W&&(0,n.jsx)(I,{onReloadClients:()=>{null==k||k(),F(!1)},handleOpen:W,close:()=>F(!1),state:b,setAgentData:C,billingAgent:!0,client:S,isV2:Z,gaIds:z}),O&&(0,n.jsx)(g.A,{open:O,state:b,handleClose:()=>H(!1)}),V&&(0,n.jsx)(j,{isLoading:M,isUnderAgentSubscription:S.isUnderAgentSubscription,type:K,open:V,handleClose:()=>q(!1),onUpdate:()=>{let e=(()=>{let e=[];return R.map(i=>{i.isUnderAgentSubscription&&e.push({clientId:i._id,cap:0})}),e})();w(S.isUnderAgentSubscription?e.filter(e=>e.clientId!==S._id):[...e,{clientId:S._id,cap:0}],()=>{q(!1),X(!1),k?k():Y(),localStorage.setItem("firstTimeMissingSeats",!0)},()=>{X(!1),k?k():Y()})}})]})}},35077:(e,i,t)=>{t.d(i,{A:()=>N});var n=t(54568),l=t(7620),o=t(13866),a=t(99404),s=t(24090),r=t(49157),c=t(37187),d=t(44193),p=t(25663),h=t(8202),u=t(4773),g=t(39106),x=t(30558),A=t(64889),b=t(5611),S=t(53041),m=t(63323),C=t(96964),f=t(44939),j=t(22006),v=t(57469),y=t(87269),I=t(2614),T=t(54426);let N=e=>{let{state:i,...t}=e,{open:N,handleClose:_}=t,w=(0,I.I)(),P=(0,o.wA)(),k=(0,o.d4)(j.Uq).isInviteClientPopup,U=(0,o.d4)(j.Uq).disabled,[E,z]=(0,l.useState)(!1),[B,R]=l.useState([]),[D,L]=(0,l.useState)(),[O,H]=(0,l.useState)([]),W=()=>{P((0,j.Fm)(!1))};return(0,l.useEffect)(()=>{(k||N)&&((()=>{let e=window.localStorage.pr_client_id,t=window.localStorage.pr_agent_id;delete window.localStorage.pr_client_id,delete window.localStorage.pr_agent_id,z(!0),i.HttpPromise({method:"get",api:"/v1/agent/get"}).then(n=>{n&&n.clients&&(P((0,j.xN)(n.clients)),(e=>{let t=((null==i?void 0:i.clientNoSubscription)||e||[]).filter(e=>"active"!==e.subscriptionStatus.webapp.status&&!e.isUnderAgentSubscription);H(t),R(t.map(e=>e._id))})(n.clients),window.localStorage.pr_client_id=e,window.localStorage.pr_agent_id=t)}).catch(()=>z(!1)).finally(()=>{z(!1)})})(),R([]))},[k,N]),(0,l.useEffect)(()=>{P((0,j.NB)(E))},[E]),(0,n.jsxs)(a.A,{maxWidth:"md",open:N||k,onClose:U?null:()=>_||W,"aria-labelledby":"form-dialog-title",children:[(0,n.jsx)(s.A,{className:w.dialogTitle,id:"form-dialog-title",children:"Invite client to pay for subscription"}),(0,n.jsxs)(r.A,{children:[(0,n.jsx)(c.A,{className:w.header,children:(0,n.jsxs)(c.A,{padding:"12px 16px",children:[(0,n.jsx)(d.A,{className:w.titleHeader,children:"Select the clients that need to set up their payment details for their Payroller subscription."}),(0,n.jsx)(d.A,{className:w.titleHeader,children:"These clients will be sent an email inviting them to enter the
1ir payment information."})]})}),E?(0,n.jsx)(c.A,{height:"100px",className:(0,T.A)({[w.iconLoading]:E}),children:(0,n.jsx)(p.A,{className:w.iconLoading})}):(0,n.jsx)(h.A,{style:{height:"275px",marginTop:19},children:(0,n.jsxs)(u.A,{stickyHeader:!0,size:"small",children:[(0,n.jsx)(g.A,{children:(0,n.jsxs)(x.A,{children:[(0,n.jsx)(A.A,{className:w.tableCellCheckBox,children:(0,n.jsx)(b.A,{className:w.checkBox,indeterminate:B.length>0&&B.length<O.length,checked:O.length>0&&B.length===O.length,onChange:e=>{if(e.target.checked)return void R(O.map(e=>e._id));R([])}})}),(0,n.jsx)(A.A,{className:w.tableCellClient,children:"Client"}),(0,n.jsx)(A.A,{className:w.tableCellEmail,children:"Email address"})]})}),(0,n.jsx)(S.A,{children:(null==O?void 0:O.length)>0?null==O?void 0:O.map((e,i)=>{let t,l=(t=e._id,-1!==B.indexOf(t)),o="enhanced-table-checkbox-".concat(i);return(0,n.jsxs)(x.A,{hover:!0,className:w.rowBody,role:"checkbox","aria-checked":l,tabIndex:-1,selected:l,children:[(0,n.jsx)(A.A,{children:(0,n.jsx)(b.A,{className:w.checkBox,checked:l,inputProps:{"aria-labelledby":o},onClick:i=>((e,i)=>{let t=B.indexOf(i),n=[];-1===t?n=n.concat(B,i):0===t?n=n.concat(B.slice(1)):t===B.length-1?n=n.concat(B.slice(0,-1)):t>0&&(n=n.concat(B.slice(0,t),B.slice(t+1))),R(n)})(0,e._id)})}),(0,n.jsx)(A.A,{children:(0,n.jsx)(c.A,{dangerouslySetInnerHTML:{__html:(null==e?void 0:e.c)||(null==e?void 0:e.e)||""}})}),(0,n.jsx)(A.A,{children:(0,n.jsx)(c.A,{className:w.contentEmail,children:(0,n.jsx)(m.A,{className:w.emailTextField,fullWidth:!0,value:(null==e?void 0:e.e)||"",onChange:e=>{var t;return t=e.target.value,void H(O.map((e,n)=>n===i?{...e,e:t}:e))}})})})]},i)}):(0,n.jsx)(A.A,{align:"center",children:"No data yet"})})]})}),(0,n.jsx)(c.A,{className:w.messageClient,children:"Message to your clients"}),(0,n.jsx)(C.A,{onChange:e=>{L(e.target.value)},className:w.textareaField})]}),(0,n.jsxs)(f.A,{className:w.dialogAction,children:[(0,n.jsx)("span",{children:(0,n.jsx)(y.b5,{disabled:U,onClick:_||W,children:"Close"})}),(0,n.jsx)(y.qP,{isLoading:E,disabled:U||0===B.length,onClick:()=>{let e={clients:B.map(e=>{let i=O.find(i=>i._id===e);return{_id:i._id,email:i.e}}),message:D};return z(!0),i.HttpPromise((0,v.N)(e)).then(e=>{i.helpers.alert("Success!","Invite client successfully!","success"),W(),i.cancel&&i.cancel()}).catch(()=>i.helpers.alert("Error!","Invite client wrong!","error")).finally(()=>z(!1))},children:"Send"})]})]})}}}]);
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.