@zeniai/web-app-ui 5.0.3-dev → 5.0.4-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 (100) hide show
  1. package/dist/assets/AddressRoutes-BfOuxooD.js +1 -0
  2. package/dist/assets/{AddressScreen-BqbCkW9F.js → AddressScreen-tCLozkzY.js} +1 -1
  3. package/dist/assets/{AiCfoScreen-Cn0zhkC5.js → AiCfoScreen-BHQknTzK.js} +1 -1
  4. package/dist/assets/{BillPayApprovalRoutes-Bolmrdjm.js → BillPayApprovalRoutes-BjYSk6ti.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-BSgAGGub.js → BillPayRoutes-CHzCnxpe.js} +1 -1
  6. package/dist/assets/{BusinessVerificationPageScreen-S9e9j7rw.js → BusinessVerificationPageScreen-j2FAzNjV.js} +1 -1
  7. package/dist/assets/{ChargeCardRoutes-BEYtqvNa.js → ChargeCardRoutes-C761-FAb.js} +1 -1
  8. package/dist/assets/{CompanyPassportScreen-dMXV1qo-.js → CompanyPassportScreen-BVtucNEF.js} +1 -1
  9. package/dist/assets/{ConnectionAuthScreen-D7LbK8he.js → ConnectionAuthScreen-Ei8QSx21.js} +1 -1
  10. package/dist/assets/CustomerOnboardingAuthScreen-CYRzq56g.js +1 -0
  11. package/dist/assets/{CustomerOnboardingRoutes-CErJ4D5a.js → CustomerOnboardingRoutes-CK9QfpeW.js} +1 -1
  12. package/dist/assets/{DashboardRoutes-Byj-cT7T.js → DashboardRoutes-C2kxyP02.js} +1 -1
  13. package/dist/assets/{DefaultTenantHome-DlY-4PIS.js → DefaultTenantHome-DduNDlJB.js} +1 -1
  14. package/dist/assets/{DomesticWireDetailScreen-BwBgY_jC.js → DomesticWireDetailScreen-Cj8iAPXf.js} +1 -1
  15. package/dist/assets/{DrawerScreen-7RB3pd-L.js → DrawerScreen-Dv_UzQOo.js} +1 -1
  16. package/dist/assets/{EntityDetailRoutes-2Lvrz1et.js → EntityDetailRoutes-CCSZXrNV.js} +1 -1
  17. package/dist/assets/{ExpenseAutomationRoutes-Rd1hQhl9.js → ExpenseAutomationRoutes-D95clzaF.js} +1 -1
  18. package/dist/assets/{FeaturePreviewScreen-CHkVgg1G.js → FeaturePreviewScreen-3Cs41rNa.js} +1 -1
  19. package/dist/assets/{MagicLinkRoutes-BZOFHOk2.js → MagicLinkRoutes-DqbOY0pO.js} +1 -1
  20. package/dist/assets/{MagicLinkSignInScreen-DHTOpNlI.js → MagicLinkSignInScreen-cJxTn6Z5.js} +1 -1
  21. package/dist/assets/{MobileAppDrawer-Cq6umKbp.js → MobileAppDrawer-D0-D1IIa.js} +1 -1
  22. package/dist/assets/NotFoundScreen-BM3DcBu4.js +1 -0
  23. package/dist/assets/{NotificationRoutes-UDRP-d_i.js → NotificationRoutes-fnITeGvC.js} +1 -1
  24. package/dist/assets/{PandLWithForecastRoutes-DovBC5qm.js → PandLWithForecastRoutes-DXeM7QQi.js} +1 -1
  25. package/dist/assets/{PeopleRoutes-BpIaCleR.js → PeopleRoutes-DWNHtx0-.js} +1 -1
  26. package/dist/assets/{PerformanceRoutes-DD5yUPPu.js → PerformanceRoutes-B2---Xlh.js} +1 -1
  27. package/dist/assets/{Preview-B_pB49hk.js → Preview-RTK9mHhj.js} +1 -1
  28. package/dist/assets/{QBOConnectionScreen-mxlQ58sF.js → QBOConnectionScreen-CMvaIZxf.js} +1 -1
  29. package/dist/assets/{ReferralListScreen-DDAnd9kQ.js → ReferralListScreen-CU0cqYp3.js} +1 -1
  30. package/dist/assets/{ReimbursementApprovalRoutes-DtjTNMyW.js → ReimbursementApprovalRoutes-DghBrXt3.js} +1 -1
  31. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-mjO0EFcS.js → ReimbursementApprovalRuleDetailScreen-CnM97Nh_.js} +1 -1
  32. package/dist/assets/{ReimbursementRoutes-DM6_XIzS.js → ReimbursementRoutes-BlPwJb9-.js} +1 -1
  33. package/dist/assets/{ReportsRoutes-CSv8fmaw.js → ReportsRoutes-OsfHQ-oH.js} +1 -1
  34. package/dist/assets/{RewardsRoutes-CQy-a7uv.js → RewardsRoutes-DCXhofuE.js} +1 -1
  35. package/dist/assets/{ScreenRoutes-BQrRNAQd.js → ScreenRoutes-DsynOrE_.js} +2 -2
  36. package/dist/assets/{SettingsRoutes-CwWBls5-.js → SettingsRoutes-DZ_F2Kb6.js} +1 -1
  37. package/dist/assets/{SetupPagesScreen-C7kgTCyu.js → SetupPagesScreen-B8Rno5B2.js} +1 -1
  38. package/dist/assets/{SignInScreen-CJiqdtfL.js → SignInScreen-rwU-QvmY.js} +1 -1
  39. package/dist/assets/{SignOutScreen-xBwa5MBZ.js → SignOutScreen-C7mRBzAo.js} +1 -1
  40. package/dist/assets/{TaskListScreen-vJcR4Bnk.js → TaskListScreen-xi0Q2QtO.js} +1 -1
  41. package/dist/assets/{TaskRoutes-CHbekD_1.js → TaskRoutes-B_fERi8e.js} +1 -1
  42. package/dist/assets/TransactionDetailRoutes-Bid-ev7j.js +1 -0
  43. package/dist/assets/{TransactionDetailScreen-lfCtA1jG.js → TransactionDetailScreen-Bgfn35GF.js} +1 -1
  44. package/dist/assets/{TransactionListRoutes-C2Nh8rHE.js → TransactionListRoutes-B3VXniAo.js} +1 -1
  45. package/dist/assets/{TreasuryRoutes-BTPTKFd8.js → TreasuryRoutes-CLsu4EBs.js} +1 -1
  46. package/dist/assets/{VendorsRoutes-B0tRBNsh.js → VendorsRoutes-DTiBYFq_.js} +1 -1
  47. package/dist/assets/{WiseConfirmationScreen-DW-WFPj-.js → WiseConfirmationScreen-DCTQj8ux.js} +1 -1
  48. package/dist/assets/{ZeniAccountRoutes-wiCc-pYp.js → ZeniAccountRoutes-D7fsKNF6.js} +1 -1
  49. package/dist/assets/{ZeniAccountStatementScreen-BjUITEnt.js → ZeniAccountStatementScreen-CD8WdGq8.js} +1 -1
  50. package/dist/assets/{accountMappingHelper-DVEV1WRI.js → accountMappingHelper-BvCdqdBq.js} +1 -1
  51. package/dist/assets/{analytics-BAQwJULS.js → analytics-Cp5F-UjF.js} +1 -1
  52. package/dist/assets/{analyticsHelper-D9biWtDJ.js → analyticsHelper-BTOyHFla.js} +1 -1
  53. package/dist/assets/{core-D85lL_9t.js → core-DZE88rLA.js} +1 -1
  54. package/dist/assets/{decodeURIComponentSafe-ByB9WhLS.js → decodeURIComponentSafe--utjO_hD.js} +1 -1
  55. package/dist/assets/{dnd-P1ekKsf6.js → dnd-B4DEM2bW.js} +1 -1
  56. package/dist/assets/{empty-CYNEYtaG.js → empty-CRf4YhY4.js} +1 -1
  57. package/dist/assets/{empty-vrCkOfCr.js → empty-DTOnM0RR.js} +1 -1
  58. package/dist/assets/{emptyVideoElement-dzCxtvYW.js → emptyVideoElement-BgQif9Ia.js} +1 -1
  59. package/dist/assets/{epic-DD3uTQrs.js → epic-BzOmBklW.js} +1 -1
  60. package/dist/assets/{getLocaleForTenant-ClrmJsWr.js → getLocaleForTenant-CPndpwIp.js} +1 -1
  61. package/dist/assets/{index-eyGUyZ3T.js → index-BET54Nt-.js} +5 -5
  62. package/dist/assets/{index-BPbXNCzw.js → index-BWIeQAsg.js} +1 -1
  63. package/dist/assets/{index-Dmo9xgqA.js → index-CTObQYXg.js} +1 -1
  64. package/dist/assets/{index-BEEelBYS.js → index-ChZJ__M2.js} +1 -1
  65. package/dist/assets/{index-Cn65SF8r.js → index-CofKdFHU.js} +2 -2
  66. package/dist/assets/{index-lPBYjZLr.js → index-DpHHAj1V.js} +1 -1
  67. package/dist/assets/{index-BUCtSz30.js → index-j9ZiGcsv.js} +1 -1
  68. package/dist/assets/{lexical-C7vBKQl2.js → lexical-Bp_BNV6r.js} +1 -1
  69. package/dist/assets/{liveblocks-dlvb-ucF.js → liveblocks-Cqbf2YvG.js} +1 -1
  70. package/dist/assets/{lottie-DGXsyyYr.js → lottie-BMcMDJUW.js} +1 -1
  71. package/dist/assets/{mui-C9WBrZQt.js → mui-B4xUUoCx.js} +1 -1
  72. package/dist/assets/{pathToGoBack-Bl_9p4QB.js → pathToGoBack-H4XoSP95.js} +1 -1
  73. package/dist/assets/{pdf-DebxFbW1.js → pdf-DYKlsr3c.js} +3 -3
  74. package/dist/assets/{pdf-lib-VVDJ8cIK.js → pdf-lib-vymaIDnW.js} +1 -1
  75. package/dist/assets/{plaid-BveLUCs7.js → plaid-G98kqTnM.js} +1 -1
  76. package/dist/assets/{pusher-DUCiEwkw.js → pusher-D7P3EdsP.js} +1 -1
  77. package/dist/assets/{react-D5d1k6ry.js → react-4qgRGAdN.js} +1 -1
  78. package/dist/assets/{react-5tQG_cKG.js → react-BEWrpOF5.js} +1 -1
  79. package/dist/assets/{react-1c4ID8s0.js → react-Bhe_slJS.js} +1 -1
  80. package/dist/assets/{react-BdgNO3-u.js → react-BmZ57NU9.js} +1 -1
  81. package/dist/assets/{react-BKO9NKrm.js → react-CLdnK8kQ.js} +1 -1
  82. package/dist/assets/{react-Cj6aZ7ln.js → react-CuhJdsIn.js} +1 -1
  83. package/dist/assets/{recharts-BYSqK3LX.js → recharts-3_XOsuaw.js} +1 -1
  84. package/dist/assets/{routePaths-Ckqdpqo6.js → routePaths-BNouI24c.js} +1 -1
  85. package/dist/assets/{sentry-DGJ961LO.js → sentry-gLPXz4Yq.js} +1 -1
  86. package/dist/assets/{url-DoymNVR-.js → url-DMg8GQjt.js} +1 -1
  87. package/dist/assets/{url-CLAf8TQN.js → url-DpALAoIG.js} +1 -1
  88. package/dist/assets/{useAskAiCfoHostNavButtonProps-D7VmZhkv.js → useAskAiCfoHostNavButtonProps-CIwJkrUG.js} +1 -1
  89. package/dist/assets/{useDeviceId-cXBRwcUd.js → useDeviceId-CMDzs7Gm.js} +1 -1
  90. package/dist/assets/{useFetchSuggestedQuestionsWhenReady-vh4emZ7O.js → useFetchSuggestedQuestionsWhenReady-CZP4Iues.js} +1 -1
  91. package/dist/assets/{useInitialThreadRequest-CdZgxQMw.js → useInitialThreadRequest-DFJpueCY.js} +1 -1
  92. package/dist/assets/{utils-4E0JE-n2.js → utils-oW6HiHsc.js} +1 -1
  93. package/dist/assets/{withTransactionSidePanel-BjZspg1h.js → withTransactionSidePanel-DiiilNMM.js} +1 -1
  94. package/dist/assets/{zeni-epic-state-De57_V18.js → zeni-epic-state-Cc2P4FPR.js} +3 -3
  95. package/dist/index.html +1 -1
  96. package/package.json +1 -1
  97. package/dist/assets/AddressRoutes-DILxRnu9.js +0 -1
  98. package/dist/assets/CustomerOnboardingAuthScreen-BI1X8NcD.js +0 -1
  99. package/dist/assets/NotFoundScreen-CNrR5P_G.js +0 -1
  100. package/dist/assets/TransactionDetailRoutes-a-PE8_JU.js +0 -1
@@ -1 +1 @@
1
- import{j as N}from"./liveblocks-dlvb-ucF.js";import{a as c}from"./sentry-DGJ961LO.js";import{h as pe,g as a,l as We,u as Xe,j as qe,i as R}from"./core-D85lL_9t.js";import{eM as he,eU as Je,eV as Se,eO as Ke,bm as Qe,f3 as ea,eW as aa,eX as ta,eZ as na,f1 as sa,fb as oa,f2 as g,f5 as ia,f6 as ue,f9 as ra,f7 as da,f8 as la,fa as ca,cF as ua,fd as fa,cL as ma,bu as ba,eL as pa,fi as ha,fj as Sa,fh as ga}from"./zeni-epic-state-De57_V18.js";import{a1 as Ea,a2 as ka,v as Ca,a as ya,z as k,a3 as Ia,u as Ta,i as r,a4 as wa,a5 as Fa,j as Aa,c as _a,a6 as Da,V as va,a7 as $a,a8 as Ba,a9 as fe,aa as me,L as Ma,ab as Pa,ac as be,d as x,r as F,ad as V,ae as Ra}from"./index-eyGUyZ3T.js";import{D as xa}from"./mui-C9WBrZQt.js";(function(){try{var f=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new f.Error().stack;d&&(f._sentryDebugIds=f._sentryDebugIds||{},f._sentryDebugIds[d]="58f4fb52-cba1-489e-960c-6deab30974c3",f._sentryDebugIdIdentifier="sentry-dbid-58f4fb52-cba1-489e-960c-6deab30974c3")}catch{}})();const Va=Ea(({isAppContentDrawerOpen:f,handleDrawerToggle:d})=>{const{tenantEmailDomain:t}=We(),n=Xe(),C=Ca(),o=qe(),U=Ke(),m=pe(),{useFeatureGate:i}=ya(),G=k.getSignedInUser(),A=Qe(G),s=a(e=>he(e)),L=a(e=>ea(e)),j=L.uiState.currentChatSessionId,y=Ia(),{setLoading:ge}=Ta(),[_,O]=c.useState(void 0),D=R("/:tenantEmailDomain/dashboard")!==null,z=R("/:tenantEmailDomain/reports")!==null,I=R("/:tenantEmailDomain/onboarding/*")!==null,{isFeatureEnabled:Y}=i(r.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Ee}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:Z}=i(r.isDebitCardFeatureEnabled),ke=wa(s,Ee,Z),{isFeatureEnabled:Ce}=i(r.isSettingsFeatureEnabled),H=a(e=>aa(e)),{isFeatureEnabled:T}=i(r.isReferralFeatureEnabled),v=a(e=>ta(e));c.useEffect(()=>{y&&T&&!I&&v.fetchState==="Not-Started"&&m(na(!0))},[y,T,v.fetchState,I]);const h=k.getSignedInUser(),$=a(e=>e.tenantState),ye=a(e=>$.fetchState==="Completed"?sa(e):[]),E=a(e=>e.expenseAutomationViewState.selectedPeriodByTenantId),{isFeatureEnabled:Ie}=i(r.isApAgingFeatureEnabled),{isFeatureEnabled:Te}=i(r.isArAgingFeatureEnabled),{isFeatureEnabled:W}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:X}=i(r.isExpenseAutomationEnabledV2),q=X||W&&A,{isFeatureEnabled:we}=i(r.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:Fe}=i(r.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:Ae}=i(r.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:_e}=i(r.isDashboardSidebarNewYearAnimationEnabled),{isFeatureEnabled:De}=i(r.isTreasuryEnabled),{isFeatureEnabled:ve}=i(r.isTaskManagerCustomerUserAccessEnabled),$e=A||!A&&ve,Be=s.company!=null&&oa(s.company),w=De&&Be,Me=a(e=>g(e).totalUnreadCount),Pe=a(e=>g(e).reducedFetchCountState),J=a(e=>g(e).notificationDetailsByTab.tasks.uiState.unreadCount),K=a(e=>g(e).notificationDetailsByTab.comments.uiState.unreadCount),Re=a(e=>g(e).notificationDetailsByTab.tasks.fetchCountState),B=a(e=>g(e).notificationDetailsByTab.comments.fetchCountState),{inboxNotifications:Q,isLoading:ee,isFetchingMore:ae,hasFetchedAll:te,fetchMore:xe}=Fa();c.useEffect(()=>{const e=setTimeout(()=>xe?.(),0);return()=>clearTimeout(e)}),c.useEffect(()=>{if(ee===!1&&ae===!1&&te===!0)if(s?.companyId!=null&&Q!=null){const e=`dashboard_${s.companyId}`;O(Q.filter(u=>u.roomId===e&&u.readAt==null).length)}else O(0)},[ee,ae,te]),c.useEffect(()=>{y&&!I&&Re.fetchState==="Not-Started"&&U.tenantId!=null&&m(ia("task_manager","dashboard"))},[y,U.tenantId]),c.useEffect(()=>{I||B.fetchState!=="Not-Started"||m(ue({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),c.useEffect(()=>{_!=null&&B.fetchState==="In-Progress"&&(m(ue({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),m(Se({unreadCount:_},"comments")))},[_,B.fetchState]);const Ve={fetchStatus:Pe,count:Me},ne=t!=null?k.getSignedInUserTenant(t):null,se=a(e=>ne?.tenantId!=null?ra(e,ne.tenantId):void 0),S=[];Ie===!1&&S.push("accounts_payable_aging"),Te===!1&&S.push("accounts_receivable_aging"),Y===!1&&S.push("zeni_accounts_promo_card"),T===!1&&S.push("rewards_card"),q===!1&&S.push("expense_automation_card");const Ne=Aa(),oe=a(e=>da(e,S,h,X,W,w).fetchState),ie=a(e=>la(e).fetchState),Ue=D&&(oe==="Completed"||oe==="Error")||z&&(ie==="Completed"||ie==="Error")||!D&&!z?void 0:"disabled",Ge=c.useMemo(()=>ca(s.userRole),[s.userRole]),Le=ua(Ge),je=s?.rewardsLastViewedTime==null,Oe=h?.userEmail!=null&&H.fetchState==="Completed"&&fa(H.notificationSettings,h.userEmail,Z,s),re=_a(),ze=re&&Da(n),de=ma(Ne?.loggedInUserRoleMap),le=s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,M=c.useCallback(()=>w&&de&&!k.getTreasuryPopupSeen(t??"")&&le===!1&&va(n.pathname)!=="treasury",[w,de,le,n.pathname,t]),[Ye,ce]=c.useState(M);c.useEffect(()=>{ce(M())},[M]);const Ze=a(e=>e.treasurySetupViewState.treasuryFundsDetails).fundsDetails,He=$a(Ze);return N.jsx(xa,{container:window.document.body,variant:"temporary",open:f,onClose:()=>d(!1),PaperProps:{sx:{width:240,zIndex:8,borderRight:"none",backgroundImage:"none"}},ModalProps:{keepMounted:!0},children:N.jsx(Ba,{signedInUser:G,currentTenantId:$.currentTenantId??"",tenants:$.fetchState==="Completed"?ye:se!=null?[se]:[],currentTenant:s,isTenantDropdownDisabled:Ue,isSettings:me(n),isSettingsFeatureEnabled:Ce,isVendorsTabVisible:Le,isZeniAccountEnabled:Y,isChargeCardEnabled:ke,isTreasuryEnabled:w,treasuryYieldPercentage:He,isTreasuryPopupVisible:Ye,isNotificationsTabVisible:Oe,notificationCountDetails:Ve,isExpenseAutomationEnabledForUser:q&&ba(s.userRole)===!1,selectedMenu:fe(n),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:je,rewardsPlan:v.rewardsPlan},isAiCfoAccessEnabled:re,onNotificationIconClick:()=>{d(!1);let e=J===0&&K>0?"notifications/comments":"notifications/tasks";me(n)&&(e=J===0&&K>0?"../../notifications/comments":"../../notifications/tasks");const u=F(n.state?.pathnameStackToGoBack,n.pathname);o(e,{state:{pathnameStackToGoBack:u}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{d(!1);const e=F(n.state?.pathnameStackToGoBack,n.pathname);o("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMenuChange:e=>{if(d(!1),e.type==="ai_cfo"){const p=F(n.state?.pathnameStackToGoBack,n.pathname);return x.trackAICFOChatScreenStateChanged("viewed","left_menu",j??null,null),void o(`/${t}/ai-cfo/explore`,{state:{pathnameStackToGoBack:p,referrer:"Sidebar"}})}const u=F(n.state?.pathnameStackToGoBack,n.pathname),l=e.type,b=V(l)&&l!=="command_center";if(V(e.type)&&E[s.tenantId]!=null&&x.trackMonthEndCloseClicked(E[s.tenantId].month,E[s.tenantId].year,"Sidebar"),b&&E[s.tenantId]!=null){const p=E[s.tenantId];return void o(`/${t}/month_end_close_checks/review/${e.type}/${p.month}-${p.year}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})}const P=Ra(e.type);be(e.type)?(j!=null&&m(ga()),o(`/${t}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):o(`/${t}/${P}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})},handleMyProfileClick:()=>{d(!1),o(`/${t}/settings/my_profile`)},handleReferralsClick:()=>{d(!1),o(`/${t}/rewards`)},handleBackClick:()=>{o(`/${t}/dashboard`)},handleTenantSelect:e=>{ge(Ma.TENANT_SWITCHING),d(!1);const u=e.tenantEmailDomain,l=fe(n);let b=`/${encodeURIComponent(u)}/`;const P=V(l);l==="home"?b+="dashboard":l==="users_and_roles"?b+="people":Pa(l)?b+="settings/my_profile":be(l)?b+=`ai-cfo/${l}`:b+=l==="task_checklist"?"tasks":P?"month_end_close_checks/review":encodeURIComponent(l),o(b,{replace:!0}),h!=null&&(m(ha(e.tenantId)),m(Sa(h.userId,e.tenantId,h.zeniSessionId)));const p=e;x.trackCompanySwitch(p.companyId,p.companyName,p.userRole)},handlePopupClose:()=>{k.saveTreasuryPopupSeen(t??"",!0),ce(!1)},onZeniLogoClick:()=>{C.toggle()},isAiCfo:ze,aiCfoView:L,isOnDashboard:D,updateCurrentChatSessionId:e=>{m(pa({sessionId:e,agentId:"controller"})),o(`/${t}/ai-cfo/${e}`)},halloweenAnimationEnabled:we,isTaskManagerAccessEnabled:$e,thanksGivingAnimationEnabled:Fe,christmasAnimationEnabled:Ae,newYearAnimationEnabled:_e})})}),za=f=>{const d=pe(),t=a(C=>he(C)),n={events:t.userRoleId!=null?[`private-${t.userRoleId}.dashboard-user-notification`]:[],eventCallback:(C,o)=>{ka(o)&&Je(o.mode)==="dashboard"&&d(Se({unreadCount:o.data.unread},"tasks"))}};return N.jsx(Va,{...f,...n})};export{za as M};
1
+ import{j as N}from"./liveblocks-Cqbf2YvG.js";import{a as c}from"./sentry-gLPXz4Yq.js";import{h as pe,g as a,l as We,u as Xe,j as qe,i as R}from"./core-DZE88rLA.js";import{eM as he,eU as Je,eV as Se,eO as Ke,bm as Qe,f3 as ea,eW as aa,eX as ta,eZ as na,f1 as sa,fb as oa,f2 as g,f5 as ia,f6 as ue,f9 as ra,f7 as da,f8 as la,fa as ca,cF as ua,fd as fa,cL as ma,bu as ba,eL as pa,fi as ha,fj as Sa,fh as ga}from"./zeni-epic-state-Cc2P4FPR.js";import{a1 as Ea,a2 as ka,v as Ca,a as ya,z as k,a3 as Ia,u as Ta,i as r,a4 as wa,a5 as Fa,j as Aa,c as _a,a6 as Da,V as va,a7 as $a,a8 as Ba,a9 as fe,aa as me,L as Ma,ab as Pa,ac as be,d as x,r as F,ad as V,ae as Ra}from"./index-BET54Nt-.js";import{D as xa}from"./mui-B4xUUoCx.js";(function(){try{var f=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new f.Error().stack;d&&(f._sentryDebugIds=f._sentryDebugIds||{},f._sentryDebugIds[d]="58f4fb52-cba1-489e-960c-6deab30974c3",f._sentryDebugIdIdentifier="sentry-dbid-58f4fb52-cba1-489e-960c-6deab30974c3")}catch{}})();const Va=Ea(({isAppContentDrawerOpen:f,handleDrawerToggle:d})=>{const{tenantEmailDomain:t}=We(),n=Xe(),C=Ca(),o=qe(),U=Ke(),m=pe(),{useFeatureGate:i}=ya(),G=k.getSignedInUser(),A=Qe(G),s=a(e=>he(e)),L=a(e=>ea(e)),j=L.uiState.currentChatSessionId,y=Ia(),{setLoading:ge}=Ta(),[_,O]=c.useState(void 0),D=R("/:tenantEmailDomain/dashboard")!==null,z=R("/:tenantEmailDomain/reports")!==null,I=R("/:tenantEmailDomain/onboarding/*")!==null,{isFeatureEnabled:Y}=i(r.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Ee}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:Z}=i(r.isDebitCardFeatureEnabled),ke=wa(s,Ee,Z),{isFeatureEnabled:Ce}=i(r.isSettingsFeatureEnabled),H=a(e=>aa(e)),{isFeatureEnabled:T}=i(r.isReferralFeatureEnabled),v=a(e=>ta(e));c.useEffect(()=>{y&&T&&!I&&v.fetchState==="Not-Started"&&m(na(!0))},[y,T,v.fetchState,I]);const h=k.getSignedInUser(),$=a(e=>e.tenantState),ye=a(e=>$.fetchState==="Completed"?sa(e):[]),E=a(e=>e.expenseAutomationViewState.selectedPeriodByTenantId),{isFeatureEnabled:Ie}=i(r.isApAgingFeatureEnabled),{isFeatureEnabled:Te}=i(r.isArAgingFeatureEnabled),{isFeatureEnabled:W}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:X}=i(r.isExpenseAutomationEnabledV2),q=X||W&&A,{isFeatureEnabled:we}=i(r.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:Fe}=i(r.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:Ae}=i(r.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:_e}=i(r.isDashboardSidebarNewYearAnimationEnabled),{isFeatureEnabled:De}=i(r.isTreasuryEnabled),{isFeatureEnabled:ve}=i(r.isTaskManagerCustomerUserAccessEnabled),$e=A||!A&&ve,Be=s.company!=null&&oa(s.company),w=De&&Be,Me=a(e=>g(e).totalUnreadCount),Pe=a(e=>g(e).reducedFetchCountState),J=a(e=>g(e).notificationDetailsByTab.tasks.uiState.unreadCount),K=a(e=>g(e).notificationDetailsByTab.comments.uiState.unreadCount),Re=a(e=>g(e).notificationDetailsByTab.tasks.fetchCountState),B=a(e=>g(e).notificationDetailsByTab.comments.fetchCountState),{inboxNotifications:Q,isLoading:ee,isFetchingMore:ae,hasFetchedAll:te,fetchMore:xe}=Fa();c.useEffect(()=>{const e=setTimeout(()=>xe?.(),0);return()=>clearTimeout(e)}),c.useEffect(()=>{if(ee===!1&&ae===!1&&te===!0)if(s?.companyId!=null&&Q!=null){const e=`dashboard_${s.companyId}`;O(Q.filter(u=>u.roomId===e&&u.readAt==null).length)}else O(0)},[ee,ae,te]),c.useEffect(()=>{y&&!I&&Re.fetchState==="Not-Started"&&U.tenantId!=null&&m(ia("task_manager","dashboard"))},[y,U.tenantId]),c.useEffect(()=>{I||B.fetchState!=="Not-Started"||m(ue({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),c.useEffect(()=>{_!=null&&B.fetchState==="In-Progress"&&(m(ue({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),m(Se({unreadCount:_},"comments")))},[_,B.fetchState]);const Ve={fetchStatus:Pe,count:Me},ne=t!=null?k.getSignedInUserTenant(t):null,se=a(e=>ne?.tenantId!=null?ra(e,ne.tenantId):void 0),S=[];Ie===!1&&S.push("accounts_payable_aging"),Te===!1&&S.push("accounts_receivable_aging"),Y===!1&&S.push("zeni_accounts_promo_card"),T===!1&&S.push("rewards_card"),q===!1&&S.push("expense_automation_card");const Ne=Aa(),oe=a(e=>da(e,S,h,X,W,w).fetchState),ie=a(e=>la(e).fetchState),Ue=D&&(oe==="Completed"||oe==="Error")||z&&(ie==="Completed"||ie==="Error")||!D&&!z?void 0:"disabled",Ge=c.useMemo(()=>ca(s.userRole),[s.userRole]),Le=ua(Ge),je=s?.rewardsLastViewedTime==null,Oe=h?.userEmail!=null&&H.fetchState==="Completed"&&fa(H.notificationSettings,h.userEmail,Z,s),re=_a(),ze=re&&Da(n),de=ma(Ne?.loggedInUserRoleMap),le=s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,M=c.useCallback(()=>w&&de&&!k.getTreasuryPopupSeen(t??"")&&le===!1&&va(n.pathname)!=="treasury",[w,de,le,n.pathname,t]),[Ye,ce]=c.useState(M);c.useEffect(()=>{ce(M())},[M]);const Ze=a(e=>e.treasurySetupViewState.treasuryFundsDetails).fundsDetails,He=$a(Ze);return N.jsx(xa,{container:window.document.body,variant:"temporary",open:f,onClose:()=>d(!1),PaperProps:{sx:{width:240,zIndex:8,borderRight:"none",backgroundImage:"none"}},ModalProps:{keepMounted:!0},children:N.jsx(Ba,{signedInUser:G,currentTenantId:$.currentTenantId??"",tenants:$.fetchState==="Completed"?ye:se!=null?[se]:[],currentTenant:s,isTenantDropdownDisabled:Ue,isSettings:me(n),isSettingsFeatureEnabled:Ce,isVendorsTabVisible:Le,isZeniAccountEnabled:Y,isChargeCardEnabled:ke,isTreasuryEnabled:w,treasuryYieldPercentage:He,isTreasuryPopupVisible:Ye,isNotificationsTabVisible:Oe,notificationCountDetails:Ve,isExpenseAutomationEnabledForUser:q&&ba(s.userRole)===!1,selectedMenu:fe(n),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:je,rewardsPlan:v.rewardsPlan},isAiCfoAccessEnabled:re,onNotificationIconClick:()=>{d(!1);let e=J===0&&K>0?"notifications/comments":"notifications/tasks";me(n)&&(e=J===0&&K>0?"../../notifications/comments":"../../notifications/tasks");const u=F(n.state?.pathnameStackToGoBack,n.pathname);o(e,{state:{pathnameStackToGoBack:u}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{d(!1);const e=F(n.state?.pathnameStackToGoBack,n.pathname);o("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMenuChange:e=>{if(d(!1),e.type==="ai_cfo"){const p=F(n.state?.pathnameStackToGoBack,n.pathname);return x.trackAICFOChatScreenStateChanged("viewed","left_menu",j??null,null),void o(`/${t}/ai-cfo/explore`,{state:{pathnameStackToGoBack:p,referrer:"Sidebar"}})}const u=F(n.state?.pathnameStackToGoBack,n.pathname),l=e.type,b=V(l)&&l!=="command_center";if(V(e.type)&&E[s.tenantId]!=null&&x.trackMonthEndCloseClicked(E[s.tenantId].month,E[s.tenantId].year,"Sidebar"),b&&E[s.tenantId]!=null){const p=E[s.tenantId];return void o(`/${t}/month_end_close_checks/review/${e.type}/${p.month}-${p.year}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})}const P=Ra(e.type);be(e.type)?(j!=null&&m(ga()),o(`/${t}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):o(`/${t}/${P}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})},handleMyProfileClick:()=>{d(!1),o(`/${t}/settings/my_profile`)},handleReferralsClick:()=>{d(!1),o(`/${t}/rewards`)},handleBackClick:()=>{o(`/${t}/dashboard`)},handleTenantSelect:e=>{ge(Ma.TENANT_SWITCHING),d(!1);const u=e.tenantEmailDomain,l=fe(n);let b=`/${encodeURIComponent(u)}/`;const P=V(l);l==="home"?b+="dashboard":l==="users_and_roles"?b+="people":Pa(l)?b+="settings/my_profile":be(l)?b+=`ai-cfo/${l}`:b+=l==="task_checklist"?"tasks":P?"month_end_close_checks/review":encodeURIComponent(l),o(b,{replace:!0}),h!=null&&(m(ha(e.tenantId)),m(Sa(h.userId,e.tenantId,h.zeniSessionId)));const p=e;x.trackCompanySwitch(p.companyId,p.companyName,p.userRole)},handlePopupClose:()=>{k.saveTreasuryPopupSeen(t??"",!0),ce(!1)},onZeniLogoClick:()=>{C.toggle()},isAiCfo:ze,aiCfoView:L,isOnDashboard:D,updateCurrentChatSessionId:e=>{m(pa({sessionId:e,agentId:"controller"})),o(`/${t}/ai-cfo/${e}`)},halloweenAnimationEnabled:we,isTaskManagerAccessEnabled:$e,thanksGivingAnimationEnabled:Fe,christmasAnimationEnabled:Ae,newYearAnimationEnabled:_e})})}),za=f=>{const d=pe(),t=a(C=>he(C)),n={events:t.userRoleId!=null?[`private-${t.userRoleId}.dashboard-user-notification`]:[],eventCallback:(C,o)=>{ka(o)&&Je(o.mode)==="dashboard"&&d(Se({unreadCount:o.data.unread},"tasks"))}};return N.jsx(Va,{...f,...n})};export{za as M};
@@ -0,0 +1 @@
1
+ import{j as e}from"./liveblocks-Cqbf2YvG.js";import{j as r,k as i}from"./core-DZE88rLA.js";import{U as n}from"./index-BET54Nt-.js";import"./mui-B4xUUoCx.js";import"./sentry-gLPXz4Yq.js";import"./zeni-epic-state-Cc2P4FPR.js";import"./recharts-3_XOsuaw.js";import"./lottie-BMcMDJUW.js";import"./analytics-Cp5F-UjF.js";import"./plaid-G98kqTnM.js";import"./dnd-B4DEM2bW.js";import"./stripe-DMRn4zHo.js";import"./lexical-Bp_BNV6r.js";import"./pdf-DYKlsr3c.js";import"./utils-oW6HiHsc.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new o.Error().stack;t&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[t]="8569e781-4cca-432a-a9cb-bfb8f16b11e6",o._sentryDebugIdIdentifier="sentry-dbid-8569e781-4cca-432a-a9cb-bfb8f16b11e6")}catch{}})();const a=i(null,function(o,t){return{onGoBack:()=>{t.navigate(-1)},onGoHome:()=>{t.navigate("/")}}})(n);function h(){const o=r();return e.jsx(a,{navigate:o})}export{h as default};
@@ -1 +1 @@
1
- import{l as dt,a as lt,m as ft,j as _}from"./liveblocks-dlvb-ucF.js";import ut from"./NotFoundScreen-CNrR5P_G.js";import{a as k}from"./sentry-DGJ961LO.js";import{j as ht,u as pt,l as kt,h as gt,g as S,k as St,n as bt,o as H}from"./core-D85lL_9t.js";import{cn as It,eW as Q,eM as X,fa as Ct,f2 as b,Op as J,f6 as d,eV as y,q9 as $,vn as Tt,Oq as yt,eU as At,fd as Et,qe as _t,Or as F,bp as M,gy as w,qi as K,Os as Nt,cy as Bt,cs as xt}from"./zeni-epic-state-De57_V18.js";import{H as wt,z as Rt,a as Ut,i as vt,F as Dt,cn as Gt,r as N,a1 as Pt,co as Ft,a2 as Mt,p as $t}from"./index-eyGUyZ3T.js";import"./mui-C9WBrZQt.js";import{u as jt}from"./useAskAiCfoHostNavButtonProps-D7VmZhkv.js";import{c as Ot}from"./useFetchSuggestedQuestionsWhenReady-vh4emZ7O.js";import"./recharts-BYSqK3LX.js";import"./lottie-DGXsyyYr.js";import"./analytics-BAQwJULS.js";import"./plaid-BveLUCs7.js";import"./dnd-P1ekKsf6.js";import"./stripe-DMRn4zHo.js";import"./lexical-C7vBKQl2.js";import"./pdf-DebxFbW1.js";import"./utils-4E0JE-n2.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new t.Error().stack;l&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[l]="8e0b5e5d-c586-4535-b2ce-660a6358c9da",t._sentryDebugIdIdentifier="sentry-dbid-8e0b5e5d-c586-4535-b2ce-660a6358c9da")}catch{}})();const Vt=(t,l)=>new Promise((n,u)=>{const g=t.map(i=>new Promise(s=>{l(i),s()}));Promise.all(g).then(()=>{setTimeout(()=>{n()},2e3)}).catch(i=>{u(i)})}),qt=St(function(t,l){const n=Q(t),{signedInUser:u,isDebitCardFeatureEnabled:g}=l,i=b(t),s=X(t),{currentTab:h}=i;return{notificationView:i,isNotificationSettingsVisible:u.userEmail!=null&&Et(n.notificationSettings,u.userEmail,g,s),isDisabled:i.notificationDetailsByTab[h].fetchState==="In-Progress"?"disabled":void 0}},function(t,l){const{location:n,tenantEmailDomain:u,loggedInUserRoleMap:g,externalNotificationsUnreadCount:i,allUnreadCommentsNotificationIds:s,navigate:h,markInboxNotificationAsRead:B,fetchMoreCommentsNotifications:R}=l;return{onNotificationClick:(a,o,m,c)=>{if(c==="task_deleted"){const r=`/${u}/tasks`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}else{const r=`/${u}/tasks/${o}`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}m==="unread"&&t(K("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,m)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){m==="unread"&&(B(a),t(F([a],M())));let r=`/${u}/${c[1]}`;const I=N(n.state?.pathnameStackToGoBack,n.pathname);c[1].startsWith("reimbursement")&&!Bt(g)&&(r="not-found"),c[1].startsWith("bill")&&!xt(g)&&(r="not-found"),h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(a,o)=>{t(y(a,o))},onUpdateNotificationTabState:(a,o)=>{t(d(a,o))},onUpdateNotificationViewCurrentTabAndSubTab:(a,o)=>{t(J(a,o));const m=`../${a}`,c=N(n.state?.pathnameStackToGoBack,n.pathname);h(m,{state:{pathnameStackToGoBack:c}})},onUpdateNotificationViewSubTab:a=>{t(Nt(a))},onFetchMoreNotifications:(a,o)=>{if(a==="tasks"){const m=[];o==="all"?m.push("read","unread"):o!=="mentions"&&m.push(o),t($("task_manager","dashboard",m))}else R?.()},onUpdateNotificationStatus:(a,o,m,c)=>{a==="tasks"?t(K("task_manager",m,c)):(t(d({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(c.map(r=>{m==="read"&&(B(r),t(F([r],M())))})).then(()=>{t(d({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(y({unreadCount:i-c.length>0?i-c.length:0},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))},r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}).catch(r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onMarkAllNotificationsAsRead:a=>{a==="tasks"?t(_t("task_manager","read")):(t(d({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Vt(s,B).then(()=>{t(F(s,M())),t(d({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(y({unreadCount:0},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}).catch(o=>{t(d({markAsAllReadState:{fetchState:"Error",error:o}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onBackClick:()=>{const a=$t(n.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";h(o,{state:{pathnameStackToGoBack:a.newStack}})},onSettingsClick:()=>{const a=N(n.state?.pathnameStackToGoBack,n.pathname);h("../../settings/notifications",{state:{pathnameStackToGoBack:a}})}}})(Pt(Ft)),Wt=()=>{const t=ht(),l=pt(),{tenantEmailDomain:n,selectedTab:u}=kt(),{areTenantIdsInSync:g}=wt(),i=It(u??""),s=gt(),h=Rt.getSignedInUser(),[B,R]=k.useState(!1),a=S(e=>Q(e)),o=S(e=>X(e)),{useFeatureGate:m}=Ut(),{isFeatureEnabled:c}=m(vt.isDebitCardFeatureEnabled),{isAiCfoOpen:r,setIsAiCfoOpen:I}=Dt(),{isAiCfoAccessEnabled:Y,onAskAiCfoClick:Z}=jt({isAiCfoOpen:r,setIsAiCfoOpen:I,mobileExploreReferrer:"Notifications"});Ot({isDataReady:!0});const tt=Ct(o.userRole);if(o==null||n==null||o.companyId==null)throw Error("Can't access notifications page without current tenant...");if(h==null)throw Error("Can't access notifications page without signed in...");const j=S(e=>b(e).notificationDetailsByTab.tasks.fetchState),O=S(e=>b(e).currentTab),U=S(e=>b(e).currentSubTab),et=S(e=>b(e).notificationDetailsByTab.comments.fetchCountState),v=S(e=>b(e).notificationDetailsByTab.comments.fetchState),at=S(e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount),ot=S(e=>b(e).allExternalNotifications).filter(e=>e.inboxNotification.readAt==null).map(e=>e.inboxNotification.id),st=Gt().allUsers,{inboxNotifications:x,isLoading:A,hasFetchedAll:C,isFetchingMore:D,fetchMore:nt}=dt(),{threads:V,isLoading:q,fetchMore:W,isFetchingMore:z,hasFetchedAll:L}=lt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect(()=>{if(O!==i&&i!=null&&s(J(i)),i==null){const e=`../${O}`,p=N(l.state?.pathnameStackToGoBack,l.pathname);t(e,{state:{pathnameStackToGoBack:p}})}},[i]),k.useEffect(()=>{et.fetchState==="Not-Started"&&s(d({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),k.useEffect(()=>{if(A===!1&&C===!0&&o?.companyId!=null&&x!=null){const e=`dashboard_${o.companyId}`,p=x.filter(T=>T.roomId===e&&T.readAt==null).length;s(d({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),s(y({unreadCount:p},"comments"))}},[A,C]),k.useEffect(()=>{j!=="In-Progress"&&g&&s($("task_manager","dashboard",["read","unread"]))},[g]),k.useEffect(()=>{const e=setTimeout(()=>nt?.(),0);return()=>clearTimeout(e)});const G=A||D===!0||C!==!0||A||D===!0||C!==!0;k.useEffect(()=>{G&&v!=="In-Progress"?s(d({fetchState:"In-Progress",error:void 0},"comments")):G||v!=="In-Progress"||s(d({fetchState:"Completed",error:void 0},"comments"))},[G,v]),k.useEffect(()=>{s(y({hasMore:C!==!0},"comments"))},[C]),k.useEffect(()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&B===!1&&(R(!0),s(Tt()))},[a.fetchState]),k.useEffect(()=>{if(A===!1&&q===!1&&x!=null&&V!=null){const e=`dashboard_${o.companyId}`,p=x.filter(f=>f.roomId===e).filter(f=>f.kind==="thread"),T=p.filter(f=>f.readAt==null),E=p.map(f=>f.id),ct=p.map(f=>{const P=V.find(mt=>mt.id===f.threadId);return P!=null?{inboxNotification:{...f,threadId:P.id},thread:P}:(z||L===!0||W==null||W(),null)}).filter(f=>f!=null);s(d({allNotificationsIds:E},"comments")),s(y({totalCount:E.length,unreadCount:T.length},"comments")),s(yt(ct))}},[A,D,z,C,L,q,x?.length]);const it={events:o.userRoleId!=null?[`private-${o.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if(Mt(p)){const T=At(p.mode);if(T==="dashboard"&&s(y({unreadCount:p.data.unread},"tasks")),j!=="In-Progress"){const E=[];U==="all"?E.push("read","unread"):U!=="mentions"&&E.push(U),s($("task_manager",T,E,!0))}}}},rt=ft();return _.jsx(qt,{tenantEmailDomain:n,loggedInUserRoleMap:tt,signedInUser:h,externalNotificationsUnreadCount:at,location:l,navigate:t,isDebitCardFeatureEnabled:c,users:st,markInboxNotificationAsRead:rt,allUnreadCommentsNotificationIds:ot,isAiCfoAccessEnabled:Y,onAskAiCfoClick:Z,...it})};function me(){return _.jsxs(bt,{children:[_.jsx(H,{path:"/:selectedTab",element:_.jsx(Wt,{})}),_.jsx(H,{path:"*",element:_.jsx(ut,{})})]})}export{me as default};
1
+ import{l as dt,a as lt,m as ft,j as _}from"./liveblocks-Cqbf2YvG.js";import ut from"./NotFoundScreen-BM3DcBu4.js";import{a as k}from"./sentry-gLPXz4Yq.js";import{j as ht,u as pt,l as kt,h as gt,g as S,k as St,n as bt,o as H}from"./core-DZE88rLA.js";import{cn as It,eW as Q,eM as X,fa as Ct,f2 as b,Op as J,f6 as d,eV as y,q9 as $,vn as Tt,Oq as yt,eU as At,fd as Et,qe as _t,Or as F,bp as M,gy as w,qi as K,Os as Nt,cy as Bt,cs as xt}from"./zeni-epic-state-Cc2P4FPR.js";import{H as wt,z as Rt,a as Ut,i as vt,F as Dt,cn as Gt,r as N,a1 as Pt,co as Ft,a2 as Mt,p as $t}from"./index-BET54Nt-.js";import"./mui-B4xUUoCx.js";import{u as jt}from"./useAskAiCfoHostNavButtonProps-CIwJkrUG.js";import{c as Ot}from"./useFetchSuggestedQuestionsWhenReady-CZP4Iues.js";import"./recharts-3_XOsuaw.js";import"./lottie-BMcMDJUW.js";import"./analytics-Cp5F-UjF.js";import"./plaid-G98kqTnM.js";import"./dnd-B4DEM2bW.js";import"./stripe-DMRn4zHo.js";import"./lexical-Bp_BNV6r.js";import"./pdf-DYKlsr3c.js";import"./utils-oW6HiHsc.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new t.Error().stack;l&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[l]="8e0b5e5d-c586-4535-b2ce-660a6358c9da",t._sentryDebugIdIdentifier="sentry-dbid-8e0b5e5d-c586-4535-b2ce-660a6358c9da")}catch{}})();const Vt=(t,l)=>new Promise((n,u)=>{const g=t.map(i=>new Promise(s=>{l(i),s()}));Promise.all(g).then(()=>{setTimeout(()=>{n()},2e3)}).catch(i=>{u(i)})}),qt=St(function(t,l){const n=Q(t),{signedInUser:u,isDebitCardFeatureEnabled:g}=l,i=b(t),s=X(t),{currentTab:h}=i;return{notificationView:i,isNotificationSettingsVisible:u.userEmail!=null&&Et(n.notificationSettings,u.userEmail,g,s),isDisabled:i.notificationDetailsByTab[h].fetchState==="In-Progress"?"disabled":void 0}},function(t,l){const{location:n,tenantEmailDomain:u,loggedInUserRoleMap:g,externalNotificationsUnreadCount:i,allUnreadCommentsNotificationIds:s,navigate:h,markInboxNotificationAsRead:B,fetchMoreCommentsNotifications:R}=l;return{onNotificationClick:(a,o,m,c)=>{if(c==="task_deleted"){const r=`/${u}/tasks`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}else{const r=`/${u}/tasks/${o}`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}m==="unread"&&t(K("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,m)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){m==="unread"&&(B(a),t(F([a],M())));let r=`/${u}/${c[1]}`;const I=N(n.state?.pathnameStackToGoBack,n.pathname);c[1].startsWith("reimbursement")&&!Bt(g)&&(r="not-found"),c[1].startsWith("bill")&&!xt(g)&&(r="not-found"),h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(a,o)=>{t(y(a,o))},onUpdateNotificationTabState:(a,o)=>{t(d(a,o))},onUpdateNotificationViewCurrentTabAndSubTab:(a,o)=>{t(J(a,o));const m=`../${a}`,c=N(n.state?.pathnameStackToGoBack,n.pathname);h(m,{state:{pathnameStackToGoBack:c}})},onUpdateNotificationViewSubTab:a=>{t(Nt(a))},onFetchMoreNotifications:(a,o)=>{if(a==="tasks"){const m=[];o==="all"?m.push("read","unread"):o!=="mentions"&&m.push(o),t($("task_manager","dashboard",m))}else R?.()},onUpdateNotificationStatus:(a,o,m,c)=>{a==="tasks"?t(K("task_manager",m,c)):(t(d({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(c.map(r=>{m==="read"&&(B(r),t(F([r],M())))})).then(()=>{t(d({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(y({unreadCount:i-c.length>0?i-c.length:0},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))},r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}).catch(r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onMarkAllNotificationsAsRead:a=>{a==="tasks"?t(_t("task_manager","read")):(t(d({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Vt(s,B).then(()=>{t(F(s,M())),t(d({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(y({unreadCount:0},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}).catch(o=>{t(d({markAsAllReadState:{fetchState:"Error",error:o}},"comments")),t(w({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))}))},onBackClick:()=>{const a=$t(n.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";h(o,{state:{pathnameStackToGoBack:a.newStack}})},onSettingsClick:()=>{const a=N(n.state?.pathnameStackToGoBack,n.pathname);h("../../settings/notifications",{state:{pathnameStackToGoBack:a}})}}})(Pt(Ft)),Wt=()=>{const t=ht(),l=pt(),{tenantEmailDomain:n,selectedTab:u}=kt(),{areTenantIdsInSync:g}=wt(),i=It(u??""),s=gt(),h=Rt.getSignedInUser(),[B,R]=k.useState(!1),a=S(e=>Q(e)),o=S(e=>X(e)),{useFeatureGate:m}=Ut(),{isFeatureEnabled:c}=m(vt.isDebitCardFeatureEnabled),{isAiCfoOpen:r,setIsAiCfoOpen:I}=Dt(),{isAiCfoAccessEnabled:Y,onAskAiCfoClick:Z}=jt({isAiCfoOpen:r,setIsAiCfoOpen:I,mobileExploreReferrer:"Notifications"});Ot({isDataReady:!0});const tt=Ct(o.userRole);if(o==null||n==null||o.companyId==null)throw Error("Can't access notifications page without current tenant...");if(h==null)throw Error("Can't access notifications page without signed in...");const j=S(e=>b(e).notificationDetailsByTab.tasks.fetchState),O=S(e=>b(e).currentTab),U=S(e=>b(e).currentSubTab),et=S(e=>b(e).notificationDetailsByTab.comments.fetchCountState),v=S(e=>b(e).notificationDetailsByTab.comments.fetchState),at=S(e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount),ot=S(e=>b(e).allExternalNotifications).filter(e=>e.inboxNotification.readAt==null).map(e=>e.inboxNotification.id),st=Gt().allUsers,{inboxNotifications:x,isLoading:A,hasFetchedAll:C,isFetchingMore:D,fetchMore:nt}=dt(),{threads:V,isLoading:q,fetchMore:W,isFetchingMore:z,hasFetchedAll:L}=lt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect(()=>{if(O!==i&&i!=null&&s(J(i)),i==null){const e=`../${O}`,p=N(l.state?.pathnameStackToGoBack,l.pathname);t(e,{state:{pathnameStackToGoBack:p}})}},[i]),k.useEffect(()=>{et.fetchState==="Not-Started"&&s(d({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))},[]),k.useEffect(()=>{if(A===!1&&C===!0&&o?.companyId!=null&&x!=null){const e=`dashboard_${o.companyId}`,p=x.filter(T=>T.roomId===e&&T.readAt==null).length;s(d({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),s(y({unreadCount:p},"comments"))}},[A,C]),k.useEffect(()=>{j!=="In-Progress"&&g&&s($("task_manager","dashboard",["read","unread"]))},[g]),k.useEffect(()=>{const e=setTimeout(()=>nt?.(),0);return()=>clearTimeout(e)});const G=A||D===!0||C!==!0||A||D===!0||C!==!0;k.useEffect(()=>{G&&v!=="In-Progress"?s(d({fetchState:"In-Progress",error:void 0},"comments")):G||v!=="In-Progress"||s(d({fetchState:"Completed",error:void 0},"comments"))},[G,v]),k.useEffect(()=>{s(y({hasMore:C!==!0},"comments"))},[C]),k.useEffect(()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&B===!1&&(R(!0),s(Tt()))},[a.fetchState]),k.useEffect(()=>{if(A===!1&&q===!1&&x!=null&&V!=null){const e=`dashboard_${o.companyId}`,p=x.filter(f=>f.roomId===e).filter(f=>f.kind==="thread"),T=p.filter(f=>f.readAt==null),E=p.map(f=>f.id),ct=p.map(f=>{const P=V.find(mt=>mt.id===f.threadId);return P!=null?{inboxNotification:{...f,threadId:P.id},thread:P}:(z||L===!0||W==null||W(),null)}).filter(f=>f!=null);s(d({allNotificationsIds:E},"comments")),s(y({totalCount:E.length,unreadCount:T.length},"comments")),s(yt(ct))}},[A,D,z,C,L,q,x?.length]);const it={events:o.userRoleId!=null?[`private-${o.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if(Mt(p)){const T=At(p.mode);if(T==="dashboard"&&s(y({unreadCount:p.data.unread},"tasks")),j!=="In-Progress"){const E=[];U==="all"?E.push("read","unread"):U!=="mentions"&&E.push(U),s($("task_manager",T,E,!0))}}}},rt=ft();return _.jsx(qt,{tenantEmailDomain:n,loggedInUserRoleMap:tt,signedInUser:h,externalNotificationsUnreadCount:at,location:l,navigate:t,isDebitCardFeatureEnabled:c,users:st,markInboxNotificationAsRead:rt,allUnreadCommentsNotificationIds:ot,isAiCfoAccessEnabled:Y,onAskAiCfoClick:Z,...it})};function me(){return _.jsxs(bt,{children:[_.jsx(H,{path:"/:selectedTab",element:_.jsx(Wt,{})}),_.jsx(H,{path:"*",element:_.jsx(ut,{})})]})}export{me as default};
@@ -1 +1 @@
1
- import{j as n}from"./liveblocks-dlvb-ucF.js";import{j as Z,h as Q,u as J,l as K,g as d,k as X,n as ee,o as C}from"./core-D85lL_9t.js";import{eM as M,pZ as U,px as ae,IT as $,ps as S,bu as te,bm as se,bQ as oe,pt as re,IU as ne,IE as T,dF as ie,tk as ce,IV as le,tH as de,eT as me,eR as fe}from"./zeni-epic-state-De57_V18.js";import{F as pe,z as ue,H as he,j as Fe,a as w,i as B,w as ge,d as G,aj as Ie,r as be}from"./index-eyGUyZ3T.js";import"./mui-C9WBrZQt.js";import Ce from"./NotFoundScreen-CNrR5P_G.js";import{F as Te}from"./FeaturePreviewScreen-CHkVgg1G.js";import{a as h}from"./sentry-DGJ961LO.js";import{u as Se}from"./useAskAiCfoHostNavButtonProps-D7VmZhkv.js";import{c as ye}from"./useFetchSuggestedQuestionsWhenReady-vh4emZ7O.js";import{u as Ae}from"./useInitialThreadRequest-CdZgxQMw.js";import{t as ke}from"./routePaths-Ckqdpqo6.js";import{M as xe}from"./MobileAppDrawer-Cq6umKbp.js";import"./recharts-BYSqK3LX.js";import"./lottie-DGXsyyYr.js";import"./analytics-BAQwJULS.js";import"./plaid-BveLUCs7.js";import"./dnd-P1ekKsf6.js";import"./stripe-DMRn4zHo.js";import"./lexical-C7vBKQl2.js";import"./pdf-DebxFbW1.js";import"./utils-4E0JE-n2.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new s.Error().stack;a&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[a]="40192153-75cb-465b-9dec-64f334568604",s._sentryDebugIdIdentifier="sentry-dbid-40192153-75cb-465b-9dec-64f334568604")}catch{}})();const y=(s,a,e,o)=>{if(s!=a){const r=o||"";s!=null&&s.length>0?e(`../${a}${r}`,{replace:!0}):e(`${a}${r}`,{replace:!0})}},je=X(function(s){const a=ne(s),e={},o=a.pandLReportWithForecast.uiState.nodeCollapseState;return Object.keys(o).forEach(r=>{e[r]=o[r]===!1}),{selectedTimeframe:a.selectedTimeframe,isForecastVsActualOn:a.isForecastVsActualOn,compareMode:a.compareMode,forecastList:a.forecastList,selectedForecast:a.selectedForecast,pandLreport:a.pandLReportWithForecast,scrollPosition:a.pandLReportWithForecast.uiState.scrollPosition,nodeOpenStatus:e,type:"name+balances_forecast",analytics:G}},function(s,a){return{onForecastSelectionChanged:(e,o)=>{s($(e,o)),a.isPandLReportFetched(e)||s(S(e)),y(a.forecastIdFromUrlPath,e,a.navigate)},onTimeframeChanged:e=>{s(de(e))},onForecastVsActualsCompareToggle:e=>{s(le(e)),s(T({forecastId:a.forecastIdFromUrlPath,scrollPosition:{scrollLeft:0,scrollTop:0}}))},onCompareModeChanged:e=>{s(ce(a.firstMonthOfFY,e,0,[]))},onAccountBalanceClick:a.hasTransactionAccess!==!0?void 0:(e,o)=>{let r,i;const F=e.accountName===""?e.accountDescription:e.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(r=o.balanceTimeFrame,i=ie(o)):o.balanceTimeFrame==="year"?(r="quarter",i={startDate:o.endDate.startOf("quarter"),endDate:o.endDate}):console.error(`timeframe ${o.balanceTimeFrame} is not supported`),i!=null&&r!=null){const f=ke(a.tenantEmailDomain,e.accountId,e.accountType,F,r,i),p=be(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(f,{state:{pathnameStackToGoBack:p,referrer:"Forecast"}})}},onNodeCollapseToggled:(e,o)=>{s(T({forecastId:a.forecastIdFromUrlPath,nodeCollapseState:{nodeId:e,isCollapsed:o===!1}}))},onTableScroll:e=>{s(T({forecastId:a.forecastIdFromUrlPath,scrollPosition:e}))},onBackClick:()=>{a.navigate("../../")}}})(Ie);function v(){const{isAiCfoOpen:s,setIsAiCfoOpen:a}=pe(),e=Z(),o=Q(),r=J(),{forecastId:i,tenantEmailDomain:F}=K(),[f,p]=h.useState(!1),[g,A]=h.useState(!1),u=ue.getSignedInUser(),k=d(t=>M(t)),N=k.company?.companyInfo.firstMonthOfFY??1,c=d(t=>U(t.forecastState,t.forecastListState)),l=d(t=>t.forecastListState.fetchState==="Completed"),x=d(t=>t.profitAndLossState),j=d(t=>t.reportUIOptionsState.selectedForecast),D=t=>x.pandLByForecastID[t]!=null&&re(t,x).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:I}=he();ye({isDataReady:l});const{isAiCfoAccessEnabled:_,onAskAiCfoClick:q}=Se({isAiCfoOpen:s,setIsAiCfoOpen:a,mobileExploreReferrer:"Forecast"});h.useEffect(()=>{if(!f&&I)p(!0),l||o(ae());else if(l&&!g){A(!0);const t=((m,R,P)=>R!=null?m.forecasts.findIndex(b=>b.id===R):P!=null?m.forecasts.findIndex(b=>b.id===P):m.forecasts.length>0?0:-1)(c,i,j?.id);t===-1&&i!=null?e("page-not-found",{replace:!0}):t!==-1&&t!=j?.index?(o($(c.forecasts[t].id,t)),y(i,c.forecasts[t].id,e,r.search)):i==null&&t!==-1&&y(void 0,c.forecasts[t].id,e,r.search),t!==-1&&!D(c.forecasts[t].id)&&I&&o(S(c.forecasts[t].id))}},[f,p,o,l,c,g,A,U,S,I]);const E=Fe(),V=E?.loggedInUserRole!=null&&te(E.loggedInUserRole),{useFeatureGate:W}=w(),{isFeatureEnabled:L}=W(B.isReportsCommentingEnabled),Y=Ae(L?k?.companyId:void 0,{clearParams:l&&g}),[z,H]=h.useState(!1),O=t=>{H(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(ge,{analytics:G,onLoad:t=>(m=>m.trackForecast())(t)}):null,n.jsx(xe,{isAppContentDrawerOpen:z,handleDrawerToggle:O}),n.jsx(je,{firstMonthOfFY:N,tenantEmailDomain:F,forecastIdFromUrlPath:i,navigate:e,location:r,isPandLReportFetched:D,meetingUrl:oe(`https://meetings.hubspot.com/svitlana-grankovska?firstname=${u?.firstName}&lastname=${u?.lastName}&email=${u?.userEmail}`),hasTransactionAccess:V,isAiCfoAccessEnabled:_,onAskAiCfoClick:q,isReportsCommentingEnabled:L,isZeniUser:se(u),initialOpenThreadRequest:Y,onClickMenuIcon:()=>{O(!0)}})]})}function Qe(){const s=d(i=>M(i)),{useFeatureGate:a}=w(),{isFeatureEnabled:e}=a(B.isDebitCardFeatureEnabled),o=me(e,s),r=fe(s);return o===!0||r===!0?n.jsx(Te,{}):n.jsxs(ee,{children:[n.jsx(C,{path:"/",element:n.jsx(v,{})}),n.jsx(C,{path:"/:forecastId",element:n.jsx(v,{})}),n.jsx(C,{path:"/:forecastId/*",element:n.jsx(Ce,{})})]})}export{Qe as PandLWithForecastRoutes,Qe as default};
1
+ import{j as n}from"./liveblocks-Cqbf2YvG.js";import{j as Z,h as Q,u as J,l as K,g as d,k as X,n as ee,o as C}from"./core-DZE88rLA.js";import{eM as M,pZ as U,px as ae,IT as $,ps as S,bu as te,bm as se,bQ as oe,pt as re,IU as ne,IE as T,dF as ie,tk as ce,IV as le,tH as de,eT as me,eR as fe}from"./zeni-epic-state-Cc2P4FPR.js";import{F as pe,z as ue,H as he,j as Fe,a as w,i as B,w as ge,d as G,aj as Ie,r as be}from"./index-BET54Nt-.js";import"./mui-B4xUUoCx.js";import Ce from"./NotFoundScreen-BM3DcBu4.js";import{F as Te}from"./FeaturePreviewScreen-3Cs41rNa.js";import{a as h}from"./sentry-gLPXz4Yq.js";import{u as Se}from"./useAskAiCfoHostNavButtonProps-CIwJkrUG.js";import{c as ye}from"./useFetchSuggestedQuestionsWhenReady-CZP4Iues.js";import{u as Ae}from"./useInitialThreadRequest-DFJpueCY.js";import{t as ke}from"./routePaths-BNouI24c.js";import{M as xe}from"./MobileAppDrawer-D0-D1IIa.js";import"./recharts-3_XOsuaw.js";import"./lottie-BMcMDJUW.js";import"./analytics-Cp5F-UjF.js";import"./plaid-G98kqTnM.js";import"./dnd-B4DEM2bW.js";import"./stripe-DMRn4zHo.js";import"./lexical-Bp_BNV6r.js";import"./pdf-DYKlsr3c.js";import"./utils-oW6HiHsc.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new s.Error().stack;a&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[a]="40192153-75cb-465b-9dec-64f334568604",s._sentryDebugIdIdentifier="sentry-dbid-40192153-75cb-465b-9dec-64f334568604")}catch{}})();const y=(s,a,e,o)=>{if(s!=a){const r=o||"";s!=null&&s.length>0?e(`../${a}${r}`,{replace:!0}):e(`${a}${r}`,{replace:!0})}},je=X(function(s){const a=ne(s),e={},o=a.pandLReportWithForecast.uiState.nodeCollapseState;return Object.keys(o).forEach(r=>{e[r]=o[r]===!1}),{selectedTimeframe:a.selectedTimeframe,isForecastVsActualOn:a.isForecastVsActualOn,compareMode:a.compareMode,forecastList:a.forecastList,selectedForecast:a.selectedForecast,pandLreport:a.pandLReportWithForecast,scrollPosition:a.pandLReportWithForecast.uiState.scrollPosition,nodeOpenStatus:e,type:"name+balances_forecast",analytics:G}},function(s,a){return{onForecastSelectionChanged:(e,o)=>{s($(e,o)),a.isPandLReportFetched(e)||s(S(e)),y(a.forecastIdFromUrlPath,e,a.navigate)},onTimeframeChanged:e=>{s(de(e))},onForecastVsActualsCompareToggle:e=>{s(le(e)),s(T({forecastId:a.forecastIdFromUrlPath,scrollPosition:{scrollLeft:0,scrollTop:0}}))},onCompareModeChanged:e=>{s(ce(a.firstMonthOfFY,e,0,[]))},onAccountBalanceClick:a.hasTransactionAccess!==!0?void 0:(e,o)=>{let r,i;const F=e.accountName===""?e.accountDescription:e.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(r=o.balanceTimeFrame,i=ie(o)):o.balanceTimeFrame==="year"?(r="quarter",i={startDate:o.endDate.startOf("quarter"),endDate:o.endDate}):console.error(`timeframe ${o.balanceTimeFrame} is not supported`),i!=null&&r!=null){const f=ke(a.tenantEmailDomain,e.accountId,e.accountType,F,r,i),p=be(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(f,{state:{pathnameStackToGoBack:p,referrer:"Forecast"}})}},onNodeCollapseToggled:(e,o)=>{s(T({forecastId:a.forecastIdFromUrlPath,nodeCollapseState:{nodeId:e,isCollapsed:o===!1}}))},onTableScroll:e=>{s(T({forecastId:a.forecastIdFromUrlPath,scrollPosition:e}))},onBackClick:()=>{a.navigate("../../")}}})(Ie);function v(){const{isAiCfoOpen:s,setIsAiCfoOpen:a}=pe(),e=Z(),o=Q(),r=J(),{forecastId:i,tenantEmailDomain:F}=K(),[f,p]=h.useState(!1),[g,A]=h.useState(!1),u=ue.getSignedInUser(),k=d(t=>M(t)),N=k.company?.companyInfo.firstMonthOfFY??1,c=d(t=>U(t.forecastState,t.forecastListState)),l=d(t=>t.forecastListState.fetchState==="Completed"),x=d(t=>t.profitAndLossState),j=d(t=>t.reportUIOptionsState.selectedForecast),D=t=>x.pandLByForecastID[t]!=null&&re(t,x).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:I}=he();ye({isDataReady:l});const{isAiCfoAccessEnabled:_,onAskAiCfoClick:q}=Se({isAiCfoOpen:s,setIsAiCfoOpen:a,mobileExploreReferrer:"Forecast"});h.useEffect(()=>{if(!f&&I)p(!0),l||o(ae());else if(l&&!g){A(!0);const t=((m,R,P)=>R!=null?m.forecasts.findIndex(b=>b.id===R):P!=null?m.forecasts.findIndex(b=>b.id===P):m.forecasts.length>0?0:-1)(c,i,j?.id);t===-1&&i!=null?e("page-not-found",{replace:!0}):t!==-1&&t!=j?.index?(o($(c.forecasts[t].id,t)),y(i,c.forecasts[t].id,e,r.search)):i==null&&t!==-1&&y(void 0,c.forecasts[t].id,e,r.search),t!==-1&&!D(c.forecasts[t].id)&&I&&o(S(c.forecasts[t].id))}},[f,p,o,l,c,g,A,U,S,I]);const E=Fe(),V=E?.loggedInUserRole!=null&&te(E.loggedInUserRole),{useFeatureGate:W}=w(),{isFeatureEnabled:L}=W(B.isReportsCommentingEnabled),Y=Ae(L?k?.companyId:void 0,{clearParams:l&&g}),[z,H]=h.useState(!1),O=t=>{H(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(ge,{analytics:G,onLoad:t=>(m=>m.trackForecast())(t)}):null,n.jsx(xe,{isAppContentDrawerOpen:z,handleDrawerToggle:O}),n.jsx(je,{firstMonthOfFY:N,tenantEmailDomain:F,forecastIdFromUrlPath:i,navigate:e,location:r,isPandLReportFetched:D,meetingUrl:oe(`https://meetings.hubspot.com/svitlana-grankovska?firstname=${u?.firstName}&lastname=${u?.lastName}&email=${u?.userEmail}`),hasTransactionAccess:V,isAiCfoAccessEnabled:_,onAskAiCfoClick:q,isReportsCommentingEnabled:L,isZeniUser:se(u),initialOpenThreadRequest:Y,onClickMenuIcon:()=>{O(!0)}})]})}function Qe(){const s=d(i=>M(i)),{useFeatureGate:a}=w(),{isFeatureEnabled:e}=a(B.isDebitCardFeatureEnabled),o=me(e,s),r=fe(s);return o===!0||r===!0?n.jsx(Te,{}):n.jsxs(ee,{children:[n.jsx(C,{path:"/",element:n.jsx(v,{})}),n.jsx(C,{path:"/:forecastId",element:n.jsx(v,{})}),n.jsx(C,{path:"/:forecastId/*",element:n.jsx(Ce,{})})]})}export{Qe as PandLWithForecastRoutes,Qe as default};
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-dlvb-ucF.js";import{IO as oe,eM as q,j8 as M,eT as J,eR as ie,Gm as Y,Iq as re,ss as ke,IP as X,sg as Pe,sB as je,sv as le,sk as de,sz as Te,sw as Le,IQ as ce,u6 as ve,IR as Ae,fx as Fe,IS as _,sp as pe,sn as ue,sE as Oe,b$ as Re}from"./zeni-epic-state-De57_V18.js";import{Z as me,a as ee,i as E,z as W,a4 as ge,A as he,af as fe,ag as Ve,x as Ce,o as F,C as be,D as ye,ah as Ue,H as Be,F as Ze,w as $e,d as we,f as ze,r as _e,ai as Ge,j as He}from"./index-eyGUyZ3T.js";import{D as Se,n as K,S as De}from"./mui-C9WBrZQt.js";import te from"./NotFoundScreen-CNrR5P_G.js";import{a as l}from"./sentry-DGJ961LO.js";import{h as se,l as Me,g,j as We,u as Ke,k as Qe,n as ne,o as z}from"./core-D85lL_9t.js";import{u as Ne}from"./useAskAiCfoHostNavButtonProps-D7VmZhkv.js";import{c as Xe}from"./useFetchSuggestedQuestionsWhenReady-vh4emZ7O.js";import{M as qe}from"./MobileAppDrawer-Cq6umKbp.js";import"./recharts-BYSqK3LX.js";import"./lottie-DGXsyyYr.js";import"./analytics-BAQwJULS.js";import"./plaid-BveLUCs7.js";import"./dnd-P1ekKsf6.js";import"./stripe-DMRn4zHo.js";import"./lexical-C7vBKQl2.js";import"./pdf-DebxFbW1.js";import"./utils-4E0JE-n2.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="e0a2a378-7c47-4625-a463-7703357d4858",e._sentryDebugIdIdentifier="sentry-dbid-e0a2a378-7c47-4625-a463-7703357d4858")}catch{}})();const Je={overlayWidth:new Ce(100,100,48)},G=ye.getLocalizedStrings().peoplePage.invitePage,Ye=({companyId:e,managersListView:n,companyPassportView:d,classListView:o,mode:h,isEditPeopleDrawerOpen:i,closeDrawerHandler:y})=>{const f=me(),u=se(),[O,R]=l.useState(!1),[k,w]=l.useState(!1),{userId:S}=Me(),c=g(t=>oe(t)),m=g(t=>q(t)),D=g(t=>M(t)),{useFeatureGate:C}=ee(),{isFeatureEnabled:I}=C(E.isDebitCardFeatureEnabled),P=J(I,m),L=ie(m),v=Y(m),V=re(m),U=!!m.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!P&&D&&o.fetchState!=="Completed"||n.fetchState!=="Completed"||d.fetchState!=="Completed"||e==null;if(W.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const b=()=>{u(X()),y()},A=()=>{O===!0?w(!0):b()},B=d.companyView?.controllers?.map(t=>t.user),{isFeatureEnabled:Z}=C(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:$}=C(E.isChargeCardFeatureEnabled),p=ge(m,$,I),{isFeatureEnabled:j}=C(E.isTreasuryEnabled),T={peopleDetails:c,classList:o.classes,managersList:n.users,controllersList:B,mode:h,isZeniTenant:v,isAccountingClassesEnabled:D,isReimbursementDisabled:U===!1,isZeniAccountsDisabled:Z===!1,isChargeCardDisabled:p===!1,isTreasuryDisabled:j===!1,isLiteRoleDisabled:V===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:L,onResetClick:b,onDeleteUser:t=>{u(de(t.userId,t.userRole.userRoleId))},onPeopleLocalDataUpdated:t=>{u(le({peopleLocalData:t})),R(!0)},onSaveClick:()=>{u(h==="zeni_only"?Pe(e):je(v))},onCloseClick:A,isLoading:x||c.person==null},r={onOkClick:()=>{w(!1),b()},onCancelClick:()=>{w(!1)}};return l.useEffect(()=>{x===!1&&S!=null&&u(ke(S))},[x,S]),l.useEffect(()=>{c.updatePersonState.fetchState==="Completed"&&b()},[c.updatePersonState.fetchState]),s.jsx(Se,{anchor:"right",open:i,PaperProps:{style:{width:Je.overlayWidth.valuePercentage(f),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:he.overlayDark,cursor:"pointer"}}},onClose:A,children:s.jsxs(es,{onClick:t=>t.stopPropagation(),children:[k===!0?s.jsx(fe,{titleComponent:s.jsx(xe,{children:G.discardTitle}),descriptionComponent:s.jsx(Ee,{children:G.discardDescription}),primaryButtonText:G.discard,secondaryButtonText:G.no,action:r,isEditPopup:!0}):null,s.jsx(Ve,{...T})]})})},es=K(De)`
1
+ import{j as s}from"./liveblocks-Cqbf2YvG.js";import{IO as oe,eM as q,j8 as M,eT as J,eR as ie,Gm as Y,Iq as re,ss as ke,IP as X,sg as Pe,sB as je,sv as le,sk as de,sz as Te,sw as Le,IQ as ce,u6 as ve,IR as Ae,fx as Fe,IS as _,sp as pe,sn as ue,sE as Oe,b$ as Re}from"./zeni-epic-state-Cc2P4FPR.js";import{Z as me,a as ee,i as E,z as W,a4 as ge,A as he,af as fe,ag as Ve,x as Ce,o as F,C as be,D as ye,ah as Ue,H as Be,F as Ze,w as $e,d as we,f as ze,r as _e,ai as Ge,j as He}from"./index-BET54Nt-.js";import{D as Se,n as K,S as De}from"./mui-B4xUUoCx.js";import te from"./NotFoundScreen-BM3DcBu4.js";import{a as l}from"./sentry-gLPXz4Yq.js";import{h as se,l as Me,g,j as We,u as Ke,k as Qe,n as ne,o as z}from"./core-DZE88rLA.js";import{u as Ne}from"./useAskAiCfoHostNavButtonProps-CIwJkrUG.js";import{c as Xe}from"./useFetchSuggestedQuestionsWhenReady-CZP4Iues.js";import{M as qe}from"./MobileAppDrawer-D0-D1IIa.js";import"./recharts-3_XOsuaw.js";import"./lottie-BMcMDJUW.js";import"./analytics-Cp5F-UjF.js";import"./plaid-G98kqTnM.js";import"./dnd-B4DEM2bW.js";import"./stripe-DMRn4zHo.js";import"./lexical-Bp_BNV6r.js";import"./pdf-DYKlsr3c.js";import"./utils-oW6HiHsc.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="e0a2a378-7c47-4625-a463-7703357d4858",e._sentryDebugIdIdentifier="sentry-dbid-e0a2a378-7c47-4625-a463-7703357d4858")}catch{}})();const Je={overlayWidth:new Ce(100,100,48)},G=ye.getLocalizedStrings().peoplePage.invitePage,Ye=({companyId:e,managersListView:n,companyPassportView:d,classListView:o,mode:h,isEditPeopleDrawerOpen:i,closeDrawerHandler:y})=>{const f=me(),u=se(),[O,R]=l.useState(!1),[k,w]=l.useState(!1),{userId:S}=Me(),c=g(t=>oe(t)),m=g(t=>q(t)),D=g(t=>M(t)),{useFeatureGate:C}=ee(),{isFeatureEnabled:I}=C(E.isDebitCardFeatureEnabled),P=J(I,m),L=ie(m),v=Y(m),V=re(m),U=!!m.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!P&&D&&o.fetchState!=="Completed"||n.fetchState!=="Completed"||d.fetchState!=="Completed"||e==null;if(W.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const b=()=>{u(X()),y()},A=()=>{O===!0?w(!0):b()},B=d.companyView?.controllers?.map(t=>t.user),{isFeatureEnabled:Z}=C(E.isDepositAccountsFeatureEnabled),{isFeatureEnabled:$}=C(E.isChargeCardFeatureEnabled),p=ge(m,$,I),{isFeatureEnabled:j}=C(E.isTreasuryEnabled),T={peopleDetails:c,classList:o.classes,managersList:n.users,controllersList:B,mode:h,isZeniTenant:v,isAccountingClassesEnabled:D,isReimbursementDisabled:U===!1,isZeniAccountsDisabled:Z===!1,isChargeCardDisabled:p===!1,isTreasuryDisabled:j===!1,isLiteRoleDisabled:V===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:L,onResetClick:b,onDeleteUser:t=>{u(de(t.userId,t.userRole.userRoleId))},onPeopleLocalDataUpdated:t=>{u(le({peopleLocalData:t})),R(!0)},onSaveClick:()=>{u(h==="zeni_only"?Pe(e):je(v))},onCloseClick:A,isLoading:x||c.person==null},r={onOkClick:()=>{w(!1),b()},onCancelClick:()=>{w(!1)}};return l.useEffect(()=>{x===!1&&S!=null&&u(ke(S))},[x,S]),l.useEffect(()=>{c.updatePersonState.fetchState==="Completed"&&b()},[c.updatePersonState.fetchState]),s.jsx(Se,{anchor:"right",open:i,PaperProps:{style:{width:Je.overlayWidth.valuePercentage(f),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:he.overlayDark,cursor:"pointer"}}},onClose:A,children:s.jsxs(es,{onClick:t=>t.stopPropagation(),children:[k===!0?s.jsx(fe,{titleComponent:s.jsx(xe,{children:G.discardTitle}),descriptionComponent:s.jsx(Ee,{children:G.discardDescription}),primaryButtonText:G.discard,secondaryButtonText:G.no,action:r,isEditPopup:!0}):null,s.jsx(Ve,{...T})]})})},es=K(De)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
@@ -1 +1 @@
1
- import{j as a}from"./liveblocks-dlvb-ucF.js";import _ from"./NotFoundScreen-CNrR5P_G.js";import{a as r}from"./sentry-DGJ961LO.js";import{j as v,u as M,g as u,l as U,h as P,N as z,k as F,n as V,o as h}from"./core-D85lL_9t.js";import{eM as B,Ot as b,bn as N,bm as Q,gQ as H,gy as $}from"./zeni-epic-state-De57_V18.js";import{v as q,z as I,F as G,cp as J}from"./index-eyGUyZ3T.js";import"./mui-C9WBrZQt.js";import{u as K}from"./useAskAiCfoHostNavButtonProps-D7VmZhkv.js";import{c as L}from"./useFetchSuggestedQuestionsWhenReady-vh4emZ7O.js";import{M as W}from"./MobileAppDrawer-Cq6umKbp.js";import"./recharts-BYSqK3LX.js";import"./lottie-DGXsyyYr.js";import"./analytics-BAQwJULS.js";import"./plaid-BveLUCs7.js";import"./dnd-P1ekKsf6.js";import"./stripe-DMRn4zHo.js";import"./lexical-C7vBKQl2.js";import"./pdf-DebxFbW1.js";import"./utils-4E0JE-n2.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]="903ebf83-633e-409b-9234-0fddc1a2f767",e._sentryDebugIdIdentifier="sentry-dbid-903ebf83-633e-409b-9234-0fddc1a2f767")}catch{}})();const X=F(function(e){const t=I.getSignedInUser(),c=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:c??""},{aggregatedReportViewState:n}=b(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}},function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}})(J),Y=()=>{const e=v(),t=M(),c=q(),o=u(s=>B(s)),{aggregatedReportViewState:n}=u(s=>b(s)),{tenantEmailDomain:m}=U(),p=P(),l=I.getSignedInUser();if(l==null)throw new Error("Can't access this page without signing in...");const f=r.useRef(!1),[C,S]=r.useState(!1),k=N(o?.userRole??[]),w=o?.userRole?.includes("bookkeeping_admin")??!1,y=Q(l),A=k||w||y,d=r.useCallback((s,i,O)=>{p(H({fromMonth:s,toMonth:i,cacheOverride:O}))},[]);r.useEffect(()=>{n?.fetchState==="Completed"&&f.current&&(p($({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),f.current=!1)},[n?.fetchState]);const D=r.useCallback((s,i)=>{n!=null&&n?.fetchState==="In-Progress"||d(s,i,!0),f.current=!0},[n?.fetchState,d]),x=r.useCallback((s,i)=>{d(s,i,!1)},[d]),g=s=>{S(s)},{isAiCfoOpen:j,setIsAiCfoOpen:R}=G(),{isAiCfoAccessEnabled:T,onAskAiCfoClick:E}=K({isAiCfoOpen:j,setIsAiCfoOpen:R,mobileExploreReferrer:"Performance"});return L({isDataReady:n?.fetchState==="Completed"}),A?a.jsxs(a.Fragment,{children:[a.jsx(W,{isAppContentDrawerOpen:C,handleDrawerToggle:g}),a.jsx(X,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:l,tenantEmailDomain:m,onReload:D,onTimeRangeSelect:x,handleDrawerToggle:g,isAiCfoAccessEnabled:T,onAskAiCfoClick:E})]}):a.jsx(z,{to:`/${m}/dashboard`,replace:!0})};function Ie(){return a.jsxs(V,{children:[a.jsx(h,{path:"*",element:a.jsx(Y,{})}),a.jsx(h,{path:"*",element:a.jsx(_,{})})]})}export{Ie as default};
1
+ import{j as a}from"./liveblocks-Cqbf2YvG.js";import _ from"./NotFoundScreen-BM3DcBu4.js";import{a as r}from"./sentry-gLPXz4Yq.js";import{j as v,u as M,g as u,l as U,h as P,N as z,k as F,n as V,o as h}from"./core-DZE88rLA.js";import{eM as B,Ot as b,bn as N,bm as Q,gQ as H,gy as $}from"./zeni-epic-state-Cc2P4FPR.js";import{v as q,z as I,F as G,cp as J}from"./index-BET54Nt-.js";import"./mui-B4xUUoCx.js";import{u as K}from"./useAskAiCfoHostNavButtonProps-CIwJkrUG.js";import{c as L}from"./useFetchSuggestedQuestionsWhenReady-CZP4Iues.js";import{M as W}from"./MobileAppDrawer-D0-D1IIa.js";import"./recharts-3_XOsuaw.js";import"./lottie-BMcMDJUW.js";import"./analytics-Cp5F-UjF.js";import"./plaid-G98kqTnM.js";import"./dnd-B4DEM2bW.js";import"./stripe-DMRn4zHo.js";import"./lexical-Bp_BNV6r.js";import"./pdf-DYKlsr3c.js";import"./utils-oW6HiHsc.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]="903ebf83-633e-409b-9234-0fddc1a2f767",e._sentryDebugIdIdentifier="sentry-dbid-903ebf83-633e-409b-9234-0fddc1a2f767")}catch{}})();const X=F(function(e){const t=I.getSignedInUser(),c=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:c??""},{aggregatedReportViewState:n}=b(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}},function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}})(J),Y=()=>{const e=v(),t=M(),c=q(),o=u(s=>B(s)),{aggregatedReportViewState:n}=u(s=>b(s)),{tenantEmailDomain:m}=U(),p=P(),l=I.getSignedInUser();if(l==null)throw new Error("Can't access this page without signing in...");const f=r.useRef(!1),[C,S]=r.useState(!1),k=N(o?.userRole??[]),w=o?.userRole?.includes("bookkeeping_admin")??!1,y=Q(l),A=k||w||y,d=r.useCallback((s,i,O)=>{p(H({fromMonth:s,toMonth:i,cacheOverride:O}))},[]);r.useEffect(()=>{n?.fetchState==="Completed"&&f.current&&(p($({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),f.current=!1)},[n?.fetchState]);const D=r.useCallback((s,i)=>{n!=null&&n?.fetchState==="In-Progress"||d(s,i,!0),f.current=!0},[n?.fetchState,d]),x=r.useCallback((s,i)=>{d(s,i,!1)},[d]),g=s=>{S(s)},{isAiCfoOpen:j,setIsAiCfoOpen:R}=G(),{isAiCfoAccessEnabled:T,onAskAiCfoClick:E}=K({isAiCfoOpen:j,setIsAiCfoOpen:R,mobileExploreReferrer:"Performance"});return L({isDataReady:n?.fetchState==="Completed"}),A?a.jsxs(a.Fragment,{children:[a.jsx(W,{isAppContentDrawerOpen:C,handleDrawerToggle:g}),a.jsx(X,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:l,tenantEmailDomain:m,onReload:D,onTimeRangeSelect:x,handleDrawerToggle:g,isAiCfoAccessEnabled:T,onAskAiCfoClick:E})]}):a.jsx(z,{to:`/${m}/dashboard`,replace:!0})};function Ie(){return a.jsxs(V,{children:[a.jsx(h,{path:"*",element:a.jsx(Y,{})}),a.jsx(h,{path:"*",element:a.jsx(_,{})})]})}export{Ie as default};
@@ -1 +1 @@
1
- import{a as h,b as t}from"./sentry-DGJ961LO.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new r.Error().stack;a&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[a]="a301a95b-8420-43bd-aa56-5738077199ba",r._sentryDebugIdIdentifier="sentry-dbid-a301a95b-8420-43bd-aa56-5738077199ba")}catch{}})();const c="64px",b={};var k=({src:r,light:a,oEmbedUrl:n,onClickPreview:l,playIcon:w,previewTabIndex:m,previewAriaLabel:u})=>{const[p,i]=h.useState(null);h.useEffect(()=>{r&&a&&n&&v({src:r,light:a,oEmbedUrl:n})},[r,a,n]);const v=async({src:e,light:d,oEmbedUrl:I})=>{if(t.isValidElement(d))return;if(typeof d=="string")return void i(d);if(b[e])return void i(b[e]);i(null);const E=await fetch(I.replace("{url}",e)),g=await E.json();if(g.thumbnail_url){const f=g.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");i(f),b[e]=f}},o=t.isValidElement(a),y={display:"flex",alignItems:"center",justifyContent:"center"},s={preview:{width:"100%",height:"100%",backgroundImage:p&&!o?`url(${p})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...y},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:c,width:c,height:c,position:o?"absolute":void 0,...y},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},_=t.createElement("div",{style:s.shadow,className:"react-player__shadow"},t.createElement("div",{style:s.playIcon,className:"react-player__play-icon"}));return t.createElement("div",{style:s.preview,className:"react-player__preview",tabIndex:m,onClick:e=>{l?.(e)},onKeyDown:e=>{e.key!=="Enter"&&e.key!==" "||l==null||l(e)},...u?{"aria-label":u}:{}},o?a:null,w||_)};export{k as default};
1
+ import{a as h,b as t}from"./sentry-gLPXz4Yq.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new r.Error().stack;a&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[a]="a301a95b-8420-43bd-aa56-5738077199ba",r._sentryDebugIdIdentifier="sentry-dbid-a301a95b-8420-43bd-aa56-5738077199ba")}catch{}})();const c="64px",b={};var k=({src:r,light:a,oEmbedUrl:n,onClickPreview:l,playIcon:w,previewTabIndex:m,previewAriaLabel:u})=>{const[p,i]=h.useState(null);h.useEffect(()=>{r&&a&&n&&v({src:r,light:a,oEmbedUrl:n})},[r,a,n]);const v=async({src:e,light:d,oEmbedUrl:I})=>{if(t.isValidElement(d))return;if(typeof d=="string")return void i(d);if(b[e])return void i(b[e]);i(null);const E=await fetch(I.replace("{url}",e)),g=await E.json();if(g.thumbnail_url){const f=g.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");i(f),b[e]=f}},o=t.isValidElement(a),y={display:"flex",alignItems:"center",justifyContent:"center"},s={preview:{width:"100%",height:"100%",backgroundImage:p&&!o?`url(${p})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...y},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:c,width:c,height:c,position:o?"absolute":void 0,...y},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},_=t.createElement("div",{style:s.shadow,className:"react-player__shadow"},t.createElement("div",{style:s.playIcon,className:"react-player__play-icon"}));return t.createElement("div",{style:s.preview,className:"react-player__preview",tabIndex:m,onClick:e=>{l?.(e)},onKeyDown:e=>{e.key!=="Enter"&&e.key!==" "||l==null||l(e)},...u?{"aria-label":u}:{}},o?a:null,w||_)};export{k as default};
@@ -1,4 +1,4 @@
1
- import{j as Ol}from"./liveblocks-dlvb-ucF.js";import{p as Q,e as xc,d as kc,g as jl,a as xl}from"./sentry-DGJ961LO.js";import{B as dt,bQ as Tc,eM as Ac,I0 as Rc,IK as kl,b$ as Tl,fi as Al,fj as Rl}from"./zeni-epic-state-De57_V18.js";import{a as lt,b as Il,c as Pl,d as Nl,e as an,f as Ll,g as $l,h as Ml,i as Vt,j as Ic,k as oe,l as je,m as Cl,n as Yt,o as ue,p as Dl}from"./utils-4E0JE-n2.js";import{r as un}from"./empty-vrCkOfCr.js";import{r as Fl,a as Bl,b as Ul,c as ql}from"./pdf-lib-VVDJ8cIK.js";import{r as Gl}from"./index-BUCtSz30.js";import{r as zl}from"./index-BPbXNCzw.js";import{j as Zl,u as Hl,h as Vl,g as En,k as Yl}from"./core-D85lL_9t.js";import{u as Kl,z as Pc,L as Wl,R as Jl,T as Xl,h as Ql,d as tf}from"./index-eyGUyZ3T.js";import"./mui-C9WBrZQt.js";import{d as Pe}from"./decodeURIComponentSafe-ByB9WhLS.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},f=new t.Error().stack;f&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[f]="05da8a96-2d4e-4aa6-8d6e-bfb6d429096f",t._sentryDebugIdIdentifier="sentry-dbid-05da8a96-2d4e-4aa6-8d6e-bfb6d429096f")}catch{}})();var _n,Sn={exports:{}},On,jn,xn,kn,Tn,An,Rn,In,Pn,Ne,Nn,Ln,$n,Mn,Cn,Dn,Fn,Bn,Un,qn,Gn,Le,zn,Zn,Hn,Vn,Yn,Kn,Wn,$e,Jn,Xn,Qn,to,eo,ro,no,Me={exports:{}},Ce={exports:{}},De={};function Nc(){if(On)return De;function t(r){return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(r)}function f(r,e){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,p){return a.__proto__=p,a},f(r,e)}function m(r){var e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var a,p=s(r);if(e){var h=s(this).constructor;a=Reflect.construct(p,arguments,h)}else a=p.apply(this,arguments);return function(d,b){if(b&&(t(b)==="object"||typeof b=="function"))return b;if(b!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}(d)}(this,a)}}function s(r){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},s(r)}On=1;var l,o,n={};function i(r,e,a){a||(a=Error);var p=function(h){(function(c,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(y&&y.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),Object.defineProperty(c,"prototype",{writable:!1}),y&&f(c,y)})(g,h);var d,b=m(g);function g(c,y,v){var S;return function(w,_){if(!(w instanceof _))throw new TypeError("Cannot call a class as a function")}(this,g),S=b.call(this,function(w,_,M){return typeof e=="string"?e:e(w,_,M)}(c,y,v)),S.code=r,S}return d=g,Object.defineProperty(d,"prototype",{writable:!1}),d}(a);n[r]=p}function u(r,e){if(Array.isArray(r)){var a=r.length;return r=r.map(function(p){return String(p)}),a>2?"one of ".concat(e," ").concat(r.slice(0,a-1).join(", "),", or ")+r[a-1]:a===2?"one of ".concat(e," ").concat(r[0]," or ").concat(r[1]):"of ".concat(e," ").concat(r[0])}return"of ".concat(e," ").concat(String(r))}return i("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),i("ERR_INVALID_ARG_TYPE",function(r,e,a){var p,h,d;if(l===void 0&&(l=ie()),l(typeof r=="string","'name' must be a string"),typeof e=="string"&&(h="not ",e.substr(0,h.length)===h)?(p="must not be",e=e.replace(/^not /,"")):p="must be",function(g,c,y){return(y===void 0||y>g.length)&&(y=g.length),g.substring(y-c.length,y)===c}(r," argument"))d="The ".concat(r," ").concat(p," ").concat(u(e,"type"));else{var b=function(g,c,y){return typeof y!="number"&&(y=0),!(y+c.length>g.length)&&g.indexOf(c,y)!==-1}(r,".")?"property":"argument";d='The "'.concat(r,'" ').concat(b," ").concat(p," ").concat(u(e,"type"))}return d+=". Received type ".concat(t(a))},TypeError),i("ERR_INVALID_ARG_VALUE",function(r,e){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";o===void 0&&(o=lt());var p=o.inspect(e);return p.length>128&&(p="".concat(p.slice(0,128),"...")),"The argument '".concat(r,"' ").concat(a,". Received ").concat(p)},TypeError),i("ERR_INVALID_RETURN_VALUE",function(r,e,a){var p;return p=a&&a.constructor&&a.constructor.name?"instance of ".concat(a.constructor.name):"type ".concat(t(a)),"Expected ".concat(r,' to be returned from the "').concat(e,'"')+" function but got ".concat(p,".")},TypeError),i("ERR_MISSING_ARGS",function(){for(var r=arguments.length,e=new Array(r),a=0;a<r;a++)e[a]=arguments[a];l===void 0&&(l=ie()),l(e.length>0,"At least one arg needs to be specified");var p="The ",h=e.length;switch(e=e.map(function(d){return'"'.concat(d,'"')}),h){case 1:p+="".concat(e[0]," argument");break;case 2:p+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:p+=e.slice(0,h-1).join(", "),p+=", and ".concat(e[h-1]," arguments")}return"".concat(p," must be specified")},TypeError),De.codes=n,De}function ef(){if(xn)return jn;function t(k,E){var j=Object.keys(k);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(k);E&&(x=x.filter(function(O){return Object.getOwnPropertyDescriptor(k,O).enumerable})),j.push.apply(j,x)}return j}function f(k){for(var E=1;E<arguments.length;E++){var j=arguments[E]!=null?arguments[E]:{};E%2?t(Object(j),!0).forEach(function(x){m(k,x,j[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(j)):t(Object(j)).forEach(function(x){Object.defineProperty(k,x,Object.getOwnPropertyDescriptor(j,x))})}return k}function m(k,E,j){return(E=l(E))in k?Object.defineProperty(k,E,{value:j,enumerable:!0,configurable:!0,writable:!0}):k[E]=j,k}function s(k,E,j){return E&&function(x,O){for(var $=0;$<O.length;$++){var N=O[$];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(x,l(N.key),N)}}(k.prototype,E),Object.defineProperty(k,"prototype",{writable:!1}),k}function l(k){var E=function(j,x){if(p(j)!=="object"||j===null)return j;var O=j[Symbol.toPrimitive];if(O!==void 0){var $=O.call(j,x);if(p($)!=="object")return $;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(j)}(k,"string");return p(E)==="symbol"?E:String(E)}function o(k,E){if(E&&(p(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return n(k)}function n(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}function i(k){var E=typeof Map=="function"?new Map:void 0;return i=function(j){if(j===null||(x=j,Function.toString.call(x).indexOf("[native code]")===-1))return j;var x;if(typeof j!="function")throw new TypeError("Super expression must either be null or a function");if(E!==void 0){if(E.has(j))return E.get(j);E.set(j,O)}function O(){return u(j,arguments,a(this).constructor)}return O.prototype=Object.create(j.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),e(O,j)},i(k)}function u(k,E,j){return u=r()?Reflect.construct.bind():function(x,O,$){var N=[null];N.push.apply(N,O);var P=new(Function.bind.apply(x,N));return $&&e(P,$.prototype),P},u.apply(null,arguments)}function r(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function e(k,E){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(j,x){return j.__proto__=x,j},e(k,E)}function a(k){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(E){return E.__proto__||Object.getPrototypeOf(E)},a(k)}function p(k){return p=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},p(k)}xn=1;var h=lt().inspect,d=Nc().codes.ERR_INVALID_ARG_TYPE;function b(k,E,j){return(j===void 0||j>k.length)&&(j=k.length),k.substring(j-E.length,j)===E}var g="",c="",y="",v="",S={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function w(k){var E=Object.keys(k),j=Object.create(Object.getPrototypeOf(k));return E.forEach(function(x){j[x]=k[x]}),Object.defineProperty(j,"message",{value:k.message}),j}function _(k){return h(k,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function M(k,E,j){var x="",O="",$=0,N="",P=!1,G=_(k),A=G.split(`
1
+ import{j as Ol}from"./liveblocks-Cqbf2YvG.js";import{p as Q,e as xc,d as kc,g as jl,a as xl}from"./sentry-gLPXz4Yq.js";import{B as dt,bQ as Tc,eM as Ac,I0 as Rc,IK as kl,b$ as Tl,fi as Al,fj as Rl}from"./zeni-epic-state-Cc2P4FPR.js";import{a as lt,b as Il,c as Pl,d as Nl,e as an,f as Ll,g as $l,h as Ml,i as Vt,j as Ic,k as oe,l as je,m as Cl,n as Yt,o as ue,p as Dl}from"./utils-oW6HiHsc.js";import{r as un}from"./empty-DTOnM0RR.js";import{r as Fl,a as Bl,b as Ul,c as ql}from"./pdf-lib-vymaIDnW.js";import{r as Gl}from"./index-j9ZiGcsv.js";import{r as zl}from"./index-BWIeQAsg.js";import{j as Zl,u as Hl,h as Vl,g as En,k as Yl}from"./core-DZE88rLA.js";import{u as Kl,z as Pc,L as Wl,R as Jl,T as Xl,h as Ql,d as tf}from"./index-BET54Nt-.js";import"./mui-B4xUUoCx.js";import{d as Pe}from"./decodeURIComponentSafe--utjO_hD.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},f=new t.Error().stack;f&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[f]="05da8a96-2d4e-4aa6-8d6e-bfb6d429096f",t._sentryDebugIdIdentifier="sentry-dbid-05da8a96-2d4e-4aa6-8d6e-bfb6d429096f")}catch{}})();var _n,Sn={exports:{}},On,jn,xn,kn,Tn,An,Rn,In,Pn,Ne,Nn,Ln,$n,Mn,Cn,Dn,Fn,Bn,Un,qn,Gn,Le,zn,Zn,Hn,Vn,Yn,Kn,Wn,$e,Jn,Xn,Qn,to,eo,ro,no,Me={exports:{}},Ce={exports:{}},De={};function Nc(){if(On)return De;function t(r){return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(r)}function f(r,e){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,p){return a.__proto__=p,a},f(r,e)}function m(r){var e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var a,p=s(r);if(e){var h=s(this).constructor;a=Reflect.construct(p,arguments,h)}else a=p.apply(this,arguments);return function(d,b){if(b&&(t(b)==="object"||typeof b=="function"))return b;if(b!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}(d)}(this,a)}}function s(r){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},s(r)}On=1;var l,o,n={};function i(r,e,a){a||(a=Error);var p=function(h){(function(c,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(y&&y.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),Object.defineProperty(c,"prototype",{writable:!1}),y&&f(c,y)})(g,h);var d,b=m(g);function g(c,y,v){var S;return function(w,_){if(!(w instanceof _))throw new TypeError("Cannot call a class as a function")}(this,g),S=b.call(this,function(w,_,M){return typeof e=="string"?e:e(w,_,M)}(c,y,v)),S.code=r,S}return d=g,Object.defineProperty(d,"prototype",{writable:!1}),d}(a);n[r]=p}function u(r,e){if(Array.isArray(r)){var a=r.length;return r=r.map(function(p){return String(p)}),a>2?"one of ".concat(e," ").concat(r.slice(0,a-1).join(", "),", or ")+r[a-1]:a===2?"one of ".concat(e," ").concat(r[0]," or ").concat(r[1]):"of ".concat(e," ").concat(r[0])}return"of ".concat(e," ").concat(String(r))}return i("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),i("ERR_INVALID_ARG_TYPE",function(r,e,a){var p,h,d;if(l===void 0&&(l=ie()),l(typeof r=="string","'name' must be a string"),typeof e=="string"&&(h="not ",e.substr(0,h.length)===h)?(p="must not be",e=e.replace(/^not /,"")):p="must be",function(g,c,y){return(y===void 0||y>g.length)&&(y=g.length),g.substring(y-c.length,y)===c}(r," argument"))d="The ".concat(r," ").concat(p," ").concat(u(e,"type"));else{var b=function(g,c,y){return typeof y!="number"&&(y=0),!(y+c.length>g.length)&&g.indexOf(c,y)!==-1}(r,".")?"property":"argument";d='The "'.concat(r,'" ').concat(b," ").concat(p," ").concat(u(e,"type"))}return d+=". Received type ".concat(t(a))},TypeError),i("ERR_INVALID_ARG_VALUE",function(r,e){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";o===void 0&&(o=lt());var p=o.inspect(e);return p.length>128&&(p="".concat(p.slice(0,128),"...")),"The argument '".concat(r,"' ").concat(a,". Received ").concat(p)},TypeError),i("ERR_INVALID_RETURN_VALUE",function(r,e,a){var p;return p=a&&a.constructor&&a.constructor.name?"instance of ".concat(a.constructor.name):"type ".concat(t(a)),"Expected ".concat(r,' to be returned from the "').concat(e,'"')+" function but got ".concat(p,".")},TypeError),i("ERR_MISSING_ARGS",function(){for(var r=arguments.length,e=new Array(r),a=0;a<r;a++)e[a]=arguments[a];l===void 0&&(l=ie()),l(e.length>0,"At least one arg needs to be specified");var p="The ",h=e.length;switch(e=e.map(function(d){return'"'.concat(d,'"')}),h){case 1:p+="".concat(e[0]," argument");break;case 2:p+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:p+=e.slice(0,h-1).join(", "),p+=", and ".concat(e[h-1]," arguments")}return"".concat(p," must be specified")},TypeError),De.codes=n,De}function ef(){if(xn)return jn;function t(k,E){var j=Object.keys(k);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(k);E&&(x=x.filter(function(O){return Object.getOwnPropertyDescriptor(k,O).enumerable})),j.push.apply(j,x)}return j}function f(k){for(var E=1;E<arguments.length;E++){var j=arguments[E]!=null?arguments[E]:{};E%2?t(Object(j),!0).forEach(function(x){m(k,x,j[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(j)):t(Object(j)).forEach(function(x){Object.defineProperty(k,x,Object.getOwnPropertyDescriptor(j,x))})}return k}function m(k,E,j){return(E=l(E))in k?Object.defineProperty(k,E,{value:j,enumerable:!0,configurable:!0,writable:!0}):k[E]=j,k}function s(k,E,j){return E&&function(x,O){for(var $=0;$<O.length;$++){var N=O[$];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(x,l(N.key),N)}}(k.prototype,E),Object.defineProperty(k,"prototype",{writable:!1}),k}function l(k){var E=function(j,x){if(p(j)!=="object"||j===null)return j;var O=j[Symbol.toPrimitive];if(O!==void 0){var $=O.call(j,x);if(p($)!=="object")return $;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(j)}(k,"string");return p(E)==="symbol"?E:String(E)}function o(k,E){if(E&&(p(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return n(k)}function n(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}function i(k){var E=typeof Map=="function"?new Map:void 0;return i=function(j){if(j===null||(x=j,Function.toString.call(x).indexOf("[native code]")===-1))return j;var x;if(typeof j!="function")throw new TypeError("Super expression must either be null or a function");if(E!==void 0){if(E.has(j))return E.get(j);E.set(j,O)}function O(){return u(j,arguments,a(this).constructor)}return O.prototype=Object.create(j.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),e(O,j)},i(k)}function u(k,E,j){return u=r()?Reflect.construct.bind():function(x,O,$){var N=[null];N.push.apply(N,O);var P=new(Function.bind.apply(x,N));return $&&e(P,$.prototype),P},u.apply(null,arguments)}function r(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function e(k,E){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(j,x){return j.__proto__=x,j},e(k,E)}function a(k){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(E){return E.__proto__||Object.getPrototypeOf(E)},a(k)}function p(k){return p=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},p(k)}xn=1;var h=lt().inspect,d=Nc().codes.ERR_INVALID_ARG_TYPE;function b(k,E,j){return(j===void 0||j>k.length)&&(j=k.length),k.substring(j-E.length,j)===E}var g="",c="",y="",v="",S={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function w(k){var E=Object.keys(k),j=Object.create(Object.getPrototypeOf(k));return E.forEach(function(x){j[x]=k[x]}),Object.defineProperty(j,"message",{value:k.message}),j}function _(k){return h(k,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function M(k,E,j){var x="",O="",$=0,N="",P=!1,G=_(k),A=G.split(`
2
2
  `),I=_(E).split(`
3
3
  `),R=0,B="";if(j==="strictEqual"&&p(k)==="object"&&p(E)==="object"&&k!==null&&E!==null&&(j="strictEqualObject"),A.length===1&&I.length===1&&A[0]!==I[0]){var V=A[0].length+I[0].length;if(V<=10){if(!(p(k)==="object"&&k!==null||p(E)==="object"&&E!==null||k===0&&E===0))return"".concat(S[j],`
4
4
 
@@ -1,4 +1,4 @@
1
- import{j as s}from"./liveblocks-dlvb-ucF.js";import{a as o}from"./sentry-DGJ961LO.js";import{g as f,j as V,h as M,u as N,k as W}from"./core-D85lL_9t.js";import{m as _,Z as $,z as R,a$ as U,x as Z,H as z,F as X,w as q,d as l,f as G,a1 as J,b0 as Q}from"./index-eyGUyZ3T.js";import{eX as K,eM as Y,Lh as I,Li as ee,ta as ae,t0 as g,eZ as re,bL as ne,t5 as te,Lj as se}from"./zeni-epic-state-De57_V18.js";import{D as oe,e as ie,n as le,S as de}from"./mui-C9WBrZQt.js";import{u as ce}from"./useAskAiCfoHostNavButtonProps-D7VmZhkv.js";import{c as fe}from"./useFetchSuggestedQuestionsWhenReady-vh4emZ7O.js";import{M as ue}from"./MobileAppDrawer-Cq6umKbp.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]="ee3d777b-1bba-4083-95b8-d56989b8ad9a",e._sentryDebugIdIdentifier="sentry-dbid-ee3d777b-1bba-4083-95b8-d56989b8ad9a")}catch{}})();const pe={overlayWidth:new Z(100,100,30)},we=({isReferralDrawerOpen:e,closeDrawerHandler:a})=>{const r=_(),n=$();if(R.getSignedInUser()==null)throw Error("Can't access How Referral works without signing in...");const i=()=>{a(!0)},u=f(d=>K(d));return s.jsx(oe,{anchor:"right",open:e,PaperProps:{style:{width:pe.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:r.colors.black,cursor:"pointer"}}},onClose:()=>i(),children:s.jsx(ie,{in:e,direction:"left",children:s.jsx(ge,{onClick:d=>d.stopPropagation(),children:s.jsx(U,{onDismissClick:i,rewardsPlan:u.rewardsPlan})})})})},ge=le(de)`
1
+ import{j as s}from"./liveblocks-Cqbf2YvG.js";import{a as o}from"./sentry-gLPXz4Yq.js";import{g as f,j as V,h as M,u as N,k as W}from"./core-DZE88rLA.js";import{m as _,Z as $,z as R,a$ as U,x as Z,H as z,F as X,w as q,d as l,f as G,a1 as J,b0 as Q}from"./index-BET54Nt-.js";import{eX as K,eM as Y,Lh as I,Li as ee,ta as ae,t0 as g,eZ as re,bL as ne,t5 as te,Lj as se}from"./zeni-epic-state-Cc2P4FPR.js";import{D as oe,e as ie,n as le,S as de}from"./mui-B4xUUoCx.js";import{u as ce}from"./useAskAiCfoHostNavButtonProps-CIwJkrUG.js";import{c as fe}from"./useFetchSuggestedQuestionsWhenReady-CZP4Iues.js";import{M as ue}from"./MobileAppDrawer-D0-D1IIa.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]="ee3d777b-1bba-4083-95b8-d56989b8ad9a",e._sentryDebugIdIdentifier="sentry-dbid-ee3d777b-1bba-4083-95b8-d56989b8ad9a")}catch{}})();const pe={overlayWidth:new Z(100,100,30)},we=({isReferralDrawerOpen:e,closeDrawerHandler:a})=>{const r=_(),n=$();if(R.getSignedInUser()==null)throw Error("Can't access How Referral works without signing in...");const i=()=>{a(!0)},u=f(d=>K(d));return s.jsx(oe,{anchor:"right",open:e,PaperProps:{style:{width:pe.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:r.colors.black,cursor:"pointer"}}},onClose:()=>i(),children:s.jsx(ie,{in:e,direction:"left",children:s.jsx(ge,{onClick:d=>d.stopPropagation(),children:s.jsx(U,{onDismissClick:i,rewardsPlan:u.rewardsPlan})})})})},ge=le(de)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
@@ -1 +1 @@
1
- import{j as t}from"./liveblocks-dlvb-ucF.js";import x from"./NotFoundScreen-CNrR5P_G.js";import{a as p}from"./sentry-DGJ961LO.js";import{j as I,u as C,h as A,g as c,N as E,k,n as D,o as u}from"./core-D85lL_9t.js";import{eM as T,Mb as v,Mr as S,C7 as V,Bg as B,C6 as m,BZ as M,MG as U}from"./zeni-epic-state-De57_V18.js";import{m as _,z as $,B as N,a1 as O,bF as W,aa as z}from"./index-eyGUyZ3T.js";import"./mui-C9WBrZQt.js";import{R as h}from"./ReimbursementApprovalRuleDetailScreen-mjO0EFcS.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]="7511c9dc-84b4-4f3b-bf7c-7fc615663406",e._sentryDebugIdIdentifier="sentry-dbid-7511c9dc-84b4-4f3b-bf7c-7fc615663406")}catch{}})();const f="reimbursement-approval-rule-update",F=k(function(e){return{approvalView:v(e),remiSetupApproverViewUpdateData:S(e).remiSetupApproverViewUpdateData}},function(e,r){const{navigate:a,location:l}=r;return{onApprovalRulesEventReceived:n=>{n.endsWith(f)&&e(U(!1))},onBackClick:()=>{z(l)?a("../../"):a("../../../reimbursements/setup")},onDeleteRuleClick:n=>{e(M(n))},onEditRuleClick:n=>{n!=null?(e(m(n)),a(`./${n}/edit`)):(e(m()),a("./new"))}}})(O(W)),G=()=>{const e=I(),r=C(),a=A(),[l,n]=p.useState(!1),[d,y]=p.useState(!1),b=c(s=>s.remiSetupApproverViewState.fetchState),o=c(s=>T(s)),w=_(),i=c(s=>v(s)),g=c(s=>S(s).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&a(V())},[g]),p.useEffect(()=>{l||b!=="Not-Started"||(n(!0),a(B(!0)))},[l,b,a]),$.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect(()=>{i.allApprovalRules.length===0&&i.fetchState==="Completed"&&(d||(y(!0),a(m())),e("./new"))},[d,i,a]);const j={events:o.companyId!=null?[`private-${o.companyId}.${f}`]:[],eventCallback:(s,P,R)=>{s.endsWith(f)&&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 Y(){return t.jsxs(D,{children:[t.jsx(u,{path:"/",element:t.jsx(G,{})}),t.jsx(u,{path:"/new",element:t.jsx(h,{})}),t.jsx(u,{path:"/:approvalRuleId/edit",element:t.jsx(h,{})}),t.jsx(u,{path:"*",element:t.jsx(x,{})})]})}export{Y as R};
1
+ import{j as t}from"./liveblocks-Cqbf2YvG.js";import x from"./NotFoundScreen-BM3DcBu4.js";import{a as p}from"./sentry-gLPXz4Yq.js";import{j as I,u as C,h as A,g as c,N as E,k,n as D,o as u}from"./core-DZE88rLA.js";import{eM as T,Mb as v,Mr as S,C7 as V,Bg as B,C6 as m,BZ as M,MG as U}from"./zeni-epic-state-Cc2P4FPR.js";import{m as _,z as $,B as N,a1 as O,bF as W,aa as z}from"./index-BET54Nt-.js";import"./mui-B4xUUoCx.js";import{R as h}from"./ReimbursementApprovalRuleDetailScreen-CnM97Nh_.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]="7511c9dc-84b4-4f3b-bf7c-7fc615663406",e._sentryDebugIdIdentifier="sentry-dbid-7511c9dc-84b4-4f3b-bf7c-7fc615663406")}catch{}})();const f="reimbursement-approval-rule-update",F=k(function(e){return{approvalView:v(e),remiSetupApproverViewUpdateData:S(e).remiSetupApproverViewUpdateData}},function(e,r){const{navigate:a,location:l}=r;return{onApprovalRulesEventReceived:n=>{n.endsWith(f)&&e(U(!1))},onBackClick:()=>{z(l)?a("../../"):a("../../../reimbursements/setup")},onDeleteRuleClick:n=>{e(M(n))},onEditRuleClick:n=>{n!=null?(e(m(n)),a(`./${n}/edit`)):(e(m()),a("./new"))}}})(O(W)),G=()=>{const e=I(),r=C(),a=A(),[l,n]=p.useState(!1),[d,y]=p.useState(!1),b=c(s=>s.remiSetupApproverViewState.fetchState),o=c(s=>T(s)),w=_(),i=c(s=>v(s)),g=c(s=>S(s).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{g?.updateStatus.fetchState==="Completed"&&a(V())},[g]),p.useEffect(()=>{l||b!=="Not-Started"||(n(!0),a(B(!0)))},[l,b,a]),$.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect(()=>{i.allApprovalRules.length===0&&i.fetchState==="Completed"&&(d||(y(!0),a(m())),e("./new"))},[d,i,a]);const j={events:o.companyId!=null?[`private-${o.companyId}.${f}`]:[],eventCallback:(s,P,R)=>{s.endsWith(f)&&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 Y(){return t.jsxs(D,{children:[t.jsx(u,{path:"/",element:t.jsx(G,{})}),t.jsx(u,{path:"/new",element:t.jsx(h,{})}),t.jsx(u,{path:"/:approvalRuleId/edit",element:t.jsx(h,{})}),t.jsx(u,{path:"*",element:t.jsx(x,{})})]})}export{Y as R};
@@ -1 +1 @@
1
- import{j as g}from"./liveblocks-dlvb-ucF.js";import{a as y}from"./sentry-DGJ961LO.js";import{j as w,h as A,u as C,l as T,g as S,k as U}from"./core-D85lL_9t.js";import{Mr as R,Mb as E,C0 as x,C9 as _,C7 as b,C8 as h,Ms as B}from"./zeni-epic-state-De57_V18.js";import{z as k,m as V,B as j,bw as F,aa as O}from"./index-eyGUyZ3T.js";import"./mui-C9WBrZQt.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]="2f19e4e1-5cac-474c-acd4-270500ad6384",e._sentryDebugIdIdentifier="sentry-dbid-2f19e4e1-5cac-474c-acd4-270500ad6384")}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 c=p=>{const v=[];return p.forEach(u=>{const D=u.actors.selectedUsers.map(d=>({type:"user",subType:void 0,userId:d.userId,idType:"user",isImplicitActor:!1})),I=u.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:u.stepType.selectedOption,actors:m,operator:m.length>1?u.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:c(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:c(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(h(p))}},onResetClick:()=>{e(b()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(b()),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=C(),{approvalRuleId:s}=T(),n=k.getSignedInUser(),l=V(),r=S(p=>R(p)),i=S(p=>E(p)),[o,c]=y.useState(!1);if(y.useEffect(()=>{o||(c(!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-Cqbf2YvG.js";import{a as y}from"./sentry-gLPXz4Yq.js";import{j as w,h as A,u as C,l as T,g as S,k as U}from"./core-DZE88rLA.js";import{Mr as R,Mb as E,C0 as x,C9 as _,C7 as b,C8 as h,Ms as B}from"./zeni-epic-state-Cc2P4FPR.js";import{z as k,m as V,B as j,bw as F,aa as O}from"./index-BET54Nt-.js";import"./mui-B4xUUoCx.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]="2f19e4e1-5cac-474c-acd4-270500ad6384",e._sentryDebugIdIdentifier="sentry-dbid-2f19e4e1-5cac-474c-acd4-270500ad6384")}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 c=p=>{const v=[];return p.forEach(u=>{const D=u.actors.selectedUsers.map(d=>({type:"user",subType:void 0,userId:d.userId,idType:"user",isImplicitActor:!1})),I=u.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:u.stepType.selectedOption,actors:m,operator:m.length>1?u.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:c(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:c(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(h(p))}},onResetClick:()=>{e(b()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(b()),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=C(),{approvalRuleId:s}=T(),n=k.getSignedInUser(),l=V(),r=S(p=>R(p)),i=S(p=>E(p)),[o,c]=y.useState(!1);if(y.useEffect(()=>{o||(c(!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,4 +1,4 @@
1
- import{j as s}from"./liveblocks-dlvb-ucF.js";import{j as W,h as le,u as V,l as Y,g as w,N,k as K,i as ut,n as pt,o as B}from"./core-D85lL_9t.js";import{eM as J,MH as me,b$ as ce,Bb as xe,jj as bt,Bo as ae,Bn as se,MI as gt,bm as de,fG as Te,MJ as ht,J3 as ft,j8 as je,J4 as Se,J5 as St,i1 as It,LZ as yt,ih as Rt,A$ as At,rQ as vt,i8 as Ct,BL as De,MK as Fe,ML as kt,MM as Et,MN as Bt,MO as wt,MP as xt,Bv as Ie,io as Tt,M6 as jt,Bp as Dt,B9 as Ft,MQ as Ut,B8 as Lt,MR as Mt,Bh as ye,Bz as Pt,By as $t,Bu as Nt,MS as Ue,Gm as _t,bn as Ot,Bk as Gt,C1 as zt,MT as Ht,MU as Zt,BH as Vt,BE as Re,Ls as Jt,B6 as Wt,MV as Le,Cq as Ae,Cy as Kt,MW as qt,MX as H,MY as Qt,MZ as Me,M_ as Xt,M$ as Pe,N0 as $e,BT as ie,bs as Yt,bD as ue,cy as pe,eT as Ne,eR as _e,N1 as en,gy as tn,LF as nn,N2 as an,N3 as Oe,LJ as sn,Mr as on,N4 as rn,MG as ln,Cv as ve,Cu as mn,N5 as cn,N6 as dn,N7 as un,N8 as pn,N9 as bn,Mc as gn,Cl as hn,Cp as fn,bu as Sn,bC as In,ct as yn,cN as Rn,br as An,I2 as vn,cJ as Cn,cL as kn,cK as En,cs as Bn}from"./zeni-epic-state-De57_V18.js";import{v as Ge,Z as ze,a as ee,i as v,z as P,bG as He,w as te,d as C,aC as Ce,o as U,ao as X,A as wn,D as Ze,bH as xn,r as Z,F as Ve,bI as Tn,j as ne,bJ as jn,H as Dn,x as Fn,B as be,f as Je,a1 as Un,b7 as Ln,Q as Mn,m as We,bK as Pn,a4 as $n}from"./index-eyGUyZ3T.js";import{n as _,S as Nn}from"./mui-C9WBrZQt.js";import oe from"./NotFoundScreen-CNrR5P_G.js";import{S as ke}from"./SetupPagesScreen-C7kgTCyu.js";import{F as Ke}from"./FeaturePreviewScreen-CHkVgg1G.js";import{a as g}from"./sentry-DGJ961LO.js";import{u as qe}from"./useInitialThreadRequest-CdZgxQMw.js";import{u as Qe}from"./useAskAiCfoHostNavButtonProps-D7VmZhkv.js";import{c as Xe}from"./useFetchSuggestedQuestionsWhenReady-vh4emZ7O.js";import{D as _n}from"./DrawerScreen-7RB3pd-L.js";import{M as Ye}from"./MobileAppDrawer-Cq6umKbp.js";import{R as On}from"./ReimbursementApprovalRoutes-DtjTNMyW.js";import{FallBackRoute as Gn}from"./ScreenRoutes-BQrRNAQd.js";import"./recharts-BYSqK3LX.js";import"./lottie-DGXsyyYr.js";import"./analytics-BAQwJULS.js";import"./plaid-BveLUCs7.js";import"./dnd-P1ekKsf6.js";import"./stripe-DMRn4zHo.js";import"./lexical-C7vBKQl2.js";import"./pdf-DebxFbW1.js";import"./utils-4E0JE-n2.js";import"./analyticsHelper-D9biWtDJ.js";import"./routePaths-Ckqdpqo6.js";import"./BusinessVerificationPageScreen-S9e9j7rw.js";import"./ReimbursementApprovalRuleDetailScreen-mjO0EFcS.js";import"./getLocaleForTenant-ClrmJsWr.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]="e31d179b-44e0-4e12-94b2-fc192c3e2ec7",e._sentryDebugIdIdentifier="sentry-dbid-e31d179b-44e0-4e12-94b2-fc192c3e2ec7")}catch{}})();const et=e=>`/${e}/reimbursements`,zn=e=>g.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},g.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),g.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{spendManagement:{reimbursement:{reimbursementDetail:L}}}=Ze.getLocalizedStrings(),Hn=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:`${X.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:x,entityAutoCompleteView:R},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:I,isUserAdmin:ce(t.currentTenant?.userRole??[]),isZeniUser:d,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:p.bankAccountCreationState,bankAccounts:p.bankAccounts,analytics:C,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:S,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:je(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:c,navigate:d,themeState:m}=t,{tenantEmailDomain:o}=r,a=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(Nt(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(Mt({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(Lt(l,i,n))},updateReimbursementType:(i,l,p)=>{e(Ut({reimbursementId:p,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,p)=>{e(Ft({reimbursementId:p,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Dt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Ie(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(jt({data:l}))},onFetchBankName:i=>{e(Tt(i))},submitRemiDetails:()=>{e(Ie("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(xt({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(ae({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(wt({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(Bt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(Et({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Fe()),e(kt());const i=et(o),l=Z(c.state?.pathnameStackToGoBack,c.pathname);d(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(C.trackReimbursementDeleteReimbursement(n),e(De(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=W(),t=le(),n=V(),{reimbursementId:r}=Y(),c=Ge(),d=ze(),[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"),j=x.includes("reimbursement/new"),[b,k]=g.useState(!1),y=P.getSignedInUser(),T=w(u=>J(u)),f=w(u=>me(u,r)),D=qe(T?.companyId,{clearParams:f.fetchState==="Completed"}),$=ce(T?.userRole??[]);g.useEffect(()=>{(j&&!b||R&&f.fetchState!="Completed"&&f.fetchState!="In-Progress")&&(k(!0),t(xe(!1,p,I,r)))});const A=w(u=>bt(u.accountState,u.accountListState,"reimbursementAccountList"));if(y==null)throw Error("Can't access address page without signing in...");const F={pathname:`../${r}`,search:n.search};return f.isDeleted===!0||f.billStage=="paid"||f.billStage=="scheduled"||f.fetchState=="Not-Started"||$&&f.billStatus==="rejected"||$===!1&&f.billStage==="pending_approval"&&f.billStatus!=="rejected"?s.jsx(N,{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=>(M=>{r!=null&&f.deleteStatus.fetchState!=="Completed"&&M.trackReimbursementEditReimbursement(r)})(u)}),m&&d!=="small"?s.jsx(Vn,{}):null,m&&d!=="small"?s.jsx(Jn,{children:s.jsx(Ce,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:y?.userId??"",sessionId:y?.zeniSessionId??"",tenantId:T?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:u=>{u!=null&&t(se(u,a,!0,r,y?.userId))},updateInvoiceUploadFetchState:u=>{t(ae({reimbursementId:r,fetchState:u}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:U.sp3,paddingBottom:"15px",paddingLeft:U.sp5},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})}):null,m&&d==="small"?s.jsxs(Wn,{children:[s.jsx(Kn,{onClick:()=>o(!1),children:s.jsx(zn,{})}),s.jsx(Ce,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:y?.userId??"",sessionId:y?.zeniSessionId??"",tenantId:T?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:u=>{u!=null&&t(se(u,a,!0,r,y?.userId))},updateInvoiceUploadFetchState:u=>{t(ae({reimbursementId:r,fetchState:u}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:U.sp5,paddingRight:U.sp3,paddingBottom:U.sp5,paddingLeft:U.sp3},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})]}):null,s.jsx(qn,{windowSize:d,children:s.jsx(Hn,{initialOpenThreadRequest:D??void 0,isReimbursementCommentingEnabled:S,location:n,navigate:e,currentTenant:T,reimbursementId:r,themeState:c,uncategorizedAccounts:A,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i})})]})}const Zn=_.div`
1
+ import{j as s}from"./liveblocks-Cqbf2YvG.js";import{j as W,h as le,u as V,l as Y,g as w,N,k as K,i as ut,n as pt,o as B}from"./core-DZE88rLA.js";import{eM as J,MH as me,b$ as ce,Bb as xe,jj as bt,Bo as ae,Bn as se,MI as gt,bm as de,fG as Te,MJ as ht,J3 as ft,j8 as je,J4 as Se,J5 as St,i1 as It,LZ as yt,ih as Rt,A$ as At,rQ as vt,i8 as Ct,BL as De,MK as Fe,ML as kt,MM as Et,MN as Bt,MO as wt,MP as xt,Bv as Ie,io as Tt,M6 as jt,Bp as Dt,B9 as Ft,MQ as Ut,B8 as Lt,MR as Mt,Bh as ye,Bz as Pt,By as $t,Bu as Nt,MS as Ue,Gm as _t,bn as Ot,Bk as Gt,C1 as zt,MT as Ht,MU as Zt,BH as Vt,BE as Re,Ls as Jt,B6 as Wt,MV as Le,Cq as Ae,Cy as Kt,MW as qt,MX as H,MY as Qt,MZ as Me,M_ as Xt,M$ as Pe,N0 as $e,BT as ie,bs as Yt,bD as ue,cy as pe,eT as Ne,eR as _e,N1 as en,gy as tn,LF as nn,N2 as an,N3 as Oe,LJ as sn,Mr as on,N4 as rn,MG as ln,Cv as ve,Cu as mn,N5 as cn,N6 as dn,N7 as un,N8 as pn,N9 as bn,Mc as gn,Cl as hn,Cp as fn,bu as Sn,bC as In,ct as yn,cN as Rn,br as An,I2 as vn,cJ as Cn,cL as kn,cK as En,cs as Bn}from"./zeni-epic-state-Cc2P4FPR.js";import{v as Ge,Z as ze,a as ee,i as v,z as P,bG as He,w as te,d as C,aC as Ce,o as U,ao as X,A as wn,D as Ze,bH as xn,r as Z,F as Ve,bI as Tn,j as ne,bJ as jn,H as Dn,x as Fn,B as be,f as Je,a1 as Un,b7 as Ln,Q as Mn,m as We,bK as Pn,a4 as $n}from"./index-BET54Nt-.js";import{n as _,S as Nn}from"./mui-B4xUUoCx.js";import oe from"./NotFoundScreen-BM3DcBu4.js";import{S as ke}from"./SetupPagesScreen-B8Rno5B2.js";import{F as Ke}from"./FeaturePreviewScreen-3Cs41rNa.js";import{a as g}from"./sentry-gLPXz4Yq.js";import{u as qe}from"./useInitialThreadRequest-DFJpueCY.js";import{u as Qe}from"./useAskAiCfoHostNavButtonProps-CIwJkrUG.js";import{c as Xe}from"./useFetchSuggestedQuestionsWhenReady-CZP4Iues.js";import{D as _n}from"./DrawerScreen-Dv_UzQOo.js";import{M as Ye}from"./MobileAppDrawer-D0-D1IIa.js";import{R as On}from"./ReimbursementApprovalRoutes-DghBrXt3.js";import{FallBackRoute as Gn}from"./ScreenRoutes-DsynOrE_.js";import"./recharts-3_XOsuaw.js";import"./lottie-BMcMDJUW.js";import"./analytics-Cp5F-UjF.js";import"./plaid-G98kqTnM.js";import"./dnd-B4DEM2bW.js";import"./stripe-DMRn4zHo.js";import"./lexical-Bp_BNV6r.js";import"./pdf-DYKlsr3c.js";import"./utils-oW6HiHsc.js";import"./analyticsHelper-BTOyHFla.js";import"./routePaths-BNouI24c.js";import"./BusinessVerificationPageScreen-j2FAzNjV.js";import"./ReimbursementApprovalRuleDetailScreen-CnM97Nh_.js";import"./getLocaleForTenant-CPndpwIp.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]="e31d179b-44e0-4e12-94b2-fc192c3e2ec7",e._sentryDebugIdIdentifier="sentry-dbid-e31d179b-44e0-4e12-94b2-fc192c3e2ec7")}catch{}})();const et=e=>`/${e}/reimbursements`,zn=e=>g.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},g.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),g.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{spendManagement:{reimbursement:{reimbursementDetail:L}}}=Ze.getLocalizedStrings(),Hn=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:`${X.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:x,entityAutoCompleteView:R},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:I,isUserAdmin:ce(t.currentTenant?.userRole??[]),isZeniUser:d,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:p.bankAccountCreationState,bankAccounts:p.bankAccounts,analytics:C,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:S,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:je(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:c,navigate:d,themeState:m}=t,{tenantEmailDomain:o}=r,a=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(Nt(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(Mt({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(Lt(l,i,n))},updateReimbursementType:(i,l,p)=>{e(Ut({reimbursementId:p,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,p)=>{e(Ft({reimbursementId:p,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Dt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Ie(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(jt({data:l}))},onFetchBankName:i=>{e(Tt(i))},submitRemiDetails:()=>{e(Ie("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(xt({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(ae({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(wt({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(Bt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(Et({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Fe()),e(kt());const i=et(o),l=Z(c.state?.pathnameStackToGoBack,c.pathname);d(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(C.trackReimbursementDeleteReimbursement(n),e(De(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=W(),t=le(),n=V(),{reimbursementId:r}=Y(),c=Ge(),d=ze(),[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"),j=x.includes("reimbursement/new"),[b,k]=g.useState(!1),y=P.getSignedInUser(),T=w(u=>J(u)),f=w(u=>me(u,r)),D=qe(T?.companyId,{clearParams:f.fetchState==="Completed"}),$=ce(T?.userRole??[]);g.useEffect(()=>{(j&&!b||R&&f.fetchState!="Completed"&&f.fetchState!="In-Progress")&&(k(!0),t(xe(!1,p,I,r)))});const A=w(u=>bt(u.accountState,u.accountListState,"reimbursementAccountList"));if(y==null)throw Error("Can't access address page without signing in...");const F={pathname:`../${r}`,search:n.search};return f.isDeleted===!0||f.billStage=="paid"||f.billStage=="scheduled"||f.fetchState=="Not-Started"||$&&f.billStatus==="rejected"||$===!1&&f.billStage==="pending_approval"&&f.billStatus!=="rejected"?s.jsx(N,{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=>(M=>{r!=null&&f.deleteStatus.fetchState!=="Completed"&&M.trackReimbursementEditReimbursement(r)})(u)}),m&&d!=="small"?s.jsx(Vn,{}):null,m&&d!=="small"?s.jsx(Jn,{children:s.jsx(Ce,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:y?.userId??"",sessionId:y?.zeniSessionId??"",tenantId:T?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:u=>{u!=null&&t(se(u,a,!0,r,y?.userId))},updateInvoiceUploadFetchState:u=>{t(ae({reimbursementId:r,fetchState:u}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:U.sp3,paddingBottom:"15px",paddingLeft:U.sp5},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})}):null,m&&d==="small"?s.jsxs(Wn,{children:[s.jsx(Kn,{onClick:()=>o(!1),children:s.jsx(zn,{})}),s.jsx(Ce,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:y?.userId??"",sessionId:y?.zeniSessionId??"",tenantId:T?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:u=>{u!=null&&t(se(u,a,!0,r,y?.userId))},updateInvoiceUploadFetchState:u=>{t(ae({reimbursementId:r,fetchState:u}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:U.sp5,paddingRight:U.sp3,paddingBottom:U.sp5,paddingLeft:U.sp3},dropFilePlaceholder:{upload:L.dropReceipt.upload,single:L.dropReceipt.single,or:L.dropReceipt.or,multiple:L.dropReceipt.multiple,receipts:L.dropReceipt.receipts}})]}):null,s.jsx(qn,{windowSize:d,children:s.jsx(Hn,{initialOpenThreadRequest:D??void 0,isReimbursementCommentingEnabled:S,location:n,navigate:e,currentTenant:T,reimbursementId:r,themeState:c,uncategorizedAccounts:A,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i})})]})}const Zn=_.div`
2
2
  display: flex;
3
3
  position: relative;
4
4
  height: 100vh;
@@ -1 +1 @@
1
- import{j as d}from"./liveblocks-dlvb-ucF.js";import{u as V,j as me,h as ue,l as _e,g as m,k as he,n as be,o as z}from"./core-D85lL_9t.js";import{eM as P,f8 as g,Ip as Ie,pr as F,iY as ye,h_ as Ce,sN as ge,pw as we,bu as Se,Iq as Re,Ir as Te,j8 as Fe,bm as Oe,tP as ke,Is as Ae,It as De,sI as je,sM as Ee,Iu as H,Iv as Pe,Iw as Me,Ix as Le,Iy as Be,Iz as w,IA as O,IB as k,IC as G,ID as A,IE as D,dF as ve,tv as Ue,tj as Y,tk as N,tB as xe,to as q,tH as Ve,IF as ze,IG as He,IH as Ge,II as Ye,IJ as Ne,eT as qe,eR as $e}from"./zeni-epic-state-De57_V18.js";import{E as Qe,F as Ze,Z as Je,a as Z,i as j,z as J,H as Ke,j as We,c as Xe,w as ea,d as E,f as aa,r as K,N as sa,O as ta,Q as oa}from"./index-eyGUyZ3T.js";import"./mui-C9WBrZQt.js";import na from"./NotFoundScreen-CNrR5P_G.js";import{F as ra}from"./FeaturePreviewScreen-CHkVgg1G.js";import{a as h}from"./sentry-DGJ961LO.js";import{u as ia,a as la,b as ca,c as da}from"./useFetchSuggestedQuestionsWhenReady-vh4emZ7O.js";import{u as pa}from"./useInitialThreadRequest-CdZgxQMw.js";import{t as $,a as Q}from"./routePaths-Ckqdpqo6.js";import{M as fa}from"./MobileAppDrawer-Cq6umKbp.js";import"./recharts-BYSqK3LX.js";import"./lottie-DGXsyyYr.js";import"./analytics-BAQwJULS.js";import"./plaid-BveLUCs7.js";import"./dnd-P1ekKsf6.js";import"./stripe-DMRn4zHo.js";import"./lexical-C7vBKQl2.js";import"./pdf-DebxFbW1.js";import"./utils-4E0JE-n2.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]="65f66b35-6f62-45d4-9bc1-82fcb49088f8",e._sentryDebugIdIdentifier="sentry-dbid-65f66b35-6f62-45d4-9bc1-82fcb49088f8")}catch{}})();const ma=["profit_loss","balance_sheet","cash_flow"],I=e=>{e(D({resetLeftScroll:!0})),e(A({resetLeftScroll:!0})),e(k({resetLeftScroll:!0})),e(O({resetLeftScroll:!0}))},ua=e=>{e(He()),e(Ge()),e(Ye()),e(Ne())},_a=he(function(e){const o=J.getSignedInUser(),p=e.tenantState.currentTenantId,u=P(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:p??""},t=g(e),r=Re(u);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:E,isZeniUser:Oe(o),showAccountGroups:r===!0,isAccountingClassesEnabled:Fe(e),isAccountingProjectsEnabled:Te(e),currentTenantCompanyName:a,statementEndPoint:`${oa}/statement`,authParams:s,isZeniCOAUsed:r}},function(e,o){const{navigate:p,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(F(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(ze(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(Ve(a)),s){const{isCompareModeOn:r,filter:c}=o,{additionalBalances:f,balancesRange:l}=c;let i=[...f];a==="year"&&(i=i.filter(y=>y!=="this_period_vs_same_period_last_year"&&y!=="this_period_vs_same_period_last_year_percent"&&y!=="same_period_last_year")),e(Y(o.firstMonthOfFY,r,l.numberOfPeriods<4?4:l.numberOfPeriods,i)),f.length>0&&e(N(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",l.numberOfPeriods<4?4:l.numberOfPeriods,i))}t!==!0&&setTimeout(()=>I(e),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(w(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(q({numberOfPeriods:4,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(H({classViewLayout:"vertical"})),I(e)},onCOABalancesRangeChanged:(a,s)=>{e(q(a,s)),I(e)},onThisPeriodChanged:(a,s,t)=>{e(xe(o.firstMonthOfFY,a,s<4?4:s)),t!==!0&&I(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(Y(o.firstMonthOfFY,a,t<4?4:t,s)),s.length>0&&e(N(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<4?4:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout(()=>I(e),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(Ue({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<4?4:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,c;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,c=ve(s)):s.balanceTimeFrame==="year"?(r="quarter",c={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),c!=null&&r!=null){const f=a.accountName===""?a.accountDescription:a.accountName,l=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return $(o.tenantEmailDomain,a.accountId,a.accountType,f,r,c);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return Q(o.tenantEmailDomain,a.accountId,a.accountType,s.id,f,r,c)}return a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?Q(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],f,r,c):a.accountType!=null?$(o.tenantEmailDomain,a.accountId,a.accountType,f,r,c):void 0})();if(l!=null){const i=K(o.location.state?.pathnameStackToGoBack,o.location.pathname);p(l,{state:{pathnameStackToGoBack:i,referrer:S(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(D({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(A({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(G({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"profit_and_loss_by_projects":e(G({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(Le({viewMode:a})),e(Be({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",S(o.selectedReportID)),e(w("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",S(o.selectedReportID)),e(w("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",S(o.selectedReportID)),e(w("profit_and_loss"))),I(e)},onUpdateClassesToFilterOut:a=>{e(Me({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(Pe({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(H({classViewLayout:a}))},onOpenAccountViewMode:()=>{e(je()),e(Ee())},onUpdateDisplayOrder:a=>{e(De(a))},onUpdateReportFormat:a=>{ua(e),e(Ae(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(ke("profit_and_loss_by_classes"))}}})(sa);function ha(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Ze(),p=Je(),u=ta(p),a=me(),s=ue(),t=V(),{tenantEmailDomain:r}=_e(),{useFeatureGate:c}=Z(),{isFeatureEnabled:f}=c(j.isReportsHorizontalClassLayoutSwitchEnabled),l=J.getSignedInUser(),[i,y]=h.useState(!1),[M,W]=h.useState(!1),{isFeatureEnabled:L}=c(j.isReportsCommentingEnabled);if(l==null)throw Error("Can't access reports page without signing in...");const B=m(n=>P(n)),X=B.company?.companyInfo.firstMonthOfFY??1,ee=pa(L?B?.companyId:void 0),C=m(n=>g(n).fetchState),ae=m(n=>Ie(n)),{areTenantIdsInSync:b}=Ke(),R=m(n=>n.financeStatementState.selectedReportId),se=m(n=>g(n).isCompareModeOn),_=m(n=>g(n).filter),T=m(n=>g(n).selectedReportAndTimeframeFetchState),te=m(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);h.useEffect(()=>{!i&&b&&(y(!0),s(F(l.userId,!0,!0,!1)))},[i,l,s,b]),h.useEffect(()=>{i&&!M&&C==="Completed"&&b&&(s(F(l.userId,!1,!0,!1)),W(!0))},[i,M,C,b]),h.useEffect(()=>{if(i&&T.fetchState==="Not-Started"&&_.timeframe!=="free_range"&&_.timeframe!=="week"&&b)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(we(_.timeframe));break;case"profit_and_loss_by_projects":s(ge(_.timeframe));break;case"balance_sheet":s(Ce(_.timeframe));break;case"cash_flow":s(ye(_.timeframe))}},[i,R,T,b]);const v=We(),oe=v?.loggedInUserRole!=null&&Se(v?.loggedInUserRole)!==!0,[ne,re]=h.useState(!1),U=n=>{re(n)},ie=Xe(),le=ca();return function(n){const{isDataReady:ce}=n,{pathname:de}=V(),x=Qe(de??"")==="reports",pe=ia(ce),fe=h.useMemo(()=>x?ma:void 0,[x]);la({canFetchSuggestedQuestions:pe,pageContexts:fe})}({isDataReady:C==="Completed"}),da({isDataReady:C==="Completed"}),d.jsxs(d.Fragment,{children:[C==="Completed"?d.jsx(ea,{analytics:E,onLoad:n=>n.trackPageLoaded(aa.Event.reports)}):null,d.jsx(fa,{isAppContentDrawerOpen:ne,handleDrawerToggle:U}),d.jsx(_a,{firstMonthOfFY:X,tenantEmailDomain:r,location:t,navigate:a,windowSize:p,classViewLayout:te,selectedReportID:R,analytics:E,filter:_,isCompareModeOn:se,hasTransactionAccess:oe,signedInUser:l,selectedReportAndTimeframeFetchState:T,handleDrawerToggle:U,reportsResyncFetchState:ae.reportsResyncFetchState,isAiCfoAccessEnabled:le&&ie&&!e,onAskAiCfoClick:()=>{if(u){const n=K(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0)},isHorizontalClassReportSwitchEnabled:f,isReportsCommentingEnabled:L,initialOpenThreadRequest:ee})]})}const S=e=>{switch(e){case"profit_and_loss":return"Profit & Loss";case"balance_sheet":return"Balance Sheet";case"cash_flow":return"Cash Flow";default:return"Reports"}};function Ua(){const e=m(s=>P(s)),{useFeatureGate:o}=Z(),{isFeatureEnabled:p}=o(j.isDebitCardFeatureEnabled),u=qe(p,e),a=$e(e);return u===!0||a===!0?d.jsx(ra,{}):d.jsxs(be,{children:[d.jsx(z,{path:"/",element:d.jsx(ha,{})}),d.jsx(z,{path:"*",element:d.jsx(na,{})})]})}export{Ua as default};
1
+ import{j as d}from"./liveblocks-Cqbf2YvG.js";import{u as V,j as me,h as ue,l as _e,g as m,k as he,n as be,o as z}from"./core-DZE88rLA.js";import{eM as P,f8 as g,Ip as Ie,pr as F,iY as ye,h_ as Ce,sN as ge,pw as we,bu as Se,Iq as Re,Ir as Te,j8 as Fe,bm as Oe,tP as ke,Is as Ae,It as De,sI as je,sM as Ee,Iu as H,Iv as Pe,Iw as Me,Ix as Le,Iy as Be,Iz as w,IA as O,IB as k,IC as G,ID as A,IE as D,dF as ve,tv as Ue,tj as Y,tk as N,tB as xe,to as q,tH as Ve,IF as ze,IG as He,IH as Ge,II as Ye,IJ as Ne,eT as qe,eR as $e}from"./zeni-epic-state-Cc2P4FPR.js";import{E as Qe,F as Ze,Z as Je,a as Z,i as j,z as J,H as Ke,j as We,c as Xe,w as ea,d as E,f as aa,r as K,N as sa,O as ta,Q as oa}from"./index-BET54Nt-.js";import"./mui-B4xUUoCx.js";import na from"./NotFoundScreen-BM3DcBu4.js";import{F as ra}from"./FeaturePreviewScreen-3Cs41rNa.js";import{a as h}from"./sentry-gLPXz4Yq.js";import{u as ia,a as la,b as ca,c as da}from"./useFetchSuggestedQuestionsWhenReady-CZP4Iues.js";import{u as pa}from"./useInitialThreadRequest-DFJpueCY.js";import{t as $,a as Q}from"./routePaths-BNouI24c.js";import{M as fa}from"./MobileAppDrawer-D0-D1IIa.js";import"./recharts-3_XOsuaw.js";import"./lottie-BMcMDJUW.js";import"./analytics-Cp5F-UjF.js";import"./plaid-G98kqTnM.js";import"./dnd-B4DEM2bW.js";import"./stripe-DMRn4zHo.js";import"./lexical-Bp_BNV6r.js";import"./pdf-DYKlsr3c.js";import"./utils-oW6HiHsc.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]="65f66b35-6f62-45d4-9bc1-82fcb49088f8",e._sentryDebugIdIdentifier="sentry-dbid-65f66b35-6f62-45d4-9bc1-82fcb49088f8")}catch{}})();const ma=["profit_loss","balance_sheet","cash_flow"],I=e=>{e(D({resetLeftScroll:!0})),e(A({resetLeftScroll:!0})),e(k({resetLeftScroll:!0})),e(O({resetLeftScroll:!0}))},ua=e=>{e(He()),e(Ge()),e(Ye()),e(Ne())},_a=he(function(e){const o=J.getSignedInUser(),p=e.tenantState.currentTenantId,u=P(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:p??""},t=g(e),r=Re(u);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:E,isZeniUser:Oe(o),showAccountGroups:r===!0,isAccountingClassesEnabled:Fe(e),isAccountingProjectsEnabled:Te(e),currentTenantCompanyName:a,statementEndPoint:`${oa}/statement`,authParams:s,isZeniCOAUsed:r}},function(e,o){const{navigate:p,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(F(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(ze(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(Ve(a)),s){const{isCompareModeOn:r,filter:c}=o,{additionalBalances:f,balancesRange:l}=c;let i=[...f];a==="year"&&(i=i.filter(y=>y!=="this_period_vs_same_period_last_year"&&y!=="this_period_vs_same_period_last_year_percent"&&y!=="same_period_last_year")),e(Y(o.firstMonthOfFY,r,l.numberOfPeriods<4?4:l.numberOfPeriods,i)),f.length>0&&e(N(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",l.numberOfPeriods<4?4:l.numberOfPeriods,i))}t!==!0&&setTimeout(()=>I(e),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(w(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(q({numberOfPeriods:4,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(H({classViewLayout:"vertical"})),I(e)},onCOABalancesRangeChanged:(a,s)=>{e(q(a,s)),I(e)},onThisPeriodChanged:(a,s,t)=>{e(xe(o.firstMonthOfFY,a,s<4?4:s)),t!==!0&&I(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(Y(o.firstMonthOfFY,a,t<4?4:t,s)),s.length>0&&e(N(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<4?4:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout(()=>I(e),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(Ue({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<4?4:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,c;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,c=ve(s)):s.balanceTimeFrame==="year"?(r="quarter",c={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),c!=null&&r!=null){const f=a.accountName===""?a.accountDescription:a.accountName,l=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return $(o.tenantEmailDomain,a.accountId,a.accountType,f,r,c);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return Q(o.tenantEmailDomain,a.accountId,a.accountType,s.id,f,r,c)}return a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?Q(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],f,r,c):a.accountType!=null?$(o.tenantEmailDomain,a.accountId,a.accountType,f,r,c):void 0})();if(l!=null){const i=K(o.location.state?.pathnameStackToGoBack,o.location.pathname);p(l,{state:{pathnameStackToGoBack:i,referrer:S(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(D({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(A({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(G({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"profit_and_loss_by_projects":e(G({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(Le({viewMode:a})),e(Be({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",S(o.selectedReportID)),e(w("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",S(o.selectedReportID)),e(w("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",S(o.selectedReportID)),e(w("profit_and_loss"))),I(e)},onUpdateClassesToFilterOut:a=>{e(Me({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(Pe({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(H({classViewLayout:a}))},onOpenAccountViewMode:()=>{e(je()),e(Ee())},onUpdateDisplayOrder:a=>{e(De(a))},onUpdateReportFormat:a=>{ua(e),e(Ae(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(ke("profit_and_loss_by_classes"))}}})(sa);function ha(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Ze(),p=Je(),u=ta(p),a=me(),s=ue(),t=V(),{tenantEmailDomain:r}=_e(),{useFeatureGate:c}=Z(),{isFeatureEnabled:f}=c(j.isReportsHorizontalClassLayoutSwitchEnabled),l=J.getSignedInUser(),[i,y]=h.useState(!1),[M,W]=h.useState(!1),{isFeatureEnabled:L}=c(j.isReportsCommentingEnabled);if(l==null)throw Error("Can't access reports page without signing in...");const B=m(n=>P(n)),X=B.company?.companyInfo.firstMonthOfFY??1,ee=pa(L?B?.companyId:void 0),C=m(n=>g(n).fetchState),ae=m(n=>Ie(n)),{areTenantIdsInSync:b}=Ke(),R=m(n=>n.financeStatementState.selectedReportId),se=m(n=>g(n).isCompareModeOn),_=m(n=>g(n).filter),T=m(n=>g(n).selectedReportAndTimeframeFetchState),te=m(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);h.useEffect(()=>{!i&&b&&(y(!0),s(F(l.userId,!0,!0,!1)))},[i,l,s,b]),h.useEffect(()=>{i&&!M&&C==="Completed"&&b&&(s(F(l.userId,!1,!0,!1)),W(!0))},[i,M,C,b]),h.useEffect(()=>{if(i&&T.fetchState==="Not-Started"&&_.timeframe!=="free_range"&&_.timeframe!=="week"&&b)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(we(_.timeframe));break;case"profit_and_loss_by_projects":s(ge(_.timeframe));break;case"balance_sheet":s(Ce(_.timeframe));break;case"cash_flow":s(ye(_.timeframe))}},[i,R,T,b]);const v=We(),oe=v?.loggedInUserRole!=null&&Se(v?.loggedInUserRole)!==!0,[ne,re]=h.useState(!1),U=n=>{re(n)},ie=Xe(),le=ca();return function(n){const{isDataReady:ce}=n,{pathname:de}=V(),x=Qe(de??"")==="reports",pe=ia(ce),fe=h.useMemo(()=>x?ma:void 0,[x]);la({canFetchSuggestedQuestions:pe,pageContexts:fe})}({isDataReady:C==="Completed"}),da({isDataReady:C==="Completed"}),d.jsxs(d.Fragment,{children:[C==="Completed"?d.jsx(ea,{analytics:E,onLoad:n=>n.trackPageLoaded(aa.Event.reports)}):null,d.jsx(fa,{isAppContentDrawerOpen:ne,handleDrawerToggle:U}),d.jsx(_a,{firstMonthOfFY:X,tenantEmailDomain:r,location:t,navigate:a,windowSize:p,classViewLayout:te,selectedReportID:R,analytics:E,filter:_,isCompareModeOn:se,hasTransactionAccess:oe,signedInUser:l,selectedReportAndTimeframeFetchState:T,handleDrawerToggle:U,reportsResyncFetchState:ae.reportsResyncFetchState,isAiCfoAccessEnabled:le&&ie&&!e,onAskAiCfoClick:()=>{if(u){const n=K(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0)},isHorizontalClassReportSwitchEnabled:f,isReportsCommentingEnabled:L,initialOpenThreadRequest:ee})]})}const S=e=>{switch(e){case"profit_and_loss":return"Profit & Loss";case"balance_sheet":return"Balance Sheet";case"cash_flow":return"Cash Flow";default:return"Reports"}};function Ua(){const e=m(s=>P(s)),{useFeatureGate:o}=Z(),{isFeatureEnabled:p}=o(j.isDebitCardFeatureEnabled),u=qe(p,e),a=$e(e);return u===!0||a===!0?d.jsx(ra,{}):d.jsxs(be,{children:[d.jsx(z,{path:"/",element:d.jsx(ha,{})}),d.jsx(z,{path:"*",element:d.jsx(na,{})})]})}export{Ua as default};
@@ -1 +1 @@
1
- import{j as a}from"./liveblocks-dlvb-ucF.js";import{a as x,z as j,aI as y,w as E,d as p,f as F,cy as P,i as L}from"./index-eyGUyZ3T.js";import"./mui-C9WBrZQt.js";import l from"./NotFoundScreen-CNrR5P_G.js";import{a as d}from"./sentry-DGJ961LO.js";import{h as T,g as b,j as V,u as A,k as R,n as U,o as f}from"./core-D85lL_9t.js";import{eM as z,P0 as C,LS as Y,P1 as k,ta as G,eZ as M,P2 as O,t8 as Z}from"./zeni-epic-state-De57_V18.js";import{R as w}from"./ReferralListScreen-DDAnd9kQ.js";import"./recharts-BYSqK3LX.js";import"./lottie-DGXsyyYr.js";import"./analytics-BAQwJULS.js";import"./plaid-BveLUCs7.js";import"./dnd-P1ekKsf6.js";import"./stripe-DMRn4zHo.js";import"./lexical-C7vBKQl2.js";import"./pdf-DebxFbW1.js";import"./utils-4E0JE-n2.js";import"./useAskAiCfoHostNavButtonProps-D7VmZhkv.js";import"./useFetchSuggestedQuestionsWhenReady-vh4emZ7O.js";import"./MobileAppDrawer-Cq6umKbp.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]="51f4d947-3813-4bf5-9736-beed0ec52518",e._sentryDebugIdIdentifier="sentry-dbid-51f4d947-3813-4bf5-9736-beed0ec52518")}catch{}})();const q=R(function(e,t){const n=C(e);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}},function(e,t){const{navigate:n}=t,o=j.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(Z())},onUpdateInviteFormLocalData:s=>{e(O({localData:s}))},onSubmitSuccess:()=>{n("../../")},onCancelClick:()=>{o!=null&&p.trackInviteEmailClicked("cancel")}}})(P),B=()=>{const e=T(),[t,n]=d.useState(!1),[o,s]=d.useState(!1),r=b(i=>z(i)),c=V(),S=A(),{useDynamicConfig:g}=x(),u=j.getSignedInUser();if(u==null)throw Error("Can't access invite referral screen without signing in...");const m=b(i=>C(i)),_=u?.firstName!=null?u.firstName:"User",{configValue:h}=g(y.zeniCardsConfig),{configValue:v}=g(y.zeniAccountsConfig),D=Y(v);d.useEffect(()=>{e(k()),r?.rewardsLastViewedTime==null&&o===!1&&(e(G()),s(!0))},[]),d.useEffect(()=>{t||m.fetchState!=="Not-Started"||(n(!0),e(M(!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(q,{navigate:c,location:S,currentTenant:r,companyName:I,userName:_,inviteFormCompayData:m.localData,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,maxAnnualPercentageYield:D.maxAnnualPercentageYield})]})};function ue(){const{useFeatureGate:e}=x(),{isFeatureEnabled:t}=e(L.isReferralFeatureEnabled);return a.jsxs(U,{children:[a.jsx(f,{path:"/",element:t?a.jsx(w,{}):a.jsx(l,{})}),a.jsx(f,{path:"how-it-works",element:t?a.jsx(w,{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{ue as default};
1
+ import{j as a}from"./liveblocks-Cqbf2YvG.js";import{a as x,z as j,aI as y,w as E,d as p,f as F,cy as P,i as L}from"./index-BET54Nt-.js";import"./mui-B4xUUoCx.js";import l from"./NotFoundScreen-BM3DcBu4.js";import{a as d}from"./sentry-gLPXz4Yq.js";import{h as T,g as b,j as V,u as A,k as R,n as U,o as f}from"./core-DZE88rLA.js";import{eM as z,P0 as C,LS as Y,P1 as k,ta as G,eZ as M,P2 as O,t8 as Z}from"./zeni-epic-state-Cc2P4FPR.js";import{R as w}from"./ReferralListScreen-CU0cqYp3.js";import"./recharts-3_XOsuaw.js";import"./lottie-BMcMDJUW.js";import"./analytics-Cp5F-UjF.js";import"./plaid-G98kqTnM.js";import"./dnd-B4DEM2bW.js";import"./stripe-DMRn4zHo.js";import"./lexical-Bp_BNV6r.js";import"./pdf-DYKlsr3c.js";import"./utils-oW6HiHsc.js";import"./useAskAiCfoHostNavButtonProps-CIwJkrUG.js";import"./useFetchSuggestedQuestionsWhenReady-CZP4Iues.js";import"./MobileAppDrawer-D0-D1IIa.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]="51f4d947-3813-4bf5-9736-beed0ec52518",e._sentryDebugIdIdentifier="sentry-dbid-51f4d947-3813-4bf5-9736-beed0ec52518")}catch{}})();const q=R(function(e,t){const n=C(e);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}},function(e,t){const{navigate:n}=t,o=j.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(Z())},onUpdateInviteFormLocalData:s=>{e(O({localData:s}))},onSubmitSuccess:()=>{n("../../")},onCancelClick:()=>{o!=null&&p.trackInviteEmailClicked("cancel")}}})(P),B=()=>{const e=T(),[t,n]=d.useState(!1),[o,s]=d.useState(!1),r=b(i=>z(i)),c=V(),S=A(),{useDynamicConfig:g}=x(),u=j.getSignedInUser();if(u==null)throw Error("Can't access invite referral screen without signing in...");const m=b(i=>C(i)),_=u?.firstName!=null?u.firstName:"User",{configValue:h}=g(y.zeniCardsConfig),{configValue:v}=g(y.zeniAccountsConfig),D=Y(v);d.useEffect(()=>{e(k()),r?.rewardsLastViewedTime==null&&o===!1&&(e(G()),s(!0))},[]),d.useEffect(()=>{t||m.fetchState!=="Not-Started"||(n(!0),e(M(!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(q,{navigate:c,location:S,currentTenant:r,companyName:I,userName:_,inviteFormCompayData:m.localData,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,maxAnnualPercentageYield:D.maxAnnualPercentageYield})]})};function ue(){const{useFeatureGate:e}=x(),{isFeatureEnabled:t}=e(L.isReferralFeatureEnabled);return a.jsxs(U,{children:[a.jsx(f,{path:"/",element:t?a.jsx(w,{}):a.jsx(l,{})}),a.jsx(f,{path:"how-it-works",element:t?a.jsx(w,{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{ue as default};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-Byj-cT7T.js","assets/sentry-DGJ961LO.js","assets/core-D85lL_9t.js","assets/zeni-epic-state-De57_V18.js","assets/index-eyGUyZ3T.js","assets/mui-C9WBrZQt.js","assets/analytics-BAQwJULS.js","assets/utils-4E0JE-n2.js","assets/withTransactionSidePanel-BjZspg1h.js","assets/useAskAiCfoHostNavButtonProps-D7VmZhkv.js","assets/useFetchSuggestedQuestionsWhenReady-vh4emZ7O.js","assets/TransactionDetailScreen-lfCtA1jG.js","assets/decodeURIComponentSafe-ByB9WhLS.js","assets/routePaths-Ckqdpqo6.js","assets/NotFoundScreen-CNrR5P_G.js","assets/analyticsHelper-D9biWtDJ.js","assets/CompanyPassportScreen-dMXV1qo-.js","assets/MobileAppDrawer-Cq6umKbp.js","assets/FeaturePreviewScreen-CHkVgg1G.js","assets/ReferralListScreen-DDAnd9kQ.js","assets/index-D-vub4_t.css","assets/BillPayRoutes-BSgAGGub.js","assets/AddressScreen-BqbCkW9F.js","assets/DomesticWireDetailScreen-BwBgY_jC.js","assets/useInitialThreadRequest-CdZgxQMw.js","assets/DrawerScreen-7RB3pd-L.js","assets/SetupPagesScreen-C7kgTCyu.js","assets/BusinessVerificationPageScreen-S9e9j7rw.js","assets/BillPayApprovalRoutes-Bolmrdjm.js","assets/ReimbursementApprovalRuleDetailScreen-mjO0EFcS.js","assets/getLocaleForTenant-ClrmJsWr.js","assets/ReimbursementRoutes-DM6_XIzS.js","assets/ReimbursementApprovalRoutes-DtjTNMyW.js","assets/TransactionListRoutes-C2Nh8rHE.js","assets/ZeniAccountStatementScreen-BjUITEnt.js","assets/SettingsRoutes-CwWBls5-.js","assets/accountMappingHelper-DVEV1WRI.js","assets/QBOConnectionScreen-mxlQ58sF.js","assets/empty-vrCkOfCr.js","assets/index-BUCtSz30.js","assets/url-DoymNVR-.js","assets/index-BPbXNCzw.js","assets/ReportsRoutes-CSv8fmaw.js","assets/ChargeCardRoutes-BEYtqvNa.js","assets/PeopleRoutes-BpIaCleR.js","assets/ExpenseAutomationRoutes-Rd1hQhl9.js","assets/TreasuryRoutes-BTPTKFd8.js","assets/VendorsRoutes-B0tRBNsh.js","assets/pathToGoBack-Bl_9p4QB.js","assets/ZeniAccountRoutes-wiCc-pYp.js","assets/AddressRoutes-DILxRnu9.js","assets/PandLWithForecastRoutes-DovBC5qm.js","assets/CustomerOnboardingRoutes-CErJ4D5a.js","assets/TransactionDetailRoutes-a-PE8_JU.js","assets/EntityDetailRoutes-2Lvrz1et.js","assets/NotificationRoutes-UDRP-d_i.js","assets/PerformanceRoutes-DD5yUPPu.js","assets/RewardsRoutes-CQy-a7uv.js","assets/TaskRoutes-CHbekD_1.js","assets/TaskListScreen-vJcR4Bnk.js","assets/AiCfoScreen-Cn0zhkC5.js"])))=>i.map(i=>d[i]);
2
- import{_ as a,bm as os,eM as ls,eT as cs,eR as ds,eS as ms,fD as us,eO as _s,cM as Ae,ct as As,f9 as Es,cl as ps,bB as Is,bp as gs,fe as xs,v as Ts,I1 as hs,bu as js,I2 as Us,bD as Ds,fb as Hs,bC as Rs,br as bs,cN as ys,I3 as fs,I4 as Cs,cJ as vs,cL as Os,cK as Ps,cs as Fs,cy as Ls,m3 as Ee,eN as pe,I5 as Bs,fi as Ie,fI as ge,fJ as xe,fj as ks}from"./zeni-epic-state-De57_V18.js";import{j as e}from"./liveblocks-dlvb-ucF.js";import{a as v}from"./sentry-DGJ961LO.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-D85lL_9t.js";import{m as ws,u as zs,z as H,a as Gs,c as $s,K as Ys,i as L,j as Ws,L as B,D as he,t as _,P as qs,d as X,l}from"./index-eyGUyZ3T.js";import"./mui-C9WBrZQt.js";import{f as je}from"./analyticsHelper-D9biWtDJ.js";import{t as Js}from"./getLocaleForTenant-ClrmJsWr.js";import"./recharts-BYSqK3LX.js";import"./lottie-DGXsyyYr.js";import"./analytics-BAQwJULS.js";import"./plaid-BveLUCs7.js";import"./dnd-P1ekKsf6.js";import"./stripe-DMRn4zHo.js";import"./lexical-C7vBKQl2.js";import"./pdf-DebxFbW1.js";import"./utils-4E0JE-n2.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]="822f1e66-7c88-446a-9545-c4157d6f1e61",i._sentryDebugIdIdentifier="sentry-dbid-822f1e66-7c88-446a-9545-c4157d6f1e61")}catch{}})();const Ks={dashboard:()=>a(()=>import("./DashboardRoutes-Byj-cT7T.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-BSgAGGub.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-DM6_XIzS.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-C2Nh8rHE.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,13,34,20])),settings:()=>a(()=>import("./SettingsRoutes-CwWBls5-.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,22,14,15,27,13,16,37,38,39,40,41,12,28,29,32,20])),reports:()=>a(()=>import("./ReportsRoutes-CSv8fmaw.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,14,18,10,24,13,17,20])),chargeCards:()=>a(()=>import("./ChargeCardRoutes-BEYtqvNa.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,26,17,14,15,13,27,9,10,22,20])),people:()=>a(()=>import("./PeopleRoutes-BpIaCleR.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,14,9,10,17,20])),expenseAutomation:()=>a(()=>import("./ExpenseAutomationRoutes-Rd1hQhl9.js"),__vite__mapDeps([45,1,2,3,14,4,5,6,7,9,10,11,12,13,8,36,25,20])),treasury:()=>a(()=>import("./TreasuryRoutes-BTPTKFd8.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,14,26,17,15,13,27,9,10,18,20])),vendors:()=>a(()=>import("./VendorsRoutes-B0tRBNsh.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,22,14,18,13,48,9,10,17,25,36,20])),zeniAccounts:()=>a(()=>import("./ZeniAccountRoutes-wiCc-pYp.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,14,26,17,15,13,27,18,23,22,9,10,34,20]))},Qs=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=i=>{"requestIdleCallback"in window?requestIdleCallback(i):setTimeout(i,100)},Xs=l(()=>a(()=>import("./ReportsRoutes-CSv8fmaw.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,14,18,10,24,13,17,20]))),ea=l(()=>a(()=>import("./AddressRoutes-DILxRnu9.js"),__vite__mapDeps([50,1,2,3,22,4,5,6,7,14,20]))),sa=l(()=>a(()=>import("./PeopleRoutes-BpIaCleR.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,14,9,10,17,20]))),aa=l(()=>a(()=>import("./PandLWithForecastRoutes-DovBC5qm.js"),__vite__mapDeps([51,1,2,3,4,5,6,7,14,18,9,10,24,13,17,20]))),na=l(()=>a(()=>import("./CustomerOnboardingRoutes-CErJ4D5a.js"),__vite__mapDeps([52,1,2,3,22,4,5,6,7,14,37,38,39,40,41,12,20]))),ta=l(()=>a(()=>import("./VendorsRoutes-B0tRBNsh.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,22,14,18,13,48,9,10,17,25,36,20]))),ia=l(()=>a(()=>import("./TransactionDetailRoutes-a-PE8_JU.js"),__vite__mapDeps([53,1,2,3,14,4,5,6,7,11,9,10,12,13,20]))),Ue=l(()=>a(()=>import("./EntityDetailRoutes-2Lvrz1et.js"),__vite__mapDeps([54,1,2,3,4,5,6,7,12,8,9,10,11,13,20]))),ra=l(()=>a(()=>import("./DashboardRoutes-Byj-cT7T.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]))),De=l(()=>a(()=>import("./BillPayRoutes-BSgAGGub.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-CwWBls5-.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,22,14,15,27,13,16,37,38,39,40,41,12,28,29,32,20]))),He=l(()=>a(()=>import("./ReimbursementRoutes-DM6_XIzS.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-wiCc-pYp.js"),__vite__mapDeps([49,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-BTPTKFd8.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,14,26,17,15,13,27,9,10,18,20]))),da=l(()=>a(()=>import("./TransactionListRoutes-C2Nh8rHE.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,13,34,20]))),ma=l(()=>a(()=>import("./ChargeCardRoutes-BEYtqvNa.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,26,17,14,15,13,27,9,10,22,20]))),ua=l(()=>a(()=>import("./NotificationRoutes-UDRP-d_i.js"),__vite__mapDeps([55,1,2,3,14,4,5,6,7,9,10,20]))),_a=l(()=>a(()=>import("./PerformanceRoutes-DD5yUPPu.js"),__vite__mapDeps([56,1,2,3,14,4,5,6,7,9,10,17,20]))),Aa=l(()=>a(()=>import("./ExpenseAutomationRoutes-Rd1hQhl9.js"),__vite__mapDeps([45,1,2,3,14,4,5,6,7,9,10,11,12,13,8,36,25,20]))),Ea=l(()=>a(()=>import("./RewardsRoutes-CQy-a7uv.js"),__vite__mapDeps([57,1,2,3,4,5,6,7,14,19,9,10,17,20]))),pa=l(()=>a(()=>import("./TaskRoutes-CHbekD_1.js"),__vite__mapDeps([58,1,2,3,14,4,5,6,7,24,17,59,9,10,20]))),Ia=l(()=>a(()=>import("./AiCfoScreen-Cn0zhkC5.js"),__vite__mapDeps([60,1,2,3,4,5,6,7,48,20]))),y=l(()=>a(()=>import("./NotFoundScreen-CNrR5P_G.js"),__vite__mapDeps([14,1,2,3,4,5,6,7,20]))),ga=l(()=>a(()=>import("./TaskListScreen-vJcR4Bnk.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:f,clearAllLoading:O,clearLoading:Z}=zs(),b=H.getSignedInUserTenant(o)?.tenantId,h=H.getSignedInUser(),J=os(h),G=Ms(),[N,be]=v.useState(!1),r=z(n=>ls(n)),{useFeatureGate:P}=Gs(),K=$s(),ye=Ys(),{isFeatureEnabled:fe}=P(L.isExpenseAutomationEnabled),{isFeatureEnabled:Ce}=P(L.isExpenseAutomationEnabledV2),ve=Ce||fe&&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),Y=z(n=>us(n));if(o!=null){const n=H.getSignedInUserTenant(o);h!=null&&n!=null&&je(h,r,S)}const w={tenantId:b,userId:h?.userId,sessionId:h?.zeniSessionId},ae=_s(),A=Ws(),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(()=>{f(B.TENANT_FETCHING),i(o)},[o]),v.useEffect(()=>{if(Q!=null&&b!=null){const n=Q.params.selectedPeriod;if(n!=null){const D=n.split("-");if(D.length===2){const d=ps(Number(D[0])),s=Number(D[1]),m=Is(`01-${d<10?`0${d}`:d}-${s}`,he.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),M=gs();m.isAfter(M,"month")===!1?U(xs(b,{month:d,year:s})):V("./month_end_close_checks/review")}}}},[Q,b]),v.useEffect(()=>{N||(be(!0),f(B.TENANT_FETCHING)),ne.current?ne.current=!1:!Ts(ae,w)&&H.isSignedIn()&&(f(B.TENANT_FETCHING),function(n,D,d,s){if(pe(D?.userId,D?.zeniSessionId,n.tenantId),d(Bs(!0)),d(Ie(n.tenantId)),n.tenantId!=null&&_.clearTenant(n.tenantId),n.tenantId!=null){const m=H.getSignedInUserTenantWithId(n.tenantId);s&&he.updateAppLocaleID(Js(s)),m?.tenantEmailDomain!=null&&H.saveActiveTenantDomainForUser(m?.tenantEmailDomain)}n.userId!=null?X.identify(n.userId,{tenant_id:n.tenantId}):X.resetUserIdentity()}(w,h,U,Me))},[w,ae,h,U,H]),v.useEffect(()=>{H.isSignedIn()&&(f(B.TENANT_FETCHING),function(n,D,d,s,m,M,k){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const W=s!=null&&m?.zeniSessionId!=null,ts=d==null||d.tenantId!==s,is=d!=null&&d.excludedResources==null,rs=d!=null&&d.externalConnections==null;if(W&&ts){k(Ie(s));const q=H.getSignedInUserTenantWithId(s);q?.tenantEmailDomain!=null&&H.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 W&&is&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(ge(m.userId,s))),W&&rs&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(xe(m.userId,s)));if(W){X.identify(m.userId,{tenant_id:s});const q=s==null||s!=null&&(D==="Completed"||D==="Error");n==="Completed"||D!=="Not-Started"&&D!=="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,b,h,f,U))},[b,E]),v.useEffect(()=>{H.isSignedIn()&&j==="Completed"&&Y.tenantsBaseInOrder.length>0&&(Z(B.TENANT_FETCHING),H.saveSignedInUserTenants(hs(Y.tenantsBaseInOrder)),h!=null&&je(h,r,S,void 0,Y.tenantsBaseInOrder))},[Y,j,r,h]),v.useEffect(()=>{E==="In-Progress"&&f(B.TENANT_FETCHING),E!=="Completed"&&E!=="Error"||(E==="Completed"&&b!=null?(O(),_.markActiveTenantFetchCompleted(b)):E==="Error"&&b!=null&&(_.markActiveTenantFetchFailed(b),Z(B.TENANT_FETCHING),Z(B.TENANT_SWITCHING))),j!=="Completed"&&j!=="Error"||(j==="Completed"?_.markAllTenantsFetchCompleted():j==="Error"&&_.markAllTenantsFetchFailed())},[E,j,b,N]);const ie=v.useRef(!1);v.useEffect(()=>{!ie.current&&E==="Completed"&&N&&(ie.current=!0,function(n=Qs,D=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))},D)}())},[E,N]);const C=r?.userRole!=null&&js(r?.userRole),{isFeatureEnabled:Ze}=P(L.isReferralFeatureEnabled),we=r?.userRole!=null&&r.userRole.includes("charge_card_user"),ze=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),F=r?.userRole!=null&&Ae(r.userRole),re=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!C,oe=Be&&!C,Ge=Us(A?.loggedInUserRoleMap),$e=r.externalConnections?.accounting[0]?.isValid,le=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!C,de=ce&&Ds(A?.loggedInUserRoleMap),me=Oe&&!C,Ye=r.company!=null&&Hs(r.company),We=Pe&&Ye===!0&&!C,qe=re&&Rs(A?.loggedInUserRoleMap),Je=oe&&bs(A?.loggedInUserRoleMap),Ke=me&&ys(A?.loggedInUserRoleMap),Qe=fs(A?.loggedInUserRoleMap),Xe=Cs(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=We&&I,as=oe&&g,ns=r.excludedResources?.resources?.find(n=>n.resource==="/invites")!=null||Ne===!0||Ge===!0||Qe===!0||Xe===!0;return H.isSignedIn()?b==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(R,{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(R,{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(R,{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(R,{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&&C===!1||we||ze?e.jsx(ia,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"transactions/*",element:F&&C===!1?e.jsx(da,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"customer/*",element:F&&C===!1?e.jsx(Ue,{entityType:"customer"}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isTenantBankingOnly:u,isUserHasTreasuryAccess:I,tenantEmailDomain:o})}),e.jsx(t,{path:"vendor/*",element:F&&C===!1?e.jsx(Ue,{entityType:"vendor"}):e.jsx(R,{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(R,{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(Re,{tenantEmailDomain:o})}),e.jsx(t,{path:"month_end_close_checks/review/*",element:ve&&C===!1?e.jsx(Aa,{}):e.jsx(Re,{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(De,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"bills/*",element:ue?e.jsx(De,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursement/*",element:_e?e.jsx(He,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursements/*",element:_e?e.jsx(He,{}):e.jsx(R,{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:f,isTenantBankingOnly:O,isTenantCardsOnly:Z})=>O===!0&&U?e.jsx(c,{to:"checking"}):Z===!0?e.jsx(c,{to:"cards"}):i?e.jsx(c,{to:"dashboard"}):U?e.jsx(c,{to:"checking"}):f?e.jsx(c,{to:"treasury"}):V?e.jsx(c,{to:"cards"}):o?e.jsx(c,{to:"bills"}):S?e.jsx(c,{to:"reimbursements"}):e.jsx(c,{to:"dashboard"}),R=({isUserHasZeniAccountsAccess:i,isUserHasChargeCardAccess:U,isUserHasBillPayAccess:V,isUserHasReimbursementAccess:o,isUserHasTreasuryAccess:S,isTenantBankingOnly:f,tenantEmailDomain:O})=>f===!0||i?e.jsx(Ua,{tenantEmailDomain:O}):S?e.jsx(ja,{tenantEmailDomain:O}):U?e.jsx(Da,{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`}),Da=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/cards`}),Re=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/dashboard`});export{R as FallBackRoute,Za as default};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-C2kxyP02.js","assets/sentry-gLPXz4Yq.js","assets/core-DZE88rLA.js","assets/zeni-epic-state-Cc2P4FPR.js","assets/index-BET54Nt-.js","assets/mui-B4xUUoCx.js","assets/analytics-Cp5F-UjF.js","assets/utils-oW6HiHsc.js","assets/withTransactionSidePanel-DiiilNMM.js","assets/useAskAiCfoHostNavButtonProps-CIwJkrUG.js","assets/useFetchSuggestedQuestionsWhenReady-CZP4Iues.js","assets/TransactionDetailScreen-Bgfn35GF.js","assets/decodeURIComponentSafe--utjO_hD.js","assets/routePaths-BNouI24c.js","assets/NotFoundScreen-BM3DcBu4.js","assets/analyticsHelper-BTOyHFla.js","assets/CompanyPassportScreen-BVtucNEF.js","assets/MobileAppDrawer-D0-D1IIa.js","assets/FeaturePreviewScreen-3Cs41rNa.js","assets/ReferralListScreen-CU0cqYp3.js","assets/index-D-vub4_t.css","assets/BillPayRoutes-CHzCnxpe.js","assets/AddressScreen-tCLozkzY.js","assets/DomesticWireDetailScreen-Cj8iAPXf.js","assets/useInitialThreadRequest-DFJpueCY.js","assets/DrawerScreen-Dv_UzQOo.js","assets/SetupPagesScreen-B8Rno5B2.js","assets/BusinessVerificationPageScreen-j2FAzNjV.js","assets/BillPayApprovalRoutes-BjYSk6ti.js","assets/ReimbursementApprovalRuleDetailScreen-CnM97Nh_.js","assets/getLocaleForTenant-CPndpwIp.js","assets/ReimbursementRoutes-BlPwJb9-.js","assets/ReimbursementApprovalRoutes-DghBrXt3.js","assets/TransactionListRoutes-B3VXniAo.js","assets/ZeniAccountStatementScreen-CD8WdGq8.js","assets/SettingsRoutes-DZ_F2Kb6.js","assets/accountMappingHelper-BvCdqdBq.js","assets/QBOConnectionScreen-CMvaIZxf.js","assets/empty-DTOnM0RR.js","assets/index-j9ZiGcsv.js","assets/url-DMg8GQjt.js","assets/index-BWIeQAsg.js","assets/ReportsRoutes-OsfHQ-oH.js","assets/ChargeCardRoutes-C761-FAb.js","assets/PeopleRoutes-DWNHtx0-.js","assets/ExpenseAutomationRoutes-D95clzaF.js","assets/TreasuryRoutes-CLsu4EBs.js","assets/VendorsRoutes-DTiBYFq_.js","assets/pathToGoBack-H4XoSP95.js","assets/ZeniAccountRoutes-D7fsKNF6.js","assets/AddressRoutes-BfOuxooD.js","assets/PandLWithForecastRoutes-DXeM7QQi.js","assets/CustomerOnboardingRoutes-CK9QfpeW.js","assets/TransactionDetailRoutes-Bid-ev7j.js","assets/EntityDetailRoutes-CCSZXrNV.js","assets/NotificationRoutes-fnITeGvC.js","assets/PerformanceRoutes-B2---Xlh.js","assets/RewardsRoutes-DCXhofuE.js","assets/TaskRoutes-B_fERi8e.js","assets/TaskListScreen-xi0Q2QtO.js","assets/AiCfoScreen-BHQknTzK.js"])))=>i.map(i=>d[i]);
2
+ import{_ as a,bm as os,eM as ls,eT as cs,eR as ds,eS as ms,fD as us,eO as _s,cM as Ae,ct as As,f9 as Es,cl as ps,bB as Is,bp as gs,fe as xs,v as Ts,I1 as hs,bu as js,I2 as Us,bD as Ds,fb as Hs,bC as Rs,br as bs,cN as ys,I3 as fs,I4 as Cs,cJ as vs,cL as Os,cK as Ps,cs as Fs,cy as Ls,m3 as Ee,eN as pe,I5 as Bs,fi as Ie,fI as ge,fJ as xe,fj as ks}from"./zeni-epic-state-Cc2P4FPR.js";import{j as e}from"./liveblocks-Cqbf2YvG.js";import{a as v}from"./sentry-gLPXz4Yq.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-DZE88rLA.js";import{m as ws,u as zs,z as H,a as Gs,c as $s,K as Ys,i as L,j as Ws,L as B,D as he,t as _,P as qs,d as X,l}from"./index-BET54Nt-.js";import"./mui-B4xUUoCx.js";import{f as je}from"./analyticsHelper-BTOyHFla.js";import{t as Js}from"./getLocaleForTenant-CPndpwIp.js";import"./recharts-3_XOsuaw.js";import"./lottie-BMcMDJUW.js";import"./analytics-Cp5F-UjF.js";import"./plaid-G98kqTnM.js";import"./dnd-B4DEM2bW.js";import"./stripe-DMRn4zHo.js";import"./lexical-Bp_BNV6r.js";import"./pdf-DYKlsr3c.js";import"./utils-oW6HiHsc.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]="822f1e66-7c88-446a-9545-c4157d6f1e61",i._sentryDebugIdIdentifier="sentry-dbid-822f1e66-7c88-446a-9545-c4157d6f1e61")}catch{}})();const Ks={dashboard:()=>a(()=>import("./DashboardRoutes-C2kxyP02.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-CHzCnxpe.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-BlPwJb9-.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-B3VXniAo.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,13,34,20])),settings:()=>a(()=>import("./SettingsRoutes-DZ_F2Kb6.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,22,14,15,27,13,16,37,38,39,40,41,12,28,29,32,20])),reports:()=>a(()=>import("./ReportsRoutes-OsfHQ-oH.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,14,18,10,24,13,17,20])),chargeCards:()=>a(()=>import("./ChargeCardRoutes-C761-FAb.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,26,17,14,15,13,27,9,10,22,20])),people:()=>a(()=>import("./PeopleRoutes-DWNHtx0-.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,14,9,10,17,20])),expenseAutomation:()=>a(()=>import("./ExpenseAutomationRoutes-D95clzaF.js"),__vite__mapDeps([45,1,2,3,14,4,5,6,7,9,10,11,12,13,8,36,25,20])),treasury:()=>a(()=>import("./TreasuryRoutes-CLsu4EBs.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,14,26,17,15,13,27,9,10,18,20])),vendors:()=>a(()=>import("./VendorsRoutes-DTiBYFq_.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,22,14,18,13,48,9,10,17,25,36,20])),zeniAccounts:()=>a(()=>import("./ZeniAccountRoutes-D7fsKNF6.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,14,26,17,15,13,27,18,23,22,9,10,34,20]))},Qs=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=i=>{"requestIdleCallback"in window?requestIdleCallback(i):setTimeout(i,100)},Xs=l(()=>a(()=>import("./ReportsRoutes-OsfHQ-oH.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,14,18,10,24,13,17,20]))),ea=l(()=>a(()=>import("./AddressRoutes-BfOuxooD.js"),__vite__mapDeps([50,1,2,3,22,4,5,6,7,14,20]))),sa=l(()=>a(()=>import("./PeopleRoutes-DWNHtx0-.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,14,9,10,17,20]))),aa=l(()=>a(()=>import("./PandLWithForecastRoutes-DXeM7QQi.js"),__vite__mapDeps([51,1,2,3,4,5,6,7,14,18,9,10,24,13,17,20]))),na=l(()=>a(()=>import("./CustomerOnboardingRoutes-CK9QfpeW.js"),__vite__mapDeps([52,1,2,3,22,4,5,6,7,14,37,38,39,40,41,12,20]))),ta=l(()=>a(()=>import("./VendorsRoutes-DTiBYFq_.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,22,14,18,13,48,9,10,17,25,36,20]))),ia=l(()=>a(()=>import("./TransactionDetailRoutes-Bid-ev7j.js"),__vite__mapDeps([53,1,2,3,14,4,5,6,7,11,9,10,12,13,20]))),Ue=l(()=>a(()=>import("./EntityDetailRoutes-CCSZXrNV.js"),__vite__mapDeps([54,1,2,3,4,5,6,7,12,8,9,10,11,13,20]))),ra=l(()=>a(()=>import("./DashboardRoutes-C2kxyP02.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]))),De=l(()=>a(()=>import("./BillPayRoutes-CHzCnxpe.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-DZ_F2Kb6.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,22,14,15,27,13,16,37,38,39,40,41,12,28,29,32,20]))),He=l(()=>a(()=>import("./ReimbursementRoutes-BlPwJb9-.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-D7fsKNF6.js"),__vite__mapDeps([49,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-CLsu4EBs.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,14,26,17,15,13,27,9,10,18,20]))),da=l(()=>a(()=>import("./TransactionListRoutes-B3VXniAo.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,13,34,20]))),ma=l(()=>a(()=>import("./ChargeCardRoutes-C761-FAb.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,26,17,14,15,13,27,9,10,22,20]))),ua=l(()=>a(()=>import("./NotificationRoutes-fnITeGvC.js"),__vite__mapDeps([55,1,2,3,14,4,5,6,7,9,10,20]))),_a=l(()=>a(()=>import("./PerformanceRoutes-B2---Xlh.js"),__vite__mapDeps([56,1,2,3,14,4,5,6,7,9,10,17,20]))),Aa=l(()=>a(()=>import("./ExpenseAutomationRoutes-D95clzaF.js"),__vite__mapDeps([45,1,2,3,14,4,5,6,7,9,10,11,12,13,8,36,25,20]))),Ea=l(()=>a(()=>import("./RewardsRoutes-DCXhofuE.js"),__vite__mapDeps([57,1,2,3,4,5,6,7,14,19,9,10,17,20]))),pa=l(()=>a(()=>import("./TaskRoutes-B_fERi8e.js"),__vite__mapDeps([58,1,2,3,14,4,5,6,7,24,17,59,9,10,20]))),Ia=l(()=>a(()=>import("./AiCfoScreen-BHQknTzK.js"),__vite__mapDeps([60,1,2,3,4,5,6,7,48,20]))),y=l(()=>a(()=>import("./NotFoundScreen-BM3DcBu4.js"),__vite__mapDeps([14,1,2,3,4,5,6,7,20]))),ga=l(()=>a(()=>import("./TaskListScreen-xi0Q2QtO.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:f,clearAllLoading:O,clearLoading:Z}=zs(),b=H.getSignedInUserTenant(o)?.tenantId,h=H.getSignedInUser(),J=os(h),G=Ms(),[N,be]=v.useState(!1),r=z(n=>ls(n)),{useFeatureGate:P}=Gs(),K=$s(),ye=Ys(),{isFeatureEnabled:fe}=P(L.isExpenseAutomationEnabled),{isFeatureEnabled:Ce}=P(L.isExpenseAutomationEnabledV2),ve=Ce||fe&&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),Y=z(n=>us(n));if(o!=null){const n=H.getSignedInUserTenant(o);h!=null&&n!=null&&je(h,r,S)}const w={tenantId:b,userId:h?.userId,sessionId:h?.zeniSessionId},ae=_s(),A=Ws(),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(()=>{f(B.TENANT_FETCHING),i(o)},[o]),v.useEffect(()=>{if(Q!=null&&b!=null){const n=Q.params.selectedPeriod;if(n!=null){const D=n.split("-");if(D.length===2){const d=ps(Number(D[0])),s=Number(D[1]),m=Is(`01-${d<10?`0${d}`:d}-${s}`,he.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),M=gs();m.isAfter(M,"month")===!1?U(xs(b,{month:d,year:s})):V("./month_end_close_checks/review")}}}},[Q,b]),v.useEffect(()=>{N||(be(!0),f(B.TENANT_FETCHING)),ne.current?ne.current=!1:!Ts(ae,w)&&H.isSignedIn()&&(f(B.TENANT_FETCHING),function(n,D,d,s){if(pe(D?.userId,D?.zeniSessionId,n.tenantId),d(Bs(!0)),d(Ie(n.tenantId)),n.tenantId!=null&&_.clearTenant(n.tenantId),n.tenantId!=null){const m=H.getSignedInUserTenantWithId(n.tenantId);s&&he.updateAppLocaleID(Js(s)),m?.tenantEmailDomain!=null&&H.saveActiveTenantDomainForUser(m?.tenantEmailDomain)}n.userId!=null?X.identify(n.userId,{tenant_id:n.tenantId}):X.resetUserIdentity()}(w,h,U,Me))},[w,ae,h,U,H]),v.useEffect(()=>{H.isSignedIn()&&(f(B.TENANT_FETCHING),function(n,D,d,s,m,M,k){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const W=s!=null&&m?.zeniSessionId!=null,ts=d==null||d.tenantId!==s,is=d!=null&&d.excludedResources==null,rs=d!=null&&d.externalConnections==null;if(W&&ts){k(Ie(s));const q=H.getSignedInUserTenantWithId(s);q?.tenantEmailDomain!=null&&H.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 W&&is&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(ge(m.userId,s))),W&&rs&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(xe(m.userId,s)));if(W){X.identify(m.userId,{tenant_id:s});const q=s==null||s!=null&&(D==="Completed"||D==="Error");n==="Completed"||D!=="Not-Started"&&D!=="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,b,h,f,U))},[b,E]),v.useEffect(()=>{H.isSignedIn()&&j==="Completed"&&Y.tenantsBaseInOrder.length>0&&(Z(B.TENANT_FETCHING),H.saveSignedInUserTenants(hs(Y.tenantsBaseInOrder)),h!=null&&je(h,r,S,void 0,Y.tenantsBaseInOrder))},[Y,j,r,h]),v.useEffect(()=>{E==="In-Progress"&&f(B.TENANT_FETCHING),E!=="Completed"&&E!=="Error"||(E==="Completed"&&b!=null?(O(),_.markActiveTenantFetchCompleted(b)):E==="Error"&&b!=null&&(_.markActiveTenantFetchFailed(b),Z(B.TENANT_FETCHING),Z(B.TENANT_SWITCHING))),j!=="Completed"&&j!=="Error"||(j==="Completed"?_.markAllTenantsFetchCompleted():j==="Error"&&_.markAllTenantsFetchFailed())},[E,j,b,N]);const ie=v.useRef(!1);v.useEffect(()=>{!ie.current&&E==="Completed"&&N&&(ie.current=!0,function(n=Qs,D=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))},D)}())},[E,N]);const C=r?.userRole!=null&&js(r?.userRole),{isFeatureEnabled:Ze}=P(L.isReferralFeatureEnabled),we=r?.userRole!=null&&r.userRole.includes("charge_card_user"),ze=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),F=r?.userRole!=null&&Ae(r.userRole),re=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!C,oe=Be&&!C,Ge=Us(A?.loggedInUserRoleMap),$e=r.externalConnections?.accounting[0]?.isValid,le=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!C,de=ce&&Ds(A?.loggedInUserRoleMap),me=Oe&&!C,Ye=r.company!=null&&Hs(r.company),We=Pe&&Ye===!0&&!C,qe=re&&Rs(A?.loggedInUserRoleMap),Je=oe&&bs(A?.loggedInUserRoleMap),Ke=me&&ys(A?.loggedInUserRoleMap),Qe=fs(A?.loggedInUserRoleMap),Xe=Cs(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=We&&I,as=oe&&g,ns=r.excludedResources?.resources?.find(n=>n.resource==="/invites")!=null||Ne===!0||Ge===!0||Qe===!0||Xe===!0;return H.isSignedIn()?b==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(R,{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(R,{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(R,{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(R,{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&&C===!1||we||ze?e.jsx(ia,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"transactions/*",element:F&&C===!1?e.jsx(da,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"customer/*",element:F&&C===!1?e.jsx(Ue,{entityType:"customer"}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isTenantBankingOnly:u,isUserHasTreasuryAccess:I,tenantEmailDomain:o})}),e.jsx(t,{path:"vendor/*",element:F&&C===!1?e.jsx(Ue,{entityType:"vendor"}):e.jsx(R,{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(R,{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(Re,{tenantEmailDomain:o})}),e.jsx(t,{path:"month_end_close_checks/review/*",element:ve&&C===!1?e.jsx(Aa,{}):e.jsx(Re,{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(De,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"bills/*",element:ue?e.jsx(De,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursement/*",element:_e?e.jsx(He,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursements/*",element:_e?e.jsx(He,{}):e.jsx(R,{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:f,isTenantBankingOnly:O,isTenantCardsOnly:Z})=>O===!0&&U?e.jsx(c,{to:"checking"}):Z===!0?e.jsx(c,{to:"cards"}):i?e.jsx(c,{to:"dashboard"}):U?e.jsx(c,{to:"checking"}):f?e.jsx(c,{to:"treasury"}):V?e.jsx(c,{to:"cards"}):o?e.jsx(c,{to:"bills"}):S?e.jsx(c,{to:"reimbursements"}):e.jsx(c,{to:"dashboard"}),R=({isUserHasZeniAccountsAccess:i,isUserHasChargeCardAccess:U,isUserHasBillPayAccess:V,isUserHasReimbursementAccess:o,isUserHasTreasuryAccess:S,isTenantBankingOnly:f,tenantEmailDomain:O})=>f===!0||i?e.jsx(Ua,{tenantEmailDomain:O}):S?e.jsx(ja,{tenantEmailDomain:O}):U?e.jsx(Da,{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`}),Da=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/cards`}),Re=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/dashboard`});export{R as FallBackRoute,Za as default};