@zeniai/web-app-ui 5.0.25-qa → 5.0.26-qa

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 (122) hide show
  1. package/dist/assets/AddressRoutes-Ddo5yFaY.js +1 -0
  2. package/dist/assets/AddressScreen-DbfnfF3g.js +9 -0
  3. package/dist/assets/{AiCfoScreen-c3WmsM7S.js → AiCfoScreen-B013GFMS.js} +1 -1
  4. package/dist/assets/BillPayApprovalRoutes-CZRSyPvo.js +1 -0
  5. package/dist/assets/{BillPayRoutes-DBqyHQ7X.js → BillPayRoutes-CH2s-gzl.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-DlerSwqe.js → BusinessVerificationPageScreen-BoEZFvFS.js} +2 -2
  7. package/dist/assets/{ChargeCardRoutes-DWhHYo21.js → ChargeCardRoutes-B7hoiWSV.js} +8 -8
  8. package/dist/assets/CompanyPassportScreen-CRMqtZFn.js +1 -0
  9. package/dist/assets/ConnectionAuthScreen-C04-2mC6.js +11 -0
  10. package/dist/assets/CustomerOnboardingAuthScreen-BmXLWm23.js +1 -0
  11. package/dist/assets/{CustomerOnboardingRoutes-DkC_d2sZ.js → CustomerOnboardingRoutes-Cj9bwQg1.js} +6 -6
  12. package/dist/assets/DashboardRoutes-kuz7A0GW.js +20 -0
  13. package/dist/assets/{DefaultTenantHome-CjzSnp03.js → DefaultTenantHome-CrJOB5X8.js} +1 -1
  14. package/dist/assets/{DomesticWireDetailScreen-LY2LbfiX.js → DomesticWireDetailScreen-B8McV8L1.js} +3 -3
  15. package/dist/assets/DrawerScreen-C7f_NiZk.js +1 -0
  16. package/dist/assets/{EntityDetailRoutes-lzOy1ccj.js → EntityDetailRoutes-CZrU40Jr.js} +1 -1
  17. package/dist/assets/{ExpenseAutomationRoutes-D_77OTBs.js → ExpenseAutomationRoutes-C7mCSmyZ.js} +3 -3
  18. package/dist/assets/FeaturePreviewScreen-CiNRRJaO.js +1 -0
  19. package/dist/assets/{MagicLinkRoutes-Nmy2VUN5.js → MagicLinkRoutes-CNG9KHKe.js} +2 -2
  20. package/dist/assets/MagicLinkSignInScreen-CdrB-rz9.js +12 -0
  21. package/dist/assets/MobileAppDrawer-DnUJz0tA.js +1 -0
  22. package/dist/assets/NotFoundScreen-DcJllQdb.js +1 -0
  23. package/dist/assets/{NotificationRoutes-z8dQlPoa.js → NotificationRoutes-Cv58FgVH.js} +1 -1
  24. package/dist/assets/PandLWithForecastRoutes-CxMrp76j.js +1 -0
  25. package/dist/assets/{PeopleRoutes-CllKrbwi.js → PeopleRoutes-72XyljMO.js} +5 -5
  26. package/dist/assets/PerformanceRoutes-BN3XbJ8Y.js +1 -0
  27. package/dist/assets/{Preview-DMyRJ2f0.js → Preview-BAKw3AAf.js} +1 -1
  28. package/dist/assets/{QBOConnectionScreen-B_jPbhuP.js → QBOConnectionScreen-Cw9-vrgq.js} +1 -1
  29. package/dist/assets/{ReferralListScreen-DIWnUNDR.js → ReferralListScreen-C3zvIkrr.js} +2 -2
  30. package/dist/assets/{ReimbursementApprovalRoutes-D-DKJaF1.js → ReimbursementApprovalRoutes-CMV2BtkL.js} +1 -1
  31. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-BGFNyRVm.js → ReimbursementApprovalRuleDetailScreen-CVP5Uq5I.js} +1 -1
  32. package/dist/assets/{ReimbursementRoutes-jGUb1Fcu.js → ReimbursementRoutes-BaDf69Ue.js} +4 -4
  33. package/dist/assets/{ReportsRoutes-MfNsO04v.js → ReportsRoutes-Cg41Op_9.js} +1 -1
  34. package/dist/assets/RewardsRoutes-Dd6j2rAO.js +1 -0
  35. package/dist/assets/ScreenRoutes-DldUU7sr.js +2 -0
  36. package/dist/assets/{SettingsRoutes-CYwSFGK7.js → SettingsRoutes-Dn3k1EVr.js} +4 -4
  37. package/dist/assets/{SetupPagesScreen-Cilkcy82.js → SetupPagesScreen-DrJKLQxS.js} +1 -1
  38. package/dist/assets/SignInScreen-DfKF7OT4.js +1 -0
  39. package/dist/assets/SignOutScreen-CAOckvN-.js +9 -0
  40. package/dist/assets/TaskListScreen-B9vL8Oxs.js +9 -0
  41. package/dist/assets/TaskRoutes-D7u9YC7x.js +9 -0
  42. package/dist/assets/TransactionDetailRoutes-BdR87vgc.js +1 -0
  43. package/dist/assets/{TransactionDetailScreen---9iPrdg.js → TransactionDetailScreen-DaK6ceRt.js} +2 -2
  44. package/dist/assets/{TransactionListRoutes-DmewD5lB.js → TransactionListRoutes-CIOjaSOe.js} +1 -1
  45. package/dist/assets/{TreasuryRoutes-DPo2M-9-.js → TreasuryRoutes-uVfHsmut.js} +6 -6
  46. package/dist/assets/{VendorsRoutes-B2HVwxpf.js → VendorsRoutes-B7j00M1u.js} +1 -1
  47. package/dist/assets/WiseConfirmationScreen--5fe8Ha5.js +12 -0
  48. package/dist/assets/{ZeniAccountRoutes-N6UjlYyq.js → ZeniAccountRoutes-RroFxPLH.js} +10 -10
  49. package/dist/assets/ZeniAccountStatementScreen-CeIEeVha.js +9 -0
  50. package/dist/assets/{accountMappingHelper-CEjaDvi1.js → accountMappingHelper-DdMTXagH.js} +1 -1
  51. package/dist/assets/{analytics-B3Q4UmLh.js → analytics-BsMspvaD.js} +1 -1
  52. package/dist/assets/{analyticsHelper-B4uZydFl.js → analyticsHelper-CQJg2P3F.js} +1 -1
  53. package/dist/assets/{core-CBFn_Yo_.js → core-PVb_PTOa.js} +1 -1
  54. package/dist/assets/{decodeURIComponentSafe-CqMC__af.js → decodeURIComponentSafe-mU8LeJGH.js} +1 -1
  55. package/dist/assets/{dnd-1A4kYEBz.js → dnd-DhtyOCgF.js} +1 -1
  56. package/dist/assets/{empty-C0ZlcUMX.js → empty-HlfDqjBl.js} +1 -1
  57. package/dist/assets/{empty-CuHDeEGA.js → empty-wep5Q-1y.js} +1 -1
  58. package/dist/assets/{emptyVideoElement-L6eqPJfK.js → emptyVideoElement-DpJB9lfW.js} +1 -1
  59. package/dist/assets/{epic-BNVHfQUa.js → epic-CMMVrD8V.js} +1 -1
  60. package/dist/assets/getLocaleForTenant-BlHoz8HV.js +1 -0
  61. package/dist/assets/{index-CpBFmiLM.js → index-BCcxTJng.js} +1 -1
  62. package/dist/assets/{index-CAO2_lCc.js → index-BWo_N8M7.js} +1 -1
  63. package/dist/assets/{index-DFEZoheE.js → index-CsPK-ZcF.js} +2 -2
  64. package/dist/assets/{index-ChMtRDkl.js → index-D5j-ijm9.js} +14700 -14610
  65. package/dist/assets/{index-BKmj_VFp.js → index-Dn-dGYDp.js} +1 -1
  66. package/dist/assets/{index-CDftMuwg.js → index-DnBq3nCg.js} +1 -1
  67. package/dist/assets/{index-D5HjsaAE.js → index-yb_kldBQ.js} +1 -1
  68. package/dist/assets/{lexical-Blenvqjv.js → lexical-CVfRQHxx.js} +1 -1
  69. package/dist/assets/{liveblocks-ypyKWtbM.js → liveblocks-DiLJJ0-W.js} +1 -1
  70. package/dist/assets/{lottie-xwOlCP2t.js → lottie-DGoffhx5.js} +1 -1
  71. package/dist/assets/{mui-D35VurIR.js → mui-Bs_Wx3U8.js} +1 -1
  72. package/dist/assets/{pathToGoBack-DEbgHxxX.js → pathToGoBack-BrzgfZOY.js} +1 -1
  73. package/dist/assets/{pdf-B5d6xxqf.js → pdf-Cq31LyOe.js} +4 -4
  74. package/dist/assets/{pdf-lib-CUHgD73m.js → pdf-lib-CKEHYQuo.js} +1 -1
  75. package/dist/assets/{plaid-O0aD-5ib.js → plaid-CT0unNLB.js} +1 -1
  76. package/dist/assets/{pusher-C48G4Qny.js → pusher-BDivubpF.js} +1 -1
  77. package/dist/assets/{react-DBFLdS1u.js → react-AIza423u.js} +1 -1
  78. package/dist/assets/{react-BHZphYxv.js → react-B22DUlFC.js} +1 -1
  79. package/dist/assets/{react-DDnuJ4gm.js → react-CQHBdAiW.js} +1 -1
  80. package/dist/assets/{react-BaFEg--9.js → react-D12Thgxw.js} +1 -1
  81. package/dist/assets/{react-DlX6KwOM.js → react-D3IfLVtg.js} +1 -1
  82. package/dist/assets/{react-DOxDWALt.js → react-x856Ci_R.js} +1 -1
  83. package/dist/assets/{recharts-CSEhqlTE.js → recharts-CreyyBLx.js} +1 -1
  84. package/dist/assets/{routePaths-nlWWZ4ZI.js → routePaths-Cu41oBox.js} +1 -1
  85. package/dist/assets/{sentry-ylIvhyeZ.js → sentry-CRXtNjzG.js} +1 -1
  86. package/dist/assets/{url-D6aOj1HL.js → url-DraJKqO-.js} +1 -1
  87. package/dist/assets/{url-BUH-dUKP.js → url-arGh5ZAs.js} +1 -1
  88. package/dist/assets/useAskAiCfoHostNavButtonProps-ZQtgg5zD.js +1 -0
  89. package/dist/assets/{useDeviceId-BJs7B5gi.js → useDeviceId-B5nwTsrh.js} +1 -1
  90. package/dist/assets/useFetchSuggestedQuestionsWhenReady-wbg5b6I3.js +1 -0
  91. package/dist/assets/{useInitialThreadRequest-BFAN9HG0.js → useInitialThreadRequest-BJAnehMw.js} +1 -1
  92. package/dist/assets/{utils-0qzBiEB0.js → utils-CfmtJLRd.js} +1 -1
  93. package/dist/assets/{withTransactionSidePanel-Bon_8p_2.js → withTransactionSidePanel-LH23g840.js} +2 -2
  94. package/dist/assets/{zeni-epic-state-DQMIbKEE.js → zeni-epic-state-4sJL0-hG.js} +3 -3
  95. package/dist/index.html +1 -1
  96. package/package.json +2 -2
  97. package/dist/assets/AddressRoutes-edSf0Hzf.js +0 -1
  98. package/dist/assets/AddressScreen-DXP1i7x7.js +0 -9
  99. package/dist/assets/BillPayApprovalRoutes-DHaXtrYO.js +0 -1
  100. package/dist/assets/CompanyPassportScreen-CuARsPx2.js +0 -1
  101. package/dist/assets/ConnectionAuthScreen-D7jj-mBL.js +0 -11
  102. package/dist/assets/CustomerOnboardingAuthScreen-DXLFxrq4.js +0 -1
  103. package/dist/assets/DashboardRoutes-e4wGQnEi.js +0 -20
  104. package/dist/assets/DrawerScreen-CdRI1pWE.js +0 -1
  105. package/dist/assets/FeaturePreviewScreen-pIQ4X1aP.js +0 -1
  106. package/dist/assets/MagicLinkSignInScreen-BVyspHCV.js +0 -12
  107. package/dist/assets/MobileAppDrawer-D23D-DVK.js +0 -1
  108. package/dist/assets/NotFoundScreen-BU5ZWYfy.js +0 -1
  109. package/dist/assets/PandLWithForecastRoutes-CA3r2X18.js +0 -1
  110. package/dist/assets/PerformanceRoutes-jV3YHfcW.js +0 -1
  111. package/dist/assets/RewardsRoutes-91uVLC96.js +0 -1
  112. package/dist/assets/ScreenRoutes-CqLlqtvw.js +0 -2
  113. package/dist/assets/SignInScreen-DUy4fwRG.js +0 -1
  114. package/dist/assets/SignOutScreen-DvIN_1Oz.js +0 -9
  115. package/dist/assets/TaskListScreen-DyrjcDli.js +0 -9
  116. package/dist/assets/TaskRoutes-BW1P-Ij8.js +0 -9
  117. package/dist/assets/TransactionDetailRoutes-BmJCEPNE.js +0 -1
  118. package/dist/assets/WiseConfirmationScreen-Dv2If-yw.js +0 -12
  119. package/dist/assets/ZeniAccountStatementScreen-BhyQMG6S.js +0 -9
  120. package/dist/assets/getLocaleForTenant-CpmXipgh.js +0 -1
  121. package/dist/assets/useAskAiCfoHostNavButtonProps-IrvXJbyC.js +0 -1
  122. package/dist/assets/useFetchSuggestedQuestionsWhenReady-kulIc847.js +0 -1
@@ -1,13 +1,13 @@
1
- import{j as a}from"./liveblocks-ypyKWtbM.js";import{t as $e,A as Ce}from"./AddressScreen-DXP1i7x7.js";import ze from"./NotFoundScreen-BU5ZWYfy.js";import{a as g}from"./sentry-ylIvhyeZ.js";import{j as oe,u as se,h as ie,l as re,g as D,N as E,k as ce,i as Me,n as Qe,o as M}from"./core-CBFn_Yo_.js";import{I as de,A as le,z as B,r as ue,h as qe,d as _,m as V,w as H,c as N,v as je,f as X,ak as Ke,K as Je,al as Ie,i as te,am as Ze,an as ke,o as He,ao as We,ap as Ee,aq as Xe}from"./index-ChMtRDkl.js";import{bm as Ye,eM as ee,fa as et,eS as pe,eQ as me,bu as tt,mf as at,f6 as nt,bL as ot,i_ as ae,j1 as ve,IX as st,bQ as it,b$ as ge,rG as fe,rr as rt,J7 as Y,rH as _e,GD as ct,k2 as Ue,J8 as Ve,J9 as dt,Ja as lt,Jb as ut,iY as pt,i$ as mt,rt as Be,rF as gt,bB as xe,cr as ft,rT as Te,pA as ht,po as yt,jW as St,fz as bt,fy as Ct,fx as It,Jc as kt,rl as Et,rU as xt,rX as Tt,r_ as Ot,s4 as At,cR as Pt}from"./zeni-epic-state-DQMIbKEE.js";import{n as he}from"./mui-D35VurIR.js";import{g as Dt,h as Ft,q as ne}from"./QBOConnectionScreen-B_jPbhuP.js";import"./recharts-CSEhqlTE.js";import"./analytics-B3Q4UmLh.js";import"./plaid-O0aD-5ib.js";import"./dnd-1A4kYEBz.js";import"./stripe-DMRn4zHo.js";import"./lottie-xwOlCP2t.js";import"./lexical-Blenvqjv.js";import"./pdf-B5d6xxqf.js";import"./utils-0qzBiEB0.js";import"./empty-CuHDeEGA.js";import"./pdf-lib-CUHgD73m.js";import"./index-CDftMuwg.js";import"./url-BUH-dUKP.js";import"./index-CpBFmiLM.js";import"./decodeURIComponentSafe-CqMC__af.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="5e034282-568d-48ef-8610-6ffca41b4ce5",t._sentryDebugIdIdentifier="sentry-dbid-5e034282-568d-48ef-8610-6ffca41b4ce5")}catch{}})();const wt=ce(function(t,o){const s=[];o.isApAgingFeatureEnabled===!1&&s.push("accounts_payable_aging"),o.isArAgingFeatureEnabled===!1&&s.push("accounts_receivable_aging"),o.shouldFetchZeniAccountsPromoCard===!1&&s.push("zeni_accounts_promo_card"),o.shouldFetchRewardsPlanCard===!1&&s.push("rewards_card"),o.isExpenseAutomationEnabledForUser===!1&&s.push("expense_automation_card");const u=nt(t,s,o.signedInUser,o.isExpenseAutomationFeatureEnabledV2,o.isExpenseAutomationEnabledForUser,o.isTreasuryEnabled);return{dashboardFetchState:ot(u.reportsInOrder.map(d=>({fetchState:d.fetchState,error:d.error}))).fetchState}},function(t,o){const{themeState:s,navigate:u,location:d}=o;return{onZeniLogoClick:()=>{s.toggle()},onDashboardFetchDone:()=>{const r=V(d.state?.pathnameStackToGoBack,d.pathname);u("../../dashboard",{state:{pathnameStackToGoBack:r,message:"activation"}})}}})(Ke),jt=()=>{const t=oe(),o=se(),s=ie(),u=de(),[d,r]=g.useState(!1),[p,S]=g.useState(!1),{tenantEmailDomain:e}=re(),n=le(),i=B.getSignedInUser(),f=Ye(i),{useFeatureGate:m}=ue(),k=qe(),{isFeatureEnabled:x}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:T}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:I}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:h}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),$=C||U&&f,c=D(l=>ee(l)),{isFeatureEnabled:L}=m(_.isTreasuryEnabled),w=c.company!=null&&et(c.company),G=L&&w,O=D(l=>l.onboardingCustomerViewState.fetchState),b=c.excludedResources,R=c.companyId??B.getSignedInUserTenant(e)?.companyId;if(i==null)throw Error("Can't access onboarding flow without signing in...");const j=pe(F,c),A=me(c),P=[],K=b?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,z=b?.resources?.find(l=>l.resource==="/reports/task_card")==null,Q=c?.userRole!=null&&tt(c?.userRole),v=b?.resources?.find(l=>l.resource==="/bills")==null&&!Q,q=b?.resources?.find(l=>l.resource==="/reimbursements")==null;if(K===!1&&P.push("top_expenses"),z===!1&&P.push("task_card"),v===!1&&P.push("bill_pay_card","bill_pay_promo_card"),q===!1&&P.push("reimbursement_card","reimbursement_promo_card"),I===!1&&P.push("zeni_accounts_promo_card"),h===!1&&P.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||j||A||(r(!0),s(at(i.userId,R,c.tenantId,!0,!1,P)))},[d,O,j,A,i,c.tenantId,s]),g.useEffect(()=>{(j||A)&&setTimeout(()=>{S(!0)},5e3)},[j,A]),O!=="Completed")return a.jsx(E,{to:"../"});if(O==="Completed"&&p){const l=V(o.state?.pathnameStackToGoBack,o.pathname);if(j)return a.jsx(E,{to:"../../checking",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}});if(A)return a.jsx(E,{to:"../../cards",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}})}return n?.loggedInUserRoleMap!=null?a.jsxs(a.Fragment,{children:[a.jsx(H,{analytics:N,onLoad:l=>(J=>J.trackPageLoaded(X.Event.onboardingDashboardActivation))(l)}),a.jsx(wt,{navigate:t,location:o,themeState:u,signedInUser:i,isApAgingFeatureEnabled:x,isArAgingFeatureEnabled:T,shouldFetchZeniAccountsPromoCard:I,shouldFetchRewardsPlanCard:h,isExpenseAutomationEnabledForUser:$,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:G,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(je,{fetchState:"In-Progress",style:{backgroundColor:k.colors.grey5}})},Oe=he.div`
1
+ import{j as a}from"./liveblocks-DiLJJ0-W.js";import{t as $e,A as Ce}from"./AddressScreen-DbfnfF3g.js";import ze from"./NotFoundScreen-DcJllQdb.js";import{a as g}from"./sentry-CRXtNjzG.js";import{j as oe,u as se,h as ie,l as re,g as D,N as x,k as ce,i as Me,n as Qe,o as M}from"./core-PVb_PTOa.js";import{x as de,j as le,z as B,n as ue,h as qe,l as _,r as V,y as H,d as N,B as je,g as X,ak as Ke,K as Je,al as ke,k as te,am as Ze,an as Ie,o as He,ao as We,ap as xe,aq as Xe}from"./index-D5j-ijm9.js";import{bm as Ye,eM as ee,fa as et,eS as pe,eQ as me,bu as tt,mf as at,f6 as nt,bL as ot,i_ as ae,j1 as ve,IX as st,bQ as it,b$ as ge,rG as he,rr as rt,J7 as Y,rH as _e,GD as ct,k2 as Ue,J8 as Ve,J9 as dt,Ja as lt,Jb as ut,iY as pt,i$ as mt,rt as Be,rF as gt,bB as Ee,cr as ht,rT as Te,pA as ft,po as yt,jW as bt,fz as St,fy as Ct,fx as kt,Jc as It,rl as xt,rU as Et,rX as Tt,r_ as Ot,s4 as Pt,cR as At}from"./zeni-epic-state-4sJL0-hG.js";import{n as fe}from"./mui-Bs_Wx3U8.js";import{g as Dt,h as Ft,q as ne}from"./QBOConnectionScreen-Cw9-vrgq.js";import"./recharts-CreyyBLx.js";import"./analytics-BsMspvaD.js";import"./plaid-CT0unNLB.js";import"./dnd-DhtyOCgF.js";import"./stripe-DMRn4zHo.js";import"./lottie-DGoffhx5.js";import"./lexical-CVfRQHxx.js";import"./pdf-Cq31LyOe.js";import"./utils-CfmtJLRd.js";import"./empty-wep5Q-1y.js";import"./pdf-lib-CKEHYQuo.js";import"./index-DnBq3nCg.js";import"./url-arGh5ZAs.js";import"./index-BCcxTJng.js";import"./decodeURIComponentSafe-mU8LeJGH.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="ddea4ccb-d87e-4e64-87db-db89193448ce",t._sentryDebugIdIdentifier="sentry-dbid-ddea4ccb-d87e-4e64-87db-db89193448ce")}catch{}})();const wt=ce(function(t,o){const s=[];o.isApAgingFeatureEnabled===!1&&s.push("accounts_payable_aging"),o.isArAgingFeatureEnabled===!1&&s.push("accounts_receivable_aging"),o.shouldFetchZeniAccountsPromoCard===!1&&s.push("zeni_accounts_promo_card"),o.shouldFetchRewardsPlanCard===!1&&s.push("rewards_card"),o.isExpenseAutomationEnabledForUser===!1&&s.push("expense_automation_card");const u=nt(t,s,o.signedInUser,o.isExpenseAutomationFeatureEnabledV2,o.isExpenseAutomationEnabledForUser,o.isTreasuryEnabled);return{dashboardFetchState:ot(u.reportsInOrder.map(d=>({fetchState:d.fetchState,error:d.error}))).fetchState}},function(t,o){const{themeState:s,navigate:u,location:d}=o;return{onZeniLogoClick:()=>{s.toggle()},onDashboardFetchDone:()=>{const r=V(d.state?.pathnameStackToGoBack,d.pathname);u("../../dashboard",{state:{pathnameStackToGoBack:r,message:"activation"}})}}})(Ke),jt=()=>{const t=oe(),o=se(),s=ie(),u=de(),[d,r]=g.useState(!1),[p,b]=g.useState(!1),{tenantEmailDomain:e}=re(),n=le(),i=B.getSignedInUser(),h=Ye(i),{useFeatureGate:m}=ue(),I=qe(),{isFeatureEnabled:E}=m(_.isApAgingFeatureEnabled),{isFeatureEnabled:T}=m(_.isArAgingFeatureEnabled),{isFeatureEnabled:k}=m(_.isDepositAccountsFeatureEnabled),{isFeatureEnabled:f}=m(_.isReferralFeatureEnabled),{isFeatureEnabled:U}=m(_.isExpenseAutomationEnabled),{isFeatureEnabled:C}=m(_.isExpenseAutomationEnabledV2),{isFeatureEnabled:F}=m(_.isDebitCardFeatureEnabled),$=C||U&&h,c=D(l=>ee(l)),{isFeatureEnabled:L}=m(_.isTreasuryEnabled),w=c.company!=null&&et(c.company),G=L&&w,O=D(l=>l.onboardingCustomerViewState.fetchState),S=c.excludedResources,R=c.companyId??B.getSignedInUserTenant(e)?.companyId;if(i==null)throw Error("Can't access onboarding flow without signing in...");const j=pe(F,c),P=me(c),A=[],K=S?.resources?.find(l=>l.resource==="/reports/top_expenses")==null,z=S?.resources?.find(l=>l.resource==="/reports/task_card")==null,Q=c?.userRole!=null&&tt(c?.userRole),v=S?.resources?.find(l=>l.resource==="/bills")==null&&!Q,q=S?.resources?.find(l=>l.resource==="/reimbursements")==null;if(K===!1&&A.push("top_expenses"),z===!1&&A.push("task_card"),v===!1&&A.push("bill_pay_card","bill_pay_promo_card"),q===!1&&A.push("reimbursement_card","reimbursement_promo_card"),k===!1&&A.push("zeni_accounts_promo_card"),f===!1&&A.push("rewards_card"),g.useEffect(()=>{O!=="Completed"||d||j||P||(r(!0),s(at(i.userId,R,c.tenantId,!0,!1,A)))},[d,O,j,P,i,c.tenantId,s]),g.useEffect(()=>{(j||P)&&setTimeout(()=>{b(!0)},5e3)},[j,P]),O!=="Completed")return a.jsx(x,{to:"../"});if(O==="Completed"&&p){const l=V(o.state?.pathnameStackToGoBack,o.pathname);if(j)return a.jsx(x,{to:"../../checking",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}});if(P)return a.jsx(x,{to:"../../cards",state:{...o.state,pathnameStackToGoBack:l,message:"activation"}})}return n?.loggedInUserRoleMap!=null?a.jsxs(a.Fragment,{children:[a.jsx(H,{analytics:N,onLoad:l=>(J=>J.trackPageLoaded(X.Event.onboardingDashboardActivation))(l)}),a.jsx(wt,{navigate:t,location:o,themeState:u,signedInUser:i,isApAgingFeatureEnabled:E,isArAgingFeatureEnabled:T,shouldFetchZeniAccountsPromoCard:k,shouldFetchRewardsPlanCard:f,isExpenseAutomationEnabledForUser:$,isExpenseAutomationFeatureEnabledV2:C,isTreasuryEnabled:G,loggedInUserRoleMap:n?.loggedInUserRoleMap})]}):a.jsx(je,{fetchState:"In-Progress",style:{backgroundColor:I.colors.grey5}})},Oe=fe.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  background-color: ${t=>t.theme.colors.grey4};
5
- `,Ae=he.div`
5
+ `,Pe=fe.div`
6
6
  display: flex;
7
7
  flex-direction: column;
8
8
  align-items: center;
9
- min-width: calc(100% - ${ke}px);
10
- padding-left: ${ke}px;
9
+ min-width: calc(100% - ${Ie}px);
10
+ padding-left: ${Ie}px;
11
11
  flex: 1;
12
12
 
13
13
  ${t=>t.theme.breakpoints.down("md")} {
@@ -16,8 +16,8 @@ import{j as a}from"./liveblocks-ypyKWtbM.js";import{t as $e,A as Ce}from"./Addre
16
16
  }
17
17
 
18
18
  ${t=>t.windowSize!=="small"?"overflow: auto;":""}
19
- `,Pe=ce(function(t,o){const{companyId:s,isAdmin:u,currentTenant:d,isOnAddressPage:r}=o,p=B.getSignedInUser(),S=d.tenantId,e={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:S??""},n=ee(t),i=fe(t,s),f=Ve(t),m=ge(d?.userRole??[])&&i.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",k=dt(t.userRoleConfigState);return{onboardingCustomerView:i,analytics:N,isRefreshingViewInBackground:!1,isDisabled:m,companyTitles:k.companyTitles,connectedAccountProvider:n.company?.featuresActivationInfo.connectedAccountProvider??"",fileProps:{filesEndPoint:We.fileMicroServiceBaseUrl,authParams:e},signedInUser:B.getSignedInUser(),currentTenant:d,isAdmin:u,isOnAddressPage:r,meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",cardPaymentView:f,isCardPaymentPopupOpen:!1,stripeKey:te.stripeKey}},function(t,o){const{companyId:s,currentTenant:u,themeState:d,navigate:r,location:p}=o,{tenantEmailDomain:S}=u;return{onFetchLinkTokenClick:(e,n)=>{t(At(e,n))},onEstablishConnectionClick:(e,n)=>{t(Ot(e,n))},onUpdatePaymentAccountStatus:(e,n,i)=>{t(Tt(e,n,i))},onUpdatePaymentAccountLoginStatus:(e,n)=>{t(xt(!1,e,n))},onEstablishConnectionSuccess:()=>{t(Et(s,!0,!1))},handleOnConnectClick:()=>{N.trackOnboardingConnectQBO(),ne.handleClick()},updateQBOPopupState:e=>{t(Y({isQBOPopupOpen:e}))},onCompanyOfficerUpdated:e=>{const n=e.map(i=>{const{officerType:f,userId:m,name:k,email:x,ssn:T,nationalityCountryCode:I,dob:h,phone:U,syncToken:C,selectDocument:F,role:$,ownership:c,isSelectedForVerification:L,userVerificationStatus:w,fileIds:G,isPhoneVerified:O}=i;let b;return F.selectDocumentType==="driverLicense"?b="driving_license":F.selectDocumentType==="passport"?b="passport":F.selectDocumentType==="stateId"?b="id_document":F.selectDocumentType==="ssnCard"&&(b="social_security_card"),{officerType:f,userId:m,firstName:k.firstName,lastName:k.lastName,email:x,ssn:T,nationalityCountryCode:I?.selectedOption!=null?Ee(I.selectedOption):void 0,phone:U,birthday:h!=null?xe(h?.toString()):h,syncToken:C,titleAtCompany:$.selectedOption,ownershipInCompany:c,documentTypeSelectedForVerification:b,isSelectedForVerification:L,userVerificationStatus:w,fileIds:G,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1,isPhoneVerified:O}});t(Te({officers:n}))},onGetOtp:(e,n)=>{t(It(e,"CustomerOnboarding")),n!=null&&t(kt({officerType:n,phone:e}))},onResendOtp:e=>{t(Ct(e,"CustomerOnboarding"))},onVerifyOtp:(e,n)=>{t(bt(e,n,"CustomerOnboarding"))},updateFilesEntity:e=>{t(St({files:e}))},onDeleteFile:e=>{t(yt(e))},onEditFileName:(e,n)=>{t(ht(e,n.split(".")[0]))},onCompanyDetailsChanged:e=>{const{companyDescription:n,companyIndustry:i,companyIndustryType:f,companyLegalName:m,companyTaxId:k,companyWebsite:x,companyPhone:T,primaryContactEmail:I,primaryContactName:h,primaryContactUserId:U,primaryContactSyncToken:C,syncToken:F,fileIds:$,typeOfIncorporation:c,stateOfIncorporation:L,incDate:w,companySourceOfFunds:G,companySourceOfFundsDescription:O,companySubIndustry:b,countriesOfOperations:R,purposeOfAccount:j,purposeOfAccountDescription:A,regulatedStatus:P,regulatedStatusDescription:K,transactionVolume:z,transactionVolumeDescription:Q,usNexus:v,usNexusTypes:q}=e,l={companyId:s,companyDescription:n,companyIndustry:i.selectedOption,companyIndustryType:f?.selectedOption??"",companyLegalName:m,taxIdOrEIN:k,website:x!=""&&x!=null?ft(x):void 0,phone:T,syncToken:F,fileIds:$,incDate:w!=null?xe(w?.toString()):w,typeOfIncorporation:c?.selectedOption??"",stateOfIncorporation:L?.selectedOption??"",companySourceOfFunds:G?.selectedOption??"",companySourceOfFundsDescription:O,companySubIndustry:b?.selectedOption??"",countriesOfOperations:R?.selectedOptions.map(Z=>Z.length===2?Z:Ee(Z))??[],purposeOfAccount:j?.selectedOption??"",purposeOfAccountDescription:A,regulatedStatus:P??"",regulatedStatusDescription:K,transactionVolume:z?.selectedOption??"",transactionVolumeDescription:Q,usNexus:v,usNexusTypes:q?.selectedOptions??[]},J={userId:U,firstName:h.firstName,lastName:h.lastName,email:I,syncToken:C};t(Te({companyDetails:l,primaryContactDetails:J}))},onAddressClick:(e,n)=>{const i=De(S,e,n),f=V(p.state?.pathnameStackToGoBack,p.pathname);r(i,{state:{pathnameStackToGoBack:f}})},onRegisteredAddressClick:(e,n)=>{const i=De(S,e,n),f=V(p.state?.pathnameStackToGoBack,p.pathname);r(i,{state:{pathnameStackToGoBack:f}})},onUpdateCustomerView:(e,n,i)=>{t(gt(s,!1,n,i,e))},onAddressEditHandler:e=>{if(e!=null){const n=$e(e);t(Ue({addressType:"subscription_billing_address",addressToCreate:n}))}},onSkipSetupClick:()=>{const e=V(p.state?.pathnameStackToGoBack,p.pathname);t(Be(s,!1,!1)),r("./activation",{state:{pathnameStackToGoBack:e}})},onUpdateStep:e=>{t(_e({step:e}))},onZeniLogoClick:()=>{d.toggle()},handleLogOutClick:()=>{const e=V(p.state?.pathnameStackToGoBack,p.pathname);r("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleCockpitClick:()=>{window.open("/cockpit")},handleCreateCardSetupIntent:e=>{t(ve(e))},handleConfirmCardSetupIntent:e=>{t(mt(e))},updateCardPaymentModalState:e=>{t(Y({isCardPaymentPopupOpen:e}))},handleAddCardPaymentSource:(e,n,i)=>{t(pt(e,n,i))},handleFetchPaymentSources:()=>{t(ae())},resetCardPaymentViewState:()=>{t(ut())},handleResetCardPaymentErrorStatuses:()=>{t(lt())},redirectToProductSuitePage:()=>{const e=V(p.state?.pathnameStackToGoBack,p.pathname);r(`/${S}/onboarding/thankyou`,{state:{pathnameStackToGoBack:e,message:"OnboardingThankyou"},replace:!0})}}})(Ze),W=({taxCFOCustomer:t=!1,isOnAddressPage:o=!1,appContent:s})=>{const u=oe(),d=se(),r=ie(),p=Je(),S=de(),[e,n]=g.useState(!1),[i,f]=g.useState(!1),[m,k]=g.useState(!1),{tenantEmailDomain:x}=re(),T=le(),{useFeatureGate:I}=ue(),{isFeatureEnabled:h}=I(_.isDebitCardFeatureEnabled),U=Me("/:tenantEmailDomain/onboarding")!==null&&d.search?.includes("code"),C=D(y=>y.onboardingCustomerViewState.fetchState),F=D(y=>y.onboardingCustomerViewState.currentStep),$=D(y=>y.onboardingCustomerViewState.uiState),c=D(y=>ee(y)),L=D(y=>y.userRoleConfigState.fetchState),w=D(y=>y.cardPaymentViewState),G=Ie(w.addCardPaymentSourceStatus.fetchState),O=w.addCardPaymentSourceStatus.fetchState,{code:b,realmId:R,state:j}=Dt(d.search),A=c.externalConnections?.accounting[0],P=A?.connectionType,K=A?.connectionName,z=A?.connectionId??"",Q=B.getSignedInUser()?.userId??"";g.useEffect(()=>{i||(f(!0),r(ae()))},[i,r]),g.useEffect(()=>{m||(ve(["card"]),k(!0))},[m]),g.useEffect(()=>{G==="In-Progress"&&O==="Completed"&&r(ae())},[G,O]),g.useEffect(()=>{Ft(b,R,j,z,Q)===!0&&c.externalConnections?.saveConnectionState!=="In-Progress"&&C==="Completed"&&(r(st(c.tenantId,{connection_type:P??"accounting",connection_name:K??"quickbooks_online",authorization_code:b,realm_id:R,connection_id:z,user_id:Q},it(window.location.origin+"/onboarding/auth"))),N.trackOnboardingSaveQBOConnection(R,z),u(d.pathname))},[b,R,j,d.pathname,C]),g.useEffect(()=>{ne.isInitiated===!1&&C==="Completed"&&ne.init("/onboarding/auth",c.tenantEmailDomain)},[C]);const v=c.companyId??B.getSignedInUserTenant(x)?.companyId,q=ge(c?.userRole??[]),l=D(y=>fe(y,v));g.useEffect(()=>{e||C!=="Not-Started"||v==null||(n(!0),r(rt(v,!0,!U)))},[e,C,v]),g.useEffect(()=>{c.externalConnections?.saveConnectionState!=="Completed"&&c.externalConnections?.saveConnectionState!=="Error"||!$.isQBOPopupOpen||F!=="qbo_connection"||r(Y({isQBOPopupOpen:!1}))},[c.externalConnections?.saveConnectionState]),g.useEffect(()=>{C==="Completed"&&U&&(r(_e({step:"qbo_connection"})),r(Y({isQBOPopupOpen:!0})))},[U,C]),g.useEffect(()=>{L==="Not-Started"&&r(ct(!0))},[L,r]);const J=Ie(l.companyDetailsLocalData?.addressStatus);g.useEffect(()=>{l.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate==null&&l.companyDetailsLocalData?.addressStatus?.addressToCreate!=null&&J==null&&r(Ue({addressType:"company_registered_address",addressToCreate:l.companyDetailsLocalData?.addressStatus?.addressToCreate}))},[l.companyDetailsLocalData?.addressStatus?.addressToCreate,l.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate]);const Z=l.isInterimEmailSent;if(B.getSignedInUser()==null)throw Error("Can't access onboarding flow without signing in...");const Le=pe(h,c),Ge=me(c),ye=c.company?.companyOnboardingInfo.isOnboardingCompleted,Se=y=>y.trackPageLoaded(X.Event.onboardingPage),be=c.productSettings.isOtherProductsEnabled,Re=c.productSettings.isTreasuryEnabled;if(ye===!0){if(!be)return Re?a.jsx(E,{to:"../../treasury"}):Le?a.jsx(E,{to:"../../checking"}):Ge?a.jsx(E,{to:"../../cards"}):a.jsx(E,{to:"../../dashboard"});const y=l.updateStatus.fetchState==="In-Progress";if(be&&!y)return t?a.jsxs(Oe,{children:[a.jsx(H,{analytics:N,onLoad:Ne=>Se(Ne)}),a.jsx(Pe,{navigate:u,location:d,companyId:v,currentTenant:c,isAdmin:q,isOnAddressPage:o,themeState:S,googleAPIKey:te.googleMapsAPIKey}),s!=null?a.jsx(Ae,{windowSize:p,children:s}):null]}):a.jsx(E,{to:"../../onboarding/thankyou"})}else if(ye===!1&&T?.loggedInUserRoleMap!=null)return Z===!0?a.jsx(E,{to:"../../onboarding/thankyou"}):a.jsxs(Oe,{children:[a.jsx(H,{analytics:N,onLoad:y=>Se(y)}),a.jsx(Pe,{navigate:u,location:d,companyId:v,currentTenant:c,isAdmin:q,isOnAddressPage:o,themeState:S,googleAPIKey:te.googleMapsAPIKey}),s!=null?a.jsx(Ae,{windowSize:p,children:s}):null]});return null};function De(t,o,s){let u=`/${t}/onboarding/address`;return u=s!=null?u.concat(`/edit/${o}/${encodeURIComponent(s)}`):u.concat(`/new/${o}`),u}const Fe=he.div`
19
+ `,Ae=ce(function(t,o){const{companyId:s,isAdmin:u,currentTenant:d,isOnAddressPage:r}=o,p=B.getSignedInUser(),b=d.tenantId,e={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:b??""},n=ee(t),i=he(t,s),h=Ve(t),m=ge(d?.userRole??[])&&i.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",I=dt(t.userRoleConfigState);return{onboardingCustomerView:i,analytics:N,isRefreshingViewInBackground:!1,isDisabled:m,companyTitles:I.companyTitles,connectedAccountProvider:n.company?.featuresActivationInfo.connectedAccountProvider??"",fileProps:{filesEndPoint:We.fileMicroServiceBaseUrl,authParams:e},signedInUser:B.getSignedInUser(),currentTenant:d,isAdmin:u,isOnAddressPage:r,meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",cardPaymentView:h,isCardPaymentPopupOpen:!1,stripeKey:te.stripeKey}},function(t,o){const{companyId:s,currentTenant:u,themeState:d,navigate:r,location:p}=o,{tenantEmailDomain:b}=u;return{onFetchLinkTokenClick:(e,n)=>{t(Pt(e,n))},onEstablishConnectionClick:(e,n)=>{t(Ot(e,n))},onUpdatePaymentAccountStatus:(e,n,i)=>{t(Tt(e,n,i))},onUpdatePaymentAccountLoginStatus:(e,n)=>{t(Et(!1,e,n))},onEstablishConnectionSuccess:()=>{t(xt(s,!0,!1))},handleOnConnectClick:()=>{N.trackOnboardingConnectQBO(),ne.handleClick()},updateQBOPopupState:e=>{t(Y({isQBOPopupOpen:e}))},onCompanyOfficerUpdated:e=>{const n=e.map(i=>{const{officerType:h,userId:m,name:I,email:E,ssn:T,nationalityCountryCode:k,dob:f,phone:U,syncToken:C,selectDocument:F,role:$,ownership:c,isSelectedForVerification:L,userVerificationStatus:w,fileIds:G,isPhoneVerified:O}=i;let S;return F.selectDocumentType==="driverLicense"?S="driving_license":F.selectDocumentType==="passport"?S="passport":F.selectDocumentType==="stateId"?S="id_document":F.selectDocumentType==="ssnCard"&&(S="social_security_card"),{officerType:h,userId:m,firstName:I.firstName,lastName:I.lastName,email:E,ssn:T,nationalityCountryCode:k?.selectedOption!=null?xe(k.selectedOption):void 0,phone:U,birthday:f!=null?Ee(f?.toString()):f,syncToken:C,titleAtCompany:$.selectedOption,ownershipInCompany:c,documentTypeSelectedForVerification:S,isSelectedForVerification:L,userVerificationStatus:w,fileIds:G,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1,isPhoneVerified:O}});t(Te({officers:n}))},onGetOtp:(e,n)=>{t(kt(e,"CustomerOnboarding")),n!=null&&t(It({officerType:n,phone:e}))},onResendOtp:e=>{t(Ct(e,"CustomerOnboarding"))},onVerifyOtp:(e,n)=>{t(St(e,n,"CustomerOnboarding"))},updateFilesEntity:e=>{t(bt({files:e}))},onDeleteFile:e=>{t(yt(e))},onEditFileName:(e,n)=>{t(ft(e,n.split(".")[0]))},onCompanyDetailsChanged:e=>{const{companyDescription:n,companyIndustry:i,companyIndustryType:h,companyLegalName:m,companyTaxId:I,companyWebsite:E,companyPhone:T,primaryContactEmail:k,primaryContactName:f,primaryContactUserId:U,primaryContactSyncToken:C,syncToken:F,fileIds:$,typeOfIncorporation:c,stateOfIncorporation:L,incDate:w,companySourceOfFunds:G,companySourceOfFundsDescription:O,companySubIndustry:S,countriesOfOperations:R,purposeOfAccount:j,purposeOfAccountDescription:P,regulatedStatus:A,regulatedStatusDescription:K,transactionVolume:z,transactionVolumeDescription:Q,usNexus:v,usNexusTypes:q}=e,l={companyId:s,companyDescription:n,companyIndustry:i.selectedOption,companyIndustryType:h?.selectedOption??"",companyLegalName:m,taxIdOrEIN:I,website:E!=""&&E!=null?ht(E):void 0,phone:T,syncToken:F,fileIds:$,incDate:w!=null?Ee(w?.toString()):w,typeOfIncorporation:c?.selectedOption??"",stateOfIncorporation:L?.selectedOption??"",companySourceOfFunds:G?.selectedOption??"",companySourceOfFundsDescription:O,companySubIndustry:S?.selectedOption??"",countriesOfOperations:R?.selectedOptions.map(Z=>Z.length===2?Z:xe(Z))??[],purposeOfAccount:j?.selectedOption??"",purposeOfAccountDescription:P,regulatedStatus:A??"",regulatedStatusDescription:K,transactionVolume:z?.selectedOption??"",transactionVolumeDescription:Q,usNexus:v,usNexusTypes:q?.selectedOptions??[]},J={userId:U,firstName:f.firstName,lastName:f.lastName,email:k,syncToken:C};t(Te({companyDetails:l,primaryContactDetails:J}))},onAddressClick:(e,n)=>{const i=De(b,e,n),h=V(p.state?.pathnameStackToGoBack,p.pathname);r(i,{state:{pathnameStackToGoBack:h}})},onRegisteredAddressClick:(e,n)=>{const i=De(b,e,n),h=V(p.state?.pathnameStackToGoBack,p.pathname);r(i,{state:{pathnameStackToGoBack:h}})},onUpdateCustomerView:(e,n,i)=>{t(gt(s,!1,n,i,e))},onAddressEditHandler:e=>{if(e!=null){const n=$e(e);t(Ue({addressType:"subscription_billing_address",addressToCreate:n}))}},onSkipSetupClick:()=>{const e=V(p.state?.pathnameStackToGoBack,p.pathname);t(Be(s,!1,!1)),r("./activation",{state:{pathnameStackToGoBack:e}})},onUpdateStep:e=>{t(_e({step:e}))},onZeniLogoClick:()=>{d.toggle()},handleLogOutClick:()=>{const e=V(p.state?.pathnameStackToGoBack,p.pathname);r("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleCockpitClick:()=>{window.open("/cockpit")},handleCreateCardSetupIntent:e=>{t(ve(e))},handleConfirmCardSetupIntent:e=>{t(mt(e))},updateCardPaymentModalState:e=>{t(Y({isCardPaymentPopupOpen:e}))},handleAddCardPaymentSource:(e,n,i)=>{t(pt(e,n,i))},handleFetchPaymentSources:()=>{t(ae())},resetCardPaymentViewState:()=>{t(ut())},handleResetCardPaymentErrorStatuses:()=>{t(lt())},redirectToProductSuitePage:()=>{const e=V(p.state?.pathnameStackToGoBack,p.pathname);r(`/${b}/onboarding/thankyou`,{state:{pathnameStackToGoBack:e,message:"OnboardingThankyou"},replace:!0})}}})(Ze),W=({taxCFOCustomer:t=!1,isOnAddressPage:o=!1,appContent:s})=>{const u=oe(),d=se(),r=ie(),p=Je(),b=de(),[e,n]=g.useState(!1),[i,h]=g.useState(!1),[m,I]=g.useState(!1),{tenantEmailDomain:E}=re(),T=le(),{useFeatureGate:k}=ue(),{isFeatureEnabled:f}=k(_.isDebitCardFeatureEnabled),U=Me("/:tenantEmailDomain/onboarding")!==null&&d.search?.includes("code"),C=D(y=>y.onboardingCustomerViewState.fetchState),F=D(y=>y.onboardingCustomerViewState.currentStep),$=D(y=>y.onboardingCustomerViewState.uiState),c=D(y=>ee(y)),L=D(y=>y.userRoleConfigState.fetchState),w=D(y=>y.cardPaymentViewState),G=ke(w.addCardPaymentSourceStatus.fetchState),O=w.addCardPaymentSourceStatus.fetchState,{code:S,realmId:R,state:j}=Dt(d.search),P=c.externalConnections?.accounting[0],A=P?.connectionType,K=P?.connectionName,z=P?.connectionId??"",Q=B.getSignedInUser()?.userId??"";g.useEffect(()=>{i||(h(!0),r(ae()))},[i,r]),g.useEffect(()=>{m||(ve(["card"]),I(!0))},[m]),g.useEffect(()=>{G==="In-Progress"&&O==="Completed"&&r(ae())},[G,O]),g.useEffect(()=>{Ft(S,R,j,z,Q)===!0&&c.externalConnections?.saveConnectionState!=="In-Progress"&&C==="Completed"&&(r(st(c.tenantId,{connection_type:A??"accounting",connection_name:K??"quickbooks_online",authorization_code:S,realm_id:R,connection_id:z,user_id:Q},it(window.location.origin+"/onboarding/auth"))),N.trackOnboardingSaveQBOConnection(R,z),u(d.pathname))},[S,R,j,d.pathname,C]),g.useEffect(()=>{ne.isInitiated===!1&&C==="Completed"&&ne.init("/onboarding/auth",c.tenantEmailDomain)},[C]);const v=c.companyId??B.getSignedInUserTenant(E)?.companyId,q=ge(c?.userRole??[]),l=D(y=>he(y,v));g.useEffect(()=>{e||C!=="Not-Started"||v==null||(n(!0),r(rt(v,!0,!U)))},[e,C,v]),g.useEffect(()=>{c.externalConnections?.saveConnectionState!=="Completed"&&c.externalConnections?.saveConnectionState!=="Error"||!$.isQBOPopupOpen||F!=="qbo_connection"||r(Y({isQBOPopupOpen:!1}))},[c.externalConnections?.saveConnectionState]),g.useEffect(()=>{C==="Completed"&&U&&(r(_e({step:"qbo_connection"})),r(Y({isQBOPopupOpen:!0})))},[U,C]),g.useEffect(()=>{L==="Not-Started"&&r(ct(!0))},[L,r]);const J=ke(l.companyDetailsLocalData?.addressStatus);g.useEffect(()=>{l.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate==null&&l.companyDetailsLocalData?.addressStatus?.addressToCreate!=null&&J==null&&r(Ue({addressType:"company_registered_address",addressToCreate:l.companyDetailsLocalData?.addressStatus?.addressToCreate}))},[l.companyDetailsLocalData?.addressStatus?.addressToCreate,l.companyDetailsLocalData?.registeredAddressStatus?.addressToCreate]);const Z=l.isInterimEmailSent;if(B.getSignedInUser()==null)throw Error("Can't access onboarding flow without signing in...");const Le=pe(f,c),Ge=me(c),ye=c.company?.companyOnboardingInfo.isOnboardingCompleted,be=y=>y.trackPageLoaded(X.Event.onboardingPage),Se=c.productSettings.isOtherProductsEnabled,Re=c.productSettings.isTreasuryEnabled;if(ye===!0){if(!Se)return Re?a.jsx(x,{to:"../../treasury"}):Le?a.jsx(x,{to:"../../checking"}):Ge?a.jsx(x,{to:"../../cards"}):a.jsx(x,{to:"../../dashboard"});const y=l.updateStatus.fetchState==="In-Progress";if(Se&&!y)return t?a.jsxs(Oe,{children:[a.jsx(H,{analytics:N,onLoad:Ne=>be(Ne)}),a.jsx(Ae,{navigate:u,location:d,companyId:v,currentTenant:c,isAdmin:q,isOnAddressPage:o,themeState:b,googleAPIKey:te.googleMapsAPIKey}),s!=null?a.jsx(Pe,{windowSize:p,children:s}):null]}):a.jsx(x,{to:"../../onboarding/thankyou"})}else if(ye===!1&&T?.loggedInUserRoleMap!=null)return Z===!0?a.jsx(x,{to:"../../onboarding/thankyou"}):a.jsxs(Oe,{children:[a.jsx(H,{analytics:N,onLoad:y=>be(y)}),a.jsx(Ae,{navigate:u,location:d,companyId:v,currentTenant:c,isAdmin:q,isOnAddressPage:o,themeState:b,googleAPIKey:te.googleMapsAPIKey}),s!=null?a.jsx(Pe,{windowSize:p,children:s}):null]});return null};function De(t,o,s){let u=`/${t}/onboarding/address`;return u=s!=null?u.concat(`/edit/${o}/${encodeURIComponent(s)}`):u.concat(`/new/${o}`),u}const Fe=fe.div`
20
20
  display: flex;
21
21
  height: 100vh;
22
22
  background-color: ${t=>t.theme.colors.grey4};
23
- `,we=ce(function(t,o){const{companyId:s,currentTenant:u}=o,d=fe(t,s),r=Ve(t);return{hasVerifiedBankAccount:(d.paymentAccount?.providerVerificationStatus?.code?.includes("verified")??!1)||(r.bankAccountsList[0]?.providerVerificationStatus?.code?.includes("verified")??!1),isDisabled:ge(u?.userRole??[])&&d.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",signedInUser:B.getSignedInUser(),currentTenant:u,meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(t,o){const{currentTenant:s,themeState:u,navigate:d,location:r}=o,{tenantEmailDomain:p}=s;return{onZeniLogoClick:()=>{u.toggle()},handleLogOutClick:()=>{const S=V(r.state?.pathnameStackToGoBack,r.pathname);d("/signout",{replace:!0,state:{pathnameStackToGoBack:S,message:"logout"}})},handleCockpitClick:()=>{window.open("/cockpit")},handleUpdatePaymentAddressDetailClick:()=>{const S=V(r.state?.pathnameStackToGoBack,r.pathname);d(`/${p}/onboarding/billing/edit`,{state:{pathnameStackToGoBack:S,message:"UpdatePaymentAddressDetail"}})}}})(Xe),vt=()=>{const t=oe(),o=ie(),s=se(),u=de(),{useFeatureGate:d}=ue(),{isFeatureEnabled:r}=d(_.isDebitCardFeatureEnabled),{tenantEmailDomain:p}=re(),S=le(),[e,n]=g.useState(!1);g.useEffect(()=>{e===!1&&s.state?.message==="OnboardingThankyou"&&n(!0)},[s.state]);const i=D(h=>ee(h)),f=i.productSettings.isOtherProductsEnabled;g.useEffect(()=>{o(Be(m,!1,!f))},[]);const m=i.companyId??B.getSignedInUserTenant(p)?.companyId;if(S.loggedInUser==null)throw Error("Can't access onboarding flow without signing in...");const k=pe(r,i),x=me(i),T=D(h=>h.onboardingCustomerViewState.updateStatus.fetchState),I=i.company?.companyOnboardingInfo.isOnboardingCompleted;return I!==!0||f?T==="Completed"&&I===!0&&f&&S?.loggedInUserRoleMap!=null?a.jsxs(Fe,{children:[a.jsx(H,{analytics:N,onLoad:h=>{h.trackPageLoaded(X.Event.onboardingLandingPage,"Onboarding",Pt(i.productSettings))}}),a.jsx(we,{navigate:t,showUpdatePaymentDetailButton:f,location:s,companyId:m,currentTenant:i,themeState:u,isVisitingFirstTime:e})]}):T==="Completed"&&I===!1&&S?.loggedInUserRoleMap!=null?a.jsxs(Fe,{children:[a.jsx(H,{analytics:N,onLoad:h=>{h.trackPageLoaded(X.Event.onboardingInterimPage)}}),a.jsx(we,{navigate:t,showUpdatePaymentDetailButton:f,location:s,companyId:m,currentTenant:i,themeState:u,isVisitingFirstTime:e})]}):a.jsx(je,{fetchState:T}):k?a.jsx(E,{to:"../../checking"}):x?a.jsx(E,{to:"../../cards"}):a.jsx(E,{to:"../../dashboard"})};function oa(){return a.jsxs(Qe,{children:[a.jsx(M,{path:"/",element:a.jsx(W,{})}),a.jsx(M,{path:"/billing/edit",element:a.jsx(W,{taxCFOCustomer:!0})}),a.jsx(M,{path:"/thankyou",element:a.jsx(vt,{})}),a.jsx(M,{path:"/activation",element:a.jsx(jt,{})}),a.jsx(M,{path:"/address/edit/:addressType/:addressId",element:a.jsx(W,{isOnAddressPage:!0,appContent:a.jsx(Ce,{})})}),a.jsx(M,{path:"/address/new/:addressType",element:a.jsx(W,{isOnAddressPage:!0,appContent:a.jsx(Ce,{})})}),a.jsx(M,{path:"*",element:a.jsx(ze,{})})]})}export{oa as default};
23
+ `,we=ce(function(t,o){const{companyId:s,currentTenant:u}=o,d=he(t,s),r=Ve(t);return{hasVerifiedBankAccount:(d.paymentAccount?.providerVerificationStatus?.code?.includes("verified")??!1)||(r.bankAccountsList[0]?.providerVerificationStatus?.code?.includes("verified")??!1),isDisabled:ge(u?.userRole??[])&&d.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",signedInUser:B.getSignedInUser(),currentTenant:u,meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(t,o){const{currentTenant:s,themeState:u,navigate:d,location:r}=o,{tenantEmailDomain:p}=s;return{onZeniLogoClick:()=>{u.toggle()},handleLogOutClick:()=>{const b=V(r.state?.pathnameStackToGoBack,r.pathname);d("/signout",{replace:!0,state:{pathnameStackToGoBack:b,message:"logout"}})},handleCockpitClick:()=>{window.open("/cockpit")},handleUpdatePaymentAddressDetailClick:()=>{const b=V(r.state?.pathnameStackToGoBack,r.pathname);d(`/${p}/onboarding/billing/edit`,{state:{pathnameStackToGoBack:b,message:"UpdatePaymentAddressDetail"}})}}})(Xe),vt=()=>{const t=oe(),o=ie(),s=se(),u=de(),{useFeatureGate:d}=ue(),{isFeatureEnabled:r}=d(_.isDebitCardFeatureEnabled),{tenantEmailDomain:p}=re(),b=le(),[e,n]=g.useState(!1);g.useEffect(()=>{e===!1&&s.state?.message==="OnboardingThankyou"&&n(!0)},[s.state]);const i=D(f=>ee(f)),h=i.productSettings.isOtherProductsEnabled;g.useEffect(()=>{o(Be(m,!1,!h))},[]);const m=i.companyId??B.getSignedInUserTenant(p)?.companyId;if(b.loggedInUser==null)throw Error("Can't access onboarding flow without signing in...");const I=pe(r,i),E=me(i),T=D(f=>f.onboardingCustomerViewState.updateStatus.fetchState),k=i.company?.companyOnboardingInfo.isOnboardingCompleted;return k!==!0||h?T==="Completed"&&k===!0&&h&&b?.loggedInUserRoleMap!=null?a.jsxs(Fe,{children:[a.jsx(H,{analytics:N,onLoad:f=>{f.trackPageLoaded(X.Event.onboardingLandingPage,"Onboarding",At(i.productSettings))}}),a.jsx(we,{navigate:t,showUpdatePaymentDetailButton:h,location:s,companyId:m,currentTenant:i,themeState:u,isVisitingFirstTime:e})]}):T==="Completed"&&k===!1&&b?.loggedInUserRoleMap!=null?a.jsxs(Fe,{children:[a.jsx(H,{analytics:N,onLoad:f=>{f.trackPageLoaded(X.Event.onboardingInterimPage)}}),a.jsx(we,{navigate:t,showUpdatePaymentDetailButton:h,location:s,companyId:m,currentTenant:i,themeState:u,isVisitingFirstTime:e})]}):a.jsx(je,{fetchState:T}):I?a.jsx(x,{to:"../../checking"}):E?a.jsx(x,{to:"../../cards"}):a.jsx(x,{to:"../../dashboard"})};function oa(){return a.jsxs(Qe,{children:[a.jsx(M,{path:"/",element:a.jsx(W,{})}),a.jsx(M,{path:"/billing/edit",element:a.jsx(W,{taxCFOCustomer:!0})}),a.jsx(M,{path:"/thankyou",element:a.jsx(vt,{})}),a.jsx(M,{path:"/activation",element:a.jsx(jt,{})}),a.jsx(M,{path:"/address/edit/:addressType/:addressId",element:a.jsx(W,{isOnAddressPage:!0,appContent:a.jsx(Ce,{})})}),a.jsx(M,{path:"/address/new/:addressType",element:a.jsx(W,{isOnAddressPage:!0,appContent:a.jsx(Ce,{})})}),a.jsx(M,{path:"*",element:a.jsx(ze,{})})]})}export{oa as default};
@@ -0,0 +1,20 @@
1
+ import{j as l}from"./liveblocks-DiLJJ0-W.js";import{l as N,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-PVb_PTOa.js";import{eM as L,Js as Le,bB as Yt,bp as de,KF as za,hO as qa,KG as Tt,KH as Za,hR as nt,KI as Be,KJ as Ha,hW as Ja,KK as xt,KL as Qa,h_ as ot,KM as Re,KN as Wa,cN as rt,KO as Xa,KP as en,JM as tn,iU as an,KQ as nn,bm as Se,KR as Kt,Jg as X,bc as Gt,j6 as Vt,mp as Nt,iR as $t,Ji as ee,Jh as Z,f2 as on,fk as sn,KS as rn,KT as cn,KU as zt,KV as fe,tw as ye,tx as ve,tU as ue,tO as te,tB as Ie,KW as ln,KX as dn,KY as un,KZ as qt,K_ as ge,K$ as mn,dA as Me,q8 as Zt,L0 as pn,L1 as hn,L2 as fn,L3 as it,ID as ct,jm as lt,u0 as dt,qg as gn,L4 as bn,ty as Dt,qb as ce,q7 as Ht,L5 as oe,L6 as Cn,L7 as ut,IC as mt,s8 as Jt,L8 as _n,L9 as kn,La as Sn,Lb as pt,sl as yn,Lc as vn,tA as Ot,s7 as Qt,Ld as se,Le as In,bu as Wt,u4 as Xt,Lf as An,Lg as En,Lh as wn,Li as ht,t$ as Tn,Lj as xn,tz as Ft,u3 as ea,Lk as re,Ll as Dn,Lm as On,Ln as ta,jb as aa,mm as na,jg as oa,mk as sa,mj as ra,mi as ia,rw as Fn,fa as Pn,cK as Bn,cL as Rn,mf as jn,f6 as Ln,mv as Mn,Lo as Un,D8 as Yn,Lp as Kn,Lq as Gn,Lr as Vn,b5 as ft,eY as Nn,gw as $n,fB as zn,mq as qn,iK as Zn,mn as Hn,ml as Jn,eS as Qn,eQ as Wn}from"./zeni-epic-state-4sJL0-hG.js";import{z as j,O as J,r as O,d as I,D as $,aP as Xn,I as Ae,y as Ee,aQ as ca,g as K,aR as eo,j as we,aS as la,n as Ue,l as M,h as to,aT as ao,aU as no,K as oo,a as da,$ as so,aV as ro,aI as ua,aW as io,aX as co,M as lo,aY as Te,aZ as uo,al as mo,p as po,J as ho,a_ as fo,a$ as Ce}from"./index-D5j-ijm9.js";import{n as gt}from"./mui-Bs_Wx3U8.js";import{a as _}from"./sentry-CRXtNjzG.js";import{w as ma}from"./withTransactionSidePanel-LH23g840.js";import{b as pa,t as me,e as ae,a as bt,v as go}from"./routePaths-Cu41oBox.js";import{u as Ye}from"./useAskAiCfoHostNavButtonProps-ZQtgg5zD.js";import{c as xe,b as bo}from"./useFetchSuggestedQuestionsWhenReady-wbg5b6I3.js";import ke from"./NotFoundScreen-DcJllQdb.js";import{t as ha}from"./analyticsHelper-CQJg2P3F.js";import{C as Co}from"./CompanyPassportScreen-CRMqtZFn.js";import{F as _o}from"./FeaturePreviewScreen-CiNRRJaO.js";import{R as ko}from"./ReferralListScreen-C3zvIkrr.js";import"./recharts-CreyyBLx.js";import"./analytics-BsMspvaD.js";import"./plaid-CT0unNLB.js";import"./dnd-DhtyOCgF.js";import"./stripe-DMRn4zHo.js";import"./lottie-DGoffhx5.js";import"./lexical-CVfRQHxx.js";import"./pdf-Cq31LyOe.js";import"./utils-CfmtJLRd.js";import"./TransactionDetailScreen-DaK6ceRt.js";import"./decodeURIComponentSafe-mU8LeJGH.js";import"./MobileAppDrawer-DnUJz0tA.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]="c3284a9e-b0ba-4b38-88d2-0138c73a973d",e._sentryDebugIdIdentifier="sentry-dbid-c3284a9e-b0ba-4b38-88d2-0138c73a973d")}catch{}})();const So=ma(function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=N(),s=j.getSignedInUser(),i=k(w=>w.tenantState.currentTenantId),d=k(w=>L(w)),{tenantEmailDomain:f}=N(),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(w=>za(w,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((w,B)=>{h(Tt({sortKey:w,sortOrder:B}))},[]),E=_.useCallback(w=>{h(Tt({downloadState:w}))},[]),y=_.useCallback(w=>{if(e)e(w.transactionId,w.transactionType);else if(f!=null){const B=pa({id:w.transactionId,type:w.transactionType},f);m(B);const pe=O(g.state?.pathnameStackToGoBack,g.pathname);m(B,{state:{pathnameStackToGoBack:pe}})}},[f,e]),T=_.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"&&T()},[T,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,T)=>{t(Be({sortKey:T,sortOrder:y}))},[]),S=_.useCallback(y=>{n(`./${y}/${c.format($.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)},[c]),A=_.useCallback(y=>{t(Be({downloadState:y}))},[]),P=_.useCallback((y,T)=>{},[]),E=_.useCallback((y,T)=>{t(Be({selectedDate:y,agingDateSelectionType:T})),t(nt(y))},[]);return l.jsxs(l.Fragment,{children:[o.fetchState==="Completed"?l.jsx(Ee,{analytics:I,onLoad:y=>y.trackPageLoaded(K.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}=N(),s=j.getSignedInUser(),i=k(T=>L(T)),{tenantEmailDomain:d}=N(),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(T=>Ha(T,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((T,w)=>{u(xt({sortKey:T,sortOrder:w}))},[]),P=_.useCallback(T=>{u(xt({downloadState:T}))},[]),E=_.useCallback(T=>{if(e)e(T.transactionId,T.transactionType);else if(d!=null){const w=pa({id:T.transactionId,type:T.transactionType},d);h(w);const B=O(f.state?.pathnameStackToGoBack,f.pathname);h(w,{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(K.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 wo(){const e=q(),a=z(),{tenantEmailDomain:t}=N(),n=we(),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 To(){const e=q(),a=z(),{tenantEmailDomain:t}=N(),n=we(),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
+ display: flex;
3
+ flex: 1 1 auto;
4
+ min-height: 100%;
5
+ flex-direction: column;
6
+ background-color: ${e=>e.theme.colors.grey4};
7
+ `,Do=gt.div`
8
+ display: flex;
9
+ flex: 1 1 auto;
10
+ flex-direction: column;
11
+ align-items: center;
12
+ background-color: ${e=>e.theme.colors.grey4};
13
+ `;function Oo({title:e,reportId:a,entityAutoCompleteView:t,autoCompleteText:n,isAiCfoAccessEnabled:o,onAskAiCfoClick:r}){const s=q(),i=V(),d=z(),{tenantEmailDomain:f}=N(),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(K.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(wo,{}):l.jsx(To,{})})]})}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=Kt((C=>{const S=Gt(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(Nt());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(K.Event.cardBalance);break;case"cash_balance":S.trackPageLoaded(K.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}=N(),{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]),T=_.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]),w=_.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:w,onSuggestedQuestionClick:T,suggestedQuestions:y}},[m,w,T,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("../")}}})(Te),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("../")}}})(Te),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})},G=(e,a,t,n)=>{e===!1?a!=null&&n("../../",{relative:"path"}):a!=t&&(a!=null&&a.length>0?n(`../${t}`,{replace:!0}):n(`./forecast/${t}`,{replace:!0}))};function 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&&G(!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&&G(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):G(!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"))}}})(Te),Ko=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&&(G(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})},Go=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&&G(!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}=Go(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&&G(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):G(!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"))}}})(Te),No=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&&(G(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=we(),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=wn(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&&G(!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&&G(!0,a.forecastIdFromUrlPath,n?.id??"",a.navigate)):G(!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(Tn())},onResyncReports:()=>{e(dt("revenue_by_classes"))}}})(Te),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&&(G(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`
14
+ display: flex;
15
+ flex: 1 1 auto;
16
+ min-height: 100%;
17
+ flex-direction: column;
18
+ background-color: ${e=>e.theme.colors.grey5};
19
+ align-items: center;
20
+ `,le=3,Ct=1;function Wo({fetchState:e,firstMonthOfFY:a,reportId:t,forecastId:n}){const o=q(),r=z(),{tenantEmailDomain:s}=N();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(No,{...d});break;case"revenue":i=l.jsx(qo,{...d});break;case"net_burn_or_income":i=l.jsx(Ko,{...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}=N();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=Kt((c=>{const u=Gt(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(K.Event.operatingExpenses,m);break;case"revenue":u.trackPageLoaded(K.Event.revenues,m);break;case"net_burn_or_income":u.trackPageLoaded(K.Event.burnRate,m);break;case"cash_position":u.trackPageLoaded(K.Event.cashPosition,m);break;case"top_expenses":u.trackPageLoaded(K.Event.topExpenses,m);break;case"cash_in_cash_out":u.trackPageLoaded(K.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=[],Ke=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==="*"?"*":Ke(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(Ke(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])==="*"?"*":Ke(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=Ke(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(Nt());break;case"rewards_card":g.includes("rewards_card")===!1&&i(Nn(!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,Kn(s)),e(Gn(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}=N(),{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:T}=s(M.isExpenseAutomationEnabledV2),w=T||y&&d,{isFeatureEnabled:B}=s(M.isTreasuryEnabled),pe=mo(w),{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),[Ge,Aa]=_.useState(!1);es("command+p, Control+p",v=>{Aa(!Ge),v.preventDefault()},{enableOnContentEditable:!0,enableOnTags:["INPUT","SELECT","TEXTAREA"]},[Ge]);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),wa=!!C?.companyReimbursementInfo?.info?.isReimbursementEnabled,Ta=!!C?.companyBillPayInfo?.info?.isBillPayEnabled,xa=k(v=>v.treasurySetupViewState.treasuryFundsDetails).fetchStatus.fetchState,Da=C?.company!=null&&Pn(C.company),Ve=B&&Da,Ne=we(),Oa=rt(Ne?.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(Ne?.loggedInUserRoleMap),ja=Rn(Ne?.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"),(w===!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===w||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),Ka=k(v=>v.revenueState.uiState.selectedForecast?.id),Ga=k(v=>v.cardBalanceState.fetchState),ie=k(v=>Ln(v,Y,r,T,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(K.Event.dashboard),Ve&&!Et&&v.trackTreasuryPromoView("Dashboard Promo Video")}}):null,l.jsx(ss,{maxColumns:e?2:void 0,isAiCfoAccessEnabled:h,onAskAiCfoClick:m,onDragAndDropCard:(v,Na)=>{const wt=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,Na,ie.cardsOrdered);wt.some((Fe,ze)=>Fe!==ie.cardsOrdered[ze])&&n(Mn(wt))},dashboardReport:ie,passedCardsOrdered:ie.cardsForDashboardUI,tenantId:A,companyId:P,tenantEmailDomain:u,location:o,navigate:t,isApAgingFeatureEnabled:E,isArAgingFeatureEnabled:he,isBillPayEnabled:Ta,isReimbursementEnabled:wa,isSummaryCardsFiltered:Ge,isForecastOn:Ya,selectedForecastOnDashboard:Ka,isVisitingFirstTime:f,isZeniAccountEnabled:Oe,isRewardsFeatureEnabled:kt,hasZeniAccountsAdminAccess:Oa,isExpenseAutomationEnabledForUser:w&&$e===!1,selectedPeriod:Ea[A],isChargeCardFeatureEnabled:ka,isUserHasCardsAccess:Ra,isUserHasTreasuryAccess:ja,cardsCreditLimit:La,cashbackRate:va,isInterestedInChargeCard:Ma,cardBalanceFetchState:Ga,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=we(),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};
@@ -1 +1 @@
1
- import{j as v}from"./liveblocks-ypyKWtbM.js";import{a as u}from"./sentry-ylIvhyeZ.js";import{h as y,g as b,k as w,u as A,N as k}from"./core-CBFn_Yo_.js";import{Ib as N,eM as _,fi as U,Ic as L,mh as R,Id as z}from"./zeni-epic-state-DQMIbKEE.js";import{u as O,z as h,L as T,t as S,O as $,b as j}from"./index-ChMtRDkl.js";import"./mui-D35VurIR.js";import{t as P}from"./getLocaleForTenant-CpmXipgh.js";import"./recharts-CSEhqlTE.js";import"./analytics-B3Q4UmLh.js";import"./plaid-O0aD-5ib.js";import"./dnd-1A4kYEBz.js";import"./stripe-DMRn4zHo.js";import"./lottie-xwOlCP2t.js";import"./lexical-Blenvqjv.js";import"./pdf-B5d6xxqf.js";import"./utils-0qzBiEB0.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]="20ea8c61-1a72-44ea-8ece-a88d3bca98ac",t._sentryDebugIdIdentifier="sentry-dbid-20ea8c61-1a72-44ea-8ece-a88d3bca98ac")}catch{}})();const Q=w(function(t){return{fetchState:t.tenantState.fetchState,activeTenantFetchState:t.tenantState.activeTenantFetchState.fetchState,currentTenant:_(t),tenantsInOrder:z(t).tenantsInOrder}})(function({fetchState:t,activeTenantFetchState:s,currentTenant:o,tenantsInOrder:f}){const r=A(),p=new URLSearchParams(r.search);if(o==null||t!=="Completed"&&s!=="Completed")return null;{let m="";const n=f.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=j(c,p);return v.jsx(k,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:I}})}});function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=O(),f=u.useRef(!1),r=u.useRef(!1),p=u.useRef(null),m=b(e=>N(e)),n=b(e=>e.tenantState.fetchState),i=b(e=>e.tenantState.error),a=b(e=>e.tenantState.activeTenantFetchState.fetchState),c=b(e=>_(e)),d=h.getSignedInUser();return u.useLayoutEffect(()=>{const e=h.getActiveTenantForUser()?.tenantId??null;p.current!==e&&(p.current=e,f.current=!1,r.current=!1,s(T.TENANT_FETCHING)),!f.current||a!=="Completed"&&a!=="Error"||(f.current=!1),!r.current||n!=="Completed"&&n!=="Error"||(r.current=!1)},[a,n]),u.useEffect(()=>{const e=h.getActiveTenantForUser()?.tenantId;f.current===!1&&d!=null&&e!=null&&S.shouldFetchActiveTenant(e)&&(f.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=h.getSignedInUser(),g=h.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(()=>{h.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(h.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())},[m.tenantsCoreDetailsInOrder,n]),u.useEffect(()=>{!h.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||($.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-DiLJJ0-W.js";import{a as u}from"./sentry-CRXtNjzG.js";import{h as y,g as b,k as w,u as A,N as k}from"./core-PVb_PTOa.js";import{Ib as N,eM as _,fi as U,Ic as L,mh as R,Id as z}from"./zeni-epic-state-4sJL0-hG.js";import{u as O,z as h,L as T,t as S,D as $,b as j}from"./index-D5j-ijm9.js";import"./mui-Bs_Wx3U8.js";import{t as P}from"./getLocaleForTenant-BlHoz8HV.js";import"./recharts-CreyyBLx.js";import"./analytics-BsMspvaD.js";import"./plaid-CT0unNLB.js";import"./dnd-DhtyOCgF.js";import"./stripe-DMRn4zHo.js";import"./lottie-DGoffhx5.js";import"./lexical-CVfRQHxx.js";import"./pdf-Cq31LyOe.js";import"./utils-CfmtJLRd.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]="3d360737-e2d3-4130-bd72-c1b8c16ca050",t._sentryDebugIdIdentifier="sentry-dbid-3d360737-e2d3-4130-bd72-c1b8c16ca050")}catch{}})();const Q=w(function(t){return{fetchState:t.tenantState.fetchState,activeTenantFetchState:t.tenantState.activeTenantFetchState.fetchState,currentTenant:_(t),tenantsInOrder:z(t).tenantsInOrder}})(function({fetchState:t,activeTenantFetchState:s,currentTenant:o,tenantsInOrder:f}){const r=A(),p=new URLSearchParams(r.search);if(o==null||t!=="Completed"&&s!=="Completed")return null;{let m="";const n=f.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=j(c,p);return v.jsx(k,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:I}})}});function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=O(),f=u.useRef(!1),r=u.useRef(!1),p=u.useRef(null),m=b(e=>N(e)),n=b(e=>e.tenantState.fetchState),i=b(e=>e.tenantState.error),a=b(e=>e.tenantState.activeTenantFetchState.fetchState),c=b(e=>_(e)),d=h.getSignedInUser();return u.useLayoutEffect(()=>{const e=h.getActiveTenantForUser()?.tenantId??null;p.current!==e&&(p.current=e,f.current=!1,r.current=!1,s(T.TENANT_FETCHING)),!f.current||a!=="Completed"&&a!=="Error"||(f.current=!1),!r.current||n!=="Completed"&&n!=="Error"||(r.current=!1)},[a,n]),u.useEffect(()=>{const e=h.getActiveTenantForUser()?.tenantId;f.current===!1&&d!=null&&e!=null&&S.shouldFetchActiveTenant(e)&&(f.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=h.getSignedInUser(),g=h.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(()=>{h.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(h.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())},[m.tenantsCoreDetailsInOrder,n]),u.useEffect(()=>{!h.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||($.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-ypyKWtbM.js";import{j as w,u as C,g as h,k as A,l as V}from"./core-CBFn_Yo_.js";import{M9 as k,Mg as _,fz as J,fy as K,fx as L,ii as W,Jh as q,pr as Q,eM as B,LH as D,ig as T,Ma as v,Mj as F,id as G,iC as j}from"./zeni-epic-state-DQMIbKEE.js";import{bm as X,K as R,r as N,z as U,h as M,p,d as S,v as z,bn as Y,o as H,bo as ee,m as te}from"./index-ChMtRDkl.js";import{n as O}from"./mui-D35VurIR.js";import"./sentry-ylIvhyeZ.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]="55377dbc-7a7a-407b-ac46-2078c9a2df31",e._sentryDebugIdIdentifier="sentry-dbid-55377dbc-7a7a-407b-ac46-2078c9a2df31")}catch{}})();const ne=A(null,function(e,t){return{onSaveVendor:n=>{e(W(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(q("common")),n!=null&&e(Q(n))},onGetOtp:n=>{e(L(n,"BillPayVendor"))},onResendOtp:n=>{e(K(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(J(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(_(n,a,o))}}})(X);function Z({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(c=>k(c,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=O.div`
1
+ import{j as l}from"./liveblocks-DiLJJ0-W.js";import{j as w,u as C,g as h,k as A,l as B}from"./core-PVb_PTOa.js";import{M9 as k,Mg as _,fz as J,fy as K,fx as L,ii as W,Jh as q,pr as Q,eM as V,LH as D,ig as T,Ma as S,Mj as F,id as G,iC as j}from"./zeni-epic-state-4sJL0-hG.js";import{bm as X,K as R,n as N,z as U,h as M,p,l as v,B as z,bn as Y,o as H,bo as ee,r as te}from"./index-D5j-ijm9.js";import{n as O}from"./mui-Bs_Wx3U8.js";import"./sentry-CRXtNjzG.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]="03aca4d3-e8b0-4b31-abf1-2001d0e0b182",e._sentryDebugIdIdentifier="sentry-dbid-03aca4d3-e8b0-4b31-abf1-2001d0e0b182")}catch{}})();const ne=A(null,function(e,t){return{onSaveVendor:n=>{e(W(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(q("common")),n!=null&&e(Q(n))},onGetOtp:n=>{e(L(n,"BillPayVendor"))},onResendOtp:n=>{e(K(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(J(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(_(n,a,o))}}})(X);function Z({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h(i=>k(i,e));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=O.div`
2
2
  display: flex;
3
3
  height: 100vh;
4
4
  width: 100%;
@@ -6,7 +6,7 @@ import{j as l}from"./liveblocks-ypyKWtbM.js";import{j as w,u as C,g as h,k as A,
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,oe=A(function(e,t){const{vendorId:n,billId:a}=t,o=k(e,n),s=D(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,a);return{billId:a,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}},function(e,t){const{navigate:n,location:a,vendorId:o}=t;return{onFetchBankName:s=>{e(j(s))},onSaveHandler:s=>{e(G(t.bankAccountContext,s,"standard",o))},onCancel:()=>{(()=>{const s=p(a.state?.pathnameStackToGoBack),c=s.poppedPathname??P();n(c,{state:{pathnameStackToGoBack:s.newStack}})})(),e(v())},onACHDetailsUpdated:s=>{const{bankAccountSection:c}=s;e(F({data:c}))},onBackClick:()=>{if(e(T({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")n("../",{relative:"path"});else{const s=p(t.location.state?.pathnameStackToGoBack),c=s.poppedPathname??P(0);t.navigate(c,{state:{pathnameStackToGoBack:s.newStack}})}e(v())}}})(Y);function fe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=R(),{vendorId:s,billId:c}=V(),i=e??s,{useFeatureGate:r}=N(),d=U.getSignedInUser(),b=h(u=>B(u)),g=M(),x=p(a.state?.pathnameStackToGoBack),f=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h(u=>k(u,i)),{isFeatureEnabled:I}=r(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=r(S.isDepositAccountsFeatureEnabled);if(d==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(z,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:g.colors.grey5}}):l.jsxs(ae,{windowSize:o,children:[l.jsx(Z,{vendorId:i,billId:c}),l.jsx(oe,{location:a,navigate:n,billId:c,vendorId:i,currentTenant:b,bankAccountContext:f,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const P=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t},me=(e,t,n)=>{let a=`/${e}/bill/${encodeURIComponent(t)}`;return n=="draft"&&(a+="/edit"),a},he=e=>`/${e}/bills`,ke=(e,t)=>{let n=`/${e}/bill`;return n=t!=null?n.concat(`/${t}/edit`):n.concat("/new"),n},E=(e,t,n,a)=>{let o=`/${e}/bill`;return o+=n!=null?`/${n}/edit/vendor`:"/new/vendor",o+=a!=null?`/${a}/edit/${t}`:`/create/${t}`,o};function ve(e,t,n){return E(e,"ach",t,n)}function Se(e,t,n){return E(e,"domestic",t,n)}function ge(e,t,n){return E(e,"international",t,n)}const se=(e,t,n)=>{let a=`/${e}/bill/`;return a=n!=null?a.concat(`${encodeURIComponent(n)}/${t}/`):a.concat(`new/${t}/`),a},re=O.div`
9
+ `,oe=A(function(e,t){const{vendorId:n,billId:a}=t,o=k(e,n),s=D(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,a);return{billId:a,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}},function(e,t){const{navigate:n,location:a,vendorId:o}=t;return{onFetchBankName:s=>{e(j(s))},onSaveHandler:s=>{e(G(t.bankAccountContext,s,"standard",o))},onCancel:()=>{(()=>{const s=p(a.state?.pathnameStackToGoBack),i=s.poppedPathname??P();n(i,{state:{pathnameStackToGoBack:s.newStack}})})(),e(S())},onACHDetailsUpdated:s=>{const{bankAccountSection:i}=s;e(F({data:i}))},onBackClick:()=>{if(e(T({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")n("../",{relative:"path"});else{const s=p(t.location.state?.pathnameStackToGoBack),i=s.poppedPathname??P(0);t.navigate(i,{state:{pathnameStackToGoBack:s.newStack}})}e(S())}}})(Y);function fe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=R(),{vendorId:s,billId:i}=B(),c=e??s,{useFeatureGate:r}=N(),d=U.getSignedInUser(),b=h(u=>V(u)),g=M(),x=p(a.state?.pathnameStackToGoBack),f=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h(u=>k(u,c)),{isFeatureEnabled:I}=r(v.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=r(v.isDepositAccountsFeatureEnabled);if(d==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(z,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:g.colors.grey5}}):l.jsxs(ae,{windowSize:o,children:[l.jsx(Z,{vendorId:c,billId:i}),l.jsx(oe,{location:a,navigate:n,billId:i,vendorId:c,currentTenant:b,bankAccountContext:f,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const P=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t},me=(e,t,n)=>{let a=`/${e}/bill/${encodeURIComponent(t)}`;return n=="draft"&&(a+="/edit"),a},he=e=>`/${e}/bills`,ke=(e,t)=>{let n=`/${e}/bill`;return n=t!=null?n.concat(`/${t}/edit`):n.concat("/new"),n},E=(e,t,n,a)=>{let o=`/${e}/bill`;return o+=n!=null?`/${n}/edit/vendor`:"/new/vendor",o+=a!=null?`/${a}/edit/${t}`:`/create/${t}`,o};function Se(e,t,n){return E(e,"ach",t,n)}function ve(e,t,n){return E(e,"domestic",t,n)}function ge(e,t,n){return E(e,"international",t,n)}const se=(e,t,n)=>{let a=`/${e}/bill/`;return a=n!=null?a.concat(`${encodeURIComponent(n)}/${t}/`):a.concat(`new/${t}/`),a},re=O.div`
10
10
  display: flex;
11
11
  height: 100vh;
12
12
  width: 100%;
@@ -15,4 +15,4 @@ import{j as l}from"./liveblocks-ypyKWtbM.js";import{j as w,u as C,g as h,k as A,
15
15
  align-items: center;
16
16
  background-color: ${e=>e.theme.colors.grey4};
17
17
  box-shadow: ${e=>`0px 2px ${H.sp1} ${e.theme.colors.dropShadowNormal}`};
18
- `,ce=A(function(e,t){const{vendorId:n,billId:a}=t,o=k(e,n),s=D(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,a);return{billId:a,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}},function(e,t){const{billId:n,navigate:a,location:o,vendorId:s,currentTenant:c}=t,{tenantEmailDomain:i}=c;return{onFetchBankName:r=>{e(j(r))},onSaveHandler:r=>{e(G(t.bankAccountContext,r,"us-domestic",s))},onWireDetailsUpdated:r=>{const{bankAccountSection:d}=r;e(F({data:d}))},onCancel:()=>{(()=>{const r=p(o.state?.pathnameStackToGoBack),d=r.poppedPathname??$();a(d,{state:{pathnameStackToGoBack:r.newStack}})})(),e(v())},onAddressClick:r=>{if(t.bankAccountContext==="express-pay")a("./add-address");else{const d=se(i,r,n),b=te(o.state?.pathnameStackToGoBack,o.pathname);a(d,{state:{pathnameStackToGoBack:b}})}},onBackClick:()=>{if(e(T({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")a("../",{relative:"path"});else{const r=p(t.location.state?.pathnameStackToGoBack),d=r.poppedPathname??$(0);t.navigate(d,{state:{pathnameStackToGoBack:r.newStack}})}e(v())}}})(ee);function xe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=R(),{vendorId:s,billId:c}=V(),i=e??s,r=U.getSignedInUser(),{useFeatureGate:d}=N(),b=M(),g=h(u=>B(u)),x=p(a.state?.pathnameStackToGoBack),f=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h(u=>k(u,i)),{isFeatureEnabled:I}=d(S.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=d(S.isDepositAccountsFeatureEnabled);if(r==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(z,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:b.colors.grey5,boxShadow:`0px 2px ${H.sp1} ${b.colors.dropShadowNormal}`}}):l.jsxs(re,{windowSize:o,children:[l.jsx(Z,{vendorId:i,billId:c}),l.jsx(ce,{location:a,navigate:n,billId:c,vendorId:i,currentTenant:g,bankAccountContext:f,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const $=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t};export{fe as A,xe as D,Z as V,me as a,se as b,ke as c,Se as d,he as g,ge as i,ve as v};
18
+ `,ie=A(function(e,t){const{vendorId:n,billId:a}=t,o=k(e,n),s=D(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,a);return{billId:a,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}},function(e,t){const{billId:n,navigate:a,location:o,vendorId:s,currentTenant:i}=t,{tenantEmailDomain:c}=i;return{onFetchBankName:r=>{e(j(r))},onSaveHandler:r=>{e(G(t.bankAccountContext,r,"us-domestic",s))},onWireDetailsUpdated:r=>{const{bankAccountSection:d}=r;e(F({data:d}))},onCancel:()=>{(()=>{const r=p(o.state?.pathnameStackToGoBack),d=r.poppedPathname??$();a(d,{state:{pathnameStackToGoBack:r.newStack}})})(),e(S())},onAddressClick:r=>{if(t.bankAccountContext==="express-pay")a("./add-address");else{const d=se(c,r,n),b=te(o.state?.pathnameStackToGoBack,o.pathname);a(d,{state:{pathnameStackToGoBack:b}})}},onBackClick:()=>{if(e(T({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")a("../",{relative:"path"});else{const r=p(t.location.state?.pathnameStackToGoBack),d=r.poppedPathname??$(0);t.navigate(d,{state:{pathnameStackToGoBack:r.newStack}})}e(S())}}})(ee);function xe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=R(),{vendorId:s,billId:i}=B(),c=e??s,r=U.getSignedInUser(),{useFeatureGate:d}=N(),b=M(),g=h(u=>V(u)),x=p(a.state?.pathnameStackToGoBack),f=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h(u=>k(u,c)),{isFeatureEnabled:I}=d(v.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=d(v.isDepositAccountsFeatureEnabled);if(r==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(z,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:b.colors.grey5,boxShadow:`0px 2px ${H.sp1} ${b.colors.dropShadowNormal}`}}):l.jsxs(re,{windowSize:o,children:[l.jsx(Z,{vendorId:c,billId:i}),l.jsx(ie,{location:a,navigate:n,billId:i,vendorId:c,currentTenant:g,bankAccountContext:f,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const $=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t};export{fe as A,xe as D,Z as V,me as a,se as b,ke as c,ve as d,he as g,ge as i,Se as v};
@@ -0,0 +1 @@
1
+ import{j as i}from"./liveblocks-DiLJJ0-W.js";import{K as f,C as l,h as c}from"./index-D5j-ijm9.js";import{D as p}from"./mui-Bs_Wx3U8.js";import"./sentry-CRXtNjzG.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]="d3dd7346-4961-45dd-895f-3ffbae5d7e32",e._sentryDebugIdIdentifier="sentry-dbid-d3dd7346-4961-45dd-895f-3ffbae5d7e32")}catch{}})();const u={drawerLeftMargin:new l(0,0,240)};function h(e){const{isOpen:r,drawerLeftMargin:o,children:n,onClose:t}=e,d=f(),s=o?.valuePx(d)??u.drawerLeftMargin.valuePx(d),a=c();return i.jsx(p,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${s})`}},slotProps:{backdrop:{style:{backgroundColor:a.colors.black,opacity:.8,cursor:"pointer"}}},onClose:t,children:n})}export{h as D};
@@ -1 +1 @@
1
- import{j as s}from"./liveblocks-ypyKWtbM.js";import{a as d}from"./sentry-ylIvhyeZ.js";import{j as A,h as B,u as J,l as N,g as l,N as q,k as F,n as M,o as O}from"./core-CBFn_Yo_.js";import{Ko as _,eM as K,JN as R,km as W,Gv as k,Kt as Y,Jg as $,jm as z,Gw as S,JS as V,JT as H,Ji as L,Jh as Q}from"./zeni-epic-state-DQMIbKEE.js";import{aM as U,c as X,p as Z,m as tt}from"./index-ChMtRDkl.js";import"./mui-D35VurIR.js";import{d as b}from"./decodeURIComponentSafe-CqMC__af.js";import{w as et}from"./withTransactionSidePanel-Bon_8p_2.js";import{e as at,b as nt}from"./routePaths-nlWWZ4ZI.js";import"./recharts-CSEhqlTE.js";import"./analytics-B3Q4UmLh.js";import"./plaid-O0aD-5ib.js";import"./dnd-1A4kYEBz.js";import"./stripe-DMRn4zHo.js";import"./lottie-xwOlCP2t.js";import"./lexical-Blenvqjv.js";import"./pdf-B5d6xxqf.js";import"./utils-0qzBiEB0.js";import"./useAskAiCfoHostNavButtonProps-IrvXJbyC.js";import"./useFetchSuggestedQuestionsWhenReady-kulIc847.js";import"./TransactionDetailScreen---9iPrdg.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]="6d419d33-a8d5-4425-ab2b-ae3eede334be",a._sentryDebugIdIdentifier="sentry-dbid-6d419d33-a8d5-4425-ab2b-ae3eede334be")}catch{}})();const ot=F(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:X,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(L({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(Q("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(V()),a(H()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??I();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(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(k(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}})(U),it=et(function({entityType:a,...t}){const e=A(),o=B(),c=J(),[m,T]=d.useState(!1),[h,g]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:j,entityNameEncoded:w}=N(),r=b(j??""),p=b(w??""),u=rt(r,p),x=[r,p].filter(n=>n!=null),i={name:p,id:r,type:a,zeniId:r,qboId:r},D=l(n=>_(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),G=l(n=>K(n).company?.companyInfo.firstMonthOfFY??1),f=l(n=>R(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&u===!0&&(T(!0),o(W(i)))},[m,u,i]);const E=l(n=>n.trendState.fetchState),P=f?.selectedPeriod?.timePeriod??D,v=function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y}(f?.selectedPeriod?.timePeriod,D);return d.useEffect(()=>{m===!0&&h===!1&&E==="Completed"&&(g(!0),P!=null&&o(k(i,"EntityDetail",{timeframe:f?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))},[m,h,E]),u?s.jsx(ot,{firstMonthOfFY:G,tenantEmailDomain:C,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:v,resetTrendIsFetchedStates:()=>{T(!1),g(!1)},...t}):s.jsx(q,{to:I(x.length)})}),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,I=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function wt({entityType:a}){return s.jsx(M,{children:s.jsx(O,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{wt as EntityDetailRoutes,wt as default};
1
+ import{j as s}from"./liveblocks-DiLJJ0-W.js";import{a as d}from"./sentry-CRXtNjzG.js";import{j as A,h as B,u as J,l as N,g as l,N as q,k as F,n as M,o as O}from"./core-PVb_PTOa.js";import{Ko as _,eM as K,JN as R,km as W,Gv as I,Kt as Y,Jg as $,jm as z,Gw as S,JS as V,JT as H,Ji as L,Jh as Q}from"./zeni-epic-state-4sJL0-hG.js";import{aM as U,d as X,p as Z,r as tt}from"./index-D5j-ijm9.js";import"./mui-Bs_Wx3U8.js";import{d as k}from"./decodeURIComponentSafe-mU8LeJGH.js";import{w as et}from"./withTransactionSidePanel-LH23g840.js";import{e as at,b as nt}from"./routePaths-Cu41oBox.js";import"./recharts-CreyyBLx.js";import"./analytics-BsMspvaD.js";import"./plaid-CT0unNLB.js";import"./dnd-DhtyOCgF.js";import"./stripe-DMRn4zHo.js";import"./lottie-DGoffhx5.js";import"./lexical-CVfRQHxx.js";import"./pdf-Cq31LyOe.js";import"./utils-CfmtJLRd.js";import"./useAskAiCfoHostNavButtonProps-ZQtgg5zD.js";import"./useFetchSuggestedQuestionsWhenReady-wbg5b6I3.js";import"./TransactionDetailScreen-DaK6ceRt.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]="34f3294f-9e86-49f7-961c-8ffe16a1ee14",a._sentryDebugIdIdentifier="sentry-dbid-34f3294f-9e86-49f7-961c-8ffe16a1ee14")}catch{}})();const ot=F(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:X,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(L({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(Q("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(V()),a(H()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??C();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(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}))}}}})(U),it=et(function({entityType:a,...t}){const e=A(),o=B(),c=J(),[m,T]=d.useState(!1),[h,g]=d.useState(!1),{tenantEmailDomain:b,entityIdEncoded:j,entityNameEncoded:w}=N(),r=k(j??""),f=k(w??""),p=rt(r,f),x=[r,f].filter(n=>n!=null),i={name:f,id:r,type:a,zeniId:r,qboId:r},D=l(n=>_(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter")),G=l(n=>K(n).company?.companyInfo.firstMonthOfFY??1),u=l(n=>R(n.trendWithTransactionsState,i,"EntityDetail"));d.useEffect(()=>{m===!1&&p===!0&&(T(!0),o(W(i)))},[m,p,i]);const E=l(n=>n.trendState.fetchState),P=u?.selectedPeriod?.timePeriod??D,v=function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y}(u?.selectedPeriod?.timePeriod,D);return d.useEffect(()=>{m===!0&&h===!1&&E==="Completed"&&(g(!0),P!=null&&o(I(i,"EntityDetail",{timeframe:u?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))},[m,h,E]),p?s.jsx(ot,{firstMonthOfFY:G,tenantEmailDomain:b,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:v,resetTrendIsFetchedStates:()=>{T(!1),g(!1)},...t}):s.jsx(q,{to:C(x.length)})}),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,C=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function wt({entityType:a}){return s.jsx(M,{children:s.jsx(O,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{wt as EntityDetailRoutes,wt as default};