@zeniai/web-app-ui 5.2.1-qa → 5.2.2-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/AddressRoutes-BpuOCrFB.js +1 -0
- package/dist/assets/{AddressScreen-nKSLWJuc.js → AddressScreen-CUr-HVcT.js} +2 -2
- package/dist/assets/{AiCfoScreen-YMI_Ue0S.js → AiCfoScreen-CQ5-XgG8.js} +1 -1
- package/dist/assets/{BillPayApprovalRoutes-CsFX5rjw.js → BillPayApprovalRoutes-D2_kNfaY.js} +1 -1
- package/dist/assets/{BillPayRoutes-BHa9CFLd.js → BillPayRoutes-COEOJVsM.js} +17 -17
- package/dist/assets/{BusinessVerificationPageScreen-DPcnOTgE.js → BusinessVerificationPageScreen-BwKYUVXz.js} +2 -2
- package/dist/assets/{CardsAiCfoScreen-Byi_dC9M.js → CardsAiCfoScreen-HxTonb4Z.js} +1 -1
- package/dist/assets/{ChargeCardRoutes-Bt1hyW6W.js → ChargeCardRoutes-Br_JifOo.js} +10 -10
- package/dist/assets/CompanyPassportScreen-D5p8YGqx.js +1 -0
- package/dist/assets/ConnectionAuthScreen-C7C9oP-O.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-DHYr81WM.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-DG97SmPk.js → CustomerOnboardingRoutes-D7xgi9kE.js} +8 -8
- package/dist/assets/{DashboardRoutes-A-E1fxlU.js → DashboardRoutes-CrUjulzU.js} +4 -4
- package/dist/assets/{DefaultTenantHome-40mCVCF-.js → DefaultTenantHome-CQVq15dz.js} +1 -1
- package/dist/assets/DomesticWireDetailScreen-mk_MQEQb.js +18 -0
- package/dist/assets/{DrawerScreen-OM7n56Dx.js → DrawerScreen-BWm1l0_Z.js} +1 -1
- package/dist/assets/EntityDetailRoutes-B8mgxcsD.js +1 -0
- package/dist/assets/{ExpenseAutomationRoutes-BmkWbc12.js → ExpenseAutomationRoutes-CY3gwyyO.js} +3 -3
- package/dist/assets/{FeaturePreviewScreen-CzJwTXfy.js → FeaturePreviewScreen-C0EZ8JBW.js} +1 -1
- package/dist/assets/HubSpotOAuthCallbackScreen-BwGxeepQ.js +1 -0
- package/dist/assets/{MagicLinkRoutes-C13fH60b.js → MagicLinkRoutes-DQ1ug8CF.js} +2 -2
- package/dist/assets/MagicLinkSignInScreen-tDhHVTnP.js +12 -0
- package/dist/assets/{MobileAppDrawer-DdLzgZKv.js → MobileAppDrawer-DJ3VpNqR.js} +1 -1
- package/dist/assets/NotFoundScreen-CamJ30ZO.js +1 -0
- package/dist/assets/{NotificationRoutes-DbrdVTft.js → NotificationRoutes-DK8GwbT3.js} +1 -1
- package/dist/assets/{OAuthConsentScreen-HS2eshhY.js → OAuthConsentScreen-Bk2mnH8v.js} +1 -1
- package/dist/assets/PandLWithForecastRoutes-BTkp9Nfx.js +1 -0
- package/dist/assets/PeopleRoutes-BqJR3HeE.js +22 -0
- package/dist/assets/PerformanceRoutes-y59oCr7_.js +1 -0
- package/dist/assets/{Preview-R-H_SCJF.js → Preview-ChMTg4zf.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-BgrYxdBK.js → QBOConnectionScreen-CmRiNFSq.js} +1 -1
- package/dist/assets/ReferralListScreen-joOUNqNx.js +5 -0
- package/dist/assets/ReimbursementApprovalRoutes-CFENXyD5.js +1 -0
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-Cx0XJ_uS.js → ReimbursementApprovalRuleDetailScreen-Be3YasZE.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-Dkp04D2k.js → ReimbursementRoutes-BcC0c-hC.js} +5 -5
- package/dist/assets/{ReportsRoutes-BMTrr5Qa.js → ReportsRoutes-Do7TO9Xv.js} +1 -1
- package/dist/assets/RewardsRoutes-CxzqjLpY.js +1 -0
- package/dist/assets/{ScreenRoutes-DT-K2cjb.js → ScreenRoutes-Ch7ptvuu.js} +2 -2
- package/dist/assets/{SettingsRoutes-C2EyidL4.js → SettingsRoutes-BKO1Pjri.js} +8 -8
- package/dist/assets/{SetupPagesScreen-Bu5xPZaM.js → SetupPagesScreen-Dvy2GpFH.js} +5 -5
- package/dist/assets/SignInScreen-BZWZX1Q0.js +1 -0
- package/dist/assets/SignOutScreen-ej7zxFCM.js +9 -0
- package/dist/assets/{TaskListScreen-KWPzBGE2.js → TaskListScreen-CPjplYNX.js} +2 -2
- package/dist/assets/TaskRoutes-D6e-kYJP.js +9 -0
- package/dist/assets/{TransactionDetailRoutes-RaFXCYib.js → TransactionDetailRoutes-BQtZsJD1.js} +1 -1
- package/dist/assets/{TransactionDetailScreen-DgWPeyaq.js → TransactionDetailScreen-B1AYJUjQ.js} +2 -2
- package/dist/assets/{TransactionListRoutes-CjUKG5HR.js → TransactionListRoutes-De3qcM42.js} +1 -1
- package/dist/assets/{TreasuryRoutes-BKd9Wuop.js → TreasuryRoutes-C1F9Ijug.js} +5 -5
- package/dist/assets/{VendorsRoutes-DrkDaPal.js → VendorsRoutes-XJ9cWDA2.js} +21 -21
- package/dist/assets/WiseConfirmationScreen-kawXhbh0.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-dq70WeFM.js → ZeniAccountRoutes-BXPbqBZ6.js} +9 -9
- package/dist/assets/ZeniAccountStatementScreen-DR8Npwal.js +9 -0
- package/dist/assets/{accountMappingHelper-D_5QqKtd.js → accountMappingHelper-BXTm4qLL.js} +1 -1
- package/dist/assets/{analytics-Dx20Frgp.js → analytics-B1ozuY-_.js} +1 -1
- package/dist/assets/analyticsHelper-mm28SP1t.js +1 -0
- package/dist/assets/{core-Deu6zgNz.js → core-jHXRcmGr.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-B2B9XdGW.js → decodeURIComponentSafe-C8Ut439h.js} +1 -1
- package/dist/assets/{dnd-CQEwIj2b.js → dnd-DXsHzzkY.js} +1 -1
- package/dist/assets/{empty-D6OiEgen.js → empty-CT_SeA8A.js} +1 -1
- package/dist/assets/{empty-BYHCt1Ql.js → empty-DkofjAEy.js} +1 -1
- package/dist/assets/{emptyVideoElement-DT5ERh7k.js → emptyVideoElement-xWUlB5cO.js} +1 -1
- package/dist/assets/epic-BU3yGtpS.js +2 -0
- package/dist/assets/{getLocaleForTenant-Goc_zo4E.js → getLocaleForTenant-BNQJePqV.js} +1 -1
- package/dist/assets/{index-DUGvnB6l.js → index-BaVUy8OL.js} +1 -1
- package/dist/assets/{index-x9_ludBd.js → index-BsfTwJVJ.js} +2 -2
- package/dist/assets/{index-CCeVfWXG.js → index-CVfL0TVn.js} +1 -1
- package/dist/assets/{index-s1I91N3w.js → index-Cz79PJvB.js} +1 -1
- package/dist/assets/{index-D1FLsJEr.js → index-D3N1b9aQ.js} +7 -7
- package/dist/assets/{index-Bpl8YvUJ.js → index-Dd8kzaST.js} +1 -1
- package/dist/assets/{index-DXBKeb53.js → index-bO5KWXDm.js} +1 -1
- package/dist/assets/{index-Diht5HAX.js → index-gdhkfqne.js} +1 -1
- package/dist/assets/{lexical-C3dsnw0c.js → lexical-BsEGFMKX.js} +1 -1
- package/dist/assets/{liveblocks-DJRxBaIV.js → liveblocks-Cl_SAGXq.js} +1 -1
- package/dist/assets/{lottie-CqN_xVLe.js → lottie-BvP-9pT9.js} +1 -1
- package/dist/assets/{mui-2-6pepya.js → mui-DT0mOTYO.js} +1 -1
- package/dist/assets/{pathToGoBack-oWhCBlv_.js → pathToGoBack-DeIlb7In.js} +1 -1
- package/dist/assets/{pdf-DoNTLdQS.js → pdf-CgzfzxbY.js} +3 -3
- package/dist/assets/{pdf-lib-CQlBYVN1.js → pdf-lib-BFqwhQQP.js} +1 -1
- package/dist/assets/{plaid-CAtEruxd.js → plaid-NlhYlsbZ.js} +1 -1
- package/dist/assets/{pusher-DVgs2vjL.js → pusher-Q2OMJpwL.js} +1 -1
- package/dist/assets/{react-BQK_PZ7X.js → react-3JBqx4v7.js} +1 -1
- package/dist/assets/{react-C1v_lzEp.js → react-BXjQIhaM.js} +1 -1
- package/dist/assets/{react-B9LU5ksb.js → react-C69jv4Ir.js} +1 -1
- package/dist/assets/{react-CuQlv2Xo.js → react-CbTW5azc.js} +1 -1
- package/dist/assets/{react-DvM9SJ-E.js → react-CzT5_e98.js} +1 -1
- package/dist/assets/{react-CaUElg_H.js → react-DyPd6pWl.js} +1 -1
- package/dist/assets/{recharts-DhkBu8Nc.js → recharts-qvF3Dod3.js} +1 -1
- package/dist/assets/{routePaths-DnU4nZVO.js → routePaths-m79Ycpnf.js} +1 -1
- package/dist/assets/{sentry-CCv9H2LX.js → sentry-4tqT1r6y.js} +1 -1
- package/dist/assets/{url-WAroKCYO.js → url-CXugcAfw.js} +1 -1
- package/dist/assets/{url-PHEx2VF6.js → url-yIFPVih_.js} +1 -1
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-2UTOy-pu.js → useAiCfoDashboardSuggestedQuestionsChips-BunYETHX.js} +1 -1
- package/dist/assets/{useAskAiCfoHostNavButtonProps-BSeuzuMu.js → useAskAiCfoHostNavButtonProps-DNA9YGXg.js} +1 -1
- package/dist/assets/useCashManagementBanner-TkTWt3zi.js +1 -0
- package/dist/assets/{useChargeCardPusherEvents-BKAhPUAk.js → useChargeCardPusherEvents-CTk-yEyL.js} +1 -1
- package/dist/assets/{useDeviceId-BPEf1gm7.js → useDeviceId-DYiky9LJ.js} +1 -1
- package/dist/assets/{useEmailConnectResultRefresh-CC7bzNqD.js → useEmailConnectResultRefresh-B9Wz5ZE4.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-BLJkGJ7X.js → useInitialThreadRequest-DE7N6h-n.js} +1 -1
- package/dist/assets/{utils-Fa4tVlqJ.js → utils-Dc4uXotD.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-DGRTBEXL.js → withTransactionSidePanel-C-SPdXRH.js} +2 -2
- package/dist/assets/{zeni-epic-state-Bs-2KETC.js → zeni-epic-state-BER7XwD9.js} +5 -5
- package/dist/index.html +1 -1
- package/package.json +3 -3
- package/dist/assets/AddressRoutes-_dq1yzrb.js +0 -1
- package/dist/assets/CompanyPassportScreen-iguimt1Z.js +0 -1
- package/dist/assets/ConnectionAuthScreen-B_sx8D_y.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-DgFgTk04.js +0 -1
- package/dist/assets/DomesticWireDetailScreen-DA0L_Ocw.js +0 -18
- package/dist/assets/EntityDetailRoutes-B_0KYTwn.js +0 -1
- package/dist/assets/HubSpotOAuthCallbackScreen-CmMEpDfA.js +0 -1
- package/dist/assets/MagicLinkSignInScreen-9In7ZPw9.js +0 -12
- package/dist/assets/NotFoundScreen-L94hFyts.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-DRhxh1ur.js +0 -1
- package/dist/assets/PeopleRoutes-CZ-1HcmI.js +0 -22
- package/dist/assets/PerformanceRoutes-KqN8s96O.js +0 -1
- package/dist/assets/ReferralListScreen-BI2I20EQ.js +0 -5
- package/dist/assets/ReimbursementApprovalRoutes-BI5htWMH.js +0 -1
- package/dist/assets/RewardsRoutes-DDbomjok.js +0 -1
- package/dist/assets/SignInScreen-DwCk4nzP.js +0 -1
- package/dist/assets/SignOutScreen-D7PeHepA.js +0 -9
- package/dist/assets/TaskRoutes-DLfDlpMH.js +0 -9
- package/dist/assets/WiseConfirmationScreen-qDF39yp8.js +0 -12
- package/dist/assets/ZeniAccountStatementScreen--gvYWrVM.js +0 -9
- package/dist/assets/analyticsHelper-Ds6_JcxE.js +0 -1
- package/dist/assets/epic-MtyVcf5U.js +0 -2
- package/dist/assets/useCashManagementBanner-DGRgaWAY.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as o}from"./liveblocks-
|
|
1
|
+
import{j as o}from"./liveblocks-Cl_SAGXq.js";import{a as u}from"./sentry-4tqT1r6y.js";import{h as L,g as Q,u as _,j as S,s as le,n as H,i as Z,o as ne,p as v}from"./core-jHXRcmGr.js";import{bn as De,eX as P,gp as Me,m$ as re,Oi as Te,hF as he,O9 as _e,qR as Ue,kx as be,mX as Re,hH as Be,Ob as Fe,Oa as Oe,QB as Ve,zl as ze,EO as Le,Qa as Ne,Qj as $e,c6 as ae,cM as Qe,cN as He,bs as Ze,Ma as Ge,xN as Ke,QC as Xe,Hd as qe,Eu as Je,El as Se,Ei as Ye,xR as ye,Eo as Ce,Er as Ie,Ex as oe,ub as se,xQ as We,k9 as J,kc as Ee,QD as en,ld as nn,y4 as tn,N1 as an,N2 as on,k7 as sn,QE as cn,ka as ln,rj as rn,MY as dn,MZ as un,rn as pn,hq as gn,Mi as ee,hi as de,hf as mn,hn as fn,Mj as hn,y1 as bn,QF as Sn,QG as yn,EL as Cn,fC as Ae,fE as xe,QH as In,gd as En,Ms as An,y0 as ue,gi as pe,gh as xn,x$ as vn,gg as wn,gf as kn,QI as jn,fH as ve,QJ as Pn,QK as Dn,y7 as Mn,x_ as ge,QL as Tn,fX as _n,xX as Un,bZ as Rn,c5 as Bn,c4 as Fn,b_ as On,c2 as Vn,c1 as zn,c0 as Ln,c3 as Nn,b$ as $n}from"./zeni-epic-state-BER7XwD9.js";import{C as Y,G as O,z as k,ag as we,bT as Qn,d as G,f as Hn,bE as Zn,I as K,B as ie,bU as Gn,i as ke,H as je,bV as Kn,ar as Xn,j as Pe,bW as qn,bX as Jn,bY as Yn,_ as Wn,bZ as et,v as nt,b_ as tt}from"./index-D3N1b9aQ.js";import{n as V}from"./mui-DT0mOTYO.js";import{M as B}from"./MobileAppDrawer-DJ3VpNqR.js";import{a as X,g as q,m as at}from"./accountMappingHelper-BXTm4qLL.js";import{t as ot,A as st}from"./AddressScreen-CUr-HVcT.js";import $ from"./NotFoundScreen-CamJ30ZO.js";import{g as it}from"./analyticsHelper-mm28SP1t.js";import{B as ct}from"./BusinessVerificationPageScreen-BwKYUVXz.js";import{C as lt}from"./CompanyPassportScreen-D5p8YGqx.js";import{u as rt,a as dt}from"./useEmailConnectResultRefresh-B9Wz5ZE4.js";import{q as me}from"./QBOConnectionScreen-CmRiNFSq.js";import{B as ut}from"./BillPayApprovalRoutes-D2_kNfaY.js";import{R as pt}from"./ReimbursementApprovalRoutes-CFENXyD5.js";import"./recharts-qvF3Dod3.js";import"./analytics-B1ozuY-_.js";import"./plaid-NlhYlsbZ.js";import"./dnd-DXsHzzkY.js";import"./stripe-DMRn4zHo.js";import"./lottie-BvP-9pT9.js";import"./lexical-BsEGFMKX.js";import"./pdf-CgzfzxbY.js";import"./utils-Dc4uXotD.js";import"./routePaths-m79Ycpnf.js";import"./empty-CT_SeA8A.js";import"./pdf-lib-BFqwhQQP.js";import"./index-CVfL0TVn.js";import"./url-yIFPVih_.js";import"./index-Dd8kzaST.js";import"./decodeURIComponentSafe-C8Ut439h.js";import"./ReimbursementApprovalRuleDetailScreen-Be3YasZE.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="34160ed7-d824-4caf-8f06-61a6c833ce31",e._sentryDebugIdIdentifier="sentry-dbid-34160ed7-d824-4caf-8f06-61a6c833ce31")}catch{}})();const gt=V.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -6,7 +6,7 @@ import{j as o}from"./liveblocks-DJRxBaIV.js";import{a as u}from"./sentry-CCv9H2L
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,mt=H(function(e,a){return{accountMappingView:a.accountMappingView,isFiling1099FeatureEnabled:a.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:a.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:be(e),isAccountingClassesUpdateInProgress:e.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:Ue(e),meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",isCapitalizationFeatureEnabled:a.isCapitalizationFeatureEnabled,capitalizableAccounts:a.capitalizableAccounts,accountNamesById:a.accountNamesById,capitalizableAccountOverrides:a.capitalizableAccountOverrides,isCapitalizationThresholdSaving:a.isCapitalizationThresholdSaving,onSaveCapitalizationAccountThreshold:a.onSaveCapitalizationAccountThreshold}},function(e,a){const{navigate:s,location:c,isFiling1099FeatureEnabled:l}=a;return{onAccountMappingChange:n=>{const{uncategorizedAccountSection:t,billsAccountSection:i,reimbursementsAccountSection:p,vendorsAccountSection:m,filing1099Section:f}=n,{incomeAccount:y,expenseAccount:g}=t,{billPayAccount:r}=i,{reimbursementsAccount:b}=p,{prepaidExpensesAccount:I,fixedAssetsAccount:
|
|
9
|
+
`,mt=H(function(e,a){return{accountMappingView:a.accountMappingView,isFiling1099FeatureEnabled:a.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:a.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:be(e),isAccountingClassesUpdateInProgress:e.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:Ue(e),meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",isCapitalizationFeatureEnabled:a.isCapitalizationFeatureEnabled,capitalizableAccounts:a.capitalizableAccounts,accountNamesById:a.accountNamesById,capitalizableAccountOverrides:a.capitalizableAccountOverrides,isCapitalizationThresholdSaving:a.isCapitalizationThresholdSaving,onSaveCapitalizationAccountThreshold:a.onSaveCapitalizationAccountThreshold}},function(e,a){const{navigate:s,location:c,isFiling1099FeatureEnabled:l}=a;return{onAccountMappingChange:n=>{const{uncategorizedAccountSection:t,billsAccountSection:i,reimbursementsAccountSection:p,vendorsAccountSection:m,filing1099Section:f}=n,{incomeAccount:y,expenseAccount:g}=t,{billPayAccount:r}=i,{reimbursementsAccount:b}=p,{prepaidExpensesAccount:I,fixedAssetsAccount:w,accruedExpensesAccount:A}=m,{bankAccount:h,expenseCategory1099:E}=f,U=X(a.accountMappingView.incomeAccountList,y.selectedOption),M=X(a.accountMappingView.expenseAccountList,g.selectedOption),x=X(a.accountMappingView.billPayAccountList,r.selectedOption),R=X(a.accountMappingView.reimbursementsAccountList,b.selectedOption),D=q(a.accountMappingView.prepaidExpensesAccountList,I.selectedOptions),N=q(a.accountMappingView.fixedAssetsAccountList,w.selectedOptions),F=q(a.accountMappingView.accruedExpensesAccountList,A.selectedOptions),d=q(a.accountMappingView.bankAccounts1099FilingAccountList,h.selectedOptions),C=at(a.accountMappingView.expenseAccounts1099FilingAccountList,E),T={selectedIncomeAccountId:U?.accountId,selectedExpenseAccountId:M?.accountId,selectedBillPayAccountId:x?.accountId,selectedReimbursementsAccountId:R?.accountId,selectedPrepaidExpensesAccountIds:D.map(j=>j.accountId),selectedFixedAssetsAccountIds:N.map(j=>j.accountId),selectedAccruedExpensesAccountIds:F.map(j=>j.accountId),selectedBankAccounts1099FilingAccountIds:d.map(j=>j.accountId),selectedExpenseAccounts1099FilingAccountIds:C};e(Oe({data:T}))},onBackClick:()=>{we(c)===!1?(s("../../dashboard"),e(Fe())):e(he())},onSaveClick:()=>{e(Be()),l&&G.track(Hn.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:n=>{e(Re(a.currentTenant.companyId,n))}}})(Qn),ft=()=>{const e=L(),a=Q(),s=_(),{useFeatureGate:c,useDynamicConfig:l}=Y(),{isFeatureEnabled:n}=c(O.isFiling1099FeatureEnabled),{isFeatureEnabled:t}=c(O.isScheduledJEAccruedExpensesFeatureEnabled),{configValue:i,isDynamicConfigLoading:p}=l("transaction_categorization_config"),m=!p&&i?.capitalization_enabled===!0,f=k.getSignedInUser(),y=De(f),g=S(d=>P(d)),{capitalizableAccounts:r,capitalizableAccountOverrides:b,isCapitalizationThresholdSaving:I,currencySymbol:w}=S(d=>{const C=d.tenantState.currentTenantId,T=C!=null?d.tenantState.tenantsById[C]:void 0,j=Me(d.companyState,g.companyId);return{capitalizableAccounts:T?.capitalizableAccounts??null,capitalizableAccountOverrides:T?.capitalizableAccountOverrides??null,isCapitalizationThresholdSaving:d.companyViewState.passportView?.capitalizationThresholdUpdateStatus?.fetchState==="In-Progress",currencySymbol:j?.company.companyLocaleInfo?.currencySymbol??"$"}},le),A=u.useCallback((d,C)=>{s(re(g.companyId,d,C))},[s,g.companyId]),h=u.useCallback(d=>{const C={...b??{}},T=Object.entries(d);for(const[z,ce]of T)ce===null?delete C[z]:C[z]=ce;const[j,W]=T[0]??[];j!=null&&s(re(g.companyId,j,W,void 0,Object.keys(C).length>0?C:null))},[s,g.companyId,b]),E=S(d=>Te(d.accountState),le),U=u.useMemo(()=>{const d={};for(const C of E)C.accountId!=null&&C.accountName!=null&&(d[C.accountId]=C.accountName);return d},[E]),[M,x]=u.useState(!1),[R,D]=u.useState(!1);u.useEffect(()=>{M===!1&&(s(he()),x(!0))},[M]);const N=S(d=>_e(d)),F=d=>{D(d)};return o.jsxs(gt,{children:[o.jsx(B,{isAppContentDrawerOpen:R,handleDrawerToggle:F}),o.jsx(mt,{currentTenant:g,navigate:e,accountMappingView:N,isFiling1099FeatureEnabled:n&&y,isAccruedExpensesFeatureEnabled:t,isCapitalizationFeatureEnabled:m,capitalizableAccounts:r,accountNamesById:U,capitalizableAccountOverrides:b,currencySymbol:w,isCapitalizationThresholdSaving:I,onSaveCapitalizationAccountThreshold:A,onSaveCapitalizationAccountThresholds:h,location:a,isSettings:we(a),onClickMenuIcon:()=>F(!0)})]})},ht=V.div`
|
|
10
10
|
display: flex;
|
|
11
11
|
height: 100%;
|
|
12
12
|
width: 100%;
|
|
@@ -14,7 +14,7 @@ import{j as o}from"./liveblocks-DJRxBaIV.js";import{a as u}from"./sentry-CCv9H2L
|
|
|
14
14
|
flex-direction: column;
|
|
15
15
|
align-items: center;
|
|
16
16
|
background-color: ${e=>e.theme.colors.grey4};
|
|
17
|
-
`,bt=H(function(e,a){const s=
|
|
17
|
+
`,bt=H(function(e,a){const s=P(e),c=Ne(e),l=$e(e),n=a.roleMap.bill_pay_admin;return{isDisabled:(ae(s?.userRole??[])||n)&&"readonly",billpayApprovalView:c,remiApproverView:l,analytics:G}},function(e,a){const{navigate:s,currentTenant:c}=a;return{onSetupApprovalRulesBillPaySectionClick:()=>{s("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{s("reimbursements/approval-rules")},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}})(Gn),St=()=>{const e=L(),a=Q(),s=_(),{tenantEmailDomain:c}=Z(),[l,n]=u.useState(!1),[t,i]=u.useState(!1),[p,m]=u.useState(!1),f=S(E=>P(E)),y=S(E=>E.billPaySetupApproverViewState.fetchState),g=S(E=>E.remiSetupApproverViewState.fetchState),r=S(E=>Ve(E)),{isApprovalRulesV3Enabled:b,isLoading:I}=Zn(f?.tenantId),w=f.companyId??k.getSignedInUserTenant(c)?.companyId;if(k.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const A=K();u.useEffect(()=>{p||y!=="Not-Started"||I||(m(!0),s(ze(!0,!0,b)))},[p,y,I,b,s]),u.useEffect(()=>{t||g!=="Not-Started"||I||(i(!0),s(Le(!0,!1,!1,b)))},[t,g,I,b,s]);const h=E=>{n(E)};return A?.loggedInUserRoleMap!=null?o.jsxs(ht,{children:[o.jsx(B,{isAppContentDrawerOpen:l,handleDrawerToggle:h}),o.jsx(bt,{navigate:e,location:a,companyId:w,currentTenant:f,roleMap:A.loggedInUserRoleMap,onClickMenuIcon:()=>{h(!0)}})]}):o.jsx(ie,{fetchState:r.fetchState})},yt=V.div`
|
|
18
18
|
display: flex;
|
|
19
19
|
height: 100%;
|
|
20
20
|
width: 100%;
|
|
@@ -22,7 +22,7 @@ import{j as o}from"./liveblocks-DJRxBaIV.js";import{a as u}from"./sentry-CCv9H2L
|
|
|
22
22
|
flex-direction: column;
|
|
23
23
|
align-items: center;
|
|
24
24
|
background-color: ${e=>e.theme.colors.grey4};
|
|
25
|
-
`,Ct=H(function(e,a){const{companyId:s,isZeniAccountEnabled:c,isChargeCardEnabled:l,isBillPayEnabled:n,isRemiEnabled:t,isTreasuryEnabled:i}=a,p=
|
|
25
|
+
`,Ct=H(function(e,a){const{companyId:s,isZeniAccountEnabled:c,isChargeCardEnabled:l,isBillPayEnabled:n,isRemiEnabled:t,isTreasuryEnabled:i}=a,p=P(e);return{bankSetupView:Xe(e,s,n,t,c,l,i),connectedAccountProvider:p.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:G}},function(e,a){const{navigate:s,currentTenant:c,companyId:l}=a;return{onFetchLinkTokenClick:(n,t,i)=>{e(se(t,n,i))},onEstablishConnectionClick:(n,t,i)=>{e(oe(n,l,t,i))},onUpdatePaymentAccountStatus:(n,t,i,p,m)=>{e(Ie(n,t,m,p,i))},onUpdatePaymentAccountLoginStatus:(n,t,i,p)=>{e(Ce(!1,n,p,i,t))},onEstablishConnectionSuccess:(n,t)=>{e(ye(t,n))},onUpdateAccountClick:(n,t,i,p,m)=>{e(m==="paymentAccount"?Se(n,t,i,p):Ye(p,n,t))},onUpdatePrimaryFundingAccount:(n,t,i)=>{e(Je(l,t,n,i))},onRemoveConnection:n=>{e(qe(n))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}})(Kn),It=()=>{const e=L(),a=Q(),s=_(),{tenantEmailDomain:c}=Z(),l=K(),{useFeatureGate:n}=Y(),{isFeatureEnabled:t}=n(O.isChargeCardFeatureEnabled),{isFeatureEnabled:i}=n(O.isDebitCardFeatureEnabled),[p,m]=u.useState(!1),[f,y]=u.useState(!1),g=S(D=>P(D)),r=S(D=>D.settingsViewState.bankConnection.fetchState),b=Qe(g,l?.loggedInUserRoleMap),I=He(g,l?.loggedInUserRoleMap),w=g?.userRole!=null&&Ze(g.userRole),A=!!g.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!w,h=g.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!w,E=ke(g,t,i),U=Ge(g,l?.loggedInUserRoleMap)&&E,{isCardsHidden:M}=je(g?.tenantId),x=g.companyId??k.getSignedInUserTenant(c)?.companyId;if(k.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");u.useEffect(()=>{f||r==="Completed"||(y(!0),s(Ke(!1)))},[f,s,r]);const R=D=>{m(D)};return b||A||I||U?o.jsxs(yt,{children:[o.jsx(B,{isAppContentDrawerOpen:p,handleDrawerToggle:R}),o.jsx(Ct,{navigate:e,location:a,companyId:x,currentTenant:g,roleMap:l.loggedInUserRoleMap,isBillPayEnabled:b,isRemiEnabled:I,isZeniAccountEnabled:A,isChargeCardEnabled:U,isChargeCardsHidden:M,isTreasuryEnabled:h,onClickMenuIcon:()=>{R(!0)}})]}):o.jsx($,{})},Et=V.div`
|
|
26
26
|
display: flex;
|
|
27
27
|
height: 100%;
|
|
28
28
|
width: 100%;
|
|
@@ -30,7 +30,7 @@ import{j as o}from"./liveblocks-DJRxBaIV.js";import{a as u}from"./sentry-CCv9H2L
|
|
|
30
30
|
flex-direction: column;
|
|
31
31
|
align-items: center;
|
|
32
32
|
background-color: ${e=>e.theme.colors.grey4};
|
|
33
|
-
`,At=H(function(e,a){const{companyId:s}=a,c=
|
|
33
|
+
`,At=H(function(e,a){const{companyId:s}=a,c=P(e),l=a.roleMap.bill_pay_admin,n=en(e,s),{uiState:t}=n,i=(ae(c?.userRole??[])||l)&&n.setupView.accountFetchStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.accountUpdateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{billingSetupView:n,uiState:t,stripeKey:Pe.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:i,analytics:G}},function(e,a){const{navigate:s,currentTenant:c,companyId:l}=a;return{onFetchLinkTokenClick:(n,t)=>{e(se("billing_setup",n,t))},onEstablishConnectionClick:n=>{e(oe(n,l,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(ye("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,t,i)=>{e(Ie(n,t,"billing","billing_setup",i))},onUpdatePaymentAccountLoginStatus:(n,t)=>{e(Ce(!1,n,"billing","billing_setup",t))},onUpdateAccountClick:(n,t)=>{e(Se(n,t,"billing","billing_setup"))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")},handleCreateCardSetupIntent:n=>{e(Ee(n))},handleConfirmCardSetupIntent:n=>{e(ln(n))},updateCardPaymentModalState:n=>{e(cn({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,t,i)=>{e(sn(n,t,i))},handleFetchPaymentSources:()=>{e(J())},resetCardPaymentViewState:()=>{e(on())},handleResetCardPaymentErrorStatuses:()=>{e(an())},onBillingAddressSave:n=>{e(tn(n))},onAddressEditHandler:n=>{if(n!=null){const t=ot(n);e(nn({addressType:"subscription_billing_address",addressToCreate:t}))}}}})(qn),xt=()=>{const e=L(),a=Q(),s=_(),{tenantEmailDomain:c}=Z(),[l,n]=u.useState(!1),[t,i]=u.useState(!1),[p,m]=u.useState(!1),f=S(h=>P(h)),y=S(h=>h.cardPaymentViewState),g=S(h=>h.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState),r=Xn(y.addCardPaymentSourceStatus.fetchState),b=y.addCardPaymentSourceStatus.fetchState,I=f.companyId??k.getSignedInUserTenant(c)?.companyId;if(k.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const w=K();u.useEffect(()=>{I!=null&&s(We(I,!1))},[I,s]),u.useEffect(()=>{t||(i(!0),s(J()))},[t,s]),u.useEffect(()=>{p||(Ee(["card"]),m(!0))},[p]),u.useEffect(()=>{r==="In-Progress"&&b==="Completed"&&s(J())},[r,b]);const A=h=>{n(h)};return w?.loggedInUserRoleMap!=null?o.jsxs(Et,{children:[o.jsx(B,{isAppContentDrawerOpen:l,handleDrawerToggle:A}),o.jsx(At,{navigate:e,location:a,companyId:I,currentTenant:f,roleMap:w.loggedInUserRoleMap,onClickMenuIcon:()=>{A(!0)},googleAPIKey:Pe.googleMapsAPIKey})]}):o.jsx(ie,{fetchState:g})},te="external_integrations",vt=H(function(e){const a=un(e,te);return{meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",notifyMeRegisteredSlugs:new Set(a.map(s=>s.additionalInfo).filter(s=>s!=null))}},function(e,a){const{navigate:s,integrationsView:c,signedInUserEmail:l,tenantEmailDomain:n,tenantId:t}=a;return{onBackClick:()=>{s("../")},onNavigateToDashboard:()=>{s("../dashboard")},onReconnectQBO:()=>{me.init("/connection/auth",n),me.handleClick()},onRefreshClick:()=>{c.integrations.refreshQBO.fetchState!=="In-Progress"&&e(bn())},onSaveChargeBeeCredentials:(i,p)=>{const m=c.externalConnections?.revenue?.find(f=>f.connectionName==="chargebee")?.connectionId;m!=null&&e(fn(t,m,ee("revenue"),hn("chargebee"),{api_key:i,site:p}))},onConnectHubSpot:(i,p)=>{const m=c.externalConnections?.revenue?.find(f=>f.connectionName==="hubspot")?.connectionId;if(m!=null){const f=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:i,client_secret:p,connection_id:m,redirect_uri:f,tenant_id:t}));const y="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(i)}&scope=${encodeURIComponent(y)}&redirect_uri=${encodeURIComponent(f)}`}},onDisconnect:(i,p)=>{e(mn(t,i,ee(p)))},onConnectGmail:()=>{e(de(t,"gmail",window.location.href))},onConnectOutlook:()=>{e(de(t,"outlook",window.location.href))},onSaveConnectorCredentials:i=>{e(gn(t,ee("payments"),i))},onNotifyMe:i=>{G.trackIntegrationsNotifyMeClicked("Settings",i),e(pn(te,i,l))}}})(Jn),wt=()=>{const e=L(),a=_(),{tenantEmailDomain:s}=Z();rt();const[c,l]=u.useState(!1),n=S(h=>h.tenantState.fetchState),t=S(h=>P(h)),i=t.companyId??k.getSignedInUserTenant(s)?.companyId,p=k.getSignedInUser(),m=K(),f=ae(t.userRole??[]);if(p==null)throw Error("Can't access Integrations page without signing in...");u.useEffect(()=>{a(rn(te))},[a]);const[y,g]=u.useState(!1);u.useEffect(()=>{y||(g(!0),a(J()))},[y,a]);const r=h=>{l(h)},b=S(h=>dn(h,i)),I=S(h=>h.plaidAccountViewState.external_account.plaidConnectionDetails),{plaidAccounts:w,onAddPlaidAccount:A}=dt({companyId:i??t.companyId});return m?.loggedInUserRoleMap!=null?o.jsxs(kt,{children:[o.jsx(B,{isAppContentDrawerOpen:c,handleDrawerToggle:r}),o.jsx(vt,{navigate:e,onClickMenuIcon:()=>{r(!0)},isAdmin:f,integrationsView:b,signedInUserEmail:p.userEmail??"",tenantEmailDomain:t.tenantEmailDomain??s??"",tenantId:t.tenantId,saveChargeBeeState:b.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:b.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:b.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:b.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:b.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(b.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map(([h,E])=>[h,E?.message])),deleteConnectionState:b.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:b.externalConnections?.deleteConnectionError?.message,isLoading:n==="In-Progress",plaidAccounts:w,onAddPlaidAccount:A,plaidConnectionDetails:I})]}):o.jsx(ie,{fetchState:n})},kt=V.div`
|
|
34
34
|
display: flex;
|
|
35
35
|
height: 100%;
|
|
36
36
|
width: 100%;
|
|
@@ -38,7 +38,7 @@ import{j as o}from"./liveblocks-DJRxBaIV.js";import{a as u}from"./sentry-CCv9H2L
|
|
|
38
38
|
flex-direction: column;
|
|
39
39
|
align-items: center;
|
|
40
40
|
background-color: ${e=>e.theme.colors.grey4};
|
|
41
|
-
`,
|
|
41
|
+
`,jt=V.div`
|
|
42
42
|
display: flex;
|
|
43
43
|
height: 100%;
|
|
44
44
|
width: 100%;
|
|
@@ -46,7 +46,7 @@ import{j as o}from"./liveblocks-DJRxBaIV.js";import{a as u}from"./sentry-CCv9H2L
|
|
|
46
46
|
flex-direction: column;
|
|
47
47
|
align-items: center;
|
|
48
48
|
background-color: ${e=>e.theme.colors.grey4};
|
|
49
|
-
`,
|
|
49
|
+
`,Pt=()=>{const e=_(),{tenantEmailDomain:a}=Z(),[s,c]=u.useState(!1),l=S(r=>P(r)).companyId??k.getSignedInUserTenant(a)?.companyId,n=k.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const t=S(r=>Sn(r,n.userId)),i=S(r=>yn(r,l,"bill_pay","user_reimbursement_account")),{plaidConnectionDetails:p}=i,m=r=>{c(r)},f=u.useCallback(r=>{e(se("user_reimbursement_account",r))},[]),y=u.useCallback(r=>{e(oe(r,l,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},[]);u.useEffect(()=>{t.fetchState!=="Completed"&&t.fetchState!=="In-Progress"&&e(Cn(n.userId))},[n.userId,t.fetchState]);const g=t.fetchState==="Not-Started"||t.fetchState==="In-Progress";return o.jsxs(jt,{children:[o.jsx(B,{isAppContentDrawerOpen:s,handleDrawerToggle:m}),o.jsx(Yn,{plaidConnectionDetails:p,isLoading:g,myBankConnectionsView:t,onFetchLinkTokenClick:f,onEstablishConnectionClick:y,onClickMenuIcon:()=>{m(!0)}})]})},Dt=V.div`
|
|
50
50
|
display: flex;
|
|
51
51
|
height: 100%;
|
|
52
52
|
width: 100%;
|
|
@@ -54,4 +54,4 @@ import{j as o}from"./liveblocks-DJRxBaIV.js";import{a as u}from"./sentry-CCv9H2L
|
|
|
54
54
|
flex-direction: column;
|
|
55
55
|
align-items: center;
|
|
56
56
|
background-color: ${e=>e.theme.colors.grey4};
|
|
57
|
-
`,fe=({appContent:e})=>{const a=_(),s=L(),c=Q(),[l,n]=u.useState(!1),t=S(d=>
|
|
57
|
+
`,fe=({appContent:e})=>{const a=_(),s=L(),c=Q(),[l,n]=u.useState(!1),t=S(d=>P(d)),{tenantEmailDomain:i}=t,p=t.companyId??k.getSignedInUserTenant(i)?.companyId;if(k.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:m}=Y(),f=!!t.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:y}=m(O.isChargeCardFeatureEnabled),{isFeatureEnabled:g}=m(O.isDebitCardFeatureEnabled),r=t.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",b=S(d=>be(d)),I=Ae(t),w=xe(g,t),A=!w&&b,h=ke(t,y,g),{isCardsHidden:E}=je(t?.tenantId),U=!h||E,{areTenantIdsInSync:M}=Wn();u.useEffect(()=>{M&&a(In(p,A))},[p,a,A,M]);const x=S(d=>En(d,A)),R=x.fetchState==="Not-Started"||x.fetchState==="In-Progress"||p==null,D=An(t),N=!!t.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,F=d=>{n(d)};return o.jsxs(Dt,{children:[o.jsx(B,{isAppContentDrawerOpen:l,handleDrawerToggle:F}),e!=null?o.jsx(o.Fragment,{children:e}):o.jsx(et,{myProfileView:x,isAccountingClassesEnabled:b,isReimbursementDisabled:N===!1,isZeniAccountsDisabled:f===!1,isChargeCardDisabled:U,isTreasuryDisabled:r===!1,isLiteRoleDisabled:D===!1,onClickMenuIcon:()=>{F(!0)},isLoading:R,isBankingOnlyTenant:w,isCardsOnlyTenant:I,onAddressClick:d=>{const C=function(j,W){let z=`/${j}/settings/my_profile`;return z=z.concat(`/new/${W}`),z}(i,d),T=nt(c.state?.pathnameStackToGoBack,c.pathname);s(C,{state:{pathnameStackToGoBack:T}})},onGetOtp:d=>{const C={...x.myProfileLocalData,phone:d};a(ue({localData:C})),a(kn(d,"MyProfile"))},onResendOtp:d=>{a(wn(d,"MyProfile"))},onCancelClick:()=>{a(vn())},onSaveClick:()=>{a(pe("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},onVerifyOtp:(d,C)=>{a(xn(d,C,"MyProfile"))},onVerifyOtpSuccess:d=>{d!=null&&k.saveZeniOtpToken(d),a(pe("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},updateMyProfileLocalData:d=>{a(ue({localData:d}))}})]})};function Mt(){const e=_(),a=S(r=>P(r)).companyId,s=S(r=>jn(r)),c=S(r=>ve(r)),l=k.getSignedInUser(),[n,t]=u.useState(!1),i=u.useCallback(r=>{t(r)},[]),p=u.useCallback(r=>{e(Pn(r))},[]),m=u.useCallback(()=>{l?.userEmail!=null&&e(Dn({loggedInUserEmail:l.userEmail}))},[l?.userEmail]),f=u.useCallback(()=>{e(Mn())},[]);if(l==null)throw Error("Can't access Notification Settings page without signing in...");const y=u.useCallback(()=>{const r=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ge(r,a))},[a,c.notificationSettings.monthEndInsightsNotificationSettings.enabled]),g=u.useCallback(()=>{e(Tn())},[]);return u.useEffect(()=>{if(c.fetchState==="Completed"&&s.fetchState!=="In-Progress"&&s.fetchState!=="Completed"){const r=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ge(r,a))}},[s.fetchState,a,c.notificationSettings.monthEndInsightsNotificationSettings.enabled,c.fetchState]),o.jsxs(o.Fragment,{children:[o.jsx(B,{isAppContentDrawerOpen:n,handleDrawerToggle:i}),o.jsx(tt,{notificationSettingsView:s,onFormDataChange:p,onCancel:m,onSave:f,onClickMenuIcon:()=>{i(!0)},signedInUser:l,onRefresh:y,resetUpdateStatus:g})]})}function ga(e){const[a,s]=u.useState(!1),c=S(r=>ve(r)),l=S(r=>P(r)),n=K(),t=k.getSignedInUser(),i=_(),{useFeatureGate:p}=Y(),{isFeatureEnabled:m}=p(O.isDebitCardFeatureEnabled),f=t?.userEmail==null||c.fetchState!=="Completed"||_n(c.notificationSettings,t.userEmail,m,l);u.useEffect(()=>{c.fetchState!=="In-Progress"&&c.fetchState!=="Completed"&&a===!1&&(s(!0),i(Un()))},[c.fetchState,a]);const y=xe(m,l),g=Ae(l);return c.fetchState!=="In-Progress"&&c.fetchState!=="Not-Started"||f!==!0?Rn(l)?o.jsxs(ne,{children:[Bn(n?.loggedInUserRole??[],m,l,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"accounting/*",element:o.jsx(ft,{})}),Fn(n?.loggedInUserRole??[],m,l,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"approval_rules/*",element:o.jsx(Tt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),On(l,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"my_bank_connections",element:o.jsx(Pt,{})}),Vn(l,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"bank_connections",element:o.jsx(It,{})}),zn(l,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"business_verification",element:o.jsx(ct,{productType:y?"zeni_accounts":g?"charge_cards":it(l,n?.loggedInUserRoleMap)})}),Ln(n?.loggedInUserRole??[],l,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"company_details",element:o.jsx(lt,{})}),Nn(n?.loggedInUserRole??[],l)&&o.jsx(v,{path:"billing",element:o.jsx(xt,{})}),$n(n?.loggedInUserRole??[],m,l)&&o.jsx(v,{path:"integrations",element:o.jsx(wt,{})}),o.jsx(v,{path:"my_profile/new/:addressType",element:o.jsx(fe,{appContent:o.jsx(st,{isSubPage:!1})})}),o.jsx(v,{path:"my_profile",element:o.jsx(fe,{})}),f&&o.jsx(v,{path:"notifications",element:o.jsx(Mt,{})}),o.jsx(v,{path:"*",element:o.jsx($,{})})]}):o.jsx(ne,{children:o.jsx(v,{path:"*",element:o.jsx($,{})})}):null}function Tt(e){return o.jsxs(ne,{children:[o.jsx(v,{path:"/",element:o.jsx(St,{})}),o.jsx(v,{path:"bills/approval-rules/*",element:o.jsx(ut,{})}),o.jsx(v,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?o.jsx(pt,{}):o.jsx($,{})}),o.jsx(v,{path:"*",element:o.jsx($,{})})]})}export{ga as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as u}from"./liveblocks-
|
|
1
|
+
import{j as u}from"./liveblocks-Cl_SAGXq.js";import{h as Y,g as ee,u as ne,i as G,j as P,N as x,n as W,t as en}from"./core-jHXRcmGr.js";import{bJ as nn,cp as Ce,P_ as ye,eX as V,cB as tn,zB as Q,zl as an,Qa as sn,Qd as on,rC as te,rq as ae,l5 as ie,tJ as z,Qf as Ie,gh as $e,gg as Ge,gf as We,Qg as cn,zK as rn,Eu as Ae,El as ke,Ei as _e,E0 as J,Eo as Ee,Er as ve,Ex as Pe,ub as we,gw as un,cw as dn,fE as ln,fC as pn,fD as mn,bt as yn,Qh as fn,D0 as le,DE as gn,Qi as Sn,bK as bn,FN as pe,EO as hn,Qj as Cn,Qk as In,FR as An,FV as kn,tC as _n,Kj as En,Gq as he,Hq as me,Ql as vn,Qm as Pn,Qn as wn,Qo as He,Qp as Tn,MM as Dn,Pn as Un,M$ as On,Qq as qe,E4 as Fn,N0 as Vn,E8 as Bn,Qr as Oe,GM as Ke,ld as xn,rt as Je,tL as jn,bE as Re,tX as Ne,cz as Rn,Qs as Xe,fW as Nn,G8 as zn,Gc as Ln,Qt as Mn,Gt as ze,Qu as Zn,Qv as Qn,Qw as $n,Qx as Gn,gp as Wn,AV as Hn,Qy as qn,A_ as Kn,AZ as Jn}from"./zeni-epic-state-BER7XwD9.js";import{I as se,C as oe,G as K,y as Te,aS as X,bE as Ye,z as U,D as ce,d as O,B as De,f as $,bF as Xn,au as re,bG as B,bH as Yn,bI as et,ag as xe,bJ as nt,v as Le,av as Me,K as tt,F as at,bK as it,bL as st,bM as ot,a9 as ct}from"./index-D3N1b9aQ.js";import{a as h}from"./sentry-4tqT1r6y.js";import{n as Fe,D as rt,S as ut}from"./mui-DT0mOTYO.js";import{M as fe}from"./MobileAppDrawer-DJ3VpNqR.js";import N from"./NotFoundScreen-CamJ30ZO.js";import{a as Ze}from"./analyticsHelper-mm28SP1t.js";import{d as Qe}from"./routePaths-m79Ycpnf.js";import{B as Ue}from"./BusinessVerificationPageScreen-BwKYUVXz.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="0140ded3-7a0e-42a5-963c-6b95dcde1c3d",e._sentryDebugIdIdentifier="sentry-dbid-0140ded3-7a0e-42a5-963c-6b95dcde1c3d")}catch{}})();const dt=Fe.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -6,7 +6,7 @@ import{j as u}from"./liveblocks-DJRxBaIV.js";import{h as Y,g as ee,u as ne,i as
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,lt=W(function(e,o){const{isUserBillPayAdmin:t,companyId:a}=o,c=V(e),n=sn(e),s=U.getSignedInUser(),l=c.tenantId,i={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:l??""},r=on(e,a),p=t&&r.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&r.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",g=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{billPaySetupView:r,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:g,showIntlWiseWidget:o.showIntlWiseWidget,isDisabled:p,billpayApprovalView:n,meetingUrl:"https://meetings.hubspot.com/snehals/demo-bill-pay?embed=true",analytics:O,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:i}},function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyBillPayInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(Q(a,!1,!0))},onSetupApprovalRulesSectionClick:()=>{t("../approval-rules")},onFetchLinkTokenClick:(n,s)=>{e(we("bill_pay_setup",n,s))},onEstablishConnectionClick:n=>{e(Pe(n,a,"bill_pay_setup","bill_pay"))},onUpdatePaymentAccountStatus:(n,s,l)=>{e(Ee(n,s,"bill_pay","bill_pay_setup",l))},onUpdatePaymentAccountLoginStatus:(n,s)=>{e(ve(!1,n,"bill_pay","bill_pay_setup",s))},onEstablishConnectionSuccess:()=>{e(Q(a,!0))},onEnableBillPayClick:()=>{e(J(a,"bill_pay"))},onUpdateAccountClick:(n,s,l)=>{e(l==="paymentAccount"?ke(n,s,"bill_pay","bill_pay_setup"):_e("reimbursement_setup",n,s))},onUpdatePrimaryFundingAccount:(n,s)=>{e(Ae(a,"bill_pay_setup",n,s))},onEnableBillPaySuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?t("../.."):t("../",{relative:"path"})},onAcceptUpdatedTOS:()=>{e(rn(a))},onAcceptUpdatedTOSSuccess:()=>{e(Q(a,!0))},onGetOtp:(n,s)=>{e(We(n,"SpendManagementSetup")),s!=null&&e(cn({officerType:s,phone:n}))},onResendOtp:n=>{e(Ge(n,"SpendManagementSetup"))},onVerifyOtp:(n,s)=>{e($e(n,s,"SpendManagementSetup"))},onVerifyOtpSuccess:(n,s)=>{n!=null&&s!=null&&e(z(a,n,"bill_pay",!0,!0))},onNavigateToDashboard:()=>{t("../../dashboard")},onNavigateToSettings:()=>{t("../bills/setup")},onInternationPaymentSetUpClick:()=>{t("../international-wire")},onCompanyOfficerUpdated:(n,s)=>{e(Ie({officerType:n,fileIds:s}))},onSendForVerificationClick:n=>{e(z(a,n,"bill_pay",!0,!0,!0))},updateFilesEntity:n=>{e(ie({files:n}))},onDeleteFile:n=>{e(ae(n))},onEditFileName:(n,s)=>{e(te(n,s.split(".")[0]))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}})(Xn),pt=()=>{const e=Y(),o=ee(),t=ne(),{tenantEmailDomain:a}=G(),c=se(),n=nn(c?.loggedInUserRoleMap),s=Ce(c?.loggedInUserRoleMap),{useFeatureGate:l,useDynamicConfig:i}=oe(),{isFeatureEnabled:r}=l(q.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:p}=l(q.isBillPayLocalCurrencyFeatureEnabled),g=Te(),{configValue:C}=i(X.zeniAccountsConfig),I=ye(C),[k,d]=h.useState(!1),S=h.useRef(!1),[y,_]=h.useState(!1),v=P(w=>w.billPaySetupViewState.fetchState),f=P(w=>V(w)),b=P(w=>w.billPaySetupApproverViewState.fetchState),{isApprovalRulesV3Enabled:D,isLoading:A}=Ye(f?.tenantId),m=f.companyId??U.getSignedInUserTenant(a)?.companyId;if(U.getSignedInUser()==null)throw Error("Can't access bill pay setup page without signing in...");const E=!!f.companyBillPayInfo?.info?.isBillPayTOSAccepted,j=tn(c?.loggedInUserRoleMap);h.useEffect(()=>{S.current||v!=="Not-Started"||m==null?S.current||v!=="Completed"||m==null||f.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(S.current=!0,t(Q(m,!1,!0))):(S.current=!0,t(Q(m,!0)))},[v,m,t]),h.useEffect(()=>{y||b!=="Not-Started"||A||(_(!0),t(an(!0,!0,D)))},[y,b,A,D,t]);const F=w=>{d(w)};if(E===!1||j&&!c?.loggedInUserRoleMap?.bill_pay_admin)return u.jsx(x,{to:"../promo"});if(E===!0&&c?.loggedInUserRoleMap!=null){const w=R=>R.trackPageLoaded($.Event.billPaySetup);return u.jsxs(dt,{children:[u.jsx(ce,{analytics:O,onLoad:R=>w(R)}),u.jsx(fe,{isAppContentDrawerOpen:k,handleDrawerToggle:F}),u.jsx(lt,{navigate:e,location:o,companyId:m,currentTenant:f,isUserBillPayAdmin:n,showIntlWiseWidget:r,onClickMenuIcon:()=>{F(!0)},hasZeniAccountsAdminAccess:s,accountsPromoConfig:I,isLocalCurrencyEnabled:p})]})}return u.jsx(De,{fetchState:"In-Progress",style:{backgroundColor:g.colors.grey5}})},Qt=(e,o)=>e!=null&&function(t){return t==="debit"||t==="credit"||t==="debit_and_credit"}(e)?e:o,$t=e=>`/${e}/cards`,Gt=e=>`/${e}/cards/setup`,Wt=e=>`/${e}/cards/onboard`,Ht=(e,o,t,a,c=!1)=>{let n=`/${e}/cards/${encodeURIComponent(o)}`;return a==null||a.status.code!=="inactive"||a.cardHolderUserId!==t.userId||a.type.code!=="business_physical_credit_card"&&a.type.code!=="business_physical_debit_card"?a!=null&&a.status.code==="active"&&a.cardHolderUserId===t.userId&&a.type.code==="business_physical_credit_card"&&c===!0?n+="/addToWallet":a==null||a.type.code!=="business_physical_debit_card"&&a.type.code!=="business_virtual_debit_card"||a.status.code!=="active"||a.cardHolderUserId!==t.userId||a.isPinSet!==!1||(n+="/setPin"):n+="/activate",n},Kt=(e,o)=>e.find(t=>t.id===o),qt=(e,o,t)=>!e||!o||t.fetchState==="Completed",mt=(e,o,t,a)=>({isCreditCardOffered:e,isDebitCardOffered:o,isDebitCardEnabled:t,isCreditCardEnabled:a}),Jt=(e,o)=>e?{creditCardCashbackOffer:`${o.cashbackAnalytics.creditCardCashbackOffer}%`,debitCardCashbackOffer:`${o.cashbackAnalytics.debitCardCashbackOffer}%`,totalEarnedCashback:B(o.cashbackSummary.cashbackEarned.amount),redeemedCashback:B(o.cashbackSummary.cashbackRedeemed.amount),availableCashback:B(o.cashbackSummary.cashbackAvailable.amount),creditCardCashbackRedemptionMode:o.cashbackAnalytics.creditCardCashbackRedemptionMode,debitCardCashbackRedemptionMode:o.cashbackAnalytics.debitCardCashbackRedemptionMode}:void 0,Xt=(e,o,t,a,c)=>e&&o&&t?{creditAccountId:a.id,creditAccountLimit:B(a.limit.amount),creditAccountAvailableAmount:B(a.available.amount),creditAccountSpentAmount:B(a.balance.amount+a.hold.amount),creditAccountStatus:a.status,outstandingBalance:B(c.remainingAmountDue.amount)}:void 0,Yt=(e,o,t,a,c)=>e&&o&&t?{debitAccountId:a.depositAccounts.map(n=>n.id),debitAccountName:a.depositAccounts.map(n=>n.accountName),debitAccountBalance:a.depositAccounts.map(n=>B(n.accountBalance.available.amount)),debitCardsSpend:B(c?.currentMonthSpends.amount??0),debitAccountStatus:a.depositAccounts.map(n=>n.accountStatus)}:void 0,ea=(e,o)=>e&&o.depositAccountLimit!=null&&o.chargeCard!=null?{debitAccountId:o.depositAccountLimit.id,debitAccountName:o.depositAccountLimit?.accountName??o.connectedAccount?.accountName,debitAccountBalance:B(o.depositAccountLimit?.accountBalance.available.amount),debitCardsSpend:B(o.chargeCard.limit.amount-o.chargeCard.available.amount),debitAccountStatus:o.depositAccountLimit?.accountStatus??o.connectedAccount?.accountStatus}:void 0,na=80,ta=80,aa=e=>e.companyId??U.getSignedInUserTenant(e.tenantEmailDomain)?.companyId,yt=({isBankingOnlyTenant:e,isDebitCardFeatureEnabled:o})=>o||e,ft=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:t,isDebitCardProductVisible:a,chargeCardsCreditAccountLimit:c})=>(e||o||t)&&(!a||c>0),ia=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:t})=>e||o||t,sa=({cardInfo:e,isProductVisible:o,isTOSAccepted:t,isSetupEnabled:a,isUserHasCardsAdminLevelAccess:c,isUserHasCardsAccess:n})=>!!e&&o&&(!t&&c||n&&!c&&!a),gt=W(function(e,o){const{isUserChargeCardAdmin:t,chargeCardSetUpView:a,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n}=o,s=V(e),l=U.getSignedInUser(),i=s.tenantId,r={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i??""},p=t&&a.updateStatus.fetchState!=="In-Progress"&&a.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&a.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&a.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",g=!!s.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{chargeCardSetUpView:a,connectedAccountProvider:s.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:g,isDisabled:p,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:O,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:r}},function(e,o){const{navigate:t,companyId:a,currentTenant:c,chargeCardSetUpView:n,isDebitCardTOSAccepted:s,isChargeCardTOSAccepted:l,isChargeCardSetupEnabled:i,isDebitCardSetupEnabled:r,productInformation:p,controllerEmails:g,businessVerificationStatus:C,isCardPolicyEnabled:I,isUserChargeCardAdmin:k}=o;return{onBusinessVerificationSectionClick:()=>{O.trackCardsVerifyIdentityCompanyDetailsClick(g,p,C?.code),t("../verification"),c?.company?.companyChargeCardInfo!=null&&c.company.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(le(a,!1,!0))},...k&&I?{onCardPolicySectionClick:()=>{t("../policy")}}:{},onFetchLinkTokenClick:(d,S)=>{e(we("charge_card_setup",d,S))},onEstablishConnectionClick:d=>{e(Pe(d,a,"charge_card_setup","charge_cards"))},onUpdatePaymentAccountStatus:(d,S,y)=>{e(Ee(d,S,"charge_cards","charge_card_setup",y))},onUpdatePaymentAccountLoginStatus:(d,S)=>{e(ve(!1,d,"charge_cards","charge_card_setup",S))},onEstablishConnectionSuccess:()=>{e(le(a,!0))},onEnableChargeCardClick:()=>{O.trackCardsEnableCardsClick(g,p,"Cards Card Setup"),l===!0&&s===!0&&i===!1&&r===!1?e(J(a,"charge_cards__debit_cards")):l===!0&&i===!1?e(J(a,"charge_cards")):s===!0&&r===!1&&e(J(a,"debit_cards"))},onUpdateChargeCardClick:(d,S,y)=>{const _=n.allBankAccounts.find(f=>f.accountId===n.primaryFundingAccount?.zeniAccountId),v=n.allBankAccounts.find(f=>f.accountId===d);O.trackCardsZeniCashAccountChangeClick(g,p,{oldZeniCashAccount:_?.accountName??"",newZeniCashAccount:v?.accountName??"",oldZeniCashAccountPosition:n.allBankAccounts.findIndex(f=>f.accountId===n.primaryFundingAccount?.zeniAccountId)+1,newZeniCashAccountPosition:n.allBankAccounts.findIndex(f=>f.accountId===d)+1,numberOfCashAccounts:n.allBankAccounts.length}),e(y==="paymentAccount"?ke(d,S,"charge_cards","charge_card_setup"):_e("charge_card_setup",d,S))},onUpdatePrimaryFundingAccount:(d,S)=>{const y=n.allFundingAccounts.find(f=>f.id===d),_=n.allFundingAccounts.findIndex(f=>f.id===n.primaryFundingAccount?.id)+1,v=n.allFundingAccounts.findIndex(f=>f.id===d)+1;O.trackCardsPaymentAccountChangeClick(g,p,{oldPaymentAccountName:n.primaryFundingAccount?.label??"",oldPaymentAccountBalance:B(n.primaryFundingAccount?.accountBalance?.available?.amount??0),newPaymentAccountName:y?.label??"",newPaymentAccountBalance:B(y?.accountBalance?.available?.amount??0),isOldPaymentAccountRecommended:n.primaryFundingAccount?.accType==="depositAccount",isNewPaymentAccountRecommended:y?.accType==="depositAccount",oldPaymentAccountPosition:_,newPaymentAccountPosition:v,numberOfPaymentAccounts:n.allFundingAccounts.length}),e(Ae(a,"charge_card_setup",d,S))},onEnableChargeCardSuccess:()=>{e(Sn()),t("../",{relative:"path"})},onBackClick:()=>{c?.companyChargeCardInfo?.info?.isChargeCardEnabled||c?.companyDebitCardInfo?.info?.isDebitCardEnabled?t("../",{relative:"path"}):t("../..",{relative:"path"})},onNavigateToDashboard:()=>{t("../../dashboard")},onCompanyOfficerUpdated:(d,S)=>{e(Ie({officerType:d,fileIds:S}))},onSendForVerificationClick:d=>{l===!0&&s===!0?e(z(a,d,"charge_cards__debit_cards",!0,!0,!0)):l===!0?e(z(a,d,"charge_cards",!0,!0,!0)):s===!0&&e(z(a,d,"debit_cards",!0,!0,!0))},updateFilesEntity:d=>{e(ie({files:d}))},onDeleteFile:d=>{e(ae(d))},onEditFileName:(d,S)=>{e(te(d,S.split(".")[0]))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onUpdateAutoPayClick:d=>{e(gn(a,d))}}})(Yn),St=()=>{const e=Y(),o=ee(),t=ne(),{tenantEmailDomain:a}=G(),c=se(),n=P(L=>V(L)),{useDynamicConfig:s,useFeatureGate:l}=oe(),i=o.state?.pathnameStackToGoBack?.[0],{configValue:r}=s(X.zeniAccountsConfig),{configValue:p}=s(X.zeniCardsConfig),g=p.credit_card_auto_pay_threshold_by_company_id?.[n.companyId]??p.default_credit_card_auto_pay_threshold??80,{isFeatureEnabled:C}=l(q.isDebitCardFeatureEnabled),{isFeatureEnabled:I}=l(q.isChargeCardFeatureEnabled),{isFeatureEnabled:k}=l(q.isEarlyPayFeatureEnabled),{isFeatureEnabled:d}=l(q.isCardPolicyEnabled),S=P(L=>un(L,n.companyId)),y=dn(S.controllers),_=!!n.company?.companyChargeCardInfo.isChargeCardEnabled,v=!!n.company?.companyDebitCardInfo.isDebitCardEnabled,f=ln(C,n),b=yt({isDebitCardFeatureEnabled:C,isBankingOnlyTenant:f}),D=pn(n),A=mn(n),m=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,E=ft({isCardsOnlyTenant:D,isChargeCardFeatureEnabled:I,isBookKeepingTenant:A,isDebitCardProductVisible:b,chargeCardsCreditAccountLimit:m}),j=b&&E===!1,F=b===!1&&E,w=ye(r),R=yn(c?.loggedInUserRoleMap),H=Ce(c?.loggedInUserRoleMap),[ge,Se]=h.useState(!1),[M,ue]=h.useState(!1),Z=P(L=>L.chargeCardSetupViewState.fetchState),T=U.getSignedInUserTenant(a)?.companyId??n.companyId,Ve=U.getSignedInUser(),de=L=>{Se(L)},Be=P(L=>fn(L,T));if(Ve==null)throw Error("Can't access charge card setup page without signing in...");h.useEffect(()=>{M||Z!=="Not-Started"||T==null?M||Z!=="Completed"||T==null||n.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(le(T,!1,!0)):(ue(!0),t(le(T,!0)))},[M,Z,T,t]);const be=!!n.company?.companyChargeCardInfo.isChargeCardTOSAccepted,K=!!n.company?.companyDebitCardInfo.isDebitCardTOSAccepted,je=mt(E,b,v,_);return be||K?be||K?u.jsxs(u.Fragment,{children:[u.jsx(ce,{analytics:O,onLoad:()=>{O.trackPageLoaded($.Event.cardsSetupVisited),O.trackCardsCardSetupView(y,je,i==null?"Cards Setup":i.includes("cards/promo")?"Promo":i.includes("cards")?"Settings":"Cards Tab")}}),u.jsx(fe,{isAppContentDrawerOpen:ge,handleDrawerToggle:de}),u.jsx(gt,{autoPayThreshold:g,navigate:e,location:o,companyId:T,currentTenant:n,isEarlyPayEnabled:k,isChargeCardTOSAccepted:be,isDebitCardTOSAccepted:K,isUserChargeCardAdmin:R,isCardPolicyEnabled:d,isDebitCardOnlyEnabled:j,isCreditCardOnlyEnabled:F,chargeCardSetUpView:Be,isCreditCardProductVisible:E,isDebitCardFeatureEnabled:b,isChargeCardSetupEnabled:_,isDebitCardSetupEnabled:v,businessVerificationStatus:n.companyBillPayInfo?.info?.businessVerificationStatus,controllerEmails:y,productInformation:je,onClickMenuIcon:()=>{de(!0)},hasZeniAccountsAdminAccess:H,accountsPromoConfig:w})]}):u.jsx(De,{fetchState:"Not-Started"}):u.jsx(x,{to:"../promo"})},bt=Fe.div`
|
|
9
|
+
`,lt=W(function(e,o){const{isUserBillPayAdmin:t,companyId:a}=o,c=V(e),n=sn(e),s=U.getSignedInUser(),l=c.tenantId,i={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:l??""},r=on(e,a),p=t&&r.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&r.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",g=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{billPaySetupView:r,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:g,showIntlWiseWidget:o.showIntlWiseWidget,isDisabled:p,billpayApprovalView:n,meetingUrl:"https://meetings.hubspot.com/snehals/demo-bill-pay?embed=true",analytics:O,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:i}},function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyBillPayInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(Q(a,!1,!0))},onSetupApprovalRulesSectionClick:()=>{t("../approval-rules")},onFetchLinkTokenClick:(n,s)=>{e(we("bill_pay_setup",n,s))},onEstablishConnectionClick:n=>{e(Pe(n,a,"bill_pay_setup","bill_pay"))},onUpdatePaymentAccountStatus:(n,s,l)=>{e(ve(n,s,"bill_pay","bill_pay_setup",l))},onUpdatePaymentAccountLoginStatus:(n,s)=>{e(Ee(!1,n,"bill_pay","bill_pay_setup",s))},onEstablishConnectionSuccess:()=>{e(Q(a,!0))},onEnableBillPayClick:()=>{e(J(a,"bill_pay"))},onUpdateAccountClick:(n,s,l)=>{e(l==="paymentAccount"?ke(n,s,"bill_pay","bill_pay_setup"):_e("reimbursement_setup",n,s))},onUpdatePrimaryFundingAccount:(n,s)=>{e(Ae(a,"bill_pay_setup",n,s))},onEnableBillPaySuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?t("../.."):t("../",{relative:"path"})},onAcceptUpdatedTOS:()=>{e(rn(a))},onAcceptUpdatedTOSSuccess:()=>{e(Q(a,!0))},onGetOtp:(n,s)=>{e(We(n,"SpendManagementSetup")),s!=null&&e(cn({officerType:s,phone:n}))},onResendOtp:n=>{e(Ge(n,"SpendManagementSetup"))},onVerifyOtp:(n,s)=>{e($e(n,s,"SpendManagementSetup"))},onVerifyOtpSuccess:(n,s)=>{n!=null&&s!=null&&e(z(a,n,"bill_pay",!0,!0))},onNavigateToDashboard:()=>{t("../../dashboard")},onNavigateToSettings:()=>{t("../bills/setup")},onInternationPaymentSetUpClick:()=>{t("../international-wire")},onCompanyOfficerUpdated:(n,s)=>{e(Ie({officerType:n,fileIds:s}))},onSendForVerificationClick:n=>{e(z(a,n,"bill_pay",!0,!0,!0))},updateFilesEntity:n=>{e(ie({files:n}))},onDeleteFile:n=>{e(ae(n))},onEditFileName:(n,s)=>{e(te(n,s.split(".")[0]))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}})(Xn),pt=()=>{const e=Y(),o=ee(),t=ne(),{tenantEmailDomain:a}=G(),c=se(),n=nn(c?.loggedInUserRoleMap),s=Ce(c?.loggedInUserRoleMap),{useFeatureGate:l,useDynamicConfig:i}=oe(),{isFeatureEnabled:r}=l(K.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:p}=l(K.isBillPayLocalCurrencyFeatureEnabled),g=Te(),{configValue:C}=i(X.zeniAccountsConfig),I=ye(C),[k,d]=h.useState(!1),S=h.useRef(!1),[y,_]=h.useState(!1),E=P(w=>w.billPaySetupViewState.fetchState),f=P(w=>V(w)),b=P(w=>w.billPaySetupApproverViewState.fetchState),{isApprovalRulesV3Enabled:D,isLoading:A}=Ye(f?.tenantId),m=f.companyId??U.getSignedInUserTenant(a)?.companyId;if(U.getSignedInUser()==null)throw Error("Can't access bill pay setup page without signing in...");const v=!!f.companyBillPayInfo?.info?.isBillPayTOSAccepted,j=tn(c?.loggedInUserRoleMap);h.useEffect(()=>{S.current||E!=="Not-Started"||m==null?S.current||E!=="Completed"||m==null||f.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(S.current=!0,t(Q(m,!1,!0))):(S.current=!0,t(Q(m,!0)))},[E,m,t]),h.useEffect(()=>{y||b!=="Not-Started"||A||(_(!0),t(an(!0,!0,D)))},[y,b,A,D,t]);const F=w=>{d(w)};if(v===!1||j&&!c?.loggedInUserRoleMap?.bill_pay_admin)return u.jsx(x,{to:"../promo"});if(v===!0&&c?.loggedInUserRoleMap!=null){const w=R=>R.trackPageLoaded($.Event.billPaySetup);return u.jsxs(dt,{children:[u.jsx(ce,{analytics:O,onLoad:R=>w(R)}),u.jsx(fe,{isAppContentDrawerOpen:k,handleDrawerToggle:F}),u.jsx(lt,{navigate:e,location:o,companyId:m,currentTenant:f,isUserBillPayAdmin:n,showIntlWiseWidget:r,onClickMenuIcon:()=>{F(!0)},hasZeniAccountsAdminAccess:s,accountsPromoConfig:I,isLocalCurrencyEnabled:p})]})}return u.jsx(De,{fetchState:"In-Progress",style:{backgroundColor:g.colors.grey5}})},Qt=(e,o)=>e!=null&&function(t){return t==="debit"||t==="credit"||t==="debit_and_credit"}(e)?e:o,$t=e=>`/${e}/cards`,Gt=e=>`/${e}/cards/setup`,Wt=e=>`/${e}/cards/onboard`,Ht=(e,o,t,a,c=!1)=>{let n=`/${e}/cards/${encodeURIComponent(o)}`;return a==null||a.status.code!=="inactive"||a.cardHolderUserId!==t.userId||a.type.code!=="business_physical_credit_card"&&a.type.code!=="business_physical_debit_card"?a!=null&&a.status.code==="active"&&a.cardHolderUserId===t.userId&&a.type.code==="business_physical_credit_card"&&c===!0?n+="/addToWallet":a==null||a.type.code!=="business_physical_debit_card"&&a.type.code!=="business_virtual_debit_card"||a.status.code!=="active"||a.cardHolderUserId!==t.userId||a.isPinSet!==!1||(n+="/setPin"):n+="/activate",n},qt=(e,o)=>e.find(t=>t.id===o),Kt=(e,o,t)=>!e||!o||t.fetchState==="Completed",mt=(e,o,t,a)=>({isCreditCardOffered:e,isDebitCardOffered:o,isDebitCardEnabled:t,isCreditCardEnabled:a}),Jt=(e,o)=>e?{creditCardCashbackOffer:`${o.cashbackAnalytics.creditCardCashbackOffer}%`,debitCardCashbackOffer:`${o.cashbackAnalytics.debitCardCashbackOffer}%`,totalEarnedCashback:B(o.cashbackSummary.cashbackEarned.amount),redeemedCashback:B(o.cashbackSummary.cashbackRedeemed.amount),availableCashback:B(o.cashbackSummary.cashbackAvailable.amount),creditCardCashbackRedemptionMode:o.cashbackAnalytics.creditCardCashbackRedemptionMode,debitCardCashbackRedemptionMode:o.cashbackAnalytics.debitCardCashbackRedemptionMode}:void 0,Xt=(e,o,t,a,c)=>e&&o&&t?{creditAccountId:a.id,creditAccountLimit:B(a.limit.amount),creditAccountAvailableAmount:B(a.available.amount),creditAccountSpentAmount:B(a.balance.amount+a.hold.amount),creditAccountStatus:a.status,outstandingBalance:B(c.remainingAmountDue.amount)}:void 0,Yt=(e,o,t,a,c)=>e&&o&&t?{debitAccountId:a.depositAccounts.map(n=>n.id),debitAccountName:a.depositAccounts.map(n=>n.accountName),debitAccountBalance:a.depositAccounts.map(n=>B(n.accountBalance.available.amount)),debitCardsSpend:B(c?.currentMonthSpends.amount??0),debitAccountStatus:a.depositAccounts.map(n=>n.accountStatus)}:void 0,ea=(e,o)=>e&&o.depositAccountLimit!=null&&o.chargeCard!=null?{debitAccountId:o.depositAccountLimit.id,debitAccountName:o.depositAccountLimit?.accountName??o.connectedAccount?.accountName,debitAccountBalance:B(o.depositAccountLimit?.accountBalance.available.amount),debitCardsSpend:B(o.chargeCard.limit.amount-o.chargeCard.available.amount),debitAccountStatus:o.depositAccountLimit?.accountStatus??o.connectedAccount?.accountStatus}:void 0,na=80,ta=80,aa=e=>e.companyId??U.getSignedInUserTenant(e.tenantEmailDomain)?.companyId,yt=({isBankingOnlyTenant:e,isDebitCardFeatureEnabled:o})=>o||e,ft=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:t,isDebitCardProductVisible:a,chargeCardsCreditAccountLimit:c})=>(e||o||t)&&(!a||c>0),ia=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:t})=>e||o||t,sa=({cardInfo:e,isProductVisible:o,isTOSAccepted:t,isSetupEnabled:a,isUserHasCardsAdminLevelAccess:c,isUserHasCardsAccess:n})=>!!e&&o&&(!t&&c||n&&!c&&!a),gt=W(function(e,o){const{isUserChargeCardAdmin:t,chargeCardSetUpView:a,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n}=o,s=V(e),l=U.getSignedInUser(),i=s.tenantId,r={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i??""},p=t&&a.updateStatus.fetchState!=="In-Progress"&&a.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&a.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&a.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",g=!!s.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{chargeCardSetUpView:a,connectedAccountProvider:s.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:g,isDisabled:p,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:O,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:r}},function(e,o){const{navigate:t,companyId:a,currentTenant:c,chargeCardSetUpView:n,isDebitCardTOSAccepted:s,isChargeCardTOSAccepted:l,isChargeCardSetupEnabled:i,isDebitCardSetupEnabled:r,productInformation:p,controllerEmails:g,businessVerificationStatus:C,isCardPolicyEnabled:I,isUserChargeCardAdmin:k}=o;return{onBusinessVerificationSectionClick:()=>{O.trackCardsVerifyIdentityCompanyDetailsClick(g,p,C?.code),t("../verification"),c?.company?.companyChargeCardInfo!=null&&c.company.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(le(a,!1,!0))},...k&&I?{onCardPolicySectionClick:()=>{t("../policy")}}:{},onFetchLinkTokenClick:(d,S)=>{e(we("charge_card_setup",d,S))},onEstablishConnectionClick:d=>{e(Pe(d,a,"charge_card_setup","charge_cards"))},onUpdatePaymentAccountStatus:(d,S,y)=>{e(ve(d,S,"charge_cards","charge_card_setup",y))},onUpdatePaymentAccountLoginStatus:(d,S)=>{e(Ee(!1,d,"charge_cards","charge_card_setup",S))},onEstablishConnectionSuccess:()=>{e(le(a,!0))},onEnableChargeCardClick:()=>{O.trackCardsEnableCardsClick(g,p,"Cards Card Setup"),l===!0&&s===!0&&i===!1&&r===!1?e(J(a,"charge_cards__debit_cards")):l===!0&&i===!1?e(J(a,"charge_cards")):s===!0&&r===!1&&e(J(a,"debit_cards"))},onUpdateChargeCardClick:(d,S,y)=>{const _=n.allBankAccounts.find(f=>f.accountId===n.primaryFundingAccount?.zeniAccountId),E=n.allBankAccounts.find(f=>f.accountId===d);O.trackCardsZeniCashAccountChangeClick(g,p,{oldZeniCashAccount:_?.accountName??"",newZeniCashAccount:E?.accountName??"",oldZeniCashAccountPosition:n.allBankAccounts.findIndex(f=>f.accountId===n.primaryFundingAccount?.zeniAccountId)+1,newZeniCashAccountPosition:n.allBankAccounts.findIndex(f=>f.accountId===d)+1,numberOfCashAccounts:n.allBankAccounts.length}),e(y==="paymentAccount"?ke(d,S,"charge_cards","charge_card_setup"):_e("charge_card_setup",d,S))},onUpdatePrimaryFundingAccount:(d,S)=>{const y=n.allFundingAccounts.find(f=>f.id===d),_=n.allFundingAccounts.findIndex(f=>f.id===n.primaryFundingAccount?.id)+1,E=n.allFundingAccounts.findIndex(f=>f.id===d)+1;O.trackCardsPaymentAccountChangeClick(g,p,{oldPaymentAccountName:n.primaryFundingAccount?.label??"",oldPaymentAccountBalance:B(n.primaryFundingAccount?.accountBalance?.available?.amount??0),newPaymentAccountName:y?.label??"",newPaymentAccountBalance:B(y?.accountBalance?.available?.amount??0),isOldPaymentAccountRecommended:n.primaryFundingAccount?.accType==="depositAccount",isNewPaymentAccountRecommended:y?.accType==="depositAccount",oldPaymentAccountPosition:_,newPaymentAccountPosition:E,numberOfPaymentAccounts:n.allFundingAccounts.length}),e(Ae(a,"charge_card_setup",d,S))},onEnableChargeCardSuccess:()=>{e(Sn()),t("../",{relative:"path"})},onBackClick:()=>{c?.companyChargeCardInfo?.info?.isChargeCardEnabled||c?.companyDebitCardInfo?.info?.isDebitCardEnabled?t("../",{relative:"path"}):t("../..",{relative:"path"})},onNavigateToDashboard:()=>{t("../../dashboard")},onCompanyOfficerUpdated:(d,S)=>{e(Ie({officerType:d,fileIds:S}))},onSendForVerificationClick:d=>{l===!0&&s===!0?e(z(a,d,"charge_cards__debit_cards",!0,!0,!0)):l===!0?e(z(a,d,"charge_cards",!0,!0,!0)):s===!0&&e(z(a,d,"debit_cards",!0,!0,!0))},updateFilesEntity:d=>{e(ie({files:d}))},onDeleteFile:d=>{e(ae(d))},onEditFileName:(d,S)=>{e(te(d,S.split(".")[0]))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onUpdateAutoPayClick:d=>{e(gn(a,d))}}})(Yn),St=()=>{const e=Y(),o=ee(),t=ne(),{tenantEmailDomain:a}=G(),c=se(),n=P(L=>V(L)),{useDynamicConfig:s,useFeatureGate:l}=oe(),i=o.state?.pathnameStackToGoBack?.[0],{configValue:r}=s(X.zeniAccountsConfig),{configValue:p}=s(X.zeniCardsConfig),g=p.credit_card_auto_pay_threshold_by_company_id?.[n.companyId]??p.default_credit_card_auto_pay_threshold??80,{isFeatureEnabled:C}=l(K.isDebitCardFeatureEnabled),{isFeatureEnabled:I}=l(K.isChargeCardFeatureEnabled),{isFeatureEnabled:k}=l(K.isEarlyPayFeatureEnabled),{isFeatureEnabled:d}=l(K.isCardPolicyEnabled),S=P(L=>un(L,n.companyId)),y=dn(S.controllers),_=!!n.company?.companyChargeCardInfo.isChargeCardEnabled,E=!!n.company?.companyDebitCardInfo.isDebitCardEnabled,f=ln(C,n),b=yt({isDebitCardFeatureEnabled:C,isBankingOnlyTenant:f}),D=pn(n),A=mn(n),m=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,v=ft({isCardsOnlyTenant:D,isChargeCardFeatureEnabled:I,isBookKeepingTenant:A,isDebitCardProductVisible:b,chargeCardsCreditAccountLimit:m}),j=b&&v===!1,F=b===!1&&v,w=ye(r),R=yn(c?.loggedInUserRoleMap),H=Ce(c?.loggedInUserRoleMap),[ge,Se]=h.useState(!1),[M,ue]=h.useState(!1),Z=P(L=>L.chargeCardSetupViewState.fetchState),T=U.getSignedInUserTenant(a)?.companyId??n.companyId,Ve=U.getSignedInUser(),de=L=>{Se(L)},Be=P(L=>fn(L,T));if(Ve==null)throw Error("Can't access charge card setup page without signing in...");h.useEffect(()=>{M||Z!=="Not-Started"||T==null?M||Z!=="Completed"||T==null||n.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(le(T,!1,!0)):(ue(!0),t(le(T,!0)))},[M,Z,T,t]);const be=!!n.company?.companyChargeCardInfo.isChargeCardTOSAccepted,q=!!n.company?.companyDebitCardInfo.isDebitCardTOSAccepted,je=mt(v,b,E,_);return be||q?be||q?u.jsxs(u.Fragment,{children:[u.jsx(ce,{analytics:O,onLoad:()=>{O.trackPageLoaded($.Event.cardsSetupVisited),O.trackCardsCardSetupView(y,je,i==null?"Cards Setup":i.includes("cards/promo")?"Promo":i.includes("cards")?"Settings":"Cards Tab")}}),u.jsx(fe,{isAppContentDrawerOpen:ge,handleDrawerToggle:de}),u.jsx(gt,{autoPayThreshold:g,navigate:e,location:o,companyId:T,currentTenant:n,isEarlyPayEnabled:k,isChargeCardTOSAccepted:be,isDebitCardTOSAccepted:q,isUserChargeCardAdmin:R,isCardPolicyEnabled:d,isDebitCardOnlyEnabled:j,isCreditCardOnlyEnabled:F,chargeCardSetUpView:Be,isCreditCardProductVisible:v,isDebitCardFeatureEnabled:b,isChargeCardSetupEnabled:_,isDebitCardSetupEnabled:E,businessVerificationStatus:n.companyBillPayInfo?.info?.businessVerificationStatus,controllerEmails:y,productInformation:je,onClickMenuIcon:()=>{de(!0)},hasZeniAccountsAdminAccess:H,accountsPromoConfig:w})]}):u.jsx(De,{fetchState:"Not-Started"}):u.jsx(x,{to:"../promo"})},bt=Fe.div`
|
|
10
10
|
display: flex;
|
|
11
11
|
height: 100%;
|
|
12
12
|
width: 100%;
|
|
@@ -14,11 +14,11 @@ import{j as u}from"./liveblocks-DJRxBaIV.js";import{h as Y,g as ee,u as ne,i as
|
|
|
14
14
|
flex-direction: column;
|
|
15
15
|
align-items: center;
|
|
16
16
|
background-color: ${e=>e.theme.colors.grey4};
|
|
17
|
-
`,ht=W(function(e,o){const{isUserRemiAdmin:t,companyId:a}=o,c=V(e),n=Cn(e),s=In(e,a),l=U.getSignedInUser(),i=c.tenantId,r={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i??""},p=t&&s.updateStatus.fetchState!=="In-Progress"&&s.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&s.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&s.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",g=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{remiSetupView:s,isDisabled:p,remiApprovalView:n,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:g,meetingUrl:"https://meetings.hubspot.com/niharn/demo-reimbursements?embed=true",analytics:O,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:r}},function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{updateMileageDetails:n=>{const{mileageAmount:s,mileageUnit:l,mileageCurrencyCode:i,mileageCurrencySymbol:r,denomination:p,denominationSymbol:g,mileageAmountInDenomination:C,description:I}=n;e(kn({mileageDetails:{mileageUnitAmount:{amount:s,currencyCode:i,currencySymbol:r},denomination:p,denominationSymbol:g,mileageAmountInDenomination:C,mileageCurrencyCode:i,mileageCurrencySymbol:r,mileageUnit:l,description:I}}))},onSaveMileageClick:n=>{e(An(a)),O.trackReimbursementMileageRateSave(n)},onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyReimbursementInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(pe(a,!1,!0))},onSetupApprovalRulesSectionClick:()=>{t("../approval-rules")},onFetchLinkTokenClick:(n,s)=>{e(we("reimbursement_setup",n,s))},onEstablishConnectionClick:n=>{e(Pe(n,a,"reimbursement_setup","reimbursement"))},onUpdatePaymentAccountStatus:(n,s,l)=>{e(Ee(n,s,"reimbursement","reimbursement_setup",l))},onUpdatePaymentAccountLoginStatus:(n,s)=>{e(ve(!1,n,"reimbursement","reimbursement_setup",s))},onEstablishConnectionSuccess:()=>{e(pe(a,!0))},onEnableRemiClick:()=>{e(J(a,"reimbursement"))},onUpdateAccountClick:(n,s,l)=>{e(l==="paymentAccount"?ke(n,s,"reimbursement","reimbursement_setup"):_e("reimbursement_setup",n,s))},onEnableRemiSuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyReimbursementInfo?.info?.isReimbursementEnabled!=null&&c.companyReimbursementInfo.info.isReimbursementEnabled===!1?t("../.."):t("../",{relative:"path"})},onCompanyOfficerUpdated:(n,s)=>{e(Ie({officerType:n,fileIds:s}))},onSendForVerificationClick:n=>{e(z(a,n,"reimbursement",!0,!0,!0))},updateFilesEntity:n=>{e(ie({files:n}))},onDeleteFile:n=>{e(ae(n))},onEditFileName:(n,s)=>{e(te(n,s.split(".")[0]))},onUpdatePrimaryFundingAccount:(n,s)=>{e(Ae(a,"reimbursement_setup",n,s))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}})(et),Ct=()=>{const e=Y(),o=ee(),t=ne(),{tenantEmailDomain:a}=G(),c=se(),{useDynamicConfig:n}=oe(),s=Te(),{configValue:l}=n(X.zeniAccountsConfig),i=ye(l),r=bn(c?.loggedInUserRoleMap),p=Ce(c?.loggedInUserRoleMap),[g,C]=h.useState(!1),I=h.useRef(!1),[k,d]=h.useState(!1),S=P(m=>m.remiSetupViewState.fetchState),y=P(m=>V(m)),_=P(m=>m.remiSetupApproverViewState.fetchState),{isApprovalRulesV3Enabled:v,isLoading:f}=Ye(y?.tenantId),b=U.getSignedInUserTenant(a)?.companyId??y.companyId,D=U.getSignedInUser(),A=m=>{C(m)};if(D==null)throw Error("Can't access reimbursement setup page without signing in...");if(h.useEffect(()=>{I.current||S!=="Not-Started"||b==null?I.current||S!=="Completed"||b==null||y.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(I.current=!0,t(pe(b,!1,!0))):(I.current=!0,t(pe(b,!0)))},[S,b,t]),h.useEffect(()=>{k||_!=="Not-Started"||f||(d(!0),t(hn(!0,!1,!1,v)))},[k,_,f,v,t]),y.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1)return u.jsx(x,{to:"../promo"});if(y.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!0){const m=E=>E.trackPageLoaded($.Event.reimbursementSetup);return u.jsxs(bt,{children:[u.jsx(ce,{analytics:O,onLoad:E=>m(E)}),u.jsx(fe,{isAppContentDrawerOpen:g,handleDrawerToggle:A}),u.jsx(ht,{navigate:e,location:o,companyId:b,currentTenant:y,isUserRemiAdmin:r,onClickMenuIcon:()=>{A(!0)},hasZeniAccountsAdminAccess:p,accountsPromoConfig:i})]})}return u.jsx(De,{fetchState:"In-Progress",style:{backgroundColor:s.colors.grey5}})},It=W(function(e,o){const{businessVerificationDetails:t,productType:a}=o,c=V(e),n=U.getSignedInUser(),s=c.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:s??""},i=Dn(o.roleMap)&&t.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",r=Un(e.companyConfigState),p=On(e.userRoleConfigState),g=a==="zeni_treasury"?Ke(e):void 0;return{businessVerificationDetails:t,verficationDetailsFetchState:t.fetchState,isRefreshingViewInBackground:t.isRefreshingViewInBackground,allNationalityCountries:t.allNationalityCountries,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:i,allIndustries:r.companyIndustries??[],companyTitles:p.companyTitles,transferDetails:g}},function(e,o){const{companyId:t,productType:a,currentTenant:c,navigate:n,location:s}=o,{tenantEmailDomain:l}=c;return{onCompanyDetailsChanged:i=>{const{companyDescription:r,companyIndustry:p,companyIndustryType:g,companyLegalName:C,companyTaxId:I,companyWebsite:k,companyPhone:d,primaryContactEmail:S,primaryContactName:y,primaryContactUserId:_,primaryContactSyncToken:v,syncToken:f,fileIds:b,incDate:D,typeOfIncorporation:A,stateOfIncorporation:m,sourceOfFunds:E,companySubIndustry:j,countriesOfOperations:F,companySourceOfFunds:w,companySourceOfFundsDescription:R,transactionVolume:H,transactionVolumeDescription:ge,purposeOfAccount:Se,purposeOfAccountDescription:M,regulatedStatus:ue,regulatedStatusDescription:Z,usNexus:T,usNexusTypes:Ve}=i,de=g?.selectedOption,Be={companyId:t,companyDescription:r,companyIndustry:p.selectedOption,companyIndustryType:de==null||de===""?void 0:de,companyLegalName:C,taxIdOrEIN:I,website:k!=""&&k!=null?Rn(k):void 0,phone:d,syncToken:f,fileIds:b,incDate:D!=null?Re(D?.toString()):D,typeOfIncorporation:A?.selectedOption??"",stateOfIncorporation:m?.selectedOption??"",sourceOfFunds:E?.selectedOption??"",companySubIndustry:j?.selectedOption??"",countriesOfOperations:F?.selectedOptions.map(K=>K.length===2?K:Me(K))??[],companySourceOfFunds:w?.selectedOption??"",companySourceOfFundsDescription:R,transactionVolume:H?.selectedOption??"",transactionVolumeDescription:ge,purposeOfAccount:Se?.selectedOption??"",purposeOfAccountDescription:M,regulatedStatus:ue??"",regulatedStatusDescription:Z,usNexus:T,usNexusTypes:Ve?.selectedOptions??[]},be={userId:_,firstName:y.firstName,lastName:y.lastName,email:S,syncToken:v};e(Ne({companyDetails:Be,primaryContactDetails:be}))},onCompanyOfficerUpdated:i=>{const r=i.map(p=>{const{officerType:g,userId:C,name:I,email:k,nationalityCountryCode:d,ssn:S,dob:y,phone:_,syncToken:v,selectDocument:f,role:b,ownership:D,isSelectedForVerification:A,userVerificationStatus:m,treasuryUserVerificationStatus:E,fileIds:j}=p;let F;return f.selectDocumentType==="driverLicense"?F="driving_license":f.selectDocumentType==="passport"?F="passport":f.selectDocumentType==="stateId"?F="id_document":f.selectDocumentType==="ssnCard"&&(F="social_security_card"),{officerType:g,userId:C,firstName:I.firstName,lastName:I.lastName,email:k,ssn:S,nationalityCountryCode:d?.selectedOption!=null?Me(d.selectedOption):void 0,phone:_,birthday:y!=null?Re(y?.toString()):y,syncToken:v,titleAtCompany:b.selectedOption,ownershipInCompany:D,documentTypeSelectedForVerification:F,isSelectedForVerification:A,userVerificationStatus:m,treasuryUserVerificationStatus:E,fileIds:j,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}});e(Ne({officers:r}))},onSaveDetailsClick:i=>{e(z(t,i,a))},onSendForVerificationClick:i=>{e(z(t,i,a,!0))},onAddressClick:i=>{const r=Qe(l,i),p=Le(s.state?.pathnameStackToGoBack,s.pathname),g=new URLSearchParams(s.search),C={};g.forEach((I,k)=>{C[k]=I}),n(r,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(C).length>0?C:void 0}})},onRegisteredAddressClick:i=>{const r=Qe(l,i),p=Le(s.state?.pathnameStackToGoBack,s.pathname),g=new URLSearchParams(s.search),C=Object.fromEntries(g.entries());n(r,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(C).length>0?C:void 0}})},onBackClick:()=>{e(jn({companyId:t})),n("../setup")},updateFilesEntity:i=>{e(ie({files:i}))},onDeleteFile:i=>{e(ae(i))},onDeleteFileList:i=>{e(Je(i))},onEditFileName:(i,r)=>{e(te(i,r.split(".")[0]))},onGetOtp:i=>{e(We(i,"SpendManagementSetup"))},onResendOtp:i=>{e(Ge(i,"SpendManagementSetup"))},onVerifyOtp:(i,r)=>{e($e(i,r,"SpendManagementSetup"))},saveNewAddressInLocalStore:(i,r)=>{e(xn({addressType:i,addressToCreate:r}))},onExecuteTreasuryTransfer:()=>{e(qe())},onOverlayClose:()=>{e(Oe())},onIdentityDocumentUploadedForAutofill:i=>{if(t==null)return;const r=Vn(i.documentType);r!=null&&e(Bn({target:"setup",companyId:t,officerType:i.officerType,fileId:i.fileId,documentType:r}))},onCompanyDocumentUploadedForAutofill:i=>{t!=null&&e(Fn({target:"setup",companyId:t,fileId:i.fileId,documentType:i.documentType}))}}})(nt),At=({productType:e,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:t})=>{const a=Y(),c=ee(),n=ne(),[s]=en(),l=s.get("showStepProgress"),i=s.get("isTransferInitiated"),[r,p]=h.useState(!1),{tenantEmailDomain:g}=G(),C=se(),{useDynamicConfig:I}=oe(),k=Te(),{configValue:d}=I(X.zeniAccountsConfig),S=ye(d),y=P(m=>{switch(e){case"zeni_accounts":return m.zeniAccountSetupViewState.fetchState;case"reimbursement":return m.remiSetupViewState.fetchState;case"charge_cards":return m.chargeCardSetupViewState.fetchState;case"zeni_treasury":return m.treasurySetupViewState.fetchState;default:return m.billPaySetupViewState.fetchState}}),_=P(m=>m.companyConfigState.fetchState),v=P(m=>m.userRoleConfigState.fetchState),f=P(m=>V(m)),b=f.companyId??U.getSignedInUserTenant(g)?.companyId;if(h.useEffect(()=>{_==="Not-Started"&&n(_n()),v==="Not-Started"&&n(vn(!0))},[_,v,n]),h.useEffect(()=>{if(!r&&y==="Not-Started"&&b!=null)switch(p(!0),e){case"zeni_accounts":n(me(b,!0));break;case"zeni_treasury":n(he(b,!0));break;case"reimbursement":n(pe(b,!0));break;case"charge_cards":n(le(b,!0));break;default:n(Q(b,!0))}},[r,y,b,n]),U.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let D;switch(e){case"zeni_accounts":D=f.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":D=f.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":D=f.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||f.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":D=f.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:D=f.companyBillPayInfo?.info?.isBillPayTOSAccepted}const A=P(m=>{let E;switch(e){case"zeni_accounts":E=Tn(m,b);break;case"zeni_treasury":E=He(m,b);break;case"charge_cards":E=wn(m,b);break;case"reimbursement":E=Pn(m,b);break;default:E=En(m,b)}return E});return D===!1?null:A.fetchState==="Completed"&&D===!0&&C?.loggedInUserRoleMap!=null?u.jsxs(u.Fragment,{children:[u.jsx(ce,{analytics:O,onLoad:m=>(E=>{switch(e){case"zeni_accounts":return E.trackPageLoaded($.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return E.trackPageLoaded($.Event.reimbursementBusinessVerification);default:return E.trackPageLoaded($.Event.billPayBusinessVerification,xe(c)?"Settings":void 0)}})(m)}),u.jsx(It,{businessVerificationDetails:A,navigate:a,location:c,companyId:b,analytics:O,currentTenant:f,productType:e,roleMap:C.loggedInUserRoleMap,isSettings:xe(c),isOverlay:!0,isStepInProgress:l!=null,isTreasuryTransferInitiated:i!=null,onClickMenuIcon:()=>{},maxInsuredAmount:S.maxInsuredAmount,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:t})]}):u.jsx(De,{fetchState:"In-Progress",style:{backgroundColor:k.colors.grey5}})},kt={overlayWidth:new at(100,100,59)},_t=W(function(e,o){const{isUserZeniAccountsAdmin:t,companyId:a,accountsPromoConfig:c}=o,n=V(e),s=U.getSignedInUser(),l=n.tenantId,i={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:l??""},r=Xe(e,a),p=He(e,a),g=t&&r.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&r.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",C=Mn(e),I=C.transactions,k=Ke(e),d=C.accountSummary?.totalBalance?.amount,S=I.length===0||d===0;return{treasurySetupView:r,businessVerificationDetails:p,connectedAccountProvider:n.company?.featuresActivationInfo.connectedAccountProvider??"",transactions:I,transferDetails:k,isFirstTransfer:S,isDisabled:g,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:O,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:i,isOnSetup:!0,maxInsuredAmount:c.maxInsuredAmount}},function(e,o){const{navigate:t,companyId:a,currentTenant:c,isAllocationDone:n,analytics:s,treasurySetupView:l}=o;return{onTransferSaveChangesToLocalStore:i=>{e($n(i))},onBusinessVerificationSectionClick:(i,r)=>{let p="../verification";i&&(p+="?showStepProgress=true",r&&(p+="&isTransferInitiated=true")),t(p),c?.company?.companyTreasuryInfo!=null&&c?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="pending_review"&&e(he(a,!1,!0))},onFetchLinkTokenClick:(i,r)=>{e(we("treasury_setup",i,r))},onEstablishConnectionClick:i=>{e(Pe(i,a,"treasury_setup","zeni_treasury"))},onUpdatePaymentAccountStatus:(i,r,p)=>{e(Ee(i,r,"zeni_treasury","treasury_setup",p))},onUpdatePaymentAccountLoginStatus:(i,r)=>{e(ve(!1,i,"zeni_treasury","treasury_setup",r))},onEstablishConnectionSuccess:()=>{e(he(a,!0))},onEnableTreasuryClick:()=>{e(J(a,"zeni_treasury"))},onUpdateTreasuryClick:(i,r,p)=>{e(p==="paymentAccount"?ke(i,r,"zeni_treasury","treasury_setup"):_e("treasury_setup",i,r))},onUpdatePrimaryFundingAccount:(i,r)=>{e(Ae(a,"treasury_setup",i,r))},onNavigateToDashboard:()=>{t(c?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="verified"?"../":"../../")},onCompanyOfficerUpdated:(i,r)=>{e(Ie({officerType:i,fileIds:r}))},onSendForVerificationClick:(i,r)=>{if(e(z(a,i,"zeni_treasury",!0,!0,!0)),!n){const p=l.fundAllocationLocalData;s.trackTreasuryPortfolioConfirm(p.riskScore,Ze(p)),e(ze(!1))}r===!0&&e(qe())},updateFilesEntity:i=>{e(ie({files:i}))},onDeleteFile:i=>{e(ae(i))},onEditFileName:(i,r)=>{e(te(i,r.split(".")[0]))},onAdditionalVerificationFieldsChanged:i=>{const{sourceOfFunds:r}=i;e(Qn({sourceOfFunds:r?.selectedOption??""}))},onUpdateFundAllocation:i=>{s.trackTreasuryAllocationAction("update",Ze(i)),e(Zn(i))},onConfirmFundAllocation:()=>{e(ze(n))},onSignUpClick:()=>{o.isUserZeniAccountsAdmin?window.open("../checking/promo","_blank","noopener,noreferrer"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank","noopener,noreferrer")},onOverlayClose:()=>{e(Oe())}}})(it),vt=()=>{const e=Y(),o=ee(),t=ne(),a=Te(),c=tt(),{tenantEmailDomain:n}=G(),{useDynamicConfig:s}=oe(),l=se(),[i,r]=h.useState(!1),p=Ce(l?.loggedInUserRoleMap),{configValue:g}=s(X.zeniAccountsConfig),C=ye(g),[I,k]=h.useState(!1),[d,S]=h.useState(!1),[y,_]=h.useState(!1),[v,f]=h.useState(!1),[b,D]=h.useState(!1),A=P(T=>T.treasurySetupViewState.fetchState),m=P(T=>T.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState),E=P(T=>T.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),j=P(T=>T.treasuryDetailState.transactionsState?.fetchState),F=P(T=>V(T)),w=U.getSignedInUserTenant(n)?.companyId??F.companyId,R=P(T=>Xe(T,w)),H=R.isAtomicAccountExists,ge=!!F.companyZeniAccountInfo?.info?.isZeniAccountEnabled,Se=U.getSignedInUser(),M=T=>{k(T)};if(Se==null)throw Error("Can't access treasury setup page without signing in...");h.useEffect(()=>{d||A!=="Not-Started"||w==null||(S(!0),t(he(w,!0,!1)))},[d,A,w,t]),h.useEffect(()=>{y||m!=="Not-Started"||w==null||(_(!0),t(Nn()))},[y,m,w,t]),h.useEffect(()=>{v||E!=="Not-Started"||w==null||(f(!0),t(zn()))},[v,E,w,t]),h.useEffect(()=>{b||j!=="Not-Started"||w==null||(D(!0),t(Ln(!0)))},[b,j,w,t]);const ue=F.companyTreasuryInfo?.info?.businessVerificationStatus?.code,Z=ue==="pending_review"||ue==="verified";return h.useEffect(()=>{i||A!=="Completed"||H||Z||!o.pathname.includes("setup")||r(!0)},[A,H,Z]),F.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1?u.jsx(x,{to:"../promo"}):u.jsxs(u.Fragment,{children:[u.jsx(ce,{analytics:O,onLoad:()=>{}}),u.jsx(fe,{isAppContentDrawerOpen:I,handleDrawerToggle:M}),u.jsx(rt,{onClose:()=>{t(Oe()),e("../setup")},anchor:"right",open:o.pathname.includes("verification"),transitionDuration:i?0:250,PaperProps:{style:{width:kt.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:i?"transparent":a.colors.black,opacity:.75,cursor:"pointer"}}},children:u.jsx(Et,{onClick:T=>T.stopPropagation(),children:u.jsx(At,{productType:"zeni_treasury",isBusinessVerificationDrawerOpen:!0,closeDrawerHandler:()=>{t(Oe()),e("../setup")}})})}),u.jsx(_t,{navigate:e,location:o,companyId:w,currentTenant:F,isUserZeniAccountsAdmin:p,accountsPromoConfig:C,isAccountsEnabled:ge,isAllocationDone:H,analytics:O,treasurySetupView:R,onClickMenuIcon:()=>{M(!0)},showTreasurySetupOverlay:i,setShowTreasurySetupOverlay:r})]})},Et=Fe(ut)`
|
|
17
|
+
`,ht=W(function(e,o){const{isUserRemiAdmin:t,companyId:a}=o,c=V(e),n=Cn(e),s=In(e,a),l=U.getSignedInUser(),i=c.tenantId,r={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i??""},p=t&&s.updateStatus.fetchState!=="In-Progress"&&s.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&s.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&s.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",g=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{remiSetupView:s,isDisabled:p,remiApprovalView:n,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:g,meetingUrl:"https://meetings.hubspot.com/niharn/demo-reimbursements?embed=true",analytics:O,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:r}},function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{updateMileageDetails:n=>{const{mileageAmount:s,mileageUnit:l,mileageCurrencyCode:i,mileageCurrencySymbol:r,denomination:p,denominationSymbol:g,mileageAmountInDenomination:C,description:I}=n;e(kn({mileageDetails:{mileageUnitAmount:{amount:s,currencyCode:i,currencySymbol:r},denomination:p,denominationSymbol:g,mileageAmountInDenomination:C,mileageCurrencyCode:i,mileageCurrencySymbol:r,mileageUnit:l,description:I}}))},onSaveMileageClick:n=>{e(An(a)),O.trackReimbursementMileageRateSave(n)},onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyReimbursementInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(pe(a,!1,!0))},onSetupApprovalRulesSectionClick:()=>{t("../approval-rules")},onFetchLinkTokenClick:(n,s)=>{e(we("reimbursement_setup",n,s))},onEstablishConnectionClick:n=>{e(Pe(n,a,"reimbursement_setup","reimbursement"))},onUpdatePaymentAccountStatus:(n,s,l)=>{e(ve(n,s,"reimbursement","reimbursement_setup",l))},onUpdatePaymentAccountLoginStatus:(n,s)=>{e(Ee(!1,n,"reimbursement","reimbursement_setup",s))},onEstablishConnectionSuccess:()=>{e(pe(a,!0))},onEnableRemiClick:()=>{e(J(a,"reimbursement"))},onUpdateAccountClick:(n,s,l)=>{e(l==="paymentAccount"?ke(n,s,"reimbursement","reimbursement_setup"):_e("reimbursement_setup",n,s))},onEnableRemiSuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyReimbursementInfo?.info?.isReimbursementEnabled!=null&&c.companyReimbursementInfo.info.isReimbursementEnabled===!1?t("../.."):t("../",{relative:"path"})},onCompanyOfficerUpdated:(n,s)=>{e(Ie({officerType:n,fileIds:s}))},onSendForVerificationClick:n=>{e(z(a,n,"reimbursement",!0,!0,!0))},updateFilesEntity:n=>{e(ie({files:n}))},onDeleteFile:n=>{e(ae(n))},onEditFileName:(n,s)=>{e(te(n,s.split(".")[0]))},onUpdatePrimaryFundingAccount:(n,s)=>{e(Ae(a,"reimbursement_setup",n,s))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}})(et),Ct=()=>{const e=Y(),o=ee(),t=ne(),{tenantEmailDomain:a}=G(),c=se(),{useDynamicConfig:n}=oe(),s=Te(),{configValue:l}=n(X.zeniAccountsConfig),i=ye(l),r=bn(c?.loggedInUserRoleMap),p=Ce(c?.loggedInUserRoleMap),[g,C]=h.useState(!1),I=h.useRef(!1),[k,d]=h.useState(!1),S=P(m=>m.remiSetupViewState.fetchState),y=P(m=>V(m)),_=P(m=>m.remiSetupApproverViewState.fetchState),{isApprovalRulesV3Enabled:E,isLoading:f}=Ye(y?.tenantId),b=U.getSignedInUserTenant(a)?.companyId??y.companyId,D=U.getSignedInUser(),A=m=>{C(m)};if(D==null)throw Error("Can't access reimbursement setup page without signing in...");if(h.useEffect(()=>{I.current||S!=="Not-Started"||b==null?I.current||S!=="Completed"||b==null||y.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(I.current=!0,t(pe(b,!1,!0))):(I.current=!0,t(pe(b,!0)))},[S,b,t]),h.useEffect(()=>{k||_!=="Not-Started"||f||(d(!0),t(hn(!0,!1,!1,E)))},[k,_,f,E,t]),y.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1)return u.jsx(x,{to:"../promo"});if(y.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!0){const m=v=>v.trackPageLoaded($.Event.reimbursementSetup);return u.jsxs(bt,{children:[u.jsx(ce,{analytics:O,onLoad:v=>m(v)}),u.jsx(fe,{isAppContentDrawerOpen:g,handleDrawerToggle:A}),u.jsx(ht,{navigate:e,location:o,companyId:b,currentTenant:y,isUserRemiAdmin:r,onClickMenuIcon:()=>{A(!0)},hasZeniAccountsAdminAccess:p,accountsPromoConfig:i})]})}return u.jsx(De,{fetchState:"In-Progress",style:{backgroundColor:s.colors.grey5}})},It=W(function(e,o){const{businessVerificationDetails:t,productType:a}=o,c=V(e),n=U.getSignedInUser(),s=c.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:s??""},i=Dn(o.roleMap)&&t.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",r=Un(e.companyConfigState),p=On(e.userRoleConfigState),g=a==="zeni_treasury"?qe(e):void 0;return{businessVerificationDetails:t,verficationDetailsFetchState:t.fetchState,isRefreshingViewInBackground:t.isRefreshingViewInBackground,allNationalityCountries:t.allNationalityCountries,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:i,allIndustries:r.companyIndustries??[],companyTitles:p.companyTitles,transferDetails:g}},function(e,o){const{companyId:t,productType:a,currentTenant:c,navigate:n,location:s}=o,{tenantEmailDomain:l}=c;return{onCompanyDetailsChanged:i=>{const{companyDescription:r,companyIndustry:p,companyIndustryType:g,companyLegalName:C,companyTaxId:I,companyWebsite:k,companyPhone:d,primaryContactEmail:S,primaryContactName:y,primaryContactUserId:_,primaryContactSyncToken:E,syncToken:f,fileIds:b,incDate:D,typeOfIncorporation:A,stateOfIncorporation:m,sourceOfFunds:v,companySubIndustry:j,countriesOfOperations:F,companySourceOfFunds:w,companySourceOfFundsDescription:R,transactionVolume:H,transactionVolumeDescription:ge,purposeOfAccount:Se,purposeOfAccountDescription:M,regulatedStatus:ue,regulatedStatusDescription:Z,usNexus:T,usNexusTypes:Ve}=i,de=g?.selectedOption,Be={companyId:t,companyDescription:r,companyIndustry:p.selectedOption,companyIndustryType:de==null||de===""?void 0:de,companyLegalName:C,taxIdOrEIN:I,website:k!=""&&k!=null?Rn(k):void 0,phone:d,syncToken:f,fileIds:b,incDate:D!=null?Re(D?.toString()):D,typeOfIncorporation:A?.selectedOption??"",stateOfIncorporation:m?.selectedOption??"",sourceOfFunds:v?.selectedOption??"",companySubIndustry:j?.selectedOption??"",countriesOfOperations:F?.selectedOptions.map(q=>q.length===2?q:Me(q))??[],companySourceOfFunds:w?.selectedOption??"",companySourceOfFundsDescription:R,transactionVolume:H?.selectedOption??"",transactionVolumeDescription:ge,purposeOfAccount:Se?.selectedOption??"",purposeOfAccountDescription:M,regulatedStatus:ue??"",regulatedStatusDescription:Z,usNexus:T,usNexusTypes:Ve?.selectedOptions??[]},be={userId:_,firstName:y.firstName,lastName:y.lastName,email:S,syncToken:E};e(Ne({companyDetails:Be,primaryContactDetails:be}))},onCompanyOfficerUpdated:i=>{const r=i.map(p=>{const{officerType:g,userId:C,name:I,email:k,nationalityCountryCode:d,ssn:S,dob:y,phone:_,syncToken:E,selectDocument:f,role:b,ownership:D,isSelectedForVerification:A,userVerificationStatus:m,treasuryUserVerificationStatus:v,fileIds:j}=p;let F;return f.selectDocumentType==="driverLicense"?F="driving_license":f.selectDocumentType==="passport"?F="passport":f.selectDocumentType==="stateId"?F="id_document":f.selectDocumentType==="ssnCard"&&(F="social_security_card"),{officerType:g,userId:C,firstName:I.firstName,lastName:I.lastName,email:k,ssn:S,nationalityCountryCode:d?.selectedOption!=null?Me(d.selectedOption):void 0,phone:_,birthday:y!=null?Re(y?.toString()):y,syncToken:E,titleAtCompany:b.selectedOption,ownershipInCompany:D,documentTypeSelectedForVerification:F,isSelectedForVerification:A,userVerificationStatus:m,treasuryUserVerificationStatus:v,fileIds:j,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}});e(Ne({officers:r}))},onSaveDetailsClick:i=>{e(z(t,i,a))},onSendForVerificationClick:i=>{e(z(t,i,a,!0))},onAddressClick:i=>{const r=Qe(l,i),p=Le(s.state?.pathnameStackToGoBack,s.pathname),g=new URLSearchParams(s.search),C={};g.forEach((I,k)=>{C[k]=I}),n(r,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(C).length>0?C:void 0}})},onRegisteredAddressClick:i=>{const r=Qe(l,i),p=Le(s.state?.pathnameStackToGoBack,s.pathname),g=new URLSearchParams(s.search),C=Object.fromEntries(g.entries());n(r,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(C).length>0?C:void 0}})},onBackClick:()=>{e(jn({companyId:t})),n("../setup")},updateFilesEntity:i=>{e(ie({files:i}))},onDeleteFile:i=>{e(ae(i))},onDeleteFileList:i=>{e(Je(i))},onEditFileName:(i,r)=>{e(te(i,r.split(".")[0]))},onGetOtp:i=>{e(We(i,"SpendManagementSetup"))},onResendOtp:i=>{e(Ge(i,"SpendManagementSetup"))},onVerifyOtp:(i,r)=>{e($e(i,r,"SpendManagementSetup"))},saveNewAddressInLocalStore:(i,r)=>{e(xn({addressType:i,addressToCreate:r}))},onExecuteTreasuryTransfer:()=>{e(Ke())},onOverlayClose:()=>{e(Oe())},onIdentityDocumentUploadedForAutofill:i=>{if(t==null)return;const r=Vn(i.documentType);r!=null&&e(Bn({target:"setup",companyId:t,officerType:i.officerType,fileId:i.fileId,documentType:r}))},onCompanyDocumentUploadedForAutofill:i=>{t!=null&&e(Fn({target:"setup",companyId:t,fileId:i.fileId,documentType:i.documentType}))}}})(nt),At=({productType:e,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:t})=>{const a=Y(),c=ee(),n=ne(),[s]=en(),l=s.get("showStepProgress"),i=s.get("isTransferInitiated"),[r,p]=h.useState(!1),{tenantEmailDomain:g}=G(),C=se(),{useDynamicConfig:I}=oe(),k=Te(),{configValue:d}=I(X.zeniAccountsConfig),S=ye(d),y=P(m=>{switch(e){case"zeni_accounts":return m.zeniAccountSetupViewState.fetchState;case"reimbursement":return m.remiSetupViewState.fetchState;case"charge_cards":return m.chargeCardSetupViewState.fetchState;case"zeni_treasury":return m.treasurySetupViewState.fetchState;default:return m.billPaySetupViewState.fetchState}}),_=P(m=>m.companyConfigState.fetchState),E=P(m=>m.userRoleConfigState.fetchState),f=P(m=>V(m)),b=f.companyId??U.getSignedInUserTenant(g)?.companyId;if(h.useEffect(()=>{_==="Not-Started"&&n(_n()),E==="Not-Started"&&n(En(!0))},[_,E,n]),h.useEffect(()=>{if(!r&&y==="Not-Started"&&b!=null)switch(p(!0),e){case"zeni_accounts":n(me(b,!0));break;case"zeni_treasury":n(he(b,!0));break;case"reimbursement":n(pe(b,!0));break;case"charge_cards":n(le(b,!0));break;default:n(Q(b,!0))}},[r,y,b,n]),U.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let D;switch(e){case"zeni_accounts":D=f.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":D=f.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":D=f.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||f.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":D=f.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:D=f.companyBillPayInfo?.info?.isBillPayTOSAccepted}const A=P(m=>{let v;switch(e){case"zeni_accounts":v=Tn(m,b);break;case"zeni_treasury":v=He(m,b);break;case"charge_cards":v=wn(m,b);break;case"reimbursement":v=Pn(m,b);break;default:v=vn(m,b)}return v});return D===!1?null:A.fetchState==="Completed"&&D===!0&&C?.loggedInUserRoleMap!=null?u.jsxs(u.Fragment,{children:[u.jsx(ce,{analytics:O,onLoad:m=>(v=>{switch(e){case"zeni_accounts":return v.trackPageLoaded($.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return v.trackPageLoaded($.Event.reimbursementBusinessVerification);default:return v.trackPageLoaded($.Event.billPayBusinessVerification,xe(c)?"Settings":void 0)}})(m)}),u.jsx(It,{businessVerificationDetails:A,navigate:a,location:c,companyId:b,analytics:O,currentTenant:f,productType:e,roleMap:C.loggedInUserRoleMap,isSettings:xe(c),isOverlay:!0,isStepInProgress:l!=null,isTreasuryTransferInitiated:i!=null,onClickMenuIcon:()=>{},maxInsuredAmount:S.maxInsuredAmount,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:t})]}):u.jsx(De,{fetchState:"In-Progress",style:{backgroundColor:k.colors.grey5}})},kt={overlayWidth:new at(100,100,59)},_t=W(function(e,o){const{isUserZeniAccountsAdmin:t,companyId:a,accountsPromoConfig:c}=o,n=V(e),s=U.getSignedInUser(),l=n.tenantId,i={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:l??""},r=Xe(e,a),p=He(e,a),g=t&&r.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&r.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",C=Mn(e),I=C.transactions,k=qe(e),d=C.accountSummary?.totalBalance?.amount,S=I.length===0||d===0;return{treasurySetupView:r,businessVerificationDetails:p,connectedAccountProvider:n.company?.featuresActivationInfo.connectedAccountProvider??"",transactions:I,transferDetails:k,isFirstTransfer:S,isDisabled:g,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:O,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:i,isOnSetup:!0,maxInsuredAmount:c.maxInsuredAmount}},function(e,o){const{navigate:t,companyId:a,currentTenant:c,isAllocationDone:n,analytics:s,treasurySetupView:l}=o;return{onTransferSaveChangesToLocalStore:i=>{e($n(i))},onBusinessVerificationSectionClick:(i,r)=>{let p="../verification";i&&(p+="?showStepProgress=true",r&&(p+="&isTransferInitiated=true")),t(p),c?.company?.companyTreasuryInfo!=null&&c?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="pending_review"&&e(he(a,!1,!0))},onFetchLinkTokenClick:(i,r)=>{e(we("treasury_setup",i,r))},onEstablishConnectionClick:i=>{e(Pe(i,a,"treasury_setup","zeni_treasury"))},onUpdatePaymentAccountStatus:(i,r,p)=>{e(ve(i,r,"zeni_treasury","treasury_setup",p))},onUpdatePaymentAccountLoginStatus:(i,r)=>{e(Ee(!1,i,"zeni_treasury","treasury_setup",r))},onEstablishConnectionSuccess:()=>{e(he(a,!0))},onEnableTreasuryClick:()=>{e(J(a,"zeni_treasury"))},onUpdateTreasuryClick:(i,r,p)=>{e(p==="paymentAccount"?ke(i,r,"zeni_treasury","treasury_setup"):_e("treasury_setup",i,r))},onUpdatePrimaryFundingAccount:(i,r)=>{e(Ae(a,"treasury_setup",i,r))},onNavigateToDashboard:()=>{t(c?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="verified"?"../":"../../")},onCompanyOfficerUpdated:(i,r)=>{e(Ie({officerType:i,fileIds:r}))},onSendForVerificationClick:(i,r)=>{if(e(z(a,i,"zeni_treasury",!0,!0,!0)),!n){const p=l.fundAllocationLocalData;s.trackTreasuryPortfolioConfirm(p.riskScore,Ze(p)),e(ze(!1))}r===!0&&e(Ke())},updateFilesEntity:i=>{e(ie({files:i}))},onDeleteFile:i=>{e(ae(i))},onEditFileName:(i,r)=>{e(te(i,r.split(".")[0]))},onAdditionalVerificationFieldsChanged:i=>{const{sourceOfFunds:r}=i;e(Qn({sourceOfFunds:r?.selectedOption??""}))},onUpdateFundAllocation:i=>{s.trackTreasuryAllocationAction("update",Ze(i)),e(Zn(i))},onConfirmFundAllocation:()=>{e(ze(n))},onSignUpClick:()=>{o.isUserZeniAccountsAdmin?window.open("../checking/promo","_blank","noopener,noreferrer"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank","noopener,noreferrer")},onOverlayClose:()=>{e(Oe())}}})(it),Et=()=>{const e=Y(),o=ee(),t=ne(),a=Te(),c=tt(),{tenantEmailDomain:n}=G(),{useDynamicConfig:s}=oe(),l=se(),[i,r]=h.useState(!1),p=Ce(l?.loggedInUserRoleMap),{configValue:g}=s(X.zeniAccountsConfig),C=ye(g),[I,k]=h.useState(!1),[d,S]=h.useState(!1),[y,_]=h.useState(!1),[E,f]=h.useState(!1),[b,D]=h.useState(!1),A=P(T=>T.treasurySetupViewState.fetchState),m=P(T=>T.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState),v=P(T=>T.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),j=P(T=>T.treasuryDetailState.transactionsState?.fetchState),F=P(T=>V(T)),w=U.getSignedInUserTenant(n)?.companyId??F.companyId,R=P(T=>Xe(T,w)),H=R.isAtomicAccountExists,ge=!!F.companyZeniAccountInfo?.info?.isZeniAccountEnabled,Se=U.getSignedInUser(),M=T=>{k(T)};if(Se==null)throw Error("Can't access treasury setup page without signing in...");h.useEffect(()=>{d||A!=="Not-Started"||w==null||(S(!0),t(he(w,!0,!1)))},[d,A,w,t]),h.useEffect(()=>{y||m!=="Not-Started"||w==null||(_(!0),t(Nn()))},[y,m,w,t]),h.useEffect(()=>{E||v!=="Not-Started"||w==null||(f(!0),t(zn()))},[E,v,w,t]),h.useEffect(()=>{b||j!=="Not-Started"||w==null||(D(!0),t(Ln(!0)))},[b,j,w,t]);const ue=F.companyTreasuryInfo?.info?.businessVerificationStatus?.code,Z=ue==="pending_review"||ue==="verified";return h.useEffect(()=>{i||A!=="Completed"||H||Z||!o.pathname.includes("setup")||r(!0)},[A,H,Z]),F.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1?u.jsx(x,{to:"../promo"}):u.jsxs(u.Fragment,{children:[u.jsx(ce,{analytics:O,onLoad:()=>{}}),u.jsx(fe,{isAppContentDrawerOpen:I,handleDrawerToggle:M}),u.jsx(rt,{onClose:()=>{t(Oe()),e("../setup")},anchor:"right",open:o.pathname.includes("verification"),transitionDuration:i?0:250,PaperProps:{style:{width:kt.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:i?"transparent":a.colors.black,opacity:.75,cursor:"pointer"}}},children:u.jsx(vt,{onClick:T=>T.stopPropagation(),children:u.jsx(At,{productType:"zeni_treasury",isBusinessVerificationDrawerOpen:!0,closeDrawerHandler:()=>{t(Oe()),e("../setup")}})})}),u.jsx(_t,{navigate:e,location:o,companyId:w,currentTenant:F,isUserZeniAccountsAdmin:p,accountsPromoConfig:C,isAccountsEnabled:ge,isAllocationDone:H,analytics:O,treasurySetupView:R,onClickMenuIcon:()=>{M(!0)},showTreasurySetupOverlay:i,setShowTreasurySetupOverlay:r})]})},vt=Fe(ut)`
|
|
18
18
|
display: flex;
|
|
19
19
|
min-height: 100%;
|
|
20
20
|
flex-direction: column;
|
|
21
|
-
`,Pt=W(function(e,o){const{isUserZeniAccountsAdmin:t,companyId:a}=o,c=V(e),n=U.getSignedInUser(),s=c.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:s??""},i=Gn(e,a),r=t&&i.updateStatus.fetchState!=="In-Progress"&&i.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&i.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&i.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly";return{zeniAccountSetUpView:i,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:r,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:O,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:l}},function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyZeniAccountInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(me(a,!1,!0))},onFetchLinkTokenClick:(n,s)=>{e(we("account_setup",n,s))},onEstablishConnectionClick:n=>{e(Pe(n,a,"account_setup","zeni_accounts"))},onUpdatePaymentAccountStatus:(n,s,l)=>{e(
|
|
21
|
+
`,Pt=W(function(e,o){const{isUserZeniAccountsAdmin:t,companyId:a}=o,c=V(e),n=U.getSignedInUser(),s=c.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:s??""},i=Gn(e,a),r=t&&i.updateStatus.fetchState!=="In-Progress"&&i.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&i.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&i.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly";return{zeniAccountSetUpView:i,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:r,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:O,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:l}},function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyZeniAccountInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(me(a,!1,!0))},onFetchLinkTokenClick:(n,s)=>{e(we("account_setup",n,s))},onEstablishConnectionClick:n=>{e(Pe(n,a,"account_setup","zeni_accounts"))},onUpdatePaymentAccountStatus:(n,s,l)=>{e(ve(n,s,"zeni_accounts","account_setup",l))},onUpdatePaymentAccountLoginStatus:(n,s)=>{e(Ee(!1,n,"zeni_accounts","account_setup",s))},onEstablishConnectionSuccess:()=>{e(me(a,!0))},onEnableZeniAccountClick:()=>{e(J(a,"zeni_accounts"))},onUpdateZeniAccountClick:(n,s,l)=>{e(l==="paymentAccount"?ke(n,s,"zeni_accounts","account_setup"):_e("account_setup",n,s))},onUpdatePrimaryFundingAccount:(n,s)=>{e(Ae(a,"account_setup",n,s))},onEnableZeniAccountSuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyZeniAccountInfo?.info?.isZeniAccountEnabled?t("../"):t("../../")},onNavigateToDashboard:()=>{t("../../dashboard")},onCompanyOfficerUpdated:(n,s)=>{e(Ie({officerType:n,fileIds:s}))},onSendForVerificationClick:n=>{e(z(a,n,"zeni_accounts",!0,!0,!0))},updateFilesEntity:n=>{e(ie({files:n}))},onDeleteFile:n=>{e(ae(n))},onEditFileName:(n,s)=>{e(te(n,s.split(".")[0]))}}})(st),wt=()=>{const e=Y(),o=ee(),t=ne(),{tenantEmailDomain:a}=G(),{useDynamicConfig:c}=oe(),n=se(),s=Ce(n?.loggedInUserRoleMap),{configValue:l}=c(X.zeniAccountsConfig),i=ye(l),[r,p]=h.useState(!1),[g,C]=h.useState(!1),I=P(_=>_.zeniAccountSetupViewState.fetchState),k=P(_=>V(_)),d=U.getSignedInUserTenant(a)?.companyId??k.companyId,S=U.getSignedInUser(),y=_=>{p(_)};if(S==null)throw Error("Can't access zeni bank account setup page without signing in...");if(h.useEffect(()=>{g||I!=="Not-Started"||d==null?g||I!=="Completed"||d==null||k.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(me(d,!1,!0)):(C(!0),t(me(d,!0)))},[g,I,d,t]),k.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted===!1)return u.jsx(x,{to:"../promo"});{const _=E=>E.trackPageLoaded($.Event.zeniAccountsSetup);return u.jsxs(u.Fragment,{children:[u.jsx(ce,{analytics:O,onLoad:E=>_(E)}),u.jsx(fe,{isAppContentDrawerOpen:r,handleDrawerToggle:y}),u.jsx(Pt,{navigate:e,location:o,companyId:d,currentTenant:k,isUserZeniAccountsAdmin:s,accountsPromoConfig:i,onClickMenuIcon:()=>{y(!0)}})]})}},Tt=Fe.div`
|
|
22
22
|
display: flex;
|
|
23
23
|
height: 100vh;
|
|
24
24
|
width: 100%;
|
|
@@ -26,4 +26,4 @@ import{j as u}from"./liveblocks-DJRxBaIV.js";import{h as Y,g as ee,u as ne,i as
|
|
|
26
26
|
flex-direction: column;
|
|
27
27
|
align-items: center;
|
|
28
28
|
background-color: ${e=>e.theme.colors.grey4};
|
|
29
|
-
`,Dt=W(function(e,o){const t=V(e),a=U.getSignedInUser(),c=t.tenantId,n={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:c??""};return{internationalOnboardingDetails:
|
|
29
|
+
`,Dt=W(function(e,o){const t=V(e),a=U.getSignedInUser(),c=t.tenantId,n={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:c??""};return{internationalOnboardingDetails:qn(e),isReadonly:o.isFormReadonly,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:n,analytics:O}},function(e,o){const{navigate:t}=o;return{onFormDataChange:a=>{e(Jn(a))},onSubmitClick:()=>{e(Kn(o.companyId))},onCancelClick:()=>{t("../setup")},updateFilesEntity:a=>{e(ie({files:a}))},onDeleteFile:a=>{e(ae(a))},onDeleteFileList:a=>{e(Je(a))},onEditFileName:(a,c)=>{e(te(a,c.split(".")[0]))}}})(ot),Ut=()=>{const e=Y(),o=ee(),t=ne(),[a,c]=h.useState(!1),[n,s]=h.useState(!1),[l,i]=h.useState(!1),{tenantEmailDomain:r}=G(),p=se(),{useFeatureGate:g}=oe(),{isFeatureEnabled:C}=g(K.isBillPayLocalCurrencyFeatureEnabled),I=P(A=>A.internationalWireVerificationState.verificationFormFetchState.fetchState),k=P(A=>A.billPaySetupViewState.fetchState),d=P(A=>V(A)),S=Te(),y=d.companyId??U.getSignedInUserTenant(r)?.companyId,_=P(A=>Wn(A.companyState,d.companyId)),E=_?.company.companyBillPayInfo.internationalWireOnboardingStatus,f=E?.code==="onboarding_status_not_started"?void 0:"readonly";if(h.useEffect(()=>{a||I!=="Not-Started"||y==null||(c(!0),t(Hn(y)))},[a,I,y,t]),h.useEffect(()=>{n||k!=="Not-Started"||y==null||(s(!0),t(Q(y,!0)))},[k,n,y,t]),U.getSignedInUser()==null)throw Error("Can't access international verification without signing in...");const b=d.companyBillPayInfo?.info?.isBillPayTOSAccepted,D=A=>{i(A)};return b===!1?u.jsx(x,{to:"../promo"}):b===!0&&p?.loggedInUserRoleMap!=null?u.jsxs(Tt,{children:[u.jsx(ce,{analytics:O,onLoad:A=>(m=>m.trackPageLoaded($.Event.billPayBusinessVerification,void 0))(A)}),xe(o)?u.jsx(fe,{isAppContentDrawerOpen:l,handleDrawerToggle:D}):null,u.jsx(Dt,{navigate:e,location:o,companyId:y,analytics:O,currentTenant:d,roleMap:p.loggedInUserRoleMap,isFormReadonly:f,isLocalCurrencyEnabled:C})]}):u.jsx(De,{fetchState:"In-Progress",style:{backgroundColor:S.colors.grey5}})},Ot=W(function(){return{}},function(e,o){const{companyId:t,productType:a}=o;return{onEventReceived:c=>{switch(c){case"bill-pay-set-up-verification-update":case"bill-pay-wise-setup":switch(a){case"reimbursement":e(pe(t,!0,!0));break;case"zeni_accounts":e(me(t,!0,!0));break;case"charge_cards":e(le(t,!0,!0));break;case"zeni_treasury":e(he(t,!0,!0));break;default:e(Q(t,!0,!0))}}}}})(ct(e=>{const{isBillPayAdminLevelAccess:o,isUserHasOnlyBillPayAccess:t,isReimbursementAdminLevelAccess:a,isZeniAccountAdminLevelAccess:c,isTreasuryAdminLevelAccess:n,isChargeCardAdminLevelAccess:s,isUserHasOnlyCardAccess:l,productType:i,type:r}=e;switch(i){case"bill_pay":switch(r){case"verification":return o?u.jsx(Ue,{productType:i}):t?u.jsx(x,{to:"../"}):u.jsx(N,{});case"international-wire":return o?u.jsx(Ut,{}):t?u.jsx(x,{to:"../"}):u.jsx(N,{});default:return o?u.jsx(pt,{}):t?u.jsx(x,{to:"../"}):u.jsx(N,{})}case"reimbursement":return r==="verification"?a?u.jsx(Ue,{productType:i}):u.jsx(N,{}):a?u.jsx(Ct,{}):u.jsx(N,{});case"zeni_accounts":return r==="verification"?c?u.jsx(Ue,{productType:"zeni_accounts"}):u.jsx(N,{}):c?u.jsx(wt,{}):u.jsx(N,{});case"zeni_treasury":return n===!0?u.jsx(Et,{}):u.jsx(N,{});case"charge_cards":return r==="verification"?s?u.jsx(Ue,{productType:"charge_cards"}):l?u.jsx(x,{to:"../"}):u.jsx(N,{}):s?u.jsx(St,{}):l?u.jsx(x,{to:"../"}):u.jsx(N,{})}}));function oa(e){const{tenantEmailDomain:o}=G(),t=P(c=>V(c)).companyId??U.getSignedInUserTenant(o)?.companyId,a={events:t!=null?[`private-encrypted-${t}.bill-pay-set-up-verification-update`,`private-encrypted-${t}.bill-pay-wise-setup`]:[],eventCallback:(c,n,s)=>{s.onEventReceived(c)}};if(U.getSignedInUser()==null)throw Error("Can't access setup details page without signing in...");return u.jsx(Ot,{...e,companyId:t,...a})}export{na as A,ta as P,oa as S,Xt as a,ea as b,yt as c,ft as d,mt as e,aa as f,Ht as g,$t as h,Jt as i,Yt as j,ia as k,Kt as l,qt as m,Gt as n,Wt as o,Qt as p,sa as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as f}from"./liveblocks-Cl_SAGXq.js";import{a as u,b as M,q as T}from"./sentry-4tqT1r6y.js";import{u as A,h as z,j as c,g as D,N as j,n as O}from"./core-jHXRcmGr.js";import{u as P,z as s,y as F,d as E,a as B,e as _,f as N,r as V,g as Y,h as Z,j as v}from"./index-D3N1b9aQ.js";import{eX as $,LY as q,LZ as J,fA as W,g0 as X,M2 as H,go as G,cZ as K,M3 as b,M4 as Q,M5 as R,bY as y}from"./zeni-epic-state-BER7XwD9.js";import"./mui-DT0mOTYO.js";import{u as ee}from"./useDeviceId-DYiky9LJ.js";import{f as te}from"./analyticsHelper-mm28SP1t.js";import{t as ne}from"./getLocaleForTenant-BNQJePqV.js";import"./recharts-qvF3Dod3.js";import"./analytics-B1ozuY-_.js";import"./plaid-NlhYlsbZ.js";import"./dnd-DXsHzzkY.js";import"./stripe-DMRn4zHo.js";import"./lottie-BvP-9pT9.js";import"./lexical-BsEGFMKX.js";import"./pdf-CgzfzxbY.js";import"./utils-Dc4uXotD.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="3470efc0-1c26-462c-83e8-76786baf8d6a",t._sentryDebugIdIdentifier="sentry-dbid-3470efc0-1c26-462c-83e8-76786baf8d6a")}catch{}})();const ie=O(function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}},function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{T({message:`OAuth error from provider ${a} with error ${n}`,level:"error",tags:{authProvider:a,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,a)=>{const l=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(R({authCode:n,oauthProvider:a,appType:"web",redirectUri:y(l),sourceUri:y(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:a}=i;a!=null&&(s.saveMagicLinkEmail(n),t(Q(n,a)))},clearSignInError:()=>{t(b())}}})(Z),ae=M.memo(ie);function ve({setTenantEmailDomain:t}){const i=A(),d=z(),{clearAllLoading:g}=P(),n=s.getSignedInUser();u.useLayoutEffect(()=>{g()},[g]);const a=ee(),l=c(e=>e.tenantState.magicLinkCodeVerifier),{sendEmailMagicLinkFetchState:h,accountLocked:C,accountUnlockTime:L}=c(e=>e.tenantState),p=c(e=>e.tenantState.fetchState),k=c(e=>e.tenantState.activeTenantFetchState.fetchState),S=c(e=>e.tenantState.signInState),o=c(e=>e.tenantState.loggedInUser),r=c(e=>$(e)),I=c(e=>q(e)),m=D(),w=F().mode,U=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(u.useEffect(()=>{h.fetchState==="Completed"&&l!=null&&(E.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(l))},[h.fetchState,l]),u.useEffect(()=>{t(void 0)},[]),u.useEffect(()=>{S!=="In-Progress"||p!=="Completed"&&k!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(J(I.tenantsInOrder),o.zeniSessionId),W(o.userId,o.zeniSessionId,r.tenantId),i(X(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(H("Completed")),B.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),G().then(()=>{const e=Y();e!=null&&_(e)}),setTimeout(()=>{E.trackLogin(N.Event.loginSuccess,o.authProvider??"google",K(r.productSettings))},2e3))},[S,p,k,o,r,I,w,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return f.jsx(j,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!U,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),C===!0&&L!=null?f.jsx(V,{onClose:()=>i(b()),unlockDate:L}):null]})}export{ve as default};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{j as s}from"./liveblocks-Cl_SAGXq.js";import{a as i}from"./sentry-4tqT1r6y.js";import{u as c,g as d,N as u}from"./core-jHXRcmGr.js";import{z as n,d as a,f as m,B as p}from"./index-D3N1b9aQ.js";import{gt as g,Mk as y}from"./zeni-epic-state-BER7XwD9.js";import{n as b}from"./mui-DT0mOTYO.js";import"./recharts-qvF3Dod3.js";import"./analytics-B1ozuY-_.js";import"./plaid-NlhYlsbZ.js";import"./dnd-DXsHzzkY.js";import"./stripe-DMRn4zHo.js";import"./lottie-BvP-9pT9.js";import"./lexical-BsEGFMKX.js";import"./pdf-CgzfzxbY.js";import"./utils-Dc4uXotD.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="732543fc-31a4-46b6-9465-e79f363e8662",e._sentryDebugIdIdentifier="sentry-dbid-732543fc-31a4-46b6-9465-e79f363e8662")}catch{}})();function M(){const e=c(),t=d(),r=i.useRef(!1),f=n.isSignedIn(),o=t.state?.message==="logout"||f;return i.useEffect(()=>{if(o&&!r.current){r.current=!0;try{e(g()),y(),a.trackLogout(m.Event.logoutSuccess),a.resetUserIdentity(),n.clearAll()}catch(l){console.error("Error during sign out:",l)}finally{window.location.replace("/signin/auth")}}},[o,e]),o?s.jsx(h,{children:s.jsx(p,{fetchState:"In-Progress"})}):s.jsx(u,{to:"../",replace:!0})}const h=b.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
height: 100vh;
|
|
4
|
+
width: 100%;
|
|
5
|
+
flex: 1 1 auto;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
+
`;export{M as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as u}from"./liveblocks-
|
|
1
|
+
import{j as u}from"./liveblocks-Cl_SAGXq.js";import{a as G}from"./sentry-4tqT1r6y.js";import{h as v,u as z,g as K,j as b,i as J,n as O}from"./core-jHXRcmGr.js";import{z as R,C as _,G as p,a0 as M,D as Q,d as V,f as W,dc as X,v as g,p as Z}from"./index-D3N1b9aQ.js";import{eX as q,TM as F,J5 as I,TN as x,TI as H,It as y,TO as Y,IB as E,HX as aa,J6 as S,TP as B,fz as ea,IY as ta,J1 as sa,IQ as oa,IO as w,J2 as na,IL as ia,TQ as la,TR as ra,TS as ka,TT as ca,TU as T,ej as da,TV as ua,TW as pa}from"./zeni-epic-state-BER7XwD9.js";import{n as Ta}from"./mui-DT0mOTYO.js";import{u as ma}from"./useAskAiCfoHostNavButtonProps-DNA9YGXg.js";import{M as ga}from"./MobileAppDrawer-DJ3VpNqR.js";import"./recharts-qvF3Dod3.js";import"./analytics-B1ozuY-_.js";import"./plaid-NlhYlsbZ.js";import"./dnd-DXsHzzkY.js";import"./stripe-DMRn4zHo.js";import"./lottie-BvP-9pT9.js";import"./lexical-BsEGFMKX.js";import"./pdf-CgzfzxbY.js";import"./utils-Dc4uXotD.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="6b208284-69d6-4f5c-8935-6b89503529df",e._sentryDebugIdIdentifier="sentry-dbid-6b208284-69d6-4f5c-8935-6b89503529df")}catch{}})();const fa=Ta.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -6,4 +6,4 @@ import{j as u}from"./liveblocks-DJRxBaIV.js";import{a as D}from"./sentry-CCv9H2L
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,
|
|
9
|
+
`,ha=O(function(e,t){const o=F(e,t.isTaskTemplatesEnabled),{taskGroupId:k}=t,n=k!=null&&k!==""?{...o,taskGroupsWithTasksList:o.taskGroupsWithTasksList.map(l=>({...l,tasks:l.tasks.filter(a=>a.taskGroupIds.includes(k))})).filter(l=>l.tasks.length>0)}:o,d=H(e),i=R.isZeniUser();return{taskListView:n,tagListView:d,localData:n.localData,isTaskTemplatesEnabled:t.isTaskTemplatesEnabled,isZeniUser:i}},function(e,t){const{navigate:o,currentTenant:k,location:n,isTaskTemplatesEnabled:d}=t,{tenantEmailDomain:i}=k,{groupByKey:l}=t.uiState;return{onTaskManagementRowClick:a=>{const s=L(i,a),c=g(n.state?.pathnameStackToGoBack,n.pathname);o(s,{state:{pathnameStackToGoBack:c}})},onReloadTasks:()=>{e(I(!0,d))},onTabChange:a=>{e(ca(a))},onParentTaskClick:a=>{const s=L(i,a);window.open(s,"_blank","noopener")},bulkUpdateTasks:(a,s)=>{e(w(a,null,s))},onNewTaskClick:()=>{if(t.localData.defaultTaskGroupId!=null){const a=C(i,t.localData.defaultTaskGroupId),s=g(n.state?.pathnameStackToGoBack,n.pathname);o(a,{state:{pathnameStackToGoBack:s,message:"comingFromTaskListPage"}})}},onColumnSortConfigChanged:(a,s)=>{e(B({uiState:{sortKey:a,sortOrder:s}}))},onFiltersChange:a=>{e(ka({filters:a}))},onSearchTextChanged:a=>{e(ra({searchText:a}))},onReloadCards:()=>{e(I(!0,d))},onBackClick:()=>{if(n.state?.message==="triggerBackClick"){const a=Z(n.state?.pathnameStackToGoBack),s=a.poppedPathname??"../";o(s,{state:{pathnameStackToGoBack:a.newStack}})}else o("../")},updateLocalData:a=>{e(la({localData:a}))},resetLocalData:()=>{e(x({taskGroupById:t.taskGroupState.taskGroupById}))},handleCreateGroup:a=>{e(ia(t.localData.newTaskGroupName,a))},assignGroupToTasks:a=>{e(w(t.localData.selectedTaskIds,a,na(t.uiState.groupByKey,a)))},onDeleteTaskGroup:a=>{e(oa(a))},onAddNewTaskToTaskGroup:a=>{if(t.localData.defaultTaskGroupId!=null){const s=Da(l,a);e(y({taskDetailLocalData:s}));const c=C(i,t.uiState.groupByKey==="groupName"?a:t.localData.defaultTaskGroupId),f=g(n.state?.pathnameStackToGoBack,n.pathname);o(c,{state:{pathnameStackToGoBack:f,message:"comingFromTaskListPage"}})}},onDragNDrop:(a,s)=>{e(sa(t.localData.selectedTaskIds.length>0?t.localData.selectedTaskIds:[a],s))},onTaskGroupRename:(a,s)=>{e(ta(a,s))},onTimeSpentUpdate:(a,s)=>{e(S({task:a,updates:s}))},onShowToast:a=>{e(ea(a))},onGroupByFilterChange:a=>{e(B({uiState:{groupByKey:a}}))},updateTask:(a,s)=>{e(S({task:a,updates:s}))},onCreateTagClick:(a,s)=>{e(aa(a,s))},handleGroupTemplateClick:a=>{e(E(a,[]))},handleGroupTemplateTaskClick:(a,s)=>{e(E(a,[s]))},handleNewTaskInitialization:a=>{if(e(y({taskDetailLocalData:{...Y,name:a}})),t.localData.defaultTaskGroupId!=null){const s=C(i,t.localData.defaultTaskGroupId),c=g(n.state?.pathnameStackToGoBack,n.pathname);o(s,{state:{pathnameStackToGoBack:c,message:"comingFromTaskListPage"}})}},onTaskGroupNameClick:a=>{o(`/${i}/tasks/group/${a}`)},onQuickResponsesClick:()=>{o(`/${i}/tasks/quick-responses`)}}})(X);function $a(){const e=v(),t=z(),o=K(),k=R.getSignedInUser(),n=b(r=>q(r)),{taskGroupId:d}=J(),{useFeatureGate:i}=_(),{isFeatureEnabled:l}=i(p.isTaskTemplatesEnabled),{isFeatureEnabled:a}=i(p.isTaskCannedResponsesEnabled),{isFeatureEnabled:s}=i(p.isTaskCategorizationEnabled),{isFeatureEnabled:c}=i(p.isTaskBulkResolutionEnabled),{isFeatureEnabled:f}=i(p.isTaskGroupAssigneesEnabled),{isFeatureEnabled:A}=i(p.isTaskRecurringParentEnabled),[P,j]=G.useState(!1),h=b(r=>F(r,l)),D=b(r=>r.taskGroupState),m=h.fetchState,{isAiCfoAccessEnabled:N,onAskAiCfoClick:$}=ma({mobileExploreReferrer:"Task Checklist"});if(M({isDataReady:m==="Completed"}),G.useEffect(()=>{t(I(!1,l))},[n?.tenantId,t,l]),G.useEffect(()=>{m==="Completed"&&t(x({taskGroupById:D.taskGroupById}))},[m,D.taskGroupById]),k==null)throw Error("Can't access task list page without signing in...");return u.jsxs(u.Fragment,{children:[m==="Completed"?u.jsx(Q,{analytics:V,onLoad:r=>(U=>U.trackPageLoaded(W.Event.taskListPage))(r)}):null,u.jsxs(fa,{children:[u.jsx(ga,{isAppContentDrawerOpen:P,handleDrawerToggle:r=>{j(r)}}),u.jsx(ha,{location:o,navigate:e,currentTenant:n,taskGroupId:d,taskGroupState:D,localData:h.localData,uiState:h.uiState,isTaskTemplatesEnabled:l,taskListFetchState:m,isTaskCategorizationEnabled:s,isTaskCannedResponsesEnabled:a,isTaskBulkResolutionEnabled:c,isTaskGroupAssigneesEnabled:f,isTaskRecurringParentEnabled:A,isAiCfoAccessEnabled:N,onAskAiCfoClick:$})]})]})}const L=(e,t)=>`/${e}/tasks/${encodeURIComponent(t)}`,C=(e,t)=>`/${e}/tasks/new/${t}`,Da=(e,t)=>{if(e==="assignee"){const o=t.split(",");return{...T.taskDetailLocalData,assignee:o}}if(e==="priority"){const o=da(t);return{...T.taskDetailLocalData,priority:o}}if(e==="status"){const o=ua(t);return{...T.taskDetailLocalData,status:o}}if(e==="tag"){const o=t.split(",");return{...T.taskDetailLocalData,tagIds:o}}if(e==="dueDate"){const o=pa(t);return{...T.taskDetailLocalData,dueDate:o}}return{...T.taskDetailLocalData}};export{$a as default};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{j as n}from"./liveblocks-Cl_SAGXq.js";import se from"./NotFoundScreen-CamJ30ZO.js";import{a as c}from"./sentry-4tqT1r6y.js";import{h as O,u as Z,j as g,g as ne,i as oe,N as ie,n as re,o as ce,p as f}from"./core-jHXRcmGr.js";import{I8 as H,Ib as le,I5 as de,eX as M,TI as X,Ip as J,I2 as pe,IV as ue,IO as ke,TJ as K,TK as V,H_ as me,HX as fe,rC as ge,rq as he,l5 as Ie,Ij as Se,TL as Te,IA as be,Ix as Ce,Ie as Ee,Iu as Ge,It as De}from"./zeni-epic-state-BER7XwD9.js";import{z as G,da as xe,x as je,C as ye,G as b,p as Q,v as w,D as ve,d as z,f as we,db as Re,j as A,au as Fe}from"./index-D3N1b9aQ.js";import{n as Be}from"./mui-DT0mOTYO.js";import{u as Pe}from"./useInitialThreadRequest-DE7N6h-n.js";import{M as Ue}from"./MobileAppDrawer-DJ3VpNqR.js";import Le from"./TaskListScreen-CPjplYNX.js";import"./recharts-qvF3Dod3.js";import"./analytics-B1ozuY-_.js";import"./plaid-NlhYlsbZ.js";import"./dnd-DXsHzzkY.js";import"./stripe-DMRn4zHo.js";import"./lottie-BvP-9pT9.js";import"./lexical-BsEGFMKX.js";import"./pdf-CgzfzxbY.js";import"./utils-Dc4uXotD.js";import"./useAskAiCfoHostNavButtonProps-DNA9YGXg.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="a13bc04e-d8fc-4565-bd20-c20f1839e5fb",e._sentryDebugIdIdentifier="sentry-dbid-a13bc04e-d8fc-4565-bd20-c20f1839e5fb")}catch{}})();function $e(){const e=O(),t=Z(),s=G.getSignedInUser(),{cannedResponses:u,fetchState:r,saveFetchState:d}=g(o=>o.cannedResponsesState),l=c.useCallback(()=>{t(H())},[t]),k=c.useCallback((o,h,I)=>{t(le({name:o,content:h,cannedResponseId:I}))},[t]),a=c.useCallback(o=>{t(de({cannedResponseId:o}))},[t]);if(s==null)throw Error("Can't access quick responses page without signing in...");return n.jsx(xe,{cannedResponses:u,isLoading:r==="In-Progress"||r==="Not-Started",isSaving:d==="In-Progress",onBackClick:()=>e(-1),onDelete:a,onFetch:l,onSave:k})}let q,_=[];const Ne=re(function(e,t){const{location:s,taskGroupId:u}=t,r=K(e,t.taskId),d=M(e),l=r.taskGroupId??u,k=l!=null?V(e.taskGroupState,l):void 0,a=G.getSignedInUser(),o=d.tenantId,h={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:o??""},I=X(e),{tenantEmailDomain:D}=d,C=r.recurringSourceTaskId,x=C!=null?`${A.appUrl}/${D}/tasks/${encodeURIComponent(C)}`:void 0;var S;return{taskDetailSelectorView:r,authParams:h,isZeniUser:G.isZeniUser(),userGroupList:((S=e.userGroupsState.userGroupByUserGroupId)!==q&&(q=S,_=Object.values(S)),_),isNewClicked:s.state?.message==="comingFromTaskListPage",filesEndPoint:Fe.fileMicroServiceBaseUrl,companyName:t.currentTenant.companyName,companyId:t.currentTenant.companyId,currentUrl:`${A.appUrl}${t.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:x,tagListView:I,taskGroupName:l!=null&&k!=null&&k.isDefault===!1?k.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map(p=>V(e.taskGroupState,p)).filter(p=>p!=null&&!p.isDeleted).map(p=>({id:p.id,name:p.name,isDefault:p.isDefault}))}},function(e,t){const{taskId:s,navigate:u,currentTenant:r,location:d,taskGroupId:l}=t,{tenantEmailDomain:k}=r;return{onSaveChangesToLocalStore:a=>{e(De({taskDetailLocalData:a,taskId:s}))},onSaveDetailClick:a=>{e(Ge(s,a??l))},onArchiveTaskClick:()=>{t.taskId!=null&&e(Ee(t.taskId))},onSnoozeTask:(a,o)=>{e(Ce(a,o))},onUnsnoozeTask:a=>{e(be(a))},onDismissClick:()=>{if(d.state?.message==="triggerBackClick"){const a=Q(d.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";u(o,{state:{pathnameStackToGoBack:a.newStack}})}else{const a=R(k),o=w(d.state?.pathnameStackToGoBack,d.pathname);u(a,{state:{pathnameStackToGoBack:o}})}e(Te({taskId:s}))},onDeleteTaskClick:()=>{e(Se(s))},updateFilesEntity:a=>{e(Ie({files:a}))},onDeleteFile:a=>{e(he(a))},onEditFileName:(a,o)=>{e(ge(a,o.split(".")[0]))},onReloadTaskDetailPage:()=>{e(J(!1,s))},onCreateTagClick:a=>{e(fe(a,s))},onDeleteTagClick:a=>{e(me(a,s))},onFetchCannedResponses:()=>{e(H())},onManageTemplatesClick:()=>{u(`/${r.tenantEmailDomain}/tasks/quick-responses`)}}})(Re);function v(){const e=O(),t=Z(),s=ne(),u=je(),{taskId:r,taskGroupId:d}=oe(),l=g(i=>M(i)),k=Pe(l?.companyId),{useFeatureGate:a}=ye(),{isFeatureEnabled:o}=a(b.isTaskSnoozeEnabled),{isFeatureEnabled:h}=a(b.isTaskVisibilityEnabled),{isFeatureEnabled:I}=a(b.isTaskCannedResponsesEnabled),{isFeatureEnabled:D}=a(b.isTaskRecurringParentEnabled),{isFeatureEnabled:C}=a(b.isTaskGroupAssigneesEnabled),[x,S]=c.useState(!1),[p,W]=c.useState(!1),[F,Y]=c.useState(!1),[B,ee]=c.useState(!1),[P,j]=c.useState(!1),T=c.useRef(!1),E=g(i=>i.taskListState.updateTasksFetchState.fetchState),U=g(i=>X(i)),L=g(i=>i.taskGroupViewState.fetchState);c.useEffect(()=>{p||(W(!0),t(J(!1,r)))},[p,t]),c.useEffect(()=>{F||U.fetchState==="Completed"||(Y(!0),t(pe()))},[F,t,U.fetchState]),c.useEffect(()=>{B||L==="Completed"||(ee(!0),t(ue()))},[B,t,L]);const ae=c.useCallback(()=>{r!=null&&(T.current=!1,t(ke([r],null,{isArchived:!1})),j(!0))},[t,r]);c.useEffect(()=>{if(P)if(E!=="In-Progress"){if(T.current){if(E==="Error")return j(!1),void(T.current=!1);if(E==="Completed"){j(!1),T.current=!1;const{tenantEmailDomain:i}=l;if(s.state?.message==="triggerBackClick"){const m=Q(s.state?.pathnameStackToGoBack);e(m.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:m.newStack}})}else{const m=R(i);e(m,{state:{pathnameStackToGoBack:w(s.state?.pathnameStackToGoBack,s.pathname)}})}}}}else T.current=!0},[P,E,l,s,e]);const $=g(i=>K(i,r)),y=$.fetchState,N=G.getSignedInUser();if(N==null)throw Error("Can't access task detail page without signing in...");if(y==="Error"&&$.error?.code===400){const{tenantEmailDomain:i}=l,m=R(i),te=w(s.state?.pathnameStackToGoBack,s.pathname);return n.jsx(ie,{to:m,state:{pathnameStackToGoBack:te}})}return n.jsxs(n.Fragment,{children:[y==="Completed"?n.jsx(ve,{analytics:z,onLoad:i=>(m=>m.trackPageLoaded(we.Event.taskDetailPage))(i)}):null,n.jsxs(Ve,{children:[n.jsx(Ue,{isAppContentDrawerOpen:x,handleDrawerToggle:i=>{S(i)}}),n.jsx(Ne,{analytics:z,currentTenant:l,handleZeniLogoClick:()=>{u.toggle()},initialOpenThreadRequest:k,location:s,loggedInUser:N,navigate:e,taskGroupId:d,taskId:r,taskDetailFetchState:y,onUnarchiveTaskClick:ae,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:h,isTaskCannedResponsesEnabled:I,isTaskRecurringParentEnabled:D,isTaskGroupAssigneesEnabled:C})]})]})}const Ve=Be.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100%;
|
|
4
|
+
width: 100%;
|
|
5
|
+
flex: 1 1 auto;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
+
`,R=e=>`/${e}/tasks`;function ia(){return n.jsxs(ce,{children:[n.jsx(f,{path:"/new",element:n.jsx(v,{})}),n.jsx(f,{path:"/new/:taskGroupId",element:n.jsx(v,{})}),n.jsx(f,{path:"/group/:taskGroupId",element:n.jsx(Le,{})}),n.jsx(f,{path:"/quick-responses",element:n.jsx($e,{})}),n.jsx(f,{path:"/:taskId",element:n.jsx(v,{})}),n.jsx(f,{path:"*",element:n.jsx(se,{})})]})}export{ia as default};
|
package/dist/assets/{TransactionDetailRoutes-RaFXCYib.js → TransactionDetailRoutes-BQtZsJD1.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t}from"./liveblocks-
|
|
1
|
+
import{j as t}from"./liveblocks-Cl_SAGXq.js";import i from"./NotFoundScreen-CamJ30ZO.js";import{T as r}from"./TransactionDetailScreen-B1AYJUjQ.js";import"./sentry-4tqT1r6y.js";import{o as s,p as o}from"./core-jHXRcmGr.js";import"./zeni-epic-state-BER7XwD9.js";import"./recharts-qvF3Dod3.js";import"./index-D3N1b9aQ.js";import"./mui-DT0mOTYO.js";import"./analytics-B1ozuY-_.js";import"./plaid-NlhYlsbZ.js";import"./dnd-DXsHzzkY.js";import"./stripe-DMRn4zHo.js";import"./lottie-BvP-9pT9.js";import"./lexical-BsEGFMKX.js";import"./pdf-CgzfzxbY.js";import"./utils-Dc4uXotD.js";import"./useAskAiCfoHostNavButtonProps-DNA9YGXg.js";import"./decodeURIComponentSafe-C8Ut439h.js";import"./routePaths-m79Ycpnf.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="a4852925-22e4-4d6c-b9c0-7fe8ce24ec96",e._sentryDebugIdIdentifier="sentry-dbid-a4852925-22e4-4d6c-b9c0-7fe8ce24ec96")}catch{}})();function k(){return t.jsxs(s,{children:[t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId",element:t.jsx(r,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:t.jsx(i,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:t.jsx(r,{})}),t.jsx(o,{path:"/*",element:t.jsx(r,{})})]})}export{k as default};
|