@zeniai/web-app-ui 5.3.45-dev → 5.3.46-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 (126) hide show
  1. package/dist/assets/{AccountMappingScreen-wN76eX8x.js → AccountMappingScreen-CfueHDEF.js} +2 -2
  2. package/dist/assets/{ActualMatchingMatchDetailScreen-DesQndtQ.js → ActualMatchingMatchDetailScreen-fiSieMf_.js} +1 -1
  3. package/dist/assets/AddressRoutes-nZx4HWhJ.js +1 -0
  4. package/dist/assets/AddressScreen-D06QouT5.js +9 -0
  5. package/dist/assets/{AiCfoScreen-Dz9VmjDJ.js → AiCfoScreen-V8xy8p4b.js} +1 -1
  6. package/dist/assets/{AppDrawer-CuwDG4i2.js → AppDrawer-CyBGsFud.js} +1 -1
  7. package/dist/assets/{BillPayApprovalRoutes-ZvXWZ4qY.js → BillPayApprovalRoutes-C1N-qtHk.js} +1 -1
  8. package/dist/assets/{BillPayRoutes-B6UGTljV.js → BillPayRoutes-CdYxJOPQ.js} +1 -1
  9. package/dist/assets/{BusinessVerificationPageScreen-DrH4Xh9l.js → BusinessVerificationPageScreen-BScFHNdu.js} +2 -2
  10. package/dist/assets/CardsAiCfoScreen-BQ4Zn40f.js +14 -0
  11. package/dist/assets/{ChargeCardRoutes-5JojYZ7y.js → ChargeCardRoutes-tPmmU_fw.js} +1 -1
  12. package/dist/assets/{CompanyPassportScreen-CZ0CexZb.js → CompanyPassportScreen-CMIjHc5k.js} +1 -1
  13. package/dist/assets/{ConnectionAuthScreen-DHtuCBfP.js → ConnectionAuthScreen-BdMANdwF.js} +1 -1
  14. package/dist/assets/CustomerOnboardingAuthScreen-BjVB3FB2.js +1 -0
  15. package/dist/assets/{CustomerOnboardingRoutes-3PDTOTim.js → CustomerOnboardingRoutes-BqAwy1Go.js} +3 -3
  16. package/dist/assets/{DashboardRoutes-U29blEjz.js → DashboardRoutes-C3Q7vlXr.js} +1 -1
  17. package/dist/assets/{DefaultTenantHome-DDjo6DdI.js → DefaultTenantHome-CPPof4Nd.js} +1 -1
  18. package/dist/assets/{DomesticWireDetailScreen-CYJRxpzs.js → DomesticWireDetailScreen-Bo5pk1NL.js} +3 -3
  19. package/dist/assets/DrawerScreen-DYwMLd1Q.js +1 -0
  20. package/dist/assets/{EntityDetailRoutes-B6kEwNqt.js → EntityDetailRoutes-_eEqLjSQ.js} +1 -1
  21. package/dist/assets/{ExpenseAutomationRoutes-CZEx-mPd.js → ExpenseAutomationRoutes-D17PZLn2.js} +1 -1
  22. package/dist/assets/{FeaturePreviewScreen-t00mgiPb.js → FeaturePreviewScreen-BE9pWqir.js} +1 -1
  23. package/dist/assets/{HubSpotOAuthCallbackScreen-D0XpQwqB.js → HubSpotOAuthCallbackScreen-CDOpB-J7.js} +1 -1
  24. package/dist/assets/{InboxNotificationsProvider-CMirleoY.js → InboxNotificationsProvider-gj6fT2eX.js} +1 -1
  25. package/dist/assets/{InvoicingRoutes-CEbeWuJ_.js → InvoicingRoutes-rYerhkHV.js} +1 -1
  26. package/dist/assets/{MagicLinkRoutes-B-uK9pQa.js → MagicLinkRoutes-D8pvaYpW.js} +6 -6
  27. package/dist/assets/MagicLinkSignInScreen-CW3gjVTf.js +12 -0
  28. package/dist/assets/{MobileAppDrawer-DbFom2zh.js → MobileAppDrawer-Dubbrc5R.js} +1 -1
  29. package/dist/assets/NotFoundScreen-r2t5kGnd.js +1 -0
  30. package/dist/assets/{NotificationRoutes-Btu3I9BW.js → NotificationRoutes-C0XszwDJ.js} +1 -1
  31. package/dist/assets/{OAuthConsentScreen-BvZ6UonX.js → OAuthConsentScreen-CS66Nuk1.js} +1 -1
  32. package/dist/assets/{PandLWithForecastRoutes-B_NSnbx3.js → PandLWithForecastRoutes-tEXmnuYa.js} +1 -1
  33. package/dist/assets/{PaymentLinkScreen-CVpQrKPS.js → PaymentLinkScreen-Ba8XuIED.js} +1 -1
  34. package/dist/assets/{PeopleRoutes-BRGNn5z0.js → PeopleRoutes-MPpefoB8.js} +9 -9
  35. package/dist/assets/{PerformanceRoutes-BssWGUh3.js → PerformanceRoutes-v3vPCjna.js} +1 -1
  36. package/dist/assets/{Preview-DPyEVqHc.js → Preview-j2_daqeV.js} +1 -1
  37. package/dist/assets/{QBOConnectionScreen-NNh_c5sH.js → QBOConnectionScreen-CAoS33ZU.js} +23 -23
  38. package/dist/assets/{ReimbursementApprovalRoutes-BputYX4N.js → ReimbursementApprovalRoutes-BqXyuFCU.js} +1 -1
  39. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-Cp2buMpa.js → ReimbursementApprovalRuleDetailScreen-B9f-fas4.js} +1 -1
  40. package/dist/assets/{ReimbursementRoutes-CLUfJEzf.js → ReimbursementRoutes-IZQbGrfA.js} +1 -1
  41. package/dist/assets/{ReportsRoutes-BRWTnngq.js → ReportsRoutes-R5Ca0XU-.js} +1 -1
  42. package/dist/assets/RewardsRoutes-CRQWx3J1.js +1 -0
  43. package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-VG_9abqY.js → ScheduleDetailsPrepaidExpensesScreen-BMDMlpQa.js} +4 -4
  44. package/dist/assets/{ScreenRoutes-C1jevG_n.js → ScreenRoutes-Cwhq-96H.js} +2 -2
  45. package/dist/assets/{SettingsRoutes-D-pfv1Ev.js → SettingsRoutes-CMH4A66d.js} +1 -1
  46. package/dist/assets/{SetupPagesScreen-CysLzuEg.js → SetupPagesScreen-BzKWg1IS.js} +1 -1
  47. package/dist/assets/SignInScreen-Niy78Kvo.js +1 -0
  48. package/dist/assets/SignOutScreen-z5R4ARFQ.js +9 -0
  49. package/dist/assets/TaskListScreen-CQ5GSVtZ.js +9 -0
  50. package/dist/assets/{TaskRoutes-BEeYmQIS.js → TaskRoutes-BLHPB9C2.js} +2 -2
  51. package/dist/assets/TransactionDetailRoutes-DWH8l2BY.js +1 -0
  52. package/dist/assets/{TransactionDetailScreen-uFx1hV5M.js → TransactionDetailScreen-Cyr21RUS.js} +2 -2
  53. package/dist/assets/{TransactionListRoutes-2lehJ6Xh.js → TransactionListRoutes-DeHnVgrc.js} +1 -1
  54. package/dist/assets/{TreasuryRoutes-CZmm7Kla.js → TreasuryRoutes-CH1V36gd.js} +5 -5
  55. package/dist/assets/{VendorsRoutes-DTnVN004.js → VendorsRoutes-D5fLbpGk.js} +1 -1
  56. package/dist/assets/{WiseConfirmationScreen-BXHRx74i.js → WiseConfirmationScreen-B4K2TMeC.js} +1 -1
  57. package/dist/assets/{ZeniAccountRoutes-C_vaL98S.js → ZeniAccountRoutes-B_-Cub3b.js} +1 -1
  58. package/dist/assets/ZeniAccountStatementScreen-Cg7a4ZMC.js +9 -0
  59. package/dist/assets/{accountMappingHelper-B5wpHG39.js → accountMappingHelper-DWzrp9Pr.js} +1 -1
  60. package/dist/assets/{analytics-5LJ4BXQX.js → analytics-wktvfErl.js} +1 -1
  61. package/dist/assets/{analyticsHelper-yBGPOCZK.js → analyticsHelper-BZsIqD3O.js} +1 -1
  62. package/dist/assets/{core-BI5oX4mx.js → core-D6EV-11Y.js} +1 -1
  63. package/dist/assets/{decodeURIComponentSafe-B7oIXSPO.js → decodeURIComponentSafe-MQV5aj_5.js} +1 -1
  64. package/dist/assets/{dnd-D6wtGmk9.js → dnd-CkchuQYc.js} +1 -1
  65. package/dist/assets/{empty-D1y42ZwI.js → empty-DQLKD1Hp.js} +1 -1
  66. package/dist/assets/{empty-PW7BYANj.js → empty-PZV8n_Ql.js} +1 -1
  67. package/dist/assets/{emptyVideoElement-DRIlZkGm.js → emptyVideoElement-CnlqukSR.js} +1 -1
  68. package/dist/assets/{epic-BgEnH7Qf.js → epic-CVdAQuh9.js} +1 -1
  69. package/dist/assets/{expenseAutomationHelper-CqPrLTRM.js → expenseAutomationHelper-DEOPVtcg.js} +1 -1
  70. package/dist/assets/{getLocaleForTenant-BbLwvfGn.js → getLocaleForTenant-DffZrhDN.js} +1 -1
  71. package/dist/assets/{index-BT5wSX8Z.js → index-8ioAZPP6.js} +1 -1
  72. package/dist/assets/{index-BgSgl7o0.js → index-B5kf_qFj.js} +1 -1
  73. package/dist/assets/{index-Cnd56s5E.js → index-BlnK23AJ.js} +1 -1
  74. package/dist/assets/{index-ChUBWLsO.js → index-CBlRXIxp.js} +1 -1
  75. package/dist/assets/{index-C8KisrNI.js → index-CKDPlCKN.js} +2 -2
  76. package/dist/assets/{index-Cf-PV9pR.js → index-EnAqWoDC.js} +1 -1
  77. package/dist/assets/{index-mRsR5jtB.js → index-lv0eG9-7.js} +13420 -13420
  78. package/dist/assets/{index-COJM8F4x.js → index-qI_nnuux.js} +1 -1
  79. package/dist/assets/{lexical-BLu7UAko.js → lexical-C6tQwGBF.js} +1 -1
  80. package/dist/assets/{liveblocks-CW9yScMF.js → liveblocks-DKqwsBQp.js} +1 -1
  81. package/dist/assets/{lottie-lQbJqTc2.js → lottie-BwhdO6jl.js} +1 -1
  82. package/dist/assets/{mui-KP5Ep0NX.js → mui-qouWiIWk.js} +1 -1
  83. package/dist/assets/{pathToGoBack-Ddmf68xx.js → pathToGoBack-DMRqTTJ7.js} +1 -1
  84. package/dist/assets/{pdf-DflcYtDk.js → pdf-DcGn_mX8.js} +4 -4
  85. package/dist/assets/{pdf-lib-iL5hUpKl.js → pdf-lib-DndwkHl6.js} +1 -1
  86. package/dist/assets/{plaid-BrgJMdej.js → plaid-deRHM6gT.js} +1 -1
  87. package/dist/assets/{pusher-CN7UYIVv.js → pusher-BmM2v3Ys.js} +1 -1
  88. package/dist/assets/{react-C3b5GjIN.js → react-1c5WrJsc.js} +1 -1
  89. package/dist/assets/{react-D7C_-SWb.js → react-D6U1M1pt.js} +1 -1
  90. package/dist/assets/{react-Ow08-_5J.js → react-DFunsRdI.js} +1 -1
  91. package/dist/assets/{react-XJ6XyB9N.js → react-DZ82GBCj.js} +1 -1
  92. package/dist/assets/{react-C3_gvmu5.js → react-DiQLb4cq.js} +1 -1
  93. package/dist/assets/{react-BvzziK5i.js → react-QkGRtVkE.js} +1 -1
  94. package/dist/assets/{recharts-DRl2ZsSW.js → recharts-C9zWmt1W.js} +1 -1
  95. package/dist/assets/{routePaths-Ch3GR24x.js → routePaths-BxLZuqJn.js} +1 -1
  96. package/dist/assets/{sentry-C_uJQK1a.js → sentry-CxSdF_rC.js} +1 -1
  97. package/dist/assets/{stripSplatSuffix-CSXpdRK5.js → stripSplatSuffix-CYVrHv_0.js} +1 -1
  98. package/dist/assets/{url-Csr3E4Sb.js → url-BSgCM0lM.js} +1 -1
  99. package/dist/assets/{url-0wqXxJRo.js → url-Ej5v3O6d.js} +1 -1
  100. package/dist/assets/{useActualMatchingMatchDetail-D-xkseKQ.js → useActualMatchingMatchDetail-Bq60hvvx.js} +1 -1
  101. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-DUvHQuQx.js → useAiCfoDashboardSuggestedQuestionsChips-sigyClkp.js} +1 -1
  102. package/dist/assets/useAskAiCfoHostNavButtonProps-Cgk5vvuH.js +1 -0
  103. package/dist/assets/{useChargeCardPusherEvents-BMgEvn3W.js → useChargeCardPusherEvents-gKhYa0T8.js} +1 -1
  104. package/dist/assets/{useDeviceId-CAlK1w38.js → useDeviceId-RToKfM0O.js} +1 -1
  105. package/dist/assets/{useEmailConnectResultRefresh-C0MkzUvF.js → useEmailConnectResultRefresh-DefipxZh.js} +1 -1
  106. package/dist/assets/{useInitialThreadRequest-BbYhZx86.js → useInitialThreadRequest-BXjZ5prE.js} +1 -1
  107. package/dist/assets/{useTaskManagerAccess-BMDBcsNO.js → useTaskManagerAccess-CncuT8wV.js} +1 -1
  108. package/dist/assets/{utils-BzQpFQvw.js → utils-D8aAQJhF.js} +1 -1
  109. package/dist/assets/{withTransactionSidePanel-BaeEJKqt.js → withTransactionSidePanel-BY_v_z2c.js} +1 -1
  110. package/dist/assets/{zeni-epic-state-CIizsNeB.js → zeni-epic-state-CZbm731W.js} +3 -3
  111. package/dist/index.html +1 -1
  112. package/package.json +3 -3
  113. package/dist/assets/AddressRoutes-Bx3-O7R0.js +0 -1
  114. package/dist/assets/AddressScreen-DOHRJgNm.js +0 -9
  115. package/dist/assets/CardsAiCfoScreen-DR0WQjnK.js +0 -14
  116. package/dist/assets/CustomerOnboardingAuthScreen-rIhWee1i.js +0 -1
  117. package/dist/assets/DrawerScreen-C0RPM-YO.js +0 -1
  118. package/dist/assets/MagicLinkSignInScreen-DPLtHJ6T.js +0 -12
  119. package/dist/assets/NotFoundScreen-BScz3VcE.js +0 -1
  120. package/dist/assets/RewardsRoutes-R7jP_3At.js +0 -1
  121. package/dist/assets/SignInScreen-BjCXQzNb.js +0 -1
  122. package/dist/assets/SignOutScreen-CSA1o3iG.js +0 -9
  123. package/dist/assets/TaskListScreen-zIhpHyB0.js +0 -9
  124. package/dist/assets/TransactionDetailRoutes-Cqr24PBj.js +0 -1
  125. package/dist/assets/ZeniAccountStatementScreen-ibYC20mc.js +0 -9
  126. package/dist/assets/useAskAiCfoHostNavButtonProps-qLwQUrxF.js +0 -1
@@ -1 +1 @@
1
- import{j as o}from"./liveblocks-CW9yScMF.js";import Z from"./NotFoundScreen-BScz3VcE.js";import{a as p}from"./sentry-C_uJQK1a.js";import{h as C,g as N,u as D,j as u,N as V,l as k,n as z,o as g}from"./core-BI5oX4mx.js";import{fF as E,YW as w,Zb as h,Nw as U,Ns as L,Nv as f,Nl as B,ZA as $,Np as F,Ny as K}from"./zeni-epic-state-CIizsNeB.js";import{z as T,w as W,c9 as Y,o as O,bS as q,ca as G}from"./index-mRsR5jtB.js";import"./mui-KP5Ep0NX.js";import{u as H,R as x}from"./ReimbursementApprovalRuleDetailScreen-Cp2buMpa.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="7765e59a-3ec8-490d-98ba-176cb0188840",e._sentryDebugIdIdentifier="sentry-dbid-7765e59a-3ec8-490d-98ba-176cb0188840")}catch{}})();const A="reimbursement-approval-rule-update",J=k((function(e){return{approvalView:w(e),remiSetupApproverViewUpdateData:h(e).remiSetupApproverViewUpdateData}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(A)&&e($(!1))},onBackClick:()=>{O(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(B(t,!1))},onEditRuleClick:t=>{t!=null?(e(f(t)),n(`./${t}/edit`)):(e(f()),n("./new"))}}}))(W(Y)),M=({isLoading:e})=>{const s=C(),n=N(),a=D(),[t,l]=p.useState(!1),[v,y]=p.useState(!1),S=u((r=>r.remiSetupApproverViewState.fetchState)),c=u((r=>E(r))),d=u((r=>w(r))),b=u((r=>h(r).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{b?.updateStatus.fetchState==="Completed"&&a(U())}),[b]),p.useEffect((()=>{t||S!=="Not-Started"||e||(l(!0),a(L(!0,!1,!1,!1)))}),[t,S,e,a]),T.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{d.allApprovalRules.length===0&&d.fetchState==="Completed"&&(v||(y(!0),a(f())),s("./new"))}),[v,d,a]);const m={events:c.companyId!=null?[`private-encrypted-${c.companyId}.${A}`]:[],eventCallback:(r,R,j)=>{r.endsWith(A)&&j.onApprovalRulesEventReceived(r)}};return c?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?o.jsx(V,{to:"../../promo"}):o.jsx(J,{currentTenant:c,location:n,navigate:s,...m})},I="reimbursement-approval-rule-update",P=k((function(e){const s=w(e),n=h(e).remiSetupApproverViewUpdateData,a={};for(const l of Object.values(e.vendorState.vendorByID))l?.id!=null&&(a[l.id]=l.name);const t={};for(const l of Object.values(e.classState.classesByKey))l?.classId!=null&&(t[l.classId]=l.className);return{approvalView:s,remiSetupApproverViewUpdateData:n,vendorNamesById:a,departmentNamesById:t}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(I)&&e($(!1))},onBackClick:()=>{O(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(B(t,!0))},onEditRuleClick:t=>{t!=null?(e(f(t)),n(`./${t}/edit`)):(e(f()),n("./new"))},onReorderRules:t=>{e(K(t,!0))}}}))(W(G)),Q=()=>{const e=u((a=>E(a))),{isApprovalRulesV3Enabled:s,isLoading:n}=q(e?.tenantId);return s?o.jsx(X,{isLoading:n}):o.jsx(M,{isLoading:n})},X=({isLoading:e})=>{const s=C(),n=N(),a=D(),[t,l]=p.useState(!1),[v,y]=p.useState(!1),[S,c]=p.useState(!1),d=u((i=>i.remiSetupApproverViewState.fetchState)),b=u((i=>i.remiSetupApproverViewState.approverListState.fetchStatus.fetchState)),m=u((i=>E(i))),r=u((i=>w(i)));H();const R=u((i=>h(i).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{R?.updateStatus.fetchState==="Completed"&&a(U())}),[R]),p.useEffect((()=>{t||d!=="Not-Started"||e||(l(!0),a(L(!0,!1,!1,!0)))}),[t,d,e,a]),p.useEffect((()=>{v||b!=="Not-Started"||e||(y(!0),a(F(!1,!0)))}),[v,b,e,a]),T.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(S||(c(!0),a(f())),s("./new"))}),[S,r,a]);const j={events:m.companyId!=null?[`private-encrypted-${m.companyId}.${I}`]:[],eventCallback:(i,ee,_)=>{i.endsWith(I)&&_.onApprovalRulesEventReceived(i)}};return m?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?o.jsx(V,{to:"../../promo"}):o.jsx(P,{currentTenant:m,location:n,navigate:s,isLoading:e,...j})};function le(){return o.jsxs(z,{children:[o.jsx(g,{path:"/",element:o.jsx(Q,{})}),o.jsx(g,{path:"/new",element:o.jsx(x,{})}),o.jsx(g,{path:"/:approvalRuleId/edit",element:o.jsx(x,{})}),o.jsx(g,{path:"*",element:o.jsx(Z,{})})]})}export{le as R};
1
+ import{j as r}from"./liveblocks-DKqwsBQp.js";import Z from"./NotFoundScreen-r2t5kGnd.js";import{a as p}from"./sentry-CxSdF_rC.js";import{h as C,g as N,u as D,j as u,N as V,l as k,n as q,o as g}from"./core-D6EV-11Y.js";import{fF as E,YW as w,Zb as h,Nw as U,Ns as L,Nv as f,Nl as B,ZA as $,Np as z,Ny as F}from"./zeni-epic-state-CZbm731W.js";import{z as T,w as W,c9 as K,q as O,bS as Y,ca as G}from"./index-lv0eG9-7.js";import"./mui-qouWiIWk.js";import{u as H,R as x}from"./ReimbursementApprovalRuleDetailScreen-B9f-fas4.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="06c52fe2-41e2-4e75-8a82-c7cd5fba14f4",e._sentryDebugIdIdentifier="sentry-dbid-06c52fe2-41e2-4e75-8a82-c7cd5fba14f4")}catch{}})();const A="reimbursement-approval-rule-update",J=k((function(e){return{approvalView:w(e),remiSetupApproverViewUpdateData:h(e).remiSetupApproverViewUpdateData}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(A)&&e($(!1))},onBackClick:()=>{O(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(B(t,!1))},onEditRuleClick:t=>{t!=null?(e(f(t)),n(`./${t}/edit`)):(e(f()),n("./new"))}}}))(W(K)),M=({isLoading:e})=>{const s=C(),n=N(),a=D(),[t,l]=p.useState(!1),[v,y]=p.useState(!1),S=u((o=>o.remiSetupApproverViewState.fetchState)),c=u((o=>E(o))),d=u((o=>w(o))),b=u((o=>h(o).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{b?.updateStatus.fetchState==="Completed"&&a(U())}),[b]),p.useEffect((()=>{t||S!=="Not-Started"||e||(l(!0),a(L(!0,!1,!1,!1)))}),[t,S,e,a]),T.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{d.allApprovalRules.length===0&&d.fetchState==="Completed"&&(v||(y(!0),a(f())),s("./new"))}),[v,d,a]);const m={events:c.companyId!=null?[`private-encrypted-${c.companyId}.${A}`]:[],eventCallback:(o,R,j)=>{o.endsWith(A)&&j.onApprovalRulesEventReceived(o)}};return c?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(V,{to:"../../promo"}):r.jsx(J,{currentTenant:c,location:n,navigate:s,...m})},I="reimbursement-approval-rule-update",P=k((function(e){const s=w(e),n=h(e).remiSetupApproverViewUpdateData,a={};for(const l of Object.values(e.vendorState.vendorByID))l?.id!=null&&(a[l.id]=l.name);const t={};for(const l of Object.values(e.classState.classesByKey))l?.classId!=null&&(t[l.classId]=l.className);return{approvalView:s,remiSetupApproverViewUpdateData:n,vendorNamesById:a,departmentNamesById:t}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(I)&&e($(!1))},onBackClick:()=>{O(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(B(t,!0))},onEditRuleClick:t=>{t!=null?(e(f(t)),n(`./${t}/edit`)):(e(f()),n("./new"))},onReorderRules:t=>{e(F(t,!0))}}}))(W(G)),Q=()=>{const e=u((a=>E(a))),{isApprovalRulesV3Enabled:s,isLoading:n}=Y(e?.tenantId);return s?r.jsx(X,{isLoading:n}):r.jsx(M,{isLoading:n})},X=({isLoading:e})=>{const s=C(),n=N(),a=D(),[t,l]=p.useState(!1),[v,y]=p.useState(!1),[S,c]=p.useState(!1),d=u((i=>i.remiSetupApproverViewState.fetchState)),b=u((i=>i.remiSetupApproverViewState.approverListState.fetchStatus.fetchState)),m=u((i=>E(i))),o=u((i=>w(i)));H();const R=u((i=>h(i).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{R?.updateStatus.fetchState==="Completed"&&a(U())}),[R]),p.useEffect((()=>{t||d!=="Not-Started"||e||(l(!0),a(L(!0,!1,!1,!0)))}),[t,d,e,a]),p.useEffect((()=>{v||b!=="Not-Started"||e||(y(!0),a(z(!1,!0)))}),[v,b,e,a]),T.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{o.allApprovalRules.length===0&&o.fetchState==="Completed"&&(S||(c(!0),a(f())),s("./new"))}),[S,o,a]);const j={events:m.companyId!=null?[`private-encrypted-${m.companyId}.${I}`]:[],eventCallback:(i,ee,_)=>{i.endsWith(I)&&_.onApprovalRulesEventReceived(i)}};return m?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(V,{to:"../../promo"}):r.jsx(P,{currentTenant:m,location:n,navigate:s,isLoading:e,...j})};function le(){return r.jsxs(q,{children:[r.jsx(g,{path:"/",element:r.jsx(Q,{})}),r.jsx(g,{path:"/new",element:r.jsx(x,{})}),r.jsx(g,{path:"/:approvalRuleId/edit",element:r.jsx(x,{})}),r.jsx(g,{path:"*",element:r.jsx(Z,{})})]})}export{le as R};
@@ -1 +1 @@
1
- import{j as h}from"./liveblocks-CW9yScMF.js";import{a as m}from"./sentry-C_uJQK1a.js";import{u as U,j as g,h as _,g as O,i as V,l as N}from"./core-BI5oX4mx.js";import{mr as W,Zb as E,YW as x,No as k,NB as B,Nw as A,Nx as w,Zc as j,fF as Z,Nv as z}from"./zeni-epic-state-CIizsNeB.js";import{z as F,c as P,a7 as $,c0 as K,o as q,bS as Y,c1 as G}from"./index-mRsR5jtB.js";import"./mui-KP5Ep0NX.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="7b6c701e-5cb3-4d7c-8c98-4a7d350147ba",e._sentryDebugIdIdentifier="sentry-dbid-7b6c701e-5cb3-4d7c-8c98-4a7d350147ba")}catch{}})();function H(){const e=U(),s=m.useRef(!1),t=g((o=>o.vendorListState.fetchStateBillsTab.fetchState??"Not-Started")),p=g((o=>o.vendorListState.allVendorIdsBillsTab.length>0));m.useEffect((()=>{s.current||p||t==="Completed"||t==="In-Progress"||(s.current=!0,e(W({})))}),[p,t,e])}const J=N((function(e,s){const t=E(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=p==="approval_create"&&t.allApprovalRules.length!==0;let i=t.allApprovalRules.length===0;return s.approvalRuleId&&(i=t.allApprovalRules.findIndex((r=>r.approvalRuleId===s.approvalRuleId))===0),{localData:t,hideUpperBoundField:o,isLowerBoundDisabled:i,approvalUpdateActionType:p}}),(function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:i}=s,r=p.remiSetupApproverViewUpdateData?.type,l=q(s.location);return{onApprovalRuleDataUpdated:a=>{const d=v=>{const S=[];return v.forEach((u=>{const I=u.actors.selectedUsers.map((f=>({type:"user",subType:void 0,userId:f.userId,idType:"user",isImplicitActor:!1}))),R=u.actors.selectedNonUsers.map((f=>{const y=(b=f.value,j(b)==null);var b;return{type:y?"attribute":"role",subType:f.value,userId:void 0,idType:void 0,isImplicitActor:!y}})),c=I.concat(R);S.push({action:u.stepType.selectedOption,actors:c,operator:c.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})})),S},n={amount:{type:"amount",comparator:"range",min:{amount:a.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:a.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(r==="approval_create"){const v={criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(w(v))}else{const v={approvalRuleId:i,criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(w(v))}},onResetClick:()=>{e(A()),r==="approval_update"||l?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||l?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!1))},onSaveRuleSuccess:()=>{t("../")}}}))(K);function M(){const e=_(),s=U(),t=O(),{approvalRuleId:p}=V(),o=F.getSignedInUser(),i=P(),r=g((n=>E(n))),l=g((n=>x(n))),[a,d]=m.useState(!1);if(m.useEffect((()=>{a||(d(!0),s(k(!0)))})),m.useEffect((()=>{l.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[l,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?h.jsx($,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):h.jsx(J,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:l,location:t})}function pe(e){return j(e)==null}const Q=N((function(e,s){const t=E(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=[],i={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(o.push(r.id),i[r.id]=r.name);return{localData:t,approvalUpdateActionType:p,allVendorIds:o,vendorNamesById:i,editingRuleId:p==="approval_update"?s.approvalRuleId:void 0,allApprovalRulesWithUser:x(e).allApprovalRules}}),(function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:i}=s,r=p.remiSetupApproverViewUpdateData?.type,l=q(s.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const f=[];return c.forEach((y=>{const b=y.actorKind?.selectedOption,L=y.selectedRole?.selectedNonUsers??[];let D=[];b==="role"?D=L.map((T=>({type:"attribute",subType:T.value,userId:void 0,idType:void 0,isImplicitActor:!1}))):b==="specific_person"&&(D=(y.persons?.selectedUsers??[]).map((T=>({type:"user",subType:void 0,userId:T.userId,idType:"user",isImplicitActor:!1}))));const C=y.action??"require_approval";f.push({action:C,actors:D,operator:D.length>1?C==="require_approval"?"or":"and":"is"})})),f},n=a.amountCriteria,v=a.vendorCriteria,S=a.departmentCriteria,u={};if(n!=null&&n.comparator.selectedOption!=null){const c=n.comparator.selectedOption;u.amount={type:"amount",comparator:c,min:c==="less_than"?void 0:n.min,max:c==="greater_than"?void 0:n.max}}const I=v?.selection.selectedOptions??[];I.length>0&&(u.vendor={type:"vendor",operator:v?.operator.selectedOption??"is",vendorIds:I});const R=S?.selection.selectedOptions??[];if(R.length>0&&(u.department={type:"department",operator:S?.operator.selectedOption??"is",departmentIds:R}),r==="approval_create"){const c={name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(w(c))}else{const c={approvalRuleId:i,name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(w(c))}},onResetClick:()=>{e(A()),r==="approval_update"||l?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||l?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:a=>{e(z(a)),t(r==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}}))(G);function ne(){const e=g((t=>Z(t))),{isApprovalRulesV3Enabled:s}=Y(e?.tenantId);return s?h.jsx(X,{}):h.jsx(M,{})}function X(){const e=_(),s=U(),t=O(),{approvalRuleId:p}=V(),o=F.getSignedInUser(),i=P(),r=g((n=>E(n))),l=g((n=>x(n))),[a,d]=m.useState(!1);if(H(),m.useEffect((()=>{a||(d(!0),s(k(!1)))})),m.useEffect((()=>{l.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[l,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?h.jsx($,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):h.jsx(Q,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:l,location:t},p??"new")}export{ne as R,pe as i,H as u};
1
+ import{j as h}from"./liveblocks-DKqwsBQp.js";import{a as f}from"./sentry-CxSdF_rC.js";import{u as U,j as g,h as _,g as O,i as V,l as N}from"./core-D6EV-11Y.js";import{mr as W,Zb as w,YW as x,No as k,NB as B,Nw as A,Nx as E,Zc as j,fF as Z,Nv as z}from"./zeni-epic-state-CZbm731W.js";import{z as F,E as P,a7 as q,c0 as K,q as $,bS as Y,c1 as G}from"./index-lv0eG9-7.js";import"./mui-qouWiIWk.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="35f50e1f-4700-4bf2-ae76-5f385dde811a",e._sentryDebugIdIdentifier="sentry-dbid-35f50e1f-4700-4bf2-ae76-5f385dde811a")}catch{}})();function H(){const e=U(),s=f.useRef(!1),t=g((o=>o.vendorListState.fetchStateBillsTab.fetchState??"Not-Started")),p=g((o=>o.vendorListState.allVendorIdsBillsTab.length>0));f.useEffect((()=>{s.current||p||t==="Completed"||t==="In-Progress"||(s.current=!0,e(W({})))}),[p,t,e])}const J=N((function(e,s){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=p==="approval_create"&&t.allApprovalRules.length!==0;let i=t.allApprovalRules.length===0;return s.approvalRuleId&&(i=t.allApprovalRules.findIndex((r=>r.approvalRuleId===s.approvalRuleId))===0),{localData:t,hideUpperBoundField:o,isLowerBoundDisabled:i,approvalUpdateActionType:p}}),(function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:i}=s,r=p.remiSetupApproverViewUpdateData?.type,l=$(s.location);return{onApprovalRuleDataUpdated:a=>{const d=v=>{const S=[];return v.forEach((u=>{const R=u.actors.selectedUsers.map((m=>({type:"user",subType:void 0,userId:m.userId,idType:"user",isImplicitActor:!1}))),b=u.actors.selectedNonUsers.map((m=>{const y=(I=m.value,j(I)==null);var I;return{type:y?"attribute":"role",subType:m.value,userId:void 0,idType:void 0,isImplicitActor:!y}})),c=R.concat(b);S.push({action:u.stepType.selectedOption,actors:c,operator:c.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})})),S},n={amount:{type:"amount",comparator:"range",min:{amount:a.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:a.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(r==="approval_create"){const v={criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}else{const v={approvalRuleId:i,criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}},onResetClick:()=>{e(A()),r==="approval_update"||l?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||l?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!1))},onSaveRuleSuccess:()=>{t("../")}}}))(K);function M(){const e=_(),s=U(),t=O(),{approvalRuleId:p}=V(),o=F.getSignedInUser(),i=P(),r=g((n=>w(n))),l=g((n=>x(n))),[a,d]=f.useState(!1);if(f.useEffect((()=>{a||(d(!0),s(k(!0)))})),f.useEffect((()=>{l.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[l,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?h.jsx(q,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):h.jsx(J,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:l,location:t})}function pe(e){return j(e)==null}const Q=N((function(e,s){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=[],i={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(o.push(r.id),i[r.id]=r.name);return{localData:t,approvalUpdateActionType:p,allVendorIds:o,vendorNamesById:i,editingRuleId:p==="approval_update"?s.approvalRuleId:void 0,allApprovalRulesWithUser:x(e).allApprovalRules}}),(function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:i}=s,r=p.remiSetupApproverViewUpdateData?.type,l=$(s.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const m=[];return c.forEach((y=>{const I=y.actorKind?.selectedOption,L=y.selectedRole?.selectedNonUsers??[];let D=[];I==="role"?D=L.map((T=>({type:"attribute",subType:T.value,userId:void 0,idType:void 0,isImplicitActor:!1}))):I==="specific_person"&&(D=(y.persons?.selectedUsers??[]).map((T=>({type:"user",subType:void 0,userId:T.userId,idType:"user",isImplicitActor:!1}))));const C=y.action??"require_approval";m.push({action:C,actors:D,operator:D.length>1?C==="require_approval"?"or":"and":"is"})})),m},n=a.amountCriteria,v=a.vendorCriteria,S=a.departmentCriteria,u={};if(n!=null&&n.comparator.selectedOption!=null){const c=n.comparator.selectedOption;u.amount={type:"amount",comparator:c,min:c==="less_than"?void 0:n.min,max:c==="greater_than"?void 0:n.max}}const R=v?.selection.selectedOptions??[];R.length>0&&(u.vendor={type:"vendor",operator:v?.operator.selectedOption??"is",vendorIds:R});const b=S?.selection.selectedOptions??[];if(b.length>0&&(u.department={type:"department",operator:S?.operator.selectedOption??"is",departmentIds:b}),r==="approval_create"){const c={name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}else{const c={approvalRuleId:i,name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}},onResetClick:()=>{e(A()),r==="approval_update"||l?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||l?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:a=>{e(z(a)),t(r==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}}))(G);function ne(){const e=g((t=>Z(t))),{isApprovalRulesV3Enabled:s}=Y(e?.tenantId);return s?h.jsx(X,{}):h.jsx(M,{})}function X(){const e=_(),s=U(),t=O(),{approvalRuleId:p}=V(),o=F.getSignedInUser(),i=P(),r=g((n=>w(n))),l=g((n=>x(n))),[a,d]=f.useState(!1);if(H(),f.useEffect((()=>{a||(d(!0),s(k(!1)))})),f.useEffect((()=>{l.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[l,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?h.jsx(q,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):h.jsx(Q,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:l,location:t},p??"new")}export{ne as R,pe as i,H as u};
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-CW9yScMF.js";import{u as ae,j as v,h as Q,g as J,i as ie,N as M,l as ee,q as ct,n as dt,o as w}from"./core-BI5oX4mx.js";import{fF as V,Ns as ut,_G as ge,c8 as he,My as Le,ma as pt,MN as ce,MM as de,_H as bt,bn as fe,gV as _e,_I as gt,WF as ht,l$ as $e,WG as Ce,WH as ft,kN as St,YI as It,l0 as yt,Mm as Rt,C5 as vt,kU as At,N7 as Me,_J as Pe,_K as Ee,_L as kt,_M as Ct,_N as Et,MT as we,l6 as wt,YR as xt,ML as Bt,Mw as Tt,_O as Dt,Mv as jt,_P as Ft,MD as xe,MX as Ut,MW as Lt,MS as _t,_Q as Ne,S5 as $t,bo as Mt,MG as Pt,Np as Nt,_R as Ot,_S as Gt,N3 as zt,N0 as Be,Yc as Zt,Mt as Vt,_T as Oe,NS as Te,N_ as Wt,_U as Ht,_V as q,_W as Yt,_X as Ge,_Y as qt,_Z as ze,__ as Ze,Nf as ue,bu as Xt,bK as Se,cM as Ie,d_ as Ve,dZ as We,_$ as Jt,gh as Kt,Yp as Qt,$0 as en,$1 as He,Yt as tn,Zb as nn,$2 as an,ZA as sn,NX as De,NW as on,$3 as rn,$4 as ln,$5 as mn,$6 as cn,$7 as dn,YX as un,NN as pn,NR as bn,bq as gn,bJ as hn,cG as fn,cu as Sn,bt as In,U4 as yn,da as Rn,dd as vn,dc as An,cF as kn}from"./zeni-epic-state-CIizsNeB.js";import{bS as Cn,E as Ye,a1 as qe,N as oe,d as x,z as _,cT as Xe,a8 as re,k as C,aS as je,I as F,ae as se,af as En,G as Je,cU as wn,p as X,as as Ke,cV as xn,U as le,cW as Bn,aq as Tn,ab as Dn,a7 as ye,S as Qe,w as jn,bA as Fn,av as Un,ai as Ln,c as et,cX as _n,h as $n}from"./index-mRsR5jtB.js";import{n as P,S as Mn}from"./mui-KP5Ep0NX.js";import pe from"./NotFoundScreen-BScz3VcE.js";import{S as Fe}from"./SetupPagesScreen-CysLzuEg.js";import{F as tt}from"./FeaturePreviewScreen-t00mgiPb.js";import{a as h}from"./sentry-C_uJQK1a.js";import{u as Re}from"./useAskAiCfoHostNavButtonProps-qLwQUrxF.js";import{u as nt}from"./useInitialThreadRequest-BbYhZx86.js";import{D as Pn}from"./DrawerScreen-C0RPM-YO.js";import{M as at}from"./MobileAppDrawer-DbFom2zh.js";import{F as Nn}from"./ScreenRoutes-C1jevG_n.js";import{R as On}from"./ReimbursementApprovalRoutes-BputYX4N.js";import"./recharts-DRl2ZsSW.js";import"./analytics-5LJ4BXQX.js";import"./plaid-BrgJMdej.js";import"./dnd-D6wtGmk9.js";import"./stripe-cKAAJElX.js";import"./lottie-lQbJqTc2.js";import"./lexical-BLu7UAko.js";import"./pdf-DflcYtDk.js";import"./utils-BzQpFQvw.js";import"./BusinessVerificationPageScreen-DrH4Xh9l.js";import"./routePaths-Ch3GR24x.js";import"./analyticsHelper-yBGPOCZK.js";import"./InboxNotificationsProvider-CMirleoY.js";import"./useTaskManagerAccess-BMDBcsNO.js";import"./getLocaleForTenant-BbLwvfGn.js";import"./ReimbursementApprovalRuleDetailScreen-Cp2buMpa.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]="ac9d4947-4982-4461-a556-ed2f82c66a9f",e._sentryDebugIdIdentifier="sentry-dbid-ac9d4947-4982-4461-a556-ed2f82c66a9f")}catch{}})();const st=e=>`/${e}/reimbursements`,Gn=e=>h.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},h.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),h.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{common:Y,spendManagement:{reimbursement:{reimbursementDetail:ne}}}=Je.getLocalizedStrings(),zn=ee((function(e,t){const n=t.currentTenant?.companyId,r=bt(e.plaidAccountViewState,"user_reimbursement_account"),c=_.getSignedInUser(),d=fe(c),m=r.plaidConnectionDetails,o=_e(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:a??""},l=ge(e,t.reimbursementId),b=gt(e,c?.userId??"");let y=`${c?.firstName} ${c?.lastName}`,f=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,f=c?.userId===l.createdBy?.userId);const B=e.entityAutoCompleteState?.autoCompleteText?.common,u=ht(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:B,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:y,isUserAdmin:he(t.currentTenant?.userRole??[]),isZeniUser:d,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:C,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:f,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:$e(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:c,navigate:d,themeState:m}=t,{tenantEmailDomain:o}=r,a=_.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(de(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(xe(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(_t(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Lt())},clearRemiSaveStatus:()=>{e(Ut("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(xe(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ft({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(jt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(Dt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Tt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Bt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(we(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(we("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Ee({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(ce({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Et({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(Ct({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(kt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Pe()),e(Ee({}));const i=st(o),l=X(c.state?.pathnameStackToGoBack,c.pathname);d(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(C.trackReimbursementDeleteReimbursement(n),e(Me(n)))},onSaveBankAccount:()=>{a?.userId&&e(At(a?.userId,n))},onFetchLinkTokenClick:i=>{e(vt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(Rt(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(yt(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(St({fetchState:"Not-Started"})),e(It())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(ft({searchString:i,entityType:l,searchOrigin:"common"})):e(Ce("common"))},onCancelAutoComplete:()=>{e(Ce("common"))}}}}))(wn);function Ue(){const e=Q(),t=ae(),n=J(),{reimbursementId:r}=ie(),c=Ye(),d=qe(),[m,o]=h.useState(r==null),[a,i]=h.useState(1),{useFeatureGate:l}=oe(),{isFeatureEnabled:b}=l(x.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(x.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:f}=l(x.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:B,onAskAiCfoClick:u}=Re({mobileExploreReferrer:"Reimbursement Details"}),T=J().pathname,D=T.includes("edit"),j=T.includes("reimbursement/new"),[A,k]=h.useState(!1),E=_.getSignedInUser(),I=v((p=>V(p))),g=v((p=>ge(p,r))),U=nt(I?.companyId,{clearParams:g.fetchState==="Completed"}),L=he(I?.userRole??[]);(function(){const p=ae(),N=v((K=>V(K))),O=N?.tenantId,{isApprovalRulesV3Enabled:G,isLoading:W}=Cn(O),H=v((K=>K.remiSetupApproverViewState.fetchState));h.useEffect((()=>{O==null||W||H==="Not-Started"&&p(ut(!0,!1,!1,G))}),[O,W,G,H,p])})(),h.useEffect((()=>{(j&&!A||D&&!A&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(k(!0),t(Le(!1,b,y,r)))}));const $=v((p=>pt(p.accountState,p.accountListState,"reimbursementAccountList")));if(E==null)throw Error("Can't access address page without signing in...");const R={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||L&&g.billStatus==="rejected"||L===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(M,{to:R}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(Xe,{isNewReimbursement:r==null}):s.jsxs(Zn,{windowSize:d,children:[s.jsx(re,{analytics:C,onLoad:p=>(N=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&N.trackReimbursementEditReimbursement(r)})(p)}),m&&d!=="small"?s.jsx(Vn,{}):null,m&&d!=="small"?s.jsx(Wn,{children:s.jsx(je,{showAutofill:m,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:E?.userId??"",sessionId:E?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(de(p,a,!0,r,E?.userId))},updateInvoiceUploadFetchState:p=>{t(ce({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:F.sp3,paddingBottom:"15px",paddingLeft:F.sp5},dropFilePlaceholder:{upload:Y.upload,single:ne.dropReceipt.single,or:Y.texts.or,multiple:ne.dropReceipt.multiple,receipts:Y.texts.receipts2}})}):null,m&&d==="small"?s.jsxs(Hn,{children:[s.jsx(Yn,{onClick:()=>o(!1),children:s.jsx(Gn,{})}),s.jsx(je,{showAutofill:m,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:E?.userId??"",sessionId:E?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(de(p,a,!0,r,E?.userId))},updateInvoiceUploadFetchState:p=>{t(ce({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:F.sp5,paddingRight:F.sp3,paddingBottom:F.sp5,paddingLeft:F.sp3},dropFilePlaceholder:{upload:Y.upload,single:ne.dropReceipt.single,or:Y.texts.or,multiple:ne.dropReceipt.multiple,receipts:Y.texts.receipts2}})]}):null,s.jsx(qn,{windowSize:d,children:s.jsx(zn,{initialOpenThreadRequest:U??void 0,isReimbursementCommentingEnabled:f,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:c,uncategorizedAccounts:$,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:B,onAskAiCfoClick:u})})]})}const Zn=P.div`
1
+ import{j as s}from"./liveblocks-DKqwsBQp.js";import{u as ae,j as v,h as Q,g as J,i as ie,N as M,l as ee,q as ct,n as dt,o as w}from"./core-D6EV-11Y.js";import{fF as V,Ns as ut,_G as ge,c8 as he,My as Le,ma as pt,MN as ce,MM as de,_H as bt,bn as fe,gV as _e,_I as gt,WF as ht,l$ as $e,WG as Ce,WH as ft,kN as St,YI as It,l0 as yt,Mm as Rt,C5 as vt,kU as At,N7 as Me,_J as Pe,_K as Ee,_L as kt,_M as Ct,_N as Et,MT as we,l6 as wt,YR as xt,ML as Bt,Mw as Tt,_O as Dt,Mv as jt,_P as Ft,MD as xe,MX as Ut,MW as Lt,MS as _t,_Q as Ne,S5 as $t,bo as Mt,MG as Pt,Np as Nt,_R as Ot,_S as Gt,N3 as zt,N0 as Be,Yc as Zt,Mt as Vt,_T as Oe,NS as Te,N_ as Wt,_U as Ht,_V as q,_W as Yt,_X as Ge,_Y as qt,_Z as ze,__ as Ze,Nf as ue,bu as Xt,bK as Se,cM as Ie,d_ as Ve,dZ as We,_$ as Jt,gh as Kt,Yp as Qt,$0 as en,$1 as He,Yt as tn,Zb as nn,$2 as an,ZA as sn,NX as De,NW as on,$3 as rn,$4 as ln,$5 as mn,$6 as cn,$7 as dn,YX as un,NN as pn,NR as bn,bq as gn,bJ as hn,cG as fn,cu as Sn,bt as In,U4 as yn,da as Rn,dd as vn,dc as An,cF as kn}from"./zeni-epic-state-CZbm731W.js";import{bS as Cn,c as Ye,a1 as qe,N as oe,d as x,z as _,cT as Xe,a8 as re,l as C,aS as je,I as F,ae as se,af as En,G as Je,cU as wn,p as X,as as Ke,cV as xn,U as le,cW as Bn,aq as Tn,ab as Dn,a7 as ye,T as Qe,w as jn,bA as Fn,av as Un,ai as Ln,E as et,cX as _n,j as $n}from"./index-lv0eG9-7.js";import{n as P,S as Mn}from"./mui-qouWiIWk.js";import pe from"./NotFoundScreen-r2t5kGnd.js";import{S as Fe}from"./SetupPagesScreen-BzKWg1IS.js";import{F as tt}from"./FeaturePreviewScreen-BE9pWqir.js";import{a as h}from"./sentry-CxSdF_rC.js";import{u as Re}from"./useAskAiCfoHostNavButtonProps-Cgk5vvuH.js";import{u as nt}from"./useInitialThreadRequest-BXjZ5prE.js";import{D as Pn}from"./DrawerScreen-DYwMLd1Q.js";import{M as at}from"./MobileAppDrawer-Dubbrc5R.js";import{F as Nn}from"./ScreenRoutes-Cwhq-96H.js";import{R as On}from"./ReimbursementApprovalRoutes-BqXyuFCU.js";import"./recharts-C9zWmt1W.js";import"./analytics-wktvfErl.js";import"./plaid-deRHM6gT.js";import"./dnd-CkchuQYc.js";import"./stripe-cKAAJElX.js";import"./lottie-BwhdO6jl.js";import"./lexical-C6tQwGBF.js";import"./pdf-DcGn_mX8.js";import"./utils-D8aAQJhF.js";import"./BusinessVerificationPageScreen-BScFHNdu.js";import"./routePaths-BxLZuqJn.js";import"./analyticsHelper-BZsIqD3O.js";import"./InboxNotificationsProvider-gj6fT2eX.js";import"./useTaskManagerAccess-CncuT8wV.js";import"./getLocaleForTenant-DffZrhDN.js";import"./ReimbursementApprovalRuleDetailScreen-B9f-fas4.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]="5c75e5fc-3fda-4ee1-9a1b-d34e2516f67b",e._sentryDebugIdIdentifier="sentry-dbid-5c75e5fc-3fda-4ee1-9a1b-d34e2516f67b")}catch{}})();const st=e=>`/${e}/reimbursements`,Gn=e=>h.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},h.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),h.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{common:Y,spendManagement:{reimbursement:{reimbursementDetail:ne}}}=Je.getLocalizedStrings(),zn=ee((function(e,t){const n=t.currentTenant?.companyId,r=bt(e.plaidAccountViewState,"user_reimbursement_account"),c=_.getSignedInUser(),d=fe(c),m=r.plaidConnectionDetails,o=_e(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:a??""},l=ge(e,t.reimbursementId),b=gt(e,c?.userId??"");let y=`${c?.firstName} ${c?.lastName}`,f=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,f=c?.userId===l.createdBy?.userId);const B=e.entityAutoCompleteState?.autoCompleteText?.common,u=ht(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:B,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:y,isUserAdmin:he(t.currentTenant?.userRole??[]),isZeniUser:d,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:C,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:f,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:$e(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:c,navigate:d,themeState:m}=t,{tenantEmailDomain:o}=r,a=_.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(de(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(xe(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(_t(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Lt())},clearRemiSaveStatus:()=>{e(Ut("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(xe(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ft({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(jt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(Dt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Tt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Bt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(we(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(we("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Ee({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(ce({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Et({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(Ct({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(kt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Pe()),e(Ee({}));const i=st(o),l=X(c.state?.pathnameStackToGoBack,c.pathname);d(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(C.trackReimbursementDeleteReimbursement(n),e(Me(n)))},onSaveBankAccount:()=>{a?.userId&&e(At(a?.userId,n))},onFetchLinkTokenClick:i=>{e(vt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(Rt(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(yt(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(St({fetchState:"Not-Started"})),e(It())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(ft({searchString:i,entityType:l,searchOrigin:"common"})):e(Ce("common"))},onCancelAutoComplete:()=>{e(Ce("common"))}}}}))(wn);function Ue(){const e=Q(),t=ae(),n=J(),{reimbursementId:r}=ie(),c=Ye(),d=qe(),[m,o]=h.useState(r==null),[a,i]=h.useState(1),{useFeatureGate:l}=oe(),{isFeatureEnabled:b}=l(x.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(x.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:f}=l(x.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:B,onAskAiCfoClick:u}=Re({mobileExploreReferrer:"Reimbursement Details"}),T=J().pathname,D=T.includes("edit"),j=T.includes("reimbursement/new"),[A,k]=h.useState(!1),E=_.getSignedInUser(),I=v((p=>V(p))),g=v((p=>ge(p,r))),U=nt(I?.companyId,{clearParams:g.fetchState==="Completed"}),L=he(I?.userRole??[]);(function(){const p=ae(),N=v((K=>V(K))),O=N?.tenantId,{isApprovalRulesV3Enabled:G,isLoading:W}=Cn(O),H=v((K=>K.remiSetupApproverViewState.fetchState));h.useEffect((()=>{O==null||W||H==="Not-Started"&&p(ut(!0,!1,!1,G))}),[O,W,G,H,p])})(),h.useEffect((()=>{(j&&!A||D&&!A&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(k(!0),t(Le(!1,b,y,r)))}));const $=v((p=>pt(p.accountState,p.accountListState,"reimbursementAccountList")));if(E==null)throw Error("Can't access address page without signing in...");const R={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||L&&g.billStatus==="rejected"||L===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(M,{to:R}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(Xe,{isNewReimbursement:r==null}):s.jsxs(Zn,{windowSize:d,children:[s.jsx(re,{analytics:C,onLoad:p=>(N=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&N.trackReimbursementEditReimbursement(r)})(p)}),m&&d!=="small"?s.jsx(Vn,{}):null,m&&d!=="small"?s.jsx(Wn,{children:s.jsx(je,{showAutofill:m,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:E?.userId??"",sessionId:E?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(de(p,a,!0,r,E?.userId))},updateInvoiceUploadFetchState:p=>{t(ce({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:F.sp3,paddingBottom:"15px",paddingLeft:F.sp5},dropFilePlaceholder:{upload:Y.upload,single:ne.dropReceipt.single,or:Y.texts.or,multiple:ne.dropReceipt.multiple,receipts:Y.texts.receipts2}})}):null,m&&d==="small"?s.jsxs(Hn,{children:[s.jsx(Yn,{onClick:()=>o(!1),children:s.jsx(Gn,{})}),s.jsx(je,{showAutofill:m,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:E?.userId??"",sessionId:E?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(de(p,a,!0,r,E?.userId))},updateInvoiceUploadFetchState:p=>{t(ce({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:F.sp5,paddingRight:F.sp3,paddingBottom:F.sp5,paddingLeft:F.sp3},dropFilePlaceholder:{upload:Y.upload,single:ne.dropReceipt.single,or:Y.texts.or,multiple:ne.dropReceipt.multiple,receipts:Y.texts.receipts2}})]}):null,s.jsx(qn,{windowSize:d,children:s.jsx(zn,{initialOpenThreadRequest:U??void 0,isReimbursementCommentingEnabled:f,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:c,uncategorizedAccounts:$,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:B,onAskAiCfoClick:u})})]})}const Zn=P.div`
2
2
  display: flex;
3
3
  position: relative;
4
4
  height: 100vh;
@@ -1 +1 @@
1
- import{j as p}from"./liveblocks-CW9yScMF.js";import{g as J,h as Oe,u as De,i as Ue,j as d,l as Ae,n as Pe,o as ee}from"./core-BI5oX4mx.js";import{fF as q,E1 as R,UC as Ee,l$ as le,u6 as ce,uX as U,lG as Ve,lP as A,lH as P,kK as E,kB as V,kA as Le,Db as ie,v0 as Me,bq as Be,UD as ve,bn as xe,Eo as ze,UE as Ge,UF as He,ci as g,D4 as Ye,UG as ae,UH as Ne,UI as $e,UJ as qe,UK as Ze,UL as Ke,UM as Qe,UN as We,UO as Xe,UP as Je,UQ as ea,UR as aa,US as sa,UT as k,UU as L,UV as M,UW as B,UX as v,UY as x,UZ as z,U_ as G,U$ as H,V0 as Y,ei as ta,E2 as oa,DR as se,DS as te,E8 as na,DW as oe,Ee as ra,V1 as la,V2 as ca,V3 as ia,V4 as da,V5 as pa,V6 as _a,V7 as fa,V8 as ba,V9 as ma,Va as ua,d_ as ha,dZ as ya}from"./zeni-epic-state-CIizsNeB.js";import{an as Ca,ao as wa,ap as Sa,a as ga,a1 as Ia,N as de,d as N,z as pe,aq as Ra,U as Ta,f as ka,ar as ja,as as Fa,a8 as Oa,k as $,S as Da,x as Ua,p as _e,at as Aa,au as Pa,av as Ea}from"./index-mRsR5jtB.js";import"./mui-KP5Ep0NX.js";import Va from"./NotFoundScreen-BScz3VcE.js";import{F as La}from"./FeaturePreviewScreen-t00mgiPb.js";import{a as m}from"./sentry-C_uJQK1a.js";import{u as Ma}from"./useInitialThreadRequest-BbYhZx86.js";import{t as ne,a as re,b as Ba}from"./routePaths-Ch3GR24x.js";import{M as va}from"./MobileAppDrawer-DbFom2zh.js";import"./recharts-DRl2ZsSW.js";import"./analytics-5LJ4BXQX.js";import"./plaid-BrgJMdej.js";import"./dnd-D6wtGmk9.js";import"./stripe-cKAAJElX.js";import"./lottie-lQbJqTc2.js";import"./lexical-BLu7UAko.js";import"./pdf-DflcYtDk.js";import"./utils-BzQpFQvw.js";import"./InboxNotificationsProvider-CMirleoY.js";import"./useTaskManagerAccess-BMDBcsNO.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]="76d53b48-1bcb-4be6-a2b7-4eab0b3ca520",e._sentryDebugIdIdentifier="sentry-dbid-76d53b48-1bcb-4be6-a2b7-4eab0b3ca520")}catch{}})();const xa=["profit_loss","balance_sheet","cash_flow"],I=e=>e==="balance_sheet"||e==="balance_sheet_by_classes"||e==="balance_sheet_by_projects",y=e=>{e(Y({resetLeftScroll:!0})),e(H({resetLeftScroll:!0})),e(G({resetLeftScroll:!0})),e(z({resetLeftScroll:!0})),e(x({resetLeftScroll:!0})),e(v({resetLeftScroll:!0})),e(L({resetLeftScroll:!0})),e(B({resetLeftScroll:!0})),e(M({resetLeftScroll:!0}))},za=e=>{e(ca()),e(ia()),e(da()),e(pa()),e(_a()),e(fa()),e(ba()),e(ma()),e(ua())},Ga=Ae((function(e){const o=pe.getSignedInUser(),_=e.tenantState.currentTenantId,b=q(e),a=b?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:_??""},t=R(e),r=ve(b);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,balanceSheetClassesViewReport:t.balanceSheetByClassReport,cashFlowClassesViewReport:t.cashFlowByClassReport,cashFlowProjectViewReport:t.cashFlowByProjectReport,balanceSheetProjectViewReport:t.balanceSheetByProjectReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:$,isZeniUser:xe(o),showAccountGroups:r===!0,isAccountingClassesEnabled:le(e),isAccountingProjectsEnabled:ce(e),currentTenantCompanyName:a,statementEndPoint:`${Ea}/statement`,authParams:s,isZeniCOAUsed:r}}),(function(e,o){const{navigate:_,handleDrawerToggle:b}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(U(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(la(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(ra(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:f,balancesRange:i}=l;let c=[...f];a==="year"&&(c=c.filter((C=>C!=="this_period_vs_same_period_last_year"&&C!=="this_period_vs_same_period_last_year_percent"&&C!=="same_period_last_year"))),e(se(o.firstMonthOfFY,r,i.numberOfPeriods<1?1:i.numberOfPeriods,c)),f.length>0&&e(te(o.firstMonthOfFY,c.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",i.numberOfPeriods<1?1:i.numberOfPeriods,c))}t!==!0&&setTimeout((()=>y(e)),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(k(a)),(I(a)||g(a))&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(oe({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(ae({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(oe(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(na(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(se(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(te(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout((()=>y(e)),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(oa({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=ta(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const f=a.accountName===""?a.accountDescription:a.accountName,i=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return ne(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return re(o.tenantEmailDomain,a.accountId,a.accountType,s.id,f,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?Ba(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,f,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?re(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],f,r,l):a.accountType!=null?ne(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l):void 0})();if(i!=null){const c=_e(o.location.state?.pathnameStackToGoBack,o.location.pathname);_(i,{state:{pathnameStackToGoBack:c,referrer:j(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(Y({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(H({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(G({scrollPosition:s}));break;case"balance_sheet":e(z({scrollPosition:s}));break;case"balance_sheet_by_classes":e(x({scrollPosition:s}));break;case"balance_sheet_by_projects":e(v({scrollPosition:s}));break;case"cash_flow_by_classes":e(B({scrollPosition:s}));break;case"cash_flow_by_projects":e(M({scrollPosition:s}));break;case"cash_flow":e(L({scrollPosition:s}));break;default:console.log(`Table Scroll state for ${a} is not handled`)}},onElementCollapseStateChanged:(a,s,t)=>{switch(a){case"profit_and_loss":e(Y({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(G({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(z({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_classes":e(x({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_projects":e(v({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_classes":e(B({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_projects":e(M({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(L({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{_("../../")},onUpdateAccountViewMode:(a,s)=>{const t=s??o.selectedReportID,r=I(t),l=g(t);l?(e(We({viewMode:a})),e(Xe({viewMode:a}))):r?(e(Je({viewMode:a})),e(ea({viewMode:a}))):(e(aa({viewMode:a})),e(sa({viewMode:a}))),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",j(t)),e(k(l?"cash_flow_by_classes":r?"balance_sheet_by_classes":"profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",j(t)),e(k(l?"cash_flow_by_projects":r?"balance_sheet_by_projects":"profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",j(t)),e(k(l?"cash_flow":r?"balance_sheet":"profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{g(o.selectedReportID)?e(Ze({classesToFilterOut:a})):I(o.selectedReportID)?e(Ke({classesToFilterOut:a})):e(Qe({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{g(o.selectedReportID)?e(Ne({projectsToFilterOut:a})):I(o.selectedReportID)?e($e({projectsToFilterOut:a})):e(qe({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(ae({classViewLayout:a}))},onOpenAccountViewMode:()=>{const a=I(o.selectedReportID),s=g(o.selectedReportID);o.isAccountingClassesEnabled&&e(s?P():a?V():Ye()),o.isAccountingProjectsEnabled&&e(s?A():a?E():ie())},onUpdateDisplayOrder:a=>{e(He(a))},onUpdateReportFormat:a=>{za(e),e(Ge(a))},onClickMenuIcon:()=>{b(!0)},onResyncReports:()=>{const a=o.selectedReportID;e(a!=="balance_sheet_by_classes"?a!=="balance_sheet_by_projects"?a!=="cash_flow_by_classes"?a!=="cash_flow_by_projects"?ze(a==="profit_and_loss_by_projects"?"profit_and_loss_by_projects":"profit_and_loss_by_classes"):A(!0):P(!0):E(!0):V(!0))}}}))(Aa);function Ha(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=ga(),_=Ia(),b=Pa(_),a=Oe(),s=De(),t=J(),{tenantEmailDomain:r}=Ue(),{useFeatureGate:l}=de(),{isFeatureEnabled:f}=l(N.isReportsHorizontalClassLayoutSwitchEnabled),i=pe.getSignedInUser(),[c,C]=m.useState(!1),[Z,fe]=m.useState(!1),{isFeatureEnabled:K}=l(N.isReportsCommentingEnabled);if(i==null)throw Error("Can't access reports page without signing in...");const F=d((n=>q(n))),be=F.masterTOSInfo?.isMasterTOSAccepted??!1,me=F.company?.companyInfo.firstMonthOfFY??1,ue=Ma(K?F?.companyId:void 0),w=d((n=>R(n).fetchState)),he=d((n=>Ee(n))),{areTenantIdsInSync:u}=Ra(),O=d((n=>n.financeStatementState.selectedReportId)),T=d((n=>le(n))),S=d((n=>ce(n))),ye=d((n=>R(n).isCompareModeOn)),h=d((n=>R(n).filter)),D=d((n=>R(n).selectedReportAndTimeframeFetchState)),Ce=d((n=>n.profitAndLossClassesViewState.uiState.classViewLayout));m.useEffect((()=>{!c&&u&&(C(!0),s(U(i.userId,!0,!0,!1)))}),[c,i,s,u]),m.useEffect((()=>{c&&!Z&&w==="Completed"&&u&&(s(U(i.userId,!1,!0,!1)),fe(!0))}),[c,Z,w,u]),m.useEffect((()=>{if(c&&D.fetchState==="Not-Started"&&h.timeframe!=="free_range"&&h.timeframe!=="week"&&u)switch(O){case"profit_and_loss":case"profit_and_loss_by_classes":s(Me(h.timeframe));break;case"profit_and_loss_by_projects":S&&s(ie());break;case"balance_sheet":s(Le(h.timeframe));break;case"balance_sheet_by_classes":T&&s(V());break;case"balance_sheet_by_projects":S&&s(E());break;case"cash_flow_by_classes":T&&s(P());break;case"cash_flow_by_projects":S&&s(A());break;case"cash_flow":s(Ve(h.timeframe))}}),[c,O,D,u,T,S]);const Q=Ta(),we=Q?.loggedInUserRole!=null&&Be(Q?.loggedInUserRole)!==!0,[Se,ge]=m.useState(!1),W=n=>{ge(n)},Ie=ka(),Re=ja();return(function(n){const{isDataReady:Te}=n,{pathname:ke}=J(),X=Ca(ke??"")==="reports",je=wa(Te),Fe=m.useMemo((()=>X?xa:void 0),[X]);Sa({canFetchSuggestedQuestions:je,pageContexts:Fe})})({isDataReady:w==="Completed"}),Fa({isDataReady:w==="Completed"}),p.jsxs(p.Fragment,{children:[w==="Completed"?p.jsx(Oa,{analytics:$,onLoad:n=>n.trackPageLoaded(Da.Event.reports)}):null,p.jsx(va,{isAppContentDrawerOpen:Se,handleDrawerToggle:W}),p.jsx(Ga,{firstMonthOfFY:me,tenantEmailDomain:r,location:t,navigate:a,windowSize:_,classViewLayout:Ce,selectedReportID:O,analytics:$,filter:h,isAccountingClassesEnabled:T,isAccountingProjectsEnabled:S,isCompareModeOn:ye,hasTransactionAccess:we,signedInUser:i,selectedReportAndTimeframeFetchState:D,handleDrawerToggle:W,reportsResyncFetchState:he.reportsResyncFetchState,isAiCfoAccessEnabled:Re&&Ie&&!e,onAskAiCfoClick:()=>{if(be)if(b){const n=_e(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else Ua({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:f,isReportsCommentingEnabled:K,initialOpenThreadRequest:ue})]})}const j=e=>{switch(e){case"profit_and_loss":case"profit_and_loss_by_classes":case"profit_and_loss_by_projects":return"Profit & Loss";case"balance_sheet":case"balance_sheet_by_classes":case"balance_sheet_by_projects":return"Balance Sheet";case"cash_flow":case"cash_flow_by_classes":case"cash_flow_by_projects":return"Cash Flow";default:return"Reports"}};function _s(){const e=d((s=>q(s))),{useFeatureGate:o}=de(),{isFeatureEnabled:_}=o(N.isDebitCardFeatureEnabled),b=ha(_,e),a=ya(e);return b===!0||a===!0?p.jsx(La,{}):p.jsxs(Pe,{children:[p.jsx(ee,{path:"/",element:p.jsx(Ha,{})}),p.jsx(ee,{path:"*",element:p.jsx(Va,{})})]})}export{_s as default};
1
+ import{j as p}from"./liveblocks-DKqwsBQp.js";import{g as J,h as Oe,u as De,i as Ue,j as d,l as Ae,n as Pe,o as ee}from"./core-D6EV-11Y.js";import{fF as q,E1 as R,UC as Ee,l$ as le,u6 as ce,uX as U,lG as Ve,lP as A,lH as P,kK as E,kB as V,kA as Le,Db as ie,v0 as Me,bq as Be,UD as ve,bn as xe,Eo as ze,UE as Ge,UF as He,ci as g,D4 as Ye,UG as ae,UH as Ne,UI as $e,UJ as qe,UK as Ze,UL as Ke,UM as Qe,UN as We,UO as Xe,UP as Je,UQ as ea,UR as aa,US as sa,UT as j,UU as L,UV as M,UW as B,UX as v,UY as x,UZ as z,U_ as G,U$ as H,V0 as Y,ei as ta,E2 as oa,DR as se,DS as te,E8 as na,DW as oe,Ee as ra,V1 as la,V2 as ca,V3 as ia,V4 as da,V5 as pa,V6 as _a,V7 as fa,V8 as ma,V9 as ua,Va as ba,d_ as ha,dZ as ya}from"./zeni-epic-state-CZbm731W.js";import{an as Ca,ao as wa,ap as Sa,a as ga,a1 as Ia,N as de,d as N,z as pe,aq as Ra,U as Ta,f as ja,ar as ka,as as Fa,a8 as Oa,l as $,T as Da,y as Ua,p as _e,at as Aa,au as Pa,av as Ea}from"./index-lv0eG9-7.js";import"./mui-qouWiIWk.js";import Va from"./NotFoundScreen-r2t5kGnd.js";import{F as La}from"./FeaturePreviewScreen-BE9pWqir.js";import{a as u}from"./sentry-CxSdF_rC.js";import{u as Ma}from"./useInitialThreadRequest-BXjZ5prE.js";import{t as ne,a as re,b as Ba}from"./routePaths-BxLZuqJn.js";import{M as va}from"./MobileAppDrawer-Dubbrc5R.js";import"./recharts-C9zWmt1W.js";import"./analytics-wktvfErl.js";import"./plaid-deRHM6gT.js";import"./dnd-CkchuQYc.js";import"./stripe-cKAAJElX.js";import"./lottie-BwhdO6jl.js";import"./lexical-C6tQwGBF.js";import"./pdf-DcGn_mX8.js";import"./utils-D8aAQJhF.js";import"./InboxNotificationsProvider-gj6fT2eX.js";import"./useTaskManagerAccess-CncuT8wV.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]="566440e7-2ef9-431a-9d47-066e7ec35f5e",e._sentryDebugIdIdentifier="sentry-dbid-566440e7-2ef9-431a-9d47-066e7ec35f5e")}catch{}})();const xa=["profit_loss","balance_sheet","cash_flow"],I=e=>e==="balance_sheet"||e==="balance_sheet_by_classes"||e==="balance_sheet_by_projects",y=e=>{e(Y({resetLeftScroll:!0})),e(H({resetLeftScroll:!0})),e(G({resetLeftScroll:!0})),e(z({resetLeftScroll:!0})),e(x({resetLeftScroll:!0})),e(v({resetLeftScroll:!0})),e(L({resetLeftScroll:!0})),e(B({resetLeftScroll:!0})),e(M({resetLeftScroll:!0}))},za=e=>{e(ca()),e(ia()),e(da()),e(pa()),e(_a()),e(fa()),e(ma()),e(ua()),e(ba())},Ga=Ae((function(e){const o=pe.getSignedInUser(),_=e.tenantState.currentTenantId,m=q(e),a=m?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:_??""},t=R(e),r=ve(m);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,balanceSheetClassesViewReport:t.balanceSheetByClassReport,cashFlowClassesViewReport:t.cashFlowByClassReport,cashFlowProjectViewReport:t.cashFlowByProjectReport,balanceSheetProjectViewReport:t.balanceSheetByProjectReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:$,isZeniUser:xe(o),showAccountGroups:r===!0,isAccountingClassesEnabled:le(e),isAccountingProjectsEnabled:ce(e),currentTenantCompanyName:a,statementEndPoint:`${Ea}/statement`,authParams:s,isZeniCOAUsed:r}}),(function(e,o){const{navigate:_,handleDrawerToggle:m}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(U(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(la(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(ra(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:f,balancesRange:i}=l;let c=[...f];a==="year"&&(c=c.filter((C=>C!=="this_period_vs_same_period_last_year"&&C!=="this_period_vs_same_period_last_year_percent"&&C!=="same_period_last_year"))),e(se(o.firstMonthOfFY,r,i.numberOfPeriods<1?1:i.numberOfPeriods,c)),f.length>0&&e(te(o.firstMonthOfFY,c.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",i.numberOfPeriods<1?1:i.numberOfPeriods,c))}t!==!0&&setTimeout((()=>y(e)),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(j(a)),(I(a)||g(a))&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(oe({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(ae({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(oe(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(na(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(se(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(te(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout((()=>y(e)),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(oa({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=ta(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const f=a.accountName===""?a.accountDescription:a.accountName,i=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return ne(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return re(o.tenantEmailDomain,a.accountId,a.accountType,s.id,f,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?Ba(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,f,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?re(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],f,r,l):a.accountType!=null?ne(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l):void 0})();if(i!=null){const c=_e(o.location.state?.pathnameStackToGoBack,o.location.pathname);_(i,{state:{pathnameStackToGoBack:c,referrer:k(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(Y({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(H({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(G({scrollPosition:s}));break;case"balance_sheet":e(z({scrollPosition:s}));break;case"balance_sheet_by_classes":e(x({scrollPosition:s}));break;case"balance_sheet_by_projects":e(v({scrollPosition:s}));break;case"cash_flow_by_classes":e(B({scrollPosition:s}));break;case"cash_flow_by_projects":e(M({scrollPosition:s}));break;case"cash_flow":e(L({scrollPosition:s}));break;default:console.log(`Table Scroll state for ${a} is not handled`)}},onElementCollapseStateChanged:(a,s,t)=>{switch(a){case"profit_and_loss":e(Y({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(G({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(z({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_classes":e(x({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_projects":e(v({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_classes":e(B({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_projects":e(M({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(L({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{_("../../")},onUpdateAccountViewMode:(a,s)=>{const t=s??o.selectedReportID,r=I(t),l=g(t);l?(e(We({viewMode:a})),e(Xe({viewMode:a}))):r?(e(Je({viewMode:a})),e(ea({viewMode:a}))):(e(aa({viewMode:a})),e(sa({viewMode:a}))),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",k(t)),e(j(l?"cash_flow_by_classes":r?"balance_sheet_by_classes":"profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",k(t)),e(j(l?"cash_flow_by_projects":r?"balance_sheet_by_projects":"profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",k(t)),e(j(l?"cash_flow":r?"balance_sheet":"profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{g(o.selectedReportID)?e(Ze({classesToFilterOut:a})):I(o.selectedReportID)?e(Ke({classesToFilterOut:a})):e(Qe({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{g(o.selectedReportID)?e(Ne({projectsToFilterOut:a})):I(o.selectedReportID)?e($e({projectsToFilterOut:a})):e(qe({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(ae({classViewLayout:a}))},onOpenAccountViewMode:()=>{const a=I(o.selectedReportID),s=g(o.selectedReportID);o.isAccountingClassesEnabled&&e(s?P():a?V():Ye()),o.isAccountingProjectsEnabled&&e(s?A():a?E():ie())},onUpdateDisplayOrder:a=>{e(He(a))},onUpdateReportFormat:a=>{za(e),e(Ge(a))},onClickMenuIcon:()=>{m(!0)},onResyncReports:()=>{const a=o.selectedReportID;e(a!=="balance_sheet_by_classes"?a!=="balance_sheet_by_projects"?a!=="cash_flow_by_classes"?a!=="cash_flow_by_projects"?ze(a==="profit_and_loss_by_projects"?"profit_and_loss_by_projects":"profit_and_loss_by_classes"):A(!0):P(!0):E(!0):V(!0))}}}))(Aa);function Ha(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=ga(),_=Ia(),m=Pa(_),a=Oe(),s=De(),t=J(),{tenantEmailDomain:r}=Ue(),{useFeatureGate:l}=de(),{isFeatureEnabled:f}=l(N.isReportsHorizontalClassLayoutSwitchEnabled),i=pe.getSignedInUser(),[c,C]=u.useState(!1),[Z,fe]=u.useState(!1),{isFeatureEnabled:K}=l(N.isReportsCommentingEnabled);if(i==null)throw Error("Can't access reports page without signing in...");const F=d((n=>q(n))),me=F.masterTOSInfo?.isMasterTOSAccepted??!1,ue=F.company?.companyInfo.firstMonthOfFY??1,be=Ma(K?F?.companyId:void 0),w=d((n=>R(n).fetchState)),he=d((n=>Ee(n))),{areTenantIdsInSync:b}=Ra(),O=d((n=>n.financeStatementState.selectedReportId)),T=d((n=>le(n))),S=d((n=>ce(n))),ye=d((n=>R(n).isCompareModeOn)),h=d((n=>R(n).filter)),D=d((n=>R(n).selectedReportAndTimeframeFetchState)),Ce=d((n=>n.profitAndLossClassesViewState.uiState.classViewLayout));u.useEffect((()=>{!c&&b&&(C(!0),s(U(i.userId,!0,!0,!1)))}),[c,i,s,b]),u.useEffect((()=>{c&&!Z&&w==="Completed"&&b&&(s(U(i.userId,!1,!0,!1)),fe(!0))}),[c,Z,w,b]),u.useEffect((()=>{if(c&&D.fetchState==="Not-Started"&&h.timeframe!=="free_range"&&h.timeframe!=="week"&&b)switch(O){case"profit_and_loss":case"profit_and_loss_by_classes":s(Me(h.timeframe));break;case"profit_and_loss_by_projects":S&&s(ie());break;case"balance_sheet":s(Le(h.timeframe));break;case"balance_sheet_by_classes":T&&s(V());break;case"balance_sheet_by_projects":S&&s(E());break;case"cash_flow_by_classes":T&&s(P());break;case"cash_flow_by_projects":S&&s(A());break;case"cash_flow":s(Ve(h.timeframe))}}),[c,O,D,b,T,S]);const Q=Ta(),we=Q?.loggedInUserRole!=null&&Be(Q?.loggedInUserRole)!==!0,[Se,ge]=u.useState(!1),W=n=>{ge(n)},Ie=ja(),Re=ka();return(function(n){const{isDataReady:Te}=n,{pathname:je}=J(),X=Ca(je??"")==="reports",ke=wa(Te),Fe=u.useMemo((()=>X?xa:void 0),[X]);Sa({canFetchSuggestedQuestions:ke,pageContexts:Fe})})({isDataReady:w==="Completed"}),Fa({isDataReady:w==="Completed"}),p.jsxs(p.Fragment,{children:[w==="Completed"?p.jsx(Oa,{analytics:$,onLoad:n=>n.trackPageLoaded(Da.Event.reports)}):null,p.jsx(va,{isAppContentDrawerOpen:Se,handleDrawerToggle:W}),p.jsx(Ga,{firstMonthOfFY:ue,tenantEmailDomain:r,location:t,navigate:a,windowSize:_,classViewLayout:Ce,selectedReportID:O,analytics:$,filter:h,isAccountingClassesEnabled:T,isAccountingProjectsEnabled:S,isCompareModeOn:ye,hasTransactionAccess:we,signedInUser:i,selectedReportAndTimeframeFetchState:D,handleDrawerToggle:W,reportsResyncFetchState:he.reportsResyncFetchState,isAiCfoAccessEnabled:Re&&Ie&&!e,onAskAiCfoClick:()=>{if(me)if(m){const n=_e(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else Ua({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:f,isReportsCommentingEnabled:K,initialOpenThreadRequest:be})]})}const k=e=>{switch(e){case"profit_and_loss":case"profit_and_loss_by_classes":case"profit_and_loss_by_projects":return"Profit & Loss";case"balance_sheet":case"balance_sheet_by_classes":case"balance_sheet_by_projects":return"Balance Sheet";case"cash_flow":case"cash_flow_by_classes":case"cash_flow_by_projects":return"Cash Flow";default:return"Reports"}};function _s(){const e=d((s=>q(s))),{useFeatureGate:o}=de(),{isFeatureEnabled:_}=o(N.isDebitCardFeatureEnabled),m=ha(_,e),a=ya(e);return m===!0||a===!0?p.jsx(La,{}):p.jsxs(Pe,{children:[p.jsx(ee,{path:"/",element:p.jsx(Ha,{})}),p.jsx(ee,{path:"*",element:p.jsx(Va,{})})]})}export{_s as default};
@@ -0,0 +1 @@
1
+ import{j as a}from"./liveblocks-DKqwsBQp.js";import{z as w,a8 as S,l as u,T as D,e4 as E,N as I,d as k}from"./index-lv0eG9-7.js";import"./mui-qouWiIWk.js";import g from"./NotFoundScreen-r2t5kGnd.js";import{a as c}from"./sentry-CxSdF_rC.js";import{u as C,j as h,h as F,g as L,l as T,n as U,o as f,N as y}from"./core-D6EV-11Y.js";import{fF as _,a1M as j,a1N as p,DI as P,p$ as V,a1O as G,DG as z}from"./zeni-epic-state-CZbm731W.js";import"./recharts-C9zWmt1W.js";import"./analytics-wktvfErl.js";import"./plaid-deRHM6gT.js";import"./dnd-CkchuQYc.js";import"./stripe-cKAAJElX.js";import"./lottie-BwhdO6jl.js";import"./lexical-C6tQwGBF.js";import"./pdf-DcGn_mX8.js";import"./utils-D8aAQJhF.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]="378628ad-3404-4c6f-9a51-2d5bfe3f24ef",e._sentryDebugIdIdentifier="sentry-dbid-378628ad-3404-4c6f-9a51-2d5bfe3f24ef")}catch{}})();const M=T((function(e,t){const n=j(e);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}}),(function(e,t){const{navigate:n}=t,i=w.getSignedInUser();return{onDismissClick:()=>{e(p()),n("/")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach((l=>{s.push(l.companyName),r.push(l.emailIds[0])})),u.trackInviteEmailClicked("send",s,r,s.length)}e(z())},onUpdateInviteFormLocalData:s=>{e(G({localData:s}))},onSubmitSuccess:()=>{e(p())},onCancelClick:()=>{i!=null&&u.trackInviteEmailClicked("cancel")}}}))(E),O=()=>{const e=C(),[t,n]=c.useState(!1),[i,s]=c.useState(!1),r=h((o=>_(o))),l=F(),x=L(),d=w.getSignedInUser();if(d==null)throw Error("Can't access invite referral screen without signing in...");const m=h((o=>j(o))),N=d?.firstName!=null?d.firstName:"User";c.useEffect((()=>{e(p()),r?.rewardsLastViewedTime==null&&i===!1&&(e(P()),s(!0))}),[]),c.useEffect((()=>{t||m.fetchState!=="Not-Started"||(n(!0),e(V(!0)))}),[m.fetchState,e]);const b=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[m.fetchState==="Completed"?a.jsx(S,{analytics:u,onLoad:o=>(v=>v.trackPageLoaded(D.Event.inviteEmailViewed))(o)}):null,a.jsx(M,{navigate:l,location:x,currentTenant:r,companyName:b,userName:N,inviteFormCompayData:m.localData})]})};function ne(){const{useFeatureGate:e}=I(),{isFeatureEnabled:t}=e(k.isReferralFeatureEnabled);return a.jsxs(U,{children:[a.jsx(f,{path:"/",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(f,{path:"how-it-works",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(f,{path:"refer/*",element:t?a.jsx(O,{}):a.jsx(g,{})}),a.jsx(f,{path:"*",element:a.jsx(g,{})})]})}export{ne as default};
@@ -1,4 +1,4 @@
1
- import{j as k}from"./liveblocks-CW9yScMF.js";import{a as A}from"./sentry-C_uJQK1a.js";import{i as G,u as H,h as Q,g as ee,j as h,l as te}from"./core-BI5oX4mx.js";import{WA as Fe,WB as Ve,l$ as ae,sr as Me,sD as Ge,sT as Re,sR as $e,sU as Ke,sW as Ue,WC as Ye,fF as K,Vz as pe,WD as Se,g_ as ne,cB as se,cC as le,F6 as ve,WE as Ce,Fa as We,gO as ce,su as ze,t2 as qe,dD as Ze,dC as Xe,SX as fe,F4 as He,E_ as Qe,WF as De,ES as et,ER as tt,EM as at,EX as nt,Fb as st,WG as Y,WH as ge,ET as lt,VA as oe,Fr as Ae,Fk as Ie,WI as xe,sx as Te,Fe as Be,Fc as Le,WJ as Je,Fy as we,Fv as be,Ff as je,Fx as _e}from"./zeni-epic-state-CIizsNeB.js";import{a4 as de,aY as ie,aZ as ct,z as ot,j as dt,a7 as it,a8 as ue,k as N,av as ut,a_ as rt,p as V,G as Ee,E as ke,a$ as ht,b0 as mt,b1 as pt}from"./index-mRsR5jtB.js";import{n as re}from"./mui-KP5Ep0NX.js";import{p as St}from"./pathToGoBack-Ddmf68xx.js";import X from"./NotFoundScreen-BScz3VcE.js";import{c as M}from"./routePaths-Ch3GR24x.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]="151edfce-3523-4247-833b-7032e425f419",e._sentryDebugIdIdentifier="sentry-dbid-151edfce-3523-4247-833b-7032e425f419")}catch{}})();function $t({isRenderedInPanel:e=!1,accrualIdOverride:t,onPanelNavigateBack:c}={}){const{accrualId:s}=G(),l=t??s,n=H(),i=Q(),a=ee(),{accrual:d,actionFetchState:o,detailFetchState:m,localData:I}=h((u=>Fe(u,l??""))),p=h((u=>Ve(u))),C=h((u=>ae(u))),g=A.useCallback((()=>{const u=de(a.state?.pathnameStackToGoBack);i(u.poppedPathname??St(4),{state:{pathnameStackToGoBack:u.newStack}})}),[a.state,i]),f=A.useRef(!1);return A.useEffect((()=>{o.fetchState!=="In-Progress"&&f.current&&o.fetchState==="Completed"&&(f.current=!1,g())}),[o.fetchState,g]),A.useEffect((()=>{l!=null&&d==null&&m.fetchState==="Not-Started"&&n(Me(l))}),[l,d,m.fetchState]),A.useEffect((()=>{n(Ge({scheduleType:"prepaid_expenses",shouldResetEnteredData:!1}))}),[n]),l==null?k.jsx(X,{}):d==null?m.fetchState==="Not-Started"||m.fetchState==="In-Progress"?k.jsx(ie,{}):k.jsx(X,{}):k.jsx(ft,{children:k.jsx(ct,{isRenderedInPanel:e,accrual:d,actionFetchState:o.fetchState,isAccountingClassesEnabled:C,localData:I,newAccrualAccountsView:p,onAccrualFormChange:(u,r)=>{n(Ye({accrualId:u,localData:r}))},onAccrualFormClear:u=>{n(Ue({accrualId:u}))},onApproveAndPost:u=>{n(Ke(l,u))},onNavigateBack:c??g,onRevert:(u,r)=>{f.current=!0,n($e(l,u,r))},onSkip:(u,r)=>{n(Re(l,u,r))}})})}const ft=re.div`
1
+ import{j as k}from"./liveblocks-DKqwsBQp.js";import{a as A}from"./sentry-CxSdF_rC.js";import{i as G,u as H,h as Q,g as ee,j as h,l as te}from"./core-D6EV-11Y.js";import{WA as Fe,WB as Ve,l$ as ae,sr as Me,sD as Ge,sT as Re,sR as $e,sU as Ke,sW as Ue,WC as Ye,fF as K,Vz as pe,WD as Se,g_ as ne,cB as se,cC as le,F6 as ve,WE as Ce,Fa as We,gO as ce,su as ze,t2 as qe,dD as Ze,dC as Xe,SX as fe,F4 as He,E_ as Qe,WF as De,ES as et,ER as tt,EM as at,EX as nt,Fb as st,WG as Y,WH as ge,ET as lt,VA as oe,Fr as Ae,Fk as Ie,WI as xe,sx as Te,Fe as Be,Fc as be,WJ as Le,Fy as Je,Fv as we,Ff as je,Fx as _e}from"./zeni-epic-state-CZbm731W.js";import{a4 as de,aY as ie,aZ as ct,z as ot,k as dt,a7 as it,a8 as ue,l as N,av as ut,a_ as rt,p as V,G as Ee,c as ke,a$ as ht,b0 as mt,b1 as pt}from"./index-lv0eG9-7.js";import{n as re}from"./mui-qouWiIWk.js";import{p as St}from"./pathToGoBack-DMRqTTJ7.js";import X from"./NotFoundScreen-r2t5kGnd.js";import{c as M}from"./routePaths-BxLZuqJn.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]="b5681a82-e4ad-41d0-83be-bda8101de5b3",e._sentryDebugIdIdentifier="sentry-dbid-b5681a82-e4ad-41d0-83be-bda8101de5b3")}catch{}})();function $t({isRenderedInPanel:e=!1,accrualIdOverride:t,onPanelNavigateBack:c}={}){const{accrualId:s}=G(),l=t??s,n=H(),i=Q(),a=ee(),{accrual:d,actionFetchState:o,detailFetchState:m,localData:I}=h((u=>Fe(u,l??""))),p=h((u=>Ve(u))),C=h((u=>ae(u))),g=A.useCallback((()=>{const u=de(a.state?.pathnameStackToGoBack);i(u.poppedPathname??St(4),{state:{pathnameStackToGoBack:u.newStack}})}),[a.state,i]),f=A.useRef(!1);return A.useEffect((()=>{o.fetchState!=="In-Progress"&&f.current&&o.fetchState==="Completed"&&(f.current=!1,g())}),[o.fetchState,g]),A.useEffect((()=>{l!=null&&d==null&&m.fetchState==="Not-Started"&&n(Me(l))}),[l,d,m.fetchState]),A.useEffect((()=>{n(Ge({scheduleType:"prepaid_expenses",shouldResetEnteredData:!1}))}),[n]),l==null?k.jsx(X,{}):d==null?m.fetchState==="Not-Started"||m.fetchState==="In-Progress"?k.jsx(ie,{}):k.jsx(X,{}):k.jsx(ft,{children:k.jsx(ct,{isRenderedInPanel:e,accrual:d,actionFetchState:o.fetchState,isAccountingClassesEnabled:C,localData:I,newAccrualAccountsView:p,onAccrualFormChange:(u,r)=>{n(Ye({accrualId:u,localData:r}))},onAccrualFormClear:u=>{n(Ue({accrualId:u}))},onApproveAndPost:u=>{n(Ke(l,u))},onNavigateBack:c??g,onRevert:(u,r)=>{f.current=!0,n($e(l,u,r))},onSkip:(u,r)=>{n(Re(l,u,r))}})})}const ft=re.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -14,7 +14,7 @@ import{j as k}from"./liveblocks-CW9yScMF.js";import{a as A}from"./sentry-C_uJQK1
14
14
  flex-direction: column;
15
15
  align-items: center;
16
16
  background-color: ${e=>e.theme.colors.grey4};
17
- `,yt=te((function(e){const t=K(e),c=e.entityAutoCompleteState.autoCompleteText.common,s=De(e,"common");return{tenantName:t.companyName,vendorSearchAutoCompleteData:{autoCompleteText:c,entityAutoCompleteView:s}}}),(function(e,t){const{navigate:c,location:s}=t,l="accrued_expenses";return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const n=de(s.state?.pathnameStackToGoBack);n.poppedPathname==null?c("../schedules/accrued_expenses"):c(n.poppedPathname,{state:{pathnameStackToGoBack:n.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:n=>{t.setShouldNavigateBack(!0),e(ve(l,n))},onDelete:n=>{e(lt(l,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(n,i)=>{n.trim().length>=2?e(ge({searchString:n,entityType:i,searchOrigin:"common"})):n.trim().length===0&&e(Y("common"))},onCancelAutoComplete:()=>{e(Y("common"))}},onEditAmount:(n,i)=>{e(st(l,n,i))},onJELinkClick:n=>{e(nt({selectedJELinkRowIndex:n})),c("./edit_link")},onCancelAccrual:(n,i,a)=>{e(at(n,i,a))},onTransactionClick:n=>{const i=`${M(n,t.tenantEmailDomain)}`,a=V(s.state?.pathnameStackToGoBack,s.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewPostedJE:n=>{const i=`${M(n,t.tenantEmailDomain)}`,a=V(s.state?.pathnameStackToGoBack,s.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewRecordedJE:n=>{const i=`${M(n,t.tenantEmailDomain)}`,a=V(s.state?.pathnameStackToGoBack,s.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewBillExpense:n=>{const i=`${M(n,t.tenantEmailDomain)}`,a=V(s.state?.pathnameStackToGoBack,s.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onDetailPageChange:(n,i,a)=>{const{scheduleDetailsAccruedExpensesSection:d}=n,{amount:o,memo:m,months:I,scheduleAccruedExpenseCategory:p,scheduleClass:C,scheduleExpenseCategory:g,startDate:f,vendor:u}=d,r=C.selectedOption!=null?t.classList.find((B=>B.classId===C.selectedOption)):void 0,v=g.selectedOption!=null?t.accountList.find((B=>B.qboId===g.selectedOption)):void 0,D=p.selectedOption!=null?t.accruedAccountList.find((B=>B.qboId===p.selectedOption)):void 0,J=I?.selectedOption;e(et({scheduleType:l,localData:i,selectedJeScheduleDetailId:t.scheduleDetailId})),a!==!1||t.scheduleDetailId!=null||v?.accountId==null||t.isAccountingClassesEnabled!==!1&&r?.classId==null||D==null||u.selectedOption==null||m==null||o==null&&o==0||f==null||J==null||e(tt({scheduleType:l}))}}}))(ht),Ut=({shouldNavigateBack:e,setShouldNavigateBack:t,isRenderedInPanel:c=!1,scheduleDetailIdOverride:s,onPanelCloseAfterDecision:l,onPanelNavigateBack:n}={})=>{const[i,a]=A.useState(!1),d=e??i,o=t??a,m=Q(),I=ee(),p=H(),C=ke(),{tenantEmailDomain:g}=G(),[f,u]=A.useState(!1);if(g==null)throw new Error("Can't access this page without a tenantEmailDomain");const{scheduleDetailId:r}=G(),v=s??r;let D;v!=="new"&&(D=v);const J=Ct(v),B=h((L=>L.scheduleAccruedDetailState.selectedJEAccruedScheduleKey)),w="accrued_expenses",y=h((L=>Se(L,"accrued_expenses"))),b=h((L=>fe(L))),j=h((L=>L.classListState.fetchState)),x=h((L=>ae(L))),_=b!=="Completed"||j!=="Completed";A.useEffect((()=>{f===!1&&_?(p(He(w,D)),u(!0)):_===!1&&f===!1&&v!=="new"&&(p(Qe(w,v)),u(!0))}),[f]);const P=h((L=>K(L))),T=h((L=>ne(L,P.companyId))),O=I.state?.message==="expenseAutomation",W=h((L=>ce(L).selectedPeriod)),U=c||O,{onScheduleDecision:z,scheduleDecisionStatus:q}=ye({jeScheduleId:y.selectedJEAccruedSchedule?.jeScheduleId,scheduleKey:y.selectedJEAccruedSchedule?.jeAccruedScheduleKey,scheduleType:w,onDecided:()=>{if(l==null)if(O!==!0)m("../schedules/accrued_expenses");else{const{month:L,year:Pe}=W;m(`../../month_end_close_checks/review/je_schedules/${L}-${Pe}`)}else l()}}),F=y.fetchState,R=y.allAccountList,Z=y.allClassList,E=y.allAccruedAccountList,S=y.scheduleAccruedDetailsLocalData;if(J!==!0||y.fetchState==="Error")return k.jsx(X,{});const $=F==="Completed"&&f===!0,Oe=y.selectedJEAccruedSchedule!=null;return F==="Completed"||F==="Not-Started"||c===!0&&Oe?k.jsxs(kt,{children:[$===!0?k.jsx(ue,{analytics:N,onLoad:()=>{vt(y,w,T)}}):null,k.jsx(yt,{onScheduleDecision:U?z:void 0,scheduleDecisionStatus:q,isRenderedInPanel:c,onPanelNavigateBack:n,setShouldNavigateBack:o,scheduleAccruedDetailsView:y,location:I,navigate:m,classList:Z,accountList:R,shouldNavigateBack:d,accruedAccountList:E,scheduleLocalData:S,selectedJEScheduleKey:B,scheduleDetailId:D,selectedScheduledJournalEntries:y.selectedJEAccruedSchedule?.scheduledJournalEntry??[],themeState:C,tenantEmailDomain:g,analytics:N,controllerUserDetails:T,isAccountingClassesEnabled:x,status:y.selectedJEAccruedSchedule?.status.code})]}):k.jsx(ie,{})},Ct=e=>e!=null,vt=(e,t,c)=>{const s=e.selectedJEAccruedSchedule,l=se(c.controllers),n=le(c.controllerUserIds);s!=null&&N.trackScheduleAccruedDetailsLoaded({scheduleType:t,scheduleExpenseCategoryAndClass:{expenseCategory:s.jeDebit.account?.accountName??null,expenseClass:s.jeDebit.accountingClass?.className??null},schedule:{...Ne(s)},vendorName:s.vendor.name??null,controllerEmails:l,controllerUserIds:n})},At=re.div`
17
+ `,yt=te((function(e){const t=K(e),c=e.entityAutoCompleteState.autoCompleteText.common,s=De(e,"common");return{tenantName:t.companyName,vendorSearchAutoCompleteData:{autoCompleteText:c,entityAutoCompleteView:s}}}),(function(e,t){const{navigate:c,location:s}=t,l="accrued_expenses";return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const n=de(s.state?.pathnameStackToGoBack);n.poppedPathname==null?c("../schedules/accrued_expenses"):c(n.poppedPathname,{state:{pathnameStackToGoBack:n.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:n=>{t.setShouldNavigateBack(!0),e(ve(l,n))},onDelete:n=>{e(lt(l,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(n,i)=>{n.trim().length>=2?e(ge({searchString:n,entityType:i,searchOrigin:"common"})):n.trim().length===0&&e(Y("common"))},onCancelAutoComplete:()=>{e(Y("common"))}},onEditAmount:(n,i)=>{e(st(l,n,i))},onJELinkClick:n=>{e(nt({selectedJELinkRowIndex:n})),c("./edit_link")},onCancelAccrual:(n,i,a)=>{e(at(n,i,a))},onTransactionClick:n=>{const i=`${M(n,t.tenantEmailDomain)}`,a=V(s.state?.pathnameStackToGoBack,s.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewPostedJE:n=>{const i=`${M(n,t.tenantEmailDomain)}`,a=V(s.state?.pathnameStackToGoBack,s.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewRecordedJE:n=>{const i=`${M(n,t.tenantEmailDomain)}`,a=V(s.state?.pathnameStackToGoBack,s.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewBillExpense:n=>{const i=`${M(n,t.tenantEmailDomain)}`,a=V(s.state?.pathnameStackToGoBack,s.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onDetailPageChange:(n,i,a)=>{const{scheduleDetailsAccruedExpensesSection:d}=n,{amount:o,memo:m,months:I,scheduleAccruedExpenseCategory:p,scheduleClass:C,scheduleExpenseCategory:g,startDate:f,vendor:u}=d,r=C.selectedOption!=null?t.classList.find((B=>B.classId===C.selectedOption)):void 0,v=g.selectedOption!=null?t.accountList.find((B=>B.qboId===g.selectedOption)):void 0,D=p.selectedOption!=null?t.accruedAccountList.find((B=>B.qboId===p.selectedOption)):void 0,L=I?.selectedOption;e(et({scheduleType:l,localData:i,selectedJeScheduleDetailId:t.scheduleDetailId})),a!==!1||t.scheduleDetailId!=null||v?.accountId==null||t.isAccountingClassesEnabled!==!1&&r?.classId==null||D==null||u.selectedOption==null||m==null||o==null&&o==0||f==null||L==null||e(tt({scheduleType:l}))}}}))(ht),Ut=({shouldNavigateBack:e,setShouldNavigateBack:t,isRenderedInPanel:c=!1,scheduleDetailIdOverride:s,onPanelCloseAfterDecision:l,onPanelNavigateBack:n}={})=>{const[i,a]=A.useState(!1),d=e??i,o=t??a,m=Q(),I=ee(),p=H(),C=ke(),{tenantEmailDomain:g}=G(),[f,u]=A.useState(!1);if(g==null)throw new Error("Can't access this page without a tenantEmailDomain");const{scheduleDetailId:r}=G(),v=s??r;let D;v!=="new"&&(D=v);const L=Ct(v),B=h((b=>b.scheduleAccruedDetailState.selectedJEAccruedScheduleKey)),J="accrued_expenses",y=h((b=>Se(b,"accrued_expenses"))),w=h((b=>fe(b))),j=h((b=>b.classListState.fetchState)),x=h((b=>ae(b))),_=w!=="Completed"||j!=="Completed";A.useEffect((()=>{f===!1&&_?(p(He(J,D)),u(!0)):_===!1&&f===!1&&v!=="new"&&(p(Qe(J,v)),u(!0))}),[f]);const P=h((b=>K(b))),T=h((b=>ne(b,P.companyId))),O=I.state?.message==="expenseAutomation",W=h((b=>ce(b).selectedPeriod)),U=c||O,{onScheduleDecision:z,scheduleDecisionStatus:q}=ye({jeScheduleId:y.selectedJEAccruedSchedule?.jeScheduleId,scheduleKey:y.selectedJEAccruedSchedule?.jeAccruedScheduleKey,scheduleType:J,onDecided:()=>{if(l==null)if(O!==!0)m("../schedules/accrued_expenses");else{const{month:b,year:Pe}=W;m(`../../month_end_close_checks/review/je_schedules/${b}-${Pe}`)}else l()}}),F=y.fetchState,R=y.allAccountList,Z=y.allClassList,E=y.allAccruedAccountList,S=y.scheduleAccruedDetailsLocalData;if(L!==!0||y.fetchState==="Error")return k.jsx(X,{});const $=F==="Completed"&&f===!0,Oe=y.selectedJEAccruedSchedule!=null;return F==="Completed"||F==="Not-Started"||c===!0&&Oe?k.jsxs(kt,{children:[$===!0?k.jsx(ue,{analytics:N,onLoad:()=>{vt(y,J,T)}}):null,k.jsx(yt,{onScheduleDecision:U?z:void 0,scheduleDecisionStatus:q,isRenderedInPanel:c,onPanelNavigateBack:n,setShouldNavigateBack:o,scheduleAccruedDetailsView:y,location:I,navigate:m,classList:Z,accountList:R,shouldNavigateBack:d,accruedAccountList:E,scheduleLocalData:S,selectedJEScheduleKey:B,scheduleDetailId:D,selectedScheduledJournalEntries:y.selectedJEAccruedSchedule?.scheduledJournalEntry??[],themeState:C,tenantEmailDomain:g,analytics:N,controllerUserDetails:T,isAccountingClassesEnabled:x,status:y.selectedJEAccruedSchedule?.status.code})]}):k.jsx(ie,{})},Ct=e=>e!=null,vt=(e,t,c)=>{const s=e.selectedJEAccruedSchedule,l=se(c.controllers),n=le(c.controllerUserIds);s!=null&&N.trackScheduleAccruedDetailsLoaded({scheduleType:t,scheduleExpenseCategoryAndClass:{expenseCategory:s.jeDebit.account?.accountName??null,expenseClass:s.jeDebit.accountingClass?.className??null},schedule:{...Ne(s)},vendorName:s.vendor.name??null,controllerEmails:l,controllerUserIds:n})},At=re.div`
18
18
  display: flex;
19
19
  min-height: 100%;
20
20
  width: 100%;
@@ -22,7 +22,7 @@ import{j as k}from"./liveblocks-CW9yScMF.js";import{a as A}from"./sentry-C_uJQK1
22
22
  flex-direction: column;
23
23
  align-items: center;
24
24
  background-color: ${e=>e.theme.colors.grey4};
25
- `,he=Ee.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,It=te((function(e){const t=K(e),c=oe(e,"fixed_assets");return{tenantName:t.companyName,scheduleDetailsView:c}}),(function(e,t){const{navigate:c,location:s,vendorSearchAutoCompleteData:l,selectedScheduledJournalEntries:n}=t,i="fixed_assets",a=n.flatMap((d=>d.error)).filter((d=>!!d))??[];return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const d=de(t.location.state?.pathnameStackToGoBack);d.poppedPathname==null?c("../schedules/fixed_assets"):t.navigate(d.poppedPathname,{state:{pathnameStackToGoBack:d.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:d=>{e(_e(i,d,a.length>0))},onDelete:d=>{e(je(i,d))},onMarkAsComplete:()=>{t.selectedJEScheduleKey!=null&&e(be(i,t.selectedJEScheduleKey))},onEditAmount:(d,o)=>{e(we(i,d,o))},onJELinkClick:d=>{e(Je({selectedJELinkRowIndex:d})),c("./edit_link")},onTransactionClick:d=>{const o=`${M(d,t.tenantEmailDomain)}`,m=V(s.state?.pathnameStackToGoBack,s.pathname);c(o,{state:{pathnameStackToGoBack:m,message:"comingFromScheduleDetailsFixedAssets"}})},onViewLinkedJE:d=>{const o=`${M(d,t.tenantEmailDomain)}`,m=V(s.state?.pathnameStackToGoBack,s.pathname);c(o,{state:{pathnameStackToGoBack:m}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(d,o)=>{d.trim().length>=2?e(ge({searchString:d,entityType:o,searchOrigin:"common"})):d.trim().length===0&&e(Y("common"))},onCancelAutoComplete:()=>{e(Y("common"))}},onDetailPageChange:(d,o)=>{const{scheduleDetailsFixedAssetsSection:m,scheduleDetailsListSection:I}=d,{scheduleClass:p,scheduleExpenseCategory:C,accumulatedDepreciationCategory:g,assetId:f,months:u,startDate:r,postingDate:v,vendor:D}=m,J=l.entityAutoCompleteView.vendor.length>0?l.entityAutoCompleteView.vendor.find((T=>T.id===D?.selectedOption)):void 0,B={id:J?.zeniId??D?.selectedOption??"",name:J?.name??D?.defaultOptions.find((T=>T.value===D?.selectedOption))?.label??"",logo:J?.logo},w=p.selectedOption!=null?t.classList.find((T=>T.classId===p.selectedOption)):void 0,y=C.selectedOption!=null?t.accountList.find((T=>T.qboId===C.selectedOption)):void 0,b=g.selectedOption!=null?t.depAccountList.find((T=>T.qboId===g.selectedOption)):void 0,j=u?.selectedOption,x=I.map(((T,O)=>({...t.scheduleLocalData.jeScheduleDetails[O],amount:{...t.scheduleLocalData.jeScheduleDetails[O].amount,amount:T.amount}}))),_=v.type==="day"?v.dayOfMonth?v.dayOfMonth:1:void 0,P=v.type==="lastDayOfMonth"||void 0;e(Be({scheduleType:i,localData:{selectedAccount:y?.accountId,selectedClass:w?.classId,selectedAccumulatedDepreciationCategory:b?.accountId,selectedDate:r,selectedMonths:j,assetId:f,jeScheduleDetails:x,lastDayOfMonth:P,selectedDayOfMonth:_,selectedVendor:B},selectedJeScheduleDetailId:t.scheduleDetailId})),o!==!1||b?.accountId==null||t.scheduleDetailId!=null&&t.status!=="draft"&&t.status!=="marked_as_completed"||y?.accountId==null||t.isAccountingClassesEnabled!==!1&&w?.classId==null||r==null||j==null||P!==!0&&_==null||e(Le({scheduleType:i}))}}}))(mt),Yt=({isRenderedInPanel:e=!1,scheduleDetailIdOverride:t,onPanelCloseAfterDecision:c,onPanelNavigateBack:s}={})=>{const l=Q(),n=ee(),i=H(),a=ke(),{tenantEmailDomain:d}=G(),[o,m]=A.useState(!1),{scheduleDetailId:I}=G(),p=t??I,C=n.state?.message==="expenseAutomation",g=xt(p),f=h((E=>E.scheduleDetailState.selectedJEScheduleKey));A.useEffect((()=>{f!=null&&f.length!==0||p!=="new"||l("../schedules/fixed_assets")}),[f,p]);const u="fixed_assets",r=h((E=>oe(E,u))),v=h((E=>E.entityAutoCompleteState.autoCompleteText.common)),D=h((E=>De(E,"common"))),J=h((E=>fe(E))),B=h((E=>E.classListState.fetchState)),w=h((E=>ae(E))),y=h((E=>ce(E).selectedPeriod)),b=J!=="Completed"||B!=="Completed";A.useEffect((()=>{o===!1&&b?(i(Ae(u,F,!0)),m(!0)):b===!1&&o===!1&&(i(Ie(u,p==="new"?void 0:p,!0)),m(!0))}),[o]),A.useEffect((()=>{if(r.markAsCompleteStatus.fetchState==="Completed")if(i(xe()),C===!0){const{month:E,year:S}=y;l(`../../month_end_close_checks/review/je_schedules/${E}-${S}`)}else l("../schedules/fixed_assets")}),[r.markAsCompleteStatus.fetchState]);const j=h((E=>K(E))),x=h((E=>ne(E,j.companyId))),_=e||C,{onScheduleDecision:P,scheduleDecisionStatus:T}=ye({jeScheduleId:r.selectedJEScheduleTransaction?.jeScheduleId,scheduleKey:r.selectedJEScheduleTransaction?.jeScheduleTransactionKey,scheduleType:u,onDecided:()=>{if(c==null)if(C!==!0)l("../schedules/fixed_assets");else{const{month:E,year:S}=y;l(`../../month_end_close_checks/review/je_schedules/${E}-${S}`)}else c()}}),O=r.fetchState,W=r.allAccountList,U=r.allClassList,z=r.allDepreciationAccountList,q=r.scheduleDetailsLocalData.fixed_assets;let F;if(p!=="new"&&(F=p),g!==!0||r.fetchState==="Error")return k.jsx(X,{});const R=O==="Completed"&&o===!0,Z=r.selectedJEScheduleTransaction!=null;return O==="Completed"||e===!0&&Z?k.jsxs(At,{children:[R===!0?k.jsx(ue,{analytics:N,onLoad:()=>{Bt(r,u,x)}}):null,k.jsx(It,{onScheduleDecision:_?P:void 0,scheduleDecisionStatus:T,isRenderedInPanel:e,onPanelNavigateBack:s,location:n,navigate:l,classList:U,vendorSearchEntityAutoCompleteView:D,vendorSearchAutoCompleteData:{autoCompleteText:v,entityAutoCompleteView:D},expenseAutomationSelectedPeriod:y,usedInExpenseAutomation:C,removeJeScheduleTransactionKey:(E,S)=>{i(Te(E,S))},accountList:W,depAccountList:z,scheduleLocalData:q,selectedJEScheduleKey:f,scheduleDetailId:F,selectedScheduledJournalEntries:r.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:a,tenantEmailDomain:d,analytics:N,controllerUserDetails:x,isAccountingClassesEnabled:w,status:r.selectedJEScheduleTransaction?.status.code})]}):k.jsx(ie,{})},xt=e=>e!=null,Tt=e=>({transactionDate:e.date.format(he),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),Bt=(e,t,c)=>{const s=e.selectedJEScheduleTransaction?.baseTransaction,l=e.selectedJEScheduleTransaction,n=se(c.controllers),i=le(c.controllerUserIds);var a;s!=null&&l!=null&&N.trackScheduleDetailsLoaded({scheduleType:t,transaction:{...Tt(s)},scheduleExpenseCategoryAndClass:{expenseCategory:l.jeDebit.account?.accountName??null,expenseClass:l.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(a=l,{currentBalance:a.balanceAsOfToday??null,currentStatus:a.status.label,period:a.period??null,startMonth:a.startDate?.format(he)??null,endMonth:a.endDate?.format(he)??null})},vendorName:l.vendor.name??null,fixedAssetsDetails:{accumulatedDepreciationCategory:l.jeCredit.account?.accountName??null,assetId:l.otherAttributes.assetId??null},controllerEmails:n,controllerUserIds:i})},Lt=re.div`
25
+ `,he=Ee.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,It=te((function(e){const t=K(e),c=oe(e,"fixed_assets");return{tenantName:t.companyName,scheduleDetailsView:c}}),(function(e,t){const{navigate:c,location:s,vendorSearchAutoCompleteData:l,selectedScheduledJournalEntries:n}=t,i="fixed_assets",a=n.flatMap((d=>d.error)).filter((d=>!!d))??[];return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const d=de(t.location.state?.pathnameStackToGoBack);d.poppedPathname==null?c("../schedules/fixed_assets"):t.navigate(d.poppedPathname,{state:{pathnameStackToGoBack:d.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:d=>{e(_e(i,d,a.length>0))},onDelete:d=>{e(je(i,d))},onMarkAsComplete:()=>{t.selectedJEScheduleKey!=null&&e(we(i,t.selectedJEScheduleKey))},onEditAmount:(d,o)=>{e(Je(i,d,o))},onJELinkClick:d=>{e(Le({selectedJELinkRowIndex:d})),c("./edit_link")},onTransactionClick:d=>{const o=`${M(d,t.tenantEmailDomain)}`,m=V(s.state?.pathnameStackToGoBack,s.pathname);c(o,{state:{pathnameStackToGoBack:m,message:"comingFromScheduleDetailsFixedAssets"}})},onViewLinkedJE:d=>{const o=`${M(d,t.tenantEmailDomain)}`,m=V(s.state?.pathnameStackToGoBack,s.pathname);c(o,{state:{pathnameStackToGoBack:m}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(d,o)=>{d.trim().length>=2?e(ge({searchString:d,entityType:o,searchOrigin:"common"})):d.trim().length===0&&e(Y("common"))},onCancelAutoComplete:()=>{e(Y("common"))}},onDetailPageChange:(d,o)=>{const{scheduleDetailsFixedAssetsSection:m,scheduleDetailsListSection:I}=d,{scheduleClass:p,scheduleExpenseCategory:C,accumulatedDepreciationCategory:g,assetId:f,months:u,startDate:r,postingDate:v,vendor:D}=m,L=l.entityAutoCompleteView.vendor.length>0?l.entityAutoCompleteView.vendor.find((T=>T.id===D?.selectedOption)):void 0,B={id:L?.zeniId??D?.selectedOption??"",name:L?.name??D?.defaultOptions.find((T=>T.value===D?.selectedOption))?.label??"",logo:L?.logo},J=p.selectedOption!=null?t.classList.find((T=>T.classId===p.selectedOption)):void 0,y=C.selectedOption!=null?t.accountList.find((T=>T.qboId===C.selectedOption)):void 0,w=g.selectedOption!=null?t.depAccountList.find((T=>T.qboId===g.selectedOption)):void 0,j=u?.selectedOption,x=I.map(((T,O)=>({...t.scheduleLocalData.jeScheduleDetails[O],amount:{...t.scheduleLocalData.jeScheduleDetails[O].amount,amount:T.amount}}))),_=v.type==="day"?v.dayOfMonth?v.dayOfMonth:1:void 0,P=v.type==="lastDayOfMonth"||void 0;e(Be({scheduleType:i,localData:{selectedAccount:y?.accountId,selectedClass:J?.classId,selectedAccumulatedDepreciationCategory:w?.accountId,selectedDate:r,selectedMonths:j,assetId:f,jeScheduleDetails:x,lastDayOfMonth:P,selectedDayOfMonth:_,selectedVendor:B},selectedJeScheduleDetailId:t.scheduleDetailId})),o!==!1||w?.accountId==null||t.scheduleDetailId!=null&&t.status!=="draft"&&t.status!=="marked_as_completed"||y?.accountId==null||t.isAccountingClassesEnabled!==!1&&J?.classId==null||r==null||j==null||P!==!0&&_==null||e(be({scheduleType:i}))}}}))(mt),Yt=({isRenderedInPanel:e=!1,scheduleDetailIdOverride:t,onPanelCloseAfterDecision:c,onPanelNavigateBack:s}={})=>{const l=Q(),n=ee(),i=H(),a=ke(),{tenantEmailDomain:d}=G(),[o,m]=A.useState(!1),{scheduleDetailId:I}=G(),p=t??I,C=n.state?.message==="expenseAutomation",g=xt(p),f=h((E=>E.scheduleDetailState.selectedJEScheduleKey));A.useEffect((()=>{f!=null&&f.length!==0||p!=="new"||l("../schedules/fixed_assets")}),[f,p]);const u="fixed_assets",r=h((E=>oe(E,u))),v=h((E=>E.entityAutoCompleteState.autoCompleteText.common)),D=h((E=>De(E,"common"))),L=h((E=>fe(E))),B=h((E=>E.classListState.fetchState)),J=h((E=>ae(E))),y=h((E=>ce(E).selectedPeriod)),w=L!=="Completed"||B!=="Completed";A.useEffect((()=>{o===!1&&w?(i(Ae(u,F,!0)),m(!0)):w===!1&&o===!1&&(i(Ie(u,p==="new"?void 0:p,!0)),m(!0))}),[o]),A.useEffect((()=>{if(r.markAsCompleteStatus.fetchState==="Completed")if(i(xe()),C===!0){const{month:E,year:S}=y;l(`../../month_end_close_checks/review/je_schedules/${E}-${S}`)}else l("../schedules/fixed_assets")}),[r.markAsCompleteStatus.fetchState]);const j=h((E=>K(E))),x=h((E=>ne(E,j.companyId))),_=e||C,{onScheduleDecision:P,scheduleDecisionStatus:T}=ye({jeScheduleId:r.selectedJEScheduleTransaction?.jeScheduleId,scheduleKey:r.selectedJEScheduleTransaction?.jeScheduleTransactionKey,scheduleType:u,onDecided:()=>{if(c==null)if(C!==!0)l("../schedules/fixed_assets");else{const{month:E,year:S}=y;l(`../../month_end_close_checks/review/je_schedules/${E}-${S}`)}else c()}}),O=r.fetchState,W=r.allAccountList,U=r.allClassList,z=r.allDepreciationAccountList,q=r.scheduleDetailsLocalData.fixed_assets;let F;if(p!=="new"&&(F=p),g!==!0||r.fetchState==="Error")return k.jsx(X,{});const R=O==="Completed"&&o===!0,Z=r.selectedJEScheduleTransaction!=null;return O==="Completed"||e===!0&&Z?k.jsxs(At,{children:[R===!0?k.jsx(ue,{analytics:N,onLoad:()=>{Bt(r,u,x)}}):null,k.jsx(It,{onScheduleDecision:_?P:void 0,scheduleDecisionStatus:T,isRenderedInPanel:e,onPanelNavigateBack:s,location:n,navigate:l,classList:U,vendorSearchEntityAutoCompleteView:D,vendorSearchAutoCompleteData:{autoCompleteText:v,entityAutoCompleteView:D},expenseAutomationSelectedPeriod:y,usedInExpenseAutomation:C,removeJeScheduleTransactionKey:(E,S)=>{i(Te(E,S))},accountList:W,depAccountList:z,scheduleLocalData:q,selectedJEScheduleKey:f,scheduleDetailId:F,selectedScheduledJournalEntries:r.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:a,tenantEmailDomain:d,analytics:N,controllerUserDetails:x,isAccountingClassesEnabled:J,status:r.selectedJEScheduleTransaction?.status.code})]}):k.jsx(ie,{})},xt=e=>e!=null,Tt=e=>({transactionDate:e.date.format(he),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),Bt=(e,t,c)=>{const s=e.selectedJEScheduleTransaction?.baseTransaction,l=e.selectedJEScheduleTransaction,n=se(c.controllers),i=le(c.controllerUserIds);var a;s!=null&&l!=null&&N.trackScheduleDetailsLoaded({scheduleType:t,transaction:{...Tt(s)},scheduleExpenseCategoryAndClass:{expenseCategory:l.jeDebit.account?.accountName??null,expenseClass:l.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(a=l,{currentBalance:a.balanceAsOfToday??null,currentStatus:a.status.label,period:a.period??null,startMonth:a.startDate?.format(he)??null,endMonth:a.endDate?.format(he)??null})},vendorName:l.vendor.name??null,fixedAssetsDetails:{accumulatedDepreciationCategory:l.jeCredit.account?.accountName??null,assetId:l.otherAttributes.assetId??null},controllerEmails:n,controllerUserIds:i})},bt=re.div`
26
26
  display: flex;
27
27
  min-height: 100%;
28
28
  width: 100%;
@@ -30,4 +30,4 @@ import{j as k}from"./liveblocks-CW9yScMF.js";import{a as A}from"./sentry-C_uJQK1
30
30
  flex-direction: column;
31
31
  align-items: center;
32
32
  background-color: ${e=>e.theme.colors.grey4};
33
- `,me=Ee.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,Jt=te((function(e,t){const c=K(e),s=oe(e,t.scheduleTab);return{tenantName:c.companyName,scheduleDetailsView:s}}),(function(e,t){const{navigate:c,location:s,vendorSearchAutoCompleteData:l,selectedScheduledJournalEntries:n}=t,i=n.flatMap((a=>a.error)).filter((a=>!!a))??[];return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const a=de(t.location.state?.pathnameStackToGoBack);a.poppedPathname==null?c("../schedules/prepaid_expenses"):t.navigate(a.poppedPathname,{state:{pathnameStackToGoBack:a.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:a=>{e(_e(t.scheduleTab,a,i.length>0))},onDelete:a=>{e(je(t.scheduleTab,a))},onMarkAsComplete:()=>{t.selectedJEScheduleKey!=null&&e(be(t.scheduleTab,t.selectedJEScheduleKey))},onEditAmount:(a,d)=>{e(we(t.scheduleTab,a,d))},onJELinkClick:a=>{e(Je({selectedJELinkRowIndex:a})),c("./edit_link")},onTransactionClick:a=>{const d=`${M(a,t.tenantEmailDomain)}`,o=V(s.state?.pathnameStackToGoBack,s.pathname);c(d,{state:{pathnameStackToGoBack:o,message:"comingFromScheduleDetails"}})},onViewLinkedJE:a=>{const d=`${M(a,t.tenantEmailDomain)}`,o=V(s.state?.pathnameStackToGoBack,s.pathname);c(d,{state:{pathnameStackToGoBack:o}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(a,d)=>{a.trim().length>=2?e(ge({searchString:a,entityType:d,searchOrigin:"common"})):a.trim().length===0&&e(Y("common"))},onCancelAutoComplete:()=>{e(Y("common"))}},onDetailPageChange:(a,d)=>{const{scheduleDetailsSection:o,scheduleDetailsListSection:m}=a,{scheduleClass:I,scheduleExpenseCategory:p,months:C,startDate:g,postingDate:f,vendor:u}=o,r=l.entityAutoCompleteView.vendor.length>0?l.entityAutoCompleteView.vendor.find((x=>x.id===u?.selectedOption)):void 0,v={id:r?.zeniId??u?.selectedOption??"",name:r?.name??u?.defaultOptions.find((x=>x.value===u?.selectedOption))?.label??"",logo:r?.logo},D=I.selectedOption!=null?t.classList.find((x=>x.classId===I.selectedOption)):void 0,J=p.selectedOption!=null?t.accountList.find((x=>x.qboId===p.selectedOption)):void 0,B=C?.selectedOption,w=m.map(((x,_)=>({...t.scheduleLocalData.jeScheduleDetails[_],amount:{...t.scheduleLocalData.jeScheduleDetails[_].amount,amount:x.amount}}))),y=f.type==="day"?f.dayOfMonth?f.dayOfMonth:1:void 0,b=f.type==="lastDayOfMonth"||void 0,j={selectedAccount:J?.accountId,selectedClass:D?.classId,selectedDate:g,selectedMonths:B,jeScheduleDetails:w,lastDayOfMonth:b,selectedVendor:v,selectedDayOfMonth:y};e(Be({scheduleType:t.scheduleTab,localData:j,selectedJeScheduleDetailId:t.scheduleDetailId})),d!==!1||t.scheduleDetailId!=null&&t.status!=="draft"&&t.status!=="marked_as_completed"||J?.accountId==null||t.isAccountingClassesEnabled!==!1&&D?.classId==null||g==null||B==null||b!==!0&&y==null||e(Le({scheduleType:t.scheduleTab}))}}}))(pt),Wt=({isRenderedInPanel:e=!1,scheduleDetailIdOverride:t,scheduleTypeOverride:c,onPanelCloseAfterDecision:s,onPanelNavigateBack:l}={})=>{const n=Q(),i=ee(),a=H(),d=ke(),{tenantEmailDomain:o}=G(),[m,I]=A.useState(!1),p=i.state?.message==="expenseAutomation",{scheduleType:C,scheduleDetailId:g}=G(),f=t??g,u=wt(c??C,f),r=h((S=>S.scheduleDetailState.selectedJEScheduleKey));A.useEffect((()=>{r!=null&&r.length!==0||f!=="new"||n("../schedules/prepaid_expenses")}),[r,f]);const v=c??pe(C)??"prepaid_expenses",D=h((S=>oe(S,v))),J=h((S=>S.entityAutoCompleteState.autoCompleteText.common)),B=h((S=>De(S,"common"))),w=h((S=>fe(S))),y=h((S=>S.classListState.fetchState)),b=h((S=>ae(S))),j=h((S=>ce(S).selectedPeriod)),x=w!=="Completed"||y!=="Completed";A.useEffect((()=>{m===!1&&x?(a(Ae(v,R,!0)),I(!0)):x===!1&&m===!1&&(a(Ie(v,f==="new"?void 0:f,!0)),I(!0))}),[m]),A.useEffect((()=>{if(D.markAsCompleteStatus.fetchState==="Completed")if(a(xe()),p===!0){const{month:S,year:$}=j;n(`../../month_end_close_checks/review/je_schedules/${S}-${$}`)}else n("../schedules/prepaid_expenses")}),[D.markAsCompleteStatus.fetchState]);const _=h((S=>K(S))),P=h((S=>ne(S,_.companyId))),T=e||p,{onScheduleDecision:O,scheduleDecisionStatus:W}=ye({jeScheduleId:D.selectedJEScheduleTransaction?.jeScheduleId,scheduleKey:D.selectedJEScheduleTransaction?.jeScheduleTransactionKey,scheduleType:v,onDecided:()=>{if(s==null)if(p!==!0)n("../schedules/prepaid_expenses");else{const{month:S,year:$}=j;n(`../../month_end_close_checks/review/je_schedules/${S}-${$}`)}else s()}}),U=D.fetchState,z=D.allAccountList,q=D.allClassList,F=D.scheduleDetailsLocalData;let R;if(f!=="new"&&(R=f),u!==!0||D.fetchState==="Error")return k.jsx(X,{});const Z=U==="Completed"&&m===!0,E=D.selectedJEScheduleTransaction!=null;return U==="Completed"||e===!0&&E?k.jsxs(Lt,{children:[Z===!0?k.jsx(ue,{analytics:N,onLoad:()=>{jt(D,v,P)}}):null,k.jsx(Jt,{onScheduleDecision:T?O:void 0,scheduleDecisionStatus:W,isRenderedInPanel:e,onPanelNavigateBack:l,location:i,vendorSearchEntityAutoCompleteView:B,vendorSearchAutoCompleteData:{autoCompleteText:J,entityAutoCompleteView:B},usedInExpenseAutomation:p,removeJeScheduleTransactionKey:(S,$)=>{a(Te(S,$))},expenseAutomationSelectedPeriod:j,navigate:n,classList:q,accountList:z,scheduleLocalData:F[v],selectedJEScheduleKey:r,scheduleDetailId:R,selectedScheduledJournalEntries:D.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:d,tenantEmailDomain:o,scheduleTab:v,analytics:N,controllerUserDetails:P,isAccountingClassesEnabled:b,status:D.selectedJEScheduleTransaction?.status.code})]}):k.jsx(ie,{})},wt=(e,t)=>pe(e)!=null&&t!=null,bt=e=>({transactionDate:e.date.format(me),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),jt=(e,t,c)=>{const s=e.selectedJEScheduleTransaction?.baseTransaction,l=e.selectedJEScheduleTransaction,n=se(c.controllers),i=le(c.controllerUserIds);var a;s!=null&&l!=null&&N.trackScheduleDetailsLoaded({scheduleType:t,transaction:{...bt(s)},scheduleExpenseCategoryAndClass:{expenseCategory:l.jeDebit.account?.accountName??null,expenseClass:l.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(a=l,{currentBalance:a.balanceAsOfToday??null,currentStatus:a.status.label,period:a.period??null,startMonth:a.startDate?.format(me)??null,endMonth:a.endDate?.format(me)??null})},vendorName:l.vendor.name??null,controllerEmails:n,controllerUserIds:i})};export{$t as J,Yt as S,Ut as a,Wt as b,Kt as c};
33
+ `,me=Ee.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,Lt=te((function(e,t){const c=K(e),s=oe(e,t.scheduleTab);return{tenantName:c.companyName,scheduleDetailsView:s}}),(function(e,t){const{navigate:c,location:s,vendorSearchAutoCompleteData:l,selectedScheduledJournalEntries:n}=t,i=n.flatMap((a=>a.error)).filter((a=>!!a))??[];return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const a=de(t.location.state?.pathnameStackToGoBack);a.poppedPathname==null?c("../schedules/prepaid_expenses"):t.navigate(a.poppedPathname,{state:{pathnameStackToGoBack:a.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:a=>{e(_e(t.scheduleTab,a,i.length>0))},onDelete:a=>{e(je(t.scheduleTab,a))},onMarkAsComplete:()=>{t.selectedJEScheduleKey!=null&&e(we(t.scheduleTab,t.selectedJEScheduleKey))},onEditAmount:(a,d)=>{e(Je(t.scheduleTab,a,d))},onJELinkClick:a=>{e(Le({selectedJELinkRowIndex:a})),c("./edit_link")},onTransactionClick:a=>{const d=`${M(a,t.tenantEmailDomain)}`,o=V(s.state?.pathnameStackToGoBack,s.pathname);c(d,{state:{pathnameStackToGoBack:o,message:"comingFromScheduleDetails"}})},onViewLinkedJE:a=>{const d=`${M(a,t.tenantEmailDomain)}`,o=V(s.state?.pathnameStackToGoBack,s.pathname);c(d,{state:{pathnameStackToGoBack:o}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(a,d)=>{a.trim().length>=2?e(ge({searchString:a,entityType:d,searchOrigin:"common"})):a.trim().length===0&&e(Y("common"))},onCancelAutoComplete:()=>{e(Y("common"))}},onDetailPageChange:(a,d)=>{const{scheduleDetailsSection:o,scheduleDetailsListSection:m}=a,{scheduleClass:I,scheduleExpenseCategory:p,months:C,startDate:g,postingDate:f,vendor:u}=o,r=l.entityAutoCompleteView.vendor.length>0?l.entityAutoCompleteView.vendor.find((x=>x.id===u?.selectedOption)):void 0,v={id:r?.zeniId??u?.selectedOption??"",name:r?.name??u?.defaultOptions.find((x=>x.value===u?.selectedOption))?.label??"",logo:r?.logo},D=I.selectedOption!=null?t.classList.find((x=>x.classId===I.selectedOption)):void 0,L=p.selectedOption!=null?t.accountList.find((x=>x.qboId===p.selectedOption)):void 0,B=C?.selectedOption,J=m.map(((x,_)=>({...t.scheduleLocalData.jeScheduleDetails[_],amount:{...t.scheduleLocalData.jeScheduleDetails[_].amount,amount:x.amount}}))),y=f.type==="day"?f.dayOfMonth?f.dayOfMonth:1:void 0,w=f.type==="lastDayOfMonth"||void 0,j={selectedAccount:L?.accountId,selectedClass:D?.classId,selectedDate:g,selectedMonths:B,jeScheduleDetails:J,lastDayOfMonth:w,selectedVendor:v,selectedDayOfMonth:y};e(Be({scheduleType:t.scheduleTab,localData:j,selectedJeScheduleDetailId:t.scheduleDetailId})),d!==!1||t.scheduleDetailId!=null&&t.status!=="draft"&&t.status!=="marked_as_completed"||L?.accountId==null||t.isAccountingClassesEnabled!==!1&&D?.classId==null||g==null||B==null||w!==!0&&y==null||e(be({scheduleType:t.scheduleTab}))}}}))(pt),Wt=({isRenderedInPanel:e=!1,scheduleDetailIdOverride:t,scheduleTypeOverride:c,onPanelCloseAfterDecision:s,onPanelNavigateBack:l}={})=>{const n=Q(),i=ee(),a=H(),d=ke(),{tenantEmailDomain:o}=G(),[m,I]=A.useState(!1),p=i.state?.message==="expenseAutomation",{scheduleType:C,scheduleDetailId:g}=G(),f=t??g,u=Jt(c??C,f),r=h((S=>S.scheduleDetailState.selectedJEScheduleKey));A.useEffect((()=>{r!=null&&r.length!==0||f!=="new"||n("../schedules/prepaid_expenses")}),[r,f]);const v=c??pe(C)??"prepaid_expenses",D=h((S=>oe(S,v))),L=h((S=>S.entityAutoCompleteState.autoCompleteText.common)),B=h((S=>De(S,"common"))),J=h((S=>fe(S))),y=h((S=>S.classListState.fetchState)),w=h((S=>ae(S))),j=h((S=>ce(S).selectedPeriod)),x=J!=="Completed"||y!=="Completed";A.useEffect((()=>{m===!1&&x?(a(Ae(v,R,!0)),I(!0)):x===!1&&m===!1&&(a(Ie(v,f==="new"?void 0:f,!0)),I(!0))}),[m]),A.useEffect((()=>{if(D.markAsCompleteStatus.fetchState==="Completed")if(a(xe()),p===!0){const{month:S,year:$}=j;n(`../../month_end_close_checks/review/je_schedules/${S}-${$}`)}else n("../schedules/prepaid_expenses")}),[D.markAsCompleteStatus.fetchState]);const _=h((S=>K(S))),P=h((S=>ne(S,_.companyId))),T=e||p,{onScheduleDecision:O,scheduleDecisionStatus:W}=ye({jeScheduleId:D.selectedJEScheduleTransaction?.jeScheduleId,scheduleKey:D.selectedJEScheduleTransaction?.jeScheduleTransactionKey,scheduleType:v,onDecided:()=>{if(s==null)if(p!==!0)n("../schedules/prepaid_expenses");else{const{month:S,year:$}=j;n(`../../month_end_close_checks/review/je_schedules/${S}-${$}`)}else s()}}),U=D.fetchState,z=D.allAccountList,q=D.allClassList,F=D.scheduleDetailsLocalData;let R;if(f!=="new"&&(R=f),u!==!0||D.fetchState==="Error")return k.jsx(X,{});const Z=U==="Completed"&&m===!0,E=D.selectedJEScheduleTransaction!=null;return U==="Completed"||e===!0&&E?k.jsxs(bt,{children:[Z===!0?k.jsx(ue,{analytics:N,onLoad:()=>{jt(D,v,P)}}):null,k.jsx(Lt,{onScheduleDecision:T?O:void 0,scheduleDecisionStatus:W,isRenderedInPanel:e,onPanelNavigateBack:l,location:i,vendorSearchEntityAutoCompleteView:B,vendorSearchAutoCompleteData:{autoCompleteText:L,entityAutoCompleteView:B},usedInExpenseAutomation:p,removeJeScheduleTransactionKey:(S,$)=>{a(Te(S,$))},expenseAutomationSelectedPeriod:j,navigate:n,classList:q,accountList:z,scheduleLocalData:F[v],selectedJEScheduleKey:r,scheduleDetailId:R,selectedScheduledJournalEntries:D.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:d,tenantEmailDomain:o,scheduleTab:v,analytics:N,controllerUserDetails:P,isAccountingClassesEnabled:w,status:D.selectedJEScheduleTransaction?.status.code})]}):k.jsx(ie,{})},Jt=(e,t)=>pe(e)!=null&&t!=null,wt=e=>({transactionDate:e.date.format(me),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),jt=(e,t,c)=>{const s=e.selectedJEScheduleTransaction?.baseTransaction,l=e.selectedJEScheduleTransaction,n=se(c.controllers),i=le(c.controllerUserIds);var a;s!=null&&l!=null&&N.trackScheduleDetailsLoaded({scheduleType:t,transaction:{...wt(s)},scheduleExpenseCategoryAndClass:{expenseCategory:l.jeDebit.account?.accountName??null,expenseClass:l.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(a=l,{currentBalance:a.balanceAsOfToday??null,currentStatus:a.status.label,period:a.period??null,startMonth:a.startDate?.format(me)??null,endMonth:a.endDate?.format(me)??null})},vendorName:l.vendor.name??null,controllerEmails:n,controllerUserIds:i})};export{$t as J,Yt as S,Ut as a,Wt as b,Kt as c};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/NotFoundScreen-BScz3VcE.js","assets/sentry-C_uJQK1a.js","assets/core-BI5oX4mx.js","assets/zeni-epic-state-CIizsNeB.js","assets/index-mRsR5jtB.js","assets/mui-KP5Ep0NX.js","assets/analytics-5LJ4BXQX.js","assets/utils-BzQpFQvw.js","assets/index-BhC2LNQw.css","assets/DashboardRoutes-U29blEjz.js","assets/withTransactionSidePanel-BaeEJKqt.js","assets/useAskAiCfoHostNavButtonProps-qLwQUrxF.js","assets/TransactionDetailScreen-uFx1hV5M.js","assets/decodeURIComponentSafe-B7oIXSPO.js","assets/useInitialThreadRequest-BbYhZx86.js","assets/routePaths-Ch3GR24x.js","assets/expenseAutomationHelper-CqPrLTRM.js","assets/stripSplatSuffix-CSXpdRK5.js","assets/analyticsHelper-yBGPOCZK.js","assets/CompanyPassportScreen-CZ0CexZb.js","assets/MobileAppDrawer-DbFom2zh.js","assets/InboxNotificationsProvider-CMirleoY.js","assets/useTaskManagerAccess-BMDBcsNO.js","assets/useAiCfoDashboardSuggestedQuestionsChips-DUvHQuQx.js","assets/FeaturePreviewScreen-t00mgiPb.js","assets/BillPayRoutes-B6UGTljV.js","assets/AddressScreen-DOHRJgNm.js","assets/DomesticWireDetailScreen-CYJRxpzs.js","assets/BusinessVerificationPageScreen-DrH4Xh9l.js","assets/DrawerScreen-C0RPM-YO.js","assets/SetupPagesScreen-CysLzuEg.js","assets/BillPayApprovalRoutes-ZvXWZ4qY.js","assets/ReimbursementApprovalRuleDetailScreen-Cp2buMpa.js","assets/getLocaleForTenant-BbLwvfGn.js","assets/ReimbursementRoutes-CLUfJEzf.js","assets/ReimbursementApprovalRoutes-BputYX4N.js","assets/TransactionListRoutes-2lehJ6Xh.js","assets/ZeniAccountStatementScreen-ibYC20mc.js","assets/SettingsRoutes-D-pfv1Ev.js","assets/AccountMappingScreen-wN76eX8x.js","assets/QBOConnectionScreen-NNh_c5sH.js","assets/empty-D1y42ZwI.js","assets/index-BT5wSX8Z.js","assets/url-0wqXxJRo.js","assets/index-Cf-PV9pR.js","assets/accountMappingHelper-B5wpHG39.js","assets/useEmailConnectResultRefresh-C0MkzUvF.js","assets/ReportsRoutes-BRWTnngq.js","assets/ChargeCardRoutes-5JojYZ7y.js","assets/useChargeCardPusherEvents-BMgEvn3W.js","assets/PeopleRoutes-BRGNn5z0.js","assets/ExpenseAutomationRoutes-CZEx-mPd.js","assets/useActualMatchingMatchDetail-D-xkseKQ.js","assets/ScheduleDetailsPrepaidExpensesScreen-VG_9abqY.js","assets/pathToGoBack-Ddmf68xx.js","assets/TreasuryRoutes-CZmm7Kla.js","assets/VendorsRoutes-DTnVN004.js","assets/ZeniAccountRoutes-C_vaL98S.js","assets/AddressRoutes-Bx3-O7R0.js","assets/PandLWithForecastRoutes-B_NSnbx3.js","assets/CustomerOnboardingRoutes-3PDTOTim.js","assets/TransactionDetailRoutes-Cqr24PBj.js","assets/EntityDetailRoutes-B6kEwNqt.js","assets/InvoicingRoutes-CEbeWuJ_.js","assets/NotificationRoutes-Btu3I9BW.js","assets/PerformanceRoutes-BssWGUh3.js","assets/ActualMatchingMatchDetailScreen-DesQndtQ.js","assets/RewardsRoutes-R7jP_3At.js","assets/TaskRoutes-BEeYmQIS.js","assets/TaskListScreen-zIhpHyB0.js","assets/AiCfoScreen-Dz9VmjDJ.js","assets/CardsAiCfoScreen-DR0WQjnK.js"])))=>i.map(i=>d[i]);
2
- import{_ as s,bn as Es,fF as hs,d_ as ps,dZ as xs,AV as gs,di as Rs,c8 as js,gJ as Is,g9 as Ts,df as pe,cG as As,gn as fs,cy as Ds,bE as bs,br as ys,U0 as Cs,v as vs,U3 as Us,bq as Os,U4 as Ps,bK as ws,bJ as Fs,bt as Ls,cu as ks,U5 as Vs,U6 as Hs,da as Ss,dd as Bs,dc as Ns,cF as Ms,cM as Zs,pS as xe,gi as ge,gY as Gs,gk as Re,gL as je,gM as Ie,gl as $s}from"./zeni-epic-state-CIizsNeB.js";import{j as e}from"./liveblocks-CW9yScMF.js";import{a as P}from"./sentry-C_uJQK1a.js";import{N as u,u as zs,h as qs,i as Ys,g as Js,j as G,q as Te,n as Ws,o as n}from"./core-BI5oX4mx.js";import{J as l,c as Ks,u as Qs,z as y,N as Xs,f as et,q as st,d as B,h as tt,K as nt,U as at,L as F,G as Ae,t as _,P as ot,M as rt,k as ne}from"./index-mRsR5jtB.js";import"./mui-KP5Ep0NX.js";import{f as fe}from"./analyticsHelper-yBGPOCZK.js";import{t as it}from"./getLocaleForTenant-BbLwvfGn.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},D=new o.Error().stack;D&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[D]="16de2249-490c-4ff6-b486-e10cf92f1676",o._sentryDebugIdIdentifier="sentry-dbid-16de2249-490c-4ff6-b486-e10cf92f1676")}catch{}})();const lt=l((()=>s((()=>import("./NotFoundScreen-BScz3VcE.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),ut=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/reimbursements`}),dt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/bills`}),De=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/treasury`}),be=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/checking`}),ye=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/cards`}),C=({showZeniAccountRoute:o,isUserHasBillPayAccess:D,isUserHasReimbursementAccess:N,showTreasuryRoute:i,isTenantBankingOnly:k,showChargeCardRoute:U,tenantEmailDomain:v})=>{if(k===!0){if(o)return e.jsx(be,{tenantEmailDomain:v});if(i)return e.jsx(De,{tenantEmailDomain:v});if(U)return e.jsx(ye,{tenantEmailDomain:v})}return o?e.jsx(be,{tenantEmailDomain:v}):i?e.jsx(De,{tenantEmailDomain:v}):U?e.jsx(ye,{tenantEmailDomain:v}):D?e.jsx(dt,{tenantEmailDomain:v}):N?e.jsx(ut,{tenantEmailDomain:v}):e.jsx(lt,{})},ct={dashboard:()=>s((()=>import("./DashboardRoutes-U29blEjz.js")),__vite__mapDeps([9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,0,18,19,20,21,22,23,24,8])),bills:()=>s((()=>import("./BillPayRoutes-B6UGTljV.js")),__vite__mapDeps([25,1,2,3,4,5,6,7,26,0,27,11,14,28,15,20,21,22,29,24,30,18,31,32,33,8])),reimbursement:()=>s((()=>import("./ReimbursementRoutes-CLUfJEzf.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,11,14,29,35,32,33,8])),transactions:()=>s((()=>import("./TransactionListRoutes-2lehJ6Xh.js")),__vite__mapDeps([36,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,37,8])),settings:()=>s((()=>import("./SettingsRoutes-D-pfv1Ev.js")),__vite__mapDeps([38,1,2,3,4,5,6,7,22,39,20,21,40,41,42,43,44,13,45,26,0,18,28,15,19,46,31,32,35,8])),reports:()=>s((()=>import("./ReportsRoutes-BRWTnngq.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,0,24,14,15,20,21,22,8])),chargeCards:()=>s((()=>import("./ChargeCardRoutes-5JojYZ7y.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,11,20,21,22,30,28,15,0,18,14,49,26,8])),people:()=>s((()=>import("./PeopleRoutes-BRGNn5z0.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,0,11,20,21,22,8])),expenseAutomation:()=>s((()=>import("./ExpenseAutomationRoutes-CZEx-mPd.js")),__vite__mapDeps([51,1,2,3,0,4,5,6,7,11,12,13,14,15,16,52,17,10,53,54,45,29,8])),treasury:()=>s((()=>import("./TreasuryRoutes-CZmm7Kla.js")),__vite__mapDeps([55,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,11,14,24,8])),vendors:()=>s((()=>import("./VendorsRoutes-DTnVN004.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,26,0,24,53,54,15,11,20,21,22,29,45,8])),zeniAccounts:()=>s((()=>import("./ZeniAccountRoutes-C_vaL98S.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,27,26,11,37,8]))},mt=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ae=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},_t=l((()=>s((()=>import("./ReportsRoutes-BRWTnngq.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,0,24,14,15,20,21,22,8])))),Et=l((()=>s((()=>import("./AddressRoutes-Bx3-O7R0.js")),__vite__mapDeps([58,1,2,3,26,4,5,6,7,0,8])))),ht=l((()=>s((()=>import("./PeopleRoutes-BRGNn5z0.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,0,11,20,21,22,8])))),pt=l((()=>s((()=>import("./PandLWithForecastRoutes-B_NSnbx3.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,0,24,11,14,15,20,21,22,8])))),xt=l((()=>s((()=>import("./CustomerOnboardingRoutes-3PDTOTim.js")),__vite__mapDeps([60,1,2,3,26,4,5,6,7,0,40,41,42,43,44,13,46,49,8])))),gt=l((()=>s((()=>import("./VendorsRoutes-DTnVN004.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,26,0,24,53,54,15,11,20,21,22,29,45,8])))),Rt=l((()=>s((()=>import("./TransactionDetailRoutes-Cqr24PBj.js")),__vite__mapDeps([61,1,2,3,0,4,5,6,7,12,11,13,14,15,16,8])))),Ce=l((()=>s((()=>import("./EntityDetailRoutes-B6kEwNqt.js")),__vite__mapDeps([62,1,2,3,4,5,6,7,13,10,11,12,14,15,16,17,8])))),jt=l((()=>s((()=>import("./DashboardRoutes-U29blEjz.js")),__vite__mapDeps([9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,0,18,19,20,21,22,23,24,8])))),ve=l((()=>s((()=>import("./BillPayRoutes-B6UGTljV.js")),__vite__mapDeps([25,1,2,3,4,5,6,7,26,0,27,11,14,28,15,20,21,22,29,24,30,18,31,32,33,8])))),It=l((()=>s((()=>import("./SettingsRoutes-D-pfv1Ev.js")),__vite__mapDeps([38,1,2,3,4,5,6,7,22,39,20,21,40,41,42,43,44,13,45,26,0,18,28,15,19,46,31,32,35,8])))),Tt=l((()=>s((()=>import("./InvoicingRoutes-CEbeWuJ_.js")),__vite__mapDeps([63,1,2,3,4,5,6,7,26,0,20,21,22,40,41,42,43,44,13,8])))),Ue=l((()=>s((()=>import("./ReimbursementRoutes-CLUfJEzf.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,11,14,29,35,32,33,8])))),At=l((()=>s((()=>import("./ZeniAccountRoutes-C_vaL98S.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,27,26,11,37,8])))),ft=l((()=>s((()=>import("./TreasuryRoutes-CZmm7Kla.js")),__vite__mapDeps([55,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,11,14,24,8])))),Dt=l((()=>s((()=>import("./TransactionListRoutes-2lehJ6Xh.js")),__vite__mapDeps([36,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,37,8])))),bt=l((()=>s((()=>import("./ChargeCardRoutes-5JojYZ7y.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,11,20,21,22,30,28,15,0,18,14,49,26,8])))),yt=l((()=>s((()=>import("./NotificationRoutes-Btu3I9BW.js")),__vite__mapDeps([64,1,2,3,0,4,5,6,7,11,22,8])))),Ct=l((()=>s((()=>import("./PerformanceRoutes-BssWGUh3.js")),__vite__mapDeps([65,1,2,3,0,4,5,6,7,11,20,21,22,8])))),vt=l((()=>s((()=>import("./ExpenseAutomationRoutes-CZEx-mPd.js")),__vite__mapDeps([51,1,2,3,0,4,5,6,7,11,12,13,14,15,16,52,17,10,53,54,45,29,8])))),Ut=l((()=>s((()=>import("./ActualMatchingMatchDetailScreen-DesQndtQ.js")),__vite__mapDeps([66,1,2,3,4,5,6,7,52,17,13,15,0,8])))),Ot=l((()=>s((()=>import("./RewardsRoutes-R7jP_3At.js")),__vite__mapDeps([67,1,2,3,4,5,6,7,0,8])))),Pt=l((()=>s((()=>import("./TaskRoutes-BEeYmQIS.js")),__vite__mapDeps([68,1,2,3,0,4,5,6,7,14,20,21,22,69,11,8])))),wt=l((()=>s((()=>import("./AiCfoScreen-Dz9VmjDJ.js")),__vite__mapDeps([70,1,2,3,4,5,6,7,23,54,15,8])))),Oe=l((()=>s((()=>import("./CardsAiCfoScreen-DR0WQjnK.js")),__vite__mapDeps([71,1,2,3,4,5,6,7,8])))),f=l((()=>s((()=>import("./NotFoundScreen-BScz3VcE.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),Ft=l((()=>s((()=>import("./TaskListScreen-zIhpHyB0.js").then((o=>o.f))),__vite__mapDeps([69,1,2,3,4,5,6,7,11,20,21,22,8])))),Lt=({isDashboardAccess:o,showZeniAccountRoute:D,isUserHasBillPayAccess:N,isUserHasReimbursementAccess:i,showTreasuryRoute:k,isTenantBankingOnly:U,isTenantCardsOnly:v,showChargeCardRoute:V})=>{if(U===!0){if(D)return e.jsx(u,{to:"checking"});if(k)return e.jsx(u,{to:"treasury"});if(V)return e.jsx(u,{to:"cards"})}return v===!0&&V?e.jsx(u,{to:"cards"}):o?e.jsx(u,{to:"dashboard"}):D?e.jsx(u,{to:"checking"}):k?e.jsx(u,{to:"treasury"}):V?e.jsx(u,{to:"cards"}):N?e.jsx(u,{to:"bills"}):i?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},Pe=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/dashboard`}),Gt=Object.freeze(Object.defineProperty({__proto__:null,default:function({setTenantEmailDomain:o}){const D=zs(),N=qs(),{tenantEmailDomain:i}=Ys(),k=Ks().mode,{setLoading:U,clearAllLoading:v,clearLoading:V}=Qs(),b=y.getSignedInUserTenant(i)?.tenantId,I=y.getSignedInUser(),W=Es(I),$=Js(),[L,we]=P.useState(!1),r=G((a=>hs(a))),{useFeatureGate:H}=Xs(),M=et(),K=st(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:ke}=H(B.isChargeCardFeatureEnabled),{isFeatureEnabled:oe}=H(B.isDebitCardFeatureEnabled),T=G((a=>a.tenantState.fetchState)),p=G((a=>a.tenantState.activeTenantFetchState.fetchState)),E=p==="Completed"||T==="Completed"?ps(oe,r):void 0,Q=p==="Completed"||T==="Completed"?xs(r):void 0,re=p==="Completed"||T==="Completed"?gs(r)&&!Rs(r):void 0,Ve=tt(r,ke,oe),{isCardsHidden:He}=nt(r?.tenantId),Se=!Ve||!!He,{isFeatureEnabled:Be}=H(B.isSettingsFeatureEnabled),{isFeatureEnabled:X}=H(B.isAiCfoFileUploadEnabled),{isFeatureEnabled:Ne}=H(B.isInvoicingFeatureEnabled??"is_invoicing_feature_enabled"),Me=Ne||rt==="DEV",Ze=r?.userRole!=null&&js(r.userRole),z=G((a=>Is(a)));if(i!=null){const a=y.getSignedInUserTenant(i);I!=null&&a!=null&&fe(I,r,k)}const Z={tenantId:b,userId:I?.userId,sessionId:I?.zeniSessionId},ie=Ts(),h=at(),Ge=r.company==null||h?.loggedInUserRoleMap!=null&&pe(h.loggedInUserRole),$e=As(h?.loggedInUserRoleMap),ee=Te("/:tenantEmailDomain/onboarding/*")!==null,ze=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),se=ze?.params.selectedPeriod,qe=G((a=>Z.tenantId!=null?fs(a,Z.tenantId):void 0));P.useEffect((()=>{U(F.TENANT_FETCHING),o(i)}),[i]),P.useEffect((()=>{if(se!=null&&b!=null){const a=se.split("-");if(a.length===2){const A=Ds(Number(a[0])),c=Number(a[1]),t=bs(`01-${A<10?`0${A}`:A}-${c}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),d=ys();t.isAfter(d,"month")===!1?D(Cs(b,{month:A,year:c})):N(`/${i}/month_end_close_checks/review`)}}}),[se,i,b]),P.useEffect((()=>{L||(we(!0),U(F.TENANT_FETCHING))}),[L,Z,ie,I,D,y]),P.useLayoutEffect((()=>{!vs(ie,Z)&&y.isSignedIn()&&(U(F.TENANT_FETCHING),(function(a,A,c,t){if(ge(A?.userId,A?.zeniSessionId,a.tenantId),c(Gs(!0)),c(Re(a.tenantId)),a.tenantId!=null&&_.clearTenant(a.tenantId),a.tenantId!=null){const d=y.getSignedInUserTenantWithId(a.tenantId);t&&Ae.updateAppLocaleID(it(t)),d?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(d?.tenantEmailDomain)}a.userId!=null?ne.identify(a.userId,{tenant_id:a.tenantId}):ne.resetUserIdentity()})(Z,I,D,qe))}),[b]),P.useEffect((()=>{y.isSignedIn()&&(U(F.TENANT_FETCHING),(function(a,A,c,t,d,q,S){if(c==null&&t==null)return void console.warn("There is no current tenant selected!!");const Y=t!=null&&d?.zeniSessionId!=null,cs=c==null||c.tenantId!==t,ms=c!=null&&c.excludedResources==null,_s=c!=null&&c.externalConnections==null;if(Y&&cs){S(Re(t));const J=y.getSignedInUserTenantWithId(t);J?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(J?.tenantEmailDomain),ge(d?.userId,d?.zeniSessionId,t),_.shouldFetchExcludedResources(t)&&(_.markExcludedResourcesFetchStarted(t),S(je(d.userId,t))),_.shouldFetchConnections(t)&&(_.markConnectionsFetchStarted(t),S(Ie(d.userId,t)))}else Y&&ms&&_.shouldFetchExcludedResources(t)&&(_.markExcludedResourcesFetchStarted(t),S(je(d.userId,t))),Y&&_s&&_.shouldFetchConnections(t)&&(_.markConnectionsFetchStarted(t),S(Ie(d.userId,t)));if(Y){ne.identify(d.userId,{tenant_id:t});const J=t==null||t!=null&&(A==="Completed"||A==="Error");a==="Completed"||A!=="Not-Started"&&A!=="Error"||t==null||!_.shouldFetchActiveTenant(t)||(_.markActiveTenantFetchStarted(t),q(F.TENANT_FETCHING),S($s(d.userId,t,d.zeniSessionId))),J&&(a==="Not-Started"||a==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),S(xe(d.userId,d.zeniSessionId)))}})(T,p,r,b,I,U,D))}),[b,p]),P.useEffect((()=>{y.isSignedIn()&&T==="Completed"&&z.tenantsBaseInOrder.length>0&&(V(F.TENANT_FETCHING),y.saveSignedInUserTenants(Us(z.tenantsBaseInOrder)),I!=null&&fe(I,r,k,void 0,z.tenantsBaseInOrder))}),[z,T,r,I]),P.useEffect((()=>{p==="In-Progress"&&U(F.TENANT_FETCHING),p!=="Completed"&&p!=="Error"||(p==="Completed"&&b!=null?(v(),_.markActiveTenantFetchCompleted(b)):p==="Error"&&b!=null&&(_.markActiveTenantFetchFailed(b),V(F.TENANT_FETCHING),V(F.TENANT_SWITCHING))),T!=="Completed"&&T!=="Error"||(T==="Completed"?_.markAllTenantsFetchCompleted():T==="Error"&&_.markAllTenantsFetchFailed())}),[p,T,b,L]);const le=P.useRef(!1);P.useEffect((()=>{!le.current&&p==="Completed"&&L&&(le.current=!0,(function(a=mt,A=3e3){setTimeout((()=>{const c=t=>{if(t>=a.length)return;const d=a[t],q=ct[d];q!=null?q().then((()=>ae((()=>c(t+1))))).catch((()=>ae((()=>c(t+1))))):c(t+1)};ae((()=>c(0)))}),A)})())}),[p,L]);const O=r?.userRole!=null&&Os(r?.userRole),{isFeatureEnabled:Ye}=H(B.isReferralFeatureEnabled),{isFeatureEnabled:Je}=H(B.isAccrualEnabled),We=r?.userRole!=null&&r.userRole.includes("charge_card_user"),Ke=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),w=r?.userRole!=null&&pe(r.userRole),ue=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!O,de=!Se&&!O,Qe=Ps(h?.loggedInUserRoleMap),Xe=r.externalConnections?.accounting[0]?.isValid,es=r.externalConnections?.fetchState==="Completed",te=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!O,me=ce&&ws(h?.loggedInUserRoleMap),_e=Fe&&!O,ss=Le&&!O,ts=ue&&Fs(h?.loggedInUserRoleMap),ns=de&&Ls(h?.loggedInUserRoleMap),as=_e&&ks(h?.loggedInUserRoleMap),os=Vs(h?.loggedInUserRoleMap),rs=Hs(h?.loggedInUserRoleMap),is=Ss(h?.loggedInUserRoleMap),ls=Bs(h?.loggedInUserRoleMap),us=Ns(h?.loggedInUserRoleMap),x=Ms(h?.loggedInUserRoleMap),g=Zs(h?.loggedInUserRoleMap),Ee=ue&&x,he=ce&&g,R=_e&&is,j=ss&&ls,m=de&&us,ds=r.excludedResources?.resources?.find((a=>a.resource==="/invites"))!=null||$e===!0||Qe===!0||os===!0||rs===!0;return y.isSignedIn()?b==null?T==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(I!=null&&T!=="In-Progress"&&D(xe(I.userId,I.zeniSessionId)),null):p!=="In-Progress"&&p!=="Not-Started"||T==="Completed"?(te===!0||W&&!ee)&&es&&Xe!==!0&&E===!1&&Q===!1&&re===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!L||re!==!0||te!==!0||ee||W?!L||te!==!1||ee||W?L&&r?.userRole&&E!=null&&Q!=null&&i!=null&&Object.keys(h.loggedInUserRoleMap).length>0?e.jsx(Ws,{children:e.jsxs(n,{element:e.jsx(ot,{}),children:[e.jsx(n,{path:"/",element:e.jsx(Lt,{isDashboardAccess:w,showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,isTenantCardsOnly:Q,showChargeCardRoute:m})}),e.jsx(n,{path:"dashboard/*",element:w?e.jsx(jt,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reports/*",element:w?e.jsx(_t,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"people/*",element:ds||w?e.jsx(ht,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"forecast/*",element:w?e.jsx(pt,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"onboarding/*",element:e.jsx(xt,{})}),e.jsx(n,{path:"transaction/*",element:w&&O===!1||We||Ke?e.jsx(Rt,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"transactions/*",element:w&&O===!1?e.jsx(Dt,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"customer/*",element:w&&O===!1?e.jsx(Ce,{entityType:"customer"}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,isTenantBankingOnly:E,showTreasuryRoute:j,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"vendor/*",element:w&&O===!1?e.jsx(Ce,{entityType:"vendor"}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"tasks",element:e.jsx(Ft,{})}),e.jsx(n,{path:"tasks/*",element:e.jsx(Pt,{})}),e.jsx(n,{path:"address/*",element:ts||me||as||ns?e.jsx(Et,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"checking/*",element:R?e.jsx(At,{}):e.jsx(f,{})}),e.jsx(n,{path:"treasury/*",element:j?e.jsx(ft,{}):e.jsx(f,{})}),e.jsx(n,{path:"performance",element:K===!0?e.jsx(Ct,{}):e.jsx(Pe,{tenantEmailDomain:i})}),e.jsx(n,{path:"month_end_close_checks/review/*",element:K===!0&&O===!1?e.jsx(vt,{}):e.jsx(Pe,{tenantEmailDomain:i})}),e.jsx(n,{path:"expense-automation/actual-matching/:matchId",element:K===!0&&O===!1&&Je===!0?e.jsx(Ut,{}):e.jsx(f,{})}),e.jsx(n,{path:"notifications/*",element:e.jsx(yt,{})}),e.jsx(n,{path:"vendors/*",element:Ge?e.jsx(gt,{}):e.jsx(f,{})}),e.jsx(n,{path:"bill/*",element:Ee?e.jsx(ve,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"bills/*",element:Ee?e.jsx(ve,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reimbursement/*",element:he?e.jsx(Ue,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reimbursements/*",element:he?e.jsx(Ue,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"settings/*",element:Be?e.jsx(It,{hasAdminLevelAccess:me}):e.jsx(f,{})}),e.jsx(n,{path:"invoicing/*",element:Me&&Ze?e.jsx(Tt,{}):e.jsx(f,{})}),e.jsx(n,{path:"cards/ask",element:m&&M?e.jsx(Oe,{isFileUploadEnabled:X}):e.jsx(f,{})}),e.jsx(n,{path:"cards/ask/:session_id",element:m&&M?e.jsx(Oe,{isFileUploadEnabled:X}):e.jsx(f,{})}),e.jsx(n,{path:"cards/*",element:m?e.jsx(bt,{}):e.jsx(f,{})}),e.jsx(n,{path:"rewards/*",element:Ye?e.jsx(Ot,{}):e.jsx(f,{})}),e.jsx(n,{path:"/ai-cfo",element:M?e.jsx(u,{to:"explore"}):e.jsx(f,{})}),e.jsx(n,{path:"/ai-cfo/",element:M?e.jsx(u,{to:"explore"}):e.jsx(f,{})}),e.jsx(n,{path:"/ai-cfo/:session_id",element:M?e.jsx(wt,{isFileUploadEnabled:X}):e.jsx(f,{})}),e.jsx(n,{path:"*",element:e.jsx(f,{})})]})}):null:(o(void 0),e.jsx(u,{to:`/${i}/onboarding`,replace:!0})):(o(void 0),e.jsx(u,{to:`/${i}/onboarding/thankyou`,replace:!0})):null:(console.warn("User logged out!!"),o(void 0),e.jsx(u,{to:"/signin/auth",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}))}},Symbol.toStringTag,{value:"Module"}));export{C as F,Gt as S};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/NotFoundScreen-r2t5kGnd.js","assets/sentry-CxSdF_rC.js","assets/core-D6EV-11Y.js","assets/zeni-epic-state-CZbm731W.js","assets/index-lv0eG9-7.js","assets/mui-qouWiIWk.js","assets/analytics-wktvfErl.js","assets/utils-D8aAQJhF.js","assets/index-BhC2LNQw.css","assets/DashboardRoutes-C3Q7vlXr.js","assets/withTransactionSidePanel-BY_v_z2c.js","assets/useAskAiCfoHostNavButtonProps-Cgk5vvuH.js","assets/TransactionDetailScreen-Cyr21RUS.js","assets/decodeURIComponentSafe-MQV5aj_5.js","assets/useInitialThreadRequest-BXjZ5prE.js","assets/routePaths-BxLZuqJn.js","assets/expenseAutomationHelper-DEOPVtcg.js","assets/stripSplatSuffix-CYVrHv_0.js","assets/analyticsHelper-BZsIqD3O.js","assets/CompanyPassportScreen-CMIjHc5k.js","assets/MobileAppDrawer-Dubbrc5R.js","assets/InboxNotificationsProvider-gj6fT2eX.js","assets/useTaskManagerAccess-CncuT8wV.js","assets/useAiCfoDashboardSuggestedQuestionsChips-sigyClkp.js","assets/FeaturePreviewScreen-BE9pWqir.js","assets/BillPayRoutes-CdYxJOPQ.js","assets/AddressScreen-D06QouT5.js","assets/DomesticWireDetailScreen-Bo5pk1NL.js","assets/BusinessVerificationPageScreen-BScFHNdu.js","assets/DrawerScreen-DYwMLd1Q.js","assets/SetupPagesScreen-BzKWg1IS.js","assets/BillPayApprovalRoutes-C1N-qtHk.js","assets/ReimbursementApprovalRuleDetailScreen-B9f-fas4.js","assets/getLocaleForTenant-DffZrhDN.js","assets/ReimbursementRoutes-IZQbGrfA.js","assets/ReimbursementApprovalRoutes-BqXyuFCU.js","assets/TransactionListRoutes-DeHnVgrc.js","assets/ZeniAccountStatementScreen-Cg7a4ZMC.js","assets/SettingsRoutes-CMH4A66d.js","assets/AccountMappingScreen-CfueHDEF.js","assets/QBOConnectionScreen-CAoS33ZU.js","assets/empty-DQLKD1Hp.js","assets/index-8ioAZPP6.js","assets/url-Ej5v3O6d.js","assets/index-EnAqWoDC.js","assets/accountMappingHelper-DWzrp9Pr.js","assets/useEmailConnectResultRefresh-DefipxZh.js","assets/ReportsRoutes-R5Ca0XU-.js","assets/ChargeCardRoutes-tPmmU_fw.js","assets/useChargeCardPusherEvents-gKhYa0T8.js","assets/PeopleRoutes-MPpefoB8.js","assets/ExpenseAutomationRoutes-D17PZLn2.js","assets/useActualMatchingMatchDetail-Bq60hvvx.js","assets/ScheduleDetailsPrepaidExpensesScreen-BMDMlpQa.js","assets/pathToGoBack-DMRqTTJ7.js","assets/TreasuryRoutes-CH1V36gd.js","assets/VendorsRoutes-D5fLbpGk.js","assets/ZeniAccountRoutes-B_-Cub3b.js","assets/AddressRoutes-nZx4HWhJ.js","assets/PandLWithForecastRoutes-tEXmnuYa.js","assets/CustomerOnboardingRoutes-BqAwy1Go.js","assets/TransactionDetailRoutes-DWH8l2BY.js","assets/EntityDetailRoutes-_eEqLjSQ.js","assets/InvoicingRoutes-rYerhkHV.js","assets/NotificationRoutes-C0XszwDJ.js","assets/PerformanceRoutes-v3vPCjna.js","assets/ActualMatchingMatchDetailScreen-fiSieMf_.js","assets/RewardsRoutes-CRQWx3J1.js","assets/TaskRoutes-BLHPB9C2.js","assets/TaskListScreen-CQ5GSVtZ.js","assets/AiCfoScreen-V8xy8p4b.js","assets/CardsAiCfoScreen-BQ4Zn40f.js"])))=>i.map(i=>d[i]);
2
+ import{_ as s,bn as Es,fF as hs,d_ as ps,dZ as xs,AV as gs,di as Rs,c8 as js,gJ as Is,g9 as Ts,df as pe,cG as As,gn as fs,cy as Ds,bE as bs,br as ys,U0 as Cs,v as vs,U3 as Us,bq as Os,U4 as Ps,bK as ws,bJ as Fs,bt as Ls,cu as Vs,U5 as ks,U6 as Hs,da as Ss,dd as Bs,dc as Ns,cF as Ms,cM as Zs,pS as xe,gi as ge,gY as Gs,gk as Re,gL as je,gM as Ie,gl as $s}from"./zeni-epic-state-CZbm731W.js";import{j as e}from"./liveblocks-DKqwsBQp.js";import{a as P}from"./sentry-CxSdF_rC.js";import{N as u,u as zs,h as Ys,i as qs,g as Js,j as G,q as Te,n as Ws,o as n}from"./core-D6EV-11Y.js";import{K as l,E as Ks,u as Qs,z as y,N as Xs,f as et,g as st,d as B,j as tt,O as nt,U as at,L as F,G as Ae,t as _,P as ot,Q as rt,l as ne}from"./index-lv0eG9-7.js";import"./mui-qouWiIWk.js";import{f as fe}from"./analyticsHelper-BZsIqD3O.js";import{t as it}from"./getLocaleForTenant-DffZrhDN.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},D=new o.Error().stack;D&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[D]="d4fefd11-cef4-4699-9866-d314a3170b3a",o._sentryDebugIdIdentifier="sentry-dbid-d4fefd11-cef4-4699-9866-d314a3170b3a")}catch{}})();const lt=l((()=>s((()=>import("./NotFoundScreen-r2t5kGnd.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),ut=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/reimbursements`}),dt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/bills`}),De=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/treasury`}),be=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/checking`}),ye=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/cards`}),C=({showZeniAccountRoute:o,isUserHasBillPayAccess:D,isUserHasReimbursementAccess:N,showTreasuryRoute:i,isTenantBankingOnly:V,showChargeCardRoute:U,tenantEmailDomain:v})=>{if(V===!0){if(o)return e.jsx(be,{tenantEmailDomain:v});if(i)return e.jsx(De,{tenantEmailDomain:v});if(U)return e.jsx(ye,{tenantEmailDomain:v})}return o?e.jsx(be,{tenantEmailDomain:v}):i?e.jsx(De,{tenantEmailDomain:v}):U?e.jsx(ye,{tenantEmailDomain:v}):D?e.jsx(dt,{tenantEmailDomain:v}):N?e.jsx(ut,{tenantEmailDomain:v}):e.jsx(lt,{})},ct={dashboard:()=>s((()=>import("./DashboardRoutes-C3Q7vlXr.js")),__vite__mapDeps([9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,0,18,19,20,21,22,23,24,8])),bills:()=>s((()=>import("./BillPayRoutes-CdYxJOPQ.js")),__vite__mapDeps([25,1,2,3,4,5,6,7,26,0,27,11,14,28,15,20,21,22,29,24,30,18,31,32,33,8])),reimbursement:()=>s((()=>import("./ReimbursementRoutes-IZQbGrfA.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,11,14,29,35,32,33,8])),transactions:()=>s((()=>import("./TransactionListRoutes-DeHnVgrc.js")),__vite__mapDeps([36,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,37,8])),settings:()=>s((()=>import("./SettingsRoutes-CMH4A66d.js")),__vite__mapDeps([38,1,2,3,4,5,6,7,22,39,20,21,40,41,42,43,44,13,45,26,0,18,28,15,19,46,31,32,35,8])),reports:()=>s((()=>import("./ReportsRoutes-R5Ca0XU-.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,0,24,14,15,20,21,22,8])),chargeCards:()=>s((()=>import("./ChargeCardRoutes-tPmmU_fw.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,11,20,21,22,30,28,15,0,18,14,49,26,8])),people:()=>s((()=>import("./PeopleRoutes-MPpefoB8.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,0,11,20,21,22,8])),expenseAutomation:()=>s((()=>import("./ExpenseAutomationRoutes-D17PZLn2.js")),__vite__mapDeps([51,1,2,3,0,4,5,6,7,11,12,13,14,15,16,52,17,10,53,54,45,29,8])),treasury:()=>s((()=>import("./TreasuryRoutes-CH1V36gd.js")),__vite__mapDeps([55,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,11,14,24,8])),vendors:()=>s((()=>import("./VendorsRoutes-D5fLbpGk.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,26,0,24,53,54,15,11,20,21,22,29,45,8])),zeniAccounts:()=>s((()=>import("./ZeniAccountRoutes-B_-Cub3b.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,27,26,11,37,8]))},mt=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ae=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},_t=l((()=>s((()=>import("./ReportsRoutes-R5Ca0XU-.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,0,24,14,15,20,21,22,8])))),Et=l((()=>s((()=>import("./AddressRoutes-nZx4HWhJ.js")),__vite__mapDeps([58,1,2,3,26,4,5,6,7,0,8])))),ht=l((()=>s((()=>import("./PeopleRoutes-MPpefoB8.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,0,11,20,21,22,8])))),pt=l((()=>s((()=>import("./PandLWithForecastRoutes-tEXmnuYa.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,0,24,11,14,15,20,21,22,8])))),xt=l((()=>s((()=>import("./CustomerOnboardingRoutes-BqAwy1Go.js")),__vite__mapDeps([60,1,2,3,26,4,5,6,7,0,40,41,42,43,44,13,46,49,8])))),gt=l((()=>s((()=>import("./VendorsRoutes-D5fLbpGk.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,26,0,24,53,54,15,11,20,21,22,29,45,8])))),Rt=l((()=>s((()=>import("./TransactionDetailRoutes-DWH8l2BY.js")),__vite__mapDeps([61,1,2,3,0,4,5,6,7,12,11,13,14,15,16,8])))),Ce=l((()=>s((()=>import("./EntityDetailRoutes-_eEqLjSQ.js")),__vite__mapDeps([62,1,2,3,4,5,6,7,13,10,11,12,14,15,16,17,8])))),jt=l((()=>s((()=>import("./DashboardRoutes-C3Q7vlXr.js")),__vite__mapDeps([9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,0,18,19,20,21,22,23,24,8])))),ve=l((()=>s((()=>import("./BillPayRoutes-CdYxJOPQ.js")),__vite__mapDeps([25,1,2,3,4,5,6,7,26,0,27,11,14,28,15,20,21,22,29,24,30,18,31,32,33,8])))),It=l((()=>s((()=>import("./SettingsRoutes-CMH4A66d.js")),__vite__mapDeps([38,1,2,3,4,5,6,7,22,39,20,21,40,41,42,43,44,13,45,26,0,18,28,15,19,46,31,32,35,8])))),Tt=l((()=>s((()=>import("./InvoicingRoutes-rYerhkHV.js")),__vite__mapDeps([63,1,2,3,4,5,6,7,26,0,20,21,22,40,41,42,43,44,13,8])))),Ue=l((()=>s((()=>import("./ReimbursementRoutes-IZQbGrfA.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,11,14,29,35,32,33,8])))),At=l((()=>s((()=>import("./ZeniAccountRoutes-B_-Cub3b.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,27,26,11,37,8])))),ft=l((()=>s((()=>import("./TreasuryRoutes-CH1V36gd.js")),__vite__mapDeps([55,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,11,14,24,8])))),Dt=l((()=>s((()=>import("./TransactionListRoutes-DeHnVgrc.js")),__vite__mapDeps([36,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,37,8])))),bt=l((()=>s((()=>import("./ChargeCardRoutes-tPmmU_fw.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,11,20,21,22,30,28,15,0,18,14,49,26,8])))),yt=l((()=>s((()=>import("./NotificationRoutes-C0XszwDJ.js")),__vite__mapDeps([64,1,2,3,0,4,5,6,7,11,22,8])))),Ct=l((()=>s((()=>import("./PerformanceRoutes-v3vPCjna.js")),__vite__mapDeps([65,1,2,3,0,4,5,6,7,11,20,21,22,8])))),vt=l((()=>s((()=>import("./ExpenseAutomationRoutes-D17PZLn2.js")),__vite__mapDeps([51,1,2,3,0,4,5,6,7,11,12,13,14,15,16,52,17,10,53,54,45,29,8])))),Ut=l((()=>s((()=>import("./ActualMatchingMatchDetailScreen-fiSieMf_.js")),__vite__mapDeps([66,1,2,3,4,5,6,7,52,17,13,15,0,8])))),Ot=l((()=>s((()=>import("./RewardsRoutes-CRQWx3J1.js")),__vite__mapDeps([67,1,2,3,4,5,6,7,0,8])))),Pt=l((()=>s((()=>import("./TaskRoutes-BLHPB9C2.js")),__vite__mapDeps([68,1,2,3,0,4,5,6,7,14,20,21,22,69,11,8])))),wt=l((()=>s((()=>import("./AiCfoScreen-V8xy8p4b.js")),__vite__mapDeps([70,1,2,3,4,5,6,7,23,54,15,8])))),Oe=l((()=>s((()=>import("./CardsAiCfoScreen-BQ4Zn40f.js")),__vite__mapDeps([71,1,2,3,4,5,6,7,8])))),f=l((()=>s((()=>import("./NotFoundScreen-r2t5kGnd.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),Ft=l((()=>s((()=>import("./TaskListScreen-CQ5GSVtZ.js").then((o=>o.f))),__vite__mapDeps([69,1,2,3,4,5,6,7,11,20,21,22,8])))),Lt=({isDashboardAccess:o,showZeniAccountRoute:D,isUserHasBillPayAccess:N,isUserHasReimbursementAccess:i,showTreasuryRoute:V,isTenantBankingOnly:U,isTenantCardsOnly:v,showChargeCardRoute:k})=>{if(U===!0){if(D)return e.jsx(u,{to:"checking"});if(V)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"}):D?e.jsx(u,{to:"checking"}):V?e.jsx(u,{to:"treasury"}):k?e.jsx(u,{to:"cards"}):N?e.jsx(u,{to:"bills"}):i?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},Pe=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/dashboard`}),Gt=Object.freeze(Object.defineProperty({__proto__:null,default:function({setTenantEmailDomain:o}){const D=zs(),N=Ys(),{tenantEmailDomain:i}=qs(),V=Ks().mode,{setLoading:U,clearAllLoading:v,clearLoading:k}=Qs(),b=y.getSignedInUserTenant(i)?.tenantId,I=y.getSignedInUser(),W=Es(I),$=Js(),[L,we]=P.useState(!1),r=G((a=>hs(a))),{useFeatureGate:H}=Xs(),M=et(),K=st(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:Ve}=H(B.isChargeCardFeatureEnabled),{isFeatureEnabled:oe}=H(B.isDebitCardFeatureEnabled),T=G((a=>a.tenantState.fetchState)),p=G((a=>a.tenantState.activeTenantFetchState.fetchState)),E=p==="Completed"||T==="Completed"?ps(oe,r):void 0,Q=p==="Completed"||T==="Completed"?xs(r):void 0,re=p==="Completed"||T==="Completed"?gs(r)&&!Rs(r):void 0,ke=tt(r,Ve,oe),{isCardsHidden:He}=nt(r?.tenantId),Se=!ke||!!He,{isFeatureEnabled:Be}=H(B.isSettingsFeatureEnabled),{isFeatureEnabled:X}=H(B.isAiCfoFileUploadEnabled),{isFeatureEnabled:Ne}=H(B.isInvoicingFeatureEnabled??"is_invoicing_feature_enabled"),Me=Ne||rt==="DEV",Ze=r?.userRole!=null&&js(r.userRole),z=G((a=>Is(a)));if(i!=null){const a=y.getSignedInUserTenant(i);I!=null&&a!=null&&fe(I,r,V)}const Z={tenantId:b,userId:I?.userId,sessionId:I?.zeniSessionId},ie=Ts(),h=at(),Ge=r.company==null||h?.loggedInUserRoleMap!=null&&pe(h.loggedInUserRole),$e=As(h?.loggedInUserRoleMap),ee=Te("/:tenantEmailDomain/onboarding/*")!==null,ze=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),se=ze?.params.selectedPeriod,Ye=G((a=>Z.tenantId!=null?fs(a,Z.tenantId):void 0));P.useEffect((()=>{U(F.TENANT_FETCHING),o(i)}),[i]),P.useEffect((()=>{if(se!=null&&b!=null){const a=se.split("-");if(a.length===2){const A=Ds(Number(a[0])),c=Number(a[1]),t=bs(`01-${A<10?`0${A}`:A}-${c}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),d=ys();t.isAfter(d,"month")===!1?D(Cs(b,{month:A,year:c})):N(`/${i}/month_end_close_checks/review`)}}}),[se,i,b]),P.useEffect((()=>{L||(we(!0),U(F.TENANT_FETCHING))}),[L,Z,ie,I,D,y]),P.useLayoutEffect((()=>{!vs(ie,Z)&&y.isSignedIn()&&(U(F.TENANT_FETCHING),(function(a,A,c,t){if(ge(A?.userId,A?.zeniSessionId,a.tenantId),c(Gs(!0)),c(Re(a.tenantId)),a.tenantId!=null&&_.clearTenant(a.tenantId),a.tenantId!=null){const d=y.getSignedInUserTenantWithId(a.tenantId);t&&Ae.updateAppLocaleID(it(t)),d?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(d?.tenantEmailDomain)}a.userId!=null?ne.identify(a.userId,{tenant_id:a.tenantId}):ne.resetUserIdentity()})(Z,I,D,Ye))}),[b]),P.useEffect((()=>{y.isSignedIn()&&(U(F.TENANT_FETCHING),(function(a,A,c,t,d,Y,S){if(c==null&&t==null)return void console.warn("There is no current tenant selected!!");const q=t!=null&&d?.zeniSessionId!=null,cs=c==null||c.tenantId!==t,ms=c!=null&&c.excludedResources==null,_s=c!=null&&c.externalConnections==null;if(q&&cs){S(Re(t));const J=y.getSignedInUserTenantWithId(t);J?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(J?.tenantEmailDomain),ge(d?.userId,d?.zeniSessionId,t),_.shouldFetchExcludedResources(t)&&(_.markExcludedResourcesFetchStarted(t),S(je(d.userId,t))),_.shouldFetchConnections(t)&&(_.markConnectionsFetchStarted(t),S(Ie(d.userId,t)))}else q&&ms&&_.shouldFetchExcludedResources(t)&&(_.markExcludedResourcesFetchStarted(t),S(je(d.userId,t))),q&&_s&&_.shouldFetchConnections(t)&&(_.markConnectionsFetchStarted(t),S(Ie(d.userId,t)));if(q){ne.identify(d.userId,{tenant_id:t});const J=t==null||t!=null&&(A==="Completed"||A==="Error");a==="Completed"||A!=="Not-Started"&&A!=="Error"||t==null||!_.shouldFetchActiveTenant(t)||(_.markActiveTenantFetchStarted(t),Y(F.TENANT_FETCHING),S($s(d.userId,t,d.zeniSessionId))),J&&(a==="Not-Started"||a==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),S(xe(d.userId,d.zeniSessionId)))}})(T,p,r,b,I,U,D))}),[b,p]),P.useEffect((()=>{y.isSignedIn()&&T==="Completed"&&z.tenantsBaseInOrder.length>0&&(k(F.TENANT_FETCHING),y.saveSignedInUserTenants(Us(z.tenantsBaseInOrder)),I!=null&&fe(I,r,V,void 0,z.tenantsBaseInOrder))}),[z,T,r,I]),P.useEffect((()=>{p==="In-Progress"&&U(F.TENANT_FETCHING),p!=="Completed"&&p!=="Error"||(p==="Completed"&&b!=null?(v(),_.markActiveTenantFetchCompleted(b)):p==="Error"&&b!=null&&(_.markActiveTenantFetchFailed(b),k(F.TENANT_FETCHING),k(F.TENANT_SWITCHING))),T!=="Completed"&&T!=="Error"||(T==="Completed"?_.markAllTenantsFetchCompleted():T==="Error"&&_.markAllTenantsFetchFailed())}),[p,T,b,L]);const le=P.useRef(!1);P.useEffect((()=>{!le.current&&p==="Completed"&&L&&(le.current=!0,(function(a=mt,A=3e3){setTimeout((()=>{const c=t=>{if(t>=a.length)return;const d=a[t],Y=ct[d];Y!=null?Y().then((()=>ae((()=>c(t+1))))).catch((()=>ae((()=>c(t+1))))):c(t+1)};ae((()=>c(0)))}),A)})())}),[p,L]);const O=r?.userRole!=null&&Os(r?.userRole),{isFeatureEnabled:qe}=H(B.isReferralFeatureEnabled),{isFeatureEnabled:Je}=H(B.isAccrualEnabled),We=r?.userRole!=null&&r.userRole.includes("charge_card_user"),Ke=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),w=r?.userRole!=null&&pe(r.userRole),ue=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!O,de=!Se&&!O,Qe=Ps(h?.loggedInUserRoleMap),Xe=r.externalConnections?.accounting[0]?.isValid,es=r.externalConnections?.fetchState==="Completed",te=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!O,me=ce&&ws(h?.loggedInUserRoleMap),_e=Fe&&!O,ss=Le&&!O,ts=ue&&Fs(h?.loggedInUserRoleMap),ns=de&&Ls(h?.loggedInUserRoleMap),as=_e&&Vs(h?.loggedInUserRoleMap),os=ks(h?.loggedInUserRoleMap),rs=Hs(h?.loggedInUserRoleMap),is=Ss(h?.loggedInUserRoleMap),ls=Bs(h?.loggedInUserRoleMap),us=Ns(h?.loggedInUserRoleMap),x=Ms(h?.loggedInUserRoleMap),g=Zs(h?.loggedInUserRoleMap),Ee=ue&&x,he=ce&&g,R=_e&&is,j=ss&&ls,m=de&&us,ds=r.excludedResources?.resources?.find((a=>a.resource==="/invites"))!=null||$e===!0||Qe===!0||os===!0||rs===!0;return y.isSignedIn()?b==null?T==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(I!=null&&T!=="In-Progress"&&D(xe(I.userId,I.zeniSessionId)),null):p!=="In-Progress"&&p!=="Not-Started"||T==="Completed"?(te===!0||W&&!ee)&&es&&Xe!==!0&&E===!1&&Q===!1&&re===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!L||re!==!0||te!==!0||ee||W?!L||te!==!1||ee||W?L&&r?.userRole&&E!=null&&Q!=null&&i!=null&&Object.keys(h.loggedInUserRoleMap).length>0?e.jsx(Ws,{children:e.jsxs(n,{element:e.jsx(ot,{}),children:[e.jsx(n,{path:"/",element:e.jsx(Lt,{isDashboardAccess:w,showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,isTenantCardsOnly:Q,showChargeCardRoute:m})}),e.jsx(n,{path:"dashboard/*",element:w?e.jsx(jt,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reports/*",element:w?e.jsx(_t,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"people/*",element:ds||w?e.jsx(ht,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"forecast/*",element:w?e.jsx(pt,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"onboarding/*",element:e.jsx(xt,{})}),e.jsx(n,{path:"transaction/*",element:w&&O===!1||We||Ke?e.jsx(Rt,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"transactions/*",element:w&&O===!1?e.jsx(Dt,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"customer/*",element:w&&O===!1?e.jsx(Ce,{entityType:"customer"}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,isTenantBankingOnly:E,showTreasuryRoute:j,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"vendor/*",element:w&&O===!1?e.jsx(Ce,{entityType:"vendor"}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"tasks",element:e.jsx(Ft,{})}),e.jsx(n,{path:"tasks/*",element:e.jsx(Pt,{})}),e.jsx(n,{path:"address/*",element:ts||me||as||ns?e.jsx(Et,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"checking/*",element:R?e.jsx(At,{}):e.jsx(f,{})}),e.jsx(n,{path:"treasury/*",element:j?e.jsx(ft,{}):e.jsx(f,{})}),e.jsx(n,{path:"performance",element:K===!0?e.jsx(Ct,{}):e.jsx(Pe,{tenantEmailDomain:i})}),e.jsx(n,{path:"month_end_close_checks/review/*",element:K===!0&&O===!1?e.jsx(vt,{}):e.jsx(Pe,{tenantEmailDomain:i})}),e.jsx(n,{path:"expense-automation/actual-matching/:matchId",element:K===!0&&O===!1&&Je===!0?e.jsx(Ut,{}):e.jsx(f,{})}),e.jsx(n,{path:"notifications/*",element:e.jsx(yt,{})}),e.jsx(n,{path:"vendors/*",element:Ge?e.jsx(gt,{}):e.jsx(f,{})}),e.jsx(n,{path:"bill/*",element:Ee?e.jsx(ve,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"bills/*",element:Ee?e.jsx(ve,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reimbursement/*",element:he?e.jsx(Ue,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reimbursements/*",element:he?e.jsx(Ue,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"settings/*",element:Be?e.jsx(It,{hasAdminLevelAccess:me}):e.jsx(f,{})}),e.jsx(n,{path:"invoicing/*",element:Me&&Ze?e.jsx(Tt,{}):e.jsx(f,{})}),e.jsx(n,{path:"cards/ask",element:m&&M?e.jsx(Oe,{isFileUploadEnabled:X}):e.jsx(f,{})}),e.jsx(n,{path:"cards/ask/:session_id",element:m&&M?e.jsx(Oe,{isFileUploadEnabled:X}):e.jsx(f,{})}),e.jsx(n,{path:"cards/*",element:m?e.jsx(bt,{}):e.jsx(f,{})}),e.jsx(n,{path:"rewards/*",element:qe?e.jsx(Ot,{}):e.jsx(f,{})}),e.jsx(n,{path:"/ai-cfo",element:M?e.jsx(u,{to:"explore"}):e.jsx(f,{})}),e.jsx(n,{path:"/ai-cfo/",element:M?e.jsx(u,{to:"explore"}):e.jsx(f,{})}),e.jsx(n,{path:"/ai-cfo/:session_id",element:M?e.jsx(wt,{isFileUploadEnabled:X}):e.jsx(f,{})}),e.jsx(n,{path:"*",element:e.jsx(f,{})})]})}):null:(o(void 0),e.jsx(u,{to:`/${i}/onboarding`,replace:!0})):(o(void 0),e.jsx(u,{to:`/${i}/onboarding/thankyou`,replace:!0})):null:(console.warn("User logged out!!"),o(void 0),e.jsx(u,{to:"/signin/auth",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}))}},Symbol.toStringTag,{value:"Module"}));export{C as F,Gt as S};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-CW9yScMF.js";import{a as d}from"./sentry-C_uJQK1a.js";import{h as N,g as H,u as _,i as O,j as C,l as K,n as Y,o as k}from"./core-BI5oX4mx.js";import{fF as w,Zd as Pe,Ns as ve,YN as we,YW as Ae,c8 as W,cT as De,cU as Ue,bq as _e,de as Re,FR as Te,Ze as Me,OV as Be,Mj as Ze,Ma as de,M7 as Fe,FV as ue,Md as pe,Mg as ge,Mm as X,C5 as ee,FU as Ve,lu as $,lx as me,Zf as Ne,mH as Oe,Gb as Le,Vt as Ge,Vu as $e,ls as He,Zg as Ke,lv as qe,uA as ze,Vo as Qe,Vp as Ye,uE as Je,hV as We,Un as Q,hN as ae,hK as Xe,hS as en,Uo as nn,G8 as tn,Zh as an,Zi as on,MA as sn,l$ as rn,dZ as fe,d_ as he,Zj as ln,gC as cn,UD as dn,G7 as oe,gH as se,gG as un,G6 as pn,gF as gn,gE as mn,Zk as fn,TP as Ce,Zl as hn,Zm as Cn,Zn as yn,Zo as Sn,Zp as bn,Zq as In,Ge as xn,Zr as En,G5 as ie,F$ as G,Zs as kn,Zt as jn,Zu as re,Zv as Pn,dS as vn,Zw as wn,Zx as An,Zy as Dn,T$ as Un,c0 as _n,c7 as Rn,c6 as Tn,c1 as Mn,Zz as Bn,c4 as Zn,c3 as Fn,c5 as Vn,c2 as Nn}from"./zeni-epic-state-CIizsNeB.js";import{bS as On,z as v,U as L,a7 as ne,c2 as Ln,k as q,N as te,d as F,h as ye,K as Se,c3 as Gn,j as $n,Z as be,c4 as Hn,ai as Kn,c5 as qn,c6 as zn,aq as Qn,c7 as Yn,p as Jn,e as Ie,c8 as Wn}from"./index-mRsR5jtB.js";import{n as B}from"./mui-KP5Ep0NX.js";import{u as xe}from"./useTaskManagerAccess-BMDBcsNO.js";import{U as Xn}from"./AccountMappingScreen-wN76eX8x.js";import{t as et,A as nt}from"./AddressScreen-DOHRJgNm.js";import V from"./NotFoundScreen-BScz3VcE.js";import{g as tt}from"./analyticsHelper-yBGPOCZK.js";import{u as at,B as ot}from"./BusinessVerificationPageScreen-DrH4Xh9l.js";import{C as st}from"./CompanyPassportScreen-CZ0CexZb.js";import{M as T}from"./MobileAppDrawer-DbFom2zh.js";import{u as it,a as rt}from"./useEmailConnectResultRefresh-C0MkzUvF.js";import{q as le}from"./QBOConnectionScreen-NNh_c5sH.js";import{B as lt}from"./BillPayApprovalRoutes-ZvXWZ4qY.js";import{R as ct}from"./ReimbursementApprovalRoutes-BputYX4N.js";import"./recharts-DRl2ZsSW.js";import"./analytics-5LJ4BXQX.js";import"./plaid-BrgJMdej.js";import"./dnd-D6wtGmk9.js";import"./stripe-cKAAJElX.js";import"./lottie-lQbJqTc2.js";import"./lexical-BLu7UAko.js";import"./pdf-DflcYtDk.js";import"./utils-BzQpFQvw.js";import"./accountMappingHelper-B5wpHG39.js";import"./routePaths-Ch3GR24x.js";import"./InboxNotificationsProvider-CMirleoY.js";import"./empty-D1y42ZwI.js";import"./pdf-lib-iL5hUpKl.js";import"./index-BT5wSX8Z.js";import"./url-0wqXxJRo.js";import"./index-Cf-PV9pR.js";import"./decodeURIComponentSafe-B7oIXSPO.js";import"./ReimbursementApprovalRuleDetailScreen-Cp2buMpa.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new e.Error().stack;l&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[l]="d78f2f04-344f-4149-b1c1-6ddde45e7ca5",e._sentryDebugIdIdentifier="sentry-dbid-d78f2f04-344f-4149-b1c1-6ddde45e7ca5")}catch{}})();const dt=B.div`
1
+ import{j as a}from"./liveblocks-DKqwsBQp.js";import{a as d}from"./sentry-CxSdF_rC.js";import{h as N,g as H,u as _,i as O,j as C,l as K,n as Y,o as k}from"./core-D6EV-11Y.js";import{fF as w,Zd as Pe,Ns as ve,YN as we,YW as Ae,c8 as W,cT as De,cU as Ue,bq as _e,de as Re,FR as Te,Ze as Me,OV as Be,Mj as Ze,Ma as de,M7 as Fe,FV as ue,Md as pe,Mg as ge,Mm as X,C5 as ee,FU as Ve,lu as $,lx as me,Zf as Ne,mH as Oe,Gb as Le,Vt as Ge,Vu as $e,ls as He,Zg as Ke,lv as qe,uA as ze,Vo as Qe,Vp as Ye,uE as Je,hV as We,Un as Q,hN as ae,hK as Xe,hS as en,Uo as nn,G8 as tn,Zh as an,Zi as on,MA as sn,l$ as rn,dZ as fe,d_ as he,Zj as ln,gC as cn,UD as dn,G7 as oe,gH as se,gG as un,G6 as pn,gF as gn,gE as mn,Zk as fn,TP as Ce,Zl as hn,Zm as Cn,Zn as yn,Zo as Sn,Zp as bn,Zq as In,Ge as xn,Zr as En,G5 as ie,F$ as G,Zs as kn,Zt as jn,Zu as re,Zv as Pn,dS as vn,Zw as wn,Zx as An,Zy as Dn,T$ as Un,c0 as _n,c7 as Rn,c6 as Tn,c1 as Mn,Zz as Bn,c4 as Zn,c3 as Fn,c5 as Vn,c2 as Nn}from"./zeni-epic-state-CZbm731W.js";import{bS as On,z as v,U as L,a7 as ne,c2 as Ln,l as q,N as te,d as F,j as ye,O as Se,c3 as Gn,k as $n,Z as be,c4 as Hn,ai as Kn,c5 as qn,c6 as zn,aq as Qn,c7 as Yn,p as Jn,e as Ie,c8 as Wn}from"./index-lv0eG9-7.js";import{n as B}from"./mui-qouWiIWk.js";import{u as xe}from"./useTaskManagerAccess-CncuT8wV.js";import{U as Xn}from"./AccountMappingScreen-CfueHDEF.js";import{t as et,A as nt}from"./AddressScreen-D06QouT5.js";import V from"./NotFoundScreen-r2t5kGnd.js";import{g as tt}from"./analyticsHelper-BZsIqD3O.js";import{u as at,B as ot}from"./BusinessVerificationPageScreen-BScFHNdu.js";import{C as st}from"./CompanyPassportScreen-CMIjHc5k.js";import{M as T}from"./MobileAppDrawer-Dubbrc5R.js";import{u as it,a as rt}from"./useEmailConnectResultRefresh-DefipxZh.js";import{q as le}from"./QBOConnectionScreen-CAoS33ZU.js";import{B as lt}from"./BillPayApprovalRoutes-C1N-qtHk.js";import{R as ct}from"./ReimbursementApprovalRoutes-BqXyuFCU.js";import"./recharts-C9zWmt1W.js";import"./analytics-wktvfErl.js";import"./plaid-deRHM6gT.js";import"./dnd-CkchuQYc.js";import"./stripe-cKAAJElX.js";import"./lottie-BwhdO6jl.js";import"./lexical-C6tQwGBF.js";import"./pdf-DcGn_mX8.js";import"./utils-D8aAQJhF.js";import"./accountMappingHelper-DWzrp9Pr.js";import"./routePaths-BxLZuqJn.js";import"./InboxNotificationsProvider-gj6fT2eX.js";import"./empty-DQLKD1Hp.js";import"./pdf-lib-DndwkHl6.js";import"./index-8ioAZPP6.js";import"./url-Ej5v3O6d.js";import"./index-EnAqWoDC.js";import"./decodeURIComponentSafe-MQV5aj_5.js";import"./ReimbursementApprovalRuleDetailScreen-B9f-fas4.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new e.Error().stack;l&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[l]="51c03a40-8799-4c00-82e3-366ae2dc4b01",e._sentryDebugIdIdentifier="sentry-dbid-51c03a40-8799-4c00-82e3-366ae2dc4b01")}catch{}})();const dt=B.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as u}from"./liveblocks-CW9yScMF.js";import{h as Q,g as X,u as ee,i as G,j as v,N as j,l as H,t as Xe}from"./core-BI5oX4mx.js";import{bJ as en,fF as F,cG as nn,HG as $,YN as tn,YQ as an,uT as ne,uH as te,mz as ae,BD as R,YS as Ce,gG as We,gF as Ge,gE as He,YT as sn,HP as on,Mj as he,Ma as Ie,M7 as Ae,LR as J,Md as _e,Mg as ke,Mm as ve,C5 as Pe,g_ as cn,cB as rn,d_ as un,dZ as dn,di as ln,bt as pn,cu as Fe,YU as mn,KR as de,Lt as yn,YV as fn,bK as gn,NE as le,Ns as Sn,YW as bn,YX as Cn,NI as hn,NM as In,YY as je,Bw as An,S8 as _n,Oi as be,P7 as pe,YZ as kn,Y_ as vn,Y$ as Pn,Z0 as Ye,Z1 as Tn,Vc as En,Y2 as Dn,Vr as Un,Z2 as Ke,LV as wn,Vs as On,LZ as Fn,Z3 as Oe,Os as qe,mH as Vn,uK as Je,BF as xn,bE as Ne,BR as Re,cE as Bn,Z4 as Qe,N$ as jn,O0 as Nn,O4 as Rn,Z5 as Ln,Ol as Le,Z6 as Mn,Z7 as zn,Z8 as Zn,Z9 as $n,gV as Wn,I_ as Gn,Za as Hn,J3 as Yn,J2 as Kn}from"./zeni-epic-state-CIizsNeB.js";import{ai as Te,U as ie,N as me,d as q,c as Ee,z as E,a8 as se,k as D,a7 as De,S as W,bP as qn,ae as oe,bQ as V,bi as Ve,bR as Jn,bS as Qn,bT as Xn,o as Be,bU as et,p as Me,aG as ze,a1 as nt,ab as tt,bV as at,bW as it,bX as st,w as ot}from"./index-mRsR5jtB.js";import{a as h}from"./sentry-C_uJQK1a.js";import{n as xe,D as ct,S as rt}from"./mui-KP5Ep0NX.js";import{u as ut,B as we}from"./BusinessVerificationPageScreen-DrH4Xh9l.js";import{M as ye}from"./MobileAppDrawer-DbFom2zh.js";import N from"./NotFoundScreen-BScz3VcE.js";import{a as Ze}from"./analyticsHelper-yBGPOCZK.js";import{d as $e}from"./routePaths-Ch3GR24x.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]="1959ad4c-0416-4cf4-9792-b79b6b461acd",e._sentryDebugIdIdentifier="sentry-dbid-1959ad4c-0416-4cf4-9792-b79b6b461acd")}catch{}})();const dt=xe.div`
1
+ import{j as u}from"./liveblocks-DKqwsBQp.js";import{h as Q,g as X,u as ee,i as G,j as v,N as j,l as H,t as Xe}from"./core-D6EV-11Y.js";import{bJ as en,fF as F,cG as nn,HG as $,YN as tn,YQ as an,uT as ne,uH as te,mz as ae,BD as R,YS as Ce,gG as We,gF as Ge,gE as He,YT as sn,HP as on,Mj as he,Ma as Ie,M7 as Ae,LR as J,Md as _e,Mg as ke,Mm as ve,C5 as Pe,g_ as cn,cB as rn,d_ as un,dZ as dn,di as ln,bt as pn,cu as Fe,YU as mn,KR as de,Lt as yn,YV as fn,bK as gn,NE as le,Ns as Sn,YW as bn,YX as Cn,NI as hn,NM as In,YY as je,Bw as An,S8 as _n,Oi as be,P7 as pe,YZ as kn,Y_ as vn,Y$ as Pn,Z0 as Ye,Z1 as Tn,Vc as En,Y2 as Dn,Vr as Un,Z2 as Ke,LV as wn,Vs as On,LZ as Fn,Z3 as Oe,Os as qe,mH as Vn,uK as Je,BF as xn,bE as Ne,BR as Re,cE as Bn,Z4 as Qe,N$ as jn,O0 as Nn,O4 as Rn,Z5 as Ln,Ol as Le,Z6 as Mn,Z7 as zn,Z8 as Zn,Z9 as $n,gV as Wn,I_ as Gn,Za as Hn,J3 as Yn,J2 as Kn}from"./zeni-epic-state-CZbm731W.js";import{ai as Te,U as ie,N as me,d as q,E as Ee,z as E,a8 as se,l as D,a7 as De,T as W,bP as qn,ae as oe,bQ as V,bi as Ve,bR as Jn,bS as Qn,bT as Xn,q as Be,bU as et,p as Me,aG as ze,a1 as nt,ab as tt,bV as at,bW as it,bX as st,w as ot}from"./index-lv0eG9-7.js";import{a as h}from"./sentry-CxSdF_rC.js";import{n as xe,D as ct,S as rt}from"./mui-qouWiIWk.js";import{u as ut,B as we}from"./BusinessVerificationPageScreen-BScFHNdu.js";import{M as ye}from"./MobileAppDrawer-Dubbrc5R.js";import N from"./NotFoundScreen-r2t5kGnd.js";import{a as Ze}from"./analyticsHelper-BZsIqD3O.js";import{d as $e}from"./routePaths-BxLZuqJn.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]="9bc95200-356d-44f3-a384-97553a17239a",e._sentryDebugIdIdentifier="sentry-dbid-9bc95200-356d-44f3-a384-97553a17239a")}catch{}})();const dt=xe.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -0,0 +1 @@
1
+ import{j as f}from"./liveblocks-DKqwsBQp.js";import{a as u,R as T,q as A}from"./sentry-CxSdF_rC.js";import{u as z,h as D,j as l,g as j,N as F,l as M}from"./core-D6EV-11Y.js";import{u as O,z as s,E as P,l as w,G as N,S as _,T as B,V,X as $,Y as q,Z as v}from"./index-lv0eG9-7.js";import{fF as J,TL as R,U3 as W,gi as X,gk as Y,U8 as G,gU as H,dj as Z,U9 as y,Ua as K,Ub as Q,b$ as U}from"./zeni-epic-state-CZbm731W.js";import"./mui-qouWiIWk.js";import{u as ee}from"./useDeviceId-RToKfM0O.js";import{f as te}from"./analyticsHelper-BZsIqD3O.js";import{t as ne}from"./getLocaleForTenant-DffZrhDN.js";import"./recharts-C9zWmt1W.js";import"./analytics-wktvfErl.js";import"./plaid-deRHM6gT.js";import"./dnd-CkchuQYc.js";import"./stripe-cKAAJElX.js";import"./lottie-BwhdO6jl.js";import"./lexical-C6tQwGBF.js";import"./pdf-DcGn_mX8.js";import"./utils-D8aAQJhF.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]="8c35f72b-4383-4283-85dd-65fe13c68efa",t._sentryDebugIdIdentifier="sentry-dbid-8c35f72b-4383-4283-85dd-65fe13c68efa")}catch{}})();const ie=M((function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}}),(function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{A({message:`OAuth error from provider ${a} with error ${n}`,level:"error",tags:{authProvider:a,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,a)=>{const c=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(Q({authCode:n,oauthProvider:a,appType:"web",redirectUri:U(c),sourceUri:U(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:a}=i;a!=null&&(s.saveMagicLinkEmail(n),t(K(n,a)))},clearSignInError:()=>{t(y())}}}))(q),ae=T.memo(ie);function ve({setTenantEmailDomain:t}){const i=z(),d=D(),{clearAllLoading:g}=O(),n=s.getSignedInUser();u.useLayoutEffect((()=>{g()}),[g]);const a=ee(),c=l((e=>e.tenantState.magicLinkCodeVerifier)),{sendEmailMagicLinkFetchState:L,accountLocked:b,accountUnlockTime:k}=l((e=>e.tenantState)),p=l((e=>e.tenantState.fetchState)),h=l((e=>e.tenantState.activeTenantFetchState.fetchState)),S=l((e=>e.tenantState.signInState)),o=l((e=>e.tenantState.loggedInUser)),r=l((e=>J(e))),I=l((e=>R(e))),m=j(),E=P().mode,C=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(u.useEffect((()=>{L.fetchState==="Completed"&&c!=null&&(w.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(c))}),[L.fetchState,c]),u.useEffect((()=>{t(void 0)}),[]),u.useEffect((()=>{S!=="In-Progress"||p!=="Completed"&&h!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(W(I.tenantsInOrder),o.zeniSessionId),X(o.userId,o.zeniSessionId,r.tenantId),i(Y(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(G("Completed")),N.updateAppLocaleID(ne(r)),te(o,r,E,void 0,I.tenantsInOrder),H().then((()=>{const e=$();e!=null&&_(e)})),setTimeout((()=>{w.trackLogin(B.Event.loginSuccess,o.authProvider??"google",Z(r.productSettings))}),2e3))}),[S,p,h,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(F,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!C,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),b===!0&&k!=null?f.jsx(V,{onClose:()=>i(y()),unlockDate:k}):null]})}export{ve as default};
@@ -0,0 +1,9 @@
1
+ import{j as s}from"./liveblocks-DKqwsBQp.js";import{a as i}from"./sentry-CxSdF_rC.js";import{u as f,g as d,N as u}from"./core-D6EV-11Y.js";import{z as n,l as a,T as m,a7 as p}from"./index-lv0eG9-7.js";import{gX as g,Up as y}from"./zeni-epic-state-CZbm731W.js";import{n as b}from"./mui-qouWiIWk.js";import"./recharts-C9zWmt1W.js";import"./analytics-wktvfErl.js";import"./plaid-deRHM6gT.js";import"./dnd-CkchuQYc.js";import"./stripe-cKAAJElX.js";import"./lottie-BwhdO6jl.js";import"./lexical-C6tQwGBF.js";import"./pdf-DcGn_mX8.js";import"./utils-D8aAQJhF.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]="4e78b738-ee5a-4720-985c-02719b0e526e",e._sentryDebugIdIdentifier="sentry-dbid-4e78b738-ee5a-4720-985c-02719b0e526e")}catch{}})();function N(){const e=f(),t=d(),r=i.useRef(!1),l=n.isSignedIn(),o=t.state?.message==="logout"||l;return i.useEffect((()=>{if(o&&!r.current){r.current=!0;try{e(g()),y(),a.trackLogout(m.Event.logoutSuccess),a.resetUserIdentity(),n.clearAll()}catch(c){console.error("Error during sign out:",c)}finally{window.location.replace("/signin/auth")}}}),[o,e]),o?s.jsx(h,{children:s.jsx(p,{fetchState:"In-Progress"})}):s.jsx(u,{to:"../",replace:!0})}const h=b.div`
2
+ display: flex;
3
+ height: 100vh;
4
+ width: 100%;
5
+ flex: 1 1 auto;
6
+ flex-direction: column;
7
+ align-items: center;
8
+ background-color: ${e=>e.theme.colors.grey4};
9
+ `;export{N as default};