@zeniai/web-app-ui 5.3.95-qa → 5.3.96-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 (125) hide show
  1. package/dist/assets/{AccountMappingScreen-CxywIq_5.js → AccountMappingScreen-BEj2Jzjh.js} +2 -2
  2. package/dist/assets/{ActualMatchingMatchDetailScreen-CflHudgj.js → ActualMatchingMatchDetailScreen-BhGe8oi6.js} +1 -1
  3. package/dist/assets/AddressRoutes-BVSHrg7z.js +1 -0
  4. package/dist/assets/AddressScreen-Doe_aPe9.js +9 -0
  5. package/dist/assets/{AiCfoScreen-QS3HKk1M.js → AiCfoScreen-T9wsddnc.js} +1 -1
  6. package/dist/assets/{AppDrawer-CVWb3Q7E.js → AppDrawer-BO5m3PED.js} +1 -1
  7. package/dist/assets/{BillPayApprovalRoutes-CKt9p3vM.js → BillPayApprovalRoutes-B8F3GVxs.js} +1 -1
  8. package/dist/assets/{BillPayRoutes-ByMlnyJ1.js → BillPayRoutes-DcSqsOgQ.js} +1 -1
  9. package/dist/assets/{BusinessVerificationPageScreen-Dn8i9qEY.js → BusinessVerificationPageScreen-JarRxoSX.js} +2 -2
  10. package/dist/assets/{CardsAiCfoScreen-Drd3k-8m.js → CardsAiCfoScreen-Cdz5Oqoj.js} +1 -1
  11. package/dist/assets/{ChargeCardRoutes-DM12hM0o.js → ChargeCardRoutes-fZYBlxkt.js} +1 -1
  12. package/dist/assets/{CompanyPassportScreen-4WUo_HTu.js → CompanyPassportScreen-CoIn2qzM.js} +1 -1
  13. package/dist/assets/{ConnectionAuthScreen-tlIsODee.js → ConnectionAuthScreen-DYsUrO3M.js} +2 -2
  14. package/dist/assets/CustomerOnboardingAuthScreen-cy1fiuJH.js +1 -0
  15. package/dist/assets/{CustomerOnboardingRoutes-ztD2iNU-.js → CustomerOnboardingRoutes-D5GZ0VVR.js} +3 -3
  16. package/dist/assets/{DashboardRoutes-BhiJFLI_.js → DashboardRoutes-DMdxy8l4.js} +4 -4
  17. package/dist/assets/{DefaultTenantHome-CsDwWhnZ.js → DefaultTenantHome-BcGsaBpe.js} +1 -1
  18. package/dist/assets/{DomesticWireDetailScreen-qRSOLyKY.js → DomesticWireDetailScreen-BbDPbcRA.js} +3 -3
  19. package/dist/assets/{DrawerScreen-B2FIpd3y.js → DrawerScreen-37FDqOIx.js} +1 -1
  20. package/dist/assets/{EntityDetailRoutes-CP1SjZC0.js → EntityDetailRoutes-DVrb6Fuj.js} +1 -1
  21. package/dist/assets/{ExpenseAutomationRoutes-BGfs-W5H.js → ExpenseAutomationRoutes-CxhAtnDQ.js} +1 -1
  22. package/dist/assets/{FeaturePreviewScreen-Rc8Q-SSN.js → FeaturePreviewScreen-yUa195bz.js} +1 -1
  23. package/dist/assets/{HubSpotOAuthCallbackScreen-CQljiAxj.js → HubSpotOAuthCallbackScreen--RhQBan-.js} +1 -1
  24. package/dist/assets/{InboxNotificationsProvider-LdTK3V9o.js → InboxNotificationsProvider-C3xMqTmq.js} +1 -1
  25. package/dist/assets/InvoicingRoutes-B-1POvyE.js +3 -0
  26. package/dist/assets/{MagicLinkRoutes-BWBnJtnC.js → MagicLinkRoutes-PBem0q8b.js} +1 -1
  27. package/dist/assets/MagicLinkSignInScreen-BcCW10cQ.js +12 -0
  28. package/dist/assets/MobileAppDrawer-DfWAieCr.js +1 -0
  29. package/dist/assets/NotFoundScreen-Bowln8Np.js +1 -0
  30. package/dist/assets/{NotificationRoutes-DTess25T.js → NotificationRoutes-DvSviwho.js} +1 -1
  31. package/dist/assets/{OAuthConsentScreen-CY4MM4YX.js → OAuthConsentScreen-CY6jrUj6.js} +1 -1
  32. package/dist/assets/{PandLWithForecastRoutes-DB6C_pxp.js → PandLWithForecastRoutes-Dhy9JC2p.js} +1 -1
  33. package/dist/assets/{PaymentLinkScreen-BPZTHdTb.js → PaymentLinkScreen-JV3evKRP.js} +5 -5
  34. package/dist/assets/{PeopleRoutes-BWwv0t4D.js → PeopleRoutes-Cse3a3sb.js} +3 -3
  35. package/dist/assets/{PerformanceRoutes-CHP8XvlQ.js → PerformanceRoutes-CxRwjZ1i.js} +1 -1
  36. package/dist/assets/{Preview-S6mtKRFK.js → Preview-DwgMDfYC.js} +1 -1
  37. package/dist/assets/{QBOConnectionScreen-pFSAqCsM.js → QBOConnectionScreen-D6uUWSjU.js} +1 -1
  38. package/dist/assets/{ReimbursementApprovalRoutes-BHy8amDu.js → ReimbursementApprovalRoutes-DHWyOWyD.js} +1 -1
  39. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-DV5UVmJ4.js → ReimbursementApprovalRuleDetailScreen-meuFzn-o.js} +1 -1
  40. package/dist/assets/{ReimbursementRoutes-C1bB9m-D.js → ReimbursementRoutes-z4gQLteF.js} +1 -1
  41. package/dist/assets/{ReportsRoutes-BkK5zT9z.js → ReportsRoutes-S7M6Uyzv.js} +1 -1
  42. package/dist/assets/RewardsRoutes-DjHnoowA.js +1 -0
  43. package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-DQFyw5bj.js → ScheduleDetailsPrepaidExpensesScreen-ByJabNd7.js} +5 -5
  44. package/dist/assets/ScreenRoutes-DxeRaGXX.js +2 -0
  45. package/dist/assets/{SettingsRoutes-B0enG4Yl.js → SettingsRoutes-BRlBwm37.js} +5 -5
  46. package/dist/assets/{SetupPagesScreen-Biv-I7I-.js → SetupPagesScreen-D3fdAxOs.js} +5 -5
  47. package/dist/assets/{SignInScreen-Byl7VfG6.js → SignInScreen-Bq6wqyFV.js} +1 -1
  48. package/dist/assets/SignOutScreen-CMyUFCH3.js +9 -0
  49. package/dist/assets/{TaskListScreen-BhzrNsEv.js → TaskListScreen-BcmmmrTo.js} +2 -2
  50. package/dist/assets/{TaskRoutes-CP6oUQsN.js → TaskRoutes-C4T84shI.js} +2 -2
  51. package/dist/assets/TransactionDetailRoutes-BnJFdHti.js +1 -0
  52. package/dist/assets/{TransactionDetailScreen-0OB8Pqf6.js → TransactionDetailScreen-Dpzd-yXF.js} +2 -2
  53. package/dist/assets/{TransactionListRoutes-DcSXD2S9.js → TransactionListRoutes-Bu7PI8Rl.js} +1 -1
  54. package/dist/assets/{TreasuryRoutes-BaGLXm-c.js → TreasuryRoutes-D6tE6770.js} +4 -4
  55. package/dist/assets/{VendorsRoutes-C9s2BiPx.js → VendorsRoutes-D_WhDWVM.js} +1 -1
  56. package/dist/assets/{WiseConfirmationScreen-BSs-1FPg.js → WiseConfirmationScreen-BhYBEIyb.js} +1 -1
  57. package/dist/assets/{ZeniAccountRoutes-WTE-a0i_.js → ZeniAccountRoutes-CtYkEuA8.js} +9 -9
  58. package/dist/assets/{ZeniAccountStatementScreen-CD7gALNT.js → ZeniAccountStatementScreen-F5yZU3cz.js} +1 -1
  59. package/dist/assets/{accountMappingHelper-1wM-u5pk.js → accountMappingHelper-BIdzFaKc.js} +1 -1
  60. package/dist/assets/{analytics-DhotUQIQ.js → analytics-BreoHt0J.js} +1 -1
  61. package/dist/assets/{analyticsHelper-DMxE_5WG.js → analyticsHelper-DbQsERTh.js} +1 -1
  62. package/dist/assets/{core-B1R51LGS.js → core-CSm69gJV.js} +1 -1
  63. package/dist/assets/{decodeURIComponentSafe-sNmSv15A.js → decodeURIComponentSafe-DD9Neunj.js} +1 -1
  64. package/dist/assets/{dnd-CBDtHD8g.js → dnd-BvLWSTOT.js} +1 -1
  65. package/dist/assets/{empty-DDVSRnUK.js → empty-BPKm1KLs.js} +1 -1
  66. package/dist/assets/{empty-1ZFG33kK.js → empty-D-Gn9Jdo.js} +1 -1
  67. package/dist/assets/{emptyVideoElement-Cmgjsfjv.js → emptyVideoElement-LUxShx9x.js} +1 -1
  68. package/dist/assets/{epic--rTGN1ZF.js → epic-B1XMIJyC.js} +1 -1
  69. package/dist/assets/{expenseAutomationHelper-Bb1c_nBx.js → expenseAutomationHelper-Djn6yrb_.js} +1 -1
  70. package/dist/assets/{getLocaleForTenant-CLKJVxYo.js → getLocaleForTenant-uCoslywF.js} +1 -1
  71. package/dist/assets/{index-DUjhchTx.js → index-B-RYxEU1.js} +1 -1
  72. package/dist/assets/{index-4kuDVIdn.js → index-Bx0cVQTh.js} +1 -1
  73. package/dist/assets/{index-DaxOKW2h.js → index-C6_y02Df.js} +2 -2
  74. package/dist/assets/{index-B4fRbcqK.js → index-CSw2zedd.js} +1 -1
  75. package/dist/assets/{index-C5-029-z.js → index-DfmKliEE.js} +1 -1
  76. package/dist/assets/{index-C49C-P8m.js → index-Di0x3KLC.js} +6167 -6167
  77. package/dist/assets/{index-CmqWYVaK.js → index-mW6D32De.js} +1 -1
  78. package/dist/assets/{index-BgCxp-PW.js → index-t_yPrnJX.js} +1 -1
  79. package/dist/assets/{lexical-Cft6chCX.js → lexical-CC3pmboN.js} +1 -1
  80. package/dist/assets/{liveblocks-BYqz0SWy.js → liveblocks-Css5YxVy.js} +1 -1
  81. package/dist/assets/{lottie-C4orech3.js → lottie-scQSn0xo.js} +1 -1
  82. package/dist/assets/{mui-D-_RYGgU.js → mui-CgZjFJJF.js} +1 -1
  83. package/dist/assets/{pathToGoBack-DZ8Lgq0-.js → pathToGoBack-Cx0NwHdB.js} +1 -1
  84. package/dist/assets/{pdf-DFgrdLB6.js → pdf-DXPt-TDj.js} +3 -3
  85. package/dist/assets/{pdf-lib-2bJZTByw.js → pdf-lib-kfbS5Id9.js} +1 -1
  86. package/dist/assets/{plaid-B0PWXAfV.js → plaid-vksPD1j4.js} +1 -1
  87. package/dist/assets/{pusher-F6-lSe0Y.js → pusher-BpFLgay1.js} +1 -1
  88. package/dist/assets/{react-BwTGo4yk.js → react-BFVWe54o.js} +1 -1
  89. package/dist/assets/{react-CM16A7NA.js → react-BpwHczl-.js} +1 -1
  90. package/dist/assets/{react-CB4vP-t_.js → react-DBgZvtMG.js} +1 -1
  91. package/dist/assets/{react-DyLpv-r1.js → react-iYq3GXPy.js} +1 -1
  92. package/dist/assets/{react-DUg8Ws81.js → react-mGF_kQSA.js} +1 -1
  93. package/dist/assets/{react-D_SPu3Ud.js → react-rwzOK-1r.js} +1 -1
  94. package/dist/assets/{recharts-By7FVN8f.js → recharts-DQBC-7lc.js} +1 -1
  95. package/dist/assets/{routePaths-3jcOIrRa.js → routePaths-DNuW5jQV.js} +1 -1
  96. package/dist/assets/{sentry-DjmIorbX.js → sentry-BBNrx1Ml.js} +1 -1
  97. package/dist/assets/{stripSplatSuffix-B5IwbFj2.js → stripSplatSuffix-L-JRH5Ri.js} +1 -1
  98. package/dist/assets/{url-B8llcdww.js → url-CiYRfW83.js} +1 -1
  99. package/dist/assets/{url-SyxPcinx.js → url-D0TdjO3t.js} +1 -1
  100. package/dist/assets/{useActualMatchingMatchDetail-BDFpjIdi.js → useActualMatchingMatchDetail-CekpYB8W.js} +1 -1
  101. package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-j2GTAdQA.js → useAiCfoDashboardSuggestedQuestionsChips-Dn4uN4J8.js} +1 -1
  102. package/dist/assets/useAskAiCfoHostNavButtonProps-Ba1QPj42.js +1 -0
  103. package/dist/assets/{useChargeCardPusherEvents-CEehuLGK.js → useChargeCardPusherEvents-Bc01kHYP.js} +1 -1
  104. package/dist/assets/{useDeviceId-D6nAUa-g.js → useDeviceId-ClCFOYOX.js} +1 -1
  105. package/dist/assets/{useEmailConnectResultRefresh-DoM1bafj.js → useEmailConnectResultRefresh-DgdB9uv-.js} +1 -1
  106. package/dist/assets/{useInitialThreadRequest-BwFSf59X.js → useInitialThreadRequest-2hi5iAsL.js} +1 -1
  107. package/dist/assets/{useTaskManagerAccess-HM4US9Ho.js → useTaskManagerAccess-D_aPdTiN.js} +1 -1
  108. package/dist/assets/{useTaskManagerPusherEvents-BfE7R6Dz.js → useTaskManagerPusherEvents-Ypcuts7J.js} +1 -1
  109. package/dist/assets/{utils-iOnDyQuG.js → utils-B8asVtkx.js} +1 -1
  110. package/dist/assets/{withTransactionSidePanel-ClaUsoxR.js → withTransactionSidePanel-Bb5FevX_.js} +1 -1
  111. package/dist/assets/{zeni-epic-state-M9sMLOaG.js → zeni-epic-state-CQbasAjU.js} +7 -7
  112. package/dist/index.html +1 -1
  113. package/package.json +3 -3
  114. package/dist/assets/AddressRoutes-DcEodit_.js +0 -1
  115. package/dist/assets/AddressScreen-CmxlHuMF.js +0 -9
  116. package/dist/assets/CustomerOnboardingAuthScreen-CxJhpy5p.js +0 -1
  117. package/dist/assets/InvoicingRoutes-BPWj_iEE.js +0 -3
  118. package/dist/assets/MagicLinkSignInScreen-DdM_RNNU.js +0 -12
  119. package/dist/assets/MobileAppDrawer-DU_XM5Fb.js +0 -1
  120. package/dist/assets/NotFoundScreen-NsaSbBFa.js +0 -1
  121. package/dist/assets/RewardsRoutes-DOeNjsqd.js +0 -1
  122. package/dist/assets/ScreenRoutes-_X4JeUid.js +0 -2
  123. package/dist/assets/SignOutScreen-qa_DEC5P.js +0 -9
  124. package/dist/assets/TransactionDetailRoutes-D92M6VPi.js +0 -1
  125. package/dist/assets/useAskAiCfoHostNavButtonProps-BXTsy7YX.js +0 -1
@@ -1,20 +1,20 @@
1
- import{j as d}from"./liveblocks-BYqz0SWy.js";import{i as q,j as S,g as H,u as z,h as W,l as ne,k as oa,n as ht,o as P,N as vn}from"./core-B1R51LGS.js";import{fI as Y,Ws as We,bF as sa,br as Ee,XQ as En,ke as xn,XR as Vt,XS as wn,kh as ft,XT as Qe,XU as Tn,km as Dn,XV as Gt,XW as Pn,kq as gt,XX as Ze,XY as On,XZ as Fn,WM as jn,ls as Rn,X_ as Mn,bn as Je,X$ as ra,Xq as le,bc as ia,lG as ca,lp as la,Xs as de,Xr as ae,fH as da,gd as Yn,gt as bt,Y0 as Bn,Y1 as Un,Y2 as ua,Y3 as Oe,Er as Ye,Es as Be,EQ as xe,EK as ue,Ew as Ue,Y4 as Ln,c0 as Le,Y5 as Vn,Y6 as Gn,Y7 as ma,Y8 as Fe,Y9 as Nn,ek as et,Ax as pa,Ya as $n,Yb as ha,Yc as zn,Yd as Kn,Ye as qn,Yf as _t,Vo as St,uh as we,m3 as Te,E_ as kt,AE as Xn,AL as Qn,Yg as Zn,Yh as Hn,Et as Nt,Yi as Wn,AA as Ie,Av as fa,Yj as ge,Yk as $t,Yl as Jn,Ym as yt,Vn as At,CI as ga,Yn as eo,Yo as ba,Yp as to,Yq as ao,Yr as no,Ys as It,CX as oo,D2 as so,Yt as ro,Yu as io,Ev as zt,Yv as co,CG as Ca,Yw as be,Yx as Kt,Yy as lo,bq as _a,F3 as Sa,Yz as uo,YA as ka,YB as mo,YC as po,YD as ho,YE as vt,EX as fo,EZ as go,YF as bo,YG as Co,Eu as qt,YH as _o,F1 as ya,YI as Ce,YJ as Xt,YK as So,YL as ko,YM as Aa,lU as Ia,p$ as va,lZ as Ea,pZ as xa,pY as wa,pX as Ta,C3 as yo,dd as Ao,pU as Io,UL as vo,q9 as Eo,YN as xo,YO as wo,YP as To,b5 as Et,q3 as Do,ih as Po,gL as Oo,q2 as Fo,li as jo,q0 as Ro,p_ as Mo,e0 as Yo,d$ as Bo}from"./zeni-epic-state-M9sMLOaG.js";import{z as B,at as oe,p as O,l as w,G as X,b9 as Uo,aq as Ve,a6 as Ge,ba as Da,K as N,bb as Lo,bc as Pa,bd as Vo,be as Go,a as Oa,_ as Fa,e as ja,ap as No,bf as $o,am as zo,c as xt,bg as Ra,x as re,bh as Ma,bi as Ya,as as Ba,bj as Ko,ag as Ne,V as $e,bk as qo,H as Xo,bl as Qo,$ as G,f as Zo,j as Ho,a2 as Wo,ao as Jo,bm as es,bn as ts,bo as as,bp as ve}from"./index-C49C-P8m.js";import{u as ns,n as wt}from"./mui-D-_RYGgU.js";import{a as b}from"./sentry-DjmIorbX.js";import{w as Ua}from"./withTransactionSidePanel-ClaUsoxR.js";import{c as La,t as De,f as me,b as Tt,a as Dt,v as os}from"./routePaths-3jcOIrRa.js";import{u as se}from"./useAskAiCfoHostNavButtonProps-BXTsy7YX.js";import Me from"./NotFoundScreen-NsaSbBFa.js";import{u as Pt}from"./useInitialThreadRequest-BwFSf59X.js";import{t as Va}from"./analyticsHelper-DMxE_5WG.js";import{C as ss}from"./CompanyPassportScreen-4WUo_HTu.js";import{u as rs}from"./useAiCfoDashboardSuggestedQuestionsChips-j2GTAdQA.js";import{F as is}from"./FeaturePreviewScreen-Rc8Q-SSN.js";import"./recharts-By7FVN8f.js";import"./analytics-DhotUQIQ.js";import"./plaid-B0PWXAfV.js";import"./dnd-CBDtHD8g.js";import"./stripe-cKAAJElX.js";import"./lottie-C4orech3.js";import"./lexical-Cft6chCX.js";import"./pdf-DFgrdLB6.js";import"./utils-iOnDyQuG.js";import"./TransactionDetailScreen-0OB8Pqf6.js";import"./decodeURIComponentSafe-sNmSv15A.js";import"./expenseAutomationHelper-Bb1c_nBx.js";import"./stripSplatSuffix-B5IwbFj2.js";import"./MobileAppDrawer-DU_XM5Fb.js";import"./InboxNotificationsProvider-LdTK3V9o.js";import"./useTaskManagerAccess-HM4US9Ho.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]="824b4886-2aac-4e73-b8fc-2c9d62fcd0fd",e._sentryDebugIdIdentifier="sentry-dbid-824b4886-2aac-4e73-b8fc-2c9d62fcd0fd")}catch{}})();const cs=Ua((function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=q(),s=B.getSignedInUser(),i=S((_=>_.tenantState.currentTenantId)),l=S((_=>Y(_))),{tenantEmailDomain:m}=q(),p=H(),h=l?.companyName??"",f={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},c=b.useMemo((()=>({authParams:f,companyName:h,downloadEndPoint:`${oe}/agingDetailedReport`,timezone:We()})),[]),u=b.useMemo((()=>r!=null?sa(r):Ee()),[r]),C=z(),g=W(),y=S((_=>En(_,u,o))),E=b.useCallback((()=>{o!=null&&y.fetchState!=="In-Progress"&&y.fetchState!=="Completed"&&C(xn(o,u))}),[u]),I=b.useCallback((()=>{g("../../",{relative:"path"})}),[]),k=b.useCallback(((_,A)=>{C(Vt({sortKey:_,sortOrder:A}))}),[]),x=b.useCallback((_=>{C(Vt({downloadState:_}))}),[]),R=b.useCallback((_=>{if(e)e(_.transactionId,_.transactionType);else if(m!=null){const A=La({id:_.transactionId,type:_.transactionType},m);g(A);const U=O(p.state?.pathnameStackToGoBack,p.pathname);g(A,{state:{pathnameStackToGoBack:U}})}}),[m,e]),T=b.useCallback((()=>{y.vendor!=null&&w.trackApAgingDetail("AP Aging",u.format(X.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),y.vendor.id,y.vendor.name)}),[y.vendor,u]);return b.useEffect((()=>{E()}),[]),b.useEffect((()=>{y.fetchState==="Completed"&&T()}),[T,y.fetchState]),d.jsx(Uo,{apAgingDetail:y,downloadParams:c,reportDate:u,analytics:w,onTransactionClick:R,onReload:E,onBackClick:I,onColumnSortConfigChanged:k,updateDownloadStateHandler:x,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})})),ls=()=>{const e=z(),a=W(),t=S((k=>wn(k))),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=se({mobileExploreReferrer:"AP Aging"});Ve({isDataReady:t.fetchState==="Completed"});const r=B.getSignedInUser(),s=S((k=>k.tenantState.currentTenantId)),i=S((k=>Y(k))),l=i?.companyName??"",m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},p=b.useMemo((()=>({authParams:m,companyName:l,downloadEndPoint:`${oe}/agingReport`,timezone:We()})),[]),h=t.apAgingUIState.selectedDate??Ee(),f=b.useCallback((()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(ft(h))}),[]);b.useEffect((()=>{f()}),[]);const c=b.useCallback((()=>{a("../",{relative:"path"})}),[]),u=b.useCallback((k=>{e(Qe({searchString:k}))}),[]),C=b.useCallback(((k,x)=>{e(Qe({sortKey:x,sortOrder:k}))}),[]),g=b.useCallback((k=>{a(`./${k}/${h.format(X.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)}),[h]),y=b.useCallback((k=>{e(Qe({downloadState:k}))}),[]),E=b.useCallback(((k,x)=>{}),[]),I=b.useCallback(((k,x)=>{e(Qe({selectedDate:k,agingDateSelectionType:x})),e(ft(k))}),[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(Ge,{analytics:w,onLoad:k=>k.trackPageLoaded(N.Event.agingReport,"AP Aging")}):null,d.jsx(Da,{uiState:t.apAgingUIState,report:t,downloadParams:p,analytics:w,onReloadReport:f,onBackClick:c,onSearchTextChange:u,onSortOrderChange:C,onEntityNameClick:g,updateDownloadStateHandler:y,onSelectedDateChanged:I,onNodeCollapseToggled:E,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},ds=Ua((function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=q(),s=B.getSignedInUser(),i=S((T=>Y(T))),{tenantEmailDomain:l}=q(),m=H(),p=i.companyName,h={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},f=b.useMemo((()=>({authParams:h,companyName:p,downloadEndPoint:`${oe}/agingDetailedReport`,timezone:We()})),[]),c=b.useMemo((()=>r!=null?sa(r):Ee()),[r]),u=z(),C=W(),g=S((T=>Tn(T,c,o))),y=b.useCallback((()=>{o!=null&&g.fetchState!=="In-Progress"&&g.fetchState!=="Completed"&&u(Dn(o,c))}),[c]),E=b.useCallback((()=>{C("../../",{relative:"path"})}),[]),I=b.useCallback(((T,_)=>{u(Gt({sortKey:T,sortOrder:_}))}),[]),k=b.useCallback((T=>{u(Gt({downloadState:T}))}),[]),x=b.useCallback((T=>{if(e)e(T.transactionId,T.transactionType);else if(l!=null){const _=La({id:T.transactionId,type:T.transactionType},l);C(_);const A=O(m.state?.pathnameStackToGoBack,m.pathname);C(_,{state:{pathnameStackToGoBack:A}})}}),[l,e]),R=b.useCallback((()=>{g.customer!=null&&w.trackArAgingDetail("AR Aging",c.format(X.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),g.customer.id,g.customer.name)}),[g.customer,c]);return b.useEffect((()=>{y()}),[]),b.useEffect((()=>{g.fetchState==="Completed"&&R()}),[g.fetchState,R]),d.jsx(Lo,{arAgingDetail:g,downloadParams:f,reportDate:c,analytics:w,onTransactionClick:x,onReload:y,onBackClick:E,onColumnSortConfigChanged:I,updateDownloadStateHandler:k,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})})),us=()=>{const e=z(),a=W(),t=S((I=>Pn(I))),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=se({mobileExploreReferrer:"AR Aging"});Ve({isDataReady:t.fetchState==="Completed"});const r=B.getSignedInUser(),s=S((I=>Y(I))),i=s.companyName,l={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},m=b.useMemo((()=>({authParams:l,companyName:i,downloadEndPoint:`${oe}/agingReport`,timezone:We()})),[]),p=t.arAgingUIState.selectedDate??Ee(),h=b.useCallback((()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(gt(p))}),[]);b.useEffect((()=>{h()}),[]);const f=b.useCallback((()=>{a("../",{relative:"path"})}),[]),c=b.useCallback((I=>{e(Ze({searchString:I}))}),[]),u=b.useCallback(((I,k)=>{e(Ze({sortKey:k,sortOrder:I}))}),[]),C=b.useCallback((I=>{a(`./${I}/${p.format(X.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)}),[p]),g=b.useCallback((I=>{e(Ze({downloadState:I}))}),[]),y=b.useCallback(((I,k)=>{e(Ze({selectedDate:I,agingDateSelectionType:k})),e(gt(I))}),[]),E=b.useCallback(((I,k)=>{e(On({nodeId:I,isCollapsed:k}))}),[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(Ge,{analytics:w,onLoad:I=>I.trackPageLoaded(N.Event.agingReport,"AR Aging")}):null,d.jsx(Da,{uiState:t.arAgingUIState,report:t,downloadParams:m,analytics:w,onReloadReport:h,onBackClick:f,onSearchTextChange:c,onSortOrderChange:u,onEntityNameClick:C,updateDownloadStateHandler:g,onSelectedDateChanged:y,onNodeCollapseToggled:E,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},Ga=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function Na(e,a){const t=jn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=De(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(Rn(n,o))}}}const ms=ne((function(e){const a=Fn(e).accountsInOrder.map(((t,n)=>Ga(t,n)));return{sectionTitle:X.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,fetchState:e.cashBalanceState.fetchState,analytics:w}}),Na)(Pa),ps=ne((function(e){const a=Mn(e).accountsInOrder.map(((o,r)=>Ga(o,r))),t=B.getSignedInUser(),n=Je(t);return{sectionTitle:X.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:w}}),Na)(Pa);function hs(){const e=W(),a=H(),{tenantEmailDomain:t}=q(),n=S((o=>Y(o).company?.companyInfo.firstMonthOfFY??1));return S((o=>o.cashBalanceState.fetchState))==="Error"?d.jsx(Me,{}):d.jsx(ms,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,firstMonthOfFY:n})}function fs(){const e=W(),a=H(),{tenantEmailDomain:t}=q(),n=S((o=>Y(o).company?.companyInfo.firstMonthOfFY??1));return S((o=>o.cardBalanceState.fetchState))==="Error"?d.jsx(Me,{}):d.jsx(ps,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,firstMonthOfFY:n})}const gs=wt.div`
1
+ import{j as d}from"./liveblocks-Css5YxVy.js";import{i as q,j as S,g as H,u as z,h as W,l as ne,k as oa,n as ht,o as P,N as In}from"./core-CSm69gJV.js";import{fI as Y,Ws as We,bF as sa,br as Ee,XQ as En,ke as wn,XR as Vt,XS as xn,kh as ft,XT as Qe,XU as Tn,km as Dn,XV as Gt,XW as Pn,kq as gt,XX as Ze,XY as On,XZ as Fn,WM as jn,ls as Rn,X_ as Mn,bn as Je,X$ as ra,Xq as le,bc as ia,lG as ca,lp as la,Xs as de,Xr as ae,fH as da,gd as Yn,gt as bt,Y0 as Bn,Y1 as Un,Y2 as ua,Y3 as Oe,Er as Ye,Es as Be,EQ as we,EK as ue,Ew as Ue,Y4 as Ln,c0 as Le,Y5 as Vn,Y6 as Gn,Y7 as ma,Y8 as Fe,Y9 as Nn,ek as et,Ax as pa,Ya as $n,Yb as ha,Yc as zn,Yd as Kn,Ye as qn,Yf as _t,Vo as St,uh as xe,m3 as Te,E_ as kt,AE as Xn,AL as Qn,Yg as Zn,Yh as Hn,Et as Nt,Yi as Wn,AA as ve,Av as fa,Yj as ge,Yk as $t,Yl as Jn,Ym as yt,Vn as At,CI as ga,Yn as eo,Yo as ba,Yp as to,Yq as ao,Yr as no,Ys as vt,CX as oo,D2 as so,Yt as ro,Yu as io,Ev as zt,Yv as co,CG as Ca,Yw as be,Yx as Kt,Yy as lo,bq as _a,F3 as Sa,Yz as uo,YA as ka,YB as mo,YC as po,YD as ho,YE as It,EX as fo,EZ as go,YF as bo,YG as Co,Eu as qt,YH as _o,F1 as ya,YI as Ce,YJ as Xt,YK as So,YL as ko,YM as Aa,lU as va,p$ as Ia,lZ as Ea,pZ as wa,pY as xa,pX as Ta,C3 as yo,dd as Ao,pU as vo,UL as Io,q9 as Eo,YN as wo,YO as xo,YP as To,b5 as Et,q3 as Do,ih as Po,gL as Oo,q2 as Fo,li as jo,q0 as Ro,p_ as Mo,e0 as Yo,d$ as Bo}from"./zeni-epic-state-CQbasAjU.js";import{z as B,at as oe,p as O,k as x,G as X,b9 as Uo,aq as Ve,a6 as Ge,ba as Da,K as N,bb as Lo,bc as Pa,bd as Vo,be as Go,a as Oa,_ as Fa,e as ja,ap as No,bf as $o,am as zo,c as wt,bg as Ra,v as re,bh as Ma,bi as Ya,as as Ba,bj as Ko,ag as Ne,V as $e,bk as qo,F as Xo,bl as Qo,$ as G,f as Zo,j as Ho,a2 as Wo,ao as Jo,bm as es,bn as ts,bo as as,bp as Ie}from"./index-Di0x3KLC.js";import{u as ns,n as xt}from"./mui-CgZjFJJF.js";import{a as b}from"./sentry-BBNrx1Ml.js";import{w as Ua}from"./withTransactionSidePanel-Bb5FevX_.js";import{c as La,t as De,f as me,b as Tt,a as Dt,v as os}from"./routePaths-DNuW5jQV.js";import{u as se}from"./useAskAiCfoHostNavButtonProps-Ba1QPj42.js";import Me from"./NotFoundScreen-Bowln8Np.js";import{u as Pt}from"./useInitialThreadRequest-2hi5iAsL.js";import{t as Va}from"./analyticsHelper-DbQsERTh.js";import{C as ss}from"./CompanyPassportScreen-CoIn2qzM.js";import{u as rs}from"./useAiCfoDashboardSuggestedQuestionsChips-Dn4uN4J8.js";import{F as is}from"./FeaturePreviewScreen-yUa195bz.js";import"./recharts-DQBC-7lc.js";import"./analytics-BreoHt0J.js";import"./plaid-vksPD1j4.js";import"./dnd-BvLWSTOT.js";import"./stripe-cKAAJElX.js";import"./lottie-scQSn0xo.js";import"./lexical-CC3pmboN.js";import"./pdf-DXPt-TDj.js";import"./utils-B8asVtkx.js";import"./TransactionDetailScreen-Dpzd-yXF.js";import"./decodeURIComponentSafe-DD9Neunj.js";import"./expenseAutomationHelper-Djn6yrb_.js";import"./stripSplatSuffix-L-JRH5Ri.js";import"./MobileAppDrawer-DfWAieCr.js";import"./InboxNotificationsProvider-C3xMqTmq.js";import"./useTaskManagerAccess-D_aPdTiN.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]="48be95c4-f328-401e-8781-d1c255e3f5e4",e._sentryDebugIdIdentifier="sentry-dbid-48be95c4-f328-401e-8781-d1c255e3f5e4")}catch{}})();const cs=Ua((function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=q(),s=B.getSignedInUser(),i=S((_=>_.tenantState.currentTenantId)),l=S((_=>Y(_))),{tenantEmailDomain:m}=q(),p=H(),h=l?.companyName??"",f={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},c=b.useMemo((()=>({authParams:f,companyName:h,downloadEndPoint:`${oe}/agingDetailedReport`,timezone:We()})),[]),u=b.useMemo((()=>r!=null?sa(r):Ee()),[r]),C=z(),g=W(),y=S((_=>En(_,u,o))),E=b.useCallback((()=>{o!=null&&y.fetchState!=="In-Progress"&&y.fetchState!=="Completed"&&C(wn(o,u))}),[u]),v=b.useCallback((()=>{g("../../",{relative:"path"})}),[]),k=b.useCallback(((_,A)=>{C(Vt({sortKey:_,sortOrder:A}))}),[]),w=b.useCallback((_=>{C(Vt({downloadState:_}))}),[]),R=b.useCallback((_=>{if(e)e(_.transactionId,_.transactionType);else if(m!=null){const A=La({id:_.transactionId,type:_.transactionType},m);g(A);const U=O(p.state?.pathnameStackToGoBack,p.pathname);g(A,{state:{pathnameStackToGoBack:U}})}}),[m,e]),T=b.useCallback((()=>{y.vendor!=null&&x.trackApAgingDetail("AP Aging",u.format(X.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),y.vendor.id,y.vendor.name)}),[y.vendor,u]);return b.useEffect((()=>{E()}),[]),b.useEffect((()=>{y.fetchState==="Completed"&&T()}),[T,y.fetchState]),d.jsx(Uo,{apAgingDetail:y,downloadParams:c,reportDate:u,analytics:x,onTransactionClick:R,onReload:E,onBackClick:v,onColumnSortConfigChanged:k,updateDownloadStateHandler:w,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})})),ls=()=>{const e=z(),a=W(),t=S((k=>xn(k))),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=se({mobileExploreReferrer:"AP Aging"});Ve({isDataReady:t.fetchState==="Completed"});const r=B.getSignedInUser(),s=S((k=>k.tenantState.currentTenantId)),i=S((k=>Y(k))),l=i?.companyName??"",m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},p=b.useMemo((()=>({authParams:m,companyName:l,downloadEndPoint:`${oe}/agingReport`,timezone:We()})),[]),h=t.apAgingUIState.selectedDate??Ee(),f=b.useCallback((()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(ft(h))}),[]);b.useEffect((()=>{f()}),[]);const c=b.useCallback((()=>{a("../",{relative:"path"})}),[]),u=b.useCallback((k=>{e(Qe({searchString:k}))}),[]),C=b.useCallback(((k,w)=>{e(Qe({sortKey:w,sortOrder:k}))}),[]),g=b.useCallback((k=>{a(`./${k}/${h.format(X.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)}),[h]),y=b.useCallback((k=>{e(Qe({downloadState:k}))}),[]),E=b.useCallback(((k,w)=>{}),[]),v=b.useCallback(((k,w)=>{e(Qe({selectedDate:k,agingDateSelectionType:w})),e(ft(k))}),[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(Ge,{analytics:x,onLoad:k=>k.trackPageLoaded(N.Event.agingReport,"AP Aging")}):null,d.jsx(Da,{uiState:t.apAgingUIState,report:t,downloadParams:p,analytics:x,onReloadReport:f,onBackClick:c,onSearchTextChange:u,onSortOrderChange:C,onEntityNameClick:g,updateDownloadStateHandler:y,onSelectedDateChanged:v,onNodeCollapseToggled:E,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},ds=Ua((function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=q(),s=B.getSignedInUser(),i=S((T=>Y(T))),{tenantEmailDomain:l}=q(),m=H(),p=i.companyName,h={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},f=b.useMemo((()=>({authParams:h,companyName:p,downloadEndPoint:`${oe}/agingDetailedReport`,timezone:We()})),[]),c=b.useMemo((()=>r!=null?sa(r):Ee()),[r]),u=z(),C=W(),g=S((T=>Tn(T,c,o))),y=b.useCallback((()=>{o!=null&&g.fetchState!=="In-Progress"&&g.fetchState!=="Completed"&&u(Dn(o,c))}),[c]),E=b.useCallback((()=>{C("../../",{relative:"path"})}),[]),v=b.useCallback(((T,_)=>{u(Gt({sortKey:T,sortOrder:_}))}),[]),k=b.useCallback((T=>{u(Gt({downloadState:T}))}),[]),w=b.useCallback((T=>{if(e)e(T.transactionId,T.transactionType);else if(l!=null){const _=La({id:T.transactionId,type:T.transactionType},l);C(_);const A=O(m.state?.pathnameStackToGoBack,m.pathname);C(_,{state:{pathnameStackToGoBack:A}})}}),[l,e]),R=b.useCallback((()=>{g.customer!=null&&x.trackArAgingDetail("AR Aging",c.format(X.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),g.customer.id,g.customer.name)}),[g.customer,c]);return b.useEffect((()=>{y()}),[]),b.useEffect((()=>{g.fetchState==="Completed"&&R()}),[g.fetchState,R]),d.jsx(Lo,{arAgingDetail:g,downloadParams:f,reportDate:c,analytics:x,onTransactionClick:w,onReload:y,onBackClick:E,onColumnSortConfigChanged:v,updateDownloadStateHandler:k,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})})),us=()=>{const e=z(),a=W(),t=S((v=>Pn(v))),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=se({mobileExploreReferrer:"AR Aging"});Ve({isDataReady:t.fetchState==="Completed"});const r=B.getSignedInUser(),s=S((v=>Y(v))),i=s.companyName,l={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},m=b.useMemo((()=>({authParams:l,companyName:i,downloadEndPoint:`${oe}/agingReport`,timezone:We()})),[]),p=t.arAgingUIState.selectedDate??Ee(),h=b.useCallback((()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(gt(p))}),[]);b.useEffect((()=>{h()}),[]);const f=b.useCallback((()=>{a("../",{relative:"path"})}),[]),c=b.useCallback((v=>{e(Ze({searchString:v}))}),[]),u=b.useCallback(((v,k)=>{e(Ze({sortKey:k,sortOrder:v}))}),[]),C=b.useCallback((v=>{a(`./${v}/${p.format(X.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)}),[p]),g=b.useCallback((v=>{e(Ze({downloadState:v}))}),[]),y=b.useCallback(((v,k)=>{e(Ze({selectedDate:v,agingDateSelectionType:k})),e(gt(v))}),[]),E=b.useCallback(((v,k)=>{e(On({nodeId:v,isCollapsed:k}))}),[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(Ge,{analytics:x,onLoad:v=>v.trackPageLoaded(N.Event.agingReport,"AR Aging")}):null,d.jsx(Da,{uiState:t.arAgingUIState,report:t,downloadParams:m,analytics:x,onReloadReport:h,onBackClick:f,onSearchTextChange:c,onSortOrderChange:u,onEntityNameClick:C,updateDownloadStateHandler:g,onSelectedDateChanged:y,onNodeCollapseToggled:E,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},Ga=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function Na(e,a){const t=jn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=De(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(Rn(n,o))}}}const ms=ne((function(e){const a=Fn(e).accountsInOrder.map(((t,n)=>Ga(t,n)));return{sectionTitle:X.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,fetchState:e.cashBalanceState.fetchState,analytics:x}}),Na)(Pa),ps=ne((function(e){const a=Mn(e).accountsInOrder.map(((o,r)=>Ga(o,r))),t=B.getSignedInUser(),n=Je(t);return{sectionTitle:X.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:x}}),Na)(Pa);function hs(){const e=W(),a=H(),{tenantEmailDomain:t}=q(),n=S((o=>Y(o).company?.companyInfo.firstMonthOfFY??1));return S((o=>o.cashBalanceState.fetchState))==="Error"?d.jsx(Me,{}):d.jsx(ms,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,firstMonthOfFY:n})}function fs(){const e=W(),a=H(),{tenantEmailDomain:t}=q(),n=S((o=>Y(o).company?.companyInfo.firstMonthOfFY??1));return S((o=>o.cardBalanceState.fetchState))==="Error"?d.jsx(Me,{}):d.jsx(ps,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,firstMonthOfFY:n})}const gs=xt.div`
2
2
  display: flex;
3
3
  flex: 1 1 auto;
4
4
  min-height: 100%;
5
5
  flex-direction: column;
6
6
  background-color: ${e=>e.theme.colors.grey4};
7
- `,bs=wt.div`
7
+ `,bs=xt.div`
8
8
  display: flex;
9
9
  flex: 1 1 auto;
10
10
  flex-direction: column;
11
11
  align-items: center;
12
12
  background-color: ${e=>e.theme.colors.grey4};
13
- `;function Cs({title:e,reportId:a,entityAutoCompleteView:t,autoCompleteText:n,isAiCfoAccessEnabled:o,onAskAiCfoClick:r}){const s=W(),i=z(),l=H(),{tenantEmailDomain:m}=q(),p=ns();return d.jsxs(gs,{children:[d.jsx(Vo,{source:a==="cash_balance"?"CashBalanceDetailScreen":"CardBalanceDetailScreen",title:e,onBackClick:()=>{s("../")},hideSearchBtn:!0,backgroundColor:p.colors.grey4,searchAutoComplete:{autoCompleteData:{entityAutoCompleteView:t,autoCompleteText:n},autoCompleteActions:{onAutoCompleteInputChange:h=>{h.trim().length>=2?i(de({searchString:h,searchOrigin:"navbar"})):h.trim().length===0&&i(ae("navbar"))},onAutoCompleteEntity:h=>{n!=null&&w?.trackSearch(N.Event.search,_s(a),h.type,h.name,n);const f=me(h,m),c=O(l.state?.pathnameStackToGoBack,l.pathname);s(f,{state:{pathnameStackToGoBack:c}})}}},rightSideComponent:d.jsx(Go,{isAiCfoAccessEnabled:o,onAskAiCfoClick:r})}),d.jsx(bs,{children:a==="cash_balance"?d.jsx(hs,{}):d.jsx(fs,{})})]})}function Qt(){const e=H(),a=z(),t=S((c=>c.cashBalanceState.fetchState)),n=S((c=>c.cardBalanceState.fetchState)),o=B.getSignedInUser();if(o==null)throw Error("Can't access dashboard detail without signing in...");const r=ra((c=>{const u=ia(c,"/").split("/");return u[u.length-1]})(e.pathname));let s="Not-Started",i="";const l=X.getLocalizedStrings();switch(r){case"cash_balance":s=t,i=l.common.texts.cashBalance;break;case"card_balance":s=n,i=l.reportTitleById.card_balance;break;default:console.error(`${r} is not supported!`)}const{isAiCfoAccessEnabled:m,onAskAiCfoClick:p}=se({mobileExploreReferrer:r==="card_balance"?"Card Balance":"Cash Balance"});Ve({isDataReady:s==="Completed"});const h=S((c=>c.entityAutoCompleteState.autoCompleteText.navbar)),f=S((c=>le(c,"navbar")));return b.useEffect((()=>{s==="Not-Started"&&(function(c,u){switch(u){case"card_balance":c(la());break;case"cash_balance":c(ca());break;default:throw new Error(`balance report type ${u} is not yet supported`)}})(a,r)}),[o,a,s]),d.jsxs(d.Fragment,{children:[s==="Completed"?d.jsx(Ge,{analytics:w,onLoad:c=>((u,C)=>{switch(C){case"card_balance":u.trackPageLoaded(N.Event.cardBalance);break;case"cash_balance":u.trackPageLoaded(N.Event.cashBalance);break;default:console.error(`Analytics: Not tracking Page Loaded for ${C}!`)}})(c,r)}):null,d.jsx(Cs,{title:i,reportId:r,autoCompleteText:h,entityAutoCompleteView:f,isAiCfoAccessEnabled:m,onAskAiCfoClick:p})]})}const _s=e=>{switch(e){case"cash_balance":return"Cash Balance";case"card_balance":return"Card Balance";default:return"Dashboard"}},Ss=[],Zt="insights_section";function ze(e){const{mobileExploreReferrer:a}=e,t=z(),n=W(),o=H(),{tenantEmailDomain:r}=q(),{setIsAiCfoOpen:s,setAiCfoSidePanelQuestionToSubmit:i}=Oa(),l=Fa(),m=Ba(l),p=oa(),h=S((F=>F.tenantState.fetchState==="Completed"||F.tenantState.activeTenantFetchState.fetchState==="Completed"?Y(F):void 0)),f=h?.masterTOSInfo?.isMasterTOSAccepted??!1,c=S((F=>da(F))),u=c.uiState?.currentChatSessionId,C=c.allSessionsWithOrderedQuestionAnswers??Ss,g=B.getSignedInUser()?.userId,y=ja(),E=No()&&y&&r!=null,I=$o(),k=zo(!0),x=S((F=>I!=null?Yn(F,I):void 0)),{useDynamicConfig:R}=xt(),{configValue:T}=R(Ra.aiCfoMessageDynamicConfig),_=b.useMemo((()=>Array.isArray(T.default_message_list)?T.default_message_list:[]),[T.default_message_list]),A=b.useMemo((()=>_.slice(0,2)),[_]),U=I!=null&&x!=null&&x.fetchState!=="Completed"&&x.fetchState!=="Error"&&(k||x.fetchState==="In-Progress"),pe=b.useMemo((()=>{if(I==null||x?.fetchState==="Error")return A;if(U)return[];const F=(x?.suggestedQuestions??[]).map((J=>J.trim())).filter((J=>J.length>0)).slice(0,2);return F.length===0?A:F}),[A,U,I,x?.fetchState,x?.suggestedQuestions]),Pe=b.useCallback(((F,J)=>{if(g==null||F.trim()==="")return;if(!f)return void re({location:o,navigate:n,mergeState:{referrer:a,aiCfoInitialQuestion:F,aiCfoInitialSubmissionSource:Zt,aiCfoSuggestionIndex:J}});const qe=Ma(p.getState());if(m){const Xe=O(o.state?.pathnameStackToGoBack,o.pathname);n(`/${r}/ai-cfo/explore`,{state:{message:"",origin:"",pathnameStackToGoBack:Xe,referrer:a,aiCfoInitialQuestion:F,aiCfoShouldSubmit:!qe}})}else{if(qe)return t(bt(F)),void s(!0);i(F),s(!0),Ya(t,F,Zt,u,C,g,J,void 0)}}),[C,u,t,f,m,o,a,n,s,i,p,r,g]),_e=b.useCallback((()=>{if(f)if(m){const F=O(o.state?.pathnameStackToGoBack,o.pathname);n(`/${r}/ai-cfo/explore`,{state:{message:"",origin:"",pathnameStackToGoBack:F,referrer:a}})}else s(!0);else re({location:o,navigate:n,mergeState:{referrer:a}})}),[f,m,o,a,n,s,r]);return b.useMemo((()=>{if(E)return{isSuggestedQuestionsLoading:U,onAskSomethingElseClick:_e,onSuggestedQuestionClick:Pe,suggestedQuestions:pe}}),[E,U,_e,Pe,pe])}const Ke=Ko,ks=ne((function(e){const a=Bn(e),t=Un(e),n=ua(e),{scrollPosition:o,...r}=n,s=X.getLocalizedStrings().reportTitleById.cash_in_cash_out,i=B.getSignedInUser(),l=e.tenantState.currentTenantId,m=Y(e),p=m?.companyName??"",h={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:l??""},f=e.entityAutoCompleteState.autoCompleteText.navbar,c=le(e,"navbar");return{selectedRangeReport:a,reportLabels:{reportTitle:s},highlightedRangeReport:t,uiState:r,scrollPosition:o,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:p,statementEndPoint:`${oe}/statement`,authParams:h},analytics:w,autoCompleteData:{autoCompleteText:f,entityAutoCompleteView:c}}}),(function(e,a){return{updateDownloadStateHandler:t=>{e(Ln(t))},onTimeframeSelectionChanged:()=>{},onCOABalancesRangeChanged:(t,n)=>{e(Ue(t,n)),e(Oe({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(xe("month")),e(ue(a.firstMonthOfFY,t)),e(Oe({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Ye(a.firstMonthOfFY,t,o,n)),n.length>0&&e(Be(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.isCompareModeOn!==t&&setTimeout((()=>e(Oe({resetLeftScroll:!0}))),50)},onElementCollapseStateChanged:(t,n)=>{e(Oe({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(Oe({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(de({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(ae("navbar"))},onAutoCompleteEntity:t=>{const n=me(t,a.tenantEmailDomain),o=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.navigate("../")}}}))(Ke),ys=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e,o=Ne(),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=se({mobileExploreReferrer:"DashboardCashInCashOut"}),i=ze({mobileExploreReferrer:"DashboardCashInCashOut"}),l=S((m=>ua(m))).mode==="compare_mode";return d.jsx(ks,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:a,location:t,isCompareModeOn:l,navigate:n,insightsSectionAiCfoInfo:i,isAiCfoAccessEnabled:r,onAskAiCfoClick:s,meetingUrl:Le(o("dashboard_report_filters"))})},As=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=et(e);break;case"year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;case"free_range":console.error("free_range timeframe is not supported!")}return{timeframe:a,timePeriod:t}},Is=ne((function(e){const a=Vn(e),t=Gn(e),n=ma(e),{scrollPosition:o,...r}=n,s=X.getLocalizedStrings().reportTitleById.cash_position,i=B.getSignedInUser(),l=e.tenantState.currentTenantId,m=Y(e),p=m?.companyName??"",h={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:l??""},f=e.entityAutoCompleteState.autoCompleteText.navbar,c=le(e,"navbar");return{selectedRangeReport:a,reportLabels:{reportTitle:s},highlightedRangeReport:t,uiState:r,scrollPosition:o,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:p,statementEndPoint:`${oe}/statement`,authParams:h},analytics:w,autoCompleteData:{autoCompleteText:f,entityAutoCompleteView:c}}}),(function(e,a){return{updateDownloadStateHandler:t=>{e(Nn(t))},onTimeframeSelectionChanged:t=>{e(xe(t)),setTimeout((()=>e(Fe({resetLeftScroll:!0}))),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ue(t,n)),e(Fe({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(ue(a.firstMonthOfFY,t)),e(Fe({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Ye(a.firstMonthOfFY,t,o,n)),n.length>0&&e(Be(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.isCompareModeOn!==t&&setTimeout((()=>e(Fe({resetLeftScroll:!0}))),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=As(n),s=t.accountName===""?t.accountDescription:t.accountName;if(o!=null&&r!=null){const i=De(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),l=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:l,referrer:"Cash Position"}})}},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(de({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(ae("navbar"))},onAutoCompleteEntity:t=>{const n=me(t,a.tenantEmailDomain),o=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onTableScroll:t=>{e(Fe({scrollPosition:t}))},onBackClick:()=>{a.navigate("../")}}}))(Ke),vs=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e,o=Ne(),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=se({mobileExploreReferrer:"DashboardCashPosition"}),i=ze({mobileExploreReferrer:"DashboardCashPosition"}),l=S((m=>ma(m))).mode==="compare_mode";return d.jsx(Is,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:a,location:t,isCompareModeOn:l,navigate:n,insightsSectionAiCfoInfo:i,isAiCfoAccessEnabled:r,onAskAiCfoClick:s,meetingUrl:Le(o("dashboard_report_filters"))})},$=(e,a,t,n)=>{e===!1?a!=null&&n("../../",{relative:"path"}):a!==t&&(a!=null&&a.length>0?n(`../${t}`,{replace:!0}):n(`./forecast/${t}`,{replace:!0}))},Es=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=et(e);break;case"year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;case"free_range":console.error("free_range timeframe is not supported!")}return{timeframe:a,timePeriod:t}},xs=ne((function(e){const a=pa(e),t=$n(e),n=ha(e),o=zn(e),r=Kn(e),s=qn(e),i=_t(e),{scrollPosition:l,...m}=i,p=t.reportTitle,h=B.getSignedInUser(),f=e.tenantState.currentTenantId,c=Y(e),u=c?.companyName??"",C={userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:f??""},g=e.entityAutoCompleteState.autoCompleteText.navbar,y=le(e,"navbar"),E=St(c);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,selectedProjectViewRangeReport:r,reportLabels:{reportTitle:p},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,highlightedProjectViewRangeReport:s,uiState:m,scrollPosition:l,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:u,statementEndPoint:`${oe}/statement`,authParams:C},analytics:w,isZeniUser:Je(h),autoCompleteData:{autoCompleteText:g,entityAutoCompleteView:y},isZeniCOAUsed:E,isAccountingClassesEnabled:Te(e),isAccountingProjectsEnabled:we(e)}}),(function(e,a){return{updateDownloadStateHandler:t=>{e(Jn(t))},onTimeframeSelectionChanged:t=>{e(xe(t)),setTimeout((()=>e(ge({resetLeftScroll:!0}))),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ue(t,n)),e(ge({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(ue(a.firstMonthOfFY,t)),e(ge({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Ye(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Be(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&$(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout((()=>e(ge({resetLeftScroll:!0}))),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=Es(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.projectsViewParentId?.projectId!=null?Tt(a.tenantEmailDomain,t.accountId,t.accountType,t.projectsViewParentId.projectId,s,r,o):t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?Dt(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):De(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),l=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:l,referrer:"Burn Rate"}})}},onElementCollapseStateChanged:(t,n)=>{a.accountViewMode!=="project"?e(ge({nodeCollapseState:{nodeId:t,isCollapsed:n}})):e($t({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{a.accountViewMode!=="project"?e(ge({scrollPosition:t})):e($t({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(de({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(ae("navbar"))},onAutoCompleteEntity:t=>{const n=me(t,a.tenantEmailDomain),o=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.selectedForecastId!=null?a.navigate("../../../"):a.navigate("../")},onForecastToggle:(t,n)=>{e(Ie(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?3:1,n)),t==="forecast_mode"?(e(Nt({viewMode:"account_group"})),e(fa(!1,n?.id)),n!=null&&$(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):$(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(ge({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":t==="project"?"Projects":"Accounts","Burn Rate"),e(Nt({viewMode:t})),e(Wn({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(Hn({classesToFilterOut:t}))},onUpdateProjectsToFilterOut:t=>{e(Zn({projectsToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e(Xn()),a.isAccountingProjectsEnabled&&e(Qn())},onResyncReports:()=>{e(kt(a.accountViewMode==="project"?"net_burn_or_income_by_projects":"net_burn_or_income_by_classes"))}}}))(Ke),ws=e=>{const a=z(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,s=Ne(),{isAiCfoAccessEnabled:i,onAskAiCfoClick:l}=se({mobileExploreReferrer:"DashboardNetBurnOrIncome"}),m=ze({mobileExploreReferrer:"DashboardNetBurnOrIncome"}),p=S((_=>_t(_))),h=p.isForecastModeOn,f=p.timeframe,c=p.selectedForecast?.id,u=S((_=>yt(_.forecastState,c??""))),C=S((_=>pa(_))),g=S((_=>At(_))),y=S((_=>Te(_))),E=S((_=>we(_))),I=S((_=>ha(_).uiState.accountViewMode)),k=p.mode==="compare_mode",x=C.dataAvailable;b.useEffect((()=>{if(c!=null&&h===!0&&($(h,r,c,o),u!=null)){const _=u?.forecastPeriod,A=x!=null&&_.endDate.isAfter(x?.endDate)===!0?x:_;a(ue(e.firstMonthOfFY,{startDate:A.endDate.startOf(f),endDate:A?.endDate}))}}),[c]);const R=$e(),T=Pt(R?.currentTenant?.companyId,{clearParams:C.fetchState==="Completed"});return d.jsx(xs,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,forecastIdFromUrlPath:r,location:n,isAccountingClassesEnabled:y,isAccountingProjectsEnabled:E,accountViewMode:I,isCompareModeOn:k,navigate:o,analytics:w,reportsResyncFetchState:g.reportsResyncFetchState,insightsSectionAiCfoInfo:m,isAiCfoAccessEnabled:i,onAskAiCfoClick:l,initialOpenThreadRequest:T,meetingUrl:Le(s("dashboard_report_filters"))})},Ts=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=et(e);break;case"year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;case"free_range":console.error("free_range timeframe is not supported!")}return{timeframe:a,timePeriod:t}},Ds=ne((function(e){const a=ga(e),t=eo(e),n=ba(e),o=to(e),r=ao(e),s=no(e),i=It(e),{scrollPosition:l,...m}=i,p=X.getLocalizedStrings().common.texts.operatingExpenses,h=B.getSignedInUser(),f=e.tenantState.currentTenantId,c=Y(e),u=c?.companyName??"",C={userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:f??""},g=e.entityAutoCompleteState.autoCompleteText.navbar,y=le(e,"navbar"),E=St(c);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,selectedProjectViewRangeReport:r,reportLabels:{reportTitle:p},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,highlightedProjectViewRangeReport:s,uiState:m,scrollPosition:l,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:u,statementEndPoint:`${oe}/statement`,authParams:C},analytics:w,isZeniUser:Je(h),autoCompleteData:{autoCompleteText:g,entityAutoCompleteView:y},isZeniCOAUsed:E,isAccountingClassesEnabled:Te(e),isAccountingProjectsEnabled:we(e)}}),(function(e,a){return{updateDownloadStateHandler:t=>{e(lo(t))},onTimeframeSelectionChanged:t=>{e(xe(t)),setTimeout((()=>e(be({resetLeftScroll:!0}))),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ue(t,n)),e(be({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(ue(a.firstMonthOfFY,t)),e(be({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Ye(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Be(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&$(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout((()=>e(be({resetLeftScroll:!0}))),50)},onAccountBalanceClick:a.hasTransactionAccess!==!0?void 0:(t,n)=>{const{timePeriod:o,timeframe:r}=Ts(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.projectsViewParentId?.projectId!=null?Tt(a.tenantEmailDomain,t.accountId,t.accountType,t.projectsViewParentId.projectId,s,r,o):t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?Dt(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):De(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),l=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:l,referrer:"Operating Expenses"}})}},onElementCollapseStateChanged:(t,n)=>{a.accountViewMode!=="project"?e(be({nodeCollapseState:{nodeId:t,isCollapsed:n}})):e(Kt({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{a.accountViewMode!=="project"?e(be({scrollPosition:t})):e(Kt({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(de({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(ae("navbar"))},onAutoCompleteEntity:t=>{const n=me(t,a.tenantEmailDomain),o=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.selectedForecastId!=null?a.navigate("../../../"):a.navigate("../")},onForecastToggle:(t,n)=>{e(Ie(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?3:1,n)),t=="forecast_mode"?(e(zt({viewMode:"account_group"})),e(Ca(!1,n?.id)),n!=null&&$(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):$(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(be({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":t==="project"?"Projects":"Accounts","Operating Expenses"),e(zt({viewMode:t})),e(co({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(io({classesToFilterOut:t}))},onUpdateProjectsToFilterOut:t=>{e(ro({projectsToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e(oo()),a.isAccountingProjectsEnabled&&e(so())},onResyncReports:()=>{e(kt(a.accountViewMode==="project"?"operating_expenses_by_projects":"operating_expenses_by_classes"))}}}))(Ke),Ps=e=>{const a=z(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,s=Ne(),{isAiCfoAccessEnabled:i,onAskAiCfoClick:l}=se({mobileExploreReferrer:"DashboardOpEx"}),m=ze({mobileExploreReferrer:"DashboardOpEx"}),p=S((A=>It(A))),h=p.isForecastModeOn,f=p.timeframe,c=p.selectedForecast?.id,u=S((A=>yt(A.forecastState,c??""))),C=S((A=>ga(A))),g=S((A=>At(A))),y=S((A=>Te(A))),E=S((A=>we(A))),I=S((A=>ba(A).uiState.accountViewMode)),k=p.mode==="compare_mode",x=C.dataAvailable;b.useEffect((()=>{if(c!=null&&h===!0&&($(h,r,c,o),u!=null)){const A=u?.forecastPeriod,U=x!=null&&A.endDate.isAfter(x?.endDate)===!0?x:A;a(ue(e.firstMonthOfFY,{startDate:U.endDate.startOf(f),endDate:U?.endDate}))}}),[c]);const R=$e(),T=R?.loggedInUserRole!=null&&_a(R?.loggedInUserRole)!==!0,_=Pt(R?.currentTenant?.companyId,{clearParams:C.fetchState==="Completed"});return d.jsx(Ds,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,location:n,isAccountingClassesEnabled:y,isAccountingProjectsEnabled:E,accountViewMode:I,isCompareModeOn:k,navigate:o,forecastIdFromUrlPath:r,analytics:w,hasTransactionAccess:T,reportsResyncFetchState:g.reportsResyncFetchState,insightsSectionAiCfoInfo:m,isAiCfoAccessEnabled:i,onAskAiCfoClick:l,initialOpenThreadRequest:_,meetingUrl:Le(s("dashboard_report_filters"))})},Os=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=et(e);break;case"year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;case"free_range":console.error("free_range timeframe is not supported!")}return{timeframe:a,timePeriod:t}},Fs=ne((function(e){const a=Sa(e),t=uo(e),n=ka(e),o=mo(e),r=po(e),s=ho(e),i=vt(e),{scrollPosition:l,...m}=i,p=X.getLocalizedStrings().common.texts.revenue,h=B.getSignedInUser(),f=e.tenantState.currentTenantId,c=Y(e),u=c?.companyName??"",C={userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:f??""},g=e.entityAutoCompleteState.autoCompleteText.navbar,y=le(e,"navbar"),E=St(c);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,selectedProjectViewRangeReport:r,reportLabels:{reportTitle:p},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,highlightedProjectViewRangeReport:s,uiState:m,scrollPosition:l,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:u,statementEndPoint:`${oe}/statement`,authParams:C},analytics:w,isZeniUser:Je(h),autoCompleteData:{autoCompleteText:g,entityAutoCompleteView:y},isZeniCOAUsed:E,isAccountingClassesEnabled:Te(e),isAccountingProjectsEnabled:we(e)}}),(function(e,a){return{updateDownloadStateHandler:t=>{e(So(t))},onTimeframeSelectionChanged:t=>{e(xe(t)),setTimeout((()=>e(Ce({resetLeftScroll:!0}))),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ue(t,n)),e(Ce({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(ue(a.firstMonthOfFY,t)),e(Ce({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Ye(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Be(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&$(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout((()=>e(Ce({resetLeftScroll:!0}))),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=Os(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.projectsViewParentId?.projectId!=null?Tt(a.tenantEmailDomain,t.accountId,t.accountType,t.projectsViewParentId.projectId,s,r,o):t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?Dt(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):De(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),l=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:l,referrer:"Revenues"}})}},onElementCollapseStateChanged:(t,n)=>{a.accountViewMode!=="project"?e(Ce({nodeCollapseState:{nodeId:t,isCollapsed:n}})):e(Xt({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{a.accountViewMode!=="project"?e(Ce({scrollPosition:t})):e(Xt({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(de({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(ae("navbar"))},onAutoCompleteEntity:t=>{const n=me(t,a.tenantEmailDomain),o=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.selectedForecastId!=null?a.navigate("../../../"):a.navigate("../")},onForecastToggle:(t,n)=>{e(Ie(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?3:1,n)),t==="forecast_mode"?(e(qt({viewMode:"account_group"})),e(ya(!1,n?.id)),n!=null&&$(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):$(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(Ce({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":t==="project"?"Projects":"Accounts","Revenues"),e(qt({viewMode:t})),e(_o({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(Co({classesToFilterOut:t}))},onUpdateProjectsToFilterOut:t=>{e(bo({projectsToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e(fo()),a.isAccountingProjectsEnabled&&e(go())},onResyncReports:()=>{e(kt(a.accountViewMode==="project"?"revenue_by_projects":"revenue_by_classes"))}}}))(Ke),js=e=>{const a=z(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,s=Ne(),{isAiCfoAccessEnabled:i,onAskAiCfoClick:l}=se({mobileExploreReferrer:"DashboardRevenue"}),m=ze({mobileExploreReferrer:"DashboardRevenue"}),p=S((_=>vt(_))),h=p.isForecastModeOn,f=p.timeframe,c=p.selectedForecast?.id,u=S((_=>yt(_.forecastState,c??""))),C=S((_=>Sa(_))),g=C.dataAvailable,y=p.mode==="compare_mode",E=S((_=>Te(_))),I=S((_=>we(_))),k=S((_=>ka(_).uiState.accountViewMode)),x=S((_=>At(_)));b.useEffect((()=>{if(c!=null&&h===!0&&($(h,r,c,o),u!=null)){const _=u?.forecastPeriod,A=g!=null&&_.endDate.isAfter(g?.endDate)===!0?g:_;a(ue(e.firstMonthOfFY,{startDate:A.endDate.startOf(f),endDate:A?.endDate}))}}),[c]);const R=$e(),T=Pt(R?.currentTenant?.companyId,{clearParams:C.fetchState==="Completed"});return d.jsx(Fs,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,isAccountingClassesEnabled:E,isAccountingProjectsEnabled:I,accountViewMode:k,isCompareModeOn:y,location:n,navigate:o,forecastIdFromUrlPath:r,analytics:w,reportsResyncFetchState:x.reportsResyncFetchState,insightsSectionAiCfoInfo:m,isAiCfoAccessEnabled:i,onAskAiCfoClick:l,initialOpenThreadRequest:T,meetingUrl:Le(s("dashboard_report_filters"))})},Rs=e=>{let a,t;if(e.endDate!=null)switch(e.timePeriod){case"this_month_to_date":case"last_month":case"this_week_to_date":case"last_week":a="month",t={startDate:e.endDate.startOf("month"),endDate:e.endDate};break;case"last_3_months":case"last_6_months":case"last_12_months":case"this_year_to_date":case"last_year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;default:console.error(`this timeperiod ${e.timePeriod} is not supported!`)}return{timeframe:a,timePeriod:t}},Ms=ne((function(e){const a=ko(e),t=e.entityAutoCompleteState.autoCompleteText.navbar,n=le(e,"navbar");return{report:a,analytics:w,autoCompleteData:{autoCompleteText:t,entityAutoCompleteView:n}}}),(function(e,a){return{onTimeframeSelectionChanged:t=>{w.trackTimeframeSwitch(Va(t),"Top Expenses"),e(Aa(t))},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=Rs(n),s=t.accountName===""?t.accountDescription:t.accountName;if(o!=null&&r!=null){const i=De(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),l=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:l,referrer:"Top Expenses"}})}},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(de({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(ae("navbar"))},onAutoCompleteEntity:t=>{const n=me(t,a.tenantEmailDomain),o=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.navigate("../")}}}))(qo),Ys=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e;return d.jsx(Ms,{tenantEmailDomain:a,location:t,navigate:n})},Bs=wt.div`
13
+ `;function Cs({title:e,reportId:a,entityAutoCompleteView:t,autoCompleteText:n,isAiCfoAccessEnabled:o,onAskAiCfoClick:r}){const s=W(),i=z(),l=H(),{tenantEmailDomain:m}=q(),p=ns();return d.jsxs(gs,{children:[d.jsx(Vo,{source:a==="cash_balance"?"CashBalanceDetailScreen":"CardBalanceDetailScreen",title:e,onBackClick:()=>{s("../")},hideSearchBtn:!0,backgroundColor:p.colors.grey4,searchAutoComplete:{autoCompleteData:{entityAutoCompleteView:t,autoCompleteText:n},autoCompleteActions:{onAutoCompleteInputChange:h=>{h.trim().length>=2?i(de({searchString:h,searchOrigin:"navbar"})):h.trim().length===0&&i(ae("navbar"))},onAutoCompleteEntity:h=>{n!=null&&x?.trackSearch(N.Event.search,_s(a),h.type,h.name,n);const f=me(h,m),c=O(l.state?.pathnameStackToGoBack,l.pathname);s(f,{state:{pathnameStackToGoBack:c}})}}},rightSideComponent:d.jsx(Go,{isAiCfoAccessEnabled:o,onAskAiCfoClick:r})}),d.jsx(bs,{children:a==="cash_balance"?d.jsx(hs,{}):d.jsx(fs,{})})]})}function Qt(){const e=H(),a=z(),t=S((c=>c.cashBalanceState.fetchState)),n=S((c=>c.cardBalanceState.fetchState)),o=B.getSignedInUser();if(o==null)throw Error("Can't access dashboard detail without signing in...");const r=ra((c=>{const u=ia(c,"/").split("/");return u[u.length-1]})(e.pathname));let s="Not-Started",i="";const l=X.getLocalizedStrings();switch(r){case"cash_balance":s=t,i=l.common.texts.cashBalance;break;case"card_balance":s=n,i=l.reportTitleById.card_balance;break;default:console.error(`${r} is not supported!`)}const{isAiCfoAccessEnabled:m,onAskAiCfoClick:p}=se({mobileExploreReferrer:r==="card_balance"?"Card Balance":"Cash Balance"});Ve({isDataReady:s==="Completed"});const h=S((c=>c.entityAutoCompleteState.autoCompleteText.navbar)),f=S((c=>le(c,"navbar")));return b.useEffect((()=>{s==="Not-Started"&&(function(c,u){switch(u){case"card_balance":c(la());break;case"cash_balance":c(ca());break;default:throw new Error(`balance report type ${u} is not yet supported`)}})(a,r)}),[o,a,s]),d.jsxs(d.Fragment,{children:[s==="Completed"?d.jsx(Ge,{analytics:x,onLoad:c=>((u,C)=>{switch(C){case"card_balance":u.trackPageLoaded(N.Event.cardBalance);break;case"cash_balance":u.trackPageLoaded(N.Event.cashBalance);break;default:console.error(`Analytics: Not tracking Page Loaded for ${C}!`)}})(c,r)}):null,d.jsx(Cs,{title:i,reportId:r,autoCompleteText:h,entityAutoCompleteView:f,isAiCfoAccessEnabled:m,onAskAiCfoClick:p})]})}const _s=e=>{switch(e){case"cash_balance":return"Cash Balance";case"card_balance":return"Card Balance";default:return"Dashboard"}},Ss=[],Zt="insights_section";function ze(e){const{mobileExploreReferrer:a}=e,t=z(),n=W(),o=H(),{tenantEmailDomain:r}=q(),{setIsAiCfoOpen:s,setAiCfoSidePanelQuestionToSubmit:i}=Oa(),l=Fa(),m=Ba(l),p=oa(),h=S((F=>F.tenantState.fetchState==="Completed"||F.tenantState.activeTenantFetchState.fetchState==="Completed"?Y(F):void 0)),f=h?.masterTOSInfo?.isMasterTOSAccepted??!1,c=S((F=>da(F))),u=c.uiState?.currentChatSessionId,C=c.allSessionsWithOrderedQuestionAnswers??Ss,g=B.getSignedInUser()?.userId,y=ja(),E=No()&&y&&r!=null,v=$o(),k=zo(!0),w=S((F=>v!=null?Yn(F,v):void 0)),{useDynamicConfig:R}=wt(),{configValue:T}=R(Ra.aiCfoMessageDynamicConfig),_=b.useMemo((()=>Array.isArray(T.default_message_list)?T.default_message_list:[]),[T.default_message_list]),A=b.useMemo((()=>_.slice(0,2)),[_]),U=v!=null&&w!=null&&w.fetchState!=="Completed"&&w.fetchState!=="Error"&&(k||w.fetchState==="In-Progress"),pe=b.useMemo((()=>{if(v==null||w?.fetchState==="Error")return A;if(U)return[];const F=(w?.suggestedQuestions??[]).map((J=>J.trim())).filter((J=>J.length>0)).slice(0,2);return F.length===0?A:F}),[A,U,v,w?.fetchState,w?.suggestedQuestions]),Pe=b.useCallback(((F,J)=>{if(g==null||F.trim()==="")return;if(!f)return void re({location:o,navigate:n,mergeState:{referrer:a,aiCfoInitialQuestion:F,aiCfoInitialSubmissionSource:Zt,aiCfoSuggestionIndex:J}});const qe=Ma(p.getState());if(m){const Xe=O(o.state?.pathnameStackToGoBack,o.pathname);n(`/${r}/ai-cfo/explore`,{state:{message:"",origin:"",pathnameStackToGoBack:Xe,referrer:a,aiCfoInitialQuestion:F,aiCfoShouldSubmit:!qe}})}else{if(qe)return t(bt(F)),void s(!0);i(F),s(!0),Ya(t,F,Zt,u,C,g,J,void 0)}}),[C,u,t,f,m,o,a,n,s,i,p,r,g]),_e=b.useCallback((()=>{if(f)if(m){const F=O(o.state?.pathnameStackToGoBack,o.pathname);n(`/${r}/ai-cfo/explore`,{state:{message:"",origin:"",pathnameStackToGoBack:F,referrer:a}})}else s(!0);else re({location:o,navigate:n,mergeState:{referrer:a}})}),[f,m,o,a,n,s,r]);return b.useMemo((()=>{if(E)return{isSuggestedQuestionsLoading:U,onAskSomethingElseClick:_e,onSuggestedQuestionClick:Pe,suggestedQuestions:pe}}),[E,U,_e,Pe,pe])}const Ke=Ko,ks=ne((function(e){const a=Bn(e),t=Un(e),n=ua(e),{scrollPosition:o,...r}=n,s=X.getLocalizedStrings().reportTitleById.cash_in_cash_out,i=B.getSignedInUser(),l=e.tenantState.currentTenantId,m=Y(e),p=m?.companyName??"",h={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:l??""},f=e.entityAutoCompleteState.autoCompleteText.navbar,c=le(e,"navbar");return{selectedRangeReport:a,reportLabels:{reportTitle:s},highlightedRangeReport:t,uiState:r,scrollPosition:o,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:p,statementEndPoint:`${oe}/statement`,authParams:h},analytics:x,autoCompleteData:{autoCompleteText:f,entityAutoCompleteView:c}}}),(function(e,a){return{updateDownloadStateHandler:t=>{e(Ln(t))},onTimeframeSelectionChanged:()=>{},onCOABalancesRangeChanged:(t,n)=>{e(Ue(t,n)),e(Oe({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(we("month")),e(ue(a.firstMonthOfFY,t)),e(Oe({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Ye(a.firstMonthOfFY,t,o,n)),n.length>0&&e(Be(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.isCompareModeOn!==t&&setTimeout((()=>e(Oe({resetLeftScroll:!0}))),50)},onElementCollapseStateChanged:(t,n)=>{e(Oe({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(Oe({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(de({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(ae("navbar"))},onAutoCompleteEntity:t=>{const n=me(t,a.tenantEmailDomain),o=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.navigate("../")}}}))(Ke),ys=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e,o=Ne(),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=se({mobileExploreReferrer:"DashboardCashInCashOut"}),i=ze({mobileExploreReferrer:"DashboardCashInCashOut"}),l=S((m=>ua(m))).mode==="compare_mode";return d.jsx(ks,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:a,location:t,isCompareModeOn:l,navigate:n,insightsSectionAiCfoInfo:i,isAiCfoAccessEnabled:r,onAskAiCfoClick:s,meetingUrl:Le(o("dashboard_report_filters"))})},As=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=et(e);break;case"year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;case"free_range":console.error("free_range timeframe is not supported!")}return{timeframe:a,timePeriod:t}},vs=ne((function(e){const a=Vn(e),t=Gn(e),n=ma(e),{scrollPosition:o,...r}=n,s=X.getLocalizedStrings().reportTitleById.cash_position,i=B.getSignedInUser(),l=e.tenantState.currentTenantId,m=Y(e),p=m?.companyName??"",h={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:l??""},f=e.entityAutoCompleteState.autoCompleteText.navbar,c=le(e,"navbar");return{selectedRangeReport:a,reportLabels:{reportTitle:s},highlightedRangeReport:t,uiState:r,scrollPosition:o,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:p,statementEndPoint:`${oe}/statement`,authParams:h},analytics:x,autoCompleteData:{autoCompleteText:f,entityAutoCompleteView:c}}}),(function(e,a){return{updateDownloadStateHandler:t=>{e(Nn(t))},onTimeframeSelectionChanged:t=>{e(we(t)),setTimeout((()=>e(Fe({resetLeftScroll:!0}))),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ue(t,n)),e(Fe({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(ue(a.firstMonthOfFY,t)),e(Fe({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Ye(a.firstMonthOfFY,t,o,n)),n.length>0&&e(Be(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.isCompareModeOn!==t&&setTimeout((()=>e(Fe({resetLeftScroll:!0}))),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=As(n),s=t.accountName===""?t.accountDescription:t.accountName;if(o!=null&&r!=null){const i=De(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),l=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:l,referrer:"Cash Position"}})}},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(de({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(ae("navbar"))},onAutoCompleteEntity:t=>{const n=me(t,a.tenantEmailDomain),o=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onTableScroll:t=>{e(Fe({scrollPosition:t}))},onBackClick:()=>{a.navigate("../")}}}))(Ke),Is=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e,o=Ne(),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=se({mobileExploreReferrer:"DashboardCashPosition"}),i=ze({mobileExploreReferrer:"DashboardCashPosition"}),l=S((m=>ma(m))).mode==="compare_mode";return d.jsx(vs,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:a,location:t,isCompareModeOn:l,navigate:n,insightsSectionAiCfoInfo:i,isAiCfoAccessEnabled:r,onAskAiCfoClick:s,meetingUrl:Le(o("dashboard_report_filters"))})},$=(e,a,t,n)=>{e===!1?a!=null&&n("../../",{relative:"path"}):a!==t&&(a!=null&&a.length>0?n(`../${t}`,{replace:!0}):n(`./forecast/${t}`,{replace:!0}))},Es=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=et(e);break;case"year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;case"free_range":console.error("free_range timeframe is not supported!")}return{timeframe:a,timePeriod:t}},ws=ne((function(e){const a=pa(e),t=$n(e),n=ha(e),o=zn(e),r=Kn(e),s=qn(e),i=_t(e),{scrollPosition:l,...m}=i,p=t.reportTitle,h=B.getSignedInUser(),f=e.tenantState.currentTenantId,c=Y(e),u=c?.companyName??"",C={userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:f??""},g=e.entityAutoCompleteState.autoCompleteText.navbar,y=le(e,"navbar"),E=St(c);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,selectedProjectViewRangeReport:r,reportLabels:{reportTitle:p},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,highlightedProjectViewRangeReport:s,uiState:m,scrollPosition:l,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:u,statementEndPoint:`${oe}/statement`,authParams:C},analytics:x,isZeniUser:Je(h),autoCompleteData:{autoCompleteText:g,entityAutoCompleteView:y},isZeniCOAUsed:E,isAccountingClassesEnabled:Te(e),isAccountingProjectsEnabled:xe(e)}}),(function(e,a){return{updateDownloadStateHandler:t=>{e(Jn(t))},onTimeframeSelectionChanged:t=>{e(we(t)),setTimeout((()=>e(ge({resetLeftScroll:!0}))),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ue(t,n)),e(ge({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(ue(a.firstMonthOfFY,t)),e(ge({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Ye(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Be(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&$(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout((()=>e(ge({resetLeftScroll:!0}))),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=Es(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.projectsViewParentId?.projectId!=null?Tt(a.tenantEmailDomain,t.accountId,t.accountType,t.projectsViewParentId.projectId,s,r,o):t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?Dt(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):De(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),l=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:l,referrer:"Burn Rate"}})}},onElementCollapseStateChanged:(t,n)=>{a.accountViewMode!=="project"?e(ge({nodeCollapseState:{nodeId:t,isCollapsed:n}})):e($t({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{a.accountViewMode!=="project"?e(ge({scrollPosition:t})):e($t({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(de({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(ae("navbar"))},onAutoCompleteEntity:t=>{const n=me(t,a.tenantEmailDomain),o=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.selectedForecastId!=null?a.navigate("../../../"):a.navigate("../")},onForecastToggle:(t,n)=>{e(ve(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?3:1,n)),t==="forecast_mode"?(e(Nt({viewMode:"account_group"})),e(fa(!1,n?.id)),n!=null&&$(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):$(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(ge({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":t==="project"?"Projects":"Accounts","Burn Rate"),e(Nt({viewMode:t})),e(Wn({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(Hn({classesToFilterOut:t}))},onUpdateProjectsToFilterOut:t=>{e(Zn({projectsToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e(Xn()),a.isAccountingProjectsEnabled&&e(Qn())},onResyncReports:()=>{e(kt(a.accountViewMode==="project"?"net_burn_or_income_by_projects":"net_burn_or_income_by_classes"))}}}))(Ke),xs=e=>{const a=z(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,s=Ne(),{isAiCfoAccessEnabled:i,onAskAiCfoClick:l}=se({mobileExploreReferrer:"DashboardNetBurnOrIncome"}),m=ze({mobileExploreReferrer:"DashboardNetBurnOrIncome"}),p=S((_=>_t(_))),h=p.isForecastModeOn,f=p.timeframe,c=p.selectedForecast?.id,u=S((_=>yt(_.forecastState,c??""))),C=S((_=>pa(_))),g=S((_=>At(_))),y=S((_=>Te(_))),E=S((_=>xe(_))),v=S((_=>ha(_).uiState.accountViewMode)),k=p.mode==="compare_mode",w=C.dataAvailable;b.useEffect((()=>{if(c!=null&&h===!0&&($(h,r,c,o),u!=null)){const _=u?.forecastPeriod,A=w!=null&&_.endDate.isAfter(w?.endDate)===!0?w:_;a(ue(e.firstMonthOfFY,{startDate:A.endDate.startOf(f),endDate:A?.endDate}))}}),[c]);const R=$e(),T=Pt(R?.currentTenant?.companyId,{clearParams:C.fetchState==="Completed"});return d.jsx(ws,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,forecastIdFromUrlPath:r,location:n,isAccountingClassesEnabled:y,isAccountingProjectsEnabled:E,accountViewMode:v,isCompareModeOn:k,navigate:o,analytics:x,reportsResyncFetchState:g.reportsResyncFetchState,insightsSectionAiCfoInfo:m,isAiCfoAccessEnabled:i,onAskAiCfoClick:l,initialOpenThreadRequest:T,meetingUrl:Le(s("dashboard_report_filters"))})},Ts=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=et(e);break;case"year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;case"free_range":console.error("free_range timeframe is not supported!")}return{timeframe:a,timePeriod:t}},Ds=ne((function(e){const a=ga(e),t=eo(e),n=ba(e),o=to(e),r=ao(e),s=no(e),i=vt(e),{scrollPosition:l,...m}=i,p=X.getLocalizedStrings().common.texts.operatingExpenses,h=B.getSignedInUser(),f=e.tenantState.currentTenantId,c=Y(e),u=c?.companyName??"",C={userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:f??""},g=e.entityAutoCompleteState.autoCompleteText.navbar,y=le(e,"navbar"),E=St(c);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,selectedProjectViewRangeReport:r,reportLabels:{reportTitle:p},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,highlightedProjectViewRangeReport:s,uiState:m,scrollPosition:l,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:u,statementEndPoint:`${oe}/statement`,authParams:C},analytics:x,isZeniUser:Je(h),autoCompleteData:{autoCompleteText:g,entityAutoCompleteView:y},isZeniCOAUsed:E,isAccountingClassesEnabled:Te(e),isAccountingProjectsEnabled:xe(e)}}),(function(e,a){return{updateDownloadStateHandler:t=>{e(lo(t))},onTimeframeSelectionChanged:t=>{e(we(t)),setTimeout((()=>e(be({resetLeftScroll:!0}))),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ue(t,n)),e(be({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(ue(a.firstMonthOfFY,t)),e(be({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Ye(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Be(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&$(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout((()=>e(be({resetLeftScroll:!0}))),50)},onAccountBalanceClick:a.hasTransactionAccess!==!0?void 0:(t,n)=>{const{timePeriod:o,timeframe:r}=Ts(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.projectsViewParentId?.projectId!=null?Tt(a.tenantEmailDomain,t.accountId,t.accountType,t.projectsViewParentId.projectId,s,r,o):t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?Dt(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):De(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),l=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:l,referrer:"Operating Expenses"}})}},onElementCollapseStateChanged:(t,n)=>{a.accountViewMode!=="project"?e(be({nodeCollapseState:{nodeId:t,isCollapsed:n}})):e(Kt({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{a.accountViewMode!=="project"?e(be({scrollPosition:t})):e(Kt({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(de({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(ae("navbar"))},onAutoCompleteEntity:t=>{const n=me(t,a.tenantEmailDomain),o=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.selectedForecastId!=null?a.navigate("../../../"):a.navigate("../")},onForecastToggle:(t,n)=>{e(ve(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?3:1,n)),t=="forecast_mode"?(e(zt({viewMode:"account_group"})),e(Ca(!1,n?.id)),n!=null&&$(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):$(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(be({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":t==="project"?"Projects":"Accounts","Operating Expenses"),e(zt({viewMode:t})),e(co({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(io({classesToFilterOut:t}))},onUpdateProjectsToFilterOut:t=>{e(ro({projectsToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e(oo()),a.isAccountingProjectsEnabled&&e(so())},onResyncReports:()=>{e(kt(a.accountViewMode==="project"?"operating_expenses_by_projects":"operating_expenses_by_classes"))}}}))(Ke),Ps=e=>{const a=z(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,s=Ne(),{isAiCfoAccessEnabled:i,onAskAiCfoClick:l}=se({mobileExploreReferrer:"DashboardOpEx"}),m=ze({mobileExploreReferrer:"DashboardOpEx"}),p=S((A=>vt(A))),h=p.isForecastModeOn,f=p.timeframe,c=p.selectedForecast?.id,u=S((A=>yt(A.forecastState,c??""))),C=S((A=>ga(A))),g=S((A=>At(A))),y=S((A=>Te(A))),E=S((A=>xe(A))),v=S((A=>ba(A).uiState.accountViewMode)),k=p.mode==="compare_mode",w=C.dataAvailable;b.useEffect((()=>{if(c!=null&&h===!0&&($(h,r,c,o),u!=null)){const A=u?.forecastPeriod,U=w!=null&&A.endDate.isAfter(w?.endDate)===!0?w:A;a(ue(e.firstMonthOfFY,{startDate:U.endDate.startOf(f),endDate:U?.endDate}))}}),[c]);const R=$e(),T=R?.loggedInUserRole!=null&&_a(R?.loggedInUserRole)!==!0,_=Pt(R?.currentTenant?.companyId,{clearParams:C.fetchState==="Completed"});return d.jsx(Ds,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,location:n,isAccountingClassesEnabled:y,isAccountingProjectsEnabled:E,accountViewMode:v,isCompareModeOn:k,navigate:o,forecastIdFromUrlPath:r,analytics:x,hasTransactionAccess:T,reportsResyncFetchState:g.reportsResyncFetchState,insightsSectionAiCfoInfo:m,isAiCfoAccessEnabled:i,onAskAiCfoClick:l,initialOpenThreadRequest:_,meetingUrl:Le(s("dashboard_report_filters"))})},Os=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=et(e);break;case"year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;case"free_range":console.error("free_range timeframe is not supported!")}return{timeframe:a,timePeriod:t}},Fs=ne((function(e){const a=Sa(e),t=uo(e),n=ka(e),o=mo(e),r=po(e),s=ho(e),i=It(e),{scrollPosition:l,...m}=i,p=X.getLocalizedStrings().common.texts.revenue,h=B.getSignedInUser(),f=e.tenantState.currentTenantId,c=Y(e),u=c?.companyName??"",C={userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:f??""},g=e.entityAutoCompleteState.autoCompleteText.navbar,y=le(e,"navbar"),E=St(c);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,selectedProjectViewRangeReport:r,reportLabels:{reportTitle:p},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,highlightedProjectViewRangeReport:s,uiState:m,scrollPosition:l,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:u,statementEndPoint:`${oe}/statement`,authParams:C},analytics:x,isZeniUser:Je(h),autoCompleteData:{autoCompleteText:g,entityAutoCompleteView:y},isZeniCOAUsed:E,isAccountingClassesEnabled:Te(e),isAccountingProjectsEnabled:xe(e)}}),(function(e,a){return{updateDownloadStateHandler:t=>{e(So(t))},onTimeframeSelectionChanged:t=>{e(we(t)),setTimeout((()=>e(Ce({resetLeftScroll:!0}))),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ue(t,n)),e(Ce({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(ue(a.firstMonthOfFY,t)),e(Ce({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Ye(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Be(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&$(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout((()=>e(Ce({resetLeftScroll:!0}))),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=Os(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.projectsViewParentId?.projectId!=null?Tt(a.tenantEmailDomain,t.accountId,t.accountType,t.projectsViewParentId.projectId,s,r,o):t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?Dt(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):De(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),l=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:l,referrer:"Revenues"}})}},onElementCollapseStateChanged:(t,n)=>{a.accountViewMode!=="project"?e(Ce({nodeCollapseState:{nodeId:t,isCollapsed:n}})):e(Xt({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{a.accountViewMode!=="project"?e(Ce({scrollPosition:t})):e(Xt({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(de({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(ae("navbar"))},onAutoCompleteEntity:t=>{const n=me(t,a.tenantEmailDomain),o=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.selectedForecastId!=null?a.navigate("../../../"):a.navigate("../")},onForecastToggle:(t,n)=>{e(ve(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?3:1,n)),t==="forecast_mode"?(e(qt({viewMode:"account_group"})),e(ya(!1,n?.id)),n!=null&&$(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):$(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(Ce({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":t==="project"?"Projects":"Accounts","Revenues"),e(qt({viewMode:t})),e(_o({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(Co({classesToFilterOut:t}))},onUpdateProjectsToFilterOut:t=>{e(bo({projectsToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e(fo()),a.isAccountingProjectsEnabled&&e(go())},onResyncReports:()=>{e(kt(a.accountViewMode==="project"?"revenue_by_projects":"revenue_by_classes"))}}}))(Ke),js=e=>{const a=z(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,s=Ne(),{isAiCfoAccessEnabled:i,onAskAiCfoClick:l}=se({mobileExploreReferrer:"DashboardRevenue"}),m=ze({mobileExploreReferrer:"DashboardRevenue"}),p=S((_=>It(_))),h=p.isForecastModeOn,f=p.timeframe,c=p.selectedForecast?.id,u=S((_=>yt(_.forecastState,c??""))),C=S((_=>Sa(_))),g=C.dataAvailable,y=p.mode==="compare_mode",E=S((_=>Te(_))),v=S((_=>xe(_))),k=S((_=>ka(_).uiState.accountViewMode)),w=S((_=>At(_)));b.useEffect((()=>{if(c!=null&&h===!0&&($(h,r,c,o),u!=null)){const _=u?.forecastPeriod,A=g!=null&&_.endDate.isAfter(g?.endDate)===!0?g:_;a(ue(e.firstMonthOfFY,{startDate:A.endDate.startOf(f),endDate:A?.endDate}))}}),[c]);const R=$e(),T=Pt(R?.currentTenant?.companyId,{clearParams:C.fetchState==="Completed"});return d.jsx(Fs,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,isAccountingClassesEnabled:E,isAccountingProjectsEnabled:v,accountViewMode:k,isCompareModeOn:y,location:n,navigate:o,forecastIdFromUrlPath:r,analytics:x,reportsResyncFetchState:w.reportsResyncFetchState,insightsSectionAiCfoInfo:m,isAiCfoAccessEnabled:i,onAskAiCfoClick:l,initialOpenThreadRequest:T,meetingUrl:Le(s("dashboard_report_filters"))})},Rs=e=>{let a,t;if(e.endDate!=null)switch(e.timePeriod){case"this_month_to_date":case"last_month":case"this_week_to_date":case"last_week":a="month",t={startDate:e.endDate.startOf("month"),endDate:e.endDate};break;case"last_3_months":case"last_6_months":case"last_12_months":case"this_year_to_date":case"last_year":a="quarter",t={startDate:e.endDate.startOf("quarter"),endDate:e.endDate};break;default:console.error(`this timeperiod ${e.timePeriod} is not supported!`)}return{timeframe:a,timePeriod:t}},Ms=ne((function(e){const a=ko(e),t=e.entityAutoCompleteState.autoCompleteText.navbar,n=le(e,"navbar");return{report:a,analytics:x,autoCompleteData:{autoCompleteText:t,entityAutoCompleteView:n}}}),(function(e,a){return{onTimeframeSelectionChanged:t=>{x.trackTimeframeSwitch(Va(t),"Top Expenses"),e(Aa(t))},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=Rs(n),s=t.accountName===""?t.accountDescription:t.accountName;if(o!=null&&r!=null){const i=De(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),l=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:l,referrer:"Top Expenses"}})}},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(de({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(ae("navbar"))},onAutoCompleteEntity:t=>{const n=me(t,a.tenantEmailDomain),o=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.navigate("../")}}}))(qo),Ys=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e;return d.jsx(Ms,{tenantEmailDomain:a,location:t,navigate:n})},Bs=xt.div`
14
14
  display: flex;
15
15
  flex: 1 1 auto;
16
16
  min-height: 100%;
17
17
  flex-direction: column;
18
18
  background-color: ${e=>e.theme.colors.grey5};
19
19
  align-items: center;
20
- `;function Us({fetchState:e,firstMonthOfFY:a,reportId:t,forecastId:n}){const o=W(),r=H(),{tenantEmailDomain:s}=q();let i;Ve({isDataReady:!0});const l={firstMonthOfFY:a,tenantEmailDomain:s,location:r,navigate:o,forecastIdFromUrlPath:n,fetchState:e};switch(t){case"operating_expenses":i=d.jsx(Ps,{...l});break;case"revenue":i=d.jsx(js,{...l});break;case"net_burn_or_income":i=d.jsx(ws,{...l});break;case"cash_position":i=d.jsx(vs,{...l});break;case"top_expenses":i=d.jsx(Ys,{...l});break;case"cash_in_cash_out":i=d.jsx(ys,{...l});break;default:console.error(`${t} is not supported!`),i=null}return i!=null?d.jsx(Bs,{children:i}):null}function ie(){const e=H(),a=z(),{forecastId:t}=q();let n="Not-Started";const o=S((c=>It(c).fetchState)),r=S((c=>vt(c).fetchState)),s=S((c=>_t(c).fetchState)),i=S((c=>c.cashPositionState.fetchState)),l=S((c=>c.topExState.fetchState)),m=S((c=>c.cashInCashOutState.fetchState));if(B.getSignedInUser()==null)throw Error("Can't access dashboard detail without signing in...");const p=S((c=>Y(c))),h=p?.company?.companyInfo?.firstMonthOfFY??1,f=ra((c=>{const u=ia(c,"/").split("/");return t!=null?u[u.length-3]:u[u.length-1]})(e.pathname));switch(f){case"operating_expenses":n=o;break;case"revenue":n=r;break;case"net_burn_or_income":n=s;break;case"cash_position":n=i;break;case"top_expenses":n=l;break;case"cash_in_cash_out":n=m;break;default:console.error(`${f} is not supported!`)}return b.useEffect((()=>{n==="Not-Started"&&(function(c,u,C,g){switch(u){case"operating_expenses":c(Ta(!0)),g!=null&&(c(Ie(C,!0,3,{id:g,index:0})),c(Ca(!1,g)));break;case"revenue":c(wa(!0)),g!=null&&(c(Ie(C,!0,3,{id:g,index:0})),c(ya(!1,g)));break;case"net_burn_or_income":c(xa(!0)),g!=null&&(c(Ie(C,!0,3,{id:g,index:0})),c(fa(!1,g)));break;case"cash_position":c(Ea(!0));break;case"top_expenses":c(va());break;case"cash_in_cash_out":c(Ia());break;default:throw new Error(`report type ${u} is not yet supported`)}})(a,f,h,t)}),[t]),d.jsxs(d.Fragment,{children:[n==="Completed"?d.jsx(Ge,{analytics:w,onLoad:c=>((u,C)=>{const g=e.state?.referrer;switch(C){case"operating_expenses":u.trackPageLoaded(N.Event.operatingExpenses,g);break;case"revenue":u.trackPageLoaded(N.Event.revenues,g);break;case"net_burn_or_income":u.trackPageLoaded(N.Event.burnRate,g);break;case"cash_position":u.trackPageLoaded(N.Event.cashPosition,g);break;case"top_expenses":u.trackPageLoaded(N.Event.topExpenses,g);break;case"cash_in_cash_out":u.trackPageLoaded(N.Event.cashInCashOut,g);break;default:console.error(`Analytics: Not tracking Page Loaded for ${C}!`)}})(c,f)}):null,d.jsx(Us,{firstMonthOfFY:h,fetchState:n,reportId:f,forecastId:t})]})}var it=typeof navigator<"u"&&navigator.userAgent.toLowerCase().indexOf("firefox")>0;function ct(e,a,t,n){e.addEventListener?e.addEventListener(a,t,n):e.attachEvent&&e.attachEvent("on".concat(a),(function(){t(window.event)}))}function $a(e,a){for(var t=a.slice(0,a.length-1),n=0;n<t.length;n++)t[n]=e[t[n].toLowerCase()];return t}function za(e){typeof e!="string"&&(e="");for(var a=(e=e.replace(/\s/g,"")).split(","),t=a.lastIndexOf("");t>=0;)a[t-1]+=",",a.splice(t,1),t=a.lastIndexOf("");return a}for(var Ot={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":it?173:189,"=":it?61:187,";":it?59:186,"'":222,"[":219,"]":221,"\\":220},ce={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},Ct={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},M={16:!1,18:!1,17:!1,91:!1},j={},He=1;He<20;He++)Ot["f".concat(He)]=111+He;var D=[],Ht=!1,Ka="all",Wt=[],tt=function(e){return Ot[e.toLowerCase()]||ce[e.toLowerCase()]||e.toUpperCase().charCodeAt(0)};function Jt(e){Ka=e||"all"}function Re(){return Ka||"all"}var lt=function(e){var a=e.key,t=e.scope,n=e.method,o=e.splitKey,r=o===void 0?"+":o;za(a).forEach((function(s){var i=s.split(r),l=i.length,m=i[l-1],p=m==="*"?"*":tt(m);if(j[p]){t||(t=Re());var h=l>1?$a(ce,i):[];j[p]=j[p].filter((function(f){return!((!n||f.method===n)&&f.scope===t&&(function(c,u){for(var C=c.length>=u.length?c:u,g=c.length>=u.length?u:c,y=!0,E=0;E<C.length;E++)g.indexOf(C[E])===-1&&(y=!1);return y})(f.mods,h))}))}}))};function ea(e,a,t,n){var o;if(a.element===n&&(a.scope===t||a.scope==="all")){for(var r in o=a.mods.length>0,M)Object.prototype.hasOwnProperty.call(M,r)&&(!M[r]&&a.mods.indexOf(+r)>-1||M[r]&&a.mods.indexOf(+r)===-1)&&(o=!1);(a.mods.length!==0||M[16]||M[18]||M[17]||M[91])&&!o&&a.shortcut!=="*"||a.method(e,a)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}function ta(e,a){var t=j["*"],n=e.keyCode||e.which||e.charCode;if(V.filter.call(this,e)){if(n!==93&&n!==224||(n=91),D.indexOf(n)===-1&&n!==229&&D.push(n),["ctrlKey","altKey","shiftKey","metaKey"].forEach((function(u){var C=Ct[u];e[u]&&D.indexOf(C)===-1?D.push(C):!e[u]&&D.indexOf(C)>-1?D.splice(D.indexOf(C),1):u==="metaKey"&&e[u]&&D.length===3&&(e.ctrlKey||e.shiftKey||e.altKey||(D=D.slice(D.indexOf(C))))})),n in M){for(var o in M[n]=!0,ce)ce[o]===n&&(V[o]=!0);if(!t)return}for(var r in M)Object.prototype.hasOwnProperty.call(M,r)&&(M[r]=e[Ct[r]]);e.getModifierState&&(!e.altKey||e.ctrlKey)&&e.getModifierState("AltGraph")&&(D.indexOf(17)===-1&&D.push(17),D.indexOf(18)===-1&&D.push(18),M[17]=!0,M[18]=!0);var s=Re();if(t)for(var i=0;i<t.length;i++)t[i].scope===s&&(e.type==="keydown"&&t[i].keydown||e.type==="keyup"&&t[i].keyup)&&ea(e,t[i],s,a);if(n in j){for(var l=0;l<j[n].length;l++)if((e.type==="keydown"&&j[n][l].keydown||e.type==="keyup"&&j[n][l].keyup)&&j[n][l].key){for(var m=j[n][l],p=m.splitKey,h=m.key.split(p),f=[],c=0;c<h.length;c++)f.push(tt(h[c]));f.sort().join("")===D.sort().join("")&&ea(e,m,s,a)}}}}function V(e,a,t){D=[];var n=za(e),o=[],r="all",s=document,i=0,l=!1,m=!0,p="+",h=!1;for(t===void 0&&typeof a=="function"&&(t=a),Object.prototype.toString.call(a)==="[object Object]"&&(a.scope&&(r=a.scope),a.element&&(s=a.element),a.keyup&&(l=a.keyup),a.keydown!==void 0&&(m=a.keydown),a.capture!==void 0&&(h=a.capture),typeof a.splitKey=="string"&&(p=a.splitKey)),typeof a=="string"&&(r=a);i<n.length;i++)o=[],(e=n[i].split(p)).length>1&&(o=$a(ce,e)),(e=(e=e[e.length-1])==="*"?"*":tt(e))in j||(j[e]=[]),j[e].push({keyup:l,keydown:m,scope:r,mods:o,shortcut:n[i],method:t,key:n[i],splitKey:p,element:s});s!==void 0&&!(function(f){return Wt.indexOf(f)>-1})(s)&&window&&(Wt.push(s),ct(s,"keydown",(function(f){ta(f,s)}),h),Ht||(Ht=!0,ct(window,"focus",(function(){D=[]}),h)),ct(s,"keyup",(function(f){ta(f,s),(function(c){var u=c.keyCode||c.which||c.charCode,C=D.indexOf(u);if(C>=0&&D.splice(C,1),c.key&&c.key.toLowerCase()==="meta"&&D.splice(0,D.length),u!==93&&u!==224||(u=91),u in M)for(var g in M[u]=!1,ce)ce[g]===u&&(V[g]=!1)})(f)}),h))}var dt={setScope:Jt,getScope:Re,deleteScope:function(e,a){var t,n;for(var o in e||(e=Re()),j)if(Object.prototype.hasOwnProperty.call(j,o))for(t=j[o],n=0;n<t.length;)t[n].scope===e?t.splice(n,1):n++;Re()===e&&Jt(a||"all")},getPressedKeyCodes:function(){return D.slice(0)},isPressed:function(e){return typeof e=="string"&&(e=tt(e)),D.indexOf(e)!==-1},filter:function(e){var a=e.target||e.srcElement,t=a.tagName,n=!0;return!a.isContentEditable&&(t!=="INPUT"&&t!=="TEXTAREA"&&t!=="SELECT"||a.readOnly)||(n=!1),n},trigger:function(e){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(j).forEach((function(t){var n=j[t].find((function(o){return o.scope===a&&o.shortcut===e}));n&&n.method&&n.method()}))},unbind:function(e){if(e===void 0)Object.keys(j).forEach((function(s){return delete j[s]}));else if(Array.isArray(e))e.forEach((function(s){s.key&&lt(s)}));else if(typeof e=="object")e.key&&lt(e);else if(typeof e=="string"){for(var a=arguments.length,t=new Array(a>1?a-1:0),n=1;n<a;n++)t[n-1]=arguments[n];var o=t[0],r=t[1];typeof o=="function"&&(r=o,o=""),lt({key:e,scope:o,method:r,splitKey:"+"})}},keyMap:Ot,modifier:ce,modifierMap:Ct};for(var ut in dt)Object.prototype.hasOwnProperty.call(dt,ut)&&(V[ut]=dt[ut]);if(typeof window<"u"){var Ls=window.hotkeys;V.noConflict=function(e){return e&&window.hotkeys===V&&(window.hotkeys=Ls),V},window.hotkeys=V}V.filter=function(){return!0};var aa=function(e,a){var t=e.target,n=t&&t.tagName;return!!(n&&a&&a.includes(n))};function Vs(e,a,t,n){t instanceof Array&&(n=t,t=void 0);var o=t||{},r=o.enableOnTags,s=o.filter,i=o.keyup,l=o.keydown,m=o.filterPreventDefault,p=m===void 0||m,h=o.enabled,f=h===void 0||h,c=o.enableOnContentEditable,u=c!==void 0&&c,C=b.useRef(null),g=b.useCallback((function(y,E){var I,k;return s&&!s(y)?!p:!!(aa(y,["INPUT","TEXTAREA","SELECT"])&&!aa(y,r)||(I=y.target)!=null&&I.isContentEditable&&!u)||!!(C.current===null||document.activeElement===C.current||(k=C.current)!=null&&k.contains(document.activeElement))&&(a(y,E),!0)}),n?[C,r,s].concat(n):[C,r,s]);return b.useEffect((function(){if(f)return i&&l!==!0&&(t.keydown=!1),V(e,t||{},g),function(){return V.unbind(e,g)};V.unbind(e,g)}),[g,e,f]),C}V.isPressed;const Gs=[],mt="dashboard_card",te="ai_cfo_dashboard_card";function na(e,a){return a?e.some((t=>String(t)===te))?e.slice():[te,...e]:e.filter((t=>String(t)!==te))}const Ns=["net_burn_or_income_story_card","cash_balance","task_card","card_balance","zeni_promo_card","insights_dashboard","information_card","company_details","bill_pay_promo_card","bill_pay_card","reimbursement_card","reimbursement_promo_card","rewards_card"],$s=(e,a,t,n,o)=>({card:{dimension:Et(t),cardType:n,cardIndex:o,fetchState:a,disableAnimations:!1,spansFullDashboardWidth:!1},data:e.status!=null?{balanceAmount:e.balance?.available,lastUpdatedTime:e.status.lastRefreshSuccessTime,changePercent:e.balance?.change?.percent,changeComparedToDate:e.balance?.change?.since}:void 0}),je=(e,a,t,n,o)=>({card:{dimension:Et(t),cardType:n,cardIndex:o,fetchState:a,disableAnimations:!1,spansFullDashboardWidth:!1},data:e}),zs=(e,a,t,n)=>je(void 0,e,ve,a,t),Ks=e=>{const a=Et(ve);return a.height=ve.height+10,{card:{dimension:a,cardType:te,cardIndex:e,fetchState:"Completed",disableAnimations:!1,spansFullDashboardWidth:!0}}},qs=ne((function(e,a){const t=Zs(a.dashboardReport),n=a.passedCardsOrdered,o=a.dashboardReport.reportsInOrder,{isInterestedInChargeCard:r,cardsCreditLimit:s,cashbackRate:i}=a;let l=n.map(((m,p)=>{if(m==="reimbursement_promo_card"||m==="bill_pay_promo_card")return zs(t,m,p);if(m==="zeni_promo_card")return je({isExpressedInterest:r,creditLimit:s,cashbackRate:i,fetchState:"Completed"},a.cardBalanceFetchState,ve,m,p);if(m==="information_card")return je(void 0,"Completed",ve,m,p);if(m===te)return Ks(p);{const h=o.find((f=>f?.reportId===m));return h?(function(f,c,u,C){const g=f.reportId;switch(g){case"card_balance":case"cash_balance":return[$s(f,c,u,g,C)];case"expense_automation_card":case"operating_expenses":case"revenue":case"top_expenses":case"cash_position":case"cash_in_cash_out":case"insights_dashboard":case"company_details":case"task_card":case"bill_pay_card":case"reimbursement_card":case"net_burn_or_income":case"accounts_payable_aging":case"accounts_receivable_aging":case"rewards_card":return[je(f,c,u,g,C)];case"net_burn_or_income_story_card":return[je(f,c,u,"net_burn_or_income_story_card",C)];default:return console.error(`card type ${g} not yet supported!`),[]}})(h,h.fetchState,ve,p):[]}})).flat();return a.isSummaryCardsFiltered===!0&&(l=l.filter((m=>Ns.includes(m.card.cardType)==0)).filter((m=>{const p=m.data?.availableNumberOfPeriods;return p!=null?p>0:m.card.cardType!="top_expenses"||m.data==null||(function(h){if(h==null||h.length===0)return!0;let f=!0;for(const c of h)if(c.balance.available.amount!==0){f=!1;break}return f})(m.data.topExpenses.accountsOrdered)===!1}))),{cardDataArray:l,autoCompleteData:{autoCompleteText:e.entityAutoCompleteState.autoCompleteText.navbar,entityAutoCompleteView:le(e,"navbar")},analytics:w,isReimbursementEnabled:a.isReimbursementEnabled,isBillPayEnabled:a.isBillPayEnabled}}),(function(e,a){const t=a.tenantId,n=B.getSignedInUser();return{cardActions:{onCardClick:(o,r,s,i)=>{if(console.warn(`onCardClick at ${o} for the type ${r}`),r==="zeni_promo_card"&&i!=null)w.trackDashboardCardClicked("cards promo",2),w.trackZeniCardsPromoCardClicked(a.isChargeCardFeatureEnabled,i,2,`${n?.firstName??""} ${n?.lastName??""}`,a.isChargeCardFeatureEnabled?a.cardsCreditLimit:void 0),i==="Learn More"?window.open("https://www.zeni.ai/product/business-credit-card","_blank"):a.navigate("../cards/promo",{relative:"path"});else if(a.isForecastOn)switch(r){case"net_burn_or_income":case"operating_expenses":case"revenue":a.navigate(`${r}/forecast/${a.selectedForecastOnDashboard}`,{state:{referrer:s}});break;default:a.navigate(`${r}`,{state:{referrer:s}})}else r==="rewards_card"?(n!=null&&w.trackDashboardCardClicked("rewards promo",o+1),a.navigate("../../rewards/refer",{state:{referrer:s}})):r==="expense_automation_card"?(w.trackMonthEndCloseClicked(a.selectedPeriod.month,a.selectedPeriod.year,"Dashboard"),a.navigate("../../month_end_close_checks/review",{state:{referrer:"Dashboard"}})):a.navigate(`${r}`,{state:{referrer:s}})},onReloadData:(o,r)=>{const s=[];a.isApAgingFeatureEnabled===!1&&s.push("accounts_payable_aging"),a.isArAgingFeatureEnabled===!1&&s.push("accounts_receivable_aging"),a.isRewardsFeatureEnabled===!1&&s.push("rewards_card"),(function(i,l,m,p){if(l!==te)switch(l){case"card_balance":i(la());break;case"cash_balance":i(ca());break;case"operating_expenses":i(Ta(!0));break;case"revenue":i(wa(!0));break;case"net_burn_or_income":i(xa(!0));break;case"net_burn_or_income_story_card":i(Mo(!0));break;case"cash_position":i(Ea(!0));break;case"top_expenses":i(va());break;case"cash_in_cash_out":i(Ia());break;case"insights_dashboard":i(Ro());break;case"bill_pay_card":i(jo());break;case"reimbursement_card":i(Fo());break;case"company_details":i(Oo(m));break;case"task_card":i(Po());break;case"accounts_payable_aging":p.includes("accounts_payable_aging")===!1&&i(ft(Ee()));break;case"accounts_receivable_aging":i(gt(Ee()));break;case"rewards_card":p.includes("rewards_card")===!1&&i(Do(!0));break;default:throw new Error(`report type ${l} is not yet supported`)}})(e,r,a.companyId,s)},onTimeframeChange:(o,r)=>{w.trackTimeframeSwitch(Va(r),Qs(o),"Dashboard"),(function(s,i,l){switch(i){case"operating_expenses":case"revenue":case"net_burn_or_income":case"cash_position":s(xe(l));break;case"top_expenses":s(Aa(l));break;default:throw new Error(`report type ${i} doesn't support changeTimeframe`)}})(e,o,r)},onUpdateSelectedInsightIndex:o=>{e(To(o))},onCategoryClick:(o,r,s)=>{o==="bill-pay"?a.navigate("../bills",{state:{tab:r,subTab:s},relative:"path"}):o==="reimbursement"?a.navigate("../reimbursements",{state:{tab:r,subTab:s},relative:"path"}):o==="uncategorized-account-mapping"?a.navigate("../settings/accounting",{relative:"path"}):o==="show-all-tasks"?a.navigate("../tasks",{relative:"path"}):a.navigate(`../../transactions/${o}`)},onCardBtnClick:o=>{if(o==="bill_pay_promo_card"){const r="../bills",s=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(r,{state:{pathnameStackToGoBack:s},relative:"path"})}else if(o==="reimbursement_promo_card"){const r="../reimbursements",s=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(r,{state:{pathnameStackToGoBack:s},relative:"path"})}},onSaveClick:(o,r,s)=>{o==="net_burn_or_income_story_card"&&(w.trackUpdateBurnRateCalculatorSettings(r,s,xo(s)),e(wo(t,r,s)))}},autoCompleteActions:{onAutoCompleteInputChange:o=>{o.trim().length>=2?e(de({searchString:o,searchOrigin:"navbar"})):o.trim().length===0&&e(ae("navbar"))},onCancelAutoComplete:()=>{e(ae("navbar"))},onAutoCompleteEntity:o=>{let r="";r=o.type!=="vendor"||o.detailType!=="bank_merchant"&&o.detailType!=="card_merchant"?me(o,a.tenantEmailDomain):os(o.zeniId,o.qboId,a.tenantEmailDomain);const s=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(r,{state:{pathnameStackToGoBack:s,referrer:"Search"}})}}}}))(as);function Xs(){const e=oa(),a=Fa(),t=Ba(a),{isAiCfoOpen:n,setIsAiCfoOpen:o,setAiCfoSidePanelQuestionToSubmit:r}=Oa(),s=W(),i=z(),l=H(),m=B.getSignedInUser(),{useFeatureGate:p,useDynamicConfig:h}=xt(),[f,c]=b.useState(!1),[u,C]=b.useState(!1),g=ja(),{tenantEmailDomain:y}=q(),{isAiCfoAccessEnabled:E,onAskAiCfoClick:I}=se({mobileExploreReferrer:"Dashboard"}),k=S((v=>v.tenantState.fetchState==="Completed"||v.tenantState.activeTenantFetchState.fetchState==="Completed"?Y(v):void 0)),x=k??B.getSignedInUserTenant(y),{isCardsShuttingDown:R,shutdownContent:T}=Xo(x?.tenantId,k?.company?.managementInfo?.receiverEmails),_=b.useMemo((()=>R===!0&&T!=null?d.jsx(Qo,{shutdownContent:T}):null),[R,T]),A=k?.masterTOSInfo?.isMasterTOSAccepted??!1,U=x.tenantId,pe=x.companyId;b.useEffect((()=>{f===!1&&l.state?.message==="activation"&&(i(yo(pe)),c(!0))}),[l.state,f,pe,i]),b.useEffect((()=>{g&&!u&&l.state?.message==="open_ai_cfo_drawer"&&(C(!0),A?(o(!0),s({pathname:l.pathname,search:l.search,hash:l.hash},{replace:!0,state:{...l.state,message:void 0}})):re({location:l,navigate:s,mergeState:{referrer:"Dashboard",message:void 0}}))}),[l,u,g,A,o,s]);const{isFeatureEnabled:Pe}=p(G.isApAgingFeatureEnabled),_e=Zo(),F=Ho(_e),{isFeatureEnabled:J}=p(G.isArAgingFeatureEnabled),{isFeatureEnabled:qe}=p(G.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Xe}=p(G.isReferralFeatureEnabled),{isFeatureEnabled:qa}=p(G.isChargeCardFeatureEnabled),{isFeatureEnabled:Xa}=p(G.isAiCfoFileUploadEnabled),{isFeatureEnabled:Qa}=p(G.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:Za}=p(G.isDashboardSidebarNewYearAnimationEnabled),{isFeatureEnabled:Ha}=p(G.aiAuditScorePercentage),{configValue:Ft}=h(Ra.zeniCardsConfig),Wa=Ft.charge_card_cashback_rate_per_transaction==null?.0175:Ft.charge_card_cashback_rate_per_transaction;if(l.state?.message==="activation"){const v=Wo(l.state?.pathnameStackToGoBack);s(l.pathname,{state:{...l.state,message:void 0,pathnameStackToGoBack:v.newStack}})}const[jt,Ja]=b.useState(!1),[at,en]=b.useState(!1);Vs("command+p, Control+p",(v=>{en(!at),v.preventDefault()}),{enableOnContentEditable:!0,enableOnTags:["INPUT","SELECT","TEXTAREA"]},[at]);const Rt=k?.externalConnections?.accounting[0]?.isValid;if(m==null)throw Error("Can't access dashboard without signing in...");const he=S((v=>Y(v)?.excludedResources)),tn=S((v=>v.expenseAutomationViewState.selectedPeriodByTenantId)),an=!!k?.companyReimbursementInfo?.info?.isReimbursementEnabled,nn=!!k?.companyBillPayInfo?.info?.isBillPayEnabled,on=$e(),K=[],Mt=he?.resources?.find((v=>v.resource==="/reports/top_expenses"))==null,sn=he?.resources?.find((v=>v.resource==="/reports/task_card"))==null,Yt=k?.userRole!=null&&_a(k?.userRole),rn=he?.resources?.find((v=>v.resource==="/bills"))==null&&!Yt,cn=he?.resources?.find((v=>v.resource==="/reimbursements"))==null,ln=Ao(on?.loggedInUserRoleMap),dn=k?.company?.companyChargeCardInfo?.chargeCardsCreditAccountLimit??0,un=k?.companyChargeCardInfo?.info?.isCompanyInterestedInChargeCard??!1;Mt===!1&&K.push("top_expenses"),sn===!1&&K.push("task_card"),rn===!1&&K.push("bill_pay_card","bill_pay_promo_card"),Pe===!1&&K.push("accounts_payable_aging"),J===!1&&K.push("accounts_receivable_aging"),(_e===!1||Yt)&&K.push("expense_automation_card"),cn===!1&&K.push("reimbursement_card","reimbursement_promo_card"),K.push("zeni_accounts_promo_card","treasury_promo_card"),Xe===!1&&K.push("rewards_card");const{areTenantIdsInSync:Bt}=Jo();b.useLayoutEffect((()=>{jt&&F===_e||Rt!==!0||!Bt||he?.fetchState!=="Completed"&&he?.fetchState!=="Error"||(Ja(!0),i(Io(m.userId,pe,U,!0,!1,K)))}),[jt,m,U,i,Mt,Rt,he?.fetchState,Bt]);const mn=S((v=>v.reportUIOptionsState.forecastOnDashboard.isForecastModeOn)),pn=S((v=>v.revenueState.uiState.selectedForecast?.id)),hn=S((v=>v.cardBalanceState.fetchState)),fe=S((v=>vo(v,K))),fn=fe.fetchState,gn=b.useMemo((()=>na(fe.cardsOrdered,E)),[fe.cardsOrdered,E]),bn=b.useMemo((()=>na(fe.cardsForDashboardUI,E)),[fe.cardsForDashboardUI,E]);Ve({isDataReady:!0});const{isSuggestedQuestionsLoading:Cn,suggestedPromptQuestions:_n}=rs(),Ut=S((v=>da(v))),Se=Ut.uiState?.currentChatSessionId,nt=Ut.allSessionsWithOrderedQuestionAnswers??Gs,{currentSessionQuestionAnswers:Sn}=es(nt,Se),Lt=Sn.length===0,kn=b.useCallback(((v,Q,ee)=>{const ke=m?.userId;if(ke==null)return;const L=v.trim();if(L.length===0&&Q.length===0)return;if(!A)return void re({location:l,navigate:s,mergeState:{referrer:"Dashboard",...L.length>0?{aiCfoInitialQuestion:L,aiCfoInitialSubmissionSource:mt,...typeof ee=="number"?{aiCfoSuggestionIndex:ee}:{}}:{}}});const Z=Ma(e.getState()),ye=()=>{const Ae=O(l.state?.pathnameStackToGoBack,l.pathname);s(`/${y}/ai-cfo/explore`,{state:{message:"",origin:"",pathnameStackToGoBack:Ae,referrer:"Dashboard",aiCfoInitialQuestion:L,aiCfoShouldSubmit:!Z&&L.length>0,aiCfoInitialSubmissionSource:mt,...typeof ee=="number"?{aiCfoSuggestionIndex:ee}:{}}})};return t?Q.length>0?void o(!0):void ye():Q.length>0?Z?(i(bt(L)),void o(!0)):(r(L.length>0?L:null),o(!0),void(L.length>0&&Ya(i,L,mt,Se,nt,ke,ee,Q.length>0?Q:void 0))):(Z&&i(bt(L)),void ye())}),[nt,Se,i,A,t,l,s,r,o,m?.userId,e,y]),yn=b.useCallback((()=>{A?o(!0):re({location:l,navigate:s,mergeState:{referrer:"Dashboard"}})}),[A,l,s,o]),An=b.useCallback((()=>{if(!A)return void re({location:l,navigate:s,mergeState:{referrer:"Dashboard"}});if(y==null)return;const v=O(l.state?.pathnameStackToGoBack,l.pathname);s(`/${y}/ai-cfo/explore`,{state:{pathnameStackToGoBack:v,referrer:"Dashboard"}})}),[A,l,s,y]),In=b.useCallback((()=>{if(A)if(t){if(y==null||k==null)return;const v=Se==null||Lt?`/${y}/ai-cfo/explore`:`/${y}/ai-cfo/${Se}`,Q=l.state?.pathnameStackToGoBack??[],ee=O(Q,l.pathname);s(v,{state:{...l.state,pathnameStackToGoBack:ee,[ts]:!0}})}else re({location:l,navigate:s,mergeState:{referrer:"Dashboard"}});else re({location:l,navigate:s,mergeState:{referrer:"Dashboard"}})}),[A,t,l,s,y,k,Se,Lt]);return d.jsxs(d.Fragment,{children:[fn==="Completed"?d.jsx(Ge,{analytics:w,onLoad:v=>{v.trackPageLoaded(N.Event.dashboard)}}):null,d.jsx(qs,{cardsShutdownBanner:_,maxColumns:n?2:void 0,isAiCfoAccessEnabled:E,onAskAiCfoClick:I,onAiCfoDashboardOpenPanel:yn,onAiCfoDashboardOpenScopePage:In,isAiCfoFileUploadEnabled:Xa===!0&&t===!1,onAiCfoDashboardPromptSubmit:kn,onAiCfoDashboardExpandToFullPage:An,aiCfoDashboardShouldClearPromptOnSubmit:A,aiCfoDashboardSuggestedPromptQuestions:_n,aiCfoDashboardSuggestedPromptQuestionsLoading:Cn,onDragAndDropCard:(v,Q)=>{if(v===te||Q===te)return;const ee=(function(Z,ye,Ae){const ot=Ae.indexOf(Z),st=Ae.indexOf(ye);if(ot===-1||st===-1||ot===st)return Ae;const rt=[...Ae];return rt.splice(ot,1),rt.splice(st,0,Z),rt})(v,Q,gn),ke=ee.filter((Z=>Z!==te)),L=fe.cardsOrdered;(ke.length!==L.length||ke.some(((Z,ye)=>Z!==L[ye])))&&i(Eo(ke))},dashboardReport:fe,passedCardsOrdered:bn,tenantId:U,companyId:pe,tenantEmailDomain:y,location:l,navigate:s,isApAgingFeatureEnabled:Pe,isArAgingFeatureEnabled:J,isBillPayEnabled:nn,isReimbursementEnabled:an,isSummaryCardsFiltered:at,isForecastOn:mn,selectedForecastOnDashboard:pn,isVisitingFirstTime:f,isZeniAccountEnabled:qe,isRewardsFeatureEnabled:Xe,selectedPeriod:tn[U],isChargeCardFeatureEnabled:qa,isUserHasCardsAccess:ln,cardsCreditLimit:dn,cashbackRate:Wa,isInterestedInChargeCard:un,cardBalanceFetchState:hn,christmasAnimationEnabled:Qa,newYearAnimationEnabled:Za,aiAuditScorePercentageEnabled:Ha})]})}const Qs=e=>{switch(e){case"operating_expenses":return"Operating Expenses";case"revenue":return"Revenues";case"top_expenses":return"Top Expenses";case"net_burn_or_income":return"Burn Rate";case"cash_in_cash_out":return"Cash In, Cash Out";case"cash_position":return"Cash Position"}return"Dashboard"},Zs=e=>e.fetchState!=="Error"?e.fetchState:e.reportsInOrder.map((a=>a.fetchState)).reduce(((a,t)=>a==="In-Progress"||a==="Not-Started"?a:t));function pt(){return d.jsxs(ht,{children:[d.jsx(P,{path:"/",element:d.jsx(ie,{})}),d.jsx(P,{path:"/:forecastId",element:d.jsx(ie,{})}),d.jsx(P,{path:"/:forecastId/*",element:d.jsx(Me,{})})]})}function wr(){const e=$e(),a=e?.excludedResources?.find((m=>m.resource==="/reports/top_expenses"))==null,{useFeatureGate:t}=xt(),{isFeatureEnabled:n}=t(G.isApAgingFeatureEnabled),{isFeatureEnabled:o}=t(G.isArAgingFeatureEnabled),r=S((m=>Y(m))),{isFeatureEnabled:s}=t(G.isDebitCardFeatureEnabled),i=Yo(s,r),l=Bo(r);return i===!0||l===!0?d.jsx(ht,{children:d.jsx(P,{path:"/*",element:d.jsx(is,{})})}):d.jsxs(ht,{children:[d.jsx(P,{path:"/",element:d.jsx(Xs,{})}),d.jsx(P,{path:"cash_balance/*",element:d.jsx(Qt,{})}),d.jsx(P,{path:"card_balance/*",element:d.jsx(Qt,{})}),d.jsx(P,{path:"operating_expenses/*",element:d.jsx(ie,{})}),d.jsx(P,{path:"operating_expenses/forecast/*",element:d.jsx(pt,{})}),d.jsx(P,{path:"revenue/forecast/*",element:d.jsx(pt,{})}),d.jsx(P,{path:"revenue/*",element:d.jsx(ie,{})}),d.jsx(P,{path:"net_burn_or_income/forecast/*",element:d.jsx(pt,{})}),d.jsx(P,{path:"net_burn_or_income/*",element:d.jsx(ie,{})}),n===!0&&d.jsxs(d.Fragment,{children:[d.jsx(P,{path:"accounts_payable_aging/*",element:d.jsx(ls,{})}),d.jsx(P,{path:"accounts_payable_aging/:vendorId/:reportDate/*",element:d.jsx(cs,{})})]}),o&&d.jsxs(d.Fragment,{children:[d.jsx(P,{path:"accounts_receivable_aging/:customerId/:reportDate/*",element:d.jsx(ds,{})}),d.jsx(P,{path:"accounts_receivable_aging/*",element:d.jsx(us,{})})]}),d.jsx(P,{path:"cash_position/*",element:d.jsx(ie,{})}),d.jsx(P,{path:"top_expenses/*",element:a===!0?d.jsx(ie,{}):d.jsx(Me,{})}),d.jsx(P,{path:"cash_in_cash_out/*",element:d.jsx(ie,{})}),d.jsx(P,{path:"company_details",element:d.jsx(ss,{})}),d.jsx(P,{path:"referrals/*",element:d.jsx(vn,{to:"../../rewards/refer",replace:!0})}),d.jsx(P,{path:"*",element:d.jsx(Me,{})})]})}export{wr as default};
20
+ `;function Us({fetchState:e,firstMonthOfFY:a,reportId:t,forecastId:n}){const o=W(),r=H(),{tenantEmailDomain:s}=q();let i;Ve({isDataReady:!0});const l={firstMonthOfFY:a,tenantEmailDomain:s,location:r,navigate:o,forecastIdFromUrlPath:n,fetchState:e};switch(t){case"operating_expenses":i=d.jsx(Ps,{...l});break;case"revenue":i=d.jsx(js,{...l});break;case"net_burn_or_income":i=d.jsx(xs,{...l});break;case"cash_position":i=d.jsx(Is,{...l});break;case"top_expenses":i=d.jsx(Ys,{...l});break;case"cash_in_cash_out":i=d.jsx(ys,{...l});break;default:console.error(`${t} is not supported!`),i=null}return i!=null?d.jsx(Bs,{children:i}):null}function ie(){const e=H(),a=z(),{forecastId:t}=q();let n="Not-Started";const o=S((c=>vt(c).fetchState)),r=S((c=>It(c).fetchState)),s=S((c=>_t(c).fetchState)),i=S((c=>c.cashPositionState.fetchState)),l=S((c=>c.topExState.fetchState)),m=S((c=>c.cashInCashOutState.fetchState));if(B.getSignedInUser()==null)throw Error("Can't access dashboard detail without signing in...");const p=S((c=>Y(c))),h=p?.company?.companyInfo?.firstMonthOfFY??1,f=ra((c=>{const u=ia(c,"/").split("/");return t!=null?u[u.length-3]:u[u.length-1]})(e.pathname));switch(f){case"operating_expenses":n=o;break;case"revenue":n=r;break;case"net_burn_or_income":n=s;break;case"cash_position":n=i;break;case"top_expenses":n=l;break;case"cash_in_cash_out":n=m;break;default:console.error(`${f} is not supported!`)}return b.useEffect((()=>{n==="Not-Started"&&(function(c,u,C,g){switch(u){case"operating_expenses":c(Ta(!0)),g!=null&&(c(ve(C,!0,3,{id:g,index:0})),c(Ca(!1,g)));break;case"revenue":c(xa(!0)),g!=null&&(c(ve(C,!0,3,{id:g,index:0})),c(ya(!1,g)));break;case"net_burn_or_income":c(wa(!0)),g!=null&&(c(ve(C,!0,3,{id:g,index:0})),c(fa(!1,g)));break;case"cash_position":c(Ea(!0));break;case"top_expenses":c(Ia());break;case"cash_in_cash_out":c(va());break;default:throw new Error(`report type ${u} is not yet supported`)}})(a,f,h,t)}),[t]),d.jsxs(d.Fragment,{children:[n==="Completed"?d.jsx(Ge,{analytics:x,onLoad:c=>((u,C)=>{const g=e.state?.referrer;switch(C){case"operating_expenses":u.trackPageLoaded(N.Event.operatingExpenses,g);break;case"revenue":u.trackPageLoaded(N.Event.revenues,g);break;case"net_burn_or_income":u.trackPageLoaded(N.Event.burnRate,g);break;case"cash_position":u.trackPageLoaded(N.Event.cashPosition,g);break;case"top_expenses":u.trackPageLoaded(N.Event.topExpenses,g);break;case"cash_in_cash_out":u.trackPageLoaded(N.Event.cashInCashOut,g);break;default:console.error(`Analytics: Not tracking Page Loaded for ${C}!`)}})(c,f)}):null,d.jsx(Us,{firstMonthOfFY:h,fetchState:n,reportId:f,forecastId:t})]})}var it=typeof navigator<"u"&&navigator.userAgent.toLowerCase().indexOf("firefox")>0;function ct(e,a,t,n){e.addEventListener?e.addEventListener(a,t,n):e.attachEvent&&e.attachEvent("on".concat(a),(function(){t(window.event)}))}function $a(e,a){for(var t=a.slice(0,a.length-1),n=0;n<t.length;n++)t[n]=e[t[n].toLowerCase()];return t}function za(e){typeof e!="string"&&(e="");for(var a=(e=e.replace(/\s/g,"")).split(","),t=a.lastIndexOf("");t>=0;)a[t-1]+=",",a.splice(t,1),t=a.lastIndexOf("");return a}for(var Ot={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":it?173:189,"=":it?61:187,";":it?59:186,"'":222,"[":219,"]":221,"\\":220},ce={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},Ct={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},M={16:!1,18:!1,17:!1,91:!1},j={},He=1;He<20;He++)Ot["f".concat(He)]=111+He;var D=[],Ht=!1,Ka="all",Wt=[],tt=function(e){return Ot[e.toLowerCase()]||ce[e.toLowerCase()]||e.toUpperCase().charCodeAt(0)};function Jt(e){Ka=e||"all"}function Re(){return Ka||"all"}var lt=function(e){var a=e.key,t=e.scope,n=e.method,o=e.splitKey,r=o===void 0?"+":o;za(a).forEach((function(s){var i=s.split(r),l=i.length,m=i[l-1],p=m==="*"?"*":tt(m);if(j[p]){t||(t=Re());var h=l>1?$a(ce,i):[];j[p]=j[p].filter((function(f){return!((!n||f.method===n)&&f.scope===t&&(function(c,u){for(var C=c.length>=u.length?c:u,g=c.length>=u.length?u:c,y=!0,E=0;E<C.length;E++)g.indexOf(C[E])===-1&&(y=!1);return y})(f.mods,h))}))}}))};function ea(e,a,t,n){var o;if(a.element===n&&(a.scope===t||a.scope==="all")){for(var r in o=a.mods.length>0,M)Object.prototype.hasOwnProperty.call(M,r)&&(!M[r]&&a.mods.indexOf(+r)>-1||M[r]&&a.mods.indexOf(+r)===-1)&&(o=!1);(a.mods.length!==0||M[16]||M[18]||M[17]||M[91])&&!o&&a.shortcut!=="*"||a.method(e,a)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}function ta(e,a){var t=j["*"],n=e.keyCode||e.which||e.charCode;if(V.filter.call(this,e)){if(n!==93&&n!==224||(n=91),D.indexOf(n)===-1&&n!==229&&D.push(n),["ctrlKey","altKey","shiftKey","metaKey"].forEach((function(u){var C=Ct[u];e[u]&&D.indexOf(C)===-1?D.push(C):!e[u]&&D.indexOf(C)>-1?D.splice(D.indexOf(C),1):u==="metaKey"&&e[u]&&D.length===3&&(e.ctrlKey||e.shiftKey||e.altKey||(D=D.slice(D.indexOf(C))))})),n in M){for(var o in M[n]=!0,ce)ce[o]===n&&(V[o]=!0);if(!t)return}for(var r in M)Object.prototype.hasOwnProperty.call(M,r)&&(M[r]=e[Ct[r]]);e.getModifierState&&(!e.altKey||e.ctrlKey)&&e.getModifierState("AltGraph")&&(D.indexOf(17)===-1&&D.push(17),D.indexOf(18)===-1&&D.push(18),M[17]=!0,M[18]=!0);var s=Re();if(t)for(var i=0;i<t.length;i++)t[i].scope===s&&(e.type==="keydown"&&t[i].keydown||e.type==="keyup"&&t[i].keyup)&&ea(e,t[i],s,a);if(n in j){for(var l=0;l<j[n].length;l++)if((e.type==="keydown"&&j[n][l].keydown||e.type==="keyup"&&j[n][l].keyup)&&j[n][l].key){for(var m=j[n][l],p=m.splitKey,h=m.key.split(p),f=[],c=0;c<h.length;c++)f.push(tt(h[c]));f.sort().join("")===D.sort().join("")&&ea(e,m,s,a)}}}}function V(e,a,t){D=[];var n=za(e),o=[],r="all",s=document,i=0,l=!1,m=!0,p="+",h=!1;for(t===void 0&&typeof a=="function"&&(t=a),Object.prototype.toString.call(a)==="[object Object]"&&(a.scope&&(r=a.scope),a.element&&(s=a.element),a.keyup&&(l=a.keyup),a.keydown!==void 0&&(m=a.keydown),a.capture!==void 0&&(h=a.capture),typeof a.splitKey=="string"&&(p=a.splitKey)),typeof a=="string"&&(r=a);i<n.length;i++)o=[],(e=n[i].split(p)).length>1&&(o=$a(ce,e)),(e=(e=e[e.length-1])==="*"?"*":tt(e))in j||(j[e]=[]),j[e].push({keyup:l,keydown:m,scope:r,mods:o,shortcut:n[i],method:t,key:n[i],splitKey:p,element:s});s!==void 0&&!(function(f){return Wt.indexOf(f)>-1})(s)&&window&&(Wt.push(s),ct(s,"keydown",(function(f){ta(f,s)}),h),Ht||(Ht=!0,ct(window,"focus",(function(){D=[]}),h)),ct(s,"keyup",(function(f){ta(f,s),(function(c){var u=c.keyCode||c.which||c.charCode,C=D.indexOf(u);if(C>=0&&D.splice(C,1),c.key&&c.key.toLowerCase()==="meta"&&D.splice(0,D.length),u!==93&&u!==224||(u=91),u in M)for(var g in M[u]=!1,ce)ce[g]===u&&(V[g]=!1)})(f)}),h))}var dt={setScope:Jt,getScope:Re,deleteScope:function(e,a){var t,n;for(var o in e||(e=Re()),j)if(Object.prototype.hasOwnProperty.call(j,o))for(t=j[o],n=0;n<t.length;)t[n].scope===e?t.splice(n,1):n++;Re()===e&&Jt(a||"all")},getPressedKeyCodes:function(){return D.slice(0)},isPressed:function(e){return typeof e=="string"&&(e=tt(e)),D.indexOf(e)!==-1},filter:function(e){var a=e.target||e.srcElement,t=a.tagName,n=!0;return!a.isContentEditable&&(t!=="INPUT"&&t!=="TEXTAREA"&&t!=="SELECT"||a.readOnly)||(n=!1),n},trigger:function(e){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(j).forEach((function(t){var n=j[t].find((function(o){return o.scope===a&&o.shortcut===e}));n&&n.method&&n.method()}))},unbind:function(e){if(e===void 0)Object.keys(j).forEach((function(s){return delete j[s]}));else if(Array.isArray(e))e.forEach((function(s){s.key&&lt(s)}));else if(typeof e=="object")e.key&&lt(e);else if(typeof e=="string"){for(var a=arguments.length,t=new Array(a>1?a-1:0),n=1;n<a;n++)t[n-1]=arguments[n];var o=t[0],r=t[1];typeof o=="function"&&(r=o,o=""),lt({key:e,scope:o,method:r,splitKey:"+"})}},keyMap:Ot,modifier:ce,modifierMap:Ct};for(var ut in dt)Object.prototype.hasOwnProperty.call(dt,ut)&&(V[ut]=dt[ut]);if(typeof window<"u"){var Ls=window.hotkeys;V.noConflict=function(e){return e&&window.hotkeys===V&&(window.hotkeys=Ls),V},window.hotkeys=V}V.filter=function(){return!0};var aa=function(e,a){var t=e.target,n=t&&t.tagName;return!!(n&&a&&a.includes(n))};function Vs(e,a,t,n){t instanceof Array&&(n=t,t=void 0);var o=t||{},r=o.enableOnTags,s=o.filter,i=o.keyup,l=o.keydown,m=o.filterPreventDefault,p=m===void 0||m,h=o.enabled,f=h===void 0||h,c=o.enableOnContentEditable,u=c!==void 0&&c,C=b.useRef(null),g=b.useCallback((function(y,E){var v,k;return s&&!s(y)?!p:!!(aa(y,["INPUT","TEXTAREA","SELECT"])&&!aa(y,r)||(v=y.target)!=null&&v.isContentEditable&&!u)||!!(C.current===null||document.activeElement===C.current||(k=C.current)!=null&&k.contains(document.activeElement))&&(a(y,E),!0)}),n?[C,r,s].concat(n):[C,r,s]);return b.useEffect((function(){if(f)return i&&l!==!0&&(t.keydown=!1),V(e,t||{},g),function(){return V.unbind(e,g)};V.unbind(e,g)}),[g,e,f]),C}V.isPressed;const Gs=[],mt="dashboard_card",te="ai_cfo_dashboard_card";function na(e,a){return a?e.some((t=>String(t)===te))?e.slice():[te,...e]:e.filter((t=>String(t)!==te))}const Ns=["net_burn_or_income_story_card","cash_balance","task_card","card_balance","zeni_promo_card","insights_dashboard","information_card","company_details","bill_pay_promo_card","bill_pay_card","reimbursement_card","reimbursement_promo_card","rewards_card"],$s=(e,a,t,n,o)=>({card:{dimension:Et(t),cardType:n,cardIndex:o,fetchState:a,disableAnimations:!1,spansFullDashboardWidth:!1},data:e.status!=null?{balanceAmount:e.balance?.available,lastUpdatedTime:e.status.lastRefreshSuccessTime,changePercent:e.balance?.change?.percent,changeComparedToDate:e.balance?.change?.since}:void 0}),je=(e,a,t,n,o)=>({card:{dimension:Et(t),cardType:n,cardIndex:o,fetchState:a,disableAnimations:!1,spansFullDashboardWidth:!1},data:e}),zs=(e,a,t,n)=>je(void 0,e,Ie,a,t),Ks=e=>{const a=Et(Ie);return a.height=Ie.height+10,{card:{dimension:a,cardType:te,cardIndex:e,fetchState:"Completed",disableAnimations:!1,spansFullDashboardWidth:!0}}},qs=ne((function(e,a){const t=Zs(a.dashboardReport),n=a.passedCardsOrdered,o=a.dashboardReport.reportsInOrder,{isInterestedInChargeCard:r,cardsCreditLimit:s,cashbackRate:i}=a;let l=n.map(((m,p)=>{if(m==="reimbursement_promo_card"||m==="bill_pay_promo_card")return zs(t,m,p);if(m==="zeni_promo_card")return je({isExpressedInterest:r,creditLimit:s,cashbackRate:i,fetchState:"Completed"},a.cardBalanceFetchState,Ie,m,p);if(m==="information_card")return je(void 0,"Completed",Ie,m,p);if(m===te)return Ks(p);{const h=o.find((f=>f?.reportId===m));return h?(function(f,c,u,C){const g=f.reportId;switch(g){case"card_balance":case"cash_balance":return[$s(f,c,u,g,C)];case"expense_automation_card":case"operating_expenses":case"revenue":case"top_expenses":case"cash_position":case"cash_in_cash_out":case"insights_dashboard":case"company_details":case"task_card":case"bill_pay_card":case"reimbursement_card":case"net_burn_or_income":case"accounts_payable_aging":case"accounts_receivable_aging":case"rewards_card":return[je(f,c,u,g,C)];case"net_burn_or_income_story_card":return[je(f,c,u,"net_burn_or_income_story_card",C)];default:return console.error(`card type ${g} not yet supported!`),[]}})(h,h.fetchState,Ie,p):[]}})).flat();return a.isSummaryCardsFiltered===!0&&(l=l.filter((m=>Ns.includes(m.card.cardType)==0)).filter((m=>{const p=m.data?.availableNumberOfPeriods;return p!=null?p>0:m.card.cardType!="top_expenses"||m.data==null||(function(h){if(h==null||h.length===0)return!0;let f=!0;for(const c of h)if(c.balance.available.amount!==0){f=!1;break}return f})(m.data.topExpenses.accountsOrdered)===!1}))),{cardDataArray:l,autoCompleteData:{autoCompleteText:e.entityAutoCompleteState.autoCompleteText.navbar,entityAutoCompleteView:le(e,"navbar")},analytics:x,isReimbursementEnabled:a.isReimbursementEnabled,isBillPayEnabled:a.isBillPayEnabled}}),(function(e,a){const t=a.tenantId,n=B.getSignedInUser();return{cardActions:{onCardClick:(o,r,s,i)=>{if(console.warn(`onCardClick at ${o} for the type ${r}`),r==="zeni_promo_card"&&i!=null)x.trackDashboardCardClicked("cards promo",2),x.trackZeniCardsPromoCardClicked(a.isChargeCardFeatureEnabled,i,2,`${n?.firstName??""} ${n?.lastName??""}`,a.isChargeCardFeatureEnabled?a.cardsCreditLimit:void 0),i==="Learn More"?window.open("https://www.zeni.ai/product/business-credit-card","_blank"):a.navigate("../cards/promo",{relative:"path"});else if(a.isForecastOn)switch(r){case"net_burn_or_income":case"operating_expenses":case"revenue":a.navigate(`${r}/forecast/${a.selectedForecastOnDashboard}`,{state:{referrer:s}});break;default:a.navigate(`${r}`,{state:{referrer:s}})}else r==="rewards_card"?(n!=null&&x.trackDashboardCardClicked("rewards promo",o+1),a.navigate("../../rewards/refer",{state:{referrer:s}})):r==="expense_automation_card"?(x.trackMonthEndCloseClicked(a.selectedPeriod.month,a.selectedPeriod.year,"Dashboard"),a.navigate("../../month_end_close_checks/review",{state:{referrer:"Dashboard"}})):a.navigate(`${r}`,{state:{referrer:s}})},onReloadData:(o,r)=>{const s=[];a.isApAgingFeatureEnabled===!1&&s.push("accounts_payable_aging"),a.isArAgingFeatureEnabled===!1&&s.push("accounts_receivable_aging"),a.isRewardsFeatureEnabled===!1&&s.push("rewards_card"),(function(i,l,m,p){if(l!==te)switch(l){case"card_balance":i(la());break;case"cash_balance":i(ca());break;case"operating_expenses":i(Ta(!0));break;case"revenue":i(xa(!0));break;case"net_burn_or_income":i(wa(!0));break;case"net_burn_or_income_story_card":i(Mo(!0));break;case"cash_position":i(Ea(!0));break;case"top_expenses":i(Ia());break;case"cash_in_cash_out":i(va());break;case"insights_dashboard":i(Ro());break;case"bill_pay_card":i(jo());break;case"reimbursement_card":i(Fo());break;case"company_details":i(Oo(m));break;case"task_card":i(Po());break;case"accounts_payable_aging":p.includes("accounts_payable_aging")===!1&&i(ft(Ee()));break;case"accounts_receivable_aging":i(gt(Ee()));break;case"rewards_card":p.includes("rewards_card")===!1&&i(Do(!0));break;default:throw new Error(`report type ${l} is not yet supported`)}})(e,r,a.companyId,s)},onTimeframeChange:(o,r)=>{x.trackTimeframeSwitch(Va(r),Qs(o),"Dashboard"),(function(s,i,l){switch(i){case"operating_expenses":case"revenue":case"net_burn_or_income":case"cash_position":s(we(l));break;case"top_expenses":s(Aa(l));break;default:throw new Error(`report type ${i} doesn't support changeTimeframe`)}})(e,o,r)},onUpdateSelectedInsightIndex:o=>{e(To(o))},onCategoryClick:(o,r,s)=>{o==="bill-pay"?a.navigate("../bills",{state:{tab:r,subTab:s},relative:"path"}):o==="reimbursement"?a.navigate("../reimbursements",{state:{tab:r,subTab:s},relative:"path"}):o==="uncategorized-account-mapping"?a.navigate("../settings/accounting",{relative:"path"}):o==="show-all-tasks"?a.navigate("../tasks",{relative:"path"}):a.navigate(`../../transactions/${o}`)},onCardBtnClick:o=>{if(o==="bill_pay_promo_card"){const r="../bills",s=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(r,{state:{pathnameStackToGoBack:s},relative:"path"})}else if(o==="reimbursement_promo_card"){const r="../reimbursements",s=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(r,{state:{pathnameStackToGoBack:s},relative:"path"})}},onSaveClick:(o,r,s)=>{o==="net_burn_or_income_story_card"&&(x.trackUpdateBurnRateCalculatorSettings(r,s,wo(s)),e(xo(t,r,s)))}},autoCompleteActions:{onAutoCompleteInputChange:o=>{o.trim().length>=2?e(de({searchString:o,searchOrigin:"navbar"})):o.trim().length===0&&e(ae("navbar"))},onCancelAutoComplete:()=>{e(ae("navbar"))},onAutoCompleteEntity:o=>{let r="";r=o.type!=="vendor"||o.detailType!=="bank_merchant"&&o.detailType!=="card_merchant"?me(o,a.tenantEmailDomain):os(o.zeniId,o.qboId,a.tenantEmailDomain);const s=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(r,{state:{pathnameStackToGoBack:s,referrer:"Search"}})}}}}))(as);function Xs(){const e=oa(),a=Fa(),t=Ba(a),{isAiCfoOpen:n,setIsAiCfoOpen:o,setAiCfoSidePanelQuestionToSubmit:r}=Oa(),s=W(),i=z(),l=H(),m=B.getSignedInUser(),{useFeatureGate:p,useDynamicConfig:h}=wt(),[f,c]=b.useState(!1),[u,C]=b.useState(!1),g=ja(),{tenantEmailDomain:y}=q(),{isAiCfoAccessEnabled:E,onAskAiCfoClick:v}=se({mobileExploreReferrer:"Dashboard"}),k=S((I=>I.tenantState.fetchState==="Completed"||I.tenantState.activeTenantFetchState.fetchState==="Completed"?Y(I):void 0)),w=k??B.getSignedInUserTenant(y),{isCardsShuttingDown:R,shutdownContent:T}=Xo(w?.tenantId,k?.company?.managementInfo?.receiverEmails),_=b.useMemo((()=>R===!0&&T!=null?d.jsx(Qo,{shutdownContent:T}):null),[R,T]),A=k?.masterTOSInfo?.isMasterTOSAccepted??!1,U=w.tenantId,pe=w.companyId;b.useEffect((()=>{f===!1&&l.state?.message==="activation"&&(i(yo(pe)),c(!0))}),[l.state,f,pe,i]),b.useEffect((()=>{g&&!u&&l.state?.message==="open_ai_cfo_drawer"&&(C(!0),A?(o(!0),s({pathname:l.pathname,search:l.search,hash:l.hash},{replace:!0,state:{...l.state,message:void 0}})):re({location:l,navigate:s,mergeState:{referrer:"Dashboard",message:void 0}}))}),[l,u,g,A,o,s]);const{isFeatureEnabled:Pe}=p(G.isApAgingFeatureEnabled),_e=Zo(),F=Ho(_e),{isFeatureEnabled:J}=p(G.isArAgingFeatureEnabled),{isFeatureEnabled:qe}=p(G.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Xe}=p(G.isReferralFeatureEnabled),{isFeatureEnabled:qa}=p(G.isChargeCardFeatureEnabled),{isFeatureEnabled:Xa}=p(G.isAiCfoFileUploadEnabled),{isFeatureEnabled:Qa}=p(G.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:Za}=p(G.isDashboardSidebarNewYearAnimationEnabled),{isFeatureEnabled:Ha}=p(G.aiAuditScorePercentage),{configValue:Ft}=h(Ra.zeniCardsConfig),Wa=Ft.charge_card_cashback_rate_per_transaction==null?.0175:Ft.charge_card_cashback_rate_per_transaction;if(l.state?.message==="activation"){const I=Wo(l.state?.pathnameStackToGoBack);s(l.pathname,{state:{...l.state,message:void 0,pathnameStackToGoBack:I.newStack}})}const[jt,Ja]=b.useState(!1),[at,en]=b.useState(!1);Vs("command+p, Control+p",(I=>{en(!at),I.preventDefault()}),{enableOnContentEditable:!0,enableOnTags:["INPUT","SELECT","TEXTAREA"]},[at]);const Rt=k?.externalConnections?.accounting[0]?.isValid;if(m==null)throw Error("Can't access dashboard without signing in...");const he=S((I=>Y(I)?.excludedResources)),tn=S((I=>I.expenseAutomationViewState.selectedPeriodByTenantId)),an=!!k?.companyReimbursementInfo?.info?.isReimbursementEnabled,nn=!!k?.companyBillPayInfo?.info?.isBillPayEnabled,on=$e(),K=[],Mt=he?.resources?.find((I=>I.resource==="/reports/top_expenses"))==null,sn=he?.resources?.find((I=>I.resource==="/reports/task_card"))==null,Yt=k?.userRole!=null&&_a(k?.userRole),rn=he?.resources?.find((I=>I.resource==="/bills"))==null&&!Yt,cn=he?.resources?.find((I=>I.resource==="/reimbursements"))==null,ln=Ao(on?.loggedInUserRoleMap),dn=k?.company?.companyChargeCardInfo?.chargeCardsCreditAccountLimit??0,un=k?.companyChargeCardInfo?.info?.isCompanyInterestedInChargeCard??!1;Mt===!1&&K.push("top_expenses"),sn===!1&&K.push("task_card"),rn===!1&&K.push("bill_pay_card","bill_pay_promo_card"),Pe===!1&&K.push("accounts_payable_aging"),J===!1&&K.push("accounts_receivable_aging"),(_e===!1||Yt)&&K.push("expense_automation_card"),cn===!1&&K.push("reimbursement_card","reimbursement_promo_card"),K.push("zeni_accounts_promo_card","treasury_promo_card"),Xe===!1&&K.push("rewards_card");const{areTenantIdsInSync:Bt}=Jo();b.useLayoutEffect((()=>{jt&&F===_e||Rt!==!0||!Bt||he?.fetchState!=="Completed"&&he?.fetchState!=="Error"||(Ja(!0),i(vo(m.userId,pe,U,!0,!1,K)))}),[jt,m,U,i,Mt,Rt,he?.fetchState,Bt]);const mn=S((I=>I.reportUIOptionsState.forecastOnDashboard.isForecastModeOn)),pn=S((I=>I.revenueState.uiState.selectedForecast?.id)),hn=S((I=>I.cardBalanceState.fetchState)),fe=S((I=>Io(I,K))),fn=fe.fetchState,gn=b.useMemo((()=>na(fe.cardsOrdered,E)),[fe.cardsOrdered,E]),bn=b.useMemo((()=>na(fe.cardsForDashboardUI,E)),[fe.cardsForDashboardUI,E]);Ve({isDataReady:!0});const{isSuggestedQuestionsLoading:Cn,suggestedPromptQuestions:_n}=rs(),Ut=S((I=>da(I))),Se=Ut.uiState?.currentChatSessionId,nt=Ut.allSessionsWithOrderedQuestionAnswers??Gs,{currentSessionQuestionAnswers:Sn}=es(nt,Se),Lt=Sn.length===0,kn=b.useCallback(((I,Q,ee)=>{const ke=m?.userId;if(ke==null)return;const L=I.trim();if(L.length===0&&Q.length===0)return;if(!A)return void re({location:l,navigate:s,mergeState:{referrer:"Dashboard",...L.length>0?{aiCfoInitialQuestion:L,aiCfoInitialSubmissionSource:mt,...typeof ee=="number"?{aiCfoSuggestionIndex:ee}:{}}:{}}});const Z=Ma(e.getState()),ye=()=>{const Ae=O(l.state?.pathnameStackToGoBack,l.pathname);s(`/${y}/ai-cfo/explore`,{state:{message:"",origin:"",pathnameStackToGoBack:Ae,referrer:"Dashboard",aiCfoInitialQuestion:L,aiCfoShouldSubmit:!Z&&L.length>0,aiCfoInitialSubmissionSource:mt,...typeof ee=="number"?{aiCfoSuggestionIndex:ee}:{}}})};return t?Q.length>0?void o(!0):void ye():Q.length>0?Z?(i(bt(L)),void o(!0)):(r(L.length>0?L:null),o(!0),void(L.length>0&&Ya(i,L,mt,Se,nt,ke,ee,Q.length>0?Q:void 0))):(Z&&i(bt(L)),void ye())}),[nt,Se,i,A,t,l,s,r,o,m?.userId,e,y]),yn=b.useCallback((()=>{A?o(!0):re({location:l,navigate:s,mergeState:{referrer:"Dashboard"}})}),[A,l,s,o]),An=b.useCallback((()=>{if(!A)return void re({location:l,navigate:s,mergeState:{referrer:"Dashboard"}});if(y==null)return;const I=O(l.state?.pathnameStackToGoBack,l.pathname);s(`/${y}/ai-cfo/explore`,{state:{pathnameStackToGoBack:I,referrer:"Dashboard"}})}),[A,l,s,y]),vn=b.useCallback((()=>{if(A)if(t){if(y==null||k==null)return;const I=Se==null||Lt?`/${y}/ai-cfo/explore`:`/${y}/ai-cfo/${Se}`,Q=l.state?.pathnameStackToGoBack??[],ee=O(Q,l.pathname);s(I,{state:{...l.state,pathnameStackToGoBack:ee,[ts]:!0}})}else re({location:l,navigate:s,mergeState:{referrer:"Dashboard"}});else re({location:l,navigate:s,mergeState:{referrer:"Dashboard"}})}),[A,t,l,s,y,k,Se,Lt]);return d.jsxs(d.Fragment,{children:[fn==="Completed"?d.jsx(Ge,{analytics:x,onLoad:I=>{I.trackPageLoaded(N.Event.dashboard)}}):null,d.jsx(qs,{cardsShutdownBanner:_,maxColumns:n?2:void 0,isAiCfoAccessEnabled:E,onAskAiCfoClick:v,onAiCfoDashboardOpenPanel:yn,onAiCfoDashboardOpenScopePage:vn,isAiCfoFileUploadEnabled:Xa===!0&&t===!1,onAiCfoDashboardPromptSubmit:kn,onAiCfoDashboardExpandToFullPage:An,aiCfoDashboardShouldClearPromptOnSubmit:A,aiCfoDashboardSuggestedPromptQuestions:_n,aiCfoDashboardSuggestedPromptQuestionsLoading:Cn,onDragAndDropCard:(I,Q)=>{if(I===te||Q===te)return;const ee=(function(Z,ye,Ae){const ot=Ae.indexOf(Z),st=Ae.indexOf(ye);if(ot===-1||st===-1||ot===st)return Ae;const rt=[...Ae];return rt.splice(ot,1),rt.splice(st,0,Z),rt})(I,Q,gn),ke=ee.filter((Z=>Z!==te)),L=fe.cardsOrdered;(ke.length!==L.length||ke.some(((Z,ye)=>Z!==L[ye])))&&i(Eo(ke))},dashboardReport:fe,passedCardsOrdered:bn,tenantId:U,companyId:pe,tenantEmailDomain:y,location:l,navigate:s,isApAgingFeatureEnabled:Pe,isArAgingFeatureEnabled:J,isBillPayEnabled:nn,isReimbursementEnabled:an,isSummaryCardsFiltered:at,isForecastOn:mn,selectedForecastOnDashboard:pn,isVisitingFirstTime:f,isZeniAccountEnabled:qe,isRewardsFeatureEnabled:Xe,selectedPeriod:tn[U],isChargeCardFeatureEnabled:qa,isUserHasCardsAccess:ln,cardsCreditLimit:dn,cashbackRate:Wa,isInterestedInChargeCard:un,cardBalanceFetchState:hn,christmasAnimationEnabled:Qa,newYearAnimationEnabled:Za,aiAuditScorePercentageEnabled:Ha})]})}const Qs=e=>{switch(e){case"operating_expenses":return"Operating Expenses";case"revenue":return"Revenues";case"top_expenses":return"Top Expenses";case"net_burn_or_income":return"Burn Rate";case"cash_in_cash_out":return"Cash In, Cash Out";case"cash_position":return"Cash Position"}return"Dashboard"},Zs=e=>e.fetchState!=="Error"?e.fetchState:e.reportsInOrder.map((a=>a.fetchState)).reduce(((a,t)=>a==="In-Progress"||a==="Not-Started"?a:t));function pt(){return d.jsxs(ht,{children:[d.jsx(P,{path:"/",element:d.jsx(ie,{})}),d.jsx(P,{path:"/:forecastId",element:d.jsx(ie,{})}),d.jsx(P,{path:"/:forecastId/*",element:d.jsx(Me,{})})]})}function xr(){const e=$e(),a=e?.excludedResources?.find((m=>m.resource==="/reports/top_expenses"))==null,{useFeatureGate:t}=wt(),{isFeatureEnabled:n}=t(G.isApAgingFeatureEnabled),{isFeatureEnabled:o}=t(G.isArAgingFeatureEnabled),r=S((m=>Y(m))),{isFeatureEnabled:s}=t(G.isDebitCardFeatureEnabled),i=Yo(s,r),l=Bo(r);return i===!0||l===!0?d.jsx(ht,{children:d.jsx(P,{path:"/*",element:d.jsx(is,{})})}):d.jsxs(ht,{children:[d.jsx(P,{path:"/",element:d.jsx(Xs,{})}),d.jsx(P,{path:"cash_balance/*",element:d.jsx(Qt,{})}),d.jsx(P,{path:"card_balance/*",element:d.jsx(Qt,{})}),d.jsx(P,{path:"operating_expenses/*",element:d.jsx(ie,{})}),d.jsx(P,{path:"operating_expenses/forecast/*",element:d.jsx(pt,{})}),d.jsx(P,{path:"revenue/forecast/*",element:d.jsx(pt,{})}),d.jsx(P,{path:"revenue/*",element:d.jsx(ie,{})}),d.jsx(P,{path:"net_burn_or_income/forecast/*",element:d.jsx(pt,{})}),d.jsx(P,{path:"net_burn_or_income/*",element:d.jsx(ie,{})}),n===!0&&d.jsxs(d.Fragment,{children:[d.jsx(P,{path:"accounts_payable_aging/*",element:d.jsx(ls,{})}),d.jsx(P,{path:"accounts_payable_aging/:vendorId/:reportDate/*",element:d.jsx(cs,{})})]}),o&&d.jsxs(d.Fragment,{children:[d.jsx(P,{path:"accounts_receivable_aging/:customerId/:reportDate/*",element:d.jsx(ds,{})}),d.jsx(P,{path:"accounts_receivable_aging/*",element:d.jsx(us,{})})]}),d.jsx(P,{path:"cash_position/*",element:d.jsx(ie,{})}),d.jsx(P,{path:"top_expenses/*",element:a===!0?d.jsx(ie,{}):d.jsx(Me,{})}),d.jsx(P,{path:"cash_in_cash_out/*",element:d.jsx(ie,{})}),d.jsx(P,{path:"company_details",element:d.jsx(ss,{})}),d.jsx(P,{path:"referrals/*",element:d.jsx(In,{to:"../../rewards/refer",replace:!0})}),d.jsx(P,{path:"*",element:d.jsx(Me,{})})]})}export{xr as default};
@@ -1 +1 @@
1
- import{j as v}from"./liveblocks-BYqz0SWy.js";import{a as u}from"./sentry-DjmIorbX.js";import{u as w,j as b,l as y,g as U,N as A}from"./core-B1R51LGS.js";import{Uu as N,fI as _,go as k,Uv as L,pW as R,Uw as z}from"./zeni-epic-state-M9sMLOaG.js";import{u as j,z as f,L as T,t as I,G as O,b as $}from"./index-C49C-P8m.js";import"./mui-D-_RYGgU.js";import{t as P}from"./getLocaleForTenant-CLKJVxYo.js";import"./recharts-By7FVN8f.js";import"./analytics-DhotUQIQ.js";import"./plaid-B0PWXAfV.js";import"./dnd-CBDtHD8g.js";import"./stripe-cKAAJElX.js";import"./lottie-C4orech3.js";import"./lexical-Cft6chCX.js";import"./pdf-DFgrdLB6.js";import"./utils-iOnDyQuG.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="d73b09da-2f5b-499c-95a6-e5ebd93abece",t._sentryDebugIdIdentifier="sentry-dbid-d73b09da-2f5b-499c-95a6-e5ebd93abece")}catch{}})();const G=y((function(t){return{fetchState:t.tenantState.fetchState,activeTenantFetchState:t.tenantState.activeTenantFetchState.fetchState,currentTenant:_(t),tenantsInOrder:z(t).tenantsInOrder}}))((function({fetchState:t,activeTenantFetchState:s,currentTenant:o,tenantsInOrder:h}){const r=U(),p=new URLSearchParams(r.search);if(o==null||t!=="Completed"&&s!=="Completed")return null;{let m="";const n=h.map((l=>l.tenantEmailDomain)),i=r.state?.origin,a=r.state?.queryParams;let c=`../${o.tenantEmailDomain}`,d=null,e=!1,g=null,S=null;const C=E(r.pathname);if(C!=null)c=`../${o.tenantEmailDomain}/${C}`,m="comingFromV2UrlPath",C==="ai-cfo/explore"&&(d=p.get("question")?.replace(/^["']|["']$/g,"")??null,e=p.get("should_submit")==="true");else if(i!=null)if(n.reduce(((l,F)=>l||i.split("/").find((D=>D===F))!=null),!1))c=i,i.includes("ai-cfo")&&a!=null&&(g=a.aiCfoRef??null,S=a.aiCfoEmailRefId??null);else{const l=E(i);l!=null?(c=`../${o.tenantEmailDomain}/${l}`,m="comingFromV2UrlPath",l==="ai-cfo/explore"&&a!=null&&(a.aiCfoQuestion!=null&&(d=a.aiCfoQuestion),a.aiCfoShouldSubmit==="true"&&(e=!0))):console.warn("Don't have access to previous path tenant!")}const x=$(c,p);return v.jsx(A,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:S}})}}));function oe(){const t=w(),{setLoading:s,clearAllLoading:o}=j(),h=u.useRef(!1),r=u.useRef(!1),p=u.useRef(null),m=b((e=>N(e))),n=b((e=>e.tenantState.fetchState)),i=b((e=>e.tenantState.error)),a=b((e=>e.tenantState.activeTenantFetchState.fetchState)),c=b((e=>_(e))),d=f.getSignedInUser();return u.useLayoutEffect((()=>{const e=f.getActiveTenantForUser()?.tenantId??null;p.current!==e&&(p.current=e,h.current=!1,r.current=!1,s(T.TENANT_FETCHING)),!h.current||a!=="Completed"&&a!=="Error"||(h.current=!1),!r.current||n!=="Completed"&&n!=="Error"||(r.current=!1)}),[a,n]),u.useEffect((()=>{const e=f.getActiveTenantForUser()?.tenantId;h.current===!1&&d!=null&&e!=null&&I.shouldFetchActiveTenant(e)&&(h.current=!0,I.markActiveTenantFetchStarted(e),n==="Completed"||a!=="Not-Started"&&a!=="Error"||(s(T.TENANT_FETCHING),t(k(d.userId,e))))}),[n,a,d,t]),u.useEffect((()=>{const e=f.getSignedInUser(),g=f.getActiveTenantForUser()?.tenantId,S=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&S&&I.shouldFetchAllTenants()&&(r.current=!0,I.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!L(i))&&t(R(e.userId)))}),[n,a,i,d,t]),u.useEffect((()=>{f.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())}),[m.tenantsCoreDetailsInOrder,n]),u.useEffect((()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||(O.updateAppLocaleID(P(c)),o())}),[n,a,c]),v.jsx(G,{})}const Q=["dashboard/cash-balance","dashboard/card-balance","dashboard/operating-expenses","dashboard/revenue","dashboard/burn-rate","dashboard/cash-position","dashboard/top-expenses","dashboard/cash-in-cash-out","dashboard","reports","forecast","uncategorized-expense","uncategorized-income","missing-receipts","bills","cards/activate","cards","reimbursements","wise","checking","aicfo"],q={"dashboard/cash-balance":"dashboard/cash_balance","dashboard/card-balance":"dashboard/card_balance","dashboard/operating-expenses":"dashboard/operating_expenses","dashboard/revenue":"dashboard/revenue","dashboard/burn-rate":"dashboard/net_burn_or_income","dashboard/cash-position":"dashboard/cash_position","dashboard/top-expenses":"dashboard/top_expenses","dashboard/cash-in-cash-out":"dashboard/cash_in_cash_out",dashboard:"dashboard",reports:"reports",forecast:"forecast","uncategorized-expense":"transactions/uncategorized-expense","uncategorized-income":"transactions/uncategorized-income","missing-receipts":"transactions/missing-receipts",bills:"bills",reimbursements:"reimbursements","cards/activate":"cards/activate",cards:"cards",wise:"bills/wise/callback/link-account",checking:"checking",aicfo:"ai-cfo/explore"};function E(t){for(const s of Q)if(t.toLocaleLowerCase().includes(s))return q[s]}export{oe as default};
1
+ import{j as v}from"./liveblocks-Css5YxVy.js";import{a as u}from"./sentry-BBNrx1Ml.js";import{u as w,j as b,l as y,g as U,N as A}from"./core-CSm69gJV.js";import{Uu as N,fI as _,go as k,Uv as L,pW as R,Uw as z}from"./zeni-epic-state-CQbasAjU.js";import{u as j,z as f,L as T,t as I,G as O,b as $}from"./index-Di0x3KLC.js";import"./mui-CgZjFJJF.js";import{t as P}from"./getLocaleForTenant-uCoslywF.js";import"./recharts-DQBC-7lc.js";import"./analytics-BreoHt0J.js";import"./plaid-vksPD1j4.js";import"./dnd-BvLWSTOT.js";import"./stripe-cKAAJElX.js";import"./lottie-scQSn0xo.js";import"./lexical-CC3pmboN.js";import"./pdf-DXPt-TDj.js";import"./utils-B8asVtkx.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="d73b09da-2f5b-499c-95a6-e5ebd93abece",t._sentryDebugIdIdentifier="sentry-dbid-d73b09da-2f5b-499c-95a6-e5ebd93abece")}catch{}})();const G=y((function(t){return{fetchState:t.tenantState.fetchState,activeTenantFetchState:t.tenantState.activeTenantFetchState.fetchState,currentTenant:_(t),tenantsInOrder:z(t).tenantsInOrder}}))((function({fetchState:t,activeTenantFetchState:s,currentTenant:o,tenantsInOrder:h}){const r=U(),p=new URLSearchParams(r.search);if(o==null||t!=="Completed"&&s!=="Completed")return null;{let m="";const n=h.map((l=>l.tenantEmailDomain)),i=r.state?.origin,a=r.state?.queryParams;let c=`../${o.tenantEmailDomain}`,d=null,e=!1,g=null,S=null;const C=E(r.pathname);if(C!=null)c=`../${o.tenantEmailDomain}/${C}`,m="comingFromV2UrlPath",C==="ai-cfo/explore"&&(d=p.get("question")?.replace(/^["']|["']$/g,"")??null,e=p.get("should_submit")==="true");else if(i!=null)if(n.reduce(((l,F)=>l||i.split("/").find((D=>D===F))!=null),!1))c=i,i.includes("ai-cfo")&&a!=null&&(g=a.aiCfoRef??null,S=a.aiCfoEmailRefId??null);else{const l=E(i);l!=null?(c=`../${o.tenantEmailDomain}/${l}`,m="comingFromV2UrlPath",l==="ai-cfo/explore"&&a!=null&&(a.aiCfoQuestion!=null&&(d=a.aiCfoQuestion),a.aiCfoShouldSubmit==="true"&&(e=!0))):console.warn("Don't have access to previous path tenant!")}const x=$(c,p);return v.jsx(A,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:S}})}}));function oe(){const t=w(),{setLoading:s,clearAllLoading:o}=j(),h=u.useRef(!1),r=u.useRef(!1),p=u.useRef(null),m=b((e=>N(e))),n=b((e=>e.tenantState.fetchState)),i=b((e=>e.tenantState.error)),a=b((e=>e.tenantState.activeTenantFetchState.fetchState)),c=b((e=>_(e))),d=f.getSignedInUser();return u.useLayoutEffect((()=>{const e=f.getActiveTenantForUser()?.tenantId??null;p.current!==e&&(p.current=e,h.current=!1,r.current=!1,s(T.TENANT_FETCHING)),!h.current||a!=="Completed"&&a!=="Error"||(h.current=!1),!r.current||n!=="Completed"&&n!=="Error"||(r.current=!1)}),[a,n]),u.useEffect((()=>{const e=f.getActiveTenantForUser()?.tenantId;h.current===!1&&d!=null&&e!=null&&I.shouldFetchActiveTenant(e)&&(h.current=!0,I.markActiveTenantFetchStarted(e),n==="Completed"||a!=="Not-Started"&&a!=="Error"||(s(T.TENANT_FETCHING),t(k(d.userId,e))))}),[n,a,d,t]),u.useEffect((()=>{const e=f.getSignedInUser(),g=f.getActiveTenantForUser()?.tenantId,S=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&S&&I.shouldFetchAllTenants()&&(r.current=!0,I.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!L(i))&&t(R(e.userId)))}),[n,a,i,d,t]),u.useEffect((()=>{f.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())}),[m.tenantsCoreDetailsInOrder,n]),u.useEffect((()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||(O.updateAppLocaleID(P(c)),o())}),[n,a,c]),v.jsx(G,{})}const Q=["dashboard/cash-balance","dashboard/card-balance","dashboard/operating-expenses","dashboard/revenue","dashboard/burn-rate","dashboard/cash-position","dashboard/top-expenses","dashboard/cash-in-cash-out","dashboard","reports","forecast","uncategorized-expense","uncategorized-income","missing-receipts","bills","cards/activate","cards","reimbursements","wise","checking","aicfo"],q={"dashboard/cash-balance":"dashboard/cash_balance","dashboard/card-balance":"dashboard/card_balance","dashboard/operating-expenses":"dashboard/operating_expenses","dashboard/revenue":"dashboard/revenue","dashboard/burn-rate":"dashboard/net_burn_or_income","dashboard/cash-position":"dashboard/cash_position","dashboard/top-expenses":"dashboard/top_expenses","dashboard/cash-in-cash-out":"dashboard/cash_in_cash_out",dashboard:"dashboard",reports:"reports",forecast:"forecast","uncategorized-expense":"transactions/uncategorized-expense","uncategorized-income":"transactions/uncategorized-income","missing-receipts":"transactions/missing-receipts",bills:"bills",reimbursements:"reimbursements","cards/activate":"cards/activate",cards:"cards",wise:"bills/wise/callback/link-account",checking:"checking",aicfo:"ai-cfo/explore"};function E(t){for(const s of Q)if(t.toLocaleLowerCase().includes(s))return q[s]}export{oe as default};
@@ -1,4 +1,4 @@
1
- import{j as l}from"./liveblocks-BYqz0SWy.js";import{h as w,g as C,j as h,l as A,i as V}from"./core-B1R51LGS.js";import{Zt as k,ZA as J,gJ as L,gI as M,gH as W,kT as X,Xr as q,uV as K,fI as D,Z0 as B,kR as T,Zu as S,ZD as F,kP as G,la as j}from"./zeni-epic-state-M9sMLOaG.js";import{bL as Q,_ as R,c as N,z as Z,a2 as p,$ as v,a5 as U,bM as Y,E as _,bN as ee,p as te}from"./index-C49C-P8m.js";import{u as H,n as O}from"./mui-D-_RYGgU.js";import"./sentry-DjmIorbX.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]="9355634f-6522-424c-8cb5-9418a1ff9b64",e._sentryDebugIdIdentifier="sentry-dbid-9355634f-6522-424c-8cb5-9418a1ff9b64")}catch{}})();const ne=A(null,(function(e,t){return{onSaveVendor:n=>{e(X(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(q("common")),n!=null&&e(K(n))},onGetOtp:n=>{e(W(n,"BillPayVendor"))},onResendOtp:n=>{e(M(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(L(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(J(n,a,o))}}}))(Q);function z({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h((r=>k(r,e)));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=O.div`
1
+ import{j as l}from"./liveblocks-Css5YxVy.js";import{h as w,g as C,j as h,l as A,i as V}from"./core-CSm69gJV.js";import{Zt as k,ZA as J,gJ as L,gI as M,gH as W,kT as X,Xr as q,uV as K,fI as D,Z0 as B,kR as T,Zu as S,ZD as F,kP as G,la as j}from"./zeni-epic-state-CQbasAjU.js";import{bL as Q,_ as R,c as N,z as Z,a2 as p,$ as v,a5 as U,bM as Y,D as _,bN as ee,p as te}from"./index-Di0x3KLC.js";import{u as H,n as O}from"./mui-CgZjFJJF.js";import"./sentry-BBNrx1Ml.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]="5fedb911-399e-4437-8397-13bdbea56776",e._sentryDebugIdIdentifier="sentry-dbid-5fedb911-399e-4437-8397-13bdbea56776")}catch{}})();const ne=A(null,(function(e,t){return{onSaveVendor:n=>{e(X(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(q("common")),n!=null&&e(K(n))},onGetOtp:n=>{e(W(n,"BillPayVendor"))},onResendOtp:n=>{e(M(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(L(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(J(n,a,o))}}}))(Q);function z({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h((d=>k(d,e)));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=O.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -6,7 +6,7 @@ import{j as l}from"./liveblocks-BYqz0SWy.js";import{h as w,g as C,j as h,l as A,
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,oe=A((function(e,t){const{vendorId:n,billId:a}=t,o=k(e,n),s=B(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,a);return{billId:a,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}}),(function(e,t){const{navigate:n,location:a,vendorId:o}=t;return{onFetchBankName:s=>{e(j(s))},onSaveHandler:s=>{e(G(t.bankAccountContext,s,"standard",o))},onCancel:()=>{(()=>{const s=p(a.state?.pathnameStackToGoBack),r=s.poppedPathname??P();n(r,{state:{pathnameStackToGoBack:s.newStack}})})(),e(S())},onACHDetailsUpdated:s=>{const{bankAccountSection:r}=s;e(F({data:r}))},onBackClick:()=>{if(e(T({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")n("../",{relative:"path"});else{const s=p(t.location.state?.pathnameStackToGoBack),r=s.poppedPathname??P(0);t.navigate(r,{state:{pathnameStackToGoBack:s.newStack}})}e(S())}}}))(Y);function fe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=R(),{vendorId:s,billId:r}=V(),d=e??s,{useFeatureGate:c}=N(),i=Z.getSignedInUser(),b=h((u=>D(u))),g=H(),I=p(a.state?.pathnameStackToGoBack),f=t??(I.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h((u=>k(u,d))),{isFeatureEnabled:x}=c(v.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=c(v.isDepositAccountsFeatureEnabled);if(i==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(U,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:g.colors.grey5}}):l.jsxs(ae,{windowSize:o,children:[l.jsx(z,{vendorId:d,billId:r}),l.jsx(oe,{location:a,navigate:n,billId:r,vendorId:d,currentTenant:b,bankAccountContext:f,isVendorRecommendationEnabled:x,isZeniAccountsFeatureEnabled:y})]})}const P=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t},me=(e,t,n)=>{let a=`/${e}/bill/${encodeURIComponent(t)}`;return n=="draft"&&(a+="/edit"),a},he=e=>`/${e}/bills`,ke=(e,t)=>{let n=`/${e}/bill`;return n=t!=null?n.concat(`/${t}/edit`):n.concat("/new"),n},E=(e,t,n,a)=>{let o=`/${e}/bill`;return o+=n!=null?`/${n}/edit/vendor`:"/new/vendor",o+=a!=null?`/${a}/edit/${t}`:`/create/${t}`,o};function Se(e,t,n){return E(e,"ach",t,n)}function ve(e,t,n){return E(e,"domestic",t,n)}function ge(e,t,n){return E(e,"international",t,n)}const se=(e,t,n)=>{let a=`/${e}/bill/`;return a=n!=null?a.concat(`${encodeURIComponent(n)}/${t}/`):a.concat(`new/${t}/`),a},ce=O.div`
9
+ `,oe=A((function(e,t){const{vendorId:n,billId:a}=t,o=k(e,n),s=B(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,a);return{billId:a,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}}),(function(e,t){const{navigate:n,location:a,vendorId:o}=t;return{onFetchBankName:s=>{e(j(s))},onSaveHandler:s=>{e(G(t.bankAccountContext,s,"standard",o))},onCancel:()=>{(()=>{const s=p(a.state?.pathnameStackToGoBack),d=s.poppedPathname??P();n(d,{state:{pathnameStackToGoBack:s.newStack}})})(),e(S())},onACHDetailsUpdated:s=>{const{bankAccountSection:d}=s;e(F({data:d}))},onBackClick:()=>{if(e(T({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")n("../",{relative:"path"});else{const s=p(t.location.state?.pathnameStackToGoBack),d=s.poppedPathname??P(0);t.navigate(d,{state:{pathnameStackToGoBack:s.newStack}})}e(S())}}}))(Y);function fe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=R(),{vendorId:s,billId:d}=V(),c=e??s,{useFeatureGate:r}=N(),i=Z.getSignedInUser(),b=h((u=>D(u))),g=H(),I=p(a.state?.pathnameStackToGoBack),f=t??(I.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h((u=>k(u,c))),{isFeatureEnabled:x}=r(v.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=r(v.isDepositAccountsFeatureEnabled);if(i==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(U,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:g.colors.grey5}}):l.jsxs(ae,{windowSize:o,children:[l.jsx(z,{vendorId:c,billId:d}),l.jsx(oe,{location:a,navigate:n,billId:d,vendorId:c,currentTenant:b,bankAccountContext:f,isVendorRecommendationEnabled:x,isZeniAccountsFeatureEnabled:y})]})}const P=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t},me=(e,t,n)=>{let a=`/${e}/bill/${encodeURIComponent(t)}`;return n=="draft"&&(a+="/edit"),a},he=e=>`/${e}/bills`,ke=(e,t)=>{let n=`/${e}/bill`;return n=t!=null?n.concat(`/${t}/edit`):n.concat("/new"),n},E=(e,t,n,a)=>{let o=`/${e}/bill`;return o+=n!=null?`/${n}/edit/vendor`:"/new/vendor",o+=a!=null?`/${a}/edit/${t}`:`/create/${t}`,o};function Se(e,t,n){return E(e,"ach",t,n)}function ve(e,t,n){return E(e,"domestic",t,n)}function ge(e,t,n){return E(e,"international",t,n)}const se=(e,t,n)=>{let a=`/${e}/bill/`;return a=n!=null?a.concat(`${encodeURIComponent(n)}/${t}/`):a.concat(`new/${t}/`),a},re=O.div`
10
10
  display: flex;
11
11
  height: 100vh;
12
12
  width: 100%;
@@ -15,4 +15,4 @@ import{j as l}from"./liveblocks-BYqz0SWy.js";import{h as w,g as C,j as h,l as A,
15
15
  align-items: center;
16
16
  background-color: ${e=>e.theme.colors.grey4};
17
17
  box-shadow: ${e=>`0px 2px ${_.sp1} ${e.theme.colors.dropShadowNormal}`};
18
- `,re=A((function(e,t){const{vendorId:n,billId:a}=t,o=k(e,n),s=B(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,a);return{billId:a,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}}),(function(e,t){const{billId:n,navigate:a,location:o,vendorId:s,currentTenant:r}=t,{tenantEmailDomain:d}=r;return{onFetchBankName:c=>{e(j(c))},onSaveHandler:c=>{e(G(t.bankAccountContext,c,"us-domestic",s))},onWireDetailsUpdated:c=>{const{bankAccountSection:i}=c;e(F({data:i}))},onCancel:()=>{(()=>{const c=p(o.state?.pathnameStackToGoBack),i=c.poppedPathname??$();a(i,{state:{pathnameStackToGoBack:c.newStack}})})(),e(S())},onAddressClick:c=>{if(t.bankAccountContext==="express-pay")a("./add-address");else{const i=se(d,c,n),b=te(o.state?.pathnameStackToGoBack,o.pathname);a(i,{state:{pathnameStackToGoBack:b}})}},onBackClick:()=>{if(e(T({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")a("../",{relative:"path"});else{const c=p(t.location.state?.pathnameStackToGoBack),i=c.poppedPathname??$(0);t.navigate(i,{state:{pathnameStackToGoBack:c.newStack}})}e(S())}}}))(ee);function Ie({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=R(),{vendorId:s,billId:r}=V(),d=e??s,c=Z.getSignedInUser(),{useFeatureGate:i}=N(),b=H(),g=h((u=>D(u))),I=p(a.state?.pathnameStackToGoBack),f=t??(I.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h((u=>k(u,d))),{isFeatureEnabled:x}=i(v.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=i(v.isDepositAccountsFeatureEnabled);if(c==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(U,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:b.colors.grey5,boxShadow:`0px 2px ${_.sp1} ${b.colors.dropShadowNormal}`}}):l.jsxs(ce,{windowSize:o,children:[l.jsx(z,{vendorId:d,billId:r}),l.jsx(re,{location:a,navigate:n,billId:r,vendorId:d,currentTenant:g,bankAccountContext:f,isVendorRecommendationEnabled:x,isZeniAccountsFeatureEnabled:y})]})}const $=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t};export{fe as A,Ie as D,z as V,me as a,se as b,ke as c,ve as d,he as g,ge as i,Se as v};
18
+ `,de=A((function(e,t){const{vendorId:n,billId:a}=t,o=k(e,n),s=B(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,a);return{billId:a,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}}),(function(e,t){const{billId:n,navigate:a,location:o,vendorId:s,currentTenant:d}=t,{tenantEmailDomain:c}=d;return{onFetchBankName:r=>{e(j(r))},onSaveHandler:r=>{e(G(t.bankAccountContext,r,"us-domestic",s))},onWireDetailsUpdated:r=>{const{bankAccountSection:i}=r;e(F({data:i}))},onCancel:()=>{(()=>{const r=p(o.state?.pathnameStackToGoBack),i=r.poppedPathname??$();a(i,{state:{pathnameStackToGoBack:r.newStack}})})(),e(S())},onAddressClick:r=>{if(t.bankAccountContext==="express-pay")a("./add-address");else{const i=se(c,r,n),b=te(o.state?.pathnameStackToGoBack,o.pathname);a(i,{state:{pathnameStackToGoBack:b}})}},onBackClick:()=>{if(e(T({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")a("../",{relative:"path"});else{const r=p(t.location.state?.pathnameStackToGoBack),i=r.poppedPathname??$(0);t.navigate(i,{state:{pathnameStackToGoBack:r.newStack}})}e(S())}}}))(ee);function Ie({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=R(),{vendorId:s,billId:d}=V(),c=e??s,r=Z.getSignedInUser(),{useFeatureGate:i}=N(),b=H(),g=h((u=>D(u))),I=p(a.state?.pathnameStackToGoBack),f=t??(I.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h((u=>k(u,c))),{isFeatureEnabled:x}=i(v.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=i(v.isDepositAccountsFeatureEnabled);if(r==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(U,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:b.colors.grey5,boxShadow:`0px 2px ${_.sp1} ${b.colors.dropShadowNormal}`}}):l.jsxs(re,{windowSize:o,children:[l.jsx(z,{vendorId:c,billId:d}),l.jsx(de,{location:a,navigate:n,billId:d,vendorId:c,currentTenant:g,bankAccountContext:f,isVendorRecommendationEnabled:x,isZeniAccountsFeatureEnabled:y})]})}const $=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t};export{fe as A,Ie as D,z as V,me as a,se as b,ke as c,ve as d,he as g,ge as i,Se as v};
@@ -1 +1 @@
1
- import{j as i}from"./liveblocks-BYqz0SWy.js";import{_ as l,a9 as c}from"./index-C49C-P8m.js";import{u as f,D as p}from"./mui-D-_RYGgU.js";import"./sentry-DjmIorbX.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="7343a8d4-dee6-4ca7-9ab3-2b3236099e14",e._sentryDebugIdIdentifier="sentry-dbid-7343a8d4-dee6-4ca7-9ab3-2b3236099e14")}catch{}})();const b={drawerLeftMargin:new c(0,0,240)};function h(e){const{isOpen:r,drawerLeftMargin:o,children:a,onClose:t}=e,n=l(),s=o?.valuePx(n)??b.drawerLeftMargin.valuePx(n),d=f();return i.jsx(p,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${s})`}},slotProps:{backdrop:{style:{backgroundColor:d.colors.black,opacity:.8,cursor:"pointer"}}},onClose:t,children:a})}export{h as D};
1
+ import{j as i}from"./liveblocks-Css5YxVy.js";import{_ as l,a9 as c}from"./index-Di0x3KLC.js";import{u as f,D as p}from"./mui-CgZjFJJF.js";import"./sentry-BBNrx1Ml.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="7343a8d4-dee6-4ca7-9ab3-2b3236099e14",e._sentryDebugIdIdentifier="sentry-dbid-7343a8d4-dee6-4ca7-9ab3-2b3236099e14")}catch{}})();const b={drawerLeftMargin:new c(0,0,240)};function h(e){const{isOpen:r,drawerLeftMargin:o,children:a,onClose:t}=e,n=l(),s=o?.valuePx(n)??b.drawerLeftMargin.valuePx(n),d=f();return i.jsx(p,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${s})`}},slotProps:{backdrop:{style:{backgroundColor:d.colors.black,opacity:.8,cursor:"pointer"}}},onClose:t,children:a})}export{h as D};
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-BYqz0SWy.js";import{a as c}from"./sentry-DjmIorbX.js";import{h as q,u as A,g as G,i as N,j as d,N as W,l as X,n as F,o as O}from"./core-B1R51LGS.js";import{Xw as _,fI as M,WN as R,n3 as Y,SN as k,XB as $,Xq as z,m3 as V,SO as P,WS as H,WT as J,Xs as K,Xr as L}from"./zeni-epic-state-M9sMLOaG.js";import{b6 as Q,l as U,a2 as Z,p as tt}from"./index-C49C-P8m.js";import"./mui-D-_RYGgU.js";import{d as I}from"./decodeURIComponentSafe-sNmSv15A.js";import{w as et}from"./withTransactionSidePanel-ClaUsoxR.js";import{f as at,c as nt}from"./routePaths-3jcOIrRa.js";import"./recharts-By7FVN8f.js";import"./analytics-DhotUQIQ.js";import"./plaid-B0PWXAfV.js";import"./dnd-CBDtHD8g.js";import"./stripe-cKAAJElX.js";import"./lottie-C4orech3.js";import"./lexical-Cft6chCX.js";import"./pdf-DFgrdLB6.js";import"./utils-iOnDyQuG.js";import"./useAskAiCfoHostNavButtonProps-BXTsy7YX.js";import"./TransactionDetailScreen-0OB8Pqf6.js";import"./useInitialThreadRequest-BwFSf59X.js";import"./expenseAutomationHelper-Bb1c_nBx.js";import"./stripSplatSuffix-B5IwbFj2.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="a6866467-5cf7-4cd2-8cf2-4241e73c8538",a._sentryDebugIdIdentifier="sentry-dbid-a6866467-5cf7-4cd2-8cf2-4241e73c8538")}catch{}})();const ot=X((function(a,t){const e=t.entity,o=$(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:z(a,"common")},trendWithTransactionsReport:o,analytics:U,isAccountingClassesEnabled:V(a)}}),(function(a,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const o=`${nt(e,t.tenantEmailDomain)}`,l=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:l}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(K({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(L("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(H()),a(J()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??C();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(P(t.entity,"EntityDetail",{timeframe:"quarter",timePeriod:t.defaultTransactionTimePeriod}));else{const o=e.currentTimePeriod==null?e.addTimePeriod:{startDate:e.addTimePeriod.startDate,endDate:e.currentTimePeriod.endDate};a(k(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(P(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}}))(Q),it=et((function({entityType:a,...t}){const e=q(),o=A(),l=G(),[m,T]=c.useState(!1),[h,D]=c.useState(!1),{tenantEmailDomain:b,entityIdEncoded:w,entityNameEncoded:x}=N(),r=I(w??""),p=I(x??""),f=rt(r,p),j=[r,p].filter((n=>n!=null)),i={name:p,id:r,type:a,zeniId:r,qboId:r},g=d((n=>_(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter"))),v=d((n=>M(n).company?.companyInfo.firstMonthOfFY??1)),u=d((n=>R(n.trendWithTransactionsState,i,"EntityDetail")));c.useEffect((()=>{m===!1&&f===!0&&(T(!0),o(Y(i)))}),[m,f,i]);const S=d((n=>n.trendState.fetchState)),E=u?.selectedPeriod?.timePeriod??g,B=(function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y})(u?.selectedPeriod?.timePeriod,g);return c.useEffect((()=>{m===!0&&h===!1&&S==="Completed"&&(D(!0),E!=null&&o(k(i,"EntityDetail",{timeframe:u?.selectedPeriod?.timeframe??"quarter",timePeriod:E})))}),[m,h,S]),f?s.jsx(ot,{firstMonthOfFY:v,tenantEmailDomain:b,location:l,navigate:e,entity:i,defaultTransactionTimePeriod:B,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(W,{to:C(j.length)})})),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,C=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function vt({entityType:a}){return s.jsx(F,{children:s.jsx(O,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{vt as EntityDetailRoutes,vt as default};
1
+ import{j as s}from"./liveblocks-Css5YxVy.js";import{a as d}from"./sentry-BBNrx1Ml.js";import{h as q,u as A,g as G,i as N,j as c,N as W,l as X,n as F,o as O}from"./core-CSm69gJV.js";import{Xw as _,fI as M,WN as R,n3 as Y,SN as I,XB as $,Xq as z,m3 as V,SO as P,WS as H,WT as J,Xs as K,Xr as L}from"./zeni-epic-state-CQbasAjU.js";import{b6 as Q,k as U,a2 as Z,p as tt}from"./index-Di0x3KLC.js";import"./mui-CgZjFJJF.js";import{d as k}from"./decodeURIComponentSafe-DD9Neunj.js";import{w as et}from"./withTransactionSidePanel-Bb5FevX_.js";import{f as at,c as nt}from"./routePaths-DNuW5jQV.js";import"./recharts-DQBC-7lc.js";import"./analytics-BreoHt0J.js";import"./plaid-vksPD1j4.js";import"./dnd-BvLWSTOT.js";import"./stripe-cKAAJElX.js";import"./lottie-scQSn0xo.js";import"./lexical-CC3pmboN.js";import"./pdf-DXPt-TDj.js";import"./utils-B8asVtkx.js";import"./useAskAiCfoHostNavButtonProps-Ba1QPj42.js";import"./TransactionDetailScreen-Dpzd-yXF.js";import"./useInitialThreadRequest-2hi5iAsL.js";import"./expenseAutomationHelper-Djn6yrb_.js";import"./stripSplatSuffix-L-JRH5Ri.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="edb6af54-9219-4071-afdc-f3479caa2c4e",a._sentryDebugIdIdentifier="sentry-dbid-edb6af54-9219-4071-afdc-f3479caa2c4e")}catch{}})();const ot=X((function(a,t){const e=t.entity,o=$(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:z(a,"common")},trendWithTransactionsReport:o,analytics:U,isAccountingClassesEnabled:V(a)}}),(function(a,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const o=`${nt(e,t.tenantEmailDomain)}`,l=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:l}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(K({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(L("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(H()),a(J()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??b();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(P(t.entity,"EntityDetail",{timeframe:"quarter",timePeriod:t.defaultTransactionTimePeriod}));else{const o=e.currentTimePeriod==null?e.addTimePeriod:{startDate:e.addTimePeriod.startDate,endDate:e.currentTimePeriod.endDate};a(I(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(P(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}}))(Q),it=et((function({entityType:a,...t}){const e=q(),o=A(),l=G(),[m,T]=d.useState(!1),[h,D]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:w,entityNameEncoded:x}=N(),r=k(w??""),p=k(x??""),f=rt(r,p),j=[r,p].filter((n=>n!=null)),i={name:p,id:r,type:a,zeniId:r,qboId:r},g=c((n=>_(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter"))),v=c((n=>M(n).company?.companyInfo.firstMonthOfFY??1)),u=c((n=>R(n.trendWithTransactionsState,i,"EntityDetail")));d.useEffect((()=>{m===!1&&f===!0&&(T(!0),o(Y(i)))}),[m,f,i]);const S=c((n=>n.trendState.fetchState)),E=u?.selectedPeriod?.timePeriod??g,B=(function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y})(u?.selectedPeriod?.timePeriod,g);return d.useEffect((()=>{m===!0&&h===!1&&S==="Completed"&&(D(!0),E!=null&&o(I(i,"EntityDetail",{timeframe:u?.selectedPeriod?.timeframe??"quarter",timePeriod:E})))}),[m,h,S]),f?s.jsx(ot,{firstMonthOfFY:v,tenantEmailDomain:C,location:l,navigate:e,entity:i,defaultTransactionTimePeriod:B,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(W,{to:b(j.length)})})),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,b=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function vt({entityType:a}){return s.jsx(F,{children:s.jsx(O,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{vt as EntityDetailRoutes,vt as default};
@@ -1,4 +1,4 @@
1
- import{j as T}from"./liveblocks-BYqz0SWy.js";import{u as Se,h as _e,g as fe,j as O,i as Te,t as qn,l as io,n as lo,o as Ge,N as ro}from"./core-B1R51LGS.js";import{fI as ye,a1F as Jn,q4 as De,UN as xt,Aq as uo,a1G as mo,a1H as po,a1I as ho,a1J as yt,a1K as it,gk as Rt,a1L as In,eH as So,g3 as fo,a1M as Cn,a1N as lt,qX as go,uY as Io,gW as Co,gU as ko,a1O as bo,r8 as To,rh as yo,qf as Po,qt as Yn,gT as re,gV as vo,a1P as Eo,qP as Wn,ri as Ao,qq as xo,ql as Ro,v2 as wo,gS as Fe,a1Q as ut,CA as Hn,N3 as Kn,a1R as Xn,F_ as Qn,a1S as Do,e$ as Fo,f1 as _o,sZ as wt,Xx as kn,Xz as Mo,m6 as Oo,XA as Uo,md as Bo,dm as Vo,DT as Dt,a1T as jo,a1U as $o,a1V as zo,a1W as Lo,fp as Ft,sN as bn,Xq as Go,a1X as No,a1Y as qo,mf as Jo,a1Z as Yo,RO as Wo,me as Ho,m3 as Ko,qI as Zn,rn as mt,tA as ea,tW as Xo,UD as ta,rm as Tn,rp as na,rr as Qo,bF as Zo,nC as es,nz as ts,rq as rt,ro as be,a1_ as ns,rI as yn,a1$ as as,a20 as os,sR as ss,sS as cs,Xm as is,Ws as ls,a17 as rs,a21 as ds,Xs as Pn,Xr as ct,a22 as vn,mu as us,a23 as ms,a24 as ps,a25 as hs,a26 as Ss,qD as fs,a27 as gs,a28 as Is,a29 as Cs,ry as ks,mh as bs,m8 as Ts,a2a as ys,mg as En,XK as Ps,a2b as vs,a2c as Es,uz as As,ua as xs,u9 as Pt,a2d as Rs,a2e as ws,a2f as Ds,a2g as Fs,nN as _s,br as aa,nI as An,nu as Ms,a2h as Os,h3 as Us,nF as Bs,s$ as Vs,t1 as js,sK as $s,Wv as zs,Ww as Ls,Fs as Gs,Fr as Ns,FI as qs,a2i as xn,sQ as Js,sl as Ys,a2j as Ws,s1 as Hs,s6 as Ks,sh as Xs,s4 as Qs,a2k as Zs,rZ as ec,sg as tc,sW as nc,a2l as ac,t7 as oc,sE as sc,td as cc,sJ as ic,rJ as lc,a2m as rc,q$ as dc,qz as uc,qG as Rn,rt as mc,a2n as pc,a2o as hc,a2p as Sc,a2q as fc,a2r as gc,a2s as Ic,a2t as Cc,th as kc,a2u as bc,a2v as Tc,a2w as wn,uK as yc,u1 as Pc,tS as Dn,tQ as vc,a2x as Ec,tF as Ac,tk as xc,tT as Rc,a2y as wc,a2z as Dc,tq as Fc,a2A as _c,tl as Mc,tp as Oc,tn as Uc,tZ as Bc,a2B as Vc,q8 as Fn,a2C as jc,E3 as _n,cz as $c}from"./zeni-epic-state-M9sMLOaG.js";import Ut from"./NotFoundScreen-NsaSbBFa.js";import{a as o,R as oa}from"./sentry-DjmIorbX.js";import{n as Me,S as zc}from"./mui-D-_RYGgU.js";import{c as qe,$ as X,l as ee,p as Z,ao as sa,aq as ca,dM as Lc,dN as Gc,z as Je,dO as _t,dP as Nc,dQ as qc,ac as Ne,dR as Jc,dS as Mn,b8 as On,dT as Yc,a5 as ia,dU as Wc,j as dt,a as Hc,dV as Kc,dW as Xc,k as Qc,V as Zc,dX as ei,dY as ti,dZ as ni,b2 as ai,bq as oi,a9 as si,b3 as ci,b4 as ii,G as la,w as li,d_ as ri,at as Mt,d$ as di,a2 as ui,e0 as mi}from"./index-C49C-P8m.js";import{u as Bt}from"./useAskAiCfoHostNavButtonProps-BXTsy7YX.js";import{g as Un,b as pi,c as hi,h as Si,a as fi,i as gi,r as Ii,C as Ci}from"./TransactionDetailScreen-0OB8Pqf6.js";import{u as ki,a as bi}from"./useActualMatchingMatchDetail-BDFpjIdi.js";import{d as Ti}from"./decodeURIComponentSafe-sNmSv15A.js";import{m as Vt,a as ra,b as da,i as Ot}from"./expenseAutomationHelper-Bb1c_nBx.js";import{u as ua,a as ma,w as yi}from"./withTransactionSidePanel-ClaUsoxR.js";import{b as Pi,S as vi,a as Ei,J as Ai}from"./ScheduleDetailsPrepaidExpensesScreen-DQFyw5bj.js";import{s as Bn,i as pa,h as xi,v as Ri,c as wi}from"./routePaths-3jcOIrRa.js";import{a as vt}from"./accountMappingHelper-1wM-u5pk.js";import{D as Di}from"./DrawerScreen-B2FIpd3y.js";import"./recharts-By7FVN8f.js";import"./analytics-DhotUQIQ.js";import"./plaid-B0PWXAfV.js";import"./dnd-CBDtHD8g.js";import"./stripe-cKAAJElX.js";import"./lottie-C4orech3.js";import"./lexical-Cft6chCX.js";import"./pdf-DFgrdLB6.js";import"./utils-iOnDyQuG.js";import"./useInitialThreadRequest-BwFSf59X.js";import"./stripSplatSuffix-B5IwbFj2.js";import"./pathToGoBack-DZ8Lgq0-.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="aa8b360a-3222-4a76-98cd-37c7675f9168",t._sentryDebugIdIdentifier="sentry-dbid-aa8b360a-3222-4a76-98cd-37c7675f9168")}catch{}})();const Fi=()=>{const t=Se(),a=_e(),S=fe(),I=O((u=>ye(u))),{useFeatureGate:d}=qe(),{isFeatureEnabled:i}=d(X.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:l}=d(X.aiAuditScorePercentage),x=O((u=>u.expenseAutomationViewState.selectedPeriodByTenantId)),r=O((u=>Jn(u,I.tenantId))),{isAiCfoAccessEnabled:v,onAskAiCfoClick:R}=Bt({mobileExploreReferrer:"Month-End Close Overview"}),C=o.useCallback(((u,y,p=!1)=>{t(De({tenantId:y,period:{month:u.month,year:u.year},refreshViewInBackground:p}))}),[]),h=o.useCallback((u=>{const y=S.state?.referrer;r.monthEndCloseChecks?.auditSummary!=null&&ee.trackMonthCloseAuditPage(u.month,u.year,r.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",r.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,y??null),t(xt(I.tenantId,u))}),[I.tenantId,r.monthEndCloseChecks?.auditSummary,r.monthEndCloseChecks?.reportEmailSentDate]),g=x[I.tenantId],D=o.useCallback((()=>{const u=S.state?.referrer;r.monthEndCloseChecks?.auditSummary!=null&&ee.trackMonthCloseAuditPage(g.month,g.year,r.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",r.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,u??null),C(g,I.tenantId,!0)}),[C,g,I.tenantId,r.monthEndCloseChecks?.auditSummary,r.monthEndCloseChecks?.reportEmailSentDate]),B=Z(S.state?.pathnameStackToGoBack,S.pathname),V=o.useCallback((()=>{if(r.monthEndCloseChecks!=null&&g!=null){const u=r.monthEndCloseChecks.monthEndCloseCheckList.find((y=>y.progress<100));if(u!=null)return void a(`./${u.id}/${g.month}-${g.year}`,{state:{pathnameStackToGoBack:B,message:"comingFromOverview"}});a(`./month_end_insights/${g.month}-${g.year}`,{state:{pathnameStackToGoBack:B,message:"comingFromOverview"}})}}),[r.monthEndCloseChecks,g]),{areTenantIdsInSync:b}=sa();return ca({isDataReady:r.fetchState==="Completed"}),o.useEffect((()=>{g!=null&&r.fetchState!=="In-Progress"&&r.fetchState!=="Completed"&&b&&C(g,I.tenantId)}),[C,g,r.fetchState,I.tenantId,b]),o.useEffect((()=>{g!=null&&r.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&r.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&b&&t(uo(g))}),[g,r.monthClosePerformanceTrendFetchStatus.fetchState,b]),o.useEffect((()=>{const u=setInterval((()=>{r.fetchState!=="In-Progress"&&r.fetchState==="Completed"&&D()}),3e5);return()=>clearInterval(u)}),[r.fetchState]),o.useEffect((()=>{if(r.fetchState==="Completed"&&r.monthEndCloseChecks?.auditSummary!=null){const u=S.state?.referrer;ee.trackMonthCloseAuditPage(r.selectedPeriod.month,r.selectedPeriod.year,r.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",r.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,u??null)}}),[r.fetchState,r.selectedPeriod,r.monthEndCloseChecks?.auditSummary,r.monthEndCloseChecks?.reportEmailSentDate]),T.jsx(_i,{children:T.jsx(Lc,{monthEndCloseChecksView:r,isRealtimeInsightsFeatureEnabled:i,onMonthEndCheckClick:u=>{a(`./${u}/${g.month}-${g.year}`,{state:{pathnameStackToGoBack:B,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:h,handleReviewButtonClick:V,onBackClick:()=>{a("../../dashboard")},onReload:D,isAiCfoAccessEnabled:v,onAskAiCfoClick:R,aiAuditScorePercentageEnabled:l})})},_i=Me.div`
1
+ import{j as T}from"./liveblocks-Css5YxVy.js";import{u as Se,h as _e,g as fe,j as O,i as Te,t as qn,l as io,n as lo,o as Ge,N as ro}from"./core-CSm69gJV.js";import{fI as ye,a1F as Jn,q4 as De,UN as xt,Aq as uo,a1G as mo,a1H as po,a1I as ho,a1J as yt,a1K as it,gk as Rt,a1L as In,eH as So,g3 as fo,a1M as Cn,a1N as lt,qX as go,uY as Io,gW as Co,gU as ko,a1O as bo,r8 as To,rh as yo,qf as Po,qt as Yn,gT as re,gV as vo,a1P as Eo,qP as Wn,ri as Ao,qq as xo,ql as Ro,v2 as wo,gS as Fe,a1Q as ut,CA as Hn,N3 as Kn,a1R as Xn,F_ as Qn,a1S as Do,e$ as Fo,f1 as _o,sZ as wt,Xx as kn,Xz as Mo,m6 as Oo,XA as Uo,md as Bo,dm as Vo,DT as Dt,a1T as jo,a1U as $o,a1V as zo,a1W as Lo,fp as Ft,sN as bn,Xq as Go,a1X as No,a1Y as qo,mf as Jo,a1Z as Yo,RO as Wo,me as Ho,m3 as Ko,qI as Zn,rn as mt,tA as ea,tW as Xo,UD as ta,rm as Tn,rp as na,rr as Qo,bF as Zo,nC as es,nz as ts,rq as rt,ro as be,a1_ as ns,rI as yn,a1$ as as,a20 as os,sR as ss,sS as cs,Xm as is,Ws as ls,a17 as rs,a21 as ds,Xs as Pn,Xr as ct,a22 as vn,mu as us,a23 as ms,a24 as ps,a25 as hs,a26 as Ss,qD as fs,a27 as gs,a28 as Is,a29 as Cs,ry as ks,mh as bs,m8 as Ts,a2a as ys,mg as En,XK as Ps,a2b as vs,a2c as Es,uz as As,ua as xs,u9 as Pt,a2d as Rs,a2e as ws,a2f as Ds,a2g as Fs,nN as _s,br as aa,nI as An,nu as Ms,a2h as Os,h3 as Us,nF as Bs,s$ as Vs,t1 as js,sK as $s,Wv as zs,Ww as Ls,Fs as Gs,Fr as Ns,FI as qs,a2i as xn,sQ as Js,sl as Ys,a2j as Ws,s1 as Hs,s6 as Ks,sh as Xs,s4 as Qs,a2k as Zs,rZ as ec,sg as tc,sW as nc,a2l as ac,t7 as oc,sE as sc,td as cc,sJ as ic,rJ as lc,a2m as rc,q$ as dc,qz as uc,qG as Rn,rt as mc,a2n as pc,a2o as hc,a2p as Sc,a2q as fc,a2r as gc,a2s as Ic,a2t as Cc,th as kc,a2u as bc,a2v as Tc,a2w as wn,uK as yc,u1 as Pc,tS as Dn,tQ as vc,a2x as Ec,tF as Ac,tk as xc,tT as Rc,a2y as wc,a2z as Dc,tq as Fc,a2A as _c,tl as Mc,tp as Oc,tn as Uc,tZ as Bc,a2B as Vc,q8 as Fn,a2C as jc,E3 as _n,cz as $c}from"./zeni-epic-state-CQbasAjU.js";import Ut from"./NotFoundScreen-Bowln8Np.js";import{a as o,R as oa}from"./sentry-BBNrx1Ml.js";import{n as Me,S as zc}from"./mui-CgZjFJJF.js";import{c as qe,$ as X,k as ee,p as Z,ao as sa,aq as ca,dM as Lc,dN as Gc,z as Je,dO as _t,dP as Nc,dQ as qc,ac as Ne,dR as Jc,dS as Mn,b8 as On,dT as Yc,a5 as ia,dU as Wc,j as dt,a as Hc,dV as Kc,dW as Xc,I as Qc,V as Zc,dX as ei,dY as ti,dZ as ni,b2 as ai,bq as oi,a9 as si,b3 as ci,b4 as ii,G as la,w as li,d_ as ri,at as Mt,d$ as di,a2 as ui,e0 as mi}from"./index-Di0x3KLC.js";import{u as Bt}from"./useAskAiCfoHostNavButtonProps-Ba1QPj42.js";import{g as Un,b as pi,c as hi,h as Si,a as fi,i as gi,r as Ii,C as Ci}from"./TransactionDetailScreen-Dpzd-yXF.js";import{u as ki,a as bi}from"./useActualMatchingMatchDetail-CekpYB8W.js";import{d as Ti}from"./decodeURIComponentSafe-DD9Neunj.js";import{m as Vt,a as ra,b as da,i as Ot}from"./expenseAutomationHelper-Djn6yrb_.js";import{u as ua,a as ma,w as yi}from"./withTransactionSidePanel-Bb5FevX_.js";import{b as Pi,S as vi,a as Ei,J as Ai}from"./ScheduleDetailsPrepaidExpensesScreen-ByJabNd7.js";import{s as Bn,i as pa,h as xi,v as Ri,c as wi}from"./routePaths-DNuW5jQV.js";import{a as vt}from"./accountMappingHelper-BIdzFaKc.js";import{D as Di}from"./DrawerScreen-37FDqOIx.js";import"./recharts-DQBC-7lc.js";import"./analytics-BreoHt0J.js";import"./plaid-vksPD1j4.js";import"./dnd-BvLWSTOT.js";import"./stripe-cKAAJElX.js";import"./lottie-scQSn0xo.js";import"./lexical-CC3pmboN.js";import"./pdf-DXPt-TDj.js";import"./utils-B8asVtkx.js";import"./useInitialThreadRequest-2hi5iAsL.js";import"./stripSplatSuffix-L-JRH5Ri.js";import"./pathToGoBack-Cx0NwHdB.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="ba868027-0c89-41d6-b281-eeb7ff787460",t._sentryDebugIdIdentifier="sentry-dbid-ba868027-0c89-41d6-b281-eeb7ff787460")}catch{}})();const Fi=()=>{const t=Se(),a=_e(),S=fe(),I=O((u=>ye(u))),{useFeatureGate:d}=qe(),{isFeatureEnabled:i}=d(X.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:l}=d(X.aiAuditScorePercentage),x=O((u=>u.expenseAutomationViewState.selectedPeriodByTenantId)),r=O((u=>Jn(u,I.tenantId))),{isAiCfoAccessEnabled:v,onAskAiCfoClick:R}=Bt({mobileExploreReferrer:"Month-End Close Overview"}),C=o.useCallback(((u,y,p=!1)=>{t(De({tenantId:y,period:{month:u.month,year:u.year},refreshViewInBackground:p}))}),[]),h=o.useCallback((u=>{const y=S.state?.referrer;r.monthEndCloseChecks?.auditSummary!=null&&ee.trackMonthCloseAuditPage(u.month,u.year,r.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",r.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,y??null),t(xt(I.tenantId,u))}),[I.tenantId,r.monthEndCloseChecks?.auditSummary,r.monthEndCloseChecks?.reportEmailSentDate]),g=x[I.tenantId],D=o.useCallback((()=>{const u=S.state?.referrer;r.monthEndCloseChecks?.auditSummary!=null&&ee.trackMonthCloseAuditPage(g.month,g.year,r.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",r.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,u??null),C(g,I.tenantId,!0)}),[C,g,I.tenantId,r.monthEndCloseChecks?.auditSummary,r.monthEndCloseChecks?.reportEmailSentDate]),B=Z(S.state?.pathnameStackToGoBack,S.pathname),V=o.useCallback((()=>{if(r.monthEndCloseChecks!=null&&g!=null){const u=r.monthEndCloseChecks.monthEndCloseCheckList.find((y=>y.progress<100));if(u!=null)return void a(`./${u.id}/${g.month}-${g.year}`,{state:{pathnameStackToGoBack:B,message:"comingFromOverview"}});a(`./month_end_insights/${g.month}-${g.year}`,{state:{pathnameStackToGoBack:B,message:"comingFromOverview"}})}}),[r.monthEndCloseChecks,g]),{areTenantIdsInSync:b}=sa();return ca({isDataReady:r.fetchState==="Completed"}),o.useEffect((()=>{g!=null&&r.fetchState!=="In-Progress"&&r.fetchState!=="Completed"&&b&&C(g,I.tenantId)}),[C,g,r.fetchState,I.tenantId,b]),o.useEffect((()=>{g!=null&&r.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&r.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&b&&t(uo(g))}),[g,r.monthClosePerformanceTrendFetchStatus.fetchState,b]),o.useEffect((()=>{const u=setInterval((()=>{r.fetchState!=="In-Progress"&&r.fetchState==="Completed"&&D()}),3e5);return()=>clearInterval(u)}),[r.fetchState]),o.useEffect((()=>{if(r.fetchState==="Completed"&&r.monthEndCloseChecks?.auditSummary!=null){const u=S.state?.referrer;ee.trackMonthCloseAuditPage(r.selectedPeriod.month,r.selectedPeriod.year,r.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",r.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,u??null)}}),[r.fetchState,r.selectedPeriod,r.monthEndCloseChecks?.auditSummary,r.monthEndCloseChecks?.reportEmailSentDate]),T.jsx(_i,{children:T.jsx(Lc,{monthEndCloseChecksView:r,isRealtimeInsightsFeatureEnabled:i,onMonthEndCheckClick:u=>{a(`./${u}/${g.month}-${g.year}`,{state:{pathnameStackToGoBack:B,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:h,handleReviewButtonClick:V,onBackClick:()=>{a("../../dashboard")},onReload:D,isAiCfoAccessEnabled:v,onAskAiCfoClick:R,aiAuditScorePercentageEnabled:l})})},_i=Me.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-BYqz0SWy.js";import{a as r}from"./sentry-DjmIorbX.js";import{au as f,av as i,Z as l,a2 as p}from"./index-C49C-P8m.js";import"./mui-D-_RYGgU.js";import m from"./NotFoundScreen-NsaSbBFa.js";import{h as b,g as u}from"./core-B1R51LGS.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]="c5cccb90-93ef-49b9-9d2f-d25df6a7e6b3",e._sentryDebugIdIdentifier="sentry-dbid-c5cccb90-93ef-49b9-9d2f-d25df6a7e6b3")}catch{}})();const _=()=>{const e=b(),a=u(),t=r.useCallback((()=>{window.open("https://www.zeni.ai/demo/request","_blank")}),[]),d=r.useCallback((()=>{(()=>{const n=p(a.state?.pathnameStackToGoBack),c=n.poppedPathname??k();e(c,{state:{pathnameStackToGoBack:n.newStack}})})()}),[]),o=f(a.pathname);return o!=null?s.jsx(i,{menuItem:l(o),onDemoClick:t,onGoBack:d}):s.jsx(m,{})},k=(e=2)=>{let a="../";for(let t=0;t<e;t++)a=`${a}../`;return a};export{_ as F};
1
+ import{j as s}from"./liveblocks-Css5YxVy.js";import{a as r}from"./sentry-BBNrx1Ml.js";import{au as f,av as i,Z as l,a2 as p}from"./index-Di0x3KLC.js";import"./mui-CgZjFJJF.js";import m from"./NotFoundScreen-Bowln8Np.js";import{h as b,g as u}from"./core-CSm69gJV.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]="c5cccb90-93ef-49b9-9d2f-d25df6a7e6b3",e._sentryDebugIdIdentifier="sentry-dbid-c5cccb90-93ef-49b9-9d2f-d25df6a7e6b3")}catch{}})();const _=()=>{const e=b(),a=u(),t=r.useCallback((()=>{window.open("https://www.zeni.ai/demo/request","_blank")}),[]),d=r.useCallback((()=>{(()=>{const n=p(a.state?.pathnameStackToGoBack),c=n.poppedPathname??k();e(c,{state:{pathnameStackToGoBack:n.newStack}})})()}),[]),o=f(a.pathname);return o!=null?s.jsx(i,{menuItem:l(o),onDemoClick:t,onGoBack:d}):s.jsx(m,{})},k=(e=2)=>{let a="../";for(let t=0;t<e;t++)a=`${a}../`;return a};export{_ as F};
@@ -1 +1 @@
1
- import{a as i}from"./sentry-DjmIorbX.js";import{u as l,h as f,g as m}from"./core-B1R51LGS.js";import{i0 as p,V8 as g,V9 as _}from"./zeni-epic-state-M9sMLOaG.js";import{u as b,L as h,z as y}from"./index-C49C-P8m.js";import"./liveblocks-BYqz0SWy.js";import"./recharts-By7FVN8f.js";import"./mui-D-_RYGgU.js";import"./analytics-DhotUQIQ.js";import"./plaid-B0PWXAfV.js";import"./dnd-CBDtHD8g.js";import"./stripe-cKAAJElX.js";import"./lottie-C4orech3.js";import"./lexical-Cft6chCX.js";import"./pdf-DFgrdLB6.js";import"./utils-iOnDyQuG.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]="a48ab914-268c-45f4-8c38-e3b31f5837ea",e._sentryDebugIdIdentifier="sentry-dbid-a48ab914-268c-45f4-8c38-e3b31f5837ea")}catch{}})();function V(){const e=l(),n=f(),r=m(),{setLoading:o,clearAllLoading:d}=b(),a=i.useRef(!1);return i.useLayoutEffect((()=>{o(h.CONNECTION_AUTH)}),[o]),i.useEffect((()=>{if(a.current)return;a.current=!0;const s=new URLSearchParams(r.search).get("code"),c=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),s!=null&&c!=null){const t=JSON.parse(c);e(p(t.tenant_id,t.connection_id,g("revenue"),_("hubspot"),{authorization_code:s,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}d();const u=y.getActiveTenantForUser();n(u?.tenantEmailDomain!=null?`/${u.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})}),[]),null}export{V as default};
1
+ import{a as i}from"./sentry-BBNrx1Ml.js";import{u as l,h as f,g as m}from"./core-CSm69gJV.js";import{i0 as p,V8 as g,V9 as _}from"./zeni-epic-state-CQbasAjU.js";import{u as b,L as h,z as y}from"./index-Di0x3KLC.js";import"./liveblocks-Css5YxVy.js";import"./recharts-DQBC-7lc.js";import"./mui-CgZjFJJF.js";import"./analytics-BreoHt0J.js";import"./plaid-vksPD1j4.js";import"./dnd-BvLWSTOT.js";import"./stripe-cKAAJElX.js";import"./lottie-scQSn0xo.js";import"./lexical-CC3pmboN.js";import"./pdf-DXPt-TDj.js";import"./utils-B8asVtkx.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]="a48ab914-268c-45f4-8c38-e3b31f5837ea",e._sentryDebugIdIdentifier="sentry-dbid-a48ab914-268c-45f4-8c38-e3b31f5837ea")}catch{}})();function V(){const e=l(),n=f(),r=m(),{setLoading:o,clearAllLoading:d}=b(),a=i.useRef(!1);return i.useLayoutEffect((()=>{o(h.CONNECTION_AUTH)}),[o]),i.useEffect((()=>{if(a.current)return;a.current=!0;const s=new URLSearchParams(r.search).get("code"),c=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),s!=null&&c!=null){const t=JSON.parse(c);e(p(t.tenant_id,t.connection_id,g("revenue"),_("hubspot"),{authorization_code:s,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}d();const u=y.getActiveTenantForUser();n(u?.tenantEmailDomain!=null?`/${u.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})}),[]),null}export{V as default};
@@ -1 +1 @@
1
- import{n as s}from"./liveblocks-BYqz0SWy.js";import{j as c}from"./core-B1R51LGS.js";import{fI as f}from"./zeni-epic-state-M9sMLOaG.js";import"./sentry-DjmIorbX.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="25fc1afa-344c-4436-b7c0-ce0cb6697f63",e._sentryDebugIdIdentifier="sentry-dbid-25fc1afa-344c-4436-b7c0-ce0cb6697f63")}catch{}})();const b=()=>c((e=>f(e))).tenantId==null?{inboxNotifications:[],isLoading:!1,isFetchingMore:!1,hasFetchedAll:!0,fetchMore:()=>null}:(()=>{const{inboxNotifications:e,isLoading:o,isFetchingMore:i,hasFetchedAll:t,fetchMore:n}=s();return{inboxNotifications:e,isLoading:o,isFetchingMore:i,hasFetchedAll:t,fetchMore:n}})();export{b as u};
1
+ import{n as s}from"./liveblocks-Css5YxVy.js";import{j as c}from"./core-CSm69gJV.js";import{fI as f}from"./zeni-epic-state-CQbasAjU.js";import"./sentry-BBNrx1Ml.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="25fc1afa-344c-4436-b7c0-ce0cb6697f63",e._sentryDebugIdIdentifier="sentry-dbid-25fc1afa-344c-4436-b7c0-ce0cb6697f63")}catch{}})();const b=()=>c((e=>f(e))).tenantId==null?{inboxNotifications:[],isLoading:!1,isFetchingMore:!1,hasFetchedAll:!0,fetchMore:()=>null}:(()=>{const{inboxNotifications:e,isLoading:o,isFetchingMore:i,hasFetchedAll:t,fetchMore:n}=s();return{inboxNotifications:e,isLoading:o,isFetchingMore:i,hasFetchedAll:t,fetchMore:n}})();export{b as u};