@zeniai/web-app-ui 5.2.18-dev → 5.2.19-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/AddressRoutes-C8sZ1LMI.js +1 -0
- package/dist/assets/AddressScreen-BIXlTd0k.js +9 -0
- package/dist/assets/AiCfoScreen-BBbfhHPd.js +22 -0
- package/dist/assets/{BillPayApprovalRoutes-DNBT8bBe.js → BillPayApprovalRoutes-Cckj8faG.js} +1 -1
- package/dist/assets/{BillPayRoutes-Ee1gMZDl.js → BillPayRoutes-DoYzm1s_.js} +12 -12
- package/dist/assets/{BusinessVerificationPageScreen-BrCTRscW.js → BusinessVerificationPageScreen-DtwUBmOs.js} +2 -2
- package/dist/assets/CardsAiCfoScreen-DC_ARWEe.js +14 -0
- package/dist/assets/{ChargeCardRoutes-BnvieJVH.js → ChargeCardRoutes-DrlvPNEr.js} +10 -10
- package/dist/assets/CompanyPassportScreen-DSK81yql.js +1 -0
- package/dist/assets/ConnectionAuthScreen-Dt0zrkJk.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-BLWOt3oi.js +1 -0
- package/dist/assets/CustomerOnboardingRoutes-BRWto4FV.js +30 -0
- package/dist/assets/{DashboardRoutes-DzdPS_ou.js → DashboardRoutes-DMxcTWza.js} +4 -4
- package/dist/assets/{DefaultTenantHome-D1Wy6Wl5.js → DefaultTenantHome-BL6j-dU2.js} +1 -1
- package/dist/assets/DomesticWireDetailScreen-CIqjtvpv.js +18 -0
- package/dist/assets/DrawerScreen-CF6jlYli.js +1 -0
- package/dist/assets/EntityDetailRoutes-DsK2unnT.js +1 -0
- package/dist/assets/ExpenseAutomationRoutes-Bh2GJ5eR.js +25 -0
- package/dist/assets/FeaturePreviewScreen-CqdV6Bc4.js +1 -0
- package/dist/assets/HubSpotOAuthCallbackScreen-CkSSYOv5.js +1 -0
- package/dist/assets/MagicLinkRoutes-CUITVdVT.js +72 -0
- package/dist/assets/MagicLinkSignInScreen-Ck9fKk0s.js +12 -0
- package/dist/assets/MobileAppDrawer-N86gBmzN.js +1 -0
- package/dist/assets/NotFoundScreen-B9IlcCjB.js +1 -0
- package/dist/assets/{NotificationRoutes-BuE5Ia0t.js → NotificationRoutes-cS6QWWsP.js} +1 -1
- package/dist/assets/OAuthConsentScreen-8YU26znY.js +1 -0
- package/dist/assets/PandLWithForecastRoutes-UkbQdYTq.js +1 -0
- package/dist/assets/PeopleRoutes-CsD4yHB-.js +22 -0
- package/dist/assets/PerformanceRoutes-NXKZM9JF.js +1 -0
- package/dist/assets/{Preview-C3t9OASa.js → Preview-Bjww8VIJ.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-BcAa0XdH.js → QBOConnectionScreen-Cwzdj4Q-.js} +1 -1
- package/dist/assets/ReimbursementApprovalRoutes-DpbViwiq.js +1 -0
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-DOYdcnj3.js → ReimbursementApprovalRuleDetailScreen-CpG3boOY.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-CVrOZVi7.js → ReimbursementRoutes-DiGdaZcS.js} +8 -8
- package/dist/assets/{ReportsRoutes-BSaDsWab.js → ReportsRoutes-BCP7KWMp.js} +1 -1
- package/dist/assets/RewardsRoutes-CpIo0I4i.js +1 -0
- package/dist/assets/ScreenRoutes-CSTyxtbM.js +2 -0
- package/dist/assets/SettingsRoutes-DvRgqkat.js +57 -0
- package/dist/assets/{SetupPagesScreen-usZWca-_.js → SetupPagesScreen-DFYeQ_eK.js} +5 -5
- package/dist/assets/SignInScreen-ZyXdRrhQ.js +1 -0
- package/dist/assets/SignOutScreen-CjCZ3Zak.js +9 -0
- package/dist/assets/TaskListScreen-DgEblwsB.js +9 -0
- package/dist/assets/TaskRoutes-Cg1seHyv.js +9 -0
- package/dist/assets/{TransactionDetailRoutes-BiA_QHF1.js → TransactionDetailRoutes-BBskyEa9.js} +1 -1
- package/dist/assets/TransactionDetailScreen-lkVHlxIe.js +5 -0
- package/dist/assets/{TransactionListRoutes-DIJytNYy.js → TransactionListRoutes-V5JqSayP.js} +1 -1
- package/dist/assets/TreasuryRoutes-MHYDsvJq.js +37 -0
- package/dist/assets/{VendorsRoutes-C0IKd0L4.js → VendorsRoutes-BJ_iX5jb.js} +15 -15
- package/dist/assets/WiseConfirmationScreen-Dk_ohJaH.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-DyxLcHZW.js → ZeniAccountRoutes-DnQ5jPxp.js} +10 -10
- package/dist/assets/ZeniAccountStatementScreen-mgHi-fEV.js +9 -0
- package/dist/assets/{accountMappingHelper-B-kf-Qnc.js → accountMappingHelper-DkNOxib8.js} +1 -1
- package/dist/assets/{analytics-DtYJ-EGT.js → analytics-dRdyiJhV.js} +1 -1
- package/dist/assets/{analyticsHelper-CTlcOyiL.js → analyticsHelper-BlJN3smJ.js} +1 -1
- package/dist/assets/{core-DnZcjy6X.js → core-6UWneHYU.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-CjxujRw-.js → decodeURIComponentSafe-IgzW2Epz.js} +1 -1
- package/dist/assets/{dnd-eoV-_JYH.js → dnd-DPJDixDO.js} +1 -1
- package/dist/assets/{empty-DkIaLxCd.js → empty-Ct6G3q3O.js} +1 -1
- package/dist/assets/{empty-Dq2hLrCm.js → empty-UUw51dpq.js} +1 -1
- package/dist/assets/{emptyVideoElement-BFB9pddL.js → emptyVideoElement-DWcmeFmU.js} +1 -1
- package/dist/assets/epic-BrLkseVN.js +2 -0
- package/dist/assets/getLocaleForTenant-bb4clfVv.js +1 -0
- package/dist/assets/{index-nBWRmUT4.js → index-A9TSx6IP.js} +15820 -16753
- package/dist/assets/{index-C8_nlYo6.js → index-CaSGnkOr.js} +2 -2
- package/dist/assets/{index-DUKU6sVX.js → index-CiAPO6YA.js} +1 -1
- package/dist/assets/index-Czu7h9lW.css +1 -0
- package/dist/assets/{index-Wtyhkk6J.js → index-D2jN0Wir.js} +1 -1
- package/dist/assets/{index-Dmm4l94W.js → index-Ns5QLo2D.js} +1 -1
- package/dist/assets/{index-D_CZgugN.js → index-T0jg9Q8I.js} +1 -1
- package/dist/assets/{index-nn6YvIGD.js → index-sP-MfLTE.js} +1 -1
- package/dist/assets/{index-CiCTnO2S.js → index-xNLACcug.js} +1 -1
- package/dist/assets/{lexical-CSqytB8g.js → lexical-BSu0Xk1T.js} +1 -1
- package/dist/assets/liveblocks-CO5jpspP.js +54 -0
- package/dist/assets/{lottie-Dz5luYQG.js → lottie-BHZsp7n9.js} +1 -1
- package/dist/assets/{mui-sr6zger7.js → mui-CZj-zMWV.js} +1 -1
- package/dist/assets/{pathToGoBack-DpO-gBzq.js → pathToGoBack-B6i9h4RV.js} +1 -1
- package/dist/assets/{pdf-BNSeVvBm.js → pdf-B15NABJW.js} +3 -3
- package/dist/assets/{pdf-lib-DwpnbCVp.js → pdf-lib-CT0ukUSx.js} +1 -1
- package/dist/assets/{plaid-QvRDxgoN.js → plaid-CQGSnVgh.js} +1 -1
- package/dist/assets/{pusher-senIjtt-.js → pusher-Cgk0flcG.js} +1 -1
- package/dist/assets/{react-CuKQRzYG.js → react-B4uDycL4.js} +1 -1
- package/dist/assets/{react-OAPKV4uC.js → react-BL-Db5kO.js} +1 -1
- package/dist/assets/{react-CBRcLxW-.js → react-C-hKaTCY.js} +1 -1
- package/dist/assets/{react-ClmbMdlp.js → react-DIU8hszS.js} +1 -1
- package/dist/assets/{react-CiyNePZ5.js → react-GfGdDMpS.js} +1 -1
- package/dist/assets/{react-BGDkRw8Y.js → react-KFT2mdy8.js} +1 -1
- package/dist/assets/{recharts-Bim6mdwu.js → recharts-DNj0j956.js} +1 -1
- package/dist/assets/routePaths-CsP6Ffie.js +1 -0
- package/dist/assets/{sentry-DFI2OQU2.js → sentry-DT80za28.js} +1 -1
- package/dist/assets/{url-p6YiHaLn.js → url-DEpm4gKV.js} +1 -1
- package/dist/assets/{url-4e0ZWhZq.js → url-DvP2uQIr.js} +1 -1
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-Bcrl6X1X.js → useAiCfoDashboardSuggestedQuestionsChips-DBOgNEAN.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-CpfOq769.js +1 -0
- package/dist/assets/useCashManagementBanner-Z61qrdOB.js +1 -0
- package/dist/assets/{useChargeCardPusherEvents-uhG5ouo_.js → useChargeCardPusherEvents-Div87iyA.js} +1 -1
- package/dist/assets/{useDeviceId-DasP_-mC.js → useDeviceId-BU2za7GL.js} +1 -1
- package/dist/assets/{useEmailConnectResultRefresh-DZSBVmEz.js → useEmailConnectResultRefresh-D7AP3TT4.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-Ch4ouOBD.js → useInitialThreadRequest-Dt_bRaHc.js} +1 -1
- package/dist/assets/{utils-cHxIh7E8.js → utils-CLt4eceg.js} +1 -1
- package/dist/assets/withTransactionSidePanel-DKi_i4iZ.js +21 -0
- package/dist/assets/{zeni-epic-state-m4zoW3ek.js → zeni-epic-state-CO3_FacC.js} +6 -6
- package/dist/index.html +1 -1
- package/package.json +6 -9
- package/dist/assets/AddressRoutes-OroYq1dZ.js +0 -1
- package/dist/assets/AddressScreen-ApC_R0Wp.js +0 -9
- package/dist/assets/AiCfoScreen-ceOXZKkH.js +0 -22
- package/dist/assets/CardsAiCfoScreen-C_N9OShc.js +0 -14
- package/dist/assets/CompanyPassportScreen-RJZfjyND.js +0 -1
- package/dist/assets/ConnectionAuthScreen-BeUh42uJ.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-BxM3YPtm.js +0 -1
- package/dist/assets/CustomerOnboardingRoutes-CHFrWBuQ.js +0 -30
- package/dist/assets/DomesticWireDetailScreen-BkAznvqR.js +0 -18
- package/dist/assets/DrawerScreen-DbGHqqp3.js +0 -1
- package/dist/assets/EntityDetailRoutes-BZZT4beI.js +0 -1
- package/dist/assets/ExpenseAutomationRoutes-DRT8zgD0.js +0 -25
- package/dist/assets/FeaturePreviewScreen-BuOhC0VV.js +0 -1
- package/dist/assets/HubSpotOAuthCallbackScreen-But5JTd3.js +0 -1
- package/dist/assets/MagicLinkRoutes-BXYryYOa.js +0 -72
- package/dist/assets/MagicLinkSignInScreen-Djwwkjab.js +0 -12
- package/dist/assets/MobileAppDrawer-KiFiOGbB.js +0 -1
- package/dist/assets/NotFoundScreen-CdBZ6E4V.js +0 -1
- package/dist/assets/OAuthConsentScreen-BHoiJyyq.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-CYJYOUC0.js +0 -1
- package/dist/assets/PeopleRoutes-DQ4ywy5y.js +0 -22
- package/dist/assets/PerformanceRoutes-DlI-5IYy.js +0 -1
- package/dist/assets/ReimbursementApprovalRoutes-vvvoQ_Sf.js +0 -1
- package/dist/assets/RewardsRoutes-DsYtBmZx.js +0 -1
- package/dist/assets/ScreenRoutes-_KkX47BV.js +0 -2
- package/dist/assets/SettingsRoutes-DqjN1ABZ.js +0 -57
- package/dist/assets/SignInScreen-BDE1HpBU.js +0 -1
- package/dist/assets/SignOutScreen-xueiP_tN.js +0 -9
- package/dist/assets/TaskListScreen-DduFWf5s.js +0 -9
- package/dist/assets/TaskRoutes-C6C-H9ff.js +0 -9
- package/dist/assets/TransactionDetailScreen-D0qCr6b1.js +0 -5
- package/dist/assets/TreasuryRoutes-BxXAoPv6.js +0 -37
- package/dist/assets/WiseConfirmationScreen-BSv238Gl.js +0 -12
- package/dist/assets/ZeniAccountStatementScreen-Dyx3X86U.js +0 -9
- package/dist/assets/epic-Blr6eiMV.js +0 -2
- package/dist/assets/getLocaleForTenant-CtnTFS0P.js +0 -1
- package/dist/assets/index-Cx4f0JbF.css +0 -1
- package/dist/assets/liveblocks-DKL6viSK.js +0 -54
- package/dist/assets/routePaths-D0N7YUlE.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-BqNcSAwL.js +0 -1
- package/dist/assets/useCashManagementBanner-rPbgM7YP.js +0 -1
- package/dist/assets/withTransactionSidePanel-CWy10IlG.js +0 -21
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import{j as u}from"./liveblocks-DKL6viSK.js";import{a as g}from"./sentry-DFI2OQU2.js";import{u as F,g as _,h as O,t as w,j as l,N as E}from"./core-DnZcjy6X.js";import{z as r,E as P,a as V,f as A,e as N,g as $,v as Q,Q as R,h as W}from"./index-nBWRmUT4.js";import{e$ as q,Ms as B,MC as G,Mt as H,fE as J,g4 as K,My as X,gx as Y,c_ as Z,MD as ee,ME as te}from"./zeni-epic-state-m4zoW3ek.js";import{n as ne}from"./mui-sr6zger7.js";import{u as se}from"./useDeviceId-DasP_-mC.js";import{f as ae}from"./analyticsHelper-CTlcOyiL.js";import{t as ie}from"./getLocaleForTenant-CtnTFS0P.js";import"./recharts-Bim6mdwu.js";import"./analytics-DtYJ-EGT.js";import"./plaid-QvRDxgoN.js";import"./dnd-eoV-_JYH.js";import"./stripe-cKAAJElX.js";import"./lottie-Dz5luYQG.js";import"./lexical-CSqytB8g.js";import"./pdf-BNSeVvBm.js";import"./utils-cHxIh7E8.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="c104e359-4351-42e7-8d1c-dd017a5eda4a",t._sentryDebugIdIdentifier="sentry-dbid-c104e359-4351-42e7-8d1c-dd017a5eda4a")}catch{}})();const x=(t,a)=>t!=null&&t.length>0&&a==="magic_links";function xe(){const t=F(),a=_(),f=O(),[k]=w(),n=k.get("token"),p=k.get("stytch_token_type"),m=r.getMagicLinkCodeVerifier(),i=se(),{otpChallenge:d,twoFAPhoneNumber:C,magicLinkEmail:c,verifyDeviceFetchState:D,resendVerifyDeviceOTPFetchState:M}=l((e=>e.tenantState)),S=l((e=>e.tenantState.fetchState)),v=l((e=>e.tenantState.activeTenantFetchState.fetchState)),h=l((e=>e.tenantState.signInState)),I=l((e=>e.tenantState.magicLinkSignInFetchState.fetchState)),s=l((e=>e.tenantState.loggedInUser)),o=l((e=>q(e))),y=l((e=>B(e))),T=r.getSignedInUser(),b=P().mode;g.useEffect((()=>{s?.zeniSessionId==null&&n!=null&&x(n,p)&&i!=null&&m!=null&&(r.saveMagicLinkTriggered(n),t(G(n,i,m)))}),[n,p,t,i,m,s?.zeniSessionId]),g.useEffect((()=>{h!=="In-Progress"||S!=="Completed"&&v!=="Completed"||s?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(s,s.zeniSessionId),r.saveSignedInUserTenants(H(y.tenantsInOrder),s.zeniSessionId),J(s.userId,s.zeniSessionId,o.tenantId),t(K(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(X("Completed")),V.updateAppLocaleID(ie(o)),ae(s,o,b,void 0,y.tenantsInOrder),Y().then((()=>{const e=W();e!=null&&A(e)})),setTimeout((()=>{N.trackLogin($.Event.loginSuccess,"email",Z(o.productSettings))}),2e3))}),[h,S,v,s,o,y,b,a.state,t]);const z=g.useCallback((()=>{f("/signin/auth")}),[f]),U=g.useCallback((()=>{i!=null&&d!=null&&c!=null&&t(ee(i,c,d))}),[i,d,t,c]),j=g.useCallback((e=>{i!=null&&n!=null&&c!=null&&d!=null&&t(te(e,i,c,d))}),[i,n,t,c,d]);if(I==="Completed"&&d!=null)return u.jsx(Q,{phoneNumber:C,verifyOtpFetchState:D.fetchState,resendVerifyDeviceOTPFetchState:M,onResendOtp:U,onVerifyOtp:j,onCancelVerifyDevice:z});if(h==="In-Progress"&&S==="Completed"&&s?.zeniSessionId!=null&&o!=null||T!=null){const e=a.state?.origin??"/";return u.jsx(E,{to:e,state:{...a.state,origin:""}})}if(!x(n,p)||m==null||I==="Error"){const e=a.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return u.jsx(E,{to:e,state:{...a.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||I==="Error"&&s?.zeniSessionId==null)}})}return u.jsx(oe,{"data-testid":"smooth-loader",children:u.jsx(R,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
|
|
2
|
-
position: fixed;
|
|
3
|
-
top: 0;
|
|
4
|
-
left: 0;
|
|
5
|
-
right: 0;
|
|
6
|
-
bottom: 0;
|
|
7
|
-
display: flex;
|
|
8
|
-
align-items: center;
|
|
9
|
-
justify-content: center;
|
|
10
|
-
z-index: 9999;
|
|
11
|
-
background-color: ${t=>t.theme.colors.background};
|
|
12
|
-
`;export{xe as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as V}from"./liveblocks-DKL6viSK.js";import{a as c}from"./sentry-DFI2OQU2.js";import{u as fe,j as n,i as We,g as He,h as Je,l as G}from"./core-DnZcjy6X.js";import{e$ as me,fJ as Ke,fK as pe,fv as Qe,bn as Xe,e_ as qe,fL as ea,fM as aa,fO as ta,fR as na,fS as g,fU as sa,fV as de,fY as oa,fW as ia,fX as ra,fZ as da,cQ as la,f$ as ca,cW as ua,fu as fa,g4 as ma,g5 as pa,g3 as ba}from"./zeni-epic-state-m4zoW3ek.js";import{a9 as ha,aa as Sa,x as ga,w as Ea,z as k,y as ka,u as Ca,i as r,d as ya,_ as Ia,ab as Ta,D as _a,c as wa,ac as Aa,a5 as Da,ad as Fa,ae as va,af as le,ag as ce,L as $a,ah as xa,ai as ue,e as P,a1 as Ma,r as _,aj as R,ak as Ga}from"./index-nBWRmUT4.js";import{D as Pa}from"./mui-sr6zger7.js";(function(){try{var f=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new f.Error().stack;d&&(f._sentryDebugIds=f._sentryDebugIds||{},f._sentryDebugIds[d]="6a2246f1-88bc-4177-830e-85bf89ffa112",f._sentryDebugIdIdentifier="sentry-dbid-6a2246f1-88bc-4177-830e-85bf89ffa112")}catch{}})();const Ra=ha((({isAppContentDrawerOpen:f,handleDrawerToggle:d})=>{const{tenantEmailDomain:t}=We(),a=He(),C=ga(),o=Je(),B=Qe(),m=fe(),{useFeatureGate:i}=Ea(),N=k.getSignedInUser(),U=Xe(N),s=n((e=>me(e))),be=s.masterTOSInfo?.isMasterTOSAccepted??!1,O=n((e=>qe(e))),L=O.uiState.currentChatSessionId,y=ka(),{setLoading:he}=Ca(),[w,j]=c.useState(void 0),A=G("/:tenantEmailDomain/dashboard")!==null,Z=G("/:tenantEmailDomain/reports")!==null,I=G("/:tenantEmailDomain/onboarding/*")!==null,Se=!!s.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:ge}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:z}=i(r.isDebitCardFeatureEnabled),Ee=ya(s,ge,z),{isFeatureEnabled:ke}=i(r.isSettingsFeatureEnabled),Y=n((e=>ea(e))),{isFeatureEnabled:T}=i(r.isReferralFeatureEnabled),D=n((e=>aa(e)));c.useEffect((()=>{y&&T&&!I&&D.fetchState==="Not-Started"&&m(ta(!0))}),[y,T,D.fetchState,I]);const h=k.getSignedInUser(),F=n((e=>e.tenantState)),Ce=n((e=>F.fetchState==="Completed"?na(e):[])),E=n((e=>e.expenseAutomationViewState.selectedPeriodByTenantId)),{isFeatureEnabled:ye}=i(r.isApAgingFeatureEnabled),{isFeatureEnabled:Ie}=i(r.isArAgingFeatureEnabled),{isFeatureEnabled:Te}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:_e}=i(r.isExpenseAutomationEnabledV2),W=Ia(),{isFeatureEnabled:we}=i(r.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:Ae}=i(r.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:De}=i(r.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:Fe}=i(r.isDashboardSidebarNewYearAnimationEnabled),v=s.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:ve}=i(r.isTaskManagerCustomerUserAccessEnabled),$e=U||!U&&ve,xe=n((e=>g(e).totalUnreadCount)),Me=n((e=>g(e).reducedFetchCountState)),H=n((e=>g(e).notificationDetailsByTab.tasks.uiState.unreadCount)),J=n((e=>g(e).notificationDetailsByTab.comments.uiState.unreadCount)),Ge=n((e=>g(e).notificationDetailsByTab.tasks.fetchCountState)),$=n((e=>g(e).notificationDetailsByTab.comments.fetchCountState)),{inboxNotifications:K,isLoading:Q,isFetchingMore:X,hasFetchedAll:q,fetchMore:Pe}=Ta();c.useEffect((()=>{const e=setTimeout((()=>Pe?.()),0);return()=>clearTimeout(e)})),c.useEffect((()=>{if(Q===!1&&X===!1&&q===!0)if(s?.companyId!=null&&K!=null){const e=`dashboard_${s.companyId}`;j(K.filter((u=>u.roomId===e&&u.readAt==null)).length)}else j(0)}),[Q,X,q]),c.useEffect((()=>{y&&!I&&Ge.fetchState==="Not-Started"&&B.tenantId!=null&&m(sa("task_manager","dashboard"))}),[y,B.tenantId]),c.useEffect((()=>{I||$.fetchState!=="Not-Started"||m(de({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))}),[]),c.useEffect((()=>{w!=null&&$.fetchState==="In-Progress"&&(m(de({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),m(pe({unreadCount:w},"comments")))}),[w,$.fetchState]);const Re={fetchStatus:Me,count:xe},ee=t!=null?k.getSignedInUserTenant(t):null,ae=n((e=>ee?.tenantId!=null?oa(e,ee.tenantId):void 0)),S=[];ye===!1&&S.push("accounts_payable_aging"),Ie===!1&&S.push("accounts_receivable_aging"),S.push("zeni_accounts_promo_card","treasury_promo_card"),T===!1&&S.push("rewards_card"),W===!1&&S.push("expense_automation_card");const Ve=_a(),te=n((e=>ia(e,S,h,_e,Te).fetchState)),ne=n((e=>ra(e).fetchState)),Be=A&&(te==="Completed"||te==="Error")||Z&&(ne==="Completed"||ne==="Error")||!A&&!Z?void 0:"disabled",Ne=c.useMemo((()=>da(s.userRole)),[s.userRole]),Ue=la(Ne),Oe=s?.rewardsLastViewedTime==null,Le=h?.userEmail!=null&&Y.fetchState==="Completed"&&ca(Y.notificationSettings,h.userEmail,z,s),se=wa(),je=se&&Aa(a),oe=ua(Ve?.loggedInUserRoleMap),ie=s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,x=c.useCallback((()=>v&&oe&&!k.getTreasuryPopupSeen(t??"")&&ie===!1&&Da(a.pathname)!=="treasury"),[v,oe,ie,a.pathname,t]),[Ze,re]=c.useState(x);c.useEffect((()=>{re(x())}),[x]);const ze=n((e=>e.treasurySetupViewState.treasuryFundsDetails)).fundsDetails,Ye=Fa(ze);return V.jsx(Pa,{container:window.document.body,variant:"temporary",open:f,onClose:()=>d(!1),PaperProps:{sx:{width:240,zIndex:8,borderRight:"none",backgroundImage:"none"}},ModalProps:{keepMounted:!0},children:V.jsx(va,{signedInUser:N,currentTenantId:F.currentTenantId??"",tenants:F.fetchState==="Completed"?Ce:ae!=null?[ae]:[],currentTenant:s,isTenantDropdownDisabled:Be,isSettings:ce(a),isSettingsFeatureEnabled:ke,isVendorsTabVisible:Ue,isZeniAccountEnabled:Se,isChargeCardEnabled:Ee,isTreasuryEnabled:v,treasuryYieldPercentage:Ye,isTreasuryPopupVisible:Ze,isNotificationsTabVisible:Le,notificationCountDetails:Re,isExpenseAutomationEnabledForUser:W,selectedMenu:le(a),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:Oe,rewardsPlan:D.rewardsPlan},isAiCfoAccessEnabled:se,onNotificationIconClick:()=>{d(!1);let e=H===0&&J>0?"notifications/comments":"notifications/tasks";ce(a)&&(e=H===0&&J>0?"../../notifications/comments":"../../notifications/tasks");const u=_(a.state?.pathnameStackToGoBack,a.pathname);o(e,{state:{pathnameStackToGoBack:u}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{d(!1);const e=_(a.state?.pathnameStackToGoBack,a.pathname);o("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMenuChange:e=>{if(d(!1),t==null)return;if(e.type==="ai_cfo"){if(P.trackAICFOChatScreenStateChanged("viewed","left_menu",L??null,null),!be)return void Ma({location:a,navigate:o,mergeState:{referrer:"Sidebar"}});const b=_(a.state?.pathnameStackToGoBack,a.pathname);return void o(`/${t}/ai-cfo/explore`,{state:{pathnameStackToGoBack:b,referrer:"Sidebar"}})}const u=_(a.state?.pathnameStackToGoBack,a.pathname),l=e.type,p=R(l)&&l!=="command_center";if(R(e.type)&&E[s.tenantId]!=null&&P.trackMonthEndCloseClicked(E[s.tenantId].month,E[s.tenantId].year,"Sidebar"),p&&E[s.tenantId]!=null){const b=E[s.tenantId];return void o(`/${t}/month_end_close_checks/review/${e.type}/${b.month}-${b.year}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})}const M=Ga(e.type);ue(e.type)?(L!=null&&m(ba()),o(`/${t}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):o(`/${t}/${M}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})},handleMyProfileClick:()=>{d(!1),o(`/${t}/settings/my_profile`)},handleReferralsClick:()=>{d(!1),o(`/${t}/rewards`)},handleBackClick:()=>{o(`/${t}/dashboard`)},handleTenantSelect:e=>{he($a.TENANT_SWITCHING),d(!1);const u=e.tenantEmailDomain,l=le(a);let p=`/${encodeURIComponent(u)}/`;const M=R(l);l==="home"?p+="dashboard":l==="users_and_roles"?p+="people":xa(l)?p+="settings/my_profile":ue(l)?p+=`ai-cfo/${l}`:p+=l==="task_checklist"?"tasks":M?"month_end_close_checks/review":encodeURIComponent(l),o(p,{replace:!0}),h!=null&&(m(ma(e.tenantId)),m(pa(h.userId,e.tenantId,h.zeniSessionId)));const b=e;P.trackCompanySwitch(b.companyId,b.companyName,b.userRole)},handlePopupClose:()=>{k.saveTreasuryPopupSeen(t??"",!0),re(!1)},onZeniLogoClick:()=>{C.toggle()},isAiCfo:je,aiCfoView:O,isOnDashboard:A,updateCurrentChatSessionId:e=>{m(fa({sessionId:e,agentId:"controller"})),o(`/${t}/ai-cfo/${e}`,{state:{...a.state}})},halloweenAnimationEnabled:we,isTaskManagerAccessEnabled:$e,thanksGivingAnimationEnabled:Ae,christmasAnimationEnabled:De,newYearAnimationEnabled:Fe})})})),ja=f=>{const d=fe(),t=n((C=>me(C))),a={events:t.userRoleId!=null?[`private-encrypted-${t.userRoleId}.dashboard-user-notification`]:[],eventCallback:(C,o)=>{Sa(o)&&Ke(o.mode)==="dashboard"&&d(pe({unreadCount:o.data.unread},"tasks"))}};return V.jsx(Ra,{...f,...a})};export{ja as M};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as r}from"./liveblocks-DKL6viSK.js";import{h as n,n as e}from"./core-DnZcjy6X.js";import{R as i}from"./index-nBWRmUT4.js";import"./mui-sr6zger7.js";import"./sentry-DFI2OQU2.js";import"./zeni-epic-state-m4zoW3ek.js";import"./recharts-Bim6mdwu.js";import"./analytics-DtYJ-EGT.js";import"./plaid-QvRDxgoN.js";import"./dnd-eoV-_JYH.js";import"./stripe-cKAAJElX.js";import"./lottie-Dz5luYQG.js";import"./lexical-CSqytB8g.js";import"./pdf-BNSeVvBm.js";import"./utils-cHxIh7E8.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new o.Error().stack;t&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[t]="9ceba748-25d5-4d32-9a3c-da4194015415",o._sentryDebugIdIdentifier="sentry-dbid-9ceba748-25d5-4d32-9a3c-da4194015415")}catch{}})();const a=e(null,(function(o,t){return{onGoBack:()=>{t.navigate(-1)},onGoHome:()=>{t.navigate("/")}}}))(i);function _(){const o=n();return r.jsx(a,{navigate:o})}export{_ as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as m}from"./liveblocks-DKL6viSK.js";import{a as r}from"./sentry-DFI2OQU2.js";import{u as T,g as A,j as o,N as R}from"./core-DnZcjy6X.js";import{MR as j,e$ as C,fR as P,MS as x,MT as z,MU as D,MV as L,on as k,LO as N}from"./zeni-epic-state-m4zoW3ek.js";import{z as h,K as I}from"./index-nBWRmUT4.js";import"./mui-sr6zger7.js";import"./recharts-Bim6mdwu.js";import"./analytics-DtYJ-EGT.js";import"./plaid-QvRDxgoN.js";import"./dnd-eoV-_JYH.js";import"./stripe-cKAAJElX.js";import"./lottie-Dz5luYQG.js";import"./lexical-CSqytB8g.js";import"./pdf-BNSeVvBm.js";import"./utils-cHxIh7E8.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new n.Error().stack;a&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[a]="a94609d2-84aa-4c69-9596-29f7f63cd1af",n._sentryDebugIdIdentifier="sentry-dbid-a94609d2-84aa-4c69-9596-29f7f63cd1af")}catch{}})();function ee(){const n=T(),a=A(),{params:t,error:i}=r.useMemo((()=>j(a.search)),[a.search]),w=r.useMemo((()=>new URLSearchParams(a.search).get("client_name")??t?.clientId??"Unknown Application"),[a.search,t]),f=h.isSignedIn(),s=h.getSignedInUser(),p=o((e=>C(e))),l=o((e=>P(e))),d=o((e=>e.tenantState.fetchState)),y=o(x),S=o(z),c=o(D),[v,E]=r.useState(null),[b,U]=r.useState(null);r.useEffect((()=>{document.querySelector("#app-shell-loader")?.remove()}),[]),r.useEffect((()=>()=>{n(L())}),[n,a.search]),r.useEffect((()=>{i!=null&&console.warn("[OAuthConsent] invalid params:",i)}),[i]);const g=r.useRef(!1);r.useEffect((()=>{f&&s!=null&&!g.current&&(d!=="Not-Started"&&d!=="Error"||(g.current=!0,n(k(s.userId,s.zeniSessionId??void 0))))}),[f,s,d,n]),r.useEffect((()=>{c!=null&&c!==""&&(window.location.href=c)}),[c]);const _=r.useMemo((()=>{if(p?.tenantId!=null)return p.tenantId;const e=h.getActiveTenantForUser()?.tenantId;return e!=null&&l.some((M=>M.tenantId===e))?e:l.length===1?l[0].tenantId:null}),[p?.tenantId,l]),u=v??_;return i!=null?m.jsx(I,{variant:"invalid_params",paramsError:i}):f?m.jsx(I,{variant:"signed_in",clientName:w,userEmail:s?.userEmail,isInitializing:d!=="Completed",tenants:l,selectedTenantId:u,onSelectTenant:E,approveError:b??S,isApproving:y==="In-Progress",showAllowButton:u!=null,onApprove:()=>{t!=null&&s!=null&&u!=null&&n(N(s.userId,s.zeniSessionId??void 0,u,t.clientId,t.redirectUri,t.codeChallenge,t.codeChallengeMethod,t.state,t.responseType))},onDeny:()=>{if(t!=null)try{const e=new URL(t.redirectUri);e.searchParams.set("error","access_denied"),e.searchParams.set("error_description","The user denied the request"),e.searchParams.set("state",t.state),window.location.href=e.toString()}catch{U("Unable to deny: redirect_uri is not a valid URL. Close this window or contact support.")}}}):m.jsx(R,{to:"/signin/auth",state:{origin:a.pathname+a.search},replace:!0})}export{ee as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as n}from"./liveblocks-DKL6viSK.js";import{h as V,u as z,g as H,i as J,j as d,n as K,o as Q,p as b}from"./core-DnZcjy6X.js";import{e$ as U,sB as R,s9 as X,Nm as v,s4 as S,bs as ee,bn as ae,bZ as te,s5 as se,Nn as oe,N9 as C,dL as re,wg as ne,No as ce,wD as ie,fI as le,fG as de}from"./zeni-epic-state-m4zoW3ek.js";import{z as fe,Z as me,a0 as pe,D as ue,w,i as N,F as he,e as M,ap as ge,r as Fe}from"./index-nBWRmUT4.js";import"./mui-sr6zger7.js";import Ie from"./NotFoundScreen-CdBZ6E4V.js";import{F as be}from"./FeaturePreviewScreen-BuOhC0VV.js";import{a as g}from"./sentry-DFI2OQU2.js";import{u as Ce}from"./useAskAiCfoHostNavButtonProps-BqNcSAwL.js";import{u as Se}from"./useInitialThreadRequest-Ch4ouOBD.js";import{t as Te}from"./routePaths-D0N7YUlE.js";import{M as ye}from"./MobileAppDrawer-KiFiOGbB.js";import"./recharts-Bim6mdwu.js";import"./analytics-DtYJ-EGT.js";import"./plaid-QvRDxgoN.js";import"./dnd-eoV-_JYH.js";import"./stripe-cKAAJElX.js";import"./lottie-Dz5luYQG.js";import"./lexical-CSqytB8g.js";import"./pdf-BNSeVvBm.js";import"./utils-cHxIh7E8.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new s.Error().stack;e&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[e]="2461c57a-af4e-4f8c-a71f-3553cf1e0229",s._sentryDebugIdIdentifier="sentry-dbid-2461c57a-af4e-4f8c-a71f-3553cf1e0229")}catch{}})();const T=(s,e,a,o)=>{if(s!=e){const r=o??"";s!=null&&s.length>0?a(`../${e}${r}`,{replace:!0}):a(`${e}${r}`,{replace:!0})}},De=K((function(s){const e=oe(s),a={},o=e.pandLReportWithForecast.uiState.nodeCollapseState;return Object.keys(o).forEach((r=>{a[r]=o[r]===!1})),{selectedTimeframe:e.selectedTimeframe,isForecastVsActualOn:e.isForecastVsActualOn,compareMode:e.compareMode,forecastList:e.forecastList,selectedForecast:e.selectedForecast,pandLreport:e.pandLReportWithForecast,scrollPosition:e.pandLReportWithForecast.uiState.scrollPosition,nodeOpenStatus:a,type:"name+balances_forecast",analytics:M}}),(function(s,e){return{onForecastSelectionChanged:(a,o)=>{s(v(a,o)),e.isPandLReportFetched(a)||s(S(a)),T(e.forecastIdFromUrlPath,a,e.navigate)},onTimeframeChanged:a=>{s(ie(a))},onForecastVsActualsCompareToggle:a=>{s(ce(a)),s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:{scrollLeft:0,scrollTop:0}}))},onCompareModeChanged:a=>{s(ne(e.firstMonthOfFY,a,0,[]))},onAccountBalanceClick:e.hasTransactionAccess!==!0?void 0:(a,o)=>{let r,c;const p=a.accountName===""?a.accountDescription:a.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(r=o.balanceTimeFrame,c=re(o)):o.balanceTimeFrame==="year"?(r="quarter",c={startDate:o.endDate.startOf("quarter"),endDate:o.endDate}):console.error(`timeframe ${o.balanceTimeFrame} is not supported`),c!=null&&r!=null){const f=Te(e.tenantEmailDomain,a.accountId,a.accountType,p,r,c),u=Fe(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(f,{state:{pathnameStackToGoBack:u,referrer:"Forecast"}})}},onNodeCollapseToggled:(a,o)=>{s(C({forecastId:e.forecastIdFromUrlPath,nodeCollapseState:{nodeId:a,isCollapsed:o===!1}}))},onTableScroll:a=>{s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:a}))},onBackClick:()=>{e.navigate("../../")}}}))(ge);function O(){const s=V(),e=z(),a=H(),{forecastId:o,tenantEmailDomain:r}=J(),[c,p]=g.useState(!1),[f,u]=g.useState(!1),h=fe.getSignedInUser(),y=d((t=>U(t))),$=y.company?.companyInfo.firstMonthOfFY??1,i=d((t=>R(t.forecastState,t.forecastListState))),l=d((t=>t.forecastListState.fetchState==="Completed")),D=d((t=>t.profitAndLossState)),k=d((t=>t.reportUIOptionsState.selectedForecast)),A=t=>D.pandLByForecastID[t]!=null&&se(t,D).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:F}=me();pe({isDataReady:l});const{isAiCfoAccessEnabled:B,onAskAiCfoClick:q}=Ce({mobileExploreReferrer:"Forecast"});g.useEffect((()=>{if(!c&&F)p(!0),l||e(X());else if(l&&!f){u(!0);const t=((m,E,P)=>E!=null?m.forecasts.findIndex((I=>I.id===E)):P!=null?m.forecasts.findIndex((I=>I.id===P)):m.forecasts.length>0?0:-1)(i,o,k?.id);t===-1&&o!=null?s("page-not-found",{replace:!0}):t!==-1&&t!=k?.index?(e(v(i.forecasts[t].id,t)),T(o,i.forecasts[t].id,s,a.search)):o==null&&t!==-1&&T(void 0,i.forecasts[t].id,s,a.search),t!==-1&&!A(i.forecasts[t].id)&&F&&e(S(i.forecasts[t].id))}}),[c,p,e,l,i,f,u,R,S,F]);const x=ue(),G=x?.loggedInUserRole!=null&&ee(x.loggedInUserRole),{useFeatureGate:_}=w(),{isFeatureEnabled:L}=_(N.isReportsCommentingEnabled),W=Se(L?y?.companyId:void 0,{clearParams:l&&f}),[Y,Z]=g.useState(!1),j=t=>{Z(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(he,{analytics:M,onLoad:t=>(m=>m.trackForecast())(t)}):null,n.jsx(ye,{isAppContentDrawerOpen:Y,handleDrawerToggle:j}),n.jsx(De,{firstMonthOfFY:$,tenantEmailDomain:r,forecastIdFromUrlPath:o,navigate:s,location:a,isPandLReportFetched:A,meetingUrl:te(`https://meetings.hubspot.com/svitlana-grankovska?firstname=${h?.firstName}&lastname=${h?.lastName}&email=${h?.userEmail}`),hasTransactionAccess:G,isAiCfoAccessEnabled:B,onAskAiCfoClick:q,isReportsCommentingEnabled:L,isZeniUser:ae(h),initialOpenThreadRequest:W,onClickMenuIcon:()=>{j(!0)}})]})}function Ze(){const s=d((c=>U(c))),{useFeatureGate:e}=w(),{isFeatureEnabled:a}=e(N.isDebitCardFeatureEnabled),o=le(a,s),r=de(s);return o===!0||r===!0?n.jsx(be,{}):n.jsxs(Q,{children:[n.jsx(b,{path:"/",element:n.jsx(O,{})}),n.jsx(b,{path:"/:forecastId",element:n.jsx(O,{})}),n.jsx(b,{path:"/:forecastId/*",element:n.jsx(Ie,{})})]})}export{Ze as PandLWithForecastRoutes,Ze as default};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-DKL6viSK.js";import{Ni as oe,e$ as J,kL as _,fI as Q,fG as ie,KM as ee,MY as re,vd as ke,Nj as X,v2 as ve,vn as Ee,vh as le,v6 as de,vl as Pe,vi as je,Nk as ce,x2 as Le,fs as Te,gk as Ae,Nl as H,va as pe,v9 as ue,vq as Fe,c7 as Re}from"./zeni-epic-state-m4zoW3ek.js";import{J as me,w as ae,i as G,z as K,d as ge,C as fe,H as he,al as Ce,am as Oe,G as ye,o as O,I as be,a as M,an as Ve,Z as Ze,a0 as Be,F as Ue,e as Se,g as $e,r as ze,ao as He,D as Ge}from"./index-nBWRmUT4.js";import{D as we,n as N,S as xe}from"./mui-sr6zger7.js";import te from"./NotFoundScreen-CdBZ6E4V.js";import{a as d}from"./sentry-DFI2OQU2.js";import{u as se,i as _e,j as g,h as Ke,g as Me,n as Ne,o as ne,p as z}from"./core-DnZcjy6X.js";import{u as We}from"./useAskAiCfoHostNavButtonProps-BqNcSAwL.js";import{M as qe}from"./MobileAppDrawer-KiFiOGbB.js";import"./recharts-Bim6mdwu.js";import"./analytics-DtYJ-EGT.js";import"./plaid-QvRDxgoN.js";import"./dnd-eoV-_JYH.js";import"./stripe-cKAAJElX.js";import"./lottie-Dz5luYQG.js";import"./lexical-CSqytB8g.js";import"./pdf-BNSeVvBm.js";import"./utils-cHxIh7E8.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]="ca646813-af8d-46fa-9d5f-44e622c5d14e",e._sentryDebugIdIdentifier="sentry-dbid-ca646813-af8d-46fa-9d5f-44e622c5d14e")}catch{}})();const Ye={overlayWidth:new ye(100,100,48)},W=M.getLocalizedStrings().peoplePage.invitePage,Xe=M.getLocalizedStrings().common,Je=({companyId:e,managersListView:t,companyPassportView:c,classListView:n,mode:f,isEditPeopleDrawerOpen:i,closeDrawerHandler:b})=>{const h=me(),m=se(),[V,Z]=d.useState(!1),[k,S]=d.useState(!1),{userId:w}=_e(),r=g((l=>oe(l))),p=g((l=>J(l))),v=g((l=>_(l))),{useFeatureGate:D}=ae(),{isFeatureEnabled:I}=D(G.isDebitCardFeatureEnabled),E=Q(I,p),L=ie(p),T=ee(p),B=re(p),U=!!p.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!E&&v&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||c.fetchState!=="Completed"||e==null;if(K.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{m(X()),b()},A=()=>{V===!0?S(!0):C()},$=c.companyView?.controllers?.map((l=>l.user)),u=!!p.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:P}=D(G.isChargeCardFeatureEnabled),j=ge(p,P,I),{isCardsHidden:F}=fe(p?.tenantId),y=!j||F,R=p.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",s={peopleDetails:r,classList:n.classes,managersList:t.users,controllersList:$,mode:f,isZeniTenant:T,isAccountingClassesEnabled:v,isReimbursementDisabled:U===!1,isZeniAccountsDisabled:u===!1,isChargeCardDisabled:y,isTreasuryDisabled:R===!1,isLiteRoleDisabled:B===!1,isBankingOnlyTenant:E,isCardsOnlyTenant:L,onResetClick:C,onDeleteUser:l=>{m(de(l.userId,l.userRole.userRoleId))},onPeopleLocalDataUpdated:l=>{m(le({peopleLocalData:l})),Z(!0)},onSaveClick:()=>{m(f==="zeni_only"?ve(e):Ee(T))},onCloseClick:A,isLoading:x||r.person==null},o={onOkClick:()=>{S(!1),C()},onCancelClick:()=>{S(!1)}};return d.useEffect((()=>{x===!1&&w!=null&&m(ke(w))}),[x,w]),d.useEffect((()=>{r.updatePersonState.fetchState==="Completed"&&C()}),[r.updatePersonState.fetchState]),a.jsx(we,{anchor:"right",open:i,PaperProps:{style:{width:Ye.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:he.overlayDark,cursor:"pointer"}}},onClose:A,children:a.jsxs(Qe,{onClick:l=>l.stopPropagation(),children:[k===!0?a.jsx(Ce,{titleComponent:a.jsx(De,{children:W.discardTitle}),descriptionComponent:a.jsx(Ie,{children:W.discardDescription}),primaryButtonText:W.discard,secondaryButtonText:Xe.no,action:o,isEditPopup:!0}):null,a.jsx(Oe,{...s})]})})},Qe=N(xe)`
|
|
2
|
-
display: flex;
|
|
3
|
-
min-height: 100%;
|
|
4
|
-
flex-direction: column;
|
|
5
|
-
`,De=N(be.H6Regular)`
|
|
6
|
-
margin-top: ${O.sp7};
|
|
7
|
-
padding-left: ${O.sp8};
|
|
8
|
-
padding-right: ${O.sp8};
|
|
9
|
-
color: ${e=>e.theme.colors.primary};
|
|
10
|
-
word-break: break-word;
|
|
11
|
-
`,Ie=N(be.LargeRegularSp)`
|
|
12
|
-
color: ${e=>e.theme.colors.hero};
|
|
13
|
-
padding-left: ${O.sp8};
|
|
14
|
-
padding-right: ${O.sp8};
|
|
15
|
-
margin-bottom: 30px;
|
|
16
|
-
margin-top: ${O.sp4};
|
|
17
|
-
white-space: pre-line;
|
|
18
|
-
`,ea={overlayWidth:new ye(100,100,48)},q=M.getLocalizedStrings().peoplePage.invitePage,aa=M.getLocalizedStrings().common,sa=({companyId:e,managersListView:t,companyPassportView:c,classListView:n,mode:f,isInvitePeopleDrawerOpen:i,closeDrawerHandler:b})=>{const h=me(),m=se(),[V,Z]=d.useState(!1),[k,S]=d.useState(!1),w=g((o=>oe(o))),r=g((o=>J(o))),p=g((o=>_(o))),{useFeatureGate:v}=ae(),{isFeatureEnabled:D}=v(G.isDebitCardFeatureEnabled),I=Q(D,r),E=ie(r),L=ee(r),T=re(r),B=!!r.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,U=!I&&p&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||c.fetchState!=="Completed"||e==null;if(K.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const x=()=>{b(),m(X())},C=()=>{V===!0?S(!0):x()},A={onOkClick:()=>{S(!1),x()},onCancelClick:()=>{S(!1)}},$=c.companyView?.controllers.map((o=>o.user)),u=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:P}=v(G.isChargeCardFeatureEnabled),j=ge(r,P,D),{isCardsHidden:F}=fe(r?.tenantId),y=!j||F,R=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",s={classList:n.classes,managersList:t.users,controllersList:$,mode:f,isZeniTenant:L,onPeopleLocalDataUpdated:o=>{m(le({peopleLocalData:o})),Z(!0)},onResetClick:x,onSaveClick:()=>{m(f==="zeni_only"?Pe(e):je())},onCloseClick:C,peopleDetails:w,isAccountingClassesEnabled:p,isReimbursementDisabled:B===!1,isLiteRoleDisabled:T===!1,isZeniAccountsDisabled:u===!1,isChargeCardDisabled:y,isTreasuryDisabled:R===!1,isBankingOnlyTenant:I,isCardsOnlyTenant:E,isLoading:U};return d.useEffect((()=>{w.invitePersonState.fetchState==="Completed"&&(b(),m(X()))}),[w.invitePersonState.fetchState]),a.jsx(we,{anchor:"right",open:i,PaperProps:{style:{width:ea.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:he.overlayDark,cursor:"pointer"}}},onClose:C,children:a.jsxs(ta,{onClick:o=>o.stopPropagation(),children:[k===!0?a.jsx(Ce,{titleComponent:a.jsx(De,{children:q.discardTitle}),descriptionComponent:a.jsx(Ie,{children:q.discardDescription}),primaryButtonText:q.discard,secondaryButtonText:aa.no,action:A}):null,a.jsx(Ve,{...s})]})})},ta=N(xe)`
|
|
19
|
-
display: flex;
|
|
20
|
-
min-height: 100%;
|
|
21
|
-
flex-direction: column;
|
|
22
|
-
`,na=Ne((function(e,t){const c=ce(e),n=K.getSignedInUser();return{data:c,loggedinUserId:n?.userId??"",isZeniTenant:t.isZeniTenant===!0,shouldFetchClasses:t.shouldFetchClasses,isZeniAdminUser:n?.userEmailDomain==="zeni.ai"&&t.isZeni===!0,isAccountingClassesEnabled:_(e),analytics:Se}}),(function(e,t){const{navigate:c,companyId:n,shouldFetchClasses:f}=t;return{personAction:{onPersonDelete:(i,b)=>{e(de(i,b))},onResendInvite:i=>{e(Fe(i))},onReloadPeople:()=>{e(pe()),e(ue(n,f))},onBackClick:()=>{c("../../")},onModeChange:i=>{e(H({mode:i,searchText:"",sortKey:"name",sortOrder:"ascending"}))},onSearchTextChanged:i=>{e(H({searchText:i}))}}}}))(He);function Y({isInvitePeopleDrawerOpen:e,isEditPeopleDrawerOpen:t}){const c=Ke(),n=se(),f=Me(),{areTenantIdsInSync:i}=Ze(),b=K.getSignedInUser(),h=g((s=>J(s))),{useFeatureGate:m}=ae(),{isFeatureEnabled:V}=m(G.isDebitCardFeatureEnabled),Z=g((s=>_(s))),k=!Q(V,h)&&Z,S=ee(h),w=h?.tenantId,{tenantEmailDomain:r}=h,[p,v]=d.useState(!1),[D,I]=d.useState(!1),[E,L]=d.useState(!1),[T,B]=d.useState("off"),[U,x]=d.useState(!1),C=s=>{x(s)},{isAiCfoAccessEnabled:A,onAskAiCfoClick:$}=We({mobileExploreReferrer:"People"}),u=g((s=>ce(s)));Be({isDataReady:u.fetchState==="Completed"});const P=g((s=>Le(s.classState,s.classListState))),j=g((s=>Te(s.userState,s.userRoleState,s.userListViewState,"manager"))),F=g((s=>Ae(s))),y=h?.companyId;d.useEffect((()=>{p&&T===u.uiState.mode||!i||(n(H({searchText:"",sortKey:"name",sortOrder:"ascending"})),B(u.uiState.mode),v(!0),n(pe()))}),[p,b,w,n,u.uiState.mode,i]),d.useEffect((()=>{y!=null&&i&&n(ue(y,k))}),[y,k,i]),d.useEffect((()=>{I(e!=null&&e===!0),L(t!=null&&t===!0&&t)}),[e,t]),d.useEffect((()=>{n(H({searchText:"",sortKey:"name",sortOrder:"ascending"}))}),[]);const R=()=>{I(!1),L(!1),c("../")};return a.jsxs(a.Fragment,{children:[u.fetchState==="Completed"?a.jsx(Ue,{analytics:Se,onLoad:s=>s.trackPageLoaded($e.Event.members)}):null,D===!0?a.jsx(sa,{closeDrawerHandler:R,isInvitePeopleDrawerOpen:D,managersListView:j,companyPassportView:F,classListView:P,companyId:y,mode:u.uiState.mode}):null,E===!0?a.jsx(Je,{closeDrawerHandler:R,isEditPeopleDrawerOpen:E,managersListView:j,companyPassportView:F,classListView:P,companyId:y,mode:u.uiState.mode}):null,a.jsx(qe,{isAppContentDrawerOpen:U,handleDrawerToggle:C}),a.jsx(na,{navigate:c,signedInUser:b,isZeni:h.isZeni,isZeniTenant:S,peopleUIState:u.uiState,companyId:y,shouldFetchClasses:k,classList:P,managersView:j,peopleView:u,onInvitePeopleClick:()=>{c("./new")},onColumnSortConfigChanged:(s,o)=>{n(H({sortKey:s,sortOrder:o}))},onRowClick:s=>{const o=`/${r}/people/${encodeURIComponent(s)}/edit`,l=ze(f.state?.pathnameStackToGoBack,f.pathname);c(o,{state:{pathnameStackToGoBack:l}})},onClickMenuIcon:()=>{C(!0)},isAiCfoAccessEnabled:A,onAskAiCfoClick:$})]})}function Da(){const e=Ge();return Re(e?.loggedInUserRole??[])?a.jsxs(ne,{children:[a.jsx(z,{path:"/",element:a.jsx(Y,{})}),a.jsx(z,{path:"new",element:a.jsx(Y,{isInvitePeopleDrawerOpen:!0})}),a.jsx(z,{path:":userId/edit",element:a.jsx(Y,{isEditPeopleDrawerOpen:!0})}),a.jsx(z,{path:"*",element:a.jsx(te,{})})]}):a.jsx(ne,{children:a.jsx(z,{path:"*",element:a.jsx(te,{})})})}export{Da as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-DKL6viSK.js";import E from"./NotFoundScreen-CdBZ6E4V.js";import{a as r}from"./sentry-DFI2OQU2.js";import{h as _,g as v,j as p,i as M,u as U,N as P,n as z,o as O,p as h}from"./core-DnZcjy6X.js";import{e$ as B,Tx as b,bq as F,bn as N,ip as V,fD as $}from"./zeni-epic-state-m4zoW3ek.js";import{x as q,z as I,a0 as Y,cY as G}from"./index-nBWRmUT4.js";import"./mui-sr6zger7.js";import{u as H}from"./useAskAiCfoHostNavButtonProps-BqNcSAwL.js";import{M as J}from"./MobileAppDrawer-KiFiOGbB.js";import"./recharts-Bim6mdwu.js";import"./analytics-DtYJ-EGT.js";import"./plaid-QvRDxgoN.js";import"./dnd-eoV-_JYH.js";import"./stripe-cKAAJElX.js";import"./lottie-Dz5luYQG.js";import"./lexical-CSqytB8g.js";import"./pdf-BNSeVvBm.js";import"./utils-cHxIh7E8.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]="edeb52c7-cc81-4a77-9823-ccd3f9e9600e",e._sentryDebugIdIdentifier="sentry-dbid-edeb52c7-cc81-4a77-9823-ccd3f9e9600e")}catch{}})();const K=z((function(e){const t=I.getSignedInUser(),c=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:c??""},{aggregatedReportViewState:n}=b(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}}),(function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}}))(G),L=()=>{const e=_(),t=v(),c=q(),o=p((a=>B(a))),{aggregatedReportViewState:n}=p((a=>b(a))),{tenantEmailDomain:f}=M(),u=U(),l=I.getSignedInUser();if(l==null)throw new Error("Can't access this page without signing in...");const m=r.useRef(!1),[w,S]=r.useState(!1),C=F(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,x=N(l),D=C||k||x,d=r.useCallback(((a,i,A)=>{u(V({fromMonth:a,toMonth:i,cacheOverride:A}))}),[]);r.useEffect((()=>{n?.fetchState==="Completed"&&m.current&&(u($({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),m.current=!1)}),[n?.fetchState]);const y=r.useCallback(((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||d(a,i,!0),m.current=!0}),[n?.fetchState,d]),j=r.useCallback(((a,i)=>{d(a,i,!1)}),[d]),g=a=>{S(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:T}=H({mobileExploreReferrer:"Performance"});return Y({isDataReady:n?.fetchState==="Completed"}),D?s.jsxs(s.Fragment,{children:[s.jsx(J,{isAppContentDrawerOpen:w,handleDrawerToggle:g}),s.jsx(K,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:l,tenantEmailDomain:f,onReload:y,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:T})]}):s.jsx(P,{to:`/${f}/dashboard`,replace:!0})};function ge(){return s.jsxs(O,{children:[s.jsx(h,{path:"*",element:s.jsx(L,{})}),s.jsx(h,{path:"*",element:s.jsx(E,{})})]})}export{ge as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as r}from"./liveblocks-DKL6viSK.js";import O from"./NotFoundScreen-CdBZ6E4V.js";import{a as p}from"./sentry-DFI2OQU2.js";import{h as x,g as C,u as E,j as u,N as D,n as k,o as W,p as b}from"./core-DnZcjy6X.js";import{e$ as I,QP as g,R3 as S,G1 as V,Fa as U,G0 as d,FT as $,Rg as B,G3 as G}from"./zeni-epic-state-m4zoW3ek.js";import{z as N,a9 as T,bZ as F,ag as L,bC as z,b_ as K}from"./index-nBWRmUT4.js";import"./mui-sr6zger7.js";import{u as P,R as A}from"./ReimbursementApprovalRuleDetailScreen-DOYdcnj3.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]="601edc68-8abf-4e3b-b94e-c3885e72f348",e._sentryDebugIdIdentifier="sentry-dbid-601edc68-8abf-4e3b-b94e-c3885e72f348")}catch{}})();const y="reimbursement-approval-rule-update",Q=k((function(e){return{approvalView:g(e),remiSetupApproverViewUpdateData:S(e).remiSetupApproverViewUpdateData}}),(function(e,o){const{navigate:s,location:n}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(y)&&e(B(!1))},onBackClick:()=>{L(n)?s("../../"):s("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e($(t,!1))},onEditRuleClick:t=>{t!=null?(e(d(t)),s(`./${t}/edit`)):(e(d()),s("./new"))}}}))(T(F)),Z=({isLoading:e})=>{const o=x(),s=C(),n=E(),[t,i]=p.useState(!1),[m,R]=p.useState(!1),f=u((a=>a.remiSetupApproverViewState.fetchState)),l=u((a=>I(a))),c=u((a=>g(a))),v=u((a=>S(a).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{v?.updateStatus.fetchState==="Completed"&&n(V())}),[v]),p.useEffect((()=>{t||f!=="Not-Started"||e||(i(!0),n(U(!0,!1,!1,!1)))}),[t,f,e,n]),N.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{c.allApprovalRules.length===0&&c.fetchState==="Completed"&&(m||(R(!0),n(d())),o("./new"))}),[m,c,n]);const w={events:l.companyId!=null?[`private-encrypted-${l.companyId}.${y}`]:[],eventCallback:(a,_,h)=>{a.endsWith(y)&&h.onApprovalRulesEventReceived(a)}};return l?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(D,{to:"../../promo"}):r.jsx(Q,{currentTenant:l,location:s,navigate:o,...w})},j="reimbursement-approval-rule-update",q=k((function(e){const o=g(e),s=S(e).remiSetupApproverViewUpdateData,n={};for(const i of Object.values(e.vendorState.vendorByID))i?.id!=null&&(n[i.id]=i.name);const t={};for(const i of Object.values(e.classState.classesByKey))i?.classId!=null&&(t[i.classId]=i.className);return{approvalView:o,remiSetupApproverViewUpdateData:s,vendorNamesById:n,departmentNamesById:t}}),(function(e,o){const{navigate:s,location:n}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(j)&&e(B(!1))},onBackClick:()=>{L(n)?s("../../"):s("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e($(t,!0))},onEditRuleClick:t=>{t!=null?(e(d(t)),s(`./${t}/edit`)):(e(d()),s("./new"))},onReorderRules:t=>{e(G(t,!0))}}}))(T(K)),H=()=>{const e=u((n=>I(n))),{isApprovalRulesV3Enabled:o,isLoading:s}=z(e?.tenantId);return o?r.jsx(J,{isLoading:s}):r.jsx(Z,{isLoading:s})},J=({isLoading:e})=>{const o=x(),s=C(),n=E(),[t,i]=p.useState(!1),[m,R]=p.useState(!1),f=u((a=>a.remiSetupApproverViewState.fetchState)),l=u((a=>I(a))),c=u((a=>g(a)));P();const v=u((a=>S(a).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{v?.updateStatus.fetchState==="Completed"&&n(V())}),[v]),p.useEffect((()=>{t||f!=="Not-Started"||e||(i(!0),n(U(!0,!1,!1,!0)))}),[t,f,e,n]),N.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{c.allApprovalRules.length===0&&c.fetchState==="Completed"&&(m||(R(!0),n(d())),o("./new"))}),[m,c,n]);const w={events:l.companyId!=null?[`private-encrypted-${l.companyId}.${j}`]:[],eventCallback:(a,_,h)=>{a.endsWith(j)&&h.onApprovalRulesEventReceived(a)}};return l?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(D,{to:"../../promo"}):r.jsx(q,{currentTenant:l,location:s,navigate:o,isLoading:e,...w})};function oe(){return r.jsxs(W,{children:[r.jsx(b,{path:"/",element:r.jsx(H,{})}),r.jsx(b,{path:"/new",element:r.jsx(A,{})}),r.jsx(b,{path:"/:approvalRuleId/edit",element:r.jsx(A,{})}),r.jsx(b,{path:"*",element:r.jsx(O,{})})]})}export{oe as R};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-DKL6viSK.js";import{z as h,F as S,e as u,g as E,da as k,w as I,i as C}from"./index-nBWRmUT4.js";import"./mui-sr6zger7.js";import g from"./NotFoundScreen-CdBZ6E4V.js";import{a as c}from"./sentry-DFI2OQU2.js";import{u as D,j as b,h as F,g as U,n as L,o as T,p as d,N as y}from"./core-DnZcjy6X.js";import{e$ as _,Ue as w,Uf as p,w6 as P,fO as V,Ug as z,w4 as G}from"./zeni-epic-state-m4zoW3ek.js";import"./recharts-Bim6mdwu.js";import"./analytics-DtYJ-EGT.js";import"./plaid-QvRDxgoN.js";import"./dnd-eoV-_JYH.js";import"./stripe-cKAAJElX.js";import"./lottie-Dz5luYQG.js";import"./lexical-CSqytB8g.js";import"./pdf-BNSeVvBm.js";import"./utils-cHxIh7E8.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]="24b59bde-db77-4fe1-a2bc-bd9138d1b352",e._sentryDebugIdIdentifier="sentry-dbid-24b59bde-db77-4fe1-a2bc-bd9138d1b352")}catch{}})();const O=L((function(e,t){const n=w(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=h.getSignedInUser();return{onDismissClick:()=>{e(p()),n("/")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach((m=>{s.push(m.companyName),r.push(m.emailIds[0])})),u.trackInviteEmailClicked("send",s,r,s.length)}e(G())},onUpdateInviteFormLocalData:s=>{e(z({localData:s}))},onSubmitSuccess:()=>{e(p())},onCancelClick:()=>{i!=null&&u.trackInviteEmailClicked("cancel")}}}))(k),R=()=>{const e=D(),[t,n]=c.useState(!1),[i,s]=c.useState(!1),r=b((o=>_(o))),m=F(),j=U(),f=h.getSignedInUser();if(f==null)throw Error("Can't access invite referral screen without signing in...");const l=b((o=>w(o))),x=f?.firstName!=null?f.firstName:"User";c.useEffect((()=>{e(p()),r?.rewardsLastViewedTime==null&&i===!1&&(e(P()),s(!0))}),[]),c.useEffect((()=>{t||l.fetchState!=="Not-Started"||(n(!0),e(V(!0)))}),[l.fetchState,e]);const v=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[l.fetchState==="Completed"?a.jsx(S,{analytics:u,onLoad:o=>(N=>N.trackPageLoaded(E.Event.inviteEmailViewed))(o)}):null,a.jsx(O,{navigate:m,location:j,currentTenant:r,companyName:v,userName:x,inviteFormCompayData:l.localData})]})};function ne(){const{useFeatureGate:e}=I(),{isFeatureEnabled:t}=e(C.isReferralFeatureEnabled);return a.jsxs(T,{children:[a.jsx(d,{path:"/",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(d,{path:"how-it-works",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(d,{path:"refer/*",element:t?a.jsx(R,{}):a.jsx(g,{})}),a.jsx(d,{path:"*",element:a.jsx(g,{})})]})}export{ne as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-DzdPS_ou.js","assets/sentry-DFI2OQU2.js","assets/core-DnZcjy6X.js","assets/zeni-epic-state-m4zoW3ek.js","assets/index-nBWRmUT4.js","assets/mui-sr6zger7.js","assets/analytics-DtYJ-EGT.js","assets/utils-cHxIh7E8.js","assets/withTransactionSidePanel-CWy10IlG.js","assets/useAskAiCfoHostNavButtonProps-BqNcSAwL.js","assets/TransactionDetailScreen-D0qCr6b1.js","assets/decodeURIComponentSafe-CjxujRw-.js","assets/routePaths-D0N7YUlE.js","assets/NotFoundScreen-CdBZ6E4V.js","assets/useInitialThreadRequest-Ch4ouOBD.js","assets/analyticsHelper-CTlcOyiL.js","assets/CompanyPassportScreen-RJZfjyND.js","assets/MobileAppDrawer-KiFiOGbB.js","assets/useAiCfoDashboardSuggestedQuestionsChips-Bcrl6X1X.js","assets/FeaturePreviewScreen-BuOhC0VV.js","assets/index-Cx4f0JbF.css","assets/BillPayRoutes-Ee1gMZDl.js","assets/AddressScreen-ApC_R0Wp.js","assets/DomesticWireDetailScreen-BkAznvqR.js","assets/DrawerScreen-DbGHqqp3.js","assets/SetupPagesScreen-usZWca-_.js","assets/BusinessVerificationPageScreen-BrCTRscW.js","assets/BillPayApprovalRoutes-DNBT8bBe.js","assets/ReimbursementApprovalRuleDetailScreen-DOYdcnj3.js","assets/getLocaleForTenant-CtnTFS0P.js","assets/ReimbursementRoutes-CVrOZVi7.js","assets/ReimbursementApprovalRoutes-vvvoQ_Sf.js","assets/TransactionListRoutes-DIJytNYy.js","assets/ZeniAccountStatementScreen-Dyx3X86U.js","assets/SettingsRoutes-DqjN1ABZ.js","assets/accountMappingHelper-B-kf-Qnc.js","assets/useEmailConnectResultRefresh-DZSBVmEz.js","assets/QBOConnectionScreen-BcAa0XdH.js","assets/empty-DkIaLxCd.js","assets/index-Dmm4l94W.js","assets/url-p6YiHaLn.js","assets/index-DUKU6sVX.js","assets/ReportsRoutes-BSaDsWab.js","assets/ChargeCardRoutes-BnvieJVH.js","assets/useChargeCardPusherEvents-uhG5ouo_.js","assets/PeopleRoutes-DQ4ywy5y.js","assets/ExpenseAutomationRoutes-DRT8zgD0.js","assets/TreasuryRoutes-BxXAoPv6.js","assets/useCashManagementBanner-rPbgM7YP.js","assets/VendorsRoutes-C0IKd0L4.js","assets/pathToGoBack-DpO-gBzq.js","assets/ZeniAccountRoutes-DyxLcHZW.js","assets/AddressRoutes-OroYq1dZ.js","assets/PandLWithForecastRoutes-CYJYOUC0.js","assets/CustomerOnboardingRoutes-CHFrWBuQ.js","assets/TransactionDetailRoutes-BiA_QHF1.js","assets/EntityDetailRoutes-BZZT4beI.js","assets/NotificationRoutes-BuE5Ia0t.js","assets/PerformanceRoutes-DlI-5IYy.js","assets/RewardsRoutes-DsYtBmZx.js","assets/TaskRoutes-C6C-H9ff.js","assets/TaskListScreen-DduFWf5s.js","assets/AiCfoScreen-ceOXZKkH.js","assets/CardsAiCfoScreen-C_N9OShc.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{_ as t,bn as ls,e$ as us,fI as ds,fG as cs,gq as ms,fv as _s,cX as Ee,cD as hs,fY as Es,cv as ps,bE as xs,bo as Rs,g0 as gs,v as Is,Mt as js,bs as Ts,Mu as As,bK as fs,bJ as Ds,bt as ys,cr as bs,Mv as Cs,Mw as vs,cT as ws,cW as Us,cV as Os,cC as Ps,cJ as Fs,on as pe,fE as xe,gD as Ls,g4 as Re,gA as ge,gB as Ie,g5 as ks}from"./zeni-epic-state-m4zoW3ek.js";import{j as e}from"./liveblocks-DKL6viSK.js";import{a as O}from"./sentry-DFI2OQU2.js";import{u as Bs,h as Hs,i as Vs,g as Ss,j as G,l as je,N as u,o as Ns,p as a}from"./core-DnZcjy6X.js";import{E as Ms,u as Zs,z as y,w as Gs,c as zs,_ as $s,i as z,d as Ys,C as Ws,D as qs,L as F,a as Te,t as _,P as Js,e as Q,l}from"./index-nBWRmUT4.js";import"./mui-sr6zger7.js";import{f as Ae}from"./analyticsHelper-CTlcOyiL.js";import{t as Ks}from"./getLocaleForTenant-CtnTFS0P.js";import"./recharts-Bim6mdwu.js";import"./analytics-DtYJ-EGT.js";import"./plaid-QvRDxgoN.js";import"./dnd-eoV-_JYH.js";import"./stripe-cKAAJElX.js";import"./lottie-Dz5luYQG.js";import"./lexical-CSqytB8g.js";import"./pdf-BNSeVvBm.js";import"./utils-cHxIh7E8.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},T=new o.Error().stack;T&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[T]="a17fb5ea-68e8-45d1-98c1-45fa710b4ea3",o._sentryDebugIdIdentifier="sentry-dbid-a17fb5ea-68e8-45d1-98c1-45fa710b4ea3")}catch{}})();const Xs={dashboard:()=>t((()=>import("./DashboardRoutes-DzdPS_ou.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])),bills:()=>t((()=>import("./BillPayRoutes-Ee1gMZDl.js")),__vite__mapDeps([21,1,2,3,4,5,6,7,22,13,23,9,14,24,17,19,25,15,12,26,27,28,29,20])),reimbursement:()=>t((()=>import("./ReimbursementRoutes-CVrOZVi7.js")),__vite__mapDeps([30,1,2,3,4,5,6,7,13,25,17,15,12,26,19,9,14,24,31,28,29,20])),transactions:()=>t((()=>import("./TransactionListRoutes-DIJytNYy.js")),__vite__mapDeps([32,1,2,3,4,5,6,7,8,9,10,11,12,33,20])),settings:()=>t((()=>import("./SettingsRoutes-DqjN1ABZ.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,17,35,22,13,15,26,12,16,36,37,38,39,40,41,11,27,28,31,20])),reports:()=>t((()=>import("./ReportsRoutes-BSaDsWab.js")),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,20])),chargeCards:()=>t((()=>import("./ChargeCardRoutes-BnvieJVH.js")),__vite__mapDeps([43,1,2,3,4,5,6,7,9,17,25,13,15,12,26,14,44,22,20])),people:()=>t((()=>import("./PeopleRoutes-DQ4ywy5y.js")),__vite__mapDeps([45,1,2,3,4,5,6,7,13,9,17,20])),expenseAutomation:()=>t((()=>import("./ExpenseAutomationRoutes-DRT8zgD0.js")),__vite__mapDeps([46,1,2,3,13,4,5,6,7,9,10,11,12,8,35,24,20])),treasury:()=>t((()=>import("./TreasuryRoutes-BxXAoPv6.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,13,25,17,15,12,26,9,14,48,19,20])),vendors:()=>t((()=>import("./VendorsRoutes-C0IKd0L4.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,22,13,19,12,50,9,17,24,35,20])),zeniAccounts:()=>t((()=>import("./ZeniAccountRoutes-DyxLcHZW.js")),__vite__mapDeps([51,1,2,3,4,5,6,7,48,13,25,17,15,12,26,19,23,22,9,33,20]))},Qs=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},et=l((()=>t((()=>import("./ReportsRoutes-BSaDsWab.js")),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,20])))),st=l((()=>t((()=>import("./AddressRoutes-OroYq1dZ.js")),__vite__mapDeps([52,1,2,3,22,4,5,6,7,13,20])))),tt=l((()=>t((()=>import("./PeopleRoutes-DQ4ywy5y.js")),__vite__mapDeps([45,1,2,3,4,5,6,7,13,9,17,20])))),nt=l((()=>t((()=>import("./PandLWithForecastRoutes-CYJYOUC0.js")),__vite__mapDeps([53,1,2,3,4,5,6,7,13,19,9,14,12,17,20])))),at=l((()=>t((()=>import("./CustomerOnboardingRoutes-CHFrWBuQ.js")),__vite__mapDeps([54,1,2,3,22,4,5,6,7,13,37,38,39,40,41,11,36,44,20])))),ot=l((()=>t((()=>import("./VendorsRoutes-C0IKd0L4.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,22,13,19,12,50,9,17,24,35,20])))),rt=l((()=>t((()=>import("./TransactionDetailRoutes-BiA_QHF1.js")),__vite__mapDeps([55,1,2,3,13,4,5,6,7,10,9,11,12,20])))),fe=l((()=>t((()=>import("./EntityDetailRoutes-BZZT4beI.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,11,8,9,10,12,20])))),it=l((()=>t((()=>import("./DashboardRoutes-DzdPS_ou.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])))),De=l((()=>t((()=>import("./BillPayRoutes-Ee1gMZDl.js")),__vite__mapDeps([21,1,2,3,4,5,6,7,22,13,23,9,14,24,17,19,25,15,12,26,27,28,29,20])))),lt=l((()=>t((()=>import("./SettingsRoutes-DqjN1ABZ.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,17,35,22,13,15,26,12,16,36,37,38,39,40,41,11,27,28,31,20])))),ye=l((()=>t((()=>import("./ReimbursementRoutes-CVrOZVi7.js")),__vite__mapDeps([30,1,2,3,4,5,6,7,13,25,17,15,12,26,19,9,14,24,31,28,29,20])))),ut=l((()=>t((()=>import("./ZeniAccountRoutes-DyxLcHZW.js")),__vite__mapDeps([51,1,2,3,4,5,6,7,48,13,25,17,15,12,26,19,23,22,9,33,20])))),dt=l((()=>t((()=>import("./TreasuryRoutes-BxXAoPv6.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,13,25,17,15,12,26,9,14,48,19,20])))),ct=l((()=>t((()=>import("./TransactionListRoutes-DIJytNYy.js")),__vite__mapDeps([32,1,2,3,4,5,6,7,8,9,10,11,12,33,20])))),mt=l((()=>t((()=>import("./ChargeCardRoutes-BnvieJVH.js")),__vite__mapDeps([43,1,2,3,4,5,6,7,9,17,25,13,15,12,26,14,44,22,20])))),_t=l((()=>t((()=>import("./NotificationRoutes-BuE5Ia0t.js")),__vite__mapDeps([57,1,2,3,13,4,5,6,7,9,20])))),ht=l((()=>t((()=>import("./PerformanceRoutes-DlI-5IYy.js")),__vite__mapDeps([58,1,2,3,13,4,5,6,7,9,17,20])))),Et=l((()=>t((()=>import("./ExpenseAutomationRoutes-DRT8zgD0.js")),__vite__mapDeps([46,1,2,3,13,4,5,6,7,9,10,11,12,8,35,24,20])))),pt=l((()=>t((()=>import("./RewardsRoutes-DsYtBmZx.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,13,20])))),xt=l((()=>t((()=>import("./TaskRoutes-C6C-H9ff.js")),__vite__mapDeps([60,1,2,3,13,4,5,6,7,14,17,61,9,20])))),Rt=l((()=>t((()=>import("./AiCfoScreen-ceOXZKkH.js")),__vite__mapDeps([62,1,2,3,4,5,6,7,18,50,20])))),be=l((()=>t((()=>import("./CardsAiCfoScreen-C_N9OShc.js")),__vite__mapDeps([63,1,2,3,4,5,6,7,20])))),C=l((()=>t((()=>import("./NotFoundScreen-CdBZ6E4V.js")),__vite__mapDeps([13,1,2,3,4,5,6,7,20])))),gt=l((()=>t((()=>import("./TaskListScreen-DduFWf5s.js").then((o=>o.f))),__vite__mapDeps([61,1,2,3,4,5,6,7,9,17,20]))));function St({setTenantEmailDomain:o}){const T=Bs(),V=Hs(),{tenantEmailDomain:i}=Vs(),L=Ms().mode,{setLoading:w,clearAllLoading:v,clearLoading:k}=Zs(),A=y.getSignedInUserTenant(i)?.tenantId,I=y.getSignedInUser(),se=ls(I),$=Ss(),[B,Oe]=O.useState(!1),r=G((n=>us(n))),{useFeatureGate:N}=Gs(),M=zs(),te=$s(),Pe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Fe=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:Le}=N(z.isChargeCardFeatureEnabled),{isFeatureEnabled:ne}=N(z.isDebitCardFeatureEnabled),f=G((n=>n.tenantState.fetchState)),j=G((n=>n.tenantState.activeTenantFetchState.fetchState)),h=j==="Completed"||f==="Completed"?ds(ne,r):void 0,J=j==="Completed"||f==="Completed"?cs(r):void 0,ke=Ys(r,Le,ne),{isCardsHidden:Be}=Ws(r?.tenantId),He=!ke||!!Be,{isFeatureEnabled:Ve}=N(z.isSettingsFeatureEnabled),{isFeatureEnabled:K}=N(z.isAiCfoFileUploadEnabled),Y=G((n=>ms(n)));if(i!=null){const n=y.getSignedInUserTenant(i);I!=null&&n!=null&&Ae(I,r,L)}const Z={tenantId:A,userId:I?.userId,sessionId:I?.zeniSessionId},ae=_s(),E=qs(),Se=r.company==null||E?.loggedInUserRoleMap!=null&&Ee(E.loggedInUserRole),Ne=hs(E?.loggedInUserRoleMap),oe=je("/:tenantEmailDomain/onboarding/*")!==null,X=je("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Me=G((n=>Z.tenantId!=null?Es(n,Z.tenantId):void 0));O.useEffect((()=>{w(F.TENANT_FETCHING),o(i)}),[i]),O.useEffect((()=>{if(X!=null&&A!=null){const n=X.params.selectedPeriod;if(n!=null){const D=n.split("-");if(D.length===2){const d=ps(Number(D[0])),s=Number(D[1]),c=xs(`01-${d<10?`0${d}`:d}-${s}`,Te.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),S=Rs();c.isAfter(S,"month")===!1?T(gs(A,{month:d,year:s})):V("./month_end_close_checks/review")}}}}),[X,A]),O.useEffect((()=>{B||(Oe(!0),w(F.TENANT_FETCHING))}),[B,Z,ae,I,T,y]),O.useLayoutEffect((()=>{!Is(ae,Z)&&y.isSignedIn()&&(w(F.TENANT_FETCHING),(function(n,D,d,s){if(xe(D?.userId,D?.zeniSessionId,n.tenantId),d(Ls(!0)),d(Re(n.tenantId)),n.tenantId!=null&&_.clearTenant(n.tenantId),n.tenantId!=null){const c=y.getSignedInUserTenantWithId(n.tenantId);s&&Te.updateAppLocaleID(Ks(s)),c?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(c?.tenantEmailDomain)}n.userId!=null?Q.identify(n.userId,{tenant_id:n.tenantId}):Q.resetUserIdentity()})(Z,I,T,Me))}),[A]),O.useEffect((()=>{y.isSignedIn()&&(w(F.TENANT_FETCHING),(function(n,D,d,s,c,S,H){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const W=s!=null&&c?.zeniSessionId!=null,os=d==null||d.tenantId!==s,rs=d!=null&&d.excludedResources==null,is=d!=null&&d.externalConnections==null;if(W&&os){H(Re(s));const q=y.getSignedInUserTenantWithId(s);q?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(q?.tenantEmailDomain),xe(c?.userId,c?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),H(ge(c.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),H(Ie(c.userId,s)))}else W&&rs&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),H(ge(c.userId,s))),W&&is&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),H(Ie(c.userId,s)));if(W){Q.identify(c.userId,{tenant_id:s});const q=s==null||s!=null&&(D==="Completed"||D==="Error");n==="Completed"||D!=="Not-Started"&&D!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),S(F.TENANT_FETCHING),H(ks(c.userId,s,c.zeniSessionId))),q&&(n==="Not-Started"||n==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),H(pe(c.userId,c.zeniSessionId)))}})(f,j,r,A,I,w,T))}),[A,j]),O.useEffect((()=>{y.isSignedIn()&&f==="Completed"&&Y.tenantsBaseInOrder.length>0&&(k(F.TENANT_FETCHING),y.saveSignedInUserTenants(js(Y.tenantsBaseInOrder)),I!=null&&Ae(I,r,L,void 0,Y.tenantsBaseInOrder))}),[Y,f,r,I]),O.useEffect((()=>{j==="In-Progress"&&w(F.TENANT_FETCHING),j!=="Completed"&&j!=="Error"||(j==="Completed"&&A!=null?(v(),_.markActiveTenantFetchCompleted(A)):j==="Error"&&A!=null&&(_.markActiveTenantFetchFailed(A),k(F.TENANT_FETCHING),k(F.TENANT_SWITCHING))),f!=="Completed"&&f!=="Error"||(f==="Completed"?_.markAllTenantsFetchCompleted():f==="Error"&&_.markAllTenantsFetchFailed())}),[j,f,A,B]);const re=O.useRef(!1);O.useEffect((()=>{!re.current&&j==="Completed"&&B&&(re.current=!0,(function(n=Qs,D=3e3){setTimeout((()=>{const d=s=>{if(s>=n.length)return;const c=n[s],S=Xs[c];S!=null?S().then((()=>ee((()=>d(s+1))))).catch((()=>ee((()=>d(s+1))))):d(s+1)};ee((()=>d(0)))}),D)})())}),[j,B]);const U=r?.userRole!=null&&Ts(r?.userRole),{isFeatureEnabled:Ze}=N(z.isReferralFeatureEnabled),Ge=r?.userRole!=null&&r.userRole.includes("charge_card_user"),ze=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),P=r?.userRole!=null&&Ee(r.userRole),ie=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!U,le=!He&&!U,$e=As(E?.loggedInUserRoleMap),Ye=r.externalConnections?.accounting[0]?.isValid,We=r.externalConnections?.fetchState==="Completed",ue=r.company?.companyOnboardingInfo.isOnboardingCompleted,de=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!U,ce=de&&fs(E?.loggedInUserRoleMap),me=Pe&&!U,qe=Fe&&!U,Je=ie&&Ds(E?.loggedInUserRoleMap),Ke=le&&ys(E?.loggedInUserRoleMap),Xe=me&&bs(E?.loggedInUserRoleMap),Qe=Cs(E?.loggedInUserRoleMap),es=vs(E?.loggedInUserRoleMap),ss=ws(E?.loggedInUserRoleMap),ts=Us(E?.loggedInUserRoleMap),ns=Os(E?.loggedInUserRoleMap),p=Ps(E?.loggedInUserRoleMap),x=Fs(E?.loggedInUserRoleMap),_e=ie&&p,he=de&&x,R=me&&ss,g=qe&&ts,m=le&&ns,as=r.excludedResources?.resources?.find((n=>n.resource==="/invites"))!=null||Ne===!0||$e===!0||Qe===!0||es===!0;return y.isSignedIn()?A==null?f==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(I!=null&&f!=="In-Progress"&&T(pe(I.userId,I.zeniSessionId)),null):j!=="In-Progress"&&j!=="Not-Started"||f==="Completed"?(ue===!0||se&&!oe)&&We&&Ye!==!0&&h===!1&&J===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!B||ue!==!1||oe||se?B&&r?.userRole&&h!=null&&J!=null&&i!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(Ns,{children:e.jsxs(a,{element:e.jsx(Js,{}),children:[e.jsx(a,{path:"/",element:e.jsx(It,{isDashboardAccess:P,showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,isTenantCardsOnly:J,showChargeCardRoute:m})}),e.jsx(a,{path:"dashboard/*",element:P?e.jsx(it,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reports/*",element:P?e.jsx(et,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"people/*",element:as||P?e.jsx(tt,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"forecast/*",element:P?e.jsx(nt,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"onboarding/*",element:e.jsx(at,{})}),e.jsx(a,{path:"transaction/*",element:P&&U===!1||Ge||ze?e.jsx(rt,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"transactions/*",element:P&&U===!1?e.jsx(ct,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"customer/*",element:P&&U===!1?e.jsx(fe,{entityType:"customer"}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,isTenantBankingOnly:h,showTreasuryRoute:g,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"vendor/*",element:P&&U===!1?e.jsx(fe,{entityType:"vendor"}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"tasks",element:e.jsx(gt,{})}),e.jsx(a,{path:"tasks/*",element:e.jsx(xt,{})}),e.jsx(a,{path:"address/*",element:Je||ce||Xe||Ke?e.jsx(st,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"checking/*",element:R?e.jsx(ut,{}):e.jsx(C,{})}),e.jsx(a,{path:"treasury/*",element:g?e.jsx(dt,{}):e.jsx(C,{})}),e.jsx(a,{path:"performance",element:te===!0?e.jsx(ht,{}):e.jsx(Ue,{tenantEmailDomain:i})}),e.jsx(a,{path:"month_end_close_checks/review/*",element:te===!0&&U===!1?e.jsx(Et,{}):e.jsx(Ue,{tenantEmailDomain:i})}),e.jsx(a,{path:"notifications/*",element:e.jsx(_t,{})}),e.jsx(a,{path:"vendors/*",element:Se?e.jsx(ot,{}):e.jsx(C,{})}),e.jsx(a,{path:"bill/*",element:_e?e.jsx(De,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"bills/*",element:_e?e.jsx(De,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursement/*",element:he?e.jsx(ye,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursements/*",element:he?e.jsx(ye,{}):e.jsx(b,{showZeniAccountRoute:R,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:x,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"settings/*",element:Ve?e.jsx(lt,{hasAdminLevelAccess:ce}):e.jsx(C,{})}),e.jsx(a,{path:"cards/ask",element:m&&M?e.jsx(be,{isFileUploadEnabled:K}):e.jsx(C,{})}),e.jsx(a,{path:"cards/ask/:session_id",element:m&&M?e.jsx(be,{isFileUploadEnabled:K}):e.jsx(C,{})}),e.jsx(a,{path:"cards/*",element:m?e.jsx(mt,{}):e.jsx(C,{})}),e.jsx(a,{path:"rewards/*",element:Ze?e.jsx(pt,{}):e.jsx(C,{})}),e.jsx(a,{path:"/ai-cfo",element:M?e.jsx(u,{to:"explore"}):e.jsx(C,{})}),e.jsx(a,{path:"/ai-cfo/",element:M?e.jsx(u,{to:"explore"}):e.jsx(C,{})}),e.jsx(a,{path:"/ai-cfo/:session_id",element:M?e.jsx(Rt,{isFileUploadEnabled:K}):e.jsx(C,{})}),e.jsx(a,{path:"*",element:e.jsx(C,{})})]})}):null:(o(void 0),e.jsx(u,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),o(void 0),e.jsx(u,{to:"/signin/auth",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}))}const It=({isDashboardAccess:o,showZeniAccountRoute:T,isUserHasBillPayAccess:V,isUserHasReimbursementAccess:i,showTreasuryRoute:L,isTenantBankingOnly:w,isTenantCardsOnly:v,showChargeCardRoute:k})=>{if(w===!0){if(T)return e.jsx(u,{to:"checking"});if(L)return e.jsx(u,{to:"treasury"});if(k)return e.jsx(u,{to:"cards"})}return v===!0&&k?e.jsx(u,{to:"cards"}):o?e.jsx(u,{to:"dashboard"}):T?e.jsx(u,{to:"checking"}):L?e.jsx(u,{to:"treasury"}):k?e.jsx(u,{to:"cards"}):V?e.jsx(u,{to:"bills"}):i?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},b=({showZeniAccountRoute:o,isUserHasBillPayAccess:T,isUserHasReimbursementAccess:V,showTreasuryRoute:i,isTenantBankingOnly:L,showChargeCardRoute:w,tenantEmailDomain:v})=>{if(L===!0){if(o)return e.jsx(ve,{tenantEmailDomain:v});if(i)return e.jsx(Ce,{tenantEmailDomain:v});if(w)return e.jsx(we,{tenantEmailDomain:v})}return o?e.jsx(ve,{tenantEmailDomain:v}):i?e.jsx(Ce,{tenantEmailDomain:v}):w?e.jsx(we,{tenantEmailDomain:v}):T?e.jsx(Tt,{tenantEmailDomain:v}):V?e.jsx(jt,{tenantEmailDomain:v}):e.jsx(C,{})},jt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/reimbursements`}),Tt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/bills`}),Ce=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/treasury`}),ve=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/checking`}),we=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/cards`}),Ue=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/dashboard`});export{b as FallBackRoute,St as default};
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./liveblocks-DKL6viSK.js";import{a as u}from"./sentry-DFI2OQU2.js";import{h as L,g as G,u as R,j as y,s as le,n as H,i as Z,o as ne,p as v}from"./core-DnZcjy6X.js";import{bn as De,e$ as j,gy as Me,nd as re,OO as Te,hO as he,OF as Re,re as Ue,kL as be,n9 as _e,hQ as Fe,OH as Oe,OG as Be,R5 as Ve,zJ as ze,Fa as Le,QG as Ne,QP as $e,c7 as ae,cO as Ge,cP as He,bs as Ze,MG as Ke,y9 as Qe,R6 as Je,HB as qe,ES as Ye,EJ as ye,EG as We,yd as Se,EM as Ce,EP as Ie,EV as oe,uz as se,yc as Xe,kn as Y,kq as Ae,R7 as en,lr as nn,ys as tn,Nx as an,Ny as on,kl as sn,R8 as cn,ko as ln,rI as rn,Ns as dn,Nt as un,rM as pn,hz as gn,MO as ee,hr as de,ho as mn,hw as fn,MP as hn,yp as bn,R9 as yn,Ra as Sn,F7 as Cn,fG as Ee,fI as xe,Rb as In,gj as An,MY as En,yo as ue,go as pe,gn as xn,yn as vn,gm as wn,gl as kn,Rc as Pn,fL as ve,Rd as jn,Re as Dn,yv as Mn,ym as ge,Rf as Tn,f$ as Rn,yj as Un,b_ as _n,c6 as Fn,c5 as On,b$ as Bn,c3 as Vn,c2 as zn,c1 as Ln,c4 as Nn,c0 as $n}from"./zeni-epic-state-m4zoW3ek.js";import{w as W,i as B,z as k,ag as we,bR as Gn,e as K,g as Hn,bC as Zn,D as Q,B as ie,bS as Kn,d as ke,C as Pe,bT as Qn,ar as Jn,k as je,bU as qn,bV as Yn,bW as Wn,Z as Xn,bX as et,r as nt,bY as tt}from"./index-nBWRmUT4.js";import{n as V}from"./mui-sr6zger7.js";import{M as F}from"./MobileAppDrawer-KiFiOGbB.js";import{a as J,g as q,m as at}from"./accountMappingHelper-B-kf-Qnc.js";import{t as ot,A as st}from"./AddressScreen-ApC_R0Wp.js";import $ from"./NotFoundScreen-CdBZ6E4V.js";import{g as it}from"./analyticsHelper-CTlcOyiL.js";import{B as ct}from"./BusinessVerificationPageScreen-BrCTRscW.js";import{C as lt}from"./CompanyPassportScreen-RJZfjyND.js";import{u as rt,a as dt}from"./useEmailConnectResultRefresh-DZSBVmEz.js";import{q as me}from"./QBOConnectionScreen-BcAa0XdH.js";import{B as ut}from"./BillPayApprovalRoutes-DNBT8bBe.js";import{R as pt}from"./ReimbursementApprovalRoutes-vvvoQ_Sf.js";import"./recharts-Bim6mdwu.js";import"./analytics-DtYJ-EGT.js";import"./plaid-QvRDxgoN.js";import"./dnd-eoV-_JYH.js";import"./stripe-cKAAJElX.js";import"./lottie-Dz5luYQG.js";import"./lexical-CSqytB8g.js";import"./pdf-BNSeVvBm.js";import"./utils-cHxIh7E8.js";import"./routePaths-D0N7YUlE.js";import"./empty-DkIaLxCd.js";import"./pdf-lib-DwpnbCVp.js";import"./index-Dmm4l94W.js";import"./url-p6YiHaLn.js";import"./index-DUKU6sVX.js";import"./decodeURIComponentSafe-CjxujRw-.js";import"./ReimbursementApprovalRuleDetailScreen-DOYdcnj3.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="a44bb73d-6249-4b05-819b-cf4d07c9cc84",e._sentryDebugIdIdentifier="sentry-dbid-a44bb73d-6249-4b05-819b-cf4d07c9cc84")}catch{}})();const gt=V.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
height: 100%;
|
|
4
|
-
width: 100%;
|
|
5
|
-
flex: 1 1 auto;
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
align-items: center;
|
|
8
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,mt=H((function(e,a){return{accountMappingView:a.accountMappingView,isFiling1099FeatureEnabled:a.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:a.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:be(e),isAccountingClassesUpdateInProgress:e.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:Ue(e),meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",isCapitalizationFeatureEnabled:a.isCapitalizationFeatureEnabled,capitalizableAccounts:a.capitalizableAccounts,accountNamesById:a.accountNamesById,capitalizableAccountOverrides:a.capitalizableAccountOverrides,isCapitalizationThresholdSaving:a.isCapitalizationThresholdSaving,onSaveCapitalizationAccountThreshold:a.onSaveCapitalizationAccountThreshold}}),(function(e,a){const{navigate:s,location:c,isFiling1099FeatureEnabled:l}=a;return{onAccountMappingChange:n=>{const{uncategorizedAccountSection:t,billsAccountSection:i,reimbursementsAccountSection:p,vendorsAccountSection:m,filing1099Section:f}=n,{incomeAccount:S,expenseAccount:g}=t,{billPayAccount:r}=i,{reimbursementsAccount:b}=p,{prepaidExpensesAccount:I,fixedAssetsAccount:w,accruedExpensesAccount:E}=m,{bankAccount:h,expenseCategory1099:A}=f,U=J(a.accountMappingView.incomeAccountList,S.selectedOption),M=J(a.accountMappingView.expenseAccountList,g.selectedOption),x=J(a.accountMappingView.billPayAccountList,r.selectedOption),_=J(a.accountMappingView.reimbursementsAccountList,b.selectedOption),D=q(a.accountMappingView.prepaidExpensesAccountList,I.selectedOptions),N=q(a.accountMappingView.fixedAssetsAccountList,w.selectedOptions),O=q(a.accountMappingView.accruedExpensesAccountList,E.selectedOptions),d=q(a.accountMappingView.bankAccounts1099FilingAccountList,h.selectedOptions),C=at(a.accountMappingView.expenseAccounts1099FilingAccountList,A),T={selectedIncomeAccountId:U?.accountId,selectedExpenseAccountId:M?.accountId,selectedBillPayAccountId:x?.accountId,selectedReimbursementsAccountId:_?.accountId,selectedPrepaidExpensesAccountIds:D.map((P=>P.accountId)),selectedFixedAssetsAccountIds:N.map((P=>P.accountId)),selectedAccruedExpensesAccountIds:O.map((P=>P.accountId)),selectedBankAccounts1099FilingAccountIds:d.map((P=>P.accountId)),selectedExpenseAccounts1099FilingAccountIds:C};e(Be({data:T}))},onBackClick:()=>{we(c)===!1?(s("../../dashboard"),e(Oe())):e(he())},onSaveClick:()=>{e(Fe()),l&&K.track(Hn.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:n=>{e(_e(a.currentTenant.companyId,n))}}}))(Gn),ft=()=>{const e=L(),a=G(),s=R(),{useFeatureGate:c,useDynamicConfig:l}=W(),{isFeatureEnabled:n}=c(B.isFiling1099FeatureEnabled),{isFeatureEnabled:t}=c(B.isScheduledJEAccruedExpensesFeatureEnabled),{configValue:i,isDynamicConfigLoading:p}=l("transaction_categorization_config"),m=!p&&i?.capitalization_enabled===!0,f=k.getSignedInUser(),S=De(f),g=y((d=>j(d))),{capitalizableAccounts:r,capitalizableAccountOverrides:b,isCapitalizationThresholdSaving:I,currencySymbol:w}=y((d=>{const C=d.tenantState.currentTenantId,T=C!=null?d.tenantState.tenantsById[C]:void 0,P=Me(d.companyState,g.companyId);return{capitalizableAccounts:T?.capitalizableAccounts??null,capitalizableAccountOverrides:T?.capitalizableAccountOverrides??null,isCapitalizationThresholdSaving:d.companyViewState.passportView?.capitalizationThresholdUpdateStatus?.fetchState==="In-Progress",currencySymbol:P?.company.companyLocaleInfo?.currencySymbol??"$"}}),le),E=u.useCallback(((d,C)=>{s(re(g.companyId,d,C))}),[s,g.companyId]),h=u.useCallback((d=>{const C={...b??{}},T=Object.entries(d);for(const[z,ce]of T)ce===null?delete C[z]:C[z]=ce;const[P,X]=T[0]??[];P!=null&&s(re(g.companyId,P,X,void 0,Object.keys(C).length>0?C:null))}),[s,g.companyId,b]),A=y((d=>Te(d.accountState)),le),U=u.useMemo((()=>{const d={};for(const C of A)C.accountId!=null&&C.accountName!=null&&(d[C.accountId]=C.accountName);return d}),[A]),[M,x]=u.useState(!1),[_,D]=u.useState(!1);u.useEffect((()=>{M===!1&&(s(he()),x(!0))}),[M]);const N=y((d=>Re(d))),O=d=>{D(d)};return o.jsxs(gt,{children:[o.jsx(F,{isAppContentDrawerOpen:_,handleDrawerToggle:O}),o.jsx(mt,{currentTenant:g,navigate:e,accountMappingView:N,isFiling1099FeatureEnabled:n&&S,isAccruedExpensesFeatureEnabled:t,isCapitalizationFeatureEnabled:m,capitalizableAccounts:r,accountNamesById:U,capitalizableAccountOverrides:b,currencySymbol:w,isCapitalizationThresholdSaving:I,onSaveCapitalizationAccountThreshold:E,onSaveCapitalizationAccountThresholds:h,location:a,isSettings:we(a),onClickMenuIcon:()=>O(!0)})]})},ht=V.div`
|
|
10
|
-
display: flex;
|
|
11
|
-
height: 100%;
|
|
12
|
-
width: 100%;
|
|
13
|
-
flex: 1 1 auto;
|
|
14
|
-
flex-direction: column;
|
|
15
|
-
align-items: center;
|
|
16
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
17
|
-
`,bt=H((function(e,a){const s=j(e),c=Ne(e),l=$e(e),n=a.roleMap.bill_pay_admin;return{isDisabled:(ae(s?.userRole??[])||n)&&"readonly",billpayApprovalView:c,remiApproverView:l,analytics:K}}),(function(e,a){const{navigate:s,currentTenant:c}=a;return{onSetupApprovalRulesBillPaySectionClick:()=>{s("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{s("reimbursements/approval-rules")},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}}))(Kn),yt=()=>{const e=L(),a=G(),s=R(),{tenantEmailDomain:c}=Z(),[l,n]=u.useState(!1),[t,i]=u.useState(!1),[p,m]=u.useState(!1),f=y((A=>j(A))),S=y((A=>A.billPaySetupApproverViewState.fetchState)),g=y((A=>A.remiSetupApproverViewState.fetchState)),r=y((A=>Ve(A))),{isApprovalRulesV3Enabled:b,isLoading:I}=Zn(f?.tenantId),w=f.companyId??k.getSignedInUserTenant(c)?.companyId;if(k.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const E=Q();u.useEffect((()=>{p||S!=="Not-Started"||I||(m(!0),s(ze(!0,!0,b)))}),[p,S,I,b,s]),u.useEffect((()=>{t||g!=="Not-Started"||I||(i(!0),s(Le(!0,!1,!1,b)))}),[t,g,I,b,s]);const h=A=>{n(A)};return E?.loggedInUserRoleMap!=null?o.jsxs(ht,{children:[o.jsx(F,{isAppContentDrawerOpen:l,handleDrawerToggle:h}),o.jsx(bt,{navigate:e,location:a,companyId:w,currentTenant:f,roleMap:E.loggedInUserRoleMap,onClickMenuIcon:()=>{h(!0)}})]}):o.jsx(ie,{fetchState:r.fetchState})},St=V.div`
|
|
18
|
-
display: flex;
|
|
19
|
-
height: 100%;
|
|
20
|
-
width: 100%;
|
|
21
|
-
flex: 1 1 auto;
|
|
22
|
-
flex-direction: column;
|
|
23
|
-
align-items: center;
|
|
24
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
25
|
-
`,Ct=H((function(e,a){const{companyId:s,isZeniAccountEnabled:c,isChargeCardEnabled:l,isBillPayEnabled:n,isRemiEnabled:t,isTreasuryEnabled:i}=a,p=j(e);return{bankSetupView:Je(e,s,n,t,c,l,i),connectedAccountProvider:p.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:K}}),(function(e,a){const{navigate:s,currentTenant:c,companyId:l}=a;return{onFetchLinkTokenClick:(n,t,i)=>{e(se(t,n,i))},onEstablishConnectionClick:(n,t,i)=>{e(oe(n,l,t,i))},onUpdatePaymentAccountStatus:(n,t,i,p,m)=>{e(Ie(n,t,m,p,i))},onUpdatePaymentAccountLoginStatus:(n,t,i,p)=>{e(Ce(!1,n,p,i,t))},onEstablishConnectionSuccess:(n,t)=>{e(Se(t,n))},onUpdateAccountClick:(n,t,i,p,m)=>{e(m==="paymentAccount"?ye(n,t,i,p):We(p,n,t))},onUpdatePrimaryFundingAccount:(n,t,i)=>{e(Ye(l,t,n,i))},onRemoveConnection:n=>{e(qe(n))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}}))(Qn),It=()=>{const e=L(),a=G(),s=R(),{tenantEmailDomain:c}=Z(),l=Q(),{useFeatureGate:n}=W(),{isFeatureEnabled:t}=n(B.isChargeCardFeatureEnabled),{isFeatureEnabled:i}=n(B.isDebitCardFeatureEnabled),[p,m]=u.useState(!1),[f,S]=u.useState(!1),g=y((D=>j(D))),r=y((D=>D.settingsViewState.bankConnection.fetchState)),b=Ge(g,l?.loggedInUserRoleMap),I=He(g,l?.loggedInUserRoleMap),w=g?.userRole!=null&&Ze(g.userRole),E=!!g.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!w,h=g.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!w,A=ke(g,t,i),U=Ke(g,l?.loggedInUserRoleMap)&&A,{isCardsHidden:M}=Pe(g?.tenantId),x=g.companyId??k.getSignedInUserTenant(c)?.companyId;if(k.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");u.useEffect((()=>{f||r==="Completed"||(S(!0),s(Qe(!1)))}),[f,s,r]);const _=D=>{m(D)};return b||E||I||U?o.jsxs(St,{children:[o.jsx(F,{isAppContentDrawerOpen:p,handleDrawerToggle:_}),o.jsx(Ct,{navigate:e,location:a,companyId:x,currentTenant:g,roleMap:l.loggedInUserRoleMap,isBillPayEnabled:b,isRemiEnabled:I,isZeniAccountEnabled:E,isChargeCardEnabled:U,isChargeCardsHidden:M,isTreasuryEnabled:h,onClickMenuIcon:()=>{_(!0)}})]}):o.jsx($,{})},At=V.div`
|
|
26
|
-
display: flex;
|
|
27
|
-
height: 100%;
|
|
28
|
-
width: 100%;
|
|
29
|
-
flex: 1 1 auto;
|
|
30
|
-
flex-direction: column;
|
|
31
|
-
align-items: center;
|
|
32
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
33
|
-
`,Et=H((function(e,a){const{companyId:s}=a,c=j(e),l=a.roleMap.bill_pay_admin,n=en(e,s),{uiState:t}=n,i=(ae(c?.userRole??[])||l)&&n.setupView.accountFetchStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.accountUpdateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{billingSetupView:n,uiState:t,stripeKey:je.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:i,analytics:K}}),(function(e,a){const{navigate:s,currentTenant:c,companyId:l}=a;return{onFetchLinkTokenClick:(n,t)=>{e(se("billing_setup",n,t))},onEstablishConnectionClick:n=>{e(oe(n,l,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(Se("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,t,i)=>{e(Ie(n,t,"billing","billing_setup",i))},onUpdatePaymentAccountLoginStatus:(n,t)=>{e(Ce(!1,n,"billing","billing_setup",t))},onUpdateAccountClick:(n,t)=>{e(ye(n,t,"billing","billing_setup"))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")},handleCreateCardSetupIntent:n=>{e(Ae(n))},handleConfirmCardSetupIntent:n=>{e(ln(n))},updateCardPaymentModalState:n=>{e(cn({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,t,i)=>{e(sn(n,t,i))},handleFetchPaymentSources:()=>{e(Y())},resetCardPaymentViewState:()=>{e(on())},handleResetCardPaymentErrorStatuses:()=>{e(an())},onBillingAddressSave:n=>{e(tn(n))},onAddressEditHandler:n=>{if(n!=null){const t=ot(n);e(nn({addressType:"subscription_billing_address",addressToCreate:t}))}}}}))(qn),xt=()=>{const e=L(),a=G(),s=R(),{tenantEmailDomain:c}=Z(),[l,n]=u.useState(!1),[t,i]=u.useState(!1),[p,m]=u.useState(!1),f=y((h=>j(h))),S=y((h=>h.cardPaymentViewState)),g=y((h=>h.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState)),r=Jn(S.addCardPaymentSourceStatus.fetchState),b=S.addCardPaymentSourceStatus.fetchState,I=f.companyId??k.getSignedInUserTenant(c)?.companyId;if(k.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const w=Q();u.useEffect((()=>{I!=null&&s(Xe(I,!1))}),[I,s]),u.useEffect((()=>{t||(i(!0),s(Y()))}),[t,s]),u.useEffect((()=>{p||(Ae(["card"]),m(!0))}),[p]),u.useEffect((()=>{r==="In-Progress"&&b==="Completed"&&s(Y())}),[r,b]);const E=h=>{n(h)};return w?.loggedInUserRoleMap!=null?o.jsxs(At,{children:[o.jsx(F,{isAppContentDrawerOpen:l,handleDrawerToggle:E}),o.jsx(Et,{navigate:e,location:a,companyId:I,currentTenant:f,roleMap:w.loggedInUserRoleMap,onClickMenuIcon:()=>{E(!0)},googleAPIKey:je.googleMapsAPIKey})]}):o.jsx(ie,{fetchState:g})},te="external_integrations",vt=H((function(e){const a=un(e,te);return{meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",notifyMeRegisteredSlugs:new Set(a.map((s=>s.additionalInfo)).filter((s=>s!=null)))}}),(function(e,a){const{navigate:s,integrationsView:c,signedInUserEmail:l,tenantEmailDomain:n,tenantId:t}=a;return{onBackClick:()=>{s("../")},onNavigateToDashboard:()=>{s("../dashboard")},onReconnectQBO:()=>{me.init("/connection/auth",n),me.handleClick()},onRefreshClick:()=>{c.integrations.refreshQBO.fetchState!=="In-Progress"&&e(bn())},onSaveChargeBeeCredentials:(i,p)=>{const m=c.externalConnections?.revenue?.find((f=>f.connectionName==="chargebee"))?.connectionId;m!=null&&e(fn(t,m,ee("revenue"),hn("chargebee"),{api_key:i,site:p}))},onConnectHubSpot:(i,p)=>{const m=c.externalConnections?.revenue?.find((f=>f.connectionName==="hubspot"))?.connectionId;if(m!=null){const f=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:i,client_secret:p,connection_id:m,redirect_uri:f,tenant_id:t}));const S="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(i)}&scope=${encodeURIComponent(S)}&redirect_uri=${encodeURIComponent(f)}`}},onDisconnect:(i,p)=>{e(mn(t,i,ee(p)))},onConnectGmail:()=>{e(de(t,"gmail",window.location.href))},onConnectOutlook:()=>{e(de(t,"outlook",window.location.href))},onSaveConnectorCredentials:i=>{e(gn(t,ee("payments"),i))},onNotifyMe:i=>{K.trackIntegrationsNotifyMeClicked("Settings",i),e(pn(te,i,l))}}}))(Yn),wt=()=>{const e=L(),a=R(),{tenantEmailDomain:s}=Z();rt();const[c,l]=u.useState(!1),n=y((h=>h.tenantState.fetchState)),t=y((h=>j(h))),i=t.companyId??k.getSignedInUserTenant(s)?.companyId,p=k.getSignedInUser(),m=Q(),f=ae(t.userRole??[]);if(p==null)throw Error("Can't access Integrations page without signing in...");u.useEffect((()=>{a(rn(te))}),[a]);const[S,g]=u.useState(!1);u.useEffect((()=>{S||(g(!0),a(Y()))}),[S,a]);const r=h=>{l(h)},b=y((h=>dn(h,i))),I=y((h=>h.plaidAccountViewState.external_account.plaidConnectionDetails)),{plaidAccounts:w,onAddPlaidAccount:E}=dt({companyId:i??t.companyId});return m?.loggedInUserRoleMap!=null?o.jsxs(kt,{children:[o.jsx(F,{isAppContentDrawerOpen:c,handleDrawerToggle:r}),o.jsx(vt,{navigate:e,onClickMenuIcon:()=>{r(!0)},isAdmin:f,integrationsView:b,signedInUserEmail:p.userEmail??"",tenantEmailDomain:t.tenantEmailDomain??s??"",tenantId:t.tenantId,saveChargeBeeState:b.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:b.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:b.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:b.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:b.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(b.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map((([h,A])=>[h,A?.message]))),deleteConnectionState:b.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:b.externalConnections?.deleteConnectionError?.message,isLoading:n==="In-Progress",plaidAccounts:w,onAddPlaidAccount:E,plaidConnectionDetails:I})]}):o.jsx(ie,{fetchState:n})},kt=V.div`
|
|
34
|
-
display: flex;
|
|
35
|
-
height: 100%;
|
|
36
|
-
width: 100%;
|
|
37
|
-
flex: 1 1 auto;
|
|
38
|
-
flex-direction: column;
|
|
39
|
-
align-items: center;
|
|
40
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
41
|
-
`,Pt=V.div`
|
|
42
|
-
display: flex;
|
|
43
|
-
height: 100%;
|
|
44
|
-
width: 100%;
|
|
45
|
-
flex: 1 1 auto;
|
|
46
|
-
flex-direction: column;
|
|
47
|
-
align-items: center;
|
|
48
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
49
|
-
`,jt=()=>{const e=R(),{tenantEmailDomain:a}=Z(),[s,c]=u.useState(!1),l=y((r=>j(r))).companyId??k.getSignedInUserTenant(a)?.companyId,n=k.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const t=y((r=>yn(r,n.userId))),i=y((r=>Sn(r,l,"bill_pay","user_reimbursement_account"))),{plaidConnectionDetails:p}=i,m=r=>{c(r)},f=u.useCallback((r=>{e(se("user_reimbursement_account",r))}),[]),S=u.useCallback((r=>{e(oe(r,l,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))}),[]);u.useEffect((()=>{t.fetchState!=="Completed"&&t.fetchState!=="In-Progress"&&e(Cn(n.userId))}),[n.userId,t.fetchState]);const g=t.fetchState==="Not-Started"||t.fetchState==="In-Progress";return o.jsxs(Pt,{children:[o.jsx(F,{isAppContentDrawerOpen:s,handleDrawerToggle:m}),o.jsx(Wn,{plaidConnectionDetails:p,isLoading:g,myBankConnectionsView:t,onFetchLinkTokenClick:f,onEstablishConnectionClick:S,onClickMenuIcon:()=>{m(!0)}})]})},Dt=V.div`
|
|
50
|
-
display: flex;
|
|
51
|
-
height: 100%;
|
|
52
|
-
width: 100%;
|
|
53
|
-
flex: 1 1 auto;
|
|
54
|
-
flex-direction: column;
|
|
55
|
-
align-items: center;
|
|
56
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
57
|
-
`,fe=({appContent:e})=>{const a=R(),s=L(),c=G(),[l,n]=u.useState(!1),t=y((d=>j(d))),{tenantEmailDomain:i}=t,p=t.companyId??k.getSignedInUserTenant(i)?.companyId;if(k.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:m}=W(),f=!!t.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:S}=m(B.isChargeCardFeatureEnabled),{isFeatureEnabled:g}=m(B.isDebitCardFeatureEnabled),r=t.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",b=y((d=>be(d))),I=Ee(t),w=xe(g,t),E=!w&&b,h=ke(t,S,g),{isCardsHidden:A}=Pe(t?.tenantId),U=!h||A,{areTenantIdsInSync:M}=Xn();u.useEffect((()=>{M&&a(In(p,E))}),[p,a,E,M]);const x=y((d=>An(d,E))),_=x.fetchState==="Not-Started"||x.fetchState==="In-Progress"||p==null,D=En(t),N=!!t.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,O=d=>{n(d)};return o.jsxs(Dt,{children:[o.jsx(F,{isAppContentDrawerOpen:l,handleDrawerToggle:O}),e!=null?o.jsx(o.Fragment,{children:e}):o.jsx(et,{myProfileView:x,isAccountingClassesEnabled:b,isReimbursementDisabled:N===!1,isZeniAccountsDisabled:f===!1,isChargeCardDisabled:U,isTreasuryDisabled:r===!1,isLiteRoleDisabled:D===!1,onClickMenuIcon:()=>{O(!0)},isLoading:_,isBankingOnlyTenant:w,isCardsOnlyTenant:I,onAddressClick:d=>{const C=(function(P,X){let z=`/${P}/settings/my_profile`;return z=z.concat(`/new/${X}`),z})(i,d),T=nt(c.state?.pathnameStackToGoBack,c.pathname);s(C,{state:{pathnameStackToGoBack:T}})},onGetOtp:d=>{const C={...x.myProfileLocalData,phone:d};a(ue({localData:C})),a(kn(d,"MyProfile"))},onResendOtp:d=>{a(wn(d,"MyProfile"))},onCancelClick:()=>{a(vn())},onSaveClick:()=>{a(pe("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},onVerifyOtp:(d,C)=>{a(xn(d,C,"MyProfile"))},onVerifyOtpSuccess:d=>{d!=null&&k.saveZeniOtpToken(d),a(pe("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},updateMyProfileLocalData:d=>{a(ue({localData:d}))}})]})};function Mt(){const e=R(),a=y((r=>j(r))).companyId,s=y((r=>Pn(r))),c=y((r=>ve(r))),l=k.getSignedInUser(),[n,t]=u.useState(!1),i=u.useCallback((r=>{t(r)}),[]),p=u.useCallback((r=>{e(jn(r))}),[]),m=u.useCallback((()=>{l?.userEmail!=null&&e(Dn({loggedInUserEmail:l.userEmail}))}),[l?.userEmail]),f=u.useCallback((()=>{e(Mn())}),[]);if(l==null)throw Error("Can't access Notification Settings page without signing in...");const S=u.useCallback((()=>{const r=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ge(r,a))}),[a,c.notificationSettings.monthEndInsightsNotificationSettings.enabled]),g=u.useCallback((()=>{e(Tn())}),[]);return u.useEffect((()=>{if(c.fetchState==="Completed"&&s.fetchState!=="In-Progress"&&s.fetchState!=="Completed"){const r=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ge(r,a))}}),[s.fetchState,a,c.notificationSettings.monthEndInsightsNotificationSettings.enabled,c.fetchState]),o.jsxs(o.Fragment,{children:[o.jsx(F,{isAppContentDrawerOpen:n,handleDrawerToggle:i}),o.jsx(tt,{notificationSettingsView:s,onFormDataChange:p,onCancel:m,onSave:f,onClickMenuIcon:()=>{i(!0)},signedInUser:l,onRefresh:S,resetUpdateStatus:g})]})}function ga(e){const[a,s]=u.useState(!1),c=y((r=>ve(r))),l=y((r=>j(r))),n=Q(),t=k.getSignedInUser(),i=R(),{useFeatureGate:p}=W(),{isFeatureEnabled:m}=p(B.isDebitCardFeatureEnabled),f=t?.userEmail==null||c.fetchState!=="Completed"||Rn(c.notificationSettings,t.userEmail,m,l);u.useEffect((()=>{c.fetchState!=="In-Progress"&&c.fetchState!=="Completed"&&a===!1&&(s(!0),i(Un()))}),[c.fetchState,a]);const S=xe(m,l),g=Ee(l);return c.fetchState!=="In-Progress"&&c.fetchState!=="Not-Started"||f!==!0?_n(l)?o.jsxs(ne,{children:[Fn(n?.loggedInUserRole??[],m,l,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"accounting/*",element:o.jsx(ft,{})}),On(n?.loggedInUserRole??[],m,l,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"approval_rules/*",element:o.jsx(Tt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),Bn(l,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"my_bank_connections",element:o.jsx(jt,{})}),Vn(l,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"bank_connections",element:o.jsx(It,{})}),zn(l,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"business_verification",element:o.jsx(ct,{productType:S?"zeni_accounts":g?"charge_cards":it(l,n?.loggedInUserRoleMap)})}),Ln(n?.loggedInUserRole??[],l,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"company_details",element:o.jsx(lt,{})}),Nn(n?.loggedInUserRole??[],l)&&o.jsx(v,{path:"billing",element:o.jsx(xt,{})}),$n(n?.loggedInUserRole??[],m,l)&&o.jsx(v,{path:"integrations",element:o.jsx(wt,{})}),o.jsx(v,{path:"my_profile/new/:addressType",element:o.jsx(fe,{appContent:o.jsx(st,{isSubPage:!1})})}),o.jsx(v,{path:"my_profile",element:o.jsx(fe,{})}),f&&o.jsx(v,{path:"notifications",element:o.jsx(Mt,{})}),o.jsx(v,{path:"*",element:o.jsx($,{})})]}):o.jsx(ne,{children:o.jsx(v,{path:"*",element:o.jsx($,{})})}):null}function Tt(e){return o.jsxs(ne,{children:[o.jsx(v,{path:"/",element:o.jsx(yt,{})}),o.jsx(v,{path:"bills/approval-rules/*",element:o.jsx(ut,{})}),o.jsx(v,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?o.jsx(pt,{}):o.jsx($,{})}),o.jsx(v,{path:"*",element:o.jsx($,{})})]})}export{ga as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as f}from"./liveblocks-DKL6viSK.js";import{a as u,b as A,q as M}from"./sentry-DFI2OQU2.js";import{u as T,h as z,j as c,g as D,N as j,n as O}from"./core-DnZcjy6X.js";import{u as P,z as s,E as _,e as w,a as B,f as F,g as N,A as $,h as V,j as q,k as v}from"./index-nBWRmUT4.js";import{e$ as J,Ms as W,Mt as Z,fE as G,g4 as H,My as K,gx as Q,c_ as R,Mz as b,MA as X,MB as Y,bZ as y}from"./zeni-epic-state-m4zoW3ek.js";import"./mui-sr6zger7.js";import{u as ee}from"./useDeviceId-DasP_-mC.js";import{f as te}from"./analyticsHelper-CTlcOyiL.js";import{t as ne}from"./getLocaleForTenant-CtnTFS0P.js";import"./recharts-Bim6mdwu.js";import"./analytics-DtYJ-EGT.js";import"./plaid-QvRDxgoN.js";import"./dnd-eoV-_JYH.js";import"./stripe-cKAAJElX.js";import"./lottie-Dz5luYQG.js";import"./lexical-CSqytB8g.js";import"./pdf-BNSeVvBm.js";import"./utils-cHxIh7E8.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="31325813-30a3-41f4-9c4f-9cc1d66bc9d9",t._sentryDebugIdIdentifier="sentry-dbid-31325813-30a3-41f4-9c4f-9cc1d66bc9d9")}catch{}})();const ie=O((function(t,i){const d=t.tenantState.fetchState,g=t.tenantState.sendEmailMagicLinkFetchState,{magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}=i;return{googleClientId:v.googleClientId,microsoftClientId:v.microsoftClientId,signInError:t.tenantState.error?.error,fetchState:d,sendMagicLinkStatus:g,magicLinkExpired:n,magicLinkAlreadyUsed:a,magicLinkExpiredEmail:l}}),(function(t,i){const{location:d,navigate:g}=i;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,a)=>{M({message:`OAuth error from provider ${a} with error ${n}`,level:"error",tags:{authProvider:a,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,a)=>{const l=a==="google"?window.location.origin:window.location.origin+window.location.pathname;t(Y({authCode:n,oauthProvider:a,appType:"web",redirectUri:y(l),sourceUri:y(d.state!=null?d.state.origin:"")}))},getSignedInUser:()=>s.getSignedInUser(),onSignedInCallback:()=>{const n=d.state?.origin;n&&n!=="/"?g(n,{replace:!0}):window.open(window.location.origin,"_self")},sendMagicLink:n=>{const{deviceId:a}=i;a!=null&&(s.saveMagicLinkEmail(n),t(X(n,a)))},clearSignInError:()=>{t(b())}}}))(q),ae=A.memo(ie);function ve({setTenantEmailDomain:t}){const i=T(),d=z(),{clearAllLoading:g}=P(),n=s.getSignedInUser();u.useLayoutEffect((()=>{g()}),[g]);const a=ee(),l=c((e=>e.tenantState.magicLinkCodeVerifier)),{sendEmailMagicLinkFetchState:E,accountLocked:x,accountUnlockTime:h}=c((e=>e.tenantState)),p=c((e=>e.tenantState.fetchState)),k=c((e=>e.tenantState.activeTenantFetchState.fetchState)),S=c((e=>e.tenantState.signInState)),o=c((e=>e.tenantState.loggedInUser)),r=c((e=>J(e))),I=c((e=>W(e))),m=D(),L=_().mode,C=m.state?.magicLinkExpired,U=m.state?.magicLinkAlreadyUsed;if(u.useEffect((()=>{E.fetchState==="Completed"&&l!=null&&(w.trackSignInLinkSent(),s.saveMagicLinkCodeVerifier(l))}),[E.fetchState,l]),u.useEffect((()=>{t(void 0)}),[]),u.useEffect((()=>{S!=="In-Progress"||p!=="Completed"&&k!=="Completed"||o?.zeniSessionId==null||r==null||(s.savePayNowInfoTooltip(!0,o.zeniSessionId),s.saveSignedInUserWithSession(o,o.zeniSessionId),s.saveSignedInUserTenants(Z(I.tenantsInOrder),o.zeniSessionId),G(o.userId,o.zeniSessionId,r.tenantId),i(H(r.tenantId)),s.saveActiveTenantDomainForUser(r.tenantEmailDomain),i(K("Completed")),B.updateAppLocaleID(ne(r)),te(o,r,L,void 0,I.tenantsInOrder),Q().then((()=>{const e=V();e!=null&&F(e)})),setTimeout((()=>{w.trackLogin(N.Event.loginSuccess,o.authProvider??"google",R(r.productSettings))}),2e3))}),[S,p,k,o,r,I,L,m.state,i]),S==="In-Progress"&&p==="Completed"&&o?.zeniSessionId!=null&&r!=null||n!=null){const e=m.state?.origin??"/";return f.jsx(j,{to:e,state:{...m.state,origin:""}})}return f.jsxs(f.Fragment,{children:[f.jsx(ae,{magicLinkExpired:!!C,magicLinkAlreadyUsed:!!U,magicLinkExpiredEmail:s.getMagicLinkEmail()??void 0,location:m,navigate:d,deviceId:a??void 0,showEmailLogin:!0}),x===!0&&h!=null?f.jsx($,{onClose:()=>i(b()),unlockDate:h}):null]})}export{ve as default};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-DKL6viSK.js";import{a as i}from"./sentry-DFI2OQU2.js";import{u as l,g as d,N as u}from"./core-DnZcjy6X.js";import{z as n,e as a,g as m,B as g}from"./index-nBWRmUT4.js";import{gC as p,MQ as y}from"./zeni-epic-state-m4zoW3ek.js";import{n as b}from"./mui-sr6zger7.js";import"./recharts-Bim6mdwu.js";import"./analytics-DtYJ-EGT.js";import"./plaid-QvRDxgoN.js";import"./dnd-eoV-_JYH.js";import"./stripe-cKAAJElX.js";import"./lottie-Dz5luYQG.js";import"./lexical-CSqytB8g.js";import"./pdf-BNSeVvBm.js";import"./utils-cHxIh7E8.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]="2ad33c4f-0697-4c06-9065-58bb671034e1",e._sentryDebugIdIdentifier="sentry-dbid-2ad33c4f-0697-4c06-9065-58bb671034e1")}catch{}})();function L(){const e=l(),t=d(),r=i.useRef(!1),c=n.isSignedIn(),o=t.state?.message==="logout"||c;return i.useEffect((()=>{if(o&&!r.current){r.current=!0;try{e(p()),y(),a.trackLogout(m.Event.logoutSuccess),a.resetUserIdentity(),n.clearAll()}catch(f){console.error("Error during sign out:",f)}finally{window.location.replace("/signin/auth")}}}),[o,e]),o?s.jsx(h,{children:s.jsx(g,{fetchState:"In-Progress"})}):s.jsx(u,{to:"../",replace:!0})}const h=b.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
height: 100vh;
|
|
4
|
-
width: 100%;
|
|
5
|
-
flex: 1 1 auto;
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
align-items: center;
|
|
8
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`;export{L as default};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{j as C}from"./liveblocks-DKL6viSK.js";import{a as f}from"./sentry-DFI2OQU2.js";import{h as pe,u as Te,g as fe,k as ge,j as F,i as _e,n as me}from"./core-DnZcjy6X.js";import{az as De,aA as be,z as x,w as Se,i as G,a0 as he,F as Ee,e as ye,g as Ae,dd as Ce,r as w,q as Ge}from"./index-nBWRmUT4.js";import{e$ as Ie,Um as X,JB as U,Un as Y,Ui as Ue,IZ as M,Uo as Be,J5 as q,IH as ve,Ij as Ke,JC as V,Up as W,fD as Le,Js as we,Jx as Re,Jk as Pe,Ji as H,Jy as Fe,Jf as je,Uq as xe,Ur as $e,Us as Ne,Ut as Oe,Uu as I,da as Je,d9 as ze,Uv as Ze,IF as Me}from"./zeni-epic-state-m4zoW3ek.js";import{n as qe}from"./mui-sr6zger7.js";import{u as Ve}from"./useAskAiCfoHostNavButtonProps-BqNcSAwL.js";import{M as We}from"./MobileAppDrawer-KiFiOGbB.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="8d6af2a8-73fe-4315-b5d6-0b2c0166d638",a._sentryDebugIdIdentifier="sentry-dbid-8d6af2a8-73fe-4315-b5d6-0b2c0166d638")}catch{}})();const c={TASK_CREATED:"task-created",TASK_UPDATED:"task-updated",TASK_SNOOZE_RESURFACED:"task-snooze-resurfaced",TASKS_BULK_UPDATED:"tasks-bulk-updated",TASKS_BULK_DELETED:"tasks-bulk-deleted"},He=(a,e)=>a==null||a===""?[]:e.map((n=>`private-encrypted-${a}.${n}`)),Qe=(a,e)=>a==null||a===""?[]:e.map((n=>`private-encrypted-${a}.${n}`)),R=a=>Array.isArray(a)&&a.every((e=>typeof e=="string")),Xe=a=>{if(a==null||typeof a!="object")return null;const e=a,n=typeof e.task_id=="string"?e.task_id:typeof e.id=="string"?e.id:null;if(n==null||typeof e.tenant_id!="string"||typeof e.event_type!="string")return null;const r={task_id:n,tenant_id:e.tenant_id,event_type:e.event_type};return typeof e.is_private=="boolean"&&(r.is_private=e.is_private),R(e.assignees)&&(r.assignees=e.assignees),R(e.direct_assignees)&&(r.direct_assignees=e.direct_assignees),typeof e.created_by=="string"&&(r.created_by=e.created_by),R(e.task_group_ids)&&(r.task_group_ids=e.task_group_ids),typeof e.name=="string"&&(r.name=e.name),typeof e.parent_task_id=="string"&&(r.parent_task_id=e.parent_task_id),r},Ye=a=>{if(a==null||typeof a!="object")return null;const e=a;return R(e.task_ids)?{task_ids:e.task_ids}:null},pa=a=>{if(a==null||typeof a!="object")return null;const e=a;return typeof e.task_id!="string"?null:{task_id:e.task_id}},ea=a=>{const{events:e,onEvent:n,onSubscribed:r}=a,i=De(),g=f.useRef(n),l=f.useRef(r),_=f.useRef(0);f.useEffect((()=>{g.current=n}),[n]),f.useEffect((()=>{l.current=r}),[r]);const t=f.useMemo((()=>[...e].sort().join("|")),[e]);f.useEffect((()=>{if(i==null||e.length===0)return;const s=[],p=new Set,S=()=>{if(l.current==null)return;const m=Date.now();m-_.current<5e3||(_.current=m,l.current())};return e.forEach((m=>{const[D,b]=be(m);if(b==="")return;const E=i.channel(D),y=T=>{g.current(b,T)};let k;if(E?.subscribed===!0){if(k=E,k.bind(b,y),!p.has(D)){p.add(D),S();const T=()=>{S()};k.bind("pusher:subscription_succeeded",T),s.push((()=>{k.unbind("pusher:subscription_succeeded",T)}))}s.push((()=>{E.unbind(b,y)}))}else{if(k=E??i.subscribe(D),k.bind(b,y),!p.has(D)){p.add(D);const T=()=>{S()};k.bind("pusher:subscription_succeeded",T),s.push((()=>{k.unbind("pusher:subscription_succeeded",T)}))}s.push((()=>{k.unbind(b,y)}))}})),()=>{s.forEach((m=>m()))}}),[i,t])},aa=qe.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
min-height: 100%;
|
|
4
|
-
width: 100%;
|
|
5
|
-
flex: 1 1 auto;
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
align-items: center;
|
|
8
|
-
background-color: ${a=>a.theme.colors.grey4};
|
|
9
|
-
`,ta=me((function(a,e){const n=X(a,e.isTaskTemplatesEnabled),{taskGroupId:r}=e,i=r!=null&&r!==""?{...n,taskGroupsWithTasksList:n.taskGroupsWithTasksList.map((t=>({...t,tasks:t.tasks.filter((s=>s.taskGroupIds.includes(r)))}))).filter((t=>t.tasks.length>0))}:n,g=Ue(a),l=x.isZeniUser(),_=a.taskDetailState?.subTaskCreateStatus?.fetchState;return{taskListView:i,tagListView:g,localData:i.localData,isTaskTemplatesEnabled:e.isTaskTemplatesEnabled,isZeniUser:l,subTaskCreateStatus:_}}),(function(a,e){const{navigate:n,currentTenant:r,location:i,isTaskTemplatesEnabled:g}=e,{tenantEmailDomain:l}=r,{groupByKey:_}=e.uiState;return{onTaskManagementRowClick:t=>{const s=Q(l,t),p=w(i.state?.pathnameStackToGoBack,i.pathname);n(s,{state:{pathnameStackToGoBack:p}})},onReloadTasks:()=>{a(U(!0,g))},onTabChange:t=>{a(Oe(t))},onParentTaskClick:t=>{const s=Q(l,t);window.open(s,"_blank","noopener")},bulkUpdateTasks:(t,s)=>{a(H(t,null,s))},onNewTaskClick:()=>{if(e.localData.defaultTaskGroupId!=null){const t=j(l,e.localData.defaultTaskGroupId),s=w(i.state?.pathnameStackToGoBack,i.pathname);n(t,{state:{pathnameStackToGoBack:s,message:"comingFromTaskListPage"}})}},onColumnSortConfigChanged:(t,s)=>{a(W({uiState:{sortKey:t,sortOrder:s}}))},onFiltersChange:t=>{a(Ne({filters:t}))},onSearchTextChanged:t=>{a($e({searchText:t}))},onReloadCards:()=>{a(U(!0,g))},onBackClick:()=>{if(i.state?.message==="triggerBackClick"){const t=Ge(i.state?.pathnameStackToGoBack),s=t.poppedPathname??"../";n(s,{state:{pathnameStackToGoBack:t.newStack}})}else n("../")},updateLocalData:t=>{a(xe({localData:t}))},resetLocalData:()=>{a(Y({taskGroupById:e.taskGroupState.taskGroupById}))},handleCreateGroup:t=>{a(je(e.localData.newTaskGroupName,t))},assignGroupToTasks:t=>{a(H(e.localData.selectedTaskIds,t,Fe(e.uiState.groupByKey,t)))},onDeleteTaskGroup:t=>{a(Pe(t))},onAddNewTaskToTaskGroup:t=>{if(e.localData.defaultTaskGroupId!=null){const s=na(_,t);a(M({taskDetailLocalData:s}));const p=j(l,e.uiState.groupByKey==="groupName"?t:e.localData.defaultTaskGroupId),S=w(i.state?.pathnameStackToGoBack,i.pathname);n(p,{state:{pathnameStackToGoBack:S,message:"comingFromTaskListPage"}})}},onDragNDrop:(t,s)=>{a(Re(e.localData.selectedTaskIds.length>0?e.localData.selectedTaskIds:[t],s))},onTaskGroupRename:(t,s)=>{a(we(t,s))},onTimeSpentUpdate:(t,s)=>{a(V({task:t,updates:s}))},onShowToast:t=>{a(Le(t))},onGroupByFilterChange:t=>{a(W({uiState:{groupByKey:t}}))},updateTask:(t,s)=>{a(V({task:t,updates:s}))},onCreateTagClick:(t,s)=>{a(Ke(t,s))},onSubtaskCreation:(t,s)=>{a(ve({...s,parentTaskId:t}))},handleGroupTemplateClick:t=>{a(q(t,[]))},handleGroupTemplateTaskClick:(t,s)=>{a(q(t,[s]))},handleNewTaskInitialization:t=>{if(a(M({taskDetailLocalData:{...Be,name:t}})),e.localData.defaultTaskGroupId!=null){const s=j(l,e.localData.defaultTaskGroupId),p=w(i.state?.pathnameStackToGoBack,i.pathname);n(s,{state:{pathnameStackToGoBack:p,message:"comingFromTaskListPage"}})}},onTaskGroupNameClick:t=>{n(`/${l}/tasks/group/${t}`)},onQuickResponsesClick:()=>{n(`/${l}/tasks/quick-responses`)}}}))(Ce);function sa(){const a=pe(),e=Te(),n=fe(),r=x.getSignedInUser(),i=x.isZeniUser(),g=ge(),l=F((u=>Ie(u))),{taskGroupId:_}=_e(),{useFeatureGate:t}=Se(),{isFeatureEnabled:s}=t(G.isTaskTemplatesEnabled),{isFeatureEnabled:p}=t(G.isTaskCannedResponsesEnabled),{isFeatureEnabled:S}=t(G.isTaskCategorizationEnabled),{isFeatureEnabled:m}=t(G.isTaskBulkResolutionEnabled),{isFeatureEnabled:D}=t(G.isTaskGroupAssigneesEnabled),{isFeatureEnabled:b}=t(G.isTaskRecurringParentEnabled),[E,y]=f.useState(!1),k=F((u=>X(u,s))),T=F((u=>u.taskGroupState)),B=k.fetchState,{isAiCfoAccessEnabled:ee,onAskAiCfoClick:ae}=Ve({mobileExploreReferrer:"Task Checklist"});he({isDataReady:B==="Completed"}),f.useEffect((()=>{e(U(!1,s))}),[l?.tenantId,e,s]);const te=f.useMemo((()=>{const u=[c.TASK_CREATED,c.TASK_UPDATED,c.TASKS_BULK_UPDATED,c.TASKS_BULK_DELETED],A=[c.TASK_CREATED,c.TASK_UPDATED,c.TASK_SNOOZE_RESURFACED,c.TASKS_BULK_UPDATED];return[...He(l?.tenantId,u),...Qe(r?.userId,A)]}),[l?.tenantId,r?.userId]);if(ea({events:te,onEvent:(u,A)=>{switch(u){case c.TASK_CREATED:case c.TASK_UPDATED:{const o=Xe(A);if(o!=null){const L=g.getState(),$=o.task_id,h=$!=null?L.taskState.taskByID?.[$]:void 0,P=h!=null;if(!i)if(o.is_private===!0){if(!P)return}else{const v=r?.userId,K=new Set([...o.assignees??[],...o.direct_assignees??[]]);if(o.created_by!=null&&o.created_by!==""&&K.add(o.created_by),!(v!=null&&K.has(v))&&!P)return}if(u===c.TASK_UPDATED&&P&&h!=null&&Array.isArray(o.task_group_ids)){const v=new Set(Object.values(L.taskGroupState.taskGroupById??{}).filter((d=>d!=null&&!d.isDeleted)).map((d=>d.id))),K=(h.taskGroupIds??[]).filter((d=>v.has(d))),N=(o.task_group_ids??[]).filter((d=>v.has(d))),se=K.length===N.length&&K.every((d=>N.includes(d))),O=h.taskGroupIds??[],J=o.task_group_ids??[],ne=O.length!==J.length||!O.every((d=>J.includes(d))),re=(d,de)=>{const z=d??[],Z=de??[];if(z.length!==Z.length)return!1;const ce=new Set(Z);return z.every((ke=>ce.has(ke)))},oe=o.name==null||o.name===h.name,ie=o.is_private==null||o.is_private===h.isPrivate,le=o.assignees==null||re(o.assignees,h.assignees),ue=o.direct_assignees==null;if(se&&ne&&oe&&ie&&le&&ue)return}}return void e(U(!0,s))}case c.TASKS_BULK_DELETED:{const o=Ye(A);return o==null?void 0:void o.task_ids.forEach((L=>e(Me(L))))}case c.TASKS_BULK_UPDATED:case c.TASK_SNOOZE_RESURFACED:return void e(U(!0,s))}},onSubscribed:()=>{e(U(!0,s))}}),f.useEffect((()=>{B==="Completed"&&e(Y({taskGroupById:T.taskGroupById}))}),[B,T.taskGroupById]),r==null)throw Error("Can't access task list page without signing in...");return C.jsxs(C.Fragment,{children:[B==="Completed"?C.jsx(Ee,{analytics:ye,onLoad:u=>(A=>A.trackPageLoaded(Ae.Event.taskListPage))(u)}):null,C.jsxs(aa,{children:[C.jsx(We,{isAppContentDrawerOpen:E,handleDrawerToggle:u=>{y(u)}}),C.jsx(ta,{location:n,navigate:a,currentTenant:l,taskGroupId:_,taskGroupState:T,localData:k.localData,uiState:k.uiState,isTaskTemplatesEnabled:s,taskListFetchState:B,isTaskCategorizationEnabled:S,isTaskCannedResponsesEnabled:p,isTaskBulkResolutionEnabled:m,isTaskGroupAssigneesEnabled:D,isTaskRecurringParentEnabled:b,isAiCfoAccessEnabled:ee,onAskAiCfoClick:ae})]})]})}const Q=(a,e)=>`/${a}/tasks/${encodeURIComponent(e)}`,j=(a,e)=>`/${a}/tasks/new/${e}`,na=(a,e)=>{if(a==="assignee"){const n=e.split(",");return{...I.taskDetailLocalData,assignee:n}}if(a==="priority"){const n=Je(e);return{...I.taskDetailLocalData,priority:n}}if(a==="status"){const n=ze(e);return{...I.taskDetailLocalData,status:n}}if(a==="tag"){const n=e.split(",");return{...I.taskDetailLocalData,tagIds:n}}if(a==="dueDate"){const n=Ze(e);return{...I.taskDetailLocalData,dueDate:n}}return{...I.taskDetailLocalData}},Ta=Object.freeze(Object.defineProperty({__proto__:null,default:sa},Symbol.toStringTag,{value:"Module"}));export{c as T,Qe as a,He as b,Ye as c,Xe as d,sa as e,Ta as f,pa as t,ea as u};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{j as r}from"./liveblocks-DKL6viSK.js";import ue from"./NotFoundScreen-CdBZ6E4V.js";import{a as k}from"./sentry-DFI2OQU2.js";import{h as Y,u as ee,j as b,g as de,i as ke,N as pe,n as me,o as Se,p as I}from"./core-DnZcjy6X.js";import{Iw as ae,Iz as fe,It as Te,Uh as ge,e$ as te,Ui as se,IV as g,IN as T,Iq as he,Jp as Ie,Ji as be,Uj as ne,fD as oe,Uk as Z,Im as Ee,Ij as De,r$ as Ce,rP as Ge,lj as Ue,IL as _e,Ul as Re,JC as we,IH as xe,J4 as je,J1 as ye,IC as Be,I_ as ve,IZ as Ae}from"./zeni-epic-state-m4zoW3ek.js";import{z as _,db as Pe,x as Fe,w as Le,i as G,q as ie,r as U,F as Ke,e as J,g as $e,dc as Ne,k as M,au as ze}from"./index-nBWRmUT4.js";import{n as Oe}from"./mui-sr6zger7.js";import{u as Ve}from"./useInitialThreadRequest-Ch4ouOBD.js";import{M as qe}from"./MobileAppDrawer-KiFiOGbB.js";import{b as Ze,a as Je,u as Me,T as f,t as He,c as H,d as Q,e as Qe}from"./TaskListScreen-DduFWf5s.js";import"./recharts-Bim6mdwu.js";import"./analytics-DtYJ-EGT.js";import"./plaid-QvRDxgoN.js";import"./dnd-eoV-_JYH.js";import"./stripe-cKAAJElX.js";import"./lottie-Dz5luYQG.js";import"./lexical-CSqytB8g.js";import"./pdf-BNSeVvBm.js";import"./utils-cHxIh7E8.js";import"./useAskAiCfoHostNavButtonProps-BqNcSAwL.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="85b915a3-279c-4ef0-8cc1-4234d2165535",e._sentryDebugIdIdentifier="sentry-dbid-85b915a3-279c-4ef0-8cc1-4234d2165535")}catch{}})();function We(){const e=Y(),a=ee(),n=_.getSignedInUser(),{cannedResponses:c,fetchState:s,saveFetchState:u}=b((o=>o.cannedResponsesState)),d=k.useCallback((()=>{a(ae())}),[a]),m=k.useCallback(((o,E,D)=>{a(fe({name:o,content:E,cannedResponseId:D}))}),[a]),t=k.useCallback((o=>{a(Te({cannedResponseId:o}))}),[a]);if(n==null)throw Error("Can't access quick responses page without signing in...");return r.jsx(Pe,{cannedResponses:c,isLoading:s==="In-Progress"||s==="Not-Started",isSaving:u==="In-Progress",onBackClick:()=>e(-1),onDelete:t,onFetch:d,onSave:m})}const L=e=>e?.taskState?.taskByID,P=(e,a)=>{const n=L(e);if(a!=null&&n!=null)return n[a]?.parentTaskId??void 0},Xe=ge([P,(e,a)=>{const n=P(e,a),c=L(e);if(n!=null&&c!=null)return c[n]?.name},(e,a)=>{const n=P(e,a),c=L(e);return n!=null&&c!=null&&c[n]!=null}],((e,a,n)=>{if(e!=null&&n===!0)return{id:e,name:a??""}}));let W,X=[];const Ye=me((function(e,a){const{location:n,taskGroupId:c}=a,s=ne(e,a.taskId),u=te(e),d=Xe(e,a.taskId),m=s.taskGroupId??c,t=m!=null?Z(e.taskGroupState,m):void 0,o=_.getSignedInUser(),E=u.tenantId,D={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:E??""},j=se(e),{tenantEmailDomain:y}=u,R=s.recurringSourceTaskId,B=R!=null?`${M.appUrl}/${y}/tasks/${encodeURIComponent(R)}`:void 0;var h;return{taskDetailSelectorView:s,authParams:D,isZeniUser:_.isZeniUser(),userGroupList:((h=e.userGroupsState.userGroupByUserGroupId)!==W&&(W=h,X=Object.values(h)),X),isNewClicked:n.state?.message==="comingFromTaskListPage",filesEndPoint:ze.fileMicroServiceBaseUrl,companyName:a.currentTenant.companyName,companyId:a.currentTenant.companyId,currentUrl:`${M.appUrl}${a.location.pathname}`,cannedResponses:e.cannedResponsesState.cannedResponses,isCannedResponsesLoading:e.cannedResponsesState.fetchState==="In-Progress",recurringSourceTaskUrl:B,tagListView:j,taskGroupName:m!=null&&t!=null&&t.isDefault===!1?t.name:void 0,taskGroupList:e.taskGroupViewState.taskGroupsIds.map((S=>Z(e.taskGroupState,S))).filter((S=>S!=null&&!S.isDeleted)).map((S=>({id:S.id,name:S.name,isDefault:S.isDefault}))),subtasks:s.subtasks,parentTaskRef:d,subTaskCreateStatus:e.taskDetailState?.subTaskCreateStatus?.fetchState}}),(function(e,a){const{taskId:n,navigate:c,currentTenant:s,location:u,taskGroupId:d}=a,{tenantEmailDomain:m}=s;return{onSaveChangesToLocalStore:t=>{e(Ae({taskDetailLocalData:t,taskId:n}))},onSaveDetailClick:t=>{e(ve(n,t??d))},onArchiveTaskClick:()=>{a.taskId!=null&&e(Be(a.taskId))},onSnoozeTask:(t,o)=>{e(ye(t,o))},onUnsnoozeTask:t=>{e(je(t))},onCreateSubtask:(t,o)=>{e(xe({...o,parentTaskId:t}))},onSubtaskUpdate:(t,o)=>{e(we({task:t,updates:o}))},onShowToast:t=>{e(oe(t))},onSubtaskRowClick:t=>{c(`/${m}/tasks/${t}`,{state:{pathnameStackToGoBack:U(u.state?.pathnameStackToGoBack,u.pathname)}})},onParentBreadcrumbClick:t=>{c(`/${m}/tasks/${t}`,{state:{pathnameStackToGoBack:U(u.state?.pathnameStackToGoBack,u.pathname)}})},onDismissClick:()=>{if(u.state?.message==="triggerBackClick"){const t=ie(u.state?.pathnameStackToGoBack),o=t.poppedPathname??"../../dashboard";c(o,{state:{pathnameStackToGoBack:t.newStack}})}else{const t=x(m),o=U(u.state?.pathnameStackToGoBack,u.pathname);c(t,{state:{pathnameStackToGoBack:o}})}e(Re({taskId:n}))},onDeleteTaskClick:()=>{e(_e(n))},updateFilesEntity:t=>{e(Ue({files:t}))},onDeleteFile:t=>{e(Ge(t))},onEditFileName:(t,o)=>{e(Ce(t,o.split(".")[0]))},onReloadTaskDetailPage:()=>{e(g(!1,n))},onCreateTagClick:t=>{e(De(t,n))},onDeleteTagClick:t=>{e(Ee(t,n))},onFetchCannedResponses:()=>{e(ae())},onManageTemplatesClick:()=>{c(`/${s.tenantEmailDomain}/tasks/quick-responses`)}}}))(Ne);function F(){const e=Y(),a=ee(),n=de(),c=Fe(),{taskId:s,taskGroupId:u}=ke(),d=b((i=>te(i))),m=Ve(d?.companyId),{useFeatureGate:t}=Le(),{isFeatureEnabled:o}=t(G.isTaskSnoozeEnabled),{isFeatureEnabled:E}=t(G.isTaskVisibilityEnabled),{isFeatureEnabled:D}=t(G.isTaskCannedResponsesEnabled),{isFeatureEnabled:j}=t(G.isTaskRecurringParentEnabled),{isFeatureEnabled:y}=t(G.isTaskGroupAssigneesEnabled),[R,B]=k.useState(!1),[h,S]=k.useState(!1),[K,re]=k.useState(!1),[$,v]=k.useState(!1),C=k.useRef(!1),w=b((i=>i.taskListState.updateTasksFetchState.fetchState)),N=b((i=>se(i))),z=b((i=>i.taskGroupViewState.fetchState));k.useEffect((()=>{a(g(!1,s)),s!=null&&a(T(s))}),[a,s]);const O=_.getSignedInUser()?.userId,ce=k.useMemo((()=>{const i=[f.TASK_CREATED,f.TASK_UPDATED,f.TASKS_BULK_UPDATED,f.TASKS_BULK_DELETED],l=[...i,f.TASK_SNOOZE_RESURFACED];return[...Ze(d?.tenantId,i),...Je(O,l)]}),[d?.tenantId,O]);Me({events:ce,onSubscribed:()=>{s!=null&&(a(g(!0,s)),a(T(s)))},onEvent:(i,l)=>{if(s!=null)switch(i){case f.TASK_CREATED:{Q(l)?.parent_task_id===s&&(a(g(!0,s)),a(T(s)));break}case f.TASK_UPDATED:{const p=Q(l);if(p==null)break;p.task_id===s?(a(g(!0,s)),a(T(s))):p.parent_task_id===s&&a(T(s));break}case f.TASKS_BULK_UPDATED:{const p=H(l);if(p==null)break;p.task_ids.includes(s)&&a(g(!0,s)),a(T(s));break}case f.TASKS_BULK_DELETED:{const p=H(l);if(p==null)break;if(p.task_ids.includes(s)){a(oe({messageSection:"delete_task",messageText:"success",type:"success"})),d?.tenantEmailDomain!=null&&e(x(d.tenantEmailDomain));break}a(T(s));break}case f.TASK_SNOOZE_RESURFACED:{He(l)?.task_id===s&&a(g(!0,s));break}}}}),k.useEffect((()=>{h||N.fetchState==="Completed"||(S(!0),a(he()))}),[h,a,N.fetchState]),k.useEffect((()=>{K||z==="Completed"||(re(!0),a(Ie()))}),[K,a,z]);const le=k.useCallback((()=>{s!=null&&(C.current=!1,a(be([s],null,{isArchived:!1})),v(!0))}),[a,s]);k.useEffect((()=>{if($)if(w!=="In-Progress"){if(C.current){if(w==="Error")return v(!1),void(C.current=!1);if(w==="Completed"){v(!1),C.current=!1;const{tenantEmailDomain:i}=d;if(n.state?.message==="triggerBackClick"){const l=ie(n.state?.pathnameStackToGoBack);e(l.poppedPathname??"../../dashboard",{state:{pathnameStackToGoBack:l.newStack}})}else{const l=x(i);e(l,{state:{pathnameStackToGoBack:U(n.state?.pathnameStackToGoBack,n.pathname)}})}}}}else C.current=!0}),[$,w,d,n,e]);const V=b((i=>ne(i,s))),A=V.fetchState,q=_.getSignedInUser();if(q==null)throw Error("Can't access task detail page without signing in...");if(A==="Error"&&V.error?.code===400){const{tenantEmailDomain:i}=d,l=x(i),p=U(n.state?.pathnameStackToGoBack,n.pathname);return r.jsx(pe,{to:l,state:{pathnameStackToGoBack:p}})}return r.jsxs(r.Fragment,{children:[A==="Completed"?r.jsx(Ke,{analytics:J,onLoad:i=>(l=>l.trackPageLoaded($e.Event.taskDetailPage))(i)}):null,r.jsxs(ea,{children:[r.jsx(qe,{isAppContentDrawerOpen:R,handleDrawerToggle:i=>{B(i)}}),r.jsx(Ye,{analytics:J,currentTenant:d,handleZeniLogoClick:()=>{c.toggle()},initialOpenThreadRequest:m,location:n,loggedInUser:q,navigate:e,taskGroupId:u,taskId:s,taskDetailFetchState:A,onUnarchiveTaskClick:le,isTaskSnoozeEnabled:o,isTaskVisibilityEnabled:E,isTaskCannedResponsesEnabled:D,isTaskRecurringParentEnabled:j,isTaskGroupAssigneesEnabled:y})]})]})}const ea=Oe.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
min-height: 100%;
|
|
4
|
-
width: 100%;
|
|
5
|
-
flex: 1 1 auto;
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
align-items: center;
|
|
8
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`,x=e=>`/${e}/tasks`;function ba(){return r.jsxs(Se,{children:[r.jsx(I,{path:"/new",element:r.jsx(F,{})}),r.jsx(I,{path:"/new/:taskGroupId",element:r.jsx(F,{})}),r.jsx(I,{path:"/group/:taskGroupId",element:r.jsx(Qe,{})}),r.jsx(I,{path:"/quick-responses",element:r.jsx(We,{})}),r.jsx(I,{path:"/:taskId",element:r.jsx(F,{})}),r.jsx(I,{path:"*",element:r.jsx(ue,{})})]})}export{ba as default};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{j as U}from"./liveblocks-DKL6viSK.js";import{a as c}from"./sentry-DFI2OQU2.js";import{u as $,k as Xe,j as g,s as fe,g as Se,h as Te,i as be,N as Qe,n as Ze}from"./core-DnZcjy6X.js";import{o0 as ye,e$ as K,gy as et,OO as tt,nd as at,mX as nt,bn as ot,cX as Ee,bs as Ie,rz as q,NN as H,OP as De,OQ as oe,Ob as ve,kW as Ce,OR as ke,Og as se,Oh as ie,lL as Ae,KI as ce,NH as M,kQ as _e,kO as Oe,k_ as st,nP as it,OS as ct,OT as rt,vP as J,kV as Pe,K1 as Ue,cj as lt,c$ as dt,OU as ut,NG as mt,OV as pt,OW as ft,OX as yt,OY as ht,vL as gt,OZ as St,O_ as Tt,O$ as bt,P0 as Et,P1 as It,kZ as Dt,P2 as vt,P3 as Ct,NI as kt,P4 as At,P5 as _t,P6 as Ot,JX as Pt,JN as Ut,Ka as xt,k$ as wt,KJ as he,nU as Ft}from"./zeni-epic-state-m4zoW3ek.js";import{w as Y,i as P,z as xe,aS as we,E as Lt,J as Vt,aT as zt,G as Bt,q as ae,D as Nt,aU as Rt,r as ne,a0 as Gt,aV as jt,e as Fe,aW as Mt,au as $t,a4 as te}from"./index-nBWRmUT4.js";import{n as Wt,S as qt,D as Ht}from"./mui-sr6zger7.js";import{u as Yt}from"./useAskAiCfoHostNavButtonProps-BqNcSAwL.js";import{d as Le}from"./decodeURIComponentSafe-CjxujRw-.js";import{h as Ve,c as ze,g as Jt,e as Kt}from"./routePaths-D0N7YUlE.js";import{u as Xt}from"./utils-cHxIh7E8.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="131cb41d-7bb8-4e0c-af7c-41ea3186a790",t._sentryDebugIdIdentifier="sentry-dbid-131cb41d-7bb8-4e0c-af7c-41ea3186a790")}catch{}})();function Qt(t=!0){const e=$(),s=Xe(),{useFeatureGate:a}=Y(),{isFeatureEnabled:n}=a(P.isCreateTransferEntryFromExpenseEnabled);c.useEffect((()=>{if(!t||n!==!0)return;const o=i=>{const r=s.getState().createTransferEntryState.transferAccountsByType[i].fetchState;return r!=="In-Progress"&&r!=="Completed"};o("transferEntryEligible")&&e(ye({kind:"transferEntryEligible"})),o("creditCardOnlyEligible")&&e(ye({kind:"creditCardOnlyEligible"}))}),[t,n,e,s])}function Zt(t,e){const s=(function(){const r=$(),[f,S]=c.useState(!1),[A,h]=c.useState(null),[m,_]=c.useState(null),{useDynamicConfig:b}=Y(),{configValue:y,isDynamicConfigLoading:C}=b("transaction_categorization_config"),I=!C&&y?.capitalization_enabled===!0,k=g((p=>K(p))),E=k.companyId,O=g((p=>et(p.companyState,k.companyId)?.company.companyLocaleInfo?.currencySymbol??"$")),{capitalizableAccounts:x,capitalizableAccountOverrides:V,dismissedAccounts:R}=g((p=>{const T=p.tenantState.currentTenantId,u=T!=null?p.tenantState.tenantsById[T]:void 0;return{capitalizableAccounts:u?.capitalizableAccounts??null,capitalizableAccountOverrides:u?.capitalizableAccountOverrides??null,dismissedAccounts:u?.capitalizationOnboardingDismissedAccounts??null}}),fe),G=c.useRef(x);G.current=x;const z=c.useRef(V);z.current=V;const w=c.useRef(R);w.current=R;const B=g((p=>tt(p.accountState)),fe),N=c.useMemo((()=>{const p={};for(const T of B)T.accountId!=null&&T.accountName!=null&&(p[T.accountId]=T.accountName);return p}),[B]),D=m!=null?N[m]??null:null,l=c.useCallback((p=>{if(!I)return;const T=G.current;if(T==null)return;const u=T.accounts??[],j=new Set(p),X=z.current??{},Q=w.current;for(const F of u)if(j.has(F.accountId)&&X[F.accountId]==null&&Q?.[F.accountId]==null)return h(F.classificationType),_(F.accountId),void S(!0)}),[I]),W=c.useCallback(((p,T)=>{r(at(E,p,T,!0)),S(!1),h(null),_(null)}),[r,E]),v=c.useCallback((()=>{m!=null&&(r(nt(E,m)),S(!1),h(null),_(null))}),[r,E,m]);return{showPopup:f&&I,popupType:A,popupAccountId:m,popupAccountName:D,currencySymbol:O,checkAndShowPopup:l,handleSubmit:W,handleDismiss:v}})(),a=c.useRef(void 0),n=c.useRef([]),o=c.useRef(s.checkAndShowPopup);o.current=s.checkAndShowPopup;const i=c.useRef(e);return i.current=e,c.useEffect((()=>{t==="In-Progress"&&(n.current=i.current()),t==="Completed"&&a.current==="In-Progress"&&n.current.length>0&&(o.current(n.current),n.current=[]),a.current=t}),[t]),s}const re=()=>{const t=xe.getSignedInUser(),{useFeatureGate:e}=Y(),{isFeatureEnabled:s}=e(P.isChainOfThoughtEnabled);return c.useMemo((()=>ot(t)&&s),[t,s])};function Be(t){if(t!=null){if("customer"in t&&t.customer!=null){const{customer:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in t&&t.vendor!=null){const{vendor:e}=t;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function Ta(t,e){const s=$(),{useFeatureGate:a,useDynamicConfig:n}=Y(),o=g((u=>K(u))),i=o.userRole.includes("charge_card_user")||o.userRole.includes("charge_card_admin"),r=o.userRole!=null&&Ee(o.userRole),f=o.userRole!=null&&Ie(o.userRole),{isFeatureEnabled:S}=a(P.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:A}=a(P.isExpenseAutomationEnabled),{configValue:h}=n(we.enableUncategorizedExpenseCategory),m=h?.uncategorized_expense_category_enabled===!0,_=re(),b=c.useMemo((()=>({id:t,type:q(e)})),[t,e]),y=g((u=>H(u,b))),C=y?.transactionDetailUpdateStatus?.fetchState,I=y?.transactionDetailLocalData?.lineItemById,k=g((u=>{const j=H(u,b)?.transactionDetailLocalData.vendorUpdates?.id;return j==null?"Not-Started":u.transactionVendorViewState.editVendorStateById[j]?.saveStatus.fetchState??"Not-Started"})),E=c.useMemo((()=>y?.fetchState==="Completed"?Be(y?.transaction):void 0),[y?.fetchState,y?.transaction]),O=g((u=>{if(E!=null)return De(u.customerIncomeState,u.vendorExpenseState,u.trendState,E,"month")})),x=g((u=>oe(u))),V=g((u=>{if(E!=null)return ve(u.trendWithTransactionsState,E,"TransactionDetail")})),R=o.company?.companyInfo.firstMonthOfFY??1,G=g((u=>Ce(u.accountState,u.accountListState,"accountList"))),[z,w]=c.useState(!1),[B,N]=c.useState(!1),[D,l]=c.useState(!1);c.useEffect((()=>{w(!1),N(!1),l(!1)}),[t,e]);const W=c.useCallback((()=>{w(!1),N(!1)}),[]),[v,p]=c.useState(!1),T=V?.selectedPeriod?.timePeriod;return c.useEffect((()=>{D||y==null||y.transaction==null||(s(ke({id:y.transaction.id,type:y.transaction.type})),l(!0)),E!=null&&(!i||r&&f===!1)&&(z?B||O==null||(N(!0),s(ce(E,"TransactionDetail",{timeframe:"month",timePeriod:T??O}))):(s(se()),s(ie()),w(!0),s(Ae(E))))}),[s,D,y?.fetchState,y?.transaction,E,i,r,f,z,B,O,T]),c.useEffect((()=>{x.newVendorState?.vendorDetailLocalData?.vendorName!=null?p(!0):p(!1)}),[x.newVendorState?.vendorDetailLocalData?.vendorName]),c.useEffect((()=>()=>{s(M("common"))}),[s]),{currentTenant:o,loggedInUserHasCardUserOrAdminRole:i,isUserHasDashboardAccess:r,isUserHasInvestorOrBankerAccess:f,isVendorBulkUpdateOnTransactionEnabled:S,isExpenseAutomationEnabled:A,isUncategorizedExpenseCategoryEnabled:m,isChainOfThoughtEnabled:_,selectedTransaction:b,transactionDetail:y,rawDetailSaveStatus:C,rawDetailLineItemById:I,vendorSaveStatus:k,tranEntity:E,defaultTrendTransactionTimePeriod:O,vendorViewDetails:x,uiState:V,firstMonthOfFY:R,uncategorizedAccounts:G,resetTrendIsFetchedStates:W,isCreateVendorDrawerOpen:v,setIsCreateVendorDrawerOpen:p}}const ea={overlayWidth:new Bt(100,100,58)},ta=({isOpen:t,onSaveVendor:e,onSaveSuccess:s,onCancel:a,vendorViewDetails:n})=>{const o=Lt(),i=Vt(),r=$(),f=g((h=>oe(h))),S=()=>{a()},A={vendorDetailView:n??f,onSaveSuccess:()=>{r(Oe()),r(st("Not-Started")),s()},onSaveVendor:e,onCancelClick:S,saveVendorDetailLocalData:h=>{r(_e({vendorId:void 0,localData:h}))}};return U.jsx(Ht,{anchor:"right",open:t,PaperProps:{style:{width:ea.overlayWidth.valuePercentage(i),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.4,cursor:"pointer"}}},onClose:S,children:U.jsx(aa,{onClick:h=>h.stopPropagation(),children:U.jsx(zt,{...A})})})},aa=Wt(qt)`
|
|
2
|
-
display: flex;
|
|
3
|
-
min-height: 100%;
|
|
4
|
-
flex-direction: column;
|
|
5
|
-
`;function na(t,e){t(it({transactionId:e.transactionId,creditAccountIntegrationId:e.creditAccountIntegrationId,debitAccountIntegrationId:e.debitAccountIntegrationId,memo:e.memo,transactionType:q(e.transactionType),sourceTransactionType:q(e.sourceTransactionType)}))}function oa({currentTransactionId:t,enabled:e=!0,buildPath:s,beforeNavigate:a,navigate:n,navigateState:o}){const i=g((f=>f.createTransferEntryState.lastTransferEntryReplacement)),r=c.useRef(null);c.useEffect((()=>{if(!e||i==null||t==null||r.current===i)return;const{previousTransactionId:f,newTransactionId:S}=i;t.id===f.id&&t.type===f.type&&(r.current=i,a?.(),n(s(S),{replace:!0,state:o}))}),[e,i,t,s,a,n,o])}const sa=({closeDrawerHandler:t,overrideTransactionId:e,overrideTransactionType:s})=>{const a=Se(),n=Te(),o=$(),i=re(),{transactionTypeEncoded:r,transactionId:f}=be(),S=e??f,A=s??Le(r??"");let h;Ve(S,A)&&(h={id:S,type:q(A)});const m=h!=null?g((b=>H(b,h))):void 0,_=()=>{const b=ae(a.state?.pathnameStackToGoBack),y=b.poppedPathname??((C=2)=>{let I="../";for(let k=0;k<C;k++)I=`${I}../`;return I})(1);n(y,{state:{pathnameStackToGoBack:b.newStack}})};return{transactionId:h,onSaveVendor:()=>{o(Pe(h,void 0))},onSaveSuccess:()=>{if(m!=null&&m?.transaction&&m?.transactionDetailLocalData.vendorUpdates?.qboId!=null&&m?.transactionDetailLocalData.vendorUpdates?.id!=null){const b=m?.transactionDetailLocalData.vendorUpdates,y={id:m?.transactionDetailLocalData.vendorUpdates?.qboId,zeniId:m?.transactionDetailLocalData.vendorUpdates?.id,type:"vendor",name:b?.name,qboId:m?.transactionDetailLocalData.vendorUpdates?.qboId??""},C={transactionId:{id:m?.transaction?.id,type:m?.transaction?.type},transaction:m?.transaction,lineIds:m?.transaction?.lines?.map((I=>I.id))??[]};o(J({entity:y,amount:m?.transaction?.amount.amount,transactionDetails:C,flowType:"detail",isFetchCOT:i}))}_()},onCancel:()=>{h!=null&&o(ct({transactionId:h})),o(Oe()),o(rt()),t(!0),_()}}},ia=Ze((function(t,e){const s=H(t,e.selectedTransaction);let a;s==null&&console.warn("Check if the you've selected the transaction before getting the details");const n=xe.getSignedInUser(),o=t.tenantState.currentTenantId,i={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:o??""};s!=null&&s.fetchState==="Completed"&&s.transaction!=null&&e.entity!=null&&(a=ut(t,e.entity,"TransactionDetail"));const r=t.entityAutoCompleteState.autoCompleteText.common,f=mt(t,"common"),S=K(t);return{transactionDetail:s,transactionAttachmentEndpointToDownload:`${te}/transaction_attachment`,transactionAttachmentsEndpointToFetch:S.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${te}/transaction_attachments_accounting_provider`:`${te}/transaction_attachments`,attachmentUploadEndpoint:`${$t.accountMicroServiceBaseUrl}`,isCOTEnabled:e.isCOTEnabled,authParams:i,trendReport:a,analytics:Fe,uncategorizedAccounts:e.uncategorizedAccounts,autoCompleteData:{autoCompleteText:r,entityAutoCompleteView:f},isVendorBulkUpdateOnTransactionEnabled:e.isVendorBulkUpdateOnTransactionEnabled,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled,enableBackClickOnSave:e.location.state?.message?.startsWith("comingFromScheduleDetails"),isTransactionSplitEditMode:s?.transactionDetailLocalData?.editMode??!1}}),(function(t,e){const{isCOTEnabled:s}=e;return{onBackClick:()=>{if(t(M("common")),e.onBackClick!=null)return void e.onBackClick();const a=ae(e.location.state?.pathnameStackToGoBack),n=a.poppedPathname??Ne(2);e.navigate(n,{state:{pathnameStackToGoBack:a.newStack,message:"comingFromTransactionDetail"}})},discardTransactionDetailLocalData:(a,n)=>{e.transaction!=null&&t(Ft({transactionId:{id:e.transaction.id,type:e.transaction.type},vendorId:a,customerId:n}))},onTransactionClick:a=>{e.resetTrendIsFetchedStates(),t(se()),t(ie());const n=ne(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(ze(a,e.tenantEmailDomain),{state:{pathnameStackToGoBack:n}})},onTrendSelectedPeriodChange:a=>{if(a==null)e.defaultTrendTransactionTimePeriod!=null&&t(he(e.entity,"TransactionDetail",{timeframe:"month",timePeriod:e.defaultTrendTransactionTimePeriod}));else{const n=a.currentTimePeriod==null?a.addTimePeriod:{startDate:a.addTimePeriod.startDate,endDate:a.currentTimePeriod.endDate};t(ce(e.entity,"TransactionDetail",{timeframe:a.timeframe,timePeriod:a.addTimePeriod})),t(he(e.entity,"TransactionDetail",{timeframe:a.timeframe,timePeriod:n}))}},onSaveUpdates:(a,n,o,i)=>{t(i===!0&&o!=null?Pe(a,o,!0,e.isExpenseAutomationEnabled,e.isUncategorizedExpenseCategoryEnabled):wt({transactionId:a,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,cotTransactionTracking:n,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled})),t(M("common"))},onUploadAttachmentAttachment:a=>{t(xt(a))},onDeleteAttachment:a=>{e.transaction!=null&&t(Ut(a,{id:e.transaction.id,type:e.transaction.type}))},onSaveTransactionDetailLocalData:(a,n)=>{t(Pt({transactionId:a,transactionLocalData:n}))},onUpdateAllChecked:(a,n,o,i)=>{e.transaction!=null&&t(Ot(e.selectedTransaction,e.transaction,a,n,o,i))},onResetLineItemsCategoryClassInLocalData:(a,n,o,i,r,f)=>{t(_t(a,n,o,i,r,f))},onChangeCategoryClassWhenUpdateAllIsChecked:(a,n)=>{e.transaction!=null&&t(At({id:e.transaction.id,type:e.transaction.type},e.transaction,a,n))},onSaveSuccess:()=>{const a=ae(e.location.state?.pathnameStackToGoBack);if(a.poppedPathname!=null){const n=Xt(a.poppedPathname,"/").split("/"),o=n[n.length-1];if(["uncategorized-income","uncategorized-expense","missing-receipts"].includes(o)&&e.navigate(a.poppedPathname,{state:{pathnameStackToGoBack:a.newStack}}),e.location.state?.message==="comingFromScheduleDetails"){const i=`${Jt(e.tenantEmailDomain)}`;e.navigate(i)}else if(e.location.state?.message==="comingFromScheduleDetailsFixedAssets"){const i=`${Kt(e.tenantEmailDomain)}`;e.navigate(i)}}},onPageRefresh:()=>{t(Ue(e.selectedTransaction,!0))},autoCompleteActions:{onAutoCompleteInputChange:(a,n)=>{a.trim().length>=2?t(kt({searchString:a,entityType:n,searchOrigin:"common"})):a.trim().length===0&&t(M("common"))},onCancelAutoComplete:()=>{t(M("common"))}},onFetchRecommendationsForEntity:(a,n,o,i)=>{t(J({entity:a,amount:n,transactionDetails:o,flowType:"detail",isFetchCOT:s}))},clearRecommendationForLineId:a=>{const{transactionId:n,transaction:o,lineId:i}=a;t(Ct(n,o,i))},resetUpdateErrorState:()=>{const a={id:e.selectedTransaction.id,type:e.selectedTransaction.type};t(vt(a))},onSaveVendorInLocalData:(a,n,o,i,r)=>{if(t(Dt({transactionId:a,vendorUpdates:n,entity:o})),n.id!=null&&o!=null&&i!=null&&r!=null&&t(J({entity:o,amount:i,transactionDetails:r,flowType:"detail",isFetchCOT:s})),t(_e({vendorId:n.id?n.id:void 0,localData:{vendorName:n.name,vendorId:n.id?n.id:void 0}})),!n.id&&e.transaction!=null){const f=e.transaction,S=ne(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(`/${e.tenantEmailDomain}/transaction/${encodeURIComponent(f.type??"")}/${f.id}/vendor/create`,{state:{pathnameStackToGoBack:S}})}},onSaveCustomerInLocalData:(a,n,o,i,r)=>{t(It({transactionId:a,customerUpdates:n,entity:o})),n.id!=null&&o!=null&&i!=null&&r!=null&&t(J({entity:o,amount:i,transactionDetails:r,flowType:"detail",isFetchCOT:s}))},onUpdateAllTranactionsWithCurrentVendorChecked:a=>{t(Et({transactionId:{id:e.selectedTransaction.id,type:e.selectedTransaction.type},isUpdateEnabled:a}))},onClickUpdateVendorToAllLineItems:(a,n,o)=>{t(bt(a,n,o))},onResetVendorToAllLineItems:(a,n,o)=>{t(Tt(a,n,o))},saveLatestSelectedEntity:(a,n,o)=>{t(St({transactionId:a,lineId:n,entity:o}))},updateVendorBulkRecommendationsFetchStatus:(a,n)=>{t(gt(a,n))},setIsVendorUpdateAllChecked:(a,n,o)=>{t(ht(a,n,o))},onCreateTransferEntry:e.isCreateTransferEntryFromExpenseEnabled===!0?a=>na(t,a):void 0,onLineAdd:()=>{if(e.transaction==null)return;const a={id:e.transaction.id,type:e.transaction.type},n=e.transaction.type==="journal_entry",o=e.transaction.amount?.currencyCode??"",i=e.transaction.amount?.currencySymbol??"",r=n?{amount:{amount:0,currencyCode:o,currencySymbol:i},id:crypto.randomUUID(),isCategoryMiscategorized:!1,isClassMiscategorized:!1,lineDescription:"",platformLineDetailType:"journal_entry_line_detail",type:"journal_entry_transaction_line",postingType:"debit",postingTypeName:"",lineTransactionType:"journal_entry"}:{amount:{amount:0,currencyCode:o,currencySymbol:i},id:crypto.randomUUID(),isCategoryMiscategorized:!1,isClassMiscategorized:!1,lineDescription:"",platformLineDetailType:"account_based_expense_line_detail",type:"transaction_with_account_and_class_line"};t(yt(a,r))},onLineDelete:a=>{if(e.transaction==null)return;const n={id:e.transaction.id,type:e.transaction.type};t(ft(n,a))},onToggleSplitEditMode:a=>{if(e.transaction==null)return;const n={id:e.transaction.id,type:e.transaction.type};t(pt(n,a))}}}))(Mt);function ba(){const t=Te(),e=$(),s=Se(),{useFeatureGate:a,useDynamicConfig:n}=Y(),o=Nt(),i=g((d=>K(d))),r=i.userRole.includes("charge_card_user")||i.userRole.includes("charge_card_admin"),f=i.userRole!=null&&Ee(i.userRole),S=i.userRole!=null&&Ie(i.userRole),{isFeatureEnabled:A}=a(P.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:h}=a(P.isExpenseAutomationEnabled),{configValue:m}=n(we.enableUncategorizedExpenseCategory),_=m?.uncategorized_expense_category_enabled===!0,{tenantEmailDomain:b,transactionTypeEncoded:y,transactionId:C}=be(),[I,k]=c.useState(!1),E=Le(y??""),O=Ve(C,E),x=g((d=>d.transactionVendorViewState)),V=re(),{isFeatureEnabled:R}=a(P.isTransactionCommentingEnabled),{isFeatureEnabled:G}=a(P.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:z}=a(P.isProjectsTransactionsEnabled),{isFeatureEnabled:w}=a(P.isTransactionSplitEnabled),B=o?.currentTenant?.companyId,N=o?.currentTenant?.companyName,D=c.useMemo((()=>{if(O)return{id:C,type:q(E)}}),[O,C,E]),l=D!=null?g((d=>H(d,D))):void 0,W=l?.transactionDetailLocalData.vendorUpdates?.id!=null?x.editVendorStateById[l?.transactionDetailLocalData.vendorUpdates.id]?.saveStatus.fetchState:"Not-Started",v=l?.fetchState==="Completed"?Be(l?.transaction):void 0,p=g((d=>v!=null?De(d.customerIncomeState,d.vendorExpenseState,d.trendState,v,"month"):void 0)),T=g((d=>oe(d))),u=g((d=>v!=null?ve(d.trendWithTransactionsState,v,"TransactionDetail"):void 0)),j=i.company?.companyInfo.firstMonthOfFY??1,X=g((d=>Ce(d.accountState,d.accountListState,"accountList"))),[Q,F]=c.useState(!1),[Re,le]=c.useState(!1),[Ge,de]=c.useState(!1),je=c.useCallback((d=>ze(d,b??"")+s.search),[b,s.search]),Me=c.useCallback((()=>{de(!1)}),[]);oa({currentTransactionId:D,enabled:b!=null&&b!=="",buildPath:je,beforeNavigate:Me,navigate:t,navigateState:s.state});const ue=()=>{F(!1),le(!1)},me=Rt();Qt();const Z=c.useRef(l?.transaction);Z.current=l?.transaction;const $e=l?.transactionDetailUpdateStatus?.fetchState,L=Zt($e,(()=>{const d=[];if(Z.current!=null)for(const ee of Z.current.lines??[])"account"in ee&&ee.account?.accountId!=null&&d.push(ee.account.accountId);return d}));c.useEffect((()=>{D!=null&&l!=null&&l.fetchState==="Not-Started"&&(e(Ue(D,!1)),ue())}),[e,D,l?.fetchState]),c.useEffect((()=>{if(D!=null&&l?.fetchState==="Error"){const d=ne(s.state?.pathnameStackToGoBack,s.pathname);t("page-not-found",{replace:!0,state:me?{pathnameStackToGoBack:d,message:"expenseAutomation",origin:"transaction_categorization"}:{pathnameStackToGoBack:d,message:"pageNotFound",origin:"transaction_detail"}})}}),[D,l?.fetchState,t,s.state,s.pathname,me]),c.useEffect((()=>{Ge||l==null||l.transaction==null||(e(ke({id:l.transaction.id,type:l.transaction.type})),de(!0)),v==null&&l?.fetchState==="Completed"&&ge(l?.transaction),v!=null&&(!r||f&&S===!1)&&(Q?Re||p==null||(le(!0),e(ce(v,"TransactionDetail",{timeframe:"month",timePeriod:u?.selectedPeriod?.timePeriod??p}))):(e(se()),e(ie()),ge(l?.transaction),F(!0),e(Ae(v))))}),[l?.fetchState,l?.transaction,p,r]),c.useEffect((()=>{T.newVendorState?.vendorDetailLocalData?.vendorName!=null?k(!0):k(!1)}),[T.newVendorState?.vendorDetailLocalData?.vendorName]),c.useEffect((()=>()=>{e(M("common"))}),[]);const We=[y,C].filter((d=>d!=null)),{transactionId:pe,onSaveVendor:qe,onSaveSuccess:He,onCancel:Ye}=sa({closeDrawerHandler:d=>{k(!1),t(d?"../":"../..")}}),{isAiCfoAccessEnabled:Je,onAskAiCfoClick:Ke}=Yt({mobileExploreReferrer:"Transaction Details"});return Gt({isDataReady:l?.fetchState==="Completed"}),O?U.jsxs(U.Fragment,{children:[pe!=null&&I&&U.jsx(ta,{isOpen:I,transactionId:pe,onSaveVendor:qe,onSaveSuccess:He,onCancel:Ye}),U.jsx(ia,{hideDeleteAttachment:!0,firstMonthOfFY:j,isDisabled:l?.transaction?.type==="transfer"&&o?.connectionName==="netsuite"?"readonly":void 0,tenantEmailDomain:b,location:s,navigate:t,selectedTransaction:D,entity:v,isCOTEnabled:V,defaultTrendTransactionTimePeriod:p,resetTrendIsFetchedStates:ue,transaction:l?.transaction,uncategorizedAccounts:X,vendorSaveStatus:W,isVendorBulkUpdateOnTransactionEnabled:A,isCreateTransferEntryFromExpenseEnabled:G,isExpenseAutomationEnabled:h,isUncategorizedExpenseCategoryEnabled:_,isAiCfoAccessEnabled:Je,onAskAiCfoClick:Ke,isTransactionCommentingEnabled:R,isProjectsTransactionsEnabled:z,isTransactionSplitEnabled:w,companyId:B,companyName:N}),L.showPopup&&L.popupType!=null&&U.jsx(jt,{popupType:L.popupType,currencySymbol:L.currencySymbol,accountId:L.popupAccountId??"",accountName:L.popupAccountName??"",onSubmit:L.handleSubmit,onDismiss:L.handleDismiss})]}):U.jsx(Qe,{to:Ne(We.length)})}const Ne=(t=2)=>{let e="../";for(let s=0;s<t;s++)e=`${e}../`;return e},ge=t=>{if(t!=null){const{transactionCategory:e,transactionClass:s}=ca(t),a=ra(t);Fe.trackTransactionDetails(t.account?.accountId,t.account?.accountName,t.id,a,e.length>0?e:void 0,s.length>0?s:void 0,t.type,t.amount,t.memo,t.lines?.length??0,t.attachments?.map((n=>n.fileName)))}},ca=t=>{const e=[],s=[];return t.lines?.forEach((a=>{switch(a.type){case"transaction_with_account_and_class_line":case"transaction_with_product_or_service_line":case"journal_entry_transaction_line":case"linked_transaction_line":{const n=a;n!=null&&n.account!=null&&n.account.accountName?.length>0&&e.push(n.account.accountName),n.class!=null&&n.class.className?.length>0&&s.push(n.class.className);break}}})),{transactionCategory:e,transactionClass:s}},ra=t=>lt(t)===!0?t.customer?.name??"":dt(t)===!0?t.vendor?.name??"":t.memo!=null?t.memo:t.type;export{ta as C,ba as T,Qt as a,Zt as b,sa as c,ia as d,oa as e,re as f,na as g,Ta as u};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./liveblocks-DKL6viSK.js";import{h as F,g as B,u as L,i as O,j as g,N as D,n as G,o as Ie,p as k}from"./core-DnZcjy6X.js";import{cs as N,e$ as E,QY as U,GO as ae,f_ as H,Gw as ne,Q_ as Te,GR as ke,QW as be,QX as se,Ra as je,EV as Ae,uz as Ee,R0 as ve,H8 as De,QZ as re,cW as q,yS as oe,fG as Fe,fI as Be,S9 as Le,Sa as Ue,Gx as Pe,Sb as Re,Gy as Me,GH as Ve,bs as Oe,bJ as Ge,cD as Ne,bK as _e,cr as ze,bt as $e,Mu as Ze,cq as He}from"./zeni-epic-state-m4zoW3ek.js";import{D as _,ar as qe,z as A,F as z,e as b,ch as Qe,ci as We,cj as Z,J as Q,E as Je,Z as Ke,a0 as Xe,w as ie,i as v,G as Ye,B as et,ck as tt,au as W,r as at,cl as nt,q as J,cm as st,Q as X,cn as rt,d as ot}from"./index-nBWRmUT4.js";import{D as it,n as R,S as ct}from"./mui-sr6zger7.js";import lt from"./NotFoundScreen-CdBZ6E4V.js";import{S as Y}from"./SetupPagesScreen-usZWca-_.js";import{a as p}from"./sentry-DFI2OQU2.js";import{u as ut}from"./useAskAiCfoHostNavButtonProps-BqNcSAwL.js";import{u as dt}from"./useInitialThreadRequest-Ch4ouOBD.js";import{u as pt}from"./useCashManagementBanner-rPbgM7YP.js";import{M as ce}from"./MobileAppDrawer-KiFiOGbB.js";import{F as mt}from"./FeaturePreviewScreen-BuOhC0VV.js";import{a as ee}from"./analyticsHelper-CTlcOyiL.js";import"./recharts-Bim6mdwu.js";import"./analytics-DtYJ-EGT.js";import"./plaid-QvRDxgoN.js";import"./dnd-eoV-_JYH.js";import"./stripe-cKAAJElX.js";import"./lottie-Dz5luYQG.js";import"./lexical-CSqytB8g.js";import"./pdf-BNSeVvBm.js";import"./utils-cHxIh7E8.js";import"./routePaths-D0N7YUlE.js";import"./BusinessVerificationPageScreen-BrCTRscW.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="64d00cb5-56a9-4fa2-9bb5-941e2f20c95d",t._sentryDebugIdIdentifier="sentry-dbid-64d00cb5-56a9-4fa2-9bb5-941e2f20c95d")}catch{}})();const ft=G((function(t,a){const{companyId:n}=a;return{treasurySetupView:U(t,n),analytics:b}}),(function(t,a){const{navigate:n,analytics:r,treasurySetupView:m}=a;return{onBackClick:()=>{n("../")},onNextClick:()=>{const s=m.fundAllocationLocalData;r.trackTreasuryPortfolioConfirm(s.riskScore,ee(s)),t(ke(!0))},onUpdateFundAllocation:s=>{r.trackTreasuryAllocationAction("update",ee(s)),t(Te(s))}}}))(Qe);function yt(){const t=F(),a=B(),n=L(),{tenantEmailDomain:r}=O(),m=_(),s=g((T=>T.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState)),f=qe(s),o=N(m?.loggedInUserRoleMap),[u,i]=p.useState(!1),[d,C]=p.useState(!1),[c,l]=p.useState(!1),S=g((T=>E(T))),y=A.getSignedInUserTenant(r)?.companyId??S.companyId,x=A.getSignedInUser(),h=g((T=>U(T,y))),I=g((T=>T.treasurySetupViewState.fetchState)),w=g((T=>T.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),M=g((T=>T.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState));if(x==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(p.useEffect((()=>{u||I!=="Not-Started"||y==null||(i(!0),n(ae(y,!0,!1)))}),[u,I,y,n]),p.useEffect((()=>{c||M!=="Not-Started"||y==null||(l(!0),n(H()))}),[c,M,y,n]),p.useEffect((()=>{d||w!=="Not-Started"||y==null||(C(!0),n(ne()))}),[d,w,y,n]),p.useEffect((()=>{f==="In-Progress"&&s==="Completed"&&t("../")}),[f,s,t]),S.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1)return e.jsx(D,{to:"../promo"});const P=S.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||I!=="Completed";return e.jsxs(e.Fragment,{children:[!P&&e.jsx(z,{analytics:b,onLoad:()=>{}}),e.jsx(ft,{navigate:t,location:a,companyId:y,isEditMode:!0,isLoading:P,isReadOnly:!o,treasurySetupView:h,analytics:b})]})}const gt=G((function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:je(t,n,"zeni_treasury","treasury_setup").plaidConnectionDetails,treasurySetupView:U(t,n)}}),(function(t,a){const{navigate:n,transferDetails:r,treasurySetupView:m}=a,s=r.treasuryTransferMoneyLocalData,f=m.fundAllocationLocalData;return{onCancelClick:()=>{Z(a.analytics,"cancel",s,f,"Transfer"),t(se()),n("../")},onTransferClick:()=>{Z(a.analytics,"confirm",s,f,"Transfer"),t(De())},onSaveChangesToLocalStore:o=>{t(ve(o))},onFetchLinkTokenClick:o=>{t(Ee("treasury_setup",o))},onEstablishConnectionClick:o=>{t(Ae(o,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}}))(We),ht=({isFirstTransfer:t})=>{const a=F(),{tenantEmailDomain:n}=O(),r=L(),[m,s]=p.useState(!1),[f,o]=p.useState(!1),[u,i]=p.useState(!1),[d,C]=p.useState(!1),c=g((w=>w.treasurySetupViewState.fetchState)),l=g((w=>w.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState)),S=g((w=>w.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState)),y=g((w=>E(w))),x=A.getSignedInUserTenant(n)?.companyId??y.companyId,h=g((w=>be(w))),I=g((w=>U(w,x)));if(A.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return p.useEffect((()=>{f||c!=="Not-Started"||x==null||(o(!0),r(ae(x,!0,!1)))}),[f,c,x,r]),p.useEffect((()=>{u||l!=="Not-Started"||x==null||(i(!0),r(H()))}),[u,l,x,r]),p.useEffect((()=>{d||S!=="Not-Started"||x==null||(C(!0),r(ne()))}),[d,S,x,r]),e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:b,onLoad:()=>{}}),e.jsx(gt,{analytics:b,navigate:a,transferDetails:h,onAnotherTransferClick:()=>{s(!1),r(se())},currentTenant:y,treasurySetupView:I,showReviewContent:m,maxInsuredAmount:5e5,onReviewClick:()=>{Z(b,"review",h.treasuryTransferMoneyLocalData,I.fundAllocationLocalData,"Transfer"),s(!0)},isFirstTransfer:t,setShowReviewContent:s,onBackClick:()=>{}})]})},St=R.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
min-height: 100%;
|
|
4
|
-
width: 100%;
|
|
5
|
-
flex: 1 1 auto;
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
align-items: center;
|
|
8
|
-
background-color: ${t=>t.theme.colors.grey4};
|
|
9
|
-
`,xt={overlayWidth:new Ye(100,100,48)},wt=G((function(t,a){const n=re(t),{companyId:r}=a;return{treasuryDetail:n,treasurySetupView:U(t,r),downloadEndPoint:`${W.bankingMicroServiceBaseUrl}/1.0/treasury-account/statements?query={"statement_type":"tax_statement"}`}}),(function(t,a){const{navigate:n,currentTenant:r,location:m,handleDrawerToggle:s,analytics:f,isCashManagementFeatureEnabled:o}=a,{tenantEmailDomain:u}=r;return{onSettingsClick:()=>{f.trackAccountsListPageClicked("Settings Icon"),n("setup")},onReloadTransactions:()=>{t(oe(!0))},handleTreasuryOptionSelection:i=>{let d="page-not-found";i==="editPortfolio"?d=Ct(u):i==="statements"?d=It(u):i==="taxLetter"?d=Tt(u):i==="settings"&&(d=kt(u));const C=at(m.state?.pathnameStackToGoBack,m.pathname);n(d,{state:{pathnameStackToGoBack:C}})},onColumnSortConfigChanged:(i,d)=>{t(Le({uiState:{sortKey:i,sortOrder:d}}))},onTransferClick:()=>{n("./transfer")},onBackClick:()=>{n("../../")},onClickMenuIcon:()=>{s(!0)},onAutoTransferClick:()=>{n(o?"../../checking/cash_management/auto-transfer":"../../checking/auto-transfer")},onCashManagementClick:()=>{n(`/${u}/checking/cash_management`)}}}))(tt);function $({isTransferDrawerOpen:t,isEditPortfolioDrawerOpen:a}){const n=B(),r=F(),m=L(),s=Q(),f=Je(),o=g((j=>E(j))),{tenantEmailDomain:u}=O(),i=o.companyId??A.getSignedInUserTenant(u)?.companyId,[d,C]=p.useState(!1),c=g((j=>re(j))),l=c.fetchState,S=c.accountSummary?.totalBalance?.amount,y=g((j=>j.treasurySetupViewState.treasuryFundsDetails?.fetchStatus)),x=o.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",h=_(),I=!!o.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,w=N(h?.loggedInUserRoleMap),M=q(h?.loggedInUserRoleMap),{areTenantIdsInSync:P}=Ke();p.useEffect((()=>{l==="Not-Started"&&!d&&P&&(C(!0),m(oe(!0)))}),[d,m,l,P]),p.useEffect((()=>{c.transactionsFetchState.fetchState==="Completed"&&c.transactions.length===0&&!n.pathname.includes("transfer")&&w&&r("./transfer")}),[c.transactionsFetchState.fetchState,c.transactions.length]);const T=()=>{r("..")},[le,ue]=p.useState(!1),K=j=>{ue(j)},{isAiCfoAccessEnabled:de,onAskAiCfoClick:pe}=ut({mobileExploreReferrer:"Treasury"});Xe({isDataReady:l==="Completed"});const me=pt(),{useFeatureGate:V}=ie(),{isFeatureEnabled:fe}=V(v.isDebitCardFeatureEnabled),{isFeatureEnabled:ye}=V(v.isAutoTransferRuleEnabled),{isFeatureEnabled:ge}=V(v.isTreasuryCommentingEnabled),{isFeatureEnabled:he}=V(v.isCashManagementFeatureEnabled),Se=dt(i,{clearParams:l==="Completed"&&y?.fetchState==="Completed"}),xe=Fe(o),we=Be(fe,o);if(xe===!0&&we!==!0)return e.jsx(mt,{});if(x){const j=y?.fetchState!=="Completed"||c.accountSummaryFetchState.fetchState!=="Completed";return e.jsxs(e.Fragment,{children:[c.accountSummaryFetchState.fetchState==="Completed"&&y?.fetchState==="Completed"&&t===!1&&a===!1?e.jsx(z,{analytics:b,onLoad:()=>{}}):null,e.jsx(it,{onClose:T,anchor:"right",open:a||t,transitionDuration:250,PaperProps:{style:{width:xt.overlayWidth.valuePercentage(s),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:f.colors.black,opacity:.75,cursor:"pointer"}}},children:e.jsxs(bt,{onClick:Ce=>Ce.stopPropagation(),children:[t===!0?e.jsx(ht,{isFirstTransfer:c.transactions.length===0||S===0}):null,a===!0?e.jsx(yt,{}):null]})}),e.jsxs(St,{windowSize:s,children:[e.jsx(ce,{isAppContentDrawerOpen:le,handleDrawerToggle:K}),e.jsx(wt,{treasuryDetailsView:c,isAutoTransferRuleEnabled:ye,navigate:r,currentTenant:o,location:n,companyId:i,analytics:b,cashManagementBannerProps:me,isCashManagementFeatureEnabled:he,isTreasuryCommentingEnabled:ge,handleDrawerToggle:K,initialOpenThreadRequest:Se,isLoading:j,isAiCfoAccessEnabled:de,onAskAiCfoClick:pe})]})]})}return I&&w?e.jsx(D,{to:"../setup"}):o.companyTreasuryInfo?.info&&!I&&M?e.jsx(D,{to:"../promo",state:n.state}):e.jsx(et,{fetchState:"In-Progress",style:{backgroundColor:f.colors.grey5}})}const Ct=t=>`/${t}/treasury/edit-portfolio`,It=t=>`/${t}/treasury/statements`,Tt=t=>`/${t}/treasury/tax-letter`,kt=t=>`/${t}/treasury/setup`,bt=R(ct)`
|
|
10
|
-
display: flex;
|
|
11
|
-
min-height: 100%;
|
|
12
|
-
flex-direction: column;
|
|
13
|
-
`,jt=R.div`
|
|
14
|
-
display: flex;
|
|
15
|
-
height: 100vh;
|
|
16
|
-
width: 100%;
|
|
17
|
-
flex: 1 1 auto;
|
|
18
|
-
flex-direction: column;
|
|
19
|
-
align-items: center;
|
|
20
|
-
background-color: ${t=>t.theme.colors.grey4};
|
|
21
|
-
`;function At(){const t=F(),a=L(),n=Q(),r=B(),m=`${W.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[s,f]=p.useState(!1),o=g((l=>Ue(l)));p.useEffect((()=>{s||o.fetchState!=="Not-Started"||(f(!0),a(Pe(!1)))}),[s,o.fetchState,a]);const u=A.getSignedInUser(),i=g((l=>E(l))),d={userId:u?.userId??"",sessionId:u?.zeniSessionId??"",tenantId:i.tenantId??""},C=i.company?.companyInfo.companyLegalName??i.companyName;if(u==null)throw Error("Can't access statements page without signing in...");const c=o.fetchState!=="Completed";return e.jsx(jt,{windowSize:n,children:e.jsx(nt,{currentTenantCompanyName:C,statementListView:o,isLoading:c,onBackClick:()=>{const l=J(r.state?.pathnameStackToGoBack),S=l.poppedPathname??"..";t(S,{state:{pathnameStackToGoBack:l.newStack}})},authParams:d,downloadEndPoint:m})})}const Et=R.div`
|
|
22
|
-
display: flex;
|
|
23
|
-
height: 100vh;
|
|
24
|
-
width: 100%;
|
|
25
|
-
flex: 1 1 auto;
|
|
26
|
-
flex-direction: column;
|
|
27
|
-
align-items: center;
|
|
28
|
-
background-color: ${t=>t.theme.colors.grey4};
|
|
29
|
-
`;function vt(){const t=F(),a=Q(),n=B(),r=L(),m=`${W.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[s,f]=p.useState(!1),o=g((l=>Re(l)));p.useEffect((()=>{s||o.fetchState!=="Not-Started"||(f(!0),r(Me(!1)))}),[s,o.fetchState,r]);const u=A.getSignedInUser(),i=g((l=>E(l))),d={userId:u?.userId??"",sessionId:u?.zeniSessionId??"",tenantId:i.tenantId??""},C=i.company?.companyInfo.companyLegalName??i.companyName;if(u==null)throw Error("Can't access tax letter page without signing in...");const c=o.fetchState!=="Completed";return e.jsx(Et,{windowSize:a,children:e.jsx(st,{currentTenantCompanyName:C,taxLetterListView:o,isLoading:c,onBackClick:()=>{const l=J(n.state?.pathnameStackToGoBack),S=l.poppedPathname??"..";t(S,{state:{pathnameStackToGoBack:l.newStack}})},authParams:d,downloadEndPoint:m})})}const Dt=G((function(t,a){const{companyId:n}=a,r=U(t,n);return{treasurySetupView:r,isSetupComplete:r.companyTreasuryInfo?.businessVerificationStatus?.code==="verified",videoUrl:"https://www.youtube.com/watch?v=sqvJWKCMZgk",meetingUrl:"https://meetings.hubspot.com/yoshi-araki/treasury-product-schedule-demo-link?embed=true"}}),(function(t,a){const{navigate:n,companyId:r}=a;return{onSetupButtonClick:()=>{t(Ve(r))},onBackClick:()=>{n("../..",{relative:"path"})},onTreasurySetupSuccess:m=>{n(m?"..":"../setup",{relative:"path"})}}}))(rt),Ft=()=>{const t=F(),a=B(),n=L(),{tenantEmailDomain:r}=O(),[m,s]=p.useState(!1),f=g((h=>E(h))),[o,u]=p.useState(!1),i=g((h=>h.treasurySetupViewState.treasuryFundsDetails?.fetchStatus));p.useEffect((()=>{o||i?.fetchState!=="Not-Started"||d==null||(u(!0),n(H()))}),[i,n]);const d=A.getSignedInUserTenant(r)?.companyId??f.companyId,C=A.getSignedInUser(),c=!!f.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,l=h=>{s(h)};if(C==null)throw Error("Can't access treasury promo page without signing in...");const S=_(),y=N(S?.loggedInUserRoleMap),x=q(S?.loggedInUserRoleMap);if(c&&y)return e.jsx(D,{to:"../../treasury/setup"});if(f.company?.companyTreasuryInfo&&(!c&&y||x)){if(a.state?.message==="activation"){const h=J(a.state?.pathnameStackToGoBack);t(a.pathname,{state:{...a.state,message:void 0,pathnameStackToGoBack:h.newStack}})}return i?.fetchState!=="Completed"?e.jsx(te,{children:e.jsx(X,{size:"ExtraLarge",start:!0})}):e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:b,onLoad:h=>(I=>I.trackTreasuryPromoView("Treasury Promo Page"))(h)}),e.jsx(ce,{isAppContentDrawerOpen:m,handleDrawerToggle:l}),e.jsx(Dt,{analytics:b,navigate:t,companyId:d,onClickMenuIcon:()=>{l(!0)}})]})}return e.jsx(te,{children:e.jsx(X,{size:"ExtraLarge",start:!0})})},te=R.div`
|
|
30
|
-
display: flex;
|
|
31
|
-
width: 100%;
|
|
32
|
-
height: 100%;
|
|
33
|
-
flex-direction: row;
|
|
34
|
-
justify-content: center;
|
|
35
|
-
align-items: center;
|
|
36
|
-
background-color: ${t=>t.theme.colors.grey5};
|
|
37
|
-
`;function na(){const t=B(),a=g((I=>E(I))),{useFeatureGate:n}=ie(),r=a.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",m=!!a.company?.companyTreasuryInfo?.isTreasuryTOSAccepted,s=_(),f=q(s?.loggedInUserRoleMap),o=a?.userRole!=null&&Oe(a?.userRole),u=(a?.company==null||a.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!o)&&Ge(s?.loggedInUserRoleMap),i=Ne(s?.loggedInUserRoleMap),d=(a?.company==null||a.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!o)&&_e(s?.loggedInUserRoleMap),C=!!a.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!o&&ze(s?.loggedInUserRoleMap),c=r&&!o&&N(s?.loggedInUserRoleMap),{isFeatureEnabled:l}=n(v.isChargeCardFeatureEnabled),{isFeatureEnabled:S}=n(v.isDebitCardFeatureEnabled),y=ot(a,l,S)&&!o&&$e(s?.loggedInUserRoleMap),x=Ze(s?.loggedInUserRoleMap),h=He(s?.loggedInUserRoleMap);return e.jsxs(Ie,{children:[h?null:e.jsx(k,{path:"setup",element:e.jsx(Y,{isBillPayAdminLevelAccess:u,isReimbursementAdminLevelAccess:d,isZeniAccountAdminLevelAccess:C,isChargeCardAdminLevelAccess:y,isTreasuryAdminLevelAccess:c,isUserHasOnlyCardAccess:x,isUserHasOnlyBillPayAccess:i,productType:"zeni_treasury",type:"setup"})}),h?null:e.jsx(k,{path:"verification",element:e.jsx(Y,{isBillPayAdminLevelAccess:u,isUserHasOnlyBillPayAccess:i,isReimbursementAdminLevelAccess:d,isZeniAccountAdminLevelAccess:C,isChargeCardAdminLevelAccess:y,isTreasuryAdminLevelAccess:c,isUserHasOnlyCardAccess:x,productType:"zeni_treasury",type:"verification"})}),e.jsx(k,{path:"promo",element:e.jsx(Ft,{})}),e.jsx(k,{path:"statements",element:e.jsx(At,{})}),e.jsx(k,{path:"tax-letter",element:e.jsx(vt,{})}),r?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"/",element:e.jsx($,{isTransferDrawerOpen:!1,isEditPortfolioDrawerOpen:!1})}),c?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"edit-portfolio",element:e.jsx($,{isEditPortfolioDrawerOpen:!0,isTransferDrawerOpen:!1})}),e.jsx(k,{path:"transfer",element:e.jsx($,{isTransferDrawerOpen:!0,isEditPortfolioDrawerOpen:!1})})]}):null,e.jsx(k,{path:"*",element:e.jsx(lt,{})})]}):m&&c?e.jsx(k,{path:"*",element:e.jsx(D,{to:"../setup"})}):a.company?.companyZeniAccountInfo&&f?e.jsx(k,{path:"*",element:e.jsx(D,{to:"../promo",state:t.state})}):e.jsx(k,{path:"*",element:null})]})}export{na as default};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./liveblocks-DKL6viSK.js";import{a as d}from"./sentry-DFI2OQU2.js";import{t as u,u as h,j as b,N as I}from"./core-DnZcjy6X.js";import{MN as y,fE as w,BI as j}from"./zeni-epic-state-m4zoW3ek.js";import{z as l,B as x,H as S,I as E}from"./index-nBWRmUT4.js";import{n as c}from"./mui-sr6zger7.js";import"./recharts-Bim6mdwu.js";import"./analytics-DtYJ-EGT.js";import"./plaid-QvRDxgoN.js";import"./dnd-eoV-_JYH.js";import"./stripe-cKAAJElX.js";import"./lottie-Dz5luYQG.js";import"./lexical-CSqytB8g.js";import"./pdf-BNSeVvBm.js";import"./utils-cHxIh7E8.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]="13c68f9c-53f1-4105-b004-f5b6bf99fa99",e._sentryDebugIdIdentifier="sentry-dbid-13c68f9c-53f1-4105-b004-f5b6bf99fa99")}catch{}})();const q=()=>{const[e]=u(),t=e.get("code")??"",s=e.get("state")??"",p=e.get("profileId")??"",[n,g]=d.useState(!1),a=h(),i=b((m=>y(m))),r=l.getSignedInUser(),f=l.getSignedInUserTenantWithId(s);if(r==null||f==null)return o.jsx(I,{to:"/signin/auth",replace:!0});if(r==null)throw Error("Can't access this page without signing in...");return w(r.userId,r.zeniSessionId,f?.tenantId),d.useEffect((()=>{n||(g(!0),a(j(t,p,s)))}),[n,a]),i.fetchState==="Error"?o.jsx(D,{children:o.jsx(_,{children:i.error?.message??""})}):(i.fetchState==="Completed"&&window.close(),o.jsx(x,{fetchState:"In-Progress"}))},D=c.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
width: 100%;
|
|
4
|
-
height: 100vh;
|
|
5
|
-
flex-direction: row;
|
|
6
|
-
justify-content: center;
|
|
7
|
-
align-items: center;
|
|
8
|
-
background-color: ${e=>e.theme.colors.grey5};
|
|
9
|
-
`,_=c(E.LargeRegular)`
|
|
10
|
-
display: flex;
|
|
11
|
-
color: ${S.important};
|
|
12
|
-
`;export{q as default};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{j as i}from"./liveblocks-DKL6viSK.js";import{a as m}from"./sentry-DFI2OQU2.js";import{h as x,u as L,g as $,i as j,j as p}from"./core-DnZcjy6X.js";import{LL as s,LK as B,S7 as v,e$ as C,S8 as E}from"./zeni-epic-state-m4zoW3ek.js";import{J as T,au as g,E as z,z as D,B as P,cg as N,q as U}from"./index-nBWRmUT4.js";import{n as _}from"./mui-sr6zger7.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="4bd1d572-7dfa-459b-9670-5e38c1f330e8",e._sentryDebugIdIdentifier="sentry-dbid-4bd1d572-7dfa-459b-9670-5e38c1f330e8")}catch{}})();const G=_.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
height: 100vh;
|
|
4
|
-
width: 100%;
|
|
5
|
-
flex: 1 1 auto;
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
align-items: center;
|
|
8
|
-
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
-
`;function Z(){const e=x(),n=L(),d=T(),l=$();let{accountId:a}=j(),f=`${g.bankingMicroServiceBaseUrl}/1.0/deposit-accounts/${a}`;a==null&&l.pathname.includes(`${s}/statements`)&&(a=s,f=`${g.bankingMicroServiceBaseUrl}/1.0/${s}`);const[u,h]=m.useState(!1),y=z();m.useEffect((()=>{u||(h(!0),n(B(a??"",!1)))}),[u,n]);const o=p((t=>v(t,a??""))),b=()=>{const t=U(l.state?.pathnameStackToGoBack),k=t.poppedPathname??"..";e(k,{state:{pathnameStackToGoBack:t.newStack}})},r=D.getSignedInUser(),c=p((t=>C(t))),I={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:c.tenantId??""},w=E(a??"")===!0?s:o.zeniAccountDetail?.accountLast4??"",S=c.company?.companyInfo.companyLegalName??c.companyName;if(r==null)throw Error("Can't access address page without signing in...");return o.fetchState!=="Completed"?i.jsx(P,{fetchState:"In-Progress",style:{backgroundColor:y.colors.grey5}}):i.jsx(G,{windowSize:d,children:i.jsx(N,{currentTenantCompanyName:S,statementListView:o,accountLast4:w,onBackClick:b,authParams:I,downloadEndPoint:f})})}export{Z};
|