@zeniai/web-app-ui 5.3.48-qa → 5.3.49-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. package/dist/assets/AccountMappingScreen-CiRabt-E.js +9 -0
  2. package/dist/assets/ActualMatchingMatchDetailScreen-CrIjNeef.js +1 -0
  3. package/dist/assets/AddressRoutes-B4RpxW72.js +1 -0
  4. package/dist/assets/AddressScreen-CPQlppZ3.js +9 -0
  5. package/dist/assets/{AiCfoScreen-DRk81N96.js → AiCfoScreen-DcV74Vwb.js} +3 -3
  6. package/dist/assets/{AppDrawer-CbgUVaEs.js → AppDrawer-DEmhHxBl.js} +3 -3
  7. package/dist/assets/{BillPayApprovalRoutes-CRw5sS5w.js → BillPayApprovalRoutes-DRDBSjZr.js} +1 -1
  8. package/dist/assets/BillPayRoutes-BVerU8xr.js +119 -0
  9. package/dist/assets/BusinessVerificationPageScreen-R4BiNdXk.js +9 -0
  10. package/dist/assets/CardsAiCfoScreen-SCqXPmm9.js +14 -0
  11. package/dist/assets/ChargeCardRoutes-Dxl-Fr5T.js +71 -0
  12. package/dist/assets/CompanyPassportScreen-CHE321d6.js +1 -0
  13. package/dist/assets/ConnectionAuthScreen-if4-dQ5X.js +11 -0
  14. package/dist/assets/CustomerOnboardingAuthScreen-qafzPnCc.js +1 -0
  15. package/dist/assets/CustomerOnboardingRoutes-BjVLhsMv.js +30 -0
  16. package/dist/assets/{DashboardRoutes-DOtnRGit.js → DashboardRoutes-Def0G9RV.js} +4 -4
  17. package/dist/assets/DefaultTenantHome-DrLH_DYg.js +1 -0
  18. package/dist/assets/DomesticWireDetailScreen-DnnWI2yA.js +18 -0
  19. package/dist/assets/DrawerScreen-CEC7Mn0M.js +1 -0
  20. package/dist/assets/EntityDetailRoutes-CJi5JMBH.js +1 -0
  21. package/dist/assets/ExpenseAutomationRoutes-DjNAjdBg.js +38 -0
  22. package/dist/assets/FeaturePreviewScreen-DTAcqRMm.js +1 -0
  23. package/dist/assets/HubSpotOAuthCallbackScreen-BKVqVZzZ.js +1 -0
  24. package/dist/assets/InboxNotificationsProvider-Dwt_tkdC.js +1 -0
  25. package/dist/assets/InvoicingRoutes-CDGhZRcq.js +2 -0
  26. package/dist/assets/MagicLinkRoutes-DJrPTlpH.js +72 -0
  27. package/dist/assets/MagicLinkSignInScreen-tE33HPhZ.js +12 -0
  28. package/dist/assets/MobileAppDrawer-CCUOxU5h.js +1 -0
  29. package/dist/assets/NotFoundScreen-CaUndFTs.js +1 -0
  30. package/dist/assets/NotificationRoutes-D_aWgIj_.js +1 -0
  31. package/dist/assets/OAuthConsentScreen-XzMLC3jd.js +1 -0
  32. package/dist/assets/PandLWithForecastRoutes-G1iTHjWf.js +1 -0
  33. package/dist/assets/{PaymentLinkScreen-D5UCUG0s.js → PaymentLinkScreen-CTXKytOV.js} +1 -1
  34. package/dist/assets/PeopleRoutes-BCTJIMEm.js +22 -0
  35. package/dist/assets/PerformanceRoutes-VB7l7YHB.js +1 -0
  36. package/dist/assets/{Preview-DFfstF1G.js → Preview-qQlP44Bb.js} +1 -1
  37. package/dist/assets/{QBOConnectionScreen-0bGr42Ku.js → QBOConnectionScreen-B613NNPN.js} +1 -1
  38. package/dist/assets/ReimbursementApprovalRoutes-Oot7vjoE.js +1 -0
  39. package/dist/assets/ReimbursementApprovalRuleDetailScreen-BbbYw1r6.js +1 -0
  40. package/dist/assets/ReimbursementRoutes-fet7iW_N.js +68 -0
  41. package/dist/assets/{ReportsRoutes-BtqrHuz-.js → ReportsRoutes-BiU3IfXy.js} +1 -1
  42. package/dist/assets/RewardsRoutes-KyVRs2V6.js +1 -0
  43. package/dist/assets/ScheduleDetailsPrepaidExpensesScreen-BeylIkiO.js +33 -0
  44. package/dist/assets/ScreenRoutes-p1iqGjnv.js +2 -0
  45. package/dist/assets/{SettingsRoutes-C1_iqx7p.js → SettingsRoutes-DgAnzCiw.js} +6 -6
  46. package/dist/assets/{SetupPagesScreen-K06f0ggy.js → SetupPagesScreen-C3gLfyZJ.js} +5 -5
  47. package/dist/assets/SignInScreen-C1PbWtoo.js +1 -0
  48. package/dist/assets/SignOutScreen-BBj0h9la.js +9 -0
  49. package/dist/assets/TaskListScreen-bZId4AF3.js +9 -0
  50. package/dist/assets/TaskRoutes-DCL22vAl.js +9 -0
  51. package/dist/assets/TransactionDetailRoutes-BAFfn1JT.js +1 -0
  52. package/dist/assets/TransactionDetailScreen-DaJqMIrN.js +5 -0
  53. package/dist/assets/TransactionListRoutes-CbPBDWZp.js +1 -0
  54. package/dist/assets/TreasuryRoutes-CGBE-vV8.js +37 -0
  55. package/dist/assets/{VendorsRoutes-CPto0F4-.js → VendorsRoutes-D_EkjlrJ.js} +17 -17
  56. package/dist/assets/{WiseConfirmationScreen-DS88ccTN.js → WiseConfirmationScreen-BNDdfueF.js} +2 -2
  57. package/dist/assets/{ZeniAccountRoutes-DbQRgRMK.js → ZeniAccountRoutes-Cf1eI0DS.js} +11 -11
  58. package/dist/assets/ZeniAccountStatementScreen-BN-JxJMw.js +9 -0
  59. package/dist/assets/{accountMappingHelper-Dc3TCyrX.js → accountMappingHelper-ZA3eE2RB.js} +1 -1
  60. package/dist/assets/{analytics-DP3hAmgL.js → analytics-EJdRN0EM.js} +1 -1
  61. package/dist/assets/analyticsHelper-yYV2XYgm.js +1 -0
  62. package/dist/assets/{core-C_3BcvPm.js → core-DrG65cn7.js} +1 -1
  63. package/dist/assets/{decodeURIComponentSafe-CMkyCq70.js → decodeURIComponentSafe-Cq-VPmfw.js} +1 -1
  64. package/dist/assets/{dnd-BXrho-40.js → dnd-ySxwrcGd.js} +1 -1
  65. package/dist/assets/{empty-BqX05B9x.js → empty-HkstFjkG.js} +1 -1
  66. package/dist/assets/{empty-5gw21cFQ.js → empty-hypZVcyj.js} +1 -1
  67. package/dist/assets/{emptyVideoElement-Cko-_QcE.js → emptyVideoElement-hQo6iMam.js} +1 -1
  68. package/dist/assets/epic-BPI4oO0H.js +2 -0
  69. package/dist/assets/expenseAutomationHelper-BhQOMrvk.js +1 -0
  70. package/dist/assets/getLocaleForTenant-DB6O4KHG.js +1 -0
  71. package/dist/assets/{index-DfdR1P4V.js → index-BRSI70wf.js} +31522 -30719
  72. package/dist/assets/index-CItropkZ.js +1 -0
  73. package/dist/assets/{index-SmhLh3Eo.js → index-CNxuKyrU.js} +1 -1
  74. package/dist/assets/{index-knjfFBPr.js → index-CdqEwb4U.js} +1 -1
  75. package/dist/assets/{index-B7fi9F1i.js → index-Cju_tsP9.js} +1 -1
  76. package/dist/assets/{index-m_4D8W9h.js → index-Csgz6JKS.js} +2 -2
  77. package/dist/assets/{index-BG-FYGvC.js → index-D2y8Uf4E.js} +1 -1
  78. package/dist/assets/{index-qXuXknhd.js → index-DWaMzRgO.js} +1 -1
  79. package/dist/assets/{lexical-DY18TAnZ.js → lexical-DsG4GgCt.js} +1 -1
  80. package/dist/assets/{liveblocks-BHA40K9j.js → liveblocks-DJozFz1F.js} +2 -2
  81. package/dist/assets/{lottie-DHD1nzoa.js → lottie-B54UhbRD.js} +1 -1
  82. package/dist/assets/{mui-DsxbZgLG.js → mui-DqsEgFea.js} +1 -1
  83. package/dist/assets/{pathToGoBack-D0yBSaLk.js → pathToGoBack-Cvep4Zpb.js} +1 -1
  84. package/dist/assets/{pdf-BmQFuRIG.js → pdf-0ccxH7eS.js} +3 -3
  85. package/dist/assets/{pdf-lib-BgeYbcJF.js → pdf-lib-CYVFTJz1.js} +1 -1
  86. package/dist/assets/{plaid-ewZxuvzf.js → plaid-KeCmRFX0.js} +1 -1
  87. package/dist/assets/{pusher-DAk6660-.js → pusher-63t06gfb.js} +1 -1
  88. package/dist/assets/{react-BGUqUuxn.js → react-BNSYzriL.js} +1 -1
  89. package/dist/assets/{react-CPspBxzV.js → react-CAoDTuLJ.js} +1 -1
  90. package/dist/assets/{react-B55QK8Y2.js → react-Ca5GapOf.js} +1 -1
  91. package/dist/assets/{react-DSfrP2G8.js → react-CjVnH7Ak.js} +1 -1
  92. package/dist/assets/{react-C1aI4U0L.js → react-DoOX0jE5.js} +1 -1
  93. package/dist/assets/{react-BDRsWZYP.js → react-xEeg46_z.js} +1 -1
  94. package/dist/assets/{recharts-CmYjG1zt.js → recharts-Bmrae78L.js} +1 -1
  95. package/dist/assets/{routePaths-Cca1tWJp.js → routePaths-C_2IfGnd.js} +1 -1
  96. package/dist/assets/{sentry-CFLt6SLf.js → sentry-C1W0cBeR.js} +1 -1
  97. package/dist/assets/stripSplatSuffix-Dk3dK5Wm.js +1 -0
  98. package/dist/assets/{url-D-ZtJ2kF.js → url-BrtuL5Mk.js} +1 -1
  99. package/dist/assets/{url-DKuONDiE.js → url-C0aMyBCn.js} +1 -1
  100. package/dist/assets/useActualMatchingMatchDetail-CQ1E-c6g.js +1 -0
  101. package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-B4wwXC6_.js +1 -0
  102. package/dist/assets/useAskAiCfoHostNavButtonProps-DgHBW0CH.js +1 -0
  103. package/dist/assets/useChargeCardPusherEvents-B1YNDwMw.js +1 -0
  104. package/dist/assets/{useDeviceId-CZr7CPDW.js → useDeviceId-BQkxGsaf.js} +1 -1
  105. package/dist/assets/useEmailConnectResultRefresh-ezN2mPba.js +1 -0
  106. package/dist/assets/useInitialThreadRequest-CIOY8QiT.js +1 -0
  107. package/dist/assets/useTaskManagerAccess-CeXMA9mP.js +1 -0
  108. package/dist/assets/{utils-D1gULS4n.js → utils-BYrZSa_o.js} +1 -1
  109. package/dist/assets/withTransactionSidePanel-M6DARYy7.js +25 -0
  110. package/dist/assets/{zeni-epic-state-BK-HD5IA.js → zeni-epic-state-1I_oueWp.js} +6 -6
  111. package/dist/index.html +1 -1
  112. package/package.json +6 -6
  113. package/dist/assets/AccountMappingScreen-amEuzz3m.js +0 -9
  114. package/dist/assets/AddressRoutes-BvCvEc0i.js +0 -1
  115. package/dist/assets/AddressScreen-SjU2U0ZR.js +0 -9
  116. package/dist/assets/BillPayRoutes-gLnnTINY.js +0 -119
  117. package/dist/assets/BusinessVerificationPageScreen-OrLH3WzL.js +0 -9
  118. package/dist/assets/CardsAiCfoScreen-CK5nzziY.js +0 -14
  119. package/dist/assets/ChargeCardRoutes-VxC6xP7p.js +0 -71
  120. package/dist/assets/CompanyPassportScreen-CMquye6T.js +0 -1
  121. package/dist/assets/ConnectionAuthScreen-D-MaPmF7.js +0 -11
  122. package/dist/assets/CustomerOnboardingAuthScreen-Cd284ksv.js +0 -1
  123. package/dist/assets/CustomerOnboardingRoutes-BEKgaiHU.js +0 -30
  124. package/dist/assets/DefaultTenantHome-BgVy6pXM.js +0 -1
  125. package/dist/assets/DomesticWireDetailScreen-ojJdskB-.js +0 -18
  126. package/dist/assets/DrawerScreen-DaPp3vfO.js +0 -1
  127. package/dist/assets/EntityDetailRoutes-CeZQKYjJ.js +0 -1
  128. package/dist/assets/ExpenseAutomationRoutes-D8dyN9JX.js +0 -38
  129. package/dist/assets/FeaturePreviewScreen-bhcVTnED.js +0 -1
  130. package/dist/assets/HubSpotOAuthCallbackScreen-BycOX9mL.js +0 -1
  131. package/dist/assets/InboxNotificationsProvider-ICcfArFM.js +0 -1
  132. package/dist/assets/InvoicingRoutes-BkdZK7i6.js +0 -2
  133. package/dist/assets/MagicLinkRoutes-BIEFcYv2.js +0 -72
  134. package/dist/assets/MagicLinkSignInScreen-ufbtyKlL.js +0 -12
  135. package/dist/assets/MobileAppDrawer-DjEeoE6u.js +0 -1
  136. package/dist/assets/NotFoundScreen-BDRAfL_x.js +0 -1
  137. package/dist/assets/NotificationRoutes-DJF3aH5n.js +0 -1
  138. package/dist/assets/OAuthConsentScreen-Bl7eWr3R.js +0 -1
  139. package/dist/assets/PandLWithForecastRoutes-CUZT8XbC.js +0 -1
  140. package/dist/assets/PeopleRoutes-DopLFED_.js +0 -22
  141. package/dist/assets/PerformanceRoutes-CoR3XZpX.js +0 -1
  142. package/dist/assets/ReimbursementApprovalRoutes-4Gmx-MuW.js +0 -1
  143. package/dist/assets/ReimbursementApprovalRuleDetailScreen-DiBNgDsy.js +0 -1
  144. package/dist/assets/ReimbursementRoutes-DjQJfMVY.js +0 -68
  145. package/dist/assets/RewardsRoutes-Dq5pKyO9.js +0 -1
  146. package/dist/assets/ScheduleDetailsPrepaidExpensesScreen-DtayUdWa.js +0 -25
  147. package/dist/assets/ScreenRoutes-BAM6ERJQ.js +0 -2
  148. package/dist/assets/SignInScreen-BvLUs9_l.js +0 -1
  149. package/dist/assets/SignOutScreen-qMNwfRFa.js +0 -9
  150. package/dist/assets/TaskListScreen-BorAtbzN.js +0 -9
  151. package/dist/assets/TaskRoutes-DJI1lloU.js +0 -9
  152. package/dist/assets/TransactionDetailRoutes-DCWaZrOs.js +0 -1
  153. package/dist/assets/TransactionDetailScreen-B2Yk34kC.js +0 -5
  154. package/dist/assets/TransactionListRoutes-eMDqkeHP.js +0 -1
  155. package/dist/assets/TreasuryRoutes-sgwJOYI2.js +0 -37
  156. package/dist/assets/ZeniAccountStatementScreen-B7vN9Y4_.js +0 -9
  157. package/dist/assets/analyticsHelper-Bfs4R3aB.js +0 -1
  158. package/dist/assets/epic-DMvtePZM.js +0 -2
  159. package/dist/assets/expenseAutomationHelper-dMv6Xo4s.js +0 -1
  160. package/dist/assets/getLocaleForTenant-CK0bI6xd.js +0 -1
  161. package/dist/assets/index-DIN19WtR.js +0 -1
  162. package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-BujA6eyw.js +0 -1
  163. package/dist/assets/useAskAiCfoHostNavButtonProps-CnAY_u1k.js +0 -1
  164. package/dist/assets/useChargeCardPusherEvents-7mxw_gTB.js +0 -1
  165. package/dist/assets/useEmailConnectResultRefresh-DL08zR5x.js +0 -1
  166. package/dist/assets/useInitialThreadRequest-C8Pdei5-.js +0 -1
  167. package/dist/assets/useTaskManagerAccess-DJ8lZv1E.js +0 -1
  168. package/dist/assets/withTransactionSidePanel-D2Vk8NEW.js +0 -25
@@ -1 +0,0 @@
1
- import{j as n}from"./liveblocks-BHA40K9j.js";import{h as K,u as X,g as H,i as Q,j as d,l as Z,n as ee,o as C}from"./core-C_3BcvPm.js";import{fE as M,zw as O,uv as ae,UJ as w,uq as y,bq as te,b$ as se,ur as oe,UK as re,Ur as S,eb as ne,Di as ce,UL as ie,DG as le,dY as de,dX as me}from"./zeni-epic-state-BK-HD5IA.js";import{ai as fe,z as pe,aq as ue,as as he,V as Fe,M as q,y as $,a8 as ge,h as _,aD as be,p as Ie}from"./index-DfdR1P4V.js";import"./mui-DsxbZgLG.js";import Ce from"./NotFoundScreen-BDRAfL_x.js";import{F as Se}from"./FeaturePreviewScreen-bhcVTnED.js";import{a as F}from"./sentry-CFLt6SLf.js";import{u as ye}from"./useAskAiCfoHostNavButtonProps-CnAY_u1k.js";import{u as Te}from"./useInitialThreadRequest-C8Pdei5-.js";import{t as De}from"./routePaths-Cca1tWJp.js";import{M as Ae}from"./MobileAppDrawer-DjEeoE6u.js";import"./recharts-CmYjG1zt.js";import"./analytics-DP3hAmgL.js";import"./plaid-ewZxuvzf.js";import"./dnd-BXrho-40.js";import"./stripe-cKAAJElX.js";import"./lottie-DHD1nzoa.js";import"./lexical-DY18TAnZ.js";import"./pdf-BmQFuRIG.js";import"./utils-D1gULS4n.js";import"./InboxNotificationsProvider-ICcfArFM.js";import"./useTaskManagerAccess-DJ8lZv1E.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]="8a28c74b-3f24-45a4-a38d-62d3d055f0d3",s._sentryDebugIdIdentifier="sentry-dbid-8a28c74b-3f24-45a4-a38d-62d3d055f0d3")}catch{}})();const T=(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})}},xe=Z((function(s){const e=re(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:_}}),(function(s,e){return{onForecastSelectionChanged:(a,o)=>{s(w(a,o)),e.isPandLReportFetched(a)||s(y(a)),T(e.forecastIdFromUrlPath,a,e.navigate)},onTimeframeChanged:a=>{s(le(a))},onForecastVsActualsCompareToggle:a=>{s(ie(a)),s(S({forecastId:e.forecastIdFromUrlPath,scrollPosition:{scrollLeft:0,scrollTop:0}}))},onCompareModeChanged:a=>{s(ce(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=ne(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=De(e.tenantEmailDomain,a.accountId,a.accountType,p,r,c),m=Ie(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(u,{state:{pathnameStackToGoBack:m,referrer:"Forecast"}})}},onNodeCollapseToggled:(a,o)=>{s(S({forecastId:e.forecastIdFromUrlPath,nodeCollapseState:{nodeId:a,isCollapsed:o===!1}}))},onTableScroll:a=>{s(S({forecastId:e.forecastIdFromUrlPath,scrollPosition:a}))},onBackClick:()=>{e.navigate("../../")}}}))(be);function v(){const s=fe(),e=K(),a=X(),o=H(),{forecastId:r,tenantEmailDomain:c}=Q(),[p,u]=F.useState(!1),[m,D]=F.useState(!1),g=pe.getSignedInUser(),A=d((t=>M(t))),B=A.company?.companyInfo.firstMonthOfFY??1,i=d((t=>O(t.forecastState,t.forecastListState))),l=d((t=>t.forecastListState.fetchState==="Completed")),x=d((t=>t.profitAndLossState)),E=d((t=>t.reportUIOptionsState.selectedForecast)),L=t=>x.pandLByForecastID[t]!=null&&oe(t,x).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:b}=ue();he({isDataReady:l});const{isAiCfoAccessEnabled:G,onAskAiCfoClick:N}=ye({mobileExploreReferrer:"Forecast"});F.useEffect((()=>{if(!p&&b)u(!0),l||a(ae());else if(l&&!m){D(!0);const t=((f,U,R)=>U!=null?f.forecasts.findIndex((I=>I.id===U)):R!=null?f.forecasts.findIndex((I=>I.id===R)):f.forecasts.length>0?0:-1)(i,r,E?.id);t===-1&&r!=null?e("page-not-found",{replace:!0}):t!==-1&&t!=E?.index?(a(w(i.forecasts[t].id,t)),T(r,i.forecasts[t].id,e,o.search)):r==null&&t!==-1&&T(void 0,i.forecasts[t].id,e,o.search),t!==-1&&!L(i.forecasts[t].id)&&b&&a(y(i.forecasts[t].id))}}),[p,u,a,l,i,m,D,O,y,b]);const j=Fe(),V=j?.loggedInUserRole!=null&&te(j.loggedInUserRole),{useFeatureGate:W}=q(),{isFeatureEnabled:k}=W($.isReportsCommentingEnabled),Y=Te(k?A?.companyId:void 0,{clearParams:l&&m}),[z,J]=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 P=t=>{J(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(ge,{analytics:_,onLoad:t=>(f=>f.trackForecast())(t)}):null,n.jsx(Ae,{isAppContentDrawerOpen:z,handleDrawerToggle:P}),n.jsx(xe,{firstMonthOfFY:B,tenantEmailDomain:c,forecastIdFromUrlPath:r,navigate:e,location:o,isPandLReportFetched:L,meetingUrl:se(h.toString()),hasTransactionAccess:V,isAiCfoAccessEnabled:G,onAskAiCfoClick:N,isReportsCommentingEnabled:k,initialOpenThreadRequest:Y,onClickMenuIcon:()=>{P(!0)}})]})}function Xe(){const s=d((c=>M(c))),{useFeatureGate:e}=q(),{isFeatureEnabled:a}=e($.isDebitCardFeatureEnabled),o=de(a,s),r=me(s);return o===!0||r===!0?n.jsx(Se,{}):n.jsxs(ee,{children:[n.jsx(C,{path:"/",element:n.jsx(v,{})}),n.jsx(C,{path:"/:forecastId",element:n.jsx(v,{})}),n.jsx(C,{path:"/:forecastId/*",element:n.jsx(Ce,{})})]})}export{Xe as default};
@@ -1,22 +0,0 @@
1
- import{j as a}from"./liveblocks-BHA40K9j.js";import{UF as re,fE as Q,l_ as G,dY as N,dX as le,Rx as X,U2 as de,Cf as Pe,UG as J,C4 as je,Cp as Le,Cj as ce,C8 as pe,Cn as ve,Ck as Te,UH as ue,rL as Ae,g5 as Re,gC as Fe,UI as H,Cc as me,Cb as ge,Cs as Ve,c8 as Oe}from"./zeni-epic-state-BK-HD5IA.js";import{a1 as Ce,M as Y,y as _,z as K,f as fe,P as he,af as be,az as ye,aA as Ue,ab as Se,J as V,ag as we,G as W,aB as Ze,aq as Be,as as $e,a8 as ze,h as xe,S as He,p as _e,aC as Ge,V as Ke}from"./index-DfdR1P4V.js";import{D as De,n as M,S as Ie}from"./mui-DsxbZgLG.js";import ae from"./NotFoundScreen-BDRAfL_x.js";import{a as d}from"./sentry-CFLt6SLf.js";import{u as ee,i as We,j as g,h as Me,g as qe,l as Je,n as se,o as z}from"./core-C_3BcvPm.js";import{u as Qe}from"./useAskAiCfoHostNavButtonProps-CnAY_u1k.js";import{M as Ne}from"./MobileAppDrawer-DjEeoE6u.js";import"./recharts-CmYjG1zt.js";import"./analytics-DP3hAmgL.js";import"./plaid-ewZxuvzf.js";import"./dnd-BXrho-40.js";import"./stripe-cKAAJElX.js";import"./lottie-DHD1nzoa.js";import"./lexical-DY18TAnZ.js";import"./pdf-BmQFuRIG.js";import"./utils-D1gULS4n.js";import"./InboxNotificationsProvider-ICcfArFM.js";import"./useTaskManagerAccess-DJ8lZv1E.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]="18b79044-ddc4-4d37-9687-11dbb4512b20",e._sentryDebugIdIdentifier="sentry-dbid-18b79044-ddc4-4d37-9687-11dbb4512b20")}catch{}})();const Xe={overlayWidth:new Se(100,100,48)},te=W.getLocalizedStrings().peoplePage.invitePage,ne=W.getLocalizedStrings().common,Ye=({companyId:e,managersListView:t,companyPassportView:c,classListView:n,mode:C,isEditPeopleDrawerOpen:i,closeDrawerHandler:y})=>{const f=Ce(),m=ee(),[O,U]=d.useState(!1),[k,S]=d.useState(!1),{userId:w}=We(),r=g((l=>re(l))),p=g((l=>Q(l))),E=g((l=>G(l))),{useFeatureGate:D}=Y(),{isFeatureEnabled:I}=D(_.isDebitCardFeatureEnabled),P=N(I,p),v=le(p),T=X(p),Z=de(p),B=!!p.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!P&&E&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||c.fetchState!=="Completed"||e==null;if(K.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const h=()=>{m(J()),y()},A=()=>{O===!0?S(!0):h()},$=c.companyView?.controllers?.map((l=>l.user)),u=!!p.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:j}=D(_.isChargeCardFeatureEnabled),L=fe(p,j,I),{isCardsHidden:R}=he(p?.tenantId),b=!L||R,F=p.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",s={peopleDetails:r,classList:n.classes,managersList:t.users,controllersList:$,mode:C,isZeniTenant:T,isAccountingClassesEnabled:E,isReimbursementDisabled:B===!1,isZeniAccountsDisabled:u===!1,isChargeCardDisabled:b,isTreasuryDisabled:F===!1,isLiteRoleDisabled:Z===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:v,onResetClick:h,onDeleteUser:l=>{m(pe(l.userId,l.userRole.userRoleId))},onPeopleLocalDataUpdated:l=>{m(ce({peopleLocalData:l})),U(!0)},onSaveClick:()=>{m(C==="zeni_only"?je(e):Le(T))},onCloseClick:A,isLoading:x||r.person==null},o={onOkClick:()=>{S(!1),h()},onCancelClick:()=>{S(!1)}};return d.useEffect((()=>{x===!1&&w!=null&&m(Pe(w))}),[x,w]),d.useEffect((()=>{r.updatePersonState.fetchState==="Completed"&&h()}),[r.updatePersonState.fetchState]),a.jsx(De,{anchor:"right",open:i,PaperProps:{style:{width:Xe.overlayWidth.valuePercentage(f),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:be.overlayDark,cursor:"pointer"}}},onClose:A,children:a.jsxs(ea,{onClick:l=>l.stopPropagation(),children:[k===!0?a.jsx(ye,{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=M(Ie)`
2
- display: flex;
3
- min-height: 100%;
4
- flex-direction: column;
5
- `,ke=M(we.H6Regular)`
6
- margin-top: ${V.sp7};
7
- padding-left: ${V.sp8};
8
- padding-right: ${V.sp8};
9
- color: ${e=>e.theme.colors.primary};
10
- word-break: break-word;
11
- `,Ee=M(we.LargeRegularSp)`
12
- color: ${e=>e.theme.colors.hero};
13
- padding-left: ${V.sp8};
14
- padding-right: ${V.sp8};
15
- margin-bottom: 30px;
16
- margin-top: ${V.sp4};
17
- white-space: pre-line;
18
- `,aa={overlayWidth:new Se(100,100,48)},oe=W.getLocalizedStrings().peoplePage.invitePage,ie=W.getLocalizedStrings().common,sa=({companyId:e,managersListView:t,companyPassportView:c,classListView:n,mode:C,isInvitePeopleDrawerOpen:i,closeDrawerHandler:y})=>{const f=Ce(),m=ee(),[O,U]=d.useState(!1),[k,S]=d.useState(!1),w=g((o=>re(o))),r=g((o=>Q(o))),p=g((o=>G(o))),{useFeatureGate:E}=Y(),{isFeatureEnabled:D}=E(_.isDebitCardFeatureEnabled),I=N(D,r),P=le(r),v=X(r),T=de(r),Z=!!r.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,B=!I&&p&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||c.fetchState!=="Completed"||e==null;if(K.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const x=()=>{y(),m(J())},h=()=>{O===!0?S(!0):x()},A={onOkClick:()=>{S(!1),x()},onCancelClick:()=>{S(!1)}},$=c.companyView?.controllers.map((o=>o.user)),u=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:j}=E(_.isChargeCardFeatureEnabled),L=fe(r,j,D),{isCardsHidden:R}=he(r?.tenantId),b=!L||R,F=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",s={classList:n.classes,managersList:t.users,controllersList:$,mode:C,isZeniTenant:v,onPeopleLocalDataUpdated:o=>{m(ce({peopleLocalData:o})),U(!0)},onResetClick:x,onSaveClick:()=>{m(C==="zeni_only"?ve(e):Te())},onCloseClick:h,peopleDetails:w,isAccountingClassesEnabled:p,isReimbursementDisabled:Z===!1,isLiteRoleDisabled:T===!1,isZeniAccountsDisabled:u===!1,isChargeCardDisabled:b,isTreasuryDisabled:F===!1,isBankingOnlyTenant:I,isCardsOnlyTenant:P,isLoading:B};return d.useEffect((()=>{w.invitePersonState.fetchState==="Completed"&&(y(),m(J()))}),[w.invitePersonState.fetchState]),a.jsx(De,{anchor:"right",open:i,PaperProps:{style:{width:aa.overlayWidth.valuePercentage(f),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:be.overlayDark,cursor:"pointer"}}},onClose:h,children:a.jsxs(ta,{onClick:o=>o.stopPropagation(),children:[k===!0?a.jsx(ye,{titleComponent:a.jsx(ke,{children:oe.discardTitle}),descriptionComponent:a.jsx(Ee,{children:oe.discardDescription}),primaryButtonText:ie.yes,secondaryButtonText:ie.no,action:A}):null,a.jsx(Ze,{...s})]})})},ta=M(Ie)`
19
- display: flex;
20
- min-height: 100%;
21
- flex-direction: column;
22
- `,na=Je((function(e,t){const c=ue(e),n=K.getSignedInUser();return{data:c,loggedinUserId:n?.userId??"",isZeniTenant:t.isZeniTenant===!0,shouldFetchClasses:t.shouldFetchClasses,isZeniAdminUser:n?.userEmailDomain==="zeni.ai"&&t.isZeni===!0,isAccountingClassesEnabled:G(e),analytics:xe}}),(function(e,t){const{navigate:c,companyId:n,shouldFetchClasses:C}=t;return{personAction:{onPersonDelete:(i,y)=>{e(pe(i,y))},onResendInvite:i=>{e(Ve(i))},onReloadPeople:()=>{e(me()),e(ge(n,C))},onBackClick:()=>{c("../../")},onModeChange:i=>{e(H({mode:i,searchText:"",sortKey:"name",sortOrder:"ascending"}))},onSearchTextChanged:i=>{e(H({searchText:i}))}}}}))(Ge);function q({isInvitePeopleDrawerOpen:e,isEditPeopleDrawerOpen:t}){const c=Me(),n=ee(),C=qe(),{areTenantIdsInSync:i}=Be(),y=K.getSignedInUser(),f=g((s=>Q(s))),{useFeatureGate:m}=Y(),{isFeatureEnabled:O}=m(_.isDebitCardFeatureEnabled),U=g((s=>G(s))),k=!N(O,f)&&U,S=X(f),w=f?.tenantId,{tenantEmailDomain:r}=f,[p,E]=d.useState(!1),[D,I]=d.useState(!1),[P,v]=d.useState(!1),[T,Z]=d.useState("off"),[B,x]=d.useState(!1),h=s=>{x(s)},{isAiCfoAccessEnabled:A,onAskAiCfoClick:$}=Qe({mobileExploreReferrer:"People"}),u=g((s=>ue(s)));$e({isDataReady:u.fetchState==="Completed"});const j=g((s=>Ae(s.classState,s.classListState))),L=g((s=>Re(s.userState,s.userRoleState,s.userListViewState,"manager"))),R=g((s=>Fe(s))),b=f?.companyId;d.useEffect((()=>{p&&T===u.uiState.mode||!i||(n(H({searchText:"",sortKey:"name",sortOrder:"ascending"})),Z(u.uiState.mode),E(!0),n(me()))}),[p,y,w,n,u.uiState.mode,i]),d.useEffect((()=>{b!=null&&i&&n(ge(b,k))}),[b,k,i]),d.useEffect((()=>{I(e!=null&&e===!0),v(t!=null&&t===!0&&t)}),[e,t]),d.useEffect((()=>{n(H({searchText:"",sortKey:"name",sortOrder:"ascending"}))}),[]);const F=()=>{I(!1),v(!1),c("../")};return a.jsxs(a.Fragment,{children:[u.fetchState==="Completed"?a.jsx(ze,{analytics:xe,onLoad:s=>s.trackPageLoaded(He.Event.members)}):null,D===!0?a.jsx(sa,{closeDrawerHandler:F,isInvitePeopleDrawerOpen:D,managersListView:L,companyPassportView:R,classListView:j,companyId:b,mode:u.uiState.mode}):null,P===!0?a.jsx(Ye,{closeDrawerHandler:F,isEditPeopleDrawerOpen:P,managersListView:L,companyPassportView:R,classListView:j,companyId:b,mode:u.uiState.mode}):null,a.jsx(Ne,{isAppContentDrawerOpen:B,handleDrawerToggle:h}),a.jsx(na,{navigate:c,signedInUser:y,isZeni:f.isZeni,isZeniTenant:S,peopleUIState:u.uiState,companyId:b,shouldFetchClasses:k,classList:j,managersView:L,peopleView:u,onInvitePeopleClick:()=>{c("./new")},onColumnSortConfigChanged:(s,o)=>{n(H({sortKey:s,sortOrder:o}))},onRowClick:s=>{const o=`/${r}/people/${encodeURIComponent(s)}/edit`,l=_e(C.state?.pathnameStackToGoBack,C.pathname);c(o,{state:{pathnameStackToGoBack:l}})},onClickMenuIcon:()=>{h(!0)},isAiCfoAccessEnabled:A,onAskAiCfoClick:$})]})}function ka(){const e=Ke();return Oe(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};
@@ -1 +0,0 @@
1
- import{j as s}from"./liveblocks-BHA40K9j.js";import T from"./NotFoundScreen-BDRAfL_x.js";import{a as r}from"./sentry-CFLt6SLf.js";import{h as _,g as v,j as p,i as M,u as U,N as P,l as z,n as N,o as h}from"./core-C_3BcvPm.js";import{fE as O,a0h as b,bo as B,bn as F,iK as V,gg as K}from"./zeni-epic-state-BK-HD5IA.js";import{r as $,z as I,as as q,dN as G}from"./index-DfdR1P4V.js";import"./mui-DsxbZgLG.js";import{u as H}from"./useAskAiCfoHostNavButtonProps-CnAY_u1k.js";import{M as J}from"./MobileAppDrawer-DjEeoE6u.js";import"./recharts-CmYjG1zt.js";import"./analytics-DP3hAmgL.js";import"./plaid-ewZxuvzf.js";import"./dnd-BXrho-40.js";import"./stripe-cKAAJElX.js";import"./lottie-DHD1nzoa.js";import"./lexical-DY18TAnZ.js";import"./pdf-BmQFuRIG.js";import"./utils-D1gULS4n.js";import"./InboxNotificationsProvider-ICcfArFM.js";import"./useTaskManagerAccess-DJ8lZv1E.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]="d08f8797-21d4-44b6-8463-853191c54c89",e._sentryDebugIdIdentifier="sentry-dbid-d08f8797-21d4-44b6-8463-853191c54c89")}catch{}})();const L=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(),g=U(),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=F(l),y=C||k||x,d=r.useCallback(((a,i,E)=>{g(V({fromMonth:a,toMonth:i,cacheOverride:E}))}),[]);r.useEffect((()=>{n?.fetchState==="Completed"&&m.current&&(g(K({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]),u=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:u}),s.jsx(L,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:l,tenantEmailDomain:f,onReload:D,onTimeRangeSelect:j,handleDrawerToggle:u,isAiCfoAccessEnabled:R,onAskAiCfoClick:A})]}):s.jsx(P,{to:`/${f}/dashboard`,replace:!0})};function he(){return s.jsxs(N,{children:[s.jsx(h,{path:"*",element:s.jsx(Q,{})}),s.jsx(h,{path:"*",element:s.jsx(T,{})})]})}export{he as default};
@@ -1 +0,0 @@
1
- import{j as r}from"./liveblocks-BHA40K9j.js";import W from"./NotFoundScreen-BDRAfL_x.js";import{a as p}from"./sentry-CFLt6SLf.js";import{h as C,g as D,u as V,j as u,N as k,l as U,n as Y,o as h}from"./core-C_3BcvPm.js";import{fE as I,Yl as b,YC as R,MY as N,MU as L,MX as f,MN as $,Y$ as B,MR as z,M_ as K}from"./zeni-epic-state-BK-HD5IA.js";import{z as M,w as T,c9 as X,n as _,bS as q,ca as F}from"./index-DfdR1P4V.js";import"./mui-DsxbZgLG.js";import{u as G,R as x}from"./ReimbursementApprovalRuleDetailScreen-DiBNgDsy.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]="fe926528-0827-4326-ac1d-89f19c9e57d4",e._sentryDebugIdIdentifier="sentry-dbid-fe926528-0827-4326-ac1d-89f19c9e57d4")}catch{}})();const A="reimbursement-approval-rule-update",H=U((function(e){return{approvalView:b(e),remiSetupApproverViewUpdateData:R(e).remiSetupApproverViewUpdateData}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(A)&&e(B(!1))},onBackClick:()=>{_(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e($(t,!1))},onEditRuleClick:t=>{t!=null?(e(f(t)),n(`./${t}/edit`)):(e(f()),n("./new"))}}}))(T(X)),J=({isLoading:e})=>{const s=C(),n=D(),a=V(),[t,l]=p.useState(!1),[v,w]=p.useState(!1),S=u((o=>o.remiSetupApproverViewState.fetchState)),c=u((o=>I(o))),d=u((o=>b(o))),g=u((o=>R(o).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{g?.updateStatus.fetchState==="Completed"&&a(N())}),[g]),p.useEffect((()=>{t||S!=="Not-Started"||e||(l(!0),a(L(!0,!1,!1,!1)))}),[t,S,e,a]),M.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{d.allApprovalRules.length===0&&d.fetchState==="Completed"&&(v||(w(!0),a(f())),s("./new"))}),[v,d,a]);const m={events:c.companyId!=null?[`private-encrypted-${c.companyId}.${A}`]:[],eventCallback:(o,y,j)=>{o.endsWith(A)&&j.onApprovalRulesEventReceived(o)}};return c?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(k,{to:"../../promo"}):r.jsx(H,{currentTenant:c,location:n,navigate:s,...m})},E="reimbursement-approval-rule-update",P=U((function(e){const s=b(e),n=R(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(E)&&e(B(!1))},onBackClick:()=>{_(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e($(t,!0))},onEditRuleClick:t=>{t!=null?(e(f(t)),n(`./${t}/edit`)):(e(f()),n("./new"))},onReorderRules:t=>{e(K(t,!0))}}}))(T(F)),Q=()=>{const e=u((a=>I(a))),{isApprovalRulesV3Enabled:s,isLoading:n}=q(e?.tenantId);return s?r.jsx(Z,{isLoading:n}):r.jsx(J,{isLoading:n})},Z=({isLoading:e})=>{const s=C(),n=D(),a=V(),[t,l]=p.useState(!1),[v,w]=p.useState(!1),[S,c]=p.useState(!1),d=u((i=>i.remiSetupApproverViewState.fetchState)),g=u((i=>i.remiSetupApproverViewState.approverListState.fetchStatus.fetchState)),m=u((i=>I(i))),o=u((i=>b(i)));G();const y=u((i=>R(i).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{y?.updateStatus.fetchState==="Completed"&&a(N())}),[y]),p.useEffect((()=>{t||d!=="Not-Started"||e||(l(!0),a(L(!0,!1,!1,!0)))}),[t,d,e,a]),p.useEffect((()=>{v||g!=="Not-Started"||e||(w(!0),a(z(!1,!0)))}),[v,g,e,a]),M.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{o.allApprovalRules.length===0&&o.fetchState==="Completed"&&(S||(c(!0),a(f())),s("./new"))}),[S,o,a]);const j={events:m.companyId!=null?[`private-encrypted-${m.companyId}.${E}`]:[],eventCallback:(i,ee,O)=>{i.endsWith(E)&&O.onApprovalRulesEventReceived(i)}};return m?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(k,{to:"../../promo"}):r.jsx(P,{currentTenant:m,location:n,navigate:s,isLoading:e,...j})};function le(){return r.jsxs(Y,{children:[r.jsx(h,{path:"/",element:r.jsx(Q,{})}),r.jsx(h,{path:"/new",element:r.jsx(x,{})}),r.jsx(h,{path:"/:approvalRuleId/edit",element:r.jsx(x,{})}),r.jsx(h,{path:"*",element:r.jsx(W,{})})]})}export{le as R};
@@ -1 +0,0 @@
1
- import{j as h}from"./liveblocks-BHA40K9j.js";import{a as m}from"./sentry-CFLt6SLf.js";import{u as U,j as g,h as _,g as O,i as V,l as k}from"./core-C_3BcvPm.js";import{mq as $,YC as w,Yl as C,MQ as B,N1 as j,MY as A,MZ as E,YD as N,fE as L,MX as z}from"./zeni-epic-state-BK-HD5IA.js";import{z as F,E as P,a7 as q,c0 as K,n as M,bS as Q,c1 as W}from"./index-DfdR1P4V.js";import"./mui-DsxbZgLG.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]="b7d771e4-0bd3-4e27-935c-cfa5b61b8655",e._sentryDebugIdIdentifier="sentry-dbid-b7d771e4-0bd3-4e27-935c-cfa5b61b8655")}catch{}})();function X(){const e=U(),s=m.useRef(!1),t=g((o=>o.vendorListState.fetchStateBillsTab.fetchState??"Not-Started")),p=g((o=>o.vendorListState.allVendorIdsBillsTab.length>0));m.useEffect((()=>{s.current||p||t==="Completed"||t==="In-Progress"||(s.current=!0,e($({})))}),[p,t,e])}const Z=k((function(e,s){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=p==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return s.approvalRuleId&&(l=t.allApprovalRules.findIndex((r=>r.approvalRuleId===s.approvalRuleId))===0),{localData:t,hideUpperBoundField:o,isLowerBoundDisabled:l,approvalUpdateActionType:p}}),(function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=M(s.location);return{onApprovalRuleDataUpdated:a=>{const d=v=>{const S=[];return v.forEach((u=>{const I=u.actors.selectedUsers.map((f=>({type:"user",subType:void 0,userId:f.userId,idType:"user",isImplicitActor:!1}))),R=u.actors.selectedNonUsers.map((f=>{const y=(b=f.value,N(b)==null);var b;return{type:y?"attribute":"role",subType:f.value,userId:void 0,idType:void 0,isImplicitActor:!y}})),c=I.concat(R);S.push({action:u.stepType.selectedOption,actors:c,operator:c.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})})),S},n={amount:{type:"amount",comparator:"range",min:{amount:a.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:a.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(r==="approval_create"){const v={criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}else{const v={approvalRuleId:l,criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(j(!1))},onSaveRuleSuccess:()=>{t("../")}}}))(K);function G(){const e=_(),s=U(),t=O(),{approvalRuleId:p}=V(),o=F.getSignedInUser(),l=P(),r=g((n=>w(n))),i=g((n=>C(n))),[a,d]=m.useState(!1);if(m.useEffect((()=>{a||(d(!0),s(B(!0)))})),m.useEffect((()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?h.jsx(q,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):h.jsx(Z,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t})}function pe(e){return N(e)==null}const H=k((function(e,s){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=[],l={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(o.push(r.id),l[r.id]=r.name);return{localData:t,approvalUpdateActionType:p,allVendorIds:o,vendorNamesById:l,editingRuleId:p==="approval_update"?s.approvalRuleId:void 0,allApprovalRulesWithUser:C(e).allApprovalRules}}),(function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=M(s.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const f=[];return c.forEach((y=>{const b=y.actorKind?.selectedOption,Y=y.selectedRole?.selectedNonUsers??[];let D=[];b==="role"?D=Y.map((T=>({type:"attribute",subType:T.value,userId:void 0,idType:void 0,isImplicitActor:!1}))):b==="specific_person"&&(D=(y.persons?.selectedUsers??[]).map((T=>({type:"user",subType:void 0,userId:T.userId,idType:"user",isImplicitActor:!1}))));const x=y.action??"require_approval";f.push({action:x,actors:D,operator:D.length>1?x==="require_approval"?"or":"and":"is"})})),f},n=a.amountCriteria,v=a.vendorCriteria,S=a.departmentCriteria,u={};if(n!=null&&n.comparator.selectedOption!=null){const c=n.comparator.selectedOption;u.amount={type:"amount",comparator:c,min:c==="less_than"?void 0:n.min,max:c==="greater_than"?void 0:n.max}}const I=v?.selection.selectedOptions??[];I.length>0&&(u.vendor={type:"vendor",operator:v?.operator.selectedOption??"is",vendorIds:I});const R=S?.selection.selectedOptions??[];if(R.length>0&&(u.department={type:"department",operator:S?.operator.selectedOption??"is",departmentIds:R}),r==="approval_create"){const c={name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}else{const c={approvalRuleId:l,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"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(j(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:a=>{e(z(a)),t(r==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}}))(W);function ne(){const e=g((t=>L(t))),{isApprovalRulesV3Enabled:s}=Q(e?.tenantId);return s?h.jsx(J,{}):h.jsx(G,{})}function J(){const e=_(),s=U(),t=O(),{approvalRuleId:p}=V(),o=F.getSignedInUser(),l=P(),r=g((n=>w(n))),i=g((n=>C(n))),[a,d]=m.useState(!1);if(X(),m.useEffect((()=>{a||(d(!0),s(B(!1)))})),m.useEffect((()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?h.jsx(q,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):h.jsx(H,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t},p??"new")}export{ne as R,pe as i,X as u};
@@ -1,68 +0,0 @@
1
- import{j as s}from"./liveblocks-BHA40K9j.js";import{u as ae,j as v,h as Q,g as J,i as ie,N as $,l as ee,q as ct,n as dt,o as w}from"./core-C_3BcvPm.js";import{fE as Z,MU as ut,_6 as ge,c8 as he,L_ as Le,m9 as pt,Md as ce,Mc as de,_7 as bt,bn as fe,gU as _e,_8 as gt,W4 as ht,l_ as Me,W5 as Ce,W6 as ft,kM as St,Y7 as It,k$ as yt,LO as Rt,Bx as vt,kT as At,Mz as $e,_9 as Pe,_a as Ee,_b as kt,_c as Ct,_d as Et,Mj as we,l5 as wt,Yg as xt,Mb as Bt,LY as Tt,_e as Dt,LX as jt,_f as Ft,M3 as xe,Mn as Ut,Mm as Lt,Mi as _t,_g as Ne,Rx as Mt,bo as $t,M6 as Pt,MR as Nt,_h as Ot,_i as zt,Mv as Gt,Ms as Be,XD as Vt,LV as Zt,_j as Oe,Ni as Te,Nq as Ht,_k as Wt,_l as Y,_m as qt,_n as ze,_o as Yt,_p as Ge,_q as Ve,MH as ue,bu as Xt,bK as Se,cM as Ie,dY as Ze,dX as He,_r as Jt,gg as Kt,XQ as Qt,_s as en,_t as We,XU as tn,YC as nn,_u as an,Y$ as sn,Nn as De,Nm as on,_v as rn,_w as ln,_x as mn,_y as cn,_z as dn,Ym as un,Nd as pn,Nh as bn,bq as gn,bJ as hn,cG as fn,cu as Sn,bt as In,Tw as yn,d9 as Rn,dc as vn,db as An,cF as kn}from"./zeni-epic-state-BK-HD5IA.js";import{bS as Cn,r as qe,a1 as Ye,M as oe,y as x,z as _,cR as Xe,a8 as re,h as C,aS as je,J as F,ae as se,af as En,G as Je,cS as wn,p as X,as as Ke,cT as xn,V as le,cU as Bn,aq as Tn,ab as Dn,a7 as ye,S as Qe,w as jn,bA as Fn,av as Un,ai as Ln,E as et,cV as _n,f as Mn}from"./index-DfdR1P4V.js";import{n as P,S as $n}from"./mui-DsxbZgLG.js";import pe from"./NotFoundScreen-BDRAfL_x.js";import{S as Fe}from"./SetupPagesScreen-K06f0ggy.js";import{F as tt}from"./FeaturePreviewScreen-bhcVTnED.js";import{a as h}from"./sentry-CFLt6SLf.js";import{u as Re}from"./useAskAiCfoHostNavButtonProps-CnAY_u1k.js";import{u as nt}from"./useInitialThreadRequest-C8Pdei5-.js";import{D as Pn}from"./DrawerScreen-DaPp3vfO.js";import{M as at}from"./MobileAppDrawer-DjEeoE6u.js";import{F as Nn}from"./ScreenRoutes-BAM6ERJQ.js";import{R as On}from"./ReimbursementApprovalRoutes-4Gmx-MuW.js";import"./recharts-CmYjG1zt.js";import"./analytics-DP3hAmgL.js";import"./plaid-ewZxuvzf.js";import"./dnd-BXrho-40.js";import"./stripe-cKAAJElX.js";import"./lottie-DHD1nzoa.js";import"./lexical-DY18TAnZ.js";import"./pdf-BmQFuRIG.js";import"./utils-D1gULS4n.js";import"./BusinessVerificationPageScreen-OrLH3WzL.js";import"./routePaths-Cca1tWJp.js";import"./analyticsHelper-Bfs4R3aB.js";import"./InboxNotificationsProvider-ICcfArFM.js";import"./useTaskManagerAccess-DJ8lZv1E.js";import"./getLocaleForTenant-CK0bI6xd.js";import"./ReimbursementApprovalRuleDetailScreen-DiBNgDsy.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]="06aa6960-53d9-4491-a97a-9e9bb8b8cc3d",e._sentryDebugIdIdentifier="sentry-dbid-06aa6960-53d9-4491-a97a-9e9bb8b8cc3d")}catch{}})();const st=e=>`/${e}/reimbursements`,zn=e=>h.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},h.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),h.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{common:q,spendManagement:{reimbursement:{reimbursementDetail:ne}}}=Je.getLocalizedStrings(),Gn=ee((function(e,t){const n=t.currentTenant?.companyId,r=bt(e.plaidAccountViewState,"user_reimbursement_account"),c=_.getSignedInUser(),d=fe(c),m=r.plaidConnectionDetails,o=_e(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:a??""},l=ge(e,t.reimbursementId),b=gt(e,c?.userId??"");let y=`${c?.firstName} ${c?.lastName}`,f=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,f=c?.userId===l.createdBy?.userId);const B=e.entityAutoCompleteState?.autoCompleteText?.common,u=ht(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:B,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:y,isUserAdmin:he(t.currentTenant?.userRole??[]),isZeniUser:d,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:C,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:f,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:Me(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:c,navigate:d,themeState:m}=t,{tenantEmailDomain:o}=r,a=_.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(de(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(xe(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(_t(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Lt())},clearRemiSaveStatus:()=>{e(Ut("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(xe(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ft({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(jt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(Dt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Tt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Bt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(we(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(we("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Ee({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(ce({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Et({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(Ct({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(kt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Pe()),e(Ee({}));const i=st(o),l=X(c.state?.pathnameStackToGoBack,c.pathname);d(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(C.trackReimbursementDeleteReimbursement(n),e($e(n)))},onSaveBankAccount:()=>{a?.userId&&e(At(a?.userId,n))},onFetchLinkTokenClick:i=>{e(vt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(Rt(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(yt(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(St({fetchState:"Not-Started"})),e(It())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(ft({searchString:i,entityType:l,searchOrigin:"common"})):e(Ce("common"))},onCancelAutoComplete:()=>{e(Ce("common"))}}}}))(wn);function Ue(){const e=Q(),t=ae(),n=J(),{reimbursementId:r}=ie(),c=qe(),d=Ye(),[m,o]=h.useState(r==null),[a,i]=h.useState(1),{useFeatureGate:l}=oe(),{isFeatureEnabled:b}=l(x.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(x.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:f}=l(x.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:B,onAskAiCfoClick:u}=Re({mobileExploreReferrer:"Reimbursement Details"}),T=J().pathname,D=T.includes("edit"),j=T.includes("reimbursement/new"),[A,k]=h.useState(!1),E=_.getSignedInUser(),I=v((p=>Z(p))),g=v((p=>ge(p,r))),U=nt(I?.companyId,{clearParams:g.fetchState==="Completed"}),L=he(I?.userRole??[]);(function(){const p=ae(),N=v((K=>Z(K))),O=N?.tenantId,{isApprovalRulesV3Enabled:z,isLoading:H}=Cn(O),W=v((K=>K.remiSetupApproverViewState.fetchState));h.useEffect((()=>{O==null||H||W==="Not-Started"&&p(ut(!0,!1,!1,z))}),[O,H,z,W,p])})(),h.useEffect((()=>{(j&&!A||D&&!A&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(k(!0),t(Le(!1,b,y,r)))}));const M=v((p=>pt(p.accountState,p.accountListState,"reimbursementAccountList")));if(E==null)throw Error("Can't access address page without signing in...");const R={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||L&&g.billStatus==="rejected"||L===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx($,{to:R}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(Xe,{isNewReimbursement:r==null}):s.jsxs(Vn,{windowSize:d,children:[s.jsx(re,{analytics:C,onLoad:p=>(N=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&N.trackReimbursementEditReimbursement(r)})(p)}),m&&d!=="small"?s.jsx(Zn,{}):null,m&&d!=="small"?s.jsx(Hn,{children:s.jsx(je,{showAutofill:m,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:E?.userId??"",sessionId:E?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(de(p,a,!0,r,E?.userId))},updateInvoiceUploadFetchState:p=>{t(ce({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:F.sp3,paddingBottom:"15px",paddingLeft:F.sp5},dropFilePlaceholder:{upload:q.upload,single:ne.dropReceipt.single,or:q.texts.or,multiple:ne.dropReceipt.multiple,receipts:q.texts.receipts2}})}):null,m&&d==="small"?s.jsxs(Wn,{children:[s.jsx(qn,{onClick:()=>o(!1),children:s.jsx(zn,{})}),s.jsx(je,{showAutofill:m,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:E?.userId??"",sessionId:E?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(de(p,a,!0,r,E?.userId))},updateInvoiceUploadFetchState:p=>{t(ce({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:F.sp5,paddingRight:F.sp3,paddingBottom:F.sp5,paddingLeft:F.sp3},dropFilePlaceholder:{upload:q.upload,single:ne.dropReceipt.single,or:q.texts.or,multiple:ne.dropReceipt.multiple,receipts:q.texts.receipts2}})]}):null,s.jsx(Yn,{windowSize:d,children:s.jsx(Gn,{initialOpenThreadRequest:U??void 0,isReimbursementCommentingEnabled:f,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:c,uncategorizedAccounts:M,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:B,onAskAiCfoClick:u})})]})}const Vn=P.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=P.div`
8
- position: fixed;
9
- top: 0;
10
- left: 0;
11
- right: 0;
12
- bottom: 0;
13
- background-color: ${En.overlayBackgroundBlack};
14
- z-index: 5;
15
- `,Hn=P.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
- `,Wn=P.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
- `,qn=P.button`
37
- align-self: flex-end;
38
- background: none;
39
- border: none;
40
- cursor: pointer;
41
- padding: ${F.sp2} ${F.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: ${F.sp4};
49
- height: ${F.sp4};
50
- }
51
- `,Yn=P.div`
52
- display: flex;
53
- flex-direction: column;
54
- width: 100%;
55
- ${e=>e.windowSize!=="small"?"overflow: auto;":""}
56
- `,Xn=ee((function(e,t){const n=Ne(e,t.reimbursementId),r=_.getSignedInUser(),c=fe(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=Ot(n.remiActivities,zt(t.currentTenant),r));const i=he(t.currentTenant?.userRole??[]),l=r?.userId===n.createdBy?.userId;return{remiDetails:n,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:m,signedInUser:r,createdBy:o,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,isAdmin:i,showApproveRejectBtns:a,isZeniUser:c,isSignedInUserReimbursementCreator:l,isAccountingClassesEnabled:Me(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(Pe());const a=st(o),i=X(c.state?.pathnameStackToGoBack,c.pathname);d(a,{state:{pathnameStackToGoBack:i}})},onSaveRealTimeApprovals:a=>{e(Zt(n,"reimbursement",a))},updateEditRealTimeApproverClicked:a=>{e(Vt({isEdit:a,entityId:n,entityType:"reimbursement"}))},approveOrRejectRemi:a=>{a.type==="approved"?e(Be(n,a.type,"")):e(Be(n,a.type,a.description??""))},redirectToEditableReimbursementScreen:()=>{const a=X(c.state?.pathnameStackToGoBack,c.pathname);d("./edit",{state:{pathnameStackToGoBack:a}})},deleteReimbursement:()=>{C.trackReimbursementDeleteReimbursement(n),e($e(n))},cancelAndDeleteReport:a=>{a===!0?C.trackReimbursementCancelAndDeleteReimbursement(n):C.trackReimbursementCancelReimbursement(n),e(Gt(n,a))},handleZeniLogoClick:()=>{m.toggle()}}}))(xn);function Jn(){const e=Q(),t=ae(),n=J(),r=n.hash.substring(1),c=qe(),{reimbursementId:d}=ie(),m=_.getSignedInUser(),o=v((R=>Z(R))),a=v((R=>Ne(R,d??""))),i=a.remiDetails?.reimbursementInfo.stage.code==="draft",l=nt(o?.companyId,{clearParams:a.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:b,onAskAiCfoClick:y}=Re({mobileExploreReferrer:"Reimbursement Details"});Ke({isDataReady:a.fetchState==="Completed"});const{useFeatureGate:f}=oe(),{isFeatureEnabled:B}=f(x.isLimitedCategoryForReimbursement),[u,T]=h.useState(!1),[D,j]=h.useState(!1),[A,k]=h.useState(!1),{isFeatureEnabled:E}=f(x.isReimbursementCommentingEnabled),{isFeatureEnabled:I}=f(x.isShowDeletedReimbursementsFeatureEnabled),g=v((R=>ge(R,d??""))),U=Mt(o),L=$t(o.userRole),M=a.fetchState;if(h.useEffect((()=>{u||d==null?u==1&&M==="Error"&&e("page-not-found",{replace:!0}):(T(!0),t(Pt(d,!1,I)))}),[u,d,t,M]),h.useEffect((()=>{I&&a.remiDetails?.isDeleted===!0||o.isZeni===!0&&m?.userEmailDomain==="zeni.ai"&&U===!1?k(!1):k(a.remiActivities[0]?.isRealTimeApprovalEnabled&&(L||a.allApprovers.find((R=>R.user.userId===m?.userId))!=null||a.remiDetails?.lastUpdatedBy===m?.userId))}),[a.remiActivities[0]?.isRealTimeApprovalEnabled,a.allApprovers,a.remiDetails?.lastUpdatedBy,L,o.isZeni,U,m]),h.useEffect((()=>{D||a.fetchState!="Completed"||a.remiDetails?.reimbursementInfo.stage.code=="paid"||a.remiDetails?.reimbursementInfo.stage.code=="scheduled"||g.fetchState=="Completed"||g.fetchState=="In-Progress"||(j(!0),t(Le(!1,B,I,d)),a.remiActivities[0]?.isRealTimeApprovalEnabled===!0&&t(Nt(!1,!0,!0,a.lastUpdatedByUserId)))}),[D,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($,{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(Xe,{}):s.jsxs(s.Fragment,{children:[s.jsx(re,{analytics:C,onLoad:R=>(p=>{d!=null&&p.trackReimbursementReimbursementDetails(d)})(R)}),s.jsx(Xn,{initialOpenThreadRequest:l??void 0,scrollId:r,isReimbursementCommentingEnabled:E,isShowDeletedReimbursementEnabled:I,location:n,navigate:e,isRealTimeApprovalEnabled:A,currentTenant:o,reimbursementId:d??"",themeState:c,isAiCfoAccessEnabled:b,onAskAiCfoClick:y})]})}const Kn=ee((function(e,t){return{remisReviewView:Oe(e),analytics:t.analytics}}),(function(e,t){return{onCloseOverlay:()=>{t.navigate(`/${t.tenantEmailDomain}/reimbursements`),e(Y())},onCloseReviewItem:n=>{e(Wt(n))},onProceedForBulkActionClick:(n,r)=>{switch(n){case"send_for_approval":e(Ht());break;case"approve":e(Te("approved",r??""));break;case"reject":e(Te("rejected",r??""))}}}}))(Bn);function Qn({tenantEmailDomain:e}){const t=Q(),n=v((m=>m.remisBulkActionViewState.bulkSubmissionFetchState.fetchState)),{remisForReview:r}=v((m=>Oe(m))),c=le(),d=c?.loggedInUserRole?.includes("admin")===!0;return h.useEffect((()=>{n!=="Completed"&&r.length!==0||t(`/${e}/reimbursements`)}),[n,r.length,e]),s.jsx(Kn,{navigate:t,analytics:C,isAdmin:d,tenantEmailDomain:e})}const V=tn(),it="bulk-operation-update",be="reimbursement-approval-rule-update",{spendManagement:ea,common:me}=Je.getLocalizedStrings(),ta=ea.reimbursement.bulkActions,na=P.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
- `,aa=ee((function(e,t){const n=Ve(e,V,t.isBulkActionEnabled);let r=n.allSubTabs;const c=_.getSignedInUser(),d=fe(c),m=e.tenantState.currentTenantId,o=Z(e),a=o?.companyName??"",i={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:m??""},l=e.remiListState.downloadUIState.downloadState;t.isShowDeletedReimbursementEnabled===!1&&(r=r.filter((f=>f!=="deleted")));const b=n.fetchState,y=nn(e);return{transactionList:t.isShowDeletedReimbursementEnabled?n.reimbursements:n.reimbursements.filter((f=>f.isDeleted===!1)),isAdmin:t.isAdmin,isZeniUser:d,isBillPayCommentingEnabled:t.isBillPayCommentingEnabled,isReimbursementCommentingEnabled:t.isReimbursementCommentingEnabled,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:V,spendManagementEndPoint:`${Un}/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(Y()),e(ze(o))},onSubtabChange:o=>{e(Y()),e(Ge(o))},onTransactionClick:(o,a)=>{const i=oa(m,o,a),l=X(c.state?.pathnameStackToGoBack,c.pathname);n(i,{state:{pathnameStackToGoBack:l}})},onClickSetupIcon:()=>{const o=ia(m),a=X(c.state?.pathnameStackToGoBack,c.pathname);n(o,{state:{pathnameStackToGoBack:a}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;C?.trackReimbursementNewReimbursement();const a=`/${o}/reimbursement/new`,i=X(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(a,{state:{pathnameStackToGoBack:i}})},onColumnSortConfigChanged:(o,a)=>{e(dn({uiState:{sortKey:o,sortOrder:a},period:t.period}))},onSearchTextChanged:o=>{e(cn(o))},onFiltersChange:o=>{e(mn({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(ln({uiState:{downloadState:o}}))},onReloadTransactions:()=>{e(ue(d,!0,t.isShowDeletedReimbursementEnabled,!1,!0))},onBackClick:()=>{n("../",{relative:"path"})},onNavigateToSettings:()=>{n("../reimbursements/setup")},updateBulkActionList:o=>{e(rn(o))},removeAllTransactionsFromBulkActionList:()=>{e(Y())},onProceedForBulkActionClick:(o,a)=>{switch(o){case"delete":case"cancel":e(on(o,a??""));break;case"send_for_approval":e(De("send_for_approval")),t.navigate("./bulk-review");break;case"review":e(De("approve")),t.navigate("./bulk-review")}},onReimbursementApprovalRulesEventReceived:o=>{o.endsWith(be)&&e(sn(!1))},onEventReceived:o=>{o===it&&e(an())}}}))(jn(Fn));function sa(){const e=Q(),t=ae(),n=J(),r=n.state,c=Ye(),[d,m]=h.useState(null),o=ct("/:tenantEmailDomain/reimbursements/bulk-review")!=null;h.useEffect((()=>{if(r?.tab!=null&&r?.subTab!=null){const S=qt(r.tab.toString());S!=null?t(ze(S)):console.log("Warning:Not a valid remiListTab");const G=Yt(r.subTab.toString());G!=null?t(Ge(G)):console.log("Warning:Not a valid remiListSubTab")}return()=>{t(Y())}}),[]);const{useFeatureGate:a}=oe(),{isFeatureEnabled:i}=a(x.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:l}=a(x.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:b}=a(x.isBillPayCommentingEnabled),{isFeatureEnabled:y}=a(x.isReimbursementCommentingEnabled),{isFeatureEnabled:f}=a(x.isReimbursementBulkActionEnabled),B=_.getSignedInUser(),u=v((S=>Z(S))),[T,D]=h.useState(!1),[j,A]=h.useState(!1),k=le(),E=k?.loggedInUserRole?.includes("admin")===!0,I=v((S=>Ve(S,V,f))),{areTenantIdsInSync:g}=Tn(),U=I.fetchState,{isAiCfoAccessEnabled:L,onAskAiCfoClick:M}=Re({mobileExploreReferrer:"Reimbursement List"});if(Ke({isDataReady:U==="Completed"}),h.useEffect((()=>{!j&&g&&(A(!0),t(ue(V,!0,l,!1,!0)))}),[j,V,t,g]),B==null)throw Error("Can't access address page without signing in...");const R=!!u?.userRole&&Xt(u),p=Se(k?.loggedInUserRoleMap),N=Ie(k?.loggedInUserRoleMap),O=!!u.userReimbursementInfo?.isReimbursementTOSAccepted,z=!!u.companyReimbursementInfo?.info?.isReimbursementEnabled,H=!!u.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,W=v((S=>_e(S.companyState,u.companyId))),K=W?.company.featuresActivationInfo.connectedAccountProvider,ve=S=>{D(S)},{isFeatureEnabled:ot}=a(x.isDebitCardFeatureEnabled),rt=Ze(ot,u),lt=He(u),{remisProcessed:te,remisProcessing:Ae}=v((S=>Jt(S)));h.useEffect((()=>{te===Ae&&d!=null&&(t(Kt({messageSection:"reimbursement_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_report_",variableValue:te>1?me.texts.reports2:ta.report},{variableName:"_has_",variableValue:te>1?me.texts.have:me.texts.has},{variableName:"_action_",variableValue:Qt(d)}]})),t(en()),setTimeout((()=>{t(ue(V,!0,l,!1,!0,!0))}),3e3),m(null))}),[te,Ae]);const mt={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${it}`,`private-encrypted-${u.companyId}.${be}`]:[],eventCallback:(S,G,ke)=>{S.endsWith(be)?ke.onReimbursementApprovalRulesEventReceived?.(S):G.entity_type==="reimbursement"&&(m(G.operation_type),ke.onEventReceived(S))}};return n.pathname.endsWith("/reimbursements/")||n.pathname.endsWith("/reimbursements")||n.pathname.endsWith("/reimbursements/bulk-review")?rt===!0||lt===!0?s.jsx(tt,{}):z&&(!R||p)||N&&O?s.jsxs(s.Fragment,{children:[U==="Completed"?s.jsx(re,{analytics:C,onLoad:S=>(G=>G.trackPageLoaded(Qe.Event.reimbursementHome))(S)}):null,s.jsx(at,{isAppContentDrawerOpen:T,handleDrawerToggle:ve}),s.jsxs(na,{windowSize:c,children:[s.jsx(Pn,{isOpen:o,drawerLeftMargin:new Dn(0,0,300,600),onClose:()=>{e(`/${u.tenantEmailDomain}/reimbursements`),t(Y())},children:s.jsx(ra,{onClick:S=>S.stopPropagation(),children:s.jsx(Qn,{tenantEmailDomain:u.tenantEmailDomain})})}),s.jsx(aa,{isShowDeletedBillsEnabled:i,isShowDeletedReimbursementEnabled:l,isBillPayCommentingEnabled:b,isReimbursementCommentingEnabled:y,location:n,navigate:e,currentTenant:u,period:V,isAdmin:E,isEmployee:R,entity:"reimbursement",onClickMenuIcon:()=>{ve(!0)},createdByUserList:I.createdByUserList,createdByUserListFetchState:I.createdByUserListFetchState,isDownloadEnabled:I.isDownloadEnabled,connectedAccountProvider:K,isBulkActionEnabled:f,bulkSubmissionLimit:I.remiBulkSubmissionLimit,bulkSubmissionFetchState:I.remiListBulkActionInfo.bulkSubmissionFetchState,isAiCfoAccessEnabled:L,onAskAiCfoClick:M,...mt})]})]}):H&&p?s.jsx($,{to:"../setup"}):k!=null&&We(u,k.loggedInUserRoleMap)?s.jsx($,{to:"../promo"}):s.jsx(ye,{fetchState:"In-Progress"}):s.jsx(pe,{})}const ia=e=>`/${e}/reimbursements/setup`,oa=(e,t,n)=>{let r=`/${e}/reimbursement/${encodeURIComponent(t)}`;return n=="draft"&&(r+="/edit"),r},ra=P($n)`
65
- display: flex;
66
- min-height: 100%;
67
- flex-direction: column;
68
- `,la=ee((function(e,t){const{companyId:n}=t;return{reimbursementSetupView:un(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(bn(n))},onCreateNewRemiButtonClick:()=>{e(pn(t.userRoleId))},onBackClick:()=>{r("../..",{relative:"path"})},onSetupReimbursementSuccess:()=>{t.isEmployee?r("../../reimbursement/new",{relative:"path"}):r("../reimbursements/setup",{relative:"path"})}}}))(_n),ma=()=>{const e=Ln(),t=Q(),n=J(),{tenantEmailDomain:r}=ie(),c=et(),[d,m]=h.useState(!1),o=v((A=>Z(A))),a=_.getSignedInUserTenant(r)?.companyId??o.companyId,i=_.getSignedInUser(),l=o.userRoleId,b=!!o.userRole?.includes("reimbursements_user"),y=le(),f=Se(y?.loggedInUserRoleMap),B=Ie(y?.loggedInUserRoleMap),u=!!o.userReimbursementInfo?.isReimbursementTOSAccepted,T=!!o.companyReimbursementInfo?.info?.isReimbursementEnabled,D=!!o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,j=A=>{m(A)};if(i==null)throw Error("Can't access reimbursement promo page without signing in...");return T&&B&&u?s.jsx($,{to:"../../../reimbursements"}):D&&f?s.jsx($,{to:"../../reimbursements/setup"}):o.companyReimbursementInfo&&!D||o.userReimbursementInfo&&B&&u===!1?s.jsxs(s.Fragment,{children:[s.jsx(re,{analytics:C,onLoad:A=>(k=>k.trackPageLoaded(Qe.Event.reimbursementPromoPage))(A)}),s.jsx(at,{isAppContentDrawerOpen:d,handleDrawerToggle:j}),s.jsx(la,{companyId:a,navigate:t,meetingUrl:e("reimbursement_promo"),location:n,userReimbursementInfo:o.userReimbursementInfo,userRoleId:l,isEmployee:b,onClickMenuIcon:()=>{j(!0)}})]}):s.jsx(ye,{fetchState:"In-Progress",style:{backgroundColor:c.colors.grey5}})};function Oa(){const e=v((W=>Z(W))),t=le(),n=!!e.company?.companyReimbursementInfo.isReimbursementEnabled,r=et(),c=!!e.company?.companyReimbursementInfo.isReimbursementTOSAccepted,d=!!e.userReimbursementInfo?.isReimbursementTOSAccepted,{useFeatureGate:m}=oe(),{isFeatureEnabled:o}=m(x.isChargeCardFeatureEnabled),{isFeatureEnabled:a}=m(x.isDebitCardFeatureEnabled),i=Ze(a,e),l=He(e),b=e?.userRole!=null&&gn(e?.userRole),y=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b)&&hn(t?.loggedInUserRoleMap),f=fn(t?.loggedInUserRoleMap),B=e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!b,u=Se(t?.loggedInUserRoleMap),T=B&&u,D=!!e.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!b,j=D&&Sn(t?.loggedInUserRoleMap),A=Mn(e,o,a)&&!b,k=A&&In(t?.loggedInUserRoleMap),E=yn(t?.loggedInUserRoleMap),I=Rn(t?.loggedInUserRoleMap),g=vn(t?.loggedInUserRoleMap),U=D&&I,L=e.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!b&&g,M=An(t?.loggedInUserRoleMap),R=kn(t?.loggedInUserRoleMap),p=Ie(t?.loggedInUserRoleMap),N=A&&M,{tenantEmailDomain:O}=ie(),z=J(),H=n===!0&&(u||p&&d);return s.jsxs(dt,{children:[z.pathname.includes("/reimbursements")?s.jsxs(s.Fragment,{children:[s.jsx(w,{path:"verification",element:s.jsx(Fe,{isBillPayAdminLevelAccess:y,isUserHasOnlyBillPayAccess:f,isReimbursementAdminLevelAccess:T,isZeniAccountAdminLevelAccess:j,isChargeCardAdminLevelAccess:k,isUserHasOnlyCardAccess:E,productType:"reimbursement",type:"verification"})}),s.jsx(w,{path:"setup",element:s.jsx(Fe,{isBillPayAdminLevelAccess:y,isUserHasOnlyBillPayAccess:f,isReimbursementAdminLevelAccess:T,isZeniAccountAdminLevelAccess:j,isChargeCardAdminLevelAccess:k,isUserHasOnlyCardAccess:E,productType:"reimbursement",type:"setup"})}),s.jsx(w,{path:"promo",element:s.jsx(ma,{})}),s.jsx(w,{path:"approval-rules/*",element:T?s.jsx(On,{}):s.jsx(Nn,{showZeniAccountRoute:U,isUserHasBillPayAccess:R,isUserHasReimbursementAccess:p,showTreasuryRoute:L,isTenantBankingOnly:i,showChargeCardRoute:N,tenantEmailDomain:O??""})}),H&&s.jsx(w,{path:"*",element:s.jsx(sa,{})}),(i===!0||l===!0)&&s.jsx(w,{path:"/*",element:s.jsx(tt,{})}),t!=null&&We(e,t?.loggedInUserRoleMap)&&s.jsx(w,{path:"*",element:s.jsx($,{to:"../promo"})}),c&&u&&s.jsx(w,{path:"*",element:s.jsx($,{to:"../setup"})})]}):z.pathname.includes("/reimbursement")?s.jsxs(s.Fragment,{children:[s.jsx(w,{path:"new",element:s.jsx(Ue,{})}),s.jsx(w,{path:":reimbursementId",element:s.jsx(Jn,{})}),s.jsx(w,{path:":reimbursementId/edit",element:s.jsx(Ue,{})}),s.jsx(w,{path:"*",element:s.jsx(pe,{})})]}):s.jsx(w,{path:"*",element:s.jsx(ye,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5,boxShadow:`0px 2px ${F.sp1} ${r.colors.dropShadowNormal}`}})}),s.jsx(w,{path:"*",element:s.jsx(pe,{})})]})}export{Oa as default};
@@ -1 +0,0 @@
1
- import{j as a}from"./liveblocks-BHA40K9j.js";import{z as j,a8 as v,h as u,S as E,e1 as N,M as k,y as C}from"./index-DfdR1P4V.js";import"./mui-DsxbZgLG.js";import g from"./NotFoundScreen-BDRAfL_x.js";import{a as c}from"./sentry-CFLt6SLf.js";import{u as I,j as h,h as F,g as L,l as _,n as T,o as f,N as y}from"./core-C_3BcvPm.js";import{fE as U,a17 as w,a18 as p,D8 as P,p_ as V,a19 as z,D6 as G}from"./zeni-epic-state-BK-HD5IA.js";import"./recharts-CmYjG1zt.js";import"./analytics-DP3hAmgL.js";import"./plaid-ewZxuvzf.js";import"./dnd-BXrho-40.js";import"./stripe-cKAAJElX.js";import"./lottie-DHD1nzoa.js";import"./lexical-DY18TAnZ.js";import"./pdf-BmQFuRIG.js";import"./utils-D1gULS4n.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]="3fd17aa0-d4b3-43f1-8e2c-3f6670937f80",e._sentryDebugIdIdentifier="sentry-dbid-3fd17aa0-d4b3-43f1-8e2c-3f6670937f80")}catch{}})();const M=_((function(e,t){const n=w(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=j.getSignedInUser();return{onDismissClick:()=>{e(p()),n("/")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach((l=>{s.push(l.companyName),r.push(l.emailIds[0])})),u.trackInviteEmailClicked("send",s,r,s.length)}e(G())},onUpdateInviteFormLocalData:s=>{e(z({localData:s}))},onSubmitSuccess:()=>{e(p())},onCancelClick:()=>{i!=null&&u.trackInviteEmailClicked("cancel")}}}))(N),R=()=>{const e=I(),[t,n]=c.useState(!1),[i,s]=c.useState(!1),r=h((o=>U(o))),l=F(),x=L(),d=j.getSignedInUser();if(d==null)throw Error("Can't access invite referral screen without signing in...");const m=h((o=>w(o))),b=d?.firstName!=null?d.firstName:"User";c.useEffect((()=>{e(p()),r?.rewardsLastViewedTime==null&&i===!1&&(e(P()),s(!0))}),[]),c.useEffect((()=>{t||m.fetchState!=="Not-Started"||(n(!0),e(V(!0)))}),[m.fetchState,e]);const D=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[m.fetchState==="Completed"?a.jsx(v,{analytics:u,onLoad:o=>(S=>S.trackPageLoaded(E.Event.inviteEmailViewed))(o)}):null,a.jsx(M,{navigate:l,location:x,currentTenant:r,companyName:D,userName:b,inviteFormCompayData:m.localData})]})};function ne(){const{useFeatureGate:e}=k(),{isFeatureEnabled:t}=e(C.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(R,{}):a.jsx(g,{})}),a.jsx(f,{path:"*",element:a.jsx(g,{})})]})}export{ne as default};
@@ -1,25 +0,0 @@
1
- import{j as E}from"./liveblocks-BHA40K9j.js";import{a as I}from"./sentry-CFLt6SLf.js";import{i as M,u as q,h as W,g as z,j as h,l as Z}from"./core-C_3BcvPm.js";import{V$ as be,W0 as we,l_ as H,rS as Je,s2 as Ne,sk as je,si as Oe,sl as Pe,so as _e,W1 as Ve,fE as F,U_ as oe,W2 as de,gZ as X,cB as Q,cC as ee,Ey as ge,W3 as Se,EC as Me,Sn as ie,Ew as Ge,Eq as Re,W4 as ue,Ei as $e,Eh as Fe,Ec as Ue,En as Ye,ED as Ke,W5 as U,W6 as re,Ej as We,U$ as te,gN as fe,ET as Ee,EM as De,W7 as ke,rY as Ce,EG as ye,EE as ve,W8 as Ae,E_ as Ie,EX as xe,EH as Te,EZ as Be}from"./zeni-epic-state-BK-HD5IA.js";import{a4 as ae,aY as ne,aZ as ze,z as qe,l as Ze,a7 as He,a8 as le,h as O,av as Xe,a_ as Qe,p as _,G as he,r as me,a$ as et,b0 as tt,b1 as at}from"./index-DfdR1P4V.js";import{n as pe}from"./mui-DsxbZgLG.js";import{p as nt}from"./pathToGoBack-D0yBSaLk.js";import K from"./NotFoundScreen-BDRAfL_x.js";import{c as V}from"./routePaths-Cca1tWJp.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]="5500451b-4c9d-4e75-9d8e-b25373655fa8",e._sentryDebugIdIdentifier="sentry-dbid-5500451b-4c9d-4e75-9d8e-b25373655fa8")}catch{}})();function bt({isRenderedInPanel:e=!1,accrualIdOverride:t,onPanelNavigateBack:d}={}){const{accrualId:l}=M(),s=t??l,n=q(),u=W(),a=z(),{accrual:c,actionFetchState:o,detailFetchState:f,localData:D}=h((i=>be(i,s??""))),C=h((i=>we(i))),x=h((i=>H(i))),r=I.useCallback((()=>{const i=ae(a.state?.pathnameStackToGoBack);u(i.poppedPathname??nt(4),{state:{pathnameStackToGoBack:i.newStack}})}),[a.state,u]),k=I.useRef(!1);return I.useEffect((()=>{o.fetchState!=="In-Progress"&&k.current&&o.fetchState==="Completed"&&(k.current=!1,r())}),[o.fetchState,r]),I.useEffect((()=>{s!=null&&c==null&&f.fetchState==="Not-Started"&&n(Je(s))}),[s,c,f.fetchState]),I.useEffect((()=>{n(Ne({scheduleType:"prepaid_expenses",shouldResetEnteredData:!1}))}),[n]),s==null?E.jsx(K,{}):c==null?f.fetchState==="Not-Started"||f.fetchState==="In-Progress"?E.jsx(ne,{}):E.jsx(K,{}):E.jsx(ze,{isRenderedInPanel:e,accrual:c,actionFetchState:o.fetchState,isAccountingClassesEnabled:x,localData:D,newAccrualAccountsView:C,onAccrualFormChange:(i,m)=>{n(Ve({accrualId:i,localData:m}))},onAccrualFormClear:i=>{n(_e({accrualId:i}))},onApproveAndPost:i=>{n(Pe(s,i))},onNavigateBack:d??r,onRevert:(i,m)=>{k.current=!0,n(Oe(s,i,m))},onSkip:(i,m)=>{n(je(s,i,m))}})}const lt=he.getLocalizedStrings(),st=Z((function(e,t){const d=de(e,t.scheduleTab),l=e.tenantState.currentTenantId;return{authParams:{userId:t.signedInUser.userId??"",sessionId:t.signedInUser.zeniSessionId??"",tenantId:l??""},linkBillExpenseView:d.linkBillExpenseView,transactions:d.linkBillExpenseView.transactions}}),(function(e,t){const{navigate:d,location:l}=t;return{onTransactionSelect(s){e(Se({selectedTransaction:s}))},onBackClick:()=>{d("..",{relative:"path"})},onCancel(){e(Se({selectedTransaction:void 0})),e(Me()),d("..",{relative:"path"})},onTransactionClick:s=>{const n=`${V(s,t.tenantEmailDomain)}`,u=_(l.state?.pathnameStackToGoBack,l.pathname);d(n,{state:{pathnameStackToGoBack:u}})},onLinkSave(){t.setShouldNavigateBack(!1),e(ge(t.scheduleTab,t.scheduleAccruedDetailsView.selectedJEAccruedSchedule?.jeScheduleId))}}}))(Qe),wt=({setShouldNavigateBack:e})=>{const t=W(),d=z(),{scheduleDetailId:l,tenantEmailDomain:s}=M(),{scheduleType:n}=M();if(s==null)throw Error("Can't access Link Bill Expense page without tenant Email Domain");const u=h((r=>F(r))),a=oe(n)??"accrued_expenses",c=qe.getSignedInUser();if(c==null)throw Error("Can't access Link Bill Expensedetail page without signing in...");if(l==null)throw Error("Invalid Schedule Detail Id");const o=h((r=>de(r,a))),f=o.selectedJELinkRowIndex,D=h((r=>X(r,u.companyId))),C=Ze(o.updateStatus.fetchState);I.useEffect((()=>{C==="In-Progress"&&o.updateStatus.fetchState==="Completed"&&t("..",{relative:"path"})}),[C,o.updateStatus.fetchState]),I.useEffect((()=>{o.fetchState==="Not-Started"&&t("..",{relative:"path"})}),[]),I.useEffect((()=>{o.selectedJEAccruedSchedule!=null&&o.selectedJELinkRowIndex!=null||t("..",{relative:"path"})}),[o.selectedJEAccruedSchedule,o.selectedJELinkRowIndex]);const x=o.linkBillExpenseView.fetchState==="Completed";return E.jsx(E.Fragment,{children:o.linkBillExpenseView.fetchState==="In-Progress"?E.jsx(He,{fetchState:o.linkBillExpenseView.fetchState}):o.selectedJEAccruedSchedule!=null&&f!=null?E.jsxs(E.Fragment,{children:[x===!0?E.jsx(le,{analytics:O,onLoad:()=>{ct(o,a,D)}}):null,E.jsx(st,{signedInUser:c,attachmentEndPoint:`${Xe}/vendor_attachments`,setShouldNavigateBack:e,scheduleVendorId:o.selectedJEAccruedSchedule.vendor.id??"",location:d,tenantEmailDomain:s,scheduleAccruedDetailsView:o,saveFetchState:o.updateStatus.fetchState,scheduleTab:a,navigate:t,analytics:O,controllerUserDetails:D,saveStatus:o.updateStatus.fetchState,jeAccruedSchedule:o.selectedJEAccruedSchedule,localData:o.scheduleAccruedDetailsLocalData.jeScheduleDetails[f]})]}):null})},Le=e=>{const t=lt.dateFormat.analytics.YYYYDashMMDashDDFormat;return{scheduleCreateDate:e.createTime.format(t)??null,scheduleMonthlyAmount:e.recurringAmount??null,startingBalance:e.otherAttributes.startingBalance??null,scheduleAccountCategory:e.jeCredit.account?.accountName??null,description:e.memo,runningBalance:e.balanceAsOfToday??null,currentBalance:e.balanceAsOfToday??null,currentStatus:e.status.label,period:e.period??null,startMonth:e.startDate?.format(t)??null,endMonth:e.endDate?.format(t)??null}},ct=(e,t,d)=>{const l=e.selectedJEAccruedSchedule,s=e.selectedJELinkRowIndex;let n;s!=null&&l!=null&&(n=l.scheduledJournalEntry[s]);const{transactions:u}=e.linkBillExpenseView,a=u.some((f=>f.isRecommendedTransaction===!0)),c=Q(d.controllers),o=ee(d.controllerUserIds);l!=null&&O.trackScheduleAccruedDetailsJournalEntryLinkedLoaded({scheduleType:t,schedule:{...Le(l)},scheduleExpenseCategoryAndClass:{expenseCategory:l.jeDebit.account?.accountName??null,expenseClass:l.jeDebit.accountingClass?.className??null},journalEntryDetails:{wasRecommendationAvailable:a,journalEntryPostingStatus:n?.status.label??""},vendorName:l.vendor.name??null,controllerEmails:c,controllerUserIds:o})},ot=pe.div`
2
- display: flex;
3
- min-height: 100%;
4
- width: 100%;
5
- flex: 1 0 auto;
6
- flex-direction: column;
7
- align-items: center;
8
- background-color: ${e=>e.theme.colors.grey4};
9
- `,dt=Z((function(e){const t=F(e),d=e.entityAutoCompleteState.autoCompleteText.common,l=ue(e,"common");return{tenantName:t.companyName,vendorSearchAutoCompleteData:{autoCompleteText:d,entityAutoCompleteView:l}}}),(function(e,t){const{navigate:d,location:l}=t,s="accrued_expenses";return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const n=ae(l.state?.pathnameStackToGoBack);n.poppedPathname==null?d("../schedules/accrued_expenses"):d(n.poppedPathname,{state:{pathnameStackToGoBack:n.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:n=>{t.setShouldNavigateBack(!0),e(ge(s,n))},onDelete:n=>{e(We(s,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(n,u)=>{n.trim().length>=2?e(re({searchString:n,entityType:u,searchOrigin:"common"})):n.trim().length===0&&e(U("common"))},onCancelAutoComplete:()=>{e(U("common"))}},onEditAmount:(n,u)=>{e(Ke(s,n,u))},onJELinkClick:n=>{e(Ye({selectedJELinkRowIndex:n})),d("./edit_link")},onCancelAccrual:(n,u,a)=>{e(Ue(n,u,a))},onTransactionClick:n=>{const u=`${V(n,t.tenantEmailDomain)}`,a=_(l.state?.pathnameStackToGoBack,l.pathname);d(u,{state:{pathnameStackToGoBack:a}})},onViewPostedJE:n=>{const u=`${V(n,t.tenantEmailDomain)}`,a=_(l.state?.pathnameStackToGoBack,l.pathname);d(u,{state:{pathnameStackToGoBack:a}})},onViewRecordedJE:n=>{const u=`${V(n,t.tenantEmailDomain)}`,a=_(l.state?.pathnameStackToGoBack,l.pathname);d(u,{state:{pathnameStackToGoBack:a}})},onViewBillExpense:n=>{const u=`${V(n,t.tenantEmailDomain)}`,a=_(l.state?.pathnameStackToGoBack,l.pathname);d(u,{state:{pathnameStackToGoBack:a}})},onDetailPageChange:(n,u,a)=>{const{scheduleDetailsAccruedExpensesSection:c}=n,{amount:o,memo:f,months:D,scheduleAccruedExpenseCategory:C,scheduleClass:x,scheduleExpenseCategory:r,startDate:k,vendor:i}=c,m=x.selectedOption!=null?t.classList.find((T=>T.classId===x.selectedOption)):void 0,S=r.selectedOption!=null?t.accountList.find((T=>T.qboId===r.selectedOption)):void 0,L=C.selectedOption!=null?t.accruedAccountList.find((T=>T.qboId===C.selectedOption)):void 0,b=D?.selectedOption;e($e({scheduleType:s,localData:u,selectedJeScheduleDetailId:t.scheduleDetailId})),a!==!1||t.scheduleDetailId!=null||S?.accountId==null||t.isAccountingClassesEnabled!==!1&&m?.classId==null||L==null||i.selectedOption==null||f==null||o==null&&o==0||k==null||b==null||e(Fe({scheduleType:s}))}}}))(et),Jt=({shouldNavigateBack:e,setShouldNavigateBack:t,isRenderedInPanel:d=!1,scheduleDetailIdOverride:l,onPanelNavigateBack:s}={})=>{const[n,u]=I.useState(!1),a=e??n,c=t??u,o=W(),f=z(),D=q(),C=me(),{tenantEmailDomain:x}=M(),[r,k]=I.useState(!1);if(x==null)throw new Error("Can't access this page without a tenantEmailDomain");const{scheduleDetailId:i}=M(),m=l??i;let S;m!=="new"&&(S=m);const L=it(m),b=h((B=>B.scheduleAccruedDetailState.selectedJEAccruedScheduleKey)),T="accrued_expenses",y=h((B=>de(B,"accrued_expenses"))),w=h((B=>ie(B))),J=h((B=>B.classListState.fetchState)),N=h((B=>H(B))),v=w!=="Completed"||J!=="Completed";I.useEffect((()=>{r===!1&&v?(D(Ge(T,S)),k(!0)):v===!1&&r===!1&&m!=="new"&&(D(Re(T,m)),k(!0))}),[r]);const j=h((B=>F(B))),P=h((B=>X(B,j.companyId))),A=y.fetchState,G=y.allAccountList,R=y.allClassList,$=y.allAccruedAccountList,Y=y.scheduleAccruedDetailsLocalData;if(L!==!0||y.fetchState==="Error")return E.jsx(K,{});const g=A==="Completed"&&r===!0,p=y.selectedJEAccruedSchedule!=null;return A==="Completed"||A==="Not-Started"||d===!0&&p?E.jsxs(ot,{children:[g===!0?E.jsx(le,{analytics:O,onLoad:()=>{ut(y,T,P)}}):null,E.jsx(dt,{isRenderedInPanel:d,onPanelNavigateBack:s,setShouldNavigateBack:c,scheduleAccruedDetailsView:y,location:f,navigate:o,classList:R,accountList:G,shouldNavigateBack:a,accruedAccountList:$,scheduleLocalData:Y,selectedJEScheduleKey:b,scheduleDetailId:S,selectedScheduledJournalEntries:y.selectedJEAccruedSchedule?.scheduledJournalEntry??[],themeState:C,tenantEmailDomain:x,analytics:O,controllerUserDetails:P,isAccountingClassesEnabled:N,status:y.selectedJEAccruedSchedule?.status.code})]}):E.jsx(ne,{})},it=e=>e!=null,ut=(e,t,d)=>{const l=e.selectedJEAccruedSchedule,s=Q(d.controllers),n=ee(d.controllerUserIds);l!=null&&O.trackScheduleAccruedDetailsLoaded({scheduleType:t,scheduleExpenseCategoryAndClass:{expenseCategory:l.jeDebit.account?.accountName??null,expenseClass:l.jeDebit.accountingClass?.className??null},schedule:{...Le(l)},vendorName:l.vendor.name??null,controllerEmails:s,controllerUserIds:n})},rt=pe.div`
10
- display: flex;
11
- min-height: 100%;
12
- width: 100%;
13
- flex: 1 0 auto;
14
- flex-direction: column;
15
- align-items: center;
16
- background-color: ${e=>e.theme.colors.grey4};
17
- `,se=he.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,ht=Z((function(e){const t=F(e),d=te(e,"fixed_assets");return{tenantName:t.companyName,scheduleDetailsView:d}}),(function(e,t){const{navigate:d,location:l,vendorSearchAutoCompleteData:s,selectedScheduledJournalEntries:n}=t,u="fixed_assets",a=n.flatMap((c=>c.error)).filter((c=>!!c))??[];return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const c=ae(t.location.state?.pathnameStackToGoBack);c.poppedPathname==null?d("../schedules/fixed_assets"):t.navigate(c.poppedPathname,{state:{pathnameStackToGoBack:c.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:c=>{e(Be(u,c,a.length>0))},onDelete:c=>{e(Te(u,c))},onMarkAsComplete:()=>{t.selectedJEScheduleKey!=null&&e(xe(u,t.selectedJEScheduleKey))},onEditAmount:(c,o)=>{e(Ie(u,c,o))},onJELinkClick:c=>{e(Ae({selectedJELinkRowIndex:c})),d("./edit_link")},onTransactionClick:c=>{const o=`${V(c,t.tenantEmailDomain)}`,f=_(l.state?.pathnameStackToGoBack,l.pathname);d(o,{state:{pathnameStackToGoBack:f,message:"comingFromScheduleDetailsFixedAssets"}})},onViewLinkedJE:c=>{const o=`${V(c,t.tenantEmailDomain)}`,f=_(l.state?.pathnameStackToGoBack,l.pathname);d(o,{state:{pathnameStackToGoBack:f}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(c,o)=>{c.trim().length>=2?e(re({searchString:c,entityType:o,searchOrigin:"common"})):c.trim().length===0&&e(U("common"))},onCancelAutoComplete:()=>{e(U("common"))}},onDetailPageChange:(c,o)=>{const{scheduleDetailsFixedAssetsSection:f,scheduleDetailsListSection:D}=c,{scheduleClass:C,scheduleExpenseCategory:x,accumulatedDepreciationCategory:r,assetId:k,months:i,startDate:m,postingDate:S,vendor:L}=f,b=s.entityAutoCompleteView.vendor.length>0?s.entityAutoCompleteView.vendor.find((A=>A.id===L?.selectedOption)):void 0,T={id:b?.zeniId??L?.selectedOption??"",name:b?.name??L?.defaultOptions.find((A=>A.value===L?.selectedOption))?.label??"",logo:b?.logo},y=C.selectedOption!=null?t.classList.find((A=>A.classId===C.selectedOption)):void 0,w=x.selectedOption!=null?t.accountList.find((A=>A.qboId===x.selectedOption)):void 0,J=r.selectedOption!=null?t.depAccountList.find((A=>A.qboId===r.selectedOption)):void 0,N=i?.selectedOption,v=D.map(((A,G)=>({...t.scheduleLocalData.jeScheduleDetails[G],amount:{...t.scheduleLocalData.jeScheduleDetails[G].amount,amount:A.amount}}))),j=S.type==="day"?S.dayOfMonth?S.dayOfMonth:1:void 0,P=S.type==="lastDayOfMonth"||void 0;e(ye({scheduleType:u,localData:{selectedAccount:w?.accountId,selectedClass:y?.classId,selectedAccumulatedDepreciationCategory:J?.accountId,selectedDate:m,selectedMonths:N,assetId:k,jeScheduleDetails:v,lastDayOfMonth:P,selectedDayOfMonth:j,selectedVendor:T},selectedJeScheduleDetailId:t.scheduleDetailId})),o!==!1||J?.accountId==null||t.scheduleDetailId!=null&&t.status!=="draft"&&t.status!=="marked_as_completed"||w?.accountId==null||t.isAccountingClassesEnabled!==!1&&y?.classId==null||m==null||N==null||P!==!0&&j==null||e(ve({scheduleType:u}))}}}))(tt),Nt=({isRenderedInPanel:e=!1,scheduleDetailIdOverride:t,onPanelNavigateBack:d}={})=>{const l=W(),s=z(),n=q(),u=me(),{tenantEmailDomain:a}=M(),[c,o]=I.useState(!1),{scheduleDetailId:f}=M(),D=t??f,C=s.state?.message==="expenseAutomation",x=mt(D),r=h((g=>g.scheduleDetailState.selectedJEScheduleKey));I.useEffect((()=>{r!=null&&r.length!==0||D!=="new"||l("../schedules/fixed_assets")}),[r,D]);const k="fixed_assets",i=h((g=>te(g,k))),m=h((g=>g.entityAutoCompleteState.autoCompleteText.common)),S=h((g=>ue(g,"common"))),L=h((g=>ie(g))),b=h((g=>g.classListState.fetchState)),T=h((g=>H(g))),y=h((g=>fe(g).selectedPeriod)),w=L!=="Completed"||b!=="Completed";I.useEffect((()=>{c===!1&&w?(n(Ee(k,R,!0)),o(!0)):w===!1&&c===!1&&(n(De(k,D==="new"?void 0:D,!0)),o(!0))}),[c]),I.useEffect((()=>{if(i.markAsCompleteStatus.fetchState==="Completed")if(n(ke()),C===!0){const{month:g,year:p}=y;l(`../../month_end_close_checks/review/je_schedules/${g}-${p}`)}else l("../schedules/fixed_assets")}),[i.markAsCompleteStatus.fetchState]);const J=h((g=>F(g))),N=h((g=>X(g,J.companyId))),v=i.fetchState,j=i.allAccountList,P=i.allClassList,A=i.allDepreciationAccountList,G=i.scheduleDetailsLocalData.fixed_assets;let R;if(D!=="new"&&(R=D),x!==!0||i.fetchState==="Error")return E.jsx(K,{});const $=v==="Completed"&&c===!0,Y=i.selectedJEScheduleTransaction!=null;return v==="Completed"||e===!0&&Y?E.jsxs(rt,{children:[$===!0?E.jsx(le,{analytics:O,onLoad:()=>{St(i,k,N)}}):null,E.jsx(ht,{isRenderedInPanel:e,onPanelNavigateBack:d,location:s,navigate:l,classList:P,vendorSearchEntityAutoCompleteView:S,vendorSearchAutoCompleteData:{autoCompleteText:m,entityAutoCompleteView:S},expenseAutomationSelectedPeriod:y,usedInExpenseAutomation:C,removeJeScheduleTransactionKey:(g,p)=>{n(Ce(g,p))},accountList:j,depAccountList:A,scheduleLocalData:G,selectedJEScheduleKey:r,scheduleDetailId:R,selectedScheduledJournalEntries:i.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:u,tenantEmailDomain:a,analytics:O,controllerUserDetails:N,isAccountingClassesEnabled:T,status:i.selectedJEScheduleTransaction?.status.code})]}):E.jsx(ne,{})},mt=e=>e!=null,pt=e=>({transactionDate:e.date.format(se),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),St=(e,t,d)=>{const l=e.selectedJEScheduleTransaction?.baseTransaction,s=e.selectedJEScheduleTransaction,n=Q(d.controllers),u=ee(d.controllerUserIds);var a;l!=null&&s!=null&&O.trackScheduleDetailsLoaded({scheduleType:t,transaction:{...pt(l)},scheduleExpenseCategoryAndClass:{expenseCategory:s.jeDebit.account?.accountName??null,expenseClass:s.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(a=s,{currentBalance:a.balanceAsOfToday??null,currentStatus:a.status.label,period:a.period??null,startMonth:a.startDate?.format(se)??null,endMonth:a.endDate?.format(se)??null})},vendorName:s.vendor.name??null,fixedAssetsDetails:{accumulatedDepreciationCategory:s.jeCredit.account?.accountName??null,assetId:s.otherAttributes.assetId??null},controllerEmails:n,controllerUserIds:u})},gt=pe.div`
18
- display: flex;
19
- min-height: 100%;
20
- width: 100%;
21
- flex: 1 0 auto;
22
- flex-direction: column;
23
- align-items: center;
24
- background-color: ${e=>e.theme.colors.grey4};
25
- `,ce=he.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,ft=Z((function(e,t){const d=F(e),l=te(e,t.scheduleTab);return{tenantName:d.companyName,scheduleDetailsView:l}}),(function(e,t){const{navigate:d,location:l,vendorSearchAutoCompleteData:s,selectedScheduledJournalEntries:n}=t,u=n.flatMap((a=>a.error)).filter((a=>!!a))??[];return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const a=ae(t.location.state?.pathnameStackToGoBack);a.poppedPathname==null?d("../schedules/prepaid_expenses"):t.navigate(a.poppedPathname,{state:{pathnameStackToGoBack:a.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:a=>{e(Be(t.scheduleTab,a,u.length>0))},onDelete:a=>{e(Te(t.scheduleTab,a))},onMarkAsComplete:()=>{t.selectedJEScheduleKey!=null&&e(xe(t.scheduleTab,t.selectedJEScheduleKey))},onEditAmount:(a,c)=>{e(Ie(t.scheduleTab,a,c))},onJELinkClick:a=>{e(Ae({selectedJELinkRowIndex:a})),d("./edit_link")},onTransactionClick:a=>{const c=`${V(a,t.tenantEmailDomain)}`,o=_(l.state?.pathnameStackToGoBack,l.pathname);d(c,{state:{pathnameStackToGoBack:o,message:"comingFromScheduleDetails"}})},onViewLinkedJE:a=>{const c=`${V(a,t.tenantEmailDomain)}`,o=_(l.state?.pathnameStackToGoBack,l.pathname);d(c,{state:{pathnameStackToGoBack:o}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(a,c)=>{a.trim().length>=2?e(re({searchString:a,entityType:c,searchOrigin:"common"})):a.trim().length===0&&e(U("common"))},onCancelAutoComplete:()=>{e(U("common"))}},onDetailPageChange:(a,c)=>{const{scheduleDetailsSection:o,scheduleDetailsListSection:f}=a,{scheduleClass:D,scheduleExpenseCategory:C,months:x,startDate:r,postingDate:k,vendor:i}=o,m=s.entityAutoCompleteView.vendor.length>0?s.entityAutoCompleteView.vendor.find((v=>v.id===i?.selectedOption)):void 0,S={id:m?.zeniId??i?.selectedOption??"",name:m?.name??i?.defaultOptions.find((v=>v.value===i?.selectedOption))?.label??"",logo:m?.logo},L=D.selectedOption!=null?t.classList.find((v=>v.classId===D.selectedOption)):void 0,b=C.selectedOption!=null?t.accountList.find((v=>v.qboId===C.selectedOption)):void 0,T=x?.selectedOption,y=f.map(((v,j)=>({...t.scheduleLocalData.jeScheduleDetails[j],amount:{...t.scheduleLocalData.jeScheduleDetails[j].amount,amount:v.amount}}))),w=k.type==="day"?k.dayOfMonth?k.dayOfMonth:1:void 0,J=k.type==="lastDayOfMonth"||void 0,N={selectedAccount:b?.accountId,selectedClass:L?.classId,selectedDate:r,selectedMonths:T,jeScheduleDetails:y,lastDayOfMonth:J,selectedVendor:S,selectedDayOfMonth:w};e(ye({scheduleType:t.scheduleTab,localData:N,selectedJeScheduleDetailId:t.scheduleDetailId})),c!==!1||t.scheduleDetailId!=null&&t.status!=="draft"&&t.status!=="marked_as_completed"||b?.accountId==null||t.isAccountingClassesEnabled!==!1&&L?.classId==null||r==null||T==null||J!==!0&&w==null||e(ve({scheduleType:t.scheduleTab}))}}}))(at),jt=({isRenderedInPanel:e=!1,scheduleDetailIdOverride:t,scheduleTypeOverride:d,onPanelNavigateBack:l}={})=>{const s=W(),n=z(),u=q(),a=me(),{tenantEmailDomain:c}=M(),[o,f]=I.useState(!1),D=n.state?.message==="expenseAutomation",{scheduleType:C,scheduleDetailId:x}=M(),r=t??x,k=Et(d??C,r),i=h((p=>p.scheduleDetailState.selectedJEScheduleKey));I.useEffect((()=>{i!=null&&i.length!==0||r!=="new"||s("../schedules/prepaid_expenses")}),[i,r]);const m=d??oe(C)??"prepaid_expenses",S=h((p=>te(p,m))),L=h((p=>p.entityAutoCompleteState.autoCompleteText.common)),b=h((p=>ue(p,"common"))),T=h((p=>ie(p))),y=h((p=>p.classListState.fetchState)),w=h((p=>H(p))),J=h((p=>fe(p).selectedPeriod)),N=T!=="Completed"||y!=="Completed";I.useEffect((()=>{o===!1&&N?(u(Ee(m,$,!0)),f(!0)):N===!1&&o===!1&&(u(De(m,r==="new"?void 0:r,!0)),f(!0))}),[o]),I.useEffect((()=>{if(S.markAsCompleteStatus.fetchState==="Completed")if(u(ke()),D===!0){const{month:p,year:B}=J;s(`../../month_end_close_checks/review/je_schedules/${p}-${B}`)}else s("../schedules/prepaid_expenses")}),[S.markAsCompleteStatus.fetchState]);const v=h((p=>F(p))),j=h((p=>X(p,v.companyId))),P=S.fetchState,A=S.allAccountList,G=S.allClassList,R=S.scheduleDetailsLocalData;let $;if(r!=="new"&&($=r),k!==!0||S.fetchState==="Error")return E.jsx(K,{});const Y=P==="Completed"&&o===!0,g=S.selectedJEScheduleTransaction!=null;return P==="Completed"||e===!0&&g?E.jsxs(gt,{children:[Y===!0?E.jsx(le,{analytics:O,onLoad:()=>{kt(S,m,j)}}):null,E.jsx(ft,{isRenderedInPanel:e,onPanelNavigateBack:l,location:n,vendorSearchEntityAutoCompleteView:b,vendorSearchAutoCompleteData:{autoCompleteText:L,entityAutoCompleteView:b},usedInExpenseAutomation:D,removeJeScheduleTransactionKey:(p,B)=>{u(Ce(p,B))},expenseAutomationSelectedPeriod:J,navigate:s,classList:G,accountList:A,scheduleLocalData:R[m],selectedJEScheduleKey:i,scheduleDetailId:$,selectedScheduledJournalEntries:S.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:a,tenantEmailDomain:c,scheduleTab:m,analytics:O,controllerUserDetails:j,isAccountingClassesEnabled:w,status:S.selectedJEScheduleTransaction?.status.code})]}):E.jsx(ne,{})},Et=(e,t)=>oe(e)!=null&&t!=null,Dt=e=>({transactionDate:e.date.format(ce),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),kt=(e,t,d)=>{const l=e.selectedJEScheduleTransaction?.baseTransaction,s=e.selectedJEScheduleTransaction,n=Q(d.controllers),u=ee(d.controllerUserIds);var a;l!=null&&s!=null&&O.trackScheduleDetailsLoaded({scheduleType:t,transaction:{...Dt(l)},scheduleExpenseCategoryAndClass:{expenseCategory:s.jeDebit.account?.accountName??null,expenseClass:s.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(a=s,{currentBalance:a.balanceAsOfToday??null,currentStatus:a.status.label,period:a.period??null,startMonth:a.startDate?.format(ce)??null,endMonth:a.endDate?.format(ce)??null})},vendorName:s.vendor.name??null,controllerEmails:n,controllerUserIds:u})};export{bt as J,Nt as S,Jt as a,jt as b,wt as c};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/NotFoundScreen-BDRAfL_x.js","assets/sentry-CFLt6SLf.js","assets/core-C_3BcvPm.js","assets/zeni-epic-state-BK-HD5IA.js","assets/index-DfdR1P4V.js","assets/mui-DsxbZgLG.js","assets/analytics-DP3hAmgL.js","assets/utils-D1gULS4n.js","assets/index-BhC2LNQw.css","assets/DashboardRoutes-DOtnRGit.js","assets/withTransactionSidePanel-D2Vk8NEW.js","assets/useAskAiCfoHostNavButtonProps-CnAY_u1k.js","assets/TransactionDetailScreen-B2Yk34kC.js","assets/decodeURIComponentSafe-CMkyCq70.js","assets/useInitialThreadRequest-C8Pdei5-.js","assets/routePaths-Cca1tWJp.js","assets/expenseAutomationHelper-dMv6Xo4s.js","assets/analyticsHelper-Bfs4R3aB.js","assets/CompanyPassportScreen-CMquye6T.js","assets/MobileAppDrawer-DjEeoE6u.js","assets/InboxNotificationsProvider-ICcfArFM.js","assets/useTaskManagerAccess-DJ8lZv1E.js","assets/useAiCfoDashboardSuggestedQuestionsChips-BujA6eyw.js","assets/FeaturePreviewScreen-bhcVTnED.js","assets/BillPayRoutes-gLnnTINY.js","assets/AddressScreen-SjU2U0ZR.js","assets/DomesticWireDetailScreen-ojJdskB-.js","assets/BusinessVerificationPageScreen-OrLH3WzL.js","assets/DrawerScreen-DaPp3vfO.js","assets/SetupPagesScreen-K06f0ggy.js","assets/BillPayApprovalRoutes-CRw5sS5w.js","assets/ReimbursementApprovalRuleDetailScreen-DiBNgDsy.js","assets/getLocaleForTenant-CK0bI6xd.js","assets/ReimbursementRoutes-DjQJfMVY.js","assets/ReimbursementApprovalRoutes-4Gmx-MuW.js","assets/TransactionListRoutes-eMDqkeHP.js","assets/ZeniAccountStatementScreen-B7vN9Y4_.js","assets/SettingsRoutes-C1_iqx7p.js","assets/AccountMappingScreen-amEuzz3m.js","assets/QBOConnectionScreen-0bGr42Ku.js","assets/empty-5gw21cFQ.js","assets/index-qXuXknhd.js","assets/url-D-ZtJ2kF.js","assets/index-DIN19WtR.js","assets/accountMappingHelper-Dc3TCyrX.js","assets/useEmailConnectResultRefresh-DL08zR5x.js","assets/ReportsRoutes-BtqrHuz-.js","assets/ChargeCardRoutes-VxC6xP7p.js","assets/useChargeCardPusherEvents-7mxw_gTB.js","assets/PeopleRoutes-DopLFED_.js","assets/ExpenseAutomationRoutes-D8dyN9JX.js","assets/ScheduleDetailsPrepaidExpensesScreen-DtayUdWa.js","assets/pathToGoBack-D0yBSaLk.js","assets/TreasuryRoutes-sgwJOYI2.js","assets/VendorsRoutes-CPto0F4-.js","assets/ZeniAccountRoutes-DbQRgRMK.js","assets/AddressRoutes-BvCvEc0i.js","assets/PandLWithForecastRoutes-CUZT8XbC.js","assets/CustomerOnboardingRoutes-BEKgaiHU.js","assets/TransactionDetailRoutes-DCWaZrOs.js","assets/EntityDetailRoutes-CeZQKYjJ.js","assets/InvoicingRoutes-BkdZK7i6.js","assets/NotificationRoutes-DJF3aH5n.js","assets/PerformanceRoutes-CoR3XZpX.js","assets/RewardsRoutes-Dq5pKyO9.js","assets/TaskRoutes-DJI1lloU.js","assets/TaskListScreen-BorAtbzN.js","assets/AiCfoScreen-DRk81N96.js","assets/CardsAiCfoScreen-CK5nzziY.js"])))=>i.map(i=>d[i]);
2
- import{_ as s,bn as ms,fE as _s,dY as hs,dX as Es,Al as ps,dh as gs,c8 as xs,gI as Rs,g8 as Is,de as pe,cG as Ts,gm as js,cy as As,bE as fs,br as ys,Ts as Ds,v as bs,Tv as Cs,bq as vs,Tw as Os,bK as Ps,bJ as ws,bt as Us,cu as Fs,Tx as Ls,Ty as ks,d9 as Vs,dc as Hs,db as Ss,cF as Bs,cM as Ns,pR as ge,gh as xe,gX as Ms,gj as Re,gK as Ie,gL as Te,gk as Zs}from"./zeni-epic-state-BK-HD5IA.js";import{j as e}from"./liveblocks-BHA40K9j.js";import{a as w}from"./sentry-CFLt6SLf.js";import{N as u,u as Gs,h as $s,i as zs,g as Ys,j as $,q as je,n as qs,o as t}from"./core-C_3BcvPm.js";import{N as l,E as Ws,u as Xs,z as D,M as Ks,d as Qs,T as Js,y as M,f as en,P as sn,V as nn,L as F,G as Ae,t as _,O as tn,Q as an,h as ne}from"./index-DfdR1P4V.js";import"./mui-DsxbZgLG.js";import{f as fe}from"./analyticsHelper-Bfs4R3aB.js";import{t as on}from"./getLocaleForTenant-CK0bI6xd.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},A=new a.Error().stack;A&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[A]="a40d98be-7af6-4591-80f3-c399c367ee05",a._sentryDebugIdIdentifier="sentry-dbid-a40d98be-7af6-4591-80f3-c399c367ee05")}catch{}})();const rn=l((()=>s((()=>import("./NotFoundScreen-BDRAfL_x.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),ln=({tenantEmailDomain:a})=>e.jsx(u,{to:`/${a}/reimbursements`}),un=({tenantEmailDomain:a})=>e.jsx(u,{to:`/${a}/bills`}),ye=({tenantEmailDomain:a})=>e.jsx(u,{to:`/${a}/treasury`}),De=({tenantEmailDomain:a})=>e.jsx(u,{to:`/${a}/checking`}),be=({tenantEmailDomain:a})=>e.jsx(u,{to:`/${a}/cards`}),b=({showZeniAccountRoute:a,isUserHasBillPayAccess:A,isUserHasReimbursementAccess:S,showTreasuryRoute:i,isTenantBankingOnly:k,showChargeCardRoute:O,tenantEmailDomain:v})=>{if(k===!0){if(a)return e.jsx(De,{tenantEmailDomain:v});if(i)return e.jsx(ye,{tenantEmailDomain:v});if(O)return e.jsx(be,{tenantEmailDomain:v})}return a?e.jsx(De,{tenantEmailDomain:v}):i?e.jsx(ye,{tenantEmailDomain:v}):O?e.jsx(be,{tenantEmailDomain:v}):A?e.jsx(un,{tenantEmailDomain:v}):S?e.jsx(ln,{tenantEmailDomain:v}):e.jsx(rn,{})},dn={dashboard:()=>s((()=>import("./DashboardRoutes-DOtnRGit.js")),__vite__mapDeps([9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,0,17,18,19,20,21,22,23,8])),bills:()=>s((()=>import("./BillPayRoutes-gLnnTINY.js")),__vite__mapDeps([24,1,2,3,4,5,6,7,25,0,26,11,14,27,15,19,20,21,28,23,29,17,30,31,32,8])),reimbursement:()=>s((()=>import("./ReimbursementRoutes-DjQJfMVY.js")),__vite__mapDeps([33,1,2,3,4,5,6,7,0,29,27,15,19,20,21,17,23,11,14,28,34,31,32,8])),transactions:()=>s((()=>import("./TransactionListRoutes-eMDqkeHP.js")),__vite__mapDeps([35,1,2,3,4,5,6,7,10,11,12,13,14,15,16,36,8])),settings:()=>s((()=>import("./SettingsRoutes-C1_iqx7p.js")),__vite__mapDeps([37,1,2,3,4,5,6,7,21,38,19,20,39,40,41,42,43,13,44,25,0,17,27,15,18,45,30,31,34,8])),reports:()=>s((()=>import("./ReportsRoutes-BtqrHuz-.js")),__vite__mapDeps([46,1,2,3,4,5,6,7,0,23,14,15,19,20,21,8])),chargeCards:()=>s((()=>import("./ChargeCardRoutes-VxC6xP7p.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,11,19,20,21,29,27,15,0,17,14,48,25,8])),people:()=>s((()=>import("./PeopleRoutes-DopLFED_.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,0,11,19,20,21,8])),expenseAutomation:()=>s((()=>import("./ExpenseAutomationRoutes-D8dyN9JX.js")),__vite__mapDeps([50,1,2,3,0,4,5,6,7,11,12,13,14,15,16,51,52,10,44,28,8])),treasury:()=>s((()=>import("./TreasuryRoutes-sgwJOYI2.js")),__vite__mapDeps([53,1,2,3,4,5,6,7,0,29,27,15,19,20,21,17,11,14,23,8])),vendors:()=>s((()=>import("./VendorsRoutes-CPto0F4-.js")),__vite__mapDeps([54,1,2,3,4,5,6,7,25,0,23,51,52,15,11,19,20,21,28,44,8])),zeniAccounts:()=>s((()=>import("./ZeniAccountRoutes-DbQRgRMK.js")),__vite__mapDeps([55,1,2,3,4,5,6,7,0,29,27,15,19,20,21,17,23,26,25,11,36,8]))},cn=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],te=a=>{"requestIdleCallback"in window?requestIdleCallback(a):setTimeout(a,100)},mn=l((()=>s((()=>import("./ReportsRoutes-BtqrHuz-.js")),__vite__mapDeps([46,1,2,3,4,5,6,7,0,23,14,15,19,20,21,8])))),_n=l((()=>s((()=>import("./AddressRoutes-BvCvEc0i.js")),__vite__mapDeps([56,1,2,3,25,4,5,6,7,0,8])))),hn=l((()=>s((()=>import("./PeopleRoutes-DopLFED_.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,0,11,19,20,21,8])))),En=l((()=>s((()=>import("./PandLWithForecastRoutes-CUZT8XbC.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,0,23,11,14,15,19,20,21,8])))),pn=l((()=>s((()=>import("./CustomerOnboardingRoutes-BEKgaiHU.js")),__vite__mapDeps([58,1,2,3,25,4,5,6,7,0,39,40,41,42,43,13,45,48,8])))),gn=l((()=>s((()=>import("./VendorsRoutes-CPto0F4-.js")),__vite__mapDeps([54,1,2,3,4,5,6,7,25,0,23,51,52,15,11,19,20,21,28,44,8])))),xn=l((()=>s((()=>import("./TransactionDetailRoutes-DCWaZrOs.js")),__vite__mapDeps([59,1,2,3,0,4,5,6,7,12,11,13,14,15,16,8])))),Ce=l((()=>s((()=>import("./EntityDetailRoutes-CeZQKYjJ.js")),__vite__mapDeps([60,1,2,3,4,5,6,7,13,10,11,12,14,15,16,8])))),Rn=l((()=>s((()=>import("./DashboardRoutes-DOtnRGit.js")),__vite__mapDeps([9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,0,17,18,19,20,21,22,23,8])))),ve=l((()=>s((()=>import("./BillPayRoutes-gLnnTINY.js")),__vite__mapDeps([24,1,2,3,4,5,6,7,25,0,26,11,14,27,15,19,20,21,28,23,29,17,30,31,32,8])))),In=l((()=>s((()=>import("./SettingsRoutes-C1_iqx7p.js")),__vite__mapDeps([37,1,2,3,4,5,6,7,21,38,19,20,39,40,41,42,43,13,44,25,0,17,27,15,18,45,30,31,34,8])))),Tn=l((()=>s((()=>import("./InvoicingRoutes-BkdZK7i6.js")),__vite__mapDeps([61,1,2,3,4,5,6,7,25,0,19,20,21,39,40,41,42,43,13,8])))),Oe=l((()=>s((()=>import("./ReimbursementRoutes-DjQJfMVY.js")),__vite__mapDeps([33,1,2,3,4,5,6,7,0,29,27,15,19,20,21,17,23,11,14,28,34,31,32,8])))),jn=l((()=>s((()=>import("./ZeniAccountRoutes-DbQRgRMK.js")),__vite__mapDeps([55,1,2,3,4,5,6,7,0,29,27,15,19,20,21,17,23,26,25,11,36,8])))),An=l((()=>s((()=>import("./TreasuryRoutes-sgwJOYI2.js")),__vite__mapDeps([53,1,2,3,4,5,6,7,0,29,27,15,19,20,21,17,11,14,23,8])))),fn=l((()=>s((()=>import("./TransactionListRoutes-eMDqkeHP.js")),__vite__mapDeps([35,1,2,3,4,5,6,7,10,11,12,13,14,15,16,36,8])))),yn=l((()=>s((()=>import("./ChargeCardRoutes-VxC6xP7p.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,11,19,20,21,29,27,15,0,17,14,48,25,8])))),Dn=l((()=>s((()=>import("./NotificationRoutes-DJF3aH5n.js")),__vite__mapDeps([62,1,2,3,0,4,5,6,7,11,21,8])))),bn=l((()=>s((()=>import("./PerformanceRoutes-CoR3XZpX.js")),__vite__mapDeps([63,1,2,3,0,4,5,6,7,11,19,20,21,8])))),Cn=l((()=>s((()=>import("./ExpenseAutomationRoutes-D8dyN9JX.js")),__vite__mapDeps([50,1,2,3,0,4,5,6,7,11,12,13,14,15,16,51,52,10,44,28,8])))),vn=l((()=>s((()=>import("./RewardsRoutes-Dq5pKyO9.js")),__vite__mapDeps([64,1,2,3,4,5,6,7,0,8])))),On=l((()=>s((()=>import("./TaskRoutes-DJI1lloU.js")),__vite__mapDeps([65,1,2,3,0,4,5,6,7,14,19,20,21,66,11,8])))),Pn=l((()=>s((()=>import("./AiCfoScreen-DRk81N96.js")),__vite__mapDeps([67,1,2,3,4,5,6,7,22,52,15,8])))),Pe=l((()=>s((()=>import("./CardsAiCfoScreen-CK5nzziY.js")),__vite__mapDeps([68,1,2,3,4,5,6,7,8])))),C=l((()=>s((()=>import("./NotFoundScreen-BDRAfL_x.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),wn=l((()=>s((()=>import("./TaskListScreen-BorAtbzN.js").then((a=>a.f))),__vite__mapDeps([66,1,2,3,4,5,6,7,11,19,20,21,8])))),Un=({isDashboardAccess:a,showZeniAccountRoute:A,isUserHasBillPayAccess:S,isUserHasReimbursementAccess:i,showTreasuryRoute:k,isTenantBankingOnly:O,isTenantCardsOnly:v,showChargeCardRoute:V})=>{if(O===!0){if(A)return e.jsx(u,{to:"checking"});if(k)return e.jsx(u,{to:"treasury"});if(V)return e.jsx(u,{to:"cards"})}return v===!0&&V?e.jsx(u,{to:"cards"}):a?e.jsx(u,{to:"dashboard"}):A?e.jsx(u,{to:"checking"}):k?e.jsx(u,{to:"treasury"}):V?e.jsx(u,{to:"cards"}):S?e.jsx(u,{to:"bills"}):i?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},we=({tenantEmailDomain:a})=>e.jsx(u,{to:`/${a}/dashboard`}),Mn=Object.freeze(Object.defineProperty({__proto__:null,default:function({setTenantEmailDomain:a}){const A=Gs(),S=$s(),{tenantEmailDomain:i}=zs(),k=Ws().mode,{setLoading:O,clearAllLoading:v,clearLoading:V}=Xs(),f=D.getSignedInUserTenant(i)?.tenantId,T=D.getSignedInUser(),X=ms(T),z=Ys(),[L,Ue]=w.useState(!1),r=$((o=>_s(o))),{useFeatureGate:B}=Ks(),Z=Qs(),ae=Js(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:ke}=B(M.isChargeCardFeatureEnabled),{isFeatureEnabled:oe}=B(M.isDebitCardFeatureEnabled),j=$((o=>o.tenantState.fetchState)),p=$((o=>o.tenantState.activeTenantFetchState.fetchState)),h=p==="Completed"||j==="Completed"?hs(oe,r):void 0,K=p==="Completed"||j==="Completed"?Es(r):void 0,re=p==="Completed"||j==="Completed"?ps(r)&&!gs(r):void 0,Ve=en(r,ke,oe),{isCardsHidden:He}=sn(r?.tenantId),Se=!Ve||!!He,{isFeatureEnabled:Be}=B(M.isSettingsFeatureEnabled),{isFeatureEnabled:Q}=B(M.isAiCfoFileUploadEnabled),{isFeatureEnabled:Ne}=B(M.isInvoicingFeatureEnabled??"is_invoicing_feature_enabled"),Me=Ne||an==="DEV",Ze=r?.userRole!=null&&xs(r.userRole),Y=$((o=>Rs(o)));if(i!=null){const o=D.getSignedInUserTenant(i);T!=null&&o!=null&&fe(T,r,k)}const G={tenantId:f,userId:T?.userId,sessionId:T?.zeniSessionId},ie=Is(),E=nn(),Ge=r.company==null||E?.loggedInUserRoleMap!=null&&pe(E.loggedInUserRole),$e=Ts(E?.loggedInUserRoleMap),J=je("/:tenantEmailDomain/onboarding/*")!==null,ee=je("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),ze=$((o=>G.tenantId!=null?js(o,G.tenantId):void 0));w.useEffect((()=>{O(F.TENANT_FETCHING),a(i)}),[i]),w.useEffect((()=>{if(ee!=null&&f!=null){const o=ee.params.selectedPeriod;if(o!=null){const y=o.split("-");if(y.length===2){const d=As(Number(y[0])),n=Number(y[1]),c=fs(`01-${d<10?`0${d}`:d}-${n}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),N=ys();c.isAfter(N,"month")===!1?A(Ds(f,{month:d,year:n})):S(`/${i}/month_end_close_checks/review`)}}}}),[ee,f]),w.useEffect((()=>{L||(Ue(!0),O(F.TENANT_FETCHING))}),[L,G,ie,T,A,D]),w.useLayoutEffect((()=>{!bs(ie,G)&&D.isSignedIn()&&(O(F.TENANT_FETCHING),(function(o,y,d,n){if(xe(y?.userId,y?.zeniSessionId,o.tenantId),d(Ms(!0)),d(Re(o.tenantId)),o.tenantId!=null&&_.clearTenant(o.tenantId),o.tenantId!=null){const c=D.getSignedInUserTenantWithId(o.tenantId);n&&Ae.updateAppLocaleID(on(n)),c?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(c?.tenantEmailDomain)}o.userId!=null?ne.identify(o.userId,{tenant_id:o.tenantId}):ne.resetUserIdentity()})(G,T,A,ze))}),[f]),w.useEffect((()=>{D.isSignedIn()&&(O(F.TENANT_FETCHING),(function(o,y,d,n,c,N,H){if(d==null&&n==null)return void console.warn("There is no current tenant selected!!");const q=n!=null&&c?.zeniSessionId!=null,us=d==null||d.tenantId!==n,ds=d!=null&&d.excludedResources==null,cs=d!=null&&d.externalConnections==null;if(q&&us){H(Re(n));const W=D.getSignedInUserTenantWithId(n);W?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(W?.tenantEmailDomain),xe(c?.userId,c?.zeniSessionId,n),_.shouldFetchExcludedResources(n)&&(_.markExcludedResourcesFetchStarted(n),H(Ie(c.userId,n))),_.shouldFetchConnections(n)&&(_.markConnectionsFetchStarted(n),H(Te(c.userId,n)))}else q&&ds&&_.shouldFetchExcludedResources(n)&&(_.markExcludedResourcesFetchStarted(n),H(Ie(c.userId,n))),q&&cs&&_.shouldFetchConnections(n)&&(_.markConnectionsFetchStarted(n),H(Te(c.userId,n)));if(q){ne.identify(c.userId,{tenant_id:n});const W=n==null||n!=null&&(y==="Completed"||y==="Error");o==="Completed"||y!=="Not-Started"&&y!=="Error"||n==null||!_.shouldFetchActiveTenant(n)||(_.markActiveTenantFetchStarted(n),N(F.TENANT_FETCHING),H(Zs(c.userId,n,c.zeniSessionId))),W&&(o==="Not-Started"||o==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),H(ge(c.userId,c.zeniSessionId)))}})(j,p,r,f,T,O,A))}),[f,p]),w.useEffect((()=>{D.isSignedIn()&&j==="Completed"&&Y.tenantsBaseInOrder.length>0&&(V(F.TENANT_FETCHING),D.saveSignedInUserTenants(Cs(Y.tenantsBaseInOrder)),T!=null&&fe(T,r,k,void 0,Y.tenantsBaseInOrder))}),[Y,j,r,T]),w.useEffect((()=>{p==="In-Progress"&&O(F.TENANT_FETCHING),p!=="Completed"&&p!=="Error"||(p==="Completed"&&f!=null?(v(),_.markActiveTenantFetchCompleted(f)):p==="Error"&&f!=null&&(_.markActiveTenantFetchFailed(f),V(F.TENANT_FETCHING),V(F.TENANT_SWITCHING))),j!=="Completed"&&j!=="Error"||(j==="Completed"?_.markAllTenantsFetchCompleted():j==="Error"&&_.markAllTenantsFetchFailed())}),[p,j,f,L]);const le=w.useRef(!1);w.useEffect((()=>{!le.current&&p==="Completed"&&L&&(le.current=!0,(function(o=cn,y=3e3){setTimeout((()=>{const d=n=>{if(n>=o.length)return;const c=o[n],N=dn[c];N!=null?N().then((()=>te((()=>d(n+1))))).catch((()=>te((()=>d(n+1))))):d(n+1)};te((()=>d(0)))}),y)})())}),[p,L]);const P=r?.userRole!=null&&vs(r?.userRole),{isFeatureEnabled:Ye}=B(M.isReferralFeatureEnabled),qe=r?.userRole!=null&&r.userRole.includes("charge_card_user"),We=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),U=r?.userRole!=null&&pe(r.userRole),ue=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!P,de=!Se&&!P,Xe=Os(E?.loggedInUserRoleMap),Ke=r.externalConnections?.accounting[0]?.isValid,Qe=r.externalConnections?.fetchState==="Completed",se=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!P,me=ce&&Ps(E?.loggedInUserRoleMap),_e=Fe&&!P,Je=Le&&!P,es=ue&&ws(E?.loggedInUserRoleMap),ss=de&&Us(E?.loggedInUserRoleMap),ns=_e&&Fs(E?.loggedInUserRoleMap),ts=Ls(E?.loggedInUserRoleMap),as=ks(E?.loggedInUserRoleMap),os=Vs(E?.loggedInUserRoleMap),rs=Hs(E?.loggedInUserRoleMap),is=Ss(E?.loggedInUserRoleMap),g=Bs(E?.loggedInUserRoleMap),x=Ns(E?.loggedInUserRoleMap),he=ue&&g,Ee=ce&&x,R=_e&&os,I=Je&&rs,m=de&&is,ls=r.excludedResources?.resources?.find((o=>o.resource==="/invites"))!=null||$e===!0||Xe===!0||ts===!0||as===!0;return D.isSignedIn()?f==null?j==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}):(T!=null&&j!=="In-Progress"&&A(ge(T.userId,T.zeniSessionId)),null):p!=="In-Progress"&&p!=="Not-Started"||j==="Completed"?(se===!0||X&&!J)&&Qe&&Ke!==!0&&h===!1&&K===!1&&re===!1?(a(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!L||re!==!0||se!==!0||J||X?!L||se!==!1||J||X?L&&r?.userRole&&h!=null&&K!=null&&i!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(qs,{children:e.jsxs(t,{element:e.jsx(tn,{}),children:[e.jsx(t,{path:"/",element:e.jsx(Un,{isDashboardAccess:U,showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:I,isTenantBankingOnly:h,isTenantCardsOnly:K,showChargeCardRoute:m})}),e.jsx(t,{path:"dashboard/*",element:U?e.jsx(Rn,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"reports/*",element:U?e.jsx(mn,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"people/*",element:ls||U?e.jsx(hn,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"forecast/*",element:U?e.jsx(En,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"onboarding/*",element:e.jsx(pn,{})}),e.jsx(t,{path:"transaction/*",element:U&&P===!1||qe||We?e.jsx(xn,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"transactions/*",element:U&&P===!1?e.jsx(fn,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"customer/*",element:U&&P===!1?e.jsx(Ce,{entityType:"customer"}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,isTenantBankingOnly:h,showTreasuryRoute:I,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"vendor/*",element:U&&P===!1?e.jsx(Ce,{entityType:"vendor"}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"tasks",element:e.jsx(wn,{})}),e.jsx(t,{path:"tasks/*",element:e.jsx(On,{})}),e.jsx(t,{path:"address/*",element:es||me||ns||ss?e.jsx(_n,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"checking/*",element:R?e.jsx(jn,{}):e.jsx(C,{})}),e.jsx(t,{path:"treasury/*",element:I?e.jsx(An,{}):e.jsx(C,{})}),e.jsx(t,{path:"performance",element:ae===!0?e.jsx(bn,{}):e.jsx(we,{tenantEmailDomain:i})}),e.jsx(t,{path:"month_end_close_checks/review/*",element:ae===!0&&P===!1?e.jsx(Cn,{}):e.jsx(we,{tenantEmailDomain:i})}),e.jsx(t,{path:"notifications/*",element:e.jsx(Dn,{})}),e.jsx(t,{path:"vendors/*",element:Ge?e.jsx(gn,{}):e.jsx(C,{})}),e.jsx(t,{path:"bill/*",element:he?e.jsx(ve,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"bills/*",element:he?e.jsx(ve,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"reimbursement/*",element:Ee?e.jsx(Oe,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"reimbursements/*",element:Ee?e.jsx(Oe,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:g,isUserHasReimbursementAccess:x,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(t,{path:"settings/*",element:Be?e.jsx(In,{hasAdminLevelAccess:me}):e.jsx(C,{})}),e.jsx(t,{path:"invoicing/*",element:Me&&Ze?e.jsx(Tn,{}):e.jsx(C,{})}),e.jsx(t,{path:"cards/ask",element:m&&Z?e.jsx(Pe,{isFileUploadEnabled:Q}):e.jsx(C,{})}),e.jsx(t,{path:"cards/ask/:session_id",element:m&&Z?e.jsx(Pe,{isFileUploadEnabled:Q}):e.jsx(C,{})}),e.jsx(t,{path:"cards/*",element:m?e.jsx(yn,{}):e.jsx(C,{})}),e.jsx(t,{path:"rewards/*",element:Ye?e.jsx(vn,{}):e.jsx(C,{})}),e.jsx(t,{path:"/ai-cfo",element:Z?e.jsx(u,{to:"explore"}):e.jsx(C,{})}),e.jsx(t,{path:"/ai-cfo/",element:Z?e.jsx(u,{to:"explore"}):e.jsx(C,{})}),e.jsx(t,{path:"/ai-cfo/:session_id",element:Z?e.jsx(Pn,{isFileUploadEnabled:Q}):e.jsx(C,{})}),e.jsx(t,{path:"*",element:e.jsx(C,{})})]})}):null:(a(void 0),e.jsx(u,{to:`/${i}/onboarding`,replace:!0})):(a(void 0),e.jsx(u,{to:`/${i}/onboarding/thankyou`,replace:!0})):null:(console.warn("User logged out!!"),a(void 0),e.jsx(u,{to:"/signin/auth",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}))}},Symbol.toStringTag,{value:"Module"}));export{b as F,Mn as S};
@@ -1 +0,0 @@
1
- import{j as f}from"./liveblocks-BHA40K9j.js";import{a as u,R as x,q as A}from"./sentry-CFLt6SLf.js";import{u as D,h as z,j as l,g as j,N as M,l as O}from"./core-C_3BcvPm.js";import{u as P,z as s,E as B,h as w,G as F,R as _,S as N,U as $,W as R,X as V,Y as v}from"./index-DfdR1P4V.js";import{fE as W,Tb as q,Tv as J,gh as X,gj as Y,TA as G,gT as H,di as K,TB as y,TC as Q,TD as Z,b$ as b}from"./zeni-epic-state-BK-HD5IA.js";import"./mui-DsxbZgLG.js";import{u as ee}from"./useDeviceId-CZr7CPDW.js";import{f as te}from"./analyticsHelper-Bfs4R3aB.js";import{t as ne}from"./getLocaleForTenant-CK0bI6xd.js";import"./recharts-CmYjG1zt.js";import"./analytics-DP3hAmgL.js";import"./plaid-ewZxuvzf.js";import"./dnd-BXrho-40.js";import"./stripe-cKAAJElX.js";import"./lottie-DHD1nzoa.js";import"./lexical-DY18TAnZ.js";import"./pdf-BmQFuRIG.js";import"./utils-D1gULS4n.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="13bf0b74-b76d-454a-85f4-78b658f7ee11",t._sentryDebugIdIdentifier="sentry-dbid-13bf0b74-b76d-454a-85f4-78b658f7ee11")}catch{}})();const ie=O((function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:c}}),(function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{A({message:`OAuth error from provider ${a} with error ${n}`,level:"error",tags:{authProvider:a,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,a)=>{const c=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(Z({authCode:n,oauthProvider:a,appType:"web",redirectUri:b(c),sourceUri:b(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:a}=i;a!=null&&(s.saveMagicLinkEmail(n),t(Q(n,a)))},clearSignInError:()=>{t(y())}}}))(V),ae=x.memo(ie);function ve({setTenantEmailDomain:t}){const i=D(),d=z(),{clearAllLoading:g}=P(),n=s.getSignedInUser();u.useLayoutEffect((()=>{g()}),[g]);const a=ee(),c=l((e=>e.tenantState.magicLinkCodeVerifier)),{sendEmailMagicLinkFetchState:h,accountLocked:T,accountUnlockTime:E}=l((e=>e.tenantState)),p=l((e=>e.tenantState.fetchState)),L=l((e=>e.tenantState.activeTenantFetchState.fetchState)),S=l((e=>e.tenantState.signInState)),o=l((e=>e.tenantState.loggedInUser)),r=l((e=>W(e))),I=l((e=>q(e))),m=j(),k=B().mode,C=m.state?.magicLinkExpired,U=m.state?.magicLinkAlreadyUsed;if(u.useEffect((()=>{h.fetchState==="Completed"&&c!=null&&(w.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(c))}),[h.fetchState,c]),u.useEffect((()=>{t(void 0)}),[]),u.useEffect((()=>{S!=="In-Progress"||p!=="Completed"&&L!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(J(I.tenantsInOrder),o.zeniSessionId),X(o.userId,o.zeniSessionId,r.tenantId),i(Y(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(G("Completed")),F.updateAppLocaleID(ne(r)),te(o,r,k,void 0,I.tenantsInOrder),H().then((()=>{const e=R();e!=null&&_(e)})),setTimeout((()=>{w.trackLogin(N.Event.loginSuccess,o.authProvider??"google",K(r.productSettings))}),2e3))}),[S,p,L,o,r,I,k,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return f.jsx(M,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!C,magicLinkAlreadyUsed:!!U,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),T===!0&&E!=null?f.jsx($,{onClose:()=>i(y()),unlockDate:E}):null]})}export{ve as default};
@@ -1,9 +0,0 @@
1
- import{j as s}from"./liveblocks-BHA40K9j.js";import{a as i}from"./sentry-CFLt6SLf.js";import{u as c,g as d,N as u}from"./core-C_3BcvPm.js";import{z as n,h as a,S as m,a7 as p}from"./index-DfdR1P4V.js";import{gW as g,TR as y}from"./zeni-epic-state-BK-HD5IA.js";import{n as h}from"./mui-DsxbZgLG.js";import"./recharts-CmYjG1zt.js";import"./analytics-DP3hAmgL.js";import"./plaid-ewZxuvzf.js";import"./dnd-BXrho-40.js";import"./stripe-cKAAJElX.js";import"./lottie-DHD1nzoa.js";import"./lexical-DY18TAnZ.js";import"./pdf-BmQFuRIG.js";import"./utils-D1gULS4n.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]="e89f5933-c86b-466d-955e-70751133152e",e._sentryDebugIdIdentifier="sentry-dbid-e89f5933-c86b-466d-955e-70751133152e")}catch{}})();function N(){const e=c(),t=d(),r=i.useRef(!1),f=n.isSignedIn(),o=t.state?.message==="logout"||f;return i.useEffect((()=>{if(o&&!r.current){r.current=!0;try{e(g()),y(),a.trackLogout(m.Event.logoutSuccess),a.resetUserIdentity(),n.clearAll()}catch(l){console.error("Error during sign out:",l)}finally{window.location.replace("/signin/auth")}}}),[o,e]),o?s.jsx(b,{children:s.jsx(p,{fetchState:"In-Progress"})}):s.jsx(u,{to:"../",replace:!0})}const b=h.div`
2
- display: flex;
3
- height: 100vh;
4
- width: 100%;
5
- flex: 1 1 auto;
6
- flex-direction: column;
7
- align-items: center;
8
- background-color: ${e=>e.theme.colors.grey4};
9
- `;export{N as default};
@@ -1,9 +0,0 @@
1
- import{j as C}from"./liveblocks-BHA40K9j.js";import{a as f}from"./sentry-CFLt6SLf.js";import{h as pa,u as Ta,g as fa,k as ga,j as F,i as _a,l as ma}from"./core-C_3BcvPm.js";import{aK as ba,aL as Da,z as x,M as Sa,y as G,as as ha,a8 as Ea,h as ya,S as Aa,e4 as Ca,p as R,a4 as Ga}from"./index-DfdR1P4V.js";import{fE as Ia,a1e as X,Qm as B,a1f as Y,a1a as Ba,PK as Z,a1g as Ka,PS as V,Ps as va,P4 as La,Qn as W,a1h as q,gg as wa,Qd as Ra,Qi as Ua,Q5 as Pa,Q3 as H,Qj as Fa,Q0 as ja,a1i as xa,a1j as $a,a1k as Na,a1l as Oa,a1m as I,dw as Qa,dv as za,a1n as Ma,Pp as Za}from"./zeni-epic-state-BK-HD5IA.js";import{n as Va}from"./mui-DsxbZgLG.js";import{u as Wa}from"./useAskAiCfoHostNavButtonProps-CnAY_u1k.js";import{M as qa}from"./MobileAppDrawer-DjEeoE6u.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="33c731ab-2d68-4e8d-a340-008f71db2628",e._sentryDebugIdIdentifier="sentry-dbid-33c731ab-2d68-4e8d-a340-008f71db2628")}catch{}})();const c={TASK_CREATED:"task-created",TASK_UPDATED:"task-updated",TASK_SNOOZE_RESURFACED:"task-snooze-resurfaced",TASKS_BULK_UPDATED:"tasks-bulk-updated",TASKS_BULK_DELETED:"tasks-bulk-deleted"},Ha=(e,a)=>e==null||e===""?[]:a.map((n=>`private-encrypted-${e}.${n}`)),Ja=(e,a)=>e==null||e===""?[]:a.map((n=>`private-encrypted-${e}.${n}`)),U=e=>Array.isArray(e)&&e.every((a=>typeof a=="string")),Xa=e=>{if(e==null||typeof e!="object")return null;const a=e,n=typeof a.task_id=="string"?a.task_id:typeof a.id=="string"?a.id:null;if(n==null||typeof a.tenant_id!="string"||typeof a.event_type!="string")return null;const o={task_id:n,tenant_id:a.tenant_id,event_type:a.event_type};return typeof a.is_private=="boolean"&&(o.is_private=a.is_private),U(a.assignees)&&(o.assignees=a.assignees),U(a.direct_assignees)&&(o.direct_assignees=a.direct_assignees),typeof a.created_by=="string"&&(o.created_by=a.created_by),U(a.task_group_ids)&&(o.task_group_ids=a.task_group_ids),typeof a.name=="string"&&(o.name=a.name),typeof a.parent_task_id=="string"&&(o.parent_task_id=a.parent_task_id),o},Ya=e=>{if(e==null||typeof e!="object")return null;const a=e;return U(a.task_ids)?{task_ids:a.task_ids}:null},pe=e=>{if(e==null||typeof e!="object")return null;const a=e;return typeof a.task_id!="string"?null:{task_id:a.task_id}},ae=e=>{const{events:a,onEvent:n,onSubscribed:o}=e,i=ba(),g=f.useRef(n),l=f.useRef(o),_=f.useRef(0);f.useEffect((()=>{g.current=n}),[n]),f.useEffect((()=>{l.current=o}),[o]);const t=f.useMemo((()=>[...a].sort().join("|")),[a]);f.useEffect((()=>{if(i==null||a.length===0)return;const s=[],p=new Set,S=()=>{if(l.current==null)return;const m=Date.now();m-_.current<5e3||(_.current=m,l.current())};return a.forEach((m=>{const[b,D]=Da(m);if(D==="")return;const E=i.channel(b),y=T=>{g.current(D,T)};let k;if(E?.subscribed===!0){if(k=E,k.bind(D,y),!p.has(b)){p.add(b),S();const T=()=>{S()};k.bind("pusher:subscription_succeeded",T),s.push((()=>{k.unbind("pusher:subscription_succeeded",T)}))}s.push((()=>{E.unbind(D,y)}))}else{if(k=E??i.subscribe(b),k.bind(D,y),!p.has(b)){p.add(b);const T=()=>{S()};k.bind("pusher:subscription_succeeded",T),s.push((()=>{k.unbind("pusher:subscription_succeeded",T)}))}s.push((()=>{k.unbind(D,y)}))}})),()=>{s.forEach((m=>m()))}}),[i,t])},ee=Va.div`
2
- display: flex;
3
- min-height: 100%;
4
- width: 100%;
5
- flex: 1 1 auto;
6
- flex-direction: column;
7
- align-items: center;
8
- background-color: ${e=>e.theme.colors.grey4};
9
- `,te=ma((function(e,a){const n=X(e,a.isTaskTemplatesEnabled),{taskGroupId:o}=a,i=o!=null&&o!==""?{...n,taskGroupsWithTasksList:n.taskGroupsWithTasksList.map((t=>({...t,tasks:t.tasks.filter((s=>s.taskGroupIds.includes(o)))}))).filter((t=>t.tasks.length>0))}:n,g=Ba(e),l=x.isZeniUser(),_=e.taskDetailState?.subTaskCreateStatus?.fetchState;return{taskListView:i,tagListView:g,localData:i.localData,isTaskTemplatesEnabled:a.isTaskTemplatesEnabled,isZeniUser:l,subTaskCreateStatus:_}}),(function(e,a){const{navigate:n,currentTenant:o,location:i,isTaskTemplatesEnabled:g}=a,{tenantEmailDomain:l}=o,{groupByKey:_}=a.uiState;return{onTaskManagementRowClick:t=>{const s=J(l,t),p=R(i.state?.pathnameStackToGoBack,i.pathname);n(s,{state:{pathnameStackToGoBack:p}})},onReloadTasks:()=>{e(B(!0,g))},onTabChange:t=>{e(Oa(t))},onParentTaskClick:t=>{const s=J(l,t);window.open(s,"_blank","noopener")},bulkUpdateTasks:(t,s)=>{e(H(t,null,s))},onNewTaskClick:()=>{if(a.localData.defaultTaskGroupId!=null){const t=j(l,a.localData.defaultTaskGroupId),s=R(i.state?.pathnameStackToGoBack,i.pathname);n(t,{state:{pathnameStackToGoBack:s,message:"comingFromTaskListPage"}})}},onColumnSortConfigChanged:(t,s)=>{e(q({uiState:{sortKey:t,sortOrder:s}}))},onFiltersChange:t=>{e(Na({filters:t}))},onSearchTextChanged:t=>{e($a({searchText:t}))},onReloadCards:()=>{e(B(!0,g))},onBackClick:()=>{if(i.state?.message==="triggerBackClick"){const t=Ga(i.state?.pathnameStackToGoBack),s=t.poppedPathname??"../";n(s,{state:{pathnameStackToGoBack:t.newStack}})}else n("../")},updateLocalData:t=>{e(xa({localData:t}))},resetLocalData:()=>{e(Y({taskGroupById:a.taskGroupState.taskGroupById}))},handleCreateGroup:t=>{e(ja(a.localData.newTaskGroupName,t))},assignGroupToTasks:t=>{e(H(a.localData.selectedTaskIds,t,Fa(a.uiState.groupByKey,t)))},onDeleteTaskGroup:t=>{e(Pa(t))},onAddNewTaskToTaskGroup:t=>{if(a.localData.defaultTaskGroupId!=null){const s=ne(_,t);e(Z({taskDetailLocalData:s}));const p=j(l,a.uiState.groupByKey==="groupName"?t:a.localData.defaultTaskGroupId),S=R(i.state?.pathnameStackToGoBack,i.pathname);n(p,{state:{pathnameStackToGoBack:S,message:"comingFromTaskListPage"}})}},onDragNDrop:(t,s)=>{e(Ua(a.localData.selectedTaskIds.length>0?a.localData.selectedTaskIds:[t],s))},onTaskGroupRename:(t,s)=>{e(Ra(t,s))},onTimeSpentUpdate:(t,s)=>{e(W({task:t,updates:s}))},onShowToast:t=>{e(wa(t))},onGroupByFilterChange:t=>{e(q({uiState:{groupByKey:t}}))},updateTask:(t,s)=>{e(W({task:t,updates:s}))},onCreateTagClick:(t,s)=>{e(La(t,s))},onSubtaskCreation:(t,s)=>{e(va({...s,parentTaskId:t}))},handleGroupTemplateClick:t=>{e(V(t,[]))},handleGroupTemplateTaskClick:(t,s)=>{e(V(t,[s]))},handleNewTaskInitialization:t=>{if(e(Z({taskDetailLocalData:{...Ka,name:t}})),a.localData.defaultTaskGroupId!=null){const s=j(l,a.localData.defaultTaskGroupId),p=R(i.state?.pathnameStackToGoBack,i.pathname);n(s,{state:{pathnameStackToGoBack:p,message:"comingFromTaskListPage"}})}},onTaskGroupNameClick:t=>{n(`/${l}/tasks/group/${t}`)},onQuickResponsesClick:()=>{n(`/${l}/tasks/quick-responses`)}}}))(Ca);function se(){const e=pa(),a=Ta(),n=fa(),o=x.getSignedInUser(),i=x.isZeniUser(),g=ga(),l=F((u=>Ia(u))),{taskGroupId:_}=_a(),{useFeatureGate:t}=Sa(),{isFeatureEnabled:s}=t(G.isTaskTemplatesEnabled),{isFeatureEnabled:p}=t(G.isTaskCannedResponsesEnabled),{isFeatureEnabled:S}=t(G.isTaskCategorizationEnabled),{isFeatureEnabled:m}=t(G.isTaskBulkResolutionEnabled),{isFeatureEnabled:b}=t(G.isTaskGroupAssigneesEnabled),{isFeatureEnabled:D}=t(G.isTaskRecurringParentEnabled),[E,y]=f.useState(!1),k=F((u=>X(u,s))),T=F((u=>u.taskGroupState)),K=k.fetchState,{isAiCfoAccessEnabled:aa,onAskAiCfoClick:ea}=Wa({mobileExploreReferrer:"Task Checklist"});ha({isDataReady:K==="Completed"}),f.useEffect((()=>{a(B(!1,s))}),[l?.tenantId,a,s]);const ta=f.useMemo((()=>{const u=[c.TASK_CREATED,c.TASK_UPDATED,c.TASKS_BULK_UPDATED,c.TASKS_BULK_DELETED],A=[c.TASK_CREATED,c.TASK_UPDATED,c.TASK_SNOOZE_RESURFACED,c.TASKS_BULK_UPDATED];return[...Ha(l?.companyId,u),...Ja(o?.userId,A)]}),[l?.companyId,o?.userId]);if(ae({events:ta,onEvent:(u,A)=>{switch(u){case c.TASK_CREATED:case c.TASK_UPDATED:{const r=Xa(A);if(r!=null){const w=g.getState(),$=r.task_id,h=$!=null?w.taskState.taskByID?.[$]:void 0,P=h!=null;if(!i)if(r.is_private===!0){if(!P)return}else{const v=o?.userId,L=new Set([...r.assignees??[],...r.direct_assignees??[]]);if(r.created_by!=null&&r.created_by!==""&&L.add(r.created_by),!(v!=null&&L.has(v))&&!P)return}if(u===c.TASK_UPDATED&&P&&h!=null&&Array.isArray(r.task_group_ids)){const v=new Set(Object.values(w.taskGroupState.taskGroupById??{}).filter((d=>d!=null&&!d.isDeleted)).map((d=>d.id))),L=(h.taskGroupIds??[]).filter((d=>v.has(d))),N=(r.task_group_ids??[]).filter((d=>v.has(d))),sa=L.length===N.length&&L.every((d=>N.includes(d))),O=h.taskGroupIds??[],Q=r.task_group_ids??[],na=O.length!==Q.length||!O.every((d=>Q.includes(d))),oa=(d,da)=>{const z=d??[],M=da??[];if(z.length!==M.length)return!1;const ca=new Set(M);return z.every((ka=>ca.has(ka)))},ra=r.name==null||r.name===h.name,ia=r.is_private==null||r.is_private===h.isPrivate,la=r.assignees==null||oa(r.assignees,h.assignees),ua=r.direct_assignees==null;if(sa&&na&&ra&&ia&&la&&ua)return}}return void a(B(!0,s))}case c.TASKS_BULK_DELETED:{const r=Ya(A);return r==null?void 0:void r.task_ids.forEach((w=>a(Za(w))))}case c.TASKS_BULK_UPDATED:case c.TASK_SNOOZE_RESURFACED:return void a(B(!0,s))}},onSubscribed:()=>{a(B(!0,s))}}),f.useEffect((()=>{K==="Completed"&&a(Y({taskGroupById:T.taskGroupById}))}),[K,T.taskGroupById]),o==null)throw Error("Can't access task list page without signing in...");return C.jsxs(C.Fragment,{children:[K==="Completed"?C.jsx(Ea,{analytics:ya,onLoad:u=>(A=>A.trackPageLoaded(Aa.Event.taskListPage))(u)}):null,C.jsxs(ee,{children:[C.jsx(qa,{isAppContentDrawerOpen:E,handleDrawerToggle:u=>{y(u)}}),C.jsx(te,{location:n,navigate:e,currentTenant:l,taskGroupId:_,taskGroupState:T,localData:k.localData,uiState:k.uiState,isTaskTemplatesEnabled:s,taskListFetchState:K,isTaskCategorizationEnabled:S,isTaskCannedResponsesEnabled:p,isTaskBulkResolutionEnabled:m,isTaskGroupAssigneesEnabled:b,isTaskRecurringParentEnabled:D,isAiCfoAccessEnabled:aa,onAskAiCfoClick:ea})]})]})}const J=(e,a)=>`/${e}/tasks/${encodeURIComponent(a)}`,j=(e,a)=>`/${e}/tasks/new/${a}`,ne=(e,a)=>{if(e==="assignee"){const n=a.split(",");return{...I.taskDetailLocalData,assignee:n}}if(e==="priority"){const n=Qa(a);return{...I.taskDetailLocalData,priority:n}}if(e==="status"){const n=za(a);return{...I.taskDetailLocalData,status:n}}if(e==="tag"){const n=a.split(",");return{...I.taskDetailLocalData,tagIds:n}}if(e==="dueDate"){const n=Ma(a);return{...I.taskDetailLocalData,dueDate:n}}return{...I.taskDetailLocalData}},Te=Object.freeze(Object.defineProperty({__proto__:null,default:se},Symbol.toStringTag,{value:"Module"}));export{c as T,Ja as a,Ha as b,Ya as c,Xa as d,se as e,Te as f,pe as t,ae as u};
@@ -1,9 +0,0 @@
1
- import{j as i}from"./liveblocks-BHA40K9j.js";import ue from"./NotFoundScreen-BDRAfL_x.js";import{a as k}from"./sentry-CFLt6SLf.js";import{h as H,u as ee,j as E,g as de,i as ke,N as pe,l as me,n as Se,o as b}from"./core-C_3BcvPm.js";import{Ph as ae,Pk as fe,Pe as Te,Z6 as ge,fE as te,a1a as se,PG as g,Py as T,Pb as he,Qa as be,Q3 as Ee,a1b as ne,gg as oe,a1c as M,P7 as Ie,P4 as De,ul as Ce,u9 as Ge,my as Pe,Pw as ye,a1d as _e,Qn as Re,Ps as Ue,PR as we,PO as xe,Pn as Be,PL as ve,PK as Ae}from"./zeni-epic-state-BK-HD5IA.js";import{z as y,e2 as je,r as Le,M as Fe,y as G,a4 as re,p as P,a8 as Ke,h as q,S as $e,e3 as Ne,Y as Q,ae as Oe}from"./index-DfdR1P4V.js";import{n as ze}from"./mui-DsxbZgLG.js";import{u as Ve}from"./useInitialThreadRequest-C8Pdei5-.js";import{M as Ze}from"./MobileAppDrawer-DjEeoE6u.js";import{b as Me,a as qe,u as Qe,T as f,t as Ye,c as Y,d as J,e as Je}from"./TaskListScreen-BorAtbzN.js";import"./recharts-CmYjG1zt.js";import"./analytics-DP3hAmgL.js";import"./plaid-ewZxuvzf.js";import"./dnd-BXrho-40.js";import"./stripe-cKAAJElX.js";import"./lottie-DHD1nzoa.js";import"./lexical-DY18TAnZ.js";import"./pdf-BmQFuRIG.js";import"./utils-D1gULS4n.js";import"./InboxNotificationsProvider-ICcfArFM.js";import"./useTaskManagerAccess-DJ8lZv1E.js";import"./useAskAiCfoHostNavButtonProps-CnAY_u1k.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="344cedee-3a2b-4f37-b7d3-28a1db034388",e._sentryDebugIdIdentifier="sentry-dbid-344cedee-3a2b-4f37-b7d3-28a1db034388")}catch{}})();function We(){const e=H(),a=ee(),n=y.getSignedInUser(),{cannedResponses:c,fetchState:s,saveFetchState:u}=E((o=>o.cannedResponsesState)),d=k.useCallback((()=>{a(ae())}),[a]),m=k.useCallback(((o,I,D)=>{a(fe({name:o,content:I,cannedResponseId:D}))}),[a]),t=k.useCallback((o=>{a(Te({cannedResponseId:o}))}),[a]);if(n==null)throw Error("Can't access quick responses page without signing in...");return i.jsx(je,{cannedResponses:c,isLoading:s==="In-Progress"||s==="Not-Started",isSaving:u==="In-Progress",onBackClick:()=>e(-1),onDelete:t,onFetch:d,onSave:m})}const F=e=>e?.taskState?.taskByID,j=(e,a)=>{const n=F(e);if(a!=null&&n!=null)return n[a]?.parentTaskId??void 0},Xe=ge([j,(e,a)=>{const n=j(e,a),c=F(e);if(n!=null&&c!=null)return c[n]?.name},(e,a)=>{const n=j(e,a),c=F(e);return n!=null&&c!=null&&c[n]!=null}],((e,a,n)=>{if(e!=null&&n===!0)return{id:e,name:a??""}}));let W,X=[];const He=me((function(e,a){const{location:n,taskGroupId:c}=a,s=ne(e,a.taskId),u=te(e),d=Xe(e,a.taskId),m=s.taskGroupId??c,t=m!=null?M(e.taskGroupState,m):void 0,o=y.getSignedInUser(),I=u.tenantId,D={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:I??""},w=se(e),{tenantEmailDomain:x}=u,_=s.recurringSourceTaskId,B=_!=null?`${Q.appUrl}/${x}/tasks/${encodeURIComponent(_)}`:void 0;var h;return{taskDetailSelectorView:s,authParams:D,isZeniUser:y.isZeniUser(),userGroupList:((h=e.userGroupsState.userGroupByUserGroupId)!==W&&(W=h,X=Object.values(h)),X),isNewClicked:n.state?.message==="comingFromTaskListPage",filesEndPoint:Oe.fileMicroServiceBaseUrl,companyName:a.currentTenant.companyName,companyId:a.currentTenant.companyId,currentUrl:`${Q.appUrl}${a.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:B,tagListView:w,taskGroupName:m!=null&&t!=null&&t.isDefault===!1?t.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map((S=>M(e.taskGroupState,S))).filter((S=>S!=null&&!S.isDeleted)).map((S=>({id:S.id,name:S.name,isDefault:S.isDefault}))),subtasks:s.subtasks,parentTaskRef:d,subTaskCreateStatus:e.taskDetailState?.subTaskCreateStatus?.fetchState}}),(function(e,a){const{taskId:n,navigate:c,currentTenant:s,location:u,taskGroupId:d}=a,{tenantEmailDomain:m}=s;return{onSaveChangesToLocalStore:t=>{e(Ae({taskDetailLocalData:t,taskId:n}))},onSaveDetailClick:t=>{e(ve(n,t??d))},onArchiveTaskClick:()=>{a.taskId!=null&&e(Be(a.taskId))},onSnoozeTask:(t,o)=>{e(xe(t,o))},onUnsnoozeTask:t=>{e(we(t))},onCreateSubtask:(t,o)=>{e(Ue({...o,parentTaskId:t}))},onSubtaskUpdate:(t,o)=>{e(Re({task:t,updates:o}))},onShowToast:t=>{e(oe(t))},onSubtaskRowClick:t=>{c(`/${m}/tasks/${t}`,{state:{pathnameStackToGoBack:P(u.state?.pathnameStackToGoBack,u.pathname)}})},onParentBreadcrumbClick:t=>{c(`/${m}/tasks/${t}`,{state:{pathnameStackToGoBack:P(u.state?.pathnameStackToGoBack,u.pathname)}})},onDismissClick:()=>{if(u.state?.message==="triggerBackClick"){const t=re(u.state?.pathnameStackToGoBack),o=t.poppedPathname??"../../dashboard";c(o,{state:{pathnameStackToGoBack:t.newStack}})}else{const t=U(m),o=P(u.state?.pathnameStackToGoBack,u.pathname);c(t,{state:{pathnameStackToGoBack:o}})}e(_e({taskId:n}))},onDeleteTaskClick:()=>{e(ye(n))},updateFilesEntity:t=>{e(Pe({files:t}))},onDeleteFile:t=>{e(Ge(t))},onEditFileName:(t,o)=>{e(Ce(t,o.split(".")[0]))},onReloadTaskDetailPage:()=>{e(g(!1,n))},onCreateTagClick:t=>{e(De(t,n))},onDeleteTagClick:t=>{e(Ie(t,n))},onFetchCannedResponses:()=>{e(ae())},onManageTemplatesClick:()=>{c(`/${s.tenantEmailDomain}/tasks/quick-responses`)}}}))(Ne);function L(){const e=H(),a=ee(),n=de(),c=Le(),{taskId:s,taskGroupId:u}=ke(),d=E((r=>te(r))),m=Ve(d?.companyId),{useFeatureGate:t}=Fe(),{isFeatureEnabled:o}=t(G.isTaskSnoozeEnabled),{isFeatureEnabled:I}=t(G.isTaskVisibilityEnabled),{isFeatureEnabled:D}=t(G.isTaskCannedResponsesEnabled),{isFeatureEnabled:w}=t(G.isTaskRecurringParentEnabled),{isFeatureEnabled:x}=t(G.isTaskGroupAssigneesEnabled),[_,B]=k.useState(!1),[h,S]=k.useState(!1),[K,ie]=k.useState(!1),[$,v]=k.useState(!1),C=k.useRef(!1),R=E((r=>r.taskListState.updateTasksFetchState.fetchState)),N=E((r=>se(r))),O=E((r=>r.taskGroupViewState.fetchState));k.useEffect((()=>{a(g(!1,s)),s!=null&&a(T(s))}),[a,s]);const z=y.getSignedInUser()?.userId,ce=k.useMemo((()=>{const r=[f.TASK_CREATED,f.TASK_UPDATED,f.TASKS_BULK_UPDATED,f.TASKS_BULK_DELETED],l=[...r,f.TASK_SNOOZE_RESURFACED];return[...Me(d?.companyId,r),...qe(z,l)]}),[d?.companyId,z]);Qe({events:ce,onSubscribed:()=>{s!=null&&(a(g(!0,s)),a(T(s)))},onEvent:(r,l)=>{if(s!=null)switch(r){case f.TASK_CREATED:{J(l)?.parent_task_id===s&&(a(g(!0,s)),a(T(s)));break}case f.TASK_UPDATED:{const p=J(l);if(p==null)break;p.task_id===s?(a(g(!0,s)),a(T(s))):p.parent_task_id===s&&a(T(s));break}case f.TASKS_BULK_UPDATED:{const p=Y(l);if(p==null)break;p.task_ids.includes(s)&&a(g(!0,s)),a(T(s));break}case f.TASKS_BULK_DELETED:{const p=Y(l);if(p==null)break;if(p.task_ids.includes(s)){a(oe({messageSection:"delete_task",messageText:"success",type:"success"})),d?.tenantEmailDomain!=null&&e(U(d.tenantEmailDomain));break}a(T(s));break}case f.TASK_SNOOZE_RESURFACED:{Ye(l)?.task_id===s&&a(g(!0,s));break}}}}),k.useEffect((()=>{h||N.fetchState==="Completed"||(S(!0),a(he()))}),[h,a,N.fetchState]),k.useEffect((()=>{K||O==="Completed"||(ie(!0),a(be()))}),[K,a,O]);const le=k.useCallback((()=>{s!=null&&(C.current=!1,a(Ee([s],null,{isArchived:!1})),v(!0))}),[a,s]);k.useEffect((()=>{if($)if(R!=="In-Progress"){if(C.current){if(R==="Error")return v(!1),void(C.current=!1);if(R==="Completed"){v(!1),C.current=!1;const{tenantEmailDomain:r}=d;if(n.state?.message==="triggerBackClick"){const l=re(n.state?.pathnameStackToGoBack);e(l.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:l.newStack}})}else{const l=U(r);e(l,{state:{pathnameStackToGoBack:P(n.state?.pathnameStackToGoBack,n.pathname)}})}}}}else C.current=!0}),[$,R,d,n,e]);const V=E((r=>ne(r,s))),A=V.fetchState,Z=y.getSignedInUser();if(Z==null)throw Error("Can't access task detail page without signing in...");if(A==="Error"&&V.error?.code===400){const{tenantEmailDomain:r}=d,l=U(r),p=P(n.state?.pathnameStackToGoBack,n.pathname);return i.jsx(pe,{to:l,state:{pathnameStackToGoBack:p}})}return i.jsxs(i.Fragment,{children:[A==="Completed"?i.jsx(Ke,{analytics:q,onLoad:r=>(l=>l.trackPageLoaded($e.Event.taskDetailPage))(r)}):null,i.jsxs(ea,{children:[i.jsx(Ze,{isAppContentDrawerOpen:_,handleDrawerToggle:r=>{B(r)}}),i.jsx(He,{analytics:q,currentTenant:d,handleZeniLogoClick:()=>{c.toggle()},initialOpenThreadRequest:m,location:n,loggedInUser:Z,navigate:e,taskGroupId:u,taskId:s,taskDetailFetchState:A,onUnarchiveTaskClick:le,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:I,isTaskCannedResponsesEnabled:D,isTaskRecurringParentEnabled:w,isTaskGroupAssigneesEnabled:x})]})]})}const ea=ze.div`
2
- display: flex;
3
- min-height: 100%;
4
- width: 100%;
5
- flex: 1 1 auto;
6
- flex-direction: column;
7
- align-items: center;
8
- background-color: ${e=>e.theme.colors.grey4};
9
- `,U=e=>`/${e}/tasks`;function Da(){return i.jsxs(Se,{children:[i.jsx(b,{path:"/new",element:i.jsx(L,{})}),i.jsx(b,{path:"/new/:taskGroupId",element:i.jsx(L,{})}),i.jsx(b,{path:"/group/:taskGroupId",element:i.jsx(Je,{})}),i.jsx(b,{path:"/quick-responses",element:i.jsx(We,{})}),i.jsx(b,{path:"/:taskId",element:i.jsx(L,{})}),i.jsx(b,{path:"*",element:i.jsx(ue,{})})]})}export{Da as default};
@@ -1 +0,0 @@
1
- import{j as t}from"./liveblocks-BHA40K9j.js";import i from"./NotFoundScreen-BDRAfL_x.js";import{T as r}from"./TransactionDetailScreen-B2Yk34kC.js";import"./sentry-CFLt6SLf.js";import{n as d,o}from"./core-C_3BcvPm.js";import"./zeni-epic-state-BK-HD5IA.js";import"./recharts-CmYjG1zt.js";import"./index-DfdR1P4V.js";import"./mui-DsxbZgLG.js";import"./analytics-DP3hAmgL.js";import"./plaid-ewZxuvzf.js";import"./dnd-BXrho-40.js";import"./stripe-cKAAJElX.js";import"./lottie-DHD1nzoa.js";import"./lexical-DY18TAnZ.js";import"./pdf-BmQFuRIG.js";import"./utils-D1gULS4n.js";import"./useAskAiCfoHostNavButtonProps-CnAY_u1k.js";import"./decodeURIComponentSafe-CMkyCq70.js";import"./useInitialThreadRequest-C8Pdei5-.js";import"./routePaths-Cca1tWJp.js";import"./expenseAutomationHelper-dMv6Xo4s.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="07c2895c-270d-414b-a4ec-49ceb0cdd05a",e._sentryDebugIdIdentifier="sentry-dbid-07c2895c-270d-414b-a4ec-49ceb0cdd05a")}catch{}})();function z(){return t.jsxs(d,{children:[t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId",element:t.jsx(r,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/page-not-found",element:t.jsx(i,{})}),t.jsx(o,{path:"/:transactionTypeEncoded/:transactionId/vendor/create",element:t.jsx(r,{})}),t.jsx(o,{path:"/*",element:t.jsx(r,{})})]})}export{z as default};
@@ -1,5 +0,0 @@
1
- import{j as C}from"./liveblocks-BHA40K9j.js";import{a as i}from"./sentry-CFLt6SLf.js";import{u as W,k as sn,j as g,s as ge,g as De,h as Ce,i as Ae,N as cn,l as rn}from"./core-C_3BcvPm.js";import{pu as Ie,fE as ee,gU as ln,TX as dn,oA as un,oa as mn,CZ as se,bn as pn,de as Re,bq as _e,sg as Q,V1 as Y,W9 as we,Wa as le,Vr as Pe,m9 as Fe,Wb as Ue,Vw as de,Vx as ue,m_ as xe,Rt as me,W5 as G,m3 as Ve,m1 as Le,md as fn,ph as hn,Wc as Sn,Wd as yn,CQ as J,m8 as Oe,QO as Be,cm as Tn,dk as bn,We as gn,W4 as In,Wf as vn,Wg as En,Wh as kn,Wi as Dn,CM as Cn,Wj as An,Wk as Rn,Wl as _n,Wm as wn,Wn as Pn,mc as Fn,Wo as Un,Wp as xn,W6 as Vn,Wq as Ln,Wr as On,Ws as Bn,QI as Nn,Qy as Wn,QX as zn,me as Mn,Ru as ve,pm as jn}from"./zeni-epic-state-BK-HD5IA.js";import{M as X,y as A,h as $,b2 as Gn,z as Ne,E as $n,a1 as qn,b3 as Hn,ab as Qn,a4 as ce,V as Yn,b4 as Xn,p as ie,as as Zn,b5 as Jn,b6 as Kn,b7 as et,ae as nt,av as oe}from"./index-DfdR1P4V.js";import{n as tt,S as at,D as ot}from"./mui-DsxbZgLG.js";import{u as st}from"./useAskAiCfoHostNavButtonProps-CnAY_u1k.js";import{d as We}from"./decodeURIComponentSafe-CMkyCq70.js";import{u as ct}from"./useInitialThreadRequest-C8Pdei5-.js";import{h as ze,c as Me,g as it,e as rt}from"./routePaths-Cca1tWJp.js";import{u as lt}from"./expenseAutomationHelper-dMv6Xo4s.js";import{v as dt}from"./utils-D1gULS4n.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new n.Error().stack;e&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[e]="73ca429b-4495-49c6-8542-261366ce7c6c",n._sentryDebugIdIdentifier="sentry-dbid-73ca429b-4495-49c6-8542-261366ce7c6c")}catch{}})();function ut(n=!0){const e=W(),o=sn(),{useFeatureGate:t}=X(),{isFeatureEnabled:a}=t(A.isCreateTransferEntryFromExpenseEnabled);i.useEffect((()=>{if(!n||a!==!0)return;const s=c=>{const u=o.getState().createTransferEntryState.transferAccountsByType[c].fetchState;return u!=="In-Progress"&&u!=="Completed"};s("transferEntryEligible")&&e(Ie({kind:"transferEntryEligible"})),s("creditCardOnlyEligible")&&e(Ie({kind:"creditCardOnlyEligible"}))}),[n,a,e,o])}function mt(n,e){const o=(function(){const u=W(),[h,y]=i.useState(!1),[f,d]=i.useState(null),[r,S]=i.useState(null),{useDynamicConfig:I}=X(),{configValue:D,isDynamicConfigLoading:T}=I("transaction_categorization_config"),b=!T&&D?.capitalization_enabled===!0,v=g((l=>ee(l))),R=v.companyId,q=g((l=>ln(l.companyState,v.companyId)?.company.companyLocaleInfo?.currencySymbol??"$")),{capitalizableAccounts:U,capitalizableAccountOverrides:_,dismissedAccounts:w}=g((l=>{const E=l.tenantState.currentTenantId,k=E!=null?l.tenantState.tenantsById[E]:void 0;return{capitalizableAccounts:k?.capitalizableAccounts??null,capitalizableAccountOverrides:k?.capitalizableAccountOverrides??null,dismissedAccounts:k?.capitalizationOnboardingDismissedAccounts??null}}),ge),x=i.useRef(U);x.current=U;const P=i.useRef(_);P.current=_;const V=i.useRef(w);V.current=w;const L=g((l=>dn(l.accountState)),ge),H=i.useMemo((()=>{const l={};for(const E of L)E.accountId!=null&&E.accountName!=null&&(l[E.accountId]=E.accountName);return l}),[L]),z=r!=null?H[r]??null:null,O=i.useCallback((l=>{if(!b)return;const E=x.current;if(E==null)return;const k=E.accounts??[],j=new Set(l),Z=P.current??{},ne=V.current;for(const B of k)if(j.has(B.accountId)&&Z[B.accountId]==null&&ne?.[B.accountId]==null)return d(B.classificationType),S(B.accountId),void y(!0)}),[b]),M=i.useCallback(((l,E)=>{u(un(R,l,E,!0)),y(!1),d(null),S(null)}),[u,R]),p=i.useCallback((()=>{r!=null&&(u(mn(R,r)),y(!1),d(null),S(null))}),[u,R,r]);return{showPopup:h&&b,popupType:f,popupAccountId:r,popupAccountName:z,currencySymbol:q,checkAndShowPopup:O,handleSubmit:M,handleDismiss:p}})(),t=i.useRef(void 0),a=i.useRef([]),s=i.useRef(o.checkAndShowPopup);s.current=o.checkAndShowPopup;const c=i.useRef(e);return c.current=e,i.useEffect((()=>{n==="In-Progress"&&(a.current=c.current()),n==="Completed"&&t.current==="In-Progress"&&a.current.length>0&&(s.current(a.current),a.current=[]),t.current=n}),[n]),o}const N=new Map,Ee=(n,e,o)=>`${n}|${e??""}|${o}`,K=(n,e)=>{const[o,t]=n.shownRecommendations;return{recommendationFor:n.dimension,recommendation:o?.name??"",recommendationSource:o?.engine??null,recommendationConfidencePercentage:o?.confidencePercentage??null,alternativeRecommendation:t?.name??null,alternativeRecommendationSource:t?.engine??null,alternativeRecommendationConfidencePercentage:t?.confidencePercentage??null,selectedValue:n.selected.name,numberOfRecommendations:n.shownRecommendations.length,transactionId:e,lineId:n.lineId??null}},re=(n,e,o)=>({transactionId:e,lineId:n.lineId,dimension:n.dimension,outcome:n.outcome,selected:{name:n.selected.name,id:n.selected.id},matchedSource:n.matchedSource,matchedRank:n.matchedRank,topPickSource:n.topPickSource,shownRecommendations:n.shownRecommendations.map((t=>({source:t.source,rank:t.rank,value:{name:t.name,id:t.id},confidence:t.confidencePercentage!=null?t.confidencePercentage/100:void 0}))),...o}),je=(n,e,o)=>{$.trackRecommendationFeedbackRetracted(K(e,o)),n(se(re(e,o,{outcome:"retracted"})))},Vt=(n,e)=>{const o=new Set(e.map(String));N.forEach(((t,a)=>{o.has(t.transactionId)&&(N.delete(a),je(n,t.feedback,t.transactionId))}))},Lt=n=>{const e=new Set(n.map(String));N.forEach(((o,t)=>{e.has(o.transactionId)&&N.delete(t)}))};function pt(n){const e=W(),[o,t]=i.useState(null),{isEnabled:a,fallbackTransactionId:s}=n,c=i.useCallback((f=>f.transactionId??s??""),[s]),u=i.useCallback((f=>{if(!a)return;const d=c(f);if(d==="")return;if(f.outcome!=="accepted")return void t(f);((S,I,D,T)=>{const b=Ee(I,D,T),v=N.get(b);return v!=null&&(N.delete(b),je(S,v.feedback,v.transactionId),!0)})(e,d,f.lineId,f.dimension)||(((S,I)=>{$.trackRecommendationAccepted(K(S,I))})(f,d),e(se(re(f,d,{}))))}),[a,c,e]),h=i.useCallback((f=>{if(o==null)return;const d=c(o);((r,S,I)=>{$.trackRecommendationFeedbackSubmitted({...K(r,S),feedbackReason:I})})(o,d,f),e(se(re(o,d,{reasonText:f,skipped:!1}))),((r,S)=>{N.set(Ee(S,r.lineId,r.dimension),{feedback:r,transactionId:S})})(o,d),t(null)}),[o,c,e]),y=i.useCallback((()=>{var f,d;o!=null&&(f=o,d=c(o),$.trackRecommendationFeedbackSkipped(K(f,d)),t(null))}),[o,c]);return{onRecommendationSelection:u,popup:o!=null?C.jsx(Gn,{feedback:o,onSubmit:h,onSkip:y}):null}}const pe=()=>{const n=Ne.getSignedInUser(),{useFeatureGate:e}=X(),{isFeatureEnabled:o}=e(A.isChainOfThoughtEnabled);return i.useMemo((()=>pn(n)&&o),[n,o])};function Ge(n){if(n!=null){if("customer"in n&&n.customer!=null){const{customer:e}=n;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in n&&n.vendor!=null){const{vendor:e}=n;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function Ot(n,e){const o=W(),{useFeatureGate:t}=X(),a=g((p=>ee(p))),s=a.userRole.includes("charge_card_user")||a.userRole.includes("charge_card_admin"),c=a.userRole!=null&&Re(a.userRole),u=a.userRole!=null&&_e(a.userRole),{isFeatureEnabled:h}=t(A.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:y}=t(A.isExpenseAutomationEnabled),f=pe(),d=i.useMemo((()=>({id:n,type:Q(e)})),[n,e]),r=g((p=>Y(p,d))),S=r?.transactionDetailUpdateStatus?.fetchState,I=r?.transactionDetailLocalData?.lineItemById,D=g((p=>{const l=Y(p,d)?.transactionDetailLocalData.vendorUpdates?.id;return l==null?"Not-Started":p.transactionVendorViewState.editVendorStateById[l]?.saveStatus.fetchState??"Not-Started"})),T=i.useMemo((()=>r?.fetchState==="Completed"?Ge(r?.transaction):void 0),[r?.fetchState,r?.transaction]),b=g((p=>{if(T!=null)return we(p.customerIncomeState,p.vendorExpenseState,p.trendState,T,"month")})),v=g((p=>le(p))),R=g((p=>{if(T!=null)return Pe(p.trendWithTransactionsState,T,"TransactionDetail")})),q=a.company?.companyInfo.firstMonthOfFY??1,U=g((p=>Fe(p.accountState,p.accountListState,"accountList"))),[_,w]=i.useState(!1),[x,P]=i.useState(!1),[V,L]=i.useState(!1);i.useEffect((()=>{w(!1),P(!1),L(!1)}),[n,e]);const H=i.useCallback((()=>{w(!1),P(!1)}),[]),[z,O]=i.useState(!1),M=R?.selectedPeriod?.timePeriod;return i.useEffect((()=>{V||r==null||r.transaction==null||(o(Ue({id:r.transaction.id,type:r.transaction.type})),L(!0)),T!=null&&(!s||c&&u===!1)&&(_?x||b==null||(P(!0),o(me(T,"TransactionDetail",{timeframe:"month",timePeriod:M??b}))):(o(de()),o(ue()),w(!0),o(xe(T))))}),[o,V,r?.fetchState,r?.transaction,T,s,c,u,_,x,b,M]),i.useEffect((()=>{v.newVendorState?.vendorDetailLocalData?.vendorName!=null?O(!0):O(!1)}),[v.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect((()=>()=>{o(G("common"))}),[o]),{currentTenant:a,loggedInUserHasCardUserOrAdminRole:s,isUserHasDashboardAccess:c,isUserHasInvestorOrBankerAccess:u,isVendorBulkUpdateOnTransactionEnabled:h,isExpenseAutomationEnabled:y,isChainOfThoughtEnabled:f,selectedTransaction:d,transactionDetail:r,rawDetailSaveStatus:S,rawDetailLineItemById:I,vendorSaveStatus:D,tranEntity:T,defaultTrendTransactionTimePeriod:b,vendorViewDetails:v,uiState:R,firstMonthOfFY:q,uncategorizedAccounts:U,resetTrendIsFetchedStates:H,isCreateVendorDrawerOpen:z,setIsCreateVendorDrawerOpen:O}}const ft={overlayWidth:new Qn(100,100,58)},ht=({isOpen:n,onSaveVendor:e,onSaveSuccess:o,onCancel:t,vendorViewDetails:a})=>{const s=$n(),c=qn(),u=W(),h=g((d=>le(d))),y=()=>{t()},f={vendorDetailView:a??h,onSaveSuccess:()=>{u(Le()),u(fn("Not-Started")),o()},onSaveVendor:e,onCancelClick:y,saveVendorDetailLocalData:d=>{u(Ve({vendorId:void 0,localData:d}))}};return C.jsx(ot,{anchor:"right",open:n,PaperProps:{style:{width:ft.overlayWidth.valuePercentage(c),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:s.colors.black,opacity:.4,cursor:"pointer"}}},onClose:y,children:C.jsx(St,{onClick:d=>d.stopPropagation(),children:C.jsx(Hn,{...f})})})},St=tt(at)`
2
- display: flex;
3
- min-height: 100%;
4
- flex-direction: column;
5
- `;function yt(n,e){n(hn({transactionId:e.transactionId,creditAccountIntegrationId:e.creditAccountIntegrationId,debitAccountIntegrationId:e.debitAccountIntegrationId,memo:e.memo,transactionType:Q(e.transactionType),sourceTransactionType:Q(e.sourceTransactionType)}))}function Tt({currentTransactionId:n,enabled:e=!0,buildPath:o,beforeNavigate:t,navigate:a,navigateState:s}){const c=g((h=>h.createTransferEntryState.lastTransferEntryReplacement)),u=i.useRef(null);i.useEffect((()=>{if(!e||c==null||n==null||u.current===c)return;const{previousTransactionId:h,newTransactionId:y}=c;n.id===h.id&&n.type===h.type&&(u.current=c,t?.(),a(o(y),{replace:!0,state:s}))}),[e,c,n,o,t,a,s])}const bt=({closeDrawerHandler:n,overrideTransactionId:e,overrideTransactionType:o})=>{const t=De(),a=Ce(),s=W(),c=pe(),{transactionTypeEncoded:u,transactionId:h}=Ae(),y=e??h,f=o??We(u??"");let d;ze(y,f)&&(d={id:y,type:Q(f)});const r=d!=null?g((I=>Y(I,d))):void 0,S=()=>{const I=ce(t.state?.pathnameStackToGoBack),D=I.poppedPathname??((T=2)=>{let b="../";for(let v=0;v<T;v++)b=`${b}../`;return b})(1);a(D,{state:{pathnameStackToGoBack:I.newStack}})};return{transactionId:d,onSaveVendor:()=>{s(Oe(d,void 0))},onSaveSuccess:()=>{if(r!=null&&r?.transaction&&r?.transactionDetailLocalData.vendorUpdates?.qboId!=null&&r?.transactionDetailLocalData.vendorUpdates?.id!=null){const I=r?.transactionDetailLocalData.vendorUpdates,D={id:r?.transactionDetailLocalData.vendorUpdates?.qboId,zeniId:r?.transactionDetailLocalData.vendorUpdates?.id,type:"vendor",name:I?.name,qboId:r?.transactionDetailLocalData.vendorUpdates?.qboId??""},T={transactionId:{id:r?.transaction?.id,type:r?.transaction?.type},transaction:r?.transaction,lineIds:r?.transaction?.lines?.map((b=>b.id))??[]};s(J({entity:D,amount:r?.transaction?.amount.amount,transactionDetails:T,flowType:"detail",isFetchCOT:c}))}S()},onCancel:()=>{d!=null&&s(Sn({transactionId:d})),s(Le()),s(yn()),n(!0),S()}}},gt=rn((function(n,e){const o=Y(n,e.selectedTransaction);let t;o==null&&console.warn("Check if the you've selected the transaction before getting the details");const a=Ne.getSignedInUser(),s=n.tenantState.currentTenantId,c={userId:a?.userId??"",sessionId:a?.zeniSessionId??"",tenantId:s??""};o!=null&&o.fetchState==="Completed"&&o.transaction!=null&&e.entity!=null&&(t=gn(n,e.entity,"TransactionDetail"));const u=n.entityAutoCompleteState.autoCompleteText.common,h=In(n,"common"),y=ee(n);return{transactionDetail:o,transactionAttachmentEndpointToDownload:`${oe}/transaction_attachment`,transactionAttachmentsEndpointToFetch:y.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${oe}/transaction_attachments_accounting_provider`:`${oe}/transaction_attachments`,attachmentUploadEndpoint:`${nt.accountMicroServiceBaseUrl}`,isCOTEnabled:e.isCOTEnabled,authParams:c,trendReport:t,analytics:$,uncategorizedAccounts:e.uncategorizedAccounts,autoCompleteData:{autoCompleteText:u,entityAutoCompleteView:h},isVendorBulkUpdateOnTransactionEnabled:e.isVendorBulkUpdateOnTransactionEnabled,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,enableBackClickOnSave:e.location.state?.message?.startsWith("comingFromScheduleDetails"),isTransactionSplitEditMode:o?.transactionDetailLocalData?.editMode??!1}}),(function(n,e){const{isCOTEnabled:o}=e;return{onBackClick:()=>{if(n(G("common")),e.onBackClick!=null)return void e.onBackClick();const t=ce(e.location.state?.pathnameStackToGoBack),a=t.poppedPathname??$e(2);e.navigate(a,{state:{pathnameStackToGoBack:t.newStack,message:"comingFromTransactionDetail"}})},discardTransactionDetailLocalData:(t,a)=>{e.transaction!=null&&n(jn({transactionId:{id:e.transaction.id,type:e.transaction.type},vendorId:t,customerId:a}))},onTransactionClick:t=>{e.resetTrendIsFetchedStates(),n(de()),n(ue());const a=ie(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(Me(t,e.tenantEmailDomain),{state:{pathnameStackToGoBack:a}})},onTrendSelectedPeriodChange:t=>{if(t==null)e.defaultTrendTransactionTimePeriod!=null&&n(ve(e.entity,"TransactionDetail",{timeframe:"month",timePeriod:e.defaultTrendTransactionTimePeriod}));else{const a=t.currentTimePeriod==null?t.addTimePeriod:{startDate:t.addTimePeriod.startDate,endDate:t.currentTimePeriod.endDate};n(me(e.entity,"TransactionDetail",{timeframe:t.timeframe,timePeriod:t.addTimePeriod})),n(ve(e.entity,"TransactionDetail",{timeframe:t.timeframe,timePeriod:a}))}},onSaveUpdates:(t,a,s,c)=>{n(c===!0&&s!=null?Oe(t,s,!0,e.isExpenseAutomationEnabled):Mn({transactionId:t,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,cotTransactionTracking:a})),n(G("common"))},onUploadAttachmentAttachment:t=>{n(zn(t))},onDeleteAttachment:t=>{e.transaction!=null&&n(Wn(t,{id:e.transaction.id,type:e.transaction.type}))},onSaveTransactionDetailLocalData:(t,a)=>{n(Nn({transactionId:t,transactionLocalData:a}))},onUpdateAllChecked:(t,a,s,c)=>{e.transaction!=null&&n(Bn(e.selectedTransaction,e.transaction,t,a,s,c))},onResetLineItemsCategoryClassInLocalData:(t,a,s,c,u,h)=>{n(On(t,a,s,c,u,h))},onChangeCategoryClassWhenUpdateAllIsChecked:(t,a)=>{e.transaction!=null&&n(Ln({id:e.transaction.id,type:e.transaction.type},e.transaction,t,a))},onSaveSuccess:()=>{const t=ce(e.location.state?.pathnameStackToGoBack);if(t.poppedPathname!=null){const a=dt(t.poppedPathname,"/").split("/"),s=a[a.length-1];if(["uncategorized-income","uncategorized-expense","missing-receipts"].includes(s)&&e.navigate(t.poppedPathname,{state:{pathnameStackToGoBack:t.newStack}}),e.location.state?.message==="comingFromScheduleDetails"){const c=`${it(e.tenantEmailDomain)}`;e.navigate(c)}else if(e.location.state?.message==="comingFromScheduleDetailsFixedAssets"){const c=`${rt(e.tenantEmailDomain)}`;e.navigate(c)}}},onPageRefresh:()=>{n(Be(e.selectedTransaction,!0))},autoCompleteActions:{onAutoCompleteInputChange:(t,a)=>{t.trim().length>=2?n(Vn({searchString:t,entityType:a,searchOrigin:"common"})):t.trim().length===0&&n(G("common"))},onCancelAutoComplete:()=>{n(G("common"))}},onFetchRecommendationsForEntity:(t,a,s,c)=>{n(J({entity:t,amount:a,transactionDetails:s,flowType:"detail",isBulkFetch:c,isFetchCOT:o}))},clearRecommendationForLineId:t=>{const{transactionId:a,transaction:s,lineId:c}=t;n(xn(a,s,c))},resetUpdateErrorState:()=>{const t={id:e.selectedTransaction.id,type:e.selectedTransaction.type};n(Un(t))},onSaveVendorInLocalData:(t,a,s,c,u)=>{if(n(Fn({transactionId:t,vendorUpdates:a,entity:s})),a.id!=null&&s!=null&&c!=null&&u!=null&&n(J({entity:s,amount:c,transactionDetails:u,flowType:"detail",isFetchCOT:o})),n(Ve({vendorId:a.id?a.id:void 0,localData:{vendorName:a.name,vendorId:a.id?a.id:void 0}})),!a.id&&e.transaction!=null){const h=e.transaction,y=ie(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(`/${e.tenantEmailDomain}/transaction/${encodeURIComponent(h.type??"")}/${h.id}/vendor/create`,{state:{pathnameStackToGoBack:y}})}},onSaveCustomerInLocalData:(t,a,s,c,u)=>{n(Pn({transactionId:t,customerUpdates:a,entity:s})),a.id!=null&&s!=null&&c!=null&&u!=null&&n(J({entity:s,amount:c,transactionDetails:u,flowType:"detail",isFetchCOT:o}))},onUpdateAllTranactionsWithCurrentVendorChecked:t=>{n(wn({transactionId:{id:e.selectedTransaction.id,type:e.selectedTransaction.type},isUpdateEnabled:t}))},onClickUpdateVendorToAllLineItems:(t,a,s)=>{n(_n(t,a,s))},onResetVendorToAllLineItems:(t,a,s)=>{n(Rn(t,a,s))},saveLatestSelectedEntity:(t,a,s)=>{n(An({transactionId:t,lineId:a,entity:s}))},updateVendorBulkRecommendationsFetchStatus:(t,a)=>{n(Cn(t,a))},setIsVendorUpdateAllChecked:(t,a,s)=>{n(Dn(t,a,s))},onCreateTransferEntry:e.isCreateTransferEntryFromExpenseEnabled===!0?t=>yt(n,t):void 0,onLineAdd:()=>{if(e.transaction==null)return;const t={id:e.transaction.id,type:e.transaction.type},a=e.transaction.type==="journal_entry",s=e.transaction.amount?.currencyCode??"",c=e.transaction.amount?.currencySymbol??"",u=a?{amount:{amount:0,currencyCode:s,currencySymbol:c},id:crypto.randomUUID(),isCategoryMiscategorized:!1,isClassMiscategorized:!1,lineDescription:"",platformLineDetailType:"journal_entry_line_detail",type:"journal_entry_transaction_line",postingType:void 0,postingTypeName:"",lineTransactionType:"journal_entry"}:{amount:{amount:0,currencyCode:s,currencySymbol:c},id:crypto.randomUUID(),isCategoryMiscategorized:!1,isClassMiscategorized:!1,lineDescription:"",platformLineDetailType:"account_based_expense_line_detail",type:"transaction_with_account_and_class_line"};n(kn(t,u))},onLineDelete:t=>{if(e.transaction==null)return;const a={id:e.transaction.id,type:e.transaction.type};n(En(a,t))},onToggleSplitEditMode:t=>{if(e.transaction==null)return;const a={id:e.transaction.id,type:e.transaction.type};n(vn(a,t))}}}))(et);function Bt(){const n=Ce(),e=W(),o=De(),{useFeatureGate:t}=X(),a=Yn(),s=g((m=>ee(m))),c=s.userRole.includes("charge_card_user")||s.userRole.includes("charge_card_admin"),u=s.userRole!=null&&Re(s.userRole),h=s.userRole!=null&&_e(s.userRole),{isFeatureEnabled:y}=t(A.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:f}=t(A.isExpenseAutomationEnabled),{tenantEmailDomain:d,transactionTypeEncoded:r,transactionId:S}=Ae(),[I,D]=i.useState(!1),T=We(r??""),b=ze(S,T),v=g((m=>m.transactionVendorViewState)),R=pe(),{isFeatureEnabled:q}=t(A.isRecommendationFeedbackEnabled),U=Xn(),{onRecommendationSelection:_,popup:w}=pt({isEnabled:q,fallbackTransactionId:S}),x=i.useMemo((()=>({...U,onRecommendationSelection:_})),[U,_]),{isFeatureEnabled:P}=t(A.isTransactionCommentingEnabled),{isFeatureEnabled:V}=t(A.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:L}=t(A.isProjectsTransactionsEnabled),{isFeatureEnabled:H}=t(A.isTransactionSplitEnabled),z=a?.currentTenant?.companyId,O=a?.currentTenant?.companyName,M=ct(z),p=i.useMemo((()=>{if(b)return{id:S,type:Q(T)}}),[b,S,T]),l=p!=null?g((m=>Y(m,p))):void 0,E=l?.transactionDetailLocalData.vendorUpdates?.id!=null?v.editVendorStateById[l?.transactionDetailLocalData.vendorUpdates.id]?.saveStatus.fetchState:"Not-Started",k=l?.fetchState==="Completed"?Ge(l?.transaction):void 0,j=g((m=>k!=null?we(m.customerIncomeState,m.vendorExpenseState,m.trendState,k,"month"):void 0)),Z=g((m=>le(m))),ne=g((m=>k!=null?Pe(m.trendWithTransactionsState,k,"TransactionDetail"):void 0)),B=s.company?.companyInfo.firstMonthOfFY??1,qe=g((m=>Fe(m.accountState,m.accountListState,"accountList"))),[He,fe]=i.useState(!1),[Qe,he]=i.useState(!1),[Ye,Se]=i.useState(!1),Xe=i.useCallback((m=>Me(m,d??"")+o.search),[d,o.search]),Ze=i.useCallback((()=>{Se(!1)}),[]);Tt({currentTransactionId:p,enabled:d!=null&&d!=="",buildPath:Xe,beforeNavigate:Ze,navigate:n,navigateState:o.state});const ye=()=>{fe(!1),he(!1)},Te=lt();ut();const te=i.useRef(l?.transaction);te.current=l?.transaction;const Je=l?.transactionDetailUpdateStatus?.fetchState,F=mt(Je,(()=>{const m=[];if(te.current!=null)for(const ae of te.current.lines??[])"account"in ae&&ae.account?.accountId!=null&&m.push(ae.account.accountId);return m}));i.useEffect((()=>{p!=null&&l!=null&&l.fetchState==="Not-Started"&&(e(Be(p,!1)),ye())}),[e,p,l?.fetchState]),i.useEffect((()=>{if(p!=null&&l?.fetchState==="Error"){const m=ie(o.state?.pathnameStackToGoBack,o.pathname);n("page-not-found",{replace:!0,state:Te?{pathnameStackToGoBack:m,message:"expenseAutomation",origin:"transaction_categorization"}:{pathnameStackToGoBack:m,message:"pageNotFound",origin:"transaction_detail"}})}}),[p,l?.fetchState,n,o.state,o.pathname,Te]),i.useEffect((()=>{Ye||l==null||l.transaction==null||(e(Ue({id:l.transaction.id,type:l.transaction.type})),Se(!0));const m=o.state?.searchContext;k==null&&l?.fetchState==="Completed"&&ke(l?.transaction,m),k!=null&&(!c||u&&h===!1)&&(He?Qe||j==null||(he(!0),e(me(k,"TransactionDetail",{timeframe:"month",timePeriod:ne?.selectedPeriod?.timePeriod??j}))):(e(de()),e(ue()),ke(l?.transaction,m),fe(!0),e(xe(k))))}),[l?.fetchState,l?.transaction,j,c]),i.useEffect((()=>{Z.newVendorState?.vendorDetailLocalData?.vendorName!=null?D(!0):D(!1)}),[Z.newVendorState?.vendorDetailLocalData?.vendorName]),i.useEffect((()=>()=>{e(G("common"))}),[]);const Ke=[r,S].filter((m=>m!=null)),{transactionId:be,onSaveVendor:en,onSaveSuccess:nn,onCancel:tn}=bt({closeDrawerHandler:m=>{D(!1),n(m?"../":"../..")}}),{isAiCfoAccessEnabled:an,onAskAiCfoClick:on}=st({mobileExploreReferrer:"Transaction Details"});return Zn({isDataReady:l?.fetchState==="Completed"}),b?C.jsxs(C.Fragment,{children:[be!=null&&I&&C.jsx(ht,{isOpen:I,transactionId:be,onSaveVendor:en,onSaveSuccess:nn,onCancel:tn}),C.jsx(Jn,{toolkit:x,children:C.jsx(gt,{hideDeleteAttachment:!0,firstMonthOfFY:B,isDisabled:l?.transaction?.type==="transfer"&&a?.connectionName==="netsuite"?"readonly":void 0,tenantEmailDomain:d,location:o,navigate:n,selectedTransaction:p,entity:k,isCOTEnabled:R,defaultTrendTransactionTimePeriod:j,resetTrendIsFetchedStates:ye,transaction:l?.transaction,uncategorizedAccounts:qe,vendorSaveStatus:E,isVendorBulkUpdateOnTransactionEnabled:y,isCreateTransferEntryFromExpenseEnabled:V,isExpenseAutomationEnabled:f,isAiCfoAccessEnabled:an,onAskAiCfoClick:on,isTransactionCommentingEnabled:P,isProjectsTransactionsEnabled:L,isTransactionSplitEnabled:H,companyId:z,companyName:O,initialOpenThreadRequest:M})}),w,F.showPopup&&F.popupType!=null&&C.jsx(Kn,{popupType:F.popupType,currencySymbol:F.currencySymbol,accountId:F.popupAccountId??"",accountName:F.popupAccountName??"",onSubmit:F.handleSubmit,onDismiss:F.handleDismiss})]}):C.jsx(cn,{to:$e(Ke.length)})}const $e=(n=2)=>{let e="../";for(let o=0;o<n;o++)e=`${e}../`;return e},ke=(n,e)=>{if(n!=null){const{transactionCategory:o,transactionClass:t}=It(n),a=vt(n);$.trackTransactionDetails(n.account?.accountId,n.account?.accountName,n.id,a,o.length>0?o:void 0,t.length>0?t:void 0,n.type,n.amount,n.memo,n.lines?.length??0,n.attachments?.map((s=>s.fileName)),e!=null?"Search":void 0,e?.searchTerm,e?.resultPosition,e?.resultsCount)}},It=n=>{const e=[],o=[];return n.lines?.forEach((t=>{switch(t.type){case"transaction_with_account_and_class_line":case"transaction_with_product_or_service_line":case"journal_entry_transaction_line":case"linked_transaction_line":{const a=t;a!=null&&a.account!=null&&a.account.accountName?.length>0&&e.push(a.account.accountName),a.class!=null&&a.class.className?.length>0&&o.push(a.class.className);break}}})),{transactionCategory:e,transactionClass:o}},vt=n=>Tn(n)===!0?n.customer?.name??"":bn(n)===!0?n.vendor?.name??"":n.memo!=null?n.memo:n.type;export{ht as C,Bt as T,pt as a,ut as b,mt as c,bt as d,gt as e,Tt as f,pe as g,Lt as h,yt as i,ke as l,Vt as r,Ot as u};