@zeniai/web-app-ui 5.3.92-dev → 5.3.93-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/dist/assets/{AccountMappingScreen-Bh9jl7Ef.js → AccountMappingScreen-BTR8uKQK.js} +2 -2
  2. package/dist/assets/{ActualMatchingMatchDetailScreen-DjOPlh3J.js → ActualMatchingMatchDetailScreen-DpaCOnCM.js} +1 -1
  3. package/dist/assets/AddressRoutes-GFLqbgTr.js +1 -0
  4. package/dist/assets/AddressScreen-DWZzKMEw.js +9 -0
  5. package/dist/assets/AiCfoScreen-Dd__YIWm.js +22 -0
  6. package/dist/assets/{AppDrawer-BQB31RFD.js → AppDrawer-D2Tl26uq.js} +1 -1
  7. package/dist/assets/{BillPayApprovalRoutes-C0zm6ZLS.js → BillPayApprovalRoutes-DV_p_SQ2.js} +1 -1
  8. package/dist/assets/{BillPayRoutes-kQgV7FX8.js → BillPayRoutes-sNvDS-kN.js} +6 -6
  9. package/dist/assets/{BusinessVerificationPageScreen-BSguq-g2.js → BusinessVerificationPageScreen-CVijkaE8.js} +2 -2
  10. package/dist/assets/{CardsAiCfoScreen-nH8-GKOx.js → CardsAiCfoScreen-DO_HCVwI.js} +1 -1
  11. package/dist/assets/{ChargeCardRoutes-C_cRa3L-.js → ChargeCardRoutes-mt2g3Jg0.js} +1 -1
  12. package/dist/assets/CompanyPassportScreen-_f68duti.js +1 -0
  13. package/dist/assets/{ConnectionAuthScreen-ByV6yTTU.js → ConnectionAuthScreen-oPVi82Cx.js} +2 -2
  14. package/dist/assets/CustomerOnboardingAuthScreen-C3FMpb4J.js +1 -0
  15. package/dist/assets/{CustomerOnboardingRoutes-BUkw8ab2.js → CustomerOnboardingRoutes-BLRE7IK-.js} +3 -3
  16. package/dist/assets/{DashboardRoutes-DEx1rH65.js → DashboardRoutes-mQvE4jJ0.js} +3 -3
  17. package/dist/assets/{DefaultTenantHome-BPLwTBZP.js → DefaultTenantHome-Dh5bAcpG.js} +1 -1
  18. package/dist/assets/DomesticWireDetailScreen-pkS3AD2d.js +18 -0
  19. package/dist/assets/{DrawerScreen-Du8hsTKk.js → DrawerScreen-DI4gxsFO.js} +1 -1
  20. package/dist/assets/EntityDetailRoutes-BH8_jvsw.js +1 -0
  21. package/dist/assets/{ExpenseAutomationRoutes-DXUAGmqA.js → ExpenseAutomationRoutes-_6qCRlW0.js} +7 -7
  22. package/dist/assets/FeaturePreviewScreen-kue3YUvW.js +1 -0
  23. package/dist/assets/{HubSpotOAuthCallbackScreen-BkrFKuyY.js → HubSpotOAuthCallbackScreen-D64pI0iU.js} +1 -1
  24. package/dist/assets/{InboxNotificationsProvider-B5M0qdMl.js → InboxNotificationsProvider-DrljtAmN.js} +1 -1
  25. package/dist/assets/{InvoicingRoutes-DJ09h0-W.js → InvoicingRoutes-D6QJ-LnU.js} +1 -1
  26. package/dist/assets/{MagicLinkRoutes-BTzEpPhB.js → MagicLinkRoutes-DFwRCGOM.js} +20 -20
  27. package/dist/assets/MagicLinkSignInScreen-DaNmJtKR.js +12 -0
  28. package/dist/assets/MobileAppDrawer-D9iwyW6E.js +1 -0
  29. package/dist/assets/NotFoundScreen-DHpPkJUq.js +1 -0
  30. package/dist/assets/{NotificationRoutes-BxisUoq4.js → NotificationRoutes-CNN0JO68.js} +1 -1
  31. package/dist/assets/{OAuthConsentScreen-DVdmzuPK.js → OAuthConsentScreen-CMQBCmUq.js} +1 -1
  32. package/dist/assets/{PandLWithForecastRoutes-Deg1E66Q.js → PandLWithForecastRoutes-BhMRDGc1.js} +1 -1
  33. package/dist/assets/{PaymentLinkScreen-C9O2KV8I.js → PaymentLinkScreen-DstzeuhJ.js} +9 -9
  34. package/dist/assets/{PeopleRoutes-DiFR5w2N.js → PeopleRoutes-6Eq28etR.js} +9 -9
  35. package/dist/assets/{PerformanceRoutes-QyQRVdnM.js → PerformanceRoutes-DkxGB8dS.js} +1 -1
  36. package/dist/assets/{Preview-DUYMZtKt.js → Preview-Dfugi26f.js} +1 -1
  37. package/dist/assets/{QBOConnectionScreen--OQu_pq8.js → QBOConnectionScreen-DNwlxY3R.js} +1 -1
  38. package/dist/assets/ReimbursementApprovalRoutes-CzKIB6lB.js +1 -0
  39. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-BJcgs97q.js → ReimbursementApprovalRuleDetailScreen-C0oxxTC0.js} +1 -1
  40. package/dist/assets/{ReimbursementRoutes-BAWywZO-.js → ReimbursementRoutes-C2uBm8Jr.js} +7 -7
  41. package/dist/assets/{ReportsRoutes-DFArxL2E.js → ReportsRoutes-CmRsRF1m.js} +1 -1
  42. package/dist/assets/RewardsRoutes-cYws_8FH.js +1 -0
  43. package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-D_ls3-hC.js → ScheduleDetailsPrepaidExpensesScreen-DKDzHrf0.js} +5 -5
  44. package/dist/assets/ScreenRoutes-Cd2fvUao.js +2 -0
  45. package/dist/assets/{SettingsRoutes-BbvIIMXV.js → SettingsRoutes-DBJKrFxG.js} +6 -6
  46. package/dist/assets/{SetupPagesScreen-RWtDE1DO.js → SetupPagesScreen-C70xRnVo.js} +1 -1
  47. package/dist/assets/SignInScreen-DB64sQry.js +1 -0
  48. package/dist/assets/SignOutScreen-RkBhfYpP.js +9 -0
  49. package/dist/assets/TaskListScreen-DW7e6ef_.js +9 -0
  50. package/dist/assets/{TaskRoutes-CjSgWf1E.js → TaskRoutes-BRKcMi_T.js} +2 -2
  51. package/dist/assets/TransactionDetailRoutes-BFBaFYFk.js +1 -0
  52. package/dist/assets/{TransactionDetailScreen-DGElbhCa.js → TransactionDetailScreen-DPKP2gGJ.js} +2 -2
  53. package/dist/assets/{TransactionListRoutes-Db86k9iu.js → TransactionListRoutes-CDs1-rA6.js} +1 -1
  54. package/dist/assets/{TreasuryRoutes-DxWgKInd.js → TreasuryRoutes-BbsVM2lE.js} +1 -1
  55. package/dist/assets/{VendorsRoutes-DHlhSQpH.js → VendorsRoutes-B18gUSfI.js} +1 -1
  56. package/dist/assets/{WiseConfirmationScreen-CMvlKiZq.js → WiseConfirmationScreen-CMKnfyei.js} +1 -1
  57. package/dist/assets/{ZeniAccountRoutes-BMjC17N2.js → ZeniAccountRoutes-CWU7HNHh.js} +9 -9
  58. package/dist/assets/{ZeniAccountStatementScreen-BAIxCUhh.js → ZeniAccountStatementScreen-BcWZ9nqz.js} +1 -1
  59. package/dist/assets/{accountMappingHelper-CDFl9gNv.js → accountMappingHelper-PEq3iFwb.js} +1 -1
  60. package/dist/assets/{analytics-K5kCmXhx.js → analytics-wUVBNE2n.js} +1 -1
  61. package/dist/assets/{analyticsHelper-Cb3EUyBw.js → analyticsHelper-C8wUoU5C.js} +1 -1
  62. package/dist/assets/{core-CJLU9TYG.js → core-DtSa7_zJ.js} +1 -1
  63. package/dist/assets/{decodeURIComponentSafe-Cai8T7ud.js → decodeURIComponentSafe-CxfS79yY.js} +1 -1
  64. package/dist/assets/{dnd-BvQSnOXX.js → dnd-BRHUZ8LO.js} +1 -1
  65. package/dist/assets/{empty-CYTi1vUC.js → empty--RCTsu0x.js} +1 -1
  66. package/dist/assets/{empty-cTsBa_MX.js → empty-TXY6nS9o.js} +1 -1
  67. package/dist/assets/{emptyVideoElement-CkuydE4W.js → emptyVideoElement-jsNpgByF.js} +1 -1
  68. package/dist/assets/{epic-B7sSwFQr.js → epic-NcSj2eco.js} +1 -1
  69. package/dist/assets/{expenseAutomationHelper-AFTT-GAh.js → expenseAutomationHelper-BUiYzGxA.js} +1 -1
  70. package/dist/assets/{getLocaleForTenant-Bc7hFfBK.js → getLocaleForTenant-D03DEBIE.js} +1 -1
  71. package/dist/assets/{index-BcoLz164.js → index-BfiunY7r.js} +1 -1
  72. package/dist/assets/{index-DSH2m0Ax.js → index-Bfr7Ew4h.js} +1 -1
  73. package/dist/assets/{index-BTdRxzeE.js → index-BgQKS1TL.js} +1 -1
  74. package/dist/assets/{index-C6CmvTKV.js → index-CABDWa_r.js} +2 -2
  75. package/dist/assets/{index-Bac0_7La.js → index-CJhgQFRI.js} +13423 -13425
  76. package/dist/assets/{index-BjN-UlqP.js → index-CeI_n1Jv.js} +1 -1
  77. package/dist/assets/{index-C5DdgWE0.js → index-Cz1UMaoE.js} +1 -1
  78. package/dist/assets/{index-DqcV3YMG.js → index-DxlUZLeR.js} +1 -1
  79. package/dist/assets/{lexical-G-6YJUO1.js → lexical-CV0PpHfb.js} +1 -1
  80. package/dist/assets/{liveblocks-D0aPwrEa.js → liveblocks-CZZ7TQJf.js} +1 -1
  81. package/dist/assets/{lottie-CRpndHoM.js → lottie-_8fQYf62.js} +1 -1
  82. package/dist/assets/{mui-BTK8WNHw.js → mui-hHF2bYsV.js} +1 -1
  83. package/dist/assets/{pathToGoBack-DSav9J7K.js → pathToGoBack-sBV6PqT4.js} +1 -1
  84. package/dist/assets/{pdf-BlY1D9V4.js → pdf-DcTPEGUQ.js} +3 -3
  85. package/dist/assets/{pdf-lib-DubKZfxI.js → pdf-lib-DvlP1tZv.js} +1 -1
  86. package/dist/assets/{plaid-BWaZTH4h.js → plaid-l93gkere.js} +1 -1
  87. package/dist/assets/{pusher-NgljFe4c.js → pusher-Chl1DxG2.js} +1 -1
  88. package/dist/assets/{react-BdvVU4nA.js → react-B6u5wAGC.js} +1 -1
  89. package/dist/assets/{react-CXfU0Dfi.js → react-BPJWvFAw.js} +1 -1
  90. package/dist/assets/{react-Cd_9VlyA.js → react-BXuuk3m7.js} +1 -1
  91. package/dist/assets/{react-CJTAFFom.js → react-Ct10qt1E.js} +1 -1
  92. package/dist/assets/{react-XHCeVOeB.js → react-DvOc8dL3.js} +1 -1
  93. package/dist/assets/{react-BlKvPBUN.js → react-UkV3Bwgo.js} +1 -1
  94. package/dist/assets/{recharts-BEqM6zw3.js → recharts-DHYb1iJa.js} +1 -1
  95. package/dist/assets/{routePaths-CFVcdQVU.js → routePaths-66PPW-xS.js} +1 -1
  96. package/dist/assets/{sentry-Bh_Qiwsv.js → sentry-7oL5NFUY.js} +1 -1
  97. package/dist/assets/{stripSplatSuffix-Ba8pyF0x.js → stripSplatSuffix-Cj4hZLSk.js} +1 -1
  98. package/dist/assets/{url-YPAxZIuQ.js → url-AXfPza2U.js} +1 -1
  99. package/dist/assets/{url-CqXRBT9H.js → url-yW-1Hcty.js} +1 -1
  100. package/dist/assets/{useActualMatchingMatchDetail-Bo3l1zUQ.js → useActualMatchingMatchDetail-Bv7_wq27.js} +1 -1
  101. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-BqbEtXbA.js → useAiCfoDashboardSuggestedQuestionsChips-B0543FEo.js} +1 -1
  102. package/dist/assets/useAskAiCfoHostNavButtonProps-C0sjuZuZ.js +1 -0
  103. package/dist/assets/{useChargeCardPusherEvents-IP7jEgbI.js → useChargeCardPusherEvents-DLwmfLZC.js} +1 -1
  104. package/dist/assets/{useDeviceId-BqYCCa6B.js → useDeviceId-DpOlnzI_.js} +1 -1
  105. package/dist/assets/{useEmailConnectResultRefresh-B2CM-p2n.js → useEmailConnectResultRefresh-DWBnl6oa.js} +1 -1
  106. package/dist/assets/{useInitialThreadRequest-Byaj949Q.js → useInitialThreadRequest-Cf6qZ2C0.js} +1 -1
  107. package/dist/assets/useTaskManagerAccess-zRd8th0q.js +1 -0
  108. package/dist/assets/{useTaskManagerPusherEvents-xfS6T84X.js → useTaskManagerPusherEvents-CtTv0DPD.js} +1 -1
  109. package/dist/assets/{utils-DnIJUuGb.js → utils-D3PNq8pk.js} +1 -1
  110. package/dist/assets/{withTransactionSidePanel-BOFkm0Uk.js → withTransactionSidePanel-DVXJCqK3.js} +1 -1
  111. package/dist/assets/{zeni-epic-state-DN1FMHPE.js → zeni-epic-state-DIQk-W8f.js} +3 -3
  112. package/dist/index.html +1 -1
  113. package/package.json +2 -2
  114. package/dist/assets/AddressRoutes-DiDhvZrH.js +0 -1
  115. package/dist/assets/AddressScreen-Djrv0IMM.js +0 -9
  116. package/dist/assets/AiCfoScreen-B4bDfb8M.js +0 -22
  117. package/dist/assets/CompanyPassportScreen-CMKrSOCe.js +0 -1
  118. package/dist/assets/CustomerOnboardingAuthScreen-Dr98fTM4.js +0 -1
  119. package/dist/assets/DomesticWireDetailScreen-CIlj8F4w.js +0 -18
  120. package/dist/assets/EntityDetailRoutes-BLSf8EBB.js +0 -1
  121. package/dist/assets/FeaturePreviewScreen-ae3ytT_c.js +0 -1
  122. package/dist/assets/MagicLinkSignInScreen-CyF3xUpa.js +0 -12
  123. package/dist/assets/MobileAppDrawer-Gq4sfjI3.js +0 -1
  124. package/dist/assets/NotFoundScreen-DVwEy2Nc.js +0 -1
  125. package/dist/assets/ReimbursementApprovalRoutes-Bu6Pn9AT.js +0 -1
  126. package/dist/assets/RewardsRoutes-CMb9MJ3w.js +0 -1
  127. package/dist/assets/ScreenRoutes-CjbhngRf.js +0 -2
  128. package/dist/assets/SignInScreen-5nP2m4Sd.js +0 -1
  129. package/dist/assets/SignOutScreen-C6DXPIPI.js +0 -9
  130. package/dist/assets/TaskListScreen-CLnMNKvr.js +0 -9
  131. package/dist/assets/TransactionDetailRoutes-CEyEoaOq.js +0 -1
  132. package/dist/assets/useAskAiCfoHostNavButtonProps-CkY97uj-.js +0 -1
  133. package/dist/assets/useTaskManagerAccess-CUawSS4F.js +0 -1
@@ -1,4 +1,4 @@
1
- import{j as r}from"./liveblocks-D0aPwrEa.js";import fe from"./NotFoundScreen-DVwEy2Nc.js";import{a as u}from"./sentry-Bh_Qiwsv.js";import{h as ee,u as ae,j as g,g as ge,i as he,N as Ee,l as be,n as De,o as h}from"./core-CJLU9TYG.js";import{Qq as se,Qt as Ie,Qn as Ce,a2y as _e,fI as te,a2z as ne,QU as b,QH as E,Qk as ye,Rn as Ae,Rg as Re,a2A as oe,gk as ie,a2B as H,a2C as Ue,Qg as Ge,Qd as ve,v2 as Be,uS as we,mD as xe,QF as je,a2D as Pe,Rz as Fe,QB as Le,R2 as Ke,Q$ as Qe,Qw as $e,QY as Ne,QR as Ze}from"./zeni-epic-state-DN1FMHPE.js";import{z as D,e1 as ze,Z as Oe,W as Ve,A as y,a2 as re,p as A,a6 as qe,j as J,N as Me,e2 as Ye,U as W,ac as He}from"./index-Bac0_7La.js";import{n as Je}from"./mui-BTK8WNHw.js";import{u as We}from"./useInitialThreadRequest-Byaj949Q.js";import{M as Xe}from"./MobileAppDrawer-Gq4sfjI3.js";import{T as m,t as ea,b as aa,a as sa,c as ta,d as X,e as na}from"./TaskListScreen-CLnMNKvr.js";import{u as oa}from"./useTaskManagerPusherEvents-xfS6T84X.js";import"./recharts-BEqM6zw3.js";import"./analytics-K5kCmXhx.js";import"./plaid-BWaZTH4h.js";import"./dnd-BvQSnOXX.js";import"./stripe-cKAAJElX.js";import"./lottie-CRpndHoM.js";import"./lexical-G-6YJUO1.js";import"./pdf-BlY1D9V4.js";import"./utils-DnIJUuGb.js";import"./InboxNotificationsProvider-B5M0qdMl.js";import"./useTaskManagerAccess-CUawSS4F.js";import"./useAskAiCfoHostNavButtonProps-CkY97uj-.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]="85617943-a234-4d08-acbc-20155a8b1a74",e._sentryDebugIdIdentifier="sentry-dbid-85617943-a234-4d08-acbc-20155a8b1a74")}catch{}})();function ia(){const e=ee(),a=ae(),n=D.getSignedInUser(),{cannedResponses:c,fetchState:t,saveFetchState:l}=g((i=>i.cannedResponsesState)),d=u.useCallback((()=>{a(se())}),[a]),S=u.useCallback(((i,I,C)=>{a(Ie({name:i,content:I,cannedResponseId:C}))}),[a]),s=u.useCallback((i=>{a(Ce({cannedResponseId:i}))}),[a]);if(n==null)throw Error("Can't access quick responses page without signing in...");return r.jsx(ze,{cannedResponses:c,isLoading:t==="In-Progress"||t==="Not-Started",isSaving:l==="In-Progress",onBackClick:()=>e(-1),onDelete:s,onFetch:d,onSave:S})}const K=e=>e?.taskState?.taskByID,F=(e,a)=>{const n=K(e);if(a!=null&&n!=null)return n[a]?.parentTaskId??void 0},ra=_e([F,(e,a)=>{const n=F(e,a),c=K(e);if(n!=null&&c!=null)return c[n]?.name},(e,a)=>{const n=F(e,a),c=K(e);return n!=null&&c!=null&&c[n]!=null}],((e,a,n)=>{if(e!=null&&n===!0)return{id:e,name:a??""}})),ca=be((function(e,a){const{location:n,taskGroupId:c}=a,t=oe(e,a.taskId),l=te(e),d=ra(e,a.taskId),S=t.taskGroupId??c,s=S!=null?H(e.taskGroupState,S):void 0,i=D.getSignedInUser(),I=l.tenantId,C={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:I??""},v=ne(e),{tenantEmailDomain:B}=l,R=t.recurringSourceTaskId,w=R!=null?`${W.appUrl}/${B}/tasks/${encodeURIComponent(R)}`:void 0;return{taskDetailSelectorView:t,authParams:C,isZeniUser:D.isZeniUser(),userGroupList:Ue(e),isNewClicked:n.state?.message==="comingFromTaskListPage",filesEndPoint:He.fileMicroServiceBaseUrl,companyName:a.currentTenant.companyName,companyId:a.currentTenant.companyId,currentUrl:`${W.appUrl}${a.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:w,tagListView:v,taskGroupName:S!=null&&s!=null&&s.isDefault===!1?s.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map((T=>H(e.taskGroupState,T))).filter((T=>T!=null&&!T.isDeleted)).map((T=>({id:T.id,name:T.name,isDefault:T.isDefault}))),subtasks:t.subtasks,parentTaskRef:d,subTaskCreateStatus:e.taskDetailState?.subTaskCreateStatus?.fetchState}}),(function(e,a){const{taskId:n,navigate:c,currentTenant:t,location:l,taskGroupId:d}=a,{tenantEmailDomain:S}=t;return{onSaveChangesToLocalStore:s=>{e(Ze({taskDetailLocalData:s,taskId:n}))},onSaveDetailClick:s=>{e(Ne(n,s??d))},onArchiveTaskClick:()=>{a.taskId!=null&&e($e(a.taskId))},onSnoozeTask:(s,i)=>{e(Qe(s,i))},onUnsnoozeTask:s=>{e(Ke(s))},onCreateSubtask:(s,i)=>{e(Le({...i,parentTaskId:s}))},onSubtaskUpdate:(s,i)=>{e(Fe({task:s,updates:i}))},onShowToast:s=>{e(ie(s))},onSubtaskRowClick:s=>{c(`/${S}/tasks/${s}`,{state:{pathnameStackToGoBack:A(l.state?.pathnameStackToGoBack,l.pathname)}})},onParentBreadcrumbClick:s=>{c(`/${S}/tasks/${s}`,{state:{pathnameStackToGoBack:A(l.state?.pathnameStackToGoBack,l.pathname)}})},onDismissClick:()=>{if(l.state?.message==="triggerBackClick"){const s=re(l.state?.pathnameStackToGoBack),i=s.poppedPathname??"../../dashboard";c(i,{state:{pathnameStackToGoBack:s.newStack}})}else{const s=G(S),i=A(l.state?.pathnameStackToGoBack,l.pathname);c(s,{state:{pathnameStackToGoBack:i}})}e(Pe({taskId:n}))},onDeleteTaskClick:()=>{e(je(n))},updateFilesEntity:s=>{e(xe({files:s}))},onDeleteFile:s=>{e(we(s))},onEditFileName:(s,i)=>{e(Be(s,i.split(".")[0]))},onReloadTaskDetailPage:()=>{e(b(!1,n))},onCreateTagClick:s=>{e(ve(s,n))},onDeleteTagClick:s=>{e(Ge(s,n))},onFetchCannedResponses:()=>{e(se())},onManageTemplatesClick:()=>{c(`/${t.tenantEmailDomain}/tasks/quick-responses`)}}}))(Ye);function L(){const e=ee(),a=ae(),n=ge(),c=Oe(),{taskId:t,taskGroupId:l}=he(),d=g((o=>te(o))),S=We(d?.companyId),{useFeatureGate:s}=Ve(),{isFeatureEnabled:i}=s(y.isTaskSnoozeEnabled),{isFeatureEnabled:I}=s(y.isTaskVisibilityEnabled),{isFeatureEnabled:C}=s(y.isTaskCannedResponsesEnabled),{isFeatureEnabled:v}=s(y.isTaskRecurringParentEnabled),{isFeatureEnabled:B}=s(y.isTaskGroupAssigneesEnabled),[R,w]=u.useState(!1),[T,ce]=u.useState(!1),[Q,le]=u.useState(!1),[$,x]=u.useState(!1),_=u.useRef(!1),U=g((o=>o.taskListState.updateTasksFetchState.fetchState)),N=g((o=>ne(o))),Z=g((o=>o.taskGroupViewState.fetchState));u.useEffect((()=>{a(b(!1,t)),t!=null&&a(E(t))}),[a,t]);const z=D.getSignedInUser()?.userId,de=D.isZeniUser(),ke=g((o=>t!=null?o.taskState.taskByID[t]?.syncToken:void 0)),O=()=>{d?.tenantEmailDomain!=null&&e(G(d.tenantEmailDomain))},V=()=>{a(ie({messageSection:"delete_task",messageText:"success",type:"success"})),O()},ue=u.useMemo((()=>{const o=[m.TASK_CREATED,m.TASK_UPDATED,m.TASKS_BULK_UPDATED,m.TASKS_BULK_DELETED],k=[...o,m.TASK_SNOOZE_RESURFACED];return[...aa(d?.companyId,o),...sa(z,k)]}),[d?.companyId,z]);oa({events:ue,onSubscribed:()=>{t!=null&&(a(b(!0,t)),a(E(t)))},onEvent:(o,k)=>{if(t!=null)switch(o){case m.TASK_CREATED:case m.TASK_UPDATED:{const p=((P,me,{isZeniUser:Se,storedSyncToken:Te,taskId:Y})=>{if(P!==m.TASK_CREATED&&P!==m.TASK_UPDATED)return"none";const f=ea(me);return f==null?"none":f.parent_task_id===Y?"refreshSubtasks":P!==m.TASK_UPDATED||f.task_id!==Y?"none":f.is_deleted===!0?"leaveDeleted":f.is_private!==!0||Se?f.sync_token!=null&&f.sync_token===Te?"none":"refreshTask":"leaveNoAccess"})(o,k,{isZeniUser:de,storedSyncToken:ke,taskId:t});p==="refreshTask"?(a(b(!0,t)),a(E(t))):p==="refreshSubtasks"?a(E(t)):p==="leaveDeleted"?V():p==="leaveNoAccess"&&O();break}case m.TASKS_BULK_UPDATED:{const p=X(k);if(p==null)break;p.task_ids.includes(t)&&a(b(!0,t)),a(E(t));break}case m.TASKS_BULK_DELETED:{const p=X(k);if(p==null)break;if(p.task_ids.includes(t)){V();break}a(E(t));break}case m.TASK_SNOOZE_RESURFACED:{ta(k)?.task_id===t&&a(b(!0,t));break}}}}),u.useEffect((()=>{T||N.fetchState==="Completed"||(ce(!0),a(ye()))}),[T,a,N.fetchState]),u.useEffect((()=>{Q||Z==="Completed"||(le(!0),a(Ae()))}),[Q,a,Z]);const pe=u.useCallback((()=>{t!=null&&(_.current=!1,a(Re([t],null,{isArchived:!1})),x(!0))}),[a,t]);u.useEffect((()=>{if($)if(U!=="In-Progress"){if(_.current){if(U==="Error")return x(!1),void(_.current=!1);if(U==="Completed"){x(!1),_.current=!1;const{tenantEmailDomain:o}=d;if(n.state?.message==="triggerBackClick"){const k=re(n.state?.pathnameStackToGoBack);e(k.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:k.newStack}})}else{const k=G(o);e(k,{state:{pathnameStackToGoBack:A(n.state?.pathnameStackToGoBack,n.pathname)}})}}}}else _.current=!0}),[$,U,d,n,e]);const q=g((o=>oe(o,t))),j=q.fetchState,M=D.getSignedInUser();if(M==null)throw Error("Can't access task detail page without signing in...");if(j==="Error"&&q.error?.code===400){const{tenantEmailDomain:o}=d,k=G(o),p=A(n.state?.pathnameStackToGoBack,n.pathname);return r.jsx(Ee,{to:k,state:{pathnameStackToGoBack:p}})}return r.jsxs(r.Fragment,{children:[j==="Completed"?r.jsx(qe,{analytics:J,onLoad:o=>(k=>k.trackPageLoaded(Me.Event.taskDetailPage))(o)}):null,r.jsxs(la,{children:[r.jsx(Xe,{isAppContentDrawerOpen:R,handleDrawerToggle:o=>{w(o)}}),r.jsx(ca,{analytics:J,currentTenant:d,handleZeniLogoClick:()=>{c.toggle()},initialOpenThreadRequest:S,location:n,loggedInUser:M,navigate:e,taskGroupId:l,taskId:t,taskDetailFetchState:j,onUnarchiveTaskClick:pe,isTaskSnoozeEnabled:i,isTaskVisibilityEnabled:I,isTaskCannedResponsesEnabled:C,isTaskRecurringParentEnabled:v,isTaskGroupAssigneesEnabled:B})]})]})}const la=Je.div`
1
+ import{j as r}from"./liveblocks-CZZ7TQJf.js";import Te from"./NotFoundScreen-DHpPkJUq.js";import{a as u}from"./sentry-7oL5NFUY.js";import{h as ee,u as ae,j as g,g as ge,i as he,N as Ee,l as De,n as be,o as h}from"./core-DtSa7_zJ.js";import{Qq as se,Qt as Ie,Qn as Ce,a2y as Re,fI as te,a2z as ne,QU as D,QH as E,Qk as _e,Rn as ye,Rg as Ae,a2A as oe,gk as ie,a2B as H,a2C as Ge,Qg as Ue,Qd as ve,v2 as Be,uS as we,mD as xe,QF as je,a2D as Pe,Rz as Fe,QB as Le,R2 as Ke,Q$ as Qe,Qw as $e,QY as Ne,QR as Ze}from"./zeni-epic-state-DIQk-W8f.js";import{z as b,e1 as ze,Z as Ve,W as Oe,c as _,a2 as re,p as y,a6 as qe,k as J,R as Me,e2 as Ye,V as W,ac as He}from"./index-CJhgQFRI.js";import{n as Je}from"./mui-hHF2bYsV.js";import{u as We}from"./useInitialThreadRequest-Cf6qZ2C0.js";import{M as Xe}from"./MobileAppDrawer-D9iwyW6E.js";import{T as m,t as ea,b as aa,a as sa,c as ta,d as X,e as na}from"./TaskListScreen-DW7e6ef_.js";import{u as oa}from"./useTaskManagerPusherEvents-CtTv0DPD.js";import"./recharts-DHYb1iJa.js";import"./analytics-wUVBNE2n.js";import"./plaid-l93gkere.js";import"./dnd-BRHUZ8LO.js";import"./stripe-cKAAJElX.js";import"./lottie-_8fQYf62.js";import"./lexical-CV0PpHfb.js";import"./pdf-DcTPEGUQ.js";import"./utils-D3PNq8pk.js";import"./InboxNotificationsProvider-DrljtAmN.js";import"./useTaskManagerAccess-zRd8th0q.js";import"./useAskAiCfoHostNavButtonProps-C0sjuZuZ.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]="21e3867c-fb1f-40f5-a4dc-a1ac91fad4e7",e._sentryDebugIdIdentifier="sentry-dbid-21e3867c-fb1f-40f5-a4dc-a1ac91fad4e7")}catch{}})();function ia(){const e=ee(),a=ae(),n=b.getSignedInUser(),{cannedResponses:c,fetchState:t,saveFetchState:l}=g((i=>i.cannedResponsesState)),d=u.useCallback((()=>{a(se())}),[a]),S=u.useCallback(((i,I,C)=>{a(Ie({name:i,content:I,cannedResponseId:C}))}),[a]),s=u.useCallback((i=>{a(Ce({cannedResponseId:i}))}),[a]);if(n==null)throw Error("Can't access quick responses page without signing in...");return r.jsx(ze,{cannedResponses:c,isLoading:t==="In-Progress"||t==="Not-Started",isSaving:l==="In-Progress",onBackClick:()=>e(-1),onDelete:s,onFetch:d,onSave:S})}const K=e=>e?.taskState?.taskByID,F=(e,a)=>{const n=K(e);if(a!=null&&n!=null)return n[a]?.parentTaskId??void 0},ra=Re([F,(e,a)=>{const n=F(e,a),c=K(e);if(n!=null&&c!=null)return c[n]?.name},(e,a)=>{const n=F(e,a),c=K(e);return n!=null&&c!=null&&c[n]!=null}],((e,a,n)=>{if(e!=null&&n===!0)return{id:e,name:a??""}})),ca=De((function(e,a){const{location:n,taskGroupId:c}=a,t=oe(e,a.taskId),l=te(e),d=ra(e,a.taskId),S=t.taskGroupId??c,s=S!=null?H(e.taskGroupState,S):void 0,i=b.getSignedInUser(),I=l.tenantId,C={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:I??""},v=ne(e),{tenantEmailDomain:B}=l,A=t.recurringSourceTaskId,w=A!=null?`${W.appUrl}/${B}/tasks/${encodeURIComponent(A)}`:void 0;return{taskDetailSelectorView:t,authParams:C,isZeniUser:b.isZeniUser(),userGroupList:Ge(e),isNewClicked:n.state?.message==="comingFromTaskListPage",filesEndPoint:He.fileMicroServiceBaseUrl,companyName:a.currentTenant.companyName,companyId:a.currentTenant.companyId,currentUrl:`${W.appUrl}${a.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:w,tagListView:v,taskGroupName:S!=null&&s!=null&&s.isDefault===!1?s.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map((f=>H(e.taskGroupState,f))).filter((f=>f!=null&&!f.isDeleted)).map((f=>({id:f.id,name:f.name,isDefault:f.isDefault}))),subtasks:t.subtasks,parentTaskRef:d,subTaskCreateStatus:e.taskDetailState?.subTaskCreateStatus?.fetchState}}),(function(e,a){const{taskId:n,navigate:c,currentTenant:t,location:l,taskGroupId:d}=a,{tenantEmailDomain:S}=t;return{onSaveChangesToLocalStore:s=>{e(Ze({taskDetailLocalData:s,taskId:n}))},onSaveDetailClick:s=>{e(Ne(n,s??d))},onArchiveTaskClick:()=>{a.taskId!=null&&e($e(a.taskId))},onSnoozeTask:(s,i)=>{e(Qe(s,i))},onUnsnoozeTask:s=>{e(Ke(s))},onCreateSubtask:(s,i)=>{e(Le({...i,parentTaskId:s}))},onSubtaskUpdate:(s,i)=>{e(Fe({task:s,updates:i}))},onShowToast:s=>{e(ie(s))},onSubtaskRowClick:s=>{c(`/${S}/tasks/${s}`,{state:{pathnameStackToGoBack:y(l.state?.pathnameStackToGoBack,l.pathname)}})},onParentBreadcrumbClick:s=>{c(`/${S}/tasks/${s}`,{state:{pathnameStackToGoBack:y(l.state?.pathnameStackToGoBack,l.pathname)}})},onDismissClick:()=>{if(l.state?.message==="triggerBackClick"){const s=re(l.state?.pathnameStackToGoBack),i=s.poppedPathname??"../../dashboard";c(i,{state:{pathnameStackToGoBack:s.newStack}})}else{const s=U(S),i=y(l.state?.pathnameStackToGoBack,l.pathname);c(s,{state:{pathnameStackToGoBack:i}})}e(Pe({taskId:n}))},onDeleteTaskClick:()=>{e(je(n))},updateFilesEntity:s=>{e(xe({files:s}))},onDeleteFile:s=>{e(we(s))},onEditFileName:(s,i)=>{e(Be(s,i.split(".")[0]))},onReloadTaskDetailPage:()=>{e(D(!1,n))},onCreateTagClick:s=>{e(ve(s,n))},onDeleteTagClick:s=>{e(Ue(s,n))},onFetchCannedResponses:()=>{e(se())},onManageTemplatesClick:()=>{c(`/${t.tenantEmailDomain}/tasks/quick-responses`)}}}))(Ye);function L(){const e=ee(),a=ae(),n=ge(),c=Ve(),{taskId:t,taskGroupId:l}=he(),d=g((o=>te(o))),S=We(d?.companyId),{useFeatureGate:s}=Oe(),{isFeatureEnabled:i}=s(_.isTaskSnoozeEnabled),{isFeatureEnabled:I}=s(_.isTaskVisibilityEnabled),{isFeatureEnabled:C}=s(_.isTaskCannedResponsesEnabled),{isFeatureEnabled:v}=s(_.isTaskRecurringParentEnabled),{isFeatureEnabled:B}=s(_.isTaskGroupAssigneesEnabled),[A,w]=u.useState(!1),[f,ce]=u.useState(!1),[Q,le]=u.useState(!1),[$,x]=u.useState(!1),R=u.useRef(!1),G=g((o=>o.taskListState.updateTasksFetchState.fetchState)),N=g((o=>ne(o))),Z=g((o=>o.taskGroupViewState.fetchState));u.useEffect((()=>{a(D(!1,t)),t!=null&&a(E(t))}),[a,t]);const z=b.getSignedInUser()?.userId,de=b.isZeniUser(),ke=g((o=>t!=null?o.taskState.taskByID[t]?.syncToken:void 0)),V=()=>{d?.tenantEmailDomain!=null&&e(U(d.tenantEmailDomain))},O=()=>{a(ie({messageSection:"delete_task",messageText:"success",type:"success"})),V()},ue=u.useMemo((()=>{const o=[m.TASK_CREATED,m.TASK_UPDATED,m.TASKS_BULK_UPDATED,m.TASKS_BULK_DELETED],k=[...o,m.TASK_SNOOZE_RESURFACED];return[...aa(d?.companyId,o),...sa(z,k)]}),[d?.companyId,z]);oa({events:ue,onSubscribed:()=>{t!=null&&(a(D(!0,t)),a(E(t)))},onEvent:(o,k)=>{if(t!=null)switch(o){case m.TASK_CREATED:case m.TASK_UPDATED:{const p=((P,me,{isZeniUser:Se,storedSyncToken:fe,taskId:Y})=>{if(P!==m.TASK_CREATED&&P!==m.TASK_UPDATED)return"none";const T=ea(me);return T==null?"none":T.parent_task_id===Y?"refreshSubtasks":P!==m.TASK_UPDATED||T.task_id!==Y?"none":T.is_deleted===!0?"leaveDeleted":T.is_private!==!0||Se?T.sync_token!=null&&T.sync_token===fe?"none":"refreshTask":"leaveNoAccess"})(o,k,{isZeniUser:de,storedSyncToken:ke,taskId:t});p==="refreshTask"?(a(D(!0,t)),a(E(t))):p==="refreshSubtasks"?a(E(t)):p==="leaveDeleted"?O():p==="leaveNoAccess"&&V();break}case m.TASKS_BULK_UPDATED:{const p=X(k);if(p==null)break;p.task_ids.includes(t)&&a(D(!0,t)),a(E(t));break}case m.TASKS_BULK_DELETED:{const p=X(k);if(p==null)break;if(p.task_ids.includes(t)){O();break}a(E(t));break}case m.TASK_SNOOZE_RESURFACED:{ta(k)?.task_id===t&&a(D(!0,t));break}}}}),u.useEffect((()=>{f||N.fetchState==="Completed"||(ce(!0),a(_e()))}),[f,a,N.fetchState]),u.useEffect((()=>{Q||Z==="Completed"||(le(!0),a(ye()))}),[Q,a,Z]);const pe=u.useCallback((()=>{t!=null&&(R.current=!1,a(Ae([t],null,{isArchived:!1})),x(!0))}),[a,t]);u.useEffect((()=>{if($)if(G!=="In-Progress"){if(R.current){if(G==="Error")return x(!1),void(R.current=!1);if(G==="Completed"){x(!1),R.current=!1;const{tenantEmailDomain:o}=d;if(n.state?.message==="triggerBackClick"){const k=re(n.state?.pathnameStackToGoBack);e(k.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:k.newStack}})}else{const k=U(o);e(k,{state:{pathnameStackToGoBack:y(n.state?.pathnameStackToGoBack,n.pathname)}})}}}}else R.current=!0}),[$,G,d,n,e]);const q=g((o=>oe(o,t))),j=q.fetchState,M=b.getSignedInUser();if(M==null)throw Error("Can't access task detail page without signing in...");if(j==="Error"&&q.error?.code===400){const{tenantEmailDomain:o}=d,k=U(o),p=y(n.state?.pathnameStackToGoBack,n.pathname);return r.jsx(Ee,{to:k,state:{pathnameStackToGoBack:p}})}return r.jsxs(r.Fragment,{children:[j==="Completed"?r.jsx(qe,{analytics:J,onLoad:o=>(k=>k.trackPageLoaded(Me.Event.taskDetailPage))(o)}):null,r.jsxs(la,{children:[r.jsx(Xe,{isAppContentDrawerOpen:A,handleDrawerToggle:o=>{w(o)}}),r.jsx(ca,{analytics:J,currentTenant:d,handleZeniLogoClick:()=>{c.toggle()},initialOpenThreadRequest:S,location:n,loggedInUser:M,navigate:e,taskGroupId:l,taskId:t,taskDetailFetchState:j,onUnarchiveTaskClick:pe,isTaskSnoozeEnabled:i,isTaskVisibilityEnabled:I,isTaskCannedResponsesEnabled:C,isTaskRecurringParentEnabled:v,isTaskGroupAssigneesEnabled:B})]})]})}const la=Je.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -6,4 +6,4 @@ import{j as r}from"./liveblocks-D0aPwrEa.js";import fe from"./NotFoundScreen-DVw
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,G=e=>`/${e}/tasks`;function wa(){return r.jsxs(De,{children:[r.jsx(h,{path:"/new",element:r.jsx(L,{})}),r.jsx(h,{path:"/new/:taskGroupId",element:r.jsx(L,{})}),r.jsx(h,{path:"/group/:taskGroupId",element:r.jsx(na,{})}),r.jsx(h,{path:"/quick-responses",element:r.jsx(ia,{})}),r.jsx(h,{path:"/:taskId",element:r.jsx(L,{})}),r.jsx(h,{path:"*",element:r.jsx(fe,{})})]})}export{wa as default};
9
+ `,U=e=>`/${e}/tasks`;function wa(){return r.jsxs(be,{children:[r.jsx(h,{path:"/new",element:r.jsx(L,{})}),r.jsx(h,{path:"/new/:taskGroupId",element:r.jsx(L,{})}),r.jsx(h,{path:"/group/:taskGroupId",element:r.jsx(na,{})}),r.jsx(h,{path:"/quick-responses",element:r.jsx(ia,{})}),r.jsx(h,{path:"/:taskId",element:r.jsx(L,{})}),r.jsx(h,{path:"*",element:r.jsx(Te,{})})]})}export{wa as default};
@@ -0,0 +1 @@
1
+ import{j as t}from"./liveblocks-CZZ7TQJf.js";import i from"./NotFoundScreen-DHpPkJUq.js";import{T as r}from"./TransactionDetailScreen-DPKP2gGJ.js";import"./sentry-7oL5NFUY.js";import{n as a,o as e}from"./core-DtSa7_zJ.js";import"./zeni-epic-state-DIQk-W8f.js";import"./recharts-DHYb1iJa.js";import"./index-CJhgQFRI.js";import"./mui-hHF2bYsV.js";import"./analytics-wUVBNE2n.js";import"./plaid-l93gkere.js";import"./dnd-BRHUZ8LO.js";import"./stripe-cKAAJElX.js";import"./lottie-_8fQYf62.js";import"./lexical-CV0PpHfb.js";import"./pdf-DcTPEGUQ.js";import"./utils-D3PNq8pk.js";import"./useAskAiCfoHostNavButtonProps-C0sjuZuZ.js";import"./decodeURIComponentSafe-CxfS79yY.js";import"./useInitialThreadRequest-Cf6qZ2C0.js";import"./routePaths-66PPW-xS.js";import"./expenseAutomationHelper-BUiYzGxA.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};
@@ -1,5 +1,5 @@
1
- import{j as R}from"./liveblocks-D0aPwrEa.js";import{a as i}from"./sentry-Bh_Qiwsv.js";import{u as j,k as ot,j as g,s as ge,g as ke,h as Ce,i as Ae,N as st,l as ct}from"./core-CJLU9TYG.js";import{pz as Ie,fI as J,gZ as it,V9 as rt,oF as lt,of as dt,DZ as se,Xn as ut,gk as mt,bn as pt,dg as Re,bq as _e,sZ as q,Wf as H,Xo as we,Xp as le,WF as Pe,me as Fe,Xq as Ue,WK as de,WL as ue,n3 as xe,SF as me,Xj as M,m8 as Le,m6 as Ve,mi as ft,pm as ht,Xr as St,Xs as yt,DQ as K,md as Be,R_ as Oe,cn as Tt,dm as bt,Xt as gt,Xi as It,Xu as vt,Xv as Dt,Xw as Et,Xx as kt,DM as Ct,Xy as At,Xz as Rt,XA as _t,XB as wt,XC as Pt,mh as Ft,XD as Ut,XE as xt,Xk as Lt,XF as Vt,XG as Bt,XH as Ot,RU as Nt,RK as zt,S7 as Xt,mj as jt,SG as ve,pr as Gt}from"./zeni-epic-state-DN1FMHPE.js";import{W as Y,A as w,j as $,b0 as Mt,z as Ne,$ as $t,b1 as Wt,a9 as qt,a2 as ce,V as Ht,b2 as Yt,p as ie,aq as Zt,b3 as Kt,b4 as Qt,b5 as Jt,ac as en,at as oe}from"./index-Bac0_7La.js";import{n as tn,S as nn,u as an,D as on}from"./mui-BTK8WNHw.js";import{u as sn}from"./useAskAiCfoHostNavButtonProps-CkY97uj-.js";import{d as ze}from"./decodeURIComponentSafe-Cai8T7ud.js";import{u as cn}from"./useInitialThreadRequest-Byaj949Q.js";import{h as Xe,c as je,g as rn,e as ln}from"./routePaths-CFVcdQVU.js";import{u as dn}from"./expenseAutomationHelper-AFTT-GAh.js";import{A as un}from"./utils-DnIJUuGb.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]="c387a5bb-a5d6-4652-955d-68c43f9fc27d",t._sentryDebugIdIdentifier="sentry-dbid-c387a5bb-a5d6-4652-955d-68c43f9fc27d")}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),[k,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,E=g((I=>J(I))),C=E.companyId,P=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),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),G=i.useMemo((()=>{const I={};for(const b of O)b.accountId!=null&&b.accountName!=null&&(I[b.accountId]=b.accountName);return I}),[O]),W=l!=null?G[l]??null:null,N=i.useCallback((I=>{if(!T)return;const b=V.current;if(b==null)return;const _=b.accounts??[],Z=new Set(I),ee=x.current??{},te=B.current;for(const z of _)if(Z.has(z.accountId)&&ee[z.accountId]==null&&te?.[z.accountId]==null)return p(z.classificationType),u(z.accountId),void h(!0)}),[T]),D=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:k,popupAccountId:l,popupAccountName:W,currencySymbol:P,checkAndShowPopup:N,handleSubmit:D,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,De=(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}),Ge=(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),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]),k=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 P=De(T,E,C),A=X.get(P);return A!=null&&(X.delete(P),Ge(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(De(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:k,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}=Y(),{isFeatureEnabled:o}=e(w.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 On(t,e){const o=j(),{useFeatureGate:n}=Y(),a=g((r=>J(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),k=pe(),p=i.useMemo((()=>({id:t,type:q(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"?Me(l?.transaction):void 0),[l?.fetchState,l?.transaction]),T=g((r=>{if(f!=null)return we(r.customerIncomeState,r.vendorExpenseState,r.trendState,f,"month")})),E=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 G=i.useCallback((()=>{U(!1),x(!1)}),[]),[W,N]=i.useState(!1),D=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:D??T}))):(o(de()),o(ue()),U(!0),o(xe(f))))}),[o,B,l?.fetchState,l?.transaction,f,s,c,d,F,V,T,D]),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:k,selectedTransaction:p,transactionDetail:l,rawDetailSaveStatus:u,rawDetailLineItemById:S,vendorSaveStatus:v,tranEntity:f,defaultTrendTransactionTimePeriod:T,vendorViewDetails:E,uiState:C,firstMonthOfFY:P,uncategorizedAccounts:A,resetTrendIsFetchedStates:G,isCreateVendorDrawerOpen:W,setIsCreateVendorDrawerOpen:N}}const hn={overlayWidth:new qt(100,100,58)},Sn=({isOpen:t,onSaveVendor:e,onSaveSuccess:o,onCancel:n,vendorViewDetails:a})=>{const s=an(),c=$t(),d=j(),y=g((p=>le(p))),h=()=>{n()},k={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,{...k})})})},yn=tn(nn)`
1
+ import{j as R}from"./liveblocks-CZZ7TQJf.js";import{a as i}from"./sentry-7oL5NFUY.js";import{u as j,k as ot,j as g,s as ge,g as Ee,h as Ce,i as Ae,N as st,l as ct}from"./core-DtSa7_zJ.js";import{pz as Ie,fI as J,gZ as it,V9 as rt,oF as lt,of as dt,DZ as se,Xn as ut,gk as mt,bn as pt,dg as Re,bq as _e,sZ as q,Wf as H,Xo as we,Xp as le,WF as Pe,me as Fe,Xq as Ue,WK as de,WL as ue,n3 as xe,SF as me,Xj as G,m8 as Le,m6 as Be,mi as ft,pm as ht,Xr as St,Xs as yt,DQ as K,md as Ve,R_ as Oe,cn as Tt,dm as bt,Xt as gt,Xi as It,Xu as vt,Xv as kt,Xw as Dt,Xx as Et,DM as Ct,Xy as At,Xz as Rt,XA as _t,XB as wt,XC as Pt,mh as Ft,XD as Ut,XE as xt,Xk as Lt,XF as Bt,XG as Vt,XH as Ot,RU as Nt,RK as zt,S7 as Xt,mj as jt,SG as ve,pr as Mt}from"./zeni-epic-state-DIQk-W8f.js";import{W as Y,c as w,k as $,b0 as Gt,z as Ne,$ as $t,b1 as Wt,a9 as qt,a2 as ce,M as Ht,b2 as Yt,p as ie,aq as Zt,b3 as Kt,b4 as Qt,b5 as Jt,ac as en,at as oe}from"./index-CJhgQFRI.js";import{n as tn,S as nn,u as an,D as on}from"./mui-hHF2bYsV.js";import{u as sn}from"./useAskAiCfoHostNavButtonProps-C0sjuZuZ.js";import{d as ze}from"./decodeURIComponentSafe-CxfS79yY.js";import{u as cn}from"./useInitialThreadRequest-Cf6qZ2C0.js";import{h as Xe,c as je,g as rn,e as ln}from"./routePaths-66PPW-xS.js";import{u as dn}from"./expenseAutomationHelper-BUiYzGxA.js";import{A as un}from"./utils-D3PNq8pk.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]="9ba48597-bec4-4500-8cd7-dce9d1d65f32",t._sentryDebugIdIdentifier="sentry-dbid-9ba48597-bec4-4500-8cd7-dce9d1d65f32")}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),[E,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,D=g((I=>J(I))),C=D.companyId,P=g((I=>it(I.companyState,D.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),B=i.useRef(A);B.current=A;const x=i.useRef(F);x.current=F;const V=i.useRef(U);V.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]),W=l!=null?M[l]??null:null,N=i.useCallback((I=>{if(!T)return;const b=B.current;if(b==null)return;const _=b.accounts??[],Z=new Set(I),ee=x.current??{},te=V.current;for(const z of _)if(Z.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:E,popupAccountId:l,popupAccountName:W,currencySymbol:P,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}`,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"})))},Bn=(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))}))},Vn=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]),E=i.useCallback((u=>{if(!d)return;const S=h(u);if(S==="")return;if(u.outcome!=="accepted")return void n(u);((f,T,D,C)=>{const P=ke(T,D,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(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(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:E,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=>J(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),E=pe(),p=i.useMemo((()=>({id:t,type:q(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")})),D=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),[B,x]=i.useState(!1),[V,O]=i.useState(!1);i.useEffect((()=>{U(!1),x(!1),O(!1)}),[t,e]);const M=i.useCallback((()=>{U(!1),x(!1)}),[]),[W,N]=i.useState(!1),k=C?.selectedPeriod?.timePeriod;return i.useEffect((()=>{V||l==null||l.transaction==null||(o(Ue({id:l.transaction.id,type:l.transaction.type})),O(!0)),f!=null&&(!s||c&&d===!1)&&(F?B||T==null||(x(!0),o(me(f,"TransactionDetail",{timeframe:"month",timePeriod:k??T}))):(o(de()),o(ue()),U(!0),o(xe(f))))}),[o,V,l?.fetchState,l?.transaction,f,s,c,d,F,B,T,k]),i.useEffect((()=>{D.newVendorState?.vendorDetailLocalData?.vendorName!=null?N(!0):N(!1)}),[D.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect((()=>()=>{o(G("common"))}),[o]),{currentTenant:a,loggedInUserHasCardUserOrAdminRole:s,isUserHasDashboardAccess:c,isUserHasInvestorOrBankerAccess:d,isVendorBulkUpdateOnTransactionEnabled:y,isExpenseAutomationEnabled:h,isChainOfThoughtEnabled:E,selectedTransaction:p,transactionDetail:l,rawDetailSaveStatus:u,rawDetailLineItemById:S,vendorSaveStatus:v,tranEntity:f,defaultTrendTransactionTimePeriod:T,vendorViewDetails:D,uiState:C,firstMonthOfFY:P,uncategorizedAccounts:A,resetTrendIsFetchedStates:M,isCreateVendorDrawerOpen:W,setIsCreateVendorDrawerOpen:N}}const hn={overlayWidth:new qt(100,100,58)},Sn=({isOpen:t,onSaveVendor:e,onSaveSuccess:o,onCancel:n,vendorViewDetails:a})=>{const s=an(),c=$t(),d=j(),y=g((p=>le(p))),h=()=>{n()},E={vendorDetailView:a??y,onSaveSuccess:()=>{d(Be()),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,{...E})})})},yn=tn(nn)`
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: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=ke(),a=Ce(),s=j(),c=pe(),{transactionTypeEncoded:d,transactionId:y}=Ae(),h=e??y,k=o??ze(d??"");let p;Xe(h,k)&&(p={id:h,type:q(k)});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 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(K({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=J(t);return{transactionDetail:o,transactionAttachmentEndpointToDownload:`${oe}/transaction_attachment`,transactionAttachmentsEndpointToFetch:h.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${oe}/transaction_attachments_accounting_provider`:`${oe}/transaction_attachments`,attachmentUploadEndpoint:`${en.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(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(M("common"))},onCancelAutoComplete:()=>{t(M("common"))}},onFetchRecommendationsForEntity:(n,a,s,c)=>{t(K({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(K({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(K({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(kt(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(Dt(a,n))},onToggleSplitEditMode:n=>{if(e.transaction==null)return;const a={id:e.transaction.id,type:e.transaction.type};t(vt(a,n))}}}))(Jt);function Nn(){const t=Ce(),e=j(),o=ke(),{useFeatureGate:n}=Y(),a=Ht(),s=g((m=>J(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:k}=n(w.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:P}=n(w.isRecommendationFeedbackEnabled),A=Yt(),{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),G=a?.currentTenant?.companyId,W=a?.currentTenant?.companyName,N=cn(G),D=i.useMemo((()=>{if(T)return{id:u,type:q(f)}}),[T,u,f]),r=D!=null?g((m=>H(m,D))):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?we(m.customerIncomeState,m.vendorExpenseState,m.trendState,b,"month"):void 0)),Z=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"))),[We,fe]=i.useState(!1),[qe,he]=i.useState(!1),[He,Se]=i.useState(!1),Ye=i.useCallback((m=>je(m,p??"")+o.search),[p,o.search]),Ze=i.useCallback((()=>{Se(!1)}),[]);bn({currentTransactionId:D,enabled:p!=null&&p!=="",buildPath:Ye,beforeNavigate:Ze,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 Ke=r?.transactionDetailUpdateStatus?.fetchState,L=pn(Ke,(()=>{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((()=>{D!=null&&r!=null&&r.fetchState==="Not-Started"&&(e(Oe(D,!1)),ye())}),[e,D,r?.fetchState]),i.useEffect((()=>{if(D!=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"}})}}),[D,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"&&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((()=>{Z.newVendorState?.vendorDetailLocalData?.vendorName!=null?v(!0):v(!1)}),[Z.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect((()=>()=>{e(M("common"))}),[]);const Qe=[l,u].filter((m=>m!=null)),{transactionId:be,onSaveVendor:Je,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:Je,onSaveSuccess:et,onCancel:tt}),R.jsx(Kt,{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:D,entity:b,isCOTEnabled:C,defaultTrendTransactionTimePeriod:_,resetTrendIsFetchedStates:ye,transaction:r?.transaction,uncategorizedAccounts:z,vendorSaveStatus:I,isVendorBulkUpdateOnTransactionEnabled:h,isCreateTransferEntryFromExpenseEnabled:x,isExpenseAutomationEnabled:k,isAiCfoAccessEnabled:nt,onAskAiCfoClick:at,isProjectsTransactionsEnabled:B,isTransactionSplitEnabled:O,companyId:G,companyName:W,initialOpenThreadRequest:N})}),U,L.showPopup&&L.popupType!=null&&R.jsx(Qt,{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},Ee=(t,e)=>{if(t!=null){const{transactionCategory:o,transactionClass:n}=vn(t),a=Dn(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}},Dn=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,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=Ee(),a=Ce(),s=j(),c=pe(),{transactionTypeEncoded:d,transactionId:y}=Ae(),h=e??y,E=o??ze(d??"");let p;Xe(h,E)&&(p={id:h,type:q(E)});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 D=0;D<f;D++)T=`${T}../`;return T})(1);a(v,{state:{pathnameStackToGoBack:S.newStack}})};return{transactionId:p,onSaveVendor:()=>{s(Ve(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(K({entity:v,amount:l?.transaction?.amount.amount,transactionDetails:f,flowType:"detail",isFetchCOT:c}))}u()},onCancel:()=>{p!=null&&s(St({transactionId:p})),s(Be()),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=J(t);return{transactionDetail:o,transactionAttachmentEndpointToDownload:`${oe}/transaction_attachment`,transactionAttachmentsEndpointToFetch:h.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${oe}/transaction_attachments_accounting_provider`:`${oe}/transaction_attachments`,attachmentUploadEndpoint:`${en.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?Ve(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(Vt(n,a,s,c,d,y))},onChangeCategoryClassWhenUpdateAllIsChecked:(n,a)=>{e.transaction!=null&&t(Bt({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(K({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(K({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(K({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(Et(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(Dt(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))}}}))(Jt);function Nn(){const t=Ce(),e=j(),o=Ee(),{useFeatureGate:n}=Y(),a=Ht(),s=g((m=>J(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:E}=n(w.isExpenseAutomationEnabled),{tenantEmailDomain:p,transactionTypeEncoded:l,transactionId:u}=Ae(),[S,v]=i.useState(!1),f=ze(l??""),T=Xe(u,f),D=g((m=>m.transactionVendorViewState)),C=pe(),{isFeatureEnabled:P}=n(w.isRecommendationFeedbackEnabled),A=Yt(),{onRecommendationSelection:F,popup:U}=fn({isEnabled:P,fallbackTransactionId:u}),B=i.useMemo((()=>({...A,onRecommendationSelection:F})),[A,F]),{isFeatureEnabled:x}=n(w.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:V}=n(w.isProjectsTransactionsEnabled),{isFeatureEnabled:O}=n(w.isTransactionSplitEnabled),M=a?.currentTenant?.companyId,W=a?.currentTenant?.companyName,N=cn(M),k=i.useMemo((()=>{if(T)return{id:u,type:q(f)}}),[T,u,f]),r=k!=null?g((m=>H(m,k))):void 0,I=r?.transactionDetailLocalData.vendorUpdates?.id!=null?D.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)),Z=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"))),[We,fe]=i.useState(!1),[qe,he]=i.useState(!1),[He,Se]=i.useState(!1),Ye=i.useCallback((m=>je(m,p??"")+o.search),[p,o.search]),Ze=i.useCallback((()=>{Se(!1)}),[]);bn({currentTransactionId:k,enabled:p!=null&&p!=="",buildPath:Ye,beforeNavigate:Ze,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 Ke=r?.transactionDetailUpdateStatus?.fetchState,L=pn(Ke,(()=>{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(Oe(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((()=>{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"&&De(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()),De(r?.transaction,m),fe(!0),e(xe(b))))}),[r?.fetchState,r?.transaction,_,c]),i.useEffect((()=>{Z.newVendorState?.vendorDetailLocalData?.vendorName!=null?v(!0):v(!1)}),[Z.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect((()=>()=>{e(G("common"))}),[]);const Qe=[l,u].filter((m=>m!=null)),{transactionId:be,onSaveVendor:Je,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:Je,onSaveSuccess:et,onCancel:tt}),R.jsx(Kt,{toolkit:B,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:E,isAiCfoAccessEnabled:nt,onAskAiCfoClick:at,isProjectsTransactionsEnabled:V,isTransactionSplitEnabled:O,companyId:M,companyName:W,initialOpenThreadRequest:N})}),U,L.showPopup&&L.popupType!=null&&R.jsx(Qt,{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},De=(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,Vn as i,De as l,Bn as r,On as u};
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-D0aPwrEa.js";import{h as W,g as q,u as K,i as Q,j as g,N as U,l as X,n as Me,o as M}from"./core-CJLU9TYG.js";import{fI as N,uh as Z,lj as p,eI as ee,Sw as Ae,br as me,a0b as Ce,m3 as te,WH as ae,a0c as pe,a0d as Be,bF as k,Ss as Se,a0e as Le,a0f as fe,a0g as Fe,Sv as he,a0h as Oe,a0i as Te,a0j as ze,a0k as ge,a0l as Ge,a0m as we,a0n as De,TJ as $e}from"./zeni-epic-state-DN1FMHPE.js";import{W as ne,A as ce,j as L,G as Ie,db as oe,p as R,a2 as se,ao as Re,e as _e}from"./index-Bac0_7La.js";import"./mui-BTK8WNHw.js";import{a as y}from"./sentry-Bh_Qiwsv.js";import{w as ie}from"./withTransactionSidePanel-BOFkm0Uk.js";import{p as re,c as de}from"./routePaths-CFVcdQVU.js";import{B as Ve}from"./utils-DnIJUuGb.js";import{d as E}from"./decodeURIComponentSafe-Cai8T7ud.js";import{Z as Je}from"./ZeniAccountStatementScreen-BAIxCUhh.js";import"./recharts-BEqM6zw3.js";import"./analytics-K5kCmXhx.js";import"./plaid-BWaZTH4h.js";import"./dnd-BvQSnOXX.js";import"./stripe-cKAAJElX.js";import"./lottie-CRpndHoM.js";import"./lexical-G-6YJUO1.js";import"./pdf-BlY1D9V4.js";import"./useAskAiCfoHostNavButtonProps-CkY97uj-.js";import"./TransactionDetailScreen-DGElbhCa.js";import"./useInitialThreadRequest-Byaj949Q.js";import"./expenseAutomationHelper-AFTT-GAh.js";import"./stripSplatSuffix-Ba8pyF0x.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="6d6272cd-d16e-41df-a175-bb7e96440156",a._sentryDebugIdIdentifier="sentry-dbid-6d6272cd-d16e-41df-a175-bb7e96440156")}catch{}})();const qe=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],J=a=>Ve(a),ke=()=>{const{common:a,uncategorizedTransactionList:e}=Ie.getLocalizedStrings();return{amount:e.missingReceipt.missingReceiptMinAmount.amount,currencyCode:a.currency.currencyCode,currencySymbol:a.currency.currencySymbol}},Ue=X((function(a,e){const t=Ce(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,J(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=se(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=J(e.selectedAccount.tranListType),d=We(t,n,c,o,e.bookCloseDate);L.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(pe({uiState:{dateRange:d},type:J(e.selectedAccount.tranListType)})),a(Ae(o,p(d),!1,o==="missingReceipts"?ke():void 0)),e.onSelectedTimePeriodChange(p(d))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=de(t,e.tenantEmailDomain),c=R(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(pe({uiState:{scrollYOffset:t},type:J(e.selectedAccount.tranListType)}))}}}))(oe),V=ie((function({...a}){const e=W(),t=q(),n=K(),c=t.pathname.split("/").find((l=>qe.includes(l))),o=c??"uncategorized-expense",{tenantEmailDomain:d}=Q(),{accountType:Y,title:b,subTitle:A}=Ne(o),f="month",T=g((l=>N(l))),v=T.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:S}=ne(),{isFeatureEnabled:h}=S(ce.isProjectsTransactionsEnabled),I=g((l=>Z(l)))&&h,{dataAvailable:x,initialTimeframeTick:F}=He(o,v,T.bookCloseDate),[P,O]=y.useState(!1),[j,z]=y.useState(void 0),u=y.useMemo((()=>{const l=p(F);return{tranListType:o,accountType:ee(Y),title:b,subTitle:A,timeframe:f,period:l}}),[o,f,Y,x]);y.useEffect((()=>{if(!P&&u!=null){O(!0),L.trackTransactionList(void 0,void 0,void 0,u.title);const l=J(u.tranListType);n(Ae(l,u.period,!0,l==="missingReceipts"?ke():void 0))}}),[P,u,n]);let C=u;return u!=null&&j!=null&&(C={...u,period:j}),c==null||C==null?s.jsx(U,{to:"../"}):s.jsx(Ue,{firstMonthOfFY:v,tenantEmailDomain:d,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:x,navigate:e,showProjectField:I,selectedAccount:C,referrerType:o,bookCloseDate:T.bookCloseDate,onSelectedTimePeriodChange:l=>z(l),...a})})),Ne=a=>{let e="",t="";const n=Ie.getLocalizedStrings();switch(a){case"uncategorized-income":e="income",t=n.uncategorizedTransactionList.income.title;break;case"uncategorized-expense":e="expenses",t=n.common.texts.uncategorizedExpenses;break;case"miscategorized-expense":e="expenses",t=n.miscategorizedTransactionList.expense.title;break;case"miscategorized-income":e="income",t=n.miscategorizedTransactionList.income.title;break;case"missing-receipts":t=n.common.texts.receipts}return{accountType:e,title:t,subTitle:""}},He=(a,e,t)=>{const n=me();let c=me().startOf("month").subtract(11,"month");return t!=null&&a!=="missing-receipts"?t.add(1,"day").isBefore(c)?{dataAvailable:{startDate:t.add(1,"day"),endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}:(c=t.add(1,"day"),{dataAvailable:{startDate:c,endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}):{dataAvailable:re(5,e),initialTimeframeTick:{startDate:c,endDate:n}}},We=(a,e,t,n,c)=>{let o=e;return n==="missingReceipts"||c==null?a.startDate.isBefore(e.startDate,t)?o={startDate:a.startDate,endDate:e.endDate}:a.startDate.isAfter(e.endDate,t)?o={startDate:e.startDate,endDate:a.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(a)}`):o=a.startDate.isBefore(c,t)?{startDate:c.add(1,"day"),endDate:e.endDate}:{startDate:a.startDate,endDate:e.endDate},o},Ke=X((function(a,e){const t=Le(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:re(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=se(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Ye();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),L.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{dateRange:o}})),a(Se(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=de(t,e.tenantEmailDomain),c=R(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{scrollYOffset:t}}))}}}))(oe),Qe=ie((function({referrerType:a,...e}){const t=W(),n=q(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:d,accountIdEncoded:Y,classIdEncoded:b,timeframe:A,startDate:f,endDate:T,titleEncoded:v}=Q(),S=E(d??""),h=E(Y??""),I=E(b??""),x=E(v??""),F=g((r=>Be(r.transactionListState,h,S,I))),[P,O]=y.useState(!1),[j,z]=y.useState(void 0),u=g((r=>N(r))),C=u.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:l}=ne(),{isFeatureEnabled:m}=l(ce.isProjectsTransactionsEnabled),w=g((r=>Z(r)))&&m;let i;const G=Xe(S,h,I,A,f,T,x);if(G){const r={startDate:k(f,"YYYY-MM-DD"),endDate:k(T,"YYYY-MM-DD")},$=Ze(F?.dateRange,r);i={accountId:h,accountType:ee(S),classId:I,title:x,timeframe:A,period:$}}y.useEffect((()=>{P||i==null||(O(!0),L.trackTransactionList(i.accountId,void 0,a,i.title),c(Se(i.accountId,i.accountType,i.classId,i.period)))}),[P,i,c]);let B=i;i!=null&&j!=null&&(B={...i,period:j});const _=[d,Y,b,A,f,T,v].filter((r=>r!=null));return G&&B!=null?s.jsx(Ke,{firstMonthOfFY:C,tenantEmailDomain:o,location:n,navigate:t,showProjectField:w,selectedAccount:B,referrerType:a,onSelectedTimePeriodChange:r=>z(r),...e}):s.jsx(U,{to:Ye(_.length)})})),Ye=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Xe=(a,e,t,n,c,o,d)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&k(c,"YYYY-MM-DD").isValid()&&k(o,"YYYY-MM-DD").isValid()&&d!=null,Ze=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),et=X((function(a,e){const t=Oe(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:re(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=se(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??be();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),L.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(Te({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{dateRange:o}})),a(he(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=de(t,e.tenantEmailDomain),c=R(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(Te({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{scrollYOffset:t}}))}}}))(oe),tt=ie((function({referrerType:a,...e}){const t=W(),n=q(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:d,accountIdEncoded:Y,projectIdEncoded:b,timeframe:A,startDate:f,endDate:T,titleEncoded:v}=Q(),S=E(d??""),h=E(Y??""),I=E(b??""),x=E(v??""),F=g((r=>Fe(r.transactionListState,h,S,I))),[P,O]=y.useState(!1),[j,z]=y.useState(void 0),u=g((r=>N(r))),C=u.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:l}=ne(),{isFeatureEnabled:m}=l(ce.isProjectsTransactionsEnabled),w=g((r=>Z(r)))&&m;let i;const G=at(S,h,I,A,f,T,x);if(G){const r={startDate:k(f,"YYYY-MM-DD"),endDate:k(T,"YYYY-MM-DD")},$=nt(F?.dateRange,r);i={accountId:h,accountType:ee(S),projectId:I,title:x,timeframe:A,period:$}}y.useEffect((()=>{P||i==null||(O(!0),L.trackTransactionList(i.accountId,void 0,a,i.title),c(he(i.accountId,i.accountType,i.projectId,i.period)))}),[P,i,c]);let B=i;i!=null&&j!=null&&(B={...i,period:j});const _=[d,Y,b,A,f,T,v].filter((r=>r!=null));return G&&B!=null?s.jsx(et,{firstMonthOfFY:C,tenantEmailDomain:o,location:n,navigate:t,showProjectField:w,selectedAccount:B,referrerType:a,onSelectedTimePeriodChange:r=>z(r),...e}):s.jsx(U,{to:be(_.length)})})),be=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},at=(a,e,t,n,c,o,d)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&k(c,"YYYY-MM-DD").isValid()&&k(o,"YYYY-MM-DD").isValid()&&d!=null,nt=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),ct=X((function(a,e){const t=Ge(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&we(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:re(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=se(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??ve();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),L.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(De({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{dateRange:o}})),a(ge(e.selectedAccount.accountId,e.selectedAccount.accountType,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=de(t,e.tenantEmailDomain),c=R(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(De({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{scrollYOffset:t}}))},onStatementPageIconClick:()=>{const t=it(e.tenantEmailDomain),n=R(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}}))(oe),ye=ie((function({referrerType:a,...e}){const t=W(),n=q(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:d,accountIdEncoded:Y,timeframe:b,startDate:A,endDate:f,titleEncoded:T,excludeSubAccounts:v}=Q(),S=E(d??""),h=E(Y??""),I=E(T??""),x=!(v!=null&&v==="exclude_subaccounts"),F=g((D=>ze(D.transactionListState,h,S))),[P,O]=y.useState(!1),[j,z]=y.useState(void 0),u=g((D=>N(D))),C=u.company?.featuresActivationInfo.connectedAccountProvider==="unit",l=u.company?.companyInfo.firstMonthOfFY??1;let m;const w=ot(S,h,b,A,f,I);if(w){const D={startDate:k(A,"YYYY-MM-DD"),endDate:k(f,"YYYY-MM-DD")},le=st(F?.dateRange,D);m={accountId:h,accountType:ee(S),title:I,timeframe:b,period:le}}let i=m;m!=null&&j!=null&&(i={...m,period:j});const{useFeatureGate:G}=ne(),B=y.useCallback(((D,le)=>{if(o==null)return;const ue=D.url.split(`/${o}/`)[1];if(ue==null)return;const[je,Ee]=ue.split("?"),H=new URLSearchParams(Ee??"");H.set("view","full"),H.set("thread_id",le),H.set("entity_type",D.entityType);const xe=R(n.state?.pathnameStackToGoBack,n.pathname);t(`/${o}/${je}?${H.toString()}`,{state:{pathnameStackToGoBack:xe}})}),[t,o,n.state,n.pathname]),{isFeatureEnabled:_}=G(ce.isProjectsTransactionsEnabled),r=g((D=>Z(D)))&&_,{areTenantIdsInSync:$}=Re();y.useEffect((()=>{!P&&m!=null&&$&&(O(!0),L.trackTransactionList(m.accountId,void 0,a,m.title),c(ge(m.accountId,m.accountType,m.period,void 0,!1,x)))}),[P,m,c,$]);const Pe=[d,Y,b,A,f,T].filter((D=>D!=null));return w&&i!=null?s.jsx(ct,{firstMonthOfFY:l,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:C,onCommentThreadClick:B,showProjectField:r,selectedAccount:i,referrerType:a,onSelectedTimePeriodChange:D=>z(D),...e}):s.jsx(U,{to:ve(Pe.length)})})),ve=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},ot=(a,e,t,n,c,o)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&(t==="month"||t==="quarter")&&k(n,"YYYY-MM-DD").isValid()&&k(c,"YYYY-MM-DD").isValid()&&o!=null,st=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),it=a=>`/${a}/transactions/${$e}/statements`;function Ct(){const a=q().state?.referrer,e=g((n=>n.expenseAutomationViewState.selectedPeriodByTenantId))[g((n=>N(n))).tenantId],t=_e();return s.jsxs(Me,{children:[s.jsx(M,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:s.jsx(ye,{referrerType:a})}),s.jsx(M,{path:"/zeni-clearing-account/statements",element:s.jsx(Je,{})}),s.jsx(M,{path:"/*",element:s.jsx(ye,{referrerType:a})}),s.jsx(M,{path:"/uncategorized-income/*",element:s.jsx(V,{})}),s.jsx(M,{path:"/uncategorized-expense/*",element:s.jsx(V,{})}),s.jsx(M,{path:"/miscategorized-income/*",element:s.jsx(V,{})}),s.jsx(M,{path:"/miscategorized-expense/*",element:s.jsx(V,{})}),s.jsx(M,{path:"/missing-receipts/*",element:t?s.jsx(U,{to:`../../month_end_close_checks/review/missing_receipts/${e.month}-${e.year}`}):s.jsx(V,{})}),s.jsx(M,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(Qe,{referrerType:a})}),s.jsx(M,{path:"/by-project/:accountTypeEncoded/:accountIdEncoded/:projectIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(tt,{referrerType:a})})]})}export{Ct as default};
1
+ import{j as s}from"./liveblocks-CZZ7TQJf.js";import{h as W,g as q,u as K,i as Q,j as g,N as H,l as X,n as Me,o as M}from"./core-DtSa7_zJ.js";import{fI as N,uh as Z,lj as p,eI as ee,Sw as Ae,br as me,a0b as Ce,m3 as te,WH as ae,a0c as pe,a0d as Be,bF as k,Ss as Se,a0e as Le,a0f as fe,a0g as Fe,Sv as he,a0h as Oe,a0i as Te,a0j as ze,a0k as ge,a0l as Ge,a0m as we,a0n as De,TJ as $e}from"./zeni-epic-state-DIQk-W8f.js";import{W as ne,c as ce,k as L,G as Ie,db as oe,p as R,a2 as se,ao as Re,H as _e}from"./index-CJhgQFRI.js";import"./mui-hHF2bYsV.js";import{a as y}from"./sentry-7oL5NFUY.js";import{w as ie}from"./withTransactionSidePanel-DVXJCqK3.js";import{p as re,c as de}from"./routePaths-66PPW-xS.js";import{B as Ve}from"./utils-D3PNq8pk.js";import{d as E}from"./decodeURIComponentSafe-CxfS79yY.js";import{Z as Je}from"./ZeniAccountStatementScreen-BcWZ9nqz.js";import"./recharts-DHYb1iJa.js";import"./analytics-wUVBNE2n.js";import"./plaid-l93gkere.js";import"./dnd-BRHUZ8LO.js";import"./stripe-cKAAJElX.js";import"./lottie-_8fQYf62.js";import"./lexical-CV0PpHfb.js";import"./pdf-DcTPEGUQ.js";import"./useAskAiCfoHostNavButtonProps-C0sjuZuZ.js";import"./TransactionDetailScreen-DPKP2gGJ.js";import"./useInitialThreadRequest-Cf6qZ2C0.js";import"./expenseAutomationHelper-BUiYzGxA.js";import"./stripSplatSuffix-Cj4hZLSk.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="e65aee57-a196-46cc-98ec-0962078235cb",a._sentryDebugIdIdentifier="sentry-dbid-e65aee57-a196-46cc-98ec-0962078235cb")}catch{}})();const qe=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],J=a=>Ve(a),ke=()=>{const{common:a,uncategorizedTransactionList:e}=Ie.getLocalizedStrings();return{amount:e.missingReceipt.missingReceiptMinAmount.amount,currencyCode:a.currency.currencyCode,currencySymbol:a.currency.currencySymbol}},He=X((function(a,e){const t=Ce(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,J(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=se(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=J(e.selectedAccount.tranListType),d=We(t,n,c,o,e.bookCloseDate);L.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(pe({uiState:{dateRange:d},type:J(e.selectedAccount.tranListType)})),a(Ae(o,p(d),!1,o==="missingReceipts"?ke():void 0)),e.onSelectedTimePeriodChange(p(d))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=de(t,e.tenantEmailDomain),c=R(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(pe({uiState:{scrollYOffset:t},type:J(e.selectedAccount.tranListType)}))}}}))(oe),V=ie((function({...a}){const e=W(),t=q(),n=K(),c=t.pathname.split("/").find((l=>qe.includes(l))),o=c??"uncategorized-expense",{tenantEmailDomain:d}=Q(),{accountType:Y,title:v,subTitle:A}=Ne(o),f="month",T=g((l=>N(l))),b=T.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:S}=ne(),{isFeatureEnabled:h}=S(ce.isProjectsTransactionsEnabled),I=g((l=>Z(l)))&&h,{dataAvailable:x,initialTimeframeTick:F}=Ue(o,b,T.bookCloseDate),[P,O]=y.useState(!1),[j,z]=y.useState(void 0),u=y.useMemo((()=>{const l=p(F);return{tranListType:o,accountType:ee(Y),title:v,subTitle:A,timeframe:f,period:l}}),[o,f,Y,x]);y.useEffect((()=>{if(!P&&u!=null){O(!0),L.trackTransactionList(void 0,void 0,void 0,u.title);const l=J(u.tranListType);n(Ae(l,u.period,!0,l==="missingReceipts"?ke():void 0))}}),[P,u,n]);let C=u;return u!=null&&j!=null&&(C={...u,period:j}),c==null||C==null?s.jsx(H,{to:"../"}):s.jsx(He,{firstMonthOfFY:b,tenantEmailDomain:d,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:x,navigate:e,showProjectField:I,selectedAccount:C,referrerType:o,bookCloseDate:T.bookCloseDate,onSelectedTimePeriodChange:l=>z(l),...a})})),Ne=a=>{let e="",t="";const n=Ie.getLocalizedStrings();switch(a){case"uncategorized-income":e="income",t=n.uncategorizedTransactionList.income.title;break;case"uncategorized-expense":e="expenses",t=n.common.texts.uncategorizedExpenses;break;case"miscategorized-expense":e="expenses",t=n.miscategorizedTransactionList.expense.title;break;case"miscategorized-income":e="income",t=n.miscategorizedTransactionList.income.title;break;case"missing-receipts":t=n.common.texts.receipts}return{accountType:e,title:t,subTitle:""}},Ue=(a,e,t)=>{const n=me();let c=me().startOf("month").subtract(11,"month");return t!=null&&a!=="missing-receipts"?t.add(1,"day").isBefore(c)?{dataAvailable:{startDate:t.add(1,"day"),endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}:(c=t.add(1,"day"),{dataAvailable:{startDate:c,endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}):{dataAvailable:re(5,e),initialTimeframeTick:{startDate:c,endDate:n}}},We=(a,e,t,n,c)=>{let o=e;return n==="missingReceipts"||c==null?a.startDate.isBefore(e.startDate,t)?o={startDate:a.startDate,endDate:e.endDate}:a.startDate.isAfter(e.endDate,t)?o={startDate:e.startDate,endDate:a.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(a)}`):o=a.startDate.isBefore(c,t)?{startDate:c.add(1,"day"),endDate:e.endDate}:{startDate:a.startDate,endDate:e.endDate},o},Ke=X((function(a,e){const t=Le(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:re(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=se(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Ye();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),L.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{dateRange:o}})),a(Se(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=de(t,e.tenantEmailDomain),c=R(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{scrollYOffset:t}}))}}}))(oe),Qe=ie((function({referrerType:a,...e}){const t=W(),n=q(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:d,accountIdEncoded:Y,classIdEncoded:v,timeframe:A,startDate:f,endDate:T,titleEncoded:b}=Q(),S=E(d??""),h=E(Y??""),I=E(v??""),x=E(b??""),F=g((r=>Be(r.transactionListState,h,S,I))),[P,O]=y.useState(!1),[j,z]=y.useState(void 0),u=g((r=>N(r))),C=u.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:l}=ne(),{isFeatureEnabled:m}=l(ce.isProjectsTransactionsEnabled),w=g((r=>Z(r)))&&m;let i;const G=Xe(S,h,I,A,f,T,x);if(G){const r={startDate:k(f,"YYYY-MM-DD"),endDate:k(T,"YYYY-MM-DD")},$=Ze(F?.dateRange,r);i={accountId:h,accountType:ee(S),classId:I,title:x,timeframe:A,period:$}}y.useEffect((()=>{P||i==null||(O(!0),L.trackTransactionList(i.accountId,void 0,a,i.title),c(Se(i.accountId,i.accountType,i.classId,i.period)))}),[P,i,c]);let B=i;i!=null&&j!=null&&(B={...i,period:j});const _=[d,Y,v,A,f,T,b].filter((r=>r!=null));return G&&B!=null?s.jsx(Ke,{firstMonthOfFY:C,tenantEmailDomain:o,location:n,navigate:t,showProjectField:w,selectedAccount:B,referrerType:a,onSelectedTimePeriodChange:r=>z(r),...e}):s.jsx(H,{to:Ye(_.length)})})),Ye=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Xe=(a,e,t,n,c,o,d)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&k(c,"YYYY-MM-DD").isValid()&&k(o,"YYYY-MM-DD").isValid()&&d!=null,Ze=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),et=X((function(a,e){const t=Oe(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:re(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=se(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??ve();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),L.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(Te({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{dateRange:o}})),a(he(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=de(t,e.tenantEmailDomain),c=R(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(Te({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{scrollYOffset:t}}))}}}))(oe),tt=ie((function({referrerType:a,...e}){const t=W(),n=q(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:d,accountIdEncoded:Y,projectIdEncoded:v,timeframe:A,startDate:f,endDate:T,titleEncoded:b}=Q(),S=E(d??""),h=E(Y??""),I=E(v??""),x=E(b??""),F=g((r=>Fe(r.transactionListState,h,S,I))),[P,O]=y.useState(!1),[j,z]=y.useState(void 0),u=g((r=>N(r))),C=u.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:l}=ne(),{isFeatureEnabled:m}=l(ce.isProjectsTransactionsEnabled),w=g((r=>Z(r)))&&m;let i;const G=at(S,h,I,A,f,T,x);if(G){const r={startDate:k(f,"YYYY-MM-DD"),endDate:k(T,"YYYY-MM-DD")},$=nt(F?.dateRange,r);i={accountId:h,accountType:ee(S),projectId:I,title:x,timeframe:A,period:$}}y.useEffect((()=>{P||i==null||(O(!0),L.trackTransactionList(i.accountId,void 0,a,i.title),c(he(i.accountId,i.accountType,i.projectId,i.period)))}),[P,i,c]);let B=i;i!=null&&j!=null&&(B={...i,period:j});const _=[d,Y,v,A,f,T,b].filter((r=>r!=null));return G&&B!=null?s.jsx(et,{firstMonthOfFY:C,tenantEmailDomain:o,location:n,navigate:t,showProjectField:w,selectedAccount:B,referrerType:a,onSelectedTimePeriodChange:r=>z(r),...e}):s.jsx(H,{to:ve(_.length)})})),ve=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},at=(a,e,t,n,c,o,d)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&k(c,"YYYY-MM-DD").isValid()&&k(o,"YYYY-MM-DD").isValid()&&d!=null,nt=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),ct=X((function(a,e){const t=Ge(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&we(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:re(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:te(a)}}),(function(a,e){return{onBackClick:()=>{const t=se(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??be();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),L.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(De({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{dateRange:o}})),a(ge(e.selectedAccount.accountId,e.selectedAccount.accountType,p(o))),e.onSelectedTimePeriodChange(p(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=de(t,e.tenantEmailDomain),c=R(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(De({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{scrollYOffset:t}}))},onStatementPageIconClick:()=>{const t=it(e.tenantEmailDomain),n=R(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}}))(oe),ye=ie((function({referrerType:a,...e}){const t=W(),n=q(),c=K(),{tenantEmailDomain:o,accountTypeEncoded:d,accountIdEncoded:Y,timeframe:v,startDate:A,endDate:f,titleEncoded:T,excludeSubAccounts:b}=Q(),S=E(d??""),h=E(Y??""),I=E(T??""),x=!(b!=null&&b==="exclude_subaccounts"),F=g((D=>ze(D.transactionListState,h,S))),[P,O]=y.useState(!1),[j,z]=y.useState(void 0),u=g((D=>N(D))),C=u.company?.featuresActivationInfo.connectedAccountProvider==="unit",l=u.company?.companyInfo.firstMonthOfFY??1;let m;const w=ot(S,h,v,A,f,I);if(w){const D={startDate:k(A,"YYYY-MM-DD"),endDate:k(f,"YYYY-MM-DD")},le=st(F?.dateRange,D);m={accountId:h,accountType:ee(S),title:I,timeframe:v,period:le}}let i=m;m!=null&&j!=null&&(i={...m,period:j});const{useFeatureGate:G}=ne(),B=y.useCallback(((D,le)=>{if(o==null)return;const ue=D.url.split(`/${o}/`)[1];if(ue==null)return;const[je,Ee]=ue.split("?"),U=new URLSearchParams(Ee??"");U.set("view","full"),U.set("thread_id",le),U.set("entity_type",D.entityType);const xe=R(n.state?.pathnameStackToGoBack,n.pathname);t(`/${o}/${je}?${U.toString()}`,{state:{pathnameStackToGoBack:xe}})}),[t,o,n.state,n.pathname]),{isFeatureEnabled:_}=G(ce.isProjectsTransactionsEnabled),r=g((D=>Z(D)))&&_,{areTenantIdsInSync:$}=Re();y.useEffect((()=>{!P&&m!=null&&$&&(O(!0),L.trackTransactionList(m.accountId,void 0,a,m.title),c(ge(m.accountId,m.accountType,m.period,void 0,!1,x)))}),[P,m,c,$]);const Pe=[d,Y,v,A,f,T].filter((D=>D!=null));return w&&i!=null?s.jsx(ct,{firstMonthOfFY:l,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:C,onCommentThreadClick:B,showProjectField:r,selectedAccount:i,referrerType:a,onSelectedTimePeriodChange:D=>z(D),...e}):s.jsx(H,{to:be(Pe.length)})})),be=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},ot=(a,e,t,n,c,o)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&(t==="month"||t==="quarter")&&k(n,"YYYY-MM-DD").isValid()&&k(c,"YYYY-MM-DD").isValid()&&o!=null,st=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?p(a):p(e),it=a=>`/${a}/transactions/${$e}/statements`;function Ct(){const a=q().state?.referrer,e=g((n=>n.expenseAutomationViewState.selectedPeriodByTenantId))[g((n=>N(n))).tenantId],t=_e();return s.jsxs(Me,{children:[s.jsx(M,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:s.jsx(ye,{referrerType:a})}),s.jsx(M,{path:"/zeni-clearing-account/statements",element:s.jsx(Je,{})}),s.jsx(M,{path:"/*",element:s.jsx(ye,{referrerType:a})}),s.jsx(M,{path:"/uncategorized-income/*",element:s.jsx(V,{})}),s.jsx(M,{path:"/uncategorized-expense/*",element:s.jsx(V,{})}),s.jsx(M,{path:"/miscategorized-income/*",element:s.jsx(V,{})}),s.jsx(M,{path:"/miscategorized-expense/*",element:s.jsx(V,{})}),s.jsx(M,{path:"/missing-receipts/*",element:t?s.jsx(H,{to:`../../month_end_close_checks/review/missing_receipts/${e.month}-${e.year}`}):s.jsx(V,{})}),s.jsx(M,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(Qe,{referrerType:a})}),s.jsx(M,{path:"/by-project/:accountTypeEncoded/:accountIdEncoded/:projectIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(tt,{referrerType:a})})]})}export{Ct as default};
@@ -1,4 +1,4 @@
1
- import{j as e}from"./liveblocks-D0aPwrEa.js";import{h as L,g as P,u as U,i as M,j as y,N as D,l as V,n as xe,o as k}from"./core-CJLU9TYG.js";import{cw as N,fI as E,ZL as B,OT as ae,OA as G,OB as ne,ZN as Ie,OW as Te,ZJ as we,ZK as se,ZZ as Ce,MX as ke,Cx as je,ZP as Ae,P1 as be,ZM as oe,de as H,H2 as re,d$ as ve,e0 as Ee,a08 as De,a09 as Le,OC as Pe,a0a as Ue,OD as Be,OM as Fe,bq as Oe,bK as Re,cH as Me,bL as Ve,cv as Ne,bu as Ze,UJ as _e,cu as $e}from"./zeni-epic-state-DN1FMHPE.js";import{V as Z,h as ze,z as v,a6 as _,j as A,d4 as Ge,d5 as He,d6 as z,$ as q,ao as qe,aq as Ke,W as ie,A as R,a9 as We,a5 as Je,d7 as Xe,ac as K,p as Ye,d8 as Qe,a2 as W,d9 as et,ag as tt,Y,da as at,g as nt}from"./index-Bac0_7La.js";import{u as st,D as ot,n as O,S as rt}from"./mui-BTK8WNHw.js";import it from"./NotFoundScreen-DVwEy2Nc.js";import{S as Q}from"./SetupPagesScreen-RWtDE1DO.js";import{a as p}from"./sentry-Bh_Qiwsv.js";import{u as ct}from"./useAskAiCfoHostNavButtonProps-CkY97uj-.js";import{u as lt}from"./useInitialThreadRequest-Byaj949Q.js";import{M as ce}from"./MobileAppDrawer-Gq4sfjI3.js";import{F as ut}from"./FeaturePreviewScreen-ae3ytT_c.js";import{a as ee}from"./analyticsHelper-Cb3EUyBw.js";import"./recharts-BEqM6zw3.js";import"./analytics-K5kCmXhx.js";import"./plaid-BWaZTH4h.js";import"./dnd-BvQSnOXX.js";import"./stripe-cKAAJElX.js";import"./lottie-CRpndHoM.js";import"./lexical-G-6YJUO1.js";import"./pdf-BlY1D9V4.js";import"./utils-DnIJUuGb.js";import"./BusinessVerificationPageScreen-BSguq-g2.js";import"./routePaths-CFVcdQVU.js";import"./InboxNotificationsProvider-B5M0qdMl.js";import"./useTaskManagerAccess-CUawSS4F.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="b6507afb-e2d0-4c01-983f-515946a2732f",t._sentryDebugIdIdentifier="sentry-dbid-b6507afb-e2d0-4c01-983f-515946a2732f")}catch{}})();const dt=V((function(t,a){const{companyId:n}=a;return{treasurySetupView:B(t,n),analytics:A}}),(function(t,a){const{navigate:n,analytics:r,treasurySetupView:i}=a;return{onBackClick:()=>{n("../")},onNextClick:()=>{const o=i.fundAllocationLocalData;r.trackTreasuryPortfolioConfirm(o.riskScore,ee(o)),t(Te(!0))},onUpdateFundAllocation:o=>{r.trackTreasuryAllocationAction("update",ee(o)),t(Ie(o))}}}))(Ge);function pt(){const t=L(),a=P(),n=U(),{tenantEmailDomain:r}=M(),i=Z(),o=y((w=>w.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState)),m=ze(o),s=N(i?.loggedInUserRoleMap),[d,c]=p.useState(!1),[S,I]=p.useState(!1),[l,u]=p.useState(!1),x=y((w=>E(w))),f=v.getSignedInUserTenant(r)?.companyId??x.companyId,C=v.getSignedInUser(),h=y((w=>B(w,f))),g=y((w=>w.treasurySetupViewState.fetchState)),j=y((w=>w.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),T=y((w=>w.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState));if(C==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(p.useEffect((()=>{d||g!=="Not-Started"||f==null||(c(!0),n(ae(f,!0,!1)))}),[d,g,f,n]),p.useEffect((()=>{l||T!=="Not-Started"||f==null||(u(!0),n(G()))}),[l,T,f,n]),p.useEffect((()=>{S||j!=="Not-Started"||f==null||(I(!0),n(ne()))}),[S,j,f,n]),p.useEffect((()=>{m==="In-Progress"&&o==="Completed"&&t("../")}),[m,o,t]),x.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1)return e.jsx(D,{to:"../promo"});const F=x.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||g!=="Completed";return e.jsxs(e.Fragment,{children:[!F&&e.jsx(_,{analytics:A,onLoad:()=>{}}),e.jsx(dt,{navigate:t,location:a,companyId:f,isEditMode:!0,isLoading:F,isReadOnly:!s,treasurySetupView:h,analytics:A})]})}const mt=V((function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:Ce(t,n,"zeni_treasury","treasury_setup").plaidConnectionDetails,treasurySetupView:B(t,n)}}),(function(t,a){const{navigate:n,transferDetails:r,treasurySetupView:i}=a,o=r.treasuryTransferMoneyLocalData,m=i.fundAllocationLocalData;return{onCancelClick:()=>{z(a.analytics,"cancel",o,m,"Transfer"),t(se()),n("../")},onTransferClick:()=>{z(a.analytics,"confirm",o,m,"Transfer"),t(be())},onSaveChangesToLocalStore:s=>{t(Ae(s))},onFetchLinkTokenClick:s=>{t(je("treasury_setup",s))},onEstablishConnectionClick:s=>{t(ke(s,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}}))(He),ft=({isFirstTransfer:t,isTransactionsLoaded:a})=>{const n=L(),{tenantEmailDomain:r}=M(),i=U(),[o,m]=p.useState(!1),[s,d]=p.useState(!1),[c,S]=p.useState(!1),[I,l]=p.useState(!1),u=y((T=>T.treasurySetupViewState.fetchState)),x=y((T=>T.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState)),f=y((T=>T.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),C=y((T=>E(T))),h=v.getSignedInUserTenant(r)?.companyId??C.companyId,g=y((T=>we(T))),j=y((T=>B(T,h)));if(v.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return p.useEffect((()=>{s||u!=="Not-Started"||h==null||(d(!0),i(ae(h,!0,!1)))}),[s,u,h,i]),p.useEffect((()=>{c||x!=="Not-Started"||h==null||(S(!0),i(G()))}),[c,x,h,i]),p.useEffect((()=>{I||f!=="Not-Started"||h==null||(l(!0),i(ne()))}),[I,f,h,i]),e.jsxs(e.Fragment,{children:[e.jsx(_,{analytics:A,onLoad:()=>{}}),e.jsx(mt,{analytics:A,navigate:n,transferDetails:g,onAnotherTransferClick:()=>{m(!1),i(se())},currentTenant:C,treasurySetupView:j,showReviewContent:o,maxInsuredAmount:5e5,onReviewClick:()=>{z(A,"review",g.treasuryTransferMoneyLocalData,j.fundAllocationLocalData,"Transfer"),m(!0)},isFirstTransfer:t,isTransactionsLoaded:a,setShowReviewContent:m,onBackClick:()=>{}})]})},yt=O.div`
1
+ import{j as e}from"./liveblocks-CZZ7TQJf.js";import{h as L,g as P,u as U,i as M,j as y,N as D,l as V,n as xe,o as k}from"./core-DtSa7_zJ.js";import{cw as N,fI as E,ZL as B,OT as ae,OA as G,OB as ne,ZN as Ie,OW as Te,ZJ as we,ZK as se,ZZ as Ce,MX as ke,Cx as je,ZP as Ae,P1 as be,ZM as oe,de as H,H2 as re,d$ as ve,e0 as Ee,a08 as De,a09 as Le,OC as Pe,a0a as Ue,OD as Be,OM as Fe,bq as Oe,bK as Re,cH as Me,bL as Ve,cv as Ne,bu as Ze,UJ as _e,cu as $e}from"./zeni-epic-state-DIQk-W8f.js";import{M as Z,j as ze,z as v,a6 as _,k as A,d4 as Ge,d5 as He,d6 as z,$ as q,ao as qe,aq as Ke,W as ie,c as R,a9 as We,a5 as Je,d7 as Xe,ac as K,p as Ye,d8 as Qe,a2 as W,d9 as et,ag as tt,Y,da as at,g as nt}from"./index-CJhgQFRI.js";import{u as st,D as ot,n as O,S as rt}from"./mui-hHF2bYsV.js";import it from"./NotFoundScreen-DHpPkJUq.js";import{S as Q}from"./SetupPagesScreen-C70xRnVo.js";import{a as p}from"./sentry-7oL5NFUY.js";import{u as ct}from"./useAskAiCfoHostNavButtonProps-C0sjuZuZ.js";import{u as lt}from"./useInitialThreadRequest-Cf6qZ2C0.js";import{M as ce}from"./MobileAppDrawer-D9iwyW6E.js";import{F as ut}from"./FeaturePreviewScreen-kue3YUvW.js";import{a as ee}from"./analyticsHelper-C8wUoU5C.js";import"./recharts-DHYb1iJa.js";import"./analytics-wUVBNE2n.js";import"./plaid-l93gkere.js";import"./dnd-BRHUZ8LO.js";import"./stripe-cKAAJElX.js";import"./lottie-_8fQYf62.js";import"./lexical-CV0PpHfb.js";import"./pdf-DcTPEGUQ.js";import"./utils-D3PNq8pk.js";import"./BusinessVerificationPageScreen-CVijkaE8.js";import"./routePaths-66PPW-xS.js";import"./InboxNotificationsProvider-DrljtAmN.js";import"./useTaskManagerAccess-zRd8th0q.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="c3bf8edb-270e-4307-8c61-05fb23f4a10f",t._sentryDebugIdIdentifier="sentry-dbid-c3bf8edb-270e-4307-8c61-05fb23f4a10f")}catch{}})();const dt=V((function(t,a){const{companyId:n}=a;return{treasurySetupView:B(t,n),analytics:A}}),(function(t,a){const{navigate:n,analytics:r,treasurySetupView:i}=a;return{onBackClick:()=>{n("../")},onNextClick:()=>{const o=i.fundAllocationLocalData;r.trackTreasuryPortfolioConfirm(o.riskScore,ee(o)),t(Te(!0))},onUpdateFundAllocation:o=>{r.trackTreasuryAllocationAction("update",ee(o)),t(Ie(o))}}}))(Ge);function pt(){const t=L(),a=P(),n=U(),{tenantEmailDomain:r}=M(),i=Z(),o=y((w=>w.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState)),m=ze(o),s=N(i?.loggedInUserRoleMap),[d,c]=p.useState(!1),[S,I]=p.useState(!1),[l,u]=p.useState(!1),x=y((w=>E(w))),f=v.getSignedInUserTenant(r)?.companyId??x.companyId,C=v.getSignedInUser(),h=y((w=>B(w,f))),g=y((w=>w.treasurySetupViewState.fetchState)),j=y((w=>w.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),T=y((w=>w.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState));if(C==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(p.useEffect((()=>{d||g!=="Not-Started"||f==null||(c(!0),n(ae(f,!0,!1)))}),[d,g,f,n]),p.useEffect((()=>{l||T!=="Not-Started"||f==null||(u(!0),n(G()))}),[l,T,f,n]),p.useEffect((()=>{S||j!=="Not-Started"||f==null||(I(!0),n(ne()))}),[S,j,f,n]),p.useEffect((()=>{m==="In-Progress"&&o==="Completed"&&t("../")}),[m,o,t]),x.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1)return e.jsx(D,{to:"../promo"});const F=x.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||g!=="Completed";return e.jsxs(e.Fragment,{children:[!F&&e.jsx(_,{analytics:A,onLoad:()=>{}}),e.jsx(dt,{navigate:t,location:a,companyId:f,isEditMode:!0,isLoading:F,isReadOnly:!s,treasurySetupView:h,analytics:A})]})}const mt=V((function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:Ce(t,n,"zeni_treasury","treasury_setup").plaidConnectionDetails,treasurySetupView:B(t,n)}}),(function(t,a){const{navigate:n,transferDetails:r,treasurySetupView:i}=a,o=r.treasuryTransferMoneyLocalData,m=i.fundAllocationLocalData;return{onCancelClick:()=>{z(a.analytics,"cancel",o,m,"Transfer"),t(se()),n("../")},onTransferClick:()=>{z(a.analytics,"confirm",o,m,"Transfer"),t(be())},onSaveChangesToLocalStore:s=>{t(Ae(s))},onFetchLinkTokenClick:s=>{t(je("treasury_setup",s))},onEstablishConnectionClick:s=>{t(ke(s,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}}))(He),ft=({isFirstTransfer:t,isTransactionsLoaded:a})=>{const n=L(),{tenantEmailDomain:r}=M(),i=U(),[o,m]=p.useState(!1),[s,d]=p.useState(!1),[c,S]=p.useState(!1),[I,l]=p.useState(!1),u=y((T=>T.treasurySetupViewState.fetchState)),x=y((T=>T.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState)),f=y((T=>T.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),C=y((T=>E(T))),h=v.getSignedInUserTenant(r)?.companyId??C.companyId,g=y((T=>we(T))),j=y((T=>B(T,h)));if(v.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return p.useEffect((()=>{s||u!=="Not-Started"||h==null||(d(!0),i(ae(h,!0,!1)))}),[s,u,h,i]),p.useEffect((()=>{c||x!=="Not-Started"||h==null||(S(!0),i(G()))}),[c,x,h,i]),p.useEffect((()=>{I||f!=="Not-Started"||h==null||(l(!0),i(ne()))}),[I,f,h,i]),e.jsxs(e.Fragment,{children:[e.jsx(_,{analytics:A,onLoad:()=>{}}),e.jsx(mt,{analytics:A,navigate:n,transferDetails:g,onAnotherTransferClick:()=>{m(!1),i(se())},currentTenant:C,treasurySetupView:j,showReviewContent:o,maxInsuredAmount:5e5,onReviewClick:()=>{z(A,"review",g.treasuryTransferMoneyLocalData,j.fundAllocationLocalData,"Transfer"),m(!0)},isFirstTransfer:t,isTransactionsLoaded:a,setShowReviewContent:m,onBackClick:()=>{}})]})},yt=O.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as o}from"./liveblocks-D0aPwrEa.js";import{a as u}from"./sentry-Bh_Qiwsv.js";import{h as M,u as G,i as z,j as f,l as $,g as q,n as We,o as P,N as U}from"./core-CJLU9TYG.js";import{Wc as gt,Wd as Ze,R_ as et,We as vt,fI as L,h2 as ge,Wf as Tt,cF as xt,Wg as bt,F$ as yt,Wh as wt,Wi as oe,Wj as te,Wk as ve,TA as ue,TB as ke,Gf as pe,Tz as he,G2 as tt,FB as Pe,Wl as It,TC as Y,m3 as me,Wm as je,Fv as Ct,Wn as Dt,Wo as Et,Wp as _e,Wq as Ve,Wr as Ae,Ws as Re,G9 as Te,Wt as nt,FS as at,Wu as Ft,Wv as kt,Ww as Pt,Wx as jt,Wy as _t,Wz as Vt,WA as At,WB as Rt,CJ as Lt,CR as Ut,CK as Bt,SG as we,WC as Ot,WD as Wt,lj as Ie,br as Mt,WE as $t,WF as Gt,n1 as Nt,na as zt,SF as Ce,bF as Me,WG as ot,Sg as st,WH as Yt,WI as Jt,WJ as Kt,nc as qt,WK as $e,WL as Ge,WM as Ne,WN as ze,WO as Xt,n8 as Ht,WP as Qt,nb as Zt,WQ as en,WR as it,T0 as rt,mr as tn,WS as nn,WT as De,WU as dt,S_ as lt,IJ as an,WV as on,WW as sn,mL as ct,WX as rn,WY as dn,Tc as ln,vn as cn,WZ as ut,W_ as Ye,T9 as Ee,W$ as Je,X0 as un,Te as pn,X1 as hn,X2 as mn,X3 as fn,X4 as Sn,X5 as gn,vq as vn,X6 as Tn,TD as xn,Vb as bn,ST as Fe,ie as yn,Vd as wn,Vc as In,ic as Cn,X7 as Dn,X8 as En,IO as Fn,X9 as kn,Xa as Pn,Xb as jn,Xc as _n,mv as Vn,bn as An,e0 as Rn,d$ as Ln}from"./zeni-epic-state-DN1FMHPE.js";import{$ as ne,a9 as Le,W as X,A as W,z as R,a5 as Un,aK as Bn,j,U as Ue,Z as xe,at as ee,aq as se,aL as On,aM as pt,ao as Wn,a6 as Se,aN as Mn,p as K,V as $n,G as ht,aO as Gn,ac as mt,a2 as Nn,h as Ke,aP as zn,E as J,a7 as Yn,ad as ft,ae as Jn,aQ as Kn,aR as qn,N as Be,aS as Xn,aT as Hn,a1 as Qn,aU as Zn,aV as ea}from"./index-Bac0_7La.js";import{u as ta,D as na,n as B,S as St}from"./mui-BTK8WNHw.js";import{t as aa,A as oa}from"./AddressScreen-Djrv0IMM.js";import fe from"./NotFoundScreen-DVwEy2Nc.js";import{F as sa}from"./FeaturePreviewScreen-ae3ytT_c.js";import{S as ia,a as ra,J as da,b as la,c as ca}from"./ScheduleDetailsPrepaidExpensesScreen-D_ls3-hC.js";import{u as ie}from"./useAskAiCfoHostNavButtonProps-CkY97uj-.js";import{M as re}from"./MobileAppDrawer-Gq4sfjI3.js";import{v as Oe,c as ua,d as pa}from"./routePaths-CFVcdQVU.js";import{D as ha}from"./DrawerScreen-Du8hsTKk.js";import{a as ma,m as fa}from"./accountMappingHelper-CDFl9gNv.js";import"./recharts-BEqM6zw3.js";import"./analytics-K5kCmXhx.js";import"./plaid-BWaZTH4h.js";import"./dnd-BvQSnOXX.js";import"./stripe-cKAAJElX.js";import"./lottie-CRpndHoM.js";import"./lexical-G-6YJUO1.js";import"./pdf-BlY1D9V4.js";import"./utils-DnIJUuGb.js";import"./pathToGoBack-DSav9J7K.js";import"./InboxNotificationsProvider-B5M0qdMl.js";import"./useTaskManagerAccess-CUawSS4F.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]="b248982d-5705-4ba0-bdc2-a3d3b51aaae7",e._sentryDebugIdIdentifier="sentry-dbid-b248982d-5705-4ba0-bdc2-a3d3b51aaae7")}catch{}})();const Sa={drawerLeftMargin:new Le(0,0,100,200)},ga=$((function(e,a){const{jeScheduledTransaction:s,selectedJERow:t,scheduleType:n,isVendorBulkUpdateOnTransactionEnabled:i}=a,{scheduleDetailsLocalData:l,updateStatus:p}=Ze(e,a.scheduleType),h=L(e),v=l[n].jeScheduleDetails[t].jeLink,m=v.type==="recommended"?v.recommendedTransactionID:v.transactionDetailID,r=m!=null?Tt(e,m):void 0,d=R.getSignedInUser(),c=e.tenantState.currentTenantId,T={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:h.tenantId??c},x=h?.company?.companyInfo?.firstMonthOfFY??1;return{jeScheduledTransaction:s,transactionDetail:r,localData:l[n].jeScheduleDetails[t],saveStatus:p.fetchState,authParams:T,isVendorBulkUpdateOnTransactionEnabled:i,firstMonthOfFY:x,isDisabled:p.fetchState==="In-Progress"?"readonly":void 0,analytics:j,qboAppUrl:xt(Ue.qboRedirectionUrl)}}),(function(e,a){const{selectedJERow:s,jeScheduleDetailId:t,navigate:n}=a;return{onUpdateLocalData:i=>{const l=i.linkJETransaction.qboURL;l!=null&&e(wt({scheduleType:a.scheduleType,jeScheduleDetailId:t,rowId:s,jeLink:l}))},onFetchTransactionClick:i=>{e(et(i))},onSaveClick:()=>{e(yt(a.scheduleType,t))},onBackClick:()=>{n("..",{relative:"path"})},onCancelClick:()=>{const i=a.jeScheduledTransaction.scheduledJournalEntry[s];e(bt({scheduleType:a.scheduleType,jeScheduleDetailId:t,rowId:s,originalScheduledJE:i})),n("..",{relative:"path"})}}}))(Bn),va=()=>{const e=ta(),a=M(),s=G(),{scheduleDetailId:t}=z(),n=ne(),i=Sa.drawerLeftMargin.valuePx(n),{scheduleType:l}=z(),{useFeatureGate:p}=X(),{isFeatureEnabled:h}=p(W.isVendorBulkUpdateOnTransactionEnabled),v=gt(l)??"prepaid_expenses",[m,r]=u.useState(!1);if(R.getSignedInUser()==null)throw Error("Can't access Account detail page without signing in...");if(t==null)throw Error("Invalid Schedule Detail Id");const d=f((b=>Ze(b,v)));u.useEffect((()=>{d.fetchState==="Not-Started"&&a("..",{relative:"path"})}),[]);const c=d.selectedJELinkRowIndex,T=c!=null?d.scheduleDetailsLocalData[v].jeScheduleDetails[c]?.jeLink:null,x=T?.type==="recommended"?T.recommendedTransactionID:T?.transactionDetailID;u.useEffect((()=>{x!=null&&s(et(x))}),[]),u.useEffect((()=>{T?.type==="recommended"&&m===!1&&c!=null&&(r(!0),s(vt({scheduleType:v,jeScheduleDetailId:t,rowId:c})))}));const g=f((b=>L(b))),y=f((b=>ge(b,g.companyId)));return o.jsx(na,{anchor:"right",open:!0,PaperProps:{style:{width:`calc(100% - ${i})`,boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:e.colors.black,opacity:.75,cursor:"pointer"}}},onClose:()=>a("..",{relative:"path"}),children:o.jsx(Ta,{onClick:b=>b.stopPropagation(),children:d.fetchState!=="Completed"||d.selectedJEScheduleTransaction==null||c==null?o.jsx(Un,{fetchState:d.fetchState}):o.jsx(ga,{scheduleType:v,jeScheduleDetailId:t,selectedJERow:c,jeScheduledTransaction:d.selectedJEScheduleTransaction,isCOTEnabled:!1,navigate:a,scheduleTab:v,controllerUserDetails:y,isVendorBulkUpdateOnTransactionEnabled:h})})})},Ta=B(St)`
1
+ import{j as o}from"./liveblocks-CZZ7TQJf.js";import{a as u}from"./sentry-7oL5NFUY.js";import{h as M,u as G,i as z,j as f,l as $,g as q,n as We,o as P,N as U}from"./core-DtSa7_zJ.js";import{Wc as gt,Wd as Ze,R_ as et,We as vt,fI as L,h2 as ge,Wf as Tt,cF as xt,Wg as bt,F$ as yt,Wh as wt,Wi as oe,Wj as te,Wk as ve,TA as ue,TB as ke,Gf as pe,Tz as he,G2 as tt,FB as Pe,Wl as It,TC as Y,m3 as me,Wm as je,Fv as Ct,Wn as Dt,Wo as Et,Wp as _e,Wq as Ve,Wr as Ae,Ws as Re,G9 as Te,Wt as nt,FS as at,Wu as Ft,Wv as kt,Ww as Pt,Wx as jt,Wy as _t,Wz as Vt,WA as At,WB as Rt,CJ as Lt,CR as Ut,CK as Bt,SG as we,WC as Ot,WD as Wt,lj as Ie,br as Mt,WE as $t,WF as Gt,n1 as Nt,na as zt,SF as Ce,bF as Me,WG as ot,Sg as st,WH as Yt,WI as Jt,WJ as Kt,nc as qt,WK as $e,WL as Ge,WM as Ne,WN as ze,WO as Xt,n8 as Ht,WP as Qt,nb as Zt,WQ as en,WR as it,T0 as rt,mr as tn,WS as nn,WT as De,WU as dt,S_ as lt,IJ as an,WV as on,WW as sn,mL as ct,WX as rn,WY as dn,Tc as ln,vn as cn,WZ as ut,W_ as Ye,T9 as Ee,W$ as Je,X0 as un,Te as pn,X1 as hn,X2 as mn,X3 as fn,X4 as Sn,X5 as gn,vq as vn,X6 as Tn,TD as xn,Vb as bn,ST as Fe,ie as yn,Vd as wn,Vc as In,ic as Cn,X7 as Dn,X8 as En,IO as Fn,X9 as kn,Xa as Pn,Xb as jn,Xc as _n,mv as Vn,bn as An,e0 as Rn,d$ as Ln}from"./zeni-epic-state-DIQk-W8f.js";import{$ as ne,a9 as Le,W as X,c as W,z as R,a5 as Un,aK as Bn,k as j,V as Ue,Z as xe,at as ee,aq as se,aL as On,aM as pt,ao as Wn,a6 as Se,aN as Mn,p as K,M as $n,G as ht,aO as Gn,ac as mt,a2 as Nn,j as Ke,aP as zn,I as J,a7 as Yn,ad as ft,ae as Jn,aQ as Kn,aR as qn,R as Be,aS as Xn,aT as Hn,a1 as Qn,aU as Zn,aV as ea}from"./index-CJhgQFRI.js";import{u as ta,D as na,n as B,S as St}from"./mui-hHF2bYsV.js";import{t as aa,A as oa}from"./AddressScreen-DWZzKMEw.js";import fe from"./NotFoundScreen-DHpPkJUq.js";import{F as sa}from"./FeaturePreviewScreen-kue3YUvW.js";import{S as ia,a as ra,J as da,b as la,c as ca}from"./ScheduleDetailsPrepaidExpensesScreen-DKDzHrf0.js";import{u as ie}from"./useAskAiCfoHostNavButtonProps-C0sjuZuZ.js";import{M as re}from"./MobileAppDrawer-D9iwyW6E.js";import{v as Oe,c as ua,d as pa}from"./routePaths-66PPW-xS.js";import{D as ha}from"./DrawerScreen-DI4gxsFO.js";import{a as ma,m as fa}from"./accountMappingHelper-PEq3iFwb.js";import"./recharts-DHYb1iJa.js";import"./analytics-wUVBNE2n.js";import"./plaid-l93gkere.js";import"./dnd-BRHUZ8LO.js";import"./stripe-cKAAJElX.js";import"./lottie-_8fQYf62.js";import"./lexical-CV0PpHfb.js";import"./pdf-DcTPEGUQ.js";import"./utils-D3PNq8pk.js";import"./pathToGoBack-sBV6PqT4.js";import"./InboxNotificationsProvider-DrljtAmN.js";import"./useTaskManagerAccess-zRd8th0q.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]="5cc4acfa-6a8a-430c-8a3a-7b3339ca61b6",e._sentryDebugIdIdentifier="sentry-dbid-5cc4acfa-6a8a-430c-8a3a-7b3339ca61b6")}catch{}})();const Sa={drawerLeftMargin:new Le(0,0,100,200)},ga=$((function(e,a){const{jeScheduledTransaction:s,selectedJERow:t,scheduleType:n,isVendorBulkUpdateOnTransactionEnabled:i}=a,{scheduleDetailsLocalData:l,updateStatus:p}=Ze(e,a.scheduleType),h=L(e),v=l[n].jeScheduleDetails[t].jeLink,m=v.type==="recommended"?v.recommendedTransactionID:v.transactionDetailID,r=m!=null?Tt(e,m):void 0,d=R.getSignedInUser(),c=e.tenantState.currentTenantId,T={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:h.tenantId??c},x=h?.company?.companyInfo?.firstMonthOfFY??1;return{jeScheduledTransaction:s,transactionDetail:r,localData:l[n].jeScheduleDetails[t],saveStatus:p.fetchState,authParams:T,isVendorBulkUpdateOnTransactionEnabled:i,firstMonthOfFY:x,isDisabled:p.fetchState==="In-Progress"?"readonly":void 0,analytics:j,qboAppUrl:xt(Ue.qboRedirectionUrl)}}),(function(e,a){const{selectedJERow:s,jeScheduleDetailId:t,navigate:n}=a;return{onUpdateLocalData:i=>{const l=i.linkJETransaction.qboURL;l!=null&&e(wt({scheduleType:a.scheduleType,jeScheduleDetailId:t,rowId:s,jeLink:l}))},onFetchTransactionClick:i=>{e(et(i))},onSaveClick:()=>{e(yt(a.scheduleType,t))},onBackClick:()=>{n("..",{relative:"path"})},onCancelClick:()=>{const i=a.jeScheduledTransaction.scheduledJournalEntry[s];e(bt({scheduleType:a.scheduleType,jeScheduleDetailId:t,rowId:s,originalScheduledJE:i})),n("..",{relative:"path"})}}}))(Bn),va=()=>{const e=ta(),a=M(),s=G(),{scheduleDetailId:t}=z(),n=ne(),i=Sa.drawerLeftMargin.valuePx(n),{scheduleType:l}=z(),{useFeatureGate:p}=X(),{isFeatureEnabled:h}=p(W.isVendorBulkUpdateOnTransactionEnabled),v=gt(l)??"prepaid_expenses",[m,r]=u.useState(!1);if(R.getSignedInUser()==null)throw Error("Can't access Account detail page without signing in...");if(t==null)throw Error("Invalid Schedule Detail Id");const d=f((b=>Ze(b,v)));u.useEffect((()=>{d.fetchState==="Not-Started"&&a("..",{relative:"path"})}),[]);const c=d.selectedJELinkRowIndex,T=c!=null?d.scheduleDetailsLocalData[v].jeScheduleDetails[c]?.jeLink:null,x=T?.type==="recommended"?T.recommendedTransactionID:T?.transactionDetailID;u.useEffect((()=>{x!=null&&s(et(x))}),[]),u.useEffect((()=>{T?.type==="recommended"&&m===!1&&c!=null&&(r(!0),s(vt({scheduleType:v,jeScheduleDetailId:t,rowId:c})))}));const g=f((b=>L(b))),y=f((b=>ge(b,g.companyId)));return o.jsx(na,{anchor:"right",open:!0,PaperProps:{style:{width:`calc(100% - ${i})`,boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:e.colors.black,opacity:.75,cursor:"pointer"}}},onClose:()=>a("..",{relative:"path"}),children:o.jsx(Ta,{onClick:b=>b.stopPropagation(),children:d.fetchState!=="Completed"||d.selectedJEScheduleTransaction==null||c==null?o.jsx(Un,{fetchState:d.fetchState}):o.jsx(ga,{scheduleType:v,jeScheduleDetailId:t,selectedJERow:c,jeScheduledTransaction:d.selectedJEScheduleTransaction,isCOTEnabled:!1,navigate:a,scheduleTab:v,controllerUserDetails:y,isVendorBulkUpdateOnTransactionEnabled:h})})})},Ta=B(St)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
@@ -1,4 +1,4 @@
1
- import{j as o}from"./liveblocks-D0aPwrEa.js";import{a as f}from"./sentry-Bh_Qiwsv.js";import{t as u,u as b,j as h,N as y}from"./core-CJLU9TYG.js";import{U$ as I,gl as w,JX as j}from"./zeni-epic-state-DN1FMHPE.js";import{z as l,a5 as x,ad as S,ae as D}from"./index-Bac0_7La.js";import{n as c}from"./mui-BTK8WNHw.js";import"./recharts-BEqM6zw3.js";import"./analytics-K5kCmXhx.js";import"./plaid-BWaZTH4h.js";import"./dnd-BvQSnOXX.js";import"./stripe-cKAAJElX.js";import"./lottie-CRpndHoM.js";import"./lexical-G-6YJUO1.js";import"./pdf-BlY1D9V4.js";import"./utils-DnIJUuGb.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7cbf33b4-be19-4cd8-a71b-e9b7d244da8b",e._sentryDebugIdIdentifier="sentry-dbid-7cbf33b4-be19-4cd8-a71b-e9b7d244da8b")}catch{}})();const A=()=>{const[e]=u(),t=e.get("code")??"",s=e.get("state")??"",g=e.get("profileId")??"",[n,p]=f.useState(!1),a=b(),i=h((m=>I(m))),r=l.getSignedInUser(),d=l.getSignedInUserTenantWithId(s);if(r==null||d==null)return o.jsx(y,{to:"/signin/auth",replace:!0});if(r==null)throw Error("Can't access this page without signing in...");return w(r.userId,r.zeniSessionId,d?.tenantId),f.useEffect((()=>{n||(p(!0),a(j(t,g,s)))}),[n,a]),i.fetchState==="Error"?o.jsx(E,{children:o.jsx(_,{children:i.error?.message??""})}):(i.fetchState==="Completed"&&window.close(),o.jsx(x,{fetchState:"In-Progress"}))},E=c.div`
1
+ import{j as o}from"./liveblocks-CZZ7TQJf.js";import{a as f}from"./sentry-7oL5NFUY.js";import{t as u,u as b,j as h,N as y}from"./core-DtSa7_zJ.js";import{U$ as I,gl as w,JX as j}from"./zeni-epic-state-DIQk-W8f.js";import{z as l,a5 as x,ad as S,ae as D}from"./index-CJhgQFRI.js";import{n as c}from"./mui-hHF2bYsV.js";import"./recharts-DHYb1iJa.js";import"./analytics-wUVBNE2n.js";import"./plaid-l93gkere.js";import"./dnd-BRHUZ8LO.js";import"./stripe-cKAAJElX.js";import"./lottie-_8fQYf62.js";import"./lexical-CV0PpHfb.js";import"./pdf-DcTPEGUQ.js";import"./utils-D3PNq8pk.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7cbf33b4-be19-4cd8-a71b-e9b7d244da8b",e._sentryDebugIdIdentifier="sentry-dbid-7cbf33b4-be19-4cd8-a71b-e9b7d244da8b")}catch{}})();const A=()=>{const[e]=u(),t=e.get("code")??"",s=e.get("state")??"",g=e.get("profileId")??"",[n,p]=f.useState(!1),a=b(),i=h((m=>I(m))),r=l.getSignedInUser(),d=l.getSignedInUserTenantWithId(s);if(r==null||d==null)return o.jsx(y,{to:"/signin/auth",replace:!0});if(r==null)throw Error("Can't access this page without signing in...");return w(r.userId,r.zeniSessionId,d?.tenantId),f.useEffect((()=>{n||(p(!0),a(j(t,g,s)))}),[n,a]),i.fetchState==="Error"?o.jsx(E,{children:o.jsx(_,{children:i.error?.message??""})}):(i.fetchState==="Completed"&&window.close(),o.jsx(x,{fetchState:"In-Progress"}))},E=c.div`
2
2
  display: flex;
3
3
  width: 100%;
4
4
  height: 100vh;
@@ -1,4 +1,4 @@
1
- import{j as e}from"./liveblocks-D0aPwrEa.js";import{u as _,h as ne,g as W,i as N,j as k,l as ae,N as J,n as Re,o as x}from"./core-CJLU9TYG.js";import{$P as Ue,LP as Fe,$Q as $e,fI as R,H0 as _e,$R as An,cv as ee,cw as ze,GW as wn,$S as Dn,$T as kn,GZ as In,H4 as me,GT as Sn,GQ as Pn,Zm as ce,$U as bn,Pn as vn,Xi as jn,Pp as En,mM as Pe,$V as Tn,v2 as Me,uS as Ve,mD as Ze,mG as be,Xj as ve,Xk as Bn,$W as On,mF as Ln,n0 as Rn,mu as Un,kU as Fn,kT as $n,$X as _n,$Y as ge,P4 as zn,$Z as Mn,$_ as Vn,ZC as fe,$$ as je,a00 as Zn,PA as Hn,ZZ as Gn,MX as He,Cx as Ge,a01 as Wn,Px as Nn,a02 as We,db as ye,PE as Ne,d$ as Xe,e0 as xe,PC as Xn,MR as Yn,Pu as Qn,a03 as Ye,a04 as Qe,P6 as qe,Pg as Ee,a05 as qn,ZQ as Kn,PF as Jn,bq as ea,bK as na,cH as aa,bL as ta,bu as oa,UJ as sa}from"./zeni-epic-state-DN1FMHPE.js";import{V as te,W as Z,A as V,z as b,at as Ce,a5 as le,cV as ra,$ as z,a9 as X,a2 as Ke,h as ia,n as Te,j as L,cW as ca,ac as Ae,cX as la,a6 as de,cY as da,N as we,bg as G,cZ as ua,ao as pa,aq as Je,c_ as Be,c$ as ma,p as ie,d0 as ga,ag as ha,d1 as fa,d2 as ya,g as xa,E as Ca}from"./index-Bac0_7La.js";import{u as U,n as F,D as Y,S as Q}from"./mui-BTK8WNHw.js";import K from"./NotFoundScreen-DVwEy2Nc.js";import{S as Oe}from"./SetupPagesScreen-RWtDE1DO.js";import{F as en}from"./FeaturePreviewScreen-ae3ytT_c.js";import{a as g}from"./sentry-Bh_Qiwsv.js";import{M as ue}from"./MobileAppDrawer-Gq4sfjI3.js";import{A as Aa,D as wa,V as Da}from"./DomesticWireDetailScreen-CIlj8F4w.js";import{A as ka}from"./AddressScreen-Djrv0IMM.js";import{u as nn}from"./useAskAiCfoHostNavButtonProps-CkY97uj-.js";import{Z as Ia}from"./ZeniAccountStatementScreen-BAIxCUhh.js";import"./recharts-BEqM6zw3.js";import"./analytics-K5kCmXhx.js";import"./plaid-BWaZTH4h.js";import"./dnd-BvQSnOXX.js";import"./stripe-cKAAJElX.js";import"./lottie-CRpndHoM.js";import"./lexical-G-6YJUO1.js";import"./pdf-BlY1D9V4.js";import"./utils-DnIJUuGb.js";import"./BusinessVerificationPageScreen-BSguq-g2.js";import"./routePaths-CFVcdQVU.js";import"./analyticsHelper-Cb3EUyBw.js";import"./InboxNotificationsProvider-B5M0qdMl.js";import"./useTaskManagerAccess-CUawSS4F.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new n.Error().stack;a&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[a]="0a752eab-14ec-4881-b789-ab74fcc44ae9",n._sentryDebugIdIdentifier="sentry-dbid-0a752eab-14ec-4881-b789-ab74fcc44ae9")}catch{}})();const Sa=F.div`
1
+ import{j as e}from"./liveblocks-CZZ7TQJf.js";import{u as _,h as ne,g as W,i as N,j as k,l as ae,N as J,n as Le,o as x}from"./core-DtSa7_zJ.js";import{$P as Ue,LP as Fe,$Q as $e,fI as L,H0 as _e,$R as An,cv as ee,cw as ze,GW as wn,$S as Dn,$T as kn,GZ as In,H4 as me,GT as Sn,GQ as Pn,Zm as ce,$U as bn,Pn as vn,Xi as jn,Pp as En,mM as Pe,$V as Tn,v2 as Me,uS as Ve,mD as Ze,mG as be,Xj as ve,Xk as Bn,$W as Rn,mF as On,n0 as Ln,mu as Un,kU as Fn,kT as $n,$X as _n,$Y as ge,P4 as zn,$Z as Mn,$_ as Vn,ZC as he,$$ as je,a00 as Zn,PA as Hn,ZZ as Gn,MX as He,Cx as Ge,a01 as Wn,Px as Nn,a02 as We,db as ye,PE as Ne,d$ as Xe,e0 as xe,PC as Xn,MR as Yn,Pu as Qn,a03 as Ye,a04 as Qe,P6 as qe,Pg as Ee,a05 as qn,ZQ as Kn,PF as Jn,bq as ea,bK as na,cH as aa,bL as ta,bu as oa,UJ as sa}from"./zeni-epic-state-DIQk-W8f.js";import{M as te,W as Z,c as V,z as b,at as Ce,a5 as le,cV as ra,$ as z,a9 as X,a2 as Ke,j as ia,o as Te,k as O,cW as ca,ac as Ae,cX as la,a6 as de,cY as da,R as we,bg as G,cZ as ua,ao as pa,aq as Je,c_ as Be,c$ as ma,p as ie,d0 as ga,ag as fa,d1 as ha,d2 as ya,g as xa,I as Ca}from"./index-CJhgQFRI.js";import{u as U,n as F,D as Y,S as Q}from"./mui-hHF2bYsV.js";import K from"./NotFoundScreen-DHpPkJUq.js";import{S as Re}from"./SetupPagesScreen-C70xRnVo.js";import{F as en}from"./FeaturePreviewScreen-kue3YUvW.js";import{a as g}from"./sentry-7oL5NFUY.js";import{M as ue}from"./MobileAppDrawer-D9iwyW6E.js";import{A as Aa,D as wa,V as Da}from"./DomesticWireDetailScreen-pkS3AD2d.js";import{A as ka}from"./AddressScreen-DWZzKMEw.js";import{u as nn}from"./useAskAiCfoHostNavButtonProps-C0sjuZuZ.js";import{Z as Ia}from"./ZeniAccountStatementScreen-BcWZ9nqz.js";import"./recharts-DHYb1iJa.js";import"./analytics-wUVBNE2n.js";import"./plaid-l93gkere.js";import"./dnd-BRHUZ8LO.js";import"./stripe-cKAAJElX.js";import"./lottie-_8fQYf62.js";import"./lexical-CV0PpHfb.js";import"./pdf-DcTPEGUQ.js";import"./utils-D3PNq8pk.js";import"./BusinessVerificationPageScreen-CVijkaE8.js";import"./routePaths-66PPW-xS.js";import"./analyticsHelper-C8wUoU5C.js";import"./InboxNotificationsProvider-DrljtAmN.js";import"./useTaskManagerAccess-zRd8th0q.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new n.Error().stack;a&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[a]="8eadcb32-0841-4ad4-bde6-c5bd398ff79a",n._sentryDebugIdIdentifier="sentry-dbid-8eadcb32-0841-4ad4-bde6-c5bd398ff79a")}catch{}})();const Sa=F.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -6,7 +6,7 @@ import{j as e}from"./liveblocks-D0aPwrEa.js";import{u as _,h as ne,g as W,i as N
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${n=>n.theme.colors.grey4};
9
- `;function Le({isEditDrawerOpen:n}){const a=U(),[r,t]=g.useState(!1),{autoTransferRulePageProps:o,isLoading:i}=(function({isEditDrawerOpen:d=!1}={}){const c=_(),p=ne(),h=W(),{ruleId:y,tenantEmailDomain:s}=N(),l=te(),{useFeatureGate:f}=Z(),m=k((u=>Ue(u))),P=k((u=>Fe(u.depositAccountState,u.depositAccountListState))),D=k((u=>$e(u))),w=k((u=>R(u))),{isFeatureEnabled:I}=f(V.isTreasuryEnabled),C=m?.fetchState??"Not-Started",A=w?.companyId??(s==null?void 0:b.getSignedInUserTenant(s)?.companyId);g.useEffect((()=>{C==="Not-Started"&&A!=null&&c(_e(!0))}),[c,C,A]);const E=m?.fetchState!=="Completed";if(E)return{autoTransferRulePageProps:void 0,isLoading:E};const T=w?.company!=null&&An(w.company),v=!!(I&&T),j=ee(l?.loggedInUserRoleMap)||ze(l?.loggedInUserRoleMap),O=b.getSignedInUser(),S={userId:O?.userId??"",sessionId:O?.zeniSessionId??"",tenantId:w?.tenantId??""},B=!!h.state?.scrollToAddRule;return{isLoading:E,autoTransferRulePageProps:{autoTransferRuleView:m,companyName:w?.companyName??"",hasAdminLevelAccess:j,includeTreasuryOption:v,transferLimit:5e5,authParams:S,currentTenant:w,depositAccountListView:P,downloadAccountDetailEndPoint:`${Ce}/account_details`,editingRuleId:y,isEditDrawerOpen:d,scrollToAddRule:B,zeniAccountsConfigDetail:D,onBackClick:()=>p(".."),onCreateRule:()=>{c(Pn())},onUpdateRule:u=>{c(me(u))},onDeleteClick:u=>{c(Sn(u))},onPauseClick:u=>{c(me(u,!0,!1))},onResumeClick:u=>{c(me(u,!1,!0))},onActivityClick:(u,M)=>{c(In(u,M))},onUpdateRuleLocalData:u=>{c(kn(u))},clearRuleLocalData:()=>{c(Dn())},onEditClick:u=>{p(`./${u}/edit`)},onEditDrawerClose:()=>{p("../../",{relative:"path"})},onReviewClick:()=>{c(wn())}}}})({isEditDrawerOpen:n});return i||o==null?e.jsx(le,{fetchState:"In-Progress",style:{backgroundColor:a.colors.grey5}}):e.jsxs(Sa,{children:[e.jsx(ue,{isAppContentDrawerOpen:r,handleDrawerToggle:d=>{t(d)}}),e.jsx(ra,{...o})]})}const Pa={overlayWidth:new X(100,100,58)},ba=({vendorId:n,isDrawerOpen:a,closeDrawerHandler:r})=>{const t=_(),o=U(),i=z();if(b.getSignedInUser()==null)throw Error("Can't access ach account page without signing in...");return e.jsx(Y,{onClose:()=>{r(!0),t(ce())},anchor:"right",open:a,PaperProps:{style:{width:Pa.overlayWidth.valuePercentage(i),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.75,cursor:"pointer"}}},children:e.jsx(va,{onClick:d=>d.stopPropagation(),children:e.jsx(Aa,{vendorIdParam:n,accountContext:"express-pay"})})})},va=F(Q)`
9
+ `;function Oe({isEditDrawerOpen:n}){const a=U(),[r,t]=g.useState(!1),{autoTransferRulePageProps:o,isLoading:i}=(function({isEditDrawerOpen:d=!1}={}){const c=_(),p=ne(),f=W(),{ruleId:y,tenantEmailDomain:s}=N(),l=te(),{useFeatureGate:h}=Z(),m=k((u=>Ue(u))),P=k((u=>Fe(u.depositAccountState,u.depositAccountListState))),D=k((u=>$e(u))),w=k((u=>L(u))),{isFeatureEnabled:I}=h(V.isTreasuryEnabled),C=m?.fetchState??"Not-Started",A=w?.companyId??(s==null?void 0:b.getSignedInUserTenant(s)?.companyId);g.useEffect((()=>{C==="Not-Started"&&A!=null&&c(_e(!0))}),[c,C,A]);const E=m?.fetchState!=="Completed";if(E)return{autoTransferRulePageProps:void 0,isLoading:E};const T=w?.company!=null&&An(w.company),v=!!(I&&T),j=ee(l?.loggedInUserRoleMap)||ze(l?.loggedInUserRoleMap),R=b.getSignedInUser(),S={userId:R?.userId??"",sessionId:R?.zeniSessionId??"",tenantId:w?.tenantId??""},B=!!f.state?.scrollToAddRule;return{isLoading:E,autoTransferRulePageProps:{autoTransferRuleView:m,companyName:w?.companyName??"",hasAdminLevelAccess:j,includeTreasuryOption:v,transferLimit:5e5,authParams:S,currentTenant:w,depositAccountListView:P,downloadAccountDetailEndPoint:`${Ce}/account_details`,editingRuleId:y,isEditDrawerOpen:d,scrollToAddRule:B,zeniAccountsConfigDetail:D,onBackClick:()=>p(".."),onCreateRule:()=>{c(Pn())},onUpdateRule:u=>{c(me(u))},onDeleteClick:u=>{c(Sn(u))},onPauseClick:u=>{c(me(u,!0,!1))},onResumeClick:u=>{c(me(u,!1,!0))},onActivityClick:(u,M)=>{c(In(u,M))},onUpdateRuleLocalData:u=>{c(kn(u))},clearRuleLocalData:()=>{c(Dn())},onEditClick:u=>{p(`./${u}/edit`)},onEditDrawerClose:()=>{p("../../",{relative:"path"})},onReviewClick:()=>{c(wn())}}}})({isEditDrawerOpen:n});return i||o==null?e.jsx(le,{fetchState:"In-Progress",style:{backgroundColor:a.colors.grey5}}):e.jsxs(Sa,{children:[e.jsx(ue,{isAppContentDrawerOpen:r,handleDrawerToggle:d=>{t(d)}}),e.jsx(ra,{...o})]})}const Pa={overlayWidth:new X(100,100,58)},ba=({vendorId:n,isDrawerOpen:a,closeDrawerHandler:r})=>{const t=_(),o=U(),i=z();if(b.getSignedInUser()==null)throw Error("Can't access ach account page without signing in...");return e.jsx(Y,{onClose:()=>{r(!0),t(ce())},anchor:"right",open:a,PaperProps:{style:{width:Pa.overlayWidth.valuePercentage(i),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.75,cursor:"pointer"}}},children:e.jsx(va,{onClick:d=>d.stopPropagation(),children:e.jsx(Aa,{vendorIdParam:n,accountContext:"express-pay"})})})},va=F(Q)`
10
10
  display: flex;
11
11
  min-height: 100%;
12
12
  flex-direction: column;
@@ -14,11 +14,11 @@ import{j as e}from"./liveblocks-D0aPwrEa.js";import{u as _,h as ne,g as W,i as N
14
14
  display: flex;
15
15
  min-height: 100%;
16
16
  flex-direction: column;
17
- `,Ba={overlayWidth:new X(100,100,58)},Oa=({vendorId:n,isDrawerOpen:a,closeDrawerHandler:r})=>{const t=_(),o=U(),i=z();if(b.getSignedInUser()==null)throw Error("Can't access ach account page without signing in...");return e.jsx(Y,{onClose:()=>{r(!0),t(ce())},anchor:"right",open:a,PaperProps:{style:{width:Ba.overlayWidth.valuePercentage(i),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.75,cursor:"pointer"}}},children:e.jsx(La,{onClick:d=>d.stopPropagation(),children:e.jsx(wa,{vendorIdParam:n,accountContext:"express-pay"})})})},La=F(Q)`
17
+ `,Ba={overlayWidth:new X(100,100,58)},Ra=({vendorId:n,isDrawerOpen:a,closeDrawerHandler:r})=>{const t=_(),o=U(),i=z();if(b.getSignedInUser()==null)throw Error("Can't access ach account page without signing in...");return e.jsx(Y,{onClose:()=>{r(!0),t(ce())},anchor:"right",open:a,PaperProps:{style:{width:Ba.overlayWidth.valuePercentage(i),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.75,cursor:"pointer"}}},children:e.jsx(Oa,{onClick:d=>d.stopPropagation(),children:e.jsx(wa,{vendorIdParam:n,accountContext:"express-pay"})})})},Oa=F(Q)`
18
18
  display: flex;
19
19
  min-height: 100%;
20
20
  flex-direction: column;
21
- `,Ra=F.div`
21
+ `,La=F.div`
22
22
  display: flex;
23
23
  height: 100vh;
24
24
  width: 100%;
@@ -26,15 +26,15 @@ import{j as e}from"./liveblocks-D0aPwrEa.js";import{u as _,h as ne,g as W,i as N
26
26
  flex-direction: column;
27
27
  align-items: center;
28
28
  background-color: ${n=>n.theme.colors.grey4};
29
- `,Ua=ae((function(n,a){const r=R(n),t=b.getSignedInUser(),o=r.tenantId,i={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:o??""},d=a.expressPayDetails,c=n.entityAutoCompleteState.autoCompleteText.common,p=jn(n,"common");return{expressPayDetails:d,fileProps:{authParams:i,filesEndPoint:`${Ae.fileMicroServiceBaseUrl}`},vendorSearchAutoCompleteData:{autoCompleteText:c,entityAutoCompleteView:p},analytics:a.analytics}}),(function(n,a){const{navigate:r}=a;return{onSaveVendor:t=>{n($n(t,void 0,void 0,!0))},saveVendorDetailLocalData:(t,o)=>{n(be({vendorId:o,localData:t}))},saveExpressPayLocalData:t=>{n(Fn({localData:t}))},onVendorSelected:t=>{t!=null&&n(Un(t,!1))},updateSelectedVendorForCreate:t=>{n(Rn(t))},initializeVendorAddress:()=>{n(Ln())},resetVendorSaveStatus:t=>{n(On({vendorId:t}))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(t,o)=>{t.trim().length>=2?n(Bn({searchString:t,entityType:o,searchOrigin:"common"})):t.trim().length===0&&n(ve("common"))},onCancelAutoComplete:()=>{n(ve("common"))}},chooseNewVendor:t=>{n(be({localData:{vendorName:t}}))},onClickAddAccount:t=>{t.method.toLowerCase().indexOf("ach")!==-1?r("./add-ach",{relative:"path"}):t.method.toLowerCase().indexOf("wire")!==-1&&t.method.toLowerCase().indexOf("domestic")!==-1&&r("./add-wire",{relative:"path"})},updateFilesEntity:t=>{n(Ze({files:t}))},onDeleteFile:t=>{n(Ve(t))},onEditFileName:(t,o)=>{n(Me(t,o.split(".")[0]))},onBackClick:t=>{t!=null&&n(Pe(t)),n(Pe()),n(Tn()),n(ce()),r("../",{relative:"path"})},onSchedulePayment:()=>{n(En())}}}))(ca);function se({isAddACHDrawerOpen:n,isAddWireDrawerOpen:a,isAddAddressDrawerOpen:r}){const t=ne(),o=W(),i=_(),[d,c]=g.useState(!1),{tenantEmailDomain:p}=N(),h=te(),y=k((u=>u.expressPayState.fetchState)),s=k((u=>R(u))),l=k((u=>bn(u))),f=l.expressPayLocalData?.vendorId,m=s.companyId??b.getSignedInUserTenant(p)?.companyId,[P,D]=g.useState(!1),[w,I]=g.useState(!1),[C,A]=g.useState(!1),E=Ke(o.state?.pathnameStackToGoBack),{poppedPathname:T}=E,v=T?.split("/"),j=v?.[v.length-1];g.useEffect((()=>{n===!0?D(!0):(D(!1),document.body.style.overflow="auto")}),[n]),g.useEffect((()=>{a===!0?I(!0):(I(!1),document.body.style.overflow="auto")}),[a]),g.useEffect((()=>{r===!0?A(!0):(A(!1),document.body.style.overflow="auto")}),[r]),g.useEffect((()=>{y==="Not-Started"&&i(vn(!0,!0))}),[y,i]);const O=ia(l.vendorViewDetails.bankAccountCreationState?.fetchState);if(g.useEffect((()=>{O==="In-Progress"&&l.vendorViewDetails.bankAccountCreationState?.fetchState==="Completed"&&B()}),[O,l.vendorViewDetails.bankAccountCreationState?.fetchState]),b.getSignedInUser()==null)throw Error("Can't access express pay page without signing in...");const S=u=>{c(u)},B=()=>{D(!1),I(!1),t("../",{relative:"path"})};return e.jsxs(Ra,{children:[Te(o)?e.jsx(ue,{isAppContentDrawerOpen:d,handleDrawerToggle:S}):null,P===!0?e.jsx(ba,{vendorId:f,closeDrawerHandler:B,isDrawerOpen:P}):null,w===!0?e.jsx(Oa,{vendorId:f,closeDrawerHandler:B,isDrawerOpen:w}):null,C===!0?e.jsx(Ea,{closeDrawerHandler:B,isDrawerOpen:C}):null,e.jsx(Da,{vendorId:f,isExpressPayPage:!0}),e.jsx(Ua,{navigate:t,location:o,companyId:m,accountId:j,analytics:L,currentTenant:s,vendorId:f,roleMap:h?.loggedInUserRoleMap,isSettings:Te(o),expressPayDetails:l,onClickMenuIcon:()=>{S(!0)}})]})}const Fa={overlayWidth:new X(100,100,58)},$a=({authParams:n,downloadAccountDetailEndPoint:a,isAccountInfoDrawerOpen:r,zeniBankAccountDetail:t,closeDrawerHandler:o})=>{const i=U(),d=z(),c=k((s=>$e(s))),p=k((s=>R(s)));if(b.getSignedInUser()==null)throw Error("Can't access Account detail page without signing in...");const h=()=>{o(!0)},y={depositAccount:t,onDismissClick:h,zeniAccountsConfigDetail:c,authParams:n,downloadAccountDetailEndPoint:a,currentTenant:p};return e.jsx(Y,{anchor:"right",open:r,PaperProps:{style:{width:Fa.overlayWidth.valuePercentage(d),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:i.colors.black,opacity:.75,cursor:"pointer"}}},onClose:()=>h(),children:e.jsx(_a,{onClick:s=>s.stopPropagation(),children:e.jsx(la,{...y})})})},_a=F(Q)`
29
+ `,Ua=ae((function(n,a){const r=L(n),t=b.getSignedInUser(),o=r.tenantId,i={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:o??""},d=a.expressPayDetails,c=n.entityAutoCompleteState.autoCompleteText.common,p=jn(n,"common");return{expressPayDetails:d,fileProps:{authParams:i,filesEndPoint:`${Ae.fileMicroServiceBaseUrl}`},vendorSearchAutoCompleteData:{autoCompleteText:c,entityAutoCompleteView:p},analytics:a.analytics}}),(function(n,a){const{navigate:r}=a;return{onSaveVendor:t=>{n($n(t,void 0,void 0,!0))},saveVendorDetailLocalData:(t,o)=>{n(be({vendorId:o,localData:t}))},saveExpressPayLocalData:t=>{n(Fn({localData:t}))},onVendorSelected:t=>{t!=null&&n(Un(t,!1))},updateSelectedVendorForCreate:t=>{n(Ln(t))},initializeVendorAddress:()=>{n(On())},resetVendorSaveStatus:t=>{n(Rn({vendorId:t}))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(t,o)=>{t.trim().length>=2?n(Bn({searchString:t,entityType:o,searchOrigin:"common"})):t.trim().length===0&&n(ve("common"))},onCancelAutoComplete:()=>{n(ve("common"))}},chooseNewVendor:t=>{n(be({localData:{vendorName:t}}))},onClickAddAccount:t=>{t.method.toLowerCase().indexOf("ach")!==-1?r("./add-ach",{relative:"path"}):t.method.toLowerCase().indexOf("wire")!==-1&&t.method.toLowerCase().indexOf("domestic")!==-1&&r("./add-wire",{relative:"path"})},updateFilesEntity:t=>{n(Ze({files:t}))},onDeleteFile:t=>{n(Ve(t))},onEditFileName:(t,o)=>{n(Me(t,o.split(".")[0]))},onBackClick:t=>{t!=null&&n(Pe(t)),n(Pe()),n(Tn()),n(ce()),r("../",{relative:"path"})},onSchedulePayment:()=>{n(En())}}}))(ca);function se({isAddACHDrawerOpen:n,isAddWireDrawerOpen:a,isAddAddressDrawerOpen:r}){const t=ne(),o=W(),i=_(),[d,c]=g.useState(!1),{tenantEmailDomain:p}=N(),f=te(),y=k((u=>u.expressPayState.fetchState)),s=k((u=>L(u))),l=k((u=>bn(u))),h=l.expressPayLocalData?.vendorId,m=s.companyId??b.getSignedInUserTenant(p)?.companyId,[P,D]=g.useState(!1),[w,I]=g.useState(!1),[C,A]=g.useState(!1),E=Ke(o.state?.pathnameStackToGoBack),{poppedPathname:T}=E,v=T?.split("/"),j=v?.[v.length-1];g.useEffect((()=>{n===!0?D(!0):(D(!1),document.body.style.overflow="auto")}),[n]),g.useEffect((()=>{a===!0?I(!0):(I(!1),document.body.style.overflow="auto")}),[a]),g.useEffect((()=>{r===!0?A(!0):(A(!1),document.body.style.overflow="auto")}),[r]),g.useEffect((()=>{y==="Not-Started"&&i(vn(!0,!0))}),[y,i]);const R=ia(l.vendorViewDetails.bankAccountCreationState?.fetchState);if(g.useEffect((()=>{R==="In-Progress"&&l.vendorViewDetails.bankAccountCreationState?.fetchState==="Completed"&&B()}),[R,l.vendorViewDetails.bankAccountCreationState?.fetchState]),b.getSignedInUser()==null)throw Error("Can't access express pay page without signing in...");const S=u=>{c(u)},B=()=>{D(!1),I(!1),t("../",{relative:"path"})};return e.jsxs(La,{children:[Te(o)?e.jsx(ue,{isAppContentDrawerOpen:d,handleDrawerToggle:S}):null,P===!0?e.jsx(ba,{vendorId:h,closeDrawerHandler:B,isDrawerOpen:P}):null,w===!0?e.jsx(Ra,{vendorId:h,closeDrawerHandler:B,isDrawerOpen:w}):null,C===!0?e.jsx(Ea,{closeDrawerHandler:B,isDrawerOpen:C}):null,e.jsx(Da,{vendorId:h,isExpressPayPage:!0}),e.jsx(Ua,{navigate:t,location:o,companyId:m,accountId:j,analytics:O,currentTenant:s,vendorId:h,roleMap:f?.loggedInUserRoleMap,isSettings:Te(o),expressPayDetails:l,onClickMenuIcon:()=>{S(!0)}})]})}const Fa={overlayWidth:new X(100,100,58)},$a=({authParams:n,downloadAccountDetailEndPoint:a,isAccountInfoDrawerOpen:r,zeniBankAccountDetail:t,closeDrawerHandler:o})=>{const i=U(),d=z(),c=k((s=>$e(s))),p=k((s=>L(s)));if(b.getSignedInUser()==null)throw Error("Can't access Account detail page without signing in...");const f=()=>{o(!0)},y={depositAccount:t,onDismissClick:f,zeniAccountsConfigDetail:c,authParams:n,downloadAccountDetailEndPoint:a,currentTenant:p};return e.jsx(Y,{anchor:"right",open:r,PaperProps:{style:{width:Fa.overlayWidth.valuePercentage(d),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:i.colors.black,opacity:.75,cursor:"pointer"}}},onClose:()=>f(),children:e.jsx(_a,{onClick:s=>s.stopPropagation(),children:e.jsx(la,{...y})})})},_a=F(Q)`
30
30
  display: flex;
31
31
  min-height: 100%;
32
32
  flex-direction: column;
33
- `,za={overlayWidth:new X(100,100,58)},an=({isCheckDepositDrawerOpen:n,closeDrawerHandler:a})=>{const r=U(),t=z(),o=_(),i=k((s=>R(s))),d=b.getSignedInUser(),c=i.tenantId,p={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:c??""};if(d==null)throw Error("Can't access check deposit page without signing in...");const h=k((s=>_n(s))),y={analytics:L,checkDeposit:h,filesEndPoint:`${Ae.fileMicroServiceBaseUrl}`,authParams:p,onSaveChangesToLocalStore:s=>{o(Mn(s))},updateFilesEntity:s=>{o(Ze({files:s}))},onAnotherTransferClick:()=>{o(ge())},onDeleteFile:s=>{o(Ve(s))},onEditFileName:(s,l)=>{o(Me(s,l.split(".")[0]))},onCheckDpositClick:()=>{o(zn())},onDismissClick:()=>{a(!0),o(ge())}};return e.jsxs(e.Fragment,{children:[e.jsx(de,{analytics:L,onLoad:s=>(l=>l.trackPageLoaded(we.Event.accountsDepositCheckFormViewed))(s)}),e.jsx(Y,{anchor:"right",open:n,PaperProps:{style:{width:za.overlayWidth.valuePercentage(t),boxShadow:"none",zIndex:8}},slotProps:{backdrop:{style:{backgroundColor:r.colors.black,opacity:.75,cursor:"pointer"}}},onClose:(s,l)=>(l==="backdropClick"||l==="escapeKeyDown")&&(a(!0),void o(ge())),children:e.jsx(Ma,{onClick:s=>s.stopPropagation(),children:e.jsx(da,{...y})})})]})},Ma=F(Q)`
33
+ `,za={overlayWidth:new X(100,100,58)},an=({isCheckDepositDrawerOpen:n,closeDrawerHandler:a})=>{const r=U(),t=z(),o=_(),i=k((s=>L(s))),d=b.getSignedInUser(),c=i.tenantId,p={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:c??""};if(d==null)throw Error("Can't access check deposit page without signing in...");const f=k((s=>_n(s))),y={analytics:O,checkDeposit:f,filesEndPoint:`${Ae.fileMicroServiceBaseUrl}`,authParams:p,onSaveChangesToLocalStore:s=>{o(Mn(s))},updateFilesEntity:s=>{o(Ze({files:s}))},onAnotherTransferClick:()=>{o(ge())},onDeleteFile:s=>{o(Ve(s))},onEditFileName:(s,l)=>{o(Me(s,l.split(".")[0]))},onCheckDpositClick:()=>{o(zn())},onDismissClick:()=>{a(!0),o(ge())}};return e.jsxs(e.Fragment,{children:[e.jsx(de,{analytics:O,onLoad:s=>(l=>l.trackPageLoaded(we.Event.accountsDepositCheckFormViewed))(s)}),e.jsx(Y,{anchor:"right",open:n,PaperProps:{style:{width:za.overlayWidth.valuePercentage(t),boxShadow:"none",zIndex:8}},slotProps:{backdrop:{style:{backgroundColor:r.colors.black,opacity:.75,cursor:"pointer"}}},onClose:(s,l)=>(l==="backdropClick"||l==="escapeKeyDown")&&(a(!0),void o(ge())),children:e.jsx(Ma,{onClick:s=>s.stopPropagation(),children:e.jsx(da,{...y})})})]})},Ma=F(Q)`
34
34
  display: flex;
35
35
  min-height: 100%;
36
36
  flex-direction: column;
37
- `,Va={overlayWidth:new X(100,100,58)},Za=ae((function(n,a){const r=a.currentTenant?.companyId;return{plaidConnectionDetails:Gn(n,r,"zeni_accounts","external_account").plaidConnectionDetails,depositAccountListView:Fe(n.depositAccountState,n.depositAccountListState)}}),(function(n,a){return{onReviewClick:()=>n(Nn()),clearReviewTransferDetail:()=>n(Wn()),onFetchLinkTokenClick:r=>{n(Ge("external_account",r))},onEstablishConnectionClick:r=>{n(He(r,a.currentTenant?.companyId,"external_account",void 0,"link_external_account"))}}}))(ua),tn=({isTransferDrawerOpen:n,authParams:a,downloadAccountDetailEndPoint:r,closeDrawerHandler:t,zeniAccountsConfig:o})=>{const i=k((C=>Vn(C))),d=k((C=>R(C))),c=U(),p=z(),h=_(),{accountId:y}=N(),[s,l]=g.useState("achTransfer"),[f,m]=g.useState(!1);if(b.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const{useDynamicConfig:P}=Z(),{configValue:D}=P(G.zeniAccountsConfig),w=fe(D),I=()=>{t(!0),h(je())};return g.useEffect((()=>{i.reviewTransferDetail.fetchState==="Completed"&&m(!0)}),[m,i.reviewTransferDetail.fetchState]),e.jsxs(e.Fragment,{children:[e.jsx(de,{analytics:L,onLoad:C=>(A=>A.trackPageLoaded(we.Event.zeniAccountsTransferFormViewed))(C)}),e.jsx(Y,{onClose:()=>{(s==="achTransfer"&&f===!1||s==="achTransfer"&&f&&i.fetchState==="Completed")&&I()},anchor:"right",open:n,PaperProps:{style:{width:Va.overlayWidth.valuePercentage(p),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:c.colors.black,opacity:.75,cursor:"pointer"}}},children:e.jsx(Ha,{onClick:C=>C.stopPropagation(),children:e.jsx(Za,{analytics:L,transferDetails:i,authParams:a,downloadAccountDetailEndPoint:r,onTransferClick:()=>{L.trackTransferBetweenAccountsFormClicked("Transfer",i.reviewTransferDetail.reviewTransferMoney.isShowDailyAchLimitWarning?"Review Split Transfer":"Review Transfer",i.transferDetailLocalData.transferFrom?.label,i.transferDetailLocalData.transferTo?.label,i.transferDetailLocalData.amount.amount,i.reviewTransferDetail.reviewTransferMoney.isShowDailyAchLimitWarning,i.reviewTransferDetail.reviewTransferMoney.transferSchedules.length,i.transferDetailLocalData.transferFrom?.accType==="paymentAccount"&&i.transferDetailLocalData.transferTo?.accType==="depositAccount"&&o.zeniAccountsConfigDetail.depositProductConfig.depositProducts?.[0].range?.[1]!=null&&i.transferDetailLocalData.amount.amount>o.zeniAccountsConfigDetail.depositProductConfig.depositProducts[0].range[1]),h(Hn(y))},onDismissClick:I,onSaveChangesToLocalStore:C=>{h(Zn(C))},onAnotherTransferClick:()=>{m(!1),h(je())},currentTenant:d,zeniAccountsConfigDetail:o,currentDrawerContent:s,setCurrentDrawerContent:l,showReviewContent:f,setShowReviewContent:m,onBackClick:()=>{},maxInsuredAmount:w.maxInsuredAmount})})})]})},Ha=F(Q)`
37
+ `,Va={overlayWidth:new X(100,100,58)},Za=ae((function(n,a){const r=a.currentTenant?.companyId;return{plaidConnectionDetails:Gn(n,r,"zeni_accounts","external_account").plaidConnectionDetails,depositAccountListView:Fe(n.depositAccountState,n.depositAccountListState)}}),(function(n,a){return{onReviewClick:()=>n(Nn()),clearReviewTransferDetail:()=>n(Wn()),onFetchLinkTokenClick:r=>{n(Ge("external_account",r))},onEstablishConnectionClick:r=>{n(He(r,a.currentTenant?.companyId,"external_account",void 0,"link_external_account"))}}}))(ua),tn=({isTransferDrawerOpen:n,authParams:a,downloadAccountDetailEndPoint:r,closeDrawerHandler:t,zeniAccountsConfig:o})=>{const i=k((C=>Vn(C))),d=k((C=>L(C))),c=U(),p=z(),f=_(),{accountId:y}=N(),[s,l]=g.useState("achTransfer"),[h,m]=g.useState(!1);if(b.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const{useDynamicConfig:P}=Z(),{configValue:D}=P(G.zeniAccountsConfig),w=he(D),I=()=>{t(!0),f(je())};return g.useEffect((()=>{i.reviewTransferDetail.fetchState==="Completed"&&m(!0)}),[m,i.reviewTransferDetail.fetchState]),e.jsxs(e.Fragment,{children:[e.jsx(de,{analytics:O,onLoad:C=>(A=>A.trackPageLoaded(we.Event.zeniAccountsTransferFormViewed))(C)}),e.jsx(Y,{onClose:()=>{(s==="achTransfer"&&h===!1||s==="achTransfer"&&h&&i.fetchState==="Completed")&&I()},anchor:"right",open:n,PaperProps:{style:{width:Va.overlayWidth.valuePercentage(p),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:c.colors.black,opacity:.75,cursor:"pointer"}}},children:e.jsx(Ha,{onClick:C=>C.stopPropagation(),children:e.jsx(Za,{analytics:O,transferDetails:i,authParams:a,downloadAccountDetailEndPoint:r,onTransferClick:()=>{O.trackTransferBetweenAccountsFormClicked("Transfer",i.reviewTransferDetail.reviewTransferMoney.isShowDailyAchLimitWarning?"Review Split Transfer":"Review Transfer",i.transferDetailLocalData.transferFrom?.label,i.transferDetailLocalData.transferTo?.label,i.transferDetailLocalData.amount.amount,i.reviewTransferDetail.reviewTransferMoney.isShowDailyAchLimitWarning,i.reviewTransferDetail.reviewTransferMoney.transferSchedules.length,i.transferDetailLocalData.transferFrom?.accType==="paymentAccount"&&i.transferDetailLocalData.transferTo?.accType==="depositAccount"&&o.zeniAccountsConfigDetail.depositProductConfig.depositProducts?.[0].range?.[1]!=null&&i.transferDetailLocalData.amount.amount>o.zeniAccountsConfigDetail.depositProductConfig.depositProducts[0].range[1]),f(Hn(y))},onDismissClick:I,onSaveChangesToLocalStore:C=>{f(Zn(C))},onAnotherTransferClick:()=>{m(!1),f(je())},currentTenant:d,zeniAccountsConfigDetail:o,currentDrawerContent:s,setCurrentDrawerContent:l,showReviewContent:h,setShowReviewContent:m,onBackClick:()=>{},maxInsuredAmount:w.maxInsuredAmount})})})]})},Ha=F(Q)`
38
38
  display: flex;
39
39
  min-height: 100%;
40
40
  flex-direction: column;
@@ -46,7 +46,7 @@ import{j as e}from"./liveblocks-D0aPwrEa.js";import{u as _,h as ne,g as W,i as N
46
46
  flex-direction: column;
47
47
  align-items: center;
48
48
  background-color: ${n=>n.theme.colors.grey4};
49
- `,Wa=ae((function(n,a){return{zeniAccountListView:We(n),isExpressPayEnabled:a.isExpressPayEnabled,analytics:a.analytics}}),(function(n,a){const{navigate:r,currentTenant:t,location:o,companyId:i,handleDrawerToggle:d,analytics:c,isBillPayEnabled:p,isDebitCardFeatureEnabled:h}=a,{tenantEmailDomain:y}=t;return{onZeniAccountClick:(s,l)=>{c.trackAccountsListPageClicked("Accounts Row Item Click",l,"active");const f=Na(y,s),m=ie(o.state?.pathnameStackToGoBack,o.pathname);r(f,{state:{pathnameStackToGoBack:m}})},onSettingsClick:()=>{c.trackAccountsListPageClicked("Settings Icon"),r("setup")},onReloadTransactions:()=>{n(Ne(!1))},handleMoveMoneyOptionSelection:(s,l)=>{let f="page-not-found";s==="sendMoney"&&(f=cn(y)),s==="payBill"?f=on(t,p,h):s==="transfer"?(f=sn(y),l!=null&&n(Ye(l))):s==="checkDeposit"&&(f=rn(y));const m=ie(o.state?.pathnameStackToGoBack,o.pathname);r(f,{state:{pathnameStackToGoBack:m}})},unlinkPaymentAccount:(s,l)=>{c.trackAccountsListPageClicked("Unlink Account",l),n(Qn(s))},onFetchLinkTokenClick:(s,l)=>{n(Ge("external_account",s,l))},onUpdatePaymentAccountStatus:(s,l,f)=>{n(Yn(s,l,"zeni_accounts","external_account",f))},onEstablishConnectionClick:s=>{n(He(s,i,"external_account",void 0,"link_external_account"))},onCreateCheckingClick:s=>{n(Xn(s))},onClickMenuIcon:()=>{d(!0)},onAutoTransferClick:s=>{const l="./auto-transfer";s?r(l,{state:{...o.state,scrollToAddRule:!0}}):r(l)}}}))(ma);function he({isTransferDrawerOpen:n,isCheckDepositDrawerOpen:a}){const r=W(),t=ne(),o=_(),i=z(),{tenantEmailDomain:d}=N(),{useDynamicConfig:c,useFeatureGate:p}=Z(),h=U(),{configValue:y}=c(G.zeniAccountsConfig),{isFeatureEnabled:s}=p(V.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=p(V.isAutoTransferRuleEnabled),f=fe(y),m=k(($=>R($))),P=m.companyId??b.getSignedInUserTenant(d)?.companyId,{configValue:D}=c(G.expressPayConfig),w=D.is_enable_all_tenants===!0||D.tenant_ids!=null&&D.tenant_ids.includes(m.tenantId),[I,C]=g.useState(!1),[A,E]=g.useState(!1),[T,v]=g.useState(!1),[j,O]=g.useState(!1),S=k(($=>We($))),B=S.fetchState,u=k(($=>Ue($))),M=u?.fetchState??"Not-Started",pe=!!m.companyZeniAccountInfo?.info?.isZeniAccountEnabled,oe=te(),H=!!m.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted,q=ee(oe?.loggedInUserRoleMap),ln=ye(oe?.loggedInUserRoleMap),dn=!!m.companyBillPayInfo?.info?.isBillPayEnabled,De=b.getSignedInUser(),un={userId:De?.userId??"",sessionId:De?.zeniSessionId??"",tenantId:m.tenantId??""},pn=`${Ce}/account_details`,{areTenantIdsInSync:ke}=pa();g.useEffect((()=>{!I&&ke&&(C(!0),o(Ne(!1)))}),[I,o,B,ke]),g.useEffect((()=>{!A&&M==="Not-Started"&&P&&(E(!0),o(_e(!0)))}),[A,M,P,o]),g.useEffect((()=>{n!=null&&n===!0?v(!0):(v(!1),document.body.style.overflow="auto")}),[n]),g.useEffect((()=>{O(a!=null&&a===!0)}),[a]);const Ie=()=>{v(!1),t("..")},[mn,gn]=g.useState(!1),Se=$=>{gn($)},{isAiCfoAccessEnabled:hn,onAskAiCfoClick:fn}=nn({mobileExploreReferrer:"Checking Accounts"});Je({isDataReady:B==="Completed"});const yn=Xe(m),xn=xe(s,m);return yn===!0&&xn!==!0?e.jsx(en,{}):pe?e.jsxs(e.Fragment,{children:[S.fetchState==="Completed"&&T===!1&&j===!1?e.jsx(de,{analytics:L,onLoad:$=>(Cn=>{Cn.trackAccountsListPageViewed(S.depositAccountsSelectorView.depositAccounts.length,S.externalAccountsSelectorView.paymentAccounts.length,Be(S.summary?.totalBalance.available.amount??0),Be(S.summary?.totalInterest.available.amount??0),S.zeniAccountsConfig.zeniAccountsConfigDetail.annualPercentageYield)})($)}):null,T===!0?e.jsx(tn,{closeDrawerHandler:Ie,isTransferDrawerOpen:T,zeniAccountsConfig:S.zeniAccountsConfig,authParams:un,downloadAccountDetailEndPoint:pn}):null,j===!0?e.jsx(an,{closeDrawerHandler:Ie,isCheckDepositDrawerOpen:j}):null,e.jsxs(Ga,{windowSize:i,children:[e.jsx(ue,{isAppContentDrawerOpen:mn,handleDrawerToggle:Se}),e.jsx(Wa,{zeniBankListView:S,navigate:t,currentTenant:m,location:r,companyId:P,analytics:L,maxInsuredAmount:f.maxInsuredAmount,isExpressPayEnabled:w,isBillPayEnabled:dn,isDebitCardFeatureEnabled:s,isAutoTransferRuleEnabled:l,handleDrawerToggle:Se,isAiCfoAccessEnabled:hn,onAskAiCfoClick:fn})]})]}):H&&q?e.jsx(J,{to:"../setup"}):m.companyZeniAccountInfo?.info&&!H&&ln?e.jsx(J,{to:"../promo",state:r.state}):e.jsx(le,{fetchState:"In-Progress",style:{backgroundColor:h.colors.grey5}})}const on=(n,a,r)=>{const t=xe(r,n),{tenantEmailDomain:o}=n;return t===!0||a===!1?`/${o}/bills`:`/${o}/bill/new`},Na=(n,a)=>`/${n}/checking/${a}`,sn=(n,a)=>a==null?`/${n}/checking/transfer`:`/${n}/checking/${a}/transfer`,rn=(n,a)=>a==null?`/${n}/checking/check-deposit`:`/${n}/checking/${a}/check-deposit`,cn=n=>`/${n}/checking/express-pay`,Xa=F.div`
49
+ `,Wa=ae((function(n,a){return{zeniAccountListView:We(n),isExpressPayEnabled:a.isExpressPayEnabled,analytics:a.analytics}}),(function(n,a){const{navigate:r,currentTenant:t,location:o,companyId:i,handleDrawerToggle:d,analytics:c,isBillPayEnabled:p,isDebitCardFeatureEnabled:f}=a,{tenantEmailDomain:y}=t;return{onZeniAccountClick:(s,l)=>{c.trackAccountsListPageClicked("Accounts Row Item Click",l,"active");const h=Na(y,s),m=ie(o.state?.pathnameStackToGoBack,o.pathname);r(h,{state:{pathnameStackToGoBack:m}})},onSettingsClick:()=>{c.trackAccountsListPageClicked("Settings Icon"),r("setup")},onReloadTransactions:()=>{n(Ne(!1))},handleMoveMoneyOptionSelection:(s,l)=>{let h="page-not-found";s==="sendMoney"&&(h=cn(y)),s==="payBill"?h=on(t,p,f):s==="transfer"?(h=sn(y),l!=null&&n(Ye(l))):s==="checkDeposit"&&(h=rn(y));const m=ie(o.state?.pathnameStackToGoBack,o.pathname);r(h,{state:{pathnameStackToGoBack:m}})},unlinkPaymentAccount:(s,l)=>{c.trackAccountsListPageClicked("Unlink Account",l),n(Qn(s))},onFetchLinkTokenClick:(s,l)=>{n(Ge("external_account",s,l))},onUpdatePaymentAccountStatus:(s,l,h)=>{n(Yn(s,l,"zeni_accounts","external_account",h))},onEstablishConnectionClick:s=>{n(He(s,i,"external_account",void 0,"link_external_account"))},onCreateCheckingClick:s=>{n(Xn(s))},onClickMenuIcon:()=>{d(!0)},onAutoTransferClick:s=>{const l="./auto-transfer";s?r(l,{state:{...o.state,scrollToAddRule:!0}}):r(l)}}}))(ma);function fe({isTransferDrawerOpen:n,isCheckDepositDrawerOpen:a}){const r=W(),t=ne(),o=_(),i=z(),{tenantEmailDomain:d}=N(),{useDynamicConfig:c,useFeatureGate:p}=Z(),f=U(),{configValue:y}=c(G.zeniAccountsConfig),{isFeatureEnabled:s}=p(V.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=p(V.isAutoTransferRuleEnabled),h=he(y),m=k(($=>L($))),P=m.companyId??b.getSignedInUserTenant(d)?.companyId,{configValue:D}=c(G.expressPayConfig),w=D.is_enable_all_tenants===!0||D.tenant_ids!=null&&D.tenant_ids.includes(m.tenantId),[I,C]=g.useState(!1),[A,E]=g.useState(!1),[T,v]=g.useState(!1),[j,R]=g.useState(!1),S=k(($=>We($))),B=S.fetchState,u=k(($=>Ue($))),M=u?.fetchState??"Not-Started",pe=!!m.companyZeniAccountInfo?.info?.isZeniAccountEnabled,oe=te(),H=!!m.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted,q=ee(oe?.loggedInUserRoleMap),ln=ye(oe?.loggedInUserRoleMap),dn=!!m.companyBillPayInfo?.info?.isBillPayEnabled,De=b.getSignedInUser(),un={userId:De?.userId??"",sessionId:De?.zeniSessionId??"",tenantId:m.tenantId??""},pn=`${Ce}/account_details`,{areTenantIdsInSync:ke}=pa();g.useEffect((()=>{!I&&ke&&(C(!0),o(Ne(!1)))}),[I,o,B,ke]),g.useEffect((()=>{!A&&M==="Not-Started"&&P&&(E(!0),o(_e(!0)))}),[A,M,P,o]),g.useEffect((()=>{n!=null&&n===!0?v(!0):(v(!1),document.body.style.overflow="auto")}),[n]),g.useEffect((()=>{R(a!=null&&a===!0)}),[a]);const Ie=()=>{v(!1),t("..")},[mn,gn]=g.useState(!1),Se=$=>{gn($)},{isAiCfoAccessEnabled:fn,onAskAiCfoClick:hn}=nn({mobileExploreReferrer:"Checking Accounts"});Je({isDataReady:B==="Completed"});const yn=Xe(m),xn=xe(s,m);return yn===!0&&xn!==!0?e.jsx(en,{}):pe?e.jsxs(e.Fragment,{children:[S.fetchState==="Completed"&&T===!1&&j===!1?e.jsx(de,{analytics:O,onLoad:$=>(Cn=>{Cn.trackAccountsListPageViewed(S.depositAccountsSelectorView.depositAccounts.length,S.externalAccountsSelectorView.paymentAccounts.length,Be(S.summary?.totalBalance.available.amount??0),Be(S.summary?.totalInterest.available.amount??0),S.zeniAccountsConfig.zeniAccountsConfigDetail.annualPercentageYield)})($)}):null,T===!0?e.jsx(tn,{closeDrawerHandler:Ie,isTransferDrawerOpen:T,zeniAccountsConfig:S.zeniAccountsConfig,authParams:un,downloadAccountDetailEndPoint:pn}):null,j===!0?e.jsx(an,{closeDrawerHandler:Ie,isCheckDepositDrawerOpen:j}):null,e.jsxs(Ga,{windowSize:i,children:[e.jsx(ue,{isAppContentDrawerOpen:mn,handleDrawerToggle:Se}),e.jsx(Wa,{zeniBankListView:S,navigate:t,currentTenant:m,location:r,companyId:P,analytics:O,maxInsuredAmount:h.maxInsuredAmount,isExpressPayEnabled:w,isBillPayEnabled:dn,isDebitCardFeatureEnabled:s,isAutoTransferRuleEnabled:l,handleDrawerToggle:Se,isAiCfoAccessEnabled:fn,onAskAiCfoClick:hn})]})]}):H&&q?e.jsx(J,{to:"../setup"}):m.companyZeniAccountInfo?.info&&!H&&ln?e.jsx(J,{to:"../promo",state:r.state}):e.jsx(le,{fetchState:"In-Progress",style:{backgroundColor:f.colors.grey5}})}const on=(n,a,r)=>{const t=xe(r,n),{tenantEmailDomain:o}=n;return t===!0||a===!1?`/${o}/bills`:`/${o}/bill/new`},Na=(n,a)=>`/${n}/checking/${a}`,sn=(n,a)=>a==null?`/${n}/checking/transfer`:`/${n}/checking/${a}/transfer`,rn=(n,a)=>a==null?`/${n}/checking/check-deposit`:`/${n}/checking/${a}/check-deposit`,cn=n=>`/${n}/checking/express-pay`,Xa=F.div`
50
50
  display: flex;
51
51
  width: 100%;
52
52
  flex: 1 1 auto;
@@ -54,4 +54,4 @@ import{j as e}from"./liveblocks-D0aPwrEa.js";import{u as _,h as ne,g as W,i as N
54
54
  align-items: center;
55
55
  min-height: 100vh;
56
56
  background-color: ${n=>n.theme.colors.grey4};
57
- `,Ya=ae((function(n,a){const{currentTenant:r}=a,t=Qe(n,a.accountId),o=b.getSignedInUser(),i=n.tenantState.currentTenantId,d={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:i??""},c=t.accountDetail?.id??"";return{currentTenantCompanyName:r.companyName??"",authParams:d,downloadEndPoint:`${Ae.bankingMicroServiceBaseUrl}/1.0/deposit-accounts/${c}`,zeniAccountDetail:t,isExpressPayEnabled:a.isExpressPayEnabled,fetchState:t.fetchState}}),(function(n,a){const{navigate:r,currentTenant:t,location:o,accountId:i}=a,{tenantEmailDomain:d}=t;return{handleMoveMoneyOptionSelection:(c,p)=>{let h="page-not-found";c==="sendMoney"?h=cn(d):c==="payBill"?h=on(t,a.isBillPayEnabled,a.isDebitCardFeatureEnabled):c==="transfer"?(h=sn(d,i),p!=null&&n(Ye(p))):c==="checkDeposit"?(h=rn(d,i),p!=null&&n(qn(p))):c==="accountStatement"&&(h=qa(d,i));const y=ie(o.state?.pathnameStackToGoBack,o.pathname);r(h,{state:{pathnameStackToGoBack:y}})},onAccountDetailClick:()=>{const c=Qa(d,i),p=ie(o.state?.pathnameStackToGoBack,o.pathname);r(c,{state:{pathnameStackToGoBack:p}})},onEditNameClick:c=>{n(Ee(i,"editName",c))},onReloadZeniAccountDetailPage:()=>{n(qe(i,!1))},onCloseAccountClick:()=>{n(Ee(i,"closeAccount",""))},onBackClick:()=>{r("../",{relative:"path"})}}}))(ga);function re({isTransferDrawerOpen:n,isCheckDepositDrawerOpen:a,isAccountInfoDrawerOpen:r}){const t=W(),o=ne(),i=_(),d=z(),{tenantEmailDomain:c,accountId:p}=N(),{useDynamicConfig:h}=Z(),{useFeatureGate:y}=Z(),{isFeatureEnabled:s}=y(V.isDebitCardFeatureEnabled),l=k((q=>R(q))),{configValue:f}=h(G.expressPayConfig),m=f.is_enable_all_tenants===!0||f.tenant_ids!=null&&f.tenant_ids.includes(l.tenantId),P=!!l.companyBillPayInfo?.info?.isBillPayEnabled,D=b.getSignedInUser(),w=l.companyId??b.getSignedInUserTenant(c)?.companyId,I={userId:D?.userId??"",sessionId:D?.zeniSessionId??"",tenantId:l.tenantId??""},C=`${Ce}/account_details`,[A,E]=g.useState(!1),[T,v]=g.useState(!1),[j,O]=g.useState(!1),[S,B]=g.useState(!1),u=k((q=>Qe(q,p??""))),M=u.fetchState,{isAiCfoAccessEnabled:pe,onAskAiCfoClick:oe}=nn({mobileExploreReferrer:"Checking Account Detail"});Je({isDataReady:M==="Completed"}),g.useEffect((()=>{A||(i(qe(p??"",!1)),E(!0))}),[A,i,M]),g.useEffect((()=>{B(r!=null&&r===!0)}),[r]),g.useEffect((()=>{n!=null&&n===!0?v(!0):(v(!1),document.body.style.overflow="auto")}),[n]),g.useEffect((()=>{O(a!=null&&a===!0)}),[a]);const H=()=>{B(!1),o("..")};return e.jsxs(e.Fragment,{children:[S===!0&&u.accountDetail!=null?e.jsx($a,{authParams:I,downloadAccountDetailEndPoint:C,closeDrawerHandler:H,isAccountInfoDrawerOpen:S,zeniBankAccountDetail:u.accountDetail}):null,T===!0?e.jsx(tn,{closeDrawerHandler:H,isTransferDrawerOpen:T,zeniAccountsConfig:u.zeniAccountsConfig,authParams:I,downloadAccountDetailEndPoint:C}):null,j===!0?e.jsx(an,{closeDrawerHandler:H,isCheckDepositDrawerOpen:j}):null,e.jsx(Xa,{windowSize:d,children:e.jsx(Ya,{navigate:o,currentTenant:l,location:t,companyId:w,isDebitCardFeatureEnabled:s,accountId:p??"",isBillPayEnabled:P,isExpressPayEnabled:m,isAiCfoAccessEnabled:pe,onAskAiCfoClick:oe})})]})}const Qa=(n,a)=>`/${n}/checking/${a}/account-info`,qa=(n,a)=>`/${n}/checking/${a}/statements`,Ka=ae((function(n,a){const{companyId:r}=a;return{zeniAccountSetupView:Kn(n,r)}}),(function(n,a){const{navigate:r,companyId:t}=a;return{onSetupButtonClick:()=>{L.trackAccountsPromoPageClicked("Setup Accounts"),n(Jn(t))},onBackClick:()=>{r("../..",{relative:"path"})},onSetupZeniAccountSuccess:()=>{r("../setup",{relative:"path"})}}}))(ya),Ja=()=>{const n=ne(),a=W(),{tenantEmailDomain:r}=N(),{useDynamicConfig:t}=Z(),o=ha(),i=U(),[d,c]=g.useState(!1),[p,h]=g.useState(!1),y=k((A=>R(A))),{configValue:s}=t(G.zeniAccountsConfig),l=fe(s);g.useEffect((()=>{p===!1&&a.state?.message==="activation"&&h(!0)}),[a.state]);const f=b.getSignedInUserTenant(r)?.companyId??y.companyId,m=b.getSignedInUser(),P=!!y.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted,D=A=>{c(A)};if(m==null)throw Error("Can't access Zeni account promo page without signing in...");const w=te(),I=ee(w?.loggedInUserRoleMap),C=ye(w?.loggedInUserRoleMap);if(P&&I)return e.jsx(J,{to:"../../checking/setup"});if(y.company?.companyZeniAccountInfo&&(!P&&I||C)){if(a.state?.message==="activation"){const A=Ke(a.state?.pathnameStackToGoBack);n(a.pathname,{state:{...a.state,message:void 0,pathnameStackToGoBack:A.newStack}})}return e.jsxs(e.Fragment,{children:[e.jsx(fa,{showConfetti:p}),e.jsx(de,{analytics:L,onLoad:A=>(E=>E.trackPageLoaded(we.Event.accountsPromoPageViewed))(A)}),e.jsx(ue,{isAppContentDrawerOpen:d,handleDrawerToggle:D}),e.jsx(Ka,{analytics:L,navigate:n,companyId:f,meetingUrl:o("zeni_accounts_promo"),onClickMenuIcon:()=>{D(!0)},maxAnnualPercentageYield:l.maxAnnualPercentageYield,maxInsuredAmount:l.maxInsuredAmount,exampleBankBalance:3e6})]})}return e.jsx(le,{fetchState:"In-Progress",style:{backgroundColor:i.colors.grey5}})};function jt(){const n=W(),a=k((S=>R(S))),r=U(),{useFeatureGate:t,useDynamicConfig:o}=Z(),i=te(),d=ee(i?.loggedInUserRoleMap),c=ye(i?.loggedInUserRoleMap),p=!!a.company?.companyZeniAccountInfo?.isZeniAccountEnabled,h=!!a.company?.companyZeniAccountInfo?.isZeniAccountTOSAccepted,{isFeatureEnabled:y}=t(V.isChargeCardFeatureEnabled),{isFeatureEnabled:s}=t(V.isDebitCardFeatureEnabled),l=Xe(a),f=xe(s,a),m=a?.userRole!=null&&ea(a?.userRole),P=(a?.company==null||a.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!m)&&na(i?.loggedInUserRoleMap),D=aa(i?.loggedInUserRoleMap),w=(a?.company==null||a.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!m)&&ta(i?.loggedInUserRoleMap),I=!!a.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!m,{configValue:C}=o(G.expressPayConfig),A=C.is_enable_all_tenants===!0||C.tenant_ids!=null&&C.tenant_ids.includes(a.tenantId),{isFeatureEnabled:E}=t(V.isAutoTransferRuleEnabled),T=xa(a,y,s)&&!m&&oa(i?.loggedInUserRoleMap),v=sa(i?.loggedInUserRoleMap),j=I&&ee(i?.loggedInUserRoleMap),O=j||ze(i?.loggedInUserRoleMap);return e.jsxs(Re,{children:[e.jsx(x,{path:"setup",element:e.jsx(Oe,{isBillPayAdminLevelAccess:P,isUserHasOnlyBillPayAccess:D,isReimbursementAdminLevelAccess:w,isZeniAccountAdminLevelAccess:j,isChargeCardAdminLevelAccess:T,isUserHasOnlyCardAccess:v,productType:"zeni_accounts",type:"setup"})}),e.jsx(x,{path:"verification",element:e.jsx(Oe,{isBillPayAdminLevelAccess:P,isUserHasOnlyBillPayAccess:D,isReimbursementAdminLevelAccess:w,isZeniAccountAdminLevelAccess:j,isChargeCardAdminLevelAccess:T,isUserHasOnlyCardAccess:v,productType:"zeni_accounts",type:"verification"})}),E?e.jsxs(e.Fragment,{children:[e.jsx(x,{path:"auto-transfer",element:e.jsx(Le,{})}),O?e.jsx(x,{path:"auto-transfer/:ruleId/edit",element:e.jsx(Le,{isEditDrawerOpen:!0})}):null]}):e.jsx(x,{path:"auto-transfer",element:e.jsx(K,{})}),A&&d?e.jsxs(e.Fragment,{children:[e.jsx(x,{path:"express-pay",element:e.jsx(se,{})}),e.jsx(x,{path:"express-pay/add-ach",element:e.jsx(se,{isAddACHDrawerOpen:!0})}),e.jsx(x,{path:"express-pay/add-wire/add-address",element:e.jsx(se,{isAddAddressDrawerOpen:!0})}),e.jsx(x,{path:"express-pay/add-wire",element:e.jsx(se,{isAddWireDrawerOpen:!0})})]}):e.jsx(x,{path:"express-pay",element:e.jsx(K,{})}),e.jsx(x,{path:"promo",element:e.jsx(Ja,{})}),l&&!f?e.jsx(x,{path:"/*",element:e.jsx(en,{})}):p?e.jsxs(e.Fragment,{children:[e.jsx(x,{path:"/",element:e.jsx(he,{})}),e.jsx(x,{path:"transfer",element:e.jsx(he,{isTransferDrawerOpen:!0})}),e.jsx(x,{path:"check-deposit",element:e.jsx(he,{isCheckDepositDrawerOpen:!0})}),e.jsx(x,{path:"cash_management/*",element:e.jsx(K,{})}),e.jsx(x,{path:":accountId/*",element:e.jsx(et,{})}),e.jsx(x,{path:"*",element:e.jsx(K,{})})]}):h&&d?e.jsx(x,{path:"*",element:e.jsx(J,{to:"../setup"})}):a.company?.companyZeniAccountInfo&&c?e.jsx(x,{path:"*",element:e.jsx(J,{to:"../promo",state:n.state})}):e.jsx(x,{path:"*",element:e.jsx(le,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5,boxShadow:`0px 2px ${Ca.sp1} ${r.colors.dropShadowNormal}`}})})]})}function et(){return e.jsxs(Re,{children:[e.jsx(x,{path:"/",element:e.jsx(re,{})}),e.jsx(x,{path:"account-info",element:e.jsx(re,{isAccountInfoDrawerOpen:!0})}),e.jsx(x,{path:"transfer",element:e.jsx(re,{isTransferDrawerOpen:!0})}),e.jsx(x,{path:"check-deposit",element:e.jsx(re,{isCheckDepositDrawerOpen:!0})}),e.jsx(x,{path:"statements",element:e.jsx(Ia,{})}),e.jsx(x,{path:"*",element:e.jsx(K,{})})]})}export{jt as default};
57
+ `,Ya=ae((function(n,a){const{currentTenant:r}=a,t=Qe(n,a.accountId),o=b.getSignedInUser(),i=n.tenantState.currentTenantId,d={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:i??""},c=t.accountDetail?.id??"";return{currentTenantCompanyName:r.companyName??"",authParams:d,downloadEndPoint:`${Ae.bankingMicroServiceBaseUrl}/1.0/deposit-accounts/${c}`,zeniAccountDetail:t,isExpressPayEnabled:a.isExpressPayEnabled,fetchState:t.fetchState}}),(function(n,a){const{navigate:r,currentTenant:t,location:o,accountId:i}=a,{tenantEmailDomain:d}=t;return{handleMoveMoneyOptionSelection:(c,p)=>{let f="page-not-found";c==="sendMoney"?f=cn(d):c==="payBill"?f=on(t,a.isBillPayEnabled,a.isDebitCardFeatureEnabled):c==="transfer"?(f=sn(d,i),p!=null&&n(Ye(p))):c==="checkDeposit"?(f=rn(d,i),p!=null&&n(qn(p))):c==="accountStatement"&&(f=qa(d,i));const y=ie(o.state?.pathnameStackToGoBack,o.pathname);r(f,{state:{pathnameStackToGoBack:y}})},onAccountDetailClick:()=>{const c=Qa(d,i),p=ie(o.state?.pathnameStackToGoBack,o.pathname);r(c,{state:{pathnameStackToGoBack:p}})},onEditNameClick:c=>{n(Ee(i,"editName",c))},onReloadZeniAccountDetailPage:()=>{n(qe(i,!1))},onCloseAccountClick:()=>{n(Ee(i,"closeAccount",""))},onBackClick:()=>{r("../",{relative:"path"})}}}))(ga);function re({isTransferDrawerOpen:n,isCheckDepositDrawerOpen:a,isAccountInfoDrawerOpen:r}){const t=W(),o=ne(),i=_(),d=z(),{tenantEmailDomain:c,accountId:p}=N(),{useDynamicConfig:f}=Z(),{useFeatureGate:y}=Z(),{isFeatureEnabled:s}=y(V.isDebitCardFeatureEnabled),l=k((q=>L(q))),{configValue:h}=f(G.expressPayConfig),m=h.is_enable_all_tenants===!0||h.tenant_ids!=null&&h.tenant_ids.includes(l.tenantId),P=!!l.companyBillPayInfo?.info?.isBillPayEnabled,D=b.getSignedInUser(),w=l.companyId??b.getSignedInUserTenant(c)?.companyId,I={userId:D?.userId??"",sessionId:D?.zeniSessionId??"",tenantId:l.tenantId??""},C=`${Ce}/account_details`,[A,E]=g.useState(!1),[T,v]=g.useState(!1),[j,R]=g.useState(!1),[S,B]=g.useState(!1),u=k((q=>Qe(q,p??""))),M=u.fetchState,{isAiCfoAccessEnabled:pe,onAskAiCfoClick:oe}=nn({mobileExploreReferrer:"Checking Account Detail"});Je({isDataReady:M==="Completed"}),g.useEffect((()=>{A||(i(qe(p??"",!1)),E(!0))}),[A,i,M]),g.useEffect((()=>{B(r!=null&&r===!0)}),[r]),g.useEffect((()=>{n!=null&&n===!0?v(!0):(v(!1),document.body.style.overflow="auto")}),[n]),g.useEffect((()=>{R(a!=null&&a===!0)}),[a]);const H=()=>{B(!1),o("..")};return e.jsxs(e.Fragment,{children:[S===!0&&u.accountDetail!=null?e.jsx($a,{authParams:I,downloadAccountDetailEndPoint:C,closeDrawerHandler:H,isAccountInfoDrawerOpen:S,zeniBankAccountDetail:u.accountDetail}):null,T===!0?e.jsx(tn,{closeDrawerHandler:H,isTransferDrawerOpen:T,zeniAccountsConfig:u.zeniAccountsConfig,authParams:I,downloadAccountDetailEndPoint:C}):null,j===!0?e.jsx(an,{closeDrawerHandler:H,isCheckDepositDrawerOpen:j}):null,e.jsx(Xa,{windowSize:d,children:e.jsx(Ya,{navigate:o,currentTenant:l,location:t,companyId:w,isDebitCardFeatureEnabled:s,accountId:p??"",isBillPayEnabled:P,isExpressPayEnabled:m,isAiCfoAccessEnabled:pe,onAskAiCfoClick:oe})})]})}const Qa=(n,a)=>`/${n}/checking/${a}/account-info`,qa=(n,a)=>`/${n}/checking/${a}/statements`,Ka=ae((function(n,a){const{companyId:r}=a;return{zeniAccountSetupView:Kn(n,r)}}),(function(n,a){const{navigate:r,companyId:t}=a;return{onSetupButtonClick:()=>{O.trackAccountsPromoPageClicked("Setup Accounts"),n(Jn(t))},onBackClick:()=>{r("../..",{relative:"path"})},onSetupZeniAccountSuccess:()=>{r("../setup",{relative:"path"})}}}))(ya),Ja=()=>{const n=ne(),a=W(),{tenantEmailDomain:r}=N(),{useDynamicConfig:t}=Z(),o=fa(),i=U(),[d,c]=g.useState(!1),[p,f]=g.useState(!1),y=k((A=>L(A))),{configValue:s}=t(G.zeniAccountsConfig),l=he(s);g.useEffect((()=>{p===!1&&a.state?.message==="activation"&&f(!0)}),[a.state]);const h=b.getSignedInUserTenant(r)?.companyId??y.companyId,m=b.getSignedInUser(),P=!!y.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted,D=A=>{c(A)};if(m==null)throw Error("Can't access Zeni account promo page without signing in...");const w=te(),I=ee(w?.loggedInUserRoleMap),C=ye(w?.loggedInUserRoleMap);if(P&&I)return e.jsx(J,{to:"../../checking/setup"});if(y.company?.companyZeniAccountInfo&&(!P&&I||C)){if(a.state?.message==="activation"){const A=Ke(a.state?.pathnameStackToGoBack);n(a.pathname,{state:{...a.state,message:void 0,pathnameStackToGoBack:A.newStack}})}return e.jsxs(e.Fragment,{children:[e.jsx(ha,{showConfetti:p}),e.jsx(de,{analytics:O,onLoad:A=>(E=>E.trackPageLoaded(we.Event.accountsPromoPageViewed))(A)}),e.jsx(ue,{isAppContentDrawerOpen:d,handleDrawerToggle:D}),e.jsx(Ka,{analytics:O,navigate:n,companyId:h,meetingUrl:o("zeni_accounts_promo"),onClickMenuIcon:()=>{D(!0)},maxAnnualPercentageYield:l.maxAnnualPercentageYield,maxInsuredAmount:l.maxInsuredAmount,exampleBankBalance:3e6})]})}return e.jsx(le,{fetchState:"In-Progress",style:{backgroundColor:i.colors.grey5}})};function jt(){const n=W(),a=k((S=>L(S))),r=U(),{useFeatureGate:t,useDynamicConfig:o}=Z(),i=te(),d=ee(i?.loggedInUserRoleMap),c=ye(i?.loggedInUserRoleMap),p=!!a.company?.companyZeniAccountInfo?.isZeniAccountEnabled,f=!!a.company?.companyZeniAccountInfo?.isZeniAccountTOSAccepted,{isFeatureEnabled:y}=t(V.isChargeCardFeatureEnabled),{isFeatureEnabled:s}=t(V.isDebitCardFeatureEnabled),l=Xe(a),h=xe(s,a),m=a?.userRole!=null&&ea(a?.userRole),P=(a?.company==null||a.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!m)&&na(i?.loggedInUserRoleMap),D=aa(i?.loggedInUserRoleMap),w=(a?.company==null||a.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!m)&&ta(i?.loggedInUserRoleMap),I=!!a.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!m,{configValue:C}=o(G.expressPayConfig),A=C.is_enable_all_tenants===!0||C.tenant_ids!=null&&C.tenant_ids.includes(a.tenantId),{isFeatureEnabled:E}=t(V.isAutoTransferRuleEnabled),T=xa(a,y,s)&&!m&&oa(i?.loggedInUserRoleMap),v=sa(i?.loggedInUserRoleMap),j=I&&ee(i?.loggedInUserRoleMap),R=j||ze(i?.loggedInUserRoleMap);return e.jsxs(Le,{children:[e.jsx(x,{path:"setup",element:e.jsx(Re,{isBillPayAdminLevelAccess:P,isUserHasOnlyBillPayAccess:D,isReimbursementAdminLevelAccess:w,isZeniAccountAdminLevelAccess:j,isChargeCardAdminLevelAccess:T,isUserHasOnlyCardAccess:v,productType:"zeni_accounts",type:"setup"})}),e.jsx(x,{path:"verification",element:e.jsx(Re,{isBillPayAdminLevelAccess:P,isUserHasOnlyBillPayAccess:D,isReimbursementAdminLevelAccess:w,isZeniAccountAdminLevelAccess:j,isChargeCardAdminLevelAccess:T,isUserHasOnlyCardAccess:v,productType:"zeni_accounts",type:"verification"})}),E?e.jsxs(e.Fragment,{children:[e.jsx(x,{path:"auto-transfer",element:e.jsx(Oe,{})}),R?e.jsx(x,{path:"auto-transfer/:ruleId/edit",element:e.jsx(Oe,{isEditDrawerOpen:!0})}):null]}):e.jsx(x,{path:"auto-transfer",element:e.jsx(K,{})}),A&&d?e.jsxs(e.Fragment,{children:[e.jsx(x,{path:"express-pay",element:e.jsx(se,{})}),e.jsx(x,{path:"express-pay/add-ach",element:e.jsx(se,{isAddACHDrawerOpen:!0})}),e.jsx(x,{path:"express-pay/add-wire/add-address",element:e.jsx(se,{isAddAddressDrawerOpen:!0})}),e.jsx(x,{path:"express-pay/add-wire",element:e.jsx(se,{isAddWireDrawerOpen:!0})})]}):e.jsx(x,{path:"express-pay",element:e.jsx(K,{})}),e.jsx(x,{path:"promo",element:e.jsx(Ja,{})}),l&&!h?e.jsx(x,{path:"/*",element:e.jsx(en,{})}):p?e.jsxs(e.Fragment,{children:[e.jsx(x,{path:"/",element:e.jsx(fe,{})}),e.jsx(x,{path:"transfer",element:e.jsx(fe,{isTransferDrawerOpen:!0})}),e.jsx(x,{path:"check-deposit",element:e.jsx(fe,{isCheckDepositDrawerOpen:!0})}),e.jsx(x,{path:"cash_management/*",element:e.jsx(K,{})}),e.jsx(x,{path:":accountId/*",element:e.jsx(et,{})}),e.jsx(x,{path:"*",element:e.jsx(K,{})})]}):f&&d?e.jsx(x,{path:"*",element:e.jsx(J,{to:"../setup"})}):a.company?.companyZeniAccountInfo&&c?e.jsx(x,{path:"*",element:e.jsx(J,{to:"../promo",state:n.state})}):e.jsx(x,{path:"*",element:e.jsx(le,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5,boxShadow:`0px 2px ${Ca.sp1} ${r.colors.dropShadowNormal}`}})})]})}function et(){return e.jsxs(Le,{children:[e.jsx(x,{path:"/",element:e.jsx(re,{})}),e.jsx(x,{path:"account-info",element:e.jsx(re,{isAccountInfoDrawerOpen:!0})}),e.jsx(x,{path:"transfer",element:e.jsx(re,{isTransferDrawerOpen:!0})}),e.jsx(x,{path:"check-deposit",element:e.jsx(re,{isCheckDepositDrawerOpen:!0})}),e.jsx(x,{path:"statements",element:e.jsx(Ia,{})}),e.jsx(x,{path:"*",element:e.jsx(K,{})})]})}export{jt as default};