@zeniai/web-app-ui 5.2.15-dev → 5.2.16-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 (131) hide show
  1. package/dist/assets/AddressRoutes-f609Ttdc.js +1 -0
  2. package/dist/assets/{AddressScreen-BVRFr_N1.js → AddressScreen-DnnIRcHN.js} +2 -2
  3. package/dist/assets/{AiCfoScreen-BN4QIEgB.js → AiCfoScreen-CjlYW9BA.js} +3 -3
  4. package/dist/assets/{BillPayApprovalRoutes-B_4hJ2pr.js → BillPayApprovalRoutes-D6R35wEu.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-BJZymqmE.js → BillPayRoutes-CAVdOoQ5.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-DrCLmIxZ.js → BusinessVerificationPageScreen-2yzgn_dq.js} +2 -2
  7. package/dist/assets/{CardsAiCfoScreen-Inv396bE.js → CardsAiCfoScreen-BqGSzxio.js} +3 -3
  8. package/dist/assets/{ChargeCardRoutes-DGEKzyzO.js → ChargeCardRoutes-DwSiYhNV.js} +8 -8
  9. package/dist/assets/CompanyPassportScreen-6gSkpDjZ.js +1 -0
  10. package/dist/assets/{ConnectionAuthScreen-CA8kXAT-.js → ConnectionAuthScreen-Ck4Gxy8V.js} +1 -1
  11. package/dist/assets/CustomerOnboardingAuthScreen-IhYlyAOK.js +1 -0
  12. package/dist/assets/{CustomerOnboardingRoutes-Xm_O4AxR.js → CustomerOnboardingRoutes-D9rEFGOH.js} +6 -6
  13. package/dist/assets/{DashboardRoutes-BsVesrb3.js → DashboardRoutes-uvzfWzIm.js} +1 -1
  14. package/dist/assets/{DefaultTenantHome-CrZNGTHj.js → DefaultTenantHome-BeV69g9G.js} +1 -1
  15. package/dist/assets/DomesticWireDetailScreen-C-5bE-Xl.js +18 -0
  16. package/dist/assets/DrawerScreen-BL40QyXA.js +1 -0
  17. package/dist/assets/EntityDetailRoutes-CnjAhdib.js +1 -0
  18. package/dist/assets/ExpenseAutomationRoutes-CjC0R383.js +25 -0
  19. package/dist/assets/FeaturePreviewScreen-DAIgYjjb.js +1 -0
  20. package/dist/assets/{HubSpotOAuthCallbackScreen-BpsDDDwu.js → HubSpotOAuthCallbackScreen-Bwh56-e_.js} +1 -1
  21. package/dist/assets/MagicLinkRoutes-wKih3lqk.js +72 -0
  22. package/dist/assets/MagicLinkSignInScreen-7uBJWOza.js +12 -0
  23. package/dist/assets/MobileAppDrawer-QMY9Y_6M.js +1 -0
  24. package/dist/assets/NotFoundScreen-Bjgm3Cgg.js +1 -0
  25. package/dist/assets/{NotificationRoutes-b1ATX3hL.js → NotificationRoutes-DQXiQJ75.js} +1 -1
  26. package/dist/assets/OAuthConsentScreen-BgywNNMG.js +1 -0
  27. package/dist/assets/{PandLWithForecastRoutes-BVouxwOp.js → PandLWithForecastRoutes-CRmbuHlA.js} +1 -1
  28. package/dist/assets/PeopleRoutes-Br3c54zD.js +22 -0
  29. package/dist/assets/PerformanceRoutes-D8GxMw7x.js +1 -0
  30. package/dist/assets/{Preview-Q7E6grqg.js → Preview-CcprGnkI.js} +1 -1
  31. package/dist/assets/{QBOConnectionScreen-CYvG88ne.js → QBOConnectionScreen-CBR0AZz1.js} +1 -1
  32. package/dist/assets/ReimbursementApprovalRoutes-COdNraf8.js +1 -0
  33. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-Bj2gRsYN.js → ReimbursementApprovalRuleDetailScreen-m4OK96Pp.js} +1 -1
  34. package/dist/assets/{ReimbursementRoutes-D8GfsHFS.js → ReimbursementRoutes-CC1LJLL_.js} +7 -7
  35. package/dist/assets/{ReportsRoutes-DYUuIrA9.js → ReportsRoutes-BSnn6sLO.js} +1 -1
  36. package/dist/assets/RewardsRoutes-CzaqvCYC.js +1 -0
  37. package/dist/assets/{ScreenRoutes-DeIZgGFA.js → ScreenRoutes-BT39k7R-.js} +2 -2
  38. package/dist/assets/{SettingsRoutes-BS_91kvY.js → SettingsRoutes-BW92o1e1.js} +7 -7
  39. package/dist/assets/{SetupPagesScreen-Du6z7K4L.js → SetupPagesScreen-CmqcI8Pt.js} +5 -5
  40. package/dist/assets/SignInScreen-Db_yZc64.js +1 -0
  41. package/dist/assets/SignOutScreen-CNV5EZSB.js +9 -0
  42. package/dist/assets/{TaskListScreen-C1GpDMh9.js → TaskListScreen-YoPRLTQT.js} +2 -2
  43. package/dist/assets/TaskRoutes-Dl6VRn1s.js +9 -0
  44. package/dist/assets/{TransactionDetailRoutes-DM262XtJ.js → TransactionDetailRoutes-BiZAv8du.js} +1 -1
  45. package/dist/assets/TransactionDetailScreen-DrsbGFZL.js +5 -0
  46. package/dist/assets/{TransactionListRoutes-q01ai3C8.js → TransactionListRoutes-CWvS2zXP.js} +1 -1
  47. package/dist/assets/{TreasuryRoutes-C4C9GZ84.js → TreasuryRoutes-BWDCDIwg.js} +5 -5
  48. package/dist/assets/{VendorsRoutes-5HmjTAo1.js → VendorsRoutes-D5S2XjMm.js} +13 -13
  49. package/dist/assets/WiseConfirmationScreen-Q0J40ioP.js +12 -0
  50. package/dist/assets/{ZeniAccountRoutes-DjosaDA2.js → ZeniAccountRoutes-D0ZCvv0b.js} +7 -7
  51. package/dist/assets/ZeniAccountStatementScreen-BQINO3hW.js +9 -0
  52. package/dist/assets/{accountMappingHelper-C5WHpsgJ.js → accountMappingHelper-DvHt_faU.js} +1 -1
  53. package/dist/assets/{analytics-D_NuuF2U.js → analytics-fzE8ssbj.js} +1 -1
  54. package/dist/assets/analyticsHelper-DjBKxGVt.js +1 -0
  55. package/dist/assets/{core-Da6TLrNx.js → core-Bnb5S7eF.js} +1 -1
  56. package/dist/assets/{decodeURIComponentSafe-B-r3T5bV.js → decodeURIComponentSafe-IB5WoVjO.js} +1 -1
  57. package/dist/assets/{dnd-DC_qF3Wr.js → dnd-BclBZkmc.js} +1 -1
  58. package/dist/assets/{empty-s0Z9SHTS.js → empty-BXrJtoVu.js} +1 -1
  59. package/dist/assets/{empty-C73kmkO9.js → empty-CGGO74v5.js} +1 -1
  60. package/dist/assets/{emptyVideoElement-CUd0nWeJ.js → emptyVideoElement-DBjMlLZt.js} +1 -1
  61. package/dist/assets/epic-Bq9rvz3h.js +2 -0
  62. package/dist/assets/getLocaleForTenant-DBW7UyHp.js +1 -0
  63. package/dist/assets/{index-DykhB8j2.js → index-B9FzYJpE.js} +1 -1
  64. package/dist/assets/{index-DAI9X2Zp.js → index-BSl9hMca.js} +2 -2
  65. package/dist/assets/{index-XC9zB3-f.js → index-BfeFOTnu.js} +1 -1
  66. package/dist/assets/{index-Bwczg7nO.js → index-BzrRJ8WV.js} +14415 -14185
  67. package/dist/assets/{index-CsQZjvif.js → index-D7gFR706.js} +1 -1
  68. package/dist/assets/{index-b_fXiiPC.js → index-DRI9BXaF.js} +1 -1
  69. package/dist/assets/{index-CWFrIv4j.js → index-gZ-YqOdE.js} +1 -1
  70. package/dist/assets/{index-COd9LNlP.js → index-oAxAWZsp.js} +1 -1
  71. package/dist/assets/{lexical-CQoPutFC.js → lexical-DbVLnI8g.js} +1 -1
  72. package/dist/assets/{liveblocks-C8AAaKDR.js → liveblocks-bqFl_SVp.js} +1 -1
  73. package/dist/assets/{lottie-B7_cpoe1.js → lottie-CosVBOrn.js} +1 -1
  74. package/dist/assets/{mui-CosLSKUu.js → mui-BAFflVdx.js} +1 -1
  75. package/dist/assets/{pathToGoBack-C_jELk-6.js → pathToGoBack-BX0vhbVE.js} +1 -1
  76. package/dist/assets/{pdf-CQB-J2hc.js → pdf-Ba7sOjY6.js} +3 -3
  77. package/dist/assets/{pdf-lib-CscVz5ta.js → pdf-lib-Sz3Y8uGi.js} +1 -1
  78. package/dist/assets/{plaid-2mv_ck83.js → plaid-Il6Pn-tK.js} +1 -1
  79. package/dist/assets/{pusher-DrRS7JyV.js → pusher-DSTN6BAp.js} +1 -1
  80. package/dist/assets/{react-B7r6-bpj.js → react-Ahj_9ocn.js} +1 -1
  81. package/dist/assets/{react-DTDSsBUn.js → react-BQr1_2Lm.js} +1 -1
  82. package/dist/assets/{react-C6MFx27g.js → react-DF-XRbvU.js} +1 -1
  83. package/dist/assets/{react-B42V2lQZ.js → react-DV1w5wyt.js} +1 -1
  84. package/dist/assets/{react-DJflHsBg.js → react-DjsKx-MP.js} +1 -1
  85. package/dist/assets/{react-BmvpxDDj.js → react-wreqxVEC.js} +1 -1
  86. package/dist/assets/{recharts-9jMEgSjc.js → recharts-B3FaT6ex.js} +1 -1
  87. package/dist/assets/{routePaths-Kh8F22Sq.js → routePaths-iBgwsr_r.js} +1 -1
  88. package/dist/assets/{sentry-DfheywaX.js → sentry-Bj_fC7Ll.js} +1 -1
  89. package/dist/assets/{url-C-T2kMoW.js → url-CRSVA0N_.js} +1 -1
  90. package/dist/assets/{url-HWxh2lX9.js → url-Cv9qurGb.js} +1 -1
  91. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-Dn_pRt3Y.js → useAiCfoDashboardSuggestedQuestionsChips-BjjheFLZ.js} +1 -1
  92. package/dist/assets/useAskAiCfoHostNavButtonProps-DGvHpWY7.js +1 -0
  93. package/dist/assets/useCashManagementBanner-DUUI_7bK.js +1 -0
  94. package/dist/assets/{useChargeCardPusherEvents-B9JTMflJ.js → useChargeCardPusherEvents-Dl4aF9Gu.js} +1 -1
  95. package/dist/assets/{useDeviceId-COe_GzcU.js → useDeviceId-CnUmsNEA.js} +1 -1
  96. package/dist/assets/{useEmailConnectResultRefresh-D4OTnNkO.js → useEmailConnectResultRefresh-C_fGcTHu.js} +1 -1
  97. package/dist/assets/{useInitialThreadRequest-CRJnx1_Z.js → useInitialThreadRequest-BaClMW9n.js} +1 -1
  98. package/dist/assets/{utils-BykfwIo5.js → utils-BKBg63lI.js} +1 -1
  99. package/dist/assets/withTransactionSidePanel-Dkd_LZWk.js +21 -0
  100. package/dist/assets/{zeni-epic-state-BqRlfhza.js → zeni-epic-state-GXytJkko.js} +5 -5
  101. package/dist/index.html +1 -1
  102. package/package.json +4 -4
  103. package/dist/assets/AddressRoutes-DKny58NT.js +0 -1
  104. package/dist/assets/CompanyPassportScreen-BsHZnsQV.js +0 -1
  105. package/dist/assets/CustomerOnboardingAuthScreen-DhhSBraP.js +0 -1
  106. package/dist/assets/DomesticWireDetailScreen-C7-Ze-bQ.js +0 -18
  107. package/dist/assets/DrawerScreen-D8laOuUr.js +0 -1
  108. package/dist/assets/EntityDetailRoutes-BH66r_ba.js +0 -1
  109. package/dist/assets/ExpenseAutomationRoutes-NkkbpV7S.js +0 -25
  110. package/dist/assets/FeaturePreviewScreen-BKSMrhrm.js +0 -1
  111. package/dist/assets/MagicLinkRoutes-pFkPSCAf.js +0 -72
  112. package/dist/assets/MagicLinkSignInScreen-DJG_XhkF.js +0 -12
  113. package/dist/assets/MobileAppDrawer-D_5ajcgl.js +0 -1
  114. package/dist/assets/NotFoundScreen-vodaR6J5.js +0 -1
  115. package/dist/assets/OAuthConsentScreen-DTjj0EZW.js +0 -1
  116. package/dist/assets/PeopleRoutes-BB0mptER.js +0 -22
  117. package/dist/assets/PerformanceRoutes-BSGtqYip.js +0 -1
  118. package/dist/assets/ReimbursementApprovalRoutes-CIZnVB8w.js +0 -1
  119. package/dist/assets/RewardsRoutes-CESh4LSy.js +0 -1
  120. package/dist/assets/SignInScreen-DGJIVFjs.js +0 -1
  121. package/dist/assets/SignOutScreen-B4fw6lrq.js +0 -9
  122. package/dist/assets/TaskRoutes-Bn-Ea5LE.js +0 -9
  123. package/dist/assets/TransactionDetailScreen-tCFIjsQZ.js +0 -5
  124. package/dist/assets/WiseConfirmationScreen-Cf2wKH5p.js +0 -12
  125. package/dist/assets/ZeniAccountStatementScreen-BBJfP9Ky.js +0 -9
  126. package/dist/assets/analyticsHelper-C7Ffbo_X.js +0 -1
  127. package/dist/assets/epic-DAjg0wXj.js +0 -2
  128. package/dist/assets/getLocaleForTenant-CnNopwIO.js +0 -1
  129. package/dist/assets/useAskAiCfoHostNavButtonProps-vhjzTbBd.js +0 -1
  130. package/dist/assets/useCashManagementBanner-DwoCHz3u.js +0 -1
  131. package/dist/assets/withTransactionSidePanel-ZJmA3F8P.js +0 -21
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-BsVesrb3.js","assets/sentry-DfheywaX.js","assets/core-Da6TLrNx.js","assets/zeni-epic-state-BqRlfhza.js","assets/index-Bwczg7nO.js","assets/mui-CosLSKUu.js","assets/analytics-D_NuuF2U.js","assets/utils-BykfwIo5.js","assets/withTransactionSidePanel-ZJmA3F8P.js","assets/useAskAiCfoHostNavButtonProps-vhjzTbBd.js","assets/TransactionDetailScreen-tCFIjsQZ.js","assets/decodeURIComponentSafe-B-r3T5bV.js","assets/routePaths-Kh8F22Sq.js","assets/NotFoundScreen-vodaR6J5.js","assets/useInitialThreadRequest-CRJnx1_Z.js","assets/analyticsHelper-C7Ffbo_X.js","assets/CompanyPassportScreen-BsHZnsQV.js","assets/MobileAppDrawer-D_5ajcgl.js","assets/useAiCfoDashboardSuggestedQuestionsChips-Dn_pRt3Y.js","assets/FeaturePreviewScreen-BKSMrhrm.js","assets/index-Czu7h9lW.css","assets/BillPayRoutes-BJZymqmE.js","assets/AddressScreen-BVRFr_N1.js","assets/DomesticWireDetailScreen-C7-Ze-bQ.js","assets/DrawerScreen-D8laOuUr.js","assets/SetupPagesScreen-Du6z7K4L.js","assets/BusinessVerificationPageScreen-DrCLmIxZ.js","assets/BillPayApprovalRoutes-B_4hJ2pr.js","assets/ReimbursementApprovalRuleDetailScreen-Bj2gRsYN.js","assets/getLocaleForTenant-CnNopwIO.js","assets/ReimbursementRoutes-D8GfsHFS.js","assets/ReimbursementApprovalRoutes-CIZnVB8w.js","assets/TransactionListRoutes-q01ai3C8.js","assets/ZeniAccountStatementScreen-BBJfP9Ky.js","assets/SettingsRoutes-BS_91kvY.js","assets/accountMappingHelper-C5WHpsgJ.js","assets/useEmailConnectResultRefresh-D4OTnNkO.js","assets/QBOConnectionScreen-CYvG88ne.js","assets/empty-s0Z9SHTS.js","assets/index-DykhB8j2.js","assets/url-C-T2kMoW.js","assets/index-CWFrIv4j.js","assets/ReportsRoutes-DYUuIrA9.js","assets/ChargeCardRoutes-DGEKzyzO.js","assets/useChargeCardPusherEvents-B9JTMflJ.js","assets/PeopleRoutes-BB0mptER.js","assets/ExpenseAutomationRoutes-NkkbpV7S.js","assets/TreasuryRoutes-C4C9GZ84.js","assets/useCashManagementBanner-DwoCHz3u.js","assets/VendorsRoutes-5HmjTAo1.js","assets/pathToGoBack-C_jELk-6.js","assets/ZeniAccountRoutes-DjosaDA2.js","assets/AddressRoutes-DKny58NT.js","assets/PandLWithForecastRoutes-BVouxwOp.js","assets/CustomerOnboardingRoutes-Xm_O4AxR.js","assets/TransactionDetailRoutes-DM262XtJ.js","assets/EntityDetailRoutes-BH66r_ba.js","assets/NotificationRoutes-b1ATX3hL.js","assets/PerformanceRoutes-BSGtqYip.js","assets/RewardsRoutes-CESh4LSy.js","assets/TaskRoutes-Bn-Ea5LE.js","assets/TaskListScreen-C1GpDMh9.js","assets/AiCfoScreen-BN4QIEgB.js","assets/CardsAiCfoScreen-Inv396bE.js"])))=>i.map(i=>d[i]);
2
- import{_ as t,bn as ls,eZ as us,fG as ds,fE as cs,go as ms,ft as _s,cW as Ee,cC as hs,fW as Es,cu as ps,bE as xs,bo as Rs,f_ as gs,v as Is,Mi as js,bs as Ts,Mj as As,bK as fs,bJ as ys,bt as Ds,cq as bs,Mk as Cs,Ml as vs,cS as ws,cV as Us,cU as Os,cB as Ps,cI as Fs,oi as pe,fC as xe,gy as Ls,g2 as Re,gv as ge,gw as Ie,g3 as ks}from"./zeni-epic-state-BqRlfhza.js";import{j as e}from"./liveblocks-C8AAaKDR.js";import{a as O}from"./sentry-DfheywaX.js";import{u as Bs,h as Hs,i as Vs,g as Ss,j as G,l as je,N as u,o as Ns,p as a}from"./core-Da6TLrNx.js";import{y as Ms,u as Zs,z as D,A as Gs,a as zs,n as $s,c as z,i as Ws,w as Ys,d as qs,L as F,O as Te,t as _,P as Js,e as X,l}from"./index-Bwczg7nO.js";import"./mui-CosLSKUu.js";import{f as Ae}from"./analyticsHelper-C7Ffbo_X.js";import{t as Ks}from"./getLocaleForTenant-CnNopwIO.js";import"./recharts-9jMEgSjc.js";import"./analytics-D_NuuF2U.js";import"./plaid-2mv_ck83.js";import"./dnd-DC_qF3Wr.js";import"./stripe-cKAAJElX.js";import"./lottie-B7_cpoe1.js";import"./lexical-CQoPutFC.js";import"./pdf-CQB-J2hc.js";import"./utils-BykfwIo5.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},T=new o.Error().stack;T&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[T]="bdf3bc32-8b37-42c5-8aa6-d3879563767d",o._sentryDebugIdIdentifier="sentry-dbid-bdf3bc32-8b37-42c5-8aa6-d3879563767d")}catch{}})();const Qs={dashboard:()=>t((()=>import("./DashboardRoutes-BsVesrb3.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])),bills:()=>t((()=>import("./BillPayRoutes-BJZymqmE.js")),__vite__mapDeps([21,1,2,3,4,5,6,7,22,13,23,9,14,24,17,19,25,15,12,26,27,28,29,20])),reimbursement:()=>t((()=>import("./ReimbursementRoutes-D8GfsHFS.js")),__vite__mapDeps([30,1,2,3,4,5,6,7,13,25,17,15,12,26,19,9,14,24,31,28,29,20])),transactions:()=>t((()=>import("./TransactionListRoutes-q01ai3C8.js")),__vite__mapDeps([32,1,2,3,4,5,6,7,8,9,10,11,12,33,20])),settings:()=>t((()=>import("./SettingsRoutes-BS_91kvY.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,17,35,22,13,15,26,12,16,36,37,38,39,40,41,11,27,28,31,20])),reports:()=>t((()=>import("./ReportsRoutes-DYUuIrA9.js")),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,20])),chargeCards:()=>t((()=>import("./ChargeCardRoutes-DGEKzyzO.js")),__vite__mapDeps([43,1,2,3,4,5,6,7,9,17,25,13,15,12,26,14,44,22,20])),people:()=>t((()=>import("./PeopleRoutes-BB0mptER.js")),__vite__mapDeps([45,1,2,3,4,5,6,7,13,9,17,20])),expenseAutomation:()=>t((()=>import("./ExpenseAutomationRoutes-NkkbpV7S.js")),__vite__mapDeps([46,1,2,3,13,4,5,6,7,9,10,11,12,8,35,24,20])),treasury:()=>t((()=>import("./TreasuryRoutes-C4C9GZ84.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,13,25,17,15,12,26,9,14,48,19,20])),vendors:()=>t((()=>import("./VendorsRoutes-5HmjTAo1.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,22,13,19,12,50,9,17,24,35,20])),zeniAccounts:()=>t((()=>import("./ZeniAccountRoutes-DjosaDA2.js")),__vite__mapDeps([51,1,2,3,4,5,6,7,48,13,25,17,15,12,26,19,23,22,9,33,20]))},Xs=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},et=l((()=>t((()=>import("./ReportsRoutes-DYUuIrA9.js")),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,20])))),st=l((()=>t((()=>import("./AddressRoutes-DKny58NT.js")),__vite__mapDeps([52,1,2,3,22,4,5,6,7,13,20])))),tt=l((()=>t((()=>import("./PeopleRoutes-BB0mptER.js")),__vite__mapDeps([45,1,2,3,4,5,6,7,13,9,17,20])))),nt=l((()=>t((()=>import("./PandLWithForecastRoutes-BVouxwOp.js")),__vite__mapDeps([53,1,2,3,4,5,6,7,13,19,9,14,12,17,20])))),at=l((()=>t((()=>import("./CustomerOnboardingRoutes-Xm_O4AxR.js")),__vite__mapDeps([54,1,2,3,22,4,5,6,7,13,37,38,39,40,41,11,36,44,20])))),ot=l((()=>t((()=>import("./VendorsRoutes-5HmjTAo1.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,22,13,19,12,50,9,17,24,35,20])))),rt=l((()=>t((()=>import("./TransactionDetailRoutes-DM262XtJ.js")),__vite__mapDeps([55,1,2,3,13,4,5,6,7,10,9,11,12,20])))),fe=l((()=>t((()=>import("./EntityDetailRoutes-BH66r_ba.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,11,8,9,10,12,20])))),it=l((()=>t((()=>import("./DashboardRoutes-BsVesrb3.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])))),ye=l((()=>t((()=>import("./BillPayRoutes-BJZymqmE.js")),__vite__mapDeps([21,1,2,3,4,5,6,7,22,13,23,9,14,24,17,19,25,15,12,26,27,28,29,20])))),lt=l((()=>t((()=>import("./SettingsRoutes-BS_91kvY.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,17,35,22,13,15,26,12,16,36,37,38,39,40,41,11,27,28,31,20])))),De=l((()=>t((()=>import("./ReimbursementRoutes-D8GfsHFS.js")),__vite__mapDeps([30,1,2,3,4,5,6,7,13,25,17,15,12,26,19,9,14,24,31,28,29,20])))),ut=l((()=>t((()=>import("./ZeniAccountRoutes-DjosaDA2.js")),__vite__mapDeps([51,1,2,3,4,5,6,7,48,13,25,17,15,12,26,19,23,22,9,33,20])))),dt=l((()=>t((()=>import("./TreasuryRoutes-C4C9GZ84.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,13,25,17,15,12,26,9,14,48,19,20])))),ct=l((()=>t((()=>import("./TransactionListRoutes-q01ai3C8.js")),__vite__mapDeps([32,1,2,3,4,5,6,7,8,9,10,11,12,33,20])))),mt=l((()=>t((()=>import("./ChargeCardRoutes-DGEKzyzO.js")),__vite__mapDeps([43,1,2,3,4,5,6,7,9,17,25,13,15,12,26,14,44,22,20])))),_t=l((()=>t((()=>import("./NotificationRoutes-b1ATX3hL.js")),__vite__mapDeps([57,1,2,3,13,4,5,6,7,9,20])))),ht=l((()=>t((()=>import("./PerformanceRoutes-BSGtqYip.js")),__vite__mapDeps([58,1,2,3,13,4,5,6,7,9,17,20])))),Et=l((()=>t((()=>import("./ExpenseAutomationRoutes-NkkbpV7S.js")),__vite__mapDeps([46,1,2,3,13,4,5,6,7,9,10,11,12,8,35,24,20])))),pt=l((()=>t((()=>import("./RewardsRoutes-CESh4LSy.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,13,20])))),xt=l((()=>t((()=>import("./TaskRoutes-Bn-Ea5LE.js")),__vite__mapDeps([60,1,2,3,13,4,5,6,7,14,17,61,9,20])))),Rt=l((()=>t((()=>import("./AiCfoScreen-BN4QIEgB.js")),__vite__mapDeps([62,1,2,3,4,5,6,7,18,50,20])))),be=l((()=>t((()=>import("./CardsAiCfoScreen-Inv396bE.js")),__vite__mapDeps([63,1,2,3,4,5,6,7,20])))),C=l((()=>t((()=>import("./NotFoundScreen-vodaR6J5.js")),__vite__mapDeps([13,1,2,3,4,5,6,7,20])))),gt=l((()=>t((()=>import("./TaskListScreen-C1GpDMh9.js")),__vite__mapDeps([61,1,2,3,4,5,6,7,9,17,20]))));function St({setTenantEmailDomain:o}){const T=Bs(),V=Hs(),{tenantEmailDomain:i}=Vs(),L=Ms().mode,{setLoading:w,clearAllLoading:v,clearLoading:k}=Zs(),A=D.getSignedInUserTenant(i)?.tenantId,I=D.getSignedInUser(),se=ls(I),$=Ss(),[B,Oe]=O.useState(!1),r=G((n=>us(n))),{useFeatureGate:N}=Gs(),M=zs(),te=$s(),Pe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Fe=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:Le}=N(z.isChargeCardFeatureEnabled),{isFeatureEnabled:ne}=N(z.isDebitCardFeatureEnabled),f=G((n=>n.tenantState.fetchState)),j=G((n=>n.tenantState.activeTenantFetchState.fetchState)),h=j==="Completed"||f==="Completed"?ds(ne,r):void 0,J=j==="Completed"||f==="Completed"?cs(r):void 0,ke=Ws(r,Le,ne),{isCardsHidden:Be}=Ys(r?.tenantId),He=!ke||!!Be,{isFeatureEnabled:Ve}=N(z.isSettingsFeatureEnabled),{isFeatureEnabled:K}=N(z.isAiCfoFileUploadEnabled),W=G((n=>ms(n)));if(i!=null){const n=D.getSignedInUserTenant(i);I!=null&&n!=null&&Ae(I,r,L)}const Z={tenantId:A,userId:I?.userId,sessionId:I?.zeniSessionId},ae=_s(),E=qs(),Se=r.company==null||E?.loggedInUserRoleMap!=null&&Ee(E.loggedInUserRole),Ne=hs(E?.loggedInUserRoleMap),oe=je("/:tenantEmailDomain/onboarding/*")!==null,Q=je("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Me=G((n=>Z.tenantId!=null?Es(n,Z.tenantId):void 0));O.useEffect((()=>{w(F.TENANT_FETCHING),o(i)}),[i]),O.useEffect((()=>{if(Q!=null&&A!=null){const n=Q.params.selectedPeriod;if(n!=null){const y=n.split("-");if(y.length===2){const d=ps(Number(y[0])),s=Number(y[1]),c=xs(`01-${d<10?`0${d}`:d}-${s}`,Te.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),S=Rs();c.isAfter(S,"month")===!1?T(gs(A,{month:d,year:s})):V("./month_end_close_checks/review")}}}}),[Q,A]),O.useEffect((()=>{B||(Oe(!0),w(F.TENANT_FETCHING))}),[B,Z,ae,I,T,D]),O.useLayoutEffect((()=>{!Is(ae,Z)&&D.isSignedIn()&&(w(F.TENANT_FETCHING),(function(n,y,d,s){if(xe(y?.userId,y?.zeniSessionId,n.tenantId),d(Ls(!0)),d(Re(n.tenantId)),n.tenantId!=null&&_.clearTenant(n.tenantId),n.tenantId!=null){const c=D.getSignedInUserTenantWithId(n.tenantId);s&&Te.updateAppLocaleID(Ks(s)),c?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(c?.tenantEmailDomain)}n.userId!=null?X.identify(n.userId,{tenant_id:n.tenantId}):X.resetUserIdentity()})(Z,I,T,Me))}),[A]),O.useEffect((()=>{D.isSignedIn()&&(w(F.TENANT_FETCHING),(function(n,y,d,s,c,S,H){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const Y=s!=null&&c?.zeniSessionId!=null,os=d==null||d.tenantId!==s,rs=d!=null&&d.excludedResources==null,is=d!=null&&d.externalConnections==null;if(Y&&os){H(Re(s));const q=D.getSignedInUserTenantWithId(s);q?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(q?.tenantEmailDomain),xe(c?.userId,c?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),H(ge(c.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),H(Ie(c.userId,s)))}else Y&&rs&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),H(ge(c.userId,s))),Y&&is&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),H(Ie(c.userId,s)));if(Y){X.identify(c.userId,{tenant_id:s});const q=s==null||s!=null&&(y==="Completed"||y==="Error");n==="Completed"||y!=="Not-Started"&&y!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),S(F.TENANT_FETCHING),H(ks(c.userId,s,c.zeniSessionId))),q&&(n==="Not-Started"||n==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),H(pe(c.userId,c.zeniSessionId)))}})(f,j,r,A,I,w,T))}),[A,j]),O.useEffect((()=>{D.isSignedIn()&&f==="Completed"&&W.tenantsBaseInOrder.length>0&&(k(F.TENANT_FETCHING),D.saveSignedInUserTenants(js(W.tenantsBaseInOrder)),I!=null&&Ae(I,r,L,void 0,W.tenantsBaseInOrder))}),[W,f,r,I]),O.useEffect((()=>{j==="In-Progress"&&w(F.TENANT_FETCHING),j!=="Completed"&&j!=="Error"||(j==="Completed"&&A!=null?(v(),_.markActiveTenantFetchCompleted(A)):j==="Error"&&A!=null&&(_.markActiveTenantFetchFailed(A),k(F.TENANT_FETCHING),k(F.TENANT_SWITCHING))),f!=="Completed"&&f!=="Error"||(f==="Completed"?_.markAllTenantsFetchCompleted():f==="Error"&&_.markAllTenantsFetchFailed())}),[j,f,A,B]);const re=O.useRef(!1);O.useEffect((()=>{!re.current&&j==="Completed"&&B&&(re.current=!0,(function(n=Xs,y=3e3){setTimeout((()=>{const d=s=>{if(s>=n.length)return;const c=n[s],S=Qs[c];S!=null?S().then((()=>ee((()=>d(s+1))))).catch((()=>ee((()=>d(s+1))))):d(s+1)};ee((()=>d(0)))}),y)})())}),[j,B]);const U=r?.userRole!=null&&Ts(r?.userRole),{isFeatureEnabled:Ze}=N(z.isReferralFeatureEnabled),Ge=r?.userRole!=null&&r.userRole.includes("charge_card_user"),ze=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),P=r?.userRole!=null&&Ee(r.userRole),ie=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!U,le=!He&&!U,$e=As(E?.loggedInUserRoleMap),We=r.externalConnections?.accounting[0]?.isValid,Ye=r.externalConnections?.fetchState==="Completed",ue=r.company?.companyOnboardingInfo.isOnboardingCompleted,de=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!U,ce=de&&fs(E?.loggedInUserRoleMap),me=Pe&&!U,qe=Fe&&!U,Je=ie&&ys(E?.loggedInUserRoleMap),Ke=le&&Ds(E?.loggedInUserRoleMap),Qe=me&&bs(E?.loggedInUserRoleMap),Xe=Cs(E?.loggedInUserRoleMap),es=vs(E?.loggedInUserRoleMap),ss=ws(E?.loggedInUserRoleMap),ts=Us(E?.loggedInUserRoleMap),ns=Os(E?.loggedInUserRoleMap),p=Ps(E?.loggedInUserRoleMap),x=Fs(E?.loggedInUserRoleMap),_e=ie&&p,he=de&&x,R=me&&ss,g=qe&&ts,m=le&&ns,as=r.excludedResources?.resources?.find((n=>n.resource==="/invites"))!=null||Ne===!0||$e===!0||Xe===!0||es===!0;return D.isSignedIn()?A==null?f==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(I!=null&&f!=="In-Progress"&&T(pe(I.userId,I.zeniSessionId)),null):j!=="In-Progress"&&j!=="Not-Started"||f==="Completed"?(ue===!0||se&&!oe)&&Ye&&We!==!0&&h===!1&&J===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!B||ue!==!1||oe||se?B&&r?.userRole&&h!=null&&J!=null&&i!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(Ns,{children:e.jsxs(a,{element:e.jsx(Js,{}),children:[e.jsx(a,{path:"/",element:e.jsx(It,{isDashboardAccess:P,showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,isTenantCardsOnly:J,showChargeCardRoute:m})}),e.jsx(a,{path:"dashboard/*",element:P?e.jsx(it,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reports/*",element:P?e.jsx(et,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"people/*",element:as||P?e.jsx(tt,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"forecast/*",element:P?e.jsx(nt,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"onboarding/*",element:e.jsx(at,{})}),e.jsx(a,{path:"transaction/*",element:P&&U===!1||Ge||ze?e.jsx(rt,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"transactions/*",element:P&&U===!1?e.jsx(ct,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"customer/*",element:P&&U===!1?e.jsx(fe,{entityType:"customer"}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,isTenantBankingOnly:h,showTreasuryRoute:g,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"vendor/*",element:P&&U===!1?e.jsx(fe,{entityType:"vendor"}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"tasks",element:e.jsx(gt,{})}),e.jsx(a,{path:"tasks/*",element:e.jsx(xt,{})}),e.jsx(a,{path:"address/*",element:Je||ce||Qe||Ke?e.jsx(st,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"checking/*",element:R?e.jsx(ut,{}):e.jsx(C,{})}),e.jsx(a,{path:"treasury/*",element:g?e.jsx(dt,{}):e.jsx(C,{})}),e.jsx(a,{path:"performance",element:te===!0?e.jsx(ht,{}):e.jsx(Ue,{tenantEmailDomain:i})}),e.jsx(a,{path:"month_end_close_checks/review/*",element:te===!0&&U===!1?e.jsx(Et,{}):e.jsx(Ue,{tenantEmailDomain:i})}),e.jsx(a,{path:"notifications/*",element:e.jsx(_t,{})}),e.jsx(a,{path:"vendors/*",element:Se?e.jsx(ot,{}):e.jsx(C,{})}),e.jsx(a,{path:"bill/*",element:_e?e.jsx(ye,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"bills/*",element:_e?e.jsx(ye,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursement/*",element:he?e.jsx(De,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursements/*",element:he?e.jsx(De,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"settings/*",element:Ve?e.jsx(lt,{hasAdminLevelAccess:ce}):e.jsx(C,{})}),e.jsx(a,{path:"cards/ask",element:m&&M?e.jsx(be,{isFileUploadEnabled:K}):e.jsx(C,{})}),e.jsx(a,{path:"cards/ask/:session_id",element:m&&M?e.jsx(be,{isFileUploadEnabled:K}):e.jsx(C,{})}),e.jsx(a,{path:"cards/*",element:m?e.jsx(mt,{}):e.jsx(C,{})}),e.jsx(a,{path:"rewards/*",element:Ze?e.jsx(pt,{}):e.jsx(C,{})}),e.jsx(a,{path:"/ai-cfo",element:M?e.jsx(u,{to:"explore"}):e.jsx(C,{})}),e.jsx(a,{path:"/ai-cfo/",element:M?e.jsx(u,{to:"explore"}):e.jsx(C,{})}),e.jsx(a,{path:"/ai-cfo/:session_id",element:M?e.jsx(Rt,{isFileUploadEnabled:K}):e.jsx(C,{})}),e.jsx(a,{path:"*",element:e.jsx(C,{})})]})}):null:(o(void 0),e.jsx(u,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),o(void 0),e.jsx(u,{to:"/signin/auth",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}))}const It=({isDashboardAccess:o,showZeniAccountRoute:T,isUserHasBillPayAccess:V,isUserHasReimbursementAccess:i,showTreasuryRoute:L,isTenantBankingOnly:w,isTenantCardsOnly:v,showChargeCardRoute:k})=>{if(w===!0){if(T)return e.jsx(u,{to:"checking"});if(L)return e.jsx(u,{to:"treasury"});if(k)return e.jsx(u,{to:"cards"})}return v===!0&&k?e.jsx(u,{to:"cards"}):o?e.jsx(u,{to:"dashboard"}):T?e.jsx(u,{to:"checking"}):L?e.jsx(u,{to:"treasury"}):k?e.jsx(u,{to:"cards"}):V?e.jsx(u,{to:"bills"}):i?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},b=({showZeniAccountRoute:o,isUserHasBillPayAccess:T,isUserHasReimbursementAccess:V,showTreasuryRoute:i,isTenantBankingOnly:L,showChargeCardRoute:w,tenantEmailDomain:v})=>{if(L===!0){if(o)return e.jsx(ve,{tenantEmailDomain:v});if(i)return e.jsx(Ce,{tenantEmailDomain:v});if(w)return e.jsx(we,{tenantEmailDomain:v})}return o?e.jsx(ve,{tenantEmailDomain:v}):i?e.jsx(Ce,{tenantEmailDomain:v}):w?e.jsx(we,{tenantEmailDomain:v}):T?e.jsx(Tt,{tenantEmailDomain:v}):V?e.jsx(jt,{tenantEmailDomain:v}):e.jsx(C,{})},jt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/reimbursements`}),Tt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/bills`}),Ce=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/treasury`}),ve=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/checking`}),we=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/cards`}),Ue=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/dashboard`});export{b as FallBackRoute,St as default};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-uvzfWzIm.js","assets/sentry-Bj_fC7Ll.js","assets/core-Bnb5S7eF.js","assets/zeni-epic-state-GXytJkko.js","assets/index-BzrRJ8WV.js","assets/mui-BAFflVdx.js","assets/analytics-fzE8ssbj.js","assets/utils-BKBg63lI.js","assets/withTransactionSidePanel-Dkd_LZWk.js","assets/useAskAiCfoHostNavButtonProps-DGvHpWY7.js","assets/TransactionDetailScreen-DrsbGFZL.js","assets/decodeURIComponentSafe-IB5WoVjO.js","assets/routePaths-iBgwsr_r.js","assets/NotFoundScreen-Bjgm3Cgg.js","assets/useInitialThreadRequest-BaClMW9n.js","assets/analyticsHelper-DjBKxGVt.js","assets/CompanyPassportScreen-6gSkpDjZ.js","assets/MobileAppDrawer-QMY9Y_6M.js","assets/useAiCfoDashboardSuggestedQuestionsChips-BjjheFLZ.js","assets/FeaturePreviewScreen-DAIgYjjb.js","assets/index-Czu7h9lW.css","assets/BillPayRoutes-CAVdOoQ5.js","assets/AddressScreen-DnnIRcHN.js","assets/DomesticWireDetailScreen-C-5bE-Xl.js","assets/DrawerScreen-BL40QyXA.js","assets/SetupPagesScreen-CmqcI8Pt.js","assets/BusinessVerificationPageScreen-2yzgn_dq.js","assets/BillPayApprovalRoutes-D6R35wEu.js","assets/ReimbursementApprovalRuleDetailScreen-m4OK96Pp.js","assets/getLocaleForTenant-DBW7UyHp.js","assets/ReimbursementRoutes-CC1LJLL_.js","assets/ReimbursementApprovalRoutes-COdNraf8.js","assets/TransactionListRoutes-CWvS2zXP.js","assets/ZeniAccountStatementScreen-BQINO3hW.js","assets/SettingsRoutes-BW92o1e1.js","assets/accountMappingHelper-DvHt_faU.js","assets/useEmailConnectResultRefresh-C_fGcTHu.js","assets/QBOConnectionScreen-CBR0AZz1.js","assets/empty-BXrJtoVu.js","assets/index-B9FzYJpE.js","assets/url-CRSVA0N_.js","assets/index-gZ-YqOdE.js","assets/ReportsRoutes-BSnn6sLO.js","assets/ChargeCardRoutes-DwSiYhNV.js","assets/useChargeCardPusherEvents-Dl4aF9Gu.js","assets/PeopleRoutes-Br3c54zD.js","assets/ExpenseAutomationRoutes-CjC0R383.js","assets/TreasuryRoutes-BWDCDIwg.js","assets/useCashManagementBanner-DUUI_7bK.js","assets/VendorsRoutes-D5S2XjMm.js","assets/pathToGoBack-BX0vhbVE.js","assets/ZeniAccountRoutes-D0ZCvv0b.js","assets/AddressRoutes-f609Ttdc.js","assets/PandLWithForecastRoutes-CRmbuHlA.js","assets/CustomerOnboardingRoutes-D9rEFGOH.js","assets/TransactionDetailRoutes-BiZAv8du.js","assets/EntityDetailRoutes-CnjAhdib.js","assets/NotificationRoutes-DQXiQJ75.js","assets/PerformanceRoutes-D8GxMw7x.js","assets/RewardsRoutes-CzaqvCYC.js","assets/TaskRoutes-Dl6VRn1s.js","assets/TaskListScreen-YoPRLTQT.js","assets/AiCfoScreen-CjlYW9BA.js","assets/CardsAiCfoScreen-BqGSzxio.js"])))=>i.map(i=>d[i]);
2
+ import{_ as t,bn as ls,eZ as us,fG as ds,fE as cs,go as ms,ft as _s,cW as Ee,cC as hs,fW as Es,cu as ps,bE as xs,bo as Rs,f_ as gs,v as Is,Mi as js,bs as Ts,Mj as As,bK as fs,bJ as ys,bt as Ds,cq as bs,Mk as Cs,Ml as vs,cS as Us,cV as ws,cU as Os,cB as Ps,cI as Fs,oi as pe,fC as xe,gy as Ls,g2 as Re,gv as ge,gw as Ie,g3 as ks}from"./zeni-epic-state-GXytJkko.js";import{j as e}from"./liveblocks-bqFl_SVp.js";import{a as O}from"./sentry-Bj_fC7Ll.js";import{u as Bs,h as Hs,i as Vs,g as Ss,j as G,l as je,N as u,o as Ns,p as a}from"./core-Bnb5S7eF.js";import{E as Ms,u as Zs,z as D,y as Gs,a as zs,c as $s,d as z,i as Ws,e as Ys,f as qs,L as F,O as Te,t as _,P as Js,g as X,l}from"./index-BzrRJ8WV.js";import"./mui-BAFflVdx.js";import{f as Ae}from"./analyticsHelper-DjBKxGVt.js";import{t as Ks}from"./getLocaleForTenant-DBW7UyHp.js";import"./recharts-B3FaT6ex.js";import"./analytics-fzE8ssbj.js";import"./plaid-Il6Pn-tK.js";import"./dnd-BclBZkmc.js";import"./stripe-cKAAJElX.js";import"./lottie-CosVBOrn.js";import"./lexical-DbVLnI8g.js";import"./pdf-Ba7sOjY6.js";import"./utils-BKBg63lI.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},T=new o.Error().stack;T&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[T]="0211c531-4d6f-403c-a884-3cc48089dd52",o._sentryDebugIdIdentifier="sentry-dbid-0211c531-4d6f-403c-a884-3cc48089dd52")}catch{}})();const Qs={dashboard:()=>t((()=>import("./DashboardRoutes-uvzfWzIm.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])),bills:()=>t((()=>import("./BillPayRoutes-CAVdOoQ5.js")),__vite__mapDeps([21,1,2,3,4,5,6,7,22,13,23,9,14,24,17,19,25,15,12,26,27,28,29,20])),reimbursement:()=>t((()=>import("./ReimbursementRoutes-CC1LJLL_.js")),__vite__mapDeps([30,1,2,3,4,5,6,7,13,25,17,15,12,26,19,9,14,24,31,28,29,20])),transactions:()=>t((()=>import("./TransactionListRoutes-CWvS2zXP.js")),__vite__mapDeps([32,1,2,3,4,5,6,7,8,9,10,11,12,33,20])),settings:()=>t((()=>import("./SettingsRoutes-BW92o1e1.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,17,35,22,13,15,26,12,16,36,37,38,39,40,41,11,27,28,31,20])),reports:()=>t((()=>import("./ReportsRoutes-BSnn6sLO.js")),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,20])),chargeCards:()=>t((()=>import("./ChargeCardRoutes-DwSiYhNV.js")),__vite__mapDeps([43,1,2,3,4,5,6,7,9,17,25,13,15,12,26,14,44,22,20])),people:()=>t((()=>import("./PeopleRoutes-Br3c54zD.js")),__vite__mapDeps([45,1,2,3,4,5,6,7,13,9,17,20])),expenseAutomation:()=>t((()=>import("./ExpenseAutomationRoutes-CjC0R383.js")),__vite__mapDeps([46,1,2,3,13,4,5,6,7,9,10,11,12,8,35,24,20])),treasury:()=>t((()=>import("./TreasuryRoutes-BWDCDIwg.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,13,25,17,15,12,26,9,14,48,19,20])),vendors:()=>t((()=>import("./VendorsRoutes-D5S2XjMm.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,22,13,19,12,50,9,17,24,35,20])),zeniAccounts:()=>t((()=>import("./ZeniAccountRoutes-D0ZCvv0b.js")),__vite__mapDeps([51,1,2,3,4,5,6,7,48,13,25,17,15,12,26,19,23,22,9,33,20]))},Xs=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},et=l((()=>t((()=>import("./ReportsRoutes-BSnn6sLO.js")),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,20])))),st=l((()=>t((()=>import("./AddressRoutes-f609Ttdc.js")),__vite__mapDeps([52,1,2,3,22,4,5,6,7,13,20])))),tt=l((()=>t((()=>import("./PeopleRoutes-Br3c54zD.js")),__vite__mapDeps([45,1,2,3,4,5,6,7,13,9,17,20])))),nt=l((()=>t((()=>import("./PandLWithForecastRoutes-CRmbuHlA.js")),__vite__mapDeps([53,1,2,3,4,5,6,7,13,19,9,14,12,17,20])))),at=l((()=>t((()=>import("./CustomerOnboardingRoutes-D9rEFGOH.js")),__vite__mapDeps([54,1,2,3,22,4,5,6,7,13,37,38,39,40,41,11,36,44,20])))),ot=l((()=>t((()=>import("./VendorsRoutes-D5S2XjMm.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,22,13,19,12,50,9,17,24,35,20])))),rt=l((()=>t((()=>import("./TransactionDetailRoutes-BiZAv8du.js")),__vite__mapDeps([55,1,2,3,13,4,5,6,7,10,9,11,12,20])))),fe=l((()=>t((()=>import("./EntityDetailRoutes-CnjAhdib.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,11,8,9,10,12,20])))),it=l((()=>t((()=>import("./DashboardRoutes-uvzfWzIm.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])))),ye=l((()=>t((()=>import("./BillPayRoutes-CAVdOoQ5.js")),__vite__mapDeps([21,1,2,3,4,5,6,7,22,13,23,9,14,24,17,19,25,15,12,26,27,28,29,20])))),lt=l((()=>t((()=>import("./SettingsRoutes-BW92o1e1.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,17,35,22,13,15,26,12,16,36,37,38,39,40,41,11,27,28,31,20])))),De=l((()=>t((()=>import("./ReimbursementRoutes-CC1LJLL_.js")),__vite__mapDeps([30,1,2,3,4,5,6,7,13,25,17,15,12,26,19,9,14,24,31,28,29,20])))),ut=l((()=>t((()=>import("./ZeniAccountRoutes-D0ZCvv0b.js")),__vite__mapDeps([51,1,2,3,4,5,6,7,48,13,25,17,15,12,26,19,23,22,9,33,20])))),dt=l((()=>t((()=>import("./TreasuryRoutes-BWDCDIwg.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,13,25,17,15,12,26,9,14,48,19,20])))),ct=l((()=>t((()=>import("./TransactionListRoutes-CWvS2zXP.js")),__vite__mapDeps([32,1,2,3,4,5,6,7,8,9,10,11,12,33,20])))),mt=l((()=>t((()=>import("./ChargeCardRoutes-DwSiYhNV.js")),__vite__mapDeps([43,1,2,3,4,5,6,7,9,17,25,13,15,12,26,14,44,22,20])))),_t=l((()=>t((()=>import("./NotificationRoutes-DQXiQJ75.js")),__vite__mapDeps([57,1,2,3,13,4,5,6,7,9,20])))),ht=l((()=>t((()=>import("./PerformanceRoutes-D8GxMw7x.js")),__vite__mapDeps([58,1,2,3,13,4,5,6,7,9,17,20])))),Et=l((()=>t((()=>import("./ExpenseAutomationRoutes-CjC0R383.js")),__vite__mapDeps([46,1,2,3,13,4,5,6,7,9,10,11,12,8,35,24,20])))),pt=l((()=>t((()=>import("./RewardsRoutes-CzaqvCYC.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,13,20])))),xt=l((()=>t((()=>import("./TaskRoutes-Dl6VRn1s.js")),__vite__mapDeps([60,1,2,3,13,4,5,6,7,14,17,61,9,20])))),Rt=l((()=>t((()=>import("./AiCfoScreen-CjlYW9BA.js")),__vite__mapDeps([62,1,2,3,4,5,6,7,18,50,20])))),be=l((()=>t((()=>import("./CardsAiCfoScreen-BqGSzxio.js")),__vite__mapDeps([63,1,2,3,4,5,6,7,20])))),C=l((()=>t((()=>import("./NotFoundScreen-Bjgm3Cgg.js")),__vite__mapDeps([13,1,2,3,4,5,6,7,20])))),gt=l((()=>t((()=>import("./TaskListScreen-YoPRLTQT.js")),__vite__mapDeps([61,1,2,3,4,5,6,7,9,17,20]))));function St({setTenantEmailDomain:o}){const T=Bs(),V=Hs(),{tenantEmailDomain:i}=Vs(),L=Ms().mode,{setLoading:U,clearAllLoading:v,clearLoading:k}=Zs(),A=D.getSignedInUserTenant(i)?.tenantId,I=D.getSignedInUser(),se=ls(I),$=Ss(),[B,Oe]=O.useState(!1),r=G((n=>us(n))),{useFeatureGate:N}=Gs(),M=zs(),te=$s(),Pe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Fe=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:Le}=N(z.isChargeCardFeatureEnabled),{isFeatureEnabled:ne}=N(z.isDebitCardFeatureEnabled),f=G((n=>n.tenantState.fetchState)),j=G((n=>n.tenantState.activeTenantFetchState.fetchState)),h=j==="Completed"||f==="Completed"?ds(ne,r):void 0,J=j==="Completed"||f==="Completed"?cs(r):void 0,ke=Ws(r,Le,ne),{isCardsHidden:Be}=Ys(r?.tenantId),He=!ke||!!Be,{isFeatureEnabled:Ve}=N(z.isSettingsFeatureEnabled),{isFeatureEnabled:K}=N(z.isAiCfoFileUploadEnabled),W=G((n=>ms(n)));if(i!=null){const n=D.getSignedInUserTenant(i);I!=null&&n!=null&&Ae(I,r,L)}const Z={tenantId:A,userId:I?.userId,sessionId:I?.zeniSessionId},ae=_s(),E=qs(),Se=r.company==null||E?.loggedInUserRoleMap!=null&&Ee(E.loggedInUserRole),Ne=hs(E?.loggedInUserRoleMap),oe=je("/:tenantEmailDomain/onboarding/*")!==null,Q=je("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Me=G((n=>Z.tenantId!=null?Es(n,Z.tenantId):void 0));O.useEffect((()=>{U(F.TENANT_FETCHING),o(i)}),[i]),O.useEffect((()=>{if(Q!=null&&A!=null){const n=Q.params.selectedPeriod;if(n!=null){const y=n.split("-");if(y.length===2){const d=ps(Number(y[0])),s=Number(y[1]),c=xs(`01-${d<10?`0${d}`:d}-${s}`,Te.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),S=Rs();c.isAfter(S,"month")===!1?T(gs(A,{month:d,year:s})):V("./month_end_close_checks/review")}}}}),[Q,A]),O.useEffect((()=>{B||(Oe(!0),U(F.TENANT_FETCHING))}),[B,Z,ae,I,T,D]),O.useLayoutEffect((()=>{!Is(ae,Z)&&D.isSignedIn()&&(U(F.TENANT_FETCHING),(function(n,y,d,s){if(xe(y?.userId,y?.zeniSessionId,n.tenantId),d(Ls(!0)),d(Re(n.tenantId)),n.tenantId!=null&&_.clearTenant(n.tenantId),n.tenantId!=null){const c=D.getSignedInUserTenantWithId(n.tenantId);s&&Te.updateAppLocaleID(Ks(s)),c?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(c?.tenantEmailDomain)}n.userId!=null?X.identify(n.userId,{tenant_id:n.tenantId}):X.resetUserIdentity()})(Z,I,T,Me))}),[A]),O.useEffect((()=>{D.isSignedIn()&&(U(F.TENANT_FETCHING),(function(n,y,d,s,c,S,H){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const Y=s!=null&&c?.zeniSessionId!=null,os=d==null||d.tenantId!==s,rs=d!=null&&d.excludedResources==null,is=d!=null&&d.externalConnections==null;if(Y&&os){H(Re(s));const q=D.getSignedInUserTenantWithId(s);q?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(q?.tenantEmailDomain),xe(c?.userId,c?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),H(ge(c.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),H(Ie(c.userId,s)))}else Y&&rs&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),H(ge(c.userId,s))),Y&&is&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),H(Ie(c.userId,s)));if(Y){X.identify(c.userId,{tenant_id:s});const q=s==null||s!=null&&(y==="Completed"||y==="Error");n==="Completed"||y!=="Not-Started"&&y!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),S(F.TENANT_FETCHING),H(ks(c.userId,s,c.zeniSessionId))),q&&(n==="Not-Started"||n==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),H(pe(c.userId,c.zeniSessionId)))}})(f,j,r,A,I,U,T))}),[A,j]),O.useEffect((()=>{D.isSignedIn()&&f==="Completed"&&W.tenantsBaseInOrder.length>0&&(k(F.TENANT_FETCHING),D.saveSignedInUserTenants(js(W.tenantsBaseInOrder)),I!=null&&Ae(I,r,L,void 0,W.tenantsBaseInOrder))}),[W,f,r,I]),O.useEffect((()=>{j==="In-Progress"&&U(F.TENANT_FETCHING),j!=="Completed"&&j!=="Error"||(j==="Completed"&&A!=null?(v(),_.markActiveTenantFetchCompleted(A)):j==="Error"&&A!=null&&(_.markActiveTenantFetchFailed(A),k(F.TENANT_FETCHING),k(F.TENANT_SWITCHING))),f!=="Completed"&&f!=="Error"||(f==="Completed"?_.markAllTenantsFetchCompleted():f==="Error"&&_.markAllTenantsFetchFailed())}),[j,f,A,B]);const re=O.useRef(!1);O.useEffect((()=>{!re.current&&j==="Completed"&&B&&(re.current=!0,(function(n=Xs,y=3e3){setTimeout((()=>{const d=s=>{if(s>=n.length)return;const c=n[s],S=Qs[c];S!=null?S().then((()=>ee((()=>d(s+1))))).catch((()=>ee((()=>d(s+1))))):d(s+1)};ee((()=>d(0)))}),y)})())}),[j,B]);const w=r?.userRole!=null&&Ts(r?.userRole),{isFeatureEnabled:Ze}=N(z.isReferralFeatureEnabled),Ge=r?.userRole!=null&&r.userRole.includes("charge_card_user"),ze=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),P=r?.userRole!=null&&Ee(r.userRole),ie=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!w,le=!He&&!w,$e=As(E?.loggedInUserRoleMap),We=r.externalConnections?.accounting[0]?.isValid,Ye=r.externalConnections?.fetchState==="Completed",ue=r.company?.companyOnboardingInfo.isOnboardingCompleted,de=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!w,ce=de&&fs(E?.loggedInUserRoleMap),me=Pe&&!w,qe=Fe&&!w,Je=ie&&ys(E?.loggedInUserRoleMap),Ke=le&&Ds(E?.loggedInUserRoleMap),Qe=me&&bs(E?.loggedInUserRoleMap),Xe=Cs(E?.loggedInUserRoleMap),es=vs(E?.loggedInUserRoleMap),ss=Us(E?.loggedInUserRoleMap),ts=ws(E?.loggedInUserRoleMap),ns=Os(E?.loggedInUserRoleMap),p=Ps(E?.loggedInUserRoleMap),x=Fs(E?.loggedInUserRoleMap),_e=ie&&p,he=de&&x,R=me&&ss,g=qe&&ts,m=le&&ns,as=r.excludedResources?.resources?.find((n=>n.resource==="/invites"))!=null||Ne===!0||$e===!0||Xe===!0||es===!0;return D.isSignedIn()?A==null?f==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(I!=null&&f!=="In-Progress"&&T(pe(I.userId,I.zeniSessionId)),null):j!=="In-Progress"&&j!=="Not-Started"||f==="Completed"?(ue===!0||se&&!oe)&&Ye&&We!==!0&&h===!1&&J===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!B||ue!==!1||oe||se?B&&r?.userRole&&h!=null&&J!=null&&i!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(Ns,{children:e.jsxs(a,{element:e.jsx(Js,{}),children:[e.jsx(a,{path:"/",element:e.jsx(It,{isDashboardAccess:P,showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,isTenantCardsOnly:J,showChargeCardRoute:m})}),e.jsx(a,{path:"dashboard/*",element:P?e.jsx(it,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reports/*",element:P?e.jsx(et,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"people/*",element:as||P?e.jsx(tt,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"forecast/*",element:P?e.jsx(nt,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"onboarding/*",element:e.jsx(at,{})}),e.jsx(a,{path:"transaction/*",element:P&&w===!1||Ge||ze?e.jsx(rt,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"transactions/*",element:P&&w===!1?e.jsx(ct,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"customer/*",element:P&&w===!1?e.jsx(fe,{entityType:"customer"}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,isTenantBankingOnly:h,showTreasuryRoute:g,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"vendor/*",element:P&&w===!1?e.jsx(fe,{entityType:"vendor"}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"tasks",element:e.jsx(gt,{})}),e.jsx(a,{path:"tasks/*",element:e.jsx(xt,{})}),e.jsx(a,{path:"address/*",element:Je||ce||Qe||Ke?e.jsx(st,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"checking/*",element:R?e.jsx(ut,{}):e.jsx(C,{})}),e.jsx(a,{path:"treasury/*",element:g?e.jsx(dt,{}):e.jsx(C,{})}),e.jsx(a,{path:"performance",element:te===!0?e.jsx(ht,{}):e.jsx(we,{tenantEmailDomain:i})}),e.jsx(a,{path:"month_end_close_checks/review/*",element:te===!0&&w===!1?e.jsx(Et,{}):e.jsx(we,{tenantEmailDomain:i})}),e.jsx(a,{path:"notifications/*",element:e.jsx(_t,{})}),e.jsx(a,{path:"vendors/*",element:Se?e.jsx(ot,{}):e.jsx(C,{})}),e.jsx(a,{path:"bill/*",element:_e?e.jsx(ye,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"bills/*",element:_e?e.jsx(ye,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursement/*",element:he?e.jsx(De,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursements/*",element:he?e.jsx(De,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"settings/*",element:Ve?e.jsx(lt,{hasAdminLevelAccess:ce}):e.jsx(C,{})}),e.jsx(a,{path:"cards/ask",element:m&&M?e.jsx(be,{isFileUploadEnabled:K}):e.jsx(C,{})}),e.jsx(a,{path:"cards/ask/:session_id",element:m&&M?e.jsx(be,{isFileUploadEnabled:K}):e.jsx(C,{})}),e.jsx(a,{path:"cards/*",element:m?e.jsx(mt,{}):e.jsx(C,{})}),e.jsx(a,{path:"rewards/*",element:Ze?e.jsx(pt,{}):e.jsx(C,{})}),e.jsx(a,{path:"/ai-cfo",element:M?e.jsx(u,{to:"explore"}):e.jsx(C,{})}),e.jsx(a,{path:"/ai-cfo/",element:M?e.jsx(u,{to:"explore"}):e.jsx(C,{})}),e.jsx(a,{path:"/ai-cfo/:session_id",element:M?e.jsx(Rt,{isFileUploadEnabled:K}):e.jsx(C,{})}),e.jsx(a,{path:"*",element:e.jsx(C,{})})]})}):null:(o(void 0),e.jsx(u,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),o(void 0),e.jsx(u,{to:"/signin/auth",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}))}const It=({isDashboardAccess:o,showZeniAccountRoute:T,isUserHasBillPayAccess:V,isUserHasReimbursementAccess:i,showTreasuryRoute:L,isTenantBankingOnly:U,isTenantCardsOnly:v,showChargeCardRoute:k})=>{if(U===!0){if(T)return e.jsx(u,{to:"checking"});if(L)return e.jsx(u,{to:"treasury"});if(k)return e.jsx(u,{to:"cards"})}return v===!0&&k?e.jsx(u,{to:"cards"}):o?e.jsx(u,{to:"dashboard"}):T?e.jsx(u,{to:"checking"}):L?e.jsx(u,{to:"treasury"}):k?e.jsx(u,{to:"cards"}):V?e.jsx(u,{to:"bills"}):i?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},b=({showZeniAccountRoute:o,isUserHasBillPayAccess:T,isUserHasReimbursementAccess:V,showTreasuryRoute:i,isTenantBankingOnly:L,showChargeCardRoute:U,tenantEmailDomain:v})=>{if(L===!0){if(o)return e.jsx(ve,{tenantEmailDomain:v});if(i)return e.jsx(Ce,{tenantEmailDomain:v});if(U)return e.jsx(Ue,{tenantEmailDomain:v})}return o?e.jsx(ve,{tenantEmailDomain:v}):i?e.jsx(Ce,{tenantEmailDomain:v}):U?e.jsx(Ue,{tenantEmailDomain:v}):T?e.jsx(Tt,{tenantEmailDomain:v}):V?e.jsx(jt,{tenantEmailDomain:v}):e.jsx(C,{})},jt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/reimbursements`}),Tt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/bills`}),Ce=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/treasury`}),ve=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/checking`}),Ue=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/cards`}),we=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/dashboard`});export{b as FallBackRoute,St as default};
@@ -1,4 +1,4 @@
1
- import{j as o}from"./liveblocks-C8AAaKDR.js";import{a as u}from"./sentry-DfheywaX.js";import{h as L,g as Q,u as U,j as y,s as le,n as G,i as Z,o as ne,p as v}from"./core-Da6TLrNx.js";import{bn as De,eZ as P,gt as Te,n8 as re,OD as Me,hJ as he,Ou as Ue,rb as _e,kG as be,n4 as Fe,hL as Re,Ow as Be,Ov as Oe,QT as Ve,zG as ze,F7 as Le,Qs as Ne,QB as $e,c7 as ae,cN as Qe,cO as Ge,bs as Ze,Mv as He,y6 as Je,QU as Ke,Hy as We,EP as Xe,EG as ye,ED as Ye,ya as Se,EJ as Ce,EM as Ie,ES as oe,uw as se,y9 as qe,ki as X,kl as Ae,QV as en,lm as nn,yp as tn,Nm as an,Nn as on,kg as sn,QW as cn,kj as ln,rF as rn,Nh as dn,Ni as un,rJ as pn,hu as gn,MD as ee,hm as de,hj as mn,hr as fn,ME as hn,ym as bn,QX as yn,QY as Sn,F4 as Cn,fE as Ee,fG as xe,QZ as In,gh as An,MN as En,yl as ue,gm as pe,gl as xn,yk as vn,gk as wn,gj as kn,Q_ as jn,fJ as ve,Q$ as Pn,R0 as Dn,ys as Tn,yj as ge,R1 as Mn,fZ as Un,yg as _n,b_ as Fn,c6 as Rn,c5 as Bn,b$ as On,c3 as Vn,c2 as zn,c1 as Ln,c4 as Nn,c0 as $n}from"./zeni-epic-state-BqRlfhza.js";import{A as Y,c as O,z as k,ag as we,bR as Qn,e as H,g as Gn,bC as Zn,d as J,D as ie,bS as Hn,i as ke,w as je,bT as Jn,ar as Kn,k as Pe,bU as Wn,bV as Xn,bW as Yn,Z as qn,bX as et,v as nt,bY as tt}from"./index-Bwczg7nO.js";import{n as V}from"./mui-CosLSKUu.js";import{M as R}from"./MobileAppDrawer-D_5ajcgl.js";import{a as K,g as W,m as at}from"./accountMappingHelper-C5WHpsgJ.js";import{t as ot,A as st}from"./AddressScreen-BVRFr_N1.js";import $ from"./NotFoundScreen-vodaR6J5.js";import{g as it}from"./analyticsHelper-C7Ffbo_X.js";import{B as ct}from"./BusinessVerificationPageScreen-DrCLmIxZ.js";import{C as lt}from"./CompanyPassportScreen-BsHZnsQV.js";import{u as rt,a as dt}from"./useEmailConnectResultRefresh-D4OTnNkO.js";import{q as me}from"./QBOConnectionScreen-CYvG88ne.js";import{B as ut}from"./BillPayApprovalRoutes-B_4hJ2pr.js";import{R as pt}from"./ReimbursementApprovalRoutes-CIZnVB8w.js";import"./recharts-9jMEgSjc.js";import"./analytics-D_NuuF2U.js";import"./plaid-2mv_ck83.js";import"./dnd-DC_qF3Wr.js";import"./stripe-cKAAJElX.js";import"./lottie-B7_cpoe1.js";import"./lexical-CQoPutFC.js";import"./pdf-CQB-J2hc.js";import"./utils-BykfwIo5.js";import"./routePaths-Kh8F22Sq.js";import"./empty-s0Z9SHTS.js";import"./pdf-lib-CscVz5ta.js";import"./index-DykhB8j2.js";import"./url-C-T2kMoW.js";import"./index-CWFrIv4j.js";import"./decodeURIComponentSafe-B-r3T5bV.js";import"./ReimbursementApprovalRuleDetailScreen-Bj2gRsYN.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="2ec9a3e5-d2ca-4bdd-9b52-57ed608ce169",e._sentryDebugIdIdentifier="sentry-dbid-2ec9a3e5-d2ca-4bdd-9b52-57ed608ce169")}catch{}})();const gt=V.div`
1
+ import{j as o}from"./liveblocks-bqFl_SVp.js";import{a as u}from"./sentry-Bj_fC7Ll.js";import{h as L,g as G,u as U,j as y,s as le,n as Z,i as Q,o as ne,p as v}from"./core-Bnb5S7eF.js";import{bn as De,eZ as P,gt as Me,n8 as re,OD as Te,hJ as he,Ou as Ue,rb as _e,kG as be,n4 as Re,hL as Fe,Ow as Be,Ov as Oe,QW as Ve,zG as ze,F7 as Le,Qv as Ne,QE as $e,c7 as ae,cN as Ge,cO as Ze,bs as Qe,Mv as He,y6 as Je,QX as Ke,Hy as We,EP as Xe,EG as ye,ED as Ye,ya as Se,EJ as Ce,EM as Ie,ES as oe,uw as se,y9 as qe,ki as X,kl as Ae,QY as en,lm as nn,yp as tn,Nm as an,Nn as on,kg as sn,QZ as cn,kj as ln,rF as rn,Nh as dn,Ni as un,rJ as pn,hu as gn,MD as ee,hm as de,hj as mn,hr as fn,ME as hn,ym as bn,Q_ as yn,Q$ as Sn,F4 as Cn,fE as Ee,fG as xe,R0 as In,gh as An,MN as En,yl as ue,gm as pe,gl as xn,yk as vn,gk as wn,gj as kn,R1 as jn,fJ as ve,R2 as Pn,R3 as Dn,ys as Mn,yj as ge,R4 as Tn,fZ as Un,yg as _n,b_ as Rn,c6 as Fn,c5 as Bn,b$ as On,c3 as Vn,c2 as zn,c1 as Ln,c4 as Nn,c0 as $n}from"./zeni-epic-state-GXytJkko.js";import{y as Y,d as O,z as k,ag as we,bR as Gn,g as H,j as Zn,bC as Qn,f as J,B as ie,bS as Hn,i as ke,e as je,bT as Jn,ar as Kn,n as Pe,bU as Wn,bV as Xn,bW as Yn,_ as qn,bX as et,w as nt,bY as tt}from"./index-BzrRJ8WV.js";import{n as V}from"./mui-BAFflVdx.js";import{M as F}from"./MobileAppDrawer-QMY9Y_6M.js";import{a as K,g as W,m as at}from"./accountMappingHelper-DvHt_faU.js";import{t as ot,A as st}from"./AddressScreen-DnnIRcHN.js";import $ from"./NotFoundScreen-Bjgm3Cgg.js";import{g as it}from"./analyticsHelper-DjBKxGVt.js";import{B as ct}from"./BusinessVerificationPageScreen-2yzgn_dq.js";import{C as lt}from"./CompanyPassportScreen-6gSkpDjZ.js";import{u as rt,a as dt}from"./useEmailConnectResultRefresh-C_fGcTHu.js";import{q as me}from"./QBOConnectionScreen-CBR0AZz1.js";import{B as ut}from"./BillPayApprovalRoutes-D6R35wEu.js";import{R as pt}from"./ReimbursementApprovalRoutes-COdNraf8.js";import"./recharts-B3FaT6ex.js";import"./analytics-fzE8ssbj.js";import"./plaid-Il6Pn-tK.js";import"./dnd-BclBZkmc.js";import"./stripe-cKAAJElX.js";import"./lottie-CosVBOrn.js";import"./lexical-DbVLnI8g.js";import"./pdf-Ba7sOjY6.js";import"./utils-BKBg63lI.js";import"./routePaths-iBgwsr_r.js";import"./empty-BXrJtoVu.js";import"./pdf-lib-Sz3Y8uGi.js";import"./index-B9FzYJpE.js";import"./url-CRSVA0N_.js";import"./index-gZ-YqOdE.js";import"./decodeURIComponentSafe-IB5WoVjO.js";import"./ReimbursementApprovalRuleDetailScreen-m4OK96Pp.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="b8157221-ce6b-4f37-a11f-8c092485e3c7",e._sentryDebugIdIdentifier="sentry-dbid-b8157221-ce6b-4f37-a11f-8c092485e3c7")}catch{}})();const gt=V.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -6,7 +6,7 @@ import{j as o}from"./liveblocks-C8AAaKDR.js";import{a as u}from"./sentry-Dfheywa
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,mt=G((function(e,a){return{accountMappingView:a.accountMappingView,isFiling1099FeatureEnabled:a.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:a.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:be(e),isAccountingClassesUpdateInProgress:e.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:_e(e),meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",isCapitalizationFeatureEnabled:a.isCapitalizationFeatureEnabled,capitalizableAccounts:a.capitalizableAccounts,accountNamesById:a.accountNamesById,capitalizableAccountOverrides:a.capitalizableAccountOverrides,isCapitalizationThresholdSaving:a.isCapitalizationThresholdSaving,onSaveCapitalizationAccountThreshold:a.onSaveCapitalizationAccountThreshold}}),(function(e,a){const{navigate:s,location:c,isFiling1099FeatureEnabled:l}=a;return{onAccountMappingChange:n=>{const{uncategorizedAccountSection:t,billsAccountSection:i,reimbursementsAccountSection:p,vendorsAccountSection:m,filing1099Section:f}=n,{incomeAccount:S,expenseAccount:g}=t,{billPayAccount:r}=i,{reimbursementsAccount:b}=p,{prepaidExpensesAccount:I,fixedAssetsAccount:w,accruedExpensesAccount:E}=m,{bankAccount:h,expenseCategory1099:A}=f,_=K(a.accountMappingView.incomeAccountList,S.selectedOption),T=K(a.accountMappingView.expenseAccountList,g.selectedOption),x=K(a.accountMappingView.billPayAccountList,r.selectedOption),F=K(a.accountMappingView.reimbursementsAccountList,b.selectedOption),D=W(a.accountMappingView.prepaidExpensesAccountList,I.selectedOptions),N=W(a.accountMappingView.fixedAssetsAccountList,w.selectedOptions),B=W(a.accountMappingView.accruedExpensesAccountList,E.selectedOptions),d=W(a.accountMappingView.bankAccounts1099FilingAccountList,h.selectedOptions),C=at(a.accountMappingView.expenseAccounts1099FilingAccountList,A),M={selectedIncomeAccountId:_?.accountId,selectedExpenseAccountId:T?.accountId,selectedBillPayAccountId:x?.accountId,selectedReimbursementsAccountId:F?.accountId,selectedPrepaidExpensesAccountIds:D.map((j=>j.accountId)),selectedFixedAssetsAccountIds:N.map((j=>j.accountId)),selectedAccruedExpensesAccountIds:B.map((j=>j.accountId)),selectedBankAccounts1099FilingAccountIds:d.map((j=>j.accountId)),selectedExpenseAccounts1099FilingAccountIds:C};e(Oe({data:M}))},onBackClick:()=>{we(c)===!1?(s("../../dashboard"),e(Be())):e(he())},onSaveClick:()=>{e(Re()),l&&H.track(Gn.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:n=>{e(Fe(a.currentTenant.companyId,n))}}}))(Qn),ft=()=>{const e=L(),a=Q(),s=U(),{useFeatureGate:c,useDynamicConfig:l}=Y(),{isFeatureEnabled:n}=c(O.isFiling1099FeatureEnabled),{isFeatureEnabled:t}=c(O.isScheduledJEAccruedExpensesFeatureEnabled),{configValue:i,isDynamicConfigLoading:p}=l("transaction_categorization_config"),m=!p&&i?.capitalization_enabled===!0,f=k.getSignedInUser(),S=De(f),g=y((d=>P(d))),{capitalizableAccounts:r,capitalizableAccountOverrides:b,isCapitalizationThresholdSaving:I,currencySymbol:w}=y((d=>{const C=d.tenantState.currentTenantId,M=C!=null?d.tenantState.tenantsById[C]:void 0,j=Te(d.companyState,g.companyId);return{capitalizableAccounts:M?.capitalizableAccounts??null,capitalizableAccountOverrides:M?.capitalizableAccountOverrides??null,isCapitalizationThresholdSaving:d.companyViewState.passportView?.capitalizationThresholdUpdateStatus?.fetchState==="In-Progress",currencySymbol:j?.company.companyLocaleInfo?.currencySymbol??"$"}}),le),E=u.useCallback(((d,C)=>{s(re(g.companyId,d,C))}),[s,g.companyId]),h=u.useCallback((d=>{const C={...b??{}},M=Object.entries(d);for(const[z,ce]of M)ce===null?delete C[z]:C[z]=ce;const[j,q]=M[0]??[];j!=null&&s(re(g.companyId,j,q,void 0,Object.keys(C).length>0?C:null))}),[s,g.companyId,b]),A=y((d=>Me(d.accountState)),le),_=u.useMemo((()=>{const d={};for(const C of A)C.accountId!=null&&C.accountName!=null&&(d[C.accountId]=C.accountName);return d}),[A]),[T,x]=u.useState(!1),[F,D]=u.useState(!1);u.useEffect((()=>{T===!1&&(s(he()),x(!0))}),[T]);const N=y((d=>Ue(d))),B=d=>{D(d)};return o.jsxs(gt,{children:[o.jsx(R,{isAppContentDrawerOpen:F,handleDrawerToggle:B}),o.jsx(mt,{currentTenant:g,navigate:e,accountMappingView:N,isFiling1099FeatureEnabled:n&&S,isAccruedExpensesFeatureEnabled:t,isCapitalizationFeatureEnabled:m,capitalizableAccounts:r,accountNamesById:_,capitalizableAccountOverrides:b,currencySymbol:w,isCapitalizationThresholdSaving:I,onSaveCapitalizationAccountThreshold:E,onSaveCapitalizationAccountThresholds:h,location:a,isSettings:we(a),onClickMenuIcon:()=>B(!0)})]})},ht=V.div`
9
+ `,mt=Z((function(e,a){return{accountMappingView:a.accountMappingView,isFiling1099FeatureEnabled:a.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:a.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:be(e),isAccountingClassesUpdateInProgress:e.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:_e(e),meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",isCapitalizationFeatureEnabled:a.isCapitalizationFeatureEnabled,capitalizableAccounts:a.capitalizableAccounts,accountNamesById:a.accountNamesById,capitalizableAccountOverrides:a.capitalizableAccountOverrides,isCapitalizationThresholdSaving:a.isCapitalizationThresholdSaving,onSaveCapitalizationAccountThreshold:a.onSaveCapitalizationAccountThreshold}}),(function(e,a){const{navigate:s,location:c,isFiling1099FeatureEnabled:l}=a;return{onAccountMappingChange:n=>{const{uncategorizedAccountSection:t,billsAccountSection:i,reimbursementsAccountSection:p,vendorsAccountSection:m,filing1099Section:f}=n,{incomeAccount:S,expenseAccount:g}=t,{billPayAccount:r}=i,{reimbursementsAccount:b}=p,{prepaidExpensesAccount:I,fixedAssetsAccount:w,accruedExpensesAccount:E}=m,{bankAccount:h,expenseCategory1099:A}=f,_=K(a.accountMappingView.incomeAccountList,S.selectedOption),M=K(a.accountMappingView.expenseAccountList,g.selectedOption),x=K(a.accountMappingView.billPayAccountList,r.selectedOption),R=K(a.accountMappingView.reimbursementsAccountList,b.selectedOption),D=W(a.accountMappingView.prepaidExpensesAccountList,I.selectedOptions),N=W(a.accountMappingView.fixedAssetsAccountList,w.selectedOptions),B=W(a.accountMappingView.accruedExpensesAccountList,E.selectedOptions),d=W(a.accountMappingView.bankAccounts1099FilingAccountList,h.selectedOptions),C=at(a.accountMappingView.expenseAccounts1099FilingAccountList,A),T={selectedIncomeAccountId:_?.accountId,selectedExpenseAccountId:M?.accountId,selectedBillPayAccountId:x?.accountId,selectedReimbursementsAccountId:R?.accountId,selectedPrepaidExpensesAccountIds:D.map((j=>j.accountId)),selectedFixedAssetsAccountIds:N.map((j=>j.accountId)),selectedAccruedExpensesAccountIds:B.map((j=>j.accountId)),selectedBankAccounts1099FilingAccountIds:d.map((j=>j.accountId)),selectedExpenseAccounts1099FilingAccountIds:C};e(Oe({data:T}))},onBackClick:()=>{we(c)===!1?(s("../../dashboard"),e(Be())):e(he())},onSaveClick:()=>{e(Fe()),l&&H.track(Zn.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:n=>{e(Re(a.currentTenant.companyId,n))}}}))(Gn),ft=()=>{const e=L(),a=G(),s=U(),{useFeatureGate:c,useDynamicConfig:l}=Y(),{isFeatureEnabled:n}=c(O.isFiling1099FeatureEnabled),{isFeatureEnabled:t}=c(O.isScheduledJEAccruedExpensesFeatureEnabled),{configValue:i,isDynamicConfigLoading:p}=l("transaction_categorization_config"),m=!p&&i?.capitalization_enabled===!0,f=k.getSignedInUser(),S=De(f),g=y((d=>P(d))),{capitalizableAccounts:r,capitalizableAccountOverrides:b,isCapitalizationThresholdSaving:I,currencySymbol:w}=y((d=>{const C=d.tenantState.currentTenantId,T=C!=null?d.tenantState.tenantsById[C]:void 0,j=Me(d.companyState,g.companyId);return{capitalizableAccounts:T?.capitalizableAccounts??null,capitalizableAccountOverrides:T?.capitalizableAccountOverrides??null,isCapitalizationThresholdSaving:d.companyViewState.passportView?.capitalizationThresholdUpdateStatus?.fetchState==="In-Progress",currencySymbol:j?.company.companyLocaleInfo?.currencySymbol??"$"}}),le),E=u.useCallback(((d,C)=>{s(re(g.companyId,d,C))}),[s,g.companyId]),h=u.useCallback((d=>{const C={...b??{}},T=Object.entries(d);for(const[z,ce]of T)ce===null?delete C[z]:C[z]=ce;const[j,q]=T[0]??[];j!=null&&s(re(g.companyId,j,q,void 0,Object.keys(C).length>0?C:null))}),[s,g.companyId,b]),A=y((d=>Te(d.accountState)),le),_=u.useMemo((()=>{const d={};for(const C of A)C.accountId!=null&&C.accountName!=null&&(d[C.accountId]=C.accountName);return d}),[A]),[M,x]=u.useState(!1),[R,D]=u.useState(!1);u.useEffect((()=>{M===!1&&(s(he()),x(!0))}),[M]);const N=y((d=>Ue(d))),B=d=>{D(d)};return o.jsxs(gt,{children:[o.jsx(F,{isAppContentDrawerOpen:R,handleDrawerToggle:B}),o.jsx(mt,{currentTenant:g,navigate:e,accountMappingView:N,isFiling1099FeatureEnabled:n&&S,isAccruedExpensesFeatureEnabled:t,isCapitalizationFeatureEnabled:m,capitalizableAccounts:r,accountNamesById:_,capitalizableAccountOverrides:b,currencySymbol:w,isCapitalizationThresholdSaving:I,onSaveCapitalizationAccountThreshold:E,onSaveCapitalizationAccountThresholds:h,location:a,isSettings:we(a),onClickMenuIcon:()=>B(!0)})]})},ht=V.div`
10
10
  display: flex;
11
11
  height: 100%;
12
12
  width: 100%;
@@ -14,7 +14,7 @@ import{j as o}from"./liveblocks-C8AAaKDR.js";import{a as u}from"./sentry-Dfheywa
14
14
  flex-direction: column;
15
15
  align-items: center;
16
16
  background-color: ${e=>e.theme.colors.grey4};
17
- `,bt=G((function(e,a){const s=P(e),c=Ne(e),l=$e(e),n=a.roleMap.bill_pay_admin;return{isDisabled:(ae(s?.userRole??[])||n)&&"readonly",billpayApprovalView:c,remiApproverView:l,analytics:H}}),(function(e,a){const{navigate:s,currentTenant:c}=a;return{onSetupApprovalRulesBillPaySectionClick:()=>{s("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{s("reimbursements/approval-rules")},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}}))(Hn),yt=()=>{const e=L(),a=Q(),s=U(),{tenantEmailDomain:c}=Z(),[l,n]=u.useState(!1),[t,i]=u.useState(!1),[p,m]=u.useState(!1),f=y((A=>P(A))),S=y((A=>A.billPaySetupApproverViewState.fetchState)),g=y((A=>A.remiSetupApproverViewState.fetchState)),r=y((A=>Ve(A))),{isApprovalRulesV3Enabled:b,isLoading:I}=Zn(f?.tenantId),w=f.companyId??k.getSignedInUserTenant(c)?.companyId;if(k.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const E=J();u.useEffect((()=>{p||S!=="Not-Started"||I||(m(!0),s(ze(!0,!0,b)))}),[p,S,I,b,s]),u.useEffect((()=>{t||g!=="Not-Started"||I||(i(!0),s(Le(!0,!1,!1,b)))}),[t,g,I,b,s]);const h=A=>{n(A)};return E?.loggedInUserRoleMap!=null?o.jsxs(ht,{children:[o.jsx(R,{isAppContentDrawerOpen:l,handleDrawerToggle:h}),o.jsx(bt,{navigate:e,location:a,companyId:w,currentTenant:f,roleMap:E.loggedInUserRoleMap,onClickMenuIcon:()=>{h(!0)}})]}):o.jsx(ie,{fetchState:r.fetchState})},St=V.div`
17
+ `,bt=Z((function(e,a){const s=P(e),c=Ne(e),l=$e(e),n=a.roleMap.bill_pay_admin;return{isDisabled:(ae(s?.userRole??[])||n)&&"readonly",billpayApprovalView:c,remiApproverView:l,analytics:H}}),(function(e,a){const{navigate:s,currentTenant:c}=a;return{onSetupApprovalRulesBillPaySectionClick:()=>{s("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{s("reimbursements/approval-rules")},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}}))(Hn),yt=()=>{const e=L(),a=G(),s=U(),{tenantEmailDomain:c}=Q(),[l,n]=u.useState(!1),[t,i]=u.useState(!1),[p,m]=u.useState(!1),f=y((A=>P(A))),S=y((A=>A.billPaySetupApproverViewState.fetchState)),g=y((A=>A.remiSetupApproverViewState.fetchState)),r=y((A=>Ve(A))),{isApprovalRulesV3Enabled:b,isLoading:I}=Qn(f?.tenantId),w=f.companyId??k.getSignedInUserTenant(c)?.companyId;if(k.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const E=J();u.useEffect((()=>{p||S!=="Not-Started"||I||(m(!0),s(ze(!0,!0,b)))}),[p,S,I,b,s]),u.useEffect((()=>{t||g!=="Not-Started"||I||(i(!0),s(Le(!0,!1,!1,b)))}),[t,g,I,b,s]);const h=A=>{n(A)};return E?.loggedInUserRoleMap!=null?o.jsxs(ht,{children:[o.jsx(F,{isAppContentDrawerOpen:l,handleDrawerToggle:h}),o.jsx(bt,{navigate:e,location:a,companyId:w,currentTenant:f,roleMap:E.loggedInUserRoleMap,onClickMenuIcon:()=>{h(!0)}})]}):o.jsx(ie,{fetchState:r.fetchState})},St=V.div`
18
18
  display: flex;
19
19
  height: 100%;
20
20
  width: 100%;
@@ -22,7 +22,7 @@ import{j as o}from"./liveblocks-C8AAaKDR.js";import{a as u}from"./sentry-Dfheywa
22
22
  flex-direction: column;
23
23
  align-items: center;
24
24
  background-color: ${e=>e.theme.colors.grey4};
25
- `,Ct=G((function(e,a){const{companyId:s,isZeniAccountEnabled:c,isChargeCardEnabled:l,isBillPayEnabled:n,isRemiEnabled:t,isTreasuryEnabled:i}=a,p=P(e);return{bankSetupView:Ke(e,s,n,t,c,l,i),connectedAccountProvider:p.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:H}}),(function(e,a){const{navigate:s,currentTenant:c,companyId:l}=a;return{onFetchLinkTokenClick:(n,t,i)=>{e(se(t,n,i))},onEstablishConnectionClick:(n,t,i)=>{e(oe(n,l,t,i))},onUpdatePaymentAccountStatus:(n,t,i,p,m)=>{e(Ie(n,t,m,p,i))},onUpdatePaymentAccountLoginStatus:(n,t,i,p)=>{e(Ce(!1,n,p,i,t))},onEstablishConnectionSuccess:(n,t)=>{e(Se(t,n))},onUpdateAccountClick:(n,t,i,p,m)=>{e(m==="paymentAccount"?ye(n,t,i,p):Ye(p,n,t))},onUpdatePrimaryFundingAccount:(n,t,i)=>{e(Xe(l,t,n,i))},onRemoveConnection:n=>{e(We(n))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}}))(Jn),It=()=>{const e=L(),a=Q(),s=U(),{tenantEmailDomain:c}=Z(),l=J(),{useFeatureGate:n}=Y(),{isFeatureEnabled:t}=n(O.isChargeCardFeatureEnabled),{isFeatureEnabled:i}=n(O.isDebitCardFeatureEnabled),[p,m]=u.useState(!1),[f,S]=u.useState(!1),g=y((D=>P(D))),r=y((D=>D.settingsViewState.bankConnection.fetchState)),b=Qe(g,l?.loggedInUserRoleMap),I=Ge(g,l?.loggedInUserRoleMap),w=g?.userRole!=null&&Ze(g.userRole),E=!!g.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!w,h=g.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!w,A=ke(g,t,i),_=He(g,l?.loggedInUserRoleMap)&&A,{isCardsHidden:T}=je(g?.tenantId),x=g.companyId??k.getSignedInUserTenant(c)?.companyId;if(k.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");u.useEffect((()=>{f||r==="Completed"||(S(!0),s(Je(!1)))}),[f,s,r]);const F=D=>{m(D)};return b||E||I||_?o.jsxs(St,{children:[o.jsx(R,{isAppContentDrawerOpen:p,handleDrawerToggle:F}),o.jsx(Ct,{navigate:e,location:a,companyId:x,currentTenant:g,roleMap:l.loggedInUserRoleMap,isBillPayEnabled:b,isRemiEnabled:I,isZeniAccountEnabled:E,isChargeCardEnabled:_,isChargeCardsHidden:T,isTreasuryEnabled:h,onClickMenuIcon:()=>{F(!0)}})]}):o.jsx($,{})},At=V.div`
25
+ `,Ct=Z((function(e,a){const{companyId:s,isZeniAccountEnabled:c,isChargeCardEnabled:l,isBillPayEnabled:n,isRemiEnabled:t,isTreasuryEnabled:i}=a,p=P(e);return{bankSetupView:Ke(e,s,n,t,c,l,i),connectedAccountProvider:p.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:H}}),(function(e,a){const{navigate:s,currentTenant:c,companyId:l}=a;return{onFetchLinkTokenClick:(n,t,i)=>{e(se(t,n,i))},onEstablishConnectionClick:(n,t,i)=>{e(oe(n,l,t,i))},onUpdatePaymentAccountStatus:(n,t,i,p,m)=>{e(Ie(n,t,m,p,i))},onUpdatePaymentAccountLoginStatus:(n,t,i,p)=>{e(Ce(!1,n,p,i,t))},onEstablishConnectionSuccess:(n,t)=>{e(Se(t,n))},onUpdateAccountClick:(n,t,i,p,m)=>{e(m==="paymentAccount"?ye(n,t,i,p):Ye(p,n,t))},onUpdatePrimaryFundingAccount:(n,t,i)=>{e(Xe(l,t,n,i))},onRemoveConnection:n=>{e(We(n))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}}))(Jn),It=()=>{const e=L(),a=G(),s=U(),{tenantEmailDomain:c}=Q(),l=J(),{useFeatureGate:n}=Y(),{isFeatureEnabled:t}=n(O.isChargeCardFeatureEnabled),{isFeatureEnabled:i}=n(O.isDebitCardFeatureEnabled),[p,m]=u.useState(!1),[f,S]=u.useState(!1),g=y((D=>P(D))),r=y((D=>D.settingsViewState.bankConnection.fetchState)),b=Ge(g,l?.loggedInUserRoleMap),I=Ze(g,l?.loggedInUserRoleMap),w=g?.userRole!=null&&Qe(g.userRole),E=!!g.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!w,h=g.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!w,A=ke(g,t,i),_=He(g,l?.loggedInUserRoleMap)&&A,{isCardsHidden:M}=je(g?.tenantId),x=g.companyId??k.getSignedInUserTenant(c)?.companyId;if(k.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");u.useEffect((()=>{f||r==="Completed"||(S(!0),s(Je(!1)))}),[f,s,r]);const R=D=>{m(D)};return b||E||I||_?o.jsxs(St,{children:[o.jsx(F,{isAppContentDrawerOpen:p,handleDrawerToggle:R}),o.jsx(Ct,{navigate:e,location:a,companyId:x,currentTenant:g,roleMap:l.loggedInUserRoleMap,isBillPayEnabled:b,isRemiEnabled:I,isZeniAccountEnabled:E,isChargeCardEnabled:_,isChargeCardsHidden:M,isTreasuryEnabled:h,onClickMenuIcon:()=>{R(!0)}})]}):o.jsx($,{})},At=V.div`
26
26
  display: flex;
27
27
  height: 100%;
28
28
  width: 100%;
@@ -30,7 +30,7 @@ import{j as o}from"./liveblocks-C8AAaKDR.js";import{a as u}from"./sentry-Dfheywa
30
30
  flex-direction: column;
31
31
  align-items: center;
32
32
  background-color: ${e=>e.theme.colors.grey4};
33
- `,Et=G((function(e,a){const{companyId:s}=a,c=P(e),l=a.roleMap.bill_pay_admin,n=en(e,s),{uiState:t}=n,i=(ae(c?.userRole??[])||l)&&n.setupView.accountFetchStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.accountUpdateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{billingSetupView:n,uiState:t,stripeKey:Pe.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:i,analytics:H}}),(function(e,a){const{navigate:s,currentTenant:c,companyId:l}=a;return{onFetchLinkTokenClick:(n,t)=>{e(se("billing_setup",n,t))},onEstablishConnectionClick:n=>{e(oe(n,l,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(Se("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,t,i)=>{e(Ie(n,t,"billing","billing_setup",i))},onUpdatePaymentAccountLoginStatus:(n,t)=>{e(Ce(!1,n,"billing","billing_setup",t))},onUpdateAccountClick:(n,t)=>{e(ye(n,t,"billing","billing_setup"))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")},handleCreateCardSetupIntent:n=>{e(Ae(n))},handleConfirmCardSetupIntent:n=>{e(ln(n))},updateCardPaymentModalState:n=>{e(cn({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,t,i)=>{e(sn(n,t,i))},handleFetchPaymentSources:()=>{e(X())},resetCardPaymentViewState:()=>{e(on())},handleResetCardPaymentErrorStatuses:()=>{e(an())},onBillingAddressSave:n=>{e(tn(n))},onAddressEditHandler:n=>{if(n!=null){const t=ot(n);e(nn({addressType:"subscription_billing_address",addressToCreate:t}))}}}}))(Wn),xt=()=>{const e=L(),a=Q(),s=U(),{tenantEmailDomain:c}=Z(),[l,n]=u.useState(!1),[t,i]=u.useState(!1),[p,m]=u.useState(!1),f=y((h=>P(h))),S=y((h=>h.cardPaymentViewState)),g=y((h=>h.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState)),r=Kn(S.addCardPaymentSourceStatus.fetchState),b=S.addCardPaymentSourceStatus.fetchState,I=f.companyId??k.getSignedInUserTenant(c)?.companyId;if(k.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const w=J();u.useEffect((()=>{I!=null&&s(qe(I,!1))}),[I,s]),u.useEffect((()=>{t||(i(!0),s(X()))}),[t,s]),u.useEffect((()=>{p||(Ae(["card"]),m(!0))}),[p]),u.useEffect((()=>{r==="In-Progress"&&b==="Completed"&&s(X())}),[r,b]);const E=h=>{n(h)};return w?.loggedInUserRoleMap!=null?o.jsxs(At,{children:[o.jsx(R,{isAppContentDrawerOpen:l,handleDrawerToggle:E}),o.jsx(Et,{navigate:e,location:a,companyId:I,currentTenant:f,roleMap:w.loggedInUserRoleMap,onClickMenuIcon:()=>{E(!0)},googleAPIKey:Pe.googleMapsAPIKey})]}):o.jsx(ie,{fetchState:g})},te="external_integrations",vt=G((function(e){const a=un(e,te);return{meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",notifyMeRegisteredSlugs:new Set(a.map((s=>s.additionalInfo)).filter((s=>s!=null)))}}),(function(e,a){const{navigate:s,integrationsView:c,signedInUserEmail:l,tenantEmailDomain:n,tenantId:t}=a;return{onBackClick:()=>{s("../")},onNavigateToDashboard:()=>{s("../dashboard")},onReconnectQBO:()=>{me.init("/connection/auth",n),me.handleClick()},onRefreshClick:()=>{c.integrations.refreshQBO.fetchState!=="In-Progress"&&e(bn())},onSaveChargeBeeCredentials:(i,p)=>{const m=c.externalConnections?.revenue?.find((f=>f.connectionName==="chargebee"))?.connectionId;m!=null&&e(fn(t,m,ee("revenue"),hn("chargebee"),{api_key:i,site:p}))},onConnectHubSpot:(i,p)=>{const m=c.externalConnections?.revenue?.find((f=>f.connectionName==="hubspot"))?.connectionId;if(m!=null){const f=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:i,client_secret:p,connection_id:m,redirect_uri:f,tenant_id:t}));const S="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(i)}&scope=${encodeURIComponent(S)}&redirect_uri=${encodeURIComponent(f)}`}},onDisconnect:(i,p)=>{e(mn(t,i,ee(p)))},onConnectGmail:()=>{e(de(t,"gmail",window.location.href))},onConnectOutlook:()=>{e(de(t,"outlook",window.location.href))},onSaveConnectorCredentials:i=>{e(gn(t,ee("payments"),i))},onNotifyMe:i=>{H.trackIntegrationsNotifyMeClicked("Settings",i),e(pn(te,i,l))}}}))(Xn),wt=()=>{const e=L(),a=U(),{tenantEmailDomain:s}=Z();rt();const[c,l]=u.useState(!1),n=y((h=>h.tenantState.fetchState)),t=y((h=>P(h))),i=t.companyId??k.getSignedInUserTenant(s)?.companyId,p=k.getSignedInUser(),m=J(),f=ae(t.userRole??[]);if(p==null)throw Error("Can't access Integrations page without signing in...");u.useEffect((()=>{a(rn(te))}),[a]);const[S,g]=u.useState(!1);u.useEffect((()=>{S||(g(!0),a(X()))}),[S,a]);const r=h=>{l(h)},b=y((h=>dn(h,i))),I=y((h=>h.plaidAccountViewState.external_account.plaidConnectionDetails)),{plaidAccounts:w,onAddPlaidAccount:E}=dt({companyId:i??t.companyId});return m?.loggedInUserRoleMap!=null?o.jsxs(kt,{children:[o.jsx(R,{isAppContentDrawerOpen:c,handleDrawerToggle:r}),o.jsx(vt,{navigate:e,onClickMenuIcon:()=>{r(!0)},isAdmin:f,integrationsView:b,signedInUserEmail:p.userEmail??"",tenantEmailDomain:t.tenantEmailDomain??s??"",tenantId:t.tenantId,saveChargeBeeState:b.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:b.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:b.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:b.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:b.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(b.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map((([h,A])=>[h,A?.message]))),deleteConnectionState:b.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:b.externalConnections?.deleteConnectionError?.message,isLoading:n==="In-Progress",plaidAccounts:w,onAddPlaidAccount:E,plaidConnectionDetails:I})]}):o.jsx(ie,{fetchState:n})},kt=V.div`
33
+ `,Et=Z((function(e,a){const{companyId:s}=a,c=P(e),l=a.roleMap.bill_pay_admin,n=en(e,s),{uiState:t}=n,i=(ae(c?.userRole??[])||l)&&n.setupView.accountFetchStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.accountUpdateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{billingSetupView:n,uiState:t,stripeKey:Pe.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:i,analytics:H}}),(function(e,a){const{navigate:s,currentTenant:c,companyId:l}=a;return{onFetchLinkTokenClick:(n,t)=>{e(se("billing_setup",n,t))},onEstablishConnectionClick:n=>{e(oe(n,l,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(Se("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,t,i)=>{e(Ie(n,t,"billing","billing_setup",i))},onUpdatePaymentAccountLoginStatus:(n,t)=>{e(Ce(!1,n,"billing","billing_setup",t))},onUpdateAccountClick:(n,t)=>{e(ye(n,t,"billing","billing_setup"))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")},handleCreateCardSetupIntent:n=>{e(Ae(n))},handleConfirmCardSetupIntent:n=>{e(ln(n))},updateCardPaymentModalState:n=>{e(cn({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,t,i)=>{e(sn(n,t,i))},handleFetchPaymentSources:()=>{e(X())},resetCardPaymentViewState:()=>{e(on())},handleResetCardPaymentErrorStatuses:()=>{e(an())},onBillingAddressSave:n=>{e(tn(n))},onAddressEditHandler:n=>{if(n!=null){const t=ot(n);e(nn({addressType:"subscription_billing_address",addressToCreate:t}))}}}}))(Wn),xt=()=>{const e=L(),a=G(),s=U(),{tenantEmailDomain:c}=Q(),[l,n]=u.useState(!1),[t,i]=u.useState(!1),[p,m]=u.useState(!1),f=y((h=>P(h))),S=y((h=>h.cardPaymentViewState)),g=y((h=>h.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState)),r=Kn(S.addCardPaymentSourceStatus.fetchState),b=S.addCardPaymentSourceStatus.fetchState,I=f.companyId??k.getSignedInUserTenant(c)?.companyId;if(k.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const w=J();u.useEffect((()=>{I!=null&&s(qe(I,!1))}),[I,s]),u.useEffect((()=>{t||(i(!0),s(X()))}),[t,s]),u.useEffect((()=>{p||(Ae(["card"]),m(!0))}),[p]),u.useEffect((()=>{r==="In-Progress"&&b==="Completed"&&s(X())}),[r,b]);const E=h=>{n(h)};return w?.loggedInUserRoleMap!=null?o.jsxs(At,{children:[o.jsx(F,{isAppContentDrawerOpen:l,handleDrawerToggle:E}),o.jsx(Et,{navigate:e,location:a,companyId:I,currentTenant:f,roleMap:w.loggedInUserRoleMap,onClickMenuIcon:()=>{E(!0)},googleAPIKey:Pe.googleMapsAPIKey})]}):o.jsx(ie,{fetchState:g})},te="external_integrations",vt=Z((function(e){const a=un(e,te);return{meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",notifyMeRegisteredSlugs:new Set(a.map((s=>s.additionalInfo)).filter((s=>s!=null)))}}),(function(e,a){const{navigate:s,integrationsView:c,signedInUserEmail:l,tenantEmailDomain:n,tenantId:t}=a;return{onBackClick:()=>{s("../")},onNavigateToDashboard:()=>{s("../dashboard")},onReconnectQBO:()=>{me.init("/connection/auth",n),me.handleClick()},onRefreshClick:()=>{c.integrations.refreshQBO.fetchState!=="In-Progress"&&e(bn())},onSaveChargeBeeCredentials:(i,p)=>{const m=c.externalConnections?.revenue?.find((f=>f.connectionName==="chargebee"))?.connectionId;m!=null&&e(fn(t,m,ee("revenue"),hn("chargebee"),{api_key:i,site:p}))},onConnectHubSpot:(i,p)=>{const m=c.externalConnections?.revenue?.find((f=>f.connectionName==="hubspot"))?.connectionId;if(m!=null){const f=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:i,client_secret:p,connection_id:m,redirect_uri:f,tenant_id:t}));const S="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(i)}&scope=${encodeURIComponent(S)}&redirect_uri=${encodeURIComponent(f)}`}},onDisconnect:(i,p)=>{e(mn(t,i,ee(p)))},onConnectGmail:()=>{e(de(t,"gmail",window.location.href))},onConnectOutlook:()=>{e(de(t,"outlook",window.location.href))},onSaveConnectorCredentials:i=>{e(gn(t,ee("payments"),i))},onNotifyMe:i=>{H.trackIntegrationsNotifyMeClicked("Settings",i),e(pn(te,i,l))}}}))(Xn),wt=()=>{const e=L(),a=U(),{tenantEmailDomain:s}=Q();rt();const[c,l]=u.useState(!1),n=y((h=>h.tenantState.fetchState)),t=y((h=>P(h))),i=t.companyId??k.getSignedInUserTenant(s)?.companyId,p=k.getSignedInUser(),m=J(),f=ae(t.userRole??[]);if(p==null)throw Error("Can't access Integrations page without signing in...");u.useEffect((()=>{a(rn(te))}),[a]);const[S,g]=u.useState(!1);u.useEffect((()=>{S||(g(!0),a(X()))}),[S,a]);const r=h=>{l(h)},b=y((h=>dn(h,i))),I=y((h=>h.plaidAccountViewState.external_account.plaidConnectionDetails)),{plaidAccounts:w,onAddPlaidAccount:E}=dt({companyId:i??t.companyId});return m?.loggedInUserRoleMap!=null?o.jsxs(kt,{children:[o.jsx(F,{isAppContentDrawerOpen:c,handleDrawerToggle:r}),o.jsx(vt,{navigate:e,onClickMenuIcon:()=>{r(!0)},isAdmin:f,integrationsView:b,signedInUserEmail:p.userEmail??"",tenantEmailDomain:t.tenantEmailDomain??s??"",tenantId:t.tenantId,saveChargeBeeState:b.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:b.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:b.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:b.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:b.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(b.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map((([h,A])=>[h,A?.message]))),deleteConnectionState:b.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:b.externalConnections?.deleteConnectionError?.message,isLoading:n==="In-Progress",plaidAccounts:w,onAddPlaidAccount:E,plaidConnectionDetails:I})]}):o.jsx(ie,{fetchState:n})},kt=V.div`
34
34
  display: flex;
35
35
  height: 100%;
36
36
  width: 100%;
@@ -46,7 +46,7 @@ import{j as o}from"./liveblocks-C8AAaKDR.js";import{a as u}from"./sentry-Dfheywa
46
46
  flex-direction: column;
47
47
  align-items: center;
48
48
  background-color: ${e=>e.theme.colors.grey4};
49
- `,Pt=()=>{const e=U(),{tenantEmailDomain:a}=Z(),[s,c]=u.useState(!1),l=y((r=>P(r))).companyId??k.getSignedInUserTenant(a)?.companyId,n=k.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const t=y((r=>yn(r,n.userId))),i=y((r=>Sn(r,l,"bill_pay","user_reimbursement_account"))),{plaidConnectionDetails:p}=i,m=r=>{c(r)},f=u.useCallback((r=>{e(se("user_reimbursement_account",r))}),[]),S=u.useCallback((r=>{e(oe(r,l,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))}),[]);u.useEffect((()=>{t.fetchState!=="Completed"&&t.fetchState!=="In-Progress"&&e(Cn(n.userId))}),[n.userId,t.fetchState]);const g=t.fetchState==="Not-Started"||t.fetchState==="In-Progress";return o.jsxs(jt,{children:[o.jsx(R,{isAppContentDrawerOpen:s,handleDrawerToggle:m}),o.jsx(Yn,{plaidConnectionDetails:p,isLoading:g,myBankConnectionsView:t,onFetchLinkTokenClick:f,onEstablishConnectionClick:S,onClickMenuIcon:()=>{m(!0)}})]})},Dt=V.div`
49
+ `,Pt=()=>{const e=U(),{tenantEmailDomain:a}=Q(),[s,c]=u.useState(!1),l=y((r=>P(r))).companyId??k.getSignedInUserTenant(a)?.companyId,n=k.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const t=y((r=>yn(r,n.userId))),i=y((r=>Sn(r,l,"bill_pay","user_reimbursement_account"))),{plaidConnectionDetails:p}=i,m=r=>{c(r)},f=u.useCallback((r=>{e(se("user_reimbursement_account",r))}),[]),S=u.useCallback((r=>{e(oe(r,l,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))}),[]);u.useEffect((()=>{t.fetchState!=="Completed"&&t.fetchState!=="In-Progress"&&e(Cn(n.userId))}),[n.userId,t.fetchState]);const g=t.fetchState==="Not-Started"||t.fetchState==="In-Progress";return o.jsxs(jt,{children:[o.jsx(F,{isAppContentDrawerOpen:s,handleDrawerToggle:m}),o.jsx(Yn,{plaidConnectionDetails:p,isLoading:g,myBankConnectionsView:t,onFetchLinkTokenClick:f,onEstablishConnectionClick:S,onClickMenuIcon:()=>{m(!0)}})]})},Dt=V.div`
50
50
  display: flex;
51
51
  height: 100%;
52
52
  width: 100%;
@@ -54,4 +54,4 @@ import{j as o}from"./liveblocks-C8AAaKDR.js";import{a as u}from"./sentry-Dfheywa
54
54
  flex-direction: column;
55
55
  align-items: center;
56
56
  background-color: ${e=>e.theme.colors.grey4};
57
- `,fe=({appContent:e})=>{const a=U(),s=L(),c=Q(),[l,n]=u.useState(!1),t=y((d=>P(d))),{tenantEmailDomain:i}=t,p=t.companyId??k.getSignedInUserTenant(i)?.companyId;if(k.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:m}=Y(),f=!!t.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:S}=m(O.isChargeCardFeatureEnabled),{isFeatureEnabled:g}=m(O.isDebitCardFeatureEnabled),r=t.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",b=y((d=>be(d))),I=Ee(t),w=xe(g,t),E=!w&&b,h=ke(t,S,g),{isCardsHidden:A}=je(t?.tenantId),_=!h||A,{areTenantIdsInSync:T}=qn();u.useEffect((()=>{T&&a(In(p,E))}),[p,a,E,T]);const x=y((d=>An(d,E))),F=x.fetchState==="Not-Started"||x.fetchState==="In-Progress"||p==null,D=En(t),N=!!t.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,B=d=>{n(d)};return o.jsxs(Dt,{children:[o.jsx(R,{isAppContentDrawerOpen:l,handleDrawerToggle:B}),e!=null?o.jsx(o.Fragment,{children:e}):o.jsx(et,{myProfileView:x,isAccountingClassesEnabled:b,isReimbursementDisabled:N===!1,isZeniAccountsDisabled:f===!1,isChargeCardDisabled:_,isTreasuryDisabled:r===!1,isLiteRoleDisabled:D===!1,onClickMenuIcon:()=>{B(!0)},isLoading:F,isBankingOnlyTenant:w,isCardsOnlyTenant:I,onAddressClick:d=>{const C=(function(j,q){let z=`/${j}/settings/my_profile`;return z=z.concat(`/new/${q}`),z})(i,d),M=nt(c.state?.pathnameStackToGoBack,c.pathname);s(C,{state:{pathnameStackToGoBack:M}})},onGetOtp:d=>{const C={...x.myProfileLocalData,phone:d};a(ue({localData:C})),a(kn(d,"MyProfile"))},onResendOtp:d=>{a(wn(d,"MyProfile"))},onCancelClick:()=>{a(vn())},onSaveClick:()=>{a(pe("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},onVerifyOtp:(d,C)=>{a(xn(d,C,"MyProfile"))},onVerifyOtpSuccess:d=>{d!=null&&k.saveZeniOtpToken(d),a(pe("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},updateMyProfileLocalData:d=>{a(ue({localData:d}))}})]})};function Tt(){const e=U(),a=y((r=>P(r))).companyId,s=y((r=>jn(r))),c=y((r=>ve(r))),l=k.getSignedInUser(),[n,t]=u.useState(!1),i=u.useCallback((r=>{t(r)}),[]),p=u.useCallback((r=>{e(Pn(r))}),[]),m=u.useCallback((()=>{l?.userEmail!=null&&e(Dn({loggedInUserEmail:l.userEmail}))}),[l?.userEmail]),f=u.useCallback((()=>{e(Tn())}),[]);if(l==null)throw Error("Can't access Notification Settings page without signing in...");const S=u.useCallback((()=>{const r=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ge(r,a))}),[a,c.notificationSettings.monthEndInsightsNotificationSettings.enabled]),g=u.useCallback((()=>{e(Mn())}),[]);return u.useEffect((()=>{if(c.fetchState==="Completed"&&s.fetchState!=="In-Progress"&&s.fetchState!=="Completed"){const r=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ge(r,a))}}),[s.fetchState,a,c.notificationSettings.monthEndInsightsNotificationSettings.enabled,c.fetchState]),o.jsxs(o.Fragment,{children:[o.jsx(R,{isAppContentDrawerOpen:n,handleDrawerToggle:i}),o.jsx(tt,{notificationSettingsView:s,onFormDataChange:p,onCancel:m,onSave:f,onClickMenuIcon:()=>{i(!0)},signedInUser:l,onRefresh:S,resetUpdateStatus:g})]})}function ga(e){const[a,s]=u.useState(!1),c=y((r=>ve(r))),l=y((r=>P(r))),n=J(),t=k.getSignedInUser(),i=U(),{useFeatureGate:p}=Y(),{isFeatureEnabled:m}=p(O.isDebitCardFeatureEnabled),f=t?.userEmail==null||c.fetchState!=="Completed"||Un(c.notificationSettings,t.userEmail,m,l);u.useEffect((()=>{c.fetchState!=="In-Progress"&&c.fetchState!=="Completed"&&a===!1&&(s(!0),i(_n()))}),[c.fetchState,a]);const S=xe(m,l),g=Ee(l);return c.fetchState!=="In-Progress"&&c.fetchState!=="Not-Started"||f!==!0?Fn(l)?o.jsxs(ne,{children:[Rn(n?.loggedInUserRole??[],m,l,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"accounting/*",element:o.jsx(ft,{})}),Bn(n?.loggedInUserRole??[],m,l,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"approval_rules/*",element:o.jsx(Mt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),On(l,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"my_bank_connections",element:o.jsx(Pt,{})}),Vn(l,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"bank_connections",element:o.jsx(It,{})}),zn(l,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"business_verification",element:o.jsx(ct,{productType:S?"zeni_accounts":g?"charge_cards":it(l,n?.loggedInUserRoleMap)})}),Ln(n?.loggedInUserRole??[],l,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"company_details",element:o.jsx(lt,{})}),Nn(n?.loggedInUserRole??[],l)&&o.jsx(v,{path:"billing",element:o.jsx(xt,{})}),$n(n?.loggedInUserRole??[],m,l)&&o.jsx(v,{path:"integrations",element:o.jsx(wt,{})}),o.jsx(v,{path:"my_profile/new/:addressType",element:o.jsx(fe,{appContent:o.jsx(st,{isSubPage:!1})})}),o.jsx(v,{path:"my_profile",element:o.jsx(fe,{})}),f&&o.jsx(v,{path:"notifications",element:o.jsx(Tt,{})}),o.jsx(v,{path:"*",element:o.jsx($,{})})]}):o.jsx(ne,{children:o.jsx(v,{path:"*",element:o.jsx($,{})})}):null}function Mt(e){return o.jsxs(ne,{children:[o.jsx(v,{path:"/",element:o.jsx(yt,{})}),o.jsx(v,{path:"bills/approval-rules/*",element:o.jsx(ut,{})}),o.jsx(v,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?o.jsx(pt,{}):o.jsx($,{})}),o.jsx(v,{path:"*",element:o.jsx($,{})})]})}export{ga as default};
57
+ `,fe=({appContent:e})=>{const a=U(),s=L(),c=G(),[l,n]=u.useState(!1),t=y((d=>P(d))),{tenantEmailDomain:i}=t,p=t.companyId??k.getSignedInUserTenant(i)?.companyId;if(k.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:m}=Y(),f=!!t.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:S}=m(O.isChargeCardFeatureEnabled),{isFeatureEnabled:g}=m(O.isDebitCardFeatureEnabled),r=t.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",b=y((d=>be(d))),I=Ee(t),w=xe(g,t),E=!w&&b,h=ke(t,S,g),{isCardsHidden:A}=je(t?.tenantId),_=!h||A,{areTenantIdsInSync:M}=qn();u.useEffect((()=>{M&&a(In(p,E))}),[p,a,E,M]);const x=y((d=>An(d,E))),R=x.fetchState==="Not-Started"||x.fetchState==="In-Progress"||p==null,D=En(t),N=!!t.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,B=d=>{n(d)};return o.jsxs(Dt,{children:[o.jsx(F,{isAppContentDrawerOpen:l,handleDrawerToggle:B}),e!=null?o.jsx(o.Fragment,{children:e}):o.jsx(et,{myProfileView:x,isAccountingClassesEnabled:b,isReimbursementDisabled:N===!1,isZeniAccountsDisabled:f===!1,isChargeCardDisabled:_,isTreasuryDisabled:r===!1,isLiteRoleDisabled:D===!1,onClickMenuIcon:()=>{B(!0)},isLoading:R,isBankingOnlyTenant:w,isCardsOnlyTenant:I,onAddressClick:d=>{const C=(function(j,q){let z=`/${j}/settings/my_profile`;return z=z.concat(`/new/${q}`),z})(i,d),T=nt(c.state?.pathnameStackToGoBack,c.pathname);s(C,{state:{pathnameStackToGoBack:T}})},onGetOtp:d=>{const C={...x.myProfileLocalData,phone:d};a(ue({localData:C})),a(kn(d,"MyProfile"))},onResendOtp:d=>{a(wn(d,"MyProfile"))},onCancelClick:()=>{a(vn())},onSaveClick:()=>{a(pe("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},onVerifyOtp:(d,C)=>{a(xn(d,C,"MyProfile"))},onVerifyOtpSuccess:d=>{d!=null&&k.saveZeniOtpToken(d),a(pe("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},updateMyProfileLocalData:d=>{a(ue({localData:d}))}})]})};function Mt(){const e=U(),a=y((r=>P(r))).companyId,s=y((r=>jn(r))),c=y((r=>ve(r))),l=k.getSignedInUser(),[n,t]=u.useState(!1),i=u.useCallback((r=>{t(r)}),[]),p=u.useCallback((r=>{e(Pn(r))}),[]),m=u.useCallback((()=>{l?.userEmail!=null&&e(Dn({loggedInUserEmail:l.userEmail}))}),[l?.userEmail]),f=u.useCallback((()=>{e(Mn())}),[]);if(l==null)throw Error("Can't access Notification Settings page without signing in...");const S=u.useCallback((()=>{const r=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ge(r,a))}),[a,c.notificationSettings.monthEndInsightsNotificationSettings.enabled]),g=u.useCallback((()=>{e(Tn())}),[]);return u.useEffect((()=>{if(c.fetchState==="Completed"&&s.fetchState!=="In-Progress"&&s.fetchState!=="Completed"){const r=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ge(r,a))}}),[s.fetchState,a,c.notificationSettings.monthEndInsightsNotificationSettings.enabled,c.fetchState]),o.jsxs(o.Fragment,{children:[o.jsx(F,{isAppContentDrawerOpen:n,handleDrawerToggle:i}),o.jsx(tt,{notificationSettingsView:s,onFormDataChange:p,onCancel:m,onSave:f,onClickMenuIcon:()=>{i(!0)},signedInUser:l,onRefresh:S,resetUpdateStatus:g})]})}function ga(e){const[a,s]=u.useState(!1),c=y((r=>ve(r))),l=y((r=>P(r))),n=J(),t=k.getSignedInUser(),i=U(),{useFeatureGate:p}=Y(),{isFeatureEnabled:m}=p(O.isDebitCardFeatureEnabled),f=t?.userEmail==null||c.fetchState!=="Completed"||Un(c.notificationSettings,t.userEmail,m,l);u.useEffect((()=>{c.fetchState!=="In-Progress"&&c.fetchState!=="Completed"&&a===!1&&(s(!0),i(_n()))}),[c.fetchState,a]);const S=xe(m,l),g=Ee(l);return c.fetchState!=="In-Progress"&&c.fetchState!=="Not-Started"||f!==!0?Rn(l)?o.jsxs(ne,{children:[Fn(n?.loggedInUserRole??[],m,l,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"accounting/*",element:o.jsx(ft,{})}),Bn(n?.loggedInUserRole??[],m,l,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"approval_rules/*",element:o.jsx(Tt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),On(l,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"my_bank_connections",element:o.jsx(Pt,{})}),Vn(l,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"bank_connections",element:o.jsx(It,{})}),zn(l,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"business_verification",element:o.jsx(ct,{productType:S?"zeni_accounts":g?"charge_cards":it(l,n?.loggedInUserRoleMap)})}),Ln(n?.loggedInUserRole??[],l,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"company_details",element:o.jsx(lt,{})}),Nn(n?.loggedInUserRole??[],l)&&o.jsx(v,{path:"billing",element:o.jsx(xt,{})}),$n(n?.loggedInUserRole??[],m,l)&&o.jsx(v,{path:"integrations",element:o.jsx(wt,{})}),o.jsx(v,{path:"my_profile/new/:addressType",element:o.jsx(fe,{appContent:o.jsx(st,{isSubPage:!1})})}),o.jsx(v,{path:"my_profile",element:o.jsx(fe,{})}),f&&o.jsx(v,{path:"notifications",element:o.jsx(Mt,{})}),o.jsx(v,{path:"*",element:o.jsx($,{})})]}):o.jsx(ne,{children:o.jsx(v,{path:"*",element:o.jsx($,{})})}):null}function Tt(e){return o.jsxs(ne,{children:[o.jsx(v,{path:"/",element:o.jsx(yt,{})}),o.jsx(v,{path:"bills/approval-rules/*",element:o.jsx(ut,{})}),o.jsx(v,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?o.jsx(pt,{}):o.jsx($,{})}),o.jsx(v,{path:"*",element:o.jsx($,{})})]})}export{ga as default};
@@ -1,4 +1,4 @@
1
- import{j as u}from"./liveblocks-C8AAaKDR.js";import{h as X,g as ee,u as ne,i as $,j as v,N as x,n as H,t as en}from"./core-Da6TLrNx.js";import{bJ as nn,cq as Ce,Qg as ye,eZ as V,cC as tn,zW as Q,zG as an,Qs as sn,Qv as on,rY as te,rM as ae,le as ie,u2 as L,Qx as Ie,gl as Ge,gk as $e,gj as He,Qy as cn,A3 as rn,EP as Ae,EG as ke,ED as _e,El as J,EJ as Ee,EM as Pe,ES as ve,uw as Te,gA as un,cx as dn,fG as ln,fE as pn,fF as mn,bt as yn,Qz as fn,Dl as le,DZ as gn,QA as Sn,bK as bn,G6 as pe,F7 as hn,QB as Cn,QC as In,Ga as An,Ge as kn,tX as _n,KE as En,GL as he,HL as me,QD as Pn,QE as vn,QF as Tn,QG as We,QH as wn,N5 as Dn,PI as Un,Nk as On,QI as Ke,Ep as Fn,Nl as Vn,Et as Bn,QJ as Oe,H5 as qe,lm as xn,rP as Je,u4 as jn,bE as Re,ug as Ne,cA as Rn,QK as Ye,fY as Nn,Gt as Ln,Gx as zn,QL as Mn,GO as Le,QM as Zn,QN as Qn,QO as Gn,QP as $n,gt as Hn,Be as Wn,QQ as Kn,Bj as qn,Bi as Jn}from"./zeni-epic-state-BqRlfhza.js";import{d as se,A as oe,c as q,y as we,aS as Y,bC as Xe,z as U,E as ce,e as O,D as De,g as G,bD as Yn,au as re,bE as B,bF as Xn,bG as et,ag as xe,bH as nt,v as ze,av as Me,J as tt,H as at,bI as it,bJ as st,bK as ot,a9 as ct}from"./index-Bwczg7nO.js";import{a as h}from"./sentry-DfheywaX.js";import{n as Fe,D as rt,S as ut}from"./mui-CosLSKUu.js";import{M as fe}from"./MobileAppDrawer-D_5ajcgl.js";import N from"./NotFoundScreen-vodaR6J5.js";import{a as Ze}from"./analyticsHelper-C7Ffbo_X.js";import{d as Qe}from"./routePaths-Kh8F22Sq.js";import{B as Ue}from"./BusinessVerificationPageScreen-DrCLmIxZ.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]="6c5ad3dc-bb45-4111-8eb1-dc388a878d5c",e._sentryDebugIdIdentifier="sentry-dbid-6c5ad3dc-bb45-4111-8eb1-dc388a878d5c")}catch{}})();const dt=Fe.div`
1
+ import{j as u}from"./liveblocks-bqFl_SVp.js";import{h as X,g as ee,u as ne,i as $,j as v,N as x,n as H,t as en}from"./core-Bnb5S7eF.js";import{bJ as nn,cq as Ce,Qj as ye,eZ as B,cC as tn,zW as Q,zG as an,Qv as sn,Qy as on,rY as te,rM as ae,le as ie,u2 as L,QA as Ie,gl as Ge,gk as $e,gj as He,QB as cn,A3 as rn,EP as Ae,EG as ke,ED as _e,El as J,EJ as Ee,EM as Pe,ES as ve,uw as Te,gA as un,cx as dn,fG as ln,fE as pn,fF as mn,bt as yn,QC as fn,Dl as le,DZ as gn,QD as Sn,bK as bn,G6 as pe,F7 as hn,QE as Cn,QF as In,Ga as An,Ge as kn,tX as _n,KE as En,GL as he,HL as me,QG as Pn,QH as vn,QI as Tn,QJ as We,QK as wn,N5 as Dn,PL as Un,Nk as On,QL as Ke,Ep as Fn,Nl as Bn,Et as Vn,QM as Oe,H5 as qe,lm as xn,rP as Je,u4 as jn,bE as Re,ug as Ne,cA as Rn,QN as Ye,fY as Nn,Gt as Ln,Gx as zn,QO as Mn,GO as Le,QP as Zn,QQ as Qn,QR as Gn,QS as $n,gt as Hn,Be as Wn,QT as Kn,Bj as qn,Bi as Jn}from"./zeni-epic-state-GXytJkko.js";import{f as se,y as oe,d as q,E as we,aS as Y,bC as Xe,z as U,D as ce,g as O,B as De,j as G,bD as Yn,au as re,bE as V,bF as Xn,bG as et,ag as xe,bH as nt,w as ze,av as Me,p as tt,G as at,bI as it,bJ as st,bK as ot,a9 as ct}from"./index-BzrRJ8WV.js";import{a as h}from"./sentry-Bj_fC7Ll.js";import{n as Fe,D as rt,S as ut}from"./mui-BAFflVdx.js";import{M as fe}from"./MobileAppDrawer-QMY9Y_6M.js";import N from"./NotFoundScreen-Bjgm3Cgg.js";import{a as Ze}from"./analyticsHelper-DjBKxGVt.js";import{d as Qe}from"./routePaths-iBgwsr_r.js";import{B as Ue}from"./BusinessVerificationPageScreen-2yzgn_dq.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]="0360ffa8-0ac9-4bf9-a87a-912b41bcf2d8",e._sentryDebugIdIdentifier="sentry-dbid-0360ffa8-0ac9-4bf9-a87a-912b41bcf2d8")}catch{}})();const dt=Fe.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -6,7 +6,7 @@ import{j as u}from"./liveblocks-C8AAaKDR.js";import{h as X,g as ee,u as ne,i as
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,lt=H((function(e,o){const{isUserBillPayAdmin:t,companyId:a}=o,c=V(e),n=sn(e),s=U.getSignedInUser(),l=c.tenantId,i={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:l??""},r=on(e,a),p=t&&r.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&r.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",g=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{billPaySetupView:r,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:g,showIntlWiseWidget:o.showIntlWiseWidget,isDisabled:p,billpayApprovalView:n,meetingUrl:"https://meetings.hubspot.com/snehals/demo-bill-pay?embed=true",analytics:O,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:i}}),(function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyBillPayInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(Q(a,!1,!0))},onSetupApprovalRulesSectionClick:()=>{t("../approval-rules")},onFetchLinkTokenClick:(n,s)=>{e(Te("bill_pay_setup",n,s))},onEstablishConnectionClick:n=>{e(ve(n,a,"bill_pay_setup","bill_pay"))},onUpdatePaymentAccountStatus:(n,s,l)=>{e(Pe(n,s,"bill_pay","bill_pay_setup",l))},onUpdatePaymentAccountLoginStatus:(n,s)=>{e(Ee(!1,n,"bill_pay","bill_pay_setup",s))},onEstablishConnectionSuccess:()=>{e(Q(a,!0))},onEnableBillPayClick:()=>{e(J(a,"bill_pay"))},onUpdateAccountClick:(n,s,l)=>{e(l==="paymentAccount"?ke(n,s,"bill_pay","bill_pay_setup"):_e("reimbursement_setup",n,s))},onUpdatePrimaryFundingAccount:(n,s)=>{e(Ae(a,"bill_pay_setup",n,s))},onEnableBillPaySuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?t("../.."):t("../",{relative:"path"})},onAcceptUpdatedTOS:()=>{e(rn(a))},onAcceptUpdatedTOSSuccess:()=>{e(Q(a,!0))},onGetOtp:(n,s)=>{e(He(n,"SpendManagementSetup")),s!=null&&e(cn({officerType:s,phone:n}))},onResendOtp:n=>{e($e(n,"SpendManagementSetup"))},onVerifyOtp:(n,s)=>{e(Ge(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(Ie({officerType:n,fileIds:s}))},onSendForVerificationClick:n=>{e(L(a,n,"bill_pay",!0,!0,!0))},updateFilesEntity:n=>{e(ie({files:n}))},onDeleteFile:n=>{e(ae(n))},onEditFileName:(n,s)=>{e(te(n,s.split(".")[0]))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}))(Yn),pt=()=>{const e=X(),o=ee(),t=ne(),{tenantEmailDomain:a}=$(),c=se(),n=nn(c?.loggedInUserRoleMap),s=Ce(c?.loggedInUserRoleMap),{useFeatureGate:l,useDynamicConfig:i}=oe(),{isFeatureEnabled:r}=l(q.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:p}=l(q.isBillPayLocalCurrencyFeatureEnabled),g=we(),{configValue:C}=i(Y.zeniAccountsConfig),I=ye(C),[k,d]=h.useState(!1),S=h.useRef(!1),[y,_]=h.useState(!1),E=v((T=>T.billPaySetupViewState.fetchState)),f=v((T=>V(T))),b=v((T=>T.billPaySetupApproverViewState.fetchState)),{isApprovalRulesV3Enabled:D,isLoading:A}=Xe(f?.tenantId),m=f.companyId??U.getSignedInUserTenant(a)?.companyId;if(U.getSignedInUser()==null)throw Error("Can't access bill pay setup page without signing in...");const P=!!f.companyBillPayInfo?.info?.isBillPayTOSAccepted,j=tn(c?.loggedInUserRoleMap);h.useEffect((()=>{S.current||E!=="Not-Started"||m==null?S.current||E!=="Completed"||m==null||f.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(S.current=!0,t(Q(m,!1,!0))):(S.current=!0,t(Q(m,!0)))}),[E,m,t]),h.useEffect((()=>{y||b!=="Not-Started"||A||(_(!0),t(an(!0,!0,D)))}),[y,b,A,D,t]);const F=T=>{d(T)};if(P===!1||j&&!c?.loggedInUserRoleMap?.bill_pay_admin)return u.jsx(x,{to:"../promo"});if(P===!0&&c?.loggedInUserRoleMap!=null){const T=R=>R.trackPageLoaded(G.Event.billPaySetup);return u.jsxs(dt,{children:[u.jsx(ce,{analytics:O,onLoad:R=>T(R)}),u.jsx(fe,{isAppContentDrawerOpen:k,handleDrawerToggle:F}),u.jsx(lt,{navigate:e,location:o,companyId:m,currentTenant:f,isUserBillPayAdmin:n,showIntlWiseWidget:r,onClickMenuIcon:()=>{F(!0)},hasZeniAccountsAdminAccess:s,accountsPromoConfig:I,isLocalCurrencyEnabled:p})]})}return u.jsx(De,{fetchState:"In-Progress",style:{backgroundColor:g.colors.grey5}})},Qt=(e,o)=>e!=null&&(function(t){return t==="debit"||t==="credit"||t==="debit_and_credit"})(e)?e:o,Gt=e=>`/${e}/cards`,$t=e=>`/${e}/cards/setup`,Ht=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},Kt=(e,o)=>e.find((t=>t.id===o)),qt=(e,o,t)=>!e||!o||t.fetchState==="Completed",mt=(e,o,t,a)=>({isCreditCardOffered:e,isDebitCardOffered:o,isDebitCardEnabled:t,isCreditCardEnabled:a}),Jt=(e,o)=>e?{creditCardCashbackOffer:`${o.cashbackAnalytics.creditCardCashbackOffer}%`,debitCardCashbackOffer:`${o.cashbackAnalytics.debitCardCashbackOffer}%`,totalEarnedCashback:B(o.cashbackSummary.cashbackEarned.amount),redeemedCashback:B(o.cashbackSummary.cashbackRedeemed.amount),availableCashback:B(o.cashbackSummary.cashbackAvailable.amount),creditCardCashbackRedemptionMode:o.cashbackAnalytics.creditCardCashbackRedemptionMode,debitCardCashbackRedemptionMode:o.cashbackAnalytics.debitCardCashbackRedemptionMode}:void 0,Yt=(e,o,t,a,c)=>e&&o&&t?{creditAccountId:a.id,creditAccountLimit:B(a.limit.amount),creditAccountAvailableAmount:B(a.available.amount),creditAccountSpentAmount:B(a.balance.amount+a.hold.amount),creditAccountStatus:a.status,outstandingBalance:B(c.remainingAmountDue.amount)}:void 0,Xt=(e,o,t,a,c)=>e&&o&&t?{debitAccountId:a.depositAccounts.map((n=>n.id)),debitAccountName:a.depositAccounts.map((n=>n.accountName)),debitAccountBalance:a.depositAccounts.map((n=>B(n.accountBalance.available.amount))),debitCardsSpend:B(c?.currentMonthSpends.amount??0),debitAccountStatus:a.depositAccounts.map((n=>n.accountStatus))}:void 0,ea=(e,o)=>e&&o.depositAccountLimit!=null&&o.chargeCard!=null?{debitAccountId:o.depositAccountLimit.id,debitAccountName:o.depositAccountLimit?.accountName??o.connectedAccount?.accountName,debitAccountBalance:B(o.depositAccountLimit?.accountBalance.available.amount),debitCardsSpend:B(o.chargeCard.limit.amount-o.chargeCard.available.amount),debitAccountStatus:o.depositAccountLimit?.accountStatus??o.connectedAccount?.accountStatus}:void 0,na=80,ta=80,aa=e=>e.companyId??U.getSignedInUserTenant(e.tenantEmailDomain)?.companyId,yt=({isBankingOnlyTenant:e,isDebitCardFeatureEnabled:o})=>o||e,ft=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:t,isDebitCardProductVisible:a,chargeCardsCreditAccountLimit:c})=>(e||o||t)&&(!a||c>0),ia=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:t})=>e||o||t,sa=({cardInfo:e,isProductVisible:o,isTOSAccepted:t,isSetupEnabled:a,isUserHasCardsAdminLevelAccess:c,isUserHasCardsAccess:n})=>!!e&&o&&(!t&&c||n&&!c&&!a),gt=H((function(e,o){const{isUserChargeCardAdmin:t,chargeCardSetUpView:a,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n}=o,s=V(e),l=U.getSignedInUser(),i=s.tenantId,r={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i??""},p=t&&a.updateStatus.fetchState!=="In-Progress"&&a.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&a.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&a.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",g=!!s.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{chargeCardSetUpView:a,connectedAccountProvider:s.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:g,isDisabled:p,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:O,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:r}}),(function(e,o){const{navigate:t,companyId:a,currentTenant:c,chargeCardSetUpView:n,isDebitCardTOSAccepted:s,isChargeCardTOSAccepted:l,isChargeCardSetupEnabled:i,isDebitCardSetupEnabled:r,productInformation:p,controllerEmails:g,businessVerificationStatus:C,isCardPolicyEnabled:I,isUserChargeCardAdmin:k}=o;return{onBusinessVerificationSectionClick:()=>{O.trackCardsVerifyIdentityCompanyDetailsClick(g,p,C?.code),t("../verification"),c?.company?.companyChargeCardInfo!=null&&c.company.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(le(a,!1,!0))},...k&&I?{onCardPolicySectionClick:()=>{t("../policy")}}:{},onFetchLinkTokenClick:(d,S)=>{e(Te("charge_card_setup",d,S))},onEstablishConnectionClick:d=>{e(ve(d,a,"charge_card_setup","charge_cards"))},onUpdatePaymentAccountStatus:(d,S,y)=>{e(Pe(d,S,"charge_cards","charge_card_setup",y))},onUpdatePaymentAccountLoginStatus:(d,S)=>{e(Ee(!1,d,"charge_cards","charge_card_setup",S))},onEstablishConnectionSuccess:()=>{e(le(a,!0))},onEnableChargeCardClick:()=>{O.trackCardsEnableCardsClick(g,p,"Cards Card Setup"),l===!0&&s===!0&&i===!1&&r===!1?e(J(a,"charge_cards__debit_cards")):l===!0&&i===!1?e(J(a,"charge_cards")):s===!0&&r===!1&&e(J(a,"debit_cards"))},onUpdateChargeCardClick:(d,S,y)=>{const _=n.allBankAccounts.find((f=>f.accountId===n.primaryFundingAccount?.zeniAccountId)),E=n.allBankAccounts.find((f=>f.accountId===d));O.trackCardsZeniCashAccountChangeClick(g,p,{oldZeniCashAccount:_?.accountName??"",newZeniCashAccount:E?.accountName??"",oldZeniCashAccountPosition:n.allBankAccounts.findIndex((f=>f.accountId===n.primaryFundingAccount?.zeniAccountId))+1,newZeniCashAccountPosition:n.allBankAccounts.findIndex((f=>f.accountId===d))+1,numberOfCashAccounts:n.allBankAccounts.length}),e(y==="paymentAccount"?ke(d,S,"charge_cards","charge_card_setup"):_e("charge_card_setup",d,S))},onUpdatePrimaryFundingAccount:(d,S)=>{const y=n.allFundingAccounts.find((f=>f.id===d)),_=n.allFundingAccounts.findIndex((f=>f.id===n.primaryFundingAccount?.id))+1,E=n.allFundingAccounts.findIndex((f=>f.id===d))+1;O.trackCardsPaymentAccountChangeClick(g,p,{oldPaymentAccountName:n.primaryFundingAccount?.label??"",oldPaymentAccountBalance:B(n.primaryFundingAccount?.accountBalance?.available?.amount??0),newPaymentAccountName:y?.label??"",newPaymentAccountBalance:B(y?.accountBalance?.available?.amount??0),isOldPaymentAccountRecommended:n.primaryFundingAccount?.accType==="depositAccount",isNewPaymentAccountRecommended:y?.accType==="depositAccount",oldPaymentAccountPosition:_,newPaymentAccountPosition:E,numberOfPaymentAccounts:n.allFundingAccounts.length}),e(Ae(a,"charge_card_setup",d,S))},onEnableChargeCardSuccess:()=>{e(Sn()),t("../",{relative:"path"})},onBackClick:()=>{c?.companyChargeCardInfo?.info?.isChargeCardEnabled||c?.companyDebitCardInfo?.info?.isDebitCardEnabled?t("../",{relative:"path"}):t("../..",{relative:"path"})},onNavigateToDashboard:()=>{t("../../dashboard")},onCompanyOfficerUpdated:(d,S)=>{e(Ie({officerType:d,fileIds:S}))},onSendForVerificationClick:d=>{l===!0&&s===!0?e(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(ie({files:d}))},onDeleteFile:d=>{e(ae(d))},onEditFileName:(d,S)=>{e(te(d,S.split(".")[0]))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onUpdateAutoPayClick:d=>{e(gn(a,d))}}}))(Xn),St=()=>{const e=X(),o=ee(),t=ne(),{tenantEmailDomain:a}=$(),c=se(),n=v((z=>V(z))),{useDynamicConfig:s,useFeatureGate:l}=oe(),i=o.state?.pathnameStackToGoBack?.[0],{configValue:r}=s(Y.zeniAccountsConfig),{configValue:p}=s(Y.zeniCardsConfig),g=p.credit_card_auto_pay_threshold_by_company_id?.[n.companyId]??p.default_credit_card_auto_pay_threshold??80,{isFeatureEnabled:C}=l(q.isDebitCardFeatureEnabled),{isFeatureEnabled:I}=l(q.isChargeCardFeatureEnabled),{isFeatureEnabled:k}=l(q.isEarlyPayFeatureEnabled),{isFeatureEnabled:d}=l(q.isCardPolicyEnabled),S=v((z=>un(z,n.companyId))),y=dn(S.controllers),_=!!n.company?.companyChargeCardInfo.isChargeCardEnabled,E=!!n.company?.companyDebitCardInfo.isDebitCardEnabled,f=ln(C,n),b=yt({isDebitCardFeatureEnabled:C,isBankingOnlyTenant:f}),D=pn(n),A=mn(n),m=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,P=ft({isCardsOnlyTenant:D,isChargeCardFeatureEnabled:I,isBookKeepingTenant:A,isDebitCardProductVisible:b,chargeCardsCreditAccountLimit:m}),j=b&&P===!1,F=b===!1&&P,T=ye(r),R=yn(c?.loggedInUserRoleMap),W=Ce(c?.loggedInUserRoleMap),[ge,Se]=h.useState(!1),[M,ue]=h.useState(!1),Z=v((z=>z.chargeCardSetupViewState.fetchState)),w=U.getSignedInUserTenant(a)?.companyId??n.companyId,Ve=U.getSignedInUser(),de=z=>{Se(z)},Be=v((z=>fn(z,w)));if(Ve==null)throw Error("Can't access charge card setup page without signing in...");h.useEffect((()=>{M||Z!=="Not-Started"||w==null?M||Z!=="Completed"||w==null||n.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(le(w,!1,!0)):(ue(!0),t(le(w,!0)))}),[M,Z,w,t]);const be=!!n.company?.companyChargeCardInfo.isChargeCardTOSAccepted,K=!!n.company?.companyDebitCardInfo.isDebitCardTOSAccepted,je=mt(P,b,E,_);return be||K?be||K?u.jsxs(u.Fragment,{children:[u.jsx(ce,{analytics:O,onLoad:()=>{O.trackPageLoaded(G.Event.cardsSetupVisited),O.trackCardsCardSetupView(y,je,i==null?"Cards Setup":i.includes("cards/promo")?"Promo":i.includes("cards")?"Settings":"Cards Tab")}}),u.jsx(fe,{isAppContentDrawerOpen:ge,handleDrawerToggle:de}),u.jsx(gt,{autoPayThreshold:g,navigate:e,location:o,companyId:w,currentTenant:n,isEarlyPayEnabled:k,isChargeCardTOSAccepted:be,isDebitCardTOSAccepted:K,isUserChargeCardAdmin:R,isCardPolicyEnabled:d,isDebitCardOnlyEnabled:j,isCreditCardOnlyEnabled:F,chargeCardSetUpView:Be,isCreditCardProductVisible:P,isDebitCardFeatureEnabled:b,isChargeCardSetupEnabled:_,isDebitCardSetupEnabled:E,businessVerificationStatus:n.companyBillPayInfo?.info?.businessVerificationStatus,controllerEmails:y,productInformation:je,onClickMenuIcon:()=>{de(!0)},hasZeniAccountsAdminAccess:W,accountsPromoConfig:T})]}):u.jsx(De,{fetchState:"Not-Started"}):u.jsx(x,{to:"../promo"})},bt=Fe.div`
9
+ `,lt=H((function(e,o){const{isUserBillPayAdmin:t,companyId:a}=o,c=B(e),n=sn(e),s=U.getSignedInUser(),l=c.tenantId,i={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:l??""},r=on(e,a),p=t&&r.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&r.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",g=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{billPaySetupView:r,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:g,showIntlWiseWidget:o.showIntlWiseWidget,isDisabled:p,billpayApprovalView:n,meetingUrl:"https://meetings.hubspot.com/snehals/demo-bill-pay?embed=true",analytics:O,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:i}}),(function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyBillPayInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(Q(a,!1,!0))},onSetupApprovalRulesSectionClick:()=>{t("../approval-rules")},onFetchLinkTokenClick:(n,s)=>{e(Te("bill_pay_setup",n,s))},onEstablishConnectionClick:n=>{e(ve(n,a,"bill_pay_setup","bill_pay"))},onUpdatePaymentAccountStatus:(n,s,l)=>{e(Pe(n,s,"bill_pay","bill_pay_setup",l))},onUpdatePaymentAccountLoginStatus:(n,s)=>{e(Ee(!1,n,"bill_pay","bill_pay_setup",s))},onEstablishConnectionSuccess:()=>{e(Q(a,!0))},onEnableBillPayClick:()=>{e(J(a,"bill_pay"))},onUpdateAccountClick:(n,s,l)=>{e(l==="paymentAccount"?ke(n,s,"bill_pay","bill_pay_setup"):_e("reimbursement_setup",n,s))},onUpdatePrimaryFundingAccount:(n,s)=>{e(Ae(a,"bill_pay_setup",n,s))},onEnableBillPaySuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?t("../.."):t("../",{relative:"path"})},onAcceptUpdatedTOS:()=>{e(rn(a))},onAcceptUpdatedTOSSuccess:()=>{e(Q(a,!0))},onGetOtp:(n,s)=>{e(He(n,"SpendManagementSetup")),s!=null&&e(cn({officerType:s,phone:n}))},onResendOtp:n=>{e($e(n,"SpendManagementSetup"))},onVerifyOtp:(n,s)=>{e(Ge(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(Ie({officerType:n,fileIds:s}))},onSendForVerificationClick:n=>{e(L(a,n,"bill_pay",!0,!0,!0))},updateFilesEntity:n=>{e(ie({files:n}))},onDeleteFile:n=>{e(ae(n))},onEditFileName:(n,s)=>{e(te(n,s.split(".")[0]))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}))(Yn),pt=()=>{const e=X(),o=ee(),t=ne(),{tenantEmailDomain:a}=$(),c=se(),n=nn(c?.loggedInUserRoleMap),s=Ce(c?.loggedInUserRoleMap),{useFeatureGate:l,useDynamicConfig:i}=oe(),{isFeatureEnabled:r}=l(q.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:p}=l(q.isBillPayLocalCurrencyFeatureEnabled),g=we(),{configValue:C}=i(Y.zeniAccountsConfig),I=ye(C),[k,d]=h.useState(!1),S=h.useRef(!1),[y,_]=h.useState(!1),E=v((T=>T.billPaySetupViewState.fetchState)),f=v((T=>B(T))),b=v((T=>T.billPaySetupApproverViewState.fetchState)),{isApprovalRulesV3Enabled:D,isLoading:A}=Xe(f?.tenantId),m=f.companyId??U.getSignedInUserTenant(a)?.companyId;if(U.getSignedInUser()==null)throw Error("Can't access bill pay setup page without signing in...");const P=!!f.companyBillPayInfo?.info?.isBillPayTOSAccepted,j=tn(c?.loggedInUserRoleMap);h.useEffect((()=>{S.current||E!=="Not-Started"||m==null?S.current||E!=="Completed"||m==null||f.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(S.current=!0,t(Q(m,!1,!0))):(S.current=!0,t(Q(m,!0)))}),[E,m,t]),h.useEffect((()=>{y||b!=="Not-Started"||A||(_(!0),t(an(!0,!0,D)))}),[y,b,A,D,t]);const F=T=>{d(T)};if(P===!1||j&&!c?.loggedInUserRoleMap?.bill_pay_admin)return u.jsx(x,{to:"../promo"});if(P===!0&&c?.loggedInUserRoleMap!=null){const T=R=>R.trackPageLoaded(G.Event.billPaySetup);return u.jsxs(dt,{children:[u.jsx(ce,{analytics:O,onLoad:R=>T(R)}),u.jsx(fe,{isAppContentDrawerOpen:k,handleDrawerToggle:F}),u.jsx(lt,{navigate:e,location:o,companyId:m,currentTenant:f,isUserBillPayAdmin:n,showIntlWiseWidget:r,onClickMenuIcon:()=>{F(!0)},hasZeniAccountsAdminAccess:s,accountsPromoConfig:I,isLocalCurrencyEnabled:p})]})}return u.jsx(De,{fetchState:"In-Progress",style:{backgroundColor:g.colors.grey5}})},Qt=(e,o)=>e!=null&&(function(t){return t==="debit"||t==="credit"||t==="debit_and_credit"})(e)?e:o,Gt=e=>`/${e}/cards`,$t=e=>`/${e}/cards/setup`,Ht=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},Kt=(e,o)=>e.find((t=>t.id===o)),qt=(e,o,t)=>!e||!o||t.fetchState==="Completed",mt=(e,o,t,a)=>({isCreditCardOffered:e,isDebitCardOffered:o,isDebitCardEnabled:t,isCreditCardEnabled:a}),Jt=(e,o)=>e?{creditCardCashbackOffer:`${o.cashbackAnalytics.creditCardCashbackOffer}%`,debitCardCashbackOffer:`${o.cashbackAnalytics.debitCardCashbackOffer}%`,totalEarnedCashback:V(o.cashbackSummary.cashbackEarned.amount),redeemedCashback:V(o.cashbackSummary.cashbackRedeemed.amount),availableCashback:V(o.cashbackSummary.cashbackAvailable.amount),creditCardCashbackRedemptionMode:o.cashbackAnalytics.creditCardCashbackRedemptionMode,debitCardCashbackRedemptionMode:o.cashbackAnalytics.debitCardCashbackRedemptionMode}:void 0,Yt=(e,o,t,a,c)=>e&&o&&t?{creditAccountId:a.id,creditAccountLimit:V(a.limit.amount),creditAccountAvailableAmount:V(a.available.amount),creditAccountSpentAmount:V(a.balance.amount+a.hold.amount),creditAccountStatus:a.status,outstandingBalance:V(c.remainingAmountDue.amount)}:void 0,Xt=(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=>V(n.accountBalance.available.amount))),debitCardsSpend:V(c?.currentMonthSpends.amount??0),debitAccountStatus:a.depositAccounts.map((n=>n.accountStatus))}:void 0,ea=(e,o)=>e&&o.depositAccountLimit!=null&&o.chargeCard!=null?{debitAccountId:o.depositAccountLimit.id,debitAccountName:o.depositAccountLimit?.accountName??o.connectedAccount?.accountName,debitAccountBalance:V(o.depositAccountLimit?.accountBalance.available.amount),debitCardsSpend:V(o.chargeCard.limit.amount-o.chargeCard.available.amount),debitAccountStatus:o.depositAccountLimit?.accountStatus??o.connectedAccount?.accountStatus}:void 0,na=80,ta=80,aa=e=>e.companyId??U.getSignedInUserTenant(e.tenantEmailDomain)?.companyId,yt=({isBankingOnlyTenant:e,isDebitCardFeatureEnabled:o})=>o||e,ft=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:t,isDebitCardProductVisible:a,chargeCardsCreditAccountLimit:c})=>(e||o||t)&&(!a||c>0),ia=({isCardsOnlyTenant:e,isChargeCardFeatureEnabled:o,isBookKeepingTenant:t})=>e||o||t,sa=({cardInfo:e,isProductVisible:o,isTOSAccepted:t,isSetupEnabled:a,isUserHasCardsAdminLevelAccess:c,isUserHasCardsAccess:n})=>!!e&&o&&(!t&&c||n&&!c&&!a),gt=H((function(e,o){const{isUserChargeCardAdmin:t,chargeCardSetUpView:a,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n}=o,s=B(e),l=U.getSignedInUser(),i=s.tenantId,r={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i??""},p=t&&a.updateStatus.fetchState!=="In-Progress"&&a.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&a.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&a.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",g=!!s.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{chargeCardSetUpView:a,connectedAccountProvider:s.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:g,isDisabled:p,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:O,isDebitCardOnlyEnabled:c,isCreditCardOnlyEnabled:n,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:r}}),(function(e,o){const{navigate:t,companyId:a,currentTenant:c,chargeCardSetUpView:n,isDebitCardTOSAccepted:s,isChargeCardTOSAccepted:l,isChargeCardSetupEnabled:i,isDebitCardSetupEnabled:r,productInformation:p,controllerEmails:g,businessVerificationStatus:C,isCardPolicyEnabled:I,isUserChargeCardAdmin:k}=o;return{onBusinessVerificationSectionClick:()=>{O.trackCardsVerifyIdentityCompanyDetailsClick(g,p,C?.code),t("../verification"),c?.company?.companyChargeCardInfo!=null&&c.company.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(le(a,!1,!0))},...k&&I?{onCardPolicySectionClick:()=>{t("../policy")}}:{},onFetchLinkTokenClick:(d,S)=>{e(Te("charge_card_setup",d,S))},onEstablishConnectionClick:d=>{e(ve(d,a,"charge_card_setup","charge_cards"))},onUpdatePaymentAccountStatus:(d,S,y)=>{e(Pe(d,S,"charge_cards","charge_card_setup",y))},onUpdatePaymentAccountLoginStatus:(d,S)=>{e(Ee(!1,d,"charge_cards","charge_card_setup",S))},onEstablishConnectionSuccess:()=>{e(le(a,!0))},onEnableChargeCardClick:()=>{O.trackCardsEnableCardsClick(g,p,"Cards Card Setup"),l===!0&&s===!0&&i===!1&&r===!1?e(J(a,"charge_cards__debit_cards")):l===!0&&i===!1?e(J(a,"charge_cards")):s===!0&&r===!1&&e(J(a,"debit_cards"))},onUpdateChargeCardClick:(d,S,y)=>{const _=n.allBankAccounts.find((f=>f.accountId===n.primaryFundingAccount?.zeniAccountId)),E=n.allBankAccounts.find((f=>f.accountId===d));O.trackCardsZeniCashAccountChangeClick(g,p,{oldZeniCashAccount:_?.accountName??"",newZeniCashAccount:E?.accountName??"",oldZeniCashAccountPosition:n.allBankAccounts.findIndex((f=>f.accountId===n.primaryFundingAccount?.zeniAccountId))+1,newZeniCashAccountPosition:n.allBankAccounts.findIndex((f=>f.accountId===d))+1,numberOfCashAccounts:n.allBankAccounts.length}),e(y==="paymentAccount"?ke(d,S,"charge_cards","charge_card_setup"):_e("charge_card_setup",d,S))},onUpdatePrimaryFundingAccount:(d,S)=>{const y=n.allFundingAccounts.find((f=>f.id===d)),_=n.allFundingAccounts.findIndex((f=>f.id===n.primaryFundingAccount?.id))+1,E=n.allFundingAccounts.findIndex((f=>f.id===d))+1;O.trackCardsPaymentAccountChangeClick(g,p,{oldPaymentAccountName:n.primaryFundingAccount?.label??"",oldPaymentAccountBalance:V(n.primaryFundingAccount?.accountBalance?.available?.amount??0),newPaymentAccountName:y?.label??"",newPaymentAccountBalance:V(y?.accountBalance?.available?.amount??0),isOldPaymentAccountRecommended:n.primaryFundingAccount?.accType==="depositAccount",isNewPaymentAccountRecommended:y?.accType==="depositAccount",oldPaymentAccountPosition:_,newPaymentAccountPosition:E,numberOfPaymentAccounts:n.allFundingAccounts.length}),e(Ae(a,"charge_card_setup",d,S))},onEnableChargeCardSuccess:()=>{e(Sn()),t("../",{relative:"path"})},onBackClick:()=>{c?.companyChargeCardInfo?.info?.isChargeCardEnabled||c?.companyDebitCardInfo?.info?.isDebitCardEnabled?t("../",{relative:"path"}):t("../..",{relative:"path"})},onNavigateToDashboard:()=>{t("../../dashboard")},onCompanyOfficerUpdated:(d,S)=>{e(Ie({officerType:d,fileIds:S}))},onSendForVerificationClick:d=>{l===!0&&s===!0?e(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(ie({files:d}))},onDeleteFile:d=>{e(ae(d))},onEditFileName:(d,S)=>{e(te(d,S.split(".")[0]))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onUpdateAutoPayClick:d=>{e(gn(a,d))}}}))(Xn),St=()=>{const e=X(),o=ee(),t=ne(),{tenantEmailDomain:a}=$(),c=se(),n=v((z=>B(z))),{useDynamicConfig:s,useFeatureGate:l}=oe(),i=o.state?.pathnameStackToGoBack?.[0],{configValue:r}=s(Y.zeniAccountsConfig),{configValue:p}=s(Y.zeniCardsConfig),g=p.credit_card_auto_pay_threshold_by_company_id?.[n.companyId]??p.default_credit_card_auto_pay_threshold??80,{isFeatureEnabled:C}=l(q.isDebitCardFeatureEnabled),{isFeatureEnabled:I}=l(q.isChargeCardFeatureEnabled),{isFeatureEnabled:k}=l(q.isEarlyPayFeatureEnabled),{isFeatureEnabled:d}=l(q.isCardPolicyEnabled),S=v((z=>un(z,n.companyId))),y=dn(S.controllers),_=!!n.company?.companyChargeCardInfo.isChargeCardEnabled,E=!!n.company?.companyDebitCardInfo.isDebitCardEnabled,f=ln(C,n),b=yt({isDebitCardFeatureEnabled:C,isBankingOnlyTenant:f}),D=pn(n),A=mn(n),m=n.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,P=ft({isCardsOnlyTenant:D,isChargeCardFeatureEnabled:I,isBookKeepingTenant:A,isDebitCardProductVisible:b,chargeCardsCreditAccountLimit:m}),j=b&&P===!1,F=b===!1&&P,T=ye(r),R=yn(c?.loggedInUserRoleMap),W=Ce(c?.loggedInUserRoleMap),[ge,Se]=h.useState(!1),[M,ue]=h.useState(!1),Z=v((z=>z.chargeCardSetupViewState.fetchState)),w=U.getSignedInUserTenant(a)?.companyId??n.companyId,Be=U.getSignedInUser(),de=z=>{Se(z)},Ve=v((z=>fn(z,w)));if(Be==null)throw Error("Can't access charge card setup page without signing in...");h.useEffect((()=>{M||Z!=="Not-Started"||w==null?M||Z!=="Completed"||w==null||n.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(le(w,!1,!0)):(ue(!0),t(le(w,!0)))}),[M,Z,w,t]);const be=!!n.company?.companyChargeCardInfo.isChargeCardTOSAccepted,K=!!n.company?.companyDebitCardInfo.isDebitCardTOSAccepted,je=mt(P,b,E,_);return be||K?be||K?u.jsxs(u.Fragment,{children:[u.jsx(ce,{analytics:O,onLoad:()=>{O.trackPageLoaded(G.Event.cardsSetupVisited),O.trackCardsCardSetupView(y,je,i==null?"Cards Setup":i.includes("cards/promo")?"Promo":i.includes("cards")?"Settings":"Cards Tab")}}),u.jsx(fe,{isAppContentDrawerOpen:ge,handleDrawerToggle:de}),u.jsx(gt,{autoPayThreshold:g,navigate:e,location:o,companyId:w,currentTenant:n,isEarlyPayEnabled:k,isChargeCardTOSAccepted:be,isDebitCardTOSAccepted:K,isUserChargeCardAdmin:R,isCardPolicyEnabled:d,isDebitCardOnlyEnabled:j,isCreditCardOnlyEnabled:F,chargeCardSetUpView:Ve,isCreditCardProductVisible:P,isDebitCardFeatureEnabled:b,isChargeCardSetupEnabled:_,isDebitCardSetupEnabled:E,businessVerificationStatus:n.companyBillPayInfo?.info?.businessVerificationStatus,controllerEmails:y,productInformation:je,onClickMenuIcon:()=>{de(!0)},hasZeniAccountsAdminAccess:W,accountsPromoConfig:T})]}):u.jsx(De,{fetchState:"Not-Started"}):u.jsx(x,{to:"../promo"})},bt=Fe.div`
10
10
  display: flex;
11
11
  height: 100%;
12
12
  width: 100%;
@@ -14,11 +14,11 @@ import{j as u}from"./liveblocks-C8AAaKDR.js";import{h as X,g as ee,u as ne,i as
14
14
  flex-direction: column;
15
15
  align-items: center;
16
16
  background-color: ${e=>e.theme.colors.grey4};
17
- `,ht=H((function(e,o){const{isUserRemiAdmin:t,companyId:a}=o,c=V(e),n=Cn(e),s=In(e,a),l=U.getSignedInUser(),i=c.tenantId,r={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i??""},p=t&&s.updateStatus.fetchState!=="In-Progress"&&s.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&s.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&s.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",g=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{remiSetupView:s,isDisabled:p,remiApprovalView:n,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:g,meetingUrl:"https://meetings.hubspot.com/niharn/demo-reimbursements?embed=true",analytics:O,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:r}}),(function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{updateMileageDetails:n=>{const{mileageAmount:s,mileageUnit:l,mileageCurrencyCode:i,mileageCurrencySymbol:r,denomination:p,denominationSymbol:g,mileageAmountInDenomination:C,description:I}=n;e(kn({mileageDetails:{mileageUnitAmount:{amount:s,currencyCode:i,currencySymbol:r},denomination:p,denominationSymbol:g,mileageAmountInDenomination:C,mileageCurrencyCode:i,mileageCurrencySymbol:r,mileageUnit:l,description:I}}))},onSaveMileageClick:n=>{e(An(a)),O.trackReimbursementMileageRateSave(n)},onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyReimbursementInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(pe(a,!1,!0))},onSetupApprovalRulesSectionClick:()=>{t("../approval-rules")},onFetchLinkTokenClick:(n,s)=>{e(Te("reimbursement_setup",n,s))},onEstablishConnectionClick:n=>{e(ve(n,a,"reimbursement_setup","reimbursement"))},onUpdatePaymentAccountStatus:(n,s,l)=>{e(Pe(n,s,"reimbursement","reimbursement_setup",l))},onUpdatePaymentAccountLoginStatus:(n,s)=>{e(Ee(!1,n,"reimbursement","reimbursement_setup",s))},onEstablishConnectionSuccess:()=>{e(pe(a,!0))},onEnableRemiClick:()=>{e(J(a,"reimbursement"))},onUpdateAccountClick:(n,s,l)=>{e(l==="paymentAccount"?ke(n,s,"reimbursement","reimbursement_setup"):_e("reimbursement_setup",n,s))},onEnableRemiSuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyReimbursementInfo?.info?.isReimbursementEnabled!=null&&c.companyReimbursementInfo.info.isReimbursementEnabled===!1?t("../.."):t("../",{relative:"path"})},onCompanyOfficerUpdated:(n,s)=>{e(Ie({officerType:n,fileIds:s}))},onSendForVerificationClick:n=>{e(L(a,n,"reimbursement",!0,!0,!0))},updateFilesEntity:n=>{e(ie({files:n}))},onDeleteFile:n=>{e(ae(n))},onEditFileName:(n,s)=>{e(te(n,s.split(".")[0]))},onUpdatePrimaryFundingAccount:(n,s)=>{e(Ae(a,"reimbursement_setup",n,s))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}))(et),Ct=()=>{const e=X(),o=ee(),t=ne(),{tenantEmailDomain:a}=$(),c=se(),{useDynamicConfig:n}=oe(),s=we(),{configValue:l}=n(Y.zeniAccountsConfig),i=ye(l),r=bn(c?.loggedInUserRoleMap),p=Ce(c?.loggedInUserRoleMap),[g,C]=h.useState(!1),I=h.useRef(!1),[k,d]=h.useState(!1),S=v((m=>m.remiSetupViewState.fetchState)),y=v((m=>V(m))),_=v((m=>m.remiSetupApproverViewState.fetchState)),{isApprovalRulesV3Enabled:E,isLoading:f}=Xe(y?.tenantId),b=U.getSignedInUserTenant(a)?.companyId??y.companyId,D=U.getSignedInUser(),A=m=>{C(m)};if(D==null)throw Error("Can't access reimbursement setup page without signing in...");if(h.useEffect((()=>{I.current||S!=="Not-Started"||b==null?I.current||S!=="Completed"||b==null||y.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(I.current=!0,t(pe(b,!1,!0))):(I.current=!0,t(pe(b,!0)))}),[S,b,t]),h.useEffect((()=>{k||_!=="Not-Started"||f||(d(!0),t(hn(!0,!1,!1,E)))}),[k,_,f,E,t]),y.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1)return u.jsx(x,{to:"../promo"});if(y.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!0){const m=P=>P.trackPageLoaded(G.Event.reimbursementSetup);return u.jsxs(bt,{children:[u.jsx(ce,{analytics:O,onLoad:P=>m(P)}),u.jsx(fe,{isAppContentDrawerOpen:g,handleDrawerToggle:A}),u.jsx(ht,{navigate:e,location:o,companyId:b,currentTenant:y,isUserRemiAdmin:r,onClickMenuIcon:()=>{A(!0)},hasZeniAccountsAdminAccess:p,accountsPromoConfig:i})]})}return u.jsx(De,{fetchState:"In-Progress",style:{backgroundColor:s.colors.grey5}})},It=H((function(e,o){const{businessVerificationDetails:t,productType:a}=o,c=V(e),n=U.getSignedInUser(),s=c.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:s??""},i=Dn(o.roleMap)&&t.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",r=Un(e.companyConfigState),p=On(e.userRoleConfigState),g=a==="zeni_treasury"?Ke(e):void 0;return{businessVerificationDetails:t,verficationDetailsFetchState:t.fetchState,isRefreshingViewInBackground:t.isRefreshingViewInBackground,allNationalityCountries:t.allNationalityCountries,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:i,allIndustries:r.companyIndustries??[],companyTitles:p.companyTitles,transferDetails:g}}),(function(e,o){const{companyId:t,productType:a,currentTenant:c,navigate:n,location:s}=o,{tenantEmailDomain:l}=c;return{onCompanyDetailsChanged:i=>{const{companyDescription:r,companyIndustry:p,companyIndustryType:g,companyLegalName:C,companyTaxId:I,companyWebsite:k,companyPhone:d,primaryContactEmail:S,primaryContactName:y,primaryContactUserId:_,primaryContactSyncToken:E,syncToken:f,fileIds:b,incDate:D,typeOfIncorporation:A,stateOfIncorporation:m,sourceOfFunds:P,companySubIndustry:j,countriesOfOperations:F,companySourceOfFunds:T,companySourceOfFundsDescription:R,transactionVolume:W,transactionVolumeDescription:ge,purposeOfAccount:Se,purposeOfAccountDescription:M,regulatedStatus:ue,regulatedStatusDescription:Z,usNexus:w,usNexusTypes:Ve}=i,de=g?.selectedOption,Be={companyId:t,companyDescription:r,companyIndustry:p.selectedOption,companyIndustryType:de==null||de===""?void 0:de,companyLegalName:C,taxIdOrEIN:I,website:k!=""&&k!=null?Rn(k):void 0,phone:d,syncToken:f,fileIds:b,incDate:D!=null?Re(D?.toString()):D,typeOfIncorporation:A?.selectedOption??"",stateOfIncorporation:m?.selectedOption??"",sourceOfFunds:P?.selectedOption??"",companySubIndustry:j?.selectedOption??"",countriesOfOperations:F?.selectedOptions.map((K=>K.length===2?K:Me(K)))??[],companySourceOfFunds:T?.selectedOption??"",companySourceOfFundsDescription:R,transactionVolume:W?.selectedOption??"",transactionVolumeDescription:ge,purposeOfAccount:Se?.selectedOption??"",purposeOfAccountDescription:M,regulatedStatus:ue??"",regulatedStatusDescription:Z,usNexus:w,usNexusTypes:Ve?.selectedOptions??[]},be={userId:_,firstName:y.firstName,lastName:y.lastName,email:S,syncToken:E};e(Ne({companyDetails:Be,primaryContactDetails:be}))},onCompanyOfficerUpdated:i=>{const r=i.map((p=>{const{officerType:g,userId:C,name:I,email:k,nationalityCountryCode:d,ssn:S,dob:y,phone:_,syncToken:E,selectDocument:f,role:b,ownership:D,isSelectedForVerification:A,userVerificationStatus:m,treasuryUserVerificationStatus:P,fileIds:j}=p;let F;return f.selectDocumentType==="driverLicense"?F="driving_license":f.selectDocumentType==="passport"?F="passport":f.selectDocumentType==="stateId"?F="id_document":f.selectDocumentType==="ssnCard"&&(F="social_security_card"),{officerType:g,userId:C,firstName:I.firstName,lastName:I.lastName,email:k,ssn:S,nationalityCountryCode:d?.selectedOption!=null?Me(d.selectedOption):void 0,phone:_,birthday:y!=null?Re(y?.toString()):y,syncToken:E,titleAtCompany:b.selectedOption,ownershipInCompany:D,documentTypeSelectedForVerification:F,isSelectedForVerification:A,userVerificationStatus:m,treasuryUserVerificationStatus:P,fileIds:j,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}}));e(Ne({officers:r}))},onSaveDetailsClick:i=>{e(L(t,i,a))},onSendForVerificationClick:i=>{e(L(t,i,a,!0))},onAddressClick:i=>{const r=Qe(l,i),p=ze(s.state?.pathnameStackToGoBack,s.pathname),g=new URLSearchParams(s.search),C={};g.forEach(((I,k)=>{C[k]=I})),n(r,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(C).length>0?C:void 0}})},onRegisteredAddressClick:i=>{const r=Qe(l,i),p=ze(s.state?.pathnameStackToGoBack,s.pathname),g=new URLSearchParams(s.search),C=Object.fromEntries(g.entries());n(r,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(C).length>0?C:void 0}})},onBackClick:()=>{e(jn({companyId:t})),n("../setup")},updateFilesEntity:i=>{e(ie({files:i}))},onDeleteFile:i=>{e(ae(i))},onDeleteFileList:i=>{e(Je(i))},onEditFileName:(i,r)=>{e(te(i,r.split(".")[0]))},onGetOtp:i=>{e(He(i,"SpendManagementSetup"))},onResendOtp:i=>{e($e(i,"SpendManagementSetup"))},onVerifyOtp:(i,r)=>{e(Ge(i,r,"SpendManagementSetup"))},saveNewAddressInLocalStore:(i,r)=>{e(xn({addressType:i,addressToCreate:r}))},onExecuteTreasuryTransfer:()=>{e(qe())},onOverlayClose:()=>{e(Oe())},onIdentityDocumentUploadedForAutofill:i=>{if(t==null)return;const r=Vn(i.documentType);r!=null&&e(Bn({target:"setup",companyId:t,officerType:i.officerType,fileId:i.fileId,documentType:r}))},onCompanyDocumentUploadedForAutofill:i=>{t!=null&&e(Fn({target:"setup",companyId:t,fileId:i.fileId,documentType:i.documentType}))}}}))(nt),At=({productType:e,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:t})=>{const a=X(),c=ee(),n=ne(),[s]=en(),l=s.get("showStepProgress"),i=s.get("isTransferInitiated"),[r,p]=h.useState(!1),{tenantEmailDomain:g}=$(),C=se(),{useDynamicConfig:I}=oe(),k=we(),{configValue:d}=I(Y.zeniAccountsConfig),S=ye(d),y=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}})),_=v((m=>m.companyConfigState.fetchState)),E=v((m=>m.userRoleConfigState.fetchState)),f=v((m=>V(m))),b=f.companyId??U.getSignedInUserTenant(g)?.companyId;if(h.useEffect((()=>{_==="Not-Started"&&n(_n()),E==="Not-Started"&&n(En(!0))}),[_,E,n]),h.useEffect((()=>{if(!r&&y==="Not-Started"&&b!=null)switch(p(!0),e){case"zeni_accounts":n(me(b,!0));break;case"zeni_treasury":n(he(b,!0));break;case"reimbursement":n(pe(b,!0));break;case"charge_cards":n(le(b,!0));break;default:n(Q(b,!0))}}),[r,y,b,n]),U.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let D;switch(e){case"zeni_accounts":D=f.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":D=f.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":D=f.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||f.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":D=f.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:D=f.companyBillPayInfo?.info?.isBillPayTOSAccepted}const A=v((m=>{let P;switch(e){case"zeni_accounts":P=wn(m,b);break;case"zeni_treasury":P=We(m,b);break;case"charge_cards":P=Tn(m,b);break;case"reimbursement":P=vn(m,b);break;default:P=Pn(m,b)}return P}));return D===!1?null:A.fetchState==="Completed"&&D===!0&&C?.loggedInUserRoleMap!=null?u.jsxs(u.Fragment,{children:[u.jsx(ce,{analytics:O,onLoad:m=>(P=>{switch(e){case"zeni_accounts":return P.trackPageLoaded(G.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return P.trackPageLoaded(G.Event.reimbursementBusinessVerification);default:return P.trackPageLoaded(G.Event.billPayBusinessVerification,xe(c)?"Settings":void 0)}})(m)}),u.jsx(It,{businessVerificationDetails:A,navigate:a,location:c,companyId:b,analytics:O,currentTenant:f,productType:e,roleMap:C.loggedInUserRoleMap,isSettings:xe(c),isOverlay:!0,isStepInProgress:l!=null,isTreasuryTransferInitiated:i!=null,onClickMenuIcon:()=>{},maxInsuredAmount:S.maxInsuredAmount,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:t})]}):u.jsx(De,{fetchState:"In-Progress",style:{backgroundColor:k.colors.grey5}})},kt={overlayWidth:new at(100,100,59)},_t=H((function(e,o){const{isUserZeniAccountsAdmin:t,companyId:a,accountsPromoConfig:c}=o,n=V(e),s=U.getSignedInUser(),l=n.tenantId,i={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:l??""},r=Ye(e,a),p=We(e,a),g=t&&r.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&r.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",C=Mn(e),I=C.transactions,k=Ke(e),d=C.accountSummary?.totalBalance?.amount,S=I.length===0||d===0;return{treasurySetupView:r,businessVerificationDetails:p,connectedAccountProvider:n.company?.featuresActivationInfo.connectedAccountProvider??"",transactions:I,transferDetails:k,isFirstTransfer:S,isDisabled:g,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:O,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:i,isOnSetup:!0,maxInsuredAmount:c.maxInsuredAmount}}),(function(e,o){const{navigate:t,companyId:a,currentTenant:c,isAllocationDone:n,analytics:s,treasurySetupView:l}=o;return{onTransferSaveChangesToLocalStore:i=>{e(Gn(i))},onBusinessVerificationSectionClick:(i,r)=>{let p="../verification";i&&(p+="?showStepProgress=true",r&&(p+="&isTransferInitiated=true")),t(p),c?.company?.companyTreasuryInfo!=null&&c?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="pending_review"&&e(he(a,!1,!0))},onFetchLinkTokenClick:(i,r)=>{e(Te("treasury_setup",i,r))},onEstablishConnectionClick:i=>{e(ve(i,a,"treasury_setup","zeni_treasury"))},onUpdatePaymentAccountStatus:(i,r,p)=>{e(Pe(i,r,"zeni_treasury","treasury_setup",p))},onUpdatePaymentAccountLoginStatus:(i,r)=>{e(Ee(!1,i,"zeni_treasury","treasury_setup",r))},onEstablishConnectionSuccess:()=>{e(he(a,!0))},onEnableTreasuryClick:()=>{e(J(a,"zeni_treasury"))},onUpdateTreasuryClick:(i,r,p)=>{e(p==="paymentAccount"?ke(i,r,"zeni_treasury","treasury_setup"):_e("treasury_setup",i,r))},onUpdatePrimaryFundingAccount:(i,r)=>{e(Ae(a,"treasury_setup",i,r))},onNavigateToDashboard:()=>{t(c?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="verified"?"../":"../../")},onCompanyOfficerUpdated:(i,r)=>{e(Ie({officerType:i,fileIds:r}))},onSendForVerificationClick:(i,r)=>{if(e(L(a,i,"zeni_treasury",!0,!0,!0)),!n){const p=l.fundAllocationLocalData;s.trackTreasuryPortfolioConfirm(p.riskScore,Ze(p)),e(Le(!1))}r===!0&&e(qe())},updateFilesEntity:i=>{e(ie({files:i}))},onDeleteFile:i=>{e(ae(i))},onEditFileName:(i,r)=>{e(te(i,r.split(".")[0]))},onAdditionalVerificationFieldsChanged:i=>{const{sourceOfFunds:r}=i;e(Qn({sourceOfFunds:r?.selectedOption??""}))},onUpdateFundAllocation:i=>{s.trackTreasuryAllocationAction("update",Ze(i)),e(Zn(i))},onConfirmFundAllocation:()=>{e(Le(n))},onSignUpClick:()=>{o.isUserZeniAccountsAdmin?window.open("../checking/promo","_blank","noopener,noreferrer"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank","noopener,noreferrer")},onOverlayClose:()=>{e(Oe())}}}))(it),Et=()=>{const e=X(),o=ee(),t=ne(),a=we(),c=tt(),{tenantEmailDomain:n}=$(),{useDynamicConfig:s}=oe(),l=se(),[i,r]=h.useState(!1),p=Ce(l?.loggedInUserRoleMap),{configValue:g}=s(Y.zeniAccountsConfig),C=ye(g),[I,k]=h.useState(!1),[d,S]=h.useState(!1),[y,_]=h.useState(!1),[E,f]=h.useState(!1),[b,D]=h.useState(!1),A=v((w=>w.treasurySetupViewState.fetchState)),m=v((w=>w.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState)),P=v((w=>w.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),j=v((w=>w.treasuryDetailState.transactionsState?.fetchState)),F=v((w=>V(w))),T=U.getSignedInUserTenant(n)?.companyId??F.companyId,R=v((w=>Ye(w,T))),W=R.isAtomicAccountExists,ge=!!F.companyZeniAccountInfo?.info?.isZeniAccountEnabled,Se=U.getSignedInUser(),M=w=>{k(w)};if(Se==null)throw Error("Can't access treasury setup page without signing in...");h.useEffect((()=>{d||A!=="Not-Started"||T==null||(S(!0),t(he(T,!0,!1)))}),[d,A,T,t]),h.useEffect((()=>{y||m!=="Not-Started"||T==null||(_(!0),t(Nn()))}),[y,m,T,t]),h.useEffect((()=>{E||P!=="Not-Started"||T==null||(f(!0),t(Ln()))}),[E,P,T,t]),h.useEffect((()=>{b||j!=="Not-Started"||T==null||(D(!0),t(zn(!0)))}),[b,j,T,t]);const ue=F.companyTreasuryInfo?.info?.businessVerificationStatus?.code,Z=ue==="pending_review"||ue==="verified";return h.useEffect((()=>{i||A!=="Completed"||W||Z||!o.pathname.includes("setup")||r(!0)}),[A,W,Z]),F.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1?u.jsx(x,{to:"../promo"}):u.jsxs(u.Fragment,{children:[u.jsx(ce,{analytics:O,onLoad:()=>{}}),u.jsx(fe,{isAppContentDrawerOpen:I,handleDrawerToggle:M}),u.jsx(rt,{onClose:()=>{t(Oe()),e("../setup")},anchor:"right",open:o.pathname.includes("verification"),transitionDuration:i?0:250,PaperProps:{style:{width:kt.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:i?"transparent":a.colors.black,opacity:.75,cursor:"pointer"}}},children:u.jsx(Pt,{onClick:w=>w.stopPropagation(),children:u.jsx(At,{productType:"zeni_treasury",isBusinessVerificationDrawerOpen:!0,closeDrawerHandler:()=>{t(Oe()),e("../setup")}})})}),u.jsx(_t,{navigate:e,location:o,companyId:T,currentTenant:F,isUserZeniAccountsAdmin:p,accountsPromoConfig:C,isAccountsEnabled:ge,isAllocationDone:W,analytics:O,treasurySetupView:R,onClickMenuIcon:()=>{M(!0)},showTreasurySetupOverlay:i,setShowTreasurySetupOverlay:r})]})},Pt=Fe(ut)`
17
+ `,ht=H((function(e,o){const{isUserRemiAdmin:t,companyId:a}=o,c=B(e),n=Cn(e),s=In(e,a),l=U.getSignedInUser(),i=c.tenantId,r={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i??""},p=t&&s.updateStatus.fetchState!=="In-Progress"&&s.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&s.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&s.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",g=!!c.companyZeniAccountInfo?.info?.isZeniAccountEnabled;return{remiSetupView:s,isDisabled:p,remiApprovalView:n,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isAccountsEnabled:g,meetingUrl:"https://meetings.hubspot.com/niharn/demo-reimbursements?embed=true",analytics:O,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:r}}),(function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{updateMileageDetails:n=>{const{mileageAmount:s,mileageUnit:l,mileageCurrencyCode:i,mileageCurrencySymbol:r,denomination:p,denominationSymbol:g,mileageAmountInDenomination:C,description:I}=n;e(kn({mileageDetails:{mileageUnitAmount:{amount:s,currencyCode:i,currencySymbol:r},denomination:p,denominationSymbol:g,mileageAmountInDenomination:C,mileageCurrencyCode:i,mileageCurrencySymbol:r,mileageUnit:l,description:I}}))},onSaveMileageClick:n=>{e(An(a)),O.trackReimbursementMileageRateSave(n)},onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyReimbursementInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(pe(a,!1,!0))},onSetupApprovalRulesSectionClick:()=>{t("../approval-rules")},onFetchLinkTokenClick:(n,s)=>{e(Te("reimbursement_setup",n,s))},onEstablishConnectionClick:n=>{e(ve(n,a,"reimbursement_setup","reimbursement"))},onUpdatePaymentAccountStatus:(n,s,l)=>{e(Pe(n,s,"reimbursement","reimbursement_setup",l))},onUpdatePaymentAccountLoginStatus:(n,s)=>{e(Ee(!1,n,"reimbursement","reimbursement_setup",s))},onEstablishConnectionSuccess:()=>{e(pe(a,!0))},onEnableRemiClick:()=>{e(J(a,"reimbursement"))},onUpdateAccountClick:(n,s,l)=>{e(l==="paymentAccount"?ke(n,s,"reimbursement","reimbursement_setup"):_e("reimbursement_setup",n,s))},onEnableRemiSuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyReimbursementInfo?.info?.isReimbursementEnabled!=null&&c.companyReimbursementInfo.info.isReimbursementEnabled===!1?t("../.."):t("../",{relative:"path"})},onCompanyOfficerUpdated:(n,s)=>{e(Ie({officerType:n,fileIds:s}))},onSendForVerificationClick:n=>{e(L(a,n,"reimbursement",!0,!0,!0))},updateFilesEntity:n=>{e(ie({files:n}))},onDeleteFile:n=>{e(ae(n))},onEditFileName:(n,s)=>{e(te(n,s.split(".")[0]))},onUpdatePrimaryFundingAccount:(n,s)=>{e(Ae(a,"reimbursement_setup",n,s))},onSignUpClick:()=>{o.hasZeniAccountsAdminAccess?window.open("../checking/promo","_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}))(et),Ct=()=>{const e=X(),o=ee(),t=ne(),{tenantEmailDomain:a}=$(),c=se(),{useDynamicConfig:n}=oe(),s=we(),{configValue:l}=n(Y.zeniAccountsConfig),i=ye(l),r=bn(c?.loggedInUserRoleMap),p=Ce(c?.loggedInUserRoleMap),[g,C]=h.useState(!1),I=h.useRef(!1),[k,d]=h.useState(!1),S=v((m=>m.remiSetupViewState.fetchState)),y=v((m=>B(m))),_=v((m=>m.remiSetupApproverViewState.fetchState)),{isApprovalRulesV3Enabled:E,isLoading:f}=Xe(y?.tenantId),b=U.getSignedInUserTenant(a)?.companyId??y.companyId,D=U.getSignedInUser(),A=m=>{C(m)};if(D==null)throw Error("Can't access reimbursement setup page without signing in...");if(h.useEffect((()=>{I.current||S!=="Not-Started"||b==null?I.current||S!=="Completed"||b==null||y.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||(I.current=!0,t(pe(b,!1,!0))):(I.current=!0,t(pe(b,!0)))}),[S,b,t]),h.useEffect((()=>{k||_!=="Not-Started"||f||(d(!0),t(hn(!0,!1,!1,E)))}),[k,_,f,E,t]),y.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1)return u.jsx(x,{to:"../promo"});if(y.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!0){const m=P=>P.trackPageLoaded(G.Event.reimbursementSetup);return u.jsxs(bt,{children:[u.jsx(ce,{analytics:O,onLoad:P=>m(P)}),u.jsx(fe,{isAppContentDrawerOpen:g,handleDrawerToggle:A}),u.jsx(ht,{navigate:e,location:o,companyId:b,currentTenant:y,isUserRemiAdmin:r,onClickMenuIcon:()=>{A(!0)},hasZeniAccountsAdminAccess:p,accountsPromoConfig:i})]})}return u.jsx(De,{fetchState:"In-Progress",style:{backgroundColor:s.colors.grey5}})},It=H((function(e,o){const{businessVerificationDetails:t,productType:a}=o,c=B(e),n=U.getSignedInUser(),s=c.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:s??""},i=Dn(o.roleMap)&&t.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",r=Un(e.companyConfigState),p=On(e.userRoleConfigState),g=a==="zeni_treasury"?Ke(e):void 0;return{businessVerificationDetails:t,verficationDetailsFetchState:t.fetchState,isRefreshingViewInBackground:t.isRefreshingViewInBackground,allNationalityCountries:t.allNationalityCountries,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:i,allIndustries:r.companyIndustries??[],companyTitles:p.companyTitles,transferDetails:g}}),(function(e,o){const{companyId:t,productType:a,currentTenant:c,navigate:n,location:s}=o,{tenantEmailDomain:l}=c;return{onCompanyDetailsChanged:i=>{const{companyDescription:r,companyIndustry:p,companyIndustryType:g,companyLegalName:C,companyTaxId:I,companyWebsite:k,companyPhone:d,primaryContactEmail:S,primaryContactName:y,primaryContactUserId:_,primaryContactSyncToken:E,syncToken:f,fileIds:b,incDate:D,typeOfIncorporation:A,stateOfIncorporation:m,sourceOfFunds:P,companySubIndustry:j,countriesOfOperations:F,companySourceOfFunds:T,companySourceOfFundsDescription:R,transactionVolume:W,transactionVolumeDescription:ge,purposeOfAccount:Se,purposeOfAccountDescription:M,regulatedStatus:ue,regulatedStatusDescription:Z,usNexus:w,usNexusTypes:Be}=i,de=g?.selectedOption,Ve={companyId:t,companyDescription:r,companyIndustry:p.selectedOption,companyIndustryType:de==null||de===""?void 0:de,companyLegalName:C,taxIdOrEIN:I,website:k!=""&&k!=null?Rn(k):void 0,phone:d,syncToken:f,fileIds:b,incDate:D!=null?Re(D?.toString()):D,typeOfIncorporation:A?.selectedOption??"",stateOfIncorporation:m?.selectedOption??"",sourceOfFunds:P?.selectedOption??"",companySubIndustry:j?.selectedOption??"",countriesOfOperations:F?.selectedOptions.map((K=>K.length===2?K:Me(K)))??[],companySourceOfFunds:T?.selectedOption??"",companySourceOfFundsDescription:R,transactionVolume:W?.selectedOption??"",transactionVolumeDescription:ge,purposeOfAccount:Se?.selectedOption??"",purposeOfAccountDescription:M,regulatedStatus:ue??"",regulatedStatusDescription:Z,usNexus:w,usNexusTypes:Be?.selectedOptions??[]},be={userId:_,firstName:y.firstName,lastName:y.lastName,email:S,syncToken:E};e(Ne({companyDetails:Ve,primaryContactDetails:be}))},onCompanyOfficerUpdated:i=>{const r=i.map((p=>{const{officerType:g,userId:C,name:I,email:k,nationalityCountryCode:d,ssn:S,dob:y,phone:_,syncToken:E,selectDocument:f,role:b,ownership:D,isSelectedForVerification:A,userVerificationStatus:m,treasuryUserVerificationStatus:P,fileIds:j}=p;let F;return f.selectDocumentType==="driverLicense"?F="driving_license":f.selectDocumentType==="passport"?F="passport":f.selectDocumentType==="stateId"?F="id_document":f.selectDocumentType==="ssnCard"&&(F="social_security_card"),{officerType:g,userId:C,firstName:I.firstName,lastName:I.lastName,email:k,ssn:S,nationalityCountryCode:d?.selectedOption!=null?Me(d.selectedOption):void 0,phone:_,birthday:y!=null?Re(y?.toString()):y,syncToken:E,titleAtCompany:b.selectedOption,ownershipInCompany:D,documentTypeSelectedForVerification:F,isSelectedForVerification:A,userVerificationStatus:m,treasuryUserVerificationStatus:P,fileIds:j,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}}));e(Ne({officers:r}))},onSaveDetailsClick:i=>{e(L(t,i,a))},onSendForVerificationClick:i=>{e(L(t,i,a,!0))},onAddressClick:i=>{const r=Qe(l,i),p=ze(s.state?.pathnameStackToGoBack,s.pathname),g=new URLSearchParams(s.search),C={};g.forEach(((I,k)=>{C[k]=I})),n(r,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(C).length>0?C:void 0}})},onRegisteredAddressClick:i=>{const r=Qe(l,i),p=ze(s.state?.pathnameStackToGoBack,s.pathname),g=new URLSearchParams(s.search),C=Object.fromEntries(g.entries());n(r,{state:{pathnameStackToGoBack:p,queryParams:Object.keys(C).length>0?C:void 0}})},onBackClick:()=>{e(jn({companyId:t})),n("../setup")},updateFilesEntity:i=>{e(ie({files:i}))},onDeleteFile:i=>{e(ae(i))},onDeleteFileList:i=>{e(Je(i))},onEditFileName:(i,r)=>{e(te(i,r.split(".")[0]))},onGetOtp:i=>{e(He(i,"SpendManagementSetup"))},onResendOtp:i=>{e($e(i,"SpendManagementSetup"))},onVerifyOtp:(i,r)=>{e(Ge(i,r,"SpendManagementSetup"))},saveNewAddressInLocalStore:(i,r)=>{e(xn({addressType:i,addressToCreate:r}))},onExecuteTreasuryTransfer:()=>{e(qe())},onOverlayClose:()=>{e(Oe())},onIdentityDocumentUploadedForAutofill:i=>{if(t==null)return;const r=Bn(i.documentType);r!=null&&e(Vn({target:"setup",companyId:t,officerType:i.officerType,fileId:i.fileId,documentType:r}))},onCompanyDocumentUploadedForAutofill:i=>{t!=null&&e(Fn({target:"setup",companyId:t,fileId:i.fileId,documentType:i.documentType}))}}}))(nt),At=({productType:e,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:t})=>{const a=X(),c=ee(),n=ne(),[s]=en(),l=s.get("showStepProgress"),i=s.get("isTransferInitiated"),[r,p]=h.useState(!1),{tenantEmailDomain:g}=$(),C=se(),{useDynamicConfig:I}=oe(),k=we(),{configValue:d}=I(Y.zeniAccountsConfig),S=ye(d),y=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}})),_=v((m=>m.companyConfigState.fetchState)),E=v((m=>m.userRoleConfigState.fetchState)),f=v((m=>B(m))),b=f.companyId??U.getSignedInUserTenant(g)?.companyId;if(h.useEffect((()=>{_==="Not-Started"&&n(_n()),E==="Not-Started"&&n(En(!0))}),[_,E,n]),h.useEffect((()=>{if(!r&&y==="Not-Started"&&b!=null)switch(p(!0),e){case"zeni_accounts":n(me(b,!0));break;case"zeni_treasury":n(he(b,!0));break;case"reimbursement":n(pe(b,!0));break;case"charge_cards":n(le(b,!0));break;default:n(Q(b,!0))}}),[r,y,b,n]),U.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let D;switch(e){case"zeni_accounts":D=f.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":D=f.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":D=f.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||f.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":D=f.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:D=f.companyBillPayInfo?.info?.isBillPayTOSAccepted}const A=v((m=>{let P;switch(e){case"zeni_accounts":P=wn(m,b);break;case"zeni_treasury":P=We(m,b);break;case"charge_cards":P=Tn(m,b);break;case"reimbursement":P=vn(m,b);break;default:P=Pn(m,b)}return P}));return D===!1?null:A.fetchState==="Completed"&&D===!0&&C?.loggedInUserRoleMap!=null?u.jsxs(u.Fragment,{children:[u.jsx(ce,{analytics:O,onLoad:m=>(P=>{switch(e){case"zeni_accounts":return P.trackPageLoaded(G.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return P.trackPageLoaded(G.Event.reimbursementBusinessVerification);default:return P.trackPageLoaded(G.Event.billPayBusinessVerification,xe(c)?"Settings":void 0)}})(m)}),u.jsx(It,{businessVerificationDetails:A,navigate:a,location:c,companyId:b,analytics:O,currentTenant:f,productType:e,roleMap:C.loggedInUserRoleMap,isSettings:xe(c),isOverlay:!0,isStepInProgress:l!=null,isTreasuryTransferInitiated:i!=null,onClickMenuIcon:()=>{},maxInsuredAmount:S.maxInsuredAmount,isBusinessVerificationDrawerOpen:o,closeDrawerHandler:t})]}):u.jsx(De,{fetchState:"In-Progress",style:{backgroundColor:k.colors.grey5}})},kt={overlayWidth:new at(100,100,59)},_t=H((function(e,o){const{isUserZeniAccountsAdmin:t,companyId:a,accountsPromoConfig:c}=o,n=B(e),s=U.getSignedInUser(),l=n.tenantId,i={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:l??""},r=Ye(e,a),p=We(e,a),g=t&&r.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&r.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&r.accountUpdateStatus?.fetchState!=="In-Progress"?void 0:"readonly",C=Mn(e),I=C.transactions,k=Ke(e),d=C.accountSummary?.totalBalance?.amount,S=I.length===0||d===0;return{treasurySetupView:r,businessVerificationDetails:p,connectedAccountProvider:n.company?.featuresActivationInfo.connectedAccountProvider??"",transactions:I,transferDetails:k,isFirstTransfer:S,isDisabled:g,meetingUrl:"https://meetings.hubspot.com/niharn/demo-accounts?embed=true",analytics:O,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:i,isOnSetup:!0,maxInsuredAmount:c.maxInsuredAmount}}),(function(e,o){const{navigate:t,companyId:a,currentTenant:c,isAllocationDone:n,analytics:s,treasurySetupView:l}=o;return{onTransferSaveChangesToLocalStore:i=>{e(Gn(i))},onBusinessVerificationSectionClick:(i,r)=>{let p="../verification";i&&(p+="?showStepProgress=true",r&&(p+="&isTransferInitiated=true")),t(p),c?.company?.companyTreasuryInfo!=null&&c?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="pending_review"&&e(he(a,!1,!0))},onFetchLinkTokenClick:(i,r)=>{e(Te("treasury_setup",i,r))},onEstablishConnectionClick:i=>{e(ve(i,a,"treasury_setup","zeni_treasury"))},onUpdatePaymentAccountStatus:(i,r,p)=>{e(Pe(i,r,"zeni_treasury","treasury_setup",p))},onUpdatePaymentAccountLoginStatus:(i,r)=>{e(Ee(!1,i,"zeni_treasury","treasury_setup",r))},onEstablishConnectionSuccess:()=>{e(he(a,!0))},onEnableTreasuryClick:()=>{e(J(a,"zeni_treasury"))},onUpdateTreasuryClick:(i,r,p)=>{e(p==="paymentAccount"?ke(i,r,"zeni_treasury","treasury_setup"):_e("treasury_setup",i,r))},onUpdatePrimaryFundingAccount:(i,r)=>{e(Ae(a,"treasury_setup",i,r))},onNavigateToDashboard:()=>{t(c?.company?.companyTreasuryInfo?.businessVerificationStatus?.code==="verified"?"../":"../../")},onCompanyOfficerUpdated:(i,r)=>{e(Ie({officerType:i,fileIds:r}))},onSendForVerificationClick:(i,r)=>{if(e(L(a,i,"zeni_treasury",!0,!0,!0)),!n){const p=l.fundAllocationLocalData;s.trackTreasuryPortfolioConfirm(p.riskScore,Ze(p)),e(Le(!1))}r===!0&&e(qe())},updateFilesEntity:i=>{e(ie({files:i}))},onDeleteFile:i=>{e(ae(i))},onEditFileName:(i,r)=>{e(te(i,r.split(".")[0]))},onAdditionalVerificationFieldsChanged:i=>{const{sourceOfFunds:r}=i;e(Qn({sourceOfFunds:r?.selectedOption??""}))},onUpdateFundAllocation:i=>{s.trackTreasuryAllocationAction("update",Ze(i)),e(Zn(i))},onConfirmFundAllocation:()=>{e(Le(n))},onSignUpClick:()=>{o.isUserZeniAccountsAdmin?window.open("../checking/promo","_blank","noopener,noreferrer"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank","noopener,noreferrer")},onOverlayClose:()=>{e(Oe())}}}))(it),Et=()=>{const e=X(),o=ee(),t=ne(),a=we(),c=tt(),{tenantEmailDomain:n}=$(),{useDynamicConfig:s}=oe(),l=se(),[i,r]=h.useState(!1),p=Ce(l?.loggedInUserRoleMap),{configValue:g}=s(Y.zeniAccountsConfig),C=ye(g),[I,k]=h.useState(!1),[d,S]=h.useState(!1),[y,_]=h.useState(!1),[E,f]=h.useState(!1),[b,D]=h.useState(!1),A=v((w=>w.treasurySetupViewState.fetchState)),m=v((w=>w.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState)),P=v((w=>w.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),j=v((w=>w.treasuryDetailState.transactionsState?.fetchState)),F=v((w=>B(w))),T=U.getSignedInUserTenant(n)?.companyId??F.companyId,R=v((w=>Ye(w,T))),W=R.isAtomicAccountExists,ge=!!F.companyZeniAccountInfo?.info?.isZeniAccountEnabled,Se=U.getSignedInUser(),M=w=>{k(w)};if(Se==null)throw Error("Can't access treasury setup page without signing in...");h.useEffect((()=>{d||A!=="Not-Started"||T==null||(S(!0),t(he(T,!0,!1)))}),[d,A,T,t]),h.useEffect((()=>{y||m!=="Not-Started"||T==null||(_(!0),t(Nn()))}),[y,m,T,t]),h.useEffect((()=>{E||P!=="Not-Started"||T==null||(f(!0),t(Ln()))}),[E,P,T,t]),h.useEffect((()=>{b||j!=="Not-Started"||T==null||(D(!0),t(zn(!0)))}),[b,j,T,t]);const ue=F.companyTreasuryInfo?.info?.businessVerificationStatus?.code,Z=ue==="pending_review"||ue==="verified";return h.useEffect((()=>{i||A!=="Completed"||W||Z||!o.pathname.includes("setup")||r(!0)}),[A,W,Z]),F.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1?u.jsx(x,{to:"../promo"}):u.jsxs(u.Fragment,{children:[u.jsx(ce,{analytics:O,onLoad:()=>{}}),u.jsx(fe,{isAppContentDrawerOpen:I,handleDrawerToggle:M}),u.jsx(rt,{onClose:()=>{t(Oe()),e("../setup")},anchor:"right",open:o.pathname.includes("verification"),transitionDuration:i?0:250,PaperProps:{style:{width:kt.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:i?"transparent":a.colors.black,opacity:.75,cursor:"pointer"}}},children:u.jsx(Pt,{onClick:w=>w.stopPropagation(),children:u.jsx(At,{productType:"zeni_treasury",isBusinessVerificationDrawerOpen:!0,closeDrawerHandler:()=>{t(Oe()),e("../setup")}})})}),u.jsx(_t,{navigate:e,location:o,companyId:T,currentTenant:F,isUserZeniAccountsAdmin:p,accountsPromoConfig:C,isAccountsEnabled:ge,isAllocationDone:W,analytics:O,treasurySetupView:R,onClickMenuIcon:()=>{M(!0)},showTreasurySetupOverlay:i,setShowTreasurySetupOverlay:r})]})},Pt=Fe(ut)`
18
18
  display: flex;
19
19
  min-height: 100%;
20
20
  flex-direction: column;
21
- `,vt=H((function(e,o){const{isUserZeniAccountsAdmin:t,companyId:a}=o,c=V(e),n=U.getSignedInUser(),s=c.tenantId,l={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:s??""},i=$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:O,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:l}}),(function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyZeniAccountInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(me(a,!1,!0))},onFetchLinkTokenClick:(n,s)=>{e(Te("account_setup",n,s))},onEstablishConnectionClick:n=>{e(ve(n,a,"account_setup","zeni_accounts"))},onUpdatePaymentAccountStatus:(n,s,l)=>{e(Pe(n,s,"zeni_accounts","account_setup",l))},onUpdatePaymentAccountLoginStatus:(n,s)=>{e(Ee(!1,n,"zeni_accounts","account_setup",s))},onEstablishConnectionSuccess:()=>{e(me(a,!0))},onEnableZeniAccountClick:()=>{e(J(a,"zeni_accounts"))},onUpdateZeniAccountClick:(n,s,l)=>{e(l==="paymentAccount"?ke(n,s,"zeni_accounts","account_setup"):_e("account_setup",n,s))},onUpdatePrimaryFundingAccount:(n,s)=>{e(Ae(a,"account_setup",n,s))},onEnableZeniAccountSuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyZeniAccountInfo?.info?.isZeniAccountEnabled?t("../"):t("../../")},onNavigateToDashboard:()=>{t("../../dashboard")},onCompanyOfficerUpdated:(n,s)=>{e(Ie({officerType:n,fileIds:s}))},onSendForVerificationClick:n=>{e(L(a,n,"zeni_accounts",!0,!0,!0))},updateFilesEntity:n=>{e(ie({files:n}))},onDeleteFile:n=>{e(ae(n))},onEditFileName:(n,s)=>{e(te(n,s.split(".")[0]))}}}))(st),Tt=()=>{const e=X(),o=ee(),t=ne(),{tenantEmailDomain:a}=$(),{useDynamicConfig:c}=oe(),n=se(),s=Ce(n?.loggedInUserRoleMap),{configValue:l}=c(Y.zeniAccountsConfig),i=ye(l),[r,p]=h.useState(!1),[g,C]=h.useState(!1),I=v((_=>_.zeniAccountSetupViewState.fetchState)),k=v((_=>V(_))),d=U.getSignedInUserTenant(a)?.companyId??k.companyId,S=U.getSignedInUser(),y=_=>{p(_)};if(S==null)throw Error("Can't access zeni bank account setup page without signing in...");if(h.useEffect((()=>{g||I!=="Not-Started"||d==null?g||I!=="Completed"||d==null||k.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(me(d,!1,!0)):(C(!0),t(me(d,!0)))}),[g,I,d,t]),k.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted===!1)return u.jsx(x,{to:"../promo"});{const _=E=>E.trackPageLoaded(G.Event.zeniAccountsSetup);return u.jsxs(u.Fragment,{children:[u.jsx(ce,{analytics:O,onLoad:E=>_(E)}),u.jsx(fe,{isAppContentDrawerOpen:r,handleDrawerToggle:y}),u.jsx(vt,{navigate:e,location:o,companyId:d,currentTenant:k,isUserZeniAccountsAdmin:s,accountsPromoConfig:i,onClickMenuIcon:()=>{y(!0)}})]})}},wt=Fe.div`
21
+ `,vt=H((function(e,o){const{isUserZeniAccountsAdmin:t,companyId:a}=o,c=B(e),n=U.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:O,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:l}}),(function(e,o){const{navigate:t,companyId:a,currentTenant:c}=o;return{onBusinessVerificationSectionClick:()=>{t("../verification"),c?.company?.companyZeniAccountInfo!=null&&c?.company?.companyBillPayInfo?.businessVerificationStatus?.code==="pending_review"&&e(me(a,!1,!0))},onFetchLinkTokenClick:(n,s)=>{e(Te("account_setup",n,s))},onEstablishConnectionClick:n=>{e(ve(n,a,"account_setup","zeni_accounts"))},onUpdatePaymentAccountStatus:(n,s,l)=>{e(Pe(n,s,"zeni_accounts","account_setup",l))},onUpdatePaymentAccountLoginStatus:(n,s)=>{e(Ee(!1,n,"zeni_accounts","account_setup",s))},onEstablishConnectionSuccess:()=>{e(me(a,!0))},onEnableZeniAccountClick:()=>{e(J(a,"zeni_accounts"))},onUpdateZeniAccountClick:(n,s,l)=>{e(l==="paymentAccount"?ke(n,s,"zeni_accounts","account_setup"):_e("account_setup",n,s))},onUpdatePrimaryFundingAccount:(n,s)=>{e(Ae(a,"account_setup",n,s))},onEnableZeniAccountSuccess:()=>{t("../",{relative:"path"})},onBackClick:()=>{c?.companyZeniAccountInfo?.info?.isZeniAccountEnabled?t("../"):t("../../")},onNavigateToDashboard:()=>{t("../../dashboard")},onCompanyOfficerUpdated:(n,s)=>{e(Ie({officerType:n,fileIds:s}))},onSendForVerificationClick:n=>{e(L(a,n,"zeni_accounts",!0,!0,!0))},updateFilesEntity:n=>{e(ie({files:n}))},onDeleteFile:n=>{e(ae(n))},onEditFileName:(n,s)=>{e(te(n,s.split(".")[0]))}}}))(st),Tt=()=>{const e=X(),o=ee(),t=ne(),{tenantEmailDomain:a}=$(),{useDynamicConfig:c}=oe(),n=se(),s=Ce(n?.loggedInUserRoleMap),{configValue:l}=c(Y.zeniAccountsConfig),i=ye(l),[r,p]=h.useState(!1),[g,C]=h.useState(!1),I=v((_=>_.zeniAccountSetupViewState.fetchState)),k=v((_=>B(_))),d=U.getSignedInUserTenant(a)?.companyId??k.companyId,S=U.getSignedInUser(),y=_=>{p(_)};if(S==null)throw Error("Can't access zeni bank account setup page without signing in...");if(h.useEffect((()=>{g||I!=="Not-Started"||d==null?g||I!=="Completed"||d==null||k.companyBillPayInfo?.info?.businessVerificationStatus?.code!=="pending_review"||t(me(d,!1,!0)):(C(!0),t(me(d,!0)))}),[g,I,d,t]),k.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted===!1)return u.jsx(x,{to:"../promo"});{const _=E=>E.trackPageLoaded(G.Event.zeniAccountsSetup);return u.jsxs(u.Fragment,{children:[u.jsx(ce,{analytics:O,onLoad:E=>_(E)}),u.jsx(fe,{isAppContentDrawerOpen:r,handleDrawerToggle:y}),u.jsx(vt,{navigate:e,location:o,companyId:d,currentTenant:k,isUserZeniAccountsAdmin:s,accountsPromoConfig:i,onClickMenuIcon:()=>{y(!0)}})]})}},wt=Fe.div`
22
22
  display: flex;
23
23
  height: 100vh;
24
24
  width: 100%;
@@ -26,4 +26,4 @@ import{j as u}from"./liveblocks-C8AAaKDR.js";import{h as X,g as ee,u as ne,i as
26
26
  flex-direction: column;
27
27
  align-items: center;
28
28
  background-color: ${e=>e.theme.colors.grey4};
29
- `,Dt=H((function(e,o){const t=V(e),a=U.getSignedInUser(),c=t.tenantId,n={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:c??""};return{internationalOnboardingDetails:Kn(e),isReadonly:o.isFormReadonly,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:n,analytics:O}}),(function(e,o){const{navigate:t}=o;return{onFormDataChange:a=>{e(Jn(a))},onSubmitClick:()=>{e(qn(o.companyId))},onCancelClick:()=>{t("../setup")},updateFilesEntity:a=>{e(ie({files:a}))},onDeleteFile:a=>{e(ae(a))},onDeleteFileList:a=>{e(Je(a))},onEditFileName:(a,c)=>{e(te(a,c.split(".")[0]))}}}))(ot),Ut=()=>{const e=X(),o=ee(),t=ne(),[a,c]=h.useState(!1),[n,s]=h.useState(!1),[l,i]=h.useState(!1),{tenantEmailDomain:r}=$(),p=se(),{useFeatureGate:g}=oe(),{isFeatureEnabled:C}=g(q.isBillPayLocalCurrencyFeatureEnabled),I=v((A=>A.internationalWireVerificationState.verificationFormFetchState.fetchState)),k=v((A=>A.billPaySetupViewState.fetchState)),d=v((A=>V(A))),S=we(),y=d.companyId??U.getSignedInUserTenant(r)?.companyId,_=v((A=>Hn(A.companyState,d.companyId))),E=_?.company.companyBillPayInfo.internationalWireOnboardingStatus,f=E?.code==="onboarding_status_not_started"?void 0:"readonly";if(h.useEffect((()=>{a||I!=="Not-Started"||y==null||(c(!0),t(Wn(y)))}),[a,I,y,t]),h.useEffect((()=>{n||k!=="Not-Started"||y==null||(s(!0),t(Q(y,!0)))}),[k,n,y,t]),U.getSignedInUser()==null)throw Error("Can't access international verification without signing in...");const b=d.companyBillPayInfo?.info?.isBillPayTOSAccepted,D=A=>{i(A)};return b===!1?u.jsx(x,{to:"../promo"}):b===!0&&p?.loggedInUserRoleMap!=null?u.jsxs(wt,{children:[u.jsx(ce,{analytics:O,onLoad:A=>(m=>m.trackPageLoaded(G.Event.billPayBusinessVerification,void 0))(A)}),xe(o)?u.jsx(fe,{isAppContentDrawerOpen:l,handleDrawerToggle:D}):null,u.jsx(Dt,{navigate:e,location:o,companyId:y,analytics:O,currentTenant:d,roleMap:p.loggedInUserRoleMap,isFormReadonly:f,isLocalCurrencyEnabled:C})]}):u.jsx(De,{fetchState:"In-Progress",style:{backgroundColor:S.colors.grey5}})},Ot=H((function(){return{}}),(function(e,o){const{companyId:t,productType:a}=o;return{onEventReceived:c=>{switch(c){case"bill-pay-set-up-verification-update":case"bill-pay-wise-setup":switch(a){case"reimbursement":e(pe(t,!0,!0));break;case"zeni_accounts":e(me(t,!0,!0));break;case"charge_cards":e(le(t,!0,!0));break;case"zeni_treasury":e(he(t,!0,!0));break;default:e(Q(t,!0,!0))}}}}}))(ct((e=>{const{isBillPayAdminLevelAccess:o,isUserHasOnlyBillPayAccess:t,isReimbursementAdminLevelAccess:a,isZeniAccountAdminLevelAccess:c,isTreasuryAdminLevelAccess:n,isChargeCardAdminLevelAccess:s,isUserHasOnlyCardAccess:l,productType:i,type:r}=e;switch(i){case"bill_pay":switch(r){case"verification":return o?u.jsx(Ue,{productType:i}):t?u.jsx(x,{to:"../"}):u.jsx(N,{});case"international-wire":return o?u.jsx(Ut,{}):t?u.jsx(x,{to:"../"}):u.jsx(N,{});default:return o?u.jsx(pt,{}):t?u.jsx(x,{to:"../"}):u.jsx(N,{})}case"reimbursement":return r==="verification"?a?u.jsx(Ue,{productType:i}):u.jsx(N,{}):a?u.jsx(Ct,{}):u.jsx(N,{});case"zeni_accounts":return r==="verification"?c?u.jsx(Ue,{productType:"zeni_accounts"}):u.jsx(N,{}):c?u.jsx(Tt,{}):u.jsx(N,{});case"zeni_treasury":return n===!0?u.jsx(Et,{}):u.jsx(N,{});case"charge_cards":return r==="verification"?s?u.jsx(Ue,{productType:"charge_cards"}):l?u.jsx(x,{to:"../"}):u.jsx(N,{}):s?u.jsx(St,{}):l?u.jsx(x,{to:"../"}):u.jsx(N,{})}})));function oa(e){const{tenantEmailDomain:o}=$(),t=v((c=>V(c))).companyId??U.getSignedInUserTenant(o)?.companyId,a={events:t!=null?[`private-encrypted-${t}.bill-pay-set-up-verification-update`,`private-encrypted-${t}.bill-pay-wise-setup`]:[],eventCallback:(c,n,s)=>{s.onEventReceived(c)}};if(U.getSignedInUser()==null)throw Error("Can't access setup details page without signing in...");return u.jsx(Ot,{...e,companyId:t,...a})}export{na as A,ta as P,oa as S,Yt as a,ea as b,yt as c,ft as d,mt as e,aa as f,Wt as g,Gt as h,Jt as i,Xt as j,ia as k,qt as l,Kt as m,$t as n,Ht as o,Qt as p,sa as s};
29
+ `,Dt=H((function(e,o){const t=B(e),a=U.getSignedInUser(),c=t.tenantId,n={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:c??""};return{internationalOnboardingDetails:Kn(e),isReadonly:o.isFormReadonly,filesEndPoint:`${re.fileMicroServiceBaseUrl}`,authParams:n,analytics:O}}),(function(e,o){const{navigate:t}=o;return{onFormDataChange:a=>{e(Jn(a))},onSubmitClick:()=>{e(qn(o.companyId))},onCancelClick:()=>{t("../setup")},updateFilesEntity:a=>{e(ie({files:a}))},onDeleteFile:a=>{e(ae(a))},onDeleteFileList:a=>{e(Je(a))},onEditFileName:(a,c)=>{e(te(a,c.split(".")[0]))}}}))(ot),Ut=()=>{const e=X(),o=ee(),t=ne(),[a,c]=h.useState(!1),[n,s]=h.useState(!1),[l,i]=h.useState(!1),{tenantEmailDomain:r}=$(),p=se(),{useFeatureGate:g}=oe(),{isFeatureEnabled:C}=g(q.isBillPayLocalCurrencyFeatureEnabled),I=v((A=>A.internationalWireVerificationState.verificationFormFetchState.fetchState)),k=v((A=>A.billPaySetupViewState.fetchState)),d=v((A=>B(A))),S=we(),y=d.companyId??U.getSignedInUserTenant(r)?.companyId,_=v((A=>Hn(A.companyState,d.companyId))),E=_?.company.companyBillPayInfo.internationalWireOnboardingStatus,f=E?.code==="onboarding_status_not_started"?void 0:"readonly";if(h.useEffect((()=>{a||I!=="Not-Started"||y==null||(c(!0),t(Wn(y)))}),[a,I,y,t]),h.useEffect((()=>{n||k!=="Not-Started"||y==null||(s(!0),t(Q(y,!0)))}),[k,n,y,t]),U.getSignedInUser()==null)throw Error("Can't access international verification without signing in...");const b=d.companyBillPayInfo?.info?.isBillPayTOSAccepted,D=A=>{i(A)};return b===!1?u.jsx(x,{to:"../promo"}):b===!0&&p?.loggedInUserRoleMap!=null?u.jsxs(wt,{children:[u.jsx(ce,{analytics:O,onLoad:A=>(m=>m.trackPageLoaded(G.Event.billPayBusinessVerification,void 0))(A)}),xe(o)?u.jsx(fe,{isAppContentDrawerOpen:l,handleDrawerToggle:D}):null,u.jsx(Dt,{navigate:e,location:o,companyId:y,analytics:O,currentTenant:d,roleMap:p.loggedInUserRoleMap,isFormReadonly:f,isLocalCurrencyEnabled:C})]}):u.jsx(De,{fetchState:"In-Progress",style:{backgroundColor:S.colors.grey5}})},Ot=H((function(){return{}}),(function(e,o){const{companyId:t,productType:a}=o;return{onEventReceived:c=>{switch(c){case"bill-pay-set-up-verification-update":case"bill-pay-wise-setup":switch(a){case"reimbursement":e(pe(t,!0,!0));break;case"zeni_accounts":e(me(t,!0,!0));break;case"charge_cards":e(le(t,!0,!0));break;case"zeni_treasury":e(he(t,!0,!0));break;default:e(Q(t,!0,!0))}}}}}))(ct((e=>{const{isBillPayAdminLevelAccess:o,isUserHasOnlyBillPayAccess:t,isReimbursementAdminLevelAccess:a,isZeniAccountAdminLevelAccess:c,isTreasuryAdminLevelAccess:n,isChargeCardAdminLevelAccess:s,isUserHasOnlyCardAccess:l,productType:i,type:r}=e;switch(i){case"bill_pay":switch(r){case"verification":return o?u.jsx(Ue,{productType:i}):t?u.jsx(x,{to:"../"}):u.jsx(N,{});case"international-wire":return o?u.jsx(Ut,{}):t?u.jsx(x,{to:"../"}):u.jsx(N,{});default:return o?u.jsx(pt,{}):t?u.jsx(x,{to:"../"}):u.jsx(N,{})}case"reimbursement":return r==="verification"?a?u.jsx(Ue,{productType:i}):u.jsx(N,{}):a?u.jsx(Ct,{}):u.jsx(N,{});case"zeni_accounts":return r==="verification"?c?u.jsx(Ue,{productType:"zeni_accounts"}):u.jsx(N,{}):c?u.jsx(Tt,{}):u.jsx(N,{});case"zeni_treasury":return n===!0?u.jsx(Et,{}):u.jsx(N,{});case"charge_cards":return r==="verification"?s?u.jsx(Ue,{productType:"charge_cards"}):l?u.jsx(x,{to:"../"}):u.jsx(N,{}):s?u.jsx(St,{}):l?u.jsx(x,{to:"../"}):u.jsx(N,{})}})));function oa(e){const{tenantEmailDomain:o}=$(),t=v((c=>B(c))).companyId??U.getSignedInUserTenant(o)?.companyId,a={events:t!=null?[`private-encrypted-${t}.bill-pay-set-up-verification-update`,`private-encrypted-${t}.bill-pay-wise-setup`]:[],eventCallback:(c,n,s)=>{s.onEventReceived(c)}};if(U.getSignedInUser()==null)throw Error("Can't access setup details page without signing in...");return u.jsx(Ot,{...e,companyId:t,...a})}export{na as A,ta as P,oa as S,Yt as a,ea as b,yt as c,ft as d,mt as e,aa as f,Wt as g,Gt as h,Jt as i,Xt as j,ia as k,qt as l,Kt as m,$t as n,Ht as o,Qt as p,sa as s};
@@ -0,0 +1 @@
1
+ import{j as f}from"./liveblocks-bqFl_SVp.js";import{a as u,b as M,q as T}from"./sentry-Bj_fC7Ll.js";import{u as A,h as z,j as l,g as D,N as O,n as j}from"./core-Bnb5S7eF.js";import{u as P,z as s,E as F,g as w,O as _,h as B,j as N,k as Z,m as q,J,n as v}from"./index-BzrRJ8WV.js";import{eZ as V,Mh as $,Mi as W,fC as G,g2 as H,Mn as K,gs as Q,cZ as R,Mo as b,Mp as X,Mq as Y,bZ as y}from"./zeni-epic-state-GXytJkko.js";import"./mui-BAFflVdx.js";import{u as ee}from"./useDeviceId-CnUmsNEA.js";import{f as te}from"./analyticsHelper-DjBKxGVt.js";import{t as ne}from"./getLocaleForTenant-DBW7UyHp.js";import"./recharts-B3FaT6ex.js";import"./analytics-fzE8ssbj.js";import"./plaid-Il6Pn-tK.js";import"./dnd-BclBZkmc.js";import"./stripe-cKAAJElX.js";import"./lottie-CosVBOrn.js";import"./lexical-DbVLnI8g.js";import"./pdf-Ba7sOjY6.js";import"./utils-BKBg63lI.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]="4e43b909-474d-495e-992f-3f8510e3af9e",t._sentryDebugIdIdentifier="sentry-dbid-4e43b909-474d-495e-992f-3f8510e3af9e")}catch{}})();const ie=j((function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}}),(function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{T({message:`OAuth error from provider ${a} with error ${n}`,level:"error",tags:{authProvider:a,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,a)=>{const c=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(Y({authCode:n,oauthProvider:a,appType:"web",redirectUri:y(c),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(X(n,a)))},clearSignInError:()=>{t(b())}}}))(J),ae=M.memo(ie);function ve({setTenantEmailDomain:t}){const i=A(),d=z(),{clearAllLoading:g}=P(),n=s.getSignedInUser();u.useLayoutEffect((()=>{g()}),[g]);const a=ee(),c=l((e=>e.tenantState.magicLinkCodeVerifier)),{sendEmailMagicLinkFetchState:h,accountLocked:C,accountUnlockTime:k}=l((e=>e.tenantState)),p=l((e=>e.tenantState.fetchState)),L=l((e=>e.tenantState.activeTenantFetchState.fetchState)),S=l((e=>e.tenantState.signInState)),o=l((e=>e.tenantState.loggedInUser)),r=l((e=>V(e))),I=l((e=>$(e))),m=D(),E=F().mode,U=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(u.useEffect((()=>{h.fetchState==="Completed"&&c!=null&&(w.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(c))}),[h.fetchState,c]),u.useEffect((()=>{t(void 0)}),[]),u.useEffect((()=>{S!=="In-Progress"||p!=="Completed"&&L!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(W(I.tenantsInOrder),o.zeniSessionId),G(o.userId,o.zeniSessionId,r.tenantId),i(H(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(K("Completed")),_.updateAppLocaleID(ne(r)),te(o,r,E,void 0,I.tenantsInOrder),Q().then((()=>{const e=q();e!=null&&B(e)})),setTimeout((()=>{w.trackLogin(N.Event.loginSuccess,o.authProvider??"google",R(r.productSettings))}),2e3))}),[S,p,L,o,r,I,E,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:!!U,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),C===!0&&k!=null?f.jsx(Z,{onClose:()=>i(b()),unlockDate:k}):null]})}export{ve as default};
@@ -0,0 +1,9 @@
1
+ import{j as s}from"./liveblocks-bqFl_SVp.js";import{a as i}from"./sentry-Bj_fC7Ll.js";import{u as c,g as d,N as u}from"./core-Bnb5S7eF.js";import{z as a,g as n,j as m,B as g}from"./index-BzrRJ8WV.js";import{gx as p,MF as y}from"./zeni-epic-state-GXytJkko.js";import{n as b}from"./mui-BAFflVdx.js";import"./recharts-B3FaT6ex.js";import"./analytics-fzE8ssbj.js";import"./plaid-Il6Pn-tK.js";import"./dnd-BclBZkmc.js";import"./stripe-cKAAJElX.js";import"./lottie-CosVBOrn.js";import"./lexical-DbVLnI8g.js";import"./pdf-Ba7sOjY6.js";import"./utils-BKBg63lI.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]="a2a07e3a-3ae0-4946-998a-e3249401b332",e._sentryDebugIdIdentifier="sentry-dbid-a2a07e3a-3ae0-4946-998a-e3249401b332")}catch{}})();function L(){const e=c(),t=d(),r=i.useRef(!1),l=a.isSignedIn(),o=t.state?.message==="logout"||l;return i.useEffect((()=>{if(o&&!r.current){r.current=!0;try{e(p()),y(),n.trackLogout(m.Event.logoutSuccess),n.resetUserIdentity(),a.clearAll()}catch(f){console.error("Error during sign out:",f)}finally{window.location.replace("/signin/auth")}}}),[o,e]),o?s.jsx(h,{children:s.jsx(g,{fetchState:"In-Progress"})}):s.jsx(u,{to:"../",replace:!0})}const h=b.div`
2
+ display: flex;
3
+ height: 100vh;
4
+ width: 100%;
5
+ flex: 1 1 auto;
6
+ flex-direction: column;
7
+ align-items: center;
8
+ background-color: ${e=>e.theme.colors.grey4};
9
+ `;export{L as default};