@zeniai/web-app-ui 5.3.72-qa → 5.3.73-next
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/{AccountMappingScreen-CJvl5JXJ.js → AccountMappingScreen-DswLKEe5.js} +2 -2
- package/dist/assets/{ActualMatchingMatchDetailScreen-BUq34KSF.js → ActualMatchingMatchDetailScreen-BOiFt58b.js} +1 -1
- package/dist/assets/AddressRoutes-BHptFN8Q.js +1 -0
- package/dist/assets/AddressScreen-CA5KE8MT.js +9 -0
- package/dist/assets/AiCfoScreen-BNQqWk-X.js +22 -0
- package/dist/assets/{AppDrawer-sYdSE7DV.js → AppDrawer-DeF5MXX7.js} +2 -2
- package/dist/assets/{BillPayApprovalRoutes-BZEAdInR.js → BillPayApprovalRoutes-D4ZedgQD.js} +1 -1
- package/dist/assets/{BillPayRoutes-169K6hbL.js → BillPayRoutes-DW75K5BT.js} +18 -18
- package/dist/assets/BusinessVerificationPageScreen-DO7l09xz.js +9 -0
- package/dist/assets/CardsAiCfoScreen-fM-dv9EP.js +14 -0
- package/dist/assets/{ChargeCardRoutes-BwNBtpIG.js → ChargeCardRoutes-B3mzz2dP.js} +6 -6
- package/dist/assets/{CompanyPassportScreen-D45sXsrZ.js → CompanyPassportScreen-BbenDHB4.js} +1 -1
- package/dist/assets/ConnectionAuthScreen-Ckp7eA-Z.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-DnrogneE.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-BFxNnHJO.js → CustomerOnboardingRoutes-D6DFJEPX.js} +3 -3
- package/dist/assets/{DashboardRoutes-Co7U6uRf.js → DashboardRoutes-Cq6T81sz.js} +3 -3
- package/dist/assets/{DefaultTenantHome-CpT6ByaT.js → DefaultTenantHome-BLShrtMZ.js} +1 -1
- package/dist/assets/{DomesticWireDetailScreen-CdZcuM7h.js → DomesticWireDetailScreen-CsEfHEEO.js} +4 -4
- package/dist/assets/{DrawerScreen-Crjhobh0.js → DrawerScreen-C2io9bi4.js} +1 -1
- package/dist/assets/EntityDetailRoutes-GqYvTApk.js +1 -0
- package/dist/assets/{ExpenseAutomationRoutes-DoAFvlJW.js → ExpenseAutomationRoutes-eWOWr85_.js} +3 -3
- package/dist/assets/FeaturePreviewScreen-D7rfxIIy.js +1 -0
- package/dist/assets/HubSpotOAuthCallbackScreen-CsVaFUIf.js +1 -0
- package/dist/assets/{InboxNotificationsProvider-CH-l5W7V.js → InboxNotificationsProvider-DZQGEyxq.js} +1 -1
- package/dist/assets/InvoicingRoutes-DByPH_q7.js +2 -0
- package/dist/assets/{MagicLinkRoutes-D-AUoRWa.js → MagicLinkRoutes-BcEhXhpL.js} +8 -8
- package/dist/assets/MagicLinkSignInScreen-DA0T0RZ3.js +12 -0
- package/dist/assets/{MobileAppDrawer-DfT3Wv4q.js → MobileAppDrawer-Cm83j2vk.js} +1 -1
- package/dist/assets/NotFoundScreen-CZf0Su98.js +1 -0
- package/dist/assets/NotificationRoutes-qrDe7DaH.js +1 -0
- package/dist/assets/OAuthConsentScreen-C3UBvO-W.js +1 -0
- package/dist/assets/PandLWithForecastRoutes-CsRM4aCt.js +1 -0
- package/dist/assets/{PaymentLinkScreen-OFX6JRL7.js → PaymentLinkScreen-BkbwkdWJ.js} +5 -5
- package/dist/assets/PeopleRoutes-CJb_v6ZN.js +22 -0
- package/dist/assets/PerformanceRoutes-CBJPZiyx.js +1 -0
- package/dist/assets/{Preview-Ch5xsyMl.js → Preview-Om1s1Q56.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-BnxzdDn6.js → QBOConnectionScreen-BVEoinfN.js} +1 -1
- package/dist/assets/ReimbursementApprovalRoutes-x_cN8gHc.js +1 -0
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-DA2wxNvn.js → ReimbursementApprovalRuleDetailScreen-CmKBSl1I.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-DtigAZux.js → ReimbursementRoutes-CQkJk7qY.js} +7 -7
- package/dist/assets/{ReportsRoutes-IMfpdgLc.js → ReportsRoutes-2nV2dA__.js} +1 -1
- package/dist/assets/RewardsRoutes-3VUweoT_.js +1 -0
- package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-DVmtIBPW.js → ScheduleDetailsPrepaidExpensesScreen-Ch8j89gL.js} +5 -5
- package/dist/assets/ScreenRoutes-BQYTwCF3.js +2 -0
- package/dist/assets/{SettingsRoutes-CPIpAqIx.js → SettingsRoutes-Dvz3g8QS.js} +6 -6
- package/dist/assets/SetupPagesScreen-QedyRW6Z.js +29 -0
- package/dist/assets/SignInScreen-BoeLntMK.js +1 -0
- package/dist/assets/SignOutScreen-CGlsZ4QP.js +9 -0
- package/dist/assets/TaskListScreen-D0yZXtyL.js +9 -0
- package/dist/assets/TaskRoutes-BFYoKVIc.js +9 -0
- package/dist/assets/TransactionDetailRoutes-C4_Uqx9Y.js +1 -0
- package/dist/assets/{TransactionDetailScreen-BWee1nGS.js → TransactionDetailScreen-CJgdnrqI.js} +2 -2
- package/dist/assets/TransactionListRoutes-CkAkq2Db.js +1 -0
- package/dist/assets/{TreasuryRoutes-B_J15-lg.js → TreasuryRoutes-C46QwTot.js} +6 -6
- package/dist/assets/{VendorsRoutes-5DKAWmAO.js → VendorsRoutes-DJ1SY9-A.js} +13 -13
- package/dist/assets/WiseConfirmationScreen-DJX_grHD.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-C8P1BGhH.js → ZeniAccountRoutes-drP5zu20.js} +11 -11
- package/dist/assets/{ZeniAccountStatementScreen-D7BQE1Xy.js → ZeniAccountStatementScreen-B9ZyTXnh.js} +2 -2
- package/dist/assets/{accountMappingHelper-CnG-eRj3.js → accountMappingHelper-YAw2LuBf.js} +1 -1
- package/dist/assets/{analytics-DlzSqyvZ.js → analytics-DAlTxslb.js} +1 -1
- package/dist/assets/{analyticsHelper-BlLXbdz8.js → analyticsHelper-CWjQXseh.js} +1 -1
- package/dist/assets/{core-D07hD3KT.js → core-B-JOvAoN.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-D3MFRtCF.js → decodeURIComponentSafe-KCik1Gu_.js} +1 -1
- package/dist/assets/{dnd-B-KpYfWT.js → dnd-COhfK8Um.js} +1 -1
- package/dist/assets/{empty-DRbThjIF.js → empty-Dw_cE_Ok.js} +1 -1
- package/dist/assets/{empty-aXh7noZx.js → empty-gDUkioP2.js} +1 -1
- package/dist/assets/{emptyVideoElement-BZocj0UF.js → emptyVideoElement-fzXomVhk.js} +1 -1
- package/dist/assets/epic-BaaG9lRz.js +2 -0
- package/dist/assets/expenseAutomationHelper-CvpVcBcR.js +1 -0
- package/dist/assets/{getLocaleForTenant-xajEPLim.js → getLocaleForTenant-C2NcEkPl.js} +1 -1
- package/dist/assets/{index-BVdX_ubi.js → index-B-FscuIp.js} +2 -2
- package/dist/assets/{index-BIOOl02m.js → index-Bifuohux.js} +1 -1
- package/dist/assets/{index-D5s14gxd.js → index-BtM-6hof.js} +1 -1
- package/dist/assets/{index-54OCX1PW.js → index-C1EzrYAP.js} +1 -1
- package/dist/assets/{index-YyHAbx34.js → index-CkFE4Y48.js} +1 -1
- package/dist/assets/{index-BxmwktwS.js → index-Cu0CawL6.js} +1 -1
- package/dist/assets/{index-z9Fh-4S1.js → index-CuyBZ-DG.js} +1 -1
- package/dist/assets/{index-BXZoRXDS.js → index-d9PzVM0C.js} +16523 -16600
- package/dist/assets/{lexical-NIxvAmS2.js → lexical-BcThc0IB.js} +1 -1
- package/dist/assets/{liveblocks-CQOAuUNI.js → liveblocks-DRe6CbUC.js} +1 -1
- package/dist/assets/{lottie-BIKpYE12.js → lottie-mNMGPSgQ.js} +1 -1
- package/dist/assets/{mui-XiTT8YBC.js → mui-D61DLOo-.js} +1 -1
- package/dist/assets/{pathToGoBack-RICxbZCJ.js → pathToGoBack-BgQq85lD.js} +1 -1
- package/dist/assets/{pdf-Dli3mGO_.js → pdf-Di2GQu6S.js} +4 -4
- package/dist/assets/{pdf-lib-D9XJLVoD.js → pdf-lib-MZXKzNW5.js} +1 -1
- package/dist/assets/{plaid-BG3pJamN.js → plaid-BBL8Aplq.js} +1 -1
- package/dist/assets/{pusher-D9DkHuMx.js → pusher-B50s1eye.js} +1 -1
- package/dist/assets/{react-DkT18Fv5.js → react-BJkFkDVX.js} +1 -1
- package/dist/assets/{react-CrrxpEIc.js → react-BJv-cA8E.js} +1 -1
- package/dist/assets/{react-D2I9LF0A.js → react-CLPQuO4d.js} +1 -1
- package/dist/assets/{react-C-5ZNsBH.js → react-D2piU7r8.js} +1 -1
- package/dist/assets/{react-C1d1ocIu.js → react-XUFgqyYV.js} +1 -1
- package/dist/assets/{react-BLzCbojr.js → react-Y8h5VZOE.js} +1 -1
- package/dist/assets/{recharts-CgYqsGTH.js → recharts-DqtwTOUm.js} +1 -1
- package/dist/assets/{routePaths-D5u7Fiee.js → routePaths-Dw39xRTk.js} +1 -1
- package/dist/assets/{sentry-pp_6zWNc.js → sentry-0qxHOSjH.js} +1 -1
- package/dist/assets/{stripSplatSuffix-DA-gXJ77.js → stripSplatSuffix-CUb6kTzD.js} +1 -1
- package/dist/assets/{url-TK5h7pVR.js → url-CKMjIwmH.js} +1 -1
- package/dist/assets/{url-yI9BET_f.js → url-CUI30DIS.js} +1 -1
- package/dist/assets/useActualMatchingMatchDetail-BHxqSBTE.js +1 -0
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-cfyM2Cui.js → useAiCfoDashboardSuggestedQuestionsChips-D45YnMeW.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-B_a9BtNp.js +1 -0
- package/dist/assets/{useChargeCardPusherEvents-CS7T_ZQN.js → useChargeCardPusherEvents-BgqIFo7c.js} +1 -1
- package/dist/assets/{useDeviceId-DCPRNX-s.js → useDeviceId-0oBI_F7i.js} +1 -1
- package/dist/assets/useEmailConnectResultRefresh-D_JJFEwu.js +1 -0
- package/dist/assets/{useInitialThreadRequest-COOzD5oF.js → useInitialThreadRequest-vRjTI0ud.js} +1 -1
- package/dist/assets/useTaskManagerAccess-DvFZ_glf.js +1 -0
- package/dist/assets/{useTaskManagerPusherEvents-D8-vSEDU.js → useTaskManagerPusherEvents-Dru9PCIf.js} +1 -1
- package/dist/assets/{utils-CrOdvv6w.js → utils-C7LPuKOj.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-eLmj1Ps-.js → withTransactionSidePanel-CeamX7TJ.js} +4 -4
- package/dist/assets/{zeni-epic-state-B3TABHgO.js → zeni-epic-state-C5XzLjC7.js} +6 -6
- package/dist/index.html +1 -1
- package/package.json +4 -4
- package/dist/assets/AddressRoutes-CRp3rVsa.js +0 -1
- package/dist/assets/AddressScreen-qpYsmNQj.js +0 -9
- package/dist/assets/AiCfoScreen-Cgg6z7vY.js +0 -22
- package/dist/assets/BusinessVerificationPageScreen-Bg2PTPOO.js +0 -9
- package/dist/assets/CardsAiCfoScreen-ClyuumNF.js +0 -14
- package/dist/assets/ConnectionAuthScreen-Ch3SMbL0.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-DUAU8WBE.js +0 -1
- package/dist/assets/EntityDetailRoutes-DBE0e8tk.js +0 -1
- package/dist/assets/FeaturePreviewScreen-WjMnw8KV.js +0 -1
- package/dist/assets/HubSpotOAuthCallbackScreen-Co1Efhtt.js +0 -1
- package/dist/assets/InvoicingRoutes-B-rSWSFX.js +0 -2
- package/dist/assets/MagicLinkSignInScreen-CRDcdldu.js +0 -12
- package/dist/assets/NotFoundScreen-CBsVugJE.js +0 -1
- package/dist/assets/NotificationRoutes-DXLsGRw8.js +0 -1
- package/dist/assets/OAuthConsentScreen-HPHCSEZf.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-CFIV5ASt.js +0 -1
- package/dist/assets/PeopleRoutes-DMreo66A.js +0 -22
- package/dist/assets/PerformanceRoutes-BpHHBv6i.js +0 -1
- package/dist/assets/ReimbursementApprovalRoutes-Di_UQPZB.js +0 -1
- package/dist/assets/RewardsRoutes-QcnfJ0I2.js +0 -1
- package/dist/assets/ScreenRoutes-BLGmNmRV.js +0 -2
- package/dist/assets/SetupPagesScreen-DUwJ2VLm.js +0 -29
- package/dist/assets/SignInScreen-6knrOqTO.js +0 -1
- package/dist/assets/SignOutScreen-Yk4k3uR0.js +0 -9
- package/dist/assets/TaskListScreen-CjEfkJDx.js +0 -9
- package/dist/assets/TaskRoutes-lIMUyAfY.js +0 -9
- package/dist/assets/TransactionDetailRoutes-D7Rn2JsN.js +0 -1
- package/dist/assets/TransactionListRoutes-xPkgCyOq.js +0 -1
- package/dist/assets/WiseConfirmationScreen-Bor5L5ul.js +0 -12
- package/dist/assets/epic-Du2AdUHP.js +0 -2
- package/dist/assets/expenseAutomationHelper-CL7YOVzM.js +0 -1
- package/dist/assets/useActualMatchingMatchDetail-9njfwmJo.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-C9O3AmSz.js +0 -1
- package/dist/assets/useEmailConnectResultRefresh-50p1dphC.js +0 -1
- package/dist/assets/useTaskManagerAccess-Dvad4Vb6.js +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/NotFoundScreen-CZf0Su98.js","assets/sentry-0qxHOSjH.js","assets/core-B-JOvAoN.js","assets/zeni-epic-state-C5XzLjC7.js","assets/index-d9PzVM0C.js","assets/mui-D61DLOo-.js","assets/analytics-DAlTxslb.js","assets/utils-C7LPuKOj.js","assets/index-BhC2LNQw.css","assets/DashboardRoutes-Cq6T81sz.js","assets/withTransactionSidePanel-CeamX7TJ.js","assets/useAskAiCfoHostNavButtonProps-B_a9BtNp.js","assets/TransactionDetailScreen-CJgdnrqI.js","assets/decodeURIComponentSafe-KCik1Gu_.js","assets/useInitialThreadRequest-vRjTI0ud.js","assets/routePaths-Dw39xRTk.js","assets/expenseAutomationHelper-CvpVcBcR.js","assets/stripSplatSuffix-CUb6kTzD.js","assets/analyticsHelper-CWjQXseh.js","assets/CompanyPassportScreen-BbenDHB4.js","assets/MobileAppDrawer-Cm83j2vk.js","assets/InboxNotificationsProvider-DZQGEyxq.js","assets/useTaskManagerAccess-DvFZ_glf.js","assets/useAiCfoDashboardSuggestedQuestionsChips-D45YnMeW.js","assets/FeaturePreviewScreen-D7rfxIIy.js","assets/BillPayRoutes-DW75K5BT.js","assets/AddressScreen-CA5KE8MT.js","assets/DomesticWireDetailScreen-CsEfHEEO.js","assets/BusinessVerificationPageScreen-DO7l09xz.js","assets/DrawerScreen-C2io9bi4.js","assets/SetupPagesScreen-QedyRW6Z.js","assets/BillPayApprovalRoutes-D4ZedgQD.js","assets/ReimbursementApprovalRuleDetailScreen-CmKBSl1I.js","assets/getLocaleForTenant-C2NcEkPl.js","assets/ReimbursementRoutes-CQkJk7qY.js","assets/ReimbursementApprovalRoutes-x_cN8gHc.js","assets/TransactionListRoutes-CkAkq2Db.js","assets/ZeniAccountStatementScreen-B9ZyTXnh.js","assets/SettingsRoutes-Dvz3g8QS.js","assets/AccountMappingScreen-DswLKEe5.js","assets/QBOConnectionScreen-BVEoinfN.js","assets/empty-Dw_cE_Ok.js","assets/index-BtM-6hof.js","assets/url-CKMjIwmH.js","assets/index-CuyBZ-DG.js","assets/accountMappingHelper-YAw2LuBf.js","assets/useEmailConnectResultRefresh-D_JJFEwu.js","assets/ReportsRoutes-2nV2dA__.js","assets/ChargeCardRoutes-B3mzz2dP.js","assets/useChargeCardPusherEvents-BgqIFo7c.js","assets/PeopleRoutes-CJb_v6ZN.js","assets/ExpenseAutomationRoutes-eWOWr85_.js","assets/useActualMatchingMatchDetail-BHxqSBTE.js","assets/ScheduleDetailsPrepaidExpensesScreen-Ch8j89gL.js","assets/pathToGoBack-BgQq85lD.js","assets/TreasuryRoutes-C46QwTot.js","assets/VendorsRoutes-DJ1SY9-A.js","assets/ZeniAccountRoutes-drP5zu20.js","assets/AddressRoutes-BHptFN8Q.js","assets/PandLWithForecastRoutes-CsRM4aCt.js","assets/CustomerOnboardingRoutes-D6DFJEPX.js","assets/TransactionDetailRoutes-C4_Uqx9Y.js","assets/EntityDetailRoutes-GqYvTApk.js","assets/InvoicingRoutes-DByPH_q7.js","assets/NotificationRoutes-qrDe7DaH.js","assets/PerformanceRoutes-CBJPZiyx.js","assets/ActualMatchingMatchDetailScreen-BOiFt58b.js","assets/RewardsRoutes-3VUweoT_.js","assets/TaskRoutes-BFYoKVIc.js","assets/TaskListScreen-D0yZXtyL.js","assets/useTaskManagerPusherEvents-Dru9PCIf.js","assets/AiCfoScreen-BNQqWk-X.js","assets/CardsAiCfoScreen-fM-dv9EP.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as s,bn as Es,fI as hs,e0 as ps,d$ as xs,B7 as gs,dj as Rs,c9 as js,gM as Is,gc as Ts,dg as pe,cH as As,gq as bs,cz as fs,bF as Ds,br as ys,Uk as vs,v as Cs,Un as Os,bq as Us,Uo as Ps,bL as ws,bK as Fs,bu as Ls,cv as ks,Up as Vs,Uq as Hs,db as Bs,de as Ss,dd as Ns,cG as Ms,cN as Zs,pV as xe,gl as ge,g$ as $s,gn as Re,gO as je,gP as Ie,go as zs}from"./zeni-epic-state-C5XzLjC7.js";import{j as e}from"./liveblocks-DRe6CbUC.js";import{a as P}from"./sentry-0qxHOSjH.js";import{N as u,u as Gs,h as qs,i as Ys,g as Ws,j as $,q as Te,n as Xs,o as n}from"./core-B-JOvAoN.js";import{N as l,E as Ks,u as Qs,z as y,_ as Js,e as et,D as st,f as S,h as tt,X as nt,O as at,L as F,G as Ae,t as _,P as ot,Q as rt,k as ne}from"./index-d9PzVM0C.js";import"./mui-D61DLOo-.js";import{f as be}from"./analyticsHelper-CWjQXseh.js";import{t as it}from"./getLocaleForTenant-C2NcEkPl.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},f=new o.Error().stack;f&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[f]="06d1fbbd-711d-410f-94bb-e5f8a9c8f4d8",o._sentryDebugIdIdentifier="sentry-dbid-06d1fbbd-711d-410f-94bb-e5f8a9c8f4d8")}catch{}})();const lt=l((()=>s((()=>import("./NotFoundScreen-CZf0Su98.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),ut=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/reimbursements`}),dt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/bills`}),fe=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/treasury`}),De=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/checking`}),ye=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/cards`}),v=({showZeniAccountRoute:o,isUserHasBillPayAccess:f,isUserHasReimbursementAccess:N,showTreasuryRoute:i,isTenantBankingOnly:k,showChargeCardRoute:O,tenantEmailDomain:C})=>{if(k===!0){if(o)return e.jsx(De,{tenantEmailDomain:C});if(i)return e.jsx(fe,{tenantEmailDomain:C});if(O)return e.jsx(ye,{tenantEmailDomain:C})}return o?e.jsx(De,{tenantEmailDomain:C}):i?e.jsx(fe,{tenantEmailDomain:C}):O?e.jsx(ye,{tenantEmailDomain:C}):f?e.jsx(dt,{tenantEmailDomain:C}):N?e.jsx(ut,{tenantEmailDomain:C}):e.jsx(lt,{})},ct={dashboard:()=>s((()=>import("./DashboardRoutes-Cq6T81sz.js")),__vite__mapDeps([9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,0,18,19,20,21,22,23,24,8])),bills:()=>s((()=>import("./BillPayRoutes-DW75K5BT.js")),__vite__mapDeps([25,1,2,3,4,5,6,7,26,0,27,11,14,28,15,20,21,22,29,24,30,18,31,32,33,8])),reimbursement:()=>s((()=>import("./ReimbursementRoutes-CQkJk7qY.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,11,14,29,35,32,33,8])),transactions:()=>s((()=>import("./TransactionListRoutes-CkAkq2Db.js")),__vite__mapDeps([36,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,37,8])),settings:()=>s((()=>import("./SettingsRoutes-Dvz3g8QS.js")),__vite__mapDeps([38,1,2,3,4,5,6,7,22,39,20,21,40,41,42,43,44,13,45,26,0,18,28,15,19,46,31,32,35,8])),reports:()=>s((()=>import("./ReportsRoutes-2nV2dA__.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,0,24,14,15,20,21,22,8])),chargeCards:()=>s((()=>import("./ChargeCardRoutes-B3mzz2dP.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,11,20,21,22,30,28,15,0,18,14,49,26,8])),people:()=>s((()=>import("./PeopleRoutes-CJb_v6ZN.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,0,11,20,21,22,8])),expenseAutomation:()=>s((()=>import("./ExpenseAutomationRoutes-eWOWr85_.js")),__vite__mapDeps([51,1,2,3,0,4,5,6,7,11,12,13,14,15,16,52,17,10,53,54,45,29,8])),treasury:()=>s((()=>import("./TreasuryRoutes-C46QwTot.js")),__vite__mapDeps([55,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,11,14,24,8])),vendors:()=>s((()=>import("./VendorsRoutes-DJ1SY9-A.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,26,0,24,53,54,15,11,20,21,22,29,45,8])),zeniAccounts:()=>s((()=>import("./ZeniAccountRoutes-drP5zu20.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,27,26,11,37,8]))},mt=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ae=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},_t=l((()=>s((()=>import("./ReportsRoutes-2nV2dA__.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,0,24,14,15,20,21,22,8])))),Et=l((()=>s((()=>import("./AddressRoutes-BHptFN8Q.js")),__vite__mapDeps([58,1,2,3,26,4,5,6,7,0,8])))),ht=l((()=>s((()=>import("./PeopleRoutes-CJb_v6ZN.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,0,11,20,21,22,8])))),pt=l((()=>s((()=>import("./PandLWithForecastRoutes-CsRM4aCt.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,0,24,11,14,15,20,21,22,8])))),xt=l((()=>s((()=>import("./CustomerOnboardingRoutes-D6DFJEPX.js")),__vite__mapDeps([60,1,2,3,26,4,5,6,7,0,40,41,42,43,44,13,46,49,8])))),gt=l((()=>s((()=>import("./VendorsRoutes-DJ1SY9-A.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,26,0,24,53,54,15,11,20,21,22,29,45,8])))),Rt=l((()=>s((()=>import("./TransactionDetailRoutes-C4_Uqx9Y.js")),__vite__mapDeps([61,1,2,3,0,4,5,6,7,12,11,13,14,15,16,8])))),ve=l((()=>s((()=>import("./EntityDetailRoutes-GqYvTApk.js")),__vite__mapDeps([62,1,2,3,4,5,6,7,13,10,11,12,14,15,16,17,8])))),jt=l((()=>s((()=>import("./DashboardRoutes-Cq6T81sz.js")),__vite__mapDeps([9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,0,18,19,20,21,22,23,24,8])))),Ce=l((()=>s((()=>import("./BillPayRoutes-DW75K5BT.js")),__vite__mapDeps([25,1,2,3,4,5,6,7,26,0,27,11,14,28,15,20,21,22,29,24,30,18,31,32,33,8])))),It=l((()=>s((()=>import("./SettingsRoutes-Dvz3g8QS.js")),__vite__mapDeps([38,1,2,3,4,5,6,7,22,39,20,21,40,41,42,43,44,13,45,26,0,18,28,15,19,46,31,32,35,8])))),Tt=l((()=>s((()=>import("./InvoicingRoutes-DByPH_q7.js")),__vite__mapDeps([63,1,2,3,4,5,6,7,26,0,20,21,22,40,41,42,43,44,13,8])))),Oe=l((()=>s((()=>import("./ReimbursementRoutes-CQkJk7qY.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,11,14,29,35,32,33,8])))),At=l((()=>s((()=>import("./ZeniAccountRoutes-drP5zu20.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,27,26,11,37,8])))),bt=l((()=>s((()=>import("./TreasuryRoutes-C46QwTot.js")),__vite__mapDeps([55,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,11,14,24,8])))),ft=l((()=>s((()=>import("./TransactionListRoutes-CkAkq2Db.js")),__vite__mapDeps([36,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,37,8])))),Dt=l((()=>s((()=>import("./ChargeCardRoutes-B3mzz2dP.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,11,20,21,22,30,28,15,0,18,14,49,26,8])))),yt=l((()=>s((()=>import("./NotificationRoutes-qrDe7DaH.js")),__vite__mapDeps([64,1,2,3,0,4,5,6,7,11,22,8])))),vt=l((()=>s((()=>import("./PerformanceRoutes-CBJPZiyx.js")),__vite__mapDeps([65,1,2,3,0,4,5,6,7,11,20,21,22,8])))),Ct=l((()=>s((()=>import("./ExpenseAutomationRoutes-eWOWr85_.js")),__vite__mapDeps([51,1,2,3,0,4,5,6,7,11,12,13,14,15,16,52,17,10,53,54,45,29,8])))),Ot=l((()=>s((()=>import("./ActualMatchingMatchDetailScreen-BOiFt58b.js")),__vite__mapDeps([66,1,2,3,4,5,6,7,52,17,13,15,0,8])))),Ut=l((()=>s((()=>import("./RewardsRoutes-3VUweoT_.js")),__vite__mapDeps([67,1,2,3,4,5,6,7,0,8])))),Pt=l((()=>s((()=>import("./TaskRoutes-BFYoKVIc.js")),__vite__mapDeps([68,1,2,3,0,4,5,6,7,14,20,21,22,69,11,70,8])))),wt=l((()=>s((()=>import("./AiCfoScreen-BNQqWk-X.js")),__vite__mapDeps([71,1,2,3,4,5,6,7,23,54,15,70,8])))),Ue=l((()=>s((()=>import("./CardsAiCfoScreen-fM-dv9EP.js")),__vite__mapDeps([72,1,2,3,4,5,6,7,8])))),b=l((()=>s((()=>import("./NotFoundScreen-CZf0Su98.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),Ft=l((()=>s((()=>import("./TaskListScreen-D0yZXtyL.js").then((o=>o.f))),__vite__mapDeps([69,1,2,3,4,5,6,7,11,20,21,22,70,8])))),Lt=({isDashboardAccess:o,showZeniAccountRoute:f,isUserHasBillPayAccess:N,isUserHasReimbursementAccess:i,showTreasuryRoute:k,isTenantBankingOnly:O,isTenantCardsOnly:C,showChargeCardRoute:V})=>{if(O===!0){if(f)return e.jsx(u,{to:"checking"});if(k)return e.jsx(u,{to:"treasury"});if(V)return e.jsx(u,{to:"cards"})}return C===!0&&V?e.jsx(u,{to:"cards"}):o?e.jsx(u,{to:"dashboard"}):f?e.jsx(u,{to:"checking"}):k?e.jsx(u,{to:"treasury"}):V?e.jsx(u,{to:"cards"}):N?e.jsx(u,{to:"bills"}):i?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},Pe=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/dashboard`}),$t=Object.freeze(Object.defineProperty({__proto__:null,default:function({setTenantEmailDomain:o}){const f=Gs(),N=qs(),{tenantEmailDomain:i}=Ys(),k=Ks().mode,{setLoading:O,clearAllLoading:C,clearLoading:V}=Qs(),D=y.getSignedInUserTenant(i)?.tenantId,I=y.getSignedInUser(),X=Es(I),z=Ws(),[L,we]=P.useState(!1),r=$((a=>hs(a))),{useFeatureGate:H}=Js(),M=et(),K=st(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:ke}=H(S.isChargeCardFeatureEnabled),{isFeatureEnabled:oe}=H(S.isDebitCardFeatureEnabled),T=$((a=>a.tenantState.fetchState)),p=$((a=>a.tenantState.activeTenantFetchState.fetchState)),E=p==="Completed"||T==="Completed"?ps(oe,r):void 0,Q=p==="Completed"||T==="Completed"?xs(r):void 0,re=p==="Completed"||T==="Completed"?gs(r)&&!Rs(r):void 0,Ve=tt(r,ke,oe),{isCardsHidden:He}=nt(r?.tenantId),Be=!Ve||!!He,{isFeatureEnabled:Se}=H(S.isSettingsFeatureEnabled),{isFeatureEnabled:J}=H(S.isAiCfoFileUploadEnabled),{isFeatureEnabled:Ne}=H(S.isInvoicingFeatureEnabled??"is_invoicing_feature_enabled"),Me=Ne||rt==="DEV",Ze=r?.userRole!=null&&js(r.userRole),G=$((a=>Is(a)));if(i!=null){const a=y.getSignedInUserTenant(i);I!=null&&a!=null&&be(I,r,k)}const Z={tenantId:D,userId:I?.userId,sessionId:I?.zeniSessionId},ie=Ts(),h=at(),$e=r.company==null||h?.loggedInUserRoleMap!=null&&pe(h.loggedInUserRole),ze=As(h?.loggedInUserRoleMap),ee=Te("/:tenantEmailDomain/onboarding/*")!==null,Ge=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),se=Ge?.params.selectedPeriod,qe=$((a=>Z.tenantId!=null?bs(a,Z.tenantId):void 0));P.useEffect((()=>{O(F.TENANT_FETCHING),o(i)}),[i]),P.useEffect((()=>{if(se!=null&&D!=null){const a=se.split("-");if(a.length===2){const A=fs(Number(a[0])),c=Number(a[1]),t=Ds(`01-${A<10?`0${A}`:A}-${c}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),d=ys();t.isAfter(d,"month")===!1?f(vs(D,{month:A,year:c})):N(`/${i}/month_end_close_checks/review`)}}}),[se,i,D]),P.useEffect((()=>{L||(we(!0),O(F.TENANT_FETCHING))}),[L,Z,ie,I,f,y]),P.useLayoutEffect((()=>{!Cs(ie,Z)&&y.isSignedIn()&&(O(F.TENANT_FETCHING),(function(a,A,c,t){if(ge(A?.userId,A?.zeniSessionId,a.tenantId),c($s(!0)),c(Re(a.tenantId)),a.tenantId!=null&&_.clearTenant(a.tenantId),a.tenantId!=null){const d=y.getSignedInUserTenantWithId(a.tenantId);t&&Ae.updateAppLocaleID(it(t)),d?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(d?.tenantEmailDomain)}a.userId!=null?ne.identify(a.userId,{tenant_id:a.tenantId}):ne.resetUserIdentity()})(Z,I,f,qe))}),[D]),P.useEffect((()=>{y.isSignedIn()&&(O(F.TENANT_FETCHING),(function(a,A,c,t,d,q,B){if(c==null&&t==null)return void console.warn("There is no current tenant selected!!");const Y=t!=null&&d?.zeniSessionId!=null,cs=c==null||c.tenantId!==t,ms=c!=null&&c.excludedResources==null,_s=c!=null&&c.externalConnections==null;if(Y&&cs){B(Re(t));const W=y.getSignedInUserTenantWithId(t);W?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(W?.tenantEmailDomain),ge(d?.userId,d?.zeniSessionId,t),_.shouldFetchExcludedResources(t)&&(_.markExcludedResourcesFetchStarted(t),B(je(d.userId,t))),_.shouldFetchConnections(t)&&(_.markConnectionsFetchStarted(t),B(Ie(d.userId,t)))}else Y&&ms&&_.shouldFetchExcludedResources(t)&&(_.markExcludedResourcesFetchStarted(t),B(je(d.userId,t))),Y&&_s&&_.shouldFetchConnections(t)&&(_.markConnectionsFetchStarted(t),B(Ie(d.userId,t)));if(Y){ne.identify(d.userId,{tenant_id:t});const W=t==null||t!=null&&(A==="Completed"||A==="Error");a==="Completed"||A!=="Not-Started"&&A!=="Error"||t==null||!_.shouldFetchActiveTenant(t)||(_.markActiveTenantFetchStarted(t),q(F.TENANT_FETCHING),B(zs(d.userId,t,d.zeniSessionId))),W&&(a==="Not-Started"||a==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),B(xe(d.userId,d.zeniSessionId)))}})(T,p,r,D,I,O,f))}),[D,p]),P.useEffect((()=>{y.isSignedIn()&&T==="Completed"&&G.tenantsBaseInOrder.length>0&&(V(F.TENANT_FETCHING),y.saveSignedInUserTenants(Os(G.tenantsBaseInOrder)),I!=null&&be(I,r,k,void 0,G.tenantsBaseInOrder))}),[G,T,r,I]),P.useEffect((()=>{p==="In-Progress"&&O(F.TENANT_FETCHING),p!=="Completed"&&p!=="Error"||(p==="Completed"&&D!=null?(C(),_.markActiveTenantFetchCompleted(D)):p==="Error"&&D!=null&&(_.markActiveTenantFetchFailed(D),V(F.TENANT_FETCHING),V(F.TENANT_SWITCHING))),T!=="Completed"&&T!=="Error"||(T==="Completed"?_.markAllTenantsFetchCompleted():T==="Error"&&_.markAllTenantsFetchFailed())}),[p,T,D,L]);const le=P.useRef(!1);P.useEffect((()=>{!le.current&&p==="Completed"&&L&&(le.current=!0,(function(a=mt,A=3e3){setTimeout((()=>{const c=t=>{if(t>=a.length)return;const d=a[t],q=ct[d];q!=null?q().then((()=>ae((()=>c(t+1))))).catch((()=>ae((()=>c(t+1))))):c(t+1)};ae((()=>c(0)))}),A)})())}),[p,L]);const U=r?.userRole!=null&&Us(r?.userRole),{isFeatureEnabled:Ye}=H(S.isReferralFeatureEnabled),{isFeatureEnabled:We}=H(S.isAccrualEnabled),Xe=r?.userRole!=null&&r.userRole.includes("charge_card_user"),Ke=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),w=r?.userRole!=null&&pe(r.userRole),ue=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!U,de=!Be&&!U,Qe=Ps(h?.loggedInUserRoleMap),Je=r.externalConnections?.accounting[0]?.isValid,es=r.externalConnections?.fetchState==="Completed",te=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!U,me=ce&&ws(h?.loggedInUserRoleMap),_e=Fe&&!U,ss=Le&&!U,ts=ue&&Fs(h?.loggedInUserRoleMap),ns=de&&Ls(h?.loggedInUserRoleMap),as=_e&&ks(h?.loggedInUserRoleMap),os=Vs(h?.loggedInUserRoleMap),rs=Hs(h?.loggedInUserRoleMap),is=Bs(h?.loggedInUserRoleMap),ls=Ss(h?.loggedInUserRoleMap),us=Ns(h?.loggedInUserRoleMap),x=Ms(h?.loggedInUserRoleMap),g=Zs(h?.loggedInUserRoleMap),Ee=ue&&x,he=ce&&g,R=_e&&is,j=ss&&ls,m=de&&us,ds=r.excludedResources?.resources?.find((a=>a.resource==="/invites"))!=null||ze===!0||Qe===!0||os===!0||rs===!0;return y.isSignedIn()?D==null?T==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}):(I!=null&&T!=="In-Progress"&&f(xe(I.userId,I.zeniSessionId)),null):p!=="In-Progress"&&p!=="Not-Started"||T==="Completed"?(te===!0||X&&!ee)&&es&&Je!==!0&&E===!1&&Q===!1&&re===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!L||re!==!0||te!==!0||ee||X?!L||te!==!1||ee||X?L&&r?.userRole&&E!=null&&Q!=null&&i!=null&&Object.keys(h.loggedInUserRoleMap).length>0?e.jsx(Xs,{children:e.jsxs(n,{element:e.jsx(ot,{}),children:[e.jsx(n,{path:"/",element:e.jsx(Lt,{isDashboardAccess:w,showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,isTenantCardsOnly:Q,showChargeCardRoute:m})}),e.jsx(n,{path:"dashboard/*",element:w?e.jsx(jt,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reports/*",element:w?e.jsx(_t,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"people/*",element:ds||w?e.jsx(ht,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"forecast/*",element:w?e.jsx(pt,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"onboarding/*",element:e.jsx(xt,{})}),e.jsx(n,{path:"transaction/*",element:w&&U===!1||Xe||Ke?e.jsx(Rt,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"transactions/*",element:w&&U===!1?e.jsx(ft,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"customer/*",element:w&&U===!1?e.jsx(ve,{entityType:"customer"}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,isTenantBankingOnly:E,showTreasuryRoute:j,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"vendor/*",element:w&&U===!1?e.jsx(ve,{entityType:"vendor"}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"tasks",element:e.jsx(Ft,{})}),e.jsx(n,{path:"tasks/*",element:e.jsx(Pt,{})}),e.jsx(n,{path:"address/*",element:ts||me||as||ns?e.jsx(Et,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"checking/*",element:R?e.jsx(At,{}):e.jsx(b,{})}),e.jsx(n,{path:"treasury/*",element:j?e.jsx(bt,{}):e.jsx(b,{})}),e.jsx(n,{path:"performance",element:K===!0?e.jsx(vt,{}):e.jsx(Pe,{tenantEmailDomain:i})}),e.jsx(n,{path:"month_end_close_checks/review/*",element:K===!0&&U===!1?e.jsx(Ct,{}):e.jsx(Pe,{tenantEmailDomain:i})}),e.jsx(n,{path:"expense-automation/actual-matching/:matchId",element:K===!0&&U===!1&&We===!0?e.jsx(Ot,{}):e.jsx(b,{})}),e.jsx(n,{path:"notifications/*",element:e.jsx(yt,{})}),e.jsx(n,{path:"vendors/*",element:$e?e.jsx(gt,{}):e.jsx(b,{})}),e.jsx(n,{path:"bill/*",element:Ee?e.jsx(Ce,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"bills/*",element:Ee?e.jsx(Ce,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reimbursement/*",element:he?e.jsx(Oe,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reimbursements/*",element:he?e.jsx(Oe,{}):e.jsx(v,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"settings/*",element:Se?e.jsx(It,{hasAdminLevelAccess:me}):e.jsx(b,{})}),e.jsx(n,{path:"invoicing/*",element:Me&&Ze?e.jsx(Tt,{}):e.jsx(b,{})}),e.jsx(n,{path:"cards/ask",element:m&&M?e.jsx(Ue,{isFileUploadEnabled:J}):e.jsx(b,{})}),e.jsx(n,{path:"cards/ask/:session_id",element:m&&M?e.jsx(Ue,{isFileUploadEnabled:J}):e.jsx(b,{})}),e.jsx(n,{path:"cards/*",element:m?e.jsx(Dt,{}):e.jsx(b,{})}),e.jsx(n,{path:"rewards/*",element:Ye?e.jsx(Ut,{}):e.jsx(b,{})}),e.jsx(n,{path:"/ai-cfo",element:M?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(n,{path:"/ai-cfo/",element:M?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(n,{path:"/ai-cfo/:session_id",element:M?e.jsx(wt,{isFileUploadEnabled:J}):e.jsx(b,{})}),e.jsx(n,{path:"*",element:e.jsx(b,{})})]})}):null:(o(void 0),e.jsx(u,{to:`/${i}/onboarding`,replace:!0})):(o(void 0),e.jsx(u,{to:`/${i}/onboarding/thankyou`,replace:!0})):null:(console.warn("User logged out!!"),o(void 0),e.jsx(u,{to:"/signin/auth",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}))}},Symbol.toStringTag,{value:"Module"}));export{v as F,$t as S};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-
|
|
1
|
+
import{j as a}from"./liveblocks-DRe6CbUC.js";import{a as d}from"./sentry-0qxHOSjH.js";import{h as N,g as H,u as M,i as F,j as C,l as K,n as Q,o as k}from"./core-B-JOvAoN.js";import{fI as A,Zy as Pe,NM as ve,Z6 as Ae,Zf as we,c9 as Y,cU as De,cV as Ue,bq as Me,df as _e,G5 as Re,Zz as Te,Pd as Be,MD as Ze,Mu as de,Mr as Oe,G9 as ue,Mx as pe,MA as ge,MG as W,Cj as ee,G8 as Ve,lx as $,lA as me,ZA as Ne,mK as Fe,Gq as Le,VN as Ge,VO as $e,lv as He,ZB as Ke,ly as qe,uK as ze,VI as Je,VJ as Qe,uO as Xe,hY as Ye,UH as J,hQ as ae,hN as We,hV as en,UI as nn,Gn as tn,ZC as an,ZD as on,MU as sn,m2 as rn,d$ as fe,e0 as he,ZE as ln,gF as cn,UX as dn,Gm as oe,gK as se,gJ as un,Gl as pn,gI as gn,gH as mn,ZF as fn,U7 as Ce,ZG as hn,ZH as Cn,ZI as yn,ZJ as Sn,ZK as bn,ZL as In,Gt as xn,ZM as En,Gk as ie,Ge as G,ZN as kn,ZO as jn,ZP as re,ZQ as Pn,dU as vn,ZR as An,ZS as wn,ZT as Dn,Uj as Un,c1 as Mn,c8 as _n,c7 as Rn,c2 as Tn,ZU as Bn,c5 as Zn,c4 as On,c6 as Vn,c3 as Nn}from"./zeni-epic-state-C5XzLjC7.js";import{bT as Fn,z as v,O as L,a7 as ne,c3 as Ln,k as q,_ as te,f as O,h as ye,X as Se,c4 as Gn,j as $n,Y as be,c5 as Hn,ai as Kn,c6 as qn,c7 as zn,aq as Jn,c8 as Qn,p as Xn,d as Ie,c9 as Yn}from"./index-d9PzVM0C.js";import{n as B}from"./mui-D61DLOo-.js";import{u as xe}from"./useTaskManagerAccess-DvFZ_glf.js";import{U as Wn}from"./AccountMappingScreen-DswLKEe5.js";import{t as et,A as nt}from"./AddressScreen-CA5KE8MT.js";import V from"./NotFoundScreen-CZf0Su98.js";import{g as tt}from"./analyticsHelper-CWjQXseh.js";import{u as at,B as ot}from"./BusinessVerificationPageScreen-DO7l09xz.js";import{C as st}from"./CompanyPassportScreen-BbenDHB4.js";import{M as R}from"./MobileAppDrawer-Cm83j2vk.js";import{u as it,a as rt}from"./useEmailConnectResultRefresh-D_JJFEwu.js";import{q as le}from"./QBOConnectionScreen-BVEoinfN.js";import{B as lt}from"./BillPayApprovalRoutes-D4ZedgQD.js";import{R as ct}from"./ReimbursementApprovalRoutes-x_cN8gHc.js";import"./recharts-DqtwTOUm.js";import"./analytics-DAlTxslb.js";import"./plaid-BBL8Aplq.js";import"./dnd-COhfK8Um.js";import"./stripe-cKAAJElX.js";import"./lottie-mNMGPSgQ.js";import"./lexical-BcThc0IB.js";import"./pdf-Di2GQu6S.js";import"./utils-C7LPuKOj.js";import"./accountMappingHelper-YAw2LuBf.js";import"./routePaths-Dw39xRTk.js";import"./InboxNotificationsProvider-DZQGEyxq.js";import"./empty-Dw_cE_Ok.js";import"./pdf-lib-MZXKzNW5.js";import"./index-BtM-6hof.js";import"./url-CKMjIwmH.js";import"./index-CuyBZ-DG.js";import"./decodeURIComponentSafe-KCik1Gu_.js";import"./ReimbursementApprovalRuleDetailScreen-CmKBSl1I.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new e.Error().stack;l&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[l]="c9ad8f54-a815-42ed-b099-11c908c30d55",e._sentryDebugIdIdentifier="sentry-dbid-c9ad8f54-a815-42ed-b099-11c908c30d55")}catch{}})();const dt=B.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -6,7 +6,7 @@ import{j as a}from"./liveblocks-CQOAuUNI.js";import{a as d}from"./sentry-pp_6zWN
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,ut=K((function(e,l){const o=
|
|
9
|
+
`,ut=K((function(e,l){const o=A(e),i=Ae(e),r=we(e),n=l.roleMap.bill_pay_admin;return{isDisabled:(Y(o?.userRole??[])||n)&&"readonly",billpayApprovalView:i,remiApproverView:r,analytics:q}}),(function(e,l){const{navigate:o,currentTenant:i}=l;return{onSetupApprovalRulesBillPaySectionClick:()=>{o("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{o("reimbursements/approval-rules")},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}}))(Ln),pt=()=>{const e=N(),l=H(),o=M(),{tenantEmailDomain:i}=F(),[r,n]=d.useState(!1),[t,s]=d.useState(!1),c=C((g=>A(g)));at();const u=C((g=>g.remiSetupApproverViewState.fetchState)),h=C((g=>Pe(g))),{isApprovalRulesV3Enabled:S,isLoading:m}=Fn(c?.tenantId),p=c.companyId??v.getSignedInUserTenant(i)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const b=L();d.useEffect((()=>{t||u!=="Not-Started"||m||c?.tenantId==null||(s(!0),o(ve(!0,!1,!1,S)))}),[t,u,m,S,c?.tenantId,o]);const E=g=>{n(g)};return b?.loggedInUserRoleMap!=null?a.jsxs(dt,{children:[a.jsx(R,{isAppContentDrawerOpen:r,handleDrawerToggle:E}),a.jsx(ut,{navigate:e,location:l,companyId:p,currentTenant:c,roleMap:b.loggedInUserRoleMap,onClickMenuIcon:()=>{E(!0)}})]}):a.jsx(ne,{fetchState:h.fetchState})},gt=B.div`
|
|
10
10
|
display: flex;
|
|
11
11
|
height: 100%;
|
|
12
12
|
width: 100%;
|
|
@@ -14,7 +14,7 @@ import{j as a}from"./liveblocks-CQOAuUNI.js";import{a as d}from"./sentry-pp_6zWN
|
|
|
14
14
|
flex-direction: column;
|
|
15
15
|
align-items: center;
|
|
16
16
|
background-color: ${e=>e.theme.colors.grey4};
|
|
17
|
-
`,mt=K((function(e,l){const{companyId:o,isZeniAccountEnabled:i,isChargeCardEnabled:r,isBillPayEnabled:n,isRemiEnabled:t,isTreasuryEnabled:s}=l,c=
|
|
17
|
+
`,mt=K((function(e,l){const{companyId:o,isZeniAccountEnabled:i,isChargeCardEnabled:r,isBillPayEnabled:n,isRemiEnabled:t,isTreasuryEnabled:s}=l,c=A(e);return{bankSetupView:Te(e,o,n,t,i,r,s),connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:q}}),(function(e,l){const{navigate:o,currentTenant:i,companyId:r}=l;return{onFetchLinkTokenClick:(n,t,s)=>{e(ee(t,n,s))},onEstablishConnectionClick:(n,t,s)=>{e(W(n,r,t,s))},onUpdatePaymentAccountStatus:(n,t,s,c,u)=>{e(ge(n,t,u,c,s))},onUpdatePaymentAccountLoginStatus:(n,t,s,c)=>{e(pe(!1,n,c,s,t))},onEstablishConnectionSuccess:(n,t)=>{e(ue(t,n))},onUpdateAccountClick:(n,t,s,c,u)=>{e(u==="paymentAccount"?de(n,t,s,c):Oe(c,n,t))},onUpdatePrimaryFundingAccount:(n,t,s)=>{e(Ze(r,t,n,s))},onRemoveConnection:n=>{e(Be(n))},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}}))(Gn),ft=()=>{const e=N(),l=H(),o=M(),{tenantEmailDomain:i}=F(),r=L(),{useFeatureGate:n}=te(),{isFeatureEnabled:t}=n(O.isChargeCardFeatureEnabled),{isFeatureEnabled:s}=n(O.isDebitCardFeatureEnabled),[c,u]=d.useState(!1),[h,S]=d.useState(!1),m=C((w=>A(w))),p=C((w=>w.settingsViewState.bankConnection.fetchState)),b=De(m,r?.loggedInUserRoleMap),E=Ue(m,r?.loggedInUserRoleMap),g=m?.userRole!=null&&Me(m.userRole),P=!!m.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!g,j=m.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!g,_=ye(m,t,s),D=_e(m,r?.loggedInUserRoleMap)&&_,{isCardsHidden:I}=Se(m?.tenantId),x=m.companyId??v.getSignedInUserTenant(i)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");d.useEffect((()=>{h||p==="Completed"||(S(!0),o(Re(!1)))}),[h,o,p]);const T=w=>{u(w)};return b||P||E||D?a.jsxs(gt,{children:[a.jsx(R,{isAppContentDrawerOpen:c,handleDrawerToggle:T}),a.jsx(mt,{navigate:e,location:l,companyId:x,currentTenant:m,roleMap:r.loggedInUserRoleMap,isBillPayEnabled:b,isRemiEnabled:E,isZeniAccountEnabled:P,isChargeCardEnabled:D,isChargeCardsHidden:I,isTreasuryEnabled:j,onClickMenuIcon:()=>{T(!0)}})]}):a.jsx(V,{})},ht=B.div`
|
|
18
18
|
display: flex;
|
|
19
19
|
height: 100%;
|
|
20
20
|
width: 100%;
|
|
@@ -22,7 +22,7 @@ import{j as a}from"./liveblocks-CQOAuUNI.js";import{a as d}from"./sentry-pp_6zWN
|
|
|
22
22
|
flex-direction: column;
|
|
23
23
|
align-items: center;
|
|
24
24
|
background-color: ${e=>e.theme.colors.grey4};
|
|
25
|
-
`,
|
|
25
|
+
`,Ct=K((function(e,l){const{companyId:o}=l,i=A(e),r=l.roleMap.bill_pay_admin,n=Ne(e,o),{uiState:t}=n,s=(Y(i?.userRole??[])||r)&&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:be.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:i.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:s,analytics:q}}),(function(e,l){const{navigate:o,currentTenant:i,companyId:r}=l;return{onFetchLinkTokenClick:(n,t)=>{e(ee("billing_setup",n,t))},onEstablishConnectionClick:n=>{e(W(n,r,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(ue("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,t,s)=>{e(ge(n,t,"billing","billing_setup",s))},onUpdatePaymentAccountLoginStatus:(n,t)=>{e(pe(!1,n,"billing","billing_setup",t))},onUpdateAccountClick:(n,t)=>{e(de(n,t,"billing","billing_setup"))},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")},handleCreateCardSetupIntent:n=>{e(me(n))},handleConfirmCardSetupIntent:n=>{e(qe(n))},updateCardPaymentModalState:n=>{e(Ke({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,t,s)=>{e(He(n,t,s))},handleFetchPaymentSources:()=>{e($())},resetCardPaymentViewState:()=>{e($e())},handleResetCardPaymentErrorStatuses:()=>{e(Ge())},onBillingAddressSave:n=>{e(Le(n))},onAddressEditHandler:n=>{if(n!=null){const t=et(n);e(Fe({addressType:"subscription_billing_address",addressToCreate:t}))}}}}))(Hn),yt=()=>{const e=N(),l=H(),o=M(),{tenantEmailDomain:i}=F(),[r,n]=d.useState(!1),[t,s]=d.useState(!1),[c,u]=d.useState(!1),h=C((j=>A(j))),S=C((j=>j.cardPaymentViewState)),m=C((j=>j.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState)),p=$n(S.addCardPaymentSourceStatus.fetchState),b=S.addCardPaymentSourceStatus.fetchState,E=h.companyId??v.getSignedInUserTenant(i)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const g=L();d.useEffect((()=>{E!=null&&o(Ve(E,!1))}),[E,o]),d.useEffect((()=>{t||(s(!0),o($()))}),[t,o]),d.useEffect((()=>{c||(me(["card"]),u(!0))}),[c]),d.useEffect((()=>{p==="In-Progress"&&b==="Completed"&&o($())}),[p,b]);const P=j=>{n(j)};return g?.loggedInUserRoleMap!=null?a.jsxs(ht,{children:[a.jsx(R,{isAppContentDrawerOpen:r,handleDrawerToggle:P}),a.jsx(Ct,{navigate:e,location:l,companyId:E,currentTenant:h,roleMap:g.loggedInUserRoleMap,onClickMenuIcon:()=>{P(!0)},googleAPIKey:be.googleMapsAPIKey})]}):a.jsx(ne,{fetchState:m})},X="external_integrations",St=K((function(e){const l=Qe(e,X);return{notifyMeRegisteredSlugs:new Set(l.map((o=>o.additionalInfo)).filter((o=>o!=null)))}}),(function(e,l){const{navigate:o,integrationsView:i,signedInUserEmail:r,tenantEmailDomain:n,tenantId:t}=l;return{onBackClick:()=>{o("../")},onNavigateToDashboard:()=>{o("../dashboard")},onReconnectQBO:()=>{le.init("/connection/auth",n),le.handleClick()},onRefreshClick:()=>{i.integrations.refreshQBO.fetchState!=="In-Progress"&&e(tn())},onSaveChargeBeeCredentials:(s,c)=>{const u=i.externalConnections?.revenue?.find((h=>h.connectionName==="chargebee"))?.connectionId;u!=null&&e(en(t,u,J("revenue"),nn("chargebee"),{api_key:s,site:c}))},onConnectHubSpot:(s,c)=>{const u=i.externalConnections?.revenue?.find((h=>h.connectionName==="hubspot"))?.connectionId;if(u!=null){const h=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:s,client_secret:c,connection_id:u,redirect_uri:h,tenant_id:t}));const S="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(s)}&scope=${encodeURIComponent(S)}&redirect_uri=${encodeURIComponent(h)}`}},onDisconnect:(s,c)=>{e(We(t,s,J(c)))},onConnectGmail:()=>{e(ae(t,"gmail",window.location.href))},onConnectOutlook:()=>{e(ae(t,"outlook",window.location.href))},onSaveConnectorCredentials:s=>{e(Ye(t,J("payments"),s))},onNotifyMe:s=>{q.trackIntegrationsNotifyMeClicked("Settings",s),e(Xe(X,s,r))}}}))(qn),bt=()=>{const e=Kn(),l=N(),o=M(),{tenantEmailDomain:i}=F(),{pendingAutoFocusTabId:r}=it(),[n,t]=d.useState(!1),s=C((I=>I.tenantState.fetchState)),c=C((I=>A(I))),u=c.companyId??v.getSignedInUserTenant(i)?.companyId,h=v.getSignedInUser(),S=L(),m=Y(c.userRole??[]);if(h==null)throw Error("Can't access Integrations page without signing in...");d.useEffect((()=>{o(ze(X))}),[o]);const[p,b]=d.useState(!1);d.useEffect((()=>{p||(b(!0),o($()))}),[p,o]);const E=I=>{t(I)},g=C((I=>Je(I,u))),P=C((I=>I.plaidAccountViewState.external_account.plaidConnectionDetails)),{plaidAccounts:j,onAddPlaidAccount:_,onReLoginPlaidAccount:D}=rt({companyId:u??c.companyId});return S?.loggedInUserRoleMap!=null?a.jsxs(It,{children:[a.jsx(R,{isAppContentDrawerOpen:n,handleDrawerToggle:E}),a.jsx(St,{navigate:l,meetingUrl:e("settings_integrations"),onClickMenuIcon:()=>{E(!0)},isAdmin:m,integrationsView:g,signedInUserEmail:h.userEmail??"",tenantEmailDomain:c.tenantEmailDomain??i??"",tenantId:c.tenantId,saveChargeBeeState:g.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:g.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:g.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:g.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:g.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(g.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map((([I,x])=>[I,x?.message]))),deleteConnectionState:g.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:g.externalConnections?.deleteConnectionError?.message,isLoading:s==="In-Progress",autoFocusTabId:r??void 0,plaidAccounts:j,onAddPlaidAccount:_,onReLoginPlaidAccount:D,plaidConnectionDetails:P})]}):a.jsx(ne,{fetchState:s})},It=B.div`
|
|
26
26
|
display: flex;
|
|
27
27
|
height: 100%;
|
|
28
28
|
width: 100%;
|
|
@@ -38,7 +38,7 @@ import{j as a}from"./liveblocks-CQOAuUNI.js";import{a as d}from"./sentry-pp_6zWN
|
|
|
38
38
|
flex-direction: column;
|
|
39
39
|
align-items: center;
|
|
40
40
|
background-color: ${e=>e.theme.colors.grey4};
|
|
41
|
-
`,Et=()=>{const e=M(),{tenantEmailDomain:l}=
|
|
41
|
+
`,Et=()=>{const e=M(),{tenantEmailDomain:l}=F(),[o,i]=d.useState(!1),r=C((p=>A(p))).companyId??v.getSignedInUserTenant(l)?.companyId,n=v.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const t=C((p=>an(p,n.userId))),s=C((p=>on(p,r,"bill_pay","user_reimbursement_account"))),{plaidConnectionDetails:c}=s,u=p=>{i(p)},h=d.useCallback((p=>{e(ee("user_reimbursement_account",p))}),[]),S=d.useCallback((p=>{e(W(p,r,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))}),[]);d.useEffect((()=>{t.fetchState!=="Completed"&&t.fetchState!=="In-Progress"&&e(sn(n.userId))}),[n.userId,t.fetchState]);const m=t.fetchState==="Not-Started"||t.fetchState==="In-Progress";return a.jsxs(xt,{children:[a.jsx(R,{isAppContentDrawerOpen:o,handleDrawerToggle:u}),a.jsx(zn,{plaidConnectionDetails:c,isLoading:m,myBankConnectionsView:t,onFetchLinkTokenClick:h,onEstablishConnectionClick:S,onClickMenuIcon:()=>{u(!0)}})]})},kt=B.div`
|
|
42
42
|
display: flex;
|
|
43
43
|
height: 100%;
|
|
44
44
|
width: 100%;
|
|
@@ -46,4 +46,4 @@ import{j as a}from"./liveblocks-CQOAuUNI.js";import{a as d}from"./sentry-pp_6zWN
|
|
|
46
46
|
flex-direction: column;
|
|
47
47
|
align-items: center;
|
|
48
48
|
background-color: ${e=>e.theme.colors.grey4};
|
|
49
|
-
`,ce=({appContent:e})=>{const l=M(),o=
|
|
49
|
+
`,ce=({appContent:e})=>{const l=M(),o=N(),i=H(),[r,n]=d.useState(!1),t=C((y=>A(y))),{tenantEmailDomain:s}=t,c=t.companyId??v.getSignedInUserTenant(s)?.companyId;if(v.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:u}=te(),h=!!t.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:S}=u(O.isChargeCardFeatureEnabled),{isFeatureEnabled:m}=u(O.isDebitCardFeatureEnabled),p=t.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",b=C((y=>rn(y))),E=fe(t),g=he(m,t),P=!g&&b,j=ye(t,S,m),{isCardsHidden:_}=Se(t?.tenantId),D=!j||_,{areTenantIdsInSync:I}=Jn();d.useEffect((()=>{I&&l(ln(c,P))}),[c,l,P,I]);const x=C((y=>cn(y,P))),T=x.fetchState==="Not-Started"||x.fetchState==="In-Progress"||c==null,w=dn(t),f=!!t.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,U=y=>{n(y)};return a.jsxs(kt,{children:[a.jsx(R,{isAppContentDrawerOpen:r,handleDrawerToggle:U}),e!=null?a.jsx(a.Fragment,{children:e}):a.jsx(Qn,{myProfileView:x,isAccountingClassesEnabled:b,isReimbursementDisabled:f===!1,isZeniAccountsDisabled:h===!1,isChargeCardDisabled:D,isTreasuryDisabled:p===!1,isLiteRoleDisabled:w===!1,onClickMenuIcon:()=>{U(!0)},isLoading:T,isBankingOnlyTenant:g,isCardsOnlyTenant:E,onAddressClick:y=>{const Z=(function(ke,je){let z=`/${ke}/settings/my_profile`;return z=z.concat(`/new/${je}`),z})(s,y),Ee=Xn(i.state?.pathnameStackToGoBack,i.pathname);o(Z,{state:{pathnameStackToGoBack:Ee}})},onGetOtp:y=>{const Z={...x.myProfileLocalData,phone:y};l(oe({localData:Z})),l(mn(y,"MyProfile"))},onResendOtp:y=>{l(gn(y,"MyProfile"))},onCancelClick:()=>{l(pn())},onSaveClick:()=>{l(se("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},onVerifyOtp:(y,Z)=>{l(un(y,Z,"MyProfile"))},onVerifyOtpSuccess:y=>{y!=null&&v.saveZeniOtpToken(y),l(se("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},updateMyProfileLocalData:y=>{l(oe({localData:y}))}})]})};function jt(){const e=M(),l=C((f=>A(f))),o=l.companyId,i=l.tenantId,r=C((f=>fn(f))),n=C((f=>Ce(f))),t=C((f=>hn(f.notificationRegistryState))),s=C((f=>Cn(f))),c=C((f=>yn(f))),u=Ie(),{isZeniUser:h,isNotificationControlsEnabled:S}=xe(u),[m,p]=d.useState(!1),b=d.useCallback((f=>{p(f)}),[]),E=d.useCallback((f=>{e(Sn(f))}),[]),g=d.useCallback((()=>{u?.userEmail!=null&&e(bn({loggedInUserEmail:u.userEmail})),e(In())}),[u?.userEmail]),P=d.useCallback((()=>{e(xn()),c&&e(En())}),[c]);if(u==null)throw Error("Can't access Notification Settings page without signing in...");const j=d.useCallback((()=>{const f=n.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ie(f,o)),e(G())}),[o,n.notificationSettings.monthEndInsightsNotificationSettings.enabled]),_=d.useCallback((()=>{e(kn())}),[]),D=d.useCallback(((f,U,y)=>{e(jn({eventId:f,channel:re(U),enabled:y}))}),[e]),I=d.useCallback(((f,U)=>{e(Pn({groupId:f,frequency:vn(U)}))}),[e]),x=d.useCallback(((f,U,y)=>{e(An({groupId:f,channel:re(U),enabled:y}))}),[e]),T=d.useMemo((()=>{if(S&&t!=null)return{isZeniUser:h,registry:t,preferences:s,onToggleEventChannel:D,onSetGroupFrequency:I,onSetGroupChannelMaster:x}}),[S,h,t,s,D,I,x]);d.useEffect((()=>{i!=null&&n.fetchState==="Not-Started"&&e(G())}),[e,i,n.fetchState]);const w=d.useRef(i);return d.useEffect((()=>{w.current!==i&&(e(wn()),e(Dn()),e(G()),w.current=i)}),[e,i]),d.useEffect((()=>{if(n.fetchState==="Completed"&&r.fetchState!=="In-Progress"&&r.fetchState!=="Completed"){const f=n.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ie(f,o))}}),[r.fetchState,o,n.notificationSettings.monthEndInsightsNotificationSettings.enabled,n.fetchState]),a.jsxs(a.Fragment,{children:[a.jsx(R,{isAppContentDrawerOpen:m,handleDrawerToggle:b}),a.jsx(Yn,{notificationSettingsView:r,onFormDataChange:E,onCancel:g,onSave:P,onClickMenuIcon:()=>{b(!0)},signedInUser:u,onRefresh:j,resetUpdateStatus:_,taskNotifications:T,isTaskNotificationsDirty:c})]})}function da(e){const[l,o]=d.useState(!1),i=C((b=>Ce(b))),r=C((b=>A(b))),n=L(),t=Ie(),s=M(),{useFeatureGate:c}=te(),{isFeatureEnabled:u}=c(O.isDebitCardFeatureEnabled),{isTaskManagerAccessEnabled:h}=xe(t),S=t?.userEmail==null||i.fetchState!=="Completed"||Un(i.notificationSettings,t.userEmail,u,r,h);d.useEffect((()=>{i.fetchState!=="In-Progress"&&i.fetchState!=="Completed"&&l===!1&&(o(!0),s(G()))}),[i.fetchState,l]);const m=he(u,r),p=fe(r);return i.fetchState!=="In-Progress"&&i.fetchState!=="Not-Started"||S!==!0?Mn(r)?a.jsxs(Q,{children:[_n(n?.loggedInUserRole??[],u,r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"accounting/*",element:a.jsx(Wn,{})}),Rn(n?.loggedInUserRole??[],u,r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"approval_rules/*",element:a.jsx(Pt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),Tn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"my_bank_connections",element:a.jsx(Et,{})}),Bn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"bank_connections",element:a.jsx(ft,{})}),Zn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"business_verification",element:a.jsx(ot,{productType:m?"zeni_accounts":p?"charge_cards":tt(r,n?.loggedInUserRoleMap)})}),On(n?.loggedInUserRole??[],r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"company_details",element:a.jsx(st,{})}),Vn(n?.loggedInUserRole??[],r)&&a.jsx(k,{path:"billing",element:a.jsx(yt,{})}),Nn(n?.loggedInUserRole??[],u,r)&&a.jsx(k,{path:"integrations",element:a.jsx(bt,{})}),a.jsx(k,{path:"my_profile/new/:addressType",element:a.jsx(ce,{appContent:a.jsx(nt,{isSubPage:!1})})}),a.jsx(k,{path:"my_profile",element:a.jsx(ce,{})}),S&&a.jsx(k,{path:"notifications",element:a.jsx(jt,{})}),a.jsx(k,{path:"*",element:a.jsx(V,{})})]}):a.jsx(Q,{children:a.jsx(k,{path:"*",element:a.jsx(V,{})})}):null}function Pt(e){return a.jsxs(Q,{children:[a.jsx(k,{path:"/",element:a.jsx(pt,{})}),a.jsx(k,{path:"bills/approval-rules/*",element:a.jsx(lt,{})}),a.jsx(k,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?a.jsx(ct,{}):a.jsx(V,{})}),a.jsx(k,{path:"*",element:a.jsx(V,{})})]})}export{da as default};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import{j as u}from"./liveblocks-DRe6CbUC.js";import{h as Q,g as X,u as ee,i as H,j as v,N as j,l as G,t as Xe}from"./core-B-JOvAoN.js";import{bK as en,fI as F,cH as nn,HZ as $,Z6 as tn,Z9 as an,v1 as ne,uR as te,mC as ae,BR as L,Zb as Ce,gJ as We,gI as He,gH as Ge,Zc as sn,I6 as on,MD as he,Mu as Ie,Mr as Ae,M9 as Y,Mx as ke,MA as _e,MG as ve,Cj as Pe,h1 as cn,cC as rn,e0 as un,d$ as dn,dj as ln,bu as pn,cv as Fe,Zd as mn,L9 as de,LN as yn,Ze as fn,bL as gn,NY as le,NM as Sn,Zf as bn,Zg as Cn,O0 as hn,O4 as In,Zh as je,BK as An,Ss as kn,OC as be,Pr as pe,Zi as _n,Zj as vn,Zk as Pn,Zl as Ke,Zm as Tn,Vw as En,Yn as Dn,VL as Un,Zn as qe,Md as On,VM as wn,Mh as Fn,Zo as we,OM as Je,mK as Vn,uU as Ye,BT as xn,bF as Re,C3 as Le,cF as Bn,Zp as Qe,Oj as jn,Ok as Rn,Oo as Ln,Zq as Nn,OF as Ne,Zr as Mn,Zs as zn,Zt as Zn,Zu as $n,gY as Wn,Ji as Hn,Zv as Gn,Jn as Kn,Jm as qn}from"./zeni-epic-state-C5XzLjC7.js";import{ai as Te,O as ie,_ as me,f as J,E as Ee,z as E,a8 as se,k as D,a7 as De,S as W,bQ as Jn,ae as oe,bR as V,bi as Ve,bS as Yn,bT as Qn,bU as Xn,o as Be,bV as et,p as Me,aG as ze,a1 as nt,ab as tt,bW as at,bX as it,bY as st,w as ot}from"./index-d9PzVM0C.js";import{a as h}from"./sentry-0qxHOSjH.js";import{n as xe,D as ct,S as rt}from"./mui-D61DLOo-.js";import{u as ut,B as Oe}from"./BusinessVerificationPageScreen-DO7l09xz.js";import{M as ye}from"./MobileAppDrawer-Cm83j2vk.js";import R from"./NotFoundScreen-CZf0Su98.js";import{a as Ze}from"./analyticsHelper-CWjQXseh.js";import{d as $e}from"./routePaths-Dw39xRTk.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]="d0f43357-d63a-444f-97aa-47bac50a6559",e._sentryDebugIdIdentifier="sentry-dbid-d0f43357-d63a-444f-97aa-47bac50a6559")}catch{}})();const dt=xe.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
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
|
+
`,lt=G((function(e,o){const{isUserBillPayAdmin:a,companyId:t}=o,r=F(e),n=tn(e),i=E.getSignedInUser(),l=r.tenantId,s={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:l??""},c=an(e,t),p=a&&c.updateStatus.fetchState!=="In-Progress"&&c.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&c.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&c.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly";return{billPaySetupView:c,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",showIntlWiseWidget:o.showIntlWiseWidget,isDisabled:p,billpayApprovalView:n,analytics:D,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:s}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r}=o;return{onBusinessVerificationSectionClick:()=>{a("../verification"),r?.company?.companyBillPayInfo!=null&&r?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e($(t,!1,!0))},onSetupApprovalRulesSectionClick:()=>{a("../approval-rules")},onFetchLinkTokenClick:(n,i)=>{e(Pe("bill_pay_setup",n,i))},onEstablishConnectionClick:n=>{e(ve(n,t,"bill_pay_setup","bill_pay"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(_e(n,i,"bill_pay","bill_pay_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(ke(!1,n,"bill_pay","bill_pay_setup",i))},onEstablishConnectionSuccess:()=>{e($(t,!0))},onEnableBillPayClick:()=>{e(Y(t,"bill_pay"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?Ie(n,i,"bill_pay","bill_pay_setup"):Ae("reimbursement_setup",n,i))},onUpdatePrimaryFundingAccount:(n,i)=>{e(he(t,"bill_pay_setup",n,i))},onEnableBillPaySuccess:()=>{a("../",{relative:"path"})},onBackClick:()=>{r?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&r.companyBillPayInfo.info.isBillPayEnabled===!1?a("../.."):a("../",{relative:"path"})},onAcceptUpdatedTOS:()=>{e(on(t))},onAcceptUpdatedTOSSuccess:()=>{e($(t,!0))},onGetOtp:(n,i)=>{e(Ge(n,"SpendManagementSetup")),i!=null&&e(sn({officerType:i,phone:n}))},onResendOtp:n=>{e(He(n,"SpendManagementSetup"))},onVerifyOtp:(n,i)=>{e(We(n,i,"SpendManagementSetup"))},onVerifyOtpSuccess:(n,i)=>{n!=null&&i!=null&&e(L(t,n,"bill_pay",!0,!0))},onNavigateToDashboard:()=>{a("../../dashboard")},onNavigateToSettings:()=>{a("../bills/setup")},onInternationPaymentSetUpClick:()=>{a("../international-wire")},onCompanyOfficerUpdated:(n,i)=>{e(Ce({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(L(t,n,"bill_pay",!0,!0,!0))},updateFilesEntity:n=>{e(ae({files:n}))},onDeleteFile:n=>{e(te(n))},onEditFileName:(n,i)=>{e(ne(n,i.split(".")[0]))}}}))(Jn),pt=()=>{const e=Te(),o=Q(),a=X(),t=ee(),{tenantEmailDomain:r}=H(),n=ie(),i=en(n?.loggedInUserRoleMap),{useFeatureGate:l}=me(),{isFeatureEnabled:s}=l(J.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:c}=l(J.isBillPayLocalCurrencyFeatureEnabled),p=Ee(),[g,S]=h.useState(!1),k=h.useRef(!1),I=v((m=>m.billPaySetupViewState.fetchState)),d=v((m=>F(m)));ut();const y=d.companyId??E.getSignedInUserTenant(r)?.companyId;if(E.getSignedInUser()==null)throw Error("Can't access bill pay setup page without signing in...");const f=!!d.companyBillPayInfo?.info?.isBillPayTOSAccepted,P=nn(n?.loggedInUserRoleMap);h.useEffect((()=>{k.current||I!=="Not-Started"||y==null?k.current||I!=="Completed"||y==null||d.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(k.current=!0,t($(y,!1,!0))):(k.current=!0,t($(y,!0)))}),[I,y,t]);const b=m=>{S(m)};if(f===!1||P&&!n?.loggedInUserRoleMap?.bill_pay_admin)return u.jsx(j,{to:"../promo"});if(f===!0&&n?.loggedInUserRoleMap!=null){const m=C=>C.trackPageLoaded(W.Event.billPaySetup);return u.jsxs(dt,{children:[u.jsx(se,{analytics:D,onLoad:C=>m(C)}),u.jsx(ye,{isAppContentDrawerOpen:g,handleDrawerToggle:b}),u.jsx(lt,{navigate:o,location:a,companyId:y,currentTenant:d,isUserBillPayAdmin:i,showIntlWiseWidget:s,meetingUrl:e("bill_pay_setup"),onClickMenuIcon:()=>{b(!0)},isLocalCurrencyEnabled:c})]})}return u.jsx(De,{fetchState:"In-Progress",style:{backgroundColor:p.colors.grey5}})},$t=(e,o)=>e!=null&&(function(a){return a==="debit"||a==="credit"||a==="debit_and_credit"})(e)?e:o,Wt=e=>`/${e}/cards`,Ht=e=>`/${e}/cards/setup`,Gt=e=>`/${e}/cards/onboard`,Kt=(e,o,a,t,r=!1)=>{let n=`/${e}/cards/${encodeURIComponent(o)}`;return t==null||t.status.code!=="inactive"||t.cardHolderUserId!==a.userId||t.type.code!=="business_physical_credit_card"&&t.type.code!=="business_physical_debit_card"?t!=null&&t.status.code==="active"&&t.cardHolderUserId===a.userId&&t.type.code==="business_physical_credit_card"&&r===!0?n+="/addToWallet":t==null||t.type.code!=="business_physical_debit_card"&&t.type.code!=="business_virtual_debit_card"||t.status.code!=="active"||t.cardHolderUserId!==a.userId||t.isPinSet!==!1||(n+="/setPin"):n+="/activate",n},qt=(e,o)=>e.find((a=>a.id===o)),Jt=(e,o,a)=>!e||!o||a.fetchState==="Completed",mt=(e,o,a,t)=>({isCreditCardOffered:e,isDebitCardOffered:o,isDebitCardEnabled:a,isCreditCardEnabled:t}),Yt=(e,o)=>e?{creditCardCashbackOffer:`${o.cashbackAnalytics.creditCardCashbackOffer}%`,debitCardCashbackOffer:`${o.cashbackAnalytics.debitCardCashbackOffer}%`,totalEarnedCashback:V(o.cashbackSummary.cashbackEarned.amount),redeemedCashback:V(o.cashbackSummary.cashbackRedeemed.amount),availableCashback:V(o.cashbackSummary.cashbackAvailable.amount),creditCardCashbackRedemptionMode:o.cashbackAnalytics.creditCardCashbackRedemptionMode,debitCardCashbackRedemptionMode:o.cashbackAnalytics.debitCardCashbackRedemptionMode}:void 0,Qt=(e,o,a,t,r)=>e&&o&&a?{creditAccountId:t.id,creditAccountLimit:V(t.limit.amount),creditAccountAvailableAmount:V(t.available.amount),creditAccountSpentAmount:V(t.balance.amount+t.hold.amount),creditAccountStatus:t.status,outstandingBalance:V(r.remainingAmountDue.amount)}:void 0,Xt=(e,o,a,t,r)=>e&&o&&a?{debitAccountId:t.depositAccounts.map((n=>n.id)),debitAccountName:t.depositAccounts.map((n=>n.accountName)),debitAccountBalance:t.depositAccounts.map((n=>V(n.accountBalance.available.amount))),debitCardsSpend:V(r?.currentMonthSpends.amount??0),debitAccountStatus:t.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:V(o.depositAccountLimit?.accountBalance.available.amount),debitCardsSpend:V(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??E.getSignedInUserTenant(e.tenantEmailDomain)?.companyId,yt=({isBankingOnlyTenant:e,isDebitCardFeatureEnabled:o})=>o||e,ft=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:a,isDebitCardProductVisible:t,chargeCardsCreditAccountLimit:r})=>(e||o||a)&&(!t||r>0),ia=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:a})=>e||o||a,sa=({cardInfo:e,isProductVisible:o,isTOSAccepted:a,isSetupEnabled:t,isUserHasCardsAdminLevelAccess:r,isUserHasCardsAccess:n})=>!!e&&o&&(!a&&r||n&&!r&&!t),gt=G((function(e,o){const{isUserChargeCardAdmin:a,chargeCardSetUpView:t,isDebitCardOnlyEnabled:r,isCreditCardOnlyEnabled:n}=o,i=F(e),l=E.getSignedInUser(),s=i.tenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},p=a&&t.updateStatus.fetchState!=="In-Progress"&&t.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&t.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&t.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly";return{chargeCardSetUpView:t,connectedAccountProvider:i.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:p,analytics:D,isDebitCardOnlyEnabled:r,isCreditCardOnlyEnabled:n,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:c}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r,chargeCardSetUpView:n,isDebitCardTOSAccepted:i,isChargeCardTOSAccepted:l,isChargeCardSetupEnabled:s,isDebitCardSetupEnabled:c,productInformation:p,controllerEmails:g,businessVerificationStatus:S,isCardPolicyEnabled:k,isUserChargeCardAdmin:I}=o;return{onBusinessVerificationSectionClick:()=>{D.trackCardsVerifyIdentityCompanyDetailsClick(g,p,S?.code),a("../verification"),r?.company?.companyChargeCardInfo!=null&&r.company.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(de(t,!1,!0))},...I&&k?{onCardPolicySectionClick:()=>{a("../policy")}}:{},onFetchLinkTokenClick:(d,y)=>{e(Pe("charge_card_setup",d,y))},onEstablishConnectionClick:d=>{e(ve(d,t,"charge_card_setup","charge_cards"))},onUpdatePaymentAccountStatus:(d,y,f)=>{e(_e(d,y,"charge_cards","charge_card_setup",f))},onUpdatePaymentAccountLoginStatus:(d,y)=>{e(ke(!1,d,"charge_cards","charge_card_setup",y))},onEstablishConnectionSuccess:()=>{e(de(t,!0))},onEnableChargeCardClick:()=>{D.trackCardsEnableCardsClick(g,p,"Cards Card Setup"),l===!0&&i===!0&&s===!1&&c===!1?e(Y(t,"charge_cards__debit_cards")):l===!0&&s===!1?e(Y(t,"charge_cards")):i===!0&&c===!1&&e(Y(t,"debit_cards"))},onUpdateChargeCardClick:(d,y,f)=>{const P=n.allBankAccounts.find((m=>m.accountId===n.primaryFundingAccount?.zeniAccountId)),b=n.allBankAccounts.find((m=>m.accountId===d));D.trackCardsZeniCashAccountChangeClick(g,p,{oldZeniCashAccount:P?.accountName??"",newZeniCashAccount:b?.accountName??"",oldZeniCashAccountPosition:n.allBankAccounts.findIndex((m=>m.accountId===n.primaryFundingAccount?.zeniAccountId))+1,newZeniCashAccountPosition:n.allBankAccounts.findIndex((m=>m.accountId===d))+1,numberOfCashAccounts:n.allBankAccounts.length}),e(f==="paymentAccount"?Ie(d,y,"charge_cards","charge_card_setup"):Ae("charge_card_setup",d,y))},onUpdatePrimaryFundingAccount:(d,y)=>{const f=n.allFundingAccounts.find((m=>m.id===d)),P=n.allFundingAccounts.findIndex((m=>m.id===n.primaryFundingAccount?.id))+1,b=n.allFundingAccounts.findIndex((m=>m.id===d))+1;D.trackCardsPaymentAccountChangeClick(g,p,{oldPaymentAccountName:n.primaryFundingAccount?.label??"",oldPaymentAccountBalance:V(n.primaryFundingAccount?.accountBalance?.available?.amount??0),newPaymentAccountName:f?.label??"",newPaymentAccountBalance:V(f?.accountBalance?.available?.amount??0),isOldPaymentAccountRecommended:n.primaryFundingAccount?.accType==="depositAccount",isNewPaymentAccountRecommended:f?.accType==="depositAccount",oldPaymentAccountPosition:P,newPaymentAccountPosition:b,numberOfPaymentAccounts:n.allFundingAccounts.length}),e(he(t,"charge_card_setup",d,y))},onEnableChargeCardSuccess:()=>{e(fn()),a("../",{relative:"path"})},onBackClick:()=>{r?.companyChargeCardInfo?.info?.isChargeCardEnabled||r?.companyDebitCardInfo?.info?.isDebitCardEnabled?a("../",{relative:"path"}):a("../..",{relative:"path"})},onNavigateToDashboard:()=>{a("../../dashboard")},onCompanyOfficerUpdated:(d,y)=>{e(Ce({officerType:d,fileIds:y}))},onSendForVerificationClick:d=>{l===!0&&i===!0?e(L(t,d,"charge_cards__debit_cards",!0,!0,!0)):l===!0?e(L(t,d,"charge_cards",!0,!0,!0)):i===!0&&e(L(t,d,"debit_cards",!0,!0,!0))},updateFilesEntity:d=>{e(ae({files:d}))},onDeleteFile:d=>{e(te(d))},onEditFileName:(d,y)=>{e(ne(d,y.split(".")[0]))},onUpdateAutoPayClick:d=>{e(yn(t,d))}}}))(Yn),St=()=>{const e=Te(),o=Q(),a=X(),t=ee(),{tenantEmailDomain:r}=H(),n=ie(),i=v((N=>F(N))),{useDynamicConfig:l,useFeatureGate:s}=me(),c=a.state?.pathnameStackToGoBack?.[0],{configValue:p}=l(Ve.zeniCardsConfig),g=p.credit_card_auto_pay_threshold_by_company_id?.[i.companyId]??p.default_credit_card_auto_pay_threshold??80,{isFeatureEnabled:S}=s(J.isDebitCardFeatureEnabled),{isFeatureEnabled:k}=s(J.isChargeCardFeatureEnabled),{isFeatureEnabled:I}=s(J.isEarlyPayFeatureEnabled),{isFeatureEnabled:d}=s(J.isCardPolicyEnabled),y=v((N=>cn(N,i.companyId))),f=rn(y.controllers),P=!!i.company?.companyChargeCardInfo.isChargeCardEnabled,b=!!i.company?.companyDebitCardInfo.isDebitCardEnabled,m=un(S,i),C=yt({isDebitCardFeatureEnabled:S,isBankingOnlyTenant:m}),_=dn(i),T=ln(i),A=i.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,U=ft({isCardsOnlyTenant:_,isChargeCardFeatureEnabled:k,isBookKeepingTenant:T,isDebitCardProductVisible:C,chargeCardsCreditAccountLimit:A}),M=C&&U===!1,x=C===!1&&U,z=pn(n?.loggedInUserRoleMap),w=Fe(n?.loggedInUserRoleMap),[ce,K]=h.useState(!1),[q,re]=h.useState(!1),Z=v((N=>N.chargeCardSetupViewState.fetchState)),B=E.getSignedInUserTenant(r)?.companyId??i.companyId,O=E.getSignedInUser(),Ue=N=>{K(N)},fe=v((N=>mn(N,B)));if(O==null)throw Error("Can't access charge card setup page without signing in...");h.useEffect((()=>{q||Z!=="Not-Started"||B==null?q||Z!=="Completed"||B==null||i.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(de(B,!1,!0)):(re(!0),t(de(B,!0)))}),[q,Z,B,t]);const ge=!!i.company?.companyChargeCardInfo.isChargeCardTOSAccepted,Se=!!i.company?.companyDebitCardInfo.isDebitCardTOSAccepted,ue=mt(U,C,b,P);return ge||Se?ge||Se?u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:D,onLoad:()=>{D.trackPageLoaded(W.Event.cardsSetupVisited),D.trackCardsCardSetupView(f,ue,c==null?"Cards Setup":c.includes("cards/promo")?"Promo":c.includes("cards")?"Settings":"Cards Tab")}}),u.jsx(ye,{isAppContentDrawerOpen:ce,handleDrawerToggle:Ue}),u.jsx(gt,{autoPayThreshold:g,navigate:o,meetingUrl:e("charge_card_setup"),location:a,companyId:B,currentTenant:i,isEarlyPayEnabled:I,isChargeCardTOSAccepted:ge,isDebitCardTOSAccepted:Se,isUserChargeCardAdmin:z,isCardPolicyEnabled:d,isDebitCardOnlyEnabled:M,isCreditCardOnlyEnabled:x,chargeCardSetUpView:fe,isCreditCardProductVisible:U,isDebitCardFeatureEnabled:C,isChargeCardSetupEnabled:P,isDebitCardSetupEnabled:b,businessVerificationStatus:i.companyBillPayInfo?.info?.businessVerificationStatus,controllerEmails:f,productInformation:ue,onClickMenuIcon:()=>{Ue(!0)},hasZeniAccountsAdminAccess:w})]}):u.jsx(De,{fetchState:"Not-Started"}):u.jsx(j,{to:"../promo"})},bt=xe.div`
|
|
10
|
+
display: flex;
|
|
11
|
+
height: 100%;
|
|
12
|
+
width: 100%;
|
|
13
|
+
flex: 1 1 auto;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
align-items: center;
|
|
16
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
17
|
+
`,Ct=G((function(e,o){const{isUserRemiAdmin:a,companyId:t}=o,r=F(e),n=bn(e),i=Cn(e,t),l=E.getSignedInUser(),s=r.tenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""};return{remiSetupView:i,isDisabled:a&&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",remiApprovalView:n,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:D,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:c}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r}=o;return{updateMileageDetails:n=>{const{mileageAmount:i,mileageUnit:l,mileageCurrencyCode:s,mileageCurrencySymbol:c,denomination:p,denominationSymbol:g,mileageAmountInDenomination:S,description:k}=n;e(In({mileageDetails:{mileageUnitAmount:{amount:i,currencyCode:s,currencySymbol:c},denomination:p,denominationSymbol:g,mileageAmountInDenomination:S,mileageCurrencyCode:s,mileageCurrencySymbol:c,mileageUnit:l,description:k}}))},onSaveMileageClick:n=>{e(hn(t)),D.trackReimbursementMileageRateSave(n)},onBusinessVerificationSectionClick:()=>{a("../verification"),r?.company?.companyReimbursementInfo!=null&&r?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(le(t,!1,!0))},onSetupApprovalRulesSectionClick:()=>{a("../approval-rules")},onFetchLinkTokenClick:(n,i)=>{e(Pe("reimbursement_setup",n,i))},onEstablishConnectionClick:n=>{e(ve(n,t,"reimbursement_setup","reimbursement"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(_e(n,i,"reimbursement","reimbursement_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(ke(!1,n,"reimbursement","reimbursement_setup",i))},onEstablishConnectionSuccess:()=>{e(le(t,!0))},onEnableRemiClick:()=>{e(Y(t,"reimbursement"))},onUpdateAccountClick:(n,i,l)=>{e(l==="paymentAccount"?Ie(n,i,"reimbursement","reimbursement_setup"):Ae("reimbursement_setup",n,i))},onEnableRemiSuccess:()=>{a("../",{relative:"path"})},onBackClick:()=>{r?.companyReimbursementInfo?.info?.isReimbursementEnabled!=null&&r.companyReimbursementInfo.info.isReimbursementEnabled===!1?a("../.."):a("../",{relative:"path"})},onCompanyOfficerUpdated:(n,i)=>{e(Ce({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(L(t,n,"reimbursement",!0,!0,!0))},updateFilesEntity:n=>{e(ae({files:n}))},onDeleteFile:n=>{e(te(n))},onEditFileName:(n,i)=>{e(ne(n,i.split(".")[0]))},onUpdatePrimaryFundingAccount:(n,i)=>{e(he(t,"reimbursement_setup",n,i))}}}))(Xn),ht=()=>{const e=Te(),o=Q(),a=X(),t=ee(),{tenantEmailDomain:r}=H(),n=ie(),i=Ee(),l=gn(n?.loggedInUserRoleMap),s=Fe(n?.loggedInUserRoleMap),[c,p]=h.useState(!1),g=h.useRef(!1),[S,k]=h.useState(!1),I=v((_=>_.remiSetupViewState.fetchState)),d=v((_=>F(_))),y=v((_=>_.remiSetupApproverViewState.fetchState)),{isApprovalRulesV3Enabled:f,isLoading:P}=Qn(d?.tenantId),b=E.getSignedInUserTenant(r)?.companyId??d.companyId,m=E.getSignedInUser(),C=_=>{p(_)};if(m==null)throw Error("Can't access reimbursement setup page without signing in...");if(h.useEffect((()=>{g.current||I!=="Not-Started"||b==null?g.current||I!=="Completed"||b==null||d.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(g.current=!0,t(le(b,!1,!0))):(g.current=!0,t(le(b,!0)))}),[I,b,t]),h.useEffect((()=>{S||y!=="Not-Started"||P||(k(!0),t(Sn(!0,!1,!1,f)))}),[S,y,P,f,t]),d.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1)return u.jsx(j,{to:"../promo"});if(d.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!0){const _=T=>T.trackPageLoaded(W.Event.reimbursementSetup);return u.jsxs(bt,{children:[u.jsx(se,{analytics:D,onLoad:T=>_(T)}),u.jsx(ye,{isAppContentDrawerOpen:c,handleDrawerToggle:C}),u.jsx(Ct,{navigate:o,location:a,companyId:b,currentTenant:d,isUserRemiAdmin:l,meetingUrl:e("reimbursement_setup"),onClickMenuIcon:()=>{C(!0)},hasZeniAccountsAdminAccess:s})]})}return u.jsx(De,{fetchState:"In-Progress",style:{backgroundColor:i.colors.grey5}})},It=G((function(e,o){const{businessVerificationDetails:a,productType:t}=o,r=F(e),n=E.getSignedInUser(),i=r.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=En(o.roleMap)&&a.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",c=Dn(e.companyConfigState),p=Un(e.userRoleConfigState),g=t==="zeni_treasury"?qe(e):void 0;return{businessVerificationDetails:a,verficationDetailsFetchState:a.fetchState,isRefreshingViewInBackground:a.isRefreshingViewInBackground,allNationalityCountries:a.allNationalityCountries,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:s,allIndustries:c.companyIndustries??[],companyTitles:p.companyTitles,transferDetails:g}}),(function(e,o){const{companyId:a,productType:t,currentTenant:r,navigate:n,location:i}=o,{tenantEmailDomain:l}=r;return{onCompanyDetailsChanged:s=>{const{companyDescription:c,companyIndustry:p,companyIndustryType:g,companyLegalName:S,companyTaxId:k,companyWebsite:I,companyPhone:d,primaryContactEmail:y,primaryContactName:f,primaryContactUserId:P,primaryContactSyncToken:b,syncToken:m,fileIds:C,incDate:_,typeOfIncorporation:T,stateOfIncorporation:A,sourceOfFunds:U,companySubIndustry:M,countriesOfOperations:x,companySourceOfFunds:z,companySourceOfFundsDescription:w,transactionVolume:ce,transactionVolumeDescription:K,purposeOfAccount:q,purposeOfAccountDescription:re,regulatedStatus:Z,regulatedStatusDescription:B,usNexus:O,usNexusTypes:Ue}=s,fe=g?.selectedOption,ge={companyId:a,companyDescription:c,companyIndustry:p.selectedOption,companyIndustryType:fe==null||fe===""?void 0:fe,companyLegalName:S,taxIdOrEIN:k,website:I!=""&&I!=null?Bn(I):void 0,phone:d,syncToken:m,fileIds:C,incDate:_!=null?Re(_?.toString()):_,typeOfIncorporation:T?.selectedOption??"",stateOfIncorporation:A?.selectedOption??"",sourceOfFunds:U?.selectedOption??"",companySubIndustry:M?.selectedOption??"",countriesOfOperations:x?.selectedOptions.map((ue=>ue.length===2?ue:ze(ue)))??[],companySourceOfFunds:z?.selectedOption??"",companySourceOfFundsDescription:w,transactionVolume:ce?.selectedOption??"",transactionVolumeDescription:K,purposeOfAccount:q?.selectedOption??"",purposeOfAccountDescription:re,regulatedStatus:Z??"",regulatedStatusDescription:B,usNexus:O,usNexusTypes:Ue?.selectedOptions??[]},Se={userId:P,firstName:f.firstName,lastName:f.lastName,email:y,syncToken:b};e(Le({companyDetails:ge,primaryContactDetails:Se}))},onCompanyOfficerUpdated:s=>{const c=s.map((p=>{const{officerType:g,userId:S,name:k,email:I,nationalityCountryCode:d,ssn:y,dob:f,phone:P,syncToken:b,selectDocument:m,role:C,ownership:_,isSelectedForVerification:T,userVerificationStatus:A,treasuryUserVerificationStatus:U,fileIds:M}=p;let x;return m.selectDocumentType==="driverLicense"?x="driving_license":m.selectDocumentType==="passport"?x="passport":m.selectDocumentType==="stateId"?x="id_document":m.selectDocumentType==="ssnCard"&&(x="social_security_card"),{officerType:g,userId:S,firstName:k.firstName,lastName:k.lastName,email:I,ssn:y,nationalityCountryCode:d?.selectedOption!=null?ze(d.selectedOption):void 0,phone:P,birthday:f!=null?Re(f?.toString()):f,syncToken:b,titleAtCompany:C.selectedOption,ownershipInCompany:_,documentTypeSelectedForVerification:x,isSelectedForVerification:T,userVerificationStatus:A,treasuryUserVerificationStatus:U,fileIds:M,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}}));e(Le({officers:c}))},onSaveDetailsClick:s=>{e(L(a,s,t))},onSendForVerificationClick:s=>{e(L(a,s,t,!0))},onAddressClick:s=>{const c=$e(l,s),p=Me(i.state?.pathnameStackToGoBack,i.pathname),g=new URLSearchParams(i.search),S={};g.forEach(((k,I)=>{S[I]=k})),n(c,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(S).length>0?S:void 0}})},onRegisteredAddressClick:s=>{const c=$e(l,s),p=Me(i.state?.pathnameStackToGoBack,i.pathname),g=new URLSearchParams(i.search),S=Object.fromEntries(g.entries());n(c,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(S).length>0?S:void 0}})},onBackClick:()=>{e(xn({companyId:a})),n("../setup")},updateFilesEntity:s=>{e(ae({files:s}))},onDeleteFile:s=>{e(te(s))},onDeleteFileList:s=>{e(Ye(s))},onEditFileName:(s,c)=>{e(ne(s,c.split(".")[0]))},onGetOtp:s=>{e(Ge(s,"SpendManagementSetup"))},onResendOtp:s=>{e(He(s,"SpendManagementSetup"))},onVerifyOtp:(s,c)=>{e(We(s,c,"SpendManagementSetup"))},saveNewAddressInLocalStore:(s,c)=>{e(Vn({addressType:s,addressToCreate:c}))},onExecuteTreasuryTransfer:()=>{e(Je())},onOverlayClose:()=>{e(we())},onIdentityDocumentUploadedForAutofill:s=>{if(a==null)return;const c=wn(s.documentType);c!=null&&e(Fn({target:"setup",companyId:a,officerType:s.officerType,fileId:s.fileId,documentType:c}))},onCompanyDocumentUploadedForAutofill:s=>{a!=null&&e(On({target:"setup",companyId:a,fileId:s.fileId,documentType:s.documentType}))}}}))(et),At=({productType:e,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:a})=>{const t=Q(),r=X(),n=ee(),[i]=Xe(),l=i.get("showStepProgress"),s=i.get("isTransferInitiated"),[c,p]=h.useState(!1),{tenantEmailDomain:g}=H(),S=ie(),{useDynamicConfig:k}=me(),I=Ee(),{configValue:d}=k(Ve.zeniAccountsConfig),y=je(d),f=v((A=>{switch(e){case"zeni_accounts":return A.zeniAccountSetupViewState.fetchState;case"reimbursement":return A.remiSetupViewState.fetchState;case"charge_cards":return A.chargeCardSetupViewState.fetchState;case"zeni_treasury":return A.treasurySetupViewState.fetchState;default:return A.billPaySetupViewState.fetchState}})),P=v((A=>A.companyConfigState.fetchState)),b=v((A=>A.userRoleConfigState.fetchState)),m=v((A=>F(A))),C=m.companyId??E.getSignedInUserTenant(g)?.companyId;if(h.useEffect((()=>{P==="Not-Started"&&n(An()),b==="Not-Started"&&n(kn(!0))}),[P,b,n]),h.useEffect((()=>{if(!c&&f==="Not-Started"&&C!=null)switch(p(!0),e){case"zeni_accounts":n(pe(C,!0));break;case"zeni_treasury":n(be(C,!0));break;case"reimbursement":n(le(C,!0));break;case"charge_cards":n(de(C,!0));break;default:n($(C,!0))}}),[c,f,C,n]),E.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let _;switch(e){case"zeni_accounts":_=m.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":_=m.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":_=m.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||m.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":_=m.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:_=m.companyBillPayInfo?.info?.isBillPayTOSAccepted}const T=v((A=>{let U;switch(e){case"zeni_accounts":U=Tn(A,C);break;case"zeni_treasury":U=Ke(A,C);break;case"charge_cards":U=Pn(A,C);break;case"reimbursement":U=vn(A,C);break;default:U=_n(A,C)}return U}));return _===!1?null:T.fetchState==="Completed"&&_===!0&&S?.loggedInUserRoleMap!=null?u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:D,onLoad:A=>(U=>{switch(e){case"zeni_accounts":return U.trackPageLoaded(W.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return U.trackPageLoaded(W.Event.reimbursementBusinessVerification);default:return U.trackPageLoaded(W.Event.billPayBusinessVerification,Be(r)?"Settings":void 0)}})(A)}),u.jsx(It,{businessVerificationDetails:T,navigate:t,location:r,companyId:C,analytics:D,currentTenant:m,productType:e,roleMap:S.loggedInUserRoleMap,isSettings:Be(r),isOverlay:!0,isStepInProgress:l!=null,isTreasuryTransferInitiated:s!=null,onClickMenuIcon:()=>{},maxInsuredAmount:y.maxInsuredAmount,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:a})]}):u.jsx(De,{fetchState:"In-Progress",style:{backgroundColor:I.colors.grey5}})},kt={overlayWidth:new tt(100,100,59)},_t=G((function(e,o){const{isUserZeniAccountsAdmin:a,companyId:t}=o,r=F(e),n=E.getSignedInUser(),i=r.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=Qe(e,t),c=Ke(e,t),p=a&&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=Nn(e),S=g.transactions,k=qe(e),I=g.accountSummary?.totalBalance?.amount,d=S.length===0||I===0;return{treasurySetupView:s,businessVerificationDetails:c,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",transactions:S,transferDetails:k,isFirstTransfer:d,isDisabled:p,analytics:D,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l,isOnSetup:!0,maxInsuredAmount:o.maxInsuredAmount}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r,isAllocationDone:n,analytics:i,treasurySetupView:l}=o;return{onTransferSaveChangesToLocalStore:s=>{e(Zn(s))},onBusinessVerificationSectionClick:(s,c)=>{let p="../verification";s&&(p+="?showStepProgress=true",c&&(p+="&isTransferInitiated=true")),a(p),r?.company?.companyTreasuryInfo!=null&&r?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="pending_review"&&e(be(t,!1,!0))},onFetchLinkTokenClick:(s,c)=>{e(Pe("treasury_setup",s,c))},onEstablishConnectionClick:s=>{e(ve(s,t,"treasury_setup","zeni_treasury"))},onUpdatePaymentAccountStatus:(s,c,p)=>{e(_e(s,c,"zeni_treasury","treasury_setup",p))},onUpdatePaymentAccountLoginStatus:(s,c)=>{e(ke(!1,s,"zeni_treasury","treasury_setup",c))},onEstablishConnectionSuccess:()=>{e(be(t,!0))},onEnableTreasuryClick:()=>{e(Y(t,"zeni_treasury"))},onUpdateTreasuryClick:(s,c,p)=>{e(p==="paymentAccount"?Ie(s,c,"zeni_treasury","treasury_setup"):Ae("treasury_setup",s,c))},onUpdatePrimaryFundingAccount:(s,c)=>{e(he(t,"treasury_setup",s,c))},onNavigateToDashboard:()=>{a(r?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="verified"?"../":"../../")},onCompanyOfficerUpdated:(s,c)=>{e(Ce({officerType:s,fileIds:c}))},onSendForVerificationClick:(s,c)=>{if(e(L(t,s,"zeni_treasury",!0,!0,!0)),!n){const p=l.fundAllocationLocalData;i.trackTreasuryPortfolioConfirm(p.riskScore,Ze(p)),e(Ne(!1))}c===!0&&e(Je())},updateFilesEntity:s=>{e(ae({files:s}))},onDeleteFile:s=>{e(te(s))},onEditFileName:(s,c)=>{e(ne(s,c.split(".")[0]))},onAdditionalVerificationFieldsChanged:s=>{const{sourceOfFunds:c}=s;e(zn({sourceOfFunds:c?.selectedOption??""}))},onUpdateFundAllocation:s=>{i.trackTreasuryAllocationAction("update",Ze(s)),e(Mn(s))},onConfirmFundAllocation:()=>{e(Ne(n))},onOverlayClose:()=>{e(we())}}}))(at),vt=()=>{const e=Te(),o=Q(),a=X(),t=ee(),r=Ee(),n=nt(),{tenantEmailDomain:i}=H(),{useDynamicConfig:l}=me(),s=ie(),[c,p]=h.useState(!1),g=Fe(s?.loggedInUserRoleMap),{configValue:S}=l(Ve.zeniAccountsConfig),k=je(S),[I,d]=h.useState(!1),[y,f]=h.useState(!1),[P,b]=h.useState(!1),[m,C]=h.useState(!1),[_,T]=h.useState(!1),A=v((O=>O.treasurySetupViewState.fetchState)),U=v((O=>O.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState)),M=v((O=>O.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),x=v((O=>O.treasuryDetailState.transactionsState?.fetchState)),z=v((O=>F(O))),w=E.getSignedInUserTenant(i)?.companyId??z.companyId,ce=v((O=>Qe(O,w))),K=ce.isAtomicAccountExists,q=E.getSignedInUser(),re=O=>{d(O)};if(q==null)throw Error("Can't access treasury setup page without signing in...");h.useEffect((()=>{y||A!=="Not-Started"||w==null||(f(!0),t(be(w,!0,!1)))}),[y,A,w,t]),h.useEffect((()=>{P||U!=="Not-Started"||w==null||(b(!0),t(jn()))}),[P,U,w,t]),h.useEffect((()=>{m||M!=="Not-Started"||w==null||(C(!0),t(Rn()))}),[m,M,w,t]),h.useEffect((()=>{_||x!=="Not-Started"||w==null||(T(!0),t(Ln(!0)))}),[_,x,w,t]);const Z=z.companyTreasuryInfo?.info?.businessVerificationStatus?.code,B=Z==="pending_review"||Z==="verified";return h.useEffect((()=>{c||A!=="Completed"||K||B||!a.pathname.includes("setup")||p(!0)}),[A,K,B]),z.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1?u.jsx(j,{to:"../promo"}):u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:D,onLoad:()=>{}}),u.jsx(ye,{isAppContentDrawerOpen:I,handleDrawerToggle:re}),u.jsx(ct,{onClose:()=>{t(we()),o("../setup")},anchor:"right",open:a.pathname.includes("verification"),transitionDuration:c?0:250,PaperProps:{style:{width:kt.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:c?"transparent":r.colors.black,opacity:.75,cursor:"pointer"}}},children:u.jsx(Pt,{onClick:O=>O.stopPropagation(),children:u.jsx(At,{productType:"zeni_treasury",isBusinessVerificationDrawerOpen:!0,closeDrawerHandler:()=>{t(we()),o("../setup")}})})}),u.jsx(_t,{navigate:o,location:a,companyId:w,currentTenant:z,isUserZeniAccountsAdmin:g,meetingUrl:e("treasury_setup"),maxInsuredAmount:k.maxInsuredAmount,isAllocationDone:K,analytics:D,treasurySetupView:ce,onClickMenuIcon:()=>{re(!0)},showTreasurySetupOverlay:c,setShowTreasurySetupOverlay:p})]})},Pt=xe(rt)`
|
|
18
|
+
display: flex;
|
|
19
|
+
min-height: 100%;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
`,Tt=G((function(e,o){const{isUserZeniAccountsAdmin:a,companyId:t}=o,r=F(e),n=E.getSignedInUser(),i=r.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:i??""},s=$n(e,t),c=a&&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";return{zeniAccountSetUpView:s,connectedAccountProvider:r.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:c,analytics:D,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:l}}),(function(e,o){const{navigate:a,companyId:t,currentTenant:r}=o;return{onBusinessVerificationSectionClick:()=>{a("../verification"),r?.company?.companyZeniAccountInfo!=null&&r?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(pe(t,!1,!0))},onFetchLinkTokenClick:(n,i)=>{e(Pe("account_setup",n,i))},onEstablishConnectionClick:n=>{e(ve(n,t,"account_setup","zeni_accounts"))},onUpdatePaymentAccountStatus:(n,i,l)=>{e(_e(n,i,"zeni_accounts","account_setup",l))},onUpdatePaymentAccountLoginStatus:(n,i)=>{e(ke(!1,n,"zeni_accounts","account_setup",i))},onEstablishConnectionSuccess:()=>{e(pe(t,!0))},onEnableZeniAccountClick:()=>{e(Y(t,"zeni_accounts"))},onUpdateZeniAccountClick:(n,i,l)=>{e(l==="paymentAccount"?Ie(n,i,"zeni_accounts","account_setup"):Ae("account_setup",n,i))},onUpdatePrimaryFundingAccount:(n,i)=>{e(he(t,"account_setup",n,i))},onEnableZeniAccountSuccess:()=>{a("../",{relative:"path"})},onBackClick:()=>{r?.companyZeniAccountInfo?.info?.isZeniAccountEnabled?a("../"):a("../../")},onNavigateToDashboard:()=>{a("../../dashboard")},onCompanyOfficerUpdated:(n,i)=>{e(Ce({officerType:n,fileIds:i}))},onSendForVerificationClick:n=>{e(L(t,n,"zeni_accounts",!0,!0,!0))},updateFilesEntity:n=>{e(ae({files:n}))},onDeleteFile:n=>{e(te(n))},onEditFileName:(n,i)=>{e(ne(n,i.split(".")[0]))}}}))(it),Et=()=>{const e=Te(),o=Q(),a=X(),t=ee(),{tenantEmailDomain:r}=H(),{useDynamicConfig:n}=me(),i=ie(),l=Fe(i?.loggedInUserRoleMap),{configValue:s}=n(Ve.zeniAccountsConfig),c=je(s),[p,g]=h.useState(!1),[S,k]=h.useState(!1),I=v((b=>b.zeniAccountSetupViewState.fetchState)),d=v((b=>F(b))),y=E.getSignedInUserTenant(r)?.companyId??d.companyId,f=E.getSignedInUser(),P=b=>{g(b)};if(f==null)throw Error("Can't access zeni bank account setup page without signing in...");if(h.useEffect((()=>{S||I!=="Not-Started"||y==null?S||I!=="Completed"||y==null||d.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(pe(y,!1,!0)):(k(!0),t(pe(y,!0)))}),[S,I,y,t]),d.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted===!1)return u.jsx(j,{to:"../promo"});{const b=m=>m.trackPageLoaded(W.Event.zeniAccountsSetup);return u.jsxs(u.Fragment,{children:[u.jsx(se,{analytics:D,onLoad:m=>b(m)}),u.jsx(ye,{isAppContentDrawerOpen:p,handleDrawerToggle:P}),u.jsx(Tt,{navigate:o,location:a,companyId:y,currentTenant:d,isUserZeniAccountsAdmin:l,accountsPromoConfig:c,meetingUrl:e("zeni_accounts_setup"),onClickMenuIcon:()=>{P(!0)}})]})}},Dt=xe.div`
|
|
22
|
+
display: flex;
|
|
23
|
+
height: 100vh;
|
|
24
|
+
width: 100%;
|
|
25
|
+
flex: 1 1 auto;
|
|
26
|
+
flex-direction: column;
|
|
27
|
+
align-items: center;
|
|
28
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
29
|
+
`,Ut=G((function(e,o){const a=F(e),t=E.getSignedInUser(),r=a.tenantId,n={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:r??""};return{internationalOnboardingDetails:Gn(e),isReadonly:o.isFormReadonly,filesEndPoint:`${oe.fileMicroServiceBaseUrl}`,authParams:n,analytics:D}}),(function(e,o){const{navigate:a}=o;return{onFormDataChange:t=>{e(qn(t))},onSubmitClick:()=>{e(Kn(o.companyId))},onCancelClick:()=>{a("../setup")},updateFilesEntity:t=>{e(ae({files:t}))},onDeleteFile:t=>{e(te(t))},onDeleteFileList:t=>{e(Ye(t))},onEditFileName:(t,r)=>{e(ne(t,r.split(".")[0]))}}}))(st),Ot=()=>{const e=Q(),o=X(),a=ee(),[t,r]=h.useState(!1),[n,i]=h.useState(!1),[l,s]=h.useState(!1),{tenantEmailDomain:c}=H(),p=ie(),{useFeatureGate:g}=me(),{isFeatureEnabled:S}=g(J.isBillPayLocalCurrencyFeatureEnabled),k=v((T=>T.internationalWireVerificationState.verificationFormFetchState.fetchState)),I=v((T=>T.billPaySetupViewState.fetchState)),d=v((T=>F(T))),y=Ee(),f=d.companyId??E.getSignedInUserTenant(c)?.companyId,P=v((T=>Wn(T.companyState,d.companyId))),b=P?.company.companyBillPayInfo.internationalWireOnboardingStatus,m=b?.code==="onboarding_status_not_started"?void 0:"readonly";if(h.useEffect((()=>{t||k!=="Not-Started"||f==null||(r(!0),a(Hn(f)))}),[t,k,f,a]),h.useEffect((()=>{n||I!=="Not-Started"||f==null||(i(!0),a($(f,!0)))}),[I,n,f,a]),E.getSignedInUser()==null)throw Error("Can't access international verification without signing in...");const C=d.companyBillPayInfo?.info?.isBillPayTOSAccepted,_=T=>{s(T)};return C===!1?u.jsx(j,{to:"../promo"}):C===!0&&p?.loggedInUserRoleMap!=null?u.jsxs(Dt,{children:[u.jsx(se,{analytics:D,onLoad:T=>(A=>A.trackPageLoaded(W.Event.billPayBusinessVerification,void 0))(T)}),Be(o)?u.jsx(ye,{isAppContentDrawerOpen:l,handleDrawerToggle:_}):null,u.jsx(Ut,{navigate:e,location:o,companyId:f,analytics:D,currentTenant:d,roleMap:p.loggedInUserRoleMap,isFormReadonly:m,isLocalCurrencyEnabled:S})]}):u.jsx(De,{fetchState:"In-Progress",style:{backgroundColor:y.colors.grey5}})},wt=G((function(){return{}}),(function(e,o){const{companyId:a,productType:t}=o;return{onEventReceived:r=>{switch(r){case"bill-pay-set-up-verification-update":case"bill-pay-wise-setup":switch(t){case"reimbursement":e(le(a,!0,!0));break;case"zeni_accounts":e(pe(a,!0,!0));break;case"charge_cards":e(de(a,!0,!0));break;case"zeni_treasury":e(be(a,!0,!0));break;default:e($(a,!0,!0))}}}}}))(ot((e=>{const{isBillPayAdminLevelAccess:o,isUserHasOnlyBillPayAccess:a,isReimbursementAdminLevelAccess:t,isZeniAccountAdminLevelAccess:r,isTreasuryAdminLevelAccess:n,isChargeCardAdminLevelAccess:i,isUserHasOnlyCardAccess:l,productType:s,type:c}=e;switch(s){case"bill_pay":switch(c){case"verification":return o?u.jsx(Oe,{productType:s}):a?u.jsx(j,{to:"../"}):u.jsx(R,{});case"international-wire":return o?u.jsx(Ot,{}):a?u.jsx(j,{to:"../"}):u.jsx(R,{});default:return o?u.jsx(pt,{}):a?u.jsx(j,{to:"../"}):u.jsx(R,{})}case"reimbursement":return c==="verification"?t?u.jsx(Oe,{productType:s}):u.jsx(R,{}):t?u.jsx(ht,{}):u.jsx(R,{});case"zeni_accounts":return c==="verification"?r?u.jsx(Oe,{productType:"zeni_accounts"}):u.jsx(R,{}):r?u.jsx(Et,{}):u.jsx(R,{});case"zeni_treasury":return n===!0?u.jsx(vt,{}):u.jsx(R,{});case"charge_cards":return c==="verification"?i?u.jsx(Oe,{productType:"charge_cards"}):l?u.jsx(j,{to:"../"}):u.jsx(R,{}):i?u.jsx(St,{}):l?u.jsx(j,{to:"../"}):u.jsx(R,{})}})));function oa(e){const{tenantEmailDomain:o}=H(),a=v((r=>F(r))).companyId??E.getSignedInUserTenant(o)?.companyId,t={events:a!=null?[`private-encrypted-${a}.bill-pay-set-up-verification-update`,`private-encrypted-${a}.bill-pay-wise-setup`]:[],eventCallback:(r,n,i)=>{i.onEventReceived(r)}};if(E.getSignedInUser()==null)throw Error("Can't access setup details page without signing in...");return u.jsx(wt,{...e,companyId:a,...t})}export{na as A,ta as P,oa as S,Qt as a,ea as b,yt as c,ft as d,mt as e,aa as f,Kt as g,Wt as h,Yt as i,Xt as j,ia as k,Jt as l,qt as m,Ht as n,Gt as o,$t as p,sa as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as u}from"./liveblocks-DRe6CbUC.js";import{a as f,R as T,q as A}from"./sentry-0qxHOSjH.js";import{u as z,h as D,j as l,g as M,N as P,l as j}from"./core-B-JOvAoN.js";import{u as O,z as s,E as F,k as w,G as N,R as _,S as B,U as V,V as R,W,Y as v}from"./index-d9PzVM0C.js";import{fI as $,U3 as q,Un as J,gl as X,gn as Y,Us as G,gX as H,dk as K,Ut as y,Uu as Q,Uv as Z,c0 as U}from"./zeni-epic-state-C5XzLjC7.js";import"./mui-D61DLOo-.js";import{u as ee}from"./useDeviceId-0oBI_F7i.js";import{f as te}from"./analyticsHelper-CWjQXseh.js";import{t as ne}from"./getLocaleForTenant-C2NcEkPl.js";import"./recharts-DqtwTOUm.js";import"./analytics-DAlTxslb.js";import"./plaid-BBL8Aplq.js";import"./dnd-COhfK8Um.js";import"./stripe-cKAAJElX.js";import"./lottie-mNMGPSgQ.js";import"./lexical-BcThc0IB.js";import"./pdf-Di2GQu6S.js";import"./utils-C7LPuKOj.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]="2fd08350-b78d-427c-a710-dbdaa196a33f",t._sentryDebugIdIdentifier="sentry-dbid-2fd08350-b78d-427c-a710-dbdaa196a33f")}catch{}})();const ie=j((function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}}),(function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{A({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 c=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(Z({authCode:n,oauthProvider:a,appType:"web",redirectUri:U(c),sourceUri:U(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(y())}}}))(W),ae=T.memo(ie);function ve({setTenantEmailDomain:t}){const i=z(),d=D(),{clearAllLoading:g}=O(),n=s.getSignedInUser();f.useLayoutEffect((()=>{g()}),[g]);const a=ee(),c=l((e=>e.tenantState.magicLinkCodeVerifier)),{sendEmailMagicLinkFetchState:k,accountLocked:b,accountUnlockTime:E}=l((e=>e.tenantState)),p=l((e=>e.tenantState.fetchState)),L=l((e=>e.tenantState.activeTenantFetchState.fetchState)),S=l((e=>e.tenantState.signInState)),o=l((e=>e.tenantState.loggedInUser)),r=l((e=>$(e))),I=l((e=>q(e))),m=M(),h=F().mode,C=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(f.useEffect((()=>{k.fetchState==="Completed"&&c!=null&&(w.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(c))}),[k.fetchState,c]),f.useEffect((()=>{t(void 0)}),[]),f.useEffect((()=>{S!=="In-Progress"||p!=="Completed"&&L!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(J(I.tenantsInOrder),o.zeniSessionId),X(o.userId,o.zeniSessionId,r.tenantId),i(Y(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(G("Completed")),N.updateAppLocaleID(ne(r)),te(o,r,h,void 0,I.tenantsInOrder),H().then((()=>{const e=R();e!=null&&_(e)})),setTimeout((()=>{w.trackLogin(B.Event.loginSuccess,o.authProvider??"google",K(r.productSettings))}),2e3))}),[S,p,L,o,r,I,h,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return u.jsx(P,{to:e,state:{...m.state,origin:""}})}return u.jsxs(u.Fragment,{children:[u.jsx(ae,{magicLinkExpired:!!C,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),b===!0&&E!=null?u.jsx(V,{onClose:()=>i(y()),unlockDate:E}):null]})}export{ve as default};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{j as s}from"./liveblocks-DRe6CbUC.js";import{a as i}from"./sentry-0qxHOSjH.js";import{u as l,g as c,N as u}from"./core-B-JOvAoN.js";import{z as n,k as a,S as m,a7 as p}from"./index-d9PzVM0C.js";import{g_ as g,UJ as b}from"./zeni-epic-state-C5XzLjC7.js";import{n as y}from"./mui-D61DLOo-.js";import"./recharts-DqtwTOUm.js";import"./analytics-DAlTxslb.js";import"./plaid-BBL8Aplq.js";import"./dnd-COhfK8Um.js";import"./stripe-cKAAJElX.js";import"./lottie-mNMGPSgQ.js";import"./lexical-BcThc0IB.js";import"./pdf-Di2GQu6S.js";import"./utils-C7LPuKOj.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="41fcb2b3-d17b-4582-965d-f4f072529497",t._sentryDebugIdIdentifier="sentry-dbid-41fcb2b3-d17b-4582-965d-f4f072529497")}catch{}})();function L(){const t=l(),e=c(),r=i.useRef(!1),f=n.isSignedIn(),o=e.state?.message==="logout"||f;return i.useEffect((()=>{if(o&&!r.current){r.current=!0;try{t(g()),b(),a.trackLogout(m.Event.logoutSuccess),a.resetUserIdentity(),n.clearAll()}catch(d){console.error("Error during sign out:",d)}finally{window.location.replace("/signin/auth")}}}),[o,t]),o?s.jsx(h,{children:s.jsx(p,{fetchState:"In-Progress"})}):s.jsx(u,{to:"../",replace:!0})}const h=y.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: ${t=>t.theme.colors.grey4};
|
|
9
|
+
`;export{L as default};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{j as f}from"./liveblocks-DRe6CbUC.js";import{a as A}from"./sentry-0qxHOSjH.js";import{h as pa,u as Ta,g as ga,k as fa,j as v,i as _a,l as ma}from"./core-B-JOvAoN.js";import{z as U,_ as Da,f as _,as as Sa,a8 as ya,k as Ea,S as ha,e5 as ba,p as C,a4 as Aa}from"./index-d9PzVM0C.js";import{fI as Ca,a2g as V,Re as D,a2h as W,a2c as Ga,QC as N,a2i as Ia,QK as O,Qk as Ba,PY as Ka,Rf as Q,a2j as Z,gk as La,R5 as va,Ra,QZ as Ua,QX as z,Rb as wa,QU as Pa,a2k as Fa,a2l as ja,a2m as xa,a2n as $a,a2o as m,dy as Na,dx as Oa,a2p as Qa,Qh as Za}from"./zeni-epic-state-C5XzLjC7.js";import{n as za}from"./mui-D61DLOo-.js";import{u as Ma}from"./useAskAiCfoHostNavButtonProps-B_a9BtNp.js";import{M as Va}from"./MobileAppDrawer-Cm83j2vk.js";import{u as Wa}from"./useTaskManagerPusherEvents-Dru9PCIf.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]="3d4e66e5-6266-4a08-a643-d9cda49d7d51",e._sentryDebugIdIdentifier="sentry-dbid-3d4e66e5-6266-4a08-a643-d9cda49d7d51")}catch{}})();const c={TASK_CREATED:"task-created",TASK_UPDATED:"task-updated",TASK_SNOOZE_RESURFACED:"task-snooze-resurfaced",TASKS_BULK_UPDATED:"tasks-bulk-updated",TASKS_BULK_DELETED:"tasks-bulk-deleted"},qa=(e,a)=>e==null||e===""?[]:a.map((n=>`private-encrypted-${e}.${n}`)),Xa=(e,a)=>e==null||e===""?[]:a.map((n=>`private-encrypted-${e}.${n}`)),G=e=>Array.isArray(e)&&e.every((a=>typeof a=="string")),Ya=e=>{if(e==null||typeof e!="object")return null;const a=e,n=typeof a.task_id=="string"?a.task_id:typeof a.id=="string"?a.id:null;if(n==null||typeof a.tenant_id!="string"||typeof a.event_type!="string")return null;const i={task_id:n,tenant_id:a.tenant_id,event_type:a.event_type};return typeof a.is_private=="boolean"&&(i.is_private=a.is_private),G(a.assignees)&&(i.assignees=a.assignees),G(a.direct_assignees)&&(i.direct_assignees=a.direct_assignees),typeof a.created_by=="string"&&(i.created_by=a.created_by),G(a.task_group_ids)&&(i.task_group_ids=a.task_group_ids),typeof a.name=="string"&&(i.name=a.name),typeof a.parent_task_id=="string"&&(i.parent_task_id=a.parent_task_id),i},Ha=e=>{if(e==null||typeof e!="object")return null;const a=e;return G(a.task_ids)?{task_ids:a.task_ids}:null},ke=e=>{if(e==null||typeof e!="object")return null;const a=e;return typeof a.task_id!="string"?null:{task_id:a.task_id}},Ja=za.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
|
+
`,ae=ma((function(e,a){const n=V(e,a.isTaskTemplatesEnabled),{taskGroupId:i}=a,r=i!=null&&i!==""?{...n,taskGroupsWithTasksList:n.taskGroupsWithTasksList.map((t=>({...t,tasks:t.tasks.filter((s=>s.taskGroupIds.includes(i)))}))).filter((t=>t.tasks.length>0))}:n,T=Ga(e),l=U.isZeniUser(),S=e.taskDetailState?.subTaskCreateStatus?.fetchState;return{taskListView:r,tagListView:T,localData:r.localData,isTaskTemplatesEnabled:a.isTaskTemplatesEnabled,isZeniUser:l,subTaskCreateStatus:S}}),(function(e,a){const{navigate:n,currentTenant:i,location:r,isTaskTemplatesEnabled:T}=a,{tenantEmailDomain:l}=i,{groupByKey:S}=a.uiState;return{onTaskManagementRowClick:t=>{const s=M(l,t),k=C(r.state?.pathnameStackToGoBack,r.pathname);n(s,{state:{pathnameStackToGoBack:k}})},onReloadTasks:()=>{e(D(!0,T))},onTabChange:t=>{e($a(t))},onParentTaskClick:t=>{const s=M(l,t);window.open(s,"_blank","noopener")},bulkUpdateTasks:(t,s)=>{e(z(t,null,s))},onNewTaskClick:()=>{if(a.localData.defaultTaskGroupId!=null){const t=R(l,a.localData.defaultTaskGroupId),s=C(r.state?.pathnameStackToGoBack,r.pathname);n(t,{state:{pathnameStackToGoBack:s,message:"comingFromTaskListPage"}})}},onColumnSortConfigChanged:(t,s)=>{e(Z({uiState:{sortKey:t,sortOrder:s}}))},onFiltersChange:t=>{e(xa({filters:t}))},onSearchTextChanged:t=>{e(ja({searchText:t}))},onReloadCards:()=>{e(D(!0,T))},onBackClick:()=>{if(r.state?.message==="triggerBackClick"){const t=Aa(r.state?.pathnameStackToGoBack),s=t.poppedPathname??"../";n(s,{state:{pathnameStackToGoBack:t.newStack}})}else n("../")},updateLocalData:t=>{e(Fa({localData:t}))},resetLocalData:()=>{e(W({taskGroupById:a.taskGroupState.taskGroupById}))},handleCreateGroup:t=>{e(Pa(a.localData.newTaskGroupName,t))},assignGroupToTasks:t=>{e(z(a.localData.selectedTaskIds,t,wa(a.uiState.groupByKey,t)))},onDeleteTaskGroup:t=>{e(Ua(t))},onAddNewTaskToTaskGroup:t=>{if(a.localData.defaultTaskGroupId!=null){const s=te(S,t);e(N({taskDetailLocalData:s}));const k=R(l,a.uiState.groupByKey==="groupName"?t:a.localData.defaultTaskGroupId),I=C(r.state?.pathnameStackToGoBack,r.pathname);n(k,{state:{pathnameStackToGoBack:I,message:"comingFromTaskListPage"}})}},onDragNDrop:(t,s)=>{e(Ra(a.localData.selectedTaskIds.length>0?a.localData.selectedTaskIds:[t],s))},onTaskGroupRename:(t,s)=>{e(va(t,s))},onTimeSpentUpdate:(t,s)=>{e(Q({task:t,updates:s}))},onShowToast:t=>{e(La(t))},onGroupByFilterChange:t=>{e(Z({uiState:{groupByKey:t}}))},updateTask:(t,s)=>{e(Q({task:t,updates:s}))},onCreateTagClick:(t,s)=>{e(Ka(t,s))},onSubtaskCreation:(t,s)=>{e(Ba({...s,parentTaskId:t}))},handleGroupTemplateClick:t=>{e(O(t,[]))},handleGroupTemplateTaskClick:(t,s)=>{e(O(t,[s]))},handleNewTaskInitialization:t=>{if(e(N({taskDetailLocalData:{...Ia,name:t}})),a.localData.defaultTaskGroupId!=null){const s=R(l,a.localData.defaultTaskGroupId),k=C(r.state?.pathnameStackToGoBack,r.pathname);n(s,{state:{pathnameStackToGoBack:k,message:"comingFromTaskListPage"}})}},onTaskGroupNameClick:t=>{n(`/${l}/tasks/group/${t}`)},onQuickResponsesClick:()=>{n(`/${l}/tasks/quick-responses`)}}}))(ba);function ee(){const e=pa(),a=Ta(),n=ga(),i=U.getSignedInUser(),r=U.isZeniUser(),T=fa(),l=v((u=>Ca(u))),{taskGroupId:S}=_a(),{useFeatureGate:t}=Da(),{isFeatureEnabled:s}=t(_.isTaskTemplatesEnabled),{isFeatureEnabled:k}=t(_.isTaskCannedResponsesEnabled),{isFeatureEnabled:I}=t(_.isTaskCategorizationEnabled),{isFeatureEnabled:q}=t(_.isTaskBulkResolutionEnabled),{isFeatureEnabled:X}=t(_.isTaskGroupAssigneesEnabled),{isFeatureEnabled:Y}=t(_.isTaskRecurringParentEnabled),[H,J]=A.useState(!1),B=v((u=>V(u,s))),K=v((u=>u.taskGroupState)),y=B.fetchState,{isAiCfoAccessEnabled:aa,onAskAiCfoClick:ea}=Ma({mobileExploreReferrer:"Task Checklist"});Sa({isDataReady:y==="Completed"}),A.useEffect((()=>{a(D(!1,s))}),[l?.tenantId,a,s]);const ta=A.useMemo((()=>{const u=[c.TASK_CREATED,c.TASK_UPDATED,c.TASKS_BULK_UPDATED,c.TASKS_BULK_DELETED],g=[c.TASK_CREATED,c.TASK_UPDATED,c.TASK_SNOOZE_RESURFACED,c.TASKS_BULK_UPDATED];return[...qa(l?.companyId,u),...Xa(i?.userId,g)]}),[l?.companyId,i?.userId]);if(Wa({events:ta,onEvent:(u,g)=>{switch(u){case c.TASK_CREATED:case c.TASK_UPDATED:{const o=Ya(g);if(o!=null){const b=T.getState(),w=o.task_id,p=w!=null?b.taskState.taskByID?.[w]:void 0,L=p!=null;if(!r)if(o.is_private===!0){if(!L)return}else{const E=i?.userId,h=new Set([...o.assignees??[],...o.direct_assignees??[]]);if(o.created_by!=null&&o.created_by!==""&&h.add(o.created_by),!(E!=null&&h.has(E))&&!L)return}if(u===c.TASK_UPDATED&&L&&p!=null&&Array.isArray(o.task_group_ids)){const E=new Set(Object.values(b.taskGroupState.taskGroupById??{}).filter((d=>d!=null&&!d.isDeleted)).map((d=>d.id))),h=(p.taskGroupIds??[]).filter((d=>E.has(d))),P=(o.task_group_ids??[]).filter((d=>E.has(d))),sa=h.length===P.length&&h.every((d=>P.includes(d))),F=p.taskGroupIds??[],j=o.task_group_ids??[],na=F.length!==j.length||!F.every((d=>j.includes(d))),oa=(d,da)=>{const x=d??[],$=da??[];if(x.length!==$.length)return!1;const ca=new Set($);return x.every((ka=>ca.has(ka)))},ia=o.name==null||o.name===p.name,ra=o.is_private==null||o.is_private===p.isPrivate,la=o.assignees==null||oa(o.assignees,p.assignees),ua=o.direct_assignees==null;if(sa&&na&&ia&&ra&&la&&ua)return}}return void a(D(!0,s))}case c.TASKS_BULK_DELETED:{const o=Ha(g);return o==null?void 0:void o.task_ids.forEach((b=>a(Za(b))))}case c.TASKS_BULK_UPDATED:case c.TASK_SNOOZE_RESURFACED:return void a(D(!0,s))}},onSubscribed:()=>{a(D(!0,s))}}),A.useEffect((()=>{y==="Completed"&&a(W({taskGroupById:K.taskGroupById}))}),[y,K.taskGroupById]),i==null)throw Error("Can't access task list page without signing in...");return f.jsxs(f.Fragment,{children:[y==="Completed"?f.jsx(ya,{analytics:Ea,onLoad:u=>(g=>g.trackPageLoaded(ha.Event.taskListPage))(u)}):null,f.jsxs(Ja,{children:[f.jsx(Va,{isAppContentDrawerOpen:H,handleDrawerToggle:u=>{J(u)}}),f.jsx(ae,{location:n,navigate:e,currentTenant:l,taskGroupId:S,taskGroupState:K,localData:B.localData,uiState:B.uiState,isTaskTemplatesEnabled:s,taskListFetchState:y,isTaskCategorizationEnabled:I,isTaskCannedResponsesEnabled:k,isTaskBulkResolutionEnabled:q,isTaskGroupAssigneesEnabled:X,isTaskRecurringParentEnabled:Y,isAiCfoAccessEnabled:aa,onAskAiCfoClick:ea})]})]})}const M=(e,a)=>`/${e}/tasks/${encodeURIComponent(a)}`,R=(e,a)=>`/${e}/tasks/new/${a}`,te=(e,a)=>{if(e==="assignee"){const n=a.split(",");return{...m.taskDetailLocalData,assignee:n}}if(e==="priority"){const n=Na(a);return{...m.taskDetailLocalData,priority:n}}if(e==="status"){const n=Oa(a);return{...m.taskDetailLocalData,status:n}}if(e==="tag"){const n=a.split(",");return{...m.taskDetailLocalData,tagIds:n}}if(e==="dueDate"){const n=Qa(a);return{...m.taskDetailLocalData,dueDate:n}}return{...m.taskDetailLocalData}},pe=Object.freeze(Object.defineProperty({__proto__:null,default:ee},Symbol.toStringTag,{value:"Module"}));export{c as T,Xa as a,qa as b,Ha as c,Ya as d,ee as e,pe as f,ke as t};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{j as i}from"./liveblocks-DRe6CbUC.js";import ue from"./NotFoundScreen-CZf0Su98.js";import{a as k}from"./sentry-0qxHOSjH.js";import{h as W,u as ee,j as E,g as de,i as ke,N as pe,l as me,n as Se,o as b}from"./core-B-JOvAoN.js";import{Q9 as ae,Qc as fe,Q6 as Te,a2b as ge,fI as te,a2c as se,Qy as g,Qq as T,Q3 as he,R2 as be,QX as Ee,a2d as ne,gk as oe,a2e as q,P$ as Ie,PY as De,v1 as Ce,uR as Ge,mC as Re,Qo as _e,a2f as ye,Rf as Ue,Qk as xe,QJ as Be,QG as ve,Qf as we,QD as Ae,QC as je}from"./zeni-epic-state-C5XzLjC7.js";import{z as _,e3 as Pe,c as Fe,_ as Le,f as G,a4 as re,p as R,a8 as Ke,k as Z,S as Qe,e4 as $e,Y as M,ae as Ne}from"./index-d9PzVM0C.js";import{n as Oe}from"./mui-D61DLOo-.js";import{u as ze}from"./useInitialThreadRequest-vRjTI0ud.js";import{M as Ve}from"./MobileAppDrawer-Cm83j2vk.js";import{b as qe,a as Ze,T as f,t as Me,c as J,d as X,e as Je}from"./TaskListScreen-D0yZXtyL.js";import{u as Xe}from"./useTaskManagerPusherEvents-Dru9PCIf.js";import"./recharts-DqtwTOUm.js";import"./analytics-DAlTxslb.js";import"./plaid-BBL8Aplq.js";import"./dnd-COhfK8Um.js";import"./stripe-cKAAJElX.js";import"./lottie-mNMGPSgQ.js";import"./lexical-BcThc0IB.js";import"./pdf-Di2GQu6S.js";import"./utils-C7LPuKOj.js";import"./InboxNotificationsProvider-DZQGEyxq.js";import"./useTaskManagerAccess-DvFZ_glf.js";import"./useAskAiCfoHostNavButtonProps-B_a9BtNp.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]="78314768-2096-4cda-8969-db9e75574905",e._sentryDebugIdIdentifier="sentry-dbid-78314768-2096-4cda-8969-db9e75574905")}catch{}})();function Ye(){const e=W(),a=ee(),n=_.getSignedInUser(),{cannedResponses:c,fetchState:s,saveFetchState:u}=E((o=>o.cannedResponsesState)),d=k.useCallback((()=>{a(ae())}),[a]),m=k.useCallback(((o,I,D)=>{a(fe({name:o,content:I,cannedResponseId:D}))}),[a]),t=k.useCallback((o=>{a(Te({cannedResponseId:o}))}),[a]);if(n==null)throw Error("Can't access quick responses page without signing in...");return i.jsx(Pe,{cannedResponses:c,isLoading:s==="In-Progress"||s==="Not-Started",isSaving:u==="In-Progress",onBackClick:()=>e(-1),onDelete:t,onFetch:d,onSave:m})}const L=e=>e?.taskState?.taskByID,P=(e,a)=>{const n=L(e);if(a!=null&&n!=null)return n[a]?.parentTaskId??void 0},He=ge([P,(e,a)=>{const n=P(e,a),c=L(e);if(n!=null&&c!=null)return c[n]?.name},(e,a)=>{const n=P(e,a),c=L(e);return n!=null&&c!=null&&c[n]!=null}],((e,a,n)=>{if(e!=null&&n===!0)return{id:e,name:a??""}}));let Y,H=[];const We=me((function(e,a){const{location:n,taskGroupId:c}=a,s=ne(e,a.taskId),u=te(e),d=He(e,a.taskId),m=s.taskGroupId??c,t=m!=null?q(e.taskGroupState,m):void 0,o=_.getSignedInUser(),I=u.tenantId,D={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:I??""},B=se(e),{tenantEmailDomain:v}=u,y=s.recurringSourceTaskId,w=y!=null?`${M.appUrl}/${v}/tasks/${encodeURIComponent(y)}`:void 0;var h;return{taskDetailSelectorView:s,authParams:D,isZeniUser:_.isZeniUser(),userGroupList:((h=e.userGroupsState.userGroupByUserGroupId)!==Y&&(Y=h,H=Object.values(h)),H),isNewClicked:n.state?.message==="comingFromTaskListPage",filesEndPoint:Ne.fileMicroServiceBaseUrl,companyName:a.currentTenant.companyName,companyId:a.currentTenant.companyId,currentUrl:`${M.appUrl}${a.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:w,tagListView:B,taskGroupName:m!=null&&t!=null&&t.isDefault===!1?t.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map((S=>q(e.taskGroupState,S))).filter((S=>S!=null&&!S.isDeleted)).map((S=>({id:S.id,name:S.name,isDefault:S.isDefault}))),subtasks:s.subtasks,parentTaskRef:d,subTaskCreateStatus:e.taskDetailState?.subTaskCreateStatus?.fetchState}}),(function(e,a){const{taskId:n,navigate:c,currentTenant:s,location:u,taskGroupId:d}=a,{tenantEmailDomain:m}=s;return{onSaveChangesToLocalStore:t=>{e(je({taskDetailLocalData:t,taskId:n}))},onSaveDetailClick:t=>{e(Ae(n,t??d))},onArchiveTaskClick:()=>{a.taskId!=null&&e(we(a.taskId))},onSnoozeTask:(t,o)=>{e(ve(t,o))},onUnsnoozeTask:t=>{e(Be(t))},onCreateSubtask:(t,o)=>{e(xe({...o,parentTaskId:t}))},onSubtaskUpdate:(t,o)=>{e(Ue({task:t,updates:o}))},onShowToast:t=>{e(oe(t))},onSubtaskRowClick:t=>{c(`/${m}/tasks/${t}`,{state:{pathnameStackToGoBack:R(u.state?.pathnameStackToGoBack,u.pathname)}})},onParentBreadcrumbClick:t=>{c(`/${m}/tasks/${t}`,{state:{pathnameStackToGoBack:R(u.state?.pathnameStackToGoBack,u.pathname)}})},onDismissClick:()=>{if(u.state?.message==="triggerBackClick"){const t=re(u.state?.pathnameStackToGoBack),o=t.poppedPathname??"../../dashboard";c(o,{state:{pathnameStackToGoBack:t.newStack}})}else{const t=x(m),o=R(u.state?.pathnameStackToGoBack,u.pathname);c(t,{state:{pathnameStackToGoBack:o}})}e(ye({taskId:n}))},onDeleteTaskClick:()=>{e(_e(n))},updateFilesEntity:t=>{e(Re({files:t}))},onDeleteFile:t=>{e(Ge(t))},onEditFileName:(t,o)=>{e(Ce(t,o.split(".")[0]))},onReloadTaskDetailPage:()=>{e(g(!1,n))},onCreateTagClick:t=>{e(De(t,n))},onDeleteTagClick:t=>{e(Ie(t,n))},onFetchCannedResponses:()=>{e(ae())},onManageTemplatesClick:()=>{c(`/${s.tenantEmailDomain}/tasks/quick-responses`)}}}))($e);function F(){const e=W(),a=ee(),n=de(),c=Fe(),{taskId:s,taskGroupId:u}=ke(),d=E((r=>te(r))),m=ze(d?.companyId),{useFeatureGate:t}=Le(),{isFeatureEnabled:o}=t(G.isTaskSnoozeEnabled),{isFeatureEnabled:I}=t(G.isTaskVisibilityEnabled),{isFeatureEnabled:D}=t(G.isTaskCannedResponsesEnabled),{isFeatureEnabled:B}=t(G.isTaskRecurringParentEnabled),{isFeatureEnabled:v}=t(G.isTaskGroupAssigneesEnabled),[y,w]=k.useState(!1),[h,S]=k.useState(!1),[K,ie]=k.useState(!1),[Q,A]=k.useState(!1),C=k.useRef(!1),U=E((r=>r.taskListState.updateTasksFetchState.fetchState)),$=E((r=>se(r))),N=E((r=>r.taskGroupViewState.fetchState));k.useEffect((()=>{a(g(!1,s)),s!=null&&a(T(s))}),[a,s]);const O=_.getSignedInUser()?.userId,ce=k.useMemo((()=>{const r=[f.TASK_CREATED,f.TASK_UPDATED,f.TASKS_BULK_UPDATED,f.TASKS_BULK_DELETED],l=[...r,f.TASK_SNOOZE_RESURFACED];return[...qe(d?.companyId,r),...Ze(O,l)]}),[d?.companyId,O]);Xe({events:ce,onSubscribed:()=>{s!=null&&(a(g(!0,s)),a(T(s)))},onEvent:(r,l)=>{if(s!=null)switch(r){case f.TASK_CREATED:{X(l)?.parent_task_id===s&&(a(g(!0,s)),a(T(s)));break}case f.TASK_UPDATED:{const p=X(l);if(p==null)break;p.task_id===s?(a(g(!0,s)),a(T(s))):p.parent_task_id===s&&a(T(s));break}case f.TASKS_BULK_UPDATED:{const p=J(l);if(p==null)break;p.task_ids.includes(s)&&a(g(!0,s)),a(T(s));break}case f.TASKS_BULK_DELETED:{const p=J(l);if(p==null)break;if(p.task_ids.includes(s)){a(oe({messageSection:"delete_task",messageText:"success",type:"success"})),d?.tenantEmailDomain!=null&&e(x(d.tenantEmailDomain));break}a(T(s));break}case f.TASK_SNOOZE_RESURFACED:{Me(l)?.task_id===s&&a(g(!0,s));break}}}}),k.useEffect((()=>{h||$.fetchState==="Completed"||(S(!0),a(he()))}),[h,a,$.fetchState]),k.useEffect((()=>{K||N==="Completed"||(ie(!0),a(be()))}),[K,a,N]);const le=k.useCallback((()=>{s!=null&&(C.current=!1,a(Ee([s],null,{isArchived:!1})),A(!0))}),[a,s]);k.useEffect((()=>{if(Q)if(U!=="In-Progress"){if(C.current){if(U==="Error")return A(!1),void(C.current=!1);if(U==="Completed"){A(!1),C.current=!1;const{tenantEmailDomain:r}=d;if(n.state?.message==="triggerBackClick"){const l=re(n.state?.pathnameStackToGoBack);e(l.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:l.newStack}})}else{const l=x(r);e(l,{state:{pathnameStackToGoBack:R(n.state?.pathnameStackToGoBack,n.pathname)}})}}}}else C.current=!0}),[Q,U,d,n,e]);const z=E((r=>ne(r,s))),j=z.fetchState,V=_.getSignedInUser();if(V==null)throw Error("Can't access task detail page without signing in...");if(j==="Error"&&z.error?.code===400){const{tenantEmailDomain:r}=d,l=x(r),p=R(n.state?.pathnameStackToGoBack,n.pathname);return i.jsx(pe,{to:l,state:{pathnameStackToGoBack:p}})}return i.jsxs(i.Fragment,{children:[j==="Completed"?i.jsx(Ke,{analytics:Z,onLoad:r=>(l=>l.trackPageLoaded(Qe.Event.taskDetailPage))(r)}):null,i.jsxs(ea,{children:[i.jsx(Ve,{isAppContentDrawerOpen:y,handleDrawerToggle:r=>{w(r)}}),i.jsx(We,{analytics:Z,currentTenant:d,handleZeniLogoClick:()=>{c.toggle()},initialOpenThreadRequest:m,location:n,loggedInUser:V,navigate:e,taskGroupId:u,taskId:s,taskDetailFetchState:j,onUnarchiveTaskClick:le,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:I,isTaskCannedResponsesEnabled:D,isTaskRecurringParentEnabled:B,isTaskGroupAssigneesEnabled:v})]})]})}const ea=Oe.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
|
+
`,x=e=>`/${e}/tasks`;function Ca(){return i.jsxs(Se,{children:[i.jsx(b,{path:"/new",element:i.jsx(F,{})}),i.jsx(b,{path:"/new/:taskGroupId",element:i.jsx(F,{})}),i.jsx(b,{path:"/group/:taskGroupId",element:i.jsx(Je,{})}),i.jsx(b,{path:"/quick-responses",element:i.jsx(Ye,{})}),i.jsx(b,{path:"/:taskId",element:i.jsx(F,{})}),i.jsx(b,{path:"*",element:i.jsx(ue,{})})]})}export{Ca as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as t}from"./liveblocks-DRe6CbUC.js";import i from"./NotFoundScreen-CZf0Su98.js";import{T as r}from"./TransactionDetailScreen-CJgdnrqI.js";import"./sentry-0qxHOSjH.js";import{n as a,o as e}from"./core-B-JOvAoN.js";import"./zeni-epic-state-C5XzLjC7.js";import"./recharts-DqtwTOUm.js";import"./index-d9PzVM0C.js";import"./mui-D61DLOo-.js";import"./analytics-DAlTxslb.js";import"./plaid-BBL8Aplq.js";import"./dnd-COhfK8Um.js";import"./stripe-cKAAJElX.js";import"./lottie-mNMGPSgQ.js";import"./lexical-BcThc0IB.js";import"./pdf-Di2GQu6S.js";import"./utils-C7LPuKOj.js";import"./useAskAiCfoHostNavButtonProps-B_a9BtNp.js";import"./decodeURIComponentSafe-KCik1Gu_.js";import"./useInitialThreadRequest-vRjTI0ud.js";import"./routePaths-Dw39xRTk.js";import"./expenseAutomationHelper-CvpVcBcR.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new o.Error().stack;n&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[n]="bfd19369-9f5a-4875-9ff9-f0a50fe2624d",o._sentryDebugIdIdentifier="sentry-dbid-bfd19369-9f5a-4875-9ff9-f0a50fe2624d")}catch{}})();function z(){return t.jsxs(a,{children:[t.jsx(e,{path:"/:transactionTypeEncoded/:transactionId",element:t.jsx(r,{})}),t.jsx(e,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:t.jsx(i,{})}),t.jsx(e,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:t.jsx(r,{})}),t.jsx(e,{path:"/*",element:t.jsx(r,{})})]})}export{z as default};
|
package/dist/assets/{TransactionDetailScreen-BWee1nGS.js → TransactionDetailScreen-CJgdnrqI.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{j as R}from"./liveblocks-CQOAuUNI.js";import{a as i}from"./sentry-pp_6zWNc.js";import{u as j,k as ot,j as g,s as ge,g as De,h as Ce,i as Ae,N as st,l as ct}from"./core-D07hD3KT.js";import{py as Ie,fI as Z,gY as it,UU as rt,oE as lt,oe as dt,DM as se,X6 as ut,gk as mt,bn as pt,dg as Re,bq as _e,sY as W,V_ as H,X7 as we,X8 as le,Wo as Pe,md as Fe,X9 as Ue,Wt as de,Wu as ue,n2 as xe,Sp as me,X2 as G,m7 as Le,m5 as Ve,mh as ft,pl as ht,Xa as St,Xb as yt,DD as J,mc as Be,RK as Oe,cn as Tt,dm as bt,Xc as gt,X1 as It,Xd as vt,Xe as Et,Xf as kt,Xg as Dt,Dz as Ct,Xh as At,Xi as Rt,Xj as _t,Xk as wt,Xl as Pt,mg as Ft,Xm as Ut,Xn as xt,X3 as Lt,Xo as Vt,Xp as Bt,Xq as Ot,RE as Nt,Ru as zt,RT as Xt,mi as jt,Sq as ve,pq as Mt}from"./zeni-epic-state-B3TABHgO.js";import{H as Y,y as w,k as $,b2 as Gt,z as Ne,E as $t,a1 as qt,b3 as Wt,ab as Ht,a4 as ce,W as Yt,b4 as Kt,p as ie,as as Jt,b5 as Qt,b6 as Zt,b7 as en,ae as tn,av as oe}from"./index-BXZoRXDS.js";import{n as nn,S as an,D as on}from"./mui-XiTT8YBC.js";import{u as sn}from"./useAskAiCfoHostNavButtonProps-C9O3AmSz.js";import{d as ze}from"./decodeURIComponentSafe-D3MFRtCF.js";import{u as cn}from"./useInitialThreadRequest-COOzD5oF.js";import{h as Xe,c as je,g as rn,e as ln}from"./routePaths-D5u7Fiee.js";import{u as dn}from"./expenseAutomationHelper-CL7YOVzM.js";import{A as un}from"./utils-CrOdvv6w.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="0c2968ca-1add-4f6b-b40e-f849fda6f9a6",t._sentryDebugIdIdentifier="sentry-dbid-0c2968ca-1add-4f6b-b40e-f849fda6f9a6")}catch{}})();function mn(t=!0){const e=j(),o=ot(),{useFeatureGate:n}=Y(),{isFeatureEnabled:a}=n(w.isCreateTransferEntryFromExpenseEnabled);i.useEffect((()=>{if(!t||a!==!0)return;const s=c=>{const d=o.getState().createTransferEntryState.transferAccountsByType[c].fetchState;return d!=="In-Progress"&&d!=="Completed"};s("transferEntryEligible")&&e(Ie({kind:"transferEntryEligible"})),s("creditCardOnlyEligible")&&e(Ie({kind:"creditCardOnlyEligible"}))}),[t,a,e,o])}function pn(t,e){const o=(function(){const d=j(),[y,h]=i.useState(!1),[D,p]=i.useState(null),[l,u]=i.useState(null),{useDynamicConfig:S}=Y(),{configValue:v,isDynamicConfigLoading:f}=S("transaction_categorization_config"),T=!f&&v?.capitalization_enabled===!0,k=g((I=>Z(I))),C=k.companyId,P=g((I=>it(I.companyState,k.companyId)?.company.companyLocaleInfo?.currencySymbol??"$")),{capitalizableAccounts:A,capitalizableAccountOverrides:F,dismissedAccounts:U}=g((I=>{const b=I.tenantState.currentTenantId,_=b!=null?I.tenantState.tenantsById[b]:void 0;return{capitalizableAccounts:_?.capitalizableAccounts??null,capitalizableAccountOverrides:_?.capitalizableAccountOverrides??null,dismissedAccounts:_?.capitalizationOnboardingDismissedAccounts??null}}),ge),V=i.useRef(A);V.current=A;const x=i.useRef(F);x.current=F;const B=i.useRef(U);B.current=U;const O=g((I=>rt(I.accountState)),ge),M=i.useMemo((()=>{const I={};for(const b of O)b.accountId!=null&&b.accountName!=null&&(I[b.accountId]=b.accountName);return I}),[O]),q=l!=null?M[l]??null:null,N=i.useCallback((I=>{if(!T)return;const b=V.current;if(b==null)return;const _=b.accounts??[],K=new Set(I),ee=x.current??{},te=B.current;for(const z of _)if(K.has(z.accountId)&&ee[z.accountId]==null&&te?.[z.accountId]==null)return p(z.classificationType),u(z.accountId),void h(!0)}),[T]),E=i.useCallback(((I,b)=>{d(lt(C,I,b,!0)),h(!1),p(null),u(null)}),[d,C]),r=i.useCallback((()=>{l!=null&&(d(dt(C,l)),h(!1),p(null),u(null))}),[d,C,l]);return{showPopup:y&&T,popupType:D,popupAccountId:l,popupAccountName:q,currencySymbol:P,checkAndShowPopup:N,handleSubmit:E,handleDismiss:r}})(),n=i.useRef(void 0),a=i.useRef([]),s=i.useRef(o.checkAndShowPopup);s.current=o.checkAndShowPopup;const c=i.useRef(e);return c.current=e,i.useEffect((()=>{t==="In-Progress"&&(a.current=c.current()),t==="Completed"&&n.current==="In-Progress"&&a.current.length>0&&(s.current(a.current),a.current=[]),n.current=t}),[t]),o}const X=new Map,Ee=(t,e,o)=>`${t}|${e??""}|${o}`,Q=(t,e)=>{const[o,n]=t.shownRecommendations;return{recommendationFor:t.dimension,recommendation:o?.name??"",recommendationSource:o?.engine??null,recommendationConfidencePercentage:o?.confidencePercentage??null,alternativeRecommendation:n?.name??null,alternativeRecommendationSource:n?.engine??null,alternativeRecommendationConfidencePercentage:n?.confidencePercentage??null,selectedValue:t.selected.name,numberOfRecommendations:t.shownRecommendations.length,transactionId:e,lineId:t.lineId??null}},re=(t,e,o)=>({transactionId:e,lineId:t.lineId,dimension:t.dimension,outcome:t.outcome,selected:{name:t.selected.name,id:t.selected.id},matchedSource:t.matchedSource,matchedRank:t.matchedRank,topPickSource:t.topPickSource,shownRecommendations:t.shownRecommendations.map((n=>({source:n.source,rank:n.rank,value:{name:n.name,id:n.id},confidence:n.confidencePercentage!=null?n.confidencePercentage/100:void 0}))),...o}),Me=(t,e,o)=>{$.trackRecommendationFeedbackRetracted(Q(e,o)),t(se(re(e,o,{outcome:"retracted"})))},Vn=(t,e)=>{const o=new Set(e.map(String));X.forEach(((n,a)=>{o.has(n.transactionId)&&(X.delete(a),Me(t,n.feedback,n.transactionId))}))},Bn=t=>{const e=new Set(t.map(String));X.forEach(((o,n)=>{e.has(o.transactionId)&&X.delete(n)}))};function fn(t){const e=j(),[o,n]=i.useState(null),[a,s]=i.useState(!1),{fetchState:c}=g(ut),{isEnabled:d,fallbackTransactionId:y}=t,h=i.useCallback((u=>u.transactionId??y??""),[y]),D=i.useCallback((u=>{if(!d)return;const S=h(u);if(S==="")return;if(u.outcome!=="accepted")return void n(u);((f,T,k,C)=>{const P=Ee(T,k,C),A=X.get(P);return A!=null&&(X.delete(P),Me(f,A.feedback,A.transactionId),!0)})(e,S,u.lineId,u.dimension)||(((f,T)=>{$.trackRecommendationAccepted(Q(f,T))})(u,S),e(se(re(u,S,{}))))}),[d,h,e]),p=i.useCallback((u=>{if(o==null)return;const S=h(o);((v,f,T)=>{$.trackRecommendationFeedbackSubmitted({...Q(v,f),feedbackReason:T})})(o,S,u),e(se(re(o,S,{reasonText:u,skipped:!1}))),((v,f)=>{X.set(Ee(f,v.lineId,v.dimension),{feedback:v,transactionId:f})})(o,S),s(!0)}),[o,h,e]),l=i.useCallback((()=>{var u,S;o!=null&&(u=o,S=h(o),$.trackRecommendationFeedbackSkipped(Q(u,S)),s(!1),n(null))}),[o,h]);return i.useEffect((()=>{if(!a||c!=="Completed"&&c!=="Error")return;s(!1),n(null);const u=c==="Completed";e(mt({messageSection:"recommendation_feedback",messageText:u?"success":"failed",type:u?"success":"error",showStatusIcon:!0}))}),[a,c,e]),{onRecommendationSelection:D,popup:o!=null?R.jsx(Gt,{feedback:o,submitState:a?c:"Not-Started",onSubmit:p,onSkip:l}):null}}const pe=()=>{const t=Ne.getSignedInUser(),{useFeatureGate:e}=Y(),{isFeatureEnabled:o}=e(w.isChainOfThoughtEnabled);return i.useMemo((()=>pt(t)&&o),[t,o])};function Ge(t){if(t!=null){if("customer"in t&&t.customer!=null){const{customer:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in t&&t.vendor!=null){const{vendor:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function On(t,e){const o=j(),{useFeatureGate:n}=Y(),a=g((r=>Z(r))),s=a.userRole.includes("charge_card_user")||a.userRole.includes("charge_card_admin"),c=a.userRole!=null&&Re(a.userRole),d=a.userRole!=null&&_e(a.userRole),{isFeatureEnabled:y}=n(w.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:h}=n(w.isExpenseAutomationEnabled),D=pe(),p=i.useMemo((()=>({id:t,type:W(e)})),[t,e]),l=g((r=>H(r,p))),u=l?.transactionDetailUpdateStatus?.fetchState,S=l?.transactionDetailLocalData?.lineItemById,v=g((r=>{const I=H(r,p)?.transactionDetailLocalData.vendorUpdates?.id;return I==null?"Not-Started":r.transactionVendorViewState.editVendorStateById[I]?.saveStatus.fetchState??"Not-Started"})),f=i.useMemo((()=>l?.fetchState==="Completed"?Ge(l?.transaction):void 0),[l?.fetchState,l?.transaction]),T=g((r=>{if(f!=null)return we(r.customerIncomeState,r.vendorExpenseState,r.trendState,f,"month")})),k=g((r=>le(r))),C=g((r=>{if(f!=null)return Pe(r.trendWithTransactionsState,f,"TransactionDetail")})),P=a.company?.companyInfo.firstMonthOfFY??1,A=g((r=>Fe(r.accountState,r.accountListState,"accountList"))),[F,U]=i.useState(!1),[V,x]=i.useState(!1),[B,O]=i.useState(!1);i.useEffect((()=>{U(!1),x(!1),O(!1)}),[t,e]);const M=i.useCallback((()=>{U(!1),x(!1)}),[]),[q,N]=i.useState(!1),E=C?.selectedPeriod?.timePeriod;return i.useEffect((()=>{B||l==null||l.transaction==null||(o(Ue({id:l.transaction.id,type:l.transaction.type})),O(!0)),f!=null&&(!s||c&&d===!1)&&(F?V||T==null||(x(!0),o(me(f,"TransactionDetail",{timeframe:"month",timePeriod:E??T}))):(o(de()),o(ue()),U(!0),o(xe(f))))}),[o,B,l?.fetchState,l?.transaction,f,s,c,d,F,V,T,E]),i.useEffect((()=>{k.newVendorState?.vendorDetailLocalData?.vendorName!=null?N(!0):N(!1)}),[k.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect((()=>()=>{o(G("common"))}),[o]),{currentTenant:a,loggedInUserHasCardUserOrAdminRole:s,isUserHasDashboardAccess:c,isUserHasInvestorOrBankerAccess:d,isVendorBulkUpdateOnTransactionEnabled:y,isExpenseAutomationEnabled:h,isChainOfThoughtEnabled:D,selectedTransaction:p,transactionDetail:l,rawDetailSaveStatus:u,rawDetailLineItemById:S,vendorSaveStatus:v,tranEntity:f,defaultTrendTransactionTimePeriod:T,vendorViewDetails:k,uiState:C,firstMonthOfFY:P,uncategorizedAccounts:A,resetTrendIsFetchedStates:M,isCreateVendorDrawerOpen:q,setIsCreateVendorDrawerOpen:N}}const hn={overlayWidth:new Ht(100,100,58)},Sn=({isOpen:t,onSaveVendor:e,onSaveSuccess:o,onCancel:n,vendorViewDetails:a})=>{const s=$t(),c=qt(),d=j(),y=g((p=>le(p))),h=()=>{n()},D={vendorDetailView:a??y,onSaveSuccess:()=>{d(Ve()),d(ft("Not-Started")),o()},onSaveVendor:e,onCancelClick:h,saveVendorDetailLocalData:p=>{d(Le({vendorId:void 0,localData:p}))}};return R.jsx(on,{anchor:"right",open:t,PaperProps:{style:{width:hn.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:s.colors.black,opacity:.4,cursor:"pointer"}}},onClose:h,children:R.jsx(yn,{onClick:p=>p.stopPropagation(),children:R.jsx(Wt,{...D})})})},yn=nn(an)`
|
|
1
|
+
import{j as R}from"./liveblocks-DRe6CbUC.js";import{a as i}from"./sentry-0qxHOSjH.js";import{u as j,k as ot,j as g,s as ge,g as De,h as Ce,i as Ae,N as st,l as ct}from"./core-B-JOvAoN.js";import{py as Ie,fI as K,gY as it,UQ as rt,oE as lt,oe as dt,DL as se,X2 as ut,gk as mt,bn as pt,dg as Re,bq as _e,sY as q,VW as Y,X3 as Pe,X4 as le,Wk as we,md as Fe,X5 as Ue,Wp as de,Wq as ue,n2 as xe,Sl as me,W_ as M,m7 as Le,m5 as Oe,mh as ft,pl as ht,X6 as St,X7 as yt,DC as Z,mc as Be,RG as Ve,cn as Tt,dm as bt,X8 as gt,WZ as It,X9 as vt,Xa as kt,Xb as Et,Xc as Dt,Dy as Ct,Xd as At,Xe as Rt,Xf as _t,Xg as Pt,Xh as wt,mg as Ft,Xi as Ut,Xj as xt,W$ as Lt,Xk as Ot,Xl as Bt,Xm as Vt,RA as Nt,Rq as zt,RP as Xt,mi as jt,Sm as ve,pq as Gt}from"./zeni-epic-state-C5XzLjC7.js";import{_ as H,f as P,k as $,b2 as Mt,z as Ne,E as $t,a1 as Wt,b3 as qt,ab as Yt,a4 as ce,O as Ht,b4 as Qt,p as ie,as as Zt,b5 as Jt,b6 as Kt,b7 as en,ae as tn,av as oe}from"./index-d9PzVM0C.js";import{n as nn,S as an,D as on}from"./mui-D61DLOo-.js";import{u as sn}from"./useAskAiCfoHostNavButtonProps-B_a9BtNp.js";import{d as ze}from"./decodeURIComponentSafe-KCik1Gu_.js";import{u as cn}from"./useInitialThreadRequest-vRjTI0ud.js";import{h as Xe,c as je,g as rn,e as ln}from"./routePaths-Dw39xRTk.js";import{u as dn}from"./expenseAutomationHelper-CvpVcBcR.js";import{A as un}from"./utils-C7LPuKOj.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="57e5571a-b906-4858-ab7c-e416173a5528",t._sentryDebugIdIdentifier="sentry-dbid-57e5571a-b906-4858-ab7c-e416173a5528")}catch{}})();function mn(t=!0){const e=j(),o=ot(),{useFeatureGate:n}=H(),{isFeatureEnabled:a}=n(P.isCreateTransferEntryFromExpenseEnabled);i.useEffect((()=>{if(!t||a!==!0)return;const s=c=>{const d=o.getState().createTransferEntryState.transferAccountsByType[c].fetchState;return d!=="In-Progress"&&d!=="Completed"};s("transferEntryEligible")&&e(Ie({kind:"transferEntryEligible"})),s("creditCardOnlyEligible")&&e(Ie({kind:"creditCardOnlyEligible"}))}),[t,a,e,o])}function pn(t,e){const o=(function(){const d=j(),[y,h]=i.useState(!1),[D,p]=i.useState(null),[l,u]=i.useState(null),{useDynamicConfig:S}=H(),{configValue:v,isDynamicConfigLoading:f}=S("transaction_categorization_config"),T=!f&&v?.capitalization_enabled===!0,E=g((I=>K(I))),C=E.companyId,w=g((I=>it(I.companyState,E.companyId)?.company.companyLocaleInfo?.currencySymbol??"$")),{capitalizableAccounts:A,capitalizableAccountOverrides:F,dismissedAccounts:U}=g((I=>{const b=I.tenantState.currentTenantId,_=b!=null?I.tenantState.tenantsById[b]:void 0;return{capitalizableAccounts:_?.capitalizableAccounts??null,capitalizableAccountOverrides:_?.capitalizableAccountOverrides??null,dismissedAccounts:_?.capitalizationOnboardingDismissedAccounts??null}}),ge),O=i.useRef(A);O.current=A;const x=i.useRef(F);x.current=F;const B=i.useRef(U);B.current=U;const V=g((I=>rt(I.accountState)),ge),G=i.useMemo((()=>{const I={};for(const b of V)b.accountId!=null&&b.accountName!=null&&(I[b.accountId]=b.accountName);return I}),[V]),W=l!=null?G[l]??null:null,N=i.useCallback((I=>{if(!T)return;const b=O.current;if(b==null)return;const _=b.accounts??[],Q=new Set(I),ee=x.current??{},te=B.current;for(const z of _)if(Q.has(z.accountId)&&ee[z.accountId]==null&&te?.[z.accountId]==null)return p(z.classificationType),u(z.accountId),void h(!0)}),[T]),k=i.useCallback(((I,b)=>{d(lt(C,I,b,!0)),h(!1),p(null),u(null)}),[d,C]),r=i.useCallback((()=>{l!=null&&(d(dt(C,l)),h(!1),p(null),u(null))}),[d,C,l]);return{showPopup:y&&T,popupType:D,popupAccountId:l,popupAccountName:W,currencySymbol:w,checkAndShowPopup:N,handleSubmit:k,handleDismiss:r}})(),n=i.useRef(void 0),a=i.useRef([]),s=i.useRef(o.checkAndShowPopup);s.current=o.checkAndShowPopup;const c=i.useRef(e);return c.current=e,i.useEffect((()=>{t==="In-Progress"&&(a.current=c.current()),t==="Completed"&&n.current==="In-Progress"&&a.current.length>0&&(s.current(a.current),a.current=[]),n.current=t}),[t]),o}const X=new Map,ke=(t,e,o)=>`${t}|${e??""}|${o}`,J=(t,e)=>{const[o,n]=t.shownRecommendations;return{recommendationFor:t.dimension,recommendation:o?.name??"",recommendationSource:o?.engine??null,recommendationConfidencePercentage:o?.confidencePercentage??null,alternativeRecommendation:n?.name??null,alternativeRecommendationSource:n?.engine??null,alternativeRecommendationConfidencePercentage:n?.confidencePercentage??null,selectedValue:t.selected.name,numberOfRecommendations:t.shownRecommendations.length,transactionId:e,lineId:t.lineId??null}},re=(t,e,o)=>({transactionId:e,lineId:t.lineId,dimension:t.dimension,outcome:t.outcome,selected:{name:t.selected.name,id:t.selected.id},matchedSource:t.matchedSource,matchedRank:t.matchedRank,topPickSource:t.topPickSource,shownRecommendations:t.shownRecommendations.map((n=>({source:n.source,rank:n.rank,value:{name:n.name,id:n.id},confidence:n.confidencePercentage!=null?n.confidencePercentage/100:void 0}))),...o}),Ge=(t,e,o)=>{$.trackRecommendationFeedbackRetracted(J(e,o)),t(se(re(e,o,{outcome:"retracted"})))},On=(t,e)=>{const o=new Set(e.map(String));X.forEach(((n,a)=>{o.has(n.transactionId)&&(X.delete(a),Ge(t,n.feedback,n.transactionId))}))},Bn=t=>{const e=new Set(t.map(String));X.forEach(((o,n)=>{e.has(o.transactionId)&&X.delete(n)}))};function fn(t){const e=j(),[o,n]=i.useState(null),[a,s]=i.useState(!1),{fetchState:c}=g(ut),{isEnabled:d,fallbackTransactionId:y}=t,h=i.useCallback((u=>u.transactionId??y??""),[y]),D=i.useCallback((u=>{if(!d)return;const S=h(u);if(S==="")return;if(u.outcome!=="accepted")return void n(u);((f,T,E,C)=>{const w=ke(T,E,C),A=X.get(w);return A!=null&&(X.delete(w),Ge(f,A.feedback,A.transactionId),!0)})(e,S,u.lineId,u.dimension)||(((f,T)=>{$.trackRecommendationAccepted(J(f,T))})(u,S),e(se(re(u,S,{}))))}),[d,h,e]),p=i.useCallback((u=>{if(o==null)return;const S=h(o);((v,f,T)=>{$.trackRecommendationFeedbackSubmitted({...J(v,f),feedbackReason:T})})(o,S,u),e(se(re(o,S,{reasonText:u,skipped:!1}))),((v,f)=>{X.set(ke(f,v.lineId,v.dimension),{feedback:v,transactionId:f})})(o,S),s(!0)}),[o,h,e]),l=i.useCallback((()=>{var u,S;o!=null&&(u=o,S=h(o),$.trackRecommendationFeedbackSkipped(J(u,S)),s(!1),n(null))}),[o,h]);return i.useEffect((()=>{if(!a||c!=="Completed"&&c!=="Error")return;s(!1),n(null);const u=c==="Completed";e(mt({messageSection:"recommendation_feedback",messageText:u?"success":"failed",type:u?"success":"error",showStatusIcon:!0}))}),[a,c,e]),{onRecommendationSelection:D,popup:o!=null?R.jsx(Mt,{feedback:o,submitState:a?c:"Not-Started",onSubmit:p,onSkip:l}):null}}const pe=()=>{const t=Ne.getSignedInUser(),{useFeatureGate:e}=H(),{isFeatureEnabled:o}=e(P.isChainOfThoughtEnabled);return i.useMemo((()=>pt(t)&&o),[t,o])};function Me(t){if(t!=null){if("customer"in t&&t.customer!=null){const{customer:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in t&&t.vendor!=null){const{vendor:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function Vn(t,e){const o=j(),{useFeatureGate:n}=H(),a=g((r=>K(r))),s=a.userRole.includes("charge_card_user")||a.userRole.includes("charge_card_admin"),c=a.userRole!=null&&Re(a.userRole),d=a.userRole!=null&&_e(a.userRole),{isFeatureEnabled:y}=n(P.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:h}=n(P.isExpenseAutomationEnabled),D=pe(),p=i.useMemo((()=>({id:t,type:q(e)})),[t,e]),l=g((r=>Y(r,p))),u=l?.transactionDetailUpdateStatus?.fetchState,S=l?.transactionDetailLocalData?.lineItemById,v=g((r=>{const I=Y(r,p)?.transactionDetailLocalData.vendorUpdates?.id;return I==null?"Not-Started":r.transactionVendorViewState.editVendorStateById[I]?.saveStatus.fetchState??"Not-Started"})),f=i.useMemo((()=>l?.fetchState==="Completed"?Me(l?.transaction):void 0),[l?.fetchState,l?.transaction]),T=g((r=>{if(f!=null)return Pe(r.customerIncomeState,r.vendorExpenseState,r.trendState,f,"month")})),E=g((r=>le(r))),C=g((r=>{if(f!=null)return we(r.trendWithTransactionsState,f,"TransactionDetail")})),w=a.company?.companyInfo.firstMonthOfFY??1,A=g((r=>Fe(r.accountState,r.accountListState,"accountList"))),[F,U]=i.useState(!1),[O,x]=i.useState(!1),[B,V]=i.useState(!1);i.useEffect((()=>{U(!1),x(!1),V(!1)}),[t,e]);const G=i.useCallback((()=>{U(!1),x(!1)}),[]),[W,N]=i.useState(!1),k=C?.selectedPeriod?.timePeriod;return i.useEffect((()=>{B||l==null||l.transaction==null||(o(Ue({id:l.transaction.id,type:l.transaction.type})),V(!0)),f!=null&&(!s||c&&d===!1)&&(F?O||T==null||(x(!0),o(me(f,"TransactionDetail",{timeframe:"month",timePeriod:k??T}))):(o(de()),o(ue()),U(!0),o(xe(f))))}),[o,B,l?.fetchState,l?.transaction,f,s,c,d,F,O,T,k]),i.useEffect((()=>{E.newVendorState?.vendorDetailLocalData?.vendorName!=null?N(!0):N(!1)}),[E.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect((()=>()=>{o(M("common"))}),[o]),{currentTenant:a,loggedInUserHasCardUserOrAdminRole:s,isUserHasDashboardAccess:c,isUserHasInvestorOrBankerAccess:d,isVendorBulkUpdateOnTransactionEnabled:y,isExpenseAutomationEnabled:h,isChainOfThoughtEnabled:D,selectedTransaction:p,transactionDetail:l,rawDetailSaveStatus:u,rawDetailLineItemById:S,vendorSaveStatus:v,tranEntity:f,defaultTrendTransactionTimePeriod:T,vendorViewDetails:E,uiState:C,firstMonthOfFY:w,uncategorizedAccounts:A,resetTrendIsFetchedStates:G,isCreateVendorDrawerOpen:W,setIsCreateVendorDrawerOpen:N}}const hn={overlayWidth:new Yt(100,100,58)},Sn=({isOpen:t,onSaveVendor:e,onSaveSuccess:o,onCancel:n,vendorViewDetails:a})=>{const s=$t(),c=Wt(),d=j(),y=g((p=>le(p))),h=()=>{n()},D={vendorDetailView:a??y,onSaveSuccess:()=>{d(Oe()),d(ft("Not-Started")),o()},onSaveVendor:e,onCancelClick:h,saveVendorDetailLocalData:p=>{d(Le({vendorId:void 0,localData:p}))}};return R.jsx(on,{anchor:"right",open:t,PaperProps:{style:{width:hn.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:s.colors.black,opacity:.4,cursor:"pointer"}}},onClose:h,children:R.jsx(yn,{onClick:p=>p.stopPropagation(),children:R.jsx(qt,{...D})})})},yn=nn(an)`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
flex-direction: column;
|
|
5
|
-
`;function Tn(t,e){t(ht({transactionId:e.transactionId,creditAccountIntegrationId:e.creditAccountIntegrationId,debitAccountIntegrationId:e.debitAccountIntegrationId,memo:e.memo,transactionType:W(e.transactionType),sourceTransactionType:W(e.sourceTransactionType)}))}function bn({currentTransactionId:t,enabled:e=!0,buildPath:o,beforeNavigate:n,navigate:a,navigateState:s}){const c=g((y=>y.createTransferEntryState.lastTransferEntryReplacement)),d=i.useRef(null);i.useEffect((()=>{if(!e||c==null||t==null||d.current===c)return;const{previousTransactionId:y,newTransactionId:h}=c;t.id===y.id&&t.type===y.type&&(d.current=c,n?.(),a(o(h),{replace:!0,state:s}))}),[e,c,t,o,n,a,s])}const gn=({closeDrawerHandler:t,overrideTransactionId:e,overrideTransactionType:o})=>{const n=De(),a=Ce(),s=j(),c=pe(),{transactionTypeEncoded:d,transactionId:y}=Ae(),h=e??y,D=o??ze(d??"");let p;Xe(h,D)&&(p={id:h,type:W(D)});const l=p!=null?g((S=>H(S,p))):void 0,u=()=>{const S=ce(n.state?.pathnameStackToGoBack),v=S.poppedPathname??((f=2)=>{let T="../";for(let k=0;k<f;k++)T=`${T}../`;return T})(1);a(v,{state:{pathnameStackToGoBack:S.newStack}})};return{transactionId:p,onSaveVendor:()=>{s(Be(p,void 0))},onSaveSuccess:()=>{if(l!=null&&l?.transaction&&l?.transactionDetailLocalData.vendorUpdates?.qboId!=null&&l?.transactionDetailLocalData.vendorUpdates?.id!=null){const S=l?.transactionDetailLocalData.vendorUpdates,v={id:l?.transactionDetailLocalData.vendorUpdates?.qboId,zeniId:l?.transactionDetailLocalData.vendorUpdates?.id,type:"vendor",name:S?.name,qboId:l?.transactionDetailLocalData.vendorUpdates?.qboId??""},f={transactionId:{id:l?.transaction?.id,type:l?.transaction?.type},transaction:l?.transaction,lineIds:l?.transaction?.lines?.map((T=>T.id))??[]};s(J({entity:v,amount:l?.transaction?.amount.amount,transactionDetails:f,flowType:"detail",isFetchCOT:c}))}u()},onCancel:()=>{p!=null&&s(St({transactionId:p})),s(Ve()),s(yt()),t(!0),u()}}},In=ct((function(t,e){const o=H(t,e.selectedTransaction);let n;o==null&&console.warn("Check if the you've selected the transaction before getting the details");const a=Ne.getSignedInUser(),s=t.tenantState.currentTenantId,c={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:s??""};o!=null&&o.fetchState==="Completed"&&o.transaction!=null&&e.entity!=null&&(n=gt(t,e.entity,"TransactionDetail"));const d=t.entityAutoCompleteState.autoCompleteText.common,y=It(t,"common"),h=Z(t);return{transactionDetail:o,transactionAttachmentEndpointToDownload:`${oe}/transaction_attachment`,transactionAttachmentsEndpointToFetch:h.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${oe}/transaction_attachments_accounting_provider`:`${oe}/transaction_attachments`,attachmentUploadEndpoint:`${tn.accountMicroServiceBaseUrl}`,isCOTEnabled:e.isCOTEnabled,authParams:c,trendReport:n,analytics:$,uncategorizedAccounts:e.uncategorizedAccounts,autoCompleteData:{autoCompleteText:d,entityAutoCompleteView:y},isVendorBulkUpdateOnTransactionEnabled:e.isVendorBulkUpdateOnTransactionEnabled,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,enableBackClickOnSave:e.location.state?.message?.startsWith("comingFromScheduleDetails"),isTransactionSplitEditMode:o?.transactionDetailLocalData?.editMode??!1}}),(function(t,e){const{isCOTEnabled:o}=e;return{onBackClick:()=>{if(t(G("common")),e.onBackClick!=null)return void e.onBackClick();const n=ce(e.location.state?.pathnameStackToGoBack),a=n.poppedPathname??$e(2);e.navigate(a,{state:{pathnameStackToGoBack:n.newStack,message:"comingFromTransactionDetail"}})},discardTransactionDetailLocalData:(n,a)=>{e.transaction!=null&&t(Mt({transactionId:{id:e.transaction.id,type:e.transaction.type},vendorId:n,customerId:a}))},onTransactionClick:n=>{e.resetTrendIsFetchedStates(),t(de()),t(ue());const a=ie(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(je(n,e.tenantEmailDomain),{state:{pathnameStackToGoBack:a}})},onTrendSelectedPeriodChange:n=>{if(n==null)e.defaultTrendTransactionTimePeriod!=null&&t(ve(e.entity,"TransactionDetail",{timeframe:"month",timePeriod:e.defaultTrendTransactionTimePeriod}));else{const a=n.currentTimePeriod==null?n.addTimePeriod:{startDate:n.addTimePeriod.startDate,endDate:n.currentTimePeriod.endDate};t(me(e.entity,"TransactionDetail",{timeframe:n.timeframe,timePeriod:n.addTimePeriod})),t(ve(e.entity,"TransactionDetail",{timeframe:n.timeframe,timePeriod:a}))}},onSaveUpdates:(n,a,s,c)=>{t(c===!0&&s!=null?Be(n,s,!0,e.isExpenseAutomationEnabled):jt({transactionId:n,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,cotTransactionTracking:a})),t(G("common"))},onUploadAttachmentAttachment:n=>{t(Xt(n))},onDeleteAttachment:n=>{e.transaction!=null&&t(zt(n,{id:e.transaction.id,type:e.transaction.type}))},onSaveTransactionDetailLocalData:(n,a)=>{t(Nt({transactionId:n,transactionLocalData:a}))},onUpdateAllChecked:(n,a,s,c)=>{e.transaction!=null&&t(Ot(e.selectedTransaction,e.transaction,n,a,s,c))},onResetLineItemsCategoryClassInLocalData:(n,a,s,c,d,y)=>{t(Bt(n,a,s,c,d,y))},onChangeCategoryClassWhenUpdateAllIsChecked:(n,a)=>{e.transaction!=null&&t(Vt({id:e.transaction.id,type:e.transaction.type},e.transaction,n,a))},onSaveSuccess:()=>{const n=ce(e.location.state?.pathnameStackToGoBack);if(n.poppedPathname!=null){const a=un(n.poppedPathname,"/").split("/"),s=a[a.length-1];if(["uncategorized-income","uncategorized-expense","missing-receipts"].includes(s)&&e.navigate(n.poppedPathname,{state:{pathnameStackToGoBack:n.newStack}}),e.location.state?.message==="comingFromScheduleDetails"){const c=`${rn(e.tenantEmailDomain)}`;e.navigate(c)}else if(e.location.state?.message==="comingFromScheduleDetailsFixedAssets"){const c=`${ln(e.tenantEmailDomain)}`;e.navigate(c)}}},onPageRefresh:()=>{t(Oe(e.selectedTransaction,!0))},autoCompleteActions:{onAutoCompleteInputChange:(n,a)=>{n.trim().length>=2?t(Lt({searchString:n,entityType:a,searchOrigin:"common"})):n.trim().length===0&&t(G("common"))},onCancelAutoComplete:()=>{t(G("common"))}},onFetchRecommendationsForEntity:(n,a,s,c)=>{t(J({entity:n,amount:a,transactionDetails:s,flowType:"detail",isBulkFetch:c,isFetchCOT:o}))},clearRecommendationForLineId:n=>{const{transactionId:a,transaction:s,lineId:c}=n;t(xt(a,s,c))},resetUpdateErrorState:()=>{const n={id:e.selectedTransaction.id,type:e.selectedTransaction.type};t(Ut(n))},onSaveVendorInLocalData:(n,a,s,c,d)=>{if(t(Ft({transactionId:n,vendorUpdates:a,entity:s})),a.id!=null&&s!=null&&c!=null&&d!=null&&t(J({entity:s,amount:c,transactionDetails:d,flowType:"detail",isFetchCOT:o})),t(Le({vendorId:a.id?a.id:void 0,localData:{vendorName:a.name,vendorId:a.id?a.id:void 0}})),!a.id&&e.transaction!=null){const y=e.transaction,h=ie(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(`/${e.tenantEmailDomain}/transaction/${encodeURIComponent(y.type??"")}/${y.id}/vendor/create`,{state:{pathnameStackToGoBack:h}})}},onSaveCustomerInLocalData:(n,a,s,c,d)=>{t(Pt({transactionId:n,customerUpdates:a,entity:s})),a.id!=null&&s!=null&&c!=null&&d!=null&&t(J({entity:s,amount:c,transactionDetails:d,flowType:"detail",isFetchCOT:o}))},onUpdateAllTranactionsWithCurrentVendorChecked:n=>{t(wt({transactionId:{id:e.selectedTransaction.id,type:e.selectedTransaction.type},isUpdateEnabled:n}))},onClickUpdateVendorToAllLineItems:(n,a,s)=>{t(_t(n,a,s))},onResetVendorToAllLineItems:(n,a,s)=>{t(Rt(n,a,s))},saveLatestSelectedEntity:(n,a,s)=>{t(At({transactionId:n,lineId:a,entity:s}))},updateVendorBulkRecommendationsFetchStatus:(n,a)=>{t(Ct(n,a))},setIsVendorUpdateAllChecked:(n,a,s)=>{t(Dt(n,a,s))},onCreateTransferEntry:e.isCreateTransferEntryFromExpenseEnabled===!0?n=>Tn(t,n):void 0,onLineAdd:()=>{if(e.transaction==null)return;const n={id:e.transaction.id,type:e.transaction.type},a=e.transaction.type==="journal_entry",s=e.transaction.amount?.currencyCode??"",c=e.transaction.amount?.currencySymbol??"",d=a?{amount:{amount:0,currencyCode:s,currencySymbol:c},id:crypto.randomUUID(),isCategoryMiscategorized:!1,isClassMiscategorized:!1,lineDescription:"",platformLineDetailType:"journal_entry_line_detail",type:"journal_entry_transaction_line",postingType:void 0,postingTypeName:"",lineTransactionType:"journal_entry"}:{amount:{amount:0,currencyCode:s,currencySymbol:c},id:crypto.randomUUID(),isCategoryMiscategorized:!1,isClassMiscategorized:!1,lineDescription:"",platformLineDetailType:"account_based_expense_line_detail",type:"transaction_with_account_and_class_line"};t(kt(n,d))},onLineDelete:n=>{if(e.transaction==null)return;const a={id:e.transaction.id,type:e.transaction.type};t(Et(a,n))},onToggleSplitEditMode:n=>{if(e.transaction==null)return;const a={id:e.transaction.id,type:e.transaction.type};t(vt(a,n))}}}))(en);function Nn(){const t=Ce(),e=j(),o=De(),{useFeatureGate:n}=Y(),a=Yt(),s=g((m=>Z(m))),c=s.userRole.includes("charge_card_user")||s.userRole.includes("charge_card_admin"),d=s.userRole!=null&&Re(s.userRole),y=s.userRole!=null&&_e(s.userRole),{isFeatureEnabled:h}=n(w.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:D}=n(w.isExpenseAutomationEnabled),{tenantEmailDomain:p,transactionTypeEncoded:l,transactionId:u}=Ae(),[S,v]=i.useState(!1),f=ze(l??""),T=Xe(u,f),k=g((m=>m.transactionVendorViewState)),C=pe(),{isFeatureEnabled:P}=n(w.isRecommendationFeedbackEnabled),A=Kt(),{onRecommendationSelection:F,popup:U}=fn({isEnabled:P,fallbackTransactionId:u}),V=i.useMemo((()=>({...A,onRecommendationSelection:F})),[A,F]),{isFeatureEnabled:x}=n(w.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:B}=n(w.isProjectsTransactionsEnabled),{isFeatureEnabled:O}=n(w.isTransactionSplitEnabled),M=a?.currentTenant?.companyId,q=a?.currentTenant?.companyName,N=cn(M),E=i.useMemo((()=>{if(T)return{id:u,type:W(f)}}),[T,u,f]),r=E!=null?g((m=>H(m,E))):void 0,I=r?.transactionDetailLocalData.vendorUpdates?.id!=null?k.editVendorStateById[r?.transactionDetailLocalData.vendorUpdates.id]?.saveStatus.fetchState:"Not-Started",b=r?.fetchState==="Completed"?Ge(r?.transaction):void 0,_=g((m=>b!=null?we(m.customerIncomeState,m.vendorExpenseState,m.trendState,b,"month"):void 0)),K=g((m=>le(m))),ee=g((m=>b!=null?Pe(m.trendWithTransactionsState,b,"TransactionDetail"):void 0)),te=s.company?.companyInfo.firstMonthOfFY??1,z=g((m=>Fe(m.accountState,m.accountListState,"accountList"))),[qe,fe]=i.useState(!1),[We,he]=i.useState(!1),[He,Se]=i.useState(!1),Ye=i.useCallback((m=>je(m,p??"")+o.search),[p,o.search]),Ke=i.useCallback((()=>{Se(!1)}),[]);bn({currentTransactionId:E,enabled:p!=null&&p!=="",buildPath:Ye,beforeNavigate:Ke,navigate:t,navigateState:o.state});const ye=()=>{fe(!1),he(!1)},Te=dn();mn();const ne=i.useRef(r?.transaction);ne.current=r?.transaction;const Je=r?.transactionDetailUpdateStatus?.fetchState,L=pn(Je,(()=>{const m=[];if(ne.current!=null)for(const ae of ne.current.lines??[])"account"in ae&&ae.account?.accountId!=null&&m.push(ae.account.accountId);return m}));i.useEffect((()=>{E!=null&&r!=null&&r.fetchState==="Not-Started"&&(e(Oe(E,!1)),ye())}),[e,E,r?.fetchState]),i.useEffect((()=>{if(E!=null&&r?.fetchState==="Error"){const m=ie(o.state?.pathnameStackToGoBack,o.pathname);t("page-not-found",{replace:!0,state:Te?{pathnameStackToGoBack:m,message:"expenseAutomation",origin:"transaction_categorization"}:{pathnameStackToGoBack:m,message:"pageNotFound",origin:"transaction_detail"}})}}),[E,r?.fetchState,t,o.state,o.pathname,Te]),i.useEffect((()=>{He||r==null||r.transaction==null||(e(Ue({id:r.transaction.id,type:r.transaction.type})),Se(!0));const m=o.state?.searchContext;b==null&&r?.fetchState==="Completed"&&ke(r?.transaction,m),b!=null&&(!c||d&&y===!1)&&(qe?We||_==null||(he(!0),e(me(b,"TransactionDetail",{timeframe:"month",timePeriod:ee?.selectedPeriod?.timePeriod??_}))):(e(de()),e(ue()),ke(r?.transaction,m),fe(!0),e(xe(b))))}),[r?.fetchState,r?.transaction,_,c]),i.useEffect((()=>{K.newVendorState?.vendorDetailLocalData?.vendorName!=null?v(!0):v(!1)}),[K.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect((()=>()=>{e(G("common"))}),[]);const Qe=[l,u].filter((m=>m!=null)),{transactionId:be,onSaveVendor:Ze,onSaveSuccess:et,onCancel:tt}=gn({closeDrawerHandler:m=>{v(!1),t(m?"../":"../..")}}),{isAiCfoAccessEnabled:nt,onAskAiCfoClick:at}=sn({mobileExploreReferrer:"Transaction Details"});return Jt({isDataReady:r?.fetchState==="Completed"}),T?R.jsxs(R.Fragment,{children:[be!=null&&S&&R.jsx(Sn,{isOpen:S,transactionId:be,onSaveVendor:Ze,onSaveSuccess:et,onCancel:tt}),R.jsx(Qt,{toolkit:V,children:R.jsx(In,{hideDeleteAttachment:!0,firstMonthOfFY:te,isDisabled:r?.transaction?.type==="transfer"&&a?.connectionName==="netsuite"?"readonly":void 0,tenantEmailDomain:p,location:o,navigate:t,selectedTransaction:E,entity:b,isCOTEnabled:C,defaultTrendTransactionTimePeriod:_,resetTrendIsFetchedStates:ye,transaction:r?.transaction,uncategorizedAccounts:z,vendorSaveStatus:I,isVendorBulkUpdateOnTransactionEnabled:h,isCreateTransferEntryFromExpenseEnabled:x,isExpenseAutomationEnabled:D,isAiCfoAccessEnabled:nt,onAskAiCfoClick:at,isProjectsTransactionsEnabled:B,isTransactionSplitEnabled:O,companyId:M,companyName:q,initialOpenThreadRequest:N})}),U,L.showPopup&&L.popupType!=null&&R.jsx(Zt,{popupType:L.popupType,currencySymbol:L.currencySymbol,accountId:L.popupAccountId??"",accountName:L.popupAccountName??"",onSubmit:L.handleSubmit,onDismiss:L.handleDismiss})]}):R.jsx(st,{to:$e(Qe.length)})}const $e=(t=2)=>{let e="../";for(let o=0;o<t;o++)e=`${e}../`;return e},ke=(t,e)=>{if(t!=null){const{transactionCategory:o,transactionClass:n}=vn(t),a=En(t);$.trackTransactionDetails(t.account?.accountId,t.account?.accountName,t.id,a,o.length>0?o:void 0,n.length>0?n:void 0,t.type,t.amount,t.memo,t.lines?.length??0,t.attachments?.map((s=>s.fileName)),e!=null?"Search":void 0,e?.searchTerm,e?.resultPosition,e?.resultsCount)}},vn=t=>{const e=[],o=[];return t.lines?.forEach((n=>{switch(n.type){case"transaction_with_account_and_class_line":case"transaction_with_product_or_service_line":case"journal_entry_transaction_line":case"linked_transaction_line":{const a=n;a!=null&&a.account!=null&&a.account.accountName?.length>0&&e.push(a.account.accountName),a.class!=null&&a.class.className?.length>0&&o.push(a.class.className);break}}})),{transactionCategory:e,transactionClass:o}},En=t=>Tt(t)===!0?t.customer?.name??"":bt(t)===!0?t.vendor?.name??"":t.memo!=null?t.memo:t.type;export{Sn as C,Nn as T,fn as a,mn as b,pn as c,gn as d,In as e,bn as f,pe as g,Tn as h,Bn as i,ke as l,Vn as r,On as u};
|
|
5
|
+
`;function Tn(t,e){t(ht({transactionId:e.transactionId,creditAccountIntegrationId:e.creditAccountIntegrationId,debitAccountIntegrationId:e.debitAccountIntegrationId,memo:e.memo,transactionType:q(e.transactionType),sourceTransactionType:q(e.sourceTransactionType)}))}function bn({currentTransactionId:t,enabled:e=!0,buildPath:o,beforeNavigate:n,navigate:a,navigateState:s}){const c=g((y=>y.createTransferEntryState.lastTransferEntryReplacement)),d=i.useRef(null);i.useEffect((()=>{if(!e||c==null||t==null||d.current===c)return;const{previousTransactionId:y,newTransactionId:h}=c;t.id===y.id&&t.type===y.type&&(d.current=c,n?.(),a(o(h),{replace:!0,state:s}))}),[e,c,t,o,n,a,s])}const gn=({closeDrawerHandler:t,overrideTransactionId:e,overrideTransactionType:o})=>{const n=De(),a=Ce(),s=j(),c=pe(),{transactionTypeEncoded:d,transactionId:y}=Ae(),h=e??y,D=o??ze(d??"");let p;Xe(h,D)&&(p={id:h,type:q(D)});const l=p!=null?g((S=>Y(S,p))):void 0,u=()=>{const S=ce(n.state?.pathnameStackToGoBack),v=S.poppedPathname??((f=2)=>{let T="../";for(let E=0;E<f;E++)T=`${T}../`;return T})(1);a(v,{state:{pathnameStackToGoBack:S.newStack}})};return{transactionId:p,onSaveVendor:()=>{s(Be(p,void 0))},onSaveSuccess:()=>{if(l!=null&&l?.transaction&&l?.transactionDetailLocalData.vendorUpdates?.qboId!=null&&l?.transactionDetailLocalData.vendorUpdates?.id!=null){const S=l?.transactionDetailLocalData.vendorUpdates,v={id:l?.transactionDetailLocalData.vendorUpdates?.qboId,zeniId:l?.transactionDetailLocalData.vendorUpdates?.id,type:"vendor",name:S?.name,qboId:l?.transactionDetailLocalData.vendorUpdates?.qboId??""},f={transactionId:{id:l?.transaction?.id,type:l?.transaction?.type},transaction:l?.transaction,lineIds:l?.transaction?.lines?.map((T=>T.id))??[]};s(Z({entity:v,amount:l?.transaction?.amount.amount,transactionDetails:f,flowType:"detail",isFetchCOT:c}))}u()},onCancel:()=>{p!=null&&s(St({transactionId:p})),s(Oe()),s(yt()),t(!0),u()}}},In=ct((function(t,e){const o=Y(t,e.selectedTransaction);let n;o==null&&console.warn("Check if the you've selected the transaction before getting the details");const a=Ne.getSignedInUser(),s=t.tenantState.currentTenantId,c={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:s??""};o!=null&&o.fetchState==="Completed"&&o.transaction!=null&&e.entity!=null&&(n=gt(t,e.entity,"TransactionDetail"));const d=t.entityAutoCompleteState.autoCompleteText.common,y=It(t,"common"),h=K(t);return{transactionDetail:o,transactionAttachmentEndpointToDownload:`${oe}/transaction_attachment`,transactionAttachmentsEndpointToFetch:h.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${oe}/transaction_attachments_accounting_provider`:`${oe}/transaction_attachments`,attachmentUploadEndpoint:`${tn.accountMicroServiceBaseUrl}`,isCOTEnabled:e.isCOTEnabled,authParams:c,trendReport:n,analytics:$,uncategorizedAccounts:e.uncategorizedAccounts,autoCompleteData:{autoCompleteText:d,entityAutoCompleteView:y},isVendorBulkUpdateOnTransactionEnabled:e.isVendorBulkUpdateOnTransactionEnabled,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,enableBackClickOnSave:e.location.state?.message?.startsWith("comingFromScheduleDetails"),isTransactionSplitEditMode:o?.transactionDetailLocalData?.editMode??!1}}),(function(t,e){const{isCOTEnabled:o}=e;return{onBackClick:()=>{if(t(M("common")),e.onBackClick!=null)return void e.onBackClick();const n=ce(e.location.state?.pathnameStackToGoBack),a=n.poppedPathname??$e(2);e.navigate(a,{state:{pathnameStackToGoBack:n.newStack,message:"comingFromTransactionDetail"}})},discardTransactionDetailLocalData:(n,a)=>{e.transaction!=null&&t(Gt({transactionId:{id:e.transaction.id,type:e.transaction.type},vendorId:n,customerId:a}))},onTransactionClick:n=>{e.resetTrendIsFetchedStates(),t(de()),t(ue());const a=ie(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(je(n,e.tenantEmailDomain),{state:{pathnameStackToGoBack:a}})},onTrendSelectedPeriodChange:n=>{if(n==null)e.defaultTrendTransactionTimePeriod!=null&&t(ve(e.entity,"TransactionDetail",{timeframe:"month",timePeriod:e.defaultTrendTransactionTimePeriod}));else{const a=n.currentTimePeriod==null?n.addTimePeriod:{startDate:n.addTimePeriod.startDate,endDate:n.currentTimePeriod.endDate};t(me(e.entity,"TransactionDetail",{timeframe:n.timeframe,timePeriod:n.addTimePeriod})),t(ve(e.entity,"TransactionDetail",{timeframe:n.timeframe,timePeriod:a}))}},onSaveUpdates:(n,a,s,c)=>{t(c===!0&&s!=null?Be(n,s,!0,e.isExpenseAutomationEnabled):jt({transactionId:n,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,cotTransactionTracking:a})),t(M("common"))},onUploadAttachmentAttachment:n=>{t(Xt(n))},onDeleteAttachment:n=>{e.transaction!=null&&t(zt(n,{id:e.transaction.id,type:e.transaction.type}))},onSaveTransactionDetailLocalData:(n,a)=>{t(Nt({transactionId:n,transactionLocalData:a}))},onUpdateAllChecked:(n,a,s,c)=>{e.transaction!=null&&t(Vt(e.selectedTransaction,e.transaction,n,a,s,c))},onResetLineItemsCategoryClassInLocalData:(n,a,s,c,d,y)=>{t(Bt(n,a,s,c,d,y))},onChangeCategoryClassWhenUpdateAllIsChecked:(n,a)=>{e.transaction!=null&&t(Ot({id:e.transaction.id,type:e.transaction.type},e.transaction,n,a))},onSaveSuccess:()=>{const n=ce(e.location.state?.pathnameStackToGoBack);if(n.poppedPathname!=null){const a=un(n.poppedPathname,"/").split("/"),s=a[a.length-1];if(["uncategorized-income","uncategorized-expense","missing-receipts"].includes(s)&&e.navigate(n.poppedPathname,{state:{pathnameStackToGoBack:n.newStack}}),e.location.state?.message==="comingFromScheduleDetails"){const c=`${rn(e.tenantEmailDomain)}`;e.navigate(c)}else if(e.location.state?.message==="comingFromScheduleDetailsFixedAssets"){const c=`${ln(e.tenantEmailDomain)}`;e.navigate(c)}}},onPageRefresh:()=>{t(Ve(e.selectedTransaction,!0))},autoCompleteActions:{onAutoCompleteInputChange:(n,a)=>{n.trim().length>=2?t(Lt({searchString:n,entityType:a,searchOrigin:"common"})):n.trim().length===0&&t(M("common"))},onCancelAutoComplete:()=>{t(M("common"))}},onFetchRecommendationsForEntity:(n,a,s,c)=>{t(Z({entity:n,amount:a,transactionDetails:s,flowType:"detail",isBulkFetch:c,isFetchCOT:o}))},clearRecommendationForLineId:n=>{const{transactionId:a,transaction:s,lineId:c}=n;t(xt(a,s,c))},resetUpdateErrorState:()=>{const n={id:e.selectedTransaction.id,type:e.selectedTransaction.type};t(Ut(n))},onSaveVendorInLocalData:(n,a,s,c,d)=>{if(t(Ft({transactionId:n,vendorUpdates:a,entity:s})),a.id!=null&&s!=null&&c!=null&&d!=null&&t(Z({entity:s,amount:c,transactionDetails:d,flowType:"detail",isFetchCOT:o})),t(Le({vendorId:a.id?a.id:void 0,localData:{vendorName:a.name,vendorId:a.id?a.id:void 0}})),!a.id&&e.transaction!=null){const y=e.transaction,h=ie(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(`/${e.tenantEmailDomain}/transaction/${encodeURIComponent(y.type??"")}/${y.id}/vendor/create`,{state:{pathnameStackToGoBack:h}})}},onSaveCustomerInLocalData:(n,a,s,c,d)=>{t(wt({transactionId:n,customerUpdates:a,entity:s})),a.id!=null&&s!=null&&c!=null&&d!=null&&t(Z({entity:s,amount:c,transactionDetails:d,flowType:"detail",isFetchCOT:o}))},onUpdateAllTranactionsWithCurrentVendorChecked:n=>{t(Pt({transactionId:{id:e.selectedTransaction.id,type:e.selectedTransaction.type},isUpdateEnabled:n}))},onClickUpdateVendorToAllLineItems:(n,a,s)=>{t(_t(n,a,s))},onResetVendorToAllLineItems:(n,a,s)=>{t(Rt(n,a,s))},saveLatestSelectedEntity:(n,a,s)=>{t(At({transactionId:n,lineId:a,entity:s}))},updateVendorBulkRecommendationsFetchStatus:(n,a)=>{t(Ct(n,a))},setIsVendorUpdateAllChecked:(n,a,s)=>{t(Dt(n,a,s))},onCreateTransferEntry:e.isCreateTransferEntryFromExpenseEnabled===!0?n=>Tn(t,n):void 0,onLineAdd:()=>{if(e.transaction==null)return;const n={id:e.transaction.id,type:e.transaction.type},a=e.transaction.type==="journal_entry",s=e.transaction.amount?.currencyCode??"",c=e.transaction.amount?.currencySymbol??"",d=a?{amount:{amount:0,currencyCode:s,currencySymbol:c},id:crypto.randomUUID(),isCategoryMiscategorized:!1,isClassMiscategorized:!1,lineDescription:"",platformLineDetailType:"journal_entry_line_detail",type:"journal_entry_transaction_line",postingType:void 0,postingTypeName:"",lineTransactionType:"journal_entry"}:{amount:{amount:0,currencyCode:s,currencySymbol:c},id:crypto.randomUUID(),isCategoryMiscategorized:!1,isClassMiscategorized:!1,lineDescription:"",platformLineDetailType:"account_based_expense_line_detail",type:"transaction_with_account_and_class_line"};t(Et(n,d))},onLineDelete:n=>{if(e.transaction==null)return;const a={id:e.transaction.id,type:e.transaction.type};t(kt(a,n))},onToggleSplitEditMode:n=>{if(e.transaction==null)return;const a={id:e.transaction.id,type:e.transaction.type};t(vt(a,n))}}}))(en);function Nn(){const t=Ce(),e=j(),o=De(),{useFeatureGate:n}=H(),a=Ht(),s=g((m=>K(m))),c=s.userRole.includes("charge_card_user")||s.userRole.includes("charge_card_admin"),d=s.userRole!=null&&Re(s.userRole),y=s.userRole!=null&&_e(s.userRole),{isFeatureEnabled:h}=n(P.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:D}=n(P.isExpenseAutomationEnabled),{tenantEmailDomain:p,transactionTypeEncoded:l,transactionId:u}=Ae(),[S,v]=i.useState(!1),f=ze(l??""),T=Xe(u,f),E=g((m=>m.transactionVendorViewState)),C=pe(),{isFeatureEnabled:w}=n(P.isRecommendationFeedbackEnabled),A=Qt(),{onRecommendationSelection:F,popup:U}=fn({isEnabled:w,fallbackTransactionId:u}),O=i.useMemo((()=>({...A,onRecommendationSelection:F})),[A,F]),{isFeatureEnabled:x}=n(P.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:B}=n(P.isProjectsTransactionsEnabled),{isFeatureEnabled:V}=n(P.isTransactionSplitEnabled),G=a?.currentTenant?.companyId,W=a?.currentTenant?.companyName,N=cn(G),k=i.useMemo((()=>{if(T)return{id:u,type:q(f)}}),[T,u,f]),r=k!=null?g((m=>Y(m,k))):void 0,I=r?.transactionDetailLocalData.vendorUpdates?.id!=null?E.editVendorStateById[r?.transactionDetailLocalData.vendorUpdates.id]?.saveStatus.fetchState:"Not-Started",b=r?.fetchState==="Completed"?Me(r?.transaction):void 0,_=g((m=>b!=null?Pe(m.customerIncomeState,m.vendorExpenseState,m.trendState,b,"month"):void 0)),Q=g((m=>le(m))),ee=g((m=>b!=null?we(m.trendWithTransactionsState,b,"TransactionDetail"):void 0)),te=s.company?.companyInfo.firstMonthOfFY??1,z=g((m=>Fe(m.accountState,m.accountListState,"accountList"))),[We,fe]=i.useState(!1),[qe,he]=i.useState(!1),[Ye,Se]=i.useState(!1),He=i.useCallback((m=>je(m,p??"")+o.search),[p,o.search]),Qe=i.useCallback((()=>{Se(!1)}),[]);bn({currentTransactionId:k,enabled:p!=null&&p!=="",buildPath:He,beforeNavigate:Qe,navigate:t,navigateState:o.state});const ye=()=>{fe(!1),he(!1)},Te=dn();mn();const ne=i.useRef(r?.transaction);ne.current=r?.transaction;const Ze=r?.transactionDetailUpdateStatus?.fetchState,L=pn(Ze,(()=>{const m=[];if(ne.current!=null)for(const ae of ne.current.lines??[])"account"in ae&&ae.account?.accountId!=null&&m.push(ae.account.accountId);return m}));i.useEffect((()=>{k!=null&&r!=null&&r.fetchState==="Not-Started"&&(e(Ve(k,!1)),ye())}),[e,k,r?.fetchState]),i.useEffect((()=>{if(k!=null&&r?.fetchState==="Error"){const m=ie(o.state?.pathnameStackToGoBack,o.pathname);t("page-not-found",{replace:!0,state:Te?{pathnameStackToGoBack:m,message:"expenseAutomation",origin:"transaction_categorization"}:{pathnameStackToGoBack:m,message:"pageNotFound",origin:"transaction_detail"}})}}),[k,r?.fetchState,t,o.state,o.pathname,Te]),i.useEffect((()=>{Ye||r==null||r.transaction==null||(e(Ue({id:r.transaction.id,type:r.transaction.type})),Se(!0));const m=o.state?.searchContext;b==null&&r?.fetchState==="Completed"&&Ee(r?.transaction,m),b!=null&&(!c||d&&y===!1)&&(We?qe||_==null||(he(!0),e(me(b,"TransactionDetail",{timeframe:"month",timePeriod:ee?.selectedPeriod?.timePeriod??_}))):(e(de()),e(ue()),Ee(r?.transaction,m),fe(!0),e(xe(b))))}),[r?.fetchState,r?.transaction,_,c]),i.useEffect((()=>{Q.newVendorState?.vendorDetailLocalData?.vendorName!=null?v(!0):v(!1)}),[Q.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect((()=>()=>{e(M("common"))}),[]);const Je=[l,u].filter((m=>m!=null)),{transactionId:be,onSaveVendor:Ke,onSaveSuccess:et,onCancel:tt}=gn({closeDrawerHandler:m=>{v(!1),t(m?"../":"../..")}}),{isAiCfoAccessEnabled:nt,onAskAiCfoClick:at}=sn({mobileExploreReferrer:"Transaction Details"});return Zt({isDataReady:r?.fetchState==="Completed"}),T?R.jsxs(R.Fragment,{children:[be!=null&&S&&R.jsx(Sn,{isOpen:S,transactionId:be,onSaveVendor:Ke,onSaveSuccess:et,onCancel:tt}),R.jsx(Jt,{toolkit:O,children:R.jsx(In,{hideDeleteAttachment:!0,firstMonthOfFY:te,isDisabled:r?.transaction?.type==="transfer"&&a?.connectionName==="netsuite"?"readonly":void 0,tenantEmailDomain:p,location:o,navigate:t,selectedTransaction:k,entity:b,isCOTEnabled:C,defaultTrendTransactionTimePeriod:_,resetTrendIsFetchedStates:ye,transaction:r?.transaction,uncategorizedAccounts:z,vendorSaveStatus:I,isVendorBulkUpdateOnTransactionEnabled:h,isCreateTransferEntryFromExpenseEnabled:x,isExpenseAutomationEnabled:D,isAiCfoAccessEnabled:nt,onAskAiCfoClick:at,isProjectsTransactionsEnabled:B,isTransactionSplitEnabled:V,companyId:G,companyName:W,initialOpenThreadRequest:N})}),U,L.showPopup&&L.popupType!=null&&R.jsx(Kt,{popupType:L.popupType,currencySymbol:L.currencySymbol,accountId:L.popupAccountId??"",accountName:L.popupAccountName??"",onSubmit:L.handleSubmit,onDismiss:L.handleDismiss})]}):R.jsx(st,{to:$e(Je.length)})}const $e=(t=2)=>{let e="../";for(let o=0;o<t;o++)e=`${e}../`;return e},Ee=(t,e)=>{if(t!=null){const{transactionCategory:o,transactionClass:n}=vn(t),a=kn(t);$.trackTransactionDetails(t.account?.accountId,t.account?.accountName,t.id,a,o.length>0?o:void 0,n.length>0?n:void 0,t.type,t.amount,t.memo,t.lines?.length??0,t.attachments?.map((s=>s.fileName)),e!=null?"Search":void 0,e?.searchTerm,e?.resultPosition,e?.resultsCount)}},vn=t=>{const e=[],o=[];return t.lines?.forEach((n=>{switch(n.type){case"transaction_with_account_and_class_line":case"transaction_with_product_or_service_line":case"journal_entry_transaction_line":case"linked_transaction_line":{const a=n;a!=null&&a.account!=null&&a.account.accountName?.length>0&&e.push(a.account.accountName),a.class!=null&&a.class.className?.length>0&&o.push(a.class.className);break}}})),{transactionCategory:e,transactionClass:o}},kn=t=>Tt(t)===!0?t.customer?.name??"":bt(t)===!0?t.vendor?.name??"":t.memo!=null?t.memo:t.type;export{Sn as C,Nn as T,fn as a,mn as b,pn as c,gn as d,In as e,bn as f,pe as g,Tn as h,Bn as i,Ee as l,On as r,Vn as u};
|