@zeniai/web-app-ui 5.3.63-dev → 5.3.64-dev-beta0KB

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 (157) hide show
  1. package/dist/assets/{AccountMappingScreen-BRZHYOUR.js → AccountMappingScreen-C_GVFaoh.js} +2 -2
  2. package/dist/assets/ActualMatchingMatchDetailScreen-Br9CFUye.js +1 -0
  3. package/dist/assets/AddressRoutes-Bw_nh--O.js +1 -0
  4. package/dist/assets/AddressScreen-CvhZrOl1.js +9 -0
  5. package/dist/assets/AiCfoScreen-enlKpZc4.js +22 -0
  6. package/dist/assets/{AppDrawer-DZIMVdFc.js → AppDrawer-BvDyxQG-.js} +1 -1
  7. package/dist/assets/BillPayApprovalRoutes-D18TxHMc.js +1 -0
  8. package/dist/assets/{BillPayRoutes-CUUjBefv.js → BillPayRoutes-CloKoO0m.js} +6 -6
  9. package/dist/assets/{BusinessVerificationPageScreen-DFamYzxa.js → BusinessVerificationPageScreen-wzhfqwbN.js} +2 -2
  10. package/dist/assets/{CardsAiCfoScreen-Cx5KkOYw.js → CardsAiCfoScreen-CsPjsbB8.js} +2 -2
  11. package/dist/assets/{ChargeCardRoutes-DzIBuJeY.js → ChargeCardRoutes-CeG2_2Iv.js} +9 -9
  12. package/dist/assets/CompanyPassportScreen-CTdU0eT4.js +1 -0
  13. package/dist/assets/ConnectionAuthScreen-tQkR0Qdq.js +11 -0
  14. package/dist/assets/CustomerOnboardingAuthScreen-Cfna6QXU.js +1 -0
  15. package/dist/assets/{CustomerOnboardingRoutes-CjmJGGJm.js → CustomerOnboardingRoutes-C2PIK8CC.js} +3 -3
  16. package/dist/assets/{DashboardRoutes-ByHBLKcB.js → DashboardRoutes-B6PQcDII.js} +4 -4
  17. package/dist/assets/DefaultTenantHome-R8lvjrth.js +1 -0
  18. package/dist/assets/DomesticWireDetailScreen-BOXpXEFg.js +18 -0
  19. package/dist/assets/{DrawerScreen-B5BqRZEJ.js → DrawerScreen-kd-vUIOU.js} +1 -1
  20. package/dist/assets/EntityDetailRoutes-CKVztcFF.js +1 -0
  21. package/dist/assets/ExpenseAutomationRoutes-CZBhc5OO.js +38 -0
  22. package/dist/assets/FeaturePreviewScreen-DlYWStt_.js +1 -0
  23. package/dist/assets/HubSpotOAuthCallbackScreen-BiVfvVOh.js +1 -0
  24. package/dist/assets/{InboxNotificationsProvider-x0fdv66l.js → InboxNotificationsProvider-jZPrqdDf.js} +1 -1
  25. package/dist/assets/InvoicingRoutes-CTeBd6HD.js +2 -0
  26. package/dist/assets/{MagicLinkRoutes-C5BKMtwW.js → MagicLinkRoutes-DBawNNk_.js} +20 -20
  27. package/dist/assets/MagicLinkSignInScreen-CKyZ86AC.js +12 -0
  28. package/dist/assets/MobileAppDrawer-thURFqdR.js +1 -0
  29. package/dist/assets/NotFoundScreen-CjcmfT5h.js +1 -0
  30. package/dist/assets/{NotificationRoutes-DICT3yoM.js → NotificationRoutes-B5kGRr3c.js} +1 -1
  31. package/dist/assets/OAuthConsentScreen-DKPtywIw.js +1 -0
  32. package/dist/assets/PandLWithForecastRoutes-DuKFzXpp.js +1 -0
  33. package/dist/assets/{PaymentLinkScreen-Cz1wlNqO.js → PaymentLinkScreen-DgjfMeF_.js} +9 -9
  34. package/dist/assets/PeopleRoutes-BFFXxsrW.js +22 -0
  35. package/dist/assets/PerformanceRoutes-DlDpAJN4.js +1 -0
  36. package/dist/assets/{Preview-Dz6yJNce.js → Preview-CFep9b6s.js} +1 -1
  37. package/dist/assets/{QBOConnectionScreen-D8eeXRWb.js → QBOConnectionScreen-zn7s2M2b.js} +1 -1
  38. package/dist/assets/ReimbursementApprovalRoutes-h6pN24Dd.js +1 -0
  39. package/dist/assets/ReimbursementApprovalRuleDetailScreen-La5bMk76.js +1 -0
  40. package/dist/assets/ReimbursementRoutes-DpjqJ1j9.js +68 -0
  41. package/dist/assets/{ReportsRoutes-CqUKv9Uh.js → ReportsRoutes-Tu97hQPr.js} +1 -1
  42. package/dist/assets/RewardsRoutes-C7-L_VuA.js +1 -0
  43. package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-CLEogplJ.js → ScheduleDetailsPrepaidExpensesScreen-BNVCc0tE.js} +5 -5
  44. package/dist/assets/ScreenRoutes-DUiJb0LC.js +2 -0
  45. package/dist/assets/{SettingsRoutes-QcMcR-j3.js → SettingsRoutes-BVrPYY3-.js} +6 -6
  46. package/dist/assets/{SetupPagesScreen-fuvb0IYd.js → SetupPagesScreen-Cx3OOUGr.js} +4 -4
  47. package/dist/assets/SignInScreen-BXBlASFY.js +1 -0
  48. package/dist/assets/SignOutScreen-BN1O2qGb.js +9 -0
  49. package/dist/assets/{TaskListScreen-C2urPjKT.js → TaskListScreen-DrflApgr.js} +2 -2
  50. package/dist/assets/{TaskRoutes-BuzkCbPW.js → TaskRoutes-BxW92Ol2.js} +2 -2
  51. package/dist/assets/TransactionDetailRoutes-CUdtnWL8.js +1 -0
  52. package/dist/assets/{TransactionDetailScreen-CQr1YyP0.js → TransactionDetailScreen-C2qhnA5b.js} +2 -2
  53. package/dist/assets/TransactionListRoutes-Bt_C_073.js +1 -0
  54. package/dist/assets/{TreasuryRoutes-CbD79DO8.js → TreasuryRoutes-DJK_7z5t.js} +5 -5
  55. package/dist/assets/{VendorsRoutes-CCYu89Uf.js → VendorsRoutes-dr-KQ_Nk.js} +13 -13
  56. package/dist/assets/WiseConfirmationScreen-BjSMumPA.js +12 -0
  57. package/dist/assets/{ZeniAccountRoutes-CoRmS3Mc.js → ZeniAccountRoutes-mpb2ppPH.js} +11 -11
  58. package/dist/assets/ZeniAccountStatementScreen-C6P6WNnP.js +9 -0
  59. package/dist/assets/{accountMappingHelper-tmyjt9rr.js → accountMappingHelper-D5I8xPpR.js} +1 -1
  60. package/dist/assets/analytics-CVpLIXYS.js +68 -0
  61. package/dist/assets/{analyticsHelper-BEL0ra9X.js → analyticsHelper-DIAaX2E9.js} +1 -1
  62. package/dist/assets/{core-CHD8T-IM.js → core-BmXpopk3.js} +1 -1
  63. package/dist/assets/{decodeURIComponentSafe-p_nrn8Pg.js → decodeURIComponentSafe-CmNiiSLm.js} +1 -1
  64. package/dist/assets/{dnd-Dwi6R-ey.js → dnd-CFbFq_On.js} +1 -1
  65. package/dist/assets/{empty-CeRjDJvl.js → empty-0E71-pkh.js} +1 -1
  66. package/dist/assets/{empty-CZC5CrVC.js → empty-IUpx8pFE.js} +1 -1
  67. package/dist/assets/{emptyVideoElement-BQ5qxpg6.js → emptyVideoElement-DvAsJwe7.js} +1 -1
  68. package/dist/assets/epic-Dp0UOOW0.js +2 -0
  69. package/dist/assets/expenseAutomationHelper-wsi-w_Qs.js +1 -0
  70. package/dist/assets/{getLocaleForTenant-D-or0iZO.js → getLocaleForTenant-CLcFXXBi.js} +1 -1
  71. package/dist/assets/{index-DKH4PK2B.js → index-BH7Z90Ry.js} +16554 -16011
  72. package/dist/assets/{index-BMy5YH8G.js → index-BwG9RDJd.js} +1 -1
  73. package/dist/assets/{index-yiW1aZfy.js → index-DaYn0dIv.js} +2 -2
  74. package/dist/assets/{index-CKiMoeFX.js → index-Diiw4rJ6.js} +1 -1
  75. package/dist/assets/{index-BVHBHjSe.js → index-_EB0AYfG.js} +1 -1
  76. package/dist/assets/{index-XRUedCJ0.js → index-n9iskFtR.js} +1 -1
  77. package/dist/assets/{index-C1KaIuMT.js → index-nMXCGK26.js} +1 -1
  78. package/dist/assets/{index-w09kaOHP.js → index-xAn5v5dB.js} +1 -1
  79. package/dist/assets/{lexical-CMNdypK6.js → lexical-CUqOWG_f.js} +1 -1
  80. package/dist/assets/{liveblocks-e6rGc1UF.js → liveblocks-2F3ER8H4.js} +1 -1
  81. package/dist/assets/{lottie-B778bt56.js → lottie-Do5BYuHO.js} +1 -1
  82. package/dist/assets/{mui-NTaF3UaY.js → mui-DpZKsKJ-.js} +1 -1
  83. package/dist/assets/{pathToGoBack-3T3qt1CN.js → pathToGoBack-IYhrTF3T.js} +1 -1
  84. package/dist/assets/{pdf-Bx92ZlM_.js → pdf-CaVqV5T4.js} +3 -3
  85. package/dist/assets/{pdf-lib-CSbJ_JNk.js → pdf-lib-DgpGz3__.js} +1 -1
  86. package/dist/assets/{plaid-DdTo7m1-.js → plaid-B0sfsJHV.js} +1 -1
  87. package/dist/assets/{pusher-TnSBrmnt.js → pusher-BZ4RRfso.js} +1 -1
  88. package/dist/assets/{react-BRi8TcMI.js → react-B40uyjvd.js} +1 -1
  89. package/dist/assets/{react-COkaiBQo.js → react-BlQV6oEC.js} +1 -1
  90. package/dist/assets/{react-Ba46BK4D.js → react-CM6JlJfX.js} +1 -1
  91. package/dist/assets/{react-Ci1ltUcy.js → react-CVdpmzlC.js} +1 -1
  92. package/dist/assets/{react-DJOUavGZ.js → react-Cx2vmGsH.js} +1 -1
  93. package/dist/assets/{react-B75Gnqob.js → react-cC2pOmRW.js} +1 -1
  94. package/dist/assets/{recharts-C6xUtcdL.js → recharts-lgPPofcu.js} +1 -1
  95. package/dist/assets/routePaths-DuFLBwyX.js +1 -0
  96. package/dist/assets/{sentry-DsyKtMW2.js → sentry-Dwi3Xpu2.js} +1 -1
  97. package/dist/assets/{stripSplatSuffix-CKrdD9MQ.js → stripSplatSuffix-Cm_Bj9mb.js} +1 -1
  98. package/dist/assets/{url-Zl9uXQ4e.js → url-B3IdPeRD.js} +1 -1
  99. package/dist/assets/{url-ClJewK9Y.js → url-CuCw2GYz.js} +1 -1
  100. package/dist/assets/useActualMatchingMatchDetail-CTL9QRWv.js +1 -0
  101. package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-B1hI9_5p.js +1 -0
  102. package/dist/assets/useAskAiCfoHostNavButtonProps-B82QOIYm.js +1 -0
  103. package/dist/assets/{useChargeCardPusherEvents-BWi4_PP5.js → useChargeCardPusherEvents-CNgbxhoK.js} +1 -1
  104. package/dist/assets/{useDeviceId-VsdzmSZI.js → useDeviceId-Dklpg4lb.js} +1 -1
  105. package/dist/assets/useEmailConnectResultRefresh-BfOhSDOo.js +1 -0
  106. package/dist/assets/useEnsureVendorListLoaded-BtOYIHPo.js +1 -0
  107. package/dist/assets/{useInitialThreadRequest-DDr_z_RH.js → useInitialThreadRequest-DagpMHc1.js} +1 -1
  108. package/dist/assets/useTaskManagerAccess-DvrYqbN3.js +1 -0
  109. package/dist/assets/{useTaskManagerPusherEvents-DCIopLVZ.js → useTaskManagerPusherEvents-Be2DL4pK.js} +1 -1
  110. package/dist/assets/{utils-CCA3F0sZ.js → utils-DAgs23EZ.js} +1 -1
  111. package/dist/assets/withTransactionSidePanel-Dn8x-lme.js +25 -0
  112. package/dist/assets/{zeni-epic-state-BO3zdDfL.js → zeni-epic-state-DtY6MD5C.js} +6 -6
  113. package/dist/index.html +1 -1
  114. package/package.json +4 -4
  115. package/dist/assets/ActualMatchingMatchDetailScreen-CT_TfQgQ.js +0 -1
  116. package/dist/assets/AddressRoutes-CisWqyoC.js +0 -1
  117. package/dist/assets/AddressScreen-CrINuapd.js +0 -9
  118. package/dist/assets/AiCfoScreen-BXw0LDjo.js +0 -22
  119. package/dist/assets/BillPayApprovalRoutes-Dp_PkbIk.js +0 -1
  120. package/dist/assets/CompanyPassportScreen-CENbDnLW.js +0 -1
  121. package/dist/assets/ConnectionAuthScreen-DTyZxcME.js +0 -11
  122. package/dist/assets/CustomerOnboardingAuthScreen-zLmHJyqv.js +0 -1
  123. package/dist/assets/DefaultTenantHome-Dm9FOXup.js +0 -1
  124. package/dist/assets/DomesticWireDetailScreen-086WQWRB.js +0 -18
  125. package/dist/assets/EntityDetailRoutes-BuN3sXNp.js +0 -1
  126. package/dist/assets/ExpenseAutomationRoutes-Ce3IicTe.js +0 -38
  127. package/dist/assets/FeaturePreviewScreen-D54Nwanb.js +0 -1
  128. package/dist/assets/HubSpotOAuthCallbackScreen-BRUwb2B6.js +0 -1
  129. package/dist/assets/InvoicingRoutes-IQsFojD0.js +0 -2
  130. package/dist/assets/MagicLinkSignInScreen-9LYlxmop.js +0 -12
  131. package/dist/assets/MobileAppDrawer-DX2JnkbM.js +0 -1
  132. package/dist/assets/NotFoundScreen-CtgFRYZy.js +0 -1
  133. package/dist/assets/OAuthConsentScreen-BmiLDdxn.js +0 -1
  134. package/dist/assets/PandLWithForecastRoutes-DAq9XRB1.js +0 -1
  135. package/dist/assets/PeopleRoutes-DgYtveDU.js +0 -22
  136. package/dist/assets/PerformanceRoutes-B6iTINLg.js +0 -1
  137. package/dist/assets/ReimbursementApprovalRoutes-CE6y6IwA.js +0 -1
  138. package/dist/assets/ReimbursementApprovalRuleDetailScreen-BT_O_PEv.js +0 -1
  139. package/dist/assets/ReimbursementRoutes-BmOT-3C-.js +0 -68
  140. package/dist/assets/RewardsRoutes-D5CR9NnI.js +0 -1
  141. package/dist/assets/ScreenRoutes-xDjhbdP1.js +0 -2
  142. package/dist/assets/SignInScreen-ekGlkjLH.js +0 -1
  143. package/dist/assets/SignOutScreen-9NJIr2hr.js +0 -9
  144. package/dist/assets/TransactionDetailRoutes-D99Yv6kv.js +0 -1
  145. package/dist/assets/TransactionListRoutes-BTidVr9Z.js +0 -1
  146. package/dist/assets/WiseConfirmationScreen-B0HeU8Sh.js +0 -12
  147. package/dist/assets/ZeniAccountStatementScreen-BnpFJ5jB.js +0 -9
  148. package/dist/assets/analytics-C3e3An3a.js +0 -68
  149. package/dist/assets/epic-BW8jUHg5.js +0 -2
  150. package/dist/assets/expenseAutomationHelper-kGR6VZFG.js +0 -1
  151. package/dist/assets/routePaths-CGyE-cU7.js +0 -1
  152. package/dist/assets/useActualMatchingMatchDetail-Cc17Q5Tv.js +0 -1
  153. package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-CHbHmZzx.js +0 -1
  154. package/dist/assets/useAskAiCfoHostNavButtonProps-BcCbRGDK.js +0 -1
  155. package/dist/assets/useEmailConnectResultRefresh-ClXdZp-6.js +0 -1
  156. package/dist/assets/useTaskManagerAccess-CUv6a62x.js +0 -1
  157. package/dist/assets/withTransactionSidePanel-B_xgLNm6.js +0 -25
@@ -0,0 +1 @@
1
+ import{j as B}from"./liveblocks-2F3ER8H4.js";import{a as f}from"./sentry-Dwi3Xpu2.js";import{u as te,j as t,i as $e,g as Ge,h as Ue,q as F}from"./core-BmXpopk3.js";import{fF as ne,U8 as Me,U9 as se,g9 as xe,fE as Ne,Ui as Pe,Ub as Re,Uc as Ve,p$ as Le,gm as Oe,Uf as b,Uk as je,Ul as Q,gn as Ze,Um as ze,Eb as qe,h1 as He,cV as Ye,Un as Je,g8 as We,go as Ke}from"./zeni-epic-state-DtY6MD5C.js";import{w as Qe,i as Xe,c as ea,d as aa,e as ta,g as na,u as sa,$ as c,h as oa,l as ia,z as ra,f as da,o as ca,q as la,v as ua,r as fa,s as X,L as ma,D as ha,F as ba,p as S,m as ee,y as pa,J as ae,B as ga,C as Sa}from"./index-BH7Z90Ry.js";import{D as Ea}from"./mui-DpZKsKJ-.js";import{u as ka}from"./InboxNotificationsProvider-jZPrqdDf.js";import{u as Ca}from"./useTaskManagerAccess-DvrYqbN3.js";(function(){try{var l=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new l.Error().stack;i&&(l._sentryDebugIds=l._sentryDebugIds||{},l._sentryDebugIds[i]="a3986ffe-4504-42ab-ae8b-8f022fae82b1",l._sentryDebugIdIdentifier="sentry-dbid-a3986ffe-4504-42ab-ae8b-8f022fae82b1")}catch{}})();const Ta=Qe((({isAppContentDrawerOpen:l,handleDrawerToggle:i})=>{const{tenantEmailDomain:s}=$e(),a=Ge(),E=ea(),n=Ue(),D=xe(),r=te(),{useFeatureGate:d}=aa(),p=ta(),{isTaskManagerAccessEnabled:k}=Ca(p),o=t((e=>ne(e))),oe=o.masterTOSInfo?.isMasterTOSAccepted??!1,$=t((e=>Ne(e))),{status:ie}=t(Pe),G=$.uiState.currentChatSessionId,C=na(),{setLoading:re}=sa(),[w,U]=f.useState(void 0),v=F("/:tenantEmailDomain/dashboard")!==null,M=F("/:tenantEmailDomain/reports")!==null,m=F("/:tenantEmailDomain/onboarding/*")!==null,de=!!o.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:ce}=d(c.isChargeCardFeatureEnabled),{isFeatureEnabled:x}=d(c.isDebitCardFeatureEnabled),le=oa(o,ce,x),{isFeatureEnabled:ue}=d(c.isSettingsFeatureEnabled),N=t((e=>Re(e))),{isFeatureEnabled:T}=d(c.isReferralFeatureEnabled),A=t((e=>Ve(e)));f.useEffect((()=>{C&&T&&!m&&A.fetchState==="Not-Started"&&r(Le(!0))}),[C,T,A.fetchState,m]);const _=t((e=>e.tenantState)),fe=t((e=>_.fetchState==="Completed"?Oe(e):[])),g=t((e=>e.expenseAutomationViewState.selectedPeriodByTenantId)),{isFeatureEnabled:me}=d(c.isApAgingFeatureEnabled),{isFeatureEnabled:he}=d(c.isArAgingFeatureEnabled),P=ia(),{isFeatureEnabled:be}=d(c.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:pe}=d(c.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:ge}=d(c.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:Se}=d(c.isDashboardSidebarNewYearAnimationEnabled),Ee=o.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",ke=t((e=>b(e).totalUnreadCount)),Ce=t((e=>b(e).reducedFetchCountState)),R=t((e=>b(e).notificationDetailsByTab.tasks.uiState.unreadCount)),V=t((e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount)),L=t((e=>b(e).notificationDetailsByTab.tasks.fetchCountState)),I=t((e=>b(e).notificationDetailsByTab.comments.fetchCountState)),{inboxNotifications:O,isLoading:j,isFetchingMore:Z,hasFetchedAll:z,fetchMore:Te}=ka();f.useEffect((()=>{const e=setTimeout((()=>Te?.()),0);return()=>clearTimeout(e)})),f.useEffect((()=>{if(j===!1&&Z===!1&&z===!0)if(o?.companyId!=null&&O!=null){const e=`dashboard_${o.companyId}`;U(O.filter((u=>u.roomId===e&&u.readAt==null)).length)}else U(0)}),[j,Z,z]),f.useEffect((()=>{C&&k&&!m&&L.fetchState==="Not-Started"&&D.tenantId!=null&&r(je("task_manager","dashboard"))}),[C,k,m,L.fetchState,D.tenantId,r]),f.useEffect((()=>{m||I.fetchState!=="Not-Started"||r(Q({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))}),[m,I.fetchState,r]),f.useEffect((()=>{w!=null&&I.fetchState==="In-Progress"&&(r(Q({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),r(se({unreadCount:w},"comments")))}),[w,I.fetchState]);const Ie={fetchStatus:Ce,count:ke},q=s!=null?ra.getSignedInUserTenant(s):null,H=t((e=>q?.tenantId!=null?Ze(e,q.tenantId):void 0)),h=[];me===!1&&h.push("accounts_payable_aging"),he===!1&&h.push("accounts_receivable_aging"),h.push("zeni_accounts_promo_card","treasury_promo_card"),T===!1&&h.push("rewards_card"),P===!1&&h.push("expense_automation_card");const Y=t((e=>ze(e,h).fetchState)),J=t((e=>qe(e).fetchState)),ye=v&&(Y==="Completed"||Y==="Error")||M&&(J==="Completed"||J==="Error")||!v&&!M?void 0:"disabled",we=f.useMemo((()=>He(o.userRole)),[o.userRole]),ve=Ye(we),Ae=o?.rewardsLastViewedTime==null,_e=p?.userEmail!=null&&N.fetchState==="Completed"&&Je(N.notificationSettings,p.userEmail,x,o,k),W=da(),Fe=W&&ca(a);return B.jsx(Ea,{container:window.document.body,variant:"temporary",open:l,onClose:()=>i(!1),PaperProps:{sx:{width:240,zIndex:8,borderRight:"none",backgroundImage:"none"}},ModalProps:{keepMounted:!0},children:B.jsx(la,{signedInUser:p,currentTenantId:_.currentTenantId??"",tenants:_.fetchState==="Completed"?fe:H!=null?[H]:[],currentTenant:o,isTenantDropdownDisabled:ye,isSettings:X(a),isInvoicing:fa(a)&&ie==="completed",isSettingsFeatureEnabled:ue,isVendorsTabVisible:ve,isZeniAccountEnabled:de,isChargeCardEnabled:le,isTreasuryEnabled:Ee,isNotificationsTabVisible:_e,notificationCountDetails:Ie,isExpenseAutomationEnabledForUser:P,selectedMenu:ua(a),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:Ae,rewardsPlan:A.rewardsPlan},isAiCfoAccessEnabled:W,onNotificationIconClick:()=>{i(!1);let e=R===0&&V>0?"notifications/comments":"notifications/tasks";X(a)&&(e=R===0&&V>0?"../../notifications/comments":"../../notifications/tasks");const u=S(a.state?.pathnameStackToGoBack,a.pathname);n(e,{state:{pathnameStackToGoBack:u}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{i(!1);const e=S(a.state?.pathnameStackToGoBack,a.pathname);n("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMenuChange:e=>{if(i(!1),s==null)return;if(e.type==="invoicing")return void n(`../${s}/invoicing/overview`,{state:{pathnameStackToGoBack:S(a.state?.pathnameStackToGoBack,a.pathname),referrer:"Sidebar"}});if(e.type==="ai_cfo"){if(ee.trackAICFOChatScreenStateChanged("viewed","left_menu",G??null,null),!oe)return void pa({location:a,navigate:n,mergeState:{referrer:"Sidebar"}});const y=S(a.state?.pathnameStackToGoBack,a.pathname);return void n(`/${s}/ai-cfo/explore`,{state:{pathnameStackToGoBack:y,referrer:"Sidebar"}})}const u=S(a.state?.pathnameStackToGoBack,a.pathname),K=e.type,Be=ae(K)&&K!=="command_center";if(ae(e.type)&&g[o.tenantId]!=null&&ee.trackMonthEndCloseClicked(g[o.tenantId].month,g[o.tenantId].year,"Sidebar"),Be&&g[o.tenantId]!=null){const y=g[o.tenantId];return void n(`/${s}/month_end_close_checks/review/${e.type}/${y.month}-${y.year}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})}const De=ga(e.type);Sa(e.type)?(G!=null&&r(Ke()),n(`/${s}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):n(`/${s}/${De}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})},handleMyProfileClick:()=>{i(!1),n(`/${s}/settings/my_profile`)},handleReferralsClick:()=>{i(!1),n(`/${s}/rewards`)},handleBackClick:()=>{n(`/${s}/dashboard`)},handleTenantSelect:e=>{re(ma.TENANT_SWITCHING),i(!1),ha({dispatch:r,navigate:n,pathToNavigate:ba(e.tenantEmailDomain,a),selectedTenant:e,signedInUser:p})},onZeniLogoClick:()=>{E.toggle()},isAiCfo:Fe,aiCfoView:$,isOnDashboard:v,updateCurrentChatSessionId:e=>{r(We({sessionId:e,agentId:"controller"})),n(`/${s}/ai-cfo/${e}`,{state:{...a.state}})},halloweenAnimationEnabled:be,isTaskManagerAccessEnabled:k,thanksGivingAnimationEnabled:pe,christmasAnimationEnabled:ge,newYearAnimationEnabled:Se})})})),Da=l=>{const i=te(),s=t((E=>ne(E))),a={events:s.userRoleId!=null?[`private-encrypted-${s.userRoleId}.dashboard-user-notification`]:[],eventCallback:(E,n)=>{Xe(n)&&Me(n.mode)==="dashboard"&&i(se({unreadCount:n.data.unread},"tasks"))}};return B.jsx(Ta,{...l,...a})};export{Da as M};
@@ -0,0 +1 @@
1
+ import{j as e}from"./liveblocks-2F3ER8H4.js";import{h as r,l as n}from"./core-BmXpopk3.js";import{an as i}from"./index-BH7Z90Ry.js";import"./mui-DpZKsKJ-.js";import"./sentry-Dwi3Xpu2.js";import"./zeni-epic-state-DtY6MD5C.js";import"./recharts-lgPPofcu.js";import"./analytics-CVpLIXYS.js";import"./plaid-B0sfsJHV.js";import"./dnd-CFbFq_On.js";import"./stripe-cKAAJElX.js";import"./lottie-Do5BYuHO.js";import"./lexical-CUqOWG_f.js";import"./pdf-CaVqV5T4.js";import"./utils-DAgs23EZ.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new o.Error().stack;t&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[t]="3be885cb-07f5-4896-9ae7-ddcb5a1e09f4",o._sentryDebugIdIdentifier="sentry-dbid-3be885cb-07f5-4896-9ae7-ddcb5a1e09f4")}catch{}})();const a=n(null,(function(o,t){return{onGoBack:()=>{t.navigate(-1)},onGoHome:()=>{t.navigate("/")}}}))(i);function _(){const o=r();return e.jsx(a,{navigate:o})}export{_ as default};
@@ -1 +1 @@
1
- import{n as mt,b as lt,o as ft,j as N}from"./liveblocks-e6rGc1UF.js";import ut from"./NotFoundScreen-CtgFRYZy.js";import{a as k}from"./sentry-DsyKtMW2.js";import{h as ht,g as pt,i as kt,u as gt,j as b,l as bt,n as St,o as Y}from"./core-CHD8T-IM.js";import{cA as It,U1 as J,fF as K,h1 as Tt,U5 as S,a0$ as Q,Ub as m,T$ as y,Ar as j,G8 as Ct,a10 as At,T_ as yt,Ud as Et,Aw as _t,a11 as $,br as F,gh as x,AA as z,a12 as Nt,cM as wt,cF as Bt}from"./zeni-epic-state-BO3zdDfL.js";import{ar as xt,c as Ut,N as vt,f as Dt,at as Rt,dL as Gt,p as w,dM as Pt,w as Mt,dN as $t,i as Ft,a5 as jt}from"./index-DKH4PK2B.js";import"./mui-NTaF3UaY.js";import{u as Vt}from"./useAskAiCfoHostNavButtonProps-BcCbRGDK.js";import{u as Lt}from"./useTaskManagerAccess-CUv6a62x.js";import"./recharts-C6xUtcdL.js";import"./analytics-C3e3An3a.js";import"./plaid-DdTo7m1-.js";import"./dnd-Dwi6R-ey.js";import"./stripe-cKAAJElX.js";import"./lottie-B778bt56.js";import"./lexical-CMNdypK6.js";import"./pdf-Bx92ZlM_.js";import"./utils-CCA3F0sZ.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new t.Error().stack;l&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[l]="6ef0b39a-6948-4438-8d28-e0fb0fcfeaf3",t._sentryDebugIdIdentifier="sentry-dbid-6ef0b39a-6948-4438-8d28-e0fb0fcfeaf3")}catch{}})();const Wt=(t,l)=>new Promise(((n,h)=>{const g=t.map((c=>new Promise((o=>{l(c),o()}))));Promise.all(g).then((()=>{setTimeout((()=>{n()}),2e3)})).catch((c=>{h(c)}))})),qt=bt((function(t,l){const n=J(t),{signedInUser:h,isDebitCardFeatureEnabled:g,isTaskManagerAccessEnabled:c}=l,o=S(t),f=K(t),{currentTab:I}=o;return{notificationView:o,isNotificationSettingsVisible:h.userEmail!=null&&Et(n.notificationSettings,h.userEmail,g,f,c),isDisabled:o.notificationDetailsByTab[I].fetchState==="In-Progress"?"disabled":void 0}}),(function(t,l){const{location:n,tenantEmailDomain:h,loggedInUserRoleMap:g,externalNotificationsUnreadCount:c,allUnreadCommentsNotificationIds:o,navigate:f,markInboxNotificationAsRead:I,fetchMoreCommentsNotifications:v}=l;return{onNotificationClick:(a,s,d,r)=>{if(r==="task_deleted"){const i=`/${h}/tasks`,T=w(n.state?.pathnameStackToGoBack,n.pathname);f(i,{state:{pathnameStackToGoBack:T,message:"triggerBackClick"}})}else{const i=`/${h}/tasks/${s}`,T=w(n.state?.pathnameStackToGoBack,n.pathname);f(i,{state:{pathnameStackToGoBack:T,message:"triggerBackClick"}})}d==="unread"&&t(z("task_manager","read",[a],!1))},onCommentNotificationClick:(a,s,d)=>{const r=s.toString().split(`/${h}/`);if(r[1]!=null){d==="unread"&&(I(a),t($([a],F())));let i=`/${h}/${r[1]}`;const T=w(n.state?.pathnameStackToGoBack,n.pathname);r[1].startsWith("reimbursement")&&!wt(g)&&(i="not-found"),r[1].startsWith("bill")&&!Bt(g)&&(i="not-found"),f(i,{state:{pathnameStackToGoBack:T,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(a,s)=>{t(y(a,s))},onUpdateNotificationTabState:(a,s)=>{t(m(a,s))},onUpdateNotificationViewCurrentTabAndSubTab:(a,s)=>{t(Q(a,s));const d=`../${a}`,r=w(n.state?.pathnameStackToGoBack,n.pathname);f(d,{state:{pathnameStackToGoBack:r}})},onUpdateNotificationViewSubTab:a=>{t(Nt(a))},onFetchMoreNotifications:(a,s)=>{if(a==="tasks"){const d=[];s==="all"?d.push("read","unread"):s!=="mentions"&&d.push(s),t(j("task_manager","dashboard",d))}else v?.()},onUpdateNotificationStatus:(a,s,d,r)=>{a==="tasks"?t(z("task_manager",d,r)):(t(m({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(r.map((i=>{d==="read"&&(I(i),t($([i],F())))}))).then((()=>{t(m({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(y({unreadCount:c-r.length>0?c-r.length:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}),(i=>{t(m({markAsReadState:{fetchState:"Error",error:i}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})).catch((i=>{t(m({markAsReadState:{fetchState:"Error",error:i}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})))},onMarkAllNotificationsAsRead:a=>{a==="tasks"?t(_t("task_manager","read")):(t(m({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Wt(o,I).then((()=>{t($(o,F())),t(m({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(y({unreadCount:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))})).catch((s=>{t(m({markAsAllReadState:{fetchState:"Error",error:s}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})))},onBackClick:()=>{const a=jt(n.state?.pathnameStackToGoBack),s=a.poppedPathname??"../../dashboard";f(s,{state:{pathnameStackToGoBack:a.newStack}})},onSettingsClick:()=>{const a=w(n.state?.pathnameStackToGoBack,n.pathname);f("../../settings/notifications",{state:{pathnameStackToGoBack:a}})}}}))(Mt($t)),Ht=()=>{const t=ht(),l=pt(),{tenantEmailDomain:n,selectedTab:h}=kt(),{areTenantIdsInSync:g}=xt(),c=It(h??""),o=gt(),f=Ut(),[I,v]=k.useState(!1),a=b((e=>J(e))),s=b((e=>K(e))),{useFeatureGate:d}=vt(),{isFeatureEnabled:r}=d(Dt.isDebitCardFeatureEnabled),{isAiCfoAccessEnabled:i,onAskAiCfoClick:T}=Vt({mobileExploreReferrer:"Notifications"});Rt({isDataReady:!0});const Z=Tt(s.userRole);if(s==null||n==null||s.companyId==null)throw Error("Can't access notifications page without current tenant...");if(f==null)throw Error("Can't access notifications page without signed in...");const V=b((e=>S(e).notificationDetailsByTab.tasks.fetchState)),L=b((e=>S(e).currentTab)),D=b((e=>S(e).currentSubTab)),tt=b((e=>S(e).notificationDetailsByTab.comments.fetchCountState)),R=b((e=>S(e).notificationDetailsByTab.comments.fetchState)),et=b((e=>S(e).notificationDetailsByTab.comments.uiState.unreadCount)),at=b((e=>S(e).allExternalNotifications)).filter((e=>e.inboxNotification.readAt==null)).map((e=>e.inboxNotification.id)),st=Gt().allUsers,{inboxNotifications:B,isLoading:E,hasFetchedAll:C,isFetchingMore:G,fetchMore:ot}=mt(),{threads:W,isLoading:q,fetchMore:H,isFetchingMore:O,hasFetchedAll:X}=lt({query:{metadata:{companyId:s.companyId,application:"dashboard"}}});k.useEffect((()=>{if(L!==c&&c!=null&&o(Q(c)),c==null){const e=`../${L}`,p=w(l.state?.pathnameStackToGoBack,l.pathname);t(e,{state:{pathnameStackToGoBack:p}})}}),[c]),k.useEffect((()=>{tt.fetchState==="Not-Started"&&o(m({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))}),[]),k.useEffect((()=>{if(E===!1&&C===!0&&s?.companyId!=null&&B!=null){const e=`dashboard_${s.companyId}`,p=B.filter((A=>A.roomId===e&&A.readAt==null)).length;o(m({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),o(y({unreadCount:p},"comments"))}}),[E,C]),k.useEffect((()=>{V!=="In-Progress"&&g&&o(j("task_manager","dashboard",["read","unread"]))}),[g]),k.useEffect((()=>{const e=setTimeout((()=>ot?.()),0);return()=>clearTimeout(e)}));const P=E||G===!0||C!==!0||E||G===!0||C!==!0;k.useEffect((()=>{P&&R!=="In-Progress"?o(m({fetchState:"In-Progress",error:void 0},"comments")):P||R!=="In-Progress"||o(m({fetchState:"Completed",error:void 0},"comments"))}),[P,R]),k.useEffect((()=>{o(y({hasMore:C!==!0},"comments"))}),[C]),k.useEffect((()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&I===!1&&(v(!0),o(Ct()))}),[a.fetchState]),k.useEffect((()=>{if(E===!1&&q===!1&&B!=null&&W!=null){const e=`dashboard_${s.companyId}`,p=B.filter((u=>u.roomId===e)).filter((u=>Pt(u.kind))),A=p.filter((u=>u.readAt==null)),_=p.map((u=>u.id)),ct=p.map((u=>{const M=W.find((dt=>{return dt.id===((U=u).kind==="thread"?U.threadId:"subjectId"in U?U.subjectId:void 0);var U}));return M!=null?{inboxNotification:{...u,threadId:M.id},thread:M}:(O||X===!0||H==null||H(),null)})).filter((u=>u!=null));o(m({allNotificationsIds:_},"comments")),o(y({totalCount:_.length,unreadCount:A.length},"comments")),o(At(ct))}}),[E,G,O,C,X,q,B?.length]);const nt={events:s.userRoleId!=null?[`private-encrypted-${s.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if(Ft(p)){const A=yt(p.mode);if(A==="dashboard"&&o(y({unreadCount:p.data.unread},"tasks")),V!=="In-Progress"){const _=[];D==="all"?_.push("read","unread"):D!=="mentions"&&_.push(D),o(j("task_manager",A,_,!0))}}}},it=ft(),{isTaskManagerAccessEnabled:rt}=Lt(f);return N.jsx(qt,{tenantEmailDomain:n,loggedInUserRoleMap:Z,signedInUser:f,externalNotificationsUnreadCount:et,location:l,navigate:t,isDebitCardFeatureEnabled:r,isTaskManagerAccessEnabled:rt,users:st,markInboxNotificationAsRead:it,allUnreadCommentsNotificationIds:at,isAiCfoAccessEnabled:i,onAskAiCfoClick:T,...nt})};function me(){return N.jsxs(St,{children:[N.jsx(Y,{path:"/:selectedTab",element:N.jsx(Ht,{})}),N.jsx(Y,{path:"*",element:N.jsx(ut,{})})]})}export{me as default};
1
+ import{n as mt,b as lt,o as ft,j as N}from"./liveblocks-2F3ER8H4.js";import ut from"./NotFoundScreen-CjcmfT5h.js";import{a as k}from"./sentry-Dwi3Xpu2.js";import{h as ht,g as pt,i as kt,u as gt,j as b,l as bt,n as St,o as X}from"./core-BmXpopk3.js";import{cA as It,Ub as z,fF as J,h1 as Tt,Uf as S,a1e as Q,Ul as m,U9 as y,Ar as j,G8 as Ct,a1f as At,U8 as yt,Un as Et,Aw as _t,a1g as F,br as $,gh as x,AA as Y,a1h as Nt,cM as wt,cF as Bt}from"./zeni-epic-state-DtY6MD5C.js";import{ar as xt,e as Ut,d as vt,$ as Dt,at as Rt,dM as Gt,p as w,dN as Pt,w as Mt,dO as Ft,i as $t,a5 as jt}from"./index-BH7Z90Ry.js";import"./mui-DpZKsKJ-.js";import{u as Vt}from"./useAskAiCfoHostNavButtonProps-B82QOIYm.js";import{u as Wt}from"./useTaskManagerAccess-DvrYqbN3.js";import"./recharts-lgPPofcu.js";import"./analytics-CVpLIXYS.js";import"./plaid-B0sfsJHV.js";import"./dnd-CFbFq_On.js";import"./stripe-cKAAJElX.js";import"./lottie-Do5BYuHO.js";import"./lexical-CUqOWG_f.js";import"./pdf-CaVqV5T4.js";import"./utils-DAgs23EZ.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new t.Error().stack;l&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[l]="da726a00-fc7b-4061-b1cb-3e62e828ff15",t._sentryDebugIdIdentifier="sentry-dbid-da726a00-fc7b-4061-b1cb-3e62e828ff15")}catch{}})();const qt=(t,l)=>new Promise(((n,h)=>{const g=t.map((c=>new Promise((o=>{l(c),o()}))));Promise.all(g).then((()=>{setTimeout((()=>{n()}),2e3)})).catch((c=>{h(c)}))})),Lt=bt((function(t,l){const n=z(t),{signedInUser:h,isDebitCardFeatureEnabled:g,isTaskManagerAccessEnabled:c}=l,o=S(t),f=J(t),{currentTab:I}=o;return{notificationView:o,isNotificationSettingsVisible:h.userEmail!=null&&Et(n.notificationSettings,h.userEmail,g,f,c),isDisabled:o.notificationDetailsByTab[I].fetchState==="In-Progress"?"disabled":void 0}}),(function(t,l){const{location:n,tenantEmailDomain:h,loggedInUserRoleMap:g,externalNotificationsUnreadCount:c,allUnreadCommentsNotificationIds:o,navigate:f,markInboxNotificationAsRead:I,fetchMoreCommentsNotifications:v}=l;return{onNotificationClick:(a,s,d,r)=>{if(r==="task_deleted"){const i=`/${h}/tasks`,T=w(n.state?.pathnameStackToGoBack,n.pathname);f(i,{state:{pathnameStackToGoBack:T,message:"triggerBackClick"}})}else{const i=`/${h}/tasks/${s}`,T=w(n.state?.pathnameStackToGoBack,n.pathname);f(i,{state:{pathnameStackToGoBack:T,message:"triggerBackClick"}})}d==="unread"&&t(Y("task_manager","read",[a],!1))},onCommentNotificationClick:(a,s,d)=>{const r=s.toString().split(`/${h}/`);if(r[1]!=null){d==="unread"&&(I(a),t(F([a],$())));let i=`/${h}/${r[1]}`;const T=w(n.state?.pathnameStackToGoBack,n.pathname);r[1].startsWith("reimbursement")&&!wt(g)&&(i="not-found"),r[1].startsWith("bill")&&!Bt(g)&&(i="not-found"),f(i,{state:{pathnameStackToGoBack:T,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(a,s)=>{t(y(a,s))},onUpdateNotificationTabState:(a,s)=>{t(m(a,s))},onUpdateNotificationViewCurrentTabAndSubTab:(a,s)=>{t(Q(a,s));const d=`../${a}`,r=w(n.state?.pathnameStackToGoBack,n.pathname);f(d,{state:{pathnameStackToGoBack:r}})},onUpdateNotificationViewSubTab:a=>{t(Nt(a))},onFetchMoreNotifications:(a,s)=>{if(a==="tasks"){const d=[];s==="all"?d.push("read","unread"):s!=="mentions"&&d.push(s),t(j("task_manager","dashboard",d))}else v?.()},onUpdateNotificationStatus:(a,s,d,r)=>{a==="tasks"?t(Y("task_manager",d,r)):(t(m({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(r.map((i=>{d==="read"&&(I(i),t(F([i],$())))}))).then((()=>{t(m({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(y({unreadCount:c-r.length>0?c-r.length:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}),(i=>{t(m({markAsReadState:{fetchState:"Error",error:i}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})).catch((i=>{t(m({markAsReadState:{fetchState:"Error",error:i}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})))},onMarkAllNotificationsAsRead:a=>{a==="tasks"?t(_t("task_manager","read")):(t(m({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),qt(o,I).then((()=>{t(F(o,$())),t(m({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(y({unreadCount:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))})).catch((s=>{t(m({markAsAllReadState:{fetchState:"Error",error:s}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})))},onBackClick:()=>{const a=jt(n.state?.pathnameStackToGoBack),s=a.poppedPathname??"../../dashboard";f(s,{state:{pathnameStackToGoBack:a.newStack}})},onSettingsClick:()=>{const a=w(n.state?.pathnameStackToGoBack,n.pathname);f("../../settings/notifications",{state:{pathnameStackToGoBack:a}})}}}))(Mt(Ft)),Ht=()=>{const t=ht(),l=pt(),{tenantEmailDomain:n,selectedTab:h}=kt(),{areTenantIdsInSync:g}=xt(),c=It(h??""),o=gt(),f=Ut(),[I,v]=k.useState(!1),a=b((e=>z(e))),s=b((e=>J(e))),{useFeatureGate:d}=vt(),{isFeatureEnabled:r}=d(Dt.isDebitCardFeatureEnabled),{isAiCfoAccessEnabled:i,onAskAiCfoClick:T}=Vt({mobileExploreReferrer:"Notifications"});Rt({isDataReady:!0});const Z=Tt(s.userRole);if(s==null||n==null||s.companyId==null)throw Error("Can't access notifications page without current tenant...");if(f==null)throw Error("Can't access notifications page without signed in...");const V=b((e=>S(e).notificationDetailsByTab.tasks.fetchState)),W=b((e=>S(e).currentTab)),D=b((e=>S(e).currentSubTab)),tt=b((e=>S(e).notificationDetailsByTab.comments.fetchCountState)),R=b((e=>S(e).notificationDetailsByTab.comments.fetchState)),et=b((e=>S(e).notificationDetailsByTab.comments.uiState.unreadCount)),at=b((e=>S(e).allExternalNotifications)).filter((e=>e.inboxNotification.readAt==null)).map((e=>e.inboxNotification.id)),st=Gt().allUsers,{inboxNotifications:B,isLoading:E,hasFetchedAll:C,isFetchingMore:G,fetchMore:ot}=mt(),{threads:q,isLoading:L,fetchMore:H,isFetchingMore:K,hasFetchedAll:O}=lt({query:{metadata:{companyId:s.companyId,application:"dashboard"}}});k.useEffect((()=>{if(W!==c&&c!=null&&o(Q(c)),c==null){const e=`../${W}`,p=w(l.state?.pathnameStackToGoBack,l.pathname);t(e,{state:{pathnameStackToGoBack:p}})}}),[c]),k.useEffect((()=>{tt.fetchState==="Not-Started"&&o(m({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))}),[]),k.useEffect((()=>{if(E===!1&&C===!0&&s?.companyId!=null&&B!=null){const e=`dashboard_${s.companyId}`,p=B.filter((A=>A.roomId===e&&A.readAt==null)).length;o(m({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),o(y({unreadCount:p},"comments"))}}),[E,C]),k.useEffect((()=>{V!=="In-Progress"&&g&&o(j("task_manager","dashboard",["read","unread"]))}),[g]),k.useEffect((()=>{const e=setTimeout((()=>ot?.()),0);return()=>clearTimeout(e)}));const P=E||G===!0||C!==!0||E||G===!0||C!==!0;k.useEffect((()=>{P&&R!=="In-Progress"?o(m({fetchState:"In-Progress",error:void 0},"comments")):P||R!=="In-Progress"||o(m({fetchState:"Completed",error:void 0},"comments"))}),[P,R]),k.useEffect((()=>{o(y({hasMore:C!==!0},"comments"))}),[C]),k.useEffect((()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&I===!1&&(v(!0),o(Ct()))}),[a.fetchState]),k.useEffect((()=>{if(E===!1&&L===!1&&B!=null&&q!=null){const e=`dashboard_${s.companyId}`,p=B.filter((u=>u.roomId===e)).filter((u=>Pt(u.kind))),A=p.filter((u=>u.readAt==null)),_=p.map((u=>u.id)),ct=p.map((u=>{const M=q.find((dt=>{return dt.id===((U=u).kind==="thread"?U.threadId:"subjectId"in U?U.subjectId:void 0);var U}));return M!=null?{inboxNotification:{...u,threadId:M.id},thread:M}:(K||O===!0||H==null||H(),null)})).filter((u=>u!=null));o(m({allNotificationsIds:_},"comments")),o(y({totalCount:_.length,unreadCount:A.length},"comments")),o(At(ct))}}),[E,G,K,C,O,L,B?.length]);const nt={events:s.userRoleId!=null?[`private-encrypted-${s.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if($t(p)){const A=yt(p.mode);if(A==="dashboard"&&o(y({unreadCount:p.data.unread},"tasks")),V!=="In-Progress"){const _=[];D==="all"?_.push("read","unread"):D!=="mentions"&&_.push(D),o(j("task_manager",A,_,!0))}}}},it=ft(),{isTaskManagerAccessEnabled:rt}=Wt(f);return N.jsx(Lt,{tenantEmailDomain:n,loggedInUserRoleMap:Z,signedInUser:f,externalNotificationsUnreadCount:et,location:l,navigate:t,isDebitCardFeatureEnabled:r,isTaskManagerAccessEnabled:rt,users:st,markInboxNotificationAsRead:it,allUnreadCommentsNotificationIds:at,isAiCfoAccessEnabled:i,onAskAiCfoClick:T,...nt})};function me(){return N.jsxs(St,{children:[N.jsx(X,{path:"/:selectedTab",element:N.jsx(Ht,{})}),N.jsx(X,{path:"*",element:N.jsx(ut,{})})]})}export{me as default};
@@ -0,0 +1 @@
1
+ import{j as m}from"./liveblocks-2F3ER8H4.js";import{a as r}from"./sentry-Dwi3Xpu2.js";import{u as A,g as P,j as o,N as j}from"./core-BmXpopk3.js";import{UO as C,fF as R,gm as x,UP as z,UQ as D,UR as M,US as L,pS as k,Tt as N}from"./zeni-epic-state-DtY6MD5C.js";import{z as h,ai as I}from"./index-BH7Z90Ry.js";import"./mui-DpZKsKJ-.js";import"./recharts-lgPPofcu.js";import"./analytics-CVpLIXYS.js";import"./plaid-B0sfsJHV.js";import"./dnd-CFbFq_On.js";import"./stripe-cKAAJElX.js";import"./lottie-Do5BYuHO.js";import"./lexical-CUqOWG_f.js";import"./pdf-CaVqV5T4.js";import"./utils-DAgs23EZ.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new n.Error().stack;s&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[s]="7bb63142-359d-4f1e-9413-e258ca2fb5bc",n._sentryDebugIdIdentifier="sentry-dbid-7bb63142-359d-4f1e-9413-e258ca2fb5bc")}catch{}})();function ee(){const n=A(),s=P(),{params:t,error:i}=r.useMemo((()=>C(s.search)),[s.search]),b=r.useMemo((()=>new URLSearchParams(s.search).get("client_name")??t?.clientId??"Unknown Application"),[s.search,t]),p=h.isSignedIn(),a=h.getSignedInUser(),f=o((e=>R(e))),l=o((e=>x(e))),d=o((e=>e.tenantState.fetchState)),w=o(z),y=o(D),c=o(M),[S,U]=r.useState(null),[v,E]=r.useState(null);r.useEffect((()=>{document.querySelector("#app-shell-loader")?.remove()}),[]),r.useEffect((()=>()=>{n(L())}),[n,s.search]),r.useEffect((()=>{i!=null&&console.warn("[OAuthConsent] invalid params:",i)}),[i]);const g=r.useRef(!1);r.useEffect((()=>{p&&a!=null&&!g.current&&(d!=="Not-Started"&&d!=="Error"||(g.current=!0,n(k(a.userId,a.zeniSessionId??void 0))))}),[p,a,d,n]),r.useEffect((()=>{c!=null&&c!==""&&(window.location.href=c)}),[c]);const _=r.useMemo((()=>{if(f?.tenantId!=null)return f.tenantId;const e=h.getActiveTenantForUser()?.tenantId;return e!=null&&l.some((T=>T.tenantId===e))?e:l.length===1?l[0].tenantId:null}),[f?.tenantId,l]),u=S??_;return i!=null?m.jsx(I,{variant:"invalid_params",paramsError:i}):p?m.jsx(I,{variant:"signed_in",clientName:b,userEmail:a?.userEmail,isInitializing:d!=="Completed",tenants:l,selectedTenantId:u,onSelectTenant:U,approveError:v??y,isApproving:w==="In-Progress",showAllowButton:u!=null,onApprove:()=>{t!=null&&a!=null&&u!=null&&n(N(a.userId,a.zeniSessionId??void 0,u,t.clientId,t.redirectUri,t.codeChallenge,t.codeChallengeMethod,t.state,t.responseType))},onDeny:()=>{if(t!=null)try{const e=new URL(t.redirectUri);e.searchParams.set("error","access_denied"),e.searchParams.set("error_description","The user denied the request"),e.searchParams.set("state",t.state),window.location.href=e.toString()}catch{E("Unable to deny: redirect_uri is not a valid URL. Close this window or contact support.")}}}):m.jsx(j,{to:"/signin/auth",state:{origin:s.pathname+s.search},replace:!0})}export{ee as default};
@@ -0,0 +1 @@
1
+ import{j as n}from"./liveblocks-2F3ER8H4.js";import{h as Y,u as W,g as z,i as H,j as d,l as Z,n as J,o as S}from"./core-BmXpopk3.js";import{fF as v,Ac as R,v5 as K,VG as M,v0 as T,bq as Q,b$ as X,v1 as ee,VH as ae,Vo as C,ei as te,E0 as se,VI as oe,Eo as re,d_ as ne,dZ as ce}from"./zeni-epic-state-DtY6MD5C.js";import{aj as ie,z as le,ar as de,at as me,O as fe,a9 as pe,m as w,aE as ue,p as he,d as Fe,$ as ge}from"./index-BH7Z90Ry.js";import"./mui-DpZKsKJ-.js";import Ie from"./NotFoundScreen-CjcmfT5h.js";import{F as be}from"./FeaturePreviewScreen-DlYWStt_.js";import{a as F}from"./sentry-Dwi3Xpu2.js";import{u as Se}from"./useAskAiCfoHostNavButtonProps-B82QOIYm.js";import{u as Ce}from"./useInitialThreadRequest-DagpMHc1.js";import{t as Te}from"./routePaths-DuFLBwyX.js";import{M as ye}from"./MobileAppDrawer-thURFqdR.js";import"./recharts-lgPPofcu.js";import"./analytics-CVpLIXYS.js";import"./plaid-B0sfsJHV.js";import"./dnd-CFbFq_On.js";import"./stripe-cKAAJElX.js";import"./lottie-Do5BYuHO.js";import"./lexical-CUqOWG_f.js";import"./pdf-CaVqV5T4.js";import"./utils-DAgs23EZ.js";import"./InboxNotificationsProvider-jZPrqdDf.js";import"./useTaskManagerAccess-DvrYqbN3.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new s.Error().stack;e&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[e]="53810e36-5ec8-4fe3-90ed-45675f7e7cbb",s._sentryDebugIdIdentifier="sentry-dbid-53810e36-5ec8-4fe3-90ed-45675f7e7cbb")}catch{}})();const y=(s,e,a,o)=>{if(s!=e){const r=o??"";s!=null&&s.length>0?a(`../${e}${r}`,{replace:!0}):a(`${e}${r}`,{replace:!0})}},Ae=Z((function(s){const e=ae(s),a={},o=e.pandLReportWithForecast.uiState.nodeCollapseState;return Object.keys(o).forEach((r=>{a[r]=o[r]===!1})),{selectedTimeframe:e.selectedTimeframe,isForecastVsActualOn:e.isForecastVsActualOn,compareMode:e.compareMode,forecastList:e.forecastList,selectedForecast:e.selectedForecast,pandLreport:e.pandLReportWithForecast,scrollPosition:e.pandLReportWithForecast.uiState.scrollPosition,nodeOpenStatus:a,type:"name+balances_forecast",analytics:w}}),(function(s,e){return{onForecastSelectionChanged:(a,o)=>{s(M(a,o)),e.isPandLReportFetched(a)||s(T(a)),y(e.forecastIdFromUrlPath,a,e.navigate)},onTimeframeChanged:a=>{s(re(a))},onForecastVsActualsCompareToggle:a=>{s(oe(a)),s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:{scrollLeft:0,scrollTop:0}}))},onCompareModeChanged:a=>{s(se(e.firstMonthOfFY,a,0,[]))},onAccountBalanceClick:e.hasTransactionAccess!==!0?void 0:(a,o)=>{let r,c;const p=a.accountName===""?a.accountDescription:a.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(r=o.balanceTimeFrame,c=te(o)):o.balanceTimeFrame==="year"?(r="quarter",c={startDate:o.endDate.startOf("quarter"),endDate:o.endDate}):console.error(`timeframe ${o.balanceTimeFrame} is not supported`),c!=null&&r!=null){const u=Te(e.tenantEmailDomain,a.accountId,a.accountType,p,r,c),m=he(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(u,{state:{pathnameStackToGoBack:m,referrer:"Forecast"}})}},onNodeCollapseToggled:(a,o)=>{s(C({forecastId:e.forecastIdFromUrlPath,nodeCollapseState:{nodeId:a,isCollapsed:o===!1}}))},onTableScroll:a=>{s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:a}))},onBackClick:()=>{e.navigate("../../")}}}))(ue);function U(){const s=ie(),e=Y(),a=W(),o=z(),{forecastId:r,tenantEmailDomain:c}=H(),[p,u]=F.useState(!1),[m,A]=F.useState(!1),g=le.getSignedInUser(),x=d((t=>v(t))),_=x.company?.companyInfo.firstMonthOfFY??1,i=d((t=>R(t.forecastState,t.forecastListState))),l=d((t=>t.forecastListState.fetchState==="Completed")),D=d((t=>t.profitAndLossState)),j=d((t=>t.reportUIOptionsState.selectedForecast)),E=t=>D.pandLByForecastID[t]!=null&&ee(t,D).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:I}=de();me({isDataReady:l});const{isAiCfoAccessEnabled:V,onAskAiCfoClick:$}=Se({mobileExploreReferrer:"Forecast"});F.useEffect((()=>{if(!p&&I)u(!0),l||a(K());else if(l&&!m){A(!0);const t=((f,P,O)=>P!=null?f.forecasts.findIndex((b=>b.id===P)):O!=null?f.forecasts.findIndex((b=>b.id===O)):f.forecasts.length>0?0:-1)(i,r,j?.id);t===-1&&r!=null?e("page-not-found",{replace:!0}):t!==-1&&t!=j?.index?(a(M(i.forecasts[t].id,t)),y(r,i.forecasts[t].id,e,o.search)):r==null&&t!==-1&&y(void 0,i.forecasts[t].id,e,o.search),t!==-1&&!E(i.forecasts[t].id)&&I&&a(T(i.forecasts[t].id))}}),[p,u,a,l,i,m,A,R,T,I]);const k=fe(),B=k?.loggedInUserRole!=null&&Q(k.loggedInUserRole),N=Ce(x?.companyId,{clearParams:l&&m}),[q,G]=F.useState(!1),h=new URL(s("forecast_pandl"));h.searchParams.set("firstname",g?.firstName??""),h.searchParams.set("lastname",g?.lastName??""),h.searchParams.set("email",g?.userEmail??"");const L=t=>{G(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(pe,{analytics:w,onLoad:t=>(f=>f.trackForecast())(t)}):null,n.jsx(ye,{isAppContentDrawerOpen:q,handleDrawerToggle:L}),n.jsx(Ae,{firstMonthOfFY:_,tenantEmailDomain:c,forecastIdFromUrlPath:r,navigate:e,location:o,isPandLReportFetched:E,meetingUrl:X(h.toString()),hasTransactionAccess:B,isAiCfoAccessEnabled:V,onAskAiCfoClick:$,initialOpenThreadRequest:N,onClickMenuIcon:()=>{L(!0)}})]})}function He(){const s=d((c=>v(c))),{useFeatureGate:e}=Fe(),{isFeatureEnabled:a}=e(ge.isDebitCardFeatureEnabled),o=ne(a,s),r=ce(s);return o===!0||r===!0?n.jsx(be,{}):n.jsxs(J,{children:[n.jsx(S,{path:"/",element:n.jsx(U,{})}),n.jsx(S,{path:"/:forecastId",element:n.jsx(U,{})}),n.jsx(S,{path:"/:forecastId/*",element:n.jsx(Ie,{})})]})}export{He as default};
@@ -1,21 +1,21 @@
1
- import{j as a}from"./liveblocks-e6rGc1UF.js";import{a as p}from"./sentry-DsyKtMW2.js";import{I as d,J as r,aa as m,ae as f,af as h}from"./index-DKH4PK2B.js";import"./mui-NTaF3UaY.js";import{i as y}from"./core-CHD8T-IM.js";import"./zeni-epic-state-BO3zdDfL.js";import"./recharts-C6xUtcdL.js";import"./analytics-C3e3An3a.js";import"./plaid-DdTo7m1-.js";import"./dnd-Dwi6R-ey.js";import"./stripe-cKAAJElX.js";import"./lottie-B778bt56.js";import"./lexical-CMNdypK6.js";import"./pdf-Bx92ZlM_.js";import"./utils-CCA3F0sZ.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]="66bdd2db-a060-4670-9d3a-ab2391de9900",e._sentryDebugIdIdentifier="sentry-dbid-66bdd2db-a060-4670-9d3a-ab2391de9900")}catch{}})();const g=d("div")`
1
+ import{j as r}from"./liveblocks-2F3ER8H4.js";import{a as p}from"./sentry-Dwi3Xpu2.js";import{H as c,I as a,aa as m,ae as f,af as h}from"./index-BH7Z90Ry.js";import"./mui-DpZKsKJ-.js";import{i as y}from"./core-BmXpopk3.js";import"./zeni-epic-state-DtY6MD5C.js";import"./recharts-lgPPofcu.js";import"./analytics-CVpLIXYS.js";import"./plaid-B0sfsJHV.js";import"./dnd-CFbFq_On.js";import"./stripe-cKAAJElX.js";import"./lottie-Do5BYuHO.js";import"./lexical-CUqOWG_f.js";import"./pdf-CaVqV5T4.js";import"./utils-DAgs23EZ.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]="dbfeba40-fd17-4b7a-8525-982131f9c7c0",e._sentryDebugIdIdentifier="sentry-dbid-dbfeba40-fd17-4b7a-8525-982131f9c7c0")}catch{}})();const g=c("div")`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  width: 100%;
5
5
  min-height: 100vh;
6
6
  background-color: ${e=>e.theme.colors.grey4};
7
- `,b=d("header")`
7
+ `,b=c("header")`
8
8
  flex-shrink: 0;
9
- padding: ${r.sp3} ${r.sp4};
10
- `,k=d(m)`
11
- width: ${r.sp4};
12
- height: ${r.sp4};
9
+ padding: ${a.sp3} ${a.sp4};
10
+ `,k=c(m)`
11
+ width: ${a.sp4};
12
+ height: ${a.sp4};
13
13
  color: ${e=>e.theme.colors.brandColorJade};
14
- `,x=d("main")`
14
+ `,x=c("main")`
15
15
  display: flex;
16
16
  flex: 1 1 auto;
17
17
  flex-direction: column;
18
18
  align-items: center;
19
19
  justify-content: center;
20
- padding: ${r.sp4};
21
- `;function j({children:e}){return a.jsxs(g,{"data-testid":"invoicing-collect-payment-layout",children:[a.jsx(b,{children:a.jsx(k,{"aria-label":"Zeni",role:"img"})}),a.jsx(x,{children:e})]})}class w extends Error{statusCode;constructor(t,o){super(t),this.name="PortalRequestError",this.statusCode=o}}function $(e,t){const o=(function(){const n=h?.invoicingMicroServiceBaseUrl;return`${n!=null&&n.length>0?n:""}/1.0`})(),s={namespace:e,token:t};async function i(n,u){const l=await fetch(`${o}${n}`,{body:JSON.stringify(u),headers:{"Content-Type":"application/json"},method:"POST"}),c=await l.json();if(!l.ok)throw new w(c.status?.message??`Request failed (${l.status}).`,l.status);return c.data}return{checkoutSession:()=>i("/portal/payment-link/checkout-session",s),plaidLinkToken:()=>i("/portal/payment-link/plaid-link-token",s),requestAccess:()=>i("/portal/payment-link/request-access",s),savePaymentMethod:n=>i("/portal/payment-link/payment-methods",{...s,...n}),session:()=>i("/portal/payment-link/session",s),setupIntent:()=>i("/portal/payment-link/setup-intent",s)}}function B(){const{namespace:e="",token:t=""}=y();p.useEffect((()=>{document.querySelector("#app-shell-loader")?.remove()}),[]);const o=p.useMemo((()=>$(e,t)),[e,t]);return a.jsx(j,{children:a.jsx(f,{portal:o})})}export{B as default};
20
+ padding: ${a.sp4};
21
+ `;function j({children:e}){return r.jsxs(g,{"data-testid":"invoicing-collect-payment-layout",children:[r.jsx(b,{children:r.jsx(k,{"aria-label":"Zeni",role:"img"})}),r.jsx(x,{children:e})]})}class w extends Error{statusCode;constructor(t,o){super(t),this.name="PortalRequestError",this.statusCode=o}}function $(e,t){const o=(function(){const n=h?.invoicingMicroServiceBaseUrl;return`${n!=null&&n.length>0?n:""}/1.0`})(),s={namespace:e,token:t};async function i(n,u){const l=await fetch(`${o}${n}`,{body:JSON.stringify(u),headers:{"Content-Type":"application/json"},method:"POST"}),d=await l.json();if(!l.ok)throw new w(d.status?.message??`Request failed (${l.status}).`,l.status);return d.data}return{checkoutSession:()=>i("/portal/payment-link/checkout-session",s),plaidLinkToken:()=>i("/portal/payment-link/plaid-link-token",s),requestAccess:()=>i("/portal/payment-link/request-access",s),savePaymentMethod:n=>i("/portal/payment-link/payment-methods",{...s,...n}),session:()=>i("/portal/payment-link/session",s),setupIntent:()=>i("/portal/payment-link/setup-intent",s)}}function B(){const{namespace:e="",token:t=""}=y();p.useEffect((()=>{document.querySelector("#app-shell-loader")?.remove()}),[]);const o=p.useMemo((()=>$(e,t)),[e,t]);return r.jsx(j,{children:r.jsx(f,{portal:o})})}export{B as default};
@@ -0,0 +1,22 @@
1
+ import{j as a}from"./liveblocks-2F3ER8H4.js";import{VC as re,fF as Q,l$ as G,d_ as Y,dZ as le,St as X,U$ as ce,CX as Pe,VD as N,CM as je,D5 as Le,C$ as de,CQ as pe,D3 as Te,D0 as ve,VE as ue,sq as Ve,g6 as Ae,gD as Fe,VF as _,CU as me,CT as ge,D8 as Oe,c8 as Re}from"./zeni-epic-state-DtY6MD5C.js";import{a2 as Ce,d as J,$ as H,z as K,h as fe,N as he,ag as ye,aA as be,aB as Ue,ac as Se,I as O,ah as De,G as M,aC as Ze,ar as Be,at as $e,a9 as ze,m as we,U as _e,p as He,aD as Ge,O as Ke}from"./index-BH7Z90Ry.js";import{D as xe,n as W,S as Ie}from"./mui-DpZKsKJ-.js";import ae from"./NotFoundScreen-CjcmfT5h.js";import{a as c}from"./sentry-Dwi3Xpu2.js";import{u as ee,i as Me,j as g,h as We,g as qe,l as Ne,n as se,o as z}from"./core-BmXpopk3.js";import{u as Qe}from"./useAskAiCfoHostNavButtonProps-B82QOIYm.js";import{M as Ye}from"./MobileAppDrawer-thURFqdR.js";import"./recharts-lgPPofcu.js";import"./analytics-CVpLIXYS.js";import"./plaid-B0sfsJHV.js";import"./dnd-CFbFq_On.js";import"./stripe-cKAAJElX.js";import"./lottie-Do5BYuHO.js";import"./lexical-CUqOWG_f.js";import"./pdf-CaVqV5T4.js";import"./utils-DAgs23EZ.js";import"./InboxNotificationsProvider-jZPrqdDf.js";import"./useTaskManagerAccess-DvrYqbN3.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]="a45ebe00-83a4-4644-adc0-6579a5ac0b05",e._sentryDebugIdIdentifier="sentry-dbid-a45ebe00-83a4-4644-adc0-6579a5ac0b05")}catch{}})();const Xe={overlayWidth:new Se(100,100,48)},te=M.getLocalizedStrings().peoplePage.invitePage,ne=M.getLocalizedStrings().common,Je=({companyId:e,managersListView:t,companyPassportView:d,classListView:n,mode:C,isEditPeopleDrawerOpen:i,closeDrawerHandler:b})=>{const f=Ce(),m=ee(),[R,U]=c.useState(!1),[k,S]=c.useState(!1),{userId:D}=Me(),r=g((l=>re(l))),p=g((l=>Q(l))),E=g((l=>G(l))),{useFeatureGate:x}=J(),{isFeatureEnabled:I}=x(H.isDebitCardFeatureEnabled),P=Y(I,p),T=le(p),v=X(p),Z=ce(p),B=!!p.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,w=!P&&E&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||d.fetchState!=="Completed"||e==null;if(K.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const h=()=>{m(N()),b()},V=()=>{R===!0?S(!0):h()},$=d.companyView?.controllers?.map((l=>l.user)),u=!!p.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:j}=x(H.isChargeCardFeatureEnabled),L=fe(p,j,I),{isCardsHidden:A}=he(p?.tenantId),y=!L||A,F=p.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",s={peopleDetails:r,classList:n.classes,managersList:t.users,controllersList:$,mode:C,isZeniTenant:v,isAccountingClassesEnabled:E,isReimbursementDisabled:B===!1,isZeniAccountsDisabled:u===!1,isChargeCardDisabled:y,isTreasuryDisabled:F===!1,isLiteRoleDisabled:Z===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:T,onResetClick:h,onDeleteUser:l=>{m(pe(l.userId,l.userRole.userRoleId))},onPeopleLocalDataUpdated:l=>{m(de({peopleLocalData:l})),U(!0)},onSaveClick:()=>{m(C==="zeni_only"?je(e):Le(v))},onCloseClick:V,isLoading:w||r.person==null},o={onOkClick:()=>{S(!1),h()},onCancelClick:()=>{S(!1)}};return c.useEffect((()=>{w===!1&&D!=null&&m(Pe(D))}),[w,D]),c.useEffect((()=>{r.updatePersonState.fetchState==="Completed"&&h()}),[r.updatePersonState.fetchState]),a.jsx(xe,{anchor:"right",open:i,PaperProps:{style:{width:Xe.overlayWidth.valuePercentage(f),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:ye.overlayDark,cursor:"pointer"}}},onClose:V,children:a.jsxs(ea,{onClick:l=>l.stopPropagation(),children:[k===!0?a.jsx(be,{titleComponent:a.jsx(ke,{children:te.discardTitle}),descriptionComponent:a.jsx(Ee,{children:te.discardDescription}),primaryButtonText:ne.yes,secondaryButtonText:ne.no,action:o,isEditPopup:!0}):null,a.jsx(Ue,{...s})]})})},ea=W(Ie)`
2
+ display: flex;
3
+ min-height: 100%;
4
+ flex-direction: column;
5
+ `,ke=W(De.H6Regular)`
6
+ margin-top: ${O.sp7};
7
+ padding-left: ${O.sp8};
8
+ padding-right: ${O.sp8};
9
+ color: ${e=>e.theme.colors.primary};
10
+ word-break: break-word;
11
+ `,Ee=W(De.LargeRegularSp)`
12
+ color: ${e=>e.theme.colors.hero};
13
+ padding-left: ${O.sp8};
14
+ padding-right: ${O.sp8};
15
+ margin-bottom: 30px;
16
+ margin-top: ${O.sp4};
17
+ white-space: pre-line;
18
+ `,aa={overlayWidth:new Se(100,100,48)},oe=M.getLocalizedStrings().peoplePage.invitePage,ie=M.getLocalizedStrings().common,sa=({companyId:e,managersListView:t,companyPassportView:d,classListView:n,mode:C,isInvitePeopleDrawerOpen:i,closeDrawerHandler:b})=>{const f=Ce(),m=ee(),[R,U]=c.useState(!1),[k,S]=c.useState(!1),D=g((o=>re(o))),r=g((o=>Q(o))),p=g((o=>G(o))),{useFeatureGate:E}=J(),{isFeatureEnabled:x}=E(H.isDebitCardFeatureEnabled),I=Y(x,r),P=le(r),T=X(r),v=ce(r),Z=!!r.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,B=!I&&p&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||d.fetchState!=="Completed"||e==null;if(K.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const w=()=>{b(),m(N())},h=()=>{R===!0?S(!0):w()},V={onOkClick:()=>{S(!1),w()},onCancelClick:()=>{S(!1)}},$=d.companyView?.controllers.map((o=>o.user)),u=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:j}=E(H.isChargeCardFeatureEnabled),L=fe(r,j,x),{isCardsHidden:A}=he(r?.tenantId),y=!L||A,F=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",s={classList:n.classes,managersList:t.users,controllersList:$,mode:C,isZeniTenant:T,onPeopleLocalDataUpdated:o=>{m(de({peopleLocalData:o})),U(!0)},onResetClick:w,onSaveClick:()=>{m(C==="zeni_only"?Te(e):ve())},onCloseClick:h,peopleDetails:D,isAccountingClassesEnabled:p,isReimbursementDisabled:Z===!1,isLiteRoleDisabled:v===!1,isZeniAccountsDisabled:u===!1,isChargeCardDisabled:y,isTreasuryDisabled:F===!1,isBankingOnlyTenant:I,isCardsOnlyTenant:P,isLoading:B};return c.useEffect((()=>{D.invitePersonState.fetchState==="Completed"&&(b(),m(N()))}),[D.invitePersonState.fetchState]),a.jsx(xe,{anchor:"right",open:i,PaperProps:{style:{width:aa.overlayWidth.valuePercentage(f),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:ye.overlayDark,cursor:"pointer"}}},onClose:h,children:a.jsxs(ta,{onClick:o=>o.stopPropagation(),children:[k===!0?a.jsx(be,{titleComponent:a.jsx(ke,{children:oe.discardTitle}),descriptionComponent:a.jsx(Ee,{children:oe.discardDescription}),primaryButtonText:ie.yes,secondaryButtonText:ie.no,action:V}):null,a.jsx(Ze,{...s})]})})},ta=W(Ie)`
19
+ display: flex;
20
+ min-height: 100%;
21
+ flex-direction: column;
22
+ `,na=Ne((function(e,t){const d=ue(e),n=K.getSignedInUser();return{data:d,loggedinUserId:n?.userId??"",isZeniTenant:t.isZeniTenant===!0,shouldFetchClasses:t.shouldFetchClasses,isZeniAdminUser:n?.userEmailDomain==="zeni.ai"&&t.isZeni===!0,isAccountingClassesEnabled:G(e),analytics:we}}),(function(e,t){const{navigate:d,companyId:n,shouldFetchClasses:C}=t;return{personAction:{onPersonDelete:(i,b)=>{e(pe(i,b))},onResendInvite:i=>{e(Oe(i))},onReloadPeople:()=>{e(me()),e(ge(n,C))},onBackClick:()=>{d("../../")},onModeChange:i=>{e(_({mode:i,searchText:"",sortKey:"name",sortOrder:"ascending"}))},onSearchTextChanged:i=>{e(_({searchText:i}))}}}}))(Ge);function q({isInvitePeopleDrawerOpen:e,isEditPeopleDrawerOpen:t}){const d=We(),n=ee(),C=qe(),{areTenantIdsInSync:i}=Be(),b=K.getSignedInUser(),f=g((s=>Q(s))),{useFeatureGate:m}=J(),{isFeatureEnabled:R}=m(H.isDebitCardFeatureEnabled),U=g((s=>G(s))),k=!Y(R,f)&&U,S=X(f),D=f?.tenantId,{tenantEmailDomain:r}=f,[p,E]=c.useState(!1),[x,I]=c.useState(!1),[P,T]=c.useState(!1),[v,Z]=c.useState("off"),[B,w]=c.useState(!1),h=s=>{w(s)},{isAiCfoAccessEnabled:V,onAskAiCfoClick:$}=Qe({mobileExploreReferrer:"People"}),u=g((s=>ue(s)));$e({isDataReady:u.fetchState==="Completed"});const j=g((s=>Ve(s.classState,s.classListState))),L=g((s=>Ae(s.userState,s.userRoleState,s.userListViewState,"manager"))),A=g((s=>Fe(s))),y=f?.companyId;c.useEffect((()=>{p&&v===u.uiState.mode||!i||(n(_({searchText:"",sortKey:"name",sortOrder:"ascending"})),Z(u.uiState.mode),E(!0),n(me()))}),[p,b,D,n,u.uiState.mode,i]),c.useEffect((()=>{y!=null&&i&&n(ge(y,k))}),[y,k,i]),c.useEffect((()=>{I(e!=null&&e===!0),T(t!=null&&t===!0&&t)}),[e,t]),c.useEffect((()=>{n(_({searchText:"",sortKey:"name",sortOrder:"ascending"}))}),[]);const F=()=>{I(!1),T(!1),d("../")};return a.jsxs(a.Fragment,{children:[u.fetchState==="Completed"?a.jsx(ze,{analytics:we,onLoad:s=>s.trackPageLoaded(_e.Event.members)}):null,x===!0?a.jsx(sa,{closeDrawerHandler:F,isInvitePeopleDrawerOpen:x,managersListView:L,companyPassportView:A,classListView:j,companyId:y,mode:u.uiState.mode}):null,P===!0?a.jsx(Je,{closeDrawerHandler:F,isEditPeopleDrawerOpen:P,managersListView:L,companyPassportView:A,classListView:j,companyId:y,mode:u.uiState.mode}):null,a.jsx(Ye,{isAppContentDrawerOpen:B,handleDrawerToggle:h}),a.jsx(na,{navigate:d,signedInUser:b,isZeni:f.isZeni,isZeniTenant:S,peopleUIState:u.uiState,companyId:y,shouldFetchClasses:k,classList:j,managersView:L,peopleView:u,onInvitePeopleClick:()=>{d("./new")},onColumnSortConfigChanged:(s,o)=>{n(_({sortKey:s,sortOrder:o}))},onRowClick:s=>{const o=`/${r}/people/${encodeURIComponent(s)}/edit`,l=He(C.state?.pathnameStackToGoBack,C.pathname);d(o,{state:{pathnameStackToGoBack:l}})},onClickMenuIcon:()=>{h(!0)},isAiCfoAccessEnabled:V,onAskAiCfoClick:$})]})}function ka(){const e=Ke();return Re(e?.loggedInUserRole??[])?a.jsxs(se,{children:[a.jsx(z,{path:"/",element:a.jsx(q,{})}),a.jsx(z,{path:"new",element:a.jsx(q,{isInvitePeopleDrawerOpen:!0})}),a.jsx(z,{path:":userId/edit",element:a.jsx(q,{isEditPeopleDrawerOpen:!0})}),a.jsx(z,{path:"*",element:a.jsx(ae,{})})]}):a.jsx(se,{children:a.jsx(z,{path:"*",element:a.jsx(ae,{})})})}export{ka as default};
@@ -0,0 +1 @@
1
+ import{j as s}from"./liveblocks-2F3ER8H4.js";import E from"./NotFoundScreen-CjcmfT5h.js";import{a as r}from"./sentry-Dwi3Xpu2.js";import{h as _,g as v,j as p,i as M,u as P,N as U,l as z,n as F,o as h}from"./core-BmXpopk3.js";import{fF as O,a1i as b,bo as B,bn as N,iL as V,gh as L}from"./zeni-epic-state-DtY6MD5C.js";import{c as $,z as I,at as q,dP as G}from"./index-BH7Z90Ry.js";import"./mui-DpZKsKJ-.js";import{u as H}from"./useAskAiCfoHostNavButtonProps-B82QOIYm.js";import{M as J}from"./MobileAppDrawer-thURFqdR.js";import"./recharts-lgPPofcu.js";import"./analytics-CVpLIXYS.js";import"./plaid-B0sfsJHV.js";import"./dnd-CFbFq_On.js";import"./stripe-cKAAJElX.js";import"./lottie-Do5BYuHO.js";import"./lexical-CUqOWG_f.js";import"./pdf-CaVqV5T4.js";import"./utils-DAgs23EZ.js";import"./InboxNotificationsProvider-jZPrqdDf.js";import"./useTaskManagerAccess-DvrYqbN3.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]="51c2a80e-e0bd-41e9-924d-fd9c41371486",e._sentryDebugIdIdentifier="sentry-dbid-51c2a80e-e0bd-41e9-924d-fd9c41371486")}catch{}})();const K=z((function(e){const t=I.getSignedInUser(),c=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:c??""},{aggregatedReportViewState:n}=b(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}}),(function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}}))(G),Q=()=>{const e=_(),t=v(),c=$(),o=p((a=>O(a))),{aggregatedReportViewState:n}=p((a=>b(a))),{tenantEmailDomain:f}=M(),u=P(),l=I.getSignedInUser();if(l==null)throw new Error("Can't access this page without signing in...");const m=r.useRef(!1),[w,S]=r.useState(!1),C=B(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,x=N(l),y=C||k||x,d=r.useCallback(((a,i,T)=>{u(V({fromMonth:a,toMonth:i,cacheOverride:T}))}),[]);r.useEffect((()=>{n?.fetchState==="Completed"&&m.current&&(u(L({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),m.current=!1)}),[n?.fetchState]);const D=r.useCallback(((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||d(a,i,!0),m.current=!0}),[n?.fetchState,d]),j=r.useCallback(((a,i)=>{d(a,i,!1)}),[d]),g=a=>{S(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:A}=H({mobileExploreReferrer:"Performance"});return q({isDataReady:n?.fetchState==="Completed"}),y?s.jsxs(s.Fragment,{children:[s.jsx(J,{isAppContentDrawerOpen:w,handleDrawerToggle:g}),s.jsx(K,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:l,tenantEmailDomain:f,onReload:D,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:A})]}):s.jsx(U,{to:`/${f}/dashboard`,replace:!0})};function he(){return s.jsxs(F,{children:[s.jsx(h,{path:"*",element:s.jsx(Q,{})}),s.jsx(h,{path:"*",element:s.jsx(E,{})})]})}export{he as default};
@@ -1 +1 @@
1
- import{a as h,R as a}from"./sentry-DsyKtMW2.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new r.Error().stack;t&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[t]="1e16de4c-304f-4e91-a86b-dc86bcc8d8a2",r._sentryDebugIdIdentifier="sentry-dbid-1e16de4c-304f-4e91-a86b-dc86bcc8d8a2")}catch{}})();const c="64px",u={};var k=({src:r,light:t,oEmbedUrl:n,onClickPreview:l,playIcon:w,previewTabIndex:m,previewAriaLabel:b})=>{const[p,i]=h.useState(null);h.useEffect((()=>{r&&t&&n&&v({src:r,light:t,oEmbedUrl:n})}),[r,t,n]);const v=async({src:e,light:s,oEmbedUrl:I})=>{if(a.isValidElement(s))return;if(typeof s=="string")return void i(s);if(u[e])return void i(u[e]);i(null);const E=await fetch(I.replace("{url}",e)),f=await E.json();if(f.thumbnail_url){const g=f.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");i(g),u[e]=g}},d=a.isValidElement(t),y={display:"flex",alignItems:"center",justifyContent:"center"},o={preview:{width:"100%",height:"100%",backgroundImage:p&&!d?`url(${p})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...y},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:c,width:c,height:c,position:d?"absolute":void 0,...y},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},_=a.createElement("div",{style:o.shadow,className:"react-player__shadow"},a.createElement("div",{style:o.playIcon,className:"react-player__play-icon"}));return a.createElement("div",{style:o.preview,className:"react-player__preview",tabIndex:m,onClick:e=>{l?.(e)},onKeyDown:e=>{e.key!=="Enter"&&e.key!==" "||l==null||l(e)},...b?{"aria-label":b}:{}},d?t:null,w||_)};export{k as default};
1
+ import{a as h,R as a}from"./sentry-Dwi3Xpu2.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new r.Error().stack;t&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[t]="1e16de4c-304f-4e91-a86b-dc86bcc8d8a2",r._sentryDebugIdIdentifier="sentry-dbid-1e16de4c-304f-4e91-a86b-dc86bcc8d8a2")}catch{}})();const c="64px",u={};var k=({src:r,light:t,oEmbedUrl:n,onClickPreview:l,playIcon:w,previewTabIndex:m,previewAriaLabel:b})=>{const[p,i]=h.useState(null);h.useEffect((()=>{r&&t&&n&&v({src:r,light:t,oEmbedUrl:n})}),[r,t,n]);const v=async({src:e,light:s,oEmbedUrl:I})=>{if(a.isValidElement(s))return;if(typeof s=="string")return void i(s);if(u[e])return void i(u[e]);i(null);const E=await fetch(I.replace("{url}",e)),f=await E.json();if(f.thumbnail_url){const g=f.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");i(g),u[e]=g}},d=a.isValidElement(t),y={display:"flex",alignItems:"center",justifyContent:"center"},o={preview:{width:"100%",height:"100%",backgroundImage:p&&!d?`url(${p})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...y},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:c,width:c,height:c,position:d?"absolute":void 0,...y},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},_=a.createElement("div",{style:o.shadow,className:"react-player__shadow"},a.createElement("div",{style:o.playIcon,className:"react-player__play-icon"}));return a.createElement("div",{style:o.preview,className:"react-player__preview",tabIndex:m,onClick:e=>{l?.(e)},onKeyDown:e=>{e.key!=="Enter"&&e.key!==" "||l==null||l(e)},...b?{"aria-label":b}:{}},d?t:null,w||_)};export{k as default};
@@ -1,4 +1,4 @@
1
- import{j as _l}from"./liveblocks-e6rGc1UF.js";import{p as te,d as jc,c as an,g as Sl,a as Ol}from"./sentry-DsyKtMW2.js";import{L as ge,b$ as xc,fF as kc,TZ as Tc,UP as jl,c8 as xl}from"./zeni-epic-state-BO3zdDfL.js";import{a as pe,b as kl,c as Tl,d as Al,e as un,f as Rl,g as Pl,h as Il,i as Ve,j as Ac,k as ot,l as xt,m as Ll,o as ct,p as Nl}from"./utils-CCA3F0sZ.js";import{r as cn}from"./empty-CeRjDJvl.js";import{r as $l,a as Ml,b as Cl,c as Dl}from"./pdf-lib-CSbJ_JNk.js";import{a as Ye,r as Fl}from"./index-BVHBHjSe.js";import{r as Ul}from"./index-CKiMoeFX.js";import{h as Bl,g as ql,u as Gl,j as _n,l as zl}from"./core-CHD8T-IM.js";import{u as Zl,z as Rc,L as Hl,al as Vl,am as Yl,_ as Wl,D as Kl}from"./index-DKH4PK2B.js";import"./mui-NTaF3UaY.js";import{d as It}from"./decodeURIComponentSafe-p_nrn8Pg.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]="3b42dba9-524b-4666-9073-b3bfeebc6cc1",e._sentryDebugIdIdentifier="sentry-dbid-3b42dba9-524b-4666-9073-b3bfeebc6cc1")}catch{}})();var Sn,On={exports:{}},jn,xn,kn,Tn,An,Rn,Pn,In,Ln,Lt,Nn,$n,Mn,Cn,Dn,Fn,Un,Bn,qn,Gn,zn,Nt,Zn,Hn,Vn,Yn,Wn,Kn,Jn,$t,Xn,Qn,eo,to,ro,no,oo,Mt={exports:{}},Ct={exports:{}},Dt={};function Pc(){if(jn)return Dt;function e(r){return e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(r)}function o(r,t){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,l){return i.__proto__=l,i},o(r,t)}function h(r){var t=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var i,l=n(r);if(t){var u=n(this).constructor;i=Reflect.construct(l,arguments,u)}else i=l.apply(this,arguments);return(function(f,b){if(b&&(e(b)==="object"||typeof b=="function"))return b;if(b!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(m){if(m===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m})(f)})(this,i)}}function n(r){return n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},n(r)}jn=1;var c,p,y={};function g(r,t,i){i||(i=Error);var l=(function(u){(function(a,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(d&&d.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),d&&o(a,d)})(m,u);var f,b=h(m);function m(a,d,v){var _;return(function(w,S){if(!(w instanceof S))throw new TypeError("Cannot call a class as a function")})(this,m),_=b.call(this,(function(w,S,N){return typeof t=="string"?t:t(w,S,N)})(a,d,v)),_.code=r,_}return f=m,Object.defineProperty(f,"prototype",{writable:!1}),f})(i);y[r]=l}function s(r,t){if(Array.isArray(r)){var i=r.length;return r=r.map((function(l){return String(l)})),i>2?"one of ".concat(t," ").concat(r.slice(0,i-1).join(", "),", or ")+r[i-1]:i===2?"one of ".concat(t," ").concat(r[0]," or ").concat(r[1]):"of ".concat(t," ").concat(r[0])}return"of ".concat(t," ").concat(String(r))}return g("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),g("ERR_INVALID_ARG_TYPE",(function(r,t,i){var l,u,f;if(c===void 0&&(c=it()),c(typeof r=="string","'name' must be a string"),typeof t=="string"&&(u="not ",t.substr(0,u.length)===u)?(l="must not be",t=t.replace(/^not /,"")):l="must be",(function(m,a,d){return(d===void 0||d>m.length)&&(d=m.length),m.substring(d-a.length,d)===a})(r," argument"))f="The ".concat(r," ").concat(l," ").concat(s(t,"type"));else{var b=(function(m,a,d){return typeof d!="number"&&(d=0),!(d+a.length>m.length)&&m.indexOf(a,d)!==-1})(r,".")?"property":"argument";f='The "'.concat(r,'" ').concat(b," ").concat(l," ").concat(s(t,"type"))}return f+=". Received type ".concat(e(i))}),TypeError),g("ERR_INVALID_ARG_VALUE",(function(r,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";p===void 0&&(p=pe());var l=p.inspect(t);return l.length>128&&(l="".concat(l.slice(0,128),"...")),"The argument '".concat(r,"' ").concat(i,". Received ").concat(l)}),TypeError),g("ERR_INVALID_RETURN_VALUE",(function(r,t,i){var l;return l=i&&i.constructor&&i.constructor.name?"instance of ".concat(i.constructor.name):"type ".concat(e(i)),"Expected ".concat(r,' to be returned from the "').concat(t,'"')+" function but got ".concat(l,".")}),TypeError),g("ERR_MISSING_ARGS",(function(){for(var r=arguments.length,t=new Array(r),i=0;i<r;i++)t[i]=arguments[i];c===void 0&&(c=it()),c(t.length>0,"At least one arg needs to be specified");var l="The ",u=t.length;switch(t=t.map((function(f){return'"'.concat(f,'"')})),u){case 1:l+="".concat(t[0]," argument");break;case 2:l+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:l+=t.slice(0,u-1).join(", "),l+=", and ".concat(t[u-1]," arguments")}return"".concat(l," must be specified")}),TypeError),Dt.codes=y,Dt}function Jl(){if(kn)return xn;function e(j,E){var O=Object.keys(j);if(Object.getOwnPropertySymbols){var P=Object.getOwnPropertySymbols(j);E&&(P=P.filter((function(x){return Object.getOwnPropertyDescriptor(j,x).enumerable}))),O.push.apply(O,P)}return O}function o(j){for(var E=1;E<arguments.length;E++){var O=arguments[E]!=null?arguments[E]:{};E%2?e(Object(O),!0).forEach((function(P){h(j,P,O[P])})):Object.getOwnPropertyDescriptors?Object.defineProperties(j,Object.getOwnPropertyDescriptors(O)):e(Object(O)).forEach((function(P){Object.defineProperty(j,P,Object.getOwnPropertyDescriptor(O,P))}))}return j}function h(j,E,O){return(E=c(E))in j?Object.defineProperty(j,E,{value:O,enumerable:!0,configurable:!0,writable:!0}):j[E]=O,j}function n(j,E,O){return E&&(function(P,x){for(var U=0;U<x.length;U++){var L=x[U];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(P,c(L.key),L)}})(j.prototype,E),Object.defineProperty(j,"prototype",{writable:!1}),j}function c(j){var E=(function(O,P){if(l(O)!=="object"||O===null)return O;var x=O[Symbol.toPrimitive];if(x!==void 0){var U=x.call(O,P);if(l(U)!=="object")return U;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(O)})(j,"string");return l(E)==="symbol"?E:String(E)}function p(j,E){if(E&&(l(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return y(j)}function y(j){if(j===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return j}function g(j){var E=typeof Map=="function"?new Map:void 0;return g=function(O){if(O===null||(P=O,Function.toString.call(P).indexOf("[native code]")===-1))return O;var P;if(typeof O!="function")throw new TypeError("Super expression must either be null or a function");if(E!==void 0){if(E.has(O))return E.get(O);E.set(O,x)}function x(){return s(O,arguments,i(this).constructor)}return x.prototype=Object.create(O.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),t(x,O)},g(j)}function s(j,E,O){return s=r()?Reflect.construct.bind():function(P,x,U){var L=[null];L.push.apply(L,x);var A=new(Function.bind.apply(P,L));return U&&t(A,U.prototype),A},s.apply(null,arguments)}function r(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}}function t(j,E){return t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(O,P){return O.__proto__=P,O},t(j,E)}function i(j){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(E){return E.__proto__||Object.getPrototypeOf(E)},i(j)}function l(j){return l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},l(j)}kn=1;var u=pe().inspect,f=Pc().codes.ERR_INVALID_ARG_TYPE;function b(j,E,O){return(O===void 0||O>j.length)&&(O=j.length),j.substring(O-E.length,O)===E}var m="",a="",d="",v="",_={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function w(j){var E=Object.keys(j),O=Object.create(Object.getPrototypeOf(j));return E.forEach((function(P){O[P]=j[P]})),Object.defineProperty(O,"message",{value:j.message}),O}function S(j){return u(j,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function N(j,E,O){var P="",x="",U=0,L="",A=!1,z=S(j),R=z.split(`
1
+ import{j as _l}from"./liveblocks-2F3ER8H4.js";import{p as te,d as jc,c as an,g as Sl,a as Ol}from"./sentry-Dwi3Xpu2.js";import{L as ge,b$ as xc,fF as kc,U7 as Tc,UZ as jl,c8 as xl}from"./zeni-epic-state-DtY6MD5C.js";import{a as pe,b as kl,c as Tl,d as Al,e as un,f as Rl,g as Pl,h as Il,i as Ve,j as Ac,k as ot,l as xt,m as Ll,o as ct,p as Nl}from"./utils-DAgs23EZ.js";import{r as cn}from"./empty-0E71-pkh.js";import{r as $l,a as Ml,b as Cl,c as Dl}from"./pdf-lib-DgpGz3__.js";import{a as Ye,r as Fl}from"./index-_EB0AYfG.js";import{r as Ul}from"./index-Diiw4rJ6.js";import{h as Bl,g as ql,u as Gl,j as _n,l as zl}from"./core-BmXpopk3.js";import{u as Zl,z as Rc,L as Hl,al as Vl,am as Yl,X as Wl,D as Kl}from"./index-BH7Z90Ry.js";import"./mui-DpZKsKJ-.js";import{d as It}from"./decodeURIComponentSafe-CmNiiSLm.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]="b6701a8f-2bed-46f8-a140-50c8ee83d87c",e._sentryDebugIdIdentifier="sentry-dbid-b6701a8f-2bed-46f8-a140-50c8ee83d87c")}catch{}})();var Sn,On={exports:{}},jn,xn,kn,Tn,An,Rn,Pn,In,Ln,Lt,Nn,$n,Mn,Cn,Dn,Fn,Un,Bn,qn,Gn,zn,Nt,Zn,Hn,Vn,Yn,Wn,Kn,Jn,$t,Xn,Qn,eo,to,ro,no,oo,Mt={exports:{}},Ct={exports:{}},Dt={};function Pc(){if(jn)return Dt;function e(r){return e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(r)}function o(r,t){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,l){return i.__proto__=l,i},o(r,t)}function h(r){var t=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var i,l=n(r);if(t){var u=n(this).constructor;i=Reflect.construct(l,arguments,u)}else i=l.apply(this,arguments);return(function(f,b){if(b&&(e(b)==="object"||typeof b=="function"))return b;if(b!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(m){if(m===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m})(f)})(this,i)}}function n(r){return n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},n(r)}jn=1;var c,p,y={};function g(r,t,i){i||(i=Error);var l=(function(u){(function(a,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(d&&d.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),d&&o(a,d)})(m,u);var f,b=h(m);function m(a,d,v){var _;return(function(w,S){if(!(w instanceof S))throw new TypeError("Cannot call a class as a function")})(this,m),_=b.call(this,(function(w,S,N){return typeof t=="string"?t:t(w,S,N)})(a,d,v)),_.code=r,_}return f=m,Object.defineProperty(f,"prototype",{writable:!1}),f})(i);y[r]=l}function s(r,t){if(Array.isArray(r)){var i=r.length;return r=r.map((function(l){return String(l)})),i>2?"one of ".concat(t," ").concat(r.slice(0,i-1).join(", "),", or ")+r[i-1]:i===2?"one of ".concat(t," ").concat(r[0]," or ").concat(r[1]):"of ".concat(t," ").concat(r[0])}return"of ".concat(t," ").concat(String(r))}return g("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),g("ERR_INVALID_ARG_TYPE",(function(r,t,i){var l,u,f;if(c===void 0&&(c=it()),c(typeof r=="string","'name' must be a string"),typeof t=="string"&&(u="not ",t.substr(0,u.length)===u)?(l="must not be",t=t.replace(/^not /,"")):l="must be",(function(m,a,d){return(d===void 0||d>m.length)&&(d=m.length),m.substring(d-a.length,d)===a})(r," argument"))f="The ".concat(r," ").concat(l," ").concat(s(t,"type"));else{var b=(function(m,a,d){return typeof d!="number"&&(d=0),!(d+a.length>m.length)&&m.indexOf(a,d)!==-1})(r,".")?"property":"argument";f='The "'.concat(r,'" ').concat(b," ").concat(l," ").concat(s(t,"type"))}return f+=". Received type ".concat(e(i))}),TypeError),g("ERR_INVALID_ARG_VALUE",(function(r,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";p===void 0&&(p=pe());var l=p.inspect(t);return l.length>128&&(l="".concat(l.slice(0,128),"...")),"The argument '".concat(r,"' ").concat(i,". Received ").concat(l)}),TypeError),g("ERR_INVALID_RETURN_VALUE",(function(r,t,i){var l;return l=i&&i.constructor&&i.constructor.name?"instance of ".concat(i.constructor.name):"type ".concat(e(i)),"Expected ".concat(r,' to be returned from the "').concat(t,'"')+" function but got ".concat(l,".")}),TypeError),g("ERR_MISSING_ARGS",(function(){for(var r=arguments.length,t=new Array(r),i=0;i<r;i++)t[i]=arguments[i];c===void 0&&(c=it()),c(t.length>0,"At least one arg needs to be specified");var l="The ",u=t.length;switch(t=t.map((function(f){return'"'.concat(f,'"')})),u){case 1:l+="".concat(t[0]," argument");break;case 2:l+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:l+=t.slice(0,u-1).join(", "),l+=", and ".concat(t[u-1]," arguments")}return"".concat(l," must be specified")}),TypeError),Dt.codes=y,Dt}function Jl(){if(kn)return xn;function e(j,E){var O=Object.keys(j);if(Object.getOwnPropertySymbols){var P=Object.getOwnPropertySymbols(j);E&&(P=P.filter((function(x){return Object.getOwnPropertyDescriptor(j,x).enumerable}))),O.push.apply(O,P)}return O}function o(j){for(var E=1;E<arguments.length;E++){var O=arguments[E]!=null?arguments[E]:{};E%2?e(Object(O),!0).forEach((function(P){h(j,P,O[P])})):Object.getOwnPropertyDescriptors?Object.defineProperties(j,Object.getOwnPropertyDescriptors(O)):e(Object(O)).forEach((function(P){Object.defineProperty(j,P,Object.getOwnPropertyDescriptor(O,P))}))}return j}function h(j,E,O){return(E=c(E))in j?Object.defineProperty(j,E,{value:O,enumerable:!0,configurable:!0,writable:!0}):j[E]=O,j}function n(j,E,O){return E&&(function(P,x){for(var U=0;U<x.length;U++){var L=x[U];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(P,c(L.key),L)}})(j.prototype,E),Object.defineProperty(j,"prototype",{writable:!1}),j}function c(j){var E=(function(O,P){if(l(O)!=="object"||O===null)return O;var x=O[Symbol.toPrimitive];if(x!==void 0){var U=x.call(O,P);if(l(U)!=="object")return U;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(O)})(j,"string");return l(E)==="symbol"?E:String(E)}function p(j,E){if(E&&(l(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return y(j)}function y(j){if(j===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return j}function g(j){var E=typeof Map=="function"?new Map:void 0;return g=function(O){if(O===null||(P=O,Function.toString.call(P).indexOf("[native code]")===-1))return O;var P;if(typeof O!="function")throw new TypeError("Super expression must either be null or a function");if(E!==void 0){if(E.has(O))return E.get(O);E.set(O,x)}function x(){return s(O,arguments,i(this).constructor)}return x.prototype=Object.create(O.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),t(x,O)},g(j)}function s(j,E,O){return s=r()?Reflect.construct.bind():function(P,x,U){var L=[null];L.push.apply(L,x);var A=new(Function.bind.apply(P,L));return U&&t(A,U.prototype),A},s.apply(null,arguments)}function r(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}}function t(j,E){return t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(O,P){return O.__proto__=P,O},t(j,E)}function i(j){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(E){return E.__proto__||Object.getPrototypeOf(E)},i(j)}function l(j){return l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},l(j)}kn=1;var u=pe().inspect,f=Pc().codes.ERR_INVALID_ARG_TYPE;function b(j,E,O){return(O===void 0||O>j.length)&&(O=j.length),j.substring(O-E.length,O)===E}var m="",a="",d="",v="",_={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function w(j){var E=Object.keys(j),O=Object.create(Object.getPrototypeOf(j));return E.forEach((function(P){O[P]=j[P]})),Object.defineProperty(O,"message",{value:j.message}),O}function S(j){return u(j,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function N(j,E,O){var P="",x="",U=0,L="",A=!1,z=S(j),R=z.split(`
2
2
  `),I=S(E).split(`
3
3
  `),k=0,C="";if(O==="strictEqual"&&l(j)==="object"&&l(E)==="object"&&j!==null&&E!==null&&(O="strictEqualObject"),R.length===1&&I.length===1&&R[0]!==I[0]){var H=R[0].length+I[0].length;if(H<=10){if(!(l(j)==="object"&&j!==null||l(E)==="object"&&E!==null||j===0&&E===0))return"".concat(_[O],`
4
4
 
@@ -0,0 +1 @@
1
+ import{j as o}from"./liveblocks-2F3ER8H4.js";import z from"./NotFoundScreen-CjcmfT5h.js";import{a as p}from"./sentry-Dwi3Xpu2.js";import{h as C,g as D,u as N,j as u,N as V,l as k,n as F,o as g}from"./core-BmXpopk3.js";import{fF as E,Zo as h,ZF as w,NK as U,NG as L,NJ as f,Nz as B,_2 as $,ND as K,NM as Z}from"./zeni-epic-state-DtY6MD5C.js";import{z as T,w as _,cc as G,s as O,bV as J,cd as M}from"./index-BH7Z90Ry.js";import"./mui-DpZKsKJ-.js";import{u as q}from"./useEnsureVendorListLoaded-BtOYIHPo.js";import{R as x}from"./ReimbursementApprovalRuleDetailScreen-La5bMk76.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]="0b35c8ba-56c6-4a5a-aea0-8c70a84b9820",e._sentryDebugIdIdentifier="sentry-dbid-0b35c8ba-56c6-4a5a-aea0-8c70a84b9820")}catch{}})();const j="reimbursement-approval-rule-update",H=k((function(e){return{approvalView:h(e),remiSetupApproverViewUpdateData:w(e).remiSetupApproverViewUpdateData}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(j)&&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"))}}}))(_(G)),P=({isLoading:e})=>{const s=C(),n=D(),a=N(),[t,l]=p.useState(!1),[v,R]=p.useState(!1),S=u((r=>r.remiSetupApproverViewState.fetchState)),c=u((r=>E(r))),d=u((r=>h(r))),b=u((r=>w(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||(R(!0),a(f())),s("./new"))}),[v,d,a]);const m={events:c.companyId!=null?[`private-encrypted-${c.companyId}.${j}`]:[],eventCallback:(r,y,I)=>{r.endsWith(j)&&I.onApprovalRulesEventReceived(r)}};return c?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?o.jsx(V,{to:"../../promo"}):o.jsx(H,{currentTenant:c,location:n,navigate:s,...m})},A="reimbursement-approval-rule-update",Q=k((function(e){const s=h(e),n=w(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(A)&&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(Z(t,!0))}}}))(_(M)),X=()=>{const e=u((a=>E(a))),{isApprovalRulesV3Enabled:s,isLoading:n}=J(e?.tenantId);return s?o.jsx(Y,{isLoading:n}):o.jsx(P,{isLoading:n})},Y=({isLoading:e})=>{const s=C(),n=D(),a=N(),[t,l]=p.useState(!1),[v,R]=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=>h(i)));q();const y=u((i=>w(i).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{y?.updateStatus.fetchState==="Completed"&&a(U())}),[y]),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||(R(!0),a(K(!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 I={events:m.companyId!=null?[`private-encrypted-${m.companyId}.${A}`]:[],eventCallback:(i,ee,W)=>{i.endsWith(A)&&W.onApprovalRulesEventReceived(i)}};return m?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?o.jsx(V,{to:"../../promo"}):o.jsx(Q,{currentTenant:m,location:n,navigate:s,isLoading:e,...I})};function ue(){return o.jsxs(F,{children:[o.jsx(g,{path:"/",element:o.jsx(X,{})}),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{ue as R};
@@ -0,0 +1 @@
1
+ import{j as g}from"./liveblocks-2F3ER8H4.js";import{a as y}from"./sentry-Dwi3Xpu2.js";import{h as C,u as _,g as O,i as V,j as S,l as N}from"./core-BmXpopk3.js";import{ZF as w,Zo as U,NC as k,NP as j,NK as A,NL as E,ZG as F,fF as K,NJ as L}from"./zeni-epic-state-DtY6MD5C.js";import{z as B,E as P,a8 as $,c3 as z,s as q,bV as G,c4 as J}from"./index-BH7Z90Ry.js";import"./mui-DpZKsKJ-.js";import{u as W}from"./useEnsureVendorListLoaded-BtOYIHPo.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},p=new e.Error().stack;p&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[p]="22265241-cb58-4700-9596-3f028c697716",e._sentryDebugIdIdentifier="sentry-dbid-22265241-cb58-4700-9596-3f028c697716")}catch{}})();const H=N((function(e,p){const t=w(e),o=t.remiSetupApproverViewUpdateData?.type??"approval_create",s=o==="approval_create"&&t.allApprovalRules.length!==0;let i=t.allApprovalRules.length===0;return p.approvalRuleId&&(i=t.allApprovalRules.findIndex((r=>r.approvalRuleId===p.approvalRuleId))===0),{localData:t,hideUpperBoundField:s,isLowerBoundDisabled:i,approvalUpdateActionType:o}}),(function(e,p){const{navigate:t,approvalUpdateDataView:o,approverViewData:s,approvalRuleId:i}=p,r=o.remiSetupApproverViewUpdateData?.type,l=q(p.location);return{onApprovalRuleDataUpdated:a=>{const d=v=>{const h=[];return v.forEach((u=>{const I=u.actors.selectedUsers.map((m=>({type:"user",subType:void 0,userId:m.userId,idType:"user",isImplicitActor:!1}))),b=u.actors.selectedNonUsers.map((m=>{const f=(R=m.value,F(R)==null);var R;return{type:f?"attribute":"role",subType:m.value,userId:void 0,idType:void 0,isImplicitActor:!f}})),c=I.concat(b);h.push({action:u.stepType.selectedOption,actors:c,operator:c.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})})),h},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("../"):s.allApprovalRules.length===0&&s.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||l?t("../"):s.allApprovalRules.length===0&&s.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(j(!1))},onSaveRuleSuccess:()=>{t("../")}}}))(z);function M(){const e=C(),p=_(),t=O(),{approvalRuleId:o}=V(),s=B.getSignedInUser(),i=P(),r=S((n=>w(n))),l=S((n=>U(n))),[a,d]=y.useState(!1);if(y.useEffect((()=>{a||(d(!0),p(k(!0)))})),y.useEffect((()=>{l.fetchState==="Not-Started"&&e(o!=null?"../../":"../")}),[l,o]),s==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx($,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):g.jsx(H,{navigate:e,approvalUpdateDataView:r,approvalRuleId:o,approverViewData:l,location:t})}function se(e){return F(e)==null}const Q=N((function(e,p){const t=w(e),o=t.remiSetupApproverViewUpdateData?.type??"approval_create",s=[],i={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(s.push(r.id),i[r.id]=r.name);return{localData:t,approvalUpdateActionType:o,allVendorIds:s,vendorNamesById:i,editingRuleId:o==="approval_update"?p.approvalRuleId:void 0,allApprovalRulesWithUser:U(e).allApprovalRules}}),(function(e,p){const{navigate:t,approvalUpdateDataView:o,approverViewData:s,approvalRuleId:i}=p,r=o.remiSetupApproverViewUpdateData?.type,l=q(p.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const m=[];return c.forEach((f=>{const R=f.actorKind?.selectedOption,Z=f.selectedRole?.selectedNonUsers??[];let D=[];R==="role"?D=Z.map((T=>({type:"attribute",subType:T.value,userId:void 0,idType:void 0,isImplicitActor:!1}))):R==="specific_person"&&(D=(f.persons?.selectedUsers??[]).map((T=>({type:"user",subType:void 0,userId:T.userId,idType:"user",isImplicitActor:!1}))));const x=f.action??"require_approval";m.push({action:x,actors:D,operator:D.length>1?x==="require_approval"?"or":"and":"is"})})),m},n=a.amountCriteria,v=a.vendorCriteria,h=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 b=h?.selection.selectedOptions??[];if(b.length>0&&(u.department={type:"department",operator:h?.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("../"):s.allApprovalRules.length===0&&s.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||l?t("../"):s.allApprovalRules.length===0&&s.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(j(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:a=>{e(L(a)),t(r==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}}))(J);function ne(){const e=S((t=>K(t))),{isApprovalRulesV3Enabled:p}=G(e?.tenantId);return p?g.jsx(X,{}):g.jsx(M,{})}function X(){const e=C(),p=_(),t=O(),{approvalRuleId:o}=V(),s=B.getSignedInUser(),i=P(),r=S((n=>w(n))),l=S((n=>U(n))),[a,d]=y.useState(!1);if(W(),y.useEffect((()=>{a||(d(!0),p(k(!1)))})),y.useEffect((()=>{l.fetchState==="Not-Started"&&e(o!=null?"../../":"../")}),[l,o]),s==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx($,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):g.jsx(Q,{navigate:e,approvalUpdateDataView:r,approvalRuleId:o,approverViewData:l,location:t},o??"new")}export{ne as R,se as i};
@@ -0,0 +1,68 @@
1
+ import{j as s}from"./liveblocks-2F3ER8H4.js";import{u as ne,j as k,h as K,g as J,i as se,N,l as Q,q as lt,n as mt,o as x}from"./core-BmXpopk3.js";import{fF as V,NG as ct,$7 as be,c8 as ge,MM as $e,ma as dt,M$ as me,M_ as ce,$8 as ut,bn as he,gV as Ue,$9 as pt,X1 as bt,l$ as Fe,X2 as Re,X3 as gt,kN as ht,Za as ft,l0 as St,MA as It,Cd as yt,kU as vt,Nl as Le,$a as Me,$b as ke,$c as At,$d as Rt,$e as kt,N5 as Ce,l6 as Ct,Zj as wt,MZ as xt,MK as Et,$f as Bt,MJ as Tt,$g as Dt,MR as we,N9 as jt,N8 as $t,N4 as Ut,$h as Pe,St as Ft,bo as Lt,MU as Mt,ND as Pt,$i as Nt,$j as _t,Nh as Ot,Ne as xe,YG as Gt,MH as Zt,$k as Ne,O4 as Ee,Oc as zt,$l as Vt,$m as X,$n as Ht,$o as _e,$p as Wt,$q as Oe,$r as Ge,Nt as de,bu as qt,bK as fe,cM as Se,d_ as Ze,dZ as ze,$s as Xt,gh as Yt,YT as Jt,$t as Kt,$u as Ve,YX as Qt,ZF as en,$v as tn,_2 as nn,O9 as Be,O8 as an,$w as sn,$x as on,$y as rn,$z as ln,$A as mn,Zp as cn,N$ as dn,O3 as un,bq as pn,bJ as bn,cG as gn,cu as hn,bt as fn,Us as Sn,da as In,dd as yn,dc as vn,cF as An}from"./zeni-epic-state-DtY6MD5C.js";import{bV as Rn,c as He,a2 as We,d as ie,$ as j,z as F,cU as qe,a9 as oe,m as C,aT as Te,I as D,af as ae,ag as kn,G as Xe,cV as Cn,p as Y,at as Ye,cW as wn,O as re,cX as xn,ar as En,ac as Bn,a8 as Ie,U as Je,w as Tn,bD as Dn,aw as jn,aj as $n,E as Ke,cY as Un,h as Fn}from"./index-BH7Z90Ry.js";import{n as _,S as Ln}from"./mui-DpZKsKJ-.js";import ue from"./NotFoundScreen-CjcmfT5h.js";import{S as De}from"./SetupPagesScreen-Cx3OOUGr.js";import{F as Qe}from"./FeaturePreviewScreen-DlYWStt_.js";import{a as f}from"./sentry-Dwi3Xpu2.js";import{u as ye}from"./useAskAiCfoHostNavButtonProps-B82QOIYm.js";import{u as et}from"./useInitialThreadRequest-DagpMHc1.js";import{D as Mn}from"./DrawerScreen-kd-vUIOU.js";import{M as tt}from"./MobileAppDrawer-thURFqdR.js";import{F as Pn}from"./ScreenRoutes-DUiJb0LC.js";import{R as Nn}from"./ReimbursementApprovalRoutes-h6pN24Dd.js";import"./recharts-lgPPofcu.js";import"./analytics-CVpLIXYS.js";import"./plaid-B0sfsJHV.js";import"./dnd-CFbFq_On.js";import"./stripe-cKAAJElX.js";import"./lottie-Do5BYuHO.js";import"./lexical-CUqOWG_f.js";import"./pdf-CaVqV5T4.js";import"./utils-DAgs23EZ.js";import"./BusinessVerificationPageScreen-wzhfqwbN.js";import"./routePaths-DuFLBwyX.js";import"./analyticsHelper-DIAaX2E9.js";import"./InboxNotificationsProvider-jZPrqdDf.js";import"./useTaskManagerAccess-DvrYqbN3.js";import"./getLocaleForTenant-CLcFXXBi.js";import"./useEnsureVendorListLoaded-BtOYIHPo.js";import"./ReimbursementApprovalRuleDetailScreen-La5bMk76.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]="35372954-ce28-46d8-9962-7edb725f62ea",e._sentryDebugIdIdentifier="sentry-dbid-35372954-ce28-46d8-9962-7edb725f62ea")}catch{}})();const nt=e=>`/${e}/reimbursements`,_n=e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{common:q,spendManagement:{reimbursement:{reimbursementDetail:te}}}=Xe.getLocalizedStrings(),On=Q((function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),c=F.getSignedInUser(),d=he(c),m=r.plaidConnectionDetails,o=Ue(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:a??""},l=be(e,t.reimbursementId),b=pt(e,c?.userId??"");let y=`${c?.firstName} ${c?.lastName}`,u=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,u=c?.userId===l.createdBy?.userId);const E=e.entityAutoCompleteState?.autoCompleteText?.common,I=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${ae.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:E,entityAutoCompleteView:I},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:y,isUserAdmin:ge(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:u,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:Fe(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:c,navigate:d,themeState:m}=t,{tenantEmailDomain:o}=r,a=F.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(ce(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(we(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Ut(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e($t())},clearRemiSaveStatus:()=>{e(jt("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(we(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Dt({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(Tt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(Bt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Et({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(xt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Ce(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(wt({data:l}))},onFetchBankName:i=>{e(Ct(i))},submitRemiDetails:()=>{e(Ce("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(ke({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(me({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(kt({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(Rt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(At({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Me()),e(ke({}));const i=nt(o),l=Y(c.state?.pathnameStackToGoBack,c.pathname);d(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(C.trackReimbursementDeleteReimbursement(n),e(Le(n)))},onSaveBankAccount:()=>{a?.userId&&e(vt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(yt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(It(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(St(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(gt({searchString:i,entityType:l,searchOrigin:"common"})):e(Re("common"))},onCancelAutoComplete:()=>{e(Re("common"))}}}}))(Cn);function je(){const e=K(),t=ne(),n=J(),{reimbursementId:r}=se(),c=He(),d=We(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=ie(),{isFeatureEnabled:b}=l(j.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(j.isShowDeletedReimbursementsFeatureEnabled),{isAiCfoAccessEnabled:u,onAskAiCfoClick:E}=ye({mobileExploreReferrer:"Reimbursement Details"}),I=J().pathname,B=I.includes("edit"),T=I.includes("reimbursement/new"),[v,w]=f.useState(!1),h=F.getSignedInUser(),A=k((p=>V(p))),g=k((p=>be(p,r))),L=et(A?.companyId,{clearParams:g.fetchState==="Completed"}),$=ge(A?.userRole??[]);(function(){const p=ne(),M=k((P=>V(P))),O=M?.tenantId,{isApprovalRulesV3Enabled:H,isLoading:G}=Rn(O),W=k((P=>P.remiSetupApproverViewState.fetchState));f.useEffect((()=>{O==null||G||W==="Not-Started"&&p(ct(!0,!1,!1,H))}),[O,G,H,W,p])})(),f.useEffect((()=>{(T&&!v||B&&!v&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(w(!0),t($e(!1,b,y,r)))}));const U=k((p=>dt(p.accountState,p.accountListState,"reimbursementAccountList")));if(h==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"||$&&g.billStatus==="rejected"||$===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(N,{to:R}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(qe,{isNewReimbursement:r==null}):s.jsxs(Gn,{windowSize:d,children:[s.jsx(oe,{analytics:C,onLoad:p=>(M=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&M.trackReimbursementEditReimbursement(r)})(p)}),m&&d!=="small"?s.jsx(Zn,{}):null,m&&d!=="small"?s.jsx(zn,{children:s.jsx(Te,{showAutofill:m,uploadInvoiceEndPoint:`${ae.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:A?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ce(p,a,!0,r,h?.userId))},updateInvoiceUploadFetchState:p=>{t(me({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:D.sp3,paddingBottom:"15px",paddingLeft:D.sp5},dropFilePlaceholder:{upload:q.upload,single:te.dropReceipt.single,or:q.texts.or,multiple:te.dropReceipt.multiple,receipts:q.texts.receipts2}})}):null,m&&d==="small"?s.jsxs(Vn,{children:[s.jsx(Hn,{onClick:()=>o(!1),children:s.jsx(_n,{})}),s.jsx(Te,{showAutofill:m,uploadInvoiceEndPoint:`${ae.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:A?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ce(p,a,!0,r,h?.userId))},updateInvoiceUploadFetchState:p=>{t(me({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:D.sp5,paddingRight:D.sp3,paddingBottom:D.sp5,paddingLeft:D.sp3},dropFilePlaceholder:{upload:q.upload,single:te.dropReceipt.single,or:q.texts.or,multiple:te.dropReceipt.multiple,receipts:q.texts.receipts2}})]}):null,s.jsx(Wn,{windowSize:d,children:s.jsx(On,{initialOpenThreadRequest:L??void 0,location:n,navigate:e,currentTenant:A,reimbursementId:r,themeState:c,uncategorizedAccounts:U,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:u,onAskAiCfoClick:E})})]})}const Gn=_.div`
2
+ display: flex;
3
+ position: relative;
4
+ height: 100vh;
5
+ flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
6
+ background-color: ${e=>e.theme.colors.grey4};
7
+ `,Zn=_.div`
8
+ position: fixed;
9
+ top: 0;
10
+ left: 0;
11
+ right: 0;
12
+ bottom: 0;
13
+ background-color: ${kn.overlayBackgroundBlack};
14
+ z-index: 5;
15
+ `,zn=_.div`
16
+ position: absolute;
17
+ top: 0;
18
+ left: 0;
19
+ width: 42%;
20
+ height: 100%;
21
+ z-index: 6;
22
+ display: flex;
23
+ background-color: transparent;
24
+ overflow: hidden;
25
+ `,Vn=_.div`
26
+ position: fixed;
27
+ top: 0;
28
+ left: 0;
29
+ right: 0;
30
+ bottom: 0;
31
+ z-index: 11;
32
+ display: flex;
33
+ flex-direction: column;
34
+ overflow-y: auto;
35
+ background-color: ${e=>e.theme.colors.grey4};
36
+ `,Hn=_.button`
37
+ align-self: flex-end;
38
+ background: none;
39
+ border: none;
40
+ cursor: pointer;
41
+ padding: ${D.sp2} ${D.sp3};
42
+ line-height: 1;
43
+ color: ${e=>e.theme.colors.hero};
44
+ &:hover {
45
+ color: ${e=>e.theme.colors.primary};
46
+ }
47
+ svg {
48
+ width: ${D.sp4};
49
+ height: ${D.sp4};
50
+ }
51
+ `,Wn=_.div`
52
+ display: flex;
53
+ flex-direction: column;
54
+ width: 100%;
55
+ ${e=>e.windowSize!=="small"?"overflow: auto;":""}
56
+ `,qn=Q((function(e,t){const n=Pe(e,t.reimbursementId),r=F.getSignedInUser(),c=he(r),d=e.tenantState.currentTenantId,m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:d??""},o=`${n.createdBy?.firstName??"Zeni"} ${n.createdBy?.lastName??""}`;let a=!1;n?.remiActivities.length>0&&(a=Nt(n.remiActivities,_t(t.currentTenant),r));const i=ge(t.currentTenant?.userRole??[]),l=r?.userId===n.createdBy?.userId;return{remiDetails:n,uploadInvoiceEndPoint:`${ae.communicationAgentMicroServiceBaseUrl}`,authParams:m,signedInUser:r,createdBy:o,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,isAdmin:i,showApproveRejectBtns:a,isZeniUser:c,isSignedInUserReimbursementCreator:l,isAccountingClassesEnabled:Fe(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:c,navigate:d,themeState:m}=t,{tenantEmailDomain:o}=r;return{onDuplicateLineClick:(a,i)=>window.open(`/${o}/reimbursement/${a}#L${i}`),redirectToReimbursementListScreen:()=>{e(Me());const a=nt(o),i=Y(c.state?.pathnameStackToGoBack,c.pathname);d(a,{state:{pathnameStackToGoBack:i}})},onSaveRealTimeApprovals:a=>{e(Zt(n,"reimbursement",a))},updateEditRealTimeApproverClicked:a=>{e(Gt({isEdit:a,entityId:n,entityType:"reimbursement"}))},approveOrRejectRemi:a=>{a.type==="approved"?e(xe(n,a.type,"")):e(xe(n,a.type,a.description??""))},redirectToEditableReimbursementScreen:()=>{const a=Y(c.state?.pathnameStackToGoBack,c.pathname);d("./edit",{state:{pathnameStackToGoBack:a}})},deleteReimbursement:()=>{C.trackReimbursementDeleteReimbursement(n),e(Le(n))},cancelAndDeleteReport:a=>{a===!0?C.trackReimbursementCancelAndDeleteReimbursement(n):C.trackReimbursementCancelReimbursement(n),e(Ot(n,a))},handleZeniLogoClick:()=>{m.toggle()}}}))(wn);function Xn(){const e=K(),t=ne(),n=J(),r=n.hash.substring(1),c=He(),{reimbursementId:d}=se(),m=F.getSignedInUser(),o=k((R=>V(R))),a=k((R=>Pe(R,d??""))),i=a.remiDetails?.reimbursementInfo.stage.code==="draft",l=et(o?.companyId,{clearParams:a.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:b,onAskAiCfoClick:y}=ye({mobileExploreReferrer:"Reimbursement Details"});Ye({isDataReady:a.fetchState==="Completed"});const{useFeatureGate:u}=ie(),{isFeatureEnabled:E}=u(j.isLimitedCategoryForReimbursement),[I,B]=f.useState(!1),[T,v]=f.useState(!1),[w,h]=f.useState(!1),{isFeatureEnabled:A}=u(j.isShowDeletedReimbursementsFeatureEnabled),g=k((R=>be(R,d??""))),L=Ft(o),$=Lt(o.userRole),U=a.fetchState;if(f.useEffect((()=>{I||d==null?I==1&&U==="Error"&&e("page-not-found",{replace:!0}):(B(!0),t(Mt(d,!1,A)))}),[I,d,t,U]),f.useEffect((()=>{A&&a.remiDetails?.isDeleted===!0||o.isZeni===!0&&m?.userEmailDomain==="zeni.ai"&&L===!1?h(!1):h(a.remiActivities[0]?.isRealTimeApprovalEnabled&&($||a.allApprovers.find((R=>R.user.userId===m?.userId))!=null||a.remiDetails?.lastUpdatedBy===m?.userId))}),[a.remiActivities[0]?.isRealTimeApprovalEnabled,a.allApprovers,a.remiDetails?.lastUpdatedBy,$,o.isZeni,L,m]),f.useEffect((()=>{T||a.fetchState!="Completed"||a.remiDetails?.reimbursementInfo.stage.code=="paid"||a.remiDetails?.reimbursementInfo.stage.code=="scheduled"||g.fetchState=="Completed"||g.fetchState=="In-Progress"||(v(!0),t($e(!1,E,A,d)),a.remiActivities[0]?.isRealTimeApprovalEnabled===!0&&t(Pt(!1,!0,!0,a.lastUpdatedByUserId)))}),[T,a,d,t]),m==null)throw Error("Can't access address page without signing in...");return a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState=="Completed"&&a.remiDetails.isDeleted===!1?s.jsx(N,{to:`./edit${n.search}`}):a.deleteStatus.fetchState==="In-Progress"||a.cancelAndDeleteStatus.fetchState==="In-Progress"||a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState!="Completed"||a.fetchState!="Completed"?s.jsx(qe,{}):s.jsxs(s.Fragment,{children:[s.jsx(oe,{analytics:C,onLoad:R=>(p=>{d!=null&&p.trackReimbursementReimbursementDetails(d)})(R)}),s.jsx(qn,{initialOpenThreadRequest:l??void 0,scrollId:r,isShowDeletedReimbursementEnabled:A,location:n,navigate:e,isRealTimeApprovalEnabled:w,currentTenant:o,reimbursementId:d??"",themeState:c,isAiCfoAccessEnabled:b,onAskAiCfoClick:y})]})}const Yn=Q((function(e,t){return{remisReviewView:Ne(e),analytics:t.analytics}}),(function(e,t){return{onCloseOverlay:()=>{t.navigate(`/${t.tenantEmailDomain}/reimbursements`),e(X())},onCloseReviewItem:n=>{e(Vt(n))},onProceedForBulkActionClick:(n,r)=>{switch(n){case"send_for_approval":e(zt());break;case"approve":e(Ee("approved",r??""));break;case"reject":e(Ee("rejected",r??""))}}}}))(xn);function Jn({tenantEmailDomain:e}){const t=K(),n=k((m=>m.remisBulkActionViewState.bulkSubmissionFetchState.fetchState)),{remisForReview:r}=k((m=>Ne(m))),c=re(),d=c?.loggedInUserRole?.includes("admin")===!0;return f.useEffect((()=>{n!=="Completed"&&r.length!==0||t(`/${e}/reimbursements`)}),[n,r.length,e]),s.jsx(Yn,{navigate:t,analytics:C,isAdmin:d,tenantEmailDomain:e})}const z=Qt(),at="bulk-operation-update",pe="reimbursement-approval-rule-update",{spendManagement:Kn,common:le}=Xe.getLocalizedStrings(),Qn=Kn.reimbursement.bulkActions,ea=_.div`
57
+ display: flex;
58
+ min-height: 100%;
59
+ width: 100%;
60
+ flex: 1 1 auto;
61
+ flex-direction: column;
62
+ align-items: center;
63
+ background-color: ${e=>e.theme.colors.grey4};
64
+ `,ta=Q((function(e,t){const n=Ge(e,z,t.isBulkActionEnabled);let r=n.allSubTabs;const c=F.getSignedInUser(),d=he(c),m=e.tenantState.currentTenantId,o=V(e),a=o?.companyName??"",i={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:m??""},l=e.remiListState.downloadUIState.downloadState;t.isShowDeletedReimbursementEnabled===!1&&(r=r.filter((u=>u!=="deleted")));const b=n.fetchState,y=en(e);return{transactionList:t.isShowDeletedReimbursementEnabled?n.reimbursements:n.reimbursements.filter((u=>u.isDeleted===!1)),isAdmin:t.isAdmin,isZeniUser:d,allSubTabs:r,isEmployee:t.isEmployee,currentTab:n.currentTab,currentSubTab:n.currentSubTab,approvalCount:n.approvalCount,fetchState:b,botEmail:n.reimbursementBotEmail,analytics:C,uiState:n.uiState,searchText:n.searchText,filters:n.filters,downloadParams:{authParams:i,companyName:a,timePeriod:z,spendManagementEndPoint:`${jn}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:l,isBulkActionAllowed:n.remiListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:n.remiListBulkActionInfo?.remisSelectedForBulkAction,allowedBulkActions:n.remiListBulkActionInfo?.allowedBulkActions,remiApprovalRulesAffectedEntityIds:y.affectedEntityIds}}),(function(e,t){const{navigate:n,currentTenant:r,location:c,period:d}=t,{tenantEmailDomain:m}=r;return{updateTabToState:o=>{e(X()),e(_e(o))},onSubtabChange:o=>{e(X()),e(Oe(o))},onTransactionClick:(o,a)=>{const i=sa(m,o,a),l=Y(c.state?.pathnameStackToGoBack,c.pathname);n(i,{state:{pathnameStackToGoBack:l}})},onClickSetupIcon:()=>{const o=aa(m),a=Y(c.state?.pathnameStackToGoBack,c.pathname);n(o,{state:{pathnameStackToGoBack:a}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;C?.trackReimbursementNewReimbursement();const a=`/${o}/reimbursement/new`,i=Y(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(a,{state:{pathnameStackToGoBack:i}})},onColumnSortConfigChanged:(o,a)=>{e(mn({uiState:{sortKey:o,sortOrder:a},period:t.period}))},onSearchTextChanged:o=>{e(ln(o))},onFiltersChange:o=>{e(rn({filters:o})),o.categories.every((a=>a.field!=null&&a.values?.length!==0))&&C.trackSpendManagmentFilterChange("reimbursement",o.categories.map((a=>`${a.field}-${JSON.stringify(a.values)}`)))},updateDownloadStateHandler:o=>{o==="In-Progress"&&C.trackSpendManagementDownloadClick("reimbursement"),e(on({uiState:{downloadState:o}}))},onReloadTransactions:()=>{e(de(d,!0,t.isShowDeletedReimbursementEnabled,!1,!0))},onBackClick:()=>{n("../",{relative:"path"})},onNavigateToSettings:()=>{n("../reimbursements/setup")},updateBulkActionList:o=>{e(sn(o))},removeAllTransactionsFromBulkActionList:()=>{e(X())},onProceedForBulkActionClick:(o,a)=>{switch(o){case"delete":case"cancel":e(an(o,a??""));break;case"send_for_approval":e(Be("send_for_approval")),t.navigate("./bulk-review");break;case"review":e(Be("approve")),t.navigate("./bulk-review")}},onReimbursementApprovalRulesEventReceived:o=>{o.endsWith(pe)&&e(nn(!1))},onEventReceived:o=>{o===at&&e(tn())}}}))(Tn(Dn));function na(){const e=K(),t=ne(),n=J(),r=n.state,c=We(),[d,m]=f.useState(null),o=lt("/:tenantEmailDomain/reimbursements/bulk-review")!=null;f.useEffect((()=>{if(r?.tab!=null&&r?.subTab!=null){const S=Ht(r.tab.toString());S!=null?t(_e(S)):console.log("Warning:Not a valid remiListTab");const Z=Wt(r.subTab.toString());Z!=null?t(Oe(Z)):console.log("Warning:Not a valid remiListSubTab")}return()=>{t(X())}}),[]);const{useFeatureGate:a}=ie(),{isFeatureEnabled:i}=a(j.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:l}=a(j.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:b}=a(j.isReimbursementBulkActionEnabled),y=F.getSignedInUser(),u=k((S=>V(S))),[E,I]=f.useState(!1),[B,T]=f.useState(!1),v=re(),w=v?.loggedInUserRole?.includes("admin")===!0,h=k((S=>Ge(S,z,b))),{areTenantIdsInSync:A}=En(),g=h.fetchState,{isAiCfoAccessEnabled:L,onAskAiCfoClick:$}=ye({mobileExploreReferrer:"Reimbursement List"});if(Ye({isDataReady:g==="Completed"}),f.useEffect((()=>{!B&&A&&(T(!0),t(de(z,!0,l,!1,!0)))}),[B,z,t,A]),y==null)throw Error("Can't access address page without signing in...");const U=!!u?.userRole&&qt(u),R=fe(v?.loggedInUserRoleMap),p=Se(v?.loggedInUserRoleMap),M=!!u.userReimbursementInfo?.isReimbursementTOSAccepted,O=!!u.companyReimbursementInfo?.info?.isReimbursementEnabled,H=!!u.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,G=k((S=>Ue(S.companyState,u.companyId))),W=G?.company.featuresActivationInfo.connectedAccountProvider,P=S=>{I(S)},{isFeatureEnabled:st}=a(j.isDebitCardFeatureEnabled),it=Ze(st,u),ot=ze(u),{remisProcessed:ee,remisProcessing:ve}=k((S=>Xt(S)));f.useEffect((()=>{ee===ve&&d!=null&&(t(Yt({messageSection:"reimbursement_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_report_",variableValue:ee>1?le.texts.reports2:Qn.report},{variableName:"_has_",variableValue:ee>1?le.texts.have:le.texts.has},{variableName:"_action_",variableValue:Jt(d)}]})),t(Kt()),setTimeout((()=>{t(de(z,!0,l,!1,!0,!0))}),3e3),m(null))}),[ee,ve]);const rt={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${at}`,`private-encrypted-${u.companyId}.${pe}`]:[],eventCallback:(S,Z,Ae)=>{S.endsWith(pe)?Ae.onReimbursementApprovalRulesEventReceived?.(S):Z.entity_type==="reimbursement"&&(m(Z.operation_type),Ae.onEventReceived(S))}};return n.pathname.endsWith("/reimbursements/")||n.pathname.endsWith("/reimbursements")||n.pathname.endsWith("/reimbursements/bulk-review")?it===!0||ot===!0?s.jsx(Qe,{}):O&&(!U||R)||p&&M?s.jsxs(s.Fragment,{children:[g==="Completed"?s.jsx(oe,{analytics:C,onLoad:S=>(Z=>Z.trackPageLoaded(Je.Event.reimbursementHome))(S)}):null,s.jsx(tt,{isAppContentDrawerOpen:E,handleDrawerToggle:P}),s.jsxs(ea,{windowSize:c,children:[s.jsx(Mn,{isOpen:o,drawerLeftMargin:new Bn(0,0,300,600),onClose:()=>{e(`/${u.tenantEmailDomain}/reimbursements`),t(X())},children:s.jsx(ia,{onClick:S=>S.stopPropagation(),children:s.jsx(Jn,{tenantEmailDomain:u.tenantEmailDomain})})}),s.jsx(ta,{isShowDeletedBillsEnabled:i,isShowDeletedReimbursementEnabled:l,location:n,navigate:e,currentTenant:u,period:z,isAdmin:w,isEmployee:U,entity:"reimbursement",onClickMenuIcon:()=>{P(!0)},createdByUserList:h.createdByUserList,createdByUserListFetchState:h.createdByUserListFetchState,isDownloadEnabled:h.isDownloadEnabled,connectedAccountProvider:W,isBulkActionEnabled:b,bulkSubmissionLimit:h.remiBulkSubmissionLimit,bulkSubmissionFetchState:h.remiListBulkActionInfo.bulkSubmissionFetchState,isAiCfoAccessEnabled:L,onAskAiCfoClick:$,...rt})]})]}):H&&R?s.jsx(N,{to:"../setup"}):v!=null&&Ve(u,v.loggedInUserRoleMap)?s.jsx(N,{to:"../promo"}):s.jsx(Ie,{fetchState:"In-Progress"}):s.jsx(ue,{})}const aa=e=>`/${e}/reimbursements/setup`,sa=(e,t,n)=>{let r=`/${e}/reimbursement/${encodeURIComponent(t)}`;return n=="draft"&&(r+="/edit"),r},ia=_(Ln)`
65
+ display: flex;
66
+ min-height: 100%;
67
+ flex-direction: column;
68
+ `,oa=Q((function(e,t){const{companyId:n}=t;return{reimbursementSetupView:cn(e,n),analytics:C,videoUrl:"https://player.vimeo.com/video/814821498?h=e7fd11e13e&badge=0&autopause=0&player_id=0&app_id=122963"}}),(function(e,t){const{companyId:n,navigate:r}=t;return{onSetupButtonClick:()=>{e(un(n))},onCreateNewRemiButtonClick:()=>{e(dn(t.userRoleId))},onBackClick:()=>{r("../..",{relative:"path"})},onSetupReimbursementSuccess:()=>{t.isEmployee?r("../../reimbursement/new",{relative:"path"}):r("../reimbursements/setup",{relative:"path"})}}}))(Un),ra=()=>{const e=$n(),t=K(),n=J(),{tenantEmailDomain:r}=se(),c=Ke(),[d,m]=f.useState(!1),o=k((w=>V(w))),a=F.getSignedInUserTenant(r)?.companyId??o.companyId,i=F.getSignedInUser(),l=o.userRoleId,b=!!o.userRole?.includes("reimbursements_user"),y=re(),u=fe(y?.loggedInUserRoleMap),E=Se(y?.loggedInUserRoleMap),I=!!o.userReimbursementInfo?.isReimbursementTOSAccepted,B=!!o.companyReimbursementInfo?.info?.isReimbursementEnabled,T=!!o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,v=w=>{m(w)};if(i==null)throw Error("Can't access reimbursement promo page without signing in...");return B&&E&&I?s.jsx(N,{to:"../../../reimbursements"}):T&&u?s.jsx(N,{to:"../../reimbursements/setup"}):o.companyReimbursementInfo&&!T||o.userReimbursementInfo&&E&&I===!1?s.jsxs(s.Fragment,{children:[s.jsx(oe,{analytics:C,onLoad:w=>(h=>h.trackPageLoaded(Je.Event.reimbursementPromoPage))(w)}),s.jsx(tt,{isAppContentDrawerOpen:d,handleDrawerToggle:v}),s.jsx(oa,{companyId:a,navigate:t,meetingUrl:e("reimbursement_promo"),location:n,userReimbursementInfo:o.userReimbursementInfo,userRoleId:l,isEmployee:b,onClickMenuIcon:()=>{v(!0)}})]}):s.jsx(Ie,{fetchState:"In-Progress",style:{backgroundColor:c.colors.grey5}})};function _a(){const e=k((P=>V(P))),t=re(),n=!!e.company?.companyReimbursementInfo.isReimbursementEnabled,r=Ke(),c=!!e.company?.companyReimbursementInfo.isReimbursementTOSAccepted,d=!!e.userReimbursementInfo?.isReimbursementTOSAccepted,{useFeatureGate:m}=ie(),{isFeatureEnabled:o}=m(j.isChargeCardFeatureEnabled),{isFeatureEnabled:a}=m(j.isDebitCardFeatureEnabled),i=Ze(a,e),l=ze(e),b=e?.userRole!=null&&pn(e?.userRole),y=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b)&&bn(t?.loggedInUserRoleMap),u=gn(t?.loggedInUserRoleMap),E=e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!b,I=fe(t?.loggedInUserRoleMap),B=E&&I,T=!!e.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!b,v=T&&hn(t?.loggedInUserRoleMap),w=Fn(e,o,a)&&!b,h=w&&fn(t?.loggedInUserRoleMap),A=Sn(t?.loggedInUserRoleMap),g=In(t?.loggedInUserRoleMap),L=yn(t?.loggedInUserRoleMap),$=T&&g,U=e.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!b&&L,R=vn(t?.loggedInUserRoleMap),p=An(t?.loggedInUserRoleMap),M=Se(t?.loggedInUserRoleMap),O=w&&R,{tenantEmailDomain:H}=se(),G=J(),W=n===!0&&(I||M&&d);return s.jsxs(mt,{children:[G.pathname.includes("/reimbursements")?s.jsxs(s.Fragment,{children:[s.jsx(x,{path:"verification",element:s.jsx(De,{isBillPayAdminLevelAccess:y,isUserHasOnlyBillPayAccess:u,isReimbursementAdminLevelAccess:B,isZeniAccountAdminLevelAccess:v,isChargeCardAdminLevelAccess:h,isUserHasOnlyCardAccess:A,productType:"reimbursement",type:"verification"})}),s.jsx(x,{path:"setup",element:s.jsx(De,{isBillPayAdminLevelAccess:y,isUserHasOnlyBillPayAccess:u,isReimbursementAdminLevelAccess:B,isZeniAccountAdminLevelAccess:v,isChargeCardAdminLevelAccess:h,isUserHasOnlyCardAccess:A,productType:"reimbursement",type:"setup"})}),s.jsx(x,{path:"promo",element:s.jsx(ra,{})}),s.jsx(x,{path:"approval-rules/*",element:B?s.jsx(Nn,{}):s.jsx(Pn,{showZeniAccountRoute:$,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:M,showTreasuryRoute:U,isTenantBankingOnly:i,showChargeCardRoute:O,tenantEmailDomain:H??""})}),W&&s.jsx(x,{path:"*",element:s.jsx(na,{})}),(i===!0||l===!0)&&s.jsx(x,{path:"/*",element:s.jsx(Qe,{})}),t!=null&&Ve(e,t?.loggedInUserRoleMap)&&s.jsx(x,{path:"*",element:s.jsx(N,{to:"../promo"})}),c&&I&&s.jsx(x,{path:"*",element:s.jsx(N,{to:"../setup"})})]}):G.pathname.includes("/reimbursement")?s.jsxs(s.Fragment,{children:[s.jsx(x,{path:"new",element:s.jsx(je,{})}),s.jsx(x,{path:":reimbursementId",element:s.jsx(Xn,{})}),s.jsx(x,{path:":reimbursementId/edit",element:s.jsx(je,{})}),s.jsx(x,{path:"*",element:s.jsx(ue,{})})]}):s.jsx(x,{path:"*",element:s.jsx(Ie,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5,boxShadow:`0px 2px ${D.sp1} ${r.colors.dropShadowNormal}`}})}),s.jsx(x,{path:"*",element:s.jsx(ue,{})})]})}export{_a as default};
@@ -1 +1 @@
1
- import{j as p}from"./liveblocks-e6rGc1UF.js";import{g as K,h as Ve,u as Fe,i as Oe,j as d,l as De,n as Ae,o as X}from"./core-CHD8T-IM.js";import{fF as N,Eb as R,UQ as Pe,l$ as ne,ua as re,u$ as D,lG as Ee,lP as A,lH as P,kK as E,kB as U,kA as Ue,Dj as le,v4 as Le,bq as Me,UR as Be,bn as ve,Ey as xe,US as ze,UT as Ge,ci as g,Dc as He,UU as J,UV as Ye,UW as $e,UX as Ne,UY as qe,UZ as Ze,U_ as Qe,U$ as We,V0 as Ke,V1 as Xe,V2 as Je,V3 as ea,V4 as aa,V5 as j,V6 as L,V7 as M,V8 as B,V9 as v,Va as x,Vb as z,Vc as G,Vd as H,Ve as Y,ei as sa,Ec as ta,D$ as ee,E0 as ae,Ei as oa,E4 as se,Eo as na,Vf as ra,Vg as la,Vh as ca,Vi as ia,Vj as da,Vk as pa,Vl as _a,Vm as fa,Vn as ma,Vo as ua,d_ as ba,dZ as ha}from"./zeni-epic-state-BO3zdDfL.js";import{ao as ya,ap as wa,aq as Ca,a as Sa,a2 as ga,N as ce,f as ie,z as de,ar as Ia,W as Ra,d as Ta,as as ja,at as ka,a9 as Va,k as $,U as Fa,y as Oa,p as pe,au as Da,av as Aa,aw as Pa}from"./index-DKH4PK2B.js";import"./mui-NTaF3UaY.js";import Ea from"./NotFoundScreen-CtgFRYZy.js";import{F as Ua}from"./FeaturePreviewScreen-D54Nwanb.js";import{a as u}from"./sentry-DsyKtMW2.js";import{u as La}from"./useInitialThreadRequest-DDr_z_RH.js";import{t as te,a as oe,b as Ma}from"./routePaths-CGyE-cU7.js";import{M as Ba}from"./MobileAppDrawer-DX2JnkbM.js";import"./recharts-C6xUtcdL.js";import"./analytics-C3e3An3a.js";import"./plaid-DdTo7m1-.js";import"./dnd-Dwi6R-ey.js";import"./stripe-cKAAJElX.js";import"./lottie-B778bt56.js";import"./lexical-CMNdypK6.js";import"./pdf-Bx92ZlM_.js";import"./utils-CCA3F0sZ.js";import"./InboxNotificationsProvider-x0fdv66l.js";import"./useTaskManagerAccess-CUv6a62x.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]="6832ca69-7f0a-41e3-99a1-4c0e782ca029",e._sentryDebugIdIdentifier="sentry-dbid-6832ca69-7f0a-41e3-99a1-4c0e782ca029")}catch{}})();const va=["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}))},xa=e=>{e(la()),e(ca()),e(ia()),e(da()),e(pa()),e(_a()),e(fa()),e(ma()),e(ua())},za=De((function(e){const o=de.getSignedInUser(),_=e.tenantState.currentTenantId,m=N(e),a=m?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:_??""},t=R(e),r=Be(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:ve(o),showAccountGroups:r===!0,isAccountingClassesEnabled:ne(e),isAccountingProjectsEnabled:re(e),currentTenantCompanyName:a,statementEndPoint:`${Pa}/statement`,authParams:s,isZeniCOAUsed:r}}),(function(e,o){const{navigate:_,handleDrawerToggle:m}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(D(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(ra(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(na(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:f,balancesRange:i}=l;let c=[...f];a==="year"&&(c=c.filter((w=>w!=="this_period_vs_same_period_last_year"&&w!=="this_period_vs_same_period_last_year_percent"&&w!=="same_period_last_year"))),e(ee(o.firstMonthOfFY,r,i.numberOfPeriods<1?1:i.numberOfPeriods,c)),f.length>0&&e(ae(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(se({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(J({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(se(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(oa(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(ee(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(ae(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(ta({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=sa(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 te(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return oe(o.tenantEmailDomain,a.accountId,a.accountType,s.id,f,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?Ma(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,f,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?oe(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],f,r,l):a.accountType!=null?te(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l):void 0})();if(i!=null){const c=pe(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(Ke({viewMode:a}))):r?(e(Xe({viewMode:a})),e(Je({viewMode:a}))):(e(ea({viewMode:a})),e(aa({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(qe({classesToFilterOut:a})):I(o.selectedReportID)?e(Ze({classesToFilterOut:a})):e(Qe({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{g(o.selectedReportID)?e(Ye({projectsToFilterOut:a})):I(o.selectedReportID)?e($e({projectsToFilterOut:a})):e(Ne({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(J({classViewLayout:a}))},onOpenAccountViewMode:()=>{const a=I(o.selectedReportID),s=g(o.selectedReportID);o.isAccountingClassesEnabled&&e(s?P():a?U():He()),o.isAccountingProjectsEnabled&&e(s?A():a?E():le())},onUpdateDisplayOrder:a=>{e(Ge(a))},onUpdateReportFormat:a=>{xa(e),e(ze(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"?xe(a==="profit_and_loss_by_projects"?"profit_and_loss_by_projects":"profit_and_loss_by_classes"):A(!0):P(!0):E(!0):U(!0))}}}))(Da);function Ga(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Sa(),_=ga(),m=Aa(_),a=Ve(),s=Fe(),t=K(),{tenantEmailDomain:r}=Oe(),{useFeatureGate:l}=ce(),{isFeatureEnabled:f}=l(ie.isReportsHorizontalClassLayoutSwitchEnabled),i=de.getSignedInUser(),[c,w]=u.useState(!1),[q,_e]=u.useState(!1);if(i==null)throw Error("Can't access reports page without signing in...");const V=d((n=>N(n))),fe=V.masterTOSInfo?.isMasterTOSAccepted??!1,me=V.company?.companyInfo.firstMonthOfFY??1,ue=La(V?.companyId),C=d((n=>R(n).fetchState)),be=d((n=>Pe(n))),{areTenantIdsInSync:b}=Ia(),F=d((n=>n.financeStatementState.selectedReportId)),T=d((n=>ne(n))),S=d((n=>re(n))),he=d((n=>R(n).isCompareModeOn)),h=d((n=>R(n).filter)),O=d((n=>R(n).selectedReportAndTimeframeFetchState)),ye=d((n=>n.profitAndLossClassesViewState.uiState.classViewLayout));u.useEffect((()=>{!c&&b&&(w(!0),s(D(i.userId,!0,!0,!1)))}),[c,i,s,b]),u.useEffect((()=>{c&&!q&&C==="Completed"&&b&&(s(D(i.userId,!1,!0,!1)),_e(!0))}),[c,q,C,b]),u.useEffect((()=>{if(c&&O.fetchState==="Not-Started"&&h.timeframe!=="free_range"&&h.timeframe!=="week"&&b)switch(F){case"profit_and_loss":case"profit_and_loss_by_classes":s(Le(h.timeframe));break;case"profit_and_loss_by_projects":S&&s(le());break;case"balance_sheet":s(Ue(h.timeframe));break;case"balance_sheet_by_classes":T&&s(U());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(Ee(h.timeframe))}}),[c,F,O,b,T,S]);const Z=Ra(),we=Z?.loggedInUserRole!=null&&Me(Z?.loggedInUserRole)!==!0,[Ce,Se]=u.useState(!1),Q=n=>{Se(n)},ge=Ta(),Ie=ja();return(function(n){const{isDataReady:Re}=n,{pathname:Te}=K(),W=ya(Te??"")==="reports",je=wa(Re),ke=u.useMemo((()=>W?va:void 0),[W]);Ca({canFetchSuggestedQuestions:je,pageContexts:ke})})({isDataReady:C==="Completed"}),ka({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(Va,{analytics:$,onLoad:n=>n.trackPageLoaded(Fa.Event.reports)}):null,p.jsx(Ba,{isAppContentDrawerOpen:Ce,handleDrawerToggle:Q}),p.jsx(za,{firstMonthOfFY:me,tenantEmailDomain:r,location:t,navigate:a,windowSize:_,classViewLayout:ye,selectedReportID:F,analytics:$,filter:h,isAccountingClassesEnabled:T,isAccountingProjectsEnabled:S,isCompareModeOn:he,hasTransactionAccess:we,signedInUser:i,selectedReportAndTimeframeFetchState:O,handleDrawerToggle:Q,reportsResyncFetchState:be.reportsResyncFetchState,isAiCfoAccessEnabled:Ie&&ge&&!e,onAskAiCfoClick:()=>{if(fe)if(m){const n=pe(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else Oa({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:f,initialOpenThreadRequest:ue})]})}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 ps(){const e=d((s=>N(s))),{useFeatureGate:o}=ce(),{isFeatureEnabled:_}=o(ie.isDebitCardFeatureEnabled),m=ba(_,e),a=ha(e);return m===!0||a===!0?p.jsx(Ua,{}):p.jsxs(Ae,{children:[p.jsx(X,{path:"/",element:p.jsx(Ga,{})}),p.jsx(X,{path:"*",element:p.jsx(Ea,{})})]})}export{ps as default};
1
+ import{j as p}from"./liveblocks-2F3ER8H4.js";import{g as J,h as ke,u as Fe,i as Oe,j as d,l as De,n as Ae,o as W}from"./core-BmXpopk3.js";import{fF as q,Eb as R,U_ as Pe,l$ as ne,ua as re,u$ as D,lG as Ee,lP as A,lH as P,kK as E,kB as L,kA as Le,Dj as le,v4 as Me,bq as Be,U$ as ve,bn as Ue,Ey as xe,V0 as ze,V1 as Ge,ci as g,Dc as He,V2 as X,V3 as $e,V4 as Ye,V5 as qe,V6 as Ne,V7 as Ze,V8 as Ke,V9 as Qe,Va as Je,Vb as We,Vc as Xe,Vd as ea,Ve as aa,Vf as V,Vg as M,Vh as B,Vi as v,Vj as U,Vk as x,Vl as z,Vm as G,Vn as H,Vo as $,ei as sa,Ec as ta,D$ as ee,E0 as ae,Ei as oa,E4 as se,Eo as na,Vp as ra,Vq as la,Vr as ca,Vs as ia,Vt as da,Vu as pa,Vv as _a,Vw as fa,Vx as ma,Vy as ua,d_ as ba,dZ as ha}from"./zeni-epic-state-DtY6MD5C.js";import{ao as ya,ap as wa,aq as Ca,a as Sa,a2 as ga,d as ce,$ as ie,z as de,ar as Ia,O as Ra,f as Ta,as as Va,at as ja,a9 as ka,m as Y,U as Fa,y as Oa,p as pe,au as Da,av as Aa,aw as Pa}from"./index-BH7Z90Ry.js";import"./mui-DpZKsKJ-.js";import Ea from"./NotFoundScreen-CjcmfT5h.js";import{F as La}from"./FeaturePreviewScreen-DlYWStt_.js";import{a as u}from"./sentry-Dwi3Xpu2.js";import{u as Ma}from"./useInitialThreadRequest-DagpMHc1.js";import{t as te,a as oe,b as Ba}from"./routePaths-DuFLBwyX.js";import{M as va}from"./MobileAppDrawer-thURFqdR.js";import"./recharts-lgPPofcu.js";import"./analytics-CVpLIXYS.js";import"./plaid-B0sfsJHV.js";import"./dnd-CFbFq_On.js";import"./stripe-cKAAJElX.js";import"./lottie-Do5BYuHO.js";import"./lexical-CUqOWG_f.js";import"./pdf-CaVqV5T4.js";import"./utils-DAgs23EZ.js";import"./InboxNotificationsProvider-jZPrqdDf.js";import"./useTaskManagerAccess-DvrYqbN3.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]="417142b7-20d6-4cef-a8d4-54843ab8361c",e._sentryDebugIdIdentifier="sentry-dbid-417142b7-20d6-4cef-a8d4-54843ab8361c")}catch{}})();const Ua=["profit_loss","balance_sheet","cash_flow"],I=e=>e==="balance_sheet"||e==="balance_sheet_by_classes"||e==="balance_sheet_by_projects",y=e=>{e($({resetLeftScroll:!0})),e(H({resetLeftScroll:!0})),e(G({resetLeftScroll:!0})),e(z({resetLeftScroll:!0})),e(x({resetLeftScroll:!0})),e(U({resetLeftScroll:!0})),e(M({resetLeftScroll:!0})),e(v({resetLeftScroll:!0})),e(B({resetLeftScroll:!0}))},xa=e=>{e(la()),e(ca()),e(ia()),e(da()),e(pa()),e(_a()),e(fa()),e(ma()),e(ua())},za=De((function(e){const o=de.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:Y,isZeniUser:Ue(o),showAccountGroups:r===!0,isAccountingClassesEnabled:ne(e),isAccountingProjectsEnabled:re(e),currentTenantCompanyName:a,statementEndPoint:`${Pa}/statement`,authParams:s,isZeniCOAUsed:r}}),(function(e,o){const{navigate:_,handleDrawerToggle:m}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(D(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(ra(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(na(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:f,balancesRange:i}=l;let c=[...f];a==="year"&&(c=c.filter((w=>w!=="this_period_vs_same_period_last_year"&&w!=="this_period_vs_same_period_last_year_percent"&&w!=="same_period_last_year"))),e(ee(o.firstMonthOfFY,r,i.numberOfPeriods<1?1:i.numberOfPeriods,c)),f.length>0&&e(ae(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(V(a)),(I(a)||g(a))&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(se({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(X({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(se(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(oa(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(ee(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(ae(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(ta({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=sa(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 te(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return oe(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?oe(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],f,r,l):a.accountType!=null?te(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l):void 0})();if(i!=null){const c=pe(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($({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(U({scrollPosition:s}));break;case"cash_flow_by_classes":e(v({scrollPosition:s}));break;case"cash_flow_by_projects":e(B({scrollPosition:s}));break;case"cash_flow":e(M({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($({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(U({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_classes":e(v({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_projects":e(B({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(M({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(Qe({viewMode:a})),e(Je({viewMode:a}))):r?(e(We({viewMode:a})),e(Xe({viewMode:a}))):(e(ea({viewMode:a})),e(aa({viewMode:a}))),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",j(t)),e(V(l?"cash_flow_by_classes":r?"balance_sheet_by_classes":"profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",j(t)),e(V(l?"cash_flow_by_projects":r?"balance_sheet_by_projects":"profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",j(t)),e(V(l?"cash_flow":r?"balance_sheet":"profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{g(o.selectedReportID)?e(Ne({classesToFilterOut:a})):I(o.selectedReportID)?e(Ze({classesToFilterOut:a})):e(Ke({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{g(o.selectedReportID)?e($e({projectsToFilterOut:a})):I(o.selectedReportID)?e(Ye({projectsToFilterOut:a})):e(qe({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(X({classViewLayout:a}))},onOpenAccountViewMode:()=>{const a=I(o.selectedReportID),s=g(o.selectedReportID);o.isAccountingClassesEnabled&&e(s?P():a?L():He()),o.isAccountingProjectsEnabled&&e(s?A():a?E():le())},onUpdateDisplayOrder:a=>{e(Ge(a))},onUpdateReportFormat:a=>{xa(e),e(ze(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"?xe(a==="profit_and_loss_by_projects"?"profit_and_loss_by_projects":"profit_and_loss_by_classes"):A(!0):P(!0):E(!0):L(!0))}}}))(Da);function Ga(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Sa(),_=ga(),m=Aa(_),a=ke(),s=Fe(),t=J(),{tenantEmailDomain:r}=Oe(),{useFeatureGate:l}=ce(),{isFeatureEnabled:f}=l(ie.isReportsHorizontalClassLayoutSwitchEnabled),i=de.getSignedInUser(),[c,w]=u.useState(!1),[N,_e]=u.useState(!1);if(i==null)throw Error("Can't access reports page without signing in...");const k=d((n=>q(n))),fe=k.masterTOSInfo?.isMasterTOSAccepted??!1,me=k.company?.companyInfo.firstMonthOfFY??1,ue=Ma(k?.companyId),C=d((n=>R(n).fetchState)),be=d((n=>Pe(n))),{areTenantIdsInSync:b}=Ia(),F=d((n=>n.financeStatementState.selectedReportId)),T=d((n=>ne(n))),S=d((n=>re(n))),he=d((n=>R(n).isCompareModeOn)),h=d((n=>R(n).filter)),O=d((n=>R(n).selectedReportAndTimeframeFetchState)),ye=d((n=>n.profitAndLossClassesViewState.uiState.classViewLayout));u.useEffect((()=>{!c&&b&&(w(!0),s(D(i.userId,!0,!0,!1)))}),[c,i,s,b]),u.useEffect((()=>{c&&!N&&C==="Completed"&&b&&(s(D(i.userId,!1,!0,!1)),_e(!0))}),[c,N,C,b]),u.useEffect((()=>{if(c&&O.fetchState==="Not-Started"&&h.timeframe!=="free_range"&&h.timeframe!=="week"&&b)switch(F){case"profit_and_loss":case"profit_and_loss_by_classes":s(Me(h.timeframe));break;case"profit_and_loss_by_projects":S&&s(le());break;case"balance_sheet":s(Le(h.timeframe));break;case"balance_sheet_by_classes":T&&s(L());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(Ee(h.timeframe))}}),[c,F,O,b,T,S]);const Z=Ra(),we=Z?.loggedInUserRole!=null&&Be(Z?.loggedInUserRole)!==!0,[Ce,Se]=u.useState(!1),K=n=>{Se(n)},ge=Ta(),Ie=Va();return(function(n){const{isDataReady:Re}=n,{pathname:Te}=J(),Q=ya(Te??"")==="reports",Ve=wa(Re),je=u.useMemo((()=>Q?Ua:void 0),[Q]);Ca({canFetchSuggestedQuestions:Ve,pageContexts:je})})({isDataReady:C==="Completed"}),ja({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(ka,{analytics:Y,onLoad:n=>n.trackPageLoaded(Fa.Event.reports)}):null,p.jsx(va,{isAppContentDrawerOpen:Ce,handleDrawerToggle:K}),p.jsx(za,{firstMonthOfFY:me,tenantEmailDomain:r,location:t,navigate:a,windowSize:_,classViewLayout:ye,selectedReportID:F,analytics:Y,filter:h,isAccountingClassesEnabled:T,isAccountingProjectsEnabled:S,isCompareModeOn:he,hasTransactionAccess:we,signedInUser:i,selectedReportAndTimeframeFetchState:O,handleDrawerToggle:K,reportsResyncFetchState:be.reportsResyncFetchState,isAiCfoAccessEnabled:Ie&&ge&&!e,onAskAiCfoClick:()=>{if(fe)if(m){const n=pe(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else Oa({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:f,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 ps(){const e=d((s=>q(s))),{useFeatureGate:o}=ce(),{isFeatureEnabled:_}=o(ie.isDebitCardFeatureEnabled),m=ba(_,e),a=ha(e);return m===!0||a===!0?p.jsx(La,{}):p.jsxs(Ae,{children:[p.jsx(W,{path:"/",element:p.jsx(Ga,{})}),p.jsx(W,{path:"*",element:p.jsx(Ea,{})})]})}export{ps as default};
@@ -0,0 +1 @@
1
+ import{j as a}from"./liveblocks-2F3ER8H4.js";import{z as w,a9 as N,m as u,U as D,e4 as E,d as k,$ as I}from"./index-BH7Z90Ry.js";import"./mui-DpZKsKJ-.js";import g from"./NotFoundScreen-CjcmfT5h.js";import{a as l}from"./sentry-Dwi3Xpu2.js";import{u as C,j as h,h as F,g as L,l as U,n as T,o as f,N as y}from"./core-BmXpopk3.js";import{fF as _,a2f as j,a2g as p,DS as P,p$ as V,a2h as $,DQ as z}from"./zeni-epic-state-DtY6MD5C.js";import"./recharts-lgPPofcu.js";import"./analytics-CVpLIXYS.js";import"./plaid-B0sfsJHV.js";import"./dnd-CFbFq_On.js";import"./stripe-cKAAJElX.js";import"./lottie-Do5BYuHO.js";import"./lexical-CUqOWG_f.js";import"./pdf-CaVqV5T4.js";import"./utils-DAgs23EZ.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]="8a8fec5f-d0e6-432f-abe1-83549e14d0cc",e._sentryDebugIdIdentifier="sentry-dbid-8a8fec5f-d0e6-432f-abe1-83549e14d0cc")}catch{}})();const G=U((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((m=>{s.push(m.companyName),r.push(m.emailIds[0])})),u.trackInviteEmailClicked("send",s,r,s.length)}e(z())},onUpdateInviteFormLocalData:s=>{e($({localData:s}))},onSubmitSuccess:()=>{e(p())},onCancelClick:()=>{i!=null&&u.trackInviteEmailClicked("cancel")}}}))(E),Q=()=>{const e=C(),[t,n]=l.useState(!1),[i,s]=l.useState(!1),r=h((o=>_(o))),m=F(),x=L(),d=w.getSignedInUser();if(d==null)throw Error("Can't access invite referral screen without signing in...");const c=h((o=>j(o))),b=d?.firstName!=null?d.firstName:"User";l.useEffect((()=>{e(p()),r?.rewardsLastViewedTime==null&&i===!1&&(e(P()),s(!0))}),[]),l.useEffect((()=>{t||c.fetchState!=="Not-Started"||(n(!0),e(V(!0)))}),[c.fetchState,e]);const S=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[c.fetchState==="Completed"?a.jsx(N,{analytics:u,onLoad:o=>(v=>v.trackPageLoaded(D.Event.inviteEmailViewed))(o)}):null,a.jsx(G,{navigate:m,location:x,currentTenant:r,companyName:S,userName:b,inviteFormCompayData:c.localData})]})};function ne(){const{useFeatureGate:e}=k(),{isFeatureEnabled:t}=e(I.isReferralFeatureEnabled);return a.jsxs(T,{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(Q,{}):a.jsx(g,{})}),a.jsx(f,{path:"*",element:a.jsx(g,{})})]})}export{ne as default};