@zeniai/web-app-ui 5.3.41-qa → 5.3.42-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.
- package/dist/assets/AccountMappingScreen-5txeuTng.js +9 -0
- package/dist/assets/ActualMatchingMatchDetailScreen-BvCTHIwN.js +1 -0
- package/dist/assets/AddressRoutes-CysroEs-.js +1 -0
- package/dist/assets/AddressScreen-C1CfOA8k.js +9 -0
- package/dist/assets/{AiCfoScreen-BjMYvl6E.js → AiCfoScreen-C0gnDsXr.js} +5 -5
- package/dist/assets/{AppDrawer-ByoXxMIV.js → AppDrawer-CZ5MsAyB.js} +2 -2
- package/dist/assets/{BillPayApprovalRoutes-Z4uvf0-n.js → BillPayApprovalRoutes-Dba8jEIY.js} +1 -1
- package/dist/assets/{BillPayRoutes-8zmFRoA_.js → BillPayRoutes-BInjoPbL.js} +11 -11
- package/dist/assets/BusinessVerificationPageScreen-BmHKq1LL.js +9 -0
- package/dist/assets/{CardsAiCfoScreen-B7sfpD2b.js → CardsAiCfoScreen-C6Rnq8nD.js} +1 -1
- package/dist/assets/ChargeCardRoutes-P239JK-b.js +71 -0
- package/dist/assets/{CompanyPassportScreen-DDKosLEE.js → CompanyPassportScreen-yPmE04_9.js} +1 -1
- package/dist/assets/ConnectionAuthScreen-6-1bG5gz.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-C__JnnR_.js +1 -0
- package/dist/assets/CustomerOnboardingRoutes-CbzzxK0y.js +30 -0
- package/dist/assets/{DashboardRoutes-B5yb7VGD.js → DashboardRoutes-DhWNQvqz.js} +4 -4
- package/dist/assets/{DefaultTenantHome-DXPTZTHs.js → DefaultTenantHome-Fsi_QjM5.js} +1 -1
- package/dist/assets/DomesticWireDetailScreen-CuBtrLRo.js +18 -0
- package/dist/assets/{DrawerScreen--7ksii2j.js → DrawerScreen-o43C4sHm.js} +1 -1
- package/dist/assets/EntityDetailRoutes-Vj0NPJut.js +1 -0
- package/dist/assets/ExpenseAutomationRoutes-faxOwOvi.js +38 -0
- package/dist/assets/FeaturePreviewScreen-CEOFkjIy.js +1 -0
- package/dist/assets/HubSpotOAuthCallbackScreen-CnHqx1ge.js +1 -0
- package/dist/assets/{InboxNotificationsProvider-D007v5X6.js → InboxNotificationsProvider-Cf5DQSg3.js} +1 -1
- package/dist/assets/{InvoicingRoutes-6Wikj2BP.js → InvoicingRoutes--kNvLDpX.js} +2 -2
- package/dist/assets/{MagicLinkRoutes-D0y8ZbiR.js → MagicLinkRoutes-_oMvrXOe.js} +8 -8
- package/dist/assets/MagicLinkSignInScreen-D2yfAbuX.js +12 -0
- package/dist/assets/MobileAppDrawer-Q8q8ssn0.js +1 -0
- package/dist/assets/NotFoundScreen-3YmbDG-O.js +1 -0
- package/dist/assets/{NotificationRoutes-La5Ef0Sp.js → NotificationRoutes-BFjfuaHE.js} +1 -1
- package/dist/assets/OAuthConsentScreen-Ce7q6w-7.js +1 -0
- package/dist/assets/PandLWithForecastRoutes-Cb8E55Qo.js +1 -0
- package/dist/assets/{PaymentLinkScreen-C3veO1_u.js → PaymentLinkScreen-CN69RRr9.js} +1 -1
- package/dist/assets/PeopleRoutes-DNCzXaoC.js +22 -0
- package/dist/assets/PerformanceRoutes-DyNYMyLi.js +1 -0
- package/dist/assets/{Preview-DA8U2xpZ.js → Preview-BCwFnEAM.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-BbB3FEE8.js → QBOConnectionScreen-DX5rBjLM.js} +1 -1
- package/dist/assets/ReimbursementApprovalRoutes-DifzmUQS.js +1 -0
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-lW1DSyNO.js → ReimbursementApprovalRuleDetailScreen-6W7aXQIv.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-03Hgu3V3.js → ReimbursementRoutes-Caztwlhg.js} +9 -9
- package/dist/assets/{ReportsRoutes-B9cy_-f4.js → ReportsRoutes-CfScWyxA.js} +1 -1
- package/dist/assets/RewardsRoutes-BaqYIdkd.js +1 -0
- package/dist/assets/ScheduleDetailsPrepaidExpensesScreen-DuraGGsO.js +33 -0
- package/dist/assets/ScreenRoutes-QNvqH_bZ.js +2 -0
- package/dist/assets/{SettingsRoutes-BAJmUy_d.js → SettingsRoutes-DzQurTcP.js} +6 -6
- package/dist/assets/{SetupPagesScreen-CNVeqnHU.js → SetupPagesScreen-CsSP_P2k.js} +5 -5
- package/dist/assets/SignInScreen-CRymVKij.js +1 -0
- package/dist/assets/SignOutScreen-B0U7u8Hy.js +9 -0
- package/dist/assets/{TaskListScreen-B_HBW--i.js → TaskListScreen-CXn6czhu.js} +2 -2
- package/dist/assets/TaskRoutes-0Yfh5AkX.js +9 -0
- package/dist/assets/TransactionDetailRoutes-BiIqbu_-.js +1 -0
- package/dist/assets/{TransactionDetailScreen-BISRvrnZ.js → TransactionDetailScreen-Cxl44PLi.js} +2 -2
- package/dist/assets/TransactionListRoutes-CBLSrFS8.js +1 -0
- package/dist/assets/{TreasuryRoutes-DQeUZ7RQ.js → TreasuryRoutes-a3UpD3kR.js} +6 -6
- package/dist/assets/{VendorsRoutes-AD9AzaGF.js → VendorsRoutes-DlFjWODu.js} +18 -18
- package/dist/assets/WiseConfirmationScreen-BJ1TyqgG.js +12 -0
- package/dist/assets/ZeniAccountRoutes-C0xgRuTa.js +57 -0
- package/dist/assets/ZeniAccountStatementScreen-C8J1M6mP.js +9 -0
- package/dist/assets/{accountMappingHelper-qlU24D2s.js → accountMappingHelper-2xXLJj4S.js} +1 -1
- package/dist/assets/{analytics-BvodL4nJ.js → analytics-CvsRIk3B.js} +1 -1
- package/dist/assets/{analyticsHelper-BBEm35nD.js → analyticsHelper-tF6p2yRC.js} +1 -1
- package/dist/assets/{core-gUqdW_kq.js → core-DGLzDXWl.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-Cst3Y24b.js → decodeURIComponentSafe-k3ZAUeWI.js} +1 -1
- package/dist/assets/{dnd-YSyN45zY.js → dnd-SnD389s6.js} +1 -1
- package/dist/assets/{empty-BAVoovBk.js → empty-BfBfVq50.js} +1 -1
- package/dist/assets/{empty-CkcqWk4Z.js → empty-BjVnPUF5.js} +1 -1
- package/dist/assets/{emptyVideoElement-DMVtoCOe.js → emptyVideoElement-Bb1KlJXy.js} +1 -1
- package/dist/assets/epic-CPuRNynX.js +2 -0
- package/dist/assets/expenseAutomationHelper-DWDIPthN.js +1 -0
- package/dist/assets/{getLocaleForTenant-BFGbVplK.js → getLocaleForTenant-CZIO6uAG.js} +1 -1
- package/dist/assets/{index-70FTEc4H.js → index-B2CKeHlo.js} +1 -1
- package/dist/assets/{index-ChcsxO47.js → index-BMI1TT7Z.js} +1 -1
- package/dist/assets/{index-1WLkQfLs.js → index-Buyjnqrt.js} +1 -1
- package/dist/assets/{index-BhZ9H0Qw.js → index-C54xa34r.js} +1 -1
- package/dist/assets/index-CQFc7TiS.js +1 -0
- package/dist/assets/{index-BzFSQsxk.js → index-CzPkUTbT.js} +2 -2
- package/dist/assets/{index-DRDpUzzs.js → index-DGjciFPC.js} +16718 -15885
- package/dist/assets/{index-6dqseRo4.js → index-DPcuwgM-.js} +1 -1
- package/dist/assets/{lexical-Euc6kCJG.js → lexical-CMBMntF_.js} +1 -1
- package/dist/assets/{liveblocks-B3m51ZRo.js → liveblocks-DRsJ0YIJ.js} +1 -1
- package/dist/assets/{lottie-DLBd_qLT.js → lottie-DEqUWUd5.js} +1 -1
- package/dist/assets/{mui-DCW4m3lZ.js → mui-BuJ3P0FU.js} +1 -1
- package/dist/assets/{pathToGoBack-Ds-XNEX3.js → pathToGoBack-BzjHaNqp.js} +1 -1
- package/dist/assets/{pdf-BDXl9G7N.js → pdf-B_v4zyN7.js} +3 -3
- package/dist/assets/{pdf-lib-Bku26ZcE.js → pdf-lib-DxbyphS9.js} +1 -1
- package/dist/assets/{plaid-BrXe9xNf.js → plaid-i7y7YD6O.js} +1 -1
- package/dist/assets/{pusher-BzxZmWnS.js → pusher-BYBfYYCn.js} +1 -1
- package/dist/assets/{react-DtuhKjd8.js → react-B90rw7na.js} +1 -1
- package/dist/assets/{react-pusavzWL.js → react-C2HSs5Iu.js} +1 -1
- package/dist/assets/{react-C43HbBFY.js → react-CAYYQ7Si.js} +1 -1
- package/dist/assets/{react-Db0eqcPH.js → react-CAr2Hff_.js} +1 -1
- package/dist/assets/{react-Cp8yT8Rr.js → react-Dm85ZpZj.js} +1 -1
- package/dist/assets/{react-FxzlmTOI.js → react-leqbcToB.js} +1 -1
- package/dist/assets/{recharts-HpXoq1DR.js → recharts-CJlXFxhv.js} +1 -1
- package/dist/assets/{routePaths-BlnN04aI.js → routePaths-COaM8xFB.js} +1 -1
- package/dist/assets/{sentry-DI7gLUjw.js → sentry-G4ZANa8Z.js} +1 -1
- package/dist/assets/stripSplatSuffix-BTaD_7hZ.js +1 -0
- package/dist/assets/{url-BVmez_R2.js → url--ciz_Nq8.js} +1 -1
- package/dist/assets/{url-qyBRakHR.js → url-CtF92dYM.js} +1 -1
- package/dist/assets/useActualMatchingMatchDetail-Dtg-Odjs.js +1 -0
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-C8tiJ4-s.js → useAiCfoDashboardSuggestedQuestionsChips-DXgID2ue.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-DY2m50un.js +1 -0
- package/dist/assets/{useChargeCardPusherEvents-K7_8wfj8.js → useChargeCardPusherEvents-C-hT_5jI.js} +1 -1
- package/dist/assets/{useDeviceId-kl-tdydV.js → useDeviceId-C9MUyzJJ.js} +1 -1
- package/dist/assets/useEmailConnectResultRefresh-B7XzuZ4T.js +1 -0
- package/dist/assets/{useInitialThreadRequest-TMWlbA40.js → useInitialThreadRequest-Cdwnj1Ib.js} +1 -1
- package/dist/assets/useTaskManagerAccess-i7vk79Wr.js +1 -0
- package/dist/assets/{utils-8Dv5nUFZ.js → utils-Bz8wuSWM.js} +1 -1
- package/dist/assets/withTransactionSidePanel-_ek7stLz.js +25 -0
- package/dist/assets/{zeni-epic-state-C-d25VTi.js → zeni-epic-state-Dm2vDWXH.js} +6 -6
- package/dist/index.html +1 -1
- package/package.json +4 -4
- package/dist/assets/AccountMappingScreen-C3HFW5Ij.js +0 -9
- package/dist/assets/AddressRoutes-Bt5wsDb7.js +0 -1
- package/dist/assets/AddressScreen-CSJE0p29.js +0 -9
- package/dist/assets/BusinessVerificationPageScreen-CmhKA9oQ.js +0 -9
- package/dist/assets/ChargeCardRoutes-C7bJJS3x.js +0 -71
- package/dist/assets/ConnectionAuthScreen-tllRDLdE.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-BtQtr6Oc.js +0 -1
- package/dist/assets/CustomerOnboardingRoutes-zfeAaUV5.js +0 -30
- package/dist/assets/DomesticWireDetailScreen-Bl1py3nW.js +0 -18
- package/dist/assets/EntityDetailRoutes-Cjc6zlA1.js +0 -1
- package/dist/assets/ExpenseAutomationRoutes-Dg2fewAy.js +0 -38
- package/dist/assets/FeaturePreviewScreen-CaIMasua.js +0 -1
- package/dist/assets/HubSpotOAuthCallbackScreen-y0UiA1as.js +0 -1
- package/dist/assets/MagicLinkSignInScreen-CYMk4ubj.js +0 -12
- package/dist/assets/MobileAppDrawer-Bh8VAeHB.js +0 -1
- package/dist/assets/NotFoundScreen-BFfoIcMt.js +0 -1
- package/dist/assets/OAuthConsentScreen-qHtuiZOo.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-AChf_KvX.js +0 -1
- package/dist/assets/PeopleRoutes-Dx-0mEVQ.js +0 -22
- package/dist/assets/PerformanceRoutes-3JW12kzP.js +0 -1
- package/dist/assets/ReimbursementApprovalRoutes-CvLfwozC.js +0 -1
- package/dist/assets/RewardsRoutes-DQIZ8X-t.js +0 -1
- package/dist/assets/ScheduleDetailsPrepaidExpensesScreen-D9k6A3OE.js +0 -33
- package/dist/assets/ScreenRoutes-DBgMcdH4.js +0 -2
- package/dist/assets/SignInScreen-_6ovFcIG.js +0 -1
- package/dist/assets/SignOutScreen-DQot6FAh.js +0 -9
- package/dist/assets/TaskRoutes-CIgfsl6U.js +0 -9
- package/dist/assets/TransactionDetailRoutes-CEwE4Bbf.js +0 -1
- package/dist/assets/TransactionListRoutes-DHaTXNgW.js +0 -1
- package/dist/assets/WiseConfirmationScreen-DnPfMtVh.js +0 -12
- package/dist/assets/ZeniAccountRoutes-BKcFRSlc.js +0 -57
- package/dist/assets/ZeniAccountStatementScreen-Cn72q1Zx.js +0 -9
- package/dist/assets/epic-DHyjKhvW.js +0 -2
- package/dist/assets/expenseAutomationHelper-DDRCXr7k.js +0 -1
- package/dist/assets/index-DhQKJDfi.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-DNzUy0g0.js +0 -1
- package/dist/assets/useEmailConnectResultRefresh-BJXmlYiy.js +0 -1
- package/dist/assets/useTaskManagerAccess-BJoTHFNB.js +0 -1
- package/dist/assets/withTransactionSidePanel-ZShW5IUX.js +0 -25
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as mt,a as lt,n as ft,j as N}from"./liveblocks-
|
|
1
|
+
import{m as mt,a as lt,n as ft,j as N}from"./liveblocks-DRsJ0YIJ.js";import ut from"./NotFoundScreen-3YmbDG-O.js";import{a as k}from"./sentry-G4ZANa8Z.js";import{h as ht,g as pt,i as kt,u as gt,j as S,l as St,n as bt,o as Q}from"./core-DGLzDXWl.js";import{cA as Tt,TM as X,fE as z,h0 as It,TQ as b,a0L as H,TW as m,TK as E,Ag as $,FY as Ct,a0M as At,TJ as Et,TY as yt,Al as _t,a0N as F,br as j,gg as x,Ap as K,a0O as Nt,cM as Bt,cF as wt}from"./zeni-epic-state-Dm2vDWXH.js";import{aq as xt,d as vt,O as Mt,c as Dt,as as Rt,dM as Pt,p as B,dN as Gt,w as Ut,dO as Ft,i as jt,a4 as $t}from"./index-DGjciFPC.js";import"./mui-BuJ3P0FU.js";import{u as Vt}from"./useAskAiCfoHostNavButtonProps-DY2m50un.js";import{u as Ot}from"./useTaskManagerAccess-i7vk79Wr.js";import"./recharts-CJlXFxhv.js";import"./analytics-CvsRIk3B.js";import"./plaid-i7y7YD6O.js";import"./dnd-SnD389s6.js";import"./stripe-cKAAJElX.js";import"./lottie-DEqUWUd5.js";import"./lexical-CMBMntF_.js";import"./pdf-B_v4zyN7.js";import"./utils-Bz8wuSWM.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]="265c7234-2007-4348-8975-60ac7a4389e6",t._sentryDebugIdIdentifier="sentry-dbid-265c7234-2007-4348-8975-60ac7a4389e6")}catch{}})();const Wt=(t,l)=>new Promise(((n,h)=>{const g=t.map((c=>new Promise((o=>{l(c),o()}))));Promise.all(g).then((()=>{setTimeout((()=>{n()}),2e3)})).catch((c=>{h(c)}))})),Lt=St((function(t,l){const n=X(t),{signedInUser:h,isDebitCardFeatureEnabled:g,isTaskManagerAccessEnabled:c}=l,o=b(t),f=z(t),{currentTab:T}=o;return{notificationView:o,isNotificationSettingsVisible:h.userEmail!=null&&yt(n.notificationSettings,h.userEmail,g,f,c),isDisabled:o.notificationDetailsByTab[T].fetchState==="In-Progress"?"disabled":void 0}}),(function(t,l){const{location:n,tenantEmailDomain:h,loggedInUserRoleMap:g,externalNotificationsUnreadCount:c,allUnreadCommentsNotificationIds:o,navigate:f,markInboxNotificationAsRead:T,fetchMoreCommentsNotifications:M}=l;return{onNotificationClick:(a,s,d,r)=>{if(r==="task_deleted"){const i=`/${h}/tasks`,I=B(n.state?.pathnameStackToGoBack,n.pathname);f(i,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}else{const i=`/${h}/tasks/${s}`,I=B(n.state?.pathnameStackToGoBack,n.pathname);f(i,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}d==="unread"&&t(K("task_manager","read",[a],!1))},onCommentNotificationClick:(a,s,d)=>{const r=s.toString().split(`/${h}/`);if(r[1]!=null){d==="unread"&&(T(a),t(F([a],j())));let i=`/${h}/${r[1]}`;const I=B(n.state?.pathnameStackToGoBack,n.pathname);r[1].startsWith("reimbursement")&&!Bt(g)&&(i="not-found"),r[1].startsWith("bill")&&!wt(g)&&(i="not-found"),f(i,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(a,s)=>{t(E(a,s))},onUpdateNotificationTabState:(a,s)=>{t(m(a,s))},onUpdateNotificationViewCurrentTabAndSubTab:(a,s)=>{t(H(a,s));const d=`../${a}`,r=B(n.state?.pathnameStackToGoBack,n.pathname);f(d,{state:{pathnameStackToGoBack:r}})},onUpdateNotificationViewSubTab:a=>{t(Nt(a))},onFetchMoreNotifications:(a,s)=>{if(a==="tasks"){const d=[];s==="all"?d.push("read","unread"):s!=="mentions"&&d.push(s),t($("task_manager","dashboard",d))}else M?.()},onUpdateNotificationStatus:(a,s,d,r)=>{a==="tasks"?t(K("task_manager",d,r)):(t(m({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(r.map((i=>{d==="read"&&(T(i),t(F([i],j())))}))).then((()=>{t(m({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(E({unreadCount:c-r.length>0?c-r.length:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}),(i=>{t(m({markAsReadState:{fetchState:"Error",error:i}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})).catch((i=>{t(m({markAsReadState:{fetchState:"Error",error:i}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})))},onMarkAllNotificationsAsRead:a=>{a==="tasks"?t(_t("task_manager","read")):(t(m({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Wt(o,T).then((()=>{t(F(o,j())),t(m({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(E({unreadCount:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))})).catch((s=>{t(m({markAsAllReadState:{fetchState:"Error",error:s}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})))},onBackClick:()=>{const a=$t(n.state?.pathnameStackToGoBack),s=a.poppedPathname??"../../dashboard";f(s,{state:{pathnameStackToGoBack:a.newStack}})},onSettingsClick:()=>{const a=B(n.state?.pathnameStackToGoBack,n.pathname);f("../../settings/notifications",{state:{pathnameStackToGoBack:a}})}}}))(Ut(Ft)),Yt=()=>{const t=ht(),l=pt(),{tenantEmailDomain:n,selectedTab:h}=kt(),{areTenantIdsInSync:g}=xt(),c=Tt(h??""),o=gt(),f=vt(),[T,M]=k.useState(!1),a=S((e=>X(e))),s=S((e=>z(e))),{useFeatureGate:d}=Mt(),{isFeatureEnabled:r}=d(Dt.isDebitCardFeatureEnabled),{isAiCfoAccessEnabled:i,onAskAiCfoClick:I}=Vt({mobileExploreReferrer:"Notifications"});Rt({isDataReady:!0});const Z=It(s.userRole);if(s==null||n==null||s.companyId==null)throw Error("Can't access notifications page without current tenant...");if(f==null)throw Error("Can't access notifications page without signed in...");const V=S((e=>b(e).notificationDetailsByTab.tasks.fetchState)),O=S((e=>b(e).currentTab)),D=S((e=>b(e).currentSubTab)),tt=S((e=>b(e).notificationDetailsByTab.comments.fetchCountState)),R=S((e=>b(e).notificationDetailsByTab.comments.fetchState)),et=S((e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount)),at=S((e=>b(e).allExternalNotifications)).filter((e=>e.inboxNotification.readAt==null)).map((e=>e.inboxNotification.id)),st=Pt().allUsers,{inboxNotifications:w,isLoading:y,hasFetchedAll:C,isFetchingMore:P,fetchMore:ot}=mt(),{threads:W,isLoading:L,fetchMore:Y,isFetchingMore:q,hasFetchedAll:J}=lt({query:{metadata:{companyId:s.companyId,application:"dashboard"}}});k.useEffect((()=>{if(O!==c&&c!=null&&o(H(c)),c==null){const e=`../${O}`,p=B(l.state?.pathnameStackToGoBack,l.pathname);t(e,{state:{pathnameStackToGoBack:p}})}}),[c]),k.useEffect((()=>{tt.fetchState==="Not-Started"&&o(m({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))}),[]),k.useEffect((()=>{if(y===!1&&C===!0&&s?.companyId!=null&&w!=null){const e=`dashboard_${s.companyId}`,p=w.filter((A=>A.roomId===e&&A.readAt==null)).length;o(m({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),o(E({unreadCount:p},"comments"))}}),[y,C]),k.useEffect((()=>{V!=="In-Progress"&&g&&o($("task_manager","dashboard",["read","unread"]))}),[g]),k.useEffect((()=>{const e=setTimeout((()=>ot?.()),0);return()=>clearTimeout(e)}));const G=y||P===!0||C!==!0||y||P===!0||C!==!0;k.useEffect((()=>{G&&R!=="In-Progress"?o(m({fetchState:"In-Progress",error:void 0},"comments")):G||R!=="In-Progress"||o(m({fetchState:"Completed",error:void 0},"comments"))}),[G,R]),k.useEffect((()=>{o(E({hasMore:C!==!0},"comments"))}),[C]),k.useEffect((()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&T===!1&&(M(!0),o(Ct()))}),[a.fetchState]),k.useEffect((()=>{if(y===!1&&L===!1&&w!=null&&W!=null){const e=`dashboard_${s.companyId}`,p=w.filter((u=>u.roomId===e)).filter((u=>Gt(u.kind))),A=p.filter((u=>u.readAt==null)),_=p.map((u=>u.id)),ct=p.map((u=>{const U=W.find((dt=>{return dt.id===((v=u).kind==="thread"?v.threadId:"subjectId"in v?v.subjectId:void 0);var v}));return U!=null?{inboxNotification:{...u,threadId:U.id},thread:U}:(q||J===!0||Y==null||Y(),null)})).filter((u=>u!=null));o(m({allNotificationsIds:_},"comments")),o(E({totalCount:_.length,unreadCount:A.length},"comments")),o(At(ct))}}),[y,P,q,C,J,L,w?.length]);const nt={events:s.userRoleId!=null?[`private-encrypted-${s.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if(jt(p)){const A=Et(p.mode);if(A==="dashboard"&&o(E({unreadCount:p.data.unread},"tasks")),V!=="In-Progress"){const _=[];D==="all"?_.push("read","unread"):D!=="mentions"&&_.push(D),o($("task_manager",A,_,!0))}}}},it=ft(),{isTaskManagerAccessEnabled:rt}=Ot(f);return N.jsx(Lt,{tenantEmailDomain:n,loggedInUserRoleMap:Z,signedInUser:f,externalNotificationsUnreadCount:et,location:l,navigate:t,isDebitCardFeatureEnabled:r,isTaskManagerAccessEnabled:rt,users:st,markInboxNotificationAsRead:it,allUnreadCommentsNotificationIds:at,isAiCfoAccessEnabled:i,onAskAiCfoClick:I,...nt})};function me(){return N.jsxs(bt,{children:[N.jsx(Q,{path:"/:selectedTab",element:N.jsx(Yt,{})}),N.jsx(Q,{path:"*",element:N.jsx(ut,{})})]})}export{me as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as m}from"./liveblocks-DRsJ0YIJ.js";import{a as r}from"./sentry-G4ZANa8Z.js";import{u as A,g as j,j as o,N as C}from"./core-DGLzDXWl.js";import{Un as P,fE as R,gl as x,Uo as z,Up as D,Uq as M,Ur as q,pR as k,T2 as L}from"./zeni-epic-state-Dm2vDWXH.js";import{z as h,ah as I}from"./index-DGjciFPC.js";import"./mui-BuJ3P0FU.js";import"./recharts-CJlXFxhv.js";import"./analytics-CvsRIk3B.js";import"./plaid-i7y7YD6O.js";import"./dnd-SnD389s6.js";import"./stripe-cKAAJElX.js";import"./lottie-DEqUWUd5.js";import"./lexical-CMBMntF_.js";import"./pdf-B_v4zyN7.js";import"./utils-Bz8wuSWM.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new n.Error().stack;a&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[a]="6e94700d-94e0-49aa-b6b3-e0652f6c208a",n._sentryDebugIdIdentifier="sentry-dbid-6e94700d-94e0-49aa-b6b3-e0652f6c208a")}catch{}})();function ee(){const n=A(),a=j(),{params:t,error:i}=r.useMemo((()=>P(a.search)),[a.search]),w=r.useMemo((()=>new URLSearchParams(a.search).get("client_name")??t?.clientId??"Unknown Application"),[a.search,t]),p=h.isSignedIn(),s=h.getSignedInUser(),f=o((e=>R(e))),l=o((e=>x(e))),d=o((e=>e.tenantState.fetchState)),y=o(z),b=o(D),u=o(M),[U,v]=r.useState(null),[S,E]=r.useState(null);r.useEffect((()=>{document.querySelector("#app-shell-loader")?.remove()}),[]),r.useEffect((()=>()=>{n(q())}),[n,a.search]),r.useEffect((()=>{i!=null&&console.warn("[OAuthConsent] invalid params:",i)}),[i]);const g=r.useRef(!1);r.useEffect((()=>{p&&s!=null&&!g.current&&(d!=="Not-Started"&&d!=="Error"||(g.current=!0,n(k(s.userId,s.zeniSessionId??void 0))))}),[p,s,d,n]),r.useEffect((()=>{u!=null&&u!==""&&(window.location.href=u)}),[u]);const _=r.useMemo((()=>{if(f?.tenantId!=null)return f.tenantId;const e=h.getActiveTenantForUser()?.tenantId;return e!=null&&l.some((T=>T.tenantId===e))?e:l.length===1?l[0].tenantId:null}),[f?.tenantId,l]),c=U??_;return i!=null?m.jsx(I,{variant:"invalid_params",paramsError:i}):p?m.jsx(I,{variant:"signed_in",clientName:w,userEmail:s?.userEmail,isInitializing:d!=="Completed",tenants:l,selectedTenantId:c,onSelectTenant:v,approveError:S??b,isApproving:y==="In-Progress",showAllowButton:c!=null,onApprove:()=>{t!=null&&s!=null&&c!=null&&n(L(s.userId,s.zeniSessionId??void 0,c,t.clientId,t.redirectUri,t.codeChallenge,t.codeChallengeMethod,t.state,t.responseType))},onDeny:()=>{if(t!=null)try{const e=new URL(t.redirectUri);e.searchParams.set("error","access_denied"),e.searchParams.set("error_description","The user denied the request"),e.searchParams.set("state",t.state),window.location.href=e.toString()}catch{E("Unable to deny: redirect_uri is not a valid URL. Close this window or contact support.")}}}):m.jsx(C,{to:"/signin/auth",state:{origin:a.pathname+a.search},replace:!0})}export{ee as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as n}from"./liveblocks-DRsJ0YIJ.js";import{h as X,u as H,g as J,i as K,j as d,l as Q,n as ee,o as C}from"./core-DGLzDXWl.js";import{fE as M,A1 as R,v0 as ae,Vf as w,uX as T,bq as te,b$ as se,uY as oe,Vg as re,UZ as S,eh as ne,DP as ce,Vh as ie,Eb as le,dZ as de,dY as me}from"./zeni-epic-state-Dm2vDWXH.js";import{ai as fe,z as pe,aq as ue,as as he,U as ge,O as q,c as $,a8 as Fe,k as V,aD as be,p as Ie}from"./index-DGjciFPC.js";import"./mui-BuJ3P0FU.js";import Ce from"./NotFoundScreen-3YmbDG-O.js";import{F as Se}from"./FeaturePreviewScreen-CEOFkjIy.js";import{a as g}from"./sentry-G4ZANa8Z.js";import{u as Te}from"./useAskAiCfoHostNavButtonProps-DY2m50un.js";import{u as ye}from"./useInitialThreadRequest-Cdwnj1Ib.js";import{t as Ae}from"./routePaths-COaM8xFB.js";import{M as De}from"./MobileAppDrawer-Q8q8ssn0.js";import"./recharts-CJlXFxhv.js";import"./analytics-CvsRIk3B.js";import"./plaid-i7y7YD6O.js";import"./dnd-SnD389s6.js";import"./stripe-cKAAJElX.js";import"./lottie-DEqUWUd5.js";import"./lexical-CMBMntF_.js";import"./pdf-B_v4zyN7.js";import"./utils-Bz8wuSWM.js";import"./InboxNotificationsProvider-Cf5DQSg3.js";import"./useTaskManagerAccess-i7vk79Wr.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new s.Error().stack;e&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[e]="00eadbd1-680f-4c2c-9ccb-92acb65e4893",s._sentryDebugIdIdentifier="sentry-dbid-00eadbd1-680f-4c2c-9ccb-92acb65e4893")}catch{}})();const y=(s,e,a,o)=>{if(s!=e){const r=o??"";s!=null&&s.length>0?a(`../${e}${r}`,{replace:!0}):a(`${e}${r}`,{replace:!0})}},xe=Q((function(s){const e=re(s),a={},o=e.pandLReportWithForecast.uiState.nodeCollapseState;return Object.keys(o).forEach((r=>{a[r]=o[r]===!1})),{selectedTimeframe:e.selectedTimeframe,isForecastVsActualOn:e.isForecastVsActualOn,compareMode:e.compareMode,forecastList:e.forecastList,selectedForecast:e.selectedForecast,pandLreport:e.pandLReportWithForecast,scrollPosition:e.pandLReportWithForecast.uiState.scrollPosition,nodeOpenStatus:a,type:"name+balances_forecast",analytics:V}}),(function(s,e){return{onForecastSelectionChanged:(a,o)=>{s(w(a,o)),e.isPandLReportFetched(a)||s(T(a)),y(e.forecastIdFromUrlPath,a,e.navigate)},onTimeframeChanged:a=>{s(le(a))},onForecastVsActualsCompareToggle:a=>{s(ie(a)),s(S({forecastId:e.forecastIdFromUrlPath,scrollPosition:{scrollLeft:0,scrollTop:0}}))},onCompareModeChanged:a=>{s(ce(e.firstMonthOfFY,a,0,[]))},onAccountBalanceClick:e.hasTransactionAccess!==!0?void 0:(a,o)=>{let r,c;const p=a.accountName===""?a.accountDescription:a.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(r=o.balanceTimeFrame,c=ne(o)):o.balanceTimeFrame==="year"?(r="quarter",c={startDate:o.endDate.startOf("quarter"),endDate:o.endDate}):console.error(`timeframe ${o.balanceTimeFrame} is not supported`),c!=null&&r!=null){const u=Ae(e.tenantEmailDomain,a.accountId,a.accountType,p,r,c),m=Ie(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(u,{state:{pathnameStackToGoBack:m,referrer:"Forecast"}})}},onNodeCollapseToggled:(a,o)=>{s(S({forecastId:e.forecastIdFromUrlPath,nodeCollapseState:{nodeId:a,isCollapsed:o===!1}}))},onTableScroll:a=>{s(S({forecastId:e.forecastIdFromUrlPath,scrollPosition:a}))},onBackClick:()=>{e.navigate("../../")}}}))(be);function v(){const s=fe(),e=X(),a=H(),o=J(),{forecastId:r,tenantEmailDomain:c}=K(),[p,u]=g.useState(!1),[m,A]=g.useState(!1),F=pe.getSignedInUser(),D=d((t=>M(t))),_=D.company?.companyInfo.firstMonthOfFY??1,i=d((t=>R(t.forecastState,t.forecastListState))),l=d((t=>t.forecastListState.fetchState==="Completed")),x=d((t=>t.profitAndLossState)),E=d((t=>t.reportUIOptionsState.selectedForecast)),k=t=>x.pandLByForecastID[t]!=null&&oe(t,x).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:b}=ue();he({isDataReady:l});const{isAiCfoAccessEnabled:B,onAskAiCfoClick:N}=Te({mobileExploreReferrer:"Forecast"});g.useEffect((()=>{if(!p&&b)u(!0),l||a(ae());else if(l&&!m){A(!0);const t=((f,U,O)=>U!=null?f.forecasts.findIndex((I=>I.id===U)):O!=null?f.forecasts.findIndex((I=>I.id===O)):f.forecasts.length>0?0:-1)(i,r,E?.id);t===-1&&r!=null?e("page-not-found",{replace:!0}):t!==-1&&t!=E?.index?(a(w(i.forecasts[t].id,t)),y(r,i.forecasts[t].id,e,o.search)):r==null&&t!==-1&&y(void 0,i.forecasts[t].id,e,o.search),t!==-1&&!k(i.forecasts[t].id)&&b&&a(T(i.forecasts[t].id))}}),[p,u,a,l,i,m,A,R,T,b]);const P=ge(),Y=P?.loggedInUserRole!=null&&te(P.loggedInUserRole),{useFeatureGate:G}=q(),{isFeatureEnabled:j}=G($.isReportsCommentingEnabled),W=ye(j?D?.companyId:void 0,{clearParams:l&&m}),[z,Z]=g.useState(!1),h=new URL(s("forecast_pandl"));h.searchParams.set("firstname",F?.firstName??""),h.searchParams.set("lastname",F?.lastName??""),h.searchParams.set("email",F?.userEmail??"");const L=t=>{Z(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(Fe,{analytics:V,onLoad:t=>(f=>f.trackForecast())(t)}):null,n.jsx(De,{isAppContentDrawerOpen:z,handleDrawerToggle:L}),n.jsx(xe,{firstMonthOfFY:_,tenantEmailDomain:c,forecastIdFromUrlPath:r,navigate:e,location:o,isPandLReportFetched:k,meetingUrl:se(h.toString()),hasTransactionAccess:Y,isAiCfoAccessEnabled:B,onAskAiCfoClick:N,isReportsCommentingEnabled:j,initialOpenThreadRequest:W,onClickMenuIcon:()=>{L(!0)}})]})}function He(){const s=d((c=>M(c))),{useFeatureGate:e}=q(),{isFeatureEnabled:a}=e($.isDebitCardFeatureEnabled),o=de(a,s),r=me(s);return o===!0||r===!0?n.jsx(Se,{}):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{He as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as r}from"./liveblocks-
|
|
1
|
+
import{j as r}from"./liveblocks-DRsJ0YIJ.js";import{a as p}from"./sentry-G4ZANa8Z.js";import{I as c,J as a,a9 as m,ad as f,ae as h}from"./index-DGjciFPC.js";import"./mui-BuJ3P0FU.js";import{i as y}from"./core-DGLzDXWl.js";import"./zeni-epic-state-Dm2vDWXH.js";import"./recharts-CJlXFxhv.js";import"./analytics-CvsRIk3B.js";import"./plaid-i7y7YD6O.js";import"./dnd-SnD389s6.js";import"./stripe-cKAAJElX.js";import"./lottie-DEqUWUd5.js";import"./lexical-CMBMntF_.js";import"./pdf-B_v4zyN7.js";import"./utils-Bz8wuSWM.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]="4553bbf5-4e68-43e4-bfc4-1af1eba789d6",e._sentryDebugIdIdentifier="sentry-dbid-4553bbf5-4e68-43e4-bfc4-1af1eba789d6")}catch{}})();const b=c("div")`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
width: 100%;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import{j as a}from"./liveblocks-DRsJ0YIJ.js";import{Vb as re,fE as N,l_ as G,dZ as X,dY as le,S2 as Q,UA as de,CM as Pe,Vc as q,CB as je,CW as Le,CQ as ce,CF as pe,CU as Te,CR as ve,Vd as ue,sk as Ae,g5 as Ve,gC as Fe,Ve as _,CJ as me,CI as ge,CZ as Re,c8 as Oe}from"./zeni-epic-state-Dm2vDWXH.js";import{a1 as fe,O as Y,c as H,z as W,g as Ce,N as he,af as ye,az as be,aA as Ze,ab as Se,J as R,ag as we,G as K,aB as Ue,aq as Be,as as $e,a8 as ze,k as xe,T as _e,p as He,aC as Ge,U as We}from"./index-DGjciFPC.js";import{D as De,n as M,S as Ie}from"./mui-BuJ3P0FU.js";import ae from"./NotFoundScreen-3YmbDG-O.js";import{a as d}from"./sentry-G4ZANa8Z.js";import{u as ee,i as Ke,j as g,h as Me,g as Je,l as qe,n as se,o as z}from"./core-DGLzDXWl.js";import{u as Ne}from"./useAskAiCfoHostNavButtonProps-DY2m50un.js";import{M as Xe}from"./MobileAppDrawer-Q8q8ssn0.js";import"./recharts-CJlXFxhv.js";import"./analytics-CvsRIk3B.js";import"./plaid-i7y7YD6O.js";import"./dnd-SnD389s6.js";import"./stripe-cKAAJElX.js";import"./lottie-DEqUWUd5.js";import"./lexical-CMBMntF_.js";import"./pdf-B_v4zyN7.js";import"./utils-Bz8wuSWM.js";import"./InboxNotificationsProvider-Cf5DQSg3.js";import"./useTaskManagerAccess-i7vk79Wr.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]="2ad5137a-7dd2-46be-8f79-307ff01cf6f2",e._sentryDebugIdIdentifier="sentry-dbid-2ad5137a-7dd2-46be-8f79-307ff01cf6f2")}catch{}})();const Qe={overlayWidth:new Se(100,100,48)},te=K.getLocalizedStrings().peoplePage.invitePage,ne=K.getLocalizedStrings().common,Ye=({companyId:e,managersListView:t,companyPassportView:c,classListView:n,mode:f,isEditPeopleDrawerOpen:i,closeDrawerHandler:b})=>{const C=fe(),m=ee(),[O,Z]=d.useState(!1),[k,S]=d.useState(!1),{userId:w}=Ke(),r=g((l=>re(l))),p=g((l=>N(l))),E=g((l=>G(l))),{useFeatureGate:D}=Y(),{isFeatureEnabled:I}=D(H.isDebitCardFeatureEnabled),P=X(I,p),T=le(p),v=Q(p),U=de(p),B=!!p.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!P&&E&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||c.fetchState!=="Completed"||e==null;if(W.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const h=()=>{m(q()),b()},A=()=>{O===!0?S(!0):h()},$=c.companyView?.controllers?.map((l=>l.user)),u=!!p.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:j}=D(H.isChargeCardFeatureEnabled),L=Ce(p,j,I),{isCardsHidden:V}=he(p?.tenantId),y=!L||V,F=p.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",s={peopleDetails:r,classList:n.classes,managersList:t.users,controllersList:$,mode:f,isZeniTenant:v,isAccountingClassesEnabled:E,isReimbursementDisabled:B===!1,isZeniAccountsDisabled:u===!1,isChargeCardDisabled:y,isTreasuryDisabled:F===!1,isLiteRoleDisabled:U===!1,isBankingOnlyTenant:P,isCardsOnlyTenant:T,onResetClick:h,onDeleteUser:l=>{m(pe(l.userId,l.userRole.userRoleId))},onPeopleLocalDataUpdated:l=>{m(ce({peopleLocalData:l})),Z(!0)},onSaveClick:()=>{m(f==="zeni_only"?je(e):Le(v))},onCloseClick:A,isLoading:x||r.person==null},o={onOkClick:()=>{S(!1),h()},onCancelClick:()=>{S(!1)}};return d.useEffect((()=>{x===!1&&w!=null&&m(Pe(w))}),[x,w]),d.useEffect((()=>{r.updatePersonState.fetchState==="Completed"&&h()}),[r.updatePersonState.fetchState]),a.jsx(De,{anchor:"right",open:i,PaperProps:{style:{width:Qe.overlayWidth.valuePercentage(C),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:ye.overlayDark,cursor:"pointer"}}},onClose:A,children:a.jsxs(ea,{onClick:l=>l.stopPropagation(),children:[k===!0?a.jsx(be,{titleComponent:a.jsx(ke,{children:te.discardTitle}),descriptionComponent:a.jsx(Ee,{children:te.discardDescription}),primaryButtonText:ne.yes,secondaryButtonText:ne.no,action:o,isEditPopup:!0}):null,a.jsx(Ze,{...s})]})})},ea=M(Ie)`
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100%;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
`,ke=M(we.H6Regular)`
|
|
6
|
+
margin-top: ${R.sp7};
|
|
7
|
+
padding-left: ${R.sp8};
|
|
8
|
+
padding-right: ${R.sp8};
|
|
9
|
+
color: ${e=>e.theme.colors.primary};
|
|
10
|
+
word-break: break-word;
|
|
11
|
+
`,Ee=M(we.LargeRegularSp)`
|
|
12
|
+
color: ${e=>e.theme.colors.hero};
|
|
13
|
+
padding-left: ${R.sp8};
|
|
14
|
+
padding-right: ${R.sp8};
|
|
15
|
+
margin-bottom: 30px;
|
|
16
|
+
margin-top: ${R.sp4};
|
|
17
|
+
white-space: pre-line;
|
|
18
|
+
`,aa={overlayWidth:new Se(100,100,48)},oe=K.getLocalizedStrings().peoplePage.invitePage,ie=K.getLocalizedStrings().common,sa=({companyId:e,managersListView:t,companyPassportView:c,classListView:n,mode:f,isInvitePeopleDrawerOpen:i,closeDrawerHandler:b})=>{const C=fe(),m=ee(),[O,Z]=d.useState(!1),[k,S]=d.useState(!1),w=g((o=>re(o))),r=g((o=>N(o))),p=g((o=>G(o))),{useFeatureGate:E}=Y(),{isFeatureEnabled:D}=E(H.isDebitCardFeatureEnabled),I=X(D,r),P=le(r),T=Q(r),v=de(r),U=!!r.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,B=!I&&p&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||c.fetchState!=="Completed"||e==null;if(W.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const x=()=>{b(),m(q())},h=()=>{O===!0?S(!0):x()},A={onOkClick:()=>{S(!1),x()},onCancelClick:()=>{S(!1)}},$=c.companyView?.controllers.map((o=>o.user)),u=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:j}=E(H.isChargeCardFeatureEnabled),L=Ce(r,j,D),{isCardsHidden:V}=he(r?.tenantId),y=!L||V,F=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",s={classList:n.classes,managersList:t.users,controllersList:$,mode:f,isZeniTenant:T,onPeopleLocalDataUpdated:o=>{m(ce({peopleLocalData:o})),Z(!0)},onResetClick:x,onSaveClick:()=>{m(f==="zeni_only"?Te(e):ve())},onCloseClick:h,peopleDetails:w,isAccountingClassesEnabled:p,isReimbursementDisabled:U===!1,isLiteRoleDisabled:v===!1,isZeniAccountsDisabled:u===!1,isChargeCardDisabled:y,isTreasuryDisabled:F===!1,isBankingOnlyTenant:I,isCardsOnlyTenant:P,isLoading:B};return d.useEffect((()=>{w.invitePersonState.fetchState==="Completed"&&(b(),m(q()))}),[w.invitePersonState.fetchState]),a.jsx(De,{anchor:"right",open:i,PaperProps:{style:{width:aa.overlayWidth.valuePercentage(C),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:ye.overlayDark,cursor:"pointer"}}},onClose:h,children:a.jsxs(ta,{onClick:o=>o.stopPropagation(),children:[k===!0?a.jsx(be,{titleComponent:a.jsx(ke,{children:oe.discardTitle}),descriptionComponent:a.jsx(Ee,{children:oe.discardDescription}),primaryButtonText:ie.yes,secondaryButtonText:ie.no,action:A}):null,a.jsx(Ue,{...s})]})})},ta=M(Ie)`
|
|
19
|
+
display: flex;
|
|
20
|
+
min-height: 100%;
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
`,na=qe((function(e,t){const c=ue(e),n=W.getSignedInUser();return{data:c,loggedinUserId:n?.userId??"",isZeniTenant:t.isZeniTenant===!0,shouldFetchClasses:t.shouldFetchClasses,isZeniAdminUser:n?.userEmailDomain==="zeni.ai"&&t.isZeni===!0,isAccountingClassesEnabled:G(e),analytics:xe}}),(function(e,t){const{navigate:c,companyId:n,shouldFetchClasses:f}=t;return{personAction:{onPersonDelete:(i,b)=>{e(pe(i,b))},onResendInvite:i=>{e(Re(i))},onReloadPeople:()=>{e(me()),e(ge(n,f))},onBackClick:()=>{c("../../")},onModeChange:i=>{e(_({mode:i,searchText:"",sortKey:"name",sortOrder:"ascending"}))},onSearchTextChanged:i=>{e(_({searchText:i}))}}}}))(Ge);function J({isInvitePeopleDrawerOpen:e,isEditPeopleDrawerOpen:t}){const c=Me(),n=ee(),f=Je(),{areTenantIdsInSync:i}=Be(),b=W.getSignedInUser(),C=g((s=>N(s))),{useFeatureGate:m}=Y(),{isFeatureEnabled:O}=m(H.isDebitCardFeatureEnabled),Z=g((s=>G(s))),k=!X(O,C)&&Z,S=Q(C),w=C?.tenantId,{tenantEmailDomain:r}=C,[p,E]=d.useState(!1),[D,I]=d.useState(!1),[P,T]=d.useState(!1),[v,U]=d.useState("off"),[B,x]=d.useState(!1),h=s=>{x(s)},{isAiCfoAccessEnabled:A,onAskAiCfoClick:$}=Ne({mobileExploreReferrer:"People"}),u=g((s=>ue(s)));$e({isDataReady:u.fetchState==="Completed"});const j=g((s=>Ae(s.classState,s.classListState))),L=g((s=>Ve(s.userState,s.userRoleState,s.userListViewState,"manager"))),V=g((s=>Fe(s))),y=C?.companyId;d.useEffect((()=>{p&&v===u.uiState.mode||!i||(n(_({searchText:"",sortKey:"name",sortOrder:"ascending"})),U(u.uiState.mode),E(!0),n(me()))}),[p,b,w,n,u.uiState.mode,i]),d.useEffect((()=>{y!=null&&i&&n(ge(y,k))}),[y,k,i]),d.useEffect((()=>{I(e!=null&&e===!0),T(t!=null&&t===!0&&t)}),[e,t]),d.useEffect((()=>{n(_({searchText:"",sortKey:"name",sortOrder:"ascending"}))}),[]);const F=()=>{I(!1),T(!1),c("../")};return a.jsxs(a.Fragment,{children:[u.fetchState==="Completed"?a.jsx(ze,{analytics:xe,onLoad:s=>s.trackPageLoaded(_e.Event.members)}):null,D===!0?a.jsx(sa,{closeDrawerHandler:F,isInvitePeopleDrawerOpen:D,managersListView:L,companyPassportView:V,classListView:j,companyId:y,mode:u.uiState.mode}):null,P===!0?a.jsx(Ye,{closeDrawerHandler:F,isEditPeopleDrawerOpen:P,managersListView:L,companyPassportView:V,classListView:j,companyId:y,mode:u.uiState.mode}):null,a.jsx(Xe,{isAppContentDrawerOpen:B,handleDrawerToggle:h}),a.jsx(na,{navigate:c,signedInUser:b,isZeni:C.isZeni,isZeniTenant:S,peopleUIState:u.uiState,companyId:y,shouldFetchClasses:k,classList:j,managersView:L,peopleView:u,onInvitePeopleClick:()=>{c("./new")},onColumnSortConfigChanged:(s,o)=>{n(_({sortKey:s,sortOrder:o}))},onRowClick:s=>{const o=`/${r}/people/${encodeURIComponent(s)}/edit`,l=He(f.state?.pathnameStackToGoBack,f.pathname);c(o,{state:{pathnameStackToGoBack:l}})},onClickMenuIcon:()=>{h(!0)},isAiCfoAccessEnabled:A,onAskAiCfoClick:$})]})}function ka(){const e=We();return Oe(e?.loggedInUserRole??[])?a.jsxs(se,{children:[a.jsx(z,{path:"/",element:a.jsx(J,{})}),a.jsx(z,{path:"new",element:a.jsx(J,{isInvitePeopleDrawerOpen:!0})}),a.jsx(z,{path:":userId/edit",element:a.jsx(J,{isEditPeopleDrawerOpen:!0})}),a.jsx(z,{path:"*",element:a.jsx(ae,{})})]}):a.jsx(se,{children:a.jsx(z,{path:"*",element:a.jsx(ae,{})})})}export{ka as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as s}from"./liveblocks-DRsJ0YIJ.js";import T from"./NotFoundScreen-3YmbDG-O.js";import{a as r}from"./sentry-G4ZANa8Z.js";import{h as _,g as P,j as p,i as v,u as M,N as U,l as z,n as O,o as h}from"./core-DGLzDXWl.js";import{fE as B,a0P as b,bo as F,bn as N,iK as V,gg as $}from"./zeni-epic-state-Dm2vDWXH.js";import{$ as K,z as I,as as q,dP as G}from"./index-DGjciFPC.js";import"./mui-BuJ3P0FU.js";import{u as H}from"./useAskAiCfoHostNavButtonProps-DY2m50un.js";import{M as J}from"./MobileAppDrawer-Q8q8ssn0.js";import"./recharts-CJlXFxhv.js";import"./analytics-CvsRIk3B.js";import"./plaid-i7y7YD6O.js";import"./dnd-SnD389s6.js";import"./stripe-cKAAJElX.js";import"./lottie-DEqUWUd5.js";import"./lexical-CMBMntF_.js";import"./pdf-B_v4zyN7.js";import"./utils-Bz8wuSWM.js";import"./InboxNotificationsProvider-Cf5DQSg3.js";import"./useTaskManagerAccess-i7vk79Wr.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]="ebaa3c05-dabd-417f-aade-c51355f66e2c",e._sentryDebugIdIdentifier="sentry-dbid-ebaa3c05-dabd-417f-aade-c51355f66e2c")}catch{}})();const L=z((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)}}}))(G),Q=()=>{const e=_(),t=P(),c=K(),o=p((a=>B(a))),{aggregatedReportViewState:n}=p((a=>b(a))),{tenantEmailDomain:f}=v(),g=M(),l=I.getSignedInUser();if(l==null)throw new Error("Can't access this page without signing in...");const m=r.useRef(!1),[w,S]=r.useState(!1),C=F(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,x=N(l),y=C||k||x,d=r.useCallback(((a,i,E)=>{g(V({fromMonth:a,toMonth:i,cacheOverride:E}))}),[]);r.useEffect((()=>{n?.fetchState==="Completed"&&m.current&&(g($({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),m.current=!1)}),[n?.fetchState]);const D=r.useCallback(((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||d(a,i,!0),m.current=!0}),[n?.fetchState,d]),j=r.useCallback(((a,i)=>{d(a,i,!1)}),[d]),u=a=>{S(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:A}=H({mobileExploreReferrer:"Performance"});return q({isDataReady:n?.fetchState==="Completed"}),y?s.jsxs(s.Fragment,{children:[s.jsx(J,{isAppContentDrawerOpen:w,handleDrawerToggle:u}),s.jsx(L,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:l,tenantEmailDomain:f,onReload:D,onTimeRangeSelect:j,handleDrawerToggle:u,isAiCfoAccessEnabled:R,onAskAiCfoClick:A})]}):s.jsx(U,{to:`/${f}/dashboard`,replace:!0})};function he(){return s.jsxs(O,{children:[s.jsx(h,{path:"*",element:s.jsx(Q,{})}),s.jsx(h,{path:"*",element:s.jsx(T,{})})]})}export{he as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as h,R as a}from"./sentry-
|
|
1
|
+
import{a as h,R as a}from"./sentry-G4ZANa8Z.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new r.Error().stack;t&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[t]="1e16de4c-304f-4e91-a86b-dc86bcc8d8a2",r._sentryDebugIdIdentifier="sentry-dbid-1e16de4c-304f-4e91-a86b-dc86bcc8d8a2")}catch{}})();const c="64px",u={};var k=({src:r,light:t,oEmbedUrl:n,onClickPreview:l,playIcon:w,previewTabIndex:m,previewAriaLabel:b})=>{const[p,i]=h.useState(null);h.useEffect((()=>{r&&t&&n&&v({src:r,light:t,oEmbedUrl:n})}),[r,t,n]);const v=async({src:e,light:s,oEmbedUrl:I})=>{if(a.isValidElement(s))return;if(typeof s=="string")return void i(s);if(u[e])return void i(u[e]);i(null);const E=await fetch(I.replace("{url}",e)),f=await E.json();if(f.thumbnail_url){const g=f.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");i(g),u[e]=g}},d=a.isValidElement(t),y={display:"flex",alignItems:"center",justifyContent:"center"},o={preview:{width:"100%",height:"100%",backgroundImage:p&&!d?`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:d?"absolute":void 0,...y},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},_=a.createElement("div",{style:o.shadow,className:"react-player__shadow"},a.createElement("div",{style:o.playIcon,className:"react-player__play-icon"}));return a.createElement("div",{style:o.preview,className:"react-player__preview",tabIndex:m,onClick:e=>{l?.(e)},onKeyDown:e=>{e.key!=="Enter"&&e.key!==" "||l==null||l(e)},...b?{"aria-label":b}:{}},d?t:null,w||_)};export{k as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as Ol}from"./liveblocks-
|
|
1
|
+
import{j as Ol}from"./liveblocks-DRsJ0YIJ.js";import{p as Q,d as kc,c as an,g as jl,a as xl}from"./sentry-G4ZANa8Z.js";import{L as dt,b$ as Tc,fE as Ac,TI as Rc,Uy as kl,c8 as Tl}from"./zeni-epic-state-Dm2vDWXH.js";import{a as lt,b as Al,c as Rl,d as Il,e as un,f as Pl,g as Nl,h as Ll,i as Vt,j as Ic,k as oe,l as je,m as $l,o as Yt,p as ue,q as Ml}from"./utils-Bz8wuSWM.js";import{r as cn}from"./empty-BjVnPUF5.js";import{r as Cl,a as Dl,b as Fl,c as Bl}from"./pdf-lib-DxbyphS9.js";import{r as Ul}from"./index-B2CKeHlo.js";import{r as ql}from"./index-CQFc7TiS.js";import{h as Gl,g as zl,u as Zl,j as _n,l as Hl}from"./core-DGLzDXWl.js";import{u as Vl,z as Pc,L as Yl,ak as Kl,al as Wl,X as Jl,F as Xl}from"./index-DGjciFPC.js";import"./mui-BuJ3P0FU.js";import{d as Pe}from"./decodeURIComponentSafe-k3ZAUeWI.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},u=new t.Error().stack;u&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[u]="f233caa6-75fc-4c31-9a01-1b6872ded44e",t._sentryDebugIdIdentifier="sentry-dbid-f233caa6-75fc-4c31-9a01-1b6872ded44e")}catch{}})();var Sn,On={exports:{}},jn,xn,kn,Tn,An,Rn,In,Pn,Nn,Ne,Ln,$n,Mn,Cn,Dn,Fn,Bn,Un,qn,Gn,zn,Le,Zn,Hn,Vn,Yn,Kn,Wn,Jn,$e,Xn,Qn,to,eo,ro,no,oo,Me={exports:{}},Ce={exports:{}},De={};function Nc(){if(jn)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 u(r,e){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,p){return a.__proto__=p,a},u(r,e)}function d(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=o(r);if(e){var h=o(this).constructor;a=Reflect.construct(p,arguments,h)}else a=p.apply(this,arguments);return(function(m,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})(m)})(this,a)}}function o(r){return o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},o(r)}jn=1;var c,i,n={};function s(r,e,a){a||(a=Error);var p=(function(h){(function(l,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function");l.prototype=Object.create(y&&y.prototype,{constructor:{value:l,writable:!0,configurable:!0}}),Object.defineProperty(l,"prototype",{writable:!1}),y&&u(l,y)})(g,h);var m,b=d(g);function g(l,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)})(l,y,v)),S.code=r,S}return m=g,Object.defineProperty(m,"prototype",{writable:!1}),m})(a);n[r]=p}function f(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 s("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),s("ERR_INVALID_ARG_TYPE",(function(r,e,a){var p,h,m;if(c===void 0&&(c=ie()),c(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,l,y){return(y===void 0||y>g.length)&&(y=g.length),g.substring(y-l.length,y)===l})(r," argument"))m="The ".concat(r," ").concat(p," ").concat(f(e,"type"));else{var b=(function(g,l,y){return typeof y!="number"&&(y=0),!(y+l.length>g.length)&&g.indexOf(l,y)!==-1})(r,".")?"property":"argument";m='The "'.concat(r,'" ').concat(b," ").concat(p," ").concat(f(e,"type"))}return m+=". Received type ".concat(t(a))}),TypeError),s("ERR_INVALID_ARG_VALUE",(function(r,e){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";i===void 0&&(i=lt());var p=i.inspect(e);return p.length>128&&(p="".concat(p.slice(0,128),"...")),"The argument '".concat(r,"' ").concat(a,". Received ").concat(p)}),TypeError),s("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),s("ERR_MISSING_ARGS",(function(){for(var r=arguments.length,e=new Array(r),a=0;a<r;a++)e[a]=arguments[a];c===void 0&&(c=ie()),c(e.length>0,"At least one arg needs to be specified");var p="The ",h=e.length;switch(e=e.map((function(m){return'"'.concat(m,'"')})),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 Ql(){if(kn)return xn;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 u(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){d(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 d(k,E,j){return(E=c(E))in k?Object.defineProperty(k,E,{value:j,enumerable:!0,configurable:!0,writable:!0}):k[E]=j,k}function o(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,c(N.key),N)}})(k.prototype,E),Object.defineProperty(k,"prototype",{writable:!1}),k}function c(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 i(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 s(k){var E=typeof Map=="function"?new Map:void 0;return s=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 f(j,arguments,a(this).constructor)}return O.prototype=Object.create(j.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),e(O,j)},s(k)}function f(k,E,j){return f=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},f.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)}kn=1;var h=lt().inspect,m=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="",l="",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
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as o}from"./liveblocks-DRsJ0YIJ.js";import Z from"./NotFoundScreen-3YmbDG-O.js";import{a as p}from"./sentry-G4ZANa8Z.js";import{h as C,g as N,u as D,j as u,N as V,l as k,n as z,o as g}from"./core-DGLzDXWl.js";import{fE as E,YT as h,Z8 as w,Nt as U,Np as L,Ns as f,Ni as B,Zx as T,Nm as K,Nv as Y}from"./zeni-epic-state-Dm2vDWXH.js";import{z as $,w as O,c9 as q,o as W,bS as F,ca as G}from"./index-DGjciFPC.js";import"./mui-BuJ3P0FU.js";import{u as H,R as x}from"./ReimbursementApprovalRuleDetailScreen-6W7aXQIv.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="82034840-7786-47ce-bbc3-23aee7004283",e._sentryDebugIdIdentifier="sentry-dbid-82034840-7786-47ce-bbc3-23aee7004283")}catch{}})();const j="reimbursement-approval-rule-update",J=k((function(e){return{approvalView:h(e),remiSetupApproverViewUpdateData:w(e).remiSetupApproverViewUpdateData}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(j)&&e(T(!1))},onBackClick:()=>{W(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(B(t,!1))},onEditRuleClick:t=>{t!=null?(e(f(t)),n(`./${t}/edit`)):(e(f()),n("./new"))}}}))(O(q)),M=({isLoading:e})=>{const s=C(),n=N(),a=D(),[t,l]=p.useState(!1),[v,R]=p.useState(!1),S=u((r=>r.remiSetupApproverViewState.fetchState)),c=u((r=>E(r))),d=u((r=>h(r))),b=u((r=>w(r).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{b?.updateStatus.fetchState==="Completed"&&a(U())}),[b]),p.useEffect((()=>{t||S!=="Not-Started"||e||(l(!0),a(L(!0,!1,!1,!1)))}),[t,S,e,a]),$.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{d.allApprovalRules.length===0&&d.fetchState==="Completed"&&(v||(R(!0),a(f())),s("./new"))}),[v,d,a]);const m={events:c.companyId!=null?[`private-encrypted-${c.companyId}.${j}`]:[],eventCallback:(r,y,I)=>{r.endsWith(j)&&I.onApprovalRulesEventReceived(r)}};return c?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?o.jsx(V,{to:"../../promo"}):o.jsx(J,{currentTenant:c,location:n,navigate:s,...m})},A="reimbursement-approval-rule-update",P=k((function(e){const s=h(e),n=w(e).remiSetupApproverViewUpdateData,a={};for(const l of Object.values(e.vendorState.vendorByID))l?.id!=null&&(a[l.id]=l.name);const t={};for(const l of Object.values(e.classState.classesByKey))l?.classId!=null&&(t[l.classId]=l.className);return{approvalView:s,remiSetupApproverViewUpdateData:n,vendorNamesById:a,departmentNamesById:t}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(A)&&e(T(!1))},onBackClick:()=>{W(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(B(t,!0))},onEditRuleClick:t=>{t!=null?(e(f(t)),n(`./${t}/edit`)):(e(f()),n("./new"))},onReorderRules:t=>{e(Y(t,!0))}}}))(O(G)),Q=()=>{const e=u((a=>E(a))),{isApprovalRulesV3Enabled:s,isLoading:n}=F(e?.tenantId);return s?o.jsx(X,{isLoading:n}):o.jsx(M,{isLoading:n})},X=({isLoading:e})=>{const s=C(),n=N(),a=D(),[t,l]=p.useState(!1),[v,R]=p.useState(!1),[S,c]=p.useState(!1),d=u((i=>i.remiSetupApproverViewState.fetchState)),b=u((i=>i.remiSetupApproverViewState.approverListState.fetchStatus.fetchState)),m=u((i=>E(i))),r=u((i=>h(i)));H();const y=u((i=>w(i).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{y?.updateStatus.fetchState==="Completed"&&a(U())}),[y]),p.useEffect((()=>{t||d!=="Not-Started"||e||(l(!0),a(L(!0,!1,!1,!0)))}),[t,d,e,a]),p.useEffect((()=>{v||b!=="Not-Started"||e||(R(!0),a(K(!1,!0)))}),[v,b,e,a]),$.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{r.allApprovalRules.length===0&&r.fetchState==="Completed"&&(S||(c(!0),a(f())),s("./new"))}),[S,r,a]);const I={events:m.companyId!=null?[`private-encrypted-${m.companyId}.${A}`]:[],eventCallback:(i,ee,_)=>{i.endsWith(A)&&_.onApprovalRulesEventReceived(i)}};return m?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?o.jsx(V,{to:"../../promo"}):o.jsx(P,{currentTenant:m,location:n,navigate:s,isLoading:e,...I})};function le(){return o.jsxs(z,{children:[o.jsx(g,{path:"/",element:o.jsx(Q,{})}),o.jsx(g,{path:"/new",element:o.jsx(x,{})}),o.jsx(g,{path:"/:approvalRuleId/edit",element:o.jsx(x,{})}),o.jsx(g,{path:"*",element:o.jsx(Z,{})})]})}export{le as R};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as h}from"./liveblocks-
|
|
1
|
+
import{j as h}from"./liveblocks-DRsJ0YIJ.js";import{a as f}from"./sentry-G4ZANa8Z.js";import{u as U,j as g,h as _,g as O,i as V,l as N}from"./core-DGLzDXWl.js";import{mq as Z,Z8 as T,YT as x,Nl as k,Ny as B,Nt as A,Nu as E,Z9 as j,fE as z,Ns as K}from"./zeni-epic-state-Dm2vDWXH.js";import{z as F,E as P,a7 as q,c0 as W,o as $,bS as Y,c1 as G}from"./index-DGjciFPC.js";import"./mui-BuJ3P0FU.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="4f874f0d-6067-47fe-b3c5-138517996bf1",e._sentryDebugIdIdentifier="sentry-dbid-4f874f0d-6067-47fe-b3c5-138517996bf1")}catch{}})();function H(){const e=U(),s=f.useRef(!1),t=g((o=>o.vendorListState.fetchStateBillsTab.fetchState??"Not-Started")),p=g((o=>o.vendorListState.allVendorIdsBillsTab.length>0));f.useEffect((()=>{s.current||p||t==="Completed"||t==="In-Progress"||(s.current=!0,e(Z({})))}),[p,t,e])}const J=N((function(e,s){const t=T(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=p==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return s.approvalRuleId&&(l=t.allApprovalRules.findIndex((r=>r.approvalRuleId===s.approvalRuleId))===0),{localData:t,hideUpperBoundField:o,isLowerBoundDisabled:l,approvalUpdateActionType:p}}),(function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=$(s.location);return{onApprovalRuleDataUpdated:a=>{const d=v=>{const S=[];return v.forEach((u=>{const R=u.actors.selectedUsers.map((m=>({type:"user",subType:void 0,userId:m.userId,idType:"user",isImplicitActor:!1}))),b=u.actors.selectedNonUsers.map((m=>{const y=(I=m.value,j(I)==null);var I;return{type:y?"attribute":"role",subType:m.value,userId:void 0,idType:void 0,isImplicitActor:!y}})),c=R.concat(b);S.push({action:u.stepType.selectedOption,actors:c,operator:c.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})})),S},n={amount:{type:"amount",comparator:"range",min:{amount:a.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:a.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(r==="approval_create"){const v={criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}else{const v={approvalRuleId:l,criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!1))},onSaveRuleSuccess:()=>{t("../")}}}))(W);function M(){const e=_(),s=U(),t=O(),{approvalRuleId:p}=V(),o=F.getSignedInUser(),l=P(),r=g((n=>T(n))),i=g((n=>x(n))),[a,d]=f.useState(!1);if(f.useEffect((()=>{a||(d(!0),s(k(!0)))})),f.useEffect((()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?h.jsx(q,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):h.jsx(J,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t})}function pe(e){return j(e)==null}const Q=N((function(e,s){const t=T(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=[],l={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(o.push(r.id),l[r.id]=r.name);return{localData:t,approvalUpdateActionType:p,allVendorIds:o,vendorNamesById:l,editingRuleId:p==="approval_update"?s.approvalRuleId:void 0,allApprovalRulesWithUser:x(e).allApprovalRules}}),(function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=$(s.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const m=[];return c.forEach((y=>{const I=y.actorKind?.selectedOption,L=y.selectedRole?.selectedNonUsers??[];let D=[];I==="role"?D=L.map((w=>({type:"attribute",subType:w.value,userId:void 0,idType:void 0,isImplicitActor:!1}))):I==="specific_person"&&(D=(y.persons?.selectedUsers??[]).map((w=>({type:"user",subType:void 0,userId:w.userId,idType:"user",isImplicitActor:!1}))));const C=y.action??"require_approval";m.push({action:C,actors:D,operator:D.length>1?C==="require_approval"?"or":"and":"is"})})),m},n=a.amountCriteria,v=a.vendorCriteria,S=a.departmentCriteria,u={};if(n!=null&&n.comparator.selectedOption!=null){const c=n.comparator.selectedOption;u.amount={type:"amount",comparator:c,min:c==="less_than"?void 0:n.min,max:c==="greater_than"?void 0:n.max}}const R=v?.selection.selectedOptions??[];R.length>0&&(u.vendor={type:"vendor",operator:v?.operator.selectedOption??"is",vendorIds:R});const b=S?.selection.selectedOptions??[];if(b.length>0&&(u.department={type:"department",operator:S?.operator.selectedOption??"is",departmentIds:b}),r==="approval_create"){const c={name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}else{const c={approvalRuleId:l,name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:a=>{e(K(a)),t(r==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}}))(G);function ne(){const e=g((t=>z(t))),{isApprovalRulesV3Enabled:s}=Y(e?.tenantId);return s?h.jsx(X,{}):h.jsx(M,{})}function X(){const e=_(),s=U(),t=O(),{approvalRuleId:p}=V(),o=F.getSignedInUser(),l=P(),r=g((n=>T(n))),i=g((n=>x(n))),[a,d]=f.useState(!1);if(H(),f.useEffect((()=>{a||(d(!0),s(k(!1)))})),f.useEffect((()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?h.jsx(q,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):h.jsx(Q,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t},p??"new")}export{ne as R,pe as i,H as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-B3m51ZRo.js";import{u as ae,j as v,h as Q,g as J,i as ie,N as $,l as ee,q as ct,n as dt,o as w}from"./core-gUqdW_kq.js";import{fE as V,MU as ut,_6 as ge,c8 as he,L_ as Le,m9 as pt,Md as ce,Mc as de,_7 as bt,bn as fe,gU as _e,_8 as gt,W4 as ht,l_ as Me,W5 as Ce,W6 as ft,kM as St,Y7 as It,k$ as yt,LO as Rt,Bx as vt,kT as At,Mz as $e,_9 as Pe,_a as Ee,_b as kt,_c as Ct,_d as Et,Mj as we,l5 as wt,Yg as xt,Mb as Bt,LY as Tt,_e as Dt,LX as jt,_f as Ft,M3 as xe,Mn as Ut,Mm as Lt,Mi as _t,_g as Ne,Rx as Mt,bo as $t,M6 as Pt,MR as Nt,_h as Ot,_i as zt,Mv as Gt,Ms as Be,XD as Zt,LV as Vt,_j as Oe,Ni as Te,Nq as Wt,_k as Ht,_l as Y,_m as qt,_n as ze,_o as Yt,_p as Ge,_q as Ze,MH as ue,bu as Xt,bK as Se,cM as Ie,dY as Ve,dX as We,_r as Jt,gg as Kt,XQ as Qt,_s as en,_t as He,XU as tn,YC as nn,_u as an,Y$ as sn,Nn as De,Nm as on,_v as rn,_w as ln,_x as mn,_y as cn,_z as dn,Ym as un,Nd as pn,Nh as bn,bq as gn,bJ as hn,cG as fn,cu as Sn,bt as In,Tw as yn,d9 as Rn,dc as vn,db as An,cF as kn}from"./zeni-epic-state-C-d25VTi.js";import{bS as Cn,c as qe,a1 as Ye,M as oe,y as x,z as _,cT as Xe,a8 as re,k as C,aS as je,J as F,ae as se,af as En,G as Je,cU as wn,p as X,as as Ke,cV as xn,Q as le,cW as Bn,aq as Tn,ab as Dn,a7 as ye,U as Qe,w as jn,bA as Fn,av as Un,ai as Ln,E as et,cX as _n,g as Mn}from"./index-DRDpUzzs.js";import{n as P,S as $n}from"./mui-DCW4m3lZ.js";import pe from"./NotFoundScreen-BFfoIcMt.js";import{S as Fe}from"./SetupPagesScreen-CNVeqnHU.js";import{F as tt}from"./FeaturePreviewScreen-CaIMasua.js";import{a as h}from"./sentry-DI7gLUjw.js";import{u as Re}from"./useAskAiCfoHostNavButtonProps-DNzUy0g0.js";import{u as nt}from"./useInitialThreadRequest-TMWlbA40.js";import{D as Pn}from"./DrawerScreen--7ksii2j.js";import{M as at}from"./MobileAppDrawer-Bh8VAeHB.js";import{F as Nn}from"./ScreenRoutes-DBgMcdH4.js";import{R as On}from"./ReimbursementApprovalRoutes-CvLfwozC.js";import"./recharts-HpXoq1DR.js";import"./analytics-BvodL4nJ.js";import"./plaid-BrXe9xNf.js";import"./dnd-YSyN45zY.js";import"./stripe-cKAAJElX.js";import"./lottie-DLBd_qLT.js";import"./lexical-Euc6kCJG.js";import"./pdf-BDXl9G7N.js";import"./utils-8Dv5nUFZ.js";import"./BusinessVerificationPageScreen-CmhKA9oQ.js";import"./routePaths-BlnN04aI.js";import"./analyticsHelper-BBEm35nD.js";import"./InboxNotificationsProvider-D007v5X6.js";import"./useTaskManagerAccess-BJoTHFNB.js";import"./getLocaleForTenant-BFGbVplK.js";import"./ReimbursementApprovalRuleDetailScreen-lW1DSyNO.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]="dc52b9f6-f41e-4b2b-8ff1-4e6d4b8c19f4",e._sentryDebugIdIdentifier="sentry-dbid-dc52b9f6-f41e-4b2b-8ff1-4e6d4b8c19f4")}catch{}})();const st=e=>`/${e}/reimbursements`,zn=e=>h.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},h.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),h.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{common:q,spendManagement:{reimbursement:{reimbursementDetail:ne}}}=Je.getLocalizedStrings(),Gn=ee((function(e,t){const n=t.currentTenant?.companyId,r=bt(e.plaidAccountViewState,"user_reimbursement_account"),c=_.getSignedInUser(),d=fe(c),m=r.plaidConnectionDetails,o=_e(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:a??""},l=ge(e,t.reimbursementId),b=gt(e,c?.userId??"");let y=`${c?.firstName} ${c?.lastName}`,f=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,f=c?.userId===l.createdBy?.userId);const B=e.entityAutoCompleteState?.autoCompleteText?.common,u=ht(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:B,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:y,isUserAdmin:he(t.currentTenant?.userRole??[]),isZeniUser:d,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:C,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:f,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:Me(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:c,navigate:d,themeState:m}=t,{tenantEmailDomain:o}=r,a=_.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(de(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(xe(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(_t(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Lt())},clearRemiSaveStatus:()=>{e(Ut("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(xe(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ft({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(jt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(Dt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Tt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Bt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(we(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(we("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Ee({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(ce({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Et({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(Ct({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(kt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Pe()),e(Ee({}));const i=st(o),l=X(c.state?.pathnameStackToGoBack,c.pathname);d(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(C.trackReimbursementDeleteReimbursement(n),e($e(n)))},onSaveBankAccount:()=>{a?.userId&&e(At(a?.userId,n))},onFetchLinkTokenClick:i=>{e(vt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(Rt(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(yt(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(St({fetchState:"Not-Started"})),e(It())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(ft({searchString:i,entityType:l,searchOrigin:"common"})):e(Ce("common"))},onCancelAutoComplete:()=>{e(Ce("common"))}}}}))(wn);function Ue(){const e=Q(),t=ae(),n=J(),{reimbursementId:r}=ie(),c=qe(),d=Ye(),[m,o]=h.useState(r==null),[a,i]=h.useState(1),{useFeatureGate:l}=oe(),{isFeatureEnabled:b}=l(x.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(x.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:f}=l(x.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:B,onAskAiCfoClick:u}=Re({mobileExploreReferrer:"Reimbursement Details"}),T=J().pathname,D=T.includes("edit"),j=T.includes("reimbursement/new"),[A,k]=h.useState(!1),E=_.getSignedInUser(),I=v((p=>V(p))),g=v((p=>ge(p,r))),U=nt(I?.companyId,{clearParams:g.fetchState==="Completed"}),L=he(I?.userRole??[]);(function(){const p=ae(),N=v((K=>V(K))),O=N?.tenantId,{isApprovalRulesV3Enabled:z,isLoading:W}=Cn(O),H=v((K=>K.remiSetupApproverViewState.fetchState));h.useEffect((()=>{O==null||W||H==="Not-Started"&&p(ut(!0,!1,!1,z))}),[O,W,z,H,p])})(),h.useEffect((()=>{(j&&!A||D&&!A&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(k(!0),t(Le(!1,b,y,r)))}));const M=v((p=>pt(p.accountState,p.accountListState,"reimbursementAccountList")));if(E==null)throw Error("Can't access address page without signing in...");const R={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||L&&g.billStatus==="rejected"||L===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx($,{to:R}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(Xe,{isNewReimbursement:r==null}):s.jsxs(Zn,{windowSize:d,children:[s.jsx(re,{analytics:C,onLoad:p=>(N=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&N.trackReimbursementEditReimbursement(r)})(p)}),m&&d!=="small"?s.jsx(Vn,{}):null,m&&d!=="small"?s.jsx(Wn,{children:s.jsx(je,{showAutofill:m,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:E?.userId??"",sessionId:E?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(de(p,a,!0,r,E?.userId))},updateInvoiceUploadFetchState:p=>{t(ce({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:F.sp3,paddingBottom:"15px",paddingLeft:F.sp5},dropFilePlaceholder:{upload:q.upload,single:ne.dropReceipt.single,or:q.texts.or,multiple:ne.dropReceipt.multiple,receipts:q.texts.receipts2}})}):null,m&&d==="small"?s.jsxs(Hn,{children:[s.jsx(qn,{onClick:()=>o(!1),children:s.jsx(zn,{})}),s.jsx(je,{showAutofill:m,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:E?.userId??"",sessionId:E?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(de(p,a,!0,r,E?.userId))},updateInvoiceUploadFetchState:p=>{t(ce({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:F.sp5,paddingRight:F.sp3,paddingBottom:F.sp5,paddingLeft:F.sp3},dropFilePlaceholder:{upload:q.upload,single:ne.dropReceipt.single,or:q.texts.or,multiple:ne.dropReceipt.multiple,receipts:q.texts.receipts2}})]}):null,s.jsx(Yn,{windowSize:d,children:s.jsx(Gn,{initialOpenThreadRequest:U??void 0,isReimbursementCommentingEnabled:f,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:c,uncategorizedAccounts:M,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:B,onAskAiCfoClick:u})})]})}const Zn=P.div`
|
|
1
|
+
import{j as s}from"./liveblocks-DRsJ0YIJ.js";import{u as ae,j as v,h as Q,g as K,i as ie,N as M,l as ee,q as ct,n as dt,o as w}from"./core-DGLzDXWl.js";import{fE as V,Np as ut,_E as ge,c8 as he,Mv as Le,m9 as pt,MK as ce,MJ as de,_F as bt,bn as fe,gU as _e,_G as gt,WC as ht,l_ as $e,WD as Ce,WE as ft,kM as St,YF as It,k$ as yt,Mj as Rt,C2 as vt,kT as At,N4 as Me,_H as Pe,_I as Ee,_J as kt,_K as Ct,_L as Et,MQ as we,l5 as wt,YO as xt,MI as Bt,Mt as Tt,_M as Dt,Ms as jt,_N as Ut,MA as xe,MU as Ft,MT as Lt,MP as _t,_O as Ne,S2 as $t,bo as Mt,MD as Pt,Nm as Nt,_P as Ot,_Q as zt,N0 as Gt,MZ as Be,Y9 as Zt,Mq as Vt,_R as Oe,NP as Te,NX as Wt,_S as Ht,_T as q,_U as Yt,_V as ze,_W as qt,_X as Ge,_Y as Ze,Nc as ue,bu as Jt,bK as Se,cM as Ie,dZ as Ve,dY as We,_Z as Kt,gg as Xt,Ym as Qt,__ as en,_$ as He,Yq as tn,Z8 as nn,$0 as an,Zx as sn,NU as De,NT as on,$1 as rn,$2 as ln,$3 as mn,$4 as cn,$5 as dn,YU as un,NK as pn,NO as bn,bq as gn,bJ as hn,cG as fn,cu as Sn,bt as In,U1 as yn,d9 as Rn,dc as vn,db as An,cF as kn}from"./zeni-epic-state-Dm2vDWXH.js";import{bS as Cn,$ as Ye,a1 as qe,O as oe,c as x,z as _,cT as Je,a8 as re,k as C,aS as je,J as U,ae as se,af as En,G as Ke,cU as wn,p as J,as as Xe,cV as xn,U as le,cW as Bn,aq as Tn,ab as Dn,a7 as ye,T as Qe,w as jn,bA as Un,av as Fn,ai as Ln,E as et,cX as _n,g as $n}from"./index-DGjciFPC.js";import{n as P,S as Mn}from"./mui-BuJ3P0FU.js";import pe from"./NotFoundScreen-3YmbDG-O.js";import{S as Ue}from"./SetupPagesScreen-CsSP_P2k.js";import{F as tt}from"./FeaturePreviewScreen-CEOFkjIy.js";import{a as h}from"./sentry-G4ZANa8Z.js";import{u as Re}from"./useAskAiCfoHostNavButtonProps-DY2m50un.js";import{u as nt}from"./useInitialThreadRequest-Cdwnj1Ib.js";import{D as Pn}from"./DrawerScreen-o43C4sHm.js";import{M as at}from"./MobileAppDrawer-Q8q8ssn0.js";import{F as Nn}from"./ScreenRoutes-QNvqH_bZ.js";import{R as On}from"./ReimbursementApprovalRoutes-DifzmUQS.js";import"./recharts-CJlXFxhv.js";import"./analytics-CvsRIk3B.js";import"./plaid-i7y7YD6O.js";import"./dnd-SnD389s6.js";import"./stripe-cKAAJElX.js";import"./lottie-DEqUWUd5.js";import"./lexical-CMBMntF_.js";import"./pdf-B_v4zyN7.js";import"./utils-Bz8wuSWM.js";import"./BusinessVerificationPageScreen-BmHKq1LL.js";import"./routePaths-COaM8xFB.js";import"./analyticsHelper-tF6p2yRC.js";import"./InboxNotificationsProvider-Cf5DQSg3.js";import"./useTaskManagerAccess-i7vk79Wr.js";import"./getLocaleForTenant-CZIO6uAG.js";import"./ReimbursementApprovalRuleDetailScreen-6W7aXQIv.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]="346382e1-6921-430d-9450-98218ca2d48a",e._sentryDebugIdIdentifier="sentry-dbid-346382e1-6921-430d-9450-98218ca2d48a")}catch{}})();const st=e=>`/${e}/reimbursements`,zn=e=>h.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},h.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),h.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{common:Y,spendManagement:{reimbursement:{reimbursementDetail:ne}}}=Ke.getLocalizedStrings(),Gn=ee((function(e,t){const n=t.currentTenant?.companyId,r=bt(e.plaidAccountViewState,"user_reimbursement_account"),c=_.getSignedInUser(),d=fe(c),m=r.plaidConnectionDetails,o=_e(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:a??""},l=ge(e,t.reimbursementId),b=gt(e,c?.userId??"");let y=`${c?.firstName} ${c?.lastName}`,f=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,f=c?.userId===l.createdBy?.userId);const B=e.entityAutoCompleteState?.autoCompleteText?.common,u=ht(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:B,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:y,isUserAdmin:he(t.currentTenant?.userRole??[]),isZeniUser:d,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:C,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:f,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:$e(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:c,navigate:d,themeState:m}=t,{tenantEmailDomain:o}=r,a=_.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(de(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(xe(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(_t(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Lt())},clearRemiSaveStatus:()=>{e(Ft("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(xe(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ut({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(jt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(Dt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Tt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Bt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(we(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(we("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Ee({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(ce({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Et({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(Ct({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(kt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Pe()),e(Ee({}));const i=st(o),l=J(c.state?.pathnameStackToGoBack,c.pathname);d(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(C.trackReimbursementDeleteReimbursement(n),e(Me(n)))},onSaveBankAccount:()=>{a?.userId&&e(At(a?.userId,n))},onFetchLinkTokenClick:i=>{e(vt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(Rt(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(yt(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(St({fetchState:"Not-Started"})),e(It())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(ft({searchString:i,entityType:l,searchOrigin:"common"})):e(Ce("common"))},onCancelAutoComplete:()=>{e(Ce("common"))}}}}))(wn);function Fe(){const e=Q(),t=ae(),n=K(),{reimbursementId:r}=ie(),c=Ye(),d=qe(),[m,o]=h.useState(r==null),[a,i]=h.useState(1),{useFeatureGate:l}=oe(),{isFeatureEnabled:b}=l(x.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(x.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:f}=l(x.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:B,onAskAiCfoClick:u}=Re({mobileExploreReferrer:"Reimbursement Details"}),T=K().pathname,D=T.includes("edit"),j=T.includes("reimbursement/new"),[A,k]=h.useState(!1),E=_.getSignedInUser(),I=v((p=>V(p))),g=v((p=>ge(p,r))),F=nt(I?.companyId,{clearParams:g.fetchState==="Completed"}),L=he(I?.userRole??[]);(function(){const p=ae(),N=v((X=>V(X))),O=N?.tenantId,{isApprovalRulesV3Enabled:z,isLoading:W}=Cn(O),H=v((X=>X.remiSetupApproverViewState.fetchState));h.useEffect((()=>{O==null||W||H==="Not-Started"&&p(ut(!0,!1,!1,z))}),[O,W,z,H,p])})(),h.useEffect((()=>{(j&&!A||D&&!A&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(k(!0),t(Le(!1,b,y,r)))}));const $=v((p=>pt(p.accountState,p.accountListState,"reimbursementAccountList")));if(E==null)throw Error("Can't access address page without signing in...");const R={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||L&&g.billStatus==="rejected"||L===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(M,{to:R}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(Je,{isNewReimbursement:r==null}):s.jsxs(Zn,{windowSize:d,children:[s.jsx(re,{analytics:C,onLoad:p=>(N=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&N.trackReimbursementEditReimbursement(r)})(p)}),m&&d!=="small"?s.jsx(Vn,{}):null,m&&d!=="small"?s.jsx(Wn,{children:s.jsx(je,{showAutofill:m,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:E?.userId??"",sessionId:E?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(de(p,a,!0,r,E?.userId))},updateInvoiceUploadFetchState:p=>{t(ce({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:U.sp3,paddingBottom:"15px",paddingLeft:U.sp5},dropFilePlaceholder:{upload:Y.upload,single:ne.dropReceipt.single,or:Y.texts.or,multiple:ne.dropReceipt.multiple,receipts:Y.texts.receipts2}})}):null,m&&d==="small"?s.jsxs(Hn,{children:[s.jsx(Yn,{onClick:()=>o(!1),children:s.jsx(zn,{})}),s.jsx(je,{showAutofill:m,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:E?.userId??"",sessionId:E?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(de(p,a,!0,r,E?.userId))},updateInvoiceUploadFetchState:p=>{t(ce({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:U.sp5,paddingRight:U.sp3,paddingBottom:U.sp5,paddingLeft:U.sp3},dropFilePlaceholder:{upload:Y.upload,single:ne.dropReceipt.single,or:Y.texts.or,multiple:ne.dropReceipt.multiple,receipts:Y.texts.receipts2}})]}):null,s.jsx(qn,{windowSize:d,children:s.jsx(Gn,{initialOpenThreadRequest:F??void 0,isReimbursementCommentingEnabled:f,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:c,uncategorizedAccounts:$,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:B,onAskAiCfoClick:u})})]})}const Zn=P.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
position: relative;
|
|
4
4
|
height: 100vh;
|
|
@@ -33,27 +33,27 @@ import{j as s}from"./liveblocks-B3m51ZRo.js";import{u as ae,j as v,h as Q,g as J
|
|
|
33
33
|
flex-direction: column;
|
|
34
34
|
overflow-y: auto;
|
|
35
35
|
background-color: ${e=>e.theme.colors.grey4};
|
|
36
|
-
`,
|
|
36
|
+
`,Yn=P.button`
|
|
37
37
|
align-self: flex-end;
|
|
38
38
|
background: none;
|
|
39
39
|
border: none;
|
|
40
40
|
cursor: pointer;
|
|
41
|
-
padding: ${
|
|
41
|
+
padding: ${U.sp2} ${U.sp3};
|
|
42
42
|
line-height: 1;
|
|
43
43
|
color: ${e=>e.theme.colors.hero};
|
|
44
44
|
&:hover {
|
|
45
45
|
color: ${e=>e.theme.colors.primary};
|
|
46
46
|
}
|
|
47
47
|
svg {
|
|
48
|
-
width: ${
|
|
49
|
-
height: ${
|
|
48
|
+
width: ${U.sp4};
|
|
49
|
+
height: ${U.sp4};
|
|
50
50
|
}
|
|
51
|
-
`,
|
|
51
|
+
`,qn=P.div`
|
|
52
52
|
display: flex;
|
|
53
53
|
flex-direction: column;
|
|
54
54
|
width: 100%;
|
|
55
55
|
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
56
|
-
`,
|
|
56
|
+
`,Jn=ee((function(e,t){const n=Ne(e,t.reimbursementId),r=_.getSignedInUser(),c=fe(r),d=e.tenantState.currentTenantId,m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:d??""},o=`${n.createdBy?.firstName??"Zeni"} ${n.createdBy?.lastName??""}`;let a=!1;n?.remiActivities.length>0&&(a=Ot(n.remiActivities,zt(t.currentTenant),r));const i=he(t.currentTenant?.userRole??[]),l=r?.userId===n.createdBy?.userId;return{remiDetails:n,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:m,signedInUser:r,createdBy:o,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,isAdmin:i,showApproveRejectBtns:a,isZeniUser:c,isSignedInUserReimbursementCreator:l,isAccountingClassesEnabled:$e(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:c,navigate:d,themeState:m}=t,{tenantEmailDomain:o}=r;return{onDuplicateLineClick:(a,i)=>window.open(`/${o}/reimbursement/${a}#L${i}`),redirectToReimbursementListScreen:()=>{e(Pe());const a=st(o),i=J(c.state?.pathnameStackToGoBack,c.pathname);d(a,{state:{pathnameStackToGoBack:i}})},onSaveRealTimeApprovals:a=>{e(Vt(n,"reimbursement",a))},updateEditRealTimeApproverClicked:a=>{e(Zt({isEdit:a,entityId:n,entityType:"reimbursement"}))},approveOrRejectRemi:a=>{a.type==="approved"?e(Be(n,a.type,"")):e(Be(n,a.type,a.description??""))},redirectToEditableReimbursementScreen:()=>{const a=J(c.state?.pathnameStackToGoBack,c.pathname);d("./edit",{state:{pathnameStackToGoBack:a}})},deleteReimbursement:()=>{C.trackReimbursementDeleteReimbursement(n),e(Me(n))},cancelAndDeleteReport:a=>{a===!0?C.trackReimbursementCancelAndDeleteReimbursement(n):C.trackReimbursementCancelReimbursement(n),e(Gt(n,a))},handleZeniLogoClick:()=>{m.toggle()}}}))(xn);function Kn(){const e=Q(),t=ae(),n=K(),r=n.hash.substring(1),c=Ye(),{reimbursementId:d}=ie(),m=_.getSignedInUser(),o=v((R=>V(R))),a=v((R=>Ne(R,d??""))),i=a.remiDetails?.reimbursementInfo.stage.code==="draft",l=nt(o?.companyId,{clearParams:a.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:b,onAskAiCfoClick:y}=Re({mobileExploreReferrer:"Reimbursement Details"});Xe({isDataReady:a.fetchState==="Completed"});const{useFeatureGate:f}=oe(),{isFeatureEnabled:B}=f(x.isLimitedCategoryForReimbursement),[u,T]=h.useState(!1),[D,j]=h.useState(!1),[A,k]=h.useState(!1),{isFeatureEnabled:E}=f(x.isReimbursementCommentingEnabled),{isFeatureEnabled:I}=f(x.isShowDeletedReimbursementsFeatureEnabled),g=v((R=>ge(R,d??""))),F=$t(o),L=Mt(o.userRole),$=a.fetchState;if(h.useEffect((()=>{u||d==null?u==1&&$==="Error"&&e("page-not-found",{replace:!0}):(T(!0),t(Pt(d,!1,I)))}),[u,d,t,$]),h.useEffect((()=>{I&&a.remiDetails?.isDeleted===!0||o.isZeni===!0&&m?.userEmailDomain==="zeni.ai"&&F===!1?k(!1):k(a.remiActivities[0]?.isRealTimeApprovalEnabled&&(L||a.allApprovers.find((R=>R.user.userId===m?.userId))!=null||a.remiDetails?.lastUpdatedBy===m?.userId))}),[a.remiActivities[0]?.isRealTimeApprovalEnabled,a.allApprovers,a.remiDetails?.lastUpdatedBy,L,o.isZeni,F,m]),h.useEffect((()=>{D||a.fetchState!="Completed"||a.remiDetails?.reimbursementInfo.stage.code=="paid"||a.remiDetails?.reimbursementInfo.stage.code=="scheduled"||g.fetchState=="Completed"||g.fetchState=="In-Progress"||(j(!0),t(Le(!1,B,I,d)),a.remiActivities[0]?.isRealTimeApprovalEnabled===!0&&t(Nt(!1,!0,!0,a.lastUpdatedByUserId)))}),[D,a,d,t]),m==null)throw Error("Can't access address page without signing in...");return a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState=="Completed"&&a.remiDetails.isDeleted===!1?s.jsx(M,{to:`./edit${n.search}`}):a.deleteStatus.fetchState==="In-Progress"||a.cancelAndDeleteStatus.fetchState==="In-Progress"||a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState!="Completed"||a.fetchState!="Completed"?s.jsx(Je,{}):s.jsxs(s.Fragment,{children:[s.jsx(re,{analytics:C,onLoad:R=>(p=>{d!=null&&p.trackReimbursementReimbursementDetails(d)})(R)}),s.jsx(Jn,{initialOpenThreadRequest:l??void 0,scrollId:r,isReimbursementCommentingEnabled:E,isShowDeletedReimbursementEnabled:I,location:n,navigate:e,isRealTimeApprovalEnabled:A,currentTenant:o,reimbursementId:d??"",themeState:c,isAiCfoAccessEnabled:b,onAskAiCfoClick:y})]})}const Xn=ee((function(e,t){return{remisReviewView:Oe(e),analytics:t.analytics}}),(function(e,t){return{onCloseOverlay:()=>{t.navigate(`/${t.tenantEmailDomain}/reimbursements`),e(q())},onCloseReviewItem:n=>{e(Ht(n))},onProceedForBulkActionClick:(n,r)=>{switch(n){case"send_for_approval":e(Wt());break;case"approve":e(Te("approved",r??""));break;case"reject":e(Te("rejected",r??""))}}}}))(Bn);function Qn({tenantEmailDomain:e}){const t=Q(),n=v((m=>m.remisBulkActionViewState.bulkSubmissionFetchState.fetchState)),{remisForReview:r}=v((m=>Oe(m))),c=le(),d=c?.loggedInUserRole?.includes("admin")===!0;return h.useEffect((()=>{n!=="Completed"&&r.length!==0||t(`/${e}/reimbursements`)}),[n,r.length,e]),s.jsx(Xn,{navigate:t,analytics:C,isAdmin:d,tenantEmailDomain:e})}const Z=tn(),it="bulk-operation-update",be="reimbursement-approval-rule-update",{spendManagement:ea,common:me}=Ke.getLocalizedStrings(),ta=ea.reimbursement.bulkActions,na=P.div`
|
|
57
57
|
display: flex;
|
|
58
58
|
min-height: 100%;
|
|
59
59
|
width: 100%;
|
|
@@ -61,8 +61,8 @@ import{j as s}from"./liveblocks-B3m51ZRo.js";import{u as ae,j as v,h as Q,g as J
|
|
|
61
61
|
flex-direction: column;
|
|
62
62
|
align-items: center;
|
|
63
63
|
background-color: ${e=>e.theme.colors.grey4};
|
|
64
|
-
`,aa=ee((function(e,t){const n=Ze(e,Z,t.isBulkActionEnabled);let r=n.allSubTabs;const c=_.getSignedInUser(),d=fe(c),m=e.tenantState.currentTenantId,o=V(e),a=o?.companyName??"",i={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:m??""},l=e.remiListState.downloadUIState.downloadState;t.isShowDeletedReimbursementEnabled===!1&&(r=r.filter((f=>f!=="deleted")));const b=n.fetchState,y=nn(e);return{transactionList:t.isShowDeletedReimbursementEnabled?n.reimbursements:n.reimbursements.filter((f=>f.isDeleted===!1)),isAdmin:t.isAdmin,isZeniUser:d,isBillPayCommentingEnabled:t.isBillPayCommentingEnabled,isReimbursementCommentingEnabled:t.isReimbursementCommentingEnabled,allSubTabs:r,isEmployee:t.isEmployee,currentTab:n.currentTab,currentSubTab:n.currentSubTab,approvalCount:n.approvalCount,fetchState:b,botEmail:n.reimbursementBotEmail,analytics:C,uiState:n.uiState,searchText:n.searchText,filters:n.filters,downloadParams:{authParams:i,companyName:a,timePeriod:Z,spendManagementEndPoint:`${
|
|
64
|
+
`,aa=ee((function(e,t){const n=Ze(e,Z,t.isBulkActionEnabled);let r=n.allSubTabs;const c=_.getSignedInUser(),d=fe(c),m=e.tenantState.currentTenantId,o=V(e),a=o?.companyName??"",i={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:m??""},l=e.remiListState.downloadUIState.downloadState;t.isShowDeletedReimbursementEnabled===!1&&(r=r.filter((f=>f!=="deleted")));const b=n.fetchState,y=nn(e);return{transactionList:t.isShowDeletedReimbursementEnabled?n.reimbursements:n.reimbursements.filter((f=>f.isDeleted===!1)),isAdmin:t.isAdmin,isZeniUser:d,isBillPayCommentingEnabled:t.isBillPayCommentingEnabled,isReimbursementCommentingEnabled:t.isReimbursementCommentingEnabled,allSubTabs:r,isEmployee:t.isEmployee,currentTab:n.currentTab,currentSubTab:n.currentSubTab,approvalCount:n.approvalCount,fetchState:b,botEmail:n.reimbursementBotEmail,analytics:C,uiState:n.uiState,searchText:n.searchText,filters:n.filters,downloadParams:{authParams:i,companyName:a,timePeriod:Z,spendManagementEndPoint:`${Fn}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:l,isBulkActionAllowed:n.remiListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:n.remiListBulkActionInfo?.remisSelectedForBulkAction,allowedBulkActions:n.remiListBulkActionInfo?.allowedBulkActions,remiApprovalRulesAffectedEntityIds:y.affectedEntityIds}}),(function(e,t){const{navigate:n,currentTenant:r,location:c,period:d}=t,{tenantEmailDomain:m}=r;return{updateTabToState:o=>{e(q()),e(ze(o))},onSubtabChange:o=>{e(q()),e(Ge(o))},onTransactionClick:(o,a)=>{const i=oa(m,o,a),l=J(c.state?.pathnameStackToGoBack,c.pathname);n(i,{state:{pathnameStackToGoBack:l}})},onClickSetupIcon:()=>{const o=ia(m),a=J(c.state?.pathnameStackToGoBack,c.pathname);n(o,{state:{pathnameStackToGoBack:a}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;C?.trackReimbursementNewReimbursement();const a=`/${o}/reimbursement/new`,i=J(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(a,{state:{pathnameStackToGoBack:i}})},onColumnSortConfigChanged:(o,a)=>{e(dn({uiState:{sortKey:o,sortOrder:a},period:t.period}))},onSearchTextChanged:o=>{e(cn(o))},onFiltersChange:o=>{e(mn({filters:o})),o.categories.every((a=>a.field!=null&&a.values?.length!==0))&&C.trackSpendManagmentFilterChange("reimbursement",o.categories.map((a=>`${a.field}-${JSON.stringify(a.values)}`)))},updateDownloadStateHandler:o=>{o==="In-Progress"&&C.trackSpendManagementDownloadClick("reimbursement"),e(ln({uiState:{downloadState:o}}))},onReloadTransactions:()=>{e(ue(d,!0,t.isShowDeletedReimbursementEnabled,!1,!0))},onBackClick:()=>{n("../",{relative:"path"})},onNavigateToSettings:()=>{n("../reimbursements/setup")},updateBulkActionList:o=>{e(rn(o))},removeAllTransactionsFromBulkActionList:()=>{e(q())},onProceedForBulkActionClick:(o,a)=>{switch(o){case"delete":case"cancel":e(on(o,a??""));break;case"send_for_approval":e(De("send_for_approval")),t.navigate("./bulk-review");break;case"review":e(De("approve")),t.navigate("./bulk-review")}},onReimbursementApprovalRulesEventReceived:o=>{o.endsWith(be)&&e(sn(!1))},onEventReceived:o=>{o===it&&e(an())}}}))(jn(Un));function sa(){const e=Q(),t=ae(),n=K(),r=n.state,c=qe(),[d,m]=h.useState(null),o=ct("/:tenantEmailDomain/reimbursements/bulk-review")!=null;h.useEffect((()=>{if(r?.tab!=null&&r?.subTab!=null){const S=Yt(r.tab.toString());S!=null?t(ze(S)):console.log("Warning:Not a valid remiListTab");const G=qt(r.subTab.toString());G!=null?t(Ge(G)):console.log("Warning:Not a valid remiListSubTab")}return()=>{t(q())}}),[]);const{useFeatureGate:a}=oe(),{isFeatureEnabled:i}=a(x.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:l}=a(x.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:b}=a(x.isBillPayCommentingEnabled),{isFeatureEnabled:y}=a(x.isReimbursementCommentingEnabled),{isFeatureEnabled:f}=a(x.isReimbursementBulkActionEnabled),B=_.getSignedInUser(),u=v((S=>V(S))),[T,D]=h.useState(!1),[j,A]=h.useState(!1),k=le(),E=k?.loggedInUserRole?.includes("admin")===!0,I=v((S=>Ze(S,Z,f))),{areTenantIdsInSync:g}=Tn(),F=I.fetchState,{isAiCfoAccessEnabled:L,onAskAiCfoClick:$}=Re({mobileExploreReferrer:"Reimbursement List"});if(Xe({isDataReady:F==="Completed"}),h.useEffect((()=>{!j&&g&&(A(!0),t(ue(Z,!0,l,!1,!0)))}),[j,Z,t,g]),B==null)throw Error("Can't access address page without signing in...");const R=!!u?.userRole&&Jt(u),p=Se(k?.loggedInUserRoleMap),N=Ie(k?.loggedInUserRoleMap),O=!!u.userReimbursementInfo?.isReimbursementTOSAccepted,z=!!u.companyReimbursementInfo?.info?.isReimbursementEnabled,W=!!u.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,H=v((S=>_e(S.companyState,u.companyId))),X=H?.company.featuresActivationInfo.connectedAccountProvider,ve=S=>{D(S)},{isFeatureEnabled:ot}=a(x.isDebitCardFeatureEnabled),rt=Ve(ot,u),lt=We(u),{remisProcessed:te,remisProcessing:Ae}=v((S=>Kt(S)));h.useEffect((()=>{te===Ae&&d!=null&&(t(Xt({messageSection:"reimbursement_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_report_",variableValue:te>1?me.texts.reports2:ta.report},{variableName:"_has_",variableValue:te>1?me.texts.have:me.texts.has},{variableName:"_action_",variableValue:Qt(d)}]})),t(en()),setTimeout((()=>{t(ue(Z,!0,l,!1,!0,!0))}),3e3),m(null))}),[te,Ae]);const mt={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${it}`,`private-encrypted-${u.companyId}.${be}`]:[],eventCallback:(S,G,ke)=>{S.endsWith(be)?ke.onReimbursementApprovalRulesEventReceived?.(S):G.entity_type==="reimbursement"&&(m(G.operation_type),ke.onEventReceived(S))}};return n.pathname.endsWith("/reimbursements/")||n.pathname.endsWith("/reimbursements")||n.pathname.endsWith("/reimbursements/bulk-review")?rt===!0||lt===!0?s.jsx(tt,{}):z&&(!R||p)||N&&O?s.jsxs(s.Fragment,{children:[F==="Completed"?s.jsx(re,{analytics:C,onLoad:S=>(G=>G.trackPageLoaded(Qe.Event.reimbursementHome))(S)}):null,s.jsx(at,{isAppContentDrawerOpen:T,handleDrawerToggle:ve}),s.jsxs(na,{windowSize:c,children:[s.jsx(Pn,{isOpen:o,drawerLeftMargin:new Dn(0,0,300,600),onClose:()=>{e(`/${u.tenantEmailDomain}/reimbursements`),t(q())},children:s.jsx(ra,{onClick:S=>S.stopPropagation(),children:s.jsx(Qn,{tenantEmailDomain:u.tenantEmailDomain})})}),s.jsx(aa,{isShowDeletedBillsEnabled:i,isShowDeletedReimbursementEnabled:l,isBillPayCommentingEnabled:b,isReimbursementCommentingEnabled:y,location:n,navigate:e,currentTenant:u,period:Z,isAdmin:E,isEmployee:R,entity:"reimbursement",onClickMenuIcon:()=>{ve(!0)},createdByUserList:I.createdByUserList,createdByUserListFetchState:I.createdByUserListFetchState,isDownloadEnabled:I.isDownloadEnabled,connectedAccountProvider:X,isBulkActionEnabled:f,bulkSubmissionLimit:I.remiBulkSubmissionLimit,bulkSubmissionFetchState:I.remiListBulkActionInfo.bulkSubmissionFetchState,isAiCfoAccessEnabled:L,onAskAiCfoClick:$,...mt})]})]}):W&&p?s.jsx(M,{to:"../setup"}):k!=null&&He(u,k.loggedInUserRoleMap)?s.jsx(M,{to:"../promo"}):s.jsx(ye,{fetchState:"In-Progress"}):s.jsx(pe,{})}const ia=e=>`/${e}/reimbursements/setup`,oa=(e,t,n)=>{let r=`/${e}/reimbursement/${encodeURIComponent(t)}`;return n=="draft"&&(r+="/edit"),r},ra=P(Mn)`
|
|
65
65
|
display: flex;
|
|
66
66
|
min-height: 100%;
|
|
67
67
|
flex-direction: column;
|
|
68
|
-
`,la=ee((function(e,t){const{companyId:n}=t;return{reimbursementSetupView:un(e,n),analytics:C,videoUrl:"https://player.vimeo.com/video/814821498?h=e7fd11e13e&badge=0&autopause=0&player_id=0&app_id=122963"}}),(function(e,t){const{companyId:n,navigate:r}=t;return{onSetupButtonClick:()=>{e(bn(n))},onCreateNewRemiButtonClick:()=>{e(pn(t.userRoleId))},onBackClick:()=>{r("../..",{relative:"path"})},onSetupReimbursementSuccess:()=>{t.isEmployee?r("../../reimbursement/new",{relative:"path"}):r("../reimbursements/setup",{relative:"path"})}}}))(_n),ma=()=>{const e=Ln(),t=Q(),n=
|
|
68
|
+
`,la=ee((function(e,t){const{companyId:n}=t;return{reimbursementSetupView:un(e,n),analytics:C,videoUrl:"https://player.vimeo.com/video/814821498?h=e7fd11e13e&badge=0&autopause=0&player_id=0&app_id=122963"}}),(function(e,t){const{companyId:n,navigate:r}=t;return{onSetupButtonClick:()=>{e(bn(n))},onCreateNewRemiButtonClick:()=>{e(pn(t.userRoleId))},onBackClick:()=>{r("../..",{relative:"path"})},onSetupReimbursementSuccess:()=>{t.isEmployee?r("../../reimbursement/new",{relative:"path"}):r("../reimbursements/setup",{relative:"path"})}}}))(_n),ma=()=>{const e=Ln(),t=Q(),n=K(),{tenantEmailDomain:r}=ie(),c=et(),[d,m]=h.useState(!1),o=v((A=>V(A))),a=_.getSignedInUserTenant(r)?.companyId??o.companyId,i=_.getSignedInUser(),l=o.userRoleId,b=!!o.userRole?.includes("reimbursements_user"),y=le(),f=Se(y?.loggedInUserRoleMap),B=Ie(y?.loggedInUserRoleMap),u=!!o.userReimbursementInfo?.isReimbursementTOSAccepted,T=!!o.companyReimbursementInfo?.info?.isReimbursementEnabled,D=!!o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,j=A=>{m(A)};if(i==null)throw Error("Can't access reimbursement promo page without signing in...");return T&&B&&u?s.jsx(M,{to:"../../../reimbursements"}):D&&f?s.jsx(M,{to:"../../reimbursements/setup"}):o.companyReimbursementInfo&&!D||o.userReimbursementInfo&&B&&u===!1?s.jsxs(s.Fragment,{children:[s.jsx(re,{analytics:C,onLoad:A=>(k=>k.trackPageLoaded(Qe.Event.reimbursementPromoPage))(A)}),s.jsx(at,{isAppContentDrawerOpen:d,handleDrawerToggle:j}),s.jsx(la,{companyId:a,navigate:t,meetingUrl:e("reimbursement_promo"),location:n,userReimbursementInfo:o.userReimbursementInfo,userRoleId:l,isEmployee:b,onClickMenuIcon:()=>{j(!0)}})]}):s.jsx(ye,{fetchState:"In-Progress",style:{backgroundColor:c.colors.grey5}})};function Oa(){const e=v((H=>V(H))),t=le(),n=!!e.company?.companyReimbursementInfo.isReimbursementEnabled,r=et(),c=!!e.company?.companyReimbursementInfo.isReimbursementTOSAccepted,d=!!e.userReimbursementInfo?.isReimbursementTOSAccepted,{useFeatureGate:m}=oe(),{isFeatureEnabled:o}=m(x.isChargeCardFeatureEnabled),{isFeatureEnabled:a}=m(x.isDebitCardFeatureEnabled),i=Ve(a,e),l=We(e),b=e?.userRole!=null&&gn(e?.userRole),y=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b)&&hn(t?.loggedInUserRoleMap),f=fn(t?.loggedInUserRoleMap),B=e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!b,u=Se(t?.loggedInUserRoleMap),T=B&&u,D=!!e.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!b,j=D&&Sn(t?.loggedInUserRoleMap),A=$n(e,o,a)&&!b,k=A&&In(t?.loggedInUserRoleMap),E=yn(t?.loggedInUserRoleMap),I=Rn(t?.loggedInUserRoleMap),g=vn(t?.loggedInUserRoleMap),F=D&&I,L=e.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!b&&g,$=An(t?.loggedInUserRoleMap),R=kn(t?.loggedInUserRoleMap),p=Ie(t?.loggedInUserRoleMap),N=A&&$,{tenantEmailDomain:O}=ie(),z=K(),W=n===!0&&(u||p&&d);return s.jsxs(dt,{children:[z.pathname.includes("/reimbursements")?s.jsxs(s.Fragment,{children:[s.jsx(w,{path:"verification",element:s.jsx(Ue,{isBillPayAdminLevelAccess:y,isUserHasOnlyBillPayAccess:f,isReimbursementAdminLevelAccess:T,isZeniAccountAdminLevelAccess:j,isChargeCardAdminLevelAccess:k,isUserHasOnlyCardAccess:E,productType:"reimbursement",type:"verification"})}),s.jsx(w,{path:"setup",element:s.jsx(Ue,{isBillPayAdminLevelAccess:y,isUserHasOnlyBillPayAccess:f,isReimbursementAdminLevelAccess:T,isZeniAccountAdminLevelAccess:j,isChargeCardAdminLevelAccess:k,isUserHasOnlyCardAccess:E,productType:"reimbursement",type:"setup"})}),s.jsx(w,{path:"promo",element:s.jsx(ma,{})}),s.jsx(w,{path:"approval-rules/*",element:T?s.jsx(On,{}):s.jsx(Nn,{showZeniAccountRoute:F,isUserHasBillPayAccess:R,isUserHasReimbursementAccess:p,showTreasuryRoute:L,isTenantBankingOnly:i,showChargeCardRoute:N,tenantEmailDomain:O??""})}),W&&s.jsx(w,{path:"*",element:s.jsx(sa,{})}),(i===!0||l===!0)&&s.jsx(w,{path:"/*",element:s.jsx(tt,{})}),t!=null&&He(e,t?.loggedInUserRoleMap)&&s.jsx(w,{path:"*",element:s.jsx(M,{to:"../promo"})}),c&&u&&s.jsx(w,{path:"*",element:s.jsx(M,{to:"../setup"})})]}):z.pathname.includes("/reimbursement")?s.jsxs(s.Fragment,{children:[s.jsx(w,{path:"new",element:s.jsx(Fe,{})}),s.jsx(w,{path:":reimbursementId",element:s.jsx(Kn,{})}),s.jsx(w,{path:":reimbursementId/edit",element:s.jsx(Fe,{})}),s.jsx(w,{path:"*",element:s.jsx(pe,{})})]}):s.jsx(w,{path:"*",element:s.jsx(ye,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5,boxShadow:`0px 2px ${U.sp1} ${r.colors.dropShadowNormal}`}})}),s.jsx(w,{path:"*",element:s.jsx(pe,{})})]})}export{Oa as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as p}from"./liveblocks-B3m51ZRo.js";import{g as W,h as De,u as Fe,i as Oe,j as d,l as Ae,n as Pe,o as ee}from"./core-gUqdW_kq.js";import{fE as $,Dt as R,U1 as Ee,l_ as le,tA as ce,up as O,lF as Le,lO as A,lG as P,kJ as E,kA as L,kz as Me,CD as ie,uu as Be,bq as ve,U2 as Ve,bn as xe,DQ as ze,U3 as Ge,U4 as Ye,ci as S,Cw as He,U5 as ae,U6 as qe,U7 as Ne,U8 as $e,U9 as Qe,Ua as Ze,Ub as Je,Uc as Xe,Ud as Ke,Ue as We,Uf as ea,Ug as aa,Uh as sa,Ui as U,Uj as M,Uk as B,Ul as v,Um as V,Un as x,Uo as z,Up as G,Uq as Y,Ur as H,eb as ta,Du as oa,Dh as se,Di as te,DA as na,Dm as oe,DG as ra,Us as la,Ut as ca,Uu as ia,Uv as da,Uw as pa,Ux as _a,Uy as fa,Uz as ma,UA as ba,UB as ua,dY as ha,dX as ya}from"./zeni-epic-state-C-d25VTi.js";import{an as wa,ao as Ca,ap as ga,a as Sa,a1 as Ia,M as de,y as q,z as pe,aq as Ra,Q as Ta,e as Ua,ar as ka,as as ja,a8 as Da,k as N,U as Fa,A as Oa,p as _e,at as Aa,au as Pa,av as Ea}from"./index-DRDpUzzs.js";import"./mui-DCW4m3lZ.js";import La from"./NotFoundScreen-BFfoIcMt.js";import{F as Ma}from"./FeaturePreviewScreen-CaIMasua.js";import{a as b}from"./sentry-DI7gLUjw.js";import{u as Ba}from"./useInitialThreadRequest-TMWlbA40.js";import{t as ne,a as re,b as va}from"./routePaths-BlnN04aI.js";import{M as Va}from"./MobileAppDrawer-Bh8VAeHB.js";import"./recharts-HpXoq1DR.js";import"./analytics-BvodL4nJ.js";import"./plaid-BrXe9xNf.js";import"./dnd-YSyN45zY.js";import"./stripe-cKAAJElX.js";import"./lottie-DLBd_qLT.js";import"./lexical-Euc6kCJG.js";import"./pdf-BDXl9G7N.js";import"./utils-8Dv5nUFZ.js";import"./InboxNotificationsProvider-D007v5X6.js";import"./useTaskManagerAccess-BJoTHFNB.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]="a7f3b170-5e36-4c0b-b1be-de16a7b0b459",e._sentryDebugIdIdentifier="sentry-dbid-a7f3b170-5e36-4c0b-b1be-de16a7b0b459")}catch{}})();const xa=["profit_loss","balance_sheet","cash_flow"],I=e=>e==="balance_sheet"||e==="balance_sheet_by_classes"||e==="balance_sheet_by_projects",y=e=>{e(H({resetLeftScroll:!0})),e(Y({resetLeftScroll:!0})),e(G({resetLeftScroll:!0})),e(z({resetLeftScroll:!0})),e(x({resetLeftScroll:!0})),e(V({resetLeftScroll:!0})),e(M({resetLeftScroll:!0})),e(v({resetLeftScroll:!0})),e(B({resetLeftScroll:!0}))},za=e=>{e(ca()),e(ia()),e(da()),e(pa()),e(_a()),e(fa()),e(ma()),e(ba()),e(ua())},Ga=Ae((function(e){const o=pe.getSignedInUser(),_=e.tenantState.currentTenantId,m=$(e),a=m?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:_??""},t=R(e),r=Ve(m);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,balanceSheetClassesViewReport:t.balanceSheetByClassReport,cashFlowClassesViewReport:t.cashFlowByClassReport,cashFlowProjectViewReport:t.cashFlowByProjectReport,balanceSheetProjectViewReport:t.balanceSheetByProjectReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:N,isZeniUser:xe(o),showAccountGroups:r===!0,isAccountingClassesEnabled:le(e),isAccountingProjectsEnabled:ce(e),currentTenantCompanyName:a,statementEndPoint:`${Ea}/statement`,authParams:s,isZeniCOAUsed:r}}),(function(e,o){const{navigate:_,handleDrawerToggle:m}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(O(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(la(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(ra(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:f,balancesRange:i}=l;let c=[...f];a==="year"&&(c=c.filter((w=>w!=="this_period_vs_same_period_last_year"&&w!=="this_period_vs_same_period_last_year_percent"&&w!=="same_period_last_year"))),e(se(o.firstMonthOfFY,r,i.numberOfPeriods<1?1:i.numberOfPeriods,c)),f.length>0&&e(te(o.firstMonthOfFY,c.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",i.numberOfPeriods<1?1:i.numberOfPeriods,c))}t!==!0&&setTimeout((()=>y(e)),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(U(a)),(I(a)||S(a))&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(oe({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(ae({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(oe(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(na(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(se(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(te(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout((()=>y(e)),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(oa({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=ta(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const f=a.accountName===""?a.accountDescription:a.accountName,i=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return ne(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return re(o.tenantEmailDomain,a.accountId,a.accountType,s.id,f,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?va(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,f,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?re(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],f,r,l):a.accountType!=null?ne(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l):void 0})();if(i!=null){const c=_e(o.location.state?.pathnameStackToGoBack,o.location.pathname);_(i,{state:{pathnameStackToGoBack:c,referrer:k(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(H({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(Y({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(G({scrollPosition:s}));break;case"balance_sheet":e(z({scrollPosition:s}));break;case"balance_sheet_by_classes":e(x({scrollPosition:s}));break;case"balance_sheet_by_projects":e(V({scrollPosition:s}));break;case"cash_flow_by_classes":e(v({scrollPosition:s}));break;case"cash_flow_by_projects":e(B({scrollPosition:s}));break;case"cash_flow":e(M({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(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(Y({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(G({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(z({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_classes":e(x({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_projects":e(V({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_classes":e(v({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_projects":e(B({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(M({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{_("../../")},onUpdateAccountViewMode:(a,s)=>{const t=s??o.selectedReportID,r=I(t),l=S(t);l?(e(Xe({viewMode:a})),e(Ke({viewMode:a}))):r?(e(We({viewMode:a})),e(ea({viewMode:a}))):(e(aa({viewMode:a})),e(sa({viewMode:a}))),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",k(t)),e(U(l?"cash_flow_by_classes":r?"balance_sheet_by_classes":"profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",k(t)),e(U(l?"cash_flow_by_projects":r?"balance_sheet_by_projects":"profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",k(t)),e(U(l?"cash_flow":r?"balance_sheet":"profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{S(o.selectedReportID)?e(Qe({classesToFilterOut:a})):I(o.selectedReportID)?e(Ze({classesToFilterOut:a})):e(Je({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{S(o.selectedReportID)?e(qe({projectsToFilterOut:a})):I(o.selectedReportID)?e(Ne({projectsToFilterOut:a})):e($e({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(ae({classViewLayout:a}))},onOpenAccountViewMode:()=>{const a=I(o.selectedReportID),s=S(o.selectedReportID);o.isAccountingClassesEnabled&&e(s?P():a?L():He()),o.isAccountingProjectsEnabled&&e(s?A():a?E():ie())},onUpdateDisplayOrder:a=>{e(Ye(a))},onUpdateReportFormat:a=>{za(e),e(Ge(a))},onClickMenuIcon:()=>{m(!0)},onResyncReports:()=>{const a=o.selectedReportID;e(a!=="balance_sheet_by_classes"?a!=="balance_sheet_by_projects"?a!=="cash_flow_by_classes"?a!=="cash_flow_by_projects"?ze(a==="profit_and_loss_by_projects"?"profit_and_loss_by_projects":"profit_and_loss_by_classes"):A(!0):P(!0):E(!0):L(!0))}}}))(Aa);function Ya(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Sa(),_=Ia(),m=Pa(_),a=De(),s=Fe(),t=W(),{tenantEmailDomain:r}=Oe(),{useFeatureGate:l}=de(),{isFeatureEnabled:f}=l(q.isReportsHorizontalClassLayoutSwitchEnabled),i=pe.getSignedInUser(),[c,w]=b.useState(!1),[Q,fe]=b.useState(!1),{isFeatureEnabled:Z}=l(q.isReportsCommentingEnabled);if(i==null)throw Error("Can't access reports page without signing in...");const j=d((n=>$(n))),me=j.masterTOSInfo?.isMasterTOSAccepted??!1,be=j.company?.companyInfo.firstMonthOfFY??1,ue=Ba(Z?j?.companyId:void 0),C=d((n=>R(n).fetchState)),he=d((n=>Ee(n))),{areTenantIdsInSync:u}=Ra(),D=d((n=>n.financeStatementState.selectedReportId)),T=d((n=>le(n))),g=d((n=>ce(n))),ye=d((n=>R(n).isCompareModeOn)),h=d((n=>R(n).filter)),F=d((n=>R(n).selectedReportAndTimeframeFetchState)),we=d((n=>n.profitAndLossClassesViewState.uiState.classViewLayout));b.useEffect((()=>{!c&&u&&(w(!0),s(O(i.userId,!0,!0,!1)))}),[c,i,s,u]),b.useEffect((()=>{c&&!Q&&C==="Completed"&&u&&(s(O(i.userId,!1,!0,!1)),fe(!0))}),[c,Q,C,u]),b.useEffect((()=>{if(c&&F.fetchState==="Not-Started"&&h.timeframe!=="free_range"&&h.timeframe!=="week"&&u)switch(D){case"profit_and_loss":case"profit_and_loss_by_classes":s(Be(h.timeframe));break;case"profit_and_loss_by_projects":g&&s(ie());break;case"balance_sheet":s(Me(h.timeframe));break;case"balance_sheet_by_classes":T&&s(L());break;case"balance_sheet_by_projects":g&&s(E());break;case"cash_flow_by_classes":T&&s(P());break;case"cash_flow_by_projects":g&&s(A());break;case"cash_flow":s(Le(h.timeframe))}}),[c,D,F,u,T,g]);const J=Ta(),Ce=J?.loggedInUserRole!=null&&ve(J?.loggedInUserRole)!==!0,[ge,Se]=b.useState(!1),X=n=>{Se(n)},Ie=Ua(),Re=ka();return(function(n){const{isDataReady:Te}=n,{pathname:Ue}=W(),K=wa(Ue??"")==="reports",ke=Ca(Te),je=b.useMemo((()=>K?xa:void 0),[K]);ga({canFetchSuggestedQuestions:ke,pageContexts:je})})({isDataReady:C==="Completed"}),ja({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(Da,{analytics:N,onLoad:n=>n.trackPageLoaded(Fa.Event.reports)}):null,p.jsx(Va,{isAppContentDrawerOpen:ge,handleDrawerToggle:X}),p.jsx(Ga,{firstMonthOfFY:be,tenantEmailDomain:r,location:t,navigate:a,windowSize:_,classViewLayout:we,selectedReportID:D,analytics:N,filter:h,isAccountingClassesEnabled:T,isAccountingProjectsEnabled:g,isCompareModeOn:ye,hasTransactionAccess:Ce,signedInUser:i,selectedReportAndTimeframeFetchState:F,handleDrawerToggle:X,reportsResyncFetchState:he.reportsResyncFetchState,isAiCfoAccessEnabled:Re&&Ie&&!e,onAskAiCfoClick:()=>{if(me)if(m){const n=_e(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else Oa({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:f,isReportsCommentingEnabled:Z,initialOpenThreadRequest:ue})]})}const k=e=>{switch(e){case"profit_and_loss":case"profit_and_loss_by_classes":case"profit_and_loss_by_projects":return"Profit & Loss";case"balance_sheet":case"balance_sheet_by_classes":case"balance_sheet_by_projects":return"Balance Sheet";case"cash_flow":case"cash_flow_by_classes":case"cash_flow_by_projects":return"Cash Flow";default:return"Reports"}};function _s(){const e=d((s=>$(s))),{useFeatureGate:o}=de(),{isFeatureEnabled:_}=o(q.isDebitCardFeatureEnabled),m=ha(_,e),a=ya(e);return m===!0||a===!0?p.jsx(Ma,{}):p.jsxs(Pe,{children:[p.jsx(ee,{path:"/",element:p.jsx(Ya,{})}),p.jsx(ee,{path:"*",element:p.jsx(La,{})})]})}export{_s as default};
|
|
1
|
+
import{j as p}from"./liveblocks-DRsJ0YIJ.js";import{g as X,h as Fe,u as Ue,i as De,j as d,l as Ae,n as Pe,o as ee}from"./core-DGLzDXWl.js";import{fE as q,D_ as R,Uz as Ee,l_ as le,u5 as ce,uW as D,lF as Le,lO as A,lG as P,kJ as E,kA as L,kz as Ve,D8 as ie,u$ as Me,bq as Be,UA as ve,bn as xe,El as ze,UB as Ge,UC as Ye,ci as g,D1 as He,UD as ae,UE as Ne,UF as $e,UG as qe,UH as Ze,UI as Je,UJ as Qe,UK as We,UL as Ke,UM as Xe,UN as ea,UO as aa,UP as sa,UQ as k,UR as V,US as M,UT as B,UU as v,UV as x,UW as z,UX as G,UY as Y,UZ as H,eh as ta,D$ as oa,DO as se,DP as te,E5 as na,DT as oe,Eb as ra,U_ as la,U$ as ca,V0 as ia,V1 as da,V2 as pa,V3 as _a,V4 as fa,V5 as ma,V6 as ba,V7 as ua,dZ as ha,dY as ya}from"./zeni-epic-state-Dm2vDWXH.js";import{an as Ca,ao as wa,ap as Sa,a as ga,a1 as Ia,O as de,c as N,z as pe,aq as Ra,U as Ta,e as ka,ar as ja,as as Oa,a8 as Fa,k as $,T as Ua,x as Da,p as _e,at as Aa,au as Pa,av as Ea}from"./index-DGjciFPC.js";import"./mui-BuJ3P0FU.js";import La from"./NotFoundScreen-3YmbDG-O.js";import{F as Va}from"./FeaturePreviewScreen-CEOFkjIy.js";import{a as b}from"./sentry-G4ZANa8Z.js";import{u as Ma}from"./useInitialThreadRequest-Cdwnj1Ib.js";import{t as ne,a as re,b as Ba}from"./routePaths-COaM8xFB.js";import{M as va}from"./MobileAppDrawer-Q8q8ssn0.js";import"./recharts-CJlXFxhv.js";import"./analytics-CvsRIk3B.js";import"./plaid-i7y7YD6O.js";import"./dnd-SnD389s6.js";import"./stripe-cKAAJElX.js";import"./lottie-DEqUWUd5.js";import"./lexical-CMBMntF_.js";import"./pdf-B_v4zyN7.js";import"./utils-Bz8wuSWM.js";import"./InboxNotificationsProvider-Cf5DQSg3.js";import"./useTaskManagerAccess-i7vk79Wr.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]="9b2093eb-c8bf-47f9-827c-9da1836cf36c",e._sentryDebugIdIdentifier="sentry-dbid-9b2093eb-c8bf-47f9-827c-9da1836cf36c")}catch{}})();const xa=["profit_loss","balance_sheet","cash_flow"],I=e=>e==="balance_sheet"||e==="balance_sheet_by_classes"||e==="balance_sheet_by_projects",y=e=>{e(H({resetLeftScroll:!0})),e(Y({resetLeftScroll:!0})),e(G({resetLeftScroll:!0})),e(z({resetLeftScroll:!0})),e(x({resetLeftScroll:!0})),e(v({resetLeftScroll:!0})),e(V({resetLeftScroll:!0})),e(B({resetLeftScroll:!0})),e(M({resetLeftScroll:!0}))},za=e=>{e(ca()),e(ia()),e(da()),e(pa()),e(_a()),e(fa()),e(ma()),e(ba()),e(ua())},Ga=Ae((function(e){const o=pe.getSignedInUser(),_=e.tenantState.currentTenantId,m=q(e),a=m?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:_??""},t=R(e),r=ve(m);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,balanceSheetClassesViewReport:t.balanceSheetByClassReport,cashFlowClassesViewReport:t.cashFlowByClassReport,cashFlowProjectViewReport:t.cashFlowByProjectReport,balanceSheetProjectViewReport:t.balanceSheetByProjectReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:$,isZeniUser:xe(o),showAccountGroups:r===!0,isAccountingClassesEnabled:le(e),isAccountingProjectsEnabled:ce(e),currentTenantCompanyName:a,statementEndPoint:`${Ea}/statement`,authParams:s,isZeniCOAUsed:r}}),(function(e,o){const{navigate:_,handleDrawerToggle:m}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(D(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(la(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(ra(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:f,balancesRange:i}=l;let c=[...f];a==="year"&&(c=c.filter((C=>C!=="this_period_vs_same_period_last_year"&&C!=="this_period_vs_same_period_last_year_percent"&&C!=="same_period_last_year"))),e(se(o.firstMonthOfFY,r,i.numberOfPeriods<1?1:i.numberOfPeriods,c)),f.length>0&&e(te(o.firstMonthOfFY,c.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",i.numberOfPeriods<1?1:i.numberOfPeriods,c))}t!==!0&&setTimeout((()=>y(e)),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(k(a)),(I(a)||g(a))&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(oe({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(ae({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(oe(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(na(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(se(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(te(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout((()=>y(e)),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(oa({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=ta(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const f=a.accountName===""?a.accountDescription:a.accountName,i=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return ne(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return re(o.tenantEmailDomain,a.accountId,a.accountType,s.id,f,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?Ba(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,f,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?re(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],f,r,l):a.accountType!=null?ne(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l):void 0})();if(i!=null){const c=_e(o.location.state?.pathnameStackToGoBack,o.location.pathname);_(i,{state:{pathnameStackToGoBack:c,referrer:j(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(H({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(Y({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(G({scrollPosition:s}));break;case"balance_sheet":e(z({scrollPosition:s}));break;case"balance_sheet_by_classes":e(x({scrollPosition:s}));break;case"balance_sheet_by_projects":e(v({scrollPosition:s}));break;case"cash_flow_by_classes":e(B({scrollPosition:s}));break;case"cash_flow_by_projects":e(M({scrollPosition:s}));break;case"cash_flow":e(V({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(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(Y({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(G({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(z({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_classes":e(x({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_projects":e(v({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_classes":e(B({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_projects":e(M({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(V({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{_("../../")},onUpdateAccountViewMode:(a,s)=>{const t=s??o.selectedReportID,r=I(t),l=g(t);l?(e(We({viewMode:a})),e(Ke({viewMode:a}))):r?(e(Xe({viewMode:a})),e(ea({viewMode:a}))):(e(aa({viewMode:a})),e(sa({viewMode:a}))),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",j(t)),e(k(l?"cash_flow_by_classes":r?"balance_sheet_by_classes":"profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",j(t)),e(k(l?"cash_flow_by_projects":r?"balance_sheet_by_projects":"profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",j(t)),e(k(l?"cash_flow":r?"balance_sheet":"profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{g(o.selectedReportID)?e(Ze({classesToFilterOut:a})):I(o.selectedReportID)?e(Je({classesToFilterOut:a})):e(Qe({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{g(o.selectedReportID)?e(Ne({projectsToFilterOut:a})):I(o.selectedReportID)?e($e({projectsToFilterOut:a})):e(qe({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(ae({classViewLayout:a}))},onOpenAccountViewMode:()=>{const a=I(o.selectedReportID),s=g(o.selectedReportID);o.isAccountingClassesEnabled&&e(s?P():a?L():He()),o.isAccountingProjectsEnabled&&e(s?A():a?E():ie())},onUpdateDisplayOrder:a=>{e(Ye(a))},onUpdateReportFormat:a=>{za(e),e(Ge(a))},onClickMenuIcon:()=>{m(!0)},onResyncReports:()=>{const a=o.selectedReportID;e(a!=="balance_sheet_by_classes"?a!=="balance_sheet_by_projects"?a!=="cash_flow_by_classes"?a!=="cash_flow_by_projects"?ze(a==="profit_and_loss_by_projects"?"profit_and_loss_by_projects":"profit_and_loss_by_classes"):A(!0):P(!0):E(!0):L(!0))}}}))(Aa);function Ya(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=ga(),_=Ia(),m=Pa(_),a=Fe(),s=Ue(),t=X(),{tenantEmailDomain:r}=De(),{useFeatureGate:l}=de(),{isFeatureEnabled:f}=l(N.isReportsHorizontalClassLayoutSwitchEnabled),i=pe.getSignedInUser(),[c,C]=b.useState(!1),[Z,fe]=b.useState(!1),{isFeatureEnabled:J}=l(N.isReportsCommentingEnabled);if(i==null)throw Error("Can't access reports page without signing in...");const O=d((n=>q(n))),me=O.masterTOSInfo?.isMasterTOSAccepted??!1,be=O.company?.companyInfo.firstMonthOfFY??1,ue=Ma(J?O?.companyId:void 0),w=d((n=>R(n).fetchState)),he=d((n=>Ee(n))),{areTenantIdsInSync:u}=Ra(),F=d((n=>n.financeStatementState.selectedReportId)),T=d((n=>le(n))),S=d((n=>ce(n))),ye=d((n=>R(n).isCompareModeOn)),h=d((n=>R(n).filter)),U=d((n=>R(n).selectedReportAndTimeframeFetchState)),Ce=d((n=>n.profitAndLossClassesViewState.uiState.classViewLayout));b.useEffect((()=>{!c&&u&&(C(!0),s(D(i.userId,!0,!0,!1)))}),[c,i,s,u]),b.useEffect((()=>{c&&!Z&&w==="Completed"&&u&&(s(D(i.userId,!1,!0,!1)),fe(!0))}),[c,Z,w,u]),b.useEffect((()=>{if(c&&U.fetchState==="Not-Started"&&h.timeframe!=="free_range"&&h.timeframe!=="week"&&u)switch(F){case"profit_and_loss":case"profit_and_loss_by_classes":s(Me(h.timeframe));break;case"profit_and_loss_by_projects":S&&s(ie());break;case"balance_sheet":s(Ve(h.timeframe));break;case"balance_sheet_by_classes":T&&s(L());break;case"balance_sheet_by_projects":S&&s(E());break;case"cash_flow_by_classes":T&&s(P());break;case"cash_flow_by_projects":S&&s(A());break;case"cash_flow":s(Le(h.timeframe))}}),[c,F,U,u,T,S]);const Q=Ta(),we=Q?.loggedInUserRole!=null&&Be(Q?.loggedInUserRole)!==!0,[Se,ge]=b.useState(!1),W=n=>{ge(n)},Ie=ka(),Re=ja();return(function(n){const{isDataReady:Te}=n,{pathname:ke}=X(),K=Ca(ke??"")==="reports",je=wa(Te),Oe=b.useMemo((()=>K?xa:void 0),[K]);Sa({canFetchSuggestedQuestions:je,pageContexts:Oe})})({isDataReady:w==="Completed"}),Oa({isDataReady:w==="Completed"}),p.jsxs(p.Fragment,{children:[w==="Completed"?p.jsx(Fa,{analytics:$,onLoad:n=>n.trackPageLoaded(Ua.Event.reports)}):null,p.jsx(va,{isAppContentDrawerOpen:Se,handleDrawerToggle:W}),p.jsx(Ga,{firstMonthOfFY:be,tenantEmailDomain:r,location:t,navigate:a,windowSize:_,classViewLayout:Ce,selectedReportID:F,analytics:$,filter:h,isAccountingClassesEnabled:T,isAccountingProjectsEnabled:S,isCompareModeOn:ye,hasTransactionAccess:we,signedInUser:i,selectedReportAndTimeframeFetchState:U,handleDrawerToggle:W,reportsResyncFetchState:he.reportsResyncFetchState,isAiCfoAccessEnabled:Re&&Ie&&!e,onAskAiCfoClick:()=>{if(me)if(m){const n=_e(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else Da({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:f,isReportsCommentingEnabled:J,initialOpenThreadRequest:ue})]})}const j=e=>{switch(e){case"profit_and_loss":case"profit_and_loss_by_classes":case"profit_and_loss_by_projects":return"Profit & Loss";case"balance_sheet":case"balance_sheet_by_classes":case"balance_sheet_by_projects":return"Balance Sheet";case"cash_flow":case"cash_flow_by_classes":case"cash_flow_by_projects":return"Cash Flow";default:return"Reports"}};function _s(){const e=d((s=>q(s))),{useFeatureGate:o}=de(),{isFeatureEnabled:_}=o(N.isDebitCardFeatureEnabled),m=ha(_,e),a=ya(e);return m===!0||a===!0?p.jsx(Va,{}):p.jsxs(Pe,{children:[p.jsx(ee,{path:"/",element:p.jsx(Ya,{})}),p.jsx(ee,{path:"*",element:p.jsx(La,{})})]})}export{_s as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as a}from"./liveblocks-DRsJ0YIJ.js";import{z as b,a8 as E,k as u,T as N,e4 as S,O as k,c as C}from"./index-DGjciFPC.js";import"./mui-BuJ3P0FU.js";import g from"./NotFoundScreen-3YmbDG-O.js";import{a as c}from"./sentry-G4ZANa8Z.js";import{u as I,j as h,h as F,g as L,l as T,n as _,o as d,N as y}from"./core-DGLzDXWl.js";import{fE as U,a1K as j,a1L as p,DF as P,p_ as V,a1M as z,DD as G}from"./zeni-epic-state-Dm2vDWXH.js";import"./recharts-CJlXFxhv.js";import"./analytics-CvsRIk3B.js";import"./plaid-i7y7YD6O.js";import"./dnd-SnD389s6.js";import"./stripe-cKAAJElX.js";import"./lottie-DEqUWUd5.js";import"./lexical-CMBMntF_.js";import"./pdf-B_v4zyN7.js";import"./utils-Bz8wuSWM.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]="b41dea2b-6d3d-45a1-9aaf-6c4932dd8328",e._sentryDebugIdIdentifier="sentry-dbid-b41dea2b-6d3d-45a1-9aaf-6c4932dd8328")}catch{}})();const K=T((function(e,t){const n=j(e);return{inviteFormView:n.localData,submitStatus:n.saveStatus,userName:t.userName,rewardsPlan:n.rewardsPlan,companyLegalName:t.companyName}}),(function(e,t){const{navigate:n}=t,i=b.getSignedInUser();return{onDismissClick:()=>{e(p()),n("/")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach((l=>{s.push(l.companyName),r.push(l.emailIds[0])})),u.trackInviteEmailClicked("send",s,r,s.length)}e(G())},onUpdateInviteFormLocalData:s=>{e(z({localData:s}))},onSubmitSuccess:()=>{e(p())},onCancelClick:()=>{i!=null&&u.trackInviteEmailClicked("cancel")}}}))(S),M=()=>{const e=I(),[t,n]=c.useState(!1),[i,s]=c.useState(!1),r=h((o=>U(o))),l=F(),w=L(),f=b.getSignedInUser();if(f==null)throw Error("Can't access invite referral screen without signing in...");const m=h((o=>j(o))),x=f?.firstName!=null?f.firstName:"User";c.useEffect((()=>{e(p()),r?.rewardsLastViewedTime==null&&i===!1&&(e(P()),s(!0))}),[]),c.useEffect((()=>{t||m.fetchState!=="Not-Started"||(n(!0),e(V(!0)))}),[m.fetchState,e]);const D=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[m.fetchState==="Completed"?a.jsx(E,{analytics:u,onLoad:o=>(v=>v.trackPageLoaded(N.Event.inviteEmailViewed))(o)}):null,a.jsx(K,{navigate:l,location:w,currentTenant:r,companyName:D,userName:x,inviteFormCompayData:m.localData})]})};function ne(){const{useFeatureGate:e}=k(),{isFeatureEnabled:t}=e(C.isReferralFeatureEnabled);return a.jsxs(_,{children:[a.jsx(d,{path:"/",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(d,{path:"how-it-works",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(d,{path:"refer/*",element:t?a.jsx(M,{}):a.jsx(g,{})}),a.jsx(d,{path:"*",element:a.jsx(g,{})})]})}export{ne as default};
|