@zeniai/web-app-ui 5.0.26-dev → 5.0.27-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/dist/assets/AddressRoutes-0TGuT2xq.js +1 -0
  2. package/dist/assets/AddressScreen-Cuxn6jUb.js +9 -0
  3. package/dist/assets/{AiCfoScreen-CyTokZKd.js → AiCfoScreen-DWkNdv1K.js} +2 -2
  4. package/dist/assets/BillPayApprovalRoutes-CLMXdAbQ.js +1 -0
  5. package/dist/assets/{BillPayRoutes-CSpnmpVl.js → BillPayRoutes-BG-syOfw.js} +6 -6
  6. package/dist/assets/{BusinessVerificationPageScreen-XAQKreuQ.js → BusinessVerificationPageScreen-BB9F88mK.js} +2 -2
  7. package/dist/assets/{ChargeCardRoutes-C39jkt7F.js → ChargeCardRoutes-DkULQd3q.js} +9 -9
  8. package/dist/assets/CompanyPassportScreen-DsQqH3R_.js +1 -0
  9. package/dist/assets/ConnectionAuthScreen-UNrq0bOs.js +11 -0
  10. package/dist/assets/CustomerOnboardingAuthScreen-Cv8y1n9u.js +1 -0
  11. package/dist/assets/CustomerOnboardingRoutes-lSSTd4er.js +23 -0
  12. package/dist/assets/{DashboardRoutes-BeeURxU7.js → DashboardRoutes-CITCXfQh.js} +3 -3
  13. package/dist/assets/DefaultTenantHome-DnXJprlQ.js +1 -0
  14. package/dist/assets/{DomesticWireDetailScreen-rVUtw5dn.js → DomesticWireDetailScreen-DswgjtZ7.js} +4 -4
  15. package/dist/assets/{DrawerScreen-D2sVaWmT.js → DrawerScreen-W83sAi_k.js} +1 -1
  16. package/dist/assets/EntityDetailRoutes-DFMGt3cF.js +1 -0
  17. package/dist/assets/{ExpenseAutomationRoutes-Dnhz3G0Y.js → ExpenseAutomationRoutes-BwBWvBQz.js} +4 -4
  18. package/dist/assets/FeaturePreviewScreen-D_2XoCHl.js +1 -0
  19. package/dist/assets/MagicLinkRoutes-DMKCfw5O.js +72 -0
  20. package/dist/assets/MagicLinkSignInScreen-BcOqXx3I.js +12 -0
  21. package/dist/assets/{MobileAppDrawer-CPQuEteC.js → MobileAppDrawer-DvyjBd4g.js} +1 -1
  22. package/dist/assets/NotFoundScreen-BHPCFLTM.js +1 -0
  23. package/dist/assets/{NotificationRoutes-By1RzVqo.js → NotificationRoutes-CgSoQGEX.js} +1 -1
  24. package/dist/assets/PandLWithForecastRoutes-D6-VHxb-.js +1 -0
  25. package/dist/assets/PeopleRoutes-Deq8C3bu.js +22 -0
  26. package/dist/assets/PerformanceRoutes-C8KioDe9.js +1 -0
  27. package/dist/assets/{Preview-BAKw3AAf.js → Preview-BNMITNPE.js} +1 -1
  28. package/dist/assets/{QBOConnectionScreen-8whb3Hsr.js → QBOConnectionScreen-B-4fO2ne.js} +1 -1
  29. package/dist/assets/ReferralListScreen-BM1gHESu.js +5 -0
  30. package/dist/assets/ReimbursementApprovalRoutes-Dtwap8JJ.js +1 -0
  31. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-CMXdWUhi.js → ReimbursementApprovalRuleDetailScreen-B5Ck2C9Y.js} +1 -1
  32. package/dist/assets/ReimbursementRoutes-cLh7G6_T.js +68 -0
  33. package/dist/assets/{ReportsRoutes-B2iWUWYi.js → ReportsRoutes-BBHBFqy6.js} +1 -1
  34. package/dist/assets/RewardsRoutes-DBKBcVt9.js +1 -0
  35. package/dist/assets/ScreenRoutes-zeq48oCM.js +2 -0
  36. package/dist/assets/{SettingsRoutes-Bjw3TffC.js → SettingsRoutes-Cw1W0wHt.js} +7 -7
  37. package/dist/assets/{SetupPagesScreen-DxIIsva3.js → SetupPagesScreen-C_S8AZRH.js} +5 -5
  38. package/dist/assets/SignInScreen-CwqEUOO8.js +1 -0
  39. package/dist/assets/SignOutScreen-kZlEM8yn.js +9 -0
  40. package/dist/assets/TaskListScreen-CqTOqB17.js +9 -0
  41. package/dist/assets/TaskRoutes-D4-Lbjxl.js +9 -0
  42. package/dist/assets/TransactionDetailRoutes-BXbmHxwN.js +1 -0
  43. package/dist/assets/{TransactionDetailScreen-lxeDv5DJ.js → TransactionDetailScreen-ClRsLpwG.js} +2 -2
  44. package/dist/assets/{TransactionListRoutes-C-9Rmaut.js → TransactionListRoutes-CmhrN_6s.js} +1 -1
  45. package/dist/assets/{TreasuryRoutes-GImokxmZ.js → TreasuryRoutes-Bgzquerm.js} +6 -6
  46. package/dist/assets/{VendorsRoutes-DWeQQswE.js → VendorsRoutes-Df3m6Veu.js} +16 -16
  47. package/dist/assets/WiseConfirmationScreen-BDSaWGqI.js +12 -0
  48. package/dist/assets/ZeniAccountRoutes-bTvT8A0g.js +66 -0
  49. package/dist/assets/ZeniAccountStatementScreen-COih_FbC.js +9 -0
  50. package/dist/assets/{accountMappingHelper-DdMTXagH.js → accountMappingHelper-Br2QJsWh.js} +1 -1
  51. package/dist/assets/{analytics-BsMspvaD.js → analytics-CaofNoIK.js} +1 -1
  52. package/dist/assets/analyticsHelper-26beXk6v.js +1 -0
  53. package/dist/assets/{core-PVb_PTOa.js → core-r3zPXrnR.js} +1 -1
  54. package/dist/assets/{decodeURIComponentSafe-mU8LeJGH.js → decodeURIComponentSafe-DIvx_0bc.js} +1 -1
  55. package/dist/assets/{dnd-DhtyOCgF.js → dnd-dQAnWf63.js} +1 -1
  56. package/dist/assets/{empty-wep5Q-1y.js → empty-DOFWY-gL.js} +1 -1
  57. package/dist/assets/{empty-HlfDqjBl.js → empty-Dguy-xnr.js} +1 -1
  58. package/dist/assets/{emptyVideoElement-DpJB9lfW.js → emptyVideoElement-BqRp7P8T.js} +1 -1
  59. package/dist/assets/epic-kHR8aIZ1.js +2 -0
  60. package/dist/assets/getLocaleForTenant-CQnHebPH.js +1 -0
  61. package/dist/assets/{index-BCcxTJng.js → index-BG4MEhH2.js} +1 -1
  62. package/dist/assets/{index-DnBq3nCg.js → index-BGpP6oaB.js} +1 -1
  63. package/dist/assets/{index-Dn-dGYDp.js → index-BTkf3iCj.js} +1 -1
  64. package/dist/assets/{index-BWo_N8M7.js → index-D-9tzkhM.js} +1 -1
  65. package/dist/assets/{index-P5rhD5Na.js → index-DHwEE904.js} +13666 -13626
  66. package/dist/assets/{index-CsPK-ZcF.js → index-DJbMCLsX.js} +2 -2
  67. package/dist/assets/{index-yb_kldBQ.js → index-DYvO_TO1.js} +1 -1
  68. package/dist/assets/{lexical-CVfRQHxx.js → lexical-DPC-NxTc.js} +1 -1
  69. package/dist/assets/{liveblocks-DiLJJ0-W.js → liveblocks-BUJqCtmZ.js} +1 -1
  70. package/dist/assets/{lottie-DGoffhx5.js → lottie-D8AaXarT.js} +1 -1
  71. package/dist/assets/{mui-Bs_Wx3U8.js → mui-BD9ReF4V.js} +1 -1
  72. package/dist/assets/{pathToGoBack-BrzgfZOY.js → pathToGoBack-D3dTZRn8.js} +1 -1
  73. package/dist/assets/{pdf-Cq31LyOe.js → pdf-iZy3i289.js} +4 -4
  74. package/dist/assets/{pdf-lib-CKEHYQuo.js → pdf-lib-C-qCwtZm.js} +1 -1
  75. package/dist/assets/{plaid-CT0unNLB.js → plaid-CxNli5Mg.js} +1 -1
  76. package/dist/assets/{pusher-BDivubpF.js → pusher-0ovRh4wm.js} +1 -1
  77. package/dist/assets/{react-D12Thgxw.js → react-Bt99sb5m.js} +1 -1
  78. package/dist/assets/{react-AIza423u.js → react-Cd-2CZq4.js} +1 -1
  79. package/dist/assets/{react-B22DUlFC.js → react-DSIBkdUb.js} +1 -1
  80. package/dist/assets/{react-x856Ci_R.js → react-Db_3nqMy.js} +1 -1
  81. package/dist/assets/{react-CQHBdAiW.js → react-DhnULN7m.js} +1 -1
  82. package/dist/assets/{react-D3IfLVtg.js → react-DqIQJ9MY.js} +1 -1
  83. package/dist/assets/{recharts-CreyyBLx.js → recharts-DD1DDktN.js} +1 -1
  84. package/dist/assets/{routePaths-C6cVlXoV.js → routePaths-BGzy8Dqj.js} +1 -1
  85. package/dist/assets/{sentry-CRXtNjzG.js → sentry-BbjYSgze.js} +1 -1
  86. package/dist/assets/{url-DraJKqO-.js → url-BaKOjXZM.js} +1 -1
  87. package/dist/assets/{url-arGh5ZAs.js → url-DYDNdwVU.js} +1 -1
  88. package/dist/assets/useAskAiCfoHostNavButtonProps-CIdYxL8V.js +1 -0
  89. package/dist/assets/{useDeviceId-B5nwTsrh.js → useDeviceId-DZSzfiw7.js} +1 -1
  90. package/dist/assets/useFetchSuggestedQuestionsWhenReady-DaXgh6Pr.js +1 -0
  91. package/dist/assets/{useInitialThreadRequest-DNzJLWO_.js → useInitialThreadRequest-C6Fi1v7Q.js} +1 -1
  92. package/dist/assets/{utils-CfmtJLRd.js → utils-gH_xiFg7.js} +1 -1
  93. package/dist/assets/{withTransactionSidePanel-9be4np7g.js → withTransactionSidePanel-C7832Ype.js} +2 -2
  94. package/dist/assets/{zeni-epic-state-4sJL0-hG.js → zeni-epic-state-Cdw8EpcM.js} +7 -7
  95. package/dist/index.html +1 -1
  96. package/package.json +3 -3
  97. package/dist/assets/AddressRoutes-CV8Sw8CP.js +0 -1
  98. package/dist/assets/AddressScreen-CG-B80_4.js +0 -9
  99. package/dist/assets/BillPayApprovalRoutes-BwSUlLgD.js +0 -1
  100. package/dist/assets/CompanyPassportScreen-BbokQ4hH.js +0 -1
  101. package/dist/assets/ConnectionAuthScreen-eyPxOj3X.js +0 -11
  102. package/dist/assets/CustomerOnboardingAuthScreen-DwO0_vwT.js +0 -1
  103. package/dist/assets/CustomerOnboardingRoutes-C6xc2c4j.js +0 -23
  104. package/dist/assets/DefaultTenantHome-xvMFl-dC.js +0 -1
  105. package/dist/assets/EntityDetailRoutes-CvQH6iMQ.js +0 -1
  106. package/dist/assets/FeaturePreviewScreen-DsVyovAJ.js +0 -1
  107. package/dist/assets/MagicLinkRoutes-DSYzYj69.js +0 -72
  108. package/dist/assets/MagicLinkSignInScreen-CYT_mA9u.js +0 -12
  109. package/dist/assets/NotFoundScreen-D5gX25SL.js +0 -1
  110. package/dist/assets/PandLWithForecastRoutes-zIKfcrxm.js +0 -1
  111. package/dist/assets/PeopleRoutes-H0bbY-ET.js +0 -22
  112. package/dist/assets/PerformanceRoutes-LsTpAH12.js +0 -1
  113. package/dist/assets/ReferralListScreen-CyEKJZYn.js +0 -5
  114. package/dist/assets/ReimbursementApprovalRoutes-Cu9gxM3S.js +0 -1
  115. package/dist/assets/ReimbursementRoutes-XZANwX-H.js +0 -68
  116. package/dist/assets/RewardsRoutes-CcpZZ0yW.js +0 -1
  117. package/dist/assets/ScreenRoutes-DMJirfOH.js +0 -2
  118. package/dist/assets/SignInScreen-x6v4P1q0.js +0 -1
  119. package/dist/assets/SignOutScreen-DYYqM-_R.js +0 -9
  120. package/dist/assets/TaskListScreen-BW-oMerA.js +0 -9
  121. package/dist/assets/TaskRoutes-NyhjOGv3.js +0 -9
  122. package/dist/assets/TransactionDetailRoutes-CPn7atS_.js +0 -1
  123. package/dist/assets/WiseConfirmationScreen-Crwiq_l2.js +0 -12
  124. package/dist/assets/ZeniAccountRoutes-CEoa3jip.js +0 -66
  125. package/dist/assets/ZeniAccountStatementScreen-DI0ZEKQp.js +0 -9
  126. package/dist/assets/analyticsHelper-DqgMIH9d.js +0 -1
  127. package/dist/assets/epic-CMMVrD8V.js +0 -2
  128. package/dist/assets/getLocaleForTenant-yD-xTTtK.js +0 -1
  129. package/dist/assets/useAskAiCfoHostNavButtonProps-BqWqtj0f.js +0 -1
  130. package/dist/assets/useFetchSuggestedQuestionsWhenReady-BJfLdWEG.js +0 -1
@@ -0,0 +1,5 @@
1
+ import{j as s}from"./liveblocks-BUJqCtmZ.js";import{a as o}from"./sentry-BbjYSgze.js";import{g as f,j as H,h as N,u as V,k as W}from"./core-r3zPXrnR.js";import{h as _,K as z,z as R,b2 as U,C as $,N as X,M as Z,y as q,d as l,g as G,a1 as J,b3 as K}from"./index-DHwEE904.js";import{eX as Q,eN as Y,Ly as I,Lz as ee,ts as ae,ti as g,eZ as re,bM as ne,tn as te,LA as se}from"./zeni-epic-state-Cdw8EpcM.js";import{D as oe,e as ie,n as le,S as ce}from"./mui-BD9ReF4V.js";import{u as de}from"./useAskAiCfoHostNavButtonProps-CIdYxL8V.js";import{c as fe}from"./useFetchSuggestedQuestionsWhenReady-DaXgh6Pr.js";import{M as ue}from"./MobileAppDrawer-DvyjBd4g.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]="88109cc2-c6d6-4d67-acb5-8001cd69b0ca",e._sentryDebugIdIdentifier="sentry-dbid-88109cc2-c6d6-4d67-acb5-8001cd69b0ca")}catch{}})();const pe={overlayWidth:new $(100,100,30)},we=({isReferralDrawerOpen:e,closeDrawerHandler:a})=>{const r=_(),n=z();if(R.getSignedInUser()==null)throw Error("Can't access How Referral works without signing in...");const i=()=>{a(!0)},u=f(c=>Q(c));return s.jsx(oe,{anchor:"right",open:e,PaperProps:{style:{width:pe.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:r.colors.black,cursor:"pointer"}}},onClose:()=>i(),children:s.jsx(ie,{in:e,direction:"left",children:s.jsx(ge,{onClick:c=>c.stopPropagation(),children:s.jsx(U,{onDismissClick:i,rewardsPlan:u.rewardsPlan})})})})},ge=le(ce)`
2
+ display: flex;
3
+ min-height: 100%;
4
+ flex-direction: column;
5
+ `,P="refer-and-earn-status-update",ke=W(function(e){const a=I(e),r=e.referralViewState.rewardsPlanFetchState,n=ne([a,r]);return{inviteList:a.invitations,uiState:a.uiState,pendingBonus:a.pendingBonus,earnedBonus:a.earnedBonus,pendingReferrals:a.pendingReferrals,fetchState:n.fetchState,rewardsPlan:a.rewardsPlan}},function(e,a){const{navigate:r}=a;return{onColumnSortConfigChanged:(n,i)=>{e(se({sortOrder:i,sortkey:n}))},onInviteClick:()=>{l.trackRewardsPageClicked("invite via email"),r("../refer")},onHowItWorksClick:()=>{l.trackRewardsPageClicked("know more"),r("../how-it-works")},onResendInviteClick:n=>{l.trackRewardsPageClicked("resend invite"),e(te(n))},onBackClick:()=>{r("../",{relative:"path"})},onReloadInvitees:()=>{e(g(!0))},onCopyReferralLink:()=>{l.trackRewardsPageClicked("copy referral link")},onClickRefer:()=>{l.trackRewardsPageClicked("refer")},onEventReceived:n=>{n===P&&e(g(!0,!0))}}})(J(K));function Pe({isReferralDrawerOpen:e}){const a=H(),r=N(),n=V(),[i,u]=o.useState(!1),[c,x]=o.useState(!1),[D,A]=o.useState(!1),[k,C]=o.useState(!1),p=R.getSignedInUser(),h=f(t=>Y(t)),m=f(t=>I(t)),b=m.fetchState,w=f(t=>t.referralViewState.rewardsPlanFetchState),y=ee([m,w]),{areTenantIdsInSync:d}=X();o.useEffect(()=>{h?.rewardsLastViewedTime==null&&D===!1&&(r(ae()),A(!0))},[]),o.useEffect(()=>{!i&&b==="Not-Started"&&d&&(u(!0),r(g(!0)))},[b,r,d]),o.useEffect(()=>{!c&&w.fetchState==="Not-Started"&&d&&(x(!0),r(re(!0)))},[w,r,d]),o.useEffect(()=>{C(e!=null&&e===!0)},[e]);const[E,j]=o.useState(!1),v=t=>{j(t)},{isAiCfoOpen:O,setIsAiCfoOpen:L}=Z(),{isAiCfoAccessEnabled:T,onAskAiCfoClick:B}=de({isAiCfoOpen:O,setIsAiCfoOpen:L,mobileExploreReferrer:"Rewards"});fe({isDataReady:y===!0});const M={events:p?.userId!=null?[`private-${p.userId}.${P}`]:[],eventCallback:(t,S,F)=>{F.onEventReceived(t)}};return s.jsxs(s.Fragment,{children:[y===!0?s.jsx(q,{analytics:l,onLoad:t=>(S=>{p!=null&&S.trackPageLoaded(G.Event.rewardsPageViewed)})(t)}):null,s.jsx(ue,{isAppContentDrawerOpen:E,handleDrawerToggle:v}),k===!0?s.jsx(we,{closeDrawerHandler:()=>{C(!1),a("..")},isReferralDrawerOpen:k}):null,s.jsx(ke,{location:n,navigate:a,currentTenant:h,onClickMenuIcon:()=>{v(!0)},isAiCfoAccessEnabled:T,onAskAiCfoClick:B,...M})]})}export{Pe as R};
@@ -0,0 +1 @@
1
+ import{j as t}from"./liveblocks-BUJqCtmZ.js";import R from"./NotFoundScreen-BHPCFLTM.js";import{a as p}from"./sentry-BbjYSgze.js";import{j as x,u as C,h as A,g as u,N as E,k,n as D,o as c}from"./core-r3zPXrnR.js";import{eN as T,Ms as g,MI as S,Cp as V,By as U,Co as m,Cf as _,MX as B}from"./zeni-epic-state-Cdw8EpcM.js";import{h as M,z as N,B as $,a1 as O,bI as W,aa as z}from"./index-DHwEE904.js";import"./mui-BD9ReF4V.js";import{R as v}from"./ReimbursementApprovalRuleDetailScreen-B5Ck2C9Y.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]="8bc8b1a8-d9d0-4e15-9f9e-06a5f43b4c3b",e._sentryDebugIdIdentifier="sentry-dbid-8bc8b1a8-d9d0-4e15-9f9e-06a5f43b4c3b")}catch{}})();const d="reimbursement-approval-rule-update",P=k(function(e){return{approvalView:g(e),remiSetupApproverViewUpdateData:S(e).remiSetupApproverViewUpdateData}},function(e,r){const{navigate:a,location:l}=r;return{onApprovalRulesEventReceived:n=>{n.endsWith(d)&&e(B(!1))},onBackClick:()=>{z(l)?a("../../"):a("../../../reimbursements/setup")},onDeleteRuleClick:n=>{e(_(n))},onEditRuleClick:n=>{n!=null?(e(m(n)),a(`./${n}/edit`)):(e(m()),a("./new"))}}})(O(W)),X=()=>{const e=x(),r=C(),a=A(),[l,n]=p.useState(!1),[f,y]=p.useState(!1),b=u(s=>s.remiSetupApproverViewState.fetchState),o=u(s=>T(s)),w=M(),i=u(s=>g(s)),h=u(s=>S(s).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{h?.updateStatus.fetchState==="Completed"&&a(V())},[h]),p.useEffect(()=>{l||b!=="Not-Started"||(n(!0),a(U(!0)))},[l,b,a]),N.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect(()=>{i.allApprovalRules.length===0&&i.fetchState==="Completed"&&(f||(y(!0),a(m())),e("./new"))},[f,i,a]);const j={events:o.companyId!=null?[`private-${o.companyId}.${d}`]:[],eventCallback:(s,q,I)=>{s.endsWith(d)&&I.onApprovalRulesEventReceived(s)}};return o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?t.jsx(E,{to:"../../promo"}):o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted!==!0||i.fetchState!=="Completed"&&i.fetchState!=="Error"?t.jsx($,{fetchState:"In-Progress",style:{backgroundColor:w.colors.grey5}}):t.jsx(P,{currentTenant:o,location:r,navigate:e,...j})};function Z(){return t.jsxs(D,{children:[t.jsx(c,{path:"/",element:t.jsx(X,{})}),t.jsx(c,{path:"/new",element:t.jsx(v,{})}),t.jsx(c,{path:"/:approvalRuleId/edit",element:t.jsx(v,{})}),t.jsx(c,{path:"*",element:t.jsx(R,{})})]})}export{Z as R};
@@ -1 +1 @@
1
- import{j as g}from"./liveblocks-DiLJJ0-W.js";import{a as y}from"./sentry-CRXtNjzG.js";import{j as w,h as A,u as C,l as T,g as b,k as E}from"./core-PVb_PTOa.js";import{ME as R,Mo as U,Cd as x,Cm as _,Ck as S,Cl as h,MF as k}from"./zeni-epic-state-4sJL0-hG.js";import{z as B,h as V,B as F,bz as j,aa as O}from"./index-P5rhD5Na.js";import"./mui-Bs_Wx3U8.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]="85117cef-51b5-46b2-9592-6db7d59ba058",e._sentryDebugIdIdentifier="sentry-dbid-85117cef-51b5-46b2-9592-6db7d59ba058")}catch{}})();function $(e){return k(e)==null}const M=E(function(e,a){const t=R(e),s=t.remiSetupApproverViewUpdateData?.type??"approval_create",n=s==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return a.approvalRuleId&&(l=t.allApprovalRules.findIndex(r=>r.approvalRuleId===a.approvalRuleId)===0),{localData:t,hideUpperBoundField:n,isLowerBoundDisabled:l,approvalUpdateActionType:s}},function(e,a){const{navigate:t,approvalUpdateDataView:s,approverViewData:n,approvalRuleId:l}=a,r=s.remiSetupApproverViewUpdateData?.type,i=O(a.location);return{onApprovalRuleDataUpdated:o=>{const u=p=>{const v=[];return p.forEach(c=>{const D=c.actors.selectedUsers.map(d=>({type:"user",subType:void 0,userId:d.userId,idType:"user",isImplicitActor:!1})),I=c.actors.selectedNonUsers.map(d=>{const f=!!$(d.value);return{type:f?"attribute":"role",subType:d.value,userId:void 0,idType:void 0,isImplicitActor:!f}}),m=D.concat(I);v.push({action:c.stepType.selectedOption,actors:m,operator:m.length>1?c.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),v};if(r==="approval_create"){const p={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(h(p))}else{const p={approvalRuleId:l,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(h(p))}},onResetClick:()=>{e(S()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(S()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(_())},onSaveRuleSuccess:()=>{t("../")}}})(j);function H(){const e=w(),a=A(),t=C(),{approvalRuleId:s}=T(),n=B.getSignedInUser(),l=V(),r=b(p=>R(p)),i=b(p=>U(p)),[o,u]=y.useState(!1);if(y.useEffect(()=>{o||(u(!0),a(x(!0)))}),y.useEffect(()=>{i.fetchState==="Not-Started"&&e(s!=null?"../../":"../")},[i,s]),n==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx(F,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):g.jsx(M,{navigate:e,approvalUpdateDataView:r,approvalRuleId:s,approverViewData:i,location:t})}export{H as R,$ as i};
1
+ import{j as g}from"./liveblocks-BUJqCtmZ.js";import{a as y}from"./sentry-BbjYSgze.js";import{j as w,h as A,u as C,l as T,g as b,k as U}from"./core-r3zPXrnR.js";import{MI as R,Ms as E,Ci as x,Cr as _,Cp as S,Cq as h,MJ as B}from"./zeni-epic-state-Cdw8EpcM.js";import{z as k,h as V,B as j,bz as F,aa as O}from"./index-DHwEE904.js";import"./mui-BD9ReF4V.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]="f365dc0b-f143-456b-a827-b32eaa25d66f",e._sentryDebugIdIdentifier="sentry-dbid-f365dc0b-f143-456b-a827-b32eaa25d66f")}catch{}})();function $(e){return B(e)==null}const M=U(function(e,a){const t=R(e),s=t.remiSetupApproverViewUpdateData?.type??"approval_create",n=s==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return a.approvalRuleId&&(l=t.allApprovalRules.findIndex(r=>r.approvalRuleId===a.approvalRuleId)===0),{localData:t,hideUpperBoundField:n,isLowerBoundDisabled:l,approvalUpdateActionType:s}},function(e,a){const{navigate:t,approvalUpdateDataView:s,approverViewData:n,approvalRuleId:l}=a,r=s.remiSetupApproverViewUpdateData?.type,i=O(a.location);return{onApprovalRuleDataUpdated:o=>{const u=p=>{const f=[];return p.forEach(c=>{const D=c.actors.selectedUsers.map(d=>({type:"user",subType:void 0,userId:d.userId,idType:"user",isImplicitActor:!1})),I=c.actors.selectedNonUsers.map(d=>{const m=!!$(d.value);return{type:m?"attribute":"role",subType:d.value,userId:void 0,idType:void 0,isImplicitActor:!m}}),v=D.concat(I);f.push({action:c.stepType.selectedOption,actors:v,operator:v.length>1?c.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),f};if(r==="approval_create"){const p={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(h(p))}else{const p={approvalRuleId:l,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(h(p))}},onResetClick:()=>{e(S()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(S()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(_())},onSaveRuleSuccess:()=>{t("../")}}})(F);function G(){const e=w(),a=A(),t=C(),{approvalRuleId:s}=T(),n=k.getSignedInUser(),l=V(),r=b(p=>R(p)),i=b(p=>E(p)),[o,u]=y.useState(!1);if(y.useEffect(()=>{o||(u(!0),a(x(!0)))}),y.useEffect(()=>{i.fetchState==="Not-Started"&&e(s!=null?"../../":"../")},[i,s]),n==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx(j,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):g.jsx(M,{navigate:e,approvalUpdateDataView:r,approvalRuleId:s,approverViewData:i,location:t})}export{G as R,$ as i};
@@ -0,0 +1,68 @@
1
+ import{j as s}from"./liveblocks-BUJqCtmZ.js";import{j as J,h as le,u as W,l as Y,g as w,N as $,k as q,i as ut,n as pt,o as B}from"./core-r3zPXrnR.js";import{eN as V,MY as me,c0 as ce,Bt as xe,jC as bt,BG as ae,BF as se,MZ as gt,bn as de,fI as Te,M_ as ht,Jk as ft,jr as je,Jl as Se,Jm as St,il as It,Me as yt,iB as Rt,Bh as At,s6 as Ct,it as vt,C1 as De,M$ as Fe,N0 as kt,N1 as Et,N2 as Bt,N3 as wt,N4 as xt,BN as Ie,iH as Tt,Mn as jt,BH as Dt,Br as Ft,N5 as Ut,Bq as Lt,N6 as Nt,Bz as ye,BR as Mt,BQ as Pt,BM as $t,N7 as Ue,GE as _t,bo as Ot,BC as zt,Cj as Gt,N8 as Ht,N9 as Zt,BZ as Wt,BW as Re,LJ as Vt,Bo as Jt,Na as Le,CI as Ae,CQ as qt,Nb as Kt,Nc as H,Nd as Qt,Ne,Nf as Xt,Ng as Me,Nh as Pe,C9 as ie,bt as Yt,bE as ue,cz as pe,eT as $e,eR as _e,Ni as en,gD as tn,LW as nn,Nj as an,Nk as Oe,L_ as sn,MI as on,Nl as rn,MX as ln,CN as Ce,CM as mn,Nm as cn,Nn as dn,No as un,Np as pn,Nq as bn,Mt as gn,CD as hn,CH as fn,bv as Sn,bD as In,cu as yn,cO as Rn,bs as An,Il as Cn,cK as vn,cM as kn,cL as En,ct as Bn}from"./zeni-epic-state-Cdw8EpcM.js";import{A as ze,K as Ge,a as ee,l as C,z as M,bJ as He,y as te,d as v,aC as ve,o as U,ao as X,G as wn,D as Ze,bK as xn,s as Z,M as We,bL as Tn,j as ne,bM as jn,N as Dn,C as Fn,B as be,g as Ve,a1 as Un,ba as Ln,R as Nn,h as Je,bN as Mn,a4 as Pn}from"./index-DHwEE904.js";import{n as _,S as $n}from"./mui-BD9ReF4V.js";import oe from"./NotFoundScreen-BHPCFLTM.js";import{S as ke}from"./SetupPagesScreen-C_S8AZRH.js";import{F as qe}from"./FeaturePreviewScreen-D_2XoCHl.js";import{a as g}from"./sentry-BbjYSgze.js";import{u as Ke}from"./useInitialThreadRequest-C6Fi1v7Q.js";import{u as Qe}from"./useAskAiCfoHostNavButtonProps-CIdYxL8V.js";import{c as Xe}from"./useFetchSuggestedQuestionsWhenReady-DaXgh6Pr.js";import{D as _n}from"./DrawerScreen-W83sAi_k.js";import{M as Ye}from"./MobileAppDrawer-DvyjBd4g.js";import{R as On}from"./ReimbursementApprovalRoutes-Dtwap8JJ.js";import{FallBackRoute as zn}from"./ScreenRoutes-zeq48oCM.js";import"./recharts-DD1DDktN.js";import"./analytics-CaofNoIK.js";import"./plaid-CxNli5Mg.js";import"./dnd-dQAnWf63.js";import"./stripe-DMRn4zHo.js";import"./lottie-D8AaXarT.js";import"./lexical-DPC-NxTc.js";import"./pdf-iZy3i289.js";import"./utils-gH_xiFg7.js";import"./analyticsHelper-26beXk6v.js";import"./routePaths-BGzy8Dqj.js";import"./BusinessVerificationPageScreen-BB9F88mK.js";import"./ReimbursementApprovalRuleDetailScreen-B5Ck2C9Y.js";import"./getLocaleForTenant-CQnHebPH.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]="dbb58945-2801-442f-a330-99337d69ecc5",e._sentryDebugIdIdentifier="sentry-dbid-dbb58945-2801-442f-a330-99337d69ecc5")}catch{}})();const et=e=>`/${e}/reimbursements`,Gn=e=>g.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},g.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),g.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{spendManagement:{reimbursement:{reimbursementDetail:L}}}=Ze.getLocalizedStrings(),Hn=q(function(e,t){const n=t.currentTenant?.companyId,r=gt(e.plaidAccountViewState,"user_reimbursement_account"),c=M.getSignedInUser(),d=de(c),m=r.plaidConnectionDetails,o=Te(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:a??""},l=me(e,t.reimbursementId),p=ht(e,c?.userId??"");let I=`${c?.firstName} ${c?.lastName}`,S=!0;t.reimbursementId!=null&&(I=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,S=c?.userId===l.createdBy?.userId);const x=e.entityAutoCompleteState?.autoCompleteText?.common,R=ft(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:x,entityAutoCompleteView:R},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:I,isUserAdmin:ce(t.currentTenant?.userRole??[]),isZeniUser:d,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:p.bankAccountCreationState,bankAccounts:p.bankAccounts,analytics:v,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:S,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:je(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:c,navigate:d,themeState:m}=t,{tenantEmailDomain:o}=r,a=M.getSignedInUser();return{onReceiptsUpload:(i,l,p)=>{i!=null&&e(se(i,l,p,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(ye(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e($t(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Pt())},clearRemiSaveStatus:()=>{e(Mt("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(ye(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Nt({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(Lt(l,i,n))},updateReimbursementType:(i,l,p)=>{e(Ut({reimbursementId:p,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,p)=>{e(Ft({reimbursementId:p,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Dt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Ie(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(jt({data:l}))},onFetchBankName:i=>{e(Tt(i))},submitRemiDetails:()=>{e(Ie("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(xt({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(ae({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(wt({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(Bt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(Et({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Fe()),e(kt());const i=et(o),l=Z(c.state?.pathnameStackToGoBack,c.pathname);d(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(v.trackReimbursementDeleteReimbursement(n),e(De(n)))},onSaveBankAccount:()=>{a?.userId&&e(vt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(Ct("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(At(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(Rt(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(It({fetchState:"Not-Started"})),e(yt())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(St({searchString:i,entityType:l,searchOrigin:"common"})):e(Se("common"))},onCancelAutoComplete:()=>{e(Se("common"))}}}})(xn);function Ee(){const e=J(),t=le(),n=W(),{reimbursementId:r}=Y(),c=ze(),d=Ge(),[m,o]=g.useState(r==null),[a,i]=g.useState(1),{useFeatureGate:l}=ee(),{isFeatureEnabled:p}=l(C.isLimitedCategoryForReimbursement),{isFeatureEnabled:I}=l(C.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:S}=l(C.isReimbursementCommentingEnabled),x=W().pathname,R=x.includes("edit"),j=x.includes("reimbursement/new"),[b,k]=g.useState(!1),y=M.getSignedInUser(),T=w(u=>V(u)),f=w(u=>me(u,r)),D=Ke(T?.companyId,{clearParams:f.fetchState==="Completed"}),P=ce(T?.userRole??[]);g.useEffect(()=>{(j&&!b||R&&f.fetchState!="Completed"&&f.fetchState!="In-Progress")&&(k(!0),t(xe(!1,p,I,r)))});const A=w(u=>bt(u.accountState,u.accountListState,"reimbursementAccountList"));if(y==null)throw Error("Can't access address page without signing in...");const F={pathname:`../${r}`,search:n.search};return f.isDeleted===!0||f.billStage=="paid"||f.billStage=="scheduled"||f.fetchState=="Not-Started"||P&&f.billStatus==="rejected"||P===!1&&f.billStage==="pending_approval"&&f.billStatus!=="rejected"?s.jsx($,{to:F}):f.deleteStatus.fetchState==="In-Progress"||f.fetchState!=="Completed"?s.jsx(He,{isNewReimbursement:r==null}):s.jsxs(Zn,{windowSize:d,children:[s.jsx(te,{analytics:v,onLoad:u=>(N=>{r!=null&&f.deleteStatus.fetchState!=="Completed"&&N.trackReimbursementEditReimbursement(r)})(u)}),m&&d!=="small"?s.jsx(Wn,{}):null,m&&d!=="small"?s.jsx(Vn,{children:s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:y?.userId??"",sessionId:y?.zeniSessionId??"",tenantId:T?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:u=>{u!=null&&t(se(u,a,!0,r,y?.userId))},updateInvoiceUploadFetchState:u=>{t(ae({reimbursementId:r,fetchState:u}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:U.sp3,paddingBottom:"15px",paddingLeft:U.sp5},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})}):null,m&&d==="small"?s.jsxs(Jn,{children:[s.jsx(qn,{onClick:()=>o(!1),children:s.jsx(Gn,{})}),s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:y?.userId??"",sessionId:y?.zeniSessionId??"",tenantId:T?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:u=>{u!=null&&t(se(u,a,!0,r,y?.userId))},updateInvoiceUploadFetchState:u=>{t(ae({reimbursementId:r,fetchState:u}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:U.sp5,paddingRight:U.sp3,paddingBottom:U.sp5,paddingLeft:U.sp3},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})]}):null,s.jsx(Kn,{windowSize:d,children:s.jsx(Hn,{initialOpenThreadRequest:D??void 0,isReimbursementCommentingEnabled:S,location:n,navigate:e,currentTenant:T,reimbursementId:r,themeState:c,uncategorizedAccounts:A,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i})})]})}const Zn=_.div`
2
+ display: flex;
3
+ position: relative;
4
+ height: 100vh;
5
+ flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
6
+ background-color: ${e=>e.theme.colors.grey4};
7
+ `,Wn=_.div`
8
+ position: fixed;
9
+ top: 0;
10
+ left: 0;
11
+ right: 0;
12
+ bottom: 0;
13
+ background-color: ${wn.overlayBackgroundBlack};
14
+ z-index: 5;
15
+ `,Vn=_.div`
16
+ position: absolute;
17
+ top: 0;
18
+ left: 0;
19
+ width: 42%;
20
+ height: 100%;
21
+ z-index: 6;
22
+ display: flex;
23
+ background-color: transparent;
24
+ overflow: hidden;
25
+ `,Jn=_.div`
26
+ position: fixed;
27
+ top: 0;
28
+ left: 0;
29
+ right: 0;
30
+ bottom: 0;
31
+ z-index: 11;
32
+ display: flex;
33
+ flex-direction: column;
34
+ overflow-y: auto;
35
+ background-color: ${e=>e.theme.colors.grey4};
36
+ `,qn=_.button`
37
+ align-self: flex-end;
38
+ background: none;
39
+ border: none;
40
+ cursor: pointer;
41
+ padding: ${U.sp2} ${U.sp3};
42
+ line-height: 1;
43
+ color: ${e=>e.theme.colors.hero};
44
+ &:hover {
45
+ color: ${e=>e.theme.colors.primary};
46
+ }
47
+ svg {
48
+ width: ${U.sp4};
49
+ height: ${U.sp4};
50
+ }
51
+ `,Kn=_.div`
52
+ display: flex;
53
+ flex-direction: column;
54
+ width: 100%;
55
+ ${e=>e.windowSize!=="small"?"overflow: auto;":""}
56
+ `,Qn=q(function(e,t){const n=Ue(e,t.reimbursementId),r=M.getSignedInUser(),c=de(r),d=e.tenantState.currentTenantId,m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:d??""},o=`${n.createdBy?.firstName??"Zeni"} ${n.createdBy?.lastName??""}`;let a=!1;n?.remiActivities.length>0&&(a=Ht(n.remiActivities,Zt(t.currentTenant),r));const i=ce(t.currentTenant?.userRole??[]),l=r?.userId===n.createdBy?.userId;return{remiDetails:n,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:m,signedInUser:r,createdBy:o,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,isAdmin:i,showApproveRejectBtns:a,isZeniUser:c,isSignedInUserReimbursementCreator:l,isAccountingClassesEnabled:je(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:c,navigate:d,themeState:m}=t,{tenantEmailDomain:o}=r;return{onDuplicateLineClick:(a,i)=>window.open(`/${o}/reimbursement/${a}#L${i}`),redirectToReimbursementListScreen:()=>{e(Fe());const a=et(o),i=Z(c.state?.pathnameStackToGoBack,c.pathname);d(a,{state:{pathnameStackToGoBack:i}})},onSaveRealTimeApprovals:a=>{e(Jt(n,"reimbursement",a))},updateEditRealTimeApproverClicked:a=>{e(Vt({isEdit:a,entityId:n,entityType:"reimbursement"}))},approveOrRejectRemi:a=>{a.type==="approved"?e(Re(n,a.type,"")):e(Re(n,a.type,a.description??""))},redirectToEditableReimbursementScreen:()=>{const a=Z(c.state?.pathnameStackToGoBack,c.pathname);d("./edit",{state:{pathnameStackToGoBack:a}})},deleteReimbursement:()=>{v.trackReimbursementDeleteReimbursement(n),e(De(n))},cancelAndDeleteReport:a=>{a===!0?v.trackReimbursementCancelAndDeleteReimbursement(n):v.trackReimbursementCancelReimbursement(n),e(Wt(n,a))},handleZeniLogoClick:()=>{m.toggle()}}})(Tn);function Xn(){const e=J(),t=le(),n=W(),r=n.hash.substring(1),c=ze(),{reimbursementId:d}=Y(),m=M.getSignedInUser(),o=w(E=>V(E)),a=w(E=>Ue(E,d??"")),i=a.remiDetails?.reimbursementInfo.stage.code==="draft",l=Ke(o?.companyId,{clearParams:a.fetchState==="Completed"&&!i}),{isAiCfoOpen:p,setIsAiCfoOpen:I}=We(),{isAiCfoAccessEnabled:S,onAskAiCfoClick:x}=Qe({isAiCfoOpen:p,setIsAiCfoOpen:I,mobileExploreReferrer:"Reimbursement Details"});Xe({isDataReady:a.fetchState==="Completed"});const{useFeatureGate:R}=ee(),{isFeatureEnabled:j}=R(C.isLimitedCategoryForReimbursement),[b,k]=g.useState(!1),[y,T]=g.useState(!1),[f,D]=g.useState(!1),{isFeatureEnabled:P}=R(C.isReimbursementCommentingEnabled),{isFeatureEnabled:A}=R(C.isShowDeletedReimbursementsFeatureEnabled),F=w(E=>me(E,d??"")),u=_t(o),N=Ot(o.userRole),G=a.fetchState;if(g.useEffect(()=>{b||d==null?b==1&&G==="Error"&&e("page-not-found",{replace:!0}):(k(!0),t(zt(d,!1,A)))},[b,d,t,G]),g.useEffect(()=>{A&&a.remiDetails?.isDeleted===!0||o.isZeni===!0&&m?.userEmailDomain==="zeni.ai"&&u===!1?D(!1):D(a.remiActivities[0]?.isRealTimeApprovalEnabled&&(N||a.allApprovers.find(E=>E.user.userId===m?.userId)!=null||a.remiDetails?.lastUpdatedBy===m?.userId))},[a.remiActivities[0]?.isRealTimeApprovalEnabled,a.allApprovers,a.remiDetails?.lastUpdatedBy,N,o.isZeni,u,m]),g.useEffect(()=>{y||a.fetchState!="Completed"||a.remiDetails?.reimbursementInfo.stage.code=="paid"||a.remiDetails?.reimbursementInfo.stage.code=="scheduled"||F.fetchState=="Completed"||F.fetchState=="In-Progress"||(T(!0),t(xe(!1,j,A,d)),a.remiActivities[0]?.isRealTimeApprovalEnabled===!0&&t(Gt(!1,!0,!0,a.lastUpdatedByUserId)))},[y,a,d,t]),m==null)throw Error("Can't access address page without signing in...");return a.remiDetails?.reimbursementInfo.stage.code=="draft"&&F.fetchState=="Completed"&&a.remiDetails.isDeleted===!1?s.jsx($,{to:`./edit${n.search}`}):a.deleteStatus.fetchState==="In-Progress"||a.cancelAndDeleteStatus.fetchState==="In-Progress"||a.remiDetails?.reimbursementInfo.stage.code=="draft"&&F.fetchState!="Completed"||a.fetchState!="Completed"?s.jsx(He,{}):s.jsxs(s.Fragment,{children:[s.jsx(te,{analytics:v,onLoad:E=>(K=>{d!=null&&K.trackReimbursementReimbursementDetails(d)})(E)}),s.jsx(Qn,{initialOpenThreadRequest:l??void 0,scrollId:r,isReimbursementCommentingEnabled:P,isShowDeletedReimbursementEnabled:A,location:n,navigate:e,isRealTimeApprovalEnabled:f,currentTenant:o,reimbursementId:d??"",themeState:c,isAiCfoAccessEnabled:S,onAskAiCfoClick:x})]})}const Yn=q(function(e,t){return{remisReviewView:Le(e),analytics:t.analytics}},function(e,t){return{onCloseOverlay:()=>{t.navigate("./"),e(H())},onCloseReviewItem:n=>{e(Kt(n))},onProceedForBulkActionClick:(n,r)=>{switch(n){case"send_for_approval":e(qt());break;case"approve":e(Ae("approved",r??""));break;case"reject":e(Ae("rejected",r??""))}}}})(jn);function ea(){const e=J(),t=w(d=>d.remisBulkActionViewState.bulkSubmissionFetchState.fetchState),{remisForReview:n}=w(d=>Le(d)),r=ne(),c=r?.loggedInUserRole?.includes("admin")===!0;return g.useEffect(()=>{t!=="Completed"&&n.length!==0||e("./")},[t,n.length]),s.jsx(Yn,{navigate:e,analytics:v,isAdmin:c})}const z=sn(),tt="bulk-operation-update",re="reimbursement-approval-rule-update",{spendManagement:ta,common:Be}=Ze.getLocalizedStrings(),we=ta.reimbursement.bulkActions,na=_.div`
57
+ display: flex;
58
+ min-height: 100%;
59
+ width: 100%;
60
+ flex: 1 1 auto;
61
+ flex-direction: column;
62
+ align-items: center;
63
+ background-color: ${e=>e.theme.colors.grey4};
64
+ `,aa=q(function(e,t){const n=Pe(e,z,t.isBulkActionEnabled);let r=n.allSubTabs;const c=M.getSignedInUser(),d=de(c),m=e.tenantState.currentTenantId,o=V(e),a=o?.companyName??"",i={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:m??""},l=e.remiListState.downloadUIState.downloadState;t.isShowDeletedReimbursementEnabled===!1&&(r=r.filter(S=>S!=="deleted"));const p=n.fetchState,I=on(e);return{transactionList:t.isShowDeletedReimbursementEnabled?n.reimbursements:n.reimbursements.filter(S=>S.isDeleted===!1),isAdmin:t.isAdmin,isZeniUser:d,isBillPayCommentingEnabled:t.isBillPayCommentingEnabled,isReimbursementCommentingEnabled:t.isReimbursementCommentingEnabled,allSubTabs:r,isEmployee:t.isEmployee,currentTab:n.currentTab,currentSubTab:n.currentSubTab,approvalCount:n.approvalCount,fetchState:p,botEmail:n.reimbursementBotEmail,analytics:v,uiState:n.uiState,searchText:n.searchText,filters:n.filters,downloadParams:{authParams:i,companyName:a,timePeriod:z,spendManagementEndPoint:`${Nn}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:l,isBulkActionAllowed:n.remiListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:n.remiListBulkActionInfo?.remisSelectedForBulkAction,allowedBulkActions:n.remiListBulkActionInfo?.allowedBulkActions,remiApprovalRulesAffectedEntityIds:I.affectedEntityIds}},function(e,t){const{navigate:n,currentTenant:r,location:c,period:d}=t,{tenantEmailDomain:m}=r;return{updateTabToState:o=>{e(H()),e(Ne(o))},onSubtabChange:o=>{e(H()),e(Me(o))},onTransactionClick:(o,a)=>{const i=oa(m,o,a),l=Z(c.state?.pathnameStackToGoBack,c.pathname);n(i,{state:{pathnameStackToGoBack:l}})},onClickSetupIcon:()=>{const o=ia(m),a=Z(c.state?.pathnameStackToGoBack,c.pathname);n(o,{state:{pathnameStackToGoBack:a}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;v?.trackReimbursementNewReimbursement();const a=`/${o}/reimbursement/new`,i=Z(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(a,{state:{pathnameStackToGoBack:i}})},onColumnSortConfigChanged:(o,a)=>{e(bn({uiState:{sortKey:o,sortOrder:a},period:t.period}))},onSearchTextChanged:o=>{e(pn(o))},onFiltersChange:o=>{e(un({filters:o})),o.categories.every(a=>a.field!=null&&a.values?.length!==0)&&v.trackSpendManagmentFilterChange("reimbursement",o.categories.map(a=>`${a.field}-${JSON.stringify(a.values)}`))},updateDownloadStateHandler:o=>{o==="In-Progress"&&v.trackSpendManagementDownloadClick("reimbursement"),e(dn({uiState:{downloadState:o}}))},onReloadTransactions:()=>{e(ie(d,!0,t.isShowDeletedReimbursementEnabled,!1,!0))},onBackClick:()=>{n("../",{relative:"path"})},onNavigateToSettings:()=>{n("../reimbursements/setup")},updateBulkActionList:o=>{e(cn(o))},removeAllTransactionsFromBulkActionList:()=>{e(H())},onProceedForBulkActionClick:(o,a)=>{switch(o){case"delete":case"cancel":e(mn(o,a??""));break;case"send_for_approval":e(Ce("send_for_approval")),t.navigate("./bulk-review");break;case"review":e(Ce("approve")),t.navigate("./bulk-review")}},onReimbursementApprovalRulesEventReceived:o=>{o.endsWith(re)&&e(ln(!1))},onEventReceived:o=>{o===tt&&e(rn())}}})(Un(Ln));function sa(){const{isAiCfoOpen:e,setIsAiCfoOpen:t}=We(),n=J(),r=le(),c=W(),d=c.state,m=Ge(),[o,a]=g.useState(null),i=ut("/:tenantEmailDomain/reimbursements/bulk-review")!=null;g.useEffect(()=>{if(d?.tab!=null&&d?.subTab!=null){const h=Qt(d.tab.toString());h!=null?r(Ne(h)):console.log("Warning:Not a valid remiListTab");const O=Xt(d.subTab.toString());O!=null?r(Me(O)):console.log("Warning:Not a valid remiListSubTab")}return()=>{r(H())}},[]);const{useFeatureGate:l}=ee(),{isFeatureEnabled:p}=l(C.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=l(C.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:S}=l(C.isBillPayCommentingEnabled),{isFeatureEnabled:x}=l(C.isReimbursementCommentingEnabled),{isFeatureEnabled:R}=l(C.isReimbursementBulkActionEnabled),j=M.getSignedInUser(),b=w(h=>V(h)),[k,y]=g.useState(!1),[T,f]=g.useState(!1),D=ne(),P=D?.loggedInUserRole?.includes("admin")===!0,A=w(h=>Pe(h,z,R)),{areTenantIdsInSync:F}=Dn(),u=A.fetchState,{isAiCfoAccessEnabled:N,onAskAiCfoClick:G}=Qe({isAiCfoOpen:e,setIsAiCfoOpen:t,mobileExploreReferrer:"Reimbursement List"});if(Xe({isDataReady:u==="Completed"}),g.useEffect(()=>{!T&&F&&(f(!0),r(ie(z,!0,I,!1,!0)))},[T,z,r,F]),j==null)throw Error("Can't access address page without signing in...");const E=!!b?.userRole&&Yt(b),K=ue(D?.loggedInUserRoleMap),nt=pe(D?.loggedInUserRoleMap),at=!!b.userReimbursementInfo?.isReimbursementTOSAccepted,st=!!b.companyReimbursementInfo?.info?.isReimbursementEnabled,it=!!b.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,ot=w(h=>Te(h.companyState,b.companyId)),rt=ot?.company.featuresActivationInfo.connectedAccountProvider,ge=h=>{y(h)},{isFeatureEnabled:lt}=l(C.isDebitCardFeatureEnabled),mt=$e(lt,b),ct=_e(b),{remisProcessed:Q,remisProcessing:he}=w(h=>en(h));g.useEffect(()=>{Q===he&&o!=null&&(r(tn({messageSection:"reimbursement_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_report_",variableValue:Q>1?we.reports:we.report},{variableName:"_has_",variableValue:Q>1?Be.texts.have:Be.texts.has},{variableName:"_action_",variableValue:nn(o)}]})),r(an()),setTimeout(()=>{r(ie(z,!0,I,!1,!0,!0))},3e3),a(null))},[Q,he]);const dt={events:b.companyId!=null?[`private-${b.companyId}.${tt}`,`private-${b.companyId}.${re}`]:[],eventCallback:(h,O,fe)=>{h.endsWith(re)?fe.onReimbursementApprovalRulesEventReceived?.(h):O.entity_type==="reimbursement"&&(a(O.operation_type),fe.onEventReceived(h))}};return c.pathname.endsWith("/reimbursements/")||c.pathname.endsWith("/reimbursements")||c.pathname.endsWith("/reimbursements/bulk-review")?mt===!0||ct===!0?s.jsx(qe,{}):st&&(!E||K)||nt&&at?s.jsxs(s.Fragment,{children:[u==="Completed"?s.jsx(te,{analytics:v,onLoad:h=>(O=>O.trackPageLoaded(Ve.Event.reimbursementHome))(h)}):null,s.jsx(Ye,{isAppContentDrawerOpen:k,handleDrawerToggle:ge}),s.jsxs(na,{windowSize:m,children:[s.jsx(_n,{isOpen:i,drawerLeftMargin:new Fn(0,0,300,600),onClose:()=>{n("./"),r(H())},children:s.jsx(ra,{onClick:h=>h.stopPropagation(),children:s.jsx(ea,{})})}),s.jsx(aa,{isShowDeletedBillsEnabled:p,isShowDeletedReimbursementEnabled:I,isBillPayCommentingEnabled:S,isReimbursementCommentingEnabled:x,location:c,navigate:n,currentTenant:b,period:z,isAdmin:P,isEmployee:E,entity:"reimbursement",onClickMenuIcon:()=>{ge(!0)},createdByUserList:A.createdByUserList,createdByUserListFetchState:A.createdByUserListFetchState,isDownloadEnabled:A.isDownloadEnabled,connectedAccountProvider:rt,isBulkActionEnabled:R,bulkSubmissionLimit:A.remiBulkSubmissionLimit,bulkSubmissionFetchState:A.remiListBulkActionInfo.bulkSubmissionFetchState,isAiCfoAccessEnabled:N,onAskAiCfoClick:G,...dt})]})]}):it&&K?s.jsx($,{to:"../setup"}):D!=null&&Oe(b,D.loggedInUserRoleMap)?s.jsx($,{to:"../promo"}):s.jsx(be,{fetchState:"In-Progress"}):s.jsx(oe,{})}const ia=e=>`/${e}/reimbursements/setup`,oa=(e,t,n)=>{let r=`/${e}/reimbursement/${encodeURIComponent(t)}`;return n=="draft"&&(r+="/edit"),r},ra=_($n)`
65
+ display: flex;
66
+ min-height: 100%;
67
+ flex-direction: column;
68
+ `,la=q(function(e,t){const{companyId:n}=t;return{reimbursementSetupView:gn(e,n),analytics:v,meetingUrl:"https://meetings.hubspot.com/niharn/demo-reimbursements?embed=true",videoUrl:"https://player.vimeo.com/video/814821498?h=e7fd11e13e&badge=0&autopause=0&player_id=0&app_id=122963"}},function(e,t){const{companyId:n,navigate:r}=t;return{onSetupButtonClick:()=>{e(fn(n))},onCreateNewRemiButtonClick:()=>{e(hn(t.userRoleId))},onBackClick:()=>{r("../..",{relative:"path"})},onSetupReimbursementSuccess:()=>{t.isEmployee?r("../../reimbursement/new",{relative:"path"}):r("../reimbursements/setup",{relative:"path"})}}})(Mn),ma=()=>{const e=J(),t=W(),{tenantEmailDomain:n}=Y(),r=Je(),[c,d]=g.useState(!1),m=w(k=>V(k)),o=M.getSignedInUserTenant(n)?.companyId??m.companyId,a=M.getSignedInUser(),i=m.userRoleId,l=!!m.userRole?.includes("reimbursements_user"),p=ne(),I=ue(p?.loggedInUserRoleMap),S=pe(p?.loggedInUserRoleMap),x=!!m.userReimbursementInfo?.isReimbursementTOSAccepted,R=!!m.companyReimbursementInfo?.info?.isReimbursementEnabled,j=!!m.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,b=k=>{d(k)};if(a==null)throw Error("Can't access reimbursement promo page without signing in...");return R&&S&&x?s.jsx($,{to:"../../../reimbursements"}):j&&I?s.jsx($,{to:"../../reimbursements/setup"}):m.companyReimbursementInfo&&!j||m.userReimbursementInfo&&S&&x===!1?s.jsxs(s.Fragment,{children:[s.jsx(te,{analytics:v,onLoad:k=>(y=>y.trackPageLoaded(Ve.Event.reimbursementPromoPage))(k)}),s.jsx(Ye,{isAppContentDrawerOpen:c,handleDrawerToggle:b}),s.jsx(la,{companyId:o,navigate:e,location:t,userReimbursementInfo:m.userReimbursementInfo,userRoleId:i,isEmployee:l,onClickMenuIcon:()=>{b(!0)}})]}):s.jsx(be,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})};function _a(){const e=w(E=>V(E)),t=ne(),n=!!e.company?.companyReimbursementInfo.isReimbursementEnabled,r=Je(),c=!!e.company?.companyReimbursementInfo.isReimbursementTOSAccepted,d=!!e.userReimbursementInfo?.isReimbursementTOSAccepted,{useFeatureGate:m}=ee(),{isFeatureEnabled:o}=m(C.isChargeCardFeatureEnabled),{isFeatureEnabled:a}=m(C.isDebitCardFeatureEnabled),i=$e(a,e),l=_e(e),p=e?.userRole!=null&&Sn(e?.userRole),I=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!p)&&In(t?.loggedInUserRoleMap),S=yn(t?.loggedInUserRoleMap),x=e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!p,R=ue(t?.loggedInUserRoleMap),j=x&&R,{isFeatureEnabled:b}=m(C.isDepositAccountsFeatureEnabled),k=b&&!p&&Rn(t?.loggedInUserRoleMap),y=Pn(e,o,a)&&!p&&An(t?.loggedInUserRoleMap),T=Cn(t?.loggedInUserRoleMap),f=vn(t?.loggedInUserRoleMap),D=kn(t?.loggedInUserRoleMap),P=En(t?.loggedInUserRoleMap),A=Bn(t?.loggedInUserRoleMap),F=pe(t?.loggedInUserRoleMap),{tenantEmailDomain:u}=Y(),N=W(),G=n===!0&&(R||F&&d);return s.jsxs(pt,{children:[N.pathname.includes("/reimbursements")?s.jsxs(s.Fragment,{children:[s.jsx(B,{path:"verification",element:s.jsx(ke,{isBillPayAdminLevelAccess:I,isUserHasOnlyBillPayAccess:S,isReimbursementAdminLevelAccess:j,isZeniAccountAdminLevelAccess:k,isChargeCardAdminLevelAccess:y,isUserHasOnlyCardAccess:T,productType:"reimbursement",type:"verification"})}),s.jsx(B,{path:"setup",element:s.jsx(ke,{isBillPayAdminLevelAccess:I,isUserHasOnlyBillPayAccess:S,isReimbursementAdminLevelAccess:j,isZeniAccountAdminLevelAccess:k,isChargeCardAdminLevelAccess:y,isUserHasOnlyCardAccess:T,productType:"reimbursement",type:"setup"})}),s.jsx(B,{path:"promo",element:s.jsx(ma,{})}),s.jsx(B,{path:"approval-rules/*",element:j?s.jsx(On,{}):s.jsx(zn,{isUserHasZeniAccountsAccess:f,isUserHasChargeCardAccess:P,isUserHasBillPayAccess:A,isUserHasReimbursementAccess:F,isUserHasTreasuryAccess:D,isTenantBankingOnly:i,tenantEmailDomain:u??""})}),G&&s.jsx(B,{path:"*",element:s.jsx(sa,{})}),(i===!0||l===!0)&&s.jsx(B,{path:"/*",element:s.jsx(qe,{})}),t!=null&&Oe(e,t?.loggedInUserRoleMap)&&s.jsx(B,{path:"*",element:s.jsx($,{to:"../promo"})}),c&&R&&s.jsx(B,{path:"*",element:s.jsx($,{to:"../setup"})})]}):N.pathname.includes("/reimbursement")?s.jsxs(s.Fragment,{children:[s.jsx(B,{path:"new",element:s.jsx(Ee,{})}),s.jsx(B,{path:":reimbursementId",element:s.jsx(Xn,{})}),s.jsx(B,{path:":reimbursementId/edit",element:s.jsx(Ee,{})}),s.jsx(B,{path:"*",element:s.jsx(oe,{})})]}):s.jsx(B,{path:"*",element:s.jsx(be,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5,boxShadow:`0px 2px ${U.sp1} ${r.colors.dropShadowNormal}`}})}),s.jsx(B,{path:"*",element:s.jsx(oe,{})})]})}export{_a as default};
@@ -1 +1 @@
1
- import{j as d}from"./liveblocks-DiLJJ0-W.js";import{u as x,j as me,h as ue,l as _e,g as m,k as he,n as be,o as z}from"./core-PVb_PTOa.js";import{eM as M,f7 as g,IC as Ie,pE as O,ja as ye,ic as Ce,s_ as ge,pJ as Se,bu as we,ID as Re,IE as Te,jm as Oe,bm as Fe,u0 as ke,IF as Ae,IG as De,sV as je,sZ as Ee,IH as G,II as Me,IJ as Pe,IK as Le,IL as Be,IM as S,IN as F,IO as k,IP as H,IQ as A,IR as D,dA as Ue,tI as Ve,tw as Y,tx as N,tO as ve,tB as $,tU as xe,IS as ze,IT as Ge,IU as He,IV as Ye,IW as Ne,eS as $e,eQ as qe}from"./zeni-epic-state-4sJL0-hG.js";import{H as Qe,I as Je,K as Ze,n as J,l as j,z as Z,J as Ke,j as We,a as Xe,y as ea,d as E,g as aa,r as K,V as sa,M as ta,O as oa}from"./index-P5rhD5Na.js";import"./mui-Bs_Wx3U8.js";import na from"./NotFoundScreen-D5gX25SL.js";import{F as ra}from"./FeaturePreviewScreen-DsVyovAJ.js";import{a as h}from"./sentry-CRXtNjzG.js";import{u as ia,a as la,b as ca,c as da}from"./useFetchSuggestedQuestionsWhenReady-BJfLdWEG.js";import{u as pa}from"./useInitialThreadRequest-DNzJLWO_.js";import{t as q,a as Q}from"./routePaths-C6cVlXoV.js";import{M as fa}from"./MobileAppDrawer-CPQuEteC.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 e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="2aeea873-90bf-4f0e-b7c0-14325bc199cd",e._sentryDebugIdIdentifier="sentry-dbid-2aeea873-90bf-4f0e-b7c0-14325bc199cd")}catch{}})();const ma=["profit_loss","balance_sheet","cash_flow"],I=e=>{e(D({resetLeftScroll:!0})),e(A({resetLeftScroll:!0})),e(k({resetLeftScroll:!0})),e(F({resetLeftScroll:!0}))},ua=e=>{e(Ge()),e(He()),e(Ye()),e(Ne())},_a=he(function(e){const o=Z.getSignedInUser(),p=e.tenantState.currentTenantId,u=M(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:p??""},t=g(e),r=Re(u);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:E,isZeniUser:Fe(o),showAccountGroups:r===!0,isAccountingClassesEnabled:Oe(e),isAccountingProjectsEnabled:Te(e),currentTenantCompanyName:a,statementEndPoint:`${oa}/statement`,authParams:s,isZeniCOAUsed:r}},function(e,o){const{navigate:p,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(O(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(ze(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(xe(a)),s){const{isCompareModeOn:r,filter:c}=o,{additionalBalances:f,balancesRange:l}=c;let i=[...f];a==="year"&&(i=i.filter(y=>y!=="this_period_vs_same_period_last_year"&&y!=="this_period_vs_same_period_last_year_percent"&&y!=="same_period_last_year")),e(Y(o.firstMonthOfFY,r,l.numberOfPeriods<4?4:l.numberOfPeriods,i)),f.length>0&&e(N(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",l.numberOfPeriods<4?4:l.numberOfPeriods,i))}t!==!0&&setTimeout(()=>I(e),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(S(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e($({numberOfPeriods:4,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(G({classViewLayout:"vertical"})),I(e)},onCOABalancesRangeChanged:(a,s)=>{e($(a,s)),I(e)},onThisPeriodChanged:(a,s,t)=>{e(ve(o.firstMonthOfFY,a,s<4?4:s)),t!==!0&&I(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(Y(o.firstMonthOfFY,a,t<4?4:t,s)),s.length>0&&e(N(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<4?4:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout(()=>I(e),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(Ve({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<4?4:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,c;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,c=Ue(s)):s.balanceTimeFrame==="year"?(r="quarter",c={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),c!=null&&r!=null){const f=a.accountName===""?a.accountDescription:a.accountName,l=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return q(o.tenantEmailDomain,a.accountId,a.accountType,f,r,c);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return Q(o.tenantEmailDomain,a.accountId,a.accountType,s.id,f,r,c)}return a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?Q(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],f,r,c):a.accountType!=null?q(o.tenantEmailDomain,a.accountId,a.accountType,f,r,c):void 0})();if(l!=null){const i=K(o.location.state?.pathnameStackToGoBack,o.location.pathname);p(l,{state:{pathnameStackToGoBack:i,referrer:w(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(D({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(A({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(H({scrollPosition:s}));break;case"balance_sheet":e(k({scrollPosition:s}));break;case"cash_flow":e(F({scrollPosition:s}));break;default:console.log(`Table Scroll state for ${a} is not handled`)}},onElementCollapseStateChanged:(a,s,t)=>{switch(a){case"profit_and_loss":e(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(A({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(k({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(F({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{p("../../")},onUpdateAccountViewMode:a=>{e(Le({viewMode:a})),e(Be({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",w(o.selectedReportID)),e(S("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",w(o.selectedReportID)),e(S("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",w(o.selectedReportID)),e(S("profit_and_loss"))),I(e)},onUpdateClassesToFilterOut:a=>{e(Pe({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(Me({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(G({classViewLayout:a}))},onOpenAccountViewMode:()=>{e(je()),e(Ee())},onUpdateDisplayOrder:a=>{e(De(a))},onUpdateReportFormat:a=>{ua(e),e(Ae(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(ke("profit_and_loss_by_classes"))}}})(sa);function ha(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Je(),p=Ze(),u=ta(p),a=me(),s=ue(),t=x(),{tenantEmailDomain:r}=_e(),{useFeatureGate:c}=J(),{isFeatureEnabled:f}=c(j.isReportsHorizontalClassLayoutSwitchEnabled),l=Z.getSignedInUser(),[i,y]=h.useState(!1),[P,W]=h.useState(!1),{isFeatureEnabled:L}=c(j.isReportsCommentingEnabled);if(l==null)throw Error("Can't access reports page without signing in...");const B=m(n=>M(n)),X=B.company?.companyInfo.firstMonthOfFY??1,ee=pa(L?B?.companyId:void 0),C=m(n=>g(n).fetchState),ae=m(n=>Ie(n)),{areTenantIdsInSync:b}=Ke(),R=m(n=>n.financeStatementState.selectedReportId),se=m(n=>g(n).isCompareModeOn),_=m(n=>g(n).filter),T=m(n=>g(n).selectedReportAndTimeframeFetchState),te=m(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);h.useEffect(()=>{!i&&b&&(y(!0),s(O(l.userId,!0,!0,!1)))},[i,l,s,b]),h.useEffect(()=>{i&&!P&&C==="Completed"&&b&&(s(O(l.userId,!1,!0,!1)),W(!0))},[i,P,C,b]),h.useEffect(()=>{if(i&&T.fetchState==="Not-Started"&&_.timeframe!=="free_range"&&_.timeframe!=="week"&&b)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Se(_.timeframe));break;case"profit_and_loss_by_projects":s(ge(_.timeframe));break;case"balance_sheet":s(Ce(_.timeframe));break;case"cash_flow":s(ye(_.timeframe))}},[i,R,T,b]);const U=We(),oe=U?.loggedInUserRole!=null&&we(U?.loggedInUserRole)!==!0,[ne,re]=h.useState(!1),V=n=>{re(n)},ie=Xe(),le=ca();return function(n){const{isDataReady:ce}=n,{pathname:de}=x(),v=Qe(de??"")==="reports",pe=ia(ce),fe=h.useMemo(()=>v?ma:void 0,[v]);la({canFetchSuggestedQuestions:pe,pageContexts:fe})}({isDataReady:C==="Completed"}),da({isDataReady:C==="Completed"}),d.jsxs(d.Fragment,{children:[C==="Completed"?d.jsx(ea,{analytics:E,onLoad:n=>n.trackPageLoaded(aa.Event.reports)}):null,d.jsx(fa,{isAppContentDrawerOpen:ne,handleDrawerToggle:V}),d.jsx(_a,{firstMonthOfFY:X,tenantEmailDomain:r,location:t,navigate:a,windowSize:p,classViewLayout:te,selectedReportID:R,analytics:E,filter:_,isCompareModeOn:se,hasTransactionAccess:oe,signedInUser:l,selectedReportAndTimeframeFetchState:T,handleDrawerToggle:V,reportsResyncFetchState:ae.reportsResyncFetchState,isAiCfoAccessEnabled:le&&ie&&!e,onAskAiCfoClick:()=>{if(u){const n=K(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0)},isHorizontalClassReportSwitchEnabled:f,isReportsCommentingEnabled:L,initialOpenThreadRequest:ee})]})}const w=e=>{switch(e){case"profit_and_loss":return"Profit & Loss";case"balance_sheet":return"Balance Sheet";case"cash_flow":return"Cash Flow";default:return"Reports"}};function Va(){const e=m(s=>M(s)),{useFeatureGate:o}=J(),{isFeatureEnabled:p}=o(j.isDebitCardFeatureEnabled),u=$e(p,e),a=qe(e);return u===!0||a===!0?d.jsx(ra,{}):d.jsxs(be,{children:[d.jsx(z,{path:"/",element:d.jsx(ha,{})}),d.jsx(z,{path:"*",element:d.jsx(na,{})})]})}export{Va as default};
1
+ import{j as d}from"./liveblocks-BUJqCtmZ.js";import{u as x,j as me,h as ue,l as _e,g as m,k as he,n as be,o as z}from"./core-r3zPXrnR.js";import{eN as E,f8 as g,IG as Ie,pJ as O,jf as ye,ii as Ce,t2 as ge,pO as Se,bv as we,IH as Re,II as Te,jr as Oe,bn as Fe,u5 as ke,IJ as Ae,IK as De,s_ as je,t6 as Pe,IL as G,IM as Ee,IN as Le,IO as Me,IP as Be,IQ as S,IR as F,IS as k,IT as N,IU as A,IV as D,dB as ve,tN as Ue,tB as H,tC as Y,tT as Ve,tG as $,tZ as xe,IW as ze,IX as Ge,IY as Ne,IZ as He,I_ as Ye,eT as $e,eR as qe}from"./zeni-epic-state-Cdw8EpcM.js";import{J as Qe,M as Ze,K as Je,a as Z,l as j,z as J,N as Ke,j as We,c as Xe,y as ea,d as P,g as aa,s as K,O as sa,Q as ta,R as oa}from"./index-DHwEE904.js";import"./mui-BD9ReF4V.js";import na from"./NotFoundScreen-BHPCFLTM.js";import{F as ra}from"./FeaturePreviewScreen-D_2XoCHl.js";import{a as h}from"./sentry-BbjYSgze.js";import{u as ia,a as la,b as ca,c as da}from"./useFetchSuggestedQuestionsWhenReady-DaXgh6Pr.js";import{u as pa}from"./useInitialThreadRequest-C6Fi1v7Q.js";import{t as q,a as Q}from"./routePaths-BGzy8Dqj.js";import{M as fa}from"./MobileAppDrawer-DvyjBd4g.js";import"./recharts-DD1DDktN.js";import"./analytics-CaofNoIK.js";import"./plaid-CxNli5Mg.js";import"./dnd-dQAnWf63.js";import"./stripe-DMRn4zHo.js";import"./lottie-D8AaXarT.js";import"./lexical-DPC-NxTc.js";import"./pdf-iZy3i289.js";import"./utils-gH_xiFg7.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="4dbfa3d9-bd0f-434f-b759-dbcebae6dbfa",e._sentryDebugIdIdentifier="sentry-dbid-4dbfa3d9-bd0f-434f-b759-dbcebae6dbfa")}catch{}})();const ma=["profit_loss","balance_sheet","cash_flow"],I=e=>{e(D({resetLeftScroll:!0})),e(A({resetLeftScroll:!0})),e(k({resetLeftScroll:!0})),e(F({resetLeftScroll:!0}))},ua=e=>{e(Ge()),e(Ne()),e(He()),e(Ye())},_a=he(function(e){const o=J.getSignedInUser(),p=e.tenantState.currentTenantId,u=E(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:p??""},t=g(e),r=Re(u);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:P,isZeniUser:Fe(o),showAccountGroups:r===!0,isAccountingClassesEnabled:Oe(e),isAccountingProjectsEnabled:Te(e),currentTenantCompanyName:a,statementEndPoint:`${oa}/statement`,authParams:s,isZeniCOAUsed:r}},function(e,o){const{navigate:p,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(O(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(ze(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(xe(a)),s){const{isCompareModeOn:r,filter:c}=o,{additionalBalances:f,balancesRange:l}=c;let i=[...f];a==="year"&&(i=i.filter(y=>y!=="this_period_vs_same_period_last_year"&&y!=="this_period_vs_same_period_last_year_percent"&&y!=="same_period_last_year")),e(H(o.firstMonthOfFY,r,l.numberOfPeriods<4?4:l.numberOfPeriods,i)),f.length>0&&e(Y(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",l.numberOfPeriods<4?4:l.numberOfPeriods,i))}t!==!0&&setTimeout(()=>I(e),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(S(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e($({numberOfPeriods:4,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(G({classViewLayout:"vertical"})),I(e)},onCOABalancesRangeChanged:(a,s)=>{e($(a,s)),I(e)},onThisPeriodChanged:(a,s,t)=>{e(Ve(o.firstMonthOfFY,a,s<4?4:s)),t!==!0&&I(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(H(o.firstMonthOfFY,a,t<4?4:t,s)),s.length>0&&e(Y(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<4?4:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout(()=>I(e),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(Ue({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<4?4:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,c;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,c=ve(s)):s.balanceTimeFrame==="year"?(r="quarter",c={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),c!=null&&r!=null){const f=a.accountName===""?a.accountDescription:a.accountName,l=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return q(o.tenantEmailDomain,a.accountId,a.accountType,f,r,c);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return Q(o.tenantEmailDomain,a.accountId,a.accountType,s.id,f,r,c)}return a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?Q(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],f,r,c):a.accountType!=null?q(o.tenantEmailDomain,a.accountId,a.accountType,f,r,c):void 0})();if(l!=null){const i=K(o.location.state?.pathnameStackToGoBack,o.location.pathname);p(l,{state:{pathnameStackToGoBack:i,referrer:w(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(D({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(A({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(N({scrollPosition:s}));break;case"balance_sheet":e(k({scrollPosition:s}));break;case"cash_flow":e(F({scrollPosition:s}));break;default:console.log(`Table Scroll state for ${a} is not handled`)}},onElementCollapseStateChanged:(a,s,t)=>{switch(a){case"profit_and_loss":e(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(A({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(N({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(k({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(F({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{p("../../")},onUpdateAccountViewMode:a=>{e(Me({viewMode:a})),e(Be({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",w(o.selectedReportID)),e(S("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",w(o.selectedReportID)),e(S("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",w(o.selectedReportID)),e(S("profit_and_loss"))),I(e)},onUpdateClassesToFilterOut:a=>{e(Le({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(Ee({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(G({classViewLayout:a}))},onOpenAccountViewMode:()=>{e(je()),e(Pe())},onUpdateDisplayOrder:a=>{e(De(a))},onUpdateReportFormat:a=>{ua(e),e(Ae(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(ke("profit_and_loss_by_classes"))}}})(sa);function ha(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Ze(),p=Je(),u=ta(p),a=me(),s=ue(),t=x(),{tenantEmailDomain:r}=_e(),{useFeatureGate:c}=Z(),{isFeatureEnabled:f}=c(j.isReportsHorizontalClassLayoutSwitchEnabled),l=J.getSignedInUser(),[i,y]=h.useState(!1),[L,W]=h.useState(!1),{isFeatureEnabled:M}=c(j.isReportsCommentingEnabled);if(l==null)throw Error("Can't access reports page without signing in...");const B=m(n=>E(n)),X=B.company?.companyInfo.firstMonthOfFY??1,ee=pa(M?B?.companyId:void 0),C=m(n=>g(n).fetchState),ae=m(n=>Ie(n)),{areTenantIdsInSync:b}=Ke(),R=m(n=>n.financeStatementState.selectedReportId),se=m(n=>g(n).isCompareModeOn),_=m(n=>g(n).filter),T=m(n=>g(n).selectedReportAndTimeframeFetchState),te=m(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);h.useEffect(()=>{!i&&b&&(y(!0),s(O(l.userId,!0,!0,!1)))},[i,l,s,b]),h.useEffect(()=>{i&&!L&&C==="Completed"&&b&&(s(O(l.userId,!1,!0,!1)),W(!0))},[i,L,C,b]),h.useEffect(()=>{if(i&&T.fetchState==="Not-Started"&&_.timeframe!=="free_range"&&_.timeframe!=="week"&&b)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Se(_.timeframe));break;case"profit_and_loss_by_projects":s(ge(_.timeframe));break;case"balance_sheet":s(Ce(_.timeframe));break;case"cash_flow":s(ye(_.timeframe))}},[i,R,T,b]);const v=We(),oe=v?.loggedInUserRole!=null&&we(v?.loggedInUserRole)!==!0,[ne,re]=h.useState(!1),U=n=>{re(n)},ie=Xe(),le=ca();return function(n){const{isDataReady:ce}=n,{pathname:de}=x(),V=Qe(de??"")==="reports",pe=ia(ce),fe=h.useMemo(()=>V?ma:void 0,[V]);la({canFetchSuggestedQuestions:pe,pageContexts:fe})}({isDataReady:C==="Completed"}),da({isDataReady:C==="Completed"}),d.jsxs(d.Fragment,{children:[C==="Completed"?d.jsx(ea,{analytics:P,onLoad:n=>n.trackPageLoaded(aa.Event.reports)}):null,d.jsx(fa,{isAppContentDrawerOpen:ne,handleDrawerToggle:U}),d.jsx(_a,{firstMonthOfFY:X,tenantEmailDomain:r,location:t,navigate:a,windowSize:p,classViewLayout:te,selectedReportID:R,analytics:P,filter:_,isCompareModeOn:se,hasTransactionAccess:oe,signedInUser:l,selectedReportAndTimeframeFetchState:T,handleDrawerToggle:U,reportsResyncFetchState:ae.reportsResyncFetchState,isAiCfoAccessEnabled:le&&ie&&!e,onAskAiCfoClick:()=>{if(u){const n=K(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0)},isHorizontalClassReportSwitchEnabled:f,isReportsCommentingEnabled:M,initialOpenThreadRequest:ee})]})}const w=e=>{switch(e){case"profit_and_loss":return"Profit & Loss";case"balance_sheet":return"Balance Sheet";case"cash_flow":return"Cash Flow";default:return"Reports"}};function Ua(){const e=m(s=>E(s)),{useFeatureGate:o}=Z(),{isFeatureEnabled:p}=o(j.isDebitCardFeatureEnabled),u=$e(p,e),a=qe(e);return u===!0||a===!0?d.jsx(ra,{}):d.jsxs(be,{children:[d.jsx(z,{path:"/",element:d.jsx(ha,{})}),d.jsx(z,{path:"*",element:d.jsx(na,{})})]})}export{Ua as default};
@@ -0,0 +1 @@
1
+ import{j as a}from"./liveblocks-BUJqCtmZ.js";import{a as x,z as w,aI as y,y as E,d as p,g as F,cC as P,l as L}from"./index-DHwEE904.js";import"./mui-BD9ReF4V.js";import l from"./NotFoundScreen-BHPCFLTM.js";import{a as f}from"./sentry-BbjYSgze.js";import{h as T,g as b,j as V,u as A,k as R,n as U,o as u}from"./core-r3zPXrnR.js";import{eN as z,Ph as C,M7 as Y,Pi as k,ts as q,eZ as G,Pj as M,tq as O}from"./zeni-epic-state-Cdw8EpcM.js";import{R as j}from"./ReferralListScreen-BM1gHESu.js";import"./recharts-DD1DDktN.js";import"./analytics-CaofNoIK.js";import"./plaid-CxNli5Mg.js";import"./dnd-dQAnWf63.js";import"./stripe-DMRn4zHo.js";import"./lottie-D8AaXarT.js";import"./lexical-DPC-NxTc.js";import"./pdf-iZy3i289.js";import"./utils-gH_xiFg7.js";import"./useAskAiCfoHostNavButtonProps-CIdYxL8V.js";import"./useFetchSuggestedQuestionsWhenReady-DaXgh6Pr.js";import"./MobileAppDrawer-DvyjBd4g.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]="2afab062-889d-4efe-83c0-f9274e96322e",e._sentryDebugIdIdentifier="sentry-dbid-2afab062-889d-4efe-83c0-f9274e96322e")}catch{}})();const Z=R(function(e,t){const n=C(e);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}},function(e,t){const{navigate:n}=t,o=w.getSignedInUser();return{onDismissClick:()=>{e(k()),n("..")},onSendClick:()=>{if(o!=null){const s=[],r=[];t.inviteFormCompayData.forEach(c=>{s.push(c.companyName),r.push(c.emailIds[0])}),p.trackInviteEmailClicked("send",s,r,s.length)}e(O())},onUpdateInviteFormLocalData:s=>{e(M({localData:s}))},onSubmitSuccess:()=>{n("../../")},onCancelClick:()=>{o!=null&&p.trackInviteEmailClicked("cancel")}}})(P),B=()=>{const e=T(),[t,n]=f.useState(!1),[o,s]=f.useState(!1),r=b(i=>z(i)),c=V(),v=A(),{useDynamicConfig:g}=x(),d=w.getSignedInUser();if(d==null)throw Error("Can't access invite referral screen without signing in...");const m=b(i=>C(i)),_=d?.firstName!=null?d.firstName:"User",{configValue:h}=g(y.zeniCardsConfig),{configValue:D}=g(y.zeniAccountsConfig),I=Y(D);f.useEffect(()=>{e(k()),r?.rewardsLastViewedTime==null&&o===!1&&(e(q()),s(!0))},[]),f.useEffect(()=>{t||m.fetchState!=="Not-Started"||(n(!0),e(G(!0)))},[m.fetchState,e]);const N=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[m.fetchState==="Completed"?a.jsx(E,{analytics:p,onLoad:i=>(S=>S.trackPageLoaded(F.Event.inviteEmailViewed))(i)}):null,a.jsx(Z,{navigate:c,location:v,currentTenant:r,companyName:N,userName:_,inviteFormCompayData:m.localData,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,maxAnnualPercentageYield:I.maxAnnualPercentageYield})]})};function de(){const{useFeatureGate:e}=x(),{isFeatureEnabled:t}=e(L.isReferralFeatureEnabled);return a.jsxs(U,{children:[a.jsx(u,{path:"/",element:t?a.jsx(j,{}):a.jsx(l,{})}),a.jsx(u,{path:"how-it-works",element:t?a.jsx(j,{isReferralDrawerOpen:!0}):a.jsx(l,{})}),a.jsx(u,{path:"refer/*",element:t?a.jsx(B,{}):a.jsx(l,{})}),a.jsx(u,{path:"*",element:a.jsx(l,{})})]})}export{de as default};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-CITCXfQh.js","assets/sentry-BbjYSgze.js","assets/core-r3zPXrnR.js","assets/zeni-epic-state-Cdw8EpcM.js","assets/index-DHwEE904.js","assets/mui-BD9ReF4V.js","assets/analytics-CaofNoIK.js","assets/utils-gH_xiFg7.js","assets/withTransactionSidePanel-C7832Ype.js","assets/useAskAiCfoHostNavButtonProps-CIdYxL8V.js","assets/useFetchSuggestedQuestionsWhenReady-DaXgh6Pr.js","assets/TransactionDetailScreen-ClRsLpwG.js","assets/decodeURIComponentSafe-DIvx_0bc.js","assets/routePaths-BGzy8Dqj.js","assets/NotFoundScreen-BHPCFLTM.js","assets/analyticsHelper-26beXk6v.js","assets/CompanyPassportScreen-DsQqH3R_.js","assets/MobileAppDrawer-DvyjBd4g.js","assets/FeaturePreviewScreen-D_2XoCHl.js","assets/ReferralListScreen-BM1gHESu.js","assets/index-Bc34frN_.css","assets/BillPayRoutes-BG-syOfw.js","assets/AddressScreen-Cuxn6jUb.js","assets/DomesticWireDetailScreen-DswgjtZ7.js","assets/useInitialThreadRequest-C6Fi1v7Q.js","assets/DrawerScreen-W83sAi_k.js","assets/SetupPagesScreen-C_S8AZRH.js","assets/BusinessVerificationPageScreen-BB9F88mK.js","assets/BillPayApprovalRoutes-CLMXdAbQ.js","assets/ReimbursementApprovalRuleDetailScreen-B5Ck2C9Y.js","assets/getLocaleForTenant-CQnHebPH.js","assets/ReimbursementRoutes-cLh7G6_T.js","assets/ReimbursementApprovalRoutes-Dtwap8JJ.js","assets/TransactionListRoutes-CmhrN_6s.js","assets/ZeniAccountStatementScreen-COih_FbC.js","assets/SettingsRoutes-Cw1W0wHt.js","assets/accountMappingHelper-Br2QJsWh.js","assets/QBOConnectionScreen-B-4fO2ne.js","assets/empty-DOFWY-gL.js","assets/index-BGpP6oaB.js","assets/url-DYDNdwVU.js","assets/index-BG4MEhH2.js","assets/ReportsRoutes-BBHBFqy6.js","assets/ChargeCardRoutes-DkULQd3q.js","assets/PeopleRoutes-Deq8C3bu.js","assets/ExpenseAutomationRoutes-BwBWvBQz.js","assets/TreasuryRoutes-Bgzquerm.js","assets/VendorsRoutes-Df3m6Veu.js","assets/pathToGoBack-D3dTZRn8.js","assets/ZeniAccountRoutes-bTvT8A0g.js","assets/AddressRoutes-0TGuT2xq.js","assets/PandLWithForecastRoutes-D6-VHxb-.js","assets/CustomerOnboardingRoutes-lSSTd4er.js","assets/TransactionDetailRoutes-BXbmHxwN.js","assets/EntityDetailRoutes-DFMGt3cF.js","assets/NotificationRoutes-CgSoQGEX.js","assets/PerformanceRoutes-C8KioDe9.js","assets/RewardsRoutes-DBKBcVt9.js","assets/TaskRoutes-D4-Lbjxl.js","assets/TaskListScreen-CqTOqB17.js","assets/AiCfoScreen-DWkNdv1K.js"])))=>i.map(i=>d[i]);
2
+ import{_ as n,bn as os,eN as ls,eT as cs,eR as ds,eS as ms,fD as us,eP as _s,cN as Ee,cu as Es,f9 as As,cm as ps,bC as Is,bq as gs,fe as xs,v as Ts,Ik as hs,bv as js,Il as Us,bE as bs,fb as Ds,bD as Hs,bs as Rs,cO as ys,Im as fs,In as Cs,cK as vs,cM as Os,cL as Ps,ct as Fs,cz as Ls,mm as Ae,eO as pe,fN as Bs,fi as Ie,fK as ge,fL as xe,fj as ks}from"./zeni-epic-state-Cdw8EpcM.js";import{j as e}from"./liveblocks-BUJqCtmZ.js";import{a as v}from"./sentry-BbjYSgze.js";import{h as Vs,j as Ns,l as Ss,u as Ms,g as z,i as Te,N as c,n as Zs,o as t}from"./core-r3zPXrnR.js";import{h as ws,u as zs,z as D,a as Gs,c as $s,I as Ys,l as L,j as qs,L as B,D as he,t as _,P as Ws,d as X,e as l}from"./index-DHwEE904.js";import"./mui-BD9ReF4V.js";import{f as je}from"./analyticsHelper-26beXk6v.js";import{t as Ks}from"./getLocaleForTenant-CQnHebPH.js";import"./recharts-DD1DDktN.js";import"./analytics-CaofNoIK.js";import"./plaid-CxNli5Mg.js";import"./dnd-dQAnWf63.js";import"./stripe-DMRn4zHo.js";import"./lottie-D8AaXarT.js";import"./lexical-DPC-NxTc.js";import"./pdf-iZy3i289.js";import"./utils-gH_xiFg7.js";(function(){try{var i=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},U=new i.Error().stack;U&&(i._sentryDebugIds=i._sentryDebugIds||{},i._sentryDebugIds[U]="924b31e5-e97c-406c-9be2-8c7f45fa47c8",i._sentryDebugIdIdentifier="sentry-dbid-924b31e5-e97c-406c-9be2-8c7f45fa47c8")}catch{}})();const Js={dashboard:()=>n(()=>import("./DashboardRoutes-CITCXfQh.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])),bills:()=>n(()=>import("./BillPayRoutes-BG-syOfw.js"),__vite__mapDeps([21,1,2,3,4,5,6,7,22,14,23,9,10,24,25,17,18,26,15,13,27,28,29,30,20])),reimbursement:()=>n(()=>import("./ReimbursementRoutes-cLh7G6_T.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,14,26,17,15,13,27,18,24,9,10,25,32,29,30,20])),transactions:()=>n(()=>import("./TransactionListRoutes-CmhrN_6s.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,13,34,20])),settings:()=>n(()=>import("./SettingsRoutes-Cw1W0wHt.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,22,14,15,27,13,16,37,38,39,40,41,12,28,29,32,20])),reports:()=>n(()=>import("./ReportsRoutes-BBHBFqy6.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,14,18,10,24,13,17,20])),chargeCards:()=>n(()=>import("./ChargeCardRoutes-DkULQd3q.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,26,17,14,15,13,27,9,10,22,20])),people:()=>n(()=>import("./PeopleRoutes-Deq8C3bu.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,14,9,10,17,20])),expenseAutomation:()=>n(()=>import("./ExpenseAutomationRoutes-BwBWvBQz.js"),__vite__mapDeps([45,1,2,3,14,4,5,6,7,9,10,11,12,13,8,36,25,20])),treasury:()=>n(()=>import("./TreasuryRoutes-Bgzquerm.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,14,26,17,15,13,27,9,10,18,20])),vendors:()=>n(()=>import("./VendorsRoutes-Df3m6Veu.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,22,14,18,13,48,9,10,17,25,36,20])),zeniAccounts:()=>n(()=>import("./ZeniAccountRoutes-bTvT8A0g.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,14,26,17,15,13,27,18,23,22,9,10,34,20]))},Qs=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=i=>{"requestIdleCallback"in window?requestIdleCallback(i):setTimeout(i,100)},Xs=l(()=>n(()=>import("./ReportsRoutes-BBHBFqy6.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,14,18,10,24,13,17,20]))),en=l(()=>n(()=>import("./AddressRoutes-0TGuT2xq.js"),__vite__mapDeps([50,1,2,3,22,4,5,6,7,14,20]))),sn=l(()=>n(()=>import("./PeopleRoutes-Deq8C3bu.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,14,9,10,17,20]))),nn=l(()=>n(()=>import("./PandLWithForecastRoutes-D6-VHxb-.js"),__vite__mapDeps([51,1,2,3,4,5,6,7,14,18,9,10,24,13,17,20]))),an=l(()=>n(()=>import("./CustomerOnboardingRoutes-lSSTd4er.js"),__vite__mapDeps([52,1,2,3,22,4,5,6,7,14,37,38,39,40,41,12,20]))),tn=l(()=>n(()=>import("./VendorsRoutes-Df3m6Veu.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,22,14,18,13,48,9,10,17,25,36,20]))),rn=l(()=>n(()=>import("./TransactionDetailRoutes-BXbmHxwN.js"),__vite__mapDeps([53,1,2,3,14,4,5,6,7,11,9,10,12,13,20]))),Ue=l(()=>n(()=>import("./EntityDetailRoutes-DFMGt3cF.js"),__vite__mapDeps([54,1,2,3,4,5,6,7,12,8,9,10,11,13,20]))),on=l(()=>n(()=>import("./DashboardRoutes-CITCXfQh.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]))),be=l(()=>n(()=>import("./BillPayRoutes-BG-syOfw.js"),__vite__mapDeps([21,1,2,3,4,5,6,7,22,14,23,9,10,24,25,17,18,26,15,13,27,28,29,30,20]))),ln=l(()=>n(()=>import("./SettingsRoutes-Cw1W0wHt.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,22,14,15,27,13,16,37,38,39,40,41,12,28,29,32,20]))),De=l(()=>n(()=>import("./ReimbursementRoutes-cLh7G6_T.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,14,26,17,15,13,27,18,24,9,10,25,32,29,30,20]))),cn=l(()=>n(()=>import("./ZeniAccountRoutes-bTvT8A0g.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,14,26,17,15,13,27,18,23,22,9,10,34,20]))),dn=l(()=>n(()=>import("./TreasuryRoutes-Bgzquerm.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,14,26,17,15,13,27,9,10,18,20]))),mn=l(()=>n(()=>import("./TransactionListRoutes-CmhrN_6s.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,13,34,20]))),un=l(()=>n(()=>import("./ChargeCardRoutes-DkULQd3q.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,26,17,14,15,13,27,9,10,22,20]))),_n=l(()=>n(()=>import("./NotificationRoutes-CgSoQGEX.js"),__vite__mapDeps([55,1,2,3,14,4,5,6,7,9,10,20]))),En=l(()=>n(()=>import("./PerformanceRoutes-C8KioDe9.js"),__vite__mapDeps([56,1,2,3,14,4,5,6,7,9,10,17,20]))),An=l(()=>n(()=>import("./ExpenseAutomationRoutes-BwBWvBQz.js"),__vite__mapDeps([45,1,2,3,14,4,5,6,7,9,10,11,12,13,8,36,25,20]))),pn=l(()=>n(()=>import("./RewardsRoutes-DBKBcVt9.js"),__vite__mapDeps([57,1,2,3,4,5,6,7,14,19,9,10,17,20]))),In=l(()=>n(()=>import("./TaskRoutes-D4-Lbjxl.js"),__vite__mapDeps([58,1,2,3,14,4,5,6,7,24,17,59,9,10,20]))),gn=l(()=>n(()=>import("./AiCfoScreen-DWkNdv1K.js"),__vite__mapDeps([60,1,2,3,4,5,6,7,48,20]))),y=l(()=>n(()=>import("./NotFoundScreen-BHPCFLTM.js"),__vite__mapDeps([14,1,2,3,4,5,6,7,20]))),xn=l(()=>n(()=>import("./TaskListScreen-CqTOqB17.js"),__vite__mapDeps([59,1,2,3,4,5,6,7,9,10,17,20])));function wn({setTenantEmailDomain:i}){const U=Vs(),V=Ns(),{tenantEmailDomain:o}=Ss(),N=ws().mode,{setLoading:f,clearAllLoading:O,clearLoading:Z}=zs(),R=D.getSignedInUserTenant(o)?.tenantId,h=D.getSignedInUser(),K=os(h),G=Ms(),[S,Re]=v.useState(!1),r=z(a=>ls(a)),{useFeatureGate:P}=Gs(),J=$s(),ye=Ys(),{isFeatureEnabled:fe}=P(L.isExpenseAutomationEnabled),{isFeatureEnabled:Ce}=P(L.isExpenseAutomationEnabledV2),ve=Ce||fe&&K,{isFeatureEnabled:Oe}=P(L.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Pe}=P(L.isTreasuryEnabled),{isFeatureEnabled:Fe}=P(L.isChargeCardFeatureEnabled),{isFeatureEnabled:se}=P(L.isDebitCardFeatureEnabled),j=z(a=>a.tenantState.fetchState),A=z(a=>a.tenantState.activeTenantFetchState.fetchState),u=A==="Completed"||j==="Completed"?cs(se,r):void 0,$=A==="Completed"||j==="Completed"?ds(r):void 0,Le=A==="Completed"||j==="Completed"?ms(r):void 0,Be=Fe||se||!!Le||!!$||!!u,{isFeatureEnabled:ke}=P(L.isSettingsFeatureEnabled),{isFeatureEnabled:Ve}=P(L.isAiCfoFileUploadEnabled),Y=z(a=>us(a));if(o!=null){const a=D.getSignedInUserTenant(o);h!=null&&a!=null&&je(h,r,N)}const w={tenantId:R,userId:h?.userId,sessionId:h?.zeniSessionId},ne=_s(),E=qs(),Ne=r.company==null||E?.loggedInUserRoleMap!=null&&Ee(E.loggedInUserRole),Se=Es(E?.loggedInUserRoleMap),ae=v.useRef(!0),te=Te("/:tenantEmailDomain/onboarding/*")!==null,Q=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Me=z(a=>w.tenantId!=null?As(a,w.tenantId):void 0);v.useEffect(()=>{f(B.TENANT_FETCHING),i(o)},[o]),v.useEffect(()=>{if(Q!=null&&R!=null){const a=Q.params.selectedPeriod;if(a!=null){const b=a.split("-");if(b.length===2){const d=ps(Number(b[0])),s=Number(b[1]),m=Is(`01-${d<10?`0${d}`:d}-${s}`,he.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),M=gs();m.isAfter(M,"month")===!1?U(xs(R,{month:d,year:s})):V("./month_end_close_checks/review")}}}},[Q,R]),v.useEffect(()=>{S||(Re(!0),f(B.TENANT_FETCHING)),ae.current?ae.current=!1:!Ts(ne,w)&&D.isSignedIn()&&(f(B.TENANT_FETCHING),function(a,b,d,s){if(pe(b?.userId,b?.zeniSessionId,a.tenantId),d(Bs(!0)),d(Ie(a.tenantId)),a.tenantId!=null&&_.clearTenant(a.tenantId),a.tenantId!=null){const m=D.getSignedInUserTenantWithId(a.tenantId);s&&he.updateAppLocaleID(Ks(s)),m?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(m?.tenantEmailDomain)}a.userId!=null?X.identify(a.userId,{tenant_id:a.tenantId}):X.resetUserIdentity()}(w,h,U,Me))},[w,ne,h,U,D]),v.useEffect(()=>{D.isSignedIn()&&(f(B.TENANT_FETCHING),function(a,b,d,s,m,M,k){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const q=s!=null&&m?.zeniSessionId!=null,ts=d==null||d.tenantId!==s,is=d!=null&&d.excludedResources==null,rs=d!=null&&d.externalConnections==null;if(q&&ts){k(Ie(s));const W=D.getSignedInUserTenantWithId(s);W?.tenantEmailDomain!=null&&D.saveActiveTenantDomainForUser(W?.tenantEmailDomain),pe(m?.userId,m?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(ge(m.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(xe(m.userId,s)))}else q&&is&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(ge(m.userId,s))),q&&rs&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(xe(m.userId,s)));if(q){X.identify(m.userId,{tenant_id:s});const W=s==null||s!=null&&(b==="Completed"||b==="Error");a==="Completed"||b!=="Not-Started"&&b!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),M(B.TENANT_FETCHING),k(ks(m.userId,s,m.zeniSessionId))),W&&(a==="Not-Started"||a==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),k(Ae(m.userId,m.zeniSessionId)))}}(j,A,r,R,h,f,U))},[R,A]),v.useEffect(()=>{D.isSignedIn()&&j==="Completed"&&Y.tenantsBaseInOrder.length>0&&(Z(B.TENANT_FETCHING),D.saveSignedInUserTenants(hs(Y.tenantsBaseInOrder)),h!=null&&je(h,r,N,void 0,Y.tenantsBaseInOrder))},[Y,j,r,h]),v.useEffect(()=>{A==="In-Progress"&&f(B.TENANT_FETCHING),A!=="Completed"&&A!=="Error"||(A==="Completed"&&R!=null?(O(),_.markActiveTenantFetchCompleted(R)):A==="Error"&&R!=null&&(_.markActiveTenantFetchFailed(R),Z(B.TENANT_FETCHING),Z(B.TENANT_SWITCHING))),j!=="Completed"&&j!=="Error"||(j==="Completed"?_.markAllTenantsFetchCompleted():j==="Error"&&_.markAllTenantsFetchFailed())},[A,j,R,S]);const ie=v.useRef(!1);v.useEffect(()=>{!ie.current&&A==="Completed"&&S&&(ie.current=!0,function(a=Qs,b=3e3){setTimeout(()=>{const d=s=>{if(s>=a.length)return;const m=a[s],M=Js[m];M!=null?M().then(()=>ee(()=>d(s+1))).catch(()=>ee(()=>d(s+1))):d(s+1)};ee(()=>d(0))},b)}())},[A,S]);const C=r?.userRole!=null&&js(r?.userRole),{isFeatureEnabled:Ze}=P(L.isReferralFeatureEnabled),we=r?.userRole!=null&&r.userRole.includes("charge_card_user"),ze=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),F=r?.userRole!=null&&Ee(r.userRole),re=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!C,oe=Be&&!C,Ge=Us(E?.loggedInUserRoleMap),$e=r.externalConnections?.accounting[0]?.isValid,le=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!C,de=ce&&bs(E?.loggedInUserRoleMap),me=Oe&&!C,Ye=r.company!=null&&Ds(r.company),qe=Pe&&Ye===!0&&!C,We=re&&Hs(E?.loggedInUserRoleMap),Ke=oe&&Rs(E?.loggedInUserRoleMap),Je=me&&ys(E?.loggedInUserRoleMap),Qe=fs(E?.loggedInUserRoleMap),Xe=Cs(E?.loggedInUserRoleMap),p=vs(E?.loggedInUserRoleMap),I=Os(E?.loggedInUserRoleMap),g=Ps(E?.loggedInUserRoleMap),x=Fs(E?.loggedInUserRoleMap),T=Ls(E?.loggedInUserRoleMap),ue=re&&x,_e=ce&&T,es=me&&p,ss=qe&&I,ns=oe&&g,as=r.excludedResources?.resources?.find(a=>a.resource==="/invites")!=null||Se===!0||Ge===!0||Qe===!0||Xe===!0;return D.isSignedIn()?R==null?j==="Completed"?e.jsx(c,{to:"/",replace:!0,state:{...G.state,message:"...",origin:G.pathname}}):(h!=null&&j!=="In-Progress"&&U(Ae(h.userId,h.zeniSessionId)),null):A!=="In-Progress"&&A!=="Not-Started"||j==="Completed"?(le===!0||K&&!te)&&$e===!1&&u===!1&&$===!1?(i(void 0),e.jsx(c,{to:"/connection/auth",replace:!0})):!S||le!==!1||te||K?S&&r?.userRole&&u!=null&&$!=null&&o!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(Zs,{children:e.jsxs(t,{element:e.jsx(Ws,{}),children:[e.jsx(t,{path:"/",element:e.jsx(Tn,{isDashboardAccess:F,isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,isTenantCardsOnly:$})}),e.jsx(t,{path:"dashboard/*",element:F?e.jsx(on,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reports/*",element:F?e.jsx(Xs,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"people/*",element:as||F?e.jsx(sn,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"forecast/*",element:F?e.jsx(nn,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"onboarding/*",element:e.jsx(an,{})}),e.jsx(t,{path:"transaction/*",element:F&&C===!1||we||ze?e.jsx(rn,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"transactions/*",element:F&&C===!1?e.jsx(mn,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"customer/*",element:F&&C===!1?e.jsx(Ue,{entityType:"customer"}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isTenantBankingOnly:u,isUserHasTreasuryAccess:I,tenantEmailDomain:o})}),e.jsx(t,{path:"vendor/*",element:F&&C===!1?e.jsx(Ue,{entityType:"vendor"}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"tasks",element:e.jsx(xn,{})}),e.jsx(t,{path:"tasks/*",element:e.jsx(In,{})}),e.jsx(t,{path:"address/*",element:We||de||Je||Ke?e.jsx(en,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"checking/*",element:es?e.jsx(cn,{}):e.jsx(y,{})}),e.jsx(t,{path:"treasury/*",element:ss?e.jsx(dn,{}):e.jsx(y,{})}),e.jsx(t,{path:"performance",element:ye?e.jsx(En,{}):e.jsx(He,{tenantEmailDomain:o})}),e.jsx(t,{path:"month_end_close_checks/review/*",element:ve&&C===!1?e.jsx(An,{}):e.jsx(He,{tenantEmailDomain:o})}),e.jsx(t,{path:"notifications/*",element:e.jsx(_n,{})}),e.jsx(t,{path:"vendors/*",element:Ne?e.jsx(tn,{}):e.jsx(y,{})}),e.jsx(t,{path:"bill/*",element:ue?e.jsx(be,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"bills/*",element:ue?e.jsx(be,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursement/*",element:_e?e.jsx(De,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursements/*",element:_e?e.jsx(De,{}):e.jsx(H,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"settings/*",element:ke?e.jsx(ln,{hasAdminLevelAccess:de}):e.jsx(y,{})}),e.jsx(t,{path:"cards/*",element:ns?e.jsx(un,{}):e.jsx(y,{})}),e.jsx(t,{path:"rewards/*",element:Ze?e.jsx(pn,{}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo",element:J?e.jsx(c,{to:"explore"}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo/",element:J?e.jsx(c,{to:"explore"}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo/:session_id",element:J?e.jsx(gn,{isFileUploadEnabled:Ve}):e.jsx(y,{})}),e.jsx(t,{path:"*",element:e.jsx(y,{})})]})}):null:(i(void 0),e.jsx(c,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),i(void 0),e.jsx(c,{to:"/signin/auth",replace:!0,state:{...G.state,message:"...",origin:G.pathname}}))}const Tn=({isDashboardAccess:i,isUserHasZeniAccountsAccess:U,isUserHasChargeCardAccess:V,isUserHasBillPayAccess:o,isUserHasReimbursementAccess:N,isUserHasTreasuryAccess:f,isTenantBankingOnly:O,isTenantCardsOnly:Z})=>O===!0&&U?e.jsx(c,{to:"checking"}):Z===!0?e.jsx(c,{to:"cards"}):i?e.jsx(c,{to:"dashboard"}):U?e.jsx(c,{to:"checking"}):f?e.jsx(c,{to:"treasury"}):V?e.jsx(c,{to:"cards"}):o?e.jsx(c,{to:"bills"}):N?e.jsx(c,{to:"reimbursements"}):e.jsx(c,{to:"dashboard"}),H=({isUserHasZeniAccountsAccess:i,isUserHasChargeCardAccess:U,isUserHasBillPayAccess:V,isUserHasReimbursementAccess:o,isUserHasTreasuryAccess:N,isTenantBankingOnly:f,tenantEmailDomain:O})=>f===!0||i?e.jsx(bn,{tenantEmailDomain:O}):N?e.jsx(Un,{tenantEmailDomain:O}):U?e.jsx(Dn,{tenantEmailDomain:O}):V?e.jsx(jn,{tenantEmailDomain:O}):o?e.jsx(hn,{tenantEmailDomain:O}):e.jsx(y,{}),hn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/reimbursements`}),jn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/bills`}),Un=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/treasury`}),bn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/checking`}),Dn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/cards`}),He=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/dashboard`});export{H as FallBackRoute,wn as default};
@@ -1,4 +1,4 @@
1
- import{j as t}from"./liveblocks-DiLJJ0-W.js";import{a as u}from"./sentry-CRXtNjzG.js";import{j as T,u as R,h as P,g as m,k as B,l as _,n as H,o as C}from"./core-PVb_PTOa.js";import{bm as Ie,eM as w,gr as ce,Kf as Ce,IE as xe,jm as le,lF as Ee,gt as Ae,Kh as ke,Kg as we,MG as je,w_ as Pe,Bt as ve,Mf as Me,Mo as De,b$ as re,cD as Ue,cE as Te,Ir as Fe,MH as Re,Is as Be,vq as _e,MI as Ve,DJ as Le,B9 as Oe,B0 as de,AZ as Ne,vu as ue,B3 as pe,B6 as ge,Bc as W,s1 as X,vt as $e,i_ as Y,j1 as me,MJ as Ge,k2 as Ke,vJ as Je,Ja as ze,Jb as Ze,iY as Qe,MK as qe,i$ as He,ML as Ye,vG as We,MM as Xe,MN as en,Bq as nn,eQ as fe,eS as he,MO as tn,fv as an,ID as sn,vF as te,fA as ae,fz as on,vE as cn,fy as ln,fx as rn,MP as dn,eV as be,MQ as un,MR as pn,vM as gn,vD as se,MS as mn,fc as fn,vA as hn,bS as bn,b_ as Sn,bZ as yn,bT as In,bX as Cn,bW as xn,bV as En,bY as An,bU as kn}from"./zeni-epic-state-4sJL0-hG.js";import{n as ee,l as D,z as x,aa as Se,bA as wn,d as G,g as jn,j as V,B as ne,bB as Pn,bC as vn,al as Mn,k as ye,bD as Dn,bE as Un,bF as Tn,a4 as Fn,J as Rn,bG as Bn,r as _n,bH as Vn}from"./index-P5rhD5Na.js";import{n as U}from"./mui-Bs_Wx3U8.js";import{M as v}from"./MobileAppDrawer-CPQuEteC.js";import{a as N,g as $,m as Ln}from"./accountMappingHelper-DdMTXagH.js";import{t as On,A as Nn}from"./AddressScreen-CG-B80_4.js";import F from"./NotFoundScreen-D5gX25SL.js";import{g as $n}from"./analyticsHelper-DqgMIH9d.js";import{B as Gn}from"./BusinessVerificationPageScreen-XAQKreuQ.js";import{C as Kn}from"./CompanyPassportScreen-BbokQ4hH.js";import{q as oe}from"./QBOConnectionScreen-8whb3Hsr.js";import{B as Jn}from"./BillPayApprovalRoutes-BwSUlLgD.js";import{R as zn}from"./ReimbursementApprovalRoutes-Cu9gxM3S.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"./routePaths-C6cVlXoV.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";import"./ReimbursementApprovalRuleDetailScreen-CMXdWUhi.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]="0eeb08b7-bf30-495e-82b0-383195116d2e",e._sentryDebugIdIdentifier="sentry-dbid-0eeb08b7-bf30-495e-82b0-383195116d2e")}catch{}})();const Zn=U.div`
1
+ import{j as t}from"./liveblocks-BUJqCtmZ.js";import{a as u}from"./sentry-BbjYSgze.js";import{j as T,u as R,h as P,g as m,k as B,l as _,n as W,o as C}from"./core-r3zPXrnR.js";import{bn as Ie,eN as w,gw as ce,Kj as Ce,II as xe,jr as le,lK as Ee,gy as Ae,Kl as je,Kk as we,MK as ke,x3 as Pe,By as ve,Mj as Me,Ms as De,c0 as re,cE as Ue,cF as Te,Iw as Fe,ML as Re,Ix as Be,vv as _e,MM as Ve,DO as Oe,Be as Le,B5 as de,B2 as Ne,vz as ue,B8 as pe,Bb as ge,Bh as X,s6 as Y,vy as Ke,j3 as q,j6 as me,MN as $e,k7 as ze,vO as Ge,Je as Ze,Jf as Je,j1 as He,MO as Qe,j4 as We,MP as qe,vL as Xe,MQ as Ye,MR as en,Bv as nn,eR as fe,eT as he,MS as tn,fw as an,IH as sn,vK as te,fB as ae,fA as on,vJ as cn,fz as ln,fy as rn,MT as dn,eW as be,MU as un,MV as pn,vR as gn,vI as se,MW as mn,fd as fn,vF as hn,bT as bn,b$ as Sn,b_ as yn,bU as In,bY as Cn,bX as xn,bW as En,bZ as An,bV as jn}from"./zeni-epic-state-Cdw8EpcM.js";import{a as ee,l as D,z as x,aa as Se,bA as wn,d as $,g as kn,j as V,B as ne,bB as Pn,bC as vn,al as Mn,m as ye,bD as Dn,bE as Un,bF as Tn,a4 as Fn,N as Rn,bG as Bn,s as _n,bH as Vn}from"./index-DHwEE904.js";import{n as U}from"./mui-BD9ReF4V.js";import{M as v}from"./MobileAppDrawer-DvyjBd4g.js";import{a as N,g as K,m as On}from"./accountMappingHelper-Br2QJsWh.js";import{t as Ln,A as Nn}from"./AddressScreen-Cuxn6jUb.js";import F from"./NotFoundScreen-BHPCFLTM.js";import{g as Kn}from"./analyticsHelper-26beXk6v.js";import{B as $n}from"./BusinessVerificationPageScreen-BB9F88mK.js";import{C as zn}from"./CompanyPassportScreen-DsQqH3R_.js";import{q as oe}from"./QBOConnectionScreen-B-4fO2ne.js";import{B as Gn}from"./BillPayApprovalRoutes-CLMXdAbQ.js";import{R as Zn}from"./ReimbursementApprovalRoutes-Dtwap8JJ.js";import"./recharts-DD1DDktN.js";import"./analytics-CaofNoIK.js";import"./plaid-CxNli5Mg.js";import"./dnd-dQAnWf63.js";import"./stripe-DMRn4zHo.js";import"./lottie-D8AaXarT.js";import"./lexical-DPC-NxTc.js";import"./pdf-iZy3i289.js";import"./utils-gH_xiFg7.js";import"./routePaths-BGzy8Dqj.js";import"./empty-DOFWY-gL.js";import"./pdf-lib-C-qCwtZm.js";import"./index-BGpP6oaB.js";import"./url-DYDNdwVU.js";import"./index-BG4MEhH2.js";import"./decodeURIComponentSafe-DIvx_0bc.js";import"./ReimbursementApprovalRuleDetailScreen-B5Ck2C9Y.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]="fcfa3dc5-01be-4d9e-8b33-33b7508aff78",e._sentryDebugIdIdentifier="sentry-dbid-fcfa3dc5-01be-4d9e-8b33-33b7508aff78")}catch{}})();const Jn=U.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -6,7 +6,7 @@ import{j as t}from"./liveblocks-DiLJJ0-W.js";import{a as u}from"./sentry-CRXtNjz
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,Qn=B(function(e,a){return{accountMappingView:a.accountMappingView,isFiling1099FeatureEnabled:a.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:a.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:le(e),isAccountingClassesUpdateInProgress:e.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:xe(e),meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(e,a){const{navigate:i,location:c,isFiling1099FeatureEnabled:o}=a;return{onAccountMappingChange:n=>{const{uncategorizedAccountSection:s,billsAccountSection:r,reimbursementsAccountSection:p,vendorsAccountSection:d,filing1099Section:f}=n,{incomeAccount:b,expenseAccount:g}=s,{billPayAccount:l}=r,{reimbursementsAccount:E}=p,{prepaidExpensesAccount:y,fixedAssetsAccount:k,accruedExpensesAccount:S}=d,{bankAccount:I,expenseCategory1099:L}=f,A=N(a.accountMappingView.incomeAccountList,b.selectedOption),K=N(a.accountMappingView.expenseAccountList,g.selectedOption),J=N(a.accountMappingView.billPayAccountList,l.selectedOption),z=N(a.accountMappingView.reimbursementsAccountList,E.selectedOption),O=$(a.accountMappingView.prepaidExpensesAccountList,y.selectedOptions),h=$(a.accountMappingView.fixedAssetsAccountList,k.selectedOptions),M=$(a.accountMappingView.accruedExpensesAccountList,S.selectedOptions),Z=$(a.accountMappingView.bankAccounts1099FilingAccountList,I.selectedOptions),Q=Ln(a.accountMappingView.expenseAccounts1099FilingAccountList,L),q={selectedIncomeAccountId:A?.accountId,selectedExpenseAccountId:K?.accountId,selectedBillPayAccountId:J?.accountId,selectedReimbursementsAccountId:z?.accountId,selectedPrepaidExpensesAccountIds:O.map(j=>j.accountId),selectedFixedAssetsAccountIds:h.map(j=>j.accountId),selectedAccruedExpensesAccountIds:M.map(j=>j.accountId),selectedBankAccounts1099FilingAccountIds:Z.map(j=>j.accountId),selectedExpenseAccounts1099FilingAccountIds:Q};e(we({data:q}))},onBackClick:()=>{Se(c)===!1?(i("../../dashboard"),e(ke())):e(ce())},onSaveClick:()=>{e(Ae()),o&&G.track(jn.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:n=>{e(Ee(a.currentTenant.companyId,n))}}})(wn),qn=()=>{const e=T(),a=R(),i=P(),{useFeatureGate:c}=ee(),{isFeatureEnabled:o}=c(D.isFiling1099FeatureEnabled),{isFeatureEnabled:n}=c(D.isScheduledJEAccruedExpensesFeatureEnabled),s=x.getSignedInUser(),r=Ie(s),p=m(y=>w(y)),[d,f]=u.useState(!1),[b,g]=u.useState(!1);u.useEffect(()=>{d===!1&&(i(ce()),f(!0))},[d]);const l=m(y=>Ce(y)),E=y=>{g(y)};return t.jsxs(Zn,{children:[t.jsx(v,{isAppContentDrawerOpen:b,handleDrawerToggle:E}),t.jsx(Qn,{currentTenant:p,navigate:e,accountMappingView:l,isFiling1099FeatureEnabled:o&&r,isAccruedExpensesFeatureEnabled:n,location:a,isSettings:Se(a),onClickMenuIcon:()=>E(!0)})]})},Hn=U.div`
9
+ `,Hn=B(function(e,a){return{accountMappingView:a.accountMappingView,isFiling1099FeatureEnabled:a.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:a.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:le(e),isAccountingClassesUpdateInProgress:e.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:xe(e),meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(e,a){const{navigate:i,location:c,isFiling1099FeatureEnabled:o}=a;return{onAccountMappingChange:n=>{const{uncategorizedAccountSection:s,billsAccountSection:r,reimbursementsAccountSection:p,vendorsAccountSection:d,filing1099Section:f}=n,{incomeAccount:b,expenseAccount:g}=s,{billPayAccount:l}=r,{reimbursementsAccount:E}=p,{prepaidExpensesAccount:y,fixedAssetsAccount:j,accruedExpensesAccount:S}=d,{bankAccount:I,expenseCategory1099:O}=f,A=N(a.accountMappingView.incomeAccountList,b.selectedOption),z=N(a.accountMappingView.expenseAccountList,g.selectedOption),G=N(a.accountMappingView.billPayAccountList,l.selectedOption),Z=N(a.accountMappingView.reimbursementsAccountList,E.selectedOption),L=K(a.accountMappingView.prepaidExpensesAccountList,y.selectedOptions),h=K(a.accountMappingView.fixedAssetsAccountList,j.selectedOptions),M=K(a.accountMappingView.accruedExpensesAccountList,S.selectedOptions),J=K(a.accountMappingView.bankAccounts1099FilingAccountList,I.selectedOptions),H=On(a.accountMappingView.expenseAccounts1099FilingAccountList,O),Q={selectedIncomeAccountId:A?.accountId,selectedExpenseAccountId:z?.accountId,selectedBillPayAccountId:G?.accountId,selectedReimbursementsAccountId:Z?.accountId,selectedPrepaidExpensesAccountIds:L.map(k=>k.accountId),selectedFixedAssetsAccountIds:h.map(k=>k.accountId),selectedAccruedExpensesAccountIds:M.map(k=>k.accountId),selectedBankAccounts1099FilingAccountIds:J.map(k=>k.accountId),selectedExpenseAccounts1099FilingAccountIds:H};e(we({data:Q}))},onBackClick:()=>{Se(c)===!1?(i("../../dashboard"),e(je())):e(ce())},onSaveClick:()=>{e(Ae()),o&&$.track(kn.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:n=>{e(Ee(a.currentTenant.companyId,n))}}})(wn),Qn=()=>{const e=T(),a=R(),i=P(),{useFeatureGate:c}=ee(),{isFeatureEnabled:o}=c(D.isFiling1099FeatureEnabled),{isFeatureEnabled:n}=c(D.isScheduledJEAccruedExpensesFeatureEnabled),s=x.getSignedInUser(),r=Ie(s),p=m(y=>w(y)),[d,f]=u.useState(!1),[b,g]=u.useState(!1);u.useEffect(()=>{d===!1&&(i(ce()),f(!0))},[d]);const l=m(y=>Ce(y)),E=y=>{g(y)};return t.jsxs(Jn,{children:[t.jsx(v,{isAppContentDrawerOpen:b,handleDrawerToggle:E}),t.jsx(Hn,{currentTenant:p,navigate:e,accountMappingView:l,isFiling1099FeatureEnabled:o&&r,isAccruedExpensesFeatureEnabled:n,location:a,isSettings:Se(a),onClickMenuIcon:()=>E(!0)})]})},Wn=U.div`
10
10
  display: flex;
11
11
  height: 100%;
12
12
  width: 100%;
@@ -14,7 +14,7 @@ import{j as t}from"./liveblocks-DiLJJ0-W.js";import{a as u}from"./sentry-CRXtNjz
14
14
  flex-direction: column;
15
15
  align-items: center;
16
16
  background-color: ${e=>e.theme.colors.grey4};
17
- `,Yn=B(function(e,a){const i=w(e),c=Me(e),o=De(e),n=a.roleMap.bill_pay_admin;return{isDisabled:(re(i?.userRole??[])||n)&&"readonly",billpayApprovalView:c,remiApproverView:o,analytics:G}},function(e,a){const{navigate:i,currentTenant:c}=a;return{onSetupApprovalRulesBillPaySectionClick:()=>{i("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{i("reimbursements/approval-rules")},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?i("../.."):i("../")},onNavigateToDashboard:()=>{i("../dashboard")}}})(Pn),Wn=()=>{const e=T(),a=R(),i=P(),{tenantEmailDomain:c}=_(),[o,n]=u.useState(!1),[s,r]=u.useState(!1),[p,d]=u.useState(!1),f=m(S=>w(S)),b=m(S=>S.billPaySetupApproverViewState.fetchState),g=m(S=>S.remiSetupApproverViewState.fetchState),l=m(S=>je(S)),E=f.companyId??x.getSignedInUserTenant(c)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const y=V();u.useEffect(()=>{p||b!=="Not-Started"||(d(!0),i(Pe(!0)))},[p,b,i]),u.useEffect(()=>{s||g!=="Not-Started"||(r(!0),i(ve(!0)))},[s,g,i]);const k=S=>{n(S)};return y?.loggedInUserRoleMap!=null?t.jsxs(Hn,{children:[t.jsx(v,{isAppContentDrawerOpen:o,handleDrawerToggle:k}),t.jsx(Yn,{navigate:e,location:a,companyId:E,currentTenant:f,roleMap:y.loggedInUserRoleMap,onClickMenuIcon:()=>{k(!0)}})]}):t.jsx(ne,{fetchState:l.fetchState})},Xn=U.div`
17
+ `,qn=B(function(e,a){const i=w(e),c=Me(e),o=De(e),n=a.roleMap.bill_pay_admin;return{isDisabled:(re(i?.userRole??[])||n)&&"readonly",billpayApprovalView:c,remiApproverView:o,analytics:$}},function(e,a){const{navigate:i,currentTenant:c}=a;return{onSetupApprovalRulesBillPaySectionClick:()=>{i("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{i("reimbursements/approval-rules")},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?i("../.."):i("../")},onNavigateToDashboard:()=>{i("../dashboard")}}})(Pn),Xn=()=>{const e=T(),a=R(),i=P(),{tenantEmailDomain:c}=_(),[o,n]=u.useState(!1),[s,r]=u.useState(!1),[p,d]=u.useState(!1),f=m(S=>w(S)),b=m(S=>S.billPaySetupApproverViewState.fetchState),g=m(S=>S.remiSetupApproverViewState.fetchState),l=m(S=>ke(S)),E=f.companyId??x.getSignedInUserTenant(c)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const y=V();u.useEffect(()=>{p||b!=="Not-Started"||(d(!0),i(Pe(!0)))},[p,b,i]),u.useEffect(()=>{s||g!=="Not-Started"||(r(!0),i(ve(!0)))},[s,g,i]);const j=S=>{n(S)};return y?.loggedInUserRoleMap!=null?t.jsxs(Wn,{children:[t.jsx(v,{isAppContentDrawerOpen:o,handleDrawerToggle:j}),t.jsx(qn,{navigate:e,location:a,companyId:E,currentTenant:f,roleMap:y.loggedInUserRoleMap,onClickMenuIcon:()=>{j(!0)}})]}):t.jsx(ne,{fetchState:l.fetchState})},Yn=U.div`
18
18
  display: flex;
19
19
  height: 100%;
20
20
  width: 100%;
@@ -22,7 +22,7 @@ import{j as t}from"./liveblocks-DiLJJ0-W.js";import{a as u}from"./sentry-CRXtNjz
22
22
  flex-direction: column;
23
23
  align-items: center;
24
24
  background-color: ${e=>e.theme.colors.grey4};
25
- `,et=B(function(e,a){const{companyId:i,isZeniAccountEnabled:c,isChargeCardEnabled:o,isBillPayEnabled:n,isRemiEnabled:s,isTreasuryEnabled:r}=a,p=w(e);return{bankSetupView:Ve(e,i,n,s,c,o,r),connectedAccountProvider:p.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:G}},function(e,a){const{navigate:i,currentTenant:c,companyId:o}=a;return{onFetchLinkTokenClick:(n,s,r)=>{e(X(s,n,r))},onEstablishConnectionClick:(n,s,r)=>{e(W(n,o,s,r))},onUpdatePaymentAccountStatus:(n,s,r,p,d)=>{e(ge(n,s,d,p,r))},onUpdatePaymentAccountLoginStatus:(n,s,r,p)=>{e(pe(!1,n,p,r,s))},onEstablishConnectionSuccess:(n,s)=>{e(ue(s,n))},onUpdateAccountClick:(n,s,r,p,d)=>{e(d==="paymentAccount"?de(n,s,r,p):Ne(p,n,s))},onUpdatePrimaryFundingAccount:(n,s,r)=>{e(Oe(o,s,n,r))},onRemoveConnection:n=>{e(Le(n))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?i("../.."):i("../")},onNavigateToDashboard:()=>{i("../dashboard")}}})(vn),nt=()=>{const e=T(),a=R(),i=P(),{tenantEmailDomain:c}=_(),o=V(),[n,s]=u.useState(!1),[r,p]=u.useState(!1),d=m(I=>w(I)),f=m(I=>I.settingsViewState.bankConnection.fetchState),b=Ue(d,o?.loggedInUserRoleMap),g=Te(d,o?.loggedInUserRoleMap),l=Fe(d,o?.loggedInUserRoleMap),E=Re(d,o?.loggedInUserRoleMap),y=Be(d,o?.loggedInUserRoleMap),k=d.companyId??x.getSignedInUserTenant(c)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");u.useEffect(()=>{r||f==="Completed"||(p(!0),i(_e(!1)))},[r,i,f]);const S=I=>{s(I)};return b||l||g||y?t.jsxs(Xn,{children:[t.jsx(v,{isAppContentDrawerOpen:n,handleDrawerToggle:S}),t.jsx(et,{navigate:e,location:a,companyId:k,currentTenant:d,roleMap:o.loggedInUserRoleMap,isBillPayEnabled:b,isRemiEnabled:g,isZeniAccountEnabled:l,isChargeCardEnabled:y,isTreasuryEnabled:E,onClickMenuIcon:()=>{S(!0)}})]}):t.jsx(F,{})},tt=U.div`
25
+ `,et=B(function(e,a){const{companyId:i,isZeniAccountEnabled:c,isChargeCardEnabled:o,isBillPayEnabled:n,isRemiEnabled:s,isTreasuryEnabled:r}=a,p=w(e);return{bankSetupView:Ve(e,i,n,s,c,o,r),connectedAccountProvider:p.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:$}},function(e,a){const{navigate:i,currentTenant:c,companyId:o}=a;return{onFetchLinkTokenClick:(n,s,r)=>{e(Y(s,n,r))},onEstablishConnectionClick:(n,s,r)=>{e(X(n,o,s,r))},onUpdatePaymentAccountStatus:(n,s,r,p,d)=>{e(ge(n,s,d,p,r))},onUpdatePaymentAccountLoginStatus:(n,s,r,p)=>{e(pe(!1,n,p,r,s))},onEstablishConnectionSuccess:(n,s)=>{e(ue(s,n))},onUpdateAccountClick:(n,s,r,p,d)=>{e(d==="paymentAccount"?de(n,s,r,p):Ne(p,n,s))},onUpdatePrimaryFundingAccount:(n,s,r)=>{e(Le(o,s,n,r))},onRemoveConnection:n=>{e(Oe(n))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?i("../.."):i("../")},onNavigateToDashboard:()=>{i("../dashboard")}}})(vn),nt=()=>{const e=T(),a=R(),i=P(),{tenantEmailDomain:c}=_(),o=V(),[n,s]=u.useState(!1),[r,p]=u.useState(!1),d=m(I=>w(I)),f=m(I=>I.settingsViewState.bankConnection.fetchState),b=Ue(d,o?.loggedInUserRoleMap),g=Te(d,o?.loggedInUserRoleMap),l=Fe(d,o?.loggedInUserRoleMap),E=Re(d,o?.loggedInUserRoleMap),y=Be(d,o?.loggedInUserRoleMap),j=d.companyId??x.getSignedInUserTenant(c)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");u.useEffect(()=>{r||f==="Completed"||(p(!0),i(_e(!1)))},[r,i,f]);const S=I=>{s(I)};return b||l||g||y?t.jsxs(Yn,{children:[t.jsx(v,{isAppContentDrawerOpen:n,handleDrawerToggle:S}),t.jsx(et,{navigate:e,location:a,companyId:j,currentTenant:d,roleMap:o.loggedInUserRoleMap,isBillPayEnabled:b,isRemiEnabled:g,isZeniAccountEnabled:l,isChargeCardEnabled:y,isTreasuryEnabled:E,onClickMenuIcon:()=>{S(!0)}})]}):t.jsx(F,{})},tt=U.div`
26
26
  display: flex;
27
27
  height: 100%;
28
28
  width: 100%;
@@ -30,7 +30,7 @@ import{j as t}from"./liveblocks-DiLJJ0-W.js";import{a as u}from"./sentry-CRXtNjz
30
30
  flex-direction: column;
31
31
  align-items: center;
32
32
  background-color: ${e=>e.theme.colors.grey4};
33
- `,at=B(function(e,a){const{companyId:i}=a,c=w(e),o=a.roleMap.bill_pay_admin,n=Ge(e,i),{uiState:s}=n,r=(re(c?.userRole??[])||o)&&n.setupView.accountFetchStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.accountUpdateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{billingSetupView:n,uiState:s,stripeKey:ye.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:r,analytics:G}},function(e,a){const{navigate:i,currentTenant:c,companyId:o}=a;return{onFetchLinkTokenClick:(n,s)=>{e(X("billing_setup",n,s))},onEstablishConnectionClick:n=>{e(W(n,o,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(ue("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,s,r)=>{e(ge(n,s,"billing","billing_setup",r))},onUpdatePaymentAccountLoginStatus:(n,s)=>{e(pe(!1,n,"billing","billing_setup",s))},onUpdateAccountClick:(n,s)=>{e(de(n,s,"billing","billing_setup"))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?i("../.."):i("../")},onNavigateToDashboard:()=>{i("../dashboard")},handleCreateCardSetupIntent:n=>{e(me(n))},handleConfirmCardSetupIntent:n=>{e(He(n))},updateCardPaymentModalState:n=>{e(qe({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,s,r)=>{e(Qe(n,s,r))},handleFetchPaymentSources:()=>{e(Y())},resetCardPaymentViewState:()=>{e(Ze())},handleResetCardPaymentErrorStatuses:()=>{e(ze())},onBillingAddressSave:n=>{e(Je(n))},onAddressEditHandler:n=>{if(n!=null){const s=On(n);e(Ke({addressType:"subscription_billing_address",addressToCreate:s}))}}}})(Dn),st=()=>{const e=T(),a=R(),i=P(),{tenantEmailDomain:c}=_(),[o,n]=u.useState(!1),[s,r]=u.useState(!1),[p,d]=u.useState(!1),f=m(I=>w(I)),b=m(I=>I.cardPaymentViewState),g=m(I=>I.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState),l=Mn(b.addCardPaymentSourceStatus.fetchState),E=b.addCardPaymentSourceStatus.fetchState,y=f.companyId??x.getSignedInUserTenant(c)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const k=V();u.useEffect(()=>{y!=null&&i($e(y,!1))},[y,i]),u.useEffect(()=>{s||(r(!0),i(Y()))},[s,i]),u.useEffect(()=>{p||(me(["card"]),d(!0))},[p]),u.useEffect(()=>{l==="In-Progress"&&E==="Completed"&&i(Y())},[l,E]);const S=I=>{n(I)};return k?.loggedInUserRoleMap!=null?t.jsxs(tt,{children:[t.jsx(v,{isAppContentDrawerOpen:o,handleDrawerToggle:S}),t.jsx(at,{navigate:e,location:a,companyId:y,currentTenant:f,roleMap:k.loggedInUserRoleMap,onClickMenuIcon:()=>{S(!0)},googleAPIKey:ye.googleMapsAPIKey})]}):t.jsx(ne,{fetchState:g})},ot=B(function(){return{meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(e,a){const{navigate:i,integrationsView:c,tenantEmailDomain:o}=a;return{onBackClick:()=>{i("../")},onNavigateToDashboard:()=>{i("../dashboard")},onReconnectQBO:()=>{oe.init("/connection/auth",o),oe.handleClick()},onRefreshClick:()=>{c.integrations.refreshQBO.fetchState!=="In-Progress"&&e(We())}}})(Un),it=()=>{const e=T(),{tenantEmailDomain:a}=_(),[i,c]=u.useState(!1),o=m(g=>g.tenantState.fetchState),n=m(g=>w(g)),s=n.companyId??x.getSignedInUserTenant(a)?.companyId,r=x.getSignedInUser(),p=V(),d=p?.loggedInUserRole.includes("admin")===!0;if(r==null)throw Error("Can't access Integrations page without signing in...");const f=g=>{c(g)},b=m(g=>Ye(g,s));return p?.loggedInUserRoleMap!=null?t.jsxs(ct,{children:[t.jsx(v,{isAppContentDrawerOpen:i,handleDrawerToggle:f}),t.jsx(ot,{navigate:e,onClickMenuIcon:()=>{f(!0)},isAdmin:d,integrationsView:b,isLoading:o==="In-Progress",tenantEmailDomain:n.tenantEmailDomain})]}):t.jsx(ne,{fetchState:o})},ct=U.div`
33
+ `,at=B(function(e,a){const{companyId:i}=a,c=w(e),o=a.roleMap.bill_pay_admin,n=$e(e,i),{uiState:s}=n,r=(re(c?.userRole??[])||o)&&n.setupView.accountFetchStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.accountUpdateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{billingSetupView:n,uiState:s,stripeKey:ye.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:r,analytics:$}},function(e,a){const{navigate:i,currentTenant:c,companyId:o}=a;return{onFetchLinkTokenClick:(n,s)=>{e(Y("billing_setup",n,s))},onEstablishConnectionClick:n=>{e(X(n,o,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(ue("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,s,r)=>{e(ge(n,s,"billing","billing_setup",r))},onUpdatePaymentAccountLoginStatus:(n,s)=>{e(pe(!1,n,"billing","billing_setup",s))},onUpdateAccountClick:(n,s)=>{e(de(n,s,"billing","billing_setup"))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?i("../.."):i("../")},onNavigateToDashboard:()=>{i("../dashboard")},handleCreateCardSetupIntent:n=>{e(me(n))},handleConfirmCardSetupIntent:n=>{e(We(n))},updateCardPaymentModalState:n=>{e(Qe({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,s,r)=>{e(He(n,s,r))},handleFetchPaymentSources:()=>{e(q())},resetCardPaymentViewState:()=>{e(Je())},handleResetCardPaymentErrorStatuses:()=>{e(Ze())},onBillingAddressSave:n=>{e(Ge(n))},onAddressEditHandler:n=>{if(n!=null){const s=Ln(n);e(ze({addressType:"subscription_billing_address",addressToCreate:s}))}}}})(Dn),st=()=>{const e=T(),a=R(),i=P(),{tenantEmailDomain:c}=_(),[o,n]=u.useState(!1),[s,r]=u.useState(!1),[p,d]=u.useState(!1),f=m(I=>w(I)),b=m(I=>I.cardPaymentViewState),g=m(I=>I.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState),l=Mn(b.addCardPaymentSourceStatus.fetchState),E=b.addCardPaymentSourceStatus.fetchState,y=f.companyId??x.getSignedInUserTenant(c)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const j=V();u.useEffect(()=>{y!=null&&i(Ke(y,!1))},[y,i]),u.useEffect(()=>{s||(r(!0),i(q()))},[s,i]),u.useEffect(()=>{p||(me(["card"]),d(!0))},[p]),u.useEffect(()=>{l==="In-Progress"&&E==="Completed"&&i(q())},[l,E]);const S=I=>{n(I)};return j?.loggedInUserRoleMap!=null?t.jsxs(tt,{children:[t.jsx(v,{isAppContentDrawerOpen:o,handleDrawerToggle:S}),t.jsx(at,{navigate:e,location:a,companyId:y,currentTenant:f,roleMap:j.loggedInUserRoleMap,onClickMenuIcon:()=>{S(!0)},googleAPIKey:ye.googleMapsAPIKey})]}):t.jsx(ne,{fetchState:g})},ot=B(function(){return{meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(e,a){const{navigate:i,integrationsView:c,tenantEmailDomain:o}=a;return{onBackClick:()=>{i("../")},onNavigateToDashboard:()=>{i("../dashboard")},onReconnectQBO:()=>{oe.init("/connection/auth",o),oe.handleClick()},onRefreshClick:()=>{c.integrations.refreshQBO.fetchState!=="In-Progress"&&e(Xe())}}})(Un),it=()=>{const e=T(),{tenantEmailDomain:a}=_(),[i,c]=u.useState(!1),o=m(g=>g.tenantState.fetchState),n=m(g=>w(g)),s=n.companyId??x.getSignedInUserTenant(a)?.companyId,r=x.getSignedInUser(),p=V(),d=p?.loggedInUserRole.includes("admin")===!0;if(r==null)throw Error("Can't access Integrations page without signing in...");const f=g=>{c(g)},b=m(g=>qe(g,s));return p?.loggedInUserRoleMap!=null?t.jsxs(ct,{children:[t.jsx(v,{isAppContentDrawerOpen:i,handleDrawerToggle:f}),t.jsx(ot,{navigate:e,onClickMenuIcon:()=>{f(!0)},isAdmin:d,integrationsView:b,isLoading:o==="In-Progress",tenantEmailDomain:n.tenantEmailDomain})]}):t.jsx(ne,{fetchState:o})},ct=U.div`
34
34
  display: flex;
35
35
  height: 100%;
36
36
  width: 100%;
@@ -46,7 +46,7 @@ import{j as t}from"./liveblocks-DiLJJ0-W.js";import{a as u}from"./sentry-CRXtNjz
46
46
  flex-direction: column;
47
47
  align-items: center;
48
48
  background-color: ${e=>e.theme.colors.grey4};
49
- `,rt=()=>{const e=P(),{tenantEmailDomain:a}=_(),[i,c]=u.useState(!1),o=m(l=>w(l)).companyId??x.getSignedInUserTenant(a)?.companyId,n=x.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const s=m(l=>Xe(l,n.userId)),r=m(l=>en(l,o,"bill_pay","user_reimbursement_account")),{plaidConnectionDetails:p}=r,d=l=>{c(l)},f=u.useCallback(l=>{e(X("user_reimbursement_account",l))},[]),b=u.useCallback(l=>{e(W(l,o,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},[]);u.useEffect(()=>{s.fetchState!=="Completed"&&s.fetchState!=="In-Progress"&&e(nn(n.userId))},[n.userId,s.fetchState]);const g=s.fetchState==="Not-Started"||s.fetchState==="In-Progress";return t.jsxs(lt,{children:[t.jsx(v,{isAppContentDrawerOpen:i,handleDrawerToggle:d}),t.jsx(Tn,{plaidConnectionDetails:p,isLoading:g,myBankConnectionsView:s,onFetchLinkTokenClick:f,onEstablishConnectionClick:b,onClickMenuIcon:()=>{d(!0)}})]})},dt=U.div`
49
+ `,rt=()=>{const e=P(),{tenantEmailDomain:a}=_(),[i,c]=u.useState(!1),o=m(l=>w(l)).companyId??x.getSignedInUserTenant(a)?.companyId,n=x.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const s=m(l=>Ye(l,n.userId)),r=m(l=>en(l,o,"bill_pay","user_reimbursement_account")),{plaidConnectionDetails:p}=r,d=l=>{c(l)},f=u.useCallback(l=>{e(Y("user_reimbursement_account",l))},[]),b=u.useCallback(l=>{e(X(l,o,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},[]);u.useEffect(()=>{s.fetchState!=="Completed"&&s.fetchState!=="In-Progress"&&e(nn(n.userId))},[n.userId,s.fetchState]);const g=s.fetchState==="Not-Started"||s.fetchState==="In-Progress";return t.jsxs(lt,{children:[t.jsx(v,{isAppContentDrawerOpen:i,handleDrawerToggle:d}),t.jsx(Tn,{plaidConnectionDetails:p,isLoading:g,myBankConnectionsView:s,onFetchLinkTokenClick:f,onEstablishConnectionClick:b,onClickMenuIcon:()=>{d(!0)}})]})},dt=U.div`
50
50
  display: flex;
51
51
  height: 100%;
52
52
  width: 100%;
@@ -54,4 +54,4 @@ import{j as t}from"./liveblocks-DiLJJ0-W.js";import{a as u}from"./sentry-CRXtNjz
54
54
  flex-direction: column;
55
55
  align-items: center;
56
56
  background-color: ${e=>e.theme.colors.grey4};
57
- `,ie=({appContent:e})=>{const a=P(),i=T(),c=R(),[o,n]=u.useState(!1),s=m(h=>w(h)),{tenantEmailDomain:r}=s,p=s.companyId??x.getSignedInUserTenant(r)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:d}=ee(),{isFeatureEnabled:f}=d(D.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(D.isChargeCardFeatureEnabled),{isFeatureEnabled:g}=d(D.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=d(D.isTreasuryEnabled),E=m(h=>le(h)),y=fe(s),k=he(g,s),S=!k&&E,I=Fn(s,b,g),{areTenantIdsInSync:L}=Rn();u.useEffect(()=>{L&&a(tn(p,S))},[p,a,S,L]);const A=m(h=>an(h,S)),K=A.fetchState==="Not-Started"||A.fetchState==="In-Progress"||p==null,J=sn(s),z=!!s.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,O=h=>{n(h)};return t.jsxs(dt,{children:[t.jsx(v,{isAppContentDrawerOpen:o,handleDrawerToggle:O}),e!=null?t.jsx(t.Fragment,{children:e}):t.jsx(Bn,{myProfileView:A,isAccountingClassesEnabled:E,isReimbursementDisabled:z===!1,isZeniAccountsDisabled:f===!1,isChargeCardDisabled:I===!1,isTreasuryDisabled:l===!1,isLiteRoleDisabled:J===!1,onClickMenuIcon:()=>{O(!0)},isLoading:K,isBankingOnlyTenant:k,isCardsOnlyTenant:y,onAddressClick:h=>{const M=function(Q,q){let j=`/${Q}/settings/my_profile`;return j=j.concat(`/new/${q}`),j}(r,h),Z=_n(c.state?.pathnameStackToGoBack,c.pathname);i(M,{state:{pathnameStackToGoBack:Z}})},onGetOtp:h=>{const M={...A.myProfileLocalData,phone:h};a(te({localData:M})),a(rn(h,"MyProfile"))},onResendOtp:h=>{a(ln(h,"MyProfile"))},onCancelClick:()=>{a(cn())},onSaveClick:()=>{a(ae("MyProfile",A.myProfileLocalData.phone,A.myProfileLocalData.otpChallenge,A.myProfileLocalData.dateOfBirth,A.addressData?.addressToCreate))},onVerifyOtp:(h,M)=>{a(on(h,M,"MyProfile"))},onVerifyOtpSuccess:h=>{h!=null&&x.saveZeniOtpToken(h),a(ae("MyProfile",A.myProfileLocalData.phone,A.myProfileLocalData.otpChallenge,A.myProfileLocalData.dateOfBirth,A.addressData?.addressToCreate))},updateMyProfileLocalData:h=>{a(te({localData:h}))}})]})};function ut(){const e=P(),a=m(l=>w(l)).companyId,i=m(l=>dn(l)),c=m(l=>be(l)),o=x.getSignedInUser(),[n,s]=u.useState(!1),r=u.useCallback(l=>{s(l)},[]),p=u.useCallback(l=>{e(un(l))},[]),d=u.useCallback(()=>{o?.userEmail!=null&&e(pn({loggedInUserEmail:o.userEmail}))},[o?.userEmail]),f=u.useCallback(()=>{e(gn())},[]);if(o==null)throw Error("Can't access Notification Settings page without signing in...");const b=u.useCallback(()=>{const l=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(se(l,a))},[a,c.notificationSettings.monthEndInsightsNotificationSettings.enabled]),g=u.useCallback(()=>{e(mn())},[]);return u.useEffect(()=>{if(c.fetchState==="Completed"&&i.fetchState!=="In-Progress"&&i.fetchState!=="Completed"){const l=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(se(l,a))}},[i.fetchState,a,c.notificationSettings.monthEndInsightsNotificationSettings.enabled,c.fetchState]),t.jsxs(t.Fragment,{children:[t.jsx(v,{isAppContentDrawerOpen:n,handleDrawerToggle:r}),t.jsx(Vn,{notificationSettingsView:i,onFormDataChange:p,onCancel:d,onSave:f,onClickMenuIcon:()=>{r(!0)},signedInUser:o,onRefresh:b,resetUpdateStatus:g})]})}function zt(e){const[a,i]=u.useState(!1),c=m(l=>be(l)),o=m(l=>w(l)),n=V(),s=x.getSignedInUser(),r=P(),{useFeatureGate:p}=ee(),{isFeatureEnabled:d}=p(D.isDebitCardFeatureEnabled),f=s?.userEmail==null||c.fetchState!=="Completed"||fn(c.notificationSettings,s.userEmail,d,o);u.useEffect(()=>{c.fetchState!=="In-Progress"&&c.fetchState!=="Completed"&&a===!1&&(i(!0),r(hn()))},[c.fetchState,a]);const b=he(d,o),g=fe(o);return c.fetchState!=="In-Progress"&&c.fetchState!=="Not-Started"||f!==!0?bn(o)?t.jsxs(H,{children:[Sn(n?.loggedInUserRole??[],d,o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"accounting/*",element:t.jsx(qn,{})}),yn(n?.loggedInUserRole??[],d,o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"approval_rules/*",element:t.jsx(pt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),In(o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"my_bank_connections",element:t.jsx(rt,{})}),Cn(o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"bank_connections",element:t.jsx(nt,{})}),xn(o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"business_verification",element:t.jsx(Gn,{productType:b?"zeni_accounts":g?"charge_cards":$n(o,n?.loggedInUserRoleMap)})}),En(n?.loggedInUserRole??[],o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"company_details",element:t.jsx(Kn,{})}),An(n?.loggedInUserRole??[],o)&&t.jsx(C,{path:"billing",element:t.jsx(st,{})}),kn(n?.loggedInUserRole??[],d,o)&&t.jsx(C,{path:"integrations",element:t.jsx(it,{})}),t.jsx(C,{path:"my_profile/new/:addressType",element:t.jsx(ie,{appContent:t.jsx(Nn,{isSubPage:!1})})}),t.jsx(C,{path:"my_profile",element:t.jsx(ie,{})}),f&&t.jsx(C,{path:"notifications",element:t.jsx(ut,{})}),t.jsx(C,{path:"*",element:t.jsx(F,{})})]}):t.jsx(H,{children:t.jsx(C,{path:"*",element:t.jsx(F,{})})}):null}function pt(e){return t.jsxs(H,{children:[t.jsx(C,{path:"/",element:t.jsx(Wn,{})}),t.jsx(C,{path:"bills/approval-rules/*",element:t.jsx(Jn,{})}),t.jsx(C,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?t.jsx(zn,{}):t.jsx(F,{})}),t.jsx(C,{path:"*",element:t.jsx(F,{})})]})}export{zt as default};
57
+ `,ie=({appContent:e})=>{const a=P(),i=T(),c=R(),[o,n]=u.useState(!1),s=m(h=>w(h)),{tenantEmailDomain:r}=s,p=s.companyId??x.getSignedInUserTenant(r)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:d}=ee(),{isFeatureEnabled:f}=d(D.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(D.isChargeCardFeatureEnabled),{isFeatureEnabled:g}=d(D.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=d(D.isTreasuryEnabled),E=m(h=>le(h)),y=fe(s),j=he(g,s),S=!j&&E,I=Fn(s,b,g),{areTenantIdsInSync:O}=Rn();u.useEffect(()=>{O&&a(tn(p,S))},[p,a,S,O]);const A=m(h=>an(h,S)),z=A.fetchState==="Not-Started"||A.fetchState==="In-Progress"||p==null,G=sn(s),Z=!!s.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,L=h=>{n(h)};return t.jsxs(dt,{children:[t.jsx(v,{isAppContentDrawerOpen:o,handleDrawerToggle:L}),e!=null?t.jsx(t.Fragment,{children:e}):t.jsx(Bn,{myProfileView:A,isAccountingClassesEnabled:E,isReimbursementDisabled:Z===!1,isZeniAccountsDisabled:f===!1,isChargeCardDisabled:I===!1,isTreasuryDisabled:l===!1,isLiteRoleDisabled:G===!1,onClickMenuIcon:()=>{L(!0)},isLoading:z,isBankingOnlyTenant:j,isCardsOnlyTenant:y,onAddressClick:h=>{const M=function(H,Q){let k=`/${H}/settings/my_profile`;return k=k.concat(`/new/${Q}`),k}(r,h),J=_n(c.state?.pathnameStackToGoBack,c.pathname);i(M,{state:{pathnameStackToGoBack:J}})},onGetOtp:h=>{const M={...A.myProfileLocalData,phone:h};a(te({localData:M})),a(rn(h,"MyProfile"))},onResendOtp:h=>{a(ln(h,"MyProfile"))},onCancelClick:()=>{a(cn())},onSaveClick:()=>{a(ae("MyProfile",A.myProfileLocalData.phone,A.myProfileLocalData.otpChallenge,A.myProfileLocalData.dateOfBirth,A.addressData?.addressToCreate))},onVerifyOtp:(h,M)=>{a(on(h,M,"MyProfile"))},onVerifyOtpSuccess:h=>{h!=null&&x.saveZeniOtpToken(h),a(ae("MyProfile",A.myProfileLocalData.phone,A.myProfileLocalData.otpChallenge,A.myProfileLocalData.dateOfBirth,A.addressData?.addressToCreate))},updateMyProfileLocalData:h=>{a(te({localData:h}))}})]})};function ut(){const e=P(),a=m(l=>w(l)).companyId,i=m(l=>dn(l)),c=m(l=>be(l)),o=x.getSignedInUser(),[n,s]=u.useState(!1),r=u.useCallback(l=>{s(l)},[]),p=u.useCallback(l=>{e(un(l))},[]),d=u.useCallback(()=>{o?.userEmail!=null&&e(pn({loggedInUserEmail:o.userEmail}))},[o?.userEmail]),f=u.useCallback(()=>{e(gn())},[]);if(o==null)throw Error("Can't access Notification Settings page without signing in...");const b=u.useCallback(()=>{const l=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(se(l,a))},[a,c.notificationSettings.monthEndInsightsNotificationSettings.enabled]),g=u.useCallback(()=>{e(mn())},[]);return u.useEffect(()=>{if(c.fetchState==="Completed"&&i.fetchState!=="In-Progress"&&i.fetchState!=="Completed"){const l=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(se(l,a))}},[i.fetchState,a,c.notificationSettings.monthEndInsightsNotificationSettings.enabled,c.fetchState]),t.jsxs(t.Fragment,{children:[t.jsx(v,{isAppContentDrawerOpen:n,handleDrawerToggle:r}),t.jsx(Vn,{notificationSettingsView:i,onFormDataChange:p,onCancel:d,onSave:f,onClickMenuIcon:()=>{r(!0)},signedInUser:o,onRefresh:b,resetUpdateStatus:g})]})}function Zt(e){const[a,i]=u.useState(!1),c=m(l=>be(l)),o=m(l=>w(l)),n=V(),s=x.getSignedInUser(),r=P(),{useFeatureGate:p}=ee(),{isFeatureEnabled:d}=p(D.isDebitCardFeatureEnabled),f=s?.userEmail==null||c.fetchState!=="Completed"||fn(c.notificationSettings,s.userEmail,d,o);u.useEffect(()=>{c.fetchState!=="In-Progress"&&c.fetchState!=="Completed"&&a===!1&&(i(!0),r(hn()))},[c.fetchState,a]);const b=he(d,o),g=fe(o);return c.fetchState!=="In-Progress"&&c.fetchState!=="Not-Started"||f!==!0?bn(o)?t.jsxs(W,{children:[Sn(n?.loggedInUserRole??[],d,o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"accounting/*",element:t.jsx(Qn,{})}),yn(n?.loggedInUserRole??[],d,o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"approval_rules/*",element:t.jsx(pt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),In(o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"my_bank_connections",element:t.jsx(rt,{})}),Cn(o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"bank_connections",element:t.jsx(nt,{})}),xn(o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"business_verification",element:t.jsx($n,{productType:b?"zeni_accounts":g?"charge_cards":Kn(o,n?.loggedInUserRoleMap)})}),En(n?.loggedInUserRole??[],o,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"company_details",element:t.jsx(zn,{})}),An(n?.loggedInUserRole??[],o)&&t.jsx(C,{path:"billing",element:t.jsx(st,{})}),jn(n?.loggedInUserRole??[],d,o)&&t.jsx(C,{path:"integrations",element:t.jsx(it,{})}),t.jsx(C,{path:"my_profile/new/:addressType",element:t.jsx(ie,{appContent:t.jsx(Nn,{isSubPage:!1})})}),t.jsx(C,{path:"my_profile",element:t.jsx(ie,{})}),f&&t.jsx(C,{path:"notifications",element:t.jsx(ut,{})}),t.jsx(C,{path:"*",element:t.jsx(F,{})})]}):t.jsx(W,{children:t.jsx(C,{path:"*",element:t.jsx(F,{})})}):null}function pt(e){return t.jsxs(W,{children:[t.jsx(C,{path:"/",element:t.jsx(Xn,{})}),t.jsx(C,{path:"bills/approval-rules/*",element:t.jsx(Gn,{})}),t.jsx(C,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?t.jsx(Zn,{}):t.jsx(F,{})}),t.jsx(C,{path:"*",element:t.jsx(F,{})})]})}export{Zt as default};