@zeniai/web-app-ui 5.1.65-qa → 5.1.66-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 (159) hide show
  1. package/dist/assets/AddressRoutes-DEXYkqV1.js +1 -0
  2. package/dist/assets/{AddressScreen-C462o9IS.js → AddressScreen-D8kv1hF_.js} +2 -2
  3. package/dist/assets/AiCfoScreen-BrNLceCE.js +22 -0
  4. package/dist/assets/BillPayApprovalRoutes-CvKgF8Ok.js +1 -0
  5. package/dist/assets/BillPayRoutes-DYswIHAT.js +119 -0
  6. package/dist/assets/BusinessVerificationPageScreen-YVk91Fzz.js +9 -0
  7. package/dist/assets/CardsAiCfoScreen-BO5V838O.js +14 -0
  8. package/dist/assets/ChargeCardRoutes-BZOF502-.js +71 -0
  9. package/dist/assets/CompanyPassportScreen-CPKfXmmb.js +1 -0
  10. package/dist/assets/ConnectionAuthScreen-Cv-HiaYb.js +11 -0
  11. package/dist/assets/CustomerOnboardingAuthScreen-DdX8BaLn.js +1 -0
  12. package/dist/assets/CustomerOnboardingRoutes-CKdlHWlk.js +30 -0
  13. package/dist/assets/{DashboardRoutes-CdLho0oB.js → DashboardRoutes-CopaUmWi.js} +4 -4
  14. package/dist/assets/DefaultTenantHome-eT4t7R06.js +1 -0
  15. package/dist/assets/DomesticWireDetailScreen-Cbmuyang.js +18 -0
  16. package/dist/assets/DrawerScreen-CCxq1yzF.js +1 -0
  17. package/dist/assets/EntityDetailRoutes-DK7l7FnA.js +1 -0
  18. package/dist/assets/ExpenseAutomationRoutes-C3RWrFV-.js +25 -0
  19. package/dist/assets/FeaturePreviewScreen-BuXd4W0P.js +1 -0
  20. package/dist/assets/HubSpotOAuthCallbackScreen-D1enkInm.js +1 -0
  21. package/dist/assets/MagicLinkRoutes-BSRFSffK.js +72 -0
  22. package/dist/assets/MagicLinkSignInScreen-BSh1nXKM.js +12 -0
  23. package/dist/assets/{MobileAppDrawer-BB6nxZVq.js → MobileAppDrawer-BIP1MEKX.js} +1 -1
  24. package/dist/assets/NotFoundScreen-DY1Wwus4.js +1 -0
  25. package/dist/assets/NotificationRoutes-6rN7RQjW.js +1 -0
  26. package/dist/assets/OAuthConsentScreen-BqL6PD1E.js +1 -0
  27. package/dist/assets/PandLWithForecastRoutes-AcF3aqCk.js +1 -0
  28. package/dist/assets/PeopleRoutes-DPUTbQp_.js +22 -0
  29. package/dist/assets/PerformanceRoutes-Cn4Ovnir.js +1 -0
  30. package/dist/assets/{Preview-BcvozuOU.js → Preview-DDPGc7EO.js} +1 -1
  31. package/dist/assets/{QBOConnectionScreen-CoBJUifN.js → QBOConnectionScreen-BEQPddK1.js} +1 -1
  32. package/dist/assets/ReferralListScreen-CQycV-0F.js +5 -0
  33. package/dist/assets/ReimbursementApprovalRoutes-Ch3sYOOh.js +1 -0
  34. package/dist/assets/ReimbursementApprovalRuleDetailScreen-BJZRYRum.js +1 -0
  35. package/dist/assets/ReimbursementRoutes-CgQPRNMh.js +68 -0
  36. package/dist/assets/ReportsRoutes-CQztdl9E.js +1 -0
  37. package/dist/assets/RewardsRoutes-B0jOOo8W.js +1 -0
  38. package/dist/assets/ScreenRoutes-D7kpFxVk.js +2 -0
  39. package/dist/assets/SettingsRoutes-CdvEgvyN.js +57 -0
  40. package/dist/assets/SetupPagesScreen-Dh6d6vu-.js +29 -0
  41. package/dist/assets/SignInScreen-FuVo71JP.js +1 -0
  42. package/dist/assets/SignOutScreen-DJh4f2Aj.js +9 -0
  43. package/dist/assets/TaskListScreen-CnT3FhwB.js +9 -0
  44. package/dist/assets/TaskRoutes-BlDolQ3c.js +9 -0
  45. package/dist/assets/TransactionDetailRoutes-C2XNyTUH.js +1 -0
  46. package/dist/assets/TransactionDetailScreen-Ch_kEoMB.js +5 -0
  47. package/dist/assets/TransactionListRoutes-CAZZrQj-.js +1 -0
  48. package/dist/assets/TreasuryRoutes-BQCtQUx_.js +37 -0
  49. package/dist/assets/{VendorsRoutes-DUhDEUNQ.js → VendorsRoutes-BGB3F2EZ.js} +27 -27
  50. package/dist/assets/WiseConfirmationScreen-BSryCvdh.js +12 -0
  51. package/dist/assets/ZeniAccountRoutes-D-szpn5h.js +73 -0
  52. package/dist/assets/ZeniAccountStatementScreen-BORtLhU4.js +9 -0
  53. package/dist/assets/{accountMappingHelper-DcHRTvHW.js → accountMappingHelper-SrHoNEDL.js} +1 -1
  54. package/dist/assets/{analytics-C--DBRuq.js → analytics-CkLW7NeW.js} +1 -1
  55. package/dist/assets/{analyticsHelper-BYU7ljxB.js → analyticsHelper-BsiU5y2K.js} +1 -1
  56. package/dist/assets/{core-yFUZRhgi.js → core-Crl6eqZl.js} +2 -2
  57. package/dist/assets/{decodeURIComponentSafe-DJGiVKY3.js → decodeURIComponentSafe-DwYiSzjo.js} +1 -1
  58. package/dist/assets/dnd-tE28jHT7.js +6 -0
  59. package/dist/assets/{empty-DWXN0zXu.js → empty-BpRPQOis.js} +1 -1
  60. package/dist/assets/{index-BjC87z-8.js → empty-C7ggsb2s.js} +1 -1
  61. package/dist/assets/{emptyVideoElement-W528gJEP.js → emptyVideoElement-BvjVfzOS.js} +1 -1
  62. package/dist/assets/epic-Qgvh4PH7.js +2 -0
  63. package/dist/assets/getLocaleForTenant-DiFaMSxg.js +1 -0
  64. package/dist/assets/{index-BN3A7Q7k.js → index-B5it1rE5.js} +1 -1
  65. package/dist/assets/{index-R6GjjTB3.css → index-BUmr5maU.css} +1 -1
  66. package/dist/assets/index-BdlPaglK.js +1 -0
  67. package/dist/assets/{index-Tz5qKzzr.js → index-Bs_5Wou0.js} +2 -2
  68. package/dist/assets/{index-BiOCnxUr.js → index-CJknvk0s.js} +33673 -28214
  69. package/dist/assets/index-CZNTdKXM.js +1 -0
  70. package/dist/assets/{index-_WROnW1b.js → index-Cg0vsa8G.js} +1 -1
  71. package/dist/assets/{index-D6SI2XXD.js → index-D5ItYKRr.js} +1 -1
  72. package/dist/assets/{index-Biw-dXZD.js → index-Dvok4kj_.js} +1 -1
  73. package/dist/assets/{lexical-a5QW-f2c.js → lexical-Bm_vZOjC.js} +1 -1
  74. package/dist/assets/{liveblocks-DQxWCA7d.js → liveblocks-B5ZW-VBI.js} +1 -1
  75. package/dist/assets/{lottie-CUC8jYi2.js → lottie-hSeCd_VX.js} +1 -1
  76. package/dist/assets/{mui-ChC8whdU.js → mui-U77PQnc2.js} +1 -1
  77. package/dist/assets/{pathToGoBack-48OEEFN8.js → pathToGoBack-BWWNiH76.js} +1 -1
  78. package/dist/assets/{pdf-BzsAlPE_.js → pdf-DDcPh2pm.js} +4 -4
  79. package/dist/assets/{pdf-lib-Bunmyp1f.js → pdf-lib-ImawEH2S.js} +1 -1
  80. package/dist/assets/{plaid-G4AU8x-v.js → plaid-TCRHScH1.js} +1 -1
  81. package/dist/assets/{pusher-C00F4DWB.js → pusher-CimMrDFu.js} +1 -1
  82. package/dist/assets/{react-C6PubH1a.js → react-BUcjX1FU.js} +1 -1
  83. package/dist/assets/{react-gwfdXk9P.js → react-BghKQeK_.js} +1 -1
  84. package/dist/assets/{react-B-EV2fAl.js → react-DdRuig8o.js} +1 -1
  85. package/dist/assets/{react-B_Y4cViF.js → react-DyFf3w8Z.js} +1 -1
  86. package/dist/assets/{react-7oSJc21D.js → react-DzBjlQkv.js} +1 -1
  87. package/dist/assets/{react-y_zdXwGN.js → react-z5kfbX38.js} +1 -1
  88. package/dist/assets/{recharts-BPALCGe7.js → recharts-e5u-LCPv.js} +3 -3
  89. package/dist/assets/{routePaths-CpYaPUdg.js → routePaths-jWP9zfXs.js} +1 -1
  90. package/dist/assets/{sentry-yFsVWhao.js → sentry-BxWyF9h9.js} +1 -1
  91. package/dist/assets/{url-DdmozPE3.js → url-DTS3WRFG.js} +1 -1
  92. package/dist/assets/{url-CItc7ZnZ.js → url-jBDeguac.js} +1 -1
  93. package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-CgykUI65.js +1 -0
  94. package/dist/assets/useAskAiCfoHostNavButtonProps-BAtYgUWq.js +1 -0
  95. package/dist/assets/useCashManagementBanner-CRbG3Xtj.js +1 -0
  96. package/dist/assets/useChargeCardPusherEvents-Dq1SGHUY.js +1 -0
  97. package/dist/assets/{useDeviceId-BY2vlOSe.js → useDeviceId-BZa5m-bZ.js} +1 -1
  98. package/dist/assets/useEmailConnectResultRefresh-CiGW-Jar.js +1 -0
  99. package/dist/assets/useInitialThreadRequest-DZr1J4rc.js +1 -0
  100. package/dist/assets/{utils-CaIGWeOv.js → utils-BjvWDnmB.js} +2 -2
  101. package/dist/assets/withTransactionSidePanel-DKnep6Xn.js +21 -0
  102. package/dist/assets/zeni-epic-state-DTyrT1Ga.js +13 -0
  103. package/dist/index.html +1 -1
  104. package/package.json +4 -4
  105. package/dist/assets/AddressRoutes-B8Ckgpa3.js +0 -1
  106. package/dist/assets/AiCfoScreen-jf_vh6RV.js +0 -22
  107. package/dist/assets/BillPayApprovalRoutes-Dv07YBai.js +0 -1
  108. package/dist/assets/BillPayRoutes-BfH1dGV8.js +0 -119
  109. package/dist/assets/BusinessVerificationPageScreen-NFhMF-eZ.js +0 -9
  110. package/dist/assets/ChargeCardRoutes-CmSQC_Lv.js +0 -71
  111. package/dist/assets/CompanyPassportScreen-BTh0h3W9.js +0 -1
  112. package/dist/assets/ConnectionAuthScreen-DbUrzBEF.js +0 -11
  113. package/dist/assets/CustomerOnboardingAuthScreen-DSwHpsbC.js +0 -1
  114. package/dist/assets/CustomerOnboardingRoutes-D6x8LO5z.js +0 -23
  115. package/dist/assets/DefaultTenantHome-Cvz__eKe.js +0 -1
  116. package/dist/assets/DomesticWireDetailScreen-Fo4R4YRQ.js +0 -18
  117. package/dist/assets/DrawerScreen-DHL_W742.js +0 -1
  118. package/dist/assets/EntityDetailRoutes-OYUKZsw7.js +0 -1
  119. package/dist/assets/ExpenseAutomationRoutes-BSNLpHm-.js +0 -25
  120. package/dist/assets/FeaturePreviewScreen-CEy-pIWu.js +0 -1
  121. package/dist/assets/HubSpotOAuthCallbackScreen-DYNBQ5WX.js +0 -1
  122. package/dist/assets/MagicLinkRoutes-AN0N6Bbm.js +0 -72
  123. package/dist/assets/MagicLinkSignInScreen-CABl7ivE.js +0 -12
  124. package/dist/assets/NotFoundScreen-DxqYM2wk.js +0 -1
  125. package/dist/assets/NotificationRoutes-CcsjMt50.js +0 -1
  126. package/dist/assets/OAuthConsentScreen-DuYRDMYr.js +0 -1
  127. package/dist/assets/PandLWithForecastRoutes-D-lH2ScL.js +0 -1
  128. package/dist/assets/PeopleRoutes-D8H5LhLo.js +0 -22
  129. package/dist/assets/PerformanceRoutes-CrUlvbe8.js +0 -1
  130. package/dist/assets/ReferralListScreen-CAddpyLT.js +0 -5
  131. package/dist/assets/ReimbursementApprovalRoutes-OLrHIpq5.js +0 -1
  132. package/dist/assets/ReimbursementApprovalRuleDetailScreen-DrKUThOY.js +0 -1
  133. package/dist/assets/ReimbursementRoutes-CC_SGbNZ.js +0 -68
  134. package/dist/assets/ReportsRoutes-BWCj8bTz.js +0 -1
  135. package/dist/assets/RewardsRoutes-DtcaGdke.js +0 -1
  136. package/dist/assets/ScreenRoutes-JqGTg3y4.js +0 -2
  137. package/dist/assets/SettingsRoutes-BTveFGVQ.js +0 -57
  138. package/dist/assets/SetupPagesScreen-3YiJuF5G.js +0 -29
  139. package/dist/assets/SignInScreen-BWGG1xLU.js +0 -1
  140. package/dist/assets/SignOutScreen-DnGtoVfY.js +0 -9
  141. package/dist/assets/TaskListScreen-Nj-zc58y.js +0 -9
  142. package/dist/assets/TaskRoutes-B_U8Y-wv.js +0 -9
  143. package/dist/assets/TransactionDetailRoutes-DTXuYQuX.js +0 -1
  144. package/dist/assets/TransactionDetailScreen-BN5X1_PJ.js +0 -5
  145. package/dist/assets/TransactionListRoutes-CKJb2lcU.js +0 -1
  146. package/dist/assets/TreasuryRoutes-DvRWBU40.js +0 -37
  147. package/dist/assets/WiseConfirmationScreen-Db88Xwe3.js +0 -12
  148. package/dist/assets/ZeniAccountRoutes-D1NhLIdB.js +0 -57
  149. package/dist/assets/ZeniAccountStatementScreen-CszrCwc6.js +0 -9
  150. package/dist/assets/dnd-BsfjgQaS.js +0 -6
  151. package/dist/assets/empty-36OhCPgu.js +0 -1
  152. package/dist/assets/epic-CIRzUJFx.js +0 -2
  153. package/dist/assets/getLocaleForTenant-BhAx8guK.js +0 -1
  154. package/dist/assets/index-D8lrtix7.js +0 -1
  155. package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-ouZaiHV2.js +0 -1
  156. package/dist/assets/useAskAiCfoHostNavButtonProps-BsQuCyy5.js +0 -1
  157. package/dist/assets/useInitialThreadRequest-CTq6SdMM.js +0 -1
  158. package/dist/assets/withTransactionSidePanel-CNVv5_p9.js +0 -21
  159. package/dist/assets/zeni-epic-state-Co_KJ39L.js +0 -13
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-CopaUmWi.js","assets/sentry-BxWyF9h9.js","assets/core-Crl6eqZl.js","assets/zeni-epic-state-DTyrT1Ga.js","assets/index-CJknvk0s.js","assets/mui-U77PQnc2.js","assets/analytics-CkLW7NeW.js","assets/utils-BjvWDnmB.js","assets/withTransactionSidePanel-DKnep6Xn.js","assets/useAskAiCfoHostNavButtonProps-BAtYgUWq.js","assets/TransactionDetailScreen-Ch_kEoMB.js","assets/decodeURIComponentSafe-DwYiSzjo.js","assets/routePaths-jWP9zfXs.js","assets/NotFoundScreen-DY1Wwus4.js","assets/useInitialThreadRequest-DZr1J4rc.js","assets/analyticsHelper-BsiU5y2K.js","assets/CompanyPassportScreen-CPKfXmmb.js","assets/MobileAppDrawer-BIP1MEKX.js","assets/useAiCfoDashboardSuggestedQuestionsChips-CgykUI65.js","assets/FeaturePreviewScreen-BuXd4W0P.js","assets/ReferralListScreen-CQycV-0F.js","assets/index-BUmr5maU.css","assets/BillPayRoutes-DYswIHAT.js","assets/AddressScreen-D8kv1hF_.js","assets/DomesticWireDetailScreen-Cbmuyang.js","assets/DrawerScreen-CCxq1yzF.js","assets/SetupPagesScreen-Dh6d6vu-.js","assets/BusinessVerificationPageScreen-YVk91Fzz.js","assets/BillPayApprovalRoutes-CvKgF8Ok.js","assets/ReimbursementApprovalRuleDetailScreen-BJZRYRum.js","assets/getLocaleForTenant-DiFaMSxg.js","assets/ReimbursementRoutes-CgQPRNMh.js","assets/ReimbursementApprovalRoutes-Ch3sYOOh.js","assets/TransactionListRoutes-CAZZrQj-.js","assets/ZeniAccountStatementScreen-BORtLhU4.js","assets/SettingsRoutes-CdvEgvyN.js","assets/accountMappingHelper-SrHoNEDL.js","assets/QBOConnectionScreen-BEQPddK1.js","assets/empty-BpRPQOis.js","assets/index-D5ItYKRr.js","assets/url-jBDeguac.js","assets/index-CZNTdKXM.js","assets/useEmailConnectResultRefresh-CiGW-Jar.js","assets/ReportsRoutes-CQztdl9E.js","assets/ChargeCardRoutes-BZOF502-.js","assets/useChargeCardPusherEvents-Dq1SGHUY.js","assets/PeopleRoutes-DPUTbQp_.js","assets/ExpenseAutomationRoutes-C3RWrFV-.js","assets/TreasuryRoutes-BQCtQUx_.js","assets/useCashManagementBanner-CRbG3Xtj.js","assets/VendorsRoutes-BGB3F2EZ.js","assets/pathToGoBack-BWWNiH76.js","assets/ZeniAccountRoutes-D-szpn5h.js","assets/AddressRoutes-DEXYkqV1.js","assets/PandLWithForecastRoutes-AcF3aqCk.js","assets/CustomerOnboardingRoutes-CKdlHWlk.js","assets/TransactionDetailRoutes-C2XNyTUH.js","assets/EntityDetailRoutes-DK7l7FnA.js","assets/NotificationRoutes-6rN7RQjW.js","assets/PerformanceRoutes-Cn4Ovnir.js","assets/RewardsRoutes-B0jOOo8W.js","assets/TaskRoutes-BlDolQ3c.js","assets/TaskListScreen-CnT3FhwB.js","assets/AiCfoScreen-BrNLceCE.js","assets/CardsAiCfoScreen-BO5V838O.js"])))=>i.map(i=>d[i]);
2
+ import{_ as a,bn as is,eW as rs,fD as os,fB as ls,fC as cs,gk as ds,fq as ms,cT as ge,cA as us,fT as _s,cs as ps,bE as As,bo as Es,fY as gs,v as xs,LV as Is,bs as Ts,LW as js,bK as hs,fV as Us,bJ as bs,bt as Rs,co as Hs,LX as Ds,LY as ys,cQ as fs,cS as Cs,cR as vs,cz as Os,cG as Ps,o9 as xe,fz as Ie,gu as Fs,g0 as Te,gr as je,gs as he,g1 as Ls}from"./zeni-epic-state-DTyrT1Ga.js";import{j as e}from"./liveblocks-B5ZW-VBI.js";import{a as v}from"./sentry-BxWyF9h9.js";import{u as ks,h as Bs,i as Vs,g as Ss,j as G,l as Ue,N as c,o as Ns,p as t}from"./core-Crl6eqZl.js";import{m as Ms,u as Zs,z as R,W as ws,a as zs,E as Gs,Q as B,I as $s,L as F,F as be,t as _,P as Ws,c as ee,l}from"./index-CJknvk0s.js";import"./mui-U77PQnc2.js";import{f as Re}from"./analyticsHelper-BsiU5y2K.js";import{t as Ys}from"./getLocaleForTenant-DiFaMSxg.js";import"./recharts-e5u-LCPv.js";import"./analytics-CkLW7NeW.js";import"./plaid-TCRHScH1.js";import"./dnd-tE28jHT7.js";import"./stripe-DMRn4zHo.js";import"./lottie-hSeCd_VX.js";import"./lexical-Bm_vZOjC.js";import"./pdf-DDcPh2pm.js";import"./utils-BjvWDnmB.js";(function(){try{var i=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},U=new i.Error().stack;U&&(i._sentryDebugIds=i._sentryDebugIds||{},i._sentryDebugIds[U]="2f41eaaa-7bcb-4b2c-85ef-dbb771e7ab92",i._sentryDebugIdIdentifier="sentry-dbid-2f41eaaa-7bcb-4b2c-85ef-dbb771e7ab92")}catch{}})();const qs={dashboard:()=>a(()=>import("./DashboardRoutes-CopaUmWi.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),bills:()=>a(()=>import("./BillPayRoutes-DYswIHAT.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21])),reimbursement:()=>a(()=>import("./ReimbursementRoutes-CgQPRNMh.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21])),transactions:()=>a(()=>import("./TransactionListRoutes-CAZZrQj-.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21])),settings:()=>a(()=>import("./SettingsRoutes-CdvEgvyN.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,11,42,28,29,32,21])),reports:()=>a(()=>import("./ReportsRoutes-CQztdl9E.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,13,19,14,12,17,21])),chargeCards:()=>a(()=>import("./ChargeCardRoutes-BZOF502-.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,45,23,21])),people:()=>a(()=>import("./PeopleRoutes-DPUTbQp_.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,9,17,21])),expenseAutomation:()=>a(()=>import("./ExpenseAutomationRoutes-C3RWrFV-.js"),__vite__mapDeps([47,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21])),treasury:()=>a(()=>import("./TreasuryRoutes-BQCtQUx_.js"),__vite__mapDeps([48,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,49,19,21])),vendors:()=>a(()=>import("./VendorsRoutes-BGB3F2EZ.js"),__vite__mapDeps([50,1,2,3,4,5,6,7,23,13,19,12,51,9,17,25,36,21])),zeniAccounts:()=>a(()=>import("./ZeniAccountRoutes-D-szpn5h.js"),__vite__mapDeps([52,1,2,3,4,5,6,7,49,13,26,17,15,12,27,19,24,23,9,34,21]))},Qs=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],se=i=>{"requestIdleCallback"in window?requestIdleCallback(i):setTimeout(i,100)},Js=l(()=>a(()=>import("./ReportsRoutes-CQztdl9E.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,13,19,14,12,17,21]))),Ks=l(()=>a(()=>import("./AddressRoutes-DEXYkqV1.js"),__vite__mapDeps([53,1,2,3,23,4,5,6,7,13,21]))),Xs=l(()=>a(()=>import("./PeopleRoutes-DPUTbQp_.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,9,17,21]))),ea=l(()=>a(()=>import("./PandLWithForecastRoutes-AcF3aqCk.js"),__vite__mapDeps([54,1,2,3,4,5,6,7,13,19,9,14,12,17,21]))),sa=l(()=>a(()=>import("./CustomerOnboardingRoutes-CKdlHWlk.js"),__vite__mapDeps([55,1,2,3,23,4,5,6,7,13,37,38,39,40,41,11,42,45,21]))),aa=l(()=>a(()=>import("./VendorsRoutes-BGB3F2EZ.js"),__vite__mapDeps([50,1,2,3,4,5,6,7,23,13,19,12,51,9,17,25,36,21]))),na=l(()=>a(()=>import("./TransactionDetailRoutes-C2XNyTUH.js"),__vite__mapDeps([56,1,2,3,13,4,5,6,7,10,9,11,12,21]))),He=l(()=>a(()=>import("./EntityDetailRoutes-DK7l7FnA.js"),__vite__mapDeps([57,1,2,3,4,5,6,7,11,8,9,10,12,21]))),ta=l(()=>a(()=>import("./DashboardRoutes-CopaUmWi.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]))),De=l(()=>a(()=>import("./BillPayRoutes-DYswIHAT.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21]))),ia=l(()=>a(()=>import("./SettingsRoutes-CdvEgvyN.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,11,42,28,29,32,21]))),ye=l(()=>a(()=>import("./ReimbursementRoutes-CgQPRNMh.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21]))),ra=l(()=>a(()=>import("./ZeniAccountRoutes-D-szpn5h.js"),__vite__mapDeps([52,1,2,3,4,5,6,7,49,13,26,17,15,12,27,19,24,23,9,34,21]))),oa=l(()=>a(()=>import("./TreasuryRoutes-BQCtQUx_.js"),__vite__mapDeps([48,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,49,19,21]))),la=l(()=>a(()=>import("./TransactionListRoutes-CAZZrQj-.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21]))),ca=l(()=>a(()=>import("./ChargeCardRoutes-BZOF502-.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,45,23,21]))),da=l(()=>a(()=>import("./NotificationRoutes-6rN7RQjW.js"),__vite__mapDeps([58,1,2,3,13,4,5,6,7,9,21]))),ma=l(()=>a(()=>import("./PerformanceRoutes-Cn4Ovnir.js"),__vite__mapDeps([59,1,2,3,13,4,5,6,7,9,17,21]))),ua=l(()=>a(()=>import("./ExpenseAutomationRoutes-C3RWrFV-.js"),__vite__mapDeps([47,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21]))),_a=l(()=>a(()=>import("./RewardsRoutes-B0jOOo8W.js"),__vite__mapDeps([60,1,2,3,4,5,6,7,13,20,9,17,21]))),pa=l(()=>a(()=>import("./TaskRoutes-BlDolQ3c.js"),__vite__mapDeps([61,1,2,3,13,4,5,6,7,14,17,62,9,21]))),Aa=l(()=>a(()=>import("./AiCfoScreen-BrNLceCE.js"),__vite__mapDeps([63,1,2,3,4,5,6,7,18,51,21]))),fe=l(()=>a(()=>import("./CardsAiCfoScreen-BO5V838O.js"),__vite__mapDeps([64,1,2,3,4,5,6,7,21]))),D=l(()=>a(()=>import("./NotFoundScreen-DY1Wwus4.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,21]))),Ea=l(()=>a(()=>import("./TaskListScreen-CnT3FhwB.js"),__vite__mapDeps([62,1,2,3,4,5,6,7,9,17,21])));function Na({setTenantEmailDomain:i}){const U=ks(),V=Bs(),{tenantEmailDomain:o}=Vs(),S=Ms().mode,{setLoading:f,clearAllLoading:O,clearLoading:Z}=Zs(),y=R.getSignedInUserTenant(o)?.tenantId,j=R.getSignedInUser(),ae=is(j),$=Ss(),[N,ve]=v.useState(!1),r=G(n=>rs(n)),{useFeatureGate:L}=ws(),w=zs(),ne=Gs(),{isFeatureEnabled:Oe}=L(B.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Pe}=L(B.isTreasuryEnabled),{isFeatureEnabled:Fe}=L(B.isChargeCardFeatureEnabled),{isFeatureEnabled:te}=L(B.isDebitCardFeatureEnabled),h=G(n=>n.tenantState.fetchState),A=G(n=>n.tenantState.activeTenantFetchState.fetchState),u=A==="Completed"||h==="Completed"?os(te,r):void 0,W=A==="Completed"||h==="Completed"?ls(r):void 0,Le=A==="Completed"||h==="Completed"?cs(r):void 0,ke=Fe||te||!!Le||!!W||!!u,{isFeatureEnabled:Be}=L(B.isSettingsFeatureEnabled),{isFeatureEnabled:J}=L(B.isAiCfoFileUploadEnabled),Y=G(n=>ds(n));if(o!=null){const n=R.getSignedInUserTenant(o);j!=null&&n!=null&&Re(j,r,S)}const z={tenantId:y,userId:j?.userId,sessionId:j?.zeniSessionId},ie=ms(),p=$s(),Ve=r.company==null||p?.loggedInUserRoleMap!=null&&ge(p.loggedInUserRole),Se=us(p?.loggedInUserRoleMap),re=v.useRef(!0),oe=Ue("/:tenantEmailDomain/onboarding/*")!==null,K=Ue("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Ne=G(n=>z.tenantId!=null?_s(n,z.tenantId):void 0);v.useEffect(()=>{f(F.TENANT_FETCHING),i(o)},[o]),v.useEffect(()=>{if(K!=null&&y!=null){const n=K.params.selectedPeriod;if(n!=null){const b=n.split("-");if(b.length===2){const d=ps(Number(b[0])),s=Number(b[1]),m=As(`01-${d<10?`0${d}`:d}-${s}`,be.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),M=Es();m.isAfter(M,"month")===!1?U(gs(y,{month:d,year:s})):V("./month_end_close_checks/review")}}}},[K,y]),v.useEffect(()=>{N||(ve(!0),f(F.TENANT_FETCHING)),re.current?re.current=!1:!xs(ie,z)&&R.isSignedIn()&&(f(F.TENANT_FETCHING),function(n,b,d,s){if(Ie(b?.userId,b?.zeniSessionId,n.tenantId),d(Fs(!0)),d(Te(n.tenantId)),n.tenantId!=null&&_.clearTenant(n.tenantId),n.tenantId!=null){const m=R.getSignedInUserTenantWithId(n.tenantId);s&&be.updateAppLocaleID(Ys(s)),m?.tenantEmailDomain!=null&&R.saveActiveTenantDomainForUser(m?.tenantEmailDomain)}n.userId!=null?ee.identify(n.userId,{tenant_id:n.tenantId}):ee.resetUserIdentity()}(z,j,U,Ne))},[z,ie,j,U,R]),v.useEffect(()=>{R.isSignedIn()&&(f(F.TENANT_FETCHING),function(n,b,d,s,m,M,k){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const q=s!=null&&m?.zeniSessionId!=null,as=d==null||d.tenantId!==s,ns=d!=null&&d.excludedResources==null,ts=d!=null&&d.externalConnections==null;if(q&&as){k(Te(s));const Q=R.getSignedInUserTenantWithId(s);Q?.tenantEmailDomain!=null&&R.saveActiveTenantDomainForUser(Q?.tenantEmailDomain),Ie(m?.userId,m?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(je(m.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(he(m.userId,s)))}else q&&ns&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(je(m.userId,s))),q&&ts&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(he(m.userId,s)));if(q){ee.identify(m.userId,{tenant_id:s});const Q=s==null||s!=null&&(b==="Completed"||b==="Error");n==="Completed"||b!=="Not-Started"&&b!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),M(F.TENANT_FETCHING),k(Ls(m.userId,s,m.zeniSessionId))),Q&&(n==="Not-Started"||n==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),k(xe(m.userId,m.zeniSessionId)))}}(h,A,r,y,j,f,U))},[y,A]),v.useEffect(()=>{R.isSignedIn()&&h==="Completed"&&Y.tenantsBaseInOrder.length>0&&(Z(F.TENANT_FETCHING),R.saveSignedInUserTenants(Is(Y.tenantsBaseInOrder)),j!=null&&Re(j,r,S,void 0,Y.tenantsBaseInOrder))},[Y,h,r,j]),v.useEffect(()=>{A==="In-Progress"&&f(F.TENANT_FETCHING),A!=="Completed"&&A!=="Error"||(A==="Completed"&&y!=null?(O(),_.markActiveTenantFetchCompleted(y)):A==="Error"&&y!=null&&(_.markActiveTenantFetchFailed(y),Z(F.TENANT_FETCHING),Z(F.TENANT_SWITCHING))),h!=="Completed"&&h!=="Error"||(h==="Completed"?_.markAllTenantsFetchCompleted():h==="Error"&&_.markAllTenantsFetchFailed())},[A,h,y,N]);const le=v.useRef(!1);v.useEffect(()=>{!le.current&&A==="Completed"&&N&&(le.current=!0,function(n=Qs,b=3e3){setTimeout(()=>{const d=s=>{if(s>=n.length)return;const m=n[s],M=qs[m];M!=null?M().then(()=>se(()=>d(s+1))).catch(()=>se(()=>d(s+1))):d(s+1)};se(()=>d(0))},b)}())},[A,N]);const C=r?.userRole!=null&&Ts(r?.userRole),{isFeatureEnabled:Me}=L(B.isReferralFeatureEnabled),Ze=r?.userRole!=null&&r.userRole.includes("charge_card_user"),we=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),P=r?.userRole!=null&&ge(r.userRole),ce=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!C,de=ke&&!C,ze=js(p?.loggedInUserRoleMap),Ge=r.externalConnections?.accounting[0]?.isValid,me=r.company?.companyOnboardingInfo.isOnboardingCompleted,ue=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!C,_e=ue&&hs(p?.loggedInUserRoleMap),pe=Oe&&!C,$e=r.company!=null&&Us(r.company),We=Pe&&$e===!0&&!C,Ye=ce&&bs(p?.loggedInUserRoleMap),qe=de&&Rs(p?.loggedInUserRoleMap),Qe=pe&&Hs(p?.loggedInUserRoleMap),Je=Ds(p?.loggedInUserRoleMap),Ke=ys(p?.loggedInUserRoleMap),E=fs(p?.loggedInUserRoleMap),g=Cs(p?.loggedInUserRoleMap),x=vs(p?.loggedInUserRoleMap),I=Os(p?.loggedInUserRoleMap),T=Ps(p?.loggedInUserRoleMap),Ae=ce&&I,Ee=ue&&T,Xe=pe&&E,es=We&&g,X=de&&x,ss=r.excludedResources?.resources?.find(n=>n.resource==="/invites")!=null||Se===!0||ze===!0||Je===!0||Ke===!0;return R.isSignedIn()?y==null?h==="Completed"?e.jsx(c,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(j!=null&&h!=="In-Progress"&&U(xe(j.userId,j.zeniSessionId)),null):A!=="In-Progress"&&A!=="Not-Started"||h==="Completed"?(me===!0||ae&&!oe)&&Ge===!1&&u===!1&&W===!1?(i(void 0),e.jsx(c,{to:"/connection/auth",replace:!0})):!N||me!==!1||oe||ae?N&&r?.userRole&&u!=null&&W!=null&&o!=null&&Object.keys(p.loggedInUserRoleMap).length>0?e.jsx(Ns,{children:e.jsxs(t,{element:e.jsx(Ws,{}),children:[e.jsx(t,{path:"/",element:e.jsx(ga,{isDashboardAccess:P,isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,isTenantCardsOnly:W})}),e.jsx(t,{path:"dashboard/*",element:P?e.jsx(ta,{}):e.jsx(H,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reports/*",element:P?e.jsx(Js,{}):e.jsx(H,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"people/*",element:ss||P?e.jsx(Xs,{}):e.jsx(H,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"forecast/*",element:P?e.jsx(ea,{}):e.jsx(H,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"onboarding/*",element:e.jsx(sa,{})}),e.jsx(t,{path:"transaction/*",element:P&&C===!1||Ze||we?e.jsx(na,{}):e.jsx(H,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"transactions/*",element:P&&C===!1?e.jsx(la,{}):e.jsx(H,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"customer/*",element:P&&C===!1?e.jsx(He,{entityType:"customer"}):e.jsx(H,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isTenantBankingOnly:u,isUserHasTreasuryAccess:g,tenantEmailDomain:o})}),e.jsx(t,{path:"vendor/*",element:P&&C===!1?e.jsx(He,{entityType:"vendor"}):e.jsx(H,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"tasks",element:e.jsx(Ea,{})}),e.jsx(t,{path:"tasks/*",element:e.jsx(pa,{})}),e.jsx(t,{path:"address/*",element:Ye||_e||Qe||qe?e.jsx(Ks,{}):e.jsx(H,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"checking/*",element:Xe?e.jsx(ra,{}):e.jsx(D,{})}),e.jsx(t,{path:"treasury/*",element:es?e.jsx(oa,{}):e.jsx(D,{})}),e.jsx(t,{path:"performance",element:ne===!0?e.jsx(ma,{}):e.jsx(Ce,{tenantEmailDomain:o})}),e.jsx(t,{path:"month_end_close_checks/review/*",element:ne===!0&&C===!1?e.jsx(ua,{}):e.jsx(Ce,{tenantEmailDomain:o})}),e.jsx(t,{path:"notifications/*",element:e.jsx(da,{})}),e.jsx(t,{path:"vendors/*",element:Ve?e.jsx(aa,{}):e.jsx(D,{})}),e.jsx(t,{path:"bill/*",element:Ae?e.jsx(De,{}):e.jsx(H,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"bills/*",element:Ae?e.jsx(De,{}):e.jsx(H,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursement/*",element:Ee?e.jsx(ye,{}):e.jsx(H,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursements/*",element:Ee?e.jsx(ye,{}):e.jsx(H,{isUserHasZeniAccountsAccess:E,isUserHasChargeCardAccess:x,isUserHasBillPayAccess:I,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:g,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"settings/*",element:Be?e.jsx(ia,{hasAdminLevelAccess:_e}):e.jsx(D,{})}),e.jsx(t,{path:"cards/ask",element:X&&w?e.jsx(fe,{isFileUploadEnabled:J}):e.jsx(D,{})}),e.jsx(t,{path:"cards/ask/:session_id",element:X&&w?e.jsx(fe,{isFileUploadEnabled:J}):e.jsx(D,{})}),e.jsx(t,{path:"cards/*",element:X?e.jsx(ca,{}):e.jsx(D,{})}),e.jsx(t,{path:"rewards/*",element:Me?e.jsx(_a,{}):e.jsx(D,{})}),e.jsx(t,{path:"/ai-cfo",element:w?e.jsx(c,{to:"explore"}):e.jsx(D,{})}),e.jsx(t,{path:"/ai-cfo/",element:w?e.jsx(c,{to:"explore"}):e.jsx(D,{})}),e.jsx(t,{path:"/ai-cfo/:session_id",element:w?e.jsx(Aa,{isFileUploadEnabled:J}):e.jsx(D,{})}),e.jsx(t,{path:"*",element:e.jsx(D,{})})]})}):null:(i(void 0),e.jsx(c,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),i(void 0),e.jsx(c,{to:"/signin/auth",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}))}const ga=({isDashboardAccess:i,isUserHasZeniAccountsAccess:U,isUserHasChargeCardAccess:V,isUserHasBillPayAccess:o,isUserHasReimbursementAccess:S,isUserHasTreasuryAccess:f,isTenantBankingOnly:O,isTenantCardsOnly:Z})=>O===!0&&U?e.jsx(c,{to:"checking"}):Z===!0?e.jsx(c,{to:"cards"}):i?e.jsx(c,{to:"dashboard"}):U?e.jsx(c,{to:"checking"}):f?e.jsx(c,{to:"treasury"}):V?e.jsx(c,{to:"cards"}):o?e.jsx(c,{to:"bills"}):S?e.jsx(c,{to:"reimbursements"}):e.jsx(c,{to:"dashboard"}),H=({isUserHasZeniAccountsAccess:i,isUserHasChargeCardAccess:U,isUserHasBillPayAccess:V,isUserHasReimbursementAccess:o,isUserHasTreasuryAccess:S,isTenantBankingOnly:f,tenantEmailDomain:O})=>f===!0||i?e.jsx(ja,{tenantEmailDomain:O}):S?e.jsx(Ta,{tenantEmailDomain:O}):U?e.jsx(ha,{tenantEmailDomain:O}):V?e.jsx(Ia,{tenantEmailDomain:O}):o?e.jsx(xa,{tenantEmailDomain:O}):e.jsx(D,{}),xa=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/reimbursements`}),Ia=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/bills`}),Ta=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/treasury`}),ja=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/checking`}),ha=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/cards`}),Ce=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/dashboard`});export{H as FallBackRoute,Na as default};
@@ -0,0 +1,57 @@
1
+ import{j as o}from"./liveblocks-B5ZW-VBI.js";import{a as u}from"./sentry-BxWyF9h9.js";import{h as V,g as Q,u as U,j as b,s as ce,n as $,i as G,o as J,p as A}from"./core-Crl6eqZl.js";import{bn as je,eW as M,gp as Pe,m$ as le,Oe as Me,hF as he,O5 as De,qR as Te,kx as fe,mX as Ue,hH as _e,O7 as Re,O6 as Be,Qw as Fe,zh as Oe,EK as Ve,Q5 as ze,Qe as Le,c6 as ee,cL as Ne,cM as Qe,M5 as $e,Qx as Ge,M6 as He,xJ as Ke,Qy as Xe,H9 as Ze,Eq as qe,Eh as be,Ee as We,xN as Se,Ek as ye,En as Ce,Et as ne,ub as te,xM as Je,k9 as Z,kc as Ie,Qz as Ye,ld as en,y0 as nn,M$ as tn,N0 as an,k7 as on,QA as sn,ka as cn,rj as ln,MW as rn,MX as dn,rn as un,hq as pn,Me as W,hi as re,hf as gn,hn as mn,Mf as hn,xZ as fn,QB as bn,QC as Sn,EH as yn,fB as xe,fD as Ee,QD as Cn,gd as In,Mo as xn,xY as de,gi as ue,gh as En,xX as An,gg as vn,gf as wn,QE as kn,fG as Ae,QF as jn,QG as Pn,y3 as Mn,xW as pe,QH as Dn,fX as Tn,xT as Un,bZ as _n,c5 as Rn,c4 as Bn,b_ as Fn,c2 as On,c1 as Vn,c0 as zn,c3 as Ln,b$ as Nn}from"./zeni-epic-state-DTyrT1Ga.js";import{W as ae,Q as R,z as j,af as ve,bR as Qn,c as q,e as $n,bC as Gn,I as H,B as oe,bS as Hn,bT as Kn,aq as Xn,f as we,bU as Zn,bV as qn,bW as Wn,a9 as Jn,X as Yn,bX as et,s as nt,bY as tt}from"./index-CJknvk0s.js";import{n as B}from"./mui-U77PQnc2.js";import{M as _}from"./MobileAppDrawer-BIP1MEKX.js";import{a as K,g as X,m as at}from"./accountMappingHelper-SrHoNEDL.js";import{t as ot,A as st}from"./AddressScreen-D8kv1hF_.js";import N from"./NotFoundScreen-DY1Wwus4.js";import{g as it}from"./analyticsHelper-BsiU5y2K.js";import{B as ct}from"./BusinessVerificationPageScreen-YVk91Fzz.js";import{C as lt}from"./CompanyPassportScreen-CPKfXmmb.js";import{q as ge}from"./QBOConnectionScreen-BEQPddK1.js";import{u as rt}from"./useEmailConnectResultRefresh-CiGW-Jar.js";import{B as dt}from"./BillPayApprovalRoutes-CvKgF8Ok.js";import{R as ut}from"./ReimbursementApprovalRoutes-Ch3sYOOh.js";import"./recharts-e5u-LCPv.js";import"./analytics-CkLW7NeW.js";import"./plaid-TCRHScH1.js";import"./dnd-tE28jHT7.js";import"./stripe-DMRn4zHo.js";import"./lottie-hSeCd_VX.js";import"./lexical-Bm_vZOjC.js";import"./pdf-DDcPh2pm.js";import"./utils-BjvWDnmB.js";import"./routePaths-jWP9zfXs.js";import"./empty-BpRPQOis.js";import"./pdf-lib-ImawEH2S.js";import"./index-D5ItYKRr.js";import"./url-jBDeguac.js";import"./index-CZNTdKXM.js";import"./decodeURIComponentSafe-DwYiSzjo.js";import"./ReimbursementApprovalRuleDetailScreen-BJZRYRum.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]="93b0be52-415d-4a4b-99d6-960dab7eaddd",e._sentryDebugIdIdentifier="sentry-dbid-93b0be52-415d-4a4b-99d6-960dab7eaddd")}catch{}})();const pt=B.div`
2
+ display: flex;
3
+ height: 100%;
4
+ width: 100%;
5
+ flex: 1 1 auto;
6
+ flex-direction: column;
7
+ align-items: center;
8
+ background-color: ${e=>e.theme.colors.grey4};
9
+ `,gt=$(function(e,t){return{accountMappingView:t.accountMappingView,isFiling1099FeatureEnabled:t.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:t.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:fe(e),isAccountingClassesUpdateInProgress:e.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:Te(e),meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",isCapitalizationFeatureEnabled:t.isCapitalizationFeatureEnabled,capitalizableAccounts:t.capitalizableAccounts,accountNamesById:t.accountNamesById,capitalizableAccountOverrides:t.capitalizableAccountOverrides,isCapitalizationThresholdSaving:t.isCapitalizationThresholdSaving,onSaveCapitalizationAccountThreshold:t.onSaveCapitalizationAccountThreshold}},function(e,t){const{navigate:s,location:l,isFiling1099FeatureEnabled:i}=t;return{onAccountMappingChange:n=>{const{uncategorizedAccountSection:a,billsAccountSection:c,reimbursementsAccountSection:p,vendorsAccountSection:d,filing1099Section:g}=n,{incomeAccount:S,expenseAccount:f}=a,{billPayAccount:r}=c,{reimbursementsAccount:m}=p,{prepaidExpensesAccount:h,fixedAssetsAccount:P,accruedExpensesAccount:v}=d,{bankAccount:I,expenseCategory1099:E}=g,w=K(t.accountMappingView.incomeAccountList,S.selectedOption),F=K(t.accountMappingView.expenseAccountList,f.selectedOption),z=K(t.accountMappingView.billPayAccountList,r.selectedOption),L=K(t.accountMappingView.reimbursementsAccountList,m.selectedOption),O=X(t.accountMappingView.prepaidExpensesAccountList,h.selectedOptions),y=X(t.accountMappingView.fixedAssetsAccountList,P.selectedOptions),D=X(t.accountMappingView.accruedExpensesAccountList,v.selectedOptions),C=X(t.accountMappingView.bankAccounts1099FilingAccountList,I.selectedOptions),x=at(t.accountMappingView.expenseAccounts1099FilingAccountList,E),T={selectedIncomeAccountId:w?.accountId,selectedExpenseAccountId:F?.accountId,selectedBillPayAccountId:z?.accountId,selectedReimbursementsAccountId:L?.accountId,selectedPrepaidExpensesAccountIds:O.map(k=>k.accountId),selectedFixedAssetsAccountIds:y.map(k=>k.accountId),selectedAccruedExpensesAccountIds:D.map(k=>k.accountId),selectedBankAccounts1099FilingAccountIds:C.map(k=>k.accountId),selectedExpenseAccounts1099FilingAccountIds:x};e(Be({data:T}))},onBackClick:()=>{ve(l)===!1?(s("../../dashboard"),e(Re())):e(he())},onSaveClick:()=>{e(_e()),i&&q.track($n.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:n=>{e(Ue(t.currentTenant.companyId,n))}}})(Qn),mt=()=>{const e=V(),t=Q(),s=U(),{useFeatureGate:l,useDynamicConfig:i}=ae(),{isFeatureEnabled:n}=l(R.isFiling1099FeatureEnabled),{isFeatureEnabled:a}=l(R.isScheduledJEAccruedExpensesFeatureEnabled),{configValue:c,isDynamicConfigLoading:p}=i("transaction_categorization_config"),d=!p&&c?.capitalization_enabled===!0,g=j.getSignedInUser(),S=je(g),f=b(C=>M(C)),{capitalizableAccounts:r,capitalizableAccountOverrides:m,isCapitalizationThresholdSaving:h,currencySymbol:P}=b(C=>{const x=C.tenantState.currentTenantId,T=x!=null?C.tenantState.tenantsById[x]:void 0,k=Pe(C.companyState,f.companyId);return{capitalizableAccounts:T?.capitalizableAccounts??null,capitalizableAccountOverrides:T?.capitalizableAccountOverrides??null,isCapitalizationThresholdSaving:C.companyViewState.passportView?.capitalizationThresholdUpdateStatus?.fetchState==="In-Progress",currencySymbol:k?.company.companyLocaleInfo?.currencySymbol??"$"}},ce),v=u.useCallback((C,x)=>{s(le(f.companyId,C,x))},[s,f.companyId]),I=u.useCallback(C=>{const x={...m??{}},T=Object.entries(C);for(const[se,ie]of T)ie===null?delete x[se]:x[se]=ie;const[k,ke]=T[0]??[];k!=null&&s(le(f.companyId,k,ke,void 0,Object.keys(x).length>0?x:null))},[s,f.companyId,m]),E=b(C=>Me(C.accountState),ce),w=u.useMemo(()=>{const C={};for(const x of E)x.accountId!=null&&x.accountName!=null&&(C[x.accountId]=x.accountName);return C},[E]),[F,z]=u.useState(!1),[L,O]=u.useState(!1);u.useEffect(()=>{F===!1&&(s(he()),z(!0))},[F]);const y=b(C=>De(C)),D=C=>{O(C)};return o.jsxs(pt,{children:[o.jsx(_,{isAppContentDrawerOpen:L,handleDrawerToggle:D}),o.jsx(gt,{currentTenant:f,navigate:e,accountMappingView:y,isFiling1099FeatureEnabled:n&&S,isAccruedExpensesFeatureEnabled:a,isCapitalizationFeatureEnabled:d,capitalizableAccounts:r,accountNamesById:w,capitalizableAccountOverrides:m,currencySymbol:P,isCapitalizationThresholdSaving:h,onSaveCapitalizationAccountThreshold:v,onSaveCapitalizationAccountThresholds:I,location:t,isSettings:ve(t),onClickMenuIcon:()=>D(!0)})]})},ht=B.div`
10
+ display: flex;
11
+ height: 100%;
12
+ width: 100%;
13
+ flex: 1 1 auto;
14
+ flex-direction: column;
15
+ align-items: center;
16
+ background-color: ${e=>e.theme.colors.grey4};
17
+ `,ft=$(function(e,t){const s=M(e),l=ze(e),i=Le(e),n=t.roleMap.bill_pay_admin;return{isDisabled:(ee(s?.userRole??[])||n)&&"readonly",billpayApprovalView:l,remiApproverView:i,analytics:q}},function(e,t){const{navigate:s,currentTenant:l}=t;return{onSetupApprovalRulesBillPaySectionClick:()=>{s("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{s("reimbursements/approval-rules")},onBackClick:()=>{l?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&l.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}})(Hn),bt=()=>{const e=V(),t=Q(),s=U(),{tenantEmailDomain:l}=G(),[i,n]=u.useState(!1),[a,c]=u.useState(!1),[p,d]=u.useState(!1),g=b(E=>M(E)),S=b(E=>E.billPaySetupApproverViewState.fetchState),f=b(E=>E.remiSetupApproverViewState.fetchState),r=b(E=>Fe(E)),{isApprovalRulesV3Enabled:m,isLoading:h}=Gn(g?.tenantId),P=g.companyId??j.getSignedInUserTenant(l)?.companyId;if(j.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const v=H();u.useEffect(()=>{p||S!=="Not-Started"||h||(d(!0),s(Oe(!0,!0,m)))},[p,S,h,m,s]),u.useEffect(()=>{a||f!=="Not-Started"||h||(c(!0),s(Ve(!0,!1,!1,m)))},[a,f,h,m,s]);const I=E=>{n(E)};return v?.loggedInUserRoleMap!=null?o.jsxs(ht,{children:[o.jsx(_,{isAppContentDrawerOpen:i,handleDrawerToggle:I}),o.jsx(ft,{navigate:e,location:t,companyId:P,currentTenant:g,roleMap:v.loggedInUserRoleMap,onClickMenuIcon:()=>{I(!0)}})]}):o.jsx(oe,{fetchState:r.fetchState})},St=B.div`
18
+ display: flex;
19
+ height: 100%;
20
+ width: 100%;
21
+ flex: 1 1 auto;
22
+ flex-direction: column;
23
+ align-items: center;
24
+ background-color: ${e=>e.theme.colors.grey4};
25
+ `,yt=$(function(e,t){const{companyId:s,isZeniAccountEnabled:l,isChargeCardEnabled:i,isBillPayEnabled:n,isRemiEnabled:a,isTreasuryEnabled:c}=t,p=M(e);return{bankSetupView:Xe(e,s,n,a,l,i,c),connectedAccountProvider:p.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:q}},function(e,t){const{navigate:s,currentTenant:l,companyId:i}=t;return{onFetchLinkTokenClick:(n,a,c)=>{e(te(a,n,c))},onEstablishConnectionClick:(n,a,c)=>{e(ne(n,i,a,c))},onUpdatePaymentAccountStatus:(n,a,c,p,d)=>{e(Ce(n,a,d,p,c))},onUpdatePaymentAccountLoginStatus:(n,a,c,p)=>{e(ye(!1,n,p,c,a))},onEstablishConnectionSuccess:(n,a)=>{e(Se(a,n))},onUpdateAccountClick:(n,a,c,p,d)=>{e(d==="paymentAccount"?be(n,a,c,p):We(p,n,a))},onUpdatePrimaryFundingAccount:(n,a,c)=>{e(qe(i,a,n,c))},onRemoveConnection:n=>{e(Ze(n))},onBackClick:()=>{l?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&l.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}})(Kn),Ct=()=>{const e=V(),t=Q(),s=U(),{tenantEmailDomain:l}=G(),i=H(),[n,a]=u.useState(!1),[c,p]=u.useState(!1),d=b(I=>M(I)),g=b(I=>I.settingsViewState.bankConnection.fetchState),S=Ne(d,i?.loggedInUserRoleMap),f=Qe(d,i?.loggedInUserRoleMap),r=$e(d,i?.loggedInUserRoleMap),m=Ge(d,i?.loggedInUserRoleMap),h=He(d,i?.loggedInUserRoleMap),P=d.companyId??j.getSignedInUserTenant(l)?.companyId;if(j.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");u.useEffect(()=>{c||g==="Completed"||(p(!0),s(Ke(!1)))},[c,s,g]);const v=I=>{a(I)};return S||r||f||h?o.jsxs(St,{children:[o.jsx(_,{isAppContentDrawerOpen:n,handleDrawerToggle:v}),o.jsx(yt,{navigate:e,location:t,companyId:P,currentTenant:d,roleMap:i.loggedInUserRoleMap,isBillPayEnabled:S,isRemiEnabled:f,isZeniAccountEnabled:r,isChargeCardEnabled:h,isTreasuryEnabled:m,onClickMenuIcon:()=>{v(!0)}})]}):o.jsx(N,{})},It=B.div`
26
+ display: flex;
27
+ height: 100%;
28
+ width: 100%;
29
+ flex: 1 1 auto;
30
+ flex-direction: column;
31
+ align-items: center;
32
+ background-color: ${e=>e.theme.colors.grey4};
33
+ `,xt=$(function(e,t){const{companyId:s}=t,l=M(e),i=t.roleMap.bill_pay_admin,n=Ye(e,s),{uiState:a}=n,c=(ee(l?.userRole??[])||i)&&n.setupView.accountFetchStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.accountUpdateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{billingSetupView:n,uiState:a,stripeKey:we.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:l.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:c,analytics:q}},function(e,t){const{navigate:s,currentTenant:l,companyId:i}=t;return{onFetchLinkTokenClick:(n,a)=>{e(te("billing_setup",n,a))},onEstablishConnectionClick:n=>{e(ne(n,i,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(Se("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,a,c)=>{e(Ce(n,a,"billing","billing_setup",c))},onUpdatePaymentAccountLoginStatus:(n,a)=>{e(ye(!1,n,"billing","billing_setup",a))},onUpdateAccountClick:(n,a)=>{e(be(n,a,"billing","billing_setup"))},onBackClick:()=>{l?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&l.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")},handleCreateCardSetupIntent:n=>{e(Ie(n))},handleConfirmCardSetupIntent:n=>{e(cn(n))},updateCardPaymentModalState:n=>{e(sn({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,a,c)=>{e(on(n,a,c))},handleFetchPaymentSources:()=>{e(Z())},resetCardPaymentViewState:()=>{e(an())},handleResetCardPaymentErrorStatuses:()=>{e(tn())},onBillingAddressSave:n=>{e(nn(n))},onAddressEditHandler:n=>{if(n!=null){const a=ot(n);e(en({addressType:"subscription_billing_address",addressToCreate:a}))}}}})(Zn),Et=()=>{const e=V(),t=Q(),s=U(),{tenantEmailDomain:l}=G(),[i,n]=u.useState(!1),[a,c]=u.useState(!1),[p,d]=u.useState(!1),g=b(I=>M(I)),S=b(I=>I.cardPaymentViewState),f=b(I=>I.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState),r=Xn(S.addCardPaymentSourceStatus.fetchState),m=S.addCardPaymentSourceStatus.fetchState,h=g.companyId??j.getSignedInUserTenant(l)?.companyId;if(j.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const P=H();u.useEffect(()=>{h!=null&&s(Je(h,!1))},[h,s]),u.useEffect(()=>{a||(c(!0),s(Z()))},[a,s]),u.useEffect(()=>{p||(Ie(["card"]),d(!0))},[p]),u.useEffect(()=>{r==="In-Progress"&&m==="Completed"&&s(Z())},[r,m]);const v=I=>{n(I)};return P?.loggedInUserRoleMap!=null?o.jsxs(It,{children:[o.jsx(_,{isAppContentDrawerOpen:i,handleDrawerToggle:v}),o.jsx(xt,{navigate:e,location:t,companyId:h,currentTenant:g,roleMap:P.loggedInUserRoleMap,onClickMenuIcon:()=>{v(!0)},googleAPIKey:we.googleMapsAPIKey})]}):o.jsx(oe,{fetchState:f})},Y="external_integrations",At=$(function(e){const t=dn(e,Y);return{meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",notifyMeRegisteredSlugs:new Set(t.map(s=>s.additionalInfo).filter(s=>s!=null))}},function(e,t){const{navigate:s,integrationsView:l,signedInUserEmail:i,tenantEmailDomain:n,tenantId:a}=t;return{onBackClick:()=>{s("../")},onNavigateToDashboard:()=>{s("../dashboard")},onReconnectQBO:()=>{ge.init("/connection/auth",n),ge.handleClick()},onRefreshClick:()=>{l.integrations.refreshQBO.fetchState!=="In-Progress"&&e(fn())},onSaveChargeBeeCredentials:(c,p)=>{const d=l.externalConnections?.revenue?.find(g=>g.connectionName==="chargebee")?.connectionId;d!=null&&e(mn(a,d,W("revenue"),hn("chargebee"),{api_key:c,site:p}))},onConnectHubSpot:(c,p)=>{const d=l.externalConnections?.revenue?.find(g=>g.connectionName==="hubspot")?.connectionId;if(d!=null){const g=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:c,client_secret:p,connection_id:d,redirect_uri:g,tenant_id:a}));const S="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(c)}&scope=${encodeURIComponent(S)}&redirect_uri=${encodeURIComponent(g)}`}},onDisconnect:(c,p)=>{e(gn(a,c,W(p)))},onConnectGmail:()=>{e(re(a,"gmail",window.location.href))},onConnectOutlook:()=>{e(re(a,"outlook",window.location.href))},onSaveConnectorCredentials:c=>{e(pn(a,W("payments"),c))},onNotifyMe:c=>{e(un(Y,c,i))}}})(qn),vt=()=>{const e=V(),t=U(),{tenantEmailDomain:s}=G();rt();const[l,i]=u.useState(!1),n=b(h=>h.tenantState.fetchState),a=b(h=>M(h)),c=a.companyId??j.getSignedInUserTenant(s)?.companyId,p=j.getSignedInUser(),d=H(),g=ee(a.userRole??[]);if(p==null)throw Error("Can't access Integrations page without signing in...");u.useEffect(()=>{t(ln(Y))},[t]);const[S,f]=u.useState(!1);u.useEffect(()=>{S||(f(!0),t(Z()))},[S,t]);const r=h=>{i(h)},m=b(h=>rn(h,c));return d?.loggedInUserRoleMap!=null?o.jsxs(wt,{children:[o.jsx(_,{isAppContentDrawerOpen:l,handleDrawerToggle:r}),o.jsx(At,{navigate:e,onClickMenuIcon:()=>{r(!0)},isAdmin:g,integrationsView:m,signedInUserEmail:p.userEmail??"",tenantEmailDomain:a.tenantEmailDomain??s??"",tenantId:a.tenantId,saveChargeBeeState:m.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:m.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:m.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:m.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:m.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(m.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map(([h,P])=>[h,P?.message])),deleteConnectionState:m.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:m.externalConnections?.deleteConnectionError?.message,isLoading:n==="In-Progress"})]}):o.jsx(oe,{fetchState:n})},wt=B.div`
34
+ display: flex;
35
+ height: 100%;
36
+ width: 100%;
37
+ flex: 1 1 auto;
38
+ flex-direction: column;
39
+ align-items: center;
40
+ background-color: ${e=>e.theme.colors.grey4};
41
+ `,kt=B.div`
42
+ display: flex;
43
+ height: 100%;
44
+ width: 100%;
45
+ flex: 1 1 auto;
46
+ flex-direction: column;
47
+ align-items: center;
48
+ background-color: ${e=>e.theme.colors.grey4};
49
+ `,jt=()=>{const e=U(),{tenantEmailDomain:t}=G(),[s,l]=u.useState(!1),i=b(r=>M(r)).companyId??j.getSignedInUserTenant(t)?.companyId,n=j.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const a=b(r=>bn(r,n.userId)),c=b(r=>Sn(r,i,"bill_pay","user_reimbursement_account")),{plaidConnectionDetails:p}=c,d=r=>{l(r)},g=u.useCallback(r=>{e(te("user_reimbursement_account",r))},[]),S=u.useCallback(r=>{e(ne(r,i,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},[]);u.useEffect(()=>{a.fetchState!=="Completed"&&a.fetchState!=="In-Progress"&&e(yn(n.userId))},[n.userId,a.fetchState]);const f=a.fetchState==="Not-Started"||a.fetchState==="In-Progress";return o.jsxs(kt,{children:[o.jsx(_,{isAppContentDrawerOpen:s,handleDrawerToggle:d}),o.jsx(Wn,{plaidConnectionDetails:p,isLoading:f,myBankConnectionsView:a,onFetchLinkTokenClick:g,onEstablishConnectionClick:S,onClickMenuIcon:()=>{d(!0)}})]})},Pt=B.div`
50
+ display: flex;
51
+ height: 100%;
52
+ width: 100%;
53
+ flex: 1 1 auto;
54
+ flex-direction: column;
55
+ align-items: center;
56
+ background-color: ${e=>e.theme.colors.grey4};
57
+ `,me=({appContent:e})=>{const t=U(),s=V(),l=Q(),[i,n]=u.useState(!1),a=b(y=>M(y)),{tenantEmailDomain:c}=a,p=a.companyId??j.getSignedInUserTenant(c)?.companyId;if(j.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:d}=ae(),{isFeatureEnabled:g}=d(R.isDepositAccountsFeatureEnabled),{isFeatureEnabled:S}=d(R.isChargeCardFeatureEnabled),{isFeatureEnabled:f}=d(R.isDebitCardFeatureEnabled),{isFeatureEnabled:r}=d(R.isTreasuryEnabled),m=b(y=>fe(y)),h=xe(a),P=Ee(f,a),v=!P&&m,I=Jn(a,S,f),{areTenantIdsInSync:E}=Yn();u.useEffect(()=>{E&&t(Cn(p,v))},[p,t,v,E]);const w=b(y=>In(y,v)),F=w.fetchState==="Not-Started"||w.fetchState==="In-Progress"||p==null,z=xn(a),L=!!a.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,O=y=>{n(y)};return o.jsxs(Pt,{children:[o.jsx(_,{isAppContentDrawerOpen:i,handleDrawerToggle:O}),e!=null?o.jsx(o.Fragment,{children:e}):o.jsx(et,{myProfileView:w,isAccountingClassesEnabled:m,isReimbursementDisabled:L===!1,isZeniAccountsDisabled:g===!1,isChargeCardDisabled:I===!1,isTreasuryDisabled:r===!1,isLiteRoleDisabled:z===!1,onClickMenuIcon:()=>{O(!0)},isLoading:F,isBankingOnlyTenant:P,isCardsOnlyTenant:h,onAddressClick:y=>{const D=function(x,T){let k=`/${x}/settings/my_profile`;return k=k.concat(`/new/${T}`),k}(c,y),C=nt(l.state?.pathnameStackToGoBack,l.pathname);s(D,{state:{pathnameStackToGoBack:C}})},onGetOtp:y=>{const D={...w.myProfileLocalData,phone:y};t(de({localData:D})),t(wn(y,"MyProfile"))},onResendOtp:y=>{t(vn(y,"MyProfile"))},onCancelClick:()=>{t(An())},onSaveClick:()=>{t(ue("MyProfile",w.myProfileLocalData.phone,w.myProfileLocalData.otpChallenge,w.myProfileLocalData.dateOfBirth,w.addressData?.addressToCreate))},onVerifyOtp:(y,D)=>{t(En(y,D,"MyProfile"))},onVerifyOtpSuccess:y=>{y!=null&&j.saveZeniOtpToken(y),t(ue("MyProfile",w.myProfileLocalData.phone,w.myProfileLocalData.otpChallenge,w.myProfileLocalData.dateOfBirth,w.addressData?.addressToCreate))},updateMyProfileLocalData:y=>{t(de({localData:y}))}})]})};function Mt(){const e=U(),t=b(r=>M(r)).companyId,s=b(r=>kn(r)),l=b(r=>Ae(r)),i=j.getSignedInUser(),[n,a]=u.useState(!1),c=u.useCallback(r=>{a(r)},[]),p=u.useCallback(r=>{e(jn(r))},[]),d=u.useCallback(()=>{i?.userEmail!=null&&e(Pn({loggedInUserEmail:i.userEmail}))},[i?.userEmail]),g=u.useCallback(()=>{e(Mn())},[]);if(i==null)throw Error("Can't access Notification Settings page without signing in...");const S=u.useCallback(()=>{const r=l.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(pe(r,t))},[t,l.notificationSettings.monthEndInsightsNotificationSettings.enabled]),f=u.useCallback(()=>{e(Dn())},[]);return u.useEffect(()=>{if(l.fetchState==="Completed"&&s.fetchState!=="In-Progress"&&s.fetchState!=="Completed"){const r=l.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(pe(r,t))}},[s.fetchState,t,l.notificationSettings.monthEndInsightsNotificationSettings.enabled,l.fetchState]),o.jsxs(o.Fragment,{children:[o.jsx(_,{isAppContentDrawerOpen:n,handleDrawerToggle:c}),o.jsx(tt,{notificationSettingsView:s,onFormDataChange:p,onCancel:d,onSave:g,onClickMenuIcon:()=>{c(!0)},signedInUser:i,onRefresh:S,resetUpdateStatus:f})]})}function pa(e){const[t,s]=u.useState(!1),l=b(r=>Ae(r)),i=b(r=>M(r)),n=H(),a=j.getSignedInUser(),c=U(),{useFeatureGate:p}=ae(),{isFeatureEnabled:d}=p(R.isDebitCardFeatureEnabled),g=a?.userEmail==null||l.fetchState!=="Completed"||Tn(l.notificationSettings,a.userEmail,d,i);u.useEffect(()=>{l.fetchState!=="In-Progress"&&l.fetchState!=="Completed"&&t===!1&&(s(!0),c(Un()))},[l.fetchState,t]);const S=Ee(d,i),f=xe(i);return l.fetchState!=="In-Progress"&&l.fetchState!=="Not-Started"||g!==!0?_n(i)?o.jsxs(J,{children:[Rn(n?.loggedInUserRole??[],d,i,n?.loggedInUserRoleMap)&&o.jsx(A,{path:"accounting/*",element:o.jsx(mt,{})}),Bn(n?.loggedInUserRole??[],d,i,n?.loggedInUserRoleMap)&&o.jsx(A,{path:"approval_rules/*",element:o.jsx(Dt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),Fn(i,n?.loggedInUserRoleMap)&&o.jsx(A,{path:"my_bank_connections",element:o.jsx(jt,{})}),On(i,n?.loggedInUserRoleMap)&&o.jsx(A,{path:"bank_connections",element:o.jsx(Ct,{})}),Vn(i,n?.loggedInUserRoleMap)&&o.jsx(A,{path:"business_verification",element:o.jsx(ct,{productType:S?"zeni_accounts":f?"charge_cards":it(i,n?.loggedInUserRoleMap)})}),zn(n?.loggedInUserRole??[],i,n?.loggedInUserRoleMap)&&o.jsx(A,{path:"company_details",element:o.jsx(lt,{})}),Ln(n?.loggedInUserRole??[],i)&&o.jsx(A,{path:"billing",element:o.jsx(Et,{})}),Nn(n?.loggedInUserRole??[],d,i)&&o.jsx(A,{path:"integrations",element:o.jsx(vt,{})}),o.jsx(A,{path:"my_profile/new/:addressType",element:o.jsx(me,{appContent:o.jsx(st,{isSubPage:!1})})}),o.jsx(A,{path:"my_profile",element:o.jsx(me,{})}),g&&o.jsx(A,{path:"notifications",element:o.jsx(Mt,{})}),o.jsx(A,{path:"*",element:o.jsx(N,{})})]}):o.jsx(J,{children:o.jsx(A,{path:"*",element:o.jsx(N,{})})}):null}function Dt(e){return o.jsxs(J,{children:[o.jsx(A,{path:"/",element:o.jsx(bt,{})}),o.jsx(A,{path:"bills/approval-rules/*",element:o.jsx(dt,{})}),o.jsx(A,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?o.jsx(ut,{}):o.jsx(N,{})}),o.jsx(A,{path:"*",element:o.jsx(N,{})})]})}export{pa as default};
@@ -0,0 +1,29 @@
1
+ import{j as u}from"./liveblocks-B5ZW-VBI.js";import{h as Y,g as X,u as ee,i as G,j as v,N as j,n as W,t as Xe}from"./core-Crl6eqZl.js";import{bJ as en,co as Ie,PV as ye,eW as V,cA as nn,zx as Q,zh as tn,Q5 as an,Q8 as sn,rC as ne,rq as te,l5 as ae,tJ as L,Qa as Ae,gh as Qe,gg as $e,gf as Ge,Qb as on,zG as cn,Eq as ke,Eh as _e,Ee as ve,DY as K,Ek as Pe,En as Ee,Et as Te,ub as we,gw as rn,cv as un,fD as dn,fB as ln,fC as pn,bt as mn,Qc as yn,CY as le,DA as fn,Qd as gn,bK as Sn,FJ as pe,EK as bn,Qe as hn,Qf as Cn,FN as In,FR as An,tC as kn,Kf as _n,Gm as Ce,Hm as me,Qg as vn,Qh as Pn,Qi as En,Qj as We,Qk as Tn,MI as wn,Pi as Dn,MZ as Un,Ql as He,E0 as On,M_ as Fn,E4 as Vn,Qm as Ve,GI as qe,ld as xn,rt as Ke,tL as Bn,bE as je,tX as Re,cy as jn,Qn as Je,fW as Rn,G4 as Nn,G8 as zn,Qo as Ln,Gp as Ne,Qp as Mn,Qq as Zn,Qr as Qn,Qs as $n,gp as Gn,AR as Wn,Qt as Hn,AW as qn,AV as Kn}from"./zeni-epic-state-DTyrT1Ga.js";import{I as ie,W as se,Q as de,m as De,aQ as J,bC as Ye,z as D,V as oe,c as U,B as Ue,e as $,bD as Jn,at as ce,bE as x,bF as Yn,bG as Xn,af as Be,bH as et,s as ze,au as Le,j as nt,x as tt,bI as at,bJ as it,bK as st,a7 as ot}from"./index-CJknvk0s.js";import{a as C}from"./sentry-BxWyF9h9.js";import{n as xe,D as ct,S as rt}from"./mui-U77PQnc2.js";import{M as fe}from"./MobileAppDrawer-BIP1MEKX.js";import z from"./NotFoundScreen-DY1Wwus4.js";import{a as Me}from"./analyticsHelper-BsiU5y2K.js";import{d as Ze}from"./routePaths-jWP9zfXs.js";import{B as Fe}from"./BusinessVerificationPageScreen-YVk91Fzz.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="8acd99ec-a54a-4542-bec4-1d2026ecf7ca",e._sentryDebugIdIdentifier="sentry-dbid-8acd99ec-a54a-4542-bec4-1d2026ecf7ca")}catch{}})();const ut=xe.div`
2
+ display: flex;
3
+ height: 100%;
4
+ width: 100%;
5
+ flex: 1 1 auto;
6
+ flex-direction: column;
7
+ align-items: center;
8
+ background-color: ${e=>e.theme.colors.grey4};
9
+ `,dt=W(function(e,o){const{isUserBillPayAdmin:t,companyId:a}=o,c=V(e),n=an(e),s=D.getSignedInUser(),l=c.tenantId,i={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:l??""},r=sn(e,a),p=t&&r.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&r.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",f=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{billPaySetupView:r,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:f,showIntlWiseWidget:o.showIntlWiseWidget,isDisabled:p,billpayApprovalView:n,meetingUrl:"https://meetings.hubspot.com/snehals/demo-bill-pay?embed=true",analytics:U,filesEndPoint:`${ce.fileMicroServiceBaseUrl}`,authParams:i}},function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyBillPayInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(Q(a,!1,!0))},onSetupApprovalRulesSectionClick:()=>{t("../approval-rules")},onFetchLinkTokenClick:(n,s)=>{e(we("bill_pay_setup",n,s))},onEstablishConnectionClick:n=>{e(Te(n,a,"bill_pay_setup","bill_pay"))},onUpdatePaymentAccountStatus:(n,s,l)=>{e(Ee(n,s,"bill_pay","bill_pay_setup",l))},onUpdatePaymentAccountLoginStatus:(n,s)=>{e(Pe(!1,n,"bill_pay","bill_pay_setup",s))},onEstablishConnectionSuccess:()=>{e(Q(a,!0))},onEnableBillPayClick:()=>{e(K(a,"bill_pay"))},onUpdateAccountClick:(n,s,l)=>{e(l==="paymentAccount"?_e(n,s,"bill_pay","bill_pay_setup"):ve("reimbursement_setup",n,s))},onUpdatePrimaryFundingAccount:(n,s)=>{e(ke(a,"bill_pay_setup",n,s))},onEnableBillPaySuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?t("../.."):t("../",{relative:"path"})},onAcceptUpdatedTOS:()=>{e(cn(a))},onAcceptUpdatedTOSSuccess:()=>{e(Q(a,!0))},onGetOtp:(n,s)=>{e(Ge(n,"SpendManagementSetup")),s!=null&&e(on({officerType:s,phone:n}))},onResendOtp:n=>{e($e(n,"SpendManagementSetup"))},onVerifyOtp:(n,s)=>{e(Qe(n,s,"SpendManagementSetup"))},onVerifyOtpSuccess:(n,s)=>{n!=null&&s!=null&&e(L(a,n,"bill_pay",!0,!0))},onNavigateToDashboard:()=>{t("../../dashboard")},onNavigateToSettings:()=>{t("../bills/setup")},onInternationPaymentSetUpClick:()=>{t("../international-wire")},onCompanyOfficerUpdated:(n,s)=>{e(Ae({officerType:n,fileIds:s}))},onSendForVerificationClick:n=>{e(L(a,n,"bill_pay",!0,!0,!0))},updateFilesEntity:n=>{e(ae({files:n}))},onDeleteFile:n=>{e(te(n))},onEditFileName:(n,s)=>{e(ne(n,s.split(".")[0]))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}})(Jn),lt=()=>{const e=Y(),o=X(),t=ee(),{tenantEmailDomain:a}=G(),c=ie(),n=en(c?.loggedInUserRoleMap),s=Ie(c?.loggedInUserRoleMap),{useFeatureGate:l,useDynamicConfig:i}=se(),{isFeatureEnabled:r}=l(de.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:p}=l(de.isBillPayLocalCurrencyFeatureEnabled),f=De(),{configValue:A}=i(J.zeniAccountsConfig),d=ye(A),[y,b]=C.useState(!1),_=C.useRef(!1),[g,S]=C.useState(!1),T=v(E=>E.billPaySetupViewState.fetchState),I=v(E=>V(E)),h=v(E=>E.billPaySetupApproverViewState.fetchState),{isApprovalRulesV3Enabled:w,isLoading:k}=Ye(I?.tenantId),m=I.companyId??D.getSignedInUserTenant(a)?.companyId;if(D.getSignedInUser()==null)throw Error("Can't access bill pay setup page without signing in...");const P=!!I.companyBillPayInfo?.info?.isBillPayTOSAccepted,R=nn(c?.loggedInUserRoleMap);C.useEffect(()=>{_.current||T!=="Not-Started"||m==null?_.current||T!=="Completed"||m==null||I.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(_.current=!0,t(Q(m,!1,!0))):(_.current=!0,t(Q(m,!0)))},[T,m,t]),C.useEffect(()=>{g||h!=="Not-Started"||k||(S(!0),t(tn(!0,!0,w)))},[g,h,k,w,t]);const F=E=>{b(E)};if(P===!1||R&&!c?.loggedInUserRoleMap?.bill_pay_admin)return u.jsx(j,{to:"../promo"});if(P===!0&&c?.loggedInUserRoleMap!=null){const E=N=>N.trackPageLoaded($.Event.billPaySetup);return u.jsxs(ut,{children:[u.jsx(oe,{analytics:U,onLoad:N=>E(N)}),u.jsx(fe,{isAppContentDrawerOpen:y,handleDrawerToggle:F}),u.jsx(dt,{navigate:e,location:o,companyId:m,currentTenant:I,isUserBillPayAdmin:n,showIntlWiseWidget:r,onClickMenuIcon:()=>{F(!0)},hasZeniAccountsAdminAccess:s,accountsPromoConfig:d,isLocalCurrencyEnabled:p})]})}return u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:f.colors.grey5}})},Zt=(e,o)=>e!=null&&function(t){return t==="debit"||t==="credit"||t==="debit_and_credit"}(e)?e:o,Qt=e=>`/${e}/cards`,$t=e=>`/${e}/cards/setup`,Gt=e=>`/${e}/cards/onboard`,Wt=(e,o,t,a,c=!1)=>{let n=`/${e}/cards/${encodeURIComponent(o)}`;return a==null||a.status.code!=="inactive"||a.cardHolderUserId!==t.userId||a.type.code!=="business_physical_credit_card"&&a.type.code!=="business_physical_debit_card"?a!=null&&a.status.code==="active"&&a.cardHolderUserId===t.userId&&a.type.code==="business_physical_credit_card"&&c===!0?n+="/addToWallet":a==null||a.type.code!=="business_physical_debit_card"&&a.type.code!=="business_virtual_debit_card"||a.status.code!=="active"||a.cardHolderUserId!==t.userId||a.isPinSet!==!1||(n+="/setPin"):n+="/activate",n},Ht=(e,o)=>e.find(t=>t.id===o),qt=(e,o,t)=>!e||!o||t.fetchState==="Completed",pt=(e,o,t,a)=>({isCreditCardOffered:e,isDebitCardOffered:o,isDebitCardEnabled:t,isCreditCardEnabled:a}),Kt=(e,o)=>e?{creditCardCashbackOffer:`${o.cashbackAnalytics.creditCardCashbackOffer}%`,debitCardCashbackOffer:`${o.cashbackAnalytics.debitCardCashbackOffer}%`,totalEarnedCashback:x(o.cashbackSummary.cashbackEarned.amount),redeemedCashback:x(o.cashbackSummary.cashbackRedeemed.amount),availableCashback:x(o.cashbackSummary.cashbackAvailable.amount),creditCardCashbackRedemptionMode:o.cashbackAnalytics.creditCardCashbackRedemptionMode,debitCardCashbackRedemptionMode:o.cashbackAnalytics.debitCardCashbackRedemptionMode}:void 0,Jt=(e,o,t,a,c)=>e&&o&&t?{creditAccountId:a.id,creditAccountLimit:x(a.limit.amount),creditAccountAvailableAmount:x(a.available.amount),creditAccountSpentAmount:x(a.balance.amount+a.hold.amount),creditAccountStatus:a.status,outstandingBalance:x(c.remainingAmountDue.amount)}:void 0,Yt=(e,o,t,a,c)=>e&&o&&t?{debitAccountId:a.depositAccounts.map(n=>n.id),debitAccountName:a.depositAccounts.map(n=>n.accountName),debitAccountBalance:a.depositAccounts.map(n=>x(n.accountBalance.available.amount)),debitCardsSpend:x(c?.currentMonthSpends.amount??0),debitAccountStatus:a.depositAccounts.map(n=>n.accountStatus)}:void 0,Xt=(e,o)=>e&&o.depositAccountLimit!=null&&o.chargeCard!=null?{debitAccountId:o.depositAccountLimit.id,debitAccountName:o.depositAccountLimit?.accountName??o.connectedAccount?.accountName,debitAccountBalance:x(o.depositAccountLimit?.accountBalance.available.amount),debitCardsSpend:x(o.chargeCard.limit.amount-o.chargeCard.available.amount),debitAccountStatus:o.depositAccountLimit?.accountStatus??o.connectedAccount?.accountStatus}:void 0,ea=80,na=80,ta=e=>e.companyId??D.getSignedInUserTenant(e.tenantEmailDomain)?.companyId,mt=({isBankingOnlyTenant:e,isDebitCardFeatureEnabled:o})=>o||e,yt=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:t,isDebitCardProductVisible:a,chargeCardsCreditAccountLimit:c})=>(e||o||t)&&(!a||c>0),aa=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:t})=>e||o||t,ia=({cardInfo:e,isProductVisible:o,isTOSAccepted:t,isSetupEnabled:a,isUserHasCardsAdminLevelAccess:c,isUserHasCardsAccess:n})=>!!e&&o&&(!t&&c||n&&!c&&!a),ft=W(function(e,o){const{isUserChargeCardAdmin:t,chargeCardSetUpView:a,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n}=o,s=V(e),l=D.getSignedInUser(),i=s.tenantId,r={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i??""},p=t&&a.updateStatus.fetchState!=="In-Progress"&&a.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&a.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&a.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",f=!!s.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{chargeCardSetUpView:a,connectedAccountProvider:s.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:f,isDisabled:p,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:U,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n,filesEndPoint:`${ce.fileMicroServiceBaseUrl}`,authParams:r}},function(e,o){const{navigate:t,companyId:a,currentTenant:c,chargeCardSetUpView:n,isDebitCardTOSAccepted:s,isChargeCardTOSAccepted:l,isChargeCardSetupEnabled:i,isDebitCardSetupEnabled:r,productInformation:p,controllerEmails:f,businessVerificationStatus:A}=o;return{onBusinessVerificationSectionClick:()=>{U.trackCardsVerifyIdentityCompanyDetailsClick(f,p,A?.code),t("../verification"),c?.company?.companyChargeCardInfo!=null&&c.company.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(le(a,!1,!0))},onCardPolicySectionClick:()=>{t("../policy")},onFetchLinkTokenClick:(d,y)=>{e(we("charge_card_setup",d,y))},onEstablishConnectionClick:d=>{e(Te(d,a,"charge_card_setup","charge_cards"))},onUpdatePaymentAccountStatus:(d,y,b)=>{e(Ee(d,y,"charge_cards","charge_card_setup",b))},onUpdatePaymentAccountLoginStatus:(d,y)=>{e(Pe(!1,d,"charge_cards","charge_card_setup",y))},onEstablishConnectionSuccess:()=>{e(le(a,!0))},onEnableChargeCardClick:()=>{U.trackCardsEnableCardsClick(f,p,"Cards Card Setup"),l===!0&&s===!0&&i===!1&&r===!1?e(K(a,"charge_cards__debit_cards")):l===!0&&i===!1?e(K(a,"charge_cards")):s===!0&&r===!1&&e(K(a,"debit_cards"))},onUpdateChargeCardClick:(d,y,b)=>{const _=n.allBankAccounts.find(S=>S.accountId===n.primaryFundingAccount?.zeniAccountId),g=n.allBankAccounts.find(S=>S.accountId===d);U.trackCardsZeniCashAccountChangeClick(f,p,{oldZeniCashAccount:_?.accountName??"",newZeniCashAccount:g?.accountName??"",oldZeniCashAccountPosition:n.allBankAccounts.findIndex(S=>S.accountId===n.primaryFundingAccount?.zeniAccountId)+1,newZeniCashAccountPosition:n.allBankAccounts.findIndex(S=>S.accountId===d)+1,numberOfCashAccounts:n.allBankAccounts.length}),e(b==="paymentAccount"?_e(d,y,"charge_cards","charge_card_setup"):ve("charge_card_setup",d,y))},onUpdatePrimaryFundingAccount:(d,y)=>{const b=n.allFundingAccounts.find(S=>S.id===d),_=n.allFundingAccounts.findIndex(S=>S.id===n.primaryFundingAccount?.id)+1,g=n.allFundingAccounts.findIndex(S=>S.id===d)+1;U.trackCardsPaymentAccountChangeClick(f,p,{oldPaymentAccountName:n.primaryFundingAccount?.label??"",oldPaymentAccountBalance:x(n.primaryFundingAccount?.accountBalance?.available?.amount??0),newPaymentAccountName:b?.label??"",newPaymentAccountBalance:x(b?.accountBalance?.available?.amount??0),isOldPaymentAccountRecommended:n.primaryFundingAccount?.accType==="depositAccount",isNewPaymentAccountRecommended:b?.accType==="depositAccount",oldPaymentAccountPosition:_,newPaymentAccountPosition:g,numberOfPaymentAccounts:n.allFundingAccounts.length}),e(ke(a,"charge_card_setup",d,y))},onEnableChargeCardSuccess:()=>{e(gn()),t("../",{relative:"path"})},onBackClick:()=>{c?.companyChargeCardInfo?.info?.isChargeCardEnabled||c?.companyDebitCardInfo?.info?.isDebitCardEnabled?t("../",{relative:"path"}):t("../..",{relative:"path"})},onNavigateToDashboard:()=>{t("../../dashboard")},onCompanyOfficerUpdated:(d,y)=>{e(Ae({officerType:d,fileIds:y}))},onSendForVerificationClick:d=>{l===!0&&s===!0?e(L(a,d,"charge_cards__debit_cards",!0,!0,!0)):l===!0?e(L(a,d,"charge_cards",!0,!0,!0)):s===!0&&e(L(a,d,"debit_cards",!0,!0,!0))},updateFilesEntity:d=>{e(ae({files:d}))},onDeleteFile:d=>{e(te(d))},onEditFileName:(d,y)=>{e(ne(d,y.split(".")[0]))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onUpdateAutoPayClick:d=>{e(fn(a,d))}}})(Yn),gt=()=>{const e=Y(),o=X(),t=ee(),{tenantEmailDomain:a}=G(),c=ie(),n=v(M=>V(M)),{useDynamicConfig:s,useFeatureGate:l}=se(),i=o.state?.pathnameStackToGoBack?.[0],{configValue:r}=s(J.zeniAccountsConfig),{configValue:p}=s(J.zeniCardsConfig),f=p.credit_card_auto_pay_threshold_by_company_id?.[n.companyId]??p.default_credit_card_auto_pay_threshold??80,{isFeatureEnabled:A}=l(de.isDebitCardFeatureEnabled),{isFeatureEnabled:d}=l(de.isChargeCardFeatureEnabled),{isFeatureEnabled:y}=l(de.isEarlyPayFeatureEnabled),b=v(M=>rn(M,n.companyId)),_=un(b.controllers),g=!!n.company?.companyChargeCardInfo.isChargeCardEnabled,S=!!n.company?.companyDebitCardInfo.isDebitCardEnabled,T=dn(A,n),I=mt({isDebitCardFeatureEnabled:A,isBankingOnlyTenant:T}),h=ln(n),w=pn(n),k=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,m=yt({isCardsOnlyTenant:h,isChargeCardFeatureEnabled:d,isBookKeepingTenant:w,isDebitCardProductVisible:I,chargeCardsCreditAccountLimit:k}),P=I&&m===!1,R=I===!1&&m,F=ye(r),E=mn(c?.loggedInUserRoleMap),N=Ie(c?.loggedInUserRoleMap),[H,ge]=C.useState(!1),[q,re]=C.useState(!1),Z=v(M=>M.chargeCardSetupViewState.fetchState),B=D.getSignedInUserTenant(a)?.companyId??n.companyId,O=D.getSignedInUser(),Oe=M=>{ge(M)},Se=v(M=>yn(M,B));if(O==null)throw Error("Can't access charge card setup page without signing in...");C.useEffect(()=>{q||Z!=="Not-Started"||B==null?q||Z!=="Completed"||B==null||n.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(le(B,!1,!0)):(re(!0),t(le(B,!0)))},[q,Z,B,t]);const be=!!n.company?.companyChargeCardInfo.isChargeCardTOSAccepted,he=!!n.company?.companyDebitCardInfo.isDebitCardTOSAccepted,ue=pt(m,I,S,g);return be||he?be||he?u.jsxs(u.Fragment,{children:[u.jsx(oe,{analytics:U,onLoad:()=>{U.trackPageLoaded($.Event.cardsSetupVisited),U.trackCardsCardSetupView(_,ue,i==null?"Cards Setup":i.includes("cards/promo")?"Promo":i.includes("cards")?"Settings":"Cards Tab")}}),u.jsx(fe,{isAppContentDrawerOpen:H,handleDrawerToggle:Oe}),u.jsx(ft,{autoPayThreshold:f,navigate:e,location:o,companyId:B,currentTenant:n,isEarlyPayEnabled:y,isChargeCardTOSAccepted:be,isDebitCardTOSAccepted:he,isUserChargeCardAdmin:E,isDebitCardOnlyEnabled:P,isCreditCardOnlyEnabled:R,chargeCardSetUpView:Se,isCreditCardProductVisible:m,isDebitCardFeatureEnabled:I,isChargeCardSetupEnabled:g,isDebitCardSetupEnabled:S,businessVerificationStatus:n.companyBillPayInfo?.info?.businessVerificationStatus,controllerEmails:_,productInformation:ue,onClickMenuIcon:()=>{Oe(!0)},hasZeniAccountsAdminAccess:N,accountsPromoConfig:F})]}):u.jsx(Ue,{fetchState:"Not-Started"}):u.jsx(j,{to:"../promo"})},St=xe.div`
10
+ display: flex;
11
+ height: 100%;
12
+ width: 100%;
13
+ flex: 1 1 auto;
14
+ flex-direction: column;
15
+ align-items: center;
16
+ background-color: ${e=>e.theme.colors.grey4};
17
+ `,bt=W(function(e,o){const{isUserRemiAdmin:t,companyId:a}=o,c=V(e),n=hn(e),s=Cn(e,a),l=D.getSignedInUser(),i=c.tenantId,r={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i??""},p=t&&s.updateStatus.fetchState!=="In-Progress"&&s.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&s.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&s.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",f=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{remiSetupView:s,isDisabled:p,remiApprovalView:n,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:f,meetingUrl:"https://meetings.hubspot.com/niharn/demo-reimbursements?embed=true",analytics:U,filesEndPoint:`${ce.fileMicroServiceBaseUrl}`,authParams:r}},function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{updateMileageDetails:n=>{const{mileageAmount:s,mileageUnit:l,mileageCurrencyCode:i,mileageCurrencySymbol:r,denomination:p,denominationSymbol:f,mileageAmountInDenomination:A,description:d}=n;e(An({mileageDetails:{mileageUnitAmount:{amount:s,currencyCode:i,currencySymbol:r},denomination:p,denominationSymbol:f,mileageAmountInDenomination:A,mileageCurrencyCode:i,mileageCurrencySymbol:r,mileageUnit:l,description:d}}))},onSaveMileageClick:n=>{e(In(a)),U.trackReimbursementMileageRateSave(n)},onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyReimbursementInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(pe(a,!1,!0))},onSetupApprovalRulesSectionClick:()=>{t("../approval-rules")},onFetchLinkTokenClick:(n,s)=>{e(we("reimbursement_setup",n,s))},onEstablishConnectionClick:n=>{e(Te(n,a,"reimbursement_setup","reimbursement"))},onUpdatePaymentAccountStatus:(n,s,l)=>{e(Ee(n,s,"reimbursement","reimbursement_setup",l))},onUpdatePaymentAccountLoginStatus:(n,s)=>{e(Pe(!1,n,"reimbursement","reimbursement_setup",s))},onEstablishConnectionSuccess:()=>{e(pe(a,!0))},onEnableRemiClick:()=>{e(K(a,"reimbursement"))},onUpdateAccountClick:(n,s,l)=>{e(l==="paymentAccount"?_e(n,s,"reimbursement","reimbursement_setup"):ve("reimbursement_setup",n,s))},onEnableRemiSuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyReimbursementInfo?.info?.isReimbursementEnabled!=null&&c.companyReimbursementInfo.info.isReimbursementEnabled===!1?t("../.."):t("../",{relative:"path"})},onCompanyOfficerUpdated:(n,s)=>{e(Ae({officerType:n,fileIds:s}))},onSendForVerificationClick:n=>{e(L(a,n,"reimbursement",!0,!0,!0))},updateFilesEntity:n=>{e(ae({files:n}))},onDeleteFile:n=>{e(te(n))},onEditFileName:(n,s)=>{e(ne(n,s.split(".")[0]))},onUpdatePrimaryFundingAccount:(n,s)=>{e(ke(a,"reimbursement_setup",n,s))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}})(Xn),ht=()=>{const e=Y(),o=X(),t=ee(),{tenantEmailDomain:a}=G(),c=ie(),{useDynamicConfig:n}=se(),s=De(),{configValue:l}=n(J.zeniAccountsConfig),i=ye(l),r=Sn(c?.loggedInUserRoleMap),p=Ie(c?.loggedInUserRoleMap),[f,A]=C.useState(!1),d=C.useRef(!1),[y,b]=C.useState(!1),_=v(m=>m.remiSetupViewState.fetchState),g=v(m=>V(m)),S=v(m=>m.remiSetupApproverViewState.fetchState),{isApprovalRulesV3Enabled:T,isLoading:I}=Ye(g?.tenantId),h=D.getSignedInUserTenant(a)?.companyId??g.companyId,w=D.getSignedInUser(),k=m=>{A(m)};if(w==null)throw Error("Can't access reimbursement setup page without signing in...");if(C.useEffect(()=>{d.current||_!=="Not-Started"||h==null?d.current||_!=="Completed"||h==null||g.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(d.current=!0,t(pe(h,!1,!0))):(d.current=!0,t(pe(h,!0)))},[_,h,t]),C.useEffect(()=>{y||S!=="Not-Started"||I||(b(!0),t(bn(!0,!1,!1,T)))},[y,S,I,T,t]),g.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1)return u.jsx(j,{to:"../promo"});if(g.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!0){const m=P=>P.trackPageLoaded($.Event.reimbursementSetup);return u.jsxs(St,{children:[u.jsx(oe,{analytics:U,onLoad:P=>m(P)}),u.jsx(fe,{isAppContentDrawerOpen:f,handleDrawerToggle:k}),u.jsx(bt,{navigate:e,location:o,companyId:h,currentTenant:g,isUserRemiAdmin:r,onClickMenuIcon:()=>{k(!0)},hasZeniAccountsAdminAccess:p,accountsPromoConfig:i})]})}return u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:s.colors.grey5}})},Ct=W(function(e,o){const{businessVerificationDetails:t,productType:a}=o,c=V(e),n=D.getSignedInUser(),s=c.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:s??""},i=wn(o.roleMap)&&t.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",r=Dn(e.companyConfigState),p=Un(e.userRoleConfigState),f=a==="zeni_treasury"?He(e):void 0;return{businessVerificationDetails:t,verficationDetailsFetchState:t.fetchState,isRefreshingViewInBackground:t.isRefreshingViewInBackground,allNationalityCountries:t.allNationalityCountries,filesEndPoint:`${ce.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:i,allIndustries:r.companyIndustries??[],companyTitles:p.companyTitles,transferDetails:f}},function(e,o){const{companyId:t,productType:a,currentTenant:c,navigate:n,location:s}=o,{tenantEmailDomain:l}=c;return{onCompanyDetailsChanged:i=>{const{companyDescription:r,companyIndustry:p,companyIndustryType:f,companyLegalName:A,companyTaxId:d,companyWebsite:y,companyPhone:b,primaryContactEmail:_,primaryContactName:g,primaryContactUserId:S,primaryContactSyncToken:T,syncToken:I,fileIds:h,incDate:w,typeOfIncorporation:k,stateOfIncorporation:m,sourceOfFunds:P,companySubIndustry:R,countriesOfOperations:F,companySourceOfFunds:E,companySourceOfFundsDescription:N,transactionVolume:H,transactionVolumeDescription:ge,purposeOfAccount:q,purposeOfAccountDescription:re,regulatedStatus:Z,regulatedStatusDescription:B,usNexus:O,usNexusTypes:Oe}=i,Se=f?.selectedOption,be={companyId:t,companyDescription:r,companyIndustry:p.selectedOption,companyIndustryType:Se==null||Se===""?void 0:Se,companyLegalName:A,taxIdOrEIN:d,website:y!=""&&y!=null?jn(y):void 0,phone:b,syncToken:I,fileIds:h,incDate:w!=null?je(w?.toString()):w,typeOfIncorporation:k?.selectedOption??"",stateOfIncorporation:m?.selectedOption??"",sourceOfFunds:P?.selectedOption??"",companySubIndustry:R?.selectedOption??"",countriesOfOperations:F?.selectedOptions.map(ue=>ue.length===2?ue:Le(ue))??[],companySourceOfFunds:E?.selectedOption??"",companySourceOfFundsDescription:N,transactionVolume:H?.selectedOption??"",transactionVolumeDescription:ge,purposeOfAccount:q?.selectedOption??"",purposeOfAccountDescription:re,regulatedStatus:Z??"",regulatedStatusDescription:B,usNexus:O,usNexusTypes:Oe?.selectedOptions??[]},he={userId:S,firstName:g.firstName,lastName:g.lastName,email:_,syncToken:T};e(Re({companyDetails:be,primaryContactDetails:he}))},onCompanyOfficerUpdated:i=>{const r=i.map(p=>{const{officerType:f,userId:A,name:d,email:y,nationalityCountryCode:b,ssn:_,dob:g,phone:S,syncToken:T,selectDocument:I,role:h,ownership:w,isSelectedForVerification:k,userVerificationStatus:m,treasuryUserVerificationStatus:P,fileIds:R}=p;let F;return I.selectDocumentType==="driverLicense"?F="driving_license":I.selectDocumentType==="passport"?F="passport":I.selectDocumentType==="stateId"?F="id_document":I.selectDocumentType==="ssnCard"&&(F="social_security_card"),{officerType:f,userId:A,firstName:d.firstName,lastName:d.lastName,email:y,ssn:_,nationalityCountryCode:b?.selectedOption!=null?Le(b.selectedOption):void 0,phone:S,birthday:g!=null?je(g?.toString()):g,syncToken:T,titleAtCompany:h.selectedOption,ownershipInCompany:w,documentTypeSelectedForVerification:F,isSelectedForVerification:k,userVerificationStatus:m,treasuryUserVerificationStatus:P,fileIds:R,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}});e(Re({officers:r}))},onSaveDetailsClick:i=>{e(L(t,i,a))},onSendForVerificationClick:i=>{e(L(t,i,a,!0))},onAddressClick:i=>{const r=Ze(l,i),p=ze(s.state?.pathnameStackToGoBack,s.pathname),f=new URLSearchParams(s.search),A={};f.forEach((d,y)=>{A[y]=d}),n(r,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(A).length>0?A:void 0}})},onRegisteredAddressClick:i=>{const r=Ze(l,i),p=ze(s.state?.pathnameStackToGoBack,s.pathname),f=new URLSearchParams(s.search),A=Object.fromEntries(f.entries());n(r,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(A).length>0?A:void 0}})},onBackClick:()=>{e(Bn({companyId:t})),n("../setup")},updateFilesEntity:i=>{e(ae({files:i}))},onDeleteFile:i=>{e(te(i))},onDeleteFileList:i=>{e(Ke(i))},onEditFileName:(i,r)=>{e(ne(i,r.split(".")[0]))},onGetOtp:i=>{e(Ge(i,"SpendManagementSetup"))},onResendOtp:i=>{e($e(i,"SpendManagementSetup"))},onVerifyOtp:(i,r)=>{e(Qe(i,r,"SpendManagementSetup"))},saveNewAddressInLocalStore:(i,r)=>{e(xn({addressType:i,addressToCreate:r}))},onExecuteTreasuryTransfer:()=>{e(qe())},onOverlayClose:()=>{e(Ve())},onIdentityDocumentUploadedForAutofill:i=>{if(t==null)return;const r=Fn(i.documentType);r!=null&&e(Vn({target:"setup",companyId:t,officerType:i.officerType,fileId:i.fileId,documentType:r}))},onCompanyDocumentUploadedForAutofill:i=>{t!=null&&e(On({target:"setup",companyId:t,fileId:i.fileId,documentType:i.documentType}))}}})(et),It=({productType:e,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:t})=>{const a=Y(),c=X(),n=ee(),[s]=Xe(),l=s.get("showStepProgress"),i=s.get("isTransferInitiated"),[r,p]=C.useState(!1),{tenantEmailDomain:f}=G(),A=ie(),{useDynamicConfig:d}=se(),y=De(),{configValue:b}=d(J.zeniAccountsConfig),_=ye(b),g=v(m=>{switch(e){case"zeni_accounts":return m.zeniAccountSetupViewState.fetchState;case"reimbursement":return m.remiSetupViewState.fetchState;case"charge_cards":return m.chargeCardSetupViewState.fetchState;case"zeni_treasury":return m.treasurySetupViewState.fetchState;default:return m.billPaySetupViewState.fetchState}}),S=v(m=>m.companyConfigState.fetchState),T=v(m=>m.userRoleConfigState.fetchState),I=v(m=>V(m)),h=I.companyId??D.getSignedInUserTenant(f)?.companyId;if(C.useEffect(()=>{S==="Not-Started"&&n(kn()),T==="Not-Started"&&n(_n(!0))},[S,T,n]),C.useEffect(()=>{if(!r&&g==="Not-Started"&&h!=null)switch(p(!0),e){case"zeni_accounts":n(me(h,!0));break;case"zeni_treasury":n(Ce(h,!0));break;case"reimbursement":n(pe(h,!0));break;case"charge_cards":n(le(h,!0));break;default:n(Q(h,!0))}},[r,g,h,n]),D.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let w;switch(e){case"zeni_accounts":w=I.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":w=I.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":w=I.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||I.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":w=I.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:w=I.companyBillPayInfo?.info?.isBillPayTOSAccepted}const k=v(m=>{let P;switch(e){case"zeni_accounts":P=Tn(m,h);break;case"zeni_treasury":P=We(m,h);break;case"charge_cards":P=En(m,h);break;case"reimbursement":P=Pn(m,h);break;default:P=vn(m,h)}return P});return w===!1?null:k.fetchState==="Completed"&&w===!0&&A?.loggedInUserRoleMap!=null?u.jsxs(u.Fragment,{children:[u.jsx(oe,{analytics:U,onLoad:m=>(P=>{switch(e){case"zeni_accounts":return P.trackPageLoaded($.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return P.trackPageLoaded($.Event.reimbursementBusinessVerification);default:return P.trackPageLoaded($.Event.billPayBusinessVerification,Be(c)?"Settings":void 0)}})(m)}),u.jsx(Ct,{businessVerificationDetails:k,navigate:a,location:c,companyId:h,analytics:U,currentTenant:I,productType:e,roleMap:A.loggedInUserRoleMap,isSettings:Be(c),isOverlay:!0,isStepInProgress:l!=null,isTreasuryTransferInitiated:i!=null,onClickMenuIcon:()=>{},maxInsuredAmount:_.maxInsuredAmount,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:t})]}):u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:y.colors.grey5}})},At={overlayWidth:new tt(100,100,59)},kt=W(function(e,o){const{isUserZeniAccountsAdmin:t,companyId:a,accountsPromoConfig:c}=o,n=V(e),s=D.getSignedInUser(),l=n.tenantId,i={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:l??""},r=Je(e,a),p=We(e,a),f=t&&r.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&r.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",A=Ln(e),d=A.transactions,y=He(e),b=A.accountSummary?.totalBalance?.amount,_=d.length===0||b===0;return{treasurySetupView:r,businessVerificationDetails:p,connectedAccountProvider:n.company?.featuresActivationInfo.connectedAccountProvider??"",transactions:d,transferDetails:y,isFirstTransfer:_,isDisabled:f,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:U,filesEndPoint:`${ce.fileMicroServiceBaseUrl}`,authParams:i,isOnSetup:!0,maxInsuredAmount:c.maxInsuredAmount}},function(e,o){const{navigate:t,companyId:a,currentTenant:c,isAllocationDone:n,analytics:s,treasurySetupView:l}=o;return{onTransferSaveChangesToLocalStore:i=>{e(Qn(i))},onBusinessVerificationSectionClick:(i,r)=>{let p="../verification";i&&(p+="?showStepProgress=true",r&&(p+="&isTransferInitiated=true")),t(p),c?.company?.companyTreasuryInfo!=null&&c?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="pending_review"&&e(Ce(a,!1,!0))},onFetchLinkTokenClick:(i,r)=>{e(we("treasury_setup",i,r))},onEstablishConnectionClick:i=>{e(Te(i,a,"treasury_setup","zeni_treasury"))},onUpdatePaymentAccountStatus:(i,r,p)=>{e(Ee(i,r,"zeni_treasury","treasury_setup",p))},onUpdatePaymentAccountLoginStatus:(i,r)=>{e(Pe(!1,i,"zeni_treasury","treasury_setup",r))},onEstablishConnectionSuccess:()=>{e(Ce(a,!0))},onEnableTreasuryClick:()=>{e(K(a,"zeni_treasury"))},onUpdateTreasuryClick:(i,r,p)=>{e(p==="paymentAccount"?_e(i,r,"zeni_treasury","treasury_setup"):ve("treasury_setup",i,r))},onUpdatePrimaryFundingAccount:(i,r)=>{e(ke(a,"treasury_setup",i,r))},onNavigateToDashboard:()=>{t(c?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="verified"?"../":"../../")},onCompanyOfficerUpdated:(i,r)=>{e(Ae({officerType:i,fileIds:r}))},onSendForVerificationClick:(i,r)=>{if(e(L(a,i,"zeni_treasury",!0,!0,!0)),!n){const p=l.fundAllocationLocalData;s.trackTreasuryPortfolioConfirm(p.riskScore,Me(p)),e(Ne(!1))}r===!0&&e(qe())},updateFilesEntity:i=>{e(ae({files:i}))},onDeleteFile:i=>{e(te(i))},onEditFileName:(i,r)=>{e(ne(i,r.split(".")[0]))},onAdditionalVerificationFieldsChanged:i=>{const{sourceOfFunds:r}=i;e(Zn({sourceOfFunds:r?.selectedOption??""}))},onUpdateFundAllocation:i=>{s.trackTreasuryAllocationAction("update",Me(i)),e(Mn(i))},onConfirmFundAllocation:()=>{e(Ne(n))},onSignUpClick:()=>{o.isUserZeniAccountsAdmin?window.open("../checking/promo","_blank","noopener,noreferrer"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank","noopener,noreferrer")},onOverlayClose:()=>{e(Ve())}}})(at),_t=()=>{const e=Y(),o=X(),t=ee(),a=De(),c=nt(),{tenantEmailDomain:n}=G(),{useDynamicConfig:s}=se(),l=ie(),[i,r]=C.useState(!1),p=Ie(l?.loggedInUserRoleMap),{configValue:f}=s(J.zeniAccountsConfig),A=ye(f),[d,y]=C.useState(!1),[b,_]=C.useState(!1),[g,S]=C.useState(!1),[T,I]=C.useState(!1),[h,w]=C.useState(!1),k=v(O=>O.treasurySetupViewState.fetchState),m=v(O=>O.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState),P=v(O=>O.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),R=v(O=>O.treasuryDetailState.transactionsState?.fetchState),F=v(O=>V(O)),E=D.getSignedInUserTenant(n)?.companyId??F.companyId,N=v(O=>Je(O,E)),H=N.isAtomicAccountExists,ge=!!F.companyZeniAccountInfo?.info?.isZeniAccountEnabled,q=D.getSignedInUser(),re=O=>{y(O)};if(q==null)throw Error("Can't access treasury setup page without signing in...");C.useEffect(()=>{b||k!=="Not-Started"||E==null||(_(!0),t(Ce(E,!0,!1)))},[b,k,E,t]),C.useEffect(()=>{g||m!=="Not-Started"||E==null||(S(!0),t(Rn()))},[g,m,E,t]),C.useEffect(()=>{T||P!=="Not-Started"||E==null||(I(!0),t(Nn()))},[T,P,E,t]),C.useEffect(()=>{h||R!=="Not-Started"||E==null||(w(!0),t(zn(!0)))},[h,R,E,t]);const Z=F.companyTreasuryInfo?.info?.businessVerificationStatus?.code,B=Z==="pending_review"||Z==="verified";return C.useEffect(()=>{i||k!=="Completed"||H||B||!o.pathname.includes("setup")||r(!0)},[k,H,B]),F.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1?u.jsx(j,{to:"../promo"}):u.jsxs(u.Fragment,{children:[u.jsx(oe,{analytics:U,onLoad:()=>{}}),u.jsx(fe,{isAppContentDrawerOpen:d,handleDrawerToggle:re}),u.jsx(ct,{onClose:()=>{t(Ve()),e("../setup")},anchor:"right",open:o.pathname.includes("verification"),transitionDuration:i?0:250,PaperProps:{style:{width:At.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:i?"transparent":a.colors.black,opacity:.75,cursor:"pointer"}}},children:u.jsx(vt,{onClick:O=>O.stopPropagation(),children:u.jsx(It,{productType:"zeni_treasury",isBusinessVerificationDrawerOpen:!0,closeDrawerHandler:()=>{t(Ve()),e("../setup")}})})}),u.jsx(kt,{navigate:e,location:o,companyId:E,currentTenant:F,isUserZeniAccountsAdmin:p,accountsPromoConfig:A,isAccountsEnabled:ge,isAllocationDone:H,analytics:U,treasurySetupView:N,onClickMenuIcon:()=>{re(!0)},showTreasurySetupOverlay:i,setShowTreasurySetupOverlay:r})]})},vt=xe(rt)`
18
+ display: flex;
19
+ min-height: 100%;
20
+ flex-direction: column;
21
+ `,Pt=W(function(e,o){const{isUserZeniAccountsAdmin:t,companyId:a}=o,c=V(e),n=D.getSignedInUser(),s=c.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:s??""},i=$n(e,a),r=t&&i.updateStatus.fetchState!=="In-Progress"&&i.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&i.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&i.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly";return{zeniAccountSetUpView:i,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:r,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:U,filesEndPoint:`${ce.fileMicroServiceBaseUrl}`,authParams:l}},function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyZeniAccountInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(me(a,!1,!0))},onFetchLinkTokenClick:(n,s)=>{e(we("account_setup",n,s))},onEstablishConnectionClick:n=>{e(Te(n,a,"account_setup","zeni_accounts"))},onUpdatePaymentAccountStatus:(n,s,l)=>{e(Ee(n,s,"zeni_accounts","account_setup",l))},onUpdatePaymentAccountLoginStatus:(n,s)=>{e(Pe(!1,n,"zeni_accounts","account_setup",s))},onEstablishConnectionSuccess:()=>{e(me(a,!0))},onEnableZeniAccountClick:()=>{e(K(a,"zeni_accounts"))},onUpdateZeniAccountClick:(n,s,l)=>{e(l==="paymentAccount"?_e(n,s,"zeni_accounts","account_setup"):ve("account_setup",n,s))},onUpdatePrimaryFundingAccount:(n,s)=>{e(ke(a,"account_setup",n,s))},onEnableZeniAccountSuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyZeniAccountInfo?.info?.isZeniAccountEnabled?t("../"):t("../../")},onNavigateToDashboard:()=>{t("../../dashboard")},onCompanyOfficerUpdated:(n,s)=>{e(Ae({officerType:n,fileIds:s}))},onSendForVerificationClick:n=>{e(L(a,n,"zeni_accounts",!0,!0,!0))},updateFilesEntity:n=>{e(ae({files:n}))},onDeleteFile:n=>{e(te(n))},onEditFileName:(n,s)=>{e(ne(n,s.split(".")[0]))}}})(it),Et=()=>{const e=Y(),o=X(),t=ee(),{tenantEmailDomain:a}=G(),{useDynamicConfig:c}=se(),n=ie(),s=Ie(n?.loggedInUserRoleMap),{configValue:l}=c(J.zeniAccountsConfig),i=ye(l),[r,p]=C.useState(!1),[f,A]=C.useState(!1),d=v(S=>S.zeniAccountSetupViewState.fetchState),y=v(S=>V(S)),b=D.getSignedInUserTenant(a)?.companyId??y.companyId,_=D.getSignedInUser(),g=S=>{p(S)};if(_==null)throw Error("Can't access zeni bank account setup page without signing in...");if(C.useEffect(()=>{f||d!=="Not-Started"||b==null?f||d!=="Completed"||b==null||y.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(me(b,!1,!0)):(A(!0),t(me(b,!0)))},[f,d,b,t]),y.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted===!1)return u.jsx(j,{to:"../promo"});{const S=T=>T.trackPageLoaded($.Event.zeniAccountsSetup);return u.jsxs(u.Fragment,{children:[u.jsx(oe,{analytics:U,onLoad:T=>S(T)}),u.jsx(fe,{isAppContentDrawerOpen:r,handleDrawerToggle:g}),u.jsx(Pt,{navigate:e,location:o,companyId:b,currentTenant:y,isUserZeniAccountsAdmin:s,accountsPromoConfig:i,onClickMenuIcon:()=>{g(!0)}})]})}},Tt=xe.div`
22
+ display: flex;
23
+ height: 100vh;
24
+ width: 100%;
25
+ flex: 1 1 auto;
26
+ flex-direction: column;
27
+ align-items: center;
28
+ background-color: ${e=>e.theme.colors.grey4};
29
+ `,wt=W(function(e,o){const t=V(e),a=D.getSignedInUser(),c=t.tenantId,n={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:c??""};return{internationalOnboardingDetails:Hn(e),isReadonly:o.isFormReadonly,filesEndPoint:`${ce.fileMicroServiceBaseUrl}`,authParams:n,analytics:U}},function(e,o){const{navigate:t}=o;return{onFormDataChange:a=>{e(Kn(a))},onSubmitClick:()=>{e(qn(o.companyId))},onCancelClick:()=>{t("../setup")},updateFilesEntity:a=>{e(ae({files:a}))},onDeleteFile:a=>{e(te(a))},onDeleteFileList:a=>{e(Ke(a))},onEditFileName:(a,c)=>{e(ne(a,c.split(".")[0]))}}})(st),Dt=()=>{const e=Y(),o=X(),t=ee(),[a,c]=C.useState(!1),[n,s]=C.useState(!1),[l,i]=C.useState(!1),{tenantEmailDomain:r}=G(),p=ie(),{useFeatureGate:f}=se(),{isFeatureEnabled:A}=f(de.isBillPayLocalCurrencyFeatureEnabled),d=v(k=>k.internationalWireVerificationState.verificationFormFetchState.fetchState),y=v(k=>k.billPaySetupViewState.fetchState),b=v(k=>V(k)),_=De(),g=b.companyId??D.getSignedInUserTenant(r)?.companyId,S=v(k=>Gn(k.companyState,b.companyId)),T=S?.company.companyBillPayInfo.internationalWireOnboardingStatus,I=T?.code==="onboarding_status_not_started"?void 0:"readonly";if(C.useEffect(()=>{a||d!=="Not-Started"||g==null||(c(!0),t(Wn(g)))},[a,d,g,t]),C.useEffect(()=>{n||y!=="Not-Started"||g==null||(s(!0),t(Q(g,!0)))},[y,n,g,t]),D.getSignedInUser()==null)throw Error("Can't access international verification without signing in...");const h=b.companyBillPayInfo?.info?.isBillPayTOSAccepted,w=k=>{i(k)};return h===!1?u.jsx(j,{to:"../promo"}):h===!0&&p?.loggedInUserRoleMap!=null?u.jsxs(Tt,{children:[u.jsx(oe,{analytics:U,onLoad:k=>(m=>m.trackPageLoaded($.Event.billPayBusinessVerification,void 0))(k)}),Be(o)?u.jsx(fe,{isAppContentDrawerOpen:l,handleDrawerToggle:w}):null,u.jsx(wt,{navigate:e,location:o,companyId:g,analytics:U,currentTenant:b,roleMap:p.loggedInUserRoleMap,isFormReadonly:I,isLocalCurrencyEnabled:A})]}):u.jsx(Ue,{fetchState:"In-Progress",style:{backgroundColor:_.colors.grey5}})},Ut=W(function(){return{}},function(e,o){const{companyId:t,productType:a}=o;return{onEventReceived:c=>{switch(c){case"bill-pay-set-up-verification-update":case"bill-pay-wise-setup":switch(a){case"reimbursement":e(pe(t,!0,!0));break;case"zeni_accounts":e(me(t,!0,!0));break;case"charge_cards":e(le(t,!0,!0));break;case"zeni_treasury":e(Ce(t,!0,!0));break;default:e(Q(t,!0,!0))}}}}})(ot(e=>{const{isBillPayAdminLevelAccess:o,isUserHasOnlyBillPayAccess:t,isReimbursementAdminLevelAccess:a,isZeniAccountAdminLevelAccess:c,isTreasuryAdminLevelAccess:n,isChargeCardAdminLevelAccess:s,isUserHasOnlyCardAccess:l,productType:i,type:r}=e;switch(i){case"bill_pay":switch(r){case"verification":return o?u.jsx(Fe,{productType:i}):t?u.jsx(j,{to:"../"}):u.jsx(z,{});case"international-wire":return o?u.jsx(Dt,{}):t?u.jsx(j,{to:"../"}):u.jsx(z,{});default:return o?u.jsx(lt,{}):t?u.jsx(j,{to:"../"}):u.jsx(z,{})}case"reimbursement":return r==="verification"?a?u.jsx(Fe,{productType:i}):u.jsx(z,{}):a?u.jsx(ht,{}):u.jsx(z,{});case"zeni_accounts":return r==="verification"?c?u.jsx(Fe,{productType:"zeni_accounts"}):u.jsx(z,{}):c?u.jsx(Et,{}):u.jsx(z,{});case"zeni_treasury":return n===!0?u.jsx(_t,{}):u.jsx(z,{});case"charge_cards":return r==="verification"?s?u.jsx(Fe,{productType:"charge_cards"}):l?u.jsx(j,{to:"../"}):u.jsx(z,{}):s?u.jsx(gt,{}):l?u.jsx(j,{to:"../"}):u.jsx(z,{})}}));function sa(e){const{tenantEmailDomain:o}=G(),t=v(c=>V(c)).companyId??D.getSignedInUserTenant(o)?.companyId,a={events:t!=null?[`private-encrypted-${t}.bill-pay-set-up-verification-update`,`private-encrypted-${t}.bill-pay-wise-setup`]:[],eventCallback:(c,n,s)=>{s.onEventReceived(c)}};if(D.getSignedInUser()==null)throw Error("Can't access setup details page without signing in...");return u.jsx(Ut,{...e,companyId:t,...a})}export{ea as A,na as P,sa as S,Jt as a,Xt as b,mt as c,yt as d,pt as e,ta as f,Wt as g,Qt as h,Kt as i,Yt as j,aa as k,qt as l,Ht as m,$t as n,Gt as o,Zt as p,ia as s};
@@ -0,0 +1 @@
1
+ import{j as f}from"./liveblocks-B5ZW-VBI.js";import{a as u,b as T,q as A}from"./sentry-BxWyF9h9.js";import{u as M,h as z,j as c,g as D,N as O,n as j}from"./core-Crl6eqZl.js";import{u as F,z as s,m as P,c as E,F as _,d as B,e as N,p as V,g as $,q,f as v}from"./index-CJknvk0s.js";import{eW as W,LU as J,LV as X,fz as Y,g0 as H,L_ as G,go as K,cX as Q,L$ as b,M0 as R,M1 as Z,bY as y}from"./zeni-epic-state-DTyrT1Ga.js";import"./mui-U77PQnc2.js";import{u as ee}from"./useDeviceId-BZa5m-bZ.js";import{f as te}from"./analyticsHelper-BsiU5y2K.js";import{t as ne}from"./getLocaleForTenant-DiFaMSxg.js";import"./recharts-e5u-LCPv.js";import"./analytics-CkLW7NeW.js";import"./plaid-TCRHScH1.js";import"./dnd-tE28jHT7.js";import"./stripe-DMRn4zHo.js";import"./lottie-hSeCd_VX.js";import"./lexical-Bm_vZOjC.js";import"./pdf-DDcPh2pm.js";import"./utils-BjvWDnmB.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="6fe88872-743b-45c0-889d-406af941370c",t._sentryDebugIdIdentifier="sentry-dbid-6fe88872-743b-45c0-889d-406af941370c")}catch{}})();const ie=j(function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}},function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{A({message:`OAuth error from provider ${a} with error ${n}`,level:"error",tags:{authProvider:a,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,a)=>{const l=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(Z({authCode:n,oauthProvider:a,appType:"web",redirectUri:y(l),sourceUri:y(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:a}=i;a!=null&&(s.saveMagicLinkEmail(n),t(R(n,a)))},clearSignInError:()=>{t(b())}}})(q),ae=T.memo(ie);function ve({setTenantEmailDomain:t}){const i=M(),d=z(),{clearAllLoading:g}=F(),n=s.getSignedInUser();u.useLayoutEffect(()=>{g()},[g]);const a=ee(),l=c(e=>e.tenantState.magicLinkCodeVerifier),{sendEmailMagicLinkFetchState:L,accountLocked:U,accountUnlockTime:h}=c(e=>e.tenantState),p=c(e=>e.tenantState.fetchState),k=c(e=>e.tenantState.activeTenantFetchState.fetchState),S=c(e=>e.tenantState.signInState),o=c(e=>e.tenantState.loggedInUser),r=c(e=>W(e)),I=c(e=>J(e)),m=D(),w=P().mode,C=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(u.useEffect(()=>{L.fetchState==="Completed"&&l!=null&&(E.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(l))},[L.fetchState,l]),u.useEffect(()=>{t(void 0)},[]),u.useEffect(()=>{S!=="In-Progress"||p!=="Completed"&&k!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(X(I.tenantsInOrder),o.zeniSessionId),Y(o.userId,o.zeniSessionId,r.tenantId),i(H(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(G("Completed")),_.updateAppLocaleID(ne(r)),te(o,r,w,void 0,I.tenantsInOrder),K().then(()=>{const e=$();e!=null&&B(e)}),setTimeout(()=>{E.trackLogin(N.Event.loginSuccess,o.authProvider??"google",Q(r.productSettings))},2e3))},[S,p,k,o,r,I,w,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return f.jsx(O,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!C,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),U===!0&&h!=null?f.jsx(V,{onClose:()=>i(b()),unlockDate:h}):null]})}export{ve as default};
@@ -0,0 +1,9 @@
1
+ import{j as s}from"./liveblocks-B5ZW-VBI.js";import{a as n}from"./sentry-BxWyF9h9.js";import{u as d,g,h as m,N as p}from"./core-Crl6eqZl.js";import{z as f,B as y,t as b,c,e as h}from"./index-CJknvk0s.js";import{gt as x,gu as I,Mg as w}from"./zeni-epic-state-DTyrT1Ga.js";import{n as j}from"./mui-U77PQnc2.js";import"./recharts-e5u-LCPv.js";import"./analytics-CkLW7NeW.js";import"./plaid-TCRHScH1.js";import"./dnd-tE28jHT7.js";import"./stripe-DMRn4zHo.js";import"./lottie-hSeCd_VX.js";import"./lexical-Bm_vZOjC.js";import"./pdf-DDcPh2pm.js";import"./utils-BjvWDnmB.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]="fb6a8240-11a0-4e86-a9e9-e6c63548b474",e._sentryDebugIdIdentifier="sentry-dbid-fb6a8240-11a0-4e86-a9e9-e6c63548b474")}catch{}})();function $(){const e=d(),t=g(),i=m(),a=n.useRef(!1),l=f.isSignedIn(),r=t.state?.message==="logout",o=r||l;return n.useEffect(()=>{o&&!a.current&&(a.current=!0,setTimeout(()=>{try{f.clearAll(),e(x()),e(I(!1)),w(),b.reset(),c.trackLogout(h.Event.logoutSuccess),c.resetUserIdentity()}catch(u){console.error("Error during sign out:",u)}finally{r||i("/signin/auth",{replace:!0})}},0))},[o,r]),o?s.jsx(v,{children:s.jsx(y,{fetchState:"In-Progress"})}):s.jsx(p,{to:"../",replace:!0})}const v=j.div`
2
+ display: flex;
3
+ height: 100vh;
4
+ width: 100%;
5
+ flex: 1 1 auto;
6
+ flex-direction: column;
7
+ align-items: center;
8
+ background-color: ${e=>e.theme.colors.grey4};
9
+ `;export{$ as default};
@@ -0,0 +1,9 @@
1
+ import{j as u}from"./liveblocks-B5ZW-VBI.js";import{a as b}from"./sentry-BxWyF9h9.js";import{h as U,u as _,g as v,j as G,i as z,n as M}from"./core-Crl6eqZl.js";import{z as R,W,Q as p,Z,V as J,c as O,e as Q,d9 as V,s as g,r as H}from"./index-CJknvk0s.js";import{eW as q,TI as F,J1 as C,TJ as x,TE as X,Ip as y,TK as Y,Ix as E,HT as aa,J2 as S,TL as B,fy as ea,IU as ta,IZ as sa,IM as oa,IK as w,I_ as na,IH as ia,TM as la,TN as ra,TO as ka,TP as ca,TQ as T,ei as da,TR as ua,TS as pa}from"./zeni-epic-state-DTyrT1Ga.js";import{n as Ta}from"./mui-U77PQnc2.js";import{u as ma}from"./useAskAiCfoHostNavButtonProps-BAtYgUWq.js";import{M as ga}from"./MobileAppDrawer-BIP1MEKX.js";import"./recharts-e5u-LCPv.js";import"./analytics-CkLW7NeW.js";import"./plaid-TCRHScH1.js";import"./dnd-tE28jHT7.js";import"./stripe-DMRn4zHo.js";import"./lottie-hSeCd_VX.js";import"./lexical-Bm_vZOjC.js";import"./pdf-DDcPh2pm.js";import"./utils-BjvWDnmB.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]="08208a1b-e6d0-46e7-a6e0-79baf2d55e21",e._sentryDebugIdIdentifier="sentry-dbid-08208a1b-e6d0-46e7-a6e0-79baf2d55e21")}catch{}})();const fa=Ta.div`
2
+ display: flex;
3
+ min-height: 100%;
4
+ width: 100%;
5
+ flex: 1 1 auto;
6
+ flex-direction: column;
7
+ align-items: center;
8
+ background-color: ${e=>e.theme.colors.grey4};
9
+ `,ha=M(function(e,t){const o=F(e,t.isTaskTemplatesEnabled),{taskGroupId:k}=t,n=k!=null&&k!==""?{...o,taskGroupsWithTasksList:o.taskGroupsWithTasksList.map(l=>({...l,tasks:l.tasks.filter(a=>a.taskGroupIds.includes(k))})).filter(l=>l.tasks.length>0)}:o,d=X(e),i=R.isZeniUser();return{taskListView:n,tagListView:d,localData:n.localData,isTaskTemplatesEnabled:t.isTaskTemplatesEnabled,isZeniUser:i}},function(e,t){const{navigate:o,currentTenant:k,location:n,isTaskTemplatesEnabled:d}=t,{tenantEmailDomain:i}=k,{groupByKey:l}=t.uiState;return{onTaskManagementRowClick:a=>{const s=L(i,a),c=g(n.state?.pathnameStackToGoBack,n.pathname);o(s,{state:{pathnameStackToGoBack:c}})},onReloadTasks:()=>{e(C(!0,d))},onTabChange:a=>{e(ca(a))},onParentTaskClick:a=>{const s=L(i,a);window.open(s,"_blank","noopener")},bulkUpdateTasks:(a,s)=>{e(w(a,null,s))},onNewTaskClick:()=>{if(t.localData.defaultTaskGroupId!=null){const a=I(i,t.localData.defaultTaskGroupId),s=g(n.state?.pathnameStackToGoBack,n.pathname);o(a,{state:{pathnameStackToGoBack:s,message:"comingFromTaskListPage"}})}},onColumnSortConfigChanged:(a,s)=>{e(B({uiState:{sortKey:a,sortOrder:s}}))},onFiltersChange:a=>{e(ka({filters:a}))},onSearchTextChanged:a=>{e(ra({searchText:a}))},onReloadCards:()=>{e(C(!0,d))},onBackClick:()=>{if(n.state?.message==="triggerBackClick"){const a=H(n.state?.pathnameStackToGoBack),s=a.poppedPathname??"../";o(s,{state:{pathnameStackToGoBack:a.newStack}})}else o("../")},updateLocalData:a=>{e(la({localData:a}))},resetLocalData:()=>{e(x({taskGroupById:t.taskGroupState.taskGroupById}))},handleCreateGroup:a=>{e(ia(t.localData.newTaskGroupName,a))},assignGroupToTasks:a=>{e(w(t.localData.selectedTaskIds,a,na(t.uiState.groupByKey,a)))},onDeleteTaskGroup:a=>{e(oa(a))},onAddNewTaskToTaskGroup:a=>{if(t.localData.defaultTaskGroupId!=null){const s=Da(l,a);e(y({taskDetailLocalData:s}));const c=I(i,t.uiState.groupByKey==="groupName"?a:t.localData.defaultTaskGroupId),f=g(n.state?.pathnameStackToGoBack,n.pathname);o(c,{state:{pathnameStackToGoBack:f,message:"comingFromTaskListPage"}})}},onDragNDrop:(a,s)=>{e(sa(t.localData.selectedTaskIds.length>0?t.localData.selectedTaskIds:[a],s))},onTaskGroupRename:(a,s)=>{e(ta(a,s))},onTimeSpentUpdate:(a,s)=>{e(S({task:a,updates:s}))},onShowToast:a=>{e(ea(a))},onGroupByFilterChange:a=>{e(B({uiState:{groupByKey:a}}))},updateTask:(a,s)=>{e(S({task:a,updates:s}))},onCreateTagClick:(a,s)=>{e(aa(a,s))},handleGroupTemplateClick:a=>{e(E(a,[]))},handleGroupTemplateTaskClick:(a,s)=>{e(E(a,[s]))},handleNewTaskInitialization:a=>{if(e(y({taskDetailLocalData:{...Y,name:a}})),t.localData.defaultTaskGroupId!=null){const s=I(i,t.localData.defaultTaskGroupId),c=g(n.state?.pathnameStackToGoBack,n.pathname);o(s,{state:{pathnameStackToGoBack:c,message:"comingFromTaskListPage"}})}},onTaskGroupNameClick:a=>{o(`/${i}/tasks/group/${a}`)},onQuickResponsesClick:()=>{o(`/${i}/tasks/quick-responses`)}}})(V);function ja(){const e=U(),t=_(),o=v(),k=R.getSignedInUser(),n=G(r=>q(r)),{taskGroupId:d}=z(),{useFeatureGate:i}=W(),{isFeatureEnabled:l}=i(p.isTaskTemplatesEnabled),{isFeatureEnabled:a}=i(p.isTaskCannedResponsesEnabled),{isFeatureEnabled:s}=i(p.isTaskCategorizationEnabled),{isFeatureEnabled:c}=i(p.isTaskBulkResolutionEnabled),{isFeatureEnabled:f}=i(p.isTaskGroupAssigneesEnabled),{isFeatureEnabled:A}=i(p.isTaskRecurringParentEnabled),[P,N]=b.useState(!1),h=G(r=>F(r,l)),D=G(r=>r.taskGroupState),m=h.fetchState,{isAiCfoAccessEnabled:$,onAskAiCfoClick:j}=ma({mobileExploreReferrer:"Task Checklist"});if(Z({isDataReady:m==="Completed"}),b.useEffect(()=>{t(C(!1,l))},[n?.tenantId,t,l]),b.useEffect(()=>{m==="Completed"&&t(x({taskGroupById:D.taskGroupById}))},[m,D.taskGroupById]),k==null)throw Error("Can't access task list page without signing in...");return u.jsxs(u.Fragment,{children:[m==="Completed"?u.jsx(J,{analytics:O,onLoad:r=>(K=>K.trackPageLoaded(Q.Event.taskListPage))(r)}):null,u.jsxs(fa,{children:[u.jsx(ga,{isAppContentDrawerOpen:P,handleDrawerToggle:r=>{N(r)}}),u.jsx(ha,{location:o,navigate:e,currentTenant:n,taskGroupId:d,taskGroupState:D,localData:h.localData,uiState:h.uiState,isTaskTemplatesEnabled:l,taskListFetchState:m,isTaskCategorizationEnabled:s,isTaskCannedResponsesEnabled:a,isTaskBulkResolutionEnabled:c,isTaskGroupAssigneesEnabled:f,isTaskRecurringParentEnabled:A,isAiCfoAccessEnabled:$,onAskAiCfoClick:j})]})]})}const L=(e,t)=>`/${e}/tasks/${encodeURIComponent(t)}`,I=(e,t)=>`/${e}/tasks/new/${t}`,Da=(e,t)=>{if(e==="assignee"){const o=t.split(",");return{...T.taskDetailLocalData,assignee:o}}if(e==="priority"){const o=da(t);return{...T.taskDetailLocalData,priority:o}}if(e==="status"){const o=ua(t);return{...T.taskDetailLocalData,status:o}}if(e==="tag"){const o=t.split(",");return{...T.taskDetailLocalData,tagIds:o}}if(e==="dueDate"){const o=pa(t);return{...T.taskDetailLocalData,dueDate:o}}return{...T.taskDetailLocalData}};export{ja as default};
@@ -0,0 +1,9 @@
1
+ import{j as n}from"./liveblocks-B5ZW-VBI.js";import se from"./NotFoundScreen-DY1Wwus4.js";import{a as c}from"./sentry-BxWyF9h9.js";import{h as H,u as O,j as g,g as ne,i as oe,N as ie,n as re,o as ce,p as f}from"./core-Crl6eqZl.js";import{I4 as W,I7 as le,I1 as de,eW as Z,TE as M,Il as K,H_ as pe,IR as ue,IK as ke,TF as J,TG as q,HW as me,HT as fe,rC as ge,rq as he,l5 as Ie,If as Se,TH as Te,Iw as be,It as Ee,Ia as Ce,Iq as Ge,Ip as De}from"./zeni-epic-state-DTyrT1Ga.js";import{z as G,d7 as xe,$ as ye,W as je,Q as b,r as Q,s as v,V as we,c as z,e as ve,d8 as Re,f as V,at as Fe}from"./index-CJknvk0s.js";import{n as Be}from"./mui-U77PQnc2.js";import{u as Pe}from"./useInitialThreadRequest-DZr1J4rc.js";import{M as Ue}from"./MobileAppDrawer-BIP1MEKX.js";import Le from"./TaskListScreen-CnT3FhwB.js";import"./recharts-e5u-LCPv.js";import"./analytics-CkLW7NeW.js";import"./plaid-TCRHScH1.js";import"./dnd-tE28jHT7.js";import"./stripe-DMRn4zHo.js";import"./lottie-hSeCd_VX.js";import"./lexical-Bm_vZOjC.js";import"./pdf-DDcPh2pm.js";import"./utils-BjvWDnmB.js";import"./useAskAiCfoHostNavButtonProps-BAtYgUWq.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]="0dcdf235-bb8e-477a-8b14-f9258ebfa38a",e._sentryDebugIdIdentifier="sentry-dbid-0dcdf235-bb8e-477a-8b14-f9258ebfa38a")}catch{}})();function $e(){const e=H(),t=O(),s=G.getSignedInUser(),{cannedResponses:u,fetchState:r,saveFetchState:d}=g(o=>o.cannedResponsesState),l=c.useCallback(()=>{t(W())},[t]),k=c.useCallback((o,h,I)=>{t(le({name:o,content:h,cannedResponseId:I}))},[t]),a=c.useCallback(o=>{t(de({cannedResponseId:o}))},[t]);if(s==null)throw Error("Can't access quick responses page without signing in...");return n.jsx(xe,{cannedResponses:u,isLoading:r==="In-Progress"||r==="Not-Started",isSaving:d==="In-Progress",onBackClick:()=>e(-1),onDelete:a,onFetch:l,onSave:k})}let A,_=[];const Ne=re(function(e,t){const{location:s,taskGroupId:u}=t,r=J(e,t.taskId),d=Z(e),l=r.taskGroupId??u,k=l!=null?q(e.taskGroupState,l):void 0,a=G.getSignedInUser(),o=d.tenantId,h={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:o??""},I=M(e),{tenantEmailDomain:D}=d,E=r.recurringSourceTaskId,x=E!=null?`${V.appUrl}/${D}/tasks/${encodeURIComponent(E)}`:void 0;var S;return{taskDetailSelectorView:r,authParams:h,isZeniUser:G.isZeniUser(),userGroupList:((S=e.userGroupsState.userGroupByUserGroupId)!==A&&(A=S,_=Object.values(S)),_),isNewClicked:s.state?.message==="comingFromTaskListPage",filesEndPoint:Fe.fileMicroServiceBaseUrl,companyName:t.currentTenant.companyName,companyId:t.currentTenant.companyId,currentUrl:`${V.appUrl}${t.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:x,tagListView:I,taskGroupName:l!=null&&k!=null&&k.isDefault===!1?k.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map(p=>q(e.taskGroupState,p)).filter(p=>p!=null&&!p.isDeleted).map(p=>({id:p.id,name:p.name,isDefault:p.isDefault}))}},function(e,t){const{taskId:s,navigate:u,currentTenant:r,location:d,taskGroupId:l}=t,{tenantEmailDomain:k}=r;return{onSaveChangesToLocalStore:a=>{e(De({taskDetailLocalData:a,taskId:s}))},onSaveDetailClick:a=>{e(Ge(s,a??l))},onArchiveTaskClick:()=>{t.taskId!=null&&e(Ce(t.taskId))},onSnoozeTask:(a,o)=>{e(Ee(a,o))},onUnsnoozeTask:a=>{e(be(a))},onDismissClick:()=>{if(d.state?.message==="triggerBackClick"){const a=Q(d.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";u(o,{state:{pathnameStackToGoBack:a.newStack}})}else{const a=R(k),o=v(d.state?.pathnameStackToGoBack,d.pathname);u(a,{state:{pathnameStackToGoBack:o}})}e(Te({taskId:s}))},onDeleteTaskClick:()=>{e(Se(s))},updateFilesEntity:a=>{e(Ie({files:a}))},onDeleteFile:a=>{e(he(a))},onEditFileName:(a,o)=>{e(ge(a,o.split(".")[0]))},onReloadTaskDetailPage:()=>{e(K(!1,s))},onCreateTagClick:a=>{e(fe(a,s))},onDeleteTagClick:a=>{e(me(a,s))},onFetchCannedResponses:()=>{e(W())},onManageTemplatesClick:()=>{u(`/${r.tenantEmailDomain}/tasks/quick-responses`)}}})(Re);function w(){const e=H(),t=O(),s=ne(),u=ye(),{taskId:r,taskGroupId:d}=oe(),l=g(i=>Z(i)),k=Pe(l?.companyId),{useFeatureGate:a}=je(),{isFeatureEnabled:o}=a(b.isTaskSnoozeEnabled),{isFeatureEnabled:h}=a(b.isTaskVisibilityEnabled),{isFeatureEnabled:I}=a(b.isTaskCannedResponsesEnabled),{isFeatureEnabled:D}=a(b.isTaskRecurringParentEnabled),{isFeatureEnabled:E}=a(b.isTaskGroupAssigneesEnabled),[x,S]=c.useState(!1),[p,X]=c.useState(!1),[F,Y]=c.useState(!1),[B,ee]=c.useState(!1),[P,y]=c.useState(!1),T=c.useRef(!1),C=g(i=>i.taskListState.updateTasksFetchState.fetchState),U=g(i=>M(i)),L=g(i=>i.taskGroupViewState.fetchState);c.useEffect(()=>{p||(X(!0),t(K(!1,r)))},[p,t]),c.useEffect(()=>{F||U.fetchState==="Completed"||(Y(!0),t(pe()))},[F,t,U.fetchState]),c.useEffect(()=>{B||L==="Completed"||(ee(!0),t(ue()))},[B,t,L]);const ae=c.useCallback(()=>{r!=null&&(T.current=!1,t(ke([r],null,{isArchived:!1})),y(!0))},[t,r]);c.useEffect(()=>{if(P)if(C!=="In-Progress"){if(T.current){if(C==="Error")return y(!1),void(T.current=!1);if(C==="Completed"){y(!1),T.current=!1;const{tenantEmailDomain:i}=l;if(s.state?.message==="triggerBackClick"){const m=Q(s.state?.pathnameStackToGoBack);e(m.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:m.newStack}})}else{const m=R(i);e(m,{state:{pathnameStackToGoBack:v(s.state?.pathnameStackToGoBack,s.pathname)}})}}}}else T.current=!0},[P,C,l,s,e]);const $=g(i=>J(i,r)),j=$.fetchState,N=G.getSignedInUser();if(N==null)throw Error("Can't access task detail page without signing in...");if(j==="Error"&&$.error?.code===400){const{tenantEmailDomain:i}=l,m=R(i),te=v(s.state?.pathnameStackToGoBack,s.pathname);return n.jsx(ie,{to:m,state:{pathnameStackToGoBack:te}})}return n.jsxs(n.Fragment,{children:[j==="Completed"?n.jsx(we,{analytics:z,onLoad:i=>(m=>m.trackPageLoaded(ve.Event.taskDetailPage))(i)}):null,n.jsxs(qe,{children:[n.jsx(Ue,{isAppContentDrawerOpen:x,handleDrawerToggle:i=>{S(i)}}),n.jsx(Ne,{analytics:z,currentTenant:l,handleZeniLogoClick:()=>{u.toggle()},initialOpenThreadRequest:k,location:s,loggedInUser:N,navigate:e,taskGroupId:d,taskId:r,taskDetailFetchState:j,onUnarchiveTaskClick:ae,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:h,isTaskCannedResponsesEnabled:I,isTaskRecurringParentEnabled:D,isTaskGroupAssigneesEnabled:E})]})]})}const qe=Be.div`
2
+ display: flex;
3
+ min-height: 100%;
4
+ width: 100%;
5
+ flex: 1 1 auto;
6
+ flex-direction: column;
7
+ align-items: center;
8
+ background-color: ${e=>e.theme.colors.grey4};
9
+ `,R=e=>`/${e}/tasks`;function ia(){return n.jsxs(ce,{children:[n.jsx(f,{path:"/new",element:n.jsx(w,{})}),n.jsx(f,{path:"/new/:taskGroupId",element:n.jsx(w,{})}),n.jsx(f,{path:"/group/:taskGroupId",element:n.jsx(Le,{})}),n.jsx(f,{path:"/quick-responses",element:n.jsx($e,{})}),n.jsx(f,{path:"/:taskId",element:n.jsx(w,{})}),n.jsx(f,{path:"*",element:n.jsx(se,{})})]})}export{ia as default};
@@ -0,0 +1 @@
1
+ import{j as t}from"./liveblocks-B5ZW-VBI.js";import i from"./NotFoundScreen-DY1Wwus4.js";import{T as r}from"./TransactionDetailScreen-Ch_kEoMB.js";import"./sentry-BxWyF9h9.js";import{o as s,p as o}from"./core-Crl6eqZl.js";import"./zeni-epic-state-DTyrT1Ga.js";import"./recharts-e5u-LCPv.js";import"./index-CJknvk0s.js";import"./mui-U77PQnc2.js";import"./analytics-CkLW7NeW.js";import"./plaid-TCRHScH1.js";import"./dnd-tE28jHT7.js";import"./stripe-DMRn4zHo.js";import"./lottie-hSeCd_VX.js";import"./lexical-Bm_vZOjC.js";import"./pdf-DDcPh2pm.js";import"./utils-BjvWDnmB.js";import"./useAskAiCfoHostNavButtonProps-BAtYgUWq.js";import"./decodeURIComponentSafe-DwYiSzjo.js";import"./routePaths-jWP9zfXs.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="a4852925-22e4-4d6c-b9c0-7fe8ce24ec96",e._sentryDebugIdIdentifier="sentry-dbid-a4852925-22e4-4d6c-b9c0-7fe8ce24ec96")}catch{}})();function k(){return t.jsxs(s,{children:[t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId",element:t.jsx(r,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:t.jsx(i,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:t.jsx(r,{})}),t.jsx(o,{path:"/*",element:t.jsx(r,{})})]})}export{k as default};
@@ -0,0 +1,5 @@
1
+ import{j as U}from"./liveblocks-B5ZW-VBI.js";import{a as i}from"./sentry-BxWyF9h9.js";import{u as W,k as Ke,j as S,s as fe,g as ge,h as Te,i as be,N as Qe,n as Ze}from"./core-Crl6eqZl.js";import{nO as he,eW as Q,gp as Xe,Oe as et,m$ as tt,mJ as at,bn as nt,cT as Ee,bs as Ie,ra as q,Nd as H,Of as ve,Og as oe,ND as De,kI as Ce,Oh as ke,NI as se,NJ as ce,lx as Ae,K8 as ie,N7 as M,kC as Oe,kA as xe,kM as ot,nB as st,Oi as ct,Oj as it,vn as K,kH as Ue,Jt as we,cY as rt,cZ as lt,Ok as dt,N6 as ut,Ol as mt,vj as pt,Om as ft,On as ht,Oo as yt,Op as St,Oq as gt,kL as Tt,Or as bt,Os as Et,N8 as It,Ot as vt,Ou as Dt,Ov as Ct,Jn as kt,Jd as At,JC as Ot,kN as xt,K9 as ye,nG as Ut}from"./zeni-epic-state-DTyrT1Ga.js";import{W as J,Q as w,z as _e,aQ as Pe,m as wt,j as _t,aR as Pt,x as Ft,r as ae,I as Vt,aS as Bt,s as ne,Z as Nt,aT as Rt,c as Fe,aU as Lt,at as zt,a2 as te}from"./index-CJknvk0s.js";import{n as Gt,S as jt,D as $t}from"./mui-U77PQnc2.js";import{u as Mt}from"./useAskAiCfoHostNavButtonProps-BAtYgUWq.js";import{d as Ve}from"./decodeURIComponentSafe-DwYiSzjo.js";import{h as Be,c as Ne,g as Wt,e as qt}from"./routePaths-jWP9zfXs.js";import{u as Ht}from"./utils-BjvWDnmB.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]="f027c5c3-4d41-48b2-bca4-1c3215a94cdc",t._sentryDebugIdIdentifier="sentry-dbid-f027c5c3-4d41-48b2-bca4-1c3215a94cdc")}catch{}})();function Jt(t=!0){const e=W(),s=Ke(),{useFeatureGate:a}=J(),{isFeatureEnabled:n}=a(w.isCreateTransferEntryFromExpenseEnabled);i.useEffect(()=>{if(!t||n!==!0)return;const o=c=>{const r=s.getState().createTransferEntryState.transferAccountsByType[c].fetchState;return r!=="In-Progress"&&r!=="Completed"};o("transferEntryEligible")&&e(he({kind:"transferEntryEligible"})),o("creditCardOnlyEligible")&&e(he({kind:"creditCardOnlyEligible"}))},[t,n,e,s])}function Yt(t,e){const s=function(){const r=W(),[p,g]=i.useState(!1),[A,y]=i.useState(null),[m,O]=i.useState(null),{useDynamicConfig:T}=J(),{configValue:f,isDynamicConfigLoading:C}=T("transaction_categorization_config"),v=!C&&f?.capitalization_enabled===!0,k=S(h=>Q(h)),b=k.companyId,x=S(h=>Xe(h.companyState,k.companyId)?.company.companyLocaleInfo?.currencySymbol??"$"),{capitalizableAccounts:_,capitalizableAccountOverrides:B,dismissedAccounts:z}=S(h=>{const E=h.tenantState.currentTenantId,u=E!=null?h.tenantState.tenantsById[E]:void 0;return{capitalizableAccounts:u?.capitalizableAccounts??null,capitalizableAccountOverrides:u?.capitalizableAccountOverrides??null,dismissedAccounts:u?.capitalizationOnboardingDismissedAccounts??null}},fe),G=i.useRef(_);G.current=_;const N=i.useRef(B);N.current=B;const P=i.useRef(z);P.current=z;const R=S(h=>et(h.accountState),fe),I=i.useMemo(()=>{const h={};for(const E of R)E.accountId!=null&&E.accountName!=null&&(h[E.accountId]=E.accountName);return h},[R]),l=m!=null?I[m]??null:null,j=i.useCallback(h=>{if(!v)return;const E=G.current;if(E==null)return;const u=E.accounts??[],$=new Set(h),Z=N.current??{},Y=P.current;for(const L of u)if($.has(L.accountId)&&Z[L.accountId]==null&&Y?.[L.accountId]==null)return y(L.classificationType),O(L.accountId),void g(!0)},[v]),D=i.useCallback((h,E)=>{r(tt(b,h,E,!0)),g(!1),y(null),O(null)},[r,b]),F=i.useCallback(()=>{m!=null&&(r(at(b,m)),g(!1),y(null),O(null))},[r,b,m]);return{showPopup:p&&v,popupType:A,popupAccountId:m,popupAccountName:l,currencySymbol:x,checkAndShowPopup:j,handleSubmit:D,handleDismiss:F}}(),a=i.useRef(void 0),n=i.useRef([]),o=i.useRef(s.checkAndShowPopup);o.current=s.checkAndShowPopup;const c=i.useRef(e);return c.current=e,i.useEffect(()=>{t==="In-Progress"&&(n.current=c.current()),t==="Completed"&&a.current==="In-Progress"&&n.current.length>0&&(o.current(n.current),n.current=[]),a.current=t},[t]),s}const re=()=>{const t=_e.getSignedInUser(),{useFeatureGate:e}=J(),{isFeatureEnabled:s}=e(w.isChainOfThoughtEnabled);return i.useMemo(()=>nt(t)&&s,[t,s])};function Re(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 ha(t,e){const s=W(),{useFeatureGate:a,useDynamicConfig:n}=J(),o=S(u=>Q(u)),c=o.userRole.includes("charge_card_user")||o.userRole.includes("charge_card_admin"),r=o.userRole!=null&&Ee(o.userRole),p=o.userRole!=null&&Ie(o.userRole),{isFeatureEnabled:g}=a(w.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:A}=a(w.isExpenseAutomationEnabled),{configValue:y}=n(Pe.enableUncategorizedExpenseCategory),m=y?.uncategorized_expense_category_enabled===!0,O=re(),T=i.useMemo(()=>({id:t,type:q(e)}),[t,e]),f=S(u=>H(u,T)),C=f?.transactionDetailUpdateStatus?.fetchState,v=f?.transactionDetailLocalData?.lineItemById,k=S(u=>{const $=H(u,T)?.transactionDetailLocalData.vendorUpdates?.id;return $==null?"Not-Started":u.transactionVendorViewState.editVendorStateById[$]?.saveStatus.fetchState??"Not-Started"}),b=i.useMemo(()=>f?.fetchState==="Completed"?Re(f?.transaction):void 0,[f?.fetchState,f?.transaction]),x=S(u=>{if(b!=null)return ve(u.customerIncomeState,u.vendorExpenseState,u.trendState,b,"month")}),_=S(u=>oe(u)),B=S(u=>{if(b!=null)return De(u.trendWithTransactionsState,b,"TransactionDetail")}),z=o.company?.companyInfo.firstMonthOfFY??1,G=S(u=>Ce(u.accountState,u.accountListState,"accountList")),[N,P]=i.useState(!1),[R,I]=i.useState(!1),[l,j]=i.useState(!1);i.useEffect(()=>{P(!1),I(!1),j(!1)},[t,e]);const D=i.useCallback(()=>{P(!1),I(!1)},[]),[F,h]=i.useState(!1),E=B?.selectedPeriod?.timePeriod;return i.useEffect(()=>{l||f==null||f.transaction==null||(s(ke({id:f.transaction.id,type:f.transaction.type})),j(!0)),b!=null&&(!c||r&&p===!1)&&(N?R||x==null||(I(!0),s(ie(b,"TransactionDetail",{timeframe:"month",timePeriod:E??x}))):(s(se()),s(ce()),P(!0),s(Ae(b))))},[s,l,f?.fetchState,f?.transaction,b,c,r,p,N,R,x,E]),i.useEffect(()=>{_.newVendorState?.vendorDetailLocalData?.vendorName!=null?h(!0):h(!1)},[_.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect(()=>()=>{s(M("common"))},[s]),{currentTenant:o,loggedInUserHasCardUserOrAdminRole:c,isUserHasDashboardAccess:r,isUserHasInvestorOrBankerAccess:p,isVendorBulkUpdateOnTransactionEnabled:g,isExpenseAutomationEnabled:A,isUncategorizedExpenseCategoryEnabled:m,isChainOfThoughtEnabled:O,selectedTransaction:T,transactionDetail:f,rawDetailSaveStatus:C,rawDetailLineItemById:v,vendorSaveStatus:k,tranEntity:b,defaultTrendTransactionTimePeriod:x,vendorViewDetails:_,uiState:B,firstMonthOfFY:z,uncategorizedAccounts:G,resetTrendIsFetchedStates:D,isCreateVendorDrawerOpen:F,setIsCreateVendorDrawerOpen:h}}const Kt={overlayWidth:new Ft(100,100,58)},Qt=({isOpen:t,onSaveVendor:e,onSaveSuccess:s,onCancel:a,vendorViewDetails:n})=>{const o=wt(),c=_t(),r=W(),p=S(y=>oe(y)),g=()=>{a()},A={vendorDetailView:n??p,onSaveSuccess:()=>{r(xe()),r(ot("Not-Started")),s()},onSaveVendor:e,onCancelClick:g,saveVendorDetailLocalData:y=>{r(Oe({vendorId:void 0,localData:y}))}};return U.jsx($t,{anchor:"right",open:t,PaperProps:{style:{width:Kt.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.4,cursor:"pointer"}}},onClose:g,children:U.jsx(Zt,{onClick:y=>y.stopPropagation(),children:U.jsx(Pt,{...A})})})},Zt=Gt(jt)`
2
+ display: flex;
3
+ min-height: 100%;
4
+ flex-direction: column;
5
+ `;function Xt(t,e){t(st({transactionId:e.transactionId,creditAccountIntegrationId:e.creditAccountIntegrationId,debitAccountIntegrationId:e.debitAccountIntegrationId,memo:e.memo,transactionType:q(e.transactionType),sourceTransactionType:q(e.sourceTransactionType)}))}function ea({currentTransactionId:t,enabled:e=!0,buildPath:s,beforeNavigate:a,navigate:n,navigateState:o}){const c=S(p=>p.createTransferEntryState.lastTransferEntryReplacement),r=i.useRef(null);i.useEffect(()=>{if(!e||c==null||t==null||r.current===c)return;const{previousTransactionId:p,newTransactionId:g}=c;t.id===p.id&&t.type===p.type&&(r.current=c,a?.(),n(s(g),{replace:!0,state:o}))},[e,c,t,s,a,n,o])}const ta=({closeDrawerHandler:t,overrideTransactionId:e,overrideTransactionType:s})=>{const a=ge(),n=Te(),o=W(),c=re(),{transactionTypeEncoded:r,transactionId:p}=be(),g=e??p,A=s??Ve(r??"");let y;Be(g,A)&&(y={id:g,type:q(A)});const m=y!=null?S(T=>H(T,y)):void 0,O=()=>{const T=ae(a.state?.pathnameStackToGoBack),f=T.poppedPathname??((C=2)=>{let v="../";for(let k=0;k<C;k++)v=`${v}../`;return v})(1);n(f,{state:{pathnameStackToGoBack:T.newStack}})};return{transactionId:y,onSaveVendor:()=>{o(Ue(y,void 0))},onSaveSuccess:()=>{if(m!=null&&m?.transaction&&m?.transactionDetailLocalData.vendorUpdates?.qboId!=null&&m?.transactionDetailLocalData.vendorUpdates?.id!=null){const T=m?.transactionDetailLocalData.vendorUpdates,f={id:m?.transactionDetailLocalData.vendorUpdates?.qboId,zeniId:m?.transactionDetailLocalData.vendorUpdates?.id,type:"vendor",name:T?.name,qboId:m?.transactionDetailLocalData.vendorUpdates?.qboId??""},C={transactionId:{id:m?.transaction?.id,type:m?.transaction?.type},transaction:m?.transaction,lineIds:m?.transaction?.lines?.map(v=>v.id)??[]};o(K({entity:f,amount:m?.transaction?.amount.amount,transactionDetails:C,flowType:"detail",isFetchCOT:c}))}O()},onCancel:()=>{y!=null&&o(ct({transactionId:y})),o(xe()),o(it()),t(!0),O()}}},aa=Ze(function(t,e){const s=H(t,e.selectedTransaction);let a;s==null&&console.warn("Check if the you've selected the transaction before getting the details");const n=_e.getSignedInUser(),o=t.tenantState.currentTenantId,c={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:o??""};s!=null&&s.fetchState==="Completed"&&s.transaction!=null&&e.entity!=null&&(a=dt(t,e.entity,"TransactionDetail"));const r=t.entityAutoCompleteState.autoCompleteText.common,p=ut(t,"common"),g=Q(t);return{transactionDetail:s,transactionAttachmentEndpointToDownload:`${te}/transaction_attachment`,transactionAttachmentsEndpointToFetch:g.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${te}/transaction_attachments_accounting_provider`:`${te}/transaction_attachments`,attachmentUploadEndpoint:`${zt.accountMicroServiceBaseUrl}`,isCOTEnabled:e.isCOTEnabled,authParams:c,trendReport:a,analytics:Fe,uncategorizedAccounts:e.uncategorizedAccounts,autoCompleteData:{autoCompleteText:r,entityAutoCompleteView:p},isVendorBulkUpdateOnTransactionEnabled:e.isVendorBulkUpdateOnTransactionEnabled,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled,enableBackClickOnSave:e.location.state?.message?.startsWith("comingFromScheduleDetails")}},function(t,e){const{isCOTEnabled:s}=e;return{onBackClick:()=>{if(t(M("common")),e.onBackClick!=null)return void e.onBackClick();const a=ae(e.location.state?.pathnameStackToGoBack),n=a.poppedPathname??Le(2);e.navigate(n,{state:{pathnameStackToGoBack:a.newStack,message:"comingFromTransactionDetail"}})},discardTransactionDetailLocalData:(a,n)=>{e.transaction!=null&&t(Ut({transactionId:{id:e.transaction.id,type:e.transaction.type},vendorId:a,customerId:n}))},onTransactionClick:a=>{e.resetTrendIsFetchedStates(),t(se()),t(ce());const n=ne(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(Ne(a,e.tenantEmailDomain),{state:{pathnameStackToGoBack:n}})},onTrendSelectedPeriodChange:a=>{if(a==null)e.defaultTrendTransactionTimePeriod!=null&&t(ye(e.entity,"TransactionDetail",{timeframe:"month",timePeriod:e.defaultTrendTransactionTimePeriod}));else{const n=a.currentTimePeriod==null?a.addTimePeriod:{startDate:a.addTimePeriod.startDate,endDate:a.currentTimePeriod.endDate};t(ie(e.entity,"TransactionDetail",{timeframe:a.timeframe,timePeriod:a.addTimePeriod})),t(ye(e.entity,"TransactionDetail",{timeframe:a.timeframe,timePeriod:n}))}},onSaveUpdates:(a,n,o,c)=>{t(c===!0&&o!=null?Ue(a,o,!0,e.isExpenseAutomationEnabled,e.isUncategorizedExpenseCategoryEnabled):xt({transactionId:a,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,cotTransactionTracking:n,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled})),t(M("common"))},onUploadAttachmentAttachment:a=>{t(Ot(a))},onDeleteAttachment:a=>{e.transaction!=null&&t(At(a,{id:e.transaction.id,type:e.transaction.type}))},onSaveTransactionDetailLocalData:(a,n)=>{t(kt({transactionId:a,transactionLocalData:n}))},onUpdateAllChecked:(a,n,o,c)=>{e.transaction!=null&&t(Ct(e.selectedTransaction,e.transaction,a,n,o,c))},onResetLineItemsCategoryClassInLocalData:(a,n,o,c,r,p)=>{t(Dt(a,n,o,c,r,p))},onChangeCategoryClassWhenUpdateAllIsChecked:(a,n)=>{e.transaction!=null&&t(vt({id:e.transaction.id,type:e.transaction.type},e.transaction,a,n))},onSaveSuccess:()=>{const a=ae(e.location.state?.pathnameStackToGoBack);if(a.poppedPathname!=null){const n=Ht(a.poppedPathname,"/").split("/"),o=n[n.length-1];if(["uncategorized-income","uncategorized-expense","missing-receipts"].includes(o)&&e.navigate(a.poppedPathname,{state:{pathnameStackToGoBack:a.newStack}}),e.location.state?.message==="comingFromScheduleDetails"){const c=`${Wt(e.tenantEmailDomain)}`;e.navigate(c)}else if(e.location.state?.message==="comingFromScheduleDetailsFixedAssets"){const c=`${qt(e.tenantEmailDomain)}`;e.navigate(c)}}},onPageRefresh:()=>{t(we(e.selectedTransaction,!0))},autoCompleteActions:{onAutoCompleteInputChange:(a,n)=>{a.trim().length>=2?t(It({searchString:a,entityType:n,searchOrigin:"common"})):a.trim().length===0&&t(M("common"))},onCancelAutoComplete:()=>{t(M("common"))}},onFetchRecommendationsForEntity:(a,n,o,c)=>{t(K({entity:a,amount:n,transactionDetails:o,flowType:"detail",isFetchCOT:s}))},clearRecommendationForLineId:a=>{const{transactionId:n,transaction:o,lineId:c}=a;t(Et(n,o,c))},resetUpdateErrorState:()=>{const a={id:e.selectedTransaction.id,type:e.selectedTransaction.type};t(bt(a))},onSaveVendorInLocalData:(a,n,o,c,r)=>{if(t(Tt({transactionId:a,vendorUpdates:n,entity:o})),n.id!=null&&o!=null&&c!=null&&r!=null&&t(K({entity:o,amount:c,transactionDetails:r,flowType:"detail",isFetchCOT:s})),t(Oe({vendorId:n.id?n.id:void 0,localData:{vendorName:n.name,vendorId:n.id?n.id:void 0}})),!n.id&&e.transaction!=null){const p=e.transaction,g=ne(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(`/${e.tenantEmailDomain}/transaction/${encodeURIComponent(p.type??"")}/${p.id}/vendor/create`,{state:{pathnameStackToGoBack:g}})}},onSaveCustomerInLocalData:(a,n,o,c,r)=>{t(gt({transactionId:a,customerUpdates:n,entity:o})),n.id!=null&&o!=null&&c!=null&&r!=null&&t(K({entity:o,amount:c,transactionDetails:r,flowType:"detail",isFetchCOT:s}))},onUpdateAllTranactionsWithCurrentVendorChecked:a=>{t(St({transactionId:{id:e.selectedTransaction.id,type:e.selectedTransaction.type},isUpdateEnabled:a}))},onClickUpdateVendorToAllLineItems:(a,n,o)=>{t(yt(a,n,o))},onResetVendorToAllLineItems:(a,n,o)=>{t(ht(a,n,o))},saveLatestSelectedEntity:(a,n,o)=>{t(ft({transactionId:a,lineId:n,entity:o}))},updateVendorBulkRecommendationsFetchStatus:(a,n)=>{t(pt(a,n))},setIsVendorUpdateAllChecked:(a,n,o)=>{t(mt(a,n,o))},onCreateTransferEntry:e.isCreateTransferEntryFromExpenseEnabled===!0?a=>Xt(t,a):void 0}})(Lt);function ya(){const t=Te(),e=W(),s=ge(),{useFeatureGate:a,useDynamicConfig:n}=J(),o=Vt(),c=S(d=>Q(d)),r=c.userRole.includes("charge_card_user")||c.userRole.includes("charge_card_admin"),p=c.userRole!=null&&Ee(c.userRole),g=c.userRole!=null&&Ie(c.userRole),{isFeatureEnabled:A}=a(w.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:y}=a(w.isExpenseAutomationEnabled),{configValue:m}=n(Pe.enableUncategorizedExpenseCategory),O=m?.uncategorized_expense_category_enabled===!0,{tenantEmailDomain:T,transactionTypeEncoded:f,transactionId:C}=be(),[v,k]=i.useState(!1),b=Ve(f??""),x=Be(C,b),_=S(d=>d.transactionVendorViewState),B=re(),{isFeatureEnabled:z}=a(w.isTransactionCommentingEnabled),{isFeatureEnabled:G}=a(w.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:N}=a(w.isProjectsTransactionsEnabled),P=o?.currentTenant?.companyId,R=o?.currentTenant?.companyName,I=i.useMemo(()=>{if(x)return{id:C,type:q(b)}},[x,C,b]),l=I!=null?S(d=>H(d,I)):void 0,j=l?.transactionDetailLocalData.vendorUpdates?.id!=null?_.editVendorStateById[l?.transactionDetailLocalData.vendorUpdates.id]?.saveStatus.fetchState:"Not-Started",D=l?.fetchState==="Completed"?Re(l?.transaction):void 0,F=S(d=>D!=null?ve(d.customerIncomeState,d.vendorExpenseState,d.trendState,D,"month"):void 0),h=S(d=>oe(d)),E=S(d=>D!=null?De(d.trendWithTransactionsState,D,"TransactionDetail"):void 0),u=c.company?.companyInfo.firstMonthOfFY??1,$=S(d=>Ce(d.accountState,d.accountListState,"accountList")),[Z,Y]=i.useState(!1),[L,le]=i.useState(!1),[ze,de]=i.useState(!1),Ge=i.useCallback(d=>Ne(d,T??"")+s.search,[T,s.search]),je=i.useCallback(()=>{de(!1)},[]);ea({currentTransactionId:I,enabled:T!=null&&T!=="",buildPath:Ge,beforeNavigate:je,navigate:t,navigateState:s.state});const ue=()=>{Y(!1),le(!1)},me=Bt();Jt();const X=i.useRef(l?.transaction);X.current=l?.transaction;const $e=l?.transactionDetailUpdateStatus?.fetchState,V=Yt($e,()=>{const d=[];if(X.current!=null)for(const ee of X.current.lines??[])"account"in ee&&ee.account?.accountId!=null&&d.push(ee.account.accountId);return d});i.useEffect(()=>{I!=null&&l!=null&&l.fetchState==="Not-Started"&&(e(we(I,!1)),ue())},[e,I,l?.fetchState]),i.useEffect(()=>{if(I!=null&&l?.fetchState==="Error"){const d=ne(s.state?.pathnameStackToGoBack,s.pathname);t("page-not-found",{replace:!0,state:me?{pathnameStackToGoBack:d,message:"expenseAutomation",origin:"transaction_categorization"}:{pathnameStackToGoBack:d,message:"pageNotFound",origin:"transaction_detail"}})}},[I,l?.fetchState,t,s.state,s.pathname,me]),i.useEffect(()=>{ze||l==null||l.transaction==null||(e(ke({id:l.transaction.id,type:l.transaction.type})),de(!0)),D==null&&l?.fetchState==="Completed"&&Se(l?.transaction),D!=null&&(!r||p&&g===!1)&&(Z?L||F==null||(le(!0),e(ie(D,"TransactionDetail",{timeframe:"month",timePeriod:E?.selectedPeriod?.timePeriod??F}))):(e(se()),e(ce()),Se(l?.transaction),Y(!0),e(Ae(D))))},[l?.fetchState,l?.transaction,F,r]),i.useEffect(()=>{h.newVendorState?.vendorDetailLocalData?.vendorName!=null?k(!0):k(!1)},[h.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect(()=>()=>{e(M("common"))},[]);const Me=[f,C].filter(d=>d!=null),{transactionId:pe,onSaveVendor:We,onSaveSuccess:qe,onCancel:He}=ta({closeDrawerHandler:d=>{k(!1),t(d?"../":"../..")}}),{isAiCfoAccessEnabled:Je,onAskAiCfoClick:Ye}=Mt({mobileExploreReferrer:"Transaction Details"});return Nt({isDataReady:l?.fetchState==="Completed"}),x?U.jsxs(U.Fragment,{children:[pe!=null&&v&&U.jsx(Qt,{isOpen:v,transactionId:pe,onSaveVendor:We,onSaveSuccess:qe,onCancel:He}),U.jsx(aa,{hideDeleteAttachment:!0,firstMonthOfFY:u,isDisabled:l?.transaction?.type==="transfer"&&o?.connectionName==="netsuite"?"readonly":void 0,tenantEmailDomain:T,location:s,navigate:t,selectedTransaction:I,entity:D,isCOTEnabled:B,defaultTrendTransactionTimePeriod:F,resetTrendIsFetchedStates:ue,transaction:l?.transaction,uncategorizedAccounts:$,vendorSaveStatus:j,isVendorBulkUpdateOnTransactionEnabled:A,isCreateTransferEntryFromExpenseEnabled:G,isExpenseAutomationEnabled:y,isUncategorizedExpenseCategoryEnabled:O,isAiCfoAccessEnabled:Je,onAskAiCfoClick:Ye,isTransactionCommentingEnabled:z,isProjectsTransactionsEnabled:N,companyId:P,companyName:R}),V.showPopup&&V.popupType!=null&&U.jsx(Rt,{popupType:V.popupType,currencySymbol:V.currencySymbol,accountId:V.popupAccountId??"",accountName:V.popupAccountName??"",onSubmit:V.handleSubmit,onDismiss:V.handleDismiss})]}):U.jsx(Qe,{to:Le(Me.length)})}const Le=(t=2)=>{let e="../";for(let s=0;s<t;s++)e=`${e}../`;return e},Se=t=>{if(t!=null){const{transactionCategory:e,transactionClass:s}=na(t),a=oa(t);Fe.trackTransactionDetails(t.account?.accountId,t.account?.accountName,t.id,a,e.length>0?e:void 0,s.length>0?s:void 0,t.type,t.amount,t.memo,t.lines?.length??0,t.attachments?.map(n=>n.fileName))}},na=t=>{const e=[],s=[];return t.lines?.forEach(a=>{switch(a.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 n=a;n!=null&&n.account!=null&&n.account.accountName?.length>0&&e.push(n.account.accountName),n.class!=null&&n.class.className?.length>0&&s.push(n.class.className);break}}}),{transactionCategory:e,transactionClass:s}},oa=t=>rt(t)===!0?t.customer?.name??"":lt(t)===!0?t.vendor?.name??"":t.memo!=null?t.memo:t.type;export{Qt as C,ya as T,Jt as a,Yt as b,ta as c,aa as d,ea as e,re as f,Xt as g,ha as u};
@@ -0,0 +1 @@
1
+ import{j as s}from"./liveblocks-B5ZW-VBI.js";import{h as Q,g as U,u as X,i as Z,j as h,N as z,n as H,o as be,p as j}from"./core-Crl6eqZl.js";import{eW as W,qR as K,jW as u,RE as ee,J$ as De,bo as le,RF as ve,kx as te,NF as ae,RG as ue,RH as Pe,bE as Y,JX as ye,RI as Ee,RJ as me,RK as je,J_ as Ae,RL as xe,RM as pe,RN as Me,RO as ge,RP as Le,RQ as Ce,RR as fe,Lb as Be}from"./zeni-epic-state-DTyrT1Ga.js";import{F as de,W as ne,Q as q,c as G,co as ce,s as N,r as oe,X as Fe,E as Re}from"./index-CJknvk0s.js";import"./mui-U77PQnc2.js";import{a as g}from"./sentry-BxWyF9h9.js";import{w as se}from"./withTransactionSidePanel-DKnep6Xn.js";import{p as ie,c as re}from"./routePaths-jWP9zfXs.js";import{v as Oe}from"./utils-BjvWDnmB.js";import{d as v}from"./decodeURIComponentSafe-DwYiSzjo.js";import{Z as Ge}from"./ZeniAccountStatementScreen-BORtLhU4.js";import"./recharts-e5u-LCPv.js";import"./analytics-CkLW7NeW.js";import"./plaid-TCRHScH1.js";import"./dnd-tE28jHT7.js";import"./stripe-DMRn4zHo.js";import"./lottie-hSeCd_VX.js";import"./lexical-Bm_vZOjC.js";import"./pdf-DDcPh2pm.js";import"./useAskAiCfoHostNavButtonProps-BAtYgUWq.js";import"./TransactionDetailScreen-Ch_kEoMB.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]="90014b55-24b7-460f-980d-07db39b0b66f",a._sentryDebugIdIdentifier="sentry-dbid-90014b55-24b7-460f-980d-07db39b0b66f")}catch{}})();const ze=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],V=a=>Oe(a),we=H(function(a,e){const t=ve(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,V(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=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=de.getLocalizedStrings(),l=V(e.selectedAccount.tranListType),m=Je(t,n,c,l,e.bookCloseDate);G.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(ue({uiState:{dateRange:m},type:V(e.selectedAccount.tranListType)})),a(De(l,u(m),!1,l==="missingReceipts"?o.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0)),e.onSelectedTimePeriodChange(u(m))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=N(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(ue({uiState:{scrollYOffset:t},type:V(e.selectedAccount.tranListType)}))}}})(ce),J=se(function({...a}){const e=Q(),t=U(),n=X(),c=t.pathname.split("/").find(r=>ze.includes(r)),o=c??"uncategorized-expense",{tenantEmailDomain:l}=Z(),m=de.getLocalizedStrings(),{accountType:S,title:T,subTitle:D}=_e(o),y="month",I=h(r=>W(r)),p=I.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:A}=ne(),{isFeatureEnabled:k}=A(q.isProjectsTransactionsEnabled),x=h(r=>K(r))&&k,{dataAvailable:C,initialTimeframeTick:P}=$e(o,p,I.bookCloseDate),[B,E]=g.useState(!1),[F,R]=g.useState(void 0),f=g.useMemo(()=>{const r=u(P);return{tranListType:o,accountType:ee(S),title:T,subTitle:D,timeframe:y,period:r}},[o,y,S,C]);g.useEffect(()=>{if(!B&&f!=null){E(!0),G.trackTransactionList(void 0,void 0,void 0,f.title);const r=V(f.tranListType);n(De(r,f.period,!0,r==="missingReceipts"?m.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0))}},[B,f,n]);let M=f;return f!=null&&F!=null&&(M={...f,period:F}),c==null||M==null?s.jsx(z,{to:"../"}):s.jsx(we,{firstMonthOfFY:p,tenantEmailDomain:l,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:C,navigate:e,showProjectField:x,selectedAccount:M,referrerType:o,bookCloseDate:I.bookCloseDate,onSelectedTimePeriodChange:r=>R(r),...a})}),_e=a=>{let e="",t="";const n=de.getLocalizedStrings();switch(a){case"uncategorized-income":e="income",t=n.uncategorizedTransactionList.income.title;break;case"uncategorized-expense":e="expenses",t=n.uncategorizedTransactionList.expense.title;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.uncategorizedTransactionList.missingReceipt.title}return{accountType:e,title:t,subTitle:""}},$e=(a,e,t)=>{const n=le();let c=le().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:ie(5,e),initialTimeframeTick:{startDate:c,endDate:n}}},Je=(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},Ve=H(function(a,e){const t=Ee(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:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??he();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)}`),G.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(me({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{dateRange:o}})),a(ye(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=N(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(me({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{scrollYOffset:t}}))}}})(ce),qe=se(function({referrerType:a,...e}){const t=Q(),n=U(),c=X(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,classIdEncoded:S,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=Z(),p=v(l??""),A=v(m??""),k=v(S??""),x=v(I??""),C=h(d=>Pe(d.transactionListState,A,p,k)),[P,B]=g.useState(!1),[E,F]=g.useState(void 0),R=h(d=>W(d)),f=R.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(q.isProjectsTransactionsEnabled),w=h(d=>K(d))&&r;let i;const O=Ne(p,A,k,T,D,y,x);if(O){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=Ue(C?.dateRange,d);i={accountId:A,accountType:ee(p),classId:k,title:x,timeframe:T,period:_}}g.useEffect(()=>{P||i==null||(B(!0),G.trackTransactionList(i.accountId,void 0,a,i.title),c(ye(i.accountId,i.accountType,i.classId,i.period)))},[P,i,c]);let L=i;i!=null&&E!=null&&(L={...i,period:E});const $=[l,m,S,T,D,y,I].filter(d=>d!=null);return O&&L!=null?s.jsx(Ve,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:w,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>F(d),...e}):s.jsx(z,{to:he($.length)})}),he=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Ne=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&Y(c,"YYYY-MM-DD").isValid()&&Y(o,"YYYY-MM-DD").isValid()&&l!=null,Ue=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),We=H(function(a,e){const t=xe(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:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Se();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)}`),G.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{dateRange:o}})),a(Ae(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=N(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{scrollYOffset:t}}))}}})(ce),Qe=se(function({referrerType:a,...e}){const t=Q(),n=U(),c=X(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,projectIdEncoded:S,timeframe:T,startDate:D,endDate:y,titleEncoded:I}=Z(),p=v(l??""),A=v(m??""),k=v(S??""),x=v(I??""),C=h(d=>je(d.transactionListState,A,p,k)),[P,B]=g.useState(!1),[E,F]=g.useState(void 0),R=h(d=>W(d)),f=R.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(q.isProjectsTransactionsEnabled),w=h(d=>K(d))&&r;let i;const O=Xe(p,A,k,T,D,y,x);if(O){const d={startDate:Y(D,"YYYY-MM-DD"),endDate:Y(y,"YYYY-MM-DD")},_=Ze(C?.dateRange,d);i={accountId:A,accountType:ee(p),projectId:k,title:x,timeframe:T,period:_}}g.useEffect(()=>{P||i==null||(B(!0),G.trackTransactionList(i.accountId,void 0,a,i.title),c(Ae(i.accountId,i.accountType,i.projectId,i.period)))},[P,i,c]);let L=i;i!=null&&E!=null&&(L={...i,period:E});const $=[l,m,S,T,D,y,I].filter(d=>d!=null);return O&&L!=null?s.jsx(We,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:w,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>F(d),...e}):s.jsx(z,{to:Se($.length)})}),Se=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Xe=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&Y(c,"YYYY-MM-DD").isValid()&&Y(o,"YYYY-MM-DD").isValid()&&l!=null,Ze=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),He=H(function(a,e){const t=Le(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&Ce(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:te(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Ie();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)}`),G.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{dateRange:o}})),a(ge(e.selectedAccount.accountId,e.selectedAccount.accountType,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=N(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,uiState:{scrollYOffset:t}}))},onStatementPageIconClick:()=>{const t=tt(e.tenantEmailDomain),n=N(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}})(ce),Te=se(function({referrerType:a,...e}){const t=Q(),n=U(),c=X(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,timeframe:S,startDate:T,endDate:D,titleEncoded:y,excludeSubAccounts:I}=Z(),p=v(l??""),A=v(m??""),k=v(y??""),x=!(I!=null&&I==="exclude_subaccounts"),C=h(b=>Me(b.transactionListState,A,p)),[P,B]=g.useState(!1),[E,F]=g.useState(void 0),R=h(b=>W(b)),f=R.company?.featuresActivationInfo.connectedAccountProvider==="unit",M=R.company?.companyInfo.firstMonthOfFY??1;let r;const w=Ke(p,A,S,T,D,k);if(w){const b={startDate:Y(T,"YYYY-MM-DD"),endDate:Y(D,"YYYY-MM-DD")},Ye=et(C?.dateRange,b);r={accountId:A,accountType:ee(p),title:k,timeframe:S,period:Ye}}let i=r;r!=null&&E!=null&&(i={...r,period:E});const{useFeatureGate:O}=ne(),{isFeatureEnabled:L}=O(q.isTransactionCommentingEnabled),{isFeatureEnabled:$}=O(q.isProjectsTransactionsEnabled),d=h(b=>K(b))&&$,{areTenantIdsInSync:_}=Fe();g.useEffect(()=>{!P&&r!=null&&_&&(B(!0),G.trackTransactionList(r.accountId,void 0,a,r.title),c(ge(r.accountId,r.accountType,r.period,void 0,!1,x)))},[P,r,c,_]);const ke=[l,m,S,T,D,y].filter(b=>b!=null);return w&&i!=null?s.jsx(He,{firstMonthOfFY:M,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:f,isTransactionCommentingEnabled:L,showProjectField:d,selectedAccount:i,referrerType:a,onSelectedTimePeriodChange:b=>F(b),...e}):s.jsx(z,{to:Ie(ke.length)})}),Ie=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Ke=(a,e,t,n,c,o)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&(t==="month"||t==="quarter")&&Y(n,"YYYY-MM-DD").isValid()&&Y(c,"YYYY-MM-DD").isValid()&&o!=null,et=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),tt=a=>`/${a}/transactions/${Be}/statements`;function kt(){const a=U().state?.referrer,e=h(n=>n.expenseAutomationViewState.selectedPeriodByTenantId)[h(n=>W(n)).tenantId],t=Re();return s.jsxs(be,{children:[s.jsx(j,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/zeni-clearing-account/statements",element:s.jsx(Ge,{})}),s.jsx(j,{path:"/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/uncategorized-income/*",element:s.jsx(J,{})}),s.jsx(j,{path:"/uncategorized-expense/*",element:t?s.jsx(z,{to:`../../month_end_close_checks/review/transaction_categorization/${e.month}-${e.year}`}):s.jsx(J,{})}),s.jsx(j,{path:"/miscategorized-income/*",element:s.jsx(J,{})}),s.jsx(j,{path:"/miscategorized-expense/*",element:t?s.jsx(z,{to:`../../month_end_close_checks/review/transaction_categorization/${e.month}-${e.year}`}):s.jsx(J,{})}),s.jsx(j,{path:"/missing-receipts/*",element:t?s.jsx(z,{to:`../../month_end_close_checks/review/missing_receipts/${e.month}-${e.year}`}):s.jsx(J,{})}),s.jsx(j,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(qe,{referrerType:a})}),s.jsx(j,{path:"/by-project/:accountTypeEncoded/:accountIdEncoded/:projectIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(Qe,{referrerType:a})})]})}export{kt as default};
@@ -0,0 +1,37 @@
1
+ import{j as e}from"./liveblocks-B5ZW-VBI.js";import{h as L,g as U,u as P,i as O,j as y,N as B,n as N,o as Te,p as k}from"./core-Crl6eqZl.js";import{cp as G,eW as D,Qn as R,Gm as ae,fW as W,G4 as ne,Qp as we,Gp as ke,Ql as be,Qm as se,QC as je,Et as Ee,ub as Ae,Qr as ve,GI as De,Qo as re,cS as q,yq as oe,fB as Fe,fD as Be,RB as Le,RC as Ue,G5 as Pe,RD as Re,G6 as Me,Gf as Ve,bs as Oe,bJ as Ne,cA as Ge,bK as _e,co as ze,fV as $e,bt as Qe,LW as We,cn as qe}from"./zeni-epic-state-DTyrT1Ga.js";import{I as _,aq as He,z as E,V as z,c as b,ch as Ze,ci as Ke,cj as Q,j as H,m as Je,X as Xe,Z as Ye,W as ie,Q as A,x as et,B as tt,ck as at,at as Z,s as nt,cl as st,r as K,cm as rt,N as X,cn as ot,a9 as it}from"./index-CJknvk0s.js";import{D as ct,n as M,S as lt}from"./mui-U77PQnc2.js";import ut from"./NotFoundScreen-DY1Wwus4.js";import{S as Y}from"./SetupPagesScreen-Dh6d6vu-.js";import{a as p}from"./sentry-BxWyF9h9.js";import{u as dt}from"./useAskAiCfoHostNavButtonProps-BAtYgUWq.js";import{u as pt}from"./useInitialThreadRequest-DZr1J4rc.js";import{u as mt}from"./useCashManagementBanner-CRbG3Xtj.js";import{M as ce}from"./MobileAppDrawer-BIP1MEKX.js";import{F as ft}from"./FeaturePreviewScreen-BuXd4W0P.js";import{a as ee}from"./analyticsHelper-BsiU5y2K.js";import"./recharts-e5u-LCPv.js";import"./analytics-CkLW7NeW.js";import"./plaid-TCRHScH1.js";import"./dnd-tE28jHT7.js";import"./stripe-DMRn4zHo.js";import"./lottie-hSeCd_VX.js";import"./lexical-Bm_vZOjC.js";import"./pdf-DDcPh2pm.js";import"./utils-BjvWDnmB.js";import"./routePaths-jWP9zfXs.js";import"./BusinessVerificationPageScreen-YVk91Fzz.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]="1591d5d2-98bf-49e6-9058-cdd4c538f70d",t._sentryDebugIdIdentifier="sentry-dbid-1591d5d2-98bf-49e6-9058-cdd4c538f70d")}catch{}})();const yt=N(function(t,a){const{companyId:n}=a;return{treasurySetupView:R(t,n),analytics:b}},function(t,a){const{navigate:n,analytics:o,treasurySetupView:m}=a;return{onBackClick:()=>{n("../")},onNextClick:()=>{const s=m.fundAllocationLocalData;o.trackTreasuryPortfolioConfirm(s.riskScore,ee(s)),t(ke(!0))},onUpdateFundAllocation:s=>{o.trackTreasuryAllocationAction("update",ee(s)),t(we(s))}}})(Ze);function gt(){const t=L(),a=U(),n=P(),{tenantEmailDomain:o}=O(),m=_(),s=y(w=>w.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState),f=He(s),r=G(m?.loggedInUserRoleMap),[l,i]=p.useState(!1),[u,I]=p.useState(!1),[d,c]=p.useState(!1),h=y(w=>D(w)),g=E.getSignedInUserTenant(o)?.companyId??h.companyId,C=E.getSignedInUser(),S=y(w=>R(w,g)),T=y(w=>w.treasurySetupViewState.fetchState),x=y(w=>w.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),F=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(()=>{l||T!=="Not-Started"||g==null||(i(!0),n(ae(g,!0,!1)))},[l,T,g,n]),p.useEffect(()=>{d||F!=="Not-Started"||g==null||(c(!0),n(W()))},[d,F,g,n]),p.useEffect(()=>{u||x!=="Not-Started"||g==null||(I(!0),n(ne()))},[u,x,g,n]),p.useEffect(()=>{f==="In-Progress"&&s==="Completed"&&t("../")},[f,s,t]),h.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1)return e.jsx(B,{to:"../promo"});const v=h.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||T!=="Completed";return e.jsxs(e.Fragment,{children:[!v&&e.jsx(z,{analytics:b,onLoad:()=>{}}),e.jsx(yt,{navigate:t,location:a,companyId:g,isEditMode:!0,isLoading:v,isReadOnly:!r,treasurySetupView:S,analytics:b})]})}const ht=N(function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:je(t,n,"zeni_treasury","treasury_setup").plaidConnectionDetails,treasurySetupView:R(t,n)}},function(t,a){const{navigate:n,transferDetails:o,treasurySetupView:m}=a,s=o.treasuryTransferMoneyLocalData,f=m.fundAllocationLocalData;return{onCancelClick:()=>{Q(a.analytics,"cancel",s,f,"Transfer"),t(se()),n("../")},onTransferClick:()=>{Q(a.analytics,"confirm",s,f,"Transfer"),t(De())},onSaveChangesToLocalStore:r=>{t(ve(r))},onFetchLinkTokenClick:r=>{t(Ae("treasury_setup",r))},onEstablishConnectionClick:r=>{t(Ee(r,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}})(Ke),St=({isFirstTransfer:t})=>{const a=L(),{tenantEmailDomain:n}=O(),o=P(),[m,s]=p.useState(!1),[f,r]=p.useState(!1),[l,i]=p.useState(!1),[u,I]=p.useState(!1),d=y(x=>x.treasurySetupViewState.fetchState),c=y(x=>x.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState),h=y(x=>x.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),g=y(x=>D(x)),C=E.getSignedInUserTenant(n)?.companyId??g.companyId,S=y(x=>be(x)),T=y(x=>R(x,C));if(E.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return p.useEffect(()=>{f||d!=="Not-Started"||C==null||(r(!0),o(ae(C,!0,!1)))},[f,d,C,o]),p.useEffect(()=>{l||c!=="Not-Started"||C==null||(i(!0),o(W()))},[l,c,C,o]),p.useEffect(()=>{u||h!=="Not-Started"||C==null||(I(!0),o(ne()))},[u,h,C,o]),e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:b,onLoad:()=>{}}),e.jsx(ht,{analytics:b,navigate:a,transferDetails:S,onAnotherTransferClick:()=>{s(!1),o(se())},currentTenant:g,treasurySetupView:T,showReviewContent:m,maxInsuredAmount:5e5,onReviewClick:()=>{Q(b,"review",S.treasuryTransferMoneyLocalData,T.fundAllocationLocalData,"Transfer"),s(!0)},isFirstTransfer:t,setShowReviewContent:s,onBackClick:()=>{}})]})},xt=M.div`
2
+ display: flex;
3
+ min-height: 100%;
4
+ width: 100%;
5
+ flex: 1 1 auto;
6
+ flex-direction: column;
7
+ align-items: center;
8
+ background-color: ${t=>t.theme.colors.grey4};
9
+ `,Ct={overlayWidth:new et(100,100,48)},It=N(function(t,a){const n=re(t),{companyId:o}=a;return{treasuryDetail:n,treasurySetupView:R(t,o),downloadEndPoint:`${Z.bankingMicroServiceBaseUrl}/1.0/treasury-account/statements?query={"statement_type":"tax_statement"}`}},function(t,a){const{navigate:n,currentTenant:o,location:m,handleDrawerToggle:s,analytics:f,isCashManagementFeatureEnabled:r}=a,{tenantEmailDomain:l}=o;return{onSettingsClick:()=>{f.trackAccountsListPageClicked("Settings Icon"),n("setup")},onReloadTransactions:()=>{t(oe(!0))},handleTreasuryOptionSelection:i=>{let u="page-not-found";i==="editPortfolio"?u=Tt(l):i==="statements"?u=wt(l):i==="taxLetter"?u=kt(l):i==="settings"&&(u=bt(l));const I=nt(m.state?.pathnameStackToGoBack,m.pathname);n(u,{state:{pathnameStackToGoBack:I}})},onColumnSortConfigChanged:(i,u)=>{t(Le({uiState:{sortKey:i,sortOrder:u}}))},onTransferClick:()=>{n("./transfer")},onBackClick:()=>{n("../../")},onClickMenuIcon:()=>{s(!0)},onAutoTransferClick:()=>{n(r?"../../checking/cash_management/auto-transfer":"../../checking/auto-transfer")},onCashManagementClick:()=>{n(`/${l}/checking/cash_management`)}}})(at);function $({isTransferDrawerOpen:t,isEditPortfolioDrawerOpen:a}){const n=U(),o=L(),m=P(),s=H(),f=Je(),r=y(j=>D(j)),{tenantEmailDomain:l}=O(),i=r.companyId??E.getSignedInUserTenant(l)?.companyId,[u,I]=p.useState(!1),d=y(j=>re(j)),c=d.fetchState,h=d.accountSummary?.totalBalance?.amount,g=y(j=>j.treasurySetupViewState.treasuryFundsDetails?.fetchStatus),C=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",S=_(),T=!!r.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,x=G(S?.loggedInUserRoleMap),F=q(S?.loggedInUserRoleMap),{areTenantIdsInSync:v}=Xe();p.useEffect(()=>{c==="Not-Started"&&!u&&v&&(I(!0),m(oe(!0)))},[u,m,c,v]),p.useEffect(()=>{d.transactionsFetchState.fetchState==="Completed"&&d.transactions.length===0&&!n.pathname.includes("transfer")&&x&&o("./transfer")},[d.transactionsFetchState.fetchState,d.transactions.length]);const w=()=>{o("..")},[le,ue]=p.useState(!1),J=j=>{ue(j)},{isAiCfoAccessEnabled:de,onAskAiCfoClick:pe}=dt({mobileExploreReferrer:"Treasury"});Ye({isDataReady:c==="Completed"});const me=mt(),{useFeatureGate:V}=ie(),{isFeatureEnabled:fe}=V(A.isDebitCardFeatureEnabled),{isFeatureEnabled:ye}=V(A.isAutoTransferRuleEnabled),{isFeatureEnabled:ge}=V(A.isTreasuryCommentingEnabled),{isFeatureEnabled:he}=V(A.isCashManagementFeatureEnabled),Se=pt(i,{clearParams:c==="Completed"&&g?.fetchState==="Completed"}),xe=Fe(r),Ce=Be(fe,r);if(xe===!0&&Ce!==!0)return e.jsx(ft,{});if(C){const j=g?.fetchState!=="Completed"||d.accountSummaryFetchState.fetchState!=="Completed";return e.jsxs(e.Fragment,{children:[d.accountSummaryFetchState.fetchState==="Completed"&&g?.fetchState==="Completed"&&t===!1&&a===!1?e.jsx(z,{analytics:b,onLoad:()=>{}}):null,e.jsx(ct,{onClose:w,anchor:"right",open:a||t,transitionDuration:250,PaperProps:{style:{width:Ct.overlayWidth.valuePercentage(s),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:f.colors.black,opacity:.75,cursor:"pointer"}}},children:e.jsxs(jt,{onClick:Ie=>Ie.stopPropagation(),children:[t===!0?e.jsx(St,{isFirstTransfer:d.transactions.length===0||h===0}):null,a===!0?e.jsx(gt,{}):null]})}),e.jsxs(xt,{windowSize:s,children:[e.jsx(ce,{isAppContentDrawerOpen:le,handleDrawerToggle:J}),e.jsx(It,{treasuryDetailsView:d,isAutoTransferRuleEnabled:ye,navigate:o,currentTenant:r,location:n,companyId:i,analytics:b,cashManagementBannerProps:me,isCashManagementFeatureEnabled:he,isTreasuryCommentingEnabled:ge,handleDrawerToggle:J,initialOpenThreadRequest:Se,isLoading:j,isAiCfoAccessEnabled:de,onAskAiCfoClick:pe})]})]})}return T&&x?e.jsx(B,{to:"../setup"}):r.companyTreasuryInfo?.info&&!T&&F?e.jsx(B,{to:"../promo",state:n.state}):e.jsx(tt,{fetchState:"In-Progress",style:{backgroundColor:f.colors.grey5}})}const Tt=t=>`/${t}/treasury/edit-portfolio`,wt=t=>`/${t}/treasury/statements`,kt=t=>`/${t}/treasury/tax-letter`,bt=t=>`/${t}/treasury/setup`,jt=M(lt)`
10
+ display: flex;
11
+ min-height: 100%;
12
+ flex-direction: column;
13
+ `,Et=M.div`
14
+ display: flex;
15
+ height: 100vh;
16
+ width: 100%;
17
+ flex: 1 1 auto;
18
+ flex-direction: column;
19
+ align-items: center;
20
+ background-color: ${t=>t.theme.colors.grey4};
21
+ `;function At(){const t=L(),a=P(),n=H(),o=U(),m=`${Z.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[s,f]=p.useState(!1),r=y(c=>Ue(c));p.useEffect(()=>{s||r.fetchState!=="Not-Started"||(f(!0),a(Pe(!1)))},[s,r.fetchState,a]);const l=E.getSignedInUser(),i=y(c=>D(c)),u={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i.tenantId??""},I=i.company?.companyInfo.companyLegalName??i.companyName;if(l==null)throw Error("Can't access statements page without signing in...");const d=r.fetchState!=="Completed";return e.jsx(Et,{windowSize:n,children:e.jsx(st,{currentTenantCompanyName:I,statementListView:r,isLoading:d,onBackClick:()=>{const c=K(o.state?.pathnameStackToGoBack),h=c.poppedPathname??"..";t(h,{state:{pathnameStackToGoBack:c.newStack}})},authParams:u,downloadEndPoint:m})})}const vt=M.div`
22
+ display: flex;
23
+ height: 100vh;
24
+ width: 100%;
25
+ flex: 1 1 auto;
26
+ flex-direction: column;
27
+ align-items: center;
28
+ background-color: ${t=>t.theme.colors.grey4};
29
+ `;function Dt(){const t=L(),a=H(),n=U(),o=P(),m=`${Z.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[s,f]=p.useState(!1),r=y(c=>Re(c));p.useEffect(()=>{s||r.fetchState!=="Not-Started"||(f(!0),o(Me(!1)))},[s,r.fetchState,o]);const l=E.getSignedInUser(),i=y(c=>D(c)),u={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i.tenantId??""},I=i.company?.companyInfo.companyLegalName??i.companyName;if(l==null)throw Error("Can't access tax letter page without signing in...");const d=r.fetchState!=="Completed";return e.jsx(vt,{windowSize:a,children:e.jsx(rt,{currentTenantCompanyName:I,taxLetterListView:r,isLoading:d,onBackClick:()=>{const c=K(n.state?.pathnameStackToGoBack),h=c.poppedPathname??"..";t(h,{state:{pathnameStackToGoBack:c.newStack}})},authParams:u,downloadEndPoint:m})})}const Ft=N(function(t,a){const{companyId:n}=a,o=R(t,n);return{treasurySetupView:o,isSetupComplete:o.companyTreasuryInfo?.businessVerificationStatus?.code==="verified",videoUrl:"https://www.youtube.com/watch?v=sqvJWKCMZgk",meetingUrl:"https://meetings.hubspot.com/yoshi-araki/treasury-product-schedule-demo-link?embed=true"}},function(t,a){const{navigate:n,companyId:o}=a;return{onSetupButtonClick:()=>{t(Ve(o))},onBackClick:()=>{n("../..",{relative:"path"})},onTreasurySetupSuccess:m=>{n(m?"..":"../setup",{relative:"path"})}}})(ot),Bt=()=>{const t=L(),a=U(),n=P(),{tenantEmailDomain:o}=O(),[m,s]=p.useState(!1),f=y(S=>D(S)),[r,l]=p.useState(!1),i=y(S=>S.treasurySetupViewState.treasuryFundsDetails?.fetchStatus);p.useEffect(()=>{r||i?.fetchState!=="Not-Started"||u==null||(l(!0),n(W()))},[i,n]);const u=E.getSignedInUserTenant(o)?.companyId??f.companyId,I=E.getSignedInUser(),d=!!f.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,c=S=>{s(S)};if(I==null)throw Error("Can't access treasury promo page without signing in...");const h=_(),g=G(h?.loggedInUserRoleMap),C=q(h?.loggedInUserRoleMap);if(d&&g)return e.jsx(B,{to:"../../treasury/setup"});if(f.company?.companyTreasuryInfo&&(!d&&g||C)){if(a.state?.message==="activation"){const S=K(a.state?.pathnameStackToGoBack);t(a.pathname,{state:{...a.state,message:void 0,pathnameStackToGoBack:S.newStack}})}return i?.fetchState!=="Completed"?e.jsx(te,{children:e.jsx(X,{size:"ExtraLarge",start:!0})}):e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:b,onLoad:S=>(T=>T.trackTreasuryPromoView("Treasury Promo Page"))(S)}),e.jsx(ce,{isAppContentDrawerOpen:m,handleDrawerToggle:c}),e.jsx(Ft,{analytics:b,navigate:t,companyId:u,onClickMenuIcon:()=>{c(!0)}})]})}return e.jsx(te,{children:e.jsx(X,{size:"ExtraLarge",start:!0})})},te=M.div`
30
+ display: flex;
31
+ width: 100%;
32
+ height: 100%;
33
+ flex-direction: row;
34
+ justify-content: center;
35
+ align-items: center;
36
+ background-color: ${t=>t.theme.colors.grey5};
37
+ `;function sa(){const t=U(),a=y(v=>D(v)),{useFeatureGate:n}=ie(),{isFeatureEnabled:o}=n(A.isTreasuryEnabled),m=!!a.company?.companyTreasuryInfo?.isTreasuryTOSAccepted,s=_(),f=q(s?.loggedInUserRoleMap),r=a?.userRole!=null&&Oe(a?.userRole),l=(a?.company==null||a.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!r)&&Ne(s?.loggedInUserRoleMap),i=Ge(s?.loggedInUserRoleMap),u=(a?.company==null||a.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!r)&&_e(s?.loggedInUserRoleMap),{isFeatureEnabled:I}=n(A.isDepositAccountsFeatureEnabled),d=I&&!r&&ze(s?.loggedInUserRoleMap),c=a.company!=null&&$e(a.company),h=o&&c===!0&&!r&&G(s?.loggedInUserRoleMap),{isFeatureEnabled:g}=n(A.isChargeCardFeatureEnabled),{isFeatureEnabled:C}=n(A.isDebitCardFeatureEnabled),S=it(a,g,C)&&!r&&Qe(s?.loggedInUserRoleMap),T=We(s?.loggedInUserRoleMap),x=qe(s?.loggedInUserRoleMap),F=a.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified";return e.jsxs(Te,{children:[x?null:e.jsx(k,{path:"setup",element:e.jsx(Y,{isBillPayAdminLevelAccess:l,isReimbursementAdminLevelAccess:u,isZeniAccountAdminLevelAccess:d,isChargeCardAdminLevelAccess:S,isTreasuryAdminLevelAccess:h,isUserHasOnlyCardAccess:T,isUserHasOnlyBillPayAccess:i,productType:"zeni_treasury",type:"setup"})}),x?null:e.jsx(k,{path:"verification",element:e.jsx(Y,{isBillPayAdminLevelAccess:l,isUserHasOnlyBillPayAccess:i,isReimbursementAdminLevelAccess:u,isZeniAccountAdminLevelAccess:d,isChargeCardAdminLevelAccess:S,isTreasuryAdminLevelAccess:h,isUserHasOnlyCardAccess:T,productType:"zeni_treasury",type:"verification"})}),e.jsx(k,{path:"promo",element:e.jsx(Bt,{})}),e.jsx(k,{path:"statements",element:e.jsx(At,{})}),e.jsx(k,{path:"tax-letter",element:e.jsx(Dt,{})}),F?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"/",element:e.jsx($,{isTransferDrawerOpen:!1,isEditPortfolioDrawerOpen:!1})}),h?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"edit-portfolio",element:e.jsx($,{isEditPortfolioDrawerOpen:!0,isTransferDrawerOpen:!1})}),e.jsx(k,{path:"transfer",element:e.jsx($,{isTransferDrawerOpen:!0,isEditPortfolioDrawerOpen:!1})})]}):null,e.jsx(k,{path:"*",element:e.jsx(ut,{})})]}):m&&h?e.jsx(k,{path:"*",element:e.jsx(B,{to:"../setup"})}):a.company?.companyZeniAccountInfo&&f?e.jsx(k,{path:"*",element:e.jsx(B,{to:"../promo",state:t.state})}):e.jsx(k,{path:"*",element:null})]})}export{sa as default};