@zeniai/web-app-ui 5.0.48-prod → 5.0.49-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/dist/assets/AddressRoutes-BmBJQzqm.js +1 -0
  2. package/dist/assets/{AddressScreen-DLCFmlpD.js → AddressScreen-DRGH0nmt.js} +2 -2
  3. package/dist/assets/{AiCfoScreen-CoTSxU-2.js → AiCfoScreen-DO3MZ9Gt.js} +2 -2
  4. package/dist/assets/{BillPayApprovalRoutes-iEKd233z.js → BillPayApprovalRoutes-CMZwB76H.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-Cltu1gUi.js → BillPayRoutes-Bsf8ADpX.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-D1vUEwVm.js → BusinessVerificationPageScreen-DvOGGDR6.js} +1 -1
  7. package/dist/assets/{ChargeCardRoutes-D-Aqd55g.js → ChargeCardRoutes-BlgRk84Y.js} +1 -1
  8. package/dist/assets/{CompanyPassportScreen-D5d4ibRm.js → CompanyPassportScreen-ekPGHciI.js} +1 -1
  9. package/dist/assets/{ConnectionAuthScreen-DT9cn7rw.js → ConnectionAuthScreen-Cl5OoRWG.js} +1 -1
  10. package/dist/assets/CustomerOnboardingAuthScreen-COUhAxtm.js +1 -0
  11. package/dist/assets/{CustomerOnboardingRoutes-CMIZYY-f.js → CustomerOnboardingRoutes-rbjwoNAv.js} +6 -6
  12. package/dist/assets/{DashboardRoutes-qkbn0MOg.js → DashboardRoutes-C9nPuy0J.js} +3 -3
  13. package/dist/assets/{DefaultTenantHome-Bcp_Qfcv.js → DefaultTenantHome-Cz3esHFl.js} +1 -1
  14. package/dist/assets/{DomesticWireDetailScreen-CiSCpdXV.js → DomesticWireDetailScreen-OHXf0lAg.js} +1 -1
  15. package/dist/assets/{DrawerScreen-CzsRyOzb.js → DrawerScreen-Dx8bR0c_.js} +1 -1
  16. package/dist/assets/{EntityDetailRoutes-jI4cGpp5.js → EntityDetailRoutes-DvPnytVY.js} +1 -1
  17. package/dist/assets/{ExpenseAutomationRoutes-DCIk3Zpt.js → ExpenseAutomationRoutes-BkXrLExV.js} +1 -1
  18. package/dist/assets/FeaturePreviewScreen-BxdQOPRs.js +1 -0
  19. package/dist/assets/{MagicLinkRoutes-BaRKS9Cm.js → MagicLinkRoutes-DURB9SWP.js} +21 -21
  20. package/dist/assets/MagicLinkSignInScreen-BhiB7aDd.js +12 -0
  21. package/dist/assets/{MobileAppDrawer-eXadB0K7.js → MobileAppDrawer-B_jzMbIp.js} +1 -1
  22. package/dist/assets/NotFoundScreen-Tdm5L-r8.js +1 -0
  23. package/dist/assets/{NotificationRoutes-B2n8NGGJ.js → NotificationRoutes-DAJRT5dy.js} +1 -1
  24. package/dist/assets/PandLWithForecastRoutes-DfoD-2hh.js +1 -0
  25. package/dist/assets/{PeopleRoutes-BSB0UpKg.js → PeopleRoutes-C-ffXnhD.js} +3 -3
  26. package/dist/assets/PerformanceRoutes-B1S0Dqww.js +1 -0
  27. package/dist/assets/{Preview-BN3241Ik.js → Preview-DgE5RaQx.js} +1 -1
  28. package/dist/assets/{QBOConnectionScreen-Bda7HGRv.js → QBOConnectionScreen-DGcZA-NS.js} +1 -1
  29. package/dist/assets/ReferralListScreen-D_GHHBdl.js +5 -0
  30. package/dist/assets/{ReimbursementApprovalRoutes-CnIKi1qG.js → ReimbursementApprovalRoutes-Cg0eMLTS.js} +1 -1
  31. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-DYr6AfpX.js → ReimbursementApprovalRuleDetailScreen-DRo7NI8S.js} +1 -1
  32. package/dist/assets/{ReimbursementRoutes-RSrv-R45.js → ReimbursementRoutes-DBntH9hp.js} +1 -1
  33. package/dist/assets/{ReportsRoutes-C-UOarHG.js → ReportsRoutes-C8DjH5Ho.js} +1 -1
  34. package/dist/assets/{RewardsRoutes-CvXUpfO3.js → RewardsRoutes-Ob0LYTs4.js} +1 -1
  35. package/dist/assets/{ScreenRoutes-Dj6hwSVK.js → ScreenRoutes-CNfwi52O.js} +2 -2
  36. package/dist/assets/{SettingsRoutes-C7kKT2Wu.js → SettingsRoutes-CfrudKWh.js} +7 -7
  37. package/dist/assets/{SetupPagesScreen-BYVxUS-A.js → SetupPagesScreen-CIkOInUe.js} +1 -1
  38. package/dist/assets/SignInScreen-DPIOjBSW.js +1 -0
  39. package/dist/assets/{SignOutScreen-CiNKrr3b.js → SignOutScreen-pj4gYTc1.js} +1 -1
  40. package/dist/assets/{TaskListScreen-Bso0gFsA.js → TaskListScreen-DRIv083S.js} +2 -2
  41. package/dist/assets/TaskRoutes-MNLLpg0T.js +9 -0
  42. package/dist/assets/TransactionDetailRoutes-BdJ8Ulvx.js +1 -0
  43. package/dist/assets/{TransactionDetailScreen-B-BVFEpP.js → TransactionDetailScreen-B0frSfDq.js} +1 -1
  44. package/dist/assets/{TransactionListRoutes-B-weK0KR.js → TransactionListRoutes-D1A6evyz.js} +1 -1
  45. package/dist/assets/{TreasuryRoutes-CvtDLSYA.js → TreasuryRoutes-CQaQab-y.js} +6 -6
  46. package/dist/assets/{VendorsRoutes-C5pg4yYd.js → VendorsRoutes-BeYBuPJz.js} +1 -1
  47. package/dist/assets/WiseConfirmationScreen-COfHYgkP.js +12 -0
  48. package/dist/assets/{ZeniAccountRoutes-BZfXZqff.js → ZeniAccountRoutes-DapwuqSm.js} +10 -10
  49. package/dist/assets/{ZeniAccountStatementScreen-BZhRsA1d.js → ZeniAccountStatementScreen-DwzVu3Si.js} +1 -1
  50. package/dist/assets/{accountMappingHelper-Du_UPbom.js → accountMappingHelper-d9bI5aJe.js} +1 -1
  51. package/dist/assets/{analytics-BYXYUYaV.js → analytics-DlMpWLtY.js} +1 -1
  52. package/dist/assets/{analyticsHelper-qtcJL_9E.js → analyticsHelper-Cf6O9Ih0.js} +1 -1
  53. package/dist/assets/{core-zBodvsmj.js → core-DK_vDmT8.js} +1 -1
  54. package/dist/assets/{decodeURIComponentSafe-BxqXitkH.js → decodeURIComponentSafe-D_yxDRpD.js} +1 -1
  55. package/dist/assets/{dnd-DXQzuHAR.js → dnd-CI1Bz-yv.js} +1 -1
  56. package/dist/assets/{empty-DznJ5vQ0.js → empty-Cq9cCg0f.js} +1 -1
  57. package/dist/assets/{empty-BYbkNusG.js → empty-DSG43sav.js} +1 -1
  58. package/dist/assets/{emptyVideoElement-DEfphVVC.js → emptyVideoElement-CnwvQS3j.js} +1 -1
  59. package/dist/assets/{epic-0Dg_EE5c.js → epic-Culj-FsH.js} +1 -1
  60. package/dist/assets/getLocaleForTenant-BzhpZyOL.js +1 -0
  61. package/dist/assets/{index-DWuYGxh2.js → index-BXVvK5HN.js} +1 -1
  62. package/dist/assets/{index-BEtykuxp.js → index-BllLxW2o.js} +13524 -13520
  63. package/dist/assets/{index-DlmJ00f5.js → index-C_rnV1Gn.js} +1 -1
  64. package/dist/assets/{index-ChjK0FS9.js → index-CvaLt6TZ.js} +1 -1
  65. package/dist/assets/{index-5cWeTq4r.js → index-DUVkAqoc.js} +1 -1
  66. package/dist/assets/{index-DeqScg-I.js → index-l9tW4qcS.js} +1 -1
  67. package/dist/assets/{index-BqKzA-Km.js → index-tcR_mP46.js} +2 -2
  68. package/dist/assets/{lexical-DftjmMYF.js → lexical-2V5hcKhY.js} +1 -1
  69. package/dist/assets/{liveblocks-BmoAyVEe.js → liveblocks-CFneZw8x.js} +1 -1
  70. package/dist/assets/{lottie-7jInd46q.js → lottie-DTY7lPgA.js} +1 -1
  71. package/dist/assets/{mui-DLJkInA_.js → mui-Cf9-_L5d.js} +1 -1
  72. package/dist/assets/{pathToGoBack-BiPTdTVS.js → pathToGoBack-DiGM4suv.js} +1 -1
  73. package/dist/assets/{pdf-D8Yl-cKT.js → pdf-DO37o4P_.js} +3 -3
  74. package/dist/assets/{pdf-lib-CUjCRAxG.js → pdf-lib-CtLCB8Ws.js} +1 -1
  75. package/dist/assets/{plaid-C7DViorD.js → plaid-COLZDQ-K.js} +1 -1
  76. package/dist/assets/{pusher-CRfXP-cv.js → pusher-1IRbjHv-.js} +1 -1
  77. package/dist/assets/{react-Dkk_ZWva.js → react-056z8_dj.js} +1 -1
  78. package/dist/assets/{react-Cdi_qhxI.js → react-BP8YOYb-.js} +1 -1
  79. package/dist/assets/{react-CdeUme6N.js → react-CTinTxki.js} +1 -1
  80. package/dist/assets/{react-BbNia0dG.js → react-DNcD4xIo.js} +1 -1
  81. package/dist/assets/{react-BiUKO3Kt.js → react-Dl0848Wb.js} +1 -1
  82. package/dist/assets/{react-Bs_LYL4f.js → react-DzYgOa8M.js} +1 -1
  83. package/dist/assets/{recharts-CBJVI15_.js → recharts-DGCFoGqb.js} +1 -1
  84. package/dist/assets/{routePaths-C57Y-8ts.js → routePaths-DP6g0Tqx.js} +1 -1
  85. package/dist/assets/{sentry-CCAVv3jj.js → sentry-Dhi05Xar.js} +1 -1
  86. package/dist/assets/{url-9z1lEuSX.js → url-A8mMNIgc.js} +1 -1
  87. package/dist/assets/{url-CBGDc-wo.js → url-Cvest_if.js} +1 -1
  88. package/dist/assets/useAskAiCfoHostNavButtonProps-Cm6zAMRj.js +1 -0
  89. package/dist/assets/{useDeviceId-Dup02Wq-.js → useDeviceId-BMcpyfup.js} +1 -1
  90. package/dist/assets/useFetchSuggestedQuestionsWhenReady-Dw2xWQ9g.js +1 -0
  91. package/dist/assets/{useInitialThreadRequest-CM5l2YfA.js → useInitialThreadRequest-Dt8Aahks.js} +1 -1
  92. package/dist/assets/{utils-IcNZtE46.js → utils-DkqKuJOX.js} +1 -1
  93. package/dist/assets/{withTransactionSidePanel-BXzIWNiu.js → withTransactionSidePanel-BQfYUuvc.js} +2 -2
  94. package/dist/assets/{zeni-epic-state-BTJNQUbs.js → zeni-epic-state-BL_LeZIj.js} +6 -6
  95. package/dist/index.html +1 -1
  96. package/package.json +4 -4
  97. package/dist/assets/AddressRoutes-CinbDYIL.js +0 -1
  98. package/dist/assets/CustomerOnboardingAuthScreen-CcoGZVlz.js +0 -1
  99. package/dist/assets/FeaturePreviewScreen-DpwaS3B5.js +0 -1
  100. package/dist/assets/MagicLinkSignInScreen-Wy-Mtwaj.js +0 -12
  101. package/dist/assets/NotFoundScreen-B9pJKI3W.js +0 -1
  102. package/dist/assets/PandLWithForecastRoutes-prXwYS5x.js +0 -1
  103. package/dist/assets/PerformanceRoutes--odeFC3_.js +0 -1
  104. package/dist/assets/ReferralListScreen-SFqT-t-3.js +0 -5
  105. package/dist/assets/SignInScreen-NPPYVpUv.js +0 -1
  106. package/dist/assets/TaskRoutes-fdFjE-0L.js +0 -9
  107. package/dist/assets/TransactionDetailRoutes-CNkB5iPK.js +0 -1
  108. package/dist/assets/WiseConfirmationScreen-C_I1BN4x.js +0 -12
  109. package/dist/assets/getLocaleForTenant-kAjI6Fe2.js +0 -1
  110. package/dist/assets/useAskAiCfoHostNavButtonProps-gYNUsHfd.js +0 -1
  111. package/dist/assets/useFetchSuggestedQuestionsWhenReady-ByvvCtR-.js +0 -1
@@ -1,4 +1,4 @@
1
- import{j as l}from"./liveblocks-BmoAyVEe.js";import{l as K,g as k,u as z,h as V,j as q,k as H,s as $a,n as at,o as D}from"./core-zBodvsmj.js";import{eN as L,Jw as Le,bC as Yt,bq as de,KJ as za,hT as qa,KK as wt,KL as Za,hW as nt,KM as Be,KN as Ha,h$ as Ja,KO as xt,KP as Qa,i3 as ot,KQ as Re,KR as Wa,cj as rt,KS as Xa,KT as en,JQ as tn,iZ as an,KU as nn,bn as Se,KV as Gt,Jk as X,bc as Nt,jb as Vt,mu as Kt,iW as $t,Jm as ee,Jl as Z,f3 as on,fl as sn,KW as rn,KX as cn,KY as zt,KZ as fe,tB as ye,tC as ve,tZ as ue,tT as te,tG as Ie,K_ as ln,K$ as dn,L0 as un,L1 as qt,L2 as ge,L3 as mn,dB as Me,qd as Zt,L4 as pn,L5 as hn,L6 as fn,L7 as it,IH as ct,jr as lt,u5 as dt,ql as gn,L8 as bn,tD as Dt,qg as ce,qc as Ht,L9 as oe,La as Cn,Lb as ut,IG as mt,sd as Jt,Lc as _n,Ld as kn,Le as Sn,Lf as pt,sq as yn,Lg as vn,tF as Ot,sc as Qt,Lh as se,Li as In,bv as Wt,u9 as Xt,Lj as An,Lk as En,Ll as Tn,Lm as ht,u4 as wn,Ln as xn,tE as Ft,u8 as ea,Lo as re,Lp as Dn,Lq as On,Lr as ta,jg as aa,mr as na,jl as oa,mp as sa,mo as ra,mn as ia,rB as Fn,fb as Pn,cM as Bn,cN as Rn,mk as jn,f7 as Ln,mA as Mn,Ls as Un,Dd as Yn,Lt as Gn,Lu as Nn,Lv as Vn,b5 as ft,eZ as Kn,gB as $n,fC as zn,mv as qn,iP as Zn,ms as Hn,mq as Jn,eT as Qn,eR as Wn}from"./zeni-epic-state-BTJNQUbs.js";import{z as j,N as J,s as O,e as I,D as $,aP as Xn,I as Ae,x as Ee,aQ as ca,g as G,aR as eo,A as Te,aS as la,a as Ue,d as M,h as to,aT as ao,aU as no,q as oo,c as da,$ as so,aV as ro,aI as ua,aW as io,aX as co,M as lo,aY as we,aZ as uo,al as mo,p as po,J as ho,a_ as fo,a$ as Ce}from"./index-BEtykuxp.js";import{n as gt}from"./mui-DLJkInA_.js";import{a as _}from"./sentry-CCAVv3jj.js";import{w as ma}from"./withTransactionSidePanel-BXzIWNiu.js";import{b as pa,t as me,e as ae,a as bt,v as go}from"./routePaths-C57Y-8ts.js";import{u as Ye}from"./useAskAiCfoHostNavButtonProps-gYNUsHfd.js";import{c as xe,b as bo}from"./useFetchSuggestedQuestionsWhenReady-ByvvCtR-.js";import ke from"./NotFoundScreen-B9pJKI3W.js";import{t as ha}from"./analyticsHelper-qtcJL_9E.js";import{C as Co}from"./CompanyPassportScreen-D5d4ibRm.js";import{F as _o}from"./FeaturePreviewScreen-DpwaS3B5.js";import{R as ko}from"./ReferralListScreen-SFqT-t-3.js";import"./recharts-CBJVI15_.js";import"./analytics-BYXYUYaV.js";import"./plaid-C7DViorD.js";import"./dnd-DXQzuHAR.js";import"./stripe-DMRn4zHo.js";import"./lottie-7jInd46q.js";import"./lexical-DftjmMYF.js";import"./pdf-D8Yl-cKT.js";import"./utils-IcNZtE46.js";import"./TransactionDetailScreen-B-BVFEpP.js";import"./decodeURIComponentSafe-BxqXitkH.js";import"./MobileAppDrawer-eXadB0K7.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]="2e2dcf22-b822-4ddb-88d3-9dcd1717a28d",e._sentryDebugIdIdentifier="sentry-dbid-2e2dcf22-b822-4ddb-88d3-9dcd1717a28d")}catch{}})();const So=ma(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=K(),s=j.getSignedInUser(),i=k(T=>T.tenantState.currentTenantId),d=k(T=>L(T)),{tenantEmailDomain:f}=K(),g=z(),b=d?.companyName??"",p={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},c=_.useMemo(()=>({authParams:p,companyName:b,downloadEndPoint:`${J}/agingDetailedReport`,timezone:Le()}),[]),u=_.useMemo(()=>r!=null?Yt(r):de(),[r]),h=V(),m=q(),C=k(T=>za(T,u,o)),S=_.useCallback(()=>{o!=null&&C.fetchState!=="In-Progress"&&C.fetchState!=="Completed"&&h(qa(o,u))},[u]),A=_.useCallback(()=>{m("../../",{relative:"path"})},[]),P=_.useCallback((T,B)=>{h(wt({sortKey:T,sortOrder:B}))},[]),E=_.useCallback(T=>{h(wt({downloadState:T}))},[]),y=_.useCallback(T=>{if(e)e(T.transactionId,T.transactionType);else if(f!=null){const B=pa({id:T.transactionId,type:T.transactionType},f);m(B);const pe=O(g.state?.pathnameStackToGoBack,g.pathname);m(B,{state:{pathnameStackToGoBack:pe}})}},[f,e]),w=_.useCallback(()=>{C.vendor!=null&&I.trackApAgingDetail("AP Aging",u.format($.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),C.vendor.id,C.vendor.name)},[C.vendor,u]);return _.useEffect(()=>{S()},[]),_.useEffect(()=>{C.fetchState==="Completed"&&w()},[w,C.fetchState]),l.jsx(Xn,{apAgingDetail:C,downloadParams:c,reportDate:u,analytics:I,onTransactionClick:y,onReload:S,onBackClick:A,onColumnSortConfigChanged:P,updateDownloadStateHandler:E,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),yo=()=>{const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Ae(),t=V(),n=q(),o=k(y=>Za(y)),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=Ye({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:"AP Aging"});xe({isDataReady:o.fetchState==="Completed"});const i=j.getSignedInUser(),d=k(y=>y.tenantState.currentTenantId),f=k(y=>L(y)),g=f?.companyName??"",b={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:d??""},p=_.useMemo(()=>({authParams:b,companyName:g,downloadEndPoint:`${J}/agingReport`,timezone:Le()}),[]),c=o.apAgingUIState.selectedDate??de(),u=_.useCallback(()=>{o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&t(nt(c))},[]);_.useEffect(()=>{u()},[]);const h=_.useCallback(()=>{n("../",{relative:"path"})},[]),m=_.useCallback(y=>{t(Be({searchString:y}))},[]),C=_.useCallback((y,w)=>{t(Be({sortKey:w,sortOrder:y}))},[]),S=_.useCallback(y=>{n(`./${y}/${c.format($.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[c]),A=_.useCallback(y=>{t(Be({downloadState:y}))},[]),P=_.useCallback((y,w)=>{},[]),E=_.useCallback((y,w)=>{t(Be({selectedDate:y,agingDateSelectionType:w})),t(nt(y))},[]);return l.jsxs(l.Fragment,{children:[o.fetchState==="Completed"?l.jsx(Ee,{analytics:I,onLoad:y=>y.trackPageLoaded(G.Event.agingReport,"AP Aging")}):null,l.jsx(ca,{uiState:o.apAgingUIState,report:o,downloadParams:p,analytics:I,onReloadReport:u,onBackClick:h,onSearchTextChange:m,onSortOrderChange:C,onEntityNameClick:S,updateDownloadStateHandler:A,onSelectedDateChanged:E,onNodeCollapseToggled:P,isAiCfoAccessEnabled:r,onAskAiCfoClick:s})]})},vo=ma(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=K(),s=j.getSignedInUser(),i=k(w=>L(w)),{tenantEmailDomain:d}=K(),f=z(),g=i.companyName,b={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},p=_.useMemo(()=>({authParams:b,companyName:g,downloadEndPoint:`${J}/agingDetailedReport`,timezone:Le()}),[]),c=_.useMemo(()=>r!=null?Yt(r):de(),[r]),u=V(),h=q(),m=k(w=>Ha(w,c,o)),C=_.useCallback(()=>{o!=null&&m.fetchState!=="In-Progress"&&m.fetchState!=="Completed"&&u(Ja(o,c))},[c]),S=_.useCallback(()=>{h("../../",{relative:"path"})},[]),A=_.useCallback((w,T)=>{u(xt({sortKey:w,sortOrder:T}))},[]),P=_.useCallback(w=>{u(xt({downloadState:w}))},[]),E=_.useCallback(w=>{if(e)e(w.transactionId,w.transactionType);else if(d!=null){const T=pa({id:w.transactionId,type:w.transactionType},d);h(T);const B=O(f.state?.pathnameStackToGoBack,f.pathname);h(T,{state:{pathnameStackToGoBack:B}})}},[d,e]),y=_.useCallback(()=>{m.customer!=null&&I.trackArAgingDetail("AR Aging",c.format($.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),m.customer.id,m.customer.name)},[m.customer,c]);return _.useEffect(()=>{C()},[]),_.useEffect(()=>{m.fetchState==="Completed"&&y()},[m.fetchState,y]),l.jsx(eo,{arAgingDetail:m,downloadParams:p,reportDate:c,analytics:I,onTransactionClick:E,onReload:C,onBackClick:S,onColumnSortConfigChanged:A,updateDownloadStateHandler:P,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),Io=()=>{const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Ae(),t=V(),n=q(),o=k(E=>Qa(E)),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=Ye({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:"AR Aging"});xe({isDataReady:o.fetchState==="Completed"});const i=j.getSignedInUser(),d=k(E=>L(E)),f=d.companyName,g={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:d.tenantId},b=_.useMemo(()=>({authParams:g,companyName:f,downloadEndPoint:`${J}/agingReport`,timezone:Le()}),[]),p=o.arAgingUIState.selectedDate??de(),c=_.useCallback(()=>{o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&t(ot(p))},[]);_.useEffect(()=>{c()},[]);const u=_.useCallback(()=>{n("../",{relative:"path"})},[]),h=_.useCallback(E=>{t(Re({searchString:E}))},[]),m=_.useCallback((E,y)=>{t(Re({sortKey:y,sortOrder:E}))},[]),C=_.useCallback(E=>{n(`./${E}/${p.format($.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[p]),S=_.useCallback(E=>{t(Re({downloadState:E}))},[]),A=_.useCallback((E,y)=>{t(Re({selectedDate:E,agingDateSelectionType:y})),t(ot(E))},[]),P=_.useCallback((E,y)=>{t(Wa({nodeId:E,isCollapsed:y}))},[]);return l.jsxs(l.Fragment,{children:[o.fetchState==="Completed"?l.jsx(Ee,{analytics:I,onLoad:E=>E.trackPageLoaded(G.Event.agingReport,"AR Aging")}):null,l.jsx(ca,{uiState:o.arAgingUIState,report:o,downloadParams:b,analytics:I,onReloadReport:c,onBackClick:u,onSearchTextChange:h,onSortOrderChange:m,onEntityNameClick:C,updateDownloadStateHandler:S,onSelectedDateChanged:A,onNodeCollapseToggled:P,isAiCfoAccessEnabled:r,onAskAiCfoClick:s})]})},fa=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function ga(e,a){const t=tn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=me(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(an(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?I.trackZeniAccountsCashBalancePromoClicked("Move Money"):(I.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else I.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const Ao=H(function(e){const a=Xa(e).accountsInOrder.map((n,o)=>fa(n,o)),t=en(e);return{sectionTitle:$.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:I}},ga)(la),Eo=H(function(e){const a=nn(e).accountsInOrder.map((o,r)=>fa(o,r)),t=j.getSignedInUser(),n=Se(t);return{sectionTitle:$.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:I}},ga)(la);function To(){const e=q(),a=z(),{tenantEmailDomain:t}=K(),n=Te(),o=k(s=>L(s).company?.companyInfo.firstMonthOfFY??1),r=rt(n?.loggedInUserRoleMap);return k(s=>s.cashBalanceState.fetchState)==="Error"?l.jsx(ke,{}):l.jsx(Ao,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function wo(){const e=q(),a=z(),{tenantEmailDomain:t}=K(),n=Te(),o=rt(n?.loggedInUserRoleMap),r=k(s=>L(s).company?.companyInfo.firstMonthOfFY??1);return k(s=>s.cardBalanceState.fetchState)==="Error"?l.jsx(ke,{}):l.jsx(Eo,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const xo=gt.div`
1
+ import{j as l}from"./liveblocks-CFneZw8x.js";import{l as K,g as k,u as z,h as V,j as q,k as H,s as $a,n as at,o as D}from"./core-DK_vDmT8.js";import{eN as L,Jw as Le,bC as Yt,bq as de,KJ as za,hT as qa,KK as wt,KL as Za,hW as nt,KM as Be,KN as Ha,h$ as Ja,KO as xt,KP as Qa,i3 as ot,KQ as Re,KR as Wa,cj as rt,KS as Xa,KT as en,JQ as tn,iZ as an,KU as nn,bn as Se,KV as Gt,Jk as X,bc as Nt,jb as Vt,mu as Kt,iW as $t,Jm as ee,Jl as Z,f3 as on,fl as sn,KW as rn,KX as cn,KY as zt,KZ as fe,tB as ye,tC as ve,tZ as ue,tT as te,tG as Ie,K_ as ln,K$ as dn,L0 as un,L1 as qt,L2 as ge,L3 as mn,dB as Me,qd as Zt,L4 as pn,L5 as hn,L6 as fn,L7 as it,IH as ct,jr as lt,u5 as dt,ql as gn,L8 as Cn,tD as Dt,qg as ce,qc as Ht,L9 as oe,La as bn,Lb as ut,IG as mt,sd as Jt,Lc as _n,Ld as kn,Le as Sn,Lf as pt,sq as yn,Lg as vn,tF as Ot,sc as Qt,Lh as se,Li as In,bv as Wt,u9 as Xt,Lj as An,Lk as En,Ll as Tn,Lm as ht,u4 as wn,Ln as xn,tE as Ft,u8 as ea,Lo as re,Lp as Dn,Lq as On,Lr as ta,jg as aa,mr as na,jl as oa,mp as sa,mo as ra,mn as ia,rB as Fn,fb as Pn,cM as Bn,cN as Rn,mk as jn,f7 as Ln,mA as Mn,Ls as Un,Dd as Yn,Lt as Gn,Lu as Nn,Lv as Vn,b5 as ft,eZ as Kn,gB as $n,fC as zn,mv as qn,iP as Zn,ms as Hn,mq as Jn,eT as Qn,eR as Wn}from"./zeni-epic-state-BL_LeZIj.js";import{z as j,N as J,s as O,e as I,D as $,aP as Xn,G as Ae,x as Ee,aQ as ca,g as G,aR as eo,A as Te,aS as la,a as Ue,d as M,h as to,aT as ao,aU as no,q as oo,c as da,$ as so,aV as ro,aI as ua,aW as io,aX as co,J as lo,aY as we,aZ as uo,al as mo,p as po,I as ho,a_ as fo,a$ as be}from"./index-BllLxW2o.js";import{n as gt}from"./mui-Cf9-_L5d.js";import{a as _}from"./sentry-Dhi05Xar.js";import{w as ma}from"./withTransactionSidePanel-BQfYUuvc.js";import{b as pa,t as me,e as ae,a as Ct,v as go}from"./routePaths-DP6g0Tqx.js";import{u as Ye}from"./useAskAiCfoHostNavButtonProps-Cm6zAMRj.js";import{c as xe,b as Co}from"./useFetchSuggestedQuestionsWhenReady-Dw2xWQ9g.js";import ke from"./NotFoundScreen-Tdm5L-r8.js";import{t as ha}from"./analyticsHelper-Cf6O9Ih0.js";import{C as bo}from"./CompanyPassportScreen-ekPGHciI.js";import{F as _o}from"./FeaturePreviewScreen-BxdQOPRs.js";import{R as ko}from"./ReferralListScreen-D_GHHBdl.js";import"./recharts-DGCFoGqb.js";import"./analytics-DlMpWLtY.js";import"./plaid-COLZDQ-K.js";import"./dnd-CI1Bz-yv.js";import"./stripe-DMRn4zHo.js";import"./lottie-DTY7lPgA.js";import"./lexical-2V5hcKhY.js";import"./pdf-DO37o4P_.js";import"./utils-DkqKuJOX.js";import"./TransactionDetailScreen-B0frSfDq.js";import"./decodeURIComponentSafe-D_yxDRpD.js";import"./MobileAppDrawer-B_jzMbIp.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]="028d8700-5809-4637-90a6-c96dfe2a2681",e._sentryDebugIdIdentifier="sentry-dbid-028d8700-5809-4637-90a6-c96dfe2a2681")}catch{}})();const So=ma(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=K(),s=j.getSignedInUser(),i=k(T=>T.tenantState.currentTenantId),d=k(T=>L(T)),{tenantEmailDomain:f}=K(),g=z(),C=d?.companyName??"",p={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},c=_.useMemo(()=>({authParams:p,companyName:C,downloadEndPoint:`${J}/agingDetailedReport`,timezone:Le()}),[]),u=_.useMemo(()=>r!=null?Yt(r):de(),[r]),h=V(),m=q(),b=k(T=>za(T,u,o)),S=_.useCallback(()=>{o!=null&&b.fetchState!=="In-Progress"&&b.fetchState!=="Completed"&&h(qa(o,u))},[u]),A=_.useCallback(()=>{m("../../",{relative:"path"})},[]),P=_.useCallback((T,B)=>{h(wt({sortKey:T,sortOrder:B}))},[]),E=_.useCallback(T=>{h(wt({downloadState:T}))},[]),y=_.useCallback(T=>{if(e)e(T.transactionId,T.transactionType);else if(f!=null){const B=pa({id:T.transactionId,type:T.transactionType},f);m(B);const pe=O(g.state?.pathnameStackToGoBack,g.pathname);m(B,{state:{pathnameStackToGoBack:pe}})}},[f,e]),w=_.useCallback(()=>{b.vendor!=null&&I.trackApAgingDetail("AP Aging",u.format($.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),b.vendor.id,b.vendor.name)},[b.vendor,u]);return _.useEffect(()=>{S()},[]),_.useEffect(()=>{b.fetchState==="Completed"&&w()},[w,b.fetchState]),l.jsx(Xn,{apAgingDetail:b,downloadParams:c,reportDate:u,analytics:I,onTransactionClick:y,onReload:S,onBackClick:A,onColumnSortConfigChanged:P,updateDownloadStateHandler:E,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),yo=()=>{const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Ae(),t=V(),n=q(),o=k(y=>Za(y)),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=Ye({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:"AP Aging"});xe({isDataReady:o.fetchState==="Completed"});const i=j.getSignedInUser(),d=k(y=>y.tenantState.currentTenantId),f=k(y=>L(y)),g=f?.companyName??"",C={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:d??""},p=_.useMemo(()=>({authParams:C,companyName:g,downloadEndPoint:`${J}/agingReport`,timezone:Le()}),[]),c=o.apAgingUIState.selectedDate??de(),u=_.useCallback(()=>{o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&t(nt(c))},[]);_.useEffect(()=>{u()},[]);const h=_.useCallback(()=>{n("../",{relative:"path"})},[]),m=_.useCallback(y=>{t(Be({searchString:y}))},[]),b=_.useCallback((y,w)=>{t(Be({sortKey:w,sortOrder:y}))},[]),S=_.useCallback(y=>{n(`./${y}/${c.format($.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[c]),A=_.useCallback(y=>{t(Be({downloadState:y}))},[]),P=_.useCallback((y,w)=>{},[]),E=_.useCallback((y,w)=>{t(Be({selectedDate:y,agingDateSelectionType:w})),t(nt(y))},[]);return l.jsxs(l.Fragment,{children:[o.fetchState==="Completed"?l.jsx(Ee,{analytics:I,onLoad:y=>y.trackPageLoaded(G.Event.agingReport,"AP Aging")}):null,l.jsx(ca,{uiState:o.apAgingUIState,report:o,downloadParams:p,analytics:I,onReloadReport:u,onBackClick:h,onSearchTextChange:m,onSortOrderChange:b,onEntityNameClick:S,updateDownloadStateHandler:A,onSelectedDateChanged:E,onNodeCollapseToggled:P,isAiCfoAccessEnabled:r,onAskAiCfoClick:s})]})},vo=ma(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=K(),s=j.getSignedInUser(),i=k(w=>L(w)),{tenantEmailDomain:d}=K(),f=z(),g=i.companyName,C={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},p=_.useMemo(()=>({authParams:C,companyName:g,downloadEndPoint:`${J}/agingDetailedReport`,timezone:Le()}),[]),c=_.useMemo(()=>r!=null?Yt(r):de(),[r]),u=V(),h=q(),m=k(w=>Ha(w,c,o)),b=_.useCallback(()=>{o!=null&&m.fetchState!=="In-Progress"&&m.fetchState!=="Completed"&&u(Ja(o,c))},[c]),S=_.useCallback(()=>{h("../../",{relative:"path"})},[]),A=_.useCallback((w,T)=>{u(xt({sortKey:w,sortOrder:T}))},[]),P=_.useCallback(w=>{u(xt({downloadState:w}))},[]),E=_.useCallback(w=>{if(e)e(w.transactionId,w.transactionType);else if(d!=null){const T=pa({id:w.transactionId,type:w.transactionType},d);h(T);const B=O(f.state?.pathnameStackToGoBack,f.pathname);h(T,{state:{pathnameStackToGoBack:B}})}},[d,e]),y=_.useCallback(()=>{m.customer!=null&&I.trackArAgingDetail("AR Aging",c.format($.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),m.customer.id,m.customer.name)},[m.customer,c]);return _.useEffect(()=>{b()},[]),_.useEffect(()=>{m.fetchState==="Completed"&&y()},[m.fetchState,y]),l.jsx(eo,{arAgingDetail:m,downloadParams:p,reportDate:c,analytics:I,onTransactionClick:E,onReload:b,onBackClick:S,onColumnSortConfigChanged:A,updateDownloadStateHandler:P,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})}),Io=()=>{const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Ae(),t=V(),n=q(),o=k(E=>Qa(E)),{isAiCfoAccessEnabled:r,onAskAiCfoClick:s}=Ye({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:"AR Aging"});xe({isDataReady:o.fetchState==="Completed"});const i=j.getSignedInUser(),d=k(E=>L(E)),f=d.companyName,g={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:d.tenantId},C=_.useMemo(()=>({authParams:g,companyName:f,downloadEndPoint:`${J}/agingReport`,timezone:Le()}),[]),p=o.arAgingUIState.selectedDate??de(),c=_.useCallback(()=>{o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&t(ot(p))},[]);_.useEffect(()=>{c()},[]);const u=_.useCallback(()=>{n("../",{relative:"path"})},[]),h=_.useCallback(E=>{t(Re({searchString:E}))},[]),m=_.useCallback((E,y)=>{t(Re({sortKey:y,sortOrder:E}))},[]),b=_.useCallback(E=>{n(`./${E}/${p.format($.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[p]),S=_.useCallback(E=>{t(Re({downloadState:E}))},[]),A=_.useCallback((E,y)=>{t(Re({selectedDate:E,agingDateSelectionType:y})),t(ot(E))},[]),P=_.useCallback((E,y)=>{t(Wa({nodeId:E,isCollapsed:y}))},[]);return l.jsxs(l.Fragment,{children:[o.fetchState==="Completed"?l.jsx(Ee,{analytics:I,onLoad:E=>E.trackPageLoaded(G.Event.agingReport,"AR Aging")}):null,l.jsx(ca,{uiState:o.arAgingUIState,report:o,downloadParams:C,analytics:I,onReloadReport:c,onBackClick:u,onSearchTextChange:h,onSortOrderChange:m,onEntityNameClick:b,updateDownloadStateHandler:S,onSelectedDateChanged:A,onNodeCollapseToggled:P,isAiCfoAccessEnabled:r,onAskAiCfoClick:s})]})},fa=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function ga(e,a){const t=tn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=me(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(an(n,o))},onPromoCardBtnClick:n=>{if(a.isZeniAccountsAdmin){let o=`../../checking/${n}`;n?I.trackZeniAccountsCashBalancePromoClicked("Move Money"):(I.trackZeniAccountsCashBalancePromoClicked("Sign Up for Free"),o="../../checking/promo");const r=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:r}})}else I.trackZeniAccountsCashBalancePromoClicked("Learn More"),window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")}}}const Ao=H(function(e){const a=Xa(e).accountsInOrder.map((n,o)=>fa(n,o)),t=en(e);return{sectionTitle:$.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,zeniAccountsPromoCardReport:t,fetchState:e.cashBalanceState.fetchState,analytics:I}},ga)(la),Eo=H(function(e){const a=nn(e).accountsInOrder.map((o,r)=>fa(o,r)),t=j.getSignedInUser(),n=Se(t);return{sectionTitle:$.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:I}},ga)(la);function To(){const e=q(),a=z(),{tenantEmailDomain:t}=K(),n=Te(),o=k(s=>L(s).company?.companyInfo.firstMonthOfFY??1),r=rt(n?.loggedInUserRoleMap);return k(s=>s.cashBalanceState.fetchState)==="Error"?l.jsx(ke,{}):l.jsx(Ao,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,isZeniAccountsAdmin:r,firstMonthOfFY:o})}function wo(){const e=q(),a=z(),{tenantEmailDomain:t}=K(),n=Te(),o=rt(n?.loggedInUserRoleMap),r=k(s=>L(s).company?.companyInfo.firstMonthOfFY??1);return k(s=>s.cardBalanceState.fetchState)==="Error"?l.jsx(ke,{}):l.jsx(Eo,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,isZeniAccountsAdmin:o,firstMonthOfFY:r})}const xo=gt.div`
2
2
  display: flex;
3
3
  flex: 1 1 auto;
4
4
  min-height: 100%;
@@ -10,11 +10,11 @@ import{j as l}from"./liveblocks-BmoAyVEe.js";import{l as K,g as k,u as z,h as V,
10
10
  flex-direction: column;
11
11
  align-items: center;
12
12
  background-color: ${e=>e.theme.colors.grey4};
13
- `;function Oo({title:e,reportId:a,entityAutoCompleteView:t,autoCompleteText:n,isAiCfoAccessEnabled:o,onAskAiCfoClick:r}){const s=q(),i=V(),d=z(),{tenantEmailDomain:f}=K(),g=to();return l.jsxs(xo,{children:[l.jsx(ao,{source:a==="cash_balance"?"CashBalanceDetailScreen":"CardBalanceDetailScreen",title:e,onBackClick:()=>{s("../")},hideSearchBtn:!0,backgroundColor:g.colors.grey4,searchAutoComplete:{autoCompleteData:{entityAutoCompleteView:t,autoCompleteText:n},autoCompleteActions:{onAutoCompleteInputChange:b=>{b.trim().length>=2?i(ee({searchString:b,searchOrigin:"navbar"})):b.trim().length===0&&i(Z("navbar"))},onAutoCompleteEntity:b=>{n!=null&&I?.trackSearch(G.Event.search,Fo(a),b.type,b.name,n);const p=ae(b,f),c=O(d.state?.pathnameStackToGoBack,d.pathname);s(p,{state:{pathnameStackToGoBack:c}})}}},rightSideComponent:o===!0&&r!=null?l.jsx(no,{onClick:r}):null}),l.jsx(Do,{children:a==="cash_balance"?l.jsx(To,{}):l.jsx(wo,{})})]})}function Pt(){const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Ae(),t=z(),n=V(),{useFeatureGate:o}=Ue(),{isFeatureEnabled:r}=o(M.isDepositAccountsFeatureEnabled),s=k(C=>C.cashBalanceState.fetchState),i=k(C=>C.cardBalanceState.fetchState),d=j.getSignedInUser();if(d==null)throw Error("Can't access dashboard detail without signing in...");const f=Gt((C=>{const S=Nt(C,"/").split("/");return S[S.length-1]})(t.pathname));let g="Not-Started",b="";const p=$.getLocalizedStrings();switch(f){case"cash_balance":g=s,b=p.reportTitleById.cash_balance;break;case"card_balance":g=i,b=p.reportTitleById.card_balance;break;default:console.error(`${f} is not supported!`)}const{isAiCfoAccessEnabled:c,onAskAiCfoClick:u}=Ye({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:f==="card_balance"?"Card Balance":"Cash Balance"});xe({isDataReady:g==="Completed"});const h=k(C=>C.entityAutoCompleteState.autoCompleteText.navbar),m=k(C=>X(C,"navbar"));return _.useEffect(()=>{g==="Not-Started"&&function(C,S,A){switch(S){case"card_balance":C($t());break;case"cash_balance":C(Vt()),A===!0&&C(Kt());break;default:throw new Error(`balance report type ${S} is not yet supported`)}}(n,f,r)},[d,n,g]),l.jsxs(l.Fragment,{children:[g==="Completed"?l.jsx(Ee,{analytics:I,onLoad:C=>((S,A)=>{switch(A){case"card_balance":S.trackPageLoaded(G.Event.cardBalance);break;case"cash_balance":S.trackPageLoaded(G.Event.cashBalance);break;default:console.error(`Analytics: Not tracking Page Loaded for ${A}!`)}})(C,f)}):null,l.jsx(Oo,{title:b,reportId:f,autoCompleteText:h,entityAutoCompleteView:m,isAiCfoAccessEnabled:c,onAskAiCfoClick:u})]})}const Fo=e=>{switch(e){case"cash_balance":return"Cash Balance";case"card_balance":return"Card Balance";default:return"Dashboard"}},Po=[];function De(e){const{mobileExploreReferrer:a}=e,t=V(),n=q(),o=z(),{tenantEmailDomain:r}=K(),{setIsAiCfoOpen:s,setAiCfoSidePanelQuestionToSubmit:i}=Ae(),d=oo(),f=lo(d),g=$a(),b=k(B=>on(B)),p=b.uiState?.currentChatSessionId,c=b.allSessionsWithOrderedQuestionAnswers??Po,u=j.getSignedInUser()?.userId,h=da(),m=bo()&&h&&r!=null,C=so(),S=ro(C),{useDynamicConfig:A}=Ue(),{configValue:P}=A(ua.aiCfoMessageDynamicConfig),E=_.useMemo(()=>Array.isArray(P.default_message_list)?P.default_message_list:[],[P.default_message_list]),y=_.useMemo(()=>(S!=null&&S.length>0?S:E).slice(0,2),[E,S]),w=_.useCallback((B,pe)=>{if(u==null||B.trim()==="")return;const he=io(g.getState());if(f){const Oe=O(o.state?.pathnameStackToGoBack,o.pathname);n(`/${r}/ai-cfo/explore`,{state:{message:"",origin:"",pathnameStackToGoBack:Oe,referrer:a,aiCfoInitialQuestion:B,aiCfoShouldSubmit:!he}})}else{if(he)return t(sn(B)),void s(!0);i(B),s(!0),co(t,B,"insights_section",p,c,u,pe,void 0)}},[c,p,t,f,o.pathname,o.state,a,n,s,i,g,r,u]),T=_.useCallback(()=>{if(f){const B=O(o.state?.pathnameStackToGoBack,o.pathname);n(`/${r}/ai-cfo/explore`,{state:{message:"",origin:"",pathnameStackToGoBack:B,referrer:a}})}else s(!0)},[f,o.pathname,o.state,a,n,s,r]);return _.useMemo(()=>{if(m)return{onAskSomethingElseClick:T,onSuggestedQuestionClick:w,suggestedQuestions:y}},[m,T,w,y])}const Bo=H(function(e){const a=rn(e),t=cn(e),n=zt(e),{scrollPosition:o,...r}=n,s=$.getLocalizedStrings().reportTitleById.cash_in_cash_out,i=j.getSignedInUser(),d=e.tenantState.currentTenantId,f=L(e),g=f?.companyName??"",b={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:d??""},p=e.entityAutoCompleteState.autoCompleteText.navbar,c=X(e,"navbar");return{selectedRangeReport:a,reportLabels:{reportTitle:s},highlightedRangeReport:t,uiState:r,scrollPosition:o,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:g,statementEndPoint:`${J}/statement`,authParams:b},analytics:I,autoCompleteData:{autoCompleteText:p,entityAutoCompleteView:c}}},function(e,a){return{updateDownloadStateHandler:t=>{e(ln(t))},onTimeframeSelectionChanged:()=>{},onCOABalancesRangeChanged:(t,n)=>{e(Ie(t,n)),e(fe({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(ue("month")),e(te(a.firstMonthOfFY,t)),e(fe({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(ye(a.firstMonthOfFY,t,o,n)),n.length>0&&e(ve(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.isCompareModeOn!==t&&setTimeout(()=>e(fe({resetLeftScroll:!0})),50)},onElementCollapseStateChanged:(t,n)=>{e(fe({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(fe({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ee({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Z("navbar"))},onAutoCompleteEntity:t=>{const n=ae(t,a.tenantEmailDomain),o=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.navigate("../")}}})(we),Ro=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e,o=De({mobileExploreReferrer:"DashboardCashInCashOut"}),r=k(s=>zt(s)).mode==="compare_mode";return l.jsx(Bo,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:a,location:t,isCompareModeOn:r,navigate:n,insightsSectionAiCfoInfo:o})},jo=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Me(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}},Lo=H(function(e){const a=dn(e),t=un(e),n=qt(e),{scrollPosition:o,...r}=n,s=$.getLocalizedStrings().reportTitleById.cash_position,i=j.getSignedInUser(),d=e.tenantState.currentTenantId,f=L(e),g=f?.companyName??"",b={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:d??""},p=e.entityAutoCompleteState.autoCompleteText.navbar,c=X(e,"navbar");return{selectedRangeReport:a,reportLabels:{reportTitle:s},highlightedRangeReport:t,uiState:r,scrollPosition:o,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:g,statementEndPoint:`${J}/statement`,authParams:b},analytics:I,autoCompleteData:{autoCompleteText:p,entityAutoCompleteView:c}}},function(e,a){return{updateDownloadStateHandler:t=>{e(mn(t))},onTimeframeSelectionChanged:t=>{e(ue(t)),setTimeout(()=>e(ge({resetLeftScroll:!0})),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ie(t,n)),e(ge({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(te(a.firstMonthOfFY,t)),e(ge({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(ye(a.firstMonthOfFY,t,o,n)),n.length>0&&e(ve(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.isCompareModeOn!==t&&setTimeout(()=>e(ge({resetLeftScroll:!0})),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=jo(n),s=t.accountName===""?t.accountDescription:t.accountName;if(o!=null&&r!=null){const i=me(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),d=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:d,referrer:"Cash Position"}})}},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ee({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Z("navbar"))},onAutoCompleteEntity:t=>{const n=ae(t,a.tenantEmailDomain),o=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onTableScroll:t=>{e(ge({scrollPosition:t}))},onBackClick:()=>{a.navigate("../")}}})(we),Mo=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e,o=De({mobileExploreReferrer:"DashboardCashPosition"}),r=k(s=>qt(s)).mode==="compare_mode";return l.jsx(Lo,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:a,location:t,isCompareModeOn:r,navigate:n,insightsSectionAiCfoInfo:o})},N=(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 Je(){return l.jsxs(at,{children:[l.jsx(D,{path:"/",element:l.jsx(Q,{})}),l.jsx(D,{path:"/:forecastId",element:l.jsx(Q,{})}),l.jsx(D,{path:"/:forecastId/*",element:l.jsx(ke,{})})]})}const Uo=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Me(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}},Yo=H(function(e){const a=Zt(e),t=pn(e),n=hn(e),o=fn(e),r=it(e),{scrollPosition:s,...i}=r,d=t.reportTitle,f=j.getSignedInUser(),g=e.tenantState.currentTenantId,b=L(e),p=b?.companyName??"",c={userId:f?.userId??"",sessionId:f?.zeniSessionId??"",tenantId:g??""},u=e.entityAutoCompleteState.autoCompleteText.navbar,h=X(e,"navbar"),m=ct(b);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,reportLabels:{reportTitle:d},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,uiState:i,scrollPosition:s,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:p,statementEndPoint:`${J}/statement`,authParams:c},analytics:I,isZeniUser:Se(f),autoCompleteData:{autoCompleteText:u,entityAutoCompleteView:h},isZeniCOAUsed:m,isAccountingClassesEnabled:lt(e)}},function(e,a){return{updateDownloadStateHandler:t=>{e(Cn(t))},onTimeframeSelectionChanged:t=>{e(ue(t)),setTimeout(()=>e(oe({resetLeftScroll:!0})),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ie(t,n)),e(oe({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(te(a.firstMonthOfFY,t)),e(oe({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(ye(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(ve(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&N(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout(()=>e(oe({resetLeftScroll:!0})),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=Uo(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?bt(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):me(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),d=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:d,referrer:"Burn Rate"}})}},onElementCollapseStateChanged:(t,n)=>{e(oe({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(oe({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ee({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Z("navbar"))},onAutoCompleteEntity:t=>{const n=ae(t,a.tenantEmailDomain),o=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.selectedForecastId!=null?a.navigate("../../../"):a.navigate("../")},onForecastToggle:(t,n)=>{e(ce(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?le:Ct,n)),t==="forecast_mode"?(e(Dt({viewMode:"account_group"})),e(Ht(!1,n?.id)),n!=null&&N(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):N(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(oe({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":"Accounts","Burn Rate"),e(Dt({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(bn({classesToFilterOut:t}))},onOpenAccountViewMode:()=>{e(gn())},onResyncReports:()=>{e(dt("net_burn_or_income_by_classes"))}}})(we),Go=e=>{const a=V(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,s=De({mobileExploreReferrer:"DashboardNetBurnOrIncome"}),i=k(m=>it(m)),d=i.isForecastModeOn,f=i.timeframe,g=i.selectedForecast?.id,b=k(m=>ut(m.forecastState,g??"")),p=k(m=>Zt(m)),c=k(m=>mt(m)),u=i.mode==="compare_mode",h=p.dataAvailable;return _.useEffect(()=>{if(g!=null&&d===!0&&(N(d,r,g,o),b!=null)){const m=b?.forecastPeriod,C=h!=null&&m.endDate.isAfter(h?.endDate)===!0?h:m;a(te(e.firstMonthOfFY,{startDate:C.endDate.startOf(f),endDate:C?.endDate}))}},[g]),l.jsx(Yo,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,forecastIdFromUrlPath:r,location:n,isCompareModeOn:u,navigate:o,analytics:I,reportsResyncFetchState:c.reportsResyncFetchState,insightsSectionAiCfoInfo:s})},No=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Me(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}},Vo=H(function(e){const a=Jt(e),t=_n(e),n=kn(e),o=Sn(e),r=pt(e),{scrollPosition:s,...i}=r,d=$.getLocalizedStrings().reportTitleById.operating_expenses,f=j.getSignedInUser(),g=e.tenantState.currentTenantId,b=L(e),p=b?.companyName??"",c={userId:f?.userId??"",sessionId:f?.zeniSessionId??"",tenantId:g??""},u=e.entityAutoCompleteState.autoCompleteText.navbar,h=X(e,"navbar"),m=ct(b);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,reportLabels:{reportTitle:d},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,uiState:i,scrollPosition:s,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:p,statementEndPoint:`${J}/statement`,authParams:c},analytics:I,isZeniUser:Se(f),autoCompleteData:{autoCompleteText:u,entityAutoCompleteView:h},isZeniCOAUsed:m,isAccountingClassesEnabled:lt(e)}},function(e,a){return{updateDownloadStateHandler:t=>{e(In(t))},onTimeframeSelectionChanged:t=>{e(ue(t)),setTimeout(()=>e(se({resetLeftScroll:!0})),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ie(t,n)),e(se({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(te(a.firstMonthOfFY,t)),e(se({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(ye(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(ve(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&N(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout(()=>e(se({resetLeftScroll:!0})),50)},onAccountBalanceClick:a.hasTransactionAccess!==!0?void 0:(t,n)=>{const{timePeriod:o,timeframe:r}=No(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?bt(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):me(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),d=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:d,referrer:"Operating Expenses"}})}},onElementCollapseStateChanged:(t,n)=>{e(se({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(se({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ee({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Z("navbar"))},onAutoCompleteEntity:t=>{const n=ae(t,a.tenantEmailDomain),o=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.selectedForecastId!=null?a.navigate("../../../"):a.navigate("../")},onForecastToggle:(t,n)=>{e(ce(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?le:Ct,n)),t=="forecast_mode"?(e(Ot({viewMode:"account_group"})),e(Qt(!1,n?.id)),n!=null&&N(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):N(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(se({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":"Accounts","Operating Expenses"),e(Ot({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(vn({classesToFilterOut:t}))},onOpenAccountViewMode:()=>{e(yn())},onResyncReports:()=>{e(dt("operating_expenses_by_classes"))}}})(we),Ko=e=>{const a=V(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,s=De({mobileExploreReferrer:"DashboardOpEx"}),i=k(S=>pt(S)),d=i.isForecastModeOn,f=i.timeframe,g=i.selectedForecast?.id,b=k(S=>ut(S.forecastState,g??"")),p=k(S=>Jt(S)),c=k(S=>mt(S)),u=i.mode==="compare_mode",h=p.dataAvailable;_.useEffect(()=>{if(g!=null&&d===!0&&(N(d,r,g,o),b!=null)){const S=b?.forecastPeriod,A=h!=null&&S.endDate.isAfter(h?.endDate)===!0?h:S;a(te(e.firstMonthOfFY,{startDate:A.endDate.startOf(f),endDate:A?.endDate}))}},[g]);const m=Te(),C=m?.loggedInUserRole!=null&&Wt(m?.loggedInUserRole)!==!0;return l.jsx(Vo,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,location:n,isCompareModeOn:u,navigate:o,forecastIdFromUrlPath:r,analytics:I,hasTransactionAccess:C,reportsResyncFetchState:c.reportsResyncFetchState,insightsSectionAiCfoInfo:s})},$o=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Me(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=H(function(e){const a=Xt(e),t=An(e),n=En(e),o=Tn(e),r=ht(e),{scrollPosition:s,...i}=r,d=$.getLocalizedStrings().reportTitleById.revenue,f=j.getSignedInUser(),g=e.tenantState.currentTenantId,b=L(e),p=b?.companyName??"",c={userId:f?.userId??"",sessionId:f?.zeniSessionId??"",tenantId:g??""},u=e.entityAutoCompleteState.autoCompleteText.navbar,h=X(e,"navbar"),m=ct(b);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,reportLabels:{reportTitle:d},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,uiState:i,scrollPosition:s,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:p,statementEndPoint:`${J}/statement`,authParams:c},analytics:I,isZeniUser:Se(f),autoCompleteData:{autoCompleteText:u,entityAutoCompleteView:h},isZeniCOAUsed:m,isAccountingClassesEnabled:lt(e)}},function(e,a){return{updateDownloadStateHandler:t=>{e(Dn(t))},onTimeframeSelectionChanged:t=>{e(ue(t)),setTimeout(()=>e(re({resetLeftScroll:!0})),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ie(t,n)),e(re({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(te(a.firstMonthOfFY,t)),e(re({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(ye(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(ve(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&N(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout(()=>e(re({resetLeftScroll:!0})),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=$o(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?bt(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):me(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),d=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:d,referrer:"Revenues"}})}},onElementCollapseStateChanged:(t,n)=>{e(re({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(re({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ee({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Z("navbar"))},onAutoCompleteEntity:t=>{const n=ae(t,a.tenantEmailDomain),o=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.selectedForecastId!=null?a.navigate("../../../"):a.navigate("../")},onForecastToggle:(t,n)=>{e(ce(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?le:Ct,n)),t==="forecast_mode"?(e(Ft({viewMode:"account_group"})),e(ea(!1,n?.id)),n!=null&&N(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):N(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(re({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":"Accounts","Revenues"),e(Ft({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(xn({classesToFilterOut:t}))},onOpenAccountViewMode:()=>{e(wn())},onResyncReports:()=>{e(dt("revenue_by_classes"))}}})(we),qo=e=>{const a=V(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,s=De({mobileExploreReferrer:"DashboardRevenue"}),i=k(h=>ht(h)),d=i.isForecastModeOn,f=i.timeframe,g=i.selectedForecast?.id,b=k(h=>ut(h.forecastState,g??"")),p=k(h=>Xt(h)).dataAvailable,c=i.mode==="compare_mode",u=k(h=>mt(h));return _.useEffect(()=>{if(g!=null&&d===!0&&(N(d,r,g,o),b!=null)){const h=b?.forecastPeriod,m=p!=null&&h.endDate.isAfter(p?.endDate)===!0?p:h;a(te(e.firstMonthOfFY,{startDate:m.endDate.startOf(f),endDate:m?.endDate}))}},[g]),l.jsx(zo,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,isCompareModeOn:c,location:n,navigate:o,forecastIdFromUrlPath:r,analytics:I,reportsResyncFetchState:u.reportsResyncFetchState,insightsSectionAiCfoInfo:s})},Zo=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}},Ho=H(function(e){const a=On(e),t=e.entityAutoCompleteState.autoCompleteText.navbar,n=X(e,"navbar");return{report:a,analytics:I,autoCompleteData:{autoCompleteText:t,entityAutoCompleteView:n}}},function(e,a){return{onTimeframeSelectionChanged:t=>{I.trackTimeframeSwitch(ha(t),"Top Expenses"),e(ta(t))},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=Zo(n),s=t.accountName===""?t.accountDescription:t.accountName;if(o!=null&&r!=null){const i=me(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),d=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:d,referrer:"Top Expenses"}})}},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ee({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Z("navbar"))},onAutoCompleteEntity:t=>{const n=ae(t,a.tenantEmailDomain),o=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.navigate("../")}}})(uo),Jo=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e;return l.jsx(Ho,{tenantEmailDomain:a,location:t,navigate:n})},Qo=gt.div`
13
+ `;function Oo({title:e,reportId:a,entityAutoCompleteView:t,autoCompleteText:n,isAiCfoAccessEnabled:o,onAskAiCfoClick:r}){const s=q(),i=V(),d=z(),{tenantEmailDomain:f}=K(),g=to();return l.jsxs(xo,{children:[l.jsx(ao,{source:a==="cash_balance"?"CashBalanceDetailScreen":"CardBalanceDetailScreen",title:e,onBackClick:()=>{s("../")},hideSearchBtn:!0,backgroundColor:g.colors.grey4,searchAutoComplete:{autoCompleteData:{entityAutoCompleteView:t,autoCompleteText:n},autoCompleteActions:{onAutoCompleteInputChange:C=>{C.trim().length>=2?i(ee({searchString:C,searchOrigin:"navbar"})):C.trim().length===0&&i(Z("navbar"))},onAutoCompleteEntity:C=>{n!=null&&I?.trackSearch(G.Event.search,Fo(a),C.type,C.name,n);const p=ae(C,f),c=O(d.state?.pathnameStackToGoBack,d.pathname);s(p,{state:{pathnameStackToGoBack:c}})}}},rightSideComponent:o===!0&&r!=null?l.jsx(no,{onClick:r}):null}),l.jsx(Do,{children:a==="cash_balance"?l.jsx(To,{}):l.jsx(wo,{})})]})}function Pt(){const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Ae(),t=z(),n=V(),{useFeatureGate:o}=Ue(),{isFeatureEnabled:r}=o(M.isDepositAccountsFeatureEnabled),s=k(b=>b.cashBalanceState.fetchState),i=k(b=>b.cardBalanceState.fetchState),d=j.getSignedInUser();if(d==null)throw Error("Can't access dashboard detail without signing in...");const f=Gt((b=>{const S=Nt(b,"/").split("/");return S[S.length-1]})(t.pathname));let g="Not-Started",C="";const p=$.getLocalizedStrings();switch(f){case"cash_balance":g=s,C=p.reportTitleById.cash_balance;break;case"card_balance":g=i,C=p.reportTitleById.card_balance;break;default:console.error(`${f} is not supported!`)}const{isAiCfoAccessEnabled:c,onAskAiCfoClick:u}=Ye({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:f==="card_balance"?"Card Balance":"Cash Balance"});xe({isDataReady:g==="Completed"});const h=k(b=>b.entityAutoCompleteState.autoCompleteText.navbar),m=k(b=>X(b,"navbar"));return _.useEffect(()=>{g==="Not-Started"&&function(b,S,A){switch(S){case"card_balance":b($t());break;case"cash_balance":b(Vt()),A===!0&&b(Kt());break;default:throw new Error(`balance report type ${S} is not yet supported`)}}(n,f,r)},[d,n,g]),l.jsxs(l.Fragment,{children:[g==="Completed"?l.jsx(Ee,{analytics:I,onLoad:b=>((S,A)=>{switch(A){case"card_balance":S.trackPageLoaded(G.Event.cardBalance);break;case"cash_balance":S.trackPageLoaded(G.Event.cashBalance);break;default:console.error(`Analytics: Not tracking Page Loaded for ${A}!`)}})(b,f)}):null,l.jsx(Oo,{title:C,reportId:f,autoCompleteText:h,entityAutoCompleteView:m,isAiCfoAccessEnabled:c,onAskAiCfoClick:u})]})}const Fo=e=>{switch(e){case"cash_balance":return"Cash Balance";case"card_balance":return"Card Balance";default:return"Dashboard"}},Po=[];function De(e){const{mobileExploreReferrer:a}=e,t=V(),n=q(),o=z(),{tenantEmailDomain:r}=K(),{setIsAiCfoOpen:s,setAiCfoSidePanelQuestionToSubmit:i}=Ae(),d=oo(),f=lo(d),g=$a(),C=k(B=>on(B)),p=C.uiState?.currentChatSessionId,c=C.allSessionsWithOrderedQuestionAnswers??Po,u=j.getSignedInUser()?.userId,h=da(),m=Co()&&h&&r!=null,b=so(),S=ro(b),{useDynamicConfig:A}=Ue(),{configValue:P}=A(ua.aiCfoMessageDynamicConfig),E=_.useMemo(()=>Array.isArray(P.default_message_list)?P.default_message_list:[],[P.default_message_list]),y=_.useMemo(()=>(S!=null&&S.length>0?S:E).slice(0,2),[E,S]),w=_.useCallback((B,pe)=>{if(u==null||B.trim()==="")return;const he=io(g.getState());if(f){const Oe=O(o.state?.pathnameStackToGoBack,o.pathname);n(`/${r}/ai-cfo/explore`,{state:{message:"",origin:"",pathnameStackToGoBack:Oe,referrer:a,aiCfoInitialQuestion:B,aiCfoShouldSubmit:!he}})}else{if(he)return t(sn(B)),void s(!0);i(B),s(!0),co(t,B,"insights_section",p,c,u,pe,void 0)}},[c,p,t,f,o.pathname,o.state,a,n,s,i,g,r,u]),T=_.useCallback(()=>{if(f){const B=O(o.state?.pathnameStackToGoBack,o.pathname);n(`/${r}/ai-cfo/explore`,{state:{message:"",origin:"",pathnameStackToGoBack:B,referrer:a}})}else s(!0)},[f,o.pathname,o.state,a,n,s,r]);return _.useMemo(()=>{if(m)return{onAskSomethingElseClick:T,onSuggestedQuestionClick:w,suggestedQuestions:y}},[m,T,w,y])}const Bo=H(function(e){const a=rn(e),t=cn(e),n=zt(e),{scrollPosition:o,...r}=n,s=$.getLocalizedStrings().reportTitleById.cash_in_cash_out,i=j.getSignedInUser(),d=e.tenantState.currentTenantId,f=L(e),g=f?.companyName??"",C={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:d??""},p=e.entityAutoCompleteState.autoCompleteText.navbar,c=X(e,"navbar");return{selectedRangeReport:a,reportLabels:{reportTitle:s},highlightedRangeReport:t,uiState:r,scrollPosition:o,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:g,statementEndPoint:`${J}/statement`,authParams:C},analytics:I,autoCompleteData:{autoCompleteText:p,entityAutoCompleteView:c}}},function(e,a){return{updateDownloadStateHandler:t=>{e(ln(t))},onTimeframeSelectionChanged:()=>{},onCOABalancesRangeChanged:(t,n)=>{e(Ie(t,n)),e(fe({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(ue("month")),e(te(a.firstMonthOfFY,t)),e(fe({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(ye(a.firstMonthOfFY,t,o,n)),n.length>0&&e(ve(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.isCompareModeOn!==t&&setTimeout(()=>e(fe({resetLeftScroll:!0})),50)},onElementCollapseStateChanged:(t,n)=>{e(fe({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(fe({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ee({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Z("navbar"))},onAutoCompleteEntity:t=>{const n=ae(t,a.tenantEmailDomain),o=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.navigate("../")}}})(we),Ro=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e,o=De({mobileExploreReferrer:"DashboardCashInCashOut"}),r=k(s=>zt(s)).mode==="compare_mode";return l.jsx(Bo,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:a,location:t,isCompareModeOn:r,navigate:n,insightsSectionAiCfoInfo:o})},jo=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Me(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}},Lo=H(function(e){const a=dn(e),t=un(e),n=qt(e),{scrollPosition:o,...r}=n,s=$.getLocalizedStrings().reportTitleById.cash_position,i=j.getSignedInUser(),d=e.tenantState.currentTenantId,f=L(e),g=f?.companyName??"",C={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:d??""},p=e.entityAutoCompleteState.autoCompleteText.navbar,c=X(e,"navbar");return{selectedRangeReport:a,reportLabels:{reportTitle:s},highlightedRangeReport:t,uiState:r,scrollPosition:o,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:g,statementEndPoint:`${J}/statement`,authParams:C},analytics:I,autoCompleteData:{autoCompleteText:p,entityAutoCompleteView:c}}},function(e,a){return{updateDownloadStateHandler:t=>{e(mn(t))},onTimeframeSelectionChanged:t=>{e(ue(t)),setTimeout(()=>e(ge({resetLeftScroll:!0})),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ie(t,n)),e(ge({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(te(a.firstMonthOfFY,t)),e(ge({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(ye(a.firstMonthOfFY,t,o,n)),n.length>0&&e(ve(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.isCompareModeOn!==t&&setTimeout(()=>e(ge({resetLeftScroll:!0})),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=jo(n),s=t.accountName===""?t.accountDescription:t.accountName;if(o!=null&&r!=null){const i=me(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),d=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:d,referrer:"Cash Position"}})}},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ee({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Z("navbar"))},onAutoCompleteEntity:t=>{const n=ae(t,a.tenantEmailDomain),o=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onTableScroll:t=>{e(ge({scrollPosition:t}))},onBackClick:()=>{a.navigate("../")}}})(we),Mo=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e,o=De({mobileExploreReferrer:"DashboardCashPosition"}),r=k(s=>qt(s)).mode==="compare_mode";return l.jsx(Lo,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:a,location:t,isCompareModeOn:r,navigate:n,insightsSectionAiCfoInfo:o})},N=(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 Je(){return l.jsxs(at,{children:[l.jsx(D,{path:"/",element:l.jsx(Q,{})}),l.jsx(D,{path:"/:forecastId",element:l.jsx(Q,{})}),l.jsx(D,{path:"/:forecastId/*",element:l.jsx(ke,{})})]})}const Uo=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Me(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}},Yo=H(function(e){const a=Zt(e),t=pn(e),n=hn(e),o=fn(e),r=it(e),{scrollPosition:s,...i}=r,d=t.reportTitle,f=j.getSignedInUser(),g=e.tenantState.currentTenantId,C=L(e),p=C?.companyName??"",c={userId:f?.userId??"",sessionId:f?.zeniSessionId??"",tenantId:g??""},u=e.entityAutoCompleteState.autoCompleteText.navbar,h=X(e,"navbar"),m=ct(C);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,reportLabels:{reportTitle:d},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,uiState:i,scrollPosition:s,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:p,statementEndPoint:`${J}/statement`,authParams:c},analytics:I,isZeniUser:Se(f),autoCompleteData:{autoCompleteText:u,entityAutoCompleteView:h},isZeniCOAUsed:m,isAccountingClassesEnabled:lt(e)}},function(e,a){return{updateDownloadStateHandler:t=>{e(bn(t))},onTimeframeSelectionChanged:t=>{e(ue(t)),setTimeout(()=>e(oe({resetLeftScroll:!0})),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ie(t,n)),e(oe({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(te(a.firstMonthOfFY,t)),e(oe({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(ye(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(ve(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&N(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout(()=>e(oe({resetLeftScroll:!0})),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=Uo(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?Ct(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):me(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),d=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:d,referrer:"Burn Rate"}})}},onElementCollapseStateChanged:(t,n)=>{e(oe({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(oe({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ee({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Z("navbar"))},onAutoCompleteEntity:t=>{const n=ae(t,a.tenantEmailDomain),o=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.selectedForecastId!=null?a.navigate("../../../"):a.navigate("../")},onForecastToggle:(t,n)=>{e(ce(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?le:bt,n)),t==="forecast_mode"?(e(Dt({viewMode:"account_group"})),e(Ht(!1,n?.id)),n!=null&&N(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):N(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(oe({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":"Accounts","Burn Rate"),e(Dt({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(Cn({classesToFilterOut:t}))},onOpenAccountViewMode:()=>{e(gn())},onResyncReports:()=>{e(dt("net_burn_or_income_by_classes"))}}})(we),Go=e=>{const a=V(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,s=De({mobileExploreReferrer:"DashboardNetBurnOrIncome"}),i=k(m=>it(m)),d=i.isForecastModeOn,f=i.timeframe,g=i.selectedForecast?.id,C=k(m=>ut(m.forecastState,g??"")),p=k(m=>Zt(m)),c=k(m=>mt(m)),u=i.mode==="compare_mode",h=p.dataAvailable;return _.useEffect(()=>{if(g!=null&&d===!0&&(N(d,r,g,o),C!=null)){const m=C?.forecastPeriod,b=h!=null&&m.endDate.isAfter(h?.endDate)===!0?h:m;a(te(e.firstMonthOfFY,{startDate:b.endDate.startOf(f),endDate:b?.endDate}))}},[g]),l.jsx(Yo,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,forecastIdFromUrlPath:r,location:n,isCompareModeOn:u,navigate:o,analytics:I,reportsResyncFetchState:c.reportsResyncFetchState,insightsSectionAiCfoInfo:s})},No=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Me(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}},Vo=H(function(e){const a=Jt(e),t=_n(e),n=kn(e),o=Sn(e),r=pt(e),{scrollPosition:s,...i}=r,d=$.getLocalizedStrings().reportTitleById.operating_expenses,f=j.getSignedInUser(),g=e.tenantState.currentTenantId,C=L(e),p=C?.companyName??"",c={userId:f?.userId??"",sessionId:f?.zeniSessionId??"",tenantId:g??""},u=e.entityAutoCompleteState.autoCompleteText.navbar,h=X(e,"navbar"),m=ct(C);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,reportLabels:{reportTitle:d},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,uiState:i,scrollPosition:s,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:p,statementEndPoint:`${J}/statement`,authParams:c},analytics:I,isZeniUser:Se(f),autoCompleteData:{autoCompleteText:u,entityAutoCompleteView:h},isZeniCOAUsed:m,isAccountingClassesEnabled:lt(e)}},function(e,a){return{updateDownloadStateHandler:t=>{e(In(t))},onTimeframeSelectionChanged:t=>{e(ue(t)),setTimeout(()=>e(se({resetLeftScroll:!0})),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ie(t,n)),e(se({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(te(a.firstMonthOfFY,t)),e(se({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(ye(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(ve(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&N(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout(()=>e(se({resetLeftScroll:!0})),50)},onAccountBalanceClick:a.hasTransactionAccess!==!0?void 0:(t,n)=>{const{timePeriod:o,timeframe:r}=No(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?Ct(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):me(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),d=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:d,referrer:"Operating Expenses"}})}},onElementCollapseStateChanged:(t,n)=>{e(se({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(se({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ee({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Z("navbar"))},onAutoCompleteEntity:t=>{const n=ae(t,a.tenantEmailDomain),o=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.selectedForecastId!=null?a.navigate("../../../"):a.navigate("../")},onForecastToggle:(t,n)=>{e(ce(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?le:bt,n)),t=="forecast_mode"?(e(Ot({viewMode:"account_group"})),e(Qt(!1,n?.id)),n!=null&&N(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):N(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(se({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":"Accounts","Operating Expenses"),e(Ot({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(vn({classesToFilterOut:t}))},onOpenAccountViewMode:()=>{e(yn())},onResyncReports:()=>{e(dt("operating_expenses_by_classes"))}}})(we),Ko=e=>{const a=V(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,s=De({mobileExploreReferrer:"DashboardOpEx"}),i=k(S=>pt(S)),d=i.isForecastModeOn,f=i.timeframe,g=i.selectedForecast?.id,C=k(S=>ut(S.forecastState,g??"")),p=k(S=>Jt(S)),c=k(S=>mt(S)),u=i.mode==="compare_mode",h=p.dataAvailable;_.useEffect(()=>{if(g!=null&&d===!0&&(N(d,r,g,o),C!=null)){const S=C?.forecastPeriod,A=h!=null&&S.endDate.isAfter(h?.endDate)===!0?h:S;a(te(e.firstMonthOfFY,{startDate:A.endDate.startOf(f),endDate:A?.endDate}))}},[g]);const m=Te(),b=m?.loggedInUserRole!=null&&Wt(m?.loggedInUserRole)!==!0;return l.jsx(Vo,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,location:n,isCompareModeOn:u,navigate:o,forecastIdFromUrlPath:r,analytics:I,hasTransactionAccess:b,reportsResyncFetchState:c.reportsResyncFetchState,insightsSectionAiCfoInfo:s})},$o=e=>{let a,t;switch(e.balanceTimeFrame){case"month":case"quarter":a=e.balanceTimeFrame,t=Me(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=H(function(e){const a=Xt(e),t=An(e),n=En(e),o=Tn(e),r=ht(e),{scrollPosition:s,...i}=r,d=$.getLocalizedStrings().reportTitleById.revenue,f=j.getSignedInUser(),g=e.tenantState.currentTenantId,C=L(e),p=C?.companyName??"",c={userId:f?.userId??"",sessionId:f?.zeniSessionId??"",tenantId:g??""},u=e.entityAutoCompleteState.autoCompleteText.navbar,h=X(e,"navbar"),m=ct(C);return{selectedRangeReport:a,selectedClassesViewRangeReport:n,reportLabels:{reportTitle:d},highlightedRangeReport:t,highlightedClassesViewRangeReport:o,uiState:i,scrollPosition:s,downloadParams:{downloadState:a.downloadState,currentTenantCompanyName:p,statementEndPoint:`${J}/statement`,authParams:c},analytics:I,isZeniUser:Se(f),autoCompleteData:{autoCompleteText:u,entityAutoCompleteView:h},isZeniCOAUsed:m,isAccountingClassesEnabled:lt(e)}},function(e,a){return{updateDownloadStateHandler:t=>{e(Dn(t))},onTimeframeSelectionChanged:t=>{e(ue(t)),setTimeout(()=>e(re({resetLeftScroll:!0})),50)},onCOABalancesRangeChanged:(t,n)=>{e(Ie(t,n)),e(re({resetLeftScroll:!0}))},onThisPeriodChanged:t=>{e(te(a.firstMonthOfFY,t)),e(re({resetLeftScroll:!0}))},onAdditionalBalanceSelectionChanged:(t,n,o)=>{e(ye(a.firstMonthOfFY,t,o,n)),n.length>0&&(e(ve(a.firstMonthOfFY,n.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",o,n)),a.forecastIdFromUrlPath!=null&&t==1&&N(!1,a.forecastIdFromUrlPath,"",a.navigate)),a.isCompareModeOn!==t&&setTimeout(()=>e(re({resetLeftScroll:!0})),50)},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=$o(n);if(o!=null&&r!=null){const s=t.accountName===""?t.accountDescription:t.accountName,i=t.classesViewParentId!=null&&t.classesViewParentId.parentClassId!=null?Ct(a.tenantEmailDomain,t.accountId,t.accountType,t.classesViewParentId.parentClassId?.[0],s,r,o):me(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),d=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:d,referrer:"Revenues"}})}},onElementCollapseStateChanged:(t,n)=>{e(re({nodeCollapseState:{nodeId:t,isCollapsed:n}}))},onTableScroll:t=>{e(re({scrollPosition:t}))},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ee({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Z("navbar"))},onAutoCompleteEntity:t=>{const n=ae(t,a.tenantEmailDomain),o=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.selectedForecastId!=null?a.navigate("../../../"):a.navigate("../")},onForecastToggle:(t,n)=>{e(ce(a.firstMonthOfFY,t==="forecast_mode",t==="forecast_mode"?le:bt,n)),t==="forecast_mode"?(e(Ft({viewMode:"account_group"})),e(ea(!1,n?.id)),n!=null&&N(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):N(!1,a.forecastIdFromUrlPath,n?.id??"",a.navigate),e(re({resetLeftScroll:!0}))},onUpdateAccountViewMode:t=>{a.analytics?.trackGroupBySwitch(t==="classes"?"Classes":"Accounts","Revenues"),e(Ft({viewMode:t}))},onUpdateClassesToFilterOut:t=>{e(xn({classesToFilterOut:t}))},onOpenAccountViewMode:()=>{e(wn())},onResyncReports:()=>{e(dt("revenue_by_classes"))}}})(we),qo=e=>{const a=V(),{tenantEmailDomain:t,location:n,navigate:o,forecastIdFromUrlPath:r}=e,s=De({mobileExploreReferrer:"DashboardRevenue"}),i=k(h=>ht(h)),d=i.isForecastModeOn,f=i.timeframe,g=i.selectedForecast?.id,C=k(h=>ut(h.forecastState,g??"")),p=k(h=>Xt(h)).dataAvailable,c=i.mode==="compare_mode",u=k(h=>mt(h));return _.useEffect(()=>{if(g!=null&&d===!0&&(N(d,r,g,o),C!=null)){const h=C?.forecastPeriod,m=p!=null&&h.endDate.isAfter(p?.endDate)===!0?p:h;a(te(e.firstMonthOfFY,{startDate:m.endDate.startOf(f),endDate:m?.endDate}))}},[g]),l.jsx(zo,{firstMonthOfFY:e.firstMonthOfFY,tenantEmailDomain:t,selectedForecastId:r,isCompareModeOn:c,location:n,navigate:o,forecastIdFromUrlPath:r,analytics:I,reportsResyncFetchState:u.reportsResyncFetchState,insightsSectionAiCfoInfo:s})},Zo=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}},Ho=H(function(e){const a=On(e),t=e.entityAutoCompleteState.autoCompleteText.navbar,n=X(e,"navbar");return{report:a,analytics:I,autoCompleteData:{autoCompleteText:t,entityAutoCompleteView:n}}},function(e,a){return{onTimeframeSelectionChanged:t=>{I.trackTimeframeSwitch(ha(t),"Top Expenses"),e(ta(t))},onAccountBalanceClick:(t,n)=>{const{timePeriod:o,timeframe:r}=Zo(n),s=t.accountName===""?t.accountDescription:t.accountName;if(o!=null&&r!=null){const i=me(a.tenantEmailDomain,t.accountId,t.accountType,s,r,o),d=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(i,{state:{pathnameStackToGoBack:d,referrer:"Top Expenses"}})}},autoCompleteActions:{onAutoCompleteInputChange:t=>{t.trim().length>=2?e(ee({searchString:t,searchOrigin:"navbar"})):t.trim().length===0&&e(Z("navbar"))},onAutoCompleteEntity:t=>{const n=ae(t,a.tenantEmailDomain),o=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(n,{state:{pathnameStackToGoBack:o}})}},onBackClick:()=>{a.navigate("../")}}})(uo),Jo=e=>{const{tenantEmailDomain:a,location:t,navigate:n}=e;return l.jsx(Ho,{tenantEmailDomain:a,location:t,navigate:n})},Qo=gt.div`
14
14
  display: flex;
15
15
  flex: 1 1 auto;
16
16
  min-height: 100%;
17
17
  flex-direction: column;
18
18
  background-color: ${e=>e.theme.colors.grey5};
19
19
  align-items: center;
20
- `,le=3,Ct=1;function Wo({fetchState:e,firstMonthOfFY:a,reportId:t,forecastId:n}){const o=q(),r=z(),{tenantEmailDomain:s}=K();let i;xe({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(qo,{...d});break;case"net_burn_or_income":i=l.jsx(Go,{...d});break;case"cash_position":i=l.jsx(Mo,{...d});break;case"top_expenses":i=l.jsx(Jo,{...d});break;case"cash_in_cash_out":i=l.jsx(Ro,{...d});break;default:console.error(`${t} is not supported!`),i=null}return i!=null?l.jsx(Qo,{children:i}):null}function Q(){const e=z(),a=V(),{forecastId:t}=K();let n="Not-Started";const o=k(c=>pt(c).fetchState),r=k(c=>ht(c).fetchState),s=k(c=>it(c).fetchState),i=k(c=>c.cashPositionState.fetchState),d=k(c=>c.topExState.fetchState),f=k(c=>c.cashInCashOutState.fetchState);if(j.getSignedInUser()==null)throw Error("Can't access dashboard detail without signing in...");const g=k(c=>L(c)),b=g?.company?.companyInfo?.firstMonthOfFY??1,p=Gt((c=>{const u=Nt(c,"/").split("/");return t!=null?u[u.length-3]:u[u.length-1]})(e.pathname));switch(p){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=f;break;default:console.error(`${p} is not supported!`)}return _.useEffect(()=>{n==="Not-Started"&&function(c,u,h,m){switch(u){case"operating_expenses":c(ia(!0)),m!=null&&(c(ce(h,!0,le,{id:m,index:0})),c(Qt(!1,m)));break;case"revenue":c(ra(!0)),m!=null&&(c(ce(h,!0,le,{id:m,index:0})),c(ea(!1,m)));break;case"net_burn_or_income":c(sa(!0)),m!=null&&(c(ce(h,!0,le,{id:m,index:0})),c(Ht(!1,m)));break;case"cash_position":c(oa(!0));break;case"top_expenses":c(na());break;case"cash_in_cash_out":c(aa());break;default:throw new Error(`report type ${u} is not yet supported`)}}(a,p,b,t)},[t]),l.jsxs(l.Fragment,{children:[n==="Completed"?l.jsx(Ee,{analytics:I,onLoad:c=>((u,h)=>{const m=e.state?.referrer;switch(h){case"operating_expenses":u.trackPageLoaded(G.Event.operatingExpenses,m);break;case"revenue":u.trackPageLoaded(G.Event.revenues,m);break;case"net_burn_or_income":u.trackPageLoaded(G.Event.burnRate,m);break;case"cash_position":u.trackPageLoaded(G.Event.cashPosition,m);break;case"top_expenses":u.trackPageLoaded(G.Event.topExpenses,m);break;case"cash_in_cash_out":u.trackPageLoaded(G.Event.cashInCashOut,m);break;default:console.error(`Analytics: Not tracking Page Loaded for ${h}!`)}})(c,p)}):null,l.jsx(Wo,{firstMonthOfFY:b,fetchState:n,reportId:p,forecastId:t})]})}var Qe=typeof navigator<"u"&&navigator.userAgent.toLowerCase().indexOf("firefox")>0;function We(e,a,t,n){e.addEventListener?e.addEventListener(a,t,n):e.attachEvent&&e.attachEvent("on".concat(a),function(){t(window.event)})}function ba(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 Ca(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 _t={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,"-":Qe?173:189,"=":Qe?61:187,";":Qe?59:186,"'":222,"[":219,"]":221,"\\":220},W={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},st={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},F={},je=1;je<20;je++)_t["f".concat(je)]=111+je;var x=[],Bt=!1,_a="all",Rt=[],Ge=function(e){return _t[e.toLowerCase()]||W[e.toLowerCase()]||e.toUpperCase().charCodeAt(0)};function jt(e){_a=e||"all"}function _e(){return _a||"all"}var Xe=function(e){var a=e.key,t=e.scope,n=e.method,o=e.splitKey,r=o===void 0?"+":o;Ca(a).forEach(function(s){var i=s.split(r),d=i.length,f=i[d-1],g=f==="*"?"*":Ge(f);if(F[g]){t||(t=_e());var b=d>1?ba(W,i):[];F[g]=F[g].filter(function(p){return!((!n||p.method===n)&&p.scope===t&&function(c,u){for(var h=c.length>=u.length?c:u,m=c.length>=u.length?u:c,C=!0,S=0;S<h.length;S++)m.indexOf(h[S])===-1&&(C=!1);return C}(p.mods,b))})}})};function Lt(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 Mt(e,a){var t=F["*"],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(u){var h=st[u];e[u]&&x.indexOf(h)===-1?x.push(h):!e[u]&&x.indexOf(h)>-1?x.splice(x.indexOf(h),1):u==="metaKey"&&e[u]&&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,W)W[o]===n&&(U[o]=!0);if(!t)return}for(var r in R)Object.prototype.hasOwnProperty.call(R,r)&&(R[r]=e[st[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=_e();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)&&Lt(e,t[i],s,a);if(n in F){for(var d=0;d<F[n].length;d++)if((e.type==="keydown"&&F[n][d].keydown||e.type==="keyup"&&F[n][d].keyup)&&F[n][d].key){for(var f=F[n][d],g=f.splitKey,b=f.key.split(g),p=[],c=0;c<b.length;c++)p.push(Ge(b[c]));p.sort().join("")===x.sort().join("")&&Lt(e,f,s,a)}}}}function U(e,a,t){x=[];var n=Ca(e),o=[],r="all",s=document,i=0,d=!1,f=!0,g="+",b=!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&&(f=a.keydown),a.capture!==void 0&&(b=a.capture),typeof a.splitKey=="string"&&(g=a.splitKey)),typeof a=="string"&&(r=a);i<n.length;i++)o=[],(e=n[i].split(g)).length>1&&(o=ba(W,e)),(e=(e=e[e.length-1])==="*"?"*":Ge(e))in F||(F[e]=[]),F[e].push({keyup:d,keydown:f,scope:r,mods:o,shortcut:n[i],method:t,key:n[i],splitKey:g,element:s});s!==void 0&&!function(p){return Rt.indexOf(p)>-1}(s)&&window&&(Rt.push(s),We(s,"keydown",function(p){Mt(p,s)},b),Bt||(Bt=!0,We(window,"focus",function(){x=[]},b)),We(s,"keyup",function(p){Mt(p,s),function(c){var u=c.keyCode||c.which||c.charCode,h=x.indexOf(u);if(h>=0&&x.splice(h,1),c.key&&c.key.toLowerCase()==="meta"&&x.splice(0,x.length),u!==93&&u!==224||(u=91),u in R)for(var m in R[u]=!1,W)W[m]===u&&(U[m]=!1)}(p)},b))}var et={setScope:jt,getScope:_e,deleteScope:function(e,a){var t,n;for(var o in e||(e=_e()),F)if(Object.prototype.hasOwnProperty.call(F,o))for(t=F[o],n=0;n<t.length;)t[n].scope===e?t.splice(n,1):n++;_e()===e&&jt(a||"all")},getPressedKeyCodes:function(){return x.slice(0)},isPressed:function(e){return typeof e=="string"&&(e=Ge(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(F).forEach(function(t){var n=F[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(F).forEach(function(s){return delete F[s]});else if(Array.isArray(e))e.forEach(function(s){s.key&&Xe(s)});else if(typeof e=="object")e.key&&Xe(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=""),Xe({key:e,scope:o,method:r,splitKey:"+"})}},keyMap:_t,modifier:W,modifierMap:st};for(var tt in et)Object.prototype.hasOwnProperty.call(et,tt)&&(U[tt]=et[tt]);if(typeof window<"u"){var Xo=window.hotkeys;U.noConflict=function(e){return e&&window.hotkeys===U&&(window.hotkeys=Xo),U},window.hotkeys=U}U.filter=function(){return!0};var Ut=function(e,a){var t=e.target,n=t&&t.tagName;return!!(n&&a&&a.includes(n))};function es(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,f=o.filterPreventDefault,g=f===void 0||f,b=o.enabled,p=b===void 0||b,c=o.enableOnContentEditable,u=c!==void 0&&c,h=_.useRef(null),m=_.useCallback(function(C,S){var A,P;return s&&!s(C)?!g:!!(Ut(C,["INPUT","TEXTAREA","SELECT"])&&!Ut(C,r)||(A=C.target)!=null&&A.isContentEditable&&!u)||!!(h.current===null||document.activeElement===h.current||(P=h.current)!=null&&P.contains(document.activeElement))&&(a(C,S),!0)},n?[h,r,s].concat(n):[h,r,s]);return _.useEffect(function(){if(p)return i&&d!==!0&&(t.keydown=!1),U(e,t||{},m),function(){return U.unbind(e,m)};U.unbind(e,m)},[m,e,p]),h}U.isPressed;const ts=["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"],as=(e,a,t,n,o)=>({card:{dimension:ft(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}),be=(e,a,t,n,o)=>({card:{dimension:ft(t),cardType:n,cardIndex:o,fetchState:a,disableAnimations:!1},data:e}),ns=(e,a,t,n)=>be(void 0,e,Ce,a,t),os=(e,a,t,n,o)=>({card:{dimension:ft(Ce),cardType:a,cardIndex:t,fetchState:e,disableAnimations:!1},data:{funds:n,hasUserSeenVideo:o,videoUrl:"https://www.youtube.com/watch?v=sqvJWKCMZgk"}}),ss=H(function(e,a){const t=cs(a.dashboardReport),n=a.passedCardsOrdered,o=a.dashboardReport.reportsInOrder,{isInterestedInChargeCard:r,cardsCreditLimit:s,cashbackRate:i,treasuryFundDetails:d,hasUserSeenTreasuryVideo:f,treasuryFetchState:g}=a;let b=n.map((p,c)=>{if(p==="reimbursement_promo_card"||p==="bill_pay_promo_card")return ns(t,p,c);if(p==="zeni_promo_card")return be({isExpressedInterest:r,creditLimit:s,cashbackRate:i,fetchState:"Completed"},a.cardBalanceFetchState,Ce,p,c);if(p==="treasury_promo_card")return os(g,p,c,d,f);if(p==="information_card")return be(void 0,"Completed",Ce,p,c);{const u=o.find(h=>h?.reportId===p);return u?function(h,m,C,S){const A=h.reportId;switch(A){case"card_balance":case"cash_balance":return[as(h,m,C,A,S)];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[be(h,m,C,A,S)];case"net_burn_or_income_story_card":return[be(h,m,C,"net_burn_or_income_story_card",S)];default:return console.error(`card type ${A} not yet supported!`),[]}}(u,u.fetchState,Ce,c):[]}}).flat();return a.isSummaryCardsFiltered===!0&&(b=b.filter(p=>ts.includes(p.card.cardType)==0).filter(p=>{const c=p.data?.availableNumberOfPeriods;return c!=null?c>0:p.card.cardType!="top_expenses"||p.data==null||function(u){if(u==null||u.length===0)return!0;let h=!0;for(const m of u)if(m.balance.available.amount!==0){h=!1;break}return h}(p.data.topExpenses.accountsOrdered)===!1})),{cardDataArray:b,autoCompleteData:{autoCompleteText:e.entityAutoCompleteState.autoCompleteText.navbar,entityAutoCompleteView:X(e,"navbar")},analytics:I,isReimbursementEnabled:a.isReimbursementEnabled,isBillPayEnabled:a.isBillPayEnabled}},function(e,a){const t=a.tenantId,n=j.getSignedInUser();return{cardActions:{onCardClick:(o,r,s,i)=>{if(console.warn(`onCardClick at ${o} for the type ${r}`),r==="zeni_promo_card"&&i!=null)I.trackDashboardCardClicked("cards promo",2),I.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&&I.trackDashboardCardClicked("rewards promo",o+1),a.navigate("../../rewards/refer",{state:{referrer:s}})):r==="expense_automation_card"?(I.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,f,g){switch(d){case"card_balance":i($t());break;case"cash_balance":i(Vt());break;case"operating_expenses":i(ia(!0));break;case"revenue":i(ra(!0));break;case"net_burn_or_income":i(sa(!0));break;case"net_burn_or_income_story_card":i(Jn(!0));break;case"cash_position":i(oa(!0));break;case"top_expenses":i(na());break;case"cash_in_cash_out":i(aa());break;case"insights_dashboard":i(Hn());break;case"bill_pay_card":i(Zn());break;case"reimbursement_card":i(qn());break;case"company_details":i(zn(f));break;case"task_card":i($n());break;case"accounts_payable_aging":g.includes("accounts_payable_aging")===!1&&i(nt(de()));break;case"accounts_receivable_aging":i(ot(de()));break;case"zeni_accounts_promo_card":g.includes("zeni_accounts_promo_card")===!1&&i(Kt());break;case"rewards_card":g.includes("rewards_card")===!1&&i(Kn(!0));break;default:throw new Error(`report type ${d} is not yet supported`)}}(e,r,a.companyId,s)},onTimeframeChange:(o,r)=>{I.trackTimeframeSwitch(ha(r),is(o),"Dashboard"),function(s,i,d){switch(i){case"operating_expenses":case"revenue":case"net_burn_or_income":case"cash_position":s(ue(d));break;case"top_expenses":s(ta(d));break;default:throw new Error(`report type ${i} doesn't support changeTimeframe`)}}(e,o,r)},onUpdateSelectedInsightIndex:o=>{e(Vn(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=O(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=O(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=O(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){j.saveTreasuryPopupSeen(a.tenantEmailDomain,!0);const s="../treasury",i=O(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"&&(I.trackUpdateBurnRateCalculatorSettings(r,s,Gn(s)),e(Nn(t,r,s)))},onVideoPlay:()=>{e(Yn())},onVideoClose:()=>{e(Un())}},autoCompleteActions:{onAutoCompleteInputChange:o=>{o.trim().length>=2?e(ee({searchString:o,searchOrigin:"navbar"})):o.trim().length===0&&e(Z("navbar"))},onCancelAutoComplete:()=>{e(Z("navbar"))},onAutoCompleteEntity:o=>{let r="";r=o.type!=="vendor"||o.detailType!=="bank_merchant"&&o.detailType!=="card_merchant"?ae(o,a.tenantEmailDomain):go(o.zeniId,o.qboId,a.tenantEmailDomain);const s=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(r,{state:{pathnameStackToGoBack:s,referrer:"Search"}})}}}})(fo);function rs(){const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Ae(),t=q(),n=V(),o=z(),r=j.getSignedInUser(),{useFeatureGate:s,useDynamicConfig:i}=Ue(),d=Se(r),[f,g]=_.useState(!1),[b,p]=_.useState(!1),c=da(),{tenantEmailDomain:u}=K(),{isAiCfoAccessEnabled:h,onAskAiCfoClick:m}=Ye({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:"Dashboard"}),C=k(v=>v.tenantState.fetchState==="Completed"||v.tenantState.activeTenantFetchState.fetchState==="Completed"?L(v):void 0),S=C??j.getSignedInUserTenant(u),A=S.tenantId,P=S.companyId;_.useEffect(()=>{f===!1&&o.state?.message==="activation"&&(n(Fn(P)),g(!0))},[o.state,f,P,n]),_.useEffect(()=>{c&&!b&&o.state?.message==="open_ai_cfo_drawer"&&(a(!0),p(!0),t(o.pathname,{replace:!0,state:{...o.state,message:void 0}}))},[o.state,b,c,a,t,o.pathname]);const{isFeatureEnabled:E}=s(M.isApAgingFeatureEnabled),{isFeatureEnabled:y}=s(M.isExpenseAutomationEnabled),{isFeatureEnabled:w}=s(M.isExpenseAutomationEnabledV2),T=w||y&&d,{isFeatureEnabled:B}=s(M.isTreasuryEnabled),pe=mo(T),{isFeatureEnabled:he}=s(M.isArAgingFeatureEnabled),{isFeatureEnabled:Oe}=s(M.isDepositAccountsFeatureEnabled),{isFeatureEnabled:kt}=s(M.isReferralFeatureEnabled),{isFeatureEnabled:ka}=s(M.isChargeCardFeatureEnabled),{isFeatureEnabled:Sa}=s(M.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:ya}=s(M.isDashboardSidebarNewYearAnimationEnabled),{configValue:St}=i(ua.zeniCardsConfig),va=St.charge_card_cashback_rate_per_transaction==null?.0175:St.charge_card_cashback_rate_per_transaction;if(o.state?.message==="activation"){const v=po(o.state?.pathnameStackToGoBack);t(o.pathname,{state:{...o.state,message:void 0,pathnameStackToGoBack:v.newStack}})}const[yt,Ia]=_.useState(!1),[Ne,Aa]=_.useState(!1);es("command+p, Control+p",v=>{Aa(!Ne),v.preventDefault()},{enableOnContentEditable:!0,enableOnTags:["INPUT","SELECT","TEXTAREA"]},[Ne]);const vt=C?.externalConnections?.accounting[0]?.isValid;if(r==null)throw Error("Can't access dashboard without signing in...");const ne=k(v=>L(v)?.excludedResources),Ea=k(v=>v.expenseAutomationViewState.selectedPeriodByTenantId),Ta=!!C?.companyReimbursementInfo?.info?.isReimbursementEnabled,wa=!!C?.companyBillPayInfo?.info?.isBillPayEnabled,xa=k(v=>v.treasurySetupViewState.treasuryFundsDetails).fetchStatus.fetchState,Da=C?.company!=null&&Pn(C.company),Ve=B&&Da,Ke=Te(),Oa=rt(Ke?.loggedInUserRoleMap),Y=[],It=ne?.resources?.find(v=>v.resource==="/reports/top_expenses")==null,Fa=ne?.resources?.find(v=>v.resource==="/reports/task_card")==null,$e=C?.userRole!=null&&Wt(C?.userRole),Pa=ne?.resources?.find(v=>v.resource==="/bills")==null&&!$e,Ba=ne?.resources?.find(v=>v.resource==="/reimbursements")==null,Ra=Bn(Ke?.loggedInUserRoleMap),ja=Rn(Ke?.loggedInUserRoleMap),La=C?.company?.companyChargeCardInfo?.chargeCardsCreditAccountLimit??0,Ma=C?.companyChargeCardInfo?.info?.isCompanyInterestedInChargeCard??!1,Ua=k(v=>v.treasurySetupViewState.treasuryFundsDetails).fundsDetails;It===!1&&Y.push("top_expenses"),Fa===!1&&Y.push("task_card"),Pa===!1&&Y.push("bill_pay_card","bill_pay_promo_card"),E===!1&&Y.push("accounts_payable_aging"),he===!1&&Y.push("accounts_receivable_aging"),(T===!1||$e)&&Y.push("expense_automation_card"),Ba===!1&&Y.push("reimbursement_card","reimbursement_promo_card"),Oe===!1&&Y.push("zeni_accounts_promo_card"),kt===!1&&Y.push("rewards_card"),Ve===!1&&Y.push("treasury_promo_card");const{areTenantIdsInSync:At}=ho();_.useLayoutEffect(()=>{yt&&pe===T||vt!==!0||!At||ne?.fetchState!=="Completed"&&ne?.fetchState!=="Error"||(Ia(!0),n(jn(r.userId,P,A,!0,!1,Y)))},[yt,r,A,n,It,vt,ne?.fetchState,At]);const Ya=k(v=>v.reportUIOptionsState.forecastOnDashboard.isForecastModeOn),Ga=k(v=>v.revenueState.uiState.selectedForecast?.id),Na=k(v=>v.cardBalanceState.fetchState),ie=k(v=>Ln(v,Y,r,w,y,Ve)),Va=ie.fetchState;xe({isDataReady:!0});const Et=C?.isTreasuryVideoViewed===!0||ie.isTreasuryVideoClosed===!0;return l.jsxs(l.Fragment,{children:[Va==="Completed"?l.jsx(Ee,{analytics:I,onLoad:v=>{v.trackPageLoaded(G.Event.dashboard),Ve&&!Et&&v.trackTreasuryPromoView("Dashboard Promo Video")}}):null,l.jsx(ss,{maxColumns:e?2:void 0,isAiCfoAccessEnabled:h,onAskAiCfoClick:m,onDragAndDropCard:(v,Ka)=>{const Tt=function(Fe,ze,Pe){const qe=Pe.indexOf(Fe),Ze=Pe.indexOf(ze);if(qe===-1||Ze===-1||qe===Ze)return Pe;const He=[...Pe];return He.splice(qe,1),He.splice(Ze,0,Fe),He}(v,Ka,ie.cardsOrdered);Tt.some((Fe,ze)=>Fe!==ie.cardsOrdered[ze])&&n(Mn(Tt))},dashboardReport:ie,passedCardsOrdered:ie.cardsForDashboardUI,tenantId:A,companyId:P,tenantEmailDomain:u,location:o,navigate:t,isApAgingFeatureEnabled:E,isArAgingFeatureEnabled:he,isBillPayEnabled:wa,isReimbursementEnabled:Ta,isSummaryCardsFiltered:Ne,isForecastOn:Ya,selectedForecastOnDashboard:Ga,isVisitingFirstTime:f,isZeniAccountEnabled:Oe,isRewardsFeatureEnabled:kt,hasZeniAccountsAdminAccess:Oa,isExpenseAutomationEnabledForUser:T&&$e===!1,selectedPeriod:Ea[A],isChargeCardFeatureEnabled:ka,isUserHasCardsAccess:Ra,isUserHasTreasuryAccess:ja,cardsCreditLimit:La,cashbackRate:va,isInterestedInChargeCard:Ma,cardBalanceFetchState:Na,christmasAnimationEnabled:Sa,newYearAnimationEnabled:ya,treasuryFundDetails:Ua,hasUserSeenTreasuryVideo:Et,treasuryFetchState:xa})]})}const is=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"},cs=e=>e.fetchState!=="Error"?e.fetchState:e.reportsInOrder.map(a=>a.fetchState).reduce((a,t)=>a==="In-Progress"||a==="Not-Started"?a:t);function js(){const e=Te(),a=e?.excludedResources?.find(f=>f.resource==="/reports/top_expenses")==null,{useFeatureGate:t}=Ue(),{isFeatureEnabled:n}=t(M.isApAgingFeatureEnabled),{isFeatureEnabled:o}=t(M.isArAgingFeatureEnabled),r=k(f=>L(f)),{isFeatureEnabled:s}=t(M.isDebitCardFeatureEnabled),i=Qn(s,r),d=Wn(r);return i===!0||d===!0?l.jsx(at,{children:l.jsx(D,{path:"/*",element:l.jsx(_o,{})})}):l.jsxs(at,{children:[l.jsx(D,{path:"/",element:l.jsx(rs,{})}),l.jsx(D,{path:"cash_balance/*",element:l.jsx(Pt,{})}),l.jsx(D,{path:"card_balance/*",element:l.jsx(Pt,{})}),l.jsx(D,{path:"operating_expenses/*",element:l.jsx(Q,{})}),l.jsx(D,{path:"operating_expenses/forecast/*",element:l.jsx(Je,{})}),l.jsx(D,{path:"revenue/forecast/*",element:l.jsx(Je,{})}),l.jsx(D,{path:"revenue/*",element:l.jsx(Q,{})}),l.jsx(D,{path:"net_burn_or_income/forecast/*",element:l.jsx(Je,{})}),l.jsx(D,{path:"net_burn_or_income/*",element:l.jsx(Q,{})}),n===!0&&l.jsxs(l.Fragment,{children:[l.jsx(D,{path:"accounts_payable_aging/*",element:l.jsx(yo,{})}),l.jsx(D,{path:"accounts_payable_aging/:vendorId/:reportDate/*",element:l.jsx(So,{})})]}),o&&l.jsxs(l.Fragment,{children:[l.jsx(D,{path:"accounts_receivable_aging/:customerId/:reportDate/*",element:l.jsx(vo,{})}),l.jsx(D,{path:"accounts_receivable_aging/*",element:l.jsx(Io,{})})]}),l.jsx(D,{path:"cash_position/*",element:l.jsx(Q,{})}),l.jsx(D,{path:"top_expenses/*",element:a===!0?l.jsx(Q,{}):l.jsx(ke,{})}),l.jsx(D,{path:"cash_in_cash_out/*",element:l.jsx(Q,{})}),l.jsx(D,{path:"company_details",element:l.jsx(Co,{})}),l.jsx(D,{path:"referrals/*",element:l.jsx(ko,{})}),l.jsx(D,{path:"*",element:l.jsx(ke,{})})]})}export{js as default};
20
+ `,le=3,bt=1;function Wo({fetchState:e,firstMonthOfFY:a,reportId:t,forecastId:n}){const o=q(),r=z(),{tenantEmailDomain:s}=K();let i;xe({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(qo,{...d});break;case"net_burn_or_income":i=l.jsx(Go,{...d});break;case"cash_position":i=l.jsx(Mo,{...d});break;case"top_expenses":i=l.jsx(Jo,{...d});break;case"cash_in_cash_out":i=l.jsx(Ro,{...d});break;default:console.error(`${t} is not supported!`),i=null}return i!=null?l.jsx(Qo,{children:i}):null}function Q(){const e=z(),a=V(),{forecastId:t}=K();let n="Not-Started";const o=k(c=>pt(c).fetchState),r=k(c=>ht(c).fetchState),s=k(c=>it(c).fetchState),i=k(c=>c.cashPositionState.fetchState),d=k(c=>c.topExState.fetchState),f=k(c=>c.cashInCashOutState.fetchState);if(j.getSignedInUser()==null)throw Error("Can't access dashboard detail without signing in...");const g=k(c=>L(c)),C=g?.company?.companyInfo?.firstMonthOfFY??1,p=Gt((c=>{const u=Nt(c,"/").split("/");return t!=null?u[u.length-3]:u[u.length-1]})(e.pathname));switch(p){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=f;break;default:console.error(`${p} is not supported!`)}return _.useEffect(()=>{n==="Not-Started"&&function(c,u,h,m){switch(u){case"operating_expenses":c(ia(!0)),m!=null&&(c(ce(h,!0,le,{id:m,index:0})),c(Qt(!1,m)));break;case"revenue":c(ra(!0)),m!=null&&(c(ce(h,!0,le,{id:m,index:0})),c(ea(!1,m)));break;case"net_burn_or_income":c(sa(!0)),m!=null&&(c(ce(h,!0,le,{id:m,index:0})),c(Ht(!1,m)));break;case"cash_position":c(oa(!0));break;case"top_expenses":c(na());break;case"cash_in_cash_out":c(aa());break;default:throw new Error(`report type ${u} is not yet supported`)}}(a,p,C,t)},[t]),l.jsxs(l.Fragment,{children:[n==="Completed"?l.jsx(Ee,{analytics:I,onLoad:c=>((u,h)=>{const m=e.state?.referrer;switch(h){case"operating_expenses":u.trackPageLoaded(G.Event.operatingExpenses,m);break;case"revenue":u.trackPageLoaded(G.Event.revenues,m);break;case"net_burn_or_income":u.trackPageLoaded(G.Event.burnRate,m);break;case"cash_position":u.trackPageLoaded(G.Event.cashPosition,m);break;case"top_expenses":u.trackPageLoaded(G.Event.topExpenses,m);break;case"cash_in_cash_out":u.trackPageLoaded(G.Event.cashInCashOut,m);break;default:console.error(`Analytics: Not tracking Page Loaded for ${h}!`)}})(c,p)}):null,l.jsx(Wo,{firstMonthOfFY:C,fetchState:n,reportId:p,forecastId:t})]})}var Qe=typeof navigator<"u"&&navigator.userAgent.toLowerCase().indexOf("firefox")>0;function We(e,a,t,n){e.addEventListener?e.addEventListener(a,t,n):e.attachEvent&&e.attachEvent("on".concat(a),function(){t(window.event)})}function Ca(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 ba(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 _t={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,"-":Qe?173:189,"=":Qe?61:187,";":Qe?59:186,"'":222,"[":219,"]":221,"\\":220},W={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},st={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},F={},je=1;je<20;je++)_t["f".concat(je)]=111+je;var x=[],Bt=!1,_a="all",Rt=[],Ge=function(e){return _t[e.toLowerCase()]||W[e.toLowerCase()]||e.toUpperCase().charCodeAt(0)};function jt(e){_a=e||"all"}function _e(){return _a||"all"}var Xe=function(e){var a=e.key,t=e.scope,n=e.method,o=e.splitKey,r=o===void 0?"+":o;ba(a).forEach(function(s){var i=s.split(r),d=i.length,f=i[d-1],g=f==="*"?"*":Ge(f);if(F[g]){t||(t=_e());var C=d>1?Ca(W,i):[];F[g]=F[g].filter(function(p){return!((!n||p.method===n)&&p.scope===t&&function(c,u){for(var h=c.length>=u.length?c:u,m=c.length>=u.length?u:c,b=!0,S=0;S<h.length;S++)m.indexOf(h[S])===-1&&(b=!1);return b}(p.mods,C))})}})};function Lt(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 Mt(e,a){var t=F["*"],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(u){var h=st[u];e[u]&&x.indexOf(h)===-1?x.push(h):!e[u]&&x.indexOf(h)>-1?x.splice(x.indexOf(h),1):u==="metaKey"&&e[u]&&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,W)W[o]===n&&(U[o]=!0);if(!t)return}for(var r in R)Object.prototype.hasOwnProperty.call(R,r)&&(R[r]=e[st[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=_e();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)&&Lt(e,t[i],s,a);if(n in F){for(var d=0;d<F[n].length;d++)if((e.type==="keydown"&&F[n][d].keydown||e.type==="keyup"&&F[n][d].keyup)&&F[n][d].key){for(var f=F[n][d],g=f.splitKey,C=f.key.split(g),p=[],c=0;c<C.length;c++)p.push(Ge(C[c]));p.sort().join("")===x.sort().join("")&&Lt(e,f,s,a)}}}}function U(e,a,t){x=[];var n=ba(e),o=[],r="all",s=document,i=0,d=!1,f=!0,g="+",C=!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&&(f=a.keydown),a.capture!==void 0&&(C=a.capture),typeof a.splitKey=="string"&&(g=a.splitKey)),typeof a=="string"&&(r=a);i<n.length;i++)o=[],(e=n[i].split(g)).length>1&&(o=Ca(W,e)),(e=(e=e[e.length-1])==="*"?"*":Ge(e))in F||(F[e]=[]),F[e].push({keyup:d,keydown:f,scope:r,mods:o,shortcut:n[i],method:t,key:n[i],splitKey:g,element:s});s!==void 0&&!function(p){return Rt.indexOf(p)>-1}(s)&&window&&(Rt.push(s),We(s,"keydown",function(p){Mt(p,s)},C),Bt||(Bt=!0,We(window,"focus",function(){x=[]},C)),We(s,"keyup",function(p){Mt(p,s),function(c){var u=c.keyCode||c.which||c.charCode,h=x.indexOf(u);if(h>=0&&x.splice(h,1),c.key&&c.key.toLowerCase()==="meta"&&x.splice(0,x.length),u!==93&&u!==224||(u=91),u in R)for(var m in R[u]=!1,W)W[m]===u&&(U[m]=!1)}(p)},C))}var et={setScope:jt,getScope:_e,deleteScope:function(e,a){var t,n;for(var o in e||(e=_e()),F)if(Object.prototype.hasOwnProperty.call(F,o))for(t=F[o],n=0;n<t.length;)t[n].scope===e?t.splice(n,1):n++;_e()===e&&jt(a||"all")},getPressedKeyCodes:function(){return x.slice(0)},isPressed:function(e){return typeof e=="string"&&(e=Ge(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(F).forEach(function(t){var n=F[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(F).forEach(function(s){return delete F[s]});else if(Array.isArray(e))e.forEach(function(s){s.key&&Xe(s)});else if(typeof e=="object")e.key&&Xe(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=""),Xe({key:e,scope:o,method:r,splitKey:"+"})}},keyMap:_t,modifier:W,modifierMap:st};for(var tt in et)Object.prototype.hasOwnProperty.call(et,tt)&&(U[tt]=et[tt]);if(typeof window<"u"){var Xo=window.hotkeys;U.noConflict=function(e){return e&&window.hotkeys===U&&(window.hotkeys=Xo),U},window.hotkeys=U}U.filter=function(){return!0};var Ut=function(e,a){var t=e.target,n=t&&t.tagName;return!!(n&&a&&a.includes(n))};function es(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,f=o.filterPreventDefault,g=f===void 0||f,C=o.enabled,p=C===void 0||C,c=o.enableOnContentEditable,u=c!==void 0&&c,h=_.useRef(null),m=_.useCallback(function(b,S){var A,P;return s&&!s(b)?!g:!!(Ut(b,["INPUT","TEXTAREA","SELECT"])&&!Ut(b,r)||(A=b.target)!=null&&A.isContentEditable&&!u)||!!(h.current===null||document.activeElement===h.current||(P=h.current)!=null&&P.contains(document.activeElement))&&(a(b,S),!0)},n?[h,r,s].concat(n):[h,r,s]);return _.useEffect(function(){if(p)return i&&d!==!0&&(t.keydown=!1),U(e,t||{},m),function(){return U.unbind(e,m)};U.unbind(e,m)},[m,e,p]),h}U.isPressed;const ts=["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"],as=(e,a,t,n,o)=>({card:{dimension:ft(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}),Ce=(e,a,t,n,o)=>({card:{dimension:ft(t),cardType:n,cardIndex:o,fetchState:a,disableAnimations:!1},data:e}),ns=(e,a,t,n)=>Ce(void 0,e,be,a,t),os=(e,a,t,n,o)=>({card:{dimension:ft(be),cardType:a,cardIndex:t,fetchState:e,disableAnimations:!1},data:{funds:n,hasUserSeenVideo:o,videoUrl:"https://www.youtube.com/watch?v=sqvJWKCMZgk"}}),ss=H(function(e,a){const t=cs(a.dashboardReport),n=a.passedCardsOrdered,o=a.dashboardReport.reportsInOrder,{isInterestedInChargeCard:r,cardsCreditLimit:s,cashbackRate:i,treasuryFundDetails:d,hasUserSeenTreasuryVideo:f,treasuryFetchState:g}=a;let C=n.map((p,c)=>{if(p==="reimbursement_promo_card"||p==="bill_pay_promo_card")return ns(t,p,c);if(p==="zeni_promo_card")return Ce({isExpressedInterest:r,creditLimit:s,cashbackRate:i,fetchState:"Completed"},a.cardBalanceFetchState,be,p,c);if(p==="treasury_promo_card")return os(g,p,c,d,f);if(p==="information_card")return Ce(void 0,"Completed",be,p,c);{const u=o.find(h=>h?.reportId===p);return u?function(h,m,b,S){const A=h.reportId;switch(A){case"card_balance":case"cash_balance":return[as(h,m,b,A,S)];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[Ce(h,m,b,A,S)];case"net_burn_or_income_story_card":return[Ce(h,m,b,"net_burn_or_income_story_card",S)];default:return console.error(`card type ${A} not yet supported!`),[]}}(u,u.fetchState,be,c):[]}}).flat();return a.isSummaryCardsFiltered===!0&&(C=C.filter(p=>ts.includes(p.card.cardType)==0).filter(p=>{const c=p.data?.availableNumberOfPeriods;return c!=null?c>0:p.card.cardType!="top_expenses"||p.data==null||function(u){if(u==null||u.length===0)return!0;let h=!0;for(const m of u)if(m.balance.available.amount!==0){h=!1;break}return h}(p.data.topExpenses.accountsOrdered)===!1})),{cardDataArray:C,autoCompleteData:{autoCompleteText:e.entityAutoCompleteState.autoCompleteText.navbar,entityAutoCompleteView:X(e,"navbar")},analytics:I,isReimbursementEnabled:a.isReimbursementEnabled,isBillPayEnabled:a.isBillPayEnabled}},function(e,a){const t=a.tenantId,n=j.getSignedInUser();return{cardActions:{onCardClick:(o,r,s,i)=>{if(console.warn(`onCardClick at ${o} for the type ${r}`),r==="zeni_promo_card"&&i!=null)I.trackDashboardCardClicked("cards promo",2),I.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&&I.trackDashboardCardClicked("rewards promo",o+1),a.navigate("../../rewards/refer",{state:{referrer:s}})):r==="expense_automation_card"?(I.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,f,g){switch(d){case"card_balance":i($t());break;case"cash_balance":i(Vt());break;case"operating_expenses":i(ia(!0));break;case"revenue":i(ra(!0));break;case"net_burn_or_income":i(sa(!0));break;case"net_burn_or_income_story_card":i(Jn(!0));break;case"cash_position":i(oa(!0));break;case"top_expenses":i(na());break;case"cash_in_cash_out":i(aa());break;case"insights_dashboard":i(Hn());break;case"bill_pay_card":i(Zn());break;case"reimbursement_card":i(qn());break;case"company_details":i(zn(f));break;case"task_card":i($n());break;case"accounts_payable_aging":g.includes("accounts_payable_aging")===!1&&i(nt(de()));break;case"accounts_receivable_aging":i(ot(de()));break;case"zeni_accounts_promo_card":g.includes("zeni_accounts_promo_card")===!1&&i(Kt());break;case"rewards_card":g.includes("rewards_card")===!1&&i(Kn(!0));break;default:throw new Error(`report type ${d} is not yet supported`)}}(e,r,a.companyId,s)},onTimeframeChange:(o,r)=>{I.trackTimeframeSwitch(ha(r),is(o),"Dashboard"),function(s,i,d){switch(i){case"operating_expenses":case"revenue":case"net_burn_or_income":case"cash_position":s(ue(d));break;case"top_expenses":s(ta(d));break;default:throw new Error(`report type ${i} doesn't support changeTimeframe`)}}(e,o,r)},onUpdateSelectedInsightIndex:o=>{e(Vn(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=O(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=O(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=O(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){j.saveTreasuryPopupSeen(a.tenantEmailDomain,!0);const s="../treasury",i=O(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"&&(I.trackUpdateBurnRateCalculatorSettings(r,s,Gn(s)),e(Nn(t,r,s)))},onVideoPlay:()=>{e(Yn())},onVideoClose:()=>{e(Un())}},autoCompleteActions:{onAutoCompleteInputChange:o=>{o.trim().length>=2?e(ee({searchString:o,searchOrigin:"navbar"})):o.trim().length===0&&e(Z("navbar"))},onCancelAutoComplete:()=>{e(Z("navbar"))},onAutoCompleteEntity:o=>{let r="";r=o.type!=="vendor"||o.detailType!=="bank_merchant"&&o.detailType!=="card_merchant"?ae(o,a.tenantEmailDomain):go(o.zeniId,o.qboId,a.tenantEmailDomain);const s=O(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(r,{state:{pathnameStackToGoBack:s,referrer:"Search"}})}}}})(fo);function rs(){const{isAiCfoOpen:e,setIsAiCfoOpen:a}=Ae(),t=q(),n=V(),o=z(),r=j.getSignedInUser(),{useFeatureGate:s,useDynamicConfig:i}=Ue(),d=Se(r),[f,g]=_.useState(!1),[C,p]=_.useState(!1),c=da(),{tenantEmailDomain:u}=K(),{isAiCfoAccessEnabled:h,onAskAiCfoClick:m}=Ye({isAiCfoOpen:e,setIsAiCfoOpen:a,mobileExploreReferrer:"Dashboard"}),b=k(v=>v.tenantState.fetchState==="Completed"||v.tenantState.activeTenantFetchState.fetchState==="Completed"?L(v):void 0),S=b??j.getSignedInUserTenant(u),A=S.tenantId,P=S.companyId;_.useEffect(()=>{f===!1&&o.state?.message==="activation"&&(n(Fn(P)),g(!0))},[o.state,f,P,n]),_.useEffect(()=>{c&&!C&&o.state?.message==="open_ai_cfo_drawer"&&(a(!0),p(!0),t(o.pathname,{replace:!0,state:{...o.state,message:void 0}}))},[o.state,C,c,a,t,o.pathname]);const{isFeatureEnabled:E}=s(M.isApAgingFeatureEnabled),{isFeatureEnabled:y}=s(M.isExpenseAutomationEnabled),{isFeatureEnabled:w}=s(M.isExpenseAutomationEnabledV2),T=w||y&&d,{isFeatureEnabled:B}=s(M.isTreasuryEnabled),pe=mo(T),{isFeatureEnabled:he}=s(M.isArAgingFeatureEnabled),{isFeatureEnabled:Oe}=s(M.isDepositAccountsFeatureEnabled),{isFeatureEnabled:kt}=s(M.isReferralFeatureEnabled),{isFeatureEnabled:ka}=s(M.isChargeCardFeatureEnabled),{isFeatureEnabled:Sa}=s(M.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:ya}=s(M.isDashboardSidebarNewYearAnimationEnabled),{configValue:St}=i(ua.zeniCardsConfig),va=St.charge_card_cashback_rate_per_transaction==null?.0175:St.charge_card_cashback_rate_per_transaction;if(o.state?.message==="activation"){const v=po(o.state?.pathnameStackToGoBack);t(o.pathname,{state:{...o.state,message:void 0,pathnameStackToGoBack:v.newStack}})}const[yt,Ia]=_.useState(!1),[Ne,Aa]=_.useState(!1);es("command+p, Control+p",v=>{Aa(!Ne),v.preventDefault()},{enableOnContentEditable:!0,enableOnTags:["INPUT","SELECT","TEXTAREA"]},[Ne]);const vt=b?.externalConnections?.accounting[0]?.isValid;if(r==null)throw Error("Can't access dashboard without signing in...");const ne=k(v=>L(v)?.excludedResources),Ea=k(v=>v.expenseAutomationViewState.selectedPeriodByTenantId),Ta=!!b?.companyReimbursementInfo?.info?.isReimbursementEnabled,wa=!!b?.companyBillPayInfo?.info?.isBillPayEnabled,xa=k(v=>v.treasurySetupViewState.treasuryFundsDetails).fetchStatus.fetchState,Da=b?.company!=null&&Pn(b.company),Ve=B&&Da,Ke=Te(),Oa=rt(Ke?.loggedInUserRoleMap),Y=[],It=ne?.resources?.find(v=>v.resource==="/reports/top_expenses")==null,Fa=ne?.resources?.find(v=>v.resource==="/reports/task_card")==null,$e=b?.userRole!=null&&Wt(b?.userRole),Pa=ne?.resources?.find(v=>v.resource==="/bills")==null&&!$e,Ba=ne?.resources?.find(v=>v.resource==="/reimbursements")==null,Ra=Bn(Ke?.loggedInUserRoleMap),ja=Rn(Ke?.loggedInUserRoleMap),La=b?.company?.companyChargeCardInfo?.chargeCardsCreditAccountLimit??0,Ma=b?.companyChargeCardInfo?.info?.isCompanyInterestedInChargeCard??!1,Ua=k(v=>v.treasurySetupViewState.treasuryFundsDetails).fundsDetails;It===!1&&Y.push("top_expenses"),Fa===!1&&Y.push("task_card"),Pa===!1&&Y.push("bill_pay_card","bill_pay_promo_card"),E===!1&&Y.push("accounts_payable_aging"),he===!1&&Y.push("accounts_receivable_aging"),(T===!1||$e)&&Y.push("expense_automation_card"),Ba===!1&&Y.push("reimbursement_card","reimbursement_promo_card"),Oe===!1&&Y.push("zeni_accounts_promo_card"),kt===!1&&Y.push("rewards_card"),Ve===!1&&Y.push("treasury_promo_card");const{areTenantIdsInSync:At}=ho();_.useLayoutEffect(()=>{yt&&pe===T||vt!==!0||!At||ne?.fetchState!=="Completed"&&ne?.fetchState!=="Error"||(Ia(!0),n(jn(r.userId,P,A,!0,!1,Y)))},[yt,r,A,n,It,vt,ne?.fetchState,At]);const Ya=k(v=>v.reportUIOptionsState.forecastOnDashboard.isForecastModeOn),Ga=k(v=>v.revenueState.uiState.selectedForecast?.id),Na=k(v=>v.cardBalanceState.fetchState),ie=k(v=>Ln(v,Y,r,w,y,Ve)),Va=ie.fetchState;xe({isDataReady:!0});const Et=b?.isTreasuryVideoViewed===!0||ie.isTreasuryVideoClosed===!0;return l.jsxs(l.Fragment,{children:[Va==="Completed"?l.jsx(Ee,{analytics:I,onLoad:v=>{v.trackPageLoaded(G.Event.dashboard),Ve&&!Et&&v.trackTreasuryPromoView("Dashboard Promo Video")}}):null,l.jsx(ss,{maxColumns:e?2:void 0,isAiCfoAccessEnabled:h,onAskAiCfoClick:m,onDragAndDropCard:(v,Ka)=>{const Tt=function(Fe,ze,Pe){const qe=Pe.indexOf(Fe),Ze=Pe.indexOf(ze);if(qe===-1||Ze===-1||qe===Ze)return Pe;const He=[...Pe];return He.splice(qe,1),He.splice(Ze,0,Fe),He}(v,Ka,ie.cardsOrdered);Tt.some((Fe,ze)=>Fe!==ie.cardsOrdered[ze])&&n(Mn(Tt))},dashboardReport:ie,passedCardsOrdered:ie.cardsForDashboardUI,tenantId:A,companyId:P,tenantEmailDomain:u,location:o,navigate:t,isApAgingFeatureEnabled:E,isArAgingFeatureEnabled:he,isBillPayEnabled:wa,isReimbursementEnabled:Ta,isSummaryCardsFiltered:Ne,isForecastOn:Ya,selectedForecastOnDashboard:Ga,isVisitingFirstTime:f,isZeniAccountEnabled:Oe,isRewardsFeatureEnabled:kt,hasZeniAccountsAdminAccess:Oa,isExpenseAutomationEnabledForUser:T&&$e===!1,selectedPeriod:Ea[A],isChargeCardFeatureEnabled:ka,isUserHasCardsAccess:Ra,isUserHasTreasuryAccess:ja,cardsCreditLimit:La,cashbackRate:va,isInterestedInChargeCard:Ma,cardBalanceFetchState:Na,christmasAnimationEnabled:Sa,newYearAnimationEnabled:ya,treasuryFundDetails:Ua,hasUserSeenTreasuryVideo:Et,treasuryFetchState:xa})]})}const is=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"},cs=e=>e.fetchState!=="Error"?e.fetchState:e.reportsInOrder.map(a=>a.fetchState).reduce((a,t)=>a==="In-Progress"||a==="Not-Started"?a:t);function js(){const e=Te(),a=e?.excludedResources?.find(f=>f.resource==="/reports/top_expenses")==null,{useFeatureGate:t}=Ue(),{isFeatureEnabled:n}=t(M.isApAgingFeatureEnabled),{isFeatureEnabled:o}=t(M.isArAgingFeatureEnabled),r=k(f=>L(f)),{isFeatureEnabled:s}=t(M.isDebitCardFeatureEnabled),i=Qn(s,r),d=Wn(r);return i===!0||d===!0?l.jsx(at,{children:l.jsx(D,{path:"/*",element:l.jsx(_o,{})})}):l.jsxs(at,{children:[l.jsx(D,{path:"/",element:l.jsx(rs,{})}),l.jsx(D,{path:"cash_balance/*",element:l.jsx(Pt,{})}),l.jsx(D,{path:"card_balance/*",element:l.jsx(Pt,{})}),l.jsx(D,{path:"operating_expenses/*",element:l.jsx(Q,{})}),l.jsx(D,{path:"operating_expenses/forecast/*",element:l.jsx(Je,{})}),l.jsx(D,{path:"revenue/forecast/*",element:l.jsx(Je,{})}),l.jsx(D,{path:"revenue/*",element:l.jsx(Q,{})}),l.jsx(D,{path:"net_burn_or_income/forecast/*",element:l.jsx(Je,{})}),l.jsx(D,{path:"net_burn_or_income/*",element:l.jsx(Q,{})}),n===!0&&l.jsxs(l.Fragment,{children:[l.jsx(D,{path:"accounts_payable_aging/*",element:l.jsx(yo,{})}),l.jsx(D,{path:"accounts_payable_aging/:vendorId/:reportDate/*",element:l.jsx(So,{})})]}),o&&l.jsxs(l.Fragment,{children:[l.jsx(D,{path:"accounts_receivable_aging/:customerId/:reportDate/*",element:l.jsx(vo,{})}),l.jsx(D,{path:"accounts_receivable_aging/*",element:l.jsx(Io,{})})]}),l.jsx(D,{path:"cash_position/*",element:l.jsx(Q,{})}),l.jsx(D,{path:"top_expenses/*",element:a===!0?l.jsx(Q,{}):l.jsx(ke,{})}),l.jsx(D,{path:"cash_in_cash_out/*",element:l.jsx(Q,{})}),l.jsx(D,{path:"company_details",element:l.jsx(bo,{})}),l.jsx(D,{path:"referrals/*",element:l.jsx(ko,{})}),l.jsx(D,{path:"*",element:l.jsx(ke,{})})]})}export{js as default};
@@ -1 +1 @@
1
- import{j as v}from"./liveblocks-BmoAyVEe.js";import{a as u}from"./sentry-CCAVv3jj.js";import{h as y,g as b,k as w,u as A,N}from"./core-zBodvsmj.js";import{Ih as k,eN as _,fj as U,Ii as L,mm as R,Ij as j}from"./zeni-epic-state-BTJNQUbs.js";import{u as z,z as f,L as T,t as S,D as O,b as $}from"./index-BEtykuxp.js";import"./mui-DLJkInA_.js";import{t as P}from"./getLocaleForTenant-kAjI6Fe2.js";import"./recharts-CBJVI15_.js";import"./analytics-BYXYUYaV.js";import"./plaid-C7DViorD.js";import"./dnd-DXQzuHAR.js";import"./stripe-DMRn4zHo.js";import"./lottie-7jInd46q.js";import"./lexical-DftjmMYF.js";import"./pdf-D8Yl-cKT.js";import"./utils-IcNZtE46.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]="4db9fc4c-2401-4b72-b102-b75e5e095755",t._sentryDebugIdIdentifier="sentry-dbid-4db9fc4c-2401-4b72-b102-b75e5e095755")}catch{}})();const Q=w(function(t){return{fetchState:t.tenantState.fetchState,activeTenantFetchState:t.tenantState.activeTenantFetchState.fetchState,currentTenant:_(t),tenantsInOrder:j(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(N,{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=>k(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(R(e.userId)))},[n,a,i,d,t]),u.useEffect(()=>{f.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())},[m.tenantsCoreDetailsInOrder,n]),u.useEffect(()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||(O.updateAppLocaleID(P(c)),o())},[n,a,c]),v.jsx(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-CFneZw8x.js";import{a as u}from"./sentry-Dhi05Xar.js";import{h as y,g as b,k as w,u as A,N}from"./core-DK_vDmT8.js";import{Ih as k,eN as _,fj as U,Ii as L,mm as R,Ij as j}from"./zeni-epic-state-BL_LeZIj.js";import{u as z,z as f,L as T,t as S,D as O,b as $}from"./index-BllLxW2o.js";import"./mui-Cf9-_L5d.js";import{t as P}from"./getLocaleForTenant-BzhpZyOL.js";import"./recharts-DGCFoGqb.js";import"./analytics-DlMpWLtY.js";import"./plaid-COLZDQ-K.js";import"./dnd-CI1Bz-yv.js";import"./stripe-DMRn4zHo.js";import"./lottie-DTY7lPgA.js";import"./lexical-2V5hcKhY.js";import"./pdf-DO37o4P_.js";import"./utils-DkqKuJOX.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]="4db9fc4c-2401-4b72-b102-b75e5e095755",t._sentryDebugIdIdentifier="sentry-dbid-4db9fc4c-2401-4b72-b102-b75e5e095755")}catch{}})();const Q=w(function(t){return{fetchState:t.tenantState.fetchState,activeTenantFetchState:t.tenantState.activeTenantFetchState.fetchState,currentTenant:_(t),tenantsInOrder:j(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(N,{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=>k(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(R(e.userId)))},[n,a,i,d,t]),u.useEffect(()=>{f.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())},[m.tenantsCoreDetailsInOrder,n]),u.useEffect(()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||(O.updateAppLocaleID(P(c)),o())},[n,a,c]),v.jsx(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-BmoAyVEe.js";import{j as w,u as C,g as h,k as A,l as B}from"./core-zBodvsmj.js";import{Md as k,Mk as _,fA as L,fz as q,fy as J,io as W,Jl as K,pw as Q,eN as V,LL as D,il as T,Me as S,Mn as F,ij as G,iH as j}from"./zeni-epic-state-BTJNQUbs.js";import{bm as X,q as N,a as R,z as U,h as z,p,d as v,B as H,bn as Y,o as M,bo as ee,s as te}from"./index-BEtykuxp.js";import{n as O}from"./mui-DLJkInA_.js";import"./sentry-CCAVv3jj.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]="d2d0982f-59c4-44a2-9afd-21abfaa16a1f",e._sentryDebugIdIdentifier="sentry-dbid-d2d0982f-59c4-44a2-9afd-21abfaa16a1f")}catch{}})();const ae=A(null,function(e,t){return{onSaveVendor:a=>{e(W(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(K("common")),a!=null&&e(Q(a))},onGetOtp:a=>{e(J(a,"BillPayVendor"))},onResendOtp:a=>{e(q(a,"BillPayVendor"))},onVerifyOtp:(a,n)=>{e(L(a,n,"BillPayVendor"))},onVerifyOtpSuccess:(a,n,o)=>{e(_(a,n,o))}}})(X);function Z({vendorId:e,billId:t,isExpressPayPage:a}){const n=w(),o=C(),s=h(r=>k(r,e));return l.jsx(ae,{location:o,navigate:n,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:a??!1})}const ne=O.div`
1
+ import{j as l}from"./liveblocks-CFneZw8x.js";import{j as w,u as C,g as h,k as A,l as B}from"./core-DK_vDmT8.js";import{Md as k,Mk as _,fA as L,fz as q,fy as J,io as W,Jl as K,pw as Q,eN as V,LL as D,il as T,Me as S,Mn as F,ij as G,iH as j}from"./zeni-epic-state-BL_LeZIj.js";import{bm as X,q as N,a as R,z as U,h as z,p,d as v,B as H,bn as Y,o as M,bo as ee,s as te}from"./index-BllLxW2o.js";import{n as O}from"./mui-Cf9-_L5d.js";import"./sentry-Dhi05Xar.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]="d2d0982f-59c4-44a2-9afd-21abfaa16a1f",e._sentryDebugIdIdentifier="sentry-dbid-d2d0982f-59c4-44a2-9afd-21abfaa16a1f")}catch{}})();const ae=A(null,function(e,t){return{onSaveVendor:a=>{e(W(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(K("common")),a!=null&&e(Q(a))},onGetOtp:a=>{e(J(a,"BillPayVendor"))},onResendOtp:a=>{e(q(a,"BillPayVendor"))},onVerifyOtp:(a,n)=>{e(L(a,n,"BillPayVendor"))},onVerifyOtpSuccess:(a,n,o)=>{e(_(a,n,o))}}})(X);function Z({vendorId:e,billId:t,isExpressPayPage:a}){const n=w(),o=C(),s=h(r=>k(r,e));return l.jsx(ae,{location:o,navigate:n,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:a??!1})}const ne=O.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as i}from"./liveblocks-BmoAyVEe.js";import{q as l,y as f,h as c}from"./index-BEtykuxp.js";import{D as b}from"./mui-DLJkInA_.js";import"./sentry-CCAVv3jj.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]="2f6b3a1f-ad67-4708-8318-0b908c62b600",e._sentryDebugIdIdentifier="sentry-dbid-2f6b3a1f-ad67-4708-8318-0b908c62b600")}catch{}})();const p={drawerLeftMargin:new f(0,0,240)};function h(e){const{isOpen:r,drawerLeftMargin:o,children:t,onClose:a}=e,n=l(),s=o?.valuePx(n)??p.drawerLeftMargin.valuePx(n),d=c();return i.jsx(b,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${s})`}},slotProps:{backdrop:{style:{backgroundColor:d.colors.black,opacity:.8,cursor:"pointer"}}},onClose:a,children:t})}export{h as D};
1
+ import{j as i}from"./liveblocks-CFneZw8x.js";import{q as l,y as f,h as c}from"./index-BllLxW2o.js";import{D as b}from"./mui-Cf9-_L5d.js";import"./sentry-Dhi05Xar.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]="2f6b3a1f-ad67-4708-8318-0b908c62b600",e._sentryDebugIdIdentifier="sentry-dbid-2f6b3a1f-ad67-4708-8318-0b908c62b600")}catch{}})();const p={drawerLeftMargin:new f(0,0,240)};function h(e){const{isOpen:r,drawerLeftMargin:o,children:t,onClose:a}=e,n=l(),s=o?.valuePx(n)??p.drawerLeftMargin.valuePx(n),d=c();return i.jsx(b,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${s})`}},slotProps:{backdrop:{style:{backgroundColor:d.colors.black,opacity:.8,cursor:"pointer"}}},onClose:a,children:t})}export{h as D};
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-BmoAyVEe.js";import{a as d}from"./sentry-CCAVv3jj.js";import{j as B,h as A,u as J,l as q,g as l,N as F,k as N,n as R,o as W}from"./core-zBodvsmj.js";import{Ks as _,eN as M,JR as O,kr as K,GA as I,Kx as Y,Jk as $,jr as z,GB as S,JW as V,JX as X,Jm as H,Jl as L}from"./zeni-epic-state-BTJNQUbs.js";import{aM as Q,e as U,p as Z,s as tt}from"./index-BEtykuxp.js";import"./mui-DLJkInA_.js";import{d as k}from"./decodeURIComponentSafe-BxqXitkH.js";import{w as et}from"./withTransactionSidePanel-BXzIWNiu.js";import{e as at,b as nt}from"./routePaths-C57Y-8ts.js";import"./recharts-CBJVI15_.js";import"./analytics-BYXYUYaV.js";import"./plaid-C7DViorD.js";import"./dnd-DXQzuHAR.js";import"./stripe-DMRn4zHo.js";import"./lottie-7jInd46q.js";import"./lexical-DftjmMYF.js";import"./pdf-D8Yl-cKT.js";import"./utils-IcNZtE46.js";import"./useAskAiCfoHostNavButtonProps-gYNUsHfd.js";import"./useFetchSuggestedQuestionsWhenReady-ByvvCtR-.js";import"./TransactionDetailScreen-B-BVFEpP.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]="46a2aff8-5595-4dcf-8450-10f335bde161",a._sentryDebugIdIdentifier="sentry-dbid-46a2aff8-5595-4dcf-8450-10f335bde161")}catch{}})();const ot=N(function(a,t){const e=t.entity,o=Y(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:$(a,"common")},trendWithTransactionsReport:o,analytics:U,isAccountingClassesEnabled:z(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(H({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(L("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(V()),a(X()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??b();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(S(t.entity,"EntityDetail",{timeframe:"quarter",timePeriod:t.defaultTransactionTimePeriod}));else{const o=e.currentTimePeriod==null?e.addTimePeriod:{startDate:e.addTimePeriod.startDate,endDate:e.currentTimePeriod.endDate};a(I(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(Q),it=et(function({entityType:a,...t}){const e=B(),o=A(),c=J(),[m,T]=d.useState(!1),[h,D]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:x,entityNameEncoded:j}=q(),r=k(x??""),f=k(j??""),p=rt(r,f),G=[r,f].filter(n=>n!=null),i={name:f,id:r,type:a,zeniId:r,qboId:r},g=l(n=>_(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),v=l(n=>M(n).company?.companyInfo.firstMonthOfFY??1),u=l(n=>O(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&p===!0&&(T(!0),o(K(i)))},[m,p,i]);const E=l(n=>n.trendState.fetchState),P=u?.selectedPeriod?.timePeriod??g,w=function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y}(u?.selectedPeriod?.timePeriod,g);return d.useEffect(()=>{m===!0&&h===!1&&E==="Completed"&&(D(!0),P!=null&&o(I(i,"EntityDetail",{timeframe:u?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))},[m,h,E]),p?s.jsx(ot,{firstMonthOfFY:v,tenantEmailDomain:C,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:w,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(F,{to:b(G.length)})}),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,b=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function jt({entityType:a}){return s.jsx(R,{children:s.jsx(W,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{jt as EntityDetailRoutes,jt as default};
1
+ import{j as s}from"./liveblocks-CFneZw8x.js";import{a as d}from"./sentry-Dhi05Xar.js";import{j as B,h as A,u as J,l as q,g as l,N as F,k as N,n as R,o as W}from"./core-DK_vDmT8.js";import{Ks as _,eN as M,JR as O,kr as K,GA as I,Kx as Y,Jk as $,jr as z,GB as S,JW as V,JX as X,Jm as H,Jl as L}from"./zeni-epic-state-BL_LeZIj.js";import{aM as Q,e as U,p as Z,s as tt}from"./index-BllLxW2o.js";import"./mui-Cf9-_L5d.js";import{d as k}from"./decodeURIComponentSafe-D_yxDRpD.js";import{w as et}from"./withTransactionSidePanel-BQfYUuvc.js";import{e as at,b as nt}from"./routePaths-DP6g0Tqx.js";import"./recharts-DGCFoGqb.js";import"./analytics-DlMpWLtY.js";import"./plaid-COLZDQ-K.js";import"./dnd-CI1Bz-yv.js";import"./stripe-DMRn4zHo.js";import"./lottie-DTY7lPgA.js";import"./lexical-2V5hcKhY.js";import"./pdf-DO37o4P_.js";import"./utils-DkqKuJOX.js";import"./useAskAiCfoHostNavButtonProps-Cm6zAMRj.js";import"./useFetchSuggestedQuestionsWhenReady-Dw2xWQ9g.js";import"./TransactionDetailScreen-B0frSfDq.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]="46a2aff8-5595-4dcf-8450-10f335bde161",a._sentryDebugIdIdentifier="sentry-dbid-46a2aff8-5595-4dcf-8450-10f335bde161")}catch{}})();const ot=N(function(a,t){const e=t.entity,o=Y(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:$(a,"common")},trendWithTransactionsReport:o,analytics:U,isAccountingClassesEnabled:z(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(H({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(L("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(V()),a(X()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??b();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(S(t.entity,"EntityDetail",{timeframe:"quarter",timePeriod:t.defaultTransactionTimePeriod}));else{const o=e.currentTimePeriod==null?e.addTimePeriod:{startDate:e.addTimePeriod.startDate,endDate:e.currentTimePeriod.endDate};a(I(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(Q),it=et(function({entityType:a,...t}){const e=B(),o=A(),c=J(),[m,T]=d.useState(!1),[h,D]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:x,entityNameEncoded:j}=q(),r=k(x??""),f=k(j??""),p=rt(r,f),G=[r,f].filter(n=>n!=null),i={name:f,id:r,type:a,zeniId:r,qboId:r},g=l(n=>_(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),v=l(n=>M(n).company?.companyInfo.firstMonthOfFY??1),u=l(n=>O(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&p===!0&&(T(!0),o(K(i)))},[m,p,i]);const E=l(n=>n.trendState.fetchState),P=u?.selectedPeriod?.timePeriod??g,w=function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y}(u?.selectedPeriod?.timePeriod,g);return d.useEffect(()=>{m===!0&&h===!1&&E==="Completed"&&(D(!0),P!=null&&o(I(i,"EntityDetail",{timeframe:u?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))},[m,h,E]),p?s.jsx(ot,{firstMonthOfFY:v,tenantEmailDomain:C,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:w,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(F,{to:b(G.length)})}),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,b=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function jt({entityType:a}){return s.jsx(R,{children:s.jsx(W,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{jt as EntityDetailRoutes,jt as default};
@@ -1,4 +1,4 @@
1
- import{j as p}from"./liveblocks-BmoAyVEe.js";import xn from"./NotFoundScreen-B9pJKI3W.js";import{a as s,b as Pt}from"./sentry-CCAVv3jj.js";import{n as De,S as Rn}from"./mui-DLJkInA_.js";import{h as se,j as wt,u as Ge,g as F,k as Dn,l as rt,n as Un,o as je}from"./core-zBodvsmj.js";import{eN as we,OL as On,f0 as Ce,fe as Fn,q7 as Bn,mN as xt,n6 as Rt,OM as Dt,ng as _n,ON as Ut,mG as Vn,pF as Mn,eY as he,OO as xe,s6 as Ot,Bh as Ft,OP as Bt,OQ as jn,pk as qe,Kt as dt,Kv as zn,ju as Ln,Kw as $n,jB as Gn,cU as qn,t9 as Je,jr as Jn,mT as _t,nl as Re,OR as Nn,Jm as ut,Jl as Ae,OS as mt,jS as Yn,OT as Kn,OU as Wn,OV as Hn,OW as Qn,m_ as Zn,mL as ce,no as Te,OX as Xn,OY as ea,OZ as ta,nv as na,jF as aa,jw as oa,O_ as sa,jE as ht,KD as ca,O$ as ia,P0 as la,pg as ra,oX as da,nm as pe,oW as ze,P1 as ua,P2 as ma,l9 as ha,bq as pa,l4 as pt,kS as ga,P3 as Ca,gD as gt,fQ as Sa,l1 as Ia,v2 as fa,P4 as ka,nW as Ea,nR as va,nV as ya,nG as ba,P5 as Aa,e$ as Vt,n9 as Ta,mW as Pa,ff as Ct,nq as wa,P6 as xa,nn as Mt,P7 as Ra,P8 as Da,P9 as Ua,Pa as Oa,Pb as St,ps as Fa,oM as Ba,Jk as _a,jD as Va,Pc as Ma,FB as ja,jC as za,e_ as La,ol as jt,oE as $a,nk as It,np as Ga,bC as qa,k_ as Ja,kX as Na,Pd as Ya,nF as ft,oC as kt,oA as Ka,oq as Wa,o5 as Ha,oD as Qa,Pe as Za,Pf as Xa,o9 as eo,Pg as to,n$ as no,o8 as ao,o6 as oo,oH as so}from"./zeni-epic-state-BTJNQUbs.js";import{I as zt,a as Lt,d as ge,e as L,s as Q,J as $t,ct as co,z as Ue,cu as io,ao as Pe,cv as lo,aO as Et,B as Gt,cw as ro,al as Le,D as uo,cx as mo,N as ho,cy as po,cz as go,cA as Co,w as So,A as Io,aI as fo,b0 as ko,y as Eo,cB as vo}from"./index-BEtykuxp.js";import{u as qt}from"./useAskAiCfoHostNavButtonProps-gYNUsHfd.js";import{c as Jt}from"./useFetchSuggestedQuestionsWhenReady-ByvvCtR-.js";import{c as vt,C as yo}from"./TransactionDetailScreen-B-BVFEpP.js";import{w as bo}from"./withTransactionSidePanel-BXzIWNiu.js";import{h as Ao,v as To}from"./routePaths-C57Y-8ts.js";import{g as $e}from"./accountMappingHelper-Du_UPbom.js";import{D as Po}from"./DrawerScreen-CzsRyOzb.js";import"./recharts-CBJVI15_.js";import"./analytics-BYXYUYaV.js";import"./plaid-C7DViorD.js";import"./dnd-DXQzuHAR.js";import"./stripe-DMRn4zHo.js";import"./lottie-7jInd46q.js";import"./lexical-DftjmMYF.js";import"./pdf-D8Yl-cKT.js";import"./utils-IcNZtE46.js";import"./decodeURIComponentSafe-BxqXitkH.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new t.Error().stack;d&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[d]="7aaa0620-467d-4aa2-a44e-6b9e7e18cf15",t._sentryDebugIdIdentifier="sentry-dbid-7aaa0620-467d-4aa2-a44e-6b9e7e18cf15")}catch{}})();const wo=()=>{const{isAiCfoOpen:t,setIsAiCfoOpen:d}=zt(),U=se(),E=wt(),S=Ge(),u=F(g=>we(g)),{useFeatureGate:c}=Lt(),{isFeatureEnabled:B}=c(ge.isRealtimeInsightsFeatureEnabled),m=F(g=>g.expenseAutomationViewState.selectedPeriodByTenantId),o=F(g=>On(g,u.tenantId)),{isAiCfoAccessEnabled:v,onAskAiCfoClick:f}=qt({isAiCfoOpen:t,setIsAiCfoOpen:d,mobileExploreReferrer:"Month-End Close Overview"}),y=s.useCallback((g,T,_=!1)=>{U(Ce({tenantId:T,period:{month:g.month,year:g.year},refreshViewInBackground:_}))},[]),V=s.useCallback(g=>{const T=S.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(g.month,g.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,T??null),U(Fn(u.tenantId,g))},[u.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),i=m[u.tenantId],h=s.useCallback(()=>{const g=S.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(i.month,i.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,g??null),y(i,u.tenantId,!0)},[y,i,u.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),w=Q(S.state?.pathnameStackToGoBack,S.pathname),A=s.useCallback(()=>{if(o.monthEndCloseChecks!=null&&i!=null){const g=o.monthEndCloseChecks.monthEndCloseCheckList.find(T=>T.progress<100);if(g!=null)return void E(`./${g.id}/${i.month}-${i.year}`,{state:{pathnameStackToGoBack:w,message:"comingFromOverview"}});E(`./month_end_insights/${i.month}-${i.year}`,{state:{pathnameStackToGoBack:w,message:"comingFromOverview"}})}},[o.monthEndCloseChecks,i]),{areTenantIdsInSync:x}=$t();return Jt({isDataReady:o.fetchState==="Completed"}),s.useEffect(()=>{i!=null&&o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&x&&y(i,u.tenantId)},[y,i,o.fetchState,u.tenantId,x]),s.useEffect(()=>{i!=null&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&x&&U(Bn(i))},[i,o.monthClosePerformanceTrendFetchStatus.fetchState,x]),s.useEffect(()=>{const g=setInterval(()=>{o.fetchState!=="In-Progress"&&o.fetchState==="Completed"&&h()},3e5);return()=>clearInterval(g)},[o.fetchState]),s.useEffect(()=>{if(o.fetchState==="Completed"&&o.monthEndCloseChecks?.auditSummary!=null){const g=S.state?.referrer;L.trackMonthCloseAuditPage(o.selectedPeriod.month,o.selectedPeriod.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,g??null)}},[o.fetchState,o.selectedPeriod,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),p.jsx(xo,{children:p.jsx(co,{monthEndCloseChecksView:o,isRealtimeInsightsFeatureEnabled:B,onMonthEndCheckClick:g=>{E(`./${g}/${i.month}-${i.year}`,{state:{pathnameStackToGoBack:w,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:V,handleReviewButtonClick:A,onBackClick:()=>{E("../../dashboard")},onReload:h,isAiCfoAccessEnabled:v,onAskAiCfoClick:f})})},xo=De.div`
1
+ import{j as p}from"./liveblocks-CFneZw8x.js";import xn from"./NotFoundScreen-Tdm5L-r8.js";import{a as s,b as Pt}from"./sentry-Dhi05Xar.js";import{n as De,S as Rn}from"./mui-Cf9-_L5d.js";import{h as se,j as wt,u as Ge,g as F,k as Dn,l as rt,n as Un,o as je}from"./core-DK_vDmT8.js";import{eN as we,OL as On,f0 as Ce,fe as Fn,q7 as Bn,mN as xt,n6 as Rt,OM as Dt,ng as _n,ON as Ut,mG as Vn,pF as Mn,eY as he,OO as xe,s6 as Ot,Bh as Ft,OP as Bt,OQ as jn,pk as qe,Kt as dt,Kv as zn,ju as Ln,Kw as $n,jB as Gn,cU as qn,t9 as Je,jr as Jn,mT as _t,nl as Re,OR as Nn,Jm as ut,Jl as Ae,OS as mt,jS as Yn,OT as Kn,OU as Wn,OV as Hn,OW as Qn,m_ as Zn,mL as ce,no as Te,OX as Xn,OY as ea,OZ as ta,nv as na,jF as aa,jw as oa,O_ as sa,jE as ht,KD as ca,O$ as ia,P0 as la,pg as ra,oX as da,nm as pe,oW as ze,P1 as ua,P2 as ma,l9 as ha,bq as pa,l4 as pt,kS as ga,P3 as Ca,gD as gt,fQ as Sa,l1 as Ia,v2 as fa,P4 as ka,nW as Ea,nR as va,nV as ya,nG as ba,P5 as Aa,e$ as Vt,n9 as Ta,mW as Pa,ff as Ct,nq as wa,P6 as xa,nn as Mt,P7 as Ra,P8 as Da,P9 as Ua,Pa as Oa,Pb as St,ps as Fa,oM as Ba,Jk as _a,jD as Va,Pc as Ma,FB as ja,jC as za,e_ as La,ol as jt,oE as $a,nk as It,np as Ga,bC as qa,k_ as Ja,kX as Na,Pd as Ya,nF as ft,oC as kt,oA as Ka,oq as Wa,o5 as Ha,oD as Qa,Pe as Za,Pf as Xa,o9 as eo,Pg as to,n$ as no,o8 as ao,o6 as oo,oH as so}from"./zeni-epic-state-BL_LeZIj.js";import{G as zt,a as Lt,d as ge,e as L,s as Q,I as $t,ct as co,z as Ue,cu as io,ao as Pe,cv as lo,aO as Et,B as Gt,cw as ro,al as Le,D as uo,cx as mo,N as ho,cy as po,cz as go,cA as Co,w as So,A as Io,aI as fo,b0 as ko,y as Eo,cB as vo}from"./index-BllLxW2o.js";import{u as qt}from"./useAskAiCfoHostNavButtonProps-Cm6zAMRj.js";import{c as Jt}from"./useFetchSuggestedQuestionsWhenReady-Dw2xWQ9g.js";import{c as vt,C as yo}from"./TransactionDetailScreen-B0frSfDq.js";import{w as bo}from"./withTransactionSidePanel-BQfYUuvc.js";import{h as Ao,v as To}from"./routePaths-DP6g0Tqx.js";import{g as $e}from"./accountMappingHelper-d9bI5aJe.js";import{D as Po}from"./DrawerScreen-Dx8bR0c_.js";import"./recharts-DGCFoGqb.js";import"./analytics-DlMpWLtY.js";import"./plaid-COLZDQ-K.js";import"./dnd-CI1Bz-yv.js";import"./stripe-DMRn4zHo.js";import"./lottie-DTY7lPgA.js";import"./lexical-2V5hcKhY.js";import"./pdf-DO37o4P_.js";import"./utils-DkqKuJOX.js";import"./decodeURIComponentSafe-D_yxDRpD.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new t.Error().stack;d&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[d]="2c8f87e4-a831-4bda-b346-3722764d8c50",t._sentryDebugIdIdentifier="sentry-dbid-2c8f87e4-a831-4bda-b346-3722764d8c50")}catch{}})();const wo=()=>{const{isAiCfoOpen:t,setIsAiCfoOpen:d}=zt(),U=se(),E=wt(),S=Ge(),u=F(g=>we(g)),{useFeatureGate:c}=Lt(),{isFeatureEnabled:B}=c(ge.isRealtimeInsightsFeatureEnabled),m=F(g=>g.expenseAutomationViewState.selectedPeriodByTenantId),o=F(g=>On(g,u.tenantId)),{isAiCfoAccessEnabled:v,onAskAiCfoClick:f}=qt({isAiCfoOpen:t,setIsAiCfoOpen:d,mobileExploreReferrer:"Month-End Close Overview"}),y=s.useCallback((g,T,_=!1)=>{U(Ce({tenantId:T,period:{month:g.month,year:g.year},refreshViewInBackground:_}))},[]),V=s.useCallback(g=>{const T=S.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(g.month,g.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,T??null),U(Fn(u.tenantId,g))},[u.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),i=m[u.tenantId],h=s.useCallback(()=>{const g=S.state?.referrer;o.monthEndCloseChecks?.auditSummary!=null&&L.trackMonthCloseAuditPage(i.month,i.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,g??null),y(i,u.tenantId,!0)},[y,i,u.tenantId,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),w=Q(S.state?.pathnameStackToGoBack,S.pathname),A=s.useCallback(()=>{if(o.monthEndCloseChecks!=null&&i!=null){const g=o.monthEndCloseChecks.monthEndCloseCheckList.find(T=>T.progress<100);if(g!=null)return void E(`./${g.id}/${i.month}-${i.year}`,{state:{pathnameStackToGoBack:w,message:"comingFromOverview"}});E(`./month_end_insights/${i.month}-${i.year}`,{state:{pathnameStackToGoBack:w,message:"comingFromOverview"}})}},[o.monthEndCloseChecks,i]),{areTenantIdsInSync:x}=$t();return Jt({isDataReady:o.fetchState==="Completed"}),s.useEffect(()=>{i!=null&&o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"&&x&&y(i,u.tenantId)},[y,i,o.fetchState,u.tenantId,x]),s.useEffect(()=>{i!=null&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&o.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&x&&U(Bn(i))},[i,o.monthClosePerformanceTrendFetchStatus.fetchState,x]),s.useEffect(()=>{const g=setInterval(()=>{o.fetchState!=="In-Progress"&&o.fetchState==="Completed"&&h()},3e5);return()=>clearInterval(g)},[o.fetchState]),s.useEffect(()=>{if(o.fetchState==="Completed"&&o.monthEndCloseChecks?.auditSummary!=null){const g=S.state?.referrer;L.trackMonthCloseAuditPage(o.selectedPeriod.month,o.selectedPeriod.year,o.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",o.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,g??null)}},[o.fetchState,o.selectedPeriod,o.monthEndCloseChecks?.auditSummary,o.monthEndCloseChecks?.reportEmailSentDate]),p.jsx(xo,{children:p.jsx(co,{monthEndCloseChecksView:o,isRealtimeInsightsFeatureEnabled:B,onMonthEndCheckClick:g=>{E(`./${g}/${i.month}-${i.year}`,{state:{pathnameStackToGoBack:w,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:V,handleReviewButtonClick:A,onBackClick:()=>{E("../../dashboard")},onReload:h,isAiCfoAccessEnabled:v,onAskAiCfoClick:f})})},xo=De.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -0,0 +1 @@
1
+ import{j as s}from"./liveblocks-CFneZw8x.js";import{a as r}from"./sentry-Dhi05Xar.js";import{V as i,W as d,_ as l,p}from"./index-BllLxW2o.js";import"./mui-Cf9-_L5d.js";import m from"./NotFoundScreen-Tdm5L-r8.js";import{j as u,u as b}from"./core-DK_vDmT8.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]="14fa8b9e-341e-42af-a1f7-dc63c7c6815c",e._sentryDebugIdIdentifier="sentry-dbid-14fa8b9e-341e-42af-a1f7-dc63c7c6815c")}catch{}})();const j=()=>{const e=u(),a=b(),t=r.useCallback(()=>{window.open("https://www.zeni.ai/demo/request","_blank")},[]),c=r.useCallback(()=>{(()=>{const n=p(a.state?.pathnameStackToGoBack),f=n.poppedPathname??k();e(f,{state:{pathnameStackToGoBack:n.newStack}})})()},[]),o=i(a.pathname);return o!=null?s.jsx(d,{menuItem:l(o),onDemoClick:t,onGoBack:c}):s.jsx(m,{})},k=(e=2)=>{let a="../";for(let t=0;t<e;t++)a=`${a}../`;return a};export{j as F};
@@ -1,4 +1,4 @@
1
- import{j as a}from"./liveblocks-BmoAyVEe.js";import{l as w,k as x,j,u as y,h as Z,q as ee,g as A,N as ae,n as te,o as p}from"./core-zBodvsmj.js";import{Iy as S,Iz as k,IA as L,yU as $,yG as N,IB as C,IC as ne,ID as oe,yK as ie,eO as I,yR as se,yO as le}from"./zeni-epic-state-BTJNQUbs.js";import{q as g,o as r,m as re,e as v,k as E,n as de,p as ce,r as me,s as F,a as pe,d as ue,v as he,w as xe,h as ge,B as fe,x as be,T as we,S as ye,O as Se,y as ke,C as ve}from"./index-BEtykuxp.js";import{n as c}from"./mui-DLJkInA_.js";import f from"./NotFoundScreen-B9pJKI3W.js";import{a as P}from"./sentry-CCAVv3jj.js";import"./recharts-CBJVI15_.js";import"./analytics-BYXYUYaV.js";import"./plaid-C7DViorD.js";import"./dnd-DXQzuHAR.js";import"./stripe-DMRn4zHo.js";import"./lottie-7jInd46q.js";import"./lexical-DftjmMYF.js";import"./pdf-D8Yl-cKT.js";import"./utils-IcNZtE46.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]="4ab9ba09-1b4e-4ea8-9a60-edd25e4f4869",e._sentryDebugIdIdentifier="sentry-dbid-4ab9ba09-1b4e-4ea8-9a60-edd25e4f4869")}catch{}})();const Ie=c.div`
1
+ import{j as a}from"./liveblocks-CFneZw8x.js";import{l as b,k as x,j,u as y,h as Z,q as ee,g as A,N as ae,n as te,o as p}from"./core-DK_vDmT8.js";import{Iy as S,Iz as k,IA as L,yU as $,yG as N,IB as C,IC as ne,ID as oe,yK as ie,eO as I,yR as se,yO as le}from"./zeni-epic-state-BL_LeZIj.js";import{q as g,o as d,m as de,e as v,j as E,n as re,p as ce,r as me,s as F,a as pe,d as ue,v as he,w as xe,h as ge,B as fe,x as we,T as be,S as ye,H as Se,y as ke,C as ve}from"./index-BllLxW2o.js";import{n as c}from"./mui-Cf9-_L5d.js";import f from"./NotFoundScreen-Tdm5L-r8.js";import{a as P}from"./sentry-Dhi05Xar.js";import"./recharts-DGCFoGqb.js";import"./analytics-DlMpWLtY.js";import"./plaid-COLZDQ-K.js";import"./dnd-CI1Bz-yv.js";import"./stripe-DMRn4zHo.js";import"./lottie-DTY7lPgA.js";import"./lexical-2V5hcKhY.js";import"./pdf-DO37o4P_.js";import"./utils-DkqKuJOX.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]="c19474c7-f4a2-4d6e-a28a-e964953da6ad",e._sentryDebugIdIdentifier="sentry-dbid-c19474c7-f4a2-4d6e-a28a-e964953da6ad")}catch{}})();const Ie=c.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -6,8 +6,8 @@ import{j as a}from"./liveblocks-BmoAyVEe.js";import{l as w,k as x,j,u as y,h as
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
10
- `,je=x(function(e){const t=S(e),n=k(e),{companyName:o}=t;return{companyName:o,isDisabled:t.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,magicLinkViewState:t}},function(e,t){const{vendorId:n,billId:o}=t;return{onFetchBankName:i=>{e(N(i))},onSaveHandler:i=>{v.trackBillPayMagicLinkSubmitBankAccountDetails(o),e($(i,"standard",n,o))},onACHDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(L({data:l}))}}})(re);function z(){const e=g(),{vendorId:t,billId:n}=w();return t==null||n==null?a.jsx(f,{}):a.jsx(a.Fragment,{children:a.jsx(Ie,{windowSize:e,children:a.jsx(je,{vendorId:t,billId:n})})})}const $e=c.div`
9
+ box-shadow: ${e=>`0px 2px ${d.sp1} ${e.theme.colors.dropShadowNormal}`};
10
+ `,je=x(function(e){const t=S(e),n=k(e),{companyName:o}=t;return{companyName:o,isDisabled:t.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,magicLinkViewState:t}},function(e,t){const{vendorId:n,billId:o}=t;return{onFetchBankName:i=>{e(N(i))},onSaveHandler:i=>{v.trackBillPayMagicLinkSubmitBankAccountDetails(o),e($(i,"standard",n,o))},onACHDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(L({data:l}))}}})(de);function z(){const e=g(),{vendorId:t,billId:n}=b();return t==null||n==null?a.jsx(f,{}):a.jsx(a.Fragment,{children:a.jsx(Ie,{windowSize:e,children:a.jsx(je,{vendorId:t,billId:n})})})}const $e=c.div`
11
11
  display: flex;
12
12
  height: 100vh;
13
13
  width: 100%;
@@ -15,8 +15,8 @@ import{j as a}from"./liveblocks-BmoAyVEe.js";import{l as w,k as x,j,u as y,h as
15
15
  flex-direction: column;
16
16
  align-items: center;
17
17
  background-color: ${e=>e.theme.colors.grey4};
18
- box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
19
- `,Ce=x(function(e,t){const{isSubPage:n}=t;return{addressToEdit:C(e),googleAPIKey:E.googleMapsAPIKey,isSubPage:n}},function(e,t){const{navigate:n,location:o}=t,i=()=>{const l=ce(o.state?.pathnameStackToGoBack),s=l.poppedPathname??De();n(s,{state:{pathnameStackToGoBack:l.newStack}})};return{onSubmitHandler:l=>{const s=Ae(l);e(ne({addressToCreate:s})),i()},onCancel:()=>{i()}}})(de);function Be({isSubPage:e}){const t=j(),n=y(),o=g();return a.jsx(a.Fragment,{children:a.jsx($e,{windowSize:o,children:a.jsx(Ce,{location:n,navigate:t,isSubPage:e===!0,googleAPIKey:E.googleMapsAPIKey})})})}const De=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t},Ae=e=>({street:[e.street.addressString,e.suite,e.secondaryInfo],city:e.city,state:e.state,country:e.country.selectedOption??"",countryCode:e.countryCode,postalCode:e.postalCode,latitude:e.street.addressValue?.locationLat,longitude:e.street.addressValue?.locationLng}),Pe=c.div`
18
+ box-shadow: ${e=>`0px 2px ${d.sp1} ${e.theme.colors.dropShadowNormal}`};
19
+ `,Ce=x(function(e,t){const{isSubPage:n}=t;return{addressToEdit:C(e),googleAPIKey:E.googleMapsAPIKey,isSubPage:n}},function(e,t){const{navigate:n,location:o}=t,i=()=>{const l=ce(o.state?.pathnameStackToGoBack),s=l.poppedPathname??De();n(s,{state:{pathnameStackToGoBack:l.newStack}})};return{onSubmitHandler:l=>{const s=Ae(l);e(ne({addressToCreate:s})),i()},onCancel:()=>{i()}}})(re);function Be({isSubPage:e}){const t=j(),n=y(),o=g();return a.jsx(a.Fragment,{children:a.jsx($e,{windowSize:o,children:a.jsx(Ce,{location:n,navigate:t,isSubPage:e===!0,googleAPIKey:E.googleMapsAPIKey})})})}const De=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t},Ae=e=>({street:[e.street.addressString,e.suite,e.secondaryInfo],city:e.city,state:e.state,country:e.country.selectedOption??"",countryCode:e.countryCode,postalCode:e.postalCode,latitude:e.street.addressValue?.locationLat,longitude:e.street.addressValue?.locationLng}),Pe=c.div`
20
20
  display: flex;
21
21
  height: 100%;
22
22
  width: 100%;
@@ -24,8 +24,8 @@ import{j as a}from"./liveblocks-BmoAyVEe.js";import{l as w,k as x,j,u as y,h as
24
24
  flex-direction: column;
25
25
  align-items: center;
26
26
  background-color: ${e=>e.theme.colors.grey4};
27
- box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
28
- `,ze=x(function(e){const t=S(e),n=k(e),o=C(e),{companyName:i}=t;return{companyName:i,isDisabled:t.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:t}},function(e,t){const{navigate:n,location:o,vendorId:i,billId:l}=t;return{onFetchBankName:s=>{e(N(s))},onSaveHandler:s=>{v.trackBillPayMagicLinkSubmitBankAccountDetails(l),e($(s,"us-domestic",i,l))},onWireDetailsUpdated:s=>{const{bankAccountSection:d}=s;e(L({data:d}))},onAddressClick:()=>{const s=o.pathname.replace("us-domestic","address"),d=F(o.state?.pathnameStackToGoBack,o.pathname);n(s,{state:{pathnameStackToGoBack:d}})}}})(me);function Le(){const e=j(),t=y(),n=g(),{vendorId:o,billId:i}=w();return o==null||i==null?a.jsx(f,{}):a.jsx(a.Fragment,{children:a.jsx(Pe,{windowSize:n,children:a.jsx(ze,{location:t,navigate:e,vendorId:o,billId:i})})})}const Ne=c.div`
27
+ box-shadow: ${e=>`0px 2px ${d.sp1} ${e.theme.colors.dropShadowNormal}`};
28
+ `,ze=x(function(e){const t=S(e),n=k(e),o=C(e),{companyName:i}=t;return{companyName:i,isDisabled:t.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:t}},function(e,t){const{navigate:n,location:o,vendorId:i,billId:l}=t;return{onFetchBankName:s=>{e(N(s))},onSaveHandler:s=>{v.trackBillPayMagicLinkSubmitBankAccountDetails(l),e($(s,"us-domestic",i,l))},onWireDetailsUpdated:s=>{const{bankAccountSection:r}=s;e(L({data:r}))},onAddressClick:()=>{const s=o.pathname.replace("us-domestic","address"),r=F(o.state?.pathnameStackToGoBack,o.pathname);n(s,{state:{pathnameStackToGoBack:r}})}}})(me);function Le(){const e=j(),t=y(),n=g(),{vendorId:o,billId:i}=b();return o==null||i==null?a.jsx(f,{}):a.jsx(a.Fragment,{children:a.jsx(Pe,{windowSize:n,children:a.jsx(ze,{location:t,navigate:e,vendorId:o,billId:i})})})}const Ne=c.div`
29
29
  display: flex;
30
30
  height: 100%;
31
31
  width: 100%;
@@ -33,40 +33,40 @@ import{j as a}from"./liveblocks-BmoAyVEe.js";import{l as w,k as x,j,u as y,h as
33
33
  flex-direction: column;
34
34
  align-items: center;
35
35
  background-color: ${e=>e.theme.colors.grey4};
36
- box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
37
- `,Ee=x(function(e){const t=S(e),n=k(e),o=C(e),{companyName:i}=t;return{companyName:i,isDisabled:t.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:t}},function(e,t){const{navigate:n,location:o,vendorId:i,billId:l}=t;return{onFetchBankNameBySwift:s=>{e(ie(s))},onSaveHandler:s=>{v.trackBillPayMagicLinkSubmitBankAccountDetails(l),e($(s,"international",i,l,t.isLocalCurrencyEnabled))},onBankDetailsUpdated:s=>{const{internationalWireSwiftAccountSection:d}=s;e(oe({data:d}))},onAddressClick:()=>{const s=o.pathname.replace("international","address"),d=F(o.state?.pathnameStackToGoBack,o.pathname);n(s,{state:{pathnameStackToGoBack:d}})}}})(he);function Fe(){const e=j(),t=y(),n=g(),{vendorId:o,billId:i}=w(),{useFeatureGate:l}=pe(),{isFeatureEnabled:s}=l(ue.isBillPayLocalCurrencyFeatureEnabled);return o==null||i==null?a.jsx(f,{}):a.jsx(Ne,{windowSize:n,children:a.jsx(Ee,{location:t,navigate:e,vendorId:o,billId:i,isLocalCurrencyEnabled:s})})}const Te={containerWidth:new ke(100,58)},Ge=c(ye)`
38
- width: ${r.sp4};
39
- height: ${r.sp4};
40
- margin-bottom: ${r.sp3};
41
- margin-top: ${r.sp3};
42
- margin-left: ${r.sp8};
36
+ box-shadow: ${e=>`0px 2px ${d.sp1} ${e.theme.colors.dropShadowNormal}`};
37
+ `,Ee=x(function(e){const t=S(e),n=k(e),o=C(e),{companyName:i}=t;return{companyName:i,isDisabled:t.fetchState!=="Completed"?"disabled":void 0,magicLinkBankAccountDetails:n,mailingAddressDetails:o,magicLinkViewState:t}},function(e,t){const{navigate:n,location:o,vendorId:i,billId:l}=t;return{onFetchBankNameBySwift:s=>{e(ie(s))},onSaveHandler:s=>{v.trackBillPayMagicLinkSubmitBankAccountDetails(l),e($(s,"international",i,l,t.isLocalCurrencyEnabled))},onBankDetailsUpdated:s=>{const{internationalWireSwiftAccountSection:r}=s;e(oe({data:r}))},onAddressClick:()=>{const s=o.pathname.replace("international","address"),r=F(o.state?.pathnameStackToGoBack,o.pathname);n(s,{state:{pathnameStackToGoBack:r}})}}})(he);function Fe(){const e=j(),t=y(),n=g(),{vendorId:o,billId:i}=b(),{useFeatureGate:l}=pe(),{isFeatureEnabled:s}=l(ue.isBillPayLocalCurrencyFeatureEnabled);return o==null||i==null?a.jsx(f,{}):a.jsx(Ne,{windowSize:n,children:a.jsx(Ee,{location:t,navigate:e,vendorId:o,billId:i,isLocalCurrencyEnabled:s})})}const Te={containerWidth:new ke(100,58)},Ge=c(ye)`
38
+ width: ${d.sp4};
39
+ height: ${d.sp4};
40
+ margin-bottom: ${d.sp3};
41
+ margin-top: ${d.sp3};
42
+ margin-left: ${d.sp8};
43
43
  cursor: pointer;
44
44
  position: absolute;
45
45
  color: ${e=>e.theme.colors.brandColorJade};
46
- `,He=c.div`
46
+ `,Me=c.div`
47
47
  display: flex;
48
48
  height: 100vh;
49
49
  flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
50
50
  width: 100vw;
51
51
  overflow-y: scroll;
52
52
  background-color: ${e=>e.theme.colors.grey4};
53
- `,Ke=c.div`
53
+ `,He=c.div`
54
54
  display: flex;
55
55
  flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
56
56
  flex-direction: column;
57
57
  width: ${e=>`${Te.containerWidth.value(e.windowSize)}%`};
58
58
  ${e=>e.windowSize!=="small"?"overflow: auto;":""}
59
- box-shadow: ${e=>`0px 2px ${r.sp1} ${e.theme.colors.dropShadowNormal}`};
60
- padding-top: ${e=>e.windowSize!=="small"?r.sp2:"0px"};
61
- `,Me=c.div`
59
+ box-shadow: ${e=>`0px 2px ${d.sp1} ${e.theme.colors.dropShadowNormal}`};
60
+ padding-top: ${e=>e.windowSize!=="small"?d.sp2:"0px"};
61
+ `,Ke=c.div`
62
62
  display: flex;
63
63
  flex-direction: column;
64
64
  align-items: center;
65
65
  justify-content: center;
66
- padding: ${e=>e.windowSize==="small"?r.sp3:`62px ${r.sp6} ${r.sp9} ${r.sp8}`};
66
+ padding: ${e=>e.windowSize==="small"?d.sp3:`62px ${d.sp6} ${d.sp9} ${d.sp8}`};
67
67
  height: ${e=>e.windowSize==="small"?"490px":"auto"};
68
68
  overflow: ${e=>e.windowSize==="small"?"unset":"hidden"};
69
69
  width: ${e=>e.windowSize=="small"?"auto":"42%"};
70
70
  background-color: ${e=>e.windowSize==="small"?e.theme.colors.grey4:e.theme.colors.background};
71
71
  margin-top: ${e=>e.windowSize==="small"?e.isAddressPage?"0px":"186px":"unset"};
72
- `,Ve=x(function(e,t){return{file:t.file,type:t.type}})(Se);function h({appContent:e}){const t=Z(),n=y(),{tenantEmailDomain:o,vendorId:i,billId:l}=w(),[s]=ee(),d=s.get("token"),T=n.pathname.includes("address"),b=g(),G=xe(),B=ge(),H=()=>{G.toggle()},K=A(u=>S(u)),M=A(u=>k(u)),{authParams:V,fetchState:m,billAttachment:O,billFetchState:D,companyName:U,currencySymbol:_,amount:W}=K,{tenantId:q,userId:J,sessionId:R}=V,{fetchState:Q,internationalBankAccountCreateStatus:X}=M;return P.useEffect(()=>{I(),m==="Not-Started"&&i!=null&&o!=null&&d!=null&&t(se(i,o,d))},[]),P.useEffect(()=>{m==="Completed"&&(I(J,R,q),l!=null&&t(le(l)))},[m]),m==="Error"?a.jsx(f,{}):Q==="Completed"||X.fetchState==="Completed"?(I(),a.jsx(ae,{to:"../../../../../../../bank/account/save/success",replace:!0,relative:"path"})):m==="In-Progress"?a.jsx(fe,{fetchState:m,style:{height:"100vh",backgroundColor:B.colors.grey5,boxShadow:`0px 2px ${r.sp1} ${B.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[m==="Completed"&&D==="Completed"&&a.jsx(be,{analytics:v,onLoad:u=>(Y=>Y.trackBillPayMagicLinkPageLoad(o??"",i??"",U,l??"",Oe(n.pathname),_,W))(u)}),a.jsxs(He,{windowSize:b,children:[b!=="small"?a.jsx(Ge,{onClick:H}):null,a.jsx(Me,{windowSize:b,isAddressPage:T,children:D==="In-Progress"?a.jsx(we,{size:"ExtraLarge",start:!0}):a.jsx(Ve,{file:O,type:"bill"})}),a.jsx(Ke,{windowSize:b,children:e})]})]})}const Oe=e=>`${e.split("/").at(-2)}_${e.split("/").at(-1)}`;function Ue(){return a.jsx(ve,{})}function la(){return a.jsxs(te,{children:[a.jsx(p,{path:"bank/account/save/success",element:a.jsx(Ue,{})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/standard",element:a.jsx(h,{appContent:a.jsx(z,{})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/same-day",element:a.jsx(h,{appContent:a.jsx(z,{})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/address",element:a.jsx(h,{appContent:a.jsx(Be,{isSubPage:!0})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/us-domestic",element:a.jsx(h,{appContent:a.jsx(Le,{})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/international",element:a.jsx(h,{appContent:a.jsx(Fe,{})})}),a.jsx(p,{path:"*",element:a.jsx(f,{})})]})}export{la as default};
72
+ `,Ve=x(function(e,t){return{file:t.file,type:t.type}})(Se);function h({appContent:e}){const t=Z(),n=y(),{tenantEmailDomain:o,vendorId:i,billId:l}=b(),[s]=ee(),r=s.get("token"),T=n.pathname.includes("address"),w=g(),G=xe(),B=ge(),M=()=>{G.toggle()},H=A(u=>S(u)),K=A(u=>k(u)),{authParams:V,fetchState:m,billAttachment:U,billFetchState:D,companyName:W,currencySymbol:_,amount:O}=H,{tenantId:q,userId:J,sessionId:R}=V,{fetchState:Q,internationalBankAccountCreateStatus:X}=K;return P.useEffect(()=>{I(),m==="Not-Started"&&i!=null&&o!=null&&r!=null&&t(se(i,o,r))},[]),P.useEffect(()=>{m==="Completed"&&(I(J,R,q),l!=null&&t(le(l)))},[m]),m==="Error"?a.jsx(f,{}):Q==="Completed"||X.fetchState==="Completed"?(I(),a.jsx(ae,{to:"../../../../../../../bank/account/save/success",replace:!0,relative:"path"})):m==="In-Progress"?a.jsx(fe,{fetchState:m,style:{height:"100vh",backgroundColor:B.colors.grey5,boxShadow:`0px 2px ${d.sp1} ${B.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[m==="Completed"&&D==="Completed"&&a.jsx(we,{analytics:v,onLoad:u=>(Y=>Y.trackBillPayMagicLinkPageLoad(o??"",i??"",W,l??"",Ue(n.pathname),_,O))(u)}),a.jsxs(Me,{windowSize:w,children:[w!=="small"?a.jsx(Ge,{onClick:M}):null,a.jsx(Ke,{windowSize:w,isAddressPage:T,children:D==="In-Progress"?a.jsx(be,{size:"ExtraLarge",start:!0}):a.jsx(Ve,{file:U,type:"bill"})}),a.jsx(He,{windowSize:w,children:e})]})]})}const Ue=e=>`${e.split("/").at(-2)}_${e.split("/").at(-1)}`;function We(){return a.jsx(ve,{})}function la(){return a.jsxs(te,{children:[a.jsx(p,{path:"bank/account/save/success",element:a.jsx(We,{})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/standard",element:a.jsx(h,{appContent:a.jsx(z,{})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/ach/same-day",element:a.jsx(h,{appContent:a.jsx(z,{})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/address",element:a.jsx(h,{appContent:a.jsx(Be,{isSubPage:!0})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/us-domestic",element:a.jsx(h,{appContent:a.jsx(Le,{})})}),a.jsx(p,{path:":tenantEmailDomain/vendor/:vendorId/bill/:billId/wire/international",element:a.jsx(h,{appContent:a.jsx(Fe,{})})}),a.jsx(p,{path:"*",element:a.jsx(f,{})})]})}export{la as default};