@zeniai/web-app-ui 5.3.63-dev → 5.3.64-qa
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AccountMappingScreen-BRZHYOUR.js → AccountMappingScreen-DivKdf2Z.js} +2 -2
- package/dist/assets/{ActualMatchingMatchDetailScreen-CT_TfQgQ.js → ActualMatchingMatchDetailScreen-BVGeVheO.js} +1 -1
- package/dist/assets/AddressRoutes-BokWmAg8.js +1 -0
- package/dist/assets/{AddressScreen-CrINuapd.js → AddressScreen-rwxaZTG1.js} +2 -2
- package/dist/assets/{AiCfoScreen-BXw0LDjo.js → AiCfoScreen-bINGDW9e.js} +1 -1
- package/dist/assets/{AppDrawer-DZIMVdFc.js → AppDrawer-Dp7qEJuM.js} +1 -1
- package/dist/assets/{BillPayApprovalRoutes-Dp_PkbIk.js → BillPayApprovalRoutes-B_lv7T-J.js} +1 -1
- package/dist/assets/{BillPayRoutes-CUUjBefv.js → BillPayRoutes-0Sw-GQIA.js} +1 -1
- package/dist/assets/{BusinessVerificationPageScreen-DFamYzxa.js → BusinessVerificationPageScreen-D3HFVVs1.js} +2 -2
- package/dist/assets/CardsAiCfoScreen-oXR70NHe.js +14 -0
- package/dist/assets/{ChargeCardRoutes-DzIBuJeY.js → ChargeCardRoutes-GPeivNsL.js} +1 -1
- package/dist/assets/CompanyPassportScreen-BQIdqUeH.js +1 -0
- package/dist/assets/ConnectionAuthScreen-B6OliLVm.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-CBVP8bsG.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-CjmJGGJm.js → CustomerOnboardingRoutes-C0r1dw1S.js} +3 -3
- package/dist/assets/{DashboardRoutes-ByHBLKcB.js → DashboardRoutes-DiVKBsiD.js} +4 -4
- package/dist/assets/{DefaultTenantHome-Dm9FOXup.js → DefaultTenantHome-BrlnSikW.js} +1 -1
- package/dist/assets/{DomesticWireDetailScreen-086WQWRB.js → DomesticWireDetailScreen-sF9fArJp.js} +3 -3
- package/dist/assets/{DrawerScreen-B5BqRZEJ.js → DrawerScreen-_LTFqCkp.js} +1 -1
- package/dist/assets/{EntityDetailRoutes-BuN3sXNp.js → EntityDetailRoutes-4B2Yzc2k.js} +1 -1
- package/dist/assets/{ExpenseAutomationRoutes-Ce3IicTe.js → ExpenseAutomationRoutes-BO6oNRaR.js} +7 -7
- package/dist/assets/FeaturePreviewScreen--_B7whPE.js +1 -0
- package/dist/assets/{HubSpotOAuthCallbackScreen-BRUwb2B6.js → HubSpotOAuthCallbackScreen-DYtx9CHZ.js} +1 -1
- package/dist/assets/{InboxNotificationsProvider-x0fdv66l.js → InboxNotificationsProvider-CYNlrTK-.js} +1 -1
- package/dist/assets/InvoicingRoutes-B76qsOVo.js +2 -0
- package/dist/assets/{MagicLinkRoutes-C5BKMtwW.js → MagicLinkRoutes-BLMLAWL4.js} +8 -8
- package/dist/assets/{MagicLinkSignInScreen-9LYlxmop.js → MagicLinkSignInScreen-ul8q5KIh.js} +1 -1
- package/dist/assets/{MobileAppDrawer-DX2JnkbM.js → MobileAppDrawer-B_iTAp0X.js} +1 -1
- package/dist/assets/NotFoundScreen-ytl2lDpJ.js +1 -0
- package/dist/assets/{NotificationRoutes-DICT3yoM.js → NotificationRoutes-CHchBCXf.js} +1 -1
- package/dist/assets/{OAuthConsentScreen-BmiLDdxn.js → OAuthConsentScreen-ByZnDGsv.js} +1 -1
- package/dist/assets/{PandLWithForecastRoutes-DAq9XRB1.js → PandLWithForecastRoutes-CEbI4eNj.js} +1 -1
- package/dist/assets/{PaymentLinkScreen-Cz1wlNqO.js → PaymentLinkScreen-Bp_f7EM0.js} +9 -9
- package/dist/assets/{PeopleRoutes-DgYtveDU.js → PeopleRoutes-Bnjxv-wy.js} +5 -5
- package/dist/assets/{PerformanceRoutes-B6iTINLg.js → PerformanceRoutes-D_c4D-Lq.js} +1 -1
- package/dist/assets/{Preview-Dz6yJNce.js → Preview-Cqz8sG2s.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-D8eeXRWb.js → QBOConnectionScreen-TwPTSdM4.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRoutes-CE6y6IwA.js → ReimbursementApprovalRoutes-WuV-IA60.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-BT_O_PEv.js → ReimbursementApprovalRuleDetailScreen-NNjpXxDw.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-BmOT-3C-.js → ReimbursementRoutes-VHBLpzUI.js} +4 -4
- package/dist/assets/{ReportsRoutes-CqUKv9Uh.js → ReportsRoutes-LNVh_-sv.js} +1 -1
- package/dist/assets/RewardsRoutes-CoqgpEpv.js +1 -0
- package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-CLEogplJ.js → ScheduleDetailsPrepaidExpensesScreen-BtoKhMiB.js} +5 -5
- package/dist/assets/{ScreenRoutes-xDjhbdP1.js → ScreenRoutes-59q3MUGL.js} +2 -2
- package/dist/assets/{SettingsRoutes-QcMcR-j3.js → SettingsRoutes-C4j0IBI2.js} +4 -4
- package/dist/assets/{SetupPagesScreen-fuvb0IYd.js → SetupPagesScreen-7E5X1hE5.js} +5 -5
- package/dist/assets/SignInScreen-CEUScjMX.js +1 -0
- package/dist/assets/SignOutScreen-BIBuRC_E.js +9 -0
- package/dist/assets/{TaskListScreen-C2urPjKT.js → TaskListScreen-lzy6FFpY.js} +2 -2
- package/dist/assets/{TaskRoutes-BuzkCbPW.js → TaskRoutes-DiG1t9-7.js} +2 -2
- package/dist/assets/TransactionDetailRoutes-B0iRCFEi.js +1 -0
- package/dist/assets/{TransactionDetailScreen-CQr1YyP0.js → TransactionDetailScreen-CeJRenTr.js} +2 -2
- package/dist/assets/{TransactionListRoutes-BTidVr9Z.js → TransactionListRoutes-YHpSLzO6.js} +1 -1
- package/dist/assets/{TreasuryRoutes-CbD79DO8.js → TreasuryRoutes-BjSaj-AP.js} +5 -5
- package/dist/assets/{VendorsRoutes-CCYu89Uf.js → VendorsRoutes-CeQ2Hysa.js} +1 -1
- package/dist/assets/{WiseConfirmationScreen-B0HeU8Sh.js → WiseConfirmationScreen-DgytZSXe.js} +1 -1
- package/dist/assets/{ZeniAccountRoutes-CoRmS3Mc.js → ZeniAccountRoutes-wpK9n9Q7.js} +9 -9
- package/dist/assets/{ZeniAccountStatementScreen-BnpFJ5jB.js → ZeniAccountStatementScreen-DbrLHVIs.js} +1 -1
- package/dist/assets/{accountMappingHelper-tmyjt9rr.js → accountMappingHelper-Gh8rpbjD.js} +1 -1
- package/dist/assets/analytics-S5MhEivL.js +68 -0
- package/dist/assets/{analyticsHelper-BEL0ra9X.js → analyticsHelper-vbAuZJHT.js} +1 -1
- package/dist/assets/{core-CHD8T-IM.js → core-Cc7wW2EM.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-p_nrn8Pg.js → decodeURIComponentSafe-DhqIXi_U.js} +1 -1
- package/dist/assets/{dnd-Dwi6R-ey.js → dnd-DEyyKSEC.js} +1 -1
- package/dist/assets/{empty-CeRjDJvl.js → empty-6MFM8UPN.js} +1 -1
- package/dist/assets/{empty-CZC5CrVC.js → empty-CjY9w6q2.js} +1 -1
- package/dist/assets/{emptyVideoElement-BQ5qxpg6.js → emptyVideoElement-MGXFhhLz.js} +1 -1
- package/dist/assets/{epic-BW8jUHg5.js → epic-D9Y6xcsI.js} +1 -1
- package/dist/assets/{expenseAutomationHelper-kGR6VZFG.js → expenseAutomationHelper-iXuIUZiF.js} +1 -1
- package/dist/assets/{getLocaleForTenant-D-or0iZO.js → getLocaleForTenant-rFLZBDSf.js} +1 -1
- package/dist/assets/{index-BVHBHjSe.js → index-2QCkbhu2.js} +1 -1
- package/dist/assets/{index-BMy5YH8G.js → index-BZ6qOKkD.js} +1 -1
- package/dist/assets/{index-DKH4PK2B.js → index-CFXYM6OK.js} +4561 -4561
- package/dist/assets/{index-yiW1aZfy.js → index-Cm43WhAF.js} +2 -2
- package/dist/assets/{index-CKiMoeFX.js → index-D2oCZR3F.js} +1 -1
- package/dist/assets/{index-XRUedCJ0.js → index-DpnxiqBj.js} +1 -1
- package/dist/assets/{index-C1KaIuMT.js → index-gtGWrJ79.js} +1 -1
- package/dist/assets/{index-w09kaOHP.js → index-ldlm2cjp.js} +1 -1
- package/dist/assets/{lexical-CMNdypK6.js → lexical-DXgKWO29.js} +1 -1
- package/dist/assets/{liveblocks-e6rGc1UF.js → liveblocks-CgHUgeBY.js} +1 -1
- package/dist/assets/{lottie-B778bt56.js → lottie-C1A2hiZE.js} +1 -1
- package/dist/assets/{mui-NTaF3UaY.js → mui-C4zFSCiU.js} +1 -1
- package/dist/assets/{pathToGoBack-3T3qt1CN.js → pathToGoBack-C17GqrA7.js} +1 -1
- package/dist/assets/{pdf-lib-CSbJ_JNk.js → pdf-lib-CsM74zBq.js} +1 -1
- package/dist/assets/{pdf-Bx92ZlM_.js → pdf-rXyPRm1U.js} +3 -3
- package/dist/assets/{plaid-DdTo7m1-.js → plaid-vsHcqLdj.js} +1 -1
- package/dist/assets/{pusher-TnSBrmnt.js → pusher-C0EhdUPA.js} +1 -1
- package/dist/assets/{react-BRi8TcMI.js → react-BU_8yW5D.js} +1 -1
- package/dist/assets/{react-Ci1ltUcy.js → react-CEepHjWP.js} +1 -1
- package/dist/assets/{react-Ba46BK4D.js → react-CzfY0Vx3.js} +1 -1
- package/dist/assets/{react-DJOUavGZ.js → react-DG8YneWb.js} +1 -1
- package/dist/assets/{react-B75Gnqob.js → react-Gc0eJCMR.js} +1 -1
- package/dist/assets/{react-COkaiBQo.js → react-Yy9ZuxR6.js} +1 -1
- package/dist/assets/{recharts-C6xUtcdL.js → recharts-DJGeJ2v_.js} +1 -1
- package/dist/assets/{routePaths-CGyE-cU7.js → routePaths-BvBrBOWH.js} +1 -1
- package/dist/assets/{sentry-DsyKtMW2.js → sentry-DSWD_gIh.js} +1 -1
- package/dist/assets/{stripSplatSuffix-CKrdD9MQ.js → stripSplatSuffix-kLnY55Qt.js} +1 -1
- package/dist/assets/{url-Zl9uXQ4e.js → url-DCbpXgdk.js} +1 -1
- package/dist/assets/{url-ClJewK9Y.js → url-DUlo21cY.js} +1 -1
- package/dist/assets/{useActualMatchingMatchDetail-Cc17Q5Tv.js → useActualMatchingMatchDetail-CF9oxT8n.js} +1 -1
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-CHbHmZzx.js → useAiCfoDashboardSuggestedQuestionsChips-CDkZMoxt.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-QQl24-IT.js +1 -0
- package/dist/assets/{useChargeCardPusherEvents-BWi4_PP5.js → useChargeCardPusherEvents-CXbFOxvL.js} +1 -1
- package/dist/assets/{useDeviceId-VsdzmSZI.js → useDeviceId-B5zol9VP.js} +1 -1
- package/dist/assets/{useEmailConnectResultRefresh-ClXdZp-6.js → useEmailConnectResultRefresh-Dd25HleM.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-DDr_z_RH.js → useInitialThreadRequest-DIgkNFzN.js} +1 -1
- package/dist/assets/{useTaskManagerAccess-CUv6a62x.js → useTaskManagerAccess-P-CWGdcX.js} +1 -1
- package/dist/assets/{useTaskManagerPusherEvents-DCIopLVZ.js → useTaskManagerPusherEvents-BREP8CYU.js} +1 -1
- package/dist/assets/{utils-CCA3F0sZ.js → utils-DiIEQ7_h.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-B_xgLNm6.js → withTransactionSidePanel-CF9KOU3s.js} +4 -4
- package/dist/assets/{zeni-epic-state-BO3zdDfL.js → zeni-epic-state-BVJjEVAA.js} +3 -3
- package/dist/index.html +1 -1
- package/package.json +3 -3
- package/dist/assets/AddressRoutes-CisWqyoC.js +0 -1
- package/dist/assets/CardsAiCfoScreen-Cx5KkOYw.js +0 -14
- package/dist/assets/CompanyPassportScreen-CENbDnLW.js +0 -1
- package/dist/assets/ConnectionAuthScreen-DTyZxcME.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-zLmHJyqv.js +0 -1
- package/dist/assets/FeaturePreviewScreen-D54Nwanb.js +0 -1
- package/dist/assets/InvoicingRoutes-IQsFojD0.js +0 -2
- package/dist/assets/NotFoundScreen-CtgFRYZy.js +0 -1
- package/dist/assets/RewardsRoutes-D5CR9NnI.js +0 -1
- package/dist/assets/SignInScreen-ekGlkjLH.js +0 -1
- package/dist/assets/SignOutScreen-9NJIr2hr.js +0 -9
- package/dist/assets/TransactionDetailRoutes-D99Yv6kv.js +0 -1
- package/dist/assets/analytics-C3e3An3a.js +0 -68
- package/dist/assets/useAskAiCfoHostNavButtonProps-BcCbRGDK.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-e6rGc1UF.js";import{u as ne,j as k,h as X,g as K,i as se,N as P,l as Q,q as lt,n as mt,o as E}from"./core-CHD8T-IM.js";import{fF as V,NG as ct,_U as be,c8 as ge,MM as Ue,ma as dt,M$ as me,M_ as ce,_V as ut,bn as he,gV as $e,_W as pt,WT as bt,l$ as Fe,WU as Ae,WV as gt,kN as ht,YX as ft,l0 as St,MA as It,Cd as yt,kU as Rt,Nl as Le,_X as Me,_Y as ke,_Z as vt,__ as At,_$ as kt,N5 as Ce,l6 as Ct,Z4 as wt,MZ as Et,MK as xt,$0 as Bt,MJ as Tt,$1 as Dt,MR as we,N9 as jt,N8 as Ut,N4 as $t,$2 as _e,Sj as Ft,bo as Lt,MU as Mt,ND as _t,$3 as Pt,$4 as Nt,Nh as Ot,Ne as Ee,Yr as Zt,MH as Gt,$5 as Pe,O4 as xe,Oc as zt,$6 as Vt,$7 as Y,$8 as Wt,$9 as Ne,$a as Ht,$b as Oe,$c as Ze,Nt as de,bu as qt,bK as fe,cM as Se,d_ as Ge,dZ as ze,$d as Yt,gh as Jt,YE as Kt,$e as Xt,$f as Ve,YI as Qt,Zq as en,$g as tn,ZP as nn,O9 as Be,O8 as an,$h as sn,$i as on,$j as rn,$k as ln,$l as mn,Za as cn,N$ as dn,O3 as un,bq as pn,bJ as bn,cG as gn,cu as hn,bt as fn,Ui as Sn,da as In,dd as yn,dc as Rn,cF as vn}from"./zeni-epic-state-BO3zdDfL.js";import{bU as An,F as We,a2 as He,N as ie,f as j,z as F,cT as qe,a9 as oe,k as C,aT as Te,J as D,af as ae,ag as kn,G as Ye,cU as Cn,p as J,at as Je,cV as wn,W as re,cW as En,ar as xn,ac as Bn,a8 as Ie,U as Ke,w as Tn,bC as Dn,aw as jn,aj as Un,E as Xe,cX as $n,g as Fn}from"./index-DKH4PK2B.js";import{n as N,S as Ln}from"./mui-NTaF3UaY.js";import ue from"./NotFoundScreen-CtgFRYZy.js";import{S as De}from"./SetupPagesScreen-fuvb0IYd.js";import{F as Qe}from"./FeaturePreviewScreen-D54Nwanb.js";import{a as f}from"./sentry-DsyKtMW2.js";import{u as ye}from"./useAskAiCfoHostNavButtonProps-BcCbRGDK.js";import{u as et}from"./useInitialThreadRequest-DDr_z_RH.js";import{D as Mn}from"./DrawerScreen-B5BqRZEJ.js";import{M as tt}from"./MobileAppDrawer-DX2JnkbM.js";import{F as _n}from"./ScreenRoutes-xDjhbdP1.js";import{R as Pn}from"./ReimbursementApprovalRoutes-CE6y6IwA.js";import"./recharts-C6xUtcdL.js";import"./analytics-C3e3An3a.js";import"./plaid-DdTo7m1-.js";import"./dnd-Dwi6R-ey.js";import"./stripe-cKAAJElX.js";import"./lottie-B778bt56.js";import"./lexical-CMNdypK6.js";import"./pdf-Bx92ZlM_.js";import"./utils-CCA3F0sZ.js";import"./BusinessVerificationPageScreen-DFamYzxa.js";import"./routePaths-CGyE-cU7.js";import"./analyticsHelper-BEL0ra9X.js";import"./InboxNotificationsProvider-x0fdv66l.js";import"./useTaskManagerAccess-CUv6a62x.js";import"./getLocaleForTenant-D-or0iZO.js";import"./ReimbursementApprovalRuleDetailScreen-BT_O_PEv.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]="ef2dc073-3297-4707-98b1-5bf46a89cf84",e._sentryDebugIdIdentifier="sentry-dbid-ef2dc073-3297-4707-98b1-5bf46a89cf84")}catch{}})();const nt=e=>`/${e}/reimbursements`,Nn=e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{common:q,spendManagement:{reimbursement:{reimbursementDetail:te}}}=Ye.getLocalizedStrings(),On=Q((function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),c=F.getSignedInUser(),d=he(c),m=r.plaidConnectionDetails,o=$e(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:a??""},l=be(e,t.reimbursementId),b=pt(e,c?.userId??"");let y=`${c?.firstName} ${c?.lastName}`,u=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,u=c?.userId===l.createdBy?.userId);const x=e.entityAutoCompleteState?.autoCompleteText?.common,I=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${ae.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:x,entityAutoCompleteView:I},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:y,isUserAdmin:ge(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:u,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:Fe(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:c,navigate:d,themeState:m}=t,{tenantEmailDomain:o}=r,a=F.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(ce(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(we(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e($t(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Ut())},clearRemiSaveStatus:()=>{e(jt("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(we(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Dt({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(Tt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(Bt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(xt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Et({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Ce(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(wt({data:l}))},onFetchBankName:i=>{e(Ct(i))},submitRemiDetails:()=>{e(Ce("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(ke({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(me({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(kt({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(At({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(vt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Me()),e(ke({}));const i=nt(o),l=J(c.state?.pathnameStackToGoBack,c.pathname);d(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(C.trackReimbursementDeleteReimbursement(n),e(Le(n)))},onSaveBankAccount:()=>{a?.userId&&e(Rt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(yt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(It(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(St(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(gt({searchString:i,entityType:l,searchOrigin:"common"})):e(Ae("common"))},onCancelAutoComplete:()=>{e(Ae("common"))}}}}))(Cn);function je(){const e=X(),t=ne(),n=K(),{reimbursementId:r}=se(),c=We(),d=He(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=ie(),{isFeatureEnabled:b}=l(j.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(j.isShowDeletedReimbursementsFeatureEnabled),{isAiCfoAccessEnabled:u,onAskAiCfoClick:x}=ye({mobileExploreReferrer:"Reimbursement Details"}),I=K().pathname,B=I.includes("edit"),T=I.includes("reimbursement/new"),[R,w]=f.useState(!1),h=F.getSignedInUser(),v=k((p=>V(p))),g=k((p=>be(p,r))),L=et(v?.companyId,{clearParams:g.fetchState==="Completed"}),U=ge(v?.userRole??[]);(function(){const p=ne(),M=k((_=>V(_))),O=M?.tenantId,{isApprovalRulesV3Enabled:W,isLoading:Z}=An(O),H=k((_=>_.remiSetupApproverViewState.fetchState));f.useEffect((()=>{O==null||Z||H==="Not-Started"&&p(ct(!0,!1,!1,W))}),[O,Z,W,H,p])})(),f.useEffect((()=>{(T&&!R||B&&!R&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(w(!0),t(Ue(!1,b,y,r)))}));const $=k((p=>dt(p.accountState,p.accountListState,"reimbursementAccountList")));if(h==null)throw Error("Can't access address page without signing in...");const A={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||U&&g.billStatus==="rejected"||U===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(P,{to:A}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(qe,{isNewReimbursement:r==null}):s.jsxs(Zn,{windowSize:d,children:[s.jsx(oe,{analytics:C,onLoad:p=>(M=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&M.trackReimbursementEditReimbursement(r)})(p)}),m&&d!=="small"?s.jsx(Gn,{}):null,m&&d!=="small"?s.jsx(zn,{children:s.jsx(Te,{showAutofill:m,uploadInvoiceEndPoint:`${ae.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:v?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ce(p,a,!0,r,h?.userId))},updateInvoiceUploadFetchState:p=>{t(me({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:D.sp3,paddingBottom:"15px",paddingLeft:D.sp5},dropFilePlaceholder:{upload:q.upload,single:te.dropReceipt.single,or:q.texts.or,multiple:te.dropReceipt.multiple,receipts:q.texts.receipts2}})}):null,m&&d==="small"?s.jsxs(Vn,{children:[s.jsx(Wn,{onClick:()=>o(!1),children:s.jsx(Nn,{})}),s.jsx(Te,{showAutofill:m,uploadInvoiceEndPoint:`${ae.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:v?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ce(p,a,!0,r,h?.userId))},updateInvoiceUploadFetchState:p=>{t(me({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:D.sp5,paddingRight:D.sp3,paddingBottom:D.sp5,paddingLeft:D.sp3},dropFilePlaceholder:{upload:q.upload,single:te.dropReceipt.single,or:q.texts.or,multiple:te.dropReceipt.multiple,receipts:q.texts.receipts2}})]}):null,s.jsx(Hn,{windowSize:d,children:s.jsx(On,{initialOpenThreadRequest:L??void 0,location:n,navigate:e,currentTenant:v,reimbursementId:r,themeState:c,uncategorizedAccounts:$,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:u,onAskAiCfoClick:x})})]})}const Zn=N.div`
|
|
1
|
+
import{j as s}from"./liveblocks-CgHUgeBY.js";import{u as ne,j as k,h as X,g as J,i as se,N as P,l as Q,q as lt,n as mt,o as E}from"./core-Cc7wW2EM.js";import{fF as V,NG as ct,_U as be,c8 as ge,MM as Ue,ma as dt,M$ as me,M_ as ce,_V as ut,bn as he,gV as $e,_W as pt,WT as bt,l$ as Fe,WU as Ae,WV as gt,kN as ht,YX as ft,l0 as St,MA as It,Cd as yt,kU as Rt,Nl as Le,_X as Me,_Y as ke,_Z as vt,__ as At,_$ as kt,N5 as Ce,l6 as Ct,Z4 as wt,MZ as Et,MK as xt,$0 as Bt,MJ as Tt,$1 as Dt,MR as we,N9 as jt,N8 as Ut,N4 as $t,$2 as _e,Sj as Ft,bo as Lt,MU as Mt,ND as _t,$3 as Pt,$4 as Nt,Nh as Ot,Ne as Ee,Yr as Zt,MH as Gt,$5 as Pe,O4 as xe,Oc as zt,$6 as Vt,$7 as Y,$8 as Wt,$9 as Ne,$a as Ht,$b as Oe,$c as Ze,Nt as de,bu as qt,bK as fe,cM as Se,d_ as Ge,dZ as ze,$d as Yt,gh as Kt,YE as Jt,$e as Xt,$f as Ve,YI as Qt,Zq as en,$g as tn,ZP as nn,O9 as Be,O8 as an,$h as sn,$i as on,$j as rn,$k as ln,$l as mn,Za as cn,N$ as dn,O3 as un,bq as pn,bJ as bn,cG as gn,cu as hn,bt as fn,Ui as Sn,da as In,dd as yn,dc as Rn,cF as vn}from"./zeni-epic-state-BVJjEVAA.js";import{bU as An,F as We,a2 as He,N as ie,f as j,z as F,cT as qe,a9 as oe,j as C,aT as Te,K as D,af as ae,ag as kn,G as Ye,cU as Cn,p as K,at as Ke,cV as wn,P as re,cW as En,ar as xn,ac as Bn,a8 as Ie,U as Je,w as Tn,bC as Dn,aw as jn,aj as Un,E as Xe,cX as $n,g as Fn}from"./index-CFXYM6OK.js";import{n as N,S as Ln}from"./mui-C4zFSCiU.js";import ue from"./NotFoundScreen-ytl2lDpJ.js";import{S as De}from"./SetupPagesScreen-7E5X1hE5.js";import{F as Qe}from"./FeaturePreviewScreen--_B7whPE.js";import{a as f}from"./sentry-DSWD_gIh.js";import{u as ye}from"./useAskAiCfoHostNavButtonProps-QQl24-IT.js";import{u as et}from"./useInitialThreadRequest-DIgkNFzN.js";import{D as Mn}from"./DrawerScreen-_LTFqCkp.js";import{M as tt}from"./MobileAppDrawer-B_iTAp0X.js";import{F as _n}from"./ScreenRoutes-59q3MUGL.js";import{R as Pn}from"./ReimbursementApprovalRoutes-WuV-IA60.js";import"./recharts-DJGeJ2v_.js";import"./analytics-S5MhEivL.js";import"./plaid-vsHcqLdj.js";import"./dnd-DEyyKSEC.js";import"./stripe-cKAAJElX.js";import"./lottie-C1A2hiZE.js";import"./lexical-DXgKWO29.js";import"./pdf-rXyPRm1U.js";import"./utils-DiIEQ7_h.js";import"./BusinessVerificationPageScreen-D3HFVVs1.js";import"./routePaths-BvBrBOWH.js";import"./analyticsHelper-vbAuZJHT.js";import"./InboxNotificationsProvider-CYNlrTK-.js";import"./useTaskManagerAccess-P-CWGdcX.js";import"./getLocaleForTenant-rFLZBDSf.js";import"./ReimbursementApprovalRuleDetailScreen-NNjpXxDw.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]="699e2401-6784-4ef3-8a9b-624c61b739a8",e._sentryDebugIdIdentifier="sentry-dbid-699e2401-6784-4ef3-8a9b-624c61b739a8")}catch{}})();const nt=e=>`/${e}/reimbursements`,Nn=e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{common:q,spendManagement:{reimbursement:{reimbursementDetail:te}}}=Ye.getLocalizedStrings(),On=Q((function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),c=F.getSignedInUser(),d=he(c),m=r.plaidConnectionDetails,o=$e(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:a??""},l=be(e,t.reimbursementId),b=pt(e,c?.userId??"");let y=`${c?.firstName} ${c?.lastName}`,u=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,u=c?.userId===l.createdBy?.userId);const x=e.entityAutoCompleteState?.autoCompleteText?.common,I=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${ae.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:x,entityAutoCompleteView:I},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:y,isUserAdmin:ge(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:u,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:Fe(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:c,navigate:d,themeState:m}=t,{tenantEmailDomain:o}=r,a=F.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(ce(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(we(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e($t(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Ut())},clearRemiSaveStatus:()=>{e(jt("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(we(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Dt({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(Tt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(Bt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(xt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Et({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Ce(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(wt({data:l}))},onFetchBankName:i=>{e(Ct(i))},submitRemiDetails:()=>{e(Ce("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(ke({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(me({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(kt({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(At({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(vt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e(Me()),e(ke({}));const i=nt(o),l=K(c.state?.pathnameStackToGoBack,c.pathname);d(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(C.trackReimbursementDeleteReimbursement(n),e(Le(n)))},onSaveBankAccount:()=>{a?.userId&&e(Rt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(yt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(It(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(St(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(gt({searchString:i,entityType:l,searchOrigin:"common"})):e(Ae("common"))},onCancelAutoComplete:()=>{e(Ae("common"))}}}}))(Cn);function je(){const e=X(),t=ne(),n=J(),{reimbursementId:r}=se(),c=We(),d=He(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=ie(),{isFeatureEnabled:b}=l(j.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(j.isShowDeletedReimbursementsFeatureEnabled),{isAiCfoAccessEnabled:u,onAskAiCfoClick:x}=ye({mobileExploreReferrer:"Reimbursement Details"}),I=J().pathname,B=I.includes("edit"),T=I.includes("reimbursement/new"),[R,w]=f.useState(!1),h=F.getSignedInUser(),v=k((p=>V(p))),g=k((p=>be(p,r))),L=et(v?.companyId,{clearParams:g.fetchState==="Completed"}),U=ge(v?.userRole??[]);(function(){const p=ne(),M=k((_=>V(_))),O=M?.tenantId,{isApprovalRulesV3Enabled:W,isLoading:Z}=An(O),H=k((_=>_.remiSetupApproverViewState.fetchState));f.useEffect((()=>{O==null||Z||H==="Not-Started"&&p(ct(!0,!1,!1,W))}),[O,Z,W,H,p])})(),f.useEffect((()=>{(T&&!R||B&&!R&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(w(!0),t(Ue(!1,b,y,r)))}));const $=k((p=>dt(p.accountState,p.accountListState,"reimbursementAccountList")));if(h==null)throw Error("Can't access address page without signing in...");const A={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||U&&g.billStatus==="rejected"||U===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(P,{to:A}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(qe,{isNewReimbursement:r==null}):s.jsxs(Zn,{windowSize:d,children:[s.jsx(oe,{analytics:C,onLoad:p=>(M=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&M.trackReimbursementEditReimbursement(r)})(p)}),m&&d!=="small"?s.jsx(Gn,{}):null,m&&d!=="small"?s.jsx(zn,{children:s.jsx(Te,{showAutofill:m,uploadInvoiceEndPoint:`${ae.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:v?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ce(p,a,!0,r,h?.userId))},updateInvoiceUploadFetchState:p=>{t(me({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:D.sp3,paddingBottom:"15px",paddingLeft:D.sp5},dropFilePlaceholder:{upload:q.upload,single:te.dropReceipt.single,or:q.texts.or,multiple:te.dropReceipt.multiple,receipts:q.texts.receipts2}})}):null,m&&d==="small"?s.jsxs(Vn,{children:[s.jsx(Wn,{onClick:()=>o(!1),children:s.jsx(Nn,{})}),s.jsx(Te,{showAutofill:m,uploadInvoiceEndPoint:`${ae.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:h?.userId??"",sessionId:h?.zeniSessionId??"",tenantId:v?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ce(p,a,!0,r,h?.userId))},updateInvoiceUploadFetchState:p=>{t(me({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:D.sp5,paddingRight:D.sp3,paddingBottom:D.sp5,paddingLeft:D.sp3},dropFilePlaceholder:{upload:q.upload,single:te.dropReceipt.single,or:q.texts.or,multiple:te.dropReceipt.multiple,receipts:q.texts.receipts2}})]}):null,s.jsx(Hn,{windowSize:d,children:s.jsx(On,{initialOpenThreadRequest:L??void 0,location:n,navigate:e,currentTenant:v,reimbursementId:r,themeState:c,uncategorizedAccounts:$,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:u,onAskAiCfoClick:x})})]})}const Zn=N.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
position: relative;
|
|
4
4
|
height: 100vh;
|
|
@@ -53,7 +53,7 @@ import{j as s}from"./liveblocks-e6rGc1UF.js";import{u as ne,j as k,h as X,g as K
|
|
|
53
53
|
flex-direction: column;
|
|
54
54
|
width: 100%;
|
|
55
55
|
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
56
|
-
`,qn=Q((function(e,t){const n=_e(e,t.reimbursementId),r=F.getSignedInUser(),c=he(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=Pt(n.remiActivities,Nt(t.currentTenant),r));const i=ge(t.currentTenant?.userRole??[]),l=r?.userId===n.createdBy?.userId;return{remiDetails:n,uploadInvoiceEndPoint:`${ae.communicationAgentMicroServiceBaseUrl}`,authParams:m,signedInUser:r,createdBy:o,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,isAdmin:i,showApproveRejectBtns:a,isZeniUser:c,isSignedInUserReimbursementCreator:l,isAccountingClassesEnabled:Fe(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(Me());const a=nt(o),i=
|
|
56
|
+
`,qn=Q((function(e,t){const n=_e(e,t.reimbursementId),r=F.getSignedInUser(),c=he(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=Pt(n.remiActivities,Nt(t.currentTenant),r));const i=ge(t.currentTenant?.userRole??[]),l=r?.userId===n.createdBy?.userId;return{remiDetails:n,uploadInvoiceEndPoint:`${ae.communicationAgentMicroServiceBaseUrl}`,authParams:m,signedInUser:r,createdBy:o,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,isAdmin:i,showApproveRejectBtns:a,isZeniUser:c,isSignedInUserReimbursementCreator:l,isAccountingClassesEnabled:Fe(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(Me());const a=nt(o),i=K(c.state?.pathnameStackToGoBack,c.pathname);d(a,{state:{pathnameStackToGoBack:i}})},onSaveRealTimeApprovals:a=>{e(Gt(n,"reimbursement",a))},updateEditRealTimeApproverClicked:a=>{e(Zt({isEdit:a,entityId:n,entityType:"reimbursement"}))},approveOrRejectRemi:a=>{a.type==="approved"?e(Ee(n,a.type,"")):e(Ee(n,a.type,a.description??""))},redirectToEditableReimbursementScreen:()=>{const a=K(c.state?.pathnameStackToGoBack,c.pathname);d("./edit",{state:{pathnameStackToGoBack:a}})},deleteReimbursement:()=>{C.trackReimbursementDeleteReimbursement(n),e(Le(n))},cancelAndDeleteReport:a=>{a===!0?C.trackReimbursementCancelAndDeleteReimbursement(n):C.trackReimbursementCancelReimbursement(n),e(Ot(n,a))},handleZeniLogoClick:()=>{m.toggle()}}}))(wn);function Yn(){const e=X(),t=ne(),n=J(),r=n.hash.substring(1),c=We(),{reimbursementId:d}=se(),m=F.getSignedInUser(),o=k((A=>V(A))),a=k((A=>_e(A,d??""))),i=a.remiDetails?.reimbursementInfo.stage.code==="draft",l=et(o?.companyId,{clearParams:a.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:b,onAskAiCfoClick:y}=ye({mobileExploreReferrer:"Reimbursement Details"});Ke({isDataReady:a.fetchState==="Completed"});const{useFeatureGate:u}=ie(),{isFeatureEnabled:x}=u(j.isLimitedCategoryForReimbursement),[I,B]=f.useState(!1),[T,R]=f.useState(!1),[w,h]=f.useState(!1),{isFeatureEnabled:v}=u(j.isShowDeletedReimbursementsFeatureEnabled),g=k((A=>be(A,d??""))),L=Ft(o),U=Lt(o.userRole),$=a.fetchState;if(f.useEffect((()=>{I||d==null?I==1&&$==="Error"&&e("page-not-found",{replace:!0}):(B(!0),t(Mt(d,!1,v)))}),[I,d,t,$]),f.useEffect((()=>{v&&a.remiDetails?.isDeleted===!0||o.isZeni===!0&&m?.userEmailDomain==="zeni.ai"&&L===!1?h(!1):h(a.remiActivities[0]?.isRealTimeApprovalEnabled&&(U||a.allApprovers.find((A=>A.user.userId===m?.userId))!=null||a.remiDetails?.lastUpdatedBy===m?.userId))}),[a.remiActivities[0]?.isRealTimeApprovalEnabled,a.allApprovers,a.remiDetails?.lastUpdatedBy,U,o.isZeni,L,m]),f.useEffect((()=>{T||a.fetchState!="Completed"||a.remiDetails?.reimbursementInfo.stage.code=="paid"||a.remiDetails?.reimbursementInfo.stage.code=="scheduled"||g.fetchState=="Completed"||g.fetchState=="In-Progress"||(R(!0),t(Ue(!1,x,v,d)),a.remiActivities[0]?.isRealTimeApprovalEnabled===!0&&t(_t(!1,!0,!0,a.lastUpdatedByUserId)))}),[T,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(P,{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(qe,{}):s.jsxs(s.Fragment,{children:[s.jsx(oe,{analytics:C,onLoad:A=>(p=>{d!=null&&p.trackReimbursementReimbursementDetails(d)})(A)}),s.jsx(qn,{initialOpenThreadRequest:l??void 0,scrollId:r,isShowDeletedReimbursementEnabled:v,location:n,navigate:e,isRealTimeApprovalEnabled:w,currentTenant:o,reimbursementId:d??"",themeState:c,isAiCfoAccessEnabled:b,onAskAiCfoClick:y})]})}const Kn=Q((function(e,t){return{remisReviewView:Pe(e),analytics:t.analytics}}),(function(e,t){return{onCloseOverlay:()=>{t.navigate(`/${t.tenantEmailDomain}/reimbursements`),e(Y())},onCloseReviewItem:n=>{e(Vt(n))},onProceedForBulkActionClick:(n,r)=>{switch(n){case"send_for_approval":e(zt());break;case"approve":e(xe("approved",r??""));break;case"reject":e(xe("rejected",r??""))}}}}))(En);function Jn({tenantEmailDomain:e}){const t=X(),n=k((m=>m.remisBulkActionViewState.bulkSubmissionFetchState.fetchState)),{remisForReview:r}=k((m=>Pe(m))),c=re(),d=c?.loggedInUserRole?.includes("admin")===!0;return f.useEffect((()=>{n!=="Completed"&&r.length!==0||t(`/${e}/reimbursements`)}),[n,r.length,e]),s.jsx(Kn,{navigate:t,analytics:C,isAdmin:d,tenantEmailDomain:e})}const z=Qt(),at="bulk-operation-update",pe="reimbursement-approval-rule-update",{spendManagement:Xn,common:le}=Ye.getLocalizedStrings(),Qn=Xn.reimbursement.bulkActions,ea=N.div`
|
|
57
57
|
display: flex;
|
|
58
58
|
min-height: 100%;
|
|
59
59
|
width: 100%;
|
|
@@ -61,8 +61,8 @@ import{j as s}from"./liveblocks-e6rGc1UF.js";import{u as ne,j as k,h as X,g as K
|
|
|
61
61
|
flex-direction: column;
|
|
62
62
|
align-items: center;
|
|
63
63
|
background-color: ${e=>e.theme.colors.grey4};
|
|
64
|
-
`,ta=Q((function(e,t){const n=Ze(e,z,t.isBulkActionEnabled);let r=n.allSubTabs;const c=F.getSignedInUser(),d=he(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((u=>u!=="deleted")));const b=n.fetchState,y=en(e);return{transactionList:t.isShowDeletedReimbursementEnabled?n.reimbursements:n.reimbursements.filter((u=>u.isDeleted===!1)),isAdmin:t.isAdmin,isZeniUser:d,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:`${jn}/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(Y()),e(Ne(o))},onSubtabChange:o=>{e(Y()),e(Oe(o))},onTransactionClick:(o,a)=>{const i=sa(m,o,a),l=
|
|
64
|
+
`,ta=Q((function(e,t){const n=Ze(e,z,t.isBulkActionEnabled);let r=n.allSubTabs;const c=F.getSignedInUser(),d=he(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((u=>u!=="deleted")));const b=n.fetchState,y=en(e);return{transactionList:t.isShowDeletedReimbursementEnabled?n.reimbursements:n.reimbursements.filter((u=>u.isDeleted===!1)),isAdmin:t.isAdmin,isZeniUser:d,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:`${jn}/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(Y()),e(Ne(o))},onSubtabChange:o=>{e(Y()),e(Oe(o))},onTransactionClick:(o,a)=>{const i=sa(m,o,a),l=K(c.state?.pathnameStackToGoBack,c.pathname);n(i,{state:{pathnameStackToGoBack:l}})},onClickSetupIcon:()=>{const o=aa(m),a=K(c.state?.pathnameStackToGoBack,c.pathname);n(o,{state:{pathnameStackToGoBack:a}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;C?.trackReimbursementNewReimbursement();const a=`/${o}/reimbursement/new`,i=K(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(a,{state:{pathnameStackToGoBack:i}})},onColumnSortConfigChanged:(o,a)=>{e(mn({uiState:{sortKey:o,sortOrder:a},period:t.period}))},onSearchTextChanged:o=>{e(ln(o))},onFiltersChange:o=>{e(rn({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(on({uiState:{downloadState:o}}))},onReloadTransactions:()=>{e(de(d,!0,t.isShowDeletedReimbursementEnabled,!1,!0))},onBackClick:()=>{n("../",{relative:"path"})},onNavigateToSettings:()=>{n("../reimbursements/setup")},updateBulkActionList:o=>{e(sn(o))},removeAllTransactionsFromBulkActionList:()=>{e(Y())},onProceedForBulkActionClick:(o,a)=>{switch(o){case"delete":case"cancel":e(an(o,a??""));break;case"send_for_approval":e(Be("send_for_approval")),t.navigate("./bulk-review");break;case"review":e(Be("approve")),t.navigate("./bulk-review")}},onReimbursementApprovalRulesEventReceived:o=>{o.endsWith(pe)&&e(nn(!1))},onEventReceived:o=>{o===at&&e(tn())}}}))(Tn(Dn));function na(){const e=X(),t=ne(),n=J(),r=n.state,c=He(),[d,m]=f.useState(null),o=lt("/:tenantEmailDomain/reimbursements/bulk-review")!=null;f.useEffect((()=>{if(r?.tab!=null&&r?.subTab!=null){const S=Wt(r.tab.toString());S!=null?t(Ne(S)):console.log("Warning:Not a valid remiListTab");const G=Ht(r.subTab.toString());G!=null?t(Oe(G)):console.log("Warning:Not a valid remiListSubTab")}return()=>{t(Y())}}),[]);const{useFeatureGate:a}=ie(),{isFeatureEnabled:i}=a(j.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:l}=a(j.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:b}=a(j.isReimbursementBulkActionEnabled),y=F.getSignedInUser(),u=k((S=>V(S))),[x,I]=f.useState(!1),[B,T]=f.useState(!1),R=re(),w=R?.loggedInUserRole?.includes("admin")===!0,h=k((S=>Ze(S,z,b))),{areTenantIdsInSync:v}=xn(),g=h.fetchState,{isAiCfoAccessEnabled:L,onAskAiCfoClick:U}=ye({mobileExploreReferrer:"Reimbursement List"});if(Ke({isDataReady:g==="Completed"}),f.useEffect((()=>{!B&&v&&(T(!0),t(de(z,!0,l,!1,!0)))}),[B,z,t,v]),y==null)throw Error("Can't access address page without signing in...");const $=!!u?.userRole&&qt(u),A=fe(R?.loggedInUserRoleMap),p=Se(R?.loggedInUserRoleMap),M=!!u.userReimbursementInfo?.isReimbursementTOSAccepted,O=!!u.companyReimbursementInfo?.info?.isReimbursementEnabled,W=!!u.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,Z=k((S=>$e(S.companyState,u.companyId))),H=Z?.company.featuresActivationInfo.connectedAccountProvider,_=S=>{I(S)},{isFeatureEnabled:st}=a(j.isDebitCardFeatureEnabled),it=Ge(st,u),ot=ze(u),{remisProcessed:ee,remisProcessing:Re}=k((S=>Yt(S)));f.useEffect((()=>{ee===Re&&d!=null&&(t(Kt({messageSection:"reimbursement_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_report_",variableValue:ee>1?le.texts.reports2:Qn.report},{variableName:"_has_",variableValue:ee>1?le.texts.have:le.texts.has},{variableName:"_action_",variableValue:Jt(d)}]})),t(Xt()),setTimeout((()=>{t(de(z,!0,l,!1,!0,!0))}),3e3),m(null))}),[ee,Re]);const rt={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${at}`,`private-encrypted-${u.companyId}.${pe}`]:[],eventCallback:(S,G,ve)=>{S.endsWith(pe)?ve.onReimbursementApprovalRulesEventReceived?.(S):G.entity_type==="reimbursement"&&(m(G.operation_type),ve.onEventReceived(S))}};return n.pathname.endsWith("/reimbursements/")||n.pathname.endsWith("/reimbursements")||n.pathname.endsWith("/reimbursements/bulk-review")?it===!0||ot===!0?s.jsx(Qe,{}):O&&(!$||A)||p&&M?s.jsxs(s.Fragment,{children:[g==="Completed"?s.jsx(oe,{analytics:C,onLoad:S=>(G=>G.trackPageLoaded(Je.Event.reimbursementHome))(S)}):null,s.jsx(tt,{isAppContentDrawerOpen:x,handleDrawerToggle:_}),s.jsxs(ea,{windowSize:c,children:[s.jsx(Mn,{isOpen:o,drawerLeftMargin:new Bn(0,0,300,600),onClose:()=>{e(`/${u.tenantEmailDomain}/reimbursements`),t(Y())},children:s.jsx(ia,{onClick:S=>S.stopPropagation(),children:s.jsx(Jn,{tenantEmailDomain:u.tenantEmailDomain})})}),s.jsx(ta,{isShowDeletedBillsEnabled:i,isShowDeletedReimbursementEnabled:l,location:n,navigate:e,currentTenant:u,period:z,isAdmin:w,isEmployee:$,entity:"reimbursement",onClickMenuIcon:()=>{_(!0)},createdByUserList:h.createdByUserList,createdByUserListFetchState:h.createdByUserListFetchState,isDownloadEnabled:h.isDownloadEnabled,connectedAccountProvider:H,isBulkActionEnabled:b,bulkSubmissionLimit:h.remiBulkSubmissionLimit,bulkSubmissionFetchState:h.remiListBulkActionInfo.bulkSubmissionFetchState,isAiCfoAccessEnabled:L,onAskAiCfoClick:U,...rt})]})]}):W&&A?s.jsx(P,{to:"../setup"}):R!=null&&Ve(u,R.loggedInUserRoleMap)?s.jsx(P,{to:"../promo"}):s.jsx(Ie,{fetchState:"In-Progress"}):s.jsx(ue,{})}const aa=e=>`/${e}/reimbursements/setup`,sa=(e,t,n)=>{let r=`/${e}/reimbursement/${encodeURIComponent(t)}`;return n=="draft"&&(r+="/edit"),r},ia=N(Ln)`
|
|
65
65
|
display: flex;
|
|
66
66
|
min-height: 100%;
|
|
67
67
|
flex-direction: column;
|
|
68
|
-
`,oa=Q((function(e,t){const{companyId:n}=t;return{reimbursementSetupView:cn(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(un(n))},onCreateNewRemiButtonClick:()=>{e(dn(t.userRoleId))},onBackClick:()=>{r("../..",{relative:"path"})},onSetupReimbursementSuccess:()=>{t.isEmployee?r("../../reimbursement/new",{relative:"path"}):r("../reimbursements/setup",{relative:"path"})}}}))($n),ra=()=>{const e=Un(),t=X(),n=
|
|
68
|
+
`,oa=Q((function(e,t){const{companyId:n}=t;return{reimbursementSetupView:cn(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(un(n))},onCreateNewRemiButtonClick:()=>{e(dn(t.userRoleId))},onBackClick:()=>{r("../..",{relative:"path"})},onSetupReimbursementSuccess:()=>{t.isEmployee?r("../../reimbursement/new",{relative:"path"}):r("../reimbursements/setup",{relative:"path"})}}}))($n),ra=()=>{const e=Un(),t=X(),n=J(),{tenantEmailDomain:r}=se(),c=Xe(),[d,m]=f.useState(!1),o=k((w=>V(w))),a=F.getSignedInUserTenant(r)?.companyId??o.companyId,i=F.getSignedInUser(),l=o.userRoleId,b=!!o.userRole?.includes("reimbursements_user"),y=re(),u=fe(y?.loggedInUserRoleMap),x=Se(y?.loggedInUserRoleMap),I=!!o.userReimbursementInfo?.isReimbursementTOSAccepted,B=!!o.companyReimbursementInfo?.info?.isReimbursementEnabled,T=!!o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,R=w=>{m(w)};if(i==null)throw Error("Can't access reimbursement promo page without signing in...");return B&&x&&I?s.jsx(P,{to:"../../../reimbursements"}):T&&u?s.jsx(P,{to:"../../reimbursements/setup"}):o.companyReimbursementInfo&&!T||o.userReimbursementInfo&&x&&I===!1?s.jsxs(s.Fragment,{children:[s.jsx(oe,{analytics:C,onLoad:w=>(h=>h.trackPageLoaded(Je.Event.reimbursementPromoPage))(w)}),s.jsx(tt,{isAppContentDrawerOpen:d,handleDrawerToggle:R}),s.jsx(oa,{companyId:a,navigate:t,meetingUrl:e("reimbursement_promo"),location:n,userReimbursementInfo:o.userReimbursementInfo,userRoleId:l,isEmployee:b,onClickMenuIcon:()=>{R(!0)}})]}):s.jsx(Ie,{fetchState:"In-Progress",style:{backgroundColor:c.colors.grey5}})};function Pa(){const e=k((_=>V(_))),t=re(),n=!!e.company?.companyReimbursementInfo.isReimbursementEnabled,r=Xe(),c=!!e.company?.companyReimbursementInfo.isReimbursementTOSAccepted,d=!!e.userReimbursementInfo?.isReimbursementTOSAccepted,{useFeatureGate:m}=ie(),{isFeatureEnabled:o}=m(j.isChargeCardFeatureEnabled),{isFeatureEnabled:a}=m(j.isDebitCardFeatureEnabled),i=Ge(a,e),l=ze(e),b=e?.userRole!=null&&pn(e?.userRole),y=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b)&&bn(t?.loggedInUserRoleMap),u=gn(t?.loggedInUserRoleMap),x=e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!b,I=fe(t?.loggedInUserRoleMap),B=x&&I,T=!!e.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!b,R=T&&hn(t?.loggedInUserRoleMap),w=Fn(e,o,a)&&!b,h=w&&fn(t?.loggedInUserRoleMap),v=Sn(t?.loggedInUserRoleMap),g=In(t?.loggedInUserRoleMap),L=yn(t?.loggedInUserRoleMap),U=T&&g,$=e.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!b&&L,A=Rn(t?.loggedInUserRoleMap),p=vn(t?.loggedInUserRoleMap),M=Se(t?.loggedInUserRoleMap),O=w&&A,{tenantEmailDomain:W}=se(),Z=J(),H=n===!0&&(I||M&&d);return s.jsxs(mt,{children:[Z.pathname.includes("/reimbursements")?s.jsxs(s.Fragment,{children:[s.jsx(E,{path:"verification",element:s.jsx(De,{isBillPayAdminLevelAccess:y,isUserHasOnlyBillPayAccess:u,isReimbursementAdminLevelAccess:B,isZeniAccountAdminLevelAccess:R,isChargeCardAdminLevelAccess:h,isUserHasOnlyCardAccess:v,productType:"reimbursement",type:"verification"})}),s.jsx(E,{path:"setup",element:s.jsx(De,{isBillPayAdminLevelAccess:y,isUserHasOnlyBillPayAccess:u,isReimbursementAdminLevelAccess:B,isZeniAccountAdminLevelAccess:R,isChargeCardAdminLevelAccess:h,isUserHasOnlyCardAccess:v,productType:"reimbursement",type:"setup"})}),s.jsx(E,{path:"promo",element:s.jsx(ra,{})}),s.jsx(E,{path:"approval-rules/*",element:B?s.jsx(Pn,{}):s.jsx(_n,{showZeniAccountRoute:U,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:M,showTreasuryRoute:$,isTenantBankingOnly:i,showChargeCardRoute:O,tenantEmailDomain:W??""})}),H&&s.jsx(E,{path:"*",element:s.jsx(na,{})}),(i===!0||l===!0)&&s.jsx(E,{path:"/*",element:s.jsx(Qe,{})}),t!=null&&Ve(e,t?.loggedInUserRoleMap)&&s.jsx(E,{path:"*",element:s.jsx(P,{to:"../promo"})}),c&&I&&s.jsx(E,{path:"*",element:s.jsx(P,{to:"../setup"})})]}):Z.pathname.includes("/reimbursement")?s.jsxs(s.Fragment,{children:[s.jsx(E,{path:"new",element:s.jsx(je,{})}),s.jsx(E,{path:":reimbursementId",element:s.jsx(Yn,{})}),s.jsx(E,{path:":reimbursementId/edit",element:s.jsx(je,{})}),s.jsx(E,{path:"*",element:s.jsx(ue,{})})]}):s.jsx(E,{path:"*",element:s.jsx(Ie,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5,boxShadow:`0px 2px ${D.sp1} ${r.colors.dropShadowNormal}`}})}),s.jsx(E,{path:"*",element:s.jsx(ue,{})})]})}export{Pa as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as p}from"./liveblocks-e6rGc1UF.js";import{g as K,h as Ve,u as Fe,i as Oe,j as d,l as De,n as Ae,o as X}from"./core-CHD8T-IM.js";import{fF as N,Eb as R,UQ as Pe,l$ as ne,ua as re,u$ as D,lG as Ee,lP as A,lH as P,kK as E,kB as U,kA as Ue,Dj as le,v4 as Le,bq as Me,UR as Be,bn as ve,Ey as xe,US as ze,UT as Ge,ci as g,Dc as He,UU as J,UV as Ye,UW as $e,UX as Ne,UY as qe,UZ as Ze,U_ as Qe,U$ as We,V0 as Ke,V1 as Xe,V2 as Je,V3 as ea,V4 as aa,V5 as j,V6 as L,V7 as M,V8 as B,V9 as v,Va as x,Vb as z,Vc as G,Vd as H,Ve as Y,ei as sa,Ec as ta,D$ as ee,E0 as ae,Ei as oa,E4 as se,Eo as na,Vf as ra,Vg as la,Vh as ca,Vi as ia,Vj as da,Vk as pa,Vl as _a,Vm as fa,Vn as ma,Vo as ua,d_ as ba,dZ as ha}from"./zeni-epic-state-BO3zdDfL.js";import{ao as ya,ap as wa,aq as Ca,a as Sa,a2 as ga,N as ce,f as ie,z as de,ar as Ia,W as Ra,d as Ta,as as ja,at as ka,a9 as Va,k as $,U as Fa,y as Oa,p as pe,au as Da,av as Aa,aw as Pa}from"./index-DKH4PK2B.js";import"./mui-NTaF3UaY.js";import Ea from"./NotFoundScreen-CtgFRYZy.js";import{F as Ua}from"./FeaturePreviewScreen-D54Nwanb.js";import{a as u}from"./sentry-DsyKtMW2.js";import{u as La}from"./useInitialThreadRequest-DDr_z_RH.js";import{t as te,a as oe,b as Ma}from"./routePaths-CGyE-cU7.js";import{M as Ba}from"./MobileAppDrawer-DX2JnkbM.js";import"./recharts-C6xUtcdL.js";import"./analytics-C3e3An3a.js";import"./plaid-DdTo7m1-.js";import"./dnd-Dwi6R-ey.js";import"./stripe-cKAAJElX.js";import"./lottie-B778bt56.js";import"./lexical-CMNdypK6.js";import"./pdf-Bx92ZlM_.js";import"./utils-CCA3F0sZ.js";import"./InboxNotificationsProvider-x0fdv66l.js";import"./useTaskManagerAccess-CUv6a62x.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]="6832ca69-7f0a-41e3-99a1-4c0e782ca029",e._sentryDebugIdIdentifier="sentry-dbid-6832ca69-7f0a-41e3-99a1-4c0e782ca029")}catch{}})();const va=["profit_loss","balance_sheet","cash_flow"],I=e=>e==="balance_sheet"||e==="balance_sheet_by_classes"||e==="balance_sheet_by_projects",y=e=>{e(Y({resetLeftScroll:!0})),e(H({resetLeftScroll:!0})),e(G({resetLeftScroll:!0})),e(z({resetLeftScroll:!0})),e(x({resetLeftScroll:!0})),e(v({resetLeftScroll:!0})),e(L({resetLeftScroll:!0})),e(B({resetLeftScroll:!0})),e(M({resetLeftScroll:!0}))},xa=e=>{e(la()),e(ca()),e(ia()),e(da()),e(pa()),e(_a()),e(fa()),e(ma()),e(ua())},za=De((function(e){const o=de.getSignedInUser(),_=e.tenantState.currentTenantId,m=N(e),a=m?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:_??""},t=R(e),r=Be(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:ve(o),showAccountGroups:r===!0,isAccountingClassesEnabled:ne(e),isAccountingProjectsEnabled:re(e),currentTenantCompanyName:a,statementEndPoint:`${Pa}/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(ra(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(na(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(ee(o.firstMonthOfFY,r,i.numberOfPeriods<1?1:i.numberOfPeriods,c)),f.length>0&&e(ae(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(j(a)),(I(a)||g(a))&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(se({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(J({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(se(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(oa(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(ee(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(ae(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(ta({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=sa(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 te(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return oe(o.tenantEmailDomain,a.accountId,a.accountType,s.id,f,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?Ma(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,f,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?oe(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],f,r,l):a.accountType!=null?te(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l):void 0})();if(i!=null){const c=pe(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(Y({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(H({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(L({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(Y({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(H({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(L({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(Je({viewMode:a}))):(e(ea({viewMode:a})),e(aa({viewMode:a}))),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",k(t)),e(j(l?"cash_flow_by_classes":r?"balance_sheet_by_classes":"profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",k(t)),e(j(l?"cash_flow_by_projects":r?"balance_sheet_by_projects":"profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",k(t)),e(j(l?"cash_flow":r?"balance_sheet":"profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{g(o.selectedReportID)?e(qe({classesToFilterOut:a})):I(o.selectedReportID)?e(Ze({classesToFilterOut:a})):e(Qe({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{g(o.selectedReportID)?e(Ye({projectsToFilterOut:a})):I(o.selectedReportID)?e($e({projectsToFilterOut:a})):e(Ne({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(J({classViewLayout:a}))},onOpenAccountViewMode:()=>{const a=I(o.selectedReportID),s=g(o.selectedReportID);o.isAccountingClassesEnabled&&e(s?P():a?U():He()),o.isAccountingProjectsEnabled&&e(s?A():a?E():le())},onUpdateDisplayOrder:a=>{e(Ge(a))},onUpdateReportFormat:a=>{xa(e),e(ze(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"?xe(a==="profit_and_loss_by_projects"?"profit_and_loss_by_projects":"profit_and_loss_by_classes"):A(!0):P(!0):E(!0):U(!0))}}}))(Da);function Ga(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Sa(),_=ga(),m=Aa(_),a=Ve(),s=Fe(),t=K(),{tenantEmailDomain:r}=Oe(),{useFeatureGate:l}=ce(),{isFeatureEnabled:f}=l(ie.isReportsHorizontalClassLayoutSwitchEnabled),i=de.getSignedInUser(),[c,w]=u.useState(!1),[q,_e]=u.useState(!1);if(i==null)throw Error("Can't access reports page without signing in...");const V=d((n=>N(n))),fe=V.masterTOSInfo?.isMasterTOSAccepted??!1,me=V.company?.companyInfo.firstMonthOfFY??1,ue=La(V?.companyId),C=d((n=>R(n).fetchState)),be=d((n=>Pe(n))),{areTenantIdsInSync:b}=Ia(),F=d((n=>n.financeStatementState.selectedReportId)),T=d((n=>ne(n))),S=d((n=>re(n))),he=d((n=>R(n).isCompareModeOn)),h=d((n=>R(n).filter)),O=d((n=>R(n).selectedReportAndTimeframeFetchState)),ye=d((n=>n.profitAndLossClassesViewState.uiState.classViewLayout));u.useEffect((()=>{!c&&b&&(w(!0),s(D(i.userId,!0,!0,!1)))}),[c,i,s,b]),u.useEffect((()=>{c&&!q&&C==="Completed"&&b&&(s(D(i.userId,!1,!0,!1)),_e(!0))}),[c,q,C,b]),u.useEffect((()=>{if(c&&O.fetchState==="Not-Started"&&h.timeframe!=="free_range"&&h.timeframe!=="week"&&b)switch(F){case"profit_and_loss":case"profit_and_loss_by_classes":s(Le(h.timeframe));break;case"profit_and_loss_by_projects":S&&s(le());break;case"balance_sheet":s(Ue(h.timeframe));break;case"balance_sheet_by_classes":T&&s(U());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(Ee(h.timeframe))}}),[c,F,O,b,T,S]);const Z=Ra(),we=Z?.loggedInUserRole!=null&&Me(Z?.loggedInUserRole)!==!0,[Ce,Se]=u.useState(!1),Q=n=>{Se(n)},ge=Ta(),Ie=ja();return(function(n){const{isDataReady:Re}=n,{pathname:Te}=K(),W=ya(Te??"")==="reports",je=wa(Re),ke=u.useMemo((()=>W?va:void 0),[W]);Ca({canFetchSuggestedQuestions:je,pageContexts:ke})})({isDataReady:C==="Completed"}),ka({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(Va,{analytics:$,onLoad:n=>n.trackPageLoaded(Fa.Event.reports)}):null,p.jsx(Ba,{isAppContentDrawerOpen:Ce,handleDrawerToggle:Q}),p.jsx(za,{firstMonthOfFY:me,tenantEmailDomain:r,location:t,navigate:a,windowSize:_,classViewLayout:ye,selectedReportID:F,analytics:$,filter:h,isAccountingClassesEnabled:T,isAccountingProjectsEnabled:S,isCompareModeOn:he,hasTransactionAccess:we,signedInUser:i,selectedReportAndTimeframeFetchState:O,handleDrawerToggle:Q,reportsResyncFetchState:be.reportsResyncFetchState,isAiCfoAccessEnabled:Ie&&ge&&!e,onAskAiCfoClick:()=>{if(fe)if(m){const n=pe(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,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 ps(){const e=d((s=>N(s))),{useFeatureGate:o}=ce(),{isFeatureEnabled:_}=o(ie.isDebitCardFeatureEnabled),m=ba(_,e),a=ha(e);return m===!0||a===!0?p.jsx(Ua,{}):p.jsxs(Ae,{children:[p.jsx(X,{path:"/",element:p.jsx(Ga,{})}),p.jsx(X,{path:"*",element:p.jsx(Ea,{})})]})}export{ps as default};
|
|
1
|
+
import{j as p}from"./liveblocks-CgHUgeBY.js";import{g as W,h as Ve,u as Fe,i as Oe,j as d,l as De,n as Ae,o as X}from"./core-Cc7wW2EM.js";import{fF as N,Eb as R,UQ as Pe,l$ as ne,ua as re,u$ as D,lG as Ee,lP as A,lH as P,kK as E,kB as U,kA as Ue,Dj as le,v4 as Le,bq as Me,UR as Be,bn as ve,Ey as xe,US as ze,UT as Ge,ci as g,Dc as He,UU as J,UV as Ye,UW as $e,UX as Ne,UY as qe,UZ as Ze,U_ as Qe,U$ as Ke,V0 as We,V1 as Xe,V2 as Je,V3 as ea,V4 as aa,V5 as j,V6 as L,V7 as M,V8 as B,V9 as v,Va as x,Vb as z,Vc as G,Vd as H,Ve as Y,ei as sa,Ec as ta,D$ as ee,E0 as ae,Ei as oa,E4 as se,Eo as na,Vf as ra,Vg as la,Vh as ca,Vi as ia,Vj as da,Vk as pa,Vl as _a,Vm as fa,Vn as ma,Vo as ua,d_ as ba,dZ as ha}from"./zeni-epic-state-BVJjEVAA.js";import{ao as ya,ap as wa,aq as Ca,a as Sa,a2 as ga,N as ce,f as ie,z as de,ar as Ia,P as Ra,d as Ta,as as ja,at as ka,a9 as Va,j as $,U as Fa,x as Oa,p as pe,au as Da,av as Aa,aw as Pa}from"./index-CFXYM6OK.js";import"./mui-C4zFSCiU.js";import Ea from"./NotFoundScreen-ytl2lDpJ.js";import{F as Ua}from"./FeaturePreviewScreen--_B7whPE.js";import{a as u}from"./sentry-DSWD_gIh.js";import{u as La}from"./useInitialThreadRequest-DIgkNFzN.js";import{t as te,a as oe,b as Ma}from"./routePaths-BvBrBOWH.js";import{M as Ba}from"./MobileAppDrawer-B_iTAp0X.js";import"./recharts-DJGeJ2v_.js";import"./analytics-S5MhEivL.js";import"./plaid-vsHcqLdj.js";import"./dnd-DEyyKSEC.js";import"./stripe-cKAAJElX.js";import"./lottie-C1A2hiZE.js";import"./lexical-DXgKWO29.js";import"./pdf-rXyPRm1U.js";import"./utils-DiIEQ7_h.js";import"./InboxNotificationsProvider-CYNlrTK-.js";import"./useTaskManagerAccess-P-CWGdcX.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]="ab2693c2-df97-4b0d-a332-f43ea663513e",e._sentryDebugIdIdentifier="sentry-dbid-ab2693c2-df97-4b0d-a332-f43ea663513e")}catch{}})();const va=["profit_loss","balance_sheet","cash_flow"],I=e=>e==="balance_sheet"||e==="balance_sheet_by_classes"||e==="balance_sheet_by_projects",y=e=>{e(Y({resetLeftScroll:!0})),e(H({resetLeftScroll:!0})),e(G({resetLeftScroll:!0})),e(z({resetLeftScroll:!0})),e(x({resetLeftScroll:!0})),e(v({resetLeftScroll:!0})),e(L({resetLeftScroll:!0})),e(B({resetLeftScroll:!0})),e(M({resetLeftScroll:!0}))},xa=e=>{e(la()),e(ca()),e(ia()),e(da()),e(pa()),e(_a()),e(fa()),e(ma()),e(ua())},za=De((function(e){const o=de.getSignedInUser(),_=e.tenantState.currentTenantId,m=N(e),a=m?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:_??""},t=R(e),r=Be(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:ve(o),showAccountGroups:r===!0,isAccountingClassesEnabled:ne(e),isAccountingProjectsEnabled:re(e),currentTenantCompanyName:a,statementEndPoint:`${Pa}/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(ra(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(na(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(ee(o.firstMonthOfFY,r,i.numberOfPeriods<1?1:i.numberOfPeriods,c)),f.length>0&&e(ae(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(j(a)),(I(a)||g(a))&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(se({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(J({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(se(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(oa(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(ee(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(ae(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(ta({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=sa(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 te(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return oe(o.tenantEmailDomain,a.accountId,a.accountType,s.id,f,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?Ma(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,f,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?oe(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],f,r,l):a.accountType!=null?te(o.tenantEmailDomain,a.accountId,a.accountType,f,r,l):void 0})();if(i!=null){const c=pe(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(Y({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(H({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(L({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(Y({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(H({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(L({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(Ke({viewMode:a})),e(We({viewMode:a}))):r?(e(Xe({viewMode:a})),e(Je({viewMode:a}))):(e(ea({viewMode:a})),e(aa({viewMode:a}))),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",k(t)),e(j(l?"cash_flow_by_classes":r?"balance_sheet_by_classes":"profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",k(t)),e(j(l?"cash_flow_by_projects":r?"balance_sheet_by_projects":"profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",k(t)),e(j(l?"cash_flow":r?"balance_sheet":"profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{g(o.selectedReportID)?e(qe({classesToFilterOut:a})):I(o.selectedReportID)?e(Ze({classesToFilterOut:a})):e(Qe({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{g(o.selectedReportID)?e(Ye({projectsToFilterOut:a})):I(o.selectedReportID)?e($e({projectsToFilterOut:a})):e(Ne({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(J({classViewLayout:a}))},onOpenAccountViewMode:()=>{const a=I(o.selectedReportID),s=g(o.selectedReportID);o.isAccountingClassesEnabled&&e(s?P():a?U():He()),o.isAccountingProjectsEnabled&&e(s?A():a?E():le())},onUpdateDisplayOrder:a=>{e(Ge(a))},onUpdateReportFormat:a=>{xa(e),e(ze(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"?xe(a==="profit_and_loss_by_projects"?"profit_and_loss_by_projects":"profit_and_loss_by_classes"):A(!0):P(!0):E(!0):U(!0))}}}))(Da);function Ga(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Sa(),_=ga(),m=Aa(_),a=Ve(),s=Fe(),t=W(),{tenantEmailDomain:r}=Oe(),{useFeatureGate:l}=ce(),{isFeatureEnabled:f}=l(ie.isReportsHorizontalClassLayoutSwitchEnabled),i=de.getSignedInUser(),[c,w]=u.useState(!1),[q,_e]=u.useState(!1);if(i==null)throw Error("Can't access reports page without signing in...");const V=d((n=>N(n))),fe=V.masterTOSInfo?.isMasterTOSAccepted??!1,me=V.company?.companyInfo.firstMonthOfFY??1,ue=La(V?.companyId),C=d((n=>R(n).fetchState)),be=d((n=>Pe(n))),{areTenantIdsInSync:b}=Ia(),F=d((n=>n.financeStatementState.selectedReportId)),T=d((n=>ne(n))),S=d((n=>re(n))),he=d((n=>R(n).isCompareModeOn)),h=d((n=>R(n).filter)),O=d((n=>R(n).selectedReportAndTimeframeFetchState)),ye=d((n=>n.profitAndLossClassesViewState.uiState.classViewLayout));u.useEffect((()=>{!c&&b&&(w(!0),s(D(i.userId,!0,!0,!1)))}),[c,i,s,b]),u.useEffect((()=>{c&&!q&&C==="Completed"&&b&&(s(D(i.userId,!1,!0,!1)),_e(!0))}),[c,q,C,b]),u.useEffect((()=>{if(c&&O.fetchState==="Not-Started"&&h.timeframe!=="free_range"&&h.timeframe!=="week"&&b)switch(F){case"profit_and_loss":case"profit_and_loss_by_classes":s(Le(h.timeframe));break;case"profit_and_loss_by_projects":S&&s(le());break;case"balance_sheet":s(Ue(h.timeframe));break;case"balance_sheet_by_classes":T&&s(U());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(Ee(h.timeframe))}}),[c,F,O,b,T,S]);const Z=Ra(),we=Z?.loggedInUserRole!=null&&Me(Z?.loggedInUserRole)!==!0,[Ce,Se]=u.useState(!1),Q=n=>{Se(n)},ge=Ta(),Ie=ja();return(function(n){const{isDataReady:Re}=n,{pathname:Te}=W(),K=ya(Te??"")==="reports",je=wa(Re),ke=u.useMemo((()=>K?va:void 0),[K]);Ca({canFetchSuggestedQuestions:je,pageContexts:ke})})({isDataReady:C==="Completed"}),ka({isDataReady:C==="Completed"}),p.jsxs(p.Fragment,{children:[C==="Completed"?p.jsx(Va,{analytics:$,onLoad:n=>n.trackPageLoaded(Fa.Event.reports)}):null,p.jsx(Ba,{isAppContentDrawerOpen:Ce,handleDrawerToggle:Q}),p.jsx(za,{firstMonthOfFY:me,tenantEmailDomain:r,location:t,navigate:a,windowSize:_,classViewLayout:ye,selectedReportID:F,analytics:$,filter:h,isAccountingClassesEnabled:T,isAccountingProjectsEnabled:S,isCompareModeOn:he,hasTransactionAccess:we,signedInUser:i,selectedReportAndTimeframeFetchState:O,handleDrawerToggle:Q,reportsResyncFetchState:be.reportsResyncFetchState,isAiCfoAccessEnabled:Ie&&ge&&!e,onAskAiCfoClick:()=>{if(fe)if(m){const n=pe(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,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 ps(){const e=d((s=>N(s))),{useFeatureGate:o}=ce(),{isFeatureEnabled:_}=o(ie.isDebitCardFeatureEnabled),m=ba(_,e),a=ha(e);return m===!0||a===!0?p.jsx(Ua,{}):p.jsxs(Ae,{children:[p.jsx(X,{path:"/",element:p.jsx(Ga,{})}),p.jsx(X,{path:"*",element:p.jsx(Ea,{})})]})}export{ps as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as a}from"./liveblocks-CgHUgeBY.js";import{z as b,a9 as v,j as u,U as D,e3 as E,N as k,f as I}from"./index-CFXYM6OK.js";import"./mui-C4zFSCiU.js";import g from"./NotFoundScreen-ytl2lDpJ.js";import{a as c}from"./sentry-DSWD_gIh.js";import{u as C,j as h,h as F,g as L,l as U,n as T,o as f,N as y}from"./core-Cc7wW2EM.js";import{fF as _,a1$ as j,a20 as p,DS as P,p$ as V,a21 as $,DQ as z}from"./zeni-epic-state-BVJjEVAA.js";import"./recharts-DJGeJ2v_.js";import"./analytics-S5MhEivL.js";import"./plaid-vsHcqLdj.js";import"./dnd-DEyyKSEC.js";import"./stripe-cKAAJElX.js";import"./lottie-C1A2hiZE.js";import"./lexical-DXgKWO29.js";import"./pdf-rXyPRm1U.js";import"./utils-DiIEQ7_h.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]="e44b5a7d-a8bf-469a-9d90-7b2f64fd5f8e",e._sentryDebugIdIdentifier="sentry-dbid-e44b5a7d-a8bf-469a-9d90-7b2f64fd5f8e")}catch{}})();const G=U((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(z())},onUpdateInviteFormLocalData:s=>{e($({localData:s}))},onSubmitSuccess:()=>{e(p())},onCancelClick:()=>{i!=null&&u.trackInviteEmailClicked("cancel")}}}))(E),Q=()=>{const e=C(),[t,n]=c.useState(!1),[i,s]=c.useState(!1),r=h((o=>_(o))),l=F(),w=L(),d=b.getSignedInUser();if(d==null)throw Error("Can't access invite referral screen without signing in...");const m=h((o=>j(o))),x=d?.firstName!=null?d.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 N=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[m.fetchState==="Completed"?a.jsx(v,{analytics:u,onLoad:o=>(S=>S.trackPageLoaded(D.Event.inviteEmailViewed))(o)}):null,a.jsx(G,{navigate:l,location:w,currentTenant:r,companyName:N,userName:x,inviteFormCompayData:m.localData})]})};function ne(){const{useFeatureGate:e}=k(),{isFeatureEnabled:t}=e(I.isReferralFeatureEnabled);return a.jsxs(T,{children:[a.jsx(f,{path:"/",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(f,{path:"how-it-works",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(f,{path:"refer/*",element:t?a.jsx(Q,{}):a.jsx(g,{})}),a.jsx(f,{path:"*",element:a.jsx(g,{})})]})}export{ne as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as
|
|
1
|
+
import{j as E}from"./liveblocks-CgHUgeBY.js";import{a as A}from"./sentry-DSWD_gIh.js";import{i as G,u as H,h as Q,g as ee,j as h,l as te}from"./core-Cc7wW2EM.js";import{WO as Fe,WP as Ve,l$ as ae,su as Me,sG as Ge,sW as $e,sU as Re,sX as Ke,sZ as Ue,WQ as We,fF as K,VN as pe,WR as Se,g_ as ne,cB as se,cC as le,Fg as ve,WS as Ce,Fk as Ye,gO as ce,sx as ze,t6 as qe,dD as Ze,dC as Xe,T9 as fe,Fe as He,F8 as Qe,WT as De,F0 as et,E$ as tt,EW as at,F5 as nt,Fl as st,WU as W,WV as ge,F1 as lt,VO as oe,FB as Ae,Fu as Ie,WW as xe,sA as Te,Fo as Be,Fm as Le,WX as we,FI as be,FF as Je,Fp as je,FH as _e}from"./zeni-epic-state-BVJjEVAA.js";import{a5 as de,aZ as ie,a_ as ct,z as ot,l as dt,a8 as it,a9 as ue,j as N,aw as ut,a$ as rt,p as V,G as ye,F as Ee,b0 as ht,b1 as mt,b2 as pt}from"./index-CFXYM6OK.js";import{n as re}from"./mui-C4zFSCiU.js";import{p as St}from"./pathToGoBack-C17GqrA7.js";import X from"./NotFoundScreen-ytl2lDpJ.js";import{c as M}from"./routePaths-BvBrBOWH.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]="2a0debde-b66e-4fc8-a1fe-c65530294a76",e._sentryDebugIdIdentifier="sentry-dbid-2a0debde-b66e-4fc8-a1fe-c65530294a76")}catch{}})();function Rt({isRenderedInPanel:e=!1,accrualIdOverride:t,onPanelNavigateBack:c}={}){const{accrualId:s}=G(),l=t??s,n=H(),i=Q(),a=ee(),{accrual:d,actionFetchState:o,detailFetchState:m,localData:I}=h((u=>Fe(u,l??""))),p=h((u=>Ve(u))),C=h((u=>ae(u))),g=A.useCallback((()=>{const u=de(a.state?.pathnameStackToGoBack);i(u.poppedPathname??St(4),{state:{pathnameStackToGoBack:u.newStack}})}),[a.state,i]),f=A.useRef(!1);return A.useEffect((()=>{o.fetchState!=="In-Progress"&&f.current&&o.fetchState==="Completed"&&(f.current=!1,g())}),[o.fetchState,g]),A.useEffect((()=>{l!=null&&d==null&&m.fetchState==="Not-Started"&&n(Me(l))}),[l,d,m.fetchState]),A.useEffect((()=>{n(Ge({scheduleType:"prepaid_expenses",shouldResetEnteredData:!1}))}),[n]),l==null?E.jsx(X,{}):d==null?m.fetchState==="Not-Started"||m.fetchState==="In-Progress"?E.jsx(ie,{}):E.jsx(X,{}):E.jsx(ft,{children:E.jsx(ct,{isRenderedInPanel:e,accrual:d,actionFetchState:o.fetchState,isAccountingClassesEnabled:C,localData:I,newAccrualAccountsView:p,onAccrualFormChange:(u,r)=>{n(We({accrualId:u,localData:r}))},onAccrualFormClear:u=>{n(Ue({accrualId:u}))},onApproveAndPost:u=>{n(Ke(l,u))},onNavigateBack:c??g,onRevert:(u,r)=>{f.current=!0,n(Re(l,u,r))},onSkip:(u,r)=>{n($e(l,u,r))}})})}const ft=re.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -6,7 +6,7 @@ import{j as y}from"./liveblocks-e6rGc1UF.js";import{a as A}from"./sentry-DsyKtMW
|
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
align-items: center;
|
|
8
8
|
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,Dt=
|
|
9
|
+
`,Dt=ye.getLocalizedStrings(),gt=te((function(e,t){const c=Se(e,t.scheduleTab),s=e.tenantState.currentTenantId;return{authParams:{userId:t.signedInUser.userId??"",sessionId:t.signedInUser.zeniSessionId??"",tenantId:s??""},linkBillExpenseView:c.linkBillExpenseView,transactions:c.linkBillExpenseView.transactions}}),(function(e,t){const{navigate:c,location:s}=t;return{onTransactionSelect(l){e(Ce({selectedTransaction:l}))},onBackClick:()=>{c("..",{relative:"path"})},onCancel(){e(Ce({selectedTransaction:void 0})),e(Ye()),c("..",{relative:"path"})},onTransactionClick:l=>{const n=`${M(l,t.tenantEmailDomain)}`,i=V(s.state?.pathnameStackToGoBack,s.pathname);c(n,{state:{pathnameStackToGoBack:i}})},onLinkSave(){t.setShouldNavigateBack(!1),e(ve(t.scheduleTab,t.scheduleAccruedDetailsView.selectedJEAccruedSchedule?.jeScheduleId))}}}))(rt),Kt=({setShouldNavigateBack:e})=>{const t=Q(),c=ee(),{scheduleDetailId:s,tenantEmailDomain:l}=G(),{scheduleType:n}=G();if(l==null)throw Error("Can't access Link Bill Expense page without tenant Email Domain");const i=h((g=>K(g))),a=pe(n)??"accrued_expenses",d=ot.getSignedInUser();if(d==null)throw Error("Can't access Link Bill Expensedetail page without signing in...");if(s==null)throw Error("Invalid Schedule Detail Id");const o=h((g=>Se(g,a))),m=o.selectedJELinkRowIndex,I=h((g=>ne(g,i.companyId))),p=dt(o.updateStatus.fetchState);A.useEffect((()=>{p==="In-Progress"&&o.updateStatus.fetchState==="Completed"&&t("..",{relative:"path"})}),[p,o.updateStatus.fetchState]),A.useEffect((()=>{o.fetchState==="Not-Started"&&t("..",{relative:"path"})}),[]),A.useEffect((()=>{o.selectedJEAccruedSchedule!=null&&o.selectedJELinkRowIndex!=null||t("..",{relative:"path"})}),[o.selectedJEAccruedSchedule,o.selectedJELinkRowIndex]);const C=o.linkBillExpenseView.fetchState==="Completed";return E.jsx(E.Fragment,{children:o.linkBillExpenseView.fetchState==="In-Progress"?E.jsx(it,{fetchState:o.linkBillExpenseView.fetchState}):o.selectedJEAccruedSchedule!=null&&m!=null?E.jsxs(E.Fragment,{children:[C===!0?E.jsx(ue,{analytics:N,onLoad:()=>{yt(o,a,I)}}):null,E.jsx(gt,{signedInUser:d,attachmentEndPoint:`${ut}/vendor_attachments`,setShouldNavigateBack:e,scheduleVendorId:o.selectedJEAccruedSchedule.vendor.id??"",location:c,tenantEmailDomain:l,scheduleAccruedDetailsView:o,saveFetchState:o.updateStatus.fetchState,scheduleTab:a,navigate:t,analytics:N,controllerUserDetails:I,saveStatus:o.updateStatus.fetchState,jeAccruedSchedule:o.selectedJEAccruedSchedule,localData:o.scheduleAccruedDetailsLocalData.jeScheduleDetails[m]})]}):null})},Ne=e=>{const t=Dt.dateFormat.analytics.YYYYDashMMDashDDFormat;return{scheduleCreateDate:e.createTime.format(t)??null,scheduleMonthlyAmount:e.recurringAmount??null,startingBalance:e.otherAttributes.startingBalance??null,scheduleAccountCategory:e.jeCredit.account?.accountName??null,description:e.memo,runningBalance:e.balanceAsOfToday??null,currentBalance:e.balanceAsOfToday??null,currentStatus:e.status.label,period:e.period??null,startMonth:e.startDate?.format(t)??null,endMonth:e.endDate?.format(t)??null}},yt=(e,t,c)=>{const s=e.selectedJEAccruedSchedule,l=e.selectedJELinkRowIndex;let n;l!=null&&s!=null&&(n=s.scheduledJournalEntry[l]);const{transactions:i}=e.linkBillExpenseView,a=i.some((m=>m.isRecommendedTransaction===!0)),d=se(c.controllers),o=le(c.controllerUserIds);s!=null&&N.trackScheduleAccruedDetailsJournalEntryLinkedLoaded({scheduleType:t,schedule:{...Ne(s)},scheduleExpenseCategoryAndClass:{expenseCategory:s.jeDebit.account?.accountName??null,expenseClass:s.jeDebit.accountingClass?.className??null},journalEntryDetails:{wasRecommendationAvailable:a,journalEntryPostingStatus:n?.status.label??""},vendorName:s.vendor.name??null,controllerEmails:d,controllerUserIds:o})};function ke({jeScheduleId:e,scheduleKey:t,scheduleType:c,onDecided:s}){const l=H(),{ignoreStatusById:n,revertStatusById:i}=h((I=>ce(I).jeSchedules)),a=A.useRef(void 0),d=t==null||a.current==null?void 0:a.current==="ignore"?n[t]?.fetchState:i[t]?.fetchState,o=A.useRef(!1),m=A.useRef(s);return m.current=s,A.useEffect((()=>{o.current&&d==="Completed"&&(o.current=!1,m.current())}),[d]),{onScheduleDecision:A.useCallback(((I,p,C)=>{if(t!=null){if(I==="ignore")return(function(g){return Ze.includes(g)})(p)?(o.current=!0,a.current="ignore",void l(ze(t,c,p,C))):void 0;e!=null&&(function(g){return Xe.includes(g)})(p)&&(o.current=!0,a.current="revert",l(qe(e,t,c,p,C)))}}),[l,e,t,c]),scheduleDecisionStatus:d}}const Et=re.div`
|
|
10
10
|
display: flex;
|
|
11
11
|
min-height: 100%;
|
|
12
12
|
width: 100%;
|
|
@@ -14,7 +14,7 @@ import{j as y}from"./liveblocks-e6rGc1UF.js";import{a as A}from"./sentry-DsyKtMW
|
|
|
14
14
|
flex-direction: column;
|
|
15
15
|
align-items: center;
|
|
16
16
|
background-color: ${e=>e.theme.colors.grey4};
|
|
17
|
-
`,
|
|
17
|
+
`,kt=te((function(e){const t=K(e),c=e.entityAutoCompleteState.autoCompleteText.common,s=De(e,"common");return{tenantName:t.companyName,vendorSearchAutoCompleteData:{autoCompleteText:c,entityAutoCompleteView:s}}}),(function(e,t){const{navigate:c,location:s}=t,l="accrued_expenses";return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const n=de(s.state?.pathnameStackToGoBack);n.poppedPathname==null?c("../schedules/accrued_expenses"):c(n.poppedPathname,{state:{pathnameStackToGoBack:n.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:n=>{t.setShouldNavigateBack(!0),e(ve(l,n))},onDelete:n=>{e(lt(l,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(n,i)=>{n.trim().length>=2?e(ge({searchString:n,entityType:i,searchOrigin:"common"})):n.trim().length===0&&e(W("common"))},onCancelAutoComplete:()=>{e(W("common"))}},onEditAmount:(n,i)=>{e(st(l,n,i))},onJELinkClick:n=>{e(nt({selectedJELinkRowIndex:n})),c("./edit_link")},onCancelAccrual:(n,i,a)=>{e(at(n,i,a))},onTransactionClick:n=>{const i=`${M(n,t.tenantEmailDomain)}`,a=V(s.state?.pathnameStackToGoBack,s.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewPostedJE:n=>{const i=`${M(n,t.tenantEmailDomain)}`,a=V(s.state?.pathnameStackToGoBack,s.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewRecordedJE:n=>{const i=`${M(n,t.tenantEmailDomain)}`,a=V(s.state?.pathnameStackToGoBack,s.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewBillExpense:n=>{const i=`${M(n,t.tenantEmailDomain)}`,a=V(s.state?.pathnameStackToGoBack,s.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onDetailPageChange:(n,i,a)=>{const{scheduleDetailsAccruedExpensesSection:d}=n,{amount:o,memo:m,months:I,scheduleAccruedExpenseCategory:p,scheduleClass:C,scheduleExpenseCategory:g,startDate:f,vendor:u}=d,r=C.selectedOption!=null?t.classList.find((B=>B.classId===C.selectedOption)):void 0,v=g.selectedOption!=null?t.accountList.find((B=>B.qboId===g.selectedOption)):void 0,D=p.selectedOption!=null?t.accruedAccountList.find((B=>B.qboId===p.selectedOption)):void 0,w=I?.selectedOption;e(et({scheduleType:l,localData:i,selectedJeScheduleDetailId:t.scheduleDetailId})),a!==!1||t.scheduleDetailId!=null||v?.accountId==null||t.isAccountingClassesEnabled!==!1&&r?.classId==null||D==null||u.selectedOption==null||m==null||o==null&&o==0||f==null||w==null||e(tt({scheduleType:l}))}}}))(ht),Ut=({shouldNavigateBack:e,setShouldNavigateBack:t,isRenderedInPanel:c=!1,scheduleDetailIdOverride:s,onPanelCloseAfterDecision:l,onPanelNavigateBack:n}={})=>{const[i,a]=A.useState(!1),d=e??i,o=t??a,m=Q(),I=ee(),p=H(),C=Ee(),{tenantEmailDomain:g}=G(),[f,u]=A.useState(!1);if(g==null)throw new Error("Can't access this page without a tenantEmailDomain");const{scheduleDetailId:r}=G(),v=s??r;let D;v!=="new"&&(D=v);const w=Ct(v),B=h((L=>L.scheduleAccruedDetailState.selectedJEAccruedScheduleKey)),b="accrued_expenses",k=h((L=>Se(L,"accrued_expenses"))),J=h((L=>fe(L))),j=h((L=>L.classListState.fetchState)),x=h((L=>ae(L))),_=J!=="Completed"||j!=="Completed";A.useEffect((()=>{f===!1&&_?(p(He(b,D)),u(!0)):_===!1&&f===!1&&v!=="new"&&(p(Qe(b,v)),u(!0))}),[f]);const P=h((L=>K(L))),T=h((L=>ne(L,P.companyId))),O=I.state?.message==="expenseAutomation",Y=h((L=>ce(L).selectedPeriod)),U=c||O,{onScheduleDecision:z,scheduleDecisionStatus:q}=ke({jeScheduleId:k.selectedJEAccruedSchedule?.jeScheduleId,scheduleKey:k.selectedJEAccruedSchedule?.jeAccruedScheduleKey,scheduleType:b,onDecided:()=>{if(l==null)if(O!==!0)m("../schedules/accrued_expenses");else{const{month:L,year:Pe}=Y;m(`../../month_end_close_checks/review/je_schedules/${L}-${Pe}`)}else l()}}),F=k.fetchState,$=k.allAccountList,Z=k.allClassList,y=k.allAccruedAccountList,S=k.scheduleAccruedDetailsLocalData;if(w!==!0||k.fetchState==="Error")return E.jsx(X,{});const R=F==="Completed"&&f===!0,Oe=k.selectedJEAccruedSchedule!=null;return F==="Completed"||F==="Not-Started"||c===!0&&Oe?E.jsxs(Et,{children:[R===!0?E.jsx(ue,{analytics:N,onLoad:()=>{vt(k,b,T)}}):null,E.jsx(kt,{onScheduleDecision:U?z:void 0,scheduleDecisionStatus:q,isRenderedInPanel:c,onPanelNavigateBack:n,setShouldNavigateBack:o,scheduleAccruedDetailsView:k,location:I,navigate:m,classList:Z,accountList:$,shouldNavigateBack:d,accruedAccountList:y,scheduleLocalData:S,selectedJEScheduleKey:B,scheduleDetailId:D,selectedScheduledJournalEntries:k.selectedJEAccruedSchedule?.scheduledJournalEntry??[],themeState:C,tenantEmailDomain:g,analytics:N,controllerUserDetails:T,isAccountingClassesEnabled:x,status:k.selectedJEAccruedSchedule?.status.code})]}):E.jsx(ie,{})},Ct=e=>e!=null,vt=(e,t,c)=>{const s=e.selectedJEAccruedSchedule,l=se(c.controllers),n=le(c.controllerUserIds);s!=null&&N.trackScheduleAccruedDetailsLoaded({scheduleType:t,scheduleExpenseCategoryAndClass:{expenseCategory:s.jeDebit.account?.accountName??null,expenseClass:s.jeDebit.accountingClass?.className??null},schedule:{...Ne(s)},vendorName:s.vendor.name??null,controllerEmails:l,controllerUserIds:n})},At=re.div`
|
|
18
18
|
display: flex;
|
|
19
19
|
min-height: 100%;
|
|
20
20
|
width: 100%;
|
|
@@ -22,7 +22,7 @@ import{j as y}from"./liveblocks-e6rGc1UF.js";import{a as A}from"./sentry-DsyKtMW
|
|
|
22
22
|
flex-direction: column;
|
|
23
23
|
align-items: center;
|
|
24
24
|
background-color: ${e=>e.theme.colors.grey4};
|
|
25
|
-
`,he=
|
|
25
|
+
`,he=ye.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,It=te((function(e){const t=K(e),c=oe(e,"fixed_assets");return{tenantName:t.companyName,scheduleDetailsView:c}}),(function(e,t){const{navigate:c,location:s,vendorSearchAutoCompleteData:l,selectedScheduledJournalEntries:n}=t,i="fixed_assets",a=n.flatMap((d=>d.error)).filter((d=>!!d))??[];return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const d=de(t.location.state?.pathnameStackToGoBack);d.poppedPathname==null?c("../schedules/fixed_assets"):t.navigate(d.poppedPathname,{state:{pathnameStackToGoBack:d.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:d=>{e(_e(i,d,a.length>0))},onDelete:d=>{e(je(i,d))},onMarkAsComplete:()=>{t.selectedJEScheduleKey!=null&&e(Je(i,t.selectedJEScheduleKey))},onEditAmount:(d,o)=>{e(be(i,d,o))},onJELinkClick:d=>{e(we({selectedJELinkRowIndex:d})),c("./edit_link")},onTransactionClick:d=>{const o=`${M(d,t.tenantEmailDomain)}`,m=V(s.state?.pathnameStackToGoBack,s.pathname);c(o,{state:{pathnameStackToGoBack:m,message:"comingFromScheduleDetailsFixedAssets"}})},onViewLinkedJE:d=>{const o=`${M(d,t.tenantEmailDomain)}`,m=V(s.state?.pathnameStackToGoBack,s.pathname);c(o,{state:{pathnameStackToGoBack:m}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(d,o)=>{d.trim().length>=2?e(ge({searchString:d,entityType:o,searchOrigin:"common"})):d.trim().length===0&&e(W("common"))},onCancelAutoComplete:()=>{e(W("common"))}},onDetailPageChange:(d,o)=>{const{scheduleDetailsFixedAssetsSection:m,scheduleDetailsListSection:I}=d,{scheduleClass:p,scheduleExpenseCategory:C,accumulatedDepreciationCategory:g,assetId:f,months:u,startDate:r,postingDate:v,vendor:D}=m,w=l.entityAutoCompleteView.vendor.length>0?l.entityAutoCompleteView.vendor.find((T=>T.id===D?.selectedOption)):void 0,B={id:w?.zeniId??D?.selectedOption??"",name:w?.name??D?.defaultOptions.find((T=>T.value===D?.selectedOption))?.label??"",logo:w?.logo},b=p.selectedOption!=null?t.classList.find((T=>T.classId===p.selectedOption)):void 0,k=C.selectedOption!=null?t.accountList.find((T=>T.qboId===C.selectedOption)):void 0,J=g.selectedOption!=null?t.depAccountList.find((T=>T.qboId===g.selectedOption)):void 0,j=u?.selectedOption,x=I.map(((T,O)=>({...t.scheduleLocalData.jeScheduleDetails[O],amount:{...t.scheduleLocalData.jeScheduleDetails[O].amount,amount:T.amount}}))),_=v.type==="day"?v.dayOfMonth?v.dayOfMonth:1:void 0,P=v.type==="lastDayOfMonth"||void 0;e(Be({scheduleType:i,localData:{selectedAccount:k?.accountId,selectedClass:b?.classId,selectedAccumulatedDepreciationCategory:J?.accountId,selectedDate:r,selectedMonths:j,assetId:f,jeScheduleDetails:x,lastDayOfMonth:P,selectedDayOfMonth:_,selectedVendor:B},selectedJeScheduleDetailId:t.scheduleDetailId})),o!==!1||J?.accountId==null||t.scheduleDetailId!=null&&t.status!=="draft"&&t.status!=="marked_as_completed"||k?.accountId==null||t.isAccountingClassesEnabled!==!1&&b?.classId==null||r==null||j==null||P!==!0&&_==null||e(Le({scheduleType:i}))}}}))(mt),Wt=({isRenderedInPanel:e=!1,scheduleDetailIdOverride:t,onPanelCloseAfterDecision:c,onPanelNavigateBack:s}={})=>{const l=Q(),n=ee(),i=H(),a=Ee(),{tenantEmailDomain:d}=G(),[o,m]=A.useState(!1),{scheduleDetailId:I}=G(),p=t??I,C=n.state?.message==="expenseAutomation",g=xt(p),f=h((y=>y.scheduleDetailState.selectedJEScheduleKey));A.useEffect((()=>{f!=null&&f.length!==0||p!=="new"||l("../schedules/fixed_assets")}),[f,p]);const u="fixed_assets",r=h((y=>oe(y,u))),v=h((y=>y.entityAutoCompleteState.autoCompleteText.common)),D=h((y=>De(y,"common"))),w=h((y=>fe(y))),B=h((y=>y.classListState.fetchState)),b=h((y=>ae(y))),k=h((y=>ce(y).selectedPeriod)),J=w!=="Completed"||B!=="Completed";A.useEffect((()=>{o===!1&&J?(i(Ae(u,F,!0)),m(!0)):J===!1&&o===!1&&(i(Ie(u,p==="new"?void 0:p,!0)),m(!0))}),[o]),A.useEffect((()=>{if(r.markAsCompleteStatus.fetchState==="Completed")if(i(xe()),C===!0){const{month:y,year:S}=k;l(`../../month_end_close_checks/review/je_schedules/${y}-${S}`)}else l("../schedules/fixed_assets")}),[r.markAsCompleteStatus.fetchState]);const j=h((y=>K(y))),x=h((y=>ne(y,j.companyId))),_=e||C,{onScheduleDecision:P,scheduleDecisionStatus:T}=ke({jeScheduleId:r.selectedJEScheduleTransaction?.jeScheduleId,scheduleKey:r.selectedJEScheduleTransaction?.jeScheduleTransactionKey,scheduleType:u,onDecided:()=>{if(c==null)if(C!==!0)l("../schedules/fixed_assets");else{const{month:y,year:S}=k;l(`../../month_end_close_checks/review/je_schedules/${y}-${S}`)}else c()}}),O=r.fetchState,Y=r.allAccountList,U=r.allClassList,z=r.allDepreciationAccountList,q=r.scheduleDetailsLocalData.fixed_assets;let F;if(p!=="new"&&(F=p),g!==!0||r.fetchState==="Error")return E.jsx(X,{});const $=O==="Completed"&&o===!0,Z=r.selectedJEScheduleTransaction!=null;return O==="Completed"||e===!0&&Z?E.jsxs(At,{children:[$===!0?E.jsx(ue,{analytics:N,onLoad:()=>{Bt(r,u,x)}}):null,E.jsx(It,{onScheduleDecision:_?P:void 0,scheduleDecisionStatus:T,isRenderedInPanel:e,onPanelNavigateBack:s,location:n,navigate:l,classList:U,vendorSearchEntityAutoCompleteView:D,vendorSearchAutoCompleteData:{autoCompleteText:v,entityAutoCompleteView:D},expenseAutomationSelectedPeriod:k,usedInExpenseAutomation:C,removeJeScheduleTransactionKey:(y,S)=>{i(Te(y,S))},accountList:Y,depAccountList:z,scheduleLocalData:q,selectedJEScheduleKey:f,scheduleDetailId:F,selectedScheduledJournalEntries:r.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:a,tenantEmailDomain:d,analytics:N,controllerUserDetails:x,isAccountingClassesEnabled:b,status:r.selectedJEScheduleTransaction?.status.code})]}):E.jsx(ie,{})},xt=e=>e!=null,Tt=e=>({transactionDate:e.date.format(he),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),Bt=(e,t,c)=>{const s=e.selectedJEScheduleTransaction?.baseTransaction,l=e.selectedJEScheduleTransaction,n=se(c.controllers),i=le(c.controllerUserIds);var a;s!=null&&l!=null&&N.trackScheduleDetailsLoaded({scheduleType:t,transaction:{...Tt(s)},scheduleExpenseCategoryAndClass:{expenseCategory:l.jeDebit.account?.accountName??null,expenseClass:l.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(a=l,{currentBalance:a.balanceAsOfToday??null,currentStatus:a.status.label,period:a.period??null,startMonth:a.startDate?.format(he)??null,endMonth:a.endDate?.format(he)??null})},vendorName:l.vendor.name??null,fixedAssetsDetails:{accumulatedDepreciationCategory:l.jeCredit.account?.accountName??null,assetId:l.otherAttributes.assetId??null},controllerEmails:n,controllerUserIds:i})},Lt=re.div`
|
|
26
26
|
display: flex;
|
|
27
27
|
min-height: 100%;
|
|
28
28
|
width: 100%;
|
|
@@ -30,4 +30,4 @@ import{j as y}from"./liveblocks-e6rGc1UF.js";import{a as A}from"./sentry-DsyKtMW
|
|
|
30
30
|
flex-direction: column;
|
|
31
31
|
align-items: center;
|
|
32
32
|
background-color: ${e=>e.theme.colors.grey4};
|
|
33
|
-
`,me=
|
|
33
|
+
`,me=ye.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,wt=te((function(e,t){const c=K(e),s=oe(e,t.scheduleTab);return{tenantName:c.companyName,scheduleDetailsView:s}}),(function(e,t){const{navigate:c,location:s,vendorSearchAutoCompleteData:l,selectedScheduledJournalEntries:n}=t,i=n.flatMap((a=>a.error)).filter((a=>!!a))??[];return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const a=de(t.location.state?.pathnameStackToGoBack);a.poppedPathname==null?c("../schedules/prepaid_expenses"):t.navigate(a.poppedPathname,{state:{pathnameStackToGoBack:a.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:a=>{e(_e(t.scheduleTab,a,i.length>0))},onDelete:a=>{e(je(t.scheduleTab,a))},onMarkAsComplete:()=>{t.selectedJEScheduleKey!=null&&e(Je(t.scheduleTab,t.selectedJEScheduleKey))},onEditAmount:(a,d)=>{e(be(t.scheduleTab,a,d))},onJELinkClick:a=>{e(we({selectedJELinkRowIndex:a})),c("./edit_link")},onTransactionClick:a=>{const d=`${M(a,t.tenantEmailDomain)}`,o=V(s.state?.pathnameStackToGoBack,s.pathname);c(d,{state:{pathnameStackToGoBack:o,message:"comingFromScheduleDetails"}})},onViewLinkedJE:a=>{const d=`${M(a,t.tenantEmailDomain)}`,o=V(s.state?.pathnameStackToGoBack,s.pathname);c(d,{state:{pathnameStackToGoBack:o}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(a,d)=>{a.trim().length>=2?e(ge({searchString:a,entityType:d,searchOrigin:"common"})):a.trim().length===0&&e(W("common"))},onCancelAutoComplete:()=>{e(W("common"))}},onDetailPageChange:(a,d)=>{const{scheduleDetailsSection:o,scheduleDetailsListSection:m}=a,{scheduleClass:I,scheduleExpenseCategory:p,months:C,startDate:g,postingDate:f,vendor:u}=o,r=l.entityAutoCompleteView.vendor.length>0?l.entityAutoCompleteView.vendor.find((x=>x.id===u?.selectedOption)):void 0,v={id:r?.zeniId??u?.selectedOption??"",name:r?.name??u?.defaultOptions.find((x=>x.value===u?.selectedOption))?.label??"",logo:r?.logo},D=I.selectedOption!=null?t.classList.find((x=>x.classId===I.selectedOption)):void 0,w=p.selectedOption!=null?t.accountList.find((x=>x.qboId===p.selectedOption)):void 0,B=C?.selectedOption,b=m.map(((x,_)=>({...t.scheduleLocalData.jeScheduleDetails[_],amount:{...t.scheduleLocalData.jeScheduleDetails[_].amount,amount:x.amount}}))),k=f.type==="day"?f.dayOfMonth?f.dayOfMonth:1:void 0,J=f.type==="lastDayOfMonth"||void 0,j={selectedAccount:w?.accountId,selectedClass:D?.classId,selectedDate:g,selectedMonths:B,jeScheduleDetails:b,lastDayOfMonth:J,selectedVendor:v,selectedDayOfMonth:k};e(Be({scheduleType:t.scheduleTab,localData:j,selectedJeScheduleDetailId:t.scheduleDetailId})),d!==!1||t.scheduleDetailId!=null&&t.status!=="draft"&&t.status!=="marked_as_completed"||w?.accountId==null||t.isAccountingClassesEnabled!==!1&&D?.classId==null||g==null||B==null||J!==!0&&k==null||e(Le({scheduleType:t.scheduleTab}))}}}))(pt),Yt=({isRenderedInPanel:e=!1,scheduleDetailIdOverride:t,scheduleTypeOverride:c,onPanelCloseAfterDecision:s,onPanelNavigateBack:l}={})=>{const n=Q(),i=ee(),a=H(),d=Ee(),{tenantEmailDomain:o}=G(),[m,I]=A.useState(!1),p=i.state?.message==="expenseAutomation",{scheduleType:C,scheduleDetailId:g}=G(),f=t??g,u=bt(c??C,f),r=h((S=>S.scheduleDetailState.selectedJEScheduleKey));A.useEffect((()=>{r!=null&&r.length!==0||f!=="new"||n("../schedules/prepaid_expenses")}),[r,f]);const v=c??pe(C)??"prepaid_expenses",D=h((S=>oe(S,v))),w=h((S=>S.entityAutoCompleteState.autoCompleteText.common)),B=h((S=>De(S,"common"))),b=h((S=>fe(S))),k=h((S=>S.classListState.fetchState)),J=h((S=>ae(S))),j=h((S=>ce(S).selectedPeriod)),x=b!=="Completed"||k!=="Completed";A.useEffect((()=>{m===!1&&x?(a(Ae(v,$,!0)),I(!0)):x===!1&&m===!1&&(a(Ie(v,f==="new"?void 0:f,!0)),I(!0))}),[m]),A.useEffect((()=>{if(D.markAsCompleteStatus.fetchState==="Completed")if(a(xe()),p===!0){const{month:S,year:R}=j;n(`../../month_end_close_checks/review/je_schedules/${S}-${R}`)}else n("../schedules/prepaid_expenses")}),[D.markAsCompleteStatus.fetchState]);const _=h((S=>K(S))),P=h((S=>ne(S,_.companyId))),T=e||p,{onScheduleDecision:O,scheduleDecisionStatus:Y}=ke({jeScheduleId:D.selectedJEScheduleTransaction?.jeScheduleId,scheduleKey:D.selectedJEScheduleTransaction?.jeScheduleTransactionKey,scheduleType:v,onDecided:()=>{if(s==null)if(p!==!0)n("../schedules/prepaid_expenses");else{const{month:S,year:R}=j;n(`../../month_end_close_checks/review/je_schedules/${S}-${R}`)}else s()}}),U=D.fetchState,z=D.allAccountList,q=D.allClassList,F=D.scheduleDetailsLocalData;let $;if(f!=="new"&&($=f),u!==!0||D.fetchState==="Error")return E.jsx(X,{});const Z=U==="Completed"&&m===!0,y=D.selectedJEScheduleTransaction!=null;return U==="Completed"||e===!0&&y?E.jsxs(Lt,{children:[Z===!0?E.jsx(ue,{analytics:N,onLoad:()=>{jt(D,v,P)}}):null,E.jsx(wt,{onScheduleDecision:T?O:void 0,scheduleDecisionStatus:Y,isRenderedInPanel:e,onPanelNavigateBack:l,location:i,vendorSearchEntityAutoCompleteView:B,vendorSearchAutoCompleteData:{autoCompleteText:w,entityAutoCompleteView:B},usedInExpenseAutomation:p,removeJeScheduleTransactionKey:(S,R)=>{a(Te(S,R))},expenseAutomationSelectedPeriod:j,navigate:n,classList:q,accountList:z,scheduleLocalData:F[v],selectedJEScheduleKey:r,scheduleDetailId:$,selectedScheduledJournalEntries:D.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:d,tenantEmailDomain:o,scheduleTab:v,analytics:N,controllerUserDetails:P,isAccountingClassesEnabled:J,status:D.selectedJEScheduleTransaction?.status.code})]}):E.jsx(ie,{})},bt=(e,t)=>pe(e)!=null&&t!=null,Jt=e=>({transactionDate:e.date.format(me),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),jt=(e,t,c)=>{const s=e.selectedJEScheduleTransaction?.baseTransaction,l=e.selectedJEScheduleTransaction,n=se(c.controllers),i=le(c.controllerUserIds);var a;s!=null&&l!=null&&N.trackScheduleDetailsLoaded({scheduleType:t,transaction:{...Jt(s)},scheduleExpenseCategoryAndClass:{expenseCategory:l.jeDebit.account?.accountName??null,expenseClass:l.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(a=l,{currentBalance:a.balanceAsOfToday??null,currentStatus:a.status.label,period:a.period??null,startMonth:a.startDate?.format(me)??null,endMonth:a.endDate?.format(me)??null})},vendorName:l.vendor.name??null,controllerEmails:n,controllerUserIds:i})};export{Rt as J,Wt as S,Ut as a,Yt as b,Kt as c};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/NotFoundScreen-
|
|
2
|
-
import{_ as s,bn as hs,fF as ps,d_ as xs,dZ as gs,B1 as Rs,di as js,c8 as Is,gJ as Ts,g9 as As,df as pe,cG as bs,gn as Ds,cy as fs,bE as ys,br as Cs,Ue as vs,v as Os,Uh as Us,bq as Ps,Ui as ws,bK as Fs,bJ as Ls,bt as ks,cu as Vs,Uj as Hs,Uk as Ss,da as Bs,dd as Ns,dc as Ms,cF as Zs,cM as Gs,pS as xe,gi as ge,gY as $s,gk as Re,gL as je,gM as Ie,gl as zs}from"./zeni-epic-state-BO3zdDfL.js";import{j as e}from"./liveblocks-e6rGc1UF.js";import{a as P}from"./sentry-DsyKtMW2.js";import{N as u,u as Ys,h as qs,i as Ws,g as Js,j as G,q as Te,n as Xs,o as n}from"./core-CHD8T-IM.js";import{M as l,E as Ks,u as Qs,z as y,N as et,d as st,Q as tt,f as B,g as nt,X as at,W as ot,L as F,G as Ae,t as _,O as it,P as rt,S as lt,k as ne}from"./index-DKH4PK2B.js";import"./mui-NTaF3UaY.js";import{f as be}from"./analyticsHelper-BEL0ra9X.js";import{t as ut}from"./getLocaleForTenant-D-or0iZO.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},D=new o.Error().stack;D&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[D]="8024086d-24f5-45c6-9b98-c1db8338a382",o._sentryDebugIdIdentifier="sentry-dbid-8024086d-24f5-45c6-9b98-c1db8338a382")}catch{}})();const dt=l((()=>s((()=>import("./NotFoundScreen-CtgFRYZy.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),ct=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/reimbursements`}),mt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/bills`}),De=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/treasury`}),fe=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/checking`}),ye=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/cards`}),C=({showZeniAccountRoute:o,isUserHasBillPayAccess:D,isUserHasReimbursementAccess:N,showTreasuryRoute:r,isTenantBankingOnly:k,showChargeCardRoute:O,tenantEmailDomain:v})=>{if(k===!0){if(o)return e.jsx(fe,{tenantEmailDomain:v});if(r)return e.jsx(De,{tenantEmailDomain:v});if(O)return e.jsx(ye,{tenantEmailDomain:v})}return o?e.jsx(fe,{tenantEmailDomain:v}):r?e.jsx(De,{tenantEmailDomain:v}):O?e.jsx(ye,{tenantEmailDomain:v}):D?e.jsx(mt,{tenantEmailDomain:v}):N?e.jsx(ct,{tenantEmailDomain:v}):e.jsx(dt,{})},_t={dashboard:()=>s((()=>import("./DashboardRoutes-ByHBLKcB.js")),__vite__mapDeps([9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,0,18,19,20,21,22,23,24,8])),bills:()=>s((()=>import("./BillPayRoutes-CUUjBefv.js")),__vite__mapDeps([25,1,2,3,4,5,6,7,26,0,27,11,14,28,15,20,21,22,29,24,30,18,31,32,33,8])),reimbursement:()=>s((()=>import("./ReimbursementRoutes-BmOT-3C-.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,11,14,29,35,32,33,8])),transactions:()=>s((()=>import("./TransactionListRoutes-BTidVr9Z.js")),__vite__mapDeps([36,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,37,8])),settings:()=>s((()=>import("./SettingsRoutes-QcMcR-j3.js")),__vite__mapDeps([38,1,2,3,4,5,6,7,22,39,20,21,40,41,42,43,44,13,45,26,0,18,28,15,19,46,31,32,35,8])),reports:()=>s((()=>import("./ReportsRoutes-CqUKv9Uh.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,0,24,14,15,20,21,22,8])),chargeCards:()=>s((()=>import("./ChargeCardRoutes-DzIBuJeY.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,11,20,21,22,30,28,15,0,18,14,49,26,8])),people:()=>s((()=>import("./PeopleRoutes-DgYtveDU.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,0,11,20,21,22,8])),expenseAutomation:()=>s((()=>import("./ExpenseAutomationRoutes-Ce3IicTe.js")),__vite__mapDeps([51,1,2,3,0,4,5,6,7,11,12,13,14,15,16,52,17,10,53,54,45,29,8])),treasury:()=>s((()=>import("./TreasuryRoutes-CbD79DO8.js")),__vite__mapDeps([55,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,11,14,24,8])),vendors:()=>s((()=>import("./VendorsRoutes-CCYu89Uf.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,26,0,24,53,54,15,11,20,21,22,29,45,8])),zeniAccounts:()=>s((()=>import("./ZeniAccountRoutes-CoRmS3Mc.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,27,26,11,37,8]))},Et=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ae=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},ht=l((()=>s((()=>import("./ReportsRoutes-CqUKv9Uh.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,0,24,14,15,20,21,22,8])))),pt=l((()=>s((()=>import("./AddressRoutes-CisWqyoC.js")),__vite__mapDeps([58,1,2,3,26,4,5,6,7,0,8])))),xt=l((()=>s((()=>import("./PeopleRoutes-DgYtveDU.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,0,11,20,21,22,8])))),gt=l((()=>s((()=>import("./PandLWithForecastRoutes-DAq9XRB1.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,0,24,11,14,15,20,21,22,8])))),Rt=l((()=>s((()=>import("./CustomerOnboardingRoutes-CjmJGGJm.js")),__vite__mapDeps([60,1,2,3,26,4,5,6,7,0,40,41,42,43,44,13,46,49,8])))),jt=l((()=>s((()=>import("./VendorsRoutes-CCYu89Uf.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,26,0,24,53,54,15,11,20,21,22,29,45,8])))),It=l((()=>s((()=>import("./TransactionDetailRoutes-D99Yv6kv.js")),__vite__mapDeps([61,1,2,3,0,4,5,6,7,12,11,13,14,15,16,8])))),Ce=l((()=>s((()=>import("./EntityDetailRoutes-BuN3sXNp.js")),__vite__mapDeps([62,1,2,3,4,5,6,7,13,10,11,12,14,15,16,17,8])))),Tt=l((()=>s((()=>import("./DashboardRoutes-ByHBLKcB.js")),__vite__mapDeps([9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,0,18,19,20,21,22,23,24,8])))),ve=l((()=>s((()=>import("./BillPayRoutes-CUUjBefv.js")),__vite__mapDeps([25,1,2,3,4,5,6,7,26,0,27,11,14,28,15,20,21,22,29,24,30,18,31,32,33,8])))),At=l((()=>s((()=>import("./SettingsRoutes-QcMcR-j3.js")),__vite__mapDeps([38,1,2,3,4,5,6,7,22,39,20,21,40,41,42,43,44,13,45,26,0,18,28,15,19,46,31,32,35,8])))),bt=l((()=>s((()=>import("./InvoicingRoutes-IQsFojD0.js")),__vite__mapDeps([63,1,2,3,4,5,6,7,26,0,20,21,22,40,41,42,43,44,13,8])))),Oe=l((()=>s((()=>import("./ReimbursementRoutes-BmOT-3C-.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,11,14,29,35,32,33,8])))),Dt=l((()=>s((()=>import("./ZeniAccountRoutes-CoRmS3Mc.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,27,26,11,37,8])))),ft=l((()=>s((()=>import("./TreasuryRoutes-CbD79DO8.js")),__vite__mapDeps([55,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,11,14,24,8])))),yt=l((()=>s((()=>import("./TransactionListRoutes-BTidVr9Z.js")),__vite__mapDeps([36,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,37,8])))),Ct=l((()=>s((()=>import("./ChargeCardRoutes-DzIBuJeY.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,11,20,21,22,30,28,15,0,18,14,49,26,8])))),vt=l((()=>s((()=>import("./NotificationRoutes-DICT3yoM.js")),__vite__mapDeps([64,1,2,3,0,4,5,6,7,11,22,8])))),Ot=l((()=>s((()=>import("./PerformanceRoutes-B6iTINLg.js")),__vite__mapDeps([65,1,2,3,0,4,5,6,7,11,20,21,22,8])))),Ut=l((()=>s((()=>import("./ExpenseAutomationRoutes-Ce3IicTe.js")),__vite__mapDeps([51,1,2,3,0,4,5,6,7,11,12,13,14,15,16,52,17,10,53,54,45,29,8])))),Pt=l((()=>s((()=>import("./ActualMatchingMatchDetailScreen-CT_TfQgQ.js")),__vite__mapDeps([66,1,2,3,4,5,6,7,52,17,13,15,0,8])))),wt=l((()=>s((()=>import("./RewardsRoutes-D5CR9NnI.js")),__vite__mapDeps([67,1,2,3,4,5,6,7,0,8])))),Ft=l((()=>s((()=>import("./TaskRoutes-BuzkCbPW.js")),__vite__mapDeps([68,1,2,3,0,4,5,6,7,14,20,21,22,69,11,70,8])))),Lt=l((()=>s((()=>import("./AiCfoScreen-BXw0LDjo.js")),__vite__mapDeps([71,1,2,3,4,5,6,7,23,54,15,70,8])))),Ue=l((()=>s((()=>import("./CardsAiCfoScreen-Cx5KkOYw.js")),__vite__mapDeps([72,1,2,3,4,5,6,7,8])))),b=l((()=>s((()=>import("./NotFoundScreen-CtgFRYZy.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),kt=l((()=>s((()=>import("./TaskListScreen-C2urPjKT.js").then((o=>o.f))),__vite__mapDeps([69,1,2,3,4,5,6,7,11,20,21,22,70,8])))),Vt=({isDashboardAccess:o,showZeniAccountRoute:D,isUserHasBillPayAccess:N,isUserHasReimbursementAccess:r,showTreasuryRoute:k,isTenantBankingOnly:O,isTenantCardsOnly:v,showChargeCardRoute:V})=>{if(O===!0){if(D)return e.jsx(u,{to:"checking"});if(k)return e.jsx(u,{to:"treasury"});if(V)return e.jsx(u,{to:"cards"})}return v===!0&&V?e.jsx(u,{to:"cards"}):o?e.jsx(u,{to:"dashboard"}):D?e.jsx(u,{to:"checking"}):k?e.jsx(u,{to:"treasury"}):V?e.jsx(u,{to:"cards"}):N?e.jsx(u,{to:"bills"}):r?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},Pe=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/dashboard`}),zt=Object.freeze(Object.defineProperty({__proto__:null,default:function({setTenantEmailDomain:o}){const D=Ys(),N=qs(),{tenantEmailDomain:r}=Ws(),k=Ks().mode,{setLoading:O,clearAllLoading:v,clearLoading:V}=Qs(),f=y.getSignedInUserTenant(r)?.tenantId,I=y.getSignedInUser(),J=hs(I),$=Js(),[L,we]=P.useState(!1),i=G((a=>ps(a))),{useFeatureGate:H}=et(),M=st(),X=tt(),Fe=!!i.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=i.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:ke}=H(B.isChargeCardFeatureEnabled),{isFeatureEnabled:oe}=H(B.isDebitCardFeatureEnabled),T=G((a=>a.tenantState.fetchState)),p=G((a=>a.tenantState.activeTenantFetchState.fetchState)),E=p==="Completed"||T==="Completed"?xs(oe,i):void 0,K=p==="Completed"||T==="Completed"?gs(i):void 0,ie=p==="Completed"||T==="Completed"?Rs(i)&&!js(i):void 0,Ve=nt(i,ke,oe),{isCardsHidden:He}=at(i?.tenantId),Se=!Ve||!!He,{isFeatureEnabled:Be}=H(B.isSettingsFeatureEnabled),{isFeatureEnabled:Q}=H(B.isAiCfoFileUploadEnabled),{isFeatureEnabled:Ne}=H(B.isInvoicingFeatureEnabled??"is_invoicing_feature_enabled"),Me=Ne||lt==="DEV",Ze=i?.userRole!=null&&Is(i.userRole),z=G((a=>Ts(a)));if(r!=null){const a=y.getSignedInUserTenant(r);I!=null&&a!=null&&be(I,i,k)}const Z={tenantId:f,userId:I?.userId,sessionId:I?.zeniSessionId},re=As(),h=ot(),Ge=i.company==null||h?.loggedInUserRoleMap!=null&&pe(h.loggedInUserRole),$e=bs(h?.loggedInUserRoleMap),ee=Te("/:tenantEmailDomain/onboarding/*")!==null,ze=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),se=ze?.params.selectedPeriod,Ye=G((a=>Z.tenantId!=null?Ds(a,Z.tenantId):void 0));P.useEffect((()=>{O(F.TENANT_FETCHING),o(r)}),[r]),P.useEffect((()=>{if(se!=null&&f!=null){const a=se.split("-");if(a.length===2){const A=fs(Number(a[0])),c=Number(a[1]),t=ys(`01-${A<10?`0${A}`:A}-${c}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),d=Cs();t.isAfter(d,"month")===!1?D(vs(f,{month:A,year:c})):N(`/${r}/month_end_close_checks/review`)}}}),[se,r,f]),P.useEffect((()=>{L||(we(!0),O(F.TENANT_FETCHING))}),[L,Z,re,I,D,y]),P.useLayoutEffect((()=>{!Os(re,Z)&&y.isSignedIn()&&(O(F.TENANT_FETCHING),(function(a,A,c,t){if(ge(A?.userId,A?.zeniSessionId,a.tenantId),c($s(!0)),c(Re(a.tenantId)),a.tenantId!=null&&_.clearTenant(a.tenantId),a.tenantId!=null){const d=y.getSignedInUserTenantWithId(a.tenantId);t&&Ae.updateAppLocaleID(ut(t)),d?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(d?.tenantEmailDomain)}a.userId!=null?ne.identify(a.userId,{tenant_id:a.tenantId}):ne.resetUserIdentity()})(Z,I,D,Ye))}),[f]),P.useEffect((()=>{y.isSignedIn()&&(O(F.TENANT_FETCHING),(function(a,A,c,t,d,Y,S){if(c==null&&t==null)return void console.warn("There is no current tenant selected!!");const q=t!=null&&d?.zeniSessionId!=null,ms=c==null||c.tenantId!==t,_s=c!=null&&c.excludedResources==null,Es=c!=null&&c.externalConnections==null;if(q&&ms){S(Re(t));const W=y.getSignedInUserTenantWithId(t);W?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(W?.tenantEmailDomain),ge(d?.userId,d?.zeniSessionId,t),_.shouldFetchExcludedResources(t)&&(_.markExcludedResourcesFetchStarted(t),S(je(d.userId,t))),_.shouldFetchConnections(t)&&(_.markConnectionsFetchStarted(t),S(Ie(d.userId,t)))}else q&&_s&&_.shouldFetchExcludedResources(t)&&(_.markExcludedResourcesFetchStarted(t),S(je(d.userId,t))),q&&Es&&_.shouldFetchConnections(t)&&(_.markConnectionsFetchStarted(t),S(Ie(d.userId,t)));if(q){ne.identify(d.userId,{tenant_id:t});const W=t==null||t!=null&&(A==="Completed"||A==="Error");a==="Completed"||A!=="Not-Started"&&A!=="Error"||t==null||!_.shouldFetchActiveTenant(t)||(_.markActiveTenantFetchStarted(t),Y(F.TENANT_FETCHING),S(zs(d.userId,t,d.zeniSessionId))),W&&(a==="Not-Started"||a==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),S(xe(d.userId,d.zeniSessionId)))}})(T,p,i,f,I,O,D))}),[f,p]),P.useEffect((()=>{y.isSignedIn()&&T==="Completed"&&z.tenantsBaseInOrder.length>0&&(V(F.TENANT_FETCHING),y.saveSignedInUserTenants(Us(z.tenantsBaseInOrder)),I!=null&&be(I,i,k,void 0,z.tenantsBaseInOrder))}),[z,T,i,I]),P.useEffect((()=>{p==="In-Progress"&&O(F.TENANT_FETCHING),p!=="Completed"&&p!=="Error"||(p==="Completed"&&f!=null?(v(),_.markActiveTenantFetchCompleted(f)):p==="Error"&&f!=null&&(_.markActiveTenantFetchFailed(f),V(F.TENANT_FETCHING),V(F.TENANT_SWITCHING))),T!=="Completed"&&T!=="Error"||(T==="Completed"?_.markAllTenantsFetchCompleted():T==="Error"&&_.markAllTenantsFetchFailed())}),[p,T,f,L]);const le=P.useRef(!1);P.useEffect((()=>{!le.current&&p==="Completed"&&L&&(le.current=!0,(function(a=Et,A=3e3){setTimeout((()=>{const c=t=>{if(t>=a.length)return;const d=a[t],Y=_t[d];Y!=null?Y().then((()=>ae((()=>c(t+1))))).catch((()=>ae((()=>c(t+1))))):c(t+1)};ae((()=>c(0)))}),A)})())}),[p,L]);const U=i?.userRole!=null&&Ps(i?.userRole),{isFeatureEnabled:qe}=H(B.isReferralFeatureEnabled),{isFeatureEnabled:We}=H(B.isAccrualEnabled),Je=it(),Xe=i?.userRole!=null&&i.userRole.includes("charge_card_user"),Ke=i?.userRole!=null&&i.userRole.includes("charge_card_admin"),w=i?.userRole!=null&&pe(i.userRole),ue=i?.company==null||i.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!U,de=!Se&&!U,Qe=ws(h?.loggedInUserRoleMap),es=i.externalConnections?.accounting[0]?.isValid,ss=i.externalConnections?.fetchState==="Completed",te=i.company?.companyOnboardingInfo.isOnboardingCompleted,ce=i?.company==null||i.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!U,me=ce&&Fs(h?.loggedInUserRoleMap),_e=Fe&&!U,ts=Le&&!U,ns=ue&&Ls(h?.loggedInUserRoleMap),as=de&&ks(h?.loggedInUserRoleMap),os=_e&&Vs(h?.loggedInUserRoleMap),is=Hs(h?.loggedInUserRoleMap),rs=Ss(h?.loggedInUserRoleMap),ls=Bs(h?.loggedInUserRoleMap),us=Ns(h?.loggedInUserRoleMap),ds=Ms(h?.loggedInUserRoleMap),x=Zs(h?.loggedInUserRoleMap),g=Gs(h?.loggedInUserRoleMap),Ee=ue&&x,he=ce&&g,R=_e&&ls,j=ts&&us,m=de&&ds,cs=i.excludedResources?.resources?.find((a=>a.resource==="/invites"))!=null||$e===!0||Qe===!0||is===!0||rs===!0;return y.isSignedIn()?f==null?T==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(I!=null&&T!=="In-Progress"&&D(xe(I.userId,I.zeniSessionId)),null):p!=="In-Progress"&&p!=="Not-Started"||T==="Completed"?(te===!0||J&&!ee)&&ss&&es!==!0&&E===!1&&K===!1&&ie===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!L||ie!==!0||te!==!0||ee||J?!L||te!==!1||ee||J?L&&i?.userRole&&E!=null&&K!=null&&r!=null&&Object.keys(h.loggedInUserRoleMap).length>0?e.jsx(Xs,{children:e.jsxs(n,{element:e.jsx(rt,{}),children:[e.jsx(n,{path:"/",element:e.jsx(Vt,{isDashboardAccess:w,showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,isTenantCardsOnly:K,showChargeCardRoute:m})}),e.jsx(n,{path:"dashboard/*",element:w?e.jsx(Tt,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:r})}),e.jsx(n,{path:"reports/*",element:w?e.jsx(ht,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:r})}),e.jsx(n,{path:"people/*",element:cs||w?e.jsx(xt,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:r})}),e.jsx(n,{path:"forecast/*",element:w?e.jsx(gt,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:r})}),e.jsx(n,{path:"onboarding/*",element:e.jsx(Rt,{})}),e.jsx(n,{path:"transaction/*",element:w&&U===!1||Xe||Ke?e.jsx(It,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:r})}),e.jsx(n,{path:"transactions/*",element:w&&U===!1?e.jsx(yt,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:r})}),e.jsx(n,{path:"customer/*",element:w&&U===!1?e.jsx(Ce,{entityType:"customer"}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,isTenantBankingOnly:E,showTreasuryRoute:j,showChargeCardRoute:m,tenantEmailDomain:r})}),e.jsx(n,{path:"vendor/*",element:w&&U===!1?e.jsx(Ce,{entityType:"vendor"}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:r})}),e.jsx(n,{path:"tasks",element:e.jsx(kt,{})}),e.jsx(n,{path:"tasks/*",element:e.jsx(Ft,{})}),e.jsx(n,{path:"address/*",element:ns||me||os||as?e.jsx(pt,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:r})}),e.jsx(n,{path:"checking/*",element:R?e.jsx(Dt,{}):e.jsx(b,{})}),e.jsx(n,{path:"treasury/*",element:j?e.jsx(ft,{}):e.jsx(b,{})}),e.jsx(n,{path:"performance",element:X===!0?e.jsx(Ot,{}):e.jsx(Pe,{tenantEmailDomain:r})}),e.jsx(n,{path:"month_end_close_checks/review/*",element:X===!0&&U===!1?e.jsx(Ut,{}):e.jsx(Pe,{tenantEmailDomain:r})}),e.jsx(n,{path:"expense-automation/actual-matching/:matchId",element:X===!0&&U===!1&&We===!0&&Je===!0?e.jsx(Pt,{}):e.jsx(b,{})}),e.jsx(n,{path:"notifications/*",element:e.jsx(vt,{})}),e.jsx(n,{path:"vendors/*",element:Ge?e.jsx(jt,{}):e.jsx(b,{})}),e.jsx(n,{path:"bill/*",element:Ee?e.jsx(ve,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:r})}),e.jsx(n,{path:"bills/*",element:Ee?e.jsx(ve,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:r})}),e.jsx(n,{path:"reimbursement/*",element:he?e.jsx(Oe,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:r})}),e.jsx(n,{path:"reimbursements/*",element:he?e.jsx(Oe,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:r})}),e.jsx(n,{path:"settings/*",element:Be?e.jsx(At,{hasAdminLevelAccess:me}):e.jsx(b,{})}),e.jsx(n,{path:"invoicing/*",element:Me&&Ze?e.jsx(bt,{}):e.jsx(b,{})}),e.jsx(n,{path:"cards/ask",element:m&&M?e.jsx(Ue,{isFileUploadEnabled:Q}):e.jsx(b,{})}),e.jsx(n,{path:"cards/ask/:session_id",element:m&&M?e.jsx(Ue,{isFileUploadEnabled:Q}):e.jsx(b,{})}),e.jsx(n,{path:"cards/*",element:m?e.jsx(Ct,{}):e.jsx(b,{})}),e.jsx(n,{path:"rewards/*",element:qe?e.jsx(wt,{}):e.jsx(b,{})}),e.jsx(n,{path:"/ai-cfo",element:M?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(n,{path:"/ai-cfo/",element:M?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(n,{path:"/ai-cfo/:session_id",element:M?e.jsx(Lt,{isFileUploadEnabled:Q}):e.jsx(b,{})}),e.jsx(n,{path:"*",element:e.jsx(b,{})})]})}):null:(o(void 0),e.jsx(u,{to:`/${r}/onboarding`,replace:!0})):(o(void 0),e.jsx(u,{to:`/${r}/onboarding/thankyou`,replace:!0})):null:(console.warn("User logged out!!"),o(void 0),e.jsx(u,{to:"/signin/auth",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}))}},Symbol.toStringTag,{value:"Module"}));export{C as F,zt as S};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/NotFoundScreen-ytl2lDpJ.js","assets/sentry-DSWD_gIh.js","assets/core-Cc7wW2EM.js","assets/zeni-epic-state-BVJjEVAA.js","assets/index-CFXYM6OK.js","assets/mui-C4zFSCiU.js","assets/analytics-S5MhEivL.js","assets/utils-DiIEQ7_h.js","assets/index-BhC2LNQw.css","assets/DashboardRoutes-DiVKBsiD.js","assets/withTransactionSidePanel-CF9KOU3s.js","assets/useAskAiCfoHostNavButtonProps-QQl24-IT.js","assets/TransactionDetailScreen-CeJRenTr.js","assets/decodeURIComponentSafe-DhqIXi_U.js","assets/useInitialThreadRequest-DIgkNFzN.js","assets/routePaths-BvBrBOWH.js","assets/expenseAutomationHelper-iXuIUZiF.js","assets/stripSplatSuffix-kLnY55Qt.js","assets/analyticsHelper-vbAuZJHT.js","assets/CompanyPassportScreen-BQIdqUeH.js","assets/MobileAppDrawer-B_iTAp0X.js","assets/InboxNotificationsProvider-CYNlrTK-.js","assets/useTaskManagerAccess-P-CWGdcX.js","assets/useAiCfoDashboardSuggestedQuestionsChips-CDkZMoxt.js","assets/FeaturePreviewScreen--_B7whPE.js","assets/BillPayRoutes-0Sw-GQIA.js","assets/AddressScreen-rwxaZTG1.js","assets/DomesticWireDetailScreen-sF9fArJp.js","assets/BusinessVerificationPageScreen-D3HFVVs1.js","assets/DrawerScreen-_LTFqCkp.js","assets/SetupPagesScreen-7E5X1hE5.js","assets/BillPayApprovalRoutes-B_lv7T-J.js","assets/ReimbursementApprovalRuleDetailScreen-NNjpXxDw.js","assets/getLocaleForTenant-rFLZBDSf.js","assets/ReimbursementRoutes-VHBLpzUI.js","assets/ReimbursementApprovalRoutes-WuV-IA60.js","assets/TransactionListRoutes-YHpSLzO6.js","assets/ZeniAccountStatementScreen-DbrLHVIs.js","assets/SettingsRoutes-C4j0IBI2.js","assets/AccountMappingScreen-DivKdf2Z.js","assets/QBOConnectionScreen-TwPTSdM4.js","assets/empty-6MFM8UPN.js","assets/index-2QCkbhu2.js","assets/url-DUlo21cY.js","assets/index-D2oCZR3F.js","assets/accountMappingHelper-Gh8rpbjD.js","assets/useEmailConnectResultRefresh-Dd25HleM.js","assets/ReportsRoutes-LNVh_-sv.js","assets/ChargeCardRoutes-GPeivNsL.js","assets/useChargeCardPusherEvents-CXbFOxvL.js","assets/PeopleRoutes-Bnjxv-wy.js","assets/ExpenseAutomationRoutes-BO6oNRaR.js","assets/useActualMatchingMatchDetail-CF9oxT8n.js","assets/ScheduleDetailsPrepaidExpensesScreen-BtoKhMiB.js","assets/pathToGoBack-C17GqrA7.js","assets/TreasuryRoutes-BjSaj-AP.js","assets/VendorsRoutes-CeQ2Hysa.js","assets/ZeniAccountRoutes-wpK9n9Q7.js","assets/AddressRoutes-BokWmAg8.js","assets/PandLWithForecastRoutes-CEbI4eNj.js","assets/CustomerOnboardingRoutes-C0r1dw1S.js","assets/TransactionDetailRoutes-B0iRCFEi.js","assets/EntityDetailRoutes-4B2Yzc2k.js","assets/InvoicingRoutes-B76qsOVo.js","assets/NotificationRoutes-CHchBCXf.js","assets/PerformanceRoutes-D_c4D-Lq.js","assets/ActualMatchingMatchDetailScreen-BVGeVheO.js","assets/RewardsRoutes-CoqgpEpv.js","assets/TaskRoutes-DiG1t9-7.js","assets/TaskListScreen-lzy6FFpY.js","assets/useTaskManagerPusherEvents-BREP8CYU.js","assets/AiCfoScreen-bINGDW9e.js","assets/CardsAiCfoScreen-oXR70NHe.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as s,bn as hs,fF as ps,d_ as xs,dZ as gs,B1 as Rs,di as js,c8 as Is,gJ as Ts,g9 as As,df as pe,cG as fs,gn as bs,cy as Ds,bE as ys,br as Cs,Ue as vs,v as Us,Uh as Os,bq as Ps,Ui as ws,bK as Fs,bJ as Ls,bt as ks,cu as Vs,Uj as Hs,Uk as Ss,da as Bs,dd as Ns,dc as Ms,cF as Zs,cM as Gs,pS as xe,gi as ge,gY as $s,gk as Re,gL as je,gM as Ie,gl as zs}from"./zeni-epic-state-BVJjEVAA.js";import{j as e}from"./liveblocks-CgHUgeBY.js";import{a as P}from"./sentry-DSWD_gIh.js";import{N as u,u as Ys,h as qs,i as Ws,g as Js,j as G,q as Te,n as Xs,o as n}from"./core-Cc7wW2EM.js";import{M as l,E as Ks,u as Qs,z as y,N as et,d as st,V as tt,f as B,g as nt,X as at,P as ot,L as F,G as Ae,t as _,Q as it,R as rt,S as lt,j as ne}from"./index-CFXYM6OK.js";import"./mui-C4zFSCiU.js";import{f as fe}from"./analyticsHelper-vbAuZJHT.js";import{t as ut}from"./getLocaleForTenant-rFLZBDSf.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},b=new o.Error().stack;b&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[b]="3185506a-23f4-48ad-b9ef-9e04dbfad680",o._sentryDebugIdIdentifier="sentry-dbid-3185506a-23f4-48ad-b9ef-9e04dbfad680")}catch{}})();const dt=l((()=>s((()=>import("./NotFoundScreen-ytl2lDpJ.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),ct=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/reimbursements`}),mt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/bills`}),be=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/treasury`}),De=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/checking`}),ye=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/cards`}),C=({showZeniAccountRoute:o,isUserHasBillPayAccess:b,isUserHasReimbursementAccess:N,showTreasuryRoute:r,isTenantBankingOnly:k,showChargeCardRoute:U,tenantEmailDomain:v})=>{if(k===!0){if(o)return e.jsx(De,{tenantEmailDomain:v});if(r)return e.jsx(be,{tenantEmailDomain:v});if(U)return e.jsx(ye,{tenantEmailDomain:v})}return o?e.jsx(De,{tenantEmailDomain:v}):r?e.jsx(be,{tenantEmailDomain:v}):U?e.jsx(ye,{tenantEmailDomain:v}):b?e.jsx(mt,{tenantEmailDomain:v}):N?e.jsx(ct,{tenantEmailDomain:v}):e.jsx(dt,{})},_t={dashboard:()=>s((()=>import("./DashboardRoutes-DiVKBsiD.js")),__vite__mapDeps([9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,0,18,19,20,21,22,23,24,8])),bills:()=>s((()=>import("./BillPayRoutes-0Sw-GQIA.js")),__vite__mapDeps([25,1,2,3,4,5,6,7,26,0,27,11,14,28,15,20,21,22,29,24,30,18,31,32,33,8])),reimbursement:()=>s((()=>import("./ReimbursementRoutes-VHBLpzUI.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,11,14,29,35,32,33,8])),transactions:()=>s((()=>import("./TransactionListRoutes-YHpSLzO6.js")),__vite__mapDeps([36,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,37,8])),settings:()=>s((()=>import("./SettingsRoutes-C4j0IBI2.js")),__vite__mapDeps([38,1,2,3,4,5,6,7,22,39,20,21,40,41,42,43,44,13,45,26,0,18,28,15,19,46,31,32,35,8])),reports:()=>s((()=>import("./ReportsRoutes-LNVh_-sv.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,0,24,14,15,20,21,22,8])),chargeCards:()=>s((()=>import("./ChargeCardRoutes-GPeivNsL.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,11,20,21,22,30,28,15,0,18,14,49,26,8])),people:()=>s((()=>import("./PeopleRoutes-Bnjxv-wy.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,0,11,20,21,22,8])),expenseAutomation:()=>s((()=>import("./ExpenseAutomationRoutes-BO6oNRaR.js")),__vite__mapDeps([51,1,2,3,0,4,5,6,7,11,12,13,14,15,16,52,17,10,53,54,45,29,8])),treasury:()=>s((()=>import("./TreasuryRoutes-BjSaj-AP.js")),__vite__mapDeps([55,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,11,14,24,8])),vendors:()=>s((()=>import("./VendorsRoutes-CeQ2Hysa.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,26,0,24,53,54,15,11,20,21,22,29,45,8])),zeniAccounts:()=>s((()=>import("./ZeniAccountRoutes-wpK9n9Q7.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,27,26,11,37,8]))},Et=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ae=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},ht=l((()=>s((()=>import("./ReportsRoutes-LNVh_-sv.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,0,24,14,15,20,21,22,8])))),pt=l((()=>s((()=>import("./AddressRoutes-BokWmAg8.js")),__vite__mapDeps([58,1,2,3,26,4,5,6,7,0,8])))),xt=l((()=>s((()=>import("./PeopleRoutes-Bnjxv-wy.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,0,11,20,21,22,8])))),gt=l((()=>s((()=>import("./PandLWithForecastRoutes-CEbI4eNj.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,0,24,11,14,15,20,21,22,8])))),Rt=l((()=>s((()=>import("./CustomerOnboardingRoutes-C0r1dw1S.js")),__vite__mapDeps([60,1,2,3,26,4,5,6,7,0,40,41,42,43,44,13,46,49,8])))),jt=l((()=>s((()=>import("./VendorsRoutes-CeQ2Hysa.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,26,0,24,53,54,15,11,20,21,22,29,45,8])))),It=l((()=>s((()=>import("./TransactionDetailRoutes-B0iRCFEi.js")),__vite__mapDeps([61,1,2,3,0,4,5,6,7,12,11,13,14,15,16,8])))),Ce=l((()=>s((()=>import("./EntityDetailRoutes-4B2Yzc2k.js")),__vite__mapDeps([62,1,2,3,4,5,6,7,13,10,11,12,14,15,16,17,8])))),Tt=l((()=>s((()=>import("./DashboardRoutes-DiVKBsiD.js")),__vite__mapDeps([9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,0,18,19,20,21,22,23,24,8])))),ve=l((()=>s((()=>import("./BillPayRoutes-0Sw-GQIA.js")),__vite__mapDeps([25,1,2,3,4,5,6,7,26,0,27,11,14,28,15,20,21,22,29,24,30,18,31,32,33,8])))),At=l((()=>s((()=>import("./SettingsRoutes-C4j0IBI2.js")),__vite__mapDeps([38,1,2,3,4,5,6,7,22,39,20,21,40,41,42,43,44,13,45,26,0,18,28,15,19,46,31,32,35,8])))),ft=l((()=>s((()=>import("./InvoicingRoutes-B76qsOVo.js")),__vite__mapDeps([63,1,2,3,4,5,6,7,26,0,20,21,22,40,41,42,43,44,13,8])))),Ue=l((()=>s((()=>import("./ReimbursementRoutes-VHBLpzUI.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,11,14,29,35,32,33,8])))),bt=l((()=>s((()=>import("./ZeniAccountRoutes-wpK9n9Q7.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,24,27,26,11,37,8])))),Dt=l((()=>s((()=>import("./TreasuryRoutes-BjSaj-AP.js")),__vite__mapDeps([55,1,2,3,4,5,6,7,0,30,28,15,20,21,22,18,11,14,24,8])))),yt=l((()=>s((()=>import("./TransactionListRoutes-YHpSLzO6.js")),__vite__mapDeps([36,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,37,8])))),Ct=l((()=>s((()=>import("./ChargeCardRoutes-GPeivNsL.js")),__vite__mapDeps([48,1,2,3,4,5,6,7,11,20,21,22,30,28,15,0,18,14,49,26,8])))),vt=l((()=>s((()=>import("./NotificationRoutes-CHchBCXf.js")),__vite__mapDeps([64,1,2,3,0,4,5,6,7,11,22,8])))),Ut=l((()=>s((()=>import("./PerformanceRoutes-D_c4D-Lq.js")),__vite__mapDeps([65,1,2,3,0,4,5,6,7,11,20,21,22,8])))),Ot=l((()=>s((()=>import("./ExpenseAutomationRoutes-BO6oNRaR.js")),__vite__mapDeps([51,1,2,3,0,4,5,6,7,11,12,13,14,15,16,52,17,10,53,54,45,29,8])))),Pt=l((()=>s((()=>import("./ActualMatchingMatchDetailScreen-BVGeVheO.js")),__vite__mapDeps([66,1,2,3,4,5,6,7,52,17,13,15,0,8])))),wt=l((()=>s((()=>import("./RewardsRoutes-CoqgpEpv.js")),__vite__mapDeps([67,1,2,3,4,5,6,7,0,8])))),Ft=l((()=>s((()=>import("./TaskRoutes-DiG1t9-7.js")),__vite__mapDeps([68,1,2,3,0,4,5,6,7,14,20,21,22,69,11,70,8])))),Lt=l((()=>s((()=>import("./AiCfoScreen-bINGDW9e.js")),__vite__mapDeps([71,1,2,3,4,5,6,7,23,54,15,70,8])))),Oe=l((()=>s((()=>import("./CardsAiCfoScreen-oXR70NHe.js")),__vite__mapDeps([72,1,2,3,4,5,6,7,8])))),f=l((()=>s((()=>import("./NotFoundScreen-ytl2lDpJ.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),kt=l((()=>s((()=>import("./TaskListScreen-lzy6FFpY.js").then((o=>o.f))),__vite__mapDeps([69,1,2,3,4,5,6,7,11,20,21,22,70,8])))),Vt=({isDashboardAccess:o,showZeniAccountRoute:b,isUserHasBillPayAccess:N,isUserHasReimbursementAccess:r,showTreasuryRoute:k,isTenantBankingOnly:U,isTenantCardsOnly:v,showChargeCardRoute:V})=>{if(U===!0){if(b)return e.jsx(u,{to:"checking"});if(k)return e.jsx(u,{to:"treasury"});if(V)return e.jsx(u,{to:"cards"})}return v===!0&&V?e.jsx(u,{to:"cards"}):o?e.jsx(u,{to:"dashboard"}):b?e.jsx(u,{to:"checking"}):k?e.jsx(u,{to:"treasury"}):V?e.jsx(u,{to:"cards"}):N?e.jsx(u,{to:"bills"}):r?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},Pe=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/dashboard`}),zt=Object.freeze(Object.defineProperty({__proto__:null,default:function({setTenantEmailDomain:o}){const b=Ys(),N=qs(),{tenantEmailDomain:r}=Ws(),k=Ks().mode,{setLoading:U,clearAllLoading:v,clearLoading:V}=Qs(),D=y.getSignedInUserTenant(r)?.tenantId,I=y.getSignedInUser(),J=hs(I),$=Js(),[L,we]=P.useState(!1),i=G((a=>ps(a))),{useFeatureGate:H}=et(),M=st(),X=tt(),Fe=!!i.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=i.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:ke}=H(B.isChargeCardFeatureEnabled),{isFeatureEnabled:oe}=H(B.isDebitCardFeatureEnabled),T=G((a=>a.tenantState.fetchState)),p=G((a=>a.tenantState.activeTenantFetchState.fetchState)),E=p==="Completed"||T==="Completed"?xs(oe,i):void 0,K=p==="Completed"||T==="Completed"?gs(i):void 0,ie=p==="Completed"||T==="Completed"?Rs(i)&&!js(i):void 0,Ve=nt(i,ke,oe),{isCardsHidden:He}=at(i?.tenantId),Se=!Ve||!!He,{isFeatureEnabled:Be}=H(B.isSettingsFeatureEnabled),{isFeatureEnabled:Q}=H(B.isAiCfoFileUploadEnabled),{isFeatureEnabled:Ne}=H(B.isInvoicingFeatureEnabled??"is_invoicing_feature_enabled"),Me=Ne||lt==="DEV",Ze=i?.userRole!=null&&Is(i.userRole),z=G((a=>Ts(a)));if(r!=null){const a=y.getSignedInUserTenant(r);I!=null&&a!=null&&fe(I,i,k)}const Z={tenantId:D,userId:I?.userId,sessionId:I?.zeniSessionId},re=As(),h=ot(),Ge=i.company==null||h?.loggedInUserRoleMap!=null&&pe(h.loggedInUserRole),$e=fs(h?.loggedInUserRoleMap),ee=Te("/:tenantEmailDomain/onboarding/*")!==null,ze=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),se=ze?.params.selectedPeriod,Ye=G((a=>Z.tenantId!=null?bs(a,Z.tenantId):void 0));P.useEffect((()=>{U(F.TENANT_FETCHING),o(r)}),[r]),P.useEffect((()=>{if(se!=null&&D!=null){const a=se.split("-");if(a.length===2){const A=Ds(Number(a[0])),c=Number(a[1]),t=ys(`01-${A<10?`0${A}`:A}-${c}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),d=Cs();t.isAfter(d,"month")===!1?b(vs(D,{month:A,year:c})):N(`/${r}/month_end_close_checks/review`)}}}),[se,r,D]),P.useEffect((()=>{L||(we(!0),U(F.TENANT_FETCHING))}),[L,Z,re,I,b,y]),P.useLayoutEffect((()=>{!Us(re,Z)&&y.isSignedIn()&&(U(F.TENANT_FETCHING),(function(a,A,c,t){if(ge(A?.userId,A?.zeniSessionId,a.tenantId),c($s(!0)),c(Re(a.tenantId)),a.tenantId!=null&&_.clearTenant(a.tenantId),a.tenantId!=null){const d=y.getSignedInUserTenantWithId(a.tenantId);t&&Ae.updateAppLocaleID(ut(t)),d?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(d?.tenantEmailDomain)}a.userId!=null?ne.identify(a.userId,{tenant_id:a.tenantId}):ne.resetUserIdentity()})(Z,I,b,Ye))}),[D]),P.useEffect((()=>{y.isSignedIn()&&(U(F.TENANT_FETCHING),(function(a,A,c,t,d,Y,S){if(c==null&&t==null)return void console.warn("There is no current tenant selected!!");const q=t!=null&&d?.zeniSessionId!=null,ms=c==null||c.tenantId!==t,_s=c!=null&&c.excludedResources==null,Es=c!=null&&c.externalConnections==null;if(q&&ms){S(Re(t));const W=y.getSignedInUserTenantWithId(t);W?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(W?.tenantEmailDomain),ge(d?.userId,d?.zeniSessionId,t),_.shouldFetchExcludedResources(t)&&(_.markExcludedResourcesFetchStarted(t),S(je(d.userId,t))),_.shouldFetchConnections(t)&&(_.markConnectionsFetchStarted(t),S(Ie(d.userId,t)))}else q&&_s&&_.shouldFetchExcludedResources(t)&&(_.markExcludedResourcesFetchStarted(t),S(je(d.userId,t))),q&&Es&&_.shouldFetchConnections(t)&&(_.markConnectionsFetchStarted(t),S(Ie(d.userId,t)));if(q){ne.identify(d.userId,{tenant_id:t});const W=t==null||t!=null&&(A==="Completed"||A==="Error");a==="Completed"||A!=="Not-Started"&&A!=="Error"||t==null||!_.shouldFetchActiveTenant(t)||(_.markActiveTenantFetchStarted(t),Y(F.TENANT_FETCHING),S(zs(d.userId,t,d.zeniSessionId))),W&&(a==="Not-Started"||a==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),S(xe(d.userId,d.zeniSessionId)))}})(T,p,i,D,I,U,b))}),[D,p]),P.useEffect((()=>{y.isSignedIn()&&T==="Completed"&&z.tenantsBaseInOrder.length>0&&(V(F.TENANT_FETCHING),y.saveSignedInUserTenants(Os(z.tenantsBaseInOrder)),I!=null&&fe(I,i,k,void 0,z.tenantsBaseInOrder))}),[z,T,i,I]),P.useEffect((()=>{p==="In-Progress"&&U(F.TENANT_FETCHING),p!=="Completed"&&p!=="Error"||(p==="Completed"&&D!=null?(v(),_.markActiveTenantFetchCompleted(D)):p==="Error"&&D!=null&&(_.markActiveTenantFetchFailed(D),V(F.TENANT_FETCHING),V(F.TENANT_SWITCHING))),T!=="Completed"&&T!=="Error"||(T==="Completed"?_.markAllTenantsFetchCompleted():T==="Error"&&_.markAllTenantsFetchFailed())}),[p,T,D,L]);const le=P.useRef(!1);P.useEffect((()=>{!le.current&&p==="Completed"&&L&&(le.current=!0,(function(a=Et,A=3e3){setTimeout((()=>{const c=t=>{if(t>=a.length)return;const d=a[t],Y=_t[d];Y!=null?Y().then((()=>ae((()=>c(t+1))))).catch((()=>ae((()=>c(t+1))))):c(t+1)};ae((()=>c(0)))}),A)})())}),[p,L]);const O=i?.userRole!=null&&Ps(i?.userRole),{isFeatureEnabled:qe}=H(B.isReferralFeatureEnabled),{isFeatureEnabled:We}=H(B.isAccrualEnabled),Je=it(),Xe=i?.userRole!=null&&i.userRole.includes("charge_card_user"),Ke=i?.userRole!=null&&i.userRole.includes("charge_card_admin"),w=i?.userRole!=null&&pe(i.userRole),ue=i?.company==null||i.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!O,de=!Se&&!O,Qe=ws(h?.loggedInUserRoleMap),es=i.externalConnections?.accounting[0]?.isValid,ss=i.externalConnections?.fetchState==="Completed",te=i.company?.companyOnboardingInfo.isOnboardingCompleted,ce=i?.company==null||i.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!O,me=ce&&Fs(h?.loggedInUserRoleMap),_e=Fe&&!O,ts=Le&&!O,ns=ue&&Ls(h?.loggedInUserRoleMap),as=de&&ks(h?.loggedInUserRoleMap),os=_e&&Vs(h?.loggedInUserRoleMap),is=Hs(h?.loggedInUserRoleMap),rs=Ss(h?.loggedInUserRoleMap),ls=Bs(h?.loggedInUserRoleMap),us=Ns(h?.loggedInUserRoleMap),ds=Ms(h?.loggedInUserRoleMap),x=Zs(h?.loggedInUserRoleMap),g=Gs(h?.loggedInUserRoleMap),Ee=ue&&x,he=ce&&g,R=_e&&ls,j=ts&&us,m=de&&ds,cs=i.excludedResources?.resources?.find((a=>a.resource==="/invites"))!=null||$e===!0||Qe===!0||is===!0||rs===!0;return y.isSignedIn()?D==null?T==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(I!=null&&T!=="In-Progress"&&b(xe(I.userId,I.zeniSessionId)),null):p!=="In-Progress"&&p!=="Not-Started"||T==="Completed"?(te===!0||J&&!ee)&&ss&&es!==!0&&E===!1&&K===!1&&ie===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!L||ie!==!0||te!==!0||ee||J?!L||te!==!1||ee||J?L&&i?.userRole&&E!=null&&K!=null&&r!=null&&Object.keys(h.loggedInUserRoleMap).length>0?e.jsx(Xs,{children:e.jsxs(n,{element:e.jsx(rt,{}),children:[e.jsx(n,{path:"/",element:e.jsx(Vt,{isDashboardAccess:w,showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,isTenantCardsOnly:K,showChargeCardRoute:m})}),e.jsx(n,{path:"dashboard/*",element:w?e.jsx(Tt,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:r})}),e.jsx(n,{path:"reports/*",element:w?e.jsx(ht,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:r})}),e.jsx(n,{path:"people/*",element:cs||w?e.jsx(xt,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:r})}),e.jsx(n,{path:"forecast/*",element:w?e.jsx(gt,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:r})}),e.jsx(n,{path:"onboarding/*",element:e.jsx(Rt,{})}),e.jsx(n,{path:"transaction/*",element:w&&O===!1||Xe||Ke?e.jsx(It,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:r})}),e.jsx(n,{path:"transactions/*",element:w&&O===!1?e.jsx(yt,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:r})}),e.jsx(n,{path:"customer/*",element:w&&O===!1?e.jsx(Ce,{entityType:"customer"}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,isTenantBankingOnly:E,showTreasuryRoute:j,showChargeCardRoute:m,tenantEmailDomain:r})}),e.jsx(n,{path:"vendor/*",element:w&&O===!1?e.jsx(Ce,{entityType:"vendor"}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:r})}),e.jsx(n,{path:"tasks",element:e.jsx(kt,{})}),e.jsx(n,{path:"tasks/*",element:e.jsx(Ft,{})}),e.jsx(n,{path:"address/*",element:ns||me||os||as?e.jsx(pt,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:r})}),e.jsx(n,{path:"checking/*",element:R?e.jsx(bt,{}):e.jsx(f,{})}),e.jsx(n,{path:"treasury/*",element:j?e.jsx(Dt,{}):e.jsx(f,{})}),e.jsx(n,{path:"performance",element:X===!0?e.jsx(Ut,{}):e.jsx(Pe,{tenantEmailDomain:r})}),e.jsx(n,{path:"month_end_close_checks/review/*",element:X===!0&&O===!1?e.jsx(Ot,{}):e.jsx(Pe,{tenantEmailDomain:r})}),e.jsx(n,{path:"expense-automation/actual-matching/:matchId",element:X===!0&&O===!1&&We===!0&&Je===!0?e.jsx(Pt,{}):e.jsx(f,{})}),e.jsx(n,{path:"notifications/*",element:e.jsx(vt,{})}),e.jsx(n,{path:"vendors/*",element:Ge?e.jsx(jt,{}):e.jsx(f,{})}),e.jsx(n,{path:"bill/*",element:Ee?e.jsx(ve,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:r})}),e.jsx(n,{path:"bills/*",element:Ee?e.jsx(ve,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:r})}),e.jsx(n,{path:"reimbursement/*",element:he?e.jsx(Ue,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:r})}),e.jsx(n,{path:"reimbursements/*",element:he?e.jsx(Ue,{}):e.jsx(C,{showZeniAccountRoute:R,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:g,showTreasuryRoute:j,isTenantBankingOnly:E,showChargeCardRoute:m,tenantEmailDomain:r})}),e.jsx(n,{path:"settings/*",element:Be?e.jsx(At,{hasAdminLevelAccess:me}):e.jsx(f,{})}),e.jsx(n,{path:"invoicing/*",element:Me&&Ze?e.jsx(ft,{}):e.jsx(f,{})}),e.jsx(n,{path:"cards/ask",element:m&&M?e.jsx(Oe,{isFileUploadEnabled:Q}):e.jsx(f,{})}),e.jsx(n,{path:"cards/ask/:session_id",element:m&&M?e.jsx(Oe,{isFileUploadEnabled:Q}):e.jsx(f,{})}),e.jsx(n,{path:"cards/*",element:m?e.jsx(Ct,{}):e.jsx(f,{})}),e.jsx(n,{path:"rewards/*",element:qe?e.jsx(wt,{}):e.jsx(f,{})}),e.jsx(n,{path:"/ai-cfo",element:M?e.jsx(u,{to:"explore"}):e.jsx(f,{})}),e.jsx(n,{path:"/ai-cfo/",element:M?e.jsx(u,{to:"explore"}):e.jsx(f,{})}),e.jsx(n,{path:"/ai-cfo/:session_id",element:M?e.jsx(Lt,{isFileUploadEnabled:Q}):e.jsx(f,{})}),e.jsx(n,{path:"*",element:e.jsx(f,{})})]})}):null:(o(void 0),e.jsx(u,{to:`/${r}/onboarding`,replace:!0})):(o(void 0),e.jsx(u,{to:`/${r}/onboarding/thankyou`,replace:!0})):null:(console.warn("User logged out!!"),o(void 0),e.jsx(u,{to:"/signin/auth",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}))}},Symbol.toStringTag,{value:"Module"}));export{C as F,zt as S};
|