@zeniai/web-app-ui 5.0.72-qa → 5.0.73-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 (110) hide show
  1. package/dist/assets/AddressRoutes-vEmbHNov.js +1 -0
  2. package/dist/assets/{AddressScreen-Ix5tWZHc.js → AddressScreen-sV_yd7Ab.js} +1 -1
  3. package/dist/assets/AiCfoScreen-CkQJ9kWE.js +22 -0
  4. package/dist/assets/{BillPayApprovalRoutes-BHzH7Hrm.js → BillPayApprovalRoutes-6Xe2lQnv.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-DnL_Dd5v.js → BillPayRoutes-BGIYRh2R.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-CpwixfEl.js → BusinessVerificationPageScreen-BDq5GBUB.js} +2 -2
  7. package/dist/assets/{ChargeCardRoutes-D7SOpqVu.js → ChargeCardRoutes-BeXE4F2M.js} +9 -9
  8. package/dist/assets/{CompanyPassportScreen-5JBMtbdY.js → CompanyPassportScreen-B3j9Q675.js} +1 -1
  9. package/dist/assets/{ConnectionAuthScreen-BgsvoVoV.js → ConnectionAuthScreen-B1CZiKGw.js} +1 -1
  10. package/dist/assets/CustomerOnboardingAuthScreen-BVcML8Yt.js +1 -0
  11. package/dist/assets/{CustomerOnboardingRoutes-BLkcQSzU.js → CustomerOnboardingRoutes-YOWG50ES.js} +1 -1
  12. package/dist/assets/DashboardRoutes-BmzocddP.js +20 -0
  13. package/dist/assets/{DefaultTenantHome-DOFkLxHn.js → DefaultTenantHome-LvjDBkWr.js} +1 -1
  14. package/dist/assets/{DomesticWireDetailScreen-D9of53D2.js → DomesticWireDetailScreen-CYvq9np3.js} +3 -3
  15. package/dist/assets/{DrawerScreen-0fzJHN6i.js → DrawerScreen-rD1CnMVg.js} +1 -1
  16. package/dist/assets/{EntityDetailRoutes-vYzM0syH.js → EntityDetailRoutes-By0WRr_0.js} +1 -1
  17. package/dist/assets/{ExpenseAutomationRoutes-JGGxLdwj.js → ExpenseAutomationRoutes-D9GRWLL6.js} +1 -1
  18. package/dist/assets/{FeaturePreviewScreen-B_upIV_z.js → FeaturePreviewScreen-BDJyKHVm.js} +1 -1
  19. package/dist/assets/{HubSpotOAuthCallbackScreen-Dnafv1F_.js → HubSpotOAuthCallbackScreen-CrwxZG5v.js} +1 -1
  20. package/dist/assets/{MagicLinkRoutes-Dlg_sv3w.js → MagicLinkRoutes-Caa30mp9.js} +1 -1
  21. package/dist/assets/{MagicLinkSignInScreen-BSQuMqe_.js → MagicLinkSignInScreen-CgyZEZjg.js} +1 -1
  22. package/dist/assets/MobileAppDrawer-G8G6Y9KP.js +1 -0
  23. package/dist/assets/NotFoundScreen-C17gldyA.js +1 -0
  24. package/dist/assets/{NotificationRoutes-C5EL7Dp4.js → NotificationRoutes-BYnfAO7g.js} +1 -1
  25. package/dist/assets/{OAuthConsentScreen-KmZzxwuS.js → OAuthConsentScreen-DVU9ASdk.js} +1 -1
  26. package/dist/assets/{PandLWithForecastRoutes-Df6uqgw5.js → PandLWithForecastRoutes-Cs0bBxgV.js} +1 -1
  27. package/dist/assets/{PeopleRoutes-W4o9CWZ7.js → PeopleRoutes-BMXjwpbj.js} +1 -1
  28. package/dist/assets/PerformanceRoutes-BUQlCdIG.js +1 -0
  29. package/dist/assets/{Preview-fN-QilxH.js → Preview-63x8M4Zb.js} +1 -1
  30. package/dist/assets/{QBOConnectionScreen-QfAoc6ay.js → QBOConnectionScreen-DC-3uNRy.js} +1 -1
  31. package/dist/assets/{ReferralListScreen-SdB5w2hV.js → ReferralListScreen-eM_oSQAW.js} +2 -2
  32. package/dist/assets/ReimbursementApprovalRoutes-IXiO8szf.js +1 -0
  33. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-qyltnFfM.js → ReimbursementApprovalRuleDetailScreen-_35fo-ny.js} +1 -1
  34. package/dist/assets/{ReimbursementRoutes-CbGhl870.js → ReimbursementRoutes-DhS09PpD.js} +1 -1
  35. package/dist/assets/{ReportsRoutes-Di3ZlGga.js → ReportsRoutes-BBk0QrPw.js} +1 -1
  36. package/dist/assets/RewardsRoutes-BJ1dLCxY.js +1 -0
  37. package/dist/assets/{ScreenRoutes-CSJKItCB.js → ScreenRoutes-E9jfC1_X.js} +2 -2
  38. package/dist/assets/{SettingsRoutes-DRoWWDnI.js → SettingsRoutes-DD0pRBoF.js} +6 -6
  39. package/dist/assets/{SetupPagesScreen-NZz5aFHU.js → SetupPagesScreen-B4FAnCzI.js} +1 -1
  40. package/dist/assets/{SignInScreen-BI2QJmsm.js → SignInScreen-BbRMQaC6.js} +1 -1
  41. package/dist/assets/{SignOutScreen-DWdPOV-f.js → SignOutScreen-DmDoYwvZ.js} +1 -1
  42. package/dist/assets/{TaskListScreen-7nDHDAx6.js → TaskListScreen-J32RYdXo.js} +2 -2
  43. package/dist/assets/TaskRoutes-CDbgH0-b.js +9 -0
  44. package/dist/assets/TransactionDetailRoutes-Bo6LxDnL.js +1 -0
  45. package/dist/assets/{TransactionDetailScreen-Bu7653PN.js → TransactionDetailScreen-BW7drAuq.js} +1 -1
  46. package/dist/assets/{TransactionListRoutes-CfjNPOQt.js → TransactionListRoutes-DrpPDsUB.js} +1 -1
  47. package/dist/assets/{TreasuryRoutes-YBCYhuyC.js → TreasuryRoutes-LIknkYk2.js} +4 -4
  48. package/dist/assets/{VendorsRoutes-BfFmnVL2.js → VendorsRoutes-BM26kA8q.js} +1 -1
  49. package/dist/assets/{WiseConfirmationScreen-BTbWpX1H.js → WiseConfirmationScreen-ZXNPthsT.js} +1 -1
  50. package/dist/assets/{ZeniAccountRoutes-BhHNPKTB.js → ZeniAccountRoutes-DT8xK0Hv.js} +1 -1
  51. package/dist/assets/{ZeniAccountStatementScreen-B_lseazU.js → ZeniAccountStatementScreen-BUz2lAXH.js} +2 -2
  52. package/dist/assets/{accountMappingHelper-yvOeY36k.js → accountMappingHelper-DEVWShIB.js} +1 -1
  53. package/dist/assets/{analytics-CFOBCmx3.js → analytics-CLyVqw3m.js} +1 -1
  54. package/dist/assets/{analyticsHelper-Bx8A0vf3.js → analyticsHelper-DF_egLQC.js} +1 -1
  55. package/dist/assets/{core-B86WF2Ww.js → core-B8DAi0nh.js} +1 -1
  56. package/dist/assets/{decodeURIComponentSafe-C-DNZuqb.js → decodeURIComponentSafe-2RJaUBNT.js} +1 -1
  57. package/dist/assets/{dnd-DrUSXn8k.js → dnd-DNrenqEc.js} +1 -1
  58. package/dist/assets/{empty-CRbjQ82E.js → empty-CMYkwe6B.js} +1 -1
  59. package/dist/assets/{empty-Dfl21Uq6.js → empty-D1H0TyYI.js} +1 -1
  60. package/dist/assets/{emptyVideoElement-Cn2ijyYz.js → emptyVideoElement-89AhO6II.js} +1 -1
  61. package/dist/assets/{epic-D4mIFLgi.js → epic-occCJYrK.js} +1 -1
  62. package/dist/assets/{getLocaleForTenant-DNhjRuKy.js → getLocaleForTenant-CuY27Ik8.js} +1 -1
  63. package/dist/assets/{index-BaOA81A8.js → index-CVyF-mcC.js} +1 -1
  64. package/dist/assets/{index-Ch8CfHB9.js → index-CrWxCSey.js} +1 -1
  65. package/dist/assets/{index-CcACvObI.js → index-DXkdnQWz.js} +1 -1
  66. package/dist/assets/{index-vzrF8p0m.js → index-LbX_nh30.js} +2 -2
  67. package/dist/assets/{index-CkmaHLOP.js → index-cQHaeS6s.js} +9549 -9543
  68. package/dist/assets/{index-D-Bl3J2P.js → index-eEUBMv7A.js} +1 -1
  69. package/dist/assets/{index-BHE-07hU.js → index-o5I9Rsf6.js} +1 -1
  70. package/dist/assets/{index-BeL81npV.js → index-orAkddId.js} +1 -1
  71. package/dist/assets/{lexical-COpm991f.js → lexical-BbcB7U6u.js} +1 -1
  72. package/dist/assets/{liveblocks-D41N0IlG.js → liveblocks-6nZkQHFl.js} +1 -1
  73. package/dist/assets/{lottie-BHETr187.js → lottie-Cp94NU-O.js} +1 -1
  74. package/dist/assets/{mui-DZd7XaFW.js → mui-DOBONCVx.js} +1 -1
  75. package/dist/assets/{pathToGoBack-Dt_z5GBF.js → pathToGoBack-CuzLi8kB.js} +1 -1
  76. package/dist/assets/{pdf-BdWka_4Q.js → pdf-B9LwAnPJ.js} +4 -4
  77. package/dist/assets/{pdf-lib-DmLnrwkt.js → pdf-lib-B6W-Zb6c.js} +1 -1
  78. package/dist/assets/{plaid-CZm5yErz.js → plaid-BJER8-rG.js} +1 -1
  79. package/dist/assets/{pusher-BTnbGSy-.js → pusher-BKAvW8Ej.js} +1 -1
  80. package/dist/assets/{react-5WKYmmJ2.js → react-Az4VFoYA.js} +1 -1
  81. package/dist/assets/{react-BBgH-vWa.js → react-BsAtiQ73.js} +1 -1
  82. package/dist/assets/{react-CqgPSYXh.js → react-Ch8Qff_2.js} +1 -1
  83. package/dist/assets/{react-DLXiwY4W.js → react-DZuEKM1F.js} +1 -1
  84. package/dist/assets/{react-BcXMc1LZ.js → react-XdIGJaYE.js} +1 -1
  85. package/dist/assets/{react-CEFsrN8T.js → react-m-TEyxm9.js} +1 -1
  86. package/dist/assets/{recharts-BHLF4b4u.js → recharts-CDgByeDS.js} +1 -1
  87. package/dist/assets/{routePaths-C8NVJkmp.js → routePaths-CHt7s04E.js} +1 -1
  88. package/dist/assets/{sentry-Bhr8KU--.js → sentry-Dr5FPm4d.js} +1 -1
  89. package/dist/assets/{url-CgMNpbBl.js → url-CgpVackm.js} +1 -1
  90. package/dist/assets/{url-qE7MaS1D.js → url-DhbS62gt.js} +1 -1
  91. package/dist/assets/{useAskAiCfoHostNavButtonProps-DRzMbg61.js → useAskAiCfoHostNavButtonProps-D-63GR-J.js} +1 -1
  92. package/dist/assets/{useDeviceId-rK1IEgER.js → useDeviceId-fW8BPEnA.js} +1 -1
  93. package/dist/assets/{useFetchSuggestedQuestionsWhenReady-dE_HTM0_.js → useFetchSuggestedQuestionsWhenReady-Cq8Wv1kQ.js} +1 -1
  94. package/dist/assets/{useInitialThreadRequest-DlZM3Hgb.js → useInitialThreadRequest-NWqhrnxo.js} +1 -1
  95. package/dist/assets/{utils-Mvk27uIx.js → utils-XBrV3QeH.js} +1 -1
  96. package/dist/assets/{withTransactionSidePanel-g1cpVyXy.js → withTransactionSidePanel-CTJGoNFJ.js} +1 -1
  97. package/dist/assets/{zeni-epic-state-BLvcbIPk.js → zeni-epic-state-DITtSXPQ.js} +3 -3
  98. package/dist/index.html +1 -1
  99. package/package.json +2 -2
  100. package/dist/assets/AddressRoutes-CtOGPOAj.js +0 -1
  101. package/dist/assets/AiCfoScreen-DibhVPUo.js +0 -11
  102. package/dist/assets/CustomerOnboardingAuthScreen-q2OxHMS0.js +0 -1
  103. package/dist/assets/DashboardRoutes-DIeIg4ky.js +0 -20
  104. package/dist/assets/MobileAppDrawer-BF7-1gg_.js +0 -1
  105. package/dist/assets/NotFoundScreen--NgVTkpE.js +0 -1
  106. package/dist/assets/PerformanceRoutes-DS0Ils-z.js +0 -1
  107. package/dist/assets/ReimbursementApprovalRoutes-CRONWgl9.js +0 -1
  108. package/dist/assets/RewardsRoutes-C2agHY9i.js +0 -1
  109. package/dist/assets/TaskRoutes-Ds4xpskA.js +0 -9
  110. package/dist/assets/TransactionDetailRoutes-CPiB8Vo9.js +0 -1
@@ -0,0 +1,20 @@
1
+ import{j as l}from"./liveblocks-6nZkQHFl.js";import{l as $,g as S,u as q,h as N,j as Z,k as Q,s as Ka,n as st,o as w}from"./core-B8DAi0nh.js";import{eO as L,K8 as Ye,bD as Gt,bq as he,Ll as qa,i0 as Za,Lm as wt,Ln as Ha,i3 as rt,Lo as je,Lp as Qa,i8 as Ja,Lq as Dt,Lr as Wa,ic as it,Ls as Me,Lt as Xa,ck as lt,Lu as en,Lv as tn,Ks as an,j6 as nn,Lw as on,bn as Ee,Lx as Nt,JY as ae,bc as zt,jk as $t,mD as Kt,j3 as qt,J_ as ne,JZ as H,f3 as sn,eL as rn,fl as cn,Ly as ln,Lz as dn,LA as Zt,LB as _e,tR as Ie,tS as Te,ud as fe,u7 as oe,tW as xe,LC as un,LD as mn,LE as pn,LF as Ht,LG as ke,LH as hn,dC as Ve,qm as Qt,LI as fn,LJ as gn,LK as bn,LL as dt,Jl as ut,jA as ge,ul as mt,qu as Cn,LM as _n,tT as Ft,qp as me,ql as Jt,LN as ie,LO as kn,LP as pt,Jj as ht,st as Wt,LQ as Sn,LR as yn,LS as An,LT as ft,sG as vn,LU as En,tV as Ot,ss as Xt,LV as ce,LW as In,bv as ea,up as ta,LX as Tn,LY as xn,LZ as wn,L_ as gt,uk as Dn,L$ as Fn,tU as Pt,uo as aa,M0 as le,M1 as On,M2 as Pn,M3 as na,jp as oa,mA as sa,ju as ra,my as ia,mx as ca,mw as la,rR as Rn,fb as Bn,cN as Ln,cO as jn,mt as Mn,f7 as Un,mK as Yn,Dt as Rt,M4 as Vn,M5 as Gn,M6 as Nn,M7 as zn,b5 as bt,e_ as $n,gK as Kn,fC as qn,mE as Zn,iY as Hn,mB as Qn,mz as Jn,eU as Wn,eS as Xn}from"./zeni-epic-state-DITtSXPQ.js";import{z as B,W as J,n as D,c as E,D as K,aR as eo,w as we,aS as da,e as V,aT as to,k as De,aU as ua,y as Ge,S as j,m as ao,aV as no,aW as oo,Q as ma,Z as so,a as pa,a1 as ro,aK as ha,aX as io,aY as co,V as lo,aZ as uo,a_ as mo,an as po,p as ho,R as fo,a$ as go,b0 as ye}from"./index-cQHaeS6s.js";import{n as Ct}from"./mui-DOBONCVx.js";import{a as C}from"./sentry-Dr5FPm4d.js";import{w as fa}from"./withTransactionSidePanel-CTJGoNFJ.js";import{b as ga,t as be,e as se,a as _t,v as bo}from"./routePaths-CHt7s04E.js";import{u as W}from"./useAskAiCfoHostNavButtonProps-D-63GR-J.js";import{c as Fe,b as Co,u as _o}from"./useFetchSuggestedQuestionsWhenReady-Cq8Wv1kQ.js";import ve from"./NotFoundScreen-C17gldyA.js";import{t as ba}from"./analyticsHelper-DF_egLQC.js";import{C as ko}from"./CompanyPassportScreen-B3j9Q675.js";import{F as So}from"./FeaturePreviewScreen-BDJyKHVm.js";import{R as yo}from"./ReferralListScreen-eM_oSQAW.js";import"./recharts-CDgByeDS.js";import"./analytics-CLyVqw3m.js";import"./plaid-BJER8-rG.js";import"./dnd-DNrenqEc.js";import"./stripe-DMRn4zHo.js";import"./lottie-Cp94NU-O.js";import"./lexical-BbcB7U6u.js";import"./pdf-B9LwAnPJ.js";import"./utils-XBrV3QeH.js";import"./TransactionDetailScreen-BW7drAuq.js";import"./decodeURIComponentSafe-2RJaUBNT.js";import"./MobileAppDrawer-G8G6Y9KP.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]="5854d826-f155-4145-af99-ceafebc0bc81",e._sentryDebugIdIdentifier="sentry-dbid-5854d826-f155-4145-af99-ceafebc0bc81")}catch{}})();const Ao=fa(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=$(),s=B.getSignedInUser(),i=S(I=>I.tenantState.currentTenantId),d=S(I=>L(I)),{tenantEmailDomain:p}=$(),_=q(),g=d?.companyName??"",u={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},c=C.useMemo(()=>({authParams:u,companyName:g,downloadEndPoint:`${J}/agingDetailedReport`,timezone:Ye()}),[]),m=C.useMemo(()=>r!=null?Gt(r):he(),[r]),h=N(),f=Z(),k=S(I=>qa(I,m,o)),y=C.useCallback(()=>{o!=null&&k.fetchState!=="In-Progress"&&k.fetchState!=="Completed"&&h(Za(o,m))},[m]),b=C.useCallback(()=>{f("../../",{relative:"path"})},[]),A=C.useCallback((I,z)=>{h(wt({sortKey:I,sortOrder:z}))},[]),T=C.useCallback(I=>{h(wt({downloadState:I}))},[]),M=C.useCallback(I=>{if(e)e(I.transactionId,I.transactionType);else if(p!=null){const z=ga({id:I.transactionId,type:I.transactionType},p);f(z);const de=D(_.state?.pathnameStackToGoBack,_.pathname);f(z,{state:{pathnameStackToGoBack:de}})}},[p,e]),F=C.useCallback(()=>{k.vendor!=null&&E.trackApAgingDetail("AP Aging",m.format(K.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),k.vendor.id,k.vendor.name)},[k.vendor,m]);return C.useEffect(()=>{y()},[]),C.useEffect(()=>{k.fetchState==="Completed"&&F()},[F,k.fetchState]),l.jsx(eo,{apAgingDetail:k,downloadParams:c,reportDate:m,analytics:E,onTransactionClick:M,onReload:y,onBackClick:b,onColumnSortConfigChanged:A,updateDownloadStateHandler:T,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),vo=()=>{const e=N(),a=Z(),t=S(A=>Ha(A)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=W({mobileExploreReferrer:"AP Aging"});Fe({isDataReady:t.fetchState==="Completed"});const r=B.getSignedInUser(),s=S(A=>A.tenantState.currentTenantId),i=S(A=>L(A)),d=i?.companyName??"",p={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},_=C.useMemo(()=>({authParams:p,companyName:d,downloadEndPoint:`${J}/agingReport`,timezone:Ye()}),[]),g=t.apAgingUIState.selectedDate??he(),u=C.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(rt(g))},[]);C.useEffect(()=>{u()},[]);const c=C.useCallback(()=>{a("../",{relative:"path"})},[]),m=C.useCallback(A=>{e(je({searchString:A}))},[]),h=C.useCallback((A,T)=>{e(je({sortKey:T,sortOrder:A}))},[]),f=C.useCallback(A=>{a(`./${A}/${g.format(K.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[g]),k=C.useCallback(A=>{e(je({downloadState:A}))},[]),y=C.useCallback((A,T)=>{},[]),b=C.useCallback((A,T)=>{e(je({selectedDate:A,agingDateSelectionType:T})),e(rt(A))},[]);return l.jsxs(l.Fragment,{children:[t.fetchState==="Completed"?l.jsx(we,{analytics:E,onLoad:A=>A.trackPageLoaded(V.Event.agingReport,"AP Aging")}):null,l.jsx(da,{uiState:t.apAgingUIState,report:t,downloadParams:_,analytics:E,onReloadReport:u,onBackClick:c,onSearchTextChange:m,onSortOrderChange:h,onEntityNameClick:f,updateDownloadStateHandler:k,onSelectedDateChanged:b,onNodeCollapseToggled:y,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},Eo=fa(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=$(),s=B.getSignedInUser(),i=S(F=>L(F)),{tenantEmailDomain:d}=$(),p=q(),_=i.companyName,g={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},u=C.useMemo(()=>({authParams:g,companyName:_,downloadEndPoint:`${J}/agingDetailedReport`,timezone:Ye()}),[]),c=C.useMemo(()=>r!=null?Gt(r):he(),[r]),m=N(),h=Z(),f=S(F=>Qa(F,c,o)),k=C.useCallback(()=>{o!=null&&f.fetchState!=="In-Progress"&&f.fetchState!=="Completed"&&m(Ja(o,c))},[c]),y=C.useCallback(()=>{h("../../",{relative:"path"})},[]),b=C.useCallback((F,I)=>{m(Dt({sortKey:F,sortOrder:I}))},[]),A=C.useCallback(F=>{m(Dt({downloadState:F}))},[]),T=C.useCallback(F=>{if(e)e(F.transactionId,F.transactionType);else if(d!=null){const I=ga({id:F.transactionId,type:F.transactionType},d);h(I);const z=D(p.state?.pathnameStackToGoBack,p.pathname);h(I,{state:{pathnameStackToGoBack:z}})}},[d,e]),M=C.useCallback(()=>{f.customer!=null&&E.trackArAgingDetail("AR Aging",c.format(K.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),f.customer.id,f.customer.name)},[f.customer,c]);return C.useEffect(()=>{k()},[]),C.useEffect(()=>{f.fetchState==="Completed"&&M()},[f.fetchState,M]),l.jsx(to,{arAgingDetail:f,downloadParams:u,reportDate:c,analytics:E,onTransactionClick:T,onReload:k,onBackClick:y,onColumnSortConfigChanged:b,updateDownloadStateHandler:A,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),Io=()=>{const e=N(),a=Z(),t=S(b=>Wa(b)),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=W({mobileExploreReferrer:"AR Aging"});Fe({isDataReady:t.fetchState==="Completed"});const r=B.getSignedInUser(),s=S(b=>L(b)),i=s.companyName,d={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},p=C.useMemo(()=>({authParams:d,companyName:i,downloadEndPoint:`${J}/agingReport`,timezone:Ye()}),[]),_=t.arAgingUIState.selectedDate??he(),g=C.useCallback(()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(it(_))},[]);C.useEffect(()=>{g()},[]);const u=C.useCallback(()=>{a("../",{relative:"path"})},[]),c=C.useCallback(b=>{e(Me({searchString:b}))},[]),m=C.useCallback((b,A)=>{e(Me({sortKey:A,sortOrder:b}))},[]),h=C.useCallback(b=>{a(`./${b}/${_.format(K.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[_]),f=C.useCallback(b=>{e(Me({downloadState:b}))},[]),k=C.useCallback((b,A)=>{e(Me({selectedDate:b,agingDateSelectionType:A})),e(it(b))},[]),y=C.useCallback((b,A)=>{e(Xa({nodeId:b,isCollapsed:A}))},[]);return l.jsxs(l.Fragment,{children:[t.fetchState==="Completed"?l.jsx(we,{analytics:E,onLoad:b=>b.trackPageLoaded(V.Event.agingReport,"AR Aging")}):null,l.jsx(da,{uiState:t.arAgingUIState,report:t,downloadParams:p,analytics:E,onReloadReport:g,onBackClick:u,onSearchTextChange:c,onSortOrderChange:m,onEntityNameClick:h,updateDownloadStateHandler:f,onSelectedDateChanged:k,onNodeCollapseToggled:y,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},Ca=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function _a(e,a){const t=an(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=be(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(nn(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?E.trackZeniAccountsCashBalancePromoClicked("Move Money"):(E.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else E.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const To=Q(function(e){const a=en(e).accountsInOrder.map((n,o)=>Ca(n,o)),t=tn(e);return{sectionTitle:K.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:E}},_a)(ua),xo=Q(function(e){const a=on(e).accountsInOrder.map((o,r)=>Ca(o,r)),t=B.getSignedInUser(),n=Ee(t);return{sectionTitle:K.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:E}},_a)(ua);function wo(){const e=Z(),a=q(),{tenantEmailDomain:t}=$(),n=De(),o=S(s=>L(s).company?.companyInfo.firstMonthOfFY??1),r=lt(n?.loggedInUserRoleMap);return S(s=>s.cashBalanceState.fetchState)==="Error"?l.jsx(ve,{}):l.jsx(To,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function Do(){const e=Z(),a=q(),{tenantEmailDomain:t}=$(),n=De(),o=lt(n?.loggedInUserRoleMap),r=S(s=>L(s).company?.companyInfo.firstMonthOfFY??1);return S(s=>s.cardBalanceState.fetchState)==="Error"?l.jsx(ve,{}):l.jsx(xo,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const Fo=Ct.div`
2
+ display: flex;
3
+ flex: 1 1 auto;
4
+ min-height: 100%;
5
+ flex-direction: column;
6
+ background-color: ${e=>e.theme.colors.grey4};
7
+ `,Oo=Ct.div`
8
+ display: flex;
9
+ flex: 1 1 auto;
10
+ flex-direction: column;
11
+ align-items: center;
12
+ background-color: ${e=>e.theme.colors.grey4};
13
+ `;function Po({title:e,reportId:a,entityAutoCompleteView:t,autoCompleteText:n,isAiCfoAccessEnabled:o,onAskAiCfoClick:r}){const s=Z(),i=N(),d=q(),{tenantEmailDomain:p}=$(),_=ao();return l.jsxs(Fo,{children:[l.jsx(no,{source:a==="cash_balance"?"CashBalanceDetailScreen":"CardBalanceDetailScreen",title:e,onBackClick:()=>{s("../")},hideSearchBtn:!0,backgroundColor:_.colors.grey4,searchAutoComplete:{autoCompleteData:{entityAutoCompleteView:t,autoCompleteText:n},autoCompleteActions:{onAutoCompleteInputChange:g=>{g.trim().length>=2?i(ne({searchString:g,searchOrigin:"navbar"})):g.trim().length===0&&i(H("navbar"))},onAutoCompleteEntity:g=>{n!=null&&E?.trackSearch(V.Event.search,Ro(a),g.type,g.name,n);const u=se(g,p),c=D(d.state?.pathnameStackToGoBack,d.pathname);s(u,{state:{pathnameStackToGoBack:c}})}}},rightSideComponent:l.jsx(oo,{isAiCfoAccessEnabled:o,onAskAiCfoClick:r})}),l.jsx(Oo,{children:a==="cash_balance"?l.jsx(wo,{}):l.jsx(Do,{})})]})}function Bt(){const e=q(),a=N(),{useFeatureGate:t}=Ge(),{isFeatureEnabled:n}=t(j.isDepositAccountsFeatureEnabled),o=S(h=>h.cashBalanceState.fetchState),r=S(h=>h.cardBalanceState.fetchState),s=B.getSignedInUser();if(s==null)throw Error("Can't access dashboard detail without signing in...");const i=Nt((h=>{const f=zt(h,"/").split("/");return f[f.length-1]})(e.pathname));let d="Not-Started",p="";const _=K.getLocalizedStrings();switch(i){case"cash_balance":d=o,p=_.reportTitleById.cash_balance;break;case"card_balance":d=r,p=_.reportTitleById.card_balance;break;default:console.error(`${i} is not supported!`)}const{isAiCfoAccessEnabled:g,onAskAiCfoClick:u}=W({mobileExploreReferrer:i==="card_balance"?"Card Balance":"Cash Balance"});Fe({isDataReady:d==="Completed"});const c=S(h=>h.entityAutoCompleteState.autoCompleteText.navbar),m=S(h=>ae(h,"navbar"));return C.useEffect(()=>{d==="Not-Started"&&function(h,f,k){switch(f){case"card_balance":h(qt());break;case"cash_balance":h($t()),k===!0&&h(Kt());break;default:throw new Error(`balance report type ${f} is not yet supported`)}}(a,i,n)},[s,a,d]),l.jsxs(l.Fragment,{children:[d==="Completed"?l.jsx(we,{analytics:E,onLoad:h=>((f,k)=>{switch(k){case"card_balance":f.trackPageLoaded(V.Event.cardBalance);break;case"cash_balance":f.trackPageLoaded(V.Event.cashBalance);break;default:console.error(`Analytics: Not tracking Page Loaded for ${k}!`)}})(h,i)}):null,l.jsx(Po,{title:p,reportId:i,autoCompleteText:c,entityAutoCompleteView:m,isAiCfoAccessEnabled:g,onAskAiCfoClick:u})]})}const Ro=e=>{switch(e){case"cash_balance":return"Cash Balance";case"card_balance":return"Card Balance";default:return"Dashboard"}},Bo=[];function Oe(e){const{mobileExploreReferrer:a}=e,t=N(),n=Z(),o=q(),{tenantEmailDomain:r}=$(),{setIsAiCfoOpen:s,setAiCfoSidePanelQuestionToSubmit:i}=ma(),d=so(),p=lo(d),_=Ka(),g=S(P=>sn(P)),u=g.uiState?.currentChatSessionId,c=g.allSessionsWithOrderedQuestionAnswers??Bo,m=B.getSignedInUser()?.userId,h=pa(),f=Co()&&h&&r!=null,k=ro(),y=_o(!0),b=S(P=>k!=null?rn(P,k):void 0),{useDynamicConfig:A}=Ge(),{configValue:T}=A(ha.aiCfoMessageDynamicConfig),M=C.useMemo(()=>Array.isArray(T.default_message_list)?T.default_message_list:[],[T.default_message_list]),F=C.useMemo(()=>M.slice(0,2),[M]),I=k!=null&&b!=null&&b.fetchState!=="Completed"&&b.fetchState!=="Error"&&(y||b.fetchState==="In-Progress"),z=C.useMemo(()=>{if(k==null||b?.fetchState==="Error")return F;if(I)return[];const P=(b?.suggestedQuestions??[]).map(X=>X.trim()).filter(X=>X.length>0).slice(0,2);return P.length===0?F:P},[F,I,k,b?.fetchState,b?.suggestedQuestions]),de=C.useCallback((P,X)=>{if(m==null||P.trim()==="")return;const Re=io(_.getState());if(p){const ze=D(o.state?.pathnameStackToGoBack,o.pathname);n(`/${r}/ai-cfo/explore`,{state:{message:"",origin:"",pathnameStackToGoBack:ze,referrer:a,aiCfoInitialQuestion:P,aiCfoShouldSubmit:!Re}})}else{if(Re)return t(cn(P)),void s(!0);i(P),s(!0),co(t,P,"insights_section",u,c,m,X,void 0)}},[c,u,t,p,o.pathname,o.state,a,n,s,i,_,r,m]),Ce=C.useCallback(()=>{if(p){const P=D(o.state?.pathnameStackToGoBack,o.pathname);n(`/${r}/ai-cfo/explore`,{state:{message:"",origin:"",pathnameStackToGoBack:P,referrer:a}})}else s(!0)},[p,o.pathname,o.state,a,n,s,r]);return C.useMemo(()=>{if(f)return{isSuggestedQuestionsLoading:I,onAskSomethingElseClick:Ce,onSuggestedQuestionClick:de,suggestedQuestions:z}},[f,I,Ce,de,z])}const Pe=uo,Lo=Q(function(e){const a=ln(e),t=dn(e),n=Zt(e),{scrollPosition:o,...r}=n,s=K.getLocalizedStrings().reportTitleById.cash_in_cash_out,i=B.getSignedInUser(),d=e.tenantState.currentTenantId,p=L(e),_=p?.companyName??"",g={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:d??""},u=e.entityAutoCompleteState.autoCompleteText.navbar,c=ae(e,"navbar");return{selectedRangeReport:a,reportLabels:{reportTitle:s},highlightedRangeReport:t,uiState:r,scrollPosition:o,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:_,statementEndPoint:`${J}/statement`,authParams:g},analytics:E,autoCompleteData:{autoCompleteText:u,entityAutoCompleteView:c}}},function(e,a){return{updateDownloadStateHandler:t=>{e(un(t))},onTimeframeSelectionChanged:()=>{},onCOABalancesRangeChanged:(t,n)=>{e(xe(t,n)),e(_e({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(fe("month")),e(oe(a.firstMonthOfFY,t)),e(_e({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Ie(a.firstMonthOfFY,t,o,n)),n.length>0&&e(Te(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.isCompareModeOn!==t&&setTimeout(()=>e(_e({resetLeftScroll:!0})),50)},onElementCollapseStateChanged:(t,n)=>{e(_e({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(_e({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ne({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(H("navbar"))},onAutoCompleteEntity:t=>{const n=se(t,a.tenantEmailDomain),o=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.navigate("../")}}})(Pe),jo=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e,{isAiCfoAccessEnabled:o,onAskAiCfoClick:r}=W({mobileExploreReferrer:"DashboardCashInCashOut"}),s=Oe({mobileExploreReferrer:"DashboardCashInCashOut"}),i=S(d=>Zt(d)).mode==="compare_mode";return l.jsx(Lo,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:a,location:t,isCompareModeOn:i,navigate:n,insightsSectionAiCfoInfo:s,isAiCfoAccessEnabled:o,onAskAiCfoClick:r})},Mo=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Ve(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}},Uo=Q(function(e){const a=mn(e),t=pn(e),n=Ht(e),{scrollPosition:o,...r}=n,s=K.getLocalizedStrings().reportTitleById.cash_position,i=B.getSignedInUser(),d=e.tenantState.currentTenantId,p=L(e),_=p?.companyName??"",g={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:d??""},u=e.entityAutoCompleteState.autoCompleteText.navbar,c=ae(e,"navbar");return{selectedRangeReport:a,reportLabels:{reportTitle:s},highlightedRangeReport:t,uiState:r,scrollPosition:o,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:_,statementEndPoint:`${J}/statement`,authParams:g},analytics:E,autoCompleteData:{autoCompleteText:u,entityAutoCompleteView:c}}},function(e,a){return{updateDownloadStateHandler:t=>{e(hn(t))},onTimeframeSelectionChanged:t=>{e(fe(t)),setTimeout(()=>e(ke({resetLeftScroll:!0})),50)},onCOABalancesRangeChanged:(t,n)=>{e(xe(t,n)),e(ke({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(oe(a.firstMonthOfFY,t)),e(ke({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Ie(a.firstMonthOfFY,t,o,n)),n.length>0&&e(Te(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.isCompareModeOn!==t&&setTimeout(()=>e(ke({resetLeftScroll:!0})),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=Mo(n),s=t.accountName===""?t.accountDescription:t.accountName;if(o!=null&&r!=null){const i=be(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),d=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:d,referrer:"Cash Position"}})}},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ne({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(H("navbar"))},onAutoCompleteEntity:t=>{const n=se(t,a.tenantEmailDomain),o=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onTableScroll:t=>{e(ke({scrollPosition:t}))},onBackClick:()=>{a.navigate("../")}}})(Pe),Yo=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e,{isAiCfoAccessEnabled:o,onAskAiCfoClick:r}=W({mobileExploreReferrer:"DashboardCashPosition"}),s=Oe({mobileExploreReferrer:"DashboardCashPosition"}),i=S(d=>Ht(d)).mode==="compare_mode";return l.jsx(Uo,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:a,location:t,isCompareModeOn:i,navigate:n,insightsSectionAiCfoInfo:s,isAiCfoAccessEnabled:o,onAskAiCfoClick:r})},G=(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}))};function Xe(){return l.jsxs(st,{children:[l.jsx(w,{path:"/",element:l.jsx(ee,{})}),l.jsx(w,{path:"/:forecastId",element:l.jsx(ee,{})}),l.jsx(w,{path:"/:forecastId/*",element:l.jsx(ve,{})})]})}const Vo=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Ve(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}},Go=Q(function(e){const a=Qt(e),t=fn(e),n=gn(e),o=bn(e),r=dt(e),{scrollPosition:s,...i}=r,d=t.reportTitle,p=B.getSignedInUser(),_=e.tenantState.currentTenantId,g=L(e),u=g?.companyName??"",c={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:_??""},m=e.entityAutoCompleteState.autoCompleteText.navbar,h=ae(e,"navbar"),f=ut(g);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,reportLabels:{reportTitle:d},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,uiState:i,scrollPosition:s,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:u,statementEndPoint:`${J}/statement`,authParams:c},analytics:E,isZeniUser:Ee(p),autoCompleteData:{autoCompleteText:m,entityAutoCompleteView:h},isZeniCOAUsed:f,isAccountingClassesEnabled:ge(e)}},function(e,a){return{updateDownloadStateHandler:t=>{e(kn(t))},onTimeframeSelectionChanged:t=>{e(fe(t)),setTimeout(()=>e(ie({resetLeftScroll:!0})),50)},onCOABalancesRangeChanged:(t,n)=>{e(xe(t,n)),e(ie({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(oe(a.firstMonthOfFY,t)),e(ie({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Ie(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Te(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&G(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout(()=>e(ie({resetLeftScroll:!0})),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=Vo(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?_t(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):be(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),d=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:d,referrer:"Burn Rate"}})}},onElementCollapseStateChanged:(t,n)=>{e(ie({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(ie({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ne({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(H("navbar"))},onAutoCompleteEntity:t=>{const n=se(t,a.tenantEmailDomain),o=D(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(me(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?pe:kt,n)),t==="forecast_mode"?(e(Ft({viewMode:"account_group"})),e(Jt(!1,n?.id)),n!=null&&G(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):G(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(ie({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":"Accounts","Burn Rate"),e(Ft({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(_n({classesToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e(Cn())},onResyncReports:()=>{e(mt("net_burn_or_income_by_classes"))}}})(Pe),No=e=>{const a=N(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,{isAiCfoAccessEnabled:s,onAskAiCfoClick:i}=W({mobileExploreReferrer:"DashboardNetBurnOrIncome"}),d=Oe({mobileExploreReferrer:"DashboardNetBurnOrIncome"}),p=S(b=>dt(b)),_=p.isForecastModeOn,g=p.timeframe,u=p.selectedForecast?.id,c=S(b=>pt(b.forecastState,u??"")),m=S(b=>Qt(b)),h=S(b=>ht(b)),f=S(b=>ge(b)),k=p.mode==="compare_mode",y=m.dataAvailable;return C.useEffect(()=>{if(u!=null&&_===!0&&(G(_,r,u,o),c!=null)){const b=c?.forecastPeriod,A=y!=null&&b.endDate.isAfter(y?.endDate)===!0?y:b;a(oe(e.firstMonthOfFY,{startDate:A.endDate.startOf(g),endDate:A?.endDate}))}},[u]),l.jsx(Go,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,forecastIdFromUrlPath:r,location:n,isAccountingClassesEnabled:f,isCompareModeOn:k,navigate:o,analytics:E,reportsResyncFetchState:h.reportsResyncFetchState,insightsSectionAiCfoInfo:d,isAiCfoAccessEnabled:s,onAskAiCfoClick:i})},zo=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Ve(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}},$o=Q(function(e){const a=Wt(e),t=Sn(e),n=yn(e),o=An(e),r=ft(e),{scrollPosition:s,...i}=r,d=K.getLocalizedStrings().reportTitleById.operating_expenses,p=B.getSignedInUser(),_=e.tenantState.currentTenantId,g=L(e),u=g?.companyName??"",c={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:_??""},m=e.entityAutoCompleteState.autoCompleteText.navbar,h=ae(e,"navbar"),f=ut(g);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,reportLabels:{reportTitle:d},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,uiState:i,scrollPosition:s,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:u,statementEndPoint:`${J}/statement`,authParams:c},analytics:E,isZeniUser:Ee(p),autoCompleteData:{autoCompleteText:m,entityAutoCompleteView:h},isZeniCOAUsed:f,isAccountingClassesEnabled:ge(e)}},function(e,a){return{updateDownloadStateHandler:t=>{e(In(t))},onTimeframeSelectionChanged:t=>{e(fe(t)),setTimeout(()=>e(ce({resetLeftScroll:!0})),50)},onCOABalancesRangeChanged:(t,n)=>{e(xe(t,n)),e(ce({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(oe(a.firstMonthOfFY,t)),e(ce({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Ie(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Te(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&G(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout(()=>e(ce({resetLeftScroll:!0})),50)},onAccountBalanceClick:a.hasTransactionAccess!==!0?void 0:(t,n)=>{const{timePeriod:o,timeframe:r}=zo(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?_t(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):be(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),d=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:d,referrer:"Operating Expenses"}})}},onElementCollapseStateChanged:(t,n)=>{e(ce({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(ce({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ne({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(H("navbar"))},onAutoCompleteEntity:t=>{const n=se(t,a.tenantEmailDomain),o=D(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(me(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?pe:kt,n)),t=="forecast_mode"?(e(Ot({viewMode:"account_group"})),e(Xt(!1,n?.id)),n!=null&&G(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):G(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(ce({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":"Accounts","Operating Expenses"),e(Ot({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(En({classesToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e(vn())},onResyncReports:()=>{e(mt("operating_expenses_by_classes"))}}})(Pe),Ko=e=>{const a=N(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,{isAiCfoAccessEnabled:s,onAskAiCfoClick:i}=W({mobileExploreReferrer:"DashboardOpEx"}),d=Oe({mobileExploreReferrer:"DashboardOpEx"}),p=S(T=>ft(T)),_=p.isForecastModeOn,g=p.timeframe,u=p.selectedForecast?.id,c=S(T=>pt(T.forecastState,u??"")),m=S(T=>Wt(T)),h=S(T=>ht(T)),f=S(T=>ge(T)),k=p.mode==="compare_mode",y=m.dataAvailable;C.useEffect(()=>{if(u!=null&&_===!0&&(G(_,r,u,o),c!=null)){const T=c?.forecastPeriod,M=y!=null&&T.endDate.isAfter(y?.endDate)===!0?y:T;a(oe(e.firstMonthOfFY,{startDate:M.endDate.startOf(g),endDate:M?.endDate}))}},[u]);const b=De(),A=b?.loggedInUserRole!=null&&ea(b?.loggedInUserRole)!==!0;return l.jsx($o,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,location:n,isAccountingClassesEnabled:f,isCompareModeOn:k,navigate:o,forecastIdFromUrlPath:r,analytics:E,hasTransactionAccess:A,reportsResyncFetchState:h.reportsResyncFetchState,insightsSectionAiCfoInfo:d,isAiCfoAccessEnabled:s,onAskAiCfoClick:i})},qo=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Ve(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}},Zo=Q(function(e){const a=ta(e),t=Tn(e),n=xn(e),o=wn(e),r=gt(e),{scrollPosition:s,...i}=r,d=K.getLocalizedStrings().reportTitleById.revenue,p=B.getSignedInUser(),_=e.tenantState.currentTenantId,g=L(e),u=g?.companyName??"",c={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:_??""},m=e.entityAutoCompleteState.autoCompleteText.navbar,h=ae(e,"navbar"),f=ut(g);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,reportLabels:{reportTitle:d},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,uiState:i,scrollPosition:s,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:u,statementEndPoint:`${J}/statement`,authParams:c},analytics:E,isZeniUser:Ee(p),autoCompleteData:{autoCompleteText:m,entityAutoCompleteView:h},isZeniCOAUsed:f,isAccountingClassesEnabled:ge(e)}},function(e,a){return{updateDownloadStateHandler:t=>{e(On(t))},onTimeframeSelectionChanged:t=>{e(fe(t)),setTimeout(()=>e(le({resetLeftScroll:!0})),50)},onCOABalancesRangeChanged:(t,n)=>{e(xe(t,n)),e(le({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(oe(a.firstMonthOfFY,t)),e(le({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(Ie(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(Te(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&G(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout(()=>e(le({resetLeftScroll:!0})),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=qo(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?_t(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):be(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),d=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:d,referrer:"Revenues"}})}},onElementCollapseStateChanged:(t,n)=>{e(le({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(le({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ne({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(H("navbar"))},onAutoCompleteEntity:t=>{const n=se(t,a.tenantEmailDomain),o=D(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(me(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?pe:kt,n)),t==="forecast_mode"?(e(Pt({viewMode:"account_group"})),e(aa(!1,n?.id)),n!=null&&G(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):G(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(le({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":"Accounts","Revenues"),e(Pt({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(Fn({classesToFilterOut:t}))},onOpenAccountViewMode:()=>{a.isAccountingClassesEnabled&&e(Dn())},onResyncReports:()=>{e(mt("revenue_by_classes"))}}})(Pe),Ho=e=>{const a=N(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,{isAiCfoAccessEnabled:s,onAskAiCfoClick:i}=W({mobileExploreReferrer:"DashboardRevenue"}),d=Oe({mobileExploreReferrer:"DashboardRevenue"}),p=S(y=>gt(y)),_=p.isForecastModeOn,g=p.timeframe,u=p.selectedForecast?.id,c=S(y=>pt(y.forecastState,u??"")),m=S(y=>ta(y)).dataAvailable,h=p.mode==="compare_mode",f=S(y=>ge(y)),k=S(y=>ht(y));return C.useEffect(()=>{if(u!=null&&_===!0&&(G(_,r,u,o),c!=null)){const y=c?.forecastPeriod,b=m!=null&&y.endDate.isAfter(m?.endDate)===!0?m:y;a(oe(e.firstMonthOfFY,{startDate:b.endDate.startOf(g),endDate:b?.endDate}))}},[u]),l.jsx(Zo,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,isAccountingClassesEnabled:f,isCompareModeOn:h,location:n,navigate:o,forecastIdFromUrlPath:r,analytics:E,reportsResyncFetchState:k.reportsResyncFetchState,insightsSectionAiCfoInfo:d,isAiCfoAccessEnabled:s,onAskAiCfoClick:i})},Qo=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}},Jo=Q(function(e){const a=Pn(e),t=e.entityAutoCompleteState.autoCompleteText.navbar,n=ae(e,"navbar");return{report:a,analytics:E,autoCompleteData:{autoCompleteText:t,entityAutoCompleteView:n}}},function(e,a){return{onTimeframeSelectionChanged:t=>{E.trackTimeframeSwitch(ba(t),"Top Expenses"),e(na(t))},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=Qo(n),s=t.accountName===""?t.accountDescription:t.accountName;if(o!=null&&r!=null){const i=be(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),d=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:d,referrer:"Top Expenses"}})}},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ne({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(H("navbar"))},onAutoCompleteEntity:t=>{const n=se(t,a.tenantEmailDomain),o=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.navigate("../")}}})(mo),Wo=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e;return l.jsx(Jo,{tenantEmailDomain:a,location:t,navigate:n})},Xo=Ct.div`
14
+ display: flex;
15
+ flex: 1 1 auto;
16
+ min-height: 100%;
17
+ flex-direction: column;
18
+ background-color: ${e=>e.theme.colors.grey5};
19
+ align-items: center;
20
+ `,pe=3,kt=1;function es({fetchState:e,firstMonthOfFY:a,reportId:t,forecastId:n}){const o=Z(),r=q(),{tenantEmailDomain:s}=$();let i;Fe({isDataReady:!0});const d={firstMonthOfFY:a,tenantEmailDomain:s,location:r,navigate:o,forecastIdFromUrlPath:n,fetchState:e};switch(t){case"operating_expenses":i=l.jsx(Ko,{...d});break;case"revenue":i=l.jsx(Ho,{...d});break;case"net_burn_or_income":i=l.jsx(No,{...d});break;case"cash_position":i=l.jsx(Yo,{...d});break;case"top_expenses":i=l.jsx(Wo,{...d});break;case"cash_in_cash_out":i=l.jsx(jo,{...d});break;default:console.error(`${t} is not supported!`),i=null}return i!=null?l.jsx(Xo,{children:i}):null}function ee(){const e=q(),a=N(),{forecastId:t}=$();let n="Not-Started";const o=S(c=>ft(c).fetchState),r=S(c=>gt(c).fetchState),s=S(c=>dt(c).fetchState),i=S(c=>c.cashPositionState.fetchState),d=S(c=>c.topExState.fetchState),p=S(c=>c.cashInCashOutState.fetchState);if(B.getSignedInUser()==null)throw Error("Can't access dashboard detail without signing in...");const _=S(c=>L(c)),g=_?.company?.companyInfo?.firstMonthOfFY??1,u=Nt((c=>{const m=zt(c,"/").split("/");return t!=null?m[m.length-3]:m[m.length-1]})(e.pathname));switch(u){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=d;break;case"cash_in_cash_out":n=p;break;default:console.error(`${u} is not supported!`)}return C.useEffect(()=>{n==="Not-Started"&&function(c,m,h,f){switch(m){case"operating_expenses":c(la(!0)),f!=null&&(c(me(h,!0,pe,{id:f,index:0})),c(Xt(!1,f)));break;case"revenue":c(ca(!0)),f!=null&&(c(me(h,!0,pe,{id:f,index:0})),c(aa(!1,f)));break;case"net_burn_or_income":c(ia(!0)),f!=null&&(c(me(h,!0,pe,{id:f,index:0})),c(Jt(!1,f)));break;case"cash_position":c(ra(!0));break;case"top_expenses":c(sa());break;case"cash_in_cash_out":c(oa());break;default:throw new Error(`report type ${m} is not yet supported`)}}(a,u,g,t)},[t]),l.jsxs(l.Fragment,{children:[n==="Completed"?l.jsx(we,{analytics:E,onLoad:c=>((m,h)=>{const f=e.state?.referrer;switch(h){case"operating_expenses":m.trackPageLoaded(V.Event.operatingExpenses,f);break;case"revenue":m.trackPageLoaded(V.Event.revenues,f);break;case"net_burn_or_income":m.trackPageLoaded(V.Event.burnRate,f);break;case"cash_position":m.trackPageLoaded(V.Event.cashPosition,f);break;case"top_expenses":m.trackPageLoaded(V.Event.topExpenses,f);break;case"cash_in_cash_out":m.trackPageLoaded(V.Event.cashInCashOut,f);break;default:console.error(`Analytics: Not tracking Page Loaded for ${h}!`)}})(c,u)}):null,l.jsx(es,{firstMonthOfFY:g,fetchState:n,reportId:u,forecastId:t})]})}var et=typeof navigator<"u"&&navigator.userAgent.toLowerCase().indexOf("firefox")>0;function tt(e,a,t,n){e.addEventListener?e.addEventListener(a,t,n):e.attachEvent&&e.attachEvent("on".concat(a),function(){t(window.event)})}function ka(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 Sa(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 St={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,"-":et?173:189,"=":et?61:187,";":et?59:186,"'":222,"[":219,"]":221,"\\":220},te={"⇧":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},R={16:!1,18:!1,17:!1,91:!1},O={},Ue=1;Ue<20;Ue++)St["f".concat(Ue)]=111+Ue;var x=[],Lt=!1,ya="all",jt=[],Ne=function(e){return St[e.toLowerCase()]||te[e.toLowerCase()]||e.toUpperCase().charCodeAt(0)};function Mt(e){ya=e||"all"}function Ae(){return ya||"all"}var at=function(e){var a=e.key,t=e.scope,n=e.method,o=e.splitKey,r=o===void 0?"+":o;Sa(a).forEach(function(s){var i=s.split(r),d=i.length,p=i[d-1],_=p==="*"?"*":Ne(p);if(O[_]){t||(t=Ae());var g=d>1?ka(te,i):[];O[_]=O[_].filter(function(u){return!((!n||u.method===n)&&u.scope===t&&function(c,m){for(var h=c.length>=m.length?c:m,f=c.length>=m.length?m:c,k=!0,y=0;y<h.length;y++)f.indexOf(h[y])===-1&&(k=!1);return k}(u.mods,g))})}})};function Ut(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,R)Object.prototype.hasOwnProperty.call(R,r)&&(!R[r]&&a.mods.indexOf(+r)>-1||R[r]&&a.mods.indexOf(+r)===-1)&&(o=!1);(a.mods.length!==0||R[16]||R[18]||R[17]||R[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 Yt(e,a){var t=O["*"],n=e.keyCode||e.which||e.charCode;if(U.filter.call(this,e)){if(n!==93&&n!==224||(n=91),x.indexOf(n)===-1&&n!==229&&x.push(n),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(m){var h=ct[m];e[m]&&x.indexOf(h)===-1?x.push(h):!e[m]&&x.indexOf(h)>-1?x.splice(x.indexOf(h),1):m==="metaKey"&&e[m]&&x.length===3&&(e.ctrlKey||e.shiftKey||e.altKey||(x=x.slice(x.indexOf(h))))}),n in R){for(var o in R[n]=!0,te)te[o]===n&&(U[o]=!0);if(!t)return}for(var r in R)Object.prototype.hasOwnProperty.call(R,r)&&(R[r]=e[ct[r]]);e.getModifierState&&(!e.altKey||e.ctrlKey)&&e.getModifierState("AltGraph")&&(x.indexOf(17)===-1&&x.push(17),x.indexOf(18)===-1&&x.push(18),R[17]=!0,R[18]=!0);var s=Ae();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)&&Ut(e,t[i],s,a);if(n in O){for(var d=0;d<O[n].length;d++)if((e.type==="keydown"&&O[n][d].keydown||e.type==="keyup"&&O[n][d].keyup)&&O[n][d].key){for(var p=O[n][d],_=p.splitKey,g=p.key.split(_),u=[],c=0;c<g.length;c++)u.push(Ne(g[c]));u.sort().join("")===x.sort().join("")&&Ut(e,p,s,a)}}}}function U(e,a,t){x=[];var n=Sa(e),o=[],r="all",s=document,i=0,d=!1,p=!0,_="+",g=!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&&(d=a.keyup),a.keydown!==void 0&&(p=a.keydown),a.capture!==void 0&&(g=a.capture),typeof a.splitKey=="string"&&(_=a.splitKey)),typeof a=="string"&&(r=a);i<n.length;i++)o=[],(e=n[i].split(_)).length>1&&(o=ka(te,e)),(e=(e=e[e.length-1])==="*"?"*":Ne(e))in O||(O[e]=[]),O[e].push({keyup:d,keydown:p,scope:r,mods:o,shortcut:n[i],method:t,key:n[i],splitKey:_,element:s});s!==void 0&&!function(u){return jt.indexOf(u)>-1}(s)&&window&&(jt.push(s),tt(s,"keydown",function(u){Yt(u,s)},g),Lt||(Lt=!0,tt(window,"focus",function(){x=[]},g)),tt(s,"keyup",function(u){Yt(u,s),function(c){var m=c.keyCode||c.which||c.charCode,h=x.indexOf(m);if(h>=0&&x.splice(h,1),c.key&&c.key.toLowerCase()==="meta"&&x.splice(0,x.length),m!==93&&m!==224||(m=91),m in R)for(var f in R[m]=!1,te)te[f]===m&&(U[f]=!1)}(u)},g))}var nt={setScope:Mt,getScope:Ae,deleteScope:function(e,a){var t,n;for(var o in e||(e=Ae()),O)if(Object.prototype.hasOwnProperty.call(O,o))for(t=O[o],n=0;n<t.length;)t[n].scope===e?t.splice(n,1):n++;Ae()===e&&Mt(a||"all")},getPressedKeyCodes:function(){return x.slice(0)},isPressed:function(e){return typeof e=="string"&&(e=Ne(e)),x.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(O).forEach(function(t){var n=O[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(O).forEach(function(s){return delete O[s]});else if(Array.isArray(e))e.forEach(function(s){s.key&&at(s)});else if(typeof e=="object")e.key&&at(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=""),at({key:e,scope:o,method:r,splitKey:"+"})}},keyMap:St,modifier:te,modifierMap:ct};for(var ot in nt)Object.prototype.hasOwnProperty.call(nt,ot)&&(U[ot]=nt[ot]);if(typeof window<"u"){var ts=window.hotkeys;U.noConflict=function(e){return e&&window.hotkeys===U&&(window.hotkeys=ts),U},window.hotkeys=U}U.filter=function(){return!0};var Vt=function(e,a){var t=e.target,n=t&&t.tagName;return!!(n&&a&&a.includes(n))};function as(e,a,t,n){t instanceof Array&&(n=t,t=void 0);var o=t||{},r=o.enableOnTags,s=o.filter,i=o.keyup,d=o.keydown,p=o.filterPreventDefault,_=p===void 0||p,g=o.enabled,u=g===void 0||g,c=o.enableOnContentEditable,m=c!==void 0&&c,h=C.useRef(null),f=C.useCallback(function(k,y){var b,A;return s&&!s(k)?!_:!!(Vt(k,["INPUT","TEXTAREA","SELECT"])&&!Vt(k,r)||(b=k.target)!=null&&b.isContentEditable&&!m)||!!(h.current===null||document.activeElement===h.current||(A=h.current)!=null&&A.contains(document.activeElement))&&(a(k,y),!0)},n?[h,r,s].concat(n):[h,r,s]);return C.useEffect(function(){if(u)return i&&d!==!0&&(t.keydown=!1),U(e,t||{},f),function(){return U.unbind(e,f)};U.unbind(e,f)},[f,e,u]),h}U.isPressed;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","zeni_accounts_promo_card","rewards_card","treasury_promo_card"],os=(e,a,t,n,o)=>({card:{dimension:bt(t),cardType:n,cardIndex:o,fetchState:a,disableAnimations:!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}),Se=(e,a,t,n,o)=>({card:{dimension:bt(t),cardType:n,cardIndex:o,fetchState:a,disableAnimations:!1},data:e}),ss=(e,a,t,n)=>Se(void 0,e,ye,a,t),rs=(e,a,t,n,o)=>({card:{dimension:bt(ye),cardType:a,cardIndex:t,fetchState:e,disableAnimations:!1},data:{funds:n,hasUserSeenVideo:o,videoUrl:"https://www.youtube.com/watch?v=sqvJWKCMZgk"}}),is=Q(function(e,a){const t=ds(a.dashboardReport),n=a.passedCardsOrdered,o=a.dashboardReport.reportsInOrder,{isInterestedInChargeCard:r,cardsCreditLimit:s,cashbackRate:i,treasuryFundDetails:d,hasUserSeenTreasuryVideo:p,treasuryFetchState:_}=a;let g=n.map((u,c)=>{if(u==="reimbursement_promo_card"||u==="bill_pay_promo_card")return ss(t,u,c);if(u==="zeni_promo_card")return Se({isExpressedInterest:r,creditLimit:s,cashbackRate:i,fetchState:"Completed"},a.cardBalanceFetchState,ye,u,c);if(u==="treasury_promo_card")return rs(_,u,c,d,p);if(u==="information_card")return Se(void 0,"Completed",ye,u,c);{const m=o.find(h=>h?.reportId===u);return m?function(h,f,k,y){const b=h.reportId;switch(b){case"card_balance":case"cash_balance":return[os(h,f,k,b,y)];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"zeni_accounts_promo_card":case"rewards_card":return[Se(h,f,k,b,y)];case"net_burn_or_income_story_card":return[Se(h,f,k,"net_burn_or_income_story_card",y)];default:return console.error(`card type ${b} not yet supported!`),[]}}(m,m.fetchState,ye,c):[]}}).flat();return a.isSummaryCardsFiltered===!0&&(g=g.filter(u=>ns.includes(u.card.cardType)==0).filter(u=>{const c=u.data?.availableNumberOfPeriods;return c!=null?c>0:u.card.cardType!="top_expenses"||u.data==null||function(m){if(m==null||m.length===0)return!0;let h=!0;for(const f of m)if(f.balance.available.amount!==0){h=!1;break}return h}(u.data.topExpenses.accountsOrdered)===!1})),{cardDataArray:g,autoCompleteData:{autoCompleteText:e.entityAutoCompleteState.autoCompleteText.navbar,entityAutoCompleteView:ae(e,"navbar")},analytics:E,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)E.trackDashboardCardClicked("cards promo",2),E.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&&E.trackDashboardCardClicked("rewards promo",o+1),a.navigate("../../rewards/refer",{state:{referrer:s}})):r==="expense_automation_card"?(E.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.isZeniAccountEnabled===!1&&s.push("zeni_accounts_promo_card"),a.isRewardsFeatureEnabled===!1&&s.push("rewards_card"),function(i,d,p,_){switch(d){case"card_balance":i(qt());break;case"cash_balance":i($t());break;case"operating_expenses":i(la(!0));break;case"revenue":i(ca(!0));break;case"net_burn_or_income":i(ia(!0));break;case"net_burn_or_income_story_card":i(Jn(!0));break;case"cash_position":i(ra(!0));break;case"top_expenses":i(sa());break;case"cash_in_cash_out":i(oa());break;case"insights_dashboard":i(Qn());break;case"bill_pay_card":i(Hn());break;case"reimbursement_card":i(Zn());break;case"company_details":i(qn(p));break;case"task_card":i(Kn());break;case"accounts_payable_aging":_.includes("accounts_payable_aging")===!1&&i(rt(he()));break;case"accounts_receivable_aging":i(it(he()));break;case"zeni_accounts_promo_card":_.includes("zeni_accounts_promo_card")===!1&&i(Kt());break;case"rewards_card":_.includes("rewards_card")===!1&&i($n(!0));break;default:throw new Error(`report type ${d} is not yet supported`)}}(e,r,a.companyId,s)},onTimeframeChange:(o,r)=>{E.trackTimeframeSwitch(ba(r),ls(o),"Dashboard"),function(s,i,d){switch(i){case"operating_expenses":case"revenue":case"net_burn_or_income":case"cash_position":s(fe(d));break;case"top_expenses":s(na(d));break;default:throw new Error(`report type ${i} doesn't support changeTimeframe`)}}(e,o,r)},onUpdateSelectedInsightIndex:o=>{e(zn(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,r)=>{if(o==="bill_pay_promo_card"){const s="../bills",i=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i},relative:"path"})}else if(o==="reimbursement_promo_card"){const s="../reimbursements",i=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i},relative:"path"})}else if(o==="zeni_accounts_promo_card")if(a.hasZeniAccountsAdminAccess){let s="../checking/promo";r!=null&&(s=`../checking/${r}`);const i=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i},relative:"path"})}else window.open("https://www.zeni.ai/product/business-checking-accounts","_blank");else if(o==="treasury_promo_card")if(a.isUserHasTreasuryAccess){B.saveTreasuryPopupSeen(a.tenantEmailDomain,!0);const s="../treasury",i=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i},relative:"path"})}else window.open("https://www.zeni.ai/product/treasury","_blank")},onSaveClick:(o,r,s)=>{o==="net_burn_or_income_story_card"&&(E.trackUpdateBurnRateCalculatorSettings(r,s,Gn(s)),e(Nn(t,r,s)))},onVideoPlay:()=>{e(Rt())},onVideoClose:()=>{e(Rt()),e(Vn())}},autoCompleteActions:{onAutoCompleteInputChange:o=>{o.trim().length>=2?e(ne({searchString:o,searchOrigin:"navbar"})):o.trim().length===0&&e(H("navbar"))},onCancelAutoComplete:()=>{e(H("navbar"))},onAutoCompleteEntity:o=>{let r="";r=o.type!=="vendor"||o.detailType!=="bank_merchant"&&o.detailType!=="card_merchant"?se(o,a.tenantEmailDomain):bo(o.zeniId,o.qboId,a.tenantEmailDomain);const s=D(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(r,{state:{pathnameStackToGoBack:s,referrer:"Search"}})}}}})(go);function cs(){const{isAiCfoOpen:e,setIsAiCfoOpen:a}=ma(),t=Z(),n=N(),o=q(),r=B.getSignedInUser(),{useFeatureGate:s,useDynamicConfig:i}=Ge(),d=Ee(r),[p,_]=C.useState(!1),[g,u]=C.useState(!1),c=pa(),{tenantEmailDomain:m}=$(),{isAiCfoAccessEnabled:h,onAskAiCfoClick:f}=W({mobileExploreReferrer:"Dashboard"}),k=S(v=>v.tenantState.fetchState==="Completed"||v.tenantState.activeTenantFetchState.fetchState==="Completed"?L(v):void 0),y=k??B.getSignedInUserTenant(m),b=y.tenantId,A=y.companyId;C.useEffect(()=>{p===!1&&o.state?.message==="activation"&&(n(Rn(A)),_(!0))},[o.state,p,A,n]),C.useEffect(()=>{c&&!g&&o.state?.message==="open_ai_cfo_drawer"&&(a(!0),u(!0),t(o.pathname,{replace:!0,state:{...o.state,message:void 0}}))},[o.state,g,c,a,t,o.pathname]);const{isFeatureEnabled:T}=s(j.isApAgingFeatureEnabled),{isFeatureEnabled:M}=s(j.isExpenseAutomationEnabled),{isFeatureEnabled:F}=s(j.isExpenseAutomationEnabledV2),I=F||M&&d,{isFeatureEnabled:z}=s(j.isTreasuryEnabled),de=po(I),{isFeatureEnabled:Ce}=s(j.isArAgingFeatureEnabled),{isFeatureEnabled:P}=s(j.isDepositAccountsFeatureEnabled),{isFeatureEnabled:X}=s(j.isReferralFeatureEnabled),{isFeatureEnabled:Re}=s(j.isChargeCardFeatureEnabled),{isFeatureEnabled:ze}=s(j.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:Aa}=s(j.isDashboardSidebarNewYearAnimationEnabled),{configValue:yt}=i(ha.zeniCardsConfig),va=yt.charge_card_cashback_rate_per_transaction==null?.0175:yt.charge_card_cashback_rate_per_transaction;if(o.state?.message==="activation"){const v=ho(o.state?.pathnameStackToGoBack);t(o.pathname,{state:{...o.state,message:void 0,pathnameStackToGoBack:v.newStack}})}const[At,Ea]=C.useState(!1),[$e,Ia]=C.useState(!1);as("command+p, Control+p",v=>{Ia(!$e),v.preventDefault()},{enableOnContentEditable:!0,enableOnTags:["INPUT","SELECT","TEXTAREA"]},[$e]);const vt=k?.externalConnections?.accounting[0]?.isValid;if(r==null)throw Error("Can't access dashboard without signing in...");const re=S(v=>L(v)?.excludedResources),Ta=S(v=>v.expenseAutomationViewState.selectedPeriodByTenantId),xa=!!k?.companyReimbursementInfo?.info?.isReimbursementEnabled,wa=!!k?.companyBillPayInfo?.info?.isBillPayEnabled,Da=S(v=>v.treasurySetupViewState.treasuryFundsDetails).fetchStatus.fetchState,Fa=k?.company!=null&&Bn(k.company),Ke=z&&Fa,qe=De(),Oa=lt(qe?.loggedInUserRoleMap),Y=[],Et=re?.resources?.find(v=>v.resource==="/reports/top_expenses")==null,Pa=re?.resources?.find(v=>v.resource==="/reports/task_card")==null,Ze=k?.userRole!=null&&ea(k?.userRole),Ra=re?.resources?.find(v=>v.resource==="/bills")==null&&!Ze,Ba=re?.resources?.find(v=>v.resource==="/reimbursements")==null,La=Ln(qe?.loggedInUserRoleMap),ja=jn(qe?.loggedInUserRoleMap),Ma=k?.company?.companyChargeCardInfo?.chargeCardsCreditAccountLimit??0,Ua=k?.companyChargeCardInfo?.info?.isCompanyInterestedInChargeCard??!1,Ya=S(v=>v.treasurySetupViewState.treasuryFundsDetails).fundsDetails;Et===!1&&Y.push("top_expenses"),Pa===!1&&Y.push("task_card"),Ra===!1&&Y.push("bill_pay_card","bill_pay_promo_card"),T===!1&&Y.push("accounts_payable_aging"),Ce===!1&&Y.push("accounts_receivable_aging"),(I===!1||Ze)&&Y.push("expense_automation_card"),Ba===!1&&Y.push("reimbursement_card","reimbursement_promo_card"),P===!1&&Y.push("zeni_accounts_promo_card"),X===!1&&Y.push("rewards_card"),Ke===!1&&Y.push("treasury_promo_card");const{areTenantIdsInSync:It}=fo();C.useLayoutEffect(()=>{At&&de===I||vt!==!0||!It||re?.fetchState!=="Completed"&&re?.fetchState!=="Error"||(Ea(!0),n(Mn(r.userId,A,b,!0,!1,Y)))},[At,r,b,n,Et,vt,re?.fetchState,It]);const Va=S(v=>v.reportUIOptionsState.forecastOnDashboard.isForecastModeOn),Ga=S(v=>v.revenueState.uiState.selectedForecast?.id),Na=S(v=>v.cardBalanceState.fetchState),ue=S(v=>Un(v,Y,r,F,M,Ke)),za=ue.fetchState;Fe({isDataReady:!0});const Tt=k?.isTreasuryVideoViewed===!0||ue.isTreasuryVideoClosed===!0;return l.jsxs(l.Fragment,{children:[za==="Completed"?l.jsx(we,{analytics:E,onLoad:v=>{v.trackPageLoaded(V.Event.dashboard),Ke&&!Tt&&v.trackTreasuryPromoView("Dashboard Promo Video")}}):null,l.jsx(is,{maxColumns:e?2:void 0,isAiCfoAccessEnabled:h,onAskAiCfoClick:f,onDragAndDropCard:(v,$a)=>{const xt=function(Be,He,Le){const Qe=Le.indexOf(Be),Je=Le.indexOf(He);if(Qe===-1||Je===-1||Qe===Je)return Le;const We=[...Le];return We.splice(Qe,1),We.splice(Je,0,Be),We}(v,$a,ue.cardsOrdered);xt.some((Be,He)=>Be!==ue.cardsOrdered[He])&&n(Yn(xt))},dashboardReport:ue,passedCardsOrdered:ue.cardsForDashboardUI,tenantId:b,companyId:A,tenantEmailDomain:m,location:o,navigate:t,isApAgingFeatureEnabled:T,isArAgingFeatureEnabled:Ce,isBillPayEnabled:wa,isReimbursementEnabled:xa,isSummaryCardsFiltered:$e,isForecastOn:Va,selectedForecastOnDashboard:Ga,isVisitingFirstTime:p,isZeniAccountEnabled:P,isRewardsFeatureEnabled:X,hasZeniAccountsAdminAccess:Oa,isExpenseAutomationEnabledForUser:I&&Ze===!1,selectedPeriod:Ta[b],isChargeCardFeatureEnabled:Re,isUserHasCardsAccess:La,isUserHasTreasuryAccess:ja,cardsCreditLimit:Ma,cashbackRate:va,isInterestedInChargeCard:Ua,cardBalanceFetchState:Na,christmasAnimationEnabled:ze,newYearAnimationEnabled:Aa,treasuryFundDetails:Ya,hasUserSeenTreasuryVideo:Tt,treasuryFetchState:Da})]})}const ls=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"},ds=e=>e.fetchState!=="Error"?e.fetchState:e.reportsInOrder.map(a=>a.fetchState).reduce((a,t)=>a==="In-Progress"||a==="Not-Started"?a:t);function Ms(){const e=De(),a=e?.excludedResources?.find(p=>p.resource==="/reports/top_expenses")==null,{useFeatureGate:t}=Ge(),{isFeatureEnabled:n}=t(j.isApAgingFeatureEnabled),{isFeatureEnabled:o}=t(j.isArAgingFeatureEnabled),r=S(p=>L(p)),{isFeatureEnabled:s}=t(j.isDebitCardFeatureEnabled),i=Wn(s,r),d=Xn(r);return i===!0||d===!0?l.jsx(st,{children:l.jsx(w,{path:"/*",element:l.jsx(So,{})})}):l.jsxs(st,{children:[l.jsx(w,{path:"/",element:l.jsx(cs,{})}),l.jsx(w,{path:"cash_balance/*",element:l.jsx(Bt,{})}),l.jsx(w,{path:"card_balance/*",element:l.jsx(Bt,{})}),l.jsx(w,{path:"operating_expenses/*",element:l.jsx(ee,{})}),l.jsx(w,{path:"operating_expenses/forecast/*",element:l.jsx(Xe,{})}),l.jsx(w,{path:"revenue/forecast/*",element:l.jsx(Xe,{})}),l.jsx(w,{path:"revenue/*",element:l.jsx(ee,{})}),l.jsx(w,{path:"net_burn_or_income/forecast/*",element:l.jsx(Xe,{})}),l.jsx(w,{path:"net_burn_or_income/*",element:l.jsx(ee,{})}),n===!0&&l.jsxs(l.Fragment,{children:[l.jsx(w,{path:"accounts_payable_aging/*",element:l.jsx(vo,{})}),l.jsx(w,{path:"accounts_payable_aging/:vendorId/:reportDate/*",element:l.jsx(Ao,{})})]}),o&&l.jsxs(l.Fragment,{children:[l.jsx(w,{path:"accounts_receivable_aging/:customerId/:reportDate/*",element:l.jsx(Eo,{})}),l.jsx(w,{path:"accounts_receivable_aging/*",element:l.jsx(Io,{})})]}),l.jsx(w,{path:"cash_position/*",element:l.jsx(ee,{})}),l.jsx(w,{path:"top_expenses/*",element:a===!0?l.jsx(ee,{}):l.jsx(ve,{})}),l.jsx(w,{path:"cash_in_cash_out/*",element:l.jsx(ee,{})}),l.jsx(w,{path:"company_details",element:l.jsx(ko,{})}),l.jsx(w,{path:"referrals/*",element:l.jsx(yo,{})}),l.jsx(w,{path:"*",element:l.jsx(ve,{})})]})}export{Ms as default};
@@ -1 +1 @@
1
- import{j as v}from"./liveblocks-D41N0IlG.js";import{a as u}from"./sentry-Bhr8KU--.js";import{h as y,g as b,k as w,u as A,N as k}from"./core-B86WF2Ww.js";import{IO as N,eO as _,fj as U,IP as L,mv as O,IQ as R}from"./zeni-epic-state-BLvcbIPk.js";import{u as z,z as f,L as T,t as S,D as j,b as $}from"./index-CkmaHLOP.js";import"./mui-DZd7XaFW.js";import{t as P}from"./getLocaleForTenant-DNhjRuKy.js";import"./recharts-BHLF4b4u.js";import"./analytics-CFOBCmx3.js";import"./plaid-CZm5yErz.js";import"./dnd-DrUSXn8k.js";import"./stripe-DMRn4zHo.js";import"./lottie-BHETr187.js";import"./lexical-COpm991f.js";import"./pdf-BdWka_4Q.js";import"./utils-Mvk27uIx.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]="ba04bac4-2a9e-46f5-a872-db8f8cb6a481",t._sentryDebugIdIdentifier="sentry-dbid-ba04bac4-2a9e-46f5-a872-db8f8cb6a481")}catch{}})();const Q=w(function(t){return{fetchState:t.tenantState.fetchState,activeTenantFetchState:t.tenantState.activeTenantFetchState.fetchState,currentTenant:_(t),tenantsInOrder:R(t).tenantsInOrder}})(function({fetchState:t,activeTenantFetchState:s,currentTenant:o,tenantsInOrder:h}){const r=A(),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,I=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,I=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(k,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:I}})}});function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=z(),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&&S.shouldFetchActiveTenant(e)&&(h.current=!0,S.markActiveTenantFetchStarted(e),n==="Completed"||a!=="Not-Started"&&a!=="Error"||(s(T.TENANT_FETCHING),t(U(d.userId,e))))},[n,a,d,t]),u.useEffect(()=>{const e=f.getSignedInUser(),g=f.getActiveTenantForUser()?.tenantId,I=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&I&&S.shouldFetchAllTenants()&&(r.current=!0,S.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!L(i))&&t(O(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||(j.updateAppLocaleID(P(c)),o())},[n,a,c]),v.jsx(Q,{})}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"],G={"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 G[s]}export{oe as default};
1
+ import{j as v}from"./liveblocks-6nZkQHFl.js";import{a as u}from"./sentry-Dr5FPm4d.js";import{h as y,g as b,k as w,u as A,N as k}from"./core-B8DAi0nh.js";import{IO as N,eO as _,fj as U,IP as L,mv as O,IQ as R}from"./zeni-epic-state-DITtSXPQ.js";import{u as z,z as f,L as T,t as S,D as j,b as $}from"./index-cQHaeS6s.js";import"./mui-DOBONCVx.js";import{t as P}from"./getLocaleForTenant-CuY27Ik8.js";import"./recharts-CDgByeDS.js";import"./analytics-CLyVqw3m.js";import"./plaid-BJER8-rG.js";import"./dnd-DNrenqEc.js";import"./stripe-DMRn4zHo.js";import"./lottie-Cp94NU-O.js";import"./lexical-BbcB7U6u.js";import"./pdf-B9LwAnPJ.js";import"./utils-XBrV3QeH.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]="ba04bac4-2a9e-46f5-a872-db8f8cb6a481",t._sentryDebugIdIdentifier="sentry-dbid-ba04bac4-2a9e-46f5-a872-db8f8cb6a481")}catch{}})();const Q=w(function(t){return{fetchState:t.tenantState.fetchState,activeTenantFetchState:t.tenantState.activeTenantFetchState.fetchState,currentTenant:_(t),tenantsInOrder:R(t).tenantsInOrder}})(function({fetchState:t,activeTenantFetchState:s,currentTenant:o,tenantsInOrder:h}){const r=A(),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,I=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,I=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(k,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:I}})}});function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=z(),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&&S.shouldFetchActiveTenant(e)&&(h.current=!0,S.markActiveTenantFetchStarted(e),n==="Completed"||a!=="Not-Started"&&a!=="Error"||(s(T.TENANT_FETCHING),t(U(d.userId,e))))},[n,a,d,t]),u.useEffect(()=>{const e=f.getSignedInUser(),g=f.getActiveTenantForUser()?.tenantId,I=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&I&&S.shouldFetchAllTenants()&&(r.current=!0,S.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!L(i))&&t(O(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||(j.updateAppLocaleID(P(c)),o())},[n,a,c]),v.jsx(Q,{})}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"],G={"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 G[s]}export{oe as default};
@@ -1,4 +1,4 @@
1
- import{j as l}from"./liveblocks-D41N0IlG.js";import{j as w,u as C,g as h,k as A,l as B}from"./core-B86WF2Ww.js";import{MR as k,MY as _,fA as q,fz as J,fy as Q,ix as W,JZ as Y,pF as K,eO as V,Mn as D,iv as F,MS as S,M$ as T,it as G,iQ as j}from"./zeni-epic-state-BLvcbIPk.js";import{bo as L,Z as R,y as N,z as U,m as Z,p,S as v,B as M,bp as X,o as O,bq as ee,n as te}from"./index-CkmaHLOP.js";import{n as z}from"./mui-DZd7XaFW.js";import"./sentry-Bhr8KU--.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]="f636b2b4-9c3b-4160-ad2f-4cb876fb180a",e._sentryDebugIdIdentifier="sentry-dbid-f636b2b4-9c3b-4160-ad2f-4cb876fb180a")}catch{}})();const ne=A(null,function(e,t){return{onSaveVendor:n=>{e(W(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(Y("common")),n!=null&&e(K(n))},onGetOtp:n=>{e(Q(n,"BillPayVendor"))},onResendOtp:n=>{e(J(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(q(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(_(n,a,o))}}})(L);function H({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(c=>k(c,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=z.div`
1
+ import{j as l}from"./liveblocks-6nZkQHFl.js";import{j as w,u as C,g as h,k as A,l as B}from"./core-B8DAi0nh.js";import{MR as k,MY as _,fA as J,fz as Q,fy as W,ix as Y,JZ as q,pF as K,eO as V,Mn as D,iv as F,MS as S,M$ as T,it as G,iQ as j}from"./zeni-epic-state-DITtSXPQ.js";import{bn as L,Z as R,y as N,z as U,m as Z,p,S as v,B as M,bo as X,o as O,bp as ee,n as te}from"./index-cQHaeS6s.js";import{n as z}from"./mui-DOBONCVx.js";import"./sentry-Dr5FPm4d.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]="664feb9c-cb2f-428e-9d19-d21b604ad490",e._sentryDebugIdIdentifier="sentry-dbid-664feb9c-cb2f-428e-9d19-d21b604ad490")}catch{}})();const ne=A(null,function(e,t){return{onSaveVendor:n=>{e(Y(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(Q(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(J(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(_(n,a,o))}}})(L);function H({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=z.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -6,7 +6,7 @@ import{j as l}from"./liveblocks-D41N0IlG.js";import{j as w,u as C,g as h,k 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=D(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),c=s.poppedPathname??E();n(c,{state:{pathnameStackToGoBack:s.newStack}})})(),e(S())},onACHDetailsUpdated:s=>{const{bankAccountSection:c}=s;e(T({data:c}))},onBackClick:()=>{if(e(F({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")n("../",{relative:"path"});else{const s=p(t.location.state?.pathnameStackToGoBack),c=s.poppedPathname??E(0);t.navigate(c,{state:{pathnameStackToGoBack:s.newStack}})}e(S())}}})(X);function fe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=R(),{vendorId:s,billId:c}=B(),d=e??s,{useFeatureGate:r}=N(),i=U.getSignedInUser(),b=h(u=>V(u)),g=Z(),x=p(a.state?.pathnameStackToGoBack),f=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h(u=>k(u,d)),{isFeatureEnabled:I}=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(M,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:g.colors.grey5}}):l.jsxs(ae,{windowSize:o,children:[l.jsx(H,{vendorId:d,billId:c}),l.jsx(oe,{location:a,navigate:n,billId:c,vendorId:d,currentTenant:b,bankAccountContext:f,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const E=(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,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,"ach",t,n)}function ve(e,t,n){return $(e,"domestic",t,n)}function ge(e,t,n){return $(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=z.div`
9
+ `,oe=A(function(e,t){const{vendorId:n,billId:a}=t,o=k(e,n),s=D(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??E();n(d,{state:{pathnameStackToGoBack:s.newStack}})})(),e(S())},onACHDetailsUpdated:s=>{const{bankAccountSection:d}=s;e(T({data:d}))},onBackClick:()=>{if(e(F({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")n("../",{relative:"path"});else{const s=p(t.location.state?.pathnameStackToGoBack),d=s.poppedPathname??E(0);t.navigate(d,{state:{pathnameStackToGoBack:s.newStack}})}e(S())}}})(X);function fe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=R(),{vendorId:s,billId:d}=B(),i=e??s,{useFeatureGate:r}=N(),c=U.getSignedInUser(),b=h(u=>V(u)),g=Z(),x=p(a.state?.pathnameStackToGoBack),f=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h(u=>k(u,i)),{isFeatureEnabled:I}=r(v.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=r(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(M,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:g.colors.grey5}}):l.jsxs(ae,{windowSize:o,children:[l.jsx(H,{vendorId:i,billId:d}),l.jsx(oe,{location:a,navigate:n,billId:d,vendorId:i,currentTenant:b,bankAccountContext:f,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const E=(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,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,"ach",t,n)}function ve(e,t,n){return $(e,"domestic",t,n)}function ge(e,t,n){return $(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=z.div`
10
10
  display: flex;
11
11
  height: 100vh;
12
12
  width: 100%;
@@ -15,4 +15,4 @@ import{j as l}from"./liveblocks-D41N0IlG.js";import{j as w,u as C,g as h,k as A,
15
15
  align-items: center;
16
16
  background-color: ${e=>e.theme.colors.grey4};
17
17
  box-shadow: ${e=>`0px 2px ${O.sp1} ${e.theme.colors.dropShadowNormal}`};
18
- `,ce=A(function(e,t){const{vendorId:n,billId:a}=t,o=k(e,n),s=D(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:c}=t,{tenantEmailDomain:d}=c;return{onFetchBankName:r=>{e(j(r))},onSaveHandler:r=>{e(G(t.bankAccountContext,r,"us-domestic",s))},onWireDetailsUpdated:r=>{const{bankAccountSection:i}=r;e(T({data:i}))},onCancel:()=>{(()=>{const r=p(o.state?.pathnameStackToGoBack),i=r.poppedPathname??P();a(i,{state:{pathnameStackToGoBack:r.newStack}})})(),e(S())},onAddressClick:r=>{if(t.bankAccountContext==="express-pay")a("./add-address");else{const i=se(d,r,n),b=te(o.state?.pathnameStackToGoBack,o.pathname);a(i,{state:{pathnameStackToGoBack:b}})}},onBackClick:()=>{if(e(F({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")a("../",{relative:"path"});else{const r=p(t.location.state?.pathnameStackToGoBack),i=r.poppedPathname??P(0);t.navigate(i,{state:{pathnameStackToGoBack:r.newStack}})}e(S())}}})(ee);function xe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=R(),{vendorId:s,billId:c}=B(),d=e??s,r=U.getSignedInUser(),{useFeatureGate:i}=N(),b=Z(),g=h(u=>V(u)),x=p(a.state?.pathnameStackToGoBack),f=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h(u=>k(u,d)),{isFeatureEnabled:I}=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(M,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:b.colors.grey5,boxShadow:`0px 2px ${O.sp1} ${b.colors.dropShadowNormal}`}}):l.jsxs(re,{windowSize:o,children:[l.jsx(H,{vendorId:d,billId:c}),l.jsx(ce,{location:a,navigate:n,billId:c,vendorId:d,currentTenant:g,bankAccountContext:f,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const P=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t};export{fe as A,xe as D,H 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=D(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:i}=d;return{onFetchBankName:r=>{e(j(r))},onSaveHandler:r=>{e(G(t.bankAccountContext,r,"us-domestic",s))},onWireDetailsUpdated:r=>{const{bankAccountSection:c}=r;e(T({data:c}))},onCancel:()=>{(()=>{const r=p(o.state?.pathnameStackToGoBack),c=r.poppedPathname??P();a(c,{state:{pathnameStackToGoBack:r.newStack}})})(),e(S())},onAddressClick:r=>{if(t.bankAccountContext==="express-pay")a("./add-address");else{const c=se(i,r,n),b=te(o.state?.pathnameStackToGoBack,o.pathname);a(c,{state:{pathnameStackToGoBack:b}})}},onBackClick:()=>{if(e(F({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")a("../",{relative:"path"});else{const r=p(t.location.state?.pathnameStackToGoBack),c=r.poppedPathname??P(0);t.navigate(c,{state:{pathnameStackToGoBack:r.newStack}})}e(S())}}})(ee);function xe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=R(),{vendorId:s,billId:d}=B(),i=e??s,r=U.getSignedInUser(),{useFeatureGate:c}=N(),b=Z(),g=h(u=>V(u)),x=p(a.state?.pathnameStackToGoBack),f=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h(u=>k(u,i)),{isFeatureEnabled:I}=c(v.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=c(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(M,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:b.colors.grey5,boxShadow:`0px 2px ${O.sp1} ${b.colors.dropShadowNormal}`}}):l.jsxs(re,{windowSize:o,children:[l.jsx(H,{vendorId:i,billId:d}),l.jsx(de,{location:a,navigate:n,billId:d,vendorId:i,currentTenant:g,bankAccountContext:f,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const P=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t};export{fe as A,xe as D,H 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-D41N0IlG.js";import{Z as l,E as f,m as c}from"./index-CkmaHLOP.js";import{D as b}from"./mui-DZd7XaFW.js";import"./sentry-Bhr8KU--.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]="5f0ed12e-e902-402b-85e7-22752bbd60d8",e._sentryDebugIdIdentifier="sentry-dbid-5f0ed12e-e902-402b-85e7-22752bbd60d8")}catch{}})();const p={drawerLeftMargin:new f(0,0,240)};function m(e){const{isOpen:r,drawerLeftMargin:o,children:t,onClose:s}=e,n=l(),d=o?.valuePx(n)??p.drawerLeftMargin.valuePx(n),a=c();return i.jsx(b,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${d})`}},slotProps:{backdrop:{style:{backgroundColor:a.colors.black,opacity:.8,cursor:"pointer"}}},onClose:s,children:t})}export{m as D};
1
+ import{j as i}from"./liveblocks-6nZkQHFl.js";import{Z as l,E as f,m as c}from"./index-cQHaeS6s.js";import{D as b}from"./mui-DOBONCVx.js";import"./sentry-Dr5FPm4d.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]="5f0ed12e-e902-402b-85e7-22752bbd60d8",e._sentryDebugIdIdentifier="sentry-dbid-5f0ed12e-e902-402b-85e7-22752bbd60d8")}catch{}})();const p={drawerLeftMargin:new f(0,0,240)};function m(e){const{isOpen:r,drawerLeftMargin:o,children:t,onClose:s}=e,n=l(),d=o?.valuePx(n)??p.drawerLeftMargin.valuePx(n),a=c();return i.jsx(b,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${d})`}},slotProps:{backdrop:{style:{backgroundColor:a.colors.black,opacity:.8,cursor:"pointer"}}},onClose:s,children:t})}export{m as D};
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-D41N0IlG.js";import{a as d}from"./sentry-Bhr8KU--.js";import{j as B,h as G,u as q,l as O,g as l,N as F,k as _,n as N,o as z}from"./core-B86WF2Ww.js";import{L4 as H,eO as J,Kt as K,kA as Y,H2 as k,L9 as L,JY as M,jA as R,H3 as b,Ky as W,Kz as $,J_ as V,JZ as Z}from"./zeni-epic-state-BLvcbIPk.js";import{aO as Q,c as U,p as X,n as tt}from"./index-CkmaHLOP.js";import"./mui-DZd7XaFW.js";import{d as S}from"./decodeURIComponentSafe-C-DNZuqb.js";import{w as et}from"./withTransactionSidePanel-g1cpVyXy.js";import{e as at,b as nt}from"./routePaths-C8NVJkmp.js";import"./recharts-BHLF4b4u.js";import"./analytics-CFOBCmx3.js";import"./plaid-CZm5yErz.js";import"./dnd-DrUSXn8k.js";import"./stripe-DMRn4zHo.js";import"./lottie-BHETr187.js";import"./lexical-COpm991f.js";import"./pdf-BdWka_4Q.js";import"./utils-Mvk27uIx.js";import"./useAskAiCfoHostNavButtonProps-DRzMbg61.js";import"./useFetchSuggestedQuestionsWhenReady-dE_HTM0_.js";import"./TransactionDetailScreen-Bu7653PN.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]="48d172b5-38b2-4a2b-9744-cefa0b4350b6",a._sentryDebugIdIdentifier="sentry-dbid-48d172b5-38b2-4a2b-9744-cefa0b4350b6")}catch{}})();const ot=_(function(a,t){const e=t.entity,o=L(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:M(a,"common")},trendWithTransactionsReport:o,analytics:U,isAccountingClassesEnabled:R(a)}},function(a,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const o=`${nt(e,t.tenantEmailDomain)}`,c=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:c}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(V({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(Z("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(W()),a($()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=X(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??I();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(b(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(b(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(Q),it=et(function({entityType:a,...t}){const e=B(),o=G(),c=q(),[m,T]=d.useState(!1),[h,D]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:j,entityNameEncoded:w}=O(),r=S(j??""),p=S(w??""),u=rt(r,p),x=[r,p].filter(n=>n!=null),i={name:p,id:r,type:a,zeniId:r,qboId:r},g=l(n=>H(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),v=l(n=>J(n).company?.companyInfo.firstMonthOfFY??1),f=l(n=>K(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&u===!0&&(T(!0),o(Y(i)))},[m,u,i]);const E=l(n=>n.trendState.fetchState),P=f?.selectedPeriod?.timePeriod??g,A=function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y}(f?.selectedPeriod?.timePeriod,g);return d.useEffect(()=>{m===!0&&h===!1&&E==="Completed"&&(D(!0),P!=null&&o(k(i,"EntityDetail",{timeframe:f?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))},[m,h,E]),u?s.jsx(ot,{firstMonthOfFY:v,tenantEmailDomain:C,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:A,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(F,{to:I(x.length)})}),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,I=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function wt({entityType:a}){return s.jsx(N,{children:s.jsx(z,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{wt as EntityDetailRoutes,wt as default};
1
+ import{j as s}from"./liveblocks-6nZkQHFl.js";import{a as d}from"./sentry-Dr5FPm4d.js";import{j as B,h as G,u as q,l as O,g as l,N as F,k as _,n as N,o as z}from"./core-B8DAi0nh.js";import{L4 as H,eO as J,Kt as K,kA as Y,H2 as k,L9 as L,JY as M,jA as R,H3 as b,Ky as W,Kz as $,J_ as V,JZ as Z}from"./zeni-epic-state-DITtSXPQ.js";import{aO as Q,c as U,p as X,n as tt}from"./index-cQHaeS6s.js";import"./mui-DOBONCVx.js";import{d as S}from"./decodeURIComponentSafe-2RJaUBNT.js";import{w as et}from"./withTransactionSidePanel-CTJGoNFJ.js";import{e as at,b as nt}from"./routePaths-CHt7s04E.js";import"./recharts-CDgByeDS.js";import"./analytics-CLyVqw3m.js";import"./plaid-BJER8-rG.js";import"./dnd-DNrenqEc.js";import"./stripe-DMRn4zHo.js";import"./lottie-Cp94NU-O.js";import"./lexical-BbcB7U6u.js";import"./pdf-B9LwAnPJ.js";import"./utils-XBrV3QeH.js";import"./useAskAiCfoHostNavButtonProps-D-63GR-J.js";import"./useFetchSuggestedQuestionsWhenReady-Cq8Wv1kQ.js";import"./TransactionDetailScreen-BW7drAuq.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]="48d172b5-38b2-4a2b-9744-cefa0b4350b6",a._sentryDebugIdIdentifier="sentry-dbid-48d172b5-38b2-4a2b-9744-cefa0b4350b6")}catch{}})();const ot=_(function(a,t){const e=t.entity,o=L(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:M(a,"common")},trendWithTransactionsReport:o,analytics:U,isAccountingClassesEnabled:R(a)}},function(a,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const o=`${nt(e,t.tenantEmailDomain)}`,c=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:c}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(V({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(Z("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(W()),a($()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=X(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??I();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(b(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(b(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(Q),it=et(function({entityType:a,...t}){const e=B(),o=G(),c=q(),[m,T]=d.useState(!1),[h,D]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:j,entityNameEncoded:w}=O(),r=S(j??""),p=S(w??""),u=rt(r,p),x=[r,p].filter(n=>n!=null),i={name:p,id:r,type:a,zeniId:r,qboId:r},g=l(n=>H(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),v=l(n=>J(n).company?.companyInfo.firstMonthOfFY??1),f=l(n=>K(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&u===!0&&(T(!0),o(Y(i)))},[m,u,i]);const E=l(n=>n.trendState.fetchState),P=f?.selectedPeriod?.timePeriod??g,A=function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y}(f?.selectedPeriod?.timePeriod,g);return d.useEffect(()=>{m===!0&&h===!1&&E==="Completed"&&(D(!0),P!=null&&o(k(i,"EntityDetail",{timeframe:f?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))},[m,h,E]),u?s.jsx(ot,{firstMonthOfFY:v,tenantEmailDomain:C,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:A,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(F,{to:I(x.length)})}),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,I=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function wt({entityType:a}){return s.jsx(N,{children:s.jsx(z,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{wt as EntityDetailRoutes,wt as default};
@@ -1,4 +1,4 @@
1
- import{j as C}from"./liveblocks-D41N0IlG.js";import xn from"./NotFoundScreen--NgVTkpE.js";import{a,b as Tt}from"./sentry-Bhr8KU--.js";import{n as Fe,S as Rn}from"./mui-DZd7XaFW.js";import{h as ce,j as wt,u as Ge,g as U,k as Dn,l as rt,n as Un,o as Le}from"./core-B86WF2Ww.js";import{eO as Re,Po as Fn,mF as Se,fe as Bn,qg as _n,mX as xt,ng as Rt,Pp as Dt,nq as Vn,Pq as Ut,mQ as Mn,pO as On,eZ as pe,Pr as De,sm as Ft,Bx as Bt,Ps as _t,Pt as jn,pt as Je,L5 as dt,L7 as Ln,jD as zn,L8 as $n,jK as qn,cV as Gn,tp as Ne,n1 as Vt,nv as Ue,Pu as Jn,J_ as ut,JZ as Te,Pv as mt,j$ as Nn,Pw as Yn,Px as Kn,Py as Qn,Pz as Zn,n8 as Hn,mV as ie,ny as we,PA as Wn,PB as Xn,PC as ea,nF as ta,jO as na,jF as aa,PD as oa,jN as ht,Lf as sa,PE as ca,PF as ia,pp as la,p4 as ra,nw as ge,p3 as ze,PG as da,PH as ua,li as ma,bq as ha,ld as pt,k$ as pa,PI as ga,gM as gt,fQ as Ca,la as Sa,vi as Ia,PJ as fa,o4 as ka,n$ as Ea,o3 as va,nQ as ya,PK as Pa,f0 as Mt,nj as ba,n4 as Aa,ff as Ct,nA as Ta,PL as wa,nx as Ot,PM as xa,PN as Ra,PO as Da,PP as Ua,PQ as St,pB as Fa,oW as Ba,JY as _a,jM as Va,PR as Ma,G3 as Oa,jL as ja,jA as La,e$ as za,ov as jt,oO as $a,nu as It,nz as qa,bD as Ga,l7 as Ja,l4 as Na,PS as Ya,nP as ft,oM as kt,oK as Ka,oA as Qa,of as Za,oN as Ha,PT as Wa,PU as Xa,oj as eo,PV as to,o9 as no,oi as ao,og as oo,oR as so}from"./zeni-epic-state-BLvcbIPk.js";import{y as Lt,S as Ce,c as L,n as Z,R as zt,cx as co,z as Be,cy as io,aq as xe,cz as lo,aQ as Et,B as $t,cA as ro,an as $e,D as uo,cB as mo,W as ho,cC as po,Q as go,cD as Co,cE as So,q as Io,k as fo,aK as ko,b2 as Eo,E as vo,cF as yo}from"./index-CkmaHLOP.js";import{u as qt}from"./useAskAiCfoHostNavButtonProps-DRzMbg61.js";import{c as Gt}from"./useFetchSuggestedQuestionsWhenReady-dE_HTM0_.js";import{c as vt,C as Po}from"./TransactionDetailScreen-Bu7653PN.js";import{w as bo}from"./withTransactionSidePanel-g1cpVyXy.js";import{h as Ao,v as To}from"./routePaths-C8NVJkmp.js";import{g as qe}from"./accountMappingHelper-yvOeY36k.js";import{D as wo}from"./DrawerScreen-0fzJHN6i.js";import"./recharts-BHLF4b4u.js";import"./analytics-CFOBCmx3.js";import"./plaid-CZm5yErz.js";import"./dnd-DrUSXn8k.js";import"./stripe-DMRn4zHo.js";import"./lottie-BHETr187.js";import"./lexical-COpm991f.js";import"./pdf-BdWka_4Q.js";import"./utils-Mvk27uIx.js";import"./decodeURIComponentSafe-C-DNZuqb.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="b5301703-7415-4368-96e9-e1c1d964ee39",t._sentryDebugIdIdentifier="sentry-dbid-b5301703-7415-4368-96e9-e1c1d964ee39")}catch{}})();const xo=()=>{const t=ce(),i=wt(),b=Ge(),f=U(d=>Re(d)),{useFeatureGate:E}=Lt(),{isFeatureEnabled:g}=E(Ce.isRealtimeInsightsFeatureEnabled),u=U(d=>d.expenseAutomationViewState.selectedPeriodByTenantId),o=U(d=>Fn(d,f.tenantId)),{isAiCfoAccessEnabled:v,onAskAiCfoClick:S}=qt({mobileExploreReferrer:"Month-End Close Overview"}),m=a.useCallback((d,R,K=!1)=>{t(Se({tenantId:R,period:{month:d.month,year:d.year},refreshViewInBackground:K}))},[]),y=a.useCallback(d=>{const R=b.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(d.month,d.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,R??null),t(Bn(f.tenantId,d))},[f.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),r=u[f.tenantId],B=a.useCallback(()=>{const d=b.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(r.month,r.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,d??null),m(r,f.tenantId,!0)},[m,r,f.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),h=Z(b.state?.pathnameStackToGoBack,b.pathname),A=a.useCallback(()=>{if(o.monthEndCloseChecks!=null&&r!=null){const d=o.monthEndCloseChecks.monthEndCloseCheckList.find(R=>R.progress<100);if(d!=null)return void i(`./${d.id}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview"}});i(`./month_end_insights/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview"}})}},[o.monthEndCloseChecks,r]),{areTenantIdsInSync:I}=zt();return Gt({isDataReady:o.fetchState==="Completed"}),a.useEffect(()=>{r!=null&&o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&I&&m(r,f.tenantId)},[m,r,o.fetchState,f.tenantId,I]),a.useEffect(()=>{r!=null&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&I&&t(_n(r))},[r,o.monthClosePerformanceTrendFetchStatus.fetchState,I]),a.useEffect(()=>{const d=setInterval(()=>{o.fetchState!=="In-Progress"&&o.fetchState==="Completed"&&B()},3e5);return()=>clearInterval(d)},[o.fetchState]),a.useEffect(()=>{if(o.fetchState==="Completed"&&o.monthEndCloseChecks?.auditSummary!=null){const d=b.state?.referrer;L.trackMonthCloseAuditPage(o.selectedPeriod.month,o.selectedPeriod.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,d??null)}},[o.fetchState,o.selectedPeriod,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),C.jsx(Ro,{children:C.jsx(co,{monthEndCloseChecksView:o,isRealtimeInsightsFeatureEnabled:g,onMonthEndCheckClick:d=>{i(`./${d}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:y,handleReviewButtonClick:A,onBackClick:()=>{i("../../dashboard")},onReload:B,isAiCfoAccessEnabled:v,onAskAiCfoClick:S})})},Ro=Fe.div`
1
+ import{j as C}from"./liveblocks-6nZkQHFl.js";import xn from"./NotFoundScreen-C17gldyA.js";import{a,b as Tt}from"./sentry-Dr5FPm4d.js";import{n as Fe,S as Rn}from"./mui-DOBONCVx.js";import{h as ce,j as wt,u as Ge,g as U,k as Dn,l as rt,n as Un,o as Le}from"./core-B8DAi0nh.js";import{eO as Re,Po as Fn,mF as Se,fe as Bn,qg as _n,mX as xt,ng as Rt,Pp as Dt,nq as Vn,Pq as Ut,mQ as Mn,pO as On,eZ as pe,Pr as De,sm as Ft,Bx as Bt,Ps as _t,Pt as jn,pt as Je,L5 as dt,L7 as Ln,jD as zn,L8 as $n,jK as qn,cV as Gn,tp as Ne,n1 as Vt,nv as Ue,Pu as Jn,J_ as ut,JZ as Te,Pv as mt,j$ as Nn,Pw as Yn,Px as Kn,Py as Qn,Pz as Zn,n8 as Hn,mV as ie,ny as we,PA as Wn,PB as Xn,PC as ea,nF as ta,jO as na,jF as aa,PD as oa,jN as ht,Lf as sa,PE as ca,PF as ia,pp as la,p4 as ra,nw as ge,p3 as ze,PG as da,PH as ua,li as ma,bq as ha,ld as pt,k$ as pa,PI as ga,gM as gt,fQ as Ca,la as Sa,vi as Ia,PJ as fa,o4 as ka,n$ as Ea,o3 as va,nQ as ya,PK as Pa,f0 as Mt,nj as ba,n4 as Aa,ff as Ct,nA as Ta,PL as wa,nx as Ot,PM as xa,PN as Ra,PO as Da,PP as Ua,PQ as St,pB as Fa,oW as Ba,JY as _a,jM as Va,PR as Ma,G3 as Oa,jL as ja,jA as La,e$ as za,ov as jt,oO as $a,nu as It,nz as qa,bD as Ga,l7 as Ja,l4 as Na,PS as Ya,nP as ft,oM as kt,oK as Ka,oA as Qa,of as Za,oN as Ha,PT as Wa,PU as Xa,oj as eo,PV as to,o9 as no,oi as ao,og as oo,oR as so}from"./zeni-epic-state-DITtSXPQ.js";import{y as Lt,S as Ce,c as L,n as Z,R as zt,cw as co,z as Be,cx as io,aq as xe,cy as lo,aQ as Et,B as $t,cz as ro,an as $e,D as uo,cA as mo,W as ho,cB as po,Q as go,cC as Co,cD as So,q as Io,k as fo,aK as ko,b1 as Eo,E as vo,cE as yo}from"./index-cQHaeS6s.js";import{u as qt}from"./useAskAiCfoHostNavButtonProps-D-63GR-J.js";import{c as Gt}from"./useFetchSuggestedQuestionsWhenReady-Cq8Wv1kQ.js";import{c as vt,C as Po}from"./TransactionDetailScreen-BW7drAuq.js";import{w as bo}from"./withTransactionSidePanel-CTJGoNFJ.js";import{h as Ao,v as To}from"./routePaths-CHt7s04E.js";import{g as qe}from"./accountMappingHelper-DEVWShIB.js";import{D as wo}from"./DrawerScreen-rD1CnMVg.js";import"./recharts-CDgByeDS.js";import"./analytics-CLyVqw3m.js";import"./plaid-BJER8-rG.js";import"./dnd-DNrenqEc.js";import"./stripe-DMRn4zHo.js";import"./lottie-Cp94NU-O.js";import"./lexical-BbcB7U6u.js";import"./pdf-B9LwAnPJ.js";import"./utils-XBrV3QeH.js";import"./decodeURIComponentSafe-2RJaUBNT.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="44cb5e39-0314-4247-874a-1192f82f08c1",t._sentryDebugIdIdentifier="sentry-dbid-44cb5e39-0314-4247-874a-1192f82f08c1")}catch{}})();const xo=()=>{const t=ce(),i=wt(),b=Ge(),f=U(d=>Re(d)),{useFeatureGate:E}=Lt(),{isFeatureEnabled:g}=E(Ce.isRealtimeInsightsFeatureEnabled),u=U(d=>d.expenseAutomationViewState.selectedPeriodByTenantId),o=U(d=>Fn(d,f.tenantId)),{isAiCfoAccessEnabled:v,onAskAiCfoClick:S}=qt({mobileExploreReferrer:"Month-End Close Overview"}),m=a.useCallback((d,R,K=!1)=>{t(Se({tenantId:R,period:{month:d.month,year:d.year},refreshViewInBackground:K}))},[]),y=a.useCallback(d=>{const R=b.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(d.month,d.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,R??null),t(Bn(f.tenantId,d))},[f.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),r=u[f.tenantId],B=a.useCallback(()=>{const d=b.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(r.month,r.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,d??null),m(r,f.tenantId,!0)},[m,r,f.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),h=Z(b.state?.pathnameStackToGoBack,b.pathname),A=a.useCallback(()=>{if(o.monthEndCloseChecks!=null&&r!=null){const d=o.monthEndCloseChecks.monthEndCloseCheckList.find(R=>R.progress<100);if(d!=null)return void i(`./${d.id}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview"}});i(`./month_end_insights/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview"}})}},[o.monthEndCloseChecks,r]),{areTenantIdsInSync:I}=zt();return Gt({isDataReady:o.fetchState==="Completed"}),a.useEffect(()=>{r!=null&&o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&I&&m(r,f.tenantId)},[m,r,o.fetchState,f.tenantId,I]),a.useEffect(()=>{r!=null&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&I&&t(_n(r))},[r,o.monthClosePerformanceTrendFetchStatus.fetchState,I]),a.useEffect(()=>{const d=setInterval(()=>{o.fetchState!=="In-Progress"&&o.fetchState==="Completed"&&B()},3e5);return()=>clearInterval(d)},[o.fetchState]),a.useEffect(()=>{if(o.fetchState==="Completed"&&o.monthEndCloseChecks?.auditSummary!=null){const d=b.state?.referrer;L.trackMonthCloseAuditPage(o.selectedPeriod.month,o.selectedPeriod.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,d??null)}},[o.fetchState,o.selectedPeriod,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),C.jsx(Ro,{children:C.jsx(co,{monthEndCloseChecksView:o,isRealtimeInsightsFeatureEnabled:g,onMonthEndCheckClick:d=>{i(`./${d}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:h,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:y,handleReviewButtonClick:A,onBackClick:()=>{i("../../dashboard")},onReload:B,isAiCfoAccessEnabled:v,onAskAiCfoClick:S})})},Ro=Fe.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-D41N0IlG.js";import{a as r}from"./sentry-Bhr8KU--.js";import{X as l,Y as p,a0 as b,p as d}from"./index-CkmaHLOP.js";import"./mui-DZd7XaFW.js";import m from"./NotFoundScreen--NgVTkpE.js";import{j as c,u}from"./core-B86WF2Ww.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]="3e0f241e-ef5a-4985-bb0b-24a3b9aea331",e._sentryDebugIdIdentifier="sentry-dbid-3e0f241e-ef5a-4985-bb0b-24a3b9aea331")}catch{}})();const D=()=>{const e=c(),a=u(),t=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),i=r.useCallback(()=>{(()=>{const n=d(a.state?.pathnameStackToGoBack),f=n.poppedPathname??k();e(f,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=l(a.pathname);return o!=null?s.jsx(p,{menuItem:b(o),onDemoClick:t,onGoBack:i}):s.jsx(m,{})},k=(e=2)=>{let a="../";for(let t=0;t<e;t++)a=`${a}../`;return a};export{D as F};
1
+ import{j as s}from"./liveblocks-6nZkQHFl.js";import{a as r}from"./sentry-Dr5FPm4d.js";import{X as l,Y as p,a0 as b,p as d}from"./index-cQHaeS6s.js";import"./mui-DOBONCVx.js";import m from"./NotFoundScreen-C17gldyA.js";import{j as c,u}from"./core-B8DAi0nh.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]="3e0f241e-ef5a-4985-bb0b-24a3b9aea331",e._sentryDebugIdIdentifier="sentry-dbid-3e0f241e-ef5a-4985-bb0b-24a3b9aea331")}catch{}})();const D=()=>{const e=c(),a=u(),t=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),i=r.useCallback(()=>{(()=>{const n=d(a.state?.pathnameStackToGoBack),f=n.poppedPathname??k();e(f,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=l(a.pathname);return o!=null?s.jsx(p,{menuItem:b(o),onDemoClick:t,onGoBack:i}):s.jsx(m,{})},k=(e=2)=>{let a="../";for(let t=0;t<e;t++)a=`${a}../`;return a};export{D as F};
@@ -1 +1 @@
1
- import{a as r}from"./sentry-Bhr8KU--.js";import{h as l,j as f,u as m}from"./core-B86WF2Ww.js";import{gt as p,Ja as g,Jb as b}from"./zeni-epic-state-BLvcbIPk.js";import{u as _,L as h,z as y}from"./index-CkmaHLOP.js";import"./liveblocks-D41N0IlG.js";import"./recharts-BHLF4b4u.js";import"./mui-DZd7XaFW.js";import"./analytics-CFOBCmx3.js";import"./plaid-CZm5yErz.js";import"./dnd-DrUSXn8k.js";import"./stripe-DMRn4zHo.js";import"./lottie-BHETr187.js";import"./lexical-COpm991f.js";import"./pdf-BdWka_4Q.js";import"./utils-Mvk27uIx.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]="768ad7e3-0477-4b5f-8592-ca18cc93b2ab",e._sentryDebugIdIdentifier="sentry-dbid-768ad7e3-0477-4b5f-8592-ca18cc93b2ab")}catch{}})();function C(){const e=l(),n=f(),o=m(),{setLoading:i,clearAllLoading:d}=_(),a=r.useRef(!1);return r.useLayoutEffect(()=>{i(h.CONNECTION_AUTH)},[i]),r.useEffect(()=>{if(a.current)return;a.current=!0;const s=new URLSearchParams(o.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"),b("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{C as default};
1
+ import{a as r}from"./sentry-Dr5FPm4d.js";import{h as l,j as f,u as m}from"./core-B8DAi0nh.js";import{gt as p,Ja as g,Jb as b}from"./zeni-epic-state-DITtSXPQ.js";import{u as _,L as h,z as y}from"./index-cQHaeS6s.js";import"./liveblocks-6nZkQHFl.js";import"./recharts-CDgByeDS.js";import"./mui-DOBONCVx.js";import"./analytics-CLyVqw3m.js";import"./plaid-BJER8-rG.js";import"./dnd-DNrenqEc.js";import"./stripe-DMRn4zHo.js";import"./lottie-Cp94NU-O.js";import"./lexical-BbcB7U6u.js";import"./pdf-B9LwAnPJ.js";import"./utils-XBrV3QeH.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]="768ad7e3-0477-4b5f-8592-ca18cc93b2ab",e._sentryDebugIdIdentifier="sentry-dbid-768ad7e3-0477-4b5f-8592-ca18cc93b2ab")}catch{}})();function C(){const e=l(),n=f(),o=m(),{setLoading:i,clearAllLoading:d}=_(),a=r.useRef(!1);return r.useLayoutEffect(()=>{i(h.CONNECTION_AUTH)},[i]),r.useEffect(()=>{if(a.current)return;a.current=!0;const s=new URLSearchParams(o.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"),b("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{C as default};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-D41N0IlG.js";import{l as S,k as g,j as C,u as y,h as ee,q as ae,g as E,N as te,n as ne,o as p}from"./core-B86WF2Ww.js";import{J3 as k,J4 as v,J5 as T,z8 as B,yW as G,J6 as D,J7 as oe,J8 as se,y_ as ie,eP as $,z5 as le,z2 as re}from"./zeni-epic-state-BLvcbIPk.js";import{Z as x,o as r,O as de,c as j,f as J,h as ce,p as me,i as pe,n as _,y as ue,S as he,F as ge,q as xe,m as fe,s as be,B as we,w as Se,T as ye,A as ke,C as ve,E as je,N as $e}from"./index-CkmaHLOP.js";import{n as m}from"./mui-DZd7XaFW.js";import f from"./NotFoundScreen--NgVTkpE.js";import{a as I}from"./sentry-Bhr8KU--.js";import"./recharts-BHLF4b4u.js";import"./analytics-CFOBCmx3.js";import"./plaid-CZm5yErz.js";import"./dnd-DrUSXn8k.js";import"./stripe-DMRn4zHo.js";import"./lottie-BHETr187.js";import"./lexical-COpm991f.js";import"./pdf-BdWka_4Q.js";import"./utils-Mvk27uIx.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]="2f9cece4-dfc7-4bfc-bab7-f36abaa62e19",e._sentryDebugIdIdentifier="sentry-dbid-2f9cece4-dfc7-4bfc-bab7-f36abaa62e19")}catch{}})();const Ie=m.div`
1
+ import{j as a}from"./liveblocks-6nZkQHFl.js";import{l as S,k as g,j as C,u as y,h as ee,q as ae,g as E,N as te,n as ne,o as p}from"./core-B8DAi0nh.js";import{J3 as k,J4 as v,J5 as T,z8 as B,yW as G,J6 as D,J7 as oe,J8 as se,y_ as ie,eP as $,z5 as le,z2 as re}from"./zeni-epic-state-DITtSXPQ.js";import{Z as x,o as r,O as de,c as j,f as J,h as ce,p as me,i as pe,n as _,y as ue,S as he,F as ge,q as xe,m as fe,s as be,B as we,w as Se,T as ye,A as ke,C as ve,E as je,N as $e}from"./index-cQHaeS6s.js";import{n as m}from"./mui-DOBONCVx.js";import f from"./NotFoundScreen-C17gldyA.js";import{a as I}from"./sentry-Dr5FPm4d.js";import"./recharts-CDgByeDS.js";import"./analytics-CLyVqw3m.js";import"./plaid-BJER8-rG.js";import"./dnd-DNrenqEc.js";import"./stripe-DMRn4zHo.js";import"./lottie-Cp94NU-O.js";import"./lexical-BbcB7U6u.js";import"./pdf-B9LwAnPJ.js";import"./utils-XBrV3QeH.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]="2f9cece4-dfc7-4bfc-bab7-f36abaa62e19",e._sentryDebugIdIdentifier="sentry-dbid-2f9cece4-dfc7-4bfc-bab7-f36abaa62e19")}catch{}})();const Ie=m.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{j as u}from"./liveblocks-D41N0IlG.js";import{a as g}from"./sentry-Bhr8KU--.js";import{h as O,u as _,j as w,q as P,g as l,N as T}from"./core-B86WF2Ww.js";import{z as r,m as M,D as V,d as A,c as N,e as R,v as W,T as $,g as q}from"./index-CkmaHLOP.js";import{eO as H,IQ as J,I_ as Q,IR as B,eP as G,fi as K,IW as X,fH as Y,cT as Z,I$ as ee,J0 as te}from"./zeni-epic-state-BLvcbIPk.js";import{n as ne}from"./mui-DZd7XaFW.js";import{u as ae}from"./useDeviceId-rK1IEgER.js";import{f as se}from"./analyticsHelper-Bx8A0vf3.js";import{t as ie}from"./getLocaleForTenant-DNhjRuKy.js";import"./recharts-BHLF4b4u.js";import"./analytics-CFOBCmx3.js";import"./plaid-CZm5yErz.js";import"./dnd-DrUSXn8k.js";import"./stripe-DMRn4zHo.js";import"./lottie-BHETr187.js";import"./lexical-COpm991f.js";import"./pdf-BdWka_4Q.js";import"./utils-Mvk27uIx.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]="f82c82fa-02d9-46a6-b1cb-d27e6a6eb4ca",t._sentryDebugIdIdentifier="sentry-dbid-f82c82fa-02d9-46a6-b1cb-d27e6a6eb4ca")}catch{}})();const D=(t,s)=>t!=null&&t.length>0&&s==="magic_links";function De(){const t=O(),s=_(),m=w(),[k]=P(),n=k.get("token"),p=k.get("stytch_token_type"),f=r.getMagicLinkCodeVerifier(),i=ae(),{otpChallenge:d,twoFAPhoneNumber:x,magicLinkEmail:c,verifyDeviceFetchState:z,resendVerifyDeviceOTPFetchState:C}=l(e=>e.tenantState),I=l(e=>e.tenantState.fetchState),y=l(e=>e.tenantState.activeTenantFetchState.fetchState),S=l(e=>e.tenantState.signInState),h=l(e=>e.tenantState.magicLinkSignInFetchState.fetchState),a=l(e=>e.tenantState.loggedInUser),o=l(e=>H(e)),b=l(e=>J(e)),E=r.getSignedInUser(),v=M().mode;g.useEffect(()=>{a?.zeniSessionId==null&&n!=null&&D(n,p)&&i!=null&&f!=null&&(r.saveMagicLinkTriggered(n),t(Q(n,i,f)))},[n,p,t,i,f,a?.zeniSessionId]),g.useEffect(()=>{S!=="In-Progress"||I!=="Completed"&&y!=="Completed"||a?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(a,a.zeniSessionId),r.saveSignedInUserTenants(B(b.tenantsInOrder),a.zeniSessionId),G(a.userId,a.zeniSessionId,o.tenantId),t(K(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(X("Completed")),V.updateAppLocaleID(ie(o)),se(a,o,v,void 0,b.tenantsInOrder),Y().then(()=>{const e=q();e!=null&&A(e)}),setTimeout(()=>{N.trackLogin(R.Event.loginSuccess,"email",Z(o.productSettings))},2e3))},[S,I,y,a,o,b,v,s.state,t]);const U=g.useCallback(()=>{m("/signin/auth")},[m]),j=g.useCallback(()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))},[i,d,t,c]),F=g.useCallback(e=>{i!=null&&n!=null&&c!=null&&d!=null&&t(te(e,i,c,d))},[i,n,t,c,d]);if(h==="Completed"&&d!=null)return u.jsx(W,{phoneNumber:x,verifyOtpFetchState:z.fetchState,resendVerifyDeviceOTPFetchState:C,onResendOtp:j,onVerifyOtp:F,onCancelVerifyDevice:U});if(S==="In-Progress"&&I==="Completed"&&a?.zeniSessionId!=null&&o!=null||E!=null){const e=s.state?.origin??"/";return u.jsx(T,{to:e,state:{...s.state,origin:""}})}if(!D(n,p)||f==null||h==="Error"){const e=s.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(T,{to:e,state:{...s.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||h==="Error"&&a?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx($,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
1
+ import{j as u}from"./liveblocks-6nZkQHFl.js";import{a as g}from"./sentry-Dr5FPm4d.js";import{h as O,u as _,j as w,q as P,g as l,N as T}from"./core-B8DAi0nh.js";import{z as r,m as M,D as V,d as A,c as N,e as R,v as W,T as $,g as q}from"./index-cQHaeS6s.js";import{eO as H,IQ as J,I_ as Q,IR as B,eP as G,fi as K,IW as X,fH as Y,cT as Z,I$ as ee,J0 as te}from"./zeni-epic-state-DITtSXPQ.js";import{n as ne}from"./mui-DOBONCVx.js";import{u as ae}from"./useDeviceId-fW8BPEnA.js";import{f as se}from"./analyticsHelper-DF_egLQC.js";import{t as ie}from"./getLocaleForTenant-CuY27Ik8.js";import"./recharts-CDgByeDS.js";import"./analytics-CLyVqw3m.js";import"./plaid-BJER8-rG.js";import"./dnd-DNrenqEc.js";import"./stripe-DMRn4zHo.js";import"./lottie-Cp94NU-O.js";import"./lexical-BbcB7U6u.js";import"./pdf-B9LwAnPJ.js";import"./utils-XBrV3QeH.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]="f82c82fa-02d9-46a6-b1cb-d27e6a6eb4ca",t._sentryDebugIdIdentifier="sentry-dbid-f82c82fa-02d9-46a6-b1cb-d27e6a6eb4ca")}catch{}})();const D=(t,s)=>t!=null&&t.length>0&&s==="magic_links";function De(){const t=O(),s=_(),m=w(),[k]=P(),n=k.get("token"),p=k.get("stytch_token_type"),f=r.getMagicLinkCodeVerifier(),i=ae(),{otpChallenge:d,twoFAPhoneNumber:x,magicLinkEmail:c,verifyDeviceFetchState:z,resendVerifyDeviceOTPFetchState:C}=l(e=>e.tenantState),I=l(e=>e.tenantState.fetchState),y=l(e=>e.tenantState.activeTenantFetchState.fetchState),S=l(e=>e.tenantState.signInState),h=l(e=>e.tenantState.magicLinkSignInFetchState.fetchState),a=l(e=>e.tenantState.loggedInUser),o=l(e=>H(e)),b=l(e=>J(e)),E=r.getSignedInUser(),v=M().mode;g.useEffect(()=>{a?.zeniSessionId==null&&n!=null&&D(n,p)&&i!=null&&f!=null&&(r.saveMagicLinkTriggered(n),t(Q(n,i,f)))},[n,p,t,i,f,a?.zeniSessionId]),g.useEffect(()=>{S!=="In-Progress"||I!=="Completed"&&y!=="Completed"||a?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(a,a.zeniSessionId),r.saveSignedInUserTenants(B(b.tenantsInOrder),a.zeniSessionId),G(a.userId,a.zeniSessionId,o.tenantId),t(K(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(X("Completed")),V.updateAppLocaleID(ie(o)),se(a,o,v,void 0,b.tenantsInOrder),Y().then(()=>{const e=q();e!=null&&A(e)}),setTimeout(()=>{N.trackLogin(R.Event.loginSuccess,"email",Z(o.productSettings))},2e3))},[S,I,y,a,o,b,v,s.state,t]);const U=g.useCallback(()=>{m("/signin/auth")},[m]),j=g.useCallback(()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))},[i,d,t,c]),F=g.useCallback(e=>{i!=null&&n!=null&&c!=null&&d!=null&&t(te(e,i,c,d))},[i,n,t,c,d]);if(h==="Completed"&&d!=null)return u.jsx(W,{phoneNumber:x,verifyOtpFetchState:z.fetchState,resendVerifyDeviceOTPFetchState:C,onResendOtp:j,onVerifyOtp:F,onCancelVerifyDevice:U});if(S==="In-Progress"&&I==="Completed"&&a?.zeniSessionId!=null&&o!=null||E!=null){const e=s.state?.origin??"/";return u.jsx(T,{to:e,state:{...s.state,origin:""}})}if(!D(n,p)||f==null||h==="Error"){const e=s.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(T,{to:e,state:{...s.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||h==="Error"&&a?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx($,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
2
2
  position: fixed;
3
3
  top: 0;
4
4
  left: 0;
@@ -0,0 +1 @@
1
+ import{j as V}from"./liveblocks-6nZkQHFl.js";import{a as c}from"./sentry-Dr5FPm4d.js";import{h as be,g as s,l as Je,u as Ke,j as ea,i as P}from"./core-B8DAi0nh.js";import{eO as he,eV as aa,eW as Se,eQ as ta,bn as na,f3 as sa,eX as oa,eY as ia,e_ as ra,f1 as da,fb as la,f2 as g,f5 as ca,f6 as ue,f9 as ua,f7 as fa,f8 as ma,fa as pa,cI as ba,fd as ha,cO as Sa,bv as ga,eN as Ea,fi as ka,fj as Ca,fh as ya}from"./zeni-epic-state-DITtSXPQ.js";import{a3 as Ia,a4 as Ta,q as _a,y as wa,z as k,Z as Aa,a5 as Fa,Q as Da,s as va,u as $a,S as r,a6 as Ba,a7 as Ga,k as Ma,a as Pa,a8 as Ra,X as Na,a9 as Va,aa as Oa,ab as fe,ac as me,L as Ua,ad as xa,ae as pe,c as R,n as w,V as ja,af as N,ag as La}from"./index-cQHaeS6s.js";import{D as za}from"./mui-DOBONCVx.js";(function(){try{var m=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new m.Error().stack;d&&(m._sentryDebugIds=m._sentryDebugIds||{},m._sentryDebugIds[d]="ce87022a-74c0-474f-af97-fbed77a17503",m._sentryDebugIdIdentifier="sentry-dbid-ce87022a-74c0-474f-af97-fbed77a17503")}catch{}})();const Ya=Ia(({isAppContentDrawerOpen:m,handleDrawerToggle:d})=>{const{tenantEmailDomain:a}=Je(),t=Ke(),C=_a(),o=ea(),O=ta(),p=be(),{useFeatureGate:i}=wa(),U=k.getSignedInUser(),A=na(U),ge=Aa(),n=s(e=>he(e)),Ee=Fa(),ke=n.masterTOSInfo?.isMasterTOSAccepted??!1,{setIsAiCfoOpen:Ce}=Da(),x=s(e=>sa(e)),j=x.uiState.currentChatSessionId,y=va(),{setLoading:ye}=$a(),[F,L]=c.useState(void 0),D=P("/:tenantEmailDomain/dashboard")!==null,z=P("/:tenantEmailDomain/reports")!==null,I=P("/:tenantEmailDomain/onboarding/*")!==null,{isFeatureEnabled:Y}=i(r.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Ie}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:Z}=i(r.isDebitCardFeatureEnabled),Te=Ba(n,Ie,Z),{isFeatureEnabled:_e}=i(r.isSettingsFeatureEnabled),H=s(e=>oa(e)),{isFeatureEnabled:T}=i(r.isReferralFeatureEnabled),v=s(e=>ia(e));c.useEffect(()=>{y&&T&&!I&&v.fetchState==="Not-Started"&&p(ra(!0))},[y,T,v.fetchState,I]);const h=k.getSignedInUser(),$=s(e=>e.tenantState),we=s(e=>$.fetchState==="Completed"?da(e):[]),E=s(e=>e.expenseAutomationViewState.selectedPeriodByTenantId),{isFeatureEnabled:Ae}=i(r.isApAgingFeatureEnabled),{isFeatureEnabled:Fe}=i(r.isArAgingFeatureEnabled),{isFeatureEnabled:Q}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:W}=i(r.isExpenseAutomationEnabledV2),X=W||Q&&A,{isFeatureEnabled:De}=i(r.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:ve}=i(r.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:$e}=i(r.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:Be}=i(r.isDashboardSidebarNewYearAnimationEnabled),{isFeatureEnabled:Ge}=i(r.isTreasuryEnabled),{isFeatureEnabled:Me}=i(r.isTaskManagerCustomerUserAccessEnabled),Pe=A||!A&&Me,Re=n.company!=null&&la(n.company),_=Ge&&Re,Ne=s(e=>g(e).totalUnreadCount),Ve=s(e=>g(e).reducedFetchCountState),q=s(e=>g(e).notificationDetailsByTab.tasks.uiState.unreadCount),J=s(e=>g(e).notificationDetailsByTab.comments.uiState.unreadCount),Oe=s(e=>g(e).notificationDetailsByTab.tasks.fetchCountState),B=s(e=>g(e).notificationDetailsByTab.comments.fetchCountState),{inboxNotifications:K,isLoading:ee,isFetchingMore:ae,hasFetchedAll:te,fetchMore:Ue}=Ga();c.useEffect(()=>{const e=setTimeout(()=>Ue?.(),0);return()=>clearTimeout(e)}),c.useEffect(()=>{if(ee===!1&&ae===!1&&te===!0)if(n?.companyId!=null&&K!=null){const e=`dashboard_${n.companyId}`;L(K.filter(u=>u.roomId===e&&u.readAt==null).length)}else L(0)},[ee,ae,te]),c.useEffect(()=>{y&&!I&&Oe.fetchState==="Not-Started"&&O.tenantId!=null&&p(ca("task_manager","dashboard"))},[y,O.tenantId]),c.useEffect(()=>{I||B.fetchState!=="Not-Started"||p(ue({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),c.useEffect(()=>{F!=null&&B.fetchState==="In-Progress"&&(p(ue({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),p(Se({unreadCount:F},"comments")))},[F,B.fetchState]);const xe={fetchStatus:Ve,count:Ne},ne=a!=null?k.getSignedInUserTenant(a):null,se=s(e=>ne?.tenantId!=null?ua(e,ne.tenantId):void 0),S=[];Ae===!1&&S.push("accounts_payable_aging"),Fe===!1&&S.push("accounts_receivable_aging"),Y===!1&&S.push("zeni_accounts_promo_card"),T===!1&&S.push("rewards_card"),X===!1&&S.push("expense_automation_card");const je=Ma(),oe=s(e=>fa(e,S,h,W,Q,_).fetchState),ie=s(e=>ma(e).fetchState),Le=D&&(oe==="Completed"||oe==="Error")||z&&(ie==="Completed"||ie==="Error")||!D&&!z?void 0:"disabled",ze=c.useMemo(()=>pa(n.userRole),[n.userRole]),Ye=ba(ze),Ze=n?.rewardsLastViewedTime==null,He=h?.userEmail!=null&&H.fetchState==="Completed"&&ha(H.notificationSettings,h.userEmail,Z,n),re=Pa(),Qe=re&&Ra(t),de=Sa(je?.loggedInUserRoleMap),le=n.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,G=c.useCallback(()=>_&&de&&!k.getTreasuryPopupSeen(a??"")&&le===!1&&Na(t.pathname)!=="treasury",[_,de,le,t.pathname,a]),[We,ce]=c.useState(G);c.useEffect(()=>{ce(G())},[G]);const Xe=s(e=>e.treasurySetupViewState.treasuryFundsDetails).fundsDetails,qe=Va(Xe);return V.jsx(za,{container:window.document.body,variant:"temporary",open:m,onClose:()=>d(!1),PaperProps:{sx:{width:240,zIndex:8,borderRight:"none",backgroundImage:"none"}},ModalProps:{keepMounted:!0},children:V.jsx(Oa,{signedInUser:U,currentTenantId:$.currentTenantId??"",tenants:$.fetchState==="Completed"?we:se!=null?[se]:[],currentTenant:n,isTenantDropdownDisabled:Le,isSettings:me(t),isSettingsFeatureEnabled:_e,isVendorsTabVisible:Ye,isZeniAccountEnabled:Y,isChargeCardEnabled:Te,isTreasuryEnabled:_,treasuryYieldPercentage:qe,isTreasuryPopupVisible:We,isNotificationsTabVisible:He,notificationCountDetails:xe,isExpenseAutomationEnabledForUser:X&&ga(n.userRole)===!1,selectedMenu:fe(t),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:Ze,rewardsPlan:v.rewardsPlan},isAiCfoAccessEnabled:re,onNotificationIconClick:()=>{d(!1);let e=q===0&&J>0?"notifications/comments":"notifications/tasks";me(t)&&(e=q===0&&J>0?"../../notifications/comments":"../../notifications/tasks");const u=w(t.state?.pathnameStackToGoBack,t.pathname);o(e,{state:{pathnameStackToGoBack:u}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{d(!1);const e=w(t.state?.pathnameStackToGoBack,t.pathname);o("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMenuChange:e=>{if(d(!1),a==null)return;if(e.type==="ai_cfo"){const f=w(t.state?.pathnameStackToGoBack,t.pathname);return R.trackAICFOChatScreenStateChanged("viewed","left_menu",j??null,null),ke?void o(`/${a}/ai-cfo/explore`,{state:{pathnameStackToGoBack:f,referrer:"Sidebar"}}):void(ja(ge)?o(`/${a}/ai-cfo/explore`,{state:{pathnameStackToGoBack:f,referrer:"Sidebar"}}):Ee?Ce(!0):o(`/${a}/dashboard`,{state:{pathnameStackToGoBack:f,referrer:"Sidebar",message:"open_ai_cfo_drawer"}}))}const u=w(t.state?.pathnameStackToGoBack,t.pathname),l=e.type,b=N(l)&&l!=="command_center";if(N(e.type)&&E[n.tenantId]!=null&&R.trackMonthEndCloseClicked(E[n.tenantId].month,E[n.tenantId].year,"Sidebar"),b&&E[n.tenantId]!=null){const f=E[n.tenantId];return void o(`/${a}/month_end_close_checks/review/${e.type}/${f.month}-${f.year}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})}const M=La(e.type);pe(e.type)?(j!=null&&p(ya()),o(`/${a}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):o(`/${a}/${M}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})},handleMyProfileClick:()=>{d(!1),o(`/${a}/settings/my_profile`)},handleReferralsClick:()=>{d(!1),o(`/${a}/rewards`)},handleBackClick:()=>{o(`/${a}/dashboard`)},handleTenantSelect:e=>{ye(Ua.TENANT_SWITCHING),d(!1);const u=e.tenantEmailDomain,l=fe(t);let b=`/${encodeURIComponent(u)}/`;const M=N(l);l==="home"?b+="dashboard":l==="users_and_roles"?b+="people":xa(l)?b+="settings/my_profile":pe(l)?b+=`ai-cfo/${l}`:b+=l==="task_checklist"?"tasks":M?"month_end_close_checks/review":encodeURIComponent(l),o(b,{replace:!0}),h!=null&&(p(ka(e.tenantId)),p(Ca(h.userId,e.tenantId,h.zeniSessionId)));const f=e;R.trackCompanySwitch(f.companyId,f.companyName,f.userRole)},handlePopupClose:()=>{k.saveTreasuryPopupSeen(a??"",!0),ce(!1)},onZeniLogoClick:()=>{C.toggle()},isAiCfo:Qe,aiCfoView:x,isOnDashboard:D,updateCurrentChatSessionId:e=>{p(Ea({sessionId:e,agentId:"controller"})),o(`/${a}/ai-cfo/${e}`,{state:{...t.state}})},halloweenAnimationEnabled:De,isTaskManagerAccessEnabled:Pe,thanksGivingAnimationEnabled:ve,christmasAnimationEnabled:$e,newYearAnimationEnabled:Be})})}),Ja=m=>{const d=be(),a=s(C=>he(C)),t={events:a.userRoleId!=null?[`private-encrypted-${a.userRoleId}.dashboard-user-notification`]:[],eventCallback:(C,o)=>{Ta(o)&&aa(o.mode)==="dashboard"&&d(Se({unreadCount:o.data.unread},"tasks"))}};return V.jsx(Ya,{...m,...t})};export{Ja as M};
@@ -0,0 +1 @@
1
+ import{j as e}from"./liveblocks-6nZkQHFl.js";import{j as r,k as i}from"./core-B8DAi0nh.js";import{K as n}from"./index-cQHaeS6s.js";import"./mui-DOBONCVx.js";import"./sentry-Dr5FPm4d.js";import"./zeni-epic-state-DITtSXPQ.js";import"./recharts-CDgByeDS.js";import"./analytics-CLyVqw3m.js";import"./plaid-BJER8-rG.js";import"./dnd-DNrenqEc.js";import"./stripe-DMRn4zHo.js";import"./lottie-Cp94NU-O.js";import"./lexical-BbcB7U6u.js";import"./pdf-B9LwAnPJ.js";import"./utils-XBrV3QeH.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new o.Error().stack;t&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[t]="8be0e406-e338-494a-8e0a-372030582bac",o._sentryDebugIdIdentifier="sentry-dbid-8be0e406-e338-494a-8e0a-372030582bac")}catch{}})();const a=i(null,function(o,t){return{onGoBack:()=>{t.navigate(-1)},onGoHome:()=>{t.navigate("/")}}})(n);function h(){const o=r();return e.jsx(a,{navigate:o})}export{h as default};
@@ -1 +1 @@
1
- import{l as ct,a as dt,m as mt,j as _}from"./liveblocks-D41N0IlG.js";import lt from"./NotFoundScreen--NgVTkpE.js";import{a as k}from"./sentry-Bhr8KU--.js";import{j as ft,u as ut,l as ht,h as pt,g as S,k as kt,n as gt,o as X}from"./core-B86WF2Ww.js";import{cq as St,eX as Q,eO as H,fa as bt,f2 as b,Pj as K,f6 as m,eW as y,qA as $,vV as It,Pk as Ct,eV as Tt,fd as yt,qF as At,Pl as F,bq as M,gM as w,qJ as O,Pm as Et,cB as _t,cv as Nt}from"./zeni-epic-state-BLvcbIPk.js";import{R as Bt,z as xt,y as wt,S as Pt,cu as vt,n as N,a3 as Rt,cv as Dt,a4 as Ut,p as Gt}from"./index-CkmaHLOP.js";import"./mui-DZd7XaFW.js";import{u as Ft}from"./useAskAiCfoHostNavButtonProps-DRzMbg61.js";import{c as Mt}from"./useFetchSuggestedQuestionsWhenReady-dE_HTM0_.js";import"./recharts-BHLF4b4u.js";import"./analytics-CFOBCmx3.js";import"./plaid-CZm5yErz.js";import"./dnd-DrUSXn8k.js";import"./stripe-DMRn4zHo.js";import"./lottie-BHETr187.js";import"./lexical-COpm991f.js";import"./pdf-BdWka_4Q.js";import"./utils-Mvk27uIx.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new t.Error().stack;l&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[l]="e5d4ddbf-d761-4738-961a-23f50088734d",t._sentryDebugIdIdentifier="sentry-dbid-e5d4ddbf-d761-4738-961a-23f50088734d")}catch{}})();const $t=(t,l)=>new Promise((n,u)=>{const g=t.map(i=>new Promise(s=>{l(i),s()}));Promise.all(g).then(()=>{setTimeout(()=>{n()},2e3)}).catch(i=>{u(i)})}),jt=kt(function(t,l){const n=Q(t),{signedInUser:u,isDebitCardFeatureEnabled:g}=l,i=b(t),s=H(t),{currentTab:h}=i;return{notificationView:i,isNotificationSettingsVisible:u.userEmail!=null&&yt(n.notificationSettings,u.userEmail,g,s),isDisabled:i.notificationDetailsByTab[h].fetchState==="In-Progress"?"disabled":void 0}},function(t,l){const{location:n,tenantEmailDomain:u,loggedInUserRoleMap:g,externalNotificationsUnreadCount:i,allUnreadCommentsNotificationIds:s,navigate:h,markInboxNotificationAsRead:B,fetchMoreCommentsNotifications:P}=l;return{onNotificationClick:(a,o,d,c)=>{if(c==="task_deleted"){const r=`/${u}/tasks`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}else{const r=`/${u}/tasks/${o}`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}d==="unread"&&t(O("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,d)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){d==="unread"&&(B(a),t(F([a],M())));let r=`/${u}/${c[1]}`;const I=N(n.state?.pathnameStackToGoBack,n.pathname);c[1].startsWith("reimbursement")&&!_t(g)&&(r="not-found"),c[1].startsWith("bill")&&!Nt(g)&&(r="not-found"),h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(a,o)=>{t(y(a,o))},onUpdateNotificationTabState:(a,o)=>{t(m(a,o))},onUpdateNotificationViewCurrentTabAndSubTab:(a,o)=>{t(K(a,o));const d=`../${a}`,c=N(n.state?.pathnameStackToGoBack,n.pathname);h(d,{state:{pathnameStackToGoBack:c}})},onUpdateNotificationViewSubTab:a=>{t(Et(a))},onFetchMoreNotifications:(a,o)=>{if(a==="tasks"){const d=[];o==="all"?d.push("read","unread"):o!=="mentions"&&d.push(o),t($("task_manager","dashboard",d))}else P?.()},onUpdateNotificationStatus:(a,o,d,c)=>{a==="tasks"?t(O("task_manager",d,c)):(t(m({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(c.map(r=>{d==="read"&&(B(r),t(F([r],M())))})).then(()=>{t(m({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(y({unreadCount:i-c.length>0?i-c.length:0},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))},r=>{t(m({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}).catch(r=>{t(m({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onMarkAllNotificationsAsRead:a=>{a==="tasks"?t(At("task_manager","read")):(t(m({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),$t(s,B).then(()=>{t(F(s,M())),t(m({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(y({unreadCount:0},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}).catch(o=>{t(m({markAsAllReadState:{fetchState:"Error",error:o}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onBackClick:()=>{const a=Gt(n.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";h(o,{state:{pathnameStackToGoBack:a.newStack}})},onSettingsClick:()=>{const a=N(n.state?.pathnameStackToGoBack,n.pathname);h("../../settings/notifications",{state:{pathnameStackToGoBack:a}})}}})(Rt(Dt)),Vt=()=>{const t=ft(),l=ut(),{tenantEmailDomain:n,selectedTab:u}=ht(),{areTenantIdsInSync:g}=Bt(),i=St(u??""),s=pt(),h=xt.getSignedInUser(),[B,P]=k.useState(!1),a=S(e=>Q(e)),o=S(e=>H(e)),{useFeatureGate:d}=wt(),{isFeatureEnabled:c}=d(Pt.isDebitCardFeatureEnabled),{isAiCfoAccessEnabled:r,onAskAiCfoClick:I}=Ft({mobileExploreReferrer:"Notifications"});Mt({isDataReady:!0});const Y=bt(o.userRole);if(o==null||n==null||o.companyId==null)throw Error("Can't access notifications page without current tenant...");if(h==null)throw Error("Can't access notifications page without signed in...");const j=S(e=>b(e).notificationDetailsByTab.tasks.fetchState),V=S(e=>b(e).currentTab),v=S(e=>b(e).currentSubTab),Z=S(e=>b(e).notificationDetailsByTab.comments.fetchCountState),R=S(e=>b(e).notificationDetailsByTab.comments.fetchState),tt=S(e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount),et=S(e=>b(e).allExternalNotifications).filter(e=>e.inboxNotification.readAt==null).map(e=>e.inboxNotification.id),at=vt().allUsers,{inboxNotifications:x,isLoading:A,hasFetchedAll:C,isFetchingMore:D,fetchMore:ot}=ct(),{threads:q,isLoading:W,fetchMore:z,isFetchingMore:J,hasFetchedAll:L}=dt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect(()=>{if(V!==i&&i!=null&&s(K(i)),i==null){const e=`../${V}`,p=N(l.state?.pathnameStackToGoBack,l.pathname);t(e,{state:{pathnameStackToGoBack:p}})}},[i]),k.useEffect(()=>{Z.fetchState==="Not-Started"&&s(m({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),k.useEffect(()=>{if(A===!1&&C===!0&&o?.companyId!=null&&x!=null){const e=`dashboard_${o.companyId}`,p=x.filter(T=>T.roomId===e&&T.readAt==null).length;s(m({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),s(y({unreadCount:p},"comments"))}},[A,C]),k.useEffect(()=>{j!=="In-Progress"&&g&&s($("task_manager","dashboard",["read","unread"]))},[g]),k.useEffect(()=>{const e=setTimeout(()=>ot?.(),0);return()=>clearTimeout(e)});const U=A||D===!0||C!==!0||A||D===!0||C!==!0;k.useEffect(()=>{U&&R!=="In-Progress"?s(m({fetchState:"In-Progress",error:void 0},"comments")):U||R!=="In-Progress"||s(m({fetchState:"Completed",error:void 0},"comments"))},[U,R]),k.useEffect(()=>{s(y({hasMore:C!==!0},"comments"))},[C]),k.useEffect(()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&B===!1&&(P(!0),s(It()))},[a.fetchState]),k.useEffect(()=>{if(A===!1&&W===!1&&x!=null&&q!=null){const e=`dashboard_${o.companyId}`,p=x.filter(f=>f.roomId===e).filter(f=>f.kind==="thread"),T=p.filter(f=>f.readAt==null),E=p.map(f=>f.id),it=p.map(f=>{const G=q.find(rt=>rt.id===f.threadId);return G!=null?{inboxNotification:{...f,threadId:G.id},thread:G}:(J||L===!0||z==null||z(),null)}).filter(f=>f!=null);s(m({allNotificationsIds:E},"comments")),s(y({totalCount:E.length,unreadCount:T.length},"comments")),s(Ct(it))}},[A,D,J,C,L,W,x?.length]);const st={events:o.userRoleId!=null?[`private-encrypted-${o.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if(Ut(p)){const T=Tt(p.mode);if(T==="dashboard"&&s(y({unreadCount:p.data.unread},"tasks")),j!=="In-Progress"){const E=[];v==="all"?E.push("read","unread"):v!=="mentions"&&E.push(v),s($("task_manager",T,E,!0))}}}},nt=mt();return _.jsx(jt,{tenantEmailDomain:n,loggedInUserRoleMap:Y,signedInUser:h,externalNotificationsUnreadCount:tt,location:l,navigate:t,isDebitCardFeatureEnabled:c,users:at,markInboxNotificationAsRead:nt,allUnreadCommentsNotificationIds:et,isAiCfoAccessEnabled:r,onAskAiCfoClick:I,...st})};function ie(){return _.jsxs(gt,{children:[_.jsx(X,{path:"/:selectedTab",element:_.jsx(Vt,{})}),_.jsx(X,{path:"*",element:_.jsx(lt,{})})]})}export{ie as default};
1
+ import{l as ct,a as mt,m as dt,j as _}from"./liveblocks-6nZkQHFl.js";import lt from"./NotFoundScreen-C17gldyA.js";import{a as k}from"./sentry-Dr5FPm4d.js";import{j as ft,u as ut,l as ht,h as pt,g as S,k as kt,n as gt,o as X}from"./core-B8DAi0nh.js";import{cq as St,eX as Q,eO as H,fa as bt,f2 as b,Pj as K,f6 as d,eW as y,qA as $,vV as It,Pk as Ct,eV as Tt,fd as yt,qF as At,Pl as F,bq as M,gM as w,qJ as O,Pm as Et,cB as _t,cv as Nt}from"./zeni-epic-state-DITtSXPQ.js";import{R as Bt,z as xt,y as wt,S as Pt,ct as Rt,n as N,a3 as vt,cu as Dt,a4 as Ut,p as Gt}from"./index-cQHaeS6s.js";import"./mui-DOBONCVx.js";import{u as Ft}from"./useAskAiCfoHostNavButtonProps-D-63GR-J.js";import{c as Mt}from"./useFetchSuggestedQuestionsWhenReady-Cq8Wv1kQ.js";import"./recharts-CDgByeDS.js";import"./analytics-CLyVqw3m.js";import"./plaid-BJER8-rG.js";import"./dnd-DNrenqEc.js";import"./stripe-DMRn4zHo.js";import"./lottie-Cp94NU-O.js";import"./lexical-BbcB7U6u.js";import"./pdf-B9LwAnPJ.js";import"./utils-XBrV3QeH.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new t.Error().stack;l&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[l]="0a19d9b3-ca66-4327-961d-b018a233035f",t._sentryDebugIdIdentifier="sentry-dbid-0a19d9b3-ca66-4327-961d-b018a233035f")}catch{}})();const $t=(t,l)=>new Promise((n,u)=>{const g=t.map(i=>new Promise(s=>{l(i),s()}));Promise.all(g).then(()=>{setTimeout(()=>{n()},2e3)}).catch(i=>{u(i)})}),jt=kt(function(t,l){const n=Q(t),{signedInUser:u,isDebitCardFeatureEnabled:g}=l,i=b(t),s=H(t),{currentTab:h}=i;return{notificationView:i,isNotificationSettingsVisible:u.userEmail!=null&&yt(n.notificationSettings,u.userEmail,g,s),isDisabled:i.notificationDetailsByTab[h].fetchState==="In-Progress"?"disabled":void 0}},function(t,l){const{location:n,tenantEmailDomain:u,loggedInUserRoleMap:g,externalNotificationsUnreadCount:i,allUnreadCommentsNotificationIds:s,navigate:h,markInboxNotificationAsRead:B,fetchMoreCommentsNotifications:P}=l;return{onNotificationClick:(a,o,m,c)=>{if(c==="task_deleted"){const r=`/${u}/tasks`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}else{const r=`/${u}/tasks/${o}`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}m==="unread"&&t(O("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,m)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){m==="unread"&&(B(a),t(F([a],M())));let r=`/${u}/${c[1]}`;const I=N(n.state?.pathnameStackToGoBack,n.pathname);c[1].startsWith("reimbursement")&&!_t(g)&&(r="not-found"),c[1].startsWith("bill")&&!Nt(g)&&(r="not-found"),h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(a,o)=>{t(y(a,o))},onUpdateNotificationTabState:(a,o)=>{t(d(a,o))},onUpdateNotificationViewCurrentTabAndSubTab:(a,o)=>{t(K(a,o));const m=`../${a}`,c=N(n.state?.pathnameStackToGoBack,n.pathname);h(m,{state:{pathnameStackToGoBack:c}})},onUpdateNotificationViewSubTab:a=>{t(Et(a))},onFetchMoreNotifications:(a,o)=>{if(a==="tasks"){const m=[];o==="all"?m.push("read","unread"):o!=="mentions"&&m.push(o),t($("task_manager","dashboard",m))}else P?.()},onUpdateNotificationStatus:(a,o,m,c)=>{a==="tasks"?t(O("task_manager",m,c)):(t(d({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(c.map(r=>{m==="read"&&(B(r),t(F([r],M())))})).then(()=>{t(d({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(y({unreadCount:i-c.length>0?i-c.length:0},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))},r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}).catch(r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onMarkAllNotificationsAsRead:a=>{a==="tasks"?t(At("task_manager","read")):(t(d({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),$t(s,B).then(()=>{t(F(s,M())),t(d({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(y({unreadCount:0},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}).catch(o=>{t(d({markAsAllReadState:{fetchState:"Error",error:o}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onBackClick:()=>{const a=Gt(n.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";h(o,{state:{pathnameStackToGoBack:a.newStack}})},onSettingsClick:()=>{const a=N(n.state?.pathnameStackToGoBack,n.pathname);h("../../settings/notifications",{state:{pathnameStackToGoBack:a}})}}})(vt(Dt)),Vt=()=>{const t=ft(),l=ut(),{tenantEmailDomain:n,selectedTab:u}=ht(),{areTenantIdsInSync:g}=Bt(),i=St(u??""),s=pt(),h=xt.getSignedInUser(),[B,P]=k.useState(!1),a=S(e=>Q(e)),o=S(e=>H(e)),{useFeatureGate:m}=wt(),{isFeatureEnabled:c}=m(Pt.isDebitCardFeatureEnabled),{isAiCfoAccessEnabled:r,onAskAiCfoClick:I}=Ft({mobileExploreReferrer:"Notifications"});Mt({isDataReady:!0});const Y=bt(o.userRole);if(o==null||n==null||o.companyId==null)throw Error("Can't access notifications page without current tenant...");if(h==null)throw Error("Can't access notifications page without signed in...");const j=S(e=>b(e).notificationDetailsByTab.tasks.fetchState),V=S(e=>b(e).currentTab),R=S(e=>b(e).currentSubTab),Z=S(e=>b(e).notificationDetailsByTab.comments.fetchCountState),v=S(e=>b(e).notificationDetailsByTab.comments.fetchState),tt=S(e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount),et=S(e=>b(e).allExternalNotifications).filter(e=>e.inboxNotification.readAt==null).map(e=>e.inboxNotification.id),at=Rt().allUsers,{inboxNotifications:x,isLoading:A,hasFetchedAll:C,isFetchingMore:D,fetchMore:ot}=ct(),{threads:q,isLoading:W,fetchMore:z,isFetchingMore:J,hasFetchedAll:L}=mt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect(()=>{if(V!==i&&i!=null&&s(K(i)),i==null){const e=`../${V}`,p=N(l.state?.pathnameStackToGoBack,l.pathname);t(e,{state:{pathnameStackToGoBack:p}})}},[i]),k.useEffect(()=>{Z.fetchState==="Not-Started"&&s(d({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),k.useEffect(()=>{if(A===!1&&C===!0&&o?.companyId!=null&&x!=null){const e=`dashboard_${o.companyId}`,p=x.filter(T=>T.roomId===e&&T.readAt==null).length;s(d({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),s(y({unreadCount:p},"comments"))}},[A,C]),k.useEffect(()=>{j!=="In-Progress"&&g&&s($("task_manager","dashboard",["read","unread"]))},[g]),k.useEffect(()=>{const e=setTimeout(()=>ot?.(),0);return()=>clearTimeout(e)});const U=A||D===!0||C!==!0||A||D===!0||C!==!0;k.useEffect(()=>{U&&v!=="In-Progress"?s(d({fetchState:"In-Progress",error:void 0},"comments")):U||v!=="In-Progress"||s(d({fetchState:"Completed",error:void 0},"comments"))},[U,v]),k.useEffect(()=>{s(y({hasMore:C!==!0},"comments"))},[C]),k.useEffect(()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&B===!1&&(P(!0),s(It()))},[a.fetchState]),k.useEffect(()=>{if(A===!1&&W===!1&&x!=null&&q!=null){const e=`dashboard_${o.companyId}`,p=x.filter(f=>f.roomId===e).filter(f=>f.kind==="thread"),T=p.filter(f=>f.readAt==null),E=p.map(f=>f.id),it=p.map(f=>{const G=q.find(rt=>rt.id===f.threadId);return G!=null?{inboxNotification:{...f,threadId:G.id},thread:G}:(J||L===!0||z==null||z(),null)}).filter(f=>f!=null);s(d({allNotificationsIds:E},"comments")),s(y({totalCount:E.length,unreadCount:T.length},"comments")),s(Ct(it))}},[A,D,J,C,L,W,x?.length]);const st={events:o.userRoleId!=null?[`private-encrypted-${o.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if(Ut(p)){const T=Tt(p.mode);if(T==="dashboard"&&s(y({unreadCount:p.data.unread},"tasks")),j!=="In-Progress"){const E=[];R==="all"?E.push("read","unread"):R!=="mentions"&&E.push(R),s($("task_manager",T,E,!0))}}}},nt=dt();return _.jsx(jt,{tenantEmailDomain:n,loggedInUserRoleMap:Y,signedInUser:h,externalNotificationsUnreadCount:tt,location:l,navigate:t,isDebitCardFeatureEnabled:c,users:at,markInboxNotificationAsRead:nt,allUnreadCommentsNotificationIds:et,isAiCfoAccessEnabled:r,onAskAiCfoClick:I,...st})};function ie(){return _.jsxs(gt,{children:[_.jsx(X,{path:"/:selectedTab",element:_.jsx(Vt,{})}),_.jsx(X,{path:"*",element:_.jsx(lt,{})})]})}export{ie as default};
@@ -1 +1 @@
1
- import{j as f}from"./liveblocks-D41N0IlG.js";import{a as r}from"./sentry-Bhr8KU--.js";import{h as A,u as C,g as o,N as J}from"./core-B86WF2Ww.js";import{Jd as P,eO as j,f1 as x,Je as z,Jf as D,Jg as M,Jh as R,mv as k,I9 as L}from"./zeni-epic-state-BLvcbIPk.js";import{z as h,_ as I}from"./index-CkmaHLOP.js";import"./mui-DZd7XaFW.js";import"./recharts-BHLF4b4u.js";import"./analytics-CFOBCmx3.js";import"./plaid-CZm5yErz.js";import"./dnd-DrUSXn8k.js";import"./stripe-DMRn4zHo.js";import"./lottie-BHETr187.js";import"./lexical-COpm991f.js";import"./pdf-BdWka_4Q.js";import"./utils-Mvk27uIx.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new n.Error().stack;s&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[s]="8a1b9db3-7dc9-47e5-8731-014891e22a78",n._sentryDebugIdIdentifier="sentry-dbid-8a1b9db3-7dc9-47e5-8731-014891e22a78")}catch{}})();function ee(){const n=A(),s=C(),{params:t,error:i}=r.useMemo(()=>P(s.search),[s.search]),w=r.useMemo(()=>new URLSearchParams(s.search).get("client_name")??t?.clientId??"Unknown Application",[s.search,t]),p=h.isSignedIn(),a=h.getSignedInUser(),m=o(e=>j(e)),l=o(e=>x(e)),d=o(e=>e.tenantState.fetchState),y=o(z),b=o(D),u=o(M),[v,S]=r.useState(null),[E,_]=r.useState(null);r.useEffect(()=>{document.querySelector("#app-shell-loader")?.remove()},[]),r.useEffect(()=>()=>{n(R())},[n,s.search]),r.useEffect(()=>{i!=null&&console.warn("[OAuthConsent] invalid params:",i)},[i]);const g=r.useRef(!1);r.useEffect(()=>{p&&a!=null&&!g.current&&(d!=="Not-Started"&&d!=="Error"||(g.current=!0,n(k(a.userId,a.zeniSessionId??void 0))))},[p,a,d,n]),r.useEffect(()=>{u!=null&&u!==""&&(window.location.href=u)},[u]);const U=r.useMemo(()=>{if(m?.tenantId!=null)return m.tenantId;const e=h.getActiveTenantForUser()?.tenantId;return e!=null&&l.some(T=>T.tenantId===e)?e:l.length===1?l[0].tenantId:null},[m?.tenantId,l]),c=v??U;return i!=null?f.jsx(I,{variant:"invalid_params",paramsError:i}):p?f.jsx(I,{variant:"signed_in",clientName:w,userEmail:a?.userEmail,isInitializing:d!=="Completed",tenants:l,selectedTenantId:c,onSelectTenant:S,approveError:E??b,isApproving:y==="In-Progress",showAllowButton:c!=null,onApprove:()=>{t!=null&&a!=null&&c!=null&&n(L(a.userId,a.zeniSessionId??void 0,c,t.clientId,t.redirectUri,t.codeChallenge,t.codeChallengeMethod,t.state,t.responseType))},onDeny:()=>{if(t!=null)try{const e=new URL(t.redirectUri);e.searchParams.set("error","access_denied"),e.searchParams.set("error_description","The user denied the request"),e.searchParams.set("state",t.state),window.location.href=e.toString()}catch{_("Unable to deny: redirect_uri is not a valid URL. Close this window or contact support.")}}}):f.jsx(J,{to:"/signin/auth",state:{origin:s.pathname+s.search},replace:!0})}export{ee as default};
1
+ import{j as f}from"./liveblocks-6nZkQHFl.js";import{a as r}from"./sentry-Dr5FPm4d.js";import{h as A,u as C,g as o,N as J}from"./core-B8DAi0nh.js";import{Jd as P,eO as j,f1 as x,Je as z,Jf as D,Jg as M,Jh as R,mv as k,I9 as L}from"./zeni-epic-state-DITtSXPQ.js";import{z as h,_ as I}from"./index-cQHaeS6s.js";import"./mui-DOBONCVx.js";import"./recharts-CDgByeDS.js";import"./analytics-CLyVqw3m.js";import"./plaid-BJER8-rG.js";import"./dnd-DNrenqEc.js";import"./stripe-DMRn4zHo.js";import"./lottie-Cp94NU-O.js";import"./lexical-BbcB7U6u.js";import"./pdf-B9LwAnPJ.js";import"./utils-XBrV3QeH.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new n.Error().stack;s&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[s]="8a1b9db3-7dc9-47e5-8731-014891e22a78",n._sentryDebugIdIdentifier="sentry-dbid-8a1b9db3-7dc9-47e5-8731-014891e22a78")}catch{}})();function ee(){const n=A(),s=C(),{params:t,error:i}=r.useMemo(()=>P(s.search),[s.search]),w=r.useMemo(()=>new URLSearchParams(s.search).get("client_name")??t?.clientId??"Unknown Application",[s.search,t]),p=h.isSignedIn(),a=h.getSignedInUser(),m=o(e=>j(e)),l=o(e=>x(e)),d=o(e=>e.tenantState.fetchState),y=o(z),b=o(D),u=o(M),[v,S]=r.useState(null),[E,_]=r.useState(null);r.useEffect(()=>{document.querySelector("#app-shell-loader")?.remove()},[]),r.useEffect(()=>()=>{n(R())},[n,s.search]),r.useEffect(()=>{i!=null&&console.warn("[OAuthConsent] invalid params:",i)},[i]);const g=r.useRef(!1);r.useEffect(()=>{p&&a!=null&&!g.current&&(d!=="Not-Started"&&d!=="Error"||(g.current=!0,n(k(a.userId,a.zeniSessionId??void 0))))},[p,a,d,n]),r.useEffect(()=>{u!=null&&u!==""&&(window.location.href=u)},[u]);const U=r.useMemo(()=>{if(m?.tenantId!=null)return m.tenantId;const e=h.getActiveTenantForUser()?.tenantId;return e!=null&&l.some(T=>T.tenantId===e)?e:l.length===1?l[0].tenantId:null},[m?.tenantId,l]),c=v??U;return i!=null?f.jsx(I,{variant:"invalid_params",paramsError:i}):p?f.jsx(I,{variant:"signed_in",clientName:w,userEmail:a?.userEmail,isInitializing:d!=="Completed",tenants:l,selectedTenantId:c,onSelectTenant:S,approveError:E??b,isApproving:y==="In-Progress",showAllowButton:c!=null,onApprove:()=>{t!=null&&a!=null&&c!=null&&n(L(a.userId,a.zeniSessionId??void 0,c,t.clientId,t.redirectUri,t.codeChallenge,t.codeChallengeMethod,t.state,t.responseType))},onDeny:()=>{if(t!=null)try{const e=new URL(t.redirectUri);e.searchParams.set("error","access_denied"),e.searchParams.set("error_description","The user denied the request"),e.searchParams.set("state",t.state),window.location.href=e.toString()}catch{_("Unable to deny: redirect_uri is not a valid URL. Close this window or contact support.")}}}):f.jsx(J,{to:"/signin/auth",state:{origin:s.pathname+s.search},replace:!0})}export{ee as default};
@@ -1 +1 @@
1
- import{j as n}from"./liveblocks-D41N0IlG.js";import{j as W,h as z,u as Z,l as H,g as d,k as K,n as Q,o as I}from"./core-B86WF2Ww.js";import{eO as P,qo as R,pY as X,JM as v,pT as C,bv as ee,bn as ae,bS as te,pU as se,JN as oe,Jy as S,dC as re,tS as ne,JO as ce,ud as ie,eU as le,eS as de}from"./zeni-epic-state-BLvcbIPk.js";import{z as me,R as fe,k as pe,y as M,S as w,w as ue,c as $,al as he,n as be}from"./index-CkmaHLOP.js";import"./mui-DZd7XaFW.js";import ge from"./NotFoundScreen--NgVTkpE.js";import{F as Fe}from"./FeaturePreviewScreen-B_upIV_z.js";import{a as b}from"./sentry-Bhr8KU--.js";import{u as Ie}from"./useAskAiCfoHostNavButtonProps-DRzMbg61.js";import{c as Se}from"./useFetchSuggestedQuestionsWhenReady-dE_HTM0_.js";import{u as Ce}from"./useInitialThreadRequest-DlZM3Hgb.js";import{t as ye}from"./routePaths-C8NVJkmp.js";import{M as Te}from"./MobileAppDrawer-BF7-1gg_.js";import"./recharts-BHLF4b4u.js";import"./analytics-CFOBCmx3.js";import"./plaid-CZm5yErz.js";import"./dnd-DrUSXn8k.js";import"./stripe-DMRn4zHo.js";import"./lottie-BHETr187.js";import"./lexical-COpm991f.js";import"./pdf-BdWka_4Q.js";import"./utils-Mvk27uIx.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new s.Error().stack;e&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[e]="1da29e30-3809-4db3-bcbd-7e2c56f859b5",s._sentryDebugIdIdentifier="sentry-dbid-1da29e30-3809-4db3-bcbd-7e2c56f859b5")}catch{}})();const y=(s,e,a,o)=>{if(s!=e){const r=o??"";s!=null&&s.length>0?a(`../${e}${r}`,{replace:!0}):a(`${e}${r}`,{replace:!0})}},ke=K(function(s){const e=oe(s),a={},o=e.pandLReportWithForecast.uiState.nodeCollapseState;return Object.keys(o).forEach(r=>{a[r]=o[r]===!1}),{selectedTimeframe:e.selectedTimeframe,isForecastVsActualOn:e.isForecastVsActualOn,compareMode:e.compareMode,forecastList:e.forecastList,selectedForecast:e.selectedForecast,pandLreport:e.pandLReportWithForecast,scrollPosition:e.pandLReportWithForecast.uiState.scrollPosition,nodeOpenStatus:a,type:"name+balances_forecast",analytics:$}},function(s,e){return{onForecastSelectionChanged:(a,o)=>{s(v(a,o)),e.isPandLReportFetched(a)||s(C(a)),y(e.forecastIdFromUrlPath,a,e.navigate)},onTimeframeChanged:a=>{s(ie(a))},onForecastVsActualsCompareToggle:a=>{s(ce(a)),s(S({forecastId:e.forecastIdFromUrlPath,scrollPosition:{scrollLeft:0,scrollTop:0}}))},onCompareModeChanged:a=>{s(ne(e.firstMonthOfFY,a,0,[]))},onAccountBalanceClick:e.hasTransactionAccess!==!0?void 0:(a,o)=>{let r,c;const p=a.accountName===""?a.accountDescription:a.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(r=o.balanceTimeFrame,c=re(o)):o.balanceTimeFrame==="year"?(r="quarter",c={startDate:o.endDate.startOf("quarter"),endDate:o.endDate}):console.error(`timeframe ${o.balanceTimeFrame} is not supported`),c!=null&&r!=null){const m=ye(e.tenantEmailDomain,a.accountId,a.accountType,p,r,c),u=be(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(m,{state:{pathnameStackToGoBack:u,referrer:"Forecast"}})}},onNodeCollapseToggled:(a,o)=>{s(S({forecastId:e.forecastIdFromUrlPath,nodeCollapseState:{nodeId:a,isCollapsed:o===!1}}))},onTableScroll:a=>{s(S({forecastId:e.forecastIdFromUrlPath,scrollPosition:a}))},onBackClick:()=>{e.navigate("../../")}}})(he);function U(){const s=W(),e=z(),a=Z(),{forecastId:o,tenantEmailDomain:r}=H(),[c,p]=b.useState(!1),[m,u]=b.useState(!1),h=me.getSignedInUser(),T=d(t=>P(t)),N=T.company?.companyInfo.firstMonthOfFY??1,i=d(t=>R(t.forecastState,t.forecastListState)),l=d(t=>t.forecastListState.fetchState==="Completed"),k=d(t=>t.profitAndLossState),A=d(t=>t.reportUIOptionsState.selectedForecast),x=t=>k.pandLByForecastID[t]!=null&&se(t,k).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:g}=fe();Se({isDataReady:l});const{isAiCfoAccessEnabled:q,onAskAiCfoClick:B}=Ie({mobileExploreReferrer:"Forecast"});b.useEffect(()=>{if(!c&&g)p(!0),l||e(X());else if(l&&!m){u(!0);const t=((f,L,O)=>L!=null?f.forecasts.findIndex(F=>F.id===L):O!=null?f.forecasts.findIndex(F=>F.id===O):f.forecasts.length>0?0:-1)(i,o,A?.id);t===-1&&o!=null?s("page-not-found",{replace:!0}):t!==-1&&t!=A?.index?(e(v(i.forecasts[t].id,t)),y(o,i.forecasts[t].id,s,a.search)):o==null&&t!==-1&&y(void 0,i.forecasts[t].id,s,a.search),t!==-1&&!x(i.forecasts[t].id)&&g&&e(C(i.forecasts[t].id))}},[c,p,e,l,i,m,u,R,C,g]);const D=pe(),Y=D?.loggedInUserRole!=null&&ee(D.loggedInUserRole),{useFeatureGate:_}=M(),{isFeatureEnabled:j}=_(w.isReportsCommentingEnabled),G=Ce(j?T?.companyId:void 0,{clearParams:l&&m}),[J,V]=b.useState(!1),E=t=>{V(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(ue,{analytics:$,onLoad:t=>(f=>f.trackForecast())(t)}):null,n.jsx(Te,{isAppContentDrawerOpen:J,handleDrawerToggle:E}),n.jsx(ke,{firstMonthOfFY:N,tenantEmailDomain:r,forecastIdFromUrlPath:o,navigate:s,location:a,isPandLReportFetched:x,meetingUrl:te(`https://meetings.hubspot.com/svitlana-grankovska?firstname=${h?.firstName}&lastname=${h?.lastName}&email=${h?.userEmail}`),hasTransactionAccess:Y,isAiCfoAccessEnabled:q,onAskAiCfoClick:B,isReportsCommentingEnabled:j,isZeniUser:ae(h),initialOpenThreadRequest:G,onClickMenuIcon:()=>{E(!0)}})]})}function We(){const s=d(c=>P(c)),{useFeatureGate:e}=M(),{isFeatureEnabled:a}=e(w.isDebitCardFeatureEnabled),o=le(a,s),r=de(s);return o===!0||r===!0?n.jsx(Fe,{}):n.jsxs(Q,{children:[n.jsx(I,{path:"/",element:n.jsx(U,{})}),n.jsx(I,{path:"/:forecastId",element:n.jsx(U,{})}),n.jsx(I,{path:"/:forecastId/*",element:n.jsx(ge,{})})]})}export{We as PandLWithForecastRoutes,We as default};
1
+ import{j as n}from"./liveblocks-6nZkQHFl.js";import{j as W,h as z,u as Z,l as H,g as d,k as K,n as Q,o as I}from"./core-B8DAi0nh.js";import{eO as P,qo as R,pY as X,JM as v,pT as C,bv as ee,bn as ae,bS as te,pU as se,JN as oe,Jy as S,dC as re,tS as ne,JO as ce,ud as ie,eU as le,eS as de}from"./zeni-epic-state-DITtSXPQ.js";import{z as me,R as fe,k as pe,y as M,S as w,w as ue,c as $,al as he,n as be}from"./index-cQHaeS6s.js";import"./mui-DOBONCVx.js";import ge from"./NotFoundScreen-C17gldyA.js";import{F as Fe}from"./FeaturePreviewScreen-BDJyKHVm.js";import{a as b}from"./sentry-Dr5FPm4d.js";import{u as Ie}from"./useAskAiCfoHostNavButtonProps-D-63GR-J.js";import{c as Se}from"./useFetchSuggestedQuestionsWhenReady-Cq8Wv1kQ.js";import{u as Ce}from"./useInitialThreadRequest-NWqhrnxo.js";import{t as ye}from"./routePaths-CHt7s04E.js";import{M as Te}from"./MobileAppDrawer-G8G6Y9KP.js";import"./recharts-CDgByeDS.js";import"./analytics-CLyVqw3m.js";import"./plaid-BJER8-rG.js";import"./dnd-DNrenqEc.js";import"./stripe-DMRn4zHo.js";import"./lottie-Cp94NU-O.js";import"./lexical-BbcB7U6u.js";import"./pdf-B9LwAnPJ.js";import"./utils-XBrV3QeH.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new s.Error().stack;e&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[e]="1da29e30-3809-4db3-bcbd-7e2c56f859b5",s._sentryDebugIdIdentifier="sentry-dbid-1da29e30-3809-4db3-bcbd-7e2c56f859b5")}catch{}})();const y=(s,e,a,o)=>{if(s!=e){const r=o??"";s!=null&&s.length>0?a(`../${e}${r}`,{replace:!0}):a(`${e}${r}`,{replace:!0})}},ke=K(function(s){const e=oe(s),a={},o=e.pandLReportWithForecast.uiState.nodeCollapseState;return Object.keys(o).forEach(r=>{a[r]=o[r]===!1}),{selectedTimeframe:e.selectedTimeframe,isForecastVsActualOn:e.isForecastVsActualOn,compareMode:e.compareMode,forecastList:e.forecastList,selectedForecast:e.selectedForecast,pandLreport:e.pandLReportWithForecast,scrollPosition:e.pandLReportWithForecast.uiState.scrollPosition,nodeOpenStatus:a,type:"name+balances_forecast",analytics:$}},function(s,e){return{onForecastSelectionChanged:(a,o)=>{s(v(a,o)),e.isPandLReportFetched(a)||s(C(a)),y(e.forecastIdFromUrlPath,a,e.navigate)},onTimeframeChanged:a=>{s(ie(a))},onForecastVsActualsCompareToggle:a=>{s(ce(a)),s(S({forecastId:e.forecastIdFromUrlPath,scrollPosition:{scrollLeft:0,scrollTop:0}}))},onCompareModeChanged:a=>{s(ne(e.firstMonthOfFY,a,0,[]))},onAccountBalanceClick:e.hasTransactionAccess!==!0?void 0:(a,o)=>{let r,c;const p=a.accountName===""?a.accountDescription:a.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(r=o.balanceTimeFrame,c=re(o)):o.balanceTimeFrame==="year"?(r="quarter",c={startDate:o.endDate.startOf("quarter"),endDate:o.endDate}):console.error(`timeframe ${o.balanceTimeFrame} is not supported`),c!=null&&r!=null){const m=ye(e.tenantEmailDomain,a.accountId,a.accountType,p,r,c),u=be(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(m,{state:{pathnameStackToGoBack:u,referrer:"Forecast"}})}},onNodeCollapseToggled:(a,o)=>{s(S({forecastId:e.forecastIdFromUrlPath,nodeCollapseState:{nodeId:a,isCollapsed:o===!1}}))},onTableScroll:a=>{s(S({forecastId:e.forecastIdFromUrlPath,scrollPosition:a}))},onBackClick:()=>{e.navigate("../../")}}})(he);function U(){const s=W(),e=z(),a=Z(),{forecastId:o,tenantEmailDomain:r}=H(),[c,p]=b.useState(!1),[m,u]=b.useState(!1),h=me.getSignedInUser(),T=d(t=>P(t)),N=T.company?.companyInfo.firstMonthOfFY??1,i=d(t=>R(t.forecastState,t.forecastListState)),l=d(t=>t.forecastListState.fetchState==="Completed"),k=d(t=>t.profitAndLossState),A=d(t=>t.reportUIOptionsState.selectedForecast),x=t=>k.pandLByForecastID[t]!=null&&se(t,k).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:g}=fe();Se({isDataReady:l});const{isAiCfoAccessEnabled:q,onAskAiCfoClick:B}=Ie({mobileExploreReferrer:"Forecast"});b.useEffect(()=>{if(!c&&g)p(!0),l||e(X());else if(l&&!m){u(!0);const t=((f,L,O)=>L!=null?f.forecasts.findIndex(F=>F.id===L):O!=null?f.forecasts.findIndex(F=>F.id===O):f.forecasts.length>0?0:-1)(i,o,A?.id);t===-1&&o!=null?s("page-not-found",{replace:!0}):t!==-1&&t!=A?.index?(e(v(i.forecasts[t].id,t)),y(o,i.forecasts[t].id,s,a.search)):o==null&&t!==-1&&y(void 0,i.forecasts[t].id,s,a.search),t!==-1&&!x(i.forecasts[t].id)&&g&&e(C(i.forecasts[t].id))}},[c,p,e,l,i,m,u,R,C,g]);const D=pe(),Y=D?.loggedInUserRole!=null&&ee(D.loggedInUserRole),{useFeatureGate:_}=M(),{isFeatureEnabled:j}=_(w.isReportsCommentingEnabled),G=Ce(j?T?.companyId:void 0,{clearParams:l&&m}),[J,V]=b.useState(!1),E=t=>{V(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(ue,{analytics:$,onLoad:t=>(f=>f.trackForecast())(t)}):null,n.jsx(Te,{isAppContentDrawerOpen:J,handleDrawerToggle:E}),n.jsx(ke,{firstMonthOfFY:N,tenantEmailDomain:r,forecastIdFromUrlPath:o,navigate:s,location:a,isPandLReportFetched:x,meetingUrl:te(`https://meetings.hubspot.com/svitlana-grankovska?firstname=${h?.firstName}&lastname=${h?.lastName}&email=${h?.userEmail}`),hasTransactionAccess:Y,isAiCfoAccessEnabled:q,onAskAiCfoClick:B,isReportsCommentingEnabled:j,isZeniUser:ae(h),initialOpenThreadRequest:G,onClickMenuIcon:()=>{E(!0)}})]})}function We(){const s=d(c=>P(c)),{useFeatureGate:e}=M(),{isFeatureEnabled:a}=e(w.isDebitCardFeatureEnabled),o=le(a,s),r=de(s);return o===!0||r===!0?n.jsx(Fe,{}):n.jsxs(Q,{children:[n.jsx(I,{path:"/",element:n.jsx(U,{})}),n.jsx(I,{path:"/:forecastId",element:n.jsx(U,{})}),n.jsx(I,{path:"/:forecastId/*",element:n.jsx(ge,{})})]})}export{We as PandLWithForecastRoutes,We as default};
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-D41N0IlG.js";import{JH as te,eO as Y,jA as G,eU as q,eS as ne,H6 as N,Jl as oe,s_ as Ee,JI as X,sO as ke,t7 as Ie,t1 as ie,sS as re,t5 as Pe,t2 as je,JJ as le,uE as Le,JK as Te,fx as ve,JL as H,sX as de,sV as ce,ta as Fe,c1 as Ae}from"./zeni-epic-state-BLvcbIPk.js";import{Z as pe,y as Q,S as E,z,a6 as ue,G as me,ah as ge,ai as Oe,E as he,o as O,H as fe,D as Ce,aj as Re,R as Ve,w as Ue,c as be,e as Ze,n as Be,ak as $e,k as He}from"./index-CkmaHLOP.js";import{D as ye,n as W,S as we}from"./mui-DZd7XaFW.js";import ae from"./NotFoundScreen--NgVTkpE.js";import{a as r}from"./sentry-Bhr8KU--.js";import{h as ee,l as Je,g as m,j as _e,u as Ge,k as ze,n as se,o as $}from"./core-B86WF2Ww.js";import{u as We}from"./useAskAiCfoHostNavButtonProps-DRzMbg61.js";import{c as Ke}from"./useFetchSuggestedQuestionsWhenReady-dE_HTM0_.js";import{M as Me}from"./MobileAppDrawer-BF7-1gg_.js";import"./recharts-BHLF4b4u.js";import"./analytics-CFOBCmx3.js";import"./plaid-CZm5yErz.js";import"./dnd-DrUSXn8k.js";import"./stripe-DMRn4zHo.js";import"./lottie-BHETr187.js";import"./lexical-COpm991f.js";import"./pdf-BdWka_4Q.js";import"./utils-Mvk27uIx.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]="45bbc141-0861-4f34-82d1-afe5941a8b31",a._sentryDebugIdIdentifier="sentry-dbid-45bbc141-0861-4f34-82d1-afe5941a8b31")}catch{}})();const Xe={overlayWidth:new he(100,100,48)},J=Ce.getLocalizedStrings().peoplePage.invitePage,Ye=({companyId:a,managersListView:t,companyPassportView:l,classListView:n,mode:g,isEditPeopleDrawerOpen:o,closeDrawerHandler:y})=>{const h=pe(),p=ee(),[R,V]=r.useState(!1),[I,w]=r.useState(!1),{userId:S}=Je(),d=m(e=>te(e)),u=m(e=>Y(e)),D=m(e=>G(e)),{useFeatureGate:f}=Q(),{isFeatureEnabled:k}=f(E.isDebitCardFeatureEnabled),P=q(k,u),T=ne(u),v=N(u),U=oe(u),Z=!!u.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!P&&D&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||l.fetchState!=="Completed"||a==null;if(z.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{p(X()),y()},F=()=>{R===!0?w(!0):C()},B=l.companyView?.controllers?.map(e=>e.user),{isFeatureEnabled:c}=f(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:j}=f(E.isChargeCardFeatureEnabled),L=ue(u,j,k),{isFeatureEnabled:A}=f(E.isTreasuryEnabled),b={peopleDetails:d,classList:n.classes,managersList:t.users,controllersList:B,mode:g,isZeniTenant:v,isAccountingClassesEnabled:D,isReimbursementDisabled:Z===!1,isZeniAccountsDisabled:c===!1,isChargeCardDisabled:L===!1,isTreasuryDisabled:A===!1,isLiteRoleDisabled:U===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:T,onResetClick:C,onDeleteUser:e=>{p(re(e.userId,e.userRole.userRoleId))},onPeopleLocalDataUpdated:e=>{p(ie({peopleLocalData:e})),V(!0)},onSaveClick:()=>{p(g==="zeni_only"?ke(a):Ie(v))},onCloseClick:F,isLoading:x||d.person==null},i={onOkClick:()=>{w(!1),C()},onCancelClick:()=>{w(!1)}};return r.useEffect(()=>{x===!1&&S!=null&&p(Ee(S))},[x,S]),r.useEffect(()=>{d.updatePersonState.fetchState==="Completed"&&C()},[d.updatePersonState.fetchState]),s.jsx(ye,{anchor:"right",open:o,PaperProps:{style:{width:Xe.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:me.overlayDark,cursor:"pointer"}}},onClose:F,children:s.jsxs(qe,{onClick:e=>e.stopPropagation(),children:[I===!0?s.jsx(ge,{titleComponent:s.jsx(Se,{children:J.discardTitle}),descriptionComponent:s.jsx(De,{children:J.discardDescription}),primaryButtonText:J.discard,secondaryButtonText:J.no,action:i,isEditPopup:!0}):null,s.jsx(Oe,{...b})]})})},qe=W(we)`
1
+ import{j as s}from"./liveblocks-6nZkQHFl.js";import{JH as te,eO as Y,jA as G,eU as q,eS as ne,H6 as N,Jl as oe,s_ as Ee,JI as X,sO as ke,t7 as Ie,t1 as ie,sS as re,t5 as Pe,t2 as je,JJ as le,uE as Le,JK as Te,fx as ve,JL as H,sX as de,sV as ce,ta as Fe,c1 as Ae}from"./zeni-epic-state-DITtSXPQ.js";import{Z as pe,y as Q,S as E,z,a6 as ue,G as me,ah as ge,ai as Oe,E as he,o as O,H as fe,D as Ce,aj as Re,R as Ve,w as Ue,c as be,e as Ze,n as Be,ak as $e,k as He}from"./index-cQHaeS6s.js";import{D as ye,n as W,S as we}from"./mui-DOBONCVx.js";import ae from"./NotFoundScreen-C17gldyA.js";import{a as r}from"./sentry-Dr5FPm4d.js";import{h as ee,l as Je,g as m,j as _e,u as Ge,k as ze,n as se,o as $}from"./core-B8DAi0nh.js";import{u as We}from"./useAskAiCfoHostNavButtonProps-D-63GR-J.js";import{c as Ke}from"./useFetchSuggestedQuestionsWhenReady-Cq8Wv1kQ.js";import{M as Me}from"./MobileAppDrawer-G8G6Y9KP.js";import"./recharts-CDgByeDS.js";import"./analytics-CLyVqw3m.js";import"./plaid-BJER8-rG.js";import"./dnd-DNrenqEc.js";import"./stripe-DMRn4zHo.js";import"./lottie-Cp94NU-O.js";import"./lexical-BbcB7U6u.js";import"./pdf-B9LwAnPJ.js";import"./utils-XBrV3QeH.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]="45bbc141-0861-4f34-82d1-afe5941a8b31",a._sentryDebugIdIdentifier="sentry-dbid-45bbc141-0861-4f34-82d1-afe5941a8b31")}catch{}})();const Xe={overlayWidth:new he(100,100,48)},J=Ce.getLocalizedStrings().peoplePage.invitePage,Ye=({companyId:a,managersListView:t,companyPassportView:l,classListView:n,mode:g,isEditPeopleDrawerOpen:o,closeDrawerHandler:y})=>{const h=pe(),p=ee(),[R,V]=r.useState(!1),[I,w]=r.useState(!1),{userId:S}=Je(),d=m(e=>te(e)),u=m(e=>Y(e)),D=m(e=>G(e)),{useFeatureGate:f}=Q(),{isFeatureEnabled:k}=f(E.isDebitCardFeatureEnabled),P=q(k,u),T=ne(u),v=N(u),U=oe(u),Z=!!u.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!P&&D&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||l.fetchState!=="Completed"||a==null;if(z.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{p(X()),y()},F=()=>{R===!0?w(!0):C()},B=l.companyView?.controllers?.map(e=>e.user),{isFeatureEnabled:c}=f(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:j}=f(E.isChargeCardFeatureEnabled),L=ue(u,j,k),{isFeatureEnabled:A}=f(E.isTreasuryEnabled),b={peopleDetails:d,classList:n.classes,managersList:t.users,controllersList:B,mode:g,isZeniTenant:v,isAccountingClassesEnabled:D,isReimbursementDisabled:Z===!1,isZeniAccountsDisabled:c===!1,isChargeCardDisabled:L===!1,isTreasuryDisabled:A===!1,isLiteRoleDisabled:U===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:T,onResetClick:C,onDeleteUser:e=>{p(re(e.userId,e.userRole.userRoleId))},onPeopleLocalDataUpdated:e=>{p(ie({peopleLocalData:e})),V(!0)},onSaveClick:()=>{p(g==="zeni_only"?ke(a):Ie(v))},onCloseClick:F,isLoading:x||d.person==null},i={onOkClick:()=>{w(!1),C()},onCancelClick:()=>{w(!1)}};return r.useEffect(()=>{x===!1&&S!=null&&p(Ee(S))},[x,S]),r.useEffect(()=>{d.updatePersonState.fetchState==="Completed"&&C()},[d.updatePersonState.fetchState]),s.jsx(ye,{anchor:"right",open:o,PaperProps:{style:{width:Xe.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:me.overlayDark,cursor:"pointer"}}},onClose:F,children:s.jsxs(qe,{onClick:e=>e.stopPropagation(),children:[I===!0?s.jsx(ge,{titleComponent:s.jsx(Se,{children:J.discardTitle}),descriptionComponent:s.jsx(De,{children:J.discardDescription}),primaryButtonText:J.discard,secondaryButtonText:J.no,action:i,isEditPopup:!0}):null,s.jsx(Oe,{...b})]})})},qe=W(we)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
@@ -0,0 +1 @@
1
+ import{j as s}from"./liveblocks-6nZkQHFl.js";import E from"./NotFoundScreen-C17gldyA.js";import{a as r}from"./sentry-Dr5FPm4d.js";import{j as _,u as v,g as p,l as M,h as P,N as U,k as O,n as z,o as b}from"./core-B8DAi0nh.js";import{eO as B,Pn as h,bo as F,bn as N,hg as V,gM as q}from"./zeni-epic-state-DITtSXPQ.js";import{q as $,z as I,cv as G}from"./index-cQHaeS6s.js";import"./mui-DOBONCVx.js";import{u as H}from"./useAskAiCfoHostNavButtonProps-D-63GR-J.js";import{c as J}from"./useFetchSuggestedQuestionsWhenReady-Cq8Wv1kQ.js";import{M as K}from"./MobileAppDrawer-G8G6Y9KP.js";import"./recharts-CDgByeDS.js";import"./analytics-CLyVqw3m.js";import"./plaid-BJER8-rG.js";import"./dnd-DNrenqEc.js";import"./stripe-DMRn4zHo.js";import"./lottie-Cp94NU-O.js";import"./lexical-BbcB7U6u.js";import"./pdf-B9LwAnPJ.js";import"./utils-XBrV3QeH.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]="4ebf1bbf-01bc-4626-be56-98ddd422082a",e._sentryDebugIdIdentifier="sentry-dbid-4ebf1bbf-01bc-4626-be56-98ddd422082a")}catch{}})();const L=O(function(e){const t=I.getSignedInUser(),c=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:c??""},{aggregatedReportViewState:n}=h(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}},function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}})(G),Q=()=>{const e=_(),t=v(),c=$(),o=p(a=>B(a)),{aggregatedReportViewState:n}=p(a=>h(a)),{tenantEmailDomain:f}=M(),u=P(),l=I.getSignedInUser();if(l==null)throw new Error("Can't access this page without signing in...");const m=r.useRef(!1),[w,C]=r.useState(!1),S=F(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,x=N(l),y=S||k||x,d=r.useCallback((a,i,T)=>{u(V({fromMonth:a,toMonth:i,cacheOverride:T}))},[]);r.useEffect(()=>{n?.fetchState==="Completed"&&m.current&&(u(q({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),m.current=!1)},[n?.fetchState]);const D=r.useCallback((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||d(a,i,!0),m.current=!0},[n?.fetchState,d]),j=r.useCallback((a,i)=>{d(a,i,!1)},[d]),g=a=>{C(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:A}=H({mobileExploreReferrer:"Performance"});return J({isDataReady:n?.fetchState==="Completed"}),y?s.jsxs(s.Fragment,{children:[s.jsx(K,{isAppContentDrawerOpen:w,handleDrawerToggle:g}),s.jsx(L,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:l,tenantEmailDomain:f,onReload:D,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:A})]}):s.jsx(U,{to:`/${f}/dashboard`,replace:!0})};function pe(){return s.jsxs(z,{children:[s.jsx(b,{path:"*",element:s.jsx(Q,{})}),s.jsx(b,{path:"*",element:s.jsx(E,{})})]})}export{pe as default};