@zeniai/web-app-ui 5.0.0-qa → 5.0.1-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 (115) hide show
  1. package/dist/assets/AddressRoutes-BQP-CfGZ.js +1 -0
  2. package/dist/assets/AddressScreen-wF2P11Cc.js +9 -0
  3. package/dist/assets/{AiCfoScreen-BR8PoUmU.js → AiCfoScreen-CILB5bBS.js} +2 -2
  4. package/dist/assets/{BillPayApprovalRoutes-BeaWY9ga.js → BillPayApprovalRoutes-Bm6O9E1C.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-CWbI-3lu.js → BillPayRoutes-DvR3hqif.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-B8mXcNLy.js → BusinessVerificationPageScreen-Db_j23ph.js} +2 -2
  7. package/dist/assets/{ChargeCardRoutes-Bgdfn44a.js → ChargeCardRoutes-B2KJAodB.js} +8 -8
  8. package/dist/assets/{CompanyPassportScreen-BCPm2c8T.js → CompanyPassportScreen-C20zLwxY.js} +1 -1
  9. package/dist/assets/ConnectionAuthScreen-DJ5wyIja.js +11 -0
  10. package/dist/assets/CustomerOnboardingAuthScreen-BSF1us15.js +1 -0
  11. package/dist/assets/{CustomerOnboardingRoutes-D-_60rGa.js → CustomerOnboardingRoutes-CnVH8vUK.js} +4 -4
  12. package/dist/assets/{DashboardRoutes-B9_-_tPb.js → DashboardRoutes-6WcO8n0u.js} +3 -3
  13. package/dist/assets/{DefaultTenantHome-Cl8vcsiM.js → DefaultTenantHome-CrXP_cR1.js} +1 -1
  14. package/dist/assets/{DomesticWireDetailScreen-DCV6HQRp.js → DomesticWireDetailScreen-C51IXDOd.js} +3 -3
  15. package/dist/assets/DrawerScreen-CV5-68Vp.js +1 -0
  16. package/dist/assets/{EntityDetailRoutes-CINCnbfR.js → EntityDetailRoutes-CWP-yEzD.js} +1 -1
  17. package/dist/assets/{ExpenseAutomationRoutes-D8G_zp8f.js → ExpenseAutomationRoutes-BCVBp8qi.js} +5 -5
  18. package/dist/assets/FeaturePreviewScreen-C9zUUTCh.js +1 -0
  19. package/dist/assets/MagicLinkRoutes-q1juhq3J.js +72 -0
  20. package/dist/assets/MagicLinkSignInScreen-D3tHYM0l.js +12 -0
  21. package/dist/assets/{MobileAppDrawer-eCdBXSxf.js → MobileAppDrawer-Czhowgsf.js} +1 -1
  22. package/dist/assets/NotFoundScreen-D0cCxE_g.js +1 -0
  23. package/dist/assets/{NotificationRoutes-CxWKZNsp.js → NotificationRoutes-C37yYJm9.js} +1 -1
  24. package/dist/assets/PandLWithForecastRoutes-LRtjQJx_.js +1 -0
  25. package/dist/assets/{PeopleRoutes-5oajZHVV.js → PeopleRoutes-nhSxQuOd.js} +5 -5
  26. package/dist/assets/PerformanceRoutes-BU2_koAY.js +1 -0
  27. package/dist/assets/{Preview-CitTL1Hn.js → Preview--bb5p9Hr.js} +1 -1
  28. package/dist/assets/{QBOConnectionScreen-B4Rcl2XA.js → QBOConnectionScreen-ChkHB_5w.js} +1 -1
  29. package/dist/assets/{ReferralListScreen-DHtLnulq.js → ReferralListScreen-DRhEWofN.js} +2 -2
  30. package/dist/assets/{ReimbursementApprovalRoutes-DdJz0p5l.js → ReimbursementApprovalRoutes-BaUI0RrG.js} +1 -1
  31. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-BVKZCEAO.js → ReimbursementApprovalRuleDetailScreen-Doqr5IfY.js} +1 -1
  32. package/dist/assets/{ReimbursementRoutes--zV8t9-V.js → ReimbursementRoutes-B52nhenO.js} +9 -9
  33. package/dist/assets/{ReportsRoutes-CRufLdv_.js → ReportsRoutes-CNqyQ8jz.js} +1 -1
  34. package/dist/assets/RewardsRoutes-CqIupqR0.js +1 -0
  35. package/dist/assets/ScreenRoutes-CDdkS4QP.js +2 -0
  36. package/dist/assets/{SettingsRoutes-BZwjpejF.js → SettingsRoutes-CbTsbTLb.js} +7 -7
  37. package/dist/assets/{SetupPagesScreen-BJy2d6s1.js → SetupPagesScreen-DeB97TrS.js} +1 -1
  38. package/dist/assets/{SignInScreen-Cr0sIFcm.js → SignInScreen-CEzGCpsn.js} +1 -1
  39. package/dist/assets/{SignOutScreen-sgTWJDGb.js → SignOutScreen-CETwZ0Jp.js} +1 -1
  40. package/dist/assets/{TaskListScreen-BpK-8QnW.js → TaskListScreen-b7SlqOLh.js} +2 -2
  41. package/dist/assets/TaskRoutes-BMFJJPYD.js +9 -0
  42. package/dist/assets/TransactionDetailRoutes-CdhRrWAk.js +1 -0
  43. package/dist/assets/{TransactionDetailScreen-BCiX38jP.js → TransactionDetailScreen-Bh4hnUTb.js} +2 -2
  44. package/dist/assets/{TransactionListRoutes-yuwwha-7.js → TransactionListRoutes-DLq7cUVK.js} +1 -1
  45. package/dist/assets/{TreasuryRoutes-CY_-R9A0.js → TreasuryRoutes-u5hb_BqK.js} +5 -5
  46. package/dist/assets/{VendorsRoutes-k37ZPcgY.js → VendorsRoutes-DG-CUygJ.js} +1 -1
  47. package/dist/assets/WiseConfirmationScreen-uk0X1R83.js +12 -0
  48. package/dist/assets/{ZeniAccountRoutes-BYcGG-cX.js → ZeniAccountRoutes-CN91LxEE.js} +9 -9
  49. package/dist/assets/{ZeniAccountStatementScreen-DOb1513X.js → ZeniAccountStatementScreen-Da1Wlwqe.js} +1 -1
  50. package/dist/assets/{accountMappingHelper-GgTLtZGv.js → accountMappingHelper-CEUIWp7O.js} +1 -1
  51. package/dist/assets/{analytics-BL0geQNn.js → analytics-BkhHPaQ4.js} +1 -1
  52. package/dist/assets/{analyticsHelper-B-IDLpaZ.js → analyticsHelper-DZ0CUT0b.js} +1 -1
  53. package/dist/assets/{core-B4ZvHvvY.js → core-C_NeXleM.js} +1 -1
  54. package/dist/assets/{decodeURIComponentSafe-CC7b77eX.js → decodeURIComponentSafe-Drd7YS9D.js} +1 -1
  55. package/dist/assets/{dnd-B2_m6pRT.js → dnd-C0SdDgY2.js} +1 -1
  56. package/dist/assets/{empty-B5RM5mjs.js → empty-5JhUjXJf.js} +1 -1
  57. package/dist/assets/{empty-u93aQEuK.js → empty-CDZc49VR.js} +1 -1
  58. package/dist/assets/{emptyVideoElement-BX5sv6Zg.js → emptyVideoElement-SE9UwlDX.js} +1 -1
  59. package/dist/assets/{epic-h4oM0Sz-.js → epic-CBKcA32L.js} +1 -1
  60. package/dist/assets/getLocaleForTenant-C75hRciY.js +1 -0
  61. package/dist/assets/{index-DZ-RvKDF.js → index-3wKQcxVk.js} +2 -2
  62. package/dist/assets/{index-fkmKbMt9.js → index-COcEChnY.js} +1 -1
  63. package/dist/assets/{index-CWllm9J4.js → index-DEiuB93P.js} +1 -1
  64. package/dist/assets/{index-bl3TgQLh.js → index-DYUyEm6J.js} +1 -1
  65. package/dist/assets/{index-ChCWQQ_0.js → index-Dmixh63m.js} +1 -1
  66. package/dist/assets/{index-DgzG0i4n.js → index-TZBFPhBM.js} +10363 -10346
  67. package/dist/assets/{index-CAShaDN8.js → index-Y_8J-EV-.js} +1 -1
  68. package/dist/assets/{lexical-DA5yMmPj.js → lexical-B1vtLf4F.js} +1 -1
  69. package/dist/assets/{liveblocks-CVGPqYnR.js → liveblocks-BCZSgQbG.js} +1 -1
  70. package/dist/assets/{lottie-B5aSI3Li.js → lottie-BdeQlKTG.js} +1 -1
  71. package/dist/assets/{mui-DoY7WfR_.js → mui-CgjVMn8C.js} +1 -1
  72. package/dist/assets/{pathToGoBack-BDUkHX_e.js → pathToGoBack-BDpRzqvH.js} +1 -1
  73. package/dist/assets/{pdf-ChIJqwGf.js → pdf-CQPNphc4.js} +4 -4
  74. package/dist/assets/{pdf-lib-DK80DJM9.js → pdf-lib-DznUmqID.js} +1 -1
  75. package/dist/assets/{plaid-C1RHGEem.js → plaid-B3UNGbGB.js} +1 -1
  76. package/dist/assets/{pusher-ChL35Yn7.js → pusher-SrZYiYid.js} +1 -1
  77. package/dist/assets/{react-4HMKyBDf.js → react-B1LuGLWv.js} +1 -1
  78. package/dist/assets/{react-BSF23jTj.js → react-BLym8SqS.js} +1 -1
  79. package/dist/assets/{react-CJCh-4ns.js → react-BR-uiB3M.js} +1 -1
  80. package/dist/assets/{react-CbMg7X0f.js → react-BUr4gNxK.js} +1 -1
  81. package/dist/assets/{react-xvaCLOMn.js → react-CUvZ-QKI.js} +1 -1
  82. package/dist/assets/{react-CTsulPb9.js → react-CkJUroZo.js} +1 -1
  83. package/dist/assets/{recharts-DNFnaP_v.js → recharts-NCr2Pwd1.js} +1 -1
  84. package/dist/assets/{routePaths-WhbiYSxu.js → routePaths-fq-ods6n.js} +1 -1
  85. package/dist/assets/{sentry-vrLJXbkU.js → sentry-CGkVgbup.js} +1 -1
  86. package/dist/assets/{url-Cw65WvOG.js → url-D7JZ1pkZ.js} +1 -1
  87. package/dist/assets/{url-CcUoq1OV.js → url-ax2xfQkc.js} +1 -1
  88. package/dist/assets/useAskAiCfoHostNavButtonProps-BmhiW9nY.js +1 -0
  89. package/dist/assets/{useDeviceId-BMtoTIZs.js → useDeviceId-DxDe1m2N.js} +1 -1
  90. package/dist/assets/useFetchSuggestedQuestionsWhenReady-CJ1dU4ni.js +1 -0
  91. package/dist/assets/{useInitialThreadRequest-C88MW4km.js → useInitialThreadRequest-DYY0nYQq.js} +1 -1
  92. package/dist/assets/{utils-QMlevttK.js → utils-CTLGOmjC.js} +1 -1
  93. package/dist/assets/{withTransactionSidePanel-D3gZnvfm.js → withTransactionSidePanel-CsJoitfl.js} +3 -3
  94. package/dist/assets/{zeni-epic-state-Da4VO2lv.js → zeni-epic-state-Dp14ovRw.js} +3 -3
  95. package/dist/index.html +1 -1
  96. package/package.json +2 -2
  97. package/dist/assets/AddressRoutes-D2Yn8dXr.js +0 -1
  98. package/dist/assets/AddressScreen-B-90Ns9M.js +0 -9
  99. package/dist/assets/ConnectionAuthScreen-BYziEpOR.js +0 -11
  100. package/dist/assets/CustomerOnboardingAuthScreen-Dduw6GDH.js +0 -1
  101. package/dist/assets/DrawerScreen-dt2KgJzx.js +0 -1
  102. package/dist/assets/FeaturePreviewScreen-C2dbroTQ.js +0 -1
  103. package/dist/assets/MagicLinkRoutes-CytIPPYS.js +0 -72
  104. package/dist/assets/MagicLinkSignInScreen-BxPvHLB5.js +0 -12
  105. package/dist/assets/NotFoundScreen-jPpbDlQd.js +0 -1
  106. package/dist/assets/PandLWithForecastRoutes-BeER1eMP.js +0 -1
  107. package/dist/assets/PerformanceRoutes-D2L3CFvV.js +0 -1
  108. package/dist/assets/RewardsRoutes-CJ6LAavD.js +0 -1
  109. package/dist/assets/ScreenRoutes-C36ZBPGp.js +0 -2
  110. package/dist/assets/TaskRoutes-DfQABQLR.js +0 -9
  111. package/dist/assets/TransactionDetailRoutes-CM3RR8SH.js +0 -1
  112. package/dist/assets/WiseConfirmationScreen-D_U8eXIb.js +0 -12
  113. package/dist/assets/getLocaleForTenant-C50EFRQ8.js +0 -1
  114. package/dist/assets/useAskAiCfoHostNavButtonProps-DQFYXydp.js +0 -1
  115. package/dist/assets/useFetchSuggestedQuestionsWhenReady-BMFUNkte.js +0 -1
@@ -1,5 +1,5 @@
1
- import{j as t}from"./liveblocks-CVGPqYnR.js";import{a as o}from"./sentry-vrLJXbkU.js";import{g as f,j as F,h as H,u as W,k as M}from"./core-B4ZvHvvY.js";import{m as N,K as $,z as R,a$ as U,x as z,M as J,J as Y,s as q,c as l,e as G,a1 as K,b0 as Q}from"./index-DgzG0i4n.js";import{eW as X,eL as Z,L6 as I,L7 as ee,t3 as ae,sV as g,eY as re,bL as ne,s_ as se,L8 as te}from"./zeni-epic-state-Da4VO2lv.js";import{D as oe,e as ie,n as le,S as ce}from"./mui-DoY7WfR_.js";import{u as de}from"./useAskAiCfoHostNavButtonProps-DQFYXydp.js";import{c as fe}from"./useFetchSuggestedQuestionsWhenReady-BMFUNkte.js";import{M as ue}from"./MobileAppDrawer-eCdBXSxf.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]="80677fec-c79f-4b2c-9975-51afe8ed7168",e._sentryDebugIdIdentifier="sentry-dbid-80677fec-c79f-4b2c-9975-51afe8ed7168")}catch{}})();const pe={overlayWidth:new z(100,100,30)},we=({isReferralDrawerOpen:e,closeDrawerHandler:a})=>{const r=N(),n=$();if(R.getSignedInUser()==null)throw Error("Can't access How Referral works without signing in...");const i=()=>{a(!0)},u=f(c=>X(c));return t.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:t.jsx(ie,{in:e,direction:"left",children:t.jsx(ge,{onClick:c=>c.stopPropagation(),children:t.jsx(U,{onDismissClick:i,rewardsPlan:u.rewardsPlan})})})})},ge=le(ce)`
1
+ import{j as t}from"./liveblocks-BCZSgQbG.js";import{a as o}from"./sentry-CGkVgbup.js";import{g as f,j as F,h as H,u as W,k as N}from"./core-C_NeXleM.js";import{m as $,K as M,z as R,a$ as U,w as q,E as z,D as Y,q as G,c as l,e as J,a1 as K,b0 as Q}from"./index-TZBFPhBM.js";import{eW as X,eL as Z,L6 as I,L7 as ee,t3 as ae,sV as g,eY as re,bL as ne,s_ as se,L8 as te}from"./zeni-epic-state-Dp14ovRw.js";import{D as oe,e as ie,n as le,S as ce}from"./mui-CgjVMn8C.js";import{u as de}from"./useAskAiCfoHostNavButtonProps-BmhiW9nY.js";import{c as fe}from"./useFetchSuggestedQuestionsWhenReady-CJ1dU4ni.js";import{M as ue}from"./MobileAppDrawer-Czhowgsf.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]="c52d9c23-fd86-4ba2-9395-a2201488f4c1",e._sentryDebugIdIdentifier="sentry-dbid-c52d9c23-fd86-4ba2-9395-a2201488f4c1")}catch{}})();const pe={overlayWidth:new q(100,100,30)},we=({isReferralDrawerOpen:e,closeDrawerHandler:a})=>{const r=$(),n=M();if(R.getSignedInUser()==null)throw Error("Can't access How Referral works without signing in...");const i=()=>{a(!0)},u=f(c=>X(c));return t.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:t.jsx(ie,{in:e,direction:"left",children:t.jsx(ge,{onClick:c=>c.stopPropagation(),children:t.jsx(U,{onDismissClick:i,rewardsPlan:u.rewardsPlan})})})})},ge=le(ce)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
5
- `,P="refer-and-earn-status-update",ke=M(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(te({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(se(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))}}})(K(Q));function Pe({isReferralDrawerOpen:e}){const a=F(),r=H(),n=W(),[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(s=>Z(s)),m=f(s=>I(s)),v=m.fetchState,w=f(s=>s.referralViewState.rewardsPlanFetchState),y=ee([m,w]),{areTenantIdsInSync:d}=J();o.useEffect(()=>{h?.rewardsLastViewedTime==null&&D===!1&&(r(ae()),A(!0))},[]),o.useEffect(()=>{!i&&v==="Not-Started"&&d&&(u(!0),r(g(!0)))},[v,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),S=s=>{j(s)},{isAiCfoOpen:L,setIsAiCfoOpen:O}=Y(),{isAiCfoAccessEnabled:T,onAskAiCfoClick:V}=de({isAiCfoOpen:L,setIsAiCfoOpen:O,mobileExploreReferrer:"Rewards"});fe({isDataReady:y===!0});const B={events:p?.userId!=null?[`private-${p.userId}.${P}`]:[],eventCallback:(s,b,_)=>{_.onEventReceived(s)}};return t.jsxs(t.Fragment,{children:[y===!0?t.jsx(q,{analytics:l,onLoad:s=>(b=>{p!=null&&b.trackPageLoaded(G.Event.rewardsPageViewed)})(s)}):null,t.jsx(ue,{isAppContentDrawerOpen:E,handleDrawerToggle:S}),k===!0?t.jsx(we,{closeDrawerHandler:()=>{C(!1),a("..")},isReferralDrawerOpen:k}):null,t.jsx(ke,{location:n,navigate:a,currentTenant:h,onClickMenuIcon:()=>{S(!0)},isAiCfoAccessEnabled:T,onAskAiCfoClick:V,...B})]})}export{Pe as R};
5
+ `,P="refer-and-earn-status-update",ke=N(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(te({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(se(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))}}})(K(Q));function Pe({isReferralDrawerOpen:e}){const a=F(),r=H(),n=W(),[i,u]=o.useState(!1),[c,D]=o.useState(!1),[x,E]=o.useState(!1),[k,C]=o.useState(!1),p=R.getSignedInUser(),h=f(s=>Z(s)),m=f(s=>I(s)),v=m.fetchState,w=f(s=>s.referralViewState.rewardsPlanFetchState),y=ee([m,w]),{areTenantIdsInSync:d}=z();o.useEffect(()=>{h?.rewardsLastViewedTime==null&&x===!1&&(r(ae()),E(!0))},[]),o.useEffect(()=>{!i&&v==="Not-Started"&&d&&(u(!0),r(g(!0)))},[v,r,d]),o.useEffect(()=>{!c&&w.fetchState==="Not-Started"&&d&&(D(!0),r(re(!0)))},[w,r,d]),o.useEffect(()=>{C(e!=null&&e===!0)},[e]);const[A,j]=o.useState(!1),S=s=>{j(s)},{isAiCfoOpen:L,setIsAiCfoOpen:O}=Y(),{isAiCfoAccessEnabled:T,onAskAiCfoClick:V}=de({isAiCfoOpen:L,setIsAiCfoOpen:O,mobileExploreReferrer:"Rewards"});fe({isDataReady:y===!0});const B={events:p?.userId!=null?[`private-${p.userId}.${P}`]:[],eventCallback:(s,b,_)=>{_.onEventReceived(s)}};return t.jsxs(t.Fragment,{children:[y===!0?t.jsx(G,{analytics:l,onLoad:s=>(b=>{p!=null&&b.trackPageLoaded(J.Event.rewardsPageViewed)})(s)}):null,t.jsx(ue,{isAppContentDrawerOpen:A,handleDrawerToggle:S}),k===!0?t.jsx(we,{closeDrawerHandler:()=>{C(!1),a("..")},isReferralDrawerOpen:k}):null,t.jsx(ke,{location:n,navigate:a,currentTenant:h,onClickMenuIcon:()=>{S(!0)},isAiCfoAccessEnabled:T,onAskAiCfoClick:V,...B})]})}export{Pe as R};
@@ -1 +1 @@
1
- import{j as t}from"./liveblocks-CVGPqYnR.js";import x from"./NotFoundScreen-jPpbDlQd.js";import{a as p}from"./sentry-vrLJXbkU.js";import{j as I,u as C,h as A,g as u,N as E,k,n as D,o as c}from"./core-B4ZvHvvY.js";import{eL as B,M0 as S,Mg as b,C0 as T,B9 as V,B$ as m,BS as U,Mv as _}from"./zeni-epic-state-Da4VO2lv.js";import{m as $,z as M,B as N,a1 as O,bF as W,aa as z}from"./index-DgzG0i4n.js";import"./mui-DoY7WfR_.js";import{R as h}from"./ReimbursementApprovalRuleDetailScreen-BVKZCEAO.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]="24375af8-cd2e-4c45-8ed2-9f958a017331",e._sentryDebugIdIdentifier="sentry-dbid-24375af8-cd2e-4c45-8ed2-9f958a017331")}catch{}})();const d="reimbursement-approval-rule-update",F=k(function(e){return{approvalView:S(e),remiSetupApproverViewUpdateData:b(e).remiSetupApproverViewUpdateData}},function(e,r){const{navigate:a,location:l}=r;return{onApprovalRulesEventReceived:n=>{n.endsWith(d)&&e(_(!1))},onBackClick:()=>{z(l)?a("../../"):a("../../../reimbursements/setup")},onDeleteRuleClick:n=>{e(U(n))},onEditRuleClick:n=>{n!=null?(e(m(n)),a(`./${n}/edit`)):(e(m()),a("./new"))}}})(O(W)),L=()=>{const e=I(),r=C(),a=A(),[l,n]=p.useState(!1),[f,y]=p.useState(!1),v=u(s=>s.remiSetupApproverViewState.fetchState),o=u(s=>B(s)),w=$(),i=u(s=>S(s)),g=u(s=>b(s).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&a(T())},[g]),p.useEffect(()=>{l||v!=="Not-Started"||(n(!0),a(V(!0)))},[l,v,a]),M.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,P,R)=>{s.endsWith(d)&&R.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(N,{fetchState:"In-Progress",style:{backgroundColor:w.colors.grey5}}):t.jsx(F,{currentTenant:o,location:r,navigate:e,...j})};function Z(){return t.jsxs(D,{children:[t.jsx(c,{path:"/",element:t.jsx(L,{})}),t.jsx(c,{path:"/new",element:t.jsx(h,{})}),t.jsx(c,{path:"/:approvalRuleId/edit",element:t.jsx(h,{})}),t.jsx(c,{path:"*",element:t.jsx(x,{})})]})}export{Z as R};
1
+ import{j as t}from"./liveblocks-BCZSgQbG.js";import x from"./NotFoundScreen-D0cCxE_g.js";import{a as p}from"./sentry-CGkVgbup.js";import{j as I,u as C,h as A,g as u,N as E,k,n as D,o as c}from"./core-C_NeXleM.js";import{eL as B,M0 as S,Mg as b,C0 as T,B9 as V,B$ as m,BS as U,Mv as _}from"./zeni-epic-state-Dp14ovRw.js";import{m as $,z as M,B as N,a1 as O,bF as W,aa as z}from"./index-TZBFPhBM.js";import"./mui-CgjVMn8C.js";import{R as h}from"./ReimbursementApprovalRuleDetailScreen-Doqr5IfY.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]="24375af8-cd2e-4c45-8ed2-9f958a017331",e._sentryDebugIdIdentifier="sentry-dbid-24375af8-cd2e-4c45-8ed2-9f958a017331")}catch{}})();const d="reimbursement-approval-rule-update",F=k(function(e){return{approvalView:S(e),remiSetupApproverViewUpdateData:b(e).remiSetupApproverViewUpdateData}},function(e,r){const{navigate:a,location:l}=r;return{onApprovalRulesEventReceived:n=>{n.endsWith(d)&&e(_(!1))},onBackClick:()=>{z(l)?a("../../"):a("../../../reimbursements/setup")},onDeleteRuleClick:n=>{e(U(n))},onEditRuleClick:n=>{n!=null?(e(m(n)),a(`./${n}/edit`)):(e(m()),a("./new"))}}})(O(W)),L=()=>{const e=I(),r=C(),a=A(),[l,n]=p.useState(!1),[f,y]=p.useState(!1),v=u(s=>s.remiSetupApproverViewState.fetchState),o=u(s=>B(s)),w=$(),i=u(s=>S(s)),g=u(s=>b(s).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&a(T())},[g]),p.useEffect(()=>{l||v!=="Not-Started"||(n(!0),a(V(!0)))},[l,v,a]),M.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,P,R)=>{s.endsWith(d)&&R.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(N,{fetchState:"In-Progress",style:{backgroundColor:w.colors.grey5}}):t.jsx(F,{currentTenant:o,location:r,navigate:e,...j})};function Z(){return t.jsxs(D,{children:[t.jsx(c,{path:"/",element:t.jsx(L,{})}),t.jsx(c,{path:"/new",element:t.jsx(h,{})}),t.jsx(c,{path:"/:approvalRuleId/edit",element:t.jsx(h,{})}),t.jsx(c,{path:"*",element:t.jsx(x,{})})]})}export{Z as R};
@@ -1 +1 @@
1
- import{j as g}from"./liveblocks-CVGPqYnR.js";import{a as y}from"./sentry-vrLJXbkU.js";import{j as w,h as A,u as T,l as C,g as b,k as U}from"./core-B4ZvHvvY.js";import{Mg as R,M0 as E,BV as x,C2 as _,C0 as S,C1 as h,Mh as B}from"./zeni-epic-state-Da4VO2lv.js";import{z as k,m as V,B as j,bw as F,aa as O}from"./index-DgzG0i4n.js";import"./mui-DoY7WfR_.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]="d7e38a42-cdbf-4584-9480-2aead72eba51",e._sentryDebugIdIdentifier="sentry-dbid-d7e38a42-cdbf-4584-9480-2aead72eba51")}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 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("../")}}})(F);function H(){const e=w(),a=A(),t=T(),{approvalRuleId:s}=C(),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{H as R,$ as i};
1
+ import{j as g}from"./liveblocks-BCZSgQbG.js";import{a as y}from"./sentry-CGkVgbup.js";import{j as w,h as A,u as T,l as C,g as b,k as U}from"./core-C_NeXleM.js";import{Mg as R,M0 as E,BV as x,C2 as _,C0 as S,C1 as h,Mh as B}from"./zeni-epic-state-Dp14ovRw.js";import{z as k,m as V,B as j,bw as F,aa as O}from"./index-TZBFPhBM.js";import"./mui-CgjVMn8C.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]="d7e38a42-cdbf-4584-9480-2aead72eba51",e._sentryDebugIdIdentifier="sentry-dbid-d7e38a42-cdbf-4584-9480-2aead72eba51")}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 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("../")}}})(F);function H(){const e=w(),a=A(),t=T(),{approvalRuleId:s}=C(),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{H as R,$ as i};
@@ -1,10 +1,10 @@
1
- import{j as s}from"./liveblocks-CVGPqYnR.js";import{j as J,h as le,u as V,l as Y,g as w,N as _,k as K,i as ut,n as pt,o as B}from"./core-B4ZvHvvY.js";import{eL as W,Mw as me,b$ as ce,B4 as xe,jh as bt,Bh as ae,Bg as se,Mx as gt,bm as de,fF as Te,My as ht,IU as ft,j6 as De,IV as Se,IW as St,h$ as It,LO as yt,ie as Rt,AU as At,rO as vt,i6 as Ct,BE as je,Mz as Fe,MA as kt,MB as Et,MC as Bt,MD as wt,ME as xt,Bo as Ie,il as Tt,LX as Dt,Bi as jt,B2 as Ft,MF as Mt,B1 as Ut,MG as Lt,Ba as ye,Bs as Pt,Br as $t,Bn as _t,MH as Me,Gf as Ot,bn as Nt,Bd as zt,BW as Gt,MI as Ht,MJ as Zt,BA as Vt,Bx as Re,Lh as Wt,A$ as Jt,MK as Ue,Cj as Ae,Cr as Kt,ML as qt,MM as H,MN as Xt,MO as Le,MP as Qt,MQ as Pe,MR as $e,BM as ie,bs as Yt,bD as ue,cy as pe,eS as _e,eQ as Oe,MS as en,gw as tn,Lu as nn,MT as an,MU as Ne,Ly as sn,Mg as on,MV as rn,Mv as ln,Co as ve,Cn as mn,MW as cn,MX as dn,MY as un,MZ as pn,M_ as bn,M1 as gn,Ce as hn,Ci as fn,bu as Sn,bC as In,ct as yn,cN as Rn,br as An,HX as vn,cJ as Cn,cL as kn,cK as En,cs as Bn}from"./zeni-epic-state-Da4VO2lv.js";import{F as ze,K as Ge,Z as ee,i as v,z as P,bG as He,s as te,c as C,aC as Ce,o as M,ao as Q,C as wn,D as Ze,bH as xn,q as Z,J as Ve,bI as Tn,S as ne,bJ as Dn,M as jn,x as Fn,B as be,e as We,a1 as Mn,b7 as Un,R as Ln,m as Je,bK as Pn,a4 as $n}from"./index-DgzG0i4n.js";import{n as O,S as _n}from"./mui-DoY7WfR_.js";import oe from"./NotFoundScreen-jPpbDlQd.js";import{S as ke}from"./SetupPagesScreen-BJy2d6s1.js";import{F as Ke}from"./FeaturePreviewScreen-C2dbroTQ.js";import{a as g}from"./sentry-vrLJXbkU.js";import{u as qe}from"./useInitialThreadRequest-C88MW4km.js";import{u as Xe}from"./useAskAiCfoHostNavButtonProps-DQFYXydp.js";import{c as Qe}from"./useFetchSuggestedQuestionsWhenReady-BMFUNkte.js";import{D as On}from"./DrawerScreen-dt2KgJzx.js";import{M as Ye}from"./MobileAppDrawer-eCdBXSxf.js";import{R as Nn}from"./ReimbursementApprovalRoutes-DdJz0p5l.js";import{FallBackRoute as zn}from"./ScreenRoutes-C36ZBPGp.js";import"./recharts-DNFnaP_v.js";import"./lottie-B5aSI3Li.js";import"./analytics-BL0geQNn.js";import"./plaid-C1RHGEem.js";import"./dnd-B2_m6pRT.js";import"./stripe-DMRn4zHo.js";import"./lexical-DA5yMmPj.js";import"./pdf-ChIJqwGf.js";import"./utils-QMlevttK.js";import"./analyticsHelper-B-IDLpaZ.js";import"./routePaths-WhbiYSxu.js";import"./BusinessVerificationPageScreen-B8mXcNLy.js";import"./ReimbursementApprovalRuleDetailScreen-BVKZCEAO.js";import"./getLocaleForTenant-C50EFRQ8.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]="85e7c35d-5ddf-42ad-90b4-20d151feb23d",e._sentryDebugIdIdentifier="sentry-dbid-85e7c35d-5ddf-42ad-90b4-20d151feb23d")}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:U}}}=Ze.getLocalizedStrings(),Hn=K(function(e,t){const n=t.currentTenant?.companyId,r=gt(e.plaidAccountViewState,"user_reimbursement_account"),c=P.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:`${Q.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:C,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:S,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:De(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:c,navigate:d,themeState:m}=t,{tenantEmailDomain:o}=r,a=P.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($t())},clearRemiSaveStatus:()=>{e(Pt("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(Lt({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(Ut(l,i,n))},updateReimbursementType:(i,l,p)=>{e(Mt({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(jt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Ie(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(Dt({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&&(C.trackReimbursementDeleteReimbursement(n),e(je(n)))},onSaveBankAccount:()=>{a?.userId&&e(Ct(a?.userId,n))},onFetchLinkTokenClick:i=>{e(vt("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=V(),{reimbursementId:r}=Y(),c=ze(),d=Ge(),[m,o]=g.useState(r==null),[a,i]=g.useState(1),{useFeatureGate:l}=ee(),{isFeatureEnabled:p}=l(v.isLimitedCategoryForReimbursement),{isFeatureEnabled:I}=l(v.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:S}=l(v.isReimbursementCommentingEnabled),x=V().pathname,R=x.includes("edit"),D=x.includes("reimbursement/new"),[b,k]=g.useState(!1),y=P.getSignedInUser(),T=w(u=>W(u)),f=w(u=>me(u,r)),j=qe(T?.companyId,{clearParams:f.fetchState==="Completed"}),$=ce(T?.userRole??[]);g.useEffect(()=>{(D&&!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"||$&&f.billStatus==="rejected"||$===!1&&f.billStage==="pending_approval"&&f.billStatus!=="rejected"?s.jsx(_,{to:F}):f.deleteStatus.fetchState==="In-Progress"||f.fetchState!=="Completed"?s.jsx(He,{}):s.jsxs(Zn,{windowSize:d,children:[s.jsx(te,{analytics:C,onLoad:u=>(L=>{r!=null&&f.deleteStatus.fetchState!=="Completed"&&L.trackReimbursementEditReimbursement(r)})(u)}),m&&d!=="small"?s.jsx(Vn,{}):null,m&&d!=="small"?s.jsx(Wn,{children:s.jsx(Ce,{showAutofill:m,uploadInvoiceEndPoint:`${Q.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:M.sp3,paddingBottom:"15px",paddingLeft:M.sp5},dropFilePlaceholder:{upload:U.dropReceipt.upload,single:U.dropReceipt.single,or:U.dropReceipt.or,multiple:U.dropReceipt.multiple,receipts:U.dropReceipt.receipts}})}):null,m&&d==="small"?s.jsxs(Jn,{children:[s.jsx(Kn,{onClick:()=>o(!1),children:s.jsx(Gn,{})}),s.jsx(Ce,{showAutofill:m,uploadInvoiceEndPoint:`${Q.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:M.sp5,paddingRight:M.sp3,paddingBottom:M.sp5,paddingLeft:M.sp3},dropFilePlaceholder:{upload:U.dropReceipt.upload,single:U.dropReceipt.single,or:U.dropReceipt.or,multiple:U.dropReceipt.multiple,receipts:U.dropReceipt.receipts}})]}):null,s.jsx(qn,{windowSize:d,children:s.jsx(Hn,{initialOpenThreadRequest:j??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=O.div`
1
+ import{j as s}from"./liveblocks-BCZSgQbG.js";import{j as K,h as le,u as V,l as Y,g as w,N as O,k as J,i as ut,n as pt,o as B}from"./core-C_NeXleM.js";import{eL as W,Mw as me,b$ as ce,B4 as xe,jh as bt,Bh as ae,Bg as se,Mx as gt,bm as de,fF as Te,My as ht,IU as ft,j6 as De,IV as Se,IW as St,h$ as It,LO as yt,ie as Rt,AU as At,rO as vt,i6 as Ct,BE as je,Mz as Fe,MA as kt,MB as Et,MC as Bt,MD as wt,ME as xt,Bo as Ie,il as Tt,LX as Dt,Bi as jt,B2 as Ft,MF as Mt,B1 as Ut,MG as Lt,Ba as ye,Bs as Pt,Br as $t,Bn as Ot,MH as Me,Gf as _t,bn as Nt,Bd as zt,BW as Gt,MI as Ht,MJ as Zt,BA as Vt,Bx as Re,Lh as Wt,A$ as Kt,MK as Ue,Cj as Ae,Cr as Jt,ML as qt,MM as H,MN as Xt,MO as Le,MP as Qt,MQ as Pe,MR as $e,BM as ie,bs as Yt,bD as ue,cy as pe,eS as Oe,eQ as _e,MS as en,gw as tn,Lu as nn,MT as an,MU as Ne,Ly as sn,Mg as on,MV as rn,Mv as ln,Co as ve,Cn as mn,MW as cn,MX as dn,MY as un,MZ as pn,M_ as bn,M1 as gn,Ce as hn,Ci as fn,bu as Sn,bC as In,ct as yn,cN as Rn,br as An,HX as vn,cJ as Cn,cL as kn,cK as En,cs as Bn}from"./zeni-epic-state-Dp14ovRw.js";import{n as ze,K as Ge,Z as ee,i as v,z as P,bG as He,q as te,c as C,aC as Ce,o as M,ao as Q,y as wn,O as Ze,bH as xn,k as Z,D as Ve,bI as Tn,S as ne,bJ as Dn,E as jn,w as Fn,B as be,e as We,a1 as Mn,b7 as Un,M as Ln,m as Ke,bK as Pn,a4 as $n}from"./index-TZBFPhBM.js";import{n as _,S as On}from"./mui-CgjVMn8C.js";import oe from"./NotFoundScreen-D0cCxE_g.js";import{S as ke}from"./SetupPagesScreen-DeB97TrS.js";import{F as Je}from"./FeaturePreviewScreen-C9zUUTCh.js";import{a as g}from"./sentry-CGkVgbup.js";import{u as qe}from"./useInitialThreadRequest-DYY0nYQq.js";import{u as Xe}from"./useAskAiCfoHostNavButtonProps-BmhiW9nY.js";import{c as Qe}from"./useFetchSuggestedQuestionsWhenReady-CJ1dU4ni.js";import{D as _n}from"./DrawerScreen-CV5-68Vp.js";import{M as Ye}from"./MobileAppDrawer-Czhowgsf.js";import{R as Nn}from"./ReimbursementApprovalRoutes-BaUI0RrG.js";import{FallBackRoute as zn}from"./ScreenRoutes-CDdkS4QP.js";import"./recharts-NCr2Pwd1.js";import"./lottie-BdeQlKTG.js";import"./analytics-BkhHPaQ4.js";import"./plaid-B3UNGbGB.js";import"./dnd-C0SdDgY2.js";import"./stripe-DMRn4zHo.js";import"./lexical-B1vtLf4F.js";import"./pdf-CQPNphc4.js";import"./utils-CTLGOmjC.js";import"./analyticsHelper-DZ0CUT0b.js";import"./routePaths-fq-ods6n.js";import"./BusinessVerificationPageScreen-Db_j23ph.js";import"./ReimbursementApprovalRuleDetailScreen-Doqr5IfY.js";import"./getLocaleForTenant-C75hRciY.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]="3ad5671d-69e0-422c-acaa-b9bc5148febe",e._sentryDebugIdIdentifier="sentry-dbid-3ad5671d-69e0-422c-acaa-b9bc5148febe")}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:U}}}=Ze.getLocalizedStrings(),Hn=J(function(e,t){const n=t.currentTenant?.companyId,r=gt(e.plaidAccountViewState,"user_reimbursement_account"),c=P.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:`${Q.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:C,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:S,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:De(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:c,navigate:d,themeState:m}=t,{tenantEmailDomain:o}=r,a=P.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(Ot(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e($t())},clearRemiSaveStatus:()=>{e(Pt("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(Lt({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(Ut(l,i,n))},updateReimbursementType:(i,l,p)=>{e(Mt({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(jt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Ie(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(Dt({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&&(C.trackReimbursementDeleteReimbursement(n),e(je(n)))},onSaveBankAccount:()=>{a?.userId&&e(Ct(a?.userId,n))},onFetchLinkTokenClick:i=>{e(vt("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=K(),t=le(),n=V(),{reimbursementId:r}=Y(),c=ze(),d=Ge(),[m,o]=g.useState(r==null),[a,i]=g.useState(1),{useFeatureGate:l}=ee(),{isFeatureEnabled:p}=l(v.isLimitedCategoryForReimbursement),{isFeatureEnabled:I}=l(v.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:S}=l(v.isReimbursementCommentingEnabled),x=V().pathname,R=x.includes("edit"),D=x.includes("reimbursement/new"),[b,k]=g.useState(!1),y=P.getSignedInUser(),T=w(u=>W(u)),f=w(u=>me(u,r)),j=qe(T?.companyId,{clearParams:f.fetchState==="Completed"}),$=ce(T?.userRole??[]);g.useEffect(()=>{(D&&!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"||$&&f.billStatus==="rejected"||$===!1&&f.billStage==="pending_approval"&&f.billStatus!=="rejected"?s.jsx(O,{to:F}):f.deleteStatus.fetchState==="In-Progress"||f.fetchState!=="Completed"?s.jsx(He,{}):s.jsxs(Zn,{windowSize:d,children:[s.jsx(te,{analytics:C,onLoad:u=>(L=>{r!=null&&f.deleteStatus.fetchState!=="Completed"&&L.trackReimbursementEditReimbursement(r)})(u)}),m&&d!=="small"?s.jsx(Vn,{}):null,m&&d!=="small"?s.jsx(Wn,{children:s.jsx(Ce,{showAutofill:m,uploadInvoiceEndPoint:`${Q.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:M.sp3,paddingBottom:"15px",paddingLeft:M.sp5},dropFilePlaceholder:{upload:U.dropReceipt.upload,single:U.dropReceipt.single,or:U.dropReceipt.or,multiple:U.dropReceipt.multiple,receipts:U.dropReceipt.receipts}})}):null,m&&d==="small"?s.jsxs(Kn,{children:[s.jsx(Jn,{onClick:()=>o(!1),children:s.jsx(Gn,{})}),s.jsx(Ce,{showAutofill:m,uploadInvoiceEndPoint:`${Q.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:M.sp5,paddingRight:M.sp3,paddingBottom:M.sp5,paddingLeft:M.sp3},dropFilePlaceholder:{upload:U.dropReceipt.upload,single:U.dropReceipt.single,or:U.dropReceipt.or,multiple:U.dropReceipt.multiple,receipts:U.dropReceipt.receipts}})]}):null,s.jsx(qn,{windowSize:d,children:s.jsx(Hn,{initialOpenThreadRequest:j??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
2
  display: flex;
3
3
  position: relative;
4
4
  height: 100vh;
5
5
  flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
6
6
  background-color: ${e=>e.theme.colors.grey4};
7
- `,Vn=O.div`
7
+ `,Vn=_.div`
8
8
  position: fixed;
9
9
  top: 0;
10
10
  left: 0;
@@ -12,7 +12,7 @@ import{j as s}from"./liveblocks-CVGPqYnR.js";import{j as J,h as le,u as V,l as Y
12
12
  bottom: 0;
13
13
  background-color: ${wn.overlayBackgroundBlack};
14
14
  z-index: 5;
15
- `,Wn=O.div`
15
+ `,Wn=_.div`
16
16
  position: absolute;
17
17
  top: 0;
18
18
  left: 0;
@@ -22,7 +22,7 @@ import{j as s}from"./liveblocks-CVGPqYnR.js";import{j as J,h as le,u as V,l as Y
22
22
  display: flex;
23
23
  background-color: transparent;
24
24
  overflow: hidden;
25
- `,Jn=O.div`
25
+ `,Kn=_.div`
26
26
  position: fixed;
27
27
  top: 0;
28
28
  left: 0;
@@ -33,7 +33,7 @@ import{j as s}from"./liveblocks-CVGPqYnR.js";import{j as J,h as le,u as V,l as Y
33
33
  flex-direction: column;
34
34
  overflow-y: auto;
35
35
  background-color: ${e=>e.theme.colors.grey4};
36
- `,Kn=O.button`
36
+ `,Jn=_.button`
37
37
  align-self: flex-end;
38
38
  background: none;
39
39
  border: none;
@@ -48,12 +48,12 @@ import{j as s}from"./liveblocks-CVGPqYnR.js";import{j as J,h as le,u as V,l as Y
48
48
  width: ${M.sp4};
49
49
  height: ${M.sp4};
50
50
  }
51
- `,qn=O.div`
51
+ `,qn=_.div`
52
52
  display: flex;
53
53
  flex-direction: column;
54
54
  width: 100%;
55
55
  ${e=>e.windowSize!=="small"?"overflow: auto;":""}
56
- `,Xn=K(function(e,t){const n=Me(e,t.reimbursementId),r=P.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:`${Q.communicationAgentMicroServiceBaseUrl}`,authParams:m,signedInUser:r,createdBy:o,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,isAdmin:i,showApproveRejectBtns:a,isZeniUser:c,isSignedInUserReimbursementCreator:l,isAccountingClassesEnabled:De(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(Wt({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:()=>{C.trackReimbursementDeleteReimbursement(n),e(je(n))},cancelAndDeleteReport:a=>{a===!0?C.trackReimbursementCancelAndDeleteReimbursement(n):C.trackReimbursementCancelReimbursement(n),e(Vt(n,a))},handleZeniLogoClick:()=>{m.toggle()}}})(Tn);function Qn(){const e=J(),t=le(),n=V(),r=n.hash.substring(1),c=ze(),{reimbursementId:d}=Y(),m=P.getSignedInUser(),o=w(E=>W(E)),a=w(E=>Me(E,d??"")),i=a.remiDetails?.reimbursementInfo.stage.code==="draft",l=qe(o?.companyId,{clearParams:a.fetchState==="Completed"&&!i}),{isAiCfoOpen:p,setIsAiCfoOpen:I}=Ve(),{isAiCfoAccessEnabled:S,onAskAiCfoClick:x}=Xe({isAiCfoOpen:p,setIsAiCfoOpen:I,mobileExploreReferrer:"Reimbursement Details"});Qe({isDataReady:a.fetchState==="Completed"});const{useFeatureGate:R}=ee(),{isFeatureEnabled:D}=R(v.isLimitedCategoryForReimbursement),[b,k]=g.useState(!1),[y,T]=g.useState(!1),[f,j]=g.useState(!1),{isFeatureEnabled:$}=R(v.isReimbursementCommentingEnabled),{isFeatureEnabled:A}=R(v.isShowDeletedReimbursementsFeatureEnabled),F=w(E=>me(E,d??"")),u=Ot(o),L=Nt(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?j(!1):j(a.remiActivities[0]?.isRealTimeApprovalEnabled&&(L||a.allApprovers.find(E=>E.user.userId===m?.userId)!=null||a.remiDetails?.lastUpdatedBy===m?.userId))},[a.remiActivities[0]?.isRealTimeApprovalEnabled,a.allApprovers,a.remiDetails?.lastUpdatedBy,L,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,D,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:C,onLoad:E=>(q=>{d!=null&&q.trackReimbursementReimbursementDetails(d)})(E)}),s.jsx(Xn,{initialOpenThreadRequest:l??void 0,scrollId:r,isReimbursementCommentingEnabled:$,isShowDeletedReimbursementEnabled:A,location:n,navigate:e,isRealTimeApprovalEnabled:f,currentTenant:o,reimbursementId:d??"",themeState:c,isAiCfoAccessEnabled:S,onAskAiCfoClick:x})]})}const Yn=K(function(e,t){return{remisReviewView:Ue(e),analytics:t.analytics}},function(e,t){return{onCloseOverlay:()=>{t.navigate("./"),e(H())},onCloseReviewItem:n=>{e(qt(n))},onProceedForBulkActionClick:(n,r)=>{switch(n){case"send_for_approval":e(Kt());break;case"approve":e(Ae("approved",r??""));break;case"reject":e(Ae("rejected",r??""))}}}})(Dn);function ea(){const e=J(),t=w(d=>d.remisBulkActionViewState.bulkSubmissionFetchState.fetchState),{remisForReview:n}=w(d=>Ue(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:C,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=O.div`
56
+ `,Xn=J(function(e,t){const n=Me(e,t.reimbursementId),r=P.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:`${Q.communicationAgentMicroServiceBaseUrl}`,authParams:m,signedInUser:r,createdBy:o,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,isAdmin:i,showApproveRejectBtns:a,isZeniUser:c,isSignedInUserReimbursementCreator:l,isAccountingClassesEnabled:De(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(Kt(n,"reimbursement",a))},updateEditRealTimeApproverClicked:a=>{e(Wt({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:()=>{C.trackReimbursementDeleteReimbursement(n),e(je(n))},cancelAndDeleteReport:a=>{a===!0?C.trackReimbursementCancelAndDeleteReimbursement(n):C.trackReimbursementCancelReimbursement(n),e(Vt(n,a))},handleZeniLogoClick:()=>{m.toggle()}}})(Tn);function Qn(){const e=K(),t=le(),n=V(),r=n.hash.substring(1),c=ze(),{reimbursementId:d}=Y(),m=P.getSignedInUser(),o=w(E=>W(E)),a=w(E=>Me(E,d??"")),i=a.remiDetails?.reimbursementInfo.stage.code==="draft",l=qe(o?.companyId,{clearParams:a.fetchState==="Completed"&&!i}),{isAiCfoOpen:p,setIsAiCfoOpen:I}=Ve(),{isAiCfoAccessEnabled:S,onAskAiCfoClick:x}=Xe({isAiCfoOpen:p,setIsAiCfoOpen:I,mobileExploreReferrer:"Reimbursement Details"});Qe({isDataReady:a.fetchState==="Completed"});const{useFeatureGate:R}=ee(),{isFeatureEnabled:D}=R(v.isLimitedCategoryForReimbursement),[b,k]=g.useState(!1),[y,T]=g.useState(!1),[f,j]=g.useState(!1),{isFeatureEnabled:$}=R(v.isReimbursementCommentingEnabled),{isFeatureEnabled:A}=R(v.isShowDeletedReimbursementsFeatureEnabled),F=w(E=>me(E,d??"")),u=_t(o),L=Nt(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?j(!1):j(a.remiActivities[0]?.isRealTimeApprovalEnabled&&(L||a.allApprovers.find(E=>E.user.userId===m?.userId)!=null||a.remiDetails?.lastUpdatedBy===m?.userId))},[a.remiActivities[0]?.isRealTimeApprovalEnabled,a.allApprovers,a.remiDetails?.lastUpdatedBy,L,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,D,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(O,{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:C,onLoad:E=>(q=>{d!=null&&q.trackReimbursementReimbursementDetails(d)})(E)}),s.jsx(Xn,{initialOpenThreadRequest:l??void 0,scrollId:r,isReimbursementCommentingEnabled:$,isShowDeletedReimbursementEnabled:A,location:n,navigate:e,isRealTimeApprovalEnabled:f,currentTenant:o,reimbursementId:d??"",themeState:c,isAiCfoAccessEnabled:S,onAskAiCfoClick:x})]})}const Yn=J(function(e,t){return{remisReviewView:Ue(e),analytics:t.analytics}},function(e,t){return{onCloseOverlay:()=>{t.navigate("./"),e(H())},onCloseReviewItem:n=>{e(qt(n))},onProceedForBulkActionClick:(n,r)=>{switch(n){case"send_for_approval":e(Jt());break;case"approve":e(Ae("approved",r??""));break;case"reject":e(Ae("rejected",r??""))}}}})(Dn);function ea(){const e=K(),t=w(d=>d.remisBulkActionViewState.bulkSubmissionFetchState.fetchState),{remisForReview:n}=w(d=>Ue(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:C,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
57
  display: flex;
58
58
  min-height: 100%;
59
59
  width: 100%;
@@ -61,8 +61,8 @@ import{j as s}from"./liveblocks-CVGPqYnR.js";import{j as J,h as le,u as V,l as Y
61
61
  flex-direction: column;
62
62
  align-items: center;
63
63
  background-color: ${e=>e.theme.colors.grey4};
64
- `,aa=K(function(e,t){const n=$e(e,z,t.isBulkActionEnabled);let r=n.allSubTabs;const c=P.getSignedInUser(),d=de(c),m=e.tenantState.currentTenantId,o=W(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:C,uiState:n.uiState,searchText:n.searchText,filters:n.filters,downloadParams:{authParams:i,companyName:a,timePeriod:z,spendManagementEndPoint:`${Ln}/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(Le(o))},onSubtabChange:o=>{e(H()),e(Pe(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;C?.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)&&C.trackSpendManagmentFilterChange("reimbursement",o.categories.map(a=>`${a.field}-${JSON.stringify(a.values)}`))},updateDownloadStateHandler:o=>{o==="In-Progress"&&C.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(ve("send_for_approval")),t.navigate("./bulk-review");break;case"review":e(ve("approve")),t.navigate("./bulk-review")}},onReimbursementApprovalRulesEventReceived:o=>{o.endsWith(re)&&e(ln(!1))},onEventReceived:o=>{o===tt&&e(rn())}}})(Mn(Un));function sa(){const{isAiCfoOpen:e,setIsAiCfoOpen:t}=Ve(),n=J(),r=le(),c=V(),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=Xt(d.tab.toString());h!=null?r(Le(h)):console.log("Warning:Not a valid remiListTab");const N=Qt(d.subTab.toString());N!=null?r(Pe(N)):console.log("Warning:Not a valid remiListSubTab")}return()=>{r(H())}},[]);const{useFeatureGate:l}=ee(),{isFeatureEnabled:p}=l(v.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=l(v.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:S}=l(v.isBillPayCommentingEnabled),{isFeatureEnabled:x}=l(v.isReimbursementCommentingEnabled),{isFeatureEnabled:R}=l(v.isReimbursementBulkActionEnabled),D=P.getSignedInUser(),b=w(h=>W(h)),[k,y]=g.useState(!1),[T,f]=g.useState(!1),j=ne(),$=j?.loggedInUserRole?.includes("admin")===!0,A=w(h=>$e(h,z,R)),{areTenantIdsInSync:F}=jn(),u=A.fetchState,{isAiCfoAccessEnabled:L,onAskAiCfoClick:G}=Xe({isAiCfoOpen:e,setIsAiCfoOpen:t,mobileExploreReferrer:"Reimbursement List"});if(Qe({isDataReady:u==="Completed"}),g.useEffect(()=>{!T&&F&&(f(!0),r(ie(z,!0,I,!1,!0)))},[T,z,r,F]),D==null)throw Error("Can't access address page without signing in...");const E=!!b?.userRole&&Yt(b),q=ue(j?.loggedInUserRoleMap),nt=pe(j?.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(v.isDebitCardFeatureEnabled),mt=_e(lt,b),ct=Oe(b),{remisProcessed:X,remisProcessing:he}=w(h=>en(h));g.useEffect(()=>{X===he&&o!=null&&(r(tn({messageSection:"reimbursement_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_report_",variableValue:X>1?we.reports:we.report},{variableName:"_has_",variableValue:X>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))},[X,he]);const dt={events:b.companyId!=null?[`private-${b.companyId}.${tt}`,`private-${b.companyId}.${re}`]:[],eventCallback:(h,N,fe)=>{h.endsWith(re)?fe.onReimbursementApprovalRulesEventReceived?.(h):N.entity_type==="reimbursement"&&(a(N.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(Ke,{}):st&&(!E||q)||nt&&at?s.jsxs(s.Fragment,{children:[u==="Completed"?s.jsx(te,{analytics:C,onLoad:h=>(N=>N.trackPageLoaded(We.Event.reimbursementHome))(h)}):null,s.jsx(Ye,{isAppContentDrawerOpen:k,handleDrawerToggle:ge}),s.jsxs(na,{windowSize:m,children:[s.jsx(On,{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:$,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:L,onAskAiCfoClick:G,...dt})]})]}):it&&q?s.jsx(_,{to:"../setup"}):j!=null&&Ne(b,j.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=O(_n)`
64
+ `,aa=J(function(e,t){const n=$e(e,z,t.isBulkActionEnabled);let r=n.allSubTabs;const c=P.getSignedInUser(),d=de(c),m=e.tenantState.currentTenantId,o=W(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:C,uiState:n.uiState,searchText:n.searchText,filters:n.filters,downloadParams:{authParams:i,companyName:a,timePeriod:z,spendManagementEndPoint:`${Ln}/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(Le(o))},onSubtabChange:o=>{e(H()),e(Pe(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;C?.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)&&C.trackSpendManagmentFilterChange("reimbursement",o.categories.map(a=>`${a.field}-${JSON.stringify(a.values)}`))},updateDownloadStateHandler:o=>{o==="In-Progress"&&C.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(ve("send_for_approval")),t.navigate("./bulk-review");break;case"review":e(ve("approve")),t.navigate("./bulk-review")}},onReimbursementApprovalRulesEventReceived:o=>{o.endsWith(re)&&e(ln(!1))},onEventReceived:o=>{o===tt&&e(rn())}}})(Mn(Un));function sa(){const{isAiCfoOpen:e,setIsAiCfoOpen:t}=Ve(),n=K(),r=le(),c=V(),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=Xt(d.tab.toString());h!=null?r(Le(h)):console.log("Warning:Not a valid remiListTab");const N=Qt(d.subTab.toString());N!=null?r(Pe(N)):console.log("Warning:Not a valid remiListSubTab")}return()=>{r(H())}},[]);const{useFeatureGate:l}=ee(),{isFeatureEnabled:p}=l(v.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=l(v.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:S}=l(v.isBillPayCommentingEnabled),{isFeatureEnabled:x}=l(v.isReimbursementCommentingEnabled),{isFeatureEnabled:R}=l(v.isReimbursementBulkActionEnabled),D=P.getSignedInUser(),b=w(h=>W(h)),[k,y]=g.useState(!1),[T,f]=g.useState(!1),j=ne(),$=j?.loggedInUserRole?.includes("admin")===!0,A=w(h=>$e(h,z,R)),{areTenantIdsInSync:F}=jn(),u=A.fetchState,{isAiCfoAccessEnabled:L,onAskAiCfoClick:G}=Xe({isAiCfoOpen:e,setIsAiCfoOpen:t,mobileExploreReferrer:"Reimbursement List"});if(Qe({isDataReady:u==="Completed"}),g.useEffect(()=>{!T&&F&&(f(!0),r(ie(z,!0,I,!1,!0)))},[T,z,r,F]),D==null)throw Error("Can't access address page without signing in...");const E=!!b?.userRole&&Yt(b),q=ue(j?.loggedInUserRoleMap),nt=pe(j?.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(v.isDebitCardFeatureEnabled),mt=Oe(lt,b),ct=_e(b),{remisProcessed:X,remisProcessing:he}=w(h=>en(h));g.useEffect(()=>{X===he&&o!=null&&(r(tn({messageSection:"reimbursement_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_report_",variableValue:X>1?we.reports:we.report},{variableName:"_has_",variableValue:X>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))},[X,he]);const dt={events:b.companyId!=null?[`private-${b.companyId}.${tt}`,`private-${b.companyId}.${re}`]:[],eventCallback:(h,N,fe)=>{h.endsWith(re)?fe.onReimbursementApprovalRulesEventReceived?.(h):N.entity_type==="reimbursement"&&(a(N.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(Je,{}):st&&(!E||q)||nt&&at?s.jsxs(s.Fragment,{children:[u==="Completed"?s.jsx(te,{analytics:C,onLoad:h=>(N=>N.trackPageLoaded(We.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:$,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:L,onAskAiCfoClick:G,...dt})]})]}):it&&q?s.jsx(O,{to:"../setup"}):j!=null&&Ne(b,j.loggedInUserRoleMap)?s.jsx(O,{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=_(On)`
65
65
  display: flex;
66
66
  min-height: 100%;
67
67
  flex-direction: column;
68
- `,la=K(function(e,t){const{companyId:n}=t;return{reimbursementSetupView:gn(e,n),analytics:C,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"})}}})(Pn),ma=()=>{const e=J(),t=V(),{tenantEmailDomain:n}=Y(),r=Je(),[c,d]=g.useState(!1),m=w(k=>W(k)),o=P.getSignedInUserTenant(n)?.companyId??m.companyId,a=P.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,D=!!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"}):D&&I?s.jsx(_,{to:"../../reimbursements/setup"}):m.companyReimbursementInfo&&!D||m.userReimbursementInfo&&S&&x===!1?s.jsxs(s.Fragment,{children:[s.jsx(te,{analytics:C,onLoad:k=>(y=>y.trackPageLoaded(We.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 Oa(){const e=w(E=>W(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(v.isChargeCardFeatureEnabled),{isFeatureEnabled:a}=m(v.isDebitCardFeatureEnabled),i=_e(a,e),l=Oe(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),D=x&&R,{isFeatureEnabled:b}=m(v.isDepositAccountsFeatureEnabled),k=b&&!p&&Rn(t?.loggedInUserRoleMap),y=$n(e,o,a)&&!p&&An(t?.loggedInUserRoleMap),T=vn(t?.loggedInUserRoleMap),f=Cn(t?.loggedInUserRoleMap),j=kn(t?.loggedInUserRoleMap),$=En(t?.loggedInUserRoleMap),A=Bn(t?.loggedInUserRoleMap),F=pe(t?.loggedInUserRoleMap),{tenantEmailDomain:u}=Y(),L=V(),G=n===!0&&(R||F&&d);return s.jsxs(pt,{children:[L.pathname.includes("/reimbursements")?s.jsxs(s.Fragment,{children:[s.jsx(B,{path:"verification",element:s.jsx(ke,{isBillPayAdminLevelAccess:I,isUserHasOnlyBillPayAccess:S,isReimbursementAdminLevelAccess:D,isZeniAccountAdminLevelAccess:k,isChargeCardAdminLevelAccess:y,isUserHasOnlyCardAccess:T,productType:"reimbursement",type:"verification"})}),s.jsx(B,{path:"setup",element:s.jsx(ke,{isBillPayAdminLevelAccess:I,isUserHasOnlyBillPayAccess:S,isReimbursementAdminLevelAccess:D,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:D?s.jsx(Nn,{}):s.jsx(zn,{isUserHasZeniAccountsAccess:f,isUserHasChargeCardAccess:$,isUserHasBillPayAccess:A,isUserHasReimbursementAccess:F,isUserHasTreasuryAccess:j,isTenantBankingOnly:i,tenantEmailDomain:u??""})}),G&&s.jsx(B,{path:"*",element:s.jsx(sa,{})}),(i===!0||l===!0)&&s.jsx(B,{path:"/*",element:s.jsx(Ke,{})}),t!=null&&Ne(e,t?.loggedInUserRoleMap)&&s.jsx(B,{path:"*",element:s.jsx(_,{to:"../promo"})}),c&&R&&s.jsx(B,{path:"*",element:s.jsx(_,{to:"../setup"})})]}):L.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(Qn,{})}),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 ${M.sp1} ${r.colors.dropShadowNormal}`}})}),s.jsx(B,{path:"*",element:s.jsx(oe,{})})]})}export{Oa as default};
68
+ `,la=J(function(e,t){const{companyId:n}=t;return{reimbursementSetupView:gn(e,n),analytics:C,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"})}}})(Pn),ma=()=>{const e=K(),t=V(),{tenantEmailDomain:n}=Y(),r=Ke(),[c,d]=g.useState(!1),m=w(k=>W(k)),o=P.getSignedInUserTenant(n)?.companyId??m.companyId,a=P.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,D=!!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(O,{to:"../../../reimbursements"}):D&&I?s.jsx(O,{to:"../../reimbursements/setup"}):m.companyReimbursementInfo&&!D||m.userReimbursementInfo&&S&&x===!1?s.jsxs(s.Fragment,{children:[s.jsx(te,{analytics:C,onLoad:k=>(y=>y.trackPageLoaded(We.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=>W(E)),t=ne(),n=!!e.company?.companyReimbursementInfo.isReimbursementEnabled,r=Ke(),c=!!e.company?.companyReimbursementInfo.isReimbursementTOSAccepted,d=!!e.userReimbursementInfo?.isReimbursementTOSAccepted,{useFeatureGate:m}=ee(),{isFeatureEnabled:o}=m(v.isChargeCardFeatureEnabled),{isFeatureEnabled:a}=m(v.isDebitCardFeatureEnabled),i=Oe(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),D=x&&R,{isFeatureEnabled:b}=m(v.isDepositAccountsFeatureEnabled),k=b&&!p&&Rn(t?.loggedInUserRoleMap),y=$n(e,o,a)&&!p&&An(t?.loggedInUserRoleMap),T=vn(t?.loggedInUserRoleMap),f=Cn(t?.loggedInUserRoleMap),j=kn(t?.loggedInUserRoleMap),$=En(t?.loggedInUserRoleMap),A=Bn(t?.loggedInUserRoleMap),F=pe(t?.loggedInUserRoleMap),{tenantEmailDomain:u}=Y(),L=V(),G=n===!0&&(R||F&&d);return s.jsxs(pt,{children:[L.pathname.includes("/reimbursements")?s.jsxs(s.Fragment,{children:[s.jsx(B,{path:"verification",element:s.jsx(ke,{isBillPayAdminLevelAccess:I,isUserHasOnlyBillPayAccess:S,isReimbursementAdminLevelAccess:D,isZeniAccountAdminLevelAccess:k,isChargeCardAdminLevelAccess:y,isUserHasOnlyCardAccess:T,productType:"reimbursement",type:"verification"})}),s.jsx(B,{path:"setup",element:s.jsx(ke,{isBillPayAdminLevelAccess:I,isUserHasOnlyBillPayAccess:S,isReimbursementAdminLevelAccess:D,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:D?s.jsx(Nn,{}):s.jsx(zn,{isUserHasZeniAccountsAccess:f,isUserHasChargeCardAccess:$,isUserHasBillPayAccess:A,isUserHasReimbursementAccess:F,isUserHasTreasuryAccess:j,isTenantBankingOnly:i,tenantEmailDomain:u??""})}),G&&s.jsx(B,{path:"*",element:s.jsx(sa,{})}),(i===!0||l===!0)&&s.jsx(B,{path:"/*",element:s.jsx(Je,{})}),t!=null&&Ne(e,t?.loggedInUserRoleMap)&&s.jsx(B,{path:"*",element:s.jsx(O,{to:"../promo"})}),c&&R&&s.jsx(B,{path:"*",element:s.jsx(O,{to:"../setup"})})]}):L.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(Qn,{})}),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 ${M.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-CVGPqYnR.js";import{u as V,j as me,h as fe,l as ue,g as f,k as _e,n as he,o as z}from"./core-B4ZvHvvY.js";import{eL as M,f7 as g,Ii as be,pp as F,iW as Ie,hY as ye,pu as Ce,bu as ge,Ij as Se,j6 as we,bm as Re,tI as Te,Ik as Fe,Il as Oe,sG as ke,Im as G,In as Ae,Io as De,Ip as R,Iq as O,Ir as k,Is as A,It as D,dF as Ee,to as Le,tc as Y,td as H,tu as Me,th as N,tA as Be,Iu as Pe,Iv as ve,Iw as xe,Ix as Ue,Iy as je,eS as Ve,eQ as ze}from"./zeni-epic-state-Da4VO2lv.js";import{G as Ge,J as Ye,K as He,Z as Q,i as E,z as Z,M as Ne,S as qe,a as $e,s as Qe,c as L,e as Ze,q as J,N as Je,Q as Ke,R as We}from"./index-DgzG0i4n.js";import"./mui-DoY7WfR_.js";import Xe from"./NotFoundScreen-jPpbDlQd.js";import{F as ea}from"./FeaturePreviewScreen-C2dbroTQ.js";import{a as _}from"./sentry-vrLJXbkU.js";import{u as aa,a as sa,b as ta,c as oa}from"./useFetchSuggestedQuestionsWhenReady-BMFUNkte.js";import{u as na}from"./useInitialThreadRequest-C88MW4km.js";import{t as q,a as $}from"./routePaths-WhbiYSxu.js";import{M as ra}from"./MobileAppDrawer-eCdBXSxf.js";import"./recharts-DNFnaP_v.js";import"./lottie-B5aSI3Li.js";import"./analytics-BL0geQNn.js";import"./plaid-C1RHGEem.js";import"./dnd-B2_m6pRT.js";import"./stripe-DMRn4zHo.js";import"./lexical-DA5yMmPj.js";import"./pdf-ChIJqwGf.js";import"./utils-QMlevttK.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]="2a3a647d-0882-4c34-b21c-a7bedb72fd40",e._sentryDebugIdIdentifier="sentry-dbid-2a3a647d-0882-4c34-b21c-a7bedb72fd40")}catch{}})();const ia=["profit_loss","balance_sheet","cash_flow"],I=e=>{e(D({resetLeftScroll:!0})),e(A({resetLeftScroll:!0})),e(k({resetLeftScroll:!0})),e(O({resetLeftScroll:!0}))},la=e=>{e(ve()),e(xe()),e(Ue()),e(je())},ca=_e(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=Se(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,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:L,isZeniUser:Re(o),showAccountGroups:r===!0,isAccountingClassesEnabled:we(e),currentTenantCompanyName:a,statementEndPoint:`${We}/statement`,authParams:s,isZeniCOAUsed:r}},function(e,o){const{navigate:p,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(F(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(Pe(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(Be(a)),s){const{isCompareModeOn:r,filter:c}=o,{additionalBalances:m,balancesRange:l}=c;let i=[...m];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)),m.length>0&&e(H(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(R(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(N({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(N(a,s)),I(e)},onThisPeriodChanged:(a,s,t)=>{e(Me(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(H(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(Le({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=Ee(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 m=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,m,r,c);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return $(o.tenantEmailDomain,a.accountId,a.accountType,s.id,m,r,c)}return a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?$(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,c):a.accountType!=null?q(o.tenantEmailDomain,a.accountId,a.accountType,m,r,c):void 0})();if(l!=null){const i=J(o.location.state?.pathnameStackToGoBack,o.location.pathname);p(l,{state:{pathnameStackToGoBack:i,referrer:T(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"balance_sheet":e(k({scrollPosition:s}));break;case"cash_flow":e(O({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"balance_sheet":e(k({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(O({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{p("../../")},onUpdateAccountViewMode:a=>{e(De({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",T(o.selectedReportID)),e(R("profit_and_loss_by_classes"))):(o.analytics?.trackGroupBySwitch("Accounts",T(o.selectedReportID)),e(R("profit_and_loss"))),I(e)},onUpdateClassesToFilterOut:a=>{e(Ae({classesToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(G({classViewLayout:a}))},onOpenAccountViewMode:()=>{e(ke())},onUpdateDisplayOrder:a=>{e(Oe(a))},onUpdateReportFormat:a=>{la(e),e(Fe(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(Te("profit_and_loss_by_classes"))}}})(Je);function da(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Ye(),p=He(),u=Ke(p),a=me(),s=fe(),t=V(),{tenantEmailDomain:r}=ue(),{useFeatureGate:c}=Q(),{isFeatureEnabled:m}=c(E.isReportsHorizontalClassLayoutSwitchEnabled),l=Z.getSignedInUser(),[i,y]=_.useState(!1),[B,K]=_.useState(!1),{isFeatureEnabled:P}=c(E.isReportsCommentingEnabled);if(l==null)throw Error("Can't access reports page without signing in...");const v=f(n=>M(n)),W=v.company?.companyInfo.firstMonthOfFY??1,X=na(P?v?.companyId:void 0),C=f(n=>g(n).fetchState),ee=f(n=>be(n)),{areTenantIdsInSync:h}=Ne(),S=f(n=>n.financeStatementState.selectedReportId),ae=f(n=>g(n).isCompareModeOn),b=f(n=>g(n).filter),w=f(n=>g(n).selectedReportAndTimeframeFetchState),se=f(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);_.useEffect(()=>{!i&&h&&(y(!0),s(F(l.userId,!0,!0,!1)))},[i,l,s,h]),_.useEffect(()=>{i&&!B&&C==="Completed"&&h&&(s(F(l.userId,!1,!0,!1)),K(!0))},[i,B,C,h]),_.useEffect(()=>{if(i&&w.fetchState==="Not-Started"&&b.timeframe!=="free_range"&&b.timeframe!=="week"&&h)switch(S){case"profit_and_loss":case"profit_and_loss_by_classes":s(Ce(b.timeframe));break;case"balance_sheet":s(ye(b.timeframe));break;case"cash_flow":s(Ie(b.timeframe))}},[i,S,w,h]);const x=qe(),te=x?.loggedInUserRole!=null&&ge(x?.loggedInUserRole)!==!0,[oe,ne]=_.useState(!1),U=n=>{ne(n)},re=$e(),ie=ta();return function(n){const{isDataReady:le}=n,{pathname:ce}=V(),j=Ge(ce??"")==="reports",de=aa(le),pe=_.useMemo(()=>j?ia:void 0,[j]);sa({canFetchSuggestedQuestions:de,pageContexts:pe})}({isDataReady:C==="Completed"}),oa({isDataReady:C==="Completed"}),d.jsxs(d.Fragment,{children:[C==="Completed"?d.jsx(Qe,{analytics:L,onLoad:n=>n.trackPageLoaded(Ze.Event.reports)}):null,d.jsx(ra,{isAppContentDrawerOpen:oe,handleDrawerToggle:U}),d.jsx(ca,{firstMonthOfFY:W,tenantEmailDomain:r,location:t,navigate:a,windowSize:p,classViewLayout:se,selectedReportID:S,analytics:L,filter:b,isCompareModeOn:ae,hasTransactionAccess:te,signedInUser:l,selectedReportAndTimeframeFetchState:w,handleDrawerToggle:U,reportsResyncFetchState:ee.reportsResyncFetchState,isAiCfoAccessEnabled:ie&&re&&!e,onAskAiCfoClick:()=>{if(u){const n=J(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0)},isHorizontalClassReportSwitchEnabled:m,isReportsCommentingEnabled:P,initialOpenThreadRequest:X})]})}const T=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 La(){const e=f(s=>M(s)),{useFeatureGate:o}=Q(),{isFeatureEnabled:p}=o(E.isDebitCardFeatureEnabled),u=Ve(p,e),a=ze(e);return u===!0||a===!0?d.jsx(ea,{}):d.jsxs(he,{children:[d.jsx(z,{path:"/",element:d.jsx(da,{})}),d.jsx(z,{path:"*",element:d.jsx(Xe,{})})]})}export{La as default};
1
+ import{j as d}from"./liveblocks-BCZSgQbG.js";import{u as V,j as me,h as fe,l as ue,g as f,k as _e,n as he,o as z}from"./core-C_NeXleM.js";import{eL as M,f7 as g,Ii as be,pp as F,iW as Ie,hY as ye,pu as Ce,bu as ge,Ij as Se,j6 as we,bm as Te,tI as Re,Ik as Fe,Il as Oe,sG as ke,Im as G,In as De,Io as Ae,Ip as T,Iq as O,Ir as k,Is as D,It as A,dF as Ee,to as Le,tc as Y,td as H,tu as Me,th as N,tA as Be,Iu as Pe,Iv as ve,Iw as xe,Ix as Ue,Iy as je,eS as Ve,eQ as ze}from"./zeni-epic-state-Dp14ovRw.js";import{C as Ge,D as Ye,K as He,Z as Q,i as E,z as Z,E as Ne,S as qe,a as $e,q as Qe,c as L,e as Ze,k as J,G as Je,J as Ke,M as We}from"./index-TZBFPhBM.js";import"./mui-CgjVMn8C.js";import Xe from"./NotFoundScreen-D0cCxE_g.js";import{F as ea}from"./FeaturePreviewScreen-C9zUUTCh.js";import{a as _}from"./sentry-CGkVgbup.js";import{u as aa,a as sa,b as ta,c as oa}from"./useFetchSuggestedQuestionsWhenReady-CJ1dU4ni.js";import{u as na}from"./useInitialThreadRequest-DYY0nYQq.js";import{t as q,a as $}from"./routePaths-fq-ods6n.js";import{M as ra}from"./MobileAppDrawer-Czhowgsf.js";import"./recharts-NCr2Pwd1.js";import"./lottie-BdeQlKTG.js";import"./analytics-BkhHPaQ4.js";import"./plaid-B3UNGbGB.js";import"./dnd-C0SdDgY2.js";import"./stripe-DMRn4zHo.js";import"./lexical-B1vtLf4F.js";import"./pdf-CQPNphc4.js";import"./utils-CTLGOmjC.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]="5dd88472-2c24-46b2-ab0d-8d94b0448c22",e._sentryDebugIdIdentifier="sentry-dbid-5dd88472-2c24-46b2-ab0d-8d94b0448c22")}catch{}})();const ia=["profit_loss","balance_sheet","cash_flow"],I=e=>{e(A({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(k({resetLeftScroll:!0})),e(O({resetLeftScroll:!0}))},la=e=>{e(ve()),e(xe()),e(Ue()),e(je())},ca=_e(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=Se(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,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:L,isZeniUser:Te(o),showAccountGroups:r===!0,isAccountingClassesEnabled:we(e),currentTenantCompanyName:a,statementEndPoint:`${We}/statement`,authParams:s,isZeniCOAUsed:r}},function(e,o){const{navigate:p,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(F(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(Pe(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(Be(a)),s){const{isCompareModeOn:r,filter:c}=o,{additionalBalances:m,balancesRange:l}=c;let i=[...m];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)),m.length>0&&e(H(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(T(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(N({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(N(a,s)),I(e)},onThisPeriodChanged:(a,s,t)=>{e(Me(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(H(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(Le({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=Ee(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 m=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,m,r,c);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return $(o.tenantEmailDomain,a.accountId,a.accountType,s.id,m,r,c)}return a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?$(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,c):a.accountType!=null?q(o.tenantEmailDomain,a.accountId,a.accountType,m,r,c):void 0})();if(l!=null){const i=J(o.location.state?.pathnameStackToGoBack,o.location.pathname);p(l,{state:{pathnameStackToGoBack:i,referrer:R(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(A({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(D({scrollPosition:s}));break;case"balance_sheet":e(k({scrollPosition:s}));break;case"cash_flow":e(O({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(A({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(k({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(O({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{p("../../")},onUpdateAccountViewMode:a=>{e(Ae({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",R(o.selectedReportID)),e(T("profit_and_loss_by_classes"))):(o.analytics?.trackGroupBySwitch("Accounts",R(o.selectedReportID)),e(T("profit_and_loss"))),I(e)},onUpdateClassesToFilterOut:a=>{e(De({classesToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(G({classViewLayout:a}))},onOpenAccountViewMode:()=>{e(ke())},onUpdateDisplayOrder:a=>{e(Oe(a))},onUpdateReportFormat:a=>{la(e),e(Fe(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(Re("profit_and_loss_by_classes"))}}})(Je);function da(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Ye(),p=He(),u=Ke(p),a=me(),s=fe(),t=V(),{tenantEmailDomain:r}=ue(),{useFeatureGate:c}=Q(),{isFeatureEnabled:m}=c(E.isReportsHorizontalClassLayoutSwitchEnabled),l=Z.getSignedInUser(),[i,y]=_.useState(!1),[B,K]=_.useState(!1),{isFeatureEnabled:P}=c(E.isReportsCommentingEnabled);if(l==null)throw Error("Can't access reports page without signing in...");const v=f(n=>M(n)),W=v.company?.companyInfo.firstMonthOfFY??1,X=na(P?v?.companyId:void 0),C=f(n=>g(n).fetchState),ee=f(n=>be(n)),{areTenantIdsInSync:h}=Ne(),S=f(n=>n.financeStatementState.selectedReportId),ae=f(n=>g(n).isCompareModeOn),b=f(n=>g(n).filter),w=f(n=>g(n).selectedReportAndTimeframeFetchState),se=f(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);_.useEffect(()=>{!i&&h&&(y(!0),s(F(l.userId,!0,!0,!1)))},[i,l,s,h]),_.useEffect(()=>{i&&!B&&C==="Completed"&&h&&(s(F(l.userId,!1,!0,!1)),K(!0))},[i,B,C,h]),_.useEffect(()=>{if(i&&w.fetchState==="Not-Started"&&b.timeframe!=="free_range"&&b.timeframe!=="week"&&h)switch(S){case"profit_and_loss":case"profit_and_loss_by_classes":s(Ce(b.timeframe));break;case"balance_sheet":s(ye(b.timeframe));break;case"cash_flow":s(Ie(b.timeframe))}},[i,S,w,h]);const x=qe(),te=x?.loggedInUserRole!=null&&ge(x?.loggedInUserRole)!==!0,[oe,ne]=_.useState(!1),U=n=>{ne(n)},re=$e(),ie=ta();return function(n){const{isDataReady:le}=n,{pathname:ce}=V(),j=Ge(ce??"")==="reports",de=aa(le),pe=_.useMemo(()=>j?ia:void 0,[j]);sa({canFetchSuggestedQuestions:de,pageContexts:pe})}({isDataReady:C==="Completed"}),oa({isDataReady:C==="Completed"}),d.jsxs(d.Fragment,{children:[C==="Completed"?d.jsx(Qe,{analytics:L,onLoad:n=>n.trackPageLoaded(Ze.Event.reports)}):null,d.jsx(ra,{isAppContentDrawerOpen:oe,handleDrawerToggle:U}),d.jsx(ca,{firstMonthOfFY:W,tenantEmailDomain:r,location:t,navigate:a,windowSize:p,classViewLayout:se,selectedReportID:S,analytics:L,filter:b,isCompareModeOn:ae,hasTransactionAccess:te,signedInUser:l,selectedReportAndTimeframeFetchState:w,handleDrawerToggle:U,reportsResyncFetchState:ee.reportsResyncFetchState,isAiCfoAccessEnabled:ie&&re&&!e,onAskAiCfoClick:()=>{if(u){const n=J(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0)},isHorizontalClassReportSwitchEnabled:m,isReportsCommentingEnabled:P,initialOpenThreadRequest:X})]})}const R=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 La(){const e=f(s=>M(s)),{useFeatureGate:o}=Q(),{isFeatureEnabled:p}=o(E.isDebitCardFeatureEnabled),u=Ve(p,e),a=ze(e);return u===!0||a===!0?d.jsx(ea,{}):d.jsxs(he,{children:[d.jsx(z,{path:"/",element:d.jsx(da,{})}),d.jsx(z,{path:"*",element:d.jsx(Xe,{})})]})}export{La as default};
@@ -0,0 +1 @@
1
+ import{j as a}from"./liveblocks-BCZSgQbG.js";import{Z as j,z as w,aI as h,q as E,c as p,e as F,cy as L,i as P}from"./index-TZBFPhBM.js";import"./mui-CgjVMn8C.js";import l from"./NotFoundScreen-D0cCxE_g.js";import{a as u}from"./sentry-CGkVgbup.js";import{h as R,g as y,j as T,u as V,k as O,n as U,o as f}from"./core-C_NeXleM.js";import{eL as z,OR as C,LH as A,OS as k,t3 as Y,eY as q,OT as G,t1 as H}from"./zeni-epic-state-Dp14ovRw.js";import{R as x}from"./ReferralListScreen-DRhEWofN.js";import"./recharts-NCr2Pwd1.js";import"./lottie-BdeQlKTG.js";import"./analytics-BkhHPaQ4.js";import"./plaid-B3UNGbGB.js";import"./dnd-C0SdDgY2.js";import"./stripe-DMRn4zHo.js";import"./lexical-B1vtLf4F.js";import"./pdf-CQPNphc4.js";import"./utils-CTLGOmjC.js";import"./useAskAiCfoHostNavButtonProps-BmhiW9nY.js";import"./useFetchSuggestedQuestionsWhenReady-CJ1dU4ni.js";import"./MobileAppDrawer-Czhowgsf.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]="72ab78b5-1bbb-4e8c-9e9c-c1787afb42bf",e._sentryDebugIdIdentifier="sentry-dbid-72ab78b5-1bbb-4e8c-9e9c-c1787afb42bf")}catch{}})();const Z=O(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(H())},onUpdateInviteFormLocalData:s=>{e(G({localData:s}))},onSubmitSuccess:()=>{n("../../")},onCancelClick:()=>{o!=null&&p.trackInviteEmailClicked("cancel")}}})(L),B=()=>{const e=R(),[t,n]=u.useState(!1),[o,s]=u.useState(!1),r=y(i=>z(i)),c=T(),S=V(),{useDynamicConfig:g}=j(),d=w.getSignedInUser();if(d==null)throw Error("Can't access invite referral screen without signing in...");const m=y(i=>C(i)),_=d?.firstName!=null?d.firstName:"User",{configValue:b}=g(h.zeniCardsConfig),{configValue:v}=g(h.zeniAccountsConfig),D=A(v);u.useEffect(()=>{e(k()),r?.rewardsLastViewedTime==null&&o===!1&&(e(Y()),s(!0))},[]),u.useEffect(()=>{t||m.fetchState!=="Not-Started"||(n(!0),e(q(!0)))},[m.fetchState,e]);const I=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[m.fetchState==="Completed"?a.jsx(E,{analytics:p,onLoad:i=>(N=>N.trackPageLoaded(F.Event.inviteEmailViewed))(i)}):null,a.jsx(Z,{navigate:c,location:S,currentTenant:r,companyName:I,userName:_,inviteFormCompayData:m.localData,chargeCardCashbackRatePerTransaction:b.charge_card_cashback_rate_per_transaction!=null?b.charge_card_cashback_rate_per_transaction:.0175,maxAnnualPercentageYield:D.maxAnnualPercentageYield})]})};function de(){const{useFeatureGate:e}=j(),{isFeatureEnabled:t}=e(P.isReferralFeatureEnabled);return a.jsxs(U,{children:[a.jsx(f,{path:"/",element:t?a.jsx(x,{}):a.jsx(l,{})}),a.jsx(f,{path:"how-it-works",element:t?a.jsx(x,{isReferralDrawerOpen:!0}):a.jsx(l,{})}),a.jsx(f,{path:"refer/*",element:t?a.jsx(B,{}):a.jsx(l,{})}),a.jsx(f,{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-6WcO8n0u.js","assets/sentry-CGkVgbup.js","assets/core-C_NeXleM.js","assets/zeni-epic-state-Dp14ovRw.js","assets/index-TZBFPhBM.js","assets/mui-CgjVMn8C.js","assets/analytics-BkhHPaQ4.js","assets/utils-CTLGOmjC.js","assets/withTransactionSidePanel-CsJoitfl.js","assets/useAskAiCfoHostNavButtonProps-BmhiW9nY.js","assets/useFetchSuggestedQuestionsWhenReady-CJ1dU4ni.js","assets/TransactionDetailScreen-Bh4hnUTb.js","assets/decodeURIComponentSafe-Drd7YS9D.js","assets/routePaths-fq-ods6n.js","assets/NotFoundScreen-D0cCxE_g.js","assets/analyticsHelper-DZ0CUT0b.js","assets/CompanyPassportScreen-C20zLwxY.js","assets/MobileAppDrawer-Czhowgsf.js","assets/FeaturePreviewScreen-C9zUUTCh.js","assets/ReferralListScreen-DRhEWofN.js","assets/index-D-vub4_t.css","assets/BillPayRoutes-DvR3hqif.js","assets/AddressScreen-wF2P11Cc.js","assets/DomesticWireDetailScreen-C51IXDOd.js","assets/useInitialThreadRequest-DYY0nYQq.js","assets/DrawerScreen-CV5-68Vp.js","assets/SetupPagesScreen-DeB97TrS.js","assets/BusinessVerificationPageScreen-Db_j23ph.js","assets/BillPayApprovalRoutes-Bm6O9E1C.js","assets/ReimbursementApprovalRuleDetailScreen-Doqr5IfY.js","assets/getLocaleForTenant-C75hRciY.js","assets/ReimbursementRoutes-B52nhenO.js","assets/ReimbursementApprovalRoutes-BaUI0RrG.js","assets/TransactionListRoutes-DLq7cUVK.js","assets/ZeniAccountStatementScreen-Da1Wlwqe.js","assets/SettingsRoutes-CbTsbTLb.js","assets/accountMappingHelper-CEUIWp7O.js","assets/ReportsRoutes-CNqyQ8jz.js","assets/ChargeCardRoutes-B2KJAodB.js","assets/PeopleRoutes-nhSxQuOd.js","assets/ExpenseAutomationRoutes-BCVBp8qi.js","assets/TreasuryRoutes-u5hb_BqK.js","assets/VendorsRoutes-DG-CUygJ.js","assets/pathToGoBack-BDpRzqvH.js","assets/ZeniAccountRoutes-CN91LxEE.js","assets/AddressRoutes-BQP-CfGZ.js","assets/PandLWithForecastRoutes-LRtjQJx_.js","assets/CustomerOnboardingRoutes-CnVH8vUK.js","assets/QBOConnectionScreen-ChkHB_5w.js","assets/empty-CDZc49VR.js","assets/index-Y_8J-EV-.js","assets/url-ax2xfQkc.js","assets/index-DEiuB93P.js","assets/TransactionDetailRoutes-CdhRrWAk.js","assets/EntityDetailRoutes-CWP-yEzD.js","assets/NotificationRoutes-C37yYJm9.js","assets/PerformanceRoutes-BU2_koAY.js","assets/RewardsRoutes-CqIupqR0.js","assets/TaskRoutes-BMFJJPYD.js","assets/TaskListScreen-b7SlqOLh.js","assets/AiCfoScreen-CILB5bBS.js"])))=>i.map(i=>d[i]);
2
+ import{_ as a,bm as os,eL as ls,eS as cs,eQ as ds,eR as ms,fC as us,eN as _s,cM as Ae,ct as As,f8 as Es,cl as ps,bB as Is,bp as gs,fd as xs,v as Ts,HW as hs,bu as js,HX as Us,bD as Hs,fa as Rs,bC as bs,br as Ds,cN as ys,HY as Cs,HZ as fs,cJ as vs,cL as Os,cK as Ps,cs as Fs,cy as Ls,m1 as Ee,eM as pe,H_ as Bs,fh as Ie,fH as ge,fI as xe,fi as ks}from"./zeni-epic-state-Dp14ovRw.js";import{j as e}from"./liveblocks-BCZSgQbG.js";import{a as v}from"./sentry-CGkVgbup.js";import{h as Vs,j as Ss,l as Ns,u as Ms,g as z,i as Te,N as c,n as Zs,o as t}from"./core-C_NeXleM.js";import{m as ws,u as zs,z as R,Z as Gs,a as $s,W as Ws,i as L,S as Ys,L as B,O as he,t as _,P as qs,c as X,l}from"./index-TZBFPhBM.js";import"./mui-CgjVMn8C.js";import{f as je}from"./analyticsHelper-DZ0CUT0b.js";import{t as Js}from"./getLocaleForTenant-C75hRciY.js";import"./recharts-NCr2Pwd1.js";import"./lottie-BdeQlKTG.js";import"./analytics-BkhHPaQ4.js";import"./plaid-B3UNGbGB.js";import"./dnd-C0SdDgY2.js";import"./stripe-DMRn4zHo.js";import"./lexical-B1vtLf4F.js";import"./pdf-CQPNphc4.js";import"./utils-CTLGOmjC.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]="455040bc-d065-45dd-8dac-a922d8e213da",i._sentryDebugIdIdentifier="sentry-dbid-455040bc-d065-45dd-8dac-a922d8e213da")}catch{}})();const Ks={dashboard:()=>a(()=>import("./DashboardRoutes-6WcO8n0u.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:()=>a(()=>import("./BillPayRoutes-DvR3hqif.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:()=>a(()=>import("./ReimbursementRoutes-B52nhenO.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:()=>a(()=>import("./TransactionListRoutes-DLq7cUVK.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,13,34,20])),settings:()=>a(()=>import("./SettingsRoutes-CbTsbTLb.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,22,14,15,27,13,16,28,29,32,20])),reports:()=>a(()=>import("./ReportsRoutes-CNqyQ8jz.js"),__vite__mapDeps([37,1,2,3,4,5,6,7,14,18,10,24,13,17,20])),chargeCards:()=>a(()=>import("./ChargeCardRoutes-B2KJAodB.js"),__vite__mapDeps([38,1,2,3,4,5,6,7,26,17,14,15,13,27,9,10,22,20])),people:()=>a(()=>import("./PeopleRoutes-nhSxQuOd.js"),__vite__mapDeps([39,1,2,3,4,5,6,7,14,9,10,17,20])),expenseAutomation:()=>a(()=>import("./ExpenseAutomationRoutes-BCVBp8qi.js"),__vite__mapDeps([40,1,2,3,14,4,5,6,7,9,10,11,12,13,8,36,25,20])),treasury:()=>a(()=>import("./TreasuryRoutes-u5hb_BqK.js"),__vite__mapDeps([41,1,2,3,4,5,6,7,14,26,17,15,13,27,9,10,18,20])),vendors:()=>a(()=>import("./VendorsRoutes-DG-CUygJ.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,22,14,18,13,43,9,10,17,25,36,20])),zeniAccounts:()=>a(()=>import("./ZeniAccountRoutes-CN91LxEE.js"),__vite__mapDeps([44,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(()=>a(()=>import("./ReportsRoutes-CNqyQ8jz.js"),__vite__mapDeps([37,1,2,3,4,5,6,7,14,18,10,24,13,17,20]))),ea=l(()=>a(()=>import("./AddressRoutes-BQP-CfGZ.js"),__vite__mapDeps([45,1,2,3,22,4,5,6,7,14,20]))),sa=l(()=>a(()=>import("./PeopleRoutes-nhSxQuOd.js"),__vite__mapDeps([39,1,2,3,4,5,6,7,14,9,10,17,20]))),aa=l(()=>a(()=>import("./PandLWithForecastRoutes-LRtjQJx_.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,14,18,9,10,24,13,17,20]))),na=l(()=>a(()=>import("./CustomerOnboardingRoutes-CnVH8vUK.js"),__vite__mapDeps([47,1,2,3,22,4,5,6,7,14,48,49,50,51,52,12,20]))),ta=l(()=>a(()=>import("./VendorsRoutes-DG-CUygJ.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,22,14,18,13,43,9,10,17,25,36,20]))),ia=l(()=>a(()=>import("./TransactionDetailRoutes-CdhRrWAk.js"),__vite__mapDeps([53,1,2,3,14,4,5,6,7,11,9,10,12,13,20]))),Ue=l(()=>a(()=>import("./EntityDetailRoutes-CWP-yEzD.js"),__vite__mapDeps([54,1,2,3,4,5,6,7,12,8,9,10,11,13,20]))),ra=l(()=>a(()=>import("./DashboardRoutes-6WcO8n0u.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]))),He=l(()=>a(()=>import("./BillPayRoutes-DvR3hqif.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]))),oa=l(()=>a(()=>import("./SettingsRoutes-CbTsbTLb.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,22,14,15,27,13,16,28,29,32,20]))),Re=l(()=>a(()=>import("./ReimbursementRoutes-B52nhenO.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]))),la=l(()=>a(()=>import("./ZeniAccountRoutes-CN91LxEE.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,14,26,17,15,13,27,18,23,22,9,10,34,20]))),ca=l(()=>a(()=>import("./TreasuryRoutes-u5hb_BqK.js"),__vite__mapDeps([41,1,2,3,4,5,6,7,14,26,17,15,13,27,9,10,18,20]))),da=l(()=>a(()=>import("./TransactionListRoutes-DLq7cUVK.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,13,34,20]))),ma=l(()=>a(()=>import("./ChargeCardRoutes-B2KJAodB.js"),__vite__mapDeps([38,1,2,3,4,5,6,7,26,17,14,15,13,27,9,10,22,20]))),ua=l(()=>a(()=>import("./NotificationRoutes-C37yYJm9.js"),__vite__mapDeps([55,1,2,3,14,4,5,6,7,9,10,20]))),_a=l(()=>a(()=>import("./PerformanceRoutes-BU2_koAY.js"),__vite__mapDeps([56,1,2,3,14,4,5,6,7,9,10,17,20]))),Aa=l(()=>a(()=>import("./ExpenseAutomationRoutes-BCVBp8qi.js"),__vite__mapDeps([40,1,2,3,14,4,5,6,7,9,10,11,12,13,8,36,25,20]))),Ea=l(()=>a(()=>import("./RewardsRoutes-CqIupqR0.js"),__vite__mapDeps([57,1,2,3,4,5,6,7,14,19,9,10,17,20]))),pa=l(()=>a(()=>import("./TaskRoutes-BMFJJPYD.js"),__vite__mapDeps([58,1,2,3,14,4,5,6,7,24,17,59,9,10,20]))),Ia=l(()=>a(()=>import("./AiCfoScreen-CILB5bBS.js"),__vite__mapDeps([60,1,2,3,4,5,6,7,43,20]))),y=l(()=>a(()=>import("./NotFoundScreen-D0cCxE_g.js"),__vite__mapDeps([14,1,2,3,4,5,6,7,20]))),ga=l(()=>a(()=>import("./TaskListScreen-b7SlqOLh.js"),__vite__mapDeps([59,1,2,3,4,5,6,7,9,10,17,20])));function Za({setTenantEmailDomain:i}){const U=Vs(),V=Ss(),{tenantEmailDomain:o}=Ns(),S=ws().mode,{setLoading:C,clearAllLoading:O,clearLoading:Z}=zs(),D=R.getSignedInUserTenant(o)?.tenantId,h=R.getSignedInUser(),J=os(h),G=Ms(),[N,De]=v.useState(!1),r=z(n=>ls(n)),{useFeatureGate:P}=Gs(),K=$s(),ye=Ws(),{isFeatureEnabled:Ce}=P(L.isExpenseAutomationEnabled),{isFeatureEnabled:fe}=P(L.isExpenseAutomationEnabledV2),ve=fe||Ce&&J,{isFeatureEnabled:Oe}=P(L.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Pe}=P(L.isTreasuryEnabled),{isFeatureEnabled:Fe}=P(L.isChargeCardFeatureEnabled),{isFeatureEnabled:se}=P(L.isDebitCardFeatureEnabled),j=z(n=>n.tenantState.fetchState),E=z(n=>n.tenantState.activeTenantFetchState.fetchState),u=E==="Completed"||j==="Completed"?cs(se,r):void 0,$=E==="Completed"||j==="Completed"?ds(r):void 0,Le=E==="Completed"||j==="Completed"?ms(r):void 0,Be=Fe||se||!!Le||!!$||!!u,{isFeatureEnabled:ke}=P(L.isSettingsFeatureEnabled),{isFeatureEnabled:Ve}=P(L.isAiCfoFileUploadEnabled),W=z(n=>us(n));if(o!=null){const n=R.getSignedInUserTenant(o);h!=null&&n!=null&&je(h,r,S)}const w={tenantId:D,userId:h?.userId,sessionId:h?.zeniSessionId},ae=_s(),A=Ys(),Se=r.company==null||A?.loggedInUserRoleMap!=null&&Ae(A.loggedInUserRole),Ne=As(A?.loggedInUserRoleMap),ne=v.useRef(!0),te=Te("/:tenantEmailDomain/onboarding/*")!==null,Q=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Me=z(n=>w.tenantId!=null?Es(n,w.tenantId):void 0);v.useEffect(()=>{C(B.TENANT_FETCHING),i(o)},[o]),v.useEffect(()=>{if(Q!=null&&D!=null){const n=Q.params.selectedPeriod;if(n!=null){const H=n.split("-");if(H.length===2){const d=ps(Number(H[0])),s=Number(H[1]),m=Is(`01-${d<10?`0${d}`:d}-${s}`,he.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),M=gs();m.isAfter(M,"month")===!1?U(xs(D,{month:d,year:s})):V("./month_end_close_checks/review")}}}},[Q,D]),v.useEffect(()=>{N||(De(!0),C(B.TENANT_FETCHING)),ne.current?ne.current=!1:!Ts(ae,w)&&R.isSignedIn()&&(C(B.TENANT_FETCHING),function(n,H,d,s){if(pe(H?.userId,H?.zeniSessionId,n.tenantId),d(Bs(!0)),d(Ie(n.tenantId)),n.tenantId!=null&&_.clearTenant(n.tenantId),n.tenantId!=null){const m=R.getSignedInUserTenantWithId(n.tenantId);s&&he.updateAppLocaleID(Js(s)),m?.tenantEmailDomain!=null&&R.saveActiveTenantDomainForUser(m?.tenantEmailDomain)}n.userId!=null?X.identify(n.userId,{tenant_id:n.tenantId}):X.resetUserIdentity()}(w,h,U,Me))},[w,ae,h,U,R]),v.useEffect(()=>{R.isSignedIn()&&(C(B.TENANT_FETCHING),function(n,H,d,s,m,M,k){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const Y=s!=null&&m?.zeniSessionId!=null,ts=d==null||d.tenantId!==s,is=d!=null&&d.excludedResources==null,rs=d!=null&&d.externalConnections==null;if(Y&&ts){k(Ie(s));const q=R.getSignedInUserTenantWithId(s);q?.tenantEmailDomain!=null&&R.saveActiveTenantDomainForUser(q?.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 Y&&is&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(ge(m.userId,s))),Y&&rs&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(xe(m.userId,s)));if(Y){X.identify(m.userId,{tenant_id:s});const q=s==null||s!=null&&(H==="Completed"||H==="Error");n==="Completed"||H!=="Not-Started"&&H!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),M(B.TENANT_FETCHING),k(ks(m.userId,s,m.zeniSessionId))),q&&(n==="Not-Started"||n==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),k(Ee(m.userId,m.zeniSessionId)))}}(j,E,r,D,h,C,U))},[D,E]),v.useEffect(()=>{R.isSignedIn()&&j==="Completed"&&W.tenantsBaseInOrder.length>0&&(Z(B.TENANT_FETCHING),R.saveSignedInUserTenants(hs(W.tenantsBaseInOrder)),h!=null&&je(h,r,S,void 0,W.tenantsBaseInOrder))},[W,j,r,h]),v.useEffect(()=>{E==="In-Progress"&&C(B.TENANT_FETCHING),E!=="Completed"&&E!=="Error"||(E==="Completed"&&D!=null?(O(),_.markActiveTenantFetchCompleted(D)):E==="Error"&&D!=null&&(_.markActiveTenantFetchFailed(D),Z(B.TENANT_FETCHING),Z(B.TENANT_SWITCHING))),j!=="Completed"&&j!=="Error"||(j==="Completed"?_.markAllTenantsFetchCompleted():j==="Error"&&_.markAllTenantsFetchFailed())},[E,j,D,N]);const ie=v.useRef(!1);v.useEffect(()=>{!ie.current&&E==="Completed"&&N&&(ie.current=!0,function(n=Qs,H=3e3){setTimeout(()=>{const d=s=>{if(s>=n.length)return;const m=n[s],M=Ks[m];M!=null?M().then(()=>ee(()=>d(s+1))).catch(()=>ee(()=>d(s+1))):d(s+1)};ee(()=>d(0))},H)}())},[E,N]);const f=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&&Ae(r.userRole),re=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!f,oe=Be&&!f,Ge=Us(A?.loggedInUserRoleMap),$e=r.externalConnections?.accounting[0]?.isValid,le=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!f,de=ce&&Hs(A?.loggedInUserRoleMap),me=Oe&&!f,We=r.company!=null&&Rs(r.company),Ye=Pe&&We===!0&&!f,qe=re&&bs(A?.loggedInUserRoleMap),Je=oe&&Ds(A?.loggedInUserRoleMap),Ke=me&&ys(A?.loggedInUserRoleMap),Qe=Cs(A?.loggedInUserRoleMap),Xe=fs(A?.loggedInUserRoleMap),p=vs(A?.loggedInUserRoleMap),I=Os(A?.loggedInUserRoleMap),g=Ps(A?.loggedInUserRoleMap),x=Fs(A?.loggedInUserRoleMap),T=Ls(A?.loggedInUserRoleMap),ue=re&&x,_e=ce&&T,es=me&&p,ss=Ye&&I,as=oe&&g,ns=r.excludedResources?.resources?.find(n=>n.resource==="/invites")!=null||Ne===!0||Ge===!0||Qe===!0||Xe===!0;return R.isSignedIn()?D==null?j==="Completed"?e.jsx(c,{to:"/",replace:!0,state:{...G.state,message:"...",origin:G.pathname}}):(h!=null&&j!=="In-Progress"&&U(Ee(h.userId,h.zeniSessionId)),null):E!=="In-Progress"&&E!=="Not-Started"||j==="Completed"?(le===!0||J&&!te)&&$e===!1&&u===!1&&$===!1?(i(void 0),e.jsx(c,{to:"/connection/auth",replace:!0})):!N||le!==!1||te||J?N&&r?.userRole&&u!=null&&$!=null&&o!=null&&Object.keys(A.loggedInUserRoleMap).length>0?e.jsx(Zs,{children:e.jsxs(t,{element:e.jsx(qs,{}),children:[e.jsx(t,{path:"/",element:e.jsx(xa,{isDashboardAccess:F,isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,isTenantCardsOnly:$})}),e.jsx(t,{path:"dashboard/*",element:F?e.jsx(ra,{}):e.jsx(b,{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(b,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"people/*",element:ns||F?e.jsx(sa,{}):e.jsx(b,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"forecast/*",element:F?e.jsx(aa,{}):e.jsx(b,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"onboarding/*",element:e.jsx(na,{})}),e.jsx(t,{path:"transaction/*",element:F&&f===!1||we||ze?e.jsx(ia,{}):e.jsx(b,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"transactions/*",element:F&&f===!1?e.jsx(da,{}):e.jsx(b,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"customer/*",element:F&&f===!1?e.jsx(Ue,{entityType:"customer"}):e.jsx(b,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isTenantBankingOnly:u,isUserHasTreasuryAccess:I,tenantEmailDomain:o})}),e.jsx(t,{path:"vendor/*",element:F&&f===!1?e.jsx(Ue,{entityType:"vendor"}):e.jsx(b,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"tasks",element:e.jsx(ga,{})}),e.jsx(t,{path:"tasks/*",element:e.jsx(pa,{})}),e.jsx(t,{path:"address/*",element:qe||de||Ke||Je?e.jsx(ea,{}):e.jsx(b,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"checking/*",element:es?e.jsx(la,{}):e.jsx(y,{})}),e.jsx(t,{path:"treasury/*",element:ss?e.jsx(ca,{}):e.jsx(y,{})}),e.jsx(t,{path:"performance",element:ye?e.jsx(_a,{}):e.jsx(be,{tenantEmailDomain:o})}),e.jsx(t,{path:"month_end_close_checks/review/*",element:ve&&f===!1?e.jsx(Aa,{}):e.jsx(be,{tenantEmailDomain:o})}),e.jsx(t,{path:"notifications/*",element:e.jsx(ua,{})}),e.jsx(t,{path:"vendors/*",element:Se?e.jsx(ta,{}):e.jsx(y,{})}),e.jsx(t,{path:"bill/*",element:ue?e.jsx(He,{}):e.jsx(b,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"bills/*",element:ue?e.jsx(He,{}):e.jsx(b,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursement/*",element:_e?e.jsx(Re,{}):e.jsx(b,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursements/*",element:_e?e.jsx(Re,{}):e.jsx(b,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"settings/*",element:ke?e.jsx(oa,{hasAdminLevelAccess:de}):e.jsx(y,{})}),e.jsx(t,{path:"cards/*",element:as?e.jsx(ma,{}):e.jsx(y,{})}),e.jsx(t,{path:"rewards/*",element:Ze?e.jsx(Ea,{}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo",element:K?e.jsx(c,{to:"explore"}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo/",element:K?e.jsx(c,{to:"explore"}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo/:session_id",element:K?e.jsx(Ia,{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 xa=({isDashboardAccess:i,isUserHasZeniAccountsAccess:U,isUserHasChargeCardAccess:V,isUserHasBillPayAccess:o,isUserHasReimbursementAccess:S,isUserHasTreasuryAccess:C,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"}):C?e.jsx(c,{to:"treasury"}):V?e.jsx(c,{to:"cards"}):o?e.jsx(c,{to:"bills"}):S?e.jsx(c,{to:"reimbursements"}):e.jsx(c,{to:"dashboard"}),b=({isUserHasZeniAccountsAccess:i,isUserHasChargeCardAccess:U,isUserHasBillPayAccess:V,isUserHasReimbursementAccess:o,isUserHasTreasuryAccess:S,isTenantBankingOnly:C,tenantEmailDomain:O})=>C===!0||i?e.jsx(Ua,{tenantEmailDomain:O}):S?e.jsx(ja,{tenantEmailDomain:O}):U?e.jsx(Ha,{tenantEmailDomain:O}):V?e.jsx(ha,{tenantEmailDomain:O}):o?e.jsx(Ta,{tenantEmailDomain:O}):e.jsx(y,{}),Ta=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/reimbursements`}),ha=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/bills`}),ja=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/treasury`}),Ua=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/checking`}),Ha=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/cards`}),be=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/dashboard`});export{b as FallBackRoute,Za as default};
@@ -1,4 +1,4 @@
1
- import{j as t}from"./liveblocks-CVGPqYnR.js";import{a as u}from"./sentry-vrLJXbkU.js";import{j as T,u as R,h as P,g as m,k as _,l as V,n as H,o as C}from"./core-B4ZvHvvY.js";import{bm as ye,eL as k,gp as ie,JT as Ie,j6 as ce,lp as Ce,gr as xe,JV as Ae,JU as Ee,Mi as je,wG as ke,B9 as we,LT as Pe,M0 as ve,b$ as le,cD as Me,cE as De,I7 as Ue,Mj as Te,I8 as Fe,v6 as Re,Mk as _e,Dp as Ve,AR as Be,AI as re,AF as Le,va as de,AL as ue,AO as pe,AU as X,rO as Y,v9 as Oe,iK as W,iN as ge,Ml as Ne,jO as $e,vp as ze,IO as Ge,IP as Ze,iI as Ke,Mm as Je,iL as qe,Mn as Qe,vm as He,Mo as We,Mp as Xe,B6 as Ye,eQ as me,eS as fe,Mq as en,fv as nn,Ij as tn,vl as te,fA as ae,fz as an,vk as sn,fy as on,fx as cn,Mr as ln,eV as he,Ms as rn,Mt as dn,vs as un,vj as se,Mu as pn,fc as gn,vg as mn,bS as fn,b_ as hn,bZ as bn,bT as Sn,bX as yn,bW as In,bV as Cn,bY as xn,bU as An}from"./zeni-epic-state-Da4VO2lv.js";import{Z as ee,i as D,z as x,aa as be,bx as En,c as z,e as jn,S as B,B as ne,by as kn,bz as wn,al as Pn,h as Se,bA as vn,bB as Mn,bC as Dn,a4 as Un,M as Tn,bD as Fn,q as Rn,bE as _n}from"./index-DgzG0i4n.js";import{n as U}from"./mui-DoY7WfR_.js";import{M as v}from"./MobileAppDrawer-eCdBXSxf.js";import{a as N,g as $,m as Vn}from"./accountMappingHelper-GgTLtZGv.js";import{t as Bn,A as Ln}from"./AddressScreen-B-90Ns9M.js";import F from"./NotFoundScreen-jPpbDlQd.js";import{g as On}from"./analyticsHelper-B-IDLpaZ.js";import{B as Nn}from"./BusinessVerificationPageScreen-B8mXcNLy.js";import{C as $n}from"./CompanyPassportScreen-BCPm2c8T.js";import{B as zn}from"./BillPayApprovalRoutes-BeaWY9ga.js";import{R as Gn}from"./ReimbursementApprovalRoutes-DdJz0p5l.js";import"./recharts-DNFnaP_v.js";import"./lottie-B5aSI3Li.js";import"./analytics-BL0geQNn.js";import"./plaid-C1RHGEem.js";import"./dnd-B2_m6pRT.js";import"./stripe-DMRn4zHo.js";import"./lexical-DA5yMmPj.js";import"./pdf-ChIJqwGf.js";import"./utils-QMlevttK.js";import"./routePaths-WhbiYSxu.js";import"./ReimbursementApprovalRuleDetailScreen-BVKZCEAO.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]="5ac58da5-0d96-4880-bd19-5115e0cda99a",e._sentryDebugIdIdentifier="sentry-dbid-5ac58da5-0d96-4880-bd19-5115e0cda99a")}catch{}})();const Zn=U.div`
1
+ import{j as t}from"./liveblocks-BCZSgQbG.js";import{a as u}from"./sentry-CGkVgbup.js";import{j as T,u as R,h as P,g as m,k as _,l as V,n as H,o as C}from"./core-C_NeXleM.js";import{bm as ye,eL as j,gp as ie,JT as Ie,j6 as ce,lp as Ce,gr as xe,JV as Ae,JU as Ee,Mi as ke,wG as je,B9 as we,LT as Pe,M0 as ve,b$ as le,cD as Me,cE as De,I7 as Ue,Mj as Te,I8 as Fe,v6 as Re,Mk as _e,Dp as Ve,AR as Be,AI as re,AF as Le,va as de,AL as ue,AO as pe,AU as X,rO as Y,v9 as Oe,iK as W,iN as ge,Ml as Ne,jO as $e,vp as ze,IO as Ge,IP as Ze,iI as Ke,Mm as Je,iL as Qe,Mn as qe,vm as He,Mo as We,Mp as Xe,B6 as Ye,eQ as me,eS as fe,Mq as en,fv as nn,Ij as tn,vl as te,fA as ae,fz as an,vk as sn,fy as on,fx as cn,Mr as ln,eV as he,Ms as rn,Mt as dn,vs as un,vj as se,Mu as pn,fc as gn,vg as mn,bS as fn,b_ as hn,bZ as bn,bT as Sn,bX as yn,bW as In,bV as Cn,bY as xn,bU as An}from"./zeni-epic-state-Dp14ovRw.js";import{Z as ee,i as D,z as x,aa as be,bx as En,c as z,e as kn,S as B,B as ne,by as jn,bz as wn,al as Pn,h as Se,bA as vn,bB as Mn,bC as Dn,a4 as Un,E as Tn,bD as Fn,k as Rn,bE as _n}from"./index-TZBFPhBM.js";import{n as U}from"./mui-CgjVMn8C.js";import{M as v}from"./MobileAppDrawer-Czhowgsf.js";import{a as N,g as $,m as Vn}from"./accountMappingHelper-CEUIWp7O.js";import{t as Bn,A as Ln}from"./AddressScreen-wF2P11Cc.js";import F from"./NotFoundScreen-D0cCxE_g.js";import{g as On}from"./analyticsHelper-DZ0CUT0b.js";import{B as Nn}from"./BusinessVerificationPageScreen-Db_j23ph.js";import{C as $n}from"./CompanyPassportScreen-C20zLwxY.js";import{B as zn}from"./BillPayApprovalRoutes-Bm6O9E1C.js";import{R as Gn}from"./ReimbursementApprovalRoutes-BaUI0RrG.js";import"./recharts-NCr2Pwd1.js";import"./lottie-BdeQlKTG.js";import"./analytics-BkhHPaQ4.js";import"./plaid-B3UNGbGB.js";import"./dnd-C0SdDgY2.js";import"./stripe-DMRn4zHo.js";import"./lexical-B1vtLf4F.js";import"./pdf-CQPNphc4.js";import"./utils-CTLGOmjC.js";import"./routePaths-fq-ods6n.js";import"./ReimbursementApprovalRuleDetailScreen-Doqr5IfY.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]="5695de32-3dd7-4d4f-95aa-e76e9dd410cb",e._sentryDebugIdIdentifier="sentry-dbid-5695de32-3dd7-4d4f-95aa-e76e9dd410cb")}catch{}})();const Zn=U.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -6,7 +6,7 @@ import{j as t}from"./liveblocks-CVGPqYnR.js";import{a as u}from"./sentry-vrLJXbk
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,Kn=_(function(e,a){return{accountMappingView:a.accountMappingView,isFiling1099FeatureEnabled:a.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:a.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:ce(e),isAccountingClassesUpdateInProgress:e.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(e,a){const{navigate:o,location:c,isFiling1099FeatureEnabled:i}=a;return{onAccountMappingChange:n=>{const{uncategorizedAccountSection:s,billsAccountSection:l,reimbursementsAccountSection:p,vendorsAccountSection:d,filing1099Section:f}=n,{incomeAccount:g,expenseAccount:S}=s,{billPayAccount:r}=l,{reimbursementsAccount:A}=p,{prepaidExpensesAccount:y,fixedAssetsAccount:j,accruedExpensesAccount:b}=d,{bankAccount:I,expenseCategory1099:L}=f,E=N(a.accountMappingView.incomeAccountList,g.selectedOption),G=N(a.accountMappingView.expenseAccountList,S.selectedOption),Z=N(a.accountMappingView.billPayAccountList,r.selectedOption),K=N(a.accountMappingView.reimbursementsAccountList,A.selectedOption),O=$(a.accountMappingView.prepaidExpensesAccountList,y.selectedOptions),h=$(a.accountMappingView.fixedAssetsAccountList,j.selectedOptions),M=$(a.accountMappingView.accruedExpensesAccountList,b.selectedOptions),J=$(a.accountMappingView.bankAccounts1099FilingAccountList,I.selectedOptions),q=Vn(a.accountMappingView.expenseAccounts1099FilingAccountList,L),Q={selectedIncomeAccountId:E?.accountId,selectedExpenseAccountId:G?.accountId,selectedBillPayAccountId:Z?.accountId,selectedReimbursementsAccountId:K?.accountId,selectedPrepaidExpensesAccountIds:O.map(w=>w.accountId),selectedFixedAssetsAccountIds:h.map(w=>w.accountId),selectedAccruedExpensesAccountIds:M.map(w=>w.accountId),selectedBankAccounts1099FilingAccountIds:J.map(w=>w.accountId),selectedExpenseAccounts1099FilingAccountIds:q};e(Ee({data:Q}))},onBackClick:()=>{be(c)===!1?(o("../../dashboard"),e(Ae())):e(ie())},onSaveClick:()=>{e(xe()),i&&z.track(jn.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:n=>{e(Ce(a.currentTenant.companyId,n))}}})(En),Jn=()=>{const e=T(),a=R(),o=P(),{useFeatureGate:c}=ee(),{isFeatureEnabled:i}=c(D.isFiling1099FeatureEnabled),{isFeatureEnabled:n}=c(D.isScheduledJEAccruedExpensesFeatureEnabled),s=x.getSignedInUser(),l=ye(s),p=m(y=>k(y)),[d,f]=u.useState(!1),[g,S]=u.useState(!1);u.useEffect(()=>{d===!1&&(o(ie()),f(!0))},[d]);const r=m(y=>Ie(y)),A=y=>{S(y)};return t.jsxs(Zn,{children:[t.jsx(v,{isAppContentDrawerOpen:g,handleDrawerToggle:A}),t.jsx(Kn,{currentTenant:p,navigate:e,accountMappingView:r,isFiling1099FeatureEnabled:i&&l,isAccruedExpensesFeatureEnabled:n,location:a,isSettings:be(a),onClickMenuIcon:()=>A(!0)})]})},qn=U.div`
9
+ `,Kn=_(function(e,a){return{accountMappingView:a.accountMappingView,isFiling1099FeatureEnabled:a.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:a.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:ce(e),isAccountingClassesUpdateInProgress:e.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(e,a){const{navigate:o,location:c,isFiling1099FeatureEnabled:i}=a;return{onAccountMappingChange:n=>{const{uncategorizedAccountSection:s,billsAccountSection:l,reimbursementsAccountSection:p,vendorsAccountSection:d,filing1099Section:f}=n,{incomeAccount:g,expenseAccount:S}=s,{billPayAccount:r}=l,{reimbursementsAccount:A}=p,{prepaidExpensesAccount:y,fixedAssetsAccount:k,accruedExpensesAccount:b}=d,{bankAccount:I,expenseCategory1099:L}=f,E=N(a.accountMappingView.incomeAccountList,g.selectedOption),G=N(a.accountMappingView.expenseAccountList,S.selectedOption),Z=N(a.accountMappingView.billPayAccountList,r.selectedOption),K=N(a.accountMappingView.reimbursementsAccountList,A.selectedOption),O=$(a.accountMappingView.prepaidExpensesAccountList,y.selectedOptions),h=$(a.accountMappingView.fixedAssetsAccountList,k.selectedOptions),M=$(a.accountMappingView.accruedExpensesAccountList,b.selectedOptions),J=$(a.accountMappingView.bankAccounts1099FilingAccountList,I.selectedOptions),Q=Vn(a.accountMappingView.expenseAccounts1099FilingAccountList,L),q={selectedIncomeAccountId:E?.accountId,selectedExpenseAccountId:G?.accountId,selectedBillPayAccountId:Z?.accountId,selectedReimbursementsAccountId:K?.accountId,selectedPrepaidExpensesAccountIds:O.map(w=>w.accountId),selectedFixedAssetsAccountIds:h.map(w=>w.accountId),selectedAccruedExpensesAccountIds:M.map(w=>w.accountId),selectedBankAccounts1099FilingAccountIds:J.map(w=>w.accountId),selectedExpenseAccounts1099FilingAccountIds:Q};e(Ee({data:q}))},onBackClick:()=>{be(c)===!1?(o("../../dashboard"),e(Ae())):e(ie())},onSaveClick:()=>{e(xe()),i&&z.track(kn.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:n=>{e(Ce(a.currentTenant.companyId,n))}}})(En),Jn=()=>{const e=T(),a=R(),o=P(),{useFeatureGate:c}=ee(),{isFeatureEnabled:i}=c(D.isFiling1099FeatureEnabled),{isFeatureEnabled:n}=c(D.isScheduledJEAccruedExpensesFeatureEnabled),s=x.getSignedInUser(),l=ye(s),p=m(y=>j(y)),[d,f]=u.useState(!1),[g,S]=u.useState(!1);u.useEffect(()=>{d===!1&&(o(ie()),f(!0))},[d]);const r=m(y=>Ie(y)),A=y=>{S(y)};return t.jsxs(Zn,{children:[t.jsx(v,{isAppContentDrawerOpen:g,handleDrawerToggle:A}),t.jsx(Kn,{currentTenant:p,navigate:e,accountMappingView:r,isFiling1099FeatureEnabled:i&&l,isAccruedExpensesFeatureEnabled:n,location:a,isSettings:be(a),onClickMenuIcon:()=>A(!0)})]})},Qn=U.div`
10
10
  display: flex;
11
11
  height: 100%;
12
12
  width: 100%;
@@ -14,7 +14,7 @@ import{j as t}from"./liveblocks-CVGPqYnR.js";import{a as u}from"./sentry-vrLJXbk
14
14
  flex-direction: column;
15
15
  align-items: center;
16
16
  background-color: ${e=>e.theme.colors.grey4};
17
- `,Qn=_(function(e,a){const o=k(e),c=Pe(e),i=ve(e),n=a.roleMap.bill_pay_admin;return{isDisabled:(le(o?.userRole??[])||n)&&"readonly",billpayApprovalView:c,remiApproverView:i,analytics:z}},function(e,a){const{navigate:o,currentTenant:c}=a;return{onSetupApprovalRulesBillPaySectionClick:()=>{o("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{o("reimbursements/approval-rules")},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}})(kn),Hn=()=>{const e=T(),a=R(),o=P(),{tenantEmailDomain:c}=V(),[i,n]=u.useState(!1),[s,l]=u.useState(!1),[p,d]=u.useState(!1),f=m(b=>k(b)),g=m(b=>b.billPaySetupApproverViewState.fetchState),S=m(b=>b.remiSetupApproverViewState.fetchState),r=m(b=>je(b)),A=f.companyId??x.getSignedInUserTenant(c)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const y=B();u.useEffect(()=>{p||g!=="Not-Started"||(d(!0),o(ke(!0)))},[p,g,o]),u.useEffect(()=>{s||S!=="Not-Started"||(l(!0),o(we(!0)))},[s,S,o]);const j=b=>{n(b)};return y?.loggedInUserRoleMap!=null?t.jsxs(qn,{children:[t.jsx(v,{isAppContentDrawerOpen:i,handleDrawerToggle:j}),t.jsx(Qn,{navigate:e,location:a,companyId:A,currentTenant:f,roleMap:y.loggedInUserRoleMap,onClickMenuIcon:()=>{j(!0)}})]}):t.jsx(ne,{fetchState:r.fetchState})},Wn=U.div`
17
+ `,qn=_(function(e,a){const o=j(e),c=Pe(e),i=ve(e),n=a.roleMap.bill_pay_admin;return{isDisabled:(le(o?.userRole??[])||n)&&"readonly",billpayApprovalView:c,remiApproverView:i,analytics:z}},function(e,a){const{navigate:o,currentTenant:c}=a;return{onSetupApprovalRulesBillPaySectionClick:()=>{o("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{o("reimbursements/approval-rules")},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}})(jn),Hn=()=>{const e=T(),a=R(),o=P(),{tenantEmailDomain:c}=V(),[i,n]=u.useState(!1),[s,l]=u.useState(!1),[p,d]=u.useState(!1),f=m(b=>j(b)),g=m(b=>b.billPaySetupApproverViewState.fetchState),S=m(b=>b.remiSetupApproverViewState.fetchState),r=m(b=>ke(b)),A=f.companyId??x.getSignedInUserTenant(c)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const y=B();u.useEffect(()=>{p||g!=="Not-Started"||(d(!0),o(je(!0)))},[p,g,o]),u.useEffect(()=>{s||S!=="Not-Started"||(l(!0),o(we(!0)))},[s,S,o]);const k=b=>{n(b)};return y?.loggedInUserRoleMap!=null?t.jsxs(Qn,{children:[t.jsx(v,{isAppContentDrawerOpen:i,handleDrawerToggle:k}),t.jsx(qn,{navigate:e,location:a,companyId:A,currentTenant:f,roleMap:y.loggedInUserRoleMap,onClickMenuIcon:()=>{k(!0)}})]}):t.jsx(ne,{fetchState:r.fetchState})},Wn=U.div`
18
18
  display: flex;
19
19
  height: 100%;
20
20
  width: 100%;
@@ -22,7 +22,7 @@ import{j as t}from"./liveblocks-CVGPqYnR.js";import{a as u}from"./sentry-vrLJXbk
22
22
  flex-direction: column;
23
23
  align-items: center;
24
24
  background-color: ${e=>e.theme.colors.grey4};
25
- `,Xn=_(function(e,a){const{companyId:o,isZeniAccountEnabled:c,isChargeCardEnabled:i,isBillPayEnabled:n,isRemiEnabled:s,isTreasuryEnabled:l}=a,p=k(e);return{bankSetupView:_e(e,o,n,s,c,i,l),connectedAccountProvider:p.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:z}},function(e,a){const{navigate:o,currentTenant:c,companyId:i}=a;return{onFetchLinkTokenClick:(n,s,l)=>{e(Y(s,n,l))},onEstablishConnectionClick:(n,s,l)=>{e(X(n,i,s,l))},onUpdatePaymentAccountStatus:(n,s,l,p,d)=>{e(pe(n,s,d,p,l))},onUpdatePaymentAccountLoginStatus:(n,s,l,p)=>{e(ue(!1,n,p,l,s))},onEstablishConnectionSuccess:(n,s)=>{e(de(s,n))},onUpdateAccountClick:(n,s,l,p,d)=>{e(d==="paymentAccount"?re(n,s,l,p):Le(p,n,s))},onUpdatePrimaryFundingAccount:(n,s,l)=>{e(Be(i,s,n,l))},onRemoveConnection:n=>{e(Ve(n))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}})(wn),Yn=()=>{const e=T(),a=R(),o=P(),{tenantEmailDomain:c}=V(),i=B(),[n,s]=u.useState(!1),[l,p]=u.useState(!1),d=m(I=>k(I)),f=m(I=>I.settingsViewState.bankConnection.fetchState),g=Me(d,i?.loggedInUserRoleMap),S=De(d,i?.loggedInUserRoleMap),r=Ue(d,i?.loggedInUserRoleMap),A=Te(d,i?.loggedInUserRoleMap),y=Fe(d,i?.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(()=>{l||f==="Completed"||(p(!0),o(Re(!1)))},[l,o,f]);const b=I=>{s(I)};return g||r||S||y?t.jsxs(Wn,{children:[t.jsx(v,{isAppContentDrawerOpen:n,handleDrawerToggle:b}),t.jsx(Xn,{navigate:e,location:a,companyId:j,currentTenant:d,roleMap:i.loggedInUserRoleMap,isBillPayEnabled:g,isRemiEnabled:S,isZeniAccountEnabled:r,isChargeCardEnabled:y,isTreasuryEnabled:A,onClickMenuIcon:()=>{b(!0)}})]}):t.jsx(F,{})},et=U.div`
25
+ `,Xn=_(function(e,a){const{companyId:o,isZeniAccountEnabled:c,isChargeCardEnabled:i,isBillPayEnabled:n,isRemiEnabled:s,isTreasuryEnabled:l}=a,p=j(e);return{bankSetupView:_e(e,o,n,s,c,i,l),connectedAccountProvider:p.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:z}},function(e,a){const{navigate:o,currentTenant:c,companyId:i}=a;return{onFetchLinkTokenClick:(n,s,l)=>{e(Y(s,n,l))},onEstablishConnectionClick:(n,s,l)=>{e(X(n,i,s,l))},onUpdatePaymentAccountStatus:(n,s,l,p,d)=>{e(pe(n,s,d,p,l))},onUpdatePaymentAccountLoginStatus:(n,s,l,p)=>{e(ue(!1,n,p,l,s))},onEstablishConnectionSuccess:(n,s)=>{e(de(s,n))},onUpdateAccountClick:(n,s,l,p,d)=>{e(d==="paymentAccount"?re(n,s,l,p):Le(p,n,s))},onUpdatePrimaryFundingAccount:(n,s,l)=>{e(Be(i,s,n,l))},onRemoveConnection:n=>{e(Ve(n))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}})(wn),Yn=()=>{const e=T(),a=R(),o=P(),{tenantEmailDomain:c}=V(),i=B(),[n,s]=u.useState(!1),[l,p]=u.useState(!1),d=m(I=>j(I)),f=m(I=>I.settingsViewState.bankConnection.fetchState),g=Me(d,i?.loggedInUserRoleMap),S=De(d,i?.loggedInUserRoleMap),r=Ue(d,i?.loggedInUserRoleMap),A=Te(d,i?.loggedInUserRoleMap),y=Fe(d,i?.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(()=>{l||f==="Completed"||(p(!0),o(Re(!1)))},[l,o,f]);const b=I=>{s(I)};return g||r||S||y?t.jsxs(Wn,{children:[t.jsx(v,{isAppContentDrawerOpen:n,handleDrawerToggle:b}),t.jsx(Xn,{navigate:e,location:a,companyId:k,currentTenant:d,roleMap:i.loggedInUserRoleMap,isBillPayEnabled:g,isRemiEnabled:S,isZeniAccountEnabled:r,isChargeCardEnabled:y,isTreasuryEnabled:A,onClickMenuIcon:()=>{b(!0)}})]}):t.jsx(F,{})},et=U.div`
26
26
  display: flex;
27
27
  height: 100%;
28
28
  width: 100%;
@@ -30,7 +30,7 @@ import{j as t}from"./liveblocks-CVGPqYnR.js";import{a as u}from"./sentry-vrLJXbk
30
30
  flex-direction: column;
31
31
  align-items: center;
32
32
  background-color: ${e=>e.theme.colors.grey4};
33
- `,nt=_(function(e,a){const{companyId:o}=a,c=k(e),i=a.roleMap.bill_pay_admin,n=Ne(e,o),{uiState:s}=n,l=(le(c?.userRole??[])||i)&&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:Se.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:l,analytics:z}},function(e,a){const{navigate:o,currentTenant:c,companyId:i}=a;return{onFetchLinkTokenClick:(n,s)=>{e(Y("billing_setup",n,s))},onEstablishConnectionClick:n=>{e(X(n,i,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(de("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,s,l)=>{e(pe(n,s,"billing","billing_setup",l))},onUpdatePaymentAccountLoginStatus:(n,s)=>{e(ue(!1,n,"billing","billing_setup",s))},onUpdateAccountClick:(n,s)=>{e(re(n,s,"billing","billing_setup"))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")},handleCreateCardSetupIntent:n=>{e(ge(n))},handleConfirmCardSetupIntent:n=>{e(qe(n))},updateCardPaymentModalState:n=>{e(Je({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,s,l)=>{e(Ke(n,s,l))},handleFetchPaymentSources:()=>{e(W())},resetCardPaymentViewState:()=>{e(Ze())},handleResetCardPaymentErrorStatuses:()=>{e(Ge())},onBillingAddressSave:n=>{e(ze(n))},onAddressEditHandler:n=>{if(n!=null){const s=Bn(n);e($e({addressType:"subscription_billing_address",addressToCreate:s}))}}}})(vn),tt=()=>{const e=T(),a=R(),o=P(),{tenantEmailDomain:c}=V(),[i,n]=u.useState(!1),[s,l]=u.useState(!1),[p,d]=u.useState(!1),f=m(I=>k(I)),g=m(I=>I.cardPaymentViewState),S=m(I=>I.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState),r=Pn(g.addCardPaymentSourceStatus.fetchState),A=g.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=B();u.useEffect(()=>{y!=null&&o(Oe(y,!1))},[y,o]),u.useEffect(()=>{s||(l(!0),o(W()))},[s,o]),u.useEffect(()=>{p||(ge(["card"]),d(!0))},[p]),u.useEffect(()=>{r==="In-Progress"&&A==="Completed"&&o(W())},[r,A]);const b=I=>{n(I)};return j?.loggedInUserRoleMap!=null?t.jsxs(et,{children:[t.jsx(v,{isAppContentDrawerOpen:i,handleDrawerToggle:b}),t.jsx(nt,{navigate:e,location:a,companyId:y,currentTenant:f,roleMap:j.loggedInUserRoleMap,onClickMenuIcon:()=>{b(!0)},googleAPIKey:Se.googleMapsAPIKey})]}):t.jsx(ne,{fetchState:S})},at=_(function(){return{meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(e,a){const{navigate:o,integrationsView:c}=a;return{onBackClick:()=>{o("../")},onNavigateToDashboard:()=>{o("../dashboard")},onRefreshClick:()=>{c.integrations.refreshQBO.fetchState!=="In-Progress"&&e(He())}}})(Mn),st=()=>{const e=T(),{tenantEmailDomain:a}=V(),[o,c]=u.useState(!1),i=m(g=>g.tenantState.fetchState),n=m(g=>k(g)).companyId??x.getSignedInUserTenant(a)?.companyId,s=x.getSignedInUser(),l=B(),p=l?.loggedInUserRole.includes("admin")===!0;if(s==null)throw Error("Can't access Integrations page without signing in...");const d=g=>{c(g)},f=m(g=>Qe(g,n));return l?.loggedInUserRoleMap!=null?t.jsxs(ot,{children:[t.jsx(v,{isAppContentDrawerOpen:o,handleDrawerToggle:d}),t.jsx(at,{navigate:e,onClickMenuIcon:()=>{d(!0)},isAdmin:p,integrationsView:f,isLoading:i==="In-Progress"})]}):t.jsx(ne,{fetchState:i})},ot=U.div`
33
+ `,nt=_(function(e,a){const{companyId:o}=a,c=j(e),i=a.roleMap.bill_pay_admin,n=Ne(e,o),{uiState:s}=n,l=(le(c?.userRole??[])||i)&&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:Se.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:l,analytics:z}},function(e,a){const{navigate:o,currentTenant:c,companyId:i}=a;return{onFetchLinkTokenClick:(n,s)=>{e(Y("billing_setup",n,s))},onEstablishConnectionClick:n=>{e(X(n,i,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(de("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,s,l)=>{e(pe(n,s,"billing","billing_setup",l))},onUpdatePaymentAccountLoginStatus:(n,s)=>{e(ue(!1,n,"billing","billing_setup",s))},onUpdateAccountClick:(n,s)=>{e(re(n,s,"billing","billing_setup"))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")},handleCreateCardSetupIntent:n=>{e(ge(n))},handleConfirmCardSetupIntent:n=>{e(Qe(n))},updateCardPaymentModalState:n=>{e(Je({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,s,l)=>{e(Ke(n,s,l))},handleFetchPaymentSources:()=>{e(W())},resetCardPaymentViewState:()=>{e(Ze())},handleResetCardPaymentErrorStatuses:()=>{e(Ge())},onBillingAddressSave:n=>{e(ze(n))},onAddressEditHandler:n=>{if(n!=null){const s=Bn(n);e($e({addressType:"subscription_billing_address",addressToCreate:s}))}}}})(vn),tt=()=>{const e=T(),a=R(),o=P(),{tenantEmailDomain:c}=V(),[i,n]=u.useState(!1),[s,l]=u.useState(!1),[p,d]=u.useState(!1),f=m(I=>j(I)),g=m(I=>I.cardPaymentViewState),S=m(I=>I.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState),r=Pn(g.addCardPaymentSourceStatus.fetchState),A=g.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=B();u.useEffect(()=>{y!=null&&o(Oe(y,!1))},[y,o]),u.useEffect(()=>{s||(l(!0),o(W()))},[s,o]),u.useEffect(()=>{p||(ge(["card"]),d(!0))},[p]),u.useEffect(()=>{r==="In-Progress"&&A==="Completed"&&o(W())},[r,A]);const b=I=>{n(I)};return k?.loggedInUserRoleMap!=null?t.jsxs(et,{children:[t.jsx(v,{isAppContentDrawerOpen:i,handleDrawerToggle:b}),t.jsx(nt,{navigate:e,location:a,companyId:y,currentTenant:f,roleMap:k.loggedInUserRoleMap,onClickMenuIcon:()=>{b(!0)},googleAPIKey:Se.googleMapsAPIKey})]}):t.jsx(ne,{fetchState:S})},at=_(function(){return{meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(e,a){const{navigate:o,integrationsView:c}=a;return{onBackClick:()=>{o("../")},onNavigateToDashboard:()=>{o("../dashboard")},onRefreshClick:()=>{c.integrations.refreshQBO.fetchState!=="In-Progress"&&e(He())}}})(Mn),st=()=>{const e=T(),{tenantEmailDomain:a}=V(),[o,c]=u.useState(!1),i=m(g=>g.tenantState.fetchState),n=m(g=>j(g)).companyId??x.getSignedInUserTenant(a)?.companyId,s=x.getSignedInUser(),l=B(),p=l?.loggedInUserRole.includes("admin")===!0;if(s==null)throw Error("Can't access Integrations page without signing in...");const d=g=>{c(g)},f=m(g=>qe(g,n));return l?.loggedInUserRoleMap!=null?t.jsxs(ot,{children:[t.jsx(v,{isAppContentDrawerOpen:o,handleDrawerToggle:d}),t.jsx(at,{navigate:e,onClickMenuIcon:()=>{d(!0)},isAdmin:p,integrationsView:f,isLoading:i==="In-Progress"})]}):t.jsx(ne,{fetchState:i})},ot=U.div`
34
34
  display: flex;
35
35
  height: 100%;
36
36
  width: 100%;
@@ -46,7 +46,7 @@ import{j as t}from"./liveblocks-CVGPqYnR.js";import{a as u}from"./sentry-vrLJXbk
46
46
  flex-direction: column;
47
47
  align-items: center;
48
48
  background-color: ${e=>e.theme.colors.grey4};
49
- `,ct=()=>{const e=P(),{tenantEmailDomain:a}=V(),[o,c]=u.useState(!1),i=m(r=>k(r)).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(r=>We(r,n.userId)),l=m(r=>Xe(r,i,"bill_pay","user_reimbursement_account")),{plaidConnectionDetails:p}=l,d=r=>{c(r)},f=u.useCallback(r=>{e(Y("user_reimbursement_account",r))},[]),g=u.useCallback(r=>{e(X(r,i,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},[]);u.useEffect(()=>{s.fetchState!=="Completed"&&s.fetchState!=="In-Progress"&&e(Ye(n.userId))},[n.userId,s.fetchState]);const S=s.fetchState==="Not-Started"||s.fetchState==="In-Progress";return t.jsxs(it,{children:[t.jsx(v,{isAppContentDrawerOpen:o,handleDrawerToggle:d}),t.jsx(Dn,{plaidConnectionDetails:p,isLoading:S,myBankConnectionsView:s,onFetchLinkTokenClick:f,onEstablishConnectionClick:g,onClickMenuIcon:()=>{d(!0)}})]})},lt=U.div`
49
+ `,ct=()=>{const e=P(),{tenantEmailDomain:a}=V(),[o,c]=u.useState(!1),i=m(r=>j(r)).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(r=>We(r,n.userId)),l=m(r=>Xe(r,i,"bill_pay","user_reimbursement_account")),{plaidConnectionDetails:p}=l,d=r=>{c(r)},f=u.useCallback(r=>{e(Y("user_reimbursement_account",r))},[]),g=u.useCallback(r=>{e(X(r,i,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},[]);u.useEffect(()=>{s.fetchState!=="Completed"&&s.fetchState!=="In-Progress"&&e(Ye(n.userId))},[n.userId,s.fetchState]);const S=s.fetchState==="Not-Started"||s.fetchState==="In-Progress";return t.jsxs(it,{children:[t.jsx(v,{isAppContentDrawerOpen:o,handleDrawerToggle:d}),t.jsx(Dn,{plaidConnectionDetails:p,isLoading:S,myBankConnectionsView:s,onFetchLinkTokenClick:f,onEstablishConnectionClick:g,onClickMenuIcon:()=>{d(!0)}})]})},lt=U.div`
50
50
  display: flex;
51
51
  height: 100%;
52
52
  width: 100%;
@@ -54,4 +54,4 @@ import{j as t}from"./liveblocks-CVGPqYnR.js";import{a as u}from"./sentry-vrLJXbk
54
54
  flex-direction: column;
55
55
  align-items: center;
56
56
  background-color: ${e=>e.theme.colors.grey4};
57
- `,oe=({appContent:e})=>{const a=P(),o=T(),c=R(),[i,n]=u.useState(!1),s=m(h=>k(h)),{tenantEmailDomain:l}=s,p=s.companyId??x.getSignedInUserTenant(l)?.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:g}=d(D.isChargeCardFeatureEnabled),{isFeatureEnabled:S}=d(D.isDebitCardFeatureEnabled),{isFeatureEnabled:r}=d(D.isTreasuryEnabled),A=m(h=>ce(h)),y=me(s),j=fe(S,s),b=!j&&A,I=Un(s,g,S),{areTenantIdsInSync:L}=Tn();u.useEffect(()=>{L&&a(en(p,b))},[p,a,b,L]);const E=m(h=>nn(h,b)),G=E.fetchState==="Not-Started"||E.fetchState==="In-Progress"||p==null,Z=tn(s),K=!!s.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,O=h=>{n(h)};return t.jsxs(lt,{children:[t.jsx(v,{isAppContentDrawerOpen:i,handleDrawerToggle:O}),e!=null?t.jsx(t.Fragment,{children:e}):t.jsx(Fn,{myProfileView:E,isAccountingClassesEnabled:A,isReimbursementDisabled:K===!1,isZeniAccountsDisabled:f===!1,isChargeCardDisabled:I===!1,isTreasuryDisabled:r===!1,isLiteRoleDisabled:Z===!1,onClickMenuIcon:()=>{O(!0)},isLoading:G,isBankingOnlyTenant:j,isCardsOnlyTenant:y,onAddressClick:h=>{const M=function(q,Q){let w=`/${q}/settings/my_profile`;return w=w.concat(`/new/${Q}`),w}(l,h),J=Rn(c.state?.pathnameStackToGoBack,c.pathname);o(M,{state:{pathnameStackToGoBack:J}})},onGetOtp:h=>{const M={...E.myProfileLocalData,phone:h};a(te({localData:M})),a(cn(h,"MyProfile"))},onResendOtp:h=>{a(on(h,"MyProfile"))},onCancelClick:()=>{a(sn())},onSaveClick:()=>{a(ae("MyProfile",E.myProfileLocalData.phone,E.myProfileLocalData.otpChallenge,E.myProfileLocalData.dateOfBirth,E.addressData?.addressToCreate))},onVerifyOtp:(h,M)=>{a(an(h,M,"MyProfile"))},onVerifyOtpSuccess:h=>{h!=null&&x.saveZeniOtpToken(h),a(ae("MyProfile",E.myProfileLocalData.phone,E.myProfileLocalData.otpChallenge,E.myProfileLocalData.dateOfBirth,E.addressData?.addressToCreate))},updateMyProfileLocalData:h=>{a(te({localData:h}))}})]})};function rt(){const e=P(),a=m(r=>k(r)).companyId,o=m(r=>ln(r)),c=m(r=>he(r)),i=x.getSignedInUser(),[n,s]=u.useState(!1),l=u.useCallback(r=>{s(r)},[]),p=u.useCallback(r=>{e(rn(r))},[]),d=u.useCallback(()=>{i?.userEmail!=null&&e(dn({loggedInUserEmail:i.userEmail}))},[i?.userEmail]),f=u.useCallback(()=>{e(un())},[]);if(i==null)throw Error("Can't access Notification Settings page without signing in...");const g=u.useCallback(()=>{const r=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(se(r,a))},[a,c.notificationSettings.monthEndInsightsNotificationSettings.enabled]),S=u.useCallback(()=>{e(pn())},[]);return u.useEffect(()=>{if(c.fetchState==="Completed"&&o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"){const r=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(se(r,a))}},[o.fetchState,a,c.notificationSettings.monthEndInsightsNotificationSettings.enabled,c.fetchState]),t.jsxs(t.Fragment,{children:[t.jsx(v,{isAppContentDrawerOpen:n,handleDrawerToggle:l}),t.jsx(_n,{notificationSettingsView:o,onFormDataChange:p,onCancel:d,onSave:f,onClickMenuIcon:()=>{l(!0)},signedInUser:i,onRefresh:g,resetUpdateStatus:S})]})}function Vt(e){const[a,o]=u.useState(!1),c=m(r=>he(r)),i=m(r=>k(r)),n=B(),s=x.getSignedInUser(),l=P(),{useFeatureGate:p}=ee(),{isFeatureEnabled:d}=p(D.isDebitCardFeatureEnabled),f=s?.userEmail==null||c.fetchState!=="Completed"||gn(c.notificationSettings,s.userEmail,d,i);u.useEffect(()=>{c.fetchState!=="In-Progress"&&c.fetchState!=="Completed"&&a===!1&&(o(!0),l(mn()))},[c.fetchState,a]);const g=fe(d,i),S=me(i);return c.fetchState!=="In-Progress"&&c.fetchState!=="Not-Started"||f!==!0?fn(i)?t.jsxs(H,{children:[hn(n?.loggedInUserRole??[],d,i,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"accounting/*",element:t.jsx(Jn,{})}),bn(n?.loggedInUserRole??[],d,i,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"approval_rules/*",element:t.jsx(dt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),Sn(i,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"my_bank_connections",element:t.jsx(ct,{})}),yn(i,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"bank_connections",element:t.jsx(Yn,{})}),In(i,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"business_verification",element:t.jsx(Nn,{productType:g?"zeni_accounts":S?"charge_cards":On(i,n?.loggedInUserRoleMap)})}),Cn(n?.loggedInUserRole??[],i,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"company_details",element:t.jsx($n,{})}),xn(n?.loggedInUserRole??[],i)&&t.jsx(C,{path:"billing",element:t.jsx(tt,{})}),An(n?.loggedInUserRole??[],d,i)&&t.jsx(C,{path:"integrations",element:t.jsx(st,{})}),t.jsx(C,{path:"my_profile/new/:addressType",element:t.jsx(oe,{appContent:t.jsx(Ln,{isSubPage:!1})})}),t.jsx(C,{path:"my_profile",element:t.jsx(oe,{})}),f&&t.jsx(C,{path:"notifications",element:t.jsx(rt,{})}),t.jsx(C,{path:"*",element:t.jsx(F,{})})]}):t.jsx(H,{children:t.jsx(C,{path:"*",element:t.jsx(F,{})})}):null}function dt(e){return t.jsxs(H,{children:[t.jsx(C,{path:"/",element:t.jsx(Hn,{})}),t.jsx(C,{path:"bills/approval-rules/*",element:t.jsx(zn,{})}),t.jsx(C,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?t.jsx(Gn,{}):t.jsx(F,{})}),t.jsx(C,{path:"*",element:t.jsx(F,{})})]})}export{Vt as default};
57
+ `,oe=({appContent:e})=>{const a=P(),o=T(),c=R(),[i,n]=u.useState(!1),s=m(h=>j(h)),{tenantEmailDomain:l}=s,p=s.companyId??x.getSignedInUserTenant(l)?.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:g}=d(D.isChargeCardFeatureEnabled),{isFeatureEnabled:S}=d(D.isDebitCardFeatureEnabled),{isFeatureEnabled:r}=d(D.isTreasuryEnabled),A=m(h=>ce(h)),y=me(s),k=fe(S,s),b=!k&&A,I=Un(s,g,S),{areTenantIdsInSync:L}=Tn();u.useEffect(()=>{L&&a(en(p,b))},[p,a,b,L]);const E=m(h=>nn(h,b)),G=E.fetchState==="Not-Started"||E.fetchState==="In-Progress"||p==null,Z=tn(s),K=!!s.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,O=h=>{n(h)};return t.jsxs(lt,{children:[t.jsx(v,{isAppContentDrawerOpen:i,handleDrawerToggle:O}),e!=null?t.jsx(t.Fragment,{children:e}):t.jsx(Fn,{myProfileView:E,isAccountingClassesEnabled:A,isReimbursementDisabled:K===!1,isZeniAccountsDisabled:f===!1,isChargeCardDisabled:I===!1,isTreasuryDisabled:r===!1,isLiteRoleDisabled:Z===!1,onClickMenuIcon:()=>{O(!0)},isLoading:G,isBankingOnlyTenant:k,isCardsOnlyTenant:y,onAddressClick:h=>{const M=function(Q,q){let w=`/${Q}/settings/my_profile`;return w=w.concat(`/new/${q}`),w}(l,h),J=Rn(c.state?.pathnameStackToGoBack,c.pathname);o(M,{state:{pathnameStackToGoBack:J}})},onGetOtp:h=>{const M={...E.myProfileLocalData,phone:h};a(te({localData:M})),a(cn(h,"MyProfile"))},onResendOtp:h=>{a(on(h,"MyProfile"))},onCancelClick:()=>{a(sn())},onSaveClick:()=>{a(ae("MyProfile",E.myProfileLocalData.phone,E.myProfileLocalData.otpChallenge,E.myProfileLocalData.dateOfBirth,E.addressData?.addressToCreate))},onVerifyOtp:(h,M)=>{a(an(h,M,"MyProfile"))},onVerifyOtpSuccess:h=>{h!=null&&x.saveZeniOtpToken(h),a(ae("MyProfile",E.myProfileLocalData.phone,E.myProfileLocalData.otpChallenge,E.myProfileLocalData.dateOfBirth,E.addressData?.addressToCreate))},updateMyProfileLocalData:h=>{a(te({localData:h}))}})]})};function rt(){const e=P(),a=m(r=>j(r)).companyId,o=m(r=>ln(r)),c=m(r=>he(r)),i=x.getSignedInUser(),[n,s]=u.useState(!1),l=u.useCallback(r=>{s(r)},[]),p=u.useCallback(r=>{e(rn(r))},[]),d=u.useCallback(()=>{i?.userEmail!=null&&e(dn({loggedInUserEmail:i.userEmail}))},[i?.userEmail]),f=u.useCallback(()=>{e(un())},[]);if(i==null)throw Error("Can't access Notification Settings page without signing in...");const g=u.useCallback(()=>{const r=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(se(r,a))},[a,c.notificationSettings.monthEndInsightsNotificationSettings.enabled]),S=u.useCallback(()=>{e(pn())},[]);return u.useEffect(()=>{if(c.fetchState==="Completed"&&o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"){const r=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(se(r,a))}},[o.fetchState,a,c.notificationSettings.monthEndInsightsNotificationSettings.enabled,c.fetchState]),t.jsxs(t.Fragment,{children:[t.jsx(v,{isAppContentDrawerOpen:n,handleDrawerToggle:l}),t.jsx(_n,{notificationSettingsView:o,onFormDataChange:p,onCancel:d,onSave:f,onClickMenuIcon:()=>{l(!0)},signedInUser:i,onRefresh:g,resetUpdateStatus:S})]})}function Vt(e){const[a,o]=u.useState(!1),c=m(r=>he(r)),i=m(r=>j(r)),n=B(),s=x.getSignedInUser(),l=P(),{useFeatureGate:p}=ee(),{isFeatureEnabled:d}=p(D.isDebitCardFeatureEnabled),f=s?.userEmail==null||c.fetchState!=="Completed"||gn(c.notificationSettings,s.userEmail,d,i);u.useEffect(()=>{c.fetchState!=="In-Progress"&&c.fetchState!=="Completed"&&a===!1&&(o(!0),l(mn()))},[c.fetchState,a]);const g=fe(d,i),S=me(i);return c.fetchState!=="In-Progress"&&c.fetchState!=="Not-Started"||f!==!0?fn(i)?t.jsxs(H,{children:[hn(n?.loggedInUserRole??[],d,i,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"accounting/*",element:t.jsx(Jn,{})}),bn(n?.loggedInUserRole??[],d,i,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"approval_rules/*",element:t.jsx(dt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),Sn(i,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"my_bank_connections",element:t.jsx(ct,{})}),yn(i,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"bank_connections",element:t.jsx(Yn,{})}),In(i,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"business_verification",element:t.jsx(Nn,{productType:g?"zeni_accounts":S?"charge_cards":On(i,n?.loggedInUserRoleMap)})}),Cn(n?.loggedInUserRole??[],i,n?.loggedInUserRoleMap)&&t.jsx(C,{path:"company_details",element:t.jsx($n,{})}),xn(n?.loggedInUserRole??[],i)&&t.jsx(C,{path:"billing",element:t.jsx(tt,{})}),An(n?.loggedInUserRole??[],d,i)&&t.jsx(C,{path:"integrations",element:t.jsx(st,{})}),t.jsx(C,{path:"my_profile/new/:addressType",element:t.jsx(oe,{appContent:t.jsx(Ln,{isSubPage:!1})})}),t.jsx(C,{path:"my_profile",element:t.jsx(oe,{})}),f&&t.jsx(C,{path:"notifications",element:t.jsx(rt,{})}),t.jsx(C,{path:"*",element:t.jsx(F,{})})]}):t.jsx(H,{children:t.jsx(C,{path:"*",element:t.jsx(F,{})})}):null}function dt(e){return t.jsxs(H,{children:[t.jsx(C,{path:"/",element:t.jsx(Hn,{})}),t.jsx(C,{path:"bills/approval-rules/*",element:t.jsx(zn,{})}),t.jsx(C,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?t.jsx(Gn,{}):t.jsx(F,{})}),t.jsx(C,{path:"*",element:t.jsx(F,{})})]})}export{Vt as default};
@@ -1,4 +1,4 @@
1
- import{j as u}from"./liveblocks-CVGPqYnR.js";import{j as J,u as Q,h as X,l as W,g as w,N as L,k as G,q as Qe}from"./core-B4ZvHvvY.js";import{bC as Xe,cN as Ie,LH as ye,eL as V,ct as en,wR as Z,wG as nn,LT as tn,LW as an,pl as ee,p9 as ne,jG as te,rk as M,LY as Ae,fz as $e,fy as We,fx as Ge,LZ as sn,w_ as on,AR as ke,AI as _e,AF as ve,Aw as K,AL as Pe,AO as we,AU as Ee,rO as Te,fJ as cn,co as rn,eS as un,eQ as dn,eR as ln,br as pn,L_ as mn,zy as le,Aa as yn,L$ as fn,bD as gn,C5 as pe,B9 as Sn,M0 as bn,M1 as hn,C9 as Cn,Cd as In,rd as An,Gj as kn,CK as Ce,DD as me,M2 as _n,M3 as vn,M4 as Pn,M5 as He,M6 as wn,IB as En,L4 as Tn,IN as Dn,M7 as qe,M8 as Be,CY as Ke,jO as Un,pc as Ye,rm as On,bB as je,ry as Le,cr as Fn,M9 as Je,fb as Bn,Cs as Vn,Cw as xn,Ma as jn,CN as Re,Mb as Ln,Mc as Rn,Md as Mn,Me as Nn,fF as zn,y9 as Zn,Mf as $n,ye as Wn,yd as Gn}from"./zeni-epic-state-Da4VO2lv.js";import{S as ae,Z as ie,i as de,m as De,aI as Y,z as T,s as se,c as E,B as Ue,e as $,bm as Hn,ao as oe,bn as x,bo as qn,bp as Kn,aa as xe,bq as Yn,q as Me,ap as Ne,K as Jn,x as Qn,br as Xn,bs as et,bt as nt,a1 as tt}from"./index-DgzG0i4n.js";import{a as C}from"./sentry-vrLJXbkU.js";import{n as Ve,D as at,S as it}from"./mui-DoY7WfR_.js";import{M as fe}from"./MobileAppDrawer-eCdBXSxf.js";import R from"./NotFoundScreen-jPpbDlQd.js";import{a as ze}from"./analyticsHelper-B-IDLpaZ.js";import{c as Ze}from"./routePaths-WhbiYSxu.js";import{B as Fe}from"./BusinessVerificationPageScreen-B8mXcNLy.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]="7ff22591-56a8-4e00-96b0-3f0e89eaf28c",e._sentryDebugIdIdentifier="sentry-dbid-7ff22591-56a8-4e00-96b0-3f0e89eaf28c")}catch{}})();const st=Ve.div`
1
+ import{j as u}from"./liveblocks-BCZSgQbG.js";import{j as J,u as Q,h as X,l as W,g as w,N as L,k as G,q as Qe}from"./core-C_NeXleM.js";import{bC as Xe,cN as Ie,LH as ye,eL as V,ct as en,wR as Z,wG as nn,LT as tn,LW as an,pl as ee,p9 as ne,jG as te,rk as M,LY as Ae,fz as $e,fy as We,fx as Ge,LZ as sn,w_ as on,AR as ke,AI as _e,AF as ve,Aw as K,AL as Pe,AO as we,AU as Ee,rO as Te,fJ as cn,co as rn,eS as un,eQ as dn,eR as ln,br as pn,L_ as mn,zy as le,Aa as yn,L$ as fn,bD as gn,C5 as pe,B9 as Sn,M0 as bn,M1 as hn,C9 as Cn,Cd as In,rd as An,Gj as kn,CK as Ce,DD as me,M2 as _n,M3 as vn,M4 as Pn,M5 as He,M6 as wn,IB as En,L4 as Tn,IN as Dn,M7 as qe,M8 as Be,CY as Ke,jO as Un,pc as Ye,rm as On,bB as je,ry as Le,cr as Fn,M9 as Je,fb as Bn,Cs as Vn,Cw as xn,Ma as jn,CN as Re,Mb as Ln,Mc as Rn,Md as Mn,Me as Nn,fF as zn,y9 as Zn,Mf as $n,ye as Wn,yd as Gn}from"./zeni-epic-state-Dp14ovRw.js";import{S as ae,Z as ie,i as de,m as De,aI as Y,z as T,q as se,c as E,B as Ue,e as $,bm as Hn,ao as oe,bn as x,bo as qn,bp as Kn,aa as xe,bq as Yn,k as Me,ap as Ne,K as Jn,w as Qn,br as Xn,bs as et,bt as nt,a1 as tt}from"./index-TZBFPhBM.js";import{a as C}from"./sentry-CGkVgbup.js";import{n as Ve,D as at,S as it}from"./mui-CgjVMn8C.js";import{M as fe}from"./MobileAppDrawer-Czhowgsf.js";import R from"./NotFoundScreen-D0cCxE_g.js";import{a as ze}from"./analyticsHelper-DZ0CUT0b.js";import{c as Ze}from"./routePaths-fq-ods6n.js";import{B as Fe}from"./BusinessVerificationPageScreen-Db_j23ph.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]="10cf6918-3b4b-41d4-912e-a1fb87489767",e._sentryDebugIdIdentifier="sentry-dbid-10cf6918-3b4b-41d4-912e-a1fb87489767")}catch{}})();const st=Ve.div`
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
@@ -1 +1 @@
1
- import{j as f}from"./liveblocks-CVGPqYnR.js";import{a as u,b as T,q as A}from"./sentry-vrLJXbkU.js";import{h as D,j as z,g as c,u as M,N as O,k as j}from"./core-B4ZvHvvY.js";import{u as P,z as s,m as F,c as w,D as _,d as B,e as N,A as V,g as H,f as W,h as v}from"./index-DgzG0i4n.js";import{eL as $,HV as q,HW as J,eM as Q,fh as R,I0 as G,fE as K,cR as X,I1 as b,I2 as Y,I3 as Z,bQ as y}from"./zeni-epic-state-Da4VO2lv.js";import"./mui-DoY7WfR_.js";import{u as ee}from"./useDeviceId-BMtoTIZs.js";import{f as te}from"./analyticsHelper-B-IDLpaZ.js";import{t as ne}from"./getLocaleForTenant-C50EFRQ8.js";import"./recharts-DNFnaP_v.js";import"./lottie-B5aSI3Li.js";import"./analytics-BL0geQNn.js";import"./plaid-C1RHGEem.js";import"./dnd-B2_m6pRT.js";import"./stripe-DMRn4zHo.js";import"./lexical-DA5yMmPj.js";import"./pdf-ChIJqwGf.js";import"./utils-QMlevttK.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="33a14e70-b54f-4e0c-a412-9c2bea6ff5da",t._sentryDebugIdIdentifier="sentry-dbid-33a14e70-b54f-4e0c-a412-9c2bea6ff5da")}catch{}})();const ie=j(function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}},function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{A({message:`OAuth error from provider ${a} with error ${n}`,level:"error",tags:{authProvider:a,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,a)=>{const l=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(Z({authCode:n,oauthProvider:a,appType:"web",redirectUri:y(l),sourceUri:y(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:a}=i;a!=null&&(s.saveMagicLinkEmail(n),t(Y(n,a)))},clearSignInError:()=>{t(b())}}})(W),ae=T.memo(ie);function ve({setTenantEmailDomain:t}){const i=D(),d=z(),{clearAllLoading:g}=P(),n=s.getSignedInUser();u.useLayoutEffect(()=>{g()},[g]);const a=ee(),l=c(e=>e.tenantState.magicLinkCodeVerifier),{sendEmailMagicLinkFetchState:h,accountLocked:C,accountUnlockTime:k}=c(e=>e.tenantState),p=c(e=>e.tenantState.fetchState),L=c(e=>e.tenantState.activeTenantFetchState.fetchState),I=c(e=>e.tenantState.signInState),o=c(e=>e.tenantState.loggedInUser),r=c(e=>$(e)),S=c(e=>q(e)),m=M(),E=F().mode,U=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(u.useEffect(()=>{h.fetchState==="Completed"&&l!=null&&(w.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(l))},[h.fetchState,l]),u.useEffect(()=>{t(void 0)},[]),u.useEffect(()=>{I!=="In-Progress"||p!=="Completed"&&L!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(J(S.tenantsInOrder),o.zeniSessionId),Q(o.userId,o.zeniSessionId,r.tenantId),i(R(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(G("Completed")),_.updateAppLocaleID(ne(r)),te(o,r,E,void 0,S.tenantsInOrder),K().then(()=>{const e=H();e!=null&&B(e)}),setTimeout(()=>{w.trackLogin(N.Event.loginSuccess,o.authProvider??"google",X(r.productSettings))},2e3))},[I,p,L,o,r,S,E,m.state,i]),I==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return f.jsx(O,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!U,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),C===!0&&k!=null?f.jsx(V,{onClose:()=>i(b()),unlockDate:k}):null]})}export{ve as default};
1
+ import{j as f}from"./liveblocks-BCZSgQbG.js";import{a as u,b as T,q as A}from"./sentry-CGkVgbup.js";import{h as z,j as D,g as c,u as M,N as O,k as j}from"./core-C_NeXleM.js";import{u as P,z as s,m as F,c as w,O as _,d as B,e as N,I as V,g as H,f as W,h as v}from"./index-TZBFPhBM.js";import{eL as $,HV as q,HW as J,eM as Q,fh as R,I0 as G,fE as K,cR as X,I1 as b,I2 as Y,I3 as Z,bQ as y}from"./zeni-epic-state-Dp14ovRw.js";import"./mui-CgjVMn8C.js";import{u as ee}from"./useDeviceId-DxDe1m2N.js";import{f as te}from"./analyticsHelper-DZ0CUT0b.js";import{t as ne}from"./getLocaleForTenant-C75hRciY.js";import"./recharts-NCr2Pwd1.js";import"./lottie-BdeQlKTG.js";import"./analytics-BkhHPaQ4.js";import"./plaid-B3UNGbGB.js";import"./dnd-C0SdDgY2.js";import"./stripe-DMRn4zHo.js";import"./lexical-B1vtLf4F.js";import"./pdf-CQPNphc4.js";import"./utils-CTLGOmjC.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="e7dd52bc-687b-4e90-9ac1-20297f6ca942",t._sentryDebugIdIdentifier="sentry-dbid-e7dd52bc-687b-4e90-9ac1-20297f6ca942")}catch{}})();const ie=j(function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}},function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{A({message:`OAuth error from provider ${a} with error ${n}`,level:"error",tags:{authProvider:a,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,a)=>{const l=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(Z({authCode:n,oauthProvider:a,appType:"web",redirectUri:y(l),sourceUri:y(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:a}=i;a!=null&&(s.saveMagicLinkEmail(n),t(Y(n,a)))},clearSignInError:()=>{t(b())}}})(W),ae=T.memo(ie);function ve({setTenantEmailDomain:t}){const i=z(),d=D(),{clearAllLoading:g}=P(),n=s.getSignedInUser();u.useLayoutEffect(()=>{g()},[g]);const a=ee(),l=c(e=>e.tenantState.magicLinkCodeVerifier),{sendEmailMagicLinkFetchState:h,accountLocked:C,accountUnlockTime:k}=c(e=>e.tenantState),p=c(e=>e.tenantState.fetchState),L=c(e=>e.tenantState.activeTenantFetchState.fetchState),I=c(e=>e.tenantState.signInState),o=c(e=>e.tenantState.loggedInUser),r=c(e=>$(e)),S=c(e=>q(e)),m=M(),E=F().mode,U=m.state?.magicLinkExpired,x=m.state?.magicLinkAlreadyUsed;if(u.useEffect(()=>{h.fetchState==="Completed"&&l!=null&&(w.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(l))},[h.fetchState,l]),u.useEffect(()=>{t(void 0)},[]),u.useEffect(()=>{I!=="In-Progress"||p!=="Completed"&&L!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(J(S.tenantsInOrder),o.zeniSessionId),Q(o.userId,o.zeniSessionId,r.tenantId),i(R(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(G("Completed")),_.updateAppLocaleID(ne(r)),te(o,r,E,void 0,S.tenantsInOrder),K().then(()=>{const e=H();e!=null&&B(e)}),setTimeout(()=>{w.trackLogin(N.Event.loginSuccess,o.authProvider??"google",X(r.productSettings))},2e3))},[I,p,L,o,r,S,E,m.state,i]),I==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return f.jsx(O,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!U,magicLinkAlreadyUsed:!!x,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),C===!0&&k!=null?f.jsx(V,{onClose:()=>i(b()),unlockDate:k}):null]})}export{ve as default};