@zeniai/web-app-ui 5.1.85-dev → 5.1.86-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-CYnGGpGr.js +1 -0
- package/dist/assets/AddressScreen-Cgf_DSfy.js +9 -0
- package/dist/assets/{AiCfoScreen-D2GxwJyN.js → AiCfoScreen-DK7jWO5l.js} +1 -1
- package/dist/assets/{BillPayApprovalRoutes-Csh9SPnU.js → BillPayApprovalRoutes-Bufqh5bf.js} +1 -1
- package/dist/assets/{BillPayRoutes-Dg9I-63-.js → BillPayRoutes-DQrVntHX.js} +12 -12
- package/dist/assets/{BusinessVerificationPageScreen-BLuK4dS7.js → BusinessVerificationPageScreen-BVO4LcOB.js} +2 -2
- package/dist/assets/{CardsAiCfoScreen-D8ZPE13M.js → CardsAiCfoScreen-BPq182YL.js} +1 -1
- package/dist/assets/ChargeCardRoutes--1Cz6d6F.js +71 -0
- package/dist/assets/CompanyPassportScreen-Cr6_STQF.js +1 -0
- package/dist/assets/{ConnectionAuthScreen-C8nHjroP.js → ConnectionAuthScreen-DPDyawJA.js} +1 -1
- package/dist/assets/CustomerOnboardingAuthScreen-CwgXB2Ot.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-Dk5stUMd.js → CustomerOnboardingRoutes-DBUibBfl.js} +4 -4
- package/dist/assets/{DashboardRoutes-B2SXqHam.js → DashboardRoutes-CWiRUKmL.js} +3 -3
- package/dist/assets/{DefaultTenantHome-DDzJzPvG.js → DefaultTenantHome-Q8Gr6wzz.js} +1 -1
- package/dist/assets/DomesticWireDetailScreen-Bg4bD2vf.js +18 -0
- package/dist/assets/DrawerScreen-ESB0V3An.js +1 -0
- package/dist/assets/EntityDetailRoutes-BgIcnD30.js +1 -0
- package/dist/assets/{ExpenseAutomationRoutes-B0EQq9x4.js → ExpenseAutomationRoutes-DRdJk7UH.js} +3 -3
- package/dist/assets/FeaturePreviewScreen-CPre8DhJ.js +1 -0
- package/dist/assets/{HubSpotOAuthCallbackScreen-DiHy3hck.js → HubSpotOAuthCallbackScreen-D1vja8MF.js} +1 -1
- package/dist/assets/MagicLinkRoutes-50BdhE1X.js +72 -0
- package/dist/assets/MagicLinkSignInScreen-oln-_jh3.js +12 -0
- package/dist/assets/{MobileAppDrawer-ChAhLGZE.js → MobileAppDrawer-CNkPd-0r.js} +1 -1
- package/dist/assets/NotFoundScreen-C4hj38o6.js +1 -0
- package/dist/assets/NotificationRoutes-CDTyM5yC.js +1 -0
- package/dist/assets/{OAuthConsentScreen-_yz0BOYy.js → OAuthConsentScreen-Bfra_k87.js} +1 -1
- package/dist/assets/PandLWithForecastRoutes-CgJVRO_P.js +1 -0
- package/dist/assets/PeopleRoutes-DsSKCjjc.js +22 -0
- package/dist/assets/PerformanceRoutes-5mjMtnxs.js +1 -0
- package/dist/assets/{Preview-D29JeEmY.js → Preview-ng4_PqRv.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-CwZNkZEW.js → QBOConnectionScreen-B3-UhwG_.js} +1 -1
- package/dist/assets/ReferralListScreen-Dt6a-ZaL.js +5 -0
- package/dist/assets/{ReimbursementApprovalRoutes-DAVTSD8z.js → ReimbursementApprovalRoutes-DJ6r8--7.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-CtUn349v.js → ReimbursementApprovalRuleDetailScreen-CGou3dCd.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-BYbEE0sN.js → ReimbursementRoutes-C1KqmlyM.js} +6 -6
- package/dist/assets/ReportsRoutes-BTVnfyaM.js +1 -0
- package/dist/assets/RewardsRoutes-DdOKhqcE.js +1 -0
- package/dist/assets/ScreenRoutes-CR7u1SOQ.js +2 -0
- package/dist/assets/SettingsRoutes-ZI-PRowa.js +57 -0
- package/dist/assets/{SetupPagesScreen-Drdx2Cz2.js → SetupPagesScreen-CnFtaoyZ.js} +5 -5
- package/dist/assets/{SignInScreen-HaZFyYNm.js → SignInScreen-BoQaZMzp.js} +1 -1
- package/dist/assets/SignOutScreen-BWN6fg9F.js +9 -0
- package/dist/assets/{TaskListScreen-B2sNWFUZ.js → TaskListScreen-wwlTbcpO.js} +2 -2
- package/dist/assets/TaskRoutes-BZfNRRg-.js +9 -0
- package/dist/assets/{TransactionDetailRoutes-BBXGE-Zw.js → TransactionDetailRoutes-75MHva3P.js} +1 -1
- package/dist/assets/{TransactionDetailScreen-D7m7OZhn.js → TransactionDetailScreen-BdRaLDX3.js} +2 -2
- package/dist/assets/{TransactionListRoutes-C8nLf9Ob.js → TransactionListRoutes-BK2uV7qm.js} +1 -1
- package/dist/assets/{TreasuryRoutes-CAqMFzPt.js → TreasuryRoutes-JT_IY3Gx.js} +6 -6
- package/dist/assets/{VendorsRoutes-kgQCFQez.js → VendorsRoutes-BS6JrHkM.js} +19 -19
- package/dist/assets/{WiseConfirmationScreen-Dj8vTbGW.js → WiseConfirmationScreen-CrmCNnnU.js} +2 -2
- package/dist/assets/{ZeniAccountRoutes-B85icQ0n.js → ZeniAccountRoutes-BPiHmqg-.js} +7 -7
- package/dist/assets/ZeniAccountStatementScreen-DxgFXxRD.js +9 -0
- package/dist/assets/{accountMappingHelper-B3v4RMhl.js → accountMappingHelper-COLWfB1U.js} +1 -1
- package/dist/assets/{analytics-7PXXxPIN.js → analytics-dJ9Vu0DH.js} +1 -1
- package/dist/assets/{analyticsHelper-Ce6ZNBVM.js → analyticsHelper-B2nQzr20.js} +1 -1
- package/dist/assets/{core-BDPZcSG4.js → core-Ca6G0voE.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-BR3AOxh5.js → decodeURIComponentSafe-BMcEUj25.js} +1 -1
- package/dist/assets/{dnd-fU8QmJ8U.js → dnd-Be5WoH8E.js} +1 -1
- package/dist/assets/{empty-DridEUN5.js → empty-DHGdIlcJ.js} +1 -1
- package/dist/assets/{empty-CM59KsLF.js → empty-uy3M1msm.js} +1 -1
- package/dist/assets/{emptyVideoElement--ZfOaFPu.js → emptyVideoElement-IUbgWLFZ.js} +1 -1
- package/dist/assets/{epic-D7C6_Y7q.js → epic-DoVGgmyH.js} +1 -1
- package/dist/assets/getLocaleForTenant-DVEihZ-H.js +1 -0
- package/dist/assets/{index-BZG4Ai-c.js → index-BMVCuDFR.js} +1 -1
- package/dist/assets/{index-DA1h5kq3.js → index-Ck8HU4ZH.js} +1 -1
- package/dist/assets/{index-DNm9oOTV.js → index-D3FowIif.js} +1 -1
- package/dist/assets/{index-B1tuor_E.js → index-DD9OmSLj.js} +14116 -14020
- package/dist/assets/{index-CAEfbAkM.js → index-Dcmv7y8l.js} +1 -1
- package/dist/assets/{index-TPK5ayqQ.js → index-Dpm9OcRr.js} +1 -1
- package/dist/assets/{index-BEZZznbS.js → index-Vw1oLCxE.js} +2 -2
- package/dist/assets/{index-BAkEFBVP.js → index-sd36C9hC.js} +1 -1
- package/dist/assets/{lexical-_D-pPLdL.js → lexical-DTpvAJin.js} +1 -1
- package/dist/assets/{liveblocks-B2nLBm11.js → liveblocks-4PIBJMyE.js} +1 -1
- package/dist/assets/{lottie--jYlW6ya.js → lottie-B7am_Gp2.js} +1 -1
- package/dist/assets/{mui-HaM5aBuG.js → mui-BI3ZId9r.js} +1 -1
- package/dist/assets/{pathToGoBack-Bp5QCbKd.js → pathToGoBack-CrG50xVP.js} +1 -1
- package/dist/assets/{pdf-CbrAe2yy.js → pdf-DUHWpwzW.js} +3 -3
- package/dist/assets/{pdf-lib-CHfVanCJ.js → pdf-lib-DyNMbFeB.js} +1 -1
- package/dist/assets/{plaid-DuKDxXr2.js → plaid-BFzM5Kog.js} +1 -1
- package/dist/assets/{pusher-p1571_5u.js → pusher-BmnXBdoc.js} +1 -1
- package/dist/assets/{react-DZP7sDw7.js → react-BOWfROr3.js} +1 -1
- package/dist/assets/{react-Di2JdnAu.js → react-CZFZzs7c.js} +1 -1
- package/dist/assets/{react-BvU2rtwe.js → react-CffrEBOp.js} +1 -1
- package/dist/assets/{react-BzGU_BeP.js → react-DM-Vx6Nk.js} +1 -1
- package/dist/assets/{react-CXLD6oJa.js → react-DMQWnTjk.js} +1 -1
- package/dist/assets/{react-D7-m9gXP.js → react-Wm4oo8rw.js} +1 -1
- package/dist/assets/{recharts-srrgu-jp.js → recharts-D6NnjcYi.js} +1 -1
- package/dist/assets/{routePaths-DbVBNvPC.js → routePaths-BumbtdKN.js} +1 -1
- package/dist/assets/{sentry-CLlo3TXi.js → sentry-CXcgkCeA.js} +1 -1
- package/dist/assets/{url-DqIeqdCZ.js → url-DVO5HPAn.js} +1 -1
- package/dist/assets/{url-ky0ROLAQ.js → url-DsqsNUWn.js} +1 -1
- package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-DQzT3CdB.js +1 -0
- package/dist/assets/useAskAiCfoHostNavButtonProps-CSLK93Wz.js +1 -0
- package/dist/assets/useCashManagementBanner-BNEI8i2V.js +1 -0
- package/dist/assets/useChargeCardPusherEvents-CtFgCR2P.js +1 -0
- package/dist/assets/{useDeviceId-CQ3pf2OT.js → useDeviceId-BbYF3u-l.js} +1 -1
- package/dist/assets/{useEmailConnectResultRefresh-7EeCPqR2.js → useEmailConnectResultRefresh-CMs316dl.js} +1 -1
- package/dist/assets/useInitialThreadRequest-B6-oXb8Z.js +1 -0
- package/dist/assets/{utils-BPOASmy-.js → utils-DFP_hVXq.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-DKz4VB48.js → withTransactionSidePanel-iSi7Lgwj.js} +3 -3
- package/dist/assets/{zeni-epic-state-pQFlpfOQ.js → zeni-epic-state-BIxjj87B.js} +3 -3
- package/dist/index.html +1 -1
- package/package.json +2 -2
- package/dist/assets/AddressRoutes-DpMeCgDh.js +0 -1
- package/dist/assets/AddressScreen-jEbIVhK3.js +0 -9
- package/dist/assets/ChargeCardRoutes-CyGButQm.js +0 -71
- package/dist/assets/CompanyPassportScreen--SPdIRlf.js +0 -1
- package/dist/assets/CustomerOnboardingAuthScreen-C6uz2GLr.js +0 -1
- package/dist/assets/DomesticWireDetailScreen-DDaUfwcf.js +0 -18
- package/dist/assets/DrawerScreen-DZ4DkgHO.js +0 -1
- package/dist/assets/EntityDetailRoutes-CFPPv2Q-.js +0 -1
- package/dist/assets/FeaturePreviewScreen-Dgm-EaRp.js +0 -1
- package/dist/assets/MagicLinkRoutes-CPrGkntv.js +0 -72
- package/dist/assets/MagicLinkSignInScreen-BHI5Ju3h.js +0 -12
- package/dist/assets/NotFoundScreen-By2F-w6l.js +0 -1
- package/dist/assets/NotificationRoutes-0mjOYLwF.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-CSm9JBFf.js +0 -1
- package/dist/assets/PeopleRoutes-DF4Scn5d.js +0 -22
- package/dist/assets/PerformanceRoutes-C0h70RAc.js +0 -1
- package/dist/assets/ReferralListScreen-C3Yy7aIK.js +0 -5
- package/dist/assets/ReportsRoutes-Cb8uSh4z.js +0 -1
- package/dist/assets/RewardsRoutes-BqWi3Rha.js +0 -1
- package/dist/assets/ScreenRoutes-CFWhfVwu.js +0 -2
- package/dist/assets/SettingsRoutes-Dqo8Gg1_.js +0 -57
- package/dist/assets/SignOutScreen-DGQ597Ur.js +0 -9
- package/dist/assets/TaskRoutes-DqlemW4d.js +0 -9
- package/dist/assets/ZeniAccountStatementScreen-CPK7RprH.js +0 -9
- package/dist/assets/getLocaleForTenant-5gC9KZpR.js +0 -1
- package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-Dpypv2iO.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-CtdOXC4O.js +0 -1
- package/dist/assets/useCashManagementBanner-DTfbqox_.js +0 -1
- package/dist/assets/useChargeCardPusherEvents-BSAOVtAf.js +0 -1
- package/dist/assets/useInitialThreadRequest-DaoYHqyn.js +0 -1
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{j as s}from"./liveblocks-4PIBJMyE.js";import{a as o}from"./sentry-CXcgkCeA.js";import{j as f,h as L,u as V,g as _,n as F}from"./core-Ca6G0voE.js";import{y as N,K as W,z as P,bg as K,E as M,_ as U,a0 as $,x as z,e as l,g as X,a9 as q,bh as G}from"./index-DD9OmSLj.js";import{fI as J,eX as Q,Pm as R,Pn as Y,vH as Z,vx as g,fK as ee,bS as re,vC as ae,Po as ne}from"./zeni-epic-state-BIxjj87B.js";import{D as te,e as se,n as oe,S as ie}from"./mui-BI3ZId9r.js";import{u as le}from"./useAskAiCfoHostNavButtonProps-CSLK93Wz.js";import{M as de}from"./MobileAppDrawer-CNkPd-0r.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="4b5ddc7f-f475-4c48-9f57-e711c9f3e7bf",e._sentryDebugIdIdentifier="sentry-dbid-4b5ddc7f-f475-4c48-9f57-e711c9f3e7bf")}catch{}})();const ce={overlayWidth:new M(100,100,30)},fe=({isReferralDrawerOpen:e,closeDrawerHandler:r})=>{const a=N(),n=W();if(P.getSignedInUser()==null)throw Error("Can't access How Referral works without signing in...");const i=()=>{r(!0)},u=f(d=>J(d));return s.jsx(te,{anchor:"right",open:e,PaperProps:{style:{width:ce.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:a.colors.black,cursor:"pointer"}}},onClose:()=>i(),children:s.jsx(se,{in:e,direction:"left",children:s.jsx(ue,{onClick:d=>d.stopPropagation(),children:s.jsx(K,{onDismissClick:i,rewardsPlan:u.rewardsPlan})})})})},ue=oe(ie)`
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100%;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
`,I="refer-and-earn-status-update",we=F(function(e){const r=R(e),a=e.referralViewState.rewardsPlanFetchState,n=re([r,a]);return{inviteList:r.invitations,uiState:r.uiState,pendingBonus:r.pendingBonus,earnedBonus:r.earnedBonus,pendingReferrals:r.pendingReferrals,fetchState:n.fetchState,rewardsPlan:r.rewardsPlan}},function(e,r){const{navigate:a}=r;return{onColumnSortConfigChanged:(n,i)=>{e(ne({sortOrder:i,sortkey:n}))},onInviteClick:()=>{l.trackRewardsPageClicked("invite via email"),a("../refer")},onHowItWorksClick:()=>{l.trackRewardsPageClicked("know more"),a("../how-it-works")},onResendInviteClick:n=>{l.trackRewardsPageClicked("resend invite"),e(ae(n))},onBackClick:()=>{a("../",{relative:"path"})},onReloadInvitees:()=>{e(g(!0))},onCopyReferralLink:()=>{l.trackRewardsPageClicked("copy referral link")},onClickRefer:()=>{l.trackRewardsPageClicked("refer")},onEventReceived:n=>{n===I&&e(g(!0,!0))}}})(q(G));function ye({isReferralDrawerOpen:e}){const r=L(),a=V(),n=_(),[i,u]=o.useState(!1),[d,x]=o.useState(!1),[D,E]=o.useState(!1),[k,C]=o.useState(!1),w=P.getSignedInUser(),h=f(t=>Q(t)),m=f(t=>R(t)),v=m.fetchState,p=f(t=>t.referralViewState.rewardsPlanFetchState),b=Y([m,p]),{areTenantIdsInSync:c}=U();o.useEffect(()=>{h?.rewardsLastViewedTime==null&&D===!1&&(a(Z()),E(!0))},[]),o.useEffect(()=>{!i&&v==="Not-Started"&&c&&(u(!0),a(g(!0)))},[v,a,c]),o.useEffect(()=>{!d&&p.fetchState==="Not-Started"&&c&&(x(!0),a(ee(!0)))},[p,a,c]),o.useEffect(()=>{C(e!=null&&e===!0)},[e]);const[j,A]=o.useState(!1),y=t=>{A(t)},{isAiCfoAccessEnabled:B,onAskAiCfoClick:O}=le({mobileExploreReferrer:"Rewards"});$({isDataReady:b===!0});const T={events:w?.userId!=null?[`private-encrypted-${w.userId}.${I}`]:[],eventCallback:(t,S,H)=>{H.onEventReceived(t)}};return s.jsxs(s.Fragment,{children:[b===!0?s.jsx(z,{analytics:l,onLoad:t=>(S=>{w!=null&&S.trackPageLoaded(X.Event.rewardsPageViewed)})(t)}):null,s.jsx(de,{isAppContentDrawerOpen:j,handleDrawerToggle:y}),k===!0?s.jsx(fe,{closeDrawerHandler:()=>{C(!1),r("..")},isReferralDrawerOpen:k}):null,s.jsx(we,{location:n,navigate:r,currentTenant:h,onClickMenuIcon:()=>{y(!0)},isAiCfoAccessEnabled:B,onAskAiCfoClick:O,...T})]})}export{ye as R};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as r}from"./liveblocks-
|
|
1
|
+
import{j as r}from"./liveblocks-4PIBJMyE.js";import O from"./NotFoundScreen-C4hj38o6.js";import{a as p}from"./sentry-CXcgkCeA.js";import{h as A,g as x,u as C,j as u,N as D,n as k,o as W,p as g}from"./core-Ca6G0voE.js";import{eX as E,Qg as b,Qw as S,FC as V,EL as U,FB as d,Fs as B,QJ as L,FE as _}from"./zeni-epic-state-BIxjj87B.js";import{z as N,a9 as $,b$ as Q,ag as T,bE as z,c0 as J}from"./index-DD9OmSLj.js";import"./mui-BI3ZId9r.js";import{u as K,R as I}from"./ReimbursementApprovalRuleDetailScreen-CGou3dCd.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]="d6bf0d1f-456c-4b46-9c34-8ad07c47a6ef",e._sentryDebugIdIdentifier="sentry-dbid-d6bf0d1f-456c-4b46-9c34-8ad07c47a6ef")}catch{}})();const y="reimbursement-approval-rule-update",X=k(function(e){return{approvalView:b(e),remiSetupApproverViewUpdateData:S(e).remiSetupApproverViewUpdateData}},function(e,o){const{navigate:s,location:n}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(y)&&e(L(!1))},onBackClick:()=>{T(n)?s("../../"):s("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(B(t,!1))},onEditRuleClick:t=>{t!=null?(e(d(t)),s(`./${t}/edit`)):(e(d()),s("./new"))}}})($(Q)),q=({isLoading:e})=>{const o=A(),s=x(),n=C(),[t,i]=p.useState(!1),[m,w]=p.useState(!1),f=u(a=>a.remiSetupApproverViewState.fetchState),l=u(a=>E(a)),c=u(a=>b(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||(w(!0),n(d())),o("./new"))},[m,c,n]);const R={events:l.companyId!=null?[`private-encrypted-${l.companyId}.${y}`]:[],eventCallback:(a,F,h)=>{a.endsWith(y)&&h.onApprovalRulesEventReceived(a)}};return l?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(D,{to:"../../promo"}):r.jsx(X,{currentTenant:l,location:s,navigate:o,...R})},j="reimbursement-approval-rule-update",G=k(function(e){const o=b(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(L(!1))},onBackClick:()=>{T(n)?s("../../"):s("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(B(t,!0))},onEditRuleClick:t=>{t!=null?(e(d(t)),s(`./${t}/edit`)):(e(d()),s("./new"))},onReorderRules:t=>{e(_(t,!0))}}})($(J)),H=()=>{const e=u(n=>E(n)),{isApprovalRulesV3Enabled:o,isLoading:s}=z(e?.tenantId);return o?r.jsx(M,{isLoading:s}):r.jsx(q,{isLoading:s})},M=({isLoading:e})=>{const o=A(),s=x(),n=C(),[t,i]=p.useState(!1),[m,w]=p.useState(!1),f=u(a=>a.remiSetupApproverViewState.fetchState),l=u(a=>E(a)),c=u(a=>b(a));K();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||(w(!0),n(d())),o("./new"))},[m,c,n]);const R={events:l.companyId!=null?[`private-encrypted-${l.companyId}.${j}`]:[],eventCallback:(a,F,h)=>{a.endsWith(j)&&h.onApprovalRulesEventReceived(a)}};return l?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(D,{to:"../../promo"}):r.jsx(G,{currentTenant:l,location:s,navigate:o,isLoading:e,...R})};function oe(){return r.jsxs(W,{children:[r.jsx(g,{path:"/",element:r.jsx(H,{})}),r.jsx(g,{path:"/new",element:r.jsx(I,{})}),r.jsx(g,{path:"/:approvalRuleId/edit",element:r.jsx(I,{})}),r.jsx(g,{path:"*",element:r.jsx(O,{})})]})}export{oe as R};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as h}from"./liveblocks-
|
|
1
|
+
import{j as h}from"./liveblocks-4PIBJMyE.js";import{a as f}from"./sentry-CXcgkCeA.js";import{u as T,j as y,h as _,g as O,i as k,n as F}from"./core-Ca6G0voE.js";import{kZ as Q,Qw as w,Qg as x,Fv as V,FH as B,FC as A,FD as E,Qx as j,eX as z,FB as H}from"./zeni-epic-state-BIxjj87B.js";import{z as N,y as P,B as $,bR as K,ag as q,bE as W,bS as X}from"./index-DD9OmSLj.js";import"./mui-BI3ZId9r.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="fed57c16-2569-4f85-ad6c-338af56ab260",e._sentryDebugIdIdentifier="sentry-dbid-fed57c16-2569-4f85-ad6c-338af56ab260")}catch{}})();function Z(){const e=T(),s=f.useRef(!1),t=y(o=>o.vendorListState.fetchStateBillsTab.fetchState??"Not-Started"),p=y(o=>o.vendorListState.allVendorIdsBillsTab.length>0);f.useEffect(()=>{s.current||p||t==="Completed"||t==="In-Progress"||(s.current=!0,e(Q({})))},[p,t,e])}const G=F(function(e,s){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=p==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return s.approvalRuleId&&(l=t.allApprovalRules.findIndex(r=>r.approvalRuleId===s.approvalRuleId)===0),{localData:t,hideUpperBoundField:o,isLowerBoundDisabled:l,approvalUpdateActionType:p}},function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=q(s.location);return{onApprovalRuleDataUpdated:a=>{const d=v=>{const S=[];return v.forEach(u=>{const R=u.actors.selectedUsers.map(m=>({type:"user",subType:void 0,userId:m.userId,idType:"user",isImplicitActor:!1})),I=u.actors.selectedNonUsers.map(m=>{const g=(b=m.value,j(b)==null);var b;return{type:g?"attribute":"role",subType:m.value,userId:void 0,idType:void 0,isImplicitActor:!g}}),c=R.concat(I);S.push({action:u.stepType.selectedOption,actors:c,operator:c.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),S},n={amount:{type:"amount",comparator:"range",min:{amount:a.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:a.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(r==="approval_create"){const v={criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}else{const v={approvalRuleId:l,criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!1))},onSaveRuleSuccess:()=>{t("../")}}})(K);function J(){const e=_(),s=T(),t=O(),{approvalRuleId:p}=k(),o=N.getSignedInUser(),l=P(),r=y(n=>w(n)),i=y(n=>x(n)),[a,d]=f.useState(!1);if(f.useEffect(()=>{a||(d(!0),s(V(!0)))}),f.useEffect(()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?h.jsx($,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):h.jsx(G,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t})}function pe(e){return j(e)==null}const M=F(function(e,s){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=[],l={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(o.push(r.id),l[r.id]=r.name);return{localData:t,approvalUpdateActionType:p,allVendorIds:o,vendorNamesById:l,editingRuleId:p==="approval_update"?s.approvalRuleId:void 0,allApprovalRulesWithUser:x(e).allApprovalRules}},function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=q(s.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const m=[];return c.forEach(g=>{const b=g.actorKind?.selectedOption,C=g.selectedRole?.selectedOption;let D=[];b==="role"&&C!=null?D=[{type:"attribute",subType:C,userId:void 0,idType:void 0,isImplicitActor:!1}]:b==="specific_person"&&(D=(g.persons?.selectedUsers??[]).map(L=>({type:"user",subType:void 0,userId:L.userId,idType:"user",isImplicitActor:!1})));const U=g.action??"require_approval";m.push({action:U,actors:D,operator:D.length>1?U==="require_approval"?"or":"and":"is"})}),m},n=a.amountCriteria,v=a.vendorCriteria,S=a.departmentCriteria,u={};if(n!=null&&n.comparator.selectedOption!=null){const c=n.comparator.selectedOption;u.amount={type:"amount",comparator:c,min:c==="less_than"?void 0:n.min,max:c==="greater_than"?void 0:n.max}}const R=v?.selection.selectedOptions??[];R.length>0&&(u.vendor={type:"vendor",operator:v?.operator.selectedOption??"is",vendorIds:R});const I=S?.selection.selectedOptions??[];if(I.length>0&&(u.department={type:"department",operator:S?.operator.selectedOption??"is",departmentIds:I}),r==="approval_create"){const c={name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}else{const c={approvalRuleId:l,name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:a=>{e(H(a)),t(r==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}})(X);function ne(){const e=y(t=>z(t)),{isApprovalRulesV3Enabled:s}=W(e?.tenantId);return s?h.jsx(Y,{}):h.jsx(J,{})}function Y(){const e=_(),s=T(),t=O(),{approvalRuleId:p}=k(),o=N.getSignedInUser(),l=P(),r=y(n=>w(n)),i=y(n=>x(n)),[a,d]=f.useState(!1);if(Z(),f.useEffect(()=>{a||(d(!0),s(V(!0)))}),f.useEffect(()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")},[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?h.jsx($,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):h.jsx(M,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t},p??"new")}export{ne as R,pe as i,Z as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-B2nLBm11.js";import{h as W,u as de,g as Z,i as Y,j as w,N as _,n as K,l as mt,o as ct,p as C}from"./core-BDPZcSG4.js";import{eX as V,QK as ue,c6 as pe,EG as Fe,kI as dt,ET as oe,ES as re,QL as ut,bn as be,gp as Ue,QM as pt,N7 as bt,kx as Le,N8 as ke,N9 as gt,js as ht,Q2 as ft,jH as St,Eu as It,ub as Rt,jz as yt,Fe as Pe,QN as $e,QO as kt,QP as vt,QQ as At,QR as Ct,QS as Et,E_ as ve,jN as wt,Qb as xt,EU as Bt,EE as Tt,QT as jt,ED as Dt,QU as Ft,EM as Ae,F2 as Ut,F1 as Lt,EZ as Pt,QV as Me,Kd as $t,bq as Mt,EP as _t,Fw as Nt,QW as Ot,QX as Qt,Fa as zt,F7 as Ce,Px as Gt,EB as Zt,QY as _e,FY as Ee,G4 as Vt,QZ as Ht,Q_ as z,Q$ as Wt,R0 as Ne,R1 as Kt,R2 as Oe,R3 as Qe,Fm as le,bu as qt,bK as ge,cG as he,fE as ze,fC as Ge,R4 as Xt,fz as Jt,PK as Yt,R5 as en,R6 as Ze,PO as tn,Qw as nn,R7 as an,QJ as sn,G1 as we,G0 as on,R8 as rn,R9 as ln,Ra as mn,Rb as cn,Rc as dn,Qh as un,FT as pn,FX as bn,bs as gn,bJ as hn,cA as fn,co as Sn,bt as In,LX as Rn,cQ as yn,cT as kn,cS as vn,cz as An}from"./zeni-epic-state-pQFlpfOQ.js";import{T as Ve,K as He,V as ee,Q as E,z as $,c0 as We,v as te,d as v,aL as xe,o as D,at as J,D as Cn,a as Ke,c1 as En,r as G,$ as qe,c2 as wn,k as ne,c3 as xn,Y as Bn,x as Tn,B as fe,f as Xe,a8 as jn,bo as Dn,a3 as Fn,y as Je,c4 as Un,i as Ln}from"./index-B1tuor_E.js";import{n as N,S as Pn}from"./mui-HaM5aBuG.js";import me from"./NotFoundScreen-By2F-w6l.js";import{S as Be}from"./SetupPagesScreen-Drdx2Cz2.js";import{F as Ye}from"./FeaturePreviewScreen-Dgm-EaRp.js";import{a as f}from"./sentry-CLlo3TXi.js";import{u as Se}from"./useAskAiCfoHostNavButtonProps-CtdOXC4O.js";import{u as et}from"./useInitialThreadRequest-DaoYHqyn.js";import{D as $n}from"./DrawerScreen-DZ4DkgHO.js";import{M as tt}from"./MobileAppDrawer-ChAhLGZE.js";import{R as Mn}from"./ReimbursementApprovalRoutes-DAVTSD8z.js";import{FallBackRoute as _n}from"./ScreenRoutes-CFWhfVwu.js";import"./recharts-srrgu-jp.js";import"./analytics-7PXXxPIN.js";import"./plaid-DuKDxXr2.js";import"./dnd-fU8QmJ8U.js";import"./stripe-DMRn4zHo.js";import"./lottie--jYlW6ya.js";import"./lexical-_D-pPLdL.js";import"./pdf-CbrAe2yy.js";import"./utils-BPOASmy-.js";import"./analyticsHelper-Ce6ZNBVM.js";import"./routePaths-DbVBNvPC.js";import"./BusinessVerificationPageScreen-BLuK4dS7.js";import"./ReimbursementApprovalRuleDetailScreen-CtUn349v.js";import"./getLocaleForTenant-5gC9KZpR.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]="16e3d80e-9708-4229-9a91-a65beec116ac",e._sentryDebugIdIdentifier="sentry-dbid-16e3d80e-9708-4229-9a91-a65beec116ac")}catch{}})();const nt=e=>`/${e}/reimbursements`,Nn=e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{spendManagement:{reimbursement:{reimbursementDetail:U}}}=Ke.getLocalizedStrings(),On=K(function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=$.getSignedInUser(),c=be(d),m=r.plaidConnectionDetails,o=Ue(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=ue(e,t.reimbursementId),b=pt(e,d?.userId??"");let y=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,h=d?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,u=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${J.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:T,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:y,isUserAdmin:pe(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:v,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:Le(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=$.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(re(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(Ae(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Pt(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Lt())},clearRemiSaveStatus:()=>{e(Ut("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(Ae(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ft({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(Dt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(jt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Tt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Bt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(ve(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(ve("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Et({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(oe({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Ct({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(At({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(vt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e($e()),e(kt());const i=nt(o),l=G(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(v.trackReimbursementDeleteReimbursement(n),e(Pe(n)))},onSaveBankAccount:()=>{a?.userId&&e(yt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(Rt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(It(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(St(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(gt({searchString:i,entityType:l,searchOrigin:"common"})):e(ke("common"))},onCancelAutoComplete:()=>{e(ke("common"))}}}})(En);function Te(){const e=W(),t=de(),n=Z(),{reimbursementId:r}=Y(),d=Ve(),c=He(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=ee(),{isFeatureEnabled:b}=l(E.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(E.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(E.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=Se({mobileExploreReferrer:"Reimbursement Details"}),x=Z().pathname,j=x.includes("edit"),k=x.includes("reimbursement/new"),[F,B]=f.useState(!1),A=$.getSignedInUser(),I=w(p=>V(p)),g=w(p=>ue(p,r)),L=et(I?.companyId,{clearParams:g.fetchState==="Completed"}),P=pe(I?.userRole??[]);f.useEffect(()=>{(k&&!F||j&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(B(!0),t(Fe(!1,b,y,r)))});const M=w(p=>dt(p.accountState,p.accountListState,"reimbursementAccountList"));if(A==null)throw Error("Can't access address page without signing in...");const R={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||P&&g.billStatus==="rejected"||P===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(_,{to:R}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(We,{isNewReimbursement:r==null}):s.jsxs(Qn,{windowSize:c,children:[s.jsx(te,{analytics:v,onLoad:p=>(H=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&H.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(zn,{}):null,m&&c!=="small"?s.jsx(Gn,{children:s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${J.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:A?.userId??"",sessionId:A?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,A?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:D.sp3,paddingBottom:"15px",paddingLeft:D.sp5},dropFilePlaceholder:{upload:U.dropReceipt.upload,single:U.dropReceipt.single,or:U.dropReceipt.or,multiple:U.dropReceipt.multiple,receipts:U.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Zn,{children:[s.jsx(Vn,{onClick:()=>o(!1),children:s.jsx(Nn,{})}),s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${J.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:A?.userId??"",sessionId:A?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,A?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:D.sp5,paddingRight:D.sp3,paddingBottom:D.sp5,paddingLeft:D.sp3},dropFilePlaceholder:{upload:U.dropReceipt.upload,single:U.dropReceipt.single,or:U.dropReceipt.or,multiple:U.dropReceipt.multiple,receipts:U.dropReceipt.receipts}})]}):null,s.jsx(Hn,{windowSize:c,children:s.jsx(On,{initialOpenThreadRequest:L??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:d,uncategorizedAccounts:M,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const Qn=N.div`
|
|
1
|
+
import{j as s}from"./liveblocks-4PIBJMyE.js";import{h as W,u as de,g as Z,i as Y,j as w,N as _,n as K,l as mt,o as ct,p as C}from"./core-Ca6G0voE.js";import{eX as H,QK as ue,c6 as pe,EG as Fe,kI as dt,ET as oe,ES as re,QL as ut,bn as be,gp as Ue,QM as pt,N7 as bt,kx as Le,N8 as Ae,N9 as gt,js as ht,Q2 as ft,jH as St,Eu as It,ub as Rt,jz as yt,Fe as Pe,QN as $e,QO as At,QP as kt,QQ as vt,QR as Ct,QS as Et,E_ as ke,jN as wt,Qb as xt,EU as Bt,EE as Tt,QT as jt,ED as Dt,QU as Ft,EM as ve,F2 as Ut,F1 as Lt,EZ as Pt,QV as Me,Kd as $t,bq as Mt,EP as _t,Fw as Nt,QW as Ot,QX as Qt,Fa as zt,F7 as Ce,Px as Gt,EB as Zt,QY as _e,FY as Ee,G4 as Ht,QZ as Vt,Q_ as z,Q$ as Wt,R0 as Ne,R1 as Kt,R2 as Oe,R3 as Qe,Fm as le,bu as qt,bK as ge,cG as he,fE as ze,fC as Ge,R4 as Xt,fz as Jt,PK as Yt,R5 as en,R6 as Ze,PO as tn,Qw as nn,R7 as an,QJ as sn,G1 as we,G0 as on,R8 as rn,R9 as ln,Ra as mn,Rb as cn,Rc as dn,Qh as un,FT as pn,FX as bn,bs as gn,bJ as hn,cA as fn,co as Sn,bt as In,LX as Rn,cQ as yn,cT as An,cS as kn,cz as vn}from"./zeni-epic-state-BIxjj87B.js";import{F as He,K as Ve,C as ee,U as E,z as $,c1 as We,x as te,e as k,aM as xe,o as D,au as J,I as Cn,a as Ke,c2 as En,s as G,a0 as qe,c3 as wn,j as ne,c4 as xn,_ as Bn,E as Tn,B as fe,g as Xe,a9 as jn,bp as Dn,a4 as Fn,y as Je,c5 as Un,i as Ln}from"./index-DD9OmSLj.js";import{n as N,S as Pn}from"./mui-BI3ZId9r.js";import me from"./NotFoundScreen-C4hj38o6.js";import{S as Be}from"./SetupPagesScreen-CnFtaoyZ.js";import{F as Ye}from"./FeaturePreviewScreen-CPre8DhJ.js";import{a as f}from"./sentry-CXcgkCeA.js";import{u as Se}from"./useAskAiCfoHostNavButtonProps-CSLK93Wz.js";import{u as et}from"./useInitialThreadRequest-B6-oXb8Z.js";import{D as $n}from"./DrawerScreen-ESB0V3An.js";import{M as tt}from"./MobileAppDrawer-CNkPd-0r.js";import{R as Mn}from"./ReimbursementApprovalRoutes-DJ6r8--7.js";import{FallBackRoute as _n}from"./ScreenRoutes-CR7u1SOQ.js";import"./recharts-D6NnjcYi.js";import"./analytics-dJ9Vu0DH.js";import"./plaid-BFzM5Kog.js";import"./dnd-Be5WoH8E.js";import"./stripe-DMRn4zHo.js";import"./lottie-B7am_Gp2.js";import"./lexical-DTpvAJin.js";import"./pdf-DUHWpwzW.js";import"./utils-DFP_hVXq.js";import"./analyticsHelper-B2nQzr20.js";import"./routePaths-BumbtdKN.js";import"./BusinessVerificationPageScreen-BVO4LcOB.js";import"./ReimbursementApprovalRuleDetailScreen-CGou3dCd.js";import"./getLocaleForTenant-DVEihZ-H.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="0dac5ffb-2b3a-4e69-b8bd-4ce611f4f22c",e._sentryDebugIdIdentifier="sentry-dbid-0dac5ffb-2b3a-4e69-b8bd-4ce611f4f22c")}catch{}})();const nt=e=>`/${e}/reimbursements`,Nn=e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{spendManagement:{reimbursement:{reimbursementDetail:U}}}=Ke.getLocalizedStrings(),On=K(function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=$.getSignedInUser(),c=be(d),m=r.plaidConnectionDetails,o=Ue(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=ue(e,t.reimbursementId),b=pt(e,d?.userId??"");let y=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,h=d?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,u=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${J.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:T,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy:y,isUserAdmin:pe(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:k,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:Le(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=$.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(re(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(ve(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Pt(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Lt())},clearRemiSaveStatus:()=>{e(Ut("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(ve(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ft({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(Dt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(jt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Tt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Bt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(ke(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(ke("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Et({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(oe({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Ct({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(vt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(kt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e($e()),e(At());const i=nt(o),l=G(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(k.trackReimbursementDeleteReimbursement(n),e(Pe(n)))},onSaveBankAccount:()=>{a?.userId&&e(yt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(Rt("user_reimbursement_account",i))},onEstablishConnectionClick:i=>{e(It(i,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:i=>{e(St(i,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,l)=>{i.trim().length>=2?e(gt({searchString:i,entityType:l,searchOrigin:"common"})):e(Ae("common"))},onCancelAutoComplete:()=>{e(Ae("common"))}}}})(En);function Te(){const e=W(),t=de(),n=Z(),{reimbursementId:r}=Y(),d=He(),c=Ve(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=ee(),{isFeatureEnabled:b}=l(E.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(E.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(E.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=Se({mobileExploreReferrer:"Reimbursement Details"}),x=Z().pathname,j=x.includes("edit"),A=x.includes("reimbursement/new"),[F,B]=f.useState(!1),v=$.getSignedInUser(),I=w(p=>H(p)),g=w(p=>ue(p,r)),L=et(I?.companyId,{clearParams:g.fetchState==="Completed"}),P=pe(I?.userRole??[]);f.useEffect(()=>{(A&&!F||j&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(B(!0),t(Fe(!1,b,y,r)))});const M=w(p=>dt(p.accountState,p.accountListState,"reimbursementAccountList"));if(v==null)throw Error("Can't access address page without signing in...");const R={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||P&&g.billStatus==="rejected"||P===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(_,{to:R}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(We,{isNewReimbursement:r==null}):s.jsxs(Qn,{windowSize:c,children:[s.jsx(te,{analytics:k,onLoad:p=>(V=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&V.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(zn,{}):null,m&&c!=="small"?s.jsx(Gn,{children:s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${J.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:v?.userId??"",sessionId:v?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,v?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:D.sp3,paddingBottom:"15px",paddingLeft:D.sp5},dropFilePlaceholder:{upload:U.dropReceipt.upload,single:U.dropReceipt.single,or:U.dropReceipt.or,multiple:U.dropReceipt.multiple,receipts:U.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Zn,{children:[s.jsx(Hn,{onClick:()=>o(!1),children:s.jsx(Nn,{})}),s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${J.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:v?.userId??"",sessionId:v?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,v?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:D.sp5,paddingRight:D.sp3,paddingBottom:D.sp5,paddingLeft:D.sp3},dropFilePlaceholder:{upload:U.dropReceipt.upload,single:U.dropReceipt.single,or:U.dropReceipt.or,multiple:U.dropReceipt.multiple,receipts:U.dropReceipt.receipts}})]}):null,s.jsx(Vn,{windowSize:c,children:s.jsx(On,{initialOpenThreadRequest:L??void 0,isReimbursementCommentingEnabled:h,location:n,navigate:e,currentTenant:I,reimbursementId:r,themeState:d,uncategorizedAccounts:M,disableInternalOverlay:!0,showSkipAutoFill:m,setShowSkipAutoFill:o,onCurrentLineIdForUploadChange:i,isAiCfoAccessEnabled:T,onAskAiCfoClick:u})})]})}const Qn=N.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
position: relative;
|
|
4
4
|
height: 100vh;
|
|
@@ -33,7 +33,7 @@ import{j as s}from"./liveblocks-B2nLBm11.js";import{h as W,u as de,g as Z,i as Y
|
|
|
33
33
|
flex-direction: column;
|
|
34
34
|
overflow-y: auto;
|
|
35
35
|
background-color: ${e=>e.theme.colors.grey4};
|
|
36
|
-
`,
|
|
36
|
+
`,Hn=N.button`
|
|
37
37
|
align-self: flex-end;
|
|
38
38
|
background: none;
|
|
39
39
|
border: none;
|
|
@@ -48,12 +48,12 @@ import{j as s}from"./liveblocks-B2nLBm11.js";import{h as W,u as de,g as Z,i as Y
|
|
|
48
48
|
width: ${D.sp4};
|
|
49
49
|
height: ${D.sp4};
|
|
50
50
|
}
|
|
51
|
-
`,
|
|
51
|
+
`,Vn=N.div`
|
|
52
52
|
display: flex;
|
|
53
53
|
flex-direction: column;
|
|
54
54
|
width: 100%;
|
|
55
55
|
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
56
|
-
`,Wn=K(function(e,t){const n=Me(e,t.reimbursementId),r=$.getSignedInUser(),d=be(r),c=e.tenantState.currentTenantId,m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:c??""},o=`${n.createdBy?.firstName??"Zeni"} ${n.createdBy?.lastName??""}`;let a=!1;n?.remiActivities.length>0&&(a=Ot(n.remiActivities,Qt(t.currentTenant),r));const i=pe(t.currentTenant?.userRole??[]),l=r?.userId===n.createdBy?.userId;return{remiDetails:n,uploadInvoiceEndPoint:`${J.communicationAgentMicroServiceBaseUrl}`,authParams:m,signedInUser:r,createdBy:o,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,isAdmin:i,showApproveRejectBtns:a,isZeniUser:d,isSignedInUserReimbursementCreator:l,isAccountingClassesEnabled:Le(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r;return{onDuplicateLineClick:(a,i)=>window.open(`/${o}/reimbursement/${a}#L${i}`),redirectToReimbursementListScreen:()=>{e($e());const a=nt(o),i=G(d.state?.pathnameStackToGoBack,d.pathname);c(a,{state:{pathnameStackToGoBack:i}})},onSaveRealTimeApprovals:a=>{e(Zt(n,"reimbursement",a))},updateEditRealTimeApproverClicked:a=>{e(Gt({isEdit:a,entityId:n,entityType:"reimbursement"}))},approveOrRejectRemi:a=>{a.type==="approved"?e(Ce(n,a.type,"")):e(Ce(n,a.type,a.description??""))},redirectToEditableReimbursementScreen:()=>{const a=G(d.state?.pathnameStackToGoBack,d.pathname);c("./edit",{state:{pathnameStackToGoBack:a}})},deleteReimbursement:()=>{
|
|
56
|
+
`,Wn=K(function(e,t){const n=Me(e,t.reimbursementId),r=$.getSignedInUser(),d=be(r),c=e.tenantState.currentTenantId,m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:c??""},o=`${n.createdBy?.firstName??"Zeni"} ${n.createdBy?.lastName??""}`;let a=!1;n?.remiActivities.length>0&&(a=Ot(n.remiActivities,Qt(t.currentTenant),r));const i=pe(t.currentTenant?.userRole??[]),l=r?.userId===n.createdBy?.userId;return{remiDetails:n,uploadInvoiceEndPoint:`${J.communicationAgentMicroServiceBaseUrl}`,authParams:m,signedInUser:r,createdBy:o,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,isAdmin:i,showApproveRejectBtns:a,isZeniUser:d,isSignedInUserReimbursementCreator:l,isAccountingClassesEnabled:Le(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r;return{onDuplicateLineClick:(a,i)=>window.open(`/${o}/reimbursement/${a}#L${i}`),redirectToReimbursementListScreen:()=>{e($e());const a=nt(o),i=G(d.state?.pathnameStackToGoBack,d.pathname);c(a,{state:{pathnameStackToGoBack:i}})},onSaveRealTimeApprovals:a=>{e(Zt(n,"reimbursement",a))},updateEditRealTimeApproverClicked:a=>{e(Gt({isEdit:a,entityId:n,entityType:"reimbursement"}))},approveOrRejectRemi:a=>{a.type==="approved"?e(Ce(n,a.type,"")):e(Ce(n,a.type,a.description??""))},redirectToEditableReimbursementScreen:()=>{const a=G(d.state?.pathnameStackToGoBack,d.pathname);c("./edit",{state:{pathnameStackToGoBack:a}})},deleteReimbursement:()=>{k.trackReimbursementDeleteReimbursement(n),e(Pe(n))},cancelAndDeleteReport:a=>{a===!0?k.trackReimbursementCancelAndDeleteReimbursement(n):k.trackReimbursementCancelReimbursement(n),e(zt(n,a))},handleZeniLogoClick:()=>{m.toggle()}}})(wn);function Kn(){const e=W(),t=de(),n=Z(),r=n.hash.substring(1),d=He(),{reimbursementId:c}=Y(),m=$.getSignedInUser(),o=w(R=>H(R)),a=w(R=>Me(R,c??"")),i=a.remiDetails?.reimbursementInfo.stage.code==="draft",l=et(o?.companyId,{clearParams:a.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:b,onAskAiCfoClick:y}=Se({mobileExploreReferrer:"Reimbursement Details"});qe({isDataReady:a.fetchState==="Completed"});const{useFeatureGate:h}=ee(),{isFeatureEnabled:T}=h(E.isLimitedCategoryForReimbursement),[u,x]=f.useState(!1),[j,A]=f.useState(!1),[F,B]=f.useState(!1),{isFeatureEnabled:v}=h(E.isReimbursementCommentingEnabled),{isFeatureEnabled:I}=h(E.isShowDeletedReimbursementsFeatureEnabled),g=w(R=>ue(R,c??"")),L=$t(o),P=Mt(o.userRole),M=a.fetchState;if(f.useEffect(()=>{u||c==null?u==1&&M==="Error"&&e("page-not-found",{replace:!0}):(x(!0),t(_t(c,!1,I)))},[u,c,t,M]),f.useEffect(()=>{I&&a.remiDetails?.isDeleted===!0||o.isZeni===!0&&m?.userEmailDomain==="zeni.ai"&&L===!1?B(!1):B(a.remiActivities[0]?.isRealTimeApprovalEnabled&&(P||a.allApprovers.find(R=>R.user.userId===m?.userId)!=null||a.remiDetails?.lastUpdatedBy===m?.userId))},[a.remiActivities[0]?.isRealTimeApprovalEnabled,a.allApprovers,a.remiDetails?.lastUpdatedBy,P,o.isZeni,L,m]),f.useEffect(()=>{j||a.fetchState!="Completed"||a.remiDetails?.reimbursementInfo.stage.code=="paid"||a.remiDetails?.reimbursementInfo.stage.code=="scheduled"||g.fetchState=="Completed"||g.fetchState=="In-Progress"||(A(!0),t(Fe(!1,T,I,c)),a.remiActivities[0]?.isRealTimeApprovalEnabled===!0&&t(Nt(!1,!0,!0,a.lastUpdatedByUserId)))},[j,a,c,t]),m==null)throw Error("Can't access address page without signing in...");return a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState=="Completed"&&a.remiDetails.isDeleted===!1?s.jsx(_,{to:`./edit${n.search}`}):a.deleteStatus.fetchState==="In-Progress"||a.cancelAndDeleteStatus.fetchState==="In-Progress"||a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState!="Completed"||a.fetchState!="Completed"?s.jsx(We,{}):s.jsxs(s.Fragment,{children:[s.jsx(te,{analytics:k,onLoad:R=>(p=>{c!=null&&p.trackReimbursementReimbursementDetails(c)})(R)}),s.jsx(Wn,{initialOpenThreadRequest:l??void 0,scrollId:r,isReimbursementCommentingEnabled:v,isShowDeletedReimbursementEnabled:I,location:n,navigate:e,isRealTimeApprovalEnabled:F,currentTenant:o,reimbursementId:c??"",themeState:d,isAiCfoAccessEnabled:b,onAskAiCfoClick:y})]})}const qn=K(function(e,t){return{remisReviewView:_e(e),analytics:t.analytics}},function(e,t){return{onCloseOverlay:()=>{t.navigate("./"),e(z())},onCloseReviewItem:n=>{e(Vt(n))},onProceedForBulkActionClick:(n,r)=>{switch(n){case"send_for_approval":e(Ht());break;case"approve":e(Ee("approved",r??""));break;case"reject":e(Ee("rejected",r??""))}}}})(xn);function Xn(){const e=W(),t=w(c=>c.remisBulkActionViewState.bulkSubmissionFetchState.fetchState),{remisForReview:n}=w(c=>_e(c)),r=ne(),d=r?.loggedInUserRole?.includes("admin")===!0;return f.useEffect(()=>{t!=="Completed"&&n.length!==0||e("./")},[t,n.length]),s.jsx(qn,{navigate:e,analytics:k,isAdmin:d})}const Q=tn(),at="bulk-operation-update",ce="reimbursement-approval-rule-update",{spendManagement:Jn,common:je}=Ke.getLocalizedStrings(),De=Jn.reimbursement.bulkActions,Yn=N.div`
|
|
57
57
|
display: flex;
|
|
58
58
|
min-height: 100%;
|
|
59
59
|
width: 100%;
|
|
@@ -61,8 +61,8 @@ import{j as s}from"./liveblocks-B2nLBm11.js";import{h as W,u as de,g as Z,i as Y
|
|
|
61
61
|
flex-direction: column;
|
|
62
62
|
align-items: center;
|
|
63
63
|
background-color: ${e=>e.theme.colors.grey4};
|
|
64
|
-
`,ea=K(function(e,t){const n=Qe(e,Q,t.isBulkActionEnabled);let r=n.allSubTabs;const d=$.getSignedInUser(),c=be(d),m=e.tenantState.currentTenantId,o=
|
|
64
|
+
`,ea=K(function(e,t){const n=Qe(e,Q,t.isBulkActionEnabled);let r=n.allSubTabs;const d=$.getSignedInUser(),c=be(d),m=e.tenantState.currentTenantId,o=H(e),a=o?.companyName??"",i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:m??""},l=e.remiListState.downloadUIState.downloadState;t.isShowDeletedReimbursementEnabled===!1&&(r=r.filter(h=>h!=="deleted"));const b=n.fetchState,y=nn(e);return{transactionList:t.isShowDeletedReimbursementEnabled?n.reimbursements:n.reimbursements.filter(h=>h.isDeleted===!1),isAdmin:t.isAdmin,isZeniUser:c,isBillPayCommentingEnabled:t.isBillPayCommentingEnabled,isReimbursementCommentingEnabled:t.isReimbursementCommentingEnabled,allSubTabs:r,isEmployee:t.isEmployee,currentTab:n.currentTab,currentSubTab:n.currentSubTab,approvalCount:n.approvalCount,fetchState:b,botEmail:n.reimbursementBotEmail,analytics:k,uiState:n.uiState,searchText:n.searchText,filters:n.filters,downloadParams:{authParams:i,companyName:a,timePeriod:Q,spendManagementEndPoint:`${Fn}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:l,isBulkActionAllowed:n.remiListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:n.remiListBulkActionInfo?.remisSelectedForBulkAction,allowedBulkActions:n.remiListBulkActionInfo?.allowedBulkActions,remiApprovalRulesAffectedEntityIds:y.affectedEntityIds}},function(e,t){const{navigate:n,currentTenant:r,location:d,period:c}=t,{tenantEmailDomain:m}=r;return{updateTabToState:o=>{e(z()),e(Ne(o))},onSubtabChange:o=>{e(z()),e(Oe(o))},onTransactionClick:(o,a)=>{const i=aa(m,o,a),l=G(d.state?.pathnameStackToGoBack,d.pathname);n(i,{state:{pathnameStackToGoBack:l}})},onClickSetupIcon:()=>{const o=na(m),a=G(d.state?.pathnameStackToGoBack,d.pathname);n(o,{state:{pathnameStackToGoBack:a}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;k?.trackReimbursementNewReimbursement();const a=`/${o}/reimbursement/new`,i=G(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(a,{state:{pathnameStackToGoBack:i}})},onColumnSortConfigChanged:(o,a)=>{e(dn({uiState:{sortKey:o,sortOrder:a},period:t.period}))},onSearchTextChanged:o=>{e(cn(o))},onFiltersChange:o=>{e(mn({filters:o})),o.categories.every(a=>a.field!=null&&a.values?.length!==0)&&k.trackSpendManagmentFilterChange("reimbursement",o.categories.map(a=>`${a.field}-${JSON.stringify(a.values)}`))},updateDownloadStateHandler:o=>{o==="In-Progress"&&k.trackSpendManagementDownloadClick("reimbursement"),e(ln({uiState:{downloadState:o}}))},onReloadTransactions:()=>{e(le(c,!0,t.isShowDeletedReimbursementEnabled,!1,!0))},onBackClick:()=>{n("../",{relative:"path"})},onNavigateToSettings:()=>{n("../reimbursements/setup")},updateBulkActionList:o=>{e(rn(o))},removeAllTransactionsFromBulkActionList:()=>{e(z())},onProceedForBulkActionClick:(o,a)=>{switch(o){case"delete":case"cancel":e(on(o,a??""));break;case"send_for_approval":e(we("send_for_approval")),t.navigate("./bulk-review");break;case"review":e(we("approve")),t.navigate("./bulk-review")}},onReimbursementApprovalRulesEventReceived:o=>{o.endsWith(ce)&&e(sn(!1))},onEventReceived:o=>{o===at&&e(an())}}})(jn(Dn));function ta(){const e=W(),t=de(),n=Z(),r=n.state,d=Ve(),[c,m]=f.useState(null),o=mt("/:tenantEmailDomain/reimbursements/bulk-review")!=null;f.useEffect(()=>{if(r?.tab!=null&&r?.subTab!=null){const S=Wt(r.tab.toString());S!=null?t(Ne(S)):console.log("Warning:Not a valid remiListTab");const O=Kt(r.subTab.toString());O!=null?t(Oe(O)):console.log("Warning:Not a valid remiListSubTab")}return()=>{t(z())}},[]);const{useFeatureGate:a}=ee(),{isFeatureEnabled:i}=a(E.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:l}=a(E.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:b}=a(E.isBillPayCommentingEnabled),{isFeatureEnabled:y}=a(E.isReimbursementCommentingEnabled),{isFeatureEnabled:h}=a(E.isReimbursementBulkActionEnabled),T=$.getSignedInUser(),u=w(S=>H(S)),[x,j]=f.useState(!1),[A,F]=f.useState(!1),B=ne(),v=B?.loggedInUserRole?.includes("admin")===!0,I=w(S=>Qe(S,Q,h)),{areTenantIdsInSync:g}=Bn(),L=I.fetchState,{isAiCfoAccessEnabled:P,onAskAiCfoClick:M}=Se({mobileExploreReferrer:"Reimbursement List"});if(qe({isDataReady:L==="Completed"}),f.useEffect(()=>{!A&&g&&(F(!0),t(le(Q,!0,l,!1,!0)))},[A,Q,t,g]),T==null)throw Error("Can't access address page without signing in...");const R=!!u?.userRole&&qt(u),p=ge(B?.loggedInUserRoleMap),V=he(B?.loggedInUserRoleMap),ae=!!u.userReimbursementInfo?.isReimbursementTOSAccepted,q=!!u.companyReimbursementInfo?.info?.isReimbursementEnabled,se=!!u.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,ie=w(S=>Ue(S.companyState,u.companyId)),st=ie?.company.featuresActivationInfo.connectedAccountProvider,Ie=S=>{j(S)},{isFeatureEnabled:it}=a(E.isDebitCardFeatureEnabled),ot=ze(it,u),rt=Ge(u),{remisProcessed:X,remisProcessing:Re}=w(S=>Xt(S));f.useEffect(()=>{X===Re&&c!=null&&(t(Jt({messageSection:"reimbursement_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_report_",variableValue:X>1?De.reports:De.report},{variableName:"_has_",variableValue:X>1?je.texts.have:je.texts.has},{variableName:"_action_",variableValue:Yt(c)}]})),t(en()),setTimeout(()=>{t(le(Q,!0,l,!1,!0,!0))},3e3),m(null))},[X,Re]);const lt={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${at}`,`private-encrypted-${u.companyId}.${ce}`]:[],eventCallback:(S,O,ye)=>{S.endsWith(ce)?ye.onReimbursementApprovalRulesEventReceived?.(S):O.entity_type==="reimbursement"&&(m(O.operation_type),ye.onEventReceived(S))}};return n.pathname.endsWith("/reimbursements/")||n.pathname.endsWith("/reimbursements")||n.pathname.endsWith("/reimbursements/bulk-review")?ot===!0||rt===!0?s.jsx(Ye,{}):q&&(!R||p)||V&&ae?s.jsxs(s.Fragment,{children:[L==="Completed"?s.jsx(te,{analytics:k,onLoad:S=>(O=>O.trackPageLoaded(Xe.Event.reimbursementHome))(S)}):null,s.jsx(tt,{isAppContentDrawerOpen:x,handleDrawerToggle:Ie}),s.jsxs(Yn,{windowSize:d,children:[s.jsx($n,{isOpen:o,drawerLeftMargin:new Tn(0,0,300,600),onClose:()=>{e("./"),t(z())},children:s.jsx(sa,{onClick:S=>S.stopPropagation(),children:s.jsx(Xn,{})})}),s.jsx(ea,{isShowDeletedBillsEnabled:i,isShowDeletedReimbursementEnabled:l,isBillPayCommentingEnabled:b,isReimbursementCommentingEnabled:y,location:n,navigate:e,currentTenant:u,period:Q,isAdmin:v,isEmployee:R,entity:"reimbursement",onClickMenuIcon:()=>{Ie(!0)},createdByUserList:I.createdByUserList,createdByUserListFetchState:I.createdByUserListFetchState,isDownloadEnabled:I.isDownloadEnabled,connectedAccountProvider:st,isBulkActionEnabled:h,bulkSubmissionLimit:I.remiBulkSubmissionLimit,bulkSubmissionFetchState:I.remiListBulkActionInfo.bulkSubmissionFetchState,isAiCfoAccessEnabled:P,onAskAiCfoClick:M,...lt})]})]}):se&&p?s.jsx(_,{to:"../setup"}):B!=null&&Ze(u,B.loggedInUserRoleMap)?s.jsx(_,{to:"../promo"}):s.jsx(fe,{fetchState:"In-Progress"}):s.jsx(me,{})}const na=e=>`/${e}/reimbursements/setup`,aa=(e,t,n)=>{let r=`/${e}/reimbursement/${encodeURIComponent(t)}`;return n=="draft"&&(r+="/edit"),r},sa=N(Pn)`
|
|
65
65
|
display: flex;
|
|
66
66
|
min-height: 100%;
|
|
67
67
|
flex-direction: column;
|
|
68
|
-
`,ia=K(function(e,t){const{companyId:n}=t;return{reimbursementSetupView:un(e,n),analytics:
|
|
68
|
+
`,ia=K(function(e,t){const{companyId:n}=t;return{reimbursementSetupView:un(e,n),analytics:k,meetingUrl:"https://meetings.hubspot.com/niharn/demo-reimbursements?embed=true",videoUrl:"https://player.vimeo.com/video/814821498?h=e7fd11e13e&badge=0&autopause=0&player_id=0&app_id=122963"}},function(e,t){const{companyId:n,navigate:r}=t;return{onSetupButtonClick:()=>{e(bn(n))},onCreateNewRemiButtonClick:()=>{e(pn(t.userRoleId))},onBackClick:()=>{r("../..",{relative:"path"})},onSetupReimbursementSuccess:()=>{t.isEmployee?r("../../reimbursement/new",{relative:"path"}):r("../reimbursements/setup",{relative:"path"})}}})(Un),oa=()=>{const e=W(),t=Z(),{tenantEmailDomain:n}=Y(),r=Je(),[d,c]=f.useState(!1),m=w(A=>H(A)),o=$.getSignedInUserTenant(n)?.companyId??m.companyId,a=$.getSignedInUser(),i=m.userRoleId,l=!!m.userRole?.includes("reimbursements_user"),b=ne(),y=ge(b?.loggedInUserRoleMap),h=he(b?.loggedInUserRoleMap),T=!!m.userReimbursementInfo?.isReimbursementTOSAccepted,u=!!m.companyReimbursementInfo?.info?.isReimbursementEnabled,x=!!m.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,j=A=>{c(A)};if(a==null)throw Error("Can't access reimbursement promo page without signing in...");return u&&h&&T?s.jsx(_,{to:"../../../reimbursements"}):x&&y?s.jsx(_,{to:"../../reimbursements/setup"}):m.companyReimbursementInfo&&!x||m.userReimbursementInfo&&h&&T===!1?s.jsxs(s.Fragment,{children:[s.jsx(te,{analytics:k,onLoad:A=>(F=>F.trackPageLoaded(Xe.Event.reimbursementPromoPage))(A)}),s.jsx(tt,{isAppContentDrawerOpen:d,handleDrawerToggle:j}),s.jsx(ia,{companyId:o,navigate:e,location:t,userReimbursementInfo:m.userReimbursementInfo,userRoleId:i,isEmployee:l,onClickMenuIcon:()=>{j(!0)}})]}):s.jsx(fe,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})};function Pa(){const e=w(ie=>H(ie)),t=ne(),n=!!e.company?.companyReimbursementInfo.isReimbursementEnabled,r=Je(),d=!!e.company?.companyReimbursementInfo.isReimbursementTOSAccepted,c=!!e.userReimbursementInfo?.isReimbursementTOSAccepted,{useFeatureGate:m}=ee(),{isFeatureEnabled:o}=m(E.isChargeCardFeatureEnabled),{isFeatureEnabled:a}=m(E.isDebitCardFeatureEnabled),i=ze(a,e),l=Ge(e),b=e?.userRole!=null&&gn(e?.userRole),y=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!b)&&hn(t?.loggedInUserRoleMap),h=fn(t?.loggedInUserRoleMap),T=e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!b,u=ge(t?.loggedInUserRoleMap),x=T&&u,j=!!e.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!b,A=j&&Sn(t?.loggedInUserRoleMap),F=Ln(e,o,a)&&!b,B=F&&In(t?.loggedInUserRoleMap),v=Rn(t?.loggedInUserRoleMap),I=yn(t?.loggedInUserRoleMap),g=An(t?.loggedInUserRoleMap),L=j&&I,P=e.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!b&&g,M=kn(t?.loggedInUserRoleMap),R=vn(t?.loggedInUserRoleMap),p=he(t?.loggedInUserRoleMap),V=F&&M,{tenantEmailDomain:ae}=Y(),q=Z(),se=n===!0&&(u||p&&c);return s.jsxs(ct,{children:[q.pathname.includes("/reimbursements")?s.jsxs(s.Fragment,{children:[s.jsx(C,{path:"verification",element:s.jsx(Be,{isBillPayAdminLevelAccess:y,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:x,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:B,isUserHasOnlyCardAccess:v,productType:"reimbursement",type:"verification"})}),s.jsx(C,{path:"setup",element:s.jsx(Be,{isBillPayAdminLevelAccess:y,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:x,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:B,isUserHasOnlyCardAccess:v,productType:"reimbursement",type:"setup"})}),s.jsx(C,{path:"promo",element:s.jsx(oa,{})}),s.jsx(C,{path:"approval-rules/*",element:x?s.jsx(Mn,{}):s.jsx(_n,{showZeniAccountRoute:L,isUserHasBillPayAccess:R,isUserHasReimbursementAccess:p,showTreasuryRoute:P,isTenantBankingOnly:i,showChargeCardRoute:V,tenantEmailDomain:ae??""})}),se&&s.jsx(C,{path:"*",element:s.jsx(ta,{})}),(i===!0||l===!0)&&s.jsx(C,{path:"/*",element:s.jsx(Ye,{})}),t!=null&&Ze(e,t?.loggedInUserRoleMap)&&s.jsx(C,{path:"*",element:s.jsx(_,{to:"../promo"})}),d&&u&&s.jsx(C,{path:"*",element:s.jsx(_,{to:"../setup"})})]}):q.pathname.includes("/reimbursement")?s.jsxs(s.Fragment,{children:[s.jsx(C,{path:"new",element:s.jsx(Te,{})}),s.jsx(C,{path:":reimbursementId",element:s.jsx(Kn,{})}),s.jsx(C,{path:":reimbursementId/edit",element:s.jsx(Te,{})}),s.jsx(C,{path:"*",element:s.jsx(me,{})})]}):s.jsx(C,{path:"*",element:s.jsx(fe,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5,boxShadow:`0px 2px ${D.sp1} ${r.colors.dropShadowNormal}`}})}),s.jsx(C,{path:"*",element:s.jsx(me,{})})]})}export{Pa as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as p}from"./liveblocks-4PIBJMyE.js";import{g as G,h as Ce,u as ge,i as we,j as d,n as Ie,o as Se,p as H}from"./core-Ca6G0voE.js";import{eX as L,fT as w,Mo as Te,kx as K,qR as J,rG as A,kl as Re,jp as Me,vb as W,rL as Oe,bs as Ae,Mp as ke,bn as Fe,wk as De,Mq as je,Mr as Ee,v3 as Pe,Ms as Y,Mt as Le,Mu as ve,Mv as Be,Mw as Ve,Mx as I,My as k,Mz as F,MA as N,MB as D,MC as j,dK as xe,w0 as Ue,vQ as q,vR as $,w6 as ze,vV as Z,wc as Ge,MD as He,ME as Ye,MF as Ne,MG as qe,MH as $e,fE as Ze,fC as Qe}from"./zeni-epic-state-BIxjj87B.js";import{T as Xe,X as Ke,Y as Je,Z as We,K as ea,C as ee,U as E,z as ae,_ as aa,j as sa,c as ta,$ as oa,a0 as na,x as ra,e as P,g as ia,a1 as la,s as se,a2 as ca,a3 as da,a4 as pa}from"./index-DD9OmSLj.js";import"./mui-BI3ZId9r.js";import fa from"./NotFoundScreen-C4hj38o6.js";import{F as ma}from"./FeaturePreviewScreen-CPre8DhJ.js";import{a as _}from"./sentry-CXcgkCeA.js";import{u as ua}from"./useInitialThreadRequest-B6-oXb8Z.js";import{t as Q,a as X,b as _a}from"./routePaths-BumbtdKN.js";import{M as ha}from"./MobileAppDrawer-CNkPd-0r.js";import"./recharts-D6NnjcYi.js";import"./analytics-dJ9Vu0DH.js";import"./plaid-BFzM5Kog.js";import"./dnd-Be5WoH8E.js";import"./stripe-DMRn4zHo.js";import"./lottie-B7am_Gp2.js";import"./lexical-DTpvAJin.js";import"./pdf-DUHWpwzW.js";import"./utils-DFP_hVXq.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]="9b6c44ee-1bcb-4df2-8f35-849406a01b11",e._sentryDebugIdIdentifier="sentry-dbid-9b6c44ee-1bcb-4df2-8f35-849406a01b11")}catch{}})();const ba=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(j({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(F({resetLeftScroll:!0})),e(k({resetLeftScroll:!0}))},ya=e=>{e(Ye()),e(Ne()),e(qe()),e($e())},Ca=Ie(function(e){const o=ae.getSignedInUser(),f=e.tenantState.currentTenantId,u=L(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:f??""},t=w(e),r=ke(u);return{fetchState:t.fetchState,selectedTimeframe:t.filter.timeframe,selectedReport:t.selectedReportId,displayOrder:t.displayOrder,reportFormat:t.reportFormat,dataAvailable:t.dataAvailable,balancesInTimeframe:t.balancesInTimeframe,allTimeframeTicks:t.allTimeframeTicks,selectedCOABalancesRange:t.filter.balancesRange,isCompareMode:t.isCompareModeOn,profitAndLossReport:t.profitAndLossReport,profitAndLossClassesViewReport:t.profitAndLossByClassReport,profitAndLossProjectViewReport:t.profitAndLossByProjectReport,profitAndLossByClassHorizontalReport:t.profitAndLossByClassHorizontalReport,balanceSheetReport:t.balanceSheetReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:P,isZeniUser:Fe(o),showAccountGroups:r===!0,isAccountingClassesEnabled:K(e),isAccountingProjectsEnabled:J(e),currentTenantCompanyName:a,statementEndPoint:`${pa}/statement`,authParams:s,isZeniCOAUsed:r}},function(e,o){const{navigate:f,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(A(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(He(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(Ge(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:m,balancesRange:c}=l;let i=[...m];a==="year"&&(i=i.filter(C=>C!=="this_period_vs_same_period_last_year"&&C!=="this_period_vs_same_period_last_year_percent"&&C!=="same_period_last_year")),e(q(o.firstMonthOfFY,r,c.numberOfPeriods<1?1:c.numberOfPeriods,i)),m.length>0&&e($(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",c.numberOfPeriods<1?1:c.numberOfPeriods,i))}t!==!0&&setTimeout(()=>y(e),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(I(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(Z({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(Y({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(Z(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(ze(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(q(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e($(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout(()=>y(e),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(Ue({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=xe(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const m=a.accountName===""?a.accountDescription:a.accountName,c=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return Q(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return X(o.tenantEmailDomain,a.accountId,a.accountType,s.id,m,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?_a(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,m,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?X(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,l):a.accountType!=null?Q(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l):void 0})();if(c!=null){const i=se(o.location.state?.pathnameStackToGoBack,o.location.pathname);f(c,{state:{pathnameStackToGoBack:i,referrer:S(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(j({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(D({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(N({scrollPosition:s}));break;case"balance_sheet":e(F({scrollPosition:s}));break;case"cash_flow":e(k({scrollPosition:s}));break;default:console.log(`Table Scroll state for ${a} is not handled`)}},onElementCollapseStateChanged:(a,s,t)=>{switch(a){case"profit_and_loss":e(j({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(N({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(F({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(k({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{f("../../")},onUpdateAccountViewMode:a=>{e(Be({viewMode:a})),e(Ve({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",S(o.selectedReportID)),e(I("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",S(o.selectedReportID)),e(I("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",S(o.selectedReportID)),e(I("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(ve({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(Le({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(Y({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Pe()),o.isAccountingProjectsEnabled&&e(W())},onUpdateDisplayOrder:a=>{e(Ee(a))},onUpdateReportFormat:a=>{ya(e),e(je(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(De("profit_and_loss_by_classes"))}}})(ca);function ga(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=We(),f=ea(),u=da(f),a=Ce(),s=ge(),t=G(),{tenantEmailDomain:r}=we(),{useFeatureGate:l}=ee(),{isFeatureEnabled:m}=l(E.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,C]=_.useState(!1),[v,te]=_.useState(!1),{isFeatureEnabled:B}=l(E.isReportsCommentingEnabled);if(c==null)throw Error("Can't access reports page without signing in...");const T=d(n=>L(n)),oe=T.masterTOSInfo?.isMasterTOSAccepted??!1,ne=T.company?.companyInfo.firstMonthOfFY??1,re=ua(B?T?.companyId:void 0),g=d(n=>w(n).fetchState),ie=d(n=>Te(n)),{areTenantIdsInSync:h}=aa(),R=d(n=>n.financeStatementState.selectedReportId),V=d(n=>K(n)),M=d(n=>J(n)),le=d(n=>w(n).isCompareModeOn),b=d(n=>w(n).filter),O=d(n=>w(n).selectedReportAndTimeframeFetchState),ce=d(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);_.useEffect(()=>{!i&&h&&(C(!0),s(A(c.userId,!0,!0,!1)))},[i,c,s,h]),_.useEffect(()=>{i&&!v&&g==="Completed"&&h&&(s(A(c.userId,!1,!0,!1)),te(!0))},[i,v,g,h]),_.useEffect(()=>{if(i&&O.fetchState==="Not-Started"&&b.timeframe!=="free_range"&&b.timeframe!=="week"&&h)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Oe(b.timeframe));break;case"profit_and_loss_by_projects":M&&s(W());break;case"balance_sheet":s(Me(b.timeframe));break;case"cash_flow":s(Re(b.timeframe))}},[i,R,O,h,V,M]);const x=sa(),de=x?.loggedInUserRole!=null&&Ae(x?.loggedInUserRole)!==!0,[pe,fe]=_.useState(!1),U=n=>{fe(n)},me=ta(),ue=oa();return function(n){const{isDataReady:_e}=n,{pathname:he}=G(),z=Xe(he??"")==="reports",be=Ke(_e),ye=_.useMemo(()=>z?ba:void 0,[z]);Je({canFetchSuggestedQuestions:be,pageContexts:ye})}({isDataReady:g==="Completed"}),na({isDataReady:g==="Completed"}),p.jsxs(p.Fragment,{children:[g==="Completed"?p.jsx(ra,{analytics:P,onLoad:n=>n.trackPageLoaded(ia.Event.reports)}):null,p.jsx(ha,{isAppContentDrawerOpen:pe,handleDrawerToggle:U}),p.jsx(Ca,{firstMonthOfFY:ne,tenantEmailDomain:r,location:t,navigate:a,windowSize:f,classViewLayout:ce,selectedReportID:R,analytics:P,filter:b,isAccountingClassesEnabled:V,isAccountingProjectsEnabled:M,isCompareModeOn:le,hasTransactionAccess:de,signedInUser:c,selectedReportAndTimeframeFetchState:O,handleDrawerToggle:U,reportsResyncFetchState:ie.reportsResyncFetchState,isAiCfoAccessEnabled:ue&&me&&!e,onAskAiCfoClick:()=>{if(oe)if(u){const n=se(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else la({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:m,isReportsCommentingEnabled:B,initialOpenThreadRequest:re})]})}const S=e=>{switch(e){case"profit_and_loss":return"Profit & Loss";case"balance_sheet":return"Balance Sheet";case"cash_flow":return"Cash Flow";default:return"Reports"}};function za(){const e=d(s=>L(s)),{useFeatureGate:o}=ee(),{isFeatureEnabled:f}=o(E.isDebitCardFeatureEnabled),u=Ze(f,e),a=Qe(e);return u===!0||a===!0?p.jsx(ma,{}):p.jsxs(Se,{children:[p.jsx(H,{path:"/",element:p.jsx(ga,{})}),p.jsx(H,{path:"*",element:p.jsx(fa,{})})]})}export{za as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as a}from"./liveblocks-4PIBJMyE.js";import{C,z as j,aS as y,x as I,e as p,g as F,d9 as P,U as T}from"./index-DD9OmSLj.js";import"./mui-BI3ZId9r.js";import m from"./NotFoundScreen-C4hj38o6.js";import{a as u}from"./sentry-CXcgkCeA.js";import{u as L,j as b,h as U,g as V,n as A,o as R,p as d}from"./core-Ca6G0voE.js";import{eX as z,TC as w,PX as X,TD as v,vH as Y,fK as G,TE as H,vF as K}from"./zeni-epic-state-BIxjj87B.js";import{R as x}from"./ReferralListScreen-Dt6a-ZaL.js";import"./recharts-D6NnjcYi.js";import"./analytics-dJ9Vu0DH.js";import"./plaid-BFzM5Kog.js";import"./dnd-Be5WoH8E.js";import"./stripe-DMRn4zHo.js";import"./lottie-B7am_Gp2.js";import"./lexical-DTpvAJin.js";import"./pdf-DUHWpwzW.js";import"./utils-DFP_hVXq.js";import"./useAskAiCfoHostNavButtonProps-CSLK93Wz.js";import"./MobileAppDrawer-CNkPd-0r.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]="49231224-064f-4d29-82ca-91b863e0a027",e._sentryDebugIdIdentifier="sentry-dbid-49231224-064f-4d29-82ca-91b863e0a027")}catch{}})();const O=A(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=j.getSignedInUser();return{onDismissClick:()=>{e(v()),n("..")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach(c=>{s.push(c.companyName),r.push(c.emailIds[0])}),p.trackInviteEmailClicked("send",s,r,s.length)}e(K())},onUpdateInviteFormLocalData:s=>{e(H({localData:s}))},onSubmitSuccess:()=>{n("../../")},onCancelClick:()=>{i!=null&&p.trackInviteEmailClicked("cancel")}}})(P),q=()=>{const e=L(),[t,n]=u.useState(!1),[i,s]=u.useState(!1),r=b(o=>z(o)),c=U(),D=V(),{useDynamicConfig:g}=C(),f=j.getSignedInUser();if(f==null)throw Error("Can't access invite referral screen without signing in...");const l=b(o=>w(o)),S=f?.firstName!=null?f.firstName:"User",{configValue:h}=g(y.zeniCardsConfig),{configValue:_}=g(y.zeniAccountsConfig),k=X(_);u.useEffect(()=>{e(v()),r?.rewardsLastViewedTime==null&&i===!1&&(e(Y()),s(!0))},[]),u.useEffect(()=>{t||l.fetchState!=="Not-Started"||(n(!0),e(G(!0)))},[l.fetchState,e]);const N=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[l.fetchState==="Completed"?a.jsx(I,{analytics:p,onLoad:o=>(E=>E.trackPageLoaded(F.Event.inviteEmailViewed))(o)}):null,a.jsx(O,{navigate:c,location:D,currentTenant:r,companyName:N,userName:S,inviteFormCompayData:l.localData,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,maxAnnualPercentageYield:k.maxAnnualPercentageYield})]})};function de(){const{useFeatureGate:e}=C(),{isFeatureEnabled:t}=e(T.isReferralFeatureEnabled);return a.jsxs(R,{children:[a.jsx(d,{path:"/",element:t?a.jsx(x,{}):a.jsx(m,{})}),a.jsx(d,{path:"how-it-works",element:t?a.jsx(x,{isReferralDrawerOpen:!0}):a.jsx(m,{})}),a.jsx(d,{path:"refer/*",element:t?a.jsx(q,{}):a.jsx(m,{})}),a.jsx(d,{path:"*",element:a.jsx(m,{})})]})}export{de as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-CWiRUKmL.js","assets/sentry-CXcgkCeA.js","assets/core-Ca6G0voE.js","assets/zeni-epic-state-BIxjj87B.js","assets/index-DD9OmSLj.js","assets/mui-BI3ZId9r.js","assets/analytics-dJ9Vu0DH.js","assets/utils-DFP_hVXq.js","assets/withTransactionSidePanel-iSi7Lgwj.js","assets/useAskAiCfoHostNavButtonProps-CSLK93Wz.js","assets/TransactionDetailScreen-BdRaLDX3.js","assets/decodeURIComponentSafe-BMcEUj25.js","assets/routePaths-BumbtdKN.js","assets/NotFoundScreen-C4hj38o6.js","assets/useInitialThreadRequest-B6-oXb8Z.js","assets/analyticsHelper-B2nQzr20.js","assets/CompanyPassportScreen-Cr6_STQF.js","assets/MobileAppDrawer-CNkPd-0r.js","assets/useAiCfoDashboardSuggestedQuestionsChips-DQzT3CdB.js","assets/FeaturePreviewScreen-CPre8DhJ.js","assets/ReferralListScreen-Dt6a-ZaL.js","assets/index-BUmr5maU.css","assets/BillPayRoutes-DQrVntHX.js","assets/AddressScreen-Cgf_DSfy.js","assets/DomesticWireDetailScreen-Bg4bD2vf.js","assets/DrawerScreen-ESB0V3An.js","assets/SetupPagesScreen-CnFtaoyZ.js","assets/BusinessVerificationPageScreen-BVO4LcOB.js","assets/BillPayApprovalRoutes-Bufqh5bf.js","assets/ReimbursementApprovalRuleDetailScreen-CGou3dCd.js","assets/getLocaleForTenant-DVEihZ-H.js","assets/ReimbursementRoutes-C1KqmlyM.js","assets/ReimbursementApprovalRoutes-DJ6r8--7.js","assets/TransactionListRoutes-BK2uV7qm.js","assets/ZeniAccountStatementScreen-DxgFXxRD.js","assets/SettingsRoutes-ZI-PRowa.js","assets/accountMappingHelper-COLWfB1U.js","assets/useEmailConnectResultRefresh-CMs316dl.js","assets/QBOConnectionScreen-B3-UhwG_.js","assets/empty-uy3M1msm.js","assets/index-Dcmv7y8l.js","assets/url-DVO5HPAn.js","assets/index-D3FowIif.js","assets/ReportsRoutes-BTVnfyaM.js","assets/ChargeCardRoutes--1Cz6d6F.js","assets/useChargeCardPusherEvents-CtFgCR2P.js","assets/PeopleRoutes-DsSKCjjc.js","assets/ExpenseAutomationRoutes-DRdJk7UH.js","assets/TreasuryRoutes-JT_IY3Gx.js","assets/useCashManagementBanner-BNEI8i2V.js","assets/VendorsRoutes-BS6JrHkM.js","assets/pathToGoBack-CrG50xVP.js","assets/ZeniAccountRoutes-BPiHmqg-.js","assets/AddressRoutes-CYnGGpGr.js","assets/PandLWithForecastRoutes-CgJVRO_P.js","assets/CustomerOnboardingRoutes-DBUibBfl.js","assets/TransactionDetailRoutes-75MHva3P.js","assets/EntityDetailRoutes-BgIcnD30.js","assets/NotificationRoutes-CDTyM5yC.js","assets/PerformanceRoutes-5mjMtnxs.js","assets/RewardsRoutes-DdOKhqcE.js","assets/TaskRoutes-BZfNRRg-.js","assets/TaskListScreen-wwlTbcpO.js","assets/AiCfoScreen-DK7jWO5l.js","assets/CardsAiCfoScreen-BPq182YL.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as t,bn as ls,eX as us,fE as ds,fC as cs,gk as ms,fr as _s,cU as pe,cA as hs,fU as Es,cs as ps,bE as Rs,bo as xs,fY as gs,v as Is,LW as js,bs as Ts,LX as As,bK as fs,bJ as bs,bt as Ds,co as ys,LY as Cs,LZ as vs,cQ as Us,cT as ws,cS as Os,cz as Ps,cG as Fs,o9 as Re,fA as xe,gu as Ls,g0 as ge,gr as Ie,gs as je,g1 as ks}from"./zeni-epic-state-BIxjj87B.js";import{j as e}from"./liveblocks-4PIBJMyE.js";import{a as O}from"./sentry-CXcgkCeA.js";import{u as Hs,h as Bs,i as Vs,g as Ss,j as z,l as Te,N as u,o as Ns,p as a}from"./core-Ca6G0voE.js";import{y as Zs,u as Ms,z as b,C as zs,c as Gs,d as $s,U as G,i as Ys,M as Ws,j as qs,L as F,a as Ae,t as _,P as Xs,e as Q,l}from"./index-DD9OmSLj.js";import"./mui-BI3ZId9r.js";import{f as fe}from"./analyticsHelper-B2nQzr20.js";import{t as Js}from"./getLocaleForTenant-DVEihZ-H.js";import"./recharts-D6NnjcYi.js";import"./analytics-dJ9Vu0DH.js";import"./plaid-BFzM5Kog.js";import"./dnd-Be5WoH8E.js";import"./stripe-DMRn4zHo.js";import"./lottie-B7am_Gp2.js";import"./lexical-DTpvAJin.js";import"./pdf-DUHWpwzW.js";import"./utils-DFP_hVXq.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]="2931b78b-4cd6-4f8b-98c3-a6e43e17646b",o._sentryDebugIdIdentifier="sentry-dbid-2931b78b-4cd6-4f8b-98c3-a6e43e17646b")}catch{}})();const Ks={dashboard:()=>t(()=>import("./DashboardRoutes-CWiRUKmL.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),bills:()=>t(()=>import("./BillPayRoutes-DQrVntHX.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21])),reimbursement:()=>t(()=>import("./ReimbursementRoutes-C1KqmlyM.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21])),transactions:()=>t(()=>import("./TransactionListRoutes-BK2uV7qm.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21])),settings:()=>t(()=>import("./SettingsRoutes-ZI-PRowa.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,42,11,28,29,32,21])),reports:()=>t(()=>import("./ReportsRoutes-BTVnfyaM.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,13,19,14,12,17,21])),chargeCards:()=>t(()=>import("./ChargeCardRoutes--1Cz6d6F.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,45,23,21])),people:()=>t(()=>import("./PeopleRoutes-DsSKCjjc.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,9,17,21])),expenseAutomation:()=>t(()=>import("./ExpenseAutomationRoutes-DRdJk7UH.js"),__vite__mapDeps([47,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21])),treasury:()=>t(()=>import("./TreasuryRoutes-JT_IY3Gx.js"),__vite__mapDeps([48,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,49,19,21])),vendors:()=>t(()=>import("./VendorsRoutes-BS6JrHkM.js"),__vite__mapDeps([50,1,2,3,4,5,6,7,23,13,19,12,51,9,17,25,36,21])),zeniAccounts:()=>t(()=>import("./ZeniAccountRoutes-BPiHmqg-.js"),__vite__mapDeps([52,1,2,3,4,5,6,7,49,13,26,17,15,12,27,19,24,23,9,34,21]))},Qs=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},et=l(()=>t(()=>import("./ReportsRoutes-BTVnfyaM.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,13,19,14,12,17,21]))),st=l(()=>t(()=>import("./AddressRoutes-CYnGGpGr.js"),__vite__mapDeps([53,1,2,3,23,4,5,6,7,13,21]))),tt=l(()=>t(()=>import("./PeopleRoutes-DsSKCjjc.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,13,9,17,21]))),nt=l(()=>t(()=>import("./PandLWithForecastRoutes-CgJVRO_P.js"),__vite__mapDeps([54,1,2,3,4,5,6,7,13,19,9,14,12,17,21]))),at=l(()=>t(()=>import("./CustomerOnboardingRoutes-DBUibBfl.js"),__vite__mapDeps([55,1,2,3,23,4,5,6,7,13,38,39,40,41,42,11,37,45,21]))),ot=l(()=>t(()=>import("./VendorsRoutes-BS6JrHkM.js"),__vite__mapDeps([50,1,2,3,4,5,6,7,23,13,19,12,51,9,17,25,36,21]))),rt=l(()=>t(()=>import("./TransactionDetailRoutes-75MHva3P.js"),__vite__mapDeps([56,1,2,3,13,4,5,6,7,10,9,11,12,21]))),be=l(()=>t(()=>import("./EntityDetailRoutes-BgIcnD30.js"),__vite__mapDeps([57,1,2,3,4,5,6,7,11,8,9,10,12,21]))),it=l(()=>t(()=>import("./DashboardRoutes-CWiRUKmL.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]))),De=l(()=>t(()=>import("./BillPayRoutes-DQrVntHX.js"),__vite__mapDeps([22,1,2,3,4,5,6,7,23,13,24,9,14,25,17,19,26,15,12,27,28,29,30,21]))),lt=l(()=>t(()=>import("./SettingsRoutes-ZI-PRowa.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,23,13,15,27,12,16,37,38,39,40,41,42,11,28,29,32,21]))),ye=l(()=>t(()=>import("./ReimbursementRoutes-C1KqmlyM.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,13,26,17,15,12,27,19,9,14,25,32,29,30,21]))),ut=l(()=>t(()=>import("./ZeniAccountRoutes-BPiHmqg-.js"),__vite__mapDeps([52,1,2,3,4,5,6,7,49,13,26,17,15,12,27,19,24,23,9,34,21]))),dt=l(()=>t(()=>import("./TreasuryRoutes-JT_IY3Gx.js"),__vite__mapDeps([48,1,2,3,4,5,6,7,13,26,17,15,12,27,9,14,49,19,21]))),ct=l(()=>t(()=>import("./TransactionListRoutes-BK2uV7qm.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,34,21]))),mt=l(()=>t(()=>import("./ChargeCardRoutes--1Cz6d6F.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,9,17,26,13,15,12,27,14,45,23,21]))),_t=l(()=>t(()=>import("./NotificationRoutes-CDTyM5yC.js"),__vite__mapDeps([58,1,2,3,13,4,5,6,7,9,21]))),ht=l(()=>t(()=>import("./PerformanceRoutes-5mjMtnxs.js"),__vite__mapDeps([59,1,2,3,13,4,5,6,7,9,17,21]))),Et=l(()=>t(()=>import("./ExpenseAutomationRoutes-DRdJk7UH.js"),__vite__mapDeps([47,1,2,3,13,4,5,6,7,9,10,11,12,8,36,25,21]))),pt=l(()=>t(()=>import("./RewardsRoutes-DdOKhqcE.js"),__vite__mapDeps([60,1,2,3,4,5,6,7,13,20,9,17,21]))),Rt=l(()=>t(()=>import("./TaskRoutes-BZfNRRg-.js"),__vite__mapDeps([61,1,2,3,13,4,5,6,7,14,17,62,9,21]))),xt=l(()=>t(()=>import("./AiCfoScreen-DK7jWO5l.js"),__vite__mapDeps([63,1,2,3,4,5,6,7,18,51,21]))),Ce=l(()=>t(()=>import("./CardsAiCfoScreen-BPq182YL.js"),__vite__mapDeps([64,1,2,3,4,5,6,7,21]))),y=l(()=>t(()=>import("./NotFoundScreen-C4hj38o6.js"),__vite__mapDeps([13,1,2,3,4,5,6,7,21]))),gt=l(()=>t(()=>import("./TaskListScreen-wwlTbcpO.js"),__vite__mapDeps([62,1,2,3,4,5,6,7,9,17,21])));function St({setTenantEmailDomain:o}){const T=Hs(),B=Bs(),{tenantEmailDomain:i}=Vs(),L=Zs().mode,{setLoading:U,clearAllLoading:C,clearLoading:k}=Ms(),v=b.getSignedInUserTenant(i)?.tenantId,I=b.getSignedInUser(),se=ls(I),$=Ss(),[V,Pe]=O.useState(!1),r=z(n=>us(n)),{useFeatureGate:N}=zs(),Z=Gs(),te=$s(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:ke}=N(G.isChargeCardFeatureEnabled),{isFeatureEnabled:ne}=N(G.isDebitCardFeatureEnabled),A=z(n=>n.tenantState.fetchState),j=z(n=>n.tenantState.activeTenantFetchState.fetchState),h=j==="Completed"||A==="Completed"?ds(ne,r):void 0,X=j==="Completed"||A==="Completed"?cs(r):void 0,He=Ys(r,ke,ne),{isCardsHidden:Be}=Ws(r?.tenantId),Ve=!He||!!Be,{isFeatureEnabled:Se}=N(G.isSettingsFeatureEnabled),{isFeatureEnabled:J}=N(G.isAiCfoFileUploadEnabled),Y=z(n=>ms(n));if(i!=null){const n=b.getSignedInUserTenant(i);I!=null&&n!=null&&fe(I,r,L)}const M={tenantId:v,userId:I?.userId,sessionId:I?.zeniSessionId},ae=_s(),E=qs(),Ne=r.company==null||E?.loggedInUserRoleMap!=null&&pe(E.loggedInUserRole),Ze=hs(E?.loggedInUserRoleMap),oe=O.useRef(!0),re=Te("/:tenantEmailDomain/onboarding/*")!==null,K=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Me=z(n=>M.tenantId!=null?Es(n,M.tenantId):void 0);O.useEffect(()=>{U(F.TENANT_FETCHING),o(i)},[i]),O.useEffect(()=>{if(K!=null&&v!=null){const n=K.params.selectedPeriod;if(n!=null){const f=n.split("-");if(f.length===2){const d=ps(Number(f[0])),s=Number(f[1]),c=Rs(`01-${d<10?`0${d}`:d}-${s}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),S=xs();c.isAfter(S,"month")===!1?T(gs(v,{month:d,year:s})):B("./month_end_close_checks/review")}}}},[K,v]),O.useEffect(()=>{V||(Pe(!0),U(F.TENANT_FETCHING)),oe.current?oe.current=!1:!Is(ae,M)&&b.isSignedIn()&&(U(F.TENANT_FETCHING),function(n,f,d,s){if(xe(f?.userId,f?.zeniSessionId,n.tenantId),d(Ls(!0)),d(ge(n.tenantId)),n.tenantId!=null&&_.clearTenant(n.tenantId),n.tenantId!=null){const c=b.getSignedInUserTenantWithId(n.tenantId);s&&Ae.updateAppLocaleID(Js(s)),c?.tenantEmailDomain!=null&&b.saveActiveTenantDomainForUser(c?.tenantEmailDomain)}n.userId!=null?Q.identify(n.userId,{tenant_id:n.tenantId}):Q.resetUserIdentity()}(M,I,T,Me))},[M,ae,I,T,b]),O.useEffect(()=>{b.isSignedIn()&&(U(F.TENANT_FETCHING),function(n,f,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(ge(s));const q=b.getSignedInUserTenantWithId(s);q?.tenantEmailDomain!=null&&b.saveActiveTenantDomainForUser(q?.tenantEmailDomain),xe(c?.userId,c?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),H(Ie(c.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),H(je(c.userId,s)))}else W&&rs&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),H(Ie(c.userId,s))),W&&is&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),H(je(c.userId,s)));if(W){Q.identify(c.userId,{tenant_id:s});const q=s==null||s!=null&&(f==="Completed"||f==="Error");n==="Completed"||f!=="Not-Started"&&f!=="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(Re(c.userId,c.zeniSessionId)))}}(A,j,r,v,I,U,T))},[v,j]),O.useEffect(()=>{b.isSignedIn()&&A==="Completed"&&Y.tenantsBaseInOrder.length>0&&(k(F.TENANT_FETCHING),b.saveSignedInUserTenants(js(Y.tenantsBaseInOrder)),I!=null&&fe(I,r,L,void 0,Y.tenantsBaseInOrder))},[Y,A,r,I]),O.useEffect(()=>{j==="In-Progress"&&U(F.TENANT_FETCHING),j!=="Completed"&&j!=="Error"||(j==="Completed"&&v!=null?(C(),_.markActiveTenantFetchCompleted(v)):j==="Error"&&v!=null&&(_.markActiveTenantFetchFailed(v),k(F.TENANT_FETCHING),k(F.TENANT_SWITCHING))),A!=="Completed"&&A!=="Error"||(A==="Completed"?_.markAllTenantsFetchCompleted():A==="Error"&&_.markAllTenantsFetchFailed())},[j,A,v,V]);const ie=O.useRef(!1);O.useEffect(()=>{!ie.current&&j==="Completed"&&V&&(ie.current=!0,function(n=Qs,f=3e3){setTimeout(()=>{const d=s=>{if(s>=n.length)return;const c=n[s],S=Ks[c];S!=null?S().then(()=>ee(()=>d(s+1))).catch(()=>ee(()=>d(s+1))):d(s+1)};ee(()=>d(0))},f)}())},[j,V]);const w=r?.userRole!=null&&Ts(r?.userRole),{isFeatureEnabled:ze}=N(G.isReferralFeatureEnabled),Ge=r?.userRole!=null&&r.userRole.includes("charge_card_user"),$e=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),P=r?.userRole!=null&&pe(r.userRole),le=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!w,ue=!Ve&&!w,Ye=As(E?.loggedInUserRoleMap),We=r.externalConnections?.accounting[0]?.isValid,de=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!w,me=ce&&fs(E?.loggedInUserRoleMap),_e=Fe&&!w,qe=Le&&!w,Xe=le&&bs(E?.loggedInUserRoleMap),Je=ue&&Ds(E?.loggedInUserRoleMap),Ke=_e&&ys(E?.loggedInUserRoleMap),Qe=Cs(E?.loggedInUserRoleMap),es=vs(E?.loggedInUserRoleMap),ss=Us(E?.loggedInUserRoleMap),ts=ws(E?.loggedInUserRoleMap),ns=Os(E?.loggedInUserRoleMap),p=Ps(E?.loggedInUserRoleMap),R=Fs(E?.loggedInUserRoleMap),he=le&&p,Ee=ce&&R,x=_e&&ss,g=qe&&ts,m=ue&&ns,as=r.excludedResources?.resources?.find(n=>n.resource==="/invites")!=null||Ze===!0||Ye===!0||Qe===!0||es===!0;return b.isSignedIn()?v==null?A==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...$.state,message:"...",origin:$.pathname}}):(I!=null&&A!=="In-Progress"&&T(Re(I.userId,I.zeniSessionId)),null):j!=="In-Progress"&&j!=="Not-Started"||A==="Completed"?(de===!0||se&&!re)&&We===!1&&h===!1&&X===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!V||de!==!1||re||se?V&&r?.userRole&&h!=null&&X!=null&&i!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(Ns,{children:e.jsxs(a,{element:e.jsx(Xs,{}),children:[e.jsx(a,{path:"/",element:e.jsx(It,{isDashboardAccess:P,showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,isTenantCardsOnly:X,showChargeCardRoute:m})}),e.jsx(a,{path:"dashboard/*",element:P?e.jsx(it,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reports/*",element:P?e.jsx(et,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"people/*",element:as||P?e.jsx(tt,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"forecast/*",element:P?e.jsx(nt,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"onboarding/*",element:e.jsx(at,{})}),e.jsx(a,{path:"transaction/*",element:P&&w===!1||Ge||$e?e.jsx(rt,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"transactions/*",element:P&&w===!1?e.jsx(ct,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"customer/*",element:P&&w===!1?e.jsx(be,{entityType:"customer"}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,isTenantBankingOnly:h,showTreasuryRoute:g,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"vendor/*",element:P&&w===!1?e.jsx(be,{entityType:"vendor"}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,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(Rt,{})}),e.jsx(a,{path:"address/*",element:Xe||me||Ke||Je?e.jsx(st,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"checking/*",element:x?e.jsx(ut,{}):e.jsx(y,{})}),e.jsx(a,{path:"treasury/*",element:g?e.jsx(dt,{}):e.jsx(y,{})}),e.jsx(a,{path:"performance",element:te===!0?e.jsx(ht,{}):e.jsx(Oe,{tenantEmailDomain:i})}),e.jsx(a,{path:"month_end_close_checks/review/*",element:te===!0&&w===!1?e.jsx(Et,{}):e.jsx(Oe,{tenantEmailDomain:i})}),e.jsx(a,{path:"notifications/*",element:e.jsx(_t,{})}),e.jsx(a,{path:"vendors/*",element:Ne?e.jsx(ot,{}):e.jsx(y,{})}),e.jsx(a,{path:"bill/*",element:he?e.jsx(De,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"bills/*",element:he?e.jsx(De,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursement/*",element:Ee?e.jsx(ye,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursements/*",element:Ee?e.jsx(ye,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:p,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"settings/*",element:Se?e.jsx(lt,{hasAdminLevelAccess:me}):e.jsx(y,{})}),e.jsx(a,{path:"cards/ask",element:m&&Z?e.jsx(Ce,{isFileUploadEnabled:J}):e.jsx(y,{})}),e.jsx(a,{path:"cards/ask/:session_id",element:m&&Z?e.jsx(Ce,{isFileUploadEnabled:J}):e.jsx(y,{})}),e.jsx(a,{path:"cards/*",element:m?e.jsx(mt,{}):e.jsx(y,{})}),e.jsx(a,{path:"rewards/*",element:ze?e.jsx(pt,{}):e.jsx(y,{})}),e.jsx(a,{path:"/ai-cfo",element:Z?e.jsx(u,{to:"explore"}):e.jsx(y,{})}),e.jsx(a,{path:"/ai-cfo/",element:Z?e.jsx(u,{to:"explore"}):e.jsx(y,{})}),e.jsx(a,{path:"/ai-cfo/:session_id",element:Z?e.jsx(xt,{isFileUploadEnabled:J}):e.jsx(y,{})}),e.jsx(a,{path:"*",element:e.jsx(y,{})})]})}):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:B,isUserHasReimbursementAccess:i,showTreasuryRoute:L,isTenantBankingOnly:U,isTenantCardsOnly:C,showChargeCardRoute:k})=>{if(U===!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 C===!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"}):B?e.jsx(u,{to:"bills"}):i?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},D=({showZeniAccountRoute:o,isUserHasBillPayAccess:T,isUserHasReimbursementAccess:B,showTreasuryRoute:i,isTenantBankingOnly:L,showChargeCardRoute:U,tenantEmailDomain:C})=>{if(L===!0){if(o)return e.jsx(Ue,{tenantEmailDomain:C});if(i)return e.jsx(ve,{tenantEmailDomain:C});if(U)return e.jsx(we,{tenantEmailDomain:C})}return o?e.jsx(Ue,{tenantEmailDomain:C}):i?e.jsx(ve,{tenantEmailDomain:C}):U?e.jsx(we,{tenantEmailDomain:C}):T?e.jsx(Tt,{tenantEmailDomain:C}):B?e.jsx(jt,{tenantEmailDomain:C}):e.jsx(y,{})},jt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/reimbursements`}),Tt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/bills`}),ve=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/treasury`}),Ue=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/checking`}),we=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/cards`}),Oe=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/dashboard`});export{D as FallBackRoute,St as default};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import{j as o}from"./liveblocks-4PIBJMyE.js";import{a as u}from"./sentry-CXcgkCeA.js";import{h as L,g as Q,u as U,j as S,s as re,n as H,i as Z,o as ne,p as v}from"./core-Ca6G0voE.js";import{bn as De,eX as P,gp as Me,m$ as le,Of as Te,hF as he,O6 as Ue,qR as _e,kx as be,mX as Be,hH as Fe,O8 as Re,O7 as Oe,Qy as Ve,zi as ze,EL as Le,Q7 as Ne,Qg as $e,c6 as ae,cL as Qe,cM as He,bs as Ze,M7 as Ge,xK as Ke,Qz as Xe,Ha as qe,Er as Je,Ei as Se,Ef as We,xO as ye,El as Ce,Eo as Ie,Eu as oe,ub as se,xN as Ye,k9 as J,kc as Ee,QA as en,ld as nn,y1 as tn,M_ as an,M$ as on,k7 as sn,QB as cn,ka as rn,rj as ln,MV as dn,MW as un,rn as pn,hq as gn,Mf as ee,hi as de,hf as mn,hn as fn,Mg as hn,x_ as bn,QC as Sn,QD as yn,EI as Cn,fC as Ae,fE as xe,QE as In,gd as En,Mp as An,xZ as ue,gi as pe,gh as xn,xY as vn,gg as kn,gf as wn,QF as jn,fH as ve,QG as Pn,QH as Dn,y4 as Mn,xX as ge,QI as Tn,fX as Un,xU as _n,bZ as Bn,c5 as Fn,c4 as Rn,b_ as On,c2 as Vn,c1 as zn,c0 as Ln,c3 as Nn,b$ as $n}from"./zeni-epic-state-BIxjj87B.js";import{C as W,U as O,z as w,ag as ke,bT as Qn,e as G,g as Hn,bE as Zn,j as K,B as ie,bU as Gn,i as we,M as je,bV as Kn,ar as Xn,k as Pe,bW as qn,bX as Jn,bY as Wn,_ as Yn,bZ as et,s as nt,b_ as tt}from"./index-DD9OmSLj.js";import{n as V}from"./mui-BI3ZId9r.js";import{M as F}from"./MobileAppDrawer-CNkPd-0r.js";import{a as X,g as q,m as at}from"./accountMappingHelper-COLWfB1U.js";import{t as ot,A as st}from"./AddressScreen-Cgf_DSfy.js";import $ from"./NotFoundScreen-C4hj38o6.js";import{g as it}from"./analyticsHelper-B2nQzr20.js";import{B as ct}from"./BusinessVerificationPageScreen-BVO4LcOB.js";import{C as rt}from"./CompanyPassportScreen-Cr6_STQF.js";import{u as lt,a as dt}from"./useEmailConnectResultRefresh-CMs316dl.js";import{q as me}from"./QBOConnectionScreen-B3-UhwG_.js";import{B as ut}from"./BillPayApprovalRoutes-Bufqh5bf.js";import{R as pt}from"./ReimbursementApprovalRoutes-DJ6r8--7.js";import"./recharts-D6NnjcYi.js";import"./analytics-dJ9Vu0DH.js";import"./plaid-BFzM5Kog.js";import"./dnd-Be5WoH8E.js";import"./stripe-DMRn4zHo.js";import"./lottie-B7am_Gp2.js";import"./lexical-DTpvAJin.js";import"./pdf-DUHWpwzW.js";import"./utils-DFP_hVXq.js";import"./routePaths-BumbtdKN.js";import"./empty-uy3M1msm.js";import"./pdf-lib-DyNMbFeB.js";import"./index-Dcmv7y8l.js";import"./url-DVO5HPAn.js";import"./index-D3FowIif.js";import"./decodeURIComponentSafe-BMcEUj25.js";import"./ReimbursementApprovalRuleDetailScreen-CGou3dCd.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]="6aa29a12-6860-4bc4-ab54-316552d81a8f",e._sentryDebugIdIdentifier="sentry-dbid-6aa29a12-6860-4bc4-ab54-316552d81a8f")}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:_e(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:r}=a;return{onAccountMappingChange:n=>{const{uncategorizedAccountSection:t,billsAccountSection:i,reimbursementsAccountSection:p,vendorsAccountSection:m,filing1099Section:f}=n,{incomeAccount:y,expenseAccount:g}=t,{billPayAccount:l}=i,{reimbursementsAccount:b}=p,{prepaidExpensesAccount:I,fixedAssetsAccount:k,accruedExpensesAccount:A}=m,{bankAccount:h,expenseCategory1099:E}=f,_=X(a.accountMappingView.incomeAccountList,y.selectedOption),M=X(a.accountMappingView.expenseAccountList,g.selectedOption),x=X(a.accountMappingView.billPayAccountList,l.selectedOption),B=X(a.accountMappingView.reimbursementsAccountList,b.selectedOption),D=q(a.accountMappingView.prepaidExpensesAccountList,I.selectedOptions),N=q(a.accountMappingView.fixedAssetsAccountList,k.selectedOptions),R=q(a.accountMappingView.accruedExpensesAccountList,A.selectedOptions),d=q(a.accountMappingView.bankAccounts1099FilingAccountList,h.selectedOptions),C=at(a.accountMappingView.expenseAccounts1099FilingAccountList,E),T={selectedIncomeAccountId:_?.accountId,selectedExpenseAccountId:M?.accountId,selectedBillPayAccountId:x?.accountId,selectedReimbursementsAccountId:B?.accountId,selectedPrepaidExpensesAccountIds:D.map(j=>j.accountId),selectedFixedAssetsAccountIds:N.map(j=>j.accountId),selectedAccruedExpensesAccountIds:R.map(j=>j.accountId),selectedBankAccounts1099FilingAccountIds:d.map(j=>j.accountId),selectedExpenseAccounts1099FilingAccountIds:C};e(Oe({data:T}))},onBackClick:()=>{ke(c)===!1?(s("../../dashboard"),e(Re())):e(he())},onSaveClick:()=>{e(Fe()),r&&G.track(Hn.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:n=>{e(Be(a.currentTenant.companyId,n))}}})(Qn),ft=()=>{const e=L(),a=Q(),s=U(),{useFeatureGate:c,useDynamicConfig:r}=W(),{isFeatureEnabled:n}=c(O.isFiling1099FeatureEnabled),{isFeatureEnabled:t}=c(O.isScheduledJEAccruedExpensesFeatureEnabled),{configValue:i,isDynamicConfigLoading:p}=r("transaction_categorization_config"),m=!p&&i?.capitalization_enabled===!0,f=w.getSignedInUser(),y=De(f),g=S(d=>P(d)),{capitalizableAccounts:l,capitalizableAccountOverrides:b,isCapitalizationThresholdSaving:I,currencySymbol:k}=S(d=>{const C=d.tenantState.currentTenantId,T=C!=null?d.tenantState.tenantsById[C]:void 0,j=Me(d.companyState,g.companyId);return{capitalizableAccounts:T?.capitalizableAccounts??null,capitalizableAccountOverrides:T?.capitalizableAccountOverrides??null,isCapitalizationThresholdSaving:d.companyViewState.passportView?.capitalizationThresholdUpdateStatus?.fetchState==="In-Progress",currencySymbol:j?.company.companyLocaleInfo?.currencySymbol??"$"}},re),A=u.useCallback((d,C)=>{s(le(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[j,Y]=T[0]??[];j!=null&&s(le(g.companyId,j,Y,void 0,Object.keys(C).length>0?C:null))},[s,g.companyId,b]),E=S(d=>Te(d.accountState),re),_=u.useMemo(()=>{const d={};for(const C of E)C.accountId!=null&&C.accountName!=null&&(d[C.accountId]=C.accountName);return d},[E]),[M,x]=u.useState(!1),[B,D]=u.useState(!1);u.useEffect(()=>{M===!1&&(s(he()),x(!0))},[M]);const N=S(d=>Ue(d)),R=d=>{D(d)};return o.jsxs(gt,{children:[o.jsx(F,{isAppContentDrawerOpen:B,handleDrawerToggle:R}),o.jsx(mt,{currentTenant:g,navigate:e,accountMappingView:N,isFiling1099FeatureEnabled:n&&y,isAccruedExpensesFeatureEnabled:t,isCapitalizationFeatureEnabled:m,capitalizableAccounts:l,accountNamesById:_,capitalizableAccountOverrides:b,currencySymbol:k,isCapitalizationThresholdSaving:I,onSaveCapitalizationAccountThreshold:A,onSaveCapitalizationAccountThresholds:h,location:a,isSettings:ke(a),onClickMenuIcon:()=>R(!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=P(e),c=Ne(e),r=$e(e),n=a.roleMap.bill_pay_admin;return{isDisabled:(ae(s?.userRole??[])||n)&&"readonly",billpayApprovalView:c,remiApproverView:r,analytics:G}},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")}}})(Gn),St=()=>{const e=L(),a=Q(),s=U(),{tenantEmailDomain:c}=Z(),[r,n]=u.useState(!1),[t,i]=u.useState(!1),[p,m]=u.useState(!1),f=S(E=>P(E)),y=S(E=>E.billPaySetupApproverViewState.fetchState),g=S(E=>E.remiSetupApproverViewState.fetchState),l=S(E=>Ve(E)),{isApprovalRulesV3Enabled:b,isLoading:I}=Zn(f?.tenantId),k=f.companyId??w.getSignedInUserTenant(c)?.companyId;if(w.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const A=K();u.useEffect(()=>{p||y!=="Not-Started"||I||(m(!0),s(ze(!0,!0,b)))},[p,y,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=E=>{n(E)};return A?.loggedInUserRoleMap!=null?o.jsxs(ht,{children:[o.jsx(F,{isAppContentDrawerOpen:r,handleDrawerToggle:h}),o.jsx(bt,{navigate:e,location:a,companyId:k,currentTenant:f,roleMap:A.loggedInUserRoleMap,onClickMenuIcon:()=>{h(!0)}})]}):o.jsx(ie,{fetchState:l.fetchState})},yt=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:r,isBillPayEnabled:n,isRemiEnabled:t,isTreasuryEnabled:i}=a,p=P(e);return{bankSetupView:Xe(e,s,n,t,c,r,i),connectedAccountProvider:p.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:G}},function(e,a){const{navigate:s,currentTenant:c,companyId:r}=a;return{onFetchLinkTokenClick:(n,t,i)=>{e(se(t,n,i))},onEstablishConnectionClick:(n,t,i)=>{e(oe(n,r,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(ye(t,n))},onUpdateAccountClick:(n,t,i,p,m)=>{e(m==="paymentAccount"?Se(n,t,i,p):We(p,n,t))},onUpdatePrimaryFundingAccount:(n,t,i)=>{e(Je(r,t,n,i))},onRemoveConnection:n=>{e(qe(n))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")}}})(Kn),It=()=>{const e=L(),a=Q(),s=U(),{tenantEmailDomain:c}=Z(),r=K(),{useFeatureGate:n}=W(),{isFeatureEnabled:t}=n(O.isChargeCardFeatureEnabled),{isFeatureEnabled:i}=n(O.isDebitCardFeatureEnabled),[p,m]=u.useState(!1),[f,y]=u.useState(!1),g=S(D=>P(D)),l=S(D=>D.settingsViewState.bankConnection.fetchState),b=Qe(g,r?.loggedInUserRoleMap),I=He(g,r?.loggedInUserRoleMap),k=g?.userRole!=null&&Ze(g.userRole),A=!!g.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!k,h=g.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!k,E=we(g,t,i),_=Ge(g,r?.loggedInUserRoleMap)&&E,{isCardsHidden:M}=je(g?.tenantId),x=g.companyId??w.getSignedInUserTenant(c)?.companyId;if(w.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");u.useEffect(()=>{f||l==="Completed"||(y(!0),s(Ke(!1)))},[f,s,l]);const B=D=>{m(D)};return b||A||I||_?o.jsxs(yt,{children:[o.jsx(F,{isAppContentDrawerOpen:p,handleDrawerToggle:B}),o.jsx(Ct,{navigate:e,location:a,companyId:x,currentTenant:g,roleMap:r.loggedInUserRoleMap,isBillPayEnabled:b,isRemiEnabled:I,isZeniAccountEnabled:A,isChargeCardEnabled:_,isChargeCardsHidden:M,isTreasuryEnabled:h,onClickMenuIcon:()=>{B(!0)}})]}):o.jsx($,{})},Et=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
|
+
`,At=H(function(e,a){const{companyId:s}=a,c=P(e),r=a.roleMap.bill_pay_admin,n=en(e,s),{uiState:t}=n,i=(ae(c?.userRole??[])||r)&&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:Pe.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:i,analytics:G}},function(e,a){const{navigate:s,currentTenant:c,companyId:r}=a;return{onFetchLinkTokenClick:(n,t)=>{e(se("billing_setup",n,t))},onEstablishConnectionClick:n=>{e(oe(n,r,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(ye("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(Se(n,t,"billing","billing_setup"))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?s("../.."):s("../")},onNavigateToDashboard:()=>{s("../dashboard")},handleCreateCardSetupIntent:n=>{e(Ee(n))},handleConfirmCardSetupIntent:n=>{e(rn(n))},updateCardPaymentModalState:n=>{e(cn({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,t,i)=>{e(sn(n,t,i))},handleFetchPaymentSources:()=>{e(J())},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=Q(),s=U(),{tenantEmailDomain:c}=Z(),[r,n]=u.useState(!1),[t,i]=u.useState(!1),[p,m]=u.useState(!1),f=S(h=>P(h)),y=S(h=>h.cardPaymentViewState),g=S(h=>h.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState),l=Xn(y.addCardPaymentSourceStatus.fetchState),b=y.addCardPaymentSourceStatus.fetchState,I=f.companyId??w.getSignedInUserTenant(c)?.companyId;if(w.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const k=K();u.useEffect(()=>{I!=null&&s(Ye(I,!1))},[I,s]),u.useEffect(()=>{t||(i(!0),s(J()))},[t,s]),u.useEffect(()=>{p||(Ee(["card"]),m(!0))},[p]),u.useEffect(()=>{l==="In-Progress"&&b==="Completed"&&s(J())},[l,b]);const A=h=>{n(h)};return k?.loggedInUserRoleMap!=null?o.jsxs(Et,{children:[o.jsx(F,{isAppContentDrawerOpen:r,handleDrawerToggle:A}),o.jsx(At,{navigate:e,location:a,companyId:I,currentTenant:f,roleMap:k.loggedInUserRoleMap,onClickMenuIcon:()=>{A(!0)},googleAPIKey:Pe.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:r,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 y="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(i)}&scope=${encodeURIComponent(y)}&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=>{G.trackIntegrationsNotifyMeClicked("Settings",i),e(pn(te,i,r))}}})(Jn),kt=()=>{const e=L(),a=U(),{tenantEmailDomain:s}=Z();lt();const[c,r]=u.useState(!1),n=S(h=>h.tenantState.fetchState),t=S(h=>P(h)),i=t.companyId??w.getSignedInUserTenant(s)?.companyId,p=w.getSignedInUser(),m=K(),f=ae(t.userRole??[]);if(p==null)throw Error("Can't access Integrations page without signing in...");u.useEffect(()=>{a(ln(te))},[a]);const[y,g]=u.useState(!1);u.useEffect(()=>{y||(g(!0),a(J()))},[y,a]);const l=h=>{r(h)},b=S(h=>dn(h,i)),I=S(h=>h.plaidAccountViewState.external_account.plaidConnectionDetails),{plaidAccounts:k,onAddPlaidAccount:A}=dt({companyId:i??t.companyId});return m?.loggedInUserRoleMap!=null?o.jsxs(wt,{children:[o.jsx(F,{isAppContentDrawerOpen:c,handleDrawerToggle:l}),o.jsx(vt,{navigate:e,onClickMenuIcon:()=>{l(!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,E])=>[h,E?.message])),deleteConnectionState:b.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:b.externalConnections?.deleteConnectionError?.message,isLoading:n==="In-Progress",plaidAccounts:k,onAddPlaidAccount:A,plaidConnectionDetails:I})]}):o.jsx(ie,{fetchState:n})},wt=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
|
+
`,jt=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
|
+
`,Pt=()=>{const e=U(),{tenantEmailDomain:a}=Z(),[s,c]=u.useState(!1),r=S(l=>P(l)).companyId??w.getSignedInUserTenant(a)?.companyId,n=w.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const t=S(l=>Sn(l,n.userId)),i=S(l=>yn(l,r,"bill_pay","user_reimbursement_account")),{plaidConnectionDetails:p}=i,m=l=>{c(l)},f=u.useCallback(l=>{e(se("user_reimbursement_account",l))},[]),y=u.useCallback(l=>{e(oe(l,r,"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(jt,{children:[o.jsx(F,{isAppContentDrawerOpen:s,handleDrawerToggle:m}),o.jsx(Wn,{plaidConnectionDetails:p,isLoading:g,myBankConnectionsView:t,onFetchLinkTokenClick:f,onEstablishConnectionClick:y,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=U(),s=L(),c=Q(),[r,n]=u.useState(!1),t=S(d=>P(d)),{tenantEmailDomain:i}=t,p=t.companyId??w.getSignedInUserTenant(i)?.companyId;if(w.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:m}=W(),f=!!t.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:y}=m(O.isChargeCardFeatureEnabled),{isFeatureEnabled:g}=m(O.isDebitCardFeatureEnabled),l=t.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",b=S(d=>be(d)),I=Ae(t),k=xe(g,t),A=!k&&b,h=we(t,y,g),{isCardsHidden:E}=je(t?.tenantId),_=!h||E,{areTenantIdsInSync:M}=Yn();u.useEffect(()=>{M&&a(In(p,A))},[p,a,A,M]);const x=S(d=>En(d,A)),B=x.fetchState==="Not-Started"||x.fetchState==="In-Progress"||p==null,D=An(t),N=!!t.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,R=d=>{n(d)};return o.jsxs(Dt,{children:[o.jsx(F,{isAppContentDrawerOpen:r,handleDrawerToggle:R}),e!=null?o.jsx(o.Fragment,{children:e}):o.jsx(et,{myProfileView:x,isAccountingClassesEnabled:b,isReimbursementDisabled:N===!1,isZeniAccountsDisabled:f===!1,isChargeCardDisabled:_,isTreasuryDisabled:l===!1,isLiteRoleDisabled:D===!1,onClickMenuIcon:()=>{R(!0)},isLoading:B,isBankingOnlyTenant:k,isCardsOnlyTenant:I,onAddressClick:d=>{const C=function(j,Y){let z=`/${j}/settings/my_profile`;return z=z.concat(`/new/${Y}`),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(wn(d,"MyProfile"))},onResendOtp:d=>{a(kn(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&&w.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=U(),a=S(l=>P(l)).companyId,s=S(l=>jn(l)),c=S(l=>ve(l)),r=w.getSignedInUser(),[n,t]=u.useState(!1),i=u.useCallback(l=>{t(l)},[]),p=u.useCallback(l=>{e(Pn(l))},[]),m=u.useCallback(()=>{r?.userEmail!=null&&e(Dn({loggedInUserEmail:r.userEmail}))},[r?.userEmail]),f=u.useCallback(()=>{e(Mn())},[]);if(r==null)throw Error("Can't access Notification Settings page without signing in...");const y=u.useCallback(()=>{const l=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ge(l,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 l=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ge(l,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:r,onRefresh:y,resetUpdateStatus:g})]})}function ga(e){const[a,s]=u.useState(!1),c=S(l=>ve(l)),r=S(l=>P(l)),n=K(),t=w.getSignedInUser(),i=U(),{useFeatureGate:p}=W(),{isFeatureEnabled:m}=p(O.isDebitCardFeatureEnabled),f=t?.userEmail==null||c.fetchState!=="Completed"||Un(c.notificationSettings,t.userEmail,m,r);u.useEffect(()=>{c.fetchState!=="In-Progress"&&c.fetchState!=="Completed"&&a===!1&&(s(!0),i(_n()))},[c.fetchState,a]);const y=xe(m,r),g=Ae(r);return c.fetchState!=="In-Progress"&&c.fetchState!=="Not-Started"||f!==!0?Bn(r)?o.jsxs(ne,{children:[Fn(n?.loggedInUserRole??[],m,r,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"accounting/*",element:o.jsx(ft,{})}),Rn(n?.loggedInUserRole??[],m,r,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"approval_rules/*",element:o.jsx(Tt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),On(r,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"my_bank_connections",element:o.jsx(Pt,{})}),Vn(r,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"bank_connections",element:o.jsx(It,{})}),zn(r,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"business_verification",element:o.jsx(ct,{productType:y?"zeni_accounts":g?"charge_cards":it(r,n?.loggedInUserRoleMap)})}),Ln(n?.loggedInUserRole??[],r,n?.loggedInUserRoleMap)&&o.jsx(v,{path:"company_details",element:o.jsx(rt,{})}),Nn(n?.loggedInUserRole??[],r)&&o.jsx(v,{path:"billing",element:o.jsx(xt,{})}),$n(n?.loggedInUserRole??[],m,r)&&o.jsx(v,{path:"integrations",element:o.jsx(kt,{})}),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(St,{})}),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};
|